nucliadb-admin-assets 1.0.0.post2202__py3-none-any.whl → 1.0.0.post2209__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.

@@ -203,28 +203,198 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
203
203
  MIT
204
204
 
205
205
  @ng-web-apis/common
206
- MIT
207
- MIT License
206
+ Apache-2.0
207
+ Apache License
208
+ Version 2.0, January 2004
209
+ http://www.apache.org/licenses/
208
210
 
209
- Copyright (c) 2020 Alexander Inkin <alexander@inkin.ru>
211
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
210
212
 
211
- Permission is hereby granted, free of charge, to any person obtaining a copy
212
- of this software and associated documentation files (the "Software"), to deal
213
- in the Software without restriction, including without limitation the rights
214
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
215
- copies of the Software, and to permit persons to whom the Software is
216
- furnished to do so, subject to the following conditions:
213
+ 1. Definitions.
217
214
 
218
- The above copyright notice and this permission notice shall be included in all
219
- copies or substantial portions of the Software.
215
+ "License" shall mean the terms and conditions for use, reproduction,
216
+ and distribution as defined by Sections 1 through 9 of this document.
217
+
218
+ "Licensor" shall mean the copyright owner or entity authorized by
219
+ the copyright owner that is granting the License.
220
+
221
+ "Legal Entity" shall mean the union of the acting entity and all
222
+ other entities that control, are controlled by, or are under common
223
+ control with that entity. For the purposes of this definition,
224
+ "control" means (i) the power, direct or indirect, to cause the
225
+ direction or management of such entity, whether by contract or
226
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
227
+ outstanding shares, or (iii) beneficial ownership of such entity.
228
+
229
+ "You" (or "Your") shall mean an individual or Legal Entity
230
+ exercising permissions granted by this License.
231
+
232
+ "Source" form shall mean the preferred form for making modifications,
233
+ including but not limited to software source code, documentation
234
+ source, and configuration files.
235
+
236
+ "Object" form shall mean any form resulting from mechanical
237
+ transformation or translation of a Source form, including but
238
+ not limited to compiled object code, generated documentation,
239
+ and conversions to other media types.
240
+
241
+ "Work" shall mean the work of authorship, whether in Source or
242
+ Object form, made available under the License, as indicated by a
243
+ copyright notice that is included in or attached to the work
244
+ (an example is provided in the Appendix below).
245
+
246
+ "Derivative Works" shall mean any work, whether in Source or Object
247
+ form, that is based on (or derived from) the Work and for which the
248
+ editorial revisions, annotations, elaborations, or other modifications
249
+ represent, as a whole, an original work of authorship. For the purposes
250
+ of this License, Derivative Works shall not include works that remain
251
+ separable from, or merely link (or bind by name) to the interfaces of,
252
+ the Work and Derivative Works thereof.
253
+
254
+ "Contribution" shall mean any work of authorship, including
255
+ the original version of the Work and any modifications or additions
256
+ to that Work or Derivative Works thereof, that is intentionally
257
+ submitted to Licensor for inclusion in the Work by the copyright owner
258
+ or by an individual or Legal Entity authorized to submit on behalf of
259
+ the copyright owner. For the purposes of this definition, "submitted"
260
+ means any form of electronic, verbal, or written communication sent
261
+ to the Licensor or its representatives, including but not limited to
262
+ communication on electronic mailing lists, source code control systems,
263
+ and issue tracking systems that are managed by, or on behalf of, the
264
+ Licensor for the purpose of discussing and improving the Work, but
265
+ excluding communication that is conspicuously marked or otherwise
266
+ designated in writing by the copyright owner as "Not a Contribution."
267
+
268
+ "Contributor" shall mean Licensor and any individual or Legal Entity
269
+ on behalf of whom a Contribution has been received by Licensor and
270
+ subsequently incorporated within the Work.
271
+
272
+ 2. Grant of Copyright License. Subject to the terms and conditions of
273
+ this License, each Contributor hereby grants to You a perpetual,
274
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
275
+ copyright license to reproduce, prepare Derivative Works of,
276
+ publicly display, publicly perform, sublicense, and distribute the
277
+ Work and such Derivative Works in Source or Object form.
278
+
279
+ 3. Grant of Patent License. Subject to the terms and conditions of
280
+ this License, each Contributor hereby grants to You a perpetual,
281
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
282
+ (except as stated in this section) patent license to make, have made,
283
+ use, offer to sell, sell, import, and otherwise transfer the Work,
284
+ where such license applies only to those patent claims licensable
285
+ by such Contributor that are necessarily infringed by their
286
+ Contribution(s) alone or by combination of their Contribution(s)
287
+ with the Work to which such Contribution(s) was submitted. If You
288
+ institute patent litigation against any entity (including a
289
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
290
+ or a Contribution incorporated within the Work constitutes direct
291
+ or contributory patent infringement, then any patent licenses
292
+ granted to You under this License for that Work shall terminate
293
+ as of the date such litigation is filed.
294
+
295
+ 4. Redistribution. You may reproduce and distribute copies of the
296
+ Work or Derivative Works thereof in any medium, with or without
297
+ modifications, and in Source or Object form, provided that You
298
+ meet the following conditions:
299
+
300
+ (a) You must give any other recipients of the Work or
301
+ Derivative Works a copy of this License; and
302
+
303
+ (b) You must cause any modified files to carry prominent notices
304
+ stating that You changed the files; and
305
+
306
+ (c) You must retain, in the Source form of any Derivative Works
307
+ that You distribute, all copyright, patent, trademark, and
308
+ attribution notices from the Source form of the Work,
309
+ excluding those notices that do not pertain to any part of
310
+ the Derivative Works; and
311
+
312
+ (d) If the Work includes a "NOTICE" text file as part of its
313
+ distribution, then any Derivative Works that You distribute must
314
+ include a readable copy of the attribution notices contained
315
+ within such NOTICE file, excluding those notices that do not
316
+ pertain to any part of the Derivative Works, in at least one
317
+ of the following places: within a NOTICE text file distributed
318
+ as part of the Derivative Works; within the Source form or
319
+ documentation, if provided along with the Derivative Works; or,
320
+ within a display generated by the Derivative Works, if and
321
+ wherever such third-party notices normally appear. The contents
322
+ of the NOTICE file are for informational purposes only and
323
+ do not modify the License. You may add Your own attribution
324
+ notices within Derivative Works that You distribute, alongside
325
+ or as an addendum to the NOTICE text from the Work, provided
326
+ that such additional attribution notices cannot be construed
327
+ as modifying the License.
328
+
329
+ You may add Your own copyright statement to Your modifications and
330
+ may provide additional or different license terms and conditions
331
+ for use, reproduction, or distribution of Your modifications, or
332
+ for any such Derivative Works as a whole, provided Your use,
333
+ reproduction, and distribution of the Work otherwise complies with
334
+ the conditions stated in this License.
335
+
336
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
337
+ any Contribution intentionally submitted for inclusion in the Work
338
+ by You to the Licensor shall be under the terms and conditions of
339
+ this License, without any additional terms or conditions.
340
+ Notwithstanding the above, nothing herein shall supersede or modify
341
+ the terms of any separate license agreement you may have executed
342
+ with Licensor regarding such Contributions.
343
+
344
+ 6. Trademarks. This License does not grant permission to use the trade
345
+ names, trademarks, service marks, or product names of the Licensor,
346
+ except as required for reasonable and customary use in describing the
347
+ origin of the Work and reproducing the content of the NOTICE file.
348
+
349
+ 7. Disclaimer of Warranty. Unless required by applicable law or
350
+ agreed to in writing, Licensor provides the Work (and each
351
+ Contributor provides its Contributions) on an "AS IS" BASIS,
352
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
353
+ implied, including, without limitation, any warranties or conditions
354
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
355
+ PARTICULAR PURPOSE. You are solely responsible for determining the
356
+ appropriateness of using or redistributing the Work and assume any
357
+ risks associated with Your exercise of permissions under this License.
358
+
359
+ 8. Limitation of Liability. In no event and under no legal theory,
360
+ whether in tort (including negligence), contract, or otherwise,
361
+ unless required by applicable law (such as deliberate and grossly
362
+ negligent acts) or agreed to in writing, shall any Contributor be
363
+ liable to You for damages, including any direct, indirect, special,
364
+ incidental, or consequential damages of any character arising as a
365
+ result of this License or out of the use or inability to use the
366
+ Work (including but not limited to damages for loss of goodwill,
367
+ work stoppage, computer failure or malfunction, or any and all
368
+ other commercial damages or losses), even if such Contributor
369
+ has been advised of the possibility of such damages.
370
+
371
+ 9. Accepting Warranty or Additional Liability. While redistributing
372
+ the Work or Derivative Works thereof, You may choose to offer,
373
+ and charge a fee for, acceptance of support, warranty, indemnity,
374
+ or other liability obligations and/or rights consistent with this
375
+ License. However, in accepting such obligations, You may act only
376
+ on Your own behalf and on Your sole responsibility, not on behalf
377
+ of any other Contributor, and only if You agree to indemnify,
378
+ defend, and hold each Contributor harmless for any liability
379
+ incurred by, or claims asserted against, such Contributor by reason
380
+ of your accepting any such warranty or additional liability.
381
+
382
+ END OF TERMS AND CONDITIONS
383
+
384
+ Copyright 2023 Tinkoff Bank
385
+
386
+ Licensed under the Apache License, Version 2.0 (the "License");
387
+ you may not use this file except in compliance with the License.
388
+ You may obtain a copy of the License at
389
+
390
+ http://www.apache.org/licenses/LICENSE-2.0
391
+
392
+ Unless required by applicable law or agreed to in writing, software
393
+ distributed under the License is distributed on an "AS IS" BASIS,
394
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
395
+ See the License for the specific language governing permissions and
396
+ limitations under the License.
220
397
 
221
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
222
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
223
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
224
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
225
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
226
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
227
- SOFTWARE.
228
398
 
229
399
  @ngx-translate/core
230
400
  MIT
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunknucliadb_admin=self.webpackChunknucliadb_admin||[]).push([[789],{1789:(jn,B,c)=>{c.r(B),c.d(B,{SYNC_ROUTES:()=>Pn});var e=c(4438),y=c(177),v=c(6489),R=c(1413),le=c(1584),f=c(5964),p=c(5558),M=c(6977);const S="assets/connector-logos";var k=function(o){return o.PENDING="PENDING",o.PROCESSING="PROCESSING",o.UPLOADED="UPLOADED",o.ERROR="ERROR",o}(k||{}),x=c(4412),m=c(7673),b=c(8141),_=c(6697),h=c(6354),G=c(9437),C=c(7413);const pe={id:"sitemap",title:"Sitemap",logo:`${S}/sitemap.svg`,description:"Upload web pages from a sitemap.xml",permanentSyncOnly:!0,factory:()=>new he};class he{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"Sitemap",originalId:"SITEMAP",metadata:{},status:k.PENDING}]}getParametersSections(){return(0,m.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:"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,m.of)(!0)}}const ue={id:"folder",title:"Folder",logo:`${S}/folder.svg`,description:"Upload a folder from your device",factory:()=>new me};class me{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:k.PENDING}]:[]}getParametersSections(){return(0,m.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,m.of)(!0)}}const O="token",N="refresh";class D{constructor(r,t,n){this.hasServerSideAuth=!0,this.isExternal=!0,this.allowToSelectFolders=!0,this.resumable=!1,this.isAuthenticated=new x.t(!1),this.canSyncSecurityGroups="gdrive"===r,this.name=r,this.id=t,this.path=n}getParametersSections(){return(0,m.of)([])}handleParameters(r){}getParametersValues(){return{token:localStorage.getItem(this.prefixStorageKey(O)),refresh:localStorage.getItem(this.prefixStorageKey(N)),refresh_endpoint:`${this.path}/api/external_auth/${this.name}/refresh`}}cleanAuthData(){localStorage.removeItem(this.prefixStorageKey(O)),localStorage.removeItem(this.prefixStorageKey(N))}goToOAuth(r,t){if(t&&this.cleanAuthData(),localStorage.getItem(this.prefixStorageKey(O)))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 t=function ge(){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(t&&t.includes("?")){const n=new URLSearchParams(t.split("?")[1]),i=n.get("token")||"",s=n.get("refresh")||"";clearInterval(r),i?(localStorage.setItem(this.prefixStorageKey(O),i),localStorage.setItem(this.prefixStorageKey(N),s||""),this.isAuthenticated.next(!0)):this.isAuthenticated.next(!1)}},500)}return this.isAuthenticated.asObservable()}prefixStorageKey(r){return`${this.name}-${this.id}-${r}`}getStaticFolders(){return[]}}const Y="SHAREPOINT_SITE_NAME";class ye extends D{constructor(r,t,n){super(r,t,n)}getParametersSections(){return(0,m.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(Y,r.site_name)}getParametersValues(){return{...super.getParametersValues(),site_name:localStorage.getItem(Y)}}}const fe={id:"confluence",title:"Confluence",logo:`${S}/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 _e},L="CONFLUENCE_TOKEN";class _e{constructor(){this.hasServerSideAuth=!1,this.isExternal=!1,this.allowToSelectFolders=!0,this.canSyncSecurityGroups=!1}getParametersSections(){return(0,m.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(L,r.token)}getParametersValues(){return{token:localStorage.getItem(L)}}goToOAuth(r,t){return(0,m.of)(!0)}cleanAuthData(){throw new Error("Method not implemented.")}authenticate(){return(0,m.of)(!!this.getParametersValues().token)}getStaticFolders(){return[]}}const be={id:"rss",title:"RSS",logo:`${S}/rss.svg`,description:"Upload web pages from a RSS feed",permanentSyncOnly:!0,factory:()=>new Ce};class Ce{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"RSS",originalId:"rss",metadata:{},status:k.PENDING}]}getParametersSections(){return(0,m.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,m.of)(!0)}}var ve=c(5512),Se=c(1626);const J="http://localhost:8090",Q="NUCLIA_SYNC_SERVER",W="NUCLIA_SYNC_SERVER_TYPE";let $=(()=>{class o{constructor(t,n,i,s){this.sdk=t,this.http=n,this.config=i,this.notificationService=s,this.connectors={gdrive:{definition:{id:"gdrive",title:"Google Drive",logo:`${S}/gdrive.svg`,description:"File storage and synchronization service developed by Google",permanentSyncOnly:!0,deprecated:!0,factory:d=>new D("gdrive",d?.id||"",this.config.getOAuthServer())}},onedrive:{definition:{id:"onedrive",title:"One Drive",logo:`${S}/onedrive.svg`,description:"Microsoft OneDrive file hosting service",permanentSyncOnly:!0,deprecated:!0,factory:d=>new D("onedrive",d?.id||"",this.config.getOAuthServer())}},sharepoint:{definition:{id:"sharepoint",title:"SharePoint",logo:`${S}/sharepoint.svg`,description:"Microsoft Sharepoint service",permanentSyncOnly:!0,deprecated:!0,factory:d=>new ye("sharepoint",d?.id||"",this.config.getOAuthServer())}},dropbox:{definition:{id:"dropbox",title:"Dropbox",logo:`${S}/dropbox.svg`,description:"File storage and synchronization service developed by Dropbox",permanentSyncOnly:!0,deprecated:!0,factory:d=>new D("dropbox",d?.id||"",this.config.getOAuthServer())}},folder:{definition:ue},sitemap:{definition:pe},confluence:{definition:fe},rss:{definition:be}},this.connectorsObs=new x.t(Object.values(this.connectors).map(d=>d.definition).filter(d=>!d.deprecated)),this._syncServer=new x.t({serverUrl:localStorage.getItem(Q)||J,type:localStorage.getItem(W)||"desktop"}),this.syncServer=this._syncServer.asObservable(),this._isServerDown=new x.t(!0),this._currentSyncId=new x.t(null),this._syncCache=new x.t({}),this._cacheUpdated=new x.t((new Date).toISOString()),this._isSyncing=new x.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(t){return this.connectors[t]?.definition}getConnector(t,n){const i=this.connectors[t];i.instances||(i.instances={});const s=i.instances;return s[n]||(s[n]=i.definition.factory({id:n})),s[n]}getCurrentSync(){return this.currentSyncId.pipe((0,f.p)(t=>!!t),(0,p.n)(t=>this.getSync(t)))}getSync(t){const n=this._syncCache.getValue();return n[t]?(0,m.of)(n[t]):this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${t}`,{headers:this.serverHeaders}).pipe((0,b.M)(i=>{n[t]=i,this._syncCache.next(n)}))}addSync(t){return this.sdk.currentKb.pipe((0,_.s)(1),(0,p.n)(n=>this.sdk.nuclia.options.standalone?(0,m.of)({...t,kb:{...this.sdk.nuclia.options,knowledgeBox:n.id}}):this.getNucliaKey(n).pipe((0,h.T)(i=>({...t,kb:{zone:this.sdk.nuclia.options.zone,backend:this.sdk.nuclia.options.backend,knowledgeBox:i.kbid,apiKey:i.token}})))),(0,p.n)(n=>this.http.post(`${this._syncServer.getValue().serverUrl}/sync`,n,{headers:this.serverHeaders})),(0,b.M)(()=>{const n=this._syncCache.getValue();n[t.id]=t,this._syncCache.next(n),this._cacheUpdated.next((new Date).toISOString())}),(0,h.T)(()=>{}))}updateSync(t,n,i){return this.http.patch(`${this._syncServer.getValue().serverUrl}/sync/${t}`,{...n,lastSyncGMT:i?"1970-01-01":void 0},{headers:this.serverHeaders}).pipe((0,b.M)(()=>{const s=this._syncCache.getValue();s[t]={...s[t],...n},this._syncCache.next(s),this._cacheUpdated.next((new Date).toISOString())}))}deleteSync(t){return this.http.delete(`${this._syncServer.getValue().serverUrl}/sync/${t}`,{headers:this.serverHeaders}).pipe((0,b.M)(()=>{const n=this._syncCache.getValue();delete n[t],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,h.T)(n=>n.hasAuth)):(0,m.of)(!1)}getSyncsForKB(t){return this.isServerDown.pipe((0,p.n)(n=>n?(0,m.of)([]):this.http.get(`${this._syncServer.getValue().serverUrl}/sync/kb/${t}`).pipe((0,h.T)(i=>i.map(s=>({...s,kbId:t,connectorId:s.connector,connector:this.getConnector(s.connector,"")})).filter(s=>s.kbId===t)))))}getFiles(t){return this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/files/search${t?`?query=${t}`:""}`)}getFolders(t){return this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/folders`,{headers:this.serverHeaders})}canSelectFiles(t){const n=this._syncCache.getValue()[t];return n&&!("sitemap"===n.connector.name||"folder"===n.connector.name||"rss"===n.connector.name)}getNucliaKey(t){return t.createKeyForService({title:"Sync",role:"SCONTRIBUTOR"},this.getExpirationDate()).pipe((0,h.T)(n=>({...n,kbid:t.id})))}getExpirationDate(){const t=new Date;return t.setFullYear(t.getFullYear()+1),Math.floor(t.getTime()/1e3).toString()}serverStatus(t){return this.http.get(`${t}/status`).pipe((0,G.W)(()=>(0,m.of)({running:!1,logs:["Server down"]})),(0,h.T)(n=>((n.logs||[]).forEach(i=>console.log("[SERVER]",i)),{running:n.running})))}setSyncServer(t,n){localStorage.setItem(Q,t||""),localStorage.setItem(W,n),this._syncServer.next({serverUrl:t||"",type:n}),t&&this.serverStatus(t).subscribe(i=>{this.setServerStatus(!i.running)})}authenticateToConnector(t,n){return n.authenticate().pipe((0,f.p)(i=>i),(0,_.s)(1),(0,p.n)(()=>this.updateSync(this.getCurrentSyncId()||"",{connector:{name:t,parameters:n.getParametersValues()}})),(0,h.T)(()=>(n.cleanAuthData(),!0)))}getCurrentSyncId(){return this._currentSyncId.getValue()}setCurrentSyncId(t){this._currentSyncId.next(t)}clearCurrentSourceId(){this._currentSyncId.next(null)}getLogs(t,n){return this.http.get(`${this._syncServer.getValue().serverUrl}/logs${t?"/"+t:""}${n?"/"+n:""}`).pipe((0,h.T)(i=>i.sort((s,d)=>{const T=(0,ve.T)(s.createdAt,d.createdAt);return 0===T?s.action.startsWith("start")?1:-1:T})))}clearLogs(){return this.http.delete(`${this._syncServer.getValue().serverUrl}/logs`)}getSyncServer(){return this._syncServer.getValue().serverUrl}setServerStatus(t){t&&!this._isServerDown.value&&this.notificationService.pushNotifications([{type:"sync-server",data:[],timestamp:(new Date).toISOString(),unread:!0,failure:!0}]),this._isServerDown.next(t)}triggerSync(t,n=!1){return this._isSyncing.next({...this._isSyncing.value,[t]:!0}),(n?this.updateSync(t,{},!0).pipe((0,h.T)(()=>!0)):(0,m.of)(!0)).pipe((0,p.n)(()=>this.http.get(`${this._syncServer.getValue().serverUrl}/sync/execute/${t}`)),(0,b.M)(()=>this._isSyncing.next({...this._isSyncing.value,[t]:!1})),(0,G.W)(s=>(console.warn("Trigger sync failed:",s),this._isSyncing.next({...this._isSyncing.value,[t]:!1}),(0,m.of)())))}static{this.\u0275fac=function(n){return new(n||o)(e.KVO(C.ok),e.KVO(Se.Qq),e.KVO(C.M),e.KVO(C.JE))}}static{this.\u0275prov=e.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),xe=(()=>{class o{constructor(){this.unsubscribeAll=new R.B,this.syncService=(0,e.WQX)($)}ngOnInit(){let t=!1,n=0;(0,le.O)(0,5e3).pipe((0,f.p)(()=>{const s=n>=(t?12:0);return n++,s}),(0,p.n)(()=>this.syncService.serverStatus(this.syncService.getSyncServer())),(0,M.Q)(this.unsubscribeAll)).subscribe(i=>{t=i.running,n=0,this.syncService.setServerStatus(!t)})}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["ng-component"]],decls:1,vars:0,template:function(n,i){1&n&&e.nrm(0,"router-outlet")},dependencies:[y.MD,v.n3],encapsulation:2,changeDetection:0})}}return o})();var a=c(8743),Te=c(9874),E=c(4929);let Fe=(()=>{class o{constructor(){this.title="",this.logo="",this.disabled=!1,this.selectConnector=new e.bkB}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["nsy-connector"]],inputs:{title:"title",logo:"logo",disabled:[2,"disabled","disabled",e.L39]},outputs:{selectConnector:"selectConnector"},features:[e.GFd],decls:5,vars:3,consts:[[3,"cardClick","disabled"],[1,"connector"],["size","large",3,"path"]],template:function(n,i){1&n&&(e.j41(0,"pa-card",0),e.bIt("cardClick",function(d){return i.selectConnector.emit(d)}),e.j41(1,"div",1),e.nrm(2,"pa-icon",2),e.j41(3,"div"),e.EFF(4),e.k0s()()()),2&n&&(e.Y8G("disabled",i.disabled),e.R7$(2),e.Y8G("path",i.logo),e.R7$(2),e.JRh(i.title))},dependencies:[y.MD,a.ALJ,Te.i,a.V3x,E.R],styles:['@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(336, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(336, 100%, 36%));--color-primary-regular: var(--custom-color-primary-regular, hsl(336, 100%, 50%));--color-primary-light: var(--custom-color-primary-light, hsl(336, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(336, 100%, 90%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(336, 100%, 96%));--color-secondary-stronger: hsl(51, 78%, 32%);--color-secondary-strong: hsl(51, 100%, 41%);--color-secondary-regular: hsl(51, 100%, 55%);--color-secondary-light: hsl(51, 100%, 75%);--color-secondary-lighter: hsl(51, 100%, 86%);--color-secondary-lightest: hsl(51, 100%, 95%);--color-tertiary-stronger: hsl(249, 100%, 24%);--color-tertiary-strong: hsl(249, 100%, 40%);--color-tertiary-regular: hsl(249, 100%, 50%);--color-tertiary-light: hsl(249, 100%, 65%);--color-tertiary-lighter: hsl(249, 100%, 92%);--color-tertiary-lightest: hsl(249, 100%, 96%)}.connector[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;gap:.5rem;width:6rem}'],changeDetection:0})}}return o})();var g=c(8018),u=c(3630),l=c(9417),P=c(3606),Ie=c(820),H=c(6812),X=c(3085),A=c(4899),Re=c(7481),Me=c(3257),ke=c(6010),z=c(5472),K=c(9435),Z=c(3107),$e=c(7839),Ee=c(4099),q=c(4684),Pe=c(9122);const ee=(o,r)=>r.id,je=()=>({section:"activity"});function we(o,r){1&o&&(e.j41(0,"nsi-dropdown-button",17),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"sync.home-page.setup-server.on-desktop.download-dropdown")," "))}function Ge(o,r){if(1&o&&(e.j41(0,"nsi-badge"),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.DNE(3,we,3,3,"nsi-dropdown-button",17)),2&o){const t=e.XpG(2);e.R7$(),e.JRh(e.bMT(2,2,"sync.badge.inactive")),e.R7$(2),e.vxM(t.downloadSyncAgentFeature?3:-1)}}function Oe(o,r){1&o&&(e.j41(0,"nsi-badge",16),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"sync.badge.active")))}function De(o,r){if(1&o&&(e.DNE(0,Ge,4,4),e.nI1(1,"async"),e.DNE(2,Oe,3,3,"nsi-badge",16)),2&o){const t=e.XpG();e.vxM(e.bMT(1,1,t.inactiveServer)?0:2)}}function Ne(o,r){1&o&&(e.j41(0,"nsi-badge"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"sync.badge.inactive")))}function Xe(o,r){1&o&&(e.j41(0,"nsi-badge",16),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"sync.badge.active")))}function Ae(o,r){if(1&o&&(e.j41(0,"div",13),e.DNE(1,Ne,3,3,"nsi-badge"),e.nI1(2,"async"),e.DNE(3,Xe,3,3,"nsi-badge",16),e.j41(4,"pa-input",18),e.EFF(5," Server URL "),e.k0s(),e.j41(6,"pa-button",19),e.EFF(7),e.nI1(8,"translate"),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.vxM(e.bMT(2,3,t.inactiveServer)?1:3),e.R7$(5),e.Y8G("disabled",!t.serverUrlChanged),e.R7$(),e.SpI(" ",e.bMT(8,5,"generic.save")," ")}}function Ve(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsy-connector",20),e.nI1(1,"async"),e.nI1(2,"translate"),e.nI1(3,"async"),e.bIt("selectConnector",function(){const i=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.onSelectConnector(i))}),e.k0s()}if(2&o){const t=r.$implicit,n=e.XpG();e.Y8G("paTooltip",e.bMT(2,6,e.bMT(1,4,n.inactiveServer)?"sync.home-page.add-sources.disabled-source-tooltip":""))("disabled",e.bMT(3,8,n.inactiveServer))("title",t.title)("logo",t.logo)}}function Ue(o,r){1&o&&(e.j41(0,"nsi-info-card",21),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"sync.home-page.sync-list.empty-info")))}function Be(o,r){if(1&o&&(e.j41(0,"div",25),e.nrm(1,"pa-icon",33),e.EFF(2),e.k0s()),2&o){const t=r;e.R7$(),e.Y8G("path",t.logo),e.R7$(),e.SpI(" ",t.title," ")}}function Ye(o,r){if(1&o&&e.nrm(0,"pa-datetime",28),2&o){const t=e.XpG().$implicit;e.Y8G("datetime",t.lastSyncGMT)}}function Le(o,r){1&o&&e.EFF(0," \u2013 ")}function Je(o,r){if(1&o&&(e.j41(0,"pa-option",30),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=e.XpG().$implicit;e.Y8G("routerLink","./"+t.id+"/edit"),e.R7$(),e.SpI(" ",e.bMT(2,2,"sync.home-page.sync-list.menu.edit-folders")," ")}}function Qe(o,r){if(1&o){const t=e.RV6();e.j41(0,"pa-table-row")(1,"pa-table-cell")(2,"a",24),e.EFF(3),e.k0s()(),e.j41(4,"pa-table-cell"),e.DNE(5,Be,3,2,"div",25),e.k0s(),e.j41(6,"pa-table-cell")(7,"div",26),e.EFF(8),e.k0s()(),e.j41(9,"pa-table-cell")(10,"pa-toggle",27),e.bIt("valueChange",function(i){const s=e.eBV(t).$implicit,d=e.XpG(3);return e.Njj(d.toggleSync(s.id,i))}),e.EFF(11),e.k0s()(),e.j41(12,"pa-table-cell")(13,"div",26),e.DNE(14,Ye,1,1,"pa-datetime",28)(15,Le,1,0),e.k0s()(),e.j41(16,"pa-table-cell-menu")(17,"pa-button",29),e.EFF(18," Menu "),e.k0s(),e.j41(19,"pa-dropdown",null,0)(21,"pa-option",30),e.EFF(22),e.nI1(23,"translate"),e.k0s(),e.DNE(24,Je,3,4,"pa-option",30),e.j41(25,"pa-option",31),e.EFF(26),e.nI1(27,"translate"),e.k0s(),e.j41(28,"pa-option",32),e.bIt("selectOption",function(){const i=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.deleteSync(i))}),e.EFF(29),e.nI1(30,"translate"),e.k0s()()()()}if(2&o){let t;const n=r.$implicit,i=e.sdS(20),s=e.XpG(3);e.R7$(2),e.Y8G("routerLink","./"+n.id),e.R7$(),e.SpI(" ",n.title," "),e.R7$(2),e.vxM((t=null==s.connectors[n.connectorId]?null:s.connectors[n.connectorId].definition)?5:-1,t),e.R7$(3),e.JRh(n.totalSyncedResources),e.R7$(2),e.Y8G("value",!n.disabled),e.R7$(),e.SpI(" ",n.disabled?"Off":"On"," "),e.R7$(3),e.vxM("1970-01-01"!==n.lastSyncGMT?14:15),e.R7$(3),e.Y8G("paPopup",i),e.R7$(4),e.Y8G("routerLink","./"+n.id+"/edit"),e.R7$(),e.SpI(" ",e.bMT(23,15,"sync.home-page.sync-list.menu.edit-settings")," "),e.R7$(2),e.vxM(n.connector.allowToSelectFolders?24:-1),e.R7$(),e.Y8G("routerLink","./"+n.id)("queryParams",e.lJ4(21,je)),e.R7$(),e.SpI(" ",e.bMT(27,17,"sync.home-page.sync-list.menu.activity-logs")," "),e.R7$(3),e.SpI(" ",e.bMT(30,19,"sync.home-page.sync-list.menu.delete")," ")}}function We(o,r){if(1&o&&(e.j41(0,"pa-table",22),e.nrm(1,"pa-table-sortable-header",23),e.Z7z(2,Qe,31,22,"pa-table-row",null,ee),e.k0s()),2&o){const t=e.XpG(),n=e.XpG();e.R7$(),e.Y8G("cells",n.syncTableHeader),e.R7$(),e.Dyx(t)}}function He(o,r){1&o&&e.DNE(0,Ue,3,3,"nsi-info-card",21)(1,We,4,1,"pa-table",22),2&o&&e.vxM(0===r.length?0:1)}let ze=(()=>{class o{constructor(){this.router=(0,e.WQX)(v.Ix),this.currentRoute=(0,e.WQX)(v.nX),this.syncService=(0,e.WQX)($),this.sdk=(0,e.WQX)(C.ok),this.toaster=(0,e.WQX)(u._g),this.modalService=(0,e.WQX)(u.w8),this.translate=(0,e.WQX)(g.c$),this.unsubscribeAll=new R.B,this.downloadSyncAgentFeature=!1,this.inactiveServer=this.syncService.isServerDown,this.syncAgentForm=new l.gE({type:new l.MJ("desktop",{nonNullable:!0}),serverUrl:new l.MJ("",{nonNullable:!0,validators:[l.k0.required]})}),this.connectors=this.syncService.connectors,this.connectorList=this.syncService.connectorsObs.pipe((0,h.T)(t=>t.sort((n,i)=>n.title.localeCompare(i.title)))),this.serverUrlBackup="",this.syncs=this.syncService.cacheUpdated.pipe((0,p.n)(()=>this.sdk.currentKb),(0,p.n)(t=>this.syncService.getSyncsForKB(t.id))),this.syncTableHeader=[new a.A3f({id:"name",label:"sync.home-page.sync-list.table-columns.name"}),new a.A3f({id:"connector",label:"sync.home-page.sync-list.table-columns.connector"}),new a.A3f({id:"resources",label:"sync.home-page.sync-list.table-columns.resources"}),new a.A3f({id:"sync",label:"sync.home-page.sync-list.table-columns.sync"}),new a.A3f({id:"latest-sync",label:"sync.home-page.sync-list.table-columns.latest-sync",sortable:!0}),new a.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(t=>{this.syncAgentForm.patchValue(t),this.serverUrlBackup=t.serverUrl}),this.syncAgentTypeControl.valueChanges.pipe((0,M.Q)(this.unsubscribeAll)).subscribe(()=>this.saveSyncServer())}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}saveSyncServer(){if(this.syncAgentForm.valid){const t=this.syncAgentForm.getRawValue();this.syncService.setSyncServer("server"===t.type?t.serverUrl:J,t.type)}}onSelectConnector(t){this.router.navigate(["./add",t.id],{relativeTo:this.currentRoute})}deleteSync(t){this.modalService.openConfirm({title:this.translate.instant("sync.confirm.deletion.title",{title:t.title}),description:"sync.confirm.deletion.description",isDestructive:!0,confirmLabel:"generic.delete"}).onClose.pipe((0,f.p)(n=>!!n),(0,p.n)(()=>this.syncService.deleteSync(t.id))).subscribe({error:()=>this.toaster.error("sync.details.toast.deletion-failed")})}toggleSync(t,n){this.syncService.updateSync(t,{disabled:!n}).subscribe({error:()=>this.toaster.error(n?"sync.details.toast.activating-failed":"sync.details.toast.disabling-failed")})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.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&&(e.j41(0,"div",1)(1,"div")(2,"h1",2),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p",3),e.EFF(6),e.nI1(7,"translate"),e.k0s()(),e.j41(8,"section")(9,"div",4)(10,"div",5),e.EFF(11),e.nI1(12,"translate"),e.k0s(),e.j41(13,"div",3),e.EFF(14),e.nI1(15,"translate"),e.k0s()(),e.j41(16,"form",6),e.bIt("ngSubmit",function(){return i.saveSyncServer()}),e.j41(17,"pa-radio-group",7)(18,"div",8)(19,"pa-radio",9),e.nI1(20,"translate"),e.j41(21,"span",10),e.EFF(22),e.nI1(23,"translate"),e.k0s()(),e.DNE(24,De,3,3),e.k0s(),e.nrm(25,"div",11),e.j41(26,"div",8)(27,"pa-radio",12),e.nI1(28,"translate"),e.j41(29,"span",10),e.EFF(30),e.nI1(31,"translate"),e.k0s()(),e.DNE(32,Ae,9,7,"div",13),e.k0s()()()(),e.nrm(33,"div",11),e.j41(34,"section")(35,"div",4)(36,"div",5),e.EFF(37),e.nI1(38,"translate"),e.k0s(),e.j41(39,"div",3),e.EFF(40),e.nI1(41,"translate"),e.k0s()(),e.j41(42,"div",14),e.Z7z(43,Ve,4,10,"nsy-connector",15,ee),e.nI1(45,"async"),e.k0s()(),e.j41(46,"section")(47,"div",4)(48,"div",5),e.EFF(49),e.nI1(50,"translate"),e.k0s(),e.j41(51,"div",3),e.EFF(52),e.nI1(53,"translate"),e.k0s()(),e.DNE(54,He,2,1),e.nI1(55,"async"),e.k0s()()),2&n){let s;e.R7$(3),e.JRh(e.bMT(4,16,"navbar.sync")),e.R7$(3),e.JRh(e.bMT(7,18,"sync.home-page.description")),e.R7$(5),e.JRh(e.bMT(12,20,"sync.home-page.setup-server.title")),e.R7$(3),e.JRh(e.bMT(15,22,"sync.home-page.setup-server.description")),e.R7$(2),e.Y8G("formGroup",i.syncAgentForm),e.R7$(3),e.Y8G("help",e.bMT(20,24,"sync.home-page.setup-server.on-desktop.radio-help")),e.R7$(3),e.JRh(e.bMT(23,26,"sync.home-page.setup-server.on-desktop.radio-label")),e.R7$(2),e.vxM(i.syncAgentOnServer?-1:24),e.R7$(3),e.Y8G("help",e.bMT(28,28,"sync.home-page.setup-server.on-server.radio-help")),e.R7$(3),e.JRh(e.bMT(31,30,"sync.home-page.setup-server.on-server.radio-label")),e.R7$(2),e.vxM(i.syncAgentOnServer?32:-1),e.R7$(5),e.JRh(e.bMT(38,32,"sync.home-page.add-sources.title")),e.R7$(3),e.JRh(e.bMT(41,34,"sync.home-page.add-sources.description")),e.R7$(3),e.Dyx(e.bMT(45,36,i.connectorList)),e.R7$(6),e.JRh(e.bMT(50,38,"sync.home-page.sync-list.title")),e.R7$(3),e.JRh(e.bMT(53,40,"sync.home-page.sync-list.description")),e.R7$(2),e.vxM((s=e.bMT(55,42,i.syncs))?54:-1,s)}},dependencies:[y.MD,y.Jj,u.nS,Fe,u.vY,a.Ymm,P.Q,a.Rx2,Ie.P,H.P,a.XgI,X.S,a.rkm,A.a,Re.v,Me.u,a.tml,ke.d,l.X1,l.qT,l.BC,l.cb,l.j4,l.JD,g.h,g.D9,a.EGN,z.O,K.e,Z.U,$e.N,Ee.V,v.Wk,a.V3x,E.R,a.Pa6,q.Z,u.IA,a.OgD,Pe.w],styles:['@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(336, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(336, 100%, 36%));--color-primary-regular: var(--custom-color-primary-regular, hsl(336, 100%, 50%));--color-primary-light: var(--custom-color-primary-light, hsl(336, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(336, 100%, 90%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(336, 100%, 96%));--color-secondary-stronger: hsl(51, 78%, 32%);--color-secondary-strong: hsl(51, 100%, 41%);--color-secondary-regular: hsl(51, 100%, 55%);--color-secondary-light: hsl(51, 100%, 75%);--color-secondary-lighter: hsl(51, 100%, 86%);--color-secondary-lightest: hsl(51, 100%, 95%);--color-tertiary-stronger: hsl(249, 100%, 24%);--color-tertiary-strong: hsl(249, 100%, 40%);--color-tertiary-regular: hsl(249, 100%, 50%);--color-tertiary-light: hsl(249, 100%, 65%);--color-tertiary-lighter: hsl(249, 100%, 92%);--color-tertiary-lightest: hsl(249, 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 Ke=c(8989),Ze=c(4418),qe=c(6851),et=c(2071),tt=c(5814),nt=c(9285),te=c(6420);const ne=(o,r)=>r.id,ot=(o,r)=>r.value,it=()=>[];function rt(o,r){if(1&o&&(e.j41(0,"pa-input",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=e.XpG().$implicit;e.Y8G("formControlName",t.id)("placeholder",t.placeholder)("help",t.help),e.R7$(),e.SpI(" ",e.bMT(2,4,t.label)," ")}}function st(o,r){if(1&o&&(e.j41(0,"pa-toggle",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=e.XpG().$implicit;e.Y8G("formControlName",t.id)("help",t.help),e.R7$(),e.SpI(" ",e.bMT(2,3,t.label)," ")}}function ct(o,r){if(1&o&&(e.j41(0,"pa-option",32),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=r.$implicit;e.Y8G("disabled",t.disabled)("value",t.value),e.R7$(),e.SpI(" ",e.bMT(2,3,t.label)," ")}}function at(o,r){if(1&o&&(e.j41(0,"pa-select",30),e.Z7z(1,ct,3,5,"pa-option",32,ot),e.k0s()),2&o){const t=e.XpG().$implicit;e.Y8G("formControlName",t.id)("label",t.label)("help",t.help),e.R7$(),e.Dyx(t.options)}}function lt(o,r){if(1&o&&(e.j41(0,"pa-textarea",29),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.Y8G("formControlName",t.id)("help",t.help),e.R7$(),e.SpI(" ",t.label," ")}}function dt(o,r){if(1&o&&(e.j41(0,"p"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(e.bMT(2,1,t.help))}}function pt(o,r){1&o&&(e.j41(0,"nsi-info-card",34),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"sync.form-validation.extra-parameters-incomplete")," "))}function ht(o,r){if(1&o){const t=e.RV6();e.j41(0,"div",31)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,dt,3,3,"p"),e.j41(5,"app-parameters-table",33),e.bIt("valuesChange",function(i){e.eBV(t);const s=e.XpG().$implicit,d=e.XpG(3);return e.Njj(d.updateTable(s.id,i))}),e.k0s(),e.DNE(6,pt,3,3,"nsi-info-card",34),e.k0s()}if(2&o){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(2),e.JRh(e.bMT(3,4,t.label)),e.R7$(2),e.vxM(t.help?4:-1),e.R7$(),e.Y8G("values",n.tables[t.id]||e.lJ4(6,it)),e.R7$(),e.vxM(n.invalidTables.includes(t.id)?6:-1)}}function ut(o,r){if(1&o&&e.DNE(0,rt,3,6,"pa-input",28)(1,st,3,5,"pa-toggle",29)(2,at,3,3,"pa-select",30)(3,lt,2,3,"pa-textarea",29)(4,ht,7,7,"div",31),2&o){let t;e.vxM("text"===(t=r.$implicit.type)?0:"boolean"===t?1:"select"===t?2:"textarea"===t?3:"table"===t?4:-1)}}function mt(o,r){if(1&o&&(e.j41(0,"nsi-two-columns-configuration-item",5)(1,"div",2),e.Z7z(2,ut,5,1,null,null,ne),e.k0s()()),2&o){const t=r.$implicit;e.Y8G("badge",t.badge)("itemTitle",t.title)("description",t.description||""),e.R7$(2),e.Dyx(t.fields)}}function gt(o,r){1&o&&(e.j41(0,"nsi-two-columns-configuration-item",9)(1,"div",7)(2,"pa-toggle",35),e.EFF(3),e.nI1(4,"translate"),e.k0s()()()),2&o&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"sync.add-page.security-group.toggle-label")," "))}function yt(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsi-label",36),e.bIt("removeLabel",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.removeLabel(i))}),e.EFF(1),e.k0s()}if(2&o){const t=r.$implicit;e.Y8G("color",t.color),e.R7$(),e.SpI(" ",t.label," ")}}function ft(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsi-label",37),e.bIt("removeLabel",function(){const i=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.removeExtension(i))}),e.EFF(1),e.k0s()}if(2&o){const t=r.$implicit;e.R7$(),e.SpI(" ",t," ")}}function _t(o,r){if(1&o){const t=e.RV6();e.j41(0,"form",0)(1,"nsi-two-columns-configuration-item",1)(2,"div",2)(3,"pa-input",3),e.EFF(4),e.nI1(5,"translate"),e.k0s()()(),e.qex(6,4),e.Z7z(7,mt,4,3,"nsi-two-columns-configuration-item",5,ne),e.nI1(9,"async"),e.bVm(),e.j41(10,"nsi-two-columns-configuration-item",6)(11,"div",7)(12,"app-extraction-select",8),e.bIt("configIdChange",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.updateExtractStrategy(i))}),e.k0s()()(),e.DNE(13,gt,5,3,"nsi-two-columns-configuration-item",9),e.j41(14,"nsi-two-columns-configuration-item",10)(15,"div",2)(16,"div",11)(17,"app-label-dropdown",12),e.nI1(18,"async"),e.nI1(19,"async"),e.bIt("selectionChange",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.updateLabelSelection(i))}),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"span",13),e.EFF(23),e.nI1(24,"translate"),e.k0s(),e.j41(25,"pa-button",14),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.createLabelSet())}),e.EFF(26),e.nI1(27,"translate"),e.k0s()(),e.j41(28,"div",15),e.Z7z(29,yt,2,2,"nsi-label",16,e.fX1),e.k0s()()(),e.j41(31,"nsi-two-columns-configuration-item",17)(32,"div",2)(33,"nsi-info-card"),e.EFF(34),e.nI1(35,"translate"),e.k0s(),e.j41(36,"div",18)(37,"div",19)(38,"pa-select",20)(39,"pa-option",21),e.EFF(40),e.nI1(41,"translate"),e.k0s(),e.j41(42,"pa-option",22),e.EFF(43),e.nI1(44,"translate"),e.k0s()(),e.j41(45,"pa-input",23),e.EFF(46),e.nI1(47,"translate"),e.k0s()(),e.j41(48,"div",15),e.Z7z(49,ft,2,1,"nsi-label",24,e.fX1),e.k0s(),e.j41(51,"div",25)(52,"label"),e.EFF(53),e.nI1(54,"translate"),e.k0s(),e.j41(55,"div",19),e.nrm(56,"pa-date-picker",26),e.nI1(57,"translate"),e.nrm(58,"pa-date-picker",27),e.nI1(59,"translate"),e.k0s()()()()()()}if(2&o){const t=e.XpG();e.Y8G("formGroup",t.form),e.R7$(),e.Y8G("noTopBorder",t.noTopBorder),e.R7$(3),e.JRh(e.bMT(5,18,"sync.add-page.connector-name.field-label")),e.R7$(3),e.Dyx(e.bMT(9,20,t.connector.getParametersSections())),e.R7$(5),e.Y8G("configId",t.extractStrategy),e.R7$(),e.vxM(t.connector.canSyncSecurityGroups?13:-1),e.R7$(4),e.Y8G("labelSets",e.bMT(18,22,t.labelSets))("selection",t.labelSelection)("disabled",!1===e.bMT(19,24,t.hasLabelSet)),e.R7$(3),e.SpI(" ",e.bMT(21,26,"sync.add-page.add-labels.select-labels")," "),e.R7$(3),e.JRh(e.bMT(24,28,"generic.or")),e.R7$(3),e.SpI(" ",e.bMT(27,30,"sync.add-page.add-labels.create-labelset")," "),e.R7$(3),e.Dyx(t.labelSelection),e.R7$(5),e.JRh(e.bMT(35,32,"sync.add-page.filter-resources.file-extension.info")),e.R7$(6),e.SpI(" ",e.bMT(41,34,"sync.add-page.filter-resources.file-extension.include")," "),e.R7$(3),e.SpI(" ",e.bMT(44,36,"sync.add-page.filter-resources.file-extension.exclude")," "),e.R7$(3),e.SpI(" ",e.bMT(47,38,"sync.add-page.filter-resources.file-extension.label")," "),e.R7$(3),e.Dyx(t.extensionList),e.R7$(4),e.JRh(e.bMT(54,40,"sync.add-page.filter-resources.modification-date.label")),e.R7$(3),e.Y8G("label",e.bMT(57,42,"sync.add-page.filter-resources.modification-date.from")),e.R7$(2),e.Y8G("label",e.bMT(59,44,"sync.add-page.filter-resources.modification-date.to"))}}const bt=new RegExp(/[^a-z0-9_-]/g);let oe=(()=>{class o{constructor(){this.labelService=(0,e.WQX)(C.xQ),this.modalService=(0,e.WQX)(u.w8),this.cdr=(0,e.WQX)(e.gRc),this.unsubscribeAll=new R.B,this.noTopBorder=!1,this.validForm=new e.bkB,this.configurationChange=new e.bkB,this.form=new l.gE({name:new l.MJ("",{nonNullable:!0,validators:[l.k0.required]}),syncSecurityGroups:new l.MJ(null),filterResources:new l.gE({extensions:new l.MJ("",{updateOn:"blur"}),extensionUsage:new l.MJ("include",{nonNullable:!0}),from:new l.MJ(""),to:new l.MJ("")}),extra:new l.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(t){if(t){this.connectorParametersBackup=t.connector.parameters;const n={extensions:t.filters?.fileExtensions?.extensions||"",extensionUsage:t.filters?.fileExtensions?.exclude?"exclude":"include",from:t.filters?.modified?.from||"",to:t.filters?.modified?.to||""};this.form.patchValue({name:t.title,syncSecurityGroups:t.syncSecurityGroups,filterResources:n}),this.labelSelection=t.labels||[],this.extensionList=this.formatExtensionList(n.extensions),t.extract_strategy&&(this.extractStrategy=t.extract_strategy),t.connector.parameters&&Object.entries(t.connector.parameters).forEach(([i,s])=>{"object"!=typeof s?this._extra[i]=s:this.tables[i]=s})}}get extensionsControl(){return this.form.controls.filterResources.controls.extensions}ngOnInit(){this.connector&&this.connector.getParametersSections().subscribe(t=>{t.forEach(n=>n.fields.forEach(i=>{"table"!==i.type&&this.form.controls.extra.addControl(i.id,new l.MJ("",{nonNullable:!0,validators:i.required?[l.k0.required]:[]}))})),Object.keys(this._extra).length>0&&this.form.patchValue({extra:this._extra})}),this.extensionsControl.valueChanges.pipe((0,M.Q)(this.unsubscribeAll)).subscribe(t=>this.extensionList=this.formatExtensionList(t)),this.form.valueChanges.pipe((0,M.Q)(this.unsubscribeAll)).subscribe(()=>{this.validForm.emit(this.form.valid),this.emitSyncEntity()})}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}updateTable(t,n){this.tables[t]=n,n.some(i=>!(i.value.trim()&&i.key.trim()||!i.value.trim()&&!i.key.trim()))?this.invalidTables.includes(t)||this.invalidTables.push(t):this.invalidTables.includes(t)&&(this.invalidTables=this.invalidTables.filter(i=>i!==t)),this.cdr.markForCheck(),this.emitSyncEntity()}createLabelSet(){this.modalService.openModal(C.Tv,new a.S6u({data:{kind:Ke.po.RESOURCES}}))}updateLabelSelection(t){this.labelSets.pipe((0,_.s)(1),(0,f.p)(n=>!!n),(0,h.T)(n=>n)).subscribe(n=>{this.labelSelection=t.map(i=>({...i,color:n[i.labelset]?.color})),this.emitSyncEntity()})}removeExtension(t){const n=this.extensionList.filter(i=>i!==t);this.extensionsControl.patchValue(n.join(", "))}removeLabel(t){this.labelSelection=this.labelSelection.filter(n=>!(n.labelset===t.labelset&&n.label===t.label)),this.emitSyncEntity()}formatExtensionList(t){return t&&t.length>0?t.split(",").map(n=>n.trim()).filter(n=>!!n):[]}emitSyncEntity(){if(!this.connectorId)return;const t=this.form.getRawValue(),n=t.name,i=(Math.random()+1).toString(36).substring(7),s=`${this.kbId}-${n?.toLowerCase().replace(bt,"-")}-${i}`,d={fileExtensions:t.filterResources.extensions?{extensions:t.filterResources.extensions,exclude:"exclude"===t.filterResources.extensionUsage}:void 0,modified:t.filterResources.from||t.filterResources.to?{from:t.filterResources.from||void 0,to:t.filterResources.to||void 0}:void 0},T=Object.entries(t.extra||{}).reduce((j,[w,U])=>({...j,[w]:U}),{}),F=Object.entries(this.tables).reduce((j,[w,U])=>(j[w]=U.filter(ae=>!(!ae.key.trim()||!ae.value.trim())),j),{}),I={id:s,title:n,labels:this.labelSelection,filters:d,connector:{name:this.connectorId,parameters:{...this.connectorParametersBackup,...F,...T}}};null!==t.syncSecurityGroups&&(I.syncSecurityGroups=t.syncSecurityGroups),I.extract_strategy=this.extractStrategy,this.configurationChange.emit(I)}updateExtractStrategy(t){this.extractStrategy=t,this.validForm.emit(this.form.valid),this.emitSyncEntity()}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["nsy-configuration-form"]],inputs:{connector:"connector",connectorId:"connectorId",kbId:"kbId",sync:"sync",noTopBorder:[2,"noTopBorder","noTopBorder",e.L39]},outputs:{validForm:"validForm",configurationChange:"configurationChange"},features:[e.GFd],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,"configIdChange","configId"],["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"],["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"],["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&&e.DNE(0,_t,60,46,"form",0),2&n&&e.vxM(i.connector?0:-1)},dependencies:[y.MD,y.Jj,u.IA,u._8,l.X1,l.qT,l.BC,l.cb,l.j4,l.JD,l.$R,a.XgI,X.S,qe.w,et.Q,H.P,C.Qy,C.Bo,tt.L,a.Ymm,P.Q,g.h,g.D9,a.OYn,nt.I,u.OE,te.U,a.rkm,A.a,Ze.RxD],styles:['@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(336, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(336, 100%, 36%));--color-primary-regular: var(--custom-color-primary-regular, hsl(336, 100%, 50%));--color-primary-light: var(--custom-color-primary-light, hsl(336, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(336, 100%, 90%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(336, 100%, 96%));--color-secondary-stronger: hsl(51, 78%, 32%);--color-secondary-strong: hsl(51, 100%, 41%);--color-secondary-regular: hsl(51, 100%, 55%);--color-secondary-light: hsl(51, 100%, 75%);--color-secondary-lighter: hsl(51, 100%, 86%);--color-secondary-lightest: hsl(51, 100%, 95%);--color-tertiary-stronger: hsl(249, 100%, 24%);--color-tertiary-strong: hsl(249, 100%, 40%);--color-tertiary-regular: hsl(249, 100%, 50%);--color-tertiary-light: hsl(249, 100%, 65%);--color-tertiary-lighter: hsl(249, 100%, 92%);--color-tertiary-lightest: hsl(249, 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 Ct=c(1943),ie=c(7670);const vt=o=>({total:o}),St=o=>({count:o});function xt(o,r){1&o&&e.nrm(0,"nsi-spinner")}function Tt(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsi-folder-tree",3),e.bIt("selectionChange",function(i){e.eBV(t);const s=e.XpG(2);return e.Njj(s.updateSelection(i))}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("selection",t.selection)("folderTree",t.folders)}}function Ft(o,r){if(1&o&&e.nrm(0,"nsi-folder-list",2),2&o){const t=e.XpG(2);e.Y8G("folders",t.selectedPaths)}}function It(o,r){if(1&o&&e.DNE(0,Tt,1,2,"nsi-folder-tree",1)(1,Ft,1,1,"nsi-folder-list",2),2&o){const t=e.XpG();e.vxM(t.seeAll?0:1)}}let V=(()=>{class o{constructor(){this.syncService=(0,e.WQX)($),this.toaster=(0,e.WQX)(u._g),this.cdr=(0,e.WQX)(e.gRc),this.selectedSyncItems=new e.bkB,this.searchQuery=new l.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(t=>({id:t.uuid,path:t.metadata.path}))),this.loadFolders()}updateView(t){this.seeAll="left"===t}updateSelection(t){this.selection=t,this.selectedPaths=t.map(n=>n.path),this.selectedIds=t.map(n=>n.id),this.selectionCount=t.length,this.selectedSyncItems.emit(this.syncItems.filter(n=>this.selectedIds.includes(n.uuid))),this.cdr.markForCheck()}loadFolders(t){this.loading=!0,this.syncService.getFolders(t?.value||"").pipe((0,G.W)(n=>(n&&this.toaster.error("string"==typeof n?n:n.error?.message||n.error||n.message||"An error occurred"),(0,m.of)({items:[],nextPage:void 0}))),(0,Ct.S)((n,i)=>n.concat(i.items),[]),(0,h.T)(n=>[{uuid:"root",originalId:"/",title:"/",status:k.PENDING,metadata:{path:"/"}},...n]),(0,h.T)(n=>n.sort((i,s)=>i.metadata.path.localeCompare(s.metadata.path))),(0,b.M)(n=>{this.totalFolders=n.length,this.syncItems=n}),(0,h.T)(n=>this.getFolderTreeFromSyncItems(n))).subscribe({next:n=>{this.loading=!1,this.folders=n,this.cdr.markForCheck()}})}getFolderTreeFromSyncItems(t){const n={id:"root",path:"/",title:"/",expanded:!0,children:{}};return t.filter(i=>"root"!==i.uuid).forEach(i=>{const s=i.metadata.path,d=i.originalId,T={id:d,title:i.title,path:s,displayPath:i.metadata.displayPath||s,children:{}};if("/"===s)n.children[d]=T;else{let I,F=n;s.split("/").slice(1,-1).forEach(w=>{F&&(I=F.children?.[w],I&&(F=I))}),F.children?F.children[d]=T:F.children={[d]:T}}}),n}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.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&&(e.j41(0,"header"),e.nrm(1,"div"),e.j41(2,"nsi-segmented-buttons",0),e.nI1(3,"translate"),e.nI1(4,"translate"),e.bIt("activeChange",function(d){return i.updateView(d)}),e.k0s()(),e.DNE(5,xt,1,0,"nsi-spinner")(6,It,2,1)),2&n&&(e.R7$(2),e.Y8G("leftButton",e.i5U(3,4,"sync.folder-selection.see-all",e.eq3(10,vt,i.totalFolders)))("rightButton",e.i5U(4,7,"sync.folder-selection.see-selection",e.eq3(12,St,i.selectionCount))),e.R7$(3),e.vxM(i.loading?5:-1),e.R7$(),e.vxM(i.folders?6:-1))},dependencies:[y.MD,u.Sq,u.sH,a.Ymm,a.XgI,l.X1,u.vI,u.J4,ie.t,g.h,g.D9],styles:['@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(336, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(336, 100%, 36%));--color-primary-regular: var(--custom-color-primary-regular, hsl(336, 100%, 50%));--color-primary-light: var(--custom-color-primary-light, hsl(336, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(336, 100%, 90%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(336, 100%, 96%));--color-secondary-stronger: hsl(51, 78%, 32%);--color-secondary-strong: hsl(51, 100%, 41%);--color-secondary-regular: hsl(51, 100%, 55%);--color-secondary-light: hsl(51, 100%, 75%);--color-secondary-lighter: hsl(51, 100%, 86%);--color-secondary-lightest: hsl(51, 100%, 95%);--color-tertiary-stronger: hsl(249, 100%, 24%);--color-tertiary-strong: hsl(249, 100%, 40%);--color-tertiary-regular: hsl(249, 100%, 50%);--color-tertiary-light: hsl(249, 100%, 65%);--color-tertiary-lighter: hsl(249, 100%, 92%);--color-tertiary-lightest: hsl(249, 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 Rt=o=>({connector:o}),Mt=(o,r)=>({index:o,total:r});function kt(o,r){if(1&o&&(e.j41(0,"div")(1,"h1",2),e.nrm(2,"pa-icon",3),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p",4),e.EFF(6),e.nI1(7,"translate"),e.k0s()()),2&o){const t=r,n=e.XpG();e.R7$(2),e.Y8G("path",t.logo),e.R7$(),e.SpI(" ",e.i5U(4,3,"sync.add-page.title",e.eq3(8,Rt,t.title))," "),e.R7$(3),e.JRh(e.bMT(7,6,"sync.add-page.description."+n))}}function $t(o,r){if(1&o&&(e.DNE(0,kt,8,10,"div"),e.nI1(1,"async")),2&o){let t;const n=e.XpG();e.vxM((t=e.bMT(1,1,n.connectorDefinition))?0:-1,t)}}function Et(o,r){1&o&&e.nrm(0,"nsi-spinner")}function Pt(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsy-configuration-form",6),e.nI1(1,"async"),e.nI1(2,"async"),e.bIt("configurationChange",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.updateConfiguration(i))})("validForm",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.validForm=i)}),e.k0s()}if(2&o){const t=e.XpG(2),n=e.XpG();e.Y8G("sync",n.sync)("kbId",e.bMT(1,4,n.kbId))("connector",t)("connectorId",e.bMT(2,6,n.connectorId))}}function jt(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsy-folder-selection",8),e.bIt("selectedSyncItems",function(i){e.eBV(t);const s=e.XpG(4);return e.Njj(s.updateSelection(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("sync",t.sync)}}function wt(o,r){if(1&o&&e.DNE(0,jt,1,1,"nsy-folder-selection",7),2&o){const t=e.XpG(3);e.vxM(t.sync?0:-1)}}function Gt(o,r){if(1&o&&(e.EFF(0),e.nI1(1,"translate")),2&o){const t=e.XpG(),n=e.XpG(3);e.SpI(" ",e.i5U(1,1,"sync.add-page.footer.steps",e.l_i(4,Mt,n.step(),t.length))," ")}}function Ot(o,r){if(1&o){const t=e.RV6();e.j41(0,"pa-button",12),e.bIt("click",function(){e.eBV(t);const i=e.XpG(4);return e.Njj(i.cancel())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"generic.cancel")," "))}function Dt(o,r){if(1&o){const t=e.RV6();e.j41(0,"pa-button",12),e.bIt("click",function(){e.eBV(t);const i=e.XpG(4);return e.Njj(i.goBack())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&o&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"generic.back")," "))}function Nt(o,r){if(1&o){const t=e.RV6();e.j41(0,"pa-button",13),e.bIt("click",function(){e.eBV(t);const i=e.XpG(4);return e.Njj(i.goNext())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("disabled",!t.validForm||t.saving),e.R7$(),e.SpI(" ",e.bMT(2,2,"sync.add-page.footer.folder-selection-button")," ")}}function Xt(o,r){if(1&o){const t=e.RV6();e.j41(0,"pa-button",13),e.bIt("click",function(){e.eBV(t);const i=e.XpG(4);return e.Njj(i.save())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&o){const t=e.XpG(3),n=e.XpG();e.Y8G("disabled",!n.validForm||t.allowToSelectFolders&&0===n.folderSelection.length||n.saving),e.R7$(),e.SpI(" ",e.bMT(2,2,"sync.add-page.footer.save-button")," ")}}function At(o,r){if(1&o&&(e.j41(0,"nsi-sticky-footer")(1,"div",9),e.DNE(2,Gt,2,7),e.k0s(),e.DNE(3,Ot,3,3,"pa-button",10)(4,Dt,3,3,"pa-button",10)(5,Nt,3,4,"pa-button",11)(6,Xt,3,4,"pa-button",11),e.k0s()),2&o){const t=r,n=e.XpG(3);e.R7$(2),e.vxM(t.length>1?2:-1),e.R7$(),e.vxM(1===n.step()?3:4),e.R7$(2),e.vxM(t.length>1&&n.step()<t.length?5:6)}}function Vt(o,r){if(1&o&&(e.DNE(0,Pt,3,8,"nsy-configuration-form",5)(1,wt,1,1)(2,At,7,3,"nsi-sticky-footer"),e.nI1(3,"async")),2&o){let t,n;const i=e.XpG(2);e.vxM(1===(t=i.step())?0:2===t?1:-1),e.R7$(2),e.vxM((n=e.bMT(3,2,i.steps))?2:-1,n)}}function Ut(o,r){if(1&o&&(e.j41(0,"div"),e.DNE(1,Et,1,0,"nsi-spinner")(2,Vt,4,4),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.loading?1:2)}}let re=(()=>{class o{constructor(){this.router=(0,e.WQX)(v.Ix),this.currentRoute=(0,e.WQX)(v.nX),this.sdk=(0,e.WQX)(C.ok),this.syncService=(0,e.WQX)($),this.modalService=(0,e.WQX)(u.w8),this.translate=(0,e.WQX)(g.c$),this.toaster=(0,e.WQX)(u._g),this.cdr=(0,e.WQX)(e.gRc),this.connectorId=this.currentRoute.params.pipe((0,f.p)(t=>t.connector),(0,h.T)(t=>t.connector)),this.connectorDefinition=this.connectorId.pipe((0,h.T)(t=>this.syncService.getConnectorDefinition(t))),this.connector=this.connectorId.pipe((0,h.T)(t=>this.syncService.getConnector(t,""))),this.kbId=this.sdk.currentKb.pipe((0,h.T)(t=>t.id)),this.steps=this.connector.pipe((0,h.T)(t=>t.allowToSelectFolders?["configuration","folder-selection"]:["configuration"])),this.stepIndex=(0,e.vPA)(0),this.step=(0,e.EWP)(()=>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)(t=>!!t.syncId),(0,_.s)(1),(0,b.M)(t=>{this.loading=!0,this.cdr.markForCheck(),this.syncId=t.syncId,this.syncService.setCurrentSyncId(this.syncId),this.validForm=!0}),(0,p.n)(()=>this.syncService.getSync(this.syncId)),(0,b.M)(t=>{this.sync=t,this.configuration=t,this.cdr.markForCheck()}),(0,p.n)(t=>this.syncService.hasCurrentSourceAuth().pipe((0,b.M)(n=>{n&&(this.loading=!1,this.cdr.markForCheck())}),(0,f.p)(n=>!n),(0,h.T)(()=>this.syncService.getConnector(t.connector.name,t.id)),(0,p.n)(n=>this.syncService.authenticateToConnector(t.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(t=>t-1)}goNext(){if(!this.configuration)return;const t=this.configuration;this.syncId?this._goNext():this.connectorDefinition.pipe((0,_.s)(1),(0,p.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,p.n)(()=>this._createSync(t)),(0,p.n)(n=>this._onSuccessfulCreation(n,t))).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)(t=>!!t),(0,p.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 t=this.configuration;if(this.syncId){if(this.folderSelection.length>0){const n=this.syncId;this.syncService.updateSync(n,{foldersToSync:this.folderSelection},!0).pipe((0,p.n)(()=>this._syncCreationDone(n))).subscribe({error:i=>this._errorHandler(i)})}}else this._createSync(t).pipe((0,p.n)(n=>this._onSuccessfulCreation(n,t))).subscribe({error:n=>this._errorHandler(n)})}updateConfiguration(t){this.configuration=t}updateSelection(t){this.folderSelection=t}_goNext(){this.steps.pipe((0,_.s)(1)).subscribe(t=>{this.stepIndex()<t.length&&this.stepIndex.update(n=>n+1)})}_createSync(t){return this.syncService.addSync(t).pipe((0,b.M)(()=>this.syncService.setCurrentSyncId(t.id)),(0,h.T)(()=>this.syncService.getConnector(t.connector.name,t.id)),(0,p.n)(n=>n.allowToSelectFolders?(0,m.of)(n):("function"==typeof n.handleParameters&&n.handleParameters(t.connector.parameters),this.syncService.updateSync(t.id,{foldersToSync:n.getStaticFolders()}).pipe((0,h.T)(()=>this.syncService.getConnector(t.connector.name,t.id))))))}_onSuccessfulCreation(t,n){if(t.hasServerSideAuth){let i=location.href.split("/sync/add/")[0];return this.sdk.nuclia.options.standalone&&(i=i.replace("#/","")),t.goToOAuth(`${i}/sync/add/${n.connector.name}/${n.id}`,!0),(0,m.of)()}return this._syncCreationDone(n.id)}_syncCreationDone(t){return(0,m.of)(!0).pipe((0,b.M)(()=>{this.router.navigate([this.syncId?`../../../${t}`:`../../${t}`],{relativeTo:this.currentRoute})}),(0,p.n)(()=>(this.toaster.success("sync.details.toast.triggering-sync-success"),this.syncService.triggerSync(t).pipe((0,G.W)(()=>(this.toaster.error("sync.details.toast.triggering-sync-failed"),(0,m.of)()))))))}_errorHandler(t){this.saving=!1,console.warn(t),this.toaster.error("sync.add-page.toast.generic-error")}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.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&&(e.j41(0,"div",0)(1,"nsi-back-button",1),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,$t,2,3),e.nI1(5,"async"),e.DNE(6,Ut,3,1,"div"),e.nI1(7,"async"),e.k0s()),2&n){let s,d;e.R7$(),e.Y8G("link",i.backPath),e.R7$(),e.SpI(" ",e.bMT(3,4,"sync.add-page.back-button")," "),e.R7$(2),e.vxM((s=e.bMT(5,6,i.connectorId))?4:-1,s),e.R7$(2),e.vxM((d=e.bMT(7,8,i.connector))?6:-1,d)}},dependencies:[y.MD,y.Jj,u.Xp,a.Ymm,P.Q,a.V3x,E.R,u.o3,g.h,g.D9,oe,V,u.J4,ie.t],styles:['@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(336, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(336, 100%, 36%));--color-primary-regular: var(--custom-color-primary-regular, hsl(336, 100%, 50%));--color-primary-light: var(--custom-color-primary-light, hsl(336, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(336, 100%, 90%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(336, 100%, 96%));--color-secondary-stronger: hsl(51, 78%, 32%);--color-secondary-strong: hsl(51, 100%, 41%);--color-secondary-regular: hsl(51, 100%, 55%);--color-secondary-light: hsl(51, 100%, 75%);--color-secondary-lighter: hsl(51, 100%, 86%);--color-secondary-lightest: hsl(51, 100%, 95%);--color-tertiary-stronger: hsl(249, 100%, 24%);--color-tertiary-strong: hsl(249, 100%, 40%);--color-tertiary-regular: hsl(249, 100%, 50%);--color-tertiary-light: hsl(249, 100%, 65%);--color-tertiary-lighter: hsl(249, 100%, 92%);--color-tertiary-lightest: hsl(249, 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 Bt=c(4572),Yt=c(2885);const Lt=["activitySection"],se=(o,r)=>r.id;function Jt(o,r){if(1&o&&(e.j41(0,"div",3)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",14),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.nrm(7,"div",4)),2&o){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"sync.details.settings.synchronize-security-groups")),e.R7$(3),e.SpI(" ",e.bMT(6,4,t.sync.syncSecurityGroups?"sync.details.settings.boolean.true":"sync.details.settings.boolean.false")," ")}}function Qt(o,r){if(1&o&&(e.j41(0,"nsi-label",6),e.EFF(1),e.k0s()),2&o){const t=r.$implicit;e.Y8G("color",t.color),e.R7$(),e.SpI(" ",t.label," ")}}function Wt(o,r){1&o&&e.EFF(0," \u2013 ")}function Ht(o,r){if(1&o&&(e.j41(0,"nsi-label",15),e.EFF(1),e.k0s()),2&o){const t=r.$implicit;e.R7$(),e.SpI(" ",t," ")}}function zt(o,r){1&o&&e.EFF(0," \u2013 ")}function Kt(o,r){1&o&&(e.j41(0,"div",5),e.Z7z(1,Ht,2,1,"nsi-label",15,e.fX1,!1,zt,1,0),e.k0s()),2&o&&(e.R7$(),e.Dyx(r.extensions.split(", ")))}function Zt(o,r){1&o&&e.EFF(0," \u2013 ")}function qt(o,r){if(1&o&&(e.EFF(0),e.nI1(1,"translate"),e.nrm(2,"pa-datetime",16),e.EFF(3),e.nI1(4,"translate"),e.nrm(5,"pa-datetime",16)),2&o){const t=r;e.SpI(" ",e.bMT(1,4,"sync.details.settings.modification-date.from")," "),e.R7$(2),e.Y8G("datetime",t.from),e.R7$(),e.SpI(" ",e.bMT(4,6,"sync.details.settings.modification-date.to")," "),e.R7$(2),e.Y8G("datetime",t.to)}}function en(o,r){1&o&&e.EFF(0," \u2013 ")}function tn(o,r){if(1&o&&(e.j41(0,"div"),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(),e.JRh(n.sync.connector.parameters[t.id]||"_")}}function nn(o,r){if(1&o&&e.nrm(0,"app-parameters-table",18),2&o){const t=e.XpG().$implicit,n=e.XpG(3);e.Y8G("values",n.sync.connector.parameters[t.id])}}function on(o,r){1&o&&e.EFF(0," \u2013 ")}function rn(o,r){1&o&&e.nrm(0,"div",4)}function sn(o,r){if(1&o&&(e.j41(0,"div",3)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,tn,2,1,"div")(5,nn,1,1,"app-parameters-table",18)(6,on,1,0),e.k0s(),e.DNE(7,rn,1,0,"div",4)),2&o){const t=r.$implicit,n=r.$index,i=r.$count,s=e.XpG(3);e.R7$(2),e.JRh(e.bMT(3,3,t.label)),e.R7$(2),e.vxM("table"!==t.type?4:s.sync.connector.parameters[t.id].length>0?5:6),e.R7$(3),e.vxM(n!==i-1?7:-1)}}function cn(o,r){if(1&o&&(e.j41(0,"nsi-two-columns-configuration-item",17)(1,"div",2),e.Z7z(2,sn,8,5,null,null,se),e.k0s()()),2&o){const t=r.$implicit;e.Y8G("itemTitle",t.title)("description",t.description||""),e.R7$(2),e.Dyx(t.fields)}}function an(o,r){if(1&o&&(e.Z7z(0,cn,4,2,"nsi-two-columns-configuration-item",17,se),e.nI1(2,"async")),2&o){const t=e.XpG();e.Dyx(e.bMT(2,0,t.connector.getParametersSections()))}}function ln(o,r){if(1&o&&(e.j41(0,"nsi-two-columns-configuration-item",8)(1,"div"),e.EFF(2),e.k0s()()),2&o){const t=e.XpG();e.R7$(2),e.JRh(t.extractStrategy)}}function dn(o,r){1&o&&e.nrm(0,"pa-icon",20)}function pn(o,r){1&o&&e.nrm(0,"pa-icon",21)}function hn(o,r){1&o&&e.nrm(0,"pa-icon",22)}function un(o,r){if(1&o&&(e.j41(0,"pa-table-row")(1,"pa-table-cell")(2,"div",19),e.DNE(3,dn,1,0,"pa-icon",20)(4,pn,1,0,"pa-icon",21)(5,hn,1,0,"pa-icon",22),e.EFF(6),e.k0s()(),e.j41(7,"pa-table-cell")(8,"div",23),e.nrm(9,"pa-datetime",24),e.k0s()()()),2&o){let t;const n=r.$implicit;e.R7$(3),e.vxM("high"===(t=n.level)?3:"medium"===t?4:"low"===t?5:-1),e.R7$(3),e.SpI(" ",n.message," "),e.R7$(3),e.Y8G("datetime",n.createdAt)}}function mn(o,r){1&o&&(e.j41(0,"pa-table-row",13)(1,"pa-table-cell")(2,"div",23),e.EFF(3),e.nI1(4,"translate"),e.k0s()()()),2&o&&(e.R7$(3),e.JRh(e.bMT(4,1,"sync.details.activity-log.no-activity")))}let gn=(()=>{class o{constructor(){this.labelService=(0,e.WQX)(C.xQ),this.cdr=(0,e.WQX)(e.gRc),this.currentRoute=(0,e.WQX)(v.nX),this.sdk=(0,e.WQX)(C.ok),this.connector=null,this._logs=[],this.labelSets={},this.coloredLabels=[],this.extractStrategy=""}set logs(t){t&&(this._logs=t)}get logs(){return this._logs}ngAfterViewInit(){this.currentRoute.queryParams.pipe((0,f.p)(t=>t.section),(0,h.T)(t=>t.section),(0,_.s)(1)).subscribe({next:t=>{setTimeout(()=>{"activity"===t&&this.activitySection&&this.activitySection.nativeElement.scrollIntoView({behavior:"smooth"})},300)}})}ngOnInit(){this.labelService.resourceLabelSets.pipe((0,_.s)(1),(0,f.p)(n=>!!n),(0,h.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 t=this.sync.extract_strategy;t&&this.sdk.currentKb.pipe((0,_.s)(1),(0,p.n)(n=>n.getExtractStrategies())).subscribe(n=>{this.extractStrategy=n[t]?.name||"",this.cdr.markForCheck()})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["nsy-sync-settings"]],viewQuery:function(n,i){if(1&n&&e.GBs(Lt,5),2&n){let s;e.mGM(s=e.lsd())&&(i.activitySection=s.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&&(e.j41(0,"nsi-two-columns-configuration-item",1)(1,"div",2)(2,"div",3)(3,"label"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"div"),e.EFF(7),e.k0s()(),e.nrm(8,"div",4),e.DNE(9,Jt,8,6),e.j41(10,"div",3)(11,"label"),e.EFF(12),e.nI1(13,"translate"),e.k0s(),e.j41(14,"div",5),e.Z7z(15,Qt,2,2,"nsi-label",6,e.fX1,!1,Wt,1,0),e.k0s()(),e.nrm(18,"div",4),e.j41(19,"label"),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"div",3),e.DNE(23,Kt,4,1,"div",5)(24,Zt,1,0),e.k0s(),e.nrm(25,"div",4),e.j41(26,"label"),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"div",7),e.DNE(30,qt,6,8)(31,en,1,0),e.k0s()()(),e.DNE(32,an,3,2)(33,ln,3,1,"nsi-two-columns-configuration-item",8),e.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),e.EFF(40),e.nI1(41,"translate"),e.k0s(),e.j41(42,"pa-table-cell",12),e.EFF(43),e.nI1(44,"translate"),e.k0s()(),e.Z7z(45,un,10,3,"pa-table-row",null,e.fX1,!1,mn,5,3,"pa-table-row",13),e.k0s()()()),2&n){let s,d;e.R7$(4),e.JRh(e.bMT(5,14,"sync.details.settings.name")),e.R7$(3),e.JRh(i.sync.title),e.R7$(2),e.vxM(null!=i.connector&&i.connector.canSyncSecurityGroups?9:-1),e.R7$(3),e.JRh(e.bMT(13,16,"sync.details.settings.labels")),e.R7$(3),e.Dyx(i.coloredLabels),e.R7$(5),e.SpI(" ",e.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")," "),e.R7$(3),e.vxM((s=null==i.sync.filters?null:i.sync.filters.fileExtensions)?23:24,s),e.R7$(4),e.JRh(e.bMT(28,20,"sync.details.settings.modification-date.label")),e.R7$(3),e.vxM((d=null==i.sync.filters?null:i.sync.filters.modified)?30:31,d),e.R7$(2),e.vxM(i.connector?32:-1),e.R7$(),e.vxM(i.extractStrategy?33:-1),e.R7$(7),e.JRh(e.bMT(41,22,"sync.details.activity-log.table-header.message")),e.R7$(3),e.JRh(e.bMT(44,24,"sync.details.activity-log.table-header.date")),e.R7$(2),e.Dyx(i.logs)}},dependencies:[y.MD,y.Jj,u._8,g.h,g.D9,u.OE,te.U,a.Pa6,q.Z,a.EGN,z.O,K.e,Z.U,Yt.Bz,a.V3x,E.R,C.Qy],styles:['@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(336, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(336, 100%, 36%));--color-primary-regular: var(--custom-color-primary-regular, hsl(336, 100%, 50%));--color-primary-light: var(--custom-color-primary-light, hsl(336, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(336, 100%, 90%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(336, 100%, 96%));--color-secondary-stronger: hsl(51, 78%, 32%);--color-secondary-strong: hsl(51, 100%, 41%);--color-secondary-regular: hsl(51, 100%, 55%);--color-secondary-light: hsl(51, 100%, 75%);--color-secondary-lighter: hsl(51, 100%, 86%);--color-secondary-lightest: hsl(51, 100%, 95%);--color-tertiary-stronger: hsl(249, 100%, 24%);--color-tertiary-strong: hsl(249, 100%, 40%);--color-tertiary-regular: hsl(249, 100%, 50%);--color-tertiary-light: hsl(249, 100%, 65%);--color-tertiary-lighter: hsl(249, 100%, 92%);--color-tertiary-lightest: hsl(249, 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:#16a249}'],changeDetection:0})}}return o})();const yn=o=>({count:o});function fn(o,r){if(1&o){const t=e.RV6();e.j41(0,"header")(1,"pa-input",1),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"pa-button",2),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.editing=!0)}),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.j41(7,"div",3),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.nrm(10,"nsi-folder-list",4)}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("formControl",t.queryControl),e.R7$(),e.SpI(" ",e.bMT(3,6,"sync.folder-selection.search-input-label")," "),e.R7$(3),e.JRh(e.bMT(6,8,"sync.folder-selection.edit-folders-button")),e.R7$(3),e.JRh(e.bMT(9,10,"sync.folder-selection.current-selection")),e.R7$(2),e.Y8G("filtered",!!t.query)("folders",t.selectedFolders)}}function _n(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsy-folder-selection",5),e.bIt("selectedSyncItems",function(i){e.eBV(t);const s=e.XpG();return e.Njj(s.updateSelection(i))}),e.k0s(),e.j41(1,"nsi-sticky-footer")(2,"div",6),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"pa-button",7),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.editing=!1)}),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"pa-button",8),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.saveSelection())}),e.EFF(9),e.nI1(10,"translate"),e.k0s()()}if(2&o){const t=e.XpG();e.Y8G("sync",t.sync),e.R7$(3),e.SpI(" ",e.i5U(4,4,"sync.folder-selection.footer.selection-count",e.eq3(11,yn,t.selectionCount))," "),e.R7$(3),e.SpI(" ",e.bMT(7,7,"generic.cancel")," "),e.R7$(3),e.SpI(" ",e.bMT(10,9,"sync.folder-selection.footer.save-changes")," ")}}let bn=(()=>{class o{constructor(){this.cdr=(0,e.WQX)(e.gRc),this._unsubscribeAll=new R.B,this.selectionChange=new e.bkB,this.editing=!1,this.selection=[],this.selectionCount=0,this.queryControl=new l.MJ("")}set sync(t){this._sync=t,this.updateSelection(t.foldersToSync||[])}get sync(){return this._sync}get selectedFolders(){const t=this.selection.map(i=>i.metadata.displayPath||i.metadata.path)||[],n=this.query?this.query.toLocaleLowerCase():"";return n?t.filter(i=>i.toLocaleLowerCase().includes(n)):t}get query(){return this.queryControl.value}updateSelection(t){this.selection=t,this.selectionCount=this.selection.length,this.cdr.detectChanges()}saveSelection(){this.selectionChange.emit(this.selection),this.editing=!1,this.cdr.markForCheck()}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.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&&(e.j41(0,"div",0),e.DNE(1,fn,11,12)(2,_n,11,13),e.k0s()),2&n&&(e.R7$(),e.vxM(i.editing?i.sync?2:-1:1))},dependencies:[y.MD,V,a.XgI,X.S,a.Ymm,P.Q,g.h,g.D9,a.V3x,u.Sq,u.o3,l.X1,l.BC,l.l_],styles:['@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(336, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(336, 100%, 36%));--color-primary-regular: var(--custom-color-primary-regular, hsl(336, 100%, 50%));--color-primary-light: var(--custom-color-primary-light, hsl(336, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(336, 100%, 90%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(336, 100%, 96%));--color-secondary-stronger: hsl(51, 78%, 32%);--color-secondary-strong: hsl(51, 100%, 41%);--color-secondary-regular: hsl(51, 100%, 55%);--color-secondary-light: hsl(51, 100%, 75%);--color-secondary-lighter: hsl(51, 100%, 86%);--color-secondary-lightest: hsl(51, 100%, 95%);--color-tertiary-stronger: hsl(249, 100%, 24%);--color-tertiary-strong: hsl(249, 100%, 40%);--color-tertiary-regular: hsl(249, 100%, 50%);--color-tertiary-light: hsl(249, 100%, 65%);--color-tertiary-lighter: hsl(249, 100%, 92%);--color-tertiary-lightest: hsl(249, 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 Cn=c(7725),vn=c(3515);function Sn(o,r){if(1&o){const t=e.RV6();e.j41(0,"div",8)(1,"div",9)(2,"pa-toggle",10),e.bIt("valueChange",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.toggleSync(i))}),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"pa-button",11),e.nI1(6,"async"),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.triggerSync())}),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.j41(9,"pa-button",12),e.EFF(10),e.nI1(11,"translate"),e.k0s(),e.j41(12,"pa-button",13),e.bIt("click",function(){e.eBV(t);const i=e.XpG(3);return e.Njj(i.deleteSync())}),e.EFF(13),e.nI1(14,"translate"),e.k0s()()}if(2&o){const t=e.XpG(2),n=e.XpG();e.R7$(2),e.Y8G("value",!t.disabled),e.R7$(),e.SpI(" ",e.bMT(4,6,t.disabled?"sync.badge.inactive":"sync.badge.active")," "),e.R7$(2),e.Y8G("disabled",e.bMT(6,8,n.isSyncing)),e.R7$(2),e.SpI(" ",e.bMT(8,10,"sync.details.buttons.sync-now")," "),e.R7$(3),e.SpI(" ",e.bMT(11,12,"sync.details.buttons.edit-settings")," "),e.R7$(3),e.SpI(" ",e.bMT(14,14,"sync.details.buttons.delete")," ")}}function xn(o,r){if(1&o&&(e.j41(0,"div",2)(1,"h1",6),e.nrm(2,"pa-icon",7),e.EFF(3),e.k0s(),e.DNE(4,Sn,15,16,"div",8),e.nI1(5,"async"),e.k0s()),2&o){const t=e.XpG(),n=e.XpG();e.R7$(2),e.Y8G("path",r.logo),e.R7$(),e.SpI(" ",t.title," "),e.R7$(),e.vxM(!1===e.bMT(5,3,n.editMode)?4:-1)}}function Tn(o,r){if(1&o){const t=e.RV6();e.j41(0,"pa-tab",14),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.activeTab="folders")}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("active","folders"===t.activeTab),e.R7$(),e.SpI(" ",e.bMT(2,2,"sync.details.tabs.folders")," ")}}function Fn(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsy-configuration-form",19),e.nI1(1,"async"),e.nI1(2,"async"),e.nI1(3,"async"),e.bIt("configurationChange",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.updateConfiguration(i))})("validForm",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.validForm=i)}),e.k0s()}if(2&o){let t;const n=e.XpG(2),i=e.XpG();e.Y8G("sync",n)("kbId",e.bMT(1,4,i.kbId))("connector",e.bMT(2,6,i.connector))("connectorId",null==(t=e.bMT(3,8,i.connectorDef))?null:t.id)}}function In(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsy-folder-selection",20),e.bIt("selectedSyncItems",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.updateSelection(i))}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("sync",t)}}function Rn(o,r){if(1&o){const t=e.RV6();e.j41(0,"div"),e.DNE(1,Fn,4,10,"nsy-configuration-form",15)(2,In,1,1,"nsy-folder-selection",16),e.j41(3,"nsi-sticky-footer")(4,"pa-button",17),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"pa-button",18),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.saveChanges())}),e.EFF(8),e.nI1(9,"translate"),e.k0s()()()}if(2&o){let t;const n=e.XpG(2);e.R7$(),e.vxM("settings"===(t=n.activeTab)?1:"folders"===t?2:-1),e.R7$(4),e.SpI(" ",e.bMT(6,3,"generic.cancel")," "),e.R7$(3),e.SpI(" ",e.bMT(9,5,"sync.details.buttons.save-changes")," ")}}function Mn(o,r){if(1&o&&(e.nrm(0,"nsy-sync-settings",21),e.nI1(1,"async"),e.nI1(2,"async")),2&o){const t=e.XpG(2),n=e.XpG();e.Y8G("sync",t)("connector",e.bMT(1,3,n.connector))("logs",e.bMT(2,5,n.activityLogs))}}function kn(o,r){if(1&o){const t=e.RV6();e.j41(0,"nsy-folders-tab",22),e.bIt("selectionChange",function(i){e.eBV(t);const s=e.XpG(3);return e.Njj(s.updateFolders(i))}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("sync",t)}}function $n(o,r){if(1&o&&e.DNE(0,Mn,3,7,"nsy-sync-settings",21)(1,kn,1,1,"nsy-folders-tab",16),2&o){let t;const n=e.XpG(2);e.vxM("settings"===(t=n.activeTab)?0:"folders"===t?1:-1)}}function En(o,r){if(1&o){const t=e.RV6();e.DNE(0,xn,6,5,"div",2),e.nI1(1,"async"),e.j41(2,"pa-tabs",3)(3,"pa-tab",4),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.activeTab="settings")}),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.DNE(6,Tn,3,4,"pa-tab",5),e.nI1(7,"async"),e.k0s(),e.DNE(8,Rn,10,7,"div"),e.nI1(9,"async"),e.DNE(10,$n,2,1)}if(2&o){let t,n;const i=e.XpG();e.vxM((t=e.bMT(1,5,i.connectorDef))?0:-1,t),e.R7$(3),e.Y8G("active","settings"===i.activeTab),e.R7$(),e.SpI(" ",e.bMT(5,7,"sync.details.tabs.settings")," "),e.R7$(2),e.vxM(null!=(n=e.bMT(7,9,i.connector))&&n.allowToSelectFolders?6:-1),e.R7$(2),e.vxM(e.bMT(9,11,i.editMode)?8:10)}}let ce=(()=>{class o{constructor(){this.router=(0,e.WQX)(v.Ix),this.currentRoute=(0,e.WQX)(v.nX),this.syncService=(0,e.WQX)($),this.toaster=(0,e.WQX)(u._g),this.sdk=(0,e.WQX)(C.ok),this.modalService=(0,e.WQX)(u.w8),this.translate=(0,e.WQX)(g.c$),this.unsubscribeAll=new R.B,this.isDeleted=new R.B,this.kbId=this.sdk.currentKb.pipe((0,h.T)(t=>t.id)),this.syncId=this.currentRoute.params.pipe((0,f.p)(t=>!!t.syncId),(0,h.T)(t=>t.syncId),(0,b.M)(t=>this.syncService.setCurrentSyncId(t))),this.sync=this.syncService.cacheUpdated.pipe((0,p.n)(()=>this.syncId),(0,p.n)(t=>this.syncService.getSync(t)),(0,M.Q)(this.isDeleted)),this.connectorDef=this.sync.pipe((0,h.T)(t=>this.syncService.connectors[t.connector.name].definition)),this.connector=this.connectorDef.pipe((0,h.T)(t=>this.syncService.getConnector(t.id,""))),this.activityLogs=this.syncId.pipe((0,p.n)(t=>this.syncService.getLogs(t))),this.activeTab="settings",this.editMode=this.currentRoute.url.pipe((0,h.T)(t=>t.length>1&&"edit"===t[1].path)),this.validForm=!1,this.isSyncing=(0,Bt.z)([this.syncId,this.syncService.isSyncing]).pipe((0,h.T)(([t,n])=>n[t]||!1))}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete(),this.isDeleted.next(),this.isDeleted.complete()}toggleSync(t){this.syncId.pipe((0,_.s)(1),(0,p.n)(n=>this.syncService.updateSync(n,{disabled:!t}))).subscribe({error:()=>this.toaster.error(t?"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,p.n)(t=>this.syncId.pipe((0,_.s)(1),(0,p.n)(n=>this.syncService.triggerSync(n,!t))))).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,p.n)(t=>this.modalService.openConfirm({title:this.translate.instant("sync.confirm.deletion.title",{title:t.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,p.n)(()=>this.syncService.deleteSync(t.id))))).subscribe({next:()=>this.router.navigate([".."],{relativeTo:this.currentRoute}),error:()=>this.toaster.error("sync.details.toast.deletion-failed")})}updateConfiguration(t){this.updatedConfig=t}updateSelection(t){this.updatedSelection=t}saveChanges(){!this.updatedConfig&&!this.updatedSelection||this.syncId.pipe((0,_.s)(1),(0,p.n)(t=>{const n={...this.updatedConfig};return this.updatedSelection&&(n.foldersToSync=this.updatedSelection),this.syncService.updateSync(t,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(t){this.syncId.pipe((0,_.s)(1),(0,p.n)(n=>this.syncService.updateSync(n,{foldersToSync:t}))).subscribe({error:()=>this.toaster.error("sync.details.toast.modification-failed")})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=e.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&&(e.j41(0,"div",0)(1,"nsi-back-button",1),e.nI1(2,"async"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.DNE(5,En,11,13),e.nI1(6,"async"),e.k0s()),2&n){let s;e.R7$(),e.Y8G("link",e.bMT(2,3,i.editMode)?"../..":".."),e.R7$(2),e.SpI(" ",e.bMT(4,5,"sync.add-page.back-button")," "),e.R7$(2),e.vxM((s=e.bMT(6,7,i.sync))?5:-1,s)}},dependencies:[y.MD,y.Jj,u.Xp,g.h,g.D9,a.V3x,E.R,a.Ymm,P.Q,a.rkm,A.a,a.aT,Cn.Q,vn.w,gn,bn,v.Wk,u.o3,oe,V],styles:['@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(336, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(336, 100%, 36%));--color-primary-regular: var(--custom-color-primary-regular, hsl(336, 100%, 50%));--color-primary-light: var(--custom-color-primary-light, hsl(336, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(336, 100%, 90%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(336, 100%, 96%));--color-secondary-stronger: hsl(51, 78%, 32%);--color-secondary-strong: hsl(51, 100%, 41%);--color-secondary-regular: hsl(51, 100%, 55%);--color-secondary-light: hsl(51, 100%, 75%);--color-secondary-lighter: hsl(51, 100%, 86%);--color-secondary-lightest: hsl(51, 100%, 95%);--color-tertiary-stronger: hsl(249, 100%, 24%);--color-tertiary-strong: hsl(249, 100%, 40%);--color-tertiary-regular: hsl(249, 100%, 50%);--color-tertiary-light: hsl(249, 100%, 65%);--color-tertiary-lighter: hsl(249, 100%, 92%);--color-tertiary-lightest: hsl(249, 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 Pn=[{path:"",component:xe,children:[{path:"",component:ze},{path:"add/:connector",component:re},{path:"add/:connector/:syncId",component:re},{path:":syncId/edit",component:ce},{path:":syncId",component:ce}]}]}}]);
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "24b9fe5863504e8ee3eb65f9b2e2888773aee2fb",
2
+ "version": "7835e1a3e1db723189ccc8299bf71fe8a008088d",
3
3
  "production": true,
4
4
  "backend": {
5
5
  "app": "nucliadb-admin",
@@ -74,6 +74,12 @@
74
74
  "account.kb-description": "Un Knowledge Box és una col·lecció de contingut en què cerca Nuclia. Alguns motors de cerca l’anomenen \"índex\" o \"corpus\". En la majoria dels casos, només necessiteu un Knowledge Box per a la vostra aplicació.",
75
75
  "account.knowledgeboxes": "Knowledge Boxes",
76
76
  "account.manage": "Gestió del compte",
77
+ "account.models.default": "Per defecte",
78
+ "account.models.description": "Gestiona models en totes les teves Knowledge Boxes.",
79
+ "account.models.empty-list": "Encara no hi ha cap model personalitzat associat al teu compte.",
80
+ "account.models.error": "S'ha produït un error en modificar el model",
81
+ "account.models.selection": "Seleccioneu els models personalitzats que es poden veure i utilitzar en aquesta Knowledge Box.",
82
+ "account.models.title": "Models",
77
83
  "account.new_token": "Nova clau de l’API",
78
84
  "account.nua_client": "Nom del client",
79
85
  "account.nua_key_activity": "Registre d’activitat de la clau Nuclia Understanding API",
@@ -823,6 +829,7 @@
823
829
  "navbar.list": "Llistat recursos",
824
830
  "navbar.manage-kbs": "Knowledge Boxes",
825
831
  "navbar.metrics": "Mètriques",
832
+ "navbar.models": "Models",
826
833
  "navbar.nua-keys": "Claus NUA",
827
834
  "navbar.rag-lab": "RAG lab",
828
835
  "navbar.settings": "Preferències",
@@ -1267,6 +1274,7 @@
1267
1274
  "retrieval-agents.workflow.node-types.external.form.prompt.label": "Prompt addicional",
1268
1275
  "retrieval-agents.workflow.node-types.external.form.url": "URL per trucar",
1269
1276
  "retrieval-agents.workflow.node-types.external.title": "Trucada externa",
1277
+ "retrieval-agents.workflow.node-types.generate.config.default-prompt": "Genera text / JSON / imatge mitjançant el prompt predeterminada",
1270
1278
  "retrieval-agents.workflow.node-types.generate.description": "Generació de text / JSON / imatges",
1271
1279
  "retrieval-agents.workflow.node-types.generate.generate_image": "Generar una imatge",
1272
1280
  "retrieval-agents.workflow.node-types.generate.images": "Utilitza imatges",
@@ -1324,6 +1332,7 @@
1324
1332
  "retrieval-agents.workflow.node-types.rephrase.form.synonyms.label": "Sinònims",
1325
1333
  "retrieval-agents.workflow.node-types.rephrase.form.user-info.help": "Incloure informació sobre l'usuari",
1326
1334
  "retrieval-agents.workflow.node-types.rephrase.form.user-info.label": "Informació de l'usuari",
1335
+ "retrieval-agents.workflow.node-types.rephrase.source": "Font",
1327
1336
  "retrieval-agents.workflow.node-types.rephrase.title": "Reformular",
1328
1337
  "retrieval-agents.workflow.node-types.restart.description": "Reiniciar el flux de treball",
1329
1338
  "retrieval-agents.workflow.node-types.restart.form.retries.integer-error": "Ha de ser un nombre enter",
@@ -1354,6 +1363,7 @@
1354
1363
  "retrieval-agents.workflow.node-types.sql.form.source": "Font SQL",
1355
1364
  "retrieval-agents.workflow.node-types.sql.form.sqlschema": "Esquema SQL",
1356
1365
  "retrieval-agents.workflow.node-types.sql.title": "Consulta SQL",
1366
+ "retrieval-agents.workflow.node-types.summarize.config.default-prompt": "Resumir la sortida mitjançant el prompt per defecte",
1357
1367
  "retrieval-agents.workflow.node-types.summarize.description": "Resumeix la sortida",
1358
1368
  "retrieval-agents.workflow.node-types.summarize.images": "Imatges",
1359
1369
  "retrieval-agents.workflow.node-types.summarize.prompt-placeholder": "Prompt del format de resum",
@@ -1381,8 +1391,12 @@
1381
1391
  "retrieval-agents.workflow.sidebar.test.form.session-select.label": "Sessió de prova",
1382
1392
  "retrieval-agents.workflow.sidebar.test.form.session-select.new": "Crea una sessió nova",
1383
1393
  "retrieval-agents.workflow.sidebar.test.form.stop-button": "Parar",
1394
+ "retrieval-agents.workflow.sidebar.test.interactions.results.description": "Retorn del resultat final...",
1395
+ "retrieval-agents.workflow.sidebar.test.interactions.results.title": "Resultat",
1384
1396
  "retrieval-agents.workflow.sidebar.test.interactions.user-input": "Entrada de l'usuari",
1385
1397
  "retrieval-agents.workflow.sidebar.test.title": "Prova l'agent",
1398
+ "retrieval-agents.workflow.sidebar.test.toasts.session-closing-error": "S'ha produït un error en tancar les interaccions de la sessió.",
1399
+ "retrieval-agents.workflow.sidebar.test.toasts.session-creation-error": "S'ha produït un error en crear la sessió.",
1386
1400
  "retrieval-agents.workflow.toolbar-buttons.add-node": "Afegir un node",
1387
1401
  "retrieval-agents.workflow.toolbar-buttons.manage-sessions": "Gestionar sessions",
1388
1402
  "retrieval-agents.workflow.toolbar-buttons.rules": "Normes",
@@ -74,6 +74,12 @@
74
74
  "account.kb-description": "A Knowledge Box is a collection of content that Nuclia searches on. Some search engines call it an \"index\" or \"corpus\". In most cases, you only need one Knowledge Box for your application.",
75
75
  "account.knowledgeboxes": "Knowledge Boxes",
76
76
  "account.manage": "Manage account",
77
+ "account.models.default": "Default",
78
+ "account.models.description": "Manage models across your Knowledge Boxes.",
79
+ "account.models.empty-list": "There are no custom models associated with your account yet.",
80
+ "account.models.error": "An error occurred while modifying the model",
81
+ "account.models.selection": "Select the custom models that can be visible and used in this Knowledge Box.",
82
+ "account.models.title": "Models",
77
83
  "account.new_token": "New API key",
78
84
  "account.nua_client": "Client name",
79
85
  "account.nua_key_activity": "Nuclia Understanding API key activity log",
@@ -823,6 +829,7 @@
823
829
  "navbar.list": "Resources list",
824
830
  "navbar.manage-kbs": "Knowledge Boxes",
825
831
  "navbar.metrics": "Metrics",
832
+ "navbar.models": "Models",
826
833
  "navbar.nua-keys": "NUA keys",
827
834
  "navbar.rag-lab": "RAG lab",
828
835
  "navbar.settings": "Settings",
@@ -1279,6 +1286,7 @@
1279
1286
  "retrieval-agents.workflow.node-types.external.form.prompt.label": "Extra prompt",
1280
1287
  "retrieval-agents.workflow.node-types.external.form.url": "URL to call",
1281
1288
  "retrieval-agents.workflow.node-types.external.title": "External call",
1289
+ "retrieval-agents.workflow.node-types.generate.config.default-prompt": "Generate text / JSON / image using the default prompt",
1282
1290
  "retrieval-agents.workflow.node-types.generate.description": "Text / JSON / image generation",
1283
1291
  "retrieval-agents.workflow.node-types.generate.generate_image": "Generate an image",
1284
1292
  "retrieval-agents.workflow.node-types.generate.images": "Uses images",
@@ -1338,6 +1346,7 @@
1338
1346
  "retrieval-agents.workflow.node-types.rephrase.form.synonyms.label": "Synonyms",
1339
1347
  "retrieval-agents.workflow.node-types.rephrase.form.user-info.help": "Include information about the user",
1340
1348
  "retrieval-agents.workflow.node-types.rephrase.form.user-info.label": "User info",
1349
+ "retrieval-agents.workflow.node-types.rephrase.source": "Source",
1341
1350
  "retrieval-agents.workflow.node-types.rephrase.title": "Rephrase",
1342
1351
  "retrieval-agents.workflow.node-types.restart.description": "Restart the workflow",
1343
1352
  "retrieval-agents.workflow.node-types.restart.form.retries.integer-error": "Must be an integer",
@@ -1370,6 +1379,7 @@
1370
1379
  "retrieval-agents.workflow.node-types.sql.form.sqlschema": "SQL schema",
1371
1380
  "retrieval-agents.workflow.node-types.sql.form.view_support": "View support",
1372
1381
  "retrieval-agents.workflow.node-types.sql.title": "SQL query",
1382
+ "retrieval-agents.workflow.node-types.summarize.config.default-prompt": "Summarize the output using the default prompt",
1373
1383
  "retrieval-agents.workflow.node-types.summarize.description": "Summarize the output",
1374
1384
  "retrieval-agents.workflow.node-types.summarize.images": "Images",
1375
1385
  "retrieval-agents.workflow.node-types.summarize.prompt-placeholder": "Prompt for the summary format",
@@ -1406,8 +1416,12 @@
1406
1416
  "retrieval-agents.workflow.sidebar.test.form.session-select.label": "Test session",
1407
1417
  "retrieval-agents.workflow.sidebar.test.form.session-select.new": "Create new session",
1408
1418
  "retrieval-agents.workflow.sidebar.test.form.stop-button": "Stop",
1419
+ "retrieval-agents.workflow.sidebar.test.interactions.results.description": "Returning final result…",
1420
+ "retrieval-agents.workflow.sidebar.test.interactions.results.title": "Result",
1409
1421
  "retrieval-agents.workflow.sidebar.test.interactions.user-input": "User input",
1410
1422
  "retrieval-agents.workflow.sidebar.test.title": "Test agent",
1423
+ "retrieval-agents.workflow.sidebar.test.toasts.session-closing-error": "An error occurred while closing the session interactions.",
1424
+ "retrieval-agents.workflow.sidebar.test.toasts.session-creation-error": "An error occurred while creating the session.",
1411
1425
  "retrieval-agents.workflow.toolbar-buttons.add-node": "Add node",
1412
1426
  "retrieval-agents.workflow.toolbar-buttons.manage-sessions": "Manage sessions",
1413
1427
  "retrieval-agents.workflow.toolbar-buttons.rules": "Rules",