1import{B as Va,D as $a,F as er,H as tr,I as ui,J as Ha,L as Ya,M as Qa,c as wa,d as Di,e as Wo,g as oi,h as zo,i as jo,m as ge,n as Hn,o as hn,p as La,q as Ua,r as Qo,s as ri,t as Wi,u as Zo,v as Jo,x as Ba,y as Xo}from"./chunk-FJGCPGIF.js";import{b as Ut,c as Kn,d as Ka,e as Gn,f as zi,g as hi,i as Jt}from"./chunk-4RNQWIV6.js";import{a as Bn,b as un,c as Vn,d as $n,f as _n,i as Pe,j as Oa,k as Pa,m as qi,n as Yo,o as ne,p as ue,q as _i}from"./chunk-CJHUNIC5.js";import{a as Ji}from"./chunk-7ZMQM2WN.js";import{a as Bt}from"./chunk-UOFOCZLC.js";import{a as Zi,b as pt}from"./chunk-7EJNEQFC.js";import{B as dt,D as ir,E as Ne,K as fi,L as za,M as zn,O as _e,P as ja,Q as nr,R as he,S as Me,T as we,a as Ga,b as it,d as Ve,e as ji,f as Te,g as ye,h as Je,i as qa,j as Yi,k as je,l as qn,n as Ye,p as Wn,s as Qi,t as Wa,u as De,v as Ee}from"./chunk-6BME2YS5.js";import{$a as rt,$b as Ca,A as qt,Aa as ra,Ab as Ue,Ad as j,Ba as R,Bb as Be,C as et,Ca as Ui,Cb as vt,D as Pn,Da as Bo,Db as Ko,Dc as lt,Eb as Go,Ec as Sa,Fa as Ct,Fb as w,Fc as Ta,G as Jr,Ga as aa,Gb as ha,H as Li,Ha as Ze,Hb as x,Ia as sa,J as We,Jb as p,Jc as Ln,Kb as kn,Kc as Ft,L as Xr,Lb as Rn,Lc as ct,Ma as ni,Mb as It,N as k,Nb as Ge,O as Uo,Oa as la,Ob as le,P as ea,Pa as ca,Pb as ce,Pc as Da,Q as Lt,Qa as da,Qb as X,R as pn,Ra as s,Rb as Zt,Rc as Oe,Sb as W,T as tt,Ta as pa,Tb as $i,U as Pt,Ua as Bi,Ub as v,V as _t,Va as Vo,Vb as D,Wa as Et,Wb as F,Xb as fa,Xc as Mt,Y as ta,Ya as Vi,Yb as An,Yc as Ti,Z as Si,Zc as Gi,_ as ia,_a as L,_b as ga,_c as Ea,a as K,ab as Ae,ac as va,ad as qo,b as ve,bb as Le,bd as Fe,ca as Nt,cb as $o,cc as kt,cd as Ia,d as jr,da as na,db as Y,dd as Fa,e as ec,ec as ba,f as Yr,fa as li,fc as pi,fd as Ma,g as On,ga as Re,gc as Hi,h as At,ha as St,hc as ie,ia as me,ib as P,ic as ht,j as He,ja as V,jc as ya,jd as Un,l as be,lb as ma,lc as h,ld as mi,mb as u,mc as C,n as oe,nc as de,oa,ob as _,od as mn,pa as te,pb as Ho,q as Qr,qa as ot,qb as J,qc as fe,qd as Se,r as xe,ra as Ke,rb as G,rd as Na,s as Zr,sb as q,sd as ka,t as M,ta as g,tb as f,td as Ra,u as Ri,ua as ci,ub as c,ud as ae,v as Ai,vb as d,vc as ze,wa as E,wb as y,wc as xa,wd as $,x as S,xa as I,xb as ua,xc as Wt,xd as z,y as Ot,ya as Nn,yb as _a,yc as Ki,z as dn,za as di,zd as Aa}from"./chunk-BUIIXSYE.js";var wr=ec((Fr,Mr)=>{(function(i,o){typeof define=="function"&&define.amd?define([],o):typeof Fr<"u"?o():(o(),i.FileSaver={})})(Fr,function(){"use strict";function i(l,m){return typeof m>"u"?m={autoBom:!1}:typeof m!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),m={autoBom:!m}),m.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(l.type)?new Blob(["\uFEFF",l],{type:l.type}):l}function o(l,m,b){var T=new XMLHttpRequest;T.open("GET",l),T.responseType="blob",T.onload=function(){a(T.response,m,b)},T.onerror=function(){console.error("could not download file")},T.send()}function e(l){var m=new XMLHttpRequest;m.open("HEAD",l,!1);try{m.send()}catch(b){}return 200<=m.status&&299>=m.status}function t(l){try{l.dispatchEvent(new MouseEvent("click"))}catch(b){var m=document.createEvent("MouseEvents");
1m.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),l.dispatchEvent(m)}}var n=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,r=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=n.saveAs||(typeof window!="object"||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!r?function(l,m,b){var T=n.URL||n.webkitURL,O=document.createElement("a");m=m||l.name||"download",O.download=m,O.rel="noopener",typeof l=="string"?(O.href=l,O.origin===location.origin?t(O):e(O.href)?o(l,m,b):t(O,O.target="_blank")):(O.href=T.createObjectURL(l),setTimeout(function(){T.revokeObjectURL(O.href)},4e4),setTimeout(function(){t(O)},0))}:"msSaveOrOpenBlob"in navigator?function(l,m,b){if(m=m||l.name||"download",typeof l!="string")navigator.msSaveOrOpenBlob(i(l,b),m);else if(e(l))o(l,m,b);else{var T=document.createElement("a");T.href=l,T.target="_blank",setTimeout(function(){t(T)})}}:function(l,m,b,T){if(T=T||open("","_blank"),T&&(T.document.title=T.document.body.innerText="downloading..."),typeof l=="string")return o(l,m,b);var O=l.type==="application/octet-stream",U=/constructor/i.test(n.HTMLElement)||n.safari,H=/CriOS\/[\d]+/.test(navigator.userAgent);if((H||O&&U||r)&&typeof FileReader<"u"){var Z=new FileReader;Z.onloadend=function(){var Ce=Z.result;Ce=H?Ce:Ce.replace(/^data:[^;]*;/,"data:attachment/file;"),T?T.location.href=Ce:location=Ce,T=null},Z.readAsDataURL(l)}else{var ee=n.URL||n.webkitURL,N=ee.createObjectURL(l);T?T.location=N:location.href=N,T=null,setTimeout(function(){ee.revokeObjectURL(N)},4e4)}});n.saveAs=a.saveAs=a,typeof Mr<"u"&&(Mr.exports=a)})});var se=(function(i){return i.ADD_DOC_LINK="config_adddoclink_ordermanagement",i.ADD_DOC_TO_META="config_adddoctometa",i.ADD_TO_BASKET="config_addtobasket",i.COMPANY_PANEL="config_companypanel",i.CREATE_SEARCH_TEMPLATE="config_createsearchtemplate",i.DELIVERED_PANEL="config_viewglobaldelivered_panelordermanagement",i.DENY_ORDER="config_denyorder",i.DIRECT_ORDER="config_directorder_ordermanagement",i.DOWNLOAD_PANEL="config_download_panel",i.EDIT_DOCUMENT_MANAGEMENT="config_editdocumentmanagement",i.EDIT_FAVORITES="config_editfavorites",i.EDIT_LICENSE_PANEL="config_editlicensepanel",i.EDIT_METADATA="config_editmetadata",i.EDIT_QUERIES="config_editqueries",i.EDIT_REQUESTED_ORDER_METADATA="config_editrequestedorder_metadata",i.EDIT_REQUESTED_ORDER_ORDERDATA="config_editrequestedorder_orderdata",i.EDIT_SHOPPING_CART_ORDER_ORDERDATA="config_editshoppingcartorder_orderdata",i.EXPORT_CSV="config_exportcsv",i.EXPORT_CSV_ADMIN="config_exportcsvadmin",i.EXTENDED_SEARCH="config_extended_search",i.FAVORITES_PANEL="config_favoritespanel",i.GROUP_PANEL="config_grouppanel",i.IMPORT_CSV="config_importcsv",i.LATEST_OBSERVATION_PANEL="config_viewlastmonitored",i.LOCATION_PANEL="config_location_panel",i.ORDERED_PANEL="config_viewglobalordered_panelordermanagement",i.RELEASE_ORDER_MANAGER="config_releaseordermanager",i.REQUESTED_PANEL="config_viewindividualreq_panelordermanagement",i.REQUEST_ORDER="config_requiredoc_panelordermanagement",i.SEND_ORDER_NOTE="config_sendordernote",i.SETTINGS="config_settings",i.SETTINGS_ADMIN="config_settings_admin",i.SHARE_FAVORITES="config_sharefavorites",i.SHARE_QUERIES="config_sharequeries",i.SHOPPING_CART_PANEL="config_viewindividualbasket_panelordermanagement",i.READ_ORDERS="config_readordermanager",i.START_COMPANY_OBSERVATION="config_updatetenant",i.STATISTICTS_PANEL="config_statistics_panel",i.USER_PANEL="config_userpanel",i.VIEW_MENU="config_viewcontextmenu",i.VIEW_DASHBOARD="config_viewdashboard",i.VIEW_DASHBOARD_BACKUPS="config_viewdashboard_backups",i.VIEW_DASHBOARD_COMPANY="config_viewdashboard_company",i.VIEW_DASHBOARD_SUPPORT="config_viewdashboard_support",i.VIEW_DOCUMENT_MANAGEMENT="config_viewdocumentmanagement",i.VIEW_HELP_SUPPORT="config_viewhelp_support",i.VIEW_LICENSE_PANEL="config_viewlicensepanel",i.VIEW_OWN_QUERIES="config_viewownqueries",i.VIEW_SHARED_FOLDERS_AND_SEARCH_TEMPLATES="config_viewsharedfolders_and_searchtemplates",i.STAMP_PANEL="config_stamp_panel",i})(se||{});var Ei=(function(i){return i.delivered="delivered",i.ordered="ordered",i.released="released",i.requested="requested",i.shoppingCart="shopping-cart",i})(Ei||{});var or=class{_document;_textarea;constructor(o,e){this._document=e;let t=this._textarea=this._document.createElement("textarea"),n=t.style;n.position="fixed",n.top=n.opacity="0",n.left="-999em",t.setAttribute("aria-hidden","true"),t.value=o,t.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(t)}copy(){let o=this._textarea,e=!1;try{if(o){let t=this._document.activeElement;o.select(),o.setSelectionRange(0,o.value.length),e=this._document.execCommand("copy"),t&&t.focus()}}catch(t){}return e}destroy(){let o=this._textarea;o&&(o.remove(),this._textarea=void 0)}},Za=(()=>{class i{_document=g(di);constructor(){}copy(e){let t=this.beginCopy(e),n=t.copy();return t.destroy(),n}beginCopy(e){return new or(e,this._document)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Xi=(()=>{class i{constructor(){this._configService=g(Se),this._httpClient=g(Fe),this._authService=g(ue),this._router=g(mi),this._clipboard=g(Za),this._currentNotifications=new oe({unreadNotificationCount:0,notifications:[]}),this.currentNotifications$=this._currentNotifications.asObservable(),this.errorStatus="Error",this._defaultFolderSubscription=new oe(null),this._defaultSearchTemplateSubscription=new oe(null),this._monitoringUpdateContainerShown=new be,this._folderSubscriptions=new oe([]),this.folderSubscriptions$=this._folderSubscriptions.asObservable(),this.monitoringUpdateContainerShown$=this._monitoringUpdateContainerShown.asObservable()}getUnreadNotifications(){let e=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/messages/inappnotifications/unread";return this._httpClient.get(e,{observe:"response"}).pipe(We(t=>
1t.status===ge.OK),S(t=>this.mapToNotificationResponseModel(t.body)),V(t=>this._currentNotifications.next(t)),Re(()=>this.currentNotifications$))}getNotifications(){let e=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/messages/inappnotifications";return this._httpClient.get(e,{observe:"response"}).pipe(We(t=>t.status===ge.OK),S(t=>this.mapToNotificationResponseModel(t.body)),V(t=>this._currentNotifications.next(t)),Re(()=>this.currentNotifications$))}getUnreadNotificationsChronological(){return this.getUnreadNotifications().pipe(S(e=>e?.notifications?(e.notifications.sort((t,n)=>new Date(n.creationDate).getTime()-new Date(t.creationDate).getTime()),e):{totalNotificationCount:0,unreadNotificationCount:0,notifications:[]}))}getNotificationsChronologicalPaged(e,t,n=null){let r=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/messages/inappnotifications",a=new Ti().set("sorting.SortField","CreationDate").set("sorting.SortDir","Desc").set("paging.PageSize",t.toString()).set("paging.PageNumber",(e-1).toString());return n?.area&&n.area.length>0&&(a=a.set("filter.Area",n.area)),n?.status!=null&&(a=a.set("filter.Unread",n.status)),this._httpClient.get(r,{observe:"response",params:a}).pipe(We(l=>l.status===ge.OK),S(l=>{let m=this.mapToNotificationResponsePagedModel(l.body);return m?.items||(m={count:m.count??0,items:[]}),m}))}getFieldOptions(){let e=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/subscriptions/selectedfieldsoptions";return this._httpClient.get(e)}markNotificationsAsRead(e){let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/messages/inappnotifications",n={notificationIds:e,action:"MarkRead"};return this._httpClient.post(t,n,{observe:"response"}).pipe(V(r=>{if(r.status===ge.OK){let a=this._currentNotifications.getValue();a.notifications=a.notifications.map(l=>(e.includes(l.id)&&(l.isRead=!0),l)),a.unreadNotificationCount=a.notifications.filter(l=>!l.isRead).length,this._currentNotifications.next(a)}}),S(r=>ne.isAccepted(r.status)))}markNotificationsAsUnread(e){let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/messages/inappnotifications",n={notificationIds:e.map(r=>r.id),action:"MarkUnread"};return this._httpClient.post(t,n,{observe:"response"}).pipe(V(r=>{if(r.status===ge.OK){let a=this._currentNotifications.getValue();e.forEach(l=>{l.isRead=!1,a.notifications.forEach(m=>{m.id===l.id&&(m.isRead=!1)}),a.notifications.some(m=>m.id===l.id)||a.notifications.push(l)}),a.unreadNotificationCount=a.notifications.filter(l=>!l.isRead).length,a.totalNotificationCount=a.notifications.length,this._currentNotifications.next(a)}}),S(r=>ne.isAccepted(r.status)))}deleteNotifications(e){let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/messages/inappnotifications",n={notificationIds:e,action:"Delete"};return this._httpClient.post(t,n,{observe:"response"}).pipe(V(r=>{if(r.status===ge.OK){let a=this._currentNotifications.getValue();a.notifications=a.notifications.filter(l=>!e.includes(l.id)),a.unreadNotificationCount=a.notifications.filter(l=>!l.isRead).length,this._currentNotifications.next(a)}}),S(r=>ne.isAccepted(r.status)))}activateSubscriptions(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/subscriptions/activate`,n=e;return this._httpClient.put(t,n,{observe:"response"})}deactivateSubscriptions(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/subscriptions/deactivate`,n=e;return this._httpClient.put(t,n,{observe:"response"})}addDefaultSubscription(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/subscriptions/default`,n={favoritesFolderId:e};return this._httpClient.post(t,n,{observe:"response"})}getDefaultSubscription(e="folder"){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/subscriptions/defaultsettings/${e}`;return e==="folder"&&this._defaultFolderSubscription.getValue()?this._defaultFolderSubscription.asObservable():e==="searchtemplate"&&this._defaultSearchTemplateSubscription.getValue()?this._defaultSearchTemplateSubscription.asObservable():this._httpClient.get(t).pipe(V(n=>e==="folder"?(this._defaultFolderSubscription.next(n),this._defaultFolderSubscription.asObservable()):(this._defaultSearchTemplateSubscription.next(n),this._defaultSearchTemplateSubscription.asObservable())))}getFolderSubscriptions(){let e=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/subscriptions";return this._httpClient.get(e).pipe(V(t=>this._folderSubscriptions.next(t)))}triggerSubscriptions(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/subscriptions/observe`,n=e;return this._httpClient.put(t,n,{observe:"response"}).pipe(S(r=>r.status===ge.NO_CONTENT),V(r=>{r&&this._monitoringUpdateContainerShown.next(!0)}),k(()=>M(!1)))}
1activateEMailNotifications(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/usercontent/mailnotifications/activate`,n=e;return this._httpClient.put(t,n,{observe:"response"})}deActivateEMailNotifications(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/usercontent/mailnotifications/deactivate`,n=e;return this._httpClient.put(t,n,{observe:"response"})}addOrUpdateSubscriptions(e,t,n,r){let a={subscriptionIds:t,nonSubscribedFolderIds:n,trigger:e.trigger,updateFrequency:e.updateFrequency,observe:r},l=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/subscriptions";return this._httpClient.put(l,a,{observe:"response"}).pipe(V(m=>{(m.status===ge.OK||m.status===204)&&r&&this._monitoringUpdateContainerShown.next(!0)}),S(m=>m.body))}hideMonitoringUpdateContainer(){this._monitoringUpdateContainerShown.next(!1)}followNotificationLink(e){let t=e?.service,n=localStorage.getItem(qi);if(!t?.name)return console.warn("Notification ohne service oder ohne service.name:",e),{linkError:!0,handleProcessId:!1,processIdCopied:null};let r=t.name.toLowerCase(),a=t.status?.toLowerCase()??null,l=t.originalStatus?.toLowerCase()??null;switch(r){case"ordermanagement":this.followOrderManagementLink(n,t);break;case"observer":e.data?.observationNoChanges||this._router.navigate([`${n}/observation/latest-observations`]);break;case"search":switch(a){case"export":this._router.navigate([`${n}/exports`]);break;case"import":this._router.navigate([`${n}/favorites-management`]);break}break;case"favorites":this._router.navigate([`${n}/exports`]);break;case"documentaccess":case"statistics":this.handleDocAccessAndStatisticsLink(l,e,n);break;case"metadata":a==="reminder"&&this._router.navigate([`${n}/search/item-detail/${e.metadata.acCode}`]);break;case"licenseddocuments":switch(a){case"documentthresholdwarning":this._router.navigate([`${n}/licenses/edit/${e.licenseDocumentThresholdData.licenseId}`]);break;case"export":this._router.navigate([`${n}/exports`]);break}break;default:a==="export"&&this._router.navigate([`${n}/exports`]);break}return{linkError:!1,handleProcessId:!1,processIdCopied:null}}handleDocAccessAndStatisticsLink(e,t,n){if(e===this.errorStatus?.toLowerCase()){let r=`TenantID: ${this._authService.userInfo.tenantId} 2 JobID: ${t.reqifData?.jobId}`;return{linkError:!1,handleProcessId:!0,processIdCopied:[t.reqifData?.jobId,this._clipboard.copy(r)]}}return t.name?.toLowerCase()==="statisticsdeleted"?this._router.navigate([`${n}/statistics`]):this._router.navigate([`${n}/exports`]),{linkError:!1,handleProcessId:!1,processIdCopied:null}}followOrderManagementLink(e,t){let n,r=t.status==="changedocument"||t.status==="edited"?t.originalStatus:t.status;switch(r){case"declined":n=Ei.shoppingCart;break;case"delivered":this._authService.userHasPermission(se.DELIVERED_PANEL)?n=r:n=Ei.requested;break;case"ordered":this._authService.userHasPermission(se.ORDERED_PANEL)?n=r:n=Ei.requested;break;case"released":this._authService.userHasPermission(se.RELEASE_ORDER_MANAGER)?n=r:n=Ei.requested;break;case"requested":n=r;break;case"csvexport":case"export":this._router.navigate([`${e}/exports`]);break;default:n=Ei.shoppingCart;break}n&&this._router.navigate([`${e}/orders/${n}`],{state:{serviceId:t.id}})}mapToNotificationResponseModel(e){return{totalNotificationCount:e.notifications.length,unreadNotificationCount:e.unreadNotificationCount,notifications:e.notifications.map(t=>this.mapToNotificationModel(t))}}mapToNotificationResponsePagedModel(e){return{count:e.count,items:e.items.map(t=>this.mapToNotificationModel(t))}}mapToNotificationModel(e){let t=e.jsonData?JSON.parse(e.jsonData):{},n;tc(t)?n=t:ic(t)?n={observationNoChanges:t.observationNoChanges===!0||t.observationNoChanges==="true",changes:null,hasMoreItems:!1,moreItemsCount:0}:n={observationNoChanges:!1,changes:null,hasMoreItems:!1,moreItemsCount:0};let r=nc(t)?t:{},a=oc(t)?t:{},l=rc(t)?t:{},m=ac(t)?t:{},b=sc(t)?t:{};return{id:e.id,userId:e.userId,isRead:e.isRead,creationDate:new Date(e.creationDate),name:e.name,title:e.title||void 0,messageBody:e.messageBody||void 0,service:e.service,data:n,reqifData:r,hostedFileData:a,metadata:l,metadataReleaseLevelData:m,licenseDocumentThresholdData:b}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function tc(i){return i!=null&&Array.isArray(i.changes)&&typeof i.hasMoreItems=="boolean"&&typeof i.moreItemsCount=="number"}function ic(i){return i!=null&&(i.observationNoChanges===!0||i.observationNoChanges==="true")}function nc(i){return i!=null&&typeof i.jobId=="string"&&typeof i.documentNumber=="string"&&typeof i.dateOfIssue=="string"}function oc(i){return i!=null&&typeof i.fileName=="string"}function rc(i){return i!=null&&typeof i.acCode=="string"&&typeof i.documentNumber=="string"}function ac(i){return i!=null&&typeof i.acCode=="string"&&typeof i.documentNumber=="string"&&(i.releaseLevel===null||typeof i.releaseLevel=="string")}function sc(i){return i!=null&&typeof i.licenseId=="string"&&typeof i.documentCount=="number"&&typeof i.documentLimit=="number"&&typeof i.documentThreshold=="number"}var zt=(function(i){return i.ADD="Add",i.REPLACE="Replace",i.NOTIFY="Notify",i})(zt||{});var jn=(function(i){return i[i.MonthlyAfterDataUpdate=1]="MonthlyAfterDataUpdate",i[i.WeeklyAfterDataUpdate=2]="WeeklyAfterDataUpdate",i[i.Daily=3]="Daily",i})(jn||{});var B=(function(i){return i[i.FILE_DIGITAL=0]="FILE_DIGITAL",i[i.FILE_LINK_WWW=1]="FILE_LINK_WWW",i[i.FILE_PAPER=2]="FILE_PAPER",i[i.FILE_LINK_LOCAL=3]="FILE_LINK_LOCAL",i[i.FILE_HOSTED=4]="FILE_HOSTED",i})(B||{});function fn(i){return i?.forEach(o=>{o.children?.sort(Xa),o?.hasChildren&&o?.children?.length&&fn(o?.children)}),i||[]}function Ja(i){return i?.sort(Xa)}var Xa=(i,o)=>i.title.localeCompare(o.title,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!1,caseFirst:"upper"});var ts=/\.([^.]+)$/,Xt=(()=>{class i{constructor(){this._notificationService=g(Xi),this._httpClient=g(Fe),this._configService=g(Se),this._authService=g(ue),this._translocoService=g(ae),this._extendedBaseUrl=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}
2`,this.folderToSubscribeSubject=new oe(null),this.folderToUnsubscribeSubject=new oe(null),this._updateTree=new oe(null),this.updateTree$=this._updateTree.asObservable(),this.deletedFavoritesFolders=new Set,this._emptyGuid=Pe}get lastSearchParamsForNavigation(){return this._lastSearchParamsForNavigation}set lastSearchParamsForNavigation(e){e&&(this._lastSearchParamsForNavigation=e)}getFolderCountForUser(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/user/${e}/folders/count?isUserReadOnly=${t}`;return this._httpClient.get(n)}getFavoriteOrNoteInformationListByAcCodes(e){let t=`${this._extendedBaseUrl}/usercontent/favorites`;return this._httpClient.post(t,e)}getFavoriteAcCodesForFolderByUser(e){if(!e)return M(null);let t=`${this._extendedBaseUrl}/usercontent/favorites/${e}`;return this._httpClient.get(t)}getFavoritesByAcCode(e){let t=`${this._extendedBaseUrl}/usercontent/favorites/accode/${e}`;return this._httpClient.get(t).pipe(S(n=>(n.favorites.forEach(r=>this.calculateShared(r)),n.notes.forEach(r=>this.calculateShared(r)),n)))}setFavoriteAcCodes(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/favorites`;return this._httpClient.post(n,{acCodes:e,folderType:t},{observe:"response"})}leaveSharedFolder(e){let t=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/share/leave`;return this._httpClient.post(t,void 0,{observe:"response"})}downloadAttachedFile(e){let t=`${this._extendedBaseUrl}/documentaccess/favoritesfolder/download/${e}`;return this._httpClient.get(t,{responseType:"blob"})}setFavoriteAcCodesToFolders(e,t,n){let r=`${this._extendedBaseUrl}/usercontent/favoritesfolders/favoritestomany`;return this._httpClient.post(r,{acCodes:e,folderIds:t,folderType:n},{observe:"response"})}unsetFavoriteAcCodes(e,t,n){let r;return n?r=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${n}/favorites/remove`:r=`${this._extendedBaseUrl}/usercontent/favoritesfolders/favorites/remove`,this._httpClient.post(r,{acCodes:e,folderType:t},{observe:"response"})}removeFromFavoriteFolders(e,t,n){let r=[];for(let a of t){let l=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${a}/favorites/remove`;r.push(this._httpClient.post(l,{acCodes:[e],folderType:n}))}return et(r)}getRootFolderAndNotification(e,t=!1,n=null,r=null){let a;n==null?r==null?a=this.getRootFolderBackendCall(e):a=this.getRootFolderForUserBackendCall(e,r):a=this.getFolderTree(n,e);let l=this._notificationService.getFolderSubscriptions().pipe(k(()=>M([])));return Xr(l,a).pipe(S(([m,b])=>{if(!b)return[];let T=this.toFavoriteTreeItemVMs(this.recursivelyRemoveNodesByIdForArray(this.deletedFavoritesFolders,b),m??[]);return t&&(T=this.filterDynamicFolders(T)),T=T.filter(O=>!T.some(U=>U!==O&&U.children?.some(H=>H.id===O.id))),fn(T)}))}filterDynamicFolders(e){return e.forEach(t=>{t.hasChildren&&t.children&&(t.children=t.children.filter(n=>!n.searchFormId||n.searchFormId===Pe))}),e}getChildFolders(e,t,n=!1){let r=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/folders`;return t&&(r+="/shared"),this._httpClient.get(r).pipe(Nt(),Re(a=>a?this._notificationService.folderSubscriptions$.pipe(tt(1),S(l=>{if(l){let m=this.toFavoriteTreeItemModel(this.recursivelyRemoveNodesById(this.deletedFavoritesFolders,a),l).children;return n&&(m=m.filter(b=>!b.searchFormId||b.searchFormId===Pe)),Ja(m)}return[]})):xe))}updateTree(e){this._updateTree.next(e)}createFavoritesFolder(e,t,n,r){let a=`${this._extendedBaseUrl}/usercontent/favoritesfolders`,l={label:e,parentFolderIds:t,folderType:n,description:r};return this._httpClient.post(a,l).pipe(S(m=>({favoritesFolderCreateResponse:m,favoritesFolderTitle:e,favoritesFolderDescription:r})))}createDynamicFolder(e){let t={id:Pe,parentFolderId:e.parentFolderId,searchFormId:e.searchFormId},n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/searchform`;return this._httpClient.post(n,t,{observe:"response"})}searchFavoritesFolders(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/search`,r={searchTrunk:e,folderType:t};return e?this._httpClient.post(n,r).pipe(Re(a=>{let l=Array.isArray(a)&&a.length>0?a[0]:void 0;return l?this._notificationService.folderSubscriptions$.pipe(S(m=>m?[this.toFavoriteTreeItemModel(l,m)]:[]),tt(1)):this.getRootFolderAndNotification(t).pipe(S(m=>{let b=m[0];return b.children=[],b.hasChildren=!1,m}))})):this.getRootFolderAndNotification(t)}copyFavoritesFolders(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/copy`,r={fromFavoritesFolderIds:e,toFavoritesFolderIds:t};return this._httpClient.post(n,r).pipe(S(a=>a.map(m=>{let{fromFavoritesFolderId:b,newFavoritesFolderId:T,toFavoritesFolderId:O}=m;return{fromFavoritesFolderId:b,newFavoritesFolderId:T,toFavoritesFolderId:O}})))}deleteFavoritesFolders(e){for(let r of e)this.deletedFavoritesFolders.has(r)||this.deletedFavoritesFolders.add(r);let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/usercontent/favoritesfolders/delete",n={favoritesFolderIds:e};return this._httpClient.post(t,n,{observe:"response"}).pipe(S(r=>ne.isAccepted(r.status)),k(()=>M(!1)))}updateFavoriteDescription(e){let t=e.folderId,n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${t}/description/label`,r={title:e.title,text:e.text,label:e.title};return this._httpClient.put(n,r,{observe:"response"}).pipe(S(a=>
2a.status===ge.OK))}getFavoriteDescription(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/folders`;return t&&(n+="/shared"),this._httpClient.get(n,{}).pipe(S(r=>this.toFavoriteDescriptionModel(r)))}uploadAcFile(e){let n={headers:i.getHeaders()},r=e.file,a=e.description,l=new FormData;l.append("FileName",r),l.append("Description",a);for(let b of e.acCodes)l.append("AcCodes[]",b);l.append("Language",e.language),l.append("DocumentType",e.documentType),l.append("DocumentNumber",e.documentNumber),l.append("PublicationDate",e.dateOfIssue),e.type===B.FILE_LINK_LOCAL?l.append("Url",e.link):l.append("Url",e.url),l.append("Type",e.type.toString()),l.append("Location",e.location||""),l.append("Building",e.building||""),l.append("Room",e.room||""),l.append("Cabinet",e.locker||""),e.hostedFileId&&l.append("HostedFileId",e.hostedFileId);let m=`${this._extendedBaseUrl}/files`;return e.id&&(l.append("Id",e.id),m=`${this._extendedBaseUrl}/files/update/${e.id}`),this._httpClient.put(m,l,n)}uploadFavoriteFile(e){let n={headers:i.getHeaders()},r=e.name,a=B.FILE_LINK_LOCAL.toString();Object.hasOwn(e,"file")&&(r=e.file.name,a=B.FILE_DIGITAL.toString());let l=new FormData;l.append("FileName",r),l.append("FavoritesFolderId",e.favoriteId),l.append("Url",e.url||""),l.append("Language",e.lang||""),l.append("Description",e.description||""),Object.hasOwn(e,"file")&&l.append("File",e.file,r),l.append("Type",a);let m=`${this._extendedBaseUrl}/files/favoritesfolder`;return this._httpClient.put(m,l,n)}deleteFavoriteFile(e){let t=`${this._extendedBaseUrl}/files/favoritesfolder/${e}`;return this._httpClient.delete(t,{})}deleteAcFile(e){let t=`${this._extendedBaseUrl}/files/${e}`;return this._httpClient.delete(t,{})}deleteAcFiles(e){let t=`${this._extendedBaseUrl}/files/bulkDelete`;return this._httpClient.post(t,e)}getFavoritesFolderNames(e){if(!e.length)return M([]);let t=e.map(n=>this.getFavoritesFolderName(n).pipe(k(()=>M(null))));return et(t).pipe(S(n=>n.filter(r=>r!==null)))}getFavoritesFolderName(e){if(e==="-1")return M({title:this._translocoService.translate("search.extended_search.search_all_folders"),id:"-1"});let t=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/folders/shared`;return this._httpClient.get(t).pipe(S(n=>({title:n.title,id:n.id})))}getShareInformation(e){let t=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/share`;return this._httpClient.get(t).pipe(S(n=>this.toFavoritesFolderShareModel(n)))}shareFavoritesFolder(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/share`;return this._httpClient.post(n,t,{observe:"response"})}shareFavoritesFolderMultiple(e){let t=`${this._extendedBaseUrl}/usercontent/favoritesfolders/share`;return this._httpClient.post(t,e,{observe:"response"})}changeFavoritesFolderShare(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/share`;return this._httpClient.put(n,t,{observe:"response"})}changeFolderOwner(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/changeOwner`;return this._httpClient.put(n,t,{observe:"response"})}removeFavoritesFolderShare(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/share/remove`;return this._httpClient.post(n,{includeSubFolders:t},{observe:"response"})}startTenantObservation(){let e=`${this._extendedBaseUrl}/subscriptions/observetenant/2`;return this._httpClient.put(e,{},{observe:"response"})}getNodeIcon(e){let t=this.isNodeDynamic(e)?"template-":"folder-";return e.isSharedFromMe?t+="shared-from-me":e.isSharedWithMe?t+="shared-with-me":t+="unshared","children"in e&&e.children&&e.children.length>0&&(e.children=e.children.map(n=>(n.icon=this.getNodeIcon(n),n))),t}userCanOpenContextMenu(e){return this._authService.userHasPermission(se.SHARE_FAVORITES)||this._authService.userHasPermission(se.EDIT_FAVORITES)&&(!e.isSharedWithMe||e.searchFormId!==this._emptyGuid&&this._authService.userHasPermission(se.EDIT_QUERIES)&&(e.isSharedWithMe||this._authService.userHasPermission(se.SHARE_FAVORITES)))}getAllFolderIdsOfUser(e){let t=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/allids`;return this._httpClient.get(t)}static getHeaders(){let e=new Mt;return e=e.append("Content-Type","empty"),e=e.append("Accept","*/*"),e=e.append("Response-Type","text/csv"),e}toFavoriteDescriptionModel(e){return{description:e.description,descriptionFiles:e.descriptionFiles.map(t=>{let r=ts.exec(t.fileName)[1]??"";return{favoritesFolderId:t.favoritesFolderId,fileName:t.fileName,fileType:r,fileSize:t.fileSize,id:t.id,language:t.language,saved:!0,deleted:!1}})}}getRootFolderBackendCall(e){let t=`${this._extendedBaseUrl}/usercontent/favoritesfolders/folders?folderType=${e}`;return this._httpClient.get(t)}getRootFolderForUserBackendCall(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/user/${t}/folders?folderType=${e}`;return this._httpClient.get(n)}getFolderTree(e,t){let n=`${this._extendedBaseUrl}/usercontent/favoritesfolders/${e}/${t}/tree`;return this._httpClient.get(n)}toFavoritesFolderShareModel(e){return{userGroupRights:e.userGroupRights,userRights:e.userRights}}recursivelyRemoveNodesByIdForArray(e,t){if(!t||t.length<1)return null;let n=[];for(let r of t){let a=this.recursivelyRemoveNodesById(e,r);a&&n.push(a)}return n}recursivelyRemoveNodesById(e,t){if(!t?.id||e.has(t.id))return null;let n=[];if(t.childFolders!=null)for(let a of t.childFolders){let l=this.recursivelyRemoveNodesById(e,a);l!=null&&n.push(l)}let r=t.childFolders?.length||0;return{id:t.id,title:t.title,fullPath:t.fullPath,childFolders:n,hasChildren:t.hasChildren&&(n.length>0||n.length===r),isSharedFromMe:t.isSharedFromMe,isSharedWithMe:t.isSharedWithMe,isMonitored:t.isMonitored,matchesSearch:t.matchesSearch,description:t.description,descriptionFiles:t.descriptionFiles,sharedFromGroup:t.sharedFromGroup,searchFormId:t.searchFormId,rights:t.rights,accessLevel:t.accessLevel,emailActive:t.emailActive}}toFavoriteTreeItemModel(e,t){if(!e)return this.getEmptyTreeItem();let n=e.childFolders&&e.childFolders.length>0;return{id:e.id,title:e.title,fullPath:e.fullPath,matchesSearch:e.matchesSearch,hasChildren:e.hasChildren,isMonitored:e.isMonitored,isSharedFromMe:e.isSharedFromMe,isSharedWithMe:e.isSharedWithMe,sharedFromGroup:e.sharedFromGroup,searchFormId:e.searchFormId,children:n?this.toFavoriteTreeItemVMs(e.childFolders,t):null,subscription:this.getFolderSubscription(e.id,t),rights:e.rights,accessLevel:e.accessLevel,de
2scription:K({},e.description),descriptionFiles:e.descriptionFiles.map(r=>this.favoriteDescriptionFileDtoToFavoriteDescriptionFileModel(r)),emailNotification:e.emailActive}}favoriteDescriptionFileDtoToFavoriteDescriptionFileModel(e){let n=ts.exec(e.fileName)[1]??"";return ve(K({},e),{fileType:n})}toFavoriteTreeItemVMs(e,t){let n=[];if(!e)return n;for(let r of e)n.push(this.toFavoriteTreeItemModel(r,t));return n}getFolderSubscription(e,t){if(t){let n=t.find(r=>r.subscriptionId===e);if(n){let{fields:r,flags:a,further:l}=n.trigger;return ve(K({},n),{trigger:{further:l,fields:r,flags:{amendedSinceLastUpdate:{action:zt[a.amendedSinceLastUpdate?.action.toUpperCase()],active:a.amendedSinceLastUpdate?.active},historic:{action:zt[a.historic?.action.toUpperCase()],active:a.historic?.active},intendedWithdrawal:{action:zt[a.intendedWithdrawal?.action.toUpperCase()],active:a.intendedWithdrawal?.active},modifiedByAmendments:{action:zt[a.modifiedByAmendments?.action.toUpperCase()],active:a.modifiedByAmendments?.active},new:{action:zt[a.new?.action.toUpperCase()],active:a.new?.active},partiallyReplaced:{action:zt[a.partiallyReplaced?.action.toUpperCase()],active:a.partiallyReplaced?.active},partiallyReplacedSinceLastUpdate:{action:zt[a.partiallyReplacedSinceLastUpdate?.action.toUpperCase()],active:a.partiallyReplacedSinceLastUpdate?.active},reInstated:{action:zt[a.reInstated?.action?.toUpperCase()],active:a.reInstated?.active},withdrawnSinceLastUpdate:{action:zt[a.withdrawnSinceLastUpdate?.action.toUpperCase()],active:a.withdrawnSinceLastUpdate?.active}}},updateFrequency:{updateFrequencyOptions:this.getFrequencyOptionsValue(n.updateFrequency.updateFrequencyOptions)}})}return null}return null}getFrequencyOptionsValue(e){return jn[jn[e]]}getEmptyTreeItem(){return{accessLevel:{fullAccess:!0,owner:!0,read:!0,write:!0},children:null,description:{text:"",title:""},descriptionFiles:[],hasChildren:!1,id:"",isMonitored:!1,isSharedFromMe:!1,isSharedWithMe:!1,matchesSearch:!1,rights:[],searchFormId:Pe,sharedFromGroup:!1,subscription:null,title:"",emailNotification:null}}isNodeDynamic(e){return"searchFormId"in e&&e.searchFormId!==Pe}calculateShared(e){return e.isSharedFromMe=!1,e.isSharedWithMe=!1,e.shared&&(e.ownedByMe?e.isSharedFromMe=!0:e.isSharedWithMe=!0),e}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var at=(function(i){return i.delivered="delivered",i.ordered="ordered",i.rejected="declined",i.released="released",i.requested="requested",i.shoppingCart="shoppingcart",i})(at||{});var en=class{static isDraftDocument(o){return["N-E","TR-E","DC"].some(t=>o.includes(t))}};var ai=class{static buildSearchUrl(o,e,t){let n=o.indexOf("?")>-1?"&":"?";return`${o}${n}pageSize=${e}&pageNumber=${t-1}`}static setSearchUrlSort(o,e,t){if(e==null&&t==null)return o;let n=o.indexOf("?")>-1?"&":"?";return e==null?o+`${n}sortDir=${t}`:t==null?o+`${n}sortField=${e}`:o+`${n}sortField=${e}&sortDir=${t}`}};var Yn=(()=>{class i{constructor(){this._httpClient=g(Fe),this._configService=g(Se),this._authService=g(ue),this._cancelWebshopDownload=!1,this._orderStates=at,this._currentDownloadOrderId=new oe(null),this.currentDownloadOrderId$=this._currentDownloadOrderId.asObservable(),this._orders=new oe(null),this.orders$=this._orders.asObservable(),this._orderCountSummary=new oe({deliveredCount:0,orderedCount:0,releasedCount:0,requestedCount:0,shoppingCartCount:0}),this.orderCountSummary$=this._orderCountSummary.asObservable(),this._newDataset=new oe(void 0),this.newDataset$=this._newDataset.asObservable(),this._stateToOrderCountMap=new Map,this.buildOrderStateToOrderCountMap()}createOrders(e,t=!0){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order`;return this._httpClient.post(n,e,{observe:"response"}).pipe(V(r=>{if(ne.isAccepted(r.status)&&t){let a=this._orderCountSummary.getValue();r.body.forEach(l=>{l.status===this._orderStates.requested?a.requestedCount+=1:a.shoppingCartCount+=1}),this._orderCountSummary.next(a)}}))}refreshOrderCountSummary(e=null,t=null){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/orderCount`,r=new URLSearchParams;e&&r.set("status",e),t&&r.set("filter",t);let a=r.toString();a&&(n+=`?${a}`),this._httpClient.get(n).subscribe(l=>{if(l){let m=l;this._orderCountSummary.next(m)}})}generateWebshopLinks(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/shop/webshop`;return this._httpClient.get(t,{params:{productId:e}})}clearOrders(){this._orders.next(null)}setNewDataset(e){this._newDataset.next(e)}loadOrders(e,t,n,r,a){this.getRequestedOrdersByState(e,t,n,r,a).subscribe(l=>{if(l){this.refreshOrderCountSummary(t,a);let m=l.map(b=>this.convertOrderDtoToOrderModel(b));this._orders.next(m)}else this._orders.next([])})}downloadFromWebShop(e){this._cancelWebshopDownload=!1;let t=e.map(n=>this.sendInstantDownloadRequest(n).pipe(k(r=>M(r))));return qt(...t).pipe(me(()=>!this._cancelWebshopDownload,!0))}cancelWebshopDownload(){this._cancelWebshopDownload=!0}sendInstantDownloadRequest(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/shop/instantdownload`;return this._httpClient.post(t,e,{observe:"events"}).pipe(V(n=>{n.type===Gi.Sent&&this._currentDownloadOrderId.next(e.orderId)}),S(n=>
2{if(n.type===Gi.Response){let r=this._orders.getValue(),a=r.find(m=>m.id===e.orderId),l=r.filter(m=>m.id!==e.orderId);return this.updateOrderCount(a,this._orderStates.delivered),this._orders.next(l),{success:!0,orderId:e.orderId}}return{success:null,orderId:null}}),k(()=>Ri(()=>({success:!1,orderId:e.orderId}))))}updateSort(e,t){this._sortField=e,this._sortDir=t}resetSort(){this._sortField=void 0,this._sortDir=void 0}getRequestedOrdersByState(e,t,n,r,a){let l=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/orderStatus/${t}?pageSize=${r}&pageNumber=${n-1}&filter=${a}`,m=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/orderStatus/${e}/${t}?pageSize=${r}&pageNumber=${n-1}&filter=${a}`,b;switch(t){case at.shoppingCart:case at.rejected:b=m;break;case at.requested:b=this._authService.userHasPermission(se.ORDERED_PANEL)||this._authService.userHasPermission(se.READ_ORDERS)?l:m;break;case at.released:b=this._authService.userHasPermission(se.RELEASE_ORDER_MANAGER)||this._authService.userHasPermission(se.READ_ORDERS)?l:m;break;case at.ordered:b=this._authService.userHasPermission(se.ORDERED_PANEL)||this._authService.userHasPermission(se.READ_ORDERS)?l:m;break;case at.delivered:b=this._authService.userHasPermission(se.DELIVERED_PANEL)||this._authService.userHasPermission(se.READ_ORDERS)?l:m;break}return this._sortField&&this._sortDir&&(b=ai.setSearchUrlSort(b,this._sortField,this._sortDir)),this._httpClient.get(b).pipe(S(T=>T||[]),k(()=>M([])))}changeDataset(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/changedocument`;return this._httpClient.put(t,e,{observe:"response"})}updateOrders(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order`,n=e.map(r=>this.convertOrderModelToOrderDto(r));return this._httpClient.put(t,n,{observe:"response"}).pipe(V(r=>{if(r.status===ge.OK){let l=this._orders.getValue().reduce((m,b)=>{let T=e.find(O=>O.id===b.id);return T?(T.requestName=b.requestName,T.orderedName=b.orderedName,T.deliveredName=b.deliveredName,T.documentType=Array.isArray(b.documentType)?b.documentType.join(","):b.documentType,b.status!==T.status?this.updateOrderCount(b,T.status):m.push(T)):m.push(b),m},[]);l=l.map(m=>(m.issuingBody=m.publishing,m.titleDe=m.title,m.priceUndetermNote=m.priceMetadata,m)),this._orders.next(l)}}))}requestCsvExport(e){e=e.replace("-","");let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/csv/${e}`;return this._httpClient.post(t,null,{observe:"response",responseType:"text"})}deleteOrderRequest(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/${e}`;return this._httpClient.delete(t,{observe:"response"}).pipe(V(n=>{if(n.status===ge.NO_CONTENT){let a=this._orders.getValue().find(b=>b.id===e),l=this._orderCountSummary.getValue(),m=this._stateToOrderCountMap.get(a.status);l[m]-=1,this._orderCountSummary.next(l),this.filterOrders(e)}}))}checkOrderExists(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/alreadyExists`;return this._httpClient.post(t,e)}updateReleaseLevelEnabled(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}
2/tenants/ordermanagement/releaselevel/${e}`;return this._httpClient.post(t,null)}getOrderUser(e){return this._httpClient.get(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/order/user/${e}`)}convertOrderDtoToOrderModel(e){let t=Array.isArray(e.documentType)?e.documentType:e.documentType.split(","),n=en.isDraftDocument(t),r=e.acCode?.startsWith("CS")??!1,a=e.documentType.split(",");return ve(K({},e),{documentType:a,isDraft:n,isCompanyData:r})}convertOrderModelToOrderDto(e){let m=e,{isDraft:t,documentType:n,isCompanyData:r}=m,a=jr(m,["isDraft","documentType","isCompanyData"]);return ve(K({},a),{documentType:Array.isArray(n)?n.join(","):n})}filterOrders(e){let n=this._orders.getValue().filter(r=>r.id!==e);this._orders.next(n)}updateOrderCount(e,t){let n=this._orderCountSummary.getValue(),r=this._stateToOrderCountMap.get(e.status),a=this._stateToOrderCountMap.get(t);n[r]-=1,n[a]+=1,this._orderCountSummary.next(n)}buildOrderStateToOrderCountMap(){this._stateToOrderCountMap.set(at.shoppingCart,"shoppingCartCount").set(at.rejected,"shoppingCartCount").set(at.requested,"requestedCount").set(at.released,"releasedCount").set(at.ordered,"orderedCount").set(at.delivered,"deliveredCount")}mapOrderRequestModelToDto(e){return ve(K({},e),{isSelected:!0,title:null,updateFlag:null})}mapCompanyStandardModelToDto(e){return ve(K({},e),{countryCode:null,acCode:null,editor:null,priceMetadata:null,priceWebShop:null,status:null,subscriptionNumber:null,valid:!0,updateFlag:null})}getOrderCountKey(e){switch(e){case"shoppingcart":return"shoppingCartCount";case"requested":return"requestedCount";case"released":return"releasedCount";case"ordered":return"orderedCount";case"delivered":return"deliveredCount";default:return""}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Vt=(function(i){return i.ADMIN="Admin",i.EDITOR="Editor",i.ORDER_MANAGER="OrderManager",i.READONLY="ReadOnly",i.READ_AND_REQUEST="ReadAndRequest",i.STANDARD="Standard",i})(Vt||{});var gi=(()=>{class i{constructor(){this._httpClient=g(Fe),this._authService=g(ue),this._configService=g(Se),this._tenant=new oe(null),this.tenant$=this._tenant.asObservable(),this._userRoles=Vt}getTenantData(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/tenants/${e}`;return this._httpClient.get(t).pipe(k(()=>M(null)),We(n=>!!n),S(n=>{let r=this.convertTenantResponseDtoToTenantModel(n);return this._tenant.next(r),r}))}hasReqIFModuleAndAdminAccess(e){let t=this._authService.userHasOnePermission([this._userRoles.ADMIN]);return this.hasModuleAccessWithBvNumberForTenant(e,"31840").pipe(S(n=>n&&t))}isNautosProActive(){return this._tenant?.value?.software?.some(e=>e.bvNumber==="30265")}isTenantSoftwareLoaded(){return this._tenant?.value?.software!==void 0}clearTenantData(){this._tenant.next(void 0)}updateIsOrderManagementEnabled(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}
2/tenants/ordermanagement/enabled/${e}`,n=this._tenant.value;return n.isOrderManagementEnabled=e,this._tenant.next(n),this._httpClient.put(t,e)}hasModuleAccessWithBvNumberForTenant(e,t){return this.getTenantData(e).pipe(S(n=>n.modules.find(r=>r.bvNumber===t)!==void 0))}convertTenantResponseDtoToTenantModel(e){let n=e.nautosConfiguration?.software.find(a=>!!a.configuration.endDate)??"";return{id:e.tenantId,tenantKey:e.tenantKey,customerId:e.customerId,customerNumber:e.customerNumber,customerName:e.name,customerEndDate:n,contactPersonId:e.contactPersonId,contactPersonNumber:e.contactPersonNumber,contactPerson:{forename:e.foreName||"",surname:e.surName||""},address:{street:"",zipCode:"",city:"",country:""},endDate:n,email:e.eMail,software:this.extractConfiguration(e.nautosConfiguration?.software),modules:this.extractConfiguration(e.nautosConfiguration?.softwareModul),metadata:this.extractConfiguration(e.nautosConfiguration?.dataFields),licenses:this.extractConfiguration(e.nautosConfiguration?.metadata),subscriptionNumbersNautos:e.nautosSub?.map(a=>a.sub.aboBlock),subscriptionNumbersNormTicker:e.subscriptionNumbers,isSsoAllowed:e.isSsoAllowed,metadataWidth:e.metadataWidth,sendPurchaseHistory:e.sendPurchaseHistory,sendBestCollection:e.sendBestCollection,sendStandardTicker:e.sendStandardTicker,isOrderManagementEnabled:e.isOrderManagementEnabled,isOrderReleaseEnabled:e.isOrderManagementReleaseLevelEnabled,subCustomerNumbers:e.subCustomerNumbers}}extractConfiguration(e){let t=[];if(!Array.isArray(e))return[];for(let n of e){let r=n.configuration;Object.hasOwn(r,"bvNummer")&&(r.bvNumber=r.bvNummer,delete r.bvNummer),t.push(r)}return t}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var si=class{static getDateFormatRegExYearMonthDay(){return/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|1\d|2\d|3[01])$/}static getDateFormatRegExYearMonth(){return/^\d{4}-(0[1-9]|1[0-2])$/}static isoToLocalDate(o){let e=new Date(o);return isNaN(e.getTime())?"":e.toLocaleDateString()}static fillWithPatternOrTruncateLeft(o,e,t){let n="0";if(t&&(n=t),e>0){let r,a;if(e-o.length>=0){r=e-o.length;let l="";for(let m=0;m<r&&l.length<r;m++)for(let b=0;b<n.length&&l.length<r;b++)l+=n[b];return l+o}else return a=-(e-o.length),o.slice(a)}return""}static getMonthsWithTranslation(o){return[{text:o.january,value:1},{text:o.february,value:2},{text:o.march,value:3},{text:o.april,value:4},{text:o.may,value:5},{text:o.june,value:6},{text:o.july,value:7},{text:o.august,value:8},{text:o.september,value:9},{text:o.october,value:10},{text:o.november,value:11},{text:o.december,value:12}]}static convertStringToDate(o){let t=new Date().getTimezoneOffset()/60,n=new Date(Date.parse(o));return n.setHours(n.getHours()+t),n}static getDateFormatted(o){let e=this.getFullMonth(o.getMonth()+1);return`${o.getFullYear()}-${e}`}static getDateFormattedWithDay(o){let e=this.getFullMonth(o.getMonth()+1),t=o.getFullYear(),n=this.getFullDay(o.getDate());return`${t}-${e}-${n}`}static getDaysInMonth(o,e){return new Date(e,o,0).getDate()}static getYearString(o){let e=o.getUTCFullYear(),t=(o.getUTCMonth()+1).toString().padStart(2,"0"),n=o.getUTCDate().toString().padStart(2,"0");return`${e}-${t}-${n}`}static getFullMonth(o){return o.toString().padStart(2,"0")}static getFullDay(o){return o<10?`0${o}`:`${o}`}};var Qn=(()=>{class i{constructor(){this._httpClient=g(Fe),this._configService=g(Se),this._itemDetailModelSubject=new oe(null)}convertToFullDetailItemModel(e){let t=this.addTargetToLinks(e.issuing),n=this.addTargetToLinks(e.author),r=i.getFlagStatus(e);return{abstractDe:e.abstractDe,abstractEn:e.abstractEn,abstractFr:e.abstractFr,abstractUnd:e.abstractUnd,admPerinormSortkey:e.admPerinormSortkey,admSectional:e.admSectional,admSortKey:e.admSortKey,amendedBy:e.amendedBy,amends:e.amends,appearance:e.appearance,author:n.join(", "),ceInfo:e.ceInfo,citation:e.citations,classificationIcs:e.classificationIcs,classificationOther:e.classificationOther,confirmation:e.confirmation,countryCode:e.countryCode?.split(",").join(", "),customFields:e.customFields,dateOfIssue:e.dateOfIssue,descriptorDe:e.descriptorDe,descriptorEn:e.descriptorEn,descriptorFr:e.descriptorFr,descriptorUnd:e.descriptorUnd,documentNumber:e.documentNumber,documentType:e.documentType,documents:e.documents,draftSuperseded:e.draftSuperseded,effective:e.effective,expiration:e.expiration,flagStatus:r,fullTextDocument:e.fullTextDocument,fulltextAddress:e.fulltextAddress,fulltextId:e.fulltextId,fulltextPages:e.documents?.map(l=>l.fulltextPages).filter(l=>l!==0).join(", "),hasFavorites:e.hasFavorites,id:e.id,internationalRelationship:{identical:e.referenceIdentical,modified:e.referenceModified,necessary:e.referenceNecessary,notEquivalent:e.referenceNotEquivalent,useful:e.referenceUseful},isCeDirective:e.isCeDirective,isDraft:en.isDraftDocument(e.documentType),isHarmonized:e.isHarmonized,isMandated:e.isMandated,isOwnStandard:e.isOwnStandard,issuing:t.
2join(", "),linkCertification:e.linkCertification,linkHandbook:e.linkHandbook,linkLegislation:e.linkLegislation,linkPublished:e.linkPublished,noteDe:e.noteDe,noteEn:e.noteEn,noteFr:e.noteFr,noteUnd:e.noteUnd,notes:e.notes,originalLanguage:e.originalLanguage.join(", "),overviewUnd:e.overviewUnd,pdfDeVt:e.pdfDeVt,pdfEnVt:e.pdfEnVt,pdfFrVt:e.pdfFrVt,pdfVt:e.pdfVt,priceUndetermNote:e.priceUndetermNote,productId:e.productId,publishing:e.publishing,refDocNrSpecial:e.refDocNrSpecial,replacedBy:e.replacedBy,replaces:e.replaces,tenantId:e.tenantId,titleDe:e.titleDe,titleEn:e.titleEn,titleFr:e.titleFr,titleUnd:e.titleUnd,transition:e.transition,translations:e.translations,valid:e.valid,version:e.version,withdrawal:e.withdrawal,qualityXml:e.qualityXml,reqIfConvertible:e.reqIfConvertible,documentTypePro:e.documentTypePro,updatePro:e.updatePro,monitoringStatus:e.monitoringStatus,ruleSetPro:e.ruleSetPro,createdBy:e.createdBy,createdAt:e.createdAt,modifiedAt:e.modifiedAt,classificationPro:e.classificationPro,info:e.info,isCited:e.isCited,regionalValidity:e.regionalValidity,pricePro:e.pricePro,publisherPro:e.publisherPro,sourcePro:e.sourcePro,certifiedBy:e.certifiedBy,certifiedDate:e.certifiedDate,releaseLevel:e.releaseLevel,releaseComment:e.releaseComment,changeDescription:e.changeDescription,revisionVersion:e.revisionVersion,reminderDate:e.reminderDate,documentOwners:e.documentOwners,lastReview:e.lastReview,updateInterval:e.updateInterval}}searchFullDetailItem(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/detail/${e}`;return this._httpClient.get(t).pipe(S(n=>this.convertToFullDetailItemModel(n)),V(n=>{this._itemDetailModelSubject.next(n)}),k(()=>M(null)))}fetchProMetadataFields(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/metadata/prometadata/${e}`;return this._httpClient.get(t).pipe(S(n=>this.convertToProMetadataFieldsModel(n)),k(n=>(console.error(n),M(null))))}addTargetToLinks(e){return e.map(t=>t.includes("target=")?t:t.replace("<a",'<a target="_blank"'))}convertToProMetadataFieldsModel(e){return e?{certifiedDate:this.getDateContent(e.certifiedDate),certifiedBy:this.getStringContent(e.certifiedBy),classificationPro:this.getStringContent(e.classificationPro),changeDescription:this.getStringContent(e.changeDescription),createdAt:this.getDateContent(e.createdAt),createdBy:this.mapUserObject(e.createdBy),documentOwners:this.mapUserObjects(e.documentOwners),documentTypePro:this.getStringContent(e.documentTypePro),info:this.getStringContent(e.info),isCited:this.getStandardRelationModelFromDto(e.isCited),lastReview:this.getDateContent(e.lastReview),modifiedAt:this.getDateContent(e.modifiedAt),modifiedBy:this.mergeUserObjects(e.modifiedBy),monitoringStatus:this.getStringContent(e.monitoringStatus),pricePro:this.getStringContent(e.pricePro),publisherPro:this.getStringContent(e.publisherPro),regionalValidity:this.getStringContent(e.regionalValidity),releaseComment:this.getStringContent(e.releaseComment),releaseLevel:this.getStringContent(e.releaseLevel),reminderDate:this.getDateContent(e.reminderDate),revisionVersion:this.getStringContent(e.revisionVersion),ruleSetPro:this.getStringContent(e.ruleSetPro),sourcePro:this.getStringContent(e.sourcePro),updateInterval:e.updateInterval??"",updatePro:this.getStringContent(e.updatePro)}:null}static getFlagStatus(e){return[{key:"flagAmendment",shortKey:"A"},{key:"flagAmendmentWeekly",shortKey:"A(V)"},{key:"flagChanged",shortKey:"C"},{key:"flagDeleted",shortKey:"D"},{key:"flagHistorical",shortKey:"H"},{key:"flagIntendedWithdrawal",shortKey:"I"},{key:"flagModified",shortKey:"M"},{key:"flagNew",shortKey:"N"},{key:"flagNewWeekly",shortKey:"N(V)"},{key:"flagPartiallyReplaced",shortKey:"P"},{key:"flagPartiallyReplacedWeekly",shortKey:"P(V)"},{key:"flagReinstated",shortKey:"R"},{key:"flagReinstatedWeekly",shortKey:"R(V)"},{key:"flagStatusChanged",shortKey:"S"},{key:"flagUnchanged",shortKey:"U"},{key:"flagWithdrawn",shortKey:"W"},{key:"flagWithdrawnWeekly",shortKey:"W(VZ)"}].filter(({key:r})=>e[r]).map(({key:r,shortKey:a})=>K({shortKey:a},r==="flagChanged"&&e.flagCNote?{childKeyList:e.flagCNote}:{}))}getStringContent(e){return e??""}getDateContent(e){return e?si.getDateFormattedWithDay(new Date(e)):""}mapUserObject(e){return e?{userGuid:e.id,userName:this.buildUserName(e)}:null}mapUserObjects(e){return e?.length?e.map(t=>this.mapUserObject(t)).filter(t=>!!t):[]}buildUserName(e){return`${e.lastname}, ${e.forename} (${e.username})`}mergeUserObjects(e){return!e||e.length===0?null:ve(K({},e[0]),{userName:e.map(t=>`${t.lastname}, ${t.forename} (${t.username})`).join("; ")})}getStandardRelationModelFromDto(e){let t=[];return e&&e.forEach(n=>{let r={id:n.id,internationalRelationType:n.internationalRelationType,isHyperlink:n.isHyperlink,relation:n.relation};t.push(r)}),t}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var gn=class{constructor(o){this.resultListConfigurationId=o.id,this.name=o.name,this.layout=o.layout,this.itemsPerPage=o.perPage,this.fieldAreas=[];let e=0;
2for(let t of o.fields)this.fieldAreas.push({fieldName:this.valueToString(Bt.firstCharToLower(t.key)),label:this.valueToString(t.label),template:this.valueToString(this.getTemplateByKey(t)),fieldAreaOrder:e,styles:this.valueToString(t.styles)}),e++;this.iconAreas=[];for(let t of o.icons)this.iconAreas.push({areaName:t.key,className:t.className,visible:t.visible});this.isTenantTemplate=o.isTenantTemplate}valueToString(o){return o??""}getTemplateByKey(o){switch(o.key){case"status":return"status";case"valid":return"valid";case"ceInfo":return"ceInfo";case"document":return"document";case"title":return"title";default:return""}}};var Zn=(function(i){return i.TABLE="table",i.TEXT="text",i})(Zn||{});var Rt=[{id:"documentTypePro",type:"text"},{id:"updatePro",type:"text"},{id:"monitoringStatus",type:"select"},{id:"ruleSetPro",type:"text"},{id:"createdBy",type:"chipInput"},{id:"createdAt",type:"text"},{id:"modifiedBy",type:"chipInput"},{id:"modifiedAt",type:"text"},{id:"classificationPro",type:"valueList"},{id:"info",type:"text"},{id:"isCited",type:"text"},{id:"regionalValidity",type:"text"},{id:"pricePro",type:"text"},{id:"publisherPro",type:"text"},{id:"sourcePro",type:"text"},{id:"certifiedBy",type:"text"},{id:"certifiedDate",type:"text"},{id:"releaseLevel",type:"select"},{id:"releaseComment",type:"text"},{id:"changeDescription",type:"text"},{id:"revisionVersion",type:"text"},{id:"reminderDate",type:"text"},{id:"documentOwners",type:"chipInput"},{id:"lastReview",type:"text"},{id:"updateInterval",type:"text"}];var Jn=(()=>{class i{static{this._blacklistedFields=["reqIfConvertible","favoritesFolders","notesFolders"]}constructor(){this._searchConfig=g(hi),this._authService=g(ue),this._configService=g(Se),this._httpClient=g(Fe),this._metadataFieldsService=g(Ut),this._translocoService=g(ae),this._presetCollectionSubject=ne
2w oe(null),this._currentPresetSubject=new oe(null),this._defaultPresetSubject=new oe(null),this._tenantWidePresetSubject=new oe(null),this._fullPresetSubject=new oe(null),this._allAvailableFieldsSubject=new oe([]),this.presetCollection$=this._presetCollectionSubject.asObservable(),this.currentPreset$=this._currentPresetSubject.asObservable(),this.defaultPreset$=this._defaultPresetSubject.asObservable(),this.tenantWidePreset$=this._tenantWidePresetSubject.asObservable(),this.fullPreset$=this._fullPresetSubject.asObservable(),this.allAvailableFields$=this._allAvailableFieldsSubject.asObservable(),this._userAuthInfoSubscription&&this._userAuthInfoSubscription.unsubscribe(),this._tenantInfoSubscription&&this._tenantInfoSubscription.unsubscribe(),this._userAuthInfoSubscription=this._authService.userInfo$.subscribe({next:e=>{e&&(this.currentUserInfo=e)}}),this._metadataFieldsService.getMetadataList().subscribe(e=>{e&&(this._metadataFieldsAvailable=Array.from(e.keys()))})}ngOnDestroy(){this._userAuthInfoSubscription&&this._userAuthInfoSubscription.unsubscribe(),this._deletePresetSubscription&&this._deletePresetSubscription.unsubscribe(),this._deletePresetAtBackendSubscription&&this._deletePresetAtBackendSubscription.unsubscribe(),this._getDefaultSubscription&&this._getDefaultSubscription.unsubscribe(),this._refreshDefaultPresetSubscription&&this._refreshDefaultPresetSubscription.unsubscribe(),this._setCurrentSubscription&&this._setCurrentSubscription.unsubscribe(),this._setCurrentPresetSubscription&&this._setCurrentPresetSubscription.unsubscribe(),this._currentPresetSubscription&&this._currentPresetSubscription.unsubscribe(),this._getPresetCollectionSubscription&&this._getPresetCollectionSubscription.unsubscribe(),this._refreshPresetCollectionSubscription&&this._refreshPresetCollectionSubscription.unsubscribe(),this._refreshAllAvailableFieldsSubscription&&this._refreshAllAvailableFieldsSubscription.unsubscribe(),this._saveNewPresetSubscription&&this._saveNewPresetSubscription.unsubscribe()}refreshAllValuesFromBackend(){this.refreshPresetCollectionFromBackendServices(),this.refreshAllAvailableFieldsFromBackendServices()}setCurrentPreset(e){this._setCurrentPresetSubscription&&this._setCurrentPresetSubscription.unsubscribe(),this._setCurrentPresetSubscription=this.setCurrentPresetAtBackendServices(e).subscribe(),this._currentPresetSubject.next(e)}deletePreset(e){this._deletePresetSubscription&&this._deletePresetSubscription.unsubscribe(),this._deletePresetSubscription=this.deletePresetAtBackendServices(e).subscribe({next:t=>{if(t===!0){let n=re.clone(this._presetCollectionSubject.getValue());n=n.filter(r=>r.id!==e.id),this._presetCollectionSubject.next(n),e.isTenantTemplate&&this._tenantWidePresetSubject.next(null)}}})}saveNewPreset(e){return new He(t=>{let n=re.clone(e),r=new gn(n);delete r.resultListConfigurationId,this._saveNewPresetSubscription&&this._saveNewPresetSubscription.unsubscribe(),this._saveNewPresetSubscription=this.saveNewPresetAtBackendServices(r).subscribe({next:a=>{if(ne.isAccepted(a.status)){if(a.body&&Object.hasOwn(a.body,"id")){let l=re.clone(e);l.id=a.body.id;let m=re.clone(this._presetCollectionSubject.getValue());m.push(l),this._presetCollectionSubject.next(m),t.next({result:!0,id:a.body.id})}}else t.next({result:!1,id:e.id}),console.error(a),t.error(a)},error:a=>{t.error(a)}})})}saveAndOverwritePreset(e){return new He(t=>{this.saveOverwritePresetAtBackendServices(new gn(e)).subscribe({next:n=>{if(n===!0){let r=re.clone(this._presetCollectionSubject.getValue()),a=re.clone(e);for(let l=0;l<r.length;l++)r[l].id===e.id&&(r[l]=a);if(this.setCurrentPreset(a),a.isTenantTemplate){let l=r.find(m=>m.id!==a.id&&m.isTenantTemplate);l&&(l.isTenantTemplate=!1),this._tenantWidePresetSubject.next(a)}else this._tenantWidePresetSubject.next(null);this._presetCollectionSubject.next(r),t.next(!0)}else t.next(!1)},error:n=>{t.error(n)}})})}convertToListPresetArray(e){let t=[];for(let n of e){let r=this.convertResultListConfigurationModelToListPreset(n);t.push(r)}return t}refreshAllAvailableFieldsFromBackendServices(){this._refreshAllAvailableFieldsSubscription&&this._refreshAllAvailableFieldsSubscription.unsubscribe(),this._refreshAllAvailableFieldsSubscription=this.getAvailableConfigurationFields().subscribe({next:e=>{e&&this._allAvailableFieldsSubject.next(e)}})}refreshPresetCollectionFromBackendServices(){this._refreshPresetCollectionSubscription&&this._refreshPresetCollectionSubscription.unsubscribe(),this._refreshPresetCollectionSubscription=this.getPresetsForUserFromBackendServices().subscribe({next:e=>{if(e){let t=e.fullView,n=e.default,r=e.tenantWide,a=e.current??e.default,l=e.resultListConfigurations??[];if(!a)throw new Error("no configuration found");t&&(t.name="search.full_view_template",t=this.filterMetadataByMetadataWidth(t),t=this.sortFieldsByDefaultConfiguration(t,n)),a=this.filterMetadataByMetadataWidth(a),r&&(r=this.filterMetadataByMetadataWidth(r),this._tenantWidePresetSubject.next(this.convertResultListConfigurationModelToListPreset(r))),n&&(n=this.filterMetadataByMetadataWidth(n)),this._presetCollectionSubject.next(this.convertToListPresetArray(l.filter(m=>m!=null))),this._currentPresetSubject.next(this.convertResultListConfigurationModelToListPreset(a)),this._defaultPresetSubject.next(this.convertResultListConfigurationModelToListPreset(n)),this._fullPresetSubject.next(this.convertResultListConfigurationModelToListPreset(t))}},error:()=>{}})}getPresetsForUserFromBackendServices(){return new He(e=>{let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/configuration/searchresultlist/user";this._getPresetCollectionSubscription&&this._getPresetCollectionSubscription.unsubscribe(),this._getPresetCollectionSubscription=this._httpClient.get(t,{observe:"response"}).subscribe({next:n=>{ne.isAccepted(n.status)?e.next(n.body):e.error(n)},error:n=>{e.error(n)}})})}sortFieldsByDefaultConfiguration(e,t){let n=K({},e);if(!t||!e.fieldAreas)return n;let r=new Set(t.fieldAreas.map(ee=>ee.fieldName)),a=t.fieldAreas,l=e.fieldAreas.filter(ee=>!r.has(ee.fieldName)),m=new Set(Rt.map(ee=>ee.id.toLowerCase())),[b,T]=l.reduce(([ee,N],Ce)=>((m.has(Ce.fieldName.toLowerCase())?ee:N).push(Ce),[ee,N]),[[],[]]),O=[...a,...T].reduce((ee,N)=>(this._translocoService.selectTranslate("common.metadata_label."+N.fieldName).subscribe(Ce=>{ee[N.fieldName]=Ce}),ee),{}),U=b.reduce((ee,N)=>{let Ce=Ht.getCorrectLabel(N.fieldName);return this._translocoService.selectTranslate("common.metadata_label.pro_metadata."+Ce).subscribe(ut
2=>{ee[N.fieldName]=ut}),ee},{}),H=[...T];H.sort((ee,N)=>{let Ce=O[ee.fieldName]||ee.fieldName,ut=O[N.fieldName]||N.fieldName;return Ce.localeCompare(ut)});let Z=[...b];return Z.sort((ee,N)=>{let Ce=U[ee.fieldName]||ee.fieldName,ut=U[N.fieldName]||N.fieldName;return Ce.localeCompare(ut)}),n.fieldAreas=[...a,...H,...Z].map((ee,N)=>ve(K({},ee),{fieldAreaOrder:N})),n}filterMetadataByMetadataWidth(e){if(!e?.fieldAreas)return e;let t=new Set(i._blacklistedFields.map(r=>r.toLowerCase())),n=new Set(this._metadataFieldsAvailable.map(r=>r.toLowerCase()));return e.fieldAreas=e.fieldAreas.filter(r=>{let a=r.fieldName.toLowerCase();return a==="custom_field"&&(r.fieldName=a),a==="admsortkey"&&(r.fieldName="admSortKey"),n.has(a)&&!t.has(a)}),e}setCurrentPresetAtBackendServices(e){return new He(t=>{let n,r;if(e){if(Object.hasOwn(e,"name")&&(r=e.name,r.toLowerCase().includes("full_view_template")))return;if(Object.hasOwn(e,"id")?n=e.id:Object.hasOwn(e,"resultListConfigurationId")&&(n=e.resultListConfigurationId),n){let a={resultListConfigurationId:n},l=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/configuration/searchresultlist/current`;this._httpClient.put(l,a,{observe:"response"}).subscribe({next:m=>{m?.status&&ne.isAccepted(m.status)?t.next(!0):(t.next(!1),t.error(m))},error:m=>{t.error(m)}})}}})}saveNewPresetAtBackendServices(e){return new He(t=>{let n=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/configuration/searchresultlist/"+this.currentUserInfo.userAccountId;this._httpClient.post(n,e,{observe:"response"}).subscribe({next:r=>{ne.isAccepted(r.status)?t.next(r):t.error(r)},error:r=>{t.error(r)}})})}saveOverwritePresetAtBackendServices(e){return new He(t=>{let n=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/configuration/searchresultlist/"+this.currentUserInfo.userAccountId;this._httpClient.put(n,e,{observe:"response"}).subscribe({next:r=>{ne.isAccepted(r.status)?t.next(!0):(t.next(!1),t.error(r))},error:r=>{t.error(r)}})})}getAvailableConfigurationFields(){let e=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/configuration/searchresultlist";return new He(t=>{this._httpClient.get(e,{observe:"response"}).subscribe({next:n=>{ne.isAccepted(n.status)?t.next(n.body):t.error(n)},error:n=>{t.error(n)}})})}deletePresetAtBackendServices(e){let t;Object.hasOwn(e,"id")?t=e.id:Object.hasOwn(e,"resultListConfigurationId")&&(t=e.resultListConfigurationId);let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/configuration/searchresultlist/${t}`;return new He(r=>{this._deletePresetAtBackendSubscription?.unsubscribe(),this._deletePresetAtBackendSubscription=this._httpClient.delete(n,{observe:"response"}).subscribe({next:a=>{a?.status&&ne.isAccepted(a.status)&&r.next(!0)},error:a=>{r.error(a)}})})}convertResultListConfigurationModelToListPreset(e){if(e==null)return null;let t=e.fieldAreas.map(a=>({key:Object.hasOwn(this._searchConfig.mapFieldKeys,a.fieldName)?this._searchConfig.mapFieldKeys[a.fieldName]:a.fieldName,label:Object.hasOwn(this._searchConfig.mapFieldKeys,a.label)?this._searchConfig.mapFieldKeys[a.label]:a.label,template:a.template,ordinal:a.fieldAreaOrder,styles:a.styles})),n=e.iconAreas.map(a=>({key:a.areaName,label:"",className:a.className,visible:a.visible}));return{id:e.id,name:e.name,userAccountId:e.userAccountId,layout:e.layout==="table"?Zn.TABLE:Zn.TEXT,perPage:e.itemsPerPage>=25?e.itemsPerPage:25,fields:t,icons:n,isTenantTemplate:e.isTenantTemplate,isDefaultTemplate:this.isDefaultLayout(e.name)}}isDefaultLayout(e){return e==="Standard view"||e==="Vue standard"||e==="Standardansicht"||e==="Default-Format"}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ii=(function(i){return i.LEFT="LEFT",i.CENTER="CENTER",i.RIGHT="RIGHT",i})(Ii||{});
2var Ci=(()=>{class i{constructor(){this._httpClient=g(Fe),this._configService=g(Se),this._metadataFieldsService=g(Ut),this.currentFormat$=new oe(null),this.tenantFormat$=new oe(null),this.defaultFormat$=new oe(null),this.generalFormats$=new oe(null),this.getMetadataBandwidthFields().subscribe(e=>{e&&this.loadMiniDetailFormats()})}setCurrentFormat(e){let t=e.id.replace("_tw",""),n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/configuration/minidetaildisplay/${t}/current`;return this._httpClient.put(n,{},{observe:"response"}).pipe(We(r=>r.ok),V(()=>{this.currentFormat$.next(e)}),S(()=>!0),k(()=>M(!1)))}resetCurrentFormat(){return this.setCurrentFormat(this.defaultFormat$.getValue())}createFormat(e,t){let n=K(K({},e),t),r=this.miniDetailDisplayLayoutModelToMiniDetailDisplayRequestDto(n);r&&delete r.miniDetailDisplayId;let a=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/configuration/minidetaildisplay`;return this._httpClient.post(a,r).pipe(S(l=>{if(l){let m=ve(K({},n),{id:l.id}),b=this.generalFormats$.getValue();return b.push(m),this.generalFormats$.next(b),this.currentFormat$.next(m),m}}),k(()=>xe))}updateFormat(e,t){let n=K(K({},e),t),r=this.miniDetailDisplayLayoutModelToMiniDetailDisplayRequestDto(n),a=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/configuration/minidetaildisplay`,l=n.id.endsWith("_tw")??n.isTenantWide;return this._httpClient.put(a,r,{observe:"response"}).pipe(S(m=>{if(ne.isAccepted(m.status)){if(this.tenantFormat$?.getValue()?.id===n.id&&!n.isTenantTemplate&&this.tenantFormat$.next(null),this.currentFormat$.next(n),n.isTenantWide)n.id+="_tw",this.tenantFormat$.next(n);else if(l){let T=this.tenantFormat$?.getValue();T.isTenantWide=!1,n.isTenantTemplate=!1,this.tenantFormat$.next(null)}let b=this.generalFormats$.getValue();b.forEach(T=>T.id===e.id?e:T),this.generalFormats$.next(b)}return n}),k(()=>M()))}deleteFormat(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/configuration/minidetaildisplay/${e.id}`;return this._httpClient.delete(t,{observe:"response"}).pipe(We(n=>n.ok),S(()=>{e.id=e.id.replace("_tw","");let n=this.generalFormats$.getValue().filter(r=>e.id!==r?.id);return this.generalFormats$.next(n),e.id===this.tenantFormat$.getValue()?.id?.replace("_tw","")&&this.tenantFormat$.next(null),e.id===this.currentFormat$.getValue().id.replace("_tw","")&&this.resetCurrentFormat().subscribe(),!0}))}loadMiniDetailFormats(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/configuration/minidetaildisplay`,t;this._httpClient.get(e).pipe(k(()=>[])).subscribe(n=>{let r=this.miniDetailDisplayResponseDtoToMiniDetailDisplayLayoutModel(n.current);n.tenantWide&&(t=this.miniDetailDisplayResponseDtoToMiniDetailDisplayLayoutModel(n.tenantWide),t.id===r.id&&(r.id=r.id+"_tw"),t.id=t.id+"_tw");let a=this.miniDetailDisplayResponseDtoToMiniDetailDisplayLayoutModel(n.default),l=n.miniDetailDisplays.filter(m=>m).map(m=>this.filterMetadataBandwidthFields(this.miniDetailDisplayResponseDtoToMiniDetailDisplayLayoutModel(m)));this.defaultFieldKeys=this.filterMetadataBandwidthFields(a).fields.map(m=>m.fieldName),this.generalFormats$.next(l),this.currentFormat$.next(this.filterMetadataBandwidthFields(r)),this.defaultFormat$.next(this.filterMetadataBandwidthFields(a)),t&&this.tenantFormat$.next(this.filterMetadataBandwidthFields(t))})}getMetadataBandwidthFields(){return this._metadataFieldsService.getMetadataList().pipe(S(e=>(e&&(this._allMetadataFieldsAvailable=Array.from(e.keys())),!!e)))}filterMetadataBandwidthFields(e){let t=e?.fields?.filter(r=>this._allMetadataFieldsAvailable.includes(r.fieldName))||[];return ve(K({},e),{fields:t})}miniDetailDisplayResponseDtoToMiniDetailDisplayLayoutModel(e){return{id:e.id,fields:e.fieldColumns,isTenantWide:e.isTenantTemplate??!1,name:e.name,userAccountId:e.userAccountId,tenantId:e.tenantId,isUserDefault:e.isUserDefault}}miniDetailDisplayLayoutModelToMiniDetailDisplayRequestDto(e){let{id:t,name:n,isTenantWide:r,fields:a}=e;return{miniDetailDisplayId:t,name:n,isTenantTemplate:r,leftColumnFields:this.mapFieldsByPosition(a,Ii.LEFT),right
2ColumnFields:this.mapFieldsByPosition(a,Ii.RIGHT),centerColumnFields:this.mapFieldsByPosition(a,Ii.CENTER)}}mapFieldsByPosition(e,t){return e.filter(n=>n.fieldPosition===t).map(n=>n.fieldName)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var jt=(function(i){return i[i.NONE=0]="NONE",i[i.CONVERTIBLE=1]="CONVERTIBLE",i[i.NOT_LICENSED=2]="NOT_LICENSED",i[i.NOT_BOUGHT=3]="NOT_BOUGHT",i[i.NOT_CONVERTIBLE=4]="NOT_CONVERTIBLE",i[i.NOT_FOUND=5]="NOT_FOUND",i})(jt||{});function cc(i,o){if(i&1&&(c(0,"span",9),v(1),d()),i&2){let e=p(2);s(),F(" ",e.getMissingDocumentCountMessage())}}function dc(i,o){if(i&1&&(c(0,"span",9),v(1),d()),i&2){let e=p(2);s(),F(" ",e.getUnconvertibleCountMessage())}}function pc(i,o){if(i&1&&(c(0,"span",9),v(1),d()),i&2){let e=p(2);s(),D(e.getUnboughtCountMessage())}}function mc(i,o){if(i&1&&(c(0,"span",9),v(1),d()),i&2){let e=p(2);s(),D(e.getUnlicensedCountMessage())}}function uc(i,o){if(i&1&&(c(0,"span",9),v(1),d()),i&2){let e=p(2);s(),D(e.getLanguageErrorCountMessage())}}function _c(i,o){if(i&1&&(c(0,"div",2)(1,"div",6),y(2,"app-icon",7),c(3,"div",8),u(4,cc,2,1,"span",9),u(5,dc,2,1,"span",9),u(6,pc,2,1,"span",9),u(7,mc,2,1,"span",9),u(8,uc,2,1,"span",9),d()()()),i&2){let e=p();s(4),_(e.missingDocumentCount?4:-1),s(),_(e.unconvertibleCount?5:-1),s(),_(e.unboughtCount?6:-1),s(),_(e.unlicensedCount?7:-1),s(),_(e.isSecondaryModal?8:-1)}}function hc(i,o){if(i&1&&(c(0,"p",14)(1,"span"),v(2),d(),y(3,"app-icon",7),d()),i&2){let e=p().$implicit;s(2),D(e.errorMessage)}}function fc(i,o){if(i&1&&(c(0,"div",4)(1,"div")(2,"p",10)(3,"span",11),v(4),d(),c(5,"span",12),v(6),d()(),c(7,"span",13),v(8),d()(),u(9,hc,4,1,"p",14),d()),i&2){let e=o.$implicit,t=p();s(4),D(e.name),s(2),F("(",e.dateOfIssue,")"),s(2),D(e.language),s(),_(e.convertibilityType!==t.reqifConvertibilityType.CONVERTIBLE?9:-1)}}var rr=(()=>{class i{constructor(){this.modalService=g(he),this._translocoService=g(ae),this.reqifConvertibilityType=jt,this.convertibilityInfos=[],this.convertibleCount=0,this.missingDocumentCount=0,this.unconvertibleCount=0,this.unboughtCount=0,this.unlicensedCount=0,this.languageErrorCount=0,this.isSecondaryModal=!1}onSave(){this.modalService.close({convert:!0})}getMissingDocumentCountMessage(){return this._translocoService.translate("search.reqif.multi.conversion_document_missing_count",{count:this.missingDocumentCount})}getUnconvertibleCountMessage(){return this._translocoService.translate("search.reqif.multi.conversion_unconvertible_count",{count:this.unconvertibleCount})}getUnboughtCountMessage(){return this._translocoService.translate("search.reqif.multi.conversion_unbought_count",{count:this.unboughtCount})}getUnlicensedCountMessage(){return this._translocoService.translate("search.reqif.multi.conversion_unlicensed_count",{count:this.unlicensedCount})}getLanguageErrorCountMessage(){return this._translocoService.translate("search.reqif.multi.conversion_error_language",{count:this.languageErrorCount})}getConvertButtonLabel(){return this.convertibleCount>0?this._translocoService.translate("search.reqif.multi.conversion_button",{count:this.convertibleCount}):this._translocoService.translate("search.reqif.multi.conversion_button")}getCancelButtonLabel(){return this._translocoService.translate(`common.${this.isSecondaryModal?"close":"cancel"}`)}get shouldShowModal(){return!!(this.missingDocumentCount||this.unconvertibleCount||this.unboughtCount||this.unlicensedCount||this.isSecondaryModal)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-reqif-multi-conversion-modal"]],inputs:{convertibilityInfos:"convertibilityInfos",convertibleCount:"convertibleCount",missingDocumentCount:"missingDocumentCount",unconvertibleCount:"unconvertibleCount",unboughtCount:"unboughtCount",unlicensedCount:"unlicensedCount",languageErrorCount:"languageErrorCount",isSecondaryModal:"isSecondaryModal"},decls:7,vars:6,consts:[["modalTitle","search.reqif.multi.title",3,"border"],[1,"modal-body"],["data-cy","warningBox",1,"box-warning"],[1,"document-list"],[1,"document"],[3,"cancelButtonClick","saveButtonClick","isSaveButtonDisabled","saveButtonText","isSaveButtonVisible","cancelButtonText"],[1,"box-content"],["name","alert",1,"icon-warning"],[1,"box-description"],["data-cy","warningMessage"],[1,"text-bold"],["data-cy","documentNumber"],["data-cy","dateOfIssue"],["data-cy","language"],["data-cy","warningMessage",1,"warning"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),c(1,"div",1),u(2,_c,9,5,"div",2),c(3,"div",3),G(4,fc,10,4,"div",4,J),d()(),c(6,"app-modal-footer",5),x("cancelButtonClick",function(){return n.modalService.dismiss()})("saveButtonClick",function(){return n.onSave()}),d()),t&2&&(f("border",!0),s(2),_(n.shouldShowModal?2:-1),s(2),q(n.convertibilityInfos),s(2),f("isSaveButtonDisabled",n.convertibleCount<=0&&!n.isSecondaryModal)("saveButtonText",n.getConvertButtonLabel())("isSaveButtonVisible",!n.isSecondaryModal)("cancelButtonText",n.getCancelButtonLabel()))},dependencies:[j,Me,we],styles:[".document-list[_ngcontent-%COMP%]{border-top:var(--border);height:400px;overflow:hidden auto}.document-list[_ngcontent-%COMP%] .document[_ngcontent-%COMP%]{border-bottom:var(--border);display:flex;gap:var(--spacer);justify-content:space-between;padding-block:calc(var(--spacer) / 2);position:relative;width:100%}.document-list[_ngcontent-%COMP%] .document[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:2}.document-list[_ngcontent-%COMP%] .document[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{flex:3}.document-list[_ngcontent-%COMP%] .document[_ngcontent-%COMP%] .text-bold[_ngcontent-%COMP%]{display:flex;gap:calc(var(--spacer) / 4)}.document-list[_ngcontent-%COMP%] .document[_ngcontent-%COMP%] .warning[_ngcontent-%COMP%]{align-items:center;display:flex;gap:calc(var(--spacer) / 2)}.box-description[_ngcontent-%COMP%]{display:flex;flex-direction:column}"]})}}return i})();var is=(()=>{class i{constructor(){this._configService=g(Se),this._feedbackService=g(pt),this._httpClient=g(Fe),this._modalService=g(he),this._translocoService=g(ae),this._uiService=g(Ha)}openMultiConvertionModal(e){this._uiService.showSpinner();let t=e.map(n=>({acCode:n.acCode,din21Ids:n.documents.map(r=>r.din21Id)}));this.checkReqIfConvertibility(t).subscribe(n=>{let r=0,a=0,l=0,m=0,b=0,T,O="",U=[];e.forEach(Z=>{if(!Z.reqIfConvertible)l+=Math.max(Z.documents.length,1),U.push({name:Z.documentNumber,acCode:Z.acCode,dateOfIssue:Z.dateOfIssue,din21Id:null,language:this._translocoService.translate("search.reqif.multi.conversion_document_all_languages"),convertibilityType:jt.NOT_CONVERTIBLE,errorMessage:this._translocoService.translate("search.reqif.multi.conversion_error_unconvertible")});else{let ee=n.find(N=>N.acCode===Z.acCode);
2Z.documents.forEach(N=>{let Ce=ee.documents.find(ut=>ut.din21Id===N.din21Id);Ce==null?(T=jt.NOT_FOUND,a++,O=this._translocoService.translate("search.reqif.multi.conversion_error_document_missing")):Ce.bought?Ce.licensed?(T=jt.CONVERTIBLE,r++):(T=jt.NOT_LICENSED,b++,O=this._translocoService.translate("search.reqif.multi.conversion_error_unlicensed")):(T=jt.NOT_BOUGHT,m++,O=this._translocoService.translate("search.reqif.multi.conversion_error_unbought")),U.push({name:Z.documentNumber,acCode:Z.acCode,dateOfIssue:Z.dateOfIssue,din21Id:N.din21Id,language:N.language.toUpperCase(),convertibilityType:T,errorMessage:O,originalLanguages:Z.originalLanguage})})}}),U.sort((Z,ee)=>Z.name.localeCompare(ee.name)).sort((Z,ee)=>-(Z.convertibilityType-ee.convertibilityType)),this._uiService.hideSpinner();let H=this._modalService.open(rr,{windowClass:"modal-large"});H.componentInstance.convertibilityInfos=U,H.componentInstance.convertibleCount=r,H.componentInstance.missingDocumentCount=a,H.componentInstance.unconvertibleCount=l,H.componentInstance.unboughtCount=m,H.componentInstance.unlicensedCount=b,H.result.then(Z=>{if(Z.convert){let ee=U.filter(N=>N.convertibilityType===jt.CONVERTIBLE).map(N=>({acCode:N.acCode,din21Ids:[N.din21Id]}));this.startReqifConversion(ee).subscribe(N=>{if(N?.jobs?.length===0)this._feedbackService.showErrorModal("search.reqif.conversion_failed");else{let Ce=this.mapConvertibilityInfosToLanguageErrorInfoModel(U);if(Ce.length>0){let ut=this._modalService.open(rr,{windowClass:"modal-large"});ut.componentInstance.isSecondaryModal=!0,ut.componentInstance.languageErrorCount=Ce.length,ut.componentInstance.convertibilityInfos=Ce,ut.result.finally(()=>{this._feedbackService.showSuccessModal(e.length===1?"search.reqif.conversion_message_single":this._translocoService.translate("search.reqif.conversion_message_multi",{count:N.jobsAddedCount}))})}else this._feedbackService.showSuccessModal(e.length===1?"search.reqif.conversion_message_single":this._translocoService.translate("search.reqif.conversion_message_multi",{count:N.jobsAddedCount}))}})}})})}checkReqIfConvertibility(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/reqif/convertibilities`;return this._httpClient.post(t,e,{observe:"response"}).pipe(S(n=>{if(ne.isAccepted(n.status))return i.convertibilityCheckResponseDtoToConvertibilityCheckModel(n.body);throw new Error("Failed to get convertibility information")}),k(()=>M(null)))}startReqifConversion(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/reqif/conversion-jobs`;return this._httpClient.post(t,e,{observe:"response"}).pipe(S(n=>{if(ne.isAccepted(n.status))return i.startConversionResponseDtoToStartConversionModel(n.body);throw new Error("Failed to create ConversionJob")}),k(()=>M(null)))}static startConversionResponseDtoToStartConversionModel(e){return{jobs:e.jobs,jobsAddedCount:e.jobsAddedCount}}mapConvertibilityInfosToLanguageErrorInfoModel(e){return e.filter(t=>!t.originalLanguages.includes(t.language.toLowerCase())).map(t=>ve(K({},t),{errorMessage:this._translocoService.translate("search.reqif.language_error"),convertibilityType:jt.NOT_CONVERTIBLE}))}static convertibilityCheckResponseDtoToConvertibilityCheckModel(e){return e.map(t=>({acCode:t.acCode,documents:t.documents?.map(n=>({din21Id:n.din21Id,language:n.language,bought:n.bought,licensed:n.licensed}))}))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function gc(i,o){i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2&&(s(),F("",C(2,1,"search.table_layout.invalid_value")," "))}function Cc(i,o){i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2&&(s(),F("",C(2,1,"search.hitlist.validation_name_min_length")," "))}function vc(i,o){i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2&&(s(),F("",C(2,1,"common.please_fill_this_field")," "))}function bc(i,o){if(i&1&&(c(0,"p",7),u(1,gc,3,3,"span"),u(2,Cc,3,3,"span"),u(3,vc,3,3,"span"),d()),i&2){let e,t,n,r=p(),a=X(1);
2s(),_((e=r.saveSettingsForm.get("name").errors)!=null&&e.invalidValue?1:-1),s(),_((t=r.saveSettingsForm.get("name").errors)!=null&&t.minlength?2:-1),s(),_((n=r.saveSettingsForm.get("name").errors)!=null&&n.required&&r.saveSettingsForm.get("name").touched&&a.submitted?3:-1)}}function yc(i,o){i&1&&(c(0,"p",8)(1,"span"),v(2),h(3,"transloco"),d()()),i&2&&(s(2),D(C(3,1,"common.error")))}var ns=(()=>{class i{constructor(){this.modalService=g(he),this._translocoService=g(ae),this.isSubmitted=!1,this._isRequestSuccessful=!0}get isRequestSuccessful(){return this._isRequestSuccessful}ngOnInit(){this._defaultValue=Bt.isNullOrEmpty(this.currentPresetLocal.userAccountId)?"":this.currentPresetLocal.name,this.saveSettingsForm=new Je({name:new je(this._defaultValue,[Ve.required,Ve.minLength(3),this.invalidValueValidator(this._translocoService.translate("search.tenant_wide_template"))])})}ngOnDestroy(){this._savePresetSubscription&&this._savePresetSubscription.unsubscribe(),this._getDefaultSubscription&&this._getDefaultSubscription.unsubscribe(),this._saveAndOverwriteSubscription&&this._saveAndOverwriteSubscription.unsubscribe(),this._saveNewSubscription&&this._saveNewSubscription.unsubscribe()}onClose(e){this.isSubmitted=e,(!e||this.saveSettingsForm.value.name.length>=3)&&!this.saveSettingsForm.get("name").errors?.invalidValue&&this.modalService.close({preset:e,folder:this.saveSettingsForm.value.name})}invalidValueValidator(e){return t=>t.value===e?{invalidValue:{value:e}}:null}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-hitlist-create-layout-modal"]],inputs:{currentPresetLocal:"currentPresetLocal",defaultPreset:"defaultPreset"},decls:13,vars:12,consts:[["ngForm","ngForm"],["name",""],[3,"ngSubmit","formGroup"],["modalTitle","search.table_layout.title_create"],[1,"modal-body"],["for","hitlist-layout-name"],["id","hitlist-layout-name","formControlName","name","data-cy","layoutName",3,"appAutoFocus"],["data-cy","errorMessage",1,"text-alert"],[1,"text-alert"],[3,"cancelButtonClick","border"]],template:function(t,n){if(t&1&&(c(0,"form",2,0),x("ngSubmit",function(){return n.onClose(!0)}),y(2,"app-modal-header",3),c(3,"div",4)(4,"div")(5,"label",5),v(6),h(7,"transloco"),d(),y(8,"input",6,1),d(),u(10,bc,4,3,"p",7),u(11,yc,4,3,"p",8),d(),c(12,"app-modal-footer",9),x("cancelButtonClick",function(){return n.onClose(!1)}),d()()),t&2){let r,a=X(1);f("formGroup",n.saveSettingsForm),s(4),W("not-valid",((r=n.saveSettingsForm.get("name"))==null?null:r.invalid)&&((r=n.saveSettingsForm.get("name"))==null?null:r.touched)&&a.submitted),s(2),D(C(7,10,"common.name")),s(2),W("submitted",n.isSubmitted),f("appAutoFocus",!0),s(2),_(!n.saveSettingsForm.get("name").valid&&n.saveSettingsForm.get("name").touched&&a.submitted?10:-1),s(),_(n.isRequestSuccessful?-1:11),s(),f("border",!1)}},dependencies:[Ji,Me,we,Ne,Ye,it,Te,ye,Ee,De,z,$],styles:[".text-alert[_ngcontent-%COMP%]{position:relative;top:-1rem}input.ng-invalid.ng-touched[_ngcontent-%COMP%]:not(.submitted){border:var(--border);background:none}"]})}}return i})();var ft=[];for(let i=0;i<256;++i)ft.push((i+256).toString(16).slice(1));function os(i,o=0){return(ft[i[o+0]]+ft[i[o+1]]+ft[i[o+2]]+ft[i[o+3]]+"-"+ft[i[o+4]]+ft[i[o+5]]+"-"+ft[i[o+6]]+ft[i[o+7]]+"-"+ft[i[o+8]]+ft[i[o+9]]+"-"+ft[i[o+10]]+ft[i[o+11]]+ft[i[o+12]]+ft[i[o+13]]+ft[i[o+14]]+ft[i[o+15]]).toLowerCase()}var ar,xc=new Uint8Array(16);function sr(){if(!ar){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ar=crypto.getRandomValues.bind(crypto)}return ar(xc)}var Sc=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lr={randomUUID:Sc};function Tc(i,o,e){i=i||{};let t=i.random??i.rng?.()??sr();if(t.length<16)throw new Error("Random bytes length must be >= 16");if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,o){if(e=e||0,e<0||e+16>o.length)throw new RangeError(`UUID byte range ${e}:${e+15} is out of buffer bounds`);for(let n=0;n<16;++n)o[e+n]=t[n];return o}return os(t)}function Dc(i,o,e){return lr.randomUUID&&!o&&!i?lr.randomUUID():Tc(i,o,e)}var Fi=Dc;var Ec=["inputEl"],Ic=i=>({width:i,"white-space":"nowrap","text-overflow":"ellipsis",overflow:"hidden"}),Fc=()=>({});function Mc(i,o){if(i&1&&(c(0,"span",6),v(1),h(2,"transloco"),d()),i&2){let e=p();W("error-text",e.controlIsInvalid())("one-line-text",e.textOverflow),f("ngStyle",e.fixedWidth?ie(8,Ic,e.fixedWidth+"px"):Hi(10,Fc)),s(),D(C(2,6,e.label))}}var yt=(()=>{class i{get opacity(){return this.disabled?.5:1}set value(e){this.setValue(e)}get value(){return this._value}constructor(){this.controlRef=g(ji,{optional:!0,self:!0}),this._renderer=g(Et),this.disabled=!1,this.textOverflow=!1,this.valueChange=new R,this.onChanged=()=>{},this.onTouched=()=>{},this.controlRef&&(this.controlRef.valueAccessor=this),this.uuid=Fi()}writeValue(e){this._value=e}registerOnChange(e){this.onChanged=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this._renderer.setProperty(this.inputEl.nativeElement,"disabled",e)}handleDisabledClick(e){e.preventDefault(),e.stopPropagation()}setValue(e){this._value=e,this._renderer.setAttribute(this.inputEl.nativeElement,"checked",e.toString()),this.onChanged(this._value),this.valueChange.emit(this._value),this.onTouched()}controlIsInvalid(){let e=this.controlRef?.control;return!!e&&!e.valid&&!e.disabled&&e.touched}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-checkbox"]],viewQuery:function(t,n){if(t&1&&Ge(Ec,7,Ze),t&2){let r;le(r=ce())&&(n.inputEl=r.first)}},hostVars:2,hostBindings:function(t,n){t&2&&Zt("opacity",n.opacity)},inputs:{disabled:"disabled",label:"label",textOverflow:"textOverflow",fixedWidth:"fixedWidth",value:"value"},outputs:{valueChange:"valueChange"},decls:6,vars:11,consts:[["inputEl",""],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"change","keydown.enter","id","checked"],[1,"form-check-label",3,"for"],["sprite","icons-small","tabindex","0",3,"name"],[1,"checkbox-label",3,"error-text","one-line-text","ngStyle"],[1,"checkbox-label",3,"ngStyle"]],template:function(t,n){if(t&1){let r=w();c(0,"div",1)(1,"input",2,0),x("change",function(){E(r);let l=X(2);return I(n.setValue(l.checked))})("keydown.enter",function(){E(r);let l=X(2);return I(n.setValue(!l.checked))}),d(),c(3,"label",3),y(4,"app-icon",4),u(5,Mc,3,11,"span",5),d()()}if(t&2){let r=X(2);W("disabled",r.disabled),s(),f("id",n.uuid)("checked",n.value),s(2),f("for",n.uuid),s(),W("checked",n.value)("unchecked",!n.value),f("name",n.value?"checkbox-checked":"checkbox-unchecked"),s(),_(n.label?5:-1)}},dependencies:[Oe,Ln,j,z,$],styles:[".form-check[_ngcontent-%COMP%]{padding-left:0}.form-check[_ngcontent-%COMP%] .form-check-label[_ngcontent-%COMP%]{display:inline-flex;gap:calc(var(--spacer) / 4);line-height:1;height:1rem;margin-bottom:0;white-space:nowrap}.form-check[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{position:relative;width:1px;height:1px;margin:0;opacity:0;pointer-events:auto}.form-check[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus{border-radius:var(--border-radius);box-shadow:0 0 0 .12rem var(--color-focus);outline:none;z-index:4}.form-check[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is([type=radio]){border:none;border-radius:50%}.form-check[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is(.btn-icon,.nautos-select){z-index:unset}.form-check[_ngcontent-%COMP%] app-icon.checked[_ngcontent-%COMP%]{color:var(--color-primary)}.form-check[_ngcontent-%COMP%] app-icon.unchecked[_ngcontent-%COMP%]{color:var(--color-primary-dark)}"]})}}return i})();function rs(i){return i.buttons===0||i.detail===0}function as(i){let o=i.touches&&i.touches[0]||i.changedTouches&&i.changedTouches[0];return!!o&&o.identifier===-1&&(o.radiusX==null||o.radiusX===1)&&(o.radiusY==null||o.radiusY===1)}function pr(i){let o=i.cloneNode(!0),e=o.querySelectorAll("[id]"),t=i.nodeName.toLowerCase();o.removeAttribute("id");for(let n=0;n<e.length;n++)e[n].removeAttribute("id");return t==="canvas"?cs(i,o):(t==="input"||t==="select"||t==="textarea")&&ls(i,o),ss("canvas",i,o,cs),ss("input, textarea, select",i,o,ls),o}function ss(i,o,e,t){let n=o.querySelectorAll(i);if(n.length){let r=e.querySelectorAll(i);for(let a=0;a<n.length;a++)t(n[a],r[a])}}var wc=0;function ls(i,o){o.type!=="file"&&(o.value=i.value),o.type==="radio"&&o.name&&(o.name=`mat-clone-${o.name}-${wc++}`)}function cs(i,o){let e=o.getContext("2d");if(e)try{e.drawImage(i,0,0)}catch(t){}}function vr(i){let o=i.getBoundingClientRect();return{top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height,x:o.x,y:o.y}}function mr(i,o,e){let{top:t,bottom:n,left:r,right:a}=i;return e>=t&&e<=n&&o>=r&&o<=a}function Oc(i,o){let e=o.left<i.left,t=o.left+o.width>i.right,n=o.top<i.top,r=o.top+o.height>i.bottom;return e||t||n||r}function bn(i,o,e){i.top+=o,i.bottom=i.top+i.height,i.left+=e,i.right=i.left+i.width}
vendor: 4,272 bytes, lines 2-15
2function ds(i,o,e,t){let{top:n,right:r,bottom:a,left:l,width:m,height:b}=i,T=m*o,O=b*o;return t>n-O&&t<a+O&&e>l-T&&e<r+T}var Xn=class{_document;positions=new Map;constructor(o){this._document=o}clear(){this.positions.clear()}cache(o){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),o.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:vr(e)})})}handleScroll(o){let e=hn(o),t=this.positions.get(e);if(!t)return null;let n=t.scrollPosition,r,a;if(e===this._document){let b=this.getViewportScrollPosition();r=b.top,a=b.left}else r=e.scrollTop,a=e.scrollLeft;let l=n.top-r,m=n.left-a;return this.positions.forEach((b,T)=>{b.clientRect&&e!==T&&e.contains(T)&&bn(b.clientRect,l,m)}),n.top=r,n.left=a,{top:l,left:m}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function bs(i,o){let e=i.rootNodes;if(e.length===1&&e[0].nodeType===o.ELEMENT_NODE)return e[0];let t=o.createElement("div");return e.forEach(n=>t.appendChild(n)),t}function br(i,o,e){for(let t in o)if(o.hasOwnProperty(t)){let n=o[t];n?i.setProperty(t,n,e?.has(t)?"important":""):i.removeProperty(t)}return i}function tn(i,o){let e=o?"":"none";br(i.style,{"touch-action":o?"":"none","-webkit-user-drag":o?"":"none","-webkit-tap-highlight-color":o?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function ps(i,o,e){br(i.style,{position:o?"":"fixed",top:o?"":"0",opacity:o?"":"0",left:o?"":"-999em"},e)}function eo(i,o){return o&&o!="none"?i+" "+o:i}function ms(i,o){i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.transform=yn(o.left,o.top)}function yn(i,o){return`translate3d(${Math.round(i)}px, ${Math.round(o)}px, 0)`}var Cn={capture:!0},cr={passive:!1,capture:!0},Pc=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=L({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(t,n){},styles:[`@layer cdk-resets { 3 .cdk-drag-preview { 4 background: none; 5 border: none; 6 padding: 0; 7 color: inherit; 8 inset: auto; 9 } 10} 11.cdk-drag-placeholder *, 12.cdk-drag-preview * { 13 pointer-events: none !important; 14} 15`],encapsulation:2,changeDetection:0})}return i})(),yr=(()=>{class i{_ngZone=g(Ui);_document=g(di);_styleLoader=g(La);_renderer=g(Vo).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new be;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=Bo([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new be;pointerUp=new be;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,cr)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,t){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(Pc),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=t.type.startsWith("touch"),r=l=>this.pointerUp.next(l),a=[["scroll",l=>this._scroll.next(l),Cn],["selectstart",this._preventDefaultWhileDragging,cr]];n?a.push(["touchend",r,Cn],["touchcancel",r,Cn]):a.push(["mouseup",r,Cn]),n||a.push(["mousemove",l=>this.pointerMove.next(l),cr]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=a.map(([l,m,b])=>this._renderer.listen(this._document,l,m,b))})}}stopDragging(e){this._activeDragInstances.update(t=>{let n=t.indexOf(e);return n>-1?(t.splice(n,1),[...t]):t}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let t=[this._scroll];return e&&e!==this._document&&t.push(new He(n=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,"scroll",a=>{this._activeDragInstances().length&&n.next(a)},Cn);return()=>{r()}}))),Li(...t)}
15registerDirectiveNode(e,t){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,t)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(t){return new(t||i)};static \u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function us(i){let o=i.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(i)*o}function Nc(i){let o=getComputedStyle(i),e=dr(o,"transition-property"),t=e.find(l=>l==="transform"||l==="all");if(!t)return 0;let n=e.indexOf(t),r=dr(o,"transition-duration"),a=dr(o,"transition-delay");return us(r[n])+us(a[n])}function dr(i,o){return i.getPropertyValue(o).split(",").map(t=>t.trim())}var kc=new Set(["position"]),ur=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(o,e,t,n,r,a,l,m,b,T){this._document=o,this._rootElement=e,this._direction=t,this._initialDomRect=n,this._previewTemplate=r,this._previewClass=a,this._pickupPositionOnPage=l,this._initialTransform=m,this._zIndex=b,this._renderer=T}attach(o){this._preview=this._createPreview(),o.appendChild(this._preview),_s(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(o){this._preview.style.transform=o}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(o){this._preview.classList.add(o)}getTransitionDuration(){return Nc(this._preview)}addEventListener(o,e){return this._renderer.listen(this._preview,o,e)}_createPreview(){let o=this._previewTemplate,e=this._previewClass,t=o?o.template:null,n;if(t&&o){let r=o.matchSize?this._initialDomRect:null,a=o.viewContainer.createEmbeddedView(t,o.context);a.detectChanges(),n=bs(a,this._document),this._previewEmbeddedView=a,o.matchSize?ms(n,r):n.style.transform=yn(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else n=pr(this._rootElement),ms(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return br(n.style,{"pointer-events":"none",margin:_s(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},kc),tn(n,!1),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(r=>n.classList.add(r)):n.classList.add(e)),n}};function _s(i){return"showPopover"in i}var Rc={passive:!0},hs={passive:!1},Ac={passive:!1,capture:!0},Lc=800,fs="cdk-drag-placeholder",gs=new Set(["position"]);function ys(i,o,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let t=i.get(Et,null,{optional:!0})||i.get(Vo).createRenderer(null,null);return new _r(o,e,i.get(di),i.get(Ui),i.get(Xo),i.get(yr),t)}var _r=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=Bo(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new be;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=At.EMPTY;_pointerUpSubscription=At.EMPTY;_scrollSubscription=At.EMPTY;_resizeSubscription=At.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(o){o!==this._disabled&&(this._disabled=o,this._toggleNativeDragInteractions(),this._handles.forEac
vendor: 11,789 bytes, line 15
15h(e=>tn(e,o)))}_disabled=!1;beforeStarted=new be;started=new be;released=new be;ended=new be;entered=new be;exited=new be;dropped=new be;moved=this._moveEvents;data;constrainPosition;constructor(o,e,t,n,r,a,l){this._config=e,this._document=t,this._ngZone=n,this._viewportRuler=r,this._dragDropRegistry=a,this._renderer=l,this.withRootElement(o).withParent(e.parentDragRef||null),this._parentPositions=new Xn(t),a.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(o){this._handles=o.map(t=>ri(t)),this._handles.forEach(t=>tn(t,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(t=>{this._handles.indexOf(t)>-1&&e.add(t)}),this._disabledHandles=e,this}withPreviewTemplate(o){return this._previewTemplate=o,this}withPlaceholderTemplate(o){return this._placeholderTemplate=o,this}withRootElement(o){let e=ri(o);if(e!==this._rootElement){this._removeRootElementListeners();let t=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[t.listen(e,"mousedown",this._pointerDown,hs),t.listen(e,"touchstart",this._pointerDown,Rc),t.listen(e,"dragstart",this._nativeDragStart,hs)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(o){return this._boundaryElement=o?ri(o):null,this._resizeSubscription.unsubscribe(),o&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(o){return this._parentDragRef=o,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&Oc(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let o=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),t=0,n=0;e.left<o.left?t=o.left-e.left:e.right>o.right&&(t=o.right-e.right),e.top<o.top?n=o.top-e.top:e.bottom>o.bottom&&(n=o.bottom-e.bottom);let r=this._activeTransform.x,a=this._activeTransform.y,l=r+t,m=a+n;this._rootElement.style.transform=yn(l,m),this._activeTransform={x:l,y:m},this._passiveTransform={x:l,y:m}}}disableHandle(o){!this._disabledHandles.has(o)&&this._handles.indexOf(o)>-1&&(this._disabledHandles.add(o),tn(o,!0))}enableHandle(o){this._disabledHandles.has(o)&&(this._disabledHandles.delete(o),tn(o,this.disabled))}withDirection(o){return this._direction=o,this}_withDropContainer(o){this._dropContainer=o}getFreeDragPosition(){let o=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:o.x,y:o.y}}setFreeDragPosition(o){return this._activeTransform={x:0,y:0},this._passiveTransform.x=o.x,this._passiveTransform.y=o.y,this._dropContainer||this._applyRootElementTransform(o.x,o.y),this}withPreviewContainer(o){return this._previewContainer=o,this}_sortFromLastPointerPosition(){let o=this._lastKnownPointerPosition;o&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(o),o)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=o=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(o);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,o)}else this.disabled||this._initializeDragSequence(this._rootElement,o)};_pointerMove=o=>{let e=this._getPointerPositionOnPage(o);if(!this._hasStartedDragging()){let n=Math.abs(e.x-this._pickupPositionOnPage.x),r=Math.abs(e.y-this._pickupPositionOnPage.y);if(n+r>=this._config.dragStartThreshold){let l=Date.now()>=this._dragStartTime+this._getDragStartDelay(o),m=this._dropContainer;if(!l){this._endDragSequence(o);return}(!m||!m.isDragging()&&!m.isReceiving())&&(o.cancelable&&o.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(o)))}return}o.cancelable&&o.preventDefault();let t=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(t),this._dropContainer)this._updateActiveDropContainer(t,e);else{let n=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=t.x-n.x+this._passiveTransform.x,r.y=t.y-n.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:t,event:o,distance:this._getDragDistance(t),delta:this._pointerDirectionDelta})})};_pointerUp=o=>{this._endDragSequence(o)};_endDragSequence(o){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:o}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(o),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(o);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:o})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(o){vn(o)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),t=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",Uc,Ac)}),t){let n=this._rootElement,r=n.parentNode,a=this._placeholder=this._createPlaceholderElement(),l=this._marker=this._marker||this._document.createComment("");r.insertBefore(l,n),this._initialTransform=n.style.transform||"",this._preview=new ur(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(r,e)),ps(n,!1,gs),this._document.body.appendChild(r.replaceChild(a,n)),this.started.next({source:this,event:o}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this)}else this.started.next({source:this,event:o}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[])}_initializeDragSequence(o,e){this._parentDragRef&&e.stopPropagation();let t=this.isDragging(),n=vn(e),r=!n&&e.button!==0,a=this._rootElement,l=hn(e),m=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+Lc>Date.now(),b=n?as(e):rs(e);if(l&&l.draggable&&e.type==="mousedown"&&e.preventDefault(),t||r||m||b)return;if(this._handles.length){let U=a.style;this._rootElementTapHighlight=U.webkitTapHighlightColor||"",U.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(U=>this._updateOnScroll(U)),this._boundaryElement&&(this._boundaryRect=vr(this._boundaryElement));let T=this._previewTemplate;this._pickupPositionInElement=T&&T.template&&!T.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,o,e);let O=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:O.x,y:O.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(o){ps(this._rootElement,!0,gs),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,t=e.getItemIndex(this),n=this._getPointerPositionOnPage(o),r=this._getDragDistance(n),a=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:r,dropPoint:n,event:o}),this.dropped.next({item:this,currentIndex:t,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:a,distance:r,dropPoint:n,event:o}),e.drop(this,t,this._initialIndex,this._initialContainer,a,r,n,o),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:o,y:e},{x:t,y:n}){let r=this._initialContainer._getSiblingContainerFromPosition(this,o,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(o,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let a=this._dropContainer.getItemIndex(this),l=this._dropContainer.getItemAtIndex(a+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,l),this._dropContainer=r,this._dropContainer.enter(this,o,e,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(t,n),this._dropContainer._sortItem(this,o,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(o,e):this._applyPreviewTransform(o-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let o=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(o.left,o.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(t=>{let n=l=>{(!l||this._preview&&hn(l)===this._preview.element&&l.propertyName==="transform")&&(a(),t(),clearTimeout(r))},r=setTimeout(n,e*1.5),a=this._preview.addEventListener("transitionend",n)}
vendor: 8,463 bytes, line 15
15))}_createPlaceholderElement(){let o=this._placeholderTemplate,e=o?o.template:null,t;return e?(this._placeholderRef=o.viewContainer.createEmbeddedView(e,o.context),this._placeholderRef.detectChanges(),t=bs(this._placeholderRef,this._document)):t=pr(this._rootElement),t.style.pointerEvents="none",t.classList.add(fs),t}_getPointerPositionInElement(o,e,t){let n=e===this._rootElement?null:e,r=n?n.getBoundingClientRect():o,a=vn(t)?t.targetTouches[0]:t,l=this._getViewportScrollPosition(),m=a.pageX-r.left-l.left,b=a.pageY-r.top-l.top;return{x:r.left-o.left+m,y:r.top-o.top+b}}_getPointerPositionOnPage(o){let e=this._getViewportScrollPosition(),t=vn(o)?o.touches[0]||o.changedTouches[0]||{pageX:0,pageY:0}:o,n=t.pageX-e.left,r=t.pageY-e.top;if(this._ownerSVGElement){let a=this._ownerSVGElement.getScreenCTM();if(a){let l=this._ownerSVGElement.createSVGPoint();return l.x=n,l.y=r,l.matrixTransform(a.inverse())}}return{x:n,y:r}}_getConstrainedPointerPosition(o){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:t,y:n}=this.constrainPosition?this.constrainPosition(o,this,this._initialDomRect,this._pickupPositionInElement):o;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(t=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:a}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,l=this._boundaryRect,{width:m,height:b}=this._getPreviewRect(),T=l.top+a,O=l.bottom-(b-a),U=l.left+r,H=l.right-(m-r);t=Cs(t,U,H),n=Cs(n,T,O)}return{x:t,y:n}}_updatePointerDirectionDelta(o){let{x:e,y:t}=o,n=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,a=Math.abs(e-r.x),l=Math.abs(t-r.y);return a>this._config.pointerDirectionChangeThreshold&&(n.x=e>r.x?1:-1,r.x=e),l>this._config.pointerDirectionChangeThreshold&&(n.y=t>r.y?1:-1,r.y=t),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let o=this._handles.length>0||!this.isDragging();o!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=o,tn(this._rootElement,o))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(o=>o()),this._rootElementCleanups=void 0}_applyRootElementTransform(o,e){let t=1/this.scale,n=yn(o*t,e*t),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=eo(n,this._initialTransform)}_applyPreviewTransform(o,e){let t=this._previewTemplate?.template?void 0:this._initialTransform,n=yn(o,e);this._preview.setTransform(eo(n,t))}_getDragDistance(o){let e=this._pickupPositionOnPage;return e?{x:o.x-e.x,y:o.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:o,y:e}=this._passiveTransform;if(o===0&&e===0||this.isDragging()||!this._boundaryElement)return;let t=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||t.width===0&&t.height===0)return;let r=n.left-t.left,a=t.right-n.right,l=n.top-t.top,m=t.bottom-n.bottom;n.width>t.width?(r>0&&(o+=r),a>0&&(o-=a)):o=0,n.height>t.height?(l>0&&(e+=l),m>0&&(e-=m)):e=0,(o!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:o})}_getDragStartDelay(o){let e=this.dragStartDelay;return typeof e=="number"?e:vn(o)?e.touch:e?e.mouse:0}_updateOnScroll(o){let e=this._parentPositions.handleScroll(o);if(e){let t=hn(o);this._boundaryRect&&t!==this._boundaryElement&&t.contains(this._boundaryElement)&&bn(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=Hn(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(o,e){let t=this._previewContainer||"global";if(t==="parent")return o;if(t==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body}return ri(t)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=o=>{if(this._handles.length){let e=this._getTargetHandle(o);e&&!this._disabledHandles.has(e)&&!this.disabled&&o.preventDefault()}else this.disabled||o.preventDefault()};_getTargetHandle(o){return this._handles.find(e=>o.target&&(o.target===e||e.contains(o.target)))}_conditionallyInsertAnchor(o,e,t){if(o===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let n=this._anchor??=pr(this._placeholder);n.classList.remove(fs),n.classList.add("cdk-drag-anchor"),n.style.transform="",t?t.before(n):ri(e.element).appendChild(n)}}};function Cs(i,o,e){return Math.max(o,Math.min(e,i))}function vn(i){return i.type[0]==="t"}function Uc(i){i.preventDefault()}function nn(i,o,e){let t=xn(o,i.length-1),n=xn(e,i.length-1);if(t===n)return;let r=i[t],a=n<t?-1:1;for(let l=t;l!==n;l+=a)i[l]=i[l+a];i[n]=r}function xs(i,o,e,t){let n=xn(e,i.length-1),r=xn(t,o.length);i.length&&o.splice(r,0,i.splice(n,1)[0])}function Ss(i,o,e,t){let n=xn(t,o.length);i.length&&o.splice(n,0,i[e])}function xn(i,o){return Math.max(0,Math.min(o,i))}var to=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(o){this._dragDropRegistry=o}_previousSwap={drag:null,delta:0,overlaps:!1};start(o){this.withItems(o)}sort(o,e,t,n){let r=this._itemPositions,a=this._getItemIndexFromPointerPosition(o,e,t,n);if(a===-1&&r.length>0)return null;let l=this.orientation==="horizontal",m=r.findIndex(N=>N.drag===o),b=r[a],T=r[m].clientRect,O=b.clientRect,U=m>a?1:-1,H=this._getItemOffsetPx(T,O,U),Z=this._getSiblingOffsetPx(m,r,U),ee=r.slice();return nn(r,m,a),r.forEach((N,Ce)=>{if(ee[Ce]===N)return;let ut=N.drag===o,Lo=ut?H:Z,Wr=ut?o.getPlaceholderElement():N.drag.getRootElement();N.offset+=Lo;let zr=Math.round(N.offset*(1/N.drag.scale));l?(Wr.style.transform=eo(`translate3d(${zr}px, 0, 0)`,N.initialTransform),bn(N.clientRect,0,Lo)):(Wr.style.transform=eo(`translate3d(0, ${zr}px, 0)`,N.initialTransform),bn(N.clientRect,Lo,0))}),this._previousSwap.overlaps=mr(O,e,t),this._previousSwap.drag=b.drag,this._previousSwap.delta=l?n.x:n.y,{previousIndex:m,currentIndex:a}}enter(o,e,t,n){let r=this._activeDraggables,a=r.indexOf(o),l=o.getPlaceholderElement();a>-1&&r.splice(a,1);let m=n==null||n<0?this._getItemIndexFromPointerPosition(o,e,t):n,b=r[m];if(b===o&&(b=r[m+1]),!b&&(m==null||m===-1||m<r.length-1)&&this._shouldEnterAsFirstChild(e,t)&&(b=r[0]),b&&!this._dragDropRegistry.isDragging(b)){let T=b.getRootElement();T.parentElement.insertBefore(l,T),r.splice(m,0,o)}else this._element.appendChild(l),r.push(o);l.style.transform="",this._cacheItemPositions()}withItems(o){this._activeDraggables=o.slice(),this._cacheItemPositions()}withSortPredicate(o){this._sortPredicate=o}reset(){this._activeDraggables?.forEach(o=>{let e=o.getRootElement();if(e){let t=this._itemPositions.find(n=>n.drag===o)?.initialTransform;e.style.transform=t||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(o){return this._getVisualItemPositions().findIndex(e=>e.drag===o)}getItemAtIndex(o){return this._getVisualItemPositions()[o]?.drag||null}updateOnScroll(o,e){this._itemPositions.forEach(({clientRect:t})=>{bn(t,o,e)}),this._itemPositions.forEach(({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(o){this._element=o}_cacheItemPositions(){let o=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let t=e.getVisibleElement();return{drag:e,offset:0,initialTransform:t.style.transform||"",clientRect:vr(t)}}).sort((e,t)=>
vendor: 8,344 bytes, line 15
15o?e.clientRect.left-t.clientRect.left:e.clientRect.top-t.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(o,e,t){let n=this.orientation==="horizontal",r=n?e.left-o.left:e.top-o.top;return t===-1&&(r+=n?e.width-o.width:e.height-o.height),r}_getSiblingOffsetPx(o,e,t){let n=this.orientation==="horizontal",r=e[o].clientRect,a=e[o+t*-1],l=r[n?"width":"height"]*t;if(a){let m=n?"left":"top",b=n?"right":"bottom";t===-1?l-=a.clientRect[m]-r[b]:l+=r[m]-a.clientRect[b]}return l}_shouldEnterAsFirstChild(o,e){if(!this._activeDraggables.length)return!1;let t=this._itemPositions,n=this.orientation==="horizontal";if(t[0].drag!==this._activeDraggables[0]){let a=t[t.length-1].clientRect;return n?o>=a.right:e>=a.bottom}else{let a=t[0].clientRect;return n?o<=a.left:e<=a.top}}_getItemIndexFromPointerPosition(o,e,t,n){let r=this.orientation==="horizontal",a=this._itemPositions.findIndex(({drag:l,clientRect:m})=>{if(l===o)return!1;if(n){let b=r?n.x:n.y;if(l===this._previousSwap.drag&&this._previousSwap.overlaps&&b===this._previousSwap.delta)return!1}return r?e>=Math.floor(m.left)&&e<Math.floor(m.right):t>=Math.floor(m.top)&&t<Math.floor(m.bottom)});return a===-1||!this._sortPredicate(a,o)?-1:a}},hr=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(o,e){this._document=o,this._dragDropRegistry=e}start(o){let e=this._element.childNodes;this._relatedNodes=[];for(let t=0;t<e.length;t++){let n=e[t];this._relatedNodes.push([n,n.nextSibling])}this.withItems(o)}sort(o,e,t,n){let r=this._getItemIndexFromPointerPosition(o,e,t),a=this._previousSwap;if(r===-1||this._activeItems[r]===o)return null;let l=this._activeItems[r];if(a.drag===l&&a.overlaps&&a.deltaX===n.x&&a.deltaY===n.y)return null;let m=this.getItemIndex(o),b=o.getPlaceholderElement(),T=l.getRootElement();r>m?T.after(b):T.before(b),nn(this._activeItems,m,r);let O=this._getRootNode().elementFromPoint(e,t);return a.deltaX=n.x,a.deltaY=n.y,a.drag=l,a.overlaps=T===O||T.contains(O),{previousIndex:m,currentIndex:r}}enter(o,e,t,n){let r=this._activeItems.indexOf(o);r>-1&&this._activeItems.splice(r,1);let a=n==null||n<0?this._getItemIndexFromPointerPosition(o,e,t):n;a===-1&&(a=this._getClosestItemIndexToPointer(o,e,t));let l=this._activeItems[a];l&&!this._dragDropRegistry.isDragging(l)?(this._activeItems.splice(a,0,o),l.getRootElement().before(o.getPlaceholderElement())):(this._activeItems.push(o),this._element.appendChild(o.getPlaceholderElement()))}withItems(o){this._activeItems=o.slice()}withSortPredicate(o){this._sortPredicate=o}reset(){let o=this._element,e=this._previousSwap;for(let t=this._relatedNodes.length-1;t>-1;t--){let[n,r]=this._relatedNodes[t];n.parentNode===o&&n.nextSibling!==r&&(r===null?o.appendChild(n):r.parentNode===o&&o.insertBefore(n,r))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(o){return this._activeItems.indexOf(o)}getItemAtIndex(o){return this._activeItems[o]||null}updateOnScroll(){this._activeItems.forEach(o=>{this._dragDropRegistry.isDragging(o)&&o._sortFromLastPointerPosition()})}withElementContainer(o){o!==this._element&&(this._element=o,this._rootNode=void 0)}_getItemIndexFromPointerPosition(o,e,t){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(t)),r=n?this._activeItems.findIndex(a=>{let l=a.getRootElement();return n===l||l.contains(n)}):-1;return r===-1||!this._sortPredicate(r,o)?-1:r}_getRootNode(){return this._rootNode||(this._rootNode=Hn(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(o,e,t){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let n=1/0,r=-1;for(let a=0;a<this._activeItems.length;a++){let l=this._activeItems[a];if(l!==o){let{x:m,y:b}=l.getRootElement().getBoundingClientRect(),T=Math.hypot(e-m,t-b);T<n&&(n=T,r=a)}}return r}},vs=.05,Ts=.05,Kt=(function(i){return i[i.NONE=0]="NONE",i[i.UP=1]="UP",i[i.DOWN=2]="DOWN",i})(Kt||{}),Tt=(function(i){return i[i.NONE=0]="NONE",i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i})(Tt||{});function Ds(i,o){return new fr(o,i.get(yr),i.get(di),i.get(Ui),i.get(Xo))}var fr=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new be;entered=new be;exited=new be;dropped=new be;sorted=new be;receivingStarted=new be;receivingStopped=new be;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=At.EMPTY;_verticalScrollDirection=Kt.NONE;_horizontalScrollDirection=Tt.NONE;_scrollNode;_stopScrollTimers=new be;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(o,e,t,n,r){this._dragDropRegistry=e,this._ngZone=n,this._viewportRuler=r;let a=this.element=ri(o);this._document=t,this.withOrientation("vertical").withElementContainer(a),e.registerDropContainer(this),this._parentPositions=new Xn(t)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(o,e,t,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(o)),this._sortStrategy.enter(o,e,t,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:o,container:this,currentIndex:this.getItemIndex(o)})}exit(o){this._reset(),this.exited.next({item:o,container:this})}drop(o,e,t,n,r,a,l,m={}){this._reset(),this.dropped.next({item:o,currentIndex:e,previousIndex:t,container:this,previousContainer:n,isPointerOverContainer:r,distance:a,dropPoint:l,event:m})}withItems(o){let e=this._draggables;return this._draggables=o,o.forEach(t=>t._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>o.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(o){return this._direction=o,this._sortStrategy instanceof to&&(this._sortStrategy.direction=o),this}connectedTo(o){return this._siblings=o.slice(),this}withOrientation(o){if(o==="mixed")this._sortStrategy=new hr(this._document,this._dragDropRegistry);else{let e=new to(this._dragDropRegistry);e.direction=this._direction,e.orientation=o,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,t)=>this.sortPredicate(e,t,this)),this}withScrollableParents(o){let e=this._container;return this._scrollableElements=o.indexOf(e)===-1?[e,...o]:o.slice(),this}withElementContainer(o){if(o===this._container)return this;let e=ri(this.element),t=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(o);return t>-1&&this._scrollableElements.splice(t,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(o),this._cachedShadowRoot=null,this._scrollableElements.unshift(o),this._container=o,this}getScrollableParents(){return this._scrollableElements}getItemIndex(o){return this._isDragging?this._sortStrategy.getItemIndex(o):this._draggables.indexOf(o)}getItemAtIndex(o){return this._isDragging?this._sortStrategy.getItemAtIndex(o):this._draggables[o]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(o,e,t,n){if(this.sortingDisabled||!this._domRect||!ds(this._domRect,vs,e,t))return;let r=this._sortStrategy.sort(o,e,t,n);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:o})}_startScrollingIfNecessary(o,e){if(this.autoScrollDisabled)return;let t,n=Kt.NONE,r=Tt.NONE;if(this._parentPositions.positions.forEach((a,l)=>
vendor: 8,898 bytes, line 15
15{l===this._document||!a.clientRect||t||ds(a.clientRect,vs,o,e)&&([n,r]=Bc(l,a.clientRect,this._direction,o,e),(n||r)&&(t=l))}),!n&&!r){let{width:a,height:l}=this._viewportRuler.getViewportSize(),m={width:a,height:l,top:0,right:a,bottom:l,left:0};n=Es(m,e),r=Is(m,o),t=window}t&&(n!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||t!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=r,this._scrollNode=t,(n||r)&&t?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let o=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=o.msScrollSnapType||o.scrollSnapType||"",o.scrollSnapType=o.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let o=this._container.style;o.scrollSnapType=o.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Jr(0,Qr).pipe(St(this._stopScrollTimers)).subscribe(()=>{let o=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===Kt.UP?o.scrollBy(0,-e):this._verticalScrollDirection===Kt.DOWN&&o.scrollBy(0,e),this._horizontalScrollDirection===Tt.LEFT?o.scrollBy(-e,0):this._horizontalScrollDirection===Tt.RIGHT&&o.scrollBy(e,0)})};_isOverContainer(o,e){return this._domRect!=null&&mr(this._domRect,o,e)}_getSiblingContainerFromPosition(o,e,t){return this._siblings.find(n=>n._canReceive(o,e,t))}_canReceive(o,e,t){if(!this._domRect||!mr(this._domRect,e,t)||!this.enterPredicate(o,this))return!1;let n=this._getShadowRoot().elementFromPoint(e,t);return n?n===this._container||this._container.contains(n):!1}_startReceiving(o,e){let t=this._activeSiblings;!t.has(o)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(t.add(o),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:o,receiver:this,items:e}))}_stopReceiving(o){this._activeSiblings.delete(o),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:o,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(o=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(o);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let o=Hn(this._container);this._cachedShadowRoot=o||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let o=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,o))}};function Es(i,o){let{top:e,bottom:t,height:n}=i,r=n*Ts;return o>=e-r&&o<=e+r?Kt.UP:o>=t-r&&o<=t+r?Kt.DOWN:Kt.NONE}function Is(i,o){let{left:e,right:t,width:n}=i,r=n*Ts;return o>=e-r&&o<=e+r?Tt.LEFT:o>=t-r&&o<=t+r?Tt.RIGHT:Tt.NONE}function Bc(i,o,e,t,n){let r=Es(o,n),a=Is(o,t),l=Kt.NONE,m=Tt.NONE;if(r){let b=i.scrollTop;r===Kt.UP?b>0&&(l=Kt.UP):i.scrollHeight-b>i.clientHeight&&(l=Kt.DOWN)}if(a){let b=i.scrollLeft;e==="rtl"?a===Tt.RIGHT?b<0&&(m=Tt.RIGHT):i.scrollWidth+b>i.clientWidth&&(m=Tt.LEFT):a===Tt.LEFT?b>0&&(m=Tt.LEFT):i.scrollWidth-b>i.clientWidth&&(m=Tt.RIGHT)}return[l,m]}var Vc=(()=>{class i{_injector=g(Nn);constructor(){}createDrag(e,t){return ys(this._injector,e,t)}createDropList(e){return Ds(this._injector,e)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),gr=new Ke("CDK_DRAG_PARENT");var $c=new Ke("CdkDragHandle");var io=new Ke("CDK_DRAG_CONFIG"),Fs=new Ke("CdkDropList"),no=(()=>{class i{element=g(Ze);dropContainer=g(Fs,{optional:!0,skipSelf:!0});_ngZone=g(Ui);_viewContainerRef=g(Vi);_dir=g(Wi,{optional:!0});_changeDetectorRef=g(ze);_selfHandle=g($c,{optional:!0,self:!0});_parentDrag=g(gr,{optional:!0,skipSelf:!0});_dragDropRegistry=g(yr);_destroyed=new be;_handles=new oe([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new R;released=new R;ended=new R;entered=new R;exited=new R;dropped=new R;moved=new He(e=>{let t=this._dragRef.moved.pipe(S(n=>({source:this,pointerPosition:n.pointerPosition,event:n.event,delta:n.delta,distance:n.distance}))).subscribe(e);return()=>{t.unsubscribe()}});_injector=g(Nn);constructor(){let e=this.dropContainer,t=g(io,{optional:!0});this._dragRef=ys(this._injector,this.element,{dragStartThreshold:t&&t.dragStartThreshold!=null?t.dragStartThreshold:5,pointerDirectionChangeThreshold:t&&t.pointerDirectionChangeThreshold!=null?t.pointerDirectionChangeThreshold:5,zIndex:t?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),t&&this._assignDefaults(t),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(St(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){pa(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let t=e.rootElementSelector,n=e.freeDragPosition;t&&!t.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let t=this._handles.getValue();t.push(e),this._handles.next(t)}_removeHandle(e){let t=this._handles.getValue(),n=t.indexOf(e);n>-1&&(t.splice(n,1),this._handles.next(t))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,t=e;this.rootElementSelector&&(t=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(t||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):ri(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let t=this._dir,n=this.dragStartDelay,r=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,a=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:Qo(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(r).withPreviewTemplate(a).withPreviewContainer(this.previewContainer||"global"),t&&e.withDirection(t.value)}}),e.beforeStarted.pipe(tt(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let t=this.element.nativeElement.parentElement;for(;t;){let n=this._dragDropRegistry.getDragDirectiveForNode(t);if(n){e.withParent(n._dragRef);break}t=t.parentElement}})}_handleEvents(e){e.started.subscribe(t=>{this.started.emit({source:this,event:t.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(t=>
15{this.released.emit({source:this,event:t.event})}),e.ended.subscribe(t=>{this.ended.emit({source:this,distance:t.distance,dropPoint:t.dropPoint,event:t.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(t=>{this.entered.emit({container:t.container.data,item:this,currentIndex:t.currentIndex})}),e.exited.subscribe(t=>{this.exited.emit({container:t.container.data,item:this})}),e.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,isPointerOverContainer:t.isPointerOverContainer,item:this,distance:t.distance,dropPoint:t.dropPoint,event:t.event})})}_assignDefaults(e){let{lockAxis:t,dragStartDelay:n,constrainPosition:r,previewClass:a,boundaryElement:l,draggingDisabled:m,rootElementSelector:b,previewContainer:T}=e;this.disabled=m??!1,this.dragStartDelay=n||0,this.lockAxis=t||null,r&&(this.constrainPosition=r),a&&(this.previewClass=a),l&&(this.boundaryElement=l),b&&(this.rootElementSelector=b),T&&(this.previewContainer=T)}_setupHandlesListener(){this._handles.pipe(V(e=>{let t=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&t.push(this.element),this._dragRef.withHandles(t)}),Re(e=>Li(...e.map(t=>t._stateChanges.pipe(li(t))))),St(this._destroyed)).subscribe(e=>{let t=this._dragRef,n=e.element.nativeElement;e.disabled?t.disableHandle(n):t.enableHandle(n)})}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(t,n){t&2&&W("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Wt],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Ki]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[pi([{provide:gr,useExisting:i}]),Ct]})}return i})(),Cr=new Ke("CdkDropListGroup"),Ms=(()=>{class i{_items=new Set;disabled=!1;ngOnDestroy(){this._items.clear()}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["","cdkDropListGroup",""]],inputs:{disabled:[2,"cdkDropListGroupDisabled","disabled",Wt]},exportAs:["cdkDropListGroup"],features:[pi([{provide:Cr,useExisting:i}])]})}return i})(),on=(()=>{class i{element=g(Ze);_changeDetectorRef=g(ze);_scrollDispatcher=g(Ba);_dir=g(Wi,{optional:!0});_group=g(Cr,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new be;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=g($a).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new R;entered=new R;exited=new R;sorted=new R;_unsortedItems=new Set;constructor(){let e=g(io,{optional:!0}),t=g(Nn);this._dropListRef=Ds(t,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(n,r)=>this.enterPredicate(n.data,r.data),this._dropListRef.sortPredicate=(n,r,a)=>this.sortPredicate(n,r.data,a.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),i._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(t=>t._dragRef))}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let t=this._latestSortedRefs.indexOf(e._dragRef);t>-1&&(this._latestSortedRefs.splice(t,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,t)=>
vendor: 4,445 bytes, line 15
15e._dragRef.getVisibleElement().compareDocumentPosition(t._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=i._dropLists.indexOf(this);e>-1&&i._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(li(this._dir.value),St(this._destroyed)).subscribe(t=>e.withDirection(t)),e.beforeStarted.subscribe(()=>{let t=Ua(this.connectedTo).map(n=>{if(typeof n=="string"){let r=i._dropLists.find(a=>a.id===n);return r}return n});if(this._group&&this._group._items.forEach(n=>{t.indexOf(n)===-1&&t.push(n)}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(r=>r.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let n=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(n)}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=Qo(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(t.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(t=>t._dragRef)),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(t=>{this.entered.emit({container:this,item:t.item.data,currentIndex:t.currentIndex})}),e.exited.subscribe(t=>{this.exited.emit({container:this,item:t.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(t=>{this.sorted.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,container:this,item:t.item.data})}),e.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,item:t.item.data,isPointerOverContainer:t.isPointerOverContainer,distance:t.distance,dropPoint:t.dropPoint,event:t.event}),this._changeDetectorRef.markForCheck()}),Li(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(e){let{lockAxis:t,draggingDisabled:n,sortingDisabled:r,listAutoScrollDisabled:a,listOrientation:l}=e;this.disabled=n??!1,this.sortingDisabled=r??!1,this.autoScrollDisabled=a??!1,this.orientation=l||"vertical",this.lockAxis=t||null}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(t,n){t&2&&(P("id",n.id),W("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",Wt],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",Wt],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",Wt],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",Wt]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[pi([{provide:Cr,useValue:void 0},{provide:Fs,useExisting:i}])]})}return i})();var Hc=new Ke("CdkDragPlaceholder"),P1=(()=>{class i{templateRef=g(Bi);_drag=g(gr,{optional:!0});data;constructor(){this._drag?._setPlaceholderTemplate(this)}ngOnDestroy(){this._drag?._resetPlaceholderTemplate(this)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["ng-template","cdkDragPlaceholder",""]],inputs:{data:"data"},features:[pi([{provide:Hc,useExisting:i}])]})}return i})();var Mi=(()=>
15{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=rt({type:i});static \u0275inj=ot({providers:[Vc],imports:[Va]})}return i})();var Kc=(()=>{class i{create(e){return typeof MutationObserver>"u"?null:new MutationObserver(e)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var xr=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=rt({type:i});static \u0275inj=ot({providers:[Kc]})}return i})();var vi=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected=null;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new be;constructor(o=!1,e,t=!0,n){this._multiple=o,this._emitChanges=t,this.compareWith=n,e&&e.length&&(o?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...o){this._verifyValueAssignment(o),o.forEach(t=>this._markSelected(t));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...o){this._verifyValueAssignment(o),o.forEach(t=>this._unmarkSelected(t));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...o){this._verifyValueAssignment(o);let e=this.selected,t=new Set(o.map(r=>this._getConcreteValue(r)));o.forEach(r=>this._markSelected(r)),e.filter(r=>!t.has(this._getConcreteValue(r,t))).forEach(r=>this._unmarkSelected(r));let n=this._hasQueuedChanges();return this._emitChangeEvent(),n}toggle(o){return this.isSelected(o)?this.deselect(o):this.select(o)}clear(o=!0){this._unmarkAll();let e=this._hasQueuedChanges();return o&&this._emitChangeEvent(),e}isSelected(o){return this._selection.has(this._getConcreteValue(o))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(o){this._multiple&&this.selected&&this._selected.sort(o)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(o){o=this._getConcreteValue(o),this.isSelected(o)||(this._multiple||this._unmarkAll(),this.isSelected(o)||this._selection.add(o),this._emitChanges&&this._selectedToEmit.push(o))}_unmarkSelected(o){o=this._getConcreteValue(o),this.isSelected(o)&&(this._selection.delete(o),this._emitChanges&&this._deselectedToEmit.push(o))}_unmarkAll(){this.isEmpty()||this._selection.forEach(o=>this._unmarkSelected(o))}_verifyValueAssignment(o){o.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(o,e){if(this.compareWith){e=e??this._selection;for(let t of e)if(this.compareWith(o,t))return t;return o}else return o}};var Gc=200,oo=class{_letterKeyStream=new be;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new be;selectedItem=this._selectedItem;constructor(o,e){let t=typeof e?.debounceInterval=="number"?e.debounceInterval:Gc;e?.skipPredicate&&(this._skipPredicateFn=e.skipPredicate),this.setItems(o),this._setupKeyHandler(t)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(o){this._selectedItemIndex=o}setItems(o){this._items=o}handleKey(o){let e=o.keyCode;o.key&&o.key.length===1?this._letterKeyStream.next(o.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(o){this._letterKeyStream.pipe(V(e=>this._pressedLetters.push(e)),pn(o),We(()=>this._pressedLetters.length>0),S(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(e=>{for(let t=1;t<this._items.length+1;t++){let n=(this._selectedItemIndex+t)%this._items.length,r=this._items[n];if(!this._skipPredicateFn?.(r)&&r.getLabel?.().toLocaleUpperCase().trim().indexOf(e)===0){this._selectedItem.next(r);break}}this._pressedLetters=[]})}};function wi(i){return Ai(i)?i:M(i)}var Sr=class{_activeItemIndex=-1;_activeItem=null;_shouldActivationFollowFocus=!1;_horizontalOrientation="ltr";_skipPredicateFn=o=>!1;_trackByFn=o=>o;_items=[];_typeahead;
15_typeaheadSubscription=At.EMPTY;_hasInitialFocused=!1;_initializeFocus(){if(this._hasInitialFocused||this._items.length===0)return;let o=0;for(let t=0;t<this._items.length;t++)if(!this._skipPredicateFn(this._items[t])&&!this._isItemDisabled(this._items[t])){o=t;break}let e=this._items[o];e.makeFocusable?(this._activeItem?.unfocus(),this._activeItemIndex=o,this._activeItem=e,this._typeahead?.setCurrentSelectedItemIndex(o),e.makeFocusable()):this.focusItem(o),this._hasInitialFocused=!0}constructor(o,e){o instanceof sa?(this._items=o.toArray(),o.changes.subscribe(t=>this._itemsChanged(t.toArray()))):Ai(o)?o.subscribe(t=>this._itemsChanged(t)):(this._items=o,this._initializeFocus()),typeof e.shouldActivationFollowFocus=="boolean"&&(this._shouldActivationFollowFocus=e.shouldActivationFollowFocus),e.horizontalOrientation&&(this._horizontalOrientation=e.horizontalOrientation),e.skipPredicate&&(this._skipPredicateFn=e.skipPredicate),e.trackBy&&(this._trackByFn=e.trackBy),typeof e.typeAheadDebounceInterval<"u"&&this._setTypeAhead(e.typeAheadDebounceInterval)}change=new be;destroy(){this._typeaheadSubscription.unsubscribe(),this._typeahead?.destroy(),this.change.complete()}onKeydown(o){switch(o.key){case"Tab":return;case"ArrowDown":this._focusNextItem();break;case"ArrowUp":this._focusPreviousItem();break;case"ArrowRight":this._horizontalOrientation==="rtl"?this._collapseCurrentItem():this._expandCurrentItem();break;case"ArrowLeft":this._horizontalOrientation==="rtl"?this._expandCurrentItem():this._collapseCurrentItem();break;case"Home":this._focusFirstItem();break;case"End":this._focusLastItem();break;case"Enter":case" ":this._activateCurrentItem();break;default:if(o.key==="*"){this._expandAllItemsAtCurrentItemLevel();break}this._typeahead?.handleKey(o);return}this._typeahead?.reset(),o.preventDefault()}getActiveItemIndex(){return this._activeItemIndex}getActiveItem(){return this._activeItem}_itemsChanged(o){this._hasInitialFocused&&this._activeItem&&!o.includes(this._activeItem)&&(this._activeItem=null,this._hasInitialFocused=!1),this._items=o,this._typeahead?.setItems(this._items),this._updateActiveItemIndex(this._items),this._initializeFocus()}_focusFirstItem(){this.focusItem(this._findNextAvailableItemIndex(-1))}_focusLastItem(){this.focusItem(this._findPreviousAvailableItemIndex(this._items.length))}_focusNextItem(){this.focusItem(this._findNextAvailableItemIndex(this._activeItemIndex))}_focusPreviousItem(){this.focusItem(this._findPreviousAvailableItemIndex(this._activeItemIndex))}focusItem(o,e={}){e.emitChangeEvent??=!0;let t=typeof o=="number"?o:this._items.findIndex(a=>this._trackByFn(a)===this._trackByFn(o));if(t<0||t>=this._items.length)return;let n=this._items[t];if(this._activeItem!==null&&this._trackByFn(n)===this._trackByFn(this._activeItem))return;let r=this._activeItem;this._activeItem=n??null,this._activeItemIndex=t,this._typeahead?.setCurrentSelectedItemIndex(t),this._activeItem?.focus(),r?.unfocus(),e.emitChangeEvent&&this.change.next(this._activeItem),this._shouldActivationFollowFocus&&this._activateCurrentItem()}_updateActiveItemIndex(o){let e=this._activeItem;if(!e)return;let t=o.findIndex(n=>this._trackByFn(n)===this._trackByFn(e));t>-1&&t!==this._activeItemIndex&&(this._activeItemIndex=t,this._typeahead?.setCurrentSelectedItemIndex(t))}_setTypeAhead(o){this._typeahead=new oo(this._items,{debounceInterval:typeof o=="number"?o:void 0,skipPredicate:e=>this._skipPredicateFn(e)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(e=>{this.focusItem(e)})}_findNextAvailableItemIndex(o){for(let e=o+1;e<this._items.length;e++)if(!this._skipPredicateFn(this._items[e]))return e;return o}_findPreviousAvailableItemIndex(o){for(let e=o-1;e>=0;e--)if(!this._skipPredicateFn(this._items[e]))return e;return o}_collapseCurrentItem(){if(this._activeItem)if(this._isCurrentItemExpanded())this._activeItem.collapse();else{let o=this._activeItem.getParent();if(!o||this._skipPredicateFn(o))return;this.focusItem(o)}}_expandCurrentItem(){this._activeItem&&(this._isCurrentItemExpanded()?wi(this._activeItem.getChildren()).pipe(tt(1)).subscribe(o=>{let e=o.find(t=>!this._skipPredicateFn(t));e&&this.focusItem(e)}):this._activeItem.expand())}_isCurrentItemExpanded(){return this._activeItem?typeof this._activeItem.isExpanded=="boolean"?this._activeItem.isExpanded:this._activeItem.isExpanded():!1}_isItemDisabled(o){return typeof o.isDisabled=="boolean"?o.isDisabled:o.isDisabled?.()}_expandAllItemsAtCurrentItemLevel(){if(!this._activeItem)return;let o=this._activeItem.getParent(),e;o?e=wi(o.getChildren()):e=M(this._items.filter(t=>t.getParent()===null)),e.pipe(tt(1)).subscribe(t=>{for(let n of t)n.expand()})}_activateCurrentItem(){this._activeItem?.activate()}},Os=new Ke("tree-key-manager",{providedIn:"root",factory:()=>(i,o)=>new Sr(i,o)});var Tr=class{dataNodes;expansionModel=new vi(!0);trackBy;getLevel;isExpandable;getChildren;toggle(o){this.expansionModel.toggle(this._trackByValue(o))}expand(o){this.expansionModel.select(this._trackByValue(o))}collapse(o){this.expansionModel.deselect(this._trackByValue(o))}isExpanded(o){return this.expansionModel.isSelected(this._trackByValue(o))}toggleDescendants(o){this.expansionModel.isSelected(this._trackByValue(o))?this.collapseDescendants(o):this.expandDescendants(o)}collapseAll(){this.expansionModel.clear()}expandDescendants(o){let e=[o];e.push(...this.getDescendants(o)),this.expansionModel.select(...e.map(t=>this._trackByValue(t)))}collapseDescendants(o){let e=[o];e.push(...this.getDescendants(o)),this.expansionModel.deselect(...e.map(t=>this._trackByValue(t)))}_trackByValue(o){return this.trackBy?this.trackBy(o):o}},ro=class extends Tr{getLevel;isExpandable;options;constructor(o,e,t){super(),this.getLevel=o,this.isExpandable=e,this.options=t,this.options&&(this.trackBy=this.options.trackBy)}getDescendants(o){let e=this.dataNodes.indexOf(o),t=[];for(let n=e+1;n<this.dataNodes.length&&this.getLevel(o)<this.getLevel(this.dataNodes[n]);n++)t.push(this.dataNodes[n]);return t}
15expandAll(){this.expansionModel.select(...this.dataNodes.map(o=>this._trackByValue(o)))}};var qc=new Ke("CDK_TREE_NODE_OUTLET_NODE"),Ps=(()=>{class i{viewContainer=g(Vi);_node=g(qc,{optional:!0});constructor(){}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["","cdkTreeNodeOutlet",""]]})}return i})(),Dr=class{$implicit;level;index;count;constructor(o){this.$implicit=o}},Er=(()=>{class i{template=g(Bi);when;constructor(){}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:[0,"cdkTreeNodeDefWhen","when"]}})}return i})();function Ns(){return Error("Could not find a tree control, levelAccessor, or childrenAccessor for the tree.")}var Sn=(()=>{class i{_differs=g(xa);_changeDetectorRef=g(ze);_elementRef=g(Ze);_dir=g(Wi);_onDestroy=new be;_dataDiffer;_defaultNodeDef=null;_dataSubscription;_levels=new Map;_parents=new Map;_ariaSets=new Map;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&this._switchDataSource(e)}_dataSource;treeControl;levelAccessor;childrenAccessor;trackBy;expansionKey;_nodeOutlet;_nodeDefs;viewChange=new oe({start:0,end:Number.MAX_VALUE});_expansionModel;_flattenedNodes=new oe([]);_nodeType=new oe(null);_nodes=new oe(new Map);_keyManagerNodes=new oe([]);_keyManagerFactory=g(Os);_keyManager;_viewInit=!1;constructor(){}ngAfterContentInit(){this._initializeKeyManager()}ngAfterContentChecked(){this._updateDefaultNodeDefinition(),this._subscribeToDataChanges()}ngOnDestroy(){this._nodeOutlet.viewContainer.clear(),this._nodes.complete(),this._keyManagerNodes.complete(),this._nodeType.complete(),this._flattenedNodes.complete(),this.viewChange.complete(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&typeof this._dataSource.disconnect=="function"&&this.dataSource.disconnect(this),this._dataSubscription?.unsubscribe(),this._dataSubscription=void 0,this._keyManager?.destroy()}ngOnInit(){this._checkTreeControlUsage(),this._initializeDataDiffer()}ngAfterViewInit(){this._viewInit=!0}_updateDefaultNodeDefinition(){let e=this._nodeDefs.filter(t=>!t.when);e.length>1,this._defaultNodeDef=e[0]}_setNodeTypeIfUnset(e){this._nodeType.value===null&&this._nodeType.next(e)}_switchDataSource(e){this._dataSource&&typeof this._dataSource.disconnect=="function"&&this.dataSource.disconnect(this),this._dataSubscription?.unsubscribe(),this._dataSubscription=void 0,e||this._nodeOutlet.viewContainer.clear(),this._dataSource=e,this._nodeDefs&&this._subscribeToDataChanges()}_getExpansionModel(){return this.treeControl?this.treeControl.expansionModel:(this._expansionModel??=new vi(!0),this._expansionModel)}_subscribeToDataChanges(){if(this._dataSubscription)return;let e;Jo(this._dataSource)?e=this._dataSource.connect(this):Ai(this._dataSource)?e=this._dataSource:Array.isArray(this._dataSource)&&(e=M(this._dataSource)),e&&(this._dataSubscription=this._getRenderData(e).pipe(St(this._onDestroy)).subscribe(t=>{this._renderDataChanges(t)}))}_getRenderData(e){let t=this._getExpansionModel();return Ot([e,this._nodeType,t.changed.pipe(li(null),V(n=>{this._emitExpansionChanges(n)}))]).pipe(Re(([n,r])=>r===null?M({renderNodes:n,flattenedNodes:null,nodeType:r}):this._computeRenderingData(n,r).pipe(S(a=>ve(K({},a),{nodeType:r})))))}_renderDataChanges(e){if(e.nodeType===null){this.renderNodeChanges(e.renderNodes);return}this._updateCachedData(e.flattenedNodes),this.renderNodeChanges(e.renderNodes),this._updateKeyManagerItems(e.flattenedNodes)}_emitExpansionChanges(e){if(!e)return;let t=this._nodes.value;for(let n of e.added)t.get(n)?._emitExpansionState(!0);for(let n of e.removed)t.get(n)?._emitExpansionState(!1)}_initializeKeyManager(){let e=Ot([this._keyManagerNodes,this._nodes]).pipe(S(([n,r])=>n.reduce((a,l)=>{let m=r.get(this._getExpansionKey(l));return m&&a.push(m),a},[]))),t={trackBy:n=>this._getExpansionKey(n.data),skipPredicate:n=>!!n.isDisabled,typeAheadDebounceInterval:!0,horizontalOrientation:this._dir.value};this._keyManager=this._keyManagerFactory(e,t)}_initializeDataDiffer(){let e=this.trackBy??((t,n)=>this._getExpansionKey(n));this._dataDiffer=this._differs.find([]).create(e)}_checkTreeControlUsage(){}renderNodeChanges(e,t=this._dataDiffer,n=this._nodeOutlet.viewContainer,r){let a=t.diff(e);!a&&!this._viewInit||(a?.forEachOperation((l,m,b)=>{if(l.previousIndex==null)this.insertNode(e[b],b,n,r);else if(b==null)n.remove(m);else{let T=n.get(m);n.move(T,b)}}),a?.forEachIdentityChange(l=>{let m=l.item;if(l.currentIndex!=null){let b=n.get(l.currentIndex);b.context.$implicit=m}}),r?this._changeDetectorRef.markForCheck():this._changeDetectorRef.detectChanges())}_getNodeDef(e,t){if(this._nodeDefs.length===1)return this._nodeDefs.first;let n=this._nodeDefs.find(r=>r.when&&r.when(t,e))||this._defaultNodeDef;return n}insertNode(e,t,n,r){let a=this._getLevelAccessor(),l=this._getNodeDef(e,t),m=this._getExpansionKey(e),b=new Dr(e);b.index=t,r??=this._parents.get(m)??void 0,a?b.level=a(e):r!==void 0&&this._levels.has(this._getExpansionKey(r))?b.level=this._levels.get(this._getExpansionKey(r))+1:b.level=0,this._levels.set(m,b.level),(n||this._nodeOutlet.viewContainer).createEmbeddedView(l.template,b,t),rn.mostRecentTreeNode&&(rn.mostRecentTreeNode.data=e)}isExpanded(e){return!!(this.treeControl?.isExpanded(e)||this._expansionModel?.isSelected(this._getExpansionKey(e)))}toggle(e){this.treeControl?this.treeControl.toggle(e):this._expansionModel&&this._expansionModel.toggle(this._getExpansionKey(e))}expand(e){this.treeControl?this.treeControl.expand(e):this._expansionModel&&this._expansionModel.select(this._getExpansionKey(e))}collapse(e){this.treeControl?this.treeControl.collapse(e):this._expansionModel&&this._expansionModel.deselect(this._getExpansionKey(e))}toggleDescendants(e){this.treeControl?this.treeControl.toggleDescendants(e):this._expansionModel&&(this.isExpanded(e)?this.collapseDescendants(e):this.expandDescendants(e))}expandDescendants(e){if(this.treeControl)this.treeControl.expandDescendants(e);else if(this._expansionModel){let t=this._expansionModel;t.select(this._getExpansionKey(e)),this._getDescendants(e).pipe(tt(1),St(this._onDestroy)).subscribe(n=>{t.select(...n.map(r=>this._getExpansionKey(r)))})}}collapseDescendants(e){if(this.treeControl)this.treeControl.collapseDescendants(e);else if(this._expansionModel){let t=this._expansionModel;t.deselect(this._getExpansionKey(e)),this._getDescendants(e).pipe(tt(1),St(this._onDestroy)).subscribe(n=>{t.deselect(...n.map(r=>this._getExpansionKey(r)))})}}
15expandAll(){this.treeControl?this.treeControl.expandAll():this._expansionModel&&this._forEachExpansionKey(e=>this._expansionModel?.select(...e))}collapseAll(){this.treeControl?this.treeControl.collapseAll():this._expansionModel&&this._forEachExpansionKey(e=>this._expansionModel?.deselect(...e))}_getLevelAccessor(){return this.treeControl?.getLevel?.bind(this.treeControl)??this.levelAccessor}_getChildrenAccessor(){return this.treeControl?.getChildren?.bind(this.treeControl)??this.childrenAccessor}_getDirectChildren(e){let t=this._getLevelAccessor(),n=this._expansionModel??this.treeControl?.expansionModel;if(!n)return M([]);let r=this._getExpansionKey(e),a=n.changed.pipe(Re(m=>m.added.includes(r)?M(!0):m.removed.includes(r)?M(!1):xe),li(this.isExpanded(e)));if(t)return Ot([a,this._flattenedNodes]).pipe(S(([m,b])=>m?this._findChildrenByLevel(t,b,e,1):[]));let l=this._getChildrenAccessor();if(l)return wi(l(e)??[]);throw Ns()}_findChildrenByLevel(e,t,n,r){let a=this._getExpansionKey(n),l=t.findIndex(O=>this._getExpansionKey(O)===a),m=e(n),b=m+r,T=[];for(let O=l+1;O<t.length;O++){let U=e(t[O]);if(U<=m)break;U<=b&&T.push(t[O])}return T}_registerNode(e){this._nodes.value.set(this._getExpansionKey(e.data),e),this._nodes.next(this._nodes.value)}_unregisterNode(e){this._nodes.value.delete(this._getExpansionKey(e.data)),this._nodes.next(this._nodes.value)}_getLevel(e){return this._levels.get(this._getExpansionKey(e))}_getSetSize(e){return this._getAriaSet(e).length}_getPositionInSet(e){let t=this._getAriaSet(e),n=this._getExpansionKey(e);return t.findIndex(r=>this._getExpansionKey(r)===n)+1}_getNodeParent(e){let t=this._parents.get(this._getExpansionKey(e.data));return t&&this._nodes.value.get(this._getExpansionKey(t))}_getNodeChildren(e){return this._getDirectChildren(e.data).pipe(S(t=>t.reduce((n,r)=>{let a=this._nodes.value.get(this._getExpansionKey(r));return a&&n.push(a),n},[])))}_sendKeydownToKeyManager(e){if(e.target===this._elementRef.nativeElement)this._keyManager.onKeydown(e);else{let t=this._nodes.getValue();for(let[,n]of t)if(e.target===n._elementRef.nativeElement){this._keyManager.onKeydown(e);break}}}_getDescendants(e){if(this.treeControl)return M(this.treeControl.getDescendants(e));if(this.levelAccessor){let t=this._findChildrenByLevel(this.levelAccessor,this._flattenedNodes.value,e,1/0);return M(t)}if(this.childrenAccessor)return this._getAllChildrenRecursively(e).pipe(Uo((t,n)=>(t.push(...n),t),[]));throw Ns()}_getAllChildrenRecursively(e){return this.childrenAccessor?wi(this.childrenAccessor(e)).pipe(tt(1),Re(t=>{for(let n of t)this._parents.set(this._getExpansionKey(n),e);return M(...t).pipe(Lt(n=>qt(M([n]),this._getAllChildrenRecursively(n))))})):M([])}_getExpansionKey(e){return this.expansionKey?.(e)??e}_getAriaSet(e){let t=this._getExpansionKey(e),n=this._parents.get(t),r=n?this._getExpansionKey(n):null;return this._ariaSets.get(r)??[e]}_findParentForNode(e,t,n){if(!n.length)return null;let r=this._levels.get(this._getExpansionKey(e))??0;for(let a=t-1;a>=0;a--){let l=n[a];if((this._levels.get(this._getExpansionKey(l))??0)<r)return l}return null}_flattenNestedNodesWithExpansion(e,t=0){let n=this._getChildrenAccessor();return n?M(...e).pipe(Lt(r=>{let a=this._getExpansionKey(r);this._parents.has(a)||this._parents.set(a,null),this._levels.set(a,t);let l=wi(n(r));return qt(M([r]),l.pipe(tt(1),V(m=>{this._ariaSets.set(a,[...m??[]]);for(let b of m??[]){let T=this._getExpansionKey(b);this._parents.set(T,r),this._levels.set(T,t+1)}}),Re(m=>m?this._flattenNestedNodesWithExpansion(m,t+1).pipe(S(b=>this.isExpanded(r)?b:[])):M([]))))}),Uo((r,a)=>(r.push(...a),r),[])):M([...e])}_computeRenderingData(e,t){if(this.childrenAccessor&&t==="flat")return this._clearPreviousCache(),this._ariaSets.set(null,[...e]),this._flattenNestedNodesWithExpansion(e).pipe(S(n=>({renderNodes:n,flattenedNodes:n})));if(this.levelAccessor&&t==="nested"){let n=this.levelAccessor;return M(e.filter(r=>n(r)===0)).pipe(S(r=>({renderNodes:r,flattenedNodes:e})),V(({flattenedNodes:r})=>{this._calculateParents(r)}))}else return t==="flat"?M({renderNodes:e,flattenedNodes:e}).pipe(V(({flattenedNodes:n})=>{this._calculateParents(n)})):(this._clearPreviousCache(),this._ariaSets.set(null,[...e]),this._flattenNestedNodesWithExpansion(e).pipe(S(n=>({renderNodes:e,flattenedNodes:n}))))}_updateCachedData(e){this._flattenedNodes.next(e)}_updateKeyManagerItems(e){this._keyManagerNodes.next(e)}_calculateParents(e){let t=this._getLevelAccessor();if(t){this._clearPreviousCache();for(let n=0;n<e.length;n++){let r=e[n],a=this._getExpansionKey(r);this._levels.set(a,t(r));let l=this._findParentForNode(r,n,e);this._parents.set(a,l);let m=l?this._getExpansionKey(l):null,b=this._ariaSets.get(m)??[];b.splice(n,0,r),this._ariaSets.set(m,b)}}}_forEachExpansionKey(e){let t=[],n=[];this._nodes.value.forEach(r=>{t.push(this._getExpansionKey(r.data)),n.push(this._getDescendants(r.data))}),n.length>0?Ot(n).pipe(tt(1),St(this._onDestroy)).subscribe(r=>{r.forEach(a=>
15a.forEach(l=>t.push(this._getExpansionKey(l)))),e(t)}):e(t)}_clearPreviousCache(){this._parents.clear(),this._levels.clear(),this._ariaSets.clear()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=L({type:i,selectors:[["cdk-tree"]],contentQueries:function(t,n,r){if(t&1&&It(r,Er,5),t&2){let a;le(a=ce())&&(n._nodeDefs=a)}},viewQuery:function(t,n){if(t&1&&Ge(Ps,7),t&2){let r;le(r=ce())&&(n._nodeOutlet=r.first)}},hostAttrs:["role","tree",1,"cdk-tree"],hostBindings:function(t,n){t&1&&x("keydown",function(a){return n._sendKeydownToKeyManager(a)})},inputs:{dataSource:"dataSource",treeControl:"treeControl",levelAccessor:"levelAccessor",childrenAccessor:"childrenAccessor",trackBy:"trackBy",expansionKey:"expansionKey"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(t,n){t&1&&vt(0,0)},dependencies:[Ps],encapsulation:2})}return i})(),rn=(()=>{class i{_elementRef=g(Ze);_tree=g(Sn);_tabindex=-1;_type="flat";get role(){return"treeitem"}set role(e){}get isExpandable(){return this._isExpandable()}set isExpandable(e){this._inputIsExpandable=e,!(this.data&&!this._isExpandable||!this._inputIsExpandable)&&(this._inputIsExpanded?this.expand():this._inputIsExpanded===!1&&this.collapse())}get isExpanded(){return this._tree.isExpanded(this._data)}set isExpanded(e){this._inputIsExpanded=e,e?this.expand():this.collapse()}isDisabled=!1;typeaheadLabel=null;getLabel(){return this.typeaheadLabel||this._elementRef.nativeElement.textContent?.trim()||""}activation=new R;expandedChange=new R;static mostRecentTreeNode=null;_destroyed=new be;_dataChanges=new be;_inputIsExpandable=!1;_inputIsExpanded=void 0;_shouldFocus=!0;_parentNodeAriaLevel;get data(){return this._data}set data(e){e!==this._data&&(this._data=e,this._dataChanges.next())}_data;get isLeafNode(){return this._tree.treeControl?.isExpandable!==void 0&&!this._tree.treeControl.isExpandable(this._data)?!0:this._tree.treeControl?.isExpandable===void 0&&this._tree.treeControl?.getDescendants(this._data).length===0}get level(){return this._tree._getLevel(this._data)??this._parentNodeAriaLevel}_isExpandable(){return this._tree.treeControl?!this.isLeafNode:this._inputIsExpandable}_getAriaExpanded(){return this._isExpandable()?String(this.isExpanded):null}_getSetSize(){return this._tree._getSetSize(this._data)}_getPositionInSet(){return this._tree._getPositionInSet(this._data)}_changeDetectorRef=g(ze);constructor(){i.mostRecentTreeNode=this}ngOnInit(){this._parentNodeAriaLevel=Wc(this._elementRef.nativeElement),this._tree._getExpansionModel().changed.pipe(S(()=>this.isExpanded),_t(),St(this._destroyed)).pipe(St(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._tree._setNodeTypeIfUnset(this._type),this._tree._registerNode(this)}ngOnDestroy(){i.mostRecentTreeNode===this&&(i.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}getParent(){return this._tree._getNodeParent(this)??null}getChildren(){return this._tree._getNodeChildren(this)}focus(){this._tabindex=0,this._shouldFocus&&this._elementRef.nativeElement.focus(),this._changeDetectorRef.markForCheck()}unfocus(){this._tabindex=-1,this._changeDetectorRef.markForCheck()}activate(){this.isDisabled||this.activation.next(this._data)}collapse(){this.isExpandable&&this._tree.collapse(this._data)}expand(){this.isExpandable&&this._tree.expand(this._data)}makeFocusable(){this._tabindex=0,this._changeDetectorRef.markForCheck()}_focusItem(){this.isDisabled||this._tree._keyManager.focusItem(this)}_setActiveItem(){this.isDisabled||(this._shouldFocus=!1,this._tree._keyManager.focusItem(this),this._shouldFocus=!0)}_emitExpansionState(e){this.expandedChange.emit(e)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["cdk-tree-node"]],hostAttrs:["role","treeitem",1,"cdk-tree-node"],hostVars:5,hostBindings:function(t,n){t&1&&x("click",function(){return n._setActiveItem()})("focus",function(){return n._focusItem()}),t&2&&(ha("tabIndex",n._tabindex),P("aria-expanded",n._getAriaExpanded())("aria-level",n.level+1)("aria-posinset",n._getPositionInSet())("aria-setsize",n._getSetSize()))},inputs:{role:"role",isExpandable:[2,"isExpandable","isExpandable",Wt],isExpanded:"isExpanded",isDisabled:[2,"isDisabled","isDisabled",Wt],typeaheadLabel:[0,"cdkTreeNodeTypeaheadLabel","typeaheadLabel"]},outputs:{activation:"activation",expandedChange:"expandedChange"},exportAs:["cdkTreeNode"]})}return i})();function Wc(i){let o=i.parentElement;for(;o&&!zc(o);)o=o.parentElement;return o?o.classList.contains("cdk-nested-tree-node")?Ki(o.getAttribute("aria-level")):0:-1}function zc(i){let o=i.classList;return!!(o?.contains("cdk-nested-tree-node")||o?.contains("cdk-tree"))}var jc=/([A-Za-z%]+)$/,ks=(()=>{class i{_treeNode=g(rn);_tree=g(Sn);_element=g(Ze);_dir=g(Wi,{optional:!0});_currentPadding=null;_destroyed=new be;indentUnits="px";get level(){return this._level}set level(e){this._setLevelInput(e)}_level;get indent(){return this._indent}set indent(e){this._setIndentInput(e)}_indent=40;constructor(){this._setPadding(),this._dir?.change.pipe(St(this._destroyed)).subscribe(()=>this._setPadding(!0)),this._treeNode._dataChanges.subscribe(()=>this._setPadding())}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_paddingIndent(){let e=(this._treeNode.data&&this._tree._getLevel(this._treeNode.data))??null,t=this._level==null?e:this._level;return typeof t=="number"?`${t*this._indent}${this.indentUnits}`:null}_setPadding(e=!1){let t=this._paddingIndent();if(t!==this._currentPadding||e){let n=this._element.nativeElement,r=this._dir&&this._dir.value==="rtl"?"paddingRight":"paddingLeft",a=r==="paddingLeft"?"paddingRight":"paddingLeft";n.style[r]=t||"",n.style[a]="",this._currentPadding=t}}_setLevelInput(e){this._level=isNaN(e)?null:e,this._setPadding()}_setIndentInput(e){let t=e,n="px";if(typeof e=="string"){let r=e.split(jc);t=r[0],n=r[1]||n}this.indentUnits=n,this._indent=Ki(t),this._setPadding()}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:[2,"cdkTreeNodePadding","level",Ki],indent:[0,"cdkTreeNodePaddingIndent","indent"]}})}return i})(),Rs=(()=>{class i{_tree=g(Sn);_treeNode=g(rn);recursive=!1;constructor(){}_toggle(e){e.stopPropagation(),this.recursive?this._tree.toggleDescendants(this._treeNode.data):this._tree.toggle(this._treeNode.data),this._tree._keyManager.focusItem(this._treeNode)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Ae({type:i,selectors:[["","cdkTreeNodeToggle",""]],hostAttrs:["tabindex","-1"],hostBindings:function(t,n){t&1&&x("click",function(a){return n._toggle(a)})("keydown.Enter",function(a){return n._toggle(a),a.preventDefault()})("keydown.Space",function(a){return n._toggle(a),a.preventDefault()})},inputs:{recursive:[2,"cdkTreeNodeToggleRecursive","recursive",Wt]}})}return i})();var Tn=(()=>
15{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=rt({type:i});static \u0275inj=ot({})}return i})();var Yc=new Ke("auth.config"),Qc={guestRoutes:["/register"]},Ls=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=rt({type:i})}static{this.\u0275inj=ot({providers:[{provide:Yc,useValue:Qc}]})}}return i})();var Gt=(function(i){return i[i.UNAUTHORIZED=401]="UNAUTHORIZED",i[i.FORBIDDEN=403]="FORBIDDEN",i[i.NOT_FOUND=404]="NOT_FOUND",i[i.CONFLICT=409]="CONFLICT",i[i.CONTENT_TOO_LARGE=413]="CONTENT_TOO_LARGE",i[i.LOCKED=423]="LOCKED",i[i.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",i})(Gt||{});var Us=(()=>{class i{constructor(){this._authStorageService=g(Bn),this._feedbackService=g(pt)}intercept(e,t){if(e.url.includes("aws")||e.url.includes("blob"))return t.handle(e);let n=this._authStorageService.load();if(!n)return t.handle(e);let r=n.token,a=Bt.isNullOrEmpty(r)?e:e.clone({setHeaders:{Authorization:`Bearer ${r}`}});return t.handle(a).pipe(k(l=>(l.status===Gt.LOCKED&&this._feedbackService.showErrorModal("common.error_aggregate_locked"),Ri(()=>l))))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Bs=(()=>{class i{intercept(e,t){let n="Content-Type",r="Accept",a="application/json";return e.headers.has(n)?e.headers.get(n)==="empty"?e=e.clone({headers:e.headers.delete(n)}):e.headers.get(n)==="eTracker"&&(e=e.clone({headers:e.headers.delete(n)}),e=e.clone({headers:e.headers.delete("authorization")})):e=e.clone({headers:e.headers.set(n,a)}),e.headers.has(r)||(e=e.clone({headers:e.headers.set(r,a)})),t.handle(e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac})}}return i})();var Ir=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=rt({type:i})}static{this.\u0275inj=ot({providers:[{provide:qo,useClass:Us,multi:!0},{provide:qo,useClass:Bs,multi:!0}],imports:[mn,Ls]})}}return i})();function Zc(i,o){if(i&1&&y(0,"iframe",1),i&2){let e=p();f("ngClass",e.isFullscreen?"context-iframe-fullscreen":"context-iframe")("src",o,la)}}var ao=(()=>{class i{constructor(){this._configService=g(Se),this._documentAccessService=g(ei),this._feedbackService=g(pt),this._sanitizer=g(Ma),this._translocoService=g(ae),this.isFullscreen=!1,this._allowedDomains=["http://localhost:9452","http://localhost:9520","https://nautos-dev.dev.aks-din.net","https://nautos-dev2.dev.aks-din.net","nautos.de","shi-jenkins","stage"],this._baseUrl=this._configService.baseConfig.baseUrl.replace("/apis/api",""),this.visibilityChange=new R}onMessage(e){if(this.allowWindowEvent(e)){let t;switch(e.data.type){case"OPEN_DASHBOARD":this.visibilityChange.emit(),this.licenseLockId&&this._documentAccessService.closeDocument(this.licenseLockId);break;case"TOGGLE_FULLSCREEN":this.isFullscreen=!this.isFullscreen;break;case"GET_AUTH_TOKEN":t={type:"AUTH_TOKEN",data:this._octaToken},e.source.postMessage(t,"*");break;case"APPLICATION_STARTUP_FAILED":this.contextAppStartError(),this.visibilityChange.emit(),this.licenseLockId&&this._documentAccessService.closeDocument(this.licenseLockId);break;default:break}}}ngOnInit(){let e=this._translocoService.getActiveLang()||"de";this.contextUrl$=this._documentAccessService.getContextToken(this.documentToOpenDin21Id,this.licenseLockId).pipe(S(t=>t?(this._octaToken=t.octaToken,this._sanitizer.bypassSecurityTrustResourceUrl(`${this._baseUrl}/nv/doc?contextid=octa&lang=${e}&din21id=${this.documentToOpenDin21Id}`)):""),V(()=>{setTimeout(()=>{let t=document.getElementsByClassName("container-announcement").length>0,n=0;t&&(n=document.getElementsByClassName("container-announcement")[0].clientHeight);let r=document.getElementsByClassName("context-wrapper")[0];r.style.height=`calc(100% - ${n+64}px)`,r.style.top=`${n+64}px`;let a=document.getElementsByClassName("context-iframe")[0];a.style.height=`calc(100% - ${n+64}px)`,a.style.top=`${n+64}px`})}),k(t=>(this.contextAppStartError(t),this.visibilityChange.emit(),this.licenseLockId&&this._documentAccessService.closeDocument(this.licenseLockId),xe)))}allowWindowEvent(e){let t=e.origin;return!!this._allowedDomains.filter(r=>{if(t.indexOf(r)>-1)return t.substr(r)})}contextAppStartError(e=null){e&&console.error("%i %s",e.status,e.message),this._feedbackService.showErrorModal()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-context"]],hostBindings:function(t,n){t&1&&x("message",function(a){return n.onMessage(a)},ca)},inputs:{documentToOpenDin21Id:"documentToOpenDin21Id",licenseLockId:"licenseLockId"},outputs:{visibilityChange:"visibilityChange"},decls:3,vars:3,consts:[[1,"context-wrapper"],["title","Context",3,"ngClass","src"]],template:function(t,n){if(t&1&&(y(0,"div",0),u(1,Zc,1,2,"iframe",1),h(2,"async")),t&2){let r;s(),_((r=C(2,1,n.contextUrl$))?1:-1,r)}},dependencies:[Oe,lt,ct],styles:[".context-iframe[_ngcontent-%COMP%]{position:fixed;border:none;width:calc(100% - 4rem);left:4rem;z-index:800}.context-iframe-fullscreen[_ngcontent-%COMP%]{border:none;z-index:1010;width:100%;height:100%;position:fixed;top:0;left:0}.context-wrapper[_ngcontent-%COMP%]{position:fixed;opacity:.5;background-color:var(--color-primary-dark);width:100%;left:4rem;z-index:799}"],changeDetection:0})}}return i})();var Ie=(function(i){return i[i.TRUE=1]="TRUE",i[i.FALSE=-1]="FALSE",i[i.PARTIALLY=0]="PARTIALLY",i})(Ie||{});var so=(()=>{class i{constructor(){this._httpClient=g(Fe),this._configService=g(Se),this._extendedBaseUrl=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}`}getAll(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/files`;return this._httpClient.post(e,{})}setMultipleStatus(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/status`;return this._httpClient.put(t,[...e])}setStatus(e,t){return this.setMultipleStatus([{hostedFileId:e,status:t}])}getHostedFilesPagedAndFiltered(e,t,n,r,a){--e;let l=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/files?pageNumber=${e}&pageSize=${t}&sortField=${n}&sortDir=${r}`;return this._httpClient.post(l,a,{observe:"response"}).pipe(S(function(m){return ne.isAccepted(m.status)?m.body:null}),k(()=>M(null)))}deleteHostedFiles(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile?hostedFileIds=${e.join("&hostedFileIds=")}`;return this._httpClient.delete(t,{observe:"response"})}renameHostedFile(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/rename`,r={hostedFileId:e,fileName:t};return this._httpClient.put(n,r,{observe:"response"})}linkHostedFileToMetadata(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/link`,r={hostedFileId:e.hostedFileId,linkDocuments:t.map(a=>
15({acCode:a.acCode,documentNumber:a.documentNumber,publicationDate:a.dateOfIssue})),language:"de",documentType:"trule"};return this._httpClient.put(n,r,{observe:"response"})}getForbiddenNameCharacters(){return this.getHostingConfig().pipe(S(e=>e.fileNameForbiddenChars))}cancelAllNewUploadsForUser(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/status/cancellation`;return this._httpClient.put(e,{})}createAsCancelled(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/cancelled`;return this._httpClient.post(t,e)}uploadCsvFile(e){let t=i.getHeaders(),n=new FormData;n.append("file",e.file),n.append("encoding",e.encoding),n.append("fieldSeparator",e.fieldSeparator),n.append("escapeChar",e.escapeChar),n.append("textQualifier",e.textQualifier);let r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/import`;return this._httpClient.post(r,n,{headers:t}).pipe(S(a=>{let l=a.templateErrors?.length<1?"common.import.import_successful":"common.import.import_failed",m=a.templateErrors?.length>0?Ie.FALSE:Ie.TRUE;a?.numCreated&&a?.numUpdated&&a?.notSuccessful&&a.numCreated+a.numUpdated<=0&&(a.notSuccessful===0?(m=Ie.TRUE,l="common.import.import_successful"):(m=Ie.FALSE,l="common.import.import_failed"));let b=a.templateErrors;return{success:m,errors:b,headline:l,numCreated:null,numDeleted:a.numDeleted,numUpdated:a.numUpdated,notSuccessful:a.notSuccessful}}))}updateDocumentLinksMetadata(e,t,n,r,a){let l={fileContentIds:e,description:n,language:r,documentType:a},m=`${this._extendedBaseUrl}/files/hostedfile/updatelinks/${t}`;return this._httpClient.put(m,l,{observe:"response"})}getHostingConfig(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/config`;return this._httpClient.get(e)}static getHeaders(){let e=new Mt;return e=e.append("Content-Type","empty"),e=e.append("Accept","*/*"),e=e.append("Response-Type","text/csv"),e}requestDocumentCsvExport(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/export`;return this._httpClient.post(e,void 0,{observe:"response"})}getCsvTemplate(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/template`;return this._httpClient.get(e,{responseType:"text"})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Dn=(function(i){return i.NONE="None",i.NEW="New",i.UPLOADING="Uploading",i.VALIDATING="Validating",i.DONE="Done",i.UPLOAD_FAILED="UploadFailed",i.VALIDATION_FAILED="ValidationFailed",i.TIMEOUT_FAILED="TimeoutFailed",i})(Dn||{});var Oi=(function(i){return i.HOSTING_EXPLORER_CURRENTLY_UPLOADING="uploadingHostedFileIds",i.UNPROCESSED_FILE_NAMES="unprocessedFileNames",i})(Oi||{});var Vs=(()=>{class i{addStringToArray(e,t){this.addStringsToArray(e,[t])}addStringsToArray(e,t){let n=this.getArray(e);t.forEach(r=>{n.includes(r)||n.push(r)}),localStorage.setItem(e,JSON.stringify(n))}clearArray(e){localStorage.setItem(e,JSON.stringify([]))}removeStringFromArray(e,t){return this.removeStringsFromArray(e,[t])}removeStringsFromArray(e,t){let n=this.getArray(e);return t.forEach(r=>{let a=n.indexOf(r);for(;a>-1;)n.splice(a,1),a=n.indexOf(r)}),localStorage.setItem(e,JSON.stringify(n)),n}getArray(e){let t=localStorage.getItem(e);return t?JSON.parse(t):[]}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var lo=(()=>{class i{constructor(){this._httpClient=g(Fe),this._configService=g(Se),this._hostedFileService=g(so),this._localStorageHelperService=g(Vs),this._favoritesService=g(Xt),this.isCurrentlyUploading=!1}bulkUploadFiles(e,t){this._localStorageHelperService.addStringsToArray(Oi.UNPROCESSED_FILE_NAMES,e.map(r=>r.name));let n=e.map(r=>({acCode:null,linkFileContent:!1,licenseIdsToLink:[],file:{file:r,fileName:r.name,description:null,language:null,documentType:null,documentNumber:null,publicationDate:null}}));return this.uploadMultipleFiles(n,t)}
15upsertHostedFiles(e,t,n){let r=e.filter(l=>l.type===B.FILE_HOSTED&&l.saved===void 0),a=e.filter(l=>l.type===B.FILE_HOSTED&&l.saved===!1&&l.hostedFile);r.length!==0&&this.uploadLinkedFiles(r,n,t.tenantId).subscribe(),a.forEach(l=>{this.uploadLinkedFiles([l],null,t.tenantId).subscribe(m=>{l.hostedFileId=m.file.hostedFileId,this._favoritesService.uploadAcFile(l).subscribe()})})}uploadLinkedFiles(e,t,n){let r=[],a=[];e.forEach(m=>{m.hostedFile&&a.push(m.hostedFile.name),r.push({file:m.hostedFile,description:m.description,language:m.language,documentType:m.documentType,documentNumber:m.documentNumber,publicationDate:m.dateOfIssue,licenseIdsToLink:m.licenseIdsToLink})}),this._localStorageHelperService.addStringsToArray(Oi.UNPROCESSED_FILE_NAMES,a);let l=r.map(m=>({acCode:t,linkFileContent:t!==null,licenseIdsToLink:m.licenseIdsToLink,file:{file:m.file,fileName:m.file.name,description:m.description,language:m.language,documentType:m.documentType,documentNumber:m.documentNumber,publicationDate:m.publicationDate}}));return this.uploadMultipleFiles(l,n)}uploadMultipleFiles(e,t){return this.isCurrentlyUploading=!0,Zr(e).pipe(Lt(n=>(this._localStorageHelperService.removeStringFromArray(Oi.UNPROCESSED_FILE_NAMES,n.file.fileName),this.createHostedFileAndGetPresignedUrlAndUploadFile(n,n.file.file,t))),V(n=>{n!=null&&this._localStorageHelperService.addStringToArray(Oi.HOSTING_EXPLORER_CURRENTLY_UPLOADING,n.file.hostedFileId)}))}downloadFileByDin21Id(e,t){this.getDownloadPresignedUrlsByDin21Ids([e]).subscribe({next:n=>{n!==null&&Array.isArray(n)&&n[0].preSignedUrl!==null&&this.startDownloadWithUrl(n[0].preSignedUrl,t)},error:n=>{console.error("Error downloading file:",n)}})}downloadFileByHostedFileId(e,t){this.getDownloadPresignedUrlsByHostedFileIds([e]).subscribe({next:n=>{n?.files?.[0]?.preSignedUrl&&this.startDownloadWithUrl(n.files[0].preSignedUrl,t)},error:n=>{console.error("Error downloading file:",n)}})}startDownloadWithUrl(e,t){let n=document.createElement("a");n.href=e,n.target="_blank",n.setAttribute("download",t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}createHostedFileAndGetPresignedUrlAndUploadFile(e,t,n){return this.createHostedFileAndGetUploadPresignedUrl(e).pipe(Lt(r=>r==null?M(null):(this._hostedFileService.setStatus(r.file.hostedFileId,Dn.UPLOADING).subscribe(),this.uploadToPresignedUrl(r,t,n).pipe(S(()=>r)).subscribe(),M(r))))}uploadToPresignedUrl(e,t,n){let r=new TextEncoder;return this._httpClient.put(e.file.preSignedUrl,t,{headers:{"x-ms-blob-type":"BlockBlob","x-amz-meta-hosted-file-id":e.file.hostedFileId,"x-amz-meta-original-file-name":btoa(String.fromCharCode.apply(null,r.encode(e.file.originalFileName))),"x-amz-meta-tenant-id":n,"Content-Type":t.type||"application/octet-stream"},observe:"response"}).pipe(V(()=>{this._localStorageHelperService.removeStringFromArray(Oi.HOSTING_EXPLORER_CURRENTLY_UPLOADING,e.file.hostedFileId)?.length||(this.isCurrentlyUploading=!1),this._hostedFileService.setStatus(e.file.hostedFileId,Dn.VALIDATING).subscribe()}),k(()=>(console.error(),this._hostedFileService.setStatus(e.file.hostedFileId,Dn.UPLOAD_FAILED).subscribe(),xe)))}createHostedFileAndGetUploadPresignedUrl(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/presignedurl/upload`;return this._httpClient.post(t,e,{observe:"response"}).pipe(S(n=>n.body),k(()=>(this.isCurrentlyUploading=!1,M(null))))}getDownloadPresignedUrlsByDin21Ids(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/hostedfiles`,n=e,r=new Ti;return n.forEach(a=>{r=r.append("din21Ids",a)}),this._httpClient.get(t,{params:r})}getDownloadPresignedUrlsByHostedFileIds(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/hostedfile/presignedurl/download`,n=e,r=new Ti;return n.forEach(a=>{r=r.append("hostedFileIds",a)}),this._httpClient.get(t,{params:r})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();
15function Jc(i,o){if(i&1&&(c(0,"p"),v(1),h(2,"transloco"),d()),i&2){let e=p();s(),D(C(2,1,e.optionalText))}}var bi=(()=>{class i{constructor(){this.modalService=g(he),this.isDeleteConfirmation=!1,this.isUnlinkConfirmation=!1,this.saveButtonText="common.delete",this.decision=new R,this.saveButtonClass="btn-alert"}ngOnInit(){this.iconName||(this.isUnlinkConfirmation?(this.iconName="alert-large",this.saveButtonText="common.remove"):this.isDeleteConfirmation?this.iconName="delete-large":this.iconName="alert-large")}callDecision(e){this.modalService.close({preset:e})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-confirmation-modal"]],inputs:{title:"title",text:"text",optionalText:"optionalText",iconName:"iconName",isDeleteConfirmation:"isDeleteConfirmation",isUnlinkConfirmation:"isUnlinkConfirmation",saveButtonText:"saveButtonText"},outputs:{decision:"decision"},decls:10,vars:10,consts:[[3,"modalTitle"],[1,"modal-body"],[1,"info-icon"],["sprite","icons-large","data-cy","iconFeedback",1,"icon-inactive",3,"name"],["data-cy","textFeedback",1,"info-text"],[3,"cancelButtonClick","saveButtonClick","border","saveButtonText","saveButtonClass"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),c(1,"div",1)(2,"p",2),y(3,"app-icon",3),d(),c(4,"div",4)(5,"p"),v(6),h(7,"transloco"),d(),u(8,Jc,3,3,"p"),d()(),c(9,"app-modal-footer",5),x("cancelButtonClick",function(){return n.callDecision(!1)})("saveButtonClick",function(){return n.callDecision(!0)}),d()),t&2&&(f("modalTitle",n.title),s(3),f("name",n.iconName),s(3),D(C(7,8,n.text)),s(2),_(n.optionalText?8:-1),s(),f("saveButtonClass",kt(n.saveButtonClass))("border",!1)("saveButtonText",n.saveButtonText))},dependencies:[j,Me,we,z,$],styles:[".modal-body[_ngcontent-%COMP%]{flex-direction:row;align-items:center}"]})}}return i})();function Xc(i,o){i&1&&(c(0,"div",7),y(1,"app-icon",9),c(2,"span"),v(3),h(4,"transloco"),d()()),i&2&&(s(3),D(C(4,1,"search.document_list.link_successfully_copied")))}var $s=(()=>{class i{constructor(){this.modalService=g(he),this._translocoService=g(ae),this.link="",this.modalHeaderDisplayDescription="search.document_list.copy_link_to_clipboard_description"}ngOnInit(){this.modalHeaderDisplayDescription=this._translocoService.translate("search.document_list.copy_link_to_clipboard_description",{link:this.link})}onCopy(){return On(this,null,function*(){try{yield navigator.clipboard.writeText(this.link),this.copySuccess=!0}catch(e){console.error("Could not copy link data: ",e),this.copySuccess=!1}})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-copy-local-link-modal"]],inputs:{link:"link"},decls:15,vars:11,consts:[["modalTitle","search.document_upload.link_local"],[1,"modal-body"],["data-cy","description"],["type","button","data-cy","copyLink",1,"btn-icon-text",3,"click"],[1,"url",3,"ngbTooltip"],[1,"label"],["name","copy"],["data-cy","successMessage",1,"copy-success"],["cancelButtonText","common.close",3,"cancelButtonClick","border","isSaveButtonVisible"],["name","check-mark"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),c(1,"div",1)(2,"p",2),v(3),h(4,"transloco"),d(),c(5,"div")(6,"button",3),x("click",function(){return n.onCopy()}),c(7,"span",4),v(8),d(),c(9,"span",5),v(10),h(11,"transloco"),d(),y(12,"app-icon",6),d(),u(13,Xc,5,3,"div",7),d()(),c(14,"app-modal-footer",8),x("cancelButtonClick",function(){return n.modalService.dismiss()}),d()),t&2&&(s(3),D(C(4,7,n.modalHeaderDisplayDescription)),s(4),f("ngbTooltip",n.link),s(),D(n.link),s(2),D(C(11,9,"search.document_list.copy_link_to_clipboard_action")),s(3),_(n.copySuccess===!0?13:-1),s(),f("border",!1)("isSaveButtonVisible",!1))},dependencies:[j,Me,we,_e,z,$],styles:[".modal-body[_ngcontent-%COMP%]{justify-content:center}.modal-body[_ngcontent-%COMP%] .btn-icon-text[_ngcontent-%COMP%]{border:1px solid var(--color-primary);justify-content:flex-start;gap:calc(var(--spacer) / 4);padding-inline:calc(var(--spacer) / 2);width:100%}.modal-body[_ngcontent-%COMP%] .btn-icon-text[_ngcontent-%COMP%]:active, .modal-body[_ngcontent-%COMP%] .btn-icon-text[_ngcontent-%COMP%]:focus, .modal
15-body[_ngcontent-%COMP%] .btn-icon-text[_ngcontent-%COMP%]:hover{text-decoration:none}.modal-body[_ngcontent-%COMP%] .btn-icon-text[_ngcontent-%COMP%] .url[_ngcontent-%COMP%]{max-width:13.75rem;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.modal-body[_ngcontent-%COMP%] .btn-icon-text[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-family:var(--font-family-regular)}.modal-body[_ngcontent-%COMP%] .copy-success[_ngcontent-%COMP%]{align-items:center;color:var(--color-success);display:flex;position:absolute}"]})}}return i})();var Hs=Yr(wr(),1);var Or;try{Or=!!new Blob}catch(i){Or=!1}var Ks=(()=>{class i{get isFileSaverSupported(){return Or}genType(e){if(!e||e.lastIndexOf(".")===-1)return"text/plain";let t=e.substring(e.lastIndexOf(".")+1);switch(t){case"txt":return"text/plain";case"xml":case"html":return`text/${t}`;case"json":return"octet/stream";default:return`application/${t}`}}save(e,t,n,r){if(!e)throw new Error("Data argument should be a blob instance");let a=new Blob([e],{type:n??e.type??this.genType(t)});(0,Hs.saveAs)(a,decodeURI(t??"download"),r)}saveText(e,t,n){let r=new Blob([e]);this.save(r,t,void 0,n)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function ed(i,o){if(i&1){let e=w();c(0,"app-context",3),x("visibilityChange",function(){E(e);let n=p();return I(n.onContextVisibilityChange())}),d()}if(i&2){let e=p();f("documentToOpenDin21Id",e.documentToOpenDin21Id)("licenseLockId",e.documentLicenseLockId)}}function td(i,o){i&1&&(y(0,"app-icon",7),h(1,"transloco"),h(2,"transloco")),i&2&&(f("ngbTooltip",C(1,2,"search.document_list.tooltip_context")),P("aria-label",C(2,4,"search.document_list.tooltip_context")))}function id(i,o){i&1&&(y(0,"app-icon",8),h(1,"transloco"),h(2,"transloco")),i&2&&(f("ngbTooltip",C(1,2,"search.document_list.tooltip_userfiles")),P("aria-label",C(2,4,"search.document_list.tooltip_userfiles")))}function nd(i,o){i&1&&(y(0,"app-icon",9),h(1,"transloco"),h(2,"transloco")),i&2&&(f("ngbTooltip",C(1,2,"search.document_list.tooltip_mixed")),P("aria-label",C(2,4,"search.document_list.tooltip_mixed")))}function od(i,o){if(i&1&&v(0),i&2){let e=p().$implicit;F(" ",e.toUpperCase()," ")}}function rd(i,o){if(i&1&&(c(0,"span"),u(1,od,1,1),d()),i&2){let e=o.$implicit;s(),_(e!==null?1:-1)}}function ad(i,o){if(i&1&&(u(0,td,3,6,"app-icon",7),u(1,id,3,6,"app-icon",8),u(2,nd,3,6,"app-icon",9),c(3,"span",10),G(4,rd,2,1,"span",null,J),d()),i&2){let e=p(2),t=p();_(t.isContextList&&e.length===1?0:-1),s(),_(t.isUserList&&e.length===1?1:-1),s(),_(t.isMixedList||e.length>1?2:-1),s(2),q(t.itemLanguages)}}function sd(i,o){i&1&&y(0,"app-icon",11)}function ld(i,o){i&1&&y(0,"app-icon",12)}function cd(i,o){i&1&&y(0,"app-icon",13)}function dd(i,o){}function pd(i,o){if(i&1&&(c(0,"span"),v(1),d(),u(2,dd,0,0)),i&2){let e=o.$implicit,t=o.$index,n=p(4);s(),D(e),s(),_(t<n.itemLanguages.length?2:-1)}}function md(i,o){if(i&1&&(u(0,sd,1,0,"app-icon",11),u(1,ld,1,0,"app-icon",12),u(2,cd,1,0,"app-icon",13),c(3,"span",14),G(4,pd,3,2,null,null,J),d(),c(6,"span",15),v(7),h(8,"transloco"),d(),y(9,"app-icon",16)),i&2){p();let e=X(1),t=p(),n=p();_(n.isContextList&&t.length===1?0:-1),s(),_(n.isUserList&&t.length===1?1:-1),s(),_(n.isMixedList||t.length>1?2:-1),s(2),q(n.itemLanguages),s(3),F(" ",C(8,5,t.length===1?"common.show_document":"common.show_documents")," "),s(2),f("direction",e.isOpen()?"up":"down")}}function ud(i,o){if(i&1){let e=w();c(0,"button",6,1),x("click",function(){E(e);let n=X(1),r=p(2);return I(r.onPopupClick(n))}),u(2,ad,6,3),u(3,md,10,7),d()}if(i&2){let e=X(1);p();let t=X(3),n=p();W("open",e.isOpen())("btn-primary",n.isItemDetail)("document-list-button",n.isItemDetail)("btn-icon-text",!n.isItemDetail),f("ngbPopover",t)("placement",n.isItemDetail?"bottom":"bottom-left"),s(2),_(n.isItemDetail?-1:2),s(),_(n.isItemDetail?3:-1)}}function _d(i,o){if(i&1&&(c(0,"p",21),v(1),d()),i&2){let e=p().$implicit;s(),F(" ",e.description," ")}}function hd(i,o){if(i&1&&(c(0,"p",21),v(1),d()),i&2){let e=p().$implicit;s(),F(" ",e.description+" ("+e.fileName+")"," ")}}function fd(i,o){if(i&1&&(c(0,"p",22),v(1),d()),i&2){let e=p().$implicit;s(),F(" ",e.language.toUpperCase()," ")}}function gd(i,o){i&1&&y(0,"app-icon",23)}function Cd(i,o){i&1&&y(0,"app-icon",24)}function vd(i,o){if(i&1){let e=w();c(0,"button",18),h(1,"transloco"),h(2,"transloco"),x("click",function(){let n=E(e).$implicit,r=p(4);return I(n.type!==r.associatedFileTypeDto.FILE_PAPER&&r.linkToDocument(n.din21Id,n.type===r.associatedFileTypeDto.FILE_HOSTED))}),c(3,"span"),y(4,"app-icon",19),c(5,"span",20),u(6,_d,2,1,"p",21),u(7,hd,2,1,"p",21),u(8,fd,2,1,"p",22),d()(),u(9,gd,1,0,"app-icon",23),u(10,Cd,1,0,"app-icon",24),d()}if(i&2){let e=o.$implicit,t=p(4);W("locked",e.isLocked),f("ngbTooltip",C(1,13,"search.document_list.document_is_locked"))("disableTooltip",!e.isLocked),P("aria-label",C(2,15,"search.document_list.document_is_locked")),s(4),W("clickable",e.isUploadedByUser),f("name",t.getIconName(e)),s(2),_(e.description&&e.description!=="null"&&e.type!==t.associatedFileTypeDto.FILE_HOSTED?6:-1),s(),_(e.fileName&&e.fileName!=="null"&&e.type===t.associatedFileTypeDto.FILE_HOSTED?7:-1),s(),_(e.language!==null?8:-1),s(),_(t.isLocked(e.din21Id)?9:-1),s(),_(t.isTemporarilyLocked(e.din21Id)?10:-1)}}function bd(i,o){if(i&1&&G(0,vd,11,17,"button",17,J),i&2){let e=p(2);q(e)}}function yd(i,o){if(i&1&&(u(0,bd,2,0),h(1,"async")),i&2){let e=p(2);_(C(1,1,e.accessInformationLoaded$)?0:-1)}}function xd(i,o){i&1&&(c(0,"div",4),u(1,ud,4,12,"button",5),d(),Y(2,yd,2,3,"ng-template",null,0,fe)),i&2&&(s(),_(o?1:-1))}var co=(()=>{class i{constructor(){this._changeDetectorRef=g(ze),this._documentService=g(ei),this._feedbackService=g(pt),this._fileSaverService=g(Ks),this._hostedFilePresignedUrlService=g(lo),this._modalService=g(he),this.accessInformationLoaded$=M(!1),this.isContextList=!1,this.isMixedList=!0,this.isUserList=!1,this.showContext=!1,this.associatedFileTypeDto=B,this._componentActive=!0,this._isPending=!1,this._itemLanguages=[],this.showDocumentTitle=!1,this.isItemDetail=!1}get documentClassMap(){return this._documentClassMap||(this._documentClassMap={[B.FILE_LINK_WWW]:"document-url",[B.FILE_PAPER]:"document-paper",[B.FILE_LINK_LOCAL]:"document-local",[B.FILE_HOSTED]:"document-hosted"}),this._documentClassMap}get itemLanguages(){return this._itemLanguages}set itemLanguages(e){this._itemLanguages=e}ngOnInit(){this.documentListItems$=this._documentService.documentListCollection$.pipe(Re(e=>{if(e?.length>0){let t=e.filter(n=>n.acCode===this.itemId);if(t.length>0){let n=t[0].fulltexts;return this._documentListItems=n,this.setListTypes(n),this._itemLanguages=this.filterItemLanguages(n),this._itemLanguages.length>2&&this.removeMiscLanguage(this._itemLanguages),this._itemLanguages=this.sortItemLanguages(this._itemLanguages),M(n)}}return M(null)}))}ngOnDestroy(){this._isLockedSubscription&&this._isLockedSubscription.unsubscribe(),this._userInfoSubscription&&this._userInfoSubscription.unsubscribe(),this._componentActive=!1}onPopupClick(e){e.isOpen()||(this.checkDocumentAccess(),this._openPopover=e,this._openPopover.open(),this.addScrollDetaction())}
15linkToDocument(e,t=!1){let n=this._documentListItems.find(m=>m.din21Id===e);if(!n)return;let r=n.fileName?.endsWith(".pdf")??!1,a=this.isLink(n.id),l=!this._documentAccessInformation[e].isRestricted||!t;if(this.isLocked(e)){this._feedbackService.showInfoModal("search.document_locked.no_license_title","search.document_locked.no_license_text",Zi.LOCKED);return}if(this.isTemporarilyLocked(e)){this._feedbackService.showInfoModal("search.document_locked.simultan_license_title","search.document_locked.simultan_license_text",Zi.LOCKED);return}if((!t||r)&&l){this._documentService.checkSimultaneouslyAccessAndBlockLicense(e).pipe(V(m=>{if(m.status===ge.OK){if(n.type===B.FILE_LINK_LOCAL){this.trackDocumentAccess(e,n.acCode,n.type,n.fileName);let b=this._modalService.open($s);return b.componentInstance.link=n.url,xe}if(this.isUserUploadFile(e)&&!r||a)return this.handleOpenLinkToDocumentForUserUploadedFile(e),xe;this.documentToOpenDin21Id=e,this.documentLicenseLockId=m.body,this.showContext=!0,this._changeDetectorRef.detectChanges(),this.trackDocumentAccess(e,n.acCode,n.type,n.fileName,this.documentLicenseLockId)}return xe}),k(m=>(m.status===Gt.FORBIDDEN&&(this.temporarilyLockDocument(e),this._feedbackService.showInfoModal("search.document_locked.simultan_license_title","search.document_locked.simultan_license_text",Zi.LOCKED)),xe)),me(()=>this._componentActive)).subscribe();return}if(!l){if(r){let m=this._modalService.open(bi);m.componentInstance.title="search.document_list.document_protected.title",m.componentInstance.text="search.document_list.document_protected.prepare_for_download",m.componentInstance.saveButtonClass="btn-primary",m.componentInstance.saveButtonText="common.download",m.result.then(b=>{b?.preset&&(this._hostedFilePresignedUrlService.downloadFileByDin21Id(e,n.fileName),this.trackDocumentAccess(e,n.acCode,n.type,n.fileName))})}else this._hostedFilePresignedUrlService.downloadFileByDin21Id(e,n.fileName),this.trackDocumentAccess(e,n.acCode,n.type,n.fileName);return}this._hostedFilePresignedUrlService.downloadFileByDin21Id(e,n.fileName),this.trackDocumentAccess(e,n.acCode,n.type,n.fileName)}isLocked(e){return this._documentAccessInformation[e].licenseInformation==="NA"}isTemporarilyLocked(e){return this._documentAccessInformation[e].licenseInformation==="NSA"}onContextVisibilityChange(){this.showContext=!1,this._changeDetectorRef.detectChanges()}getIconName(e){return e.isUploadedByUser?this.documentClassMap[e.type]??"":"document-context"}handleOpenLinkToDocumentForUserUploadedFile(e){let t=this.getIdByDin21Id(e),n=this.getFulltextByDin21Id(e);if(this.isLink(t))if(n?.url)n.type===B.FILE_LINK_WWW?!n.url.startsWith("http")&&!n.url.startsWith("ftp")&&(n.url="https://"+n.url):n.type===B.FILE_LINK_LOCAL&&(n.url="file:///"+n.url),window.open(n.url,"_blank"),this.trackDocumentAccess(e,n.acCode,n.type,n.fileName);else return;else n.type===B.FILE_HOSTED?(this._hostedFilePresignedUrlService.downloadFileByDin21Id(n.din21Id,n.fileName),this.trackDocumentAccess(e,n.acCode,n.type,n.fileName)):this._documentService.downloadFile(t).subscribe({next:r=>{let a=n.fileName;this._fileSaverService.save(r,a),this.trackDocumentAccess(e,n.acCode,n.type,n.fileName)},error:()=>{this._feedbackService.showErrorModal()}})}addScrollDetaction(){let e=document.querySelector("app-table")?.parentElement;e&&Pn(e,"scroll").pipe(me(()=>this._openPopover.isOpen())).subscribe(()=>{let t=document.querySelector("thead")?.getBoundingClientRect(),n=document.querySelector(".document-list-popover")?.getBoundingClientRect();t&&n&&t.bottom>=n.top&&this._openPopover.close()})}checkDocumentAccess(){this._isPending||(this._isPending=!0,Ot([this.documentListItems$,this._documentService.documentListCollection$]).pipe(V(([e,t])=>{if(e?.length&&t?.length){let n=t.find(r=>r.acCode===this.itemId)?.fulltexts.map(r=>r.din21Id);n?.length&&this._documentService.getDocumentAccessInformation(n).pipe(Si(()=>this._isPending=!1)).subscribe(r=>{if(r){this._documentAccessInformation=r,this.accessInformationLoaded$=M(!0);for(let a of e)a.isLocked=this.isLocked(a.din21Id)}})}}),me(()=>this._isPending)).subscribe())}isUserUploadFile(e){for(let t of this._documentListItems)if(t.din21Id===e)return t.isUploadedByUser;return!1}getFulltextByDin21Id(e){for(let t of this._documentListItems){let n=t;if(n.din21Id===e)return n}return null}isLink(e){for(let t of this._documentListItems){let n=t;if(n.id===e&&n.fileSize===0&&(n.type===B.FILE_LINK_LOCAL||n.type===B.FILE_LINK_WWW))return!0}return!1}getIdByDin21Id(e){return this._documentListItems.find(n=>n.din21Id===e)?.id??""}temporarilyLockDocument(e){this._documentAccessInformation[e].isAccessible="NSA"}trackDocumentAccess(e,t,n,r,a=null){this._documentService.trackDocumentAccess(e,t,n,r,a).subscribe()}sortItemLanguages(e){return e.sort((t,n)=>t.localeCompare(n))}removeMiscLanguage(e){this._itemLanguages=e.filter(t=>t!=="..."),this._itemLanguages.length=2}filterItemLanguages(e){return e.map(t=>
15t.language).filter((t,n,r)=>t&&n===r.indexOf(t))}setListTypes(e){let t=e.some(r=>r.isUploadedByUser),n=e.some(r=>!r.isUploadedByUser);this.isContextList=!t&&n,this.isUserList=t&&!n,this.isMixedList=t&&n}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-document-list"]],inputs:{itemId:"itemId",showDocumentTitle:"showDocumentTitle",isItemDetail:"isItemDetail"},decls:3,vars:4,consts:[["documentListPopover",""],["popover","ngbPopover"],[3,"documentToOpenDin21Id","licenseLockId"],[3,"visibilityChange","documentToOpenDin21Id","licenseLockId"],[1,"document-functions-container"],["type","button","data-cy","openDocumentList","triggers","manual",3,"open","btn-primary","document-list-button","btn-icon-text","ngbPopover","placement"],["type","button","data-cy","openDocumentList","triggers","manual",3,"click","ngbPopover","placement"],["name","document-context","placement","top","data-cy","iconDocument",3,"ngbTooltip"],["name","document","placement","top","data-cy","iconDocument",3,"ngbTooltip"],["name","documents","placement","top","data-cy","iconDocument",3,"ngbTooltip"],["data-cy","documentListLanguages",1,"document-list-languages"],["name","document-context"],["name","document"],["name","documents"],[1,"document-language"],[1,"document-list-button-text"],["name","chevron",3,"direction"],["type","button","data-cy","openDocument",1,"btn-document",3,"locked","ngbTooltip","disableTooltip"],["type","button","data-cy","openDocument",1,"btn-document",3,"click","ngbTooltip","disableTooltip"],["data-cy","iconDocument",1,"document-list-popover-icon",3,"name"],[1,"document-text"],["data-cy","documentDescription",1,"document-description"],["data-cy","documentLanguage",1,"document-language"],["name","document-locked","data-cy","iconDocumentLocked"],["name","document-locked-simultan","data-cy","iconDocumentLockedTemporarily"]],template:function(t,n){if(t&1&&(u(0,ed,1,2,"app-context",2),u(1,xd,4,1),h(2,"async")),t&2){let r;_(n.showContext?0:-1),s(),_((r=C(2,2,n.documentListItems$))?1:-1,r)}},dependencies:[Oe,ao,j,zn,_e,z,ct,$],styles:[".btn-icon-text[_ngcontent-%COMP%]{width:5rem}.document-functions-container[_ngcontent-%COMP%]{color:var(--color-primary-dark)}.btn-primary[_ngcontent-%COMP%]{gap:calc(var(--spacer) / 2);padding-inline:calc(var(--spacer) / 2)}.btn-primary[_ngcontent-%COMP%] .document-language[_ngcontent-%COMP%]{display:flex;flex-basis:3ch;flex-direction:column;font-family:var(--font-family-regular);font-size:var(--font-size-small);overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.document-list-languages[_ngcontent-%COMP%]{display:flex;color:var(--color-text);flex-basis:3ch;flex-direction:column;font-family:var(--font-family-regular);font-size:var(--font-size-small);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn-document[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:calc(var(--spacer) / 2);border-radius:0;color:var(--color-primary);cursor:pointer;height:4rem;padding:calc(var(--spacer) / 2);min-width:17rem;max-width:50vw;width:100%}.btn-document[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:flex;align-items:center;gap:calc(var(--spacer) / 2)}.btn-document[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] .document-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start}.btn-document[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] .document-text[_ngcontent-%COMP%] .document-description[_ngcontent-%COMP%]{max-width:38vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn-document[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] .document-text[_ngcontent-%COMP%] .document-language[_ngcontent-%COMP%]{font-family:var(--font-family-regular)}.btn-document[_ngcontent-%COMP%]:not(:last-child){border-bottom:var(--border)}.btn-document[_ngcontent-%COMP%]:hover{background-color:var(--color-gray-light)}"]})}}return i})();var Pr=(function(i){return i.identical="IDT",i.modified="MOD",i.necessary="NEC",i.notEquivalent="NEQ",i.useful="USE",i})(Pr||{});var po=(()=>{class i{constructor(){this.internationalRelationshipToken=Pr,this.itemDivider=", "}transform(e){let t=Object.keys(e),n="";for(let r of t)n+=e[r].map(a=>`${a.relation}, ${this.internationalRelationshipToken[r]}`).join(this.itemDivider);return n}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"internationalRelationshipOutput",type:i,pure:!0})}}return i})();var mo=(()=>{class i{constructor(){this._templateRef=g(Bi),this._viewContainer=g(Vi),this._authService=g(ue),this.operator="OR",this.requiresHostingModule=!1,this._isHidden=!0}set hasPermissions(e){Array.isArray(e)?this.permissions=e:this.permissions=[e],this.updateView()}set permissionsElse(e){e&&(this.elseTemplate=e)}set permissionsOperator(e){e&&(this.operator=e.toUpperCase(),this.updateView())}set permissionsRequiresHostingModule(e){e&&(this.requiresHostingModule=e,this.updateView())}ngOnInit(){this._authService.loggedIn$.pipe(V(e=>{e?this.updateView():this.clearView()})).subscribe()}updateView(){let e=this.requiresHostingModule&&this._authService.currentTokenDecoded.hasHostingModule||!this.requiresHostingModule;this.checkPermission()&&e?(this.elseTemplate&&this.clearView(),this._isHidden&&this.createView(this._templateRef)):this.elseTemplate?this._isHidden?this.createView(this.elseTemplate):this.clearView():this.clearView()}clearView(){this._viewContainer.clear(),this._isHidden=!0}createView(e){this._viewContainer.createEmbeddedView(e),this._isHidden=!1}checkPermission(){if(!this.permissions)return console.error("PERMISSIONS ERROR: Please specify at least one permission!"),!1;if(this.permissions.length===1){let[e]=this.permissions;return this._authService.userHasPermission(e)}return this.operator==="OR"?this._authService.userHasOnePermission(this.permissions):this._authService.userHasAllPermissions(this.permissions)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=Ae({type:i,selectors:[["","permissions",""]],inputs:{hasPermissions:[0,"permissions","hasPermissions"],permissionsElse:"permissionsElse",permissionsOperator:"permissionsOperator",permissionsRequiresHostingModule:"permissionsRequiresHostingModule"},standalone:!1})}}return i})();var qs=(()=>{class i{constructor(){this._authService=g(ue)}transform(e,t="OR"){let n;return Array.isArray(e)?n=e:n=[e],t==="AND"?this._authService.userHasAllPermissions(n):this._authService.userHasOnePermission(n)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"hasPermissions",type:i,pure:!0,standalone:!1})}}return i})();var En=(()=>
15{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=rt({type:i})}static{this.\u0275inj=ot({imports:[Oe]})}}return i})();var MT="IntersectionObserver"in window;var In=(function(i){return i[i.Csv=0]="Csv",i[i.HostedDocument=1]="HostedDocument",i})(In||{});var an=(()=>{class i{constructor(){this.fileDropped=new R,this.background="var(--color-background)"}onDragOver(e){e.preventDefault(),e.stopPropagation(),this.background="var(--color-primary-light)"}onDragLeave(e){e.preventDefault(),e.stopPropagation(),this.background="var(--color-background)"}ondrop(e){e.preventDefault(),e.stopPropagation(),this.background="var(--color-background)";let t;e instanceof FileList?t=e:e.dataTransfer&&(t=e.dataTransfer.files),t&&t.length>0&&this.fileDropped.emit(t)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=Ae({type:i,selectors:[["","dragAndDrop",""]],hostVars:2,hostBindings:function(t,n){t&1&&x("dragover",function(a){return n.onDragOver(a)})("dragleave",function(a){return n.onDragLeave(a)})("drop",function(a){return n.ondrop(a)}),t&2&&Zt("background-color",n.background)},outputs:{fileDropped:"fileDropped"}})}}return i})();var Ws=(()=>{class i{static{this._unitFactor=1024}static{this._sizeUnits=["Bytes","KB","MB","GB","TB"]}static formatFileSize(e,t=2,n="de-DE"){if(e===0)return"0 Bytes";let r=Math.floor(Math.log(e)/Math.log(this._unitFactor)),l=new Intl.NumberFormat(n,{maximumFractionDigits:t}).format(e/Math.pow(this._unitFactor,r));return this._sizeUnits[r]==="Bytes"&&(l=Math.floor(parseFloat(l)).toString()),l+" "+this._sizeUnits[r]}static toBytes(e,t){let n=this._sizeUnits.indexOf(t);if(n===-1)throw new Error("Unit not recognized");return e*Math.pow(this._unitFactor,n)}}return i})();var zs=i=>({fileSizeLimit:i});function Td(i,o){if(i&1&&(c(0,"span",8),v(1),d()),i&2){let e=p().$implicit,t=p();s(),F(" ",t.fileSizeUtils.formatFileSize(e.file.size)," ")}}function Dd(i,o){if(i&1&&(c(0,"p",12),v(1),h(2,"transloco"),d()),i&2){let e=p().$implicit,t=p();W("text-alert",e.errorMessage),s(),F(" ",de(2,3,e.errorMessage,ie(6,zs,t.fileSizeUtils.formatFileSize(t.fileSizeLimitInMB*1024*1024)))," ")}}function Ed(i,o){if(i&1){let e=w();c(0,"div",2)(1,"div",3)(2,"div",4),y(3,"app-icon",5),c(4,"p",6)(5,"span",7),v(6),d(),u(7,Td,2,1,"span",8),d()(),c(8,"button",9),h(9,"transloco"),h(10,"transloco"),x("click",function(){let n=E(e).$implicit,r=p();return I(r.removeFile(n.file))}),y(11,"app-icon",10),d()(),u(12,Dd,3,8,"p",11),d()}if(i&2){let e=o.$implicit,t=p();s(6),D(e.file.name),s(),_(t.showFileSizes?7:-1),s(),f("ngbTooltip",C(9,5,"common.remove")),P("aria-label",C(10,7,"common.remove")),s(4),_(e.errorMessage?12:-1)}}function Id(i,o){if(i&1&&(c(0,"p",18),v(1),h(2,"transloco"),d()),i&2){let e=p(2);s(),F(" ",C(2,1,e.outerErrorMessage)," ")}}function Fd(i,o){if(i&1){let e=w();c(0,"div",13),x("click",function(){E(e);let n=X(7);return I(n.click())})("fileDropped",function(n){E(e);let r=p();return I(r.onAddUploadFile(n))})("keydown.enter",function(){E(e);let n=X(7);return I(n.click())}),c(1,"div",14),y(2,"app-icon",15),c(3,"span",16),v(4),h(5,"transloco"),d()(),c(6,"input",17,0),x("change",function(n){E(e);let r=p();return I(r.onAddUploadFile(n))}),d()(),u(8,Id,3,3,"p",18)}if(i&2){let e=p();W("error",e.outerErrorMessage!==null),s(4),F(" ",de(5,6,"common.file_upload_hint_changeable",ie(9,zs,e.fileSizeUtils.formatFileSize(e.fileSizeUtils.toBytes(e.fileSizeLimitInMB,"MB"))))," "),s(2),f("accept",e.allowedMimeTypes)("multiple",e.canAddMultipleFiles),s(2),_(e.outerErrorMessage!==null?8:-1)}}var uo=(()=>{class i{constructor(){this.fileUploadType=In.HostedDocument,this.fileSizeLimitInMB=9999999,this.outerErrorMessage=null,this.sortByFileName=!0,this.allowedFileExtensions=[],this.showFileSizes=!1,this.canAddMultipleFiles=!1,this.selectedFileChanged=new R,this.errorOccurred=new R,this.filesAndErrorMessages=[],this.mimeTypes={pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",txt:"text/plain",csv:"text/csv",zip:"application/zip,application/x-zip-compressed","7z":"application/x-7z-compressed",ace:"application/x-ace-compressed",iso:"application/x-iso9660-image",rar:"application/vnd.rar,application/x-rar-compressed","tar.gz":"application/gzip",tgz:"application/gzip"},this.fileSizeUtils=Ws}get allowedMimeTypes(){let e=[];for(let t of this.allowedFileExtensions){let n=t.toLowerCase(),r=this.getMimeTypeFromString(n);r&&e.push(r),n==="tar.gz"?e.push(".tar.gz"):e.push("."+n)}return e.join(", ")}get fileSizeLimit(){return this.fileSizeLimitInMB*1024*1024}ngOnInit(){this.preSelectedFile&&(this.filesAndErrorMessages=[{file:this.preSelectedFile,errorMessage:this.getErrorForFile
15(this.preSelectedFile)}]),this.emitIfErrorsOccurred()}removeFile(e){let t=this.filesAndErrorMessages.findIndex(n=>n.file===e);t>-1&&(this.filesAndErrorMessages.splice(t,1),this.selectedFileChanged.emit(this.filesAndErrorMessages.map(n=>n.file)),this.emitIfErrorsOccurred())}onAddUploadFile(e){let t;if("target"in e?t=e.target.files:e instanceof FileList&&(t=e),!!t){this.outerErrorMessage=null;for(let n of Array.from(t)){let r=this.getErrorForFile(n);this.addFileToVisibleFileList(n,r)}"target"in e&&(e.target.value=""),this.emitIfErrorsOccurred()}}addFileToVisibleFileList(e,t){this.canAddMultipleFiles?this.filesAndErrorMessages.push({file:e,errorMessage:t}):this.filesAndErrorMessages=[{file:e,errorMessage:t}],this.sortByFileName&&this.canAddMultipleFiles&&this.sortFilesByName(),this.selectedFileChanged.emit(this.filesAndErrorMessages.map(n=>n.file))}getErrorForFile(e){if(e.size>this.fileSizeLimit)return"search.document_upload.hosted_file.file_too_big";if(this.allowedFileExtensions.length>0){let t=e.type,n=this.getMimeType(e),r=!!t&&this.allowedMimeTypes.includes(t),a=!!n&&this.allowedMimeTypes.includes(n),l=e.name.toLowerCase(),m=!1;if(l.endsWith(".tar.gz"))m=this.allowedFileExtensions.some(b=>b.toLowerCase()==="tar.gz");else{let b=l.includes(".")?l.substring(l.lastIndexOf(".")+1):"";m=!!b&&this.allowedFileExtensions.some(T=>T.toLowerCase()===b)}if(!(r||a||m))return"favorites.description.file_type_not_supported"}return null}getMimeType(e){let t=e.name.toLowerCase();if(t.endsWith(".tar.gz"))return this.getMimeTypeFromString("tar.gz");if(t.endsWith(".tgz"))return this.getMimeTypeFromString("tgz");let n=t.includes(".")?t.substring(t.lastIndexOf(".")+1):"";return this.getMimeTypeFromString(n)}getMimeTypeFromString(e){return this.mimeTypes[e]}emitIfErrorsOccurred(){this.filesAndErrorMessages.find(e=>e.errorMessage)||this.outerErrorMessage?this.errorOccurred.emit(!0):this.errorOccurred.emit(!1)}sortFilesByName(){this.filesAndErrorMessages.sort((e,t)=>e.file.name<t.file.name?-1:e.file.name>t.file.name?1:0)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-file-upload"]],inputs:{preSelectedFile:"preSelectedFile",acCodes:"acCodes",fileUploadType:"fileUploadType",fileSizeLimitInMB:"fileSizeLimitInMB",outerErrorMessage:"outerErrorMessage",sortByFileName:"sortByFileName",allowedFileExtensions:"allowedFileExtensions",showFileSizes:"showFileSizes",canAddMultipleFiles:"canAddMultipleFiles"},outputs:{selectedFileChanged:"selectedFileChanged",errorOccurred:"errorOccurred"},decls:4,vars:1,consts:[["fileInput",""],[1,"file-info-container"],[1,"not-valid"],["data-cy","file",1,"file-info-element"],[1,"file"],["name","document-hosted","data-cy","iconDocumentHosted"],[1,"file-info"],["data-cy","fileName"],["data-cy","fileSize"],["type","button",1,"btn-icon",3,"click","ngbTooltip"],["name","cross","data-cy","iconRemoveFile"],["data-cy","errorMessage",3,"text-alert"],["data-cy","errorMessage"],["dragAndDrop","",1,"upload-file-container",3,"click","fileDropped","keydown.enter"],[1,"upload-disclaimer"],["name","cloud-upload","data-cy","iconFileUpload"],["data-cy","uploadMessage"],["hidden","","type","file","data-cy","uploadFile",3,"change","accept","multiple"],["data-cy","noFileErrorMessage",1,"text-alert"]],template:function(t,n){t&1&&(c(0,"div",1),G(1,Ed,13,9,"div",2,J),d(),u(3,Fd,9,11)),t&2&&(s(),q(n.filesAndErrorMessages),s(2),_(n.canAddMultipleFiles||n.filesAndErrorMessages.length===0||!n.canAddMultipleFiles&&n.filesAndErrorMessages.length===0?3:-1))},dependencies:[an,j,_e,z,$],styles:[".file-info-element[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.file-info-element[_ngcontent-%COMP%] .btn-icon[_ngcontent-%COMP%]{margin:2px}.file-info-element[_ngcontent-%COMP%] .file[_ngcontent-%COMP%]{align-items:center;display:flex}.file-info-element[_ngcontent-%COMP%] .file[_ngcontent-%COMP%] .file-info[_ngcontent-%COMP%]{display:flex;flex-direction:column}.file-info-container[_ngcontent-%COMP%]{max-height:30vh;overflow-y:auto}.text-alert[_ngcontent-%COMP%]{position:relative}"]})}}return i})();var Md=i=>({count:i});function wd(i,o){if(i&1&&(Ko(0),v(1),h(2,"transloco"),Go()),i&2){let e=p();s(),D(C(2,1,e.singularKey))}}function Od(i,o){if(i&1&&(Ko(0),v(1),h(2,"transloco"),Go()),i&2){let e=p();s(),D(de(2,1,e.pluralKey,ie(4,Md,e.formattedCount)))}}var _o=(()=>{class i{constructor(){this._translocoService=g(ae),this.count=0,this.size="large",this.singularKey="common.one_record",this.pluralKey="common.x_records"}get locale(){switch(this._translocoService.getActiveLang()){case"en":return"en-US";case"fr":return"fr-FR";default:return"de-DE"}}
15get formattedCount(){return(this.count??0).toLocaleString(this.locale)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-record-count"]],inputs:{count:"count",size:"size",singularKey:"singularKey",pluralKey:"pluralKey"},decls:3,vars:3,consts:[["data-cy","numberOfEntries",1,"text-important"]],template:function(t,n){t&1&&(ua(0,"p",0),u(1,wd,3,3,"ng-container")(2,Od,3,6,"ng-container"),_a()),t&2&&($i(n.size),s(),_(n.count===1?1:2))},dependencies:[z,$],styles:[".small[_ngcontent-%COMP%]{font-size:var(--font-size-default)}"],changeDetection:0})}}return i})();var lD=(()=>{class i{constructor(){this._router=g(mi),this._route=g(Un),this._authService=g(ue)}ngOnInit(){let e=localStorage.getItem(qi)||this._route.snapshot.params.tenant;this._route.queryParams.subscribe(t=>{t.redirected&&this._authService.completeShibbolethLogin().subscribe({next:n=>{let r=n.tenantKey;this._router.navigate([`${r}/search`])}})}),e?this._router.navigateByUrl(`${e}/dashboard`):this._router.navigateByUrl("login")}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["ng-component"]],decls:0,vars:0,template:function(t,n){},encapsulation:2})}}return i})();var Pd=["tableHeader"],Nd=["tableCell"],ho=(()=>{class i{constructor(){this._columnText="",this.sortable=!1,this.styleClasses="",this.centerTableHeader=!1}set columnText(e){this._columnText=e,e==="common.metadata_label.classificationIcs"?this._columnText="common.metadata_label.classificationIcs_short":e==="common.metadata_label.flagStatus"&&(this._columnText="common.metadata_label.flagStatus_short")}get columnText(){return this._columnText}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=Ae({type:i,selectors:[["","tableColumn",""]],contentQueries:function(t,n,r){if(t&1&&It(r,Pd,5)(r,Nd,5),t&2){let a;le(a=ce())&&(n.headerTemplate=a.first),le(a=ce())&&(n.cellTemplate=a.first)}},inputs:{columnText:"columnText",itemProperty:"itemProperty",sortable:"sortable",styleClasses:"styleClasses",width:"width",centerTableHeader:"centerTableHeader",columnWidth:"columnWidth"}})}}return i})();var sn=(()=>{class i{constructor(){this._elemtRef=g(Ze)}onSubmit(){setTimeout(()=>{let e=(this.isFormControl?"input.ng-invalid,textarea.ng-invalid":"input.invalid")+", .invalid-focus";this.focusFirstInvalidInput(e)},0)}focusFirstInvalidInput(e){this._elemtRef.nativeElement.querySelector(e)?.focus()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=Ae({type:i,selectors:[["","focusInvalidInput",""]],hostBindings:function(t,n){t&1&&x("submit",function(){return n.onSubmit()})},inputs:{isFormControl:[0,"focusInvalidInput","isFormControl"]}})}}return i})();var js=(()=>{class i{constructor(){this._control=g(ji)}onKeyUp(e){let{value:t}=e.target;t.length>=this.inputLimit&&this._control.control.setValue(t[this.inputLimit-1])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=Ae({type:i,selectors:[["","limitInput",""]],hostBindings:function(t,n){t&1&&x("keyup",function(a){return n.onKeyUp(a)})},inputs:{inputLimit:[0,"limitInput","inputLimit"]}})}}return i})();var kd=["menuAnimatedButtons"],Rd=["menuStaticButtons"],ln=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=Ae({type:i,selectors:[["","menu",""]],contentQueries:function(t,n,r){if(t&1&&It(r,kd,5)(r,Rd,5),t&2){let a;le(a=ce())&&(n.menuAnimatedButtons=a.first),le(a=ce())&&(n.menuStaticButtons=a.first)}}})}}return i})();var ED=(()=>{class i{constructor(){this._el=g(Ze),this._renderer=g(Et),this.showScrollToTopButton=!1}ngOnInit(){this.showScrollToTopButton&&(this._mainContainer=this._renderer.selectRootElement("main",!0),this.createIntersectionObserver())}createIntersectionObserver(){let e={root:null,rootMargin:"0px",threshold:0},t=n=>{n.forEach(r=>{r.isIntersecting&&this.hideButton(),r.isIntersecting||this.showButton()})};this._intersectionObserver=new IntersectionObserver(t,e),this._intersectionObserver.observe(this._el.nativeElement)}showButton(){this._dynamicButton=this.createButton(),this.setupClickListener()}hideButton(){this._el.nativeElement&&this._dynamicButton&&this._renderer.removeChild(this._el.nativeElement,this._dynamicButton)}createButton(){let e="1rem",t=this._renderer.createElement("button"),n=this._renderer.createElement("svg","svg"),r=this._renderer.createElement("use","svg");return this._renderer.setAttribute(n,"width","30"),this._renderer.setAttribute(n,"height","30"),this._renderer.setAttribute(r,"href","assets/icons/icons-default.svg#arrow"),this._renderer.setStyle(n,"transform","rotate(180deg)"),this._renderer.appendChild(n,r),this._renderer.appendChild(t,n),this._renderer.setStyle(n,"color","var(--color-primary)"),this._renderer.setStyle(t,"z-index","9999"),this._renderer.setStyle(t,"width","48px"),this._renderer.setStyle(t,"height","64px"),this._renderer.setStyle(t,"display","flex"),this._renderer.setStyle(t,"align-items","center"),this._renderer.setStyle(t,"justify-content","center"),this._renderer.setStyle(t,"position","fixed"),this._renderer.setStyle(t,"bottom",e),this._renderer.setStyle(t,"right","15px"),this._renderer.setStyle(t,"border","2px solid var(--color-primary)"),this._renderer.setStyle(t,"border-radius","2px"),this._renderer.setStyle(t,"box-shadow","0px 2px 10px rgba(0,0,0, 0.2)"),this._renderer.setStyle(t,"background-color","var(--color-background)"),this._renderer.setStyle(t,"color","var(--color-primary)"),this._renderer.setAttribute(t,"data-cy","scrollToTop"),this._renderer.setAttribute(t,"aria-label","Scroll to top"),this._renderer.setAttribute(t,"type","button"),this._renderer.appendChild(this._el.nativeElement,t),t}setupClickListener(){this._renderer.listen(this._dynamicButton,"click",()=>{this._mainContainer.getElementsByClassName("content")[0]?.scrollTo({top:0,behavior:"smooth"})})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=Ae({type:i,selectors:[["","scrollToTopButton",""]],inputs:{showScrollToTopButton:[0,"scrollToTopButton","showScrollToTopButton"]}})}}return i})();var Ys=(()=>{class i{constructor(){this._elementRef=g(Ze),this._totalItems=0}set itemsVisible(e){e&&(e===0?this._itemsVisible=1:e>this.totalItems&&this.totalItems>0?this._itemsVisible=this.totalItems:this._itemsVisible=e,this.configureDropDown())}get itemsVisible(){return this._itemsVisible}set totalItems(e){this._totalItems=e,this.configureDropDown()}get totalItems(){return this._totalItems}ngAfterViewInit(){this.configureDropDown()}ngOnChanges(e){(e.itemsVisible||e.totalItems||e.itemHeight)&&this.configureDropDown()}configureDropDown(){if(!this.itemsVisible||!this.itemHeight||!this.totalItems)return;let t=Math.min(this.itemsVisible,this.totalItems)*this.itemHeight,n=this._elementRef.nativeElement;n.style.maxHeight=`${t}px`,this.totalItems*this.itemHeight>t?n.style.overflow="auto":n.style.overflow="visible"}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=Ae({type:i,selectors:[["","itemsVisible",""]],inputs:{itemsVisible:"itemsVisible",itemHeight:"itemHeight",totalItems:"totalItems"},features:[Ct]})}}return i})();var Q=(function(i){return i[i.Flag_AmendedSinceLastUpdate=10010]="Flag_AmendedSinceLastUpdate",i[i.Flag_Historic=10020]="Flag_Historic",i[i.Flag_ModifiedByAmendments=10030]="Flag_ModifiedByAmendments",i[i.Flag_Parti
15allyReplaced=10040]="Flag_PartiallyReplaced",i[i.Flag_PartiallyReplacedSinceLastUpdate=10050]="Flag_PartiallyReplacedSinceLastUpdate",i[i.Flag_ReInstated=10060]="Flag_ReInstated",i[i.Flag_WithdrawnSinceLastUpdate=10070]="Flag_WithdrawnSinceLastUpdate",i[i.Flag_New=10080]="Flag_New",i[i.Flag_IntendedWithdrawal=10090]="Flag_IntendedWithdrawal",i[i.Change_OriginCode=20010]="Change_OriginCode",i[i.Change_DocumentIdentifier=20020]="Change_DocumentIdentifier",i[i.Change_PublicationDate=20030]="Change_PublicationDate",i[i.Change_IssuingBody=20040]="Change_IssuingBody",i[i.Change_Status=20050]="Change_Status",i[i.Change_EffectiveDate=20060]="Change_EffectiveDate",i[i.Change_ConfirmationDate=20070]="Change_ConfirmationDate",i[i.Change_Classification=20080]="Change_Classification",i[i.Change_CommitteeReference=20090]="Change_CommitteeReference",i[i.Change_ExpiryDate=20100]="Change_ExpiryDate",i[i.Change_Certification=20110]="Change_Certification",i[i.Change_OriginalLanguage=20120]="Change_OriginalLanguage",i[i.Change_TitleDe=20130]="Change_TitleDe",i[i.Change_TitleEn=20140]="Change_TitleEn",i[i.Change_TitleFr=20150]="Change_TitleFr",i[i.Change_TitleOther=20160]="Change_TitleOther",i[i.Change_AvailableFrom=20170]="Change_AvailableFrom",i[i.Change_Translations=20180]="Change_Translations",i[i.Change_FormatPages=20190]="Change_FormatPages",i[i.Change_Price=20200]="Change_Price",i[i.Change_FullTextAddress=20210]="Change_FullTextAddress",i[i.Change_AbstractDe=20220]="Change_AbstractDe",i[i.Change_AbstractEn=20230]="Change_AbstractEn",i[i.Change_AbstractFr=20240]="Change_AbstractFr",i[i.Change_AbstractOther=20250]="Change_AbstractOther",i[i.Change_DescriptorsDe=20260]="Change_DescriptorsDe",i[i.Change_DescriptorsEn=20270]="Change_DescriptorsEn",i[i.Change_DescriptorsFr=20280]="Change_DescriptorsFr",i[i.Change_DescriptorsOther=20290]="Change_DescriptorsOther",i[i.Change_NotesEn=20300]="Change_NotesEn",i[i.Change_NotesFr=20310]="Change_NotesFr",i[i.Change_NotesDe=20320]="Change_NotesDe",i[i.Change_NotesOther=20330]="Change_NotesOther",i[i.Change_PublishedIn=20340]="Change_PublishedIn",i[i.Change_Handbook=20350]="Change_Handbook",i[i.Change_ReplacedBy=20360]="Change_ReplacedBy",i[i.Change_Replaces=20370]="Change_Replaces",i[i.Change_HistoryOfVersions=20380]="Change_HistoryOfVersions",i[i.Change_AmendedBy=20390]="Change_AmendedBy",i[i.Change_Amends=20400]="Change_Amends",i[i.Change_DraftSuperseded=20410]="Change_DraftSuperseded",i[i.Change_InternationalRelationship=20420]="Change_InternationalRelationship",i[i.Change_CrossReferences=20430]="Change_CrossReferences",i[i.Change_Legislation=20440]="Change_Legislation",i[i.Change_SortKey=20450]="Change_SortKey",i[i.Change_SectionalList=20460]="Change_SectionalList",i[i.Change_WithdrawalDate=20470]="Change_WithdrawalDate",i[i.Change_ProductId=20480]="Change_ProductId",i[i.Change_FullTextOnlineId=20490]="Change_FullTextOnlineId",i[i.Change_DateOfAppearance=20500]="Change_DateOfAppearance",i[i.Change_TransitionPeriod=20510]="Change_TransitionPeriod",i[i.Change_Overview=20520]="Change_Overview",i})(Q||{});var kD=(()=>{class i{constructor(){this._metadataLabel="common.metadata_label.",this._flagMap={[Q.Flag_Historic]:"observation.flag_h",[Q.Flag_WithdrawnSinceLastUpdate]:"observation.flag_w",[Q.Flag_PartiallyReplaced]:"observation.document_type_pr",[Q.Flag_PartiallyReplacedSinceLastUpdate]:"observation.flag_p",[Q.Flag_ModifiedByAmendments]:"observation.flag_m",[Q.Flag_AmendedSinceLastUpdate]:"observation.flag_a",[Q.Flag_ReInstated]:"observation.flag_r",[Q.Flag_IntendedWithdrawal]:"observation.flag_i",[Q.Flag_New]:"observation.flag_n"},this._metadataMap={[Q.Change_AbstractDe]:"abstractDe",[Q.Change_AbstractEn]:"abstractEn",[Q.Change_AbstractFr]:"abstractFr",[Q.Change_AbstractOther]:"abstractUnd",[Q.Change_SortKey]:"admSortKey",[Q.Change_AmendedBy]:"amendedBy",[Q.Change_Amends]:"amends",[Q.Change_DateOfAppearance]:"appearance",[Q.Change_CommitteeReference]:"author",[Q.Change_CrossReferences]:"citation",[Q.Change_Classification]:"classificationIcs",[Q.Change_ConfirmationDate]:"confirmation",[Q.Change_OriginCode]:"countryCode",[Q.Change_PublicationDate]:"dateOfIssue",[Q.Change_DescriptorsDe]:"descriptorDe",[Q.Change_DescriptorsEn]:"descriptorEn",[Q.Change_DescriptorsFr]:"descriptorFr",[Q.Change_DescriptorsOther]:"descriptorUnd",[Q.Change_DocumentIdentifier]:"documentNumber",[Q.Change_Status]:"documentType",[Q.Change_DraftSuperseded]:"draftSuperseded",[Q.Change_FullTextOnlineId]:"edvNr",[Q.Change_Effe
15ctiveDate]:"effective",[Q.Change_ExpiryDate]:"expiration",[Q.Change_FullTextAddress]:"fulltextAddress",[Q.Change_FormatPages]:"fulltextPages",[Q.Change_InternationalRelationship]:"internationalRelationship",[Q.Change_IssuingBody]:"issuing",[Q.Change_Certification]:"linkCertification",[Q.Change_Handbook]:"linkHandbook",[Q.Change_Legislation]:"linkLegislation",[Q.Change_PublishedIn]:"linkPublished",[Q.Change_NotesDe]:"noteDe",[Q.Change_NotesEn]:"noteEn",[Q.Change_NotesFr]:"noteFr",[Q.Change_NotesOther]:"noteUnd",[Q.Change_OriginalLanguage]:"originalLanguage",[Q.Change_Overview]:"overview",[Q.Change_Price]:"priceUndetermNote",[Q.Change_ProductId]:"productId",[Q.Change_AvailableFrom]:"publishing",[Q.Change_ReplacedBy]:"replacedBy",[Q.Change_Replaces]:"replaces",[Q.Change_SectionalList]:"sectionalList",[Q.Change_TitleDe]:"titleDe",[Q.Change_TitleEn]:"titleEn",[Q.Change_TitleFr]:"titleFr",[Q.Change_TitleOther]:"titleUnd",[Q.Change_TransitionPeriod]:"transitionPeriod",[Q.Change_Translations]:"translations",[Q.Change_HistoryOfVersions]:"version",[Q.Change_WithdrawalDate]:"withdrawalDate"}}transform(e){return this._flagMap[e]?this._flagMap[e]:this._metadataMap[e]?this._metadataLabel+this._metadataMap[e]:""}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"changeFlagToTranslationKey",type:i,pure:!0})}}return i})();var AD=(()=>{class i{transform(e,t){return t?.find(n=>n.value===e)?.text}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"displayItemText",type:i,pure:!0})}}return i})();var BD=(()=>{class i{transform(e){switch(e){case B.FILE_LINK_LOCAL:return"search.document_upload.link_local";case B.FILE_LINK_WWW:return"search.document_upload.link_url";case B.FILE_PAPER:return"search.document_upload.link_paper";case B.FILE_DIGITAL:return"search.document_upload.digital_document";case B.FILE_HOSTED:return"search.document_upload.link_hosted";default:return""}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"fileType",type:i,pure:!0})}}return i})();var $D=(()=>{class i{transform(e,t){return t.controls.findIndex(n=>n.value.id===e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"findIndex",type:i,pure:!0})}}return i})();var Qs=(()=>{class i{transform(e){let t=Array.isArray(e),n=!1,r;if(t)if(e[0])n=Object.hasOwn(e[0],"shortKey");else return"";if(n?r=e.map(a=>(r=a.shortKey,a?.childKeyList&&a.childKeyList.length>0&&(r+=" ("+a.childKeyList.join(", ")+")"),r)).join(", "):r=t?e.join(", "):e,t){let a="",l=e[0];l&&Object.hasOwn(l,"internationalRelationType")?(a=l.internationalRelationType,r=e.map(m=>`${m.relation}, ${a}`)):l&&Object.hasOwn(l,"relation")&&(r=e.map(m=>m.relation))}return r}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"formatTableItem",type:i,pure:!0})}}return i})();var fo=(()=>{class i{transform(e,t=120){return!e||t<=0||e.length<=t?e:e.slice(0,t)+"..."}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"truncate",type:i,pure:!0})}}return i})();var Zs=(()=>{class i{constructor(){this._authService=g(ue),this._configService=g(Se),this._httpClient=g(Fe),this._translocoService=g(ae),this._groupCollectionSubject=ne
15w oe(void 0),this.groupCollection$=this._groupCollectionSubject.asObservable(),this._filter={},this._lockGroupSubscriptions=[],this.refreshGroups(),this._langSubscription=this._translocoService.langChanges$.subscribe(()=>{let e=this._groupCollectionSubject.getValue();e&&this._groupCollectionSubject.next(e.map(t=>this.localizeName(t)))})}ngOnDestroy(){if(this._groupCollectionSubscription&&this._groupCollectionSubscription.unsubscribe(),this._userInfoSubscription&&this._userInfoSubscription.unsubscribe(),this._lockGroupSubscriptions)for(let e of this._lockGroupSubscriptions)e&&e.unsubscribe();this._langSubscription?.unsubscribe()}getUserListForDynamicGroup(e,t,n){--t;let r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/userlistdynamic?pageNumber=${t}&pageSize=${n}`;return this._httpClient.post(r,e,{observe:"response"}).pipe(S(a=>ne.isAccepted(a.status)?a.body:[]),k(()=>M([])))}updateGroup(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e.groupId}`;return this._httpClient.put(t,e,{observe:"response"}).pipe(S(n=>n.status===ge.OK),k(()=>M(!1)))}updateGroupFireAndForget(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e.groupId}`;this._httpClient.put(t,e).pipe().subscribe()}getGroupsById(e){return this.groupCollection$.pipe(S(t=>t.filter(n=>e.indexOf(n.groupId)>-1)))}createGroup(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups`;return this._httpClient.post(t,e,{observe:"response"}).pipe(S(n=>{if(ne.isAccepted(n.status)){let r={groupId:n.body.id,costCenters:[],hasFavorites:!1,hasLicenses:!1,hasNotes:!1,hasSites:!1,isDynamicGroup:!1,isSystemGroup:!1,license:[],licenseNames:[],lock:null,name:e.name,roles:[],tenantId:this._authService.userInfo.tenantId,userCount:0},a=this._groupCollectionSubject.getValue();return a.push(r),this._groupCollectionSubject.next(a),n.body.id}return null}),k(n=>{throw n.status}))}createGroupFireAndForget(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups`;this._httpClient.post(t,e,{observe:"response"}).pipe().subscribe()}lockGroup(e,t){let n=new Date().toISOString(),r;return new He(a=>{this._userInfoSubscription=this._authService.userInfo$.subscribe({next:l=>{if(l){r=l;let m={lockedById:r.userAccountId,reason:t,time:n};this._httpClient.post(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e.groupId}/lock`,m,{observe:"response"}).subscribe({next:b=>{if(b?.status&&ne.isAccepted(b.status)){if(b.body)this.updateLocalGroupsDataLockedStatus([e.groupId],b.body);else{let T={idOfExecutingUser:r.userAccountId,nameOfExecutingUser:r.username,reason:t,time:n,lockType:0,groupId:e.groupId};this.updateLocalGroupsDataLockedStatus([e.groupId],T)}a.next(!0)}else a.next(!1)},error:b=>{a.next(!1),a.error(b)},complete:()=>{a.complete()}})}}})})}lockGroups(e,t){let n=new Date().toISOString(),r,a=new Map;return new He(l=>(this._userInfoSubscription=this._authService.userInfo$.subscribe({next:m=>{if(m){r=m;let b={lockedById:r.userAccountId,reason:t,time:n};if(this._lockGroupSubscriptions)for(let T of this._lockGroupSubscriptions)T&&T.unsubscribe();for(let T of e){let O=this._httpClient.post(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${T}/lock`,b,{observe:"response"}).subscribe({next:U=>{U?.status?(U.status===ge.NO_CONTENT?(a.set(T.groupId,!0),this.updateLocalGroupsDataLockedStatus([T.groupId],U.body)):a.set(T.groupId,!1),l.next(!0)):(a.set(T.groupId,!1),l.next(!1))},error:()=>{l.next(!1),a.set(T.groupId,!1)}});this._lockGroupSubscriptions.push(O)}}}}),()=>{this._userInfoSubscription?.unsubscribe();for(let m of this._lockGroupSubscriptions)m?.unsubscribe()}))}unlockGroups(e){let t=e.map(n=>this._httpClient.delete(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${n.groupId}/lock`,{observe:"response"}).pipe(S(r=>ne.isAccepted(r.status)),Pt(200)));return qt(...t).pipe(Pt(200))}unlockGroup(e){return new He(t=>{this._httpClient.delete(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e.groupId}/lock`,{observe:"response"}).subscribe({next:n=>{n?.status&&ne.isAccepted(n.status)?(this.updateLocalGroupsDataLockedStatus([e.groupId],null),t.next(!0)):t.next(!1)},error:n=>{t.error(n)},complete:()=>{t.complete()}})})}unlinkUsersFromGroup(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e}/useraccounts/unlinked`,r=t.map(function(a){return{userAccountId:a}});return this._httpClient.post(n,r,{observe:"response"}).pipe(S(a=>a.status===ge.NO_CONTENT),Pt(200))}unlinkUserFromGroups(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${t}/unlinked`,r=e.map(function(a){return{groupId:a}});return this._httpClient.post(n,r,{observe:"response"}).pipe(S(a=>a.status===ge.NO_CONTENT),Pt(200))}deleteGroups(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/delete`;return this._httpClient.post(t,e,{observe:"response"}).pipe(S(n=>{if(n.ok){let a=this._groupCollectionSubject.getValue().reduce((l,m)=>(e.includes(m.groupId)||l.push(m))&&l,[]);return this._groupCollectionSubject.next(a),!0}return!1}),k(()=>M(!1)))}addUsersToGroups(e,t){let n=e.map(function(m){return{userAccountId:m}}),r=t.map(function(m){return{groupId:m}}),a={userAccounts:n,groups:r},l=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/useraccounts`;return this._httpClient.post(l,a,{observe:"response"}).pipe(S(m=>m.status===ge.NO_CONTENT),Pt(200))}getGroupsForUser(e){let t=this._groupCollectionSubject.getValue();return t&&t.length>0&&(t=t.filter(n=>e.groups&&e.groups.indexOf(n.groupId)>=0)),t}getGroupWithUsers(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e}/useraccounts`;return this.getGroupById(e).pipe(Re(n=>n?n.isDynamicGroup?M(ve(K({},n),{users:[]})):this._httpClient.get(t).pipe(S(r=>ve(K({},n),{users:r}))):M(null)))}refreshGroups(){this._groupCollectionSubscription?.unsubscribe(),this._groupCollectionSubscription=this.requestGroups(this._filter).pipe(li(void 0)).subscribe(e=>{this._groupCollectionSubject.next(e)})}setSort(e,t){this._sortField=e,this._sortDir=t,!(this._sortField==null||this._sortDir==null)&&this.refreshGroups()}setFilter(e){this._filter=e,this.refreshGroups()}getAllGroupsForTenant(){let e={};return new He(t=>{this.requestGroups(e).subscribe({next:n=>{t.next(n)}})})}filterFullGroups(e){let t={groupname:e};return this.requestGroups(t)}filterGroupsThumbnails(e,t,n){let r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/any/thumbnail?sortField=surname&sortDir=asc`;t!=null&&n!=null&&(r+=`&pageSize=${n}&pageNumber=${t}`);let a={};return e!=null&&(a.groupname=e),this._httpClient.post(r,a,{observe:"response"}).pipe(S(l=>ne.isAccepted(l.status)?l.body:null),k(()=>M(null)))}getDynamicGroupSelectOptions(){let e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return[{text:this._translocoService.translate("user_management.users.department"),value:"department",disabled:!1,format:"text"},{text:this._translocoService.translate("user_management.users.company"),value:"company",disabled:!1,format:"text"},{text:this._translocoService.translate("user_management.users.information"),value:"information",disabled:!1,format:"text"},{text:this._translocoService.translate("user_management.cost_center"),value:"cost_center",disabled:!1,format:"text"},{text:this._translocoService.translate("user_management.users.location"),value:"location",disabled:!1,format:"select"},{text:this._translocoService.translate("user_management.users.role"),value:"role",disabled:!1,format:"select"},{text:this._translocoService.translate("common.language"),value:"language",disabled:!1,format:"text"}].sort((t,n)=>e.compare(t.text,n.text))}getUsersByGroup(e,t,n){--t;let r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e}/useraccounts?pageNumber=${t}&pageSize=${n}`;return this._httpClient.get(r)}getUserCountForDynamicGroup(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/userlistdynamic/count`;return this._httpClient.post(t,e,{observe:"response"}).pipe(S(n=>ne.isAccepted(n.status)?n.body:0),k(()=>M(0)))}getStaticUserCount(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e}/useraccounts/count`;return this._httpClient.get(t)}getGroupById(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/${e}`;return this._httpClient.get(t,{observe:"response"}).pipe(S(n=>ne.isAccepted(n.status)?this.localizeName(n.body):null),k(()=>M(null)))}localizeName(e){if(!e)return e;let t=e.originalName??e.name;if(!e.isSystemGroup)return ve(K({},e),{originalName:t,name:t});let n="user_management.groups.system_all_users",r=this._translocoService.translate(n),a=r&&r!==n?r:t;return ve(K({},e),{originalName:t,name:a})}requestGroups(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/groups/any?pageNumber=0&pageSize=9999`;return t=ai.setSearchUrlSort(t,this._sortField,this._sortDir),this._httpClient.post(t,e).pipe(S(n=>(n??[]).map(r=>this.localizeName(r))),Nt())}updateLocalGroupsDataLockedStatus(e,t){if(this._groupCollectionSubject?.getValue()!=null){let n=JSON.parse(JSON.stringify(this._groupCollectionSubject.getValue()));
15for(let r of e)for(let a of n)a.groupId===r&&(a.lock=t);this._groupCollectionSubject.next(n)}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var dE=(()=>{class i{constructor(){this._groupService=g(Zs)}transform(e){return e?this._groupService.getGroupWithUsers(e).pipe(S(t=>t.users)):M([])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"usersInGroup",type:i,pure:!0})}}return i})();var Ad=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;function Js(i){try{return typeof i=="string"&&Intl.getCanonicalLocales(i).length>0}catch(o){return!1}}function Ld(i,o,e){let t=Ra(i);return t!==null?new Intl.NumberFormat(o,e).format(t):""}function Ud(i,o,e){return Xs(i)?new Intl.DateTimeFormat(o,e).format(i):""}function Xs(i){return i instanceof Date&&!isNaN(i)}function Bd(i){let o;if(typeof i=="string"&&(i=i.trim()),Xs(i))return i;if(!isNaN(i-parseFloat(i)))return new Date(parseFloat(i));if(typeof i=="string"&&/^(\d{4}-\d{1,2}-\d{1,2})$/.test(i)){let[e,t,n]=i.split("-").map(r=>parseInt(r,10));return new Date(e,t-1,n)}return typeof i=="string"&&(o=i.match(Ad))?Vd(o):new Date(i)}function Vd(i){let o=new Date(0),e=0,t=0,n=i[8]?o.setUTCFullYear:o.setFullYear,r=i[8]?o.setUTCHours:o.setHours;i[9]&&(e=+(i[9]+i[10]),t=+(i[9]+i[11])),n.call(o,+i[1],+i[2]-1,+i[3]);let a=+(i[4]||"0")-e,l=+(i[5]||"0")-t,m=+(i[6]||"0"),b=Math.round(parseFloat("0."+(i[7]||0))*1e3);return r.call(o,a,l,m,b),o}function Nr(i,o,e){let t=e.global?.[o]??{},n=e.localeBased?.[i]??{};return Reflect.has(n,o)?K(K({},t),n[o]):t}var $d={"aa-DJ":"DJF","aa-ER":"ERN","aa-ET":"ETB","ab-GE":"ETB","ab-TR":"ETB","af-BW":"ETB","af-NA":"ETB","af-ZA":"ZAR","ak-GH":"ZAR","am-ET":"ETB","am-IL":"ETB","ar-AE":"AED","ar-AR":"AED","ar-BH":"BHD","ar-CM":"BHD","ar-CY":"BHD","ar-DJ":"BHD","ar-DZ":"DZD","ar-EG":"EGP","ar-EH":"EGP","ar-ER":"EGP","ar-IL":"EGP","ar-IQ":"IQD","ar-IR":"IQD","ar-JO":"JOD","ar-KE":"JOD","ar-KM":"JOD","ar-KW":"KWD","ar-LB":"LBP","ar-LY":"LYD","ar-MA":"MAD","ar-ML":"MAD","ar-MR":"MAD","ar-NE":"MAD","ar-NG":"MAD","ar-OM":"OMR","ar-PS":"OMR","ar-QA":"QAR","ar-SA":"SAR","ar-SD":"SDD","ar-SS":"SDD","ar-SY":"SYP","ar-TD":"SYP","ar-TJ":"SYP","ar-TN":"TND","ar-TR":"TND","ar-YE":"YER","as-IN":"INR","av-RU":"INR","ay-BO":"INR","ay-PE":"INR","az-AZ":"AZM","ba-RU":"AZM","be-BY":"BYR","be-PL":"BYR","be-UA":"BYR","bg-BG":"BGN","bg-GR":"BGN","bg-MD":"BGN","bg-RO":"BGN","bg-TR":"BGN","bg-UA":"BGN","bi-VU":"BGN","bm-ML":"BGN","bn-BD":"BDT","bn-GB":"BDT","bn-IN":"INR","bn-NP":"INR","bo-CN":"CNY","bo-IN":"INR","bo-NP":"INR","br-FR":"EUR","bs-BA":"BAM","ca-AD":"EUR","ca-ES":"EUR","ca-FR":"EUR","ca-IT":"EUR","ce-RU":"EUR","ch-GU":"EUR","ch-MP":"EUR","co-FR":"EUR","cs-CZ":"CZK","cv-RU":"RUB","cy-AR":"RUB","cy-GB":"GBP","da-DE":"GBP","da-DK":"DKK","da-GL":"DKK","da-IS":"DKK","de-AT":"EUR","de-BE":"EUR","de-BR":"EUR","de-CA":"EUR","de-CH":"CHF","de-CZ":"CHF","de-DE":"EUR","de-DK":"EUR","de-HU":"EUR","de-IT":"EUR","de-KZ":"EUR","de-LI":"EUR","de-LU":"EUR","de-NA":"EUR","de-PL":"EUR","de-PY":"EUR","de-RO":"EUR","de-SK":"EUR","de-US":"EUR","dv-IN":"EUR","dv-MV":"MVR","dz-BT":"BTN","dz-IN":"BTN","ee-GH":"BTN","ee-TG":"BTN","el-AL":"BTN","el-CY":"EUR","el-DE":"EUR","el-EG":"EUR","el-GB":"EUR","el-GR":"EUR","el-IT":"EUR","el-RO":"EUR","el-TR":"EUR","el-UA":"EUR","en-AC":"EUR","en-AG":"XCD","en-AI":"XCD","en-AS":"XCD","en-AU":"AUD","en-AW":"AUD","en-BB":"AUD","en-BE":"AUD","en-BM":"AUD","en-BN":"AUD","en-BS":"AUD","en-BW":"BWP","en-BZ":"BWP","en-CA":"CAD","en-CC":"CAD","en-CK":"CAD","en-CM":"CAD","en-CN":"CAD","en-CX":"CAD","en-DE":"CAD","en-DG":"CAD","en-DM":"CAD","en-DO":"CAD","en-ES":"CAD","en-ET":"CAD","en-FI":"CAD","en-FJ":"CAD","en-FK":"CAD","en-FM":"CAD","en-FR":"CAD","en-GB":"GBP","en-GD":"GBP","en-GG":"GBP","en-GH":"GBP","en-GI":"GBP","en-GM":"GBP","en-GU":"GBP","en-GY":"GBP","en-HK":"HKD","en-HN":"HKD","en-IE":"EUR","en-IL":"EUR","en-IM":"EUR","en-IN":"INR","en-IO":"INR","en-IT":"INR","en-JE":"INR","en-JM":"INR","en-KE":"INR","en-KI":"INR","en-KN":"INR","en-KY":"INR","en-LB":"INR","en-LC":"INR","en-LK":"INR","en-LR":"INR","en-LS":"INR","en-MG":"INR","en-MH":"INR","en-MP":"INR","en-MS":"INR","en-MT":"INR","en-MU":"INR","en-MW":"INR","en-MY":"INR","en-NA":"INR","en-NF":"INR","en-NG":"NGN","en-NL":"NGN","en-NR":"NGN","en-NU":"NGN","en-NZ":"NZD","en-PA":"NZD","en-PG":"NZD","en-PH":"PHP","en-PI":"PHP","en-PK":"PHP","en-PM":"PHP","en-PN":"PHP","en-PR":"PHP","en-PW":"PHP","en-RW":"PHP","en-SB":"PHP","en-SC":"PHP","en-SG":"SGD","en-SH":"SGD","en-SL":"SGD","en-SS":"SGD","en-SZ":"SGD","en-TA":"SGD","en-TC":"SGD","en-TK":"SGD","en-TO":"SGD","en-TT":"SGD","en-TV":"SGD","en-TZ":"SGD","en-UD":"SGD","en-UG":"SGD","en-UM":"SGD","en-US":"USD","en-VC":"USD","en-VG":"USD","en-VI":"USD","en-VU":"USD","en-WS":"USD","en-ZA":"ZAR","en-ZM":"ZAR","en-ZW":"ZWD","eo-EO":"ZWD","eo-SM":"ZWD","es-AD":"ZWD","es-AR":"ARS","es-BO":"BOB","es-BZ":"BOB","es-CL":"CLP","es-CO":"COP","es-CR":"CRC","es-CU":"CRC","es-DE":"CRC","es-DO":"DOP","es-EA":"DOP","es-EC":"USD","es-ES":"EUR","es-GQ":"EUR","es-GT":"GTQ","es-HN":"HNL","es-IC":"HNL","es-LA":"HNL","es-MA":"HNL","es-MX":"MXN","es-NI":"NIO","es-PA":"PAB","es-PE":"PEN","es-PH":"PEN","es-PR":"USD","es-PY":"PYG","es-SV":"SVC","es-TT":"SVC","es-US":"USD","es-UY":"UYU","es-VE":"VEB","et-EE":"EEK","et-FI":"EEK","eu-ES":"EUR","eu-FR":"EUR","fa-AE":"EUR","fa-AF":"EUR","fa-IQ":"EUR","fa-IR":"IRR","fa-OM":"IRR","fa-PK":"IRR","fa-QA":"IRR","fa-TJ":"IRR","fb-LT":"IRR","ff-GN":"IRR","ff-MR":"IRR","ff-SN":"IRR","fi-FI":"EUR","fi-RU":"EUR","fi-SE":"EUR","fj-FJ":"EUR","fo-FO":"DKK","fr-AD":"DKK","fr-BE":"EUR","fr-BF":"EUR","fr-BI":"EUR","fr-BJ":"EUR","fr-BL":"EUR","fr-CA":"CAD","fr-CD":"CAD","fr-CF":"CAD","fr-CG":"CAD","fr-CH":"CHF","fr-CI":"CHF","fr-CM":"CHF","fr-CP":"CHF","fr-DJ":"CHF","fr-DZ":"CHF","fr-FR":"EUR","fr-GA":"EUR","fr-GB":"EUR","fr-GF":"EUR","fr-GN":"EUR","fr-GP":"EUR","fr-GQ":"EUR","fr-HT":"EUR","fr-IT":"EUR","fr-KM":"EUR","fr-LB":"EUR","fr-LU":"EUR","fr-MA":"EUR","fr-MC":"EUR","fr-MF":"EUR","fr-MG":"EUR","fr-ML":"EUR","fr-MQ":"EUR","fr-MR":"EUR","fr-MU":"EUR","fr-NC":"EUR","fr-NE":"EUR","fr-PF":"EUR","fr-PM":"EUR","fr-RE":"EUR","fr-RW":"EUR","fr-SC":"EUR","fr-SN":"EUR","fr-SY":"EUR","fr-TD":"EUR","fr-TF":"EUR","fr-TG":"EUR","fr-TN":"EUR","fr-US":"EUR","fr-VU":"EUR","fr-WF":"EUR","fr-YT":"EUR","fy-NL":"EUR","ga-GB":"EUR","ga-IE":"EUR","gd-GB":"GBP","gl-ES":"EUR","gl-PT":"EUR","g
15n-AR":"EUR","gn-BO":"EUR","gn-PY":"EUR","gu-IN":"INR","gu-KE":"INR","gv-IM":"INR","he-IL":"ILS","hi-FJ":"ILS","hi-IN":"INR","hi-NP":"INR","hi-UG":"INR","hi-ZA":"INR","ho-PG":"INR","hr-AT":"INR","hr-BA":"INR","hr-DE":"INR","hr-HR":"HRK","hr-HU":"HRK","hr-IT":"HRK","ht-HT":"HTG","hu-AT":"HTG","hu-HU":"HUF","hu-IL":"HUF","hu-RO":"HUF","hu-RS":"HUF","hu-SI":"HUF","hu-SK":"HUF","hu-UA":"HUF","hy-AM":"AMD","hy-CY":"AMD","hy-GE":"AMD","hy-IR":"AMD","hy-LB":"AMD","hy-SY":"AMD","hy-TR":"AMD","ia-SE":"AMD","id-ID":"IDR","id-NL":"IDR","ig-NG":"NGN","ii-CN":"NGN","ik-US":"NGN","is-IS":"ISK","it-AU":"ISK","it-BR":"ISK","it-CA":"ISK","it-CH":"CHF","it-DE":"CHF","it-FR":"CHF","it-GB":"CHF","it-HR":"CHF","it-IT":"EUR","it-SI":"EUR","it-SM":"EUR","it-US":"EUR","it-VA":"EUR","iu-GL":"EUR","ja-BR":"EUR","ja-JP":"JPY","jv-ID":"JPY","jv-MY":"JPY","ka-GE":"GEL","ka-IR":"GEL","ka-TR":"GEL","kg-CD":"GEL","ki-KE":"GEL","kj-NA":"GEL","kl-DK":"GEL","kl-GL":"DKK","km-KH":"KHR","kn-IN":"INR","ko-BR":"INR","ko-CN":"INR","ko-JP":"INR","ko-KP":"INR","ko-KR":"KRW","ko-US":"KRW","ks-GB":"KRW","ks-IN":"INR","ks-PK":"INR","ku-TR":"TRY","kw-GB":"GBP","la-VA":"GBP","lb-LU":"GBP","lg-UG":"UGX","li-NL":"EUR","ln-CD":"EUR","ln-CG":"EUR","lo-LA":"LAK","lt-LT":"LTL","lu-CD":"LTL","lv-LV":"LVL","mg-MG":"MGA","mh-MH":"MGA","mi-NZ":"NZD","mk-AL":"NZD","mk-GR":"NZD","mk-MK":"MKD","ml-AE":"MKD","ml-BH":"MKD","ml-GB":"MKD","ml-IL":"MKD","ml-IN":"INR","ml-MY":"INR","ml-QA":"INR","ml-SG":"INR","mr-IN":"INR","ms-BN":"INR","ms-CC":"INR","ms-ID":"INR","ms-MY":"MYR","ms-SG":"MYR","mt-MT":"EUR","my-BD":"EUR","my-MM":"MMK","na-NR":"MMK","nb-NO":"NOK","nb-SJ":"NOK","nd-ZW":"NOK","ne-BT":"NOK","ne-IN":"NOK","ne-NP":"INR","ng-NA":"INR","nl-AW":"AWG","nl-BE":"EUR","nl-DE":"EUR","nl-FR":"EUR","nl-NL":"EUR","nl-SR":"EUR","nn-NO":"NOK","nr-ZA":"ZAR","nv-US":"ZAR","ny-MW":"ZAR","ny-MZ":"ZAR","ny-ZM":"ZAR","ny-ZW":"ZAR","oc-FR":"EUR","om-ET":"ETB","om-KE":"KES","om-SO":"KES","or-IN":"INR","os-GE":"INR","pa-IN":"INR","pl-CZ":"INR","pl-DE":"INR","pl-IL":"INR","pl-PL":"PLN","pl-RO":"PLN","pl-SK":"PLN","pl-UA":"PLN","ps-AE":"PLN","ps-AF":"AFN","ps-IR":"AFN","ps-PK":"AFN","pt-AG":"AFN","pt-AO":"AFN","pt-BR":"BRL","pt-CV":"BRL","pt-FR":"BRL","pt-GW":"BRL","pt-MO":"BRL","pt-MZ":"BRL","pt-PT":"EUR","pt-ST":"EUR","pt-TL":"EUR","qu-BO":"EUR","qu-PE":"EUR","rm-CH":"EUR","rn-BI":"EUR","ro-HU":"EUR","ro-IL":"EUR","ro-MD":"EUR","ro-RO":"RON","ro-RS":"RON","ro-UA":"RON","ru-BY":"RON","ru-CN":"RON","ru-DE":"RON","ru-EE":"RON","ru-FI":"RON","ru-GE":"RON","ru-IL":"RON","ru-KG":"RON","ru-KZ":"RON","ru-LT":"RON","ru-LV":"RON","ru-MD":"RON","ru-MN":"RON","ru-RU":"RUB","ru-SJ":"RUB","ru-TM":"RUB","ru-UA":"UAH","ru-US":"UAH","ru-UZ":"UAH","rw-CD":"UAH","rw-RW":"RWF","rw-UG":"RWF","sa-IN":"INR","se-FI":"INR","se-NO":"NOK","se-SE":"NOK","sg-CF":"NOK","si-LK":"LKR","sk-HU":"LKR","sk-RS":"LKR","sk-SK":"EUR","sl-AT":"EUR","sl-HU":"EUR","sl-IT":"EUR","sl-SI":"EUR","sm-AS":"EUR","sm-WS":"EUR","sn-ZW":"EUR","so-DJ":"DJF","so-ET":"ETB","so-KE":"ETB","so-SO":"SOS","sq-AL":"ALL","sq-GR":"ALL","sq-ME":"ALL","sq-MK":"MKD","sq-RS":"MKD","sq-TR":"MKD","sr-RS":"RSD","ss-LS":"RSD","ss-SZ":"RSD","ss-ZA":"ZAR","st-LS":"ZAR","st-ZA":"ZAR","su-ID":"ZAR","sv-AX":"ZAR","sv-FI":"EUR","sv-SE":"SEK","sw-BI":"SEK","sw-CD":"SEK","sw-KE":"SEK","sw-MZ":"SEK","sw-SO":"SEK","sw-TZ":"SEK","sw-UG":"SEK","sw-YT":"SEK","sw-ZA":"SEK","ta-IN":"INR","ta-LK":"INR","ta-MU":"INR","ta-MY":"INR","ta-RE":"INR","ta-SG":"INR","te-IN":"INR","th-TH":"THB","ti-ER":"ERN","ti-ET":"ETB","ti-IL":"ETB","tk-AF":"ETB","tk-IR":"ETB","tk-TM":"TMM","tl-PH":"PHP","tl-US":"PHP","tn-BW":"PHP","tn-NA":"PHP","tn-ZA":"ZAR","tn-ZW":"ZAR","to-TO":"ZAR","tr-BG":"ZAR","tr-CY":"TRY","tr-DE":"TRY","tr-GR":"TRY","tr-MK":"TRY","tr-NL":"TRY","tr-RO":"TRY","tr-TR":"TRY","tr-UA":"TRY","tr-UZ":"TRY","ts-MZ":"TRY","ts-SZ":"TRY","ts-ZA":"ZAR","tt-RU":"RUB","ty-PF":"RUB","uk-PL":"RUB","uk-SK":"RUB","uk-UA":"UAH","ur-IN":"UAH","ur-MU":"UAH","ur-PK":"PKR","ve-ZA":"ZAR","ve-ZW":"ZAR","vi-CN":"ZAR","vi-US":"ZAR","vi-VN":"VND","wa-BE":"EUR","xh-LS":"EUR","xh-ZA":"ZAR","yi-UA":"ZAR","yo-BJ":"ZAR","yo-NG":"NGN","za-CN":"NGN","zh-CN":"CNY","zh-HK":"HKD","zh-TW":"TWD","zu-LS":"TWD","zu-MW":"TWD","zu-MZ":"TWD","zu-SZ":"TWD","zu-ZA":"ZAR"},Hd={localeConfig:{global:{},localeBased:{}},defaultLocale:"en-US",defaultCurrency:"USD",localeToCurrencyMapping:$d,langToLocaleMapping:{}},el=new Ke(""),tl=new Ke(""),il=new Ke(""),Ar=new Ke(""),nl=new Ke(""),ol=new Ke(""),rl=new Ke(""),kr=class{transform(o,e,t){return Ud(o,e,t)}},Rr=class{transform(o,e,t,n){return Ld(o,t,ve(K({},n),{style:e}))}},Kd=(()=>{class i{translocoService=g(ae);langLocaleMapping=g(il);defaultLocale=g(el);defaultCurrency=g(tl);localeCurrencyMapping=g(nl);numberTransformer=g(rl);dateTransformer=g(ol);localeConfig=g(Ar);browserLocale=Aa()||this.defaultLocale;_locale="";locale=new oe(this._locale);localeChanges$=this.locale.pipe(_t());constructor(){g(ra).onDestroy(()=>{this.locale.complete(),this.locale.unsubscribe()}),this.setLocale(this.initializeLocale()),this.translocoService.langChanges$.pipe(S(e=>this.toLocale(e)),We(Boolean),Na()).subscribe(e=>this.setLocale(e))}getDefaultLocale(){return this.defaultLocale}getLocale(){return this._locale}setLocale(e){if(!Js(e)){console.error(`${e} isn't a valid locale format`);return}this.locale.next(e),this._locale=e}getCurrencySymbol(e=this.getLocale()){let t=this.localeCurrencyMapping[e],n=new Intl.NumberFormat(e,{style:"currency",currencyDisplay:"symbol",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}),r=0;return n.format(r).split(r.toString()).map(a=>a.trim()).find(a=>!!a)}localizeDate(e,t=this.getLocale(),n={}){let r=n??Nr(t,"date",this.localeConfig);return this.dateTransformer.transform(Bd(e),t,r)}localizeNumber(e,t,n=this.getLocale(),r){let a=r??Nr(n,t,this.localeConfig);return t==="currency"&&(a=ve(K({},a),{currency:a.currency||this._resolveCurrencyCode(n)})),this.numberTransformer.transform(e,t,n,a)}
15_resolveCurrencyCode(e=this.getLocale()){return this.localeCurrencyMapping[e]||this.defaultCurrency}toLocale(e){return this.langLocaleMapping[e]?this.langLocaleMapping[e]:Js(e)?e:""}initializeLocale(){let e=this.toLocale(this.browserLocale);if(e)return e;let t=this.translocoService.getActiveLang();if(t){let r=this.toLocale(t);if(r)return r}let n=this.toLocale(this.defaultLocale);return n||this.defaultLocale}static \u0275fac=function(t){return new(t||i)};static \u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Gd=(()=>{class i{localeService=g(Kd);cdr=g(ze);localeChangeSub=this.localeService.localeChanges$.subscribe(()=>this.cdr.markForCheck());getLocale(e){return e||this.localeService.getLocale()}ngOnDestroy(){this.localeChangeSub?.unsubscribe(),this.localeChangeSub=null}static \u0275fac=function(t){return new(t||i)};static \u0275prov=te({token:i,factory:i.\u0275fac})}return i})();var yE=(()=>{class i extends Gd{localeConfig=g(Ar);transform(e,t={},n){return ka(e)?"":(n=this.getLocale(n),this.localeService.localizeDate(e,n,K(K({},Nr(n,"date",this.localeConfig)),t)))}static \u0275fac=(()=>{let e;return function(n){return(e||(e=aa(i)))(n||i)}})();static \u0275pipe=Le({name:"translocoDate",type:i,pure:!1})}return i})();var Lr=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=rt({type:i});static \u0275inj=ot({})}return i})();function xE(i){let o=K(K({},Hd),i);return[qd(o.localeConfig),jd(o.defaultLocale),Yd(o.defaultCurrency),Wd(o.langToLocaleMapping),zd(o.localeToCurrencyMapping),Qd(kr),Zd(Rr)]}function qd(i){return ci([{provide:Ar,useValue:i}])}function Wd(i){return ci([{provide:il,useValue:i}])}function zd(i){return ci([{provide:nl,useValue:i}])}function jd(i){return ci([{provide:el,useValue:i}])}function Yd(i){return ci([{provide:tl,useValue:i}])}function Qd(i){return ci([{provide:ol,useClass:i}])}function Zd(i){return ci([{provide:rl,useClass:i}])}var Pi=(function(i){return i.ACCODE="acCode",i.AMENDEDBY="amendedBy",i.AMENDS="amends",i.AUTHOR="author",i.CITATION="citation",i.CLASSIFICATION_ICS="classificationIcs",i.CLASSIFICATION_OTHER="classificationOther",i.COUNTRYCODE="countryCode",i.DESCRIPTORDE="descriptorDe",i.DESCRIPTOREN="descriptorEn",i.DESCRIPTORFR="descriptorFr",i.DESCRIPTORUND="descriptorUnd",i.DOCUMENTIDENTIFIER="documentIdentifier",i.DOCUMENTTYPE="documentType",i.DRAFTSUPERSEDED="draftSuperseded",i.FAVORITESFOLDERS="favoritesFolders",i.FLAGSTATUS="flagStatus",i.INTERNATIONALRELATIONSHIP="internationalRelationship",i.ISSUING="issuing",i.LEGISLATION="legislation",i.LINKHANDBOOK="linkHandbook",i.LINKLEGISLATION="linkLegislation",i.LINKPUBLISHED="linkPublished",i.NOTESFOLDERS="notesFolders",i.ORIGINALLANGUAGE="originalLanguage",i.PUBLICATIONDATE="publicationDate",i.PUBLISHING="publishing",i.REPLACEDBY="replacedBy",i.REPLACES="replaces",i.SECTIONALLIST="sectionalList",i.TRANSLATIONS="translations",i})(Pi||{});var st=class{static someToAssociatedDocumentModel(o){let e={id:o.id,din21Id:o.din21Id,description:o.description,language:o.language.toUpperCase(),documentType:o.documentType,file:o.type===B.FILE_HOSTED?o.fileName:void 0,saved:!0,deleted:!1,type:o.type,link:"",url:"",hostedFileId:o.hostedFileId,valid:!0,errors:[]};return o.type===B.FILE_LINK_WWW&&(e.url=o.url),(o.type===B.FILE_LINK_LOCAL||o.type===B.FILE_DIGITAL)&&(e.link=o.url),o.type===B.FILE_DIGITAL&&(e.type=B.FILE_LINK_LOCAL),e.building=o.building||"",e.room=o.room||"",e.locker=o.cabinet||"",e.location=o.location||"",e}static convertValueListSeparator(o,e){let t=["author","classificationIcs","countryCode","documentType","flagStatus","originalLanguage"];for(let n in t){let r=o[t[n]],a=t[n],l=re.detectStringSeparator(o[t[n]]),m=r.split(l);m=m.map(b=>b.trim()),o[a]=m.join(e)}return o}static presetFieldsToFieldConfiguration(o,e){return e?(o=o.filter(t=>t.key!=="title"),o.map(t=>{let n=e.filter(r=>r.key===t.key)[0];return n?{key:t.key,label:t.key,type:n.type,ordinal:t.ordinal}:null}).filter(t=>!!t)):null}static metadataMapToFieldConfiguration(o){return o?Array.from(o).map(e=>({key:e[0],label:e[1].id,type:e[1].type,ordinal:1})):[]}static standardReferenceRequestDtoToStringList(o){return o.map(e=>e.acCode)}static csFragmentToMetadataModel(o){return JSON.parse(o)}static customFragmentToMetadataModel(o){return JSON.parse(o)}static normalizeEmptyStrings(o){let e={};for(let[t,n]of Object.entries(o))e[t]=n===""?null:n;return e}static stripCTag(o){let e=/C\(([A-Z]*)\)/gm;return o.replace(e,"$1")}static convertStringToStandardReferenceRequestDto(o){let e=[];
15if(!o)return null;if(!Array.isArray(o)){let t=re.detectStringSeparator(o),n=o.split(t);for(let r=0;r<n.length;r++){let a={acCode:null,value:n[r].trim()};e.push(a)}}return e}static licenseSummaryResponseDtoToLicenseSummaryModel(o){let e=o.groups.map(n=>n.name);return{id:o.id,title:o.title,description:o.description,users:o.users,groups:o.groups,createdOn:o.createdOn,changedOn:o.changedOn,licenseType:o.licenseType,groupNames:e}}static favoriteItemsToFavoriteFolderDetailsModels(o){return o.map(e=>({folderId:e.favoritesFolderId,name:e.name,path:e.path,fullPath:e.fullPath,description:e.description,isSharedFromMe:e.isSharedFromMe,isSharedWithMe:e.isSharedWithMe,ownedByMe:e.ownedByMe}))}};var go=(()=>{class i{constructor(){this._searchConfig=g(hi),this._configService=g(Se),this._httpClient=g(Fe),this._languageStorageService=g(_i),this._searchService=g(Jt),this._shortKeyMapSubject=new oe(null),this._validFieldsMapSubject=new oe({}),this._flagStatusCache$=null,this._documentTypeCache$=null,this._languageStorageService.currentLanguage$.subscribe(e=>{this._currentLanguage=e}),this.shortKeyMap$=this._shortKeyMapSubject.asObservable()}getIcsClassificationRootNodes(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/ics/parents`;return this._httpClient.get(e).pipe(S(t=>{let n=[];for(let r of t){let a=i.icsClassificationResponseDtoToIcsClassificationTreeNodeModel(r);n.push(a)}return n}))}filterIcsClassificationNodes(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/ics`,n={};return this._currentLanguage==="de"?n.germanTitle=e:this._currentLanguage==="en"?n.englishTitle=e:n.frenchTitle=e,this._httpClient.post(t,n).pipe(S(r=>{let a=[];for(let l of r){let m=i.icsClassificationResponseDtoToIcsClassificationTreeNodeModel(l);a.push(m)}return a}))}getIcsClassificationByIcsKeyList(e){if(e&&Array.isArray(e)&&e.length>0){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/ics/icsKeys`;return this._httpClient.get(t,{params:{key:e}}).pipe(k(()=>M(null)))}else return M(null)}filterValueListNodes(e,t){let n=t===Pi.FLAGSTATUS?"documentstatus":t.toLowerCase(),r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${n}`,a={};return this._currentLanguage==="de"?a.germanTitle=e:this._currentLanguage==="en"?a.englishTitle=e:a.frenchTitle=e,this._httpClient.post(r,a).pipe(S(l=>{let m=[];for(let b of l){let T=i.toValueListTreeNodeModel(b);m.push(T)}return m}))}getIcsClassificationChildren(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/ics/${e}/childs`;return this._httpClient.get(t).pipe(S(n=>{let r=[];for(let a of n){let l=i.icsClassificationResponseDtoToIcsClassificationTreeNodeModel(a);r.push(l)}return r}))}getValueListFlagStatusRootNodes(){return this.getFlagStatus().pipe(S(e=>i.toValueListFlagStatusModel(e)))}getFlagStatusDetailsByKeyStringList(e){return this.getFlagStatus().pipe(S(t=>{let n=[];return t.forEach(r=>{let a=i.toValueListTreeNodeModel(r),l=a.shortKey;e.includes(l)&&n.push(a)}),n}))}getFlagStatusDetailsByKeyList(e){let t=e.map(n=>{let r=n.shortKey;return n?.childKeyList?.length&&(r+=", "+n.childKeyList.join(", ")),r});return this.getFlagStatus().pipe(S(n=>{let r=[];return n.forEach(a=>{let l=i.toValueListTreeNodeModel(a),m=l.shortKey.split("(")[0];t.includes(m)&&r.push(l)}),r}))}getDocumentTypeDetailsByKeyList(e){return this.getDocumentType().pipe(S(t=>{let n=[];for(let r of t){let a=i.toValueListTreeNodeModel(r);e.includes(a.shortKey)&&n.push(a)}return n}))}getAllDocumentTypesDetails(){return this.getDocumentType().pipe(S(e=>e.map(t=>i.toValueListTreeNodeModel(t))))}filterFlagStatusValueListNodes(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentstatus`,n={};return this._currentLanguage==="de"?n.germanTitle=e:this._currentLanguage==="en"?n.englishTitle=e:n.frenchTitle=e,this._httpClient.post(t,n).pipe(S(r=>i.toValueListFlagStatusModel(r,!0)))}getValueListRootNodes(e){let t=i.mapFieldToUrl(e),n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${t}`;return this._httpClient.get(n).pipe(S(i.convertExtendedValueListItemDtoToValueListTreeNodeNodel))}getAdvancedSearchSuggestions(e,t){let n=i.mapFieldToUrl(t),r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${n}/suggestions`,a={text:e,language:this._currentLanguage,count:this._searchConfig.advancedSearchAutocompleteCount};return this._httpClient.post(r,a).pipe(S(l=>l.map(m=>{let b;switch(this._currentLanguage){case"de":b=m.germanTitle;break;case"en":b=m.englishTitle;break;case"fr":b=m.frenchTitle;break;default:b=m.germanTitle;break}let T=m.icsKey??m.shortKey;return{displayTitle:b,searchTerm:T}})))}areValidValueListEntries(e,t){let n;return typeof t=="string"?n=t.split(",").map(r=>r.trim()):n=t,Ot(n.map(r=>this.isValidValueListEntry(e,r))).pipe(S(r=>r.every(Boolean)),tt(1))}isValidValueListEntry(e,t){return this.shortKeyMap$.pipe(We(n=>n!==null),Lt(n=>{if(!n)return M(!1);if(e!=null&&e.length>0&&t&&t.length>0){let r=!0;if(e===Pi.DOCUMENTTYPE)return this.isDoctypeValueValid(t).pipe(Lt(a=>{r=a;
15let l=re.clone(this._validFieldsMapSubject.getValue());return l[e]=r,this._validFieldsMapSubject.next(r?l:{}),M(r)}));{let a=t;e===Pi.FLAGSTATUS&&(a=st.stripCTag(a)),a=a.replaceAll(",","OR"),a.split(/ OR | NOT | AND /).map(b=>b.trim()).forEach(b=>{let T=!1,O=e;n[O]&&n[O].filter(H=>H.toLowerCase()===b.toLowerCase()).length>0&&(T=!0),T||(r=!1)});let m=re.clone(this._validFieldsMapSubject.getValue());return m[e]=r,this._validFieldsMapSubject.next(m),M(r)}}else if(e!=null&&e.length>0){let r=re.clone(this._validFieldsMapSubject.getValue()),a=!!t||t===""||t.length===0;return r[e]=a,this._validFieldsMapSubject.next(r),M(a)}else return M(!1)}),k(()=>M(!1)))}getShortKeyMapValueList(e){let t=this._shortKeyMapSubject.getValue()??{},n=e.map(i.mapUrlToFieldId).filter(a=>!t[a]);if(n.length===0)return M(t);let r=n.map((a,l)=>this.getValueListFor(e[l]));return et(r).pipe(S(a=>{for(let l=0;l<n.length;l++)t[n[l]]=a[l];return this._shortKeyMapSubject.next(t),t}),k(()=>M(t)))}clearValueListCache(){this._shortKeyMapSubject.next(null),this._flagStatusCache$=null,this._documentTypeCache$=null}getValueListFieldKeys(e){let t=["favoritesFolders","notesFolders","documentOwners","modifiedBy","createdBy","refDocNrSpecial"];return Array.from(e.values()).filter(n=>(n.type==="valueList"||n.type.includes("valueListShortKey"))&&!t.includes(n.id)).map(n=>n.id)}initializeValueListFields(e){let t=this.getValueListFieldKeys(e);this.getShortKeyMapValueList(t).subscribe()}static mapUrlToFieldId(e){let t=new Map().set("countrycode","countryCode").set("documentstatus","flagStatus").set("documenttype","documentType").set("ics","classificationIcs").set("internationalrelationships","internationalRelationship").set("linkpublished","linkPublished").set("legislations","linkLegislation").set("originallanguage","originalLanguage").set("sectional","sectionalList");return t.get(e)?t.get(e):e}addClassificationPro(e){let t=this._shortKeyMapSubject.value??{},n=ve(K({},t),{classificationPro:[...t.classificationPro??[],e]});this._shortKeyMapSubject.next(n)}static convertExtendedValueListItemDtoToValueListTreeNodeNodel(e){let t=[];for(let n of e){let r=i.toValueListTreeNodeModel(n);t.push(r)}return t}getValueListFor(e){let t=i.mapFieldToUrl(e),n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${t}/allkeys`;return this._httpClient.get(n)}isDoctypeValueValid(e){return this.shortKeyMap$.pipe(Lt(t=>{if(t){let r=e.replaceAll(",","OR").split(/ OR | NOT | AND /).map(l=>l.trim()),a=!1;if(Object.hasOwn(t,Pi.DOCUMENTTYPE)){let l=t[Pi.DOCUMENTTYPE],m=!1,b=0;for(let T of r)for(let O of l)if(O.trim().toLocaleLowerCase()===T.trim().toLocaleLowerCase()){b++;break}return b===r.length&&(m=!0),M(m)}return a?M(!1):this._searchService.getDoctypeAbbreviationForSearchTerm(e).pipe(S(l=>l&&l.length>0?!0:e==null||e===""))}else return M(!1)}),k(()=>M(!1)))}getFlagStatus(){if(!this._flagStatusCache$){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentstatus`;this._flagStatusCache$=this._httpClient.get(e).pipe(Nt(1))}return this._flagStatusCache$}getDocumentType(){if(!this._documentTypeCache$){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documenttype`;this._documentTypeCache$=this._httpClient.get(e).pipe(Nt(1))}return this._documentTypeCache$}static mapFieldToUrl(e){let t=new Map().set("countryCode","countrycode").set("flagStatus","documentstatus").set("documentType","documenttype").set("classificationIcs","ics").set("internationalRelationship","internationalrelationships").set("linkLegislation","legislations").set("linkPublished","linkpublished").set("originalLanguage","originallanguage").set("sectionalList","sectional").set("classificationPro","metadata/classification-pro");return t.get(e)?t.get(e):e}static icsClassificationResponseDtoToIcsClassificationTreeNodeModel(e){return{id:e.id,tenantId:e.tenantId,icsKey:e.icsKey,englishTitle:e.englishTitle,frenchTitle:e.frenchTitle,germanTitle:e.germanTitle,hasChildren:e.hasChilds,children:void 0,title:""}}static toValueListTreeNodeModel(e){return{id:e.id,tenantId:e.tenantId,shortKey:e.shortKey,englishTitle:e.englishTitle,frenchTitle:e.frenchTitle,germanTitle:e.germanTitle,hasChildren:!1,children:void 0,title:""}}static toValueListFlagStatusModel(e,t=!1){let n=[],r=[];for(let l of e){let m=i.toValueListTreeNodeModel(l);l.isWeekly?r.push(m):n.push(m)}let a=[];if(t)a=n;else{let l=[];
15n.forEach(m=>{m.shortKey.length>1?l.push(m):(a.push(m),m.shortKey==="C"&&(m.children=l))})}return{monthlyFlags:a,weeklyFlags:r}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function Jd(i,o){if(i&1&&(c(0,"p",6),v(1),h(2,"transloco"),d()),i&2){let e=p(2);P("data-cy",e.searchField+"ErrorMessage"),s(),F(" ",C(2,2,"search.extended_search.search_field_invalid")," ")}}function Xd(i,o){if(i&1){let e=w();c(0,"form",1)(1,"div",2),y(2,"input",3,0),h(4,"transloco"),c(5,"button",4),h(6,"transloco"),h(7,"transloco"),x("click",function(n){E(e);let r=p();return I(r.onIconClick(n))}),y(8,"app-icon",5),d()(),u(9,Jd,3,4,"p",6),d()}if(i&2){let e=p();f("formGroup",e.formGroup),s(2),W("validation-correctly",e.isValidationCorrect())("validation-error",e.isValidationError()),f("ngbTypeahead",e.onKeyup)("resultFormatter",e.advancedSearchSuggestResultFormatter)("inputFormatter",e.advancedSearchSuggestInputFormatter)("value",e.value),P("aria-label",C(4,15,"common.metadata_label."+e.searchField))("data-cy",e.searchField),s(3),f("ngbTooltip",C(6,17,"search.extended_search.value_list_tooltip")),P("aria-label",C(7,19,"search.extended_search.value_list_tooltip")),s(3),P("data-cy",e.searchField+"AddValue"),s(),_(!e.validationInProgress&&!e.isValid&&e.formGroup.dirty&&(e.formGroup.value==null?null:e.formGroup.value.field.length)>0?9:-1)}}var al=(()=>{class i{constructor(){this._valueListService=g(go),this.dynamicSearch=!1,this.isMandatory=!1,this.isValid=!1,this.iconClick=new R,this.optionSelected=new R,this.validationInProgress=!1,this._subscriptions=new At,this._debounceTime=200,this.onChange=()=>{},this.onTouched=()=>{},this.onKeyup=e=>e.pipe(pn(this._debounceTime),_t(),We(t=>t.length>0&&t.trim()!==""&&this.searchField!=="favoritesFolders"),Re(t=>this._valueListService.getAdvancedSearchSuggestions(t.trim(),this.searchField).pipe(S(n=>n.filter(r=>Bt.isNullOrEmpty(r.displayTitle)?Bt.isNullOrEmpty(r.searchTerm)?!1:(r.displayTitle=r.searchTerm,r):r)),k(()=>M([])))))}ngOnChanges(){this.value&&this.writeValue(this.value)}ngOnInit(){this.formGroup=new Je({field:new je("")});let e=this.formGroup.get("field");e&&(this._subscriptions.add(e.valueChanges.pipe(V(t=>{this.validationInProgress=!0;let n=this.extractChangeString(t);if((e.value??"")!==n){if(!n||n.length===0){this.formGroup.reset();return}e.patchValue(n,{emitEvent:!1})}this.onChange(n),this.onTouched()}),pn(this._debounceTime),_t()).subscribe(t=>{let n=this.extractChangeString(t);this.validateAsync(n),this.optionSelected.emit(n)})),this.value&&this.writeValue(this.value))}writeValue(e){let t=this.formGroup?.get("field");t&&(t.setValue(e??"",{emitEvent:!1}),e||this.formGroup.markAsPristine(),e!==""&&this.validateAsync(e))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}
15onIconClick(e){this.iconClick.emit(e)}advancedSearchSuggestInputFormatter(e){return typeof e=="string"?e:e.searchTerm}advancedSearchSuggestResultFormatter(e){return e.displayTitle}ngOnDestroy(){this._subscriptions.unsubscribe()}isValidationCorrect(){return this.isValid&&!this.validationInProgress&&!!this.formGroup.value?.field}isValidationError(){let e=this.formGroup.value?.field;return!this.isValid&&!this.validationInProgress&&this.formGroup.dirty||!this.isValid&&this.isMandatory&&(!e||e.length===0)}validateAsync(e){!e||e.length===0||(this.validationInProgress=!0,this._valueListService.areValidValueListEntries(this.searchField,e).pipe(k(()=>M(!1))).subscribe(t=>{this.isValid=t,this.validationInProgress=!1}))}extractChangeString(e){return typeof e=="string"?e:e?.searchTerm??""}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-autocomplete"]],inputs:{searchField:"searchField",value:"value",dynamicSearch:"dynamicSearch",isMandatory:"isMandatory",isValid:"isValid"},outputs:{iconClick:"iconClick",optionSelected:"optionSelected"},features:[pi([{provide:Ga,useExisting:oa(()=>i),multi:!0}]),Ct],decls:1,vars:1,consts:[["element",""],[3,"formGroup"],[1,"input-group"],["type","text","formControlName","field",3,"ngbTypeahead","resultFormatter","inputFormatter","value"],["type","button",1,"btn-icon-border",3,"click","ngbTooltip"],["name","add"],[1,"text-alert"]],template:function(t,n){t&1&&u(0,Xd,10,21,"form",1),t&2&&_(n.formGroup?0:-1)},dependencies:[j,_e,ja,Ne,Ye,it,Te,ye,Ee,De,z,$],styles:["form[_ngcontent-%COMP%]{position:relative}"]})}}return i})();var ep={zIndex:1e4},tp=[Ir,Tn,Oe,Mi,ir,nr,xr,tr,En,er,Ne,mn,Lr,z],Qe=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=rt({type:i})}static{this.\u0275inj=ot({providers:[Gn,{provide:io,useValue:ep},Ia(Fa())],imports:[tp,al,yt,ao,co,uo,j,_o,Ir,Tn,Oe,Mi,ir,nr,xr,tr,En,er,Ne,mn,Lr,z]})}}return i})();var Yt=class{static isRelationField(o){return o.relation!==void 0}static isLanguageField(o){return Array.isArray(o)&&o.length>0?o[0].languageKey!==void 0:!1}static isString(o){return typeof o=="string"}static isCustomKey(o){return/^custom_\d+$/.test(o)}};var ip=["usedList"];function np(i,o){if(i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2){let e=p().$implicit,t=p();s(),D(C(2,1,"common.metadata_label.pro_metadata."+t.getCorrectLabel(e.label)))}}function op(i,o){if(i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2){let e=p().$implicit;s(),D(C(2,1,"common.metadata_label."+e.label))}}function rp(i,o){if(i&1){let e=w();c(0,"div",6),u(1,np,3,3,"span"),u(2,op,3,3,"span"),c(3,"button",10),h(4,"transloco"),h(5,"transloco"),x("click",function(){let n=E(e).$implicit,r=p();return I(r.removeElementOnClick(n))}),y(6,"app-icon",11),d()()}if(i&2){let e=o.$implicit,t=p();f("title",e.key),P("data-cy",e.key),s(),_(t.isCustomerField(e.label)?1:-1),s(),_(t.isCustomerField(e.label)?-1:2),s(),f("ngbTooltip",C(4,6,"search.remove_field")),P("aria-label",C(5,8,"search.remove_field"))}}function ap(i,o){if(i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2){let e=p().$index,t=p();s(),D(C(2,1,"common.metadata_label.pro_metadata."+t.getCorrectLabel(t.displayedFields[e].label)))}}function sp(i,o){if(i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2){let e=p().$index,t=p();s(),D(C(2,1,"common.metadata_label."+t.displayedFields[e].label))}}function lp(i,o){if(i&1){let e=w();c(0,"div",12),x("cdkDragStarted",function(n){E(e);let r=p();return I(r.dragStart(n))}),u(1,ap,3,3,"span"),u(2,sp,3,3,"span"),d()}if(i&2){let e=o.$index,t=p();W("non-draggable-card",t.displayedFields[e].active)("draggable-card",!t.displayedFields[e].active),f("cdkDragData",t.displayedFields[e].label),P("data-cy",t.displayedFields[e].label),s(),_(t.isCustomerField(t.displayedFields[e].label)?1:-1),s(),_(t.isCustomerField(t.displayedFields[e].label)?-1:2)}}var sl=(()=>{class i{constructor(){this._renderer=g(Et),this._metadataFieldsService=g(Ut),this._translocoService=g(ae),this.usedFields=[],this.currentPresetLocalChanged=new R,this.displayedFields=[]}set cdkDropLists(e){this.cdkDropTrackLists=e.toArray()}ngOnInit(){this._metadataFieldsService.getMetadataList().subscribe(e=>{if(e){let t=new Set(["favoritesFolders","notesFolders","reqIfConvertible"]),n=new Map([...e].filter(([b])=>!t.has(b)&&!Yt.isCustomKey(b))),r=st.metadataMapToFieldConfiguration(n),a=new Set(Rt.map(b=>b.id.toLowerCase())),[l,m]=r.reduce(([b,T],O)=>((a.has(O.key.toLowerCase())?b:T).push(O),[b,T]),[[],[]]);this.allAvailableBasicFields=re.sortMetadataByTranslation(m,this._translocoService),this.allAvailableProFields=re.sortMetadataByTranslation(l,this._translocoService),this.usedFields=st.presetFieldsToFieldConfiguration(this.currentPresetLocal.fields,[...this.allAvailableBasicFields,...this.allAvailableProFields]),this.updateDisplayedFields()}})}ngOnChanges(){let e=this.allAvailableBasicFields??[],t=this.allAvailableProFields??[];this.usedFields=st.presetFieldsToFieldConfiguration(this.currentPresetLocal.fields,[...e,...t])}ngOnDestroy(){this._getAllAvailableFieldsSubscription&&this._getAllAvailableFieldsSubscription.unsubscribe()}emitChanges(){this.currentPresetLocalChanged.emit(this.usedFields)}updateDisplayedFields(){this.displayedFields=[...re.sortMetadataByTranslation(this.allAvailableBasicFields,this._translocoService),...re.sortMetadataByTranslation(this.allAvailableProFields,this._translocoService)];let e=this.usedFields.map(t=>t.key);this.displayedFields.forEach(t=>{t.active=e.includes(t.key)})}onToggleIcon(e){e.visible=!e.visible}removeElementOnClick(e){let t=e.key.toLocaleLowerCase();e.key&&(this.usedFields=this.usedFields.filter(n=>n.key.toLocaleLowerCase()!==t),this.displayedFields=this.displayedFields.map(n=>(n.key.toLocaleLowerCase()===t&&(n.active=!1),n)),this.emitChanges())}onNavigateLeft(){let e=this.usedCardsContainer.element.nativeElement,t=e.scrollLeft-150;this._renderer.setProperty(e,"scrollLeft",t)}onNavigateRight(){let e=this.usedCardsContainer.element.nativeElement,t=e.scrollLeft+150;this._renderer.setProperty(e,"scrollLeft",t)}dragStart(e){for(let t=0;t<this.displayedFields.length;t++)this.displayedFields[t].key===e.source.data&&(this._dragIndex=t)}dropNew(e){e.previousContainer===e.container?nn(e.container.data,e.previousIndex,e.currentIndex):(Ss(e.previousContainer.data,e.container.data,this._dragIndex,e.currentIndex),this.displayedFields[this._dragIndex].active=!0),this._dragIndex=null,this.emitChanges()}asIsOrder(){return 1}getCorrectLabel(e){return Ht.getCorrectLabel(e)}isCustomerField(e){return Rt.map(t=>
15t.id.toLowerCase()).includes(e.toLowerCase())}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-hitlist-schema-editor"]],viewQuery:function(t,n){if(t&1&&Ge(ip,5)(on,5),t&2){let r;le(r=ce())&&(n.usedCardsContainer=r.first),le(r=ce())&&(n.cdkDropLists=r)}},inputs:{defaultPreset:"defaultPreset",currentPresetLocal:"currentPresetLocal"},outputs:{currentPresetLocalChanged:"currentPresetLocalChanged"},features:[Ct],decls:14,vars:9,consts:[["usedList","cdkDropList"],["availableList","cdkDropList"],["data-cy","tableList",1,"columns-container"],["type","button",1,"btn-navigate",3,"click"],["name","chevron","direction","left"],["data-cy","dropArea","cdkDropList","",1,"used-cards-container","drop-container",3,"cdkDropListDropped","cdkDropListConnectedTo","cdkDropListData","cdkDropListOrientation"],["cdkDrag","","cdkDragLockAxis","x",1,"draggable-card",3,"title"],["name","chevron","direction","right"],["cdkDropList","","cdkDropListSortingDisabled","",1,"drop-container","available-cards-container",3,"cdkDropListConnectedTo","cdkDropListData","cdkDropListOrientation"],["cdkDrag","",3,"cdkDragData","non-draggable-card","draggable-card"],["type","button","data-cy","iconRemoveField",1,"btn-icon-remove",3,"click","ngbTooltip"],["name","cross"],["cdkDrag","",3,"cdkDragStarted","cdkDragData"]],template:function(t,n){if(t&1&&(c(0,"div",2)(1,"button",3),x("click",function(){return n.onNavigateLeft()}),y(2,"app-icon",4),d(),c(3,"div",5,0),x("cdkDropListDropped",function(a){return n.dropNew(a)}),G(5,rp,7,10,"div",6,J),d(),c(7,"button",3),x("click",function(){return n.onNavigateRight()}),y(8,"app-icon",7),d()(),c(9,"div",8,1),G(11,lp,3,8,"div",9,J),h(13,"keyvalue"),d()),t&2){let r=X(4),a=X(10);s(3),f("cdkDropListConnectedTo",a)("cdkDropListData",n.usedFields)("cdkDropListOrientation","horizontal"),s(2),q(n.usedFields),s(4),f("cdkDropListConnectedTo",r)("cdkDropListData",n.displayedFields)("cdkDropListOrientation","horizontal"),s(2),q(de(13,6,n.displayedFields,n.asIsOrder))}},dependencies:[Oe,Mi,on,no,j,_e,z,Da,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer)}.columns-container[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:var(--color-gray-light);overflow:hidden;height:3rem}.columns-container[_ngcontent-%COMP%] .used-cards-container[_ngcontent-%COMP%]{flex-wrap:nowrap;font-family:var(--font-family-bold);height:2.5rem;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;width:100%}.columns-container[_ngcontent-%COMP%] .btn-navigate[_ngcontent-%COMP%]{margin-inline:2px}.btn-collapse[_ngcontent-%COMP%]{font-size:var(--font-size-default);height:2.5rem;justify-content:center;text-decoration:underline}.btn-collapse[_ngcontent-%COMP%]:active, .btn-collapse[_ngcontent-%COMP%]:focus, .btn-collapse[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.non-draggable-card[_ngcontent-%COMP%], .draggable-card[_ngcontent-%COMP%], .cdk-drag-preview[_ngcontent-%COMP%]{box-shadow:0 4px 10px #00000059;display:flex;flex-wrap:nowrap;background-color:var(--color-gray-lighter);border-radius:var(--border-radius);border:solid 1px var(--color-gray-dark);color:var(--color-primary-dark);height:2.5rem;-webkit-user-select:none;user-select:none;white-space:nowrap}.non-draggable-card.placeholder[_ngcontent-%COMP%], .draggable-card.placeholder[_ngcontent-%COMP%], .cdk-drag-preview.placeholder[_ngcontent-%COMP%]{opacity:.5;border:dashed 1px var(--color-gray-dark);height:2.5rem}.non-draggable-card[_ngcontent-%COMP%] .btn-icon-remove[_ngcontent-%COMP%], .draggable-card[_ngcontent-%COMP%] .btn-icon-remove[_ngcontent-%COMP%], .cdk-drag-preview[_ngcontent-%COMP%] .btn-icon-remove[_ngcontent-%COMP%]{background-color:var(--color-gray-lighter);border:none;height:2rem;margin-left:calc(var(--spacer) / 2);min-height:2rem;min-width:2rem;width:2rem}.cdk-drag-animating[_ngcontent-%COMP%]{transition:var(--transition)}.drop-container[_ngcontent-%COMP%]{display:flex;gap:calc(var(--spacer) / 2);flex-wrap:wrap}.drop-container[_ngcontent-%COMP%] .cdk-drag[_ngcontent-%COMP%], .drop-container[_ngcontent-%COMP%] .draggable-card[_ngcontent-%COMP%]{box-shadow:0 1px 2px #00000040;
15display:flex;align-items:center;justify-content:center;cursor:move;padding:calc(var(--spacer) / 2);transition:var(--transition)}.cdk-drag-preview[_ngcontent-%COMP%]{padding:calc(var(--spacer) / 2)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:.3;height:2.5rem}.non-draggable-card[_ngcontent-%COMP%]{background-color:var(--color-background);border-style:dashed;color:var(--color-gray-dark);pointer-events:none}"]})}}return i})();var cp=["selectDiv"],dp=["select"],pp=["options"],mp=(i,o)=>({open:i,invalid:o}),up=(i,o)=>({invalid:i,disabled:o}),_p=i=>({"text-italic":i}),ll=i=>({mandatory:i}),hp=i=>({open:i}),fp=(i,o)=>({selected:i,disabled:o}),gp=i=>({$implicit:i});function Cp(i,o){if(i&1&&(c(0,"label",10),v(1),h(2,"transloco"),d()),i&2){let e=p(2);f("for",e.ngControl.name)("ngClass",ie(6,ll,e.isMandatory)),P("data-selectid",e.uuid),s(),F(" ",C(2,4,e.label)," ")}}function vp(i,o){if(i&1&&(c(0,"label",11),v(1),h(2,"transloco"),d()),i&2){let e=p(2);f("for",e.ngControl.name)("ngClass",ie(6,ll,e.isMandatory)),P("data-selectid",e.uuid),s(),F(" ",C(2,4,e.label)," ")}}function bp(i,o){if(i&1&&(u(0,Cp,3,8,"label",10),u(1,vp,3,8,"label",11)),i&2){let e=p();_(e.label&&e.labelPosition==="top"?0:-1),s(),_(e.label&&e.labelPosition==="left"?1:-1)}}function yp(i,o){i&1&&vt(0)}function xp(i,o){if(i&1&&(c(0,"span",15),v(1),h(2,"transloco"),d()),i&2){let e=p().$implicit,t=p(2);P("data-selectid",t.uuid),s(),D(C(2,2,e==null?null:e.text))}}function Sp(i,o){if(i&1){let e=w();c(0,"div",13,2),h(2,"transloco"),x("click",function(n){let r=E(e).$implicit,a=p(2);return I(r.disabled?a.handleDisabledClick(n):a.selectItem(r.value))})("keydown.enter",function(){let n=E(e).$implicit,r=p(2);return I(r.selectItem(n.value))}),Y(3,yp,1,0,"ng-container",14)(4,xp,3,4,"ng-template",null,3,fe),d()}if(i&2){let e=o.$implicit,t=o.$index,n=X(5),r=p(2);f("id",ba("",r.uuid,"_",(e==null?null:e.value)===null?"null":e.value))("ngClass",ht(11,fp,r.selectedItem&&r.selectedItem.value===(e==null?null:e.value)||(!r.selectedItem||!r.value)&&t===0,e.disabled)),P("value",e==null?null:e.value)("data-selectid",r.uuid)("data-cy",e?C(2,9,e.text):""),s(3),f("ngTemplateOutlet",r.customSelectTemplate||n)("ngTemplateOutletContext",ie(14,gp,e))}}function Tp(i,o){if(i&1&&(c(0,"div",9),G(1,Sp,6,16,"div",12,ma().trackByFn,!0),d()),i&2){let e=p();f("ngClass",ie(4,hp,e.isOpen))("itemsVisible",e.itemsVisible)("itemHeight",40)("totalItems",e.items.length),s(),q(e.items)}}function Dp(i,o){i&1&&(c(0,"span",16),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.please_fill_this_field")," "))}function Ep(i,o){if(i&1&&u(0,Dp,3,3,"span",16),i&2){let e=p();_(e.ngControl.hasError("required")?0:-1)}}var xt=(()=>{class i{get opacity(){return this.disabled?.5:1}set items(e){e&&(this._items=e,this.showUnselectItem&&(this._items=[this._emptySelectItem,...this._items]))}get items(){return this._items}get value(){return this._items&&(this.selectedItem=this._items.find(e=>e.value===this._value)??this._items[0]),this.selectedItem?.disabled&&this.unselectDisabledItem(),this._value}constructor(){this.control=g(ji,{self:!0,optional:!0}),this._changeDetectorRef=g(ze),this._renderer=g(Et),this.manualValidation=!1,this.itemsVisible=5,this.labelPosition="top",this.isMandatory=!1,this.disabled=!1,this._componentActive=!0,this._emptySelectItem={text:"common.please_choose",value:null},this.isOpen=!1,this.itemSelected=new R,this.onChanged=()=>{},this.onTouched=()=>{},this.control&&(this.control.valueAccessor=this),this.ngControl=this.control,this.uuid=Fi()}onOutsideClick(e){let t=e.target;if(e.stopPropagation(),!this.disabled){if((t.dataset?.selectid??t.parentElement?.dataset.selectid??null)===this.uuid&&(t.closest(".select-selected")||t.closest(".app-select")||t.closest("app-icon")||t.closest("label"))){this.isOpen?this.closeDropdown():this.openDropdown(),this.selectDiv.nativeElement.focus();return}this.isOpen&&this.closeDropdown(),t.dataset.selectid!==this.uuid&&this.selectDiv.nativeElement.blur()}}ngOnInit(){this.initEventListeners()}ngAfterViewInit(){this.selectedKey&&this._items.find(e=>e.value===this.selectedKey)&&this.selectItem(this.selectedKey),this._changeDetectorRef.detectChanges()}ngOnChanges(e){if(e.showUnselectItem)if(this.showUnselectItem&&this.items[0]?.value!==null)this._items=[this._emptySelectItem,...this._items];else{if(this.selectedItem?.value===null){let n=[...this._items];n.shift();let r=n.find(a=>!a.disabled);this.selectItem(r.value)}this._items.shift()}}writeValue(e){this._value=e,this._changeDetectorRef.markForCheck()}registerOnChange(e){this.onChanged=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this._renderer.setProperty(this.select.nativeElement,"disabled",e)}handleDisabledClick(e){e.preventDefault(),e.stopPropagation()}closeSelect(){this.isOpen=!1}setValue(e,t=!1){this.disabled||(this._value=e??null,this.onChanged(this._value),this.onTouched(),t||(this.blur(),this.closeDropdown())),this.isOpen&&this.scrollToItem();let n=this.items.find(r=>r.value===e);this.selectedItem=n,this.itemSelected.emit(this.selectedItem.value),this._changeDetectorRef.markForCheck()}trackByFn(e,t){return t.value}onSelectItem(e){let t=e.target.value;this.selectItem(t)}selectItem(e){this.setValue(e),this.blur()}unselectDisabledItem(){this.showUnselectItem=!0,this.setValue(null),this.manualValidation&&this.control.reset()}scrollToItem(){let t=this.options.toArray().find(n=>n.nativeElement.id===`${this.uuid}_${this.value}`);t&&t.nativeElement.scrollIntoView({behavior:"smooth",block:"nearest"})}initEventListeners(){Pn(this.selectDiv.nativeElement,"keydown").pipe(V(e=>{let{key:t}=e;if(t==="ArrowDown"||t==="ArrowUp")if(e.preventDefault(),this.isOpen)if(this.selectedItem?.value!==void 0){let n=this.items.findIndex(l=>l.value===this.selectedItem.value),r=this.items[n-1],a=this.items[n+1];if(t==="ArrowDown"&&a){if(a.disabled){let l=this.findNextEnabledItem(a,"ArrowDown");l&&this.setValue(l.value,!0)}else this.setValue(a.value,!0);this._changeDetectorRef.markForCheck()}if(t==="ArrowUp"&&r){if(r.disabled){let l=this.findNextEnabledItem(r,"ArrowUp");l&&this.setValue(l.value,!0)}else this.setValue(r.value,!0);this._changeDetectorRef.markForCheck()}}else{let n=this.items.filter(r=>!r.disabled);n?.length&&this.setValue(n[0].value,!0)}else this.openDropdown();else(t==="Tab"||t==="Enter"||t==="Escape")&&(this.isOpen?(this.closeDropdown(),this.blur()
15):t==="Enter"&&this.openDropdown())}),me(()=>this._componentActive)).subscribe()}findNextEnabledItem(e,t){if(e){let n=this.items.findIndex(r=>r.value===e.value);if(n&&n>0){let r=this.items.filter((m,b)=>t==="ArrowDown"?b>n:b<n);t==="ArrowUp"&&r.reverse();let a=r[0],l=Object.values(r);for(let m of l)if(typeof m=="object"&&m.disabled!==void 0){let b=m;if(b.disabled)this.findNextEnabledItem(a,t);else return b}}}return null}openDropdown(){this.isOpen=!0,this.selectDiv.nativeElement.focus(),this.scrollToItem(),this._changeDetectorRef.markForCheck()}closeDropdown(){this.isOpen=!1}blur(){this.selectDiv.nativeElement.blur(),this.select.nativeElement.blur(),this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._componentActive=!1}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-select"]],viewQuery:function(t,n){if(t&1&&Ge(cp,7,Ze)(dp,7,Ze)(pp,5,Ze),t&2){let r;le(r=ce())&&(n.selectDiv=r.first),le(r=ce())&&(n.select=r.first),le(r=ce())&&(n.options=r)}},hostVars:2,hostBindings:function(t,n){t&1&&x("click",function(a){return n.onOutsideClick(a)},da),t&2&&Zt("opacity",n.opacity)},inputs:{items:"items",manualValidation:"manualValidation",itemsVisible:"itemsVisible",label:"label",labelPosition:"labelPosition",isMandatory:"isMandatory",customSelectTemplate:"customSelectTemplate",disabled:"disabled",showUnselectItem:"showUnselectItem",selectedKey:"selectedKey"},outputs:{itemSelected:"itemSelected"},features:[Ct],decls:12,vars:26,consts:[["selectDiv",""],["select",""],["options",""],["defaultSelect",""],[1,"nautos-select",3,"ngClass"],["tabindex","-1",3,"change","name","value"],[1,"select-selected",3,"ngClass"],["data-cy","selectedText",1,"select-text",3,"ngClass"],["name","chevron",3,"direction"],[1,"select-items",3,"ngClass","itemsVisible","itemHeight","totalItems"],[1,"label-top",3,"for","ngClass"],[1,"label-left",3,"for","ngClass"],[1,"select-item",3,"id","ngClass"],[1,"select-item",3,"click","keydown.enter","id","ngClass"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"select-text"],["data-cy","errorMessage",1,"text-alert"]],template:function(t,n){if(t&1&&(u(0,bp,2,2),c(1,"div",4,0)(3,"select",5,1),x("change",function(a){return n.onSelectItem(a)}),d(),c(5,"div",6)(6,"span",7),v(7),h(8,"transloco"),d(),y(9,"app-icon",8),d(),u(10,Tp,3,6,"div",9),u(11,Ep,1,1),d()),t&2){let r=X(4);_(n.ngControl?0:-1),s(),Zt("cursor",r.disabled&&!n.manualValidation?"not-allowed":"clickable"),f("ngClass",ht(18,mp,n.isOpen,(n.ngControl==null?null:n.ngControl.invalid)&&n.ngControl&&!n.manualValidation)),s(2),f("name",n.ngControl==null?null:n.ngControl.name)("value",n.value),s(2),Zt("cursor",r.disabled&&!n.manualValidation?"not-allowed":"clickable"),f("ngClass",ht(21,up,(n.ngControl==null?null:n.ngControl.invalid)&&(n.ngControl==null?null:n.ngControl.touched),n.disabled)),P("data-selectid",n.uuid),s(),f("ngClass",ie(24,_p,n.selectedItem===null||n.selectedItem&&n.selectedItem.value===null)),s(),F(" ",C(8,16,n.selectedItem==null?null:n.selectedItem.text)," "),s(2),f("direction",n.isOpen?"up":"down"),P("data-selectid",n.uuid),s(),_(n.items&&n.items.length>0?10:-1),s(),_(n.ngControl!=null&&n.ngControl.invalid&&(n.ngControl!=null&&n.ngControl.touched)&&!n.manualValidation?11:-1)}},dependencies:[lt,j,Ys,Ft,$],styles:["[_nghost-%COMP%]{display:flex;gap:calc(var(--spacer) / 2);align-items:center}[_nghost-%COMP%]:has(.label-top){align-items:flex-start;flex-direction:column;gap:0}[_nghost-%COMP%] .label-left[_ngcontent-%COMP%]{white-space:nowrap}.nautos-select[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus{border-radius:var(--border-radius);box-shadow:0 0 0 .12rem var(--color-focus);outline:none;z-index:4}.nautos-select[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is([type=radio]){border:none;border-radius:50%}.nautos-select[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is(.btn-icon,.nautos-select){z-index:unset}.nautos-select[_ngcontent-%COMP%]{appearance:none;background-color:var(--color-gray-lighter);border-radius:var(--border-radius);color:var(--color-primary-dark);height:2.5rem;position:relative;-webkit-user-select:none;user-select:none;min-width:5rem;width:100%}
15.nautos-select.invalid[_ngcontent-%COMP%]{outline:1px solid var(--color-alert);background-color:light-dark(var(--color-alert-light),var(--color-gray-lighter))}.nautos-select[_ngcontent-%COMP%] .select-selected[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;border-radius:var(--border-radius);border:var(--border);cursor:pointer;height:100%;padding-inline:calc(var(--spacer) / 2);transition:var(--transition)}.nautos-select[_ngcontent-%COMP%] .select-selected.open[_ngcontent-%COMP%]{border-radius:var(--border-radius) var(--border-radius) 0 0}.nautos-select[_ngcontent-%COMP%] .select-selected.invalid[_ngcontent-%COMP%]:not(.disabled){border:1px solid var(--color-alert)}.nautos-select.open[_ngcontent-%COMP%]{background-color:var(--color-gray-light)}.nautos-select[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{display:none}select[_ngcontent-%COMP%] .nautos-select[_ngcontent-%COMP%]::-ms-expand{display:none}.nautos-select[_ngcontent-%COMP%] .select-text[_ngcontent-%COMP%]{pointer-events:none;text-overflow:ellipsis;overflow:hidden;width:95%;white-space:nowrap}.nautos-select[_ngcontent-%COMP%] .select-items[_ngcontent-%COMP%]{box-shadow:0 4px 10px #00000059;background-color:var(--color-background);border:var(--border);cursor:pointer;left:0;max-height:0;opacity:0;pointer-events:none;position:absolute;right:0;top:100%;transition:var(--transition);z-index:99}.nautos-select[_ngcontent-%COMP%] .select-items.open[_ngcontent-%COMP%]{max-height:500px;opacity:1;pointer-events:all;border-radius:0 0 var(--border-radius) var(--border-radius)}.nautos-select[_ngcontent-%COMP%] .select-items[_ngcontent-%COMP%] .selected[_ngcontent-%COMP%]{color:var(--color-primary-dark);background-color:var(--color-gray-light);font-family:var(--font-family-bold)}.nautos-select[_ngcontent-%COMP%] .select-items[_ngcontent-%COMP%] .select-item[_ngcontent-%COMP%]{align-items:center;display:flex;gap:calc(var(--spacer) / 2);height:2.5rem;padding-inline:var(--spacer)}.nautos-select[_ngcontent-%COMP%] .select-items[_ngcontent-%COMP%] .select-item.disabled[_ngcontent-%COMP%]{background-color:var(--color-gray-lighter);color:var(--color-gray-dark);font-style:italic;cursor:default}.nautos-select[_ngcontent-%COMP%] .select-items[_ngcontent-%COMP%] .select-item[_ngcontent-%COMP%]:not(:last-child){border-bottom:var(--border)}.nautos-select[_ngcontent-%COMP%] .select-items[_ngcontent-%COMP%] .select-item[_ngcontent-%COMP%]:last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}.nautos-select[_ngcontent-%COMP%] .select-items[_ngcontent-%COMP%] .select-item[_ngcontent-%COMP%]:hover:not(.disabled,.selected){background-color:var(--color-gray-lighter);color:var(--color-primary)}"],changeDetection:0})}}return i})();var Ip=i=>({label:"common.name",value:i});function Fp(i,o){if(i&1){let e=w();c(0,"app-checkbox",10),va("valueChange",function(n){E(e);let r=p();return Ca(r.currentLayout.isTenantTemplate,n)||(r.currentLayout.isTenantTemplate=n),I(n)}),d()}if(i&2){let e=p();ga("value",e.currentLayout.isTenantTemplate)}}var cl=(()=>{class i{constructor(){this.activeModal=g(fi),this._authService=g(ue),this._feedbackService=g(pt),this._listPresetService=g(Jn),this._metadataFieldsService=g(Ut),this._translocoService=g(ae),this.createMode=!1,this.userIsAdmin=this._authService.userIsAdmin}ngOnInit(){this.currentLayout=re.clone(this.activePreset),this.initForms(),this.pageSizeOptions=zi,this._metadataFieldsService.getMetadataList().subscribe(e=>{if(e){let t=new Set(["custom_1","custom_2","custom_3"]),n=new Map([...e].filter(([r])=>!t.has(r)));this._allAvailableFields=st.metadataMapToFieldConfiguration(n),this._allAvailableFields=re.sortMetadataByTranslation(this._allAvailableFields,this._translocoService)}}),this._defaultPresetSubscription=this._listPresetService.defaultPreset$.subscribe({next:e=>{e&&(this.defaultPreset=e)}})}ngOnDestroy(){this._defaultPresetSubscription&&this._defaultPresetSubscription.unsubscribe()}initForms(){this.pageSizeForm=new Je({selectedPageSize:new je(this.currentLayout.perPage||25)})}currentPresetLocalChanged(e){this.currentLayout.fields=e}onPageSizeSelected(){this.currentLayout.perPage=this.pageSizeForm.value.selectedPageSize}onSave(){this.currentLayout.fields=this.recalculateFieldsOrdinal(),this._listPresetService.saveAndOverwritePreset(this.currentLayout).subscribe({next:()=>{this._feedbackService.showSuccessModal("search.hitlist.layout_saved"),this.activeModal.close({configId:this.currentLayout.id})},error:()=>{this._feedbackService.showSuccessModal("search.table_layout.table_layout_save_error")}})}onClose(){this.activeModal.close()}recalculateFieldsOrdinal(){let e=[];for(let t=0;t<this.currentLayout.fields.length;t++){let n=this.currentLayout.fields[t];e.push({key:n.key,label:n.label,ordinal:t,template:n.template?n.template:"",styles:n.styles?n.styles:""})}return e}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-hitlist-edit-layout-modal"]],inputs:{createMode:"createMode",activePreset:"activePreset"},decls:13,vars:12,consts:[["modalTitle","search.table_layout.title_edit",3,"modalInfo","border"],[1,"modal-body"],[1,"content-row"],[1,"settings-container"],[1,"page-size-settings",3,"formGroup"],["label","common.table.pagination","labelPosition","left","formControlName","selectedPageSize","data-cy","pageSizeSettings",3,"itemSelected","items"],[1,"list-preset-items-editor"],[3,"currentPresetLocalChanged","currentPresetLocal","defaultPreset"],["data-cy","activateHitlistLayoutTenantWide","label","search.tenant_wide_template",1,"tenant-wide",3,"value"],[3,"cancelButtonClick","saveButtonClick"],["data-cy","activateHitlistLayoutTenantWide","label","search.tenant_wide_template",1,"tenant-wide",3,"valueChange","value"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),c(1,"div",1)(2,"div",2)(3,"p"),v(4),h(5,"transloco"),d(),c(6,"div",3)(7,"div",4)(8,"app-select",5),x("itemSelected",function(){return n.onPageSizeSelected()}),d()()()(),c(9,"div",6)(10,"app-hitlist-schema-editor",7),x("currentPresetLocalChanged",function(a){return n.currentPresetLocalChanged(a)}),d()(),u(11,Fp,1,1,"app-checkbox",8),d(),c(12,"app-modal-footer",9),x("cancelButtonClick",function(){return n.onClose()})("saveButtonClick",function(){return n.onSave()}),d()),t&2&&(f("modalInfo",ie(10,Ip,n.currentLayout.name))("border",!0),s(4),D(C(5,8,"search.table_layout.info_text")),s(3),f("formGroup",n.pageSizeForm),s(),f("items",n.pageSizeOptions),s(2),f("currentPresetLocal",n.currentLayout)("defaultPreset",n.defaultPreset),s(),_(n.userIsAdmin?11:-1))},dependencies:[yt,sl,Me,we,Qe,Te,ye,Ee,De,z,xt,$],styles:[".content-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:var(--spacer)}"]})}}return i})();var Mp=["fileInput"];function wp(i,o){i&1&&(c(0,"span",7),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"common.file_upload_hint")))}function Op(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p();s(),D(e.file.name)}}function Pp(i,o){i&1&&(c(0,"p",9),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.please_choose_a_file")," "))}function Np(i,o){if(i&1){let e=w();c(0,"div",17)(1,"input",20),x("change",function(){E(e);let n=p();return I(n.selectedType=n.associatedFileTypeDto.FILE_HOSTED)}),d(),c(2,"label",21),v(3),h(4,"transloco"),d()()}if(i&2){let e=p();s(),f("name","linktype")("checked",e.selectedType===e.associatedFileTypeDto.FILE_HOSTED),s(2),F("",C(4,3,"search.document_upload.link_hosted")," ")}}function kp(i,o){i&1&&(c(0,"div")(1,"label",22),v(2),h(3,"transloco"),d(),y(4,"input",23),h(5,"transloco"),d()),i&2&&(s(2),D(C(3,3,"search.control_file.base_path")),s(2),f("placeholder",kt(C(5,5,"search.control_file.base_path_placeholder"))))}function Rp(i,o){i&1&&(c(0,"p",18),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"search.control_file.empty_base_path_error")," "))}var dl=(()=>{class i{constructor(){this._authService=g(ue),this._formBuilder=g(dt),this.modalService=g(he),this.selectedType=B.FILE_LINK_LOCAL,this.radioLocalId="linktype-url-local",this.radioWwwId="linktype-url-www",this.radioHostedId="linktype-hosted",this.associatedFileTypeDto=B}get hasHostingExplorer(){return this._authService.currentTokenDecoded.hasHostingModule}ngOnInit(){this.initForm()}onAddUploadFile(e){if(e instanceof FileList){if(e.length>1)return;this.file=e[0],this.importDatasetForm.patchValue({fileName:this.file.name})}else{e.preventDefault();let t=e.target;if(t.files.length>1)return;this.file=t.files[0],this.importDatasetForm.patchValue({fileName:this.file.name})}}onSave(){if(this.importDatasetForm.markAllAsTouched(),this.importDatasetForm.valid){let e={file:this.file,basePath:this.getBasePath(this.importDatasetForm.get("basePath").value),fileType:this.selectedType};this.modalService.close(e)}}getBasePath(e){return this.selectedType===B.FILE_HOSTED?null:e}initForm(){this.importDatasetForm=this._formBuilder.group({fileName:["",Ve.required],basePath:[""]})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-control-file-import-modal"]],viewQuery:function(t,n){if(t&1&&Ge(Mp,7),t&2){let r;le(r=ce())&&(n.fileInput=r.first)}},decls:33,vars:24,consts:[["fileInput",""],["modalTitle","search.control_file.title",3,"border"],[1,"modal-body",3,"formGroup"],[1,"label-bold-top"],["dragAndDrop","",1,"upload-file-container",3,"click","keydown.enter","fileDropped"],["data-cy","uploadText",1,"upload-disclaimer"],["name","cloud-upload","data-cy","iconFileUpload"],[1,"upload-disclaimer-message"],["hidden","","type","file","accept",".001,.txt","data-cy","uploadFile",3,"change"],["data-cy","noFileErrorMessage",1,"text-alert"],[1,"file-types"],["data-cy","linkTypeLocal",1,"form-check"],["
15id","link-type-local","type","radio","value","url",1,"form-check-input",3,"change","name","checked"],["for","link-type-local",1,"form-check-label"],["data-cy","linkTypeUrl",1,"form-check"],["id","link-type-url","type","radio","value","url",1,"form-check-input",3,"change","name","checked"],["for","link-type-url",1,"form-check-label"],["data-cy","linkTypeHosted",1,"form-check"],["data-cy","noPathErrorMessage",1,"text-alert"],[3,"cancelButtonClick","saveButtonClick"],["id","link-type-hosted","type","radio","value","url",1,"form-check-input",3,"change","name","checked"],["for","link-type-hosted",1,"form-check-label"],["for","basePath"],["id","basePath","type","text","formControlName","basePath","data-cy","path",3,"placeholder"]],template:function(t,n){if(t&1){let r=w();y(0,"app-modal-header",1),c(1,"div",2)(2,"div")(3,"p",3),v(4),h(5,"transloco"),d(),c(6,"div",4),x("click",function(){E(r);let l=X(12);return I(l.click())})("keydown.enter",function(){E(r);let l=X(12);return I(l.click())})("fileDropped",function(l){return n.onAddUploadFile(l)}),c(7,"div",5),y(8,"app-icon",6),u(9,wp,3,3,"span",7),u(10,Op,2,1,"span"),d(),c(11,"input",8,0),x("change",function(l){return n.onAddUploadFile(l)}),d()(),u(13,Pp,3,3,"p",9),d(),c(14,"div")(15,"p",3),v(16),h(17,"transloco"),d(),c(18,"div",10)(19,"div",11)(20,"input",12),x("change",function(){return n.selectedType=n.associatedFileTypeDto.FILE_LINK_LOCAL}),d(),c(21,"label",13),v(22),h(23,"transloco"),d()(),c(24,"div",14)(25,"input",15),x("change",function(){return n.selectedType=n.associatedFileTypeDto.FILE_LINK_WWW}),d(),c(26,"label",16),v(27),h(28,"transloco"),d()(),u(29,Np,5,5,"div",17),d()(),u(30,kp,6,7,"div"),u(31,Rp,3,3,"p",18),d(),c(32,"app-modal-footer",19),x("cancelButtonClick",function(){return n.modalService.dismiss()})("saveButtonClick",function(){return n.onSave()}),d()}t&2&&(f("border",!0),s(),f("formGroup",n.importDatasetForm),s(3),D(C(5,16,"search.control_file.import_document")),s(5),_(n.file!=null&&n.file.name?-1:9),s(),_(n.file!=null&&n.file.name?10:-1),s(3),_(!(n.importDatasetForm.controls.fileName!=null&&n.importDatasetForm.controls.fileName.valid)&&(n.importDatasetForm.controls.fileName!=null&&n.importDatasetForm.controls.fileName.touched||n.importDatasetForm.controls.fileName!=null&&n.importDatasetForm.controls.fileName.dirty)?13:-1),s(3),D(C(17,18,"common.properties")),s(4),f("name","linktype")("checked",n.selectedType===n.associatedFileTypeDto.FILE_LINK_LOCAL),s(2),F("",C(23,20,"search.document_upload.link_local")," "),s(3),f("name","linktype")("checked",n.selectedType===n.associatedFileTypeDto.FILE_LINK_WWW),s(2),F("",C(28,22,"search.document_upload.link_url")," "),s(2),_(n.hasHostingExplorer?29:-1),s(),_(n.selectedType!==n.associatedFileTypeDto.FILE_HOSTED?30:-1),s(),_(!(n.importDatasetForm.controls.basePath!=null&&n.importDatasetForm.controls.basePath.valid)&&(n.importDatasetForm.controls.basePath!=null&&n.importDatasetForm.controls.basePath.touched||n.importDatasetForm.controls.basePath!=null&&n.importDatasetForm.controls.basePath.dirty)&&n.selectedType!==n.associatedFileTypeDto.FILE_HOSTED?31:-1))},dependencies:[an,j,Me,we,Ne,it,Te,ye,Ee,De,z,$],encapsulation:2})}}return i})();var wt=(function(i){return i[i.unknown_error=1]="unknown_error",i[i.parse_error=2]="parse_error",i[i.field_value_invalid=3]="field_value_invalid",i[i.id_not_found=4]="id_not_found",i[i.hosted_file_not_found=5]="hosted_file_not_found",i[i.tenant_id_not_matching=6]="tenant_id_not_matching",i[i.ac_code_not_found=7]="ac_code_not_found",i[i.ac_code_could_not_be_created=8]="ac_code_could_not_be_created",i[i.invalid_ac_code=9]="invalid_ac_code",i[i.could_not_delete_system_file=10]="could_not_delete_system_file",i[i.could_not_be_deleted=11]="could_not_be_deleted",i[i.could_not_be_renamed=12]="could_not_be_renamed",i[i.username_duplicate=13]="username_duplicate",i[i.unknown_group=14]="unknown_group",i[i.invalid_role=15]="invalid_role",i[i.empty=16]="empty",i[i.empty_with_fieldName=17]="empty_with_fieldName",i[i.wrong_headers=18]="wrong_headers",i[i.username_invalid=19]="username_invalid",i[i.not_found_with_source=20]="not_found_with_source",i[i.field_value_invalid_with_source=21]="field_value_invalid_with_source",i[i.search_results_exceeded_threshold=22]="search_results_exceeded_threshold",i[i.unknown_error_with_source=23]="unknown_error_with_source",i})(wt||{});var Ap=i=>({count:i}),Lp=i=>({lineNo:i});function Up(i,o){i&1&&(c(0,"p",4),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"common.import.import_successful")))}function Bp(i,o){i&1&&(c(0,"p",4),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.import.import_partially_successful")," "))}function Vp(i,o){i&1&&(c(0,"p",4),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"common.import.import_failed")))}function $p(i,o){i&1&&(c(0,"span",8),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"search.control_file.link_successful_count_single")))}function Hp(i,o){if(i&1&&(c(0,"span",8),v(1),h(2,"transloco"),d()),i&2){let e=p(2);s(),D(de(2,1,"search.control_file.link_successful_count_multiple",ie(4,Ap,e.successfulImports)))}}function Kp(i,o){if(i&1&&(c(0,"div"),y(1,"app-icon",7),u(2,$p,3,3,"span",8),u(3,Hp,3,6,"span",8),d()),i&2){let e=p();s(2),_(e.successfulImports===1?2:-1),s(),_(e.successfulImports>1?3:-1)}}function Gp(i,o){if(i&1&&(c(0,"div"),y(1,"app-icon",9),c(2,"span",10),v(3),h(4,"transloco"),d(),c(5,"span",11),v(6),h(7,"transloco"),d()()),i&2){let e=o.$implicit,t=p(2);s(3),D(de(4,2,"search.control_file.link_error_line_no",ie(7,Lp,e.lineNo))),s(3),D(C(7,5,"company_data.metadata_upload.errors."+t.importErrors[e.type].toString()))}}function qp(i,o){if(i&1&&G(0,Gp,8,9,"div",null,J),i&2){let e=p();q(e.errors)}}var pl=(()=>{class i{constructor(){this.modalService=g(he),this.icon="success",this.successfulImports=0,this.importErrors=wt}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-control-file-report-modal"]],inputs:{icon:"icon",successfulImports:"successfulImports",errors:"errors"},decls:11,vars:11,consts:[["modalTitle","common.import.protocol"],[1,"modal-body"],[1,"container-report-header"],["sprite","icons-large","data-cy","iconImport",3,"name"],[1,"text-important"],[1,"container-protocol"],["cancelButtonClass","btn-primary-outline","cancelButtonText","common.close",3,"cancelButtonClick","isSaveButtonVisible"],["name","check-mark-filled",1,"icon-success"],["data-cy","importInfo"],["name","cross-filled","data-cy","importError",1,"icon-alert"],["data-cy","importErrorInfo",1,"error-line-no"],["data-cy","importErrorMessage"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),c(1,"div",1)(2,"div",2),y(3,"app-icon",3),u(4,Up,3,3,"p",4),u(5,Bp,3,3,"p",4),u(6,Vp,3,3,"p",4),d(),c(7,"div",5),u(8,Kp,4,2,"div"),u(9,qp,2,0),d()(),c(10,"app-modal-footer",6),x("cancelButtonClick",function(){return n.modalService.dismiss()}),d()),t&2&&(s(3),W("icon-success",n.icon==="success")("icon-alert",n.icon==="error"),f("name",n.icon==="success"?"check-mark-large":n.icon==="error"?"cross-large":""),s(),_(n.icon==="success"?4:-1),s(),_(n.icon==="error"&&n.successfulImports>0?5:-1),s(),_(n.successfulImports===0?6:-1),s(2),_(n.successfulImports>0?8:-1),s(),_(n.errors!=null&&n.errors.length?9:-1),s(),f("isSaveButtonVisible",!1))},dependencies:[j,Me,we,z,$],styles:[".container-report-header[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;gap:calc(var(--spacer) * 2);margin-bottom:calc(var(--spacer) * 2)}.container-protocol[_ngcontent-%COMP%]{display:flex;flex-direction:column}.container-protocol[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;align-items:center}.error-line-no[_ngcontent-%COMP%]{white-space:pre}"]})}}return i})();var $e=(function(i){return i[i.Folder=0]="Folder",i[i.SearchForm=1]="SearchForm",i[i.Note=2]="Note",i})($e||{});var Fn=(function(i){return i.FAVORITE_ADD="FAVORITE_ADD",i.FAVORITE_REMOVE="FAVORITE_REMOVE",i.FOLDER_RENAME="FOLDER_RENAME",i.FOLDER_DESCRIPTION_CHANGE="FOLDER_DESCRIPTION_CHANGE",i.FOLDER_REMOVE="FOLDER_REMOVE",i.FOLDER_LEAVE="FOLDER_LEAVE",i.FOLDER_EDIT_SHARE="FOLDER_EDIT_SHARE",i.FOLDER_ADD_
15SUBFOLDER="FOLDER_ADD_SUBFOLDER",i.FOLDER_CONFIG_OBSERVE="FOLDER_CONFIG_OBSERVE",i.FOLDER_COPY="FOLDER_COPY",i})(Fn||{});var Ni=class i{static findNode(o,e){for(let t of e){if(t.id===o)return t;if(t.children){let n=i.findNode(o,t.children);if(n)return n}}return null}static findNodesWithSameSearchForm(o,e){let t=[];for(let n of e)if(n.searchFormId===o&&t.push(n),n.children){let r=i.findNodesWithSameSearchForm(o,n.children);r.length>0&&t.push(...r)}return t}static deleteNodes(o,e){for(let t of e)o.includes(t.id)?e=e.filter(n=>n.id!==t.id):t.children&&(t.children=t.children.filter(n=>o.indexOf(n.id)<0),t.children.length<1?t.hasChildren=!1:i.deleteNodes(o,t.children));return e}static copyNode(o,e,t,n){let r=i.findNode(e,n);if(r){let a=i.findNode(o,n),l=a.title;if(r.children&&r.children.length>0){l=i.findNewFolderTitle(r.children,l,[]);let m={id:t,children:null,title:l,matchesSearch:a.matchesSearch,subscription:null,isSharedFromMe:!1,isSharedWithMe:!1,isMonitored:a.isMonitored,hasChildren:a.hasChildren,description:a.description,descriptionFiles:a.descriptionFiles,sharedFromGroup:a.sharedFromGroup,rights:i.getDefaultFolderRights(),accessLevel:i.getDefaultAccessLevel(),searchFormId:a.searchFormId,emailNotification:!0};r.children.push(m)}else r.children=null;r.hasChildren=!0}return n}static findNewFolderTitle(o,e,t){let n,r,a=0;for(;!r;){n=e,a>0&&(n+=" ("+a+")");let l=!1;for(let m of o)if(m.title===n&&t.indexOf(m.id)<0){l=!0;break}if(!l)break;a++}return n}static getDefaultFolderRights(){return[{rightName:"FAVORITE_ADD",hasRight:!0},{rightName:"FAVORITE_REMOVE",hasRight:!0},{rightName:"FOLDER_ADD_SUBFOLDER",hasRight:!0},{rightName:"FOLDER_CONFIG_OBSERVE",hasRight:!0},{rightName:"FOLDER_COPY",hasRight:!0},{rightName:"FOLDER_DESCRIPTION_CHANGE",hasRight:!0},{rightName:"FOLDER_EDIT_SHARE",hasRight:!0},{rightName:"FOLDER_LEAVE",hasRight:!0},{rightName:"FOLDER_REMOVE",hasRight:!0},{rightName:"FOLDER_RENAME",hasRight:!0}]}static getDefaultAccessLevel(){return{fullAccess:!0,owner:!0,read:!0,write:!0}}};var Co=class extends Zo{get data(){return this._data.value}set data(o){this._data.next(o),this._flattenedData.next(this._treeFlattener.flattenNodes(this.data)),this._treeControl.dataNodes=this._flattenedData.value}constructor(o,e,t){super(),this._treeControl=o,this._treeFlattener=e,this._flattenedData=new oe([]),this._expandedData=new oe([]),this._data=new oe([]),t&&(this.data=t)}connect(o){return Li(o.viewChange,this._treeControl.expansionModel.changed,this._flattenedData).pipe(S(()=>(this._expandedData.next(this._treeFlattener.expandFlattenedNodes(this._flattenedData.value,this._treeControl)),this._expandedData.value)))}disconnect(){}};var vo=class{constructor(o,e,t,n){this.transformFunction=o,this.getLevel=e,this.isExpandable=t,this.getChildren=n}flattenNode(o,e,t,n){let r=this.transformFunction(o,e);if(t.push(r),this.isExpandable(r)){let a=this.getChildren(o);a&&(Array.isArray(a)?this.flattenChildren(a,e,t,n):a.pipe(tt(1)).subscribe(l=>{this.flattenChildren(l,e,t,n)}))}return t}flattenChildren(o,e,t,n){o?.forEach((r,a)=>{let l=n.slice();l.push(a!==o.length-1),this.flattenNode(r,e+1,t,l)})}flattenNodes(o){let e=[];return o.forEach(t=>this.flattenNode(t,0,e,[])),e}expandFlattenedNodes(o,e){let t=[],n=[];return n[0]=!0,o.forEach(r=>{let a=!0;for(let l=0;l<=this.getLevel(r);l++)a=a&&n[l];a&&t.push(r),this.isExpandable(r)&&(n[this.getLevel(r)+1]=e.isExpanded(r))}),t}};var Wp=i=>({$implicit:i});function zp(i,o){if(i&1&&(c(0,"button",2),h(1,"transloco"),h(2,"transloco"),h(3,"transloco"),h(4,"transloco"),y(5,"app-icon",5),d()),i&2){let e=p(2);f("ngbTooltip",e.isExpanded?C(1,3,"common.collapse"):C(2,5,"common.expand")),P("aria-label",e.isExpanded?C(3,7,"common.collapse"):C(4,9,"common.expand")),s(5),f("direction",e.isExpanded?"down":"right")}}function jp(i,o){if(i&1&&(c(0,"form",3),y(1,"app-checkbox",6),d()),i&2){let e=p(2);f("formGroup",e.checkboxForm),s(),f("label",e.useLabelForText?e.node.title:"")}}function Yp(i,o){i&1&&vt(0)}function Qp(i,o){if(i&1){let e=w();c(0,"div",7),x("click",function(){E(e);let n=p(2);return I(!n.isDisabled&&n.onLabelClick())})("keydown.enter",function(){E(e);let n=p(2);return I(!n.isDisabled&&n.onLabelClick())}),Y(1,Yp,1,0,"ng-container",8),d()}if(i&2){let e=p(2);
15s(),f("ngTemplateOutlet",e.nodeTemplate)("ngTemplateOutletContext",ie(2,Wp,e.node))}}function Zp(i,o){if(i&1&&(c(0,"div",1),u(1,zp,6,11,"button",2),u(2,jp,2,2,"form",3),u(3,Qp,2,4,"div",4),d()),i&2){let e=p();W("toggle-none",!e.dataDoesntHaveChildren&&!e.node.hasChildren),P("data-cy","folderLevel"+(e.node==null?null:e.node.level)),s(),_(e.node.hasChildren?1:-1),s(),_(e.hideCheckboxes?-1:2),s(),_(e.useLabelForText?-1:3)}}var ml=(()=>{class i{constructor(){this._formBuilder=g(dt),this.selectOnTextClick=!0,this.useLabelForText=!1,this.hideCheckboxes=!1,this.checkboxChange=new R,this._isSelected=!1,this._isDisabled=!1}set isChecked(e){this._isSelected=e,this.checkboxForm&&this.checkboxForm.controls.isSelected.patchValue(e,{emitEvent:!1})}set isDisabled(e){this._isDisabled=e,this.checkboxForm&&(e===!0?this.checkboxForm.controls.isSelected.disable({emitEvent:!1}):this.checkboxForm.controls.isSelected.enable({emitEvent:!0}))}get isChecked(){return this._isSelected}get isDisabled(){return this._isDisabled}ngOnInit(){this.hideCheckboxes?this.checkboxForm=this._formBuilder.group({isSelected:this._formBuilder.control(this._isSelected)}):(this.checkboxForm=this._formBuilder.group({isSelected:this._formBuilder.control(this._isSelected)}),this.isDisabled&&this.checkboxForm.controls.isSelected.disable({emitEvent:!1}),this._checkboxChangeSubscription=this.checkboxForm.valueChanges.subscribe(()=>{this.toggleSelected()}))}onLabelClick(){this.selectOnTextClick&&!this.hideCheckboxes&&this.checkboxForm&&this.checkboxForm.controls.isSelected.patchValue(!this.checkboxForm.controls.isSelected.value)}emitCheckboxChange(){this.checkboxChange.emit()}toggleSelected(){this._isSelected=!this._isSelected,this.emitCheckboxChange()}ngOnDestroy(){this._checkboxChangeSubscription&&this._checkboxChangeSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-tree-node"]],inputs:{node:"node",isExpanded:"isExpanded",selectOnTextClick:"selectOnTextClick",nodeTemplate:"nodeTemplate",useLabelForText:"useLabelForText",isChecked:"isChecked",isDisabled:"isDisabled",dataDoesntHaveChildren:"dataDoesntHaveChildren",hideCheckboxes:"hideCheckboxes"},outputs:{checkboxChange:"checkboxChange"},decls:1,vars:1,consts:[[1,"node",3,"toggle-none"],[1,"node"],["cdkTreeNodeToggle","","type","button","data-cy","toggle",1,"btn-icon",3,"ngbTooltip"],[3,"formGroup"],[1,"one-line-text"],["name","chevron",3,"direction"],["formControlName","isSelected","data-cy","treeCheckbox",3,"label"],[1,"one-line-text",3,"click","keydown.enter"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(t,n){t&1&&u(0,Zp,4,6,"div",0),t&2&&_(n.node?0:-1)},dependencies:[Tn,Rs,yt,Oe,Ft,j,_e,Ne,Ye,Te,ye,Ee,De,z,$],styles:["[_nghost-%COMP%]{display:flex;flex-grow:1}[_nghost-%COMP%]:hover{background-color:var(--color-gray-lighter)}.node[_ngcontent-%COMP%]{align-items:center;color:var(--color-primary-dark);cursor:pointer;display:flex;height:2.5rem;width:100%}.node[_ngcontent-%COMP%] .btn-icon[_ngcontent-%COMP%]{color:var(--color-primary-dark);height:2.25rem;margin-left:2px;min-width:2.25rem;align-items:end}.node[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{margin-right:calc(var(--spacer) / 2)}.node[_ngcontent-%COMP%] .one-line-text[_ngcontent-%COMP%]{width:100%}.toggle-none[_ngcontent-%COMP%]{padding-left:2.38rem}"]})}}return i})();var Jp=["nodeTemplate"];function Xp(i,o){if(i&1){let e=w();c(0,"cdk-tree-node",2)(1,"app-tree-node",3),x("checkboxChange",function(){let n=E(e).$implicit,r=p();return I(!r.allSelectedOrDeselected&&r.itemSelection(n,!0))}),d()()}if(i&2){let e=o.$implicit,t=p();f("cdkTreeNodePaddingIndent",20),s(),W("tree-no-children",t.treeNodeDoesntHaveChildren),f("dataDoesntHaveChildren",t.dataDoesntHaveChildren)("nodeTemplate",t.nodeTemplate)("node",e)("isDisabled",t.isAllDisabled)("isChecked",t.selectAll||t.checklistSelection.isSelected(e))("isExpanded",t.treeControl.isExpanded(e))("hideCheckboxes",t.hideCheckboxes)("useLabelForText",t.useLabelForText)("selectOnTextClick",t.selectOnTextClick&&!t.hideCheckboxes)}}var ul=(()=>
15{class i{set rootNodes(e){if(e){let t=e;this.filterDynamicFolders&&(t=e.filter(n=>n.searchFormId===Pe)),this._rootNodes=t,this._dataChange.next(this._rootNodes),this._componentIsInitialized&&this.expandTree()}}get rootNodes(){return this._rootNodes}set disableAll(e){this._isAllDisabled=e,this._componentIsInitialized&&this.handleDisableAll(e)}set selectedNodesKeys(e){this._selectedNodesKeys=e,this._componentIsInitialized&&this.handleSelection()}set selectAll(e){this._isAllSelected=e}get selectAll(){return this._isAllSelected}constructor(){this.nodeTemplate=null,this.selectOnTextClick=!0,this.openFirst=!1,this.useLabelForText=!1,this.showPopupMenu=!0,this.treeNodeDoesntHaveChildren=!1,this.filterDynamicFolders=!1,this.allSelectedOrDeselected=!1,this._isAllSelected=!1,this.hideCheckboxes=!1,this.selectionChange=new R,this.selectionAllChange=new R,this.dataDoesntHaveChildren=!1,this._flatNodeMap=new Map,this._dataChange=new oe([]),this._selectedNodesKeys=[],this._componentIsInitialized=!1,this._componentActive=!0,this._isAllDisabled=!1,this.getLevel=e=>e.level,this.isExpandable=e=>e?.hasChildren,this.getChildren=e=>e?.children,this.transformer=(e,t)=>{let n=e;return n.level=t,this._flatNodeMap.set(n,e),n},this._treeFlattener=new vo(this.transformer,this.getLevel,this.isExpandable,this.getChildren),this.treeControl=new ro(this.getLevel,this.isExpandable),this.dataSource=new Co(this.treeControl,this._treeFlattener)}ngOnInit(){this._componentIsInitialized=!0,this.treeControl.expansionModel.changed.pipe(me(()=>this._componentActive),V(e=>{(e.added?.length>0||e.removed?.length>0)&&this.handleToggleTreeNode(e)})).subscribe(),this._dataChange.pipe(me(()=>this._componentActive),V(e=>{e?.length>0&&(this.dataSource.data=e,this.dataDoesntHaveChildren=!this.dataSource.data.some(t=>t.hasChildren))})).subscribe(),this.handleSelection(),this.expandTree()}handleToggleTreeNode(e){e.added&&e.added.forEach(t=>{let n=this._flatNodeMap.get(t);n.children?.length||this.getChildFn(t).subscribe(r=>{this.handleNestedItemSelection(n,r),this._dataChange.next(this.dataSource.data)})})}itemSelection(e,t){this._isAllSelected||(this.checklistSelection.isSelected(e)?this.checklistSelection.deselect(e):this.checklistSelection.select(e),e.path||(e.path=this.getPath(e)),t&&this.selectionChange.emit(e))}ngOnDestroy(){this._componentActive=!1}get isAllDisabled(){return this._isAllDisabled}getPath(e){let t=[e.title],n=this.getParentNode(e);for(;n;)t.unshift(n.title),n=this.getParentNode(n);return t.join("/")}getParentNode(e){let t=this.getLevel(e);if(t<1)return null;let n=this.treeControl.dataNodes.indexOf(e)-1;for(let r=n;r>=0;r--){let a=this.treeControl.dataNodes[r];if(this.getLevel(a)<t)return a}return null}expandTree(){if(this._flatNodeMap.size>0){if(this.selectedItem!=null){let e=this._flatNodeMap.values().find(r=>r.id===this.selectedItem),t=[],n;do n=this.getParentNode(e),n!=null&&(t.push(n),e=n);while(n!=null);t.forEach(r=>this.treeControl.expand(r))}else if(this.openFirst&&this._rootNodes?.length>0){let e=this._rootNodes[0];e.hasChildren&&this.treeControl.expand(this._flatNodeMap.get(e))}}}handleSelectAll(e){this._isAllSelected=e,e===!0?this.selectionAllChange.emit(Array.from(this._flatNodeMap.values())):e===!1&&(this.checklistSelection.clear(),this.selectionAllChange.emit([]))}handleDisableAll(e){this._isAllDisabled=e}handleSelection(){let e=[];this._selectedNodesKeys?.length>0&&Array.from(this._flatNodeMap.keys()).forEach(t=>{this._selectedNodesKeys.includes(t.id)&&e.push(this._flatNodeMap.get(t))}),this.checklistSelection=new vi(!0,e)}handleNestedItemSelection(e,t){e.children=t,e.children?.forEach(n=>{let r=this._flatNodeMap.get(e);this.transformer(n,r.level++),this._selectedNodesKeys?.includes(n.id)&&this.itemSelection(this._flatNodeMap.get(n),!1)})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-tree"]],contentQueries:function(t,n,r){if(t&1&&It(r,Jp,5),t&2){let a;le(a=ce())&&(n.nodeTemplate=a.first)}},inputs:{selectOnTextClick:"selectOnTextClick",openFirst:"openFirst",useLabelForText:"useLabelForText",getChildFn:"getChildFn",rootNodes:"rootNodes",showPopupMenu:"showPopupMenu",treeNodeDoesntHaveChildren:"treeNodeDoesntHaveChildren",filterDynamicFolders:"filterDynamicFolders",disableAll:"disableAll",selectedNodesKeys:"selectedNodesKeys",selectedItem:"selectedItem",hideCheckboxes:"hideCheckboxes",selectAll:"selectAll"},outputs:{selectionChange:"selectionChange",selectionAllChange:"selectionAllChange"}
15,decls:2,vars:2,consts:[[1,"tree",3,"dataSource","treeControl"],["cdkTreeNodePadding","",3,"cdkTreeNodePaddingIndent",4,"cdkTreeNodeDef"],["cdkTreeNodePadding","",3,"cdkTreeNodePaddingIndent"],["data-cy","folder",3,"checkboxChange","dataDoesntHaveChildren","nodeTemplate","node","isDisabled","isChecked","isExpanded","hideCheckboxes","useLabelForText","selectOnTextClick"]],template:function(t,n){t&1&&(c(0,"cdk-tree",0),Y(1,Xp,2,12,"cdk-tree-node",1),d()),t&2&&f("dataSource",n.dataSource)("treeControl",n.treeControl)},dependencies:[Qe,Er,ks,Sn,rn,ml],styles:[".tree[_ngcontent-%COMP%]{display:flex;width:100%;flex-direction:column}.tree-no-children[_ngcontent-%COMP%]{padding-left:2.25rem}"],changeDetection:0})}}return i})();var _l=(()=>{class i{constructor(){this._notificationService=g(Xi)}insertNewFolders(e,t,n){let{cancel:r,addSubscription:a,createResult:l}=e;return r?[]:(l.favoritesFolderCreateResponse.forEach(b=>{let{parentFolderId:T,favoritesFolderId:O}=b,U=Ni.findNode(T,t),H={title:this.addParentIfTitleExists(l.favoritesFolderTitle,U),children:[],hasChildren:!1,id:O,matchesSearch:l.favoritesFolderTitle.toLowerCase().indexOf(n.toLowerCase())>-1,isMonitored:!1,fullPath:U.fullPath+"/"+e.createResult.favoritesFolderTitle,isSharedFromMe:U.isSharedFromMe||!1,isSharedWithMe:U.isSharedWithMe||!1,sharedFromGroup:U.sharedFromGroup||!1,subscription:null,rights:[],accessLevel:{fullAccess:!(U&&!U.accessLevel.owner),owner:!(U&&!U.accessLevel.owner),read:!(U&&!U.accessLevel.owner),write:!(U&&!U.accessLevel.owner)},searchFormId:Pe,description:{text:l.favoritesFolderDescription,title:l.favoritesFolderTitle},descriptionFiles:[],emailNotification:!0};a&&this._notificationService.addDefaultSubscription(O).pipe(Re(ee=>{if(ee){let N=ee.body.subscriptionId;return this._notificationService.getDefaultSubscription().pipe(V(Ce=>{Ce&&(H.subscription={active:!0,updateFrequency:Ce.updateFrequency,hasDefaultSettings:!0,subscriptionId:N,trigger:Ce.trigger})}))}return xe})).subscribe();let Z=this.findById(t,T);Z&&((!Z.hasChildren||!Z.children)&&(Z.children=[]),Z.hasChildren=!0,Z.children.push(H))}),fn(t))}addParentIfTitleExists(e,t){let n=t?.children?.filter(r=>r.title===e)??[];return n.length?`${e} (${n.length})`:e}findById(e,t){let n="children";if(e.length)return e.find(r=>r.id===t)||this.findById(e.flatMap(r=>r[n]||[]),t)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var hl=(()=>{class i{transform(e,t){return!!e?.find(r=>r.rightName===t)?.hasRight}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"hasFolderPermission",type:i,pure:!0})}}return i})();function em(i,o){if(i&1){let e=w();c(0,"input",13),h(1,"transloco"),x("keyup",function(n){E(e);let r=p();return I(r.onKeyPress(n))}),d(),c(2,"textarea",14),h(3,"transloco"),v(4," "),d(),c(5,"span",15),v(6),h(7,"transloco"),d()}i&2&&(f("placeholder",kt(C(1,6,"favorites.folder_name")))("appAutoFocus",!0),s(2),f("placeholder",kt(C(3,8,"favorites.folder_description"))),s(4),D(C(7,10,"search.favorites_folder_select.as_subfolder_of")))}function tm(i,o){i&1&&y(0,"app-spinner")}function im(i,o){if(i&1&&(c(0,"div")(1,"div",17),y(2,"app-icon",18),c(3,"span",19),v(4),d()()()),i&2){let e=p().$implicit,t=p(2);s(2),f("name",t.getNodeIcon(e))("ngClass",e.isSharedWithMe||e.isSharedFromMe?"icon-success":"icon-clickable-dark"),s(2),D(e.title)}}function nm(i,o){if(i&1&&(u(0,im,5,3,"div"),h(1,"hasFolderPermission"),h(2,"hasFolderPermission")),i&2){let e=o.$implicit,t=p(2);_(!e.isSharedWithMe||de(1,1,e.isSharedWithMe&&e.rights,t.folderPermission.FAVORITE_ADD)||de(2,4,e.isSharedWithMe&&e.rights,t.folderPermission.FOLDER_ADD_SUBFOLDER)?0:-1)}}function om(i,o){if(i&1){let e=w();c(0,"app-tree",16),x("selectionChange",function(n){E(e);let r=p();return I(r.setSelected(n))}),Y(1,nm,3,7,"ng-template",null,0,fe),d()}if(i&2){let e=p();f("filterDynamicFolders",!1)("rootNodes",e.rootNodes)("getChildFn",e.getChildren)("openFirst",!0)("selectAll",e.selectAll)("selectedNodesKeys",e.selectedNodes)}}function rm(i,o){if(i&1){let e=w();c(0,"button",20),x("click",function(){E(e);let n=p();return I(n.switchToCreateMode())}),y(1,"app-icon",21),c(2,"span"),v(3),h(4,"transloco"),h(5,"transloco"),d()()}if(i&2){let e=p();s(3),F(" ",e.folderType===e.folderTypes.Note?C(4,1,"favorites.note.create_folder"):C(5,3,"favorites.favorite.create_folder")," ")}}function am(i,o){i&1&&y(0,"app-checkbox",7)}function sm(i,o){if(i&1){let e=w();c(0,"button",22),x("click",function(){E(e);let n=p();return I(n.onAddToSelected())}),v(1),h(2,"transloco"),d()}i&2&&(s(),F(" ",C(2,1,"common.save")," "))}function lm(i,o){if(i&1){let e=w();c(0,"button",22),x("click",function(){E(e);let n=p();return I(n.onCreateNewFoldersInSelected())}),v(1),h(2,"transloco"),d()}i&2&&(s(),F(" ",C(2,1,"common.save")," "))}function cm(i,o){i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"common.save")))}function dm(i,o){i&1&&y(0,"app-icon",24)}function pm(i,o){if(i&1){let e=w();c(0,"button",23),x("click",function(){E(e);let n=p();return I(n.onCopyFolders())}),u(1,cm,3,3,"span"),u(2,dm,1,0,"app-icon",24),d()}if(i&2){let e=p();f("disabled",e.isSaveDisabled),s(),_(e.sendingRequest?-1:1),s(),_(e.sendingRequest?2:-1)}}var Ur=(()=>{class i{constructor(){this.modalService=g(he),this._activeModal=g(fi),this._changeDetectorRef=g(ze),this._favoritesService=g(Xt),this._formBuilder=g(dt),this._translocoService=g(ae),this._treeService=g(_l),this.folderPermission=Fn,this.folderTypes=$e,this.emptyGuid=Pe,this.isPending=!0,this.rootNodes=null,this.sendingRequest=!1,this.selectAll=null,this.selectedNodes=[],this.isSaveDisabled=!1,this.isAddDisabled=!0,this._isCreateMode=!1,this._onlyCreate=!1,this._isCopyMode=!1,this._componentActive=!0,this._selectedNodesMap=new Map,this.preSelectedNodes=[],this.folderType=$e.Folder,this.createDynamicFolder=!1,this.createdFolderInCreateMode=new R,this.folderCreated=new R,this.getChildren=e=>this.isPending?M([]):(this.isPending=!0,this._favoritesService.getChildFolders(e.id,e.isSharedWithMe,!this.createDynamicFolder).pi
15pe(Nt(),Si(()=>this.isPending=!1),S(t=>(this._changeDetectorRef.detectChanges(),t)),k(()=>M([]))))}ngOnInit(){this.favoriteFolderSelectForm=this._formBuilder.group({folderTitle:this._formBuilder.control(""),folderDescription:this._formBuilder.control(""),addSubscription:this._formBuilder.control(!0)}),this.isPending=!0,this._errorMessage="",this._favoritesService.getRootFolderAndNotification(this.folderType,!this.createDynamicFolder).subscribe({next:e=>{e&&(this.rootNodes=e.filter(t=>t.rights.filter(n=>n.rightName==="FAVORITE_ADD").map(n=>n.hasRight).every(n=>!!n)),this.isPending=!1,this._changeDetectorRef.detectChanges())}})}ngOnDestroy(){this._componentActive=!1,this._onCopyFoldersSubscription&&this._onCopyFoldersSubscription.unsubscribe(),this._rootFolderSubscription&&this._rootFolderSubscription.unsubscribe()}get isCreateMode(){return this._isCreateMode}get errorMessage(){return this._errorMessage}set onlyCreate(e){this._onlyCreate=e,e&&(this._isCreateMode=!0)}get isCopyMode(){return this._isCopyMode}set isCopyMode(e){this._isCopyMode=e}get showMoreSettings(){return this.isCreateMode}onClose(e,t,n){if(this._isCreateMode&&!this._onlyCreate&&e){this._isCreateMode=!1,this._errorMessage="";for(let r of e.favoritesFolderCreateResponse){let a=Ni.findNode(r.parentFolderId,this.rootNodes);if(a&&(a.hasChildren=!0,a.children)){let l=Ni.findNewFolderTitle(a.children,e.favoritesFolderTitle,[]),m=this.createNewNode(l,r.favoritesFolderId);a.children.push(m)}}}else{let r=this.rootNodes.map(b=>b.id),a=[...this._selectedNodesMap.keys()],l=[...this._selectedNodesMap.values()],m=a.every(b=>r.includes(b));this._activeModal.close({createResult:e,copyResult:t,addSubscription:this.addSubscription.value,cancel:n,isRootFavorite:m,selectedNodesValues:l})}}onKeyPress(e){e.key==="Enter"&&this.onCreateNewFoldersInSelected()}onAddToSelected(){if(this.selectAll=null,this.isAddDisabled){this._errorMessage="favorites.folder_select_at_least_one";return}else this._errorMessage="";if(this._selectedNodesMap?.size<=0&&this.rootNodes[0]&&this._selectedNodesMap.set(this.rootNodes[0].id,this.rootNodes[0]),this.createDynamicFolder||this._favoritesService.setFavoriteAcCodesToFolders(this.acCodes,[...this._selectedNodesMap.keys()],this.folderType).subscribe(()=>{this.onClose(null,null,!1)}),this.createDynamicFolder&&this._selectedNodesMap&&this.searchTemplateId){let e=[];this._selectedNodesMap.forEach((n,r)=>{e.push({searchFormId:this.searchTemplateId,parentFolderId:r})});let t=e.map(n=>this._favoritesService.createDynamicFolder(n));qt(...t).pipe(ea(),k(()=>(this._activeModal.close({success:!1}),xe)),me(()=>this._componentActive)).subscribe({next:n=>{if(n){let r=n.map(a=>a.body.favoritesFolderId);this._activeModal.close({success:!0,response:r})}}})}}onCreateNewFoldersInSelected(){this.selectAll=null,this._selectedNodesMap?.size<=0&&this.rootNodes[0]&&(this._selectedNodesMap.set(this.rootNodes[0].id,this.rootNodes[0]),this.selectAll=null);let e=this.folderType===$e.Note?this._translocoService.translate("favorites.new_notes_folder"):this._translocoService.translate("favorites.new_folder");if(!this.folderTitle.value||this.folderTitle.value===this._translocoService.translate("favorites.new_notes_folder")||this.folderTitle.value===this._translocoService.translate("favorites.new_folder")){let t=0,n=e;for(;this.rootNodes[0]?.children?.some(r=>r.title===n);)t++,n=`${e} (${t})`;this.folderTitle.patchValue(n)}this._favoritesService.createFavoritesFolder(this.folderTitle.value,[...this._selectedNodesMap.keys()],this.folderType,this.folderDescription.value).pipe(V(t=>{if(this._onlyCreate){this.onClose(t,null,!1);return}let n={createResult:{favoritesFolderCreateResponse:t.favoritesFolderCreateResponse,favoritesFolderTitle:this.folderTitle.value,favoritesFolderDescription:this.folderDescription.value},addSubscription:this.addSubscription.value,cancel:!1,copyResult:null};this.rootNodes=[...this._treeService.insertNewFolders(n,this.rootNodes,"")],this.handleSelectionAfterFolderCreation(n),this.createdFolderInCreateMode.emit({success:!0}),this._isCreateMode=!1,this.selectAll=!1,this.folderCreated.emit({nodes:this.rootNodes,folderType:this.folderType})}),k(()=>(this.createdFolderInCreateMode.emit({success:!1}),xe)),me(()=>this._componentActive)).subscribe()}setSelected(e){this.selectAll=null;let t=e;this._selectedNodesMap.has(e.id)?this._selectedNodesMap.delete(e.id):this._selectedNodesMap.set(e.id,t),!this.isCreateMode&&this.isCopyMode&&(this.isSaveDisabled=this.onlySharedSelected()),!this.isCreateMode&&!this.isCopyMode&&(this.isAddDisabled=this._selectedNodesMap.size===0)}switchToCreateMode(){this._isCreateMode=!0,this._errorMessage="",this.folderTitle.patchValue(""),this._selectedNodesMap.clear(),this.selectedNodes=[],this.selectAll=!1}getModalTitle(){let e=this.folderType===$e.Note?"favorites.note":"favorites.favorite";return this._isCopyMode&&!this._isCreateMode?`${e}.copy_folder`:!this._isCopyMode&&!this._isCreateMode?`${e}.add_to_folder`:`${e}.create_folder`}onCopyFolders(){if(!this.sendingRequest){if(this._onCopyFoldersSubscription&&this._onCopyFoldersSubscription.unsubscribe(),this._selectedNodesMap.size===0){this._errorMessage="favorites.please_choose_target_folder";return}
15this._selectedNodesMap.forEach((e,t)=>{this.preSelectedNodes.indexOf(t)>-1&&(this._errorMessage="favorites.folder_can_not_be_copied_into_own_structure")}),this.sendingRequest=!0,this._onCopyFoldersSubscription=this._favoritesService.copyFavoritesFolders(this.preSelectedNodes,[...this._selectedNodesMap.keys()]).pipe(Si(()=>this.sendingRequest=!1)).subscribe({next:e=>{this.onClose(null,e,!1)}})}}getNodeIcon(e){return this._favoritesService.getNodeIcon(e)}createNewNode(e,t){return{title:e,children:[],hasChildren:!1,id:t,matchesSearch:!1,isMonitored:!1,isSharedFromMe:!1,isSharedWithMe:!1,subscription:null,description:{text:"",title:e},descriptionFiles:[],searchFormId:Pe,sharedFromGroup:!1,rights:[{rightName:"FAVORITE_ADD",hasRight:!0},{rightName:"FAVORITE_REMOVE",hasRight:!0},{rightName:"FOLDER_ADD_SUBFOLDER",hasRight:!0},{rightName:"FOLDER_CONFIG_OBSERVE",hasRight:!0},{rightName:"FOLDER_COPY",hasRight:!0},{rightName:"FOLDER_DESCRIPTION_CHANGE",hasRight:!0},{rightName:"FOLDER_EDIT_SHARE",hasRight:!0},{rightName:"FOLDER_LEAVE",hasRight:!0},{rightName:"FOLDER_REMOVE",hasRight:!0},{rightName:"FOLDER_RENAME",hasRight:!0}],accessLevel:{fullAccess:!0,owner:!0,read:!0,write:!0},emailNotification:null}}handleSelectionAfterFolderCreation(e){let t=new Map(this._selectedNodesMap);this._selectedNodesMap.clear(),this.selectedNodes=[],e.createResult.favoritesFolderCreateResponse.forEach(n=>{let r=t.get(n.parentFolderId).children.find(a=>a.id===n.favoritesFolderId);this.setSelected(r)}),this.selectedNodes=[...this._selectedNodesMap.keys()],this.isAddDisabled=!1}get folderTitle(){return this.favoriteFolderSelectForm.get("folderTitle")}get folderDescription(){return this.favoriteFolderSelectForm.get("folderDescription")}get addSubscription(){return this.favoriteFolderSelectForm.get("addSubscription")}onlySharedSelected(){return!Array.from(this._selectedNodesMap.values()).map(e=>e.isSharedWithMe).some(e=>!e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-favorites-folder-select-modal"]],inputs:{preSelectedNodes:"preSelectedNodes",folderType:"folderType",createDynamicFolder:"createDynamicFolder",searchTemplateId:"searchTemplateId"},outputs:{createdFolderInCreateMode:"createdFolderInCreateMode",folderCreated:"folderCreated"},decls:19,vars:17,consts:[["nodeTemplate",""],[3,"modalTitle","border"],[3,"formGroup"],[1,"modal-body"],[1,"scroll-box"],[3,"filterDynamicFolders","rootNodes","getChildFn","openFirst","selectAll","selectedNodesKeys"],["type","button","data-cy","createFolder",1,"btn-icon-text"],["formControlName","addSubscription","label","observation.create","data-cy","activateObservation"],["data-cy","errorMessage",1,"modal-text-alert"],["buttonType","custom"],["type","button","data-cy","cancel",1,"btn-primary-outline",3,"click"],["type","button","data-cy","save",1,"btn-primary"],["type","button","data-cy","save",1,"btn-primary",3,"disabled"],["formControlName","folderTitle","type","text","data-cy","newFolderName",3,"keyup","appAutoFocus","placeholder"],["formControlName","folderDescription","data-cy","folderDescription",3,"placeholder"],[1,"subfolder-headline"],[3,"selectionChange","filterDynamicFolders","rootNodes","getChildFn","openFirst","selectAll","selectedNodesKeys"],[1,"folder"],["sprite","icons-folders","data-cy","iconFolder",3,"name","ngClass"],["data-cy","folderName",1,"one-line-text"],["type","button","data-cy","createFolder",1,"btn-icon-text",3,"click"],["name","folder-add"],["type","button","data-cy","save",1,"btn-primary",3,"click"],["type","button","data-cy","save",1,"btn-primary",3,"click","disabled"],["name","loading-spinner"]],template:function(t,n){t&1&&(y(0,"app-modal-header",1),c(1,"form",2)(2,"div",3),u(3,em,8,12),c(4,"div",4),u(5,tm,1,0,"app-spinner"),u(6,om,3,6,"app-tree",5),d(),u(7,rm,6,5,"button",6),u(8,am,1,0,"app-checkbox",7),c(9,"p",8),v(10),h(11,"transloco"),d()()(),c(12,"app-modal-footer",9)(13,"button",10),x("click",function(){return n.modalService.dismiss()}),v(14),h(15,"transloco"),d(),u(16,sm,3,3,"button",11),u(17,lm,3,3,"button",11),u(18,pm,3,3,"button",12),d()),t&2&&(f("modalTitle",n.getModalTitle())("border",!0),s(),f("formGroup",n.favoriteFolderSelectForm),s(2),_(n.isCreateMode?3:-1),s(2),_(n.isPending?5:-1),s(),_((n.rootNodes==null?null:n.rootNodes.length)>0?6:-1),s(),_(n.isCreateMode?-1:7),s(),_(n.showMoreSettings?8:-1),s(2),D(C(11,13,n.errorMessage)),s(4),F(" ",C(15,15,"common.cancel")," "),s(2),_(!n.isCreateMode&&!n.isCopyMode?16:-1),s(),_(n.isCreateMode?17:-1),s(),_(!n.isCreateMode&&n.isCopyMode?18:-1))},dependencies:[Ji,yt,j,Me,we,Ne,Ye,it,Te,ye,Ee,De,Qe,lt,ui,z,ul,$,hl],styles:[".scroll-box[_ngcontent-%COMP%]{border-bottom:var(--border);height:40vh}.scroll-box[_ngcontent-%COMP%] .folder[_ngcontent-%COMP%]{display:flex;align-items:center}.scroll-box[_ngcontent-%COMP%] .folder[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{flex-shrink:0}.modal-text-alert[_ngcontent-%COMP%]{color:var(--color-alert);font-size:var(--font-size-small);margin:0}.btn-icon-text[_ngcontent-%COMP%]{justify-content:flex-start;width:100%}"]})}}return i})();var mm=["*"];function um(i,o){if(i&1&&(y(0,"app-icon",3),h(1,"transloco"),h(2,"transloco")),i&2){let e=p();f("ngbTooltip",C(1,2,e.info)),P("aria-label",C(2,4,e.info))}}function _m(i,o){if(i&1){let e=w();c(0,"button",5),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p();return I(n.resetSettings.emit(n.blockName))}),y(3,"app-icon",6),d()}if(i&2){let e=p();W("disabled",e.isResetButtonDisabled),f("disabled",e.isResetButtonDisabled)("ngbTooltip",C(1,7,"common.reset")),P("aria-label",C(2,9,"common.reset")),s(3),W("disabled",e.isResetButtonDisabled)}}function hm(i,o){i&1&&Rn(0)}var fl=(()=>{class i{constructor(){this.expanded=!0,this.headline="",this.hasResetButton=!1,this.isResetButtonDisabled=!1,this.resetSettings=new R}toggleExpand(e){if(e.target.tagName==="I"&&e.target.className==="icon-reset"){e.preventDefault();return}this.expanded=!this.expanded}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-collapsible-section"]],inputs:{expanded:"expanded",headline:"headline",hasResetButton:"hasResetButton",isResetButtonDisabled:"isResetButtonDisabled",blockName:"blockName",info:"info"},outputs:{resetSettings:"resetSettings"},ngContentSelectors:mm,decls:9,vars:7,consts:[[1,"collapse-container"],["type","button","data-cy","toggleCollapse",1,"btn-collapse",3,"click"],["name","chevron",3,"direction"],["name","info","data-cy","licenseInfo",1,"icon-cl
15ickable",3,"ngbTooltip"],["type","button","data-cy","reset",1,"reset-button",3,"disabled","ngbTooltip"],["type","button","data-cy","reset",1,"reset-button",3,"click","disabled","ngbTooltip"],["name","reset"]],template:function(t,n){t&1&&(kn(),c(0,"div",0)(1,"button",1),x("click",function(a){return n.toggleExpand(a)}),y(2,"app-icon",2),c(3,"span"),v(4),h(5,"transloco"),d(),u(6,um,3,6,"app-icon",3),d(),u(7,_m,4,11,"button",4),d(),u(8,hm,1,0)),t&2&&(s(2),f("direction",n.expanded?"down":"right"),s(2),D(C(5,5,n.headline)),s(2),_(n.info?6:-1),s(),_(n.hasResetButton?7:-1),s(),_(n.expanded?8:-1))},dependencies:[j,_e,z,$],styles:[".collapse-container[_ngcontent-%COMP%]{border-bottom:var(--border)}.collapse-container[_ngcontent-%COMP%] .reset-button[_ngcontent-%COMP%]{width:2.5rem;height:2.5rem;border-radius:var(--border-radius);border:var(--border);background-color:var(--color-gray-lighter)}.collapse-container[_ngcontent-%COMP%] .reset-button[_ngcontent-%COMP%]:hover{background-color:var(--color-gray-light)}.collapse-container[_ngcontent-%COMP%] .reset-button.disabled[_ngcontent-%COMP%]{background-color:var(--color-gray-dark)}"]})}}return i})();function fm(i,o){i&1&&y(0,"app-spinner")}function gm(i,o){i&1&&(c(0,"p",4),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"favorites.not_contained_in_any_folder")," "))}function Cm(i,o){if(i&1&&(c(0,"span",10),v(1),d()),i&2){let e=p(2).$implicit;s(),F(" (",e.fullPath,") ")}}function vm(i,o){if(i&1){let e=w();c(0,"button",13),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(2).$implicit,r=p(4);return I(r.removeElement(n))}),y(3,"app-icon",14),d()}i&2&&(f("ngbTooltip",C(1,2,"common.remove")),P("aria-label",C(2,4,"common.remove")))}function bm(i,o){if(i&1&&(c(0,"div",6)(1,"div")(2,"div",7),y(3,"app-icon",8),c(4,"span",9),v(5),d(),u(6,Cm,2,1,"span",10),d(),c(7,"p",11),v(8),d()(),u(9,vm,4,6,"button",12),d()),i&2){let e=p().$implicit,t=p(4);$i(e.customStyleClass),s(3),W("icon-success",e.isSharedWithMe||e.isSharedFromMe)("icon-clickable-dark",!(e.isSharedWithMe||e.isSharedFromMe)),f("name",t.getFolderIcon(e)),s(2),D(e.path),s(),_(e.isSharedWithMe?6:-1),s(2),D(e.description),s(),_(e.hasWriteAccess?9:-1)}}function ym(i,o){if(i&1&&u(0,bm,10,11,"div",5),i&2){let e=o.$implicit;_(e?0:-1)}}function xm(i,o){if(i&1&&G(0,ym,1,1,null,null,J),i&2){let e=p().$implicit;q(e.formElements)}}function Sm(i,o){if(i&1&&(c(0,"app-collapsible-section",3),u(1,fm,1,0,"app-spinner"),u(2,gm,3,3,"p",4),u(3,xm,2,0),d()),i&2){let e=o.$implicit,t=o.$index,n=p(2);f("expanded",e.expanded)("headline",e.headline),P("data-cy",n.dataCyMapping[t]),s(),_(e!=null&&e.formElements?-1:1),s(),_(e!=null&&e.formElements&&!(!(e==null||e.formElements==null)&&e.formElements.length)?2:-1),s(),_(!(e==null||e.formElements==null)&&e.formElements.length?3:-1)}}function Tm(i,o){if(i&1&&(c(0,"div",1),G(1,Sm,4,6,"app-collapsible-section",3,J),d()),i&2){let e=p();s(),q(e.formConfig[0].collapseBlocks)}}var gl=(()=>{class i{constructor(){this.modalService=g(he),this._favoritesService=g(Xt),this.dataCyMapping=["favorites","notes"],this.folderPermission=Fn,this._deleteFavoritesIds=[],this._deleteNotesIds=[],this.saveRemoved=new R,this.formConfig=[{pageNum:1,collapseBlocks:[{headline:"favorites.favorite.title",expanded:!0,formElements:void 0},{headline:"favorites.notes",expanded:!0,formElements:void 0}]}]}set favorites(e){this._favorites=e,this.formConfig[0].collapseBlocks[0].formElements=[];for(let t of this._favorites){let n={path:t.path,fullPath:t.fullPath,description:t.description,hideCheckbox:!0,customStyleClass:"favorites-details-container",field:"",value:t.folderId,type:"favorite",isSharedFromMe:t.isSharedFromMe,isSharedWithMe:t.isSharedWithMe,hasWriteAccess:!1};t.ownedByMe?n.hasWriteAccess=!0:this._favoritesService.getShareInformation(t.folderId).pipe(V(r=>{n.hasWriteAccess=this.getHasWriteAccessFromUserRights(r)||this.getHasWriteAccessFromUserGroupRights(r)})).subscribe(),this.formConfig[0].collapseBlocks[0].formElements.push(n)}}set notes(e){this._notes=e,this.formConfig[0].collapseBlocks[1].formElements=[];for(let t of this._notes){let n={path:t.path,fullPath:t.fullPath,description:t.description,hideCheckbox:!0,customStyleClass:"notes-details-container",field:"",value:t.folderId,type:"note",isSharedFromMe:t.isSharedFromMe,isSharedWithMe:t.isSharedWithMe,hasWriteAccess:!0};t.ownedByMe?n.hasWriteAccess=!0:this._favoritesService.getShareInformation(t.folderId).pipe(V(r=>{n.hasWriteAccess=this.getHasWriteAccessFromUserRights(r)||this.getHasWriteAccessFromUserGroupRights(r)})).subscribe(),this.formConfig[0].collapseBlocks[1].formElements.push(n)}}removeElement(e){e.type==="favorite"?(this.formConfig[0].collapseBlocks[0].formElements=this.formConfig[0].collapseBlocks[0].formElements.filter(t=>t.path!==e.path),this._deleteFavoritesIds.push(e.value)):e.type==="note"&&(this.formConfig[0].collapseBlocks[1].formElements=this.formConfig[0].collapseBlocks[1].formElements.filter(t=>t.path!==e.path),this._deleteNotesIds.push(e.value))}onSave(){this.saveRemoved.emit({deleteFavoritesIds:this._deleteFavoritesIds,deleteNotesIds:this._deleteNotesIds}),this.modalService.dismiss()}getFolderIcon(e){return this._favoritesService.getNodeIcon(e)}getHasWriteAccessFromUserRights(e){return e.userRights.findIndex(t=>t.fullAccess||t.write)!==-1}getHasWriteAccessFromUserGroupRights(e){return e.userGroupRights.findIndex(t=>t.fullAccess||t.write)!==-1}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-favorites-notes-modal"]],inputs:{favorites:"favorites",notes:"notes"},outputs:{saveRemoved:"saveRemoved"},decls:3,vars:2,consts:[["modalTitle","favorites.favorites_and_notes",3,"border"],[1,"modal-body"],[3,"cancelButtonClick","saveButtonClick"],[3,"expanded","headline"],[1,"not-favorite-or-note"],["data-cy","folder",3,"class"],["data-cy","folder"],[1,"folder"],["sprite","icons-folders","data-cy","iconFolder",3,"name"],["data-cy","folderName",1,"text-bold"],["data-cy","folderPath"],["data-cy","folderDescription",1,"description"],["type","button",1,"btn-icon",3,"ngbTooltip"],["type","button",1,"btn-icon",3,"click","ngbTooltip"],["name","cross","data-cy","iconRemove"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),u(1,Tm,3,0,"div",1),c(2,"app-modal-footer",2),x("cancelButtonClick",function(){return n.modalService.dismiss()})("saveButtonClick",function(){return n.onSave()}),d()),t&2&&(f("border",!0),s(),_(n.formConfig?1:-1))}
15,dependencies:[fl,j,Me,we,_e,ui,z,$],styles:["[class*=-details-container][_ngcontent-%COMP%]{background-color:var(--color-gray-lighter);border-radius:var(--border-radius);border:var(--border);display:flex;justify-content:space-between;margin-block:calc(var(--spacer) / 2);padding:calc(var(--spacer) / 2)}[class*=-details-container][_ngcontent-%COMP%]:not(:last-child){margin-bottom:calc(var(--spacer) / 2)}[class*=-details-container][_ngcontent-%COMP%] .folder[_ngcontent-%COMP%]{align-items:center;display:flex;gap:calc(var(--spacer) / 2)}[class*=-details-container][_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin-left:43px}.not-favorite-or-note[_ngcontent-%COMP%]{font-family:var(--font-family-italic);margin:var(--spacer)}.notes-details-container[_ngcontent-%COMP%], .notes-details-container[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background-color:var(--color-warning-light)}"]})}}return i})();var ti=class{static getAvailableLanguages(){return[{text:"DE",value:"de"},{text:"EN",value:"en"},{text:"FR",value:"fr"},{text:"ML",value:"ml"}]}static getDocumentFormats(){return[{text:"common.download",value:"download"},{text:"orders.request.paper",value:"paper"}]}static getDocumentTypes(o,e){let t=o.subscriptionNumbersNormTicker,n={text:"orders.request.single_purchase",value:"single_purchase"},r=t.map(a=>({text:`${e.translate("orders.request.subscription")} (${a})`,value:a}));return[n,...r]}};var Br=new Ke("user-detail.config"),Dm="userFavorites",Em="userNotes",Im={userDetail:{navigationPanelInfo:[{headerIconName:"folder-favorite",panelId:Dm,panelTitle:"favorites.my_favorites",permissions:se.SETTINGS_ADMIN},{headerIconName:"note-folder",panelId:Em,panelTitle:"favorites.my_notes",permissions:se.SETTINGS_ADMIN}],ssoSettings:[{value:"login-options",text:"user_management.sso.settings.general"},{value:"ip-ranges",text:"user_management.sso.ip_ranges.ip_ranges"},{value:"sso/v1",text:"user_management.sso.settings.sso_v1"},{value:"sso/ldap",text:"user_management.sso.settings.ldap"},{value:"sso/v2",text:"user_management.sso.settings.sso_v2"},{value:"logging",text:"user_management.sso.settings.logging"},{value:"proxy",text:"user_management.sso.settings.proxy"}],ssoLoginOptions:[{value:un.PASSWORD_LOGIN,text:"user_management.login_options.password"},{value:un.IP_LOGIN,text:"user_management.login_options.iplogin"},{value:un.LDAP,text:"user_management.login_options.ldap"},{value:un.SAML,text:"user_management.login_options.saml"}],ssoLoginParameters:[{value:$n.USERNAME_AND_PASSWORD,text:"user_management.login_options.password",url:"",active:!1},{value:$n.IP_LOGIN,text:"user_management.login_options.iplogin",url:"",active:!1},{value:$n.SSO_V2,text:"user_management.sso.settings.sso_v2",url:"",active:!1}],ssoLogoutOptions:[{value:Vn.LOGOUT_DISABLED,text:"user_management.logout_options.logout_disabled"},{value:Vn.GOTO_STANDARD_LOGOUT_PAGE,text:"user_management.logout_options.navigate_to_logout_page"},{value:Vn.GOTO_CUSTOM_LOGOUT_PAGE,text:"user_management.logout_options.navigate_to_custom_logout_page"}],ssoLogStatusTypes:[{value:_n.REJECTED,text:"common.declined"},{value:_n.SUCCESS,text:"user_management.sso.logging.success"},{value:_n.LOGOUT,text:"user_management.sso.logging.logout"},{value:_n.ERROR,text:"user_management.sso.logging.error"}],effectiveUntil:Array.from([1,2,3,4,5,6]).map(i=>{let o=new Date,e=new Date;return o.setUTCMonth(e.getUTCMonth()+i),o}).map(i=>({value:i.toISOString(),text:i.toISOString()}))},paging:{pageNumber:0,perPage:25}},Nw=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=rt({type:i})}static{this.\u0275inj=ot({providers:[{provide:Br,useValue:Im}]})}}return i})();var bo=class{};var yo=class{constructor(){this._roles=[],this.roleNames=[],this._costCenters=[]}set user(o){this._user=o}get user(){return this._user}set roles(o){this._roles=o,this.roleNames=o.map(e=>e.name)}get surname(){return this._user.surname}get forename(){return this._user.forename}get department(){return this._user.department}get roles(){return this._roles}get costCenters(){return this._costCenters}set costCenters(o){this._costCenters=o}set lockAdminUsername(o){this._lockAdminUsername=o}get lockAdminUsername(){return this._lockAdminUsername}set lockTime(o){this._lockTime=o}get lockTime(){return this._lockTime}get id(){return this.user.id}set id(o){this.user.id=o}get groups(){return this.user.groups}set groups(o){this.user.groups=o}set language(o){this.user.language=o}get language(){return this.user.language}set licenseNames(o){this.user.licenseNames=o}get licenseNames(){return this.user.licenseNames}set layoutLanguage(o){this.user.layoutLanguage=o}get layoutLanguage(){return this.user?.layoutLanguage}set active(o){this.user.active=o}get active(){return this.user?.active??!1}};var yi=class{static toUserAccountRequest(o){let e=new bo;return e.email=o.email,e.forename=o.forename,e.orderNumber=o.orderNumber,e.password=o.password,e.surname=o.surname,e.userAccountId=o.id,e.username=o.username,e.salutation=o.salutation,e.abbreviation=o.abbreviation,e.info=o.info,e.costCenters=o.costCenters,e.company=o.company,e.department=o.department,e.phoneNumber=o.phoneNumber,e.location=o.location,e.language=o.language,e.effectiveUntil=o.effectiveUntil,e.layoutLanguage=o.layoutLanguage??"de",e.isOrderEmailNotificationActivated=o.isOrderEmailNotificationActivated,e}static toUserVM(o,e=[],t=[],n=null){let r=new yo;return r.user=o,r.roles=e,r.costCenters=t,r?.layoutLanguage||(r.user.layoutLanguage="de"),n&&o.lock!==null&&(r.lockTime=si.isoToLocalDate(o.lock.time),r.lockAdminUsername=n.username,o.lock.nameOfExecutingUser=`${n.forename} ${n.surname} (${n.username})`),r}static toUserChangeRequest(o){return{forename:o.forename!=null?o.forename:"",surname:o.surname!=null?o.surname:"",email:o.email!=null?o.email:"",password:o.password!=null?o.password:null,orderNumber:o.orderNumber!=null?o.orderNumber:"",costCenters:o.costCenters!=null?[...o.costCenters]:[],salutation:o.salutation!=null?o.salutation:"",abbreviation:o.abbreviation!=null?o.abbreviation:"",info:o.info!=null?o.info:"",company:o.company!=null?o.company:"",department:o.department!=null?o.department:"",phoneNumber:o.phoneNumber!=null?o.phoneNumber:"",location:o.location!=null?o.location:"",language:o.language!=null?o.language:"",effectiveUntil:o.effectiveUntil,layoutLanguage:o.layoutLanguage,username:o.username,isOrderEmailNotificationActivated:o.isOrderEmailNotificationActivated}}};var xo=(()=>{class i{constructor(){this._userDetailConfig=g(Br),this._authService=g(ue),this._authStorage=g(Bn),this._configService=g(Se),this._httpClient=g(Fe),this._users=new oe([]),this.users$=this._users.asObservable(),this._page=this._userDetailConfig.paging.pageNumber,this._perPage=this._userDetailConfig.paging.perPage,this._filter={licenseTitle:"",costCenter:"",status:!0,trunk:"",name:"",username:"",roleName:null,isNotAMemberOfGroup:null,isAMemberOfGroup:null,includePaperbin:!1,location:"",isNotAssignedToLocation:"",isUserActive:null},this._authStorage.tokenChanged().subscribe(e=>{e&&this.resetFilter()})}get filter(){return this._filter}set filter(e){this._filter=e}static getGroupNames(e,t=[]){return e.filter(n=>t.includes(n.groupId)).map(n=>n.name)}static hasRole(e,t,n=!1){e=e.toLowerCase(),t=t.map(a=>a.toLowerCase());let r=t.includes(e);return n&&r&&(r=![Vt.READONLY,Vt.STANDARD,Vt.ADMIN].map(l=>l.toLocaleLowerCase()).filter(l=>l!==e).some(l=>t.includes(l))),r}static getHeaders(){let e=new Mt;return e=e.append("Content-Type","empty"),e=e.append("Accept","*/*"),e=e.append("Response-Type","text/csv"),e}ngOnDestroy(){this._users.complete()}filterUsersWhichAreNotInGroup(e,t,n,r){let a=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any/thumbnail?sortField=surname&sortDir=asc`;n!=null&&r!=null&&(a+=`&pageSize=${r}&pageNumber=${n}`);let l={isNotAMemberOfGroup:e};return t!=null&&(l.name=t),this._httpClient.post(a,l,{observe:"response"}).pipe(S(m=>ne.isAccepted(m.status)?m.body:null),k(()=>M(null)))}filterUsersWhichAreNotAssignedToLocation(e,t,n,r){let a=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any?sortField=surname&sortDir=asc`;n!=null&&r!=null&&(a+=`&pageSize=${r}&pageNumber=${n}`);let l={isNotAssignedToLocation:e};return t!=null&&(l.name=t),this._httpClient.post(a,l,{observe:"response"}).pipe(S(m=>ne.isAccepted(m.status)?m.body:null),k(()=>M(null)))}getAllUsers(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any/thumbnail`,n={includePaperbin:e};return this._httpClient.post(t,n,{observe:"response"}).pipe(S(r=>ne.isAccepted(r.status)?r.body:null),k(()=>M(null)))}getUsersByIdsBulk(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/ids/thumbnail`,n=e;return this._httpClient.post(t,n,{observe:"response"}).pipe(S(r=>ne.isAccepted(r.status)?r.body:null),k(()=>M(null)))}filterFullUsers(e,t,n){let r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any?sortField=surname&sortDir=asc`;t!=null&&n!=null&&(r+=`&pageSize=${n}&pageNumber=${t}`);let a={name:e};return this._httpClient.post(r,a,{observe:"response"}).pipe(S(l=>ne.isAccepted(l.status)?l.body:null),k(()=>M(null)))}getUsers(){return this._users}
15getUserChipInputs(e){if(!e.length)return M([]);let t=e.map(n=>this.getUserChipInput(n).pipe(k(()=>M(null))));return et(t).pipe(S(n=>n.filter(r=>r!==null)))}getUserChipInput(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/${e}`;return this._httpClient.get(t).pipe(S(n=>({id:n.id,title:`${n.surname}, ${n.forename} (${n.username})`})))}getUser(e){return this._httpClient.get(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/${e}`)}getUserDetail(e){return this._httpClient.get(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/detail/${e}`)}getUsersByIds(e){let t=e.map(n=>this.getUser(n));return et(t)}getUsersVM(e){return(e??this.getUsers()).pipe(dn(n=>n.length>0?et(n.map(r=>this.mergeUserVM(r))):M([])))}isUsernameAvailable(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/username-availability`;return this._httpClient.post(t,{username:e},{observe:"response",headers:new Mt({Accept:"*/*"})}).pipe(k(n=>M(n)),S(n=>n.status!==Gt.CONFLICT),ia())}getUserByUsername(e){return this._httpClient.post(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/username/`,{username:e},{observe:"response"}).pipe(S(t=>ne.isAccepted(t.status)?t.body:null),k(()=>M(null)))}getUserRoles(e){return this._httpClient.get(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/${e}/roles`)}getUserCostCenters(e){return this._httpClient.get(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/${e}/costcenters`)}getUserLockInfo(e){let t=e?.lock?.idOfExecutingUser;return t&&t!==Pe?this.getUser(t):M(null)}reSendInvitationMessage(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/invitations/batch`;return this._httpClient.post(t,e)}createUserInvitation(e){let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/useraccounts/invitations",n=yi.toUserAccountRequest(e);return this._httpClient.post(t,n,{observe:"response"}).pipe(We(r=>r.ok),S(r=>(e.id=r.body.id,e)))}createUser(e){let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/useraccounts",n=yi.toUserAccountRequest(e);return this._httpClient.post(t,n,{observe:"response"}).pipe(We(r=>r.ok),S(r=>(e.id=r.body.id,e)),Pt(200))}updateUser(e){let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/useraccounts/"+e.id,n=yi.toUserChangeRequest(e);return this._httpClient.put(t,n,{observe:"response"}).pipe(We(r=>r.ok),Lt(()=>et([M(e)])),S(()=>e),V(()=>{let r=[e._user];this._users.next(r)}))}updateSupportAccess(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/${e}/support`,r={isSupportAllowed:t};return this._httpClient.put(n,r,{observe:"response"}).pipe(S(a=>ne.isAccepted(a.status)),k(()=>M(null)))}getSupportAccess(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/supportstatus/${e}`;return this._httpClient.get(t)}deleteUsers(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/delete`;return this._httpClient.post(t,e,{observe:"response"}).pipe(S(n=>ne.isAccepted(n.status)),k(()=>M(!1)))}lockUsers(e){if(e.length>0){let t=e.map(n=>this._httpClient.post(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/${n.userAccountId}/lock`,n,{observe:"response"}).pipe(S(r=>r.status===ge.NO_CONTENT)));return qt(...t).pipe(Pt(200))}else return M(!0)}unlockUser(e){let t=this._configService.baseConfig.baseUrl+this._configService.baseConfig.extension+"/useraccounts/"+e+"/lock";return new He(n=>{this._httpClient.delete(t,{observe:"response"}).subscribe({next:r=>{ne.isAccepted(r.status)?n.next(!0):n.next(!1),n.complete()},error:r=>{n.error(r)}})})}resetFilter(e=!0){this._filter.licenseTitle="",this._filter.costCenter="",this._filter.status=!0,this._filter.trunk="",this._filter.username="",this._filter.roleName=null,this._filter.isNotAMemberOfGroup=null,this._filter.location="",this._filter.isUserActive=null,e&&(this._userSubscription&&this._userSubscription.unsubscribe(),this._userSubscription=this.requestUsers().subscribe(t=>{this._users.next(t)}))}setFilter(e){this._filter=e}changeSort(e,t){this._sortField=e,this._sortDir=t}addRolesToUsers(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/roles`,r={roles:t.map(a=>({roleId:a})),userAccounts:e.map(a=>({userAccountId:a}))};return this._httpClient.post(n,r,{observe:"response"}).pipe(S(a=>ne.isAccepted(a.status)),k(()=>M(!1)))}removeRolesFromUsers(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/roles/unlinked`,r={roles:t.map(a=>({roleId:a})),userAccounts:e.map(a=>({userAccountId:a}))};return this._httpClient.post(n,r,{observe:"response"}).pipe(S(a=>ne.isAccepted(a.status)),k(()=>M(!1)))}requestUsersCount(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any/count`;return this._httpClient.post(e,this._filter).pipe(S(t=>t.count))}requestUsers(e,t,n){let r=this._authService.userInfo.roles;if(!this.hasUserInfoPermssion(r))return M(null);let{page:a,perPage:l}=this.getValidPagination(e,t,n),m=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any?pageNumber=${a}&pageSize=${l}`;return this._sortField&&this._sortDir&&(m=ai.setSearchUrlSort(m,this._sortField,this._sortDir)),this._httpClient.post(m,this._filter)}requestAvailableOrderManagers(){let e=this._authService.userInfo.roles;if(!this.hasUserInfoPermssion(e))return M(null);let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any/ordermanagers`;return this._httpClient.get(t)}requestOrderManagersForGroup(e){let t=this._authService.userInfo.roles;if(!this.hasUserInfoPermssion(t))return M(null);let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any/ordermanagers/${e}`;return this._httpClient.get(n)}requestUsersForList(e,t,n){let r=this._authService.userInfo.roles;if(!this.hasUserInfoPermssion(r))return M(null);let{page:a,perPage:l}=this.getValidPagination(e,t,n),m=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/any/list?pageNumber=${a}&pageSize=${l}`;return this._sortField&&this._sortDir&&(m=ai.setSearchUrlSort(m,this._sortField,this._sortDir)),this._httpClient.post(m,this._filter)}
15requestCsvExport(){let t={headers:i.getHeaders(),responseType:"text"},n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/csv/export`;return this._httpClient.get(n,t)}uploadCsvFile(e){let n={headers:i.getHeaders()},r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/csv/import/`,a=e.file.name,l=new FormData;return l.append("File",e.file,a),this._httpClient.post(r,l,n).pipe(S(m=>{let b=m.templateErrors.length<1?"common.import.import_successful":"common.import.import_failed",T=m.templateErrors.length>0?Ie.FALSE:Ie.TRUE;m.numCreated+m.numUpdated<=0&&(m.notSuccessful===0?(T=Ie.TRUE,b="common.import.import_successful"):(T=Ie.FALSE,b="common.import.import_failed"));let O=m.templateErrors;return{success:T,errors:O,headline:b,numCreated:m.numCreated,numDeleted:m.numDeleted,numUpdated:m.numUpdated,notSuccessful:m.notSuccessful}}))}getCsvTemplate(){let e=this.getUrl("useraccounts/csv/template");return this._httpClient.get(e,{responseType:"text"})}setLocationForUsers(e,t){if(t.length>0){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/useraccounts/location/bulk/${e}`;return this._httpClient.put(n,t,{observe:"response"}).pipe(S(r=>r.status===ge.NO_CONTENT))}else return M(!0)}putDecentralGroup(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}
15/tenants/ordermanagement/limited`;return this._httpClient.put(t,e,{observe:"response"}).pipe(S(n=>n.body.id))}getDecentralGroup(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/tenants/ordermanagement/limited`;return this._httpClient.get(e,{observe:"response"}).pipe(S(t=>t.body))}deleteManagementGroup(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/tenants/ordermanagement/limited/${e}`;return this._httpClient.delete(t,{observe:"response"})}hasUserInfoPermssion(e){return e&&(e.includes(se.EDIT_FAVORITES)||e.includes(se.EDIT_QUERIES)||e.includes(se.USER_PANEL)||e.includes(se.VIEW_LICENSE_PANEL)||e.includes(se.VIEW_DOCUMENT_MANAGEMENT))}getUrl(e){return`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${e}`}getValidPagination(e,t,n){let r,a;return n?(r=e??this._page,a=t??9999):(r=e!=null&&e>=0?e:this._page,a=t!=null&&t>=0?t:this._perPage,this._page=r,this._perPage=a,r>0&&r--),{page:r,perPage:a}}mergeUserVM(e){return et([M(e),this.getUserLockInfo(e)]).pipe(k(t=>M(t)),S(t=>yi.toUserVM(t[0],t[0].roles,t[0].costCenters,t[1])),k(()=>M(yi.toUserVM(e))))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var nt=(()=>{class i{static{this.numericValidator=e=>{let t=e.value;return isNaN(+t)?{numeric:!0}:null}}static{this.greaterThanValidator=e=>t=>{let n=t.value;return n===""?null:+n<=e?{greaterThan:!0}:null}}static touchedRequiredValidator(){return e=>e.touched?e.value?null:{required:!0}:null}static touchedDateFormatValidator(){return e=>!e.touched||e.value===null||e.value===""||this.isDateValid(e.value,"YYYY-MM")||this.isDateValid(e.value,"YYYY-MM-DD")?null:{dateFormat:!0}}static isDateValid(e,t){let n;switch(t){case"YYYY-MM":n=si.getDateFormatRegExYearMonth();break;case"YYYY-MM-DD":n=si.getDateFormatRegExYearMonthDay();break;default:return!1}return n.test(e)}static{this.validGuidValidator=e=>{let t=e.value;return!!t&&t!==Pe?null:{invalidGuid:!0}}}static mandatoryFieldFn(){return e=>!e.touched||e.value?null:{required:!0}}static lengthLimitFn(e){return t=>{let n=t.value;return!n||n.length<e?null:{maxlength:{requiredLength:e,actualLength:n.length}}}}}return i})();var Fm=i=>({limit:i}),Mm=i=>({minVal:i});function wm(i,o){i&1&&y(0,"app-spinner")}function Om(i,o){i&1&&y(0,"app-icon",16)}function Pm(i,o){i&1&&y(0,"app-icon",17)}function Nm(i,o){i&1&&y(0,"span",19)}function km(i,o){if(i&1){let e=w();c(0,"button",26),h(1,"transloco"),h(2,"transloco"),x("click",function(n){E(e);let r=p().$index,a=p(2);return I(a.removeOrder(r,n))}),y(3,"app-icon",27),d()}i&2&&(f("ngbTooltip",C(1,2,"common.remove")),P("aria-label",C(2,4,"common.remove")))}function Rm(i,o){i&1&&(c(0,"div",23)(1,"div",28),y(2,"app-icon",29),c(3,"div",30)(4,"span",31),v(5),h(6,"transloco"),d()()()()),i&2&&(s(5),D(C(6,1,"orders.request_warning")))}function Am(i,o){i&1&&(v(0),h(1,"transloco")),i&2&&D(C(1,1,"orders.details_on_invoice_tooltip"))}function Lm(i,o){if(i&1&&(c(0,"span",32)(1,"label",34),v(2),h(3,"transloco"),d(),y(4,"app-icon",35),Y(5,Am,2,3,"ng-template",null,0,fe),d()),i&2){let e=X(6),t=p(2).$implicit,n=p(),r=n.$implicit,a=n.$index,l=p(2);s(),W("mandatory",t.mandatory||t.formControlName==="comment"&&(l.documentsWithWarning==null?null:l.documentsWithWarning.includes(r.value.acCode))),f("for",a+"_"+t.formControlName),s(),F(" ",C(3,5,t.text)," "),s(2),f("ngbTooltip",e)}}function Um(i,o){if(i&1&&(c(0,"label",34),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit,t=p(),n=t.$implicit,r=t.$index,a=p(2);W("mandatory",e.mandatory||e.formControlName==="comment"&&(a.documentsWithWarning==null?null:a.documentsWithWarning.includes(n.value.acCode))),f("for",r+"_"+e.formControlName),s(),F(" ",C(2,4,e.text)," ")}}function Bm(i,o){if(i&1&&u(0,Lm,7,7,"span",32)(1,Um,3,6,"label",33),i&2){let e=p().$implicit;_(e.formControlName==="comment"?0:1)}}function Vm(i,o){if(i&1&&(c(0,"span",37),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit;W("mandatory",e.mandatory),s(),F(" ",C(2,3,e.text)," ")}}function $m(i,o){if(i&1&&u(0,Vm,3,5,"span",36),i&2){let e=p().$implicit,t=p().$implicit;_(t.value[e.value]!==void 0?0:-1)}}function Hm(i,o){if(i&1&&y(0,"span",38),i&2){let e=p(2).$implicit,t=p().$implicit;f("innerHtml",t.value[e.value],ni)}}function Km(i,o){if(i&1&&(c(0,"span",39),v(1),d()),i&2){let e=p(2).$implicit,t=p().$implicit;s(),F(" ",t.value[e.value]," ")}}function Gm(i,o){if(i&1&&(c(0,"span",40)(1,"span"),v(2),h(3,"transloco"),h(4,"transloco"),d()()),i&2){let e=p(2).$implicit,t=p().$implicit;s(2),F(" ",t.value[e.value]?C(3,1,"common.yes"):C(4,3,"common.no")," ")}}function qm(i,o){if(i&1&&(u(0,Hm,1,1,"span",38),u(1,Km,2,1,"span",39),u(2,Gm,5,5,"span",40)),i&2){let e=p().$implicit;_(e.value==="issuing"?0:-1),s(),_(e.value==="priceMetadata"?1:-1),s(),_(e.value==="valid"?2:-1)}}function Wm(i,o){if(i&1&&(c(0,"p",42),v(1),h(2,"transloco"),d()),i&2){let e=p(4).$implicit;P("data-cy",e.formControlName+"ErrorMessage"),s(),F(" ",C(2,2,"common.please_fill_this_field")," ")}}function zm(i,o){if(i&1&&(c(0,"p",42),v(1),h(2,"transloco"),d()),i&2){let e=p(4).$implicit;P("data-cy",e.formControlName+"ErrorMessage"),s(),F(" ",de(2,2,"orders.character_limit",ie(5,Fm,o.requiredLength))," ")}}function jm(i,o){if(i&1&&(c(0,"p",42),v(1),h(2,"transloco"),d()),i&2){let e=p(4).$implicit,t=p(3);P("data-cy",e.formControlName+"ErrorMessage"),s(),F(" ",de(2,2,"orders.error_greater_than",ie(5,Mm,t.minOrderAmount-1))," ")}}function Ym(i,o){if(i&1&&(u(0,Wm,3,4,"p",42),u(1,zm,3,7,"p",42),u(2,jm,3,7,"p",42)),i&2){let e,t=p(3).$implicit,n=p().$index,r=p(2);_(!(r.formsArray.controls[n].controls[t.formControlName]==null||r.formsArray.controls[n].controls[t.formControlName].errors==null)&&r.formsArray.controls[n].controls[t.formControlName].errors.required?0:-1),s(),_((e=r.formsArray.controls[n].controls[t.formControlName]==null||r.formsArray.controls[n].controls[t.formControlName].errors==null?null:r.formsArray.controls[n].controls[t.formControlName].errors.maxlength)?1:-1,e),s(),_(!(!(r.formsArray.controls[n].controls[t.formControlName]==null||r.formsArray.controls[n].controls[t.formControlName].errors==null)&&r.formsArray.controls[n].controls[t.formControlName].errors.required)&&(!(r.formsArray.controls[n].controls[t.formControlName]==null||r.formsArray.controls[n].controls[t.formControlName].errors==null)&&r.formsArray.controls[n].controls[t.formControlName].errors.greaterThan)?2:-1)}}function Qm(i,o){if(i&1&&(c(0,"div"),y(1,"input",41),u(2,Ym,3,3),d()),i&2){let e=p(2).$implicit,t=p().$index,n=p(2);s(),W("invalid",!n.orderRequestForm.valid&&!(n.formsArray.controls[t].controls[e.formControlName]!=null&&n.formsArray.controls[t].controls[e.formControlName].valid)),f("type",kt(e.formControlName==="number"?"number":"text"))("id",t+"_"+e.formControlName)("formControlName",e.formControlName),P("inputmode",e.formControlName==="number"?"numeric":"text")("data-cy",e.formControlName),s(),_(!n.orderRequestForm.valid&&!(n.formsArray.controls[t].controls[e.formControlName]!=null&&n.formsArray.controls[t].controls[e.formControlName].valid)?2:-1)}}function Zm(i,o){if(i&1&&y(0,"app-select",43),i&2){let e=p(4).$implicit,t=p().$index,n=p(2);f("id",t+"_"+e.formControlName)("items",n.documentFormat)("formControlName",e.formControlName)("manualValidation",!0),P("data-cy",e.formControlName)}}function Jm(i,o){if(i&1&&y(0,"app-select",43),i&2){let e=p(4).$implicit,t=p().$index,n=p(2);f("id",t+"_"+e.formControlName)("items",n.availableLanguages)("formControlName",e.formControlName)("manualValidation",!0),P("data-cy",e.formControlName)}}function Xm(i,o){if(i&1&&(y(0,"app-select",43),h(1,"async")),i&2){let e=p(4).$implicit,t=p(3);f("id",e.formControlName)("items",C(1,5,t.requestTypes$))("formControlName",e.formControlName)("manualValidation",!0),P("data-cy",e.formControlName)}}function eu(i,o){if(i&1&&(u(0,Zm,1,5,"app-select",43),u(1,Jm,1,5,"app-select",43),u(2,Xm,2,7,"app-select",43)),i&2){let e=p(3).$implicit;_(e.dataSrc==="documentFormat"?0:-1),s(),_(e.dataSrc==="availableLanguages"?1:-1),s(),_(e.dataSrc==="requestTypes"?2:-1)}}function tu(i,o){if(i&1&&(c(0,"div"),u(1,eu,3,3),d()),i&2){let e=p(2).$implicit;s(),_(e.formControlName?1:-1)}}function iu(i,o){if(i&1&&(c(0,"p",42),v(1),h(2,"transloco"),d()),i&2){let e=p(3).$implicit;P("data-cy",e.formControlName+"ErrorMessage"),s(),F(" ",C(2,2,"common.please_fill_this_field")," ")}}function nu(i,o){if(i&1&&(c(0,"div"),y(1,"textarea",44),u(2,iu,3,4,"p",42),d()),i&2){let e=p(2).$implicit,t=p().$index,n=p(2);s(),W("invalid",!(n.formsArray.controls[t].controls[e.formControlName]!=null&&n.formsArray.controls[t].controls[e.formControlName].valid)),f("id",t+"_"+e.formControlName)("formControlName",e.formControlName),P("data-cy",e.formControlName),s(),_(n.formsArray.controls[t].controls[e.formControlName]!=null&&n.formsArray.controls[t].controls[e.formControlName].valid?-1:2)}}function ou(i,o){if(i&1&&u(0,Qm,3,9,"div")(1,tu,2,1,"div")(2,nu,3,6,"div"),i&2){let e,t=p().$implicit;_((e=t.component)==="input"?0:e==="dropdown"?1:e==="textarea"?2:-1)}}function ru(i,o){if(i&1&&(c(0,"div"),u(1,Bm,2,1)(2,$m,1,1),u(3,qm,3,3),u(4,ou,3,1),d()),i&2){let e=o.$implicit,t=p().$implicit;W("content-row",e.value===null)("one-line-text",e.value!==null)("metadata-row",e.value!==null),s(),_(e.component?1:2),s(2),_(t.value[e.value]!==void 0?3:-1),s(),_(t.value[e.value]?-1:4)}}function au(i,o){i&1&&(c(0,"div",46),y(1,"app-icon",47),v(2),h(3,"transloco"),d()),i&2&&(s(2),F(" ",C(3,1,"orders.applied_data_to_all_orders")," "))}function su(i,o){if(i&1){let e=w();c(0,"div",25)(1,"button",45),x("click",function(){E(e);let n=p().$index,r=p(2);return I(r.applyToAllOrders(n))}),v(2),h(3,"transloco"),d(),u(4,au,4,3,"div",46),d()}if(i&2){let e=p().$index,t=p(2);s(2),F(" ",C(3,2,"orders.apply_data_to_all_orders")," "),s(2),_(t.appliedFromIndex===e?4:-1)}}function lu(i,o){if(i&1){let e=w();c(0,"div",9)(1,"div",10)(2,"button",11),x("click",function(){let n=E(e).$index,r=p(2);return I(r.toggleCollapsible(n))}),y(3,"app-icon",12),c(4,"span",13)(5,"p")(6,"span",14),v(7),h(8,"truncate"),d(),c(9,"span",15),v(10),d(),u(11,Om,1,0,"app-icon",16),u(12,Pm,1,0,"app-icon",17),d(),c(13,"span",18),v(14),h(15,"truncate"),d()(),u(16,Nm,1,0,"span",19),d(),u(17,km,4,6,"button",20),d(),Ue(18,21),c(19,"div",22),u(20,Rm,7,3,"div",23),G(21,ru,5,9,"div",24,J),u(23,su,5,4,"div",25),d(),Be(),d()}if(i&2){let e=o.$implicit,t=o.$index,n=p(2);s(3),f("direction",e.value.collapsed?"right":"down"),s(4),F(" ",de(8,15,e.value.documentNumber,100),"\xA0 "),s(3),F("(",e.value==null?null:e.value.dateOfIssue,")"),s(),_(e.value.isCompanyData?11:-1),s(),_(e.value.isDraft?12:-1),s(),f("title",e==null||e.value==null?null:e.value.title),s(),F(" ",C(15,18,e==null||e.value==null?null:e.value.title)," "),s(2),_(n.documentsWithWarning!=null&&n.documentsWithWarning.includes(e.value.acCode)?16:-1),s(),_(n.formsArray.length>1?17:-1),s(2),W("edit",n.editOrder),f("@collapseAnimation",e.value.collapsed?"collapsed":"expanded")("formGroupName",t),s(),_(n.documentsWithWarning!=null&&n.documentsWithWarning.includes(e.value.acCode)?20:-1),s(),q(n.formFieldConfig),s(2),_(n.formsArray.controls.length>1?23:-1)}}function cu(i,o){if(i&1&&(c(0,"div",3),G(1,lu,24,20,"div",9,J),d()),i&2){let e=p();f("formGroup",e.orderRequestForm),s(),q(e.formsArray.controls)}}function du(i,o){i&1&&(c(0,"button",6),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"orders.add_to_shopping_cart")," "))}function pu(i,o){i&1&&(c(0,"button",7),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"orders.request.order_directly")," "))}function mu(i,o){i&1&&(c(0,"button",8),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.save")," "))}var Cl=(()=>{class i{constructor(){this.modalService=g(he),this._authService=g(ue),this._documentService=g(ei),this._formBuilder=g(dt),this._orderManagementService=g(Yn),this._tenantStateService=g(gi),this._translocoService=g(ae),this._userService=g(xo),this.documentsWithWarning=[],this.minOrderAmount=1,this.permissions=se,this._editOrder=!1,this._isComponentActive=!0,this._defaultTypeOfRequestValue="single_purchase",this._orderStates=at,this.modalTitle="orders.request.title",this.removeItem=new R,this.formFieldConfig=[{text:"common.metadata_label.valid",value:"valid",component:null},{text:"common.metadata_label.issuing",value:"issuing",component:null},{text:"common.metadata_label.priceUndetermNote",value:"priceMetadata",component:null},{text:"common.count_number",value:null,component:"input",formControlName:"number",mandatory:!0},{text:"common.language",value:null,component:"dropdown",formControlName:"language",dataSrc:"availableLanguages",mandatory:!0},{text:"orders.request.type_of_request",value:null,component:"dropdown",formControlName:"typeOfRequest",dataSrc:"requestTypes",mandatory:!0},{text:"orders.request.format",value:null,component:"dropdown",formControlName:"format",dataSrc:"documentFormat",mandatory:!0},{text:"orders.request.order_number",value:null,component:"input",formControlName:"orderNumber",mandatory:!1},{text:"orders.request.buyer_reference",value:null,component:"input",formControlName:"buyerReference",mandatory:!1},{text:"user_management.cost_center",value:null,component:"input",formControlName:"costCentre",mandatory:!1},{text:"orders.details_on_invoice",value:null,component:"textarea",formControlName:"comment"}],this.documentFormat=ti.getDocumentFormats(),this.availableLanguages=ti.getAvailableLanguages()}set orders(e){this._orders=e}get orders(){return this._orders}set loading(e){this._loading=e,!this._loading&&this._userInfo&&this.buildForm()}get loading(){return this._loading}set userInfo(e){this._userInfo=e,!this._loading&&this._userInfo&&this.buildForm()}get userInfo(){return this._userInfo}set editOrder(e){this._editOrder=e,this.editOrder&&this.buildEditOrderForm()}get editOrder(){return this._editOrder}get formsArray(){return this.orderRequestForm?.get("orders")}ngOnDestroy(){this._isComponentActive=!1}get isEditOrder(){return this.editOrder}get isNewOrder(){return!this.editOrder}ngOnInit(){let e=this._authService.userInfo;this.orderRequestForm||(this.orderRequestForm=this._formBuilder.group({orders:[]})),this.isEditOrder||(this.orderRequestForm=this._formBuilder.group({orders:[]}),this._userService.getUser(e.userAccountId).subscribe({next:t=>{this.userInfo=t}})),this.requestTypes$=this.requestTypes$=this._tenantStateService.tenant$.pipe(S(t=>ti.getDocumentTypes(t,this._translocoService)))}onSubmit(e){switch(e.submitter.getAttribute("name")){case"shoppingcart":this.createOrder(this.formsArray.controls,"shoppingcart");break;case"orderNow":this.createOrder(this.formsArray.controls,"orderNow");break;case"update":this.updateOrders();break}}toggleCollapsible(e){let t=this.formsArray.at(e);t.patchValue({collapsed:!t.value.collapsed},{emitEvent:!1})}applyToAllOrders(e){this.appliedFromIndex=e;let t=this.formsArray.at(e).value,{comment:n,costCentre:r,format:a,language:l,orderNumber:m,typeOfRequest:b,number:T,buyerReference:O}=t,U=this.formsArray.getRawValue().map(H=>ve(K({},H),{comment:n,costCentre:r,format:a,language:l,orderNumber:m,typeOfRequest:b,number:T,buyerReference:O}));this.formsArray.patchValue(U,{emitEvent:!1,onlySelf:!0})}addToShoppingCart(e){let t=e.map(n=>this._orderManagementService.mapOrderRequestModelToDto(n));this._orderManagementService.createOrders(t).pipe(V(n=>{ne.isAccepted(n.status)&&this.modalService.close({success:!0,action:"addedToCart"})}),k(()=>(this.modalService.close("errorAddingToCart"),xe)),me(()=>this._isComponentActive)).subscribe()}orderNow(e){let t=re.cloneDeep(e);t.forEach(r=>{r.status=this._orderStates.requested});let n=t.map(r=>this._orderManagementService.mapOrderRequestModelToDto(r));this._orderManagementService.createOrders(n).pipe(V(r=>
15{r.status===ge.OK&&this.modalService.close({success:!0,action:"ordered"})}),k(()=>(this.modalService.close("errorRequestingOrder"),xe))).subscribe()}removeOrder(e,t){t.stopPropagation(),this.editOrder||this.removeItem.emit(e),this.formsArray.removeAt(e),this.formsArray.at(0).value.collapsed&&this.toggleCollapsible(0)}createOrder(e,t){if(this.orderRequestForm.markAllAsTouched(),e.forEach(n=>{this.documentsWithWarning.includes(n.value.acCode)&&n.controls.comment.updateValueAndValidity(),n.controls.orderNumber.updateValueAndValidity(),n.controls.costCentre.updateValueAndValidity()}),this.orderRequestForm.valid){let n=e.map(r=>({acCode:r.value.acCode,dateOfIssue:r.value.dateOfIssue,language:r.value.language,documentType:r.value.documentType,countryCode:r.value.countryCode,comment:r.value.comment,orderNumber:r.value.orderNumber,buyerReference:r.value.buyerReference,costCentre:r.value.costCentre,typeOfRequest:r.value.typeOfRequest,format:r.value.format,editor:"",priceMetadata:r.value.priceMetadata,priceWebShop:r.value.priceWebShop,number:+r.value.number,valid:r.value.valid,status:t==="orderNow"?at.ordered:at.shoppingCart,subscriptionNumber:r.value.subscriptionNumber,documentNumber:r.value.documentNumber}));t==="orderNow"&&this.orderNow(n),t==="shoppingcart"&&this.addToShoppingCart(n)}}updateOrders(){if(this.orderRequestForm.valid){this.formsArray.controls.forEach(t=>{t.value.shoppingCartDate=new Date,t.value.number=+t.value.number});let e=this.formsArray.controls.map(t=>t.value);this._orderManagementService.updateOrders(e).pipe(k(()=>(this.modalService.close("errorUpdatingOrder"),xe))).subscribe(t=>{t.status===ge.OK&&this.modalService.close({success:!0,action:"updatedOrder"})})}}buildForm(){this.checkOrderWarnings();let e=this._formBuilder.array([]);this.documentsWithDetails.forEach((t,n)=>{let a=(t.documentDetails.originalLanguage?t.documentDetails.originalLanguage.split(","):[]).length>1?this.availableLanguages[3].value:this.availableLanguages[0].value;e.push(this._formBuilder.group({acCode:t.document.acCode,documentNumber:t.documentDetails.documentNumber,documentId:[t.documentDetails.id,Ve.required],dateOfIssue:[t.documentDetails.dateOfIssue,Ve.required],language:[a,Ve.required],documentType:t.documentDetails.documentType.toString(),isDraft:t.documentDetails.isDraft,isCompanyData:t.document.acCode.startsWith("CS"),requestDepartment:"",requestDate:null,comment:["",[this.isRequiredCommentFn(t.document.acCode)]],orderNumber:[null,[nt.lengthLimitFn(35)]],buyerReference:[null,[nt.lengthLimitFn(30)]],costCentre:[Array.isArray(this._userInfo.costCenters)&&this._userInfo.costCenters.length>0?this._userInfo.costCenters.join(", "):null,[nt.lengthLimitFn(30)]],typeOfRequest:[this._defaultTypeOfRequestValue,Ve.required],format:[this.documentFormat[0].value,Ve.required],editor:"",issuing:Array.isArray(t.documentDetails.issuing)?t.documentDetails.issuing.join(", "):t.documentDetails.issuing,priceMetadata:t.documentDetails.priceUndetermNote?t.documentDetails.priceUndetermNote:"",priceWebShop:t.documentDetails.priceUndetermNote?t.documentDetails.priceUndetermNote:"",number:[1,[Ve.required,nt.greaterThanValidator(this.minOrderAmount-1),nt.numericValidator]],title:t.documentDetails.titleDe||t.documentDetails.titleEn||t.documentDetails.titleFr,valid:[t.documentDetails.valid,Ve.required],referenceSource:"",collapsed:n!==0,countryCode:t.documentDetails.countryCode}))}),this.orderRequestForm=this._formBuilder.group({orders:e}),this.listenToFormChanges()}buildEditOrderForm(){let e=this._formBuilder.array([]);this.orders.forEach((t,n)=>{e.push(this._formBuilder.group({id:t.id,tenantId:t.tenantId,deliveryMethods:t.deliveryMethods||"",acCode:t.acCode,documentNumber:t.documentNumber||"",countryCode:t.countryCode||"",dateOfIssue:t.dateOfIssue,isDraft:t.isDraft,isCompanyData:t.acCode.startsWith("CS"),language:[t.language,[Ve.required]],documentType:t.documentType.toString(),requestDepartment:t.requestDepartment||"",comment:t.comment,issuing:(Array.isArray(t.issuingBody)?t.issuingBody.join(", "):t.issuingBody)??"",orderNumber:[t.orderNumber,[nt.lengthLimitFn(35)]],buyerReference:[t.buyerReference,[nt.lengthLimitFn(30)]],costCentre:[t.costCentre,[nt.lengthLimitFn(30)]],typeOfRequest:[t.typeOfRequest,Ve.required],shoppingCartFrom:t.shoppingCartFrom||Pe,shoppingCartDate:t.shoppingCartDate,format:[t.format,[Ve.required]],editor:t.editor,priceMetadata:t.priceMetadata,priceWebShop:t.priceWebShop,declinedFrom:t.declinedFrom||Pe,declinedDate:t.declinedDate,declinedReason:t.declinedReason,deliveredFrom:t.deliveredFrom||Pe,deliveredDate:t.deliveredDate,orderedFrom:t.orderedFrom||Pe,orderedDate:t.orderedDate,requestFrom:t.requestFrom||Pe,requestDate:t.requestDate,releasedFrom:t.releasedFrom||Pe,releasedDate:t.releasedDate,number:[t.number,[Ve.required,nt.greaterThanValidator(this.minOrderAmount-1),nt.numericValidator]],title:t.titleDe??t.titleEn??t.titleFr??"",valid:t.valid,referenceSource:t.referenceSource||"",status:t.status,collapsed:n!==0}))}),this.orderRequestForm=this._formBuilder.group({orders:e}),this.listenToFormChanges()}listenToFormChanges(){this.formsArray.valueChanges.pipe(_t(),me(()=>this._isComponentActive)).subscribe({next:()=>{this.appliedFromIndex=void 0}})}checkOrderWarnings(){let e=this.documentsWithDetails.map(t=>t.document.acCode);this._documentService.documentListCollection$.subscribe(t=>{t.forEach(n=>{e.includes(n.acCode)&&this.documentsWithWarning.push(n.acCode)})}),this._orderManagementService.checkOrderExists(e).subscribe(t=>{Object.entries(t).forEach(([n,r])=>{r&&this.documentsWithWarning.push(n)})})}isRequiredCommentFn(e){return t=>!t.touched||t.value?null:this.documentsWithWarning.includes(e)?{required:!0}:null}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-request-order-modal"]],hostVars:4,hostBindings:function(t,n){t&2&&W("edit-order",n.isEditOrder)("new-order",n.isNewOrder)},inputs:{modalTitle:"modalTitle",documentsWithDetails:"documentsWithDetails",orders:"orders",loading:"loading",editOrder:"editOrder"},outputs:{removeItem:"removeItem"},decls:12,vars:13,consts:[["tip",""],[3,"modalTitle","border"],[3,"ngSubmit","focusInvalidInput"],[1,"modal-body","scroll-box",3,"formGroup"],["buttonType","custom"],["type","button","data-cy","cancel",1,"btn-primary-outline",3,"click"],["type","submit","name","shoppingcart","data-cy","addToShoppingCart",1,"btn-primary"],["type","submit","name","orderNow","data-cy","addRequest",1,"btn-primary"],["type","submit","name","update","data-cy","save",1,"btn-primary"],[1,"collapsible"],[1,"collapsible-header"],["type","button","data-cy","toggleOrder",1,"btn-collapse-small",3,"click"],["name","chevron",3,"direction"],[1,"metadata"],["data-cy","documentNumber",1,"label-bold"],["data-cy","dateOfIssue"],["name","company-data","data-cy","iconCompanyData"],["name","metadata-draft","data-cy","iconDraft"],["data-cy","title",1,"one-line-text",3,"title"],["data-cy","iconWarning",1,"icon-warning"],["type","button",1,"btn-icon-remove",3,"ngbTooltip"],["formArrayName","orders"],["data-cy","orderDetails",1,"collapsible-content",3,"formGroupName"],["data-cy","warningBox",1,"box-warning"],[3,"content-row","one-line-text","metadata-row"],[1,"apply-all-container"],["type","button",1,"btn-icon-remove",3,"click","ngbTooltip"],["name","cross","data-cy","unlinkOrder"],[1,"box-content"],["name","alert","data-cy","iconWarning",1,"icon-warning"],[1,"description"],["data-cy","warningText"],[1,"label-with-icon"],[3,"for","mandatory"],[3,"for"],["placement","top","name","info",1,"icon-cl
15ickable",3,"ngbTooltip"],[1,"metadata-label",3,"mandatory"],[1,"metadata-label"],["data-cy","issuing",1,"metadata-value",3,"innerHtml"],["data-cy","priceUndetermNote",1,"metadata-value"],["data-cy","valid",1,"metadata-value"],[3,"id","type","formControlName"],[1,"text-alert"],[3,"id","items","formControlName","manualValidation"],[3,"id","formControlName"],["type","button","data-cy","applyDataToAllOrders",1,"btn-primary-outline",3,"click"],["data-cy","successMessage",1,"text-success"],["name","check-mark"]],template:function(t,n){t&1&&(u(0,wm,1,0,"app-spinner"),y(1,"app-modal-header",1),c(2,"form",2),x("ngSubmit",function(a){return n.onSubmit(a)}),u(3,cu,3,1,"div",3),c(4,"app-modal-footer",4)(5,"button",5),x("click",function(){return n.modalService.dismiss()}),v(6),h(7,"transloco"),d(),u(8,du,3,3,"button",6),u(9,pu,3,3,"button",7),h(10,"hasPermissions"),u(11,mu,3,3,"button",8),d()()),t&2&&(_(n.loading?0:-1),s(),f("modalTitle",n.modalTitle)("border",!0),s(),f("focusInvalidInput",!0),s(),_(n.loading?-1:3),s(3),F(" ",C(7,9,"common.cancel")," "),s(2),_(n.editOrder?-1:8),s(),_(C(10,11,n.permissions.REQUEST_ORDER)&&!n.editOrder?9:-1),s(2),_(n.editOrder?11:-1))},dependencies:[Oe,sn,j,Me,we,_e,Ne,Ye,it,Te,ye,Ee,De,Qi,Wa,Qe,Yi,ui,z,xt,ct,qs,$,fo],styles:[".modal-body[_ngcontent-%COMP%]{gap:0}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;background-color:var(--color-gray-light)}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-header[_ngcontent-%COMP%] .btn-icon-remove[_ngcontent-%COMP%]{border-radius:0;height:2.75rem;width:2.75rem}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-header[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%]{font-family:var(--font-family-regular);text-align:left;max-width:32rem;min-width:32rem}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-header[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%] .one-line-text[_ngcontent-%COMP%]{font-size:var(--font-size-small)}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-header[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{display:flex;align-items:center;gap:calc(var(--spacer) / 4)}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-header[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{height:1rem;display:inline-flex;align-items:center}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-header[_ngcontent-%COMP%]:not(:last-child){margin-bottom:calc(var(--spacer) / 4)}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-inline:calc(var(--spacer) * 2.5);overflow:hidden}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .metadata-row[_ngcontent-%COMP%]{display:flex;font-size:var(--font-size-small)}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .metadata-row[_ngcontent-%COMP%] .metadata-label[_ngcontent-%COMP%]{color:var(--color-primary-dark);flex:1}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .metadata-row[_ngcontent-%COMP%] .metadata-value[_ngcontent-%COMP%]{flex:4}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%]{display:flex;margin-top:var(--spacer)}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{align-items:center;display:flex;flex:1}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] > .label-with-icon[_ngcontent-%COMP%]{flex:1;display:inline-flex;align-items:center;gap:.5rem;min-width:0}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:2}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .apply-all-container[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;justify-content:center;margin-block:var(--spacer)}.modal-body[_ngcontent-%COMP%] .collapsible[_ngcontent-%COMP%] .collapsible-content[_ngcontent-%COMP%] .apply-all-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{align-items:center;display:flex;width:fit-content}.scroll-box[_ngcontent-%COMP%]{height:75vh;overflow-x:hidden}textarea[_ngcontent-%COMP%] + p.text-alert[_ngcontent-%COMP%]{margin-top:-.5em}"],data:{animation:[Ya]}})}}return i})();var So=(()=>{class i{constructor(){this._httpClient=g(Fe),this._configService=g(Se),this._cancelUpload=!1,this._uploadProgress=new be,this.uploadProgress$=this._uploadProgress.asObservable()}uploadControlFile(e){this._cancelUpload=!1,this._uploadProgress.next(void 0);let t=new FormData;return t.append("file",e.file),t.append("basePath",e.basePath),t.append("fileType",e.fileType.toString()),this.uploadRequest(t,e.file.name).pipe(me(()=>!this._cancelUpload))}getCsvTemplate(){let e=this.getUrl("files/template");return this._httpClient.get(e,{responseType:"text"})}uploadCsvFile(e){let n={headers:i.getHeaders()},r=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}
15/files/template`,a=e.file.name,l=new FormData;return l.append("File",e.file,a),l.append("encoding",e.encoding),l.append("escapeChar",e.escapeChar),l.append("fieldSeparator",e.fieldSeparator),l.append("textQualifier",e.textQualifier),this._httpClient.post(r,l,n).pipe(S(m=>{let b=m.templateErrors.length>0?Ie.FALSE:Ie.TRUE;m.templateErrors.length>0&&m.numCreated+m.numUpdated+m.numDeleted>0&&(b=Ie.PARTIALLY);let T="";switch(b){case Ie.FALSE:T="common.import.import_failed";break;case Ie.TRUE:T="common.import.import_successful";break;case Ie.PARTIALLY:T="common.import.import_partially_successful";break}let O=m.templateErrors;return{success:b,errors:O.map(H=>({errorCode:H.errorCode,fieldName:H.fieldName,lineNumber:H.lineNumber,errorCodeLabel:H.errorCodeLabel})),headline:T,numCreated:m.numCreated,numDeleted:m.numDeleted,numUpdated:m.numUpdated,notSuccessful:m.notSuccessful}}),k(m=>M({errorCode:m.status})))}getUrl(e){return`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${e}`}static getHeaders(){let e=new Mt;return e=e.append("Content-Type","empty"),e=e.append("Accept","*/*"),e=e.append("Response-Type","text/csv"),e}uploadRequest(e,t){let n=i.getHeaders(),r={fileName:t,loaded:null,percent:0,total:null},a=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/files/control`;return this._httpClient.put(a,e,{reportProgress:!0,observe:"events",headers:n,responseType:"json"}).pipe(S(l=>{switch(l.type){case Gi.UploadProgress:{let{loaded:m,total:b}=l;return r.total=(b/Math.pow(1024,2)).toFixed(1),r.loaded=(m/Math.pow(1024,2)).toFixed(1),r.percent=Math.round(m*100/b),this._uploadProgress.next(r),null}case Gi.Response:return this._uploadProgress.next(r),l.body;default:return null}}),k(l=>{throw new Error(l)}))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ki=(function(i){return i.EMPTY="Empty",i.WRONG_HEADERS="WrongHeaders",i.NOT_FOUND="NotFound",i.INVALID="Invalid",i.EXCEEDS_SEARCH_RESULTS_THRESHOLD="ExceedsSearchResultsThreshold",i})(ki||{});var To=(()=>{class i{constructor(){this._configService=g(Se),this._httpClient=g(Fe)}cloneLicense(e,t){let n=this.getUrl("licenses/clone"),r={licenseToCloneId:e,title:t};return this._httpClient.post(n,r,{observe:"response"})}addDocumentsToLicense(e){let t=this.getUrl("licenses/documents");return this._httpClient.put(t,e,{observe:"response"}).pipe(S(n=>n.status===ge.NO_CONTENT),k(()=>M(null)))}addGroupMembersToLicenses(e,t){let n=this.getUrl("licenses/members"),r={licenseIds:t,groupIds:e,userIds:void 0};return this._httpClient.post(n,r,{observe:"response"}).pipe(S(function(a){return ne.isAccepted(a.status)}),k(()=>M(null)))}addUserMembersToLicenses(e,t){let n=this.getUrl("licenses/members"),r={licenseIds:t,userIds:e,groupIds:void 0};return this._httpClient.post(n,r,{observe:"response"}).pipe(S(function(a){return ne.isAccepted(a.status)}),k(()=>M(null)))}unlinkGroupMembersFromLicenses(e,t){let n=this.getUrl("licenses/members/unlinked"),r={licenseIds:t,groupIds:e,userIds:void 0};return this._httpClient.post(n,r,{observe:"response"}).pipe(S(function(a){return a.status===ge.NO_CONTENT}),k(()=>M(null)))}unlinkUserMembersFromLicenses(e,t){let n=this.getUrl("licenses/members/unlinked"),r={licenseIds:t,userIds:e,groupIds:void 0};return this._httpClient.post(n,r,{observe:"response"}).pipe(S(function(a){return a.status===ge.NO_CONTENT}),k(()=>M(null)))}createLicense(e){let t=this.getUrl("licenses"),n=i.convertLicenseDetailModelToCreateLicenseRequestDto(e);return this._httpClient.post(t,n)}getLicensesPagedAndFiltered(e,t,n,r,a,l,m,b){--e;let T=this.getUrl(`licenses/filter?pageNumber=${e}&pageSize=${t}&sortField=${n}&sortDir=${r}`),O={trunk:a,title:l,groupIds:m,userId:b};return this._httpClient.post(T,O,{observe:"response"}).pipe(S(function(U){return ne.isAccepted(U.status)?U.body:null}),k(()=>M(null)))}getLicensesByType(e){let t=this.getUrl("licenses/outline"),n=new Ti().set("licenseType",e);return this._httpClient.get(t,{params:n})}getLicenseAutoComplete(e){let t=this.getUrl("documentaccess/license");return this._httpClient.post(t,{licenseName:e},{observe:"response"}).pipe(S(n=>n.body.licenseNames.map(a=>({text:a,value:a}))),k(()=>M([])))}getCsvTemplate(){let e=this.getUrl("licenses/csv/template/documents");return this._httpClient.get(e,{responseType:"text"})}getCsvTemplateLicenseSettings(){let e=this.getUrl("licenses/csv/template/settings");return this._httpClient.get(e,{responseType:"text"})}deleteLicense(e){let t=this.getUrl("licenses/paperbin");return this._httpClient.post(t,e,{observe:"response"}).pipe(S(function(n){return ne.isAccepted(n.status)}),k(()=>M(null)))}removeDocumentsFromLicenses(e){let t=this.getUrl("licenses/remove-documents"),n={din21Ids:e};return this._httpClient.post(t,n,{observe:"response"}).pipe(S(function(r){return r.status>=ge.OK&&r.status<=ge.NO_CONTENT}),k(()=>M(null)))}uploadCsvFile(e){let n={headers:i.getHeaders()}
15,r=this.getUrl("licenses/csv/import"),a=e.file.name,l=new FormData;return l.append("File",e.file,a),l.append("encoding",e.encoding),l.append("escapeChar",e.escapeChar),l.append("fieldSeparator",e.fieldSeparator),l.append("textQualifier",e.textQualifier),this._httpClient.post(r,l,n).pipe()}requestDocumentLicensesCsvExport(){let e=this.getUrl("export/csv/license");return this._httpClient.post(e,null,{observe:"response"})}requestDocumentLicenseSettingsCsvExport(){let e=this.getUrl("export/csv/license-setting");return this._httpClient.post(e,null,{observe:"response"})}changeLicense(e,t,n,r){let a=this.getUrl(`licenses/${t}`),l={title:e.title,rights:e.rights,description:e.description,users:e.users.map(m=>m.userId),groups:e.groups.map(m=>m.groupId),licenseType:e.licenseType,searchForm:i.convertSearchFormModelToSearchFormDto(e.searchForm),addedDin21Ids:n,removedDin21Ids:r,documentLimit:e.documentLimit};return this._httpClient.put(a,l)}getLicenseDetailById(e){let t=this.getUrl(`licenses/${e}`);return this._httpClient.get(t,{observe:"response"}).pipe(S(function(n){return ne.isAccepted(n.status)?i.convertLicenseDetailResponseDtoToLicenseDetailModel(n.body):null}),k(()=>M(null)))}getLicenseSummaryById(e){let t=this.getUrl(`licenses/${e}/summary`);return this._httpClient.get(t,{observe:"response"}).pipe(S(function(n){return ne.isAccepted(n.status)?i.convertLicenseSummaryResponseDtoToLicenseSummary(n.body):null}),k(()=>M(null)))}static convertLicenseUserDtoToReducedUserModel(e){return e.map(t=>({userId:t.userId,username:t.username,forename:t.forename,surname:t.surname}))}static convertLicenseDetailModelToCreateLicenseRequestDto(e){return{title:e.title,description:e.description,din21Ids:e.din21Ids,users:e.users.map(t=>t.userId),groups:e.groups.map(t=>t.groupId),rights:e.rights,licenseType:e.licenseType,searchForm:i.convertSearchFormModelToSearchFormDto(e.searchForm),documentLimit:e.documentLimit}}static convertLicenseSummaryResponseDtoToLicenseSummary(e){return{id:e.id,title:e.title,description:e.description,users:i.convertLicenseUserDtoToReducedUserModel(e.users),groups:e.groups,createdOn:e.createdOn,licenseType:e.licenseType}}static convertLicenseDetailResponseDtoToLicenseDetailModel(e){return{id:e.id,title:e.title,description:e.description,users:e.users,groups:e.groups,createdOn:e.createdOn,changedOn:e.changedOn,din21Ids:e.din21Ids,rights:e.rights,licenseType:e.licenseType,documentLimit:e.documentLimit,searchForm:i.convertSearchFormDtoToSearchFormModel(e.searchForm)}}static convertSearchFormDtoToSearchFormModel(e){let t;if(e){let n=e.documentNr;delete e.documentNr,t=e,t.favoritesFolders=this.mapToChipInputModels(e.favoritesFolders),t.notesFolders=this.mapToChipInputModels(e.notesFolders),t.modifiedBy=this.mapToChipInputModels(e.modifiedBy),t.documentOwners=this.mapToChipInputModels(e.documentOwners),t.documentNumber=n,e.useDynamicSearch&&(t.dynamicSearchFields=this.convertDynamicParameterDtoToDynamicSearchFieldModel(e.dynamicParameters))}return t}static mapToChipInputModels(e){return e?.map(t=>({id:t,title:""}))}static convertDynamicParameterDtoToDynamicSearchFieldModel(e){let t=[],n=!1,r=!1;if(e.forEach(a=>{n=a.fieldName==="dateOfIssueFrom"||a.fieldName==="dateOfIssueUntil",r=a.fieldName==="appearanceFrom"||a.fieldName==="appearanceUntil",!n&&!r&&t.push({fieldName:a.fieldName,fieldValue:a.fieldValue,operator:a.operator,order:a.order})}),n||r){if(n){let a=e.find(m=>m.fieldName==="dateOfIssueFrom"),l=e.find(m=>m.fieldName==="dateOfIssueUntil");t.push({fieldName:"dateOfIssue",fieldValue:"",dateOfIssueFrom:a?.fieldValue,dateOfIssueUntil:l?.fieldValue,operator:a?.operator?a.operator:l.operator,order:a?.order?a.order:l.order})}if(r){let a=e.find(m=>m.fieldName==="appearanceFrom"),l=e.find(m=>m.fieldName==="appearanceUntil");t.push({fieldName:"appearance",fieldValue:"",appearanceFrom:a?.fieldValue,appearanceUntil:l?.fieldValue,operator:a?.operator?a.operator:l.operator,order:a?.order?a.order:l.order})}t.sort((a,l)=>a.order-l.order)}return t}static convertSearchFormModelToSearchFormDto(e){let t;return e&&(t={fulltext:e.fulltext,valid:e.valid,withDocument:e.withDocument,withDocumentId:e.withDocumentId,favoritesFolders:e.favoritesFolders?.map(n=>n.id),notesFolders:e.notesFolders?.map(n=>n.id),facetQuerys:e.facetQuerys,facetFields:e.facetFields,documentNr:e.documentNumber,documentType:e.documentType,classificationIcs:e.classificationIcs,classificationOther:e.classificationOther,countryCode:e.countryCode,flagStatus:e.flagStatus,flagAmendment:e.flagAmendment,flagChanged:e.flagChanged,flagHistorical:e.flagHistorical,flagIntendedWithdrawal:e.flagIntendedWithdrawal,flagModified:e.flagModified,flagNew:e.flagNew,flagPartiallyReplaced:e.flagPartiallyReplaced,flagReinstated:e.flagReinstated,flagUnchanged:e.flagUnchanged,flagWithdrawn:e.flagWithdrawn,dateOfIssueFrom:e.dateOfIssueFrom,dateOfIssueUntil:e.dateOfIssueUntil,linkPublished:e.linkPublished,noteUnd:e.noteUnd,noteFr:e.noteFr,noteEn:e.n
15oteEn,noteDe:e.noteDe,descriptorUnd:e.descriptorUnd,linkHandbook:e.linkHandbook,descriptorFr:e.descriptorFr,descriptorDe:e.descriptorDe,abstractUnd:e.abstractDe,abstractEn:e.abstractEn,abstractFr:e.abstractFr,abstractDe:e.abstractDe,fulltextAddress:e.fulltextAddress,edvNr:e.edvNr,descriptorEn:e.descriptorEn,linkCertification:e.linkCertification,linkLegislation:e.linkLegislation,replacedBy:e.replacedBy,productId:e.productId,sectionalList:e.sectionalList,citation:e.citation,internationalRelationship:e.internationalRelationship,titleUnd:e.titleUnd,titleFr:e.titleFr,titleEn:e.titleEn,titleDe:e.titleDe,transitionPeriod:e.transitionPeriod,appearance:e.appearance,appearanceFrom:e.appearanceFrom,appearanceUntil:e.appearanceUntil,withdrawalDate:e.withdrawalDate,draftSuperseded:e.draftSuperseded,amends:e.amends,amendedBy:e.amendedBy,replaces:e.replaces,priceUndetermNote:e.priceUndetermNote,fulltextPages:e.fulltextPages,translations:e.translations,publishing:e.publishing,originalLanguage:e.originalLanguage,expiration:e.expiration,author:e.author,confirmation:e.confirmation,effective:e.effective,issuing:e.issuing,overview:e.overview,acCode:e.acCode,showOnlyTenantItems:e.showOnlyTenantItems,searchFormId:e.searchFormId,version:e.version,dynamicParameters:e.dynamicParameters,ceSearch:e.ceSearch,useDynamicSearch:e.useDynamicSearch,dynamicSearchOperator:e.dynamicSearchOperator,customFields:e.customFields,documentTypePro:e.documentTypePro,updatePro:e.updatePro,monitoringStatus:e.monitoringStatus,ruleSetPro:e.ruleSetPro,createdBy:e.createdBy?.map(n=>n.id),createdAt:e.createdAt,modifiedBy:e.modifiedBy?.map(n=>n.id),modifiedAt:e.modifiedAt,classificationPro:e.classificationPro,info:e.info,isCited:e.isCited,regionalValidity:e.regionalValidity,pricePro:e.pricePro,publisherPro:e.publisherPro,sourcePro:e.sourcePro,certifiedBy:e.certifiedBy,certifiedDate:e.certifiedDate,releaseLevel:e.releaseLevel,releaseComment:e.releaseComment,changeDescription:e.changeDescription,revisionVersion:e.revisionVersion,reminderDate:e.reminderDate,documentOwners:e.documentOwners?.map(n=>n.id),lastReview:e.lastReview,updateInterval:e.updateInterval}),t}static getHeaders(){let e=new Mt;return e=e.append("Content-Type","empty"),e=e.append("Accept","*/*"),e=e.append("Response-Type","text/csv"),e}getUrl(e){return`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${e}`}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac})}}return i})();var pe=(function(i){return i.metadata="metadata",i.user="user",i.fileListImport="fileListImport",i.documentLinks="documentLinks",i.hostedFiles="hostedFiles",i.documentLicense="documentLicense",i.licenseSettings="licenseSettings",i})(pe||{});var vl=(()=>{class i{copyText(e){return new He(t=>{navigator.clipboard.writeText(e).then(()=>{t.next(),t.complete()}).catch(n=>{console.error("Clipboard copy failed: ",n),t.error(n)})})}copyFromMultipleClasses(e){return new He(t=>{let n=[];try{e.forEach(a=>{(typeof a!="string"||!a.trim())&&console.warn(`Invalide class name: "${a}"`);let l=document.querySelectorAll(`.${a}`);l.length||console.warn(`No elements found for class: "${a}"`),l.forEach(m=>{let b=m.textContent?.trim();if(b){let T=this.splitAndTrimLines(b);n.push(...T)}})});let r=n.join(` 16`);r?(t.next(r),t.complete()):t.error("Empty content")}catch(r){console.error("An error occurred while copying: ",r),t.error(r)}}).pipe(Re(t=>this.copyText(t)),k(t=>(console.error("Clipboard copy observable pipeline error: ",t),Ri(()=>t))))}splitAndTrimLines(e){return e.split(` 17`).map(t=>t.trim())}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var xi=i=>({count:i}),bl=i=>({number:i}),uu=(i,o)=>({field:i,fieldValue:o}),_u=(i,o)=>({fieldName:i,source:o}),hu=i=>({fieldName:i});function fu(i,o){i&1&&y(0,"app-icon",18)}function gu(i,o){i&1&&y(0,"app-icon",19)}function Cu(i,o){i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2&&(s(),F(" ",C(2,1,"common.import.info_text")," "))}function vu(i,o){i&1&&(c(0,"div",20),y(1,"app-icon",21),c(2,"span"),v(3),h(4,"transloco"),d()()),i&2&&(s(3),D(C(4,1,"common.copied")))}function bu(i,o){i&1&&y(0,"app-icon",22)}function yu(i,o){if(i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2){let e=p(2);s(),F(" ",de(2,1,"licenses.import_x_licenses_successfully_added",ie(4,xi,e.report.numCreated))," ")}}function xu(i,o){if(i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2){let e=p(2);s(),F(" ",de(2,1,"common.import.x_records_successfully_added",ie(4,xi,e.report.numCreated))," ")}}function Su(i,o){if(i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2){let e=p(2);s(),F(" ",de(2,1,"search.filelist_import.several_successful",ie(4,xi,e.report.numCreated))," ")}}function Tu(i,o){if(i&1&&(c(0,"span",23),Y(1,yu,3,6,"ng-container",7)(2,xu,3,6,"ng-container",7)(3,Su,3,6,"ng-container",7),d()),i&2){let e=p();s(),f("ngIf",e.csvImportKey===e.csvImportKeys.documentLicense),s(),f("ngIf",e.csvImportKey!==e.csvImportKeys.fileListImport&&e.csvImportKey!==e.csvImportKeys.documentLicense),s(),f("ngIf",e.csvImportKey===e.csvImportKeys.fileListImport)}}function Du(i,o){i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2&&(s(),F(" ",C(2,1,"licenses.import_license_successfully_added")," "))}function Eu(i,o){i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2&&(s(),F(" ",C(2,1,"common.import.record_successfully_added")," "))}function Iu(i,o){i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2&&(s(),F(" ",C(2,1,"search.filelist_import.one_successful")," "))}function Fu(i,o){if(i&1&&(c(0,"span",23),Y(1,Du,3,3,"ng-container",7)(2,Eu,3,3,"ng-container",7)(3,Iu,3,3,"ng-container",7),d()),i&2){let e=p();s(),f("ngIf",e.csvImportKey===e.csvImportKeys.documentLicense),s(),f("ngIf",e.csvImportKey!==e.csvImportKeys.fileListImport&&e.csvImportKey!==e.csvImportKeys.documentLicense),s(),f("ngIf",e.csvImportKey===e.csvImportKeys.fileListImport)}}function Mu(i,o){if(i&1&&(c(0,"span",25),v(1),h(2,"transloco"),d()),i&2){let e=p(2);s(),F(" ",de(2,1,"licenses.import_x_licenses_successfully_updated",ie(4,xi,e.report.numUpdated))," ")}}function wu(i,o){i&1&&(c(0,"span",25),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"licenses.import_license_successfully_updated")," "))}function Ou(i,o){if(i&1&&(c(0,"div",13),y(1,"app-icon",22),Y(2,Mu,3,6,"span",24)(3,wu,3,3,"span",24),d()),i&2){let e=p();s(2),f("ngIf",e.report.numUpdated!==1),s(),f("ngIf",e.report.numUpdated===1)}}function Pu(i,o){if(i&1&&(c(0,"span",25),v(1),h(2,"transloco"),d()),i&2){let e=p(2);s(),F(" ",de(2,1,"common.import.x_records_successfully_updated",ie(4,xi,e.report.numUpdated))," ")}}function Nu(i,o){i&1&&(c(0,"span",25),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.import.record_successfully_updated")," "))}function ku(i,o){if(i&1&&(c(0,"div",13),y(1,"app-icon",22),Y(2,Pu,3,6,"span",24)(3,Nu,3,3,"span",24),d()),i&2){let e=p();s(2),f("ngIf",e.report.numUpdated!==1),s(),f("ngIf",e.report.numUpdated===1)}}function Ru(i,o){if(i&1&&(c(0,"span",27),v(1),h(2,"transloco"),d()),i&2){let e=p(2);s(),F(" ",de(2,1,"common.import.x_records_successfully_deleted",ie(4,xi,e.report.numDeleted))," ")}}function Au(i,o){i&1&&(c(0,"span",27),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.import.record_successfully_deleted")," "))}function Lu(i,o){if(i&1&&(c(0,"div",13),y(1,"app-icon",22),Y(2,Ru,3,6,"span",26)(3,Au,3,3,"span",26),d()),i&2){let e=p();s(2),f("ngIf",e.report.numDeleted!==1),s(),f("ngIf",e.report.numDeleted===1)}}function Uu(i,o){if(i&1&&(c(0,"span",31),v(1),h(2,"transloco"),d()),i&2){let e=p(3);s(),F(" ",de(2,1,"licenses.import.report.error.record_count_x",ie(4,xi,e.report.notSuccessful))," ")}}function Bu(i,o){i&1&&(c(0,"span",31),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.import.record_could_not_be_processed")," "))}function Vu(i,o){if(i&1&&(Ue(0),c(1,"div",32),v(2),h(3,"transloco"),h(4,"transloco"),h(5,"transloco"),h(6,"transloco"),d(),Be()),i&2){let e=o.$implicit,t=p(3);s(2),fa(" ",de(3,2,"company_data.metadata_upload.errors.line_number_x",ie(12,bl,e.lineNumber+t.numberOfHeaderLines)),": ",de(6,9,t.errorTranslationKey(e),ht(14,uu,C(4,5,t.fieldTranslationKey(e.fieldName)),e.fieldValue!==null&&e.fieldValue!==""?e.fieldValue:C(5,7,"licenses.import.empty")))," ")}}function $u(i,o){if(i&1&&(c(0,"div")(1,"div",13),y(2,"app-icon",28),Y(3,Uu,3,6,"span",29)(4,Bu,3,3,"ng-template",null,1,fe),d(),Y(6,Vu,7,17,"ng-container",30),d()),i&2){let e=X(5),t=p(2);s(3),f("ngIf",t.report.notSuccessful>1)("ngIfElse",e),s(3),f("ngForOf",t.report.errors)}}function Hu(i,o){if(i&1&&(Ue(0),Y(1,$u,7,3,"div",7),Be()),i&2){let e=p();s(),f("ngIf",(e.report==null||e.report.errors==null?null:e.report.errors.length)>0||(e.report==null||e.report.errors==null?null:e.report.errors.length)===0&&(e.report==null?null:e.report.notSuccessful)>0)}}function Ku(i,o){if(i&1&&(c(0,"span",31),v(1),h(2,"transloco"),d()),i&2){let e=p(3);s(),F(" ",de(2,1,"common.import.x_records_could_not_be_processed",ie(4,xi,e.report.notSuccessful))," ")}}function Gu(i,o){i&1&&(c(0,"span",31),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.import.record_could_not_be_processed")," "))}function qu(i,o){if(i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2){let e=p().$implicit,t=p(3);s(),F(" ",de(2,1,"company_data.metadata_upload.errors."+t.errorLabels[e.errorCode],ht(4,_u,e.fieldName,e.errorCodeLabel))," ")}}function Wu(i,o){if(i&1&&(Ue(0),v(1),h(2,"transloco"),Be()),i&2){let e=p().$implicit,t=p(3);s(),F(" ",de(2,1,"company_data.metadata_upload.errors."+t.errorLabels[e.errorCode],ie(4,hu,e.fieldName))," ")}}function zu(i,o){if(i&1&&(Ue(0),c(1,"div",32),v(2),h(3,"transloco"),Y(4,qu,3,7,"ng-container",7)(5,Wu,3,6,"ng-container",7),d(),Be()),i&2){let e=o.$implicit,t=p(3);s(2),F(" ",de(3,3,"company_data.metadata_upload.errors.line_number_x",ie(6,bl,e.lineNumber+t.numberOfHeaderLines)),": "),s(2),f("ngIf",t.csvImportKey===t.csvImportKeys.fileListImport),s(),f("ngIf",t.csvImportKey!==t.csvImportKeys.fileListImport)}}function ju(i,o){if(i&1&&(c(0,"div")(1,"div",13),y(2,"app-icon",28),Y(3,Ku,3,6,"span",29)(4,Gu,3,3,"ng-template",null,1,fe),d(),Y(6,zu,6,8,"ng-container",30),d()),i&2){let e=X(5),t=p(2);s(3),f("ngIf",t.report.notSuccessful>1)("ngIfElse",e),s(3),f("ngForOf",t.report.errors)}}function Yu(i,o){if(i&1&&Y(0,ju,7,3,"div",7),i&2){let e=p();f("ngIf",(e.report==null||e.report.errors==null?null:e.report.errors.length)>0||(e.report==null||e.report.errors==null?null:e.report.errors.length)===0&&(e.report==null?null:e.report.notSuccessful)>0)}}function Qu(i,o){if(i&1&&(c(0,"div",13)(1,"span"),v(2),h(3,"transloco"),d()()),i&2){let e=p();s(2),D(C(3,1,e.reportMessage))}}var Zu=[pe.documentLicense,pe.documentLinks,pe.hostedFiles,pe.licenseSettings,pe.metadata,pe.user],yl=(()=>{class i{constructor(){this._clipboardService=g(vl),this.showDeleteReports=Zu,this.reportSuccess=Ie,this.csvImportKeys=pe,this.errorLabels=wt}onCopyToClipboard(){this._clipboardService.copyFromMultipleClasses(["report","error-details"]).subscribe({next:()=>{this.isCopySuccess=!0},error:e=>console.error("Could not copy report: ",e)})}errorTranslationKey(e){return`licenses.import.report.error.${Bt.camelToSnakeCase(e.errorCodeLabel)}`}fieldTranslationKey(e){return e===""?"licenses.import.empty":`licenses.import.fields.${Bt.camelToSnakeCase(e)}`}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-import-report"]],inputs:{csvImportKey:"csvImportKey",report:"report",reportMessage:"reportMessage",numberOfHeaderLines:"numberOfHeaderLines"},decls:27,vars:22,consts:[["otherImportReports",""],["singular",""],[1,"report-status"],["class","icon-success","data-cy","iconImport","name","check-mark-large","sprite","icons-large",4,"ngIf"],["class","icon-alert","data-cy","iconImport","name","cross-large","sprite","icons-large",4,"ngIf"],["data-cy","reportStatus"],["data-cy","textImportInfo"],[4,"ngIf"],[1,"report-container"],[1,"btn-copy"],["type","button",1,"btn-icon",3,"click","ngbTooltip"],["name","copy"],["class","copy-success",4,"ngIf"],[1,"report"],["class","icon-success","name","check-mark-filled",4,"ngIf"],["data-cy","successMessageAdded",4,"ngIf"],["class","report",4,"ngIf"],[4,"ngIf","ngIfElse"],["data-cy","iconImport","name","check-mark-large","sprite","icons-large",1,"icon-success"],["data-cy","iconImport","name","cross-large","sprite","icons-large",1,"icon-alert"],[1,"copy-success"],["name","check-mark"],["name","check-mark-filled",1,"icon-success"],["data-cy","successMessageAdded"],["data-cy","successMessageUpdated",4,"ngIf"],["data-cy","successMessageUpdated"],["data-cy","successMessageDeleted",4,"ngIf"],["data-cy","successMessageDeleted"],["data-cy","importError","name","cross-filled",1,"icon-alert"],["data-cy","errorMessage",4,"ngIf","ngIfElse"],[4,"ngFor","ngForOf"],["data-cy","errorMessage"],["data-cy","reportErrorMessage",1,"error-details"]],template:function(t,n){if(t&1&&(c(0,"div",2),Y(1,fu,1,0,"app-icon",3)(2,gu,1,0,"app-icon",4),c(3,"h3",5),v(4),h(5,"transloco"),d()(),c(6,"div",6),Y(7,Cu,3,3,"ng-container",7),d(),c(8,"div",8)(9,"div",9)(10,"button",10),h(11,"transloco"),h(12,"transloco"),x("click",function(){return n.onCopyToClipboard()}),y(13,"app-icon",11),d(),Y(14,vu,5,3,"div",12),d(),c(15,"div")(16,"div",13),Y(17,bu,1,0,"app-icon",14)(18,Tu,4,3,"span",15)(19,Fu,4,3,"span",15),d(),Y(20,Ou,4,2,"div",16)(21,ku,4,2,"div",16)(22,Lu,4,2,"div",16),d(),Y(23,Hu,2,1,"ng-container",17)(24,Yu,1,1,"ng-template",null,0,fe)(26,Qu,4,3,"div",16),d()),t&2){let r=X(25);s(),f("ngIf",n.report.success===n.reportSuccess.TRUE||n.report.success===n.reportSuccess.PARTIALLY),s(),f("ngIf",n.report.success===n.reportSuccess.FALSE),s(2),D(C(5,16,n.report.headline)),s(3),f("ngIf",n.csvImportKey===n.csvImportKeys.metadata||n.csvImportKey===n.csvImportKeys.user||n.csvImportKey===n.csvImportKeys.fileListImport||n.csvImportKey===n.csvImportKeys.documentLinks),s(3),f("ngbTooltip",C(11,18,"common.copy_to_clipboard")),P("aria-label",C(12,20,"common.copy_to_clipboard")),s(4),f("ngIf",n.isCopySuccess),s(3),f("ngIf",n.report.numCreated!==null),s(),f("ngIf",n.report.numCreated!==null&&n.report.numCreated!==1),s(),f("ngIf",n.report.numCreated!==null&&n.report.numCreated===1),s(),f("ngIf",n.csvImportKey===n.csvImportKeys.documentLicense),s(),f("ngIf",n.csvImportKey!==n.csvImportKeys.fileListImport&&n.csvImportKey!==n.csvImportKeys.documentLicense),s(),f("ngIf",n.showDeleteReports.includes(n.csvImportKey)||n.report.numDeleted>0),s(),f("ngIf",n.csvImportKey===n.csvImportKeys.licenseSettings||n.csvImportKey===n.csvImportKeys.documentLicense)("ngIfElse",r),s(3),f("ngIf",n.reportMessage&&(n.reportMessage==null?null:n.reportMessage.length)>0)}},dependencies:[Oe,Sa,Ta,j,_e,Qe,z,$],styles:[".report-status[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;gap:var(--spacer);margin-bottom:calc(var(--spacer) * 3)}.report-container[_ngcontent-%COMP%]{border-top:var(--border);max-height:30vh;overflow:hidden auto;margin-top:var(--spacer);padding-top:var(--spacer)}.report-container[_ngcontent-%COMP%] .report[_ngcontent-%COMP%]{align-items:center;display:flex;gap:calc(var(--spacer) / 2)}.report-container[_ngcontent-%COMP%] .error-details[_ngcontent-%COMP%]{margin-left:38px}.report[_ngcontent-%COMP%] .error-report[_ngcontent-%COMP%]{margin-left:calc(var(--spacer) * 2);line-height:2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.btn-copy[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-bottom:var(--spacer);margin-right:calc(var(--spacer) / 4);position:relative}.btn-copy[_ngcontent-%COMP%] .copy-success[_ngcontent-%COMP%]{align-items:center;color:var(--color-success);display:flex;position:absolute;top:calc(var(--spacer) * 2);right:calc(var(--spacer) / 3)}"]})}}return i})();var ii=(function(i){return i.CREATED="Created",i.RUNNING="Running",i.SUCCESSFUL="Successful",i.FAILED="Failed",i.PARTIALLY_SUCCESSFUL="Parti
17allySuccessful",i})(ii||{});var Do=class{constructor(o={}){this.abstractDe=o.abstractDe||"",this.abstractEn=o.abstractEn||"",this.abstractFr=o.abstractFr||"",this.abstractUnd=o.abstractUnd||"",this.acCode=o.acCode||"",this.admSortKey=o.admSortKey||"",this.amendedBy=o.amendedBy||[],this.amends=o.amends||[],this.appearance=o.appearance||"",this.author=o.author||"",this.citation=o.citation||[],this.classificationIcs=o.classificationIcs||"",this.classificationOther=o.classificationOther||"",this.committeeReference=o.committeeReference||"",this.confirmation=o.confirmation||"",this.countryCode=o.countryCode||"",this.customFields=o.customFields||[],this.dateOfIssue=o.dateOfIssue||"",this.descriptorDe=o.descriptorDe||"",this.descriptorEn=o.descriptorEn||"",this.descriptorFr=o.descriptorFr||"",this.descriptorUnd=o.descriptorUnd||"",this.documentNumber=o.documentNumber||"",this.documentType=o.documentType||"",this.draftSuperseded=o.draftSuperseded||[],this.edvNr=o.edvNr||"",this.effective=o.effective||"",this.expiration=o.expiration||"",this.flagStatus=o.flagStatus||"",this.fulltextAddress=o.fulltextAddress||"",this.fulltextOnlineId=o.fulltextOnlineId||"",this.fulltextPages=o.fulltextPages||"",this.id=o.id||"",this.internationalRelationship=o.internationalRelationship||[],this.issuing=o.issuing||"",this.linkCertification=o.linkCertification||[],this.linkHandbook=o.linkHandbook||[],this.linkLegislation=o.linkLegislation||[],this.linkPublished=o.linkPublished||[],this.noteDe=o.noteDe||"",this.noteEn=o.noteEn||"",this.noteFr=o.noteFr||"",this.noteUnd=o.noteUnd||"",this.originalLanguage=o.originalLanguage||"",this.overview=o.overview||"",this.priceUndetermNote=o.priceUndetermNote||"",this.productId=o.productId||"",this.publishing=o.publishing||"",this.replacedBy=o.replacedBy||[],this.replaces=o.replaces||[],this.sectionalList=o.sectionalList||"",this.titleDe=o.titleDe||"",this.titleEn=o.titleEn||"",this.titleFr=o.titleFr||"",this.titleUnd=o.titleUnd||"",this.transitionPeriod=o.transitionPeriod||"",this.translations=o.translations||"",this.version=o.version||[],this.withdrawalDate=o.withdrawalDate||"",this.documentTypePro=o.documentTypePro||"",this.updatePro=o.updatePro||"",this.monitoringStatus=o.monitoringStatus||"",this.ruleSetPro=o.ruleSetPro||"",this.createdBy=o.createdBy,this.createdAt=o.createdAt||"",this.modifiedBy=o.modifiedBy,this.modifiedAt=o.modifiedAt||"",this.classificationPro=o.classificationPro||"",this.info=o.info||"",this.isCited=o.isCited||[],this.regionalValidity=o.regionalValidity||"",this.pricePro=o.pricePro||"",this.publisherPro=o.publisherPro||"",this.sourcePro=o.sourcePro||"",this.certifiedBy=o.certifiedBy||"",this.certifiedDate=o.certifiedDate||"",this.releaseLevel=o.releaseLevel||"",this.releaseComment=o.releaseComment||"",this.changeDescription=o.changeDescription||"",this.revisionVersion=o.revisionVersion||"",this.reminderDate=o.reminderDate||"",this.documentOwners=o.documentOwners||[],this.lastReview=o.lastReview||"",this.updateInterval=o.updateInterval||""}};var xl=(()=>{class i{constructor(){this._configService=g(Se),this._searchService=g(Jt),this._httpClient=g(Fe)}createMetadata(e,t=!1,n=!1,r=null){let a=this.getURL("metadata");r!==null&&(a.searchParams.set("asSuccessor",String(t)),a.searchParams.set("withdrawOriginal",String(n)),a.searchParams.set("originalAcCode",String(r)));let l=i.metaDataModelToCompanyDataDto(e,!0);return this._httpClient.post(a.toString(),l).pipe(S(m=>({id:m.id,acCode:m.acCode})))}getMetadataDetails(e){let t=this.getUrl("detail")+"/"+e;return this._httpClient.get(t).pipe(S(n=>i.searchResultItemDtoToMetaDataModel(n)))}updateMetadata(e){let t=this.getUrl("metadata/update"),n=i.metaDataModelToCompanyDataDto(e,!1);return this._httpClient.put(t,n).pipe(S(r=>({id:r.id})))}updateProCustomerFields(e,t){let n=this.getUrl("metadata/updatepro"),r=i.customFieldsModelToCustomerStandardProDto(e,t);return this._httpClient.put(n,r)}deleteMetadata(e){let t=this.getUrl("metadata/delete")+"/"+e;return this._httpClient.delete(t)}uploadCsvFile(e){let n={headers:i.getHeaders()}
17,r=this.getUrl("metadata/template"),a=e.file.name,l=new FormData;return l.append("File",e.file,a),l.append("encoding",e.encoding),l.append("escapeChar",e.escapeChar),l.append("fieldSeparator",e.fieldSeparator),l.append("textQualifier",e.textQualifier),this._httpClient.post(r,l,n).pipe(S(m=>{let b=m.templateErrors.length<1?"common.import.import_successful":"common.import.import_partially_successful",T=m.templateErrors.length>0?Ie.PARTIALLY:Ie.TRUE;m.numCreated+m.numUpdated<=0&&(m.notSuccessful===0?(T=Ie.TRUE,b="common.import.import_successful"):(T=Ie.FALSE,b="common.import.import_failed"));let O=m.templateErrors;return{success:T,errors:O.map(H=>({fieldName:H.fieldName,lineNumber:H.lineNumber,errorCode:H.errorCode,errorCodeLabel:H.errorCodeLabel})),headline:b,numCreated:m.numCreated,numDeleted:m.numDeleted,numUpdated:m.numUpdated,notSuccessful:m.notSuccessful}}))}getCsvTemplate(e){let t=this.getUrl("metadata/defaulttemplate"),n=new Mt;return n.append("Content-Type","application/json"),this._httpClient.post(t,JSON.stringify(e),{headers:n,responseType:"blob"})}getURL(e){return new URL(`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${e}`)}getUrl(e){return`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${e}`}static getHeaders(){let e=new Mt;return e=e.append("Content-Type","empty"),e=e.append("Accept","*/*"),e=e.append("Response-Type","blob"),e}static customFieldsModelToCustomerStandardProDto(e,t){return{acCode:t,certifiedBy:e.certifiedBy,certifiedDate:e.certifiedDate?e.certifiedDate:void 0,changeDescription:e.changeDescription,classificationPro:e.classificationPro,documentOwners:e.documentOwners?.map(n=>n.userGuid),documentTypePro:e.documentTypePro,info:e.info,lastReview:e.lastReview?e.lastReview:void 0,monitoringStatus:e.monitoringStatus,pricePro:e.pricePro,publisherPro:e.publisherPro,regionalValidity:e.regionalValidity,releaseComment:e.releaseComment,releaseLevel:e.releaseLevel,reminderDate:e.reminderDate?e.reminderDate:void 0,revisionVersion:e.revisionVersion,ruleSetPro:e.ruleSetPro,sourcePro:e.sourcePro,updateInterval:e.updateInterval!==""?e.updateInterval:null,updatePro:e.updatePro}}static metaDataModelToCompanyDataDto(e,t){let n=["amendedBy","amends","citations","draftSuperseded","linkHandbook","replacedBy","replaces"],r=Array.isArray(e.countryCode)?e.countryCode[0]:e.countryCode,a=re.detectStringSeparator(e.documentType),l=e.documentType.split(a).map(N=>N.trim());a=re.detectStringSeparator(e.flagStatus);let m=e.flagStatus.split(a).map(N=>N.trim());a=re.detectStringSeparator(e.classificationIcs);let b=e.classificationIcs.split(a).map(N=>N.trim()),T=e.classificationOther.split(a).map(N=>N.trim());a=re.detectStringSeparator(e.author);let O=e.author.split(a).map(N=>N.trim());a=re.detectStringSeparator(e.originalLanguage);let U=e.originalLanguage.split(a).map(N=>N.trim()),H;Object.hasOwn(e,"customFields")&&Array.isArray(e.customFields)&&(H=e.customFields);let Z=[{edvNr:e.edvNr,addresses:[e.fulltextAddress],pageSize:Number.parseInt(e.fulltextPages,10),language:"DE"}],ee={abstractDe:e.abstractDe,abstractEn:e.abstractEn,abstractFr:e.abstractFr,abstractUnd:e.abstractUnd,acCode:e.acCode||null,acCodeExtern:null,admSortKey:e.admSortKey||null,amendedBy:[],amends:[],appearance:e.appearance,author:O,ceInfo:"",citations:[],classificationIcs:b,classificationOther:T,confirmation:e.confirmation,countryCode:r,customFields:H,dateOfIssue:e.dateOfIssue,descriptorDe:e.descriptorDe,descriptorEn:e.descriptorEn,descriptorFr:e.descriptorFr,descriptorUnd:e.descriptorUnd,documentNumber:e.documentNumber,documents:Z,documentType:l,draftSuperseded:null,edvNr:e.edvNr,fulltextAddress:e.fulltextAddress,fulltextPages:e.fulltextPages,effective:e.effective,expiration:e.expiration,flags:m,issuing:[e.issuing],linkHandbook:null,linkLegislation:st.convertStringToStandardReferenceRequestDto(e.linkLegislation),publishedIn:st.convertStringToStandardReferenceRequestDto(e.linkPublished),linkCertification:e.linkCertification,noteDe:e.noteDe,noteEn:e.noteEn,noteFr:e.noteFr,noteUnd:e.noteUnd,originalLanguage:U,overviewUnd:e.overview,price:e.priceUndetermNote,productId:e.productId,publishing:[e.publishing],referenceIdentical:st.convertStringToStandardReferenceRequestDto(e.internationalRelationship
17),referenceModified:[],referenceNecessary:[],referenceNotEquivalent:[],referenceUseful:[],replacedBy:null,replaces:null,admSectional:[e.sectionalList],titleDe:e.titleDe,titleEn:e.titleEn,titleFr:e.titleFr,titleUnd:e.titleUnd,transition:e.transitionPeriod,translations:[e.translations],valid:!0,version:e.version,withdrawal:e.withdrawalDate,documentTypePro:e.documentTypePro,updatePro:e.updatePro,monitoringStatus:e.monitoringStatus,ruleSetPro:e.ruleSetPro,classificationPro:e.classificationPro,info:e.info,isCited:e.isCited,regionalValidity:e.regionalValidity,pricePro:e.pricePro,publisherPro:e.publisherPro,sourcePro:e.sourcePro,certifiedBy:e.certifiedBy,certifiedDate:e.certifiedDate,releaseLevel:e.releaseLevel||null,releaseComment:e.releaseComment,changeDescription:e.changeDescription,revisionVersion:e.revisionVersion,reminderDate:e.reminderDate,documentOwners:e.documentOwners?.map(N=>N.userGuid),lastReview:e.lastReview,updateInterval:e.updateInterval!==""?e.updateInterval:null};return t||(ee.id=e.id),n.forEach(N=>{let Ce=e[N];N==="citations"&&(Ce=e.citation),ee=i.conditionallyAddField(N,Ce,ee)}),ee}static searchResultItemDtoToMetaDataModel(e,t=", "){let n=e.documentType.join(", "),r=e.classificationIcs.join(t),a=e.classificationOther.join(t),l=re.detectStringSeparator(e.countryCode),m=e.countryCode?.split(l).join(t),b=i.getFlagStatus(e),T=e.customFields.map(H=>({fieldName:H.id,fieldValue:H.value})),O=[];for(let H of T){let Z=Number.parseInt(H.fieldName.slice(-1),10)-1;H.fieldName=H.fieldName.replace("custom_field","custom_"),H.fieldName=H.fieldName.replace("customfield","custom_"),O[Z]=H}let U=new Do({abstractDe:e.abstractDe.join(t),abstractEn:e.abstractEn.join(t),abstractFr:e.abstractFr.join(t),abstractUnd:e.abstractUnd.join(t),acCode:e.id,admSortKey:e.admSortKey,amendedBy:i.toStandardReferenceRequestDto(e.amendedBy),amends:i.toStandardReferenceRequestDto(e.amends),appearance:e.appearance,author:e.author.join(t),citation:i.toStandardReferenceRequestDto(e.citations),classificationIcs:r,classificationOther:a,confirmation:e.confirmation,countryCode:m,customFields:O,dateOfIssue:e.dateOfIssue,descriptorDe:e.descriptorDe.join(t),descriptorEn:e.descriptorEn.join(t),descriptorFr:e.descriptorFr.join(t),descriptorUnd:e.descriptorUnd.join(t),documentNumber:e.documentNumber,documentType:n,draftSuperseded:i.toStandardReferenceRequestDto(e.draftSuperseded),edvNr:e.documents[0]?.edvNr,effective:e.effective,expiration:e.expiration,flagStatus:b,fulltextAddress:e.fulltextAddress.join(t),fulltextPages:e.documents[0]?.fulltextPages.toString(),id:e.id,internationalRelationship:i.toStandardReferenceRequestDto(e.referenceIdentical),issuing:e.issuing.join(t),linkCertification:i.toStandardReferenceRequestDto(e.linkCertification),linkHandbook:i.toStandardReferenceRequestDto(e.linkHandbook),linkLegislation:i.toStandardReferenceRequestDto(e.linkLegislation),linkPublished:i.toStandardReferenceRequestDto(e.linkPublished),noteDe:e.noteDe,noteEn:e.noteEn,noteFr:e.noteFr,noteUnd:e.noteUnd,originalLanguage:e.originalLanguage.join(t),overview:e.overviewUnd,priceUndetermNote:e.priceUndetermNote,productId:e.productId,publishing:e.publishing.join(t),replacedBy:i.toStandardReferenceRequestDto(e.replacedBy),replaces:i.toStandardReferenceRequestDto(e.replaces),sectionalList:e.admSectional.join(t),titleDe:e.titleDe,titleEn:e.titleEn,titleFr:e.titleFr,titleUnd:e.titleUnd,transitionPeriod:e.transition,translations:e.translations.join(t),version:i.toStandardReferenceRequestDto(e.version),withdrawalDate:e.withdrawal});for(let H of e.customFields){let Z=Number.parseInt(H.id.replace("customfield",""),10);U["custom_"+Z]=H.value}return U}static conditionallyAddField(e,t,n){return t&&n&&(n[e]=Array.isArray(t)?t:[t]),n}static getFlagStatus(e){return new Gn().transform(e,!0)}static toStandardReferenceRequestDto(e=[]){return e.map(t=>({acCode:t.id,value:t.relation}))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function e_(i,o){if(i&1&&y(0,"app-import-report",3),i&2){let e=p();f("csvImportKey",e.csvImportKey)("numberOfHeaderLines",e.numberOfHeaderLines)("reportMessage",e.reportMessage)("report",e.report)}}function t_(i,o){if(i&1){let e=w();c(0,"button",12),x("click",function(n){E(e);let r=p(2);return I(!r.isUploading&&r.downloadMetadataTemplate(n))}),y(1,"app-icon",13),c(2,"span"),v(3),h(4,"transloco"),d()()}if(i&2){let e=p(2);W("disabled",e.isUploading),s(3),D(C(4,3,e.templateFields.downloadTemplate))}}function i_(i,o){if(i&1&&(c(0,"span",17),v(1),h(2,"transloco"),d()),i&2){let e=p(3);s(),D(C(2,1,e.templateFields.uploadDisclaimer))}}function n_(i,o){if(i&1&&(c(0,"span",18),v(1),d()),i&2){let e=p(3);s(),D(e.fileName)}}function o_(i,o){if(i&1&&(c(0,"p",20),v(1),h(2,"transloco"),d()),i&2){let e=p(3);s(),F(" ",C(2,1,e.errorMessage)," ")}}function r_(i,o){if(i&1){let e=w();c(0,"div",14),x("click",function(){E(e);let n=X(6);return I(n.click())})("fileDropped",function(n){E(e);let r=p(2);return I(r.onAddUploadFile(n))})("keydown.enter",function(){E(e);let n=X(6);return I(n.click())}),c(1,"div",15),y(2,"app-icon",16),u(3,i_,3,3,"span",17),u(4,n_,2,1,"span",18),d(),c(5,"input",19,0),x("change",function(n){E(e);let r=p(2);return I(r.onAddUploadFile(n))}),d()(),u(7,o_,3,3,"p",20)}if(i&2){let e=p(2);s(3),_(e.fileName?-1:3),s(),_(e.fileName?4:-1),s(3),_(e.errorMessage?7:-1)}}function a_(i,o){if(i&1&&(c(0,"div",9),y(1,"app-icon",21),c(2,"span"),v(3),h(4,"truncate"),d(),c(5,"span"),v(6,".csv"),d()()),i&2){let e=p(2);s(3),D(de(4,1,e.fileName,50))}}function s_(i,o){if(i&1&&(c(0,"span",10),v(1),h(2,"transloco"),d()),i&2){let e=p(2);s(),F(" ",C(2,1,e.templateFields.uploadFileProperties)," ")}}function l_(i,o){i&1&&(c(0,"p",28),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.please_fill_this_field")," "))}function c_(i,o){i&1&&(c(0,"p",31),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.please_fill_this_field")," "))}function d_(i,o){i&1&&(c(0,"p",34),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.please_fill_this_field")," "))}function p_(i,o){if(i&1&&(c(0,"div",11)(1,"div",22)(2,"label",23),v(3),h(4,"transloco"),d(),c(5,"div",24),y(6,"app-select",25),d()(),c(7,"div",22)(8,"label",26),v(9),h(10,"transloco"),d(),c(11,"div",24),y(12,"input",27),u(13,l_,3,3,"p",28),d()(),c(14,"div",22)(15,"label",29),v(16),h(17,"transloco"),d(),c(18,"div",24),y(19,"input",30),u(20,c_,3,3,"p",31),d()(),c(21,"div",22)(22,"label",32),v(23),h(24,"transloco"),d(),c(25,"div",24),y(26,"input",33),u(27,d_,3,3,"p",34),d()()()),i&2){let e=p(2);s(3),D(C(4,11,e.templateFields.fileEncoding)),s(3),f("items",e.encodingOptions),s(3),D(C(10,13,"common.import.field_separator")),s(3),f("limitInput",1),s(),_(e.uploadForm.controls.fieldSeparator.invali
17d?13:-1),s(3),D(C(17,15,e.templateFields.textQualifier)),s(3),f("limitInput",1),s(),_(e.uploadForm.controls.textQualifier.invalid?20:-1),s(3),D(C(24,17,e.templateFields.escapeChar)),s(3),f("limitInput",1),s(),_(e.uploadForm.controls.escapeChar.invalid?27:-1)}}function m_(i,o){if(i&1){let e=w();c(0,"div")(1,"button",35),x("click",function(n){E(e);let r=p(2);return I(r.downloadLicenseSettingsTemplate(n))}),y(2,"app-icon",13),c(3,"span"),v(4),h(5,"transloco"),d()(),c(6,"button",36),x("click",function(n){E(e);let r=p(2);return I(r.downloadDocumentLicenseTemplate(n))}),y(7,"app-icon",13),c(8,"span"),v(9),h(10,"transloco"),d()()()}if(i&2){let e=p(2);s(),W("disabled",e.isUploading),s(3),D(C(5,6,"common.import.download_license_settings_template")),s(2),W("disabled",e.isUploading),s(3),D(C(10,8,"common.import.download_license_documents_template"))}}function u_(i,o){if(i&1&&(c(0,"form",4)(1,"div")(2,"div",6)(3,"p",7),v(4),h(5,"transloco"),d(),u(6,t_,5,5,"button",8),d(),u(7,r_,8,3),u(8,a_,7,4,"div",9),d(),c(9,"div"),u(10,s_,3,3,"span",10),u(11,p_,28,19,"div",11),u(12,m_,11,10,"div"),d()()),i&2){let e=p();f("formGroup",e.uploadForm),s(4),D(C(5,8,e.templateFields.uploadFormTitle)),s(2),_(e.csvImportKey!==e.csvImportKeys.documentLicense&&e.csvImportKey!==e.csvImportKeys.licenseSettings?6:-1),s(),_(!e.isUploading&&e.csvImportKey===e.csvImportKeys.fileListImport||!e.isUploading&&e.csvImportKey===e.csvImportKeys.documentLicense||!e.isUploading&&e.csvImportKey===e.csvImportKeys.licenseSettings||e.csvImportKey!==e.csvImportKeys.fileListImport&&e.csvImportKey!==e.csvImportKeys.documentLicense?7:-1),s(),_(e.isUploading&&(e.csvImportKey===e.csvImportKeys.fileListImport||e.csvImportKey===e.csvImportKeys.documentLicense)?8:-1),s(2),_(e.extendedModal&&e.csvImportKey!==e.csvImportKeys.fileListImport&&e.csvImportKey!==e.csvImportKeys.documentLicense?10:-1),s(),_(e.extendedModal&&e.csvImportKey!==e.csvImportKeys.fileListImport&&e.csvImportKey!==e.csvImportKeys.documentLicense?11:-1),s(),_(e.csvImportKey===e.csvImportKeys.documentLicense||e.csvImportKey===e.csvImportKeys.licenseSettings?12:-1)}}var cn={downloadTemplate:"common.import.download_template",uploadFileProperties:"common.import.file_properties",fileEncoding:"common.import.file_encoding",fieldSeparator:"common.import.field_separator",textQualifier:"common.import.text_qualifier",escapeChar:"common.import.escape_char"},__={metadata:K({modalTitle:"company_data.metadata_upload.title",uploadFormTitle:"company_data.document_upload",uploadDisclaimer:"common.file_upload_hint"},cn),user:K({modalTitle:"user_management.users.upload_users",uploadFormTitle:"company_data.document_upload",uploadDisclaimer:"common.file_upload_hint"},cn),fileListImport:K({modalTitle:"search.import_file_list",uploadFormTitle:"company_data.document_upload",uploadDisclaimer:"common.file_upload_hint"},cn),documentLinks:K({modalTitle:"licenses.document_management.import_title",uploadFormTitle:"company_data.document_upload",uploadDisclaimer:"common.file_upload_hint_small"},cn),hostedFiles:K({modalTitle:"licenses.hosting_explorer.import_title",uploadFormTitle:"company_data.document_upload",uploadDisclaimer:"common.file_upload_hint_small"},cn),documentLicense:K({modalTitle:"licenses.import_licenses",uploadFormTitle:"company_data.document_upload",uploadDisclaimer:"common.file_upload_hint_small"},cn)},h_=[pe.documentLicense,pe.documentLinks,pe.hostedFiles,pe.metadata,pe.user,pe.documentLicense,pe.licenseSettings],Sl=(()=>{class i{constructor(){this._document=g(di),this.modalService=g(he),this._feedbackService=g(pt),this._fileContentService=g(So),this._hostedFileService=g(so),this._licenseService=g(To),this._metadataService=g(xl),this._renderer=g(Et),this._searchService=g(Jt),this._translocoService=g(ae),this._userService=g(xo),this.showDeleteReports=h_,this.reportSuccess=Ie,this.errorLabels=wt,this.isUploading=!1,this.reportAvailable=!1,this.encodingOptions=[{text:"UTF-8",value:"utf",disabled:!1},{text:"ISO-8859-1",value:"iso",disabled:!1}],this.extendedModal=!0,this.completed=new R,this.csvImportKeys=pe,this._defaultEncoding="utf",this._defaultFieldSeparator=";",this._defaultTextQualifier='"',this._defaultEscapeChar='"',this.uploadForm=new qa({file:new qn(""),encoding:new qn(this._defaultEncoding,[Ve.required]),fieldSeparator:this.createCharControl(this._defaultFieldSeparator),textQualifier:this.createCharControl(this._defaultTextQualifier),escapeChar:this.createCharControl(this._defaultEscapeChar)})}get csvImportKey(){return this._csvImportKey}set csvImportKey(e){if(!Object.values(pe).includes(e))throw new RangeError(`CSV Import type ${e} not found!`);this.numberOfHeaderLines=this.getHeaderLinesForKey(e),this._csvImportKey=e}ngOnInit(){this.templateFields=__[pe[this.csvImportKey]]}onSave(){if(this.errorMessage=void 0,this._file||(this.errorMessage="common.please_choose_a_file"),this.errorMessage){this.isUploading=!1;return}this.uploadForm.valid&&(this.disableForm(),this.isUploading=!0,this._upload=K(K({},this._upload),this.uploadForm.value),this._upload.file=this._file,this.uploadFile(this._upload).subscribe(e=>{if(e)if(Object.hasOwn(e,"errorCode")){e=e;let t;switch(e.errorCode){case Gt.TOO_MANY_REQUESTS:t="common.import.too_many_requests";break;case Gt.CONTENT_TOO_LARGE:t="common.import.file_too_big";break;default:t="common.error";break}this.modalService.close(),this._feedbackService.showErrorModal(t)}else this.showReport(e)}))}onAddUploadFile(e){let t,n=!1;if("target"in e?t=e.target.files:e instanceof FileList&&(t=e),!t)return;let r=t[0];this.fileName=r.name;let a=r.size,l=r.name.split(".").pop().toLowerCase();this.errorMessage=void 0;let m=this.csvImportKey===pe.documentLinks?1048576:52428800;Number(a)>m&&(this.errorMessage="common.import.file_too_big",n=!0),Oa.includes(l)||(this.errorMessage="favorites.description.file_type_not_supported",n=!0),n?(this.fileName=void 0,this._file=void 0):this._file=t[0]}downloadMetadataTemplate(e){this.isUploading||(e.preventDefault(),this.downloadTemplate(this.getTemplate()))}downloadDocumentLicenseTemplate(e){this.isUploading||(e.preventDefault(),this.downloadTemplate(this._licenseService.getCsvTemplate()))}downloadLicenseSettingsTemplate(e){this.isUploading||(e.preventDefault(),this.downloadTemplate(this._licenseService.getCsvTemplateLicenseSettings()))}createLinkAndTriggerDownload(e,t="template.csv"){let n=URL.createObjectURL(e),r=this._renderer.createElement("a");r.href=n,r.download=t,r.click(),this._renderer.removeChild(this._document.body,r)}disableForm(){this.uploadForm.disable()}enableForm(){this.uploadForm.enable()}getHeaderLinesForKey(e){switch(e){case pe.documentLicense:case pe.documentLinks:case pe.licenseSettings:case pe.user:return 0;case pe.fileListImport:return 1;case pe.metadata:return 4;default:return 3}}
17onUploadFailed(){this.report={success:Ie.FALSE,errors:[],numCreated:0,numDeleted:0,numUpdated:0,headline:"common.import.import_failed"},this.reportAvailable=!0,this.reportMessage="common.import.file_could_not_be_parsed",this.isUploading=!1}getTemplate(){switch(this._csvImportKey){case pe.metadata:return this._metadataService.getCsvTemplate(this.metadataWidth);case pe.user:return this._userService.getCsvTemplate();case pe.fileListImport:return M(this._translocoService.getActiveLang()).pipe(Re(e=>this._searchService.getCsvTemplate(e)));case pe.documentLinks:return this._fileContentService.getCsvTemplate();case pe.hostedFiles:return this._hostedFileService.getCsvTemplate();case pe.documentLicense:return this._licenseService.getCsvTemplate();case pe.licenseSettings:return this._licenseService.getCsvTemplateLicenseSettings();default:return M(null)}}uploadFile(e){let t=()=>n=>n.pipe(k(()=>(this.onUploadFailed(),xe)),Si(()=>{this.csvImportKey!==pe.fileListImport&&(this.isUploading=!1,this.enableForm());let r=this.report?.numCreated+this.report?.numUpdated;this.completed.emit(r)}));switch(this._csvImportKey){case pe.metadata:return this._metadataService.uploadCsvFile(e).pipe(t());case pe.user:return this._userService.uploadCsvFile(e).pipe(t());case pe.fileListImport:return this._searchService.uploadCsvFile(e).pipe(t(),Re(({id:n})=>n?this.checkImportStatus(n,null).pipe(ta(r=>[ii.CREATED,ii.RUNNING].includes(r.statusAsString)?this.checkImportStatus(n,r.progress):xe)):xe),S(n=>n?.progress===100&&n.statusAsString!==ii.RUNNING?(this.reportAvailable=!0,this.isUploading=!1,this.progress=0,{success:this.getReportStatus(n.statusAsString),notSuccessful:n.failedImportedAcCodes,errors:this.getErrorReport(n.report),numCreated:n.foundAcCodesCount,numDeleted:0,numUpdated:0,headline:this.getReportStatusText(n.statusAsString,n.failedImportedAcCodes)}):null),Nt());case pe.documentLinks:return this._fileContentService.uploadCsvFile(e).pipe(t());case pe.hostedFiles:return this._hostedFileService.uploadCsvFile(e).pipe(t());case pe.licenseSettings:case pe.documentLicense:return this.importLicense(e).pipe(t());default:return M(null)}}importLicense(e){return this._licenseService.uploadCsvFile(e).pipe(S(t=>{let n=t.templateErrors.length<1?"common.import.import_successful":"common.import.import_failed",r=t.templateErrors.length>0?Ie.FALSE:Ie.TRUE;t.numCreated+t.numUpdated<=0&&(t.notSuccessful===0?(r=Ie.TRUE,n="common.import.import_successful"):(r=Ie.FALSE,n="common.import.import_failed"));let a=t.templateErrors;return{success:r,errors:a.map(m=>({errorCode:m.errorCode,fieldName:m.fieldName,lineNumber:m.lineNumber,errorCodeLabel:m.errorCodeLabel,fieldValue:m.fieldValue})),headline:n,numCreated:t.numCreated,numDeleted:t.numDeleted,numUpdated:t.numUpdated,notSuccessful:t.notSuccessful}}))}getErrorReport(e){return e.map(t=>({fieldName:t.field,lineNumber:t.lineNumber,errorCode:this.mapFileListErrorToDataImportError(t.reason,t.field),errorCodeLabel:t.source}))}mapFileListErrorToDataImportError(e,t=null){switch(e){case ki.EMPTY:return t?wt.empty_with_fieldName:wt.empty;case ki.WRONG_HEADERS:return wt.wrong_headers;case ki.NOT_FOUND:return wt.not_found_with_source;case ki.INVALID:return wt.field_value_invalid_with_source;case ki.EXCEEDS_SEARCH_RESULTS_THRESHOLD:return wt.search_results_exceeded_threshold;default:return wt.unknown_error_with_source}}getReportStatus(e){return e===ii.SUCCESSFUL?Ie.TRUE:e===ii.PARTIALLY_SUCCESSFUL?Ie.PARTIALLY:Ie.FALSE}getReportStatusText(e,t){return e===ii.SUCCESSFUL&&t===0?"common.import.import_successful":e===ii.PARTIALLY_SUCCESSFUL||e===ii.SUCCESSFUL&&t>0?"common.import.import_partially_successful":"common.import.import_failed"}checkImportStatus(e,t=null){let n=t<90?3500:5e3;return this._searchService.checkImportStatus(e).pipe(Pt(n),V(r=>{r&&(this.progress=r.progress)}))}showReport(e){this.report=e,this.reportAvailable=!0}createCharControl(e){return new qn(e,[Ve.required,Ve.minLength(1),Ve.maxLength(1)])}downloadTemplate(e){e.pipe(k(()=>(this._feedbackService.showErrorModal(),xe))).subscribe(t=>{if(t)if(t instanceof Ea){let n=ne.getFilenameFromContentDisposition(t)||"template.csv";this.createLinkAndTriggerDownload(t.body,n)}else{let n=new Blob([t],{type:"text/csv"});this.createLinkAndTriggerDownload(n,"template.csv")}})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-csv-upload-modal"]],inputs:{extendedModal:"extendedModal",report:"report",metadataWidth:"metadataWidth",csvImportKey:"csvImportKey"},outputs:{completed:"completed"},decls:5,vars:8,consts:[["fileInput",""],[3,"border","modalTitle"],[1,"modal-body"],[3,"csvImportKey","numberOfHeaderLines","reportMessage","report"],[1,"container-upload",3,"formGroup"],["saveButtonText","common.upload",3,"cancelButtonClick","saveButtonClick","cancelButtonText","isBusy","isCancelButtonVisible","isSaveButtonVisible"],[1,"upload-header"],["for","upload",1,"label-bold-top"],["data-cy","downloadTemplate","type","button",1,"btn-icon-text",3,"disabled"],[1,"upload"],[1,"label-bold"],[1,"file-properties"],["data-cy","downloadTemplate","type","button",1,"btn-icon-text",3,"click"],["name","cloud-download"],["dragAndDrop","",1,"upload-file-container",3,"click","fileDropped","keydown.enter"],[1,"upload-disclaimer"],["data-cy","iconFileUpload","name","cloud-upload"],["data-cy","uploadMessage",1,"upload-disclaimer-message"],["data-cy","fileName"],["accept",".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel","data-cy","uploadFile","formControlName","file","hidden","","type","file",3,"change"],["data-cy","noFileErrorMessage",1,"text-alert"],["name","document",1,"icon-inactive"],[1,"content-row"],["for","encoding",1,"mandatory"],[1,"option"],["data-cy","encoding","formControlName","encoding","id","encoding",3,"items"],["for","field-separator",1,"mandatory"],["data-cy","fieldSeparator","formControlName","fieldSeparator","id","field-separator","type","text",1,"single-char",3,"limitInput"],["data-cy","fieldSeparatorErrorMessage",1,"text-alert"],["for","text-qualifier",1,"mandatory"],["data-cy","textQualifier","formControlName","textQualifier","id","text-qualifier","type","text",1,"single-char",3,"limitInput"],["data-cy","textQualifierErrorMessage",1,"text-alert"],["for","escape-char",1,"mandatory"],["data-cy","escapeChar","formControlName","escapeChar","id","escape-char","type","text",1,"single-char",3,"limitInput"],["data-cy","escapeCharErrorMessage",1,"text-alert"],["data-cy","downloadSettingsTemplate","type","button",1,"btn-icon-text",3,"click"],["data-cy","downloadLicensesTemplate","type","button",1,"btn-icon-text",3,"click"]],template:function(t,n){t&1&&(y(0,"app-modal-header",1),c(1,"div",2),u(2,e_,1,4,"app-import-report",3),u(3,u_,13,10,"form",4),d(),c(4,"app-modal-footer",5),x("cancelButtonClick",function(){return n.modalService.dismiss()})("saveButtonClick",function(){return n.onSave()}),d()),t&2&&(f("border",!n.reportAvailable)("modalTitle",n.reportAvailable?"common.import.protocol":n.templateFields.modalTitle),s(2),_(n.reportAvailable?2:-1),s(),_(n.reportAvailable?-1:3),s(),f("cancelButtonText",n.reportAvailable?"common.close":"common.cancel")("isBusy",n.isUploading)("isCancelButtonVisible",!(n.csvImportKey===n.csvImportKeys.fileListImport&&n.isUploading))("isSaveButtonVisible",!n.reportAvailable))},dependencies:[an,j,yl,js,Me,we,Ne,Ye,it,Te,ye,Ee,De,Qe,z,xt,$,fo],styles:[".container-upload[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer)}.container-upload[_ngcontent-%COMP%] .upload-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.container-upload[_ngcontent-%COMP%] .file-properties[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:calc(var(--spacer) * 1.5);margin-top:var(--spacer)}.container-upload[_ngcontent-%COMP%] .file-properties[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%]{display:flex}.container-upload[_ngcontent-%COMP%] .file-properties[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%], .container-upload[_ngcontent-%COMP%] .file-properties[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] .option[_ngcontent-%COMP%]{flex:1}.container-upload[_ngcontent-%COMP%] .file-properties[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] .option[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:25%}.container-upload[_ngcontent-%COMP%] .file-properties[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] .option[_ngcontent-%COMP%] app-select[_ngcontent-%COMP%]{width:50%}.container-upload[_ngcontent-%COMP%] .upload[_ngcontent-%COMP%]{align-items:center;border-top:var(--border);display:flex;padding-top:var(--spacer)}"]})}}return i})();var Vr=(function(i){return i.Successor="as_successor",i.WithdrawOriginalRecord="withdraw_original_record",i})(Vr||{});function f_(i,o){if(i&1){let e=w();c(0,"div"),y(1,"app-modal-header",0),c(2,"div",1)(3,"form",2),x("ngSubmit",function(){E(e);let n=p();return I(n.onSave())}),c(4,"div",3),y(5,"app-checkbox",4)(6,"app-checkbox",5),d()(),c(7,"div",6),v(8),h(9,"transloco"),d()(),c(10,"app-modal-footer",7),h(11,"transloco"),x("cancelButtonClick",function(){E(e);let n=p();return I(n.modalService.dismiss())})("saveButtonClick",function(){E(e);let n=p();return I(n.onSave())}),d()()}if(i&2){let e=p();s(3),f("formGroup",e.checkboxForm),s(5),D(C(9,4,"company_data.duplication.note")),s(2),f("saveButtonText",C(11,6,"common.create"))("border",!1)}}var Tl=(()=>{class i{constructor(){this.modalService=g(he),this._formBuilder=g(dt),this.type=new R,this.isCu
17stomerStandard=!1}ngOnInit(){let e=Object.values(Vr).reduce((t,n)=>(t[n]=new je({value:!1,disabled:!this.isCustomerStandard}),t),{});this.checkboxForm=this._formBuilder.group({types:this._formBuilder.group(e)})}onSave(){let e=Object.entries(this.checkboxForm.value.types).filter(([,t])=>t).map(([t])=>t);this.modalService.close(e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-metadata-duplicate-modal"]],outputs:{type:"type"},decls:1,vars:1,consts:[["modalTitle","company_data.duplication.modal_title"],[1,"modal-body"],[3,"ngSubmit","formGroup"],["formGroupName","types"],["formControlName","as_successor","label","company_data.duplication.as_successor","data-cy","copyAsSuccessor"],["formControlName","withdraw_original_record","label","company_data.duplication.withdraw_original_record","data-cy","withdrawOriginal"],["data-cy","infoBox",1,"box-info"],[3,"cancelButtonClick","saveButtonClick","saveButtonText","border"]],template:function(t,n){t&1&&u(0,f_,12,8,"div"),t&2&&_(n.isCustomerStandard!==void 0?0:-1)},dependencies:[yt,Me,we,Ne,Ye,Te,ye,Ee,De,Qi,z,$],encapsulation:2})}}return i})();var Dl=(i,o)=>({config:i,form:o}),El=(i,o)=>({field:i,form:o}),g_=i=>({minVal:i});function C_(i,o){i&1&&vt(0)}function v_(i,o){i&1&&vt(0)}function b_(i,o){i&1&&vt(0)}function y_(i,o){if(i&1&&(c(0,"div"),Y(1,b_,1,0,"ng-container",8),d()),i&2){let e=p().$implicit,t=p().form;p();let n=X(20);s(),f("ngTemplateOutlet",n)("ngTemplateOutletContext",ht(2,El,e,t))}}function x_(i,o){i&1&&vt(0)}function S_(i,o){if(i&1&&(c(0,"div"),Y(1,x_,1,0,"ng-container",8),d()),i&2){let e=p().$implicit,t=p().form;p();let n=X(22);s(),f("ngTemplateOutlet",n)("ngTemplateOutletContext",ht(2,El,e,t))}}function T_(i,o){if(i&1&&(c(0,"div"),y(1,"textarea",13),d()),i&2){let e=p().$implicit;s(),f("id",e.formControlName)("formControlName",e.formControlName),P("data-cy",e.formControlName)}}function D_(i,o){if(i&1&&(c(0,"div",11)(1,"label",12),v(2),h(3,"transloco"),d(),Ue(4),u(5,y_,2,5,"div")(6,S_,2,5,"div")(7,T_,2,3,"div"),Be(),d()),i&2){let e,t=o.$implicit;s(),W("mandatory",t.mandatory),f("for",t.formControlName),s(),F(" ",C(3,5,t.text)," "),s(3),_((e=t.component)==="input"?5:e==="dropdown"?6:e==="textarea"?7:-1)}}function E_(i,o){if(i&1&&(Ue(0,10),G(1,D_,8,7,"div",11,J),Be()),i&2){let e=o.config,t=o.form;f("formGroup",t),s(),q(e)}}function I_(i,o){if(i&1&&(c(0,"p",15),v(1),h(2,"transloco"),d()),i&2){let e=p(2).field;P("data-cy",e.formControlName+"ErrorMessage"),s(),F(" ",C(2,2,"common.please_fill_this_field")," ")}}function F_(i,o){if(i&1&&(c(0,"p",15),v(1),h(2,"transloco"),d()),i&2){let e=p(2).field;P("data-cy",e.formControlName+"ErrorMessage"),s(),F(" ",C(2,2,"common.date_format_with_optional_day_error")," ")}}function M_(i,o){if(i&1&&(c(0,"p",15),v(1),h(2,"transloco"),d()),i&2){let e=p(2).field,t=p();P("data-cy",e.formControlName+"ErrorMessage"),s(),F(" ",de(2,2,"orders.error_greater_than",ie(5,g_,t.minOrderAmount-1))," ")}}function w_(i,o){if(i&1&&(u(0,I_,3,4,"p",15),u(1,F_,3,4,"p",15),u(2,M_,3,7,"p",15)),i&2){let e=p().field,t=p();_(!(t.requestCompanyDataForm.controls[e.formControlName]==null||t.requestCompanyDataForm.controls[e.formControlName].errors==null)&&t.requestCompanyDataForm.controls[e.formControlName].errors.required?0:-1),s(),_(!(t.requestCompanyDataForm.controls[e.formControlName]==null||t.requestCompanyDataForm.controls[e.formControlName].errors==null)&&t.requestCompanyDataForm.controls[e.formControlName].errors.dateFormat?1:-1),s(),_(!(!(t.requestCompanyDataForm.controls[e.formControlName]==null||t.requestCompanyDataForm.controls[e.formControlName].errors==null)&&t.requestCompanyDataForm.controls[e.formControlName].errors.required)&&(!(t.requestCompanyDataForm.controls[e.formControlName]==null||t.requestCompanyDataForm.controls[e.formControlName].errors==null)&&t.requestCompanyDataForm.controls[e.formControlName].errors.min)?2:-1)}}function O_(i,o){if(i&1&&(Ue(0,10),y(1,"input",14),h(2,"transloco"),u(3,w_,3,3),Be()),i&2){let e=o.field,t=p();f("formGroup",t.requestCompanyDataForm),s(),W("invalid",!(t.requestCompanyDataForm.controls[e.formControlName]!=null&&t.requestCompanyDataForm.controls[e.formControlName].valid)),f("type",kt(e.formControlName==="number"?"number":"text"))("id",e.formControlName)("formControlName",e.formControlName)("placeholder",e.inputType==="date"?C(2,11,"common.date_format_with_optional_day"):""),P("inputmode",e.formControlName==="number"?"numeric":"text")("data-cy",e.formControlName),s(2),_(t.requestCompanyDataForm.controls[e.formControlName]!=null&&t.requestCompanyDataForm.controls[e.formControlName].valid?-1:3)}}function P_(i,o){i&1&&(c(0,"span",15),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"common.please_fill_this_field")))}function N_(i,o){if(i&1&&u(0,P_,3,3,"span",15),i&2){let e=p(3).field,t=p();_(!(t.requestCompanyDataForm.controls[e.formControlName]==null||t.requestCompanyDataForm.controls[e.formControlName].errors==null)&&t.requestCompanyDataForm.controls[e.formControlName].errors.required?0:-1)}}function k_(i,o){if(i&1&&(y(0,"app-select",16),u(1,N_,1,1)),i&2){let e=p(2).field,t=p();f("id",e.formControlName)("items",t.documentFormat)("formControlName",e.formControlName)("manualValidation",!0),P("data-cy",e.formControlName),s(),_(!t.requestCompanyDataForm.valid&&!(t.requestCompanyDataForm.controls[e.formControlName]!=null&&t.requestCompanyDataForm.controls[e.formControlName].valid)?1:-1)}}function R_(i,o){i&1&&(c(0,"span",15),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"common.please_fill_this_field")))}function A_(i,o){if(i&1&&u(0,R_,3,3,"span",15),i&2){let e=p(3).field,t=p();_(!(t.requestCompanyDataForm.controls[e.formControlName]==null||t.requestCompanyDataForm.controls[e.formControlName].errors==null)&&t.requestCompanyDataForm.controls[e.formControlName].errors.required?0:-1)}}function L_(i,o){if(i&1&&(y(0,"app-select",16),u(1,A_,1,1)),i&2){let e=p(2).field,t=p();f("id",e.formControlName)("items",t.availableLanguages)("formControlName",e.formControlName)("manualValidation",!0),P("data-cy",e.formControlName),s(),_(!t.requestCompanyDataForm.valid&&!(t.requestCompanyDataForm.controls[e.formControlName]!=null&&t.requestCompanyDataForm.controls[e.formControlName].valid)?1:-1)}}function U_(i,o){i&1&&(c(0,"span",15),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"common.please_fill_this_field")))}function B_(i,o){if(i&1&&u(0,U_,3,3,"span",15),i&2){let e=p(3).field,t=p();_(!(t.requestCompanyDataForm.controls[e.formControlName]==null||t.requestCompanyDataForm.controls[e.formControlName].errors==null)&&t.requestCompanyDataForm.controls[e.formControlName].errors.required?0:-1)}}function V_(i,o){if(i&1&&(y(0,"app-select",16),h(1,"async"),u(2,B_,1,1)),i&2){let e=p(2).field,t=p();f("id",e.formControlName)("items",C(1,6,t.requestTypes$))("formControlName",e.formControlName)("manualValidation",!0),P("data-cy",e.formControlName),s(2),_(!t.requestCompanyDataForm.valid&&!(t.requestCompanyDataForm.controls[e.formControlName]!=null&&t.requestCompanyDataForm.controls[e.formControlName].valid)?2:-1)}}function $_(i,o){if(i&1&&(Ue(0,10),u(1,k_,2,6),u(2,L_,2,6),u(3,V_,3,8),Be()),i&2){let e=p(),t=e.field,n=e.form;f("formGroup",n),s(),_(t.dataSrc==="documentFormat"?1:-1),s(),_(t.dataSrc==="availableLanguages"?2:-1),s(),_(t.dataSrc==="requestTypes"?3:-1)}}function H_(i,o){if(i&1&&u(0,$_,4,4,"ng-container",10),i&2){let e=o.field;_(e.formControlName?0:-1)}}var Il=(()=>{class i{constructor(){this._formBuilder=g(dt),this._tenantStateService=g(gi),this._translocoService=g(ae),this.modalService=g(he),this.minOrderAmount=1,this.companyFieldConfig=[{text:"common.metadata_label.documentNumber",value:null,component:"input",formControlName:"documentNumber",dataSrc:"documentNumber",mandatory:!0},{text:"common.metadata_label.dateOfIssue",value:null,component:"input",formControlName:"dateOfIssue",dataSrc:"dateOfIssue",mandatory:!0,inputType:"date"},{text:"common.metadata_label.titleDynamic",value:null,component:"input",formControlName:"title",dataSrc:"title",mandatory:!0}],this.orderFieldConfig=[{text:"common.count_number",value:null,component:"input",formControlName:"number",mandatory:!0},{text:"common.language",value:null,component:"dropdown",formControlName:"language",dataSrc:"availableLanguages",mandatory:!0},{text:"orders.request.type_of_request",value:null,component:"dropdown",formControlName:"typeOfRequest",dataSrc:"requestTypes",mandatory:!0},{text:"orders.request.format",value:null,component:"dropdown",formControlName:"format",dataSrc:"documentFormat",mandatory:!0},{text:"orders.request.order_number",value:null,component:"input",formControlName:"orderNumber",mandatory:!1},{text:"orders.request.buyer_reference",value:null,component:"input",formControlName:"buyerReference",mandatory:!1},{text:"user_management.cost_center",value:null,component:"input",formControlName:"costCentre",mandatory:!1},{text:"orders.details_on_invoice",value:null,component:"textarea",formControlName:"comment"}],this.documentFormat=ti.getDocumentFormats(),this.availableLanguages=ti.getAvailableLanguages()}ngOnInit(){this.requestCompanyDataForm=this._formBuilder.group({documentNumber:[null,
17nt.touchedRequiredValidator()],dateOfIssue:[null,[nt.touchedRequiredValidator(),nt.touchedDateFormatValidator()]],title:[null,nt.touchedRequiredValidator()],format:[this.documentFormat[0].value],language:[this.availableLanguages[0].value],typeOfRequest:["single_purchase"],number:[1,[nt.touchedRequiredValidator(),Ve.min(1)]],orderNumber:[null,[nt.lengthLimitFn(35)]],buyerReference:[null,[nt.lengthLimitFn(30)]],costCentre:[null,[nt.lengthLimitFn(30)]],comment:[]},{updateOn:"blur"}),this.requestTypes$=this._tenantStateService.tenant$.pipe(S(e=>ti.getDocumentTypes(e,this._translocoService)))}onSave(){this.requestCompanyDataForm.markAllAsTouched(),this.requestCompanyDataForm.updateValueAndValidity(),Object.keys(this.requestCompanyDataForm.controls).forEach(e=>{this.requestCompanyDataForm.get(e).updateValueAndValidity()}),this.requestCompanyDataForm.valid&&this.modalService.close(this.requestCompanyDataForm.value)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-request-company-data-modal"]],decls:23,vars:24,consts:[["contentRowTemplate",""],["inputTemplate",""],["dropdownTemplate",""],[3,"ngSubmit","focusInvalidInput"],["modalTitle","orders.orders_overview.request_company_data",3,"border"],[1,"modal-body","scroll-box"],[1,"title-row"],["name","info","data-cy","licenseInfo",1,"icon-clickable",3,"ngbTooltip"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["saveButtonText","common.request",3,"cancelButtonClick","saveButtonClick"],[3,"formGroup"],[1,"content-row"],[3,"for"],[3,"id","formControlName"],[3,"id","type","formControlName","placeholder"],[1,"text-alert"],[3,"id","items","formControlName","manualValidation"]],template:function(t,n){if(t&1&&(c(0,"form",3),x("ngSubmit",function(){return n.onSave()}),y(1,"app-modal-header",4),c(2,"div",5)(3,"div",6)(4,"h4"),v(5),h(6,"transloco"),d(),y(7,"app-icon",7),h(8,"transloco"),h(9,"transloco"),d(),Y(10,C_,1,0,"ng-container",8),c(11,"div",6)(12,"h4"),v(13),h(14,"transloco"),d()(),Y(15,v_,1,0,"ng-container",8),d(),c(16,"app-modal-footer",9),x("cancelButtonClick",function(){return n.modalService.dismiss()})("saveButtonClick",function(){return n.onSave()}),d()(),Y(17,E_,3,1,"ng-template",null,0,fe)(19,O_,4,13,"ng-template",null,1,fe)(21,H_,1,1,"ng-template",null,2,fe)),t&2){let r=X(18);f("focusInvalidInput",!0),s(),f("border",!0),s(4),D(C(6,10,"company_data.title")),s(2),f("ngbTooltip",C(8,12,"company_data.info_text")),P("aria-label",C(9,14,"company_data.info_text")),s(3),f("ngTemplateOutlet",r)("ngTemplateOutletContext",ht(18,Dl,n.companyFieldConfig,n.requestCompanyDataForm)),s(3),D(C(14,16,"orders.order_data")),s(2),f("ngTemplateOutlet",r)("ngTemplateOutletContext",ht(21,Dl,n.orderFieldConfig,n.requestCompanyDataForm))}},dependencies:[sn,j,Me,we,_e,Ne,Ye,it,Te,ye,Ee,De,Qe,Ft,Yi,z,xt,ct,$],styles:[".modal-body[_ngcontent-%COMP%]{gap:0}.modal-body[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%]{display:flex;margin-bottom:var(--spacer)}.modal-body[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{align-items:center;display:flex;flex:1}.modal-body[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:2}.modal-body[_ngcontent-%COMP%] .title-row[_ngcontent-%COMP%]{display:flex;align-items:end;margin-bottom:calc(var(--spacer) / 2)}.scroll-box[_ngcontent-%COMP%]{height:75vh}"]})}}return i})();var gt=(function(i){return i.HIDDEN="hidden",i.VISIBLE="visible",i})(gt||{}),Eo={additionalState:wa("additionalState",[zo(gt.HIDDEN,oi({"max-width":"0",opacity:"0",visibility:"hidden"})),zo(gt.VISIBLE,oi({"max-width":"880px",opacity:"1",visibility:"visible"})),jo(gt.HIDDEN+" => "+gt.VISIBLE,[Wo([Di("400ms ease-in-out",oi({visibility:"visible"})),Di("600ms ease-in-out",oi({"max-width":"880px"})),Di("800ms ease-in-out",oi({opacity:"1"}))])]),jo(gt.VISIBLE+" => "+gt.HIDDEN,[Wo([Di("400ms ease-in-out",oi({visibility:"hidden"})),Di("600ms ease-in-out",oi({"max-width":"0"})),Di("800ms ease-in-out",oi({opacity:"0"}))])])])};var qe=(function(i){return i[i.UNCHECKED=0]="UNCHECKED",i[i.INDETERMINATE=1]="INDETERMINATE",i[i.CHECKED=2]="CHECKED",i})(qe||{});var K_=(i,o,e)=>
17({"icon-clickable-dark":i,"icon-clickable":o,disabled:e}),Io=(()=>{class i{constructor(){this.disabled=!1,this.fieldValueChange=new R,this.uuid=Fi()}onClick(){if(!this.disabled)switch(this.fieldValue){case 0:case 1:this.fieldValueChange.emit(qe.CHECKED);break;case 2:this.fieldValueChange.emit(qe.UNCHECKED);break}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-tristate-checkbox"]],inputs:{fieldValue:"fieldValue",label:"label",disabled:"disabled"},outputs:{fieldValueChange:"fieldValueChange"},decls:7,vars:12,consts:[[1,"form-group"],["type","checkbox",3,"id"],[1,"checkbox-label",3,"click","keydown.enter","for"],["sprite","icons-small","tabindex","0",1,"icon-clickable",3,"name"]],template:function(t,n){t&1&&(c(0,"div",0),y(1,"input",1),c(2,"label",2),x("click",function(){return n.onClick()})("keydown.enter",function(){return n.onClick()}),y(3,"app-icon",3),c(4,"span"),v(5),h(6,"transloco"),d()()()),t&2&&(s(),f("id",n.uuid),s(),f("for",n.uuid),s(),$i(ya(8,K_,n.fieldValue===0,n.fieldValue===2,n.disabled)),f("name",n.fieldValue===0?"checkbox-unchecked":n.fieldValue===1?"checkbox-part-checked":n.fieldValue===2?"checkbox-checked":""),s(2),D(C(6,6,n.label)))},dependencies:[j,z,$],styles:[".form-group[_ngcontent-%COMP%]{align-items:center;display:flex}.form-group[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:calc(var(--spacer) / 4);line-height:1;height:1rem;margin:0;white-space:nowrap}.form-group[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{position:relative;width:1px;height:1px;margin:0;opacity:0;pointer-events:auto}.form-group[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus{border-radius:var(--border-radius);box-shadow:0 0 0 .12rem var(--color-focus);outline:none;z-index:4}.form-group[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is([type=radio]){border:none;border-radius:50%}.form-group[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is(.btn-icon,.nautos-select){z-index:unset}"]})}}return i})();var G_=["menuWrapper"],Fl=(()=>{class i{constructor(){this.additionalState=gt.HIDDEN,this.selectAllCheckbox=0,this.selectAll=new R,this.deselectAll=new R}set selectState(e){this.selectAllCheckbox=e,this.animateToggleButtons()}changeSelectStateAll(e){this.selectAllCheckbox=e,this.selectAllCheckbox===qe.CHECKED?this.selectAll.emit():this.selectAllCheckbox===qe.UNCHECKED&&this.deselectAll.emit(),this.animateToggleButtons()}animateToggleButtons(){this.selectAllCheckbox===qe.UNCHECKED?this.additionalState=gt.HIDDEN:this.additionalState=gt.VISIBLE}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-tree-menu"]],contentQueries:function(t,n,r){if(t&1&&It(r,ln,5),t&2){let a;le(a=ce())&&(n.selectedTemplate=a.first)}},viewQuery:function(t,n){if(t&1&&Ge(G_,5),t&2){let r;le(r=ce())&&(n.menuWrapper=r.first)}},inputs:{selectState:"selectState"},outputs:{selectAll:"selectAll",deselectAll:"deselectAll"},decls:7,vars:3,consts:[["menuWrapper",""],[1,"result-action-row"],[1,"checkbox-wrapper"],["label","common.select_all","fieldId","selectAllCheckbox","data-cy","selectAllFolders",3,"fieldValueChange","fieldValue"],["id","js-menu-container",1,"menu-container"],["placement","bottom",1,"slide-in-row"],[3,"ngTemplateOutlet"]],template:function(t,n){t&1&&(c(0,"div",1,0)(2,"div",2)(3,"app-tristate-checkbox",3),x("fieldValueChange",function(a){return n.changeSelectStateAll(a)}),d()(),c(4,"div",4)(5,"div",5),y(6,"div",6),d()()()),t&2&&(s(3),f("fieldValue",n.selectAllCheckbox),s(),f("@additionalState",n.additionalState),s(2),f("ngTemplateOutlet",n.selectedTemplate.menuAnimatedButtons))},dependencies:[Oe,Ft,Io],styles:[".result-action-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacer);padding-block:calc(var(--spacer) / 2)}.result-action-row[_ngcontent-%COMP%] .collapse-spacer[_ngcontent-%COMP%]{padding-left:calc(var(--spacer) * 1.5)}@media(width<=48rem){.result-action-row[_ngcontent-%COMP%] .collapse-spacer[_ngcontent-%COMP%]{padding-left:0}}.result-action-row[_ngcontent-%COMP%] .checkbox-wrapper[_ngcontent-%COMP%]{margin-block:var(--spacer);margin-left:var(--spacer)}.menu-container[_ngcontent-%COMP%]{white-space:nowrap;scrollbar-width:none}.menu-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}"],data:{animation:[Eo.additionalState]}})}}return i})();function q_(i,o){i&1&&y(0,"div",1)}function W_(i,o){if(i&1){let e=w();c(0,"app-tristate-checkbox",6),x("fieldValueChange",function(n){E(e);let r=p(2);return I(r.changeSelectStateAll(n))}),d()}if(i&2){let e=p(2);f("fieldValue",e.selectAllCheckbox)}}function z_(i,o){if(i&1&&(c(0,"div",2),u(1,W_,1,1,"app-tristate-checkbox",5),d()),i&2){let e=p();s(),_(e.inline?-1:1)}}var $r=(()=>{class i extends Fl{constructor(){super(),this.inline=!1,this.hasCheckbox=!0,this.isExpandedTable=!1,this.animationStart=new R,this.animationDone=new R,this.additionalState=gt.HIDDEN,this.selectAllCheckbox=0}ngOnChanges(e){for(let t in e)t==="appTable"&&e[t].currentValue&&(this.stateChangeSubscription=this.appTable.stateChange.subscribe(n=>{let r=document.getElementsByTagName("app-hitlist");if(r&&r.length>0){let l=r[0].querySelector(".menu-container");l&&(l.style.overflowY="hidden")}this.additionalState===gt.HIDDEN&&n.selectedCount>0?this.additionalState=gt.VISIBLE:this.additionalState===gt.VISIBLE&&n.selectedCount<1&&(document.getElementById("js-menu-container")&&(document.getElementById("js-menu-container").style["overflow-y"]="auto"),this.additionalState=gt.HIDDEN)}))}ngOnDestroy(){this.stateChangeSubscription&&this.stateChangeSubscription.unsubscribe()}changeSelectStateAll(e){this.appTable&&(this.selectAllCheckbox=e===qe.CHECKED||e===qe.INDETERMINATE?qe.CHECKED:qe.UNCHECKED,e===qe.UNCHECKED?this.appTable.onDeselectAll():this.appTable.onSelectAll())}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-table-menu"]],contentQueries:function(t,n,r){if(t&1&&It(r,ln,5),t&2){let a;le(a=ce())&&(n.selectedTemplate=a.first)}},inputs:{appTable:"appTable",inline:"inline",hasCheckbox:"hasCheckbox",isExpandedTable:"isExpandedTable"},outputs:{animationStart:"animationStart",animationDone:"animationDone"},features:[$o,Ct],decls:7,vars:5,consts:[[1,"result-action-row"],[1,"collapse-spacer"],[1,"checkbox-wrapper"],[1,"slide-in-row"],[3,"ngTemplateOutlet"],["label","common.select_all","data-cy","selectAll",3,"fieldValue"],["label","common.select_all","data-cy","selectAll",3,"fieldValueChange","fieldValue"]],template:function(t,n){t&1&&(c(0,"div",0),u(1,q_,1,0,"div",1),u(2,z_,2,1,"div",2),c(3,"div"),x("@additionalState.start",function(a){return n.animationStart.emit(a)})("@additionalState.done",function(a){return n.animationDone.emit(a)}),c(4,"div",3),vt(5,4),d()(),vt(6,4),d()),t&2&&(s(),_(n.isExpandedTable?1:-1),s(),_(n.hasCheckbox?2:-1),s(),f("@additionalState",n.additionalState),s(2),f("ngTemplateOutlet",n.selectedTemplate.menuAnimatedButtons),s(),f("ngTemplateOutlet",n.selectedTemplate.menuStaticButtons))},dependencies:[Oe,Ft,Io],styles:["table[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{background-color:var(--color-gray-light);color:light-dark(var(--color-primary-dark),white);font-family:var(--font-family-bold);height:3rem;z-index:10}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding-left:calc(var(--spacer) / 2)}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.button-column[_ngcontent-%COMP%]{width:3rem;height:3rem}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:has(.btn-filter,.icon-cl
17ickable-dark){padding:calc(var(--spacer) / 8)}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] .sorting[_ngcontent-%COMP%]{display:flex;align-items:center}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] .sorting[_ngcontent-%COMP%]:has(.open) > [_ngcontent-%COMP%]:last-child{color:var(--color-primary)}table[_ngcontent-%COMP%] thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:5}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{color:var(--color-text)}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]:not(:last-child){border-bottom:var(--border)}.border-left[_ngcontent-%COMP%]{border-left:var(--border)}td[_ngcontent-%COMP%]{padding:calc(var(--spacer) / 2)}td[_ngcontent-%COMP%]:has(.btn-icon){padding:calc(var(--spacer) / 8)}.narrow[_ngcontent-%COMP%]{width:10%}.wide[_ngcontent-%COMP%]{width:25%}",".result-action-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacer);padding-block:calc(var(--spacer) / 2)}.result-action-row[_ngcontent-%COMP%] .collapse-spacer[_ngcontent-%COMP%]{padding-left:calc(var(--spacer) * 1.5)}@media(width<=48rem){.result-action-row[_ngcontent-%COMP%] .collapse-spacer[_ngcontent-%COMP%]{padding-left:0}}.result-action-row[_ngcontent-%COMP%] .checkbox-wrapper[_ngcontent-%COMP%]{margin-block:var(--spacer);margin-left:var(--spacer)}.menu-container[_ngcontent-%COMP%]{white-space:nowrap;scrollbar-width:none}.menu-container[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}"],data:{animation:[Eo.additionalState]}})}}return i})();var j_=["row"],Y_=["appTableRow",""],Ml=i=>({selected:i}),Q_=i=>({item:i}),Z_=(i,o)=>({col:i,item:o}),J_=(i,o)=>({item:i,currentRow:o});function X_(i,o){if(i&1){let e=w();c(0,"td")(1,"button",4),h(2,"transloco"),h(3,"transloco"),h(4,"transloco"),h(5,"transloco"),x("click",function(n){E(e);let r=p();return I(r.onExpandRow(n))}),y(6,"app-icon",5),d()()}if(i&2){let e=p();s(),f("ngbTooltip",e.expanded?C(2,3,"common.collapse"):C(3,5,"common.expand")),P("aria-label",e.expanded?C(4,7,"common.collapse"):C(5,9,"common.expand")),s(5),f("direction",e.expanded?"down":"right")}}function eh(i,o){i&1&&y(0,"app-checkbox",6)}function th(i,o){}function ih(i,o){if(i&1&&(c(0,"td",2),u(1,eh,1,0,"app-checkbox",6)(2,th,0,0),d()),i&2){let e=p();f("formGroup",e.selectedForm),s(),_(!e.item.isReadonlyLicense&&!e.item.isSystemGroup&&!e.hideCheckboxes&&!e.item.isDefault?1:2)}}function nh(i,o){if(i&1&&(c(0,"td",2),y(1,"input",7),d()),i&2){let e=p();f("formGroup",e.selectedRadioForm),s(),f("value",e.item)}}function oh(i,o){if(i&1&&(c(0,"td"),y(1,"div",8),d()),i&2){let e=p();s(),f("ngTemplateOutlet",e.contextMenuTemplate)("ngTemplateOutletContext",ie(2,Q_,e.item))}}function rh(i,o){if(i&1&&(y(0,"span",10),h(1,"formatTableItem")),i&2){let e=p().$implicit,t=p();f("textContent",C(1,2,t.item[e.itemProperty])),P("data-cy",e.itemProperty)}}function ah(i,o){if(i&1&&(y(0,"span",10),h(1,"internationalRelationshipOutput")),i&2){let e=p().$implicit,t=p();f("textContent",C(1,2,t.item[e.itemProperty])),P("data-cy",e.itemProperty)}}function sh(i,o){if(i&1&&y(0,"span",10),i&2){let e=o.$implicit,t=o.$index,n=o.$count,r=p(2).$implicit;f("textContent",e.value+(t===n-1?"":", ")),P("data-cy",r.itemProperty)}}function lh(i,o){if(i&1&&G(0,sh,1,2,"span",10,J),i&2){let e=p(2);q(e.item.customFields)}}function ch(i,o){if(i&1&&vt(0,8),i&2){let e=p().$implicit,t=p();f("ngTemplateOutlet",e.cellTemplate)("ngTemplateOutletContext",ht(2,Z_,e,t.item))}}function dh(i,o){if(i&1){let e=w();c(0,"td",9),x("click",function(){let n=E(e).$implicit,r=p();return I(n.itemProperty!=="fullTextDocument"&&r.onCellClick())})("keydown",function(n){E(e);let r=p();return I(r.onKeyDown(n))}),u(1,rh,2,4,"span",10),u(2,ah,2,4,"span",10),u(3,lh,2,0),u(4,ch,1,5,"ng-container",8),d()}if(i&2){let e=o.$implicit,t=p();f("ngClass",e.styleClasses),s(),_(!e.cellTemplate&&e.itemProperty!=="internationalRelationship"?1:-1),s(),_(e.itemProperty==="internationalRelationship"?2:-1),s(),_(e.itemProperty==="custom_field"&&t.item.customFields.length>0?3:-1),s(),_(e.cellTemplate?4:-1)}}function ph(i,o){if(i&1&&(c(0,"tr",3),y(1,"td"),c(2,"td",11),y(3,"div",8),d()()),i&2){let e=p();f("ngClass",ie(5,Ml,e.selectedFormGroup.value)),s(),P("colspan",e.customColSpan??3),s(),P("colspan",e.columns.length+e.customColSpan),s(),f("ngTemplateOutlet",e.expandTemplate)("ngTemplateOutletContext",ht(7,J_,e.item,e.currentRow))}}var Hr=(()=>{class i{constructor(){this._formBuilder=g(dt),this._changeDetectorRef=g(ze),this.hideCheckboxes=!1,this.showInlineSearch=!0,this.selectStatusChange=new R,this.selectRadioStatusChange=new R,this.cellClick=new R,this._expanded=!1,this._componentActive=!0,this.currentRow=this}set expanded(e){this._expanded=e,this._changeDetectorRef.markForCheck()}get expanded(){return this._expanded}get selectedFormGroup(){return this.selectedForm.get("selected")}get selectedRadioFormGroup(){return this.selectedRadioForm.get("selected")}ngOnInit(){this.selectedForm=this._formBuilder.group({selected:this._formBuilder.control(!1)}),this.selectedRadioForm=this._formBuilder.group({selected:this._formBuilder.control(!1)}),this.selectedRadioFormGroup.valueChanges.pipe(me(()=>this._componentActive)).subscribe(()=>{this.selectRadioStatusChange.emit(this.selectedFormGroup.value)}),this.selectedFormGroup.valueChanges.pipe(me(()=>this._componentActive)).subscribe(()=>{this.selectStatusChange.emit(this.selectedFormGroup.value)})}onCellClick(){this.cellClick.emit(this.item)}onKeyDown(e){(e.key==="Enter"||e.key===" ")&&this.onCellClick()}onExpandRow(e){e.stopPropagation(),this.expanded=!this.expanded,this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._componentActive=!1}isItemHidden(e){return e.isReadonlyLicense||e.isSystemGroup||e.isDynamicGroup&&!this.showDynamicGroupControl||e.isSelectable!==null&&e.isSelectable!==void 0&&!e.isSelectable||e.hasCheckbox!==null&&e.hasCheckbox!==void 0&&!e.hasCheckbox}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["","appTableRow",""]],viewQuery:function(t,n){if(t&1&&Ge(j_,5),t&2){let r;le(r=ce())&&(n.rowElementRef=r.first)}},inputs:{item:"item",index:"index",hasExpandedRow:"hasExpandedRow",hasCheckboxColumn:"hasCheckboxColumn",hideCheckboxes:"hideCheckboxes",hasRadioButtonColumn:"hasRadioButtonColumn",hasExtraIconColumn:"hasExtraIconColumn",showInlineSearch:"showInlineSearch",showDynamicGroupControl:"showDynamicGroupControl",expandTemplate:"expandTemplate",contextMenuTemplate:"contextMenuTemplate",columns:"columns",customColSpan:"customColSpan"},outputs:{selectStatusChange:"selectStatusChange",selectRadioStatusChange:"selectRadioStatusChange",cellClick:"cellClick"},attrs:Y_,decls:9,vars:9,consts:[["row",""],[3,"ngClass","id"],[3,"formGroup"],[3,"ngClass"],["type","button","data-cy","toggleMiniDetails",1,"btn-icon",3,"click","ngbTooltip"],["name","chevron",3,"direction"],["formControlName","selected","data-cy","tableRowCheckbox"],["formControlName","selected","type","radio","name","selected","data-cy","tableRowRadio",1,"form-check-input",3,"value"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"click","keydown","ngClass"],[1,"link","ellipsicated",3,"textContent"],["colspan","20"]],template:function(t,n){t&1&&(c(0,"tr",1,0),u(2,X_,7,11,"td"),u(3,ih,3,2,"td",2),u(4,nh,2,2,"td",2),u(5,oh,2,4,"td"),G(6,dh,5,5,"td",3,J),d(),u(8,ph,4,10,"tr",3)),t&2&&(f("ngClass",ie(7,Ml,n.selectedFormGroup.value))("id",n.item.id),s(2),_(n.hasExpandedRow?2:-1),s(),_(n.hasCheckboxColumn?3:-1),s(),_(n.hasRadioButtonColumn?4:-1),s(),_(n.hasExtraIconColumn?5:-1),s(),q(n.columns),s(2),_(n.hasExpandedRow&&n.expanded?8:-1))},dependencies:[lt,_e,j,Ne,it,Wn,Te,ye,Ee,De,yt,Ft,$,Qs,po],styles:["table[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{background-color:var(--color-gray-light);color:light-dark(var(--color-primary-dark),white);font-family:var(--font-family-bold);height:3rem;z-index:10}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding-left:calc(var(--spacer) / 2)}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.button-column[_ngcontent-%COMP%]{width:3rem;height:3rem}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:has(.btn-filter,.icon-cl
17ickable-dark){padding:calc(var(--spacer) / 8)}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] .sorting[_ngcontent-%COMP%]{display:flex;align-items:center}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] .sorting[_ngcontent-%COMP%]:has(.open) > [_ngcontent-%COMP%]:last-child{color:var(--color-primary)}table[_ngcontent-%COMP%] thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:5}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{color:var(--color-text)}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]:not(:last-child){border-bottom:var(--border)}.border-left[_ngcontent-%COMP%]{border-left:var(--border)}td[_ngcontent-%COMP%]{padding:calc(var(--spacer) / 2)}td[_ngcontent-%COMP%]:has(.btn-icon){padding:calc(var(--spacer) / 8)}.narrow[_ngcontent-%COMP%]{width:10%}.wide[_ngcontent-%COMP%]{width:25%}"]})}}return i})();var Qt=(function(i){return i[i.SORT=0]="SORT",i[i.DEFAULT=1]="DEFAULT",i})(Qt||{});var mh=["tableExpand"],uh=["tableExpandColumnHeader"],_h=["tableCheckboxColumnHeader"],hh=["tableContextMenu"],fh=i=>({"sticky-header":i}),gh=i=>({hide:i}),Mn=i=>({"background-color":i}),Ch=i=>({column:i});function vh(i,o){i&1&&v(0," \xA0\xA0\xA0 ")}function bh(i,o){if(i&1&&(c(0,"th",4,1),u(2,vh,1,0),y(3,"div",6),d()),i&2){let e=p();f("ngStyle",ie(3,Mn,e.tableHeaderBackgroundColor)),s(2),_(e.expandColumnHeaderTemplate?-1:2),s(),f("ngTemplateOutlet",e.expandColumnHeaderTemplate)}}function yh(i,o){if(i&1){let e=w();c(0,"span",9),x("click",function(){E(e);let n=p();return I(n.onOpenSettings())})("keydown.enter",function(){E(e);let n=p();return I(n.onOpenSettings())}),d()}}function xh(i,o){if(i&1&&y(0,"th",4),i&2){let e=p();f("ngStyle",ie(1,Mn,e.tableHeaderBackgroundColor))}}function Sh(i,o){if(i&1&&y(0,"th",4),i&2){let e=p();f("ngStyle",ie(1,Mn,e.tableHeaderBackgroundColor))}}function Th(i,o){i&1&&y(0,"app-icon",14)}function Dh(i,o){if(i&1&&y(0,"app-icon",15),i&2){let e=p(4);f("direction",e.sortAsc?"up":"down")}}function Eh(i,o){if(i&1&&(u(0,Th,1,0,"app-icon",14),u(1,Dh,1,1,"app-icon",15)),i&2){let e=p(2).$implicit,t=p();_(e.itemProperty!==t.sortBy?0:-1),s(),_(e.itemProperty===t.sortBy?1:-1)}}function Ih(i,o){if(i&1&&(c(0,"div",11),y(1,"span",13),h(2,"transloco"),u(3,Eh,2,2),d()),i&2){let e=p().$implicit;s(),f("textContent",C(2,2,e.columnText)),s(2),_(e!=null&&e.sortable?3:-1)}}function Fh(i,o){if(i&1&&y(0,"span",12),i&2){let e=p().$implicit;f("ngTemplateOutlet",e.headerTemplate)("ngTemplateOutletContext",ie(2,Ch,e))}}function Mh(i,o){if(i&1){let e=w();c(0,"th",10),x("click",function(n){let r=E(e).$implicit,a=p();return I(a.onHeaderClick(r,n))}),u(1,Ih,4,4,"div",11),u(2,Fh,1,4,"span",12),d()}if(i&2){let e=o.$implicit,t=p();Zt("width",e.columnWidth,"px")("min-width",e.columnWidth,"px"),W("center",e.centerTableHeader)("clickable",e.sortable),f("ngStyle",ie(12,Mn,t.tableHeaderBackgroundColor))("ngClass",e.styleClasses),s(),_(e.headerTemplate?-1:1),s(),_(e.headerTemplate?2:-1)}}function wh(i,o){if(i&1){let e=w();c(0,"tbody",16,2),x("click",function(n){E(e);let r=X(1),a=p();return I(a.onRowClick(r,n))})("selectStatusChange",function(){E(e);let n=X(1),r=p();return I(r.onSelectStatusChange(n))})("selectRadioStatusChange",function(){E(e);let n=X(1),r=p();return I(r.onSelectRadioStatusChange(n))})("cellClick",function(n){E(e);let r=p();return I(r.onCellClick(n))})("keyup",function(n){let r=E(e).$implicit,a=p();return I(a.onCellKeyEnter(n,r))}),d()}if(i&2){let e=o.$implicit,t=o.$index,n=p();f("item",e)("index",t)("hasExpandedRow",n.hasExpandedRow)("hasCheckboxColumn",n.hasCheckboxColumn)("hideCheckboxes",n.hideCheckboxes)("hasRadioButtonColumn",n.hasRadioButtonColumn)("hasExtraIconColumn",n.hasExtraIconColumn)("contextMenuTemplate",n.contextMenuTemplate)("columns",n.columns)("expandTemplate",n.expandTemplate)("customColSpan",n.customColSpan)("showDynamicGroupControl",n.showDynamicGroupControl)}}var Kr=(()=>{class i{constructor(){this._elementRef=g(Ze),this.hasExpandedRow=!1,this.hasCheckboxColumn=!0,this.hideCheckboxes=!1,this.hasRadioButtonColumn=!1,this.hasExtraIconColumn=!1,this.hasStickyHeader=!1,this.sortAsc=!1,this.showDynamicGroupControl
17=!0,this.customColSpan=null,this.resetSelectionAfterItemUpdate=!0,this._items=[],this.headerClick=new R,this.rowClick=new R,this.cellClick=new R,this.stateChange=new R,this.itemsReloaded=new R,this.openSettings=new R,this.rowsSelected=new R,this.selectedRows=[],this.permission=se,this.single=na}get selectAllCheckbox(){return this._selectAllCheckbox}set selectAllCheckbox(e){this._selectAllCheckbox=e}get items(){return this._items}set items(e){this._items=e,this.onReloadDone()}ngOnInit(){this._headerSubscription=this.headerClick.subscribe(e=>this.sortColumn(e.column))}ngOnChanges(e){this.sortBy==="title"&&(this.sortBy="titleDe");for(let t in e){let n=e[t];t==="items"&&(n.isFirstChange()||(this.resetSelectionAfterItemUpdate&&this.resetSelection(),this.collapseAllMiniDetails(),this.triggerStateChange(Qt.DEFAULT)))}}ngOnDestroy(){this._headerSubscription&&this._headerSubscription.unsubscribe()}onHeaderClick(e,t){this.headerClick.emit({column:e,event:t})}onRowClick(e,t){this.rowClick.emit({row:e,event:t})}onCellClick(e){this.cellClick.emit(e)}onCellKeyEnter(e,t){e.key==="Enter"&&this.cellClick.emit(t)}onSelectStatusChange(e){e.selectedFormGroup.value&&this.selectedRows.indexOf(e)<0?this.selectedRows.push(e):!e.selectedFormGroup.value&&this.selectedRows.indexOf(e)>=0&&(this.selectedRows=this.selectedRows.filter(t=>t.index!==e.index)),this.rowsSelected.emit(this.selectedRows),this.triggerStateChange(Qt.DEFAULT)}onSelectRadioStatusChange(e){e.selectedRadioFormGroup.value&&(this.selectedRows=[e]),this.rowsSelected.emit(this.selectedRows),this.triggerStateChange(Qt.DEFAULT)}onSelectAll(){this.rows&&this.rows.forEach(e=>(e.selectedForm.patchValue({selected:!0}),this.selectedRows.includes(e)||this.selectedRows.push(e),e)),this.rowsSelected.emit(this.selectedRows),this.triggerStateChange(Qt.DEFAULT)}onDeselectAll(){this.resetSelection()}onOpenSettings(){this.openSettings.emit()}resetSelection(){this.selectedRows=[],this.rows&&this.rows.forEach(e=>{e.selectedForm.patchValue({selected:!1})}),this.rowsSelected.emit(this.selectedRows),this.triggerStateChange(Qt.DEFAULT)}collapseAllMiniDetails(){this.rows&&this.rows.forEach(e=>{e.expanded=!1})}selectRowSet(e,t){let n=Math.min(e,t),r=Math.max(e,t);for(let a=n;a<=r;a++)this.rows.find(l=>l.index===a).selectedForm.patchValue({selected:!0})}getSelectedStateOfRowWithIndex(e){if(this.rows){let t=this.rows.filter(n=>n.index===e);if(t[0]!==void 0)return t[0].selectedFormGroup.value}return!1}getIndexOfItem(e){let t=-1;for(let n=0;n<this.items.length;n++)if(this.items[n]===e){t=n;break}return t}trackByFn(e){return e}onReloadDone(){this.scrollToTop(),this.itemsReloaded.emit(this.getCurrentTableState(Qt.DEFAULT))}scrollToTop(){this._elementRef.nativeElement.parentElement?.scrollTo({top:0})}triggerStateChange(e){this.stateChange.emit(this.getCurrentTableState(e))}getCurrentTableState(e){let t={};return t.selectedCount=this.selectedRows.length,t.sortAsc=this.sortAsc,t.sortBy=this.sortBy,t.changeType=e,t}sortColumn(e){e&&e.sortable&&(this.sortAsc=this.sortBy===e.itemProperty?!this.sortAsc:!1,this.sortBy=e.itemProperty,this.triggerStateChange(Qt.SORT))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-table"]],contentQueries:function(t,n,r){if(t&1&&It(r,mh,5)(r,uh,5)(r,_h,5)(r,hh,5)(r,ho,4),t&2){let a;le(a=ce())&&(n.expandTemplate=a.first),le(a=ce())&&(n.expandColumnHeaderTemplate=a.first),le(a=ce())&&(n.checkboxColumnHeaderTemplate=a.first),le(a=ce())&&(n.contextMenuTemplate=a.first),le(a=ce())&&(n.columns=a)}},viewQuery:function(t,n){if(t&1&&Ge(Hr,5),t&2){let r;le(r=ce())&&(n.rows=r)}},inputs:{hasExpandedRow:"hasExpandedRow",hasCheckboxColumn:"hasCheckboxColumn",hideCheckboxes:"hideCheckboxes",hasRadioButtonColumn:"hasRadioButtonColumn",hasExtraIconColumn:"hasExtraIconColumn",hasStickyHeader:"hasStickyHeader",tableHeaderBackgroundColor:"tableHeaderBackgroundColor",sortBy:"sortBy",sortAsc:"sortAsc",showDynamicGroupControl:"showDynamicGroupControl",customColSpan:"customColSpan",resetSelectionAfterItemUpdate:"resetSelectionAfterItemUpdate",items:"items"},outputs:{headerClick:"headerClick",rowClick:"rowClick",cellClick:"cellClick",
17stateChange:"stateChange",itemsReloaded:"itemsReloaded",openSettings:"openSettings",rowsSelected:"rowsSelected"},features:[Ct],decls:14,vars:14,consts:[["tableCheckboxColumnHeader",""],["tableExpandColumnHeader",""],["appTableRow",""],[3,"ngClass"],[1,"button-column",3,"ngStyle"],[1,"button-column",3,"ngClass","ngStyle"],[3,"ngTemplateOutlet"],[3,"ngStyle","ngClass","width","minWidth","center","clickable"],["appTableRow","","data-cy","tableRow",3,"item","index","hasExpandedRow","hasCheckboxColumn","hideCheckboxes","hasRadioButtonColumn","hasExtraIconColumn","contextMenuTemplate","columns","expandTemplate","customColSpan","showDynamicGroupControl"],[3,"click","keydown.enter"],[3,"click","ngStyle","ngClass"],[1,"sorting"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"textContent"],["name","chevron","direction","down"],["name","chevron",3,"direction"],["appTableRow","","data-cy","tableRow",3,"click","selectStatusChange","selectRadioStatusChange","cellClick","keyup","item","index","hasExpandedRow","hasCheckboxColumn","hideCheckboxes","hasRadioButtonColumn","hasExtraIconColumn","contextMenuTemplate","columns","expandTemplate","customColSpan","showDynamicGroupControl"]],template:function(t,n){t&1&&(c(0,"table")(1,"thead",3)(2,"tr"),u(3,bh,4,5,"th",4),c(4,"th",5,0),u(6,yh,1,0,"span"),y(7,"div",6),d(),u(8,xh,1,3,"th",4),u(9,Sh,1,3,"th",4),G(10,Mh,3,14,"th",7,Ho),d()(),G(12,wh,2,12,"tbody",8,Ho),d()),t&2&&(s(),f("ngClass",ie(8,fh,n.hasStickyHeader)),s(2),_(n.hasExpandedRow?3:-1),s(),f("ngClass",ie(10,gh,!n.hasCheckboxColumn))("ngStyle",ie(12,Mn,n.tableHeaderBackgroundColor)),s(2),_(n.checkboxColumnHeaderTemplate?-1:6),s(),f("ngTemplateOutlet",n.checkboxColumnHeaderTemplate),s(),_(n.hasRadioButtonColumn?8:-1),s(),_(n.hasExtraIconColumn?9:-1),s(),q(n.columns),s(2),q(n.items))},dependencies:[Hr,lt,Ln,Ft,j,$],styles:["table[_ngcontent-%COMP%]{width:100%}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{background-color:var(--color-gray-light);color:light-dark(var(--color-primary-dark),white);font-family:var(--font-family-bold);height:3rem;z-index:10}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding-left:calc(var(--spacer) / 2)}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th.button-column[_ngcontent-%COMP%]{width:3rem;height:3rem}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:has(.btn-filter,.icon-clickable-dark){padding:calc(var(--spacer) / 8)}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] .sorting[_ngcontent-%COMP%]{display:flex;align-items:center}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] .sorting[_ngcontent-%COMP%]:has(.open) > [_ngcontent-%COMP%]:last-child{color:var(--color-primary)}table[_ngcontent-%COMP%] thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:5}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{color:var(--color-text)}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]:not(:last-child){border-bottom:var(--border)}.border-left[_ngcontent-%COMP%]{border-left:var(--border)}td[_ngcontent-%COMP%]{padding:calc(var(--spacer) / 2)}td[_ngcontent-%COMP%]:has(.btn-icon){padding:calc(var(--spacer) / 8)}.narrow[_ngcontent-%COMP%]{width:10%}.wide[_ngcontent-%COMP%]{width:25%}"]})}}return i})();var Dt=(function(i){return i[i.ADD_TO_FAVORITE_FOLDER=0]="ADD_TO_FAVORITE_FOLDER",i[i.ADD_TO_NOTE_FOLDER=1]="ADD_TO_NOTE_FOLDER",i[i.CHANGE_LOCATION=2]="CHANGE_LOCATION",i[i.CREATE_COMPANY_DATA=3]="CREATE_COMPANY_DATA",i[i.DELETE=4]="DELETE",i[i.EDIT=5]="EDIT",i[i.EDIT_METADATA=6]="EDIT_METADATA",i[i.EDIT_ORDER=7]="EDIT_ORDER",i[i.EXPORT_CSV=8]="EXPORT_CSV",i[i.FAVORITE=9]="FAVORITE",i[i.IMPORT_COMPANY_DATA=10]="IMPORT_COMPANY_DATA",i[i.IMPORT_DATASET=11]="IMPORT_DATASET",i[i.LINK=12]="LINK",i[i.LINK_LICENSE=13]="LINK_LICENSE",i[i.LINK_VIA_ASSIGNMENT_FILE=14]="LINK_VIA_ASSIGNMENT_FILE",i[i.ORDER_NOW=15]="ORDER_NOW",i[i.REJECT_ORDER=16]="REJECT_ORDER",i[i.REQIF_CONVERSION=17]="REQIF_CONVERSION",i[i.REQUEST_COMPANY_DATA=18]="REQUEST_COMPANY_DATA",i[i.REQUEST_ORDER=19]="REQUEST_ORDER",i[i.SET_RELEASED=20]="SET_RELEASED",i[i.SET_DELIVERED=21]="SET_DELIVERED",i[i.SET_ORDERED=22]="SET_ORDERED",i[i.SHOPPING_CART=23]="SHOPPING_CART",i[i.TO_SHOPPING_CART=24]="TO_SHOPPING_CART",i[i.UNLINK_DOCUMENTS_FROM_LICENSE=25]="UNLINK_DOCUMENTS_FROM_LICENSE",i[i.UPLOAD_HOSTED_FILES=26]="UPLOAD_HOSTED_FILES",i})(Dt||{});var Fo=(function(i){return i.DESC="DESC",i.ASC="ASC",i})(Fo||{});var Gr=(function(i){return i.DOCUMENT="Document",i.COLLECTION="Collection",i.METADATA="Metadata",i})(Gr||{});var wl="Nautos Collections License",Mo=class{static isNautosCollectionTitle(o){return o.includes(wl)}static cutNautosCollectionFromTitle(o){return o.replace(wl,"")}static translateNautosCollectionTitle(o,e){return this.isNautosCollectionTitle(o)?e.translate("licenses.document_management.subscription.bestcollection_license")+this.cutNautosCollectionFromTitle(o):o}};function Oh(i,o){if(i&1&&(Ue(0,11),y(1,"app-checkbox",13),Be()),i&2){let e=o.$implicit;s(),f("formControlName",e.id)("label",e.title),P("data-cy",e.title)}}var Ol=(()=>{class i{constructor(){this.modalService=g(he),this._authService=g(ue),this._activeModal=g(fi),this._router=g(mi),this._formBuilder=g(dt),this._licenseService=g(To),this._hostedFilePresignedUrlService=g(lo),this.nautosTitleUtils=Mo,this.files=[],this._hostedFilesPersisted=!1,this._licenseOptions={addLicense:"addLicense",createLicense:"newLicense"}}ngOnInit(){this.description="licenses.create_document_license.description",this.radioButtonText="licenses.create_document_license.add_license",this.licenses=this._licenseService.getLicensesByType(Gr.DOCUMENT).pipe(S(e=>e.filter(t=>!this.nautosTitleUtils.isNautosCollectionTitle(t.title))),V(e=>{!e.length||e.length<1?(this.form.controls.licenseSelect.disable(),this.form.controls.licenseSelect.patchValue(this._licenseOptions.createLicense)):e.forEach(t=>{this.form.get("selectedLicenses").addControl(t.id,this._formBuilder.control(!1))})})),this.form=new Je({licenseSelect:new je(this._licenseOptions.addLicense),selectedLicenses:new Je({})}),this.form.controls.licenseSelect.valueChanges.subscribe(e=>{e==="newLicense"?this.form.get("selectedLicenses").disable():this.form.get("selectedLicenses").enable()})}ngOnDestroy(){if(!this._hostedFilesPersisted){let e=this.files.filter(t=>t.isPending&&t.type===B.FILE_HOSTED);if(e.length>0){let t=this._authService.userInfo;this._hostedFilePresignedUrlService.upsertHostedFiles(e,t,e[0].acCodes[0])}}}onDone(){let e=this.form.get("licenseSelect").value,t=Object.keys(this.form.get("selectedLicenses").controls).filter(n=>this.form.get("selectedLicenses").controls[n].value);if(e===this._licenseOptions.createLicense&&this.files.length>0){let n=localStorage.getItem(qi);this._activeModal.close(),this._router.navigate([`${n}/licenses/create/Document`],{state:{files:this.files}})}else if(e===this._licenseOptions.addLicense&&this.files.length>0&&t.length>0){if(this.din21Ids.length>0){let r=this.din21Ids.filter(l=>!!l),a={licenseIds:t,din21Ids:r};this._licenseService.addDocumentsToLicense(a).subscribe({next:()=>this._activeModal.close({success:!0}),error:()=>this._activeModal.close({success:!1})})}let n=this.files.filter(r=>r.isPending&&r.type===B.FILE_HOSTED);if(n.length>0){n=n.map(a=>(a.licenseIdsToLink=t,a));let r=this._authService.userInfo;this._hostedFilePresignedUrlService.upsertHostedFiles(n,r,n[0].acCodes[0]),this._activeModal.close({success:!0})}}this._hostedFilesPersisted=!0}get din21Ids(){return this.files.filter(e=>!!e.din21Id).map(e=>e.din21Id)}static{this.\u0275fac=function(t){return new(t||i)}}
17static{this.\u0275cmp=L({type:i,selectors:[["app-license-automatic-creation-modal"]],inputs:{files:"files"},decls:22,vars:13,consts:[["modalTitle","licenses.create_document_license.title",3,"border"],[3,"formGroup"],[1,"modal-body"],["for","document-license-description"],["data-cy","addLicense",1,"form-check"],["type","radio","id","add-document-license","formControlName","licenseSelect","value","addLicense",1,"form-check-input"],["for","add-document-license",1,"form-check-label"],["data-cy","setNewLicense",1,"form-check"],["type","radio","id","new-document-license","formControlName","licenseSelect","value","newLicense",1,"form-check-input"],["for","new-document-license",1,"form-check-label"],[1,"scroll-box"],["formGroupName","selectedLicenses"],[3,"cancelButtonClick","saveButtonClick"],[3,"formControlName","label"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),c(1,"form",1)(2,"div",2)(3,"p",3),v(4),h(5,"transloco"),d(),c(6,"div")(7,"div",4),y(8,"input",5),c(9,"label",6),v(10),h(11,"transloco"),d()(),c(12,"div",7),y(13,"input",8),c(14,"label",9),v(15),h(16,"transloco"),d()()(),c(17,"div",10),G(18,Oh,2,3,"ng-container",11,J),h(20,"async"),d()()(),c(21,"app-modal-footer",12),x("cancelButtonClick",function(){return n.modalService.dismiss()})("saveButtonClick",function(){return n.onDone()}),d()),t&2&&(f("border",!0),s(),f("formGroup",n.form),s(3),D(C(5,5,n.description)),s(6),D(C(11,7,n.radioButtonText)),s(5),F(" ",C(16,9,"licenses.create_license")," "),s(3),q(C(20,11,n.licenses)))},dependencies:[yt,Oe,Me,we,Ne,Ye,it,Wn,Te,ye,Ee,De,Qi,z,ct,$],styles:[".scroll-box[_ngcontent-%COMP%]{border-top:var(--border);padding-block:var(--spacer)}.scroll-box[_ngcontent-%COMP%] app-checkbox[_ngcontent-%COMP%]{display:block;min-height:2rem}"]})}}return i})();var Pl=(()=>{class i{updateValidityStatus(e){return e.forEach(t=>{switch(t.type){case B.FILE_PAPER:break;case B.FILE_LINK_LOCAL:t.link||(t.valid=!1,this.validateAndAddError(t,"link"));break;case B.FILE_LINK_WWW:t.url||(t.valid=!1,this.validateAndAddError(t,"url"));break;case B.FILE_HOSTED:(!t.file||!t.valid)&&(t.valid=!1,this.validateAndAddError(t,"hostedFile"));break;default:break}}),e}validateAndAddError(e,t){return e[t]||e.errors.push(t),e}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var wo=(function(i){return i.SQ="albanian",i.AR="arabic",i.BS="bosnian",i.BG="bulgarian",i.HR="croatian",i.CS="czech",i.DA="danish",i.NL="dutch",i.ET="estonian",i.FI="finnish",i.EL="greek",i.HU="hungarian",i.IT="italian",i.JA="japanese",i.KO="korean",i.LV="latvian",i.LT="lithuanian",i.ZH="mandarin",i.NO="norwegian",i.PL="polish",i.PT="portughese",i.RO="romanian",i.RU="russian",i.SR="serbian",i.SK="slovak",i.SL="slovenian",i.ES="spanish",i.SV="swedish",i.TR="turkish",i})(wo||{});var Oo=(function(i){return i.DE="german",i.EN="english",i.FR="french",i.ML="multilingual",i.MISC="other",i})(Oo||{});var Po=(function(i){return i.trule="search.document_upload.trule",i.wnorm="search.document_upload.wnorm",i.misc="search.document_upload.misc",i.redline="search.document_upload.redline",i.file="search.document_upload.file",i})(Po||{});var Nh=i=>({fileTypesList:i});function kh(i,o){if(i&1){let e=w();c(0,"div",11)(1,"input",22),x("change",function(n){E(e);let r=p();return I(r.onFieldChanged(n))}),d(),c(2,"label",8),v(3),h(4,"transloco"),d()()}if(i&2){let e=p();s(),f("id","linktype-hosted-"+e.documentIndex)("name","linktype-hosted-"+e.documentIndex)("checked",e.document.type===e.linkTypes.FILE_HOSTED)("disabled",e.document.type===e.linkTypes.FILE_HOSTED&&e.document.saved),s(),f("for","linktype-hosted-"+e.documentIndex),s(),D(C(4,6,"search.document_upload.link_hosted"))}}function Rh(i,o){i&1&&(c(0,"div",14),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"search.document_upload.hosted_file.warning")," "))}function Ah(i,o){if(i&1){let e=w();c(0,"div",4)(1,"label",15),v(2),h(3,"transloco"),d(),c(4,"input",23),x("change",function(n){E(e);let r=p();return I(r.onFieldChanged(n))}),d()(),c(5,"div",4)(6,"label",15),v(7),h(8,"transloco"),d(),c(9,"input",24),x("change",function(n){E(e);let r=p();return I(r.onFieldChanged(n))}),d()(),c(10,"div",4)(11,"label",15),v(12),h(13,"transloco"),d(),c(14,"input",25),x("change",function(n){E(e);let r=p();return I(r.onFieldChanged(n))}),d()(),c(15,"div",4)(16,"label",15),v(17),h(18,"transloco"),d(),c(19,"input",26),x("change",function(n){E(e);let r=p();return I(r.onFieldChanged(n))}),d()()}if(i&2){let e=p();s(),f("for","building-"+e.documentIndex),s(),D(C(3,16,"search.document_upload.building")),s(2),f("id","building-"+e.documentIndex)("value",e.document.building),s(2),f("for","room-"+e.documentIndex),s(),D(C(8,18,"search.document_upload.room")),s(2),f("id","room-"+e.documentIndex)("value",e.document.room),s(2),f("for","locker-"+e.documentIndex),s(),D(C(13,20,"search.document_upload.closet")),s(2),f("id","locker-"+e.documentIndex)("value",e.document.locker),s(2),f("for","location-"+e.documentIndex),s(),D(C(18,22,"user_management.users.location")),s(2),f("id","location-"+e.documentIndex)("value",e.document.location)}}function Lh(i,o){i&1&&(c(0,"p",29),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.please_fill_this_field")," "))}function Uh(i,o){if(i&1){let e=w();c(0,"div",4)(1,"label",27),v(2),h(3,"transloco"),d(),c(4,"div")(5,"input",28,1),x("change",function(n){E(e);let r=p();return I(r.onFieldChanged(n))}),d(),u(7,Lh,3,3,"p",29),d()()}if(i&2){let e=p();s(),f("for","file-url"+e.documentIndex),s(),D(C(3,7,"search.document_upload.url")),s(3),f("id","link-input-"+e.documentIndex)("value",e.document.url)("disabled",e.document.type!==e.linkTypes.FILE_LINK_WWW)("ngClass",e.document.valid?"valid":"invalid"),s(2),_(e.document.valid?-1:7)}}function Bh(i,o){i&1&&(c(0,"p",29),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.please_fill_this_field")," "))}function Vh(i,o){if(i&1){let e=w();c(0,"div",4)(1,"label",27),v(2),h(3,"transloco"),d(),c(4,"div")(5,"input",30,2),x("change",function(n){E(e);let r=p();return I(r.onFieldChanged(n))}),d(),u(7,Bh,3,3,"p",29),d()()}if(i&2){let e=p();s(),f("for","file-local"+e.documentIndex),s(),D(C(3,7,"search.document_upload.path")),s(3),f("id","file-local"+e.documentIndex)("disabled",e.document.type!==e.linkTypes.FILE_LINK_LOCAL)("value",e.document.link)("ngClass",e.document.valid?"valid":"invalid"),s(2),_(e.document.valid?-1:7)}}function $h(i,o){if(i&1){let e=w();c(0,"div",33)(1,"app-file-upload",35),x("errorOccurred",function(n){E(e);let r=p(2);return I(r.onValidationErrorOccurred(n))})("selectedFileChanged",function(n){E(e);let r=p(2);return I(r.handleSelectedFileChanged(n))}),d()()}if(i&2){let e=p(2);s(),f("preSelectedFile",e.document.hostedFile)("acCodes",e.acCodes)("fileUploadType",e.fileUploadType.HostedDocument)("fileSizeLimitInMB",e.fileSizeLimitMb)("outerErrorMessage",e.getFileErrorMessage())("allowedFileExtensions",e.allowedFileExtensions)}}function Hh(i,o){if(i&1&&(c(0,"div",34),y(1,"app-icon",36),c(2,"span",37),v(3),d()()),i&2){let e=p(2);s(3),D(e.document.file)}}function Kh(i,o){if(i&1&&(c(0,"div",4)(1,"div")(2,"label",31),v(3),h(4,"transloco"),d(),y(5,"app-icon",32),d(),u(6,$h,2,6,"div",33),u(7,Hh,4,1,"div",34),d()),i&2){let e=p(),t=X(43);s(3),D(C(4,5,"search.document_upload.file")),s(2),f("ngbTooltip",t),P("aria-label",t),s(),_(e.document.type===e.linkTypes.FILE_HOSTED&&e.document.id===void 0?6:-1),s(),_(e.document.type===e.linkTypes.FILE_HOSTED&&(e.document.hostedFile||e.document.file)&&e.document.id!==void 0?7:-1)}}function Gh(i,o){if(i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2){let e=p();s(),D(de(2,1,"search.document_upload.allowed_file_types",ie(4,Nh,e.allowedFileExtensions.join(", "))))}}var Nl=(()=>{class i{constructor(){this._translocoService=g(ae),this._authService=g(ue),this._languageStorageService=g(_i),this.fileSizeLimitMb=2048,this.fieldChanged=new R,this.linkTypes=B,this.fileUploadType=In,this._fieldsChanged={},this._siteLanguage="DE",this._additionalLanguages=wo,this._allTypes=Po,this._baseLanguages=Oo,this._fileTypeOptions=Object.keys(Po),this._selectableAdditionalLanguages=Object.keys(wo),this._selectableBaseLanguages=Object.keys(Oo)}
17get hasHostingModule(){return this._authService.currentTokenDecoded.hasHostingModule}ngOnInit(){this._languageStorageService.currentLanguage$.pipe(tt(1)).subscribe(e=>{this._siteLanguage=e.toUpperCase()??"DE"}),this.buildForms(),this.allowedFileExtensions=Pa}selectLanguage(){let e=this.langsForm.value.selectedLanguage,t={fieldName:"language",value:e,documentIndex:this.documentIndex,documentValid:!0};this.document.language=e,this.document.saved!==void 0&&(this.document.saved=!1),this.fieldChanged.emit(t)}selectDocumentType(){let e=this.typesForm.value.selectedDocumentType,t={fieldName:"documentType",value:e,documentIndex:this.documentIndex,documentValid:!0};this.document.documentType=e,this.document.saved!==void 0&&(this.document.saved=!1),this.fieldChanged.emit(t)}onFieldChanged(e){let t=e.target.name,r=e.target.id.split("-")[1]??"",a=e.target.value;this.document.saved!==void 0&&(this.document.saved=!1),r==="local"?(this.document.type=B.FILE_LINK_LOCAL,this.document.isPending=!1,t="type",a=B.FILE_LINK_LOCAL):r==="url"?(this.document.type=B.FILE_LINK_WWW,this.document.isPending=!1,t="type",a=B.FILE_LINK_WWW):r==="hosted"?(this.document.type=B.FILE_HOSTED,this.document.isPending=!0,t="type",a=B.FILE_HOSTED):r==="paper"&&(this.document.type=B.FILE_PAPER,this.document.isPending=!1,t="type",a=B.FILE_PAPER);let l={fieldName:t,value:a,documentIndex:this.documentIndex,documentValid:!0};this.document[t]=a,this._fieldsChanged[t]=!0,this.fieldChanged.emit(l)}handleSelectedFileChanged(e){let t=e[0];this.document.hostedFile=t;let n={fieldName:"hostedFile",value:t,documentIndex:this.documentIndex,documentValid:!0};this._fieldsChanged.hostedFile=!0,this.fieldChanged.emit(n);let r={fieldName:"file",value:t?.name,documentIndex:this.documentIndex,documentValid:!0};this._fieldsChanged.file=!0,this.fieldChanged.emit(r),this.document.valid=!0}onValidationErrorOccurred(e){this.document.valid=!e}getFileErrorMessage(){return!this.document.hostedFile&&this.document.errors.length>0?"common.please_choose_a_file":null}buildForms(){let e=this._selectableBaseLanguages.map(n=>({text:this._translocoService.translate("common.languages."+this._baseLanguages[n]),value:n,disabled:!1})),t=this._selectableAdditionalLanguages.map(n=>({text:this._translocoService.translate("common.languages."+this._additionalLanguages[n]),value:n,disabled:!1})).sort((n,r)=>n.text.localeCompare(r.text));this.languageOptions=e.concat(t),this.documentTypeOptions=this._fileTypeOptions.map(n=>({text:this._allTypes[n],value:n,disabled:!1})),this.langsForm=new Je({selectedLanguage:new je(this.document.language||this._siteLanguage.toUpperCase()||"DE")}),this.typesForm=new Je({selectedDocumentType:new je(this.document.documentType||"wnorm")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-document-entry"]],inputs:{document:"document",documentIndex:"documentIndex",acCodes:"acCodes"},outputs:{fieldChanged:"fieldChanged"},decls:44,vars:48,consts:[["infoTip",""],["urlInput",""],["linkInput",""],[1,"info-container",3,"ngClass"],[1,"content-row"],[1,"types"],["data-cy","linkTypeLocal",1,"form-check"],["type","radio","value","local",1,"form-check-input",3,"change","id","name","checked","disabled"],[1,"form-check-label",3,"for"],["data-cy","linkTypeUrl",1,"form-check"],["type","radio","value","url",1,"form-check-input",3,"change","id","name","checked","disabled"],["data-cy","linkTypeHosted",1,"form-check"],[1,"form-check"],["type","radio","value","paper",1,"form-check-input",3,"change","id","name","checked","disabled"],["data-cy","infoBox",1,"box-info"],[3,"for"],["name","description","rows","3","data-cy","description",3,"change","id"],["for","language",1,"mandatory"],[3,"formGroup"],["id","language","formControlName","selectedLanguage","data-cy","language",3,"itemSelected","items","itemsVisible"],["for","document-type",1,"mandatory"],["id","document-type","formControlName","selectedDocumentType","data-cy","documentType",3,"itemSelected","items"],["type","radio","value","hosted",1,"form-check-input",3,"change","id","name","checked","disabled"],["type","text","name","building",3,"change","id","value"],["type","text","name","room",3,"change","id","value"],["type","text","name","locker",3,"change","id","value"],["type","text","name","location",3,"change","id","value"],[1,"mandatory",3,"for"],["type","text","name","url","data-cy","url",3,"change","id","value","disabled","ngClass"],["data-cy","errorMessage",1,"text-alert"],["type","text","name","link","data-cy","url",3,"change","id","disabled","value","ngClass"],["for","file",1,"mandatory"],["name","info","data-cy","allowedFileTypes","role","tooltip",1,"icon-cl
17ickable",3,"ngbTooltip"],[1,"file-upload-container"],[1,"file-name"],[3,"errorOccurred","selectedFileChanged","preSelectedFile","acCodes","fileUploadType","fileSizeLimitInMB","outerErrorMessage","allowedFileExtensions"],["name","document-hosted"],["data-cy","fileName"]],template:function(t,n){t&1&&(c(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"input",7),x("change",function(a){return n.onFieldChanged(a)}),d(),c(5,"label",8),v(6),h(7,"transloco"),d()(),c(8,"div",9)(9,"input",10),x("change",function(a){return n.onFieldChanged(a)}),d(),c(10,"label",8),v(11),h(12,"transloco"),d()(),u(13,kh,5,8,"div",11),c(14,"div",12)(15,"input",13),x("change",function(a){return n.onFieldChanged(a)}),d(),c(16,"label",8),v(17),h(18,"transloco"),d()()(),u(19,Rh,3,3,"div",14),d(),u(20,Ah,20,24),u(21,Uh,8,9,"div",4),u(22,Vh,8,9,"div",4),u(23,Kh,8,7,"div",4),c(24,"div",4)(25,"label",15),v(26),h(27,"transloco"),d(),c(28,"textarea",16),x("change",function(a){return n.onFieldChanged(a)}),v(29),d()(),c(30,"div",4)(31,"label",17),v(32),h(33,"transloco"),d(),c(34,"div",18)(35,"app-select",19),x("itemSelected",function(){return n.selectLanguage()}),d()()(),c(36,"div",4)(37,"label",20),v(38),h(39,"transloco"),d(),c(40,"div",18)(41,"app-select",21),x("itemSelected",function(){return n.selectDocumentType()}),d()()()(),Y(42,Gh,3,6,"ng-template",null,0,fe)),t&2&&(f("ngClass",n.document.deleted?"deleted":""),s(4),f("id","linktype-local-"+n.documentIndex)("name","linktype-"+n.documentIndex)("checked",n.document.type===n.linkTypes.FILE_LINK_LOCAL)("disabled",n.document.type===n.linkTypes.FILE_HOSTED&&n.document.saved),s(),f("for","linktype-local-"+n.documentIndex),s(),D(C(7,36,"search.document_upload.link_local")),s(3),f("id","linktype-url-"+n.documentIndex)("name","linktype-"+n.documentIndex)("checked",n.document.type===n.linkTypes.FILE_LINK_WWW)("disabled",n.document.type===n.linkTypes.FILE_HOSTED&&n.document.saved),s(),f("for","linktype-url-"+n.documentIndex),s(),D(C(12,38,"search.document_upload.link_url")),s(2),_(n.hasHostingModule?13:-1),s(2),f("id","linktype-paper-"+n.documentIndex)("name","linktype-"+n.documentIndex)("checked",n.document.type===n.linkTypes.FILE_PAPER)("disabled",!0),s(),f("for","linktype-paper-"+n.documentIndex),s(),D(C(18,40,"search.document_upload.link_paper")),s(2),_(n.document.type===n.linkTypes.FILE_HOSTED?19:-1),s(),_(n.document.type===n.linkTypes.FILE_PAPER?20:-1),s(),_(n.document.type===n.linkTypes.FILE_LINK_WWW?21:-1),s(),_(n.document.type===n.linkTypes.FILE_LINK_LOCAL?22:-1),s(),_(n.document.type===n.linkTypes.FILE_HOSTED?23:-1),s(2),f("for","description-"+n.documentIndex),s(),D(C(27,42,"common.description")),s(2),f("id","description-"+n.documentIndex),s(),D(n.document.description),s(3),D(C(33,44,"common.language")),s(2),f("formGroup",n.langsForm),s(),f("items",n.languageOptions)("itemsVisible",10),s(3),D(C(39,46,"common.document_type")),s(2),f("formGroup",n.typesForm),s(),f("items",n.documentTypeOptions))},dependencies:[Oe,lt,uo,j,Qe,Te,ye,_e,Ee,De,z,xt,$],styles:[".info-container[_ngcontent-%COMP%]{display:grid;gap:var(--spacer);margin:var(--spacer)}.info-container[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 3fr;gap:var(--spacer)}.info-container[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] app-select[_ngcontent-%COMP%]{width:15rem}.info-container[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] > .box-info[_ngcontent-%COMP%]{margin:0}.info-container[_ngcontent-%COMP%] .content-row[_ngcontent-%COMP%] > .file-name[_ngcontent-%COMP%]{align-items:center;display:flex}.types[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-bottom:calc(var(--spacer) / 2)}"]})}}return i})();function qh(i,o){i&1&&(c(0,"span",15),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"search.document_upload.link_url")," "))}function Wh(i,o){i&1&&(c(0,"span",15),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"search.document_upload.link_local")," "))}function zh(i,o){i&1&&(c(0,"span",15),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"search.document_upload.link_paper")," "))}function jh(i,o){i&1&&(c(0,"span",15),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"search.document_upload.link_hosted")," "))}function Yh(i,o){i&1&&y(0,"app-icon",17)}function Qh(i,o){if(i&1){let e=w();c(0,"div",10)(1,"button",12),x("click",function(){E(e);let n=p().$index,r=p();return I(r.toggleCollapsible(n))}),y(2,"app-icon",13),c(3,"span",14)(4,"p"),u(5,qh,3,3,"span",15),u(6,Wh,3,3,"span",15),u(7,zh,3,3,"span",15),u(8,jh,3,3,"span",15),d(),c(9,"span",16),v(10),d()()(),u(11,Yh,1,0,"app-icon",17),c(12,"button",18),h(13,"transloco"),h(14,"transloco"),x("click",function(){E(e);let n=p().$implicit,r=p();return I(r.onDeleteDocument(n))}),y(15,"app-icon",19),d()()}if(i&2){let e=p(),t=e.$implicit,n=e.$index,r=p();s(2),f("direction",n!==r.expandedItemIndex?"right":"down"),s(3),_(t.type===r.associatedFileTypes.FILE_LINK_WWW?5:-1),s(),_(t.type===r.associatedFileTypes.FILE_LINK_LOCAL?6:-1),s(),_(t.type===r.associatedFileTypes.FILE_PAPER?7:-1),s(),_(t.type===r.associatedFileTypes.FILE_HOSTED?8:-1),s(2),F(" ",t.description," "),s(),_(t.valid?-1:11),s(),f("ngbTooltip",C(13,9,"common.delete_document")),P("aria-label",C(14,11,"common.delete_document"))}}function Zh(i,o){if(i&1){let e=w();c(0,"app-collapsible",11)(1,"div",20)(2,"app-document-entry",21),x("fieldChanged",function(n){E(e);let r=p(2);return I(r.onFieldChanged(n))}),d()()()}if(i&2){let e=p(),t=e.$implicit,n=e.$index,r=p();f("expanded",n===r.expandedItemIndex),s(2),f("document",t)("documentIndex",n)("acCodes",r.acCodes)}}function Jh(i,o){if(i&1&&(c(0,"div"),u(1,Qh,16,13,"div",10),u(2,Zh,3,4,"app-collapsible",11),d()),i&2){let e=o.$implicit,t=o.$index,n=p();W("collapsed",t!==n.expandedItemIndex),s(),_(e.deleted?-1:1),s(),_(e.deleted?-1:2)}}var kl=(()=>{class i{constructor(){this._activeModal=g(fi),this.modalService=g(he),this._translocoService=g(ae),this._associatedDocumentsValidationService=g(Pl),this.documents=[],this.deleteFile=new R,this.uploadFile=ne
17w R,this.uploadPaperDocument=new R,this.submitData=new R,this.associatedFileTypes=B,this.isPristine=!0,this.documentErrors=[],this.selectedDigitalDocumentIndex=0,this.digitalDocuments=[],this.paperDocuments=[]}get description(){return this.digitalDocuments[this.selectedDigitalDocumentIndex].description||""}ngOnInit(){this.initData(),this.documents.length<1&&this.documents.push({description:this.getDocumentDescription(),language:this.langOptions[0].value,documentType:this.typeOptions[0].value,documentNumber:this.documentNumber,dateOfIssue:this.dateOfIssue,link:"",url:"",building:"",room:"",locker:"",location:"",type:B.FILE_LINK_LOCAL,saved:void 0,deleted:!1,valid:!0,errors:[],isPending:!1}),this.documents=this.documents.sort(i.documentCompare),this.initForm()}initForm(){this.expandedItemIndex=0}expand(e){this.expandedItemIndex=e}toggleCollapsible(e){this.expandedItemIndex===e?this.expandedItemIndex=void 0:this.expandedItemIndex=e}addDocumentForm(){this.documents.push({description:this.getDocumentDescription(),language:this.langOptions[0].value,documentType:this.typeOptions[0].value,documentNumber:this.documentNumber,dateOfIssue:this.dateOfIssue,saved:void 0,deleted:!1,link:"",url:"",building:"",room:"",locker:"",location:"",type:B.FILE_LINK_LOCAL,valid:!0,errors:[],isPending:!1}),this.expandedItemIndex=this.documents.length-1}onClose(){this._activeModal.dismiss()}onSubmit(){let e=this.getUploadDocuments();if(!this.documentsAreValid())return;let t=e.deleteDocuments,n=e.uploadDocuments;if(t.length+n.length<1){this.onClose();return}let r={deleteDocuments:t,upsertDocuments:n,associatedAcCodes:this.acCodes};this.submitData.emit(r),this.isPristine=!0,this.onClose()}onFieldChanged(e){let t=e.fieldName,n=this.documents[e.documentIndex];n.valid=e.documentValid,n.valid&&(n.errors=[]),t==="language"?n[t]=String(e.value).toLowerCase():n[t]=e.value,n.saved!==void 0&&(n.saved=!1),t==="type"&&(n.valid=!0,e.value===B.FILE_HOSTED&&(n.isPending=!0))}onDeleteDocument(e){let t=this.documents.indexOf(e);this.documents[t].deleted=!0,this.documents[t].saved===void 0&&this.documents.splice(t,1)}static documentCompare(e,t){return e.description<t.description?-1:e.description>t.description?1:0}getUploadDocuments(){let e=this.documents.filter(n=>"deleted"in n&&n.deleted)||[],t=this.documents.filter(n=>!("saved"in n)||n.saved!==!0&&n.deleted!==!0)||[];return{deleteDocuments:e,uploadDocuments:t}}documentsAreValid(){this.documentErrors=[],this._associatedDocumentsValidationService.updateValidityStatus(this.documents);let e=this.documents.findIndex(t=>!t.valid);return e===-1?!0:(this.expand(e),!1)}initData(){this._translocoService.selectTranslateObject("search.document_upload").subscribe(e=>{this.langOptions=[{text:e.german,value:"de"},{text:e.english,value:"en"},{text:e.french,value:"fr"},{text:e.other_language,value:"misc"}],this.typeOptions=[{text:e.trule,value:"trule"},{text:e.wnorm,value:"wnorm"},{text:e.misc,value:"misc"},{text:e.redline,value:"redline"},{text:e.file,value:"file"}],this.licenseOptions=[{text:e.single_license,value:"single"},{text:e.multi_license,value:"multi"}]})}getDocumentDescription(){return`${this.documentNumber} (${this.dateOfIssue})`}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-document-upload-modal"]],inputs:{documentNumber:"documentNumber",dateOfIssue:"dateOfIssue",acCodes:"acCodes"},outputs:{deleteFile:"deleteFile",uploadFile:"uploadFile",uploadPaperDocument:"uploadPaperDocument",submitData:"submitData"},decls:13,vars:5,consts:[["modalTitle","common.link_document",3,"border"],[3,"ngSubmit","focusInvalidInput"],[1,"modal-body"],[1,"accordion-container"],[3,"collapsed"],[1,"add-document"],["type","button",1,"btn-icon-text",3,"click"],["name","document-add"],["data-cy","addDocument"],[3,"cancelButtonClick"],[1,"accordion-item-header"],[3,"expanded"],["type","button",1,"btn-collapse-small",3,"click"],["name","chevron",3,"direction"],[1,"header-text"],["data-cy","linkTypeHeader"],["data-cy","descriptionHeader",1,"description","elipsicated"],["name","alert","data-cy","iconError",1,"icon-alert"],["type","button","data-cy","iconDeleteFile",1,"btn-icon-remove",3,"click","ngbTooltip"],["name","delete"],[1,"document-container"],[3,"fieldChanged","document","documentIndex","acCodes"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),c(1,"form",1),x("ngSubmit",function(){return n.onSubmit()}),c(2,"div",2)(3,"div",3),G(4,Jh,3,4,"div",4,J),d(),c(6,"div",5)(7,"button",6),x("click",function(){return n.addDocumentForm(
17)}),y(8,"app-icon",7),c(9,"span",8),v(10),h(11,"transloco"),d()()()(),c(12,"app-modal-footer",9),x("cancelButtonClick",function(){return n.onClose()}),d()()),t&2&&(f("border",!0),s(),f("focusInvalidInput",!1),s(3),q(n.documents),s(6),D(C(11,3,"search.document_upload.add_additional_document")))},dependencies:[Qa,Nl,sn,j,Me,we,_e,Qe,Ye,ye,Yi,z,$],styles:[".document-container[_ngcontent-%COMP%]{border-bottom:var(--border);padding-bottom:var(--spacer)}.accordion-item-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:calc(var(--spacer) / 4)}.accordion-item-header[_ngcontent-%COMP%] .header-text[_ngcontent-%COMP%]{display:block;text-align:left;max-width:50rem}.accordion-item-header[_ngcontent-%COMP%] .header-text[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-family:var(--font-family-regular)}.accordion-item-header[_ngcontent-%COMP%] .header-text[_ngcontent-%COMP%] .elipsicated[_ngcontent-%COMP%]{display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%}.accordion-item-header[_ngcontent-%COMP%] .btn-icon-remove[_ngcontent-%COMP%]{border-radius:0;height:2.75rem;width:2.75rem}.add-document[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-top:var(--spacer)}.add-document[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Rl=(()=>{class i{constructor(){this._authService=g(ue),this._documentAccessService=g(ei),this._favoritesService=g(Xt),this._feedbackService=g(pt),this._modalService=g(za),this.allFilesValid=!0}showDocumentLinkModal(e,t,n,r,a){let l=this._authService.userInfo;this._documentAccessService.getDocumentListForAcCodes(t).pipe(S(m=>{let b=this._modalService.open(kl,{windowClass:"modal-extra-large"}),T=m.map(Z=>Z.fulltexts);T=T.map(Z=>Z.filter(ee=>ee.isUploadedByUser&&ee.type!==B.FILE_DIGITAL));let O=[].concat(...T),U=[],H=[];if(O&&O.length>0)for(let Z of O){let ee=st.someToAssociatedDocumentModel(Z);ee.type===B.FILE_PAPER?H.push(ee):U.push(ee)}return b.componentInstance.digitalDocuments=U,b.componentInstance.paperDocuments=H,b.componentInstance.documents=U.concat(H),b.componentInstance.acCodes=t,b.componentInstance.documentNumber=e.length>0?e[0].documentNumber:"",b.componentInstance.dateOfIssue=e.length>0?e[0].dateOfIssue:"",b}),Re(m=>m.componentInstance.submitData.asObservable().pipe(St(m.closed))),S(m=>{let b=0,T=0,O=0,U=[],H=m.deleteDocuments,Z=m.upsertDocuments.filter(N=>N.type!==B.FILE_HOSTED&&!N.saved||N.type===B.FILE_HOSTED&&N.saved===!1&&!N.hostedFile),ee=m.upsertDocuments.filter(N=>N.type===B.FILE_HOSTED&&!N.saved);return b=Z.filter(N=>N.saved!==void 0).length,T=Z.length-b,O=ee.filter(N=>N.saved===void 0).length,this.allFilesValid=this.checkFilesValid(Z)&&this.checkFilesValid(ee),U=U.concat(this.deleteAssociatedDocuments(H)),Z=Z.map(N=>(N.tenantId=l.tenantId,N.acCodes=t,N.file=N.type===B.FILE_HOSTED?N.file:"userfile",N)),U=U.concat(this.updateAssociatedDocuments(Z)),U=U.concat(this.completeHostedFileInformation(ee,l,t)),{responses:U,allFilesWithoutHostedFiles:Z,numAddFiles:T,numAddHostedFiles:O}}),dn(({responses:m,allFilesWithoutHostedFiles:b,numAddFiles:T,numAddHostedFiles:O})=>et([...m]).pipe(S(U=>({documentResults:U,allFilesWithoutHostedFiles:b,numAddFiles:T,numAddHostedFiles:O})))),dn(({documentResults:m,allFilesWithoutHostedFiles:b,numAddFiles:T,numAddHostedFiles:O})=>{this._feedbackService.showSuccessModal("search.document_upload.save_success");let U=m.flat().filter(N=>!!N&&N.type!==B.FILE_HOSTED&&Number.parseInt(N.din21Id,10)!==0),H=m.flat().filter(N=>!!N&&N.type===B.FILE_HOSTED&&!N.deleted),Z=b.filter(N=>N.saved===void 0);for(let N of Z)for(let Ce of U)!N.din21Id&&re.documentCompare(Ce,N)&&(N.din21Id=Ce.din21Id);let ee=!0;return this._modalService.activeInstances.pipe(me(()=>ee),V(N=>{(T>0||O>0)&&N.length===0&&(this.openAutomaticDocumentLicenseCreation(U.concat(H)),ee=!1,n&&r&&a&&this.resetTableState(n,r,a))}))})).subscribe({error:m=>{console.error(m),this._feedbackService.showErrorModal()}})}completeHostedFileInformation(e,t,n){let r=e.map(a=>(a.tenantId=t.tenantId,a.acCodes=n,a));return M(r)}checkFilesValid(e){return e.every(t=>{switch(t.type){case B.FILE_PAPER:if(!t.building||!t.room||!t.locker||!t.location)return!1;break;case B.FILE_LINK_LOCAL:if(!t.link)return!1;break;case B.FILE_LINK_WWW:if(!t.url)return!1;break;case B.FILE_HOSTED:if(!t.hostedFile)return!1}return t})}deleteAssociatedDocuments(e){let t=[];for(let n of e)t.push(this._favoritesService.deleteAcFile(n.id));return t}updateAssociatedDocuments(e){let t=[];for(let n of e)t.push(this._favoritesService.uploadAcFile(n));return t}openAutomaticDocumentLicenseCreation(e){let t=this._modalService.open(Ol);t.componentInstance.files=e,t.result.then(n=>
17{n&&(n.success?this._feedbackService.showSuccessModal("user_management.groups.licenses_successfully_added"):this._feedbackService.showErrorModal())})}resetTableState(e,t,n){e.resetSelection(),t.selectAllCheckbox=qe.UNCHECKED,n.markForCheck()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Xl=Yr(wr());var Xh=i=>({active:i});function ef(i,o){if(i&1){let e=w();c(0,"app-select",2),x("itemSelected",function(n){E(e);let r=p();return I(r.onSwitchPageSize(n))}),d()}if(i&2){let e=p();f("items",e.pageSizeSelectOptions)}}function tf(i,o){i&1&&y(0,"app-icon",3)}function nf(i,o){if(i&1){let e=w();c(0,"button",8),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(2);return I(n.onSwitchPage(n.page-1))})("keydown.enter",function(){E(e);let n=p(2);return I(n.onSwitchPage(n.page-1))}),y(3,"app-icon",9),d()}i&2&&(f("ngbTooltip",C(1,2,"common.back")),P("aria-label",C(2,4,"common.back")))}function of(i,o){if(i&1){let e=w();c(0,"li",5),x("click",function(){let n=E(e).$implicit,r=p(2);return I(r.onSwitchPage(n))})("keydown.enter",function(){let n=E(e).$implicit,r=p(2);return I(r.onSwitchPage(n))}),c(1,"span",10),v(2),d()()}if(i&2){let e=o.$implicit,t=p(2);s(),f("ngClass",ie(2,Xh,t.page===e)),s(),F(" ",e," ")}}function rf(i,o){i&1&&(c(0,"button",6),h(1,"transloco"),h(2,"transloco"),y(3,"app-icon",11),d()),i&2&&(f("ngbTooltip",C(1,2,"common.next")),P("aria-label",C(2,4,"common.next")))}function af(i,o){i&1&&y(0,"app-icon",7)}function sf(i,o){if(i&1){let e=w();c(0,"ul")(1,"li"),u(2,tf,1,0,"app-icon",3),u(3,nf,4,6,"button",4),d(),G(4,of,3,4,"li",null,J),c(6,"li",5),x("click",function(){E(e);let n=p();return I(n.onSwitchPage(n.page+1))})("keydown.enter",function(){E(e);let n=p();return I(n.onSwitchPage(n.page+1))}),u(7,rf,4,6,"button",6),u(8,af,1,0,"app-icon",7),d()()}if(i&2){let e=p();s(2),_(e.page===1?2:-1),s(),_(e.page>1?3:-1),s(),q(e.pages),s(3),_(e.page<e.last?7:-1),s(),_(e.page===e.last?8:-1)}}var Al=(()=>{class i{constructor(){this._formBuilder=g(dt),this.pageSizeSelectOptions=zi,this.collectionSize=0,this.pageSize=25,this.page=0,this.pageSizeSelectEnabled=!1,this.pageChange=new R,this.pageSizeChange=new R,this._last=0,this._pages=[],this._maxShown=7}ngOnChanges(){this.recalculate()}ngOnInit(){this.recalculate(),this.buildForm()}onSwitchPage(e){e<1||this._last<e||(this.page=e,this.tableMenu&&(this.tableMenu.selectAllCheckbox=qe.UNCHECKED),this.pageChange.emit(e))}onSwitchPageSize(e){this.tableMenu&&(this.tableMenu.selectAllCheckbox=qe.UNCHECKED),this.pageSizeChange.emit(parseInt(e,10))}get pages(){return this._pages}get last(){return this._last}getDisplayPages(){let e=new Array(Math.min(this._maxShown,this.pageCount)),t=Math.max(0,this.page-Math.floor(this._maxShown/2+1));return e.fill(0).map((r,a)=>t+ ++a).filter(r=>r<=this.pageCount)}recalculate(){this._last=this.pageCount,this._pages=this.getDisplayPages()}get pageCount(){let e=1;return this.collectionSize&&this.pageSize&&(e=Math.ceil(this.collectionSize/this.pageSize)),e}buildForm(){this.paginationForm||(this.paginationForm=this._formBuilder.group({pageSizeOptions:this._formBuilder.control(this.pageSize)}))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-pagination"]],inputs:{collectionSize:"collectionSize",pageSize:"pageSize",page:"page",pageSizeSelectEnabled:"pageSizeSelectEnabled",tableMenu:"tableMenu"},outputs:{pageChange:"pageChange",pageSizeChange:"pageSizeChange"},features:[Ct],decls:3,vars:3,consts:[[1,"nav",3,"formGroup"],["label","common.table.pagination","labelPosition","left","data-cy","paginationSize","formControlName","pageSizeOptions",3,"items"],["label","common.table.pagination","labelPosition","left","data-cy","paginationSize","formControlName","pageSizeOptions",3,"itemSelected","items"],["name","chevron","direction","left","data-cy","iconBackDisabled",1,"icon-inactive"],["type","button",1,"btn-prev",3,"ngbTooltip"],[3,"click","keydown.enter"],["type","button",1,"btn-next",3,"ngbTooltip"],["name","chevron","direction","right","data-cy","iconNextDisabled",1,"icon-inactive"],["type","button",1,"btn-prev",3,"click","keydown.enter","ngbTooltip"],["name","chevron","direction","left","data-cy","iconBack"],["data-cy","paginationNumber",1,"page-link",3,"ngClass"],["name","chevron","direction","right","data-cy","iconNext"]],template:function(t,n){t&1&&(c(0,"n
17av",0),u(1,ef,1,1,"app-select",1),u(2,sf,9,4,"ul"),d()),t&2&&(f("formGroup",n.paginationForm),s(),_(n.pageSizeSelectEnabled?1:-1),s(),_(n.collectionSize>0&&n.pages&&n.pages.length>1?2:-1))},dependencies:[j,Qe,lt,Te,ye,_e,Ee,De,xt,$],styles:["ul[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:flex-end;padding:calc(var(--spacer) / 2) calc(var(--spacer) / 8)}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:center;justify-content:center;height:2.5rem;width:2rem}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus{border-radius:var(--border-radius);box-shadow:0 0 0 .12rem var(--color-focus);outline:none;z-index:4}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is([type=radio]){border:none;border-radius:50%}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is(.btn-icon,.nautos-select){z-index:unset}@media(width<=100rem){ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{width:1.5rem}}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn-prev[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus, ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn-next[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus{border-radius:var(--border-radius);box-shadow:0 0 0 .12rem var(--color-focus);outline:none;z-index:4}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn-prev[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is([type=radio]), ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn-next[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is([type=radio]){border:none;border-radius:50%}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn-prev[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is(.btn-icon,.nautos-select), ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn-next[_ngcontent-%COMP%]:not(:disabled,.disabled,.sidebar-item):focus:is(.btn-icon,.nautos-select){z-index:unset}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn-prev[_ngcontent-%COMP%], ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .btn-next[_ngcontent-%COMP%]{background-color:var(--color-background);color:var(--color-primary-dark);padding:0;width:2rem}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]{color:var(--color-primary-dark)}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .page-link[_ngcontent-%COMP%]:not(.active,.disabled){text-decoration:underline}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .page-link.active[_ngcontent-%COMP%]{font-family:var(--font-family-bold)}"]})}}return i})();var wn=class{constructor(o,e,t){this.metafield=o,this.value=e,this.query=t}};var Ll=(()=>{class i{transform(e){switch(e){case"ADM_STATUS":return"common.metadata_label.documentType";case"CLASSIF_ICS":return"common.metadata_label.classificationIcs";case"COUNTRYCODE":return"common.metadata_label.countryCode";case"LANG_ORIG_COMPLETE":return"common.metadata_label.originalLanguage";case"LANG_TRANS_COMPLETE":return"common.metadata_label.translations";default:return""}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"hitlistFilterTranslation",type:i,pure:!0})}}return i})();var lf=["filterContainer"];function cf(i,o){i&1&&(c(0,"span",3),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.table.filter")," "))}function df(i,o){if(i&1){let e=w();c(0,"button",8),x("click",function(){E(e);let n=p();return I(n.resetAllFilters())}),c(1,"span",9),v(2),h(3,"transloco"),d()()}i&2&&(s(2),D(C(3,1,"common.reset")))}function pf(i,o){if(i&1){let e=w();c(0,"button",14),x("click",function(){E(e);let n=p(2).$implicit,r=p().$implicit,a=p(2);return I(a.setFilter(r,n))}),c(1,"span",15),v(2),d(),c(3,"span",16),v(4),d()()}if(i&2){let e=p(2).$implicit;s(2),D(e.value),s(2),F("(",e.count,")")}}function mf(i,o){if(i&1){let e=w();c(0,"div",12)(1,"span",17)(2,"span",15),v(3),d(),c(4,"span",16),v(5),d()(),c(6,"button",5),h(7,"transloco"),h(8,"transloco"),x("click",function(){E(e);let n=p(2).$implicit,r=p().$implicit,a=p(2);return I(a.unsetFilter(r,n))}),y(9,"app-icon",18),d()()}if(i&2){let e=p(2).$implicit;P("data-cy",e.value),s(3),D(e.value),s(2),F("(",e.count,")"),s(),f("ngbTooltip",C(7,5,"common.remove")),P("aria-label",C(8,7,"common.remove"))}}function uf(i,o){if(i&1&&(c(0,"div",12),u(1,pf,5,2,"button",13),u(2,mf,10,9,"div",12),d()),i&2){let e=p().$implicit,t=p().$implicit,n=p(2);s(),_(n.isFilterSet(t,e)?-1:1),s(),_(n.isFilterSet(t,e)&&e.count>0?2:-1)}}function _f(i,o){if(i&1&&u(0,uf,3,2,"div",12),i&2){let e=o.$implicit,t=o.$index,n=p(3);_(e.count>0&&t<n.maxDisplayCounts?0:-1)}}function hf(i,o){if(i&1&&(c(0,"div",10)(1,"span",11),v(2),h(3,"hitlistFilterTranslation"),h(4,"transloco"),d(),G(5,_f,1,1,null,null,J),d()),i&2){let e=o.$implicit;P("data-cy",e.field),s(2),D(C(4,4,C(3,2,e.field))),s(3),q(e.facetFieldItems)}}function ff(i,o){if(i&1&&(c(0,"div",7,0),G(2,hf,7,6,"div",10,J),h(4,"async"),d()),i&2){let e=p();s(2),q(C(4,0,e.facetFields$))}}var Ul=(()=>{class i{constructor(){this._filterService=g(Ka),this._facetService=g(Kn),this._searchService=g(Jt),this._renderer=g(Et),this._componentActive=!0,this.currentSelectedFacets=new Map,this.isFilterColumnExpanded=!0,this.maxDisplayCounts=5,this.filterClose=new R,this.filterChange=new R}ngOnInit(){this._facetService.fetchFacets(this._searchService.lastSearchRequestDto),this.facetFields$=this._facetService.mergedFacets$.pipe(k(()=>xe)),this._facetService.currentSelectedFacets$.pipe(k(()=>xe)).pipe(me(()=>this._componentActive)).subscribe(t=>{t!==null&&(this.currentSelectedFacets=t)})}ngAfterViewInit(){let e=window.innerHeight,t=this.filterRef.nativeElement;this._renderer.setStyle(t,"height",`${e-530}px`)}ngOnDestroy(){this._componentActive=!1}setFilter(e,t){this._facetService.enableFacetForMetafield(e.field,t);let n=new wn(e.field,t.value,t.query);this._filterService.enableFilter(n),this.filterChange.emit(this.currentSelectedFacets.size>0),this._facetService.fetchFacets(this._searchService.lastSearchRequestDto)}unsetFilter(e,t){this._facetService.disableFacetForMetafield(e.field,t);let n=new wn(e.field,t.value,t.query);this._filterService.disableFilter(n),this.filterChange.emit(this.currentSelectedFacets.size>0),this._facetService.fetchFacets(this._searchService.lastSearchRequestDto)}
17isFilterSet(e,t){return this._facetService.isFacetSelected(e.field,t)}onFilterClose(){this.filterClose.emit()}resetAllFilters(){this._facetService.disableAllFacets(),this._filterService.removeAll(),this.filterChange.emit(),this._facetService.fetchFacets(this._searchService.lastSearchRequestDto)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-hitlist-filter"]],viewQuery:function(t,n){if(t&1&&Ge(lf,5),t&2){let r;le(r=ce())&&(n.filterRef=r.first)}},outputs:{filterClose:"filterClose",filterChange:"filterChange"},decls:9,vars:9,consts:[["filterContainer",""],[1,"filter"],[1,"filter-header"],["data-cy","filterTitle",1,"title"],["type","button",1,"btn-filter-reset"],["type","button",1,"btn-filter-close",3,"click","ngbTooltip"],["name","cross","data-cy","iconCloseFilter"],[1,"scroll-box"],["type","button",1,"btn-filter-reset",3,"click"],["data-cy","resetFilter"],[1,"filter-group"],["for","filter"],[1,"filter-row"],["type","button","data-cy","filterItem",1,"btn-filter-value"],["type","button","data-cy","filterItem",1,"btn-filter-value",3,"click"],["data-cy","filterValue"],["data-cy","filterCount"],["data-cy","filterItem",1,"filter-value-active"],["name","cross","data-cy","removeFilter"]],template:function(t,n){t&1&&(c(0,"div",1)(1,"div",2),u(2,cf,3,3,"span",3),u(3,df,4,3,"button",4),c(4,"button",5),h(5,"transloco"),h(6,"transloco"),x("click",function(){return n.onFilterClose()}),y(7,"app-icon",6),d()(),u(8,ff,5,2,"div",7),d()),t&2&&(s(2),_(n.isFilterColumnExpanded?2:-1),s(),_(n.currentSelectedFacets.size>0?3:-1),s(),f("ngbTooltip",C(5,5,"common.table.close_filter")),P("aria-label",C(6,7,"common.table.close_filter")),s(4),_(n.isFilterColumnExpanded?8:-1))},dependencies:[Oe,j,_e,z,ct,Ll,$],styles:[".filter[_ngcontent-%COMP%]{display:flex;background-color:var(--color-popover);color:#fff;flex-direction:column}.filter[_ngcontent-%COMP%] .filter-group[_ngcontent-%COMP%]{color:inherit;display:flex;flex-direction:column;gap:calc(var(--spacer) / 4);margin-bottom:var(--spacer)}.filter[_ngcontent-%COMP%] .filter-group[_ngcontent-%COMP%] .filter-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:2rem;width:100%}.filter[_ngcontent-%COMP%] .filter-group[_ngcontent-%COMP%] .filter-row[_ngcontent-%COMP%] .btn-filter-value[_ngcontent-%COMP%]:not(:disabled):focus{border-radius:var(--border-radius);box-shadow:0 0 0 .12rem #fff;outline:none}.filter[_ngcontent-%COMP%] .filter-group[_ngcontent-%COMP%] .filter-row[_ngcontent-%COMP%] .btn-filter-value[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;background-color:inherit;border:solid 1px transparent;color:inherit;font-family:var(--font-family-regular);font-size:var(--font-size-default);gap:calc(var(--spacer) / 4);height:2rem;margin:2px}.filter[_ngcontent-%COMP%] .filter-group[_ngcontent-%COMP%] .filter-row[_ngcontent-%COMP%] .btn-filter-close[_ngcontent-%COMP%]{margin-right:2px;max-height:2rem;min-height:2rem;max-width:2rem;min-width:2rem}.filter[_ngcontent-%COMP%] .filter-group[_ngcontent-%COMP%] .filter-row[_ngcontent-%COMP%] .filter-value-active[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;color:inherit;font-family:var(--font-family-bold);gap:calc(var(--spacer) / 4);margin-left:calc(var(--spacer) / 2)}"]})}}return i})();function gf(i,o){i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2&&(s(),F("",C(2,1,"search.hitlist.validation_name_min_length")," "))}function Cf(i,o){i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2&&(s(),F("",C(2,1,"common.please_fill_this_field")," "))}function vf(i,o){i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2&&(s(),F("",C(2,1,"search.mini_detail_layout.validation_unique_name")," "))}function bf(i,o){if(i&1&&(c(0,"p",7),u(1,gf,3,3,"span"),u(2,Cf,3,3,"span"),u(3,vf,3,3,"span"),d()),i&2){let e,t,n,r=p();s(),_((e=r.saveFormatForm.get("name").errors)!=null&&e.minlength?1:-1),s(),_((t=r.saveFormatForm.get("name").errors)!=null&&t.required?2:-1),s(),_((n=r.saveFormatForm.get("name").errors)!=null&&n.forbiddenName?3:-1)}}function yf(i,o){i&1&&(c(0,"p",8)(1,"span"),v(2),h(3,"transloco"),d()()),i&2&&(s(2),D(C(3,1,"common.error")))}var Bl=(()=>{class i{constructor(){this.modalService=g(he),this._miniDisplayFormatService=g(Ci),this._subscriptions=[],this._responseSuccess=!0}get responseSuccess(){return this._responseSuccess}ngOnInit(){this._subscriptions.push(this._miniDisplayFormatService.defaultFormat$.subscribe({next:e=>{let t=this.currentFormat?.id===e.id?"":this.currentFormat?.name??"";this.saveFormatForm=new Je({name:new je(t,[Ve.required,Ve.minLength(3),this.forbiddenNameValidator(e.name)])})}}))}ngOnDestroy(){for(let e of this._subscriptions)e?.unsubscribe();this._saveSubscription&&this._saveSubscription.unsubscribe()}onSave(){if(this.saveFormatForm.valid){let e=K(K({},this.saveFormatForm.value),this.changes);this._saveSubscription&&this._saveSubscription.unsubscribe(),this._saveSubscription=this._miniDisplayFormatService.createFormat(this.currentFormat,e).subscribe({next:t=>{this._responseSuccess=!0,this.modalService.close({updatedFormat:t})},error:()=>{this._responseSuccess=!1}})}}forbiddenNameValidator(e){return t=>e===t.value?{forbiddenName:{value:t.value}}:null}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-mini-detail-create-layout-modal"]],inputs:{currentFormat:"currentFormat",originalFormat:"originalFormat",changes:"changes"},decls:14,vars:10,consts:[["ngForm","ngForm"],["name",""],["modalTitle","search.mini_detail_layout.create"],[3,"ngSubmit","formGroup"],[1,"modal-body"],["for","name"],["id","name","name","name","type","text","formControlName","name","data-cy","miniDetailsLayoutName",1,"autofocus",3,"appAutoFocus"],["data-cy","errorMessage",1,"text-alert"],[1,"text-alert"],[3,"cancelButtonClick","border"]],template:function(t,n){if(t&1&&(y(0,"app-modal-header",2),c(1,"form",3,0),x("ngSubmit",function(){return n.onSave()}),c(3,"div",4)(4,"div")(5,"div")(6,"label",5),v(7),h(8,"transloco"),d(),y(9,"input",6,1),d(),u(11,bf,4,3,"p",7),u(12,yf,4,3,"p",8),d()(),c(13,"app-modal-footer",9),x("cancelButtonClick",function(){return n.modalService.dismiss()}),d()()),t&2){let r=X(2);s(),f("formGroup",n.saveFormatForm),s(4),W("not-valid",!n.saveFormatForm.get("name").valid&&r.submitted),s(2),D(C(8,8,"common.name")),s(2),f("appAutoFocus",!0),s(2),_(!n.saveFormatForm.get("name").valid&&r.submitted?11:-1),s(),_(n.responseSuccess?-1:12),s(),f("border",!1)}},dependencies:[Ji,Me,we,Ne,Ye,it,Te,ye,Ee,De,z,$],encapsulation:2})}}return i})();var xf=["plusButton"],Vl=()=>[0,1,2],Sf=()=>[0,1];function Tf(i,o){if(i&1&&(c(0,"span",11),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit,t=p();f("id",t.leftColumnValues[e]+"-active"),s(),D(C(2,2,"common.metadata_label.pro_metadata."+t.getCorrectLabel(t.leftColumnValues[e])))}}function Df(i,o){if(i&1&&(c(0,"span",11),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit,t=p();f("id",t.leftColumnValues[e]+"-active"),s(),D(C(2,2,"common.metadata_label."+t.leftColumnValues[e]))}}function Ef(i,o){if(i&1){let e=w();c(0,"div",9),u(1,Tf,3,4,"span",11),u(2,Df,3,4,"span",11),c(3,"button",12),x("click",function(){E(e);let n=p().$implicit,r=p();return I(r.removeItem(r.leftColumnValues,n))}),y(4,"app-icon",13),d()()}if(i&2){let e=p().$implicit,t=p();P("data-cy",t.leftColumnValues[e]),s(),_(t.isCustomerField(t.leftColumnValues[e])?1:-1),s(),_(t.isCustomerField(t.leftColumnValues[e])?-1:2)}}function If(i,o){i&1&&(c(0,"div",10),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.add")," "))}function Ff(i,o){if(i&1&&(u(0,Ef,5,3,"div",9),u(1,If,3,3,"div",10)),i&2){let e=o.$implicit,t=p();_(t.leftColumnValues[e]?0:-1),s(),_(t.leftColumnValues[e]?-1:1)}}function Mf(i,o){if(i&1&&(c(0,"span",11),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit,t=p();f("id",t.centerColumnValues[e]+"-active"),s(),D(C(2,2,"common.metadata_label.pro_metadata."+t.getCorrectLabel(t.centerColumnValues[e])))}}function wf(i,o){if(i&1&&(c(0,"span",11),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit,t=p();f("id",t.centerColumnValues[e]+"-active"),s(),D(C(2,2,"common.metadata_label."+t.centerColumnValues[e]))}}function Of(i,o){if(i&1){let e=w();c(0,"div",9),u(1,Mf,3,4,"span",11),u(2,wf,3,4,"span",11),c(3,"button",12),x("click",function(){E(e);let n=p().$implicit,r=p();return I(r.removeItem(r.centerColumnValues,n))}),y(4,"app-icon",13),d()()}if(i&2){let e=p().$implicit,t=p();P("data-cy",t.centerColumnValues[e]),s(),_(t.isCustomerField(t.centerColumnValues[e])?1:-1),s(),_(t.isCustomerField(t.centerColumnValues[e])?-1:2)}}function Pf(i,o){i&1&&(c(0,"div",10),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.add")," "))}function Nf(i,o){if(i&1&&(u(0,Of,5,3,"div",9),u(1,Pf,3,3,"div",10)),i&2){let e=o.$implicit,t=p();_(t.centerColumnValues[e]?0:-1),s(),_(t.centerColumnValues[e]?-1:1)}}function kf(i,o){if(i&1&&(c(0,"div",11),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit,t=p();f("id",t.rightColumnValues[e]+"-active"),s(),F(" ",C(2,2,"common.metadata_label.pro_metadata."+t.getCorrectLabel(t.rightColumnValues[e]))," ")}}function Rf(i,o){if(i&1&&(c(0,"div",11),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit,t=p();f("id",t.rightColumnValues[e]+"-active"),s(),F(" ",C(2,2,"common.metadata_label."+t.rightColumnValues[e])," ")}}function Af(i,o){if(i&1){let e=w();c(0,"div",14),u(1,kf,3,4,"div",11),u(2,Rf,3,4,"div",11),c(3,"button",15),h(4,"transloco"),h(5,"transloco"),x("click",function(){E(e);let n=p().$implicit,r=p();return I(r.removeItem(r.rightColumnValues,n))}),y(6,"app-icon",13),d()()}if(i&2){let e=p().$implicit,t=p();P("data-cy",t.rightColumnValues[e]),s(),_(t.isCustomerField(t.rightColumnValues[e])?1:-1),s(),_(t.isCustomerField(t.rightColumnValues[e])?-1:2),s(),f("ngbTooltip",C(4,5,"search.remove_field")),P("aria-label",C(5,7,"search.remove_field"))}}function Lf(i,o){i&1&&(c(0,"div",10),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"common.add")," "))}function Uf(i,o){if(i&1&&(u(0,Af,7,9,"div",14),u(1,Lf,3,3,"div",10)),i&2){let e=o.$implicit,t=p();_(t.rightColumnValues[e]?0:-1),s(),_(t.rightColumnValues[e]?-1:1)}}function Bf(i,o){if(i&1&&(v(0),h(1,"transloco")),i&2){let e=p().$implicit,t=p();F(" ",C(1,1,"common.metadata_label.pro_metadata."+t.getCorrectLabel(e))," ")}}function Vf(i,o){if(i&1&&(v(0),h(1,"transloco")),i&2){let e=p().$implicit;F(" ",C(1,1,"common.metadata_label."+e)," ")}}function $f(i,o){if(i&1&&(c(0,"div",6),u(1,Bf,2,3),u(2,Vf,2,3),d()),i&2){let e=o.$implicit,t=p();f("id",kt(e))("cdkDragDisabled",t.isSettingAlreadyUsed(e)),P("data-cy",e),s(),_(t.isCustomerField(e)?1:-1),s(),_(t.isCustomerField(e)?-1:2)}}function Hf(i,o){i&1&&y(0,"app-checkbox",8)}var $l=(()=>
17{class i{set settings(e){if(!e)return;this._layout=e;let t=e.fields;this.leftColumnValues=[],this.centerColumnValues=[],this.rightColumnValues=[],t.forEach(n=>{n.fieldPosition==="LEFT"?this.leftColumnValues.push(n.fieldName):n.fieldPosition==="CENTER"?this.centerColumnValues.push(n.fieldName):n.fieldPosition==="RIGHT"&&this.rightColumnValues.push(n.fieldName)}),this._isTenantWideTemplate=e.isTenantWide}constructor(){this._metadataFieldsService=g(Ut),this._translocoService=g(ae),this._authService=g(ue),this.settingsChange=new R,this.showHidden=!1,this.leftColumnValues=[],this.centerColumnValues=[],this.rightColumnValues=[],this.userIsAdmin=!1,this._isTenantWideTemplate=!1,this.userIsAdmin=this._authService.userIsAdmin}ngOnInit(){this.configForm=new Je({saveAsTenantWideTemplate:new je(this._isTenantWideTemplate)}),this._availableMetadataFieldsSubscription=this._metadataFieldsService.getMetadataList().subscribe(e=>{e&&(this._allMetadataFieldsLabel=Array.from(e.keys()),this.initMetadataFields())}),this.configForm.valueChanges.subscribe(e=>{this._isTenantWideTemplate=e.saveAsTenantWideTemplate,this.updateSettings()})}ngOnDestroy(){this._availableMetadataFieldsSubscription&&this._availableMetadataFieldsSubscription.unsubscribe()}dropToSlotContainer(e){let t=e.previousContainer.id===e.container.id,n=e.previousContainer.id==="new-columns-container",a=e.container.id==="slotListRight"?e.container.data.length<2:e.container.data.length<3;t?nn(e.container.data,e.previousIndex,e.currentIndex):a&&(n?e.container.data.push(e.previousContainer.data[e.previousIndex]):xs(e.previousContainer.data,e.container.data,e.previousIndex,e.currentIndex)),this.updateSettings()}dropToColoumnContainer(e){e.previousContainer.id!==e.container.id&&e.previousContainer.data.splice(e.previousIndex,1),this.updateSettings()}removeItem(e,t){e.splice(t,1),this.updateSettings()}isSettingAlreadyUsed(e){let t=this.leftColumnValues.concat(this.centerColumnValues,this.rightColumnValues);for(let n of t)if(n&&n.toLowerCase()===e.toLowerCase())return!0;return!1}getCorrectLabel(e){return Ht.getCorrectLabel(e)}isCustomerField(e){return Rt.map(t=>t.id.toLowerCase()).includes(e.toLowerCase())}initMetadataFields(){if(this._allMetadataFieldsLabel){let e=["","favoritesFolders","notesFolders","reqIfConvertible"],[t,n]=this._allMetadataFieldsLabel.reduce(([r,a],l)=>
17e.includes(l)||Yt.isCustomKey(l)?[r,a]:((this.isCustomerField(l)?r:a).push(l),[r,a]),[[],[]]);this.actualShownFields=[...re.sortStringArrayByTranslation(n,this._translocoService),...re.sortStringArrayByTranslation(t,this._translocoService,!0)]}}updateSettings(){let e=[];e.push(...this.getFieldsByColumn(this.leftColumnValues,"LEFT")),e.push(...this.getFieldsByColumn(this.rightColumnValues,"RIGHT")),e.push(...this.getFieldsByColumn(this.centerColumnValues,"CENTER"));let t=this.configForm.controls.saveAsTenantWideTemplate.getRawValue();this._layout.fields=e,this._layout.isTenantWide=t,this.settingsChange.emit(this._layout)}getFieldsByColumn(e,t){let n=[];return e.forEach(r=>{let a={label:r,fieldName:r,fieldPosition:t};n.push(a)}),n}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-mini-detail-schema-editor"]],viewQuery:function(t,n){if(t&1&&Ge(xf,7),t&2){let r;le(r=ce())&&(n.plusButtonRef=r.first)}},inputs:{settings:"settings"},outputs:{settingsChange:"settingsChange"},decls:16,vars:9,consts:[["cdkDropListGroup","",1,"container-mini-detail-editor"],["data-cy","activeFelds",1,"container-selection"],["id","slotListLeft","data-cy","dropAreaLeft","cdkDropList","",1,"column",3,"cdkDropListDropped","cdkDropListData"],["id","slotListCenter","data-cy","dropAreaCenter","cdkDropList","",1,"column",3,"cdkDropListDropped","cdkDropListData"],["id","slotListRight","data-cy","dropAreaRight","cdkDropList","",1,"column",3,"cdkDropListDropped","cdkDropListData"],["id","new-columns-container","cdkDropListSortingDisabled","","cdkDropList","","data-cy","metadataFields",1,"container-fields",3,"cdkDropListDropped","cdkDropListData"],["cdkDrag","",3,"id","cdkDragDisabled"],[1,"container-control",3,"formGroup"],["label","search.tenant_wide_template","data-cy","miniDetailsTenantWide","formControlName","saveAsTenantWideTemplate"],["cdkDrag","",1,"setting-element"],["data-cy","addField",1,"setting-element","placeholder"],[3,"id"],["type","button","data-cy","iconRemoveField",1,"btn-icon-remove",3,"click"],["name","cross"],["cdkDrag","",1,"setting-element","large"],["type","button","data-cy","iconRemoveField",1,"btn-icon-remove",3,"click","ngbTooltip"]],template:function(t,n){t&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),x("cdkDropListDropped",function(a){return n.dropToSlotContainer(a)}),G(3,Ff,2,2,null,null,J),d(),c(5,"div",3),x("cdkDropListDropped",function(a){return n.dropToSlotContainer(a)}),G(6,Nf,2,2,null,null,J),d(),c(8,"div",4),x("cdkDropListDropped",function(a){return n.dropToSlotContainer(a)}),G(9,Uf,2,2,null,null,J),d()(),c(11,"div",5),x("cdkDropListDropped",function(a){return n.dropToColoumnContainer(a)}),G(12,$f,3,6,"div",6,J),d(),c(14,"div",7),u(15,Hf,1,0,"app-checkbox",8),d()()),t&2&&(s(2),f("cdkDropListData",n.leftColumnValues),s(),q(Hi(6,Vl)),s(2),f("cdkDropListData",n.centerColumnValues),s(),q(Hi(7,Vl)),s(2),f("cdkDropListData",n.rightColumnValues),s(),q(Hi(8,Sf)),s(2),f("cdkDropListData",n.actualShownFields),s(),q(n.actualShownFields),s(2),f("formGroup",n.configForm),s(),_(n.userIsAdmin?15:-1))},dependencies:[yt,Mi,on,Ms,no,j,_e,Ne,Te,ye,Ee,De,z,$],styles:[".cdk-drag-placeholder[_ngcontent-%COMP%]{background-color:var(--color-gray-lighter);border-radius:var(--border-radius);border:var(--border);color:var(--color-primary-dark);font-family:var(--font-family-bold);opacity:.3;padding:calc(var(--spacer) / 2);text-align:center}.cdk-drag-preview[_ngcontent-%COMP%]{box-shadow:0 4px 10px #00000059;display:flex;justify-content:space-between;align-items:center;background-color:var(--color-gray-lighter);border-radius:var(--border-radius);border:var(--border);color:var(--color-primary-dark);font-family:var(--font-family-bold);padding-inline:calc(var(--spacer) / 2);-webkit-user-select:none;user-select:none}.cdk-drag-preview[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{display:none}.container-mini-detail-editor[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacer)}.container-mini-detail-editor[_ngcontent-%COMP%] .container-selection[_ngcontent-%COMP%]{border-bottom:var(--border);display:flex;gap:var(--spacer);padding-bottom:var(--spacer);-webkit-user-select:none;user-select:none}
17.container-mini-detail-editor[_ngcontent-%COMP%] .container-selection[_ngcontent-%COMP%] .column[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:var(--spacer);flex-direction:column;width:25%}.container-mini-detail-editor[_ngcontent-%COMP%] .container-selection[_ngcontent-%COMP%] .column[_ngcontent-%COMP%]:last-child{width:50%}.container-mini-detail-editor[_ngcontent-%COMP%] .container-selection[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] .setting-element[_ngcontent-%COMP%]{box-shadow:0 1px 2px #00000040;display:flex;justify-content:space-between;align-items:center;background-color:var(--color-gray-lighter);border-radius:var(--border-radius);border:var(--border);color:var(--color-primary-dark);cursor:pointer;flex-basis:100%;font-family:var(--font-family-bold);min-height:42px;padding-left:calc(var(--spacer) / 2);width:100%}.container-mini-detail-editor[_ngcontent-%COMP%] .container-selection[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] .setting-element.large[_ngcontent-%COMP%]{align-items:space-between;display:flex}.container-mini-detail-editor[_ngcontent-%COMP%] .container-selection[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] .setting-element.large[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{align-self:flex-start}.container-mini-detail-editor[_ngcontent-%COMP%] .container-selection[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] .setting-element.placeholder[_ngcontent-%COMP%]{background-color:transparent;border:1px dashed var(--color-gray-dark);box-shadow:none;cursor:default;font-family:var(--font-family-regular);opacity:.5}.container-mini-detail-editor[_ngcontent-%COMP%] .container-fields[_ngcontent-%COMP%]{display:flex;gap:calc(var(--spacer) / 2);flex-wrap:wrap;min-height:3rem}.container-mini-detail-editor[_ngcontent-%COMP%] .container-fields[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{box-shadow:0 1px 2px #00000040;background-color:var(--color-gray-lighter);border-radius:var(--border-radius);border:var(--border);color:var(--color-primary-dark);cursor:pointer;padding:calc(var(--spacer) / 2);text-align:center;-webkit-user-select:none;user-select:none}.container-mini-detail-editor[_ngcontent-%COMP%] .container-fields[_ngcontent-%COMP%] > div.cdk-drag-disabled[_ngcontent-%COMP%]{background-color:var(--color-background);border:1px dashed var(--color-gray-dark);box-shadow:none;cursor:default;font-family:var(--font-family-regular);opacity:.5}.container-mini-detail-editor[_ngcontent-%COMP%] .container-control[_ngcontent-%COMP%]{display:flex;flex-direction:column}.container-mini-detail-editor[_ngcontent-%COMP%] .container-control[_ngcontent-%COMP%] .btn-collapse[_ngcontent-%COMP%]{font-size:var(--font-size-default);height:2.5rem;justify-content:center;text-decoration:underline}.container-mini-detail-editor[_ngcontent-%COMP%] .container-control[_ngcontent-%COMP%] .btn-collapse[_ngcontent-%COMP%]:active, .container-mini-detail-editor[_ngcontent-%COMP%] .container-control[_ngcontent-%COMP%] .btn-collapse[_ngcontent-%COMP%]:focus, .container-mini-detail-editor[_ngcontent-%COMP%] .container-control[_ngcontent-%COMP%] .btn-collapse[_ngcontent-%COMP%]:hover{color:var(--color-primary)}"]})}}return i})();var Kf=i=>({label:"common.name",value:i}),Hl=(()=>{class i{constructor(){this.modalService=g(he),this._miniDisplayFormatService=g(Ci)}ngOnInit(){this._changes=void 0,this.currentLayout=this.activeFormat}ngOnDestroy(){this._activateSubscription&&this._activateSubscription.unsubscribe(),this._deleteSubscription&&this._deleteSubscription.unsubscribe(),this._saveSubscription&&this._saveSubscription.unsubscribe()}onSave(){this._saveSubscription&&this._saveSubscription.unsubscribe();let e=K(K({},this.currentLayout),this._changes);this._saveSubscription=this._miniDisplayFormatService.updateFormat(this.currentLayout,e).subscribe({next:t=>{this.modalService.close({success:!0,updatedFormat:t})}})}onSettingsChange(e){this._changes={layout:e}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-mini-detail-edit-layout-modal"]],inputs:{activeFormat:"activeFormat"},decls:4,vars:5,consts:[["modalTitle","search.mini_detail_layout.edit",3,"modalInfo","border"],[1,"modal-body"],[3,"settingsChange","settings"],[3,"cancelButtonClick","saveButtonClick"]],template:function(t,n){t&1&&(y(0,"app-modal-header",0),c(1,"div",1)(2,"app-mini-detail-schema-editor",2),x("settingsChange",function(a){return n.onSettingsChange(a)}),d()(),c(3,"app-modal-footer",3),x("cancelButtonClick",function(){return n.modalService.dismiss()})("saveButtonClick",function(){return n.onSave()}),d()),t&2&&(f("modalInfo",ie(3,Kf,n.currentLayout.name))("border",!0),s(2),f("settings",n.currentLayout))},dependencies:[$l,Me,we],encapsulation:2})}}return i})();var No=(()=>
17{class i{static{this._displayTitleLanguageFallbackFields={de:["titleDe","titleEn","titleFr","titleUnd"],en:["titleEn","titleDe","titleFr","titleUnd"],fr:["titleFr","titleEn","titleDe","titleUnd"]}}static getDisplayTitle(e,t){if(!e)return"";let n=this._displayTitleLanguageFallbackFields[t];if(!n||n.length===0)return"";for(let r of n){let a=e[r];if(a)return a}return""}static resolveTitleByFallback(e,t){if(!e||e.length===0)return"";let n=this._displayTitleLanguageFallbackFields[t];if(!n||n.length===0)return"";for(let r of n){let a=e.find(l=>l.titleLanguage&&`title${l.titleLanguage}`.toLowerCase()===r.toLowerCase());if(a?.value)return a.value}return""}}return i})();var ko=(()=>{class i{constructor(){this._translocoService=g(ae),this._valueListService=g(go)}transform(e,t,n=""){let r=n!==""?n:this._translocoService.getActiveLang();switch(t){case"classificationIcs":return this.getIcsClassificationTitle(e,r);case"documentType":return this.getDocumentTypeTitle(e,r);case"flagStatus":return this.getFlagStatusTitle(e,r)}return M([])}getIcsClassificationTitle(e,t){return this._valueListService.getIcsClassificationByIcsKeyList(e).pipe(S(n=>{let r=[];for(let a=0;a<n.length;a++){let l=n[a];r.push(this.getTitleBySelectedLanguage(l,l.icsKey,t))}return r}))}getDocumentTypeTitle(e,t){return this._valueListService.getDocumentTypeDetailsByKeyList(e).pipe(S(n=>{let r=[];for(let a=0;a<n.length;a++){let l=n[a];r.push(this.getTitleBySelectedLanguage(l,l.shortKey,t))}return r}))}getFlagStatusTitle(e,t){let n=[],r=e.map(l=>{let m=l.shortKey,b=l.childKeyList;return n.push(m),m==="C"&&b&&(n=n.concat(b)),l});return this._valueListService.getFlagStatusDetailsByKeyStringList(n).pipe(S(l=>{let m=[];for(let b=0;b<r.length;b++){let O=r[b].shortKey,U=l.filter(Z=>Z.shortKey===O),H=this.getTitleBySelectedLanguage(U[0],O,t);if(r[b]?.childKeyList?.length>0){H+=" (";for(let Z=0;Z<r[b].childKeyList.length;Z++){let ee=r[b].childKeyList[Z],N=l.filter(ut=>ut.shortKey===ee)[0],Ce=this.getTitleBySelectedLanguage(N,ee,t);H+=Ce,Z<r[b].childKeyList.length-1&&(H+=", ")}H+=")"}m.push(H)}return m}))}getTitleBySelectedLanguage(e,t,n){let r=t+" ";switch(n){case"de":r+=e.germanTitle;break;case"en":r+=e.englishTitle;break;case"fr":r+=e.frenchTitle;break}return r}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"valueListTooltip",type:i,pure:!0})}}return i})();function Gf(i,o){if(i&1&&(c(0,"div")(1,"div",1),y(2,"app-icon",4),c(3,"span",5),v(4),h(5,"transloco"),h(6,"transloco"),d()()()),i&2){let e=p();s(2),W("icon-success",e.value)("icon-alert",!e.value),f("name",e.value?"check-mark-filled":"cross-filled"),s(2),D(e.value?C(5,6,"common.yes"):C(6,8,"common.no"))}}function qf(i,o){i&1&&y(0,"div")}function Wf(i,o){i&1&&(y(0,"app-icon",6),c(1,"span",7),v(2),h(3,"transloco"),d()),i&2&&(s(2),D(C(3,1,"search.hitlist.harmonized")))}function zf(i,o){i&1&&(y(0,"app-icon",8),c(1,"span",9),v(2),h(3,"transloco"),d()),i&2&&(s(2),D(C(3,1,"search.hitlist.mandated")))}function jf(i,o){if(i&1&&(c(0,"div",1),u(1,Wf,4,3),u(2,zf,4,3),d()),i&2){let e=p();s(),_((e.value.isCeDirective||e.value.isHarmonized)&&!e.value.isMandated?1:-1),s(),_(!e.value.isCeDirective&&!e.value.isHarmonized&&e.value.isMandated?2:-1)}}function Yf(i,o){if(i&1){let e=w();c(0,"a",10),x("click",function(){E(e);let n=p();return I(n.onShowAll())}),v(1),h(2,"transloco"),d()}i&2&&(s(),F("... ",C(2,1,"common.more")))}function Qf(i,o){if(i&1&&(c(0,"div",11),v(1),d()),i&2){let e=o.$implicit;s(),D(e)}}function Zf(i,o){if(i&1&&(G(0,Qf,2,1,"div",11,J),h(2,"valueListTooltip"),h(3,"async")),i&2){let e=p();q(C(3,3,de(2,0,e.valueListTitles,e.fieldName)))}}var Kl=(()=>{class i{constructor(){this.currentText="",this.valueListTitles=[],this.isCollapsed=!0,this.maxLength=200,this.styleClasses="",this.showAll=new R,this._userReferenceFields=["modifiedBy","createdBy","documentOwners"]}set fieldName(e){this._fieldName=e}get fieldName(){return this._fieldName}set value(e){this._value=e,this.currentText=this.getText()}get value(){return this._value}ngOnInit(){this.currentText=this.getText(),this.valueListTitles=this.getValueListTitles()}onShowAll(){this.showAll.emit()}getText(){let e="";return typeof this._value=="string"?e=this._value:typeof this._value=="number"?e=this._value.toString():this.fieldName==="custom_field"?e=this.getCustomFieldText(this._value):Array.isArray(this._value)?this._value.every(t=>typeof t!="string")?e=this.getFlagStatusListText(this._value):e=this._value.join(", "):this.isUserField(this.fieldName)&&(e=this.value.userName),this.shouldCollapseText(e)?(e=this.shortenText(e),this.isCollapsed=!0):this.isCollapsed=!1,e}getValueListTitles(){let e=[];return typeof this._value=="string"||this.fieldName==="valid"||this.fieldName==="ceInfo"?e=[this._value]:this.fieldName==="custom_field"?this._value?.forEach(t=>{e=[...this.valueListTitles,t.value]}):this.fieldName!=="flagStatus"||Array.isArray(this._value)?e=this._value:e=[this._value],e}getCustomFieldText(e){return e.map(t=>t.value).join(", ")}shouldCollapseText(e){return!(e.length<=this.maxLength||this.fieldName==="custom_field")}shortenText(e){let t=e.substring(0,this.maxLength),n=t.lastIndexOf(" ");return n===-1?t:t.substring(0,n)}getFlagStatusListText(e){return e.map(t=>this.getFlagStatusText(t)).join(", ")}getFlagStatusText(e){let t=e.shortKey;return e.childKeyList&&e.childKeyList.length>0&&(t+=` (${e.childKeyList.join(", ")})`),t}isUserField(e){return this._userReferenceFields.includes(e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-read-more"]],inputs:{maxLength:"maxLength",styleClasses:"styleClasses",fieldName:"fieldName",value:"value"},outputs:{showAll:"showAll"},decls:7,vars:8,consts:[["classificationIcsTip",""],[1,"icon-with-text"],[3,"innerHTML","ngClass","disableTooltip","ngbTooltip"],[1,"read-more-link"],["data-cy","iconValid",3,"name"],["data-cy","textValid"],["name","search-ce","data-cy","iconCeHarmonizedOrDirective",1,"icon-cl
17ickable-dark"],["data-cy","textCeHarmonizedOrDirective"],["name","search-ce","data-cy","iconCeMandated",1,"icon-clickable"],["data-cy","textCeMandated"],[1,"read-more-link",3,"click"],[1,"tooltip-text"]],template:function(t,n){if(t&1&&(u(0,Gf,7,10,"div"),u(1,qf,1,0,"div"),u(2,jf,3,2,"div",1),y(3,"div",2),u(4,Yf,3,3,"a",3),Y(5,Zf,4,5,"ng-template",null,0,fe)),t&2){let r=X(6);_(n.fieldName==="valid"?0:-1),s(),_(n.fieldName==="valid"&&(n.value===void 0||n.value===null)?1:-1),s(),_(n.fieldName==="ceInfo"?2:-1),s(),f("innerHTML",n.currentText,ni)("ngClass",n.styleClasses)("disableTooltip",!(n.fieldName==="classificationIcs"||n.fieldName==="documentType"||n.fieldName==="flagStatus"))("ngbTooltip",r),s(),_(n.isCollapsed?4:-1)}},dependencies:[Oe,lt,j,_e,z,ct,$,ko],styles:['.read-more-link[_ngcontent-%COMP%]{cursor:pointer;font-family:var(--font-family-italic)}.read-more-link[_ngcontent-%COMP%]:before{content:" "}.tooltip-text[_ngcontent-%COMP%]{display:flex;justify-content:flex-start}']})}}return i})();var qr=(function(i){return i.LINK_LIST="link_list",i.TEXT="text",i.TEXT_LIST="text_list",i.NESTED_LIST="nested_list",i})(qr||{});var Gl=[{translocoKey:"yes",value:"yes"},{translocoKey:"manual",value:"manual"},{translocoKey:"no",value:"no"},{translocoKey:"other",value:"other"}];var Ro=(()=>{class i{constructor(){this._translocoService=g(ae),this.monitoringStatusMap=new Map(Gl.map(e=>[e.value,e.translocoKey]))}transform(e){let t=this.monitoringStatusMap.get(e);return t?this._translocoService.translate(`common.metadata_label.pro_metadata.monitoringStatus_options.${t}`):""}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"transformMonitoringStatus",type:i,pure:!0})}}return i})();var ql=[{translocoKey:"created",value:"Created"},{translocoKey:"under_review",value:"UnderReview"},{translocoKey:"released",value:"Released"},{translocoKey:"approved_conditionally",value:"ApprovedConditionally"},{translocoKey:"not_released",value:"NotReleased"},{translocoKey:"other",value:"Other"}];var Ao=(()=>{class i{constructor(){this._translocoService=g(ae),this.releaseLevelsMap=new Map(ql.map(e=>[e.value,e.translocoKey]))}transform(e){let t=this.releaseLevelsMap.get(e);return t?this._translocoService.translate(`common.metadata_label.pro_metadata.releaseLevels.${t}`):""}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=Le({name:"transformReleaseLevel",type:i,pure:!0})}}return i})();function Jf(i,o){i&1&&(c(0,"div",0),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"search.no_information")))}function Xf(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p(3).$implicit;s(),F("<",e.ceType,">")}}function e0(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p(3).$implicit;s(),F("HARMBEGIN=",e.begin)}}function t0(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p(3).$implicit;s(),F("END=",e.end)}}function i0(i,o){if(i&1){let e=w();c(0,"div",3),x("click",function(){E(e);let n=p(2).$implicit,r=p(2);return I(r.searchOrNavigate.emit({value:n.id}))})("keydown.enter",function(){E(e);let n=p(2).$implicit,r=p(2);return I(r.searchOrNavigate.emit({value:n.id}))}),c(1,"span"),v(2),d(),u(3,Xf,2,1,"span"),u(4,e0,2,1,"span"),u(5,t0,2,1,"span"),d()}if(i&2){let e=p(2).$implicit;s(2),D(e.relation),s(),_(e!=null&&e.ceType?3:-1),s(),_(e!=null&&e.begin?4:-1),s(),_(e!=null&&e.begin&&(e!=null&&e.end)?5:-1)}}function n0(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p(3).$implicit;s(),F("<",e.ceType,">")}}function o0(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p(3).$implicit;s(),F("HARMBEGIN=",e.begin)}}function r0(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p(3).$implicit;s(),F("END=",e.end)}}function a0(i,o){if(i&1&&(c(0,"div",2)(1,"span"),v(2),d(),u(3,n0,2,1,"span"),u(4,o0,2,1,"span"),u(5,r0,2,1,"span"),d()),i&2){let e=p(2).$implicit;s(2),D(e.relation),s(),_(e!=null&&e.ceType?3:-1),s(),_(e!=null&&e.begin?4:-1),s(),_(e!=null&&e.begin&&(e!=null&&e.end)?5:-1)}}function s0(i,o){if(i&1&&u(0,i0,6,4,"div",1)(1,a0,6,4,"div",2),i&2){let e=p().$implicit;_(e.isHyperlink?0:1)}}function l0(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p(2).$implicit;s(),F("<",e.ceType,">")}}function c0(i,o){if(i&1){let e=w();c(0,"div",3),x("click",function(){E(e);let n=p().$implicit,r=p(2);return I(r.searchOrNavigate.emit({value:n.id}))})("keydown.enter",function(){E(e);let n=p().$implicit,r=p(2);return I(r.searchOrNavigate.emit({value:n.id}))}),c(1,"span"),v(2),d(),u(3,l0,2,1,"span"),d()}if(i&2){let e=p().$implicit;s(2),D(e.id),s(),_(e!=null&&e.ceType?3:-1)}}function d0(i,o){i&1&&(c(0,"div",0),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"search.no_information")))}function p0(i,o){if(i&1&&(u(0,s0,2,1),u(1,c0,4,2,"div",1),u(2,d0,3,3,"div",0)),i&2){let e=o.$implicit,t=p(2);_(t.isRelationDefined(e)?0:-1),s(),_(!t.isRelationDefined(e)&&e.id?1:-1),s(),_(!t.isRelationDefined(e)&&!e.id?2:-1)}}function m0(i,o){if(i&1&&G(0,p0,3,3,null,null,J),i&2){let e=p();q(e.value)}}function u0(i,o){if(i&1){let e=w();c(0,"app-read-more",6),h(1,"transformReleaseLevel"),x("showAll",function(){E(e);let n=p(2);return I(n.onShowAll())}),d()}if(i&2){let e=p(2);f("fieldName",e.fieldName)("value",C(1,2,e.value))}}function _0(i,o){if(i&1){let e=w();c(0,"app-read-more",6),h(1,"transformMonitoringStatus"),x("showAll",function(){E(e);let n=p(2);return I(n.onShowAll())}),d()}if(i&2){let e=p(2);f("fieldName",e.fieldName)("value",C(1,2,e.value))}}function h0(i,o){if(i&1){let e=w();c(0,"app-read-more",7),x("showAll",function(){E(e);let n=p(2);return I(n.onShowAll())}),d()}if(i&2){let e=p(2);f("value",e.value)("fieldName",e.fieldName)}}function f0(i,o){if(i&1&&(c(0,"div"),u(1,u0,2,4,"app-read-more",4),u(2,_0,2,4,"app-read-more",4)(3,h0,1,2,"app-read-more",5),d()),i&2){let e=p();s(),_(e.fieldName==="releaseLevel"?1:-1),s(),_(e.fieldName==="monitoringStatus"?2:3)}}function g0(i,o){if(i&1){let e=w();c(0,"div")(1,"app-read-more",7),x("showAll",function(){E(e);let n=p();return I(n.onShowAll())}),d()()}if(i&2){let e=p();s(),f("value",e.value)("fieldName",e.fieldName)}}function C0(i,o){if(i&1){let e=w();c(0,"div")(1,"app-read-more",8),h(2,"internationalRelationshipOutput"),x("showAll",function(){E(e);let n=p();return I(n.onShowAll())}),d()()}if(i&2){let e=p();s(),f("value",C(2,1,e.value))}}var Wl=(()=>{class i{constructor(){this.showAll=new R,this.searchOrNavigate=new R,this.miniDetailDisplayFieldType=qr}getType(){let e;return this.isEmpty(this.value,this.fieldName)||this.isCEInfoActivated(this.value,this.fieldName)||Array.isArray(this.value)&&this.value.length<=0?e=null:this.isLinkList()?e=this.miniDetailDisplayFieldType.LINK_LIST:this.isTextList(
17)?e=this.miniDetailDisplayFieldType.TEXT_LIST:this.isNestedList()?e=this.miniDetailDisplayFieldType.NESTED_LIST:e=this.miniDetailDisplayFieldType.TEXT,e}onShowAll(){this.showAll.emit()}isRelationDefined(e){return e?.relation?.length}isEmpty(e,t){return!e&&!this.isSpecialField(t)}isSpecialField(e){return e==="valid"||e==="ceInfo"}isCEInfoActivated(e,t){return t==="ceInfo"&&!e?.isCeDirective&&!e?.isHarmonized&&!e?.isMandated}isLinkList(){return Array.isArray(this.value)&&this.value.length>0&&Yt.isRelationField(this.value[0])}isTextList(){return Array.isArray(this.value)&&this.value.length>0&&Yt.isString(this.value[0])}isNestedList(){return this.value instanceof Object&&Object.hasOwn(this.value,"identical")}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-mini-detail-display-field-resolver"]],inputs:{value:"value",fieldName:"fieldName"},outputs:{showAll:"showAll",searchOrNavigate:"searchOrNavigate"},decls:5,vars:5,consts:[[1,"text-italic"],["data-cy","metadataLink",1,"link-text"],["data-cy","metadataLink"],["data-cy","metadataLink",1,"link-text",3,"click","keydown.enter"],[3,"fieldName","value"],[3,"value","fieldName"],[3,"showAll","fieldName","value"],[3,"showAll","value","fieldName"],[3,"showAll","value"]],template:function(t,n){t&1&&(u(0,Jf,3,3,"div",0),u(1,m0,2,0),u(2,f0,4,2,"div"),u(3,g0,2,2,"div"),u(4,C0,3,3,"div")),t&2&&(_(n.getType()===null?0:-1),s(),_(n.getType()===n.miniDetailDisplayFieldType.LINK_LIST?1:-1),s(),_(n.getType()===n.miniDetailDisplayFieldType.TEXT?2:-1),s(),_(n.getType()===n.miniDetailDisplayFieldType.TEXT_LIST?3:-1),s(),_(n.getType()===n.miniDetailDisplayFieldType.NESTED_LIST?4:-1))},dependencies:[Kl,z,po,$,Ro,Ao],encapsulation:2})}}return i})();function v0(i,o){if(i&1&&(c(0,"p",12),v(1),h(2,"transloco"),d()),i&2){let e=p().$implicit,t=p(2);s(),F(" ",C(2,1,"common.metadata_label.pro_metadata."+t.getCorrectLabel(e.fieldName))," ")}}function b0(i,o){if(i&1&&(c(0,"p",12),v(1),h(2,"transloco"),d()),i&2){let e=p().$implicit;s(),F(" ",C(2,1,"common.metadata_label."+e.fieldName)," ")}}function y0(i,o){if(i&1){let e=w();c(0,"div",9),u(1,v0,3,3,"p",12),u(2,b0,3,3,"p",12),c(3,"app-mini-detail-display-field-resolver",13),x("showAll",function(){let n=E(e).$implicit,r=p(2);return I(r.onShowAllMetas(r.item,n.fieldName))})("searchOrNavigate",function(n){E(e);let r=p(2);return I(r.searchOrNavigate.emit(n))}),d()()}if(i&2){let e=o.$implicit,t=p(2);P("data-cy",e.fieldName+"Mini"),s(),_(t.isCustomerField(e.fieldName)?1:-1),s(),_(t.isCustomerField(e.fieldName)?-1:2),s(),f("value",t.getItemValue(e.fieldName))("fieldName",e.fieldName)}}function x0(i,o){if(i&1&&(c(0,"p",12),v(1),h(2,"transloco"),d()),i&2){let e=p().$implicit,t=p(2);s(),F(" ",C(2,1,"common.metadata_label.pro_metadata."+t.getCorrectLabel(e.fieldName))," ")}}function S0(i,o){if(i&1&&(c(0,"p",12),v(1),h(2,"transloco"),d()),i&2){let e=p().$implicit;s(),F(" ",C(2,1,"common.metadata_label."+e.fieldName)," ")}}function T0(i,o){if(i&1){let e=w();c(0,"div",9),u(1,x0,3,3,"p",12),u(2,S0,3,3,"p",12),c(3,"app-mini-detail-display-field-resolver",13),x("showAll",function(){let n=E(e).$implicit,r=p(2);return I(r.onShowAllMetas(r.item,n.fieldName))})("searchOrNavigate",function(n){E(e);let r=p(2);return I(r.searchOrNavigate.emit(n))}),d()()}if(i&2){let e=o.$implicit,t=p(2);P("data-cy",e.fieldName+"Mini"),s(),_(t.isCustomerField(e.fieldName)?1:-1),s(),_(t.isCustomerField(e.fieldName)?-1:2),s(),f("value",t.getItemValue(e.fieldName))("fieldName",e.fieldName)}}function D0(i,o){if(i&1&&(c(0,"p",12),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit,t=p(2);s(),F(" ",C(2,1,"common.metadata_label.pro_metadata."+t.getCorrectLabel(e.fieldName))," ")}}function E0(i,o){if(i&1&&(c(0,"p",12),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit;s(),F(" ",C(2,1,"common.metadata_label."+e.fieldName)," ")}}function I0(i,o){if(i&1){let e=w();u(0,D0,3,3,"p",12),u(1,E0,3,3,"p",12),c(2,"app-mini-detail-display-field-resolver",13),x("showAll",function(){E(e);let n=p().$implicit,r=p(2);return I(r.onShowAllMetas(r.item,n.fieldName))})("searchOrNavigate",function(n){E(e);let r=p(3);return I(r.searchOrNavigate.emit(n))}),d()}if(i&2){let e=p().$implicit,t=p(2);_(t.isCustomerField(e.fieldName)?0:-1),s(),_(t.isCustomerField(e.fieldName)?-1:1),s(),f("value",t.getItemV
17alue(e.fieldName))("fieldName",e.fieldName)}}function F0(i,o){if(i&1&&(c(0,"div",9),u(1,I0,3,4),d()),i&2){let e=o.$implicit,t=p(2);P("data-cy",e.fieldName+"Mini"),s(),_(e.fieldPosition===t.miniDetailDisplayFieldPosition.RIGHT?1:-1)}}function M0(i,o){if(i&1&&(c(0,"div",1)(1,"div",8),G(2,y0,4,5,"div",9,J),d(),c(4,"div",10),G(5,T0,4,5,"div",9,J),d(),c(7,"div",11),G(8,F0,2,2,"div",9,J),d()()),i&2){let e=p();s(2),q(e.leftFields),s(3),q(e.centerFields),s(3),q(e.longFields)}}function w0(i,o){if(i&1){let e=w();Ue(0)(1,14),c(2,"app-select",15),x("itemSelected",function(n){E(e);let r=p();return I(r.onLayoutSelected(n))}),d(),Be()()}if(i&2){let e=p(),t=X(14);s(),f("formGroup",e.selectForm),s(),f("items",e.selectOptions)("customSelectTemplate",t)}}function O0(i,o){if(i&1){let e=w();c(0,"div",17)(1,"button",18),x("click",function(n){E(e);let r=p(2).$implicit,a=p();return I(a.onEditFormat(n,r))}),y(2,"app-icon",19),d(),c(3,"button",20),x("click",function(n){E(e);let r=p(2).$implicit,a=p();return I(a.onDeleteFormat(n,r))}),y(4,"app-icon",21),d()()}}function P0(i,o){if(i&1&&(c(0,"div",16)(1,"span"),v(2),h(3,"transloco"),d(),u(4,O0,5,0,"div",17),d()),i&2){let e=p().$implicit,t=p();s(2),D(C(3,2,e==null?null:e.text)),s(2),_(e.value&&(e.value!==t.tenantWideLayoutId||e.text!==t.defaultLabelTexts.tenantWide)&&e.value!==t.userDefaultLayoutId?4:-1)}}function N0(i,o){if(i&1&&(y(0,"app-icon",22),c(1,"span",23),v(2),h(3,"transloco"),d()),i&2){let e=p().$implicit;s(2),D(C(3,1,e==null?null:e.text))}}function k0(i,o){if(i&1&&(u(0,P0,5,4,"div",16),u(1,N0,4,3)),i&2){let e=o.$implicit,t=p();_(e.value!=="newTemplate"?0:-1),s(),_(e.text!==t.defaultLabelTexts.default&&e.value==="newTemplate"?1:-1)}}var zl=(()=>{class i{constructor(){this._searchConfig=g(hi),this._authService=g(ue),this._changeDetectorRef=g(ze),this._feedbackService=g(pt),this._itemDetailService=g(Qn),this._languageStorageService=g(_i),this._miniDisplayFormatService=g(Ci),this._modalService=g(he),this._tenantStateService=g(gi),this.defaultLabelTexts={create:"search.create_layout",default:"search.extended_search.default_layout",tenantWide:"search.tenant_wide_template"},this.showAllMetas=new R,this.searchOrNavigate=new R,this.formatCollection=[],this.mayDeleteOrEditTenantWideFormat=!1,this.miniDetailDisplayFieldPosition=Ii,this.leftFields=[],this.centerFields=[],this.longFields=[],this.permissions=se}set format(e){this._format=e,this.leftFields=this._format.fields.filter(t=>t.fieldPosition===this.miniDetailDisplayFieldPosition.LEFT),this.centerFields=this._format.fields.filter(t=>t.fieldPosition===this.miniDetailDisplayFieldPosition.CENTER),this.longFields=this._format.fields.filter(t=>t.fieldPosition===this.miniDetailDisplayFieldPosition.RIGHT)}ngOnInit(){if(this.selectForm=new Je({selectedLayout:new je("")}),this._currentLanguageSubscription=this._languageStorageService.currentLanguage$.subscribe({next:e=>{this._currentLanguage=e}}),this.item!=null){let e=this._itemDetailService.searchFullDetailItem(this.item.acCode),t=this._tenantStateService.isNautosProActive()?this._itemDetailService.fetchProMetadataFields(this.item.acCode):M(null);et({item:e,customFields:t}).subscribe(n=>{let{item:r,customFields:a}=n;this.itemDetails=K(K({},r),a),this._changeDetectorRef.detectChanges()})}this._miniDisplayFormatService.currentFormat$.subscribe(e=>{e&&(this.format=e)}),this._miniDisplayFormatService.defaultFormat$.subscribe(e=>{e&&(e.isUserDefault=!0,this.defaultFormat=e,this.userDefaultLayoutId=e.id)}),this._miniDisplayFormatService.tenantFormat$.subscribe(e=>{this._tenantWideFormat=e,this.tenantWideLayoutId=e?.id??void 0;let t=this._authService.userInfo.userAccountId;this.mayDeleteOrEditTenantWideFormat=this._tenantWideFormat?.userAccountId===t}),this._miniDisplayFormatService.generalFormats$.subscribe(e=>{e&&(this.formatCollection=re.cloneDeep(e))}),Ot([this._miniDisplayFormatService.generalFormats$,this._miniDisplayFormatService.defaultFormat$,this._miniDisplayFormatService.currentFormat$,this._miniDisplayFormatService.tenantFormat$]).subscribe(e=>{let[t,n,r]=e;t&&n&&r&&this.createSelectOptions()})}ngOnDestroy(){this._currentLanguageSubscription&&this._currentLanguageSubscription.unsubscribe(),this._activateSubscription&&this._activateSubscription.unsubscribe(),this._deleteSubscription&&this._deleteSubscription.unsubscribe(),this._formatCollectionSubscription&&this._formatCollectionSubscription.unsubscribe()}
17onShowAllMetas(e,t){this.showAllMetas.emit({acCode:e.acCode,fragment:t})}onCloseExpanded(e){e.expanded=!e.expanded}onOpenMiniDisplayFormatDialog(e){let t=this._modalService.open(Hl,{windowClass:"modal-fullscreen",isCentered:!1});t.componentInstance.activeFormat=e,t.result.then(n=>{n.success?(this._feedbackService.showSuccessModal("search.hitlist.layout_saved"),e.isTenantWide||this.onSelectFormat(n.updatedFormat)):this._feedbackService.showErrorModal()})}getItemValue(e){if(e=Object.hasOwn(this._searchConfig.mapFieldKeys,e)?this._searchConfig.mapFieldKeys[e]:e,!this.itemDetails)return"";switch(e){case"acCode":return this.itemDetails.id;case"custom_field":return[...this.itemDetails.customFields];case"ceInfo":return this.buildCeInfoModel();case"overview":return this.itemDetails.overviewUnd;case"transitionPeriod":return this.itemDetails.transition;case"withdrawalDate":return this.itemDetails.withdrawal;case"sectionalList":return this.itemDetails.admSectional;case"flagStatus":return this.item.flagStatus;case"citation":return this.buildCitationList();case"edvNr":return this.buildEdvNrList();case"titleDynamic":return No.getDisplayTitle(this.item,this._currentLanguage);default:return this.extractDefaultValue(e)}}isDefaultFormat(e){return e?.id===this.defaultFormat.id}onSelectFormat(e){this._activateSubscription&&this._activateSubscription.unsubscribe(),this._activateSubscription=this._miniDisplayFormatService.setCurrentFormat(e).subscribe()}onResetFormat(){this._activateSubscription&&this._activateSubscription.unsubscribe(),this._activateSubscription=this._miniDisplayFormatService.resetCurrentFormat().subscribe(e=>{e===!0&&this.patchSelectForm(this.defaultFormat.id)})}onLayoutSelected(e){let t=e;if(t==="newTemplate")this.onCreateFormat();else if(this.defaultFormat.id===t)this.onResetFormat();else{let n=this.selectForm.value.selectedLayout,r=this.getSelectedMiniDetailsFormat(n);this.onSelectFormat(r)}}onDeleteFormat(e,t){e.stopPropagation();let n=this._modalService.open(bi);n.componentInstance.isDeleteConfirmation=!0,n.componentInstance.title="search.mini_detail_layout.delete",n.componentInstance.text="search.mini_detail_layout.delete_info";let r=this.formatCollection.find(a=>a.id===t.value);n.result.then(a=>{a.preset&&(this._deleteSubscription&&this._deleteSubscription.unsubscribe(),this._deleteSubscription=this._miniDisplayFormatService.deleteFormat(r).pipe(Pt(200)).subscribe(l=>{l===!0?this._feedbackService.showSuccessModal("search.hitlist.layout_deleted"):this._feedbackService.showErrorModal()}))})}onEditFormat(e,t){e.stopPropagation();let n=this.formatCollection.find(r=>r.id===t.value);this.onOpenMiniDisplayFormatDialog(n)}onCreateFormat(){let e=this._modalService.open(Bl);e.componentInstance.currentFormat=this.defaultFormat,e.componentInstance.changes={},e.componentInstance.clone=!1,e.result.then(t=>{t?.updatedFormat?this.onOpenMiniDisplayFormatDialog(t.updatedFormat):this._feedbackService.showErrorModal()})}getCorrectLabel(e){return Ht.getCorrectLabel(e)}isCustomerField(e){return Rt.map(t=>t.id.toLowerCase()).includes(e.toLowerCase())}buildCeInfoModel(){return{isCeDirective:this.itemDetails.isCeDirective,isHarmonized:this.itemDetails.isHarmonized,isMandated:this.itemDetails.isMandated}}buildCitationList(){return this.itemDetails.citation?.length?this.itemDetails.citation.map(e=>({begin:"",end:"",id:e.id,internationalRelationType:e.internationalRelationType,isHyperlink:e.isHyperlink,relation:e.relation,name:"",ceType:"",toBeAnnounced:!1})):[]}buildEdvNrList(){return this.itemDetails.documents?.length?this.itemDetails.documents.map(e=>e.edvNr).join(", "):""}extractDefaultValue(e){let t=this.itemDetails[e];if(Array.isArray(t)&&t.length>0){if(Yt.isLanguageField(t)){let n=t.find(r=>r.languageKey===this._currentLanguage);return n?n.languageData:t}return t}return t??""}createSelectOptions(){let e=[],t={text:this.defaultLabelTexts.create,value:"newTemplate",disabled:!1},n={text:this.defaultLabelTexts.default,value:this.userDefaultLayoutId,disabled:!1},r={text:this.defaultLabelTexts.tenantWide,value:this.tenantWideLayoutId??null,disabled:!this._tenantWideFormat};e.push(t),e.push(r),this.userDefaultLayoutId&&e.push(n),this.formatCollection.forEach(l=>{l&&e.push({text:l.name,value:l.id,disabled:!1})}),this.selectOptions=e;let a=this.getSelectedMiniDetailsFormat(this._format.id);this.patchSelectForm(a.id)}getSelectedMiniDetailsFormat(e){return this.formatCollection.concat(this._tenantWideFormat).find(r=>r?.id===e)??this.defaultFormat}patchSelectForm(e){this.selectForm.controls.selectedLayout.patchValue(e)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-mini-detail"]],inputs:{item:"item",defaultFormat:"defaultFormat",currentRow:"currentRow",format:"format"},outputs:{showAllMetas:"showAllMetas",searchOrNavigate:"searchOrNavigate"},decls:15,vars:8,consts:[["layoutSelect",""],[1,"mini-detail-container"],[1,"mini-detail-options"],[4,"permissions"],["type","button","data-cy","openDetails",1,"btn-primary-outline",3,"click"],["name","arrow","direction","right"],["type","button",1,"btn-collapse-small",3,"click"],["name","chevron","direction","up"],["data-cy","miniDetailsLeft"],[1,"metadata-fields"],["data-cy","miniDetailsCenter"],["data-cy","miniDetailsRight"],[1,"label-bold-top"],[3,"showAll","searchOrNavigate","value","fieldName"],[3,"formGroup"],["label","search.mini_detail_layout.title","labelPosition","left","formControlName","selectedLayout","data-cy","miniDetailsLayout",1,"mini-layout",3,"itemSelected","items","customSelectTemplate"],[1,"mini-detail-entry"],[1,"actions"],["type","button","data-cy","iconEditMiniLayout",1,"btn-icon-no-border",3,"click"],["name","edit"],["type","button","data-cy","iconDeleteMiniLayout",1,"btn-icon-no-border",3,"click"],["name","delete"],["name","settings"],[1,"text-bold"]],template:function(t,n){t&1&&(u(0,M0,10,0,"div",1),c(1,"div",2),Y(2,w0,3,3,"ng-container",3),c(3,"button",4),x("click",function(){return n.onShowAllMetas(n.item,"")}),c(4,"span"),v(5),h(6,"transloco"),d(),y(7,"app-icon",5),d(),c(8,"button",6),x("click",function(){return n.onCloseExpanded(n.currentRow)}),y(9,"app-icon",7),c(10,"span"),v(11),h(12,"transloco"),d()()(),Y(13,k0,2,2,"ng-template",null,0,fe)),t&2&&(_(n.itemDetails?0:-1),s(2),f("permissions",n.permissions.SETTINGS),s(3),D(C(6,4,"search.show_all_metadata")),s(6),D(C(12,6,"common.close")))},dependencies:[j,Wl,Qe,Te,ye,mo,Ee,De,z,xt,$],styles:[".mini-detail-container[_ngcontent-%COMP%]{display:flex;gap:var(--spacer);width:100vw}.mini-detail-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}.mini-detail-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:last-child{flex:2}.mini-detail-container[_ngcontent-%COMP%] .metadata-fields[_ngcontent-%COMP%]{margin-bottom:var(--spacer)}.mini-detail-container[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-family:var(--font-family-bold);margin-bottom:3px}.mini-detail-options[_ngcontent-%COMP%]{align-items:center;border-top:var(--border);display:flex;gap:var(--spacer);padding-top:calc(var(--spacer) / 2)}.mini-detail-options[_ngcontent-%COMP%] app-select[_ngcontent-%COMP%]{min-width:24rem}.mini-detail-options[_ngcontent-%COMP%] app-select[_ngcontent-%COMP%] .text-bold[_ngcontent-%COMP%]{color:var(--color-primary);font-family:var(--font-family-bold)}.mini-detail-options[_ngcontent-%COMP%] app-select[_ngcontent-%COMP%] .mini-detail-entry[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.mini-detail-options[_ngcontent-%COMP%] app-select[_ngcontent-%COMP%] .mini-detail-entry[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;margin:0}.mini-detail-options[_ngcontent-%COMP%] .btn-collapse-small[_ngcontent-%COMP%]{background-color:transparent;width:fit-content}"],changeDetection:0})}}return i})();var R0=["textElement"];function A0(i,o){if(i&1&&(c(0,"div",6),y(1,"app-document-list",11),d()),i&2){let e=p();s(),f("showDocumentTitle",!0)("itemId",e.item.acCode)}}function L0(i,o){i&1&&(c(0,"span"),v(1,"\xA0,\xA0"),d())}function U0(i,o){if(i&1&&(c(0,"span"),v(1),d(),u(2,L0,2,0,"span")),i&2){let e=o.$implicit,t=o.$index,n=o.$count;s(),D(e==null?null:e.edvNr),s(),_(t!==n-1?2:-1)}}function B0(i,o){if(i&1&&(c(0,"div",7),G(1,U0,3,2,null,null,J),d()),i&2){let e=p();s(),q(e.item==null?null:e.item.documents)}}function V0(i,o){i&1&&(c(0,"span"),v(1,",\xA0"),d())}function $0(i,o){if(i&1&&(c(0,"span"),v(1),d(),u(2,V0,2,0,"span")),i&2){let e=o.$implicit,t=o.$index,n=o.$count;s(),D(e),s(),_(t!==n-1?2:-1)}}function H0(i,o){if(i&1&&(c(0,"div",7),G(1,$0,3,2,null,null,J),d()),i&2){let e=p();s(),q(e.item.admSectional)}}function K0(i,o){i&1&&(c(0,"span"),v(1,",\xA0"),d())}function G0(i,o){if(i&1&&(c(0,"span"),v(1),d(),u(2,K0,2,0,"span")),i&2){let e=o.$implicit,t=o.$index,n=o.$count;s(),D(e),s(),_(t!==n-1?2:-1)}}function q0(i,o){if(i&1&&(c(0,"div",8),G(1,G0,3,2,null,null,J),d()),i&2){let e=p();s(),q(e.item.refDocNrSpecial)}}function W0(i,o){if(i&1&&(c(0,"span",7),v(1),d()),i&2){let e=p(2);s(),An("",e.item[e.cellTemplate].lastname,", ",e.item[e.cellTemplate].forename,"
17(",e.item[e.cellTemplate].username,")")}}function z0(i,o){if(i&1&&(c(0,"div",8),u(1,W0,2,3,"span",7),d()),i&2){let e=p();s(),_(e.item[e.cellTemplate]?1:-1)}}function j0(i,o){if(i&1&&(c(0,"span",7),v(1),d()),i&2){let e=p(2);s(),D(e.item[e.cellTemplate])}}function Y0(i,o){if(i&1&&(c(0,"div",8),u(1,j0,2,1,"span",7),d()),i&2){let e=p();s(),_(e.item[e.cellTemplate]&&e.item[e.cellTemplate]!=="0"?1:-1)}}function Q0(i,o){i&1&&(c(0,"span"),v(1," | "),d())}function Z0(i,o){if(i&1&&(v(0),u(1,Q0,2,0,"span")),i&2){let e=o.$implicit,t=o.$index,n=o.$count;An(" ",e.lastname,", ",e.forename," (",e.username,") "),s(),_(t!==n-1?1:-1)}}function J0(i,o){if(i&1&&(c(0,"span"),G(1,Z0,2,4,null,null,J),d()),i&2){let e=p(2);s(),q(e.item[e.cellTemplate])}}function X0(i,o){if(i&1&&(c(0,"div",7),u(1,J0,3,0,"span"),d()),i&2){let e=p();s(),_(e.item[e.cellTemplate]?1:-1)}}function eg(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=o;s(),An(" ",e.lastname,", ",e.forename," (",e.username,") ")}}function tg(i,o){if(i&1&&(c(0,"div",7),u(1,eg,2,3,"span"),d()),i&2){let e,t=p();s(),_((e=t.getLastModified(t.item[t.cellTemplate]))?1:-1,e)}}function ig(i,o){if(i&1&&(c(0,"div",7)(1,"span"),v(2),h(3,"transformReleaseLevel"),d()()),i&2){let e=p();s(2),D(C(3,1,e.item.releaseLevel))}}function ng(i,o){if(i&1&&(c(0,"div",7)(1,"span"),v(2),h(3,"transformMonitoringStatus"),d()()),i&2){let e=p();s(2),D(C(3,1,e.item.monitoringStatus))}}function og(i,o){if(i&1&&y(0,"div",9,5),i&2){let e=p(),t=X(28);f("innerHTML",e.getDisplayTitle(e.item),ni)("ngbTooltip",e.isTruncated?t:"")}}function rg(i,o){if(i&1&&y(0,"div",9,5),i&2){let e=p(),t=X(26);f("innerHTML",e.cellValue,ni)("ngbTooltip",e.isTruncated?t:"")}}function ag(i,o){if(i&1&&(c(0,"div")(1,"div",12),y(2,"app-icon",13),c(3,"span",14),v(4),h(5,"transloco"),h(6,"transloco"),d()()()),i&2){let e=p();s(2),W("icon-success",e.item.valid)("icon-alert",!e.item.valid),f("name",e.item.valid?"check-mark-filled":"cross-filled"),s(2),D(e.item.valid?C(5,6,"common.yes"):C(6,8,"common.no"))}}function sg(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p().$implicit;s(),D(e.relation)}}function lg(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p().$implicit;s(),D(e.id)}}function cg(i,o){if(i&1&&(c(0,"span"),v(1),d()),i&2){let e=p().$implicit;s(),F("<",e.ceType,">")}}function dg(i,o){i&1&&(c(0,"span"),v(1,","),d())}function pg(i,o){if(i&1&&(c(0,"div",15),u(1,sg,2,1,"span"),u(2,lg,2,1,"span"),u(3,cg,2,1,"span"),u(4,dg,2,0,"span"),d()),i&2){let e=o.$implicit,t=o.$index,n=p(2);s(),_(e.relation?1:-1),s(),_(e.relation?-1:2),s(),_(e!=null&&e.ceType?3:-1),s(),_(t<n.item.linkLegislation.length-1?4:-1)}}function mg(i,o){if(i&1&&(c(0,"div",7),G(1,pg,5,4,"div",15,J),d()),i&2){let e=p();s(),q(e.item.linkLegislation)}}function ug(i,o){i&1&&(c(0,"div",16),y(1,"app-icon",17),h(2,"transloco"),h(3,"transloco"),c(4,"span",18),v(5),h(6,"transloco"),d()()),i&2&&(s(),f("ngbTooltip",C(2,3,"search.ce_search.tooltip_harmonized_or_directive")),P("aria-label",C(3,5,"search.ce_search.tooltip_harmonized_or_directive")),s(4),D(C(6,7,"search.hitlist.harmonized")))}function _g(i,o){i&1&&(c(0,"div",16),y(1,"app-icon",19),h(2,"transloco"),h(3,"transloco"),c(4,"span",18),v(5),h(6,"transloco"),d()()),i&2&&(s(),f("ngbTooltip",C(2,3,"search.ce_search.tooltip_mandated")),P("aria-label",C(3,5,"search.ce_search.tooltip_mandated")),s(4),D(C(6,7,"search.hitlist.mandated")))}function hg(i,o){if(i&1&&(c(0,"div"),u(1,ug,7,9,"div",16),u(2,_g,7,9,"div",16),d()),i&2){let e=p();s(),_((e.item.isCeDirective||e.item.isHarmonized)&&!e.item.isMandated?1:-1),s(),_(!e.item.isCeDirective&&!e.item.isHarmonized&&e.item.isMandated?2:-1)}}function fg(i,o){i&1&&(c(0,"span"),v(1,",\xA0"),d())}function gg(i,o){if(i&1&&(c(0,"span"),v(1),d(),u(2,fg,2,0,"span")),i&2){let e=o.$implicit,t=o.$index,n=o.$count;s(),D(e),s(),_(t!==n-1?2:-1)}}function Cg(i,o){if(i&1&&(c(0,"div",10),G(1,gg,3,2,null,null,J),d()),i&2){let e=p(),t=X(20);f("ngbTooltip",t),s(),q(e.item==null?null:e.item.classificationIcs)}}function vg(i,o){i&1&&(c(0,"span"),v(1,",\xA0"),d())}function bg(i,o){if(i&1&&(c(0,"span"),v(1),d(),u(2,vg,2,0,"span")),i&2){let e=o.$implicit,t=o.$index,n=o.$count;s(),D(e),s(),_(t!==n-1?2:-1)}}function yg(i,o){if(i&1&&(c(0,"div",10),G(1,bg,3,2,null,null,J),d()),i&2){let e=p(),t=X(22);f("ngbTooltip",t),s(),q(e.item==null?null:e.item.documentType)}}function xg(i,o){i&1&&(Ue(0),v(1,"("),Be())}function Sg(i,o){i&1&&(c(0,"span"),v(1,",\xA0"),d())}function Tg(i,o){if(i&1&&(c(0,"span"),v(1),d(),u(2,Sg,2,0,"span")),i&2){let e=o.$implicit,t=o.$index,n=p().$implicit;s(),D(e),s(),_(t<(n==null?null:n.childKeyList.length)-1?2:-1)}}function Dg(i,o){i&1&&(Ue(0),v(1,")"),Be())}function Eg(i,o){i&1&&(c(0,"span"),v(1,",\xA0"),d())}function Ig(i,o){if(i&1&&(c(0,"span"),v(1),d(),u(2,xg,2,0,"ng-container"),G(3,Tg,3,2,null,null,J),u(5,Dg,2,0,"ng-container"),u(6,Eg,2,0,"span")),i&2){let e=o.$implicit,t=o.$index,n=o.$count;s(),D(e.shortKey),s(),_(e.childKeyList.length>0?2:-1),s(),q(e==null?null:e.childKeyList),s(2),_(e.childKeyList.length>0?5:-1),s(),_(t!==n-1?6:-1)}}function Fg(i,o){if(i&1&&(c(0,"div",10),G(1,Ig,7,4,null,null,J),d()),i&2){let e=p(),t=X(24);f("ngbTooltip",t),s(),q(e.item==null?null:e.item.flagStatus)}}function Mg(i,o){if(i&1&&(c(0,"span",20),v(1),d()),i&2){let e=o.$implicit;s(),F(" ",e.relation," ")}}function wg(i,o){if(i&1&&(c(0,"div",7),G(1,Mg,2,1,"span",20,J),d()),i&2){let e=p();s(),q(e.item[e.cellTemplate])}}function Og(i,o){if(i&1&&(c(0,"div",21),v(1),d()),i&2){let e=o.$implicit;s(),D(e)}}function Pg(i,o){if(i&1&&(G(0,Og,2,1,"div",21,J),h(2,"valueListTooltip"),h(3,"async")),i&2){let e=p();q(C(3,3,de(2,0,e.item.classificationIcs,"classificationIcs")))}}function Ng(i,o){if(i&1&&(c(0,"div",21),v(1),d()),i&2){let e=o.$implicit;s(),D(e)}}function kg(i,o){if(i&1&&(G(0,Ng,2,1,"div",21,J),h(2,"valueListTooltip"),h(3,"async")),i&2){let e=p();q(C(3,3,de(2,0,e.item.documentType,"documentType")))}}function Rg(i,o){if(i&1&&(c(0,"div",21),v(1),d()),i&2){let e=o.$implicit;s(),D(e)}}function Ag(i,o){if(i&1&&(G(0,Rg,2,1,"div",21,J),h(2,"valueListTooltip"),h(3,"async")),i&2){let e=p();q(C(3,3,de(2,0,e.item.flagStatus,"flagStatus")))}}function Lg(i,o){if(i&1&&y(0,"span",22),i&2){let e=p();f("innerHTML",e.cellValue,ni)}}function Ug(i,o){if(i&1&&y(0,"span",22),i&2){let e=p();f("innerHTML",e.getDisplayTitle(e.item),ni)}}var jl=(()=>{class i{constructor(){this._changeDetectorRef=g(ze),this._languageStorageService=g(_i),this.isTitleTemplate=!1,this._currentLanguage="de",this._ellipsisCache=new Map,this.itemAddedToCart=new R,this.isTruncated=!1}set item(e){this._item=e,this.updateItem(),setTimeout(()=>this.checkForEllipsis(),0)}get item(){return this._item}ngOnInit(){this._languageSubscription=this._languageStorageService.currentLanguage$.subscribe(e=>this._currentLanguage=e),this.updateItem()}ngAfterViewInit(){this.updateItem()}ngOnDestroy(){this._languageSubscription&&this._languageSubscription.unsubscribe()}getDisplayTitle(e){return No.getDisplayTitle(e,this._currentLanguage)}updateItem(){if(!this.cellTemplate)return;let e=["titlede","titleen","titlefr"];this._cellFieldName=this.cellTemplate,this.isTitleTemplate=e.includes(this.cellTemplate.toLowerCase()),this._cellFieldName==="titleDynamic"?(this.cellValue=this.getDisplayTitle(this.item),this.tooltipText=this.getDisplayTitle(this.item)):(this.cellValue=this.item[this._cellFieldName],this.tooltipText=this.item[this._cellFieldName]??""),setTimeout(()=>{this._changeDetectorRef.detectChanges(),this.isTruncated=this.checkForEllipsis()},0)}checkForEllipsis(){let e=this.textElement?.nativeElement;if(!e)return!1;let t=e?.innerText;if(!t)return!1;if(this._ellipsisCache.has(t))return this._ellipsisCache.get(t);let n=e.cloneNode(!0);return n.style.position="absolute",n.style.visibility="hidden",n.style.height="auto",n.style.maxWidth=e.clientWidth+"px",n.style.whiteSpace="normal",n.style.top="200",n.style.left="200",document.body.appendChild(n),this.isTruncated=n.scrollHeight>e.clientHeight,this._ellipsisCache.set(t,this.isTruncated),document.body.removeChild(n),this.isTruncated}
17getLastModified(e){return e?.length?e[e.length-1]:null}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-cell-template-resolver"]],viewQuery:function(t,n){if(t&1&&Ge(R0,5),t&2){let r;le(r=ce())&&(n.textElement=r.first)}},inputs:{cellTemplate:"cellTemplate",item:"item"},outputs:{itemAddedToCart:"itemAddedToCart"},decls:29,vars:19,consts:[["classificationIcsTip",""],["documentTypeTip",""],["flagStatusTip",""],["tooltipContent",""],["tooltipContentValue",""],["textElement",""],[1,"document-functions-container"],[1,"ellipsicated","link"],[1,"ellipsicated"],[1,"ellipsicated","link",3,"innerHTML","ngbTooltip"],[1,"ellipsicated","link",3,"ngbTooltip"],[3,"showDocumentTitle","itemId"],[1,"icon-with-text","link"],["data-cy","iconValid",3,"name"],["data-cy","textValid"],[1,"link"],[1,"ce-search"],["name","search-ce","data-cy","iconCeHarmonizedOrDirective",1,"icon-clickable-dark",3,"ngbTooltip"],[1,"text-small"],["name","search-ce","data-cy","iconCeMandated",1,"icon-clickable",3,"ngbTooltip"],[1,"comma-separated-list"],[1,"text-start"],[3,"innerHTML"]],template:function(t,n){t&1&&(u(0,A0,2,2,"div",6),u(1,B0,3,0,"div",7),u(2,H0,3,0,"div",7),u(3,q0,3,0,"div",8),u(4,z0,2,1,"div",8),u(5,Y0,2,1,"div",8),u(6,X0,2,1,"div",7),u(7,tg,2,1,"div",7),u(8,ig,4,3,"div",7),u(9,ng,4,3,"div",7),u(10,og,2,2,"div",9),u(11,rg,2,2,"div",9),u(12,ag,7,10,"div"),u(13,mg,3,0,"div",7),u(14,hg,3,2,"div"),u(15,Cg,3,1,"div",10),u(16,yg,3,1,"div",10),u(17,Fg,3,1,"div",10),u(18,wg,3,0,"div",7),Y(19,Pg,4,5,"ng-template",null,0,fe)(21,kg,4,5,"ng-template",null,1,fe)(23,Ag,4,5,"ng-template",null,2,fe)(25,Lg,1,1,"ng-template",null,3,fe)(27,Ug,1,1,"ng-template",null,4,fe)),t&2&&(_(n.cellTemplate.toLowerCase()==="fulltextdocument"?0:-1),s(),_(n.cellTemplate.toLowerCase()==="edvnr"?1:-1),s(),_(n.cellTemplate.toLowerCase()==="sectionallist"?2:-1),s(),_(n.cellTemplate.toLowerCase()==="refdocnrspecial"?3:-1),s(),_(n.cellTemplate.toLowerCase()==="createdby"?4:-1),s(),_(n.cellTemplate.toLowerCase()==="updateinterval"?5:-1),s(),_(n.cellTemplate.toLowerCase()==="documentowners"?6:-1),s(),_(n.cellTemplate.toLowerCase()==="modifiedby"?7:-1),s(),_(n.cellTemplate.toLowerCase()==="releaselevel"?8:-1),s(),_(n.cellTemplate.toLowerCase()==="monitoringstatus"?9:-1),s(),_(n.cellTemplate.toLowerCase()==="titledynamic"?10:-1),s(),_(n.isTitleTemplate?11:-1),s(),_(n.cellTemplate.toLowerCase()==="valid"?12:-1),s(),_(n.cellTemplate.toLowerCase()==="linklegislation"&&(n.item.linkLegislation==null?null:n.item.linkLegislation.length)>0?13:-1),s(),_(n.cellTemplate.toLowerCase()==="ceinfo"?14:-1),s(),_(n.cellTemplate.toLowerCase()==="classificationics"?15:-1),s(),_(n.cellTemplate.toLowerCase()==="documenttype"?16:-1),s(),_(n.cellTemplate.toLowerCase()==="flagstatus"?17:-1),s(),_(n.cellTemplate.toLowerCase()==="linkhandbook"||n.cellTemplate.toLowerCase()==="replaces"||n.cellTemplate.toLowerCase()==="replacedby"||n.cellTemplate.toLowerCase()==="amends"||n.cellTemplate.toLowerCase()==="amendedby"||n.cellTemplate.toLowerCase()==="version"||n.cellTemplate.toLowerCase()==="linkpublished"||n.cellTemplate.toLowerCase()==="citation"||n.cellTemplate.toLowerCase()==="linkcertification"||n.cellTemplate.toLowerCase()==="draftsuperseded"?18:-1))},dependencies:[co,_e,j,Ao,Ro,$,ko,ct],styles:[".document-functions-container[_ngcontent-%COMP%]{border:none;color:transparent;display:flex;text-align:right;white-space:nowrap}.ce-search[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}.ce-search[_ngcontent-%COMP%] .text-small[_ngcontent-%COMP%]{font-size:var(--font-size-small)}"]})}}return i})();var Bg=["*"],Vg=i=>({"inline-search":i}),$g=i=>({count:i}),Hg=(i,o)=>({"icon-clickable-dark":i,"icon-inactive":o});function Kg(i,o){i&1&&y(0,"app-spinner")}function Gg(i,o){if(i&1&&y(0,"app-record-count",14),i&2){let e=p(2);f("count",e.collectionSize)}}function qg(i,o){if(i&1&&(c(0,"p",25),v(1),h(2,"transloco"),h(3,"transloco"),d()),i&2){let e=p(3);s(),F(" ",e.hitlistTable.selectedRows.length===1?C(2,1,"search.hitlist.element_selected"):de(3,3,"search.hitlist.elements_selected",ie(6,$g,e.hitlistTable.selectedRows.length))," ")}}function Wg(i,o){if(i&1&&y(0,"app-record-count",26),i&2){let e=p(3);f("count",e.collectionSize)}}function zg(i,o){if(i&1&&(u(0,qg,4,8,"p",25),u(1,Wg,1,1,"app-record-count",26)),i&2){let e=p(2);_(!e.favoritesMode&&(e.hitlistTable!=null&&e.hitlistTable.selectedRows)?0:-1),s(),_(e.favoritesMode?1:-1)}}function jg(i,o){i&1&&Rn(0)}function Yg(i,o){if(i&1){let e=w();c(0,"div",15)(1,"app-select",27),x("itemSelected",function(n){E(e);let r=p(2);return I(r.onLayoutSelected(n))}),d()()}
17if(i&2){let e=p(2),t=X(5);f("formGroup",e.layoutsForm),s(),f("items",e.searchLayoutSelectOptions)("customSelectTemplate",t)}}function Qg(i,o){if(i&1){let e=w();c(0,"div",16)(1,"p",28),v(2),h(3,"transloco"),d(),c(4,"div",29)(5,"div")(6,"p"),v(7),h(8,"transloco"),d(),c(9,"p"),v(10),h(11,"transloco"),d()(),c(12,"button",30),x("click",function(){E(e);let n=p(2);return I(n.refreshFolder())}),v(13),h(14,"transloco"),d()()()}i&2&&(s(2),D(C(3,4,"observation.run_finished")),s(5),D(C(8,6,"observation.run_finished_refresh_folder_info")),s(3),D(C(11,8,"observation.run_finished_refresh_folder_question")),s(3),F(" ",C(14,10,"common.refresh")," "))}function Zg(i,o){if(i&1&&(c(0,"div",31)(1,"p",28),v(2),h(3,"transloco"),d(),c(4,"p",32),v(5),d()()),i&2){let e=p(2);W("folder-favorite",e.favoritesFolderType===e.favoritesFolderTypes.Folder)("box-warning",e.favoritesFolderType===e.favoritesFolderTypes.Note),s(2),D(C(3,6,"favorites.folder_description")),s(3),D(e.favoritesFolder.description.text)}}function Jg(i,o){if(i&1){let e=w();c(0,"button",43),h(1,"transloco"),h(2,"transloco"),h(3,"transloco"),h(4,"transloco"),x("click",function(){E(e);let n=p(6);return I(n.onTableMenuAction(n.menuAction.FAVORITE))}),y(5,"app-icon",44),d()}if(i&2){let e=p(6);f("ngbTooltip",e.onlyFavoritesSelected?C(1,3,"search.hitlist.remove_from_favorites"):C(2,5,"search.hitlist.add_to_favorites")),P("aria-label",e.onlyFavoritesSelected?C(3,7,"search.hitlist.remove_from_favorites"):C(4,9,"search.hitlist.add_to_favorites")),s(5),f("name",e.onlyFavoritesSelected?"cross":"favorite-star")}}function Xg(i,o){if(i&1){let e=w();Ue(0),u(1,Jg,6,11,"button",40),c(2,"button",41),h(3,"transloco"),h(4,"transloco"),x("click",function(){E(e);let n=p(5);return I(n.onTableMenuAction(n.menuAction.ADD_TO_FAVORITE_FOLDER))}),y(5,"app-icon",42),d(),Be()}if(i&2){let e=p(5);s(),_(e.isSearchForm(e.favoritesFolder)?-1:1),s(),f("ngbTooltip",C(3,3,"favorites.favorite.add_to_folder")),P("aria-label",C(4,5,"favorites.favorite.add_to_folder"))}}function eC(i,o){if(i&1&&Y(0,Xg,6,7,"ng-container",39),i&2){let e=p(4);f("permissions",e.permissions.EDIT_FAVORITES)}}function tC(i,o){if(i&1){let e=w();c(0,"button",45),h(1,"transloco"),h(2,"transloco"),h(3,"transloco"),h(4,"transloco"),x("click",function(){E(e);let n=p(4);return I(n.onTableMenuAction(n.menuAction.ADD_TO_NOTE_FOLDER))}),y(5,"app-icon",46),d()}if(i&2){let e=p(4);f("ngbTooltip",e.favoritesMode&&e.currentOpenFolderType===e.folderTypes.Note&&e.notesSelected?C(1,3,"search.hitlist.remove_note"):C(2,5,"favorites.note.add_to_folder")),P("aria-label",e.favoritesMode&&e.currentOpenFolderType===e.folderTypes.Note&&e.notesSelected?C(3,7,"search.hitlist.remove_note"):C(4,9,"favorites.note.add_to_folder")),s(5),f("name",!e.favoritesMode||e.favoritesMode&&(e.currentOpenFolderType===e.folderTypes.Folder||e.currentOpenFolderType===e.folderTypes.Note&&!e.notesSelected)?"note-folder":"cross")}}function iC(i,o){if(i&1){let e=w();c(0,"button",48),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(5);return I(n.onTableMenuAction(n.menuAction.SHOPPING_CART))}),y(3,"app-icon",49),d()}i&2&&(f("ngbTooltip",C(1,2,"orders.add_to_shopping_cart")),P("aria-label",C(2,4,"orders.add_to_shopping_cart")))}function nC(i,o){if(i&1&&Y(0,iC,4,6,"button",47),i&2){let e=p(4);f("permissions",e.permissions.ADD_TO_BASKET)}}function oC(i,o){if(i&1){let e=w();c(0,"button",50),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(4);return I(n.onTableMenuAction(n.menuAction.LINK))}),y(3,"app-icon",51),d()}if(i&2){let e=p(4);f("disabled",e.disableSingleButtons)("ngbTooltip",C(1,3,"common.link_document")),P("aria-label",C(2,5,"common.link_document"))}}function rC(i,o){if(i&1){let e=w();c(0,"button",52),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(4);return I(n.onTableMenuAction(n.menuAction.EDIT_METADATA))}),y(3,"app-icon",53),d()}if(i&2){let e=p(4);f("disabled",e.disableSingleButtons)("ngbTooltip",C(1,3,"search.hitlist.edit_metadata")),P("aria-label",C(2,5,"search.hitlist.edit_metadata"))}}function aC(i,o){if(i&1){let e=w();c(0,"button",54),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(4);return I(n.onTableMenuAction(n.menuAction.REQIF_CONVERSION))}),y(3,"app-icon",55),d()}if(i&2){let e=p(4);f("disabled",e.conversionLimitReached)("ngbTooltip",C(1,3,e.conversionLimitReached?"search.reqif.conversion_limit_reached":"search.reqif.conversion")),P("aria-label",C(2,5,e.conversionLimitReached?"search.reqif.conversion_limit_reached":"search.reqif.conversion"))}}function sC(i,o){if(i&1&&(c(0,"div",33),u(1,eC,1,1,"ng-container"),Y(2,tC,6,11,"button",34),u(3,nC,1,1,"button",35),u(4,oC,4,7,"button",36),Y(5,rC,4,7,"button",37),u(6,aC,4,7,"button",38),d()),i&2){let e=p(3);s(),_(!e.favoritesMode||e.currentOpenFolderType!==e.folderTypes.Note?1:-1),s(),f("permissions",e.permissions.EDIT_FAVORITES),s(),_(e.isOrderManagementEnabled?3:-1),s(),_(e.showLinkDocumentButton?4:-1),s(),f("permissions",e.permissions.EDIT_METADATA),s(),_(e.hasReqIFModule?6:-1)}}function lC(i,o){i&1&&Y(0,sC,7,6,"ng-template",null,3,fe)}function cC(i,o){if(i&1){let e=w();c(0,"button",59),x("click",function(){E(e);let n=p(4);return I(n.onTableMenuAction(n.menuAction.EXPORT_CSV))}),y(1,"app-icon",60),d()}if(i&2){let e=p(4),t=X(3);f("disabled",!e.csvExportEnabled)("ngbTooltip",t),P("aria-label",t)}}function dC(i,o){if(i&1){let e=w();c(0,"button",61),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(4);return I(n.onTableMenuAction(n.menuAction.IMPORT_DATASET))}),y(3,"app-icon",62),d()}i&2&&(f("ngbTooltip",C(1,2,"search.hitlist.link_documents_via_assignment_file")),P("aria-label",C(2,4,"search.hitlist.link_documents_via_assignment_file")))}function pC(i,o){if(i&1){let e=w();c(0,"button",64),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(5);return I(n.onTableMenuAction(n.menuAction.REQUEST_COMPANY_DATA))}),y(3,"app-icon",65),d()}if(i&2){let e=p(5);f("disabled",e.areElementsSelected)("ngbTooltip",C(1,3,"orders.orders_overview.request_company_data")),P("aria-label",C(2,5,"orders.orders_overview.request_company_data"))}}function mC(i,o){if(i&1&&Y(0,pC,4,7,"button",63),i&2){let e=p(4);f("permissions",e.permissions.REQUEST_ORDER)}}function uC(i,o){if(i&1){let e=w();c(0,"button",68),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(5);return I(n.onTableMenuAction(n.menuAction.CREATE_COMPANY_DATA))}),y(3,"app-icon",69),d()}i&2&&(f("ngbTooltip",C(1,2,"company_data.create_company_data")),P("aria-label",C(2,4,"company_data.create_company_data")))}function _C(i,o){if(i&1){let e=w();c(0,"button",70),h(1,"transloco"),h(2,"transloco"),x("click",function(){E(e);let n=p(5);return I(n.onTableMenuAction(n.menuAction.IMPORT_COMPANY_DATA))}),y(3,"app-icon",71),d()}i&2&&(f("ngbTooltip",C(1,2,"company_data.metadata_upload.title")),P("aria-label",C(2,4,"company_data.metadata_upload.title")))}function hC(i,o){if(i&1&&Y(0,uC,4,6,"button",66)(1,_C,4,6,"button",67),i&2){let e=p(4);f("permissions",e.permissions.EDIT_METADATA),s(),f("permissions",e.permissions.EDIT_METADATA)}}function fC(i,o){if(i&1&&(c(0,"div",33),Y(1,cC,2,3,"button",56)(2,dC,4,6,"button",57),u(3,mC,1,1,"button",58),u(4,hC,2,2),d()),i&2){let e=p(3);s(),f("permissions",e.permissions.EXPORT_CSV||e.permissions.EXPORT_CSV_ADMIN),s(),f("permissions",e.permissions.ADD_DOC_TO_META),s(),_(e.isOrderManagementEnabled?3:-1),s(),_(e.hasCompanyDataRights?4:-1)}}function gC(i,o){i&1&&Y(0,fC,5,4,"ng-template",null,4,fe)}function CC(i,o){if(i&1){let e=w();c(0,"app-hitlist-filter",77),x("filterClose",function(){E(e),p();let n=X(2);return I(n.close())})("filterChange",function(n){E(e);let r=p(4);return I(r.filterChange(n))}),d()}}function vC(i,o){if(i&1&&(c(0,"div")(1,"button",75,7),h(3,"transloco"),y(4,"app-icon",76),d(),Y(5,CC,1,0,"ng-template",null,8,fe),d()),i&2){let e=X(6),t=p(3);s(),W("disabled",t.collectionSize===0&&!t.isFilterActive),f("ngbPopover",e)("disablePopover",t.collectionSize===0&&!t.isFilterActive),P("aria-label",C(3,6,"common.table.o
17pen_filter")),s(3),f("ngClass",t.isFilterActive?"icon-filter-active":"icon-filter-inactive")}}function bC(i,o){if(i&1){let e=w();c(0,"app-mini-detail",78),h(1,"async"),x("showAllMetas",function(n){E(e);let r=p(4);return I(r.onShowAllMetas(n))})("searchOrNavigate",function(n){E(e);let r=p(4);return I(r.onHyperlinkClick(n))}),d()}if(i&2){let e=o.item,t=o.currentRow,n=p(4);f("item",e)("currentRow",t)("format",n.miniDisplayFormat)("defaultFormat",C(1,4,n.defaultFormat$))}}function yC(i,o){i&1&&Y(0,bC,2,6,"ng-template",null,9,fe)}function xC(i,o){if(i&1&&y(0,"app-icon",85),i&2){let e=p().item;f("ngClass",e.reqIfConvertible?"icon-active":"icon-inactive")}}function SC(i,o){if(i&1){let e=w();c(0,"div",79)(1,"button",80),h(2,"transloco"),h(3,"transloco"),x("click",function(){let n=E(e).item,r=p(3);return I(r.onFavoriteClicked(n.acCode))}),y(4,"app-icon",81),d(),c(5,"button",80),h(6,"transloco"),h(7,"transloco"),x("click",function(){let n=E(e).item,r=p(3);return I(r.onFavoriteClicked(n.acCode))}),y(8,"app-icon",82),d(),y(9,"app-icon",83)(10,"app-icon",84),u(11,xC,1,1,"app-icon",85),d()}if(i&2){let e=o.item,t=p(3);s(),f("ngbTooltip",C(2,9,"favorites.favorite.show_folders")),P("aria-label",C(3,11,"favorites.favorite.show_folders")),s(3),f("ngClass",e.isFavorite?"icon-warning":"icon-inactive"),s(),f("ngbTooltip",C(6,13,"favorites.note.show_folders")),P("aria-label",C(7,15,"favorites.note.show_folders")),s(3),f("ngClass",ht(17,Hg,e.hasComment,!e.hasComment)),s(),f("ngClass",e.isCompanyData?"icon-active":"icon-inactive"),s(),f("ngClass",e.isDraft?"icon-active":"icon-inactive"),s(),_(t.hasReqIFModule?11:-1)}}function TC(i,o){if(i&1){let e=w();c(0,"app-cell-template-resolver",88),x("itemAddedToCart",function(n){E(e);let r=p(7);return I(r.onAddItemsToCart([n]))}),d()}if(i&2){let e=p().item,t=p(2).$implicit;f("item",e)("cellTemplate",t.key),P("data-cy",t.key)}}function DC(i,o){if(i&1){let e=w();c(0,"app-cell-template-resolver",88),x("itemAddedToCart",function(n){E(e);let r=p(7);return I(r.onAddItemsToCart([n]))}),d()}if(i&2){let e=p().item,t=p(2).$implicit;f("item",e.relation)("cellTemplate",t.key),P("data-cy",t.key)}}function EC(i,o){if(i&1&&(u(0,TC,1,3,"app-cell-template-resolver",87),u(1,DC,1,3,"app-cell-template-resolver",87)),i&2){let e=o.item;_(e.hasOwnProperty("relation")?-1:0),s(),_(e.hasOwnProperty("relation")?1:-1)}}function IC(i,o){i&1&&Y(0,EC,2,2,"ng-template",null,10,fe)}function FC(i,o){if(i&1&&(c(0,"div",86),u(1,IC,2,0),d()),i&2){let e=o.$implicit,t=p(4);f("columnText",e==null?null:e.label)("itemProperty",e.key)("styleClasses",e.styles)("sortable",!0),s(),_(t.cellTemplateFields&&t.cellTemplateFields.includes(e.key)?1:-1)}}function MC(i,o){if(i&1&&G(0,FC,2,5,"div",86,J),i&2){let e=p(3);q(e.currentPreset==null?null:e.currentPreset.fields)}}function wC(i,o){if(i&1&&(Ue(0),c(1,"p",92),v(2),h(3,"transloco"),d(),Be()),i&2){let e=p(5);s(),W("empty-favorites",e.favoritesMode),s(),F(" ",C(3,3,"favorites.no_items_in_folder")," ")}}function OC(i,o){if(i&1&&(c(0,"p",93),v(1),h(2,"transloco"),h(3,"transloco"),d()),i&2){let e=p(5);W("empty-favorites",e.favoritesMode),s(),F(" ",e.currentOpenFolderType===e.favoritesFolderTypes.Note?C(2,3,"favorites.note.no_folder_shared_yet"):C(3,5,"favorites.favorite.no_folder_shared_yet")," ")}}function PC(i,o){if(i&1&&Y(0,wC,4,5,"ng-container",91)(1,OC,4,7,"ng-template",null,11,fe),i&2){let e=X(2),t=p(4);f("permissions",t.permissions.EDIT_FAVORITES)("permissionsElse",e)}}function NC(i,o){if(i&1&&(c(0,"p",92),v(1),h(2,"transloco"),h(3,"transloco"),d()),i&2){let e=p(4);W("empty-favorites",e.favoritesMode),s(),F(" ",e.favoritesMode?C(2,3,"favorites.no_items_in_folder"):C(3,5,"search.hitlist.no_items_found")," ")}}function kC(i,o){if(i&1&&(c(0,"div",74),y(1,"app-icon",89),u(2,PC,3,2),u(3,NC,4,7,"p",90),d()),i&2){let e=p(3);s(),f("name",e.favoritesMode?"folder-empty-large":"search-empty-large"),s(),_(e.favoritesMode?2:-1),s(),_(e.favoritesMode?-1:3)}}function RC(i,o){if(i&1){let e=w();c(0,"div",24)(1,"app-table",72),x("rowsSelected",function(n){E(e);let r=p(2);return I(r.onRowsSelected(n))})("stateChange",function(n){E(e);let r=p(2);return I(r.onSortChange(n))})("cellClick",function(n){E(e);let r=p(2);return I(r.onCellClick(n))}),Y(2,vC,7,8,"ng-template",null,5,fe),u(4,yC,2,0),Y(5,SC,12,20,"ng-template",null,6,fe),u(7,MC,2,0),h(8,"async"),y(9,"div",73),d(),u(10,kC,4,3,"div",74),d()}if(i&2){let e,t=p(2);s(),f("items",t.hitlistItems)("hasExpandedRow",!0)("hasCheckboxColumn",!t.disableSelection&&(!t.isOrderManagement||t.hasCheckboxColumn))("hasRadioButtonColumn",t.isOrderManagement||t.hasRadioButtonColumn)("hasExtraIconColumn",!0)("hasStickyHeader",!0),s(3),_(t.miniDisplayFormat?4:-1),s(3),_((e=C(8,9,t.allAvailableMetadataFieldsForCurrentTenant$))?7:-1,e),s(3),_(t.collectionSize===0?10:-1)}}function AC(i,o){if(i&1){let e=w();c(0,"div",12)(1,"div",13)(2,"div"),u(3,Gg,1,1,"app-record-count",14),u(4,zg,2,2),d(),u(5,jg,1,0),u(6,Yg,2,3,"div",15),d(),u(7,Qg,15,12,"div",16),h(8,"async"),u(9,Zg,6,8,"div",17),c(10,"div",18)(11,"app-table-menu",19,2)(13,"div",20),u(14,lC,2,0),u(15,gC,2,0),d()(),c(16,"div",21)(17,"app-select",22),x("itemSelected",function(){E(e);let n=p();return I(n.onPageSizeSelected())}),d(),c(18,"app-pagination",23),x("pageChange",function(n){E(e);let r=p();return I(r.onPageChange(n))}),d()()(),u(19,RC,11,11,"div",24),d()}if(i&2){let e,t,n=X(12),r=p();s(),f("ngClass",ie(22,Vg,r.isOrderManagement)),s(2),_(r.hitlistItems&&!r.favoritesMode?3:-1),s(),_(r.showLayoutSelect&&!r.isOrderManagement?4:-1),s(),_(r.favoritesMode?5:-1),s(),_(r.showLayoutSelect&&r.layoutsForm?6:-1),s(),_(C(8,20,r.monitoringUpdateContainerShown$)&&r.favoritesFolder?7:-1),s(2),_(!(r.favoritesFolder==null||r.favoritesFolder.description==null)&&r.favoritesFolder.description.text?9:-1),s(2),f("appTable",r.hitlistTable)("inline",r.isOrderManagement)("isExpandedTable",!0)("hasCheckbox",!r.disableSelection),s(3),_((e=r.showContextMenu)?14:-1,e),s(),_((t=r.showContextMenu)?15:-1,t),s(),f("formGroup",r.pageSizeForm),s(),f("items",r.pageSizeSelectOptions),s(),f("collectionSize",r.collectionSize)("tableMenu",n)("page",r.currentPage)("pageSize",r.currentPageSize),s(),_(r.initialPresetsAreLoaded?19:-1)}}function LC(i,o){i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2&&(s(),D(C(2,1,"common.export.title_text")))}function UC(i,o){if(i&1&&(c(0,"span"),v(1),h(2,"transloco"),d()),i&2){let e=p(2);s(),D(C(2,1,e.csvExportDisabledTooltipLabel))}}function BC(i,o){if(i&1&&(u(0,LC,3,3,"span"),u(1,UC,3,3,"span")),i&2){let e=p();_(e.csvExportEnabled?0:-1),s(),_(e.csvExportEnabled?-1:1)}}function VC(i,o){i&1&&(c(0,"div",95),v(1),h(2,"transloco"),d()),i&2&&(s(),F(" ",C(2,1,"search.extended_search.default_layout")," "))}function $C(i,o){if(i&1&&(c(0,"div",95),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit;W("disabled",e.disabled),s(),F(" ",C(2,3,"search.tenant_wide_template")," ")}}function HC(i,o){if(i&1&&(c(0,"div",95),v(1),h(2,"transloco"),d()),i&2){let e=p(2).$implicit;W("disabled",e.disabled),s(),F(" ",C(2,3,"search.full_view_template")," ")}}function KC(i,o){if(i&1){let e=w();c(0,"span",97),v(1),d(),c(2,"button",98),x("click",function(n){E(e);let r=p(2).$implicit,a=p();return I(a.editLayout(n,r))}),y(3,"app-icon",99),d(),c(4,"button",100),x("click",function(n){E(e);let r=p(2).$implicit,a=p();return I(a.deleteLayout(n,r))}),y(5,"app-icon",101),d()}if(i&2){let e=p(2).$implicit;W("disabled",e.disabled),s(),D(e==null?null:e.text)}}function GC(i,o){if(i&1&&(u(0,VC,3,3,"div",95),u(1,$C,3,5,"div",96),u(2,HC,3,5,"div",96),u(3,KC,6,3)),i&2){let e=p().$implicit;_(e.isDefaultTemplate?0:-1),s(),_(e.isTenantTemplateByName?1:-1),s(),_(!e.isDefaultTemplate&&!e.isTenantTemplateByName&&e.text==="search.full_view_template"?2:-1),s(),_(!e.isDefaultTemplate&&!e.isTenantTemplateByName&&e.value!=="newFormat"&&e.text!=="search.full_view_template"?3:-1)}}function qC(i,o){i&1&&(c(0,"button",94),y(1,"app-icon",102),c(2,"span"),v(3),h(4,"transloco"),d()()),i&2&&(s(3),D(C(4,1,"search.create_layout")))}function WC(i,o){if(i&1&&(u(0,GC,4,4),u(1,qC,5,3,"button",94)),i&2){let e=o.$implicit;_(e.value&&e.value!=="newFormat"?0:-1),s(),_(!e.isDefaultTemplate&&!e.isTenantTemplateByName&&(!e.value||e.value==="newFormat")?1:-1)}}var Yl="favorit",Ql="entwurf",Zl="kommentar",Jl="firmendatensatz",zC=25,Ht=(()=>{class i{constructor(){this._searchConfig=g(hi),this._authService=g(ue),this._changeDetectorRef=g(ze),this._documentAccessService=g(ei),this._facetService=g(Kn),this._favoritesService=g(Xt),this._feedbackService=g(pt),this._fileContentService=g(So),this._itemDetailService=g(Qn),this._linkDocumentService=g(Rl),this._listPresetService=g(Jn),this._metadataFieldsService=g(Ut),this._miniDisplayFormatService=g(Ci),this._modalService=g(he),this._notificationService=g(Xi),this._orderManagementService=g(Yn),this._reqifConversionService=g(is),this._route=g(Un),this._router=g(mi),this._searchService=g(Jt),this._tenantStateService=g(gi),this._translocoService=g(ae),this.disableSelection=!1,this.isOrderManagement=!1,this.favoritesFolderTitle="",this.showContextMenu=!0,this.hasCheckboxColumn=!1,this.showHitlist=!0,this.hasRadioButtonColumn=!1,this.searchChanged=new R,this.rowsSelected=new R,this.refreshFavoriteFolder=new R,this.collectionSize=0,this.cellTemplateFields=["ceInfo","fullTextDocument","edvNr","flagStatus","valid","titleDynamic","titleDe","titleEn","titleFr","amends","amendedBy","linkHandbook","linkLegislation","replaces","replacedBy","version","linkPublished","citation","sectionalList","classificationIcs","documentType","linkCertification","draftSuperseded","refDocNrSpecial","createdBy","modifiedBy","documentOwners","updateInterval","releaseLevel","monitoringStatus"],this.permissions=se,this.favoritesFolderTypes=$e,this.favoritesMode=!1,this.currentPage=this._searchConfig.defaultPage,this.hitsPerPage=this._searchConfig.defaultPerPage,this._sortField="",this._sortOrder="",this.isFilterActive=!1,this.allAvailableMetadataFieldsForCurrentTenant=[],this.allAvailablePresets=[],this.showLayoutSelect=!0,this.pageSizeSelectOptions=zi,this.notesSelected=!1,this.menuAction=Dt,this.showLinkDocumentButton=!1,this.disableSingleButtons=!0,this.folderTypes=$e,this.initialPresetsAreLoaded=!1,this.csvExportEnabled=!1,this.csvExportDisabledTooltipLabel="",this.conversionLimitReached=!1,this.hasReqIFModule=!1,this.isOrderManagementEnabled=!0,this.hasCompanyDataRights=!1,this.areElementsSelected=!1,this._favoriteAcCodes=[],this._noteAcCodes=[],this._rootFavoriteAcCodes=[],this._userRoles=Vt,this._componentActive=!0,this._subscriptions=new At,this._curFavoritesFolders=[],this._curNotesFolders=[]}set resultList(e){if(e){let t=e.searchResult;this._hitlistItems=this.searchResultToHitlistItems(t),this.collectionSize=e.count;let n=t.map(r=>r.acCode);n.length>0&&(this._documentAccessService.refreshDocumentList(n),this.getRootFolder(),this.getFavoritesAndNotes(n),this.updateHitlistItems()),this.csvExportEnabled=this.collectionSize&&this.collectionSize>0&&(this._authService.userHasPermission(se.EXPORT_CSV_ADMIN)||this._authService.userHasPermission(se.EXPORT_CSV)&&this.collectionSize<=1e3),this.csvExportEnabled||(this.collectionSize<=0?this.csvExportDisabledTooltipLabel=this._translocoService.translate("common.export.disabled_no_datasets"):!this._authService.userHasPermission(se.EXPORT_CSV_ADMIN)&&this.collectionSize>1e3&&(this.csvExportDisabledTooltipLabel=this._translocoService.translate("common.export.disabled_too_many_entries")))}}get hitlistItems(){return this._hitlistItems}set currentPaginationFromSearch(e){e&&(this.currentPage=e)}set currentPageSizeFromSearch(e){e&&(this._currentPageSizeFromSearch=e,this.pageSizeForm?.controls?.selectedPageSize?.patchValue(e))}get currentPageSizeFromSearch(){return this._currentPageSizeFromSearch}set currentSortDirection(e){this._sortOrder=e}set currentSortField(e){this._sortField=e}set currentOpenFolderType(e){this._currentOpenFolderType=e,this.favoritesOrNotesTranslationKey=e===$e.Note?"note":"favorite"}get currentOpenFolderType(){return this._currentOpenFolderType}set hitlistTable(e){e&&(this._hitlistTable=e)}get hitlistTable(){return this._hitlistTable}get onlyFavoritesSelected(){if(this.hitlistTable)if(this.favoritesMode){let e=this.hitlistTable.selectedRows.length,t=this.hitlistTable.selectedRows.filter(n=>this._favoriteAcCodes.indexOf(n.item.acCode)>-1).length;return e===t}else{let e=this.hitlistTable.selectedRows.length,t=this.hitlistTable.selectedRows.filter(n=>this._rootFavoriteAcCodes.indexOf(n.item.acCode)>-1).length;return e>0&&e===t}return!1}ngOnInit(){this.initForms(),this.showLayoutSelect=this._authService.userHasPermission(se.SETTINGS),this.hasCompanyDataRights=this._authService.userHasPermission(se.EDIT_METADATA),this.allAvailableMetadataFieldsForCurrentTenant$=this._metadataFieldsService.getMetadataList().pipe(_t(),S(e=>e?Array.from(e.keys()):[]),me(()=>this._componentActive)),this.isFilterActive=this._facetService.currentSelectedFacetsMap.size>0,this._listPresetService.refreshAllValuesFromBackend(),Ot([this._listPresetService.currentPreset$.pipe(me(()=>this._componentActive),_t()),this._listPresetService.defaultPreset$.pipe(me(()=>this._componentActive),_t()),this._listPresetService.tenantWidePreset$.pipe(me(()=>this._componentActive),_t()),this._listPresetService.presetCollection$.pipe(me(()=>this._componentActive),_t()),this._listPresetService.fullPreset$.pipe(me(()=>this._componentActive),_t()),this.allAvailableMetadataFieldsForCurrentTenant$]).pipe(me(()=>this._componentActive)).subscribe(([e,t,n,r,a,l])=>{e&&t&&r&&l&&(this.allAvailableMetadataFieldsForCurrentTenant=l,this.setCurrentPreset(e),this.setDefaultPreset(t),this.setTenantWidePreset(n),this.fullPreset=a,r=r.sort((m,b)=>m.name?.localeCompare(b?.name)),this.setAllAvailablePresets([this.defaultPreset,this.fullPreset,this.tenantWidePreset,...r]),this.initialPresetsAreLoaded=!0,this._changeDetectorRef.markForCheck())}),this._miniDisplayFormatService.currentFormat$.subscribe(e=>{e&&(this.miniDisplayFormat=e,this._changeDetectorRef.markForCheck())}),this.defaultFormat$=this._miniDisplayFormatService.defaultFormat$,this.defaultFormat$.subscribe(e=>{this.defaultFormat=e}),this.hideContextMenuIfNoPermission(),this.monitoringUpdateContainerShown$=this._notificationService.monitoringUpdateContainerShown$.pipe(_t(),Nt()),this._tenantStateService.hasReqIFModuleAndAdminAccess(this._authService.userInfo.tenantId).subscribe(e=>{this.hasReqIFModule=e,this._changeDetectorRef.detectChanges()}),this._tenantStateService.tenant$.pipe(me(()=>this._componentActive)).subscribe(e=>{e&&(this.isOrderManagementEnabled=e.isOrderManagementEnabled)})}onTableMenuAction(e){let n=this.hitlistTable.selectedRows.map(a=>a.item),r=n.map(a=>a.acCode);switch(e){case Dt.ADD_TO_FAVORITE_FOLDER:this.addFavoritesToCatalogue(r);break;
17case Dt.FAVORITE:{let a=this.favoritesFolder&&Object.hasOwn(this.favoritesFolder,"id")?this.favoritesFolder.id:null;this.setOrUnsetFavorites(n,a);break}case Dt.ADD_TO_NOTE_FOLDER:this.addToNoteFolder(n,r);break;case Dt.LINK:this._linkDocumentService.showDocumentLinkModal(n,i.getAcCodesFromDatasets(n),this.hitlistTable,this.tableMenu,this._changeDetectorRef);break;case Dt.IMPORT_DATASET:this.showImportDatasetModal();break;case Dt.SHOPPING_CART:this.onAddItemsToCart(n);break;case Dt.EDIT_METADATA:this.handleEditMetadata(r);break;case Dt.EXPORT_CSV:this.requestCsvExport();break;case Dt.REQUEST_COMPANY_DATA:this.openRequestCompanyDataModal();break;case Dt.CREATE_COMPANY_DATA:this._router.navigate(["../search/company-data/create"],{relativeTo:this._route});break;case Dt.IMPORT_COMPANY_DATA:this.importMetadata();break;case Dt.REQIF_CONVERSION:this.createConvertibilityInfos(n);break;default:break}}filterAvailable(e){return e?.filter(t=>this.allAvailableMetadataFieldsForCurrentTenant.map(n=>n.toLowerCase()).includes(t.key.toLowerCase()))}onAddItemsToCart(e){if(this._authService.userHasOnePermission([this._userRoles.ADMIN,this._userRoles.STANDARD,this._userRoles.READ_AND_REQUEST,se.ADD_TO_BASKET])){let t=this._modalService.open(Cl,{windowClass:"modal-large"}),n=!0;if(t.componentInstance.loading=!0,e.length===1)this._itemDetailService.searchFullDetailItem(e[0].acCode).pipe(V(r=>{if(r){let a={document:e[0],documentDetails:r};t.componentInstance.documentsWithDetails=[a],t.componentInstance.loading=!1}})).subscribe();else{let r=[];e.forEach(a=>{r.push(this._itemDetailService.searchFullDetailItem(a.acCode).pipe(S(l=>({document:a,documentDetails:l})),k(()=>M({document:a,documentDetails:null}))))}),et(r).pipe(V(a=>{a&&(t.componentInstance.documentsWithDetails=a,t.componentInstance.loading=!1)}),k(()=>(t.componentInstance.loading=!1,xe))).subscribe()}t.componentInstance.removeItem.pipe(me(()=>n)).subscribe(r=>e.splice(r,1)),t.result.then(r=>{if(n=!1,r?.success){switch(r.action){case"addedToCart":{this._feedbackService.showSuccessModal(e.length===1?"search.hitlist.order_added_to_shopping_cart":this._translocoService.translate("search.hitlist.orders_added_to_shopping_cart",{count:e.length}));break}case"ordered":{this._feedbackService.showSuccessModal(e.length===1?"orders.order_successfully_requested":this._translocoService.translate("search.hitlist.orders_directly_requested",{count:e.length}));break}}this.resetTableState()}},()=>{t.dismissed||(n=!1,this._feedbackService.showErrorModal())})}else this._feedbackService.showErrorModal("search.no_admin_rights")}setNewDataset(e){this._orderManagementService.setNewDataset(e)}importMetadata(){let e=this._modalService.open(Sl);e.componentInstance.csvImportKey=pe.metadata,this._subscriptions.add(this._tenantStateService.tenant$.subscribe(t=>{e.componentInstance.metadataWidth=t?.metadataWidth??"basic"}))}onRowsSelected(e){this.rowsSelected.emit(e),this.checkPermissionsForContextMenu(e),this.calculateConversionLimitReached(),this.setTableMenuIcons(e.map(t=>t.item).map(t=>t.acCode))}limitPageSize(e){return e.perPage<25&&(e.perPage=25),e}onCellClick(e){this.isOrderManagement?this.setNewDataset(e):this.showItemDetails(e.acCode)}onSortChange(e){e.changeType===Qt.SORT&&(this._sortField=e.sortBy,this._sortOrder=e.sortAsc?Fo.ASC:Fo.DESC,this.publishSearchChanges())}isSearchForm(e){return!!e&&e?.searchFormId!==Pe}onPageChange(e){this.currentPage=e,this.publishSearchChanges()}onPageSizeSelected(){this.tableMenu.selectAllCheckbox=qe.UNCHECKED,this.currentPageSize=Number.parseInt(this.pageSizeForm.value.selectedPageSize,10),this.currentPage=this._searchConfig.defaultPage,this._sortField="",this._sortOrder="",this.pageSizeForm.controls.selectedPageSize.patchValue(this.currentPageSize),this._searchService.customPageSize=this.currentPageSize,this.publishSearchChanges()}onHyperlinkClick(e){this.showItemDetails(e.value)}onFavoriteClicked(e){let t=this._modalService.open(gl,{windowClass:"modal-extra-large"});this._favoritesService.getFavoritesByAcCode(e).subscribe(n=>{let r=this._authService.userHasPermission(se.EDIT_FAVORITES);t.componentInstance.showRemoveButtons=r,this._curFavoritesFolders=st.favoriteItemsToFavoriteFolderDetailsModels(n.favorites),this._curNotesFolders=st.favoriteItemsToFavoriteFolderDetailsModels(n.notes),t.componentInstance.favorites=this._curFavoritesFolders,t.componentInstance.notes=this._curNotesFolders,t.componentInstance.saveRemoved.subscribe(a=>{let l=[];a.deleteFavoritesIds.length&&l.push(this._favoritesService.removeFromFavoriteFolders(e,a.deleteFavoritesIds,$e.Folder)),a.deleteNotesIds.length&&l.push(this._favoritesService.removeFromFavoriteFolders(e,a.deleteNotesIds,$e.Note)),et(l).subscribe({next:()=>{this._feedbackService.showSuccessModal("favorites.favorites_and_notes_successfully_updated"),this.favoritesMode?this.removeFromFavoritesView(a,e):this.removeFromSearchResultView(a,e)},error:()=>{this._feedbackService.showErrorModal()}})})})}onShowAllMetas(e){this.showItemDetails(e.acCode)}onLayoutSelected(e){let t=e;if(t==="newFormat")this.createTableLayout();else{let n=this.allAvailablePresets.filter(r=>r.id===t)[0];n&&(this._listPresetService.setCurrentPreset(n),this.pageSizeForm.controls.selectedPageSize.patchValue(n.perPage),this.currentPageSize=n.perPage,this.publishSearchChanges())}}editLayout(e,t){e.stopPropagation();let n=this.allAvailablePresets.find(r=>r.name===t.text);this.onOpenListPresetConfiguration(n)}deleteLayout(e,t){e.stopPropagation();let n=this.allAvailablePresets.filter(a=>a.name===t.text)[0],r=this._modalService.open(bi);r.componentInstance.isDeleteConfirmation=!0,this._translocoService.selectTranslate("search.extended_search.delete_layout_request",{name:n.name}).subscribe(a=>{r.componentInstance.text=a,r.componentInstance.title="search.extended_search.delete_layout"}),r.result.then(a=>{if(a.preset){if(this._listPresetService.deletePreset(n),this.optimisticDeleteHitlistLayout(n),this.currentPreset.id===t.value){let m=this.allAvailablePresets[0];this.currentPageSize=m.perPage}this._feedbackService.showSuccessModal("search.hitlist.layout_deleted"),this.patchSelectionForms(),this.publishSearchChanges()}})}optimisticDeleteHitlistLayout(e){this.allAvailablePresets=this.allAvailablePresets.filter(t=>t.id!==e.id),this.searchLayoutSelectOptions=this.searchLayoutSelectOptions.filter(t=>t.value!==e.id)}filterChange(e){this.isFilterActive=e,this.publishSearchChanges()}refreshFolder(){this._notificationService.hideMonitoringUpdateContainer(),this.refreshFavoriteFolder.emit()}ngOnDestroy(){this._subscriptions.unsubscribe(),this._componentActive=!1}showItemDetails(e){this._router.navigateByUrl(`${this._route.snapshot.params.tenant}/search/item-detail/${e}`)}getInitialLayoutFields(){let e=["documentNumber","dateOfIssue","titleDynamic","valid","ceInfo","fullTextDocument","documentType","flagStatus","classificationIcs"];return this.filterAvailable(e.map((t,n)=>({key:t,label:`common.metadata_label.${t}`,template:"",ordinal:n,styles:""})))}removeFromFavoritesView(e,t){let n=this.favoritesFolder?.id||this.favoritesRootFolder.id;e.deleteFavoritesIds.includes(n)&&(this._hitlistItems=this._hitlistItems.filter(r=>r.acCode!==t),this.collectionSize=this._hitlistItems.length),e.deleteNotesIds.includes(n)&&(this._hitlistItems=this._hitlistItems.filter(r=>r.acCode!==t),this.collectionSize=this._hitlistItems.length)}removeFromSearchResultView(e,t){let n=!!this._curFavoritesFolders.filter(a=>!e.deleteFavoritesIds.includes(a.folderId)).length,r=!!this._curNotesFolders.filter(a=>!e.deleteNotesIds.includes(a.folderId)).length;n||(this._favoriteAcCodes=this._favoriteAcCodes.filter(a=>a!==t),this._rootFavoriteAcCodes=this._rootFavoriteAcCodes.filter(a=>a!==t)),r||(this._noteAcCodes=this._noteAcCodes.filter(a=>a!==t)),this.updateHitlistItems()}publishSearchChanges(e){let t;this.isFilterActive||(t=e||this._searchService.lastSearchParamsForNavigation?.searchRequest);let n={searchRequest:t,pageSize:this.currentPageSize??this.hitsPerPage,pageNumber:this.currentPage,sortField:this._sortField,sortDir:this._sortOrder};t?.useDynamicSearch&&(n.searchRequest.dynamicParameters=this.mapDynamicParameters(n.searchRequest.dynamicParameters)),this.searchChanged.emit(n)}mapDynamicParameters(e){return e.map(t=>ve(K({},t),{fieldName:t.fieldName==="documentNumber"?"documentNr":t.fieldName}))}static getAcCodesFromDatasets(e){let t=[];return t=t.concat(e.map(n=>n.acCode)),t}
17requestCsvExport(){let e=[],t=this._searchService.lastSearchRequest;for(let n of this.currentPreset.fields)e.push(n.key);this._subscriptions.add(this._tenantStateService.tenant$.pipe(S(n=>({searchRequest:t,visibleColumns:e,metadataWidth:n?.metadataWidth??"basic"})),Re(n=>this._searchService.requestCsvExport(n))).subscribe({next:n=>{if(n.status===ge.ACCEPTED)this._feedbackService.showInfoModal("common.export.title_text","common.export.requested_deferred",Zi.DOWNLOAD);else if(n.status===ge.OK){let r="csvReport.csv",a="text/csv;charset=UTF-8",l=n.body,m=new Blob([l],{type:a});(0,Xl.saveAs)(m,r),this._feedbackService.showSuccessModal("common.export.export_successful")}},error:n=>{n.status===Gt.TOO_MANY_REQUESTS?this._feedbackService.showErrorModal("common.export.too_many_requests"):this._feedbackService.showErrorModal()}}))}getIconState(e,t){let n;switch(e){case Yl:{n=this._favoriteAcCodes.some(a=>t.acCode===a);break}case Jl:{n=this._authService.userInfo.tenantId.toUpperCase()===t.tenantId;break}case Ql:{n=["N-E","TR-E","DC"].some(a=>t.documentType.includes(a));break}case Zl:{n=this._noteAcCodes.some(r=>t.acCode===r);break}default:n=!1;break}return n}openRequestCompanyDataModal(){this._modalService.open(Il).result.then(t=>{t&&this.createCompanyData([ve(K({},t),{isSelected:!1})])})}createCompanyData(e){let t=e.map(n=>this._orderManagementService.mapCompanyStandardModelToDto(n));this._orderManagementService.createOrders(t).pipe(V(n=>{n.status===ge.OK?(this._feedbackService.showSuccessModal("company_data.record_successfully_requested"),this.resetTableState()):this._feedbackService.showErrorModal()}),k(()=>(this._feedbackService.showErrorModal(),xe))).subscribe()}initForms(){this.layoutsForm=new Je({selectedLayout:new je("")}),this.pageSizeForm=new Je({selectedPageSize:new je(this.currentPageSize)})}createTableLayout(){let e=this._modalService.open(ns);e.componentInstance.currentPresetLocal={},e.result.then(t=>{if(!t.preset)return;let n=re.cloneDeep(this.currentPreset);n.name=t.folder,n.fields=this.getInitialLayoutFields(),n.icons=[],n.id=null,n.perPage=25,n.isTenantTemplate=!1,n.isDefaultTemplate=!1,this._listPresetService.saveNewPreset(n).pipe(k(()=>(this._feedbackService.showErrorModal(),xe))).subscribe({next:r=>{r&&setTimeout(()=>{n.id=r.id,this._listPresetService.setCurrentPreset(n),this.currentPreset=n,this.onOpenListPresetConfiguration(n)},500)}})})}onOpenListPresetConfiguration(e){e||(e=this.currentPreset);let t=this._modalService.open(cl,{windowClass:"modal-fullscreen",isCentered:!1});t.componentInstance.activePreset=e,t.result.then(n=>{if(n?.configId){let r=this.allAvailablePresets.filter(a=>a.id===n.configId);r&&r.length>0&&this.setCurrentPreset(r[0]),this.currentPageSize=void 0,this.syncListPresetConfiguration(),this.publishSearchChanges(),this.patchSelectionForms()}})}userCanWrite(){let e=this._authService.userInfo;return this._authService.userHasPermission(se.EDIT_FAVORITES)||e.roles.includes(Vt.ADMIN)||e.roles.includes(Vt.STANDARD)||!e.roles.includes(Vt.READONLY)}getRootFolder(){!this.favoritesRootFolder&&this.userCanWrite()&&this._favoritesService.getRootFolderAndNotification(this.favoritesFolderType||$e.Folder).pipe(me(()=>this._componentActive),V(e=>{this.favoritesRootFolder=e[0]})).subscribe()}getFavoritesAndNotes(e){this._favoritesService.getFavoriteOrNoteInformationListByAcCodes(e).subscribe(t=>{t.length>0&&(this._favoriteAcCodes=t.filter(n=>n.isFavorite).map(n=>n.acCode),this._noteAcCodes=t.filter(n=>n.isNote).map(n=>n.acCode),this._rootFavoriteAcCodes=t.filter(n=>n.isFavoriteRoot).map(n=>n.acCode)),(this._favoriteAcCodes.length>0||this._noteAcCodes.length>0)&&this.updateHitlistItems()})}sortListPreset(e){return e.sort((t,n)=>t.ordinal<n.ordinal?-1:1)}setCurrentPreset(e){e.fields=this.sortListPreset(e.fields),e.fields=this.filterAvailable(e.fields),e=this.limitPageSize(e),this.currentPageSize=void 0;let t=e.fields.filter(n=>n.key==="fullTextDocument")[0];t?t.label="common.document":t={key:"fullTextDocument",label:"common.document",ordinal:0,styles:"",template:""},e.fields.forEach(n=>{n.label.startsWith("common.metadata_label")||(n.label=i.getCorrectLabel(n.label),Rt.map(r=>r.id.toLowerCase()).includes(n.key.toLowerCase())?n.label="common.metadata_label.pro_metadata."+n.label:n.label="common.metadata_label."+n.label)}),this.currentPreset=ve(K({},e),{fields:e.fields.filter(n=>n.key!=="fullTextDocument")}),this.currentPageSize=e.perPage,this.isOrderManagement||this.currentPreset.fields.unshift(t)}static getCorrectLabel(e){return e.toLocaleLowerCase()==="custom_field"&&(e=e.toLowerCase()),e.toLowerCase()==="admsortkey"&&(e="admSortKey"),e}setDefaultPreset(e){e=this.limitPageSize(e),this.defaultPreset=e,this.defaultPreset.name=this._translocoService.translate("search.extended_search.default_layout"),this.defaultPreset.fields=this.filterAvailable(this.defaultPreset.fields)}setTenantWidePreset(e){e?this.tenantWidePreset=re.clone(e):(this.tenantWidePreset={},this.tenantWidePreset.id=Pe,this.tenantWidePreset.isTenantTemplate=!0),this.tenantWidePreset.fields=this.filterAvailable(this.tenantWidePreset.fields),this.tenantWidePreset.name=this._translocoService.translate("search.tenant_wide_template")}setAllAvailablePresets(e){e=e.filter(t=>t!==null),this.searchLayoutSelectOptions=this.generateLayoutOptions(e),this.allAvailablePresets=e,this.patchSelectionForms()}addToNoteFolder(e,t){if(!this.favoritesMode||this.favoritesMode&&(this.currentOpenFolderType===$e.Folder||this.currentOpenFolderType===$e.Note&&!this.notesSelected))this.addNote(t);else if(this.favoritesMode&&this.currentOpenFolderType===$e.Note&&this.notesSelected)if(this.tableMenu.selectAllCheckbox===qe.CHECKED){let n=this._modalService.open(bi);n.componentInstance.title="search.hitlist.remove_from_notes_title",n.componentInstance.text="search.hitlist.remove_from_notes_info",n.componentInstance.saveButtonText="common.remove",n.result.then(r=>{r.preset&&this.removeNote(e)})}else this.removeNote(e)}setOrUnsetFavorites(e,t){return On(this,null,function*(){let n=this._favoriteAcCodes;this.favoritesMode&&this.favoritesFolderType===$e.Folder||(n=this._rootFavoriteAcCodes);let r=e.every(l=>n.includes(l.acCode)),a=e.map(l=>l.acCode);if(r){if(this.tableMenu.selectAllCheckbox===qe.CHECKED){let m=this._modalService.open(bi);if(m.componentInstance.title="search.hitlist.remove_from_favorites_title",m.componentInstance.text="search.hitlist.remove_from_favorites_info",m.componentInstance.saveButtonText="common.remove",!(yield m.result).preset)return}this.favoritesFolderType===$e.Note?t=void 0:t||(t=this.favoritesRootFolder.id);let l=a.filter(m=>n.indexOf(m)>-1);this._favoritesService.unsetFavoriteAcCodes(l,$e.Folder,t).subscribe(()=>{this._feedbackService.showSuccessModal(e.length===1?"search.hitlist.favorite_successfully_removed":"search.hitlist.favorites_successfully_removed"),e.forEach(m=>{if(this.favoritesMode&&this.favoritesFolderType===$e.Folder){let T=this._hitlistItems.length;this._hitlistItems=this._hitlistItems.filter(O=>O.acCode!==m.acCode),this.collectionSize=this.collectionSize-(T-this._hitlistItems.length)}let b=this._favoriteAcCodes.findIndex(T=>T===m.acCode);if(this._favoriteAcCodes.splice(b,1),t===this.favoritesRootFolder.id){let T=this._rootFavoriteAcCodes.findIndex(O=>O===m.acCode);this._rootFavoriteAcCodes.splice(T,1)}}),this.setCurrentPreset(this.currentPreset)})}else{if(!this.favoritesRootFolder)return;this._favoritesService.setFavoriteAcCodesToFolders(a,[this.favoritesRootFolder.id],$e.Folder).subscribe({next:()=>{this._favoriteAcCodes=this._favoriteAcCodes.concat(a),this._rootFavoriteAcCodes=this._rootFavoriteAcCodes.concat(a),t===this.favoritesRootFolder.id&&(this._rootFavoriteAcCodes=re.removeDuplicates(this._rootFavoriteAcCodes.filter(m=>m!=null))),this._favoriteAcCodes=re.removeDuplicates(this._favoriteAcCodes.filter(m=>m!=null)),this._feedbackService.showSuccessModal(a.length===1?"search.hitlist.favorite_successfully_added":"search.hitlist.favorites_successfully_added"),this.updateHitlistItems()},error:()=>{this._feedbackService.showErrorModal()}})}this.resetTableState()})}setTableMenuIcons(e){this.notesSelected=e.every(t=>this._noteAcCodes.includes(t))}patchSelectionForms(){let e=this.allAvailablePresets.filter(n=>n.name===this.currentPreset?.name)[0];this.allAvailablePresets.length<=1?e=this.allAvailablePresets[0]:this.currentPreset&&(e=this.currentPreset);let t=e.id;this.pageSizeForm.controls.selectedPageSize.patchValue(this._searchService.customPageSize??this.currentPageSize??this.hitsPerPage??this.currentPreset.perPage),this.layoutsForm.controls.selectedLayout.patchValue(t)}generateLayoutOptions(e){return[{text:this._translocoService.translate("search.create_layout"),value:"newFormat",disabled:!1,isDefaultTemplate:!1,isTenantTemplateByName:!1},...e.map(t=>({text:t.name,value:t.id,disabled:t.id===Pe,isDefaultTemplate:t.isDefaultTemplate,isTenantTemplateByName:this.isTenantTemplate(t.name)}))]}addFavoritesToCatalogue(e){let t=this._modalService.open(Ur);t.componentInstance.acCodes=e,t.componentInstance.folderType=$e.Folder,t.componentInstance.createdFolderInCreateMode.pipe(V(n=>{n.success?this._feedbackService.showSuccessModal("favorites.favorite.create_folder_success"):this._feedbackService.showErrorModal()}),me(()=>this._componentActive)).subscribe(),t.componentInstance.folderCreated.pipe(V(n=>{this.favoritesFolderType===n.folderType&&this._favoritesService.updateTree(n.nodes)}),me(()=>this._componentActive)).subscribe(),t.result.then(n=>
17{n&&!n.cancel&&(this._favoriteAcCodes=this._favoriteAcCodes.concat(e),n.isRootFavorite&&(this._rootFavoriteAcCodes=this._rootFavoriteAcCodes.concat(e)),this._feedbackService.showSuccessModal(e.length===1?"search.hitlist.favorite_successfully_added":"search.hitlist.favorites_successfully_added"),this.updateHitlistItems(),this.resetTableState())})}resetTableState(){this.tableMenu.selectAllCheckbox=qe.UNCHECKED,this.hitlistTable.resetSelection()}addNote(e){let t=this._modalService.open(Ur);t.componentInstance.acCodes=e,t.componentInstance.folderType=$e.Note,t.componentInstance.folderCreated.pipe(V(n=>{this.favoritesFolderType===n.folderType&&this._favoritesService.updateTree(n.nodes)}),me(()=>this._componentActive)).subscribe(),t.componentInstance.createdFolderInCreateMode.pipe(V(n=>{n.success?this._feedbackService.showSuccessModal("favorites.note.create_folder_success"):this._feedbackService.showErrorModal()}),me(()=>this._componentActive)).subscribe(),t.result.then(n=>{n&&!n.cancel&&(this._noteAcCodes=this._noteAcCodes.concat(e),this.updateHitlistItems(),this._feedbackService.showSuccessModal(e.length===1?"search.hitlist.note_successfully_added":"search.hitlist.notes_successfully_added"),this.resetTableState())})}removeNote(e){let t=e.map(n=>n.acCode);this._favoritesService.unsetFavoriteAcCodes(t,$e.Note,this.favoritesFolder?.id).pipe(V(({status:n})=>{n===ge.NO_CONTENT&&(this._currentOpenFolderType===$e.Note&&(this._hitlistItems=this._hitlistItems.filter(r=>!t.includes(r.acCode)),this.collectionSize=this._hitlistItems.length),this._feedbackService.showSuccessModal(e.length===1?"search.hitlist.note_successfully_removed":"search.hitlist.notes_successfully_removed"),t.forEach(r=>{let a=this._noteAcCodes.findIndex(l=>l===r);a>-1&&(this._noteAcCodes=this._noteAcCodes.filter((l,m)=>m!==a))}),this.resetTableState())})).subscribe()}showImportDatasetModal(){this._modalService.open(dl).result.then(t=>{t&&this._fileContentService.uploadControlFile(t).pipe(V(n=>{if(n){let{importErrors:r,successfulImports:a}=n,l=this._modalService.open(pl);l.componentInstance.icon="success",a.length&&(l.componentInstance.successfulImports=a.length),r.length&&(l.componentInstance.errors=r,l.componentInstance.icon="error")}}),k(()=>(this._feedbackService.showErrorModal(),xe))).subscribe()})}syncListPresetConfiguration(){this.currentPageSize=this.currentPreset?this.currentPreset.perPage:this._searchConfig.defaultPerPage,this.currentPage=this._searchConfig.defaultPage}checkPermissionsForContextMenu(e){e.length===1&&(this.showLinkDocumentButton=this._authService.userHasPermission(se.ADD_DOC_TO_META));let n=this.hitlistTable.selectedRows.map(r=>r.item);this.disableSingleButtons=n.length!==1,this.areElementsSelected=n.length>0}hideContextMenuIfNoPermission(){!this.isOrderManagement&&this.showContextMenu&&(this.showContextMenu=this._authService.userHasPermission(se.VIEW_MENU))}updateHitlistItems(){for(let e=0;e<this._hitlistItems.length;e++){let t=this._hitlistItems[e];this._hitlistItems[e].isFavorite=this.getIconState(Yl,t),this._hitlistItems[e].hasComment=this.getIconState(Zl,t),this._hitlistItems[e].isCompanyData=this.getIconState(Jl,t),this._hitlistItems[e].isDraft=this.getIconState(Ql,t)}this._changeDetectorRef.markForCheck()}searchResultToHitlistItems(e){let t=[];for(let n of e){let r=n;r.isCompanyData=void 0,r.isDraft=void 0,r.isFavorite=void 0,r.hasComment=void 0,t.push(r)}return t}isTenantTemplate(e){return e===this._translocoService.translate("search.tenant_wide_template")}createConvertibilityInfos(e){let t=e.map(n=>({acCode:n.acCode,documentNumber:n.documentNumber,dateOfIssue:n.dateOfIssue,reqIfConvertible:n.reqIfConvertible,originalLanguage:n.originalLanguage,documents:n.documents.map(r=>({downloadable:r.downloadable,subscribable:r.subscribable,fulltextAddress:r.fulltextAddress,din21Id:r.din21Id,edvNr:r.edvNr,fulltextPages:r.fulltextPages,language:r.language}))}));this._reqifConversionService.openMultiConvertionModal(t)}calculateConversionLimitReached(){this.hitlistTable?.selectedRows||(this.conversionLimitReached=!1);let n=this.hitlistTable.selectedRows.map(r=>r.item).filter(r=>r.reqIfConvertible).length;this.conversionLimitReached=n>zC}
17handleEditMetadata(e){if(e[0].startsWith("CS")&&this._tenantStateService.isNautosProActive()){let t=this._modalService.open(Tl);t.componentInstance.isCustomerStandard=e[0].startsWith("CS"),t.result.then(n=>{n&&this._router.navigate(["../search/company-data/template",e[0]],{relativeTo:this._route,state:{type:n}})})}else this._router.navigate(["../search/company-data/template",e[0]],{relativeTo:this._route})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-hitlist"]],viewQuery:function(t,n){if(t&1&&Ge(Kr,5)($r,5),t&2){let r;le(r=ce())&&(n.hitlistTable=r.first),le(r=ce())&&(n.tableMenu=r.first)}},inputs:{resultList:"resultList",currentPaginationFromSearch:"currentPaginationFromSearch",currentPageSizeFromSearch:"currentPageSizeFromSearch",disableSelection:"disableSelection",isOrderManagement:"isOrderManagement",favoritesFolderTitle:"favoritesFolderTitle",favoritesRootFolder:"favoritesRootFolder",favoritesFolderType:"favoritesFolderType",favoritesFolder:"favoritesFolder",showContextMenu:"showContextMenu",currentPageSize:"currentPageSize",hasCheckboxColumn:"hasCheckboxColumn",showHitlist:"showHitlist",hasRadioButtonColumn:"hasRadioButtonColumn",currentSortDirection:"currentSortDirection",currentSortField:"currentSortField",currentOpenFolderType:"currentOpenFolderType",favoritesMode:"favoritesMode"},outputs:{searchChanged:"searchChanged",rowsSelected:"rowsSelected",refreshFavoriteFolder:"refreshFavoriteFolder"},ngContentSelectors:Bg,decls:6,vars:2,consts:[["exportCsvTip",""],["layoutSelect",""],["tableMenu",""],["menuAnimatedButtons",""],["menuStaticButtons",""],["tableExpandColumnHeader",""],["tableContextMenu",""],["filterPopover","ngbPopover"],["filterPopoverContent",""],["tableExpand",""],["tableCell",""],["readonly_favorites",""],[1,"container-hitlist"],[1,"header-row",3,"ngClass"],["singularKey","search.hitlist.record_found","pluralKey","search.hitlist.records_found",3,"count"],[1,"table-layout",3,"formGroup"],["data-cy","infoBox",1,"box-info"],[1,"folder-description",3,"folder-favorite","box-warning"],[1,"container-menu-pagination"],[3,"appTable","inline","isExpandedTable","hasCheckbox"],["menu",""],[1,"table-pagination",3,"formGroup"],["label","common.table.pagination","labelPosition","left","data-cy","paginationSize","formControlName","selectedPageSize",3,"itemSelected","items"],["data-cy","pagination",3,"pageChange","collectionSize","tableMenu","page","pageSize"],[1,"container-table"],["data-cy","numberOfSelectedEntries"],[3,"count"],["label","search.table_layout.title","labelPosition","left","data-cy","openHitlistLayouts","formControlName","selectedLayout",3,"itemSelected","items","customSelectTemplate"],[1,"box-title"],[1,"box-content"],["type","button",1,"btn-primary-outline",3,"click"],[1,"folder-description"],["data-cy","folderDescription",1,"box-content"],[1,"btn-group"],["type","button","class","btn-menu-animated",3,"ngbTooltip","click",4,"permissions"],["type","button","data-cy","iconAddToCart",1,"btn-menu-animated",3,"ngbTooltip"],["type","button","data-cy","iconLinkDocument",1,"btn-menu-animated",3,"disabled","ngbTooltip"],["type","button","class","btn-menu-animated","data-cy","iconMetadataAsTemplate",3,"disabled","ngbTooltip","click",4,"permissions"],["type","button","data-cy","iconReqIfConversion",1,"btn-menu-animated",3,"disabled","ngbTooltip"],[4,"permissions"],["type","button","data-cy","iconAddToRootFavorite",1,"btn-menu-animated",3,"ngbTooltip"],["type","button","data-cy","iconAddToFavorite",1,"btn-menu-animated",3,"click","ngbTooltip"],["name","folder-favorite"],["type","button","data-cy","iconAddToRootFavorite",1,"btn-menu-animated",3,"click","ngbTooltip"],[3,"name"],["type","button",1,"btn-menu-animated",3,"click","ngbTooltip"],["data-cy","iconAddToNote",3,"name"],["type","button","class","btn-menu-animated","data-cy","iconAddToCart",3,"ngbTooltip","click",4,"permissions"],["type","button","data-cy","iconAddToCart",1,"btn-menu-animated",3,"click","ngbTooltip"],["name","order-add"],["type","button","data-cy","iconLinkDocument",1,"btn-menu-animated",3,"click","disabled","ngbTooltip"],["name","document-link"],["type","button","data-cy","iconMetadataAsTemplate",1,"btn-menu-animated",3,"click","disabled","ngbTooltip"],["name","copy"],["type","button","data-cy","iconReqIfConversion",1,"btn-menu-animated",3,"click","disabled","ngbTooltip"],["name","reqif-conversion"],["type","button","class","btn-menu-static","data-cy","iconCsvExport",3,"disabled","ngbTooltip","click",4,"permissions"],["type","button","class","btn-menu-static","data-cy","iconControlFileImport",3,"ngbTooltip","click",4,"permissions"],["type","button","data-cy","iconRequestCompanyData",1,"btn-menu-static",3,"disabled","ngbTooltip"],["type","button","data-cy","iconCsvExport",1,"btn-menu-static",3,"click","disabled","ngbTooltip"],["name","csv-export"],["type","button","data-cy","iconControlFileImport",1,"btn-menu-static",3,"click","ngbTooltip"],["name","control-file-import"],["type","button","class","btn-menu-static","data-cy","iconRequestCompanyData",3,"disabled","ngbTooltip","click",4,"permissions"],["type","button","data-cy","iconRequestCompanyData",1,"btn-menu-static",3,"click","disabled","ngbTooltip"],["name","order-company-data"],["type","button","class","btn-menu-static","data-cy","iconAddCompanyData",3,"ngbTooltip","click",4,"permissions"],["type","button","class","btn-menu-static","data-cy","iconCsvImport",3,"ngbTooltip","click",4,"permissions"],["type","button","data-cy","iconAddCompanyData",1,"btn-menu-static",3,"click","ngbTooltip"],["name","company-data-create"],["type","button","data-cy","iconCsvImport",1,"btn-menu-static",3,"click","ngbTooltip"],["name","csv-import"],["sortBy","title","preventBrowserSelectClass","prevent-user-selection","id","hitlist-table","data-cy","table",3,"rowsSelected","stateChange","cellClick","items","hasExpandedRow","hasCheckboxColumn","hasRadioButtonColumn","hasExtraIconColumn","hasStickyHeader"],["tableColumn",""],[1,"no-content"],["popoverClass","filter-container","placement","bottom-left","autoClose","outside","type","button","container","body",1,"btn-filter",3,"ngbPopover","disablePopover"],["name","filter","data-cy","iconFilter",3,"ngClass"],["data-cy","filter",3,"filterClose","filterChange"],["data-cy","miniDetails",3,"showAllMetas","searchOrNavigate","item","currentRow","format","defaultFormat"],[1,"hitlist-options"],["type","button",1,"btn-icon",3,"click","ngbTooltip"],["name","folder-favorite","data-cy","iconFavorite",3,"ngClass"],["name","note-folder","data-cy","iconNote",3,"ngClass"],["name","company-data","data-cy","iconCompanyData",3,"ngClass"],["name","metadata-draft","data-cy","iconDraft",3,"ngClass"],["name","reqif","data-cy","iconReqIf",3,"ngClass"],["tableColumn","",3,"columnText","itemProperty","styleClasses","sortable"],[3,"item","cellTemplate"],[3,"itemAddedToCart","item","cellTemplate"],["sprite","icons-large","data-cy","iconLargeNoSearchResult",1,"icon-inactive",3,"name"],["data-cy","textNoSearchResults",3,"empty-favorites"],[4,"permissions","permissionsElse"],["data-cy","textNoSearchResults"],["data-cy","textNoItemsShared"],["type","button","data-cy","createHitlistLayout",1,"btn-icon-text"],[1,"select-text"],[1,"select-text",3,"disabled"],[1,"select-text","clickable"],["type","button","data-cy","editHitlistLayout",1,"btn-icon-no-border",3,"click"],["name","edit"],["type","button","data-cy","deleteHitlistLayout",1,"btn-icon-no-border",3,"click"],["name","delete"],["name","settings"]],template:function(t,n){t&1&&(kn(),u(0,Kg,1,0,"app-spinner"),u(1,AC,20,24,"div",12),Y(2,BC,2,2,"ng-template",null,0,fe)(4,WC,2,2,"ng-template",null,1,fe)),t&2&&(_(n.initialPresetsAreLoaded?-1:0),s(),_(n.showHitlist&&(n.hitlistItems||n.favoritesMode)?1:-1))},dependencies:[ui,Oe,lt,_o,Ne,Te,ye,Ee,De,xt,$r,ln,En,mo,_e,j,Al,Kr,zn,Ul,zl,ho,jl,ct,$],styles:[".folder-description[_ngcontent-%COMP%]{border-radius:var(--border-radius);border:var(--border);margin-bottom:var(--spacer);padding:var(--spacer);white-space:pre-wrap}.folder-description.folder-favorite[_ngcontent-%COMP%]{background-color:var(--color-gray-lighter)}.folder-description[_ngcontent-%COMP%] .box-title[_ngcontent-%COMP%]{font-family:var(--font-family-bold);font-size:var(--font-size-h3)}.header-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;margin-block:var(--spacer);padding-right:2px}.header-row[_ngcontent-%COMP%] .table-layout[_ngcontent-%COMP%]{display:flex;gap:calc(var(--spacer) / 2);flex-wrap:wrap;align-items:center}.header-row[_ngcontent-%COMP%] .table-layout[_ngcontent-%COMP%] app-select[_ngcontent-%COMP%]{width:24rem}@media(width<=36rem){.header-row[_ngcontent-%COMP%] .table-layout[_ngcontent-%COMP%]{margin-block:calc(var(--spacer) / 2)}}@media(width<=36rem){.header-row[_ngcontent-%COMP%]{margin-block:0}}.container-hitlist[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.container-hitlist[_ngcontent-%COMP%] .container-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;overflow-x:auto}.prevent-user-selection[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.select-text[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
17width:18.75rem}.select-text.disabled[_ngcontent-%COMP%]{cursor:default}.hitlist-options[_ngcontent-%COMP%]{align-items:center;display:flex}.hitlist-options[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]:first-child{margin-right:.1rem}"],changeDetection:0})}}return i})();var re=class i{static sortStringArrayByTranslation(o,e,t=!1){let n=t?"common.metadata_label.pro_metadata.":"common.metadata_label.";return o.sort((r,a)=>{t&&(r=Ht.getCorrectLabel(r),a=Ht.getCorrectLabel(a));let l=e.translate(n+r),m=e.translate(n+a);return l.localeCompare(m)})}static sortObjectsInArrayByDate(o,e,t="desc"){return o.sort((n,r)=>t==="desc"?r[e]?.localeCompare(n[e]):n[e]?.localeCompare(r[e]))}static sortMetadataByTranslation(o,e){let t="",n=Rt.map(l=>l.id.toLowerCase()),r=o.map((l,m)=>{n.includes(l.key.toLowerCase())?t="common.metadata_label.pro_metadata."+Ht.getCorrectLabel(l.key):t="common.metadata_label."+l.key;let b=e.translate(t);return{index:m,value:b.toLowerCase()}});return r.sort((l,m)=>l.value.localeCompare(m.value)),r.map(l=>o[l.index])}static clone(o){return JSON.parse(JSON.stringify(o))}static cloneDeep(o,e){e||(e=new WeakMap);let t=n=>n&&typeof n=="object"?i.cloneDeep(n,e):n;if(Array.isArray(o))return o.map(t);if(o&&typeof o=="object"){if(e.has(o))return e.get(o);if(o instanceof Date){let r=new Date(o.valueOf());return e.set(o,r),r}let n=Object.create(Object.getPrototypeOf(o));e.set(o,n);for(let[r,a]of Object.entries(o))n[r]=t(a);return n}return o}static removeDuplicates(o,e="id"){if(e)if(i.isArrayOfStrings(o)){let t={};return o.filter(n=>Object.hasOwn(t,n)?!1:(t[n]=!0,!0))}else return o.map(t=>t[e]).map((t,n,r)=>r.indexOf(t)===n&&n).filter(t=>o[t]).map(t=>o[t]);
17else return o.filter((t,n)=>o.indexOf(t)===n)}static documentCompare(o,e){let t=o.url?o.url:o.link,n=e.url?e.url:e.link;return t===n&&o.description===e.description}static detectStringSeparator(o){let e=",";return typeof o!="string"?"":(o.indexOf(Yo)>0&&(e=Yo),e)}static compareCustomFields(o,e){return o.id.replace("customfield","")<e.id.replace("customfield","")?-1:o.id.replace("customfield","")>e.id.replace("customfield","")?1:0}static isArrayOfStrings(o){return Array.isArray(o)&&o.every(e=>typeof e=="string")}};var ei=(()=>{class i{constructor(){this._authService=g(ue),this._configService=g(Se),this._httpClient=g(Fe),this._documentListCollectionSubject=new oe([]),this.documentListCollection$=this._documentListCollectionSubject.asObservable()}getUserAccountId(){return this._authService.userInfo.userAccountId}closeDocument(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/simultaneously/${e}`;this._httpClient.delete(t).subscribe()}getTenantWideDocuments(e,t,n,r,a){--e;let l=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/tenantwidedocuments?pageNumber=${e}&pageSize=${t}&sortField=${n}&sortDir=${r}`;return this._httpClient.post(l,this.convertFilterModelToDto(a),{observe:"response"}).pipe(S(m=>{let b=m.body,T=b.items.map(O=>({id:O.id,din21Id:O.din21Id,url:O.url?O.url:O.fileName,description:O.description,language:O.language,documentType:O.documentType,documentNumber:O.documentNumber,dateOfIssue:O.publicationDate,fileName:O.fileName,type:O.type,acCode:O.acCode,updatedOn:O.updatedOn,createdOn:O.createdOn,abos:O.abos.sort()}));return{totalCount:b.totalCount,documentItems:T}}),k(()=>M(null)))}getLicensesByDin21Id(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/licenses/${e}`;return this._httpClient.get(t)}getDocumentListForDin21Ids(e,t,n){return new He(r=>{let a=t.pageNumber,l=t.pageSize,m=t.sortField,b=t.sortDir||"asc",T=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/din21id?pageNumber=${a}&pageSize=${l}&sortField=${m}&sortDir=${b}`,U={userId:this.getUserAccountId(),din21Ids:e,filter:n};this._httpClient.post(T,U).subscribe({next:H=>{H&&r.next(H)}})})}getDocumentListForAcCodes(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess`,r={userId:this.getUserAccountId(),acCodes:e};return this._httpClient.post(t,r)}downloadFile(e){if(!e)throw new Error("fileId must not be empty!");let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/download/${e}`;return this._httpClient.get(t,{responseType:"blob"})}requestDocumentCsvExport(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/export/csv/documentaccess`;return this._httpClient.post(t,e,{observe:"response"})}getDocumentAccessInformation(e){return et({accessInformation:this.getAccessInformation(e),additionalInformation:this.getPdfProtection(e)}).pipe(S(({accessInformation:t,additionalInformation:n})=>this.transformAccessInformation(t,n)))}checkSimultaneouslyAccessAndBlockLicense(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/simultaneously/${e}`;return this._httpClient.get(t,{observe:"response"})}getContextToken(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/octa/token?din21id=${e}`;return t&&(n+=`&lockId=${t}`),this._httpClient.get(n)}getDocumentsForBuyNowInterface(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/alldocuments`;return this._httpClient.post(t,{acCodes:e})}refreshDocumentList(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess`,a={userId:t??this.getUserAccountId(),acCodes:e};this._httpClient.post(n,a).pipe().subscribe({next:l=>{l&&this._documentListCollectionSubject.next(this.toDocumentResponseModel(l))}})}changeProxySettings(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/proxy/settings`,n={encryptDocumentUrl:e};return this._httpClient.post(t,n)}getProxySettings(){let e=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/proxy/settings`;return this._httpClient.get(e,{observe:"response"}).pipe(S(t=>ne.isAccepted(t.status)?t.body:null))}trackDocumentAccess(e,t,n,r,a=null){let l=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/document-opened`,m={din21Id:e,acCode:t,documentType:n,fileName:r,lockId:a};return this._httpClient.post(l,m)}trackDocumentAccessByHostedFileId(e,t){let n=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/document-opened/hosted-file?hostedFileId=${e}&documentType=${B.FILE_HOSTED}?fileName=${t}`;return this._httpClient.post(n,null)}getAccessInformation(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/info`,r={ids:re.removeDuplicates(e,"id")};return this._httpClient.post(t,r)}getPdfProtection(e){let t=`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/documentaccess/hostedfiles/security-status`,n={ids:e};return this._httpClient.post(t,n).pipe(S(r=>r.map(this.documentAccessStatusDtoToModel)))}documentAccessStatusDtoToModel(e){return{hostedFileId:e.hostedFileId,isViewable:e.isViewable,error:e.error}}transformAccessInformation(e,t){let n=Object.keys(e.accessInformations),r={},a=t.reduce((l,m)=>(l[m.hostedFileId]=!m.isViewable,l),{});
17return n.forEach(l=>{let m={licenseInformation:e.accessInformations[l],isRestricted:a[l]||!1};r[l]=m}),r}toDocumentResponseModel(e){return e.map(t=>ve(K({},t),{fulltexts:this.toFulltextResponseModel(t.fulltexts)}))}toFulltextResponseModel(e){return e.map(t=>ve(K({},t),{isLocked:!1}))}convertFilterModelToDto(e){return{abos:e.abos,description:e.description,documentNumber:e.documentNumber,documentType:e.documentType,groupId:e.group?.value??Pe,language:e.language,licenseAssignmentType:e.licenseAssignmentType,licenseName:e.licenseName,publicationDate:e.publicationDate,type:e.type,userId:e.user?.value??Pe,updatedOn:e.updatedOn}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=te({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{zt as a,se as b,Ei as c,Xi as d,B as e,Xt as f,so as g,Dn as h,Oi as i,Vs as j,lo as k,at as l,en as m,Yn as n,Vt as o,gi as p,Pi as q,ei as r,si as s,Qn as t,Rt as u,Jn as v,is as w,Fi as x,yt as y,nn as z,no as A,Ms as B,on as C,P1 as D,Mi as E,Gt as F,Ir as G,bi as H,wr as I,Ks as J,co as K,Pr as L,mo as M,qs as N,En as O,an as P,Ws as Q,uo as R,_o as S,lD as T,ho as U,sn as V,ln as W,ED as X,Ys as Y,kD as Z,AD as _,BD as $,$D as aa,fo as ba,Zs as ca,dE as da,yE as ea,xE as fa,al as ga,Qe as ha,Yt as ia,xt as ja,dl as ka,pl as la,$e as ma,Fn as na,Ni as oa,ul as pa,_l as qa,hl as ra,Ur as sa,fl as ta,gl as ua,ti as va,Br as wa,Dm as xa,Em as ya,Nw as za,yi as Aa,xo as Ba,nt as Ca,Cl as Da,So as Ea,To as Fa,pe as Ga,vl as Ha,Do as Ia,xl as Ja,Sl as Ka,Vr as La,Tl as Ma,Il as Na,qe as Oa,Io as Pa,Fl as Qa,$r as Ra,Qt as Sa,Kr as Ta,Dt as Ua,Fo as Va,Gr as Wa,Mo as Xa,Ol as Ya,wo as Za,Oo as _a,Po as $a,Rl as ab,Al as bb,No as cb,ko as db,Gl as eb,Ro as fb,ql as gb,Ao as hb,Ht as ib,re as jb,st as kb,go as lb};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.