1import{A as lt,d as nt,h as at,o as it,q as ot,r as ie,s as oe,t as be,u as De,v as B,w as ye,x as Se,y as st,z as rt}from"./chunk-D2VBQR6Q.js";import"./chunk-EE2LMKIQ.js";import"./chunk-5U3LFFTC.js";import"./chunk-FOMLW6WK.js";import"./chunk-C7QEKYJS.js";import"./chunk-5AVFQXDZ.js";import"./chunk-LIEWBGB4.js";import"./chunk-V5NWSRC5.js";import"./chunk-F7N73Z6D.js";import"./chunk-XLPYRAAY.js";import"./chunk-X5KW2S6F.js";import"./chunk-G3C5YP26.js";import"./chunk-V2CSFJBP.js";import"./chunk-Q5JHPWKU.js";import"./chunk-I5E7WDK5.js";import"./chunk-X5CPQQV4.js";import"./chunk-SXGAHIOA.js";import"./chunk-V6ANJJSA.js";import"./chunk-RJWWSJNV.js";import{a as tt}from"./chunk-N5L6JTFU.js";import"./chunk-FBYIWLBF.js";import"./chunk-LG7GWAXN.js";import"./chunk-ZBE5DUKE.js";import"./chunk-BBF4AZQU.js";import"./chunk-77SJUUN4.js";import"./chunk-PYRN7HBI.js";import"./chunk-UMT7XSPS.js";import"./chunk-GCBS322W.js";import"./chunk-ZCE6WC2E.js";import"./chunk-XN23UEAX.js";import"./chunk-CLF7OWAY.js";import"./chunk-3647CSYX.js";import"./chunk-L25GO5IG.js";import"./chunk-XQDO3TCW.js";import"./chunk-4IJX6PMT.js";import"./chunk-ODH33RHD.js";import"./chunk-LQJMY3DE.js";import"./chunk-Z6SRZK6I.js";import"./chunk-JBZQDEPX.js";import"./chunk-OQ62ZWRL.js";import"./chunk-3JIGNYKS.js";import{a as Je}from"./chunk-CIC3D5O5.js";import{h as ze}from"./chunk-YY5DU4UB.js";import"./chunk-WBNU5YMZ.js";import"./chunk-WV7J7GUC.js";import"./chunk-NIYLRKBW.js";import"./chunk-7EG4D6ST.js";import"./chunk-V76HSRXV.js";import"./chunk-S2ID3Y7V.js";import"./chunk-ROR5XTLD.js";import{h as et}from"./chunk-QWGEP2IW.js";import"./chunk-3LJAJJDF.js";import"./chunk-WACOI4H6.js";import"./chunk-GNWNH7VP.js";import"./chunk-NLDH5OJL.js";import"./chunk-VRUSTUSH.js";import"./chunk-4MZ5WSHL.js";import"./chunk-7DUGVXPT.js";import"./chunk-IJYGQQVU.js";import"./chunk-7TDC45YI.js";import"./chunk-PLQK3DIU.js";import"./chunk-KCPAHKTX.js";import"./chunk-CUUWRNUR.js";import"./chunk-MHOIQ52I.js";import"./chunk-PXGZUBWA.js";import"./chunk-U3TACSM5.js";import"./chunk-UOEXEO4C.js";import"./chunk-7XNLYUQJ.js";import"./chunk-M6KR5DAF.js";import"./chunk-4PR5XMHX.js";import"./chunk-3SZJ6WTN.js";import"./chunk-LK7GPYH2.js";import"./chunk-T4K3UAE7.js";import"./chunk-6OK36KCQ.js";import"./chunk-BZLNXTM2.js";import"./chunk-BWWDHO3P.js";import"./chunk-VAYQ7QPN.js";import{a as Ke,b as Ye}from"./chunk-KNFDDB5X.js";import"./chunk-SIH37SVH.js";import"./chunk-6IT7HA7T.js";import"./chunk-LVLTZEX5.js";import"./chunk-X7P5OGBI.js";import"./chunk-W5CGKLBN.js";import"./chunk-IVHNSXTB.js";import"./chunk-E2SURHRA.js";import"./chunk-BHOYYKW5.js";import"./chunk-GLUY2ZI4.js";import"./chunk-L6EVGPBR.js";import{a as Ze}from"./chunk-J4XE5EJS.js";import"./chunk-OLFLYJL3.js";import"./chunk-NK7VNWCV.js";import{a as Ge}from"./chunk-3KCEF5AK.js";import"./chunk-IZ2ZVTH2.js";import"./chunk-YM5ZLSHY.js";import"./chunk-BIY5CK7N.js";import"./chunk-FY4ZWY2U.js";import{b as Xe}from"./chunk-2XENFBRK.js";import"./chunk-JWNFXKZK.js";import"./chunk-WG3SHCWC.js";import{n as qe}from"./chunk-YU5TEXZF.js";import"./chunk-SHMAXFJR.js";import"./chunk-6UO7SKKY.js";import"./chunk-YFWKNYD3.js";import"./chunk-LEF362D3.js";import"./chunk-OJYDU3VS.js";import"./chunk-4FTOUWLB.js";import"./chunk-HBCPRKGT.js";import"./chunk-5JXMQV4Y.js";import"./chunk-HBMXNZCG.js";import"./chunk-NAZY5GWU.js";import"./chunk-PLHZAJB6.js";import"./chunk-ZEGDUAO5.js";import"./chunk-Q3EIZCEI.js";import"./chunk-WAKG2MOL.js";import"./chunk-REUPZ2NS.js";import{e as Qe}from"./chunk-U5YXG2ED.js";import"./chunk-3RRA4CXT.js";import"./chunk-VCX6GLOM.js";import"./chunk-4J4G6MRS.js";import"./chunk-XUNNJQMR.js";import"./chunk-UUJKFV33.js";import"./chunk-HXAOPQV6.js";import"./chunk-TT7XXVKE.js";import"./chunk-76AOOTFK.js";import"./chunk-NO5XV46E.js";import"./chunk-F23HFIFJ.js";import"./chunk-TQHLLBT3.js";import"./chunk-4CDRI647.js";import"./chunk-JTRAJYJK.js";import"./chunk-BBFDVBFB.js";import"./chunk-CNRDBXMJ.js";import"./chunk-FP23HYXT.js";import"./chunk-SW7A4GFU.js";import"./chunk-LEPTOKZU.js";import"./chunk-MNYCS2HP.js";import"./chunk-LR3UBCPZ.js";import{i as $e}from"./chunk-QILPHZFK.js";import{b as Ve}from"./chunk-5YNJVDT4.js";import"./chunk-DG66OMZ3.js";import"./chunk-HF3M3HSS.js";
1import"./chunk-DKFK2IYT.js";import"./chunk-W427K26N.js";import"./chunk-FE7JGI2K.js";import"./chunk-EFLWX2EB.js";import"./chunk-3PEVBLTC.js";import"./chunk-55BYVSOV.js";import"./chunk-ZHSNRBMM.js";import"./chunk-PNPKBLBK.js";import"./chunk-5JHWAP4I.js";import"./chunk-FRUWV5KD.js";import"./chunk-JIXEADDX.js";import"./chunk-72JP3BSS.js";import{p as ae,u as He,y as We}from"./chunk-BLEZP7A6.js";import{f as Be,j as je}from"./chunk-2VE3SBCZ.js";import"./chunk-P4J44NUO.js";import"./chunk-LFOLKTE6.js";import"./chunk-W7T65B76.js";import"./chunk-SH2KIJP4.js";import"./chunk-67HI2W2E.js";import"./chunk-Q2LKF24R.js";import"./chunk-PFSY4IBR.js";import"./chunk-JR5TE5UL.js";import"./chunk-5MROVAXA.js";import{ha as Re,ka as Ue,na as X}from"./chunk-FOMDNV5D.js";import{t as T,y as ne}from"./chunk-Q7GHQAUF.js";import{a as U}from"./chunk-BJCURVIP.js";import{Ad as W,Bd as Fe,C as $,Ea as r,Ec as C,Fc as h,Gc as S,Hc as _,Ib as d,Ic as p,J as Te,Jc as b,Kc as Z,Lc as Oe,Ld as x,Ma as k,Mc as Ie,Md as N,Na as O,P as xe,Pc as Q,Qc as ee,S as Ne,Sa as ke,Wc as I,Xc as we,Xd as m,Yc as E,Z as Ae,Za as o,Zb as u,de as Le,ed as _e,f as Ee,fd as Me,g as ve,kd as te,l as z,ld as D,md as v,nd as Pe,u as V,xc as G,za as y,zc as H}from"./chunk-A5XNZBUR.js";import{a as A,b as R}from"./chunk-OLNG5T5J.js";var q=class a{#t=r(Ve);#e=r($e);get(e,t){return this.doRequest({url:e},void 0,t)}doRequest(e,t,n){let i=this.#n(e.url),s=this.#a(n);return e.url=s?`${i}?${s}`:i,this.#t.getApi().connecta().doApiRequest(e,t)}#n(e){if(e.includes("{organisation}")){let t=this.#e.getCurrentSession()?.organizationId;if(!t)throw new Error("Unable to resolve the organisation URL");return e.replace("{organisation}",t)}return e}#a(e){if(!e)return"";let t=new URLSearchParams;for(let[n,i]of Object.entries(e)){if(Array.isArray(i)){i.filter(s=>s).forEach(s=>t.append(n,s));continue}i!=null&&t.append(n,i.toString())}return t.toString()}static \u0275fac=function(t){return new(t||a)};static \u0275prov=y({token:a,factory:a.\u0275fac,providedIn:"root"})};var se=class a{#t="/organizations/{organisation}/agents";#e=r(q);getMany=e=>this.#e.get(this.#t,e);get=(e,t)=>this.#e.get(`${this.#t}/${e}`,t);static \u0275fac=function(t){return new(t||a)};static \u0275prov=y({token:a,factory:a.\u0275fac,providedIn:"root"})};var M=class a{#t="/organizations/{organisation}/tasks";#e=r(q);#n=r(Qe);#a=r(T);getMany(e){return this.#e.get(this.#t+"/all",e)}downloadFiles(e){let t=e.fileId;return this.#e.doRequest({url:`${this.#t}/download`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)},{countForErrorPage:!1,countForErrorToaster:!1}).pipe($(n=>{let i=n;if(i.url==null){this.#n.createToast(this.#a.translate("CONNECTA.ERROR_DOWNLOADING_FILES"),{type:"error"});return}let s=document.createElement("a");s.href=i.url,s.download="",s.rel="noopener",document.body.appendChild(s),s.click(),s.remove()}),Ne(()=>(this.#n.createToast(this.#a.translate("CONNECTA.ERROR_DOWNLOADING_FILES"),{type:"error"}),z)))}static \u0275fac=function(t){return new(t||a)};static \u0275prov=y({token:a,factory:a.\u0275fac,providedIn:"root"})};var ct=["SipOutPersonalizadoParaAgente","sipOutAlbaranesParaFabricante","sipOutClasificacionesParaFabricante","sipOutClientesAlbaranesParaFabricante","sipOutClientesExtendedParaFabricante","sipOutClientesParaFabricante","sipOutEntregasParaFabricante","sipOutFacturasExtendedParaFabricante","sipOutFacturasParaFabricante","sipOutLiquidacionesAcuerdosParaFabricante","sipOutPedidosParaFabricante","sipOutReaprovisionamientosParaFabricante","sipOutStocksParaFabricante","sipOutVentasAcumClienteParaFabricante","sipOutVentasAcumMesParaFabricante"],K=class a{#t=r(se);#e=r(T);#n=r(M);#a;hiddenColumns=["id","hashId"];defaultVisibleColumns=["fileName","agent","orchestration","frequency","receptionDate","endDate","processingTime","msgRows","status","download"];constructor(){this.#a=this.#i()}#i(){let e=Object.keys(ie).filter(n=>n!=="Unknown").map(n=>({id:n,name:this.#e.translate(`UPLOADS.FILESLIST.STATUS.${n.replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase()}`)})),t=Object.keys(oe).map(n=>({id:n,name:this.#e.translate(`DATA_EXTRACTION.CHANNEL.${n==="BlobAzure"?"BLOB_AZURE":n.toUpperCase()}`)}));return{id:{},hashId:{},fileName:{label:"UPLOADS.FILESLIST.COLUMNS.FILENAME",type:"string",width:200,sortCriteria:"FileName",filter:{enabled:!0}},agent:{label:"UPLOADS.FILESLIST.COLUMNS.ORIGIN",type:"string",width:200,sortCriteria:"Agent",filter:{enabled:!0,isMandatory:!0,defaultValue:null,autoSuggestOptionsGetter:n=>this.#t.getMany({search:n,multitenant:!1}).pipe($(i=>this.#o(i))),autoSuggestOptionsGetterByIds:n=>
1{let i=[...new Set(n)].map(s=>this.#t.get(s,{multitenant:!1}));return Te(i).pipe($(s=>this.#o(s)))}}},sendChannel:{label:"DATA_EXTRACTION.COLUMNS.SEND_CHANNEL",type:"combobox",width:120,isNotSortable:!0,filter:{enabled:!0,options:t}},orchestration:{label:"DATA_EXTRACTION.COLUMNS.TYPE",type:"combobox",width:220,isNotSortable:!0,filter:{enabled:!0,options:ct.map(n=>({id:n,name:n}))}},frequency:{label:"CONNECTA.LAUNCHERS.SCHEDULE.FREQUENCY",type:"string",width:200,isNotSortable:!0},receptionDate:{label:"CONNECTA.TASKS.STARTTIMESTAMP",type:"period",width:210,sortCriteria:"ReceptionDate",filter:{enabled:!0,isMandatory:!1,defaultValue:this.#s()}},endDate:{label:"CONNECTA.TASKS.ENDTIMESTAMP",type:"period",width:210,sortCriteria:"EndDate",filter:{enabled:!0}},processingTime:{label:"CONNECTA.TASKS.TIME",type:"number",width:105,sortCriteria:"ProcessingTime"},msgRows:{label:"DATA_EXTRACTION.COLUMNS.EXTRACTED_ROWS",type:"number",width:140,isNotSortable:!0},extractionId:{label:"DATA_EXTRACTION.COLUMNS.EXTRACTION_ID",type:"string",width:180,isNotSortable:!0},status:{label:"UPLOADS.FILESLIST.COLUMNS.STATUS",type:"combobox",width:180,isNotSortable:!0,filter:{enabled:!0,options:e}},download:{label:"UPLOADS.FILESLIST.COLUMNS.FILEURL",type:"string",width:150,isNotSortable:!0}}}#o(e){return e.map((t,n)=>({id:t.id,name:`${t.id} - ${t.name}`,order:n,icon:null,autosuggestUrl:null,condition:null,nivel:null,additionalInfo:null}))}#s(){let e=new Date,t=new Date;return t.setDate(e.getDate()-30),`${t.toISOString()};${e.toISOString()}`}removeData(e){}getEntity(){return null}getLinkBase(){return""}keyExtractor(e){return e.id}onDataChange(){return V(null)}changeData(e,t,n){}addData(e){}columns(){let e=Object.entries(this.#a).map(([t,n])=>R(A({id:t},n),{label:n.label?this.#e.translate(n.label):t}));return V([{columns:e}])}filterOptions(e){return V([])}filters(){let e=Object.entries(this.#a).filter(([,t])=>t.filter?.enabled).map(([t,n])=>{let i={id:t,label:this.#e.translate(n.label??""),type:this.#r(n.filter)??n.type,data:n.filter.options?.map((s,f)=>({id:s.id,name:s.name,order:f})),isMandatory:!!n.filter?.isMandatory,defaultValue:n.filter?.defaultValue};if(n.filter?.autoSuggestOptionsGetter){let s=i;s.getOptions=f=>n.filter.autoSuggestOptionsGetter(f),s.getOptionsByIds=f=>n.filter.autoSuggestOptionsGetterByIds(f)}return i});return V([{groupId:0,groupLabel:"",filters:e}])}#r(e){return e.type?e.type:e.autoSuggestOptionsGetter?"autosuggest":e.options?"list":null}#l=new ve([]);selectedFilters(){return this.#l.asObservable()}updateSelectedFilters(e){let t=Object.entries(e).map(([n,i])=>({id:n,selectedValue:i,label:n,type:"string"}));this.#l.next([{groupId:1,groupLabel:"Filters",filters:t}])}load(e){let t={};e.filters?.filters?t=A(A({},e.filters.filters),Object.fromEntries(Object.entries(e.filters).filter(([l,c])=>l!=="filters"&&l!=="columns"&&c!==void 0&&c!==null))):e.filters&&typeof e.filters=="object"&&(t=e.filters);let n=l=>l?l.replace(/^\("(.*)"\)$/,"$1").split(","):void 0,i=l=>{if(l)return Array.isArray(l)?l.map(Number):l.toString().split(",").map(Number)},s=l=>{if(l)return Array.isArray(l)?l:l.split(",")},f={limit:e.pageSize,offset:(e.page-1)*e.pageSize,sortAsc:e.sortDirection==="asc",sortBy:this.#a[e.sortColumn]?.sortCriteria??"Default",fields:["None"],fileNames:n(t.fileName),agents:i(t.agent),orchestration:s(t.orchestration)??ct,receptionDateRange:t.receptionDate,endDateRange:t.endDate,statuses:s(t.status),search:t.q,sendChannels:s(t.sendChannel)};return this.#n.getMany(f).pipe($(l=>R(A({},l),{data:l.data.map(c=>R(A({},c),{processingTime:c.processingTime!=null?c.processingTime*1e3:c.processingTime}))})))}saveColumns(e){return z}saveFilters(e){return z}selectedColumns(){return V([...this.defaultVisibleColumns])}static \u0275fac=function(t){return new(t||a)};static \u0275prov=y({token:a,factory:a.\u0275fac})};var j=class a{fileClicked$=new Ee;static \u0275fac=function(t){return new(t||a)};static \u0275prov=y({token:a,factory:a.\u0275fac})};var re=class a{#t=o(null);#e=o(null);#n=o(null);set data(e){this.#t.set(e)}get data(){return this.#t()}set column(e){this.#e.set(e)}get column(){return this.#e()}set dataset(e){this.#n.set(e)}get dataset(){return this.#n()}agentName=m(()=>this.#t()?.agent?.name||"");static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-agent-cell"]],decls:2,vars:1,template:function(t,n){t&1&&(p(0,"span"),D(1),b()),t&2&&(d(),v(n.agentName()))},encapsulation:2,changeDetection:0})};var le=class a{#t=o(null);#e=o(null);#n=o(null);#a=r(X);#i=r(T).getActiveLang();set data(e){this.#t.set(e)}get data(){return this.#t()}set column(e){this.#e.set(e)}get column(){return this.#e()}set dataset(e){this.#n.set(e)}get dataset(){return this.#n()}formattedDate=m(()=>{let e=this.#t();return e&&this.#a.transform(e.receptionDate,"dd/MM/yyyy HH:mm:ss","UTC",this.#i)||""});static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-date-cell"]],features:[W([X])],decls:2,vars:1,template:function(t,n){t&1&&(p(0,"span"),D(1),b()),t&2&&(d(),v(n.formattedDate()))},encapsulation:2,changeDetection:0})};function mt(a,e){if(a&1){let t=Q();h(0,"uve-action-button",2),I("clicked",function(){k(t);let i=E();return O(i.downloadFile())}),S()}if(a&2){let t=E();C("disabled",t.isDisabled())}}function ut(a,e){a&1&&_(0,"uve-action-button",1),a&2&&C("disabled",!0)}var ce=class a{#t=r(M);#e=o(null);#n=o(null);#a=o(null);isDownloading=o(!1);set data(e){this.#e.set(e)}get data(){return this.#e()}set column(e){this.#n.set(e)}get column(){return this.#n()}set dataset(e){this.#a.set(e)}get dataset(){return this.#a()}isDisabled=m(()=>{let e=this.#e();return!e?.hashId||e.hashId.trim()===""});downloadFile(){let e=this.#e();if(!e)return;this.isDownloading.set(!0);let t=B(e.fileName);
1this.#t.downloadFiles({fileId:[{hashId:e.hashId,agentId:e.agent.id,fileName:t}]}).subscribe({next:()=>this.isDownloading.set(!1),error:()=>this.isDownloading.set(!1)})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-download-cell"]],decls:2,vars:1,consts:[["icon","fa-light fa-cloud-arrow-down","type","secondary",3,"disabled"],["icon","fa-light fa-spinner fa-spin","type","secondary",3,"disabled"],["icon","fa-light fa-cloud-arrow-down","type","secondary",3,"clicked","disabled"]],template:function(t,n){t&1&&G(0,mt,1,1,"uve-action-button",0)(1,ut,1,1,"uve-action-button",1),t&2&&H(n.isDownloading()?1:0)},dependencies:[ae],encapsulation:2,changeDetection:0})};var de=class a{#t=o(null);#e=o(null);#n=o(null);#a=r(X);#i=r(T).getActiveLang();set data(e){this.#t.set(e)}get data(){return this.#t()}set column(e){this.#e.set(e)}get column(){return this.#e()}set dataset(e){this.#n.set(e)}get dataset(){return this.#n()}formattedEndDate=m(()=>{let e=this.#t();return!e||e.status==="Processing"?null:this.#a.transform(e.endDate,"dd/MM/yyyy HH:mm:ss","UTC",this.#i)||""});static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-end-date-cell"]],features:[W([X])],decls:2,vars:1,template:function(t,n){t&1&&(p(0,"span"),D(1),b()),t&2&&(d(),v(n.formattedEndDate()))},encapsulation:2,changeDetection:0})};var me=class a{#t=o(null);#e=o(null);#n=o(null);set data(e){this.#t.set(e)}get data(){return this.#t()}set column(e){this.#e.set(e)}get column(){return this.#e()}set dataset(e){this.#n.set(e)}get dataset(){return this.#n()}extractionId=m(()=>ye(this.#t()?.fileName??""));static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-extraction-id-cell"]],decls:2,vars:2,consts:[[3,"title"]],template:function(t,n){t&1&&(p(0,"span",0),D(1),b()),t&2&&(ee("title",n.extractionId()),d(),v(n.extractionId()))},encapsulation:2,changeDetection:0})};var ue=class a{#t=r(j);#e=o(null);#n=o(null);#a=o(null);set data(e){this.#e.set(e)}get data(){return this.#e()}set column(e){this.#n.set(e)}get column(){return this.#n()}set dataset(e){this.#a.set(e)}get dataset(){return this.#a()}displayName=m(()=>B(this.#e()?.fileName??""));fileIcon=m(()=>{switch(this.displayName()?.split(".").pop()?.toLowerCase()){case"pdf":return"fa-regular fa-file-pdf t-text-uve-danger";case"xls":case"xlsx":return"fa-regular fa-file-excel t-text-uve-success";case"csv":return"fa-regular fa-file-csv t-text-uve-green-30";case"txt":return"fa-regular fa-file-lines t-text-uve-neutral-60";case"xml":return"fa-regular fa-file-code t-text-uve-warning";default:return"fa-regular fa-file t-text-uve-neutral-40"}});clicked(){this.#t.fileClicked$.next({task:this.#e()})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-file-name-cell"]],decls:4,vars:4,consts:[[1,"t-flex","t-items-center","t-gap-2"],["type","button",1,"t-truncate","t-text-uve-primary","t-bg-transparent","t-border-0","t-p-0","hover:t-underline",3,"click","title"]],template:function(t,n){t&1&&(p(0,"div",0),Z(1,"i"),p(2,"button",1),we("click",function(){return n.clicked()}),D(3),b()()),t&2&&(d(),te(n.fileIcon()+" t-flex-shrink-0"),d(),ee("title",n.displayName()),d(),Pe(" ",n.displayName()," "))},encapsulation:2,changeDetection:0})};var pe=class a{#t=o(null);#e=o(null);#n=o(null);set data(e){this.#t.set(e)}get data(){return this.#t()}set column(e){this.#e.set(e)}get column(){return this.#e()}set dataset(e){this.#n.set(e)}get dataset(){return this.#n()}channel=m(()=>Se(this.#t()?.fileName??""));icon=m(()=>{switch(this.channel()){case"Mail":return"fa-regular fa-envelope t-text-blue-500";case"FTP":return"fa-regular fa-server t-text-green-500";case"API":return"fa-regular fa-globe t-text-purple-500";case"BlobAzure":return"fa-regular fa-cloud t-text-cyan-500";default:return"fa-regular fa-question t-text-gray-400"}});label=m(()=>{switch(this.channel()){case"Mail":return"DATA_EXTRACTION.CHANNEL.MAIL";case"FTP":return"DATA_EXTRACTION.CHANNEL.FTP";case"API":return"DATA_EXTRACTION.CHANNEL.API";case"BlobAzure":return"DATA_EXTRACTION.CHANNEL.BLOB_AZURE";default:return"DATA_EXTRACTION.CHANNEL.UNKNOWN"}});static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-send-channel-cell"]],decls:5,vars:5,consts:[[1,"t-flex","t-items-center","t-gap-2"]],template:function(t,n){t&1&&(p(0,"div",0),Z(1,"i"),p(2,"span"),D(3),x(4,"transloco"),b()()),t&2&&(d(),te(n.icon()),d(2),v(N(4,3,n.label())))},dependencies:[ne],encapsulation:2,changeDetection:0})};var fe=class a{#t=r(T);#e=o(null);#n=o(null);#a=o(null);set data(e){this.#e.set(e)}get data(){return this.#e()}set column(e){this.#n.set(e)}get column(){return this.#n()}set dataset(e){this.#a.set(e)}get dataset(){return this.#a()}#i={Processing:"UPLOADS.FILESLIST.STATUS.PROCESSING",WithErrors:"UPLOADS.FILESLIST.STATUS.WITH_ERRORS",NotProcessed:"UPLOADS.FILESLIST.STATUS.NOT_PROCESSED",Processed:"UPLOADS.FILESLIST.STATUS.PROCESSED",Reprocessed:"UPLOADS.FILESLIST.STATUS.REPROCESSED",Scheduled:"UPLOADS.FILESLIST.STATUS.SCHEDULED",Disabled:"UPLOADS.FILESLIST.STATUS.DISABLED",Unknown:"UPLOADS.FILESLIST.STATUS.UNKNOWN"};#o={NotProcessed:"red",Processed:"green",Processing:"gray",WithErrors:"yellow",Reprocessed:"purple",Scheduled:"blue",Disabled:"gray",Unknown:"red"};#s={Processing:"fa-light fa-spinner fa-spin",WithErrors:"fa-light fa-triangle-exclamation",NotProcessed:"fa-light fa-circle-xmark",Processed:"fa-light fa-circle-check",Reprocessed:"fa-light fa-arrows-rotate",Scheduled:"fa-light fa-clock",Disabled:"fa-light fa-ban",Unknown:"fa-light fa-circle-question"};colorClass=m(()=>{let e=this.#e()?.status;return e&&this.#o[e]||"white"});iconClass=m(()=>{let e=this.#e()?.status;return e&&this.#s[e]||""});label=m(()=>{let e=this.#e()?.status,t=e&&this.#i[e]||"UPLOADS.FILESLIST.STATUS.UNKNOWN";return this.#t.translate(t)}
1);static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-status-cell"]],decls:2,vars:3,consts:[[1,"t-flex","t-w-[150px]","t-justify-center"],["rounded","","block","",3,"color","icon","label"]],template:function(t,n){t&1&&(h(0,"div",0),_(1,"uve-state-button",1),S()),t&2&&(d(),C("color",n.colorClass())("icon",n.iconClass())("label",n.label()))},dependencies:[We],encapsulation:2,changeDetection:0})};var ge=class a{#t=o(null);#e=o(null);#n=o(null);set data(e){this.#t.set(e)}get data(){return this.#t()}set column(e){this.#e.set(e)}get column(){return this.#e()}set dataset(e){this.#n.set(e)}get dataset(){return this.#n()}formattedTime=m(()=>{let e=this.#t();if(!e||e.status==="Processing"||e.status==="Scheduled"||e.status==="Disabled")return null;let t=e.processingTime;if(t!=null&&t<0)return null;if(!t)return"0:00:00";let n=Math.floor(t/1e3),i=Math.floor(n/3600),s=Math.floor(n%3600/60),f=n%60;return`${i}:${s.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`});static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-de-time-cell"]],decls:2,vars:1,template:function(t,n){t&1&&(p(0,"span"),D(1),b()),t&2&&(d(),v(n.formattedTime()))},encapsulation:2,changeDetection:0})};var Y=class a{customCells={fileName:ue,agent:re,sendChannel:pe,extractionId:me,receptionDate:le,endDate:de,processingTime:ge,status:fe,download:ce,frequency:ot};getCellComponentOf(e){return this.customCells[e.id]||null}static \u0275fac=function(t){return new(t||a)};static \u0275prov=y({token:a,factory:a.\u0275fac})};var pt=["snackbar"],ft=()=>["list"];function gt(a,e){if(a&1){let t=Q();h(0,"div",2)(1,"uve-action-back-button",5),I("clicked",function(){k(t);let i=E();return O(i.goBack())}),S(),h(2,"uve-shared-header-actions",6),x(3,"transloco"),x(4,"uppercase"),h(5,"uve-action-button",7),x(6,"transloco"),I("clicked",function(){k(t);let i=E();return O(i.refreshDataGrid())}),S(),h(7,"uve-action-button",8),x(8,"transloco"),I("clicked",function(){k(t);let i=E();return O(i.navigateToLauncher())}),S()()()}if(a&2){let t=E();d(2),C("dataset",t.dataset)("title",N(4,9,N(3,7,"DATA_EXTRACTION.TITLE")))("useDatasetTotal",!0),d(3),C("label",N(6,11,"COMMON.REFRESH"))("disabled",t.isRefreshing())("icon",t.isRefreshing()?"fa-light fa-spinner fa-spin":"fa-light fa-rotate-right"),d(2),C("label",N(8,13,"COMMON.NEW"))}}function Ct(a,e){a&1&&_(0,"mat-progress-bar",3)}function ht(a,e){if(a&1){let t=Q();Oe(0,4),h(1,"uve-shared-dataset-toolbar",9),x(2,"async"),h(3,"uve-shared-responsive-button",10),I("onclick",function(){k(t);let i=E();return O(!i.isDownloading()&&i.downloadFiles(i.dataset.select))}),S(),h(4,"uve-shared-responsive-button",11),I("onclick",function(){k(t);let i=E();return O(!i.isProcessingAction()&&i.toggleEnabledSelected())}),S(),h(5,"uve-shared-responsive-button",12),I("onclick",function(){k(t);let i=E();return O(!i.isProcessingAction()&&i.deleteSelected())}),S()(),_(6,"uve-shared-table-responsive-wrapper",13),Ie()}if(a&2){let t=E();d(),C("views",Fe(18,ft))("appearActions",N(2,16,t.dataset.select.areSomeSelected$()))("dataset",t.dataset)("showSearchBar",!0),d(2),C("disabled",t.isDownloadDisabled()||t.isDownloading())("icon",t.isDownloading()?"fa-light fa-spinner fa-spin":"fa-light fa-cloud-arrow-down"),d(),C("text",t.disabledActionsEnabled()?"CONNECTA.SCHEDULED_TASKS.ENABLE":"CONNECTA.SCHEDULED_TASKS.DISABLE")("disabled",!t.scheduledActionsEnabled()&&!t.disabledActionsEnabled()||t.isProcessingAction())("icon",t.isProcessingAction()?"fa-light fa-spinner fa-spin":t.disabledActionsEnabled()?"fa-light fa-play":"fa-light fa-pause"),d(),C("disabled",!t.deletableActionsEnabled()||t.isProcessingAction())("icon",t.isProcessingAction()?"fa-light fa-spinner fa-spin":"fa-light fa-trash"),d(),C("dataset",t.dataset)("customCellsService",t.customCellsService)("paginationEnabled",!1)("itemSelectorEnabled",!0)("dragAndSelectEnabled",!1)}}var Ce=class a{#t=r(ze);#e=r(ke);#n=r(j);#a=r(K);#i=r(M);#o=r(Be);#s=r(je);#r=r(st);#l=r(lt);customCellsService=r(Y);#f=r(it);#g=r(Ge);#C=r(T);dataset;isRefreshing=o(!1);isDownloading=o(!1);isProcessingAction=o(!1);snackbar=Le("snackbar");selectedTasks=o([]);isDownloadDisabled=m(()=>{let e=this.selectedTasks();return e.length===0||e.length>40?!0:e.some(t=>!t.hashId||t.hashId.trim()==="")});#c=m(()=>rt(this.selectedTasks()));scheduledActionsEnabled=m(()=>this.#c().scheduled);disabledActionsEnabled=m(()=>this.#c().disabled);deletableActionsEnabled=m(()=>this.#c().deletable);#m=["receptionDate","status","agent","fileName","endDate","sendChannel","orchestration"];ngOnInit(){this.#h(),this.#n.fileClicked$.pipe(U(this.#e)).subscribe(e=>{let t=e.task,n=t.status==="Scheduled",i=t.fileName,s=be(i),f=De(s),l=t.orchestration??"",c=l.toLowerCase().startsWith("custom")||l.includes("Personalizado"),P=Object.entries(f).filter(([F])=>F!=="siptype"&&F!=="sipagent").map(([F,L])=>({key:F,value:L}
1)),J={id:t.id,processId:l,isScheduled:n,isCustom:c,parameters:P};this.#f.set(t.id,J),this.#s.navigate([at,t.id])})}#h(){this.#D();let e=this.#y();this.dataset=this.#t.build(this.#a,{hiddenColumns:this.#a.hiddenColumns,initialSortColumn:"receptionDate",initialSortDirection:"desc",infiniteScroll:!0,infiniteScrollTable:!0,initialPageSize:40,syncUrl:!1,routeReuseId:"connecta-data-extraction",initialQuery:e}),this.#S(),this.#b()}#b(){this.dataset.select.selected$().pipe(U(this.#e)).subscribe(()=>this.selectedTasks.set(this.dataset.select.getValues()))}deleteSelected(){if(this.selectedTasks().length===0||this.isProcessingAction())return;let e=new Je(this.#g);e.buildPopup({title:"CONNECTA.DELETE",description:this.#C.translate("CONNECTA.SCHEDULED_TASKS.DELETE_CONFIRM"),closeButton:!1,size:"medium",okButton:"COMMON.YES",koButton:"COMMON.NO"}),e.koAction().pipe(U(this.#e)).subscribe(()=>e.context.closeOverlay()),e.okAction().pipe(U(this.#e)).subscribe(()=>{e.context.closeOverlay(),this.#d("DELETE",t=>this.#r.deleteScheduledSipTask(t.id))})}toggleEnabledSelected(){this.disabledActionsEnabled()?this.#d("ENABLE",e=>this.#r.enableScheduledSipTask(e.id)):this.scheduledActionsEnabled()&&this.#d("DISABLE",e=>this.#r.disableScheduledSipTask(e.id))}#d(e,t){let n=this.selectedTasks();n.length===0||this.isProcessingAction()||(this.isProcessingAction.set(!0),this.#l.run(n.map(t),e).pipe(U(this.#e)).subscribe(i=>{this.isProcessingAction.set(!1),i.succeeded>0&&(this.dataset.select.clear(),this.refreshDataGrid()),this.snackbar()?.show(i.snackbar)}))}downloadFiles(e){let t=e.getValues().filter(i=>i.hashId&&i.hashId.trim()!=="");if(t.length===0)return;this.isDownloading.set(!0);let n=t.map(i=>({hashId:i.hashId,agentId:i.agent.id,fileName:B(i.fileName)}));this.#i.downloadFiles({fileId:n}).subscribe({next:()=>this.isDownloading.set(!1),error:()=>this.isDownloading.set(!1)})}navigateToLauncher(){this.#s.navigate([nt])}goBack(){this.#s.navigate(["/portal/configuration"])}refreshDataGrid(){this.isRefreshing.set(!0),this.dataset.reload(),this.dataset.state.isLoading$().pipe(xe(e=>!e),Ae(1)).subscribe(()=>this.isRefreshing.set(!1))}#u(){let e=this.#o.snapshot.queryParams,t={};return Object.keys(e).forEach(n=>{if(!n.startsWith("gf_"))return;let i=n.substring(3);if(!this.#m.includes(i))return;let s=e[n];if(i==="receptionDate"&&typeof s=="string"&&s.includes(";")){let[f,l]=s.split(";"),c=this.#p(f),P=this.#p(l);c&&P&&(t[i]=`${c};${P}`)}else t[i]=s}),t}#p(e){let[t,n,i]=e.split("-"),s=new Date(Date.UTC(parseInt(i),parseInt(n)-1,parseInt(t)));return isNaN(s.getTime())?null:s.toISOString()}#D(){let e=this.#u();Object.keys(e).length===0&&(e.receptionDate="l7d"),this.#a.updateSelectedFilters(e)}#y(){let e=this.#u();return{filters:Object.keys(e).length>0?e:{receptionDate:"l7d"},columns:this.#a.defaultVisibleColumns}}#S(){this.dataset._query.query$().pipe(U(this.#e)).subscribe(e=>this.#E(e))}#E(e){let t=this.#o.snapshot.queryParams,n={},i={};e.filters?.filters?i=Object.fromEntries(Object.entries(e.filters).filter(([l,c])=>l!=="filters"&&l!=="columns"&&c!==void 0&&c!==null)):e.filters&&typeof e.filters=="object"&&(i=e.filters),Object.keys(i).forEac
1h(l=>{let c=i[l];if(!(!this.#m.includes(l)||c===null||c===void 0||c===""))if(l==="receptionDate"&&typeof c=="string"&&c.includes(";")){let[P,J]=c.split(";"),F=L=>!isNaN(new Date(L).getTime())&&L.includes("T");if(F(P)&&F(J)){let L=dt=>{let he=new Date(dt);return`${he.getUTCDate().toString().padStart(2,"0")}-${(he.getUTCMonth()+1).toString().padStart(2,"0")}-${he.getUTCFullYear()}`};n.gf_receptionDate=`${L(P)};${L(J)}`}}else n[`gf_${l}`]=Array.isArray(c)?c.join(","):c.toString()}),e.columns?.length>0&&(n.columns=e.columns.join(","));let s=JSON.stringify(Object.keys(t).sort().reduce((l,c)=>R(A({},l),{[c]:t[c]}),{})),f=JSON.stringify(Object.keys(n).sort().reduce((l,c)=>R(A({},l),{[c]:n[c]}),{}));s!==f&&this.#s.navigate([],{relativeTo:this.#o,queryParams:n,replaceUrl:!0})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=u({type:a,selectors:[["uve-connecta-data-extraction"]],viewQuery:function(t,n){t&1&&_e(n.snackbar,pt,5),t&2&&Me()},features:[W([K,Y,j])],decls:8,vars:7,consts:[["snackbar",""],[1,"view-wrapper","t-flex","t-flex-col"],[1,"t-flex","t-items-center","t-gap-2"],["mode","indeterminate"],[1,"t-flex-1"],[1,"t-mr-2",3,"clicked"],["currentView","grid",1,"t-flex-1",3,"dataset","title","useDatasetTotal"],["type","secondary",3,"clicked","label","disabled","icon"],["type","primary","icon","fa-light fa-plus",3,"clicked","label"],["view","list",1,"__list-actions",3,"views","appearActions","dataset","showSearchBar"],["type","raised","text","COMMON.DOWNLOAD",3,"onclick","disabled","icon"],["type","raised",3,"onclick","text","disabled","icon"],["type","raised","text","CONNECTA.SCHEDULED_TASKS.DELETE",3,"onclick","disabled","icon"],[1,"t-mt-3","t-flex-1","t-min-h-0",3,"dataset","customCellsService","paginationEnabled","itemSelectorEnabled","dragAndSelectEnabled"]],template:function(t,n){t&1&&(h(0,"div",1),G(1,gt,9,15,"div",2),G(2,Ct,1,0,"mat-progress-bar",3),x(3,"async"),G(4,ht,7,19,"ng-container",4),x(5,"async"),_(6,"uve-overlay-snackbar",null,0),S()),t&2&&(d(),H(n.dataset?1:-1),d(),H(N(3,3,n.dataset==null||n.dataset.state==null?null:n.dataset.state.hasInitialise$)===!1?2:-1),d(2),H(N(5,5,n.dataset==null||n.dataset.state==null?null:n.dataset.state.hasInitialise$)?4:-1))},dependencies:[tt,et,Ze,Ye,Ke,Xe,He,ae,qe,Re,Ue,ne],encapsulation:2,changeDetection:0})};var _a=[{path:"",component:Ce}];export{Ce as DataExtractionComponent,_a as connectaDataExtractionRoutes};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.