1import"./chunk-VJBA5QGQ.js";import{a as Y,b as ee}from"./chunk-Q7VJMXX4.js";import"./chunk-G7G4S2F4.js";import"./chunk-T4G723NK.js";import{e as Z,f as G,h as K,n as X}from"./chunk-3NM6VLWR.js";import"./chunk-MCAZH2AM.js";import{Ab as v,Ca as I,Nb as z,Ob as Q,Sc as V,Tb as h,Ub as u,Vb as c,Wb as w,ac as A,ca as E,fb as p,ga as k,hc as g,hd as H,lc as j,mc as $,nc as U,ob as W,rc as O,ua as r,ub as L,vb as B,vc as N,wc as C,ya as q,yc as J}from"./chunk-YEWIMTMH.js";import{a as M,b as F,d as m}from"./chunk-4CLCTAJ7.js";var re=["iframe"];function ne(s,i){if(s&1&&A(0,9),s&2){let e=g(2);h("ngTemplateOutlet",e.customSpinnerTpl)}}function ae(s,i){s&1&&(u(0,"div",10),w(1,"div",11),u(2,"div",12),C(3," Loading PDF... "),c()())}function de(s,i){if(s&1&&(u(0,"div",7),v(1,ne,1,1,"ng-container",8)(2,ae,4,0,"ng-template",null,1,V),c()),s&2){let e=O(3),t=g();h("ngClass",t.spinnerClass),p(),h("ngIf",t.customSpinnerTpl)("ngIfElse",e)}}function le(s,i){if(s&1&&A(0,15),s&2){let e=g(2);h("ngTemplateOutlet",e.customErrorTpl)("ngTemplateOutletContext",e.getErrorTemplateData())}}function he(s,i){if(s&1&&(u(0,"div",16)(1,"div",17),C(2," \u26A0\uFE0F "),c(),u(3,"div",18),C(4," Error Loading PDF "),c(),u(5,"div",19),C(6),c()()),s&2){let e=g(2);p(6),J(" ",e.currentErrorMessage," ")}}function ue(s,i){if(s&1&&(u(0,"div",13),v(1,le,1,2,"ng-container",14)(2,he,7,1,"ng-template",null,2,V),c()),s&2){let e=O(3),t=g();h("ngClass",t.errorClass),p(),h("ngIf",t.customErrorTpl)("ngIfElse",e)}}var _=class{actionQueue=[];executedActions=new Map;isDocumentLoaded=!1;isPostMessageReady=!1;postMessageReadiness=0;diagnosticLogs=!1;postMessageExecutor;constructor(i=!1){this.diagnosticLogs=i}setDiagnosticLogs(i){this.diagnosticLogs=i}setPostMessageReady(i,e=0){this.isPostMessageReady=i,this.postMessageReadiness=e,i&&this.processQueuedActions()}updateReadiness(i){this.postMessageReadiness!==i&&(this.postMessageReadiness=i)}queueAction(i,e){this.actionQueue.push({action:i,readinessLevel:e})}queueImmediateAction(i){this.queueAction(i,3)}queueViewerReadyAction(i){this.queueAction(i,4)}queueDocumentLoadedAction(i){this.queueAction(i,5)}queueOnDemandAction(i){return this.executeAction(i)}onDocumentLoaded(){this.isDocumentLoaded=!0,this.processQueuedActions()}processQueuedActions(){let i=this.actionQueue.filter(e=>this.postMessageReadiness>=e.readinessLevel&&(e.readinessLevel<5||this.isDocumentLoaded));this.actionQueue=this.actionQueue.filter(e=>!(this.postMessageReadiness>=e.readinessLevel&&(e.readinessLevel<5||this.isDocumentLoaded))),i.forEach(e=>{this.executeAction(e.action)})}executeAction(i){return m(this,null,function*(){let e={actionId:i.id,success:!1,timestamp:Date.now()};try{if(i.condition&&!i.condition(null))return e.error="Condition not met",this.executedActions.set(i.id,e),e;let t=yield this.executeActionViaPostMessage(i);e.success=t,i.resolver&&i.resolver(e)}catch(t){e.error=t instanceof Error?t.message:String(t),this.diagnosticLogs&&console.error(`\u{1F50D} ActionQueueManager: Error executing action ${i.action}:`,t),i.resolver&&i.resolver(e)}return this.executedActions.set(i.id,e),e})}executeActionViaPostMessage(i){return m(this,null,function*(){if(!this.postMessageExecutor)throw new Error("PostMessage executor not set");return yield this.postMessageExecutor(i.action,i.payload),!0})}setPostMessageExecutor(i){this.postMessageExecutor=i}getActionStatus(i){let e=this.executedActions.get(i);return e?e.success?"completed":"failed":this.actionQueue.some(o=>o.action.id===i)?"pending":"not-found"}clearQueues(){this.actionQueue=[],this.executedActions.clear()}getQueueStatus(){return{queuedActions:this.actionQueue.length,executedActions:this.executedActions.size}}},d=(()=>{class s{static transformZoom={toViewer:e=>e?{auto:"auto","page-fit":"page-fit","page-width":"page-width","page-actual":"page-actual"}[e.toLowerCase()]||e:"auto",fromViewer:e=>typeof e=="string"?e:typeof e=="number"?e.toString():"auto"};static transformRotation={toViewer:e=>(e%360+360)%360,fromViewer:e=>typeof e=="number"?e:0};static transformCursor={toViewer:e=>e&&{select:"select",hand:"hand",zoom:"zoom"}[e.toLowerCase()]||"select",fromViewer:e=>typeof e=="string"?e:"select"};static transformScroll={toViewer:e=>e&&{vertical:"vertical",horizontal:"horizontal",wrapped:"wrapped",page:"page"}[e.toLowerCase()]||"vertical",fromViewer:e=>{let t=["vertical","horizontal","wrapped","page"];return typeof e=="number"?t[e]||"vertical":typeof e=="string"?e:"vertical"}};static transformSpread={toViewer:e=>e&&{none:"none",odd:"odd",even:"even"}[e.toLowerCase()]||"none",fromViewer:e=>{let t=["none","odd","even"];return typeof e=="number"?t[e]||"none":typeof e=="string"?e:"none"}};static transformPageMode={toViewer:e=>e&&{none:"none",thumbs:"thumbs",bookmarks:"bookmarks",attachments:"attachments"}[e.toLowerCase()]||"none",fromViewer:e=>typeof e=="string"?e:"none"}}return s})(),b=class{static getActionForProperty(i){let e={showOpenFile:"show-openfile",showDownload:"show-download",showPrint:"show-print",showFullScreen:"show-fullscreen",showFind:"show-find",showViewBookmark:"show-bookmark",showAnnotations:"show-annotations",cursor:"set-cursor",scroll:"set-scroll",spread:"set-spread",zoom:"set-zoom",pageMode:"update-page-mode",page:"set-page",rotation:"set-rotation",namedDest:"go-to-named-dest",downloadOnLoad:"trigger-download",printOnLoad:"trigger-print",showLastPageOnLoad:"go-to-last-page",rotateCW:"trigger-rotate-cw",rotateCCW:"trigger-rotate-ccw",errorMessage:"set-error-message",errorOverride:"set-error-override",errorAppend:"set-error-append",locale:"set-locale",useOnlyCssZoom:"set-css-zoom",downloadFileName:"set-download-filename",theme:"set-theme",primaryColor:"set-primary-color",backgroundColor:"set-background-color",pageBorderColor:"set-page-border-color",pageSpacing:"set-page-spacing",toolbarColor:"set-toolbar-color",textColor:"set-text-color",borderRadius:"set-border-radius",customCSS:"set-custom-css",diagnosticLogs:"set-diagnostic-logs"},t={showToolbarLeft:"show-toolbar-left",showToolbarMiddle:"show-toolbar-middle",showToolbarRight:"show-toolbar-right",showSecondaryToolbarToggle:"show-secondary-toolbar-toggle",showSidebar:"show-sidebar",showSidebarLeft:"show-sidebar-left",showSidebarRight:"show-sidebar-right"},o={toolbarDensity:"set-toolbar-density",sidebarWidth:"set-sidebar-width",toolbarPosition:"set-toolbar-position",sidebarPosition:"set-sidebar-position",responsiveBreakpoint:"set-responsive-breakpoint"};return e[i]||t[i]||o[i]||null}
1static cleanupEventHandlers(i){if(i._webviewerLoadedHandler&&document.removeEventListener("webviewerloaded",i._webviewerLoadedHandler),i._pdfEventHandlers){let e=i._pdfEventHandlers,t=i.PDFViewerApplication?.eventBus;t&&Object.keys(e).forEach(o=>{t.off(o,e[o])})}}},T=class{userInitiatedChanges=new Set;programmaticChanges=new Set;markUserInitiated(i){this.userInitiatedChanges.add(i),setTimeout(()=>this.userInitiatedChanges.delete(i),0)}markProgrammatic(i){this.programmaticChanges.add(i),setTimeout(()=>this.programmaticChanges.delete(i),0)}isUserInitiated(i){return this.userInitiatedChanges.has(i)}isProgrammatic(i){return this.programmaticChanges.has(i)}},te=(()=>{class s{iframe;static lastID=0;viewerId=`ng2-pdfjs-viewer-ID${++s.lastID}`;onBeforePrint=new r;onAfterPrint=new r;onDocumentLoad=new r;onPageChange=new r;onScaleChange=new r;onRotationChange=new r;onDocumentError=new r;onDocumentInit=new r;onPagesInit=new r;onPresentationModeChanged=new r;onOpenFile=new r;onFind=new r;onUpdateFindMatchesCount=new r;onMetadataLoaded=new r;onOutlineLoaded=new r;onPageRendered=new r;onAnnotationLayerRendered=new r;onBookmarkClick=new r;onIdle=new r;viewerFolder;externalWindow=!1;target="_blank";showSpinner=!0;downloadFileName;locale;useOnlyCssZoom=!1;set diagnosticLogs(e){this._diagnosticLogs=e,this.actionQueueManager.setDiagnosticLogs(e),this.dispatchAction("set-diagnostic-logs",e,"property-change")}get diagnosticLogs(){return this._diagnosticLogs}_diagnosticLogs=!1;showOpenFile=!0;showAnnotations=!1;showDownload=!0;showViewBookmark=!0;showPrint=!0;showFullScreen=!0;showFind=!0;downloadOnLoad=!1;printOnLoad=!1;rotateCW=!1;rotateCCW=!1;showLastPageOnLoad=!1;namedDest;errorOverride=!1;errorAppend=!0;errorMessage;urlValidation=!0;customSecurityTpl;securityWarning=null;theme="auto";primaryColor;backgroundColor;pageBorderColor;pageSpacing;toolbarColor;textColor;borderRadius;customCSS;cspNonce;iframeTitle;customSpinnerTpl;spinnerClass;customErrorTpl;errorClass;showToolbarLeft=!0;showToolbarMiddle=!0;showToolbarRight=!0;showSecondaryToolbarToggle=!0;showSidebar=!0;showSidebarLeft=!0;showSidebarRight=!0;toolbarDensity="default";sidebarWidth;toolbarPosition="top";sidebarPosition="left";responsiveBreakpoint;isLoading=!0;hasFirstRender=!1;hasError=!1;currentErrorMessage="";errorTemplateData={};getErrorTemplateData(){return M({errorMessage:this.currentErrorMessage,errorClass:this.errorClass},this.errorTemplateData)}getIframeClasses(){let e=["ng2-pdfjs-viewer-iframe"];return this.iframeBorder&&this.iframeBorder!=="0"&&this.iframeBorder!==0&&e.push("has-border"),e.join(" ")}reloadViewer(){this.refresh()}goBack(){window.history.length>1?window.history.back():window.close()}closeViewer(){window.close()}set controlVisibility(e){e.download!==void 0&&(this.showDownload=e.download),e.print!==void 0&&(this.showPrint=e.print),e.find!==void 0&&(this.showFind=e.find),e.fullScreen!==void 0&&(this.showFullScreen=e.fullScreen),e.openFile!==void 0&&(this.showOpenFile=e.openFile),e.viewBookmark!==void 0&&(this.showViewBookmark=e.viewBookmark),e.annotations!==void 0&&(this.showAnnotations=e.annotations)}set autoActions(e){e.downloadOnLoad!==void 0&&(this.downloadOnLoad=e.downloadOnLoad),e.printOnLoad!==void 0&&(this.printOnLoad=e.printOnLoad),e.showLastPageOnLoad!==void 0&&(this.showLastPageOnLoad=e.showLastPageOnLoad),e.rotateCW!==void 0&&(this.rotateCW=e.rotateCW),e.rotateCCW!==void 0&&(this.rotateCCW=e.rotateCCW)}set errorHandling(e){e.override!==void 0&&(this.errorOverride=e.override),e.append!==void 0&&(this.errorAppend=e.append),e.message!==void 0&&(this.errorMessage=e.message)}set viewerConfig(e){e.showSpinner!==void 0&&(this.showSpinner=e.showSpinner),e.useOnlyCssZoom!==void 0&&(this.useOnlyCssZoom=e.useOnlyCssZoom),e.diagnosticLogs!==void 0&&(this.diagnosticLogs=e.diagnosticLogs),e.locale!==void 0&&(this.locale=e.locale)}set themeConfig(e){e.theme!==void 0&&(this.theme=e.theme),e.primaryColor!==void 0&&(this.primaryColor=e.primaryColor),e.backgroundColor!==void 0&&(this.backgroundColor=e.backgroundColor),e.pageBorderColor!==void 0&&(this.pageBorderColor=e.pageBorderColor),e.pageSpacing!==void 0&&(this.pageSpacing=e.pageSpacing),e.toolbarColor!==void 0&&(this.toolbarColor=e.toolbarColor),e.textColor!==void 0&&(this.textColor=e.textColor),e.borderRadius!==void 0&&(this.borderRadius=e.borderRadius),e.customCSS!==void 0&&(this.customCSS=e.customCSS),e.cspNonce!==void 0&&(this.cspNonce=e.cspNonce)}set groupVisibility(e){e.toolbarLeft!==void 0&&(this.showToolbarLeft=e.toolbarLeft),e.toolbarMiddle!==void 0&&(this.showToolbarMiddle=e.toolbarMiddle),e.toolbarRight!==void 0&&(this.showToolbarRight=e.toolbarRight),e.secondaryToolbarToggle!==void 0&&(this.showSecondaryToolbarToggle=e.secondaryToolbarToggle),e.sidebar!==void 0&&(this.showSidebar=e.sidebar),e.sidebarLeft!==void 0&&(this.showSidebarLeft=e.sidebarLeft),e.sidebarRight!==void 0&&(this.showSidebarRight=e.sidebarRight)}set layoutConfig(e){e.toolbarDensity!==void 0&&(this.toolbarDensity=e.toolbarDensity),e.sidebarWidth!==void 0&&(this.sidebarWidth=e.sidebarWidth),e.toolbarPosition!==void 0&&(this.toolbarPosition=e.toolbarPosition),e.sidebarPosition!==void 0&&(this.sidebarPosition=e.sidebarPosition),e.responsiveBreakpoint!==void 0&&(this.responsiveBreakpoint=e.responsiveBreakpoint)}setDeprecatedProperty(e,t,o){this.diagnosticLogs&&console.warn(`\u26A0\uFE0F DEPRECATED: Property "${e}" is deprecated. Use "${t}" instead.`),this[t]=o}set startDownload(e){this.setDeprecatedProperty("startDownload","downloadOnLoad",e)}set startPrint(e){this.setDeprecatedProperty("startPrint","printOnLoad",e)}set openFile(e){this.setDeprecatedProperty("openFile","showOpenFile",e)}set download(e){this.setDeprecatedProperty("download","showDownload",e)}set print(e){this.setDeprecatedProperty("print","showPrint",e)}set fullScreen(e){this.setDeprecatedProperty("fullScreen","showFullScreen",e)}set find(e){this.setDeprecatedProperty("find","showFind",e)}
1set viewBookmark(e){this.setDeprecatedProperty("viewBookmark","showViewBookmark",e)}set lastPage(e){this.setDeprecatedProperty("lastPage","showLastPageOnLoad",e)}externalWindowOptions;viewerTab;iframeBorder="0";_src;_page;isPostMessageReady=!1;postMessageReadiness=0;pendingInitialConfig=!0;initialConfigQueued=!1;actionQueueManager=new _(this._diagnosticLogs);changeOriginTracker=new T;cdr;constructor(e){this.cdr=e}messageIdCounter=0;pendingMessages=new Map;pendingChanges=[];relaseUrl;_zoom="auto";_rotation=0;_cursor="select";_scroll="vertical";_spread="none";_pageMode="none";zoomChange=new r;cursorChange=new r;scrollChange=new r;spreadChange=new r;pageModeChange=new r;get zoom(){return this._zoom}set zoom(e){let t=d.transformZoom.toViewer(e);this._zoom!==t&&(this.changeOriginTracker.markProgrammatic("zoom"),this._zoom=t,this.applyZoomToViewer(this._zoom),this.zoomChange.emit(this._zoom))}set rotation(e){let t=d.transformRotation.toViewer(e);this._rotation!==t&&(this._rotation=t,this.applyRotationToViewer(this._rotation))}get rotation(){return this._rotation}get cursor(){return this._cursor}set cursor(e){let t=d.transformCursor.toViewer(e);this._cursor!==t&&(this.changeOriginTracker.markProgrammatic("cursor"),this._cursor=t,this.applyCursorToViewer(this._cursor),this.cursorChange.emit(this._cursor))}get scroll(){return this._scroll}set scroll(e){let t=d.transformScroll.toViewer(e);this._scroll!==t&&(this.changeOriginTracker.markProgrammatic("scroll"),this._scroll=t,this.applyScrollToViewer(this._scroll),this.scrollChange.emit(this._scroll))}get spread(){return this._spread}set spread(e){let t=d.transformSpread.toViewer(e);this._spread!==t&&(this.changeOriginTracker.markProgrammatic("spread"),this._spread=t,this.applySpreadToViewer(this._spread),this.spreadChange.emit(this._spread))}get pageMode(){return this._pageMode}set pageMode(e){let t=d.transformPageMode.toViewer(e);this._pageMode!==t&&(this.changeOriginTracker.markProgrammatic("pageMode"),this._pageMode=t,this.applyPageModeToViewer(this._pageMode),this.pageModeChange.emit(this._pageMode))}set page(e){this._page=e,this.PDFViewerApplication&&this.PDFViewerApplication.initialized?this.PDFViewerApplication.page=this._page:this.diagnosticLogs&&console.warn("Document is not loaded yet!!!. Try to set page# after full load. Ignore this warning if you are not setting page# using '.' notation. (E.g. pdfViewer.page = 5;)")}get page(){return this.PDFViewerApplication&&this.PDFViewerApplication.initialized?this.PDFViewerApplication.page:(this.diagnosticLogs&&console.warn("Document is not loaded yet!!!. Try to retrieve page# after full load."),this._page||1)}set pdfSrc(e){this._src=e}get pdfSrc(){return this._src}get PDFViewerApplicationOptions(){let e=null;return this.externalWindow?this.viewerTab&&(e=this.viewerTab.PDFViewerApplicationOptions):this.iframe.nativeElement.contentWindow&&(e=this.iframe.nativeElement.contentWindow.PDFViewerApplicationOptions),e}get PDFViewerApplication(){let e=null;return this.externalWindow?this.viewerTab&&(e=this.viewerTab.PDFViewerApplication):this.iframe.nativeElement.contentWindow&&(e=this.iframe.nativeElement.contentWindow.PDFViewerApplication),this.diagnosticLogs&&console.debug("PdfJsViewer: Viewer ->",e),e}ngOnInit(){this.actionQueueManager.setPostMessageExecutor((e,t)=>this.sendControlMessageWithRequeue(e,t)),this.dispatchAction("set-diagnostic-logs",this._diagnosticLogs,"initial-load"),this.dispatchAction("set-url-validation",this.urlValidation,"initial-load"),this.setupMessageListener(),this.bindToPdfJsEventBus()}ngAfterViewInit(){this.externalWindow||this.loadPdf()}ngOnChanges(e){if(e.pdfSrc&&!e.pdfSrc.firstChange){this.externalWindow||(this.isLoading=!0,this.hasError=!1,this.currentErrorMessage="",this.initialConfigQueued=!1,this.isPostMessageReady=!1,this.loadPdf());return}this.PDFViewerApplication?this.isPostMessageReady&&this.PDFViewerApplication.initialized?this.applyChanges(e):this.pendingChanges.push(e):this.pendingChanges.push(e)}ngOnDestroy(){this.pendingMessages.clear(),b.cleanupEventHandlers(this),this.initialConfigQueued=!1,this.relaseUrl?.()}generateMessageId(){return`msg_${++this.messageIdCounter}_${Date.now()}`}sendControlMessage(e,t){return new Promise((o,a)=>{let n=this.generateMessageId(),P={type:"control-update",action:e,payload:t,id:n,timestamp:Date.now()};this.pendingMessages.set(n,{resolve:o,reject:a}),this.isIframeAccessible()?this.iframe.nativeElement.contentWindow.postMessage(P,"*"):(this.pendingMessages.delete(n),a(new Error("Iframe not available")))})}sendControlMessageWithRequeue(e,t){return m(this,null,function*(){try{return yield this.sendControlMessage(e,t)}catch(o){if(o instanceof Error&&o.message==="Iframe not available"){let a=this.getRequiredReadinessLevel(e),n={id:`requeue-${e}-${Date.now()}`,action:e,payload:t};throw this.actionQueueManager.queueAction(n,a),Promise.resolve().then(()=>{this.isIframeAccessible()&&this.isPostMessageReady&&this.actionQueueManager.processQueuedActions()}),o}throw o}})}isIframeAccessible(){return!!(this.iframe&&this.iframe.nativeElement&&this.iframe.nativeElement.contentWindow)}processPostMessageReadyActions(){this.actionQueueManager&&(this.actionQueueManager.updateReadiness(this.postMessageReadiness),this.actionQueueManager.processQueuedActions()),this.queueAllConfigurations(),this.initialConfigQueued=!0,this.applyPendingChanges()}handleControlResponse(e){let t=this.pendingMessages.get(e.id);t&&(this.pendingMessages.delete(e.id),e.success?t.resolve(e):t.reject(new Error(e.error||"Unknown error")))}setupMessageListener(){window.addEventListener("message",e=>
1{if(e.data&&e.data.type==="control-response"){this.handleControlResponse(e.data);return}if(e.data&&e.data.type==="ng2-pdfjs-viewer-security-warning"){this.securityWarning={message:e.data.message,originalUrl:e.data.originalUrl,currentUrl:e.data.currentUrl};return}if(e.data&&e.data.type==="postmessage-ready"){this.isPostMessageReady=!0,this.postMessageReadiness=e.data.readiness||0,this.isIframeAccessible()?this.processPostMessageReadyActions():Promise.resolve().then(()=>{this.isIframeAccessible()&&this.processPostMessageReadyActions()});return}if(e.data&&e.data.type==="state-change"){this.handleStateChangeNotification(e.data);return}if(e.data&&e.data.type==="event-notification"){this.handleEventNotification(e.data);return}})}handleStateChangeNotification(e){let{property:t,value:o,source:a}=e;if(t==="loading"){this.isLoading=!!o,o&&(this.hasError=!1,this.currentErrorMessage=""),this.cdr.markForCheck();return}if(t==="error"){this.hasError=!!o,o&&typeof o=="string"&&(this.currentErrorMessage=o,this.errorTemplateData=this.getErrorTemplateData());return}if(a==="user"&&!this.changeOriginTracker.isProgrammatic(t))switch(this.changeOriginTracker.markUserInitiated(t),t){case"cursor":this._cursor!==o&&(this._cursor=d.transformCursor.fromViewer(o),this.cursorChange.emit(this._cursor));break;case"scroll":this._scroll!==o&&(this._scroll=d.transformScroll.fromViewer(o),this.scrollChange.emit(this._scroll));break;case"spread":this._spread!==o&&(this._spread=d.transformSpread.fromViewer(o),this.spreadChange.emit(this._spread));break;case"pageMode":this._pageMode!==o&&(this._pageMode=d.transformPageMode.fromViewer(o),this.pageModeChange.emit(this._pageMode));break;case"zoom":this._zoom!==o&&(this._zoom=d.transformZoom.fromViewer(o),this.zoomChange.emit(this._zoom));break;case"rotation":this._rotation!==o&&(this._rotation=d.transformRotation.fromViewer(o));break;default:this.diagnosticLogs&&console.log(`\u{1F50D} PdfJsViewer: Unknown state change property: ${t}`)}}handleEventNotification(e){let{eventName:t,eventData:o}=e;switch(t){case"documentError":this.onDocumentError.emit(o);break;case"documentInit":this.onDocumentInit.emit();break;case"pagesInit":this.onPagesInit.emit(o);break;case"presentationModeChanged":this.onPresentationModeChanged.emit(o);break;case"openFile":this.onOpenFile.emit();break;case"find":this.onFind.emit(o);break;case"updateFindMatchesCount":this.onUpdateFindMatchesCount.emit(o);break;case"metadataLoaded":this.onMetadataLoaded.emit(o);break;case"outlineLoaded":this.onOutlineLoaded.emit(o);break;case"pageRendered":this.onPageRendered.emit(o);break;case"annotationLayerRendered":this.onAnnotationLayerRendered.emit(o);break;case"bookmarkClick":this.onBookmarkClick.emit(o);break;case"idle":this.onIdle.emit();break;default:this.diagnosticLogs&&console.log(`\u{1F50D} PdfJsViewer: Unknown event notification: ${t}`)}}mapPropertyToAction(e){return b.getActionForProperty(e)}updateViewerControl(e,t){let o=this.mapPropertyToAction(e);o&&this.dispatchAction(o,t,"property-change")}applyChanges(e){Object.keys(e).forEach(t=>{let o=e[t];if(o.currentValue!==o.previousValue){if(["downloadOnLoad","printOnLoad","showLastPageOnLoad","rotateCW","rotateCCW"].includes(t)){this.initialConfigQueued=!1,this.isPostMessageReady&&(this.queueAllConfigurations(),this.initialConfigQueued=!0);return}let n=this.mapPropertyToAction(t);n&&this.dispatchAction(n,o.currentValue,"property-change")}})}applyPendingChanges(){this.isPostMessageReady&&this.pendingChanges.length>
10&&(this.pendingChanges.forEach((e,t)=>{this.processChangesForQueuing(e)}),this.pendingChanges=[])}processChangesForQueuing(e){Object.keys(e).forEach(t=>{let o=e[t];if(o.currentValue!==o.previousValue){if(["downloadOnLoad","printOnLoad","showLastPageOnLoad","rotateCW","rotateCCW"].includes(t)){this.initialConfigQueued=!1,this.isPostMessageReady&&(this.queueAllConfigurations(),this.initialConfigQueued=!0);return}let n=this.mapPropertyToAction(t);n&&this.dispatchAction(n,o.currentValue,"property-change")}})}bindToPdfJsEventBus(){let e=()=>{if(this.diagnosticLogs&&console.debug("PdfJsViewer: webviewerloaded event received"),this.locale&&this.iframe?.nativeElement?.contentWindow)try{let t=this.iframe.nativeElement.contentWindow;t.PDFViewerApplicationOptions&&(t.PDFViewerApplicationOptions.set("localeProperties",{lang:this.locale}),this.diagnosticLogs&&console.debug(`PdfJsViewer: Locale set to ${this.locale} before initialization`))}catch(t){this.diagnosticLogs&&console.debug("PdfJsViewer: Could not set locale before initialization:",t)}if(!this.PDFViewerApplication){this.diagnosticLogs&&console.debug("PdfJsViewer: Viewer not yet (or no longer) available, events can not yet be bound.");return}this.PDFViewerApplication.initializedPromise.then(()=>{this.applyPendingChanges();let o=this.PDFViewerApplication.eventBus,a=()=>{this.diagnosticLogs&&console.debug("PdfJsViewer: The document has now been loaded!"),this.onDocumentLoad.emit(),this.queueAutoActionsForDocumentLoad(),this.actionQueueManager.onDocumentLoaded()},n=()=>{this.diagnosticLogs&&console.debug("PdfJsViewer: All pages have been fully loaded!"),this.printOnLoad===!0&&this.dispatchAction("trigger-print",!0,"initial-load")},P=()=>{this.diagnosticLogs&&console.debug("PdfJsViewer: The document is about to be printed!"),this.onBeforePrint.emit()},S=()=>{this.diagnosticLogs&&console.debug("PdfJsViewer: The document has been printed!"),this.onAfterPrint.emit()},D=l=>{this.diagnosticLogs&&console.debug("PdfJsViewer: The page has changed:",l.pageNumber),this._page!==l.pageNumber&&!this.changeOriginTracker.isProgrammatic("page")&&(this.changeOriginTracker.markUserInitiated("page"),this._page=l.pageNumber),this.onPageChange.emit(l.pageNumber)},R=l=>{let y={rotation:l.pagesRotation,page:l.pageNumber};this.diagnosticLogs&&console.debug("PdfJsViewer: The rotation has changed!",l);let f=d.transformRotation.fromViewer(l.pagesRotation);this._rotation!==f&&!this.changeOriginTracker.isProgrammatic("rotation")&&(this.changeOriginTracker.markUserInitiated("rotation"),this._rotation=f),this.onRotationChange.emit(y)},x=l=>{let y=l.scale;this.diagnosticLogs&&console.debug("PdfJsViewer: The document has scale has changed!",y);let f=d.transformZoom.fromViewer(l.scale);this._zoom!==f&&!this.changeOriginTracker.isProgrammatic("zoom")&&(this.changeOriginTracker.markUserInitiated("zoom"),this._zoom=f,this.zoomChange.emit(f)),this.onScaleChange.emit(y)};this._pdfEventHandlers={documentloaded:a,pagesloaded:n,beforeprint:P,afterprint:S,pagechanging:D,rotationchanging:R,scalechanging:x},o.on("documentloaded",a),o.on("pagesloaded",n),o.on("beforeprint",P),o.on("afterprint",S),o.on("pagechanging",D),o.on("rotationchanging",R),o.on("scalechanging",x)})};
1this._webviewerLoadedHandler=e,document.addEventListener("webviewerloaded",e)}queueAllConfigurations(){if(this.queueConfiguration("showOpenFile",this.showOpenFile,"show-openfile"),this.queueConfiguration("showDownload",this.showDownload,"show-download"),this.queueConfiguration("showPrint",this.showPrint,"show-print"),this.queueConfiguration("showFullScreen",this.showFullScreen,"show-fullscreen"),this.queueConfiguration("showFind",this.showFind,"show-find"),this.queueConfiguration("showViewBookmark",this.showViewBookmark,"show-bookmark"),this.queueConfiguration("showAnnotations",this.showAnnotations,"show-annotations"),this.queueConfiguration("showToolbarLeft",this.showToolbarLeft,"show-toolbar-left"),this.queueConfiguration("showToolbarMiddle",this.showToolbarMiddle,"show-toolbar-middle"),this.queueConfiguration("showToolbarRight",this.showToolbarRight,"show-toolbar-right"),this.queueConfiguration("showSecondaryToolbarToggle",this.showSecondaryToolbarToggle,"show-secondary-toolbar-toggle"),this.queueConfiguration("showSidebar",this.showSidebar,"show-sidebar"),this.queueConfiguration("showSidebarLeft",this.showSidebarLeft,"show-sidebar-left"),this.queueConfiguration("showSidebarRight",this.showSidebarRight,"show-sidebar-right"),this.queueConfiguration("toolbarDensity",this.toolbarDensity,"set-toolbar-density"),this.sidebarWidth&&this.queueConfiguration("sidebarWidth",this.sidebarWidth,"set-sidebar-width"),this.queueConfiguration("toolbarPosition",this.toolbarPosition,"set-toolbar-position"),this.queueConfiguration("sidebarPosition",this.sidebarPosition,"set-sidebar-position"),this.responsiveBreakpoint!==void 0&&this.queueConfiguration("responsiveBreakpoint",this.responsiveBreakpoint,"set-responsive-breakpoint"),this.cursor&&this.queueConfiguration("cursor",this.cursor,"set-cursor"),this.scroll&&this.queueConfiguration("scroll",this.scroll,"set-scroll"),this.spread&&this.queueConfiguration("spread",this.spread,"set-spread"),this._page&&this.queueConfiguration("page",this._page,"set-page"),this.zoom&&this.queueConfiguration("zoom",this.zoom,"set-zoom"),this.namedDest&&this.namedDest.trim()!==""&&this.queueConfiguration("namedDest",this.namedDest,"go-to-named-dest"),this.pageMode&&this.queueConfiguration("pageMode",this.pageMode,"update-page-mode"),this.rotateCW===!0&&this.queueConfiguration("rotateCW",this.rotateCW,"trigger-rotate-cw"),this.rotateCCW===!0&&this.queueConfiguration("rotateCCW",this.rotateCCW,"trigger-rotate-ccw"),this.errorMessage&&this.queueConfiguration("errorMessage",this.errorMessage,"set-error-message"),this.errorOverride!==void 0&&this.queueConfiguration("errorOverride",this.errorOverride,"set-error-override"),this.errorAppend!==void 0&&this.queueConfiguration("errorAppend",this.errorAppend,"set-error-append"),this.queueConfiguration("theme",this.theme||"auto","set-theme"),this.primaryColor&&this.queueConfiguration("primaryColor",this.primaryColor,"set-primary-color"),this.backgroundColor&&this.queueConfiguration("backgroundColor",this.backgroundColor,"set-background-color"),this.pageBorderColor&&this.queueConfiguration("pageBorderColor",this.pageBorderColor,"set-page-border-color"),this.pageSpacing&&this.queueConfiguration("pageSpacing",this.pageSpacing,"set-page-spacing"),this.toolbarColor&&this.queueConfiguration("toolbarColor",this.toolbarColor,"set-toolbar-color"),this.textColor&&this.queueConfiguration("textColor",this.textColor,"set-text-color"),this.borderRadius&&this.queueConfiguration("borderRadius",this.borderRadius,"set-border-radius"),this.customCSS){let e=this.cspNonce?{css:this.customCSS,nonce:this.cspNonce}:this.customCSS;this.queueConfiguration("customCSS",e,"set-custom-css")}this.useOnlyCssZoom!==void 0&&this.queueConfiguration("useOnlyCssZoom",this.useOnlyCssZoom,"set-css-zoom"),this.onBeforePrint&&this.queueConfiguration("beforePrint",!0,"enable-before-print"),this.onAfterPrint&&this.queueConfiguration("afterPrint",!0,"enable-after-print"),this.onDocumentLoad&&this.queueConfiguration("pagesLoaded",!0,"enable-pages-loaded"),this.onPageChange&&this.queueConfiguration("pageChange",!0,"enable-page-change"),this.onDocumentError&&this.queueConfiguration("documentError",!0,"enable-document-error"),this.onDocumentInit&&this.queueConfiguration("documentInit",!0,"enable-document-init"),this.onPagesInit&&this.queueConfiguration("pagesInit",!0,"enable-pages-init"),this.onPresentationModeChanged&&this.queueConfiguration("presentationModeChanged",!0,"enable-presentation-mode-changed"),this.onOpenFile&&this.queueConfiguration("openFile",!0,"enable-open-file"),this.onFind&&this.queueConfiguration("find",!0,"enable-find"),this.onUpdateFindMatchesCount&&this.queueConfiguration("updateFindMatchesCount",!0,"enable-update-find-matches-count"),this.onMetadataLoaded&&this.queueConfiguration("metadataLoaded",!0,"enable-metadata-loaded"),this.onOutlineLoaded&&this.queueConfiguration("outlineLoaded",!0,"enable-outline-loaded"),this.onPageRendered&&this.queueConfiguration("pageRendered",!0,"enable-page-rendered"),this.onAnnotationLayerRendered&&this.queueConfiguration("annotationLayerRendered",!0,"enable-annotation-layer-rendered"),this.onBookmarkClick&&this.queueConfiguration("bookmarkClick",!0,"enable-bookmark-click"),this.onIdle&&this.queueConfiguration("idle",!0,"enable-idle")}queueAutoActionsForDocumentLoad(){this.downloadOnLoad===!0&&this.dispatchAction("trigger-download",!0,"initial-load"),this.showLastPageOnLoad===!0&&this.dispatchAction("go-to-last-page",!0,"initial-load")}queueConfiguration(e,t,o){this.dispatchAction(o,t,"initial-load")}refresh(){b.cleanupEventHandlers(this),this.actionQueueManager&&this.actionQueueManager.clearQueues(),this.isPostMessageReady=!1,this.postMessageReadiness=0,this.pendingInitialConfig=!0,this.initialConfigQueued=!1,this.loadPdf()}sendViewerControlMessage(e,t){return this.sendControlMessage(e,t)}triggerDownload(){return this.dispatchAction("trigger-download",!0,"user-interaction")}triggerPrint(){return this.dispatchAction("trigger-print",!0,"user-interaction")}setPage(e){return this.dispatchAction("set-page",e,"user-interaction")}setZoom(e){return this.dispatchAction("set-zoom",e,"user-interaction")}goToLastPage(){return this.dispatchAction("go-to-last-page",!0,"user-interaction")}setCursor(e){return this.dispatchAction("set-cursor",e,"user-interaction")}setScroll(e){return this.dispatchAction("set-scroll",e,"user-interaction")}setSpread(e){return this.dispatchAction("set-spread",e,"user-interaction")}triggerRotation(e){let t=e==="cw"?"trigger-rotate-cw":"trigger-rotate-ccw";return this.dispatchAction(t,!0,"user-interaction")}goToPage(e){return this.setPage(e)}getActionStatus(e){return this.actionQueueManager?this.actionQueueManager.getActionStatus(e):"not-found"}getQueueStatus(){return this.actionQueueManager?this.actionQueueManager.getQueueStatus():{queuedActions:0,executedActions:0}}clearActionQueue(){this.actionQueueManager&&this.actionQueueManager.clearQueues()}setUrlValidation(e=!0){return this.dispatchAction("set-url-validation",e,"user-interaction")}dismissSecurityWarning(){this.securityWarning=null}loadPdf(){if(!this.validatePdfSource())return;this.isLoading=!0,this.hasError=!1,this.currentErrorMessage="",this.setupExternalWindow();let e=this.createFileUrl(),t=this.buildViewerUrl(e);this.navigateToViewer(t)}validatePdfSource(){return!!this._src}setupExternalWindow(){if(this.externalWindow&&(typeof this.viewerTab>"u"||this.viewerTab.closed)){if(this.viewerTab=window.open("",this.target,this.externalWindowOptions||""),this.viewerTab==null){this.diagnosticLogs&&console.error("ng2-pdfjs-viewer: For 'externalWindow = true'. i.e opening in new tab to work, pop-ups should be enabled.");return}this.showSpinner&&this.renderLoadingSpinner()}}
1renderLoadingSpinner(){this.viewerTab.document.write(` 2 <style> 3 .loader { 4 position: fixed; 5 left: 40%; 6 top: 40%; 7 border: 16px solid #f3f3f3; 8 border-radius: 50%; 9 border-top: 16px solid #3498db; 10 width: 120px; 11 height: 120px; 12 animation: spin 2s linear infinite; 13 } 14 @keyframes spin { 15 0% { 16 transform: rotate(0deg); 17 } 18 100% { 19 transform: rotate(360deg); 20 } 21 } 22 </style> 23 <div class="loader"></div> 24 `)}createFileUrl(){if(this.relaseUrl?.(),this._src instanceof Blob){let e=URL.createObjectURL(this._src);return this.relaseUrl=()=>URL.revokeObjectURL(e),encodeURIComponent(e)}else if(this._src instanceof Uint8Array){let e=this._src.buffer,t=new Blob([e],{type:"application/pdf"}),o=URL.createObjectURL(t);return this.relaseUrl=()=>URL.revokeObjectURL(o),encodeURIComponent(o)}else return this._src}buildViewerUrl(e){let t=this.getBaseViewerUrl();return t=this.addFileParameter(t,e),t=this.addViewerIdParameter(t),t=this.addUrlValidationParameter(t),t=this.addCacheBustingIfNeeded(t),t}getBaseViewerUrl(){return this.viewerFolder?`${this.viewerFolder}/web/viewer.html`:"assets/pdfjs/web/viewer.html"}addFileParameter(e,t){return`${e}?file=${t}`}addViewerIdParameter(e){return typeof this.viewerId<"u"?`${e}&viewerId=${this.viewerId}`:e}addUrlValidationParameter(e){let t=this.urlValidation===!1?0:1;return`${e}&urlValidation=${t}`}addCacheBustingIfNeeded(e){if(this.isDevelopmentMode()){let t=Date.now();return`${e}&_t=${t}`}else return e}isDevelopmentMode(){return window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"||window.location.port==="4200"||window.location.href.includes("localhost:4200")}navigateToViewer(e){this.externalWindow?this.viewerTab.location.href=e:this.iframe.nativeElement.contentWindow.location.replace(e),this.diagnosticLogs&&this.logViewerConfiguration(e)}logViewerConfiguration(e){console.debug(`PdfJsViewer: Minimal URL configuration: 25 pdfSrc = ${this.pdfSrc} 26 externalWindow = ${this.externalWindow} 27 viewerFolder = ${this.viewerFolder} 28 viewerId = ${this.viewerId} 29 finalUrl = ${e} 30 31 All other configurations handled via PostMessage system: 32 showOpenFile = ${this.showOpenFile} 33 showDownload = ${this.showDownload} 34 showViewBookmark = ${this.showViewBookmark} 35 showPrint = ${this.showPrint} 36 showFullScreen = ${this.showFullScreen} 37 showFind = ${this.showFind} 38 cursor = ${this.cursor} 39 scroll = ${this.scroll} 40 spread = ${this.spread} 41 page = ${this.page} 42 zoom = ${this.zoom} 43 namedDest = ${this.namedDest} 44 pageMode = ${this.pageMode} 45 errorOverride = ${this.errorOverride} 46 errorAppend = ${this.errorAppend} 47 errorMessage = ${this.errorMessage} 48 locale = ${this.locale} 49 useOnlyCssZoom = ${this.useOnlyCssZoom} 50 51 Auto-actions (handled by action queue): 52 downloadOnLoad = ${this.downloadOnLoad} 53 printOnLoad = ${this.printOnLoad} 54 showLastPageOnLoad = ${this.showLastPageOnLoad} 55 `)}applyZoomToViewer(e){this.dispatchAction("set-zoom",e,"property-change")}applyRotationToViewer(e){this.dispatchAction("set-rotation",e,"property-change")}applyCursorToViewer(e){this.dispatchAction("set-cursor",e,"property-change")}applyScrollToViewer(e){this.dispatchAction("set-scroll",e,"property-change")}applySpreadToViewer(e){this.dispatchAction("set-spread",e,"property-change")}applyPageModeToViewer(e){this.dispatchAction("update-page-mode",e,"property-change")}dispatchAction(e,t,o="property-change"){let a=this.getRequiredReadinessLevel(e),n={id:`${o}-${e}-${Date.now()}`,action:e,payload:t};return this.hasRequiredReadiness(a)?this.actionQueueManager.executeAction(n):(this.actionQueueManager.queueAction(n,a),Promise.resolve({actionId:n.id,success:!0,timestamp:Date.now()}))}getRequiredReadinessLevel(e){let t=["set-theme","set-primary-color","set-background-color","set-page-border-color","set-toolbar-color","set-text-color","set-border-radius","set-custom-css"],o=["show-download","show-print","show-fullscreen","show-find","show-bookmark","show-openfile","show-annotations","set-error-message","set-error-override","set-error-append","set-css-zoom","show-toolbar-left","show-toolbar-middle","show-toolbar-right","show-secondary-toolbar-toggle","show-sidebar","show-sidebar-left","show-sidebar-right"],a=["set-cursor","set-scroll","set-spread","set-zoom","update-page-mode","set-toolbar-density","set-sidebar-width","set-toolbar-position","set-sidebar-position","set-responsive-breakpoint"],n=["set-page","set-rotation","go-to-last-page","go-to-named-dest","trigger-download","trigger-print","trigger-rotate-cw","trigger-rotate-ccw"];return t.includes(e)?1:o.includes(e)?3:a.includes(e)?4:n.includes(e)?5:3}hasRequiredReadiness(e){return!this.isPostMessageReady||e===5&&!this.actionQueueManager?.isDocumentLoaded?!1:this.postMessageReadiness>=e}static \u0275fac=function(t){return new(t||s)(W(H))};static \u0275cmp=L({type:s,selectors:[["ng2-pdfjs-viewer"]],viewQuery:function(t,o){if(t&1&&j(re,7),t&2){let a;$(a=U())&&(o.iframe=a.first)}},inputs:{viewerId:"viewerId",viewerFolder:"viewerFolder",externalWindow:"externalWindow",target:"target",showSpinner:"showSpinner",downloadFileName:"downloadFileName",locale:"locale",useOnlyCssZoom:"useOnlyCssZoom",diagnosticLogs:"diagnosticLogs",showOpenFile:"showOpenFile",showAnnotations:"showAnnotations",showDownload:"showDownload",showViewBookmark:"showViewBookmark",showPrint:"showPrint",showFullScreen:"showFullScreen",showFind:"showFind",downloadOnLoad:"downloadOnLoad",printOnLoad:"printOnLoad",rotateCW:"rotateCW",rotateCCW:"rotateCCW",showLastPageOnLoad:"showLastPageOnLoad",namedDest:"namedDest",errorOverride:"errorOverride",errorAppend:"errorAppend",errorMessage:"errorMessage",urlValidation:"url
55Validation",customSecurityTpl:"customSecurityTpl",theme:"theme",primaryColor:"primaryColor",backgroundColor:"backgroundColor",pageBorderColor:"pageBorderColor",pageSpacing:"pageSpacing",toolbarColor:"toolbarColor",textColor:"textColor",borderRadius:"borderRadius",customCSS:"customCSS",cspNonce:"cspNonce",iframeTitle:"iframeTitle",customSpinnerTpl:"customSpinnerTpl",spinnerClass:"spinnerClass",customErrorTpl:"customErrorTpl",errorClass:"errorClass",showToolbarLeft:"showToolbarLeft",showToolbarMiddle:"showToolbarMiddle",showToolbarRight:"showToolbarRight",showSecondaryToolbarToggle:"showSecondaryToolbarToggle",showSidebar:"showSidebar",showSidebarLeft:"showSidebarLeft",showSidebarRight:"showSidebarRight",toolbarDensity:"toolbarDensity",sidebarWidth:"sidebarWidth",toolbarPosition:"toolbarPosition",sidebarPosition:"sidebarPosition",responsiveBreakpoint:"responsiveBreakpoint",controlVisibility:"controlVisibility",autoActions:"autoActions",errorHandling:"errorHandling",viewerConfig:"viewerConfig",themeConfig:"themeConfig",groupVisibility:"groupVisibility",layoutConfig:"layoutConfig",startDownload:"startDownload",startPrint:"startPrint",openFile:"openFile",download:"download",print:"print",fullScreen:"fullScreen",find:"find",viewBookmark:"viewBookmark",lastPage:"lastPage",externalWindowOptions:"externalWindowOptions",iframeBorder:"iframeBorder",zoom:"zoom",rotation:"rotation",cursor:"cursor",scroll:"scroll",spread:"spread",pageMode:"pageMode",page:"page",pdfSrc:"pdfSrc"},outputs:{onBeforePrint:"onBeforePrint",onAfterPrint:"onAfterPrint",onDocumentLoad:"onDocumentLoad",onPageChange:"onPageChange",onScaleChange:"onScaleChange",onRotationChange:"onRotationChange",onDocumentError:"onDocumentError",onDocumentInit:"onDocumentInit",onPagesInit:"onPagesInit",onPresentationModeChanged:"onPresentationModeChanged",onOpenFile:"onOpenFile",onFind:"onFind",onUpdateFindMatchesCount:"onUpdateFindMatchesCount",onMetadataLoaded:"onMetadataLoaded",onOutlineLoaded:"onOutlineLoaded",onPageRendered:"onPageRendered",onAnnotationLayerRendered:"onAnnotationLayerRendered",onBookmarkClick:"onBookmarkClick",onIdle:"onIdle",zoomChange:"zoomChange",cursorChange:"cursorChange",scrollChange:"scrollChange",spreadChange:"spreadChange",pageModeChange:"pageModeChange"},standalone:!1,features:[I],decls:5,vars:6,consts:[["iframe",""],["defaultSpinner",""],["defaultError",""],[1,"ng2-pdfjs-viewer-container"],["sandbox","allow-forms allow-scripts allow-same-origin allow-modals allow-downloads","width","100%","height","100%",3,"title","hidden"],["class","ng2-pdfjs-loading-overlay",3,"ngClass",4,"ngIf"],["class","ng2-pdfjs-error-overlay",3,"ngClass",4,"ngIf"],[1,"ng2-pdfjs-loading-overlay",3,"ngClass"],[3,"ngTemplateOutlet",4,"ngIf","ngIfElse"],[3,"ngTemplateOutlet"],[1,"ng2-pdfjs-spinner-content"],[1,"ng2-pdfjs-spinner-icon"],[1,"ng2-pdfjs-spinner-text"],[1,"ng2-pdfjs-error-overlay",3,"ngClass"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf","ngIfElse"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ng2-pdfjs-error-content"],[1,"ng2-pdfjs-error-icon"],[1,"ng2-pdfjs-error-title"],[1,"ng2-pdfjs-error-message"]],template:function(t,o){t&1&&(u(0,"div",3),w(1,"iframe",4,0),v(3,de,4,3,"div",5)(4,ue,4,3,"div",6),c()),t&2&&(p(),N(o.getIframeClasses()),h("title",o.iframeTitle||"PDF document viewer")("hidden",o.externalWindow||!o.externalWindow&&!o.pdfSrc),p(2),h("ngIf",o.showSpinner&&o.isLoading&&!o.externalWindow),p(),h("ngIf",o.errorOverride&&o.hasError&&!o.externalWindow))},dependencies:[Z,G,K],styles:[".ng2-pdfjs-viewer-container[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}.ng2-pdfjs-loading-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#fff9;-webkit-backdrop-filter:saturate(120%) blur(1px);backdrop-filter:saturate(120%) blur(1px)}.ng2-pdfjs-spinner-content[_ngcontent-%COMP%]{text-align:center}.ng2-pdfjs-spinner-icon[_ngcontent-%COMP%]{display:inline-block;width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #2196F3;border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.ng2-pdfjs-spinner-text[_ngcontent-%COMP%]{margin-top:16px;color:#666;font-size:16px}.ng2-pdfjs-error-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffe6;-webkit-backdrop-filter:saturate(120%) blur(1px);backdrop-filter:saturate(120%) blur(1px)}.ng2-pdfjs-error-content[_ngcontent-%COMP%]{text-align:center;max-width:400px;padding:20px}.ng2-pdfjs-error-icon[_ngcontent-%COMP%]{font-size:48px;color:#f44336;margin-bottom:16px}.ng2-pdfjs-error-title[_ngcontent-%COMP%]{color:#333;font-size:18px;font-weight:500;margin-bottom:8px}.ng2-pdfjs-error-message[_ngcontent-%COMP%]{color:#666;font-size:14px;line-height:1.4}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ng2-pdfjs-viewer-iframe[_ngcontent-%COMP%]{border:0}.ng2-pdfjs-viewer-iframe.has-border[_ngcontent-%COMP%]{border:1px solid #ccc}"]})}return s})(),oe=(()=>{class s{static forRoot(){return{ngModule:s}}static \u0275fac=function(t){return new(t||s)};static \u0275mod=B({type:s});static \u0275inj=E({imports:[X]})}return s})();function ge(s,i){if(s&1&&w(0,"ng2-pdfjs-viewer",0),s&2){let e=g();h("pdfSrc",e.item().url)("showSpinner",!0)("theme","light")("showPrint",!1)("showDownload",!1)("showOpenFile",!1)}}var ie=class s{data=k(ee);dialogRef=k(Y);item=q({url:"",name:"",type:"DOCUMENT"});constructor(){this.loadPdf()}loadPdf(){return m(this,null,function*(){try{let i=yield fetch(this.data.url);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let e=yield i.blob();this.item.set(F(M({},this.data),{url:URL.createObjectURL(e)}))}catch(i){console.error("Failed to load PDF:",i)}})}ngOnDestroy(){URL.revokeObjectURL(this.item().url)}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=L({type:s,selectors:[["app-pdf-viewer"]],decls:1,vars:1,consts:[[1,"h-100",3,"pdfSrc","showSpinner","theme","showPrint","showDownload","showOpenFile"]],template:function(e,t){e&1&&z(0,ge,1,6,"ng2-pdfjs-viewer",0),e&2&&Q(t.item().url?0:-1)},dependencies:[oe,te],encapsulation:2})};export{ie as PdfViewerComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.