ngx-doc-viewer 21.0.5 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,517 +1,682 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, TemplateRef, ViewChildren, ContentChild, Input, Output, Component, NgModule } from '@angular/core';
3
- import * as i2 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import { getViewerDetails, isLocalFile, replaceLocalUrl, getDocxToHtml, googleCheckSubscription, getViewerRecoveryPlan, iframeIsLoaded } from 'docviewhelper';
6
- export * from 'docviewhelper';
7
- import * as i1 from '@angular/platform-browser';
8
-
9
- class NgxDocViewerComponent {
10
- domSanitizer;
11
- ngZone;
12
- cdr;
13
- loaded = new EventEmitter();
14
- loading = new EventEmitter();
15
- error = new EventEmitter();
16
- phaseChange = new EventEmitter();
17
- url = '';
18
- queryParams = '';
19
- viewerUrl = '';
20
- googleCheckInterval = 3000;
21
- googleMaxChecks = 5;
22
- googleFinalRetryDelay = 0;
23
- disableContent = 'none';
24
- googleCheckContentLoaded = true;
25
- viewer = 'google';
26
- overrideLocalhost = '';
27
- loadingText = 'Loading document...';
28
- errorTextOverride = '';
29
- retryButtonText = 'Retry';
30
- officeAutoRetry = false;
31
- officeRetryDelay = 3000;
32
- officeReloadButtonText = '↻';
33
- officeReloadButtonTitle = 'Reload document';
34
- secondaryActionText = '';
35
- secondaryActionMode = 'open';
36
- loadingTemplate;
37
- errorTemplate;
38
- errorActionsTemplate;
39
- officeReloadTemplate;
40
- iframes = undefined;
41
- fullUrl = undefined;
42
- externalViewer = false;
43
- docHtml = '';
44
- configuredViewer = 'google';
45
- showIframe = true;
46
- renderPhase = 'idle';
47
- errorText = '';
48
- failedUrl = '';
49
- retryNonce = 0;
50
- loadingTemplateContext = this.createTemplateContext();
51
- errorTemplateContext = this.createTemplateContext();
52
- checkIFrameSubscription = undefined;
53
- loadVersion = 0;
54
- externalLoadTimeoutId = undefined;
55
- googleFinalRetryTimeoutId = undefined;
56
- googleFinalRetriedSourceKey = undefined;
57
- currentGoogleSourceKey = undefined;
58
- officeRetryTimeoutId = undefined;
59
- officeAutoRetriedSourceKey = undefined;
60
- currentOfficeSourceKey = undefined;
61
- lastEmittedPhase = undefined;
62
- constructor(domSanitizer, ngZone, cdr) {
63
- this.domSanitizer = domSanitizer;
64
- this.ngZone = ngZone;
65
- this.cdr = cdr;
66
- }
67
- ngOnDestroy() {
68
- this.clearExternalLoadTimeout();
69
- this.clearGoogleFinalRetry();
70
- this.clearOfficeRetry();
71
- if (this.checkIFrameSubscription) {
72
- this.checkIFrameSubscription.unsubscribe();
73
- }
74
- }
75
- async ngOnChanges(changes) {
76
- if (changes &&
77
- changes['retryNonce'] &&
78
- changes['retryNonce'].firstChange) {
79
- return;
80
- }
81
- if (changes &&
82
- changes['viewer'] &&
83
- (changes['viewer'].firstChange ||
84
- changes['viewer'].currentValue !== changes['viewer'].previousValue)) {
85
- if (this.viewer !== 'google' &&
86
- this.viewer !== 'office' &&
87
- this.viewer !== 'mammoth' &&
88
- this.viewer !== 'pdf' &&
89
- this.viewer !== 'url') {
90
- console.error(`Unsupported viewer: '${this.viewer}'. Supported viewers: google, office, mammoth and pdf`);
91
- }
92
- this.configuredViewer = this.viewer;
93
- this.updateTemplateContexts();
94
- }
95
- if ((changes['url'] &&
96
- changes['url'].currentValue !== changes['url'].previousValue) ||
97
- (changes['viewer'] &&
98
- changes['viewer'].currentValue !== changes['viewer'].previousValue) ||
99
- (changes['viewerUrl'] &&
100
- changes['viewerUrl'].currentValue !==
101
- changes['viewerUrl'].previousValue)) {
102
- let viewerDetails = getViewerDetails(this.url, this.configuredViewer, this.queryParams, this.viewerUrl);
103
- const loadVersion = ++this.loadVersion;
104
- this.clearExternalLoadTimeout();
105
- this.externalViewer = viewerDetails.externalViewer;
106
- if (viewerDetails.externalViewer &&
107
- this.overrideLocalhost &&
108
- isLocalFile(this.url)) {
109
- const newUrl = replaceLocalUrl(this.url, this.overrideLocalhost);
110
- viewerDetails = getViewerDetails(newUrl, this.configuredViewer, this.queryParams, this.viewerUrl);
111
- }
112
- const officeSourceKey = this.configuredViewer === 'office' ? viewerDetails.url : undefined;
113
- if (officeSourceKey !== this.currentOfficeSourceKey) {
114
- this.officeAutoRetriedSourceKey = undefined;
115
- }
116
- this.currentOfficeSourceKey = officeSourceKey;
117
- const googleSourceKey = this.configuredViewer === 'google' ? viewerDetails.url : undefined;
118
- if (googleSourceKey !== this.currentGoogleSourceKey) {
119
- this.googleFinalRetriedSourceKey = undefined;
120
- }
121
- this.currentGoogleSourceKey = googleSourceKey;
122
- this.docHtml = '';
123
- this.errorText = '';
124
- this.failedUrl = this.url;
125
- this.clearGoogleFinalRetry();
126
- this.clearOfficeRetry();
127
- this.updateTemplateContexts();
128
- if (this.checkIFrameSubscription) {
129
- this.checkIFrameSubscription.unsubscribe();
130
- }
131
- if (!this.url) {
132
- this.fullUrl = undefined;
133
- this.showIframe = false;
134
- this.externalViewer = false;
135
- this.setRenderPhase('idle');
136
- this.updateTemplateContexts();
137
- }
138
- else if (viewerDetails.externalViewer ||
139
- this.configuredViewer === 'url' ||
140
- this.configuredViewer === 'pdf') {
141
- this.setRenderPhase('loading');
142
- const iframeUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(viewerDetails.url);
143
- this.fullUrl = undefined;
144
- this.showIframe = false;
145
- this.cdr.detectChanges();
146
- this.fullUrl = iframeUrl;
147
- this.showIframe = true;
148
- this.updateTemplateContexts();
149
- this.scheduleExternalLoadTimeout(loadVersion);
150
- this.cdr.detectChanges();
151
- this.scheduleViewerRecovery();
152
- }
153
- else if (this.configuredViewer === 'mammoth') {
154
- this.setRenderPhase('loading');
155
- this.externalViewer = false;
156
- this.fullUrl = undefined;
157
- this.showIframe = false;
158
- try {
159
- const docHtml = await getDocxToHtml(this.url);
160
- if (loadVersion !== this.loadVersion) {
161
- return;
162
- }
163
- this.ngZone.run(() => {
164
- this.docHtml = docHtml;
165
- this.setRenderPhase('ready');
166
- this.updateTemplateContexts();
167
- this.cdr.detectChanges();
168
- });
169
- }
170
- catch (error) {
171
- if (loadVersion !== this.loadVersion) {
172
- return;
173
- }
174
- this.ngZone.run(() => {
175
- this.errorText =
176
- error instanceof Error ? error.message : 'Unable to load document.';
177
- this.setRenderPhase('error');
178
- this.updateTemplateContexts();
179
- this.cdr.detectChanges();
180
- });
181
- }
182
- }
183
- }
184
- }
185
- retryLoad() {
186
- this.retryNonce += 1;
187
- const retryVersion = ++this.loadVersion;
188
- this.clearExternalLoadTimeout();
189
- this.clearGoogleFinalRetry();
190
- this.clearOfficeRetry();
191
- this.errorText = '';
192
- this.setRenderPhase(this.url ? 'loading' : 'idle');
193
- this.updateTemplateContexts();
194
- if (!this.url) {
195
- return;
196
- }
197
- if (this.configuredViewer === 'mammoth') {
198
- this.docHtml = '';
199
- void this.reloadMammoth(retryVersion);
200
- return;
201
- }
202
- if (this.configuredViewer === 'google' ||
203
- this.configuredViewer === 'office' ||
204
- this.configuredViewer === 'url' ||
205
- this.configuredViewer === 'pdf') {
206
- const details = getViewerDetails(this.url, this.configuredViewer, this.queryParams, this.viewerUrl);
207
- const finalUrl = details.externalViewer && this.overrideLocalhost && isLocalFile(this.url)
208
- ? getViewerDetails(replaceLocalUrl(this.url, this.overrideLocalhost), this.configuredViewer, this.queryParams, this.viewerUrl).url
209
- : details.url;
210
- this.fullUrl = undefined;
211
- this.showIframe = false;
212
- this.cdr.detectChanges();
213
- this.fullUrl =
214
- this.domSanitizer.bypassSecurityTrustResourceUrl(finalUrl);
215
- this.showIframe = true;
216
- this.scheduleExternalLoadTimeout(retryVersion);
217
- this.scheduleViewerRecovery();
218
- this.updateTemplateContexts();
219
- this.cdr.detectChanges();
220
- }
221
- }
222
- reloadIframe(iframe) {
223
- this.checkIFrameSubscription = googleCheckSubscription();
224
- this.checkIFrameSubscription.subscribe(iframe, this.googleCheckInterval, this.googleMaxChecks);
225
- }
226
- scheduleViewerRecovery() {
227
- const recoveryPlan = getViewerRecoveryPlan({
228
- viewer: this.configuredViewer,
229
- googleCheckContentLoaded: this.googleCheckContentLoaded,
230
- googleFinalRetryDelay: this.googleFinalRetryDelay,
231
- officeAutoRetry: this.officeAutoRetry,
232
- });
233
- for (const mode of recoveryPlan.modes) {
234
- if (mode === 'google-probe') {
235
- this.scheduleGoogleRecovery();
236
- }
237
- if (mode === 'google-final-retry') {
238
- continue;
239
- }
240
- if (mode === 'office-auto-retry') {
241
- this.scheduleOfficeRetry();
242
- }
243
- }
244
- }
245
- scheduleGoogleRecovery() {
246
- if (this.configuredViewer !== 'google' ||
247
- !this.googleCheckContentLoaded) {
248
- return;
249
- }
250
- // see:
251
- // https://stackoverflow.com/questions/40414039/google-docs-viewer-returning-204-responses-no-longer-working-alternatives
252
- // hack to reload iframe if it's not loaded.
253
- this.ngZone.runOutsideAngular(() => {
254
- window.setTimeout(() => {
255
- const iframe = this.iframes?.first?.nativeElement;
256
- if (iframe) {
257
- this.reloadIframe(iframe);
258
- }
259
- }, 0);
260
- });
261
- }
262
- iframeLoaded() {
263
- const iframe = this.iframes?.first?.nativeElement;
264
- if (iframe && iframeIsLoaded(iframe)) {
265
- this.clearExternalLoadTimeout();
266
- this.clearGoogleFinalRetry();
267
- this.clearOfficeRetry();
268
- this.setRenderPhase('ready');
269
- this.updateTemplateContexts();
270
- this.loaded.emit(undefined);
271
- if (this.checkIFrameSubscription) {
272
- this.checkIFrameSubscription.unsubscribe();
273
- }
274
- }
275
- }
276
- objectLoaded() {
277
- this.clearExternalLoadTimeout();
278
- this.clearGoogleFinalRetry();
279
- this.clearOfficeRetry();
280
- this.setRenderPhase('ready');
281
- this.updateTemplateContexts();
282
- }
283
- async reloadMammoth(loadVersion) {
284
- this.externalViewer = false;
285
- this.fullUrl = undefined;
286
- this.showIframe = false;
287
- try {
288
- const docHtml = await getDocxToHtml(this.url);
289
- if (loadVersion !== this.loadVersion) {
290
- return;
291
- }
292
- this.ngZone.run(() => {
293
- this.docHtml = docHtml;
294
- this.setRenderPhase('ready');
295
- this.updateTemplateContexts();
296
- this.cdr.detectChanges();
297
- });
298
- }
299
- catch (error) {
300
- if (loadVersion !== this.loadVersion) {
301
- return;
302
- }
303
- this.ngZone.run(() => {
304
- this.errorText =
305
- error instanceof Error ? error.message : 'Unable to load document.';
306
- this.setRenderPhase('error');
307
- this.updateTemplateContexts();
308
- this.cdr.detectChanges();
309
- });
310
- }
311
- }
312
- scheduleExternalLoadTimeout(loadVersion) {
313
- this.clearExternalLoadTimeout();
314
- const timeoutMs = this.configuredViewer === 'google'
315
- ? Math.max(this.googleCheckInterval * this.googleMaxChecks + 2000, 15000)
316
- : 15000;
317
- this.externalLoadTimeoutId = window.setTimeout(() => {
318
- if (loadVersion !== this.loadVersion || this.renderPhase !== 'loading') {
319
- return;
320
- }
321
- if (this.scheduleGoogleFinalRetry()) {
322
- return;
323
- }
324
- this.ngZone.run(() => {
325
- this.errorText = `The ${this.configuredViewer} viewer did not finish loading in time.`;
326
- this.setRenderPhase('error');
327
- this.updateTemplateContexts();
328
- this.cdr.detectChanges();
329
- });
330
- }, timeoutMs);
331
- }
332
- clearExternalLoadTimeout() {
333
- if (this.externalLoadTimeoutId) {
334
- window.clearTimeout(this.externalLoadTimeoutId);
335
- this.externalLoadTimeoutId = undefined;
336
- }
337
- }
338
- clearGoogleFinalRetry() {
339
- if (this.googleFinalRetryTimeoutId) {
340
- window.clearTimeout(this.googleFinalRetryTimeoutId);
341
- this.googleFinalRetryTimeoutId = undefined;
342
- }
343
- }
344
- clearOfficeRetry() {
345
- if (this.officeRetryTimeoutId) {
346
- window.clearTimeout(this.officeRetryTimeoutId);
347
- this.officeRetryTimeoutId = undefined;
348
- }
349
- }
350
- scheduleOfficeRetry() {
351
- if (this.configuredViewer !== 'office' ||
352
- !this.officeAutoRetry ||
353
- !this.currentOfficeSourceKey ||
354
- this.officeAutoRetriedSourceKey === this.currentOfficeSourceKey) {
355
- return;
356
- }
357
- this.clearOfficeRetry();
358
- this.officeRetryTimeoutId = window.setTimeout(() => {
359
- if (!this.currentOfficeSourceKey ||
360
- this.officeAutoRetriedSourceKey === this.currentOfficeSourceKey) {
361
- return;
362
- }
363
- this.officeAutoRetriedSourceKey = this.currentOfficeSourceKey;
364
- this.ngZone.run(() => this.retryLoad());
365
- }, this.officeRetryDelay);
366
- }
367
- scheduleGoogleFinalRetry() {
368
- const recoveryPlan = getViewerRecoveryPlan({
369
- viewer: this.configuredViewer,
370
- googleCheckContentLoaded: this.googleCheckContentLoaded,
371
- googleFinalRetryDelay: this.googleFinalRetryDelay,
372
- officeAutoRetry: this.officeAutoRetry,
373
- });
374
- if (!recoveryPlan.modes.includes('google-final-retry') ||
375
- !this.currentGoogleSourceKey ||
376
- this.googleFinalRetriedSourceKey === this.currentGoogleSourceKey) {
377
- return false;
378
- }
379
- this.clearGoogleFinalRetry();
380
- this.googleFinalRetryTimeoutId = window.setTimeout(() => {
381
- if (!this.currentGoogleSourceKey ||
382
- this.googleFinalRetriedSourceKey === this.currentGoogleSourceKey) {
383
- return;
384
- }
385
- this.googleFinalRetriedSourceKey = this.currentGoogleSourceKey;
386
- this.ngZone.run(() => this.retryLoad());
387
- }, this.googleFinalRetryDelay);
388
- return true;
389
- }
390
- get displayedErrorText() {
391
- return this.errorTextOverride || this.errorText || 'Unable to load document.';
392
- }
393
- updateTemplateContexts() {
394
- const state = this.createStateContext();
395
- this.loadingTemplateContext = { $implicit: state, state };
396
- this.errorTemplateContext = { $implicit: state, state };
397
- }
398
- createTemplateContext() {
399
- const state = this.createStateContext();
400
- return { $implicit: state, state };
401
- }
402
- createStateContext() {
403
- return {
404
- viewer: this.configuredViewer,
405
- url: this.failedUrl || this.url,
406
- phase: this.renderPhase,
407
- errorText: this.displayedErrorText,
408
- retry: () => this.retryLoad(),
409
- actionUrl: this.failedUrl || this.url,
410
- };
411
- }
412
- setRenderPhase(phase) {
413
- this.renderPhase = phase;
414
- this.emitLifecycleIfNeeded();
415
- }
416
- emitLifecycleIfNeeded() {
417
- if (this.lastEmittedPhase === this.renderPhase) {
418
- return;
419
- }
420
- this.lastEmittedPhase = this.renderPhase;
421
- const state = this.createStateContext();
422
- this.phaseChange.emit(state);
423
- if (this.renderPhase === 'loading') {
424
- this.loading.emit(state);
425
- }
426
- if (this.renderPhase === 'error') {
427
- this.error.emit(state);
428
- }
429
- }
430
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NgxDocViewerComponent, deps: [{ token: i1.DomSanitizer }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
431
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: NgxDocViewerComponent, isStandalone: true, selector: "ngx-doc-viewer", inputs: { url: "url", queryParams: "queryParams", viewerUrl: "viewerUrl", googleCheckInterval: "googleCheckInterval", googleMaxChecks: "googleMaxChecks", googleFinalRetryDelay: "googleFinalRetryDelay", disableContent: "disableContent", googleCheckContentLoaded: "googleCheckContentLoaded", viewer: "viewer", overrideLocalhost: "overrideLocalhost", loadingText: "loadingText", errorTextOverride: "errorTextOverride", retryButtonText: "retryButtonText", officeAutoRetry: "officeAutoRetry", officeRetryDelay: "officeRetryDelay", officeReloadButtonText: "officeReloadButtonText", officeReloadButtonTitle: "officeReloadButtonTitle", secondaryActionText: "secondaryActionText", secondaryActionMode: "secondaryActionMode" }, outputs: { loaded: "loaded", loading: "loading", error: "error", phaseChange: "phaseChange" }, queries: [{ propertyName: "loadingTemplate", first: true, predicate: ["loadingContent"], descendants: true, read: TemplateRef }, { propertyName: "errorTemplate", first: true, predicate: ["errorContent"], descendants: true, read: TemplateRef }, { propertyName: "errorActionsTemplate", first: true, predicate: ["errorActions"], descendants: true, read: TemplateRef }, { propertyName: "officeReloadTemplate", first: true, predicate: ["officeReloadContent"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "iframes", predicate: ["iframe"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"container\">\n <div *ngIf=\"renderPhase === 'loading'\" class=\"loading-overlay\">\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate; context: loadingTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultLoadingTemplate>{{ loadingText }}</ng-template>\n </div>\n <div *ngIf=\"renderPhase === 'error'\" class=\"error-overlay\">\n <ng-container *ngIf=\"errorTemplate; else defaultErrorTemplate\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorTemplate>\n <div>\n <div>{{ displayedErrorText }}</div>\n <div *ngIf=\"configuredViewer\" style=\"margin-top: 8px; color: #475569;\">\n Viewer: {{ configuredViewer }}\n </div>\n <div *ngIf=\"failedUrl\" style=\"margin-top: 4px; color: #64748b; font-size: 12px; word-break: break-word;\">\n {{ failedUrl }}\n </div>\n <ng-container *ngIf=\"errorActionsTemplate; else defaultErrorActions\">\n <ng-container *ngTemplateOutlet=\"errorActionsTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorActions>\n <div style=\"margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;\">\n <button\n type=\"button\"\n (click)=\"retryLoad()\"\n style=\"border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;\"\n >\n {{ retryButtonText }}\n </button>\n <a\n *ngIf=\"secondaryActionText && failedUrl\"\n [href]=\"failedUrl\"\n [attr.target]=\"secondaryActionMode === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode === 'download' ? '' : null\"\n style=\"border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 8px 14px; text-decoration: none; font: inherit;\"\n >\n {{ secondaryActionText }}\n </a>\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!externalViewer\">\n <div *ngIf=\"configuredViewer !== 'pdf'\" class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml\"></div>\n </div>\n <object\n (load)=\"objectLoaded()\"\n *ngIf=\"fullUrl && configuredViewer === 'pdf'\"\n [data]=\"fullUrl\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl\">Download the PDF</a>.\n </p>\n </object>\n </ng-container>\n\n <button\n *ngIf=\"configuredViewer === 'office' && renderPhase === 'ready'\"\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle\"\n (click)=\"retryLoad()\"\n >\n <ng-container *ngIf=\"officeReloadTemplate; else defaultOfficeReloadTemplate\">\n <ng-container *ngTemplateOutlet=\"officeReloadTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultOfficeReloadTemplate>{{ officeReloadButtonText }}</ng-template>\n </button>\n\n <ng-container *ngIf=\"externalViewer\">\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe && disableContent === 'none'\"\n #iframe\n id=\"iframe-doc-viewer\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n <div class=\"container\" *ngIf=\"disableContent !== 'none'\">\n <div\n [class.overlay-full]=\"disableContent === 'all'\"\n [class.overlay-popout-google]=\"\n configuredViewer === 'google' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [class.overlay-popout-office]=\"\n configuredViewer === 'office' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [style.background-color]=\"\n disableContent === 'popout-hide' ? '#fff' : 'transparent'\n \"\n ></div>\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe\"\n #iframe\n id=\"iframe\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n </div>\n </ng-container>\n</div>\n", styles: [":host{display:block}.container{width:100%;height:100%;position:relative}.inline-document-shell{width:100%;height:100%;overflow:auto;background:linear-gradient(180deg,#eef2f7,#f8fafc);padding:24px}.inline-document-page{max-width:900px;min-height:100%;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:18px;box-shadow:0 18px 40px -24px #0f172a4d,0 6px 18px -10px #0f172a2e;padding:40px 48px}.inline-document-page,.inline-document-page *{box-sizing:border-box}.inline-document-page{color:#1e293b;font-family:Georgia,Cambria,Times New Roman,Times,serif;font-size:18px;line-height:1.7}.inline-document-page p,.inline-document-page ul,.inline-document-page ol,.inline-document-page blockquote,.inline-document-page table{margin:0 0 1.1em}.inline-document-page h1,.inline-document-page h2,.inline-document-page h3,.inline-document-page h4,.inline-document-page h5,.inline-document-page h6{margin:1.4em 0 .65em;color:#0f172a;line-height:1.25}.inline-document-page h1:first-child,.inline-document-page h2:first-child,.inline-document-page h3:first-child,.inline-document-page p:first-child{margin-top:0}.inline-document-page table{width:100%;border-collapse:collapse}.inline-document-page td,.inline-document-page th{padding:6px 10px;vertical-align:top}.inline-document-page img{max-width:100%;height:auto}.inline-document-page hr{border:0;border-top:1px solid #dbe4f0;margin:1.5em 0}.loading-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#ffffffe0;color:#475569;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#fffffff0;color:#991b1b;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.overlay-popout-google{width:40px;height:40px;right:26px;top:11.5px;position:absolute;z-index:1000}.overlay-popout-office{width:100px;height:20px;right:0;bottom:0;position:absolute;z-index:1000}.office-reload-btn{position:absolute;top:8px;right:8px;z-index:1001;width:32px;height:32px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#ffffffd9;color:#475569;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.5;transition:opacity .15s;padding:0}.office-reload-btn:hover{opacity:1}.overlay-full{width:100%;height:100%;right:0;top:0;position:absolute;z-index:1000}iframe{width:100%;height:100%}@media(max-width:768px){.inline-document-shell{padding:12px}.inline-document-page{border-radius:12px;padding:22px 18px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
432
- }
433
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NgxDocViewerComponent, decorators: [{
434
- type: Component,
435
- args: [{ selector: 'ngx-doc-viewer', standalone: true, imports: [CommonModule], template: "<div class=\"container\">\n <div *ngIf=\"renderPhase === 'loading'\" class=\"loading-overlay\">\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate; context: loadingTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultLoadingTemplate>{{ loadingText }}</ng-template>\n </div>\n <div *ngIf=\"renderPhase === 'error'\" class=\"error-overlay\">\n <ng-container *ngIf=\"errorTemplate; else defaultErrorTemplate\">\n <ng-container *ngTemplateOutlet=\"errorTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorTemplate>\n <div>\n <div>{{ displayedErrorText }}</div>\n <div *ngIf=\"configuredViewer\" style=\"margin-top: 8px; color: #475569;\">\n Viewer: {{ configuredViewer }}\n </div>\n <div *ngIf=\"failedUrl\" style=\"margin-top: 4px; color: #64748b; font-size: 12px; word-break: break-word;\">\n {{ failedUrl }}\n </div>\n <ng-container *ngIf=\"errorActionsTemplate; else defaultErrorActions\">\n <ng-container *ngTemplateOutlet=\"errorActionsTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultErrorActions>\n <div style=\"margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;\">\n <button\n type=\"button\"\n (click)=\"retryLoad()\"\n style=\"border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer;\"\n >\n {{ retryButtonText }}\n </button>\n <a\n *ngIf=\"secondaryActionText && failedUrl\"\n [href]=\"failedUrl\"\n [attr.target]=\"secondaryActionMode === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode === 'download' ? '' : null\"\n style=\"border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 8px 14px; text-decoration: none; font: inherit;\"\n >\n {{ secondaryActionText }}\n </a>\n </div>\n </ng-template>\n </div>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!externalViewer\">\n <div *ngIf=\"configuredViewer !== 'pdf'\" class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml\"></div>\n </div>\n <object\n (load)=\"objectLoaded()\"\n *ngIf=\"fullUrl && configuredViewer === 'pdf'\"\n [data]=\"fullUrl\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl\">Download the PDF</a>.\n </p>\n </object>\n </ng-container>\n\n <button\n *ngIf=\"configuredViewer === 'office' && renderPhase === 'ready'\"\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle\"\n (click)=\"retryLoad()\"\n >\n <ng-container *ngIf=\"officeReloadTemplate; else defaultOfficeReloadTemplate\">\n <ng-container *ngTemplateOutlet=\"officeReloadTemplate; context: errorTemplateContext\"></ng-container>\n </ng-container>\n <ng-template #defaultOfficeReloadTemplate>{{ officeReloadButtonText }}</ng-template>\n </button>\n\n <ng-container *ngIf=\"externalViewer\">\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe && disableContent === 'none'\"\n #iframe\n id=\"iframe-doc-viewer\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n <div class=\"container\" *ngIf=\"disableContent !== 'none'\">\n <div\n [class.overlay-full]=\"disableContent === 'all'\"\n [class.overlay-popout-google]=\"\n configuredViewer === 'google' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [class.overlay-popout-office]=\"\n configuredViewer === 'office' &&\n (disableContent === 'popout' || disableContent === 'popout-hide')\n \"\n [style.background-color]=\"\n disableContent === 'popout-hide' ? '#fff' : 'transparent'\n \"\n ></div>\n <iframe\n (load)=\"iframeLoaded()\"\n *ngIf=\"fullUrl && showIframe\"\n #iframe\n id=\"iframe\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl\"\n ></iframe>\n </div>\n </ng-container>\n</div>\n", styles: [":host{display:block}.container{width:100%;height:100%;position:relative}.inline-document-shell{width:100%;height:100%;overflow:auto;background:linear-gradient(180deg,#eef2f7,#f8fafc);padding:24px}.inline-document-page{max-width:900px;min-height:100%;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:18px;box-shadow:0 18px 40px -24px #0f172a4d,0 6px 18px -10px #0f172a2e;padding:40px 48px}.inline-document-page,.inline-document-page *{box-sizing:border-box}.inline-document-page{color:#1e293b;font-family:Georgia,Cambria,Times New Roman,Times,serif;font-size:18px;line-height:1.7}.inline-document-page p,.inline-document-page ul,.inline-document-page ol,.inline-document-page blockquote,.inline-document-page table{margin:0 0 1.1em}.inline-document-page h1,.inline-document-page h2,.inline-document-page h3,.inline-document-page h4,.inline-document-page h5,.inline-document-page h6{margin:1.4em 0 .65em;color:#0f172a;line-height:1.25}.inline-document-page h1:first-child,.inline-document-page h2:first-child,.inline-document-page h3:first-child,.inline-document-page p:first-child{margin-top:0}.inline-document-page table{width:100%;border-collapse:collapse}.inline-document-page td,.inline-document-page th{padding:6px 10px;vertical-align:top}.inline-document-page img{max-width:100%;height:auto}.inline-document-page hr{border:0;border-top:1px solid #dbe4f0;margin:1.5em 0}.loading-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#ffffffe0;color:#475569;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#fffffff0;color:#991b1b;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.overlay-popout-google{width:40px;height:40px;right:26px;top:11.5px;position:absolute;z-index:1000}.overlay-popout-office{width:100px;height:20px;right:0;bottom:0;position:absolute;z-index:1000}.office-reload-btn{position:absolute;top:8px;right:8px;z-index:1001;width:32px;height:32px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#ffffffd9;color:#475569;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.5;transition:opacity .15s;padding:0}.office-reload-btn:hover{opacity:1}.overlay-full{width:100%;height:100%;right:0;top:0;position:absolute;z-index:1000}iframe{width:100%;height:100%}@media(max-width:768px){.inline-document-shell{padding:12px}.inline-document-page{border-radius:12px;padding:22px 18px}}\n"] }]
436
- }], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }], propDecorators: { loaded: [{
437
- type: Output
438
- }], loading: [{
439
- type: Output
440
- }], error: [{
441
- type: Output
442
- }], phaseChange: [{
443
- type: Output
444
- }], url: [{
445
- type: Input
446
- }], queryParams: [{
447
- type: Input
448
- }], viewerUrl: [{
449
- type: Input
450
- }], googleCheckInterval: [{
451
- type: Input
452
- }], googleMaxChecks: [{
453
- type: Input
454
- }], googleFinalRetryDelay: [{
455
- type: Input
456
- }], disableContent: [{
457
- type: Input
458
- }], googleCheckContentLoaded: [{
459
- type: Input
460
- }], viewer: [{
461
- type: Input
462
- }], overrideLocalhost: [{
463
- type: Input
464
- }], loadingText: [{
465
- type: Input
466
- }], errorTextOverride: [{
467
- type: Input
468
- }], retryButtonText: [{
469
- type: Input
470
- }], officeAutoRetry: [{
471
- type: Input
472
- }], officeRetryDelay: [{
473
- type: Input
474
- }], officeReloadButtonText: [{
475
- type: Input
476
- }], officeReloadButtonTitle: [{
477
- type: Input
478
- }], secondaryActionText: [{
479
- type: Input
480
- }], secondaryActionMode: [{
481
- type: Input
482
- }], loadingTemplate: [{
483
- type: ContentChild,
484
- args: ['loadingContent', { read: TemplateRef }]
485
- }], errorTemplate: [{
486
- type: ContentChild,
487
- args: ['errorContent', { read: TemplateRef }]
488
- }], errorActionsTemplate: [{
489
- type: ContentChild,
490
- args: ['errorActions', { read: TemplateRef }]
491
- }], officeReloadTemplate: [{
492
- type: ContentChild,
493
- args: ['officeReloadContent', { read: TemplateRef }]
494
- }], iframes: [{
495
- type: ViewChildren,
496
- args: ['iframe']
497
- }] } });
498
-
499
- class NgxDocViewerModule {
500
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NgxDocViewerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
501
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.4", ngImport: i0, type: NgxDocViewerModule, imports: [CommonModule, NgxDocViewerComponent], exports: [NgxDocViewerComponent] });
502
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NgxDocViewerModule, imports: [CommonModule, NgxDocViewerComponent] });
503
- }
504
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NgxDocViewerModule, decorators: [{
505
- type: NgModule,
506
- args: [{
507
- imports: [CommonModule, NgxDocViewerComponent],
508
- exports: [NgxDocViewerComponent],
509
- }]
510
- }] });
511
-
512
- /**
513
- * Generated bundle index. Do not edit.
514
- */
515
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, Injector, NgModule, NgZone, TemplateRef, afterNextRender, computed, contentChild, inject, input, output, signal, viewChild } from "@angular/core";
3
+ import { CommonModule, NgTemplateOutlet } from "@angular/common";
4
+ import { DomSanitizer } from "@angular/platform-browser";
5
+ import { ViewerRecoveryController, getDisableContentOverlay, getDocxToHtml, googleCheckSubscription, iframeIsLoaded, resolveViewerDetails } from "docviewhelper";
6
+ export * from "docviewhelper";
7
+ const SUPPORTED_VIEWERS = [
8
+ "google",
9
+ "office",
10
+ "mammoth",
11
+ "pdf",
12
+ "url"
13
+ ];
14
+ const SOURCE_INPUTS = [
15
+ "url",
16
+ "viewer",
17
+ "viewerUrl",
18
+ "queryParams",
19
+ "overrideLocalhost"
20
+ ];
21
+ var NgxDocViewerComponent = class NgxDocViewerComponent {
22
+ domSanitizer = inject(DomSanitizer);
23
+ ngZone = inject(NgZone);
24
+ injector = inject(Injector);
25
+ loaded = output();
26
+ loading = output();
27
+ error = output();
28
+ phaseChange = output();
29
+ url = input("", ...ngDevMode ? [{ debugName: "url" }] : /* istanbul ignore next */ []);
30
+ queryParams = input("", ...ngDevMode ? [{ debugName: "queryParams" }] : /* istanbul ignore next */ []);
31
+ viewerUrl = input("", ...ngDevMode ? [{ debugName: "viewerUrl" }] : /* istanbul ignore next */ []);
32
+ googleCheckInterval = input(3e3, ...ngDevMode ? [{ debugName: "googleCheckInterval" }] : /* istanbul ignore next */ []);
33
+ googleMaxChecks = input(5, ...ngDevMode ? [{ debugName: "googleMaxChecks" }] : /* istanbul ignore next */ []);
34
+ googleFinalRetryDelay = input(0, ...ngDevMode ? [{ debugName: "googleFinalRetryDelay" }] : /* istanbul ignore next */ []);
35
+ disableContent = input("none", ...ngDevMode ? [{ debugName: "disableContent" }] : /* istanbul ignore next */ []);
36
+ googleCheckContentLoaded = input(true, ...ngDevMode ? [{ debugName: "googleCheckContentLoaded" }] : /* istanbul ignore next */ []);
37
+ viewer = input("google", ...ngDevMode ? [{ debugName: "viewer" }] : /* istanbul ignore next */ []);
38
+ overrideLocalhost = input("", ...ngDevMode ? [{ debugName: "overrideLocalhost" }] : /* istanbul ignore next */ []);
39
+ loadingText = input("Loading document...", ...ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []);
40
+ errorTextOverride = input("", ...ngDevMode ? [{ debugName: "errorTextOverride" }] : /* istanbul ignore next */ []);
41
+ retryButtonText = input("Retry", ...ngDevMode ? [{ debugName: "retryButtonText" }] : /* istanbul ignore next */ []);
42
+ officeAutoRetry = input(false, ...ngDevMode ? [{ debugName: "officeAutoRetry" }] : /* istanbul ignore next */ []);
43
+ officeRetryDelay = input(3e3, ...ngDevMode ? [{ debugName: "officeRetryDelay" }] : /* istanbul ignore next */ []);
44
+ officeReloadButtonText = input("↻", ...ngDevMode ? [{ debugName: "officeReloadButtonText" }] : /* istanbul ignore next */ []);
45
+ officeReloadButtonTitle = input("Reload document", ...ngDevMode ? [{ debugName: "officeReloadButtonTitle" }] : /* istanbul ignore next */ []);
46
+ secondaryActionText = input("", ...ngDevMode ? [{ debugName: "secondaryActionText" }] : /* istanbul ignore next */ []);
47
+ secondaryActionMode = input("open", ...ngDevMode ? [{ debugName: "secondaryActionMode" }] : /* istanbul ignore next */ []);
48
+ loadingTemplate = contentChild("loadingContent", {
49
+ ...ngDevMode ? { debugName: "loadingTemplate" } : /* istanbul ignore next */ {},
50
+ read: TemplateRef
51
+ });
52
+ errorTemplate = contentChild("errorContent", {
53
+ ...ngDevMode ? { debugName: "errorTemplate" } : /* istanbul ignore next */ {},
54
+ read: TemplateRef
55
+ });
56
+ errorActionsTemplate = contentChild("errorActions", {
57
+ ...ngDevMode ? { debugName: "errorActionsTemplate" } : /* istanbul ignore next */ {},
58
+ read: TemplateRef
59
+ });
60
+ officeReloadTemplate = contentChild("officeReloadContent", {
61
+ ...ngDevMode ? { debugName: "officeReloadTemplate" } : /* istanbul ignore next */ {},
62
+ read: TemplateRef
63
+ });
64
+ iframe = viewChild("iframe", ...ngDevMode ? [{ debugName: "iframe" }] : /* istanbul ignore next */ []);
65
+ renderPhase = signal("idle", ...ngDevMode ? [{ debugName: "renderPhase" }] : /* istanbul ignore next */ []);
66
+ externalViewer = signal(false, ...ngDevMode ? [{ debugName: "externalViewer" }] : /* istanbul ignore next */ []);
67
+ fullUrl = signal(void 0, ...ngDevMode ? [{ debugName: "fullUrl" }] : /* istanbul ignore next */ []);
68
+ docHtml = signal("", ...ngDevMode ? [{ debugName: "docHtml" }] : /* istanbul ignore next */ []);
69
+ errorText = signal("", ...ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []);
70
+ sourceUrl = signal("", ...ngDevMode ? [{ debugName: "sourceUrl" }] : /* istanbul ignore next */ []);
71
+ loadKey = signal(0, ...ngDevMode ? [{ debugName: "loadKey" }] : /* istanbul ignore next */ []);
72
+ loadKeys = computed(() => this.fullUrl() ? [this.loadKey()] : [], ...ngDevMode ? [{ debugName: "loadKeys" }] : /* istanbul ignore next */ []);
73
+ displayedErrorText = computed(() => this.errorTextOverride() || this.errorText() || "Unable to load document.", ...ngDevMode ? [{ debugName: "displayedErrorText" }] : /* istanbul ignore next */ []);
74
+ overlayClass = computed(() => {
75
+ const overlay = getDisableContentOverlay(this.viewer(), this.disableContent());
76
+ return overlay ? `overlay overlay-${overlay}` : void 0;
77
+ }, ...ngDevMode ? [{ debugName: "overlayClass" }] : /* istanbul ignore next */ []);
78
+ templateContext = computed(() => {
79
+ const state = {
80
+ viewer: this.viewer(),
81
+ url: this.sourceUrl() || this.url(),
82
+ phase: this.renderPhase(),
83
+ errorText: this.displayedErrorText(),
84
+ retry: () => this.retryLoad(),
85
+ actionUrl: this.sourceUrl() || this.url()
86
+ };
87
+ return {
88
+ $implicit: state,
89
+ state
90
+ };
91
+ }, ...ngDevMode ? [{ debugName: "templateContext" }] : /* istanbul ignore next */ []);
92
+ checkIFrameSubscription = void 0;
93
+ googleProbe = void 0;
94
+ recovery = void 0;
95
+ lastEmittedPhase = void 0;
96
+ ngOnDestroy() {
97
+ this.recovery?.dispose();
98
+ this.stopGoogleProbe();
99
+ }
100
+ ngOnChanges(changes) {
101
+ if (changes["viewer"] && !SUPPORTED_VIEWERS.includes(this.viewer())) console.error(`Unsupported viewer: '${this.viewer()}'. Supported viewers: ${SUPPORTED_VIEWERS.join(", ")}`);
102
+ if (SOURCE_INPUTS.some((name) => changes[name] && changes[name].currentValue !== changes[name].previousValue)) this.load();
103
+ }
104
+ retryLoad() {
105
+ this.load();
106
+ }
107
+ iframeLoaded() {
108
+ const iframe = this.iframe()?.nativeElement;
109
+ if (iframe && iframeIsLoaded(iframe)) {
110
+ this.recovery?.notifyLoaded();
111
+ this.checkIFrameSubscription?.unsubscribe();
112
+ this.setRenderPhase("ready");
113
+ }
114
+ }
115
+ objectLoaded() {
116
+ this.recovery?.notifyLoaded();
117
+ this.setRenderPhase("ready");
118
+ }
119
+ load() {
120
+ const loadKey = this.loadKey() + 1;
121
+ const isActive = () => loadKey === this.loadKey();
122
+ this.loadKey.set(loadKey);
123
+ const recovery = this.ensureRecovery();
124
+ this.stopGoogleProbe();
125
+ const url = this.url();
126
+ const viewer = this.viewer();
127
+ const details = resolveViewerDetails({
128
+ url,
129
+ viewer,
130
+ queryParams: this.queryParams(),
131
+ viewerUrl: this.viewerUrl(),
132
+ overrideLocalhost: this.overrideLocalhost()
133
+ });
134
+ recovery.trackSource(details.url);
135
+ this.externalViewer.set(!!url && details.externalViewer);
136
+ this.fullUrl.set(void 0);
137
+ this.docHtml.set("");
138
+ this.errorText.set("");
139
+ this.sourceUrl.set(url);
140
+ if (!url) {
141
+ recovery.clearTimers();
142
+ this.setRenderPhase("idle");
143
+ return;
144
+ }
145
+ this.setRenderPhase("loading");
146
+ if (viewer === "mammoth") {
147
+ recovery.beginInlineLoad(isActive);
148
+ getDocxToHtml(details.url).then((html) => {
149
+ if (!isActive()) return;
150
+ recovery.notifyLoaded();
151
+ this.docHtml.set(html);
152
+ this.setRenderPhase("ready");
153
+ }, (error) => {
154
+ if (!isActive()) return;
155
+ recovery.clearTimers();
156
+ this.errorText.set(error instanceof Error ? error.message : "Unable to load document.");
157
+ this.setRenderPhase("error");
158
+ });
159
+ return;
160
+ }
161
+ this.fullUrl.set(this.domSanitizer.bypassSecurityTrustResourceUrl(details.url));
162
+ if (recovery.beginExternalLoad(isActive).modes.includes("google-probe")) this.startGoogleProbe(isActive);
163
+ }
164
+ ensureRecovery() {
165
+ if (!this.recovery) this.recovery = new ViewerRecoveryController(this.buildRecoveryConfig(), {
166
+ triggerRetry: () => this.retryLoad(),
167
+ reportTimeout: () => {
168
+ if (this.renderPhase() !== "loading") return;
169
+ this.errorText.set(`The ${this.viewer()} viewer did not finish loading in time.`);
170
+ this.setRenderPhase("error");
171
+ }
172
+ });
173
+ this.recovery.configure(this.buildRecoveryConfig());
174
+ return this.recovery;
175
+ }
176
+ buildRecoveryConfig() {
177
+ return {
178
+ viewer: this.viewer(),
179
+ googleCheckContentLoaded: this.googleCheckContentLoaded(),
180
+ googleCheckInterval: this.googleCheckInterval(),
181
+ googleMaxChecks: this.googleMaxChecks(),
182
+ googleFinalRetryDelay: this.googleFinalRetryDelay(),
183
+ officeAutoRetry: this.officeAutoRetry(),
184
+ officeRetryDelay: this.officeRetryDelay()
185
+ };
186
+ }
187
+ startGoogleProbe(isActive) {
188
+ this.googleProbe = afterNextRender(() => {
189
+ this.googleProbe = void 0;
190
+ const iframe = this.iframe()?.nativeElement;
191
+ if (!isActive() || !iframe) return;
192
+ this.checkIFrameSubscription = googleCheckSubscription();
193
+ this.ngZone.runOutsideAngular(() => this.checkIFrameSubscription?.subscribe(iframe, this.googleCheckInterval(), this.googleMaxChecks()));
194
+ }, { injector: this.injector });
195
+ }
196
+ stopGoogleProbe() {
197
+ this.googleProbe?.destroy();
198
+ this.googleProbe = void 0;
199
+ this.checkIFrameSubscription?.unsubscribe();
200
+ this.checkIFrameSubscription = void 0;
201
+ }
202
+ setRenderPhase(phase) {
203
+ this.renderPhase.set(phase);
204
+ if (this.lastEmittedPhase === phase) return;
205
+ this.lastEmittedPhase = phase;
206
+ const { state } = this.templateContext();
207
+ this.phaseChange.emit(state);
208
+ if (phase === "loading") this.loading.emit(state);
209
+ if (phase === "error") this.error.emit(state);
210
+ if (phase === "ready") this.loaded.emit();
211
+ }
212
+ static ɵfac = i0.ɵɵngDeclareFactory({
213
+ minVersion: "12.0.0",
214
+ version: "22.2.3",
215
+ ngImport: i0,
216
+ type: NgxDocViewerComponent,
217
+ deps: [],
218
+ target: i0.ɵɵFactoryTarget.Component
219
+ });
220
+ static ɵcmp = i0.ɵɵngDeclareComponent({
221
+ minVersion: "17.0.0",
222
+ version: "22.2.3",
223
+ type: NgxDocViewerComponent,
224
+ isStandalone: true,
225
+ selector: "ngx-doc-viewer",
226
+ inputs: {
227
+ url: {
228
+ classPropertyName: "url",
229
+ publicName: "url",
230
+ isSignal: true,
231
+ isRequired: false,
232
+ transformFunction: null
233
+ },
234
+ queryParams: {
235
+ classPropertyName: "queryParams",
236
+ publicName: "queryParams",
237
+ isSignal: true,
238
+ isRequired: false,
239
+ transformFunction: null
240
+ },
241
+ viewerUrl: {
242
+ classPropertyName: "viewerUrl",
243
+ publicName: "viewerUrl",
244
+ isSignal: true,
245
+ isRequired: false,
246
+ transformFunction: null
247
+ },
248
+ googleCheckInterval: {
249
+ classPropertyName: "googleCheckInterval",
250
+ publicName: "googleCheckInterval",
251
+ isSignal: true,
252
+ isRequired: false,
253
+ transformFunction: null
254
+ },
255
+ googleMaxChecks: {
256
+ classPropertyName: "googleMaxChecks",
257
+ publicName: "googleMaxChecks",
258
+ isSignal: true,
259
+ isRequired: false,
260
+ transformFunction: null
261
+ },
262
+ googleFinalRetryDelay: {
263
+ classPropertyName: "googleFinalRetryDelay",
264
+ publicName: "googleFinalRetryDelay",
265
+ isSignal: true,
266
+ isRequired: false,
267
+ transformFunction: null
268
+ },
269
+ disableContent: {
270
+ classPropertyName: "disableContent",
271
+ publicName: "disableContent",
272
+ isSignal: true,
273
+ isRequired: false,
274
+ transformFunction: null
275
+ },
276
+ googleCheckContentLoaded: {
277
+ classPropertyName: "googleCheckContentLoaded",
278
+ publicName: "googleCheckContentLoaded",
279
+ isSignal: true,
280
+ isRequired: false,
281
+ transformFunction: null
282
+ },
283
+ viewer: {
284
+ classPropertyName: "viewer",
285
+ publicName: "viewer",
286
+ isSignal: true,
287
+ isRequired: false,
288
+ transformFunction: null
289
+ },
290
+ overrideLocalhost: {
291
+ classPropertyName: "overrideLocalhost",
292
+ publicName: "overrideLocalhost",
293
+ isSignal: true,
294
+ isRequired: false,
295
+ transformFunction: null
296
+ },
297
+ loadingText: {
298
+ classPropertyName: "loadingText",
299
+ publicName: "loadingText",
300
+ isSignal: true,
301
+ isRequired: false,
302
+ transformFunction: null
303
+ },
304
+ errorTextOverride: {
305
+ classPropertyName: "errorTextOverride",
306
+ publicName: "errorTextOverride",
307
+ isSignal: true,
308
+ isRequired: false,
309
+ transformFunction: null
310
+ },
311
+ retryButtonText: {
312
+ classPropertyName: "retryButtonText",
313
+ publicName: "retryButtonText",
314
+ isSignal: true,
315
+ isRequired: false,
316
+ transformFunction: null
317
+ },
318
+ officeAutoRetry: {
319
+ classPropertyName: "officeAutoRetry",
320
+ publicName: "officeAutoRetry",
321
+ isSignal: true,
322
+ isRequired: false,
323
+ transformFunction: null
324
+ },
325
+ officeRetryDelay: {
326
+ classPropertyName: "officeRetryDelay",
327
+ publicName: "officeRetryDelay",
328
+ isSignal: true,
329
+ isRequired: false,
330
+ transformFunction: null
331
+ },
332
+ officeReloadButtonText: {
333
+ classPropertyName: "officeReloadButtonText",
334
+ publicName: "officeReloadButtonText",
335
+ isSignal: true,
336
+ isRequired: false,
337
+ transformFunction: null
338
+ },
339
+ officeReloadButtonTitle: {
340
+ classPropertyName: "officeReloadButtonTitle",
341
+ publicName: "officeReloadButtonTitle",
342
+ isSignal: true,
343
+ isRequired: false,
344
+ transformFunction: null
345
+ },
346
+ secondaryActionText: {
347
+ classPropertyName: "secondaryActionText",
348
+ publicName: "secondaryActionText",
349
+ isSignal: true,
350
+ isRequired: false,
351
+ transformFunction: null
352
+ },
353
+ secondaryActionMode: {
354
+ classPropertyName: "secondaryActionMode",
355
+ publicName: "secondaryActionMode",
356
+ isSignal: true,
357
+ isRequired: false,
358
+ transformFunction: null
359
+ }
360
+ },
361
+ outputs: {
362
+ loaded: "loaded",
363
+ loading: "loading",
364
+ error: "error",
365
+ phaseChange: "phaseChange"
366
+ },
367
+ queries: [
368
+ {
369
+ propertyName: "loadingTemplate",
370
+ first: true,
371
+ predicate: ["loadingContent"],
372
+ descendants: true,
373
+ read: TemplateRef,
374
+ isSignal: true
375
+ },
376
+ {
377
+ propertyName: "errorTemplate",
378
+ first: true,
379
+ predicate: ["errorContent"],
380
+ descendants: true,
381
+ read: TemplateRef,
382
+ isSignal: true
383
+ },
384
+ {
385
+ propertyName: "errorActionsTemplate",
386
+ first: true,
387
+ predicate: ["errorActions"],
388
+ descendants: true,
389
+ read: TemplateRef,
390
+ isSignal: true
391
+ },
392
+ {
393
+ propertyName: "officeReloadTemplate",
394
+ first: true,
395
+ predicate: ["officeReloadContent"],
396
+ descendants: true,
397
+ read: TemplateRef,
398
+ isSignal: true
399
+ }
400
+ ],
401
+ viewQueries: [{
402
+ propertyName: "iframe",
403
+ first: true,
404
+ predicate: ["iframe"],
405
+ descendants: true,
406
+ isSignal: true
407
+ }],
408
+ usesOnChanges: true,
409
+ ngImport: i0,
410
+ template: "<div class=\"container\">\n @if (renderPhase() === 'loading') {\n <div class=\"loading-overlay\">\n @if (loadingTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: templateContext()\" />\n } @else {\n {{ loadingText() }}\n }\n </div>\n }\n @if (renderPhase() === 'error') {\n <div class=\"error-overlay\">\n @if (errorTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: templateContext()\" />\n } @else {\n <div>\n <div>{{ displayedErrorText() }}</div>\n <div class=\"error-viewer\">Viewer: {{ viewer() }}</div>\n @if (sourceUrl()) {\n <div class=\"error-url\">{{ sourceUrl() }}</div>\n }\n @if (errorActionsTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: templateContext()\" />\n } @else {\n <div class=\"error-actions\">\n <button type=\"button\" class=\"retry-btn\" (click)=\"retryLoad()\">\n {{ retryButtonText() }}\n </button>\n @if (secondaryActionText() && sourceUrl()) {\n <a\n class=\"secondary-action-btn\"\n [href]=\"sourceUrl()\"\n [attr.target]=\"secondaryActionMode() === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode() === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode() === 'download' ? '' : null\"\n >\n {{ secondaryActionText() }}\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (externalViewer()) {\n @for (key of loadKeys(); track key) {\n <iframe\n #iframe\n class=\"ngx-doc-viewer-iframe\"\n title=\"Document viewer\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl()\"\n (load)=\"iframeLoaded()\"\n ></iframe>\n }\n @if (overlayClass(); as overlay) {\n <div\n [class]=\"overlay\"\n [style.background-color]=\"disableContent() === 'popout-hide' ? '#fff' : 'transparent'\"\n ></div>\n }\n } @else if (viewer() === 'pdf') {\n @for (key of loadKeys(); track key) {\n <object\n class=\"ngx-doc-viewer-object\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n [data]=\"fullUrl()\"\n (load)=\"objectLoaded()\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl()\">Download the PDF</a>.\n </p>\n </object>\n }\n } @else {\n <div class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml()\"></div>\n </div>\n }\n\n @if (viewer() === 'office' && renderPhase() === 'ready') {\n <button\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle()\"\n (click)=\"retryLoad()\"\n >\n @if (officeReloadTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: templateContext()\" />\n } @else {\n {{ officeReloadButtonText() }}\n }\n </button>\n }\n</div>\n",
411
+ styles: [":host{display:block}.container{width:100%;height:100%;position:relative}.inline-document-shell{width:100%;height:100%;overflow:auto;background:linear-gradient(180deg,#eef2f7,#f8fafc);padding:24px}.inline-document-page{max-width:900px;min-height:100%;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:18px;box-shadow:0 18px 40px -24px #0f172a4d,0 6px 18px -10px #0f172a2e;padding:40px 48px}.inline-document-page,.inline-document-page *{box-sizing:border-box}.inline-document-page{color:#1e293b;font-family:Georgia,Cambria,Times New Roman,Times,serif;font-size:18px;line-height:1.7}.inline-document-page p,.inline-document-page ul,.inline-document-page ol,.inline-document-page blockquote,.inline-document-page table{margin:0 0 1.1em}.inline-document-page h1,.inline-document-page h2,.inline-document-page h3,.inline-document-page h4,.inline-document-page h5,.inline-document-page h6{margin:1.4em 0 .65em;color:#0f172a;line-height:1.25}.inline-document-page h1:first-child,.inline-document-page h2:first-child,.inline-document-page h3:first-child,.inline-document-page p:first-child{margin-top:0}.inline-document-page table{width:100%;border-collapse:collapse}.inline-document-page td,.inline-document-page th{padding:6px 10px;vertical-align:top}.inline-document-page img{max-width:100%;height:auto}.inline-document-page hr{border:0;border-top:1px solid #dbe4f0;margin:1.5em 0}.loading-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#ffffffe0;color:#475569;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#fffffff0;color:#991b1b;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-viewer{margin-top:8px;color:#475569}.error-url{margin-top:4px;color:#64748b;font-size:12px;word-break:break-word}.error-actions{margin-top:14px;display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.retry-btn{border:1px solid #fecaca;background:#fff;color:#991b1b;border-radius:999px;padding:8px 14px;font:inherit;cursor:pointer}.secondary-action-btn{border:1px solid #cbd5e1;background:#fff;color:#334155;border-radius:999px;padding:8px 14px;text-decoration:none;font:inherit}.overlay{position:absolute;z-index:1000}.overlay-popout-google{width:40px;height:40px;right:26px;top:11.5px}.overlay-popout-office{width:100px;height:20px;right:0;bottom:0}.overlay-full{width:100%;height:100%;right:0;top:0}.office-reload-btn{position:absolute;top:8px;right:8px;z-index:1001;width:32px;height:32px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#ffffffd9;color:#475569;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.5;transition:opacity .15s;padding:0}.office-reload-btn:hover{opacity:1}iframe,object{display:block;width:100%;height:100%}@media(max-width:768px){.inline-document-shell{padding:12px}.inline-document-page{border-radius:12px;padding:22px 18px}}\n"],
412
+ dependencies: [{
413
+ kind: "directive",
414
+ type: NgTemplateOutlet,
415
+ selector: "[ngTemplateOutlet]",
416
+ inputs: [
417
+ "ngTemplateOutletContext",
418
+ "ngTemplateOutlet",
419
+ "ngTemplateOutletInjector"
420
+ ]
421
+ }]
422
+ });
423
+ };
424
+ i0.ɵɵngDeclareClassMetadata({
425
+ minVersion: "12.0.0",
426
+ version: "22.2.3",
427
+ ngImport: i0,
428
+ type: NgxDocViewerComponent,
429
+ decorators: [{
430
+ type: Component,
431
+ args: [{
432
+ selector: "ngx-doc-viewer",
433
+ standalone: true,
434
+ imports: [NgTemplateOutlet],
435
+ template: "<div class=\"container\">\n @if (renderPhase() === 'loading') {\n <div class=\"loading-overlay\">\n @if (loadingTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: templateContext()\" />\n } @else {\n {{ loadingText() }}\n }\n </div>\n }\n @if (renderPhase() === 'error') {\n <div class=\"error-overlay\">\n @if (errorTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: templateContext()\" />\n } @else {\n <div>\n <div>{{ displayedErrorText() }}</div>\n <div class=\"error-viewer\">Viewer: {{ viewer() }}</div>\n @if (sourceUrl()) {\n <div class=\"error-url\">{{ sourceUrl() }}</div>\n }\n @if (errorActionsTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: templateContext()\" />\n } @else {\n <div class=\"error-actions\">\n <button type=\"button\" class=\"retry-btn\" (click)=\"retryLoad()\">\n {{ retryButtonText() }}\n </button>\n @if (secondaryActionText() && sourceUrl()) {\n <a\n class=\"secondary-action-btn\"\n [href]=\"sourceUrl()\"\n [attr.target]=\"secondaryActionMode() === 'open' ? '_blank' : null\"\n [attr.rel]=\"secondaryActionMode() === 'open' ? 'noreferrer' : null\"\n [attr.download]=\"secondaryActionMode() === 'download' ? '' : null\"\n >\n {{ secondaryActionText() }}\n </a>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n @if (externalViewer()) {\n @for (key of loadKeys(); track key) {\n <iframe\n #iframe\n class=\"ngx-doc-viewer-iframe\"\n title=\"Document viewer\"\n frameBorder=\"0\"\n allow=\"clipboard-read; clipboard-write\"\n [src]=\"fullUrl()\"\n (load)=\"iframeLoaded()\"\n ></iframe>\n }\n @if (overlayClass(); as overlay) {\n <div\n [class]=\"overlay\"\n [style.background-color]=\"disableContent() === 'popout-hide' ? '#fff' : 'transparent'\"\n ></div>\n }\n } @else if (viewer() === 'pdf') {\n @for (key of loadKeys(); track key) {\n <object\n class=\"ngx-doc-viewer-object\"\n type=\"application/pdf\"\n width=\"100%\"\n height=\"100%\"\n [data]=\"fullUrl()\"\n (load)=\"objectLoaded()\"\n >\n <p>\n Your browser does not support PDFs.\n <a [href]=\"fullUrl()\">Download the PDF</a>.\n </p>\n </object>\n }\n } @else {\n <div class=\"inline-document-shell\">\n <div class=\"inline-document-page\" [innerHTML]=\"docHtml()\"></div>\n </div>\n }\n\n @if (viewer() === 'office' && renderPhase() === 'ready') {\n <button\n class=\"office-reload-btn\"\n type=\"button\"\n [attr.title]=\"officeReloadButtonTitle()\"\n (click)=\"retryLoad()\"\n >\n @if (officeReloadTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: templateContext()\" />\n } @else {\n {{ officeReloadButtonText() }}\n }\n </button>\n }\n</div>\n",
436
+ styles: [":host{display:block}.container{width:100%;height:100%;position:relative}.inline-document-shell{width:100%;height:100%;overflow:auto;background:linear-gradient(180deg,#eef2f7,#f8fafc);padding:24px}.inline-document-page{max-width:900px;min-height:100%;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:18px;box-shadow:0 18px 40px -24px #0f172a4d,0 6px 18px -10px #0f172a2e;padding:40px 48px}.inline-document-page,.inline-document-page *{box-sizing:border-box}.inline-document-page{color:#1e293b;font-family:Georgia,Cambria,Times New Roman,Times,serif;font-size:18px;line-height:1.7}.inline-document-page p,.inline-document-page ul,.inline-document-page ol,.inline-document-page blockquote,.inline-document-page table{margin:0 0 1.1em}.inline-document-page h1,.inline-document-page h2,.inline-document-page h3,.inline-document-page h4,.inline-document-page h5,.inline-document-page h6{margin:1.4em 0 .65em;color:#0f172a;line-height:1.25}.inline-document-page h1:first-child,.inline-document-page h2:first-child,.inline-document-page h3:first-child,.inline-document-page p:first-child{margin-top:0}.inline-document-page table{width:100%;border-collapse:collapse}.inline-document-page td,.inline-document-page th{padding:6px 10px;vertical-align:top}.inline-document-page img{max-width:100%;height:auto}.inline-document-page hr{border:0;border-top:1px solid #dbe4f0;margin:1.5em 0}.loading-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#ffffffe0;color:#475569;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-overlay{position:absolute;inset:0;z-index:1001;display:flex;align-items:center;justify-content:center;background:#fffffff0;color:#991b1b;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;padding:16px}.error-viewer{margin-top:8px;color:#475569}.error-url{margin-top:4px;color:#64748b;font-size:12px;word-break:break-word}.error-actions{margin-top:14px;display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.retry-btn{border:1px solid #fecaca;background:#fff;color:#991b1b;border-radius:999px;padding:8px 14px;font:inherit;cursor:pointer}.secondary-action-btn{border:1px solid #cbd5e1;background:#fff;color:#334155;border-radius:999px;padding:8px 14px;text-decoration:none;font:inherit}.overlay{position:absolute;z-index:1000}.overlay-popout-google{width:40px;height:40px;right:26px;top:11.5px}.overlay-popout-office{width:100px;height:20px;right:0;bottom:0}.overlay-full{width:100%;height:100%;right:0;top:0}.office-reload-btn{position:absolute;top:8px;right:8px;z-index:1001;width:32px;height:32px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#ffffffd9;color:#475569;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.5;transition:opacity .15s;padding:0}.office-reload-btn:hover{opacity:1}iframe,object{display:block;width:100%;height:100%}@media(max-width:768px){.inline-document-shell{padding:12px}.inline-document-page{border-radius:12px;padding:22px 18px}}\n"]
437
+ }]
438
+ }],
439
+ propDecorators: {
440
+ loaded: [{
441
+ type: i0.Output,
442
+ args: ["loaded"]
443
+ }],
444
+ loading: [{
445
+ type: i0.Output,
446
+ args: ["loading"]
447
+ }],
448
+ error: [{
449
+ type: i0.Output,
450
+ args: ["error"]
451
+ }],
452
+ phaseChange: [{
453
+ type: i0.Output,
454
+ args: ["phaseChange"]
455
+ }],
456
+ url: [{
457
+ type: i0.Input,
458
+ args: [{
459
+ isSignal: true,
460
+ alias: "url",
461
+ required: false
462
+ }]
463
+ }],
464
+ queryParams: [{
465
+ type: i0.Input,
466
+ args: [{
467
+ isSignal: true,
468
+ alias: "queryParams",
469
+ required: false
470
+ }]
471
+ }],
472
+ viewerUrl: [{
473
+ type: i0.Input,
474
+ args: [{
475
+ isSignal: true,
476
+ alias: "viewerUrl",
477
+ required: false
478
+ }]
479
+ }],
480
+ googleCheckInterval: [{
481
+ type: i0.Input,
482
+ args: [{
483
+ isSignal: true,
484
+ alias: "googleCheckInterval",
485
+ required: false
486
+ }]
487
+ }],
488
+ googleMaxChecks: [{
489
+ type: i0.Input,
490
+ args: [{
491
+ isSignal: true,
492
+ alias: "googleMaxChecks",
493
+ required: false
494
+ }]
495
+ }],
496
+ googleFinalRetryDelay: [{
497
+ type: i0.Input,
498
+ args: [{
499
+ isSignal: true,
500
+ alias: "googleFinalRetryDelay",
501
+ required: false
502
+ }]
503
+ }],
504
+ disableContent: [{
505
+ type: i0.Input,
506
+ args: [{
507
+ isSignal: true,
508
+ alias: "disableContent",
509
+ required: false
510
+ }]
511
+ }],
512
+ googleCheckContentLoaded: [{
513
+ type: i0.Input,
514
+ args: [{
515
+ isSignal: true,
516
+ alias: "googleCheckContentLoaded",
517
+ required: false
518
+ }]
519
+ }],
520
+ viewer: [{
521
+ type: i0.Input,
522
+ args: [{
523
+ isSignal: true,
524
+ alias: "viewer",
525
+ required: false
526
+ }]
527
+ }],
528
+ overrideLocalhost: [{
529
+ type: i0.Input,
530
+ args: [{
531
+ isSignal: true,
532
+ alias: "overrideLocalhost",
533
+ required: false
534
+ }]
535
+ }],
536
+ loadingText: [{
537
+ type: i0.Input,
538
+ args: [{
539
+ isSignal: true,
540
+ alias: "loadingText",
541
+ required: false
542
+ }]
543
+ }],
544
+ errorTextOverride: [{
545
+ type: i0.Input,
546
+ args: [{
547
+ isSignal: true,
548
+ alias: "errorTextOverride",
549
+ required: false
550
+ }]
551
+ }],
552
+ retryButtonText: [{
553
+ type: i0.Input,
554
+ args: [{
555
+ isSignal: true,
556
+ alias: "retryButtonText",
557
+ required: false
558
+ }]
559
+ }],
560
+ officeAutoRetry: [{
561
+ type: i0.Input,
562
+ args: [{
563
+ isSignal: true,
564
+ alias: "officeAutoRetry",
565
+ required: false
566
+ }]
567
+ }],
568
+ officeRetryDelay: [{
569
+ type: i0.Input,
570
+ args: [{
571
+ isSignal: true,
572
+ alias: "officeRetryDelay",
573
+ required: false
574
+ }]
575
+ }],
576
+ officeReloadButtonText: [{
577
+ type: i0.Input,
578
+ args: [{
579
+ isSignal: true,
580
+ alias: "officeReloadButtonText",
581
+ required: false
582
+ }]
583
+ }],
584
+ officeReloadButtonTitle: [{
585
+ type: i0.Input,
586
+ args: [{
587
+ isSignal: true,
588
+ alias: "officeReloadButtonTitle",
589
+ required: false
590
+ }]
591
+ }],
592
+ secondaryActionText: [{
593
+ type: i0.Input,
594
+ args: [{
595
+ isSignal: true,
596
+ alias: "secondaryActionText",
597
+ required: false
598
+ }]
599
+ }],
600
+ secondaryActionMode: [{
601
+ type: i0.Input,
602
+ args: [{
603
+ isSignal: true,
604
+ alias: "secondaryActionMode",
605
+ required: false
606
+ }]
607
+ }],
608
+ loadingTemplate: [{
609
+ type: i0.ContentChild,
610
+ args: ["loadingContent", {
611
+ read: TemplateRef,
612
+ isSignal: true
613
+ }]
614
+ }],
615
+ errorTemplate: [{
616
+ type: i0.ContentChild,
617
+ args: ["errorContent", {
618
+ read: TemplateRef,
619
+ isSignal: true
620
+ }]
621
+ }],
622
+ errorActionsTemplate: [{
623
+ type: i0.ContentChild,
624
+ args: ["errorActions", {
625
+ read: TemplateRef,
626
+ isSignal: true
627
+ }]
628
+ }],
629
+ officeReloadTemplate: [{
630
+ type: i0.ContentChild,
631
+ args: ["officeReloadContent", {
632
+ read: TemplateRef,
633
+ isSignal: true
634
+ }]
635
+ }],
636
+ iframe: [{
637
+ type: i0.ViewChild,
638
+ args: ["iframe", { isSignal: true }]
639
+ }]
640
+ }
641
+ });
642
+ var NgxDocViewerModule = class NgxDocViewerModule {
643
+ static ɵfac = i0.ɵɵngDeclareFactory({
644
+ minVersion: "12.0.0",
645
+ version: "22.2.3",
646
+ ngImport: i0,
647
+ type: NgxDocViewerModule,
648
+ deps: [],
649
+ target: i0.ɵɵFactoryTarget.NgModule
650
+ });
651
+ static ɵmod = i0.ɵɵngDeclareNgModule({
652
+ minVersion: "14.0.0",
653
+ version: "22.2.3",
654
+ ngImport: i0,
655
+ type: NgxDocViewerModule,
656
+ imports: [CommonModule, NgxDocViewerComponent],
657
+ exports: [NgxDocViewerComponent]
658
+ });
659
+ static ɵinj = i0.ɵɵngDeclareInjector({
660
+ minVersion: "12.0.0",
661
+ version: "22.2.3",
662
+ ngImport: i0,
663
+ type: NgxDocViewerModule,
664
+ imports: [CommonModule]
665
+ });
666
+ };
667
+ i0.ɵɵngDeclareClassMetadata({
668
+ minVersion: "12.0.0",
669
+ version: "22.2.3",
670
+ ngImport: i0,
671
+ type: NgxDocViewerModule,
672
+ decorators: [{
673
+ type: NgModule,
674
+ args: [{
675
+ imports: [CommonModule, NgxDocViewerComponent],
676
+ exports: [NgxDocViewerComponent]
677
+ }]
678
+ }]
679
+ });
516
680
  export { NgxDocViewerComponent, NgxDocViewerModule };
517
- //# sourceMappingURL=ngx-doc-viewer.mjs.map
681
+
682
+ //# sourceMappingURL=ngx-doc-viewer.mjs.map