@eo-sdk/client 9.2.0 → 9.3.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/app/eo-framework/actions/actions/delete-action/delete/delete.component.d.ts +2 -1
  2. package/app/eo-framework/app-shell/app-bar/app-search/app-search.component.d.ts +4 -3
  3. package/app/eo-framework/ui/signature-tab/signature-tab.component.d.ts +10 -0
  4. package/app/eo-framework-core/search/app-search.service.d.ts +5 -0
  5. package/assets/_default/config/main.json +1 -1
  6. package/assets/_default/i18n/de.json +17 -0
  7. package/assets/_default/i18n/en.json +16 -0
  8. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js +71 -61
  9. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js.map +1 -1
  10. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js +2 -2
  11. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js.map +1 -1
  12. package/bundles/eo-sdk-client.umd.js +153 -80
  13. package/bundles/eo-sdk-client.umd.js.map +1 -1
  14. package/bundles/eo-sdk-client.umd.min.js +1 -1
  15. package/bundles/eo-sdk-client.umd.min.js.map +1 -1
  16. package/eo-sdk-client.d.ts +65 -64
  17. package/eo-sdk-client.metadata.json +1 -1
  18. package/esm2015/app/eo-client/about-state/about-state.component.js +3 -3
  19. package/esm2015/app/eo-framework/actions/action-menu/action-menu.component.js +6 -5
  20. package/esm2015/app/eo-framework/actions/actions/delete-action/delete/delete.component.js +14 -6
  21. package/esm2015/app/eo-framework/app-shell/app-bar/app-search/app-search.component.js +10 -4
  22. package/esm2015/app/eo-framework/object-details/object-details.component.js +2 -2
  23. package/esm2015/app/eo-framework/object-form/object-form/form-element-table/form-element-table.component.js +2 -2
  24. package/esm2015/app/eo-framework/ui/indexdata-summary/indexdata-summary.component.js +2 -2
  25. package/esm2015/app/eo-framework/ui/signature-tab/signature-tab.component.js +35 -0
  26. package/esm2015/app/eo-framework/ui/ui.module.js +5 -2
  27. package/esm2015/app/eo-framework-core/search/app-search.service.js +15 -1
  28. package/esm2015/eo-sdk-client.js +66 -65
  29. package/esm2015/projects/eo-sdk/core/lib/service/dms/dms.service.js +6 -2
  30. package/esm2015/projects/eo-sdk/core/lib/service/search/search-query.model.js +64 -62
  31. package/esm2015/projects/eo-sdk/core/lib/service/search/search.service.js +5 -2
  32. package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js +71 -62
  33. package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js.map +1 -1
  34. package/fesm2015/eo-sdk-client.js +81 -17
  35. package/fesm2015/eo-sdk-client.js.map +1 -1
  36. package/misc/scripts/mvn-deploy.js +66 -0
  37. package/package.json +8 -2
  38. package/projects/eo-sdk/core/eo-sdk-client-projects-eo-sdk-core.metadata.json +1 -1
  39. package/projects/eo-sdk/core/lib/service/dms/dms.service.d.ts +2 -1
  40. package/projects/eo-sdk/core/lib/service/search/search-query.model.d.ts +3 -1
  41. package/projects/eo-sdk/core/package.json +1 -1
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ngx-translate/core"),require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/common/locales/de-CH"),require("@angular/common/locales/extra/de-CH"),require("@angular/common/locales/de"),require("@angular/common/locales/extra/de"),require("@angular/common/locales/ar"),require("@angular/common/locales/extra/ar"),require("@angular/common/locales/es"),require("@angular/common/locales/extra/es"),require("@angular/common/locales/pt"),require("@angular/common/locales/extra/pt"),require("@angular/common/locales/fr"),require("@angular/common/locales/extra/fr"),require("@angular/common/locales/zh"),require("@angular/common/locales/extra/zh"),require("@angular/common/locales/zh-Hant"),require("@angular/common/locales/extra/zh-Hant"),require("@angular/common/locales/lv"),require("@angular/common/locales/extra/lv"),require("@angular/common/locales/ru"),require("@angular/common/locales/extra/ru"),require("@angular/common/locales/it"),require("@angular/common/locales/extra/it"),require("@angular/common/locales/nl"),require("@angular/common/locales/extra/nl"),require("@angular/common/locales/sk"),require("@angular/common/locales/extra/sk"),require("@angular/common/locales/pl"),require("@angular/common/locales/extra/pl"),require("@angular/common/locales/uk"),require("@angular/common/locales/extra/uk"),require("@angular/common/locales/ja"),require("@angular/common/locales/extra/ja"),require("@angular/common/locales/ko"),require("@angular/common/locales/extra/ko"),require("@angular/common/locales/hi"),require("@angular/common/locales/extra/hi"),require("@angular/common/locales/bn"),require("@angular/common/locales/extra/bn"),require("@angular/common/locales/vi"),require("@angular/common/locales/extra/vi"),require("@angular/common/locales/th"),require("@angular/common/locales/extra/th"),require("@angular/common/locales/en-GB"),require("@angular/common/locales/extra/en-GB"),require("@angular/common/locales/he"),require("@angular/common/locales/extra/he"),require("moment"),require("@ngx-pwa/local-storage"),require("file-saver"),require("lodash"),require("ngx-toastr")):"function"==typeof define&&define.amd?define("@eo-sdk/client/projects/eo-sdk/core",["exports","@ngx-translate/core","@angular/core","@angular/common/http","rxjs","rxjs/operators","@angular/common","@angular/common/locales/de-CH","@angular/common/locales/extra/de-CH","@angular/common/locales/de","@angular/common/locales/extra/de","@angular/common/locales/ar","@angular/common/locales/extra/ar","@angular/common/locales/es","@angular/common/locales/extra/es","@angular/common/locales/pt","@angular/common/locales/extra/pt","@angular/common/locales/fr","@angular/common/locales/extra/fr","@angular/common/locales/zh","@angular/common/locales/extra/zh","@angular/common/locales/zh-Hant","@angular/common/locales/extra/zh-Hant","@angular/common/locales/lv","@angular/common/locales/extra/lv","@angular/common/locales/ru","@angular/common/locales/extra/ru","@angular/common/locales/it","@angular/common/locales/extra/it","@angular/common/locales/nl","@angular/common/locales/extra/nl","@angular/common/locales/sk","@angular/common/locales/extra/sk","@angular/common/locales/pl","@angular/common/locales/extra/pl","@angular/common/locales/uk","@angular/common/locales/extra/uk","@angular/common/locales/ja","@angular/common/locales/extra/ja","@angular/common/locales/ko","@angular/common/locales/extra/ko","@angular/common/locales/hi","@angular/common/locales/extra/hi","@angular/common/locales/bn","@angular/common/locales/extra/bn","@angular/common/locales/vi","@angular/common/locales/extra/vi","@angular/common/locales/th","@angular/common/locales/extra/th","@angular/common/locales/en-GB","@angular/common/locales/extra/en-GB","@angular/common/locales/he","@angular/common/locales/extra/he","moment","@ngx-pwa/local-storage","file-saver","lodash","ngx-toastr"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["eo-sdk"]=e["eo-sdk"]||{},e["eo-sdk"].client=e["eo-sdk"].client||{},e["eo-sdk"].client.projects=e["eo-sdk"].client.projects||{},e["eo-sdk"].client.projects["eo-sdk"]=e["eo-sdk"].client.projects["eo-sdk"]||{},e["eo-sdk"].client.projects["eo-sdk"].core={}),e.core,e.ng.core,e.ng.common.http,e.rxjs,e.rxjs.operators,e.ng.common,e.ng.common.locales.deCH,e.ng.common.locales.extra.deCH,e.ng.common.locales.de,e.ng.common.locales.extra.de,e.ng.common.locales.ar,e.ng.common.locales.extra.ar,e.ng.common.locales.es,e.ng.common.locales.extra.es,e.ng.common.locales.pt,e.ng.common.locales.extra.pt,e.ng.common.locales.fr,e.ng.common.locales.extra.fr,e.ng.common.locales.zh,e.ng.common.locales.extra.zh,e.ng.common.locales.zhHant,e.ng.common.locales.extra.zhHant,e.ng.common.locales.lv,e.ng.common.locales.extra.lv,e.ng.common.locales.ru,e.ng.common.locales.extra.ru,e.ng.common.locales.it,e.ng.common.locales.extra.it,e.ng.common.locales.nl,e.ng.common.locales.extra.nl,e.ng.common.locales.sk,e.ng.common.locales.extra.sk,e.ng.common.locales.pl,e.ng.common.locales.extra.pl,e.ng.common.locales.uk,e.ng.common.locales.extra.uk,e.ng.common.locales.ja,e.ng.common.locales.extra.ja,e.ng.common.locales.ko,e.ng.common.locales.extra.ko,e.ng.common.locales.hi,e.ng.common.locales.extra.hi,e.ng.common.locales.bn,e.ng.common.locales.extra.bn,e.ng.common.locales.vi,e.ng.common.locales.extra.vi,e.ng.common.locales.th,e.ng.common.locales.extra.th,e.ng.common.locales.enGB,e.ng.common.locales.extra.enGB,e.ng.common.locales.he,e.ng.common.locales.extra.he,e.momentImported,e.localStorage,e.FileSaver,e._,e.ngxToastr)}(this,(function(e,t,r,n,o,i,s,a,c,u,p,l,h,f,d,m,g,y,b,v,S,E,T,O,C,I,x,k,_,w,A,R,P,D,j,N,F,U,L,M,B,H,q,Q,G,V,J,z,Y,K,W,$,Z,X,ee,te,re,ne){"use strict";function oe(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function ie(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var se=oe(a),ae=oe(c),ce=oe(u),ue=oe(p),pe=oe(l),le=oe(h),he=oe(f),fe=oe(d),de=oe(m),me=oe(g),ge=oe(y),ye=oe(b),be=oe(v),ve=oe(S),Se=oe(E),Ee=oe(T),Te=oe(O),Oe=oe(C),Ce=oe(I),Ie=oe(x),xe=oe(k),ke=oe(_),_e=oe(w),we=oe(A),Ae=oe(R),Re=oe(P),Pe=oe(D),De=oe(j),je=oe(N),Ne=oe(F),Fe=oe(U),Ue=oe(L),Le=oe(M),Me=oe(B),Be=oe(H),He=oe(q),qe=oe(Q),Qe=oe(G),Ge=oe(V),Ve=oe(J),Je=oe(z),ze=oe(Y),Ye=oe(K),Ke=oe(W),We=oe($),$e=oe(Z),Ze=ie(X),Xe=new r.InjectionToken("CUSTOM_CONFIG"),et=new r.InjectionToken("CORE_CONFIG"),tt=function(e){this.main=["assets/_default/config/main.json","assets/_default/config/extend.json"],this.translations=["assets/_default/i18n/"],this.environment={production:!0},this.withCredentials=!1,Object.assign(this,e)};function rt(e){return function(){return e.initialize()}}tt.ctorParameters=function(){return[{type:tt,decorators:[{type:r.Inject,args:[Xe]}]}]};var nt=function(){function e(){}return e.prototype.handle=function(e){return"!missing key: "+e.key},e}(),ot=function(){function e(e,t){this.http=e,this.config=t,s.registerLocaleData(ce.default,"de",ue.default),s.registerLocaleData(pe.default,"ar",le.default),s.registerLocaleData(he.default,"es",fe.default),s.registerLocaleData(de.default,"pt",me.default),s.registerLocaleData(ge.default,"fr",ye.default),s.registerLocaleData(be.default,"zh",ve.default),s.registerLocaleData(Te.default,"lv",Oe.default),s.registerLocaleData(Ce.default,"ru",Ie.default),s.registerLocaleData(xe.default,"it",ke.default),s.registerLocaleData(_e.default,"nl",we.default),s.registerLocaleData(Ae.default,"sk",Re.default),s.registerLocaleData(Pe.default,"pl",De.default),s.registerLocaleData(je.default,"uk",Ne.default),s.registerLocaleData(Fe.default,"ja",Ue.default),s.registerLocaleData(Le.default,"ko",Me.default),s.registerLocaleData(Be.default,"hi",He.default),s.registerLocaleData(qe.default,"bn",Qe.default),s.registerLocaleData(se.default,"de-CH",ae.default),s.registerLocaleData(Se.default,"zh-Hant",Ee.default),s.registerLocaleData(Je.default,"th",ze.default),s.registerLocaleData(Ge.default,"vi",Ve.default),s.registerLocaleData(Ye.default,"en-GB",Ke.default),s.registerLocaleData(We.default,"he",$e.default)}return e.prototype.getTranslation=function(e){var t=this;return o.forkJoin(this.config.translations.map((function(r){return t.loadTranslationFile(r,e)}))).pipe(i.map((function(e){return e.reduce((function(e,t){return Object.assign(e,t)}),{})})))},e.prototype.loadTranslationFile=function(e,t){var r=this;return this.http.get(""+e+t+".json").pipe(i.catchError((function(n){return t.length>2?r.loadTranslationFile(e,t.substring(0,2)):o.of({})})))},e}();ot.ctorParameters=function(){return[{type:n.HttpClient},{type:tt,decorators:[{type:r.Inject,args:[et]}]}]};var it,st=function(){function e(e,t,r,n){this.originalError=e,this._name=t,this._message=r,this._skipNotification=n}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name||this.originalError.name||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message||this.originalError.message||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stack",{get:function(){return this.originalError.stack},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.originalError.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this.originalError.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skipNotification",{get:function(){return void 0===this._skipNotification?!!this.originalError.skipNotification:this._skipNotification},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHttpErrorResponse",{get:function(){return this.originalError.isHttpErrorResponse||this.originalError instanceof n.HttpErrorResponse},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.originalError.toString()},e}();(it=e.QueryScope||(e.QueryScope={})).ALL="all",it.CONTENT="content",it.INDEX_DATA="indexdata";var at=function(){function e(){this.types=[],this.contextFolderTypes=[],this.filters=[],this.expertMode=!1,this.searchMode=e.DEFAULT_SEARCH_MODE,this.sortOptions=[],this.resolveReference=!0,this.state=new pt,this.highlighting=!1,this.withContext=!1}return e.prototype.addType=function(e){this.types.find((function(t){return t.id===e.id}))||this.types.push(e)},e.prototype.removeType=function(e){this.types=this.types.filter((function(t){return t.id!==e.id}))},e.prototype.toggleType=function(e){this.types.find((function(t){return t.id===e.id}))?this.removeType(e):this.types.push(e)},e.prototype.addFilter=function(e){e&&(this.getFilter(e.property)?(this.removeFilter(e.property),this.filters.push(e)):this.filters.push(e))},e.prototype.removeFilter=function(e){this.filters=this.filters.filter((function(t){return t.property!==e}))},e.prototype.toggleFilter=function(e,t){this.getFilter(e.property)?(this.removeFilter(e.property),t&&this.filters.push(e)):this.filters.push(e)},e.prototype.getFilter=function(e){return this.filters.find((function(t){return t.property===e}))},e.prototype.getTableFilters=function(e){return this.filters.filter((function(t){return t.property.startsWith(e+".")}))},e.prototype.addSortOption=function(e,t,r){this.sortOptions.find((function(t){return t.field===e}))||this.sortOptions.push(new ct(e,t,r))},e.prototype.removeSortOption=function(e){this.sortOptions=this.sortOptions.filter((function(t){return t.field!==e}))},e.prototype.getQueryJson=function(t){var r={};return this.types.length>0&&(r.types=this.types.map((function(e){return"string"==typeof e?e:e.name}))),this.contextFolderTypes.length>0&&(r.contextfoldertypes=this.contextFolderTypes.map((function(e){return e.name}))),this.filters.length>0&&(r.filters={},this.filters.forEach((function(e){r.filters[e.property]=e.toQuery()}))),this.term&&(r.term=this.term),this.fields&&(r.fields=this.fields),this.name&&(r.name=this.name),this.applyOptions()&&(r.options={},r.options.scope=this.scope,this.suggest&&(r.options.suggest=!0),this.expertMode&&(r.options.expertmode=!0),r.options.resolvereference=void 0===t||t,this.searchMode!==e.DEFAULT_SEARCH_MODE&&(r.options.searchmode=this.searchMode),this.sortOptions&&this.sortOptions.length&&(r.options.sort={},this.sortOptions.forEach((function(e){r.options.sort[e.field]={order:e.order}}))),this.highlighting&&(r.options.highlighting=this.highlighting),this.withContext&&(r.options.withcontext=this.withContext)),r},e.prototype.applyOptions=function(){return this.expertMode||!!this.scope||this.suggest||this.highlighting||this.resolveReference||this.withContext||this.searchMode!==e.DEFAULT_SEARCH_MODE||this.sortOptions.length>0},e}();at.BASE_PARAMS={TYPE:"type",CREATOR:"creator",CREATED:"created",MODIFIER:"modifier",MODIFIED:"modified",FILESIZE:"filesize",FILENAME:"filename",MIMETYPEGROUP:"mimetypegroup"},at.TIME_PERIOD_BUCKETS={TODAY:"today",YESTERDAY:"yesterday",THIS_WEEK:"thisweek",LAST_WEEK:"lastweek",THIS_MONTH:"thismonth",LAST_MONTH:"lastmonth",THIS_YEAR:"thisyear",LAST_YEAR:"lastyear"},at.MIMETYPEGROUP_BUCKETS={PDF:"pdf",MAIL:"mail",WORD:"word",IMAGE:"image",OCTET_STREAM:"octet-stream",TXT:"txt",EXCEL:"excel",POWERPOINT:"powerpoint",VIDEO:"video",HTML:"html",AUDIO:"audio",ZIP:"zip"},at.FILE_SIZE_BUCKETS={LT1MB:"lt1MB",LT10MB:"lt10MB",LT100MB:"lt100MB",GT100MB:"gt100MB"},at.UPDATE_CAUSE={TOGGLED_TYPE:"cause.type.toggled",TOGGLED_EXPERTMODE:"cause.expertmode.toggled",TERM_SET:"cause.term.set",TYPES_SET:"cause.types.set",CONTEXT_FOLDER_SET:"cause.contextfolder.set",TOGGLED_FILTER:"cause.filter.toggled",ADDED_FILTER:"cause.filter.added",REMOVED_FILTER:"cause.filter.removed"},at.DEFAULT_SEARCH_MODE="idxs",at.FULLTEXT_SEARCH_MODE="fts";var ct=function(e,t,r){this.field=e,this.order=t,this.missing=r},ut=function(e,t,r,n,o,i){void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n=[]),void 0===o&&(o=[]),this.elements=e,this.sortorder=t,this.grouporder=r,this.pinned=n,this.alignmentx=o,this.mode=i},pt=function(){function e(){this.aggregations={type:new Map,contextType:new Map,created:[],modified:[],mimetypegroup:[],filesize:[]}}return Object.defineProperty(e.prototype,"totalCount",{get:function(){return Array.from(this.aggregations.type.values()).reduce((function(e,t){return e+t}),0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return!(this.count&&this.count.value)},enumerable:!1,configurable:!0}),e.prototype.addAggregations=function(e,t,r,n){switch(e){case"contexttype":this.aggregations.contextType.set(t,r);break;case at.BASE_PARAMS.TYPE:this.aggregations.type.set(t,r);break;case at.BASE_PARAMS.CREATED:this.aggregations.created.push({key:t,value:r});break;case at.BASE_PARAMS.MODIFIED:this.aggregations.modified.push({key:t,value:r});break;case at.BASE_PARAMS.MIMETYPEGROUP:this.aggregations.mimetypegroup.push({key:t,value:r});break;case at.BASE_PARAMS.FILESIZE:this.aggregations.filesize.push({key:t,value:r,from:n.from,to:n.to||1/0,label:t.replace("gt","> ").replace("lt","< ")})}},e}(),lt=function(){},ht=function(){function e(e,t,r,n,o){this.property=e,this.operator=t,this.firstValue=r,this.secondValue=n,this.transformDate=o}return e.prototype.formatDate=function(e){return this.transformDate&&e?this.transformDate.timezone?new s.DatePipe("en").transform(e,"yyyy-MM-ddTZ"):this.transformDate.time?new Date(e).toISOString().slice(0,16)+"Z":new s.DatePipe("en").transform(e,"yyyy-MM-dd"):e},e.prototype.toQuery=function(){return Object.assign({o:this.operator,v1:this.formatDate(this.firstValue)},this.secondValue&&{v2:this.formatDate(this.secondValue)})},e.prototype.toDateTimeQuery=function(){if(this.transformDate&&this.transformDate.timezone&&this.firstValue){var t=this.firstValue,r=this.secondValue,n=new Date(r||t);if(n.setHours(23,59,59,999),this.operator===e.OPERATOR.LESS_OR_EQUAL)t=n.toISOString();else{var o=new Date(t);this.operator===e.OPERATOR.GREATER_THAN||this.operator===e.OPERATOR.INTERVAL?o.setHours(23,59,59,999):o.setHours(0,0,0,0),t=o.toISOString()}return this.operator!==e.OPERATOR.INTERVAL_INCLUDE_BOTH&&this.operator!==e.OPERATOR.EQUAL||(r=n.toISOString()),Object.assign({o:this.operator===e.OPERATOR.EQUAL?e.OPERATOR.INTERVAL_INCLUDE_BOTH:this.operator,v1:t},r&&{v2:r})}return this.toQuery()},e.prototype.match=function(e,t,r,n){return this.property===e&&this.operator===t&&this.secondValue===n&&(this.firstValue instanceof Array?!!this.firstValue.find((function(e){return e===r})):this.firstValue===r)},e}();ht.OPERATOR={EQUAL:"eq",MATCH:"match",IN:"in",GREATER_THAN:"gt",GREATER_OR_EQUAL:"gte",LESS_THAN:"lt",LESS_OR_EQUAL:"lte",INTERVAL:"gtlt",INTERVAL_INCLUDE_BOTH:"gtelte",INTERVAL_INCLUDE_TO:"gtlte",INTERVAL_INCLUDE_FROM:"gtelt",RANGE:"rg"};var ft=function(){function e(e,t,r){this.operator=e,this.firstValue=t,this.secondValue=r}return e.getOperatorLabel=function(e){var t="?";switch(e){case ht.OPERATOR.EQUAL:t="=";break;case ht.OPERATOR.GREATER_OR_EQUAL:t=">=";break;case ht.OPERATOR.LESS_OR_EQUAL:t="<=";break;case ht.OPERATOR.INTERVAL_INCLUDE_BOTH:t="-"}return t},e}(),dt=Ze,mt=function(){function e(){}return e.buildUri=function(e,t){var r=Object.keys(t).filter((function(e){return t[e]||0===t[e]||!1===t[e]})).map((function(e){return e+"="+encodeURIComponent(t[e])})).join("&");return e+(r?"?"+r:"")},e.uuid=function(){return e._p8()+e._p8(!0)+e._p8(!0)+e._p8()},e.encodeFileName=function(t){return"=?UTF-8?Q?"+e.encodeToQuotedPrintable(e.encodeToUtf8(t)).replace(/_/g,"=5F")+"?="},e._p8=function(e){var t=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+t.substr(0,4)+"-"+t.substr(4,4):t},e.encodeToUtf8=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},e.quotedPrintable=function(e){if(e>"ÿ")throw RangeError("`encodeToQuotedPrintable` expects extended ASCII input only. Missing prior UTF-8 encoding?");return"="+("0"+e.charCodeAt(0).toString(16).toUpperCase()).slice(-2)},e.encodeToQuotedPrintable=function(e){return e.replace(/[\0-\b\n-\x1F=\x7F-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/g,this.quotedPrintable)},e.sortValues=function(t,r,n,o){void 0===t&&(t=""),void 0===r&&(r="asc");return function(i,s){var a,c=e.getProperty(i,t),u=e.getProperty(s,t);if("number"==typeof c&&"number"==typeof u)a=c-u;else{var p=c||0===c?c.toString():"",l=u||0===u?u.toString():"";a=p.localeCompare(l,n,o)}return"desc"===r?-1*a:a}},e.getProperty=function(e,t){return void 0===t&&(t=""),t?t.split(".").reduce((function(e,t){return(e||{})[t]}),e):e},e.empty=function(e){return function(e){return o.EMPTY}},e.catchSkip=function(e,t,r,n){return function(i){var s=t&&t(i),a=e&&e(i);return o.throwError(new st(s instanceof Error?s:i,r,n,a))}},e.catch=function(e,t,r,n){return function(i){var s=e&&e(i);return o.throwError(new st(s instanceof Error?s:i,t,r,n))}},e.throw=function(e,t,r,n){return function(o){var i=e&&e(o);throw new st(i instanceof Error?i:o,t,r,n)}},e.logError=function(t,r,n,o){return void 0===o&&(o=!0),e.throw(t,r,n,o)},e.isVisible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},e.getBaseHref=function(){return document.getElementsByTagName("base")[0].getAttribute("href")},e.truncateString=function(e,t,r){return void 0===r&&(r="..."),e.length>t&&(t>3&&(t-=3),e=""+e.substring(0,t)+r),e},e.getTimezoneOffset=function(){return dt().format("Z")},e.formatMailTo=function(e,t){return t&&e?Array.isArray(e)?e.join().replace(/,/g,"; "):e.replace(/,/g,"; "):e},e.arrayToObject=function(e,t,r){void 0===e&&(e=[]);var n="string"==typeof t?function(e){return e[t]}:t,o="string"==typeof r?function(e){return e[r]}:r;return e.reduce((function(e,t,r){return e[n?n(t):r]=o?o(t):t,e}),{})},e.formDataStringify=function(t){return JSON.stringify(t,(function(t,r){return r instanceof ft?"/"+e.PREF_RANGEVALUE+"("+JSON.stringify(r)+")/":r}))},e.formDataParse=function(t){return JSON.parse(t,(function(t,r){if("string"==typeof r&&r.startsWith("/"+e.PREF_RANGEVALUE+"(")&&r.endsWith(")/")){r=r.substring(e.PREF_RANGEVALUE.length+2,r.length-2);var n=JSON.parse(r);return new ft(n.operator,n.firstValue,n.secondValue)}return r}))},e}();mt.PREF_RANGEVALUE="RangeValue";var gt=function(){function e(){this.eventSource=new o.Subject,this.event$=this.eventSource.asObservable()}return e.prototype.trigger=function(e,t){this.eventSource.next({type:e,data:t})},e.prototype.on=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.event$.pipe(i.filter((function(t){return t&&!!e.find((function(e){return e===t.type}))})))},e}();gt.decorators=[{type:r.Injectable}],gt.ctorParameters=function(){return[]};var yt={LOGOUT:"eo.user.logout",CLIENT_LOCALE_CHANGED:"eo.user.locale.client.changed",SCHEMA_LOCALE_CHANGED:"eo.user.locale.schema.changed",DMS_OBJECT_LOADED:"eo.dms.object.loaded",DMS_OBJECT_DELETED:"eo.dms.object.deleted",DMS_OBJECT_VERSION_RESTORED:"eo.dms.object.version.restored",DMS_OBJECT_FAVORITE_ON:"eo.dms.object.favorite.on",DMS_OBJECT_FAVORITE_OFF:"eo.dms.object.favorite.off",DMS_OBJECT_UPDATED:"eo.dms.object.updated",DMS_OBJECT_PASTED:"eo.dms.object.pasted",INBOX_ITEM_CONFIRMED:"eo.inbox.item.confirmed",PROCESS_FILE_CHANGED:"eo.process.file.changed",EO_DIALOG_STACK_CHANGED:"eo.dialog.stack.changed",SYSTEM_STATUS_SCHEMA_CHANGED:"eo.status.schema",SYSTEM_STATUS_ORG_CHANGED:"eo.status.org",SYSTEM_STATUS_SEC_CHANGED:"eo.status.sec",SYSTEM_STATUS_ACL_CHANGED:"eo.status.acl",SYSTEM_STATUS_INBOX_CHANGED:"eo.status.inbox",EO_LICENSE_GRID:"eo_license_grid",SYSTEM_STATUS_IMAGE_CHANGE:"eo.status.image"},bt=function(){function e(e,t){this.translate=e,this.event=t,this.cfg=null,this.fixServiceUris=null}return e.prototype.initializeGrid=function(){this.event.trigger(yt.EO_LICENSE_GRID)},e.prototype.set=function(e){this.cfg=e,this.fixServiceUris=new Map([["serviceBase","/rest-ws/service"],["searchBase","/search"],["contextBase","/structure"],["inboxBase","/inboxservice"],["bpmBase","/bpm"],["agentBase","/agent"],["statusBase","/status"]]);var t=this.getClientLocales().map((function(e){return e.iso}));this.translate.addLangs(t),this.translate.setDefaultLang(this.getDefaultClientLocale()),this.initializeGrid()},e.prototype.getLoginBase=function(){return this.getContextPath()},e.prototype.getContextPath=function(){var e=this.getUri("contextPath")||this.getUri("loginBase");return e&&"/"!==e?e:""},e.prototype.getRaw=function(e){return e?mt.getProperty(this.cfg,e):this.cfg},e.prototype.getUri=function(e){return this.cfg.uri&&this.cfg.uri[e]||this.fixServiceUris.get(e)},e.prototype.getClientLocales=function(){return this.cfg.languages},e.prototype.getSupportedClientLocales=function(){return["en","de","ar","es","pt","fr","zh","lv","ru","it","nl","sk","pl","uk","ja","ko","hi","bn","de-CH","zh-Hant","th","vi","en-GB","he"]},e.prototype.getDashboardBackgroundImage=function(){return this.cfg.dashboardBackgroundImage},e.prototype.getSideBarHeaderImage=function(){return this.cfg.sideBarHeaderImage},e.prototype.getNavigationBarImage=function(){var e=this.cfg.navBarLogo;return e=e.endsWith(".svg")?e:"<svg></svg>"},e.prototype.getDefaultClientLocale=function(){var e=this.getClientLocales().find((function(e){return e.fallback}));return e?e.iso:"en"},e.prototype.getAgentConfig=function(){return this.cfg.agent},e}();bt.decorators=[{type:r.Injectable}],bt.ctorParameters=function(){return[{type:t.TranslateService},{type:gt}]};var vt=function(){function e(e,t){var r=this;this.storage=e,this.storageMap=t,this.SYSTEM_DEFINITION="eo.framework.cache.systemdefinition",this.HOSTS="eo.framework.cache.hosts",this.LOCATION_HISTORY="eo.framework.cache.locations.history",this.itemsMap=new Map,window._ngStorageRefresh=function(){return r.getStorage().subscribe((function(e){return r.setStorage(e).subscribe()&&console.log(e)}))}}return e.prototype.setItem=function(e,t,r){var n=this;if(void 0===r&&(r=500),r){if(!this.itemsMap.has(e)){var s=new o.Subject;s.pipe(i.debounceTime(r),i.switchMap((function(t){return n.storage.setItem(e,t)}))).subscribe(),this.itemsMap.set(e,s)}return this.itemsMap.get(e).next(t),o.of(!0)}return this.storage.setItem(e,t)},e.prototype.getItem=function(e){return this.storage.getItem(e).pipe(i.map((function(e){return"value"===Object.keys(e||{}).join()?e.value:e})))},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.clear=function(e){var t=this;return e?this.getStorageKeys().pipe(i.switchMap((function(r){var n=r.filter((function(t){return e(t)})).map((function(e){return t.removeItem(e)}));return n.length?o.forkJoin(n).pipe(i.map((function(){return!0}))):o.of(!0)}))):this.storage.clear()},e.prototype.getStorageKeys=function(){var e=this;return new o.Observable((function(t){var r=[];e.storageMap.keys().subscribe({next:function(e){return r.push(e)},complete:function(){return t.next(r)}})})).pipe(i.first())},e.prototype.getStorage=function(){var e=this;return this.getStorageKeys().pipe(i.switchMap((function(t){return t.length?o.forkJoin(mt.arrayToObject(t,(function(e){return e}),(function(t){return e.getItem(t)}))):o.of({})})))},e.prototype.setStorage=function(e){var t=this;return o.forkJoin(Object.keys(e||{}).map((function(r){return t.setItem(r,e[r])})))},e}();vt.decorators=[{type:r.Injectable}],vt.ctorParameters=function(){return[{type:ee.LocalStorage},{type:ee.StorageMap}]};var St=function(){function e(e){var t=e.user,r=e.schema;this.id=t.id,this.name=t.name,this.firstname=t.firstname,this.lastname=t.lastname,this.title=t.title,this.email=t.email,this.present=t.present,!0===t.hasimage&&(this.imageUri="/organization/image/"+this.id),this.userSettings="object"==typeof e.usersettings?e.usersettings:{},this.schema={version:r.version,supportedLocales:r.supportedlocales},this.privileges=t.privileges,this.roles=t.effectiveroles,this.deputies=t.deputies||[],this.substitutesOf=t.substitutesOf||[],this.schemaLocale=t.locale||this.getClientLocale()}return e.prototype.hasPrivilege=function(e){var t=!1;if(this.privileges)for(var r=0;!t&&r<this.privileges.length;)t=this.privileges[r].name===e,r++;return t},e.prototype.hasRole=function(e){var t=!1;if(this.roles)for(var r=0;!t&&r<this.roles.length;)t=this.roles[r].name===e,r++;return t},e.prototype.setImageBase=function(e){this.imageUri&&(this.imageUri=e+this.imageUri)},e.prototype.getClientLocale=function(){return this.userSettings.clientlocale||"en"},e.prototype.getSchemaLocale=function(){return this.schemaLocale},e}(),Et=function(e,t){return(Et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ngx-translate/core"),require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/common/locales/de-CH"),require("@angular/common/locales/extra/de-CH"),require("@angular/common/locales/de"),require("@angular/common/locales/extra/de"),require("@angular/common/locales/ar"),require("@angular/common/locales/extra/ar"),require("@angular/common/locales/es"),require("@angular/common/locales/extra/es"),require("@angular/common/locales/pt"),require("@angular/common/locales/extra/pt"),require("@angular/common/locales/fr"),require("@angular/common/locales/extra/fr"),require("@angular/common/locales/zh"),require("@angular/common/locales/extra/zh"),require("@angular/common/locales/zh-Hant"),require("@angular/common/locales/extra/zh-Hant"),require("@angular/common/locales/lv"),require("@angular/common/locales/extra/lv"),require("@angular/common/locales/ru"),require("@angular/common/locales/extra/ru"),require("@angular/common/locales/it"),require("@angular/common/locales/extra/it"),require("@angular/common/locales/nl"),require("@angular/common/locales/extra/nl"),require("@angular/common/locales/sk"),require("@angular/common/locales/extra/sk"),require("@angular/common/locales/pl"),require("@angular/common/locales/extra/pl"),require("@angular/common/locales/uk"),require("@angular/common/locales/extra/uk"),require("@angular/common/locales/ja"),require("@angular/common/locales/extra/ja"),require("@angular/common/locales/ko"),require("@angular/common/locales/extra/ko"),require("@angular/common/locales/hi"),require("@angular/common/locales/extra/hi"),require("@angular/common/locales/bn"),require("@angular/common/locales/extra/bn"),require("@angular/common/locales/vi"),require("@angular/common/locales/extra/vi"),require("@angular/common/locales/th"),require("@angular/common/locales/extra/th"),require("@angular/common/locales/en-GB"),require("@angular/common/locales/extra/en-GB"),require("@angular/common/locales/he"),require("@angular/common/locales/extra/he"),require("moment"),require("@ngx-pwa/local-storage"),require("file-saver"),require("lodash"),require("ngx-toastr")):"function"==typeof define&&define.amd?define("@eo-sdk/client/projects/eo-sdk/core",["exports","@ngx-translate/core","@angular/core","@angular/common/http","rxjs","rxjs/operators","@angular/common","@angular/common/locales/de-CH","@angular/common/locales/extra/de-CH","@angular/common/locales/de","@angular/common/locales/extra/de","@angular/common/locales/ar","@angular/common/locales/extra/ar","@angular/common/locales/es","@angular/common/locales/extra/es","@angular/common/locales/pt","@angular/common/locales/extra/pt","@angular/common/locales/fr","@angular/common/locales/extra/fr","@angular/common/locales/zh","@angular/common/locales/extra/zh","@angular/common/locales/zh-Hant","@angular/common/locales/extra/zh-Hant","@angular/common/locales/lv","@angular/common/locales/extra/lv","@angular/common/locales/ru","@angular/common/locales/extra/ru","@angular/common/locales/it","@angular/common/locales/extra/it","@angular/common/locales/nl","@angular/common/locales/extra/nl","@angular/common/locales/sk","@angular/common/locales/extra/sk","@angular/common/locales/pl","@angular/common/locales/extra/pl","@angular/common/locales/uk","@angular/common/locales/extra/uk","@angular/common/locales/ja","@angular/common/locales/extra/ja","@angular/common/locales/ko","@angular/common/locales/extra/ko","@angular/common/locales/hi","@angular/common/locales/extra/hi","@angular/common/locales/bn","@angular/common/locales/extra/bn","@angular/common/locales/vi","@angular/common/locales/extra/vi","@angular/common/locales/th","@angular/common/locales/extra/th","@angular/common/locales/en-GB","@angular/common/locales/extra/en-GB","@angular/common/locales/he","@angular/common/locales/extra/he","moment","@ngx-pwa/local-storage","file-saver","lodash","ngx-toastr"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["eo-sdk"]=e["eo-sdk"]||{},e["eo-sdk"].client=e["eo-sdk"].client||{},e["eo-sdk"].client.projects=e["eo-sdk"].client.projects||{},e["eo-sdk"].client.projects["eo-sdk"]=e["eo-sdk"].client.projects["eo-sdk"]||{},e["eo-sdk"].client.projects["eo-sdk"].core={}),e.core,e.ng.core,e.ng.common.http,e.rxjs,e.rxjs.operators,e.ng.common,e.ng.common.locales.deCH,e.ng.common.locales.extra.deCH,e.ng.common.locales.de,e.ng.common.locales.extra.de,e.ng.common.locales.ar,e.ng.common.locales.extra.ar,e.ng.common.locales.es,e.ng.common.locales.extra.es,e.ng.common.locales.pt,e.ng.common.locales.extra.pt,e.ng.common.locales.fr,e.ng.common.locales.extra.fr,e.ng.common.locales.zh,e.ng.common.locales.extra.zh,e.ng.common.locales.zhHant,e.ng.common.locales.extra.zhHant,e.ng.common.locales.lv,e.ng.common.locales.extra.lv,e.ng.common.locales.ru,e.ng.common.locales.extra.ru,e.ng.common.locales.it,e.ng.common.locales.extra.it,e.ng.common.locales.nl,e.ng.common.locales.extra.nl,e.ng.common.locales.sk,e.ng.common.locales.extra.sk,e.ng.common.locales.pl,e.ng.common.locales.extra.pl,e.ng.common.locales.uk,e.ng.common.locales.extra.uk,e.ng.common.locales.ja,e.ng.common.locales.extra.ja,e.ng.common.locales.ko,e.ng.common.locales.extra.ko,e.ng.common.locales.hi,e.ng.common.locales.extra.hi,e.ng.common.locales.bn,e.ng.common.locales.extra.bn,e.ng.common.locales.vi,e.ng.common.locales.extra.vi,e.ng.common.locales.th,e.ng.common.locales.extra.th,e.ng.common.locales.enGB,e.ng.common.locales.extra.enGB,e.ng.common.locales.he,e.ng.common.locales.extra.he,e.momentImported,e.localStorage,e.FileSaver,e._,e.ngxToastr)}(this,(function(e,t,r,n,o,i,s,a,c,u,p,l,h,f,d,m,g,y,b,v,S,E,T,O,C,I,x,k,_,w,A,R,P,D,j,N,F,U,L,M,B,H,q,Q,G,V,J,z,Y,K,W,$,Z,X,ee,te,re,ne){"use strict";function oe(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function ie(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var se=oe(a),ae=oe(c),ce=oe(u),ue=oe(p),pe=oe(l),le=oe(h),he=oe(f),fe=oe(d),de=oe(m),me=oe(g),ge=oe(y),ye=oe(b),be=oe(v),ve=oe(S),Se=oe(E),Ee=oe(T),Te=oe(O),Oe=oe(C),Ce=oe(I),Ie=oe(x),xe=oe(k),ke=oe(_),_e=oe(w),we=oe(A),Ae=oe(R),Re=oe(P),Pe=oe(D),De=oe(j),je=oe(N),Ne=oe(F),Fe=oe(U),Ue=oe(L),Le=oe(M),Me=oe(B),Be=oe(H),He=oe(q),qe=oe(Q),Qe=oe(G),Ge=oe(V),Ve=oe(J),Je=oe(z),ze=oe(Y),Ye=oe(K),Ke=oe(W),We=oe($),$e=oe(Z),Ze=ie(X),Xe=new r.InjectionToken("CUSTOM_CONFIG"),et=new r.InjectionToken("CORE_CONFIG"),tt=function(e){this.main=["assets/_default/config/main.json","assets/_default/config/extend.json"],this.translations=["assets/_default/i18n/"],this.environment={production:!0},this.withCredentials=!1,Object.assign(this,e)};function rt(e){return function(){return e.initialize()}}tt.ctorParameters=function(){return[{type:tt,decorators:[{type:r.Inject,args:[Xe]}]}]};var nt=function(){function e(){}return e.prototype.handle=function(e){return"!missing key: "+e.key},e}(),ot=function(){function e(e,t){this.http=e,this.config=t,s.registerLocaleData(ce.default,"de",ue.default),s.registerLocaleData(pe.default,"ar",le.default),s.registerLocaleData(he.default,"es",fe.default),s.registerLocaleData(de.default,"pt",me.default),s.registerLocaleData(ge.default,"fr",ye.default),s.registerLocaleData(be.default,"zh",ve.default),s.registerLocaleData(Te.default,"lv",Oe.default),s.registerLocaleData(Ce.default,"ru",Ie.default),s.registerLocaleData(xe.default,"it",ke.default),s.registerLocaleData(_e.default,"nl",we.default),s.registerLocaleData(Ae.default,"sk",Re.default),s.registerLocaleData(Pe.default,"pl",De.default),s.registerLocaleData(je.default,"uk",Ne.default),s.registerLocaleData(Fe.default,"ja",Ue.default),s.registerLocaleData(Le.default,"ko",Me.default),s.registerLocaleData(Be.default,"hi",He.default),s.registerLocaleData(qe.default,"bn",Qe.default),s.registerLocaleData(se.default,"de-CH",ae.default),s.registerLocaleData(Se.default,"zh-Hant",Ee.default),s.registerLocaleData(Je.default,"th",ze.default),s.registerLocaleData(Ge.default,"vi",Ve.default),s.registerLocaleData(Ye.default,"en-GB",Ke.default),s.registerLocaleData(We.default,"he",$e.default)}return e.prototype.getTranslation=function(e){var t=this;return o.forkJoin(this.config.translations.map((function(r){return t.loadTranslationFile(r,e)}))).pipe(i.map((function(e){return e.reduce((function(e,t){return Object.assign(e,t)}),{})})))},e.prototype.loadTranslationFile=function(e,t){var r=this;return this.http.get(""+e+t+".json").pipe(i.catchError((function(n){return t.length>2?r.loadTranslationFile(e,t.substring(0,2)):o.of({})})))},e}();ot.ctorParameters=function(){return[{type:n.HttpClient},{type:tt,decorators:[{type:r.Inject,args:[et]}]}]};var it,st=function(){function e(e,t,r,n){this.originalError=e,this._name=t,this._message=r,this._skipNotification=n}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name||this.originalError.name||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message||this.originalError.message||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stack",{get:function(){return this.originalError.stack},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.originalError.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this.originalError.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skipNotification",{get:function(){return void 0===this._skipNotification?!!this.originalError.skipNotification:this._skipNotification},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHttpErrorResponse",{get:function(){return this.originalError.isHttpErrorResponse||this.originalError instanceof n.HttpErrorResponse},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.originalError.toString()},e}();(it=e.QueryScope||(e.QueryScope={})).ALL="all",it.CONTENT="content",it.INDEX_DATA="indexdata";var at=function(){function e(){this.types=[],this.contextFolderTypes=[],this.filters=[],this.expertMode=!1,this.searchMode=e.DEFAULT_SEARCH_MODE,this.sortOptions=[],this.resolveReference=!0,this.state=new pt,this.highlighting=!1,this.withContext=!1}return e.prototype.addType=function(e){this.types.find((function(t){return t.id===e.id}))||this.types.push(e)},e.prototype.removeType=function(e){this.types=this.types.filter((function(t){return t.id!==e.id}))},e.prototype.toggleType=function(e){this.types.find((function(t){return t.id===e.id}))?this.removeType(e):this.types.push(e)},e.prototype.addFilter=function(e){e&&(this.getFilter(e.property)?(this.removeFilter(e.property),this.filters.push(e)):this.filters.push(e))},e.prototype.removeFilter=function(e){this.filters=this.filters.filter((function(t){return t.property!==e}))},e.prototype.toggleFilter=function(e,t){this.getFilter(e.property)?(this.removeFilter(e.property),t&&this.filters.push(e)):this.filters.push(e)},e.prototype.getFilter=function(e){return this.filters.find((function(t){return t.property===e}))},e.prototype.getTableFilters=function(e){return this.filters.filter((function(t){return t.property.startsWith(e+".")}))},e.prototype.addSortOption=function(e,t,r){this.sortOptions.find((function(t){return t.field===e}))||this.sortOptions.push(new ct(e,t,r))},e.prototype.removeSortOption=function(e){this.sortOptions=this.sortOptions.filter((function(t){return t.field!==e}))},e.prototype.getQueryJson=function(t){var r={};return this.types.length>0&&(r.types=this.types.map((function(e){return"string"==typeof e?e:e.name}))),this.contextFolderTypes.length>0&&(r.contextfoldertypes=this.contextFolderTypes.map((function(e){return e.name}))),this.filters.length>0&&(r.filters={},this.filters.forEach((function(e){r.filters[e.property]=e.toQuery()}))),this.term&&(r.term=this.term),this.fields&&(r.fields=this.fields),this.name&&(r.name=this.name),this.applyOptions()&&(r.options={},r.options.scope=this.scope,this.suggest&&(r.options.suggest=!0),this.expertMode&&(r.options.expertmode=!0),r.options.resolvereference=void 0===t||t,this.searchMode!==e.DEFAULT_SEARCH_MODE&&(r.options.searchmode=this.searchMode),this.sortOptions&&this.sortOptions.length&&(r.options.sort={},this.sortOptions.forEach((function(e){r.options.sort[e.field]={order:e.order}}))),this.highlighting&&(r.options.highlighting=this.highlighting),this.withContext&&(r.options.withcontext=this.withContext)),r},e.prototype.applyOptions=function(){return this.expertMode||!!this.scope||this.suggest||this.highlighting||this.resolveReference||this.withContext||this.searchMode!==e.DEFAULT_SEARCH_MODE||this.sortOptions.length>0},e}();at.BASE_PARAMS={TYPE:"type",CREATOR:"creator",CREATED:"created",MODIFIER:"modifier",MODIFIED:"modified",FILESIZE:"filesize",FILENAME:"filename",MIMETYPEGROUP:"mimetypegroup",FOLDER:"folder"},at.TIME_PERIOD_BUCKETS={TODAY:"today",YESTERDAY:"yesterday",THIS_WEEK:"thisweek",LAST_WEEK:"lastweek",THIS_MONTH:"thismonth",LAST_MONTH:"lastmonth",THIS_YEAR:"thisyear",LAST_YEAR:"lastyear"},at.MIMETYPEGROUP_BUCKETS={PDF:"pdf",MAIL:"mail",WORD:"word",IMAGE:"image",OCTET_STREAM:"octet-stream",TXT:"txt",EXCEL:"excel",POWERPOINT:"powerpoint",VIDEO:"video",HTML:"html",AUDIO:"audio",ZIP:"zip"},at.FILE_SIZE_BUCKETS={NONE:"none",LT1MB:"lt1MB",LT10MB:"lt10MB",LT100MB:"lt100MB",GT100MB:"gt100MB"},at.UPDATE_CAUSE={TOGGLED_TYPE:"cause.type.toggled",TOGGLED_EXPERTMODE:"cause.expertmode.toggled",TERM_SET:"cause.term.set",TYPES_SET:"cause.types.set",CONTEXT_FOLDER_SET:"cause.contextfolder.set",TOGGLED_FILTER:"cause.filter.toggled",ADDED_FILTER:"cause.filter.added",REMOVED_FILTER:"cause.filter.removed"},at.DEFAULT_SEARCH_MODE="idxs",at.FULLTEXT_SEARCH_MODE="fts";var ct=function(e,t,r){this.field=e,this.order=t,this.missing=r},ut=function(e,t,r,n,o,i){void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n=[]),void 0===o&&(o=[]),this.elements=e,this.sortorder=t,this.grouporder=r,this.pinned=n,this.alignmentx=o,this.mode=i},pt=function(){function e(){this.aggregations={type:new Map,contextType:new Map,created:[],modified:[],mimetypegroup:[],filesize:[]}}return Object.defineProperty(e.prototype,"totalCount",{get:function(){return Array.from(this.aggregations.type.values()).reduce((function(e,t){return e+t}),0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return!(this.count&&this.count.value)},enumerable:!1,configurable:!0}),e.prototype.addAggregations=function(e,t,r,n){switch(e){case"contexttype":this.aggregations.contextType.set(t,r);break;case at.BASE_PARAMS.TYPE:this.aggregations.type.set(t,r);break;case at.BASE_PARAMS.CREATED:this.aggregations.created.push({key:t,value:r});break;case at.BASE_PARAMS.MODIFIED:this.aggregations.modified.push({key:t,value:r});break;case at.BASE_PARAMS.MIMETYPEGROUP:this.aggregations.mimetypegroup.push({key:t,value:r});break;case at.BASE_PARAMS.FILESIZE:this.aggregations.filesize.push({key:t,value:r,from:n.from,to:n.to||1/0,label:t.replace("gt","> ").replace("lt","< ")})}},e}(),lt=function(){},ht=function(){function e(e,t,r,n,o){this.property=e,this.operator=t,this.firstValue=r,this.secondValue=n,this.transformDate=o}return e.prototype.formatDate=function(e){return this.transformDate&&e?this.transformDate.timezone?new s.DatePipe("en").transform(e,"yyyy-MM-ddTZ"):this.transformDate.time?new Date(e).toISOString().slice(0,16)+"Z":new s.DatePipe("en").transform(e,"yyyy-MM-dd"):e},e.prototype.toQuery=function(){return Object.assign({o:this.operator,v1:this.formatDate(this.firstValue)},this.secondValue&&{v2:this.formatDate(this.secondValue)})},e.prototype.toDateTimeQuery=function(){if(this.transformDate&&this.transformDate.timezone&&this.firstValue){var t=this.firstValue,r=this.secondValue,n=new Date(r||t);if(n.setHours(23,59,59,999),this.operator===e.OPERATOR.LESS_OR_EQUAL)t=n.toISOString();else{var o=new Date(t);this.operator===e.OPERATOR.GREATER_THAN||this.operator===e.OPERATOR.INTERVAL?o.setHours(23,59,59,999):o.setHours(0,0,0,0),t=o.toISOString()}return this.operator!==e.OPERATOR.INTERVAL_INCLUDE_BOTH&&this.operator!==e.OPERATOR.EQUAL||(r=n.toISOString()),Object.assign({o:this.operator===e.OPERATOR.EQUAL?e.OPERATOR.INTERVAL_INCLUDE_BOTH:this.operator,v1:t},r&&{v2:r})}return this.toQuery()},e.prototype.match=function(e,t,r,n){return this.property===e&&this.operator===t&&this.secondValue===n&&(this.firstValue instanceof Array?!!this.firstValue.find((function(e){return e===r})):this.firstValue===r)},e}();ht.OPERATOR={EQUAL:"eq",MATCH:"match",IN:"in",GREATER_THAN:"gt",GREATER_OR_EQUAL:"gte",LESS_THAN:"lt",LESS_OR_EQUAL:"lte",INTERVAL:"gtlt",INTERVAL_INCLUDE_BOTH:"gtelte",INTERVAL_INCLUDE_TO:"gtlte",INTERVAL_INCLUDE_FROM:"gtelt",RANGE:"rg"};var ft=function(){function e(e,t,r){this.operator=e,this.firstValue=t,this.secondValue=r}return e.getOperatorLabel=function(e){var t="?";switch(e){case ht.OPERATOR.EQUAL:t="=";break;case ht.OPERATOR.GREATER_OR_EQUAL:t=">=";break;case ht.OPERATOR.LESS_OR_EQUAL:t="<=";break;case ht.OPERATOR.INTERVAL_INCLUDE_BOTH:t="-"}return t},e}(),dt=Ze,mt=function(){function e(){}return e.buildUri=function(e,t){var r=Object.keys(t).filter((function(e){return t[e]||0===t[e]||!1===t[e]})).map((function(e){return e+"="+encodeURIComponent(t[e])})).join("&");return e+(r?"?"+r:"")},e.uuid=function(){return e._p8()+e._p8(!0)+e._p8(!0)+e._p8()},e.encodeFileName=function(t){return"=?UTF-8?Q?"+e.encodeToQuotedPrintable(e.encodeToUtf8(t)).replace(/_/g,"=5F")+"?="},e._p8=function(e){var t=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+t.substr(0,4)+"-"+t.substr(4,4):t},e.encodeToUtf8=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},e.quotedPrintable=function(e){if(e>"ÿ")throw RangeError("`encodeToQuotedPrintable` expects extended ASCII input only. Missing prior UTF-8 encoding?");return"="+("0"+e.charCodeAt(0).toString(16).toUpperCase()).slice(-2)},e.encodeToQuotedPrintable=function(e){return e.replace(/[\0-\b\n-\x1F=\x7F-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/g,this.quotedPrintable)},e.sortValues=function(t,r,n,o){void 0===t&&(t=""),void 0===r&&(r="asc");return function(i,s){var a,c=e.getProperty(i,t),u=e.getProperty(s,t);if("number"==typeof c&&"number"==typeof u)a=c-u;else{var p=c||0===c?c.toString():"",l=u||0===u?u.toString():"";a=p.localeCompare(l,n,o)}return"desc"===r?-1*a:a}},e.getProperty=function(e,t){return void 0===t&&(t=""),t?t.split(".").reduce((function(e,t){return(e||{})[t]}),e):e},e.empty=function(e){return function(e){return o.EMPTY}},e.catchSkip=function(e,t,r,n){return function(i){var s=t&&t(i),a=e&&e(i);return o.throwError(new st(s instanceof Error?s:i,r,n,a))}},e.catch=function(e,t,r,n){return function(i){var s=e&&e(i);return o.throwError(new st(s instanceof Error?s:i,t,r,n))}},e.throw=function(e,t,r,n){return function(o){var i=e&&e(o);throw new st(i instanceof Error?i:o,t,r,n)}},e.logError=function(t,r,n,o){return void 0===o&&(o=!0),e.throw(t,r,n,o)},e.isVisible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},e.getBaseHref=function(){return document.getElementsByTagName("base")[0].getAttribute("href")},e.truncateString=function(e,t,r){return void 0===r&&(r="..."),e.length>t&&(t>3&&(t-=3),e=""+e.substring(0,t)+r),e},e.getTimezoneOffset=function(){return dt().format("Z")},e.formatMailTo=function(e,t){return t&&e?Array.isArray(e)?e.join().replace(/,/g,"; "):e.replace(/,/g,"; "):e},e.arrayToObject=function(e,t,r){void 0===e&&(e=[]);var n="string"==typeof t?function(e){return e[t]}:t,o="string"==typeof r?function(e){return e[r]}:r;return e.reduce((function(e,t,r){return e[n?n(t):r]=o?o(t):t,e}),{})},e.formDataStringify=function(t){return JSON.stringify(t,(function(t,r){return r instanceof ft?"/"+e.PREF_RANGEVALUE+"("+JSON.stringify(r)+")/":r}))},e.formDataParse=function(t){return JSON.parse(t,(function(t,r){if("string"==typeof r&&r.startsWith("/"+e.PREF_RANGEVALUE+"(")&&r.endsWith(")/")){r=r.substring(e.PREF_RANGEVALUE.length+2,r.length-2);var n=JSON.parse(r);return new ft(n.operator,n.firstValue,n.secondValue)}return r}))},e}();mt.PREF_RANGEVALUE="RangeValue";var gt=function(){function e(){this.eventSource=new o.Subject,this.event$=this.eventSource.asObservable()}return e.prototype.trigger=function(e,t){this.eventSource.next({type:e,data:t})},e.prototype.on=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.event$.pipe(i.filter((function(t){return t&&!!e.find((function(e){return e===t.type}))})))},e}();gt.decorators=[{type:r.Injectable}],gt.ctorParameters=function(){return[]};var yt={LOGOUT:"eo.user.logout",CLIENT_LOCALE_CHANGED:"eo.user.locale.client.changed",SCHEMA_LOCALE_CHANGED:"eo.user.locale.schema.changed",DMS_OBJECT_LOADED:"eo.dms.object.loaded",DMS_OBJECT_DELETED:"eo.dms.object.deleted",DMS_OBJECT_VERSION_RESTORED:"eo.dms.object.version.restored",DMS_OBJECT_FAVORITE_ON:"eo.dms.object.favorite.on",DMS_OBJECT_FAVORITE_OFF:"eo.dms.object.favorite.off",DMS_OBJECT_UPDATED:"eo.dms.object.updated",DMS_OBJECT_PASTED:"eo.dms.object.pasted",INBOX_ITEM_CONFIRMED:"eo.inbox.item.confirmed",PROCESS_FILE_CHANGED:"eo.process.file.changed",EO_DIALOG_STACK_CHANGED:"eo.dialog.stack.changed",SYSTEM_STATUS_SCHEMA_CHANGED:"eo.status.schema",SYSTEM_STATUS_ORG_CHANGED:"eo.status.org",SYSTEM_STATUS_SEC_CHANGED:"eo.status.sec",SYSTEM_STATUS_ACL_CHANGED:"eo.status.acl",SYSTEM_STATUS_INBOX_CHANGED:"eo.status.inbox",EO_LICENSE_GRID:"eo_license_grid",SYSTEM_STATUS_IMAGE_CHANGE:"eo.status.image"},bt=function(){function e(e,t){this.translate=e,this.event=t,this.cfg=null,this.fixServiceUris=null}return e.prototype.initializeGrid=function(){this.event.trigger(yt.EO_LICENSE_GRID)},e.prototype.set=function(e){this.cfg=e,this.fixServiceUris=new Map([["serviceBase","/rest-ws/service"],["searchBase","/search"],["contextBase","/structure"],["inboxBase","/inboxservice"],["bpmBase","/bpm"],["agentBase","/agent"],["statusBase","/status"]]);var t=this.getClientLocales().map((function(e){return e.iso}));this.translate.addLangs(t),this.translate.setDefaultLang(this.getDefaultClientLocale()),this.initializeGrid()},e.prototype.getLoginBase=function(){return this.getContextPath()},e.prototype.getContextPath=function(){var e=this.getUri("contextPath")||this.getUri("loginBase");return e&&"/"!==e?e:""},e.prototype.getRaw=function(e){return e?mt.getProperty(this.cfg,e):this.cfg},e.prototype.getUri=function(e){return this.cfg.uri&&this.cfg.uri[e]||this.fixServiceUris.get(e)},e.prototype.getClientLocales=function(){return this.cfg.languages},e.prototype.getSupportedClientLocales=function(){return["en","de","ar","es","pt","fr","zh","lv","ru","it","nl","sk","pl","uk","ja","ko","hi","bn","de-CH","zh-Hant","th","vi","en-GB","he"]},e.prototype.getDashboardBackgroundImage=function(){return this.cfg.dashboardBackgroundImage},e.prototype.getSideBarHeaderImage=function(){return this.cfg.sideBarHeaderImage},e.prototype.getNavigationBarImage=function(){var e=this.cfg.navBarLogo;return e=e.endsWith(".svg")?e:"<svg></svg>"},e.prototype.getDefaultClientLocale=function(){var e=this.getClientLocales().find((function(e){return e.fallback}));return e?e.iso:"en"},e.prototype.getAgentConfig=function(){return this.cfg.agent},e}();bt.decorators=[{type:r.Injectable}],bt.ctorParameters=function(){return[{type:t.TranslateService},{type:gt}]};var vt=function(){function e(e,t){var r=this;this.storage=e,this.storageMap=t,this.SYSTEM_DEFINITION="eo.framework.cache.systemdefinition",this.HOSTS="eo.framework.cache.hosts",this.LOCATION_HISTORY="eo.framework.cache.locations.history",this.itemsMap=new Map,window._ngStorageRefresh=function(){return r.getStorage().subscribe((function(e){return r.setStorage(e).subscribe()&&console.log(e)}))}}return e.prototype.setItem=function(e,t,r){var n=this;if(void 0===r&&(r=500),r){if(!this.itemsMap.has(e)){var s=new o.Subject;s.pipe(i.debounceTime(r),i.switchMap((function(t){return n.storage.setItem(e,t)}))).subscribe(),this.itemsMap.set(e,s)}return this.itemsMap.get(e).next(t),o.of(!0)}return this.storage.setItem(e,t)},e.prototype.getItem=function(e){return this.storage.getItem(e).pipe(i.map((function(e){return"value"===Object.keys(e||{}).join()?e.value:e})))},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.clear=function(e){var t=this;return e?this.getStorageKeys().pipe(i.switchMap((function(r){var n=r.filter((function(t){return e(t)})).map((function(e){return t.removeItem(e)}));return n.length?o.forkJoin(n).pipe(i.map((function(){return!0}))):o.of(!0)}))):this.storage.clear()},e.prototype.getStorageKeys=function(){var e=this;return new o.Observable((function(t){var r=[];e.storageMap.keys().subscribe({next:function(e){return r.push(e)},complete:function(){return t.next(r)}})})).pipe(i.first())},e.prototype.getStorage=function(){var e=this;return this.getStorageKeys().pipe(i.switchMap((function(t){return t.length?o.forkJoin(mt.arrayToObject(t,(function(e){return e}),(function(t){return e.getItem(t)}))):o.of({})})))},e.prototype.setStorage=function(e){var t=this;return o.forkJoin(Object.keys(e||{}).map((function(r){return t.setItem(r,e[r])})))},e}();vt.decorators=[{type:r.Injectable}],vt.ctorParameters=function(){return[{type:ee.LocalStorage},{type:ee.StorageMap}]};var St=function(){function e(e){var t=e.user,r=e.schema;this.id=t.id,this.name=t.name,this.firstname=t.firstname,this.lastname=t.lastname,this.title=t.title,this.email=t.email,this.present=t.present,!0===t.hasimage&&(this.imageUri="/organization/image/"+this.id),this.userSettings="object"==typeof e.usersettings?e.usersettings:{},this.schema={version:r.version,supportedLocales:r.supportedlocales},this.privileges=t.privileges,this.roles=t.effectiveroles,this.deputies=t.deputies||[],this.substitutesOf=t.substitutesOf||[],this.schemaLocale=t.locale||this.getClientLocale()}return e.prototype.hasPrivilege=function(e){var t=!1;if(this.privileges)for(var r=0;!t&&r<this.privileges.length;)t=this.privileges[r].name===e,r++;return t},e.prototype.hasRole=function(e){var t=!1;if(this.roles)for(var r=0;!t&&r<this.roles.length;)t=this.roles[r].name===e,r++;return t},e.prototype.setImageBase=function(e){this.imageUri&&(this.imageUri=e+this.imageUri)},e.prototype.getClientLocale=function(){return this.userSettings.clientlocale||"en"},e.prototype.getSchemaLocale=function(){return this.schemaLocale},e}(),Et=function(e,t){return(Et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */Object.create;function Tt(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ot(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function Ct(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ot(arguments[t]));return e}Object.create;var It=function(){function e(){}return e.prototype.assert=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.group=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.groupEnd=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e}();It.decorators=[{type:r.Injectable}];var xt=function(){function e(e,t,r,n){this.http=e,this.coreConfig=t,this.logger=r,this.config=n,this.gridDataFilter=i.map((function(e){return null==e?void 0:e.filter((function(e){return!e.__removed}))})),this.cache=new Map,this.temp=new Map,this.headers=this.setDefaultHeaders(),this.authProfile={host:"",ntlm:!0}}return e.prototype.setAuthProfile=function(e){e&&(this.headers=this.setDefaultHeaders(),this.authProfile=e,this.authProfile.auth,this.headers.delete("Authorization"))},e.prototype.setHeader=function(e,t){t&&t.length&&(this.headers=this.headers.set(e,t))},e.prototype.getHeaders=function(){return this.headers},e.prototype.getHttpOptions=function(e){return Object.assign({headers:this.getHeaders(),withCredentials:this.coreConfig.withCredentials},e)},e.prototype.getServiceBase=function(){return this.config.getUri("serviceBase")},e.prototype.getSearchBase=function(){return this.config.getUri("searchBase")},e.prototype.getContextBase=function(){return this.config.getUri("contextBase")},e.prototype.getInboxBase=function(){return this.config.getUri("inboxBase")},e.prototype.getBpmBase=function(){return this.config.getUri("bpmBase")},e.prototype.getAgentBase=function(){return this.config.getUri("agentBase")},e.prototype.getStatusBase=function(){return this.config.getUri("statusBase")},e.prototype.getIconBase=function(e){return void 0===e&&(e=""),this.getServiceBase()+"/ui/icon/"+e},e.prototype.getHost=function(){return this.authProfile.host||""},e.prototype.getBaseWithContext=function(e){return(null==e?void 0:e.startsWith("/"))?this.config.getContextPath()+e:e},e.prototype.getContextPath=function(e){return this.getHost()+this.getBaseWithContext(e||this.getServiceBase())},e.prototype.get=function(e,t,r){return this.http.get(this.getContextPath(t)+e,this.getHttpOptions(r))},e.prototype.put=function(e,t,r,n){return this.http.put(this.getContextPath(r)+e,t,this.getHttpOptions(n))},e.prototype.getJson=function(e,t){return this.http.get(this.getContextPath(t)+e,this.getHttpOptions({responseType:"json"}))},e.prototype.post=function(e,t,r,n){var o=this.getContextPath(r),i=t?JSON.stringify(t):"";return this.http.post(""+o+e,i,this.getHttpOptions(n))},e.prototype.postMultiPart=function(e,t,r,n){var o=this.getContextPath(r),i=this.getHeaders();i.delete("Content-Type");var s=Object.assign({headers:i,withCredentials:this.coreConfig.withCredentials},n);return this.http.post(""+o+e,t,s)},e.prototype.del=function(e,t,r){return this.http.delete(this.getContextPath(t)+e,this.getHttpOptions(r))},e.prototype.update=function(e,t){return t.forEach((function(t){var r=t.id,n=t.item;if(r){var o=e.find((function(e){return e.id===r}));Object.assign(o,n,n?{__updated:!0}:{__removed:!0})}else n&&e.unshift(Object.assign(n,{__added:!0}))})),e},e.prototype.getViaCache=function(e){var t=this;return this.cache.has(e)?o.of(this.cache.get(e)):this.getViaTempCache(e,(function(){return t.http.get(e,{withCredentials:t.coreConfig.withCredentials,responseType:"text"}).pipe(i.tap((function(r){return t.cache.set(e,r)})))}))},e.prototype.getViaTempCache=function(e,t){var r=this;if(this.temp.has(e))return this.temp.get(e);var n=(t?t():this.get(e)).pipe(i.finalize((function(){return r.temp.delete(e)})),i.shareReplay(1));return this.temp.set(e,n),n},e.prototype.downloadContent=function(e,t,r){var n=e[0];if(1===e.length)if(n.content){var o=this.getServiceBase()+"/dms/"+n.content.id+"/content?type="+n.content.type+"&asdownload=true";o+=t?"&rendition="+t+"&_intent=DOWNLOAD_"+t:"&_intent=DOWNLOAD",n.content.id===n.id&&(o+="&version="+n.version),this.download(o,r?n.version:null)}else this.logger.error("The provided dms object has no content",n);if(e.length>1){o=this.getServiceBase()+"/dms/batch/export";if(n.content){var i={query:{expression:Ct(e.map((function(e){return e.content.id})))},options:{rendition:""}};i.options.rendition=t?"PDF":null,this.downloadMulti(o,r?n.version:null,i)}else this.logger.error("The provided dms object has no content",n)}},e.prototype.download=function(e,t){var r=this;this.http.get(e,{observe:"response",responseType:"blob",withCredentials:this.coreConfig.withCredentials}).subscribe((function(e){te.saveAs(e.body,r.getFileNameFromHttpResponse(e,t))}))},e.prototype.downloadMulti=function(e,t,r){var n=this;this.http.post(e,r,{observe:"response",responseType:"blob",withCredentials:this.coreConfig.withCredentials}).subscribe((function(e){te.saveAs(e.body,n.getFileNameFromHttpResponse(e,t))}))},e.prototype.getFileNameFromHttpResponse=function(e,t){var r=e.headers.get("Content-Disposition")||"",n=r.match("filename\\*=UTF-8''(.*)")||r.match('filename="(.*)"'),o=n?n[1]:null,i=o?decodeURIComponent(o):"unknown",s=~i.lastIndexOf(".")?i.lastIndexOf("."):i.length;return t?i.slice(0,s)+"_v"+t+i.slice(s):i},e.prototype.setDefaultHeaders=function(){return new n.HttpHeaders({"Content-Type":"application/json","X-os-include-links":"false","X-os-include-actions":"false","X-os-sync-index":"true"})},e}();xt.decorators=[{type:r.Injectable}],xt.ctorParameters=function(){return[{type:n.HttpClient},{type:tt,decorators:[{type:r.Inject,args:[et]}]},{type:It},{type:bt}]};var kt,_t=function(){function e(e){this.id=e.id,this.implements=e.implements?e.implements:[],this.isFolder=e.folder,this.isContextFolder=e.iscontextfolder,this.isAbstract=e.abstract,this.iconId=e.icon?e.icon.id:null,this.maxFiles=e.maxfiles,this.minFiles=e.minfiles,this.name=e.name,this.qname=e.qname,this.label=e.label,this.description=e.description,this.group=e.group?e.group.label:"",this.elements=e.elements,this.allowedcontexttypes=e.allowedcontexttypes?e.allowedcontexttypes:[],this.supertypes=e.supertypes?e.supertypes.map((function(e){return e.name})):[],this.shareable=e.shareable,this.parenttypes=this.getParentTypes(e.allowedlocations)}return e.prototype.getParentTypes=function(e){return e?e.parenttypes.map((function(e){return e.name})):[]},e}(),wt=Ze,At=function(){function e(e,t,r,n){var i=this;this.backend=e,this.logger=t,this.eventService=r,this.appCache=n,this.systemSource=new o.ReplaySubject,this.system$=this.systemSource.asObservable(),this.objectTypeForms=[],this.cachedRoles=[],this.eventService.on(yt.SYSTEM_STATUS_SCHEMA_CHANGED).subscribe((function(){i.fetchSystemDefinition(i.user)}))}return Object.defineProperty(e.prototype,"system",{get:function(){return JSON.parse(JSON.stringify(this._system))},set:function(e){this._system=e},enumerable:!1,configurable:!0}),e.prototype.getObjectTypes=function(){return this.system.types},e.prototype.getObjectType=function(e){return this.system.types.find((function(t){return t.name===e}))},e.prototype.getFormElementsFromFormModel=function(e,t,r){var n=this;return this.getObjectTypeForm(e,t,r?"CONTEXT":null).pipe(i.switchMap((function(e){var t=[];return n.processFormModelElements(e,t),o.of(t)})))},e.prototype.processFormModelElements=function(e,t){var r=this;e.elements.forEach((function(e){"o2mGroup"!==e.type&&"o2mGroupStack"!==e.type?t.push(e):e.elements&&e.elements.length&&r.processFormModelElements(e,t)}))},e.prototype.implementsType=function(e,t){return e.name===t||e.implements&&-1!==e.implements.indexOf(t)},e.prototype.getCodesystem=function(e){return this.system.codesystems.find((function(t){return t.id===e||t.name===e}))},e.prototype.getObjectTypeForm=function(e,t,r){for(var n,s=this,a=0;!n&&a<this.objectTypeForms.length;)this.objectTypeForms[a].name===e&&this.objectTypeForms[a].mode===r&&this.objectTypeForms[a].situation===t&&(n=this.objectTypeForms[a]),a++;if(n)return o.of(re.cloneDeep(n));var c="/ui/form/"+e+"?situation="+t;return c+=r?"&formmode="+r:"",this.backend.getViaTempCache(c,(function(){return s.backend.getJson(c).pipe(i.tap((function(e){return s.objectTypeForms.push(re.cloneDeep(e))})))}))},e.prototype.getSystemDefinition=function(e){return this.user=e,this.fetchSystemDefinition(e)},e.prototype.getDefaultValue=function(e){var t;switch(e){case"CURRENT_USER":t=this.user.name;break;case"CURRENT_USER_NAME":t=this.user.title;break;case"CURRENT_DATETIME":t=new Date;break;case"CURRENT_DATE":t=wt().startOf("day").toDate();break;case"YEAR":t=wt().year();break;case"MONTH":t=wt().month()+1;break;case"DAY":t=wt().date();break;case"HOUR":t=wt().hour();break;case"MINUTE":t=wt().minute();break;case"SECOND":t=wt().second();break;case"WEEK_OF_YEAR":t=wt().isoWeek();break;case"FIRST_DAY_OF_WEEK":t=wt().startOf("isoWeek").toDate();break;case"FIRST_DAY_OF_MONTH":t=wt().startOf("month").toDate();break;case"FIRST_DAY_OF_YEAR":t=wt().startOf("year").toDate()}return t},e.prototype.fetchSystemDefinition=function(e){var t=this,r=[this.backend.getJson("/system/type/list?elements=true&basetypes=true"),this.backend.getJson("/system/cs/list?elements=true")];return o.forkJoin(r).pipe(i.catchError(mt.catch((function(e){t.logger.error("Error fetching recent version of system definition from server.",e),t.systemSource.error("Error fetching recent version of system definition from server.")}))),i.map((function(r){t.objectTypeForms=[];var n={info:{user:e.id,locale:e.getSchemaLocale(),version:e.schema.version},locales:e.schema.supportedLocales,types:[],codesystems:[]},o=r[0];return n.types=o.map((function(e){return new _t(e)})),n.codesystems=r[1],t.system=n,t.systemSource.next(n),t.logger.debug("Fetched new version of system definition (user: "+e.id+", version: "+e.schema.version+")."),t.appCache.setItem(t.appCache.SYSTEM_DEFINITION,n).subscribe((function(){t.logger.debug("Cached recent version")}),mt.logError(null,"Error caching recent version of system definition.")),!0})))},e.prototype.getOrganizationObjectById=function(e){return this.backend.getJson("/organization/id/"+e)},e.prototype.getOrganizationObject=function(e){return this.getOrganizationObjects([e]).pipe(i.map((function(e){return e[0]})))},e.prototype.getOrganizationObjects=function(e){var t=this,r=e.map((function(e){return t.backend.getJson("/organization/name/"+e).pipe(i.catchError((function(t){return o.of({id:e,active:!1})})))}));return o.forkJoin(r)},e.prototype.getRoles=function(){var e=this;return this.cachedRoles.length?o.of(this.cachedRoles):this.backend.get("/organization/role").pipe(i.map((function(e){return e})),i.tap((function(t){return e.cachedRoles=t})))},e}();At.decorators=[{type:r.Injectable}],At.ctorParameters=function(){return[{type:xt},{type:It},{type:gt},{type:vt}]},(kt=e.Direction||(e.Direction={})).LTR="ltr",kt.RTL="rtl";var Rt=function(){function t(e,t,r,n,s,a,c){this.backend=e,this.translate=t,this.logger=r,this.eventService=n,this.system=s,this.http=a,this.config=c,this.USER_FETCH_URI="/user?favorites=true&privileges=true&roles=true&deputies=true&substitutesOf=true",this.user=null,this.userSource=new o.BehaviorSubject(this.user),this.user$=this.userSource.asObservable(),this.favorites=null,this.favoritesSource=new o.BehaviorSubject(this.favorites),this.favoritesGridData$=this.favoritesSource.asObservable().pipe(i.debounceTime(100),i.filter((function(e){return e}))),this.favorites$=this.favoritesGridData$.pipe(this.backend.gridDataFilter),this.notifications=null,this.notificationsSource=new o.BehaviorSubject(this.notifications),this.notificationsGridData$=this.notificationsSource.asObservable().pipe(i.debounceTime(100),i.filter((function(e){return e}))),this.notifications$=this.notificationsGridData$.pipe(this.backend.gridDataFilter)}return t.prototype.getCurrentUser=function(){return this.user},t.prototype.setPresence=function(e){var t=this;return e!==this.user.present?this.backend.put("/user?presence="+e).pipe(i.tap((function(r){t.user.present=e,t.userSource.next(t.user)}))):o.of(null)},t.prototype.delUserImage=function(e){return this.http.put(e,null)},t.prototype.setUserImage=function(e){return this.backend.put("/user/image",e)},t.prototype.setDeputies=function(e){var t=this;return this.backend.put("/user/deputy?user="+e.join("&user=")).pipe(i.tap((function(){return t.refreshCurrentUser().subscribe()})))},t.prototype.changeClientLocale=function(t){var r=this;this.user.userSettings.clientlocale=t,this.backend.put("/user/config/web",this.user.userSettings).subscribe((function(){r.logger.debug("Changed client locale to '"+t+"'"),r.translate.use(t),r.user.uiDirection=(r.config.getClientLocales().find((function(e){return e.iso===t}))||{}).dir||e.Direction.LTR,r.userSource.next(r.user),r.eventService.trigger(yt.CLIENT_LOCALE_CHANGED,t)}))},t.prototype.changeSchemaLocale=function(e){var t=this;return this.user.schemaLocale=e,this.backend.put("/user/locale/"+this.user.schemaLocale).pipe(i.tap((function(){t.logger.debug("Changed schema locale to '"+e+"'"),t.userSource.next(t.user),t.backend.setHeader("Accept-Language",t.user.getSchemaLocale()),t.logger.debug("Loading system definition for new locale."),t.system.getSystemDefinition(t.user).subscribe(),t.eventService.trigger(yt.SCHEMA_LOCALE_CHANGED,e)})))},t.prototype.setCurrentUser=function(t){this.user=new St(t),this.passwordValidationSettings=t.passwortvalidation,this.user.setImageBase(this.backend.getServiceBase()),this.backend.setHeader("Accept-Language",this.user.getSchemaLocale());var r=this.config.getClientLocales().map((function(e){return e.iso})),n=this.user.getClientLocale();-1===r.indexOf(n)&&(n=this.config.getDefaultClientLocale()),this.logger.debug("Setting client locale to '"+n+"'"),this.translate.use(n),this.user.uiDirection=(this.config.getClientLocales().find((function(e){return e.iso===n}))||{}).dir||e.Direction.LTR,this.userSource.next(this.user),this.favorites=null,this.favoritesSource.next(this.favorites),this.notifications=null,this.notificationsSource.next(this.notifications)},t.prototype.getFavorites=function(){var e=this;return this.backend.getJson("/user/favorites").pipe(i.map((function(e){return e&&e.filter((function(e){return"DMS_OBJECT"===e.favoritetype}))})),i.tap((function(t){e.favorites=t,e.favoritesSource.next(e.favorites)})))},t.prototype.updateFavorites=function(e,t,r){this.backend.update(this.favorites,r||[{id:e,item:t}])&&this.favoritesSource.next(this.favorites)},t.prototype.getNotifications=function(){var e=[this.getSubscription(),this.getResubmission()];return o.forkJoin(e)},t.prototype.getResubmission=function(){var e=this;return this.backend.getJson("/messageprovider/resubmission/list").pipe(i.tap((function(t){e.notifications=t,e.notificationsSource.next(e.notifications)})))},t.prototype.getSubscription=function(){var e=this;return this.backend.getJson("/messageprovider/subscription/list").pipe(i.tap((function(t){e.notifications=t,e.notificationsSource.next(e.notifications)})))},t.prototype.removeNotifications=function(e,t){var r,n=this;switch(t){case"SUBSCRIPTION":r="subscription";break;case"RESUBMISSION":r="resubmission";break;default:return}return this.backend.del("/messageprovider/"+r+"/"+e).pipe(i.tap((function(e){return n.updateNotifications("")})))},t.prototype.updateNotifications=function(e,t,r){this.backend.update(this.notifications,r||[{id:e,item:t}])&&this.notificationsSource.next(this.notifications)},t.prototype.getUserImageUri=function(e){return this.backend.getServiceBase()+"/organization/image/"+e+"?usedefault=true"},t.prototype.removeFavorite=function(e){var t=this;return this.backend.del("/user/favorite/"+e).pipe(i.tap((function(r){return t.updateFavorites(e)})))},t.prototype.createFavorite=function(e,t,r){var n=this,o=mt.buildUri("/dms/favorite/"+e,{type:t,title:r});return this.backend.post(o,{}).pipe(i.tap((function(e){return n.getFavorites().subscribe()})))},t.prototype.removeFavoritesForTarget=function(e){var t=this;return this.backend.del("/dms/favorite/"+e).pipe(i.tap((function(r){var n=t.favorites.filter((function(t){return t.target.id===e})).map((function(e){return Object.assign({id:e.id})}));t.updateFavorites(null,null,n)})))},t.prototype.changeLockSetting=function(e){var t=this;return this.user.userSettings.alwayslock=e,this.backend.put("/user/config/web",this.user.userSettings).pipe(i.map((function(){t.refreshCurrentUser().subscribe()})))},t.prototype.hasPrivilege=function(e){return!!this.user.privileges.find((function(t){return t.name===e}))},t.prototype.changePassword=function(e){return this.backend.put("/user/password",e)},t.prototype.refreshCurrentUser=function(){var e=this;return this.backend.get(this.USER_FETCH_URI).pipe(i.map((function(t){return e.setCurrentUser(t)})))},t.prototype.validatePassword=function(e){return e.length<this.passwordValidationSettings.minlength?{type:"short",amount:this.passwordValidationSettings.minlength}:e.replace(/[^0-9]/g,"").length<this.passwordValidationSettings.minnumber?{type:"number",amount:this.passwordValidationSettings.minnumber}:e.replace(/[a-zA-Z0-9ß ]/g,"").length<this.passwordValidationSettings.minspecialchars?{type:"specialchars",amount:this.passwordValidationSettings.minspecialchars}:{type:"valid",amount:null}},t.prototype.changeSavedInboxFilters=function(e){var t=this;return this.user.userSettings.savedInboxFilter=e,this.backend.put("/user/config/web",this.user.userSettings).pipe(i.map((function(){t.refreshCurrentUser().subscribe()})))},t}();Rt.decorators=[{type:r.Injectable}],Rt.ctorParameters=function(){return[{type:xt},{type:t.TranslateService},{type:It},{type:gt},{type:At},{type:n.HttpClient},{type:bt}]};var Pt=function(){function e(e){Object.assign(this,e)}return Object.defineProperty(e.prototype,"title",{get:function(){return this.selectedtype?this.selectedtype.label:""},enumerable:!1,configurable:!0}),e.prototype.hasContent=function(){return!!this.template||this.contentcount>0},e.prototype.getSelectedTypeObject=function(){return this.types.find((function(e){return e.selected}))},e}(),Dt=function(){function e(e,t,r){this.coreConfig=e,this.http=t,this.userService=r}return e.prototype.upload=function(e,t){var r=new FormData,o=new n.HttpHeaders({"Accept-Language":this.userService.getCurrentUser().getClientLocale()});return t.forEach((function(e){return r.append("files[]",e,mt.encodeFileName(e.name))})),this.http.post(e,r,{headers:o,withCredentials:this.coreConfig.withCredentials})},e}();Dt.decorators=[{type:r.Injectable}],Dt.ctorParameters=function(){return[{type:tt,decorators:[{type:r.Inject,args:[et]}]},{type:n.HttpClient},{type:Rt}]};var jt=function(){function e(e,t){this.id=e,this.type=t}return e.prototype.onUploadSuccess=function(e){return e},e.prototype.onUploadFail=function(){return{}},e}();jt.ROOT="root",jt.CONTEXT="context",jt.CONTEXT_TREE="contexttree",jt.OBJECT="object",jt.CUSTOM="custom";var Nt=function(){function e(e,t){this.backend=e,this.uploadService=t,this.preparedItemsSource=new o.ReplaySubject(1),this.preparedItems$=this.preparedItemsSource.asObservable(),this.preparedItemCountSource=new o.ReplaySubject(1),this.preparedItemCount$=this.preparedItemCountSource.asObservable()}return e.prototype.refreshPreparedItemsCount=function(){this.fetchPreparedItemsCount()},e.prototype.fetchPreparedItemsCount=function(){var e=this;this.backend.getJson("/prepare/state").pipe(i.map((function(e){return e.count}))).subscribe((function(t){e.preparedItemCount=t,e.preparedItemCountSource.next(e.preparedItemCount)}))},e.prototype.createPreparedItem=function(e,t){var r=this;return this.backend.post(this.createPreparedItemPostUrl({parentId:e,childType:t||null}),{}).pipe(i.tap((function(){return r.getPreparedItems$()})))},e.prototype.updatePreparedItemIndexData=function(e,t){var r=this;return this.backend.put("/prepare/"+e,t).pipe(i.tap((function(){return r.getPreparedItems$()})))},e.prototype.createPreparedItemPostUrl=function(e){var t=e.createMany?"/prepare/createmany":"/prepare/create";return e&&(t=mt.buildUri(t,e)),t},e.prototype.getPreparedItems$=function(e){return this.fetchPreparedItems(e).subscribe(),this.preparedItems$},e.prototype.fetchPreparedItems=function(e){var t=this,r=e?"/prepare":"/prepare?form=true";return this.backend.getJson(r).pipe(i.map((function(e){return e.map((function(e){return new Pt(e)}))})),i.tap((function(){return t.fetchPreparedItemsCount()})),i.tap((function(e){return t.preparedItemsSource.next(e.sort(mt.sortValues("created","desc")))})))},e.prototype.deletePreparedItem=function(e){var t=this;return this.backend.del("/prepare/"+e).pipe(i.tap((function(){return t.getPreparedItems$()})))},e.prototype.getPrepareRootTypes=function(){return this.backend.getViaTempCache("/prepare/types").pipe(i.map((function(e){return e.types.map((function(e){return new _t(e)}))})))},e.prototype.getPrepareChildTypes=function(e,t){var r=e?{parentId:e,withcontent:t}:{withcontent:t},n=mt.buildUri("/prepare/types",r);return this.backend.getViaTempCache(n).pipe(i.map((function(e){return{parent:e.parent,types:e.types.map((function(e){return new _t(e)}))}})))},e.prototype.getPreviewUri=function(e,t,r){return mt.buildUri(this.backend.getServiceBase()+"/prepare/"+e+"/content",{rendition:r,index:t})},e.prototype.updateChildType=function(e,t){return this.backend.put("/prepare/"+t+"/"+e+"?form=true&contentmeta=true").pipe(i.map((function(e){return new Pt(e)})))},e.prototype.addTemplate=function(e,t){return this.backend.put("/prepare/"+e+"/template?templateid="+t).pipe(i.map((function(e){return new Pt(e)})))},e.prototype.getTemplates=function(e){return this.backend.getJson("/template/list?type="+e).pipe(i.map((function(e){return e})))},e.prototype.getTemplatePreviewUri=function(e,t){return mt.buildUri(this.backend.getServiceBase()+"/template/"+e+"/content",{rendition:t})},e.prototype.commitPreparedItem=function(e,t,r){var n=this;return this.backend.put("/prepare/"+e+"/"+t).pipe(i.mergeMap((function(){return n.backend.post("/prepare/commit/"+e,r)})),i.tap((function(){return n.getPreparedItems$()})),i.map((function(e){return e.id})))},e.prototype.uploadContent=function(e,t){var r=this.backend.getServiceBase()+"/prepare/"+e+"/content.json?form=true&contentmeta=true";return this.uploadService.upload(r,[t]).pipe()},e.prototype.uploadToTarget=function(e,t,r){var n=this,o=t.map((function(e){return e._file}));return this.uploadService.upload(this.getUploadTarget(e,r),o).pipe(i.tap((function(){return n.getPreparedItems$()})))},e.prototype.getUploadTarget=function(e,t){var r;if(e.type===jt.ROOT)r=this.backend.getServiceBase()+this.createPreparedItemPostUrl({parentId:null,createMany:!t});else if(e.type===jt.OBJECT){var n=e.referenceObject;r=this.backend.getServiceBase()+"/dms/"+n.id+"/contents?type="+n.type.name}else e.type!==jt.CONTEXT&&e.type!==jt.CONTEXT_TREE||(r=this.backend.getServiceBase()+this.createPreparedItemPostUrl({parentId:e.referenceObject.id,createMany:!t,childType:e.subFolder&&e.subFolder.data.type?e.subFolder.data.type:null}));return r},e.prototype.deletePreparedItemContent=function(e,t){var r="/prepare/"+e+"/content"+(void 0!==t?"?index="+t:"");return this.backend.del(r).pipe(i.map((function(e){return new Pt(e)})))},e}();Nt.decorators=[{type:r.Injectable}],Nt.ctorParameters=function(){return[{type:xt},{type:Dt}]};var Ft=Ze,Ut=function(){function e(e){this.id=e.inboxentryid,this.title=e.title,this.description=e.description,this.type=e.type,this.sourceId=e.source?e.source.id:null,this.iconId=e.target&&e.target.icon?e.target.icon.id:null,this.accepted=e.accepted,this.isdeputy=e.isdeputy,this.duetime=e.duetime,this.received=e.receivetime,this.target=e.target}return e.prototype.isOverdue=function(){return this.duetime&&Ft(this.duetime).isBefore(Ft())},e}();Ut.TYPE_BPM="BPM",Ut.TYPE_RESUBMISSION="RESUBMISSION",Ut.TYPE_SUBSCRIPTION="SUBSCRIPTION";var Lt=function(){function e(e){this.backend=e,this.MAX_PAGE_SIZE=1e3,this.inboxStateSource=new o.ReplaySubject(1),this.inboxState$=this.inboxStateSource.asObservable(),this.inboxItemsSource=new o.ReplaySubject(1),this.inboxItemsGridData$=this.inboxItemsSource.asObservable(),this.inboxItems$=this.inboxItemsGridData$.pipe(this.backend.gridDataFilter)}return e.prototype.getItems=function(){var e=this;return this.getAllPages().pipe(i.map((function(e){return e.map((function(e){return new Ut(e)}))})),i.tap((function(t){e.inboxItems=t,e.inboxItemsSource.next(e.inboxItems)})),i.catchError(mt.throw((function(){return e.inboxItemsSource.next([])}))))},e.prototype.getAllPages=function(){var e=this,t=[];return this.getPage().pipe(i.expand((function(t){return t.last?o.EMPTY:e.getPage(t.pageable.pageNumber+1)})),i.tap((function(e){return t=Ct(t,e.content)})),i.skipWhile((function(e){return!e.last})),i.map((function(e){return t})))},e.prototype.getPage=function(e){return this.backend.getJson("/get?size="+this.MAX_PAGE_SIZE+"&page="+(e||0),this.backend.getInboxBase())},e.prototype.getState=function(){return this.inboxState},e.prototype.refreshInboxState=function(){this.fetchInboxState()},e.prototype.fetchInboxState=function(){var e=this;this.backend.getJson("/state",this.backend.getInboxBase()).pipe(i.map((function(e){return e}))).subscribe((function(t){e.inboxState=t,e.inboxStateSource.next(e.inboxState)}),mt.logError(null,"Failed to fetch inbox state!"))},e.prototype.removeItem=function(e){var t=this;return this.backend.del("/"+e.id,this.backend.getInboxBase()).pipe(i.tap((function(){return t.updateInboxItems(e.id)})))},e.prototype.updateInboxItems=function(e,t,r){this.backend.update(this.inboxItems,r||[{id:e,item:t}])&&this.inboxItemsSource.next(this.inboxItems)},e.prototype.markAsRead=function(e){return this.backend.put("/read/"+e.id,this.backend.getInboxBase())},e}();Lt.decorators=[{type:r.Injectable}],Lt.ctorParameters=function(){return[{type:xt}]};var Mt,Bt=function(){function e(){}return e.prototype.setCapabilities=function(e,t){return this.capabilities={bpm:e.bpm,favorites:e.favorites,followup:e.followup,subscription:e.subscription,intray:e.intray,storedqueries:e.storedqueries,recyclebin:e.recyclebin,inbox:e.bpm||e.followup||e.subscription,notifications:e.followup||e.subscription,template:e.template,sso:t||!1},this.capabilities},e.prototype.getCapabilities=function(){return this.capabilities},e.prototype.hasCapability=function(e){return this.capabilities[e]},e}();Bt.decorators=[{type:r.Injectable}],Bt.ctorParameters=function(){return[]};var Ht=function(){function e(){return Mt&&(Mt=this),this.storage=this.isLocalStorageAvailable()?window.localStorage:null,Mt}return e.prototype.setItem=function(e,t){if(void 0===e||void 0===t)return!1;this.storage.setItem(e,JSON.stringify(t))},e.prototype.getItem=function(e){this.isKeyDefined(e);var t=this.storage.getItem(e);return!!t&&JSON.parse(t)},e.prototype.hasItem=function(e){return this.isKeyDefined(e),null===this.storage.getItem(e)},e.prototype.removeItem=function(e){this.isKeyDefined(e),this.storage.removeItem(e)},e.prototype.clear=function(e){var t=this;return e?Object.keys(this.storage).forEach((function(r){return e(r)&&t.removeItem(r)})):this.storage.clear()},e.prototype.isKeyDefined=function(e){if(void 0===e)return!1},e.prototype.isLocalStorageAvailable=function(){try{var e=window.localStorage;return e.setItem("test","test"),e.removeItem("test"),!0}catch(e){return!1}},e}();Ht.decorators=[{type:r.Injectable}],Ht.ctorParameters=function(){return[]};var qt,Qt=function(e){var t=this;switch(this.title=e.activityName,this.description=e.description,this.number=e.number,this.time=e.time,this.type=e.type,this.data={},e.type){case"DEADLINE_START":case"DEADLINE_FIRE":this.title=e.periodName+": "+e.description,this.description=null,this.data={periodFireTime:e.periodFireTime},this.type=e.type}e.performer&&(this.performer=[],e.performer.groups.forEach((function(e){return t.performer.push({type:"group",label:e.name})})),e.performer.roles.forEach((function(e){return t.performer.push({type:"role",label:e.name})})),e.performer.users.forEach((function(e){return t.performer.push({type:"user",label:e.lastname+", "+e.firstname+" ("+e.name+")"})}))),e.user&&(this.editor=e.user)},Gt=function(){function e(e){this.creatorid=e.creatorid,this.modelname=e.modelname,this.iconurl=e.iconurl,this.iconid=e.iconid,this.localizedsubject=e.subject,this.modelid=e.modelid,this.processid=e.id,this.procname=e.name,this.starttime=e.starttime,this.endtime=e.endtime,this.state=e.state}return Object.defineProperty(e.prototype,"title",{get:function(){return this.localizedsubject||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.processid||""},enumerable:!1,configurable:!0}),e.prototype.setFile=function(e){this.file=e||[]},e}(),Vt=function(){function e(e){Object.assign(this,e),this.fileEntryPermissions={add:e.isFileElemAddable||!1,remove:e.isFileElemRemovable||!1},this.actions&&this.actions.length&&(this.actions=this.actions.sort((function(e,t){return e.code-t.code})))}return e.prototype.setFile=function(e){this.file=e?e.sort((function(e,t){return e.addtime<t.addtime?-1:e.addtime>t.addtime?1:0})):[]},e}();(qt=e.ClipboardAction||(e.ClipboardAction={}))[qt.COPY=0]="COPY",qt[qt.CUT=1]="CUT";var Jt,zt=function(){function t(e,t,r,n){this.capabilities=e,this.backend=t,this.eventService=r,this.inboxService=n,this.processItemsSource=new o.ReplaySubject(1),this.processItems$=this.processItemsSource.asObservable()}return t.prototype.getProcesses=function(e){var t=this;return void 0===e&&(e=1e3),this.backend.getJson("/process/user?size="+e,this.backend.getBpmBase()).pipe(i.map((function(e){return e.content.map((function(e){return new Gt(e)}))})),i.tap((function(e){t.processItems=e,t.processItemsSource.next(t.processItems)})))},t.prototype.getExecutableProcesses=function(e,t,r,n,i){return this.capabilities.hasCapability("bpm")?this.executableProcesses&&t?o.of(this.executableProcesses):this.fetchExecutableProcesses(e,r,n,i):o.of([])},t.prototype.initExecutableProcesses=function(){var e=this;return this.backend.get("/bpm/process/executable").pipe(i.tap((function(t){return e.hasMainExecutableProcesses=null==t?void 0:t.length})))},t.prototype.getExecutableProcessesForDmsObjects=function(e){return this.getExecutableProcesses(e.map((function(e){return e.typeName})),!1,!0)},t.prototype.fetchExecutableProcesses=function(e,t,r,n){var o=this,s="/bpm/process/executable";return t&&(s+="?form=true&fields=true"),e&&(s+=(t?"&":"?")+"type="+e.join(",")),r&&(s+=(t||e?"&":"?")+"modelid="+r),this.backend.get(s).pipe(i.map((function(e){return e})),i.tap((function(e){n&&(t?(o.executableProcesses||(o.executableProcesses=[]),e.forEach((function(e){var t=o.executableProcesses.findIndex((function(t){return t.id===e.id}));-1===t?o.executableProcesses.push(e):o.executableProcesses[t]=e}))):o.executableProcesses=e)})))},t.prototype.getProcessFile=function(e){return this.backend.getJson("/process/"+e+"/file",this.backend.getBpmBase()).pipe(i.map((function(e){return e.content.map((function(e){return{id:e.elementid,title:e.title,description:e.description?e.description:"",iconid:e.iconid,creator:e.creator,addtime:e.addtime,type:e.type}}))})))},t.prototype.getWorkItem=function(e,t,r){var n=r||{form:!0,fields:!0},s=[this.backend.getJson(mt.buildUri("/bpm/process/"+e+"/"+t,n)),this.getProcessFile(e)];return o.forkJoin(s).pipe(i.map((function(e){var t=new Vt(e[0]);return t.setFile(e[1]),t})))},t.prototype.saveWorkItem=function(e){var t=this,r=e.id,n=e.processId,o={contents:e.file,data:e.data};return this.backend.post(mt.buildUri("/bpm/process/"+n+"/"+r+"/save",{keeplock:!0,isautolock:!1}),o).pipe(i.mergeMap((function(){return t.getWorkItem(n,r)})))},t.prototype.forwardWorkItem=function(e,t){var r=this,n={action:t,contents:e.file,data:e.data};return this.backend.post(mt.buildUri("/bpm/process/"+e.processId+"/"+e.id+"/save",{keeplock:!1,isautolock:!1}),n).pipe(i.tap((function(){return r.inboxService.updateInboxItems(e.id)})))},t.prototype.lockWorkItem=function(e){var t=this;return this.backend.put("/bpm/process/"+e.processId+"/"+e.id+"/lock").pipe(i.mergeMap((function(){return t.getWorkItem(e.processId,e.id)})))},t.prototype.unlockWorkItem=function(e){var t=this;return this.backend.del("/bpm/process/"+e.processId+"/"+e.id+"/lock").pipe(i.mergeMap((function(){return t.getWorkItem(e.processId,e.id)})))},t.prototype.startProcess=function(e,t,r){return this.backend.post("/bpm/process/?modelid="+e,{data:t,contents:r})},t.prototype.getProcessHistory=function(e){return this.backend.getJson("/bpm/process/"+e+"/history").pipe(i.map((function(e){return e&&e.length?e.map((function(e){return new Qt(e)})):[]})))},t.prototype.removeFileElement=function(e,t,r){return this.backend.del("/process/"+e+"/file/"+r+"?activityid="+t,this.backend.getBpmBase())},t.prototype.addFileElements=function(e,t,r){var n=this,s=[];return r.forEach((function(r){s.push(n.backend.post("/process/"+e+"/file/"+r.id+"?type="+r.type.name+"&activityid="+t,{},n.backend.getBpmBase()))})),o.forkJoin(s).pipe(i.mergeMap((function(){return n.getWorkItem(e,t)})))},t.prototype.addFileElementsFromClipboard=function(t,r){if(t&&t.fileEntryPermissions.add&&r&&r.elements.length&&r.action===e.ClipboardAction.COPY){var n=void 0;if(t.file.length){var i=t.file.map((function(e){return e.id}));n=r.elements.filter((function(e){return-1===i.indexOf(e.id)}))}else n=r.elements;return this.addFileElements(t.processId,t.id,n)}return o.throwError("error")},t}();zt.decorators=[{type:r.Injectable}],zt.ctorParameters=function(){return[{type:Bt},{type:xt},{type:gt},{type:Lt}]},(Jt=e.SystemStatusEnum||(e.SystemStatusEnum={})).SYSTEM_STATUS_SCHEMA_CHANGED="schemaChangedOn",Jt.SYSTEM_STATUS_ORG_CHANGED="orgChangedOn",Jt.SYSTEM_STATUS_SEC_CHANGED="securityChangedOn",Jt.SYSTEM_STATUS_ACL_CHANGED="aclChangedOn",Jt.SYSTEM_STATUS_INBOX_CHANGED="inboxChangedOn";var Yt=function(){function t(e,t,r,n){var i=this;this.eventService=e,this.backend=t,this.appCache=r,this.ngZone=n,this.statusCacheKey="eo.framework.cache.system.status",this.pollingStopTrigger$=new o.Subject,this.appCache.getItem(this.statusCacheKey).subscribe((function(e){return i.currentStatus=e}))}return t.prototype.init=function(e){void 0===e&&(e=-1),e>-1&&(this.pollingStopTrigger$=new o.Subject,this.startPolling(e))},t.prototype.stop=function(){this.hasBeenStopped=!0,this.pollingStopTrigger$.next(),this.pollingStopTrigger$.complete()},t.prototype.startPolling=function(e){var t=this;this.ngZone.runOutsideAngular((function(){o.timer(0,e).pipe(i.takeUntil(t.pollingStopTrigger$)).subscribe((function(){t.ngZone.run((function(){t.eventService.trigger(yt.SYSTEM_STATUS_INBOX_CHANGED,{})}))}))}))},t.prototype.handleStatusResult=function(e){var t=this,r=[];Object.keys(e).forEach((function(n){t.statusCheck(e,n)&&r.push({type:t.statusEvent(n),data:e})})),(r.length||this.hasBeenStopped)&&this.ngZone.run((function(){r.forEach((function(e){t.eventService.trigger(e.type,e.data)}))})),!r.length&&this.currentStatus||(this.currentStatus=e,this.appCache.setItem(this.statusCacheKey,e))},t.prototype.handleStatusError=function(e){var t=this;this.ngZone.run((function(){setTimeout((function(e){t.stop()}))}))},t.prototype.statusEvent=function(t){return yt[Object.keys(e.SystemStatusEnum).find((function(r){return e.SystemStatusEnum[r]===t}))]},t.prototype.statusCheck=function(e,t){return this.currentStatus&&this.currentStatus[t]<e[t]},t}();Yt.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new Yt(r.ɵɵinject(gt),r.ɵɵinject(xt),r.ɵɵinject(vt),r.ɵɵinject(r.NgZone))},token:Yt,providedIn:"root"}),Yt.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],Yt.ctorParameters=function(){return[{type:gt},{type:xt},{type:vt},{type:r.NgZone}]};var Kt=function(){function e(){}return e.isWebEnvironment=function(){return!e.isDesktopEnvironment()&&!e.isMobileEnvironment()},e.isMobileEnvironment=function(){return window.hasOwnProperty("cordova")},e.isDesktopEnvironment=function(){return window.hasOwnProperty("process")&&window.process.versions.hasOwnProperty("electron")},e}(),Wt=function(){function e(){this._cloudEnvironment=!1}return Object.defineProperty(e.prototype,"cloudEnvironment",{get:function(){return this._cloudEnvironment},set:function(e){this._cloudEnvironment=e},enumerable:!1,configurable:!0}),e.prototype.isCloud=function(){return this.cloudEnvironment},e}();Wt.decorators=[{type:r.Injectable}],Wt.ctorParameters=function(){return[]};var $t=function(){function e(e,t,r,n,i,s,a,c,u,p,l,h,f,d,m,g,y,b,v){var S=this;this.config=e,this.coreConfig=t,this.appCache=r,this.envService=n,this.http=i,this.bpmService=s,this.ngZone=a,this.location=c,this.capabilitiesService=u,this.logger=p,this.inboxService=l,this.prepareService=h,this.backend=f,this.systemService=d,this.userService=m,this.eventService=g,this.systemStatusService=y,this.storage=b,this.local=v,this.TOKEN_STORAGE_KEY="eo.auth.cloud.credentials",this.userProfileUri=this.userService.USER_FETCH_URI,this.authSource=new o.BehaviorSubject(!1),this.loggedInCacheKey="eo.user.loggedIn",this.authenticated$=this.authSource.asObservable(),this.hosts=[],this.profile={host:"",user:null,auth:null,active:!1},window.addEventListener("storage",(function(e){if(e.key===S.loggedInCacheKey){var t=JSON.parse(e.newValue).host;S.initUser(t).subscribe()}}))}return e.prototype.login=function(e,t,r){var o=this;e=e||"";var s=new FormData;s.append("username",encodeURIComponent(t)),s.append("password",encodeURIComponent(r));var a=new n.HttpHeaders({"Content-Type":"application/x-www-form-urlencoded"});return this.http.post(e+this.config.getContextPath()+"/login","username="+encodeURIComponent(t)+"&password="+encodeURIComponent(r),{headers:a,responseType:"text",withCredentials:this.coreConfig.withCredentials}).pipe(i.switchMap((function(){return o.initUser(e)})))},e.prototype.cloudLogin=function(e,t){var r=this;return o.Observable.create((function(n){var s=new o.Subject,a=e||"";r.http.get(a+"/tenant/"+t+"/loginDevice").subscribe((function(e){var c=a+"/oauth/"+t+"?user_code="+e.user_code,u=window.open(c,"auth");u&&r.ngZone.runOutsideAngular((function(){var e=setInterval((function(){u.closed&&(clearInterval(e),r.ngZone.run((function(){s.next(),s.complete()})))}),1e3)})),r.cloudLoginPollForResult(a+"/auth/info/state?device_code="+e.device_code,1e3,s).pipe(i.tap((function(e){if(e){r.cloudLoginSetHeaders(e,t);var n={tenant:t,accessToken:e};r.storage.setItem(r.TOKEN_STORAGE_KEY,n).subscribe()}})),i.switchMap((function(e){if(e)return r.initUser(a);o.throwError("not authenticated")}))).subscribe((function(e){u.close(),n.next(e),n.complete()}),(function(e){u.close(),n.error(e),n.complete()}))}),(function(e){n.error("unable to call device flow endpoint",e),n.complete()}))}))},e.prototype.cloudLoginPollForResult=function(e,t,r){var n=this;return void 0===r&&(r=new o.Subject),o.Observable.create((function(s){var a=!1,c=!1;n.ngZone.runOutsideAngular((function(){o.interval(t).pipe(i.takeUntil(r),i.switchMap((function(){return n.http.get(e).pipe(i.catchError((function(e){if(400===e.status)return o.of(e.error);o.throwError(e)})))}))).subscribe((function(e){n.ngZone.run((function(){a=!!e.access_token,c="access_denied"===e.error,a||c?(r.next(),r.complete(),s.next(a?e.access_token:null),s.complete()):"expired_token"===e.error&&o.throwError("Token expired")}))}),(function(e){n.ngZone.run((function(){s.error(e),s.complete()}))}),(function(){n.ngZone.run((function(){s.next(a),s.complete()}))}))}))}))},e.prototype.cloudLoginSetHeaders=function(e,t){this.backend.setHeader("Authorization","bearer "+e),this.backend.setHeader("X-ID-TENANT-NAME",t)},e.prototype.initUser=function(e){var t=this,r=new n.HttpHeaders({"Content-Type":"application/json"});return this.http.get(""+(e||"")+this.config.getContextPath()+"/auth/info",{headers:r,withCredentials:this.coreConfig.withCredentials}).pipe(i.switchMap((function(r){return t.gatewayInfo=r,t.envService.cloudEnvironment=t.gatewayInfo&&t.gatewayInfo.oauth2,t.isCloudEnvironment()?t.storage.getItem(t.TOKEN_STORAGE_KEY).pipe(i.switchMap((function(n){return n&&t.cloudLoginSetHeaders(n.accessToken,n.tenant),t.fetchUser(r,e)}))):t.fetchUser(r,e)})))},e.prototype.fetchUser=function(e,t){var r=this,o=new n.HttpHeaders({"Content-Type":"application/json"});return this.http.get(""+(t||"")+this.config.getUri("serviceBase")+this.userProfileUri,{headers:o,withCredentials:this.coreConfig.withCredentials}).pipe(i.switchMap((function(n){return r.profile={host:t||"",user:n.user.name,auth:null,active:!0},t&&r.addHostConfig(t),window.localStorage.setItem(r.loggedInCacheKey,JSON.stringify({userId:n.user.id,host:t})),r.initApp(n,e.ntlm)})),i.tap((function(){return r.authSource.next(r.isLoggedIn())})))},e.prototype.logout=function(e){this.authSource.next(!1),this.systemStatusService.stop(),this.profile={host:"",user:null,auth:null,active:!1},this.isCloudEnvironment()&&(this.storage.removeItem(this.TOKEN_STORAGE_KEY).subscribe(),this.coreConfig.environment.production&&Kt.isWebEnvironment())?window.location.href=this.config.getContextPath()+"/logout":(e&&this.http.get(""+(this.profile.host||"")+this.config.getContextPath()+"/logout",{withCredentials:this.coreConfig.withCredentials}).subscribe(),this.backend.setAuthProfile(this.profile),this.eventService.trigger(yt.LOGOUT))},e.prototype.isCloudEnvironment=function(){return this.gatewayInfo&&this.gatewayInfo.oauth2},e.prototype.addHostConfig=function(e){this.hosts.find((function(t){return t===e}))||this.hosts.push(e)},e.prototype.isLoggedIn=function(){return null!==this.profile.user},e.prototype.initApp=function(e,t){var r=new St(e);this.backend.setAuthProfile(this.profile),this.userService.setCurrentUser(e);var n=this.capabilitiesService.setCapabilities(e.capabilities,t);this.systemStatusService.init(this.config.getRaw("systemStatusUpdateInterval")),n.inbox&&this.inboxService.refreshInboxState(),n.intray&&this.prepareService.refreshPreparedItemsCount();var s=[this.bpmService.initExecutableProcesses(),this.systemService.getSystemDefinition(r)];return o.forkJoin(s).pipe(i.map((function(){return r})))},e}();$t.decorators=[{type:r.Injectable}],$t.ctorParameters=function(){return[{type:bt},{type:tt,decorators:[{type:r.Inject,args:[et]}]},{type:vt},{type:Wt},{type:n.HttpClient},{type:zt},{type:r.NgZone},{type:s.PlatformLocation},{type:Bt},{type:It},{type:Lt},{type:Nt},{type:xt},{type:At},{type:Rt},{type:gt},{type:Yt},{type:ee.LocalStorage},{type:Ht}]};var Zt=function(){function e(e,t,r,n,o){this.coreConfig=e,this.logger=t,this.http=r,this.configService=n,this.authService=o}return e.prototype.initialize=function(){var e=this;return new Promise((function(t,r){(Array.isArray(e.coreConfig.main)?o.forkJoin(e.coreConfig.main.map((function(t){return e.http.get(t,{withCredentials:e.coreConfig.withCredentials}).pipe(i.catchError((function(t){return e.logger.error("failed to catch config file",t),o.of({})})))}))):o.of([e.coreConfig.main])).pipe(i.map((function(e){return e.reduce((function(e,t){return Object.keys(t).forEach((function(r){return!e[r]||Array.isArray(t[r])||"object"!=typeof t[r]?e[r]=t[r]:Object.assign(e[r],t[r])})),e}),{})})),i.mergeMap((function(t){return e.configService.set(t),e.authService.initUser().pipe(i.catchError((function(e){return o.of(!0)})))}))).subscribe((function(e){t(!0)}),(function(t){e.logger.error(t),r()}))}))},e}();Zt.decorators=[{type:r.Injectable}],Zt.ctorParameters=function(){return[{type:tt,decorators:[{type:r.Inject,args:[et]}]},{type:It},{type:n.HttpClient},{type:bt},{type:$t}]};var Xt,er=function(e){Object.assign(this,e)},tr=function(e){this.subscriptions=[],this.resubmissions=[],this.storageInfo=[],this.additionalvisibility=[],this.id=e.id,this.title=e.title,this.description=e.description,this.version=e.version,this.versions=e.versions,this.data=e.data,this.typeName=e.type,this.isActiveVersion=e.activeversion,this.isFinalized=e.finalized,this.isFavorite=e.favorite,this.isFolder=e.folder,this.isContextFolder=!!e.iscontextfolder,this.storageInfo=e.storageinfo,e.contents&&e.contents[0]&&(this.contentFileName=e.contents[0].path,this.contentFileSize=e.contents[0].size),e.contextfolder&&(this.contextFolder={id:e.contextfolder.id,typeName:e.contextfolder.type,title:e.contextfolder.title,description:e.contextfolder.description}),e.created&&(this.created={on:e.created.on,by:{id:e.created.by.id,title:e.created.by.title,name:e.created.by.name}}),e.modified&&(this.modified={on:e.modified.on,by:{id:e.modified.by.id,title:e.modified.by.title,name:e.modified.by.name}}),"NOT_LOCKED"!==e.lock&&e.lockinfo&&(this.lock={on:e.lockinfo.time,by:{me:"LOCKED_BY_SESSION_USER"===e.lock,other:"LOCKED_BY_OTHER_USER"===e.lock,name:e.lockinfo.username,label:e.lockinfo.usertitle}}),e.rights&&e.rights.length>0?this.rights={select:e.rights[0].privileges.select,edit:e.rights[0].privileges.edit&&!(this.lock&&this.lock.by.other),delete:e.rights[0].privileges.delete&&!(this.lock&&this.lock.by.other),finalize:e.rights[0].privileges.finalize&&!(this.lock&&this.lock.by.other),recycle:e.rights[0].privileges.recycle&&!(this.lock&&this.lock.by.other)}:this.rights={select:!1,edit:!1,delete:!1,finalize:!1,recycle:!1},e.shares&&(this.shares=e.shares),e.contentid&&(this.content={id:e.contentid,type:e.contenttype,count:e.contentcount||0,linked:e.contentid!==e.id,contents:e.contents}),e.subscriptions&&(this.subscriptions=e.subscriptions),e.resubmissions&&(this.resubmissions=e.resubmissions),e.additionalvisibility&&(this.additionalvisibility=e.additionalvisibility)},rr=function(e){this.version=e.version,this.time=e.time,this.title=e.title,this.description=e.description,this.comment=e.comment,this.group=e.group,this.type=e.type,this.user=e.user,e.parameter&&(this.parameter=Object.assign(Object.assign({},e.parameter),{processId:e.parameter.procId,processName:e.parameter.procName,activityId:e.parameter.actId,activityName:e.parameter.actName}))};(Xt=e.SubscriptionMode||(e.SubscriptionMode={})).ONLY_INDEX_DATA_CHANGED="META",Xt.ONLY_DOCUMENT_CONTENT_CHANGED="CONTENT",Xt.DMS_OBJECT_CHANGED="BOTH";var nr=function(){function e(e,t,r){this.backend=e,this.systemService=t,this.eventService=r}return e.prototype.getDmsObject=function(e,t,r,n,o,s){var a=this,c="/dms/"+e,u={additionalvisibility:!0,subscription:"CURRENT",resubmission:"CURRENT",rights:"CURRENT",datameta:"true",contextfolder:"true",type:t,recyclebin:o,version:r,storageinfo:s,_intent:n};return this.backend.getViaTempCache(mt.buildUri(c,u)).pipe(i.catchError(mt.catchSkip((function(e){return 404===e.status}))),i.map((function(e){return a.resolveObjectTypes(new tr(e))})))},e.prototype.getDmsObjectByParams=function(e){return this.getDmsObject(e.id,e.type,e.version,e.intent,e.recyclebin,e.withStorageInfo)},e.prototype.resolveObjectTypes=function(e){return e.type=this.systemService.getObjectType(e.typeName),e.contextFolder&&(e.contextFolder.type=this.systemService.getObjectType(e.contextFolder.typeName)),e},e.prototype.deleteDmsObject=function(e,t,r){var n="/dms/"+e,o={};return t&&t.length>0&&(o.type=t),r&&(o.harddelete=r),this.backend.del(mt.buildUri(n,o))},e.prototype.getContextPath=function(e){return this.backend.get("/dms/"+e+"/context").pipe(i.map((function(e){return e.forEach((function(e){e.dmsobject=new tr(e.dmsobject)})),e})))},e.prototype.getChildren=function(e){var t=this,r="/dms/"+e.id+"/children";return this.backend.getViaTempCache(mt.buildUri(r,{type:e.type.name})).pipe(i.map((function(e){return e.map((function(e){return t.resolveObjectTypes(new tr(e))}))})))},e.prototype.getVersions=function(e,t){var r="/dms/"+e+"/versions";return this.backend.getViaTempCache(mt.buildUri(r,{type:t})).pipe(i.map((function(e){return new tr(e)})))},e.prototype.getAttachments=function(e){var t,r,n,s=this,a=null===(t=e.content)||void 0===t?void 0:t.type,c=(null===(r=e.content)||void 0===r?void 0:r.linked)?-1:e.version,u=null===(n=e.content)||void 0===n?void 0:n.id,p=mt.buildUri("/dms/"+u+"/attachments",{type:a,version:c});return u?this.backend.getViaTempCache(p).pipe(i.catchError(mt.catchSkip((function(e){return 404===e.status}))),i.map((function(e){return e.attachmentinfo&&e.attachmentinfo.attachments?e.attachmentinfo.attachments.map((function(e,t){return new er(Object.assign(e,{id:t,previewUri:s.getAttachmentByIndex(u,t,a,c)}))})):[]}))):o.of([])},e.prototype.getAttachmentByIndex=function(e,t,r,n){var o=mt.buildUri("/dms/"+e+"/attachments/"+t,{type:r,version:n});return this.backend.getServiceBase()+o},e.prototype.getSlide=function(e,t,r,n){return mt.buildUri(this.backend.getServiceBase()+"/dms/"+e+"/slide",{type:t,version:r,height:n})},e.prototype.getPreview=function(e,t,r,n){return mt.buildUri(this.backend.getServiceBase()+"/dms/"+e+"/content",{rendition:n,type:t,version:r})},e.prototype.updateObject=function(e,t,r,n,o){var i=mt.buildUri("/dms/"+e,{type:r,version:n,checkreferences:o});return this.triggerUpdate({id:e,type:r,typeName:r},this.backend.put(i,t))},e.prototype.getHistory=function(e,t){var r="/dms/"+e+"/audit";return this.backend.getJson(mt.buildUri(r,{type:t})).pipe(i.map((function(e){return e.audit.map((function(e){return new rr(e)}))})))},e.prototype.restoreVersion=function(e,t,r){var n="/dms/restoreversion/"+e+"/"+t;return this.backend.post(mt.buildUri(n,{type:r}),null)},e.prototype.triggerUpdate=function(e,t){var r=this;return e?t.pipe(i.mergeMap((function(){return r.getDmsObject(e.id,e.typeName)})),i.tap((function(e){return r.eventService.trigger(yt.DMS_OBJECT_UPDATED,e)}))):t},e.prototype.removeContent=function(e){var t="/dms/"+e.id+"/content";return this.triggerUpdate(e,this.backend.del(t))},e.prototype.createDmsObject=function(e,t,r,n){var o=new FormData;r?o.append("data",new Blob([JSON.stringify(r)],{type:"application/json"})):o.append("noindexdata",""),t&&o.append("files[]",t,mt.encodeFileName(t.name));var i="/dms/create/"+e;return n&&(i=mt.buildUri(i,{parentId:n.id,parentType:n.type})),this.backend.postMultiPart(i,o,null,{headers:{}})},e.prototype.createSubscription=function(e,t,r,n,o,i){var s="/dms/subscription/"+e.id;return this.triggerUpdate(e,this.backend.post(mt.buildUri(s,{subject:t,type:e.typeName,receiver:r,sendemail:n,onlyemail:o,mode:i}),{}))},e.prototype.createResubmission=function(e,t,r,n,o,i){var s="/dms/resubmission/"+e.id;return this.triggerUpdate(e,this.backend.post(mt.buildUri(s,{subject:t,type:e.typeName,receiver:n,due:r?r.toISOString():"",sendemail:o,onlyemail:i}),{}))},e.prototype.removeSubscriptionById=function(e,t){return this.triggerUpdate(t,this.backend.del("/messageprovider/subscription/"+e))},e.prototype.removeResubmissionsById=function(e,t){return this.triggerUpdate(t,this.backend.del("/dms/resubmission/"+e))},e.prototype.updateResubmission=function(e,t,r,n,o,s){var a=this;return this.removeResubmissionsById(e.id).pipe(i.mergeMap((function(){return a.createResubmission(e,t,r,n,o,s)})))},e.prototype.setOrganizationObjectsWithReadRights=function(e,t,r,n){var o="/dms/"+t+"/share",i={shares:Ct(n.map((function(e){return{organizationobject:e,sharechildren:!0}})),r.map((function(e){return{organizationobject:e,sharechildren:!1}})))};return this.triggerUpdate(e[0],this.backend.put(o,i))},e.prototype.move=function(e,t,r,n){var o="/dms/location/"+e;return this.backend.post(mt.buildUri(o,{type:t,parentId:r,parentType:n}),{})},e.prototype.copy=function(e,t,r,n,o){var i="/dms/copy/"+e;return this.backend.post(mt.buildUri(i,{type:t,parentId:r,parentType:n,createcontentlink:o}),{})},e.prototype.finalize=function(e){var t="/dms/finalize/"+e.id+"?type="+e.typeName;return this.triggerUpdate(e,this.backend.put(t))},e.prototype.definalize=function(e){var t="/dms/definalize/"+e.id+"?type="+e.typeName;return this.triggerUpdate(e,this.backend.put(t))},e.prototype.createLocalCopyOfDMSObject=function(e){var t={id:e.id,title:e.title,description:e.description,version:e.version,versions:e.versions,data:e.data,type:e.typeName,activeversion:e.isActiveVersion,finalized:e.isFinalized,favorite:e.isFavorite,folder:e.isFolder,iscontextfolder:e.isContextFolder,contextfolder:e.contextFolder?{id:e.contextFolder.id,type:e.contextFolder.typeName,title:e.contextFolder.title,description:e.contextFolder.description}:null,created:e.created,modified:e.modified,lock:e.lock?e.lock.by.me?"LOCKED_BY_SESSION_USER":"LOCKED_BY_OTHER_USER":"NOT_LOCKED",lockinfo:e.lock?{username:e.lock.by.name,usertitle:e.lock.by.label,time:e.lock.on}:null,rights:[{privileges:{select:e.rights.select,edit:e.rights.edit,delete:e.rights.delete,finalize:e.rights.finalize,recycle:e.rights.recycle}}],shares:e.shares,contentid:e.content?e.content.id:null,contenttype:e.content?e.content.type:null,contentcount:e.content?e.content.count:null,contents:e.content?e.content.contents:null,subscriptions:e.subscriptions,resubmissions:e.resubmissions,additionalvisibility:e.additionalvisibility},r=new tr(t);return r.type=e.type,r},e}();nr.decorators=[{type:r.Injectable}],nr.ctorParameters=function(){return[{type:xt},{type:At},{type:gt}]};var or=function(e){function t(r){var n,o,i=e.call(this)||this;if(r){if(i.id=r.id,i.name=r.name,i.favorite=r.favorite,i.shared=r.shared,i.user=r.user,i.version=r.version,i.roles=r.roles||[],i.parameter=[],r.parameter&&r.parameter.length>0)try{for(var s=Tt(r.parameter),a=s.next();!a.done;a=s.next()){var c=a.value;try{var u=JSON.parse(c),p={qname:u.qname,type:u.type};i.parameter.push(p)}catch(e){console.error("Failed parsing stored query parameter",e)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}}else i.id=t.ID_NEW,i.parameter=[];return i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Et(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),Object.defineProperty(t.prototype,"title",{get:function(){return this.name||""},enumerable:!1,configurable:!0}),t.prototype.setQuery=function(e){this.term=e?e.term:"",this.types=e?e.types:[],this.contextFolderTypes=e?e.contextFolderTypes:[],this.filters=e?e.filters:[],this.suggest=!!e&&e.suggest,this.expertMode=!!e&&e.expertMode,this.scope=e?e.scope:null,this.searchMode=e?e.searchMode:"idx"},t.prototype.toPersistableStoredQuery=function(){var e=[];return this.parameter.forEach((function(t){return e.push(JSON.stringify(t))})),{id:this.id,name:this.name,favorite:this.favorite,shared:this.shared,user:this.user,version:this.version,roles:this.roles,parameter:e,query:JSON.stringify(this.getQueryJson())}},t.prototype.isNew=function(){return this.id===t.ID_NEW},t}(at);or.ID_NEW="new";var ir=function(){function e(e,t,r){this.system=e,this.backend=t,this.config=r}return e.toRangeValue=function(e){if(e){if(e instanceof ft)return e;if(e.hasOwnProperty("operator")&&e.hasOwnProperty("firstValue"))return new ft(e.operator,e.firstValue,e.secondValue)}return e},e.prototype.buildQuery=function(e){var t,r,n=this;e instanceof at?t=e:(r="string"==typeof e?JSON.parse(e):e,(t=new at).term=r.term,r.filters&&Object.keys(r.filters).forEach((function(e){t.filters.push(new ht(e,r.filters[e].o,r.filters[e].v1,r.filters[e].v2))})),r.types&&r.types.forEach((function(e){n.system.getObjectType(e)?t.types.push(n.system.getObjectType(e)):t.types.push(e)})),r.contextfoldertypes&&r.contextfoldertypes.forEach((function(e){if("sysroot"===e){var r=new _t({id:"a",folder:!0,name:"sysroot",qname:"sysroot",label:"sysroot",iscontextfolder:!0,abstract:!1,elements:[],description:"",shareable:!1,minfiles:0,maxfiles:1});t.contextFolderTypes.push(r)}else t.contextFolderTypes.push(n.system.getObjectType(e))})),t.fields=r.fields,r.options&&(t.suggest=r.options.suggest||!1,t.expertMode=r.options.expertmode||!1,t.scope=r.options.scope,t.resolveReference=null!==r.options.resolvereference?r.options.resolvereference:null===r.options.resolveReference||r.options.resolveReference,t.withContext=r.options.withcontext||r.options.withContext||!1,t.searchMode=r.options.searchmode||at.DEFAULT_SEARCH_MODE));return t},e.prototype.search=function(e){var t=this;return this.executeQuery(e.getQueryJson()).pipe(i.map((function(e){return t.createResultFromResponse(e)})))},e.prototype.getSearchState=function(e){return e instanceof at&&(e=e.getQueryJson()),delete e.name,this.executeQuery(e,!0).pipe(i.map((function(e){var t=new pt;return t.count=e.hits.total,Object.keys(at.BASE_PARAMS).forEach((function(r){var n=at.BASE_PARAMS[r];(e.aggregations[n]?e.aggregations[n].buckets:[]).forEach((function(e){var r=e.key,o=e.doc_count,i=e.contextfoldertype;t.addAggregations(n,r,o,e),n===at.BASE_PARAMS.TYPE&&i&&i.buckets.forEach((function(e){t.addAggregations("contexttype",e.key,e.doc_count,e)}))}))})),t})))},e.prototype.getChunkedResult=function(e,t,r){var n=this,o=e.getQueryJson();o.from=t;var s="search!chunk:"+r+"!"+JSON.stringify(o);return this.backend.getViaTempCache(s,(function(){return n.executeQuery(o,!1,r).pipe(i.map((function(e){return n.createResultFromResponse(e)})))}))},e.prototype.executeQuery=function(e,t,r){var n,o=this,i=e;if(t)n="/aggregate";else{var s=r||this.config.getRaw("search.limit");n="/?size="+s}return i.options=Object.assign(Object.assign({},i.options),{tracktotalhits:this.config.getRaw("search.trackTotalHits")||!1,timezone:mt.getTimezoneOffset()}),this.backend.getViaTempCache(n+JSON.stringify(i),(function(){return o.backend.post(n,i,o.backend.getSearchBase())}))},e.prototype.downloadCsvFromQuery=function(e){var t=this;return this.backend.post("/export",e,this.backend.getSearchBase(),{observe:"response",responseType:"blob"}).pipe(i.tap((function(e){var r=new Blob([e.body],{type:"text/csv;charset=utf-8"});te.saveAs(r,t.getFileNameFromHttpResponse(e),{autoBom:!0})})))},e.prototype.getFileNameFromHttpResponse=function(e){return(e.headers.get("Content-Disposition")||"").split("filename=")[1]},e.prototype.autocomplete=function(e){return this.backend.getJson("/autocomplete?prefix="+encodeURIComponent(e),this.backend.getSearchBase())},e.prototype.getSearchFilter=function(e,t,r){var n=[],o=this.identifySearchFilter(e,t),i=e[0].elements.find((function(e){return e.qname===t}));if(null===r)n.push(new ht(t,ht.OPERATOR.EQUAL,null));else if(i&&"path"===i.classification)n.push(new ht(t,ht.OPERATOR.MATCH,r));else if(r instanceof ft)null!==r.firstValue&&void 0!==r.firstValue&&n.push(new ht(t,r.operator,r.firstValue,r.secondValue,o.datetime?{time:o.withtime}:void 0));else if(!o.multiselect&&!Array.isArray(r)||o.table)if(o.table){var s=r[0];Object.keys(s).forEach((function(e){if(void 0!==s[e]){var r=t+"."+e;s[e]instanceof ft?n.push(new ht(r,s[e].operator,s[e].firstValue,s[e].secondValue)):n.push(new ht(r,Array.isArray(s[e])?ht.OPERATOR.IN:ht.OPERATOR.EQUAL,s[e]))}}))}else n.push(new ht(t,ht.OPERATOR.EQUAL,r));else Array.isArray(r)&&r.length&&n.push(new ht(t,ht.OPERATOR.IN,r));return n},e.prototype.identifySearchFilter=function(e,t){for(var r,n=0;!r&&n<e.length;)r=e[n].elements.find((function(e){return e.qname===t})),n++;return{multiselect:this.isMultiselectSearchFilter(r),table:r&&"TABLE"===r.type,datetime:r&&"DATETIME"===r.type,withtime:r&&r.withtime}},e.prototype.isMultiselectSearchFilter=function(e){return e&&("ORGANIZATION"===e.type||"CODESYSTEM"===e.type||"STRING"===e.type&&"selector"===e.classification||"STRING"===e.type&&e.multiselect)},e.prototype.createResultFromResponse=function(e){var t=new lt;t.suggests=e.suggest,t.fields=e.config;var r=e.hits.hits.map((function(e){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e._source),{id:e._id}),e.snippets&&{snippets:e.snippets}),e.references&&{_references:e.references}),e.context&&{context:e.context})}));return t.count=e.hits.total,t.hits=r||[],t},e.prototype.getResultFieldDefinitionConfig=function(e){return{type:1===(e.types||[]).length?e.types[0]:null,contextType:1===(e.contextFolderTypes||[]).length?e.contextFolderTypes[0]:null}},e.prototype.resolveConfigTypeNames=function(e,t){return{typeName:e?e.qname:"sysobject",contextTypeName:e&&t?t.qname:void 0}},e.prototype.fetchResultFieldDefinition=function(e,t,r){var n=this.resolveConfigTypeNames(e,t),o=n.typeName,s=n.contextTypeName,a=mt.buildUri("/user/config/result/"+o,{contexttype:s,mode:r});return this.backend.getJson(a).pipe(i.map((function(e){return new ut(e.elements,e.sortorder,e.grouporder,e.pinned,e.alignmentx,e.mode)})))},e.prototype.saveResultFieldDefinition=function(e,t,r,n){void 0===n&&(n=!1);var o=n?"/user/config/commonresult/":"/user/config/result/",i=this.resolveConfigTypeNames(e,t),s=i.typeName,a=i.contextTypeName,c=mt.buildUri(o+s,{contexttype:a});return this.backend.post(c,r)},e.prototype.removeResultFieldDefinition=function(e,t){var r=this.resolveConfigTypeNames(e,t),n=r.typeName,o=r.contextTypeName,i=mt.buildUri("/user/config/result/"+n,{contexttype:o});return this.backend.del(i)},e.prototype.filterToElementValue=function(e,t){var r=void 0;return e&&(r="NUMBER"!==t&&"DATETIME"!==t||!e.firstValue?e.firstValue:new ft(e.operator,e.firstValue,e.secondValue)),r},e.prototype.tableFiltersToElementValue=function(e,t){var r=this,n={};return e.forEach((function(e){var o=t.find((function(t){return t.qname===e.property})).name,i=t.find((function(t){return t.qname===e.property})).type;n[o]=r.filterToElementValue(e,i)})),[n]},e}();ir.decorators=[{type:r.Injectable}],ir.ctorParameters=function(){return[{type:At},{type:xt},{type:bt}]};var sr=function(){function e(e,t,r,n){var i=this;this.backend=e,this.system=t,this.searchService=r,this.eventService=n,this.storedQueries={queries:[]},this.storedQueriesSource=new o.BehaviorSubject(this.storedQueries),this.storedQueries$=this.storedQueriesSource.asObservable(),n.on(yt.LOGOUT).subscribe((function(){return i.clear()}))}return e.prototype.clear=function(){this.storedQueries={queries:[]},this.storedQueriesSource.next(this.storedQueries)},e.prototype.getStoredQueries$=function(){return this.storedQueries.queries.length||this.fetchStoredQueries(),this.storedQueries$},e.prototype.refreshStoredQueries=function(){this.fetchStoredQueries()},e.prototype.fetchStoredQueries=function(){var e=this;this.backend.getJson("/storedqueries?size=9999",this.backend.getSearchBase()).pipe(i.map((function(t){return(t||[]).map((function(t){var r=new or(t);return r.setQuery(e.searchService.buildQuery(t.query)),r}))}))).subscribe((function(t){e.storedQueries={queries:t},e.storedQueriesSource.next(e.storedQueries)}))},e.prototype.saveNewStoredQuery=function(e){var t=this;return this.backend.post("/storedqueries",e.toPersistableStoredQuery(),this.backend.getSearchBase()).pipe(i.map((function(e){var r=new or(e);return r.setQuery(t.searchService.buildQuery(e.query)),t.storedQueries.select=r.id,t.storedQueries.queries.push(r),t.storedQueriesSource.next(t.storedQueries),r})))},e.prototype.updateStoredQuery=function(e){var t=this;return this.backend.put("/storedqueries",e.toPersistableStoredQuery(),this.backend.getSearchBase()).pipe(i.map((function(e){var r=new or(e);return r.setQuery(t.searchService.buildQuery(e.query)),t.storedQueries.select=r.id,t.storedQueries.queries=t.storedQueries.queries.filter((function(e){return e.id!==r.id})),t.storedQueries.queries.push(r),t.storedQueriesSource.next(t.storedQueries),r})))},e.prototype.saveStoredQuery=function(t){return t.id===e.ID_NEW?this.saveNewStoredQuery(t):this.updateStoredQuery(t)},e.prototype.removeStoredQuery=function(e){var t=this;return this.backend.del("/storedqueries/"+e,this.backend.getSearchBase()).pipe(i.tap((function(){t.storedQueries.select=null,t.storedQueries.queries=t.storedQueries.queries.filter((function(t){return t.id!==e})),t.storedQueriesSource.next(t.storedQueries)})))},e.prototype.getFulltextFormElement=function(t,r){return{name:e.FULLTEXT,qname:e.FULLTEXT,label:t,value:r,type:"STRING"}},e}();sr.ID_NEW=or.ID_NEW,sr.FULLTEXT="fulltext",sr.decorators=[{type:r.Injectable}],sr.ctorParameters=function(){return[{type:xt},{type:At},{type:ir},{type:gt}]};var ar=function(){function e(e){var t=this;this.eventService=e,this.cacheKey="eo.clipboard",this.clipboard={action:null,elements:[]},this.clipboardSource=new o.ReplaySubject(1),this.clipboard$=this.clipboardSource.asObservable(),e.on(yt.LOGOUT).subscribe((function(e){t.clear()})),this.loadCachedClipboard(),window.addEventListener("storage",(function(e){e.key===t.cacheKey&&t.loadCachedClipboard()}))}return e.prototype.set=function(e,t,r){this.clipboard={action:t,elements:e},r||this.updateCache(),this.clipboardSource.next(this.clipboard)},e.prototype.get=function(){return this.clipboard},e.prototype.clear=function(){this.clipboard={action:null,elements:[]},this.updateCache(),this.clipboardSource.next(this.clipboard)},e.prototype.updateCache=function(){window.localStorage.setItem(this.cacheKey,JSON.stringify(this.clipboard))},e.prototype.loadCachedClipboard=function(){var e=window.localStorage.getItem(this.cacheKey);try{var t=JSON.parse(e);t?this.set(t.elements,t.action,!0):this.clear()}catch(e){}},e}();ar.decorators=[{type:r.Injectable}],ar.ctorParameters=function(){return[{type:gt}]};var cr=function(){function e(e){this.toastrService=e,this.options={closeButton:!0,positionClass:"toast-bottom-right",timeOut:15e3}}return e.prototype.info=function(e,t){this.toast(e,t)},e.prototype.confirm=function(e,t,r,n){this.toast(e,t,"confirm",{onAdd:r,onRemove:n,timeOut:7e3})},e.prototype.success=function(e,t){this.toast(e,t,"success")},e.prototype.wait=function(e,t){this.toast(e,t,"wait")},e.prototype.error=function(e,t){this.toast(e,t,"error",{closeButton:!0,timeOut:7e3})},e.prototype.warning=function(e,t){this.toast(e,t,"warning")},e.prototype.toast=function(e,t,r,n){var o=Object.assign({},this.options,n);this.doToast(t,e,o,r)},e.prototype.doToast=function(e,t,r,n){switch(n){case"success":this.toastrService.success(e,t,r);break;case"error":this.toastrService.error(e,t,r);break;case"warning":this.toastrService.warning(e,t,r);break;case"confirm":this.toastrService.info(e,t,r);break;default:this.toastrService.info(e,t,r)}},e}();cr.decorators=[{type:r.Injectable}],cr.ctorParameters=function(){return[{type:ne.ToastrService}]};var ur=function(){function e(){}return e.prototype.apply=function(e,t){return console&&console[e]&&console[e].apply(console,Ct(t))},e.prototype.assert=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("assert",e)},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("debug",e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("error",e)},e.prototype.group=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("group",e)},e.prototype.groupEnd=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("groupEnd",e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("info",e)},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("log",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("warn",e)},e}();ur.decorators=[{type:r.Injectable}];var pr=function(){function e(e){this.prepareService=e,this._targets=[],this.targetsSource=new o.ReplaySubject(1),this.uploadTargets$=this.targetsSource.asObservable()}return e.prototype.setOverlayActive=function(e){this.overlayActive=e},e.prototype.isOverlayActive=function(){return this.overlayActive},e.prototype.register=function(e){var t,r,n=this;e.referenceObject&&(e.description=("object"===e.type&&(null===(r=null===(t=e.referenceObject)||void 0===t?void 0:t.type)||void 0===r?void 0:r.label)?e.referenceObject.type.label+": ":"")+e.referenceObject.title,e.subFolder&&this.prepareService.getPrepareChildTypes(e.referenceObject.id).subscribe((function(t){n.isSubFolderAllowed(e.subFolder.data,t.types)&&(e.description+="; "+e.subFolder.name)})));var o=this._targets.find((function(t){return t.id===e.id}));o?Object.assign(o,e):this._targets.push(e),this.targetsSource.next(this._targets)},e.prototype.isSubFolderAllowed=function(e,t){return!!t.find((function(t){return t.name===e.type}))},e.prototype.unregister=function(e){this._targets=this._targets.filter((function(t){return t.id!==e})),this.targetsSource.next(this._targets)},e}();pr.decorators=[{type:r.Injectable}],pr.ctorParameters=function(){return[{type:Nt}]};var lr=function(){};lr.decorators=[{type:r.NgModule,args:[{exports:[ne.ToastrModule,t.TranslateModule]}]}];var hr=function(){function e(e){this.auth=e}return e.prototype.intercept=function(e,t){var r=this;return t.handle(e).pipe(i.tap((function(e){n.HttpResponse}),(function(e){(e instanceof n.HttpErrorResponse||e.isHttpErrorResponse)&&401===e.status&&r.auth.logout()})))},e}();hr.decorators=[{type:r.Injectable}],hr.ctorParameters=function(){return[{type:$t}]};var fr=function(){function e(e){if(e)throw new Error("EoCoreModule is already loaded. Import it in the AppModule only")}return e.forRoot=function(o){return{ngModule:e,providers:[Zt,{provide:n.HTTP_INTERCEPTORS,useClass:hr,multi:!0},{provide:Xe,useValue:o},{provide:et,useClass:tt,deps:[Xe]},{provide:r.APP_INITIALIZER,useFactory:rt,deps:[Zt],multi:!0},{provide:t.TranslateLoader,useClass:ot,deps:[n.HttpClient,et]},{provide:t.MissingTranslationHandler,useClass:nt}]}},e}();fr.decorators=[{type:r.NgModule,args:[{imports:[n.HttpClientModule,t.TranslateModule.forRoot(),ne.ToastrModule.forRoot()],providers:[$t,xt,It,Rt,ir,At,vt,nr,bt,Nt,Lt,zt,Bt,ar,Dt,cr,Ht,sr,gt,pr,Wt,{provide:It,useClass:ur},Yt],exports:[lr]}]}],fr.ctorParameters=function(){return[{type:fr,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var dr=function(e){this.id=mt.uuid(),this.name=e.name,this.size=e.size,this.type=e.type,this._file=e};Object.defineProperty(e,"TranslateLoader",{enumerable:!0,get:function(){return t.TranslateLoader}}),Object.defineProperty(e,"TranslateModule",{enumerable:!0,get:function(){return t.TranslateModule}}),Object.defineProperty(e,"TranslateService",{enumerable:!0,get:function(){return t.TranslateService}}),e.AppCacheService=vt,e.AuthService=$t,e.BackendService=xt,e.BpmService=zt,e.CORE_CONFIG=et,e.CUSTOM_CONFIG=Xe,e.CapabilitiesService=Bt,e.ClipboardService=ar,e.Config=bt,e.CoreConfig=tt,e.CoreInit=Zt,e.DmsObject=tr,e.DmsObjectAttachment=er,e.DmsObjectHistoryEntry=rr,e.DmsService=nr,e.EnaioEvent=yt,e.EnvironmentEnaio=Kt,e.EnvironmentService=Wt,e.EoCoreModule=fr,e.EoError=st,e.EoSharedModule=lr,e.EoUser=St,e.EoxMissingTranslationHandler=nt,e.EoxTranslateJsonLoader=ot,e.EventService=gt,e.FieldDefinition=ut,e.InboxItem=Ut,e.InboxService=Lt,e.LocalStorageService=Ht,e.Logger=It,e.NotificationsService=cr,e.ObjectType=_t,e.PrepareService=Nt,e.PreparedItem=Pt,e.Process=Gt,e.RangeValue=ft,e.SearchFilter=ht,e.SearchQuery=at,e.SearchResult=lt,e.SearchService=ir,e.SearchState=pt,e.SortOption=ct,e.StoredQueriesService=sr,e.StoredQuery=or,e.SystemService=At,e.UploadFileItem=dr,e.UploadRegistryService=pr,e.UploadService=Dt,e.UploadTarget=jt,e.UserService=Rt,e.Utils=mt,e.WorkItem=Vt,e.WorkItemHistoryEntry=Qt,e.init_module=rt,e.ɵa=Yt,e.ɵb=ur,e.ɵc=hr,Object.defineProperty(e,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */Object.create;function Tt(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ot(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function Ct(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ot(arguments[t]));return e}Object.create;var It=function(){function e(){}return e.prototype.assert=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.group=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.groupEnd=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e}();It.decorators=[{type:r.Injectable}];var xt=function(){function e(e,t,r,n){this.http=e,this.coreConfig=t,this.logger=r,this.config=n,this.gridDataFilter=i.map((function(e){return null==e?void 0:e.filter((function(e){return!e.__removed}))})),this.cache=new Map,this.temp=new Map,this.headers=this.setDefaultHeaders(),this.authProfile={host:"",ntlm:!0}}return e.prototype.setAuthProfile=function(e){e&&(this.headers=this.setDefaultHeaders(),this.authProfile=e,this.authProfile.auth,this.headers.delete("Authorization"))},e.prototype.setHeader=function(e,t){t&&t.length&&(this.headers=this.headers.set(e,t))},e.prototype.getHeaders=function(){return this.headers},e.prototype.getHttpOptions=function(e){return Object.assign({headers:this.getHeaders(),withCredentials:this.coreConfig.withCredentials},e)},e.prototype.getServiceBase=function(){return this.config.getUri("serviceBase")},e.prototype.getSearchBase=function(){return this.config.getUri("searchBase")},e.prototype.getContextBase=function(){return this.config.getUri("contextBase")},e.prototype.getInboxBase=function(){return this.config.getUri("inboxBase")},e.prototype.getBpmBase=function(){return this.config.getUri("bpmBase")},e.prototype.getAgentBase=function(){return this.config.getUri("agentBase")},e.prototype.getStatusBase=function(){return this.config.getUri("statusBase")},e.prototype.getIconBase=function(e){return void 0===e&&(e=""),this.getServiceBase()+"/ui/icon/"+e},e.prototype.getHost=function(){return this.authProfile.host||""},e.prototype.getBaseWithContext=function(e){return(null==e?void 0:e.startsWith("/"))?this.config.getContextPath()+e:e},e.prototype.getContextPath=function(e){return this.getHost()+this.getBaseWithContext(e||this.getServiceBase())},e.prototype.get=function(e,t,r){return this.http.get(this.getContextPath(t)+e,this.getHttpOptions(r))},e.prototype.put=function(e,t,r,n){return this.http.put(this.getContextPath(r)+e,t,this.getHttpOptions(n))},e.prototype.getJson=function(e,t){return this.http.get(this.getContextPath(t)+e,this.getHttpOptions({responseType:"json"}))},e.prototype.post=function(e,t,r,n){var o=this.getContextPath(r),i=t?JSON.stringify(t):"";return this.http.post(""+o+e,i,this.getHttpOptions(n))},e.prototype.postMultiPart=function(e,t,r,n){var o=this.getContextPath(r),i=this.getHeaders();i.delete("Content-Type");var s=Object.assign({headers:i,withCredentials:this.coreConfig.withCredentials},n);return this.http.post(""+o+e,t,s)},e.prototype.del=function(e,t,r){return this.http.delete(this.getContextPath(t)+e,this.getHttpOptions(r))},e.prototype.update=function(e,t){return t.forEach((function(t){var r=t.id,n=t.item;if(r){var o=e.find((function(e){return e.id===r}));Object.assign(o,n,n?{__updated:!0}:{__removed:!0})}else n&&e.unshift(Object.assign(n,{__added:!0}))})),e},e.prototype.getViaCache=function(e){var t=this;return this.cache.has(e)?o.of(this.cache.get(e)):this.getViaTempCache(e,(function(){return t.http.get(e,{withCredentials:t.coreConfig.withCredentials,responseType:"text"}).pipe(i.tap((function(r){return t.cache.set(e,r)})))}))},e.prototype.getViaTempCache=function(e,t){var r=this;if(this.temp.has(e))return this.temp.get(e);var n=(t?t():this.get(e)).pipe(i.finalize((function(){return r.temp.delete(e)})),i.shareReplay(1));return this.temp.set(e,n),n},e.prototype.downloadContent=function(e,t,r){var n=e[0];if(1===e.length)if(n.content){var o=this.getServiceBase()+"/dms/"+n.content.id+"/content?type="+n.content.type+"&asdownload=true";o+=t?"&rendition="+t+"&_intent=DOWNLOAD_"+t:"&_intent=DOWNLOAD",n.content.id===n.id&&(o+="&version="+n.version),this.download(o,r?n.version:null)}else this.logger.error("The provided dms object has no content",n);if(e.length>1){o=this.getServiceBase()+"/dms/batch/export";if(n.content){var i={query:{expression:Ct(e.map((function(e){return e.content.id})))},options:{rendition:""}};i.options.rendition=t?"PDF":null,this.downloadMulti(o,r?n.version:null,i)}else this.logger.error("The provided dms object has no content",n)}},e.prototype.download=function(e,t){var r=this;this.http.get(e,{observe:"response",responseType:"blob",withCredentials:this.coreConfig.withCredentials}).subscribe((function(e){te.saveAs(e.body,r.getFileNameFromHttpResponse(e,t))}))},e.prototype.downloadMulti=function(e,t,r){var n=this;this.http.post(e,r,{observe:"response",responseType:"blob",withCredentials:this.coreConfig.withCredentials}).subscribe((function(e){te.saveAs(e.body,n.getFileNameFromHttpResponse(e,t))}))},e.prototype.getFileNameFromHttpResponse=function(e,t){var r=e.headers.get("Content-Disposition")||"",n=r.match("filename\\*=UTF-8''(.*)")||r.match('filename="(.*)"'),o=n?n[1]:null,i=o?decodeURIComponent(o):"unknown",s=~i.lastIndexOf(".")?i.lastIndexOf("."):i.length;return t?i.slice(0,s)+"_v"+t+i.slice(s):i},e.prototype.setDefaultHeaders=function(){return new n.HttpHeaders({"Content-Type":"application/json","X-os-include-links":"false","X-os-include-actions":"false","X-os-sync-index":"true"})},e}();xt.decorators=[{type:r.Injectable}],xt.ctorParameters=function(){return[{type:n.HttpClient},{type:tt,decorators:[{type:r.Inject,args:[et]}]},{type:It},{type:bt}]};var kt,_t=function(){function e(e){this.id=e.id,this.implements=e.implements?e.implements:[],this.isFolder=e.folder,this.isContextFolder=e.iscontextfolder,this.isAbstract=e.abstract,this.iconId=e.icon?e.icon.id:null,this.maxFiles=e.maxfiles,this.minFiles=e.minfiles,this.name=e.name,this.qname=e.qname,this.label=e.label,this.description=e.description,this.group=e.group?e.group.label:"",this.elements=e.elements,this.allowedcontexttypes=e.allowedcontexttypes?e.allowedcontexttypes:[],this.supertypes=e.supertypes?e.supertypes.map((function(e){return e.name})):[],this.shareable=e.shareable,this.parenttypes=this.getParentTypes(e.allowedlocations)}return e.prototype.getParentTypes=function(e){return e?e.parenttypes.map((function(e){return e.name})):[]},e}(),wt=Ze,At=function(){function e(e,t,r,n){var i=this;this.backend=e,this.logger=t,this.eventService=r,this.appCache=n,this.systemSource=new o.ReplaySubject,this.system$=this.systemSource.asObservable(),this.objectTypeForms=[],this.cachedRoles=[],this.eventService.on(yt.SYSTEM_STATUS_SCHEMA_CHANGED).subscribe((function(){i.fetchSystemDefinition(i.user)}))}return Object.defineProperty(e.prototype,"system",{get:function(){return JSON.parse(JSON.stringify(this._system))},set:function(e){this._system=e},enumerable:!1,configurable:!0}),e.prototype.getObjectTypes=function(){return this.system.types},e.prototype.getObjectType=function(e){return this.system.types.find((function(t){return t.name===e}))},e.prototype.getFormElementsFromFormModel=function(e,t,r){var n=this;return this.getObjectTypeForm(e,t,r?"CONTEXT":null).pipe(i.switchMap((function(e){var t=[];return n.processFormModelElements(e,t),o.of(t)})))},e.prototype.processFormModelElements=function(e,t){var r=this;e.elements.forEach((function(e){"o2mGroup"!==e.type&&"o2mGroupStack"!==e.type?t.push(e):e.elements&&e.elements.length&&r.processFormModelElements(e,t)}))},e.prototype.implementsType=function(e,t){return e.name===t||e.implements&&-1!==e.implements.indexOf(t)},e.prototype.getCodesystem=function(e){return this.system.codesystems.find((function(t){return t.id===e||t.name===e}))},e.prototype.getObjectTypeForm=function(e,t,r){for(var n,s=this,a=0;!n&&a<this.objectTypeForms.length;)this.objectTypeForms[a].name===e&&this.objectTypeForms[a].mode===r&&this.objectTypeForms[a].situation===t&&(n=this.objectTypeForms[a]),a++;if(n)return o.of(re.cloneDeep(n));var c="/ui/form/"+e+"?situation="+t;return c+=r?"&formmode="+r:"",this.backend.getViaTempCache(c,(function(){return s.backend.getJson(c).pipe(i.tap((function(e){return s.objectTypeForms.push(re.cloneDeep(e))})))}))},e.prototype.getSystemDefinition=function(e){return this.user=e,this.fetchSystemDefinition(e)},e.prototype.getDefaultValue=function(e){var t;switch(e){case"CURRENT_USER":t=this.user.name;break;case"CURRENT_USER_NAME":t=this.user.title;break;case"CURRENT_DATETIME":t=new Date;break;case"CURRENT_DATE":t=wt().startOf("day").toDate();break;case"YEAR":t=wt().year();break;case"MONTH":t=wt().month()+1;break;case"DAY":t=wt().date();break;case"HOUR":t=wt().hour();break;case"MINUTE":t=wt().minute();break;case"SECOND":t=wt().second();break;case"WEEK_OF_YEAR":t=wt().isoWeek();break;case"FIRST_DAY_OF_WEEK":t=wt().startOf("isoWeek").toDate();break;case"FIRST_DAY_OF_MONTH":t=wt().startOf("month").toDate();break;case"FIRST_DAY_OF_YEAR":t=wt().startOf("year").toDate()}return t},e.prototype.fetchSystemDefinition=function(e){var t=this,r=[this.backend.getJson("/system/type/list?elements=true&basetypes=true"),this.backend.getJson("/system/cs/list?elements=true")];return o.forkJoin(r).pipe(i.catchError(mt.catch((function(e){t.logger.error("Error fetching recent version of system definition from server.",e),t.systemSource.error("Error fetching recent version of system definition from server.")}))),i.map((function(r){t.objectTypeForms=[];var n={info:{user:e.id,locale:e.getSchemaLocale(),version:e.schema.version},locales:e.schema.supportedLocales,types:[],codesystems:[]},o=r[0];return n.types=o.map((function(e){return new _t(e)})),n.codesystems=r[1],t.system=n,t.systemSource.next(n),t.logger.debug("Fetched new version of system definition (user: "+e.id+", version: "+e.schema.version+")."),t.appCache.setItem(t.appCache.SYSTEM_DEFINITION,n).subscribe((function(){t.logger.debug("Cached recent version")}),mt.logError(null,"Error caching recent version of system definition.")),!0})))},e.prototype.getOrganizationObjectById=function(e){return this.backend.getJson("/organization/id/"+e)},e.prototype.getOrganizationObject=function(e){return this.getOrganizationObjects([e]).pipe(i.map((function(e){return e[0]})))},e.prototype.getOrganizationObjects=function(e){var t=this,r=e.map((function(e){return t.backend.getJson("/organization/name/"+e).pipe(i.catchError((function(t){return o.of({id:e,active:!1})})))}));return o.forkJoin(r)},e.prototype.getRoles=function(){var e=this;return this.cachedRoles.length?o.of(this.cachedRoles):this.backend.get("/organization/role").pipe(i.map((function(e){return e})),i.tap((function(t){return e.cachedRoles=t})))},e}();At.decorators=[{type:r.Injectable}],At.ctorParameters=function(){return[{type:xt},{type:It},{type:gt},{type:vt}]},(kt=e.Direction||(e.Direction={})).LTR="ltr",kt.RTL="rtl";var Rt=function(){function t(e,t,r,n,s,a,c){this.backend=e,this.translate=t,this.logger=r,this.eventService=n,this.system=s,this.http=a,this.config=c,this.USER_FETCH_URI="/user?favorites=true&privileges=true&roles=true&deputies=true&substitutesOf=true",this.user=null,this.userSource=new o.BehaviorSubject(this.user),this.user$=this.userSource.asObservable(),this.favorites=null,this.favoritesSource=new o.BehaviorSubject(this.favorites),this.favoritesGridData$=this.favoritesSource.asObservable().pipe(i.debounceTime(100),i.filter((function(e){return e}))),this.favorites$=this.favoritesGridData$.pipe(this.backend.gridDataFilter),this.notifications=null,this.notificationsSource=new o.BehaviorSubject(this.notifications),this.notificationsGridData$=this.notificationsSource.asObservable().pipe(i.debounceTime(100),i.filter((function(e){return e}))),this.notifications$=this.notificationsGridData$.pipe(this.backend.gridDataFilter)}return t.prototype.getCurrentUser=function(){return this.user},t.prototype.setPresence=function(e){var t=this;return e!==this.user.present?this.backend.put("/user?presence="+e).pipe(i.tap((function(r){t.user.present=e,t.userSource.next(t.user)}))):o.of(null)},t.prototype.delUserImage=function(e){return this.http.put(e,null)},t.prototype.setUserImage=function(e){return this.backend.put("/user/image",e)},t.prototype.setDeputies=function(e){var t=this;return this.backend.put("/user/deputy?user="+e.join("&user=")).pipe(i.tap((function(){return t.refreshCurrentUser().subscribe()})))},t.prototype.changeClientLocale=function(t){var r=this;this.user.userSettings.clientlocale=t,this.backend.put("/user/config/web",this.user.userSettings).subscribe((function(){r.logger.debug("Changed client locale to '"+t+"'"),r.translate.use(t),r.user.uiDirection=(r.config.getClientLocales().find((function(e){return e.iso===t}))||{}).dir||e.Direction.LTR,r.userSource.next(r.user),r.eventService.trigger(yt.CLIENT_LOCALE_CHANGED,t)}))},t.prototype.changeSchemaLocale=function(e){var t=this;return this.user.schemaLocale=e,this.backend.put("/user/locale/"+this.user.schemaLocale).pipe(i.tap((function(){t.logger.debug("Changed schema locale to '"+e+"'"),t.userSource.next(t.user),t.backend.setHeader("Accept-Language",t.user.getSchemaLocale()),t.logger.debug("Loading system definition for new locale."),t.system.getSystemDefinition(t.user).subscribe(),t.eventService.trigger(yt.SCHEMA_LOCALE_CHANGED,e)})))},t.prototype.setCurrentUser=function(t){this.user=new St(t),this.passwordValidationSettings=t.passwortvalidation,this.user.setImageBase(this.backend.getServiceBase()),this.backend.setHeader("Accept-Language",this.user.getSchemaLocale());var r=this.config.getClientLocales().map((function(e){return e.iso})),n=this.user.getClientLocale();-1===r.indexOf(n)&&(n=this.config.getDefaultClientLocale()),this.logger.debug("Setting client locale to '"+n+"'"),this.translate.use(n),this.user.uiDirection=(this.config.getClientLocales().find((function(e){return e.iso===n}))||{}).dir||e.Direction.LTR,this.userSource.next(this.user),this.favorites=null,this.favoritesSource.next(this.favorites),this.notifications=null,this.notificationsSource.next(this.notifications)},t.prototype.getFavorites=function(){var e=this;return this.backend.getJson("/user/favorites").pipe(i.map((function(e){return e&&e.filter((function(e){return"DMS_OBJECT"===e.favoritetype}))})),i.tap((function(t){e.favorites=t,e.favoritesSource.next(e.favorites)})))},t.prototype.updateFavorites=function(e,t,r){this.backend.update(this.favorites,r||[{id:e,item:t}])&&this.favoritesSource.next(this.favorites)},t.prototype.getNotifications=function(){var e=[this.getSubscription(),this.getResubmission()];return o.forkJoin(e)},t.prototype.getResubmission=function(){var e=this;return this.backend.getJson("/messageprovider/resubmission/list").pipe(i.tap((function(t){e.notifications=t,e.notificationsSource.next(e.notifications)})))},t.prototype.getSubscription=function(){var e=this;return this.backend.getJson("/messageprovider/subscription/list").pipe(i.tap((function(t){e.notifications=t,e.notificationsSource.next(e.notifications)})))},t.prototype.removeNotifications=function(e,t){var r,n=this;switch(t){case"SUBSCRIPTION":r="subscription";break;case"RESUBMISSION":r="resubmission";break;default:return}return this.backend.del("/messageprovider/"+r+"/"+e).pipe(i.tap((function(e){return n.updateNotifications("")})))},t.prototype.updateNotifications=function(e,t,r){this.backend.update(this.notifications,r||[{id:e,item:t}])&&this.notificationsSource.next(this.notifications)},t.prototype.getUserImageUri=function(e){return this.backend.getServiceBase()+"/organization/image/"+e+"?usedefault=true"},t.prototype.removeFavorite=function(e){var t=this;return this.backend.del("/user/favorite/"+e).pipe(i.tap((function(r){return t.updateFavorites(e)})))},t.prototype.createFavorite=function(e,t,r){var n=this,o=mt.buildUri("/dms/favorite/"+e,{type:t,title:r});return this.backend.post(o,{}).pipe(i.tap((function(e){return n.getFavorites().subscribe()})))},t.prototype.removeFavoritesForTarget=function(e){var t=this;return this.backend.del("/dms/favorite/"+e).pipe(i.tap((function(r){var n=t.favorites.filter((function(t){return t.target.id===e})).map((function(e){return Object.assign({id:e.id})}));t.updateFavorites(null,null,n)})))},t.prototype.changeLockSetting=function(e){var t=this;return this.user.userSettings.alwayslock=e,this.backend.put("/user/config/web",this.user.userSettings).pipe(i.map((function(){t.refreshCurrentUser().subscribe()})))},t.prototype.hasPrivilege=function(e){return!!this.user.privileges.find((function(t){return t.name===e}))},t.prototype.changePassword=function(e){return this.backend.put("/user/password",e)},t.prototype.refreshCurrentUser=function(){var e=this;return this.backend.get(this.USER_FETCH_URI).pipe(i.map((function(t){return e.setCurrentUser(t)})))},t.prototype.validatePassword=function(e){return e.length<this.passwordValidationSettings.minlength?{type:"short",amount:this.passwordValidationSettings.minlength}:e.replace(/[^0-9]/g,"").length<this.passwordValidationSettings.minnumber?{type:"number",amount:this.passwordValidationSettings.minnumber}:e.replace(/[a-zA-Z0-9ß ]/g,"").length<this.passwordValidationSettings.minspecialchars?{type:"specialchars",amount:this.passwordValidationSettings.minspecialchars}:{type:"valid",amount:null}},t.prototype.changeSavedInboxFilters=function(e){var t=this;return this.user.userSettings.savedInboxFilter=e,this.backend.put("/user/config/web",this.user.userSettings).pipe(i.map((function(){t.refreshCurrentUser().subscribe()})))},t}();Rt.decorators=[{type:r.Injectable}],Rt.ctorParameters=function(){return[{type:xt},{type:t.TranslateService},{type:It},{type:gt},{type:At},{type:n.HttpClient},{type:bt}]};var Pt=function(){function e(e){Object.assign(this,e)}return Object.defineProperty(e.prototype,"title",{get:function(){return this.selectedtype?this.selectedtype.label:""},enumerable:!1,configurable:!0}),e.prototype.hasContent=function(){return!!this.template||this.contentcount>0},e.prototype.getSelectedTypeObject=function(){return this.types.find((function(e){return e.selected}))},e}(),Dt=function(){function e(e,t,r){this.coreConfig=e,this.http=t,this.userService=r}return e.prototype.upload=function(e,t){var r=new FormData,o=new n.HttpHeaders({"Accept-Language":this.userService.getCurrentUser().getClientLocale()});return t.forEach((function(e){return r.append("files[]",e,mt.encodeFileName(e.name))})),this.http.post(e,r,{headers:o,withCredentials:this.coreConfig.withCredentials})},e}();Dt.decorators=[{type:r.Injectable}],Dt.ctorParameters=function(){return[{type:tt,decorators:[{type:r.Inject,args:[et]}]},{type:n.HttpClient},{type:Rt}]};var jt=function(){function e(e,t){this.id=e,this.type=t}return e.prototype.onUploadSuccess=function(e){return e},e.prototype.onUploadFail=function(){return{}},e}();jt.ROOT="root",jt.CONTEXT="context",jt.CONTEXT_TREE="contexttree",jt.OBJECT="object",jt.CUSTOM="custom";var Nt=function(){function e(e,t){this.backend=e,this.uploadService=t,this.preparedItemsSource=new o.ReplaySubject(1),this.preparedItems$=this.preparedItemsSource.asObservable(),this.preparedItemCountSource=new o.ReplaySubject(1),this.preparedItemCount$=this.preparedItemCountSource.asObservable()}return e.prototype.refreshPreparedItemsCount=function(){this.fetchPreparedItemsCount()},e.prototype.fetchPreparedItemsCount=function(){var e=this;this.backend.getJson("/prepare/state").pipe(i.map((function(e){return e.count}))).subscribe((function(t){e.preparedItemCount=t,e.preparedItemCountSource.next(e.preparedItemCount)}))},e.prototype.createPreparedItem=function(e,t){var r=this;return this.backend.post(this.createPreparedItemPostUrl({parentId:e,childType:t||null}),{}).pipe(i.tap((function(){return r.getPreparedItems$()})))},e.prototype.updatePreparedItemIndexData=function(e,t){var r=this;return this.backend.put("/prepare/"+e,t).pipe(i.tap((function(){return r.getPreparedItems$()})))},e.prototype.createPreparedItemPostUrl=function(e){var t=e.createMany?"/prepare/createmany":"/prepare/create";return e&&(t=mt.buildUri(t,e)),t},e.prototype.getPreparedItems$=function(e){return this.fetchPreparedItems(e).subscribe(),this.preparedItems$},e.prototype.fetchPreparedItems=function(e){var t=this,r=e?"/prepare":"/prepare?form=true";return this.backend.getJson(r).pipe(i.map((function(e){return e.map((function(e){return new Pt(e)}))})),i.tap((function(){return t.fetchPreparedItemsCount()})),i.tap((function(e){return t.preparedItemsSource.next(e.sort(mt.sortValues("created","desc")))})))},e.prototype.deletePreparedItem=function(e){var t=this;return this.backend.del("/prepare/"+e).pipe(i.tap((function(){return t.getPreparedItems$()})))},e.prototype.getPrepareRootTypes=function(){return this.backend.getViaTempCache("/prepare/types").pipe(i.map((function(e){return e.types.map((function(e){return new _t(e)}))})))},e.prototype.getPrepareChildTypes=function(e,t){var r=e?{parentId:e,withcontent:t}:{withcontent:t},n=mt.buildUri("/prepare/types",r);return this.backend.getViaTempCache(n).pipe(i.map((function(e){return{parent:e.parent,types:e.types.map((function(e){return new _t(e)}))}})))},e.prototype.getPreviewUri=function(e,t,r){return mt.buildUri(this.backend.getServiceBase()+"/prepare/"+e+"/content",{rendition:r,index:t})},e.prototype.updateChildType=function(e,t){return this.backend.put("/prepare/"+t+"/"+e+"?form=true&contentmeta=true").pipe(i.map((function(e){return new Pt(e)})))},e.prototype.addTemplate=function(e,t){return this.backend.put("/prepare/"+e+"/template?templateid="+t).pipe(i.map((function(e){return new Pt(e)})))},e.prototype.getTemplates=function(e){return this.backend.getJson("/template/list?type="+e).pipe(i.map((function(e){return e})))},e.prototype.getTemplatePreviewUri=function(e,t){return mt.buildUri(this.backend.getServiceBase()+"/template/"+e+"/content",{rendition:t})},e.prototype.commitPreparedItem=function(e,t,r){var n=this;return this.backend.put("/prepare/"+e+"/"+t).pipe(i.mergeMap((function(){return n.backend.post("/prepare/commit/"+e,r)})),i.tap((function(){return n.getPreparedItems$()})),i.map((function(e){return e.id})))},e.prototype.uploadContent=function(e,t){var r=this.backend.getServiceBase()+"/prepare/"+e+"/content.json?form=true&contentmeta=true";return this.uploadService.upload(r,[t]).pipe()},e.prototype.uploadToTarget=function(e,t,r){var n=this,o=t.map((function(e){return e._file}));return this.uploadService.upload(this.getUploadTarget(e,r),o).pipe(i.tap((function(){return n.getPreparedItems$()})))},e.prototype.getUploadTarget=function(e,t){var r;if(e.type===jt.ROOT)r=this.backend.getServiceBase()+this.createPreparedItemPostUrl({parentId:null,createMany:!t});else if(e.type===jt.OBJECT){var n=e.referenceObject;r=this.backend.getServiceBase()+"/dms/"+n.id+"/contents?type="+n.type.name}else e.type!==jt.CONTEXT&&e.type!==jt.CONTEXT_TREE||(r=this.backend.getServiceBase()+this.createPreparedItemPostUrl({parentId:e.referenceObject.id,createMany:!t,childType:e.subFolder&&e.subFolder.data.type?e.subFolder.data.type:null}));return r},e.prototype.deletePreparedItemContent=function(e,t){var r="/prepare/"+e+"/content"+(void 0!==t?"?index="+t:"");return this.backend.del(r).pipe(i.map((function(e){return new Pt(e)})))},e}();Nt.decorators=[{type:r.Injectable}],Nt.ctorParameters=function(){return[{type:xt},{type:Dt}]};var Ft=Ze,Ut=function(){function e(e){this.id=e.inboxentryid,this.title=e.title,this.description=e.description,this.type=e.type,this.sourceId=e.source?e.source.id:null,this.iconId=e.target&&e.target.icon?e.target.icon.id:null,this.accepted=e.accepted,this.isdeputy=e.isdeputy,this.duetime=e.duetime,this.received=e.receivetime,this.target=e.target}return e.prototype.isOverdue=function(){return this.duetime&&Ft(this.duetime).isBefore(Ft())},e}();Ut.TYPE_BPM="BPM",Ut.TYPE_RESUBMISSION="RESUBMISSION",Ut.TYPE_SUBSCRIPTION="SUBSCRIPTION";var Lt=function(){function e(e){this.backend=e,this.MAX_PAGE_SIZE=1e3,this.inboxStateSource=new o.ReplaySubject(1),this.inboxState$=this.inboxStateSource.asObservable(),this.inboxItemsSource=new o.ReplaySubject(1),this.inboxItemsGridData$=this.inboxItemsSource.asObservable(),this.inboxItems$=this.inboxItemsGridData$.pipe(this.backend.gridDataFilter)}return e.prototype.getItems=function(){var e=this;return this.getAllPages().pipe(i.map((function(e){return e.map((function(e){return new Ut(e)}))})),i.tap((function(t){e.inboxItems=t,e.inboxItemsSource.next(e.inboxItems)})),i.catchError(mt.throw((function(){return e.inboxItemsSource.next([])}))))},e.prototype.getAllPages=function(){var e=this,t=[];return this.getPage().pipe(i.expand((function(t){return t.last?o.EMPTY:e.getPage(t.pageable.pageNumber+1)})),i.tap((function(e){return t=Ct(t,e.content)})),i.skipWhile((function(e){return!e.last})),i.map((function(e){return t})))},e.prototype.getPage=function(e){return this.backend.getJson("/get?size="+this.MAX_PAGE_SIZE+"&page="+(e||0),this.backend.getInboxBase())},e.prototype.getState=function(){return this.inboxState},e.prototype.refreshInboxState=function(){this.fetchInboxState()},e.prototype.fetchInboxState=function(){var e=this;this.backend.getJson("/state",this.backend.getInboxBase()).pipe(i.map((function(e){return e}))).subscribe((function(t){e.inboxState=t,e.inboxStateSource.next(e.inboxState)}),mt.logError(null,"Failed to fetch inbox state!"))},e.prototype.removeItem=function(e){var t=this;return this.backend.del("/"+e.id,this.backend.getInboxBase()).pipe(i.tap((function(){return t.updateInboxItems(e.id)})))},e.prototype.updateInboxItems=function(e,t,r){this.backend.update(this.inboxItems,r||[{id:e,item:t}])&&this.inboxItemsSource.next(this.inboxItems)},e.prototype.markAsRead=function(e){return this.backend.put("/read/"+e.id,this.backend.getInboxBase())},e}();Lt.decorators=[{type:r.Injectable}],Lt.ctorParameters=function(){return[{type:xt}]};var Mt,Bt=function(){function e(){}return e.prototype.setCapabilities=function(e,t){return this.capabilities={bpm:e.bpm,favorites:e.favorites,followup:e.followup,subscription:e.subscription,intray:e.intray,storedqueries:e.storedqueries,recyclebin:e.recyclebin,inbox:e.bpm||e.followup||e.subscription,notifications:e.followup||e.subscription,template:e.template,sso:t||!1},this.capabilities},e.prototype.getCapabilities=function(){return this.capabilities},e.prototype.hasCapability=function(e){return this.capabilities[e]},e}();Bt.decorators=[{type:r.Injectable}],Bt.ctorParameters=function(){return[]};var Ht=function(){function e(){return Mt&&(Mt=this),this.storage=this.isLocalStorageAvailable()?window.localStorage:null,Mt}return e.prototype.setItem=function(e,t){if(void 0===e||void 0===t)return!1;this.storage.setItem(e,JSON.stringify(t))},e.prototype.getItem=function(e){this.isKeyDefined(e);var t=this.storage.getItem(e);return!!t&&JSON.parse(t)},e.prototype.hasItem=function(e){return this.isKeyDefined(e),null===this.storage.getItem(e)},e.prototype.removeItem=function(e){this.isKeyDefined(e),this.storage.removeItem(e)},e.prototype.clear=function(e){var t=this;return e?Object.keys(this.storage).forEach((function(r){return e(r)&&t.removeItem(r)})):this.storage.clear()},e.prototype.isKeyDefined=function(e){if(void 0===e)return!1},e.prototype.isLocalStorageAvailable=function(){try{var e=window.localStorage;return e.setItem("test","test"),e.removeItem("test"),!0}catch(e){return!1}},e}();Ht.decorators=[{type:r.Injectable}],Ht.ctorParameters=function(){return[]};var qt,Qt=function(e){var t=this;switch(this.title=e.activityName,this.description=e.description,this.number=e.number,this.time=e.time,this.type=e.type,this.data={},e.type){case"DEADLINE_START":case"DEADLINE_FIRE":this.title=e.periodName+": "+e.description,this.description=null,this.data={periodFireTime:e.periodFireTime},this.type=e.type}e.performer&&(this.performer=[],e.performer.groups.forEach((function(e){return t.performer.push({type:"group",label:e.name})})),e.performer.roles.forEach((function(e){return t.performer.push({type:"role",label:e.name})})),e.performer.users.forEach((function(e){return t.performer.push({type:"user",label:e.lastname+", "+e.firstname+" ("+e.name+")"})}))),e.user&&(this.editor=e.user)},Gt=function(){function e(e){this.creatorid=e.creatorid,this.modelname=e.modelname,this.iconurl=e.iconurl,this.iconid=e.iconid,this.localizedsubject=e.subject,this.modelid=e.modelid,this.processid=e.id,this.procname=e.name,this.starttime=e.starttime,this.endtime=e.endtime,this.state=e.state}return Object.defineProperty(e.prototype,"title",{get:function(){return this.localizedsubject||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.processid||""},enumerable:!1,configurable:!0}),e.prototype.setFile=function(e){this.file=e||[]},e}(),Vt=function(){function e(e){Object.assign(this,e),this.fileEntryPermissions={add:e.isFileElemAddable||!1,remove:e.isFileElemRemovable||!1},this.actions&&this.actions.length&&(this.actions=this.actions.sort((function(e,t){return e.code-t.code})))}return e.prototype.setFile=function(e){this.file=e?e.sort((function(e,t){return e.addtime<t.addtime?-1:e.addtime>t.addtime?1:0})):[]},e}();(qt=e.ClipboardAction||(e.ClipboardAction={}))[qt.COPY=0]="COPY",qt[qt.CUT=1]="CUT";var Jt,zt=function(){function t(e,t,r,n){this.capabilities=e,this.backend=t,this.eventService=r,this.inboxService=n,this.processItemsSource=new o.ReplaySubject(1),this.processItems$=this.processItemsSource.asObservable()}return t.prototype.getProcesses=function(e){var t=this;return void 0===e&&(e=1e3),this.backend.getJson("/process/user?size="+e,this.backend.getBpmBase()).pipe(i.map((function(e){return e.content.map((function(e){return new Gt(e)}))})),i.tap((function(e){t.processItems=e,t.processItemsSource.next(t.processItems)})))},t.prototype.getExecutableProcesses=function(e,t,r,n,i){return this.capabilities.hasCapability("bpm")?this.executableProcesses&&t?o.of(this.executableProcesses):this.fetchExecutableProcesses(e,r,n,i):o.of([])},t.prototype.initExecutableProcesses=function(){var e=this;return this.backend.get("/bpm/process/executable").pipe(i.tap((function(t){return e.hasMainExecutableProcesses=null==t?void 0:t.length})))},t.prototype.getExecutableProcessesForDmsObjects=function(e){return this.getExecutableProcesses(e.map((function(e){return e.typeName})),!1,!0)},t.prototype.fetchExecutableProcesses=function(e,t,r,n){var o=this,s="/bpm/process/executable";return t&&(s+="?form=true&fields=true"),e&&(s+=(t?"&":"?")+"type="+e.join(",")),r&&(s+=(t||e?"&":"?")+"modelid="+r),this.backend.get(s).pipe(i.map((function(e){return e})),i.tap((function(e){n&&(t?(o.executableProcesses||(o.executableProcesses=[]),e.forEach((function(e){var t=o.executableProcesses.findIndex((function(t){return t.id===e.id}));-1===t?o.executableProcesses.push(e):o.executableProcesses[t]=e}))):o.executableProcesses=e)})))},t.prototype.getProcessFile=function(e){return this.backend.getJson("/process/"+e+"/file",this.backend.getBpmBase()).pipe(i.map((function(e){return e.content.map((function(e){return{id:e.elementid,title:e.title,description:e.description?e.description:"",iconid:e.iconid,creator:e.creator,addtime:e.addtime,type:e.type}}))})))},t.prototype.getWorkItem=function(e,t,r){var n=r||{form:!0,fields:!0},s=[this.backend.getJson(mt.buildUri("/bpm/process/"+e+"/"+t,n)),this.getProcessFile(e)];return o.forkJoin(s).pipe(i.map((function(e){var t=new Vt(e[0]);return t.setFile(e[1]),t})))},t.prototype.saveWorkItem=function(e){var t=this,r=e.id,n=e.processId,o={contents:e.file,data:e.data};return this.backend.post(mt.buildUri("/bpm/process/"+n+"/"+r+"/save",{keeplock:!0,isautolock:!1}),o).pipe(i.mergeMap((function(){return t.getWorkItem(n,r)})))},t.prototype.forwardWorkItem=function(e,t){var r=this,n={action:t,contents:e.file,data:e.data};return this.backend.post(mt.buildUri("/bpm/process/"+e.processId+"/"+e.id+"/save",{keeplock:!1,isautolock:!1}),n).pipe(i.tap((function(){return r.inboxService.updateInboxItems(e.id)})))},t.prototype.lockWorkItem=function(e){var t=this;return this.backend.put("/bpm/process/"+e.processId+"/"+e.id+"/lock").pipe(i.mergeMap((function(){return t.getWorkItem(e.processId,e.id)})))},t.prototype.unlockWorkItem=function(e){var t=this;return this.backend.del("/bpm/process/"+e.processId+"/"+e.id+"/lock").pipe(i.mergeMap((function(){return t.getWorkItem(e.processId,e.id)})))},t.prototype.startProcess=function(e,t,r){return this.backend.post("/bpm/process/?modelid="+e,{data:t,contents:r})},t.prototype.getProcessHistory=function(e){return this.backend.getJson("/bpm/process/"+e+"/history").pipe(i.map((function(e){return e&&e.length?e.map((function(e){return new Qt(e)})):[]})))},t.prototype.removeFileElement=function(e,t,r){return this.backend.del("/process/"+e+"/file/"+r+"?activityid="+t,this.backend.getBpmBase())},t.prototype.addFileElements=function(e,t,r){var n=this,s=[];return r.forEach((function(r){s.push(n.backend.post("/process/"+e+"/file/"+r.id+"?type="+r.type.name+"&activityid="+t,{},n.backend.getBpmBase()))})),o.forkJoin(s).pipe(i.mergeMap((function(){return n.getWorkItem(e,t)})))},t.prototype.addFileElementsFromClipboard=function(t,r){if(t&&t.fileEntryPermissions.add&&r&&r.elements.length&&r.action===e.ClipboardAction.COPY){var n=void 0;if(t.file.length){var i=t.file.map((function(e){return e.id}));n=r.elements.filter((function(e){return-1===i.indexOf(e.id)}))}else n=r.elements;return this.addFileElements(t.processId,t.id,n)}return o.throwError("error")},t}();zt.decorators=[{type:r.Injectable}],zt.ctorParameters=function(){return[{type:Bt},{type:xt},{type:gt},{type:Lt}]},(Jt=e.SystemStatusEnum||(e.SystemStatusEnum={})).SYSTEM_STATUS_SCHEMA_CHANGED="schemaChangedOn",Jt.SYSTEM_STATUS_ORG_CHANGED="orgChangedOn",Jt.SYSTEM_STATUS_SEC_CHANGED="securityChangedOn",Jt.SYSTEM_STATUS_ACL_CHANGED="aclChangedOn",Jt.SYSTEM_STATUS_INBOX_CHANGED="inboxChangedOn";var Yt=function(){function t(e,t,r,n){var i=this;this.eventService=e,this.backend=t,this.appCache=r,this.ngZone=n,this.statusCacheKey="eo.framework.cache.system.status",this.pollingStopTrigger$=new o.Subject,this.appCache.getItem(this.statusCacheKey).subscribe((function(e){return i.currentStatus=e}))}return t.prototype.init=function(e){void 0===e&&(e=-1),e>-1&&(this.pollingStopTrigger$=new o.Subject,this.startPolling(e))},t.prototype.stop=function(){this.hasBeenStopped=!0,this.pollingStopTrigger$.next(),this.pollingStopTrigger$.complete()},t.prototype.startPolling=function(e){var t=this;this.ngZone.runOutsideAngular((function(){o.timer(0,e).pipe(i.takeUntil(t.pollingStopTrigger$)).subscribe((function(){t.ngZone.run((function(){t.eventService.trigger(yt.SYSTEM_STATUS_INBOX_CHANGED,{})}))}))}))},t.prototype.handleStatusResult=function(e){var t=this,r=[];Object.keys(e).forEach((function(n){t.statusCheck(e,n)&&r.push({type:t.statusEvent(n),data:e})})),(r.length||this.hasBeenStopped)&&this.ngZone.run((function(){r.forEach((function(e){t.eventService.trigger(e.type,e.data)}))})),!r.length&&this.currentStatus||(this.currentStatus=e,this.appCache.setItem(this.statusCacheKey,e))},t.prototype.handleStatusError=function(e){var t=this;this.ngZone.run((function(){setTimeout((function(e){t.stop()}))}))},t.prototype.statusEvent=function(t){return yt[Object.keys(e.SystemStatusEnum).find((function(r){return e.SystemStatusEnum[r]===t}))]},t.prototype.statusCheck=function(e,t){return this.currentStatus&&this.currentStatus[t]<e[t]},t}();Yt.ɵprov=r.ɵɵdefineInjectable({factory:function(){return new Yt(r.ɵɵinject(gt),r.ɵɵinject(xt),r.ɵɵinject(vt),r.ɵɵinject(r.NgZone))},token:Yt,providedIn:"root"}),Yt.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],Yt.ctorParameters=function(){return[{type:gt},{type:xt},{type:vt},{type:r.NgZone}]};var Kt=function(){function e(){}return e.isWebEnvironment=function(){return!e.isDesktopEnvironment()&&!e.isMobileEnvironment()},e.isMobileEnvironment=function(){return window.hasOwnProperty("cordova")},e.isDesktopEnvironment=function(){return window.hasOwnProperty("process")&&window.process.versions.hasOwnProperty("electron")},e}(),Wt=function(){function e(){this._cloudEnvironment=!1}return Object.defineProperty(e.prototype,"cloudEnvironment",{get:function(){return this._cloudEnvironment},set:function(e){this._cloudEnvironment=e},enumerable:!1,configurable:!0}),e.prototype.isCloud=function(){return this.cloudEnvironment},e}();Wt.decorators=[{type:r.Injectable}],Wt.ctorParameters=function(){return[]};var $t=function(){function e(e,t,r,n,i,s,a,c,u,p,l,h,f,d,m,g,y,b,v){var S=this;this.config=e,this.coreConfig=t,this.appCache=r,this.envService=n,this.http=i,this.bpmService=s,this.ngZone=a,this.location=c,this.capabilitiesService=u,this.logger=p,this.inboxService=l,this.prepareService=h,this.backend=f,this.systemService=d,this.userService=m,this.eventService=g,this.systemStatusService=y,this.storage=b,this.local=v,this.TOKEN_STORAGE_KEY="eo.auth.cloud.credentials",this.userProfileUri=this.userService.USER_FETCH_URI,this.authSource=new o.BehaviorSubject(!1),this.loggedInCacheKey="eo.user.loggedIn",this.authenticated$=this.authSource.asObservable(),this.hosts=[],this.profile={host:"",user:null,auth:null,active:!1},window.addEventListener("storage",(function(e){if(e.key===S.loggedInCacheKey){var t=JSON.parse(e.newValue).host;S.initUser(t).subscribe()}}))}return e.prototype.login=function(e,t,r){var o=this;e=e||"";var s=new FormData;s.append("username",encodeURIComponent(t)),s.append("password",encodeURIComponent(r));var a=new n.HttpHeaders({"Content-Type":"application/x-www-form-urlencoded"});return this.http.post(e+this.config.getContextPath()+"/login","username="+encodeURIComponent(t)+"&password="+encodeURIComponent(r),{headers:a,responseType:"text",withCredentials:this.coreConfig.withCredentials}).pipe(i.switchMap((function(){return o.initUser(e)})))},e.prototype.cloudLogin=function(e,t){var r=this;return o.Observable.create((function(n){var s=new o.Subject,a=e||"";r.http.get(a+"/tenant/"+t+"/loginDevice").subscribe((function(e){var c=a+"/oauth/"+t+"?user_code="+e.user_code,u=window.open(c,"auth");u&&r.ngZone.runOutsideAngular((function(){var e=setInterval((function(){u.closed&&(clearInterval(e),r.ngZone.run((function(){s.next(),s.complete()})))}),1e3)})),r.cloudLoginPollForResult(a+"/auth/info/state?device_code="+e.device_code,1e3,s).pipe(i.tap((function(e){if(e){r.cloudLoginSetHeaders(e,t);var n={tenant:t,accessToken:e};r.storage.setItem(r.TOKEN_STORAGE_KEY,n).subscribe()}})),i.switchMap((function(e){if(e)return r.initUser(a);o.throwError("not authenticated")}))).subscribe((function(e){u.close(),n.next(e),n.complete()}),(function(e){u.close(),n.error(e),n.complete()}))}),(function(e){n.error("unable to call device flow endpoint",e),n.complete()}))}))},e.prototype.cloudLoginPollForResult=function(e,t,r){var n=this;return void 0===r&&(r=new o.Subject),o.Observable.create((function(s){var a=!1,c=!1;n.ngZone.runOutsideAngular((function(){o.interval(t).pipe(i.takeUntil(r),i.switchMap((function(){return n.http.get(e).pipe(i.catchError((function(e){if(400===e.status)return o.of(e.error);o.throwError(e)})))}))).subscribe((function(e){n.ngZone.run((function(){a=!!e.access_token,c="access_denied"===e.error,a||c?(r.next(),r.complete(),s.next(a?e.access_token:null),s.complete()):"expired_token"===e.error&&o.throwError("Token expired")}))}),(function(e){n.ngZone.run((function(){s.error(e),s.complete()}))}),(function(){n.ngZone.run((function(){s.next(a),s.complete()}))}))}))}))},e.prototype.cloudLoginSetHeaders=function(e,t){this.backend.setHeader("Authorization","bearer "+e),this.backend.setHeader("X-ID-TENANT-NAME",t)},e.prototype.initUser=function(e){var t=this,r=new n.HttpHeaders({"Content-Type":"application/json"});return this.http.get(""+(e||"")+this.config.getContextPath()+"/auth/info",{headers:r,withCredentials:this.coreConfig.withCredentials}).pipe(i.switchMap((function(r){return t.gatewayInfo=r,t.envService.cloudEnvironment=t.gatewayInfo&&t.gatewayInfo.oauth2,t.isCloudEnvironment()?t.storage.getItem(t.TOKEN_STORAGE_KEY).pipe(i.switchMap((function(n){return n&&t.cloudLoginSetHeaders(n.accessToken,n.tenant),t.fetchUser(r,e)}))):t.fetchUser(r,e)})))},e.prototype.fetchUser=function(e,t){var r=this,o=new n.HttpHeaders({"Content-Type":"application/json"});return this.http.get(""+(t||"")+this.config.getUri("serviceBase")+this.userProfileUri,{headers:o,withCredentials:this.coreConfig.withCredentials}).pipe(i.switchMap((function(n){return r.profile={host:t||"",user:n.user.name,auth:null,active:!0},t&&r.addHostConfig(t),window.localStorage.setItem(r.loggedInCacheKey,JSON.stringify({userId:n.user.id,host:t})),r.initApp(n,e.ntlm)})),i.tap((function(){return r.authSource.next(r.isLoggedIn())})))},e.prototype.logout=function(e){this.authSource.next(!1),this.systemStatusService.stop(),this.profile={host:"",user:null,auth:null,active:!1},this.isCloudEnvironment()&&(this.storage.removeItem(this.TOKEN_STORAGE_KEY).subscribe(),this.coreConfig.environment.production&&Kt.isWebEnvironment())?window.location.href=this.config.getContextPath()+"/logout":(e&&this.http.get(""+(this.profile.host||"")+this.config.getContextPath()+"/logout",{withCredentials:this.coreConfig.withCredentials}).subscribe(),this.backend.setAuthProfile(this.profile),this.eventService.trigger(yt.LOGOUT))},e.prototype.isCloudEnvironment=function(){return this.gatewayInfo&&this.gatewayInfo.oauth2},e.prototype.addHostConfig=function(e){this.hosts.find((function(t){return t===e}))||this.hosts.push(e)},e.prototype.isLoggedIn=function(){return null!==this.profile.user},e.prototype.initApp=function(e,t){var r=new St(e);this.backend.setAuthProfile(this.profile),this.userService.setCurrentUser(e);var n=this.capabilitiesService.setCapabilities(e.capabilities,t);this.systemStatusService.init(this.config.getRaw("systemStatusUpdateInterval")),n.inbox&&this.inboxService.refreshInboxState(),n.intray&&this.prepareService.refreshPreparedItemsCount();var s=[this.bpmService.initExecutableProcesses(),this.systemService.getSystemDefinition(r)];return o.forkJoin(s).pipe(i.map((function(){return r})))},e}();$t.decorators=[{type:r.Injectable}],$t.ctorParameters=function(){return[{type:bt},{type:tt,decorators:[{type:r.Inject,args:[et]}]},{type:vt},{type:Wt},{type:n.HttpClient},{type:zt},{type:r.NgZone},{type:s.PlatformLocation},{type:Bt},{type:It},{type:Lt},{type:Nt},{type:xt},{type:At},{type:Rt},{type:gt},{type:Yt},{type:ee.LocalStorage},{type:Ht}]};var Zt=function(){function e(e,t,r,n,o){this.coreConfig=e,this.logger=t,this.http=r,this.configService=n,this.authService=o}return e.prototype.initialize=function(){var e=this;return new Promise((function(t,r){(Array.isArray(e.coreConfig.main)?o.forkJoin(e.coreConfig.main.map((function(t){return e.http.get(t,{withCredentials:e.coreConfig.withCredentials}).pipe(i.catchError((function(t){return e.logger.error("failed to catch config file",t),o.of({})})))}))):o.of([e.coreConfig.main])).pipe(i.map((function(e){return e.reduce((function(e,t){return Object.keys(t).forEach((function(r){return!e[r]||Array.isArray(t[r])||"object"!=typeof t[r]?e[r]=t[r]:Object.assign(e[r],t[r])})),e}),{})})),i.mergeMap((function(t){return e.configService.set(t),e.authService.initUser().pipe(i.catchError((function(e){return o.of(!0)})))}))).subscribe((function(e){t(!0)}),(function(t){e.logger.error(t),r()}))}))},e}();Zt.decorators=[{type:r.Injectable}],Zt.ctorParameters=function(){return[{type:tt,decorators:[{type:r.Inject,args:[et]}]},{type:It},{type:n.HttpClient},{type:bt},{type:$t}]};var Xt,er=function(e){Object.assign(this,e)},tr=function(e){this.subscriptions=[],this.resubmissions=[],this.storageInfo=[],this.additionalvisibility=[],this.id=e.id,this.title=e.title,this.description=e.description,this.version=e.version,this.versions=e.versions,this.data=e.data,this.typeName=e.type,this.isActiveVersion=e.activeversion,this.isFinalized=e.finalized,this.isFavorite=e.favorite,this.isFolder=e.folder,this.isContextFolder=!!e.iscontextfolder,this.storageInfo=e.storageinfo,e.contents&&e.contents[0]&&(this.contentFileName=e.contents[0].path,this.contentFileSize=e.contents[0].size),e.contextfolder&&(this.contextFolder={id:e.contextfolder.id,typeName:e.contextfolder.type,title:e.contextfolder.title,description:e.contextfolder.description}),e.created&&(this.created={on:e.created.on,by:{id:e.created.by.id,title:e.created.by.title,name:e.created.by.name}}),e.modified&&(this.modified={on:e.modified.on,by:{id:e.modified.by.id,title:e.modified.by.title,name:e.modified.by.name}}),"NOT_LOCKED"!==e.lock&&e.lockinfo&&(this.lock={on:e.lockinfo.time,by:{me:"LOCKED_BY_SESSION_USER"===e.lock,other:"LOCKED_BY_OTHER_USER"===e.lock,name:e.lockinfo.username,label:e.lockinfo.usertitle}}),e.rights&&e.rights.length>0?this.rights={select:e.rights[0].privileges.select,edit:e.rights[0].privileges.edit&&!(this.lock&&this.lock.by.other),delete:e.rights[0].privileges.delete&&!(this.lock&&this.lock.by.other),finalize:e.rights[0].privileges.finalize&&!(this.lock&&this.lock.by.other),recycle:e.rights[0].privileges.recycle&&!(this.lock&&this.lock.by.other)}:this.rights={select:!1,edit:!1,delete:!1,finalize:!1,recycle:!1},e.shares&&(this.shares=e.shares),e.contentid&&(this.content={id:e.contentid,type:e.contenttype,count:e.contentcount||0,linked:e.contentid!==e.id,contents:e.contents}),e.subscriptions&&(this.subscriptions=e.subscriptions),e.resubmissions&&(this.resubmissions=e.resubmissions),e.additionalvisibility&&(this.additionalvisibility=e.additionalvisibility)},rr=function(e){this.version=e.version,this.time=e.time,this.title=e.title,this.description=e.description,this.comment=e.comment,this.group=e.group,this.type=e.type,this.user=e.user,e.parameter&&(this.parameter=Object.assign(Object.assign({},e.parameter),{processId:e.parameter.procId,processName:e.parameter.procName,activityId:e.parameter.actId,activityName:e.parameter.actName}))};(Xt=e.SubscriptionMode||(e.SubscriptionMode={})).ONLY_INDEX_DATA_CHANGED="META",Xt.ONLY_DOCUMENT_CONTENT_CHANGED="CONTENT",Xt.DMS_OBJECT_CHANGED="BOTH";var nr=function(){function e(e,t,r){this.backend=e,this.systemService=t,this.eventService=r}return e.prototype.getDmsObject=function(e,t,r,n,o,s){var a=this,c="/dms/"+e,u={additionalvisibility:!0,subscription:"CURRENT",resubmission:"CURRENT",rights:"CURRENT",datameta:"true",contextfolder:"true",type:t,recyclebin:o,version:r,storageinfo:s,_intent:n};return this.backend.getViaTempCache(mt.buildUri(c,u)).pipe(i.catchError(mt.catchSkip((function(e){return 404===e.status}))),i.map((function(e){return a.resolveObjectTypes(new tr(e))})))},e.prototype.getDmsObjectByParams=function(e){return this.getDmsObject(e.id,e.type,e.version,e.intent,e.recyclebin,e.withStorageInfo)},e.prototype.resolveObjectTypes=function(e){return e.type=this.systemService.getObjectType(e.typeName),e.contextFolder&&(e.contextFolder.type=this.systemService.getObjectType(e.contextFolder.typeName)),e},e.prototype.deleteDmsObject=function(e,t,r,n){void 0===n&&(n=!1);var o="/dms/"+e,i={};return t&&t.length>0&&(i.type=t),r&&(i.harddelete=r),n&&(i.forcedelete=n),this.backend.del(mt.buildUri(o,i))},e.prototype.getContextPath=function(e){return this.backend.get("/dms/"+e+"/context").pipe(i.map((function(e){return e.forEach((function(e){e.dmsobject=new tr(e.dmsobject)})),e})))},e.prototype.getChildren=function(e){var t=this,r="/dms/"+e.id+"/children";return this.backend.getViaTempCache(mt.buildUri(r,{type:e.type.name})).pipe(i.map((function(e){return e.map((function(e){return t.resolveObjectTypes(new tr(e))}))})))},e.prototype.getVersions=function(e,t){var r="/dms/"+e+"/versions";return this.backend.getViaTempCache(mt.buildUri(r,{type:t})).pipe(i.map((function(e){return new tr(e)})))},e.prototype.getAttachments=function(e){var t,r,n,s=this,a=null===(t=e.content)||void 0===t?void 0:t.type,c=(null===(r=e.content)||void 0===r?void 0:r.linked)?-1:e.version,u=null===(n=e.content)||void 0===n?void 0:n.id,p=mt.buildUri("/dms/"+u+"/attachments",{type:a,version:c});return u?this.backend.getViaTempCache(p).pipe(i.catchError(mt.catchSkip((function(e){return 404===e.status}))),i.map((function(e){return e.attachmentinfo&&e.attachmentinfo.attachments?e.attachmentinfo.attachments.map((function(e,t){return new er(Object.assign(e,{id:t,previewUri:s.getAttachmentByIndex(u,t,a,c)}))})):[]}))):o.of([])},e.prototype.getAttachmentByIndex=function(e,t,r,n){var o=mt.buildUri("/dms/"+e+"/attachments/"+t,{type:r,version:n});return this.backend.getServiceBase()+o},e.prototype.getSlide=function(e,t,r,n){return mt.buildUri(this.backend.getServiceBase()+"/dms/"+e+"/slide",{type:t,version:r,height:n})},e.prototype.getPreview=function(e,t,r,n){return mt.buildUri(this.backend.getServiceBase()+"/dms/"+e+"/content",{rendition:n,type:t,version:r})},e.prototype.updateObject=function(e,t,r,n,o){var i=mt.buildUri("/dms/"+e,{type:r,version:n,checkreferences:o});return this.triggerUpdate({id:e,type:r,typeName:r},this.backend.put(i,t))},e.prototype.getHistory=function(e,t){var r="/dms/"+e+"/audit";return this.backend.getJson(mt.buildUri(r,{type:t})).pipe(i.map((function(e){return e.audit.map((function(e){return new rr(e)}))})))},e.prototype.restoreVersion=function(e,t,r){var n="/dms/restoreversion/"+e+"/"+t;return this.backend.post(mt.buildUri(n,{type:r}),null)},e.prototype.triggerUpdate=function(e,t){var r=this;return e?t.pipe(i.mergeMap((function(){return r.getDmsObject(e.id,e.typeName)})),i.tap((function(e){return r.eventService.trigger(yt.DMS_OBJECT_UPDATED,e)}))):t},e.prototype.removeContent=function(e){var t="/dms/"+e.id+"/content";return this.triggerUpdate(e,this.backend.del(t))},e.prototype.createDmsObject=function(e,t,r,n){var o=new FormData;r?o.append("data",new Blob([JSON.stringify(r)],{type:"application/json"})):o.append("noindexdata",""),t&&o.append("files[]",t,mt.encodeFileName(t.name));var i="/dms/create/"+e;return n&&(i=mt.buildUri(i,{parentId:n.id,parentType:n.type})),this.backend.postMultiPart(i,o,null,{headers:{}})},e.prototype.createSubscription=function(e,t,r,n,o,i){var s="/dms/subscription/"+e.id;return this.triggerUpdate(e,this.backend.post(mt.buildUri(s,{subject:t,type:e.typeName,receiver:r,sendemail:n,onlyemail:o,mode:i}),{}))},e.prototype.createResubmission=function(e,t,r,n,o,i){var s="/dms/resubmission/"+e.id;return this.triggerUpdate(e,this.backend.post(mt.buildUri(s,{subject:t,type:e.typeName,receiver:n,due:r?r.toISOString():"",sendemail:o,onlyemail:i}),{}))},e.prototype.removeSubscriptionById=function(e,t){return this.triggerUpdate(t,this.backend.del("/messageprovider/subscription/"+e))},e.prototype.removeResubmissionsById=function(e,t){return this.triggerUpdate(t,this.backend.del("/dms/resubmission/"+e))},e.prototype.updateResubmission=function(e,t,r,n,o,s){var a=this;return this.removeResubmissionsById(e.id).pipe(i.mergeMap((function(){return a.createResubmission(e,t,r,n,o,s)})))},e.prototype.setOrganizationObjectsWithReadRights=function(e,t,r,n){var o="/dms/"+t+"/share",i={shares:Ct(n.map((function(e){return{organizationobject:e,sharechildren:!0}})),r.map((function(e){return{organizationobject:e,sharechildren:!1}})))};return this.triggerUpdate(e[0],this.backend.put(o,i))},e.prototype.move=function(e,t,r,n){var o="/dms/location/"+e;return this.backend.post(mt.buildUri(o,{type:t,parentId:r,parentType:n}),{})},e.prototype.copy=function(e,t,r,n,o){var i="/dms/copy/"+e;return this.backend.post(mt.buildUri(i,{type:t,parentId:r,parentType:n,createcontentlink:o}),{})},e.prototype.finalize=function(e){var t="/dms/finalize/"+e.id+"?type="+e.typeName;return this.triggerUpdate(e,this.backend.put(t))},e.prototype.definalize=function(e){var t="/dms/definalize/"+e.id+"?type="+e.typeName;return this.triggerUpdate(e,this.backend.put(t))},e.prototype.createLocalCopyOfDMSObject=function(e){var t={id:e.id,title:e.title,description:e.description,version:e.version,versions:e.versions,data:e.data,type:e.typeName,activeversion:e.isActiveVersion,finalized:e.isFinalized,favorite:e.isFavorite,folder:e.isFolder,iscontextfolder:e.isContextFolder,contextfolder:e.contextFolder?{id:e.contextFolder.id,type:e.contextFolder.typeName,title:e.contextFolder.title,description:e.contextFolder.description}:null,created:e.created,modified:e.modified,lock:e.lock?e.lock.by.me?"LOCKED_BY_SESSION_USER":"LOCKED_BY_OTHER_USER":"NOT_LOCKED",lockinfo:e.lock?{username:e.lock.by.name,usertitle:e.lock.by.label,time:e.lock.on}:null,rights:[{privileges:{select:e.rights.select,edit:e.rights.edit,delete:e.rights.delete,finalize:e.rights.finalize,recycle:e.rights.recycle}}],shares:e.shares,contentid:e.content?e.content.id:null,contenttype:e.content?e.content.type:null,contentcount:e.content?e.content.count:null,contents:e.content?e.content.contents:null,subscriptions:e.subscriptions,resubmissions:e.resubmissions,additionalvisibility:e.additionalvisibility},r=new tr(t);return r.type=e.type,r},e}();nr.decorators=[{type:r.Injectable}],nr.ctorParameters=function(){return[{type:xt},{type:At},{type:gt}]};var or=function(e){function t(r){var n,o,i=e.call(this)||this;if(r){if(i.id=r.id,i.name=r.name,i.favorite=r.favorite,i.shared=r.shared,i.user=r.user,i.version=r.version,i.roles=r.roles||[],i.parameter=[],r.parameter&&r.parameter.length>0)try{for(var s=Tt(r.parameter),a=s.next();!a.done;a=s.next()){var c=a.value;try{var u=JSON.parse(c),p={qname:u.qname,type:u.type};i.parameter.push(p)}catch(e){console.error("Failed parsing stored query parameter",e)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}}else i.id=t.ID_NEW,i.parameter=[];return i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Et(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),Object.defineProperty(t.prototype,"title",{get:function(){return this.name||""},enumerable:!1,configurable:!0}),t.prototype.setQuery=function(e){this.term=e?e.term:"",this.types=e?e.types:[],this.contextFolderTypes=e?e.contextFolderTypes:[],this.filters=e?e.filters:[],this.suggest=!!e&&e.suggest,this.expertMode=!!e&&e.expertMode,this.scope=e?e.scope:null,this.searchMode=e?e.searchMode:"idx"},t.prototype.toPersistableStoredQuery=function(){var e=[];return this.parameter.forEach((function(t){return e.push(JSON.stringify(t))})),{id:this.id,name:this.name,favorite:this.favorite,shared:this.shared,user:this.user,version:this.version,roles:this.roles,parameter:e,query:JSON.stringify(this.getQueryJson())}},t.prototype.isNew=function(){return this.id===t.ID_NEW},t}(at);or.ID_NEW="new";var ir=function(){function e(e,t,r){this.system=e,this.backend=t,this.config=r}return e.toRangeValue=function(e){if(e){if(e instanceof ft)return e;if(e.hasOwnProperty("operator")&&e.hasOwnProperty("firstValue"))return new ft(e.operator,e.firstValue,e.secondValue)}return e},e.prototype.buildQuery=function(e){var t,r,n=this;e instanceof at?t=e:(r="string"==typeof e?JSON.parse(e):e,(t=new at).term=r.term,r.filters&&Object.keys(r.filters).forEach((function(e){t.filters.push(new ht(e,r.filters[e].o,r.filters[e].v1,r.filters[e].v2))})),r.types&&r.types.forEach((function(e){n.system.getObjectType(e)?t.types.push(n.system.getObjectType(e)):t.types.push(e)})),r.contextfoldertypes&&r.contextfoldertypes.forEach((function(e){if("sysroot"===e){var r=new _t({id:"a",folder:!0,name:"sysroot",qname:"sysroot",label:"sysroot",iscontextfolder:!0,abstract:!1,elements:[],description:"",shareable:!1,minfiles:0,maxfiles:1});t.contextFolderTypes.push(r)}else t.contextFolderTypes.push(n.system.getObjectType(e))})),t.fields=r.fields,r.options&&(t.suggest=r.options.suggest||!1,t.expertMode=r.options.expertmode||!1,t.scope=r.options.scope,t.resolveReference=null!==r.options.resolvereference?r.options.resolvereference:null===r.options.resolveReference||r.options.resolveReference,t.withContext=r.options.withcontext||r.options.withContext||!1,t.searchMode=r.options.searchmode||at.DEFAULT_SEARCH_MODE));return t},e.prototype.search=function(e){var t=this;return this.executeQuery(e.getQueryJson()).pipe(i.map((function(e){return t.createResultFromResponse(e)})))},e.prototype.getSearchState=function(e){return e instanceof at&&(e=e.getQueryJson()),delete e.name,this.executeQuery(e,!0).pipe(i.map((function(e){var t=new pt;return t.count=e.hits.total,Object.keys(at.BASE_PARAMS).forEach((function(r){var n=at.BASE_PARAMS[r];(e.aggregations[n]?e.aggregations[n].buckets:[]).forEach((function(e){var r=e.key,o=e.doc_count,i=e.contextfoldertype;"filesize"===n&&(o=e["filter#documents"].doc_count),t.addAggregations(n,r,o,e),n===at.BASE_PARAMS.TYPE&&i&&i.buckets.forEach((function(e){t.addAggregations("contexttype",e.key,e.doc_count,e)}))}))})),t})))},e.prototype.getChunkedResult=function(e,t,r){var n=this,o=e.getQueryJson();o.from=t;var s="search!chunk:"+r+"!"+JSON.stringify(o);return this.backend.getViaTempCache(s,(function(){return n.executeQuery(o,!1,r).pipe(i.map((function(e){return n.createResultFromResponse(e)})))}))},e.prototype.executeQuery=function(e,t,r){var n,o=this,i=e;if(t)n="/aggregate";else{var s=r||this.config.getRaw("search.limit");n="/?size="+s}return i.options=Object.assign(Object.assign({},i.options),{tracktotalhits:this.config.getRaw("search.trackTotalHits")||!1,timezone:mt.getTimezoneOffset()}),this.backend.getViaTempCache(n+JSON.stringify(i),(function(){return o.backend.post(n,i,o.backend.getSearchBase())}))},e.prototype.downloadCsvFromQuery=function(e){var t=this;return this.backend.post("/export",e,this.backend.getSearchBase(),{observe:"response",responseType:"blob"}).pipe(i.tap((function(e){var r=new Blob([e.body],{type:"text/csv;charset=utf-8"});te.saveAs(r,t.getFileNameFromHttpResponse(e),{autoBom:!0})})))},e.prototype.getFileNameFromHttpResponse=function(e){return(e.headers.get("Content-Disposition")||"").split("filename=")[1]},e.prototype.autocomplete=function(e){return this.backend.getJson("/autocomplete?prefix="+encodeURIComponent(e),this.backend.getSearchBase())},e.prototype.getSearchFilter=function(e,t,r){var n=[],o=this.identifySearchFilter(e,t),i=e[0].elements.find((function(e){return e.qname===t}));if(null===r)n.push(new ht(t,ht.OPERATOR.EQUAL,null));else if(i&&"path"===i.classification)n.push(new ht(t,ht.OPERATOR.MATCH,r));else if(r instanceof ft)null!==r.firstValue&&void 0!==r.firstValue&&n.push(new ht(t,r.operator,r.firstValue,r.secondValue,o.datetime?{time:o.withtime}:void 0));else if(!o.multiselect&&!Array.isArray(r)||o.table)if(o.table){var s=r[0];Object.keys(s).forEach((function(e){if(void 0!==s[e]){var r=t+"."+e;s[e]instanceof ft?n.push(new ht(r,s[e].operator,s[e].firstValue,s[e].secondValue)):n.push(new ht(r,Array.isArray(s[e])?ht.OPERATOR.IN:ht.OPERATOR.EQUAL,s[e]))}}))}else n.push(new ht(t,ht.OPERATOR.EQUAL,r));else Array.isArray(r)&&r.length&&n.push(new ht(t,ht.OPERATOR.IN,r));return n},e.prototype.identifySearchFilter=function(e,t){for(var r,n=0;!r&&n<e.length;)r=e[n].elements.find((function(e){return e.qname===t})),n++;return{multiselect:this.isMultiselectSearchFilter(r),table:r&&"TABLE"===r.type,datetime:r&&"DATETIME"===r.type,withtime:r&&r.withtime}},e.prototype.isMultiselectSearchFilter=function(e){return e&&("ORGANIZATION"===e.type||"CODESYSTEM"===e.type||"STRING"===e.type&&"selector"===e.classification||"STRING"===e.type&&e.multiselect)},e.prototype.createResultFromResponse=function(e){var t=new lt;t.suggests=e.suggest,t.fields=e.config;var r=e.hits.hits.map((function(e){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e._source),{id:e._id}),e.snippets&&{snippets:e.snippets}),e.references&&{_references:e.references}),e.context&&{context:e.context})}));return t.count=e.hits.total,t.hits=r||[],t},e.prototype.getResultFieldDefinitionConfig=function(e){return{type:1===(e.types||[]).length?e.types[0]:null,contextType:1===(e.contextFolderTypes||[]).length?e.contextFolderTypes[0]:null}},e.prototype.resolveConfigTypeNames=function(e,t){return{typeName:e?e.qname:"sysobject",contextTypeName:e&&t?t.qname:void 0}},e.prototype.fetchResultFieldDefinition=function(e,t,r){var n=this.resolveConfigTypeNames(e,t),o=n.typeName,s=n.contextTypeName,a=mt.buildUri("/user/config/result/"+o,{contexttype:s,mode:r});return this.backend.getJson(a).pipe(i.map((function(e){return new ut(e.elements,e.sortorder,e.grouporder,e.pinned,e.alignmentx,e.mode)})))},e.prototype.saveResultFieldDefinition=function(e,t,r,n){void 0===n&&(n=!1);var o=n?"/user/config/commonresult/":"/user/config/result/",i=this.resolveConfigTypeNames(e,t),s=i.typeName,a=i.contextTypeName,c=mt.buildUri(o+s,{contexttype:a});return this.backend.post(c,r)},e.prototype.removeResultFieldDefinition=function(e,t){var r=this.resolveConfigTypeNames(e,t),n=r.typeName,o=r.contextTypeName,i=mt.buildUri("/user/config/result/"+n,{contexttype:o});return this.backend.del(i)},e.prototype.filterToElementValue=function(e,t){var r=void 0;return e&&(r="NUMBER"!==t&&"DATETIME"!==t||!e.firstValue?e.firstValue:new ft(e.operator,e.firstValue,e.secondValue)),r},e.prototype.tableFiltersToElementValue=function(e,t){var r=this,n={};return e.forEach((function(e){var o=t.find((function(t){return t.qname===e.property})).name,i=t.find((function(t){return t.qname===e.property})).type;n[o]=r.filterToElementValue(e,i)})),[n]},e}();ir.decorators=[{type:r.Injectable}],ir.ctorParameters=function(){return[{type:At},{type:xt},{type:bt}]};var sr=function(){function e(e,t,r,n){var i=this;this.backend=e,this.system=t,this.searchService=r,this.eventService=n,this.storedQueries={queries:[]},this.storedQueriesSource=new o.BehaviorSubject(this.storedQueries),this.storedQueries$=this.storedQueriesSource.asObservable(),n.on(yt.LOGOUT).subscribe((function(){return i.clear()}))}return e.prototype.clear=function(){this.storedQueries={queries:[]},this.storedQueriesSource.next(this.storedQueries)},e.prototype.getStoredQueries$=function(){return this.storedQueries.queries.length||this.fetchStoredQueries(),this.storedQueries$},e.prototype.refreshStoredQueries=function(){this.fetchStoredQueries()},e.prototype.fetchStoredQueries=function(){var e=this;this.backend.getJson("/storedqueries?size=9999",this.backend.getSearchBase()).pipe(i.map((function(t){return(t||[]).map((function(t){var r=new or(t);return r.setQuery(e.searchService.buildQuery(t.query)),r}))}))).subscribe((function(t){e.storedQueries={queries:t},e.storedQueriesSource.next(e.storedQueries)}))},e.prototype.saveNewStoredQuery=function(e){var t=this;return this.backend.post("/storedqueries",e.toPersistableStoredQuery(),this.backend.getSearchBase()).pipe(i.map((function(e){var r=new or(e);return r.setQuery(t.searchService.buildQuery(e.query)),t.storedQueries.select=r.id,t.storedQueries.queries.push(r),t.storedQueriesSource.next(t.storedQueries),r})))},e.prototype.updateStoredQuery=function(e){var t=this;return this.backend.put("/storedqueries",e.toPersistableStoredQuery(),this.backend.getSearchBase()).pipe(i.map((function(e){var r=new or(e);return r.setQuery(t.searchService.buildQuery(e.query)),t.storedQueries.select=r.id,t.storedQueries.queries=t.storedQueries.queries.filter((function(e){return e.id!==r.id})),t.storedQueries.queries.push(r),t.storedQueriesSource.next(t.storedQueries),r})))},e.prototype.saveStoredQuery=function(t){return t.id===e.ID_NEW?this.saveNewStoredQuery(t):this.updateStoredQuery(t)},e.prototype.removeStoredQuery=function(e){var t=this;return this.backend.del("/storedqueries/"+e,this.backend.getSearchBase()).pipe(i.tap((function(){t.storedQueries.select=null,t.storedQueries.queries=t.storedQueries.queries.filter((function(t){return t.id!==e})),t.storedQueriesSource.next(t.storedQueries)})))},e.prototype.getFulltextFormElement=function(t,r){return{name:e.FULLTEXT,qname:e.FULLTEXT,label:t,value:r,type:"STRING"}},e}();sr.ID_NEW=or.ID_NEW,sr.FULLTEXT="fulltext",sr.decorators=[{type:r.Injectable}],sr.ctorParameters=function(){return[{type:xt},{type:At},{type:ir},{type:gt}]};var ar=function(){function e(e){var t=this;this.eventService=e,this.cacheKey="eo.clipboard",this.clipboard={action:null,elements:[]},this.clipboardSource=new o.ReplaySubject(1),this.clipboard$=this.clipboardSource.asObservable(),e.on(yt.LOGOUT).subscribe((function(e){t.clear()})),this.loadCachedClipboard(),window.addEventListener("storage",(function(e){e.key===t.cacheKey&&t.loadCachedClipboard()}))}return e.prototype.set=function(e,t,r){this.clipboard={action:t,elements:e},r||this.updateCache(),this.clipboardSource.next(this.clipboard)},e.prototype.get=function(){return this.clipboard},e.prototype.clear=function(){this.clipboard={action:null,elements:[]},this.updateCache(),this.clipboardSource.next(this.clipboard)},e.prototype.updateCache=function(){window.localStorage.setItem(this.cacheKey,JSON.stringify(this.clipboard))},e.prototype.loadCachedClipboard=function(){var e=window.localStorage.getItem(this.cacheKey);try{var t=JSON.parse(e);t?this.set(t.elements,t.action,!0):this.clear()}catch(e){}},e}();ar.decorators=[{type:r.Injectable}],ar.ctorParameters=function(){return[{type:gt}]};var cr=function(){function e(e){this.toastrService=e,this.options={closeButton:!0,positionClass:"toast-bottom-right",timeOut:15e3}}return e.prototype.info=function(e,t){this.toast(e,t)},e.prototype.confirm=function(e,t,r,n){this.toast(e,t,"confirm",{onAdd:r,onRemove:n,timeOut:7e3})},e.prototype.success=function(e,t){this.toast(e,t,"success")},e.prototype.wait=function(e,t){this.toast(e,t,"wait")},e.prototype.error=function(e,t){this.toast(e,t,"error",{closeButton:!0,timeOut:7e3})},e.prototype.warning=function(e,t){this.toast(e,t,"warning")},e.prototype.toast=function(e,t,r,n){var o=Object.assign({},this.options,n);this.doToast(t,e,o,r)},e.prototype.doToast=function(e,t,r,n){switch(n){case"success":this.toastrService.success(e,t,r);break;case"error":this.toastrService.error(e,t,r);break;case"warning":this.toastrService.warning(e,t,r);break;case"confirm":this.toastrService.info(e,t,r);break;default:this.toastrService.info(e,t,r)}},e}();cr.decorators=[{type:r.Injectable}],cr.ctorParameters=function(){return[{type:ne.ToastrService}]};var ur=function(){function e(){}return e.prototype.apply=function(e,t){return console&&console[e]&&console[e].apply(console,Ct(t))},e.prototype.assert=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("assert",e)},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("debug",e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("error",e)},e.prototype.group=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("group",e)},e.prototype.groupEnd=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("groupEnd",e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("info",e)},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("log",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.apply("warn",e)},e}();ur.decorators=[{type:r.Injectable}];var pr=function(){function e(e){this.prepareService=e,this._targets=[],this.targetsSource=new o.ReplaySubject(1),this.uploadTargets$=this.targetsSource.asObservable()}return e.prototype.setOverlayActive=function(e){this.overlayActive=e},e.prototype.isOverlayActive=function(){return this.overlayActive},e.prototype.register=function(e){var t,r,n=this;e.referenceObject&&(e.description=("object"===e.type&&(null===(r=null===(t=e.referenceObject)||void 0===t?void 0:t.type)||void 0===r?void 0:r.label)?e.referenceObject.type.label+": ":"")+e.referenceObject.title,e.subFolder&&this.prepareService.getPrepareChildTypes(e.referenceObject.id).subscribe((function(t){n.isSubFolderAllowed(e.subFolder.data,t.types)&&(e.description+="; "+e.subFolder.name)})));var o=this._targets.find((function(t){return t.id===e.id}));o?Object.assign(o,e):this._targets.push(e),this.targetsSource.next(this._targets)},e.prototype.isSubFolderAllowed=function(e,t){return!!t.find((function(t){return t.name===e.type}))},e.prototype.unregister=function(e){this._targets=this._targets.filter((function(t){return t.id!==e})),this.targetsSource.next(this._targets)},e}();pr.decorators=[{type:r.Injectable}],pr.ctorParameters=function(){return[{type:Nt}]};var lr=function(){};lr.decorators=[{type:r.NgModule,args:[{exports:[ne.ToastrModule,t.TranslateModule]}]}];var hr=function(){function e(e){this.auth=e}return e.prototype.intercept=function(e,t){var r=this;return t.handle(e).pipe(i.tap((function(e){n.HttpResponse}),(function(e){(e instanceof n.HttpErrorResponse||e.isHttpErrorResponse)&&401===e.status&&r.auth.logout()})))},e}();hr.decorators=[{type:r.Injectable}],hr.ctorParameters=function(){return[{type:$t}]};var fr=function(){function e(e){if(e)throw new Error("EoCoreModule is already loaded. Import it in the AppModule only")}return e.forRoot=function(o){return{ngModule:e,providers:[Zt,{provide:n.HTTP_INTERCEPTORS,useClass:hr,multi:!0},{provide:Xe,useValue:o},{provide:et,useClass:tt,deps:[Xe]},{provide:r.APP_INITIALIZER,useFactory:rt,deps:[Zt],multi:!0},{provide:t.TranslateLoader,useClass:ot,deps:[n.HttpClient,et]},{provide:t.MissingTranslationHandler,useClass:nt}]}},e}();fr.decorators=[{type:r.NgModule,args:[{imports:[n.HttpClientModule,t.TranslateModule.forRoot(),ne.ToastrModule.forRoot()],providers:[$t,xt,It,Rt,ir,At,vt,nr,bt,Nt,Lt,zt,Bt,ar,Dt,cr,Ht,sr,gt,pr,Wt,{provide:It,useClass:ur},Yt],exports:[lr]}]}],fr.ctorParameters=function(){return[{type:fr,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var dr=function(e){this.id=mt.uuid(),this.name=e.name,this.size=e.size,this.type=e.type,this._file=e};Object.defineProperty(e,"TranslateLoader",{enumerable:!0,get:function(){return t.TranslateLoader}}),Object.defineProperty(e,"TranslateModule",{enumerable:!0,get:function(){return t.TranslateModule}}),Object.defineProperty(e,"TranslateService",{enumerable:!0,get:function(){return t.TranslateService}}),e.AppCacheService=vt,e.AuthService=$t,e.BackendService=xt,e.BpmService=zt,e.CORE_CONFIG=et,e.CUSTOM_CONFIG=Xe,e.CapabilitiesService=Bt,e.ClipboardService=ar,e.Config=bt,e.CoreConfig=tt,e.CoreInit=Zt,e.DmsObject=tr,e.DmsObjectAttachment=er,e.DmsObjectHistoryEntry=rr,e.DmsService=nr,e.EnaioEvent=yt,e.EnvironmentEnaio=Kt,e.EnvironmentService=Wt,e.EoCoreModule=fr,e.EoError=st,e.EoSharedModule=lr,e.EoUser=St,e.EoxMissingTranslationHandler=nt,e.EoxTranslateJsonLoader=ot,e.EventService=gt,e.FieldDefinition=ut,e.InboxItem=Ut,e.InboxService=Lt,e.LocalStorageService=Ht,e.Logger=It,e.NotificationsService=cr,e.ObjectType=_t,e.PrepareService=Nt,e.PreparedItem=Pt,e.Process=Gt,e.RangeValue=ft,e.SearchFilter=ht,e.SearchQuery=at,e.SearchResult=lt,e.SearchService=ir,e.SearchState=pt,e.SortOption=ct,e.StoredQueriesService=sr,e.StoredQuery=or,e.SystemService=At,e.UploadFileItem=dr,e.UploadRegistryService=pr,e.UploadService=Dt,e.UploadTarget=jt,e.UserService=Rt,e.Utils=mt,e.WorkItem=Vt,e.WorkItemHistoryEntry=Qt,e.init_module=rt,e.ɵa=Yt,e.ɵb=ur,e.ɵc=hr,Object.defineProperty(e,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=eo-sdk-client-projects-eo-sdk-core.umd.min.js.map