1import {DocumentPreviewerComponent as w}from'./chunk-DlN5P0KX.js';import'./chunk-WwYzvBZI.js';import {G}from'./chunk--t8eRwWX.js';import {J as Je,b as b$1,at as Y,U as je,e as eC,c as eb,t as tb,d as ds,p as pu,a2 as $b,f as pw,h as P_,w as wm,X as Dm,ac as Fh,ad as Ph}from'./main-MURRLOR2.js';var b=()=>["jpg","png","jpeg"];function M(e,t){if(e&1&&(ds(0,"div",1),wm(1,"img",3),pu()),e&2){let n=$b(2);pw(),Dm("src",n.fileInfo().url,Fh);}}function E(e,t){if(e&1&&wm(0,"iframe",4),e&2){let n=$b(3);Dm("srcdoc",n.emlPreview(),Ph);}}function O(e,t){if(e&1&&eb(0,E,1,1,"iframe",4),e&2){let n=$b(2);tb(n.emlPreview()?0:-1);}}function S(e,t){if(e&1&&wm(0,"cf-document-previewer",2),e&2){let n=$b(2);Dm("fileInfo",n.fileInfo());}}function D(e,t){if(e&1&&(ds(0,"div",0),eb(1,M,2,1,"div",1)(2,O,1,1)(3,S,1,1,"cf-document-previewer",2),pu()),e&2){let n=$b();pw(),tb(P_(1,b).includes(n.fileInfo().fileExtension.toLowerCase())?1:n.fileInfo().fileExtension.toLowerCase()==="eml"?2:3);}}var x=class e{fileInfo=Je(null);emlPreview=Je(null);activatedRoter=b$1(Y);sanitizer=b$1(je);ngAfterViewInit(){this.fileInfo.set(JSON.parse(localStorage.getItem("PreviewFileInfo")||"null"));let t=this.fileInfo();t?.fileExtension?.toLowerCase()==="eml"&&this.loadEmlPreview(t.url);}async loadEmlPreview(t){try{let n=await fetch(t).then(I=>I.arrayBuffer()),o=await new G().parse(n),h=o.html??o.text??"";this.emlPreview.set(this.sanitizer.bypassSecurityTrustHtml(h));}catch{this.emlPreview.set(null);}}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=eC({type:e,selectors:[["cf-previewer"]],decls:1,vars:1,consts:[[1,"full-page-container"],[1,"image-container"],[3,"fileInfo"],["alt","",3,"src"],["sandbox","allow-same-origin","title","Email preview",1,"eml-iframe",3,"srcdoc"]],template:function(n,o){n&1&&eb(0,D,4,2,"div",0),n&2&&tb(o.fileInfo()?0:-1);},dependencies:[w],styles:["html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%;margin:0;padding:0}.full-page-container[_ngcontent-%COMP%]{height:100vh;width:100vw}.image-container[_ngcontent-%COMP%]{display:flex;justify-content:center;height:100vh}.full-page-container[_ngcontent-%COMP%] .image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%}.eml-iframe[_ngcontent-%COMP%]{width:100%;height:100vh;border:none}"]})};export{x as PreviewerComponent};
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.