nucliadb-admin-assets 1.0.0.post2439__py3-none-any.whl → 1.0.0.post2441__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of nucliadb-admin-assets might be problematic. Click here for more details.

@@ -1 +1 @@
1
- "use strict";(self.webpackChunknucliadb_admin=self.webpackChunknucliadb_admin||[]).push([[789],{1789:(Vn,L,c)=>{c.r(L),c.d(L,{SYNC_ROUTES:()=>On});var s=c(2306),S=c(419),k=c(1413),ht=c(1584),f=c(5964),h=c(5558),$=c(6977);const x="assets/connector-logos";var P=function(o){return o.PENDING="PENDING",o.PROCESSING="PROCESSING",o.UPLOADED="UPLOADED",o.ERROR="ERROR",o}(P||{}),T=c(4412),g=c(7673),b=c(8141),_=c(6697),u=c(6354),V=c(9437),C=c(7413);const mt={id:"sitemap",title:"Sitemap",logo:`${x}/sitemap.svg`,description:"Upload web pages from a sitemap.xml",permanentSyncOnly:!0,factory:()=>new gt};class gt{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"Sitemap",originalId:"SITEMAP",metadata:{},status:P.PENDING}]}getParametersSections(){return(0,g.of)([{id:"url",title:"sync.connectors.sitemap.url.section-title",fields:[{id:"sitemap",label:"sync.connectors.sitemap.url.label",type:"text",required:!0,pattern:/.+\.(ashx|xml)/,placeholder:"https://my-website.com/sitemap.xml"}]},{id:"restrict-indexation",title:"sync.connectors.common.restrict-indexation.title",description:"sync.connectors.common.restrict-indexation.description",badge:"generic.badge.optional",fields:[{id:"cssSelector",label:"sync.connectors.common.css.label",help:"sync.connectors.common.css.help",type:"text",required:!1,placeholder:".main-content"},{id:"xpathSelector",label:"sync.connectors.common.xpath.label",help:"sync.connectors.common.xpath.help",type:"text",required:!1,placeholder:'//div[@id="main"]'}]},{id:"web-scraping-helpers",title:"sync.connectors.common.web-scraping-helpers.title",description:"sync.connectors.common.web-scraping-helpers.description",badge:"generic.badge.advanced",fields:[{id:"localExtract",label:"sync.connectors.common.local-extract.label",help:"sync.connectors.common.local-extract.help",type:"boolean",required:!1},{id:"keepQueryString",label:"sync.connectors.common.keep-querystring.label",help:"sync.connectors.common.keep-querystring.help",type:"boolean",required:!1},{id:"headers",label:"sync.connectors.common.headers.label",help:"sync.connectors.common.headers.help",type:"table",required:!1},{id:"cookies",label:"sync.connectors.common.cookies.label",help:"sync.connectors.common.cookies.help",type:"table",required:!1},{id:"localstorage",label:"sync.connectors.common.localstorage.label",help:"sync.connectors.common.localstorage.help",type:"table",required:!1}]}])}handleParameters(r){}cleanAuthData(){throw new Error("Method not implemented.")}getParametersValues(){return{}}goToOAuth(){}authenticate(){return(0,g.of)(!0)}}const yt={id:"folder",title:"Folder",logo:`${x}/folder.svg`,description:"Upload a folder from your device",factory:()=>new ft};class ft{constructor(){this.hasServerSideAuth=!1,this.isExternal=!1,this.allowToSelectFolders=!1,this.files=[],this.path="",this.canSyncSecurityGroups=!1}getStaticFolders(){return this.path?[{uuid:"",title:this.path,originalId:this.path,metadata:{},status:P.PENDING}]:[]}getParametersSections(){return(0,g.of)([{id:"local-path",title:"sync.connectors.folder.local-path.title",description:"sync.connectors.folder.local-path.description",fields:[{id:"path",label:"sync.connectors.folder.local-path.field-label",placeholder:"/Users/alice/Documents or C:\\Users\\Alice\\Documents",type:"text",required:!0}]}])}goToOAuth(){}cleanAuthData(){throw new Error("Method not implemented.")}handleParameters(r){r.path&&(this.path=r.path)}getParametersValues(){return{path:this.path}}authenticate(){return(0,g.of)(!0)}}const X="token",A="refresh";class D{constructor(r,e,n){this.hasServerSideAuth=!0,this.isExternal=!0,this.allowToSelectFolders=!0,this.resumable=!1,this.isAuthenticated=new T.t(!1),this.canSyncSecurityGroups="gdrive"===r,this.name=r,this.id=e,this.path=n}getParametersSections(){return(0,g.of)([])}handleParameters(r){}getParametersValues(){return{token:localStorage.getItem(this.prefixStorageKey(X)),refresh:localStorage.getItem(this.prefixStorageKey(A)),refresh_endpoint:`${this.path}/api/external_auth/${this.name}/refresh`}}cleanAuthData(){localStorage.removeItem(this.prefixStorageKey(X)),localStorage.removeItem(this.prefixStorageKey(A))}goToOAuth(r,e){if(e&&this.cleanAuthData(),localStorage.getItem(this.prefixStorageKey(X)))this.isAuthenticated.next(!0);else{const i=`${this.path}/api/external_auth/${this.name}/authorize`;window.electron?window.electron.openExternal(`${i}?redirect=nuclia-desktop://index.html`):location.href=`${i}?redirect=${r}`}}authenticate(){if(!this.isAuthenticated.getValue()){const r=setInterval(()=>{const e=function _t(){let o=location.search;if(!o&&location.href.includes("#")){const r=location.href.split("#")[1];o=r.includes("?")?"?"+r.split("?")[1]:"?"+r}return o&&o.includes("#")&&!o.includes("?")&&(o=o.replace("#","?")),o}();if(e&&e.includes("?")){const n=new URLSearchParams(e.split("?")[1]),i=n.get("token")||"",a=n.get("refresh")||"";clearInterval(r),i?(localStorage.setItem(this.prefixStorageKey(X),i),localStorage.setItem(this.prefixStorageKey(A),a||""),this.isAuthenticated.next(!0)):this.isAuthenticated.next(!1)}},500)}return this.isAuthenticated.asObservable()}prefixStorageKey(r){return`${this.name}-${this.id}-${r}`}getStaticFolders(){return[]}}const J="SHAREPOINT_SITE_NAME";class bt extends D{constructor(r,e,n){super(r,e,n)}getParametersSections(){return(0,g.of)([{id:"account",title:"sync.connectors.sharepoint.account.title",fields:[{id:"site_name",label:"sync.connectors.sharepoint.site.label",type:"text",required:!0}]}])}handleParameters(r){localStorage.setItem(J,r.site_name)}getParametersValues(){return{...super.getParametersValues(),site_name:localStorage.getItem(J)}}}const Ct={id:"confluence",title:"Confluence",logo:`${x}/confluence.svg`,description:"Collaboration platform developed by Atlassian",helpUrl:"https://docs.nuclia.dev/docs/docs/using/sync-agent#confluence-connector-usage",deprecated:!0,factory:()=>new vt},Q="CONFLUENCE_TOKEN";class vt{constructor(){this.hasServerSideAuth=!1,this.isExternal=!1,this.allowToSelectFolders=!0,this.canSyncSecurityGroups=!1}getParametersSections(){return(0,g.of)([{id:"account",title:"sync.connectors.confluence.account.title",description:"sync.connectors.confluence.account.description",fields:[{id:"url",label:"sync.connectors.confluence.url.label",type:"text",placeholder:"https://my-site.atlassian.net/wiki",required:!0},{id:"user",label:"sync.connectors.confluence.user.label",type:"text",placeholder:"me@mycompany.com",required:!0},{id:"token",label:"sync.connectors.confluence.token.label",type:"text",required:!0}]}])}handleParameters(r){localStorage.setItem(Q,r.token)}getParametersValues(){return{token:localStorage.getItem(Q)}}goToOAuth(r,e){return(0,g.of)(!0)}cleanAuthData(){throw new Error("Method not implemented.")}authenticate(){return(0,g.of)(!!this.getParametersValues().token)}getStaticFolders(){return[]}}const St={id:"rss",title:"RSS",logo:`${x}/rss.svg`,description:"Upload web pages from a RSS feed",permanentSyncOnly:!0,factory:()=>new xt};class xt{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"RSS",originalId:"rss",metadata:{},status:P.PENDING}]}getParametersSections(){return(0,g.of)([{id:"url",title:"sync.connectors.rss.url.label",fields:[{id:"url",label:"sync.connectors.rss.url.label",type:"text",required:!0,placeholder:"https://rss-feed-url"}]},{id:"restrict-indexation",title:"sync.connectors.common.restrict-indexation.title",description:"sync.connectors.common.restrict-indexation.description",badge:"generic.badge.optional",fields:[{id:"cssSelector",label:"sync.connectors.common.css.label",help:"sync.connectors.common.css.help",type:"text",required:!1,placeholder:".main-content"},{id:"xpathSelector",label:"sync.connectors.common.xpath.label",help:"sync.connectors.common.xpath.help",type:"text",required:!1,placeholder:'//div[@id="main"]'}]},{id:"web-scraping-helpers",title:"sync.connectors.common.web-scraping-helpers.title",description:"sync.connectors.common.web-scraping-helpers.description",badge:"generic.badge.advanced",fields:[{id:"localExtract",label:"sync.connectors.common.local-extract.label",help:"sync.connectors.common.local-extract.help",type:"boolean",required:!1},{id:"headers",label:"sync.connectors.common.headers.label",help:"sync.connectors.common.headers.help",type:"table",required:!1},{id:"cookies",label:"sync.connectors.common.cookies.label",help:"sync.connectors.common.cookies.help",type:"table",required:!1},{id:"localstorage",label:"sync.connectors.common.localstorage.label",help:"sync.connectors.common.localstorage.help",type:"table",required:!1}]}])}handleParameters(r){}cleanAuthData(){throw new Error("Method not implemented.")}getParametersValues(){return{}}goToOAuth(){}authenticate(){return(0,g.of)(!0)}}var Tt=c(5512),Ft=c(4808);const W="http://localhost:8090",H="NUCLIA_SYNC_SERVER",z="NUCLIA_SYNC_SERVER_TYPE";let j=(()=>{class o{constructor(e,n,i,a){this.sdk=e,this.http=n,this.config=i,this.notificationService=a,this.connectors={gdrive:{definition:{id:"gdrive",title:"Google Drive",logo:`${x}/gdrive.svg`,description:"File storage and synchronization service developed by Google",permanentSyncOnly:!0,deprecated:!0,factory:p=>new D("gdrive",p?.id||"",this.config.getOAuthServer())}},onedrive:{definition:{id:"onedrive",title:"One Drive",logo:`${x}/onedrive.svg`,description:"Microsoft OneDrive file hosting service",permanentSyncOnly:!0,deprecated:!0,factory:p=>new D("onedrive",p?.id||"",this.config.getOAuthServer())}},sharepoint:{definition:{id:"sharepoint",title:"SharePoint",logo:`${x}/sharepoint.svg`,description:"Microsoft Sharepoint service",permanentSyncOnly:!0,deprecated:!0,factory:p=>new bt("sharepoint",p?.id||"",this.config.getOAuthServer())}},dropbox:{definition:{id:"dropbox",title:"Dropbox",logo:`${x}/dropbox.svg`,description:"File storage and synchronization service developed by Dropbox",permanentSyncOnly:!0,deprecated:!0,factory:p=>new D("dropbox",p?.id||"",this.config.getOAuthServer())}},folder:{definition:yt},sitemap:{definition:mt},confluence:{definition:Ct},rss:{definition:St}},this.connectorsObs=new T.t(Object.values(this.connectors).map(p=>p.definition).filter(p=>!p.deprecated)),this._syncServer=new T.t({serverUrl:localStorage.getItem(H)||W,type:localStorage.getItem(z)||"desktop"}),this.syncServer=this._syncServer.asObservable(),this._isServerDown=new T.t(!0),this._currentSyncId=new T.t(null),this._syncCache=new T.t({}),this._cacheUpdated=new T.t((new Date).toISOString()),this._isSyncing=new T.t({}),this.isServerDown=this._isServerDown.asObservable(),this.currentSyncId=this._currentSyncId.asObservable(),this.serverHeaders={token:this.sdk.nuclia.auth.getToken(!0)},this.cacheUpdated=this._cacheUpdated.asObservable(),this.isSyncing=this._isSyncing.asObservable()}getConnectorDefinition(e){return this.connectors[e]?.definition}getConnector(e,n){const i=this.connectors[e];i.instances||(i.instances={});const a=i.instances;return a[n]||(a[n]=i.definition.factory({id:n})),a[n]}getCurrentSync(){return this.currentSyncId.pipe((0,f.p)(e=>!!e),(0,h.n)(e=>this.getSync(e)))}getSync(e){const n=this._syncCache.getValue();return n[e]?(0,g.of)(n[e]):this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{headers:this.serverHeaders}).pipe((0,b.M)(i=>{n[e]=i,this._syncCache.next(n)}))}addSync(e){return this.sdk.currentKb.pipe((0,_.s)(1),(0,h.n)(n=>this.sdk.nuclia.options.standalone?(0,g.of)({...e,kb:{...this.sdk.nuclia.options,knowledgeBox:n.id}}):this.getNucliaKey(n).pipe((0,u.T)(i=>({...e,kb:{zone:this.sdk.nuclia.options.zone,backend:this.sdk.nuclia.options.backend,knowledgeBox:i.kbid,apiKey:i.token}})))),(0,h.n)(n=>this.http.post(`${this._syncServer.getValue().serverUrl}/sync`,n,{headers:this.serverHeaders})),(0,b.M)(()=>{const n=this._syncCache.getValue();n[e.id]=e,this._syncCache.next(n),this._cacheUpdated.next((new Date).toISOString())}),(0,u.T)(()=>{}))}updateSync(e,n,i){return this.http.patch(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{...n,lastSyncGMT:i?"1970-01-01":void 0},{headers:this.serverHeaders}).pipe((0,b.M)(()=>{const a=this._syncCache.getValue();a[e]={...a[e],...n},this._syncCache.next(a),this._cacheUpdated.next((new Date).toISOString())}))}deleteSync(e){return this.http.delete(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{headers:this.serverHeaders}).pipe((0,b.M)(()=>{const n=this._syncCache.getValue();delete n[e],this._syncCache.next(n),this._cacheUpdated.next((new Date).toISOString())}))}hasCurrentSourceAuth(){return this.getCurrentSyncId()?this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/auth`).pipe((0,u.T)(n=>n.hasAuth)):(0,g.of)(!1)}getSyncsForKB(e){return this.isServerDown.pipe((0,h.n)(n=>n?(0,g.of)([]):this.http.get(`${this._syncServer.getValue().serverUrl}/sync/kb/${e}`).pipe((0,u.T)(i=>i.map(a=>({...a,kbId:e,connectorId:a.connector,connector:this.getConnector(a.connector,"")})).filter(a=>a.kbId===e)))))}getFiles(e){return this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/files/search${e?`?query=${e}`:""}`)}getFolders(e){return this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/folders`,{headers:this.serverHeaders})}canSelectFiles(e){const n=this._syncCache.getValue()[e];return n&&!("sitemap"===n.connector.name||"folder"===n.connector.name||"rss"===n.connector.name)}getNucliaKey(e){return e.createKeyForService({title:"Sync",role:"SCONTRIBUTOR"},this.getExpirationDate()).pipe((0,u.T)(n=>({...n,kbid:e.id})))}getExpirationDate(){const e=new Date;return e.setFullYear(e.getFullYear()+1),Math.floor(e.getTime()/1e3).toString()}serverStatus(e){return this.http.get(`${e}/status`).pipe((0,V.W)(()=>(0,g.of)({running:!1,logs:["Server down"]})),(0,u.T)(n=>((n.logs||[]).forEach(i=>console.log("[SERVER]",i)),{running:n.running})))}setSyncServer(e,n){localStorage.setItem(H,e||""),localStorage.setItem(z,n),this._syncServer.next({serverUrl:e||"",type:n}),e&&this.serverStatus(e).subscribe(i=>{this.setServerStatus(!i.running)})}authenticateToConnector(e,n){return n.authenticate().pipe((0,f.p)(i=>i),(0,_.s)(1),(0,h.n)(()=>this.updateSync(this.getCurrentSyncId()||"",{connector:{name:e,parameters:n.getParametersValues()}})),(0,u.T)(()=>(n.cleanAuthData(),!0)))}getCurrentSyncId(){return this._currentSyncId.getValue()}setCurrentSyncId(e){this._currentSyncId.next(e)}clearCurrentSourceId(){this._currentSyncId.next(null)}getLogs(e,n){return this.http.get(`${this._syncServer.getValue().serverUrl}/logs${e?"/"+e:""}${n?"/"+n:""}`).pipe((0,u.T)(i=>i.sort((a,p)=>{const F=(0,Tt.T)(a.createdAt,p.createdAt);return 0===F?a.action.startsWith("start")?1:-1:F})))}clearLogs(){return this.http.delete(`${this._syncServer.getValue().serverUrl}/logs`)}getSyncServer(){return this._syncServer.getValue().serverUrl}setServerStatus(e){e&&!this._isServerDown.value&&this.notificationService.pushNotifications([{type:"sync-server",data:[],timestamp:(new Date).toISOString(),unread:!0,failure:!0}]),this._isServerDown.next(e)}triggerSync(e,n=!1){return this._isSyncing.next({...this._isSyncing.value,[e]:!0}),(n?this.updateSync(e,{},!0).pipe((0,u.T)(()=>!0)):(0,g.of)(!0)).pipe((0,h.n)(()=>this.http.get(`${this._syncServer.getValue().serverUrl}/sync/execute/${e}`)),(0,b.M)(()=>this._isSyncing.next({...this._isSyncing.value,[e]:!1})),(0,V.W)(a=>(console.warn("Trigger sync failed:",a),this._isSyncing.next({...this._isSyncing.value,[e]:!1}),(0,g.of)())))}static#t=this.\u0275fac=function(n){return new(n||o)(s.KVO(C.ok),s.KVO(Ft.Qq),s.KVO(C.M),s.KVO(C.JE))};static#e=this.\u0275prov=s.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var t=c(2898);let It=(()=>{class o{constructor(){this.unsubscribeAll=new k.B,this.syncService=(0,s.WQX)(j)}ngOnInit(){let e=!1,n=0;(0,ht.O)(0,5e3).pipe((0,f.p)(()=>{const a=n>=(e?12:0);return n++,a}),(0,h.n)(()=>this.syncService.serverStatus(this.syncService.getSyncServer())),(0,$.Q)(this.unsubscribeAll)).subscribe(i=>{e=i.running,n=0,this.syncService.setServerStatus(!e)})}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["ng-component"]],decls:1,vars:0,template:function(n,i){1&n&&t.nrm(0,"router-outlet")},dependencies:[S.n3],encapsulation:2,changeDetection:0})}return o})();var R=c(7705),l=c(8743),Rt=c(9874),E=c(4929);let Mt=(()=>{class o{constructor(){this.title="",this.logo="",this.disabled=!1,this.selectConnector=new t.bkB}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-connector"]],inputs:{title:"title",logo:"logo",disabled:[2,"disabled","disabled",R.L39]},outputs:{selectConnector:"selectConnector"},decls:5,vars:3,consts:[[3,"cardClick","disabled"],[1,"connector"],["size","large",3,"path"]],template:function(n,i){1&n&&(t.j41(0,"pa-card",0),t.bIt("cardClick",function(p){return i.selectConnector.emit(p)}),t.j41(1,"div",1),t.nrm(2,"pa-icon",2),t.j41(3,"div"),t.EFF(4),t.k0s()()()),2&n&&(t.Y8G("disabled",i.disabled),t.R7$(2),t.Y8G("path",i.logo),t.R7$(2),t.JRh(i.title))},dependencies:[l.ALJ,Rt.i,l.V3x,E.R],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.connector[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;gap:.5rem;width:6rem}'],changeDetection:0})}return o})();var v=c(7248),d=c(9417),K=c(4825),y=c(8018),m=c(4795),w=c(3606),kt=c(820),Z=c(6812),N=c(3085),B=c(4899),$t=c(7481),Pt=c(3257),jt=c(6010),q=c(5472),tt=c(9435),et=c(3107),Et=c(7839),wt=c(4099),nt=c(4684),Gt=c(9122);const Ot=()=>({section:"activity"}),ot=(o,r)=>r.id;function Vt(o,r){1&o&&(t.j41(0,"nsi-dropdown-button",17),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"sync.home-page.setup-server.on-desktop.download-dropdown")," "))}function Xt(o,r){if(1&o&&(t.j41(0,"nsi-badge"),t.EFF(1),t.nI1(2,"translate"),t.k0s(),t.nVh(3,Vt,3,3,"nsi-dropdown-button",17)),2&o){const e=t.XpG(2);t.R7$(),t.JRh(t.bMT(2,2,"sync.badge.inactive")),t.R7$(2),t.vxM(e.downloadSyncAgentFeature?3:-1)}}function Dt(o,r){1&o&&(t.j41(0,"nsi-badge",16),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.active")))}function At(o,r){if(1&o&&(t.nVh(0,Xt,4,4),t.nI1(1,"async"),t.vZN(2,Dt,3,3,"nsi-badge",16)),2&o){const e=t.XpG();t.vxM(t.bMT(1,1,e.inactiveServer)?0:2)}}function Nt(o,r){1&o&&(t.j41(0,"nsi-badge"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.inactive")))}function Bt(o,r){1&o&&(t.j41(0,"nsi-badge",16),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.active")))}function Ut(o,r){if(1&o&&(t.j41(0,"div",13),t.nVh(1,Nt,3,3,"nsi-badge"),t.nI1(2,"async"),t.vZN(3,Bt,3,3,"nsi-badge",16),t.j41(4,"pa-input",18),t.EFF(5," Server URL "),t.k0s(),t.j41(6,"pa-button",19),t.EFF(7),t.nI1(8,"translate"),t.k0s()()),2&o){const e=t.XpG();t.R7$(),t.vxM(t.bMT(2,3,e.inactiveServer)?1:3),t.R7$(5),t.Y8G("disabled",!e.serverUrlChanged),t.R7$(),t.SpI(" ",t.bMT(8,5,"generic.save")," ")}}function Yt(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-connector",20),t.nI1(1,"async"),t.nI1(2,"translate"),t.nI1(3,"async"),t.bIt("selectConnector",function(){const i=s.eBV(e).$implicit,a=t.XpG();return s.Njj(a.onSelectConnector(i))}),t.k0s()}if(2&o){const e=r.$implicit,n=t.XpG();t.Y8G("paTooltip",t.bMT(2,6,t.bMT(1,4,n.inactiveServer)?"sync.home-page.add-sources.disabled-source-tooltip":""))("disabled",t.bMT(3,8,n.inactiveServer))("title",e.title)("logo",e.logo)}}function Lt(o,r){1&o&&(t.j41(0,"nsi-info-card",21),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.home-page.sync-list.empty-info")))}function Jt(o,r){if(1&o&&(t.j41(0,"div",25),t.nrm(1,"pa-icon",33),t.EFF(2),t.k0s()),2&o){const e=r;t.R7$(),t.Y8G("path",e.logo),t.R7$(),t.SpI(" ",e.title," ")}}function Qt(o,r){if(1&o&&t.nrm(0,"pa-datetime",28),2&o){const e=t.XpG().$implicit;t.Y8G("datetime",e.lastSyncGMT)}}function Wt(o,r){1&o&&t.EFF(0," \u2013 ")}function Ht(o,r){if(1&o&&(t.j41(0,"pa-option",30),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("routerLink","./"+e.id+"/edit"),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.home-page.sync-list.menu.edit-folders")," ")}}function zt(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-table-row")(1,"pa-table-cell")(2,"a",24),t.EFF(3),t.k0s()(),t.j41(4,"pa-table-cell"),t.nVh(5,Jt,3,2,"div",25),t.k0s(),t.j41(6,"pa-table-cell")(7,"div",26),t.EFF(8),t.k0s()(),t.j41(9,"pa-table-cell")(10,"pa-toggle",27),t.bIt("valueChange",function(i){const a=s.eBV(e).$implicit,p=t.XpG(3);return s.Njj(p.toggleSync(a.id,i))}),t.EFF(11),t.k0s()(),t.j41(12,"pa-table-cell")(13,"div",26),t.nVh(14,Qt,1,1,"pa-datetime",28)(15,Wt,1,0),t.k0s()(),t.j41(16,"pa-table-cell-menu")(17,"pa-button",29),t.EFF(18," Menu "),t.k0s(),t.j41(19,"pa-dropdown",null,0)(21,"pa-option",30),t.EFF(22),t.nI1(23,"translate"),t.k0s(),t.nVh(24,Ht,3,4,"pa-option",30),t.j41(25,"pa-option",31),t.EFF(26),t.nI1(27,"translate"),t.k0s(),t.j41(28,"pa-option",32),t.bIt("selectOption",function(){const i=s.eBV(e).$implicit,a=t.XpG(3);return s.Njj(a.deleteSync(i))}),t.EFF(29),t.nI1(30,"translate"),t.k0s()()()()}if(2&o){let e;const n=r.$implicit,i=t.sdS(20),a=t.XpG(3);t.R7$(2),t.Y8G("routerLink","./"+n.id),t.R7$(),t.SpI(" ",n.title," "),t.R7$(2),t.vxM((e=null==a.connectors[n.connectorId]?null:a.connectors[n.connectorId].definition)?5:-1,e),t.R7$(3),t.JRh(n.totalSyncedResources),t.R7$(2),t.Y8G("value",!n.disabled),t.R7$(),t.SpI(" ",n.disabled?"Off":"On"," "),t.R7$(3),t.vxM("1970-01-01"!==n.lastSyncGMT?14:15),t.R7$(3),t.Y8G("paPopup",i),t.R7$(4),t.Y8G("routerLink","./"+n.id+"/edit"),t.R7$(),t.SpI(" ",t.bMT(23,15,"sync.home-page.sync-list.menu.edit-settings")," "),t.R7$(2),t.vxM(n.connector.allowToSelectFolders?24:-1),t.R7$(),t.Y8G("routerLink","./"+n.id)("queryParams",t.lJ4(21,Ot)),t.R7$(),t.SpI(" ",t.bMT(27,17,"sync.home-page.sync-list.menu.activity-logs")," "),t.R7$(3),t.SpI(" ",t.bMT(30,19,"sync.home-page.sync-list.menu.delete")," ")}}function Kt(o,r){if(1&o&&(t.j41(0,"pa-table",22),t.nrm(1,"pa-table-sortable-header",23),t.Z7z(2,zt,31,22,"pa-table-row",null,ot),t.k0s()),2&o){const e=t.XpG(),n=t.XpG();t.R7$(),t.Y8G("cells",n.syncTableHeader),t.R7$(),t.Dyx(e)}}function Zt(o,r){1&o&&t.nVh(0,Lt,3,3,"nsi-info-card",21)(1,Kt,4,1,"pa-table",22),2&o&&t.vxM(0===r.length?0:1)}let qt=(()=>{class o{constructor(){this.router=(0,s.WQX)(S.Ix),this.currentRoute=(0,s.WQX)(S.nX),this.syncService=(0,s.WQX)(j),this.sdk=(0,s.WQX)(C.ok),this.toaster=(0,s.WQX)(m._g),this.modalService=(0,s.WQX)(m.w8),this.translate=(0,s.WQX)(y.c$),this.unsubscribeAll=new k.B,this.downloadSyncAgentFeature=!1,this.inactiveServer=this.syncService.isServerDown,this.syncAgentForm=new d.gE({type:new d.MJ("desktop",{nonNullable:!0}),serverUrl:new d.MJ("",{nonNullable:!0,validators:[d.k0.required]})}),this.connectors=this.syncService.connectors,this.connectorList=this.syncService.connectorsObs.pipe((0,u.T)(e=>e.sort((n,i)=>n.title.localeCompare(i.title)))),this.serverUrlBackup="",this.syncs=this.syncService.cacheUpdated.pipe((0,h.n)(()=>this.sdk.currentKb),(0,h.n)(e=>this.syncService.getSyncsForKB(e.id))),this.syncTableHeader=[new l.A3f({id:"name",label:"sync.home-page.sync-list.table-columns.name"}),new l.A3f({id:"connector",label:"sync.home-page.sync-list.table-columns.connector"}),new l.A3f({id:"resources",label:"sync.home-page.sync-list.table-columns.resources"}),new l.A3f({id:"sync",label:"sync.home-page.sync-list.table-columns.sync"}),new l.A3f({id:"latest-sync",label:"sync.home-page.sync-list.table-columns.latest-sync",sortable:!0}),new l.A3f({id:"actions",label:"sync.home-page.sync-list.table-columns.actions"})]}get syncAgentOnServer(){return"server"===this.syncAgentForm.controls.type.value}get syncAgentTypeControl(){return this.syncAgentForm.controls.type}get syncServerUrl(){return this.syncAgentForm.controls.serverUrl.value}get serverUrlChanged(){return this.serverUrlBackup!==this.syncServerUrl}ngOnInit(){this.syncService.syncServer.pipe((0,_.s)(1)).subscribe(e=>{this.syncAgentForm.patchValue(e),this.serverUrlBackup=e.serverUrl}),this.syncAgentTypeControl.valueChanges.pipe((0,$.Q)(this.unsubscribeAll)).subscribe(()=>this.saveSyncServer())}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}saveSyncServer(){if(this.syncAgentForm.valid){const e=this.syncAgentForm.getRawValue();this.syncService.setSyncServer("server"===e.type?e.serverUrl:W,e.type)}}onSelectConnector(e){this.router.navigate(["./add",e.id],{relativeTo:this.currentRoute})}deleteSync(e){this.modalService.openConfirm({title:this.translate.instant("sync.confirm.deletion.title",{title:e.title}),description:"sync.confirm.deletion.description",isDestructive:!0,confirmLabel:"generic.delete"}).onClose.pipe((0,f.p)(n=>!!n),(0,h.n)(()=>this.syncService.deleteSync(e.id))).subscribe({error:()=>this.toaster.error("sync.details.toast.deletion-failed")})}toggleSync(e,n){this.syncService.updateSync(e,{disabled:!n}).subscribe({error:()=>this.toaster.error(n?"sync.details.toast.activating-failed":"sync.details.toast.disabling-failed")})}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["ng-component"]],decls:56,vars:44,consts:[["syncMenu",""],[1,"page-spacing"],[1,"page-title"],[1,"page-description"],[1,"section-description"],[1,"title-l"],[1,"setup-sync-agent",3,"ngSubmit","formGroup"],["formControlName","type"],[1,"radio-config-row"],["value","desktop",3,"help"],[1,"title-m"],[1,"separator-line"],["value","server",3,"help"],[1,"inline-form"],[1,"connector-list"],[3,"paTooltip","disabled","title","logo"],["kind","success"],["aspect","basic"],["formControlName","serverUrl",1,"server-url"],["type","submit",3,"disabled"],[3,"selectConnector","paTooltip","disabled","title","logo"],["icon","info"],["border","","columns","repeat(5, 1fr) 96px"],[3,"cells"],[1,"body-m","black-link",3,"routerLink"],[1,"logo-title"],[1,"body-s"],["labelOnRight","",3,"valueChange","value"],[3,"datetime"],["icon","more-vertical","aspect","basic","size","small",3,"paPopup"],[3,"routerLink"],[3,"routerLink","queryParams"],["destructive","",3,"selectOption"],["size","small",3,"path"]],template:function(n,i){if(1&n&&(t.j41(0,"div",1)(1,"div")(2,"h1",2),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"p",3),t.EFF(6),t.nI1(7,"translate"),t.k0s()(),t.j41(8,"section")(9,"div",4)(10,"div",5),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.j41(13,"div",3),t.EFF(14),t.nI1(15,"translate"),t.k0s()(),t.j41(16,"form",6),t.bIt("ngSubmit",function(){return i.saveSyncServer()}),t.j41(17,"pa-radio-group",7)(18,"div",8)(19,"pa-radio",9),t.nI1(20,"translate"),t.j41(21,"span",10),t.EFF(22),t.nI1(23,"translate"),t.k0s()(),t.nVh(24,At,3,3),t.k0s(),t.nrm(25,"div",11),t.j41(26,"div",8)(27,"pa-radio",12),t.nI1(28,"translate"),t.j41(29,"span",10),t.EFF(30),t.nI1(31,"translate"),t.k0s()(),t.nVh(32,Ut,9,7,"div",13),t.k0s()()()(),t.nrm(33,"div",11),t.j41(34,"section")(35,"div",4)(36,"div",5),t.EFF(37),t.nI1(38,"translate"),t.k0s(),t.j41(39,"div",3),t.EFF(40),t.nI1(41,"translate"),t.k0s()(),t.j41(42,"div",14),t.Z7z(43,Yt,4,10,"nsy-connector",15,ot),t.nI1(45,"async"),t.k0s()(),t.j41(46,"section")(47,"div",4)(48,"div",5),t.EFF(49),t.nI1(50,"translate"),t.k0s(),t.j41(51,"div",3),t.EFF(52),t.nI1(53,"translate"),t.k0s()(),t.nVh(54,Zt,2,1),t.nI1(55,"async"),t.k0s()()),2&n){let a;t.R7$(3),t.JRh(t.bMT(4,16,"navbar.sync")),t.R7$(3),t.JRh(t.bMT(7,18,"sync.home-page.description")),t.R7$(5),t.JRh(t.bMT(12,20,"sync.home-page.setup-server.title")),t.R7$(3),t.JRh(t.bMT(15,22,"sync.home-page.setup-server.description")),t.R7$(2),t.Y8G("formGroup",i.syncAgentForm),t.R7$(3),t.Y8G("help",t.bMT(20,24,"sync.home-page.setup-server.on-desktop.radio-help")),t.R7$(3),t.JRh(t.bMT(23,26,"sync.home-page.setup-server.on-desktop.radio-label")),t.R7$(2),t.vxM(i.syncAgentOnServer?-1:24),t.R7$(3),t.Y8G("help",t.bMT(28,28,"sync.home-page.setup-server.on-server.radio-help")),t.R7$(3),t.JRh(t.bMT(31,30,"sync.home-page.setup-server.on-server.radio-label")),t.R7$(2),t.vxM(i.syncAgentOnServer?32:-1),t.R7$(5),t.JRh(t.bMT(38,32,"sync.home-page.add-sources.title")),t.R7$(3),t.JRh(t.bMT(41,34,"sync.home-page.add-sources.description")),t.R7$(3),t.Dyx(t.bMT(45,36,i.connectorList)),t.R7$(6),t.JRh(t.bMT(50,38,"sync.home-page.sync-list.title")),t.R7$(3),t.JRh(t.bMT(53,40,"sync.home-page.sync-list.description")),t.R7$(2),t.vxM((a=t.bMT(55,42,i.syncs))?54:-1,a)}},dependencies:[v.MD,v.Jj,m.nS,Mt,m.vY,l.Ymm,w.Q,l.Rx2,kt.P,Z.P,l.XgI,N.S,l.rkm,B.a,$t.v,Pt.u,l.tml,jt.d,d.X1,d.qT,d.BC,d.cb,d.j4,d.JD,y.h,y.D9,l.EGN,q.O,tt.e,et.U,Et.N,wt.V,K.Wk,l.V3x,E.R,l.Pa6,nt.Z,m.IA,l.OgD,Gt.w],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}section[_ngcontent-%COMP%] .section-description[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%]{border:1px solid var(--color-neutral-lighter, hsl(207, 17%, 91%));border-radius:.5rem;padding:1.5rem}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .radio-config-row[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem;justify-content:space-between}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .radio-config-row[_ngcontent-%COMP%] pa-radio[_ngcontent-%COMP%]{flex:1 0 auto}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .inline-form[_ngcontent-%COMP%]{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] pa-input.server-url[_ngcontent-%COMP%] .pa-field-control{width:20rem}@media (min-width: 1440px){section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] pa-input.server-url[_ngcontent-%COMP%] .pa-field-control{width:26.5rem}}section[_ngcontent-%COMP%] .separator-line[_ngcontent-%COMP%]{margin:1.5rem 0}section[_ngcontent-%COMP%] .connector-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem}section[_ngcontent-%COMP%] .logo-title[_ngcontent-%COMP%]{font-size:.75rem;line-height:1.25rem;letter-spacing:0;font-weight:400;align-items:center;display:flex;gap:.5rem}section[_ngcontent-%COMP%] pa-table-cell[_ngcontent-%COMP%] pa-toggle[_ngcontent-%COMP%] .pa-toggle-context{gap:.5rem}section[_ngcontent-%COMP%] pa-table-sortable-header[_ngcontent-%COMP%] .pa-table-grid--header{z-index:1}'],changeDetection:0})}return o})();var te=c(3129),ee=c(2193),ne=c(1963),oe=c(6851),ie=c(2071),re=c(5814),se=c(9285),it=c(6420);const ae=()=>[],rt=(o,r)=>r.id,ce=(o,r)=>r.value;function le(o,r){if(1&o&&(t.j41(0,"pa-input",30),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("formControlName",e.id)("placeholder",e.placeholder)("help",e.help),t.R7$(),t.SpI(" ",t.bMT(2,4,e.label)," ")}}function de(o,r){if(1&o&&(t.j41(0,"pa-toggle",31),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("formControlName",e.id)("help",e.help),t.R7$(),t.SpI(" ",t.bMT(2,3,e.label)," ")}}function pe(o,r){if(1&o&&(t.j41(0,"pa-option",34),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=r.$implicit;t.Y8G("disabled",e.disabled)("value",e.value),t.R7$(),t.SpI(" ",t.bMT(2,3,e.label)," ")}}function he(o,r){if(1&o&&(t.j41(0,"pa-select",32),t.Z7z(1,pe,3,5,"pa-option",34,ce),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("formControlName",e.id)("label",e.label)("help",e.help),t.R7$(),t.Dyx(e.options)}}function ue(o,r){if(1&o&&(t.j41(0,"pa-textarea",31),t.EFF(1),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("formControlName",e.id)("help",e.help),t.R7$(),t.SpI(" ",e.label," ")}}function me(o,r){if(1&o&&(t.j41(0,"p"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=t.XpG(2).$implicit;t.R7$(),t.JRh(t.bMT(2,1,e.help))}}function ge(o,r){1&o&&(t.j41(0,"nsi-info-card",36),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"sync.form-validation.extra-parameters-incomplete")," "))}function ye(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",33)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,me,3,3,"p"),t.j41(5,"app-parameters-table",35),t.bIt("valuesChange",function(i){s.eBV(e);const a=t.XpG().$implicit,p=t.XpG(3);return s.Njj(p.updateTable(a.id,i))}),t.k0s(),t.nVh(6,ge,3,3,"nsi-info-card",36),t.k0s()}if(2&o){const e=t.XpG().$implicit,n=t.XpG(3);t.R7$(2),t.JRh(t.bMT(3,4,e.label)),t.R7$(2),t.vxM(e.help?4:-1),t.R7$(),t.Y8G("values",n.tables[e.id]||t.lJ4(6,ae)),t.R7$(),t.vxM(n.invalidTables.includes(e.id)?6:-1)}}function fe(o,r){if(1&o&&t.nVh(0,le,3,6,"pa-input",30)(1,de,3,5,"pa-toggle",31)(2,he,3,3,"pa-select",32)(3,ue,2,3,"pa-textarea",31)(4,ye,7,7,"div",33),2&o){let e;t.vxM("text"===(e=r.$implicit.type)?0:"boolean"===e?1:"select"===e?2:"textarea"===e?3:"table"===e?4:-1)}}function _e(o,r){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",5)(1,"div",2),t.Z7z(2,fe,5,1,null,null,rt),t.k0s()()),2&o){const e=r.$implicit;t.Y8G("badge",e.badge)("itemTitle",e.title)("description",e.description||""),t.R7$(2),t.Dyx(e.fields)}}function be(o,r){1&o&&(t.j41(0,"nsi-two-columns-configuration-item",9)(1,"div",7)(2,"pa-toggle",37),t.EFF(3),t.nI1(4,"translate"),t.k0s()()()),2&o&&(t.R7$(3),t.SpI(" ",t.bMT(4,1,"sync.add-page.security-group.toggle-label")," "))}function Ce(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsi-label",38),t.bIt("removeLabel",function(){const i=s.eBV(e).$implicit,a=t.XpG(2);return s.Njj(a.removeLabel(i))}),t.EFF(1),t.k0s()}if(2&o){const e=r.$implicit;t.Y8G("color",e.color),t.R7$(),t.SpI(" ",e.label," ")}}function ve(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsi-label",39),t.bIt("removeLabel",function(){const i=s.eBV(e).$implicit,a=t.XpG(2);return s.Njj(a.removeExtension(i))}),t.EFF(1),t.k0s()}if(2&o){const e=r.$implicit;t.R7$(),t.SpI(" ",e," ")}}function Se(o,r){if(1&o){const e=t.RV6();t.j41(0,"form",0)(1,"nsi-two-columns-configuration-item",1)(2,"div",2)(3,"pa-input",3),t.EFF(4),t.nI1(5,"translate"),t.k0s()()(),t.qex(6,4),t.Z7z(7,_e,4,3,"nsi-two-columns-configuration-item",5,rt),t.nI1(9,"async"),t.bVm(),t.j41(10,"nsi-two-columns-configuration-item",6)(11,"div",7)(12,"app-extraction-select",8),t.bIt("extractConfigChange",function(i){s.eBV(e);const a=t.XpG();return s.Njj(a.updateExtractStrategy(i))}),t.k0s()()(),t.nVh(13,be,5,3,"nsi-two-columns-configuration-item",9),t.j41(14,"nsi-two-columns-configuration-item",10)(15,"div",2)(16,"div",11)(17,"app-label-dropdown",12),t.nI1(18,"async"),t.nI1(19,"async"),t.bIt("selectionChange",function(i){s.eBV(e);const a=t.XpG();return s.Njj(a.updateLabelSelection(i))}),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.j41(22,"span",13),t.EFF(23),t.nI1(24,"translate"),t.k0s(),t.j41(25,"pa-button",14),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.createLabelSet())}),t.EFF(26),t.nI1(27,"translate"),t.k0s()(),t.j41(28,"div",15),t.Z7z(29,Ce,2,2,"nsi-label",16,t.fX1),t.k0s()(),t.j41(31,"div",17)(32,"pa-toggle",18),t.EFF(33),t.nI1(34,"translate"),t.k0s()()(),t.j41(35,"nsi-two-columns-configuration-item",19)(36,"div",2)(37,"nsi-info-card"),t.EFF(38),t.nI1(39,"translate"),t.k0s(),t.j41(40,"div",20)(41,"div",21)(42,"pa-select",22)(43,"pa-option",23),t.EFF(44),t.nI1(45,"translate"),t.k0s(),t.j41(46,"pa-option",24),t.EFF(47),t.nI1(48,"translate"),t.k0s()(),t.j41(49,"pa-input",25),t.EFF(50),t.nI1(51,"translate"),t.k0s()(),t.j41(52,"div",15),t.Z7z(53,ve,2,1,"nsi-label",26,t.fX1),t.k0s(),t.j41(55,"div",27)(56,"label"),t.EFF(57),t.nI1(58,"translate"),t.k0s(),t.j41(59,"div",21),t.nrm(60,"pa-date-picker",28),t.nI1(61,"translate"),t.nrm(62,"pa-date-picker",29),t.nI1(63,"translate"),t.k0s()()()()()()}if(2&o){const e=t.XpG();t.Y8G("formGroup",e.form),t.R7$(),t.Y8G("noTopBorder",e.noTopBorder),t.R7$(3),t.JRh(t.bMT(5,20,"sync.add-page.connector-name.field-label")),t.R7$(3),t.Dyx(t.bMT(9,22,e.connector.getParametersSections())),t.R7$(5),t.Y8G("onlyExtract",!0)("extractConfig",e.extractStrategy),t.R7$(),t.vxM(e.connector.canSyncSecurityGroups?13:-1),t.R7$(4),t.Y8G("labelSets",t.bMT(18,24,e.labelSets))("selection",e.labelSelection)("disabled",!1===t.bMT(19,26,e.hasLabelSet)),t.R7$(3),t.SpI(" ",t.bMT(21,28,"sync.add-page.add-labels.select-labels")," "),t.R7$(3),t.JRh(t.bMT(24,30,"generic.or")),t.R7$(3),t.SpI(" ",t.bMT(27,32,"sync.add-page.add-labels.create-labelset")," "),t.R7$(3),t.Dyx(e.labelSelection),t.R7$(4),t.SpI(" ",t.bMT(34,34,"sync.add-page.preserve-labels.toggle-label")," "),t.R7$(5),t.JRh(t.bMT(39,36,"sync.add-page.filter-resources.file-extension.info")),t.R7$(6),t.SpI(" ",t.bMT(45,38,"sync.add-page.filter-resources.file-extension.include")," "),t.R7$(3),t.SpI(" ",t.bMT(48,40,"sync.add-page.filter-resources.file-extension.exclude")," "),t.R7$(3),t.SpI(" ",t.bMT(51,42,"sync.add-page.filter-resources.file-extension.label")," "),t.R7$(3),t.Dyx(e.extensionList),t.R7$(4),t.JRh(t.bMT(58,44,"sync.add-page.filter-resources.modification-date.label")),t.R7$(3),t.Y8G("label",t.bMT(61,46,"sync.add-page.filter-resources.modification-date.from")),t.R7$(2),t.Y8G("label",t.bMT(63,48,"sync.add-page.filter-resources.modification-date.to"))}}const xe=new RegExp(/[^a-z0-9_-]/g);let st=(()=>{class o{constructor(){this.labelService=(0,s.WQX)(C.xQ),this.modalService=(0,s.WQX)(m.w8),this.cdr=(0,s.WQX)(R.gRc),this.unsubscribeAll=new k.B,this.noTopBorder=!1,this.validForm=new t.bkB,this.configurationChange=new t.bkB,this.form=new d.gE({name:new d.MJ("",{nonNullable:!0,validators:[d.k0.required]}),syncSecurityGroups:new d.MJ(null),preserveLabels:new d.MJ(null),filterResources:new d.gE({extensions:new d.MJ("",{updateOn:"blur"}),extensionUsage:new d.MJ("include",{nonNullable:!0}),from:new d.MJ(""),to:new d.MJ("")}),extra:new d.gE({})}),this.labelSets=this.labelService.resourceLabelSets,this.hasLabelSet=this.labelService.hasResourceLabelSets,this.labelSelection=[],this.extensionList=[],this.tables={},this.invalidTables=[],this.extractStrategy="",this._extra={}}set sync(e){if(e){this.connectorParametersBackup=e.connector.parameters;const n={extensions:e.filters?.fileExtensions?.extensions||"",extensionUsage:e.filters?.fileExtensions?.exclude?"exclude":"include",from:e.filters?.modified?.from||"",to:e.filters?.modified?.to||""};this.form.patchValue({name:e.title,syncSecurityGroups:e.syncSecurityGroups,filterResources:n,preserveLabels:e.preserveLabels}),this.labelSelection=e.labels||[],this.extensionList=this.formatExtensionList(n.extensions),e.extract_strategy&&(this.extractStrategy=e.extract_strategy),e.connector.parameters&&Object.entries(e.connector.parameters).forEach(([i,a])=>{"object"!=typeof a?this._extra[i]=a:this.tables[i]=a})}}get extensionsControl(){return this.form.controls.filterResources.controls.extensions}ngOnInit(){this.connector&&this.connector.getParametersSections().subscribe(e=>{e.forEach(n=>n.fields.forEach(i=>{"table"!==i.type&&this.form.controls.extra.addControl(i.id,new d.MJ("",{nonNullable:!0,validators:i.required?[d.k0.required]:[]}))})),Object.keys(this._extra).length>0&&this.form.patchValue({extra:this._extra})}),this.extensionsControl.valueChanges.pipe((0,$.Q)(this.unsubscribeAll)).subscribe(e=>this.extensionList=this.formatExtensionList(e)),this.form.valueChanges.pipe((0,$.Q)(this.unsubscribeAll)).subscribe(()=>{this.validForm.emit(this.form.valid),this.emitSyncEntity()})}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}updateTable(e,n){this.tables[e]=n,n.some(i=>!(i.value.trim()&&i.key.trim()||!i.value.trim()&&!i.key.trim()))?this.invalidTables.includes(e)||this.invalidTables.push(e):this.invalidTables.includes(e)&&(this.invalidTables=this.invalidTables.filter(i=>i!==e)),this.cdr.markForCheck(),this.emitSyncEntity()}createLabelSet(){this.modalService.openModal(C.Tv,new l.S6u({data:{kind:ee.po.RESOURCES}}))}updateLabelSelection(e){this.labelSets.pipe((0,_.s)(1),(0,f.p)(n=>!!n),(0,u.T)(n=>n)).subscribe(n=>{this.labelSelection=e.map(i=>({...i,color:n[i.labelset]?.color})),this.emitSyncEntity()})}removeExtension(e){const n=this.extensionList.filter(i=>i!==e);this.extensionsControl.patchValue(n.join(", "))}removeLabel(e){this.labelSelection=this.labelSelection.filter(n=>!(n.labelset===e.labelset&&n.label===e.label)),this.emitSyncEntity()}formatExtensionList(e){return e&&e.length>0?e.split(",").map(n=>n.trim()).filter(n=>!!n):[]}emitSyncEntity(){if(!this.connectorId)return;const e=this.form.getRawValue(),n=e.name,i=(Math.random()+1).toString(36).substring(7),a=`${this.kbId}-${n?.toLowerCase().replace(xe,"-")}-${i}`,p={fileExtensions:e.filterResources.extensions?{extensions:e.filterResources.extensions,exclude:"exclude"===e.filterResources.extensionUsage}:void 0,modified:e.filterResources.from||e.filterResources.to?{from:e.filterResources.from||void 0,to:e.filterResources.to||void 0}:void 0},F=Object.entries(e.extra||{}).reduce((G,[O,Y])=>({...G,[O]:Y}),{}),I=Object.entries(this.tables).reduce((G,[O,Y])=>(G[O]=Y.filter(pt=>!(!pt.key.trim()||!pt.value.trim())),G),{}),M={id:a,title:n,labels:this.labelSelection,preserveLabels:e.preserveLabels||!1,filters:p,connector:{name:this.connectorId,parameters:{...this.connectorParametersBackup,...I,...F}}};null!==e.syncSecurityGroups&&(M.syncSecurityGroups=e.syncSecurityGroups),M.extract_strategy=this.extractStrategy,this.configurationChange.emit(M)}updateExtractStrategy(e){this.extractStrategy=e,this.validForm.emit(this.form.valid),this.emitSyncEntity()}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-configuration-form"]],inputs:{connector:"connector",connectorId:"connectorId",kbId:"kbId",sync:"sync",noTopBorder:[2,"noTopBorder","noTopBorder",R.L39]},outputs:{validForm:"validForm",configurationChange:"configurationChange"},decls:1,vars:1,consts:[[3,"formGroup"],["itemTitle","sync.add-page.connector-name.title","description","sync.add-page.connector-name.description",3,"noTopBorder"],[1,"form-container"],["formControlName","name"],["formGroupName","extra"],[3,"badge","itemTitle","description"],["itemTitle","sync.add-page.extract-config.title","description","sync.add-page.extract-config.description","badge","generic.badge.advanced"],[1,"form-container","toggle-container"],[3,"extractConfigChange","onlyExtract","extractConfig"],["itemTitle","sync.add-page.security-group.title","description","sync.add-page.security-group.description","badge","generic.badge.advanced"],["badge","generic.badge.optional","itemTitle","sync.add-page.add-labels.title","description","sync.add-page.add-labels.description"],[1,"inline-form","full-width"],["displayRadioForNonMultiple","","aspect","basic","fullWidth","",3,"selectionChange","labelSets","selection","disabled"],[1,"separator-word","body-s"],["icon","circle-plus","aspect","basic","iconAndText","",1,"full-width",3,"click"],[1,"inline-form","small-gap"],[3,"color"],[1,"toggle-container"],["formControlName","preserveLabels"],["badge","generic.badge.optional","itemTitle","sync.add-page.filter-resources.title","description","sync.add-page.filter-resources.description"],["formGroupName","filterResources",1,"form-container"],[1,"inline-form","full-width","small-gap"],["formControlName","extensionUsage"],["value","include"],["value","exclude"],["id","extension","placeholder",".pdf,.docx","formControlName","extensions"],["neutral",""],[1,"label-field-container"],["formControlName","from",3,"label"],["formControlName","to",3,"label"],[3,"formControlName","placeholder","help"],[3,"formControlName","help"],[3,"formControlName","label","help"],[1,"table-container"],[3,"disabled","value"],[3,"valuesChange","values"],["type","warning","icon","warning"],["withBackground","","formControlName","syncSecurityGroups"],[3,"removeLabel","color"],["neutral","",3,"removeLabel"]],template:function(n,i){1&n&&t.nVh(0,Se,64,50,"form",0),2&n&&t.vxM(i.connector?0:-1)},dependencies:[v.MD,v.Jj,m.IA,m._8,d.X1,d.qT,d.BC,d.cb,d.j4,d.JD,d.$R,l.XgI,N.S,oe.w,ie.Q,Z.P,C.Qy,C.Bo,re.L,l.Ymm,w.Q,y.h,y.D9,l.OYn,se.I,m.OE,it.U,l.rkm,B.a,ne.RxD],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.toggle-container[_ngcontent-%COMP%] pa-toggle[_ngcontent-%COMP%] .pa-toggle-context{justify-content:space-between}.table-container[_ngcontent-%COMP%] nsi-info-card[_ngcontent-%COMP%]{margin-top:.75rem}'],changeDetection:0})}return o})();var Te=c(1943),at=c(7670);const Fe=o=>({total:o}),Ie=o=>({count:o});function Re(o,r){1&o&&t.nrm(0,"nsi-spinner")}function Me(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsi-folder-tree",3),t.bIt("selectionChange",function(i){s.eBV(e);const a=t.XpG(2);return s.Njj(a.updateSelection(i))}),t.k0s()}if(2&o){const e=t.XpG(2);t.Y8G("selection",e.selection)("folderTree",e.folders)}}function ke(o,r){if(1&o&&t.nrm(0,"nsi-folder-list",2),2&o){const e=t.XpG(2);t.Y8G("folders",e.selectedPaths)}}function $e(o,r){if(1&o&&t.nVh(0,Me,1,2,"nsi-folder-tree",1)(1,ke,1,1,"nsi-folder-list",2),2&o){const e=t.XpG();t.vxM(e.seeAll?0:1)}}let U=(()=>{class o{constructor(){this.syncService=(0,s.WQX)(j),this.toaster=(0,s.WQX)(m._g),this.cdr=(0,s.WQX)(R.gRc),this.selectedSyncItems=new t.bkB,this.searchQuery=new d.MJ("",{nonNullable:!0}),this.totalFolders=0,this.selectionCount=0,this.loading=!1,this.seeAll=!0,this.selection=[],this.selectedPaths=[],this.syncItems=[],this.selectedIds=[]}ngOnInit(){this.updateSelection((this.sync.foldersToSync||[]).map(e=>({id:e.uuid,path:e.metadata.path}))),this.loadFolders()}updateView(e){this.seeAll="left"===e}updateSelection(e){this.selection=e,this.selectedPaths=e.map(n=>n.path),this.selectedIds=e.map(n=>n.id),this.selectionCount=e.length,this.selectedSyncItems.emit(this.syncItems.filter(n=>this.selectedIds.includes(n.uuid))),this.cdr.markForCheck()}loadFolders(e){this.loading=!0,this.syncService.getFolders(e?.value||"").pipe((0,V.W)(n=>(n&&this.toaster.error("string"==typeof n?n:n.error?.message||n.error||n.message||"An error occurred"),(0,g.of)({items:[],nextPage:void 0}))),(0,Te.S)((n,i)=>n.concat(i.items),[]),(0,u.T)(n=>[{uuid:"root",originalId:"/",title:"/",status:P.PENDING,metadata:{path:"/"}},...n]),(0,u.T)(n=>n.sort((i,a)=>i.metadata.path.localeCompare(a.metadata.path))),(0,b.M)(n=>{this.totalFolders=n.length,this.syncItems=n}),(0,u.T)(n=>this.getFolderTreeFromSyncItems(n))).subscribe({next:n=>{this.loading=!1,this.folders=n,this.cdr.markForCheck()}})}getFolderTreeFromSyncItems(e){const n={id:"root",path:"/",title:"/",expanded:!0,children:{}};return e.filter(i=>"root"!==i.uuid).forEach(i=>{const a=i.metadata.path,p=i.originalId,F={id:p,title:i.title,path:a,displayPath:i.metadata.displayPath||a,children:{}};if("/"===a)n.children[p]=F;else{let M,I=n;a.split("/").slice(1,-1).forEach(O=>{I&&(M=I.children?.[O],M&&(I=M))}),I.children?I.children[p]=F:I.children={[p]:F}}}),n}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-folder-selection"]],inputs:{sync:"sync"},outputs:{selectedSyncItems:"selectedSyncItems"},decls:7,vars:14,consts:[[3,"activeChange","leftButton","rightButton"],[3,"selection","folderTree"],[3,"folders"],[3,"selectionChange","selection","folderTree"]],template:function(n,i){1&n&&(t.j41(0,"header"),t.nrm(1,"div"),t.j41(2,"nsi-segmented-buttons",0),t.nI1(3,"translate"),t.nI1(4,"translate"),t.bIt("activeChange",function(p){return i.updateView(p)}),t.k0s()(),t.nVh(5,Re,1,0,"nsi-spinner"),t.nVh(6,$e,2,1)),2&n&&(t.R7$(2),t.Y8G("leftButton",t.i5U(3,4,"sync.folder-selection.see-all",t.eq3(10,Fe,i.totalFolders)))("rightButton",t.i5U(4,7,"sync.folder-selection.see-selection",t.eq3(12,Ie,i.selectionCount))),t.R7$(3),t.vxM(i.loading?5:-1),t.R7$(),t.vxM(i.folders?6:-1))},dependencies:[m.Sq,m.sH,l.Ymm,l.XgI,d.X1,m.vI,m.J4,at.t,y.h,y.D9],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}header[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{width:30rem}'],changeDetection:0})}return o})();const Pe=o=>({connector:o}),je=(o,r)=>({index:o,total:r});function Ee(o,r){if(1&o&&(t.j41(0,"div")(1,"h1",2),t.nrm(2,"pa-icon",3),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"p",4),t.EFF(6),t.nI1(7,"translate"),t.k0s()()),2&o){const e=r,n=t.XpG();t.R7$(2),t.Y8G("path",e.logo),t.R7$(),t.SpI(" ",t.i5U(4,3,"sync.add-page.title",t.eq3(8,Pe,e.title))," "),t.R7$(3),t.JRh(t.bMT(7,6,"sync.add-page.description."+n))}}function we(o,r){if(1&o&&(t.nVh(0,Ee,8,10,"div"),t.nI1(1,"async")),2&o){let e;const n=t.XpG();t.vxM((e=t.bMT(1,1,n.connectorDefinition))?0:-1,e)}}function Ge(o,r){1&o&&t.nrm(0,"nsi-spinner")}function Oe(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-configuration-form",6),t.nI1(1,"async"),t.nI1(2,"async"),t.bIt("configurationChange",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.updateConfiguration(i))})("validForm",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.validForm=i)}),t.k0s()}if(2&o){const e=t.XpG(2),n=t.XpG();t.Y8G("sync",n.sync)("kbId",t.bMT(1,4,n.kbId))("connector",e)("connectorId",t.bMT(2,6,n.connectorId))}}function Ve(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-folder-selection",8),t.bIt("selectedSyncItems",function(i){s.eBV(e);const a=t.XpG(4);return s.Njj(a.updateSelection(i))}),t.k0s()}if(2&o){const e=t.XpG(4);t.Y8G("sync",e.sync)}}function Xe(o,r){if(1&o&&t.nVh(0,Ve,1,1,"nsy-folder-selection",7),2&o){const e=t.XpG(3);t.vxM(e.sync?0:-1)}}function De(o,r){if(1&o&&(t.EFF(0),t.nI1(1,"translate")),2&o){const e=t.XpG(),n=t.XpG(3);t.SpI(" ",t.i5U(1,1,"sync.add-page.footer.steps",t.l_i(4,je,n.step(),e.length))," ")}}function Ae(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-button",12),t.bIt("click",function(){s.eBV(e);const i=t.XpG(4);return s.Njj(i.cancel())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"generic.cancel")," "))}function Ne(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-button",12),t.bIt("click",function(){s.eBV(e);const i=t.XpG(4);return s.Njj(i.goBack())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"generic.back")," "))}function Be(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-button",13),t.bIt("click",function(){s.eBV(e);const i=t.XpG(4);return s.Njj(i.goNext())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const e=t.XpG(4);t.Y8G("disabled",!e.validForm||e.saving),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.add-page.footer.folder-selection-button")," ")}}function Ue(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-button",13),t.bIt("click",function(){s.eBV(e);const i=t.XpG(4);return s.Njj(i.save())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const e=t.XpG(3),n=t.XpG();t.Y8G("disabled",!n.validForm||e.allowToSelectFolders&&0===n.folderSelection.length||n.saving),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.add-page.footer.save-button")," ")}}function Ye(o,r){if(1&o&&(t.j41(0,"nsi-sticky-footer")(1,"div",9),t.nVh(2,De,2,7),t.k0s(),t.nVh(3,Ae,3,3,"pa-button",10)(4,Ne,3,3,"pa-button",10),t.nVh(5,Be,3,4,"pa-button",11)(6,Ue,3,4,"pa-button",11),t.k0s()),2&o){const e=r,n=t.XpG(3);t.R7$(2),t.vxM(e.length>1?2:-1),t.R7$(),t.vxM(1===n.step()?3:4),t.R7$(2),t.vxM(e.length>1&&n.step()<e.length?5:6)}}function Le(o,r){if(1&o&&(t.nVh(0,Oe,3,8,"nsy-configuration-form",5)(1,Xe,1,1),t.nVh(2,Ye,7,3,"nsi-sticky-footer"),t.nI1(3,"async")),2&o){let e,n;const i=t.XpG(2);t.vxM(1===(e=i.step())?0:2===e?1:-1),t.R7$(2),t.vxM((n=t.bMT(3,2,i.steps))?2:-1,n)}}function Je(o,r){if(1&o&&(t.j41(0,"div"),t.nVh(1,Ge,1,0,"nsi-spinner")(2,Le,4,4),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.vxM(e.loading?1:2)}}let ct=(()=>{class o{constructor(){this.router=(0,s.WQX)(S.Ix),this.currentRoute=(0,s.WQX)(S.nX),this.sdk=(0,s.WQX)(C.ok),this.syncService=(0,s.WQX)(j),this.modalService=(0,s.WQX)(m.w8),this.translate=(0,s.WQX)(y.c$),this.toaster=(0,s.WQX)(m._g),this.cdr=(0,s.WQX)(R.gRc),this.connectorId=this.currentRoute.params.pipe((0,f.p)(e=>e.connector),(0,u.T)(e=>e.connector)),this.connectorDefinition=this.connectorId.pipe((0,u.T)(e=>this.syncService.getConnectorDefinition(e))),this.connector=this.connectorId.pipe((0,u.T)(e=>this.syncService.getConnector(e,""))),this.kbId=this.sdk.currentKb.pipe((0,u.T)(e=>e.id)),this.steps=this.connector.pipe((0,u.T)(e=>e.allowToSelectFolders?["configuration","folder-selection"]:["configuration"])),this.stepIndex=(0,s.vPA)(0),this.step=(0,te.EW)(()=>this.stepIndex()+1),this.validForm=!1,this.folderSelection=[],this.loading=!1,this.saving=!1}get backPath(){return this.syncId?"../../..":"../.."}ngOnInit(){this.currentRoute.params.pipe((0,f.p)(e=>!!e.syncId),(0,_.s)(1),(0,b.M)(e=>{this.loading=!0,this.cdr.markForCheck(),this.syncId=e.syncId,this.syncService.setCurrentSyncId(this.syncId),this.validForm=!0}),(0,h.n)(()=>this.syncService.getSync(this.syncId)),(0,b.M)(e=>{this.sync=e,this.configuration=e,this.cdr.markForCheck()}),(0,h.n)(e=>this.syncService.hasCurrentSourceAuth().pipe((0,b.M)(n=>{n&&(this.loading=!1,this.cdr.markForCheck())}),(0,f.p)(n=>!n),(0,u.T)(()=>this.syncService.getConnector(e.connector.name,e.id)),(0,h.n)(n=>this.syncService.authenticateToConnector(e.connector.name,n))))).subscribe({next:()=>{this._goNext(),this.loading=!1,this.cdr.markForCheck(),this.router.navigate([],{queryParams:{}})},error:()=>this.toaster.error("sync.details.authentication.fail")})}goBack(){this.stepIndex()>0&&this.stepIndex.update(e=>e-1)}goNext(){if(!this.configuration)return;const e=this.configuration;this.syncId?this._goNext():this.connectorDefinition.pipe((0,_.s)(1),(0,h.n)(n=>this.modalService.openConfirm({title:this.translate.instant("sync.add-page.confirm-authenticate.title",{connector:n.title}),description:this.translate.instant("sync.add-page.confirm-authenticate.description"),confirmLabel:this.translate.instant("sync.add-page.confirm-authenticate.confirm-button")}).onClose),(0,f.p)(n=>!!n),(0,h.n)(()=>this._createSync(e)),(0,h.n)(n=>this._onSuccessfulCreation(n,e))).subscribe({error:n=>{console.warn(n),this.toaster.error("sync.add-page.toast.generic-error")}})}cancel(){this.syncId?this.modalService.openConfirm({title:"sync.confirm.cancel-oauth.title",description:"sync.confirm.cancel-oauth.description",isDestructive:!0,confirmLabel:"sync.confirm.cancel-oauth.confirm-label",cancelLabel:"sync.confirm.cancel-oauth.cancel-label"}).onClose.pipe((0,f.p)(e=>!!e),(0,h.n)(()=>this.syncService.deleteSync(this.syncId))).subscribe({next:()=>this.router.navigate([this.backPath],{relativeTo:this.currentRoute})}):this.router.navigate([this.backPath],{relativeTo:this.currentRoute})}save(){if(!this.configuration)return;this.saving=!0;const e=this.configuration;if(this.syncId){if(this.folderSelection.length>0){const n=this.syncId;this.syncService.updateSync(n,{foldersToSync:this.folderSelection},!0).pipe((0,h.n)(()=>this._syncCreationDone(n))).subscribe({error:i=>this._errorHandler(i)})}}else this._createSync(e).pipe((0,h.n)(n=>this._onSuccessfulCreation(n,e))).subscribe({error:n=>this._errorHandler(n)})}updateConfiguration(e){this.configuration=e}updateSelection(e){this.folderSelection=e}_goNext(){this.steps.pipe((0,_.s)(1)).subscribe(e=>{this.stepIndex()<e.length&&this.stepIndex.update(n=>n+1)})}_createSync(e){return this.syncService.addSync(e).pipe((0,b.M)(()=>this.syncService.setCurrentSyncId(e.id)),(0,u.T)(()=>this.syncService.getConnector(e.connector.name,e.id)),(0,h.n)(n=>n.allowToSelectFolders?(0,g.of)(n):("function"==typeof n.handleParameters&&n.handleParameters(e.connector.parameters),this.syncService.updateSync(e.id,{foldersToSync:n.getStaticFolders()}).pipe((0,u.T)(()=>this.syncService.getConnector(e.connector.name,e.id))))))}_onSuccessfulCreation(e,n){if(e.hasServerSideAuth){let i=location.href.split("/sync/add/")[0];return this.sdk.nuclia.options.standalone&&(i=i.replace("#/","")),e.goToOAuth(`${i}/sync/add/${n.connector.name}/${n.id}`,!0),(0,g.of)()}return this._syncCreationDone(n.id)}_syncCreationDone(e){return(0,g.of)(!0).pipe((0,b.M)(()=>{this.router.navigate([this.syncId?`../../../${e}`:`../../${e}`],{relativeTo:this.currentRoute})}),(0,h.n)(()=>(this.toaster.success("sync.details.toast.triggering-sync-success"),this.syncService.triggerSync(e).pipe((0,V.W)(()=>(this.toaster.error("sync.details.toast.triggering-sync-failed"),(0,g.of)()))))))}_errorHandler(e){this.saving=!1,console.warn(e),this.toaster.error("sync.add-page.toast.generic-error")}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-add-sync-page"]],decls:8,vars:10,consts:[[1,"page-spacing"],[3,"link"],[1,"page-title"],["size","large",3,"path"],[1,"page-description"],[3,"sync","kbId","connector","connectorId"],[3,"configurationChange","validForm","sync","kbId","connector","connectorId"],[3,"sync"],[3,"selectedSyncItems","sync"],["footerNote",""],["aspect","basic"],["kind","primary",3,"disabled"],["aspect","basic",3,"click"],["kind","primary",3,"click","disabled"]],template:function(n,i){if(1&n&&(t.j41(0,"div",0)(1,"nsi-back-button",1),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,we,2,3),t.nI1(5,"async"),t.nVh(6,Je,3,1,"div"),t.nI1(7,"async"),t.k0s()),2&n){let a,p;t.R7$(),t.Y8G("link",i.backPath),t.R7$(),t.SpI(" ",t.bMT(3,4,"sync.add-page.back-button")," "),t.R7$(2),t.vxM((a=t.bMT(5,6,i.connectorId))?4:-1,a),t.R7$(2),t.vxM((p=t.bMT(7,8,i.connector))?6:-1,p)}},dependencies:[v.MD,v.Jj,m.Xp,l.Ymm,w.Q,l.V3x,E.R,m.o3,y.h,y.D9,st,U,m.J4,at.t],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}.inline-form[_ngcontent-%COMP%] pa-select[_ngcontent-%COMP%]{flex:0 0 auto;min-width:8rem;width:fit-content}.inline-form[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{max-width:unset}'],changeDetection:0})}return o})();var Qe=c(4572),We=c(2885);const He=["activitySection"],lt=(o,r)=>r.id;function ze(o,r){if(1&o&&(t.j41(0,"div",3)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"div",14),t.EFF(5),t.nI1(6,"translate"),t.k0s()(),t.nrm(7,"div",4)),2&o){const e=t.XpG();t.R7$(2),t.JRh(t.bMT(3,2,"sync.details.settings.synchronize-security-groups")),t.R7$(3),t.SpI(" ",t.bMT(6,4,e.sync.syncSecurityGroups?"sync.details.settings.boolean.true":"sync.details.settings.boolean.false")," ")}}function Ke(o,r){if(1&o&&(t.j41(0,"nsi-label",6),t.EFF(1),t.k0s()),2&o){const e=r.$implicit;t.Y8G("color",e.color),t.R7$(),t.SpI(" ",e.label," ")}}function Ze(o,r){1&o&&t.EFF(0," \u2013 ")}function qe(o,r){if(1&o&&(t.j41(0,"nsi-label",15),t.EFF(1),t.k0s()),2&o){const e=r.$implicit;t.R7$(),t.SpI(" ",e," ")}}function tn(o,r){1&o&&t.EFF(0," \u2013 ")}function en(o,r){1&o&&(t.j41(0,"div",5),t.Z7z(1,qe,2,1,"nsi-label",15,t.fX1,!1,tn,1,0),t.k0s()),2&o&&(t.R7$(),t.Dyx(r.extensions.split(", ")))}function nn(o,r){1&o&&t.EFF(0," \u2013 ")}function on(o,r){if(1&o&&(t.EFF(0),t.nI1(1,"translate"),t.nrm(2,"pa-datetime",16),t.EFF(3),t.nI1(4,"translate"),t.nrm(5,"pa-datetime",16)),2&o){const e=r;t.SpI(" ",t.bMT(1,4,"sync.details.settings.modification-date.from")," "),t.R7$(2),t.Y8G("datetime",e.from),t.R7$(),t.SpI(" ",t.bMT(4,6,"sync.details.settings.modification-date.to")," "),t.R7$(2),t.Y8G("datetime",e.to)}}function rn(o,r){1&o&&t.EFF(0," \u2013 ")}function sn(o,r){if(1&o&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&o){const e=t.XpG().$implicit,n=t.XpG(3);t.R7$(),t.JRh(n.sync.connector.parameters[e.id]||"_")}}function an(o,r){if(1&o&&t.nrm(0,"app-parameters-table",18),2&o){const e=t.XpG().$implicit,n=t.XpG(3);t.Y8G("values",n.sync.connector.parameters[e.id])}}function cn(o,r){1&o&&t.EFF(0," \u2013 ")}function ln(o,r){1&o&&t.nrm(0,"div",4)}function dn(o,r){if(1&o&&(t.j41(0,"div",3)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,sn,2,1,"div")(5,an,1,1,"app-parameters-table",18)(6,cn,1,0),t.k0s(),t.nVh(7,ln,1,0,"div",4)),2&o){const e=r.$implicit,n=r.$index,i=r.$count,a=t.XpG(3);t.R7$(2),t.JRh(t.bMT(3,3,e.label)),t.R7$(2),t.vxM("table"!==e.type?4:(null==a.sync.connector.parameters[e.id]?null:a.sync.connector.parameters[e.id].length)>0?5:6),t.R7$(3),t.vxM(n!==i-1?7:-1)}}function pn(o,r){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",17)(1,"div",2),t.Z7z(2,dn,8,5,null,null,lt),t.k0s()()),2&o){const e=r.$implicit;t.Y8G("itemTitle",e.title)("description",e.description||""),t.R7$(2),t.Dyx(e.fields)}}function hn(o,r){if(1&o&&(t.Z7z(0,pn,4,2,"nsi-two-columns-configuration-item",17,lt),t.nI1(2,"async")),2&o){const e=t.XpG();t.Dyx(t.bMT(2,0,e.connector.getParametersSections()))}}function un(o,r){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",8)(1,"div"),t.EFF(2),t.k0s()()),2&o){const e=t.XpG();t.R7$(2),t.JRh(e.extractStrategy)}}function mn(o,r){1&o&&t.nrm(0,"pa-icon",20)}function gn(o,r){1&o&&t.nrm(0,"pa-icon",21)}function yn(o,r){1&o&&t.nrm(0,"pa-icon",22)}function fn(o,r){if(1&o&&(t.j41(0,"pa-table-row")(1,"pa-table-cell")(2,"div",19),t.nVh(3,mn,1,0,"pa-icon",20)(4,gn,1,0,"pa-icon",21)(5,yn,1,0,"pa-icon",22),t.EFF(6),t.k0s()(),t.j41(7,"pa-table-cell")(8,"div",23),t.nrm(9,"pa-datetime",24),t.k0s()()()),2&o){let e;const n=r.$implicit;t.R7$(3),t.vxM("high"===(e=n.level)?3:"medium"===e?4:"low"===e?5:-1),t.R7$(3),t.SpI(" ",n.message," "),t.R7$(3),t.Y8G("datetime",n.createdAt)}}function _n(o,r){1&o&&(t.j41(0,"pa-table-row",13)(1,"pa-table-cell")(2,"div",23),t.EFF(3),t.nI1(4,"translate"),t.k0s()()()),2&o&&(t.R7$(3),t.JRh(t.bMT(4,1,"sync.details.activity-log.no-activity")))}let bn=(()=>{class o{constructor(){this.labelService=(0,s.WQX)(C.xQ),this.cdr=(0,s.WQX)(R.gRc),this.currentRoute=(0,s.WQX)(S.nX),this.sdk=(0,s.WQX)(C.ok),this.connector=null,this._logs=[],this.labelSets={},this.coloredLabels=[],this.extractStrategy=""}set logs(e){e&&(this._logs=e)}get logs(){return this._logs}ngAfterViewInit(){this.currentRoute.queryParams.pipe((0,f.p)(e=>e.section),(0,u.T)(e=>e.section),(0,_.s)(1)).subscribe({next:e=>{setTimeout(()=>{"activity"===e&&this.activitySection&&this.activitySection.nativeElement.scrollIntoView({behavior:"smooth"})},300)}})}ngOnInit(){this.labelService.resourceLabelSets.pipe((0,_.s)(1),(0,f.p)(n=>!!n),(0,u.T)(n=>n)).subscribe(n=>{this.labelSets=n,this.coloredLabels=this.sync.labels?.map(i=>({...i,color:this.labelSets[i.labelset]?.color}))||[],this.cdr.detectChanges()});const e=this.sync.extract_strategy;e&&this.sdk.currentKb.pipe((0,_.s)(1),(0,h.n)(n=>n.getExtractStrategies())).subscribe(n=>{this.extractStrategy=n[e]?.name||"",this.cdr.markForCheck()})}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-sync-settings"]],viewQuery:function(n,i){if(1&n&&t.GBs(He,5),2&n){let a;t.mGM(a=t.lsd())&&(i.activitySection=a.first)}},inputs:{sync:"sync",connector:"connector",logs:"logs"},decls:48,vars:26,consts:[["activitySection",""],["noTopBorder","","itemTitle","sync.details.settings.title","description","sync.details.settings.description"],[1,"sync-settings-container"],[1,"body-s","settings-item"],[1,"separator-line"],[1,"row-container"],["readonly","",3,"color"],[1,"body-s","row-container"],["itemTitle","sync.add-page.extract-config.title","description","sync.add-page.extract-config.description"],["itemTitle","sync.details.activity-log.title","description","sync.details.activity-log.description"],[1,"activity-logs-container"],["border","","columns","2fr 1fr"],["header",""],["last",""],[2,"text-transform","capitalize"],["readonly","","neutral",""],["dateOnly","",3,"datetime"],[3,"itemTitle","description"],["readonly","",3,"values"],[1,"body-s","icon-and-text"],["size","small","name","circle-cross",1,"error"],["size","small","name","warning",1,"warning"],["size","small","name","circle-check",1,"success"],[1,"body-s"],[3,"datetime"]],template:function(n,i){if(1&n&&(t.j41(0,"nsi-two-columns-configuration-item",1)(1,"div",2)(2,"div",3)(3,"label"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"div"),t.EFF(7),t.k0s()(),t.nrm(8,"div",4),t.nVh(9,ze,8,6),t.j41(10,"div",3)(11,"label"),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"div",5),t.Z7z(15,Ke,2,2,"nsi-label",6,t.fX1,!1,Ze,1,0),t.k0s()(),t.nrm(18,"div",4),t.j41(19,"label"),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.j41(22,"div",3),t.nVh(23,en,4,1,"div",5)(24,nn,1,0),t.k0s(),t.nrm(25,"div",4),t.j41(26,"label"),t.EFF(27),t.nI1(28,"translate"),t.k0s(),t.j41(29,"div",7),t.nVh(30,on,6,8)(31,rn,1,0),t.k0s()()(),t.nVh(32,hn,3,2),t.nVh(33,un,3,1,"nsi-two-columns-configuration-item",8),t.j41(34,"nsi-two-columns-configuration-item",9)(35,"div",10,0)(37,"pa-table",11)(38,"pa-table-header")(39,"pa-table-cell",12),t.EFF(40),t.nI1(41,"translate"),t.k0s(),t.j41(42,"pa-table-cell",12),t.EFF(43),t.nI1(44,"translate"),t.k0s()(),t.Z7z(45,fn,10,3,"pa-table-row",null,t.fX1,!1,_n,5,3,"pa-table-row",13),t.k0s()()()),2&n){let a,p;t.R7$(4),t.JRh(t.bMT(5,14,"sync.details.settings.name")),t.R7$(3),t.JRh(i.sync.title),t.R7$(2),t.vxM(null!=i.connector&&i.connector.canSyncSecurityGroups?9:-1),t.R7$(3),t.JRh(t.bMT(13,16,"sync.details.settings.labels")),t.R7$(3),t.Dyx(i.coloredLabels),t.R7$(5),t.SpI(" ",t.bMT(21,18,null!=i.sync.filters&&null!=i.sync.filters.fileExtensions&&i.sync.filters.fileExtensions.exclude?"sync.details.settings.file-extensions.excluded":"sync.details.settings.file-extensions.included")," "),t.R7$(3),t.vxM((a=null==i.sync.filters?null:i.sync.filters.fileExtensions)?23:24,a),t.R7$(4),t.JRh(t.bMT(28,20,"sync.details.settings.modification-date.label")),t.R7$(3),t.vxM((p=null==i.sync.filters?null:i.sync.filters.modified)?30:31,p),t.R7$(2),t.vxM(i.connector?32:-1),t.R7$(),t.vxM(i.extractStrategy?33:-1),t.R7$(7),t.JRh(t.bMT(41,22,"sync.details.activity-log.table-header.message")),t.R7$(3),t.JRh(t.bMT(44,24,"sync.details.activity-log.table-header.date")),t.R7$(2),t.Dyx(i.logs)}},dependencies:[v.MD,v.Jj,m._8,y.h,y.D9,m.OE,it.U,l.Pa6,nt.Z,l.EGN,q.O,tt.e,et.U,We.Bz,l.V3x,E.R,C.Qy],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.sync-settings-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.sync-settings-container[_ngcontent-%COMP%] .settings-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.sync-settings-container[_ngcontent-%COMP%] .body-s[_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{color:var(--color-neutral-regular, hsl(207, 17%, 58%));font-weight:600}.sync-settings-container[_ngcontent-%COMP%] .row-container[_ngcontent-%COMP%]{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.25rem}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] pa-icon[_ngcontent-%COMP%]{display:flex}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .error[_ngcontent-%COMP%], .activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .warning[_ngcontent-%COMP%]{color:var(--color-secondary-stronger, hsl(7, 90%, 35%))}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .success[_ngcontent-%COMP%]{color:var(--color-primary-strong)}'],changeDetection:0})}return o})();const Cn=o=>({count:o});function vn(o,r){if(1&o){const e=t.RV6();t.j41(0,"header")(1,"pa-input",1),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"pa-button",2),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.editing=!0)}),t.EFF(5),t.nI1(6,"translate"),t.k0s()(),t.j41(7,"div",3),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.nrm(10,"nsi-folder-list",4)}if(2&o){const e=t.XpG();t.R7$(),t.Y8G("formControl",e.queryControl),t.R7$(),t.SpI(" ",t.bMT(3,6,"sync.folder-selection.search-input-label")," "),t.R7$(3),t.JRh(t.bMT(6,8,"sync.folder-selection.edit-folders-button")),t.R7$(3),t.JRh(t.bMT(9,10,"sync.folder-selection.current-selection")),t.R7$(2),t.Y8G("filtered",!!e.query)("folders",e.selectedFolders)}}function Sn(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-folder-selection",5),t.bIt("selectedSyncItems",function(i){s.eBV(e);const a=t.XpG();return s.Njj(a.updateSelection(i))}),t.k0s(),t.j41(1,"nsi-sticky-footer")(2,"div",6),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"pa-button",7),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.editing=!1)}),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.j41(8,"pa-button",8),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.saveSelection())}),t.EFF(9),t.nI1(10,"translate"),t.k0s()()}if(2&o){const e=t.XpG();t.Y8G("sync",e.sync),t.R7$(3),t.SpI(" ",t.i5U(4,4,"sync.folder-selection.footer.selection-count",t.eq3(11,Cn,e.selectionCount))," "),t.R7$(3),t.SpI(" ",t.bMT(7,7,"generic.cancel")," "),t.R7$(3),t.SpI(" ",t.bMT(10,9,"sync.folder-selection.footer.save-changes")," ")}}let xn=(()=>{class o{constructor(){this.cdr=(0,s.WQX)(R.gRc),this._unsubscribeAll=new k.B,this.selectionChange=new t.bkB,this.editing=!1,this.selection=[],this.selectionCount=0,this.queryControl=new d.MJ("")}set sync(e){this._sync=e,this.updateSelection(e.foldersToSync||[])}get sync(){return this._sync}get selectedFolders(){const e=this.selection.map(i=>i.metadata.displayPath||i.metadata.path)||[],n=this.query?this.query.toLocaleLowerCase():"";return n?e.filter(i=>i.toLocaleLowerCase().includes(n)):e}get query(){return this.queryControl.value}updateSelection(e){this.selection=e,this.selectionCount=this.selection.length,this.cdr.detectChanges()}saveSelection(){this.selectionChange.emit(this.selection),this.editing=!1,this.cdr.markForCheck()}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-folders-tab"]],inputs:{sync:"sync"},outputs:{selectionChange:"selectionChange"},decls:3,vars:1,consts:[[1,"folders-tab"],["icon","search",3,"formControl"],[3,"click"],[1,"title-xxs"],[3,"filtered","folders"],[3,"selectedSyncItems","sync"],["footerNote","",1,"title-xs"],["aspect","basic",3,"click"],["kind","primary",3,"click"]],template:function(n,i){1&n&&(t.j41(0,"div",0),t.nVh(1,vn,11,12)(2,Sn,11,13),t.k0s()),2&n&&(t.R7$(),t.vxM(i.editing?i.sync?2:-1:1))},dependencies:[U,l.XgI,N.S,l.Ymm,w.Q,y.h,y.D9,l.V3x,m.Sq,m.o3,d.X1,d.BC,d.l_],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.folders-tab[_ngcontent-%COMP%]{position:relative}.folders-tab[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}.folders-tab[_ngcontent-%COMP%] header[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{width:30rem}'],changeDetection:0})}return o})();var Tn=c(7725),Fn=c(3515);function In(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",8)(1,"div",9)(2,"pa-toggle",10),t.bIt("valueChange",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.toggleSync(i))}),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"pa-button",11),t.nI1(6,"async"),t.bIt("click",function(){s.eBV(e);const i=t.XpG(3);return s.Njj(i.triggerSync())}),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.j41(9,"pa-button",12),t.EFF(10),t.nI1(11,"translate"),t.k0s(),t.j41(12,"pa-button",13),t.bIt("click",function(){s.eBV(e);const i=t.XpG(3);return s.Njj(i.deleteSync())}),t.EFF(13),t.nI1(14,"translate"),t.k0s()()}if(2&o){const e=t.XpG(2),n=t.XpG();t.R7$(2),t.Y8G("value",!e.disabled),t.R7$(),t.SpI(" ",t.bMT(4,6,e.disabled?"sync.badge.inactive":"sync.badge.active")," "),t.R7$(2),t.Y8G("disabled",t.bMT(6,8,n.isSyncing)),t.R7$(2),t.SpI(" ",t.bMT(8,10,"sync.details.buttons.sync-now")," "),t.R7$(3),t.SpI(" ",t.bMT(11,12,"sync.details.buttons.edit-settings")," "),t.R7$(3),t.SpI(" ",t.bMT(14,14,"sync.details.buttons.delete")," ")}}function Rn(o,r){if(1&o&&(t.j41(0,"div",2)(1,"h1",6),t.nrm(2,"pa-icon",7),t.EFF(3),t.k0s(),t.nVh(4,In,15,16,"div",8),t.nI1(5,"async"),t.k0s()),2&o){const e=t.XpG(),n=t.XpG();t.R7$(2),t.Y8G("path",r.logo),t.R7$(),t.SpI(" ",e.title," "),t.R7$(),t.vxM(!1===t.bMT(5,3,n.editMode)?4:-1)}}function Mn(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-tab",14),t.bIt("click",function(){s.eBV(e);const i=t.XpG(2);return s.Njj(i.activeTab="folders")}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const e=t.XpG(2);t.Y8G("active","folders"===e.activeTab),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.details.tabs.folders")," ")}}function kn(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-configuration-form",19),t.nI1(1,"async"),t.nI1(2,"async"),t.nI1(3,"async"),t.bIt("configurationChange",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.updateConfiguration(i))})("validForm",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.validForm=i)}),t.k0s()}if(2&o){let e;const n=t.XpG(2),i=t.XpG();t.Y8G("sync",n)("kbId",t.bMT(1,4,i.kbId))("connector",t.bMT(2,6,i.connector))("connectorId",null==(e=t.bMT(3,8,i.connectorDef))?null:e.id)}}function $n(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-folder-selection",20),t.bIt("selectedSyncItems",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.updateSelection(i))}),t.k0s()}if(2&o){const e=t.XpG(2);t.Y8G("sync",e)}}function Pn(o,r){if(1&o){const e=t.RV6();t.j41(0,"div"),t.nVh(1,kn,4,10,"nsy-configuration-form",15)(2,$n,1,1,"nsy-folder-selection",16),t.j41(3,"nsi-sticky-footer")(4,"pa-button",17),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"pa-button",18),t.bIt("click",function(){s.eBV(e);const i=t.XpG(2);return s.Njj(i.saveChanges())}),t.EFF(8),t.nI1(9,"translate"),t.k0s()()()}if(2&o){let e;const n=t.XpG(2);t.R7$(),t.vxM("settings"===(e=n.activeTab)?1:"folders"===e?2:-1),t.R7$(4),t.SpI(" ",t.bMT(6,3,"generic.cancel")," "),t.R7$(3),t.SpI(" ",t.bMT(9,5,"sync.details.buttons.save-changes")," ")}}function jn(o,r){if(1&o&&(t.nrm(0,"nsy-sync-settings",21),t.nI1(1,"async"),t.nI1(2,"async")),2&o){const e=t.XpG(2),n=t.XpG();t.Y8G("sync",e)("connector",t.bMT(1,3,n.connector))("logs",t.bMT(2,5,n.activityLogs))}}function En(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-folders-tab",22),t.bIt("selectionChange",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.updateFolders(i))}),t.k0s()}if(2&o){const e=t.XpG(2);t.Y8G("sync",e)}}function wn(o,r){if(1&o&&t.nVh(0,jn,3,7,"nsy-sync-settings",21)(1,En,1,1,"nsy-folders-tab",16),2&o){let e;const n=t.XpG(2);t.vxM("settings"===(e=n.activeTab)?0:"folders"===e?1:-1)}}function Gn(o,r){if(1&o){const e=t.RV6();t.nVh(0,Rn,6,5,"div",2),t.nI1(1,"async"),t.j41(2,"pa-tabs",3)(3,"pa-tab",4),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.activeTab="settings")}),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nVh(6,Mn,3,4,"pa-tab",5),t.nI1(7,"async"),t.k0s(),t.nVh(8,Pn,10,7,"div"),t.nI1(9,"async"),t.vZN(10,wn,2,1)}if(2&o){let e,n;const i=t.XpG();t.vxM((e=t.bMT(1,5,i.connectorDef))?0:-1,e),t.R7$(3),t.Y8G("active","settings"===i.activeTab),t.R7$(),t.SpI(" ",t.bMT(5,7,"sync.details.tabs.settings")," "),t.R7$(2),t.vxM(null!=(n=t.bMT(7,9,i.connector))&&n.allowToSelectFolders?6:-1),t.R7$(2),t.vxM(t.bMT(9,11,i.editMode)?8:10)}}let dt=(()=>{class o{constructor(){this.router=(0,s.WQX)(S.Ix),this.currentRoute=(0,s.WQX)(S.nX),this.syncService=(0,s.WQX)(j),this.toaster=(0,s.WQX)(m._g),this.sdk=(0,s.WQX)(C.ok),this.modalService=(0,s.WQX)(m.w8),this.translate=(0,s.WQX)(y.c$),this.unsubscribeAll=new k.B,this.isDeleted=new k.B,this.kbId=this.sdk.currentKb.pipe((0,u.T)(e=>e.id)),this.syncId=this.currentRoute.params.pipe((0,f.p)(e=>!!e.syncId),(0,u.T)(e=>e.syncId),(0,b.M)(e=>this.syncService.setCurrentSyncId(e))),this.sync=this.syncService.cacheUpdated.pipe((0,h.n)(()=>this.syncId),(0,h.n)(e=>this.syncService.getSync(e)),(0,$.Q)(this.isDeleted)),this.connectorDef=this.sync.pipe((0,u.T)(e=>this.syncService.connectors[e.connector.name].definition)),this.connector=this.connectorDef.pipe((0,u.T)(e=>this.syncService.getConnector(e.id,""))),this.activityLogs=this.syncId.pipe((0,h.n)(e=>this.syncService.getLogs(e))),this.activeTab="settings",this.editMode=this.currentRoute.url.pipe((0,u.T)(e=>e.length>1&&"edit"===e[1].path)),this.validForm=!1,this.isSyncing=(0,Qe.z)([this.syncId,this.syncService.isSyncing]).pipe((0,u.T)(([e,n])=>n[e]||!1))}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete(),this.isDeleted.next(),this.isDeleted.complete()}toggleSync(e){this.syncId.pipe((0,_.s)(1),(0,h.n)(n=>this.syncService.updateSync(n,{disabled:!e}))).subscribe({error:()=>this.toaster.error(e?"sync.details.toast.activating-failed":"sync.details.toast.disabling-failed")})}triggerSync(){this.modalService.openConfirm({title:this.translate.instant("sync.details.modal.title"),description:"sync.details.modal.description",confirmLabel:"sync.details.modal.sync-new",cancelLabel:"sync.details.modal.re-sync-all"}).onClose.pipe((0,h.n)(e=>this.syncId.pipe((0,_.s)(1),(0,h.n)(n=>this.syncService.triggerSync(n,!e))))).subscribe({next:()=>this.toaster.success("sync.details.toast.triggering-sync-success"),error:()=>this.toaster.error("sync.details.toast.triggering-sync-failed")})}deleteSync(){this.sync.pipe((0,h.n)(e=>this.modalService.openConfirm({title:this.translate.instant("sync.confirm.deletion.title",{title:e.title}),description:"sync.confirm.deletion.description",isDestructive:!0,confirmLabel:"generic.delete"}).onClose.pipe((0,f.p)(n=>!!n),(0,b.M)(()=>this.isDeleted.next()),(0,h.n)(()=>this.syncService.deleteSync(e.id))))).subscribe({next:()=>this.router.navigate([".."],{relativeTo:this.currentRoute}),error:()=>this.toaster.error("sync.details.toast.deletion-failed")})}updateConfiguration(e){this.updatedConfig=e}updateSelection(e){this.updatedSelection=e}saveChanges(){!this.updatedConfig&&!this.updatedSelection||this.syncId.pipe((0,_.s)(1),(0,h.n)(e=>{const n={...this.updatedConfig};return this.updatedSelection&&(n.foldersToSync=this.updatedSelection),this.syncService.updateSync(e,n)})).subscribe({next:()=>{this.toaster.success("sync.details.toast.modification-success"),this.router.navigate([".."],{relativeTo:this.currentRoute})},error:()=>this.toaster.error("sync.details.toast.modification-failed")})}updateFolders(e){this.syncId.pipe((0,_.s)(1),(0,h.n)(n=>this.syncService.updateSync(n,{foldersToSync:e}))).subscribe({error:()=>this.toaster.error("sync.details.toast.modification-failed")})}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-sync-details-page"]],decls:7,vars:9,consts:[[1,"page-spacing"],[3,"link"],[1,"details-header"],["notFullWidth",""],["data-cy","settings-tab",3,"click","active"],["data-cy","folders-tab",3,"active"],[1,"page-title"],["size","large",3,"path"],[1,"cta-container"],[1,"toggle-container"],["withBackground","","data-cy","active-toggle",3,"valueChange","value"],["aspect","basic","data-cy","sync-now",3,"click","disabled"],["aspect","basic","routerLink","./edit"],["kind","destructive","data-cy","delete",3,"click"],["data-cy","folders-tab",3,"click","active"],["noTopBorder","",3,"sync","kbId","connector","connectorId"],[3,"sync"],["aspect","basic","routerLink",".."],["kind","primary",3,"click"],["noTopBorder","",3,"configurationChange","validForm","sync","kbId","connector","connectorId"],[3,"selectedSyncItems","sync"],[3,"sync","connector","logs"],[3,"selectionChange","sync"]],template:function(n,i){if(1&n&&(t.j41(0,"div",0)(1,"nsi-back-button",1),t.nI1(2,"async"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.nVh(5,Gn,11,13),t.nI1(6,"async"),t.k0s()),2&n){let a;t.R7$(),t.Y8G("link",t.bMT(2,3,i.editMode)?"../..":".."),t.R7$(2),t.SpI(" ",t.bMT(4,5,"sync.add-page.back-button")," "),t.R7$(2),t.vxM((a=t.bMT(6,7,i.sync))?5:-1,a)}},dependencies:[v.MD,v.Jj,m.Xp,y.h,y.D9,l.V3x,E.R,l.Ymm,w.Q,l.rkm,B.a,l.aT,Tn.Q,Fn.w,bn,xn,K.Wk,m.o3,st,U],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}.details-header[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:space-between}.cta-container[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}'],changeDetection:0})}return o})();const On=[{path:"",component:It,children:[{path:"",component:qt},{path:"add/:connector",component:ct},{path:"add/:connector/:syncId",component:ct},{path:":syncId/edit",component:dt},{path:":syncId",component:dt}]}]}}]);
1
+ "use strict";(self.webpackChunknucliadb_admin=self.webpackChunknucliadb_admin||[]).push([[789],{1789:(Vn,L,c)=>{c.r(L),c.d(L,{SYNC_ROUTES:()=>On});var s=c(2306),S=c(419),k=c(1413),ht=c(1584),f=c(5964),h=c(5558),$=c(6977);const x="assets/connector-logos";var P=function(o){return o.PENDING="PENDING",o.PROCESSING="PROCESSING",o.UPLOADED="UPLOADED",o.ERROR="ERROR",o}(P||{}),T=c(4412),g=c(7673),b=c(8141),_=c(6697),u=c(6354),V=c(9437),C=c(7413);const mt={id:"sitemap",title:"Sitemap",logo:`${x}/sitemap.svg`,description:"Upload web pages from a sitemap.xml",permanentSyncOnly:!0,factory:()=>new gt};class gt{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"Sitemap",originalId:"SITEMAP",metadata:{},status:P.PENDING}]}getParametersSections(){return(0,g.of)([{id:"url",title:"sync.connectors.sitemap.url.section-title",fields:[{id:"sitemap",label:"sync.connectors.sitemap.url.label",type:"text",required:!0,pattern:/.+\.(ashx|xml)/,placeholder:"https://my-website.com/sitemap.xml"}]},{id:"restrict-indexation",title:"sync.connectors.common.restrict-indexation.title",description:"sync.connectors.common.restrict-indexation.description",badge:"generic.badge.optional",fields:[{id:"cssSelector",label:"sync.connectors.common.css.label",help:"sync.connectors.common.css.help",type:"text",required:!1,placeholder:".main-content"},{id:"xpathSelector",label:"sync.connectors.common.xpath.label",help:"sync.connectors.common.xpath.help",type:"text",required:!1,placeholder:'//div[@id="main"]'}]},{id:"web-scraping-helpers",title:"sync.connectors.common.web-scraping-helpers.title",description:"sync.connectors.common.web-scraping-helpers.description",badge:"generic.badge.advanced",fields:[{id:"localExtract",label:"sync.connectors.common.local-extract.label",help:"sync.connectors.common.local-extract.help",type:"boolean",required:!1},{id:"keepQueryString",label:"sync.connectors.common.keep-querystring.label",help:"sync.connectors.common.keep-querystring.help",type:"boolean",required:!1},{id:"headers",label:"sync.connectors.common.headers.label",help:"sync.connectors.common.headers.help",type:"table",required:!1},{id:"cookies",label:"sync.connectors.common.cookies.label",help:"sync.connectors.common.cookies.help",type:"table",required:!1},{id:"localstorage",label:"sync.connectors.common.localstorage.label",help:"sync.connectors.common.localstorage.help",type:"table",required:!1}]}])}handleParameters(r){}cleanAuthData(){throw new Error("Method not implemented.")}getParametersValues(){return{}}goToOAuth(){}authenticate(){return(0,g.of)(!0)}}const yt={id:"folder",title:"Folder",logo:`${x}/folder.svg`,description:"Upload a folder from your device",factory:()=>new ft};class ft{constructor(){this.hasServerSideAuth=!1,this.isExternal=!1,this.allowToSelectFolders=!1,this.files=[],this.path="",this.canSyncSecurityGroups=!1}getStaticFolders(){return this.path?[{uuid:"",title:this.path,originalId:this.path,metadata:{},status:P.PENDING}]:[]}getParametersSections(){return(0,g.of)([{id:"local-path",title:"sync.connectors.folder.local-path.title",description:"sync.connectors.folder.local-path.description",fields:[{id:"path",label:"sync.connectors.folder.local-path.field-label",placeholder:"/Users/alice/Documents or C:\\Users\\Alice\\Documents",type:"text",required:!0}]}])}goToOAuth(){}cleanAuthData(){throw new Error("Method not implemented.")}handleParameters(r){r.path&&(this.path=r.path)}getParametersValues(){return{path:this.path}}authenticate(){return(0,g.of)(!0)}}const X="token",A="refresh";class D{constructor(r,e,n){this.hasServerSideAuth=!0,this.isExternal=!0,this.allowToSelectFolders=!0,this.resumable=!1,this.isAuthenticated=new T.t(!1),this.canSyncSecurityGroups="gdrive"===r,this.name=r,this.id=e,this.path=n}getParametersSections(){return(0,g.of)([])}handleParameters(r){}getParametersValues(){return{token:localStorage.getItem(this.prefixStorageKey(X)),refresh:localStorage.getItem(this.prefixStorageKey(A)),refresh_endpoint:`${this.path}/api/external_auth/${this.name}/refresh`}}cleanAuthData(){localStorage.removeItem(this.prefixStorageKey(X)),localStorage.removeItem(this.prefixStorageKey(A))}goToOAuth(r,e){if(e&&this.cleanAuthData(),localStorage.getItem(this.prefixStorageKey(X)))this.isAuthenticated.next(!0);else{const i=`${this.path}/api/external_auth/${this.name}/authorize`;window.electron?window.electron.openExternal(`${i}?redirect=nuclia-desktop://index.html`):location.href=`${i}?redirect=${r}`}}authenticate(){if(!this.isAuthenticated.getValue()){const r=setInterval(()=>{const e=function _t(){let o=location.search;if(!o&&location.href.includes("#")){const r=location.href.split("#")[1];o=r.includes("?")?"?"+r.split("?")[1]:"?"+r}return o&&o.includes("#")&&!o.includes("?")&&(o=o.replace("#","?")),o}();if(e&&e.includes("?")){const n=new URLSearchParams(e.split("?")[1]),i=n.get("token")||"",a=n.get("refresh")||"";clearInterval(r),i?(localStorage.setItem(this.prefixStorageKey(X),i),localStorage.setItem(this.prefixStorageKey(A),a||""),this.isAuthenticated.next(!0)):this.isAuthenticated.next(!1)}},500)}return this.isAuthenticated.asObservable()}prefixStorageKey(r){return`${this.name}-${this.id}-${r}`}getStaticFolders(){return[]}}const J="SHAREPOINT_SITE_NAME";class bt extends D{constructor(r,e,n){super(r,e,n)}getParametersSections(){return(0,g.of)([{id:"account",title:"sync.connectors.sharepoint.account.title",fields:[{id:"site_name",label:"sync.connectors.sharepoint.site.label",type:"text",required:!0}]}])}handleParameters(r){localStorage.setItem(J,r.site_name)}getParametersValues(){return{...super.getParametersValues(),site_name:localStorage.getItem(J)}}}const Ct={id:"confluence",title:"Confluence",logo:`${x}/confluence.svg`,description:"Collaboration platform developed by Atlassian",helpUrl:"https://docs.nuclia.dev/docs/docs/using/sync-agent#confluence-connector-usage",deprecated:!0,factory:()=>new vt},Q="CONFLUENCE_TOKEN";class vt{constructor(){this.hasServerSideAuth=!1,this.isExternal=!1,this.allowToSelectFolders=!0,this.canSyncSecurityGroups=!1}getParametersSections(){return(0,g.of)([{id:"account",title:"sync.connectors.confluence.account.title",description:"sync.connectors.confluence.account.description",fields:[{id:"url",label:"sync.connectors.confluence.url.label",type:"text",placeholder:"https://my-site.atlassian.net/wiki",required:!0},{id:"user",label:"sync.connectors.confluence.user.label",type:"text",placeholder:"me@mycompany.com",required:!0},{id:"token",label:"sync.connectors.confluence.token.label",type:"text",required:!0}]}])}handleParameters(r){localStorage.setItem(Q,r.token)}getParametersValues(){return{token:localStorage.getItem(Q)}}goToOAuth(r,e){return(0,g.of)(!0)}cleanAuthData(){throw new Error("Method not implemented.")}authenticate(){return(0,g.of)(!!this.getParametersValues().token)}getStaticFolders(){return[]}}const St={id:"rss",title:"RSS",logo:`${x}/rss.svg`,description:"Upload web pages from a RSS feed",permanentSyncOnly:!0,factory:()=>new xt};class xt{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"RSS",originalId:"rss",metadata:{},status:P.PENDING}]}getParametersSections(){return(0,g.of)([{id:"url",title:"sync.connectors.rss.url.label",fields:[{id:"url",label:"sync.connectors.rss.url.label",type:"text",required:!0,placeholder:"https://rss-feed-url"}]},{id:"restrict-indexation",title:"sync.connectors.common.restrict-indexation.title",description:"sync.connectors.common.restrict-indexation.description",badge:"generic.badge.optional",fields:[{id:"cssSelector",label:"sync.connectors.common.css.label",help:"sync.connectors.common.css.help",type:"text",required:!1,placeholder:".main-content"},{id:"xpathSelector",label:"sync.connectors.common.xpath.label",help:"sync.connectors.common.xpath.help",type:"text",required:!1,placeholder:'//div[@id="main"]'}]},{id:"web-scraping-helpers",title:"sync.connectors.common.web-scraping-helpers.title",description:"sync.connectors.common.web-scraping-helpers.description",badge:"generic.badge.advanced",fields:[{id:"localExtract",label:"sync.connectors.common.local-extract.label",help:"sync.connectors.common.local-extract.help",type:"boolean",required:!1},{id:"headers",label:"sync.connectors.common.headers.label",help:"sync.connectors.common.headers.help",type:"table",required:!1},{id:"cookies",label:"sync.connectors.common.cookies.label",help:"sync.connectors.common.cookies.help",type:"table",required:!1},{id:"localstorage",label:"sync.connectors.common.localstorage.label",help:"sync.connectors.common.localstorage.help",type:"table",required:!1}]}])}handleParameters(r){}cleanAuthData(){throw new Error("Method not implemented.")}getParametersValues(){return{}}goToOAuth(){}authenticate(){return(0,g.of)(!0)}}var Tt=c(5512),Ft=c(4808);const W="http://localhost:8090",H="NUCLIA_SYNC_SERVER",z="NUCLIA_SYNC_SERVER_TYPE";let j=(()=>{class o{constructor(e,n,i,a){this.sdk=e,this.http=n,this.config=i,this.notificationService=a,this.connectors={gdrive:{definition:{id:"gdrive",title:"Google Drive",logo:`${x}/gdrive.svg`,description:"File storage and synchronization service developed by Google",permanentSyncOnly:!0,deprecated:!0,factory:p=>new D("gdrive",p?.id||"",this.config.getOAuthServer())}},onedrive:{definition:{id:"onedrive",title:"One Drive",logo:`${x}/onedrive.svg`,description:"Microsoft OneDrive file hosting service",permanentSyncOnly:!0,deprecated:!0,factory:p=>new D("onedrive",p?.id||"",this.config.getOAuthServer())}},sharepoint:{definition:{id:"sharepoint",title:"SharePoint",logo:`${x}/sharepoint.svg`,description:"Microsoft Sharepoint service",permanentSyncOnly:!0,deprecated:!0,factory:p=>new bt("sharepoint",p?.id||"",this.config.getOAuthServer())}},dropbox:{definition:{id:"dropbox",title:"Dropbox",logo:`${x}/dropbox.svg`,description:"File storage and synchronization service developed by Dropbox",permanentSyncOnly:!0,deprecated:!0,factory:p=>new D("dropbox",p?.id||"",this.config.getOAuthServer())}},folder:{definition:yt},sitemap:{definition:mt},confluence:{definition:Ct},rss:{definition:St}},this.connectorsObs=new T.t(Object.values(this.connectors).map(p=>p.definition).filter(p=>!p.deprecated)),this._syncServer=new T.t({serverUrl:localStorage.getItem(H)||W,type:localStorage.getItem(z)||"desktop"}),this.syncServer=this._syncServer.asObservable(),this._isServerDown=new T.t(!0),this._currentSyncId=new T.t(null),this._syncCache=new T.t({}),this._cacheUpdated=new T.t((new Date).toISOString()),this._isSyncing=new T.t({}),this.isServerDown=this._isServerDown.asObservable(),this.currentSyncId=this._currentSyncId.asObservable(),this.serverHeaders={token:this.sdk.nuclia.auth.getToken(!0)},this.cacheUpdated=this._cacheUpdated.asObservable(),this.isSyncing=this._isSyncing.asObservable()}getConnectorDefinition(e){return this.connectors[e]?.definition}getConnector(e,n){const i=this.connectors[e];i.instances||(i.instances={});const a=i.instances;return a[n]||(a[n]=i.definition.factory({id:n})),a[n]}getCurrentSync(){return this.currentSyncId.pipe((0,f.p)(e=>!!e),(0,h.n)(e=>this.getSync(e)))}getSync(e){const n=this._syncCache.getValue();return n[e]?(0,g.of)(n[e]):this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{headers:this.serverHeaders}).pipe((0,b.M)(i=>{n[e]=i,this._syncCache.next(n)}))}addSync(e){return this.sdk.currentKb.pipe((0,_.s)(1),(0,h.n)(n=>this.sdk.nuclia.options.standalone?(0,g.of)({...e,kb:{...this.sdk.nuclia.options,knowledgeBox:n.id}}):this.getNucliaKey(n).pipe((0,u.T)(i=>({...e,kb:{zone:this.sdk.nuclia.options.zone,backend:this.sdk.nuclia.options.backend,knowledgeBox:i.kbid,apiKey:i.token}})))),(0,h.n)(n=>this.http.post(`${this._syncServer.getValue().serverUrl}/sync`,n,{headers:this.serverHeaders})),(0,b.M)(()=>{const n=this._syncCache.getValue();n[e.id]=e,this._syncCache.next(n),this._cacheUpdated.next((new Date).toISOString())}),(0,u.T)(()=>{}))}updateSync(e,n,i){return this.http.patch(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{...n,lastSyncGMT:i?"1970-01-01":void 0},{headers:this.serverHeaders}).pipe((0,b.M)(()=>{const a=this._syncCache.getValue();a[e]={...a[e],...n},this._syncCache.next(a),this._cacheUpdated.next((new Date).toISOString())}))}deleteSync(e){return this.http.delete(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{headers:this.serverHeaders}).pipe((0,b.M)(()=>{const n=this._syncCache.getValue();delete n[e],this._syncCache.next(n),this._cacheUpdated.next((new Date).toISOString())}))}hasCurrentSourceAuth(){return this.getCurrentSyncId()?this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/auth`).pipe((0,u.T)(n=>n.hasAuth)):(0,g.of)(!1)}getSyncsForKB(e){return this.isServerDown.pipe((0,h.n)(n=>n?(0,g.of)([]):this.http.get(`${this._syncServer.getValue().serverUrl}/sync/kb/${e}`).pipe((0,u.T)(i=>i.map(a=>({...a,kbId:e,connectorId:a.connector,connector:this.getConnector(a.connector,"")})).filter(a=>a.kbId===e)))))}getFiles(e){return this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/files/search${e?`?query=${e}`:""}`)}getFolders(e){return this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/folders`,{headers:this.serverHeaders})}canSelectFiles(e){const n=this._syncCache.getValue()[e];return n&&!("sitemap"===n.connector.name||"folder"===n.connector.name||"rss"===n.connector.name)}getNucliaKey(e){return e.createKeyForService({title:"Sync",role:"SCONTRIBUTOR"},this.getExpirationDate()).pipe((0,u.T)(n=>({...n,kbid:e.id})))}getExpirationDate(){const e=new Date;return e.setFullYear(e.getFullYear()+1),Math.floor(e.getTime()/1e3).toString()}serverStatus(e){return this.http.get(`${e}/status`).pipe((0,V.W)(()=>(0,g.of)({running:!1,logs:["Server down"]})),(0,u.T)(n=>((n.logs||[]).forEach(i=>console.log("[SERVER]",i)),{running:n.running})))}setSyncServer(e,n){localStorage.setItem(H,e||""),localStorage.setItem(z,n),this._syncServer.next({serverUrl:e||"",type:n}),e&&this.serverStatus(e).subscribe(i=>{this.setServerStatus(!i.running)})}authenticateToConnector(e,n){return n.authenticate().pipe((0,f.p)(i=>i),(0,_.s)(1),(0,h.n)(()=>this.updateSync(this.getCurrentSyncId()||"",{connector:{name:e,parameters:n.getParametersValues()}})),(0,u.T)(()=>(n.cleanAuthData(),!0)))}getCurrentSyncId(){return this._currentSyncId.getValue()}setCurrentSyncId(e){this._currentSyncId.next(e)}clearCurrentSourceId(){this._currentSyncId.next(null)}getLogs(e,n){return this.http.get(`${this._syncServer.getValue().serverUrl}/logs${e?"/"+e:""}${n?"/"+n:""}`).pipe((0,u.T)(i=>i.sort((a,p)=>{const F=(0,Tt.T)(a.createdAt,p.createdAt);return 0===F?a.action.startsWith("start")?1:-1:F})))}clearLogs(){return this.http.delete(`${this._syncServer.getValue().serverUrl}/logs`)}getSyncServer(){return this._syncServer.getValue().serverUrl}setServerStatus(e){e&&!this._isServerDown.value&&this.notificationService.pushNotifications([{type:"sync-server",data:[],timestamp:(new Date).toISOString(),unread:!0,failure:!0}]),this._isServerDown.next(e)}triggerSync(e,n=!1){return this._isSyncing.next({...this._isSyncing.value,[e]:!0}),(n?this.updateSync(e,{},!0).pipe((0,u.T)(()=>!0)):(0,g.of)(!0)).pipe((0,h.n)(()=>this.http.get(`${this._syncServer.getValue().serverUrl}/sync/execute/${e}`)),(0,b.M)(()=>this._isSyncing.next({...this._isSyncing.value,[e]:!1})),(0,V.W)(a=>(console.warn("Trigger sync failed:",a),this._isSyncing.next({...this._isSyncing.value,[e]:!1}),(0,g.of)())))}static#t=this.\u0275fac=function(n){return new(n||o)(s.KVO(C.ok),s.KVO(Ft.Qq),s.KVO(C.M),s.KVO(C.JE))};static#e=this.\u0275prov=s.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var t=c(2898);let It=(()=>{class o{constructor(){this.unsubscribeAll=new k.B,this.syncService=(0,s.WQX)(j)}ngOnInit(){let e=!1,n=0;(0,ht.O)(0,5e3).pipe((0,f.p)(()=>{const a=n>=(e?12:0);return n++,a}),(0,h.n)(()=>this.syncService.serverStatus(this.syncService.getSyncServer())),(0,$.Q)(this.unsubscribeAll)).subscribe(i=>{e=i.running,n=0,this.syncService.setServerStatus(!e)})}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["ng-component"]],decls:1,vars:0,template:function(n,i){1&n&&t.nrm(0,"router-outlet")},dependencies:[S.n3],encapsulation:2,changeDetection:0})}return o})();var R=c(7705),l=c(8743),Rt=c(9874),E=c(4929);let Mt=(()=>{class o{constructor(){this.title="",this.logo="",this.disabled=!1,this.selectConnector=new t.bkB}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-connector"]],inputs:{title:"title",logo:"logo",disabled:[2,"disabled","disabled",R.L39]},outputs:{selectConnector:"selectConnector"},decls:5,vars:3,consts:[[3,"cardClick","disabled"],[1,"connector"],["size","large",3,"path"]],template:function(n,i){1&n&&(t.j41(0,"pa-card",0),t.bIt("cardClick",function(p){return i.selectConnector.emit(p)}),t.j41(1,"div",1),t.nrm(2,"pa-icon",2),t.j41(3,"div"),t.EFF(4),t.k0s()()()),2&n&&(t.Y8G("disabled",i.disabled),t.R7$(2),t.Y8G("path",i.logo),t.R7$(2),t.JRh(i.title))},dependencies:[l.ALJ,Rt.i,l.V3x,E.R],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.connector[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;gap:.5rem;width:6rem}'],changeDetection:0})}return o})();var v=c(7248),d=c(9417),K=c(4825),y=c(8018),m=c(4795),w=c(3606),kt=c(820),Z=c(6812),N=c(3085),B=c(4899),$t=c(7481),Pt=c(3257),jt=c(6010),q=c(5472),tt=c(9435),et=c(3107),Et=c(7839),wt=c(4099),nt=c(4684),Gt=c(9122);const Ot=()=>({section:"activity"}),ot=(o,r)=>r.id;function Vt(o,r){1&o&&(t.j41(0,"nsi-dropdown-button",17),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"sync.home-page.setup-server.on-desktop.download-dropdown")," "))}function Xt(o,r){if(1&o&&(t.j41(0,"nsi-badge"),t.EFF(1),t.nI1(2,"translate"),t.k0s(),t.nVh(3,Vt,3,3,"nsi-dropdown-button",17)),2&o){const e=t.XpG(2);t.R7$(),t.JRh(t.bMT(2,2,"sync.badge.inactive")),t.R7$(2),t.vxM(e.downloadSyncAgentFeature?3:-1)}}function Dt(o,r){1&o&&(t.j41(0,"nsi-badge",16),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.active")))}function At(o,r){if(1&o&&(t.nVh(0,Xt,4,4),t.nI1(1,"async"),t.vZN(2,Dt,3,3,"nsi-badge",16)),2&o){const e=t.XpG();t.vxM(t.bMT(1,1,e.inactiveServer)?0:2)}}function Nt(o,r){1&o&&(t.j41(0,"nsi-badge"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.inactive")))}function Bt(o,r){1&o&&(t.j41(0,"nsi-badge",16),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.active")))}function Ut(o,r){if(1&o&&(t.j41(0,"div",13),t.nVh(1,Nt,3,3,"nsi-badge"),t.nI1(2,"async"),t.vZN(3,Bt,3,3,"nsi-badge",16),t.j41(4,"pa-input",18),t.EFF(5," Server URL "),t.k0s(),t.j41(6,"pa-button",19),t.EFF(7),t.nI1(8,"translate"),t.k0s()()),2&o){const e=t.XpG();t.R7$(),t.vxM(t.bMT(2,3,e.inactiveServer)?1:3),t.R7$(5),t.Y8G("disabled",!e.serverUrlChanged),t.R7$(),t.SpI(" ",t.bMT(8,5,"generic.save")," ")}}function Yt(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-connector",20),t.nI1(1,"async"),t.nI1(2,"translate"),t.nI1(3,"async"),t.bIt("selectConnector",function(){const i=s.eBV(e).$implicit,a=t.XpG();return s.Njj(a.onSelectConnector(i))}),t.k0s()}if(2&o){const e=r.$implicit,n=t.XpG();t.Y8G("paTooltip",t.bMT(2,6,t.bMT(1,4,n.inactiveServer)?"sync.home-page.add-sources.disabled-source-tooltip":""))("disabled",t.bMT(3,8,n.inactiveServer))("title",e.title)("logo",e.logo)}}function Lt(o,r){1&o&&(t.j41(0,"nsi-info-card",21),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.home-page.sync-list.empty-info")))}function Jt(o,r){if(1&o&&(t.j41(0,"div",25),t.nrm(1,"pa-icon",33),t.EFF(2),t.k0s()),2&o){const e=r;t.R7$(),t.Y8G("path",e.logo),t.R7$(),t.SpI(" ",e.title," ")}}function Qt(o,r){if(1&o&&t.nrm(0,"pa-datetime",28),2&o){const e=t.XpG().$implicit;t.Y8G("datetime",e.lastSyncGMT)}}function Wt(o,r){1&o&&t.EFF(0," \u2013 ")}function Ht(o,r){if(1&o&&(t.j41(0,"pa-option",30),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("routerLink","./"+e.id+"/edit"),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.home-page.sync-list.menu.edit-folders")," ")}}function zt(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-table-row")(1,"pa-table-cell")(2,"a",24),t.EFF(3),t.k0s()(),t.j41(4,"pa-table-cell"),t.nVh(5,Jt,3,2,"div",25),t.k0s(),t.j41(6,"pa-table-cell")(7,"div",26),t.EFF(8),t.k0s()(),t.j41(9,"pa-table-cell")(10,"pa-toggle",27),t.bIt("valueChange",function(i){const a=s.eBV(e).$implicit,p=t.XpG(3);return s.Njj(p.toggleSync(a.id,i))}),t.EFF(11),t.k0s()(),t.j41(12,"pa-table-cell")(13,"div",26),t.nVh(14,Qt,1,1,"pa-datetime",28)(15,Wt,1,0),t.k0s()(),t.j41(16,"pa-table-cell-menu")(17,"pa-button",29),t.EFF(18," Menu "),t.k0s(),t.j41(19,"pa-dropdown",null,0)(21,"pa-option",30),t.EFF(22),t.nI1(23,"translate"),t.k0s(),t.nVh(24,Ht,3,4,"pa-option",30),t.j41(25,"pa-option",31),t.EFF(26),t.nI1(27,"translate"),t.k0s(),t.j41(28,"pa-option",32),t.bIt("selectOption",function(){const i=s.eBV(e).$implicit,a=t.XpG(3);return s.Njj(a.deleteSync(i))}),t.EFF(29),t.nI1(30,"translate"),t.k0s()()()()}if(2&o){let e;const n=r.$implicit,i=t.sdS(20),a=t.XpG(3);t.R7$(2),t.Y8G("routerLink","./"+n.id),t.R7$(),t.SpI(" ",n.title," "),t.R7$(2),t.vxM((e=null==a.connectors[n.connectorId]?null:a.connectors[n.connectorId].definition)?5:-1,e),t.R7$(3),t.JRh(n.totalSyncedResources),t.R7$(2),t.Y8G("value",!n.disabled),t.R7$(),t.SpI(" ",n.disabled?"Off":"On"," "),t.R7$(3),t.vxM("1970-01-01"!==n.lastSyncGMT?14:15),t.R7$(3),t.Y8G("paPopup",i),t.R7$(4),t.Y8G("routerLink","./"+n.id+"/edit"),t.R7$(),t.SpI(" ",t.bMT(23,15,"sync.home-page.sync-list.menu.edit-settings")," "),t.R7$(2),t.vxM(n.connector.allowToSelectFolders?24:-1),t.R7$(),t.Y8G("routerLink","./"+n.id)("queryParams",t.lJ4(21,Ot)),t.R7$(),t.SpI(" ",t.bMT(27,17,"sync.home-page.sync-list.menu.activity-logs")," "),t.R7$(3),t.SpI(" ",t.bMT(30,19,"sync.home-page.sync-list.menu.delete")," ")}}function Kt(o,r){if(1&o&&(t.j41(0,"pa-table",22),t.nrm(1,"pa-table-sortable-header",23),t.Z7z(2,zt,31,22,"pa-table-row",null,ot),t.k0s()),2&o){const e=t.XpG(),n=t.XpG();t.R7$(),t.Y8G("cells",n.syncTableHeader),t.R7$(),t.Dyx(e)}}function Zt(o,r){1&o&&t.nVh(0,Lt,3,3,"nsi-info-card",21)(1,Kt,4,1,"pa-table",22),2&o&&t.vxM(0===r.length?0:1)}let qt=(()=>{class o{constructor(){this.router=(0,s.WQX)(S.Ix),this.currentRoute=(0,s.WQX)(S.nX),this.syncService=(0,s.WQX)(j),this.sdk=(0,s.WQX)(C.ok),this.toaster=(0,s.WQX)(m._g),this.modalService=(0,s.WQX)(m.w8),this.translate=(0,s.WQX)(y.c$),this.unsubscribeAll=new k.B,this.downloadSyncAgentFeature=!1,this.inactiveServer=this.syncService.isServerDown,this.syncAgentForm=new d.gE({type:new d.MJ("desktop",{nonNullable:!0}),serverUrl:new d.MJ("",{nonNullable:!0,validators:[d.k0.required]})}),this.connectors=this.syncService.connectors,this.connectorList=this.syncService.connectorsObs.pipe((0,u.T)(e=>e.sort((n,i)=>n.title.localeCompare(i.title)))),this.serverUrlBackup="",this.syncs=this.syncService.cacheUpdated.pipe((0,h.n)(()=>this.sdk.currentKb),(0,h.n)(e=>this.syncService.getSyncsForKB(e.id))),this.syncTableHeader=[new l.A3f({id:"name",label:"sync.home-page.sync-list.table-columns.name"}),new l.A3f({id:"connector",label:"sync.home-page.sync-list.table-columns.connector"}),new l.A3f({id:"resources",label:"sync.home-page.sync-list.table-columns.resources"}),new l.A3f({id:"sync",label:"sync.home-page.sync-list.table-columns.sync"}),new l.A3f({id:"latest-sync",label:"sync.home-page.sync-list.table-columns.latest-sync",sortable:!0}),new l.A3f({id:"actions",label:"sync.home-page.sync-list.table-columns.actions"})]}get syncAgentOnServer(){return"server"===this.syncAgentForm.controls.type.value}get syncAgentTypeControl(){return this.syncAgentForm.controls.type}get syncServerUrl(){return this.syncAgentForm.controls.serverUrl.value}get serverUrlChanged(){return this.serverUrlBackup!==this.syncServerUrl}ngOnInit(){this.syncService.syncServer.pipe((0,_.s)(1)).subscribe(e=>{this.syncAgentForm.patchValue(e),this.serverUrlBackup=e.serverUrl}),this.syncAgentTypeControl.valueChanges.pipe((0,$.Q)(this.unsubscribeAll)).subscribe(()=>this.saveSyncServer())}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}saveSyncServer(){if(this.syncAgentForm.valid){const e=this.syncAgentForm.getRawValue();this.syncService.setSyncServer("server"===e.type?e.serverUrl:W,e.type)}}onSelectConnector(e){this.router.navigate(["./add",e.id],{relativeTo:this.currentRoute})}deleteSync(e){this.modalService.openConfirm({title:this.translate.instant("sync.confirm.deletion.title",{title:e.title}),description:"sync.confirm.deletion.description",isDestructive:!0,confirmLabel:"generic.delete"}).onClose.pipe((0,f.p)(n=>!!n),(0,h.n)(()=>this.syncService.deleteSync(e.id))).subscribe({error:()=>this.toaster.error("sync.details.toast.deletion-failed")})}toggleSync(e,n){this.syncService.updateSync(e,{disabled:!n}).subscribe({error:()=>this.toaster.error(n?"sync.details.toast.activating-failed":"sync.details.toast.disabling-failed")})}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["ng-component"]],decls:56,vars:44,consts:[["syncMenu",""],[1,"page-spacing"],[1,"page-title"],[1,"page-description"],[1,"section-description"],[1,"title-l"],[1,"setup-sync-agent",3,"ngSubmit","formGroup"],["formControlName","type"],[1,"radio-config-row"],["value","desktop",3,"help"],[1,"title-m"],[1,"separator-line"],["value","server",3,"help"],[1,"inline-form"],[1,"connector-list"],[3,"paTooltip","disabled","title","logo"],["kind","success"],["aspect","basic"],["formControlName","serverUrl",1,"server-url"],["type","submit",3,"disabled"],[3,"selectConnector","paTooltip","disabled","title","logo"],["icon","info"],["border","","columns","repeat(5, 1fr) 96px"],[3,"cells"],[1,"body-m","black-link",3,"routerLink"],[1,"logo-title"],[1,"body-s"],["labelOnRight","",3,"valueChange","value"],[3,"datetime"],["icon","more-vertical","aspect","basic","size","small",3,"paPopup"],[3,"routerLink"],[3,"routerLink","queryParams"],["destructive","",3,"selectOption"],["size","small",3,"path"]],template:function(n,i){if(1&n&&(t.j41(0,"div",1)(1,"div")(2,"h1",2),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"p",3),t.EFF(6),t.nI1(7,"translate"),t.k0s()(),t.j41(8,"section")(9,"div",4)(10,"div",5),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.j41(13,"div",3),t.EFF(14),t.nI1(15,"translate"),t.k0s()(),t.j41(16,"form",6),t.bIt("ngSubmit",function(){return i.saveSyncServer()}),t.j41(17,"pa-radio-group",7)(18,"div",8)(19,"pa-radio",9),t.nI1(20,"translate"),t.j41(21,"span",10),t.EFF(22),t.nI1(23,"translate"),t.k0s()(),t.nVh(24,At,3,3),t.k0s(),t.nrm(25,"div",11),t.j41(26,"div",8)(27,"pa-radio",12),t.nI1(28,"translate"),t.j41(29,"span",10),t.EFF(30),t.nI1(31,"translate"),t.k0s()(),t.nVh(32,Ut,9,7,"div",13),t.k0s()()()(),t.nrm(33,"div",11),t.j41(34,"section")(35,"div",4)(36,"div",5),t.EFF(37),t.nI1(38,"translate"),t.k0s(),t.j41(39,"div",3),t.EFF(40),t.nI1(41,"translate"),t.k0s()(),t.j41(42,"div",14),t.Z7z(43,Yt,4,10,"nsy-connector",15,ot),t.nI1(45,"async"),t.k0s()(),t.j41(46,"section")(47,"div",4)(48,"div",5),t.EFF(49),t.nI1(50,"translate"),t.k0s(),t.j41(51,"div",3),t.EFF(52),t.nI1(53,"translate"),t.k0s()(),t.nVh(54,Zt,2,1),t.nI1(55,"async"),t.k0s()()),2&n){let a;t.R7$(3),t.JRh(t.bMT(4,16,"navbar.sync")),t.R7$(3),t.JRh(t.bMT(7,18,"sync.home-page.description")),t.R7$(5),t.JRh(t.bMT(12,20,"sync.home-page.setup-server.title")),t.R7$(3),t.JRh(t.bMT(15,22,"sync.home-page.setup-server.description")),t.R7$(2),t.Y8G("formGroup",i.syncAgentForm),t.R7$(3),t.Y8G("help",t.bMT(20,24,"sync.home-page.setup-server.on-desktop.radio-help")),t.R7$(3),t.JRh(t.bMT(23,26,"sync.home-page.setup-server.on-desktop.radio-label")),t.R7$(2),t.vxM(i.syncAgentOnServer?-1:24),t.R7$(3),t.Y8G("help",t.bMT(28,28,"sync.home-page.setup-server.on-server.radio-help")),t.R7$(3),t.JRh(t.bMT(31,30,"sync.home-page.setup-server.on-server.radio-label")),t.R7$(2),t.vxM(i.syncAgentOnServer?32:-1),t.R7$(5),t.JRh(t.bMT(38,32,"sync.home-page.add-sources.title")),t.R7$(3),t.JRh(t.bMT(41,34,"sync.home-page.add-sources.description")),t.R7$(3),t.Dyx(t.bMT(45,36,i.connectorList)),t.R7$(6),t.JRh(t.bMT(50,38,"sync.home-page.sync-list.title")),t.R7$(3),t.JRh(t.bMT(53,40,"sync.home-page.sync-list.description")),t.R7$(2),t.vxM((a=t.bMT(55,42,i.syncs))?54:-1,a)}},dependencies:[v.MD,v.Jj,m.nS,Mt,m.vY,l.Ymm,w.Q,l.Rx2,kt.P,Z.P,l.XgI,N.S,l.rkm,B.a,$t.v,Pt.u,l.tml,jt.d,d.X1,d.qT,d.BC,d.cb,d.j4,d.JD,y.h,y.D9,l.EGN,q.O,tt.e,et.U,Et.N,wt.V,K.Wk,l.V3x,E.R,l.Pa6,nt.Z,m.IA,l.OgD,Gt.w],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}section[_ngcontent-%COMP%] .section-description[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%]{border:1px solid var(--color-neutral-lighter, hsl(207, 17%, 91%));border-radius:.5rem;padding:1.5rem}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .radio-config-row[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem;justify-content:space-between}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .radio-config-row[_ngcontent-%COMP%] pa-radio[_ngcontent-%COMP%]{flex:1 0 auto}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .inline-form[_ngcontent-%COMP%]{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] pa-input.server-url[_ngcontent-%COMP%] .pa-field-control{width:20rem}@media (min-width: 1440px){section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] pa-input.server-url[_ngcontent-%COMP%] .pa-field-control{width:26.5rem}}section[_ngcontent-%COMP%] .separator-line[_ngcontent-%COMP%]{margin:1.5rem 0}section[_ngcontent-%COMP%] .connector-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem}section[_ngcontent-%COMP%] .logo-title[_ngcontent-%COMP%]{font-size:.75rem;line-height:1.25rem;letter-spacing:0;font-weight:400;align-items:center;display:flex;gap:.5rem}section[_ngcontent-%COMP%] pa-table-cell[_ngcontent-%COMP%] pa-toggle[_ngcontent-%COMP%] .pa-toggle-context{gap:.5rem}section[_ngcontent-%COMP%] pa-table-sortable-header[_ngcontent-%COMP%] .pa-table-grid--header{z-index:1}'],changeDetection:0})}return o})();var te=c(3129),ee=c(2193),ne=c(9781),oe=c(6851),ie=c(2071),re=c(5814),se=c(9285),it=c(6420);const ae=()=>[],rt=(o,r)=>r.id,ce=(o,r)=>r.value;function le(o,r){if(1&o&&(t.j41(0,"pa-input",30),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("formControlName",e.id)("placeholder",e.placeholder)("help",e.help),t.R7$(),t.SpI(" ",t.bMT(2,4,e.label)," ")}}function de(o,r){if(1&o&&(t.j41(0,"pa-toggle",31),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("formControlName",e.id)("help",e.help),t.R7$(),t.SpI(" ",t.bMT(2,3,e.label)," ")}}function pe(o,r){if(1&o&&(t.j41(0,"pa-option",34),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=r.$implicit;t.Y8G("disabled",e.disabled)("value",e.value),t.R7$(),t.SpI(" ",t.bMT(2,3,e.label)," ")}}function he(o,r){if(1&o&&(t.j41(0,"pa-select",32),t.Z7z(1,pe,3,5,"pa-option",34,ce),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("formControlName",e.id)("label",e.label)("help",e.help),t.R7$(),t.Dyx(e.options)}}function ue(o,r){if(1&o&&(t.j41(0,"pa-textarea",31),t.EFF(1),t.k0s()),2&o){const e=t.XpG().$implicit;t.Y8G("formControlName",e.id)("help",e.help),t.R7$(),t.SpI(" ",e.label," ")}}function me(o,r){if(1&o&&(t.j41(0,"p"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const e=t.XpG(2).$implicit;t.R7$(),t.JRh(t.bMT(2,1,e.help))}}function ge(o,r){1&o&&(t.j41(0,"nsi-info-card",36),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"sync.form-validation.extra-parameters-incomplete")," "))}function ye(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",33)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,me,3,3,"p"),t.j41(5,"app-parameters-table",35),t.bIt("valuesChange",function(i){s.eBV(e);const a=t.XpG().$implicit,p=t.XpG(3);return s.Njj(p.updateTable(a.id,i))}),t.k0s(),t.nVh(6,ge,3,3,"nsi-info-card",36),t.k0s()}if(2&o){const e=t.XpG().$implicit,n=t.XpG(3);t.R7$(2),t.JRh(t.bMT(3,4,e.label)),t.R7$(2),t.vxM(e.help?4:-1),t.R7$(),t.Y8G("values",n.tables[e.id]||t.lJ4(6,ae)),t.R7$(),t.vxM(n.invalidTables.includes(e.id)?6:-1)}}function fe(o,r){if(1&o&&t.nVh(0,le,3,6,"pa-input",30)(1,de,3,5,"pa-toggle",31)(2,he,3,3,"pa-select",32)(3,ue,2,3,"pa-textarea",31)(4,ye,7,7,"div",33),2&o){let e;t.vxM("text"===(e=r.$implicit.type)?0:"boolean"===e?1:"select"===e?2:"textarea"===e?3:"table"===e?4:-1)}}function _e(o,r){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",5)(1,"div",2),t.Z7z(2,fe,5,1,null,null,rt),t.k0s()()),2&o){const e=r.$implicit;t.Y8G("badge",e.badge)("itemTitle",e.title)("description",e.description||""),t.R7$(2),t.Dyx(e.fields)}}function be(o,r){1&o&&(t.j41(0,"nsi-two-columns-configuration-item",9)(1,"div",7)(2,"pa-toggle",37),t.EFF(3),t.nI1(4,"translate"),t.k0s()()()),2&o&&(t.R7$(3),t.SpI(" ",t.bMT(4,1,"sync.add-page.security-group.toggle-label")," "))}function Ce(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsi-label",38),t.bIt("removeLabel",function(){const i=s.eBV(e).$implicit,a=t.XpG(2);return s.Njj(a.removeLabel(i))}),t.EFF(1),t.k0s()}if(2&o){const e=r.$implicit;t.Y8G("color",e.color),t.R7$(),t.SpI(" ",e.label," ")}}function ve(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsi-label",39),t.bIt("removeLabel",function(){const i=s.eBV(e).$implicit,a=t.XpG(2);return s.Njj(a.removeExtension(i))}),t.EFF(1),t.k0s()}if(2&o){const e=r.$implicit;t.R7$(),t.SpI(" ",e," ")}}function Se(o,r){if(1&o){const e=t.RV6();t.j41(0,"form",0)(1,"nsi-two-columns-configuration-item",1)(2,"div",2)(3,"pa-input",3),t.EFF(4),t.nI1(5,"translate"),t.k0s()()(),t.qex(6,4),t.Z7z(7,_e,4,3,"nsi-two-columns-configuration-item",5,rt),t.nI1(9,"async"),t.bVm(),t.j41(10,"nsi-two-columns-configuration-item",6)(11,"div",7)(12,"app-extraction-select",8),t.bIt("extractConfigChange",function(i){s.eBV(e);const a=t.XpG();return s.Njj(a.updateExtractStrategy(i))}),t.k0s()()(),t.nVh(13,be,5,3,"nsi-two-columns-configuration-item",9),t.j41(14,"nsi-two-columns-configuration-item",10)(15,"div",2)(16,"div",11)(17,"app-label-dropdown",12),t.nI1(18,"async"),t.nI1(19,"async"),t.bIt("selectionChange",function(i){s.eBV(e);const a=t.XpG();return s.Njj(a.updateLabelSelection(i))}),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.j41(22,"span",13),t.EFF(23),t.nI1(24,"translate"),t.k0s(),t.j41(25,"pa-button",14),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.createLabelSet())}),t.EFF(26),t.nI1(27,"translate"),t.k0s()(),t.j41(28,"div",15),t.Z7z(29,Ce,2,2,"nsi-label",16,t.fX1),t.k0s()(),t.j41(31,"div",17)(32,"pa-toggle",18),t.EFF(33),t.nI1(34,"translate"),t.k0s()()(),t.j41(35,"nsi-two-columns-configuration-item",19)(36,"div",2)(37,"nsi-info-card"),t.EFF(38),t.nI1(39,"translate"),t.k0s(),t.j41(40,"div",20)(41,"div",21)(42,"pa-select",22)(43,"pa-option",23),t.EFF(44),t.nI1(45,"translate"),t.k0s(),t.j41(46,"pa-option",24),t.EFF(47),t.nI1(48,"translate"),t.k0s()(),t.j41(49,"pa-input",25),t.EFF(50),t.nI1(51,"translate"),t.k0s()(),t.j41(52,"div",15),t.Z7z(53,ve,2,1,"nsi-label",26,t.fX1),t.k0s(),t.j41(55,"div",27)(56,"label"),t.EFF(57),t.nI1(58,"translate"),t.k0s(),t.j41(59,"div",21),t.nrm(60,"pa-date-picker",28),t.nI1(61,"translate"),t.nrm(62,"pa-date-picker",29),t.nI1(63,"translate"),t.k0s()()()()()()}if(2&o){const e=t.XpG();t.Y8G("formGroup",e.form),t.R7$(),t.Y8G("noTopBorder",e.noTopBorder),t.R7$(3),t.JRh(t.bMT(5,20,"sync.add-page.connector-name.field-label")),t.R7$(3),t.Dyx(t.bMT(9,22,e.connector.getParametersSections())),t.R7$(5),t.Y8G("onlyExtract",!0)("extractConfig",e.extractStrategy),t.R7$(),t.vxM(e.connector.canSyncSecurityGroups?13:-1),t.R7$(4),t.Y8G("labelSets",t.bMT(18,24,e.labelSets))("selection",e.labelSelection)("disabled",!1===t.bMT(19,26,e.hasLabelSet)),t.R7$(3),t.SpI(" ",t.bMT(21,28,"sync.add-page.add-labels.select-labels")," "),t.R7$(3),t.JRh(t.bMT(24,30,"generic.or")),t.R7$(3),t.SpI(" ",t.bMT(27,32,"sync.add-page.add-labels.create-labelset")," "),t.R7$(3),t.Dyx(e.labelSelection),t.R7$(4),t.SpI(" ",t.bMT(34,34,"sync.add-page.preserve-labels.toggle-label")," "),t.R7$(5),t.JRh(t.bMT(39,36,"sync.add-page.filter-resources.file-extension.info")),t.R7$(6),t.SpI(" ",t.bMT(45,38,"sync.add-page.filter-resources.file-extension.include")," "),t.R7$(3),t.SpI(" ",t.bMT(48,40,"sync.add-page.filter-resources.file-extension.exclude")," "),t.R7$(3),t.SpI(" ",t.bMT(51,42,"sync.add-page.filter-resources.file-extension.label")," "),t.R7$(3),t.Dyx(e.extensionList),t.R7$(4),t.JRh(t.bMT(58,44,"sync.add-page.filter-resources.modification-date.label")),t.R7$(3),t.Y8G("label",t.bMT(61,46,"sync.add-page.filter-resources.modification-date.from")),t.R7$(2),t.Y8G("label",t.bMT(63,48,"sync.add-page.filter-resources.modification-date.to"))}}const xe=new RegExp(/[^a-z0-9_-]/g);let st=(()=>{class o{constructor(){this.labelService=(0,s.WQX)(C.xQ),this.modalService=(0,s.WQX)(m.w8),this.cdr=(0,s.WQX)(R.gRc),this.unsubscribeAll=new k.B,this.noTopBorder=!1,this.validForm=new t.bkB,this.configurationChange=new t.bkB,this.form=new d.gE({name:new d.MJ("",{nonNullable:!0,validators:[d.k0.required]}),syncSecurityGroups:new d.MJ(null),preserveLabels:new d.MJ(null),filterResources:new d.gE({extensions:new d.MJ("",{updateOn:"blur"}),extensionUsage:new d.MJ("include",{nonNullable:!0}),from:new d.MJ(""),to:new d.MJ("")}),extra:new d.gE({})}),this.labelSets=this.labelService.resourceLabelSets,this.hasLabelSet=this.labelService.hasResourceLabelSets,this.labelSelection=[],this.extensionList=[],this.tables={},this.invalidTables=[],this.extractStrategy="",this._extra={}}set sync(e){if(e){this.connectorParametersBackup=e.connector.parameters;const n={extensions:e.filters?.fileExtensions?.extensions||"",extensionUsage:e.filters?.fileExtensions?.exclude?"exclude":"include",from:e.filters?.modified?.from||"",to:e.filters?.modified?.to||""};this.form.patchValue({name:e.title,syncSecurityGroups:e.syncSecurityGroups,filterResources:n,preserveLabels:e.preserveLabels}),this.labelSelection=e.labels||[],this.extensionList=this.formatExtensionList(n.extensions),e.extract_strategy&&(this.extractStrategy=e.extract_strategy),e.connector.parameters&&Object.entries(e.connector.parameters).forEach(([i,a])=>{"object"!=typeof a?this._extra[i]=a:this.tables[i]=a})}}get extensionsControl(){return this.form.controls.filterResources.controls.extensions}ngOnInit(){this.connector&&this.connector.getParametersSections().subscribe(e=>{e.forEach(n=>n.fields.forEach(i=>{"table"!==i.type&&this.form.controls.extra.addControl(i.id,new d.MJ("",{nonNullable:!0,validators:i.required?[d.k0.required]:[]}))})),Object.keys(this._extra).length>0&&this.form.patchValue({extra:this._extra})}),this.extensionsControl.valueChanges.pipe((0,$.Q)(this.unsubscribeAll)).subscribe(e=>this.extensionList=this.formatExtensionList(e)),this.form.valueChanges.pipe((0,$.Q)(this.unsubscribeAll)).subscribe(()=>{this.validForm.emit(this.form.valid),this.emitSyncEntity()})}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}updateTable(e,n){this.tables[e]=n,n.some(i=>!(i.value.trim()&&i.key.trim()||!i.value.trim()&&!i.key.trim()))?this.invalidTables.includes(e)||this.invalidTables.push(e):this.invalidTables.includes(e)&&(this.invalidTables=this.invalidTables.filter(i=>i!==e)),this.cdr.markForCheck(),this.emitSyncEntity()}createLabelSet(){this.modalService.openModal(C.Tv,new l.S6u({data:{kind:ee.po.RESOURCES}}))}updateLabelSelection(e){this.labelSets.pipe((0,_.s)(1),(0,f.p)(n=>!!n),(0,u.T)(n=>n)).subscribe(n=>{this.labelSelection=e.map(i=>({...i,color:n[i.labelset]?.color})),this.emitSyncEntity()})}removeExtension(e){const n=this.extensionList.filter(i=>i!==e);this.extensionsControl.patchValue(n.join(", "))}removeLabel(e){this.labelSelection=this.labelSelection.filter(n=>!(n.labelset===e.labelset&&n.label===e.label)),this.emitSyncEntity()}formatExtensionList(e){return e&&e.length>0?e.split(",").map(n=>n.trim()).filter(n=>!!n):[]}emitSyncEntity(){if(!this.connectorId)return;const e=this.form.getRawValue(),n=e.name,i=(Math.random()+1).toString(36).substring(7),a=`${this.kbId}-${n?.toLowerCase().replace(xe,"-")}-${i}`,p={fileExtensions:e.filterResources.extensions?{extensions:e.filterResources.extensions,exclude:"exclude"===e.filterResources.extensionUsage}:void 0,modified:e.filterResources.from||e.filterResources.to?{from:e.filterResources.from||void 0,to:e.filterResources.to||void 0}:void 0},F=Object.entries(e.extra||{}).reduce((G,[O,Y])=>({...G,[O]:Y}),{}),I=Object.entries(this.tables).reduce((G,[O,Y])=>(G[O]=Y.filter(pt=>!(!pt.key.trim()||!pt.value.trim())),G),{}),M={id:a,title:n,labels:this.labelSelection,preserveLabels:e.preserveLabels||!1,filters:p,connector:{name:this.connectorId,parameters:{...this.connectorParametersBackup,...I,...F}}};null!==e.syncSecurityGroups&&(M.syncSecurityGroups=e.syncSecurityGroups),M.extract_strategy=this.extractStrategy,this.configurationChange.emit(M)}updateExtractStrategy(e){this.extractStrategy=e,this.validForm.emit(this.form.valid),this.emitSyncEntity()}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-configuration-form"]],inputs:{connector:"connector",connectorId:"connectorId",kbId:"kbId",sync:"sync",noTopBorder:[2,"noTopBorder","noTopBorder",R.L39]},outputs:{validForm:"validForm",configurationChange:"configurationChange"},decls:1,vars:1,consts:[[3,"formGroup"],["itemTitle","sync.add-page.connector-name.title","description","sync.add-page.connector-name.description",3,"noTopBorder"],[1,"form-container"],["formControlName","name"],["formGroupName","extra"],[3,"badge","itemTitle","description"],["itemTitle","sync.add-page.extract-config.title","description","sync.add-page.extract-config.description","badge","generic.badge.advanced"],[1,"form-container","toggle-container"],[3,"extractConfigChange","onlyExtract","extractConfig"],["itemTitle","sync.add-page.security-group.title","description","sync.add-page.security-group.description","badge","generic.badge.advanced"],["badge","generic.badge.optional","itemTitle","sync.add-page.add-labels.title","description","sync.add-page.add-labels.description"],[1,"inline-form","full-width"],["displayRadioForNonMultiple","","aspect","basic","fullWidth","",3,"selectionChange","labelSets","selection","disabled"],[1,"separator-word","body-s"],["icon","circle-plus","aspect","basic","iconAndText","",1,"full-width",3,"click"],[1,"inline-form","small-gap"],[3,"color"],[1,"toggle-container"],["formControlName","preserveLabels"],["badge","generic.badge.optional","itemTitle","sync.add-page.filter-resources.title","description","sync.add-page.filter-resources.description"],["formGroupName","filterResources",1,"form-container"],[1,"inline-form","full-width","small-gap"],["formControlName","extensionUsage"],["value","include"],["value","exclude"],["id","extension","placeholder",".pdf,.docx","formControlName","extensions"],["neutral",""],[1,"label-field-container"],["formControlName","from",3,"label"],["formControlName","to",3,"label"],[3,"formControlName","placeholder","help"],[3,"formControlName","help"],[3,"formControlName","label","help"],[1,"table-container"],[3,"disabled","value"],[3,"valuesChange","values"],["type","warning","icon","warning"],["withBackground","","formControlName","syncSecurityGroups"],[3,"removeLabel","color"],["neutral","",3,"removeLabel"]],template:function(n,i){1&n&&t.nVh(0,Se,64,50,"form",0),2&n&&t.vxM(i.connector?0:-1)},dependencies:[v.MD,v.Jj,m.IA,m._8,d.X1,d.qT,d.BC,d.cb,d.j4,d.JD,d.$R,l.XgI,N.S,oe.w,ie.Q,Z.P,C.Qy,C.Bo,re.L,l.Ymm,w.Q,y.h,y.D9,l.OYn,se.I,m.OE,it.U,l.rkm,B.a,ne.RxD],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.toggle-container[_ngcontent-%COMP%] pa-toggle[_ngcontent-%COMP%] .pa-toggle-context{justify-content:space-between}.table-container[_ngcontent-%COMP%] nsi-info-card[_ngcontent-%COMP%]{margin-top:.75rem}'],changeDetection:0})}return o})();var Te=c(1943),at=c(7670);const Fe=o=>({total:o}),Ie=o=>({count:o});function Re(o,r){1&o&&t.nrm(0,"nsi-spinner")}function Me(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsi-folder-tree",3),t.bIt("selectionChange",function(i){s.eBV(e);const a=t.XpG(2);return s.Njj(a.updateSelection(i))}),t.k0s()}if(2&o){const e=t.XpG(2);t.Y8G("selection",e.selection)("folderTree",e.folders)}}function ke(o,r){if(1&o&&t.nrm(0,"nsi-folder-list",2),2&o){const e=t.XpG(2);t.Y8G("folders",e.selectedPaths)}}function $e(o,r){if(1&o&&t.nVh(0,Me,1,2,"nsi-folder-tree",1)(1,ke,1,1,"nsi-folder-list",2),2&o){const e=t.XpG();t.vxM(e.seeAll?0:1)}}let U=(()=>{class o{constructor(){this.syncService=(0,s.WQX)(j),this.toaster=(0,s.WQX)(m._g),this.cdr=(0,s.WQX)(R.gRc),this.selectedSyncItems=new t.bkB,this.searchQuery=new d.MJ("",{nonNullable:!0}),this.totalFolders=0,this.selectionCount=0,this.loading=!1,this.seeAll=!0,this.selection=[],this.selectedPaths=[],this.syncItems=[],this.selectedIds=[]}ngOnInit(){this.updateSelection((this.sync.foldersToSync||[]).map(e=>({id:e.uuid,path:e.metadata.path}))),this.loadFolders()}updateView(e){this.seeAll="left"===e}updateSelection(e){this.selection=e,this.selectedPaths=e.map(n=>n.path),this.selectedIds=e.map(n=>n.id),this.selectionCount=e.length,this.selectedSyncItems.emit(this.syncItems.filter(n=>this.selectedIds.includes(n.uuid))),this.cdr.markForCheck()}loadFolders(e){this.loading=!0,this.syncService.getFolders(e?.value||"").pipe((0,V.W)(n=>(n&&this.toaster.error("string"==typeof n?n:n.error?.message||n.error||n.message||"An error occurred"),(0,g.of)({items:[],nextPage:void 0}))),(0,Te.S)((n,i)=>n.concat(i.items),[]),(0,u.T)(n=>[{uuid:"root",originalId:"/",title:"/",status:P.PENDING,metadata:{path:"/"}},...n]),(0,u.T)(n=>n.sort((i,a)=>i.metadata.path.localeCompare(a.metadata.path))),(0,b.M)(n=>{this.totalFolders=n.length,this.syncItems=n}),(0,u.T)(n=>this.getFolderTreeFromSyncItems(n))).subscribe({next:n=>{this.loading=!1,this.folders=n,this.cdr.markForCheck()}})}getFolderTreeFromSyncItems(e){const n={id:"root",path:"/",title:"/",expanded:!0,children:{}};return e.filter(i=>"root"!==i.uuid).forEach(i=>{const a=i.metadata.path,p=i.originalId,F={id:p,title:i.title,path:a,displayPath:i.metadata.displayPath||a,children:{}};if("/"===a)n.children[p]=F;else{let M,I=n;a.split("/").slice(1,-1).forEach(O=>{I&&(M=I.children?.[O],M&&(I=M))}),I.children?I.children[p]=F:I.children={[p]:F}}}),n}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-folder-selection"]],inputs:{sync:"sync"},outputs:{selectedSyncItems:"selectedSyncItems"},decls:7,vars:14,consts:[[3,"activeChange","leftButton","rightButton"],[3,"selection","folderTree"],[3,"folders"],[3,"selectionChange","selection","folderTree"]],template:function(n,i){1&n&&(t.j41(0,"header"),t.nrm(1,"div"),t.j41(2,"nsi-segmented-buttons",0),t.nI1(3,"translate"),t.nI1(4,"translate"),t.bIt("activeChange",function(p){return i.updateView(p)}),t.k0s()(),t.nVh(5,Re,1,0,"nsi-spinner"),t.nVh(6,$e,2,1)),2&n&&(t.R7$(2),t.Y8G("leftButton",t.i5U(3,4,"sync.folder-selection.see-all",t.eq3(10,Fe,i.totalFolders)))("rightButton",t.i5U(4,7,"sync.folder-selection.see-selection",t.eq3(12,Ie,i.selectionCount))),t.R7$(3),t.vxM(i.loading?5:-1),t.R7$(),t.vxM(i.folders?6:-1))},dependencies:[m.Sq,m.sH,l.Ymm,l.XgI,d.X1,m.vI,m.J4,at.t,y.h,y.D9],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}header[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{width:30rem}'],changeDetection:0})}return o})();const Pe=o=>({connector:o}),je=(o,r)=>({index:o,total:r});function Ee(o,r){if(1&o&&(t.j41(0,"div")(1,"h1",2),t.nrm(2,"pa-icon",3),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"p",4),t.EFF(6),t.nI1(7,"translate"),t.k0s()()),2&o){const e=r,n=t.XpG();t.R7$(2),t.Y8G("path",e.logo),t.R7$(),t.SpI(" ",t.i5U(4,3,"sync.add-page.title",t.eq3(8,Pe,e.title))," "),t.R7$(3),t.JRh(t.bMT(7,6,"sync.add-page.description."+n))}}function we(o,r){if(1&o&&(t.nVh(0,Ee,8,10,"div"),t.nI1(1,"async")),2&o){let e;const n=t.XpG();t.vxM((e=t.bMT(1,1,n.connectorDefinition))?0:-1,e)}}function Ge(o,r){1&o&&t.nrm(0,"nsi-spinner")}function Oe(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-configuration-form",6),t.nI1(1,"async"),t.nI1(2,"async"),t.bIt("configurationChange",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.updateConfiguration(i))})("validForm",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.validForm=i)}),t.k0s()}if(2&o){const e=t.XpG(2),n=t.XpG();t.Y8G("sync",n.sync)("kbId",t.bMT(1,4,n.kbId))("connector",e)("connectorId",t.bMT(2,6,n.connectorId))}}function Ve(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-folder-selection",8),t.bIt("selectedSyncItems",function(i){s.eBV(e);const a=t.XpG(4);return s.Njj(a.updateSelection(i))}),t.k0s()}if(2&o){const e=t.XpG(4);t.Y8G("sync",e.sync)}}function Xe(o,r){if(1&o&&t.nVh(0,Ve,1,1,"nsy-folder-selection",7),2&o){const e=t.XpG(3);t.vxM(e.sync?0:-1)}}function De(o,r){if(1&o&&(t.EFF(0),t.nI1(1,"translate")),2&o){const e=t.XpG(),n=t.XpG(3);t.SpI(" ",t.i5U(1,1,"sync.add-page.footer.steps",t.l_i(4,je,n.step(),e.length))," ")}}function Ae(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-button",12),t.bIt("click",function(){s.eBV(e);const i=t.XpG(4);return s.Njj(i.cancel())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"generic.cancel")," "))}function Ne(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-button",12),t.bIt("click",function(){s.eBV(e);const i=t.XpG(4);return s.Njj(i.goBack())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"generic.back")," "))}function Be(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-button",13),t.bIt("click",function(){s.eBV(e);const i=t.XpG(4);return s.Njj(i.goNext())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const e=t.XpG(4);t.Y8G("disabled",!e.validForm||e.saving),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.add-page.footer.folder-selection-button")," ")}}function Ue(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-button",13),t.bIt("click",function(){s.eBV(e);const i=t.XpG(4);return s.Njj(i.save())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const e=t.XpG(3),n=t.XpG();t.Y8G("disabled",!n.validForm||e.allowToSelectFolders&&0===n.folderSelection.length||n.saving),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.add-page.footer.save-button")," ")}}function Ye(o,r){if(1&o&&(t.j41(0,"nsi-sticky-footer")(1,"div",9),t.nVh(2,De,2,7),t.k0s(),t.nVh(3,Ae,3,3,"pa-button",10)(4,Ne,3,3,"pa-button",10),t.nVh(5,Be,3,4,"pa-button",11)(6,Ue,3,4,"pa-button",11),t.k0s()),2&o){const e=r,n=t.XpG(3);t.R7$(2),t.vxM(e.length>1?2:-1),t.R7$(),t.vxM(1===n.step()?3:4),t.R7$(2),t.vxM(e.length>1&&n.step()<e.length?5:6)}}function Le(o,r){if(1&o&&(t.nVh(0,Oe,3,8,"nsy-configuration-form",5)(1,Xe,1,1),t.nVh(2,Ye,7,3,"nsi-sticky-footer"),t.nI1(3,"async")),2&o){let e,n;const i=t.XpG(2);t.vxM(1===(e=i.step())?0:2===e?1:-1),t.R7$(2),t.vxM((n=t.bMT(3,2,i.steps))?2:-1,n)}}function Je(o,r){if(1&o&&(t.j41(0,"div"),t.nVh(1,Ge,1,0,"nsi-spinner")(2,Le,4,4),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.vxM(e.loading?1:2)}}let ct=(()=>{class o{constructor(){this.router=(0,s.WQX)(S.Ix),this.currentRoute=(0,s.WQX)(S.nX),this.sdk=(0,s.WQX)(C.ok),this.syncService=(0,s.WQX)(j),this.modalService=(0,s.WQX)(m.w8),this.translate=(0,s.WQX)(y.c$),this.toaster=(0,s.WQX)(m._g),this.cdr=(0,s.WQX)(R.gRc),this.connectorId=this.currentRoute.params.pipe((0,f.p)(e=>e.connector),(0,u.T)(e=>e.connector)),this.connectorDefinition=this.connectorId.pipe((0,u.T)(e=>this.syncService.getConnectorDefinition(e))),this.connector=this.connectorId.pipe((0,u.T)(e=>this.syncService.getConnector(e,""))),this.kbId=this.sdk.currentKb.pipe((0,u.T)(e=>e.id)),this.steps=this.connector.pipe((0,u.T)(e=>e.allowToSelectFolders?["configuration","folder-selection"]:["configuration"])),this.stepIndex=(0,s.vPA)(0),this.step=(0,te.EW)(()=>this.stepIndex()+1),this.validForm=!1,this.folderSelection=[],this.loading=!1,this.saving=!1}get backPath(){return this.syncId?"../../..":"../.."}ngOnInit(){this.currentRoute.params.pipe((0,f.p)(e=>!!e.syncId),(0,_.s)(1),(0,b.M)(e=>{this.loading=!0,this.cdr.markForCheck(),this.syncId=e.syncId,this.syncService.setCurrentSyncId(this.syncId),this.validForm=!0}),(0,h.n)(()=>this.syncService.getSync(this.syncId)),(0,b.M)(e=>{this.sync=e,this.configuration=e,this.cdr.markForCheck()}),(0,h.n)(e=>this.syncService.hasCurrentSourceAuth().pipe((0,b.M)(n=>{n&&(this.loading=!1,this.cdr.markForCheck())}),(0,f.p)(n=>!n),(0,u.T)(()=>this.syncService.getConnector(e.connector.name,e.id)),(0,h.n)(n=>this.syncService.authenticateToConnector(e.connector.name,n))))).subscribe({next:()=>{this._goNext(),this.loading=!1,this.cdr.markForCheck(),this.router.navigate([],{queryParams:{}})},error:()=>this.toaster.error("sync.details.authentication.fail")})}goBack(){this.stepIndex()>0&&this.stepIndex.update(e=>e-1)}goNext(){if(!this.configuration)return;const e=this.configuration;this.syncId?this._goNext():this.connectorDefinition.pipe((0,_.s)(1),(0,h.n)(n=>this.modalService.openConfirm({title:this.translate.instant("sync.add-page.confirm-authenticate.title",{connector:n.title}),description:this.translate.instant("sync.add-page.confirm-authenticate.description"),confirmLabel:this.translate.instant("sync.add-page.confirm-authenticate.confirm-button")}).onClose),(0,f.p)(n=>!!n),(0,h.n)(()=>this._createSync(e)),(0,h.n)(n=>this._onSuccessfulCreation(n,e))).subscribe({error:n=>{console.warn(n),this.toaster.error("sync.add-page.toast.generic-error")}})}cancel(){this.syncId?this.modalService.openConfirm({title:"sync.confirm.cancel-oauth.title",description:"sync.confirm.cancel-oauth.description",isDestructive:!0,confirmLabel:"sync.confirm.cancel-oauth.confirm-label",cancelLabel:"sync.confirm.cancel-oauth.cancel-label"}).onClose.pipe((0,f.p)(e=>!!e),(0,h.n)(()=>this.syncService.deleteSync(this.syncId))).subscribe({next:()=>this.router.navigate([this.backPath],{relativeTo:this.currentRoute})}):this.router.navigate([this.backPath],{relativeTo:this.currentRoute})}save(){if(!this.configuration)return;this.saving=!0;const e=this.configuration;if(this.syncId){if(this.folderSelection.length>0){const n=this.syncId;this.syncService.updateSync(n,{foldersToSync:this.folderSelection},!0).pipe((0,h.n)(()=>this._syncCreationDone(n))).subscribe({error:i=>this._errorHandler(i)})}}else this._createSync(e).pipe((0,h.n)(n=>this._onSuccessfulCreation(n,e))).subscribe({error:n=>this._errorHandler(n)})}updateConfiguration(e){this.configuration=e}updateSelection(e){this.folderSelection=e}_goNext(){this.steps.pipe((0,_.s)(1)).subscribe(e=>{this.stepIndex()<e.length&&this.stepIndex.update(n=>n+1)})}_createSync(e){return this.syncService.addSync(e).pipe((0,b.M)(()=>this.syncService.setCurrentSyncId(e.id)),(0,u.T)(()=>this.syncService.getConnector(e.connector.name,e.id)),(0,h.n)(n=>n.allowToSelectFolders?(0,g.of)(n):("function"==typeof n.handleParameters&&n.handleParameters(e.connector.parameters),this.syncService.updateSync(e.id,{foldersToSync:n.getStaticFolders()}).pipe((0,u.T)(()=>this.syncService.getConnector(e.connector.name,e.id))))))}_onSuccessfulCreation(e,n){if(e.hasServerSideAuth){let i=location.href.split("/sync/add/")[0];return this.sdk.nuclia.options.standalone&&(i=i.replace("#/","")),e.goToOAuth(`${i}/sync/add/${n.connector.name}/${n.id}`,!0),(0,g.of)()}return this._syncCreationDone(n.id)}_syncCreationDone(e){return(0,g.of)(!0).pipe((0,b.M)(()=>{this.router.navigate([this.syncId?`../../../${e}`:`../../${e}`],{relativeTo:this.currentRoute})}),(0,h.n)(()=>(this.toaster.success("sync.details.toast.triggering-sync-success"),this.syncService.triggerSync(e).pipe((0,V.W)(()=>(this.toaster.error("sync.details.toast.triggering-sync-failed"),(0,g.of)()))))))}_errorHandler(e){this.saving=!1,console.warn(e),this.toaster.error("sync.add-page.toast.generic-error")}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-add-sync-page"]],decls:8,vars:10,consts:[[1,"page-spacing"],[3,"link"],[1,"page-title"],["size","large",3,"path"],[1,"page-description"],[3,"sync","kbId","connector","connectorId"],[3,"configurationChange","validForm","sync","kbId","connector","connectorId"],[3,"sync"],[3,"selectedSyncItems","sync"],["footerNote",""],["aspect","basic"],["kind","primary",3,"disabled"],["aspect","basic",3,"click"],["kind","primary",3,"click","disabled"]],template:function(n,i){if(1&n&&(t.j41(0,"div",0)(1,"nsi-back-button",1),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,we,2,3),t.nI1(5,"async"),t.nVh(6,Je,3,1,"div"),t.nI1(7,"async"),t.k0s()),2&n){let a,p;t.R7$(),t.Y8G("link",i.backPath),t.R7$(),t.SpI(" ",t.bMT(3,4,"sync.add-page.back-button")," "),t.R7$(2),t.vxM((a=t.bMT(5,6,i.connectorId))?4:-1,a),t.R7$(2),t.vxM((p=t.bMT(7,8,i.connector))?6:-1,p)}},dependencies:[v.MD,v.Jj,m.Xp,l.Ymm,w.Q,l.V3x,E.R,m.o3,y.h,y.D9,st,U,m.J4,at.t],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}.inline-form[_ngcontent-%COMP%] pa-select[_ngcontent-%COMP%]{flex:0 0 auto;min-width:8rem;width:fit-content}.inline-form[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{max-width:unset}'],changeDetection:0})}return o})();var Qe=c(4572),We=c(2885);const He=["activitySection"],lt=(o,r)=>r.id;function ze(o,r){if(1&o&&(t.j41(0,"div",3)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"div",14),t.EFF(5),t.nI1(6,"translate"),t.k0s()(),t.nrm(7,"div",4)),2&o){const e=t.XpG();t.R7$(2),t.JRh(t.bMT(3,2,"sync.details.settings.synchronize-security-groups")),t.R7$(3),t.SpI(" ",t.bMT(6,4,e.sync.syncSecurityGroups?"sync.details.settings.boolean.true":"sync.details.settings.boolean.false")," ")}}function Ke(o,r){if(1&o&&(t.j41(0,"nsi-label",6),t.EFF(1),t.k0s()),2&o){const e=r.$implicit;t.Y8G("color",e.color),t.R7$(),t.SpI(" ",e.label," ")}}function Ze(o,r){1&o&&t.EFF(0," \u2013 ")}function qe(o,r){if(1&o&&(t.j41(0,"nsi-label",15),t.EFF(1),t.k0s()),2&o){const e=r.$implicit;t.R7$(),t.SpI(" ",e," ")}}function tn(o,r){1&o&&t.EFF(0," \u2013 ")}function en(o,r){1&o&&(t.j41(0,"div",5),t.Z7z(1,qe,2,1,"nsi-label",15,t.fX1,!1,tn,1,0),t.k0s()),2&o&&(t.R7$(),t.Dyx(r.extensions.split(", ")))}function nn(o,r){1&o&&t.EFF(0," \u2013 ")}function on(o,r){if(1&o&&(t.EFF(0),t.nI1(1,"translate"),t.nrm(2,"pa-datetime",16),t.EFF(3),t.nI1(4,"translate"),t.nrm(5,"pa-datetime",16)),2&o){const e=r;t.SpI(" ",t.bMT(1,4,"sync.details.settings.modification-date.from")," "),t.R7$(2),t.Y8G("datetime",e.from),t.R7$(),t.SpI(" ",t.bMT(4,6,"sync.details.settings.modification-date.to")," "),t.R7$(2),t.Y8G("datetime",e.to)}}function rn(o,r){1&o&&t.EFF(0," \u2013 ")}function sn(o,r){if(1&o&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&o){const e=t.XpG().$implicit,n=t.XpG(3);t.R7$(),t.JRh(n.sync.connector.parameters[e.id]||"_")}}function an(o,r){if(1&o&&t.nrm(0,"app-parameters-table",18),2&o){const e=t.XpG().$implicit,n=t.XpG(3);t.Y8G("values",n.sync.connector.parameters[e.id])}}function cn(o,r){1&o&&t.EFF(0," \u2013 ")}function ln(o,r){1&o&&t.nrm(0,"div",4)}function dn(o,r){if(1&o&&(t.j41(0,"div",3)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,sn,2,1,"div")(5,an,1,1,"app-parameters-table",18)(6,cn,1,0),t.k0s(),t.nVh(7,ln,1,0,"div",4)),2&o){const e=r.$implicit,n=r.$index,i=r.$count,a=t.XpG(3);t.R7$(2),t.JRh(t.bMT(3,3,e.label)),t.R7$(2),t.vxM("table"!==e.type?4:(null==a.sync.connector.parameters[e.id]?null:a.sync.connector.parameters[e.id].length)>0?5:6),t.R7$(3),t.vxM(n!==i-1?7:-1)}}function pn(o,r){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",17)(1,"div",2),t.Z7z(2,dn,8,5,null,null,lt),t.k0s()()),2&o){const e=r.$implicit;t.Y8G("itemTitle",e.title)("description",e.description||""),t.R7$(2),t.Dyx(e.fields)}}function hn(o,r){if(1&o&&(t.Z7z(0,pn,4,2,"nsi-two-columns-configuration-item",17,lt),t.nI1(2,"async")),2&o){const e=t.XpG();t.Dyx(t.bMT(2,0,e.connector.getParametersSections()))}}function un(o,r){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",8)(1,"div"),t.EFF(2),t.k0s()()),2&o){const e=t.XpG();t.R7$(2),t.JRh(e.extractStrategy)}}function mn(o,r){1&o&&t.nrm(0,"pa-icon",20)}function gn(o,r){1&o&&t.nrm(0,"pa-icon",21)}function yn(o,r){1&o&&t.nrm(0,"pa-icon",22)}function fn(o,r){if(1&o&&(t.j41(0,"pa-table-row")(1,"pa-table-cell")(2,"div",19),t.nVh(3,mn,1,0,"pa-icon",20)(4,gn,1,0,"pa-icon",21)(5,yn,1,0,"pa-icon",22),t.EFF(6),t.k0s()(),t.j41(7,"pa-table-cell")(8,"div",23),t.nrm(9,"pa-datetime",24),t.k0s()()()),2&o){let e;const n=r.$implicit;t.R7$(3),t.vxM("high"===(e=n.level)?3:"medium"===e?4:"low"===e?5:-1),t.R7$(3),t.SpI(" ",n.message," "),t.R7$(3),t.Y8G("datetime",n.createdAt)}}function _n(o,r){1&o&&(t.j41(0,"pa-table-row",13)(1,"pa-table-cell")(2,"div",23),t.EFF(3),t.nI1(4,"translate"),t.k0s()()()),2&o&&(t.R7$(3),t.JRh(t.bMT(4,1,"sync.details.activity-log.no-activity")))}let bn=(()=>{class o{constructor(){this.labelService=(0,s.WQX)(C.xQ),this.cdr=(0,s.WQX)(R.gRc),this.currentRoute=(0,s.WQX)(S.nX),this.sdk=(0,s.WQX)(C.ok),this.connector=null,this._logs=[],this.labelSets={},this.coloredLabels=[],this.extractStrategy=""}set logs(e){e&&(this._logs=e)}get logs(){return this._logs}ngAfterViewInit(){this.currentRoute.queryParams.pipe((0,f.p)(e=>e.section),(0,u.T)(e=>e.section),(0,_.s)(1)).subscribe({next:e=>{setTimeout(()=>{"activity"===e&&this.activitySection&&this.activitySection.nativeElement.scrollIntoView({behavior:"smooth"})},300)}})}ngOnInit(){this.labelService.resourceLabelSets.pipe((0,_.s)(1),(0,f.p)(n=>!!n),(0,u.T)(n=>n)).subscribe(n=>{this.labelSets=n,this.coloredLabels=this.sync.labels?.map(i=>({...i,color:this.labelSets[i.labelset]?.color}))||[],this.cdr.detectChanges()});const e=this.sync.extract_strategy;e&&this.sdk.currentKb.pipe((0,_.s)(1),(0,h.n)(n=>n.getExtractStrategies())).subscribe(n=>{this.extractStrategy=n[e]?.name||"",this.cdr.markForCheck()})}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-sync-settings"]],viewQuery:function(n,i){if(1&n&&t.GBs(He,5),2&n){let a;t.mGM(a=t.lsd())&&(i.activitySection=a.first)}},inputs:{sync:"sync",connector:"connector",logs:"logs"},decls:48,vars:26,consts:[["activitySection",""],["noTopBorder","","itemTitle","sync.details.settings.title","description","sync.details.settings.description"],[1,"sync-settings-container"],[1,"body-s","settings-item"],[1,"separator-line"],[1,"row-container"],["readonly","",3,"color"],[1,"body-s","row-container"],["itemTitle","sync.add-page.extract-config.title","description","sync.add-page.extract-config.description"],["itemTitle","sync.details.activity-log.title","description","sync.details.activity-log.description"],[1,"activity-logs-container"],["border","","columns","2fr 1fr"],["header",""],["last",""],[2,"text-transform","capitalize"],["readonly","","neutral",""],["dateOnly","",3,"datetime"],[3,"itemTitle","description"],["readonly","",3,"values"],[1,"body-s","icon-and-text"],["size","small","name","circle-cross",1,"error"],["size","small","name","warning",1,"warning"],["size","small","name","circle-check",1,"success"],[1,"body-s"],[3,"datetime"]],template:function(n,i){if(1&n&&(t.j41(0,"nsi-two-columns-configuration-item",1)(1,"div",2)(2,"div",3)(3,"label"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"div"),t.EFF(7),t.k0s()(),t.nrm(8,"div",4),t.nVh(9,ze,8,6),t.j41(10,"div",3)(11,"label"),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"div",5),t.Z7z(15,Ke,2,2,"nsi-label",6,t.fX1,!1,Ze,1,0),t.k0s()(),t.nrm(18,"div",4),t.j41(19,"label"),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.j41(22,"div",3),t.nVh(23,en,4,1,"div",5)(24,nn,1,0),t.k0s(),t.nrm(25,"div",4),t.j41(26,"label"),t.EFF(27),t.nI1(28,"translate"),t.k0s(),t.j41(29,"div",7),t.nVh(30,on,6,8)(31,rn,1,0),t.k0s()()(),t.nVh(32,hn,3,2),t.nVh(33,un,3,1,"nsi-two-columns-configuration-item",8),t.j41(34,"nsi-two-columns-configuration-item",9)(35,"div",10,0)(37,"pa-table",11)(38,"pa-table-header")(39,"pa-table-cell",12),t.EFF(40),t.nI1(41,"translate"),t.k0s(),t.j41(42,"pa-table-cell",12),t.EFF(43),t.nI1(44,"translate"),t.k0s()(),t.Z7z(45,fn,10,3,"pa-table-row",null,t.fX1,!1,_n,5,3,"pa-table-row",13),t.k0s()()()),2&n){let a,p;t.R7$(4),t.JRh(t.bMT(5,14,"sync.details.settings.name")),t.R7$(3),t.JRh(i.sync.title),t.R7$(2),t.vxM(null!=i.connector&&i.connector.canSyncSecurityGroups?9:-1),t.R7$(3),t.JRh(t.bMT(13,16,"sync.details.settings.labels")),t.R7$(3),t.Dyx(i.coloredLabels),t.R7$(5),t.SpI(" ",t.bMT(21,18,null!=i.sync.filters&&null!=i.sync.filters.fileExtensions&&i.sync.filters.fileExtensions.exclude?"sync.details.settings.file-extensions.excluded":"sync.details.settings.file-extensions.included")," "),t.R7$(3),t.vxM((a=null==i.sync.filters?null:i.sync.filters.fileExtensions)?23:24,a),t.R7$(4),t.JRh(t.bMT(28,20,"sync.details.settings.modification-date.label")),t.R7$(3),t.vxM((p=null==i.sync.filters?null:i.sync.filters.modified)?30:31,p),t.R7$(2),t.vxM(i.connector?32:-1),t.R7$(),t.vxM(i.extractStrategy?33:-1),t.R7$(7),t.JRh(t.bMT(41,22,"sync.details.activity-log.table-header.message")),t.R7$(3),t.JRh(t.bMT(44,24,"sync.details.activity-log.table-header.date")),t.R7$(2),t.Dyx(i.logs)}},dependencies:[v.MD,v.Jj,m._8,y.h,y.D9,m.OE,it.U,l.Pa6,nt.Z,l.EGN,q.O,tt.e,et.U,We.Bz,l.V3x,E.R,C.Qy],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.sync-settings-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.sync-settings-container[_ngcontent-%COMP%] .settings-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.sync-settings-container[_ngcontent-%COMP%] .body-s[_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{color:var(--color-neutral-regular, hsl(207, 17%, 58%));font-weight:600}.sync-settings-container[_ngcontent-%COMP%] .row-container[_ngcontent-%COMP%]{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.25rem}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] pa-icon[_ngcontent-%COMP%]{display:flex}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .error[_ngcontent-%COMP%], .activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .warning[_ngcontent-%COMP%]{color:var(--color-secondary-stronger, hsl(7, 90%, 35%))}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .success[_ngcontent-%COMP%]{color:var(--color-primary-strong)}'],changeDetection:0})}return o})();const Cn=o=>({count:o});function vn(o,r){if(1&o){const e=t.RV6();t.j41(0,"header")(1,"pa-input",1),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"pa-button",2),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.editing=!0)}),t.EFF(5),t.nI1(6,"translate"),t.k0s()(),t.j41(7,"div",3),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.nrm(10,"nsi-folder-list",4)}if(2&o){const e=t.XpG();t.R7$(),t.Y8G("formControl",e.queryControl),t.R7$(),t.SpI(" ",t.bMT(3,6,"sync.folder-selection.search-input-label")," "),t.R7$(3),t.JRh(t.bMT(6,8,"sync.folder-selection.edit-folders-button")),t.R7$(3),t.JRh(t.bMT(9,10,"sync.folder-selection.current-selection")),t.R7$(2),t.Y8G("filtered",!!e.query)("folders",e.selectedFolders)}}function Sn(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-folder-selection",5),t.bIt("selectedSyncItems",function(i){s.eBV(e);const a=t.XpG();return s.Njj(a.updateSelection(i))}),t.k0s(),t.j41(1,"nsi-sticky-footer")(2,"div",6),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"pa-button",7),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.editing=!1)}),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.j41(8,"pa-button",8),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.saveSelection())}),t.EFF(9),t.nI1(10,"translate"),t.k0s()()}if(2&o){const e=t.XpG();t.Y8G("sync",e.sync),t.R7$(3),t.SpI(" ",t.i5U(4,4,"sync.folder-selection.footer.selection-count",t.eq3(11,Cn,e.selectionCount))," "),t.R7$(3),t.SpI(" ",t.bMT(7,7,"generic.cancel")," "),t.R7$(3),t.SpI(" ",t.bMT(10,9,"sync.folder-selection.footer.save-changes")," ")}}let xn=(()=>{class o{constructor(){this.cdr=(0,s.WQX)(R.gRc),this._unsubscribeAll=new k.B,this.selectionChange=new t.bkB,this.editing=!1,this.selection=[],this.selectionCount=0,this.queryControl=new d.MJ("")}set sync(e){this._sync=e,this.updateSelection(e.foldersToSync||[])}get sync(){return this._sync}get selectedFolders(){const e=this.selection.map(i=>i.metadata.displayPath||i.metadata.path)||[],n=this.query?this.query.toLocaleLowerCase():"";return n?e.filter(i=>i.toLocaleLowerCase().includes(n)):e}get query(){return this.queryControl.value}updateSelection(e){this.selection=e,this.selectionCount=this.selection.length,this.cdr.detectChanges()}saveSelection(){this.selectionChange.emit(this.selection),this.editing=!1,this.cdr.markForCheck()}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-folders-tab"]],inputs:{sync:"sync"},outputs:{selectionChange:"selectionChange"},decls:3,vars:1,consts:[[1,"folders-tab"],["icon","search",3,"formControl"],[3,"click"],[1,"title-xxs"],[3,"filtered","folders"],[3,"selectedSyncItems","sync"],["footerNote","",1,"title-xs"],["aspect","basic",3,"click"],["kind","primary",3,"click"]],template:function(n,i){1&n&&(t.j41(0,"div",0),t.nVh(1,vn,11,12)(2,Sn,11,13),t.k0s()),2&n&&(t.R7$(),t.vxM(i.editing?i.sync?2:-1:1))},dependencies:[U,l.XgI,N.S,l.Ymm,w.Q,y.h,y.D9,l.V3x,m.Sq,m.o3,d.X1,d.BC,d.l_],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.folders-tab[_ngcontent-%COMP%]{position:relative}.folders-tab[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}.folders-tab[_ngcontent-%COMP%] header[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{width:30rem}'],changeDetection:0})}return o})();var Tn=c(7725),Fn=c(3515);function In(o,r){if(1&o){const e=t.RV6();t.j41(0,"div",8)(1,"div",9)(2,"pa-toggle",10),t.bIt("valueChange",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.toggleSync(i))}),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"pa-button",11),t.nI1(6,"async"),t.bIt("click",function(){s.eBV(e);const i=t.XpG(3);return s.Njj(i.triggerSync())}),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.j41(9,"pa-button",12),t.EFF(10),t.nI1(11,"translate"),t.k0s(),t.j41(12,"pa-button",13),t.bIt("click",function(){s.eBV(e);const i=t.XpG(3);return s.Njj(i.deleteSync())}),t.EFF(13),t.nI1(14,"translate"),t.k0s()()}if(2&o){const e=t.XpG(2),n=t.XpG();t.R7$(2),t.Y8G("value",!e.disabled),t.R7$(),t.SpI(" ",t.bMT(4,6,e.disabled?"sync.badge.inactive":"sync.badge.active")," "),t.R7$(2),t.Y8G("disabled",t.bMT(6,8,n.isSyncing)),t.R7$(2),t.SpI(" ",t.bMT(8,10,"sync.details.buttons.sync-now")," "),t.R7$(3),t.SpI(" ",t.bMT(11,12,"sync.details.buttons.edit-settings")," "),t.R7$(3),t.SpI(" ",t.bMT(14,14,"sync.details.buttons.delete")," ")}}function Rn(o,r){if(1&o&&(t.j41(0,"div",2)(1,"h1",6),t.nrm(2,"pa-icon",7),t.EFF(3),t.k0s(),t.nVh(4,In,15,16,"div",8),t.nI1(5,"async"),t.k0s()),2&o){const e=t.XpG(),n=t.XpG();t.R7$(2),t.Y8G("path",r.logo),t.R7$(),t.SpI(" ",e.title," "),t.R7$(),t.vxM(!1===t.bMT(5,3,n.editMode)?4:-1)}}function Mn(o,r){if(1&o){const e=t.RV6();t.j41(0,"pa-tab",14),t.bIt("click",function(){s.eBV(e);const i=t.XpG(2);return s.Njj(i.activeTab="folders")}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const e=t.XpG(2);t.Y8G("active","folders"===e.activeTab),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.details.tabs.folders")," ")}}function kn(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-configuration-form",19),t.nI1(1,"async"),t.nI1(2,"async"),t.nI1(3,"async"),t.bIt("configurationChange",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.updateConfiguration(i))})("validForm",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.validForm=i)}),t.k0s()}if(2&o){let e;const n=t.XpG(2),i=t.XpG();t.Y8G("sync",n)("kbId",t.bMT(1,4,i.kbId))("connector",t.bMT(2,6,i.connector))("connectorId",null==(e=t.bMT(3,8,i.connectorDef))?null:e.id)}}function $n(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-folder-selection",20),t.bIt("selectedSyncItems",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.updateSelection(i))}),t.k0s()}if(2&o){const e=t.XpG(2);t.Y8G("sync",e)}}function Pn(o,r){if(1&o){const e=t.RV6();t.j41(0,"div"),t.nVh(1,kn,4,10,"nsy-configuration-form",15)(2,$n,1,1,"nsy-folder-selection",16),t.j41(3,"nsi-sticky-footer")(4,"pa-button",17),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"pa-button",18),t.bIt("click",function(){s.eBV(e);const i=t.XpG(2);return s.Njj(i.saveChanges())}),t.EFF(8),t.nI1(9,"translate"),t.k0s()()()}if(2&o){let e;const n=t.XpG(2);t.R7$(),t.vxM("settings"===(e=n.activeTab)?1:"folders"===e?2:-1),t.R7$(4),t.SpI(" ",t.bMT(6,3,"generic.cancel")," "),t.R7$(3),t.SpI(" ",t.bMT(9,5,"sync.details.buttons.save-changes")," ")}}function jn(o,r){if(1&o&&(t.nrm(0,"nsy-sync-settings",21),t.nI1(1,"async"),t.nI1(2,"async")),2&o){const e=t.XpG(2),n=t.XpG();t.Y8G("sync",e)("connector",t.bMT(1,3,n.connector))("logs",t.bMT(2,5,n.activityLogs))}}function En(o,r){if(1&o){const e=t.RV6();t.j41(0,"nsy-folders-tab",22),t.bIt("selectionChange",function(i){s.eBV(e);const a=t.XpG(3);return s.Njj(a.updateFolders(i))}),t.k0s()}if(2&o){const e=t.XpG(2);t.Y8G("sync",e)}}function wn(o,r){if(1&o&&t.nVh(0,jn,3,7,"nsy-sync-settings",21)(1,En,1,1,"nsy-folders-tab",16),2&o){let e;const n=t.XpG(2);t.vxM("settings"===(e=n.activeTab)?0:"folders"===e?1:-1)}}function Gn(o,r){if(1&o){const e=t.RV6();t.nVh(0,Rn,6,5,"div",2),t.nI1(1,"async"),t.j41(2,"pa-tabs",3)(3,"pa-tab",4),t.bIt("click",function(){s.eBV(e);const i=t.XpG();return s.Njj(i.activeTab="settings")}),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nVh(6,Mn,3,4,"pa-tab",5),t.nI1(7,"async"),t.k0s(),t.nVh(8,Pn,10,7,"div"),t.nI1(9,"async"),t.vZN(10,wn,2,1)}if(2&o){let e,n;const i=t.XpG();t.vxM((e=t.bMT(1,5,i.connectorDef))?0:-1,e),t.R7$(3),t.Y8G("active","settings"===i.activeTab),t.R7$(),t.SpI(" ",t.bMT(5,7,"sync.details.tabs.settings")," "),t.R7$(2),t.vxM(null!=(n=t.bMT(7,9,i.connector))&&n.allowToSelectFolders?6:-1),t.R7$(2),t.vxM(t.bMT(9,11,i.editMode)?8:10)}}let dt=(()=>{class o{constructor(){this.router=(0,s.WQX)(S.Ix),this.currentRoute=(0,s.WQX)(S.nX),this.syncService=(0,s.WQX)(j),this.toaster=(0,s.WQX)(m._g),this.sdk=(0,s.WQX)(C.ok),this.modalService=(0,s.WQX)(m.w8),this.translate=(0,s.WQX)(y.c$),this.unsubscribeAll=new k.B,this.isDeleted=new k.B,this.kbId=this.sdk.currentKb.pipe((0,u.T)(e=>e.id)),this.syncId=this.currentRoute.params.pipe((0,f.p)(e=>!!e.syncId),(0,u.T)(e=>e.syncId),(0,b.M)(e=>this.syncService.setCurrentSyncId(e))),this.sync=this.syncService.cacheUpdated.pipe((0,h.n)(()=>this.syncId),(0,h.n)(e=>this.syncService.getSync(e)),(0,$.Q)(this.isDeleted)),this.connectorDef=this.sync.pipe((0,u.T)(e=>this.syncService.connectors[e.connector.name].definition)),this.connector=this.connectorDef.pipe((0,u.T)(e=>this.syncService.getConnector(e.id,""))),this.activityLogs=this.syncId.pipe((0,h.n)(e=>this.syncService.getLogs(e))),this.activeTab="settings",this.editMode=this.currentRoute.url.pipe((0,u.T)(e=>e.length>1&&"edit"===e[1].path)),this.validForm=!1,this.isSyncing=(0,Qe.z)([this.syncId,this.syncService.isSyncing]).pipe((0,u.T)(([e,n])=>n[e]||!1))}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete(),this.isDeleted.next(),this.isDeleted.complete()}toggleSync(e){this.syncId.pipe((0,_.s)(1),(0,h.n)(n=>this.syncService.updateSync(n,{disabled:!e}))).subscribe({error:()=>this.toaster.error(e?"sync.details.toast.activating-failed":"sync.details.toast.disabling-failed")})}triggerSync(){this.modalService.openConfirm({title:this.translate.instant("sync.details.modal.title"),description:"sync.details.modal.description",confirmLabel:"sync.details.modal.sync-new",cancelLabel:"sync.details.modal.re-sync-all"}).onClose.pipe((0,h.n)(e=>this.syncId.pipe((0,_.s)(1),(0,h.n)(n=>this.syncService.triggerSync(n,!e))))).subscribe({next:()=>this.toaster.success("sync.details.toast.triggering-sync-success"),error:()=>this.toaster.error("sync.details.toast.triggering-sync-failed")})}deleteSync(){this.sync.pipe((0,h.n)(e=>this.modalService.openConfirm({title:this.translate.instant("sync.confirm.deletion.title",{title:e.title}),description:"sync.confirm.deletion.description",isDestructive:!0,confirmLabel:"generic.delete"}).onClose.pipe((0,f.p)(n=>!!n),(0,b.M)(()=>this.isDeleted.next()),(0,h.n)(()=>this.syncService.deleteSync(e.id))))).subscribe({next:()=>this.router.navigate([".."],{relativeTo:this.currentRoute}),error:()=>this.toaster.error("sync.details.toast.deletion-failed")})}updateConfiguration(e){this.updatedConfig=e}updateSelection(e){this.updatedSelection=e}saveChanges(){!this.updatedConfig&&!this.updatedSelection||this.syncId.pipe((0,_.s)(1),(0,h.n)(e=>{const n={...this.updatedConfig};return this.updatedSelection&&(n.foldersToSync=this.updatedSelection),this.syncService.updateSync(e,n)})).subscribe({next:()=>{this.toaster.success("sync.details.toast.modification-success"),this.router.navigate([".."],{relativeTo:this.currentRoute})},error:()=>this.toaster.error("sync.details.toast.modification-failed")})}updateFolders(e){this.syncId.pipe((0,_.s)(1),(0,h.n)(n=>this.syncService.updateSync(n,{foldersToSync:e}))).subscribe({error:()=>this.toaster.error("sync.details.toast.modification-failed")})}static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["nsy-sync-details-page"]],decls:7,vars:9,consts:[[1,"page-spacing"],[3,"link"],[1,"details-header"],["notFullWidth",""],["data-cy","settings-tab",3,"click","active"],["data-cy","folders-tab",3,"active"],[1,"page-title"],["size","large",3,"path"],[1,"cta-container"],[1,"toggle-container"],["withBackground","","data-cy","active-toggle",3,"valueChange","value"],["aspect","basic","data-cy","sync-now",3,"click","disabled"],["aspect","basic","routerLink","./edit"],["kind","destructive","data-cy","delete",3,"click"],["data-cy","folders-tab",3,"click","active"],["noTopBorder","",3,"sync","kbId","connector","connectorId"],[3,"sync"],["aspect","basic","routerLink",".."],["kind","primary",3,"click"],["noTopBorder","",3,"configurationChange","validForm","sync","kbId","connector","connectorId"],[3,"selectedSyncItems","sync"],[3,"sync","connector","logs"],[3,"selectionChange","sync"]],template:function(n,i){if(1&n&&(t.j41(0,"div",0)(1,"nsi-back-button",1),t.nI1(2,"async"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.nVh(5,Gn,11,13),t.nI1(6,"async"),t.k0s()),2&n){let a;t.R7$(),t.Y8G("link",t.bMT(2,3,i.editMode)?"../..":".."),t.R7$(2),t.SpI(" ",t.bMT(4,5,"sync.add-page.back-button")," "),t.R7$(2),t.vxM((a=t.bMT(6,7,i.sync))?5:-1,a)}},dependencies:[v.MD,v.Jj,m.Xp,y.h,y.D9,l.V3x,E.R,l.Ymm,w.Q,l.rkm,B.a,l.aT,Tn.Q,Fn.w,bn,xn,K.Wk,m.o3,st,U],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}.details-header[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:space-between}.cta-container[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}'],changeDetection:0})}return o})();const On=[{path:"",component:It,children:[{path:"",component:qt},{path:"add/:connector",component:ct},{path:"add/:connector/:syncId",component:ct},{path:":syncId/edit",component:dt},{path:":syncId",component:dt}]}]}}]);
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "241fd9c9af82c275127ce1a6ea4cd02308252968",
2
+ "version": "fc2e85bd53aca693d068b3155f7bd9bb05ed0706",
3
3
  "production": true,
4
4
  "backend": {
5
5
  "app": "nucliadb-admin",
@@ -13,5 +13,5 @@
13
13
  <body class="body-s">
14
14
  <nad-root></nad-root>
15
15
  <noscript>Please enable JavaScript to continue using this application.</noscript>
16
- <script src="runtime.7e5f9506824c46c6.js" type="module"></script><script src="polyfills.07329d7acd49761e.js" type="module"></script><script src="main.9e7eb7f1e74994e7.js" type="module"></script></body>
16
+ <script src="runtime.6139d812be170d58.js" type="module"></script><script src="polyfills.07329d7acd49761e.js" type="module"></script><script src="main.c0066998605b7d12.js" type="module"></script></body>
17
17
  </html>