-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4.js
1 lines (1 loc) · 119 KB
/
4.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{Mcfc:function(e,t,n){"use strict";n.r(t),n.d(t,"routes",function(){return fi}),n.d(t,"ResourceModule",function(){return mi});var i=n("SVse"),c=n("iInd"),r=n("tHmd"),o=n("u9T3"),s=n("TSSN"),a=n("s7LF"),l=n("o4Yh"),u=n("Dxy4"),d=n("rJgo"),h=n("iELJ"),g=n("gy9y"),b=n("9s9I"),p=n("gXqq"),f=n("ARaq"),m=n("8Y7J");let v=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=m.Nb({type:e}),e.\u0275inj=m.Mb({imports:[[i.c,f.c,s.b.forChild()]]}),e})();var x=n("VbpA"),w=n("0igQ"),P=n("7uiw"),O=n("+yVL");let y=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=m.Nb({type:e}),e.\u0275inj=m.Mb({imports:[[i.c,x.c,w.b,P.b,O.b,s.b.forChild()]]}),e})();var C=n("7KAL"),M=n("ZFy/");let k=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=m.Nb({type:e}),e.\u0275inj=m.Mb({imports:[[i.c,o.a,r.a,C.f,M.b]]}),e})();var _=n("GcOp");let V=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=m.Nb({type:e}),e.\u0275inj=m.Mb({imports:[[i.c,s.b.forChild(),o.a,r.a,a.n,l.a,u.b,d.b,h.e,g.b,b.c,p.f,v,y,_.b,p.a,p.g,p.i,k]]}),e})();var I=n("2Vo4"),F=n("LRne"),E=n("XNiG"),T=n("VRyK"),S=n("lJxs"),U=n("/uUt"),L=n("PZkE"),R=n("q92s"),A=n("pLZG"),z=n("3UWI"),j=n("eIep"),H=n("1G5W"),$=n("Oh6u");let B=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=m.Lb({token:e,factory:e.\u0275fac}),e})();const Q=[10,20,30,40,50,60,70,80,90,100,110,130,150,170,190,210,240,270,300];let W=(()=>{class e{constructor(e,t,n,i,c){this.resourceService=e,this.resourceViewConfig=t,this.route=n,this.router=i,this.tokenService=c,this.textBlock=null,this.searchResults=new I.a(null),this.pdfPage=Object(F.a)(null),this.pdfZoom=new I.a(50),this.zoomLevels=Q,this.makeSearch=new E.a,this.pageChange=new E.a,this.termReset=new E.a,this.pause=new E.a,this.fullScreen=new E.a,this.startTimeAgain=new E.a,this.unsubscribeAll=new E.a}setResource(e,t){var n,i;this.resource=e,this.options=t,this.textBlock=this.resource.hasMainLink?null===(n=this.resource)||void 0===n?void 0:n.getTextFromMainLink():null===(i=this.resource)||void 0===i?void 0:i.getTextFromMainFile(),this.viewType=this.getViewType(this.resource),this.init()}init(){this.updateSearch(),this.checkSearchParams();const e=this.route.snapshot.queryParams;e.q&&!e.term&&this.setSearchTerm(e.q),this.isSinglePagePdf()&&(this.pdfPage=this.getPdfPage())}ngOnDestroy(){this.unsubscribeAll&&(this.unsubscribeAll.next(),this.unsubscribeAll.complete())}getViewType(e){var t,n;let i="other";return e.hasMainLink&&e.isMainLinkEmbed()?i=e.isYoutubeLink()?"link-youtube":"link-embed":e.hasMainLink&&e.getMainLinkPdf()&&(null===(t=this.options)||void 0===t?void 0:t.showLinksAsPdf)?i="link-pdf":e.hasMainLink&&e.getMainLinkImage()?i="link-image":e.hasMainFile&&e.isMainFileMedia()||e.isImportedVideo()?i="media":e.hasMainFile&&"pdf"===e.mainExtension?i="pdf":e.hasMainFile&&e.isMainPDFPreview()?i="pdf-preview":e.hasMainFile&&e.hasSpreadsheetData()?i="spreadsheet":e.hasMainFile&&e.isImagePreview()?i="image":e.hasMainFile&&"zip"===e.mainExtension?i="zip":!e.hasMainFile||"txt"!==e.mainExtension&&"dwg"!==e.mainExtension?e.hasMainFile&&(null===(n=e.html)||void 0===n?void 0:n.html)&&(i="page"):i="text",i}getPause(){return this.pause.asObservable()}getTermReset(){return this.termReset.asObservable()}getSearchResults(){return Object(T.a)(this.searchResults,this.getSearchOrder()).pipe(Object(S.a)(()=>this.getCurrentSortedResults()))}getSearchOrder(){return this.route.queryParams.pipe(Object(S.a)(e=>e.order?e.order:"sequential"),Object(U.a)())}getSearchTerm(){return this.route.queryParams.pipe(Object(S.a)(e=>e.term?e.term:""),Object(U.a)())}getSelectedText(){return this.route.queryParams.pipe(Object(L.a)("paragraph"),Object(S.a)(e=>{var t;if(e.paragraph&&e.source){const n=parseInt(e.paragraph),i=void 0!==e.term,c=this.textBlock.text.find(e=>e.e.init===n);return c?{text:c.p,page:null===(t=c.e.page)||void 0===t?void 0:t[0],fromSearch:i}:null}return null}))}getSelectedTranscript(){const e=this.startTimeAgain.pipe(Object(S.a)(()=>this.route.snapshot.queryParams));return this.route.queryParams.pipe(Object(L.a)("time"),Object(R.a)(e),Object(S.a)(e=>{if(void 0!==e.time){const t=parseFloat(e.time),n=void 0!==e.term,i=this.textBlock.allTranscripts().find(e=>e.start===t);return i?{time:i.start,fromSearch:n}:null}return null}))}getSelectedRow(){return Object(T.a)(this.route.queryParams.pipe(Object(L.a)("tab")),this.route.queryParams.pipe(Object(L.a)("row"))).pipe(Object(S.a)(e=>void 0!==e.tab?{tabIndex:parseInt(e.tab),rowIndex:void 0===e.row?void 0:parseInt(e.row),fromSearch:void 0!==e.term}:null))}getSearchIndex(){return Object(T.a)(this.searchResults,this.route.queryParams).pipe(Object(S.a)(()=>this.getCurrentIndex()))}setSearchTerm(e){const t=this.route.snapshot.queryParams.term;t&&t.length&&""===e&&this.termReset.next(),this.changeQueryParams({term:e.length>0?e:null})}setSearchOrder(e){this.changeQueryParams({order:"sequential"!==e?e:null})}selectTranscript(e){e.start===parseFloat(this.route.snapshot.queryParams.time)?this.startTimeAgain.next():this.changeQueryParams({time:e.start})}selectSearchTranscript(e){const t=this.getTranscript(e);t&&this.selectTranscript(t)}selectText(e){var t;const n={paragraph:null===(t=e.e.init)||void 0===t?void 0:t.toString(),source:e.e.source};this.changeQueryParams(n)}selectSearchText(e){this.changeQueryParams({paragraph:e.init,source:e.source})}selectRow(e,t){this.changeQueryParams({tab:e,row:t})}selectSearchRow(e){const t=this.getRow(e);t&&this.selectRow(t.tabIndex,t.rowIndex)}getPdfPage(){const e=this.getSelectedText().pipe(Object(A.a)(e=>null!==e),Object(S.a)(e=>"link-pdf"===this.viewType?{index:0,url:this.getFullPdfUrl()}:{index:e.page,url:this.resourceService.getPageUrl(this.resource,e.page)}));return Object(T.a)(e,this.pageChange)}setPdfPage(e){this.clearSelected(),this.pageChange.next({index:e,url:this.resourceService.getPageUrl(this.resource,e)})}getPdfZoom(){return this.pdfZoom.asObservable()}setPdfZoom(e){this.pdfZoom.next(Math.round(e))}zoomInPdf(){const e=this.pdfZoom.getValue(),t=this.zoomLevels.indexOf(e);t>-1?t===this.zoomLevels.length-1||this.setPdfZoom(this.zoomLevels[t+1]):this.setPdfZoom(50)}zoomOutPdf(){const e=this.pdfZoom.getValue(),t=this.zoomLevels.indexOf(e);t>-1?0===t||this.setPdfZoom(this.zoomLevels[t-1]):this.setPdfZoom(50)}setFullScreen(){this.fullScreen.next()}checkSearchParams(){const e=this.route.snapshot.queryParams;if(e.term&&e.fromParagraph&&e.fromSource){let t={};if("media"===this.viewType||"link-youtube"===this.viewType){const n=this.getTranscriptFromPosition(parseInt(e.fromParagraph));n&&(t={time:n.start})}else this.isPdf()&&(t={paragraph:e.fromParagraph,source:e.fromSource});this.changeQueryParams(Object.assign(Object.assign({},t),{fromParagraph:null,fromSource:null}))}}changeQueryParams(e){this.router.navigate(["."],{queryParams:e,queryParamsHandling:"merge",relativeTo:this.route,replaceUrl:!0})}getTextIndex(e,t){const n=this.getCurrentSortedResults();if(n){const i=n.findIndex(n=>void 0!==n.init&&parseInt(n.init)===e&&n.source===t);return i>-1?i:void 0}}getTranscriptIndex(e){const t=this.getCurrentSortedResults();if(t){const n=t.findIndex(t=>{const n=this.getTranscript(t);return n&&n.start===e});return n>-1?n:void 0}}getRowIndex(e,t){const n=this.getCurrentSortedResults();if(n){const i=n.findIndex(n=>{const i=this.getRow(n);return i&&i.tabIndex===e&&i.rowIndex===t});return i>-1?i:void 0}}clearSelected(){this.changeQueryParams({paragraph:null,time:null,source:null,tab:null,row:null})}updateSearch(){const e=this.getSearchTerm().pipe(Object(z.a)(200));Object(T.a)(this.makeSearch,e).pipe(Object(j.a)(e=>""!==e.trim()?this.resourceService.searchParagraph(this.resource,e):Object(F.a)(null)),Object(H.a)(this.unsubscribeAll)).subscribe(e=>{null!==this.getCurrentSortedResults()&&this.clearSelected(),this.searchResults.next(null===e?e:e.results?e.results:[])})}search(e){this.makeSearch.next(e)}nextTranscript(){const e=this.nextResult(e=>void 0!==this.getTranscript(e));e&&this.selectSearchTranscript(e)}prevTranscript(){const e=this.prevResult(e=>void 0!==this.getTranscript(e));e&&this.selectSearchTranscript(e)}nextText(){const e=this.nextResult(e=>e.isFtf()||e.isFtl());e&&this.selectSearchText(e)}prevText(){const e=this.prevResult(e=>e.isFtf()||e.isFtl());e&&this.selectSearchText(e)}nextRow(){const e=this.nextResult(e=>void 0!==this.getRow(e));e&&this.selectSearchRow(e)}prevRow(){const e=this.prevResult(e=>void 0!==this.getRow(e));e&&this.selectSearchRow(e)}nextResult(e){const t=this.getCurrentIndex(),n=this.getCurrentSortedResults();let i=-1;for(let c=t+1;c<n.length;c++)if(void 0!==e(n[c])){i=c;break}if(-1!==i)return n[i]}prevResult(e){const t=this.getCurrentIndex(),n=this.getCurrentSortedResults();let i=-1;for(let c=t-1;c>=0;c--)if(void 0!==e(n[c])){i=c;break}if(-1!==i)return n[i]}getTranscript(e){let t;if(this.textBlock&&this.textBlock.allTranscripts().length>0){const n=new RegExp("\n","g"),i=new RegExp("^[.]+"),c=new RegExp("[.]+$"),r=new RegExp("[\\s.]","g");t=this.textBlock.allTranscripts().find(t=>{const o=t.text.replace(n,"").trim();let s=o===e.body;if(s||"."!==e.body[0]||(s=o===e.body.replace(i,"")),s||"."!==e.body.slice(-1)||(s=o===e.body.replace(c,"")),!s){const t=o.replace(r,""),n=e.body.replace(r,"");s=t===n,!s&&n.length>50&&(s=t.indexOf(n)>=0),!s&&t.length>50&&(s=n.indexOf(t.slice(4))>=0)}return s})}return t}getTranscriptFromPosition(e){let t;return this.textBlock&&this.textBlock.allTranscripts().length>0&&(t=this.textBlock.allTranscripts().find(t=>t.start_position===e-1||t.start_position===e||t.start_position===e+1)),t}getRow(e){return this.resource.getSpreadsheetTabs().getRowByOrder(parseInt(e.order))}sortResultsSequentially(e){return e.slice().sort((e,t)=>parseInt(e.order)-parseInt(t.order))}getCurrentIndex(){const e=this.route.snapshot.queryParams;return e.term&&e.paragraph&&e.source?this.getTextIndex(parseInt(e.paragraph),e.source):e.term&&void 0!==e.time?this.getTranscriptIndex(parseFloat(e.time)):e.term&&void 0!==e.tab&&void 0!==e.row?this.getRowIndex(parseInt(e.tab),parseInt(e.row)):void 0}getCurrentSortedResults(){const e=this.route.snapshot.queryParams,t=this.searchResults.getValue();return t&&t.length&&!e.order?this.sortResultsSequentially(t):t}pauseMedia(){this.pause.next()}isPdf(){return"pdf"==this.viewType||"pdf-preview"==this.viewType||"link-pdf"==this.viewType}isSinglePagePdf(){return this.isPdf()&&(this.resource.hasSegmentedPdf()||"link-pdf"===this.viewType)}isSpreadsheet(){return"spreadsheet"===this.viewType}getFullPdfUrl(){var e,t;return"pdf-preview"===this.viewType?`${null===(e=this.resource)||void 0===e?void 0:e.url}/@download/previews/${$.d}`:"link-pdf"===this.viewType?this.resource.getMainLinkPdf():`${null===(t=this.resource)||void 0===t?void 0:t.url}/@download/files/${$.d}`}download(e=!1,t=!1){if(this.resource){const n=t?"previews":"files",i=e?"&disposition=inline":"";(this.resourceViewConfig.isPublicResource()?Object(F.a)({token:""}):this.tokenService.getTempToken()).subscribe(e=>{var t;window.open(`${null===(t=this.resource)||void 0===t?void 0:t.url}/@download/${n}/${$.d}?ws_token=${e.token}${i}`)})}}canShowSource(){return["pdf","pdf-preview","image","media","link-youtube","link-image","link-embed","link-pdf","spreadsheet"].indexOf(this.viewType)>-1||!!this.resource.getOriginLink()||!!this.resource.getMainLink()}showSource(e){"image"===e&&this.resourceViewConfig.getOptions().imageZoomEnabled?this.resourceViewConfig.onZoomImage(this.resource.url+"/@download/files/"+$.d,this.resource.title):this.download(!0)}}return e.\u0275fac=function(t){return new(t||e)(m.Zb($.f),m.Zb(B),m.Zb(c.a),m.Zb(c.e),m.Zb(g.c))},e.\u0275prov=m.Lb({token:e,factory:e.\u0275fac}),e})();var D=n("VDRc"),N=n("zuBV"),q=n("YrdD");const J=["menu"],Z=["*"];let G=(()=>{class e{constructor(){}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-context-menu"]],viewQuery:function(e,t){if(1&e&&m.Lc(J,1),2&e){let e;m.sc(e=m.ec())&&(t.matMenu=e.first)}},inputs:{minWidth:"minWidth"},ngContentSelectors:Z,decls:4,vars:2,consts:[[1,"context-menu"],["menu","matMenu"]],template:function(e,t){1&e&&(m.mc(),m.Vb(0,"mat-menu",0,1),m.Vb(2,"div"),m.lc(3),m.Ub(),m.Ub()),2&e&&(m.Eb(2),m.Cc("min-width",t.minWidth?t.minWidth:null))},directives:[d.a],styles:[".mat-menu-panel.context-menu{border-radius:0;box-shadow:2px 2px 10px rgba(0,0,0,.16);min-height:0;min-width:0} .mat-menu-panel.context-menu .mat-menu-content{padding:0}"]}),e})();const K=["*"];let Y=(()=>{class e{constructor(){this.clickButton=new m.n}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-context-menu-item"]],outputs:{clickButton:"clickButton"},ngContentSelectors:K,decls:2,vars:0,consts:[[3,"click"]],template:function(e,t){1&e&&(m.mc(),m.Vb(0,"button",0),m.dc("click",function(){return t.clickButton.emit()}),m.lc(1),m.Ub())},styles:['[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%]:after{background-color:#fafafa;content:"";display:block;height:1px}[_nghost-%COMP%]::last-child:after{display:none}button[_ngcontent-%COMP%]{-webkit-appearance:none;align-items:center;background:transparent;border:none;color:inherit;cursor:pointer;display:flex;font:inherit;height:37px;margin:0;padding:0 14px;width:auto;width:100%}button[_ngcontent-%COMP%]:hover{background-color:#f7f7f8}']}),e})();var X=n("dRYV"),ee=n("G1b6");function te(e,t){1&e&&m.Qb(0,"svg-icon",19),2&e&&m.nc("src","assets/icons/"+t.ngIf)}function ne(e,t){1&e&&m.Qb(0,"div",20)}function ie(e,t){if(1&e&&(m.Vb(0,"button",21),m.Qb(1,"svg-icon",22),m.Ub()),2&e){m.hc();const e=m.tc(18);m.nc("matMenuTriggerFor",e.matMenu)}}function ce(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-context-menu-item",23),m.dc("clickButton",function(){return m.xc(e),m.hc(2).edit()}),m.Hc(1),m.ic(2,"translate"),m.Ub()}2&e&&(m.Eb(1),m.Jc(" ",m.jc(2,1,"resource.edit")," "))}function re(e,t){if(1&e&&(m.Vb(0,"stf-context-menu-item"),m.Vb(1,"a",24),m.Hc(2),m.ic(3,"translate"),m.Ub(),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("href",e.resource.getMainLink(),m.zc),m.Eb(1),m.Ic(m.jc(3,2,"generic.go"))}}function oe(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-context-menu-item",23),m.dc("clickButton",function(){return m.xc(e),m.hc(2).resourceView.download()}),m.Hc(1),m.ic(2,"translate"),m.Ub()}2&e&&(m.Eb(1),m.Jc(" ",m.jc(2,1,"generic.download")," "))}function se(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-context-menu-item",23),m.dc("clickButton",function(){return m.xc(e),m.hc(2).delete()}),m.Hc(1),m.ic(2,"translate"),m.Ub()}2&e&&(m.Eb(1),m.Jc(" ",m.jc(2,1,"generic.delete")," "))}function ae(e,t){if(1&e){const e=m.Wb();m.Vb(0,"img",25),m.dc("click",function(){m.xc(e);const t=m.hc(2);return t.canZoom()?t.showThumbnail():null}),m.Ub()}2&e&&m.nc("src",t.ngIf,m.zc)}function le(e,t){if(1&e&&(m.Vb(0,"div",1),m.Vb(1,"div",2),m.Fc(2,te,1,1,"svg-icon",3),m.ic(3,"mimeIcon"),m.Ub(),m.Vb(4,"div",4),m.Vb(5,"div",5),m.Hc(6),m.Ub(),m.Vb(7,"div",6),m.Vb(8,"div",7),m.Qb(9,"stf-user",8),m.Fc(10,ne,1,0,"div",9),m.Vb(11,"div"),m.Hc(12),m.ic(13,"date"),m.Ub(),m.Ub(),m.Qb(14,"stf-render-tags",10),m.Ub(),m.Ub(),m.Vb(15,"div",11),m.Fc(16,ie,2,1,"button",12),m.Vb(17,"stf-context-menu",13,14),m.Fc(19,ce,3,3,"stf-context-menu-item",15),m.Fc(20,re,4,4,"stf-context-menu-item",16),m.Fc(21,oe,3,3,"stf-context-menu-item",15),m.Fc(22,se,3,3,"stf-context-menu-item",15),m.Ub(),m.Ub(),m.Vb(23,"div",17),m.Fc(24,ae,1,1,"img",18),m.ic(25,"getfile"),m.Ub(),m.Ub()),2&e){const e=m.tc(18),t=m.hc();m.Eb(2),m.nc("ngIf",m.jc(3,14,t.resource.icon)),m.Eb(4),m.Ic(t.resource.title),m.Eb(3),m.nc("id",t.resource.getFirstAuthor()),m.Eb(1),m.nc("ngIf",t.resource.getFirstAuthor()&&t.resource.modification_date),m.Eb(2),m.Ic(m.kc(13,16,t.resource.modification_date,"dd - LL - yyyy")),m.Eb(2),m.nc("tags",t.resource.getTags()),m.Eb(2),m.nc("ngIf",(null==e?null:e.matMenu)&&t.showActions()),m.Eb(3),m.nc("ngIf",t.resource.write),m.Eb(1),m.nc("ngIf",t.resource.hasMainLink),m.Eb(1),m.nc("ngIf",t.resource.hasMainFile),m.Eb(1),m.nc("ngIf",t.resource.delete),m.Eb(1),m.Cc("cursor",t.canZoom()?"pointer":null),m.Eb(1),m.nc("ngIf",m.jc(25,19,t.getMainImage()))}}let ue=(()=>{class e{constructor(e,t,n,i,c,r,o){this.dialog=e,this.resourceViewConfig=t,this.resourceService=n,this.resourceView=i,this.stateService=c,this.route=r,this.router=o}ngOnInit(){}getMainImage(){var e;return(null===(e=this.resource)||void 0===e?void 0:e.thumbnail)?`${this.resource.url}/@download${this.resource.thumbnail}`:"/assets/images/default_image.jpg"}showThumbnail(){this.resource&&this.resource.thumbnail&&this.resourceViewConfig.onZoomImage(`${this.resource.url}/@download${this.resource.thumbnail}`,this.resource.title)}canZoom(){return this.resourceViewConfig.getOptions().imageZoomEnabled}showActions(){return this.resourceViewConfig.getOptions().contextMenuEnabled&&(this.resource.write||this.resource.delete||this.resource.hasMainFile||this.resource.hasMainLink)}delete(){this.dialog.open(p.c,{width:"550px",data:{title:"confirm.delete_title"}}).afterClosed().subscribe(e=>{e&&this.resourceService.deleteResource(this.resource.url).subscribe(()=>{this.router.navigate([`${this.stateService.getStashWebUrl()}`])})})}edit(){this.router.navigate(["./edit"],{relativeTo:this.route,replaceUrl:!0})}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(h.b),m.Pb(B),m.Pb($.f),m.Pb(W),m.Pb($.j),m.Pb(c.a),m.Pb(c.e))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-header"]],inputs:{resource:"resource"},decls:1,vars:1,consts:[["class","resource-header","fxLayout","row",4,"ngIf"],["fxLayout","row",1,"resource-header"],["fxFlex","0 0 auto","fxLayout","center","fxLayoutAlign","center start",1,"resource-header-icon"],[3,"src",4,"ngIf"],["fxFlex","1 1 auto",1,"resource-header-main"],[1,"resource-header-title"],["fxLayout","row wrap","fxLayoutAlign","start center","fxLayoutGap","24px",1,"resource-header-subtitle"],["fxLayout","row","fxLayoutAlign","start center",1,"resource-header-info"],["only_name","",3,"id"],["class","resource-header-info-divider",4,"ngIf"],["size","small",3,"tags"],["fxFlex","0 0 auto","fxLayout","row","fxLayoutAlign","center start",1,"resource-header-actions"],["fxLayout","row","fxLayoutAlign","center center","aria-label","Actions",3,"matMenuTriggerFor",4,"ngIf"],["minWidth","136px"],["menu",""],[3,"clickButton",4,"ngIf"],[4,"ngIf"],["fxFlex","0 0 auto",1,"resource-header-thumbnail"],[3,"src","click",4,"ngIf"],[3,"src"],[1,"resource-header-info-divider"],["fxLayout","row","fxLayoutAlign","center center","aria-label","Actions",3,"matMenuTriggerFor"],["src","assets/icons/dots-vertical.svg"],[3,"clickButton"],["target","_blank","rel","noopener noreferrer",1,"resource-header-link",3,"href"],[3,"src","click"]],template:function(e,t){1&e&&m.Fc(0,le,26,21,"div",0),2&e&&m.nc("ngIf",t.resource)},directives:[i.n,D.d,D.b,D.c,D.e,N.a,q.a,G,r.b,d.c,Y],pipes:[X.a,i.e,ee.a,s.c],styles:[".resource-header[_ngcontent-%COMP%]{background-color:#2d2d2d;height:192px;position:relative}.resource-header-icon[_ngcontent-%COMP%]{margin-top:26px;width:84px}.resource-header-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .resource-header-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{fill:#fff!important}.resource-header-main[_ngcontent-%COMP%]{margin-top:26px}.resource-header-title[_ngcontent-%COMP%]{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--stf-white);display:-webkit-box;font-size:var(--stf-font-size-title);font-weight:var(--stf-font-weight-bold);line-height:1.3;overflow:hidden;text-overflow:ellipsis}.resource-header-subtitle[_ngcontent-%COMP%]{line-height:1.3}.resource-header-info[_ngcontent-%COMP%]{color:var(--stf-white);font-size:var(--stf-font-size-ssmall);font-style:italic}.resource-header-info-divider[_ngcontent-%COMP%]{background-color:var(--stf-white);height:1em;margin:0 6px;width:1px}.resource-header[_ngcontent-%COMP%] stf-render-tags[_ngcontent-%COMP%]{margin-top:10px}.resource-header-actions[_ngcontent-%COMP%]{margin-top:26px;width:84px}.resource-header-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;border:none;border-radius:50%;color:inherit;cursor:pointer;font:inherit;height:32px;margin:0;padding:0;transition:background-color .5s;width:auto;width:32px}.resource-header-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible, .resource-header-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background-color:hsla(0,0%,100%,.3);transition:background-color .15s}.resource-header-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block}.resource-header-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] circle[_ngcontent-%COMP%]{fill:var(--stf-white)}.resource-header-link[_ngcontent-%COMP%]{color:inherit;text-align:left;width:100%}.resource-header-link[_ngcontent-%COMP%]:hover{text-decoration:none}.resource-header-thumbnail[_ngcontent-%COMP%]{width:340px}.resource-header-thumbnail[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:top center;object-position:top center;width:100%}"]}),e})();var de=n("cUpR"),he=n("ura0"),ge=n("9BqC");function be(e,t){1&e&&m.Qb(0,"svg-icon",15)}function pe(e,t){1&e&&m.Qb(0,"svg-icon",16)}function fe(e,t){if(1&e&&(m.Tb(0),m.Fc(1,be,1,0,"svg-icon",13),m.Fc(2,pe,1,0,"svg-icon",14),m.Sb()),2&e){const e=m.hc(3);m.Eb(1),m.nc("ngIf",!(e.isOcr||e.isInception)),m.Eb(1),m.nc("ngIf",e.isOcr||e.isInception)}}function me(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",10),m.dc("click",function(){return m.xc(e),m.hc(2).onClick()})("mouseenter",function(){return m.xc(e),m.hc(2).mouseEnter()})("mouseleave",function(){return m.xc(e),m.hc(2).mouseLeave()}),m.Fc(1,fe,3,2,"ng-container",11),m.Vb(2,"div",12),m.Hc(3),m.Ub(),m.Ub()}if(2&e){const e=m.hc(2);m.Eb(1),m.nc("ngIf",e.hover||e.active),m.Eb(2),m.Ic(e.getTime(e.time))}}function ve(e,t){1&e&&m.Qb(0,"svg-icon",20)}function xe(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",17),m.dc("click",function(){return m.xc(e),m.hc(2).onClick()})("mouseenter",function(){return m.xc(e),m.hc(2).mouseEnter()})("mouseleave",function(){return m.xc(e),m.hc(2).mouseLeave()}),m.Fc(1,ve,1,0,"svg-icon",18),m.Vb(2,"div",19),m.Hc(3),m.Ub(),m.Ub()}if(2&e){const e=m.hc(2);m.Eb(1),m.nc("ngIf",e.hover||e.active),m.Eb(2),m.Jc("p. ",e.page+1,"")}}function we(e,t){1&e&&m.Qb(0,"svg-icon",23)}function Pe(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",21),m.dc("click",function(){return m.xc(e),m.hc(2).onClick()})("mouseenter",function(){return m.xc(e),m.hc(2).rowMouseEnter()})("mouseleave",function(){return m.xc(e),m.hc(2).rowMouseLeave()}),m.Fc(1,we,1,0,"svg-icon",22),m.Vb(2,"div",19),m.Hc(3),m.Qb(4,"br"),m.Hc(5),m.Ub(),m.Ub()}if(2&e){const e=m.hc(2);m.Eb(1),m.nc("ngIf",e.hover||e.active),m.Eb(2),m.Jc("Tab. ",e.row.tabIndex+1,""),m.Eb(2),m.Jc("Row. ",e.row.rowIndex+1,"")}}function Oe(e,t){if(1&e){const e=m.Wb();m.Vb(0,"svg-icon",24),m.dc("click",function(){return m.xc(e),m.hc(2).onClick()}),m.Ub()}}function ye(e,t){if(1&e){const e=m.Wb();m.Vb(0,"img",25),m.dc("click",function(){return m.xc(e),m.hc(2).onClick()}),m.ic(1,"getfile"),m.Ub()}if(2&e){const e=m.hc(2);m.nc("src",m.jc(1,1,e.image),m.zc)}}function Ce(e,t){if(1&e&&(m.Vb(0,"div",4),m.Fc(1,me,4,2,"div",5),m.Fc(2,xe,4,2,"div",6),m.Fc(3,Pe,6,3,"div",7),m.Fc(4,Oe,1,0,"svg-icon",8),m.Fc(5,ye,2,3,"img",9),m.Ub()),2&e){const e=m.hc();m.Hb("wider",e.row),m.Eb(1),m.nc("ngIf",void 0!==e.time),m.Eb(1),m.nc("ngIf",e.isPdf&&void 0!==e.page),m.Eb(1),m.nc("ngIf",e.row),m.Eb(1),m.nc("ngIf",e.isPdf&&void 0===e.page),m.Eb(1),m.nc("ngIf",e.image)}}function Me(e,t){1&e&&(m.Vb(0,"span",28),m.Hc(1,"OCR. "),m.Ub())}function ke(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",26),m.dc("mouseenter",function(){return m.xc(e),m.hc().mouseEnter()})("mouseleave",function(){return m.xc(e),m.hc().mouseLeave()})("click",function(){m.xc(e);const t=m.hc();return t.isClickable()&&t.onClick()}),m.Fc(1,Me,2,0,"span",27),m.lc(2),m.Ub()}if(2&e){const e=m.hc();m.Cc("cursor",e.isClickable()?"pointer":null),m.Eb(1),m.nc("ngIf",e.isOcr)}}function _e(e,t){if(1&e){const e=m.Wb();m.Tb(0),m.Vb(1,"div",31),m.Vb(2,"span",32),m.dc("mouseenter",function(){return m.xc(e),m.hc(3).rowMouseEnter()})("mouseleave",function(){return m.xc(e),m.hc(3).rowMouseLeave()})("click",function(){return m.xc(e),m.hc(3).onClick()}),m.Hc(3),m.Ub(),m.Ub(),m.Sb()}if(2&e){const e=t.$implicit;m.Eb(3),m.Ic(e)}}function Ve(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div"),m.Vb(1,"button",33),m.dc("click",function(){return m.xc(e),m.hc(3).expandRow()}),m.Qb(2,"div",34),m.Vb(3,"div"),m.Hc(4),m.ic(5,"translate"),m.Ub(),m.Ub(),m.Ub()}2&e&&(m.Eb(4),m.Ic(m.jc(5,1,"generic.expand_info")))}function Ie(e,t){if(1&e&&(m.Tb(0),m.Fc(1,_e,4,1,"ng-container",30),m.Fc(2,Ve,6,3,"div",11),m.Sb()),2&e){const e=t.ngIf,n=m.hc(2);m.Eb(1),m.nc("ngForOf",n._rowCollapsed?e.slice(0,10):e),m.Eb(1),m.nc("ngIf",n._rowCollapsed&&e.length>10)}}function Fe(e,t){if(1&e&&(m.Vb(0,"div",29),m.Fc(1,Ie,3,2,"ng-container",11),m.Ub()),2&e){const e=m.hc();m.Eb(1),m.nc("ngIf",e.validColumns(e.row))}}const Ee=["*"];let Te=(()=>{class e{constructor(e){this.cd=e,this.text="",this.imageZoomable=!1,this.isPdf=!1,this.active=!1,this.forceIndent=!1,this.isOcr=!1,this.isInception=!1,this.rowCollapsed=!0,this.select=new m.n,this.hover=!1,this.willLeave=!1,this._rowCollapsed=!0}ngOnInit(){this._rowCollapsed=this.rowCollapsed}getTime(e){e=Math.floor(e);const t=Math.floor(e/60),n=e%60;return`${t<10?"0"+t:t.toString()}.${n<10?"0"+n:n.toString()}`}isClickable(){return void 0!==this.time||this.isPdf||this.image&&this.imageZoomable||this.row}onClick(){this.select.emit()}mouseEnter(){this.hover=!0,this.cd.markForCheck()}mouseLeave(){this.hover=!1,this.cd.markForCheck()}rowMouseEnter(){this.hover=!0,this.willLeave=!1,this.cd.markForCheck()}rowMouseLeave(){this.willLeave||(this.willLeave=!0,setTimeout(()=>{this.willLeave&&(this.hover=!1,this.cd.markForCheck())},100))}renderColumn(e){return"nan"===e?"":e}validColumns(e){return e.columns.filter(e=>"nan"!==e)}expandRow(){this._rowCollapsed=!1}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(m.h))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-paragraph"]],inputs:{text:"text",time:"time",image:"image",imageZoomable:"imageZoomable",isPdf:"isPdf",page:"page",active:"active",forceIndent:"forceIndent",isOcr:"isOcr",isInception:"isInception",row:"row",rowCollapsed:"rowCollapsed"},outputs:{select:"select"},ngContentSelectors:Ee,decls:4,vars:5,consts:[[1,"paragraph"],["class","paragraph-info",3,"wider",4,"ngIf"],["class","paragraph-text",3,"cursor","mouseenter","mouseleave","click",4,"ngIf"],["class","paragraph-row",4,"ngIf"],[1,"paragraph-info"],["class","paragraph-time",3,"click","mouseenter","mouseleave",4,"ngIf"],["class","paragraph-page",3,"click","mouseenter","mouseleave",4,"ngIf"],["class","paragraph-row-num",3,"click","mouseenter","mouseleave",4,"ngIf"],["class","paragraph-pdf","src","assets/icons/enlarge.svg",3,"click",4,"ngIf"],["class","paragraph-image",3,"src","click",4,"ngIf"],[1,"paragraph-time",3,"click","mouseenter","mouseleave"],[4,"ngIf"],[1,"animated-text","animated-time"],["class","animated-icon play-icon","src","assets/icons/play-small.svg",4,"ngIf"],["class","animated-icon image-icon","src","assets/icons/image.svg",4,"ngIf"],["src","assets/icons/play-small.svg",1,"animated-icon","play-icon"],["src","assets/icons/image.svg",1,"animated-icon","image-icon"],[1,"paragraph-page",3,"click","mouseenter","mouseleave"],["class","animated-icon","src","assets/icons/enlarge.svg",4,"ngIf"],[1,"animated-text"],["src","assets/icons/enlarge.svg",1,"animated-icon"],[1,"paragraph-row-num",3,"click","mouseenter","mouseleave"],["class","animated-icon","src","assets/icons/squares.svg",4,"ngIf"],["src","assets/icons/squares.svg",1,"animated-icon"],["src","assets/icons/enlarge.svg",1,"paragraph-pdf",3,"click"],[1,"paragraph-image",3,"src","click"],[1,"paragraph-text",3,"mouseenter","mouseleave","click"],["class","prefix",4,"ngIf"],[1,"prefix"],[1,"paragraph-row"],[4,"ngFor","ngForOf"],[1,"column"],[3,"mouseenter","mouseleave","click"],[1,"button-expand",3,"click"],[1,"button-expand-arrow"]],template:function(e,t){1&e&&(m.mc(),m.Vb(0,"div",0),m.Fc(1,Ce,6,7,"div",1),m.Fc(2,ke,3,3,"div",2),m.Fc(3,Fe,2,1,"div",3),m.Ub()),2&e&&(m.Hb("active",t.isClickable()&&(t.hover||t.active)),m.Eb(1),m.nc("ngIf",t.isClickable()||t.forceIndent),m.Eb(1),m.nc("ngIf",!t.row),m.Eb(1),m.nc("ngIf",t.row))},directives:[i.n,r.b,i.m],pipes:[ee.a,s.c],styles:[".paragraph[_ngcontent-%COMP%]{display:flex;margin-bottom:25px}.paragraph-text[_ngcontent-%COMP%] .prefix[_ngcontent-%COMP%]{font-weight:var(--stf-font-weight-bold)}.paragraph-row[_ngcontent-%COMP%] .column[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;padding:1px 0}.paragraph.active[_ngcontent-%COMP%] .paragraph-row[_ngcontent-%COMP%], .paragraph.active[_ngcontent-%COMP%] .paragraph-text[_ngcontent-%COMP%]{font-weight:var(--stf-font-weight-semibold)}.paragraph-info[_ngcontent-%COMP%]{flex:0 0 auto;font-weight:var(--stf-font-weight-light);width:78px}.paragraph-info.wider[_ngcontent-%COMP%]{width:98px}.paragraph-time[_ngcontent-%COMP%]{cursor:pointer;position:relative}.paragraph-time[_ngcontent-%COMP%] .play-icon[_ngcontent-%COMP%]{margin-top:1px}.paragraph-time[_ngcontent-%COMP%] .image-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block;margin-top:3px}.paragraph.active[_ngcontent-%COMP%] .paragraph-time[_ngcontent-%COMP%] .play-icon[_ngcontent-%COMP%]{opacity:1}.paragraph.active[_ngcontent-%COMP%] .paragraph-time[_ngcontent-%COMP%] .play-time[_ngcontent-%COMP%]{transform:translateX(18px)}.paragraph-page[_ngcontent-%COMP%]{cursor:pointer;position:relative}.paragraph-page[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{margin-top:3px}.paragraph-pdf[_ngcontent-%COMP%]{cursor:pointer}.paragraph-row-num[_ngcontent-%COMP%]{cursor:pointer;position:relative}.paragraph-image[_ngcontent-%COMP%]{cursor:pointer;margin-left:10px;max-height:40px;max-width:40px}.paragraph[_ngcontent-%COMP%] .animated-icon[_ngcontent-%COMP%]{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:icon-fade-in;animation-name:icon-fade-in;left:0;position:absolute;top:0}@-webkit-keyframes icon-fade-in{0%{opacity:0}to{opacity:1}}@keyframes icon-fade-in{0%{opacity:0}to{opacity:1}}.paragraph[_ngcontent-%COMP%] .animated-text[_ngcontent-%COMP%]{display:inline-block;transition:transform .15s}.paragraph.active[_ngcontent-%COMP%] .animated-text[_ngcontent-%COMP%]{font-weight:var(--stf-font-weight-semibold);transform:translateX(21px)}.button-expand[_ngcontent-%COMP%]{-webkit-appearance:none;align-items:center;background:transparent;border:none;color:inherit;cursor:pointer;display:flex;font:inherit;font-weight:var(--stf-font-weight-regular);margin:0;padding:0;text-decoration:underline;width:auto}.button-expand-arrow[_ngcontent-%COMP%]{border-bottom:4px solid transparent;border-left:6px solid #000;border-top:4px solid transparent;height:8px;margin-right:5px;width:6px}"],changeDetection:0}),e})();function Se(e,t){if(1&e){const e=m.Wb();m.Vb(0,"button",14),m.dc("click",function(){return m.xc(e),m.hc().clearSearch()}),m.Qb(1,"svg-icon",15),m.Ub()}}function Ue(e,t){}function Le(e,t){if(1&e&&(m.Vb(0,"div",16),m.Fc(1,Ue,0,0,"ng-template",17),m.Ub()),2&e){m.hc();const e=m.tc(14);m.nc("fxHide.lt-lg",!0),m.Eb(1),m.nc("ngTemplateOutlet",e)}}function Re(e,t){}function Ae(e,t){if(1&e&&(m.Vb(0,"div",18),m.Fc(1,Re,0,0,"ng-template",17),m.Ub()),2&e){m.hc();const e=m.tc(14);m.nc("fxHide.gt-md",!0),m.Eb(1),m.nc("ngTemplateOutlet",e)}}function ze(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-simple-select",19),m.dc("changeSelected",function(t){return m.xc(e),m.hc().setOrder(t)}),m.ic(1,"async"),m.Ub()}if(2&e){const e=m.hc();m.nc("options",e.orderOptions)("value",m.jc(1,2,e.searchOrder$))}}function je(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-paragraph",25),m.dc("select",function(){m.xc(e);const n=t.$implicit;return m.hc(4).resourceView.selectTranscript(n)}),m.Hc(1),m.Ub()}if(2&e){const e=t.$implicit;m.nc("time",e.start),m.Eb(1),m.Jc(" ",e.text," ")}}function He(e,t){if(1&e&&(m.Tb(0),m.Fc(1,je,2,2,"stf-paragraph",24),m.Sb()),2&e){const e=m.hc(3);m.Eb(1),m.nc("ngForOf",e.textBlock.transcript)}}function $e(e,t){if(1&e&&(m.Tb(0),m.Vb(1,"h3"),m.Hc(2),m.ic(3,"translate"),m.Ub(),m.Vb(4,"pre",22),m.Hc(5),m.Ub(),m.Sb()),2&e){const e=m.hc(3);m.Eb(2),m.Ic(m.jc(3,2,"resource.description.title")),m.Eb(3),m.Jc(" ",e.textBlock.description,"\n ")}}function Be(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-paragraph",28),m.dc("select",function(){m.xc(e);const n=t.$implicit;return m.hc(5).resourceView.selectTranscript(n)}),m.Hc(1),m.Ub()}if(2&e){const e=t.$implicit;m.nc("time",e.start)("isOcr",!0),m.Eb(1),m.Jc(" ",e.text," ")}}function Qe(e,t){if(1&e&&(m.Tb(0),m.Fc(1,Be,2,3,"stf-paragraph",27),m.Sb()),2&e){const e=m.hc(4);m.Eb(1),m.nc("ngForOf",e.textBlock.ocr_list)}}function We(e,t){if(1&e&&(m.Vb(0,"pre",22),m.Hc(1),m.Ub()),2&e){const e=m.hc(4);m.Eb(1),m.Jc(" ",e.ocr,"\n ")}}function De(e,t){if(1&e&&(m.Tb(0),m.Vb(1,"h3"),m.Hc(2),m.ic(3,"translate"),m.Ub(),m.Fc(4,Qe,2,1,"ng-container",13),m.Fc(5,We,2,1,"pre",26),m.Sb()),2&e){const e=m.hc(3);m.Eb(2),m.Ic(m.jc(3,3,"resource.ocr.title")),m.Eb(2),m.nc("ngIf",e.textBlock.ocr_list.length>0),m.Eb(1),m.nc("ngIf",e.ocr.length>0)}}function Ne(e,t){if(1&e){const e=m.Wb();m.Vb(0,"button",31),m.dc("click",function(){m.xc(e);const n=t.$implicit;return m.hc(5).resourceView.selectTranscript(n)}),m.Hc(1),m.Ub()}if(2&e){const e=t.$implicit;m.Eb(1),m.Jc(" ",e.text," ")}}function qe(e,t){if(1&e&&(m.Vb(0,"div"),m.Fc(1,Ne,2,1,"button",30),m.Ub()),2&e){const e=m.hc(4);m.Eb(1),m.nc("ngForOf",e.textBlock.inception_list)}}function Je(e,t){if(1&e&&(m.Vb(0,"span",34),m.Hc(1),m.Ub()),2&e){const e=t.$implicit;m.Eb(1),m.Ic(e)}}function Ze(e,t){if(1&e&&(m.Vb(0,"div",32),m.Fc(1,Je,2,1,"span",33),m.Ub()),2&e){const e=m.hc(4);m.Eb(1),m.nc("ngForOf",e.inception)}}function Ge(e,t){if(1&e&&(m.Tb(0),m.Vb(1,"h3"),m.Hc(2),m.ic(3,"translate"),m.Ub(),m.Fc(4,qe,2,1,"div",13),m.Fc(5,Ze,2,1,"div",29),m.Sb()),2&e){const e=m.hc(3);m.Eb(2),m.Ic(m.jc(3,3,"resource.inception.title")),m.Eb(2),m.nc("ngIf",e.textBlock.inception_list.length>0),m.Eb(1),m.nc("ngIf",e.inception)}}function Ke(e,t){if(1&e&&(m.Vb(0,"div"),m.Fc(1,He,2,1,"ng-container",13),m.Fc(2,$e,6,4,"ng-container",13),m.Fc(3,De,6,5,"ng-container",13),m.Fc(4,Ge,6,5,"ng-container",13),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("ngIf",e.textBlock.transcript&&e.textBlock.transcript.length>0),m.Eb(1),m.nc("ngIf",e.textBlock.description),m.Eb(1),m.nc("ngIf",e.ocr.length>0||e.textBlock.ocr_list.length>0),m.Eb(1),m.nc("ngIf",e.inception.length>0||e.textBlock.inception_list.length>0)}}function Ye(e,t){if(1&e){const e=m.Wb();m.Tb(0),m.Vb(1,"stf-paragraph",36),m.dc("select",function(){m.xc(e);const n=t.$implicit;return m.hc(5).resourceView.selectRow(n.tabIndex,n.rowIndex)}),m.Ub(),m.Sb()}if(2&e){const e=t.$implicit,n=m.hc(2).ngIf;m.Eb(1),m.nc("row",e)("rowCollapsed",n.getTotalRows()>2)}}function Xe(e,t){if(1&e&&(m.Tb(0),m.Fc(1,Ye,2,2,"ng-container",35),m.Sb()),2&e){const e=t.$implicit;m.Eb(1),m.nc("ngForOf",e.value)}}function et(e,t){if(1&e&&(m.Tb(0),m.Fc(1,Xe,2,1,"ng-container",35),m.ic(2,"keyvalue"),m.Sb()),2&e){const e=t.ngIf,n=m.hc(3);m.Eb(1),m.nc("ngForOf",m.kc(2,1,e.tabs,n.preserveOrder))}}function tt(e,t){if(1&e&&(m.Vb(0,"div"),m.Fc(1,et,3,4,"ng-container",13),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("ngIf",e.resource.getSpreadsheetTabs())}}function nt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-paragraph",39),m.dc("select",function(){m.xc(e);const t=m.hc().$implicit,n=m.hc(3);return n.showImage(n.resource.url+"/@download/files/"+t.e.image,t.p)}),m.Hc(1),m.Ub()}if(2&e){const e=m.hc().$implicit,t=m.hc(3);m.nc("image",t.resource.url+"/@download/files/"+e.e.image)("imageZoomable",t.canZoom()),m.Eb(1),m.Jc(" ",e.p," ")}}function it(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-paragraph",40),m.dc("select",function(){m.xc(e);const t=m.hc().$implicit;return m.hc(3).resourceView.selectText(t)}),m.Hc(1),m.Ub()}if(2&e){const e=m.hc().$implicit,t=m.hc(3);m.nc("isPdf",t.isPdfParagraph(e))("page",e.e.page&&e.e.page[0])("forceIndent",!0),m.Eb(1),m.Jc(" ",e.p," ")}}function ct(e,t){if(1&e&&(m.Tb(0),m.Fc(1,nt,2,3,"stf-paragraph",37),m.Fc(2,it,2,4,"stf-paragraph",38),m.Sb()),2&e){const e=t.$implicit;m.Eb(1),m.nc("ngIf",null==e.e?null:e.e.image),m.Eb(1),m.nc("ngIf",null==e.e?null:e.e.text)}}function rt(e,t){if(1&e&&(m.Vb(0,"div"),m.Fc(1,ct,3,2,"ng-container",35),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("ngForOf",e.textBlock.text)}}function ot(e,t){if(1&e&&(m.Vb(0,"stf-paragraph"),m.Hc(1),m.Ub()),2&e){const e=m.hc().$implicit;m.Eb(1),m.Ic(e.p)}}function st(e,t){if(1&e&&(m.Tb(0),m.Fc(1,ot,2,1,"stf-paragraph",13),m.Sb()),2&e){const e=t.$implicit;m.Eb(1),m.nc("ngIf",null==e.e?null:e.e.text)}}function at(e,t){if(1&e&&(m.Tb(0),m.Fc(1,st,2,1,"ng-container",35),m.Sb()),2&e){const e=m.hc(3);m.Eb(1),m.nc("ngForOf",e.textBlock.text)}}function lt(e,t){if(1&e&&(m.Vb(0,"div"),m.Fc(1,at,2,1,"ng-container",13),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("ngIf",e.textBlock&&e.textBlock.text)}}function ut(e,t){if(1&e&&(m.Vb(0,"div",20),m.Fc(1,Ke,5,4,"div",21),m.Fc(2,tt,2,1,"div",21),m.Fc(3,rt,2,1,"div",21),m.Fc(4,lt,2,1,"div",21),m.Vb(5,"pre",22),m.Hc(6),m.Ub(),m.Vb(7,"div",23),m.Hc(8),m.Ub(),m.Vb(9,"pre",22),m.Hc(10),m.Ub(),m.Ub()),2&e){const e=m.hc();m.nc("ngSwitch",e.textType()),m.Eb(1),m.nc("ngSwitchCase","media"),m.Eb(1),m.nc("ngSwitchCase","spreadsheet"),m.Eb(1),m.nc("ngSwitchCase","pdf"),m.Eb(1),m.nc("ngSwitchCase","other"),m.Eb(2),m.Jc(" ",e.resource.getTextFromLayout(),"\n "),m.Eb(2),m.Jc(" ",e.resource.getTextFromHTML()," "),m.Eb(2),m.Jc(" ",e.resource.getTextFromConversation(),"\n ")}}function dt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-paragraph",45),m.dc("select",function(){m.xc(e);const t=m.hc(2).$implicit;return m.hc(2).resourceView.selectSearchTranscript(t)}),m.Hc(1),m.Ub()}if(2&e){const e=t.ngIf,n=m.hc(2),i=n.index,c=n.$implicit,r=m.hc(2);m.nc("time",e.start)("active",r.selectedIndex===i)("isOcr","ocr"===e.mode)("isInception","inception"===e.mode),m.Eb(1),m.Jc(" ",r.getTranscript(c).text," ")}}function ht(e,t){if(1&e&&(m.Tb(0),m.Fc(1,dt,2,5,"stf-paragraph",44),m.Sb()),2&e){const e=m.hc().$implicit,t=m.hc(2);m.Eb(1),m.nc("ngIf",t.getTranscript(e))}}function gt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-paragraph",46),m.dc("select",function(){m.xc(e);const t=m.hc().$implicit;return m.hc(2).resourceView.selectSearchText(t)}),m.Hc(1),m.Ub()}if(2&e){const e=m.hc(),t=e.$implicit,n=e.index,i=m.hc(2);m.nc("isPdf",!0)("page",t.getInitPage())("active",i.selectedIndex===n),m.Eb(1),m.Jc(" ",t.body," ")}}function bt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-paragraph",47),m.dc("select",function(){m.xc(e);const t=m.hc().$implicit;return m.hc(2).resourceView.selectSearchRow(t)}),m.Hc(1),m.Ub()}if(2&e){const e=m.hc(),t=e.$implicit,n=e.index,i=m.hc(2);m.nc("row",i.getRow(t))("active",i.selectedIndex===n),m.Eb(1),m.Jc(" ",t.body," ")}}function pt(e,t){if(1&e&&(m.Vb(0,"stf-paragraph",48),m.Hc(1),m.Ub()),2&e){const e=m.hc().$implicit,t=m.hc(2);m.nc("forceIndent",t.isPdf||t.isMedia||t.resourceView.isSpreadsheet()),m.Eb(1),m.Jc(" ",e.body," ")}}function ft(e,t){if(1&e&&(m.Tb(0),m.Tb(1,20),m.Fc(2,ht,2,1,"ng-container",21),m.Fc(3,gt,2,4,"stf-paragraph",41),m.Fc(4,bt,2,3,"stf-paragraph",42),m.Fc(5,pt,2,2,"stf-paragraph",43),m.Sb(),m.Sb()),2&e){const e=t.$implicit,n=m.hc(2);m.Eb(1),m.nc("ngSwitch",n.searchParagraphType(e)),m.Eb(1),m.nc("ngSwitchCase","transcript"),m.Eb(1),m.nc("ngSwitchCase","pdf"),m.Eb(1),m.nc("ngSwitchCase","spreadsheet"),m.Eb(1),m.nc("ngSwitchCase","other")}}function mt(e,t){if(1&e&&(m.Vb(0,"div"),m.Fc(1,ft,6,5,"ng-container",35),m.Ub()),2&e){const e=m.hc();m.Eb(1),m.nc("ngForOf",e.paragraphs)}}let vt=(()=>{class e{constructor(e,t,n,i){this.resourceViewConfig=e,this.formBuilder=t,this.resourceView=n,this.cd=i,this.isPdf=!1,this.isMedia=!1,this.paragraphs=null,this.inception=[],this.paragraphForm=this.formBuilder.group({search:[""]}),this.preserveOrder=()=>0,this.orderOptions=[{key:"sequential",value:"generic.sequential"},{key:"relevance",value:"generic.by_relevance"}],this.unsubscribeAll=new E.a,this.resourceView.getSearchTerm().pipe(Object(H.a)(this.unsubscribeAll)).subscribe(e=>{var t;null===(t=this.paragraphForm.get("search"))||void 0===t||t.patchValue(e),this.cd.markForCheck()}),this.resourceView.getSearchResults().pipe(Object(H.a)(this.unsubscribeAll)).subscribe(e=>{this.paragraphs=e,this.cd.markForCheck()}),this.searchOrder$=this.resourceView.getSearchOrder()}keyUp(e){this.resourceView.setSearchTerm(e.target.value)}clickSearch(){this.resourceView.search(this.paragraphForm.value.search)}clearSearch(){this.resourceView.setSearchTerm("")}getTranscript(e){return this.resourceView.getTranscript(e)}getRow(e){return this.resourceView.getRow(e)}isPdfParagraph(e){var t;const n=null===(t=e.e)||void 0===t?void 0:t.source,i=void 0!==n&&"ftf"===n.slice(0,3);return this.isPdf&&(i||void 0!==n&&"ftl"===n)}textType(e){return this.isMedia&&this.textBlock?"media":this.isPdf&&this.textBlock?"pdf":this.resourceView.isSpreadsheet()?"spreadsheet":"other"}searchParagraphType(e){return this.isMedia&&this.getTranscript(e)?"transcript":this.isPdf&&(e.isFtf()||e.isFtl())?"pdf":this.resourceView.isSpreadsheet()?"spreadsheet":"other"}ngOnInit(){var e,t;const n=null===(e=this.resource)||void 0===e?void 0:e.getTextFromMainLink(),i=null===(t=this.resource)||void 0===t?void 0:t.getTextFromMainFile();this.textBlock=i||n,this.textBlock&&(this.inception=this.cleanInception(this.textBlock.inception),this.ocr=this.cleanOCR(this.textBlock.ocr)),this.cd.markForCheck()}cleanOCR(e){return e.split("\n").filter(e=>" "!==e&&""!==e&&" "!==e&&" "!==e&&e.length>3).join("\n").replace(/[^\x00-\x7F]/g,"")}cleanInception(e){return e.split("\n").filter(e=>" "!==e&&""!==e&&" "!==e)}canZoom(){return this.resourceViewConfig.getOptions().imageZoomEnabled}showImage(e,t){this.resourceViewConfig.onZoomImage(e,t)}setOrder(e){this.resourceView.setSearchOrder(e.key)}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(B),m.Pb(a.d),m.Pb(W),m.Pb(m.h))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-text"]],inputs:{resource:"resource",isPdf:"isPdf",isMedia:"isMedia",selectedIndex:"selectedIndex"},decls:17,vars:9,consts:[[1,"search-paragraph"],["fxLayout","row","fxLayoutAlign","start center",3,"formGroup"],["fxFlex","0 0 auto","for","search-paragraph-input",1,"search-paragraph-title"],["type","text","id","search-paragraph-input","fxFlex","1 1 auto","formControlName","search","autocomplete","off","autocapitalize","off",3,"keyup"],["search",""],["fxFlex","0 0 auto",1,"search-paragraph-buttons"],["mat-icon-button","","aria-label","Search",3,"click"],["src","assets/icons/lupa.svg"],["mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],["fxFlex","0 0 auto","class","search-paragraph-order",3,"fxHide.lt-lg",4,"ngIf"],["class","search-paragraph-order-sm","fxLayout","row","fxLayoutAlign","end start",3,"fxHide.gt-md",4,"ngIf"],["order",""],[3,"ngSwitch",4,"ngIf"],[4,"ngIf"],["mat-icon-button","","aria-label","Clear",3,"click"],["src","assets/icons/close.svg"],["fxFlex","0 0 auto",1,"search-paragraph-order",3,"fxHide.lt-lg"],[3,"ngTemplateOutlet"],["fxLayout","row","fxLayoutAlign","end start",1,"search-paragraph-order-sm",3,"fxHide.gt-md"],["theme","bordered",3,"options","value","changeSelected"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"full_text"],[1,"full_text_html"],[3,"time","select",4,"ngFor","ngForOf"],[3,"time","select"],["class","full_text",4,"ngIf"],[3,"time","isOcr","select",4,"ngFor","ngForOf"],[3,"time","isOcr","select"],["class","inception-wrapper",4,"ngIf"],["class","inception-button",3,"click",4,"ngFor","ngForOf"],[1,"inception-button",3,"click"],[1,"inception-wrapper"],["class","inception",4,"ngFor","ngForOf"],[1,"inception"],[4,"ngFor","ngForOf"],[3,"row","rowCollapsed","select"],[3,"image","imageZoomable","select",4,"ngIf"],[3,"isPdf","page","forceIndent","select",4,"ngIf"],[3,"image","imageZoomable","select"],[3,"isPdf","page","forceIndent","select"],[3,"isPdf","page","active","select",4,"ngSwitchCase"],[3,"row","active","select",4,"ngSwitchCase"],[3,"forceIndent",4,"ngSwitchCase"],[3,"time","active","isOcr","isInception","select",4,"ngIf"],[3,"time","active","isOcr","isInception","select"],[3,"isPdf","page","active","select"],[3,"row","active","select"],[3,"forceIndent"]],template:function(e,t){1&e&&(m.Vb(0,"div",0),m.Vb(1,"form",1),m.Vb(2,"label",2),m.Hc(3),m.ic(4,"translate"),m.Ub(),m.Vb(5,"input",3,4),m.dc("keyup",function(e){return t.keyUp(e)}),m.Ub(),m.Vb(7,"div",5),m.Vb(8,"button",6),m.dc("click",function(){return t.clickSearch()}),m.Qb(9,"svg-icon",7),m.Ub(),m.Fc(10,Se,2,0,"button",8),m.Ub(),m.Fc(11,Le,2,2,"div",9),m.Ub(),m.Fc(12,Ae,2,2,"div",10),m.Ub(),m.Fc(13,ze,2,4,"ng-template",null,11,m.Gc),m.Fc(15,ut,11,8,"div",12),m.Fc(16,mt,2,1,"div",13)),2&e&&(m.Eb(1),m.nc("formGroup",t.paragraphForm),m.Eb(2),m.Ic(m.jc(4,7,"resource.paragraph.help")),m.Eb(7),m.nc("ngIf",t.paragraphForm.value.search.length>0),m.Eb(1),m.nc("ngIf",t.paragraphForm.value.search.length>0),m.Eb(1),m.nc("ngIf",t.paragraphForm.value.search.length>0),m.Eb(3),m.nc("ngIf",null===t.paragraphs),m.Eb(1),m.nc("ngIf",null!==t.paragraphs))},directives:[a.p,a.k,D.d,D.c,a.f,D.b,a.c,a.j,a.e,u.a,r.b,i.n,he.b,i.r,ge.a,i.p,i.q,i.m,Te],pipes:[s.c,i.b,i.g],styles:[".search-paragraph[_ngcontent-%COMP%]{margin-bottom:40px;margin-right:-15px}.search-paragraph-title[_ngcontent-%COMP%]{font-size:var(--stf-font-size-xlarge);font-weight:var(--stf-font-weight-bold);margin-right:24px}.search-paragraph[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:0;border-bottom:1px solid #000;font-family:var(--stf-font-family);padding-bottom:2px;padding-top:4px}.search-paragraph-buttons[_ngcontent-%COMP%]{min-width:80px}.search-paragraph-buttons[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--stf-black);width:24px}.search-paragraph-order[_ngcontent-%COMP%]{margin-left:12px}.search-paragraph-order-sm[_ngcontent-%COMP%]{margin:20px 8px 0 0}.search-paragraph[_ngcontent-%COMP%] stf-simple-select[_ngcontent-%COMP%]{display:block;width:144px}h3[_ngcontent-%COMP%]{font-weight:var(--stf-font-weight-bold)}.full_text[_ngcontent-%COMP%], .full_text_html[_ngcontent-%COMP%], .paragraph_selection[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.paragraph_selection[_ngcontent-%COMP%]{background-color:var(--stf-white);border:1px dashed var(--stf-gray-lighter);margin-bottom:5px;padding:5px}.inception-wrapper[_ngcontent-%COMP%]{line-height:2.5em}.inception[_ngcontent-%COMP%]{background-color:var(--stf-gray-background)}.inception[_ngcontent-%COMP%], .inception-button[_ngcontent-%COMP%]{border:1px solid #000;border-radius:3px;margin:4px;padding:4px}.inception-button[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;background-color:var(--stf-gray-background);color:inherit;cursor:pointer;font:inherit;width:auto}"],changeDetection:0}),e})();function xt(e,t){}function wt(e,t){if(1&e&&(m.Vb(0,"a",4),m.Fc(1,xt,0,0,"ng-template",5),m.Ub()),2&e){const e=m.hc(2),t=m.tc(2);m.nc("href",e.getLink(),m.zc),m.Eb(1),m.nc("ngTemplateOutlet",t)}}function Pt(e,t){}function Ot(e,t){if(1&e){const e=m.Wb();m.Vb(0,"button",6),m.dc("click",function(){return m.xc(e),m.hc(2).showSource.emit()}),m.Fc(1,Pt,0,0,"ng-template",5),m.Ub()}if(2&e){m.hc(2);const e=m.tc(2);m.Eb(1),m.nc("ngTemplateOutlet",e)}}function yt(e,t){if(1&e&&(m.Tb(0),m.Fc(1,wt,2,2,"a",2),m.Fc(2,Ot,2,1,"button",3),m.Sb()),2&e){const e=m.hc();m.Eb(1),m.nc("ngIf",e.hasLink()),m.Eb(1),m.nc("ngIf",e.resource.hasMainFile)}}function Ct(e,t){1&e&&m.Qb(0,"svg-icon",12)}function Mt(e,t){1&e&&m.Qb(0,"svg-icon",13)}function kt(e,t){if(1&e&&(m.Vb(0,"div",7),m.Fc(1,Ct,1,0,"svg-icon",8),m.Fc(2,Mt,1,0,"svg-icon",9),m.Vb(3,"div",10),m.Hc(4),m.ic(5,"translate"),m.Ub(),m.Vb(6,"div",11),m.Hc(7),m.ic(8,"translate"),m.Ub(),m.Ub()),2&e){const e=m.hc();m.Eb(1),m.nc("ngIf",!e.isMedia()),m.Eb(1),m.nc("ngIf",e.isMedia()),m.Eb(1),m.nc("fxHide.lt-lg",!0),m.Eb(1),m.Ic(m.jc(5,6,"resource.access_source_file")),m.Eb(2),m.nc("fxHide.gt-md",!0),m.Eb(1),m.Ic(m.jc(8,8,"resource.source_file"))}}let _t=(()=>{class e{constructor(){this.showSource=new m.n}ngOnInit(){}hasLink(){return this.resource.hasMainLink||void 0!==this.resource.getOriginLink()}getLink(){return this.resource.hasMainLink?this.resource.getMainLink():this.resource.getOriginLink()}isMedia(){return"media"===this.viewType||"link-youtube"===this.viewType}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-source"]],inputs:{resource:"resource",viewType:"viewType"},outputs:{showSource:"showSource"},decls:3,vars:1,consts:[[4,"ngIf"],["sourceFile",""],["class","resource-source-link","target","_blank","rel","noopener noreferrer",3,"href",4,"ngIf"],["class","resource-source-button",3,"click",4,"ngIf"],["target","_blank","rel","noopener noreferrer",1,"resource-source-link",3,"href"],[3,"ngTemplateOutlet"],[1,"resource-source-button",3,"click"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","10px",1,"resource-source"],["src","assets/icons/documents.svg",4,"ngIf"],["src","assets/icons/video.svg",4,"ngIf"],[3,"fxHide.lt-lg"],[3,"fxHide.gt-md"],["src","assets/icons/documents.svg"],["src","assets/icons/video.svg"]],template:function(e,t){1&e&&(m.Fc(0,yt,3,2,"ng-container",0),m.Fc(1,kt,9,10,"ng-template",null,1,m.Gc)),2&e&&m.nc("ngIf",t.resource)},directives:[i.n,i.r,D.d,D.c,D.e,he.b,r.b],pipes:[s.c],styles:[".resource-source[_ngcontent-%COMP%]{font-weight:var(--stf-font-weight-bold)}.resource-source[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block}.resource-source-link[_ngcontent-%COMP%]{color:inherit;display:block}.resource-source-link[_ngcontent-%COMP%]:hover{text-decoration:none}.resource-source-button[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;border:none;color:inherit;cursor:pointer;font:inherit;margin:0;padding:0;text-align:left;width:auto}"],changeDetection:0}),e})();var Vt=n("u93l");function It(e,t){if(1&e){const e=m.Wb();m.Tb(0),m.Vb(1,"div",21),m.Vb(2,"label",22),m.Hc(3),m.ic(4,"translate"),m.Ub(),m.Vb(5,"input",23),m.dc("keyup",function(t){m.xc(e);const n=m.hc(3).$implicit;return m.hc(3).setEntityFilter(n.key,t)}),m.Ub(),m.Qb(6,"svg-icon",24),m.Ub(),m.Sb()}if(2&e){const e=m.hc(3).$implicit;m.Eb(2),m.nc("for","filter-"+e.key),m.Eb(1),m.Ic(m.jc(4,3,"resource.search_one")),m.Eb(2),m.nc("id","filter-"+e.key)}}function Ft(e,t){if(1&e){const e=m.Wb();m.Vb(0,"a",25),m.dc("click",function(n){m.xc(e);const i=t.$implicit;return m.hc(6).onClickEntity(n,i)}),m.Hc(1),m.Ub()}if(2&e){const e=t.$implicit;m.Eb(1),m.Ic(e)}}function Et(e,t){1&e&&(m.Vb(0,"div",26),m.Hc(1),m.ic(2,"translate"),m.Ub()),2&e&&(m.Eb(1),m.Ic(m.jc(2,1,"generic.no_results")))}function Tt(e,t){if(1&e&&(m.Vb(0,"div",17),m.Fc(1,It,7,5,"ng-container",3),m.Vb(2,"div",18),m.Fc(3,Ft,2,1,"a",19),m.Fc(4,Et,3,3,"div",20),m.Ub(),m.Ub()),2&e){const e=t.ngIf,n=m.hc(2).$implicit;m.Eb(1),m.nc("ngIf",n.value.length>20),m.Eb(1),m.Hb("width-scroll",e.length>10),m.Eb(1),m.nc("ngForOf",e),m.Eb(1),m.nc("ngIf",0===e.length)}}function St(e,t){if(1&e&&(m.Vb(0,"mat-expansion-panel"),m.Vb(1,"mat-expansion-panel-header"),m.Vb(2,"mat-panel-title"),m.Qb(3,"div",14),m.Vb(4,"span",15),m.Hc(5),m.ic(6,"translate"),m.ic(7,"lowercase"),m.Ub(),m.Ub(),m.Ub(),m.Fc(8,Tt,5,5,"div",16),m.Ub()),2&e){const e=m.hc(),t=e.first,n=e.$implicit,i=m.hc(3);m.Eb(1),m.Hb("is-first",t),m.Eb(2),m.nc("ngClass",n.key),m.Eb(2),m.Kc("",m.jc(6,6,m.jc(7,8,"resource.entities."+n.key))," (",n.value.length,")"),m.Eb(3),m.nc("ngIf",i.getFilteredNamedEntities(n.key))}}function Ut(e,t){if(1&e&&(m.Tb(0),m.Fc(1,St,9,10,"mat-expansion-panel",3),m.Sb()),2&e){const e=t.$implicit,n=m.hc(3);m.Eb(1),m.nc("ngIf",n.renderNamedEntity(e.key.toLowerCase()))}}function Lt(e,t){if(1&e&&(m.Tb(0),m.Vb(1,"h2",11),m.Hc(2),m.ic(3,"translate"),m.Ub(),m.Vb(4,"div",12),m.Fc(5,Ut,2,1,"ng-container",13),m.ic(6,"keyvalue"),m.Ub(),m.Sb()),2&e){const e=m.hc(2);m.Eb(2),m.Jc(" ",m.jc(3,2,"resource.entities.title")," "),m.Eb(3),m.nc("ngForOf",m.jc(6,4,e.namedEntitiesFormated))}}function Rt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",27),m.Vb(1,"stf-resource-source",28),m.dc("showSource",function(){return m.xc(e),m.hc(2).showSource()}),m.Ub(),m.Ub()}if(2&e){const e=m.hc(2);m.Eb(1),m.nc("resource",e.resource)("viewType",e.viewType)}}function At(e,t){if(1&e&&(m.Vb(0,"div",7),m.Vb(1,"div",8),m.Hc(2),m.ic(3,"translate"),m.Ub(),m.Vb(4,"div",9),m.Hc(5),m.Ub(),m.Ub()),2&e){const e=m.hc().ngIf;m.Eb(2),m.Ic(m.jc(3,2,"resource.author")),m.Eb(3),m.Ic(e.creator)}}function zt(e,t){if(1&e&&(m.Tb(0),m.Fc(1,At,6,4,"div",10),m.Sb()),2&e){const e=t.ngIf;m.Eb(1),m.nc("ngIf",e.creator)}}function jt(e,t){if(1&e&&(m.Vb(0,"div",7),m.Vb(1,"div",8),m.Hc(2),m.ic(3,"translate"),m.Ub(),m.Vb(4,"div",9),m.Hc(5),m.Ub(),m.Ub()),2&e){const e=m.hc(2);m.Eb(2),m.Ic(m.jc(3,2,"resource.language")),m.Eb(3),m.Ic(e.resource.metadata.language)}}function Ht(e,t){if(1&e&&(m.Vb(0,"div",1),m.Vb(1,"div",2),m.Fc(2,Lt,7,6,"ng-container",3),m.Ub(),m.Vb(3,"div",4),m.Vb(4,"h2",5),m.Hc(5),m.ic(6,"translate"),m.Ub(),m.Fc(7,Rt,2,2,"div",6),m.Vb(8,"div",7),m.Vb(9,"div",8),m.Hc(10),m.ic(11,"translate"),m.Ub(),m.Vb(12,"div",9),m.Hc(13),m.ic(14,"sanitizeTags"),m.Ub(),m.Ub(),m.Vb(15,"div",7),m.Vb(16,"div",8),m.Hc(17),m.ic(18,"translate"),m.Ub(),m.Vb(19,"div",9),m.Hc(20),m.ic(21,"date"),m.Ub(),m.Ub(),m.Fc(22,zt,2,1,"ng-container",3),m.Fc(23,jt,6,4,"div",10),m.Ub(),m.Ub()),2&e){const e=m.hc();m.Eb(2),m.nc("ngIf",e.namedEntitiesFormated),m.Eb(3),m.Ic(m.jc(6,9,"resource.other_data")),m.Eb(2),m.nc("ngIf",e.resourceView.canShowSource()),m.Eb(3),m.Ic(m.jc(11,11,"resource.summary")),m.Eb(3),m.Ic(m.kc(14,13,e.resource.description,!0)),m.Eb(4),m.Ic(m.jc(18,16,"resource.creation_date")),m.Eb(3),m.Ic(m.kc(21,18,e.resource.creation_date,"dd - LL - yyyy")),m.Eb(2),m.nc("ngIf",e.resource.getMainFileMetadata()),m.Eb(1),m.nc("ngIf",null==e.resource.metadata?null:e.resource.metadata.language)}}let $t=(()=>{class e{constructor(e,t){this.resourceView=e,this.cd=t,this.hideMetadata=new m.n,this.namedEntitiesFormated=null,this.entitiesFilters=null,this.renderNamedEntity=e=>!["quantity","law"].includes(e)}ngOnInit(){this.formatedNamedEntites()}formatedNamedEntites(){var e,t;if(null===(t=null===(e=this.resource)||void 0===e?void 0:e.extracted_metadata)||void 0===t?void 0:t.named_entities){const e=this.resource.extracted_metadata.named_entities,t=Array.from(new Set(Object.values(e)));this.namedEntitiesFormated={},t.forEach(e=>{this.namedEntitiesFormated[e]=[]});for(const[n,i]of Object.entries(e))n.length>2&&this.namedEntitiesFormated[i].push(n);for(let n in this.namedEntitiesFormated)this.namedEntitiesFormated[n].sort((e,t)=>e.localeCompare(t));this.entitiesFilters={},t.forEach(e=>{this.entitiesFilters[e]=""})}this.cd.markForCheck()}onClickEntity(e,t){e.preventDefault(),this.resourceView.setSearchTerm(t)}getFilteredNamedEntities(e){if(0==this.entitiesFilters[e].length)return this.namedEntitiesFormated[e];{const t=new RegExp(`(${this.entitiesFilters[e]})`,"gi");return this.namedEntitiesFormated[e].filter(e=>t.test(e))}}getEntityFilter(e){return this.entitiesFilters[e]}setEntityFilter(e,t){this.entitiesFilters[e]=t.target.value,this.cd.markForCheck()}showSource(){this.resourceView.showSource(this.viewType)}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(W),m.Pb(m.h))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-metadata"]],inputs:{resource:"resource",viewType:"viewType"},outputs:{hideMetadata:"hideMetadata"},decls:1,vars:1,consts:[["class","resource-metadata","fxLayout","row","fxLayout.lt-lg","column",4,"ngIf"],["fxLayout","row","fxLayout.lt-lg","column",1,"resource-metadata"],["fxFlex","57%","fxFlex.lt-lg","100%",1,"resource-metadata-entities"],[4,"ngIf"],["fxFlex","43%","fxFlex.lt-lg","100%",1,"resource-metadata-attributes"],[1,"resource-metadata-attributes-title"],["class","resource-source-container",4,"ngIf"],[1,"attribute"],[1,"attribute-title"],[1,"attribute-text"],["class","attribute",4,"ngIf"],[1,"resource-metadata-entities-title"],[1,"entities-panel"],[4,"ngFor","ngForOf"],[1,"colorbox",3,"ngClass"],[1,"ner-label"],["class","ners",4,"ngIf"],[1,"ners"],[1,"ners-list"],["class","ner-item","href","",3,"click",4,"ngFor","ngForOf"],["class","no-results",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","12px",1,"ners-filter"],["fxFlex","0 0 auto",3,"for"],["fxFlex","1 1 0","type","text",3,"id","keyup"],["fxFlex","0 0 auto","src","assets/icons/lupa.svg"],["href","",1,"ner-item",3,"click"],[1,"no-results"],[1,"resource-source-container"],[3,"resource","viewType","showSource"]],template:function(e,t){1&e&&m.Fc(0,Ht,24,21,"div",0),2&e&&m.nc("ngIf",t.resource)},directives:[i.n,D.d,D.b,i.m,l.b,l.c,l.d,i.l,he.a,D.c,D.e,r.b,_t],pipes:[s.c,Vt.a,i.e,i.g,i.k],styles:['.resource-metadata[_ngcontent-%COMP%]{padding:46px 5% 46px 8%}@media screen and (max-width:1279px){.resource-metadata[_ngcontent-%COMP%]{padding-left:55px;padding-right:55px}}.resource-metadata[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:var(--stf-font-size-xlarge);font-weight:var(--stf-font-weight-bold);line-height:1.1}.resource-metadata-entities[_ngcontent-%COMP%]{padding-right:10%}@media screen and (max-width:1279px){.resource-metadata-entities[_ngcontent-%COMP%]{margin-bottom:30px;padding-right:0}}.resource-metadata-entities-title[_ngcontent-%COMP%]{margin:0 0 32px}.resource-metadata-attributes-title[_ngcontent-%COMP%]{margin:0 0 28px}.resource-metadata[_ngcontent-%COMP%] .attribute[_ngcontent-%COMP%]{margin-bottom:28px}.resource-metadata[_ngcontent-%COMP%] .attribute-title[_ngcontent-%COMP%]{font-style:italic;font-weight:var(--stf-font-weight-semibold);margin-bottom:4px}.resource-metadata[_ngcontent-%COMP%] .attribute-text[_ngcontent-%COMP%]{-webkit-line-clamp:6;-webkit-box-orient:vertical;color:rgba(0,0,0,.9);display:-webkit-box;line-height:1.3;overflow:hidden;text-overflow:ellipsis}.resource-source-container[_ngcontent-%COMP%]{margin-bottom:20px}.entities-panel[_ngcontent-%COMP%]{max-width:330px}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{border-radius:0;box-shadow:2px 2px 3px 0 rgba(0,0,0,.1)}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{height:unset;padding-left:0}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]:after{background-color:#c5c5c5;content:"";height:1px;left:30px;position:absolute;right:16px;top:0}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header.is-first[_ngcontent-%COMP%]:after{display:none}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .ner-label[_ngcontent-%COMP%]{padding-top:8px}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .mat-expansion-indicator[_ngcontent-%COMP%]:after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;margin-top:-6px;padding:3px;transform:rotate(136deg);vertical-align:middle}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox[_ngcontent-%COMP%]{margin-right:18px;min-height:38px;min-width:20px}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.DATE[_ngcontent-%COMP%]{background:#ff8989;color:#000}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.FAC[_ngcontent-%COMP%]{background:#81d8ac;color:#000}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.GPE[_ngcontent-%COMP%]{background:#454ade;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.ORG[_ngcontent-%COMP%]{background:#6eb0ec;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.PERSON[_ngcontent-%COMP%]{background:#ffe186;color:#000}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.PERCENT[_ngcontent-%COMP%]{background:#1e264f;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.TIME[_ngcontent-%COMP%]{background:#21b8a6;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.MAIL[_ngcontent-%COMP%]{background:#e81c66;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.MONEY[_ngcontent-%COMP%]{background:#ff8c4b;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.EVENT[_ngcontent-%COMP%]{background:#cba2da;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.LOC[_ngcontent-%COMP%]{background:#b7a38d;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.NORP[_ngcontent-%COMP%]{background:#743ccf;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.PRODUCT[_ngcontent-%COMP%]{background:#d74f57;color:#fff}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.WORK_OF_ART[_ngcontent-%COMP%]{background:#ffbccc;color:#000}.entities-panel[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .colorbox.LANGUAGE[_ngcontent-%COMP%]{background:#d1d3ff;color:#000}.ners-filter[_ngcontent-%COMP%]{background-color:#e7e7e7;height:40px;margin:0 -24px;padding:0 20px 0 39px}.ners-filter[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:15px;font-weight:var(--stf-font-weight-semibold)}.ners-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{background-color:transparent;border:0;border-bottom:1px solid #7d7d7d;font-family:var(--stf-font-family);height:20px;min-width:0}.ners-filter[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#333;display:block;margin-bottom:2px;width:20px}.ners-list[_ngcontent-%COMP%]{margin-top:12px;padding:0 10px 0 0}.ners-list[_ngcontent-%COMP%]::-webkit-scrollbar{background-color:var(--stf-gray-background);height:12px;width:12px}.ners-list[_ngcontent-%COMP%]::-webkit-scrollbar:hover{background-color:rgba(134,138,160,.1)}.ners-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:12px;box-shadow:inset 0 0 0 12px rgba(134,138,160,.15)}.ners-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:active{border-radius:12px;box-shadow:inset 0 0 0 12px rgba(134,138,160,.55)}.ners-list.width-scroll[_ngcontent-%COMP%]{height:400px;overflow-y:auto}.ners-list[_ngcontent-%COMP%] .ner-item[_ngcontent-%COMP%]{color:inherit;display:block;font-size:15px;padding:10px 0 10px 15px}'],changeDetection:0}),e})();function Bt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",6),m.Vb(1,"button",7),m.dc("click",function(){return m.xc(e),m.hc(2).prevPage()}),m.Qb(2,"svg-icon",8),m.Ub(),m.Vb(3,"button",9),m.dc("click",function(){return m.xc(e),m.hc(2).nextPage()}),m.Qb(4,"svg-icon",8),m.Ub(),m.Vb(5,"div",10),m.Vb(6,"span",11),m.Hc(7),m.Ub(),m.Hc(8),m.Ub(),m.Ub()}if(2&e){const e=m.hc(2);m.Eb(1),m.nc("disabled",0===e.currentPage.index),m.Eb(2),m.nc("disabled",e.currentPage.index===e.resource.getTotalPdfPages()-1),m.Eb(4),m.Ic(e.currentPage.index+1),m.Eb(1),m.Jc(" / ",e.resource.getTotalPdfPages(),"")}}function Qt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",12),m.Vb(1,"button",13),m.dc("click",function(){return m.xc(e),m.hc(2).resourceView.zoomOutPdf()}),m.Qb(2,"svg-icon",14),m.Ub(),m.Vb(3,"button",15),m.dc("click",function(){return m.xc(e),m.hc(2).resourceView.zoomInPdf()}),m.Qb(4,"svg-icon",16),m.Ub(),m.Vb(5,"div",17),m.Hc(6),m.Ub(),m.Ub()}if(2&e){const e=t.ngIf,n=m.hc(2);m.Eb(1),m.nc("disabled",e===n.resourceView.zoomLevels[0]),m.Eb(2),m.nc("disabled",e===n.resourceView.zoomLevels[n.resourceView.zoomLevels.length-1]),m.Eb(3),m.Jc("",e," %")}}function Wt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",1),m.Fc(1,Bt,9,4,"div",2),m.Fc(2,Qt,7,3,"div",3),m.ic(3,"async"),m.Vb(4,"button",4),m.dc("click",function(){return m.xc(e),m.hc().resourceView.setFullScreen()}),m.Qb(5,"svg-icon",5),m.Ub(),m.Ub()}if(2&e){const e=m.hc();m.Eb(1),m.nc("ngIf",e.resource.hasSegmentedPdf()&&null!==e.currentPage),m.Eb(1),m.nc("ngIf",m.jc(3,2,e.resourceView.getPdfZoom()))}}let Dt=(()=>{class e{constructor(e){this.resourceView=e,this.currentPage=null,this.unsubscribeAll=new E.a,this.resourceView.pdfPage.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(e=>{this.currentPage=e})}ngOnInit(){}prevPage(){this.currentPage.index>0&&this.resourceView.setPdfPage(this.currentPage.index-1)}nextPage(){const e=this.resource.getTotalPdfPages();this.currentPage.index<e-1&&this.resourceView.setPdfPage(this.currentPage.index+1)}ngOnDestroy(){this.unsubscribeAll&&(this.unsubscribeAll.next(),this.unsubscribeAll.complete())}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(W))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-controls-pdf"]],inputs:{resource:"resource"},decls:1,vars:1,consts:[["class","controls-pdf","fxLayout","row","fxLayoutAlign","start center",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center",1,"controls-pdf"],["class","controls-pdf-nav","fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","5px",4,"ngIf"],["class","controls-pdf-zoom","fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","5px",4,"ngIf"],[1,"controls-pdf-fullscreen",3,"click"],["src","assets/icons/full-screen.svg"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","5px",1,"controls-pdf-nav"],[1,"controls-pdf-prev",3,"disabled","click"],["src","assets/icons/back.svg"],[1,"controls-pdf-next",3,"disabled","click"],[1,"controls-pdf-pages"],[1,"current"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","5px",1,"controls-pdf-zoom"],[1,"controls-pdf-zoom-out",3,"disabled","click"],["src","assets/icons/less-button.svg"],[1,"controls-pdf-zoom-in",3,"disabled","click"],["src","assets/icons/plus-button.svg"],[1,"controls-pdf-zoom-current"]],template:function(e,t){1&e&&m.Fc(0,Wt,6,4,"div",0),2&e&&m.nc("ngIf",t.resource)},directives:[i.n,D.d,D.c,r.b,D.e],pipes:[i.b],styles:[".controls-pdf[_ngcontent-%COMP%]{background:#e5e5e5;border-radius:4px;color:rgba(0,0,0,.7);height:29px;padding:0 13px}.controls-pdf-nav[_ngcontent-%COMP%]{margin-right:28px}.controls-pdf-next[_ngcontent-%COMP%], .controls-pdf-prev[_ngcontent-%COMP%], .controls-pdf-zoom-in[_ngcontent-%COMP%], .controls-pdf-zoom-out[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;border:none;color:inherit;cursor:pointer;font:inherit;margin:0;padding:0;width:auto}.controls-pdf-next[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .controls-pdf-prev[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .controls-pdf-zoom-in[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .controls-pdf-zoom-out[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block;height:14px;width:14px}.controls-pdf-next[disabled][_ngcontent-%COMP%], .controls-pdf-prev[disabled][_ngcontent-%COMP%], .controls-pdf-zoom-in[disabled][_ngcontent-%COMP%], .controls-pdf-zoom-out[disabled][_ngcontent-%COMP%]{opacity:.4}.controls-pdf-next[_ngcontent-%COMP%]{transform:rotate(-180deg)}.controls-pdf-pages[_ngcontent-%COMP%]{font-size:9px}.controls-pdf-pages[_ngcontent-%COMP%] .current[_ngcontent-%COMP%]{text-decoration:underline}.controls-pdf-zoom[_ngcontent-%COMP%]{margin-right:32px}.controls-pdf-zoom-current[_ngcontent-%COMP%]{font-size:9px;padding-left:2px;text-decoration:underline}.controls-pdf-fullscreen[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;border:none;color:inherit;cursor:pointer;font:inherit;margin:0;padding:0;width:auto}.controls-pdf-fullscreen[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block}"]}),e})();function Nt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",5),m.Vb(1,"div"),m.Hc(2),m.ic(3,"translate"),m.Ub(),m.Vb(4,"div",6),m.Hc(5),m.Ub(),m.Vb(6,"div",7),m.Vb(7,"button",8),m.dc("click",function(){return m.xc(e),m.hc(2).prev.emit()}),m.Qb(8,"svg-icon",9),m.Ub(),m.Vb(9,"button",10),m.dc("click",function(){return m.xc(e),m.hc(2).next.emit()}),m.Qb(10,"svg-icon",9),m.Ub(),m.Ub(),m.Ub()}if(2&e){const e=m.hc(2);m.Eb(2),m.Ic(m.jc(3,4,"generic.result")),m.Eb(3),m.Ic(e.current+1+" / "+e.total),m.Eb(2),m.nc("disabled",0===e.current),m.Eb(2),m.nc("disabled",e.current===e.total-1)}}function qt(e,t){1&e&&m.Qb(0,"div")}function Jt(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-resource-source",11),m.dc("showSource",function(){return m.xc(e),m.hc(2).resourceView.showSource()}),m.Ub()}if(2&e){const e=m.hc(2);m.nc("resource",e.resource)("viewType",e.viewType)}}function Zt(e,t){if(1&e&&(m.Vb(0,"div",1),m.Fc(1,Nt,11,6,"div",2),m.Fc(2,qt,1,0,"div",3),m.Fc(3,Jt,1,2,"stf-resource-source",4),m.Ub()),2&e){const e=m.hc();m.Eb(1),m.nc("ngIf",e.showNavigation()),m.Eb(1),m.nc("ngIf",!e.showNavigation()),m.Eb(1),m.nc("ngIf",e.resourceView.canShowSource())}}let Gt=(()=>{class e{constructor(e){this.resourceView=e,this.total=0,this.showNav=!1,this.next=new m.n,this.prev=new m.n}ngOnInit(){}showNavigation(){return this.showNav&&this.total>0&&void 0!==this.current}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(W))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-nav"]],inputs:{resource:"resource",viewType:"viewType",total:"total",current:"current",showNav:"showNav"},outputs:{next:"next",prev:"prev"},decls:1,vars:1,consts:[["class","resource-nav","fxLayout","row wrap","fxLayoutAlign","space-between center","fxLayoutGap","10px",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","space-between center","fxLayoutGap","10px",1,"resource-nav"],["fxLayout","row","fxLayoutAlign","start center",4,"ngIf"],[4,"ngIf"],[3,"resource","viewType","showSource",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center"],[1,"resource-nav-counter"],[1,"resource-nav-buttons"],["mat-icon-button","",1,"resource-nav-prev",3,"disabled","click"],["src","assets/icons/back.svg"],["mat-icon-button","",1,"next",3,"disabled","click"],[3,"resource","viewType","showSource"]],template:function(e,t){1&e&&m.Fc(0,Zt,4,3,"div",0),2&e&&m.nc("ngIf",t.resource)},directives:[i.n,D.d,D.c,D.e,u.a,r.b,_t],pipes:[s.c],styles:[".resource-nav[_ngcontent-%COMP%]{border-bottom:1px solid #e7e7eb;min-height:76px}.resource-nav-counter[_ngcontent-%COMP%]{font-weight:var(--stf-font-weight-bold);margin:0 10px 0 12px}.resource-nav-buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{opacity:.3}.resource-nav-buttons[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:26px;width:26px}.resource-nav-buttons[_ngcontent-%COMP%] .next[_ngcontent-%COMP%]{margin-left:-4px}.resource-nav-buttons[_ngcontent-%COMP%] .next[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{transform:rotate(180deg)}"],changeDetection:0}),e})();var Kt=n("PqYM"),Yt=n("l5mm"),Xt=n("cp0P"),en=n("IzEk"),tn=n("GJmQ");function nn(e){var t=e.replace(/\r+/g,""),n=(t=t.replace(/^\s+|\s+$/g,"")).split("\n\n"),i="";if(n.length>0){i+="WEBVTT\n\n";for(var c=0;c<n.length;c+=1)i+=cn(n[c])}return i}function cn(e){for(var t="",n=e.split(/\n/);n.length>3;){for(var i=3;i<n.length;i++)n[2]+="\n"+n[i];n.splice(3,n.length-3)}var c=0;if(!n[0].match(/\d+:\d+:\d+/)&&n[1].match(/\d+:\d+:\d+/)&&(t+=n[0].match(/\w+/)+"\n",c+=1),!n[c].match(/\d+:\d+:\d+/))return"";var r=n[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);return r?(t+=r[1]+":"+r[2]+":"+r[3]+"."+r[4]+" --\x3e "+r[5]+":"+r[6]+":"+r[7]+"."+r[8]+"\n",n[c+=1]&&(t+=n[c]+"\n\n"),t):""}let rn=(()=>{class e{constructor(e,t,n){this.ref=e,this.API=t,this.loadScript=n,this.onGetBitrates=new m.n,this.dashLoaded=!1,this.subscriptions=[]}ngOnInit(){this.API.isPlayerReady&&this.dashLoaded?this.onPlayerReady():this.subscriptions.push(Object(Xt.a)(this.API.playerReadyEvent.pipe(Object(en.a)(1)),this.loadScript.loadScript("assets/dash.all.min.js").pipe(Object(en.a)(1))).subscribe(()=>{this.onPlayerReady()}))}onPlayerReady(){this.vgFor=this.ref.nativeElement.getAttribute("vgFor"),this.target=this.API.getMediaById(this.vgFor),this.createPlayer()}ngOnChanges(e){var t;(null===(t=e.vgDash)||void 0===t?void 0:t.currentValue)?this.createPlayer():this.destroyPlayer()}createPlayer(){if(this.dash&&this.destroyPlayer(),this.stfVgDash&&(this.stfVgDash.indexOf(".mpd")>-1||this.stfVgDash.indexOf("mpd-time-csf")>-1)){let e;if(this.vgDRMLicenseServer&&(e=this.vgDRMLicenseServer,this.vgDRMToken))for(const t in e)t.hasOwnProperty(t)&&(e[t].httpRequestHeaders={Authorization:this.vgDRMToken});this.dash=dashjs.MediaPlayer().create(),this.dash.extend("RequestModifier",()=>({modifyRequestHeader:e=>e,modifyRequestURL:e=>e.indexOf("token")>-1?e:e+"?ws_token="+this.stfVgToken}),!0),this.dash.updateSettings({debug:{logLevel:dashjs.Debug.LOG_LEVEL_NONE}}),this.dash.initialize(this.ref.nativeElement),this.dash.setAutoPlay(!1),this.dash.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED,()=>{const e=this.dash.getBitrateInfoListFor("audio"),t=this.dash.getBitrateInfoListFor("video");e.length>1&&(e.forEach(e=>e.qualityIndex=++e.qualityIndex),e.unshift({qualityIndex:0,width:0,height:0,bitrate:0,mediaType:"video",scanType:"AUTO"}),this.onGetBitrates.emit(e)),t.length>1&&(t.forEach(e=>e.qualityIndex=++e.qualityIndex),t.unshift({qualityIndex:0,width:0,height:0,bitrate:0,mediaType:"video",scanType:"AUTO"}),this.onGetBitrates.emit(t))}),e&&this.dash.setProtectionData(e),this.dash.attachSource(this.stfVgDash)}else this.target&&(this.target.pause(),this.target.seekTime(0),this.ref.nativeElement.src=this.stfVgDash)}setBitrate({mediaType:e,qualityIndex:t}){this.dash&&(t>0?(this.dash.getSettings()&&this.dash.updateSettings({streaming:{abr:{autoSwitchBitrate:{[e]:!1}}}}),this.dash.setQualityFor(e,t-1)):this.dash.updateSettings({streaming:{abr:{autoSwitchBitrate:{[e]:!0}}}}))}destroyPlayer(){this.dash&&(this.dash.reset(),this.dash=null)}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.destroyPlayer()}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(m.l),m.Pb(x.a),m.Pb($.c))},e.\u0275dir=m.Kb({type:e,selectors:[["","stfVgDash",""]],inputs:{stfVgDash:"stfVgDash",stfVgToken:"stfVgToken",vgDRMToken:"vgDRMToken",vgDRMLicenseServer:"vgDRMLicenseServer"},outputs:{onGetBitrates:"onGetBitrates"},exportAs:["stfVgDash"],features:[m.Cb]}),e})();const on=["player"];function sn(e,t){1&e&&m.Qb(0,"vg-overlay-play")}function an(e,t){1&e&&m.Qb(0,"vg-scrub-bar",11)}function ln(e,t){1&e&&(m.Vb(0,"vg-scrub-bar"),m.Qb(1,"vg-scrub-bar-current-time"),m.Qb(2,"vg-scrub-bar-buffering-time"),m.Ub())}function un(e,t){1&e&&m.Qb(0,"vg-track-selector")}function dn(e,t){if(1&e&&(m.Qb(0,"track",15),m.ic(1,"translate")),2&e){const e=t.$implicit;m.oc("label",m.jc(1,4,e.label)),m.nc("src",e.url,m.zc)("srclang",e.lang)("default",e.default)}}function hn(e,t){if(1&e&&(m.Vb(0,"video",12,13),m.Fc(3,dn,2,6,"track",14),m.Ub()),2&e){const e=m.tc(1),t=m.hc(3);m.nc("vgMedia",e)("stfVgDash",t.currentstream)("stfVgToken",t.token),m.Eb(3),m.nc("ngForOf",t.subtitles)}}function gn(e,t){if(1&e&&(m.Qb(0,"track",15),m.ic(1,"translate")),2&e){const e=t.$implicit;m.oc("label",m.jc(1,4,e.label)),m.nc("src",e.url,m.zc)("srclang",e.lang)("default",e.default)}}function bn(e,t){if(1&e&&(m.Vb(0,"video",16,17),m.Qb(2,"source",18),m.Fc(3,gn,2,6,"track",14),m.Ub()),2&e){const e=m.tc(1),t=m.hc(3);m.nc("vgMedia",e),m.Eb(2),m.oc("type",t.resource.icon),m.nc("src",t.download_url,m.zc),m.Eb(1),m.nc("ngForOf",t.subtitles)}}function pn(e,t){if(1&e){const e=m.Wb();m.Vb(0,"vg-player",2,3),m.dc("onPlayerReady",function(t){return m.xc(e),m.hc(2).onPlayerReady(t)}),m.Fc(2,sn,1,0,"vg-overlay-play",4),m.Qb(3,"vg-buffering"),m.Vb(4,"vg-scrub-bar"),m.Qb(5,"vg-scrub-bar-current-time"),m.Qb(6,"vg-scrub-bar-buffering-time"),m.Ub(),m.Vb(7,"vg-controls",5),m.Qb(8,"vg-play-pause"),m.Qb(9,"vg-playback-button"),m.Qb(10,"vg-time-display",6),m.Fc(11,an,1,0,"vg-scrub-bar",7),m.Fc(12,ln,3,0,"vg-scrub-bar",4),m.Qb(13,"vg-time-display",8),m.Fc(14,un,1,0,"vg-track-selector",4),m.Qb(15,"vg-mute"),m.Qb(16,"vg-volume"),m.Qb(17,"vg-fullscreen"),m.Ub(),m.Fc(18,hn,4,4,"video",9),m.Fc(19,bn,4,4,"video",10),m.Ub()}if(2&e){const e=m.hc(2);m.Eb(2),m.nc("ngIf",!e.isAudio),m.Eb(5),m.nc("vgAutohide",e.subtitles.length>0)("vgAutohideTime",2),m.Eb(4),m.nc("ngIf",!e.isAudio),m.Eb(1),m.nc("ngIf",e.isAudio),m.Eb(2),m.nc("ngIf",e.subtitles.length>0),m.Eb(4),m.nc("ngIf",e.currentstream),m.Eb(1),m.nc("ngIf",!e.currentstream)}}function fn(e,t){if(1&e&&(m.Vb(0,"div"),m.Fc(1,pn,20,8,"vg-player",1),m.Ub()),2&e){const e=m.hc();m.Hb("is-audio",e.isAudio),m.Eb(1),m.nc("ngIf",e.download_url)}}let mn=(()=>{class e{constructor(e,t,n,i){this.token_service=e,this.cd=t,this.sanitizer=n,this.apiService=i,this.isPublic=!1,this.docReady=!1,this.firstLoad=!0,this.isAudio=!1,this.enabled=!0,this.subtitles=[],this.subtitlesLoaded=!1,this.unsubscribeAll=new E.a}onPlayerReady(e){this.api=e,this.firstLoad&&(this.handleSeekEvents(),this.firstLoad=!1),this.prevTime&&this.restoreVideoState()}ngOnInit(){var e;this.isAudio=!!(null===(e=this.resource)||void 0===e?void 0:e.isAudio()),this.handlePauseEvents(),this.handleTokenRefresh(),this.generateVideoUrl(),this.getSubtitles().subscribe(e=>{this.subtitles=e,this.subtitlesLoaded=!0,this.cd.markForCheck()},e=>{this.subtitlesLoaded=!0,this.cd.markForCheck()})}handlePauseEvents(){var e;null===(e=this.pause)||void 0===e||e.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{if(this.api){const e=this.api.getDefaultMedia();"playing"===e.state&&e.pause()}})}pollCanPlay(e){return Object(Kt.a)(10,1e3).pipe(Object(S.a)(()=>{var e;const t=null===(e=this.api)||void 0===e?void 0:e.getDefaultMedia();return!!((null==t?void 0:t.elem.readyState)>=2)}),Object(en.a)(e),Object(tn.a)(e=>!e,!0))}canPlay(){const e=this.api.getDefaultMedia().subscriptions.canPlay,t=this.pollCanPlay(8).pipe(Object(A.a)(e=>!0===e));return Object(T.a)(e,t).pipe(Object(en.a)(1))}handleSeekEvents(){this.canPlay().pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{var e;null===(e=this.second)||void 0===e||e.pipe(Object(H.a)(this.unsubscribeAll),Object(A.a)(e=>e&&(void 0!==e.goPlay||void 0!==e.time)&&!!this.api),Object(S.a)(e=>void 0!==e.goPlay?e.goPlay:e.time)).subscribe(e=>{const t=this.api.getDefaultMedia();t.currentTime=e,t.play()})})}handleTokenRefresh(){Object(Yt.a)(585e3).pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{this.saveVideoState(),this.generateVideoUrl().subscribe(()=>{this.enabled=!1,this.cd.detectChanges(),this.enabled=!0,this.cd.markForCheck()})})}saveVideoState(){const e=this.api.getDefaultMedia();this.prevTime=e.currentTime,this.prevState=e.state,this.prevVolume=this.api.volume}restoreVideoState(){this.canPlay().pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{const e=this.api.getDefaultMedia();e.currentTime=this.prevTime,"playing"===this.prevState&&e.play(),this.prevVolume&&(this.api.volume=this.prevVolume),this.prevTime=void 0,this.prevState=void 0,this.prevVolume=void 0})}generateVideoUrl(){var e,t;const n=new E.a,i=this.isPublic?Object(F.a)({token:""}):this.token_service.getTempToken(!0);return(null===(t=null===(e=this.resource)||void 0===e?void 0:e.files)||void 0===t?void 0:t.files["video.mpd"])&&i.subscribe(e=>{var t,i;const c=`${null===(t=this.resource)||void 0===t?void 0:t.url}/@download/files/video.mpd`;this.token=e.token,this.currentstream=c+"?ws_token="+e.token;const r=`${null===(i=this.resource)||void 0===i?void 0:i.url}/@stream/files/${$.d}`;this.download_url=this.sanitizer.bypassSecurityTrustResourceUrl(r+"?ws_token="+e.token),this.docReady=!0,this.cd.markForCheck(),n.next(!0),n.complete()}),i.subscribe(e=>{var t;const i=`${null===(t=this.resource)||void 0===t?void 0:t.url}/@stream/files/${$.d}`;this.download_url=this.sanitizer.bypassSecurityTrustResourceUrl(i+"?ws_token="+e.token),this.docReady=!0,this.cd.markForCheck(),n.next(!0),n.complete()}),n.asObservable()}getSubtitles(){const e={};return["en","es","ca"].forEach(t=>{const n=this.resource.getSubtitlesUrl(t);void 0!==n&&(e[t]=this.apiService.getFileText(n))}),0===Object.keys(e).length?Object(F.a)([]):Object(Xt.a)(e).pipe(Object(S.a)(e=>Object.entries(e).map(([e,t])=>{let n;try{n=new Blob([nn(t)])}catch(c){throw new Error("Invalid srt subtitles")}const i=URL.createObjectURL(n);return{lang:e,label:"language."+e,url:this.sanitizer.bypassSecurityTrustResourceUrl(i),default:"en"===e}})))}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(g.c),m.Pb(m.h),m.Pb(de.b),m.Pb(g.a))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-movie-viewer-component"]],viewQuery:function(e,t){if(1&e&&m.Lc(on,1),2&e){let e;m.sc(e=m.ec())&&(t.player=e.first)}},inputs:{resource:"resource",second:"second",pause:"pause",isPublic:"isPublic"},decls:1,vars:1,consts:[[3,"is-audio",4,"ngIf"],[3,"onPlayerReady",4,"ngIf"],[3,"onPlayerReady"],["player",""],[4,"ngIf"],[3,"vgAutohide","vgAutohideTime"],["vgProperty","current","vgFormat","mm:ss"],["style","pointer-events: none;",4,"ngIf"],["vgProperty","total","vgFormat","mm:ss"],["id","media_stream","preload","auto","crossorigin","",3,"vgMedia","stfVgDash","stfVgToken",4,"ngIf"],["id","media","preload","auto","crossorigin","",3,"vgMedia",4,"ngIf"],[2,"pointer-events","none"],["id","media_stream","preload","auto","crossorigin","",3,"vgMedia","stfVgDash","stfVgToken"],["media_stream","","stfVgDash","stfVgDash"],["kind","subtitles",3,"label","src","srclang","default",4,"ngFor","ngForOf"],["kind","subtitles",3,"label","src","srclang","default"],["id","media","preload","auto","crossorigin","",3,"vgMedia"],["media",""],[3,"src","type"]],template:function(e,t){1&e&&m.Fc(0,fn,2,3,"div",0),2&e&&m.nc("ngIf",t.enabled&&t.subtitlesLoaded)},directives:[i.n,x.f,O.a,w.h,w.i,w.g,w.a,w.e,w.f,w.j,w.d,w.l,w.c,P.a,w.k,x.e,rn,i.m],pipes:[s.c],styles:[".mat-spinner circle{stroke:var(--stf-primary)}.is-audio[_ngcontent-%COMP%] vg-player[_ngcontent-%COMP%]{height:50px}"],changeDetection:0}),e})();const vn=["youtubePlayer"];function xn(e,t){if(1&e&&m.Qb(0,"stf-movie-viewer-component",5),2&e){const e=m.hc(2);m.nc("resource",e.resource)("second",e.selectedTranscript$)("pause",e.resourceView.getPause())("isPublic",e.isPublic())}}const wn=function(){return{rel:0}};function Pn(e,t){if(1&e&&m.Qb(0,"youtube-player",6,7),2&e){const e=m.hc(2);m.nc("videoId",e.resource.isYoutubeLink())("playerVars",m.pc(2,wn))}}function On(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",1),m.Fc(1,xn,1,4,"stf-movie-viewer-component",2),m.Fc(2,Pn,2,3,"youtube-player",3),m.Vb(3,"stf-resource-nav",4),m.dc("next",function(){return m.xc(e),m.hc().resourceView.nextTranscript()})("prev",function(){return m.xc(e),m.hc().resourceView.prevTranscript()}),m.Ub(),m.Ub()}if(2&e){const e=m.hc();m.Eb(1),m.nc("ngIf","media"===e.viewType),m.Eb(1),m.nc("ngIf","link-youtube"===e.viewType),m.Eb(1),m.nc("resource",e.resource)("viewType",e.viewType)("total",e.resultsLength)("current",e.selectedIndex)("showNav",e.selectedTranscript&&e.selectedTranscript.fromSearch)}}let yn=(()=>{class e{constructor(e,t,n,i){this.resourceViewConfig=e,this.resourceView=t,this.loadScriptService=n,this.cd=i,this.selectedTranscript=null,this.unsubscribeAll=new E.a,this.selectedTranscript$=this.resourceView.getSelectedTranscript(),this.selectedTranscript$.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(e=>{this.selectedTranscript=e,this.cd.markForCheck()})}ngOnInit(){"link-youtube"===this.viewType&&this.initYoutube()}initYoutube(){this.loadScriptService.loadScript("https://www.youtube.com/iframe_api"),this.selectedTranscript$.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(e=>{var t,n;null!==e&&(null===(t=this.youtubePlayer)||void 0===t||t.seekTo(e.time,!0),null===(n=this.youtubePlayer)||void 0===n||n.playVideo(),this.cd.markForCheck())}),this.resourceView.getPause().pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{var e;null===(e=this.youtubePlayer)||void 0===e||e.pauseVideo(),this.cd.markForCheck()})}isPublic(){return this.resourceViewConfig.isPublicResource()}ngOnDestroy(){this.unsubscribeAll&&(this.unsubscribeAll.next(),this.unsubscribeAll.complete())}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(B),m.Pb(W),m.Pb($.c),m.Pb(m.h))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-media"]],viewQuery:function(e,t){if(1&e&&m.Lc(vn,1),2&e){let e;m.sc(e=m.ec())&&(t.youtubePlayer=e.first)}},inputs:{resource:"resource",viewType:"viewType",resultsLength:"resultsLength",selectedIndex:"selectedIndex"},decls:1,vars:1,consts:[["class","resource-media",4,"ngIf"],[1,"resource-media"],["class","w-100-p",3,"resource","second","pause","isPublic",4,"ngIf"],["width","100%",3,"videoId","playerVars",4,"ngIf"],[3,"resource","viewType","total","current","showNav","next","prev"],[1,"w-100-p",3,"resource","second","pause","isPublic"],["width","100%",3,"videoId","playerVars"],["youtubePlayer",""]],template:function(e,t){1&e&&m.Fc(0,On,4,7,"div",0),2&e&&m.nc("ngIf",t.resource)},directives:[i.n,Gt,mn,_.a],styles:[""],changeDetection:0}),e})();const Cn=["pdfComponent"];function Mn(e,t){if(1&e){const e=m.Wb();m.Vb(0,"ngx-extended-pdf-viewer",4,5),m.dc("pdfLoaded",function(t){return m.xc(e),m.hc().pdfLoaded(t)})("updateFindMatchesCount",function(t){return m.xc(e),m.hc().updateFindMatchesCount(t)})("updateFindState",function(t){return m.xc(e),m.hc().updateFindState(t)})("textLayerRendered",function(t){return m.xc(e),m.hc().highlightWords(t)})("currentZoomFactor",function(t){return m.xc(e),m.hc().zoomUpdated(t)})("pageChange",function(t){return m.xc(e),m.hc().page=t})("zoomChange",function(t){return m.xc(e),m.hc().zoom=t}),m.Ub()}if(2&e){const e=m.hc(),t=m.tc(2);m.nc("src",e.url)("customToolbar",t)("textLayer",!0)("page",e.page)("zoom",e.zoom)("showBorders",!0)("height",e.height)("useBrowserLocale",!0)("showHandToolButton",!0)("httpHeaders",e.headers)("scrollMode",e.scrollMode)}}function kn(e,t){1&e&&(m.Vb(0,"div",6),m.Vb(1,"div",7),m.Qb(2,"pdf-toggle-sidebar"),m.Qb(3,"div",8),m.Qb(4,"pdf-find-button",9),m.Qb(5,"pdf-paging-area"),m.Qb(6,"div",8),m.Ub(),m.Vb(7,"div",10),m.Qb(8,"pdf-presentation-mode"),m.Ub(),m.Qb(9,"pdf-zoom-toolbar"),m.Ub()),2&e&&(m.Eb(4),m.nc("showFindButton",!0)("textLayer",!0))}function _n(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",6),m.Vb(1,"div",11),m.Qb(2,"pdf-zoom-dropdown",12),m.Vb(3,"input",13),m.dc("click",function(){return m.xc(e),m.hc().zoom="50%"}),m.Ub(),m.Vb(4,"label",14),m.Hc(5,"50%"),m.Ub(),m.Vb(6,"input",15),m.dc("click",function(){return m.xc(e),m.hc().zoom="100%"}),m.Ub(),m.Vb(7,"label",16),m.Hc(8,"100%"),m.Ub(),m.Vb(9,"input",17),m.dc("click",function(){return m.xc(e),m.hc().zoom="200%"}),m.Ub(),m.Vb(10,"label",18),m.Hc(11,"200%"),m.Ub(),m.Vb(12,"input",19),m.dc("click",function(){return m.xc(e),m.hc().zoom="auto"}),m.Ub(),m.Vb(13,"label",20),m.Hc(14,"auto"),m.Ub(),m.Ub(),m.Ub()}if(2&e){const e=m.hc();m.Eb(1),m.Hb("invisible",!1),m.Eb(2),m.nc("checked","50%"===e.zoom),m.Eb(3),m.nc("checked","100%"===e.zoom),m.Eb(3),m.nc("checked","200%"===e.zoom),m.Eb(3),m.nc("checked","auto"===e.zoom)}}function Vn(e,t){1&e&&(m.Vb(0,"div",21),m.Vb(1,"div",22),m.Vb(2,"div",23),m.Vb(3,"button",24),m.Vb(4,"span",25),m.Hc(5,"Thumbnails"),m.Ub(),m.Ub(),m.Vb(6,"button",26),m.Vb(7,"span",27),m.Hc(8,"Document Outline"),m.Ub(),m.Ub(),m.Vb(9,"button",28),m.Vb(10,"span",29),m.Hc(11,"Attachments"),m.Ub(),m.Ub(),m.Ub(),m.Ub(),m.Qb(12,"pdf-sidebar-content"),m.Qb(13,"div",30),m.Ub())}let In=(()=>{class e{constructor(e,t,n){this.token_service=e,this.api=t,this.ngxExtendedPdfViewerService=n,this.preview=!1,this.load=!0,this.docReady=!1,this.page=1,this.zoom="50%",this.height="450px",this.scrollMode=f.l.horizontal,this.highlightAll=!0,this.matchCase=!1,this.wholeWord=!1,this.ignoreAccents=!0,this.fuzzy=!0,this._searchtext="",this.pendingSearchtext="",this.unsubscribeAll=new E.a}ngOnInit(){var e,t;this.headers={Authorization:this.api.createHeaders(!0).get("Authorization")},this.setpage&&this.setpage.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(e=>{e.nextPage&&(this.page=e.nextPage),e.query&&(this.searchtext=e.query)}),this.url=this.preview?`${null===(e=this.resource)||void 0===e?void 0:e.url}/@download/previews/${$.d}`:`${null===(t=this.resource)||void 0===t?void 0:t.url}/@download/files/${$.d}`}get findStateText(){switch(this.findState){case f.a.FOUND:return"found";case f.a.NOT_FOUND:return"not found";case f.a.PENDING:return"pending";case f.a.WRAPPED:return"wrapped"}}get searchtext(){return this._searchtext}set searchtext(e){this.docReady&&this.ngxExtendedPdfViewerService.find(e,{highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWords:this.wholeWord,ignoreAccents:this.ignoreAccents,fuzzySearch:this.fuzzy})?this._searchtext=e:this.pendingSearchtext=e}search(e){return this.ngxExtendedPdfViewerService.find(e,{highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWords:this.wholeWord,ignoreAccents:this.ignoreAccents,fuzzySearch:this.fuzzy})}findNext(){this.ngxExtendedPdfViewerService.findNext()}findPrevious(){this.ngxExtendedPdfViewerService.findPrevious()}updateFindState(e){this.findState=e}updateFindMatchesCount(e){this.currentMatchNumber=e.current,this.totalMatches=e.total}zoomUpdated(e){let t=1250*e;void 0!==this.maxHeight&&t>window.innerHeight*this.maxHeight&&(t=window.innerHeight*this.maxHeight),t<404&&(t=404),this.height=`${t}px`}pdfLoaded(e){this.totalPages=e.pagesCount,this.docReady=!0}incrementPage(e){this.page+=e}getMainFileUrl(){if(!this.resource||!this.resource.thumbnail)return""}highlightWords(e){""!==this.pendingSearchtext&&(this.search(this.pendingSearchtext),this.pendingSearchtext="")}ngOnDestroy(){this.unsubscribeAll&&(this.unsubscribeAll.next(),this.unsubscribeAll.complete())}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(g.c),m.Pb(g.a),m.Pb(f.d))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-pdf-viewer-component"]],viewQuery:function(e,t){if(1&e&&m.Lc(Cn,1),2&e){let e;m.sc(e=m.ec())&&(t.pdfComponent=e.first)}},inputs:{resource:"resource",setpage:"setpage",preview:"preview",maxHeight:"maxHeight",load:"load"},decls:7,vars:1,consts:[["backgroundColor","#ffffff",3,"src","customToolbar","textLayer","page","zoom","showBorders","height","useBrowserLocale","showHandToolButton","httpHeaders","scrollMode","pdfLoaded","updateFindMatchesCount","updateFindState","textLayerRendered","currentZoomFactor","pageChange","zoomChange",4,"ngIf"],["additionalButtons",""],["customCheckboxZoomToolbar",""],["fancySidebar",""],["backgroundColor","#ffffff",3,"src","customToolbar","textLayer","page","zoom","showBorders","height","useBrowserLocale","showHandToolButton","httpHeaders","scrollMode","pdfLoaded","updateFindMatchesCount","updateFindState","textLayerRendered","currentZoomFactor","pageChange","zoomChange"],["pdfComponent",""],["id","toolbarViewer"],["id","toolbarViewerLeft"],[1,"toolbarButtonSpacer"],[3,"showFindButton","textLayer"],["id","toolbarViewerRight"],["id","toolbarViewerMiddle"],[1,"invisible"],["type","radio","id","zoom50","tabindex","94","name","zoom",1,"toolbarField","radio",3,"checked","click"],["for","zoom50",1,"toolbarLabel"],["type","radio","id","zoom100","tabindex","95","name","zoom",1,"toolbarField","radio",3,"checked","click"],["for","zoom100",1,"toolbarLabel"],["type","radio","id","zoom200","tabindex","96","name","zoom",1,"toolbarField","radio",3,"checked","click"],["for","zoom200",1,"toolbarLabel"],["type","radio","id","zoom-auto","tabindex","97","name","zoom",1,"toolbarField","radio",3,"checked","click"],["for","zoom-auto",1,"toolbarLabel"],["id","sidebarContainer",2,"top","31px","background-color","goldenrod"],["id","additionalSidebarContainer"],["id","toolbarSidebar"],["type","button","id","viewThumbnail","data-l10n-id","thumbs",1,"toolbarButton",2,"background-color","red","height","100%","width","34%","border","0","margin","0","padding","0"],["data-l10n-id","thumbs_label"],["type","button","id","viewOutline","data-l10n-id","document_outline",1,"toolbarButton",2,"background-color","green","height","100%","width","35%","border","0","margin","0","padding","0"],["data-l10n-id","document_outline_label"],["type","button","id","viewAttachments","data-l10n-id","attachments",1,"toolbarButton",2,"background-color","blue","height","100%","width","34%","border","0","margin","0","padding","0"],["data-l10n-id","attachments_label"],["id","sidebarResizer",1,"hidden"]],template:function(e,t){1&e&&(m.Fc(0,Mn,2,11,"ngx-extended-pdf-viewer",0),m.Fc(1,kn,10,2,"ng-template",null,1,m.Gc),m.Fc(3,_n,15,6,"ng-template",null,2,m.Gc),m.Fc(5,Vn,14,0,"ng-template",null,3,m.Gc)),2&e&&m.nc("ngIf",t.load)},directives:[i.n,f.b,f.i,f.e,f.f,f.g,f.k,f.j,f.h],styles:[".mat-spinner circle{stroke:var(--stf-primary)}.pdf-viewer[_ngcontent-%COMP%]{display:block;max-width:100%;padding:2rem}"],changeDetection:0}),e})();var Fn=n("xgIS");const En=["pdfComponent"],Tn=function(){return[.5,1,2,"auto"]};function Sn(e,t){if(1&e){const e=m.Wb();m.Vb(0,"ngx-extended-pdf-viewer",1,2),m.dc("pdfLoaded",function(t){return m.xc(e),m.hc().pdfLoaded(t)})("textLayerRendered",function(t){return m.xc(e),m.hc().highlightWords(t)})("updateFindState",function(t){return m.xc(e),m.hc().updateFindState(t)})("zoomChange",function(t){return m.xc(e),m.hc().zoom=t})("zoomChange",function(t){return m.xc(e),m.hc().zoomChange.emit(t)}),m.Ub()}if(2&e){const e=m.hc();m.nc("src",e.url)("showToolbar",!1)("textLayer",!0)("page",0)("zoom",e.zoom)("zoomLevels",m.pc(13,Tn))("showBorders",!0)("height",e.height+"px")("useBrowserLocale",!0)("showHandToolButton",!0)("httpHeaders",e.headers)("scrollMode",e.scrollMode)("zoom",e.zoom)}}let Un=(()=>{class e{constructor(e,t,n){this.api=e,this.element=t,this.ngxExtendedPdfViewerService=n,this.load=!0,this.url=null,this.height=400,this.zoom=50,this.zoomChange=new m.n,this.docReady=!1,this.scrollMode=f.l.vertical,this.pendingSearch=!0,this._searchtext="",this.unsubscribeAll=new E.a,this.highlightAll=!0,this.matchCase=!1,this.wholeWord=!1,this.ignoreAccents=!0,this.fuzzy=!0}get searchtext(){return this._searchtext}set searchtext(e){this._searchtext=e,this.docReady&&this.search(e)}ngOnInit(){this.headers={Authorization:this.api.createHeaders(!0).get("Authorization")},this.fullScreen&&this.fullScreen.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{this.showFullScreen()})}search(e){return this.ngxExtendedPdfViewerService.find(e,{highlightAll:this.highlightAll,matchCase:this.matchCase,wholeWords:this.wholeWord,ignoreAccents:this.ignoreAccents,fuzzySearch:this.fuzzy})}pdfLoaded(e){this.docReady=!0}ngOnChanges(e){e.url&&(this.pendingSearch=!0)}highlightWords(e){this.pendingSearch&&""!==this.searchtext&&this.search(this.searchtext),this.pendingSearch=!1}showFullScreen(){this.element.nativeElement.querySelector("#presentationMode").click()}updateFindState(e){if(e===f.a.FOUND){const e=this.element.nativeElement.querySelector("#viewerContainer"),t=Object(Kt.a)(300),n=Object(Fn.a)(e,"scroll").pipe(Object(H.a)(t));Object(T.a)(t,n).pipe(Object(en.a)(1)).subscribe(()=>{this.scrollToResult(e)})}}scrollToResult(e){const t=this.element.nativeElement.querySelectorAll(".textLayer .highlight"),n=Array.from(t).filter(e=>e.textContent&&e.textContent.length>2)[0];if(n){const t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),c=n.clientWidth,r=e.clientHeight,o=e.clientWidth,s=t.top-i.top,a=t.left-i.left,l=t.right-i.right;s>0&&s<=r&&a>0&&l<=o||(e.scrollTop=Math.round(s-r/2),e.scrollLeft=Math.round(a-o/2-c/2))}}ngOnDestroy(){this.unsubscribeAll&&(this.unsubscribeAll.next(),this.unsubscribeAll.complete())}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(g.a),m.Pb(m.l),m.Pb(f.d))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-pdf-single-page"]],viewQuery:function(e,t){if(1&e&&m.Lc(En,1),2&e){let e;m.sc(e=m.ec())&&(t.pdfComponent=e.first)}},inputs:{load:"load",url:"url",height:"height",zoom:"zoom",fullScreen:"fullScreen",searchtext:"searchtext"},outputs:{zoomChange:"zoomChange"},features:[m.Cb],decls:1,vars:1,consts:[["backgroundColor","#fff",3,"src","showToolbar","textLayer","page","zoom","zoomLevels","showBorders","height","useBrowserLocale","showHandToolButton","httpHeaders","scrollMode","pdfLoaded","textLayerRendered","updateFindState","zoomChange",4,"ngIf"],["backgroundColor","#fff",3,"src","showToolbar","textLayer","page","zoom","zoomLevels","showBorders","height","useBrowserLocale","showHandToolButton","httpHeaders","scrollMode","pdfLoaded","textLayerRendered","updateFindState","zoomChange"],["pdfComponent",""]],template:function(e,t){1&e&&m.Fc(0,Sn,2,14,"ngx-extended-pdf-viewer",0),2&e&&m.nc("ngIf",t.load)},directives:[i.n,f.b],styles:["[_nghost-%COMP%] ngx-extended-pdf-viewer .pdfViewer .page{-o-border-image:none!important;border-image:none!important;box-shadow:0 0 40px 0 rgba(0,0,0,.05)}"],changeDetection:0}),e})();const Ln=["tabNav"],Rn=["dataTable"],An=["list"];function zn(e,t){if(1&e){const e=m.Wb();m.Vb(0,"button",14),m.dc("click",function(){return m.xc(e),m.hc(3).prevTab()}),m.Qb(1,"svg-icon",15),m.Ub()}}function jn(e,t){if(1&e){const e=m.Wb();m.Vb(0,"button",16),m.dc("click",function(){m.xc(e);const n=t.index;return m.hc(3).selectTab.emit(n)}),m.Hc(1),m.Ub()}if(2&e){const e=t.$implicit,n=t.index,i=m.hc(3);m.Hb("selected",n===i.selectedTab),m.nc("title",e),m.Eb(1),m.Jc(" Tab. ",n+1," ")}}function Hn(e,t){if(1&e){const e=m.Wb();m.Vb(0,"button",17),m.dc("click",function(){return m.xc(e),m.hc(3).nextTab()}),m.Qb(1,"svg-icon",15),m.Ub()}}function $n(e,t){if(1&e&&(m.Vb(0,"div",7),m.Fc(1,zn,2,0,"button",8),m.Vb(2,"div",9,10),m.Fc(4,jn,2,4,"button",11),m.Ub(),m.Qb(5,"div",12),m.Fc(6,Hn,2,0,"button",13),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("ngIf",e.showPrevButton()),m.Eb(3),m.nc("ngForOf",e.tabKeys),m.Eb(2),m.nc("ngIf",e.showNextButton())}}function Bn(e,t){if(1&e&&(m.Vb(0,"span",24),m.Hc(1),m.Ub()),2&e){const e=m.hc().$implicit,t=m.hc(3);m.Eb(1),m.Jc(" ",t.renderColumn(e)," ")}}function Qn(e,t){if(1&e&&(m.Vb(0,"span",25),m.Hc(1),m.Ub()),2&e){const e=m.hc().$implicit,t=m.hc(3);m.nc("matTooltip",e),m.Eb(1),m.Jc(" ",t.renderColumn(e)," ")}}function Wn(e,t){if(1&e&&(m.Vb(0,"div",21),m.Fc(1,Bn,2,1,"span",22),m.Fc(2,Qn,2,2,"span",23),m.Ub()),2&e){const e=t.$implicit;m.Eb(1),m.nc("ngIf",e.length<=16),m.Eb(1),m.nc("ngIf",e.length>16)}}function Dn(e,t){if(1&e&&(m.Tb(0),m.Vb(1,"div",18),m.Vb(2,"div",19),m.Hc(3),m.Ub(),m.Fc(4,Wn,3,2,"div",20),m.Ub(),m.Sb()),2&e){const e=t.$implicit,n=t.first,i=m.hc(2);m.Eb(1),m.Hb("first-row",n)("selected",e.rowIndex===i.selectedRow),m.Eb(2),m.Ic(e.rowIndex+1),m.Eb(1),m.nc("ngForOf",e.columns)}}function Nn(e,t){if(1&e&&(m.Vb(0,"div",1,2),m.Fc(2,$n,7,3,"div",3),m.Vb(3,"cdk-virtual-scroll-viewport",4,5),m.Fc(5,Dn,5,6,"ng-container",6),m.Ub(),m.Ub()),2&e){const e=m.hc();m.Cc("max-height",e.height,"px"),m.Eb(2),m.nc("ngIf",e.tabKeys.length>1),m.Eb(1),m.Cc("height",e.getTableHeight(),"px"),m.nc("itemSize",e.rowHeight),m.Eb(2),m.nc("cdkVirtualForOf",e.rows)}}let qn=(()=>{class e{constructor(e,t){this.cd=e,this.ruler=t,this.selectedTab=0,this.selectTab=new m.n,this.rowHeight=37,this.firstScroll=!1,this.unsubscribeAll=new E.a}ngOnInit(){this.ruler.change(100).pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{this.tabKeys.length>1&&this.updateButtonsVisibility()})}ngAfterViewInit(){var e;this.tabKeys.length>1&&this.updateButtonsVisibility(),null===(e=this.list)||void 0===e||e.changes.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{setTimeout(()=>{this.virtualScroll.checkViewportSize(),this.firstScroll||(this.scrollToSelected(),this.firstScroll=!0),this.cd.markForCheck()},100)})}ngOnChanges(e){if(e.selectedRow&&this.virtualScroll){let t=0;e.selectedTab&&(t=100),setTimeout(()=>this.scrollToSelected(),t)}}get tabKeys(){return Object.keys(this.data.tabs)}get rows(){return this.data.tabs[this.tabKeys[this.selectedTab]]}renderColumn(e){return"nan"===e?"":e}getTableHeight(){if(void 0!==this.height){const e=37*this.rows.length+20,t=this.height-29;return e<t?e:t}return 0}scrollToSelected(){if(this.virtualScroll&&void 0!==this.selectedRow){const e=this.virtualScroll.getElementRef().nativeElement,t=37*this.selectedRow-Math.round(e.clientHeight/2);this.virtualScroll.scrollToOffset(t)}if(this.tabNav){const e=this.tabNav.nativeElement;e.scrollLeft=121*this.selectedTab-Math.round(e.clientWidth/2)+60.5}}showPrevButton(){return void 0!==this.tabNav&&this.tabNav.nativeElement.scrollLeft>0}showNextButton(){if(this.tabNav&&this.container){const e=this.tabNav.nativeElement.scrollLeft,t=this.tabNav.nativeElement.scrollWidth,n=this.container.nativeElement.offsetWidth-19-(e>0?44:0);return t>n&&e+n<t}return!1}prevTab(){const e=this.tabNav.nativeElement;e.scrollLeft=e.scrollLeft-121,setTimeout(()=>this.updateButtonsVisibility(),0)}nextTab(){const e=this.tabNav.nativeElement;e.scrollLeft=e.scrollLeft+121,setTimeout(()=>this.updateButtonsVisibility(),0)}updateButtonsVisibility(){this.cd.markForCheck()}ngOnDestroy(){this.unsubscribeAll&&(this.unsubscribeAll.next(),this.unsubscribeAll.complete())}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(m.h),m.Pb(C.g))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-data-table"]],viewQuery:function(e,t){if(1&e&&(m.Lc(Ln,1),m.Lc(Rn,1),m.Lc(C.d,1),m.Lc(An,1)),2&e){let e;m.sc(e=m.ec())&&(t.tabNav=e.first),m.sc(e=m.ec())&&(t.container=e.first),m.sc(e=m.ec())&&(t.virtualScroll=e.first),m.sc(e=m.ec())&&(t.list=e)}},inputs:{data:"data",height:"height",selectedTab:"selectedTab",selectedRow:"selectedRow"},outputs:{selectTab:"selectTab"},features:[m.Cb],decls:1,vars:1,consts:[["class","data-table",3,"max-height",4,"ngIf"],[1,"data-table"],["dataTable",""],["class","tabs-container","fxLayout","row",4,"ngIf"],["orientation","vertical",1,"scroll-container",3,"itemSize"],["list",""],[4,"cdkVirtualFor","cdkVirtualForOf"],["fxLayout","row",1,"tabs-container"],["fxFlex","0 0 auto","class","prev-tab",3,"click",4,"ngIf"],["fxLayout","row",1,"tabs"],["tabNav",""],["fxFlex","0 0 auto",3,"selected","title","click",4,"ngFor","ngForOf"],["fxFlex","1 1 auto",1,"empty-space"],["fxFlex","0 0 auto","class","next-tab",3,"click",4,"ngIf"],["fxFlex","0 0 auto",1,"prev-tab",3,"click"],["src","assets/icons/back.svg"],["fxFlex","0 0 auto",3,"title","click"],["fxFlex","0 0 auto",1,"next-tab",3,"click"],[1,"row"],[1,"row-number"],["class","column",4,"ngFor","ngForOf"],[1,"column"],["class","text-truncate",4,"ngIf"],["class","text-truncate","matTooltipShowDelay","300",3,"matTooltip",4,"ngIf"],[1,"text-truncate"],["matTooltipShowDelay","300",1,"text-truncate",3,"matTooltip"]],template:function(e,t){1&e&&m.Fc(0,Nn,6,7,"div",0),2&e&&m.nc("ngIf",t.data)},directives:[i.n,C.d,C.a,C.c,D.d,i.m,D.b,r.b,M.a],styles:['.data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%]{height:29px;padding-left:19px;width:100%}.data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .tabs[_ngcontent-%COMP%]{min-width:0;overflow:hidden}.data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;background-color:#e5e5e5;border:none;color:inherit;cursor:pointer;font:inherit;font-size:9px;font-weight:var(--stf-font-weight-semibold);margin:0 1px 0 0;padding:0;width:auto;width:120px}.data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .tabs[_ngcontent-%COMP%] button.selected[_ngcontent-%COMP%]{background-color:#fff}.data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .empty-space[_ngcontent-%COMP%]{background-color:#e5e5e5}.data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .next-tab[_ngcontent-%COMP%], .data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .prev-tab[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;background-color:hsla(0,0%,89.8%,.3);border:none;color:inherit;cursor:pointer;font:inherit;margin:0;padding:0;width:auto;width:44px}.data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .next-tab[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .prev-tab[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:12px;width:12px}.data-table[_ngcontent-%COMP%] .tabs-container[_ngcontent-%COMP%] .next-tab[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{transform:rotate(180deg)}.data-table[_ngcontent-%COMP%] .scroll-container[_ngcontent-%COMP%]{background-color:#fff;transform:none}.data-table[_ngcontent-%COMP%] .scroll-container[_ngcontent-%COMP%]::-webkit-scrollbar{background-color:rgba(204,206,214,.15);height:12px;width:12px}.data-table[_ngcontent-%COMP%] .scroll-container[_ngcontent-%COMP%]::-webkit-scrollbar:hover{background-color:rgba(204,206,214,.15)}.data-table[_ngcontent-%COMP%] .scroll-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:12px;box-shadow:inset 0 0 0 12px #e5e5e5}.data-table[_ngcontent-%COMP%] .scroll-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:active{border-radius:12px;box-shadow:inset 0 0 0 12px rgba(134,138,160,.25)}.data-table[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:flex}.data-table[_ngcontent-%COMP%] .row.first-row[_ngcontent-%COMP%]{font-weight:var(--stf-font-weight-semibold)}.data-table[_ngcontent-%COMP%] .row-number[_ngcontent-%COMP%]{background-color:#e5e5e5;border-bottom:1px solid #fff;font-size:9px;font-weight:var(--stf-font-weight-semibold);justify-content:center;left:0;margin-right:38px;position:sticky;width:19px;z-index:10}.data-table[_ngcontent-%COMP%] .column[_ngcontent-%COMP%], .data-table[_ngcontent-%COMP%] .row-number[_ngcontent-%COMP%]{align-items:center;display:flex;flex-shrink:0}.data-table[_ngcontent-%COMP%] .column[_ngcontent-%COMP%]{border-bottom:1px solid #bfbfbf;font-size:8px;height:37px;margin-right:3px;padding:0 6px 0 8px;position:relative;width:80px;z-index:1}.data-table[_ngcontent-%COMP%] .column[_ngcontent-%COMP%]:last-child{margin-right:0}.data-table[_ngcontent-%COMP%] .row.selected[_ngcontent-%COMP%] .column[_ngcontent-%COMP%]{margin-right:0;width:83px}.data-table[_ngcontent-%COMP%] .row.selected[_ngcontent-%COMP%] .column[_ngcontent-%COMP%]:after{background-color:rgb(var(--stf-primary-rgb),.08);bottom:3px;content:"";left:0;position:absolute;right:0;top:3px;z-index:-1}'],changeDetection:0}),e})();const Jn=["preview"];function Zn(e,t){if(1&e&&(m.Vb(0,"div"),m.Vb(1,"h5"),m.Hc(2),m.Ub(),m.Vb(3,"div"),m.Hc(4),m.Ub(),m.Ub()),2&e){const e=t.$implicit;m.Eb(2),m.Ic(e.key),m.Eb(2),m.Jc(" ",e.value.text," ")}}function Gn(e,t){if(1&e&&(m.Vb(0,"div",21),m.Fc(1,Zn,5,2,"div",22),m.ic(2,"keyvalue"),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("ngForOf",m.jc(2,1,null==e.resource.extracted_text||null==e.resource.extracted_text.ftf?null:e.resource.extracted_text.ftf.file.files))}}function Kn(e,t){if(1&e){const e=m.Wb();m.Vb(0,"stf-resource-metadata",23),m.dc("hideMetadata",function(){return m.xc(e),m.hc(2).hideMetadata()}),m.Ub()}if(2&e){const e=m.hc(2);m.nc("resource",e.resource)("viewType",e.viewType)}}function Yn(e,t){if(1&e&&m.Qb(0,"stf-resource-controls-pdf",24),2&e){const e=m.hc(2);m.nc("resource",e.resource)}}function Xn(e,t){if(1&e&&(m.Qb(0,"stf-resource-media",25),m.ic(1,"async"),m.ic(2,"async")),2&e){const e=m.hc(2);m.nc("resource",e.resource)("viewType",e.viewType)("resultsLength",m.jc(1,4,e.resultsLength$))("selectedIndex",m.jc(2,6,e.selectedIndex$))}}function ei(e,t){if(1&e&&(m.Vb(0,"div",26),m.Qb(1,"stf-pdf-viewer-component",27),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("resource",e.resource)("preview","pdf-preview"===e.viewType)("setpage",e.query$)("load",!e.showMetadata)("maxHeight",.7)}}function ti(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",26),m.Vb(1,"stf-pdf-single-page",28),m.dc("zoomChange",function(t){return m.xc(e),m.hc(2).resourceView.setPdfZoom(t)}),m.ic(2,"async"),m.ic(3,"async"),m.Ub(),m.Vb(4,"stf-resource-nav",29),m.dc("next",function(){return m.xc(e),m.hc(2).resourceView.nextText()})("prev",function(){return m.xc(e),m.hc(2).resourceView.prevText()}),m.ic(5,"async"),m.ic(6,"async"),m.Ub(),m.Ub()}if(2&e){const e=m.hc(2);let t=null;m.Eb(1),m.nc("load",!e.showMetadata)("url",null==(t=m.jc(2,11,e.pdfPage$))?null:t.url)("height",e.contentHeight)("searchtext",e.selectedText?e.selectedText.text:"")("zoom",m.jc(3,13,e.resourceView.getPdfZoom()))("fullScreen",e.resourceView.fullScreen),m.Eb(3),m.nc("resource",e.resource)("viewType",e.viewType)("total",m.jc(5,15,e.resultsLength$))("current",m.jc(6,17,e.selectedIndex$))("showNav",e.selectedText&&e.selectedText.fromSearch)}}function ni(e,t){if(1&e){const e=m.Wb();m.Tb(0),m.Vb(1,"stf-data-table",32),m.dc("selectTab",function(t){return m.xc(e),m.hc(3).resourceView.selectRow(t)}),m.Ub(),m.Vb(2,"stf-resource-nav",29),m.dc("next",function(){return m.xc(e),m.hc(3).resourceView.nextRow()})("prev",function(){return m.xc(e),m.hc(3).resourceView.prevRow()}),m.ic(3,"async"),m.ic(4,"async"),m.Ub(),m.Sb()}if(2&e){const e=t.ngIf,n=m.hc(3);m.Eb(1),m.nc("data",n.resource.getSpreadsheetTabs())("height",n.contentHeight)("selectedTab",e.tabIndex)("selectedRow",e.rowIndex),m.Eb(1),m.nc("resource",n.resource)("viewType",n.viewType)("total",m.jc(3,9,n.resultsLength$))("current",m.jc(4,11,n.selectedIndex$))("showNav",e.fromSearch)}}function ii(e,t){if(1&e&&(m.Vb(0,"div",30),m.Fc(1,ni,5,13,"ng-container",31),m.ic(2,"async"),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("ngIf",m.jc(2,1,e.selectedRow$))}}function ci(e,t){if(1&e&&(m.Vb(0,"div",33),m.Vb(1,"stf-richtext",34),m.Hc(2,"resource.text"),m.Ub(),m.Ub()),2&e){const e=m.hc(2);m.Eb(1),m.nc("show_editable",!1)("value",null==e.resource||null==e.resource.html?null:e.resource.html.html)}}function ri(e,t){if(1&e){const e=m.Wb();m.Vb(0,"div",1),m.Vb(1,"div",2),m.Vb(2,"div",3),m.Fc(3,Gn,3,3,"div",4),m.Qb(4,"stf-resource-text",5),m.ic(5,"async"),m.Ub(),m.Ub(),m.Vb(6,"div",6),m.Fc(7,Kn,1,2,"stf-resource-metadata",7),m.Vb(8,"div",8),m.Vb(9,"div",9,10),m.Vb(11,"div",11),m.Vb(12,"button",12),m.dc("click",function(){return m.xc(e),m.hc().closePreview()}),m.Qb(13,"svg-icon",13),m.Vb(14,"span",14),m.Hc(15),m.ic(16,"translate"),m.Ub(),m.Vb(17,"span",15),m.Hc(18),m.ic(19,"translate"),m.Ub(),m.Ub(),m.Fc(20,Yn,1,1,"stf-resource-controls-pdf",16),m.Ub(),m.Fc(21,Xn,3,8,"stf-resource-media",17),m.Fc(22,ei,2,5,"div",18),m.Fc(23,ti,7,19,"div",18),m.Fc(24,ii,3,3,"div",19),m.Fc(25,ci,3,2,"div",20),m.Ub(),m.Ub(),m.Ub(),m.Ub()}if(2&e){const e=m.hc();m.Eb(3),m.nc("ngIf","zip"===e.viewType),m.Eb(1),m.nc("resource",e.resource)("isPdf",e.resourceView.isPdf())("isMedia",e.isMedia())("selectedIndex",m.jc(5,17,e.selectedIndex$)),m.Eb(3),m.nc("ngIf",e.showMetadata),m.Eb(1),m.nc("fxHide",e.showMetadata),m.Eb(6),m.nc("fxHide.lt-lg",!0),m.Eb(1),m.Ic(m.jc(16,19,"resource.close_preview")),m.Eb(2),m.nc("fxHide.gt-md",!0),m.Eb(1),m.Ic(m.jc(19,21,"generic.close")),m.Eb(2),m.nc("ngIf",e.resourceView.isPdf()&&e.resourceView.isSinglePagePdf()),m.Eb(1),m.nc("ngIf",e.isMedia()),m.Eb(1),m.nc("ngIf",e.resourceView.isPdf()&&!e.resourceView.isSinglePagePdf()),m.Eb(1),m.nc("ngIf",e.resourceView.isPdf()&&e.resourceView.isSinglePagePdf()),m.Eb(1),m.nc("ngIf","spreadsheet"===e.viewType&&!e.showMetadata),m.Eb(1),m.nc("ngIf","page"===e.viewType)}}let oi=(()=>{class e{constructor(e,t,n,i,c){this.sanitizer=e,this.resourceView=t,this.resourceViewConfig=n,this.ruler=i,this.cd=c,this.showMetadata=!0,this.selectedText=null,this.unsubscribeAll=new E.a,this.selectedText$=this.resourceView.getSelectedText(),this.selectedIndex$=this.resourceView.getSearchIndex(),this.pdfPage$=this.resourceView.pdfPage,this.selectTranscript$=this.resourceView.getSelectedTranscript(),this.selectedRow$=this.resourceView.getSelectedRow(),this.resultsLength$=this.resourceView.getSearchResults().pipe(Object(S.a)(e=>null!==e&&e.length>0?e.length:0)),this.query$=this.selectedText$.pipe(Object(S.a)(e=>({query:e?e.text:""}))),this.selectedText$.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(e=>{this.selectedText=e,this.cd.markForCheck(),null!==e&&this.hideMetadata()}),this.selectTranscript$.pipe(Object(R.a)(this.selectedRow$),Object(H.a)(this.unsubscribeAll)).subscribe(e=>{null!==e&&this.hideMetadata()}),this.resourceView.getTermReset().pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{0==this.showMetadata&&this.closePreview()})}ngOnInit(){this.viewType=this.resourceView.viewType,"link-embed"===this.viewType&&(this.embedUrl=this.sanitizer.bypassSecurityTrustResourceUrl(this.resource.isMainLinkEmbed())),this.cd.markForCheck()}ngAfterViewInit(){if(this.resourceView.isPdf()||this.resourceView.isSpreadsheet()){this.contentHeight=this.getContentHeight(),this.cd.markForCheck();const e=this.ruler.change(100);Object(T.a)(this.pdfPage$,this.selectedRow$,e).pipe(Object(H.a)(this.unsubscribeAll)).subscribe(()=>{setTimeout(()=>{this.contentHeight=this.getContentHeight(),this.cd.markForCheck()},100)})}}isMedia(){return"link-youtube"===this.viewType||"media"===this.viewType}getContentMaxHeight(){return this.resourceViewConfig.getAvailableViewportHeight()-184}getContentHeight(){const e=this.getContentMaxHeight();if(this.preview){const t=this.preview.nativeElement.clientWidth;return t<e?t:e}return 0}closePreview(){this.showMetadata=!0,this.resourceView.clearSelected(),this.resourceView.pauseMedia(),this.cd.markForCheck()}hideMetadata(){this.showMetadata=!1,this.cd.markForCheck()}ngOnDestroy(){this.unsubscribeAll&&(this.unsubscribeAll.next(),this.unsubscribeAll.complete())}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(de.b),m.Pb(W),m.Pb(B),m.Pb(C.g),m.Pb(m.h))},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-content"]],viewQuery:function(e,t){if(1&e&&m.Lc(Jn,1),2&e){let e;m.sc(e=m.ec())&&(t.preview=e.first)}},inputs:{resource:"resource"},decls:1,vars:1,consts:[["class","resource-content","fxLayout","row",4,"ngIf"],["fxLayout","row",1,"resource-content"],["fxFlex","1 1 50%",1,"resource-content-left"],[1,"resource-text"],["class","resource-zip-text",4,"ngIf"],[3,"resource","isPdf","isMedia","selectedIndex"],["fxFlex","1 1 50%",1,"resource-content-right"],[3,"resource","viewType","hideMetadata",4,"ngIf"],[1,"resource-content-preview",3,"fxHide"],[1,"resource-content-preview-container"],["preview",""],["fxLayout","row","fxLayoutAlign","space-between start",1,"resource-content-preview-header"],["fxLayout","row","fxLayoutGap","7px","fxLayoutAlign","start center",1,"close-preview",3,"click"],["src","assets/icons/cross.svg"],[3,"fxHide.lt-lg"],[3,"fxHide.gt-md"],[3,"resource",4,"ngIf"],[3,"resource","viewType","resultsLength","selectedIndex",4,"ngIf"],["class","resource-content-pdf",4,"ngIf"],["class","resource-content-spreadsheet",4,"ngIf"],["class","resource-content-html",4,"ngIf"],[1,"resource-zip-text"],[4,"ngFor","ngForOf"],[3,"resource","viewType","hideMetadata"],[3,"resource"],[3,"resource","viewType","resultsLength","selectedIndex"],[1,"resource-content-pdf"],[1,"w-100-p",3,"resource","preview","setpage","load","maxHeight"],[1,"w-100-p",3,"load","url","height","searchtext","zoom","fullScreen","zoomChange"],[3,"resource","viewType","total","current","showNav","next","prev"],[1,"resource-content-spreadsheet"],[4,"ngIf"],[3,"data","height","selectedTab","selectedRow","selectTab"],[1,"resource-content-html"],[3,"show_editable","value"]],template:function(e,t){1&e&&m.Fc(0,ri,26,23,"div",0),2&e&&m.nc("ngIf",t.resource)},directives:[i.n,D.d,D.b,vt,he.b,D.c,D.e,r.b,i.m,$t,Dt,yn,In,Un,Gt,qn],pipes:[i.b,s.c,i.g],styles:[".resource-content-left[_ngcontent-%COMP%]{background-color:#fff}.resource-content-right[_ngcontent-%COMP%]{background-color:#fbfbfb}.resource-content-preview[_ngcontent-%COMP%]{padding:48px;position:sticky;top:var(--stf-resource-preview-top,0)}.resource-content-preview-header[_ngcontent-%COMP%]{margin-bottom:12px}.resource-content-html[_ngcontent-%COMP%]{background-color:#fff;max-height:50vh;overflow-y:auto;padding:30px}.close-preview[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;border:none;color:inherit;cursor:pointer;font:inherit;font-weight:var(--stf-font-weight-bold);margin:0;padding:0;width:auto}.close-preview[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block;height:19px;width:19px}.resource-text[_ngcontent-%COMP%]{padding:34px 44px 44px}.resource-zip-text[_ngcontent-%COMP%]{margin-bottom:30px}"],changeDetection:0}),e})();function si(e,t){if(1&e&&(m.Tb(0),m.Vb(1,"div",1),m.Qb(2,"stf-resource-header",2),m.Qb(3,"stf-resource-content",2),m.Ub(),m.Sb()),2&e){const e=m.hc();m.Eb(2),m.nc("resource",e.resource),m.Eb(1),m.nc("resource",e.resource)}}let ai=(()=>{class e{constructor(){}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=m.Jb({type:e,selectors:[["stf-resource-view"]],inputs:{resource:"resource"},decls:1,vars:1,consts:[[4,"ngIf"],[1,"resource-view"],[3,"resource"]],template:function(e,t){1&e&&m.Fc(0,si,4,2,"ng-container",0),2&e&&m.nc("ngIf",t.resource)},directives:[i.n,ue,oi],encapsulation:2}),e})();var li=n("aTZX");let ui=(()=>{class e{getOptions(){return{imageZoomEnabled:!1,contextMenuEnabled:!1}}onZoomImage(){}getAvailableViewportHeight(){const e=Math.max(Math.min(Math.round(.147*window.innerHeight),130),89);return window.innerHeight-e}isPublicResource(){return!0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=m.Lb({token:e,factory:e.\u0275fac}),e})();function di(e,t){1&e&&(m.Vb(0,"span"),m.Hc(1),m.ic(2,"translate"),m.Ub()),2&e&&(m.Eb(1),m.Ic(m.jc(2,1,"resource.back_to_results")))}function hi(e,t){1&e&&(m.Vb(0,"span"),m.Hc(1),m.ic(2,"translate"),m.Ub()),2&e&&(m.Eb(1),m.Ic(m.jc(2,1,"generic.back")))}function gi(e,t){if(1&e&&m.Qb(0,"stf-resource-view",11),2&e){const e=m.hc();m.nc("resource",e.resource)}}let bi=(()=>{class e{constructor(e,t,n){this.appService=e,this.route=t,this.resourceView=n,this.unsubscribeAll=new E.a,this.route.data.pipe(Object(H.a)(this.unsubscribeAll)).subscribe(e=>{e.resource&&(this.resourceView.setResource(e.resource),this.resource=e.resource)})}ngOnInit(){}goBack(){this.appService.goBackFromResource()}close(){this.appService.closeModal()}comeFromSearch(){var e;return"search-grid"===(null===(e=this.appService.prevPage)||void 0===e?void 0:e.pageType)}ngOnDestroy(){this.unsubscribeAll&&(this.unsubscribeAll.next(),this.unsubscribeAll.complete())}}return e.\u0275fac=function(t){return new(t||e)(m.Pb(li.a),m.Pb(c.a),m.Pb(W))},e.\u0275cmp=m.Jb({type:e,selectors:[["flaps-widget-resource"]],features:[m.Db([W,{provide:B,useClass:ui}])],decls:12,vars:3,consts:[["fxLayout","column",1,"resource-container"],["fxFlex","0 0 auto","fxLayout","row","fxLayoutAlign","space-between end",1,"resource-container-header"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","15px",1,"resource-container-back"],["mat-icon-button","",1,"resource-container-back-icon",3,"click"],["src","assets/icons/back-white.svg"],[1,"resource-container-back-text",3,"click"],[4,"ngIf"],["mat-icon-button","",1,"resource-container-close",3,"click"],["src","assets/icons/close-white.svg"],["fxFlex","1 1 auto",1,"resource-container-content"],[3,"resource",4,"ngIf"],[3,"resource"]],template:function(e,t){1&e&&(m.Vb(0,"div",0),m.Vb(1,"div",1),m.Vb(2,"div",2),m.Vb(3,"button",3),m.dc("click",function(){return t.goBack()}),m.Qb(4,"svg-icon",4),m.Ub(),m.Vb(5,"button",5),m.dc("click",function(){return t.goBack()}),m.Fc(6,di,3,3,"span",6),m.Fc(7,hi,3,3,"span",6),m.Ub(),m.Ub(),m.Vb(8,"button",7),m.dc("click",function(){return t.close()}),m.Qb(9,"svg-icon",8),m.Ub(),m.Ub(),m.Vb(10,"div",9),m.Fc(11,gi,1,1,"stf-resource-view",10),m.Ub(),m.Ub()),2&e&&(m.Eb(6),m.nc("ngIf",t.comeFromSearch()),m.Eb(1),m.nc("ngIf",!t.comeFromSearch()),m.Eb(4),m.nc("ngIf",t.resource))},directives:[D.d,D.b,D.c,D.e,r.b,i.n,ai],pipes:[s.c],styles:[".resource-container[_ngcontent-%COMP%]{height:100%;overflow-y:auto;padding:0 10%}.resource-container-header[_ngcontent-%COMP%]{height:14.6%;max-height:130px;min-height:89px;padding-bottom:32px}.resource-container-back-icon[_ngcontent-%COMP%], .resource-container-back-text[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;border:none;color:inherit;color:#fff;cursor:pointer;font:inherit;margin:0;padding:0;width:auto}.resource-container-back-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block}.resource-container-back-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:currentColor}.resource-container-back-text[_ngcontent-%COMP%]{font-weight:var(--stf-font-weight-semibold)}.resource-container-close[_ngcontent-%COMP%]{-webkit-appearance:none;background:transparent;border:none;color:inherit;cursor:pointer;font:inherit;margin:0;padding:0;width:auto}.resource-container-close[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block}.resource-container-content[_ngcontent-%COMP%]{overflow-y:auto}"]}),e})();var pi=n("JIr8");const fi=[{path:":resource",component:bi,resolve:{resource:(()=>{class e{constructor(e,t){this.resourceService=e,this.stateService=t}resolve(e,t){const n=this.stateService.getStateData();return this.resourceService.getResource(null==n?void 0:n.db,null==n?void 0:n.account,null==n?void 0:n.stash,e.params.resource,!0).pipe(Object(pi.a)(()=>Object(F.a)(null)))}}return e.\u0275fac=function(t){return new(t||e)(m.Zb($.f),m.Zb($.j))},e.\u0275prov=m.Lb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()}}];let mi=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=m.Nb({type:e}),e.\u0275inj=m.Mb({imports:[[i.c,r.a,o.a,s.b.forChild(),V,c.f.forChild(fi)],c.f,V]}),e})()}}]);