@memberjunction/ng-explorer-core 6.3.0-edge.0 → 6.3.0-edge.1

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.
Files changed (117) hide show
  1. package/dist/app-routing.module.d.ts.map +1 -1
  2. package/dist/app-routing.module.js +42 -7
  3. package/dist/app-routing.module.js.map +1 -1
  4. package/dist/generated/lazy-feature-config.d.ts +1 -1
  5. package/dist/generated/lazy-feature-config.d.ts.map +1 -1
  6. package/dist/generated/lazy-feature-config.js +55 -3
  7. package/dist/generated/lazy-feature-config.js.map +1 -1
  8. package/dist/lib/about/about-dialog.component.d.ts +2 -0
  9. package/dist/lib/about/about-dialog.component.d.ts.map +1 -1
  10. package/dist/lib/about/about-dialog.component.js +11 -2
  11. package/dist/lib/about/about-dialog.component.js.map +1 -1
  12. package/dist/lib/guards/moved-nav-item-redirect.d.ts +10 -0
  13. package/dist/lib/guards/moved-nav-item-redirect.d.ts.map +1 -1
  14. package/dist/lib/guards/moved-nav-item-redirect.js +20 -0
  15. package/dist/lib/guards/moved-nav-item-redirect.js.map +1 -1
  16. package/dist/lib/omnibar/index.d.ts +1 -0
  17. package/dist/lib/omnibar/index.d.ts.map +1 -1
  18. package/dist/lib/omnibar/index.js +1 -0
  19. package/dist/lib/omnibar/index.js.map +1 -1
  20. package/dist/lib/omnibar/omnibar-palette.component.d.ts +2 -0
  21. package/dist/lib/omnibar/omnibar-palette.component.d.ts.map +1 -1
  22. package/dist/lib/omnibar/omnibar-palette.component.js +49 -1
  23. package/dist/lib/omnibar/omnibar-palette.component.js.map +1 -1
  24. package/dist/lib/omnibar/omnibar-provider.d.ts +6 -0
  25. package/dist/lib/omnibar/omnibar-provider.d.ts.map +1 -1
  26. package/dist/lib/omnibar/omnibar-provider.js.map +1 -1
  27. package/dist/lib/omnibar/omnibar-semantic-index.service.d.ts +106 -0
  28. package/dist/lib/omnibar/omnibar-semantic-index.service.d.ts.map +1 -0
  29. package/dist/lib/omnibar/omnibar-semantic-index.service.js +362 -0
  30. package/dist/lib/omnibar/omnibar-semantic-index.service.js.map +1 -0
  31. package/dist/lib/omnibar/providers/omnibar-search.provider.d.ts +9 -0
  32. package/dist/lib/omnibar/providers/omnibar-search.provider.d.ts.map +1 -1
  33. package/dist/lib/omnibar/providers/omnibar-search.provider.js +75 -8
  34. package/dist/lib/omnibar/providers/omnibar-search.provider.js.map +1 -1
  35. package/dist/lib/profile/profile-dialog.component.js +4 -4
  36. package/dist/lib/profile/profile-dialog.component.js.map +1 -1
  37. package/dist/lib/public-guest/public-artifact-guest.component.d.ts +94 -0
  38. package/dist/lib/public-guest/public-artifact-guest.component.d.ts.map +1 -0
  39. package/dist/lib/public-guest/public-artifact-guest.component.js +691 -0
  40. package/dist/lib/public-guest/public-artifact-guest.component.js.map +1 -0
  41. package/dist/lib/resource-wrappers/artifact-resource.component.d.ts +31 -4
  42. package/dist/lib/resource-wrappers/artifact-resource.component.d.ts.map +1 -1
  43. package/dist/lib/resource-wrappers/artifact-resource.component.js +154 -20
  44. package/dist/lib/resource-wrappers/artifact-resource.component.js.map +1 -1
  45. package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts +9 -190
  46. package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts.map +1 -1
  47. package/dist/lib/resource-wrappers/chat-collections-resource.component.js +40 -580
  48. package/dist/lib/resource-wrappers/chat-collections-resource.component.js.map +1 -1
  49. package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts +10 -1
  50. package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts.map +1 -1
  51. package/dist/lib/resource-wrappers/chat-conversations-resource.component.js +95 -18
  52. package/dist/lib/resource-wrappers/chat-conversations-resource.component.js.map +1 -1
  53. package/dist/lib/resource-wrappers/chat-export-artifact-link.d.ts +17 -0
  54. package/dist/lib/resource-wrappers/chat-export-artifact-link.d.ts.map +1 -0
  55. package/dist/lib/resource-wrappers/chat-export-artifact-link.js +28 -0
  56. package/dist/lib/resource-wrappers/chat-export-artifact-link.js.map +1 -0
  57. package/dist/lib/resource-wrappers/chat-search-routing.d.ts +1 -1
  58. package/dist/lib/resource-wrappers/chat-search-routing.d.ts.map +1 -1
  59. package/dist/lib/resource-wrappers/chat-search-routing.js +2 -2
  60. package/dist/lib/resource-wrappers/chat-search-routing.js.map +1 -1
  61. package/dist/lib/resource-wrappers/chat-tasks-resource.component.d.ts +20 -10
  62. package/dist/lib/resource-wrappers/chat-tasks-resource.component.d.ts.map +1 -1
  63. package/dist/lib/resource-wrappers/chat-tasks-resource.component.js +43 -21
  64. package/dist/lib/resource-wrappers/chat-tasks-resource.component.js.map +1 -1
  65. package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts +1 -1
  66. package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts.map +1 -1
  67. package/dist/lib/resource-wrappers/dashboard-resource.component.js +2 -2
  68. package/dist/lib/resource-wrappers/dashboard-resource.component.js.map +1 -1
  69. package/dist/lib/resource-wrappers/human-handoff-console-resource.component.js +3 -3
  70. package/dist/lib/resource-wrappers/library-agent-context.d.ts +42 -0
  71. package/dist/lib/resource-wrappers/library-agent-context.d.ts.map +1 -0
  72. package/dist/lib/resource-wrappers/library-agent-context.js +296 -0
  73. package/dist/lib/resource-wrappers/library-agent-context.js.map +1 -0
  74. package/dist/lib/resource-wrappers/library-resource.component.d.ts +58 -0
  75. package/dist/lib/resource-wrappers/library-resource.component.d.ts.map +1 -0
  76. package/dist/lib/resource-wrappers/library-resource.component.js +326 -0
  77. package/dist/lib/resource-wrappers/library-resource.component.js.map +1 -0
  78. package/dist/lib/resource-wrappers/livekit-lazy-config.d.ts +8 -0
  79. package/dist/lib/resource-wrappers/livekit-lazy-config.d.ts.map +1 -0
  80. package/dist/lib/resource-wrappers/livekit-lazy-config.js +17 -0
  81. package/dist/lib/resource-wrappers/livekit-lazy-config.js.map +1 -0
  82. package/dist/lib/resource-wrappers/livekit-resources.module.d.ts +23 -0
  83. package/dist/lib/resource-wrappers/livekit-resources.module.d.ts.map +1 -0
  84. package/dist/lib/resource-wrappers/livekit-resources.module.js +68 -0
  85. package/dist/lib/resource-wrappers/livekit-resources.module.js.map +1 -0
  86. package/dist/lib/shell/components/header/app-switcher.component.js +2 -2
  87. package/dist/lib/shell/components/header/app-switcher.component.js.map +1 -1
  88. package/dist/lib/shell/components/tabs/component-cache-manager.d.ts +7 -0
  89. package/dist/lib/shell/components/tabs/component-cache-manager.d.ts.map +1 -1
  90. package/dist/lib/shell/components/tabs/component-cache-manager.js +14 -5
  91. package/dist/lib/shell/components/tabs/component-cache-manager.js.map +1 -1
  92. package/dist/lib/shell/components/tabs/tab-container.component.d.ts +41 -0
  93. package/dist/lib/shell/components/tabs/tab-container.component.d.ts.map +1 -1
  94. package/dist/lib/shell/components/tabs/tab-container.component.js +198 -3
  95. package/dist/lib/shell/components/tabs/tab-container.component.js.map +1 -1
  96. package/dist/lib/shell/services/sharing-center-dialog-host.component.d.ts.map +1 -1
  97. package/dist/lib/shell/services/sharing-center-dialog-host.component.js +2 -1
  98. package/dist/lib/shell/services/sharing-center-dialog-host.component.js.map +1 -1
  99. package/dist/lib/shell/shell.component.d.ts.map +1 -1
  100. package/dist/lib/shell/shell.component.js +26 -8
  101. package/dist/lib/shell/shell.component.js.map +1 -1
  102. package/dist/lib/shell/shell.module.d.ts +2 -2
  103. package/dist/lib/shell/shell.module.js +4 -4
  104. package/dist/lib/shell/shell.module.js.map +1 -1
  105. package/dist/lib/user-notifications/user-notifications.component.d.ts +13 -0
  106. package/dist/lib/user-notifications/user-notifications.component.d.ts.map +1 -1
  107. package/dist/lib/user-notifications/user-notifications.component.js +35 -9
  108. package/dist/lib/user-notifications/user-notifications.component.js.map +1 -1
  109. package/dist/module.d.ts +57 -63
  110. package/dist/module.d.ts.map +1 -1
  111. package/dist/module.js +21 -45
  112. package/dist/module.js.map +1 -1
  113. package/dist/public-api.d.ts +5 -1
  114. package/dist/public-api.d.ts.map +1 -1
  115. package/dist/public-api.js +5 -1
  116. package/dist/public-api.js.map +1 -1
  117. package/package.json +60 -59
@@ -0,0 +1,691 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, inject } from '@angular/core';
2
+ import { ActivatedRoute } from '@angular/router';
3
+ import { MJArtifactVersionEntity } from '@memberjunction/core-entities';
4
+ import { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';
5
+ import { BaseAngularComponent } from '@memberjunction/ng-base-types';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "@memberjunction/ng-artifacts";
8
+ function PublicArtifactGuestComponent_Conditional_6_Conditional_5_Template(rf, ctx) { if (rf & 1) {
9
+ i0.ɵɵelementStart(0, "span");
10
+ i0.ɵɵtext(1);
11
+ i0.ɵɵelementEnd();
12
+ } if (rf & 2) {
13
+ const ctx_r0 = i0.ɵɵnextContext(2);
14
+ i0.ɵɵadvance();
15
+ i0.ɵɵtextInterpolate1("v", ctx_r0.Payload.VersionNumber);
16
+ } }
17
+ function PublicArtifactGuestComponent_Conditional_6_Conditional_6_Template(rf, ctx) { if (rf & 1) {
18
+ i0.ɵɵelementStart(0, "span", 14);
19
+ i0.ɵɵtext(1);
20
+ i0.ɵɵelementEnd();
21
+ } if (rf & 2) {
22
+ const ctx_r0 = i0.ɵɵnextContext(2);
23
+ i0.ɵɵadvance();
24
+ i0.ɵɵtextInterpolate(ctx_r0.Payload.ArtifactTypeName);
25
+ } }
26
+ function PublicArtifactGuestComponent_Conditional_6_Conditional_7_Template(rf, ctx) { if (rf & 1) {
27
+ i0.ɵɵelementStart(0, "span", 14);
28
+ i0.ɵɵtext(1);
29
+ i0.ɵɵelementEnd();
30
+ } if (rf & 2) {
31
+ const ctx_r0 = i0.ɵɵnextContext(2);
32
+ i0.ɵɵadvance();
33
+ i0.ɵɵtextInterpolate(ctx_r0.Payload.Label);
34
+ } }
35
+ function PublicArtifactGuestComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
36
+ i0.ɵɵelementStart(0, "h1", 5);
37
+ i0.ɵɵtext(1);
38
+ i0.ɵɵelementEnd();
39
+ i0.ɵɵelementStart(2, "span", 14);
40
+ i0.ɵɵelement(3, "i", 15);
41
+ i0.ɵɵtext(4);
42
+ i0.ɵɵconditionalCreate(5, PublicArtifactGuestComponent_Conditional_6_Conditional_5_Template, 2, 1, "span");
43
+ i0.ɵɵelementEnd();
44
+ i0.ɵɵconditionalCreate(6, PublicArtifactGuestComponent_Conditional_6_Conditional_6_Template, 2, 1, "span", 14);
45
+ i0.ɵɵconditionalCreate(7, PublicArtifactGuestComponent_Conditional_6_Conditional_7_Template, 2, 1, "span", 14);
46
+ } if (rf & 2) {
47
+ const ctx_r0 = i0.ɵɵnextContext();
48
+ i0.ɵɵadvance();
49
+ i0.ɵɵtextInterpolate(ctx_r0.DisplayTitle);
50
+ i0.ɵɵadvance(3);
51
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.Payload.ShareMode || "Frozen", " ");
52
+ i0.ɵɵadvance();
53
+ i0.ɵɵconditional(ctx_r0.Payload.VersionNumber != null ? 5 : -1);
54
+ i0.ɵɵadvance();
55
+ i0.ɵɵconditional(ctx_r0.Payload.ArtifactTypeName ? 6 : -1);
56
+ i0.ɵɵadvance();
57
+ i0.ɵɵconditional(ctx_r0.Payload.Label ? 7 : -1);
58
+ } }
59
+ function PublicArtifactGuestComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
60
+ i0.ɵɵelementStart(0, "h1", 5);
61
+ i0.ɵɵtext(1, "Shared Artifact");
62
+ i0.ɵɵelementEnd();
63
+ } }
64
+ function PublicArtifactGuestComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
65
+ i0.ɵɵelementStart(0, "span", 7);
66
+ i0.ɵɵelement(1, "i", 16);
67
+ i0.ɵɵtext(2);
68
+ i0.ɵɵelementEnd();
69
+ } if (rf & 2) {
70
+ const ctx_r0 = i0.ɵɵnextContext();
71
+ i0.ɵɵadvance(2);
72
+ i0.ɵɵtextInterpolate1(" Expires ", ctx_r0.FormattedExpiresAt, " ");
73
+ } }
74
+ function PublicArtifactGuestComponent_Conditional_14_Template(rf, ctx) { if (rf & 1) {
75
+ i0.ɵɵelementStart(0, "div", 11);
76
+ i0.ɵɵelement(1, "i", 17);
77
+ i0.ɵɵelementStart(2, "h2", 18);
78
+ i0.ɵɵtext(3, "Loading shared artifact...");
79
+ i0.ɵɵelementEnd();
80
+ i0.ɵɵelementStart(4, "p", 19);
81
+ i0.ɵɵtext(5, "Verifying external guest link and preparing frozen snapshot.");
82
+ i0.ɵɵelementEnd()();
83
+ } }
84
+ function PublicArtifactGuestComponent_Conditional_15_Template(rf, ctx) { if (rf & 1) {
85
+ const _r2 = i0.ɵɵgetCurrentView();
86
+ i0.ɵɵelementStart(0, "div", 12);
87
+ i0.ɵɵelement(1, "i", 20);
88
+ i0.ɵɵelementStart(2, "div", 21)(3, "h2", 22);
89
+ i0.ɵɵtext(4);
90
+ i0.ɵɵelementEnd();
91
+ i0.ɵɵelementStart(5, "p", 23);
92
+ i0.ɵɵtext(6);
93
+ i0.ɵɵelementEnd();
94
+ i0.ɵɵelementStart(7, "div", 24)(8, "button", 25);
95
+ i0.ɵɵlistener("click", function PublicArtifactGuestComponent_Conditional_15_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.Retry()); });
96
+ i0.ɵɵelement(9, "i", 26);
97
+ i0.ɵɵtext(10, " Retry ");
98
+ i0.ɵɵelementEnd()()()();
99
+ } if (rf & 2) {
100
+ const ctx_r0 = i0.ɵɵnextContext();
101
+ i0.ɵɵadvance();
102
+ i0.ɵɵclassMap(ctx_r0.ErrorIcon + " guest-error-icon");
103
+ i0.ɵɵadvance(3);
104
+ i0.ɵɵtextInterpolate(ctx_r0.ErrorTitle);
105
+ i0.ɵɵadvance(2);
106
+ i0.ɵɵtextInterpolate(ctx_r0.ErrorMessage);
107
+ } }
108
+ function PublicArtifactGuestComponent_Conditional_16_Conditional_1_Template(rf, ctx) { if (rf & 1) {
109
+ const _r3 = i0.ɵɵgetCurrentView();
110
+ i0.ɵɵelementStart(0, "mj-artifact-type-plugin-viewer", 29);
111
+ i0.ɵɵlistener("PluginLoaded", function PublicArtifactGuestComponent_Conditional_16_Conditional_1_Template_mj_artifact_type_plugin_viewer_PluginLoaded_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.OnPluginLoaded()); });
112
+ i0.ɵɵelementEnd();
113
+ } if (rf & 2) {
114
+ const ctx_r0 = i0.ɵɵnextContext(2);
115
+ i0.ɵɵproperty("artifactVersion", ctx_r0.GuestArtifactVersion)("ArtifactTypeName", ctx_r0.Payload.ArtifactTypeName || "Markdown Document")("DriverClass", ctx_r0.Payload.DriverClass || undefined)("PreVerifiedFrozenSnapshots", ctx_r0.PreVerifiedFrozenSnapshots)("GuestSnapshotMode", true)("readonly", true);
116
+ } }
117
+ function PublicArtifactGuestComponent_Conditional_16_Conditional_2_Template(rf, ctx) { if (rf & 1) {
118
+ i0.ɵɵelementStart(0, "pre", 28);
119
+ i0.ɵɵtext(1);
120
+ i0.ɵɵelementEnd();
121
+ } if (rf & 2) {
122
+ const ctx_r0 = i0.ɵɵnextContext(2);
123
+ i0.ɵɵadvance();
124
+ i0.ɵɵtextInterpolate(ctx_r0.SanitizedFallbackContent);
125
+ } }
126
+ function PublicArtifactGuestComponent_Conditional_16_Template(rf, ctx) { if (rf & 1) {
127
+ i0.ɵɵelementStart(0, "div", 13);
128
+ i0.ɵɵconditionalCreate(1, PublicArtifactGuestComponent_Conditional_16_Conditional_1_Template, 1, 6, "mj-artifact-type-plugin-viewer", 27)(2, PublicArtifactGuestComponent_Conditional_16_Conditional_2_Template, 2, 1, "pre", 28);
129
+ i0.ɵɵelementEnd();
130
+ } if (rf & 2) {
131
+ const ctx_r0 = i0.ɵɵnextContext();
132
+ i0.ɵɵadvance();
133
+ i0.ɵɵconditional(!ctx_r0.ViewerFallbackOnly ? 1 : 2);
134
+ } }
135
+ /**
136
+ * Converts server-verified `FrozenProvenance` records into the flat lookup map
137
+ * expected by `[PreVerifiedFrozenSnapshots]` on `<mj-artifact-type-plugin-viewer>`.
138
+ */
139
+ export function BuildPreVerifiedFrozenSnapshotsMap(items) {
140
+ if (!items || items.length === 0) {
141
+ return null;
142
+ }
143
+ const map = {};
144
+ for (const item of items) {
145
+ const entry = {
146
+ Verified: Boolean(item.SnapshotVerified),
147
+ FrozenByUserName: item.FrozenByUserName || undefined,
148
+ FrozenAt: item.FrozenAt || undefined,
149
+ };
150
+ const exactKeys = [
151
+ item.TargetID,
152
+ item.BlockID,
153
+ item.LiveTableID,
154
+ item.RegionID,
155
+ item.SlideID && item.RegionID ? `${item.SlideID}:${item.RegionID}` : undefined,
156
+ ];
157
+ for (const rawKey of exactKeys) {
158
+ const key = typeof rawKey === 'string' ? rawKey.trim() : '';
159
+ if (key) {
160
+ const existing = map[key];
161
+ map[key] = existing
162
+ ? {
163
+ ...entry,
164
+ Verified: existing.Verified && entry.Verified,
165
+ }
166
+ : entry;
167
+ }
168
+ }
169
+ const slideKey = typeof item.SlideID === 'string' ? item.SlideID.trim() : '';
170
+ if (slideKey) {
171
+ const existingSlide = map[slideKey];
172
+ map[slideKey] = existingSlide
173
+ ? {
174
+ ...entry,
175
+ Verified: existingSlide.Verified && entry.Verified,
176
+ }
177
+ : entry;
178
+ }
179
+ }
180
+ return Object.keys(map).length > 0 ? map : null;
181
+ }
182
+ const MAGIC_LINK_TOKEN_STORAGE_KEY = 'mj_magic_link_token';
183
+ const PROVIDER_WAIT_INTERVAL_MS = 50;
184
+ const PROVIDER_WAIT_TIMEOUT_MS = 10_000;
185
+ const SENSITIVE_CONFIG_KEYS = new Set([
186
+ '__mj_guestlinks',
187
+ 'guestsharelinks',
188
+ 'apikey',
189
+ 'secret',
190
+ 'tokenhash',
191
+ 'password',
192
+ 'credentials',
193
+ 'accesstoken',
194
+ 'refreshtoken',
195
+ ]);
196
+ const RESOLVE_GUEST_ARTIFACT_SNAPSHOT_GQL = `
197
+ query ResolveGuestArtifactSnapshot {
198
+ ResolveGuestArtifactSnapshot {
199
+ Success
200
+ Valid
201
+ ErrorCode
202
+ ErrorMessage
203
+ LinkID
204
+ ArtifactID
205
+ ArtifactName
206
+ Title
207
+ ArtifactTypeName
208
+ DriverClass
209
+ VersionID
210
+ VersionNumber
211
+ Content
212
+ Configuration
213
+ FrozenProvenance {
214
+ TargetType
215
+ TargetID
216
+ ArtifactID
217
+ BlockID
218
+ SlideID
219
+ RegionID
220
+ LiveTableID
221
+ SnapshotVerified
222
+ FrozenByUserName
223
+ FrozenAt
224
+ }
225
+ ExpiresAt
226
+ Label
227
+ ShareMode
228
+ ReadOnly
229
+ }
230
+ }
231
+ `;
232
+ /**
233
+ * Strips any residual credential-like keys from artifact configuration JSON before
234
+ * passing it to an unauthenticated read-only viewer.
235
+ */
236
+ export function SanitizeGuestConfigurationJson(rawConfig) {
237
+ if (!rawConfig || !rawConfig.trim()) {
238
+ return '';
239
+ }
240
+ try {
241
+ const parsed = JSON.parse(rawConfig);
242
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
243
+ return '';
244
+ }
245
+ const sanitized = {};
246
+ for (const [key, value] of Object.entries(parsed)) {
247
+ if (!SENSITIVE_CONFIG_KEYS.has(key.toLowerCase())) {
248
+ sanitized[key] = value;
249
+ }
250
+ }
251
+ return JSON.stringify(sanitized);
252
+ }
253
+ catch {
254
+ return '';
255
+ }
256
+ }
257
+ /**
258
+ * Maps server error codes returned by the guest-share resolver into clear user-facing copy.
259
+ */
260
+ export function DescribeGuestShareError(errorCode, fallbackMessage) {
261
+ switch ((errorCode ?? '').trim().toUpperCase()) {
262
+ case 'EXPIRED':
263
+ return {
264
+ title: 'Guest Share Link Expired',
265
+ message: fallbackMessage || 'This external guest share link has expired and can no longer be viewed.',
266
+ icon: 'fa-solid fa-clock',
267
+ };
268
+ case 'REVOKED':
269
+ return {
270
+ title: 'Guest Share Link Revoked',
271
+ message: fallbackMessage || 'The owner revoked access for this external guest share link.',
272
+ icon: 'fa-solid fa-ban',
273
+ };
274
+ case 'CONSUMED':
275
+ return {
276
+ title: 'Share Link Limit Reached',
277
+ message: fallbackMessage || 'This external guest share link has reached its maximum number of uses.',
278
+ icon: 'fa-solid fa-ban',
279
+ };
280
+ case 'ACCESS_DENIED':
281
+ return {
282
+ title: 'Guest Session Required',
283
+ message: fallbackMessage || 'Open a valid Magic Link share URL to view this shared artifact.',
284
+ icon: 'fa-solid fa-lock',
285
+ };
286
+ case 'FROZEN_REQUIRED':
287
+ return {
288
+ title: 'Frozen Snapshot Required',
289
+ message: fallbackMessage || 'This artifact must have a frozen snapshot before it can be shared externally.',
290
+ icon: 'fa-solid fa-snowflake',
291
+ };
292
+ case 'RATE_LIMITED':
293
+ return {
294
+ title: 'Too Many Requests',
295
+ message: fallbackMessage || 'Please wait a moment and retry opening this shared artifact.',
296
+ icon: 'fa-solid fa-gauge-high',
297
+ };
298
+ case 'NOT_FOUND':
299
+ case 'INVALID':
300
+ case 'INVALID_TOKEN':
301
+ return {
302
+ title: 'Invalid or Unknown Share Link',
303
+ message: fallbackMessage || 'This share link could not be verified. Check the URL or ask the owner for a new link.',
304
+ icon: 'fa-solid fa-link-slash',
305
+ };
306
+ default:
307
+ return {
308
+ title: 'Unable to Load Shared Artifact',
309
+ message: fallbackMessage || 'An unexpected error occurred while verifying this share link.',
310
+ icon: 'fa-solid fa-triangle-exclamation',
311
+ };
312
+ }
313
+ }
314
+ /**
315
+ * Standalone guest route component mounted at `/guest/artifact`.
316
+ * Activated after Magic Link redemption redirects to `/guest/artifact#token=<jwt>`
317
+ * (or `/guest/artifact?mlError=<code>` when redemption fails) and calls the
318
+ * Magic-Link-authenticated GraphQL query `ResolveGuestArtifactSnapshot` so
319
+ * external guests view frozen read-only artifacts (`Markdown Document`, `Presentation`,
320
+ * `Excel Spreadsheet`, etc.) with strict scoped session credentials and no OAuth wall.
321
+ */
322
+ export class PublicArtifactGuestComponent extends BaseAngularComponent {
323
+ route = inject(ActivatedRoute);
324
+ cdr = inject(ChangeDetectorRef);
325
+ /** Optional viewer fallback mode when host bundle has no plugin registered. */
326
+ ViewerFallbackOnly = false;
327
+ IsLoading = true;
328
+ ErrorTitle = '';
329
+ ErrorMessage = '';
330
+ ErrorCode = '';
331
+ ErrorIcon = 'fa-solid fa-triangle-exclamation';
332
+ Payload = null;
333
+ GuestArtifactVersion = null;
334
+ PreVerifiedFrozenSnapshots = null;
335
+ activeLoadSeq = 0;
336
+ providerWaitTimer = null;
337
+ subscriptions = [];
338
+ get DisplayTitle() {
339
+ return (this.Payload?.Title?.trim() ||
340
+ this.Payload?.ArtifactName?.trim() ||
341
+ 'Shared Artifact');
342
+ }
343
+ get FormattedExpiresAt() {
344
+ if (!this.Payload?.ExpiresAt) {
345
+ return '';
346
+ }
347
+ const parsed = new Date(this.Payload.ExpiresAt);
348
+ if (Number.isNaN(parsed.getTime())) {
349
+ return this.Payload.ExpiresAt;
350
+ }
351
+ return parsed.toLocaleString();
352
+ }
353
+ get SanitizedFallbackContent() {
354
+ return this.Payload?.Content ?? '';
355
+ }
356
+ ngOnInit() {
357
+ const querySub = this.route.queryParamMap.subscribe((qparams) => {
358
+ const mlError = (qparams.get('mlError') ?? '').trim();
359
+ if (mlError) {
360
+ this.activeLoadSeq++;
361
+ this.Payload = null;
362
+ this.GuestArtifactVersion = null;
363
+ this.PreVerifiedFrozenSnapshots = null;
364
+ this.applyError(mlError, undefined);
365
+ return;
366
+ }
367
+ if (!this.Payload) {
368
+ void this.LoadGuestShare();
369
+ }
370
+ });
371
+ this.subscriptions.push(querySub);
372
+ }
373
+ ngOnDestroy() {
374
+ this.activeLoadSeq++;
375
+ this.clearProviderWaitTimer();
376
+ for (const sub of this.subscriptions) {
377
+ sub.unsubscribe();
378
+ }
379
+ this.subscriptions.length = 0;
380
+ }
381
+ OnSignInClick() {
382
+ try {
383
+ if (typeof window !== 'undefined') {
384
+ window.sessionStorage?.removeItem(MAGIC_LINK_TOKEN_STORAGE_KEY);
385
+ }
386
+ }
387
+ catch {
388
+ // Ignore storage access errors in hardened browser contexts
389
+ }
390
+ }
391
+ Retry() {
392
+ void this.LoadGuestShare();
393
+ }
394
+ OnPluginLoaded() {
395
+ this.cdr.markForCheck();
396
+ }
397
+ async LoadGuestShare() {
398
+ const seq = ++this.activeLoadSeq;
399
+ this.clearProviderWaitTimer();
400
+ this.IsLoading = true;
401
+ this.ErrorTitle = '';
402
+ this.ErrorMessage = '';
403
+ this.ErrorCode = '';
404
+ this.Payload = null;
405
+ this.GuestArtifactVersion = null;
406
+ this.PreVerifiedFrozenSnapshots = null;
407
+ this.cdr.markForCheck();
408
+ const mlError = (this.route.snapshot?.queryParamMap?.get('mlError') ?? '').trim();
409
+ if (mlError) {
410
+ this.applyError(mlError, undefined);
411
+ return;
412
+ }
413
+ const result = await this.resolveGuestSnapshot(seq);
414
+ if (seq !== this.activeLoadSeq) {
415
+ return;
416
+ }
417
+ if (!result.Success || !result.Valid) {
418
+ this.applyError(result.ErrorCode, result.ErrorMessage);
419
+ return;
420
+ }
421
+ const sanitizedConfig = SanitizeGuestConfigurationJson(result.Configuration);
422
+ const sanitizedPayload = {
423
+ ...result,
424
+ Configuration: sanitizedConfig,
425
+ ReadOnly: true,
426
+ };
427
+ this.Payload = sanitizedPayload;
428
+ this.PreVerifiedFrozenSnapshots = BuildPreVerifiedFrozenSnapshotsMap(sanitizedPayload.FrozenProvenance);
429
+ this.GuestArtifactVersion = this.buildReadOnlyArtifactVersion(sanitizedPayload);
430
+ this.IsLoading = false;
431
+ this.cdr.markForCheck();
432
+ }
433
+ applyError(errorCode, rawMessage) {
434
+ const described = DescribeGuestShareError(errorCode, rawMessage);
435
+ this.ErrorCode = errorCode ?? 'INTERNAL_ERROR';
436
+ this.ErrorTitle = described.title;
437
+ this.ErrorMessage = described.message;
438
+ this.ErrorIcon = described.icon;
439
+ this.IsLoading = false;
440
+ this.cdr.markForCheck();
441
+ }
442
+ clearProviderWaitTimer() {
443
+ if (this.providerWaitTimer) {
444
+ clearInterval(this.providerWaitTimer);
445
+ this.providerWaitTimer = null;
446
+ }
447
+ }
448
+ getReadyGraphQLProvider() {
449
+ // Explicit [Provider] input (primarily in unit tests) bypasses singleton ConfigData readiness check
450
+ if (this.Provider instanceof GraphQLDataProvider && typeof this.Provider.ExecuteGQL === 'function') {
451
+ return this.Provider;
452
+ }
453
+ const singleton = GraphQLDataProvider.Instance ?? null;
454
+ if (singleton instanceof GraphQLDataProvider &&
455
+ typeof singleton.ExecuteGQL === 'function' &&
456
+ Boolean(singleton.ConfigData?.URL?.trim()) &&
457
+ Boolean(singleton.ConfigData?.Token?.trim())) {
458
+ return singleton;
459
+ }
460
+ return null;
461
+ }
462
+ waitForReadyGraphQLProvider(seq) {
463
+ const immediate = this.getReadyGraphQLProvider();
464
+ if (immediate) {
465
+ return Promise.resolve(immediate);
466
+ }
467
+ // If an explicit non-GraphQL provider was injected, fail fast rather than polling the singleton
468
+ if (this.Provider) {
469
+ return Promise.resolve(null);
470
+ }
471
+ const startedAt = Date.now();
472
+ this.clearProviderWaitTimer();
473
+ return new Promise((resolve) => {
474
+ this.providerWaitTimer = setInterval(() => {
475
+ if (seq !== this.activeLoadSeq) {
476
+ this.clearProviderWaitTimer();
477
+ resolve(null);
478
+ return;
479
+ }
480
+ const ready = this.getReadyGraphQLProvider();
481
+ if (ready) {
482
+ this.clearProviderWaitTimer();
483
+ resolve(ready);
484
+ return;
485
+ }
486
+ if (Date.now() - startedAt >= PROVIDER_WAIT_TIMEOUT_MS) {
487
+ this.clearProviderWaitTimer();
488
+ resolve(null);
489
+ }
490
+ }, PROVIDER_WAIT_INTERVAL_MS);
491
+ });
492
+ }
493
+ async resolveGuestSnapshot(seq) {
494
+ const provider = await this.waitForReadyGraphQLProvider(seq);
495
+ if (seq !== this.activeLoadSeq) {
496
+ return {
497
+ Success: false,
498
+ Valid: false,
499
+ ErrorCode: 'INTERNAL_ERROR',
500
+ ErrorMessage: 'Guest snapshot request superseded.',
501
+ ShareMode: 'Frozen',
502
+ ReadOnly: true,
503
+ };
504
+ }
505
+ if (!provider || typeof provider.ExecuteGQL !== 'function') {
506
+ const singleton = GraphQLDataProvider.Instance ?? null;
507
+ const missingSessionToken = singleton instanceof GraphQLDataProvider &&
508
+ Boolean(singleton.ConfigData?.URL?.trim()) &&
509
+ !singleton.ConfigData?.Token?.trim();
510
+ return {
511
+ Success: false,
512
+ Valid: false,
513
+ ErrorCode: missingSessionToken ? 'ACCESS_DENIED' : 'INTERNAL_ERROR',
514
+ ErrorMessage: missingSessionToken
515
+ ? 'A valid Magic Link guest session is required to view this artifact.'
516
+ : 'Unable to reach the GraphQL provider for guest snapshot verification.',
517
+ ShareMode: 'Frozen',
518
+ ReadOnly: true,
519
+ };
520
+ }
521
+ try {
522
+ const data = await provider.ExecuteGQL(RESOLVE_GUEST_ARTIFACT_SNAPSHOT_GQL, {});
523
+ const resolved = data?.ResolveGuestArtifactSnapshot;
524
+ if (!resolved) {
525
+ return {
526
+ Success: false,
527
+ Valid: false,
528
+ ErrorCode: 'ACCESS_DENIED',
529
+ ErrorMessage: 'A valid Magic Link guest session is required to view this artifact.',
530
+ ShareMode: 'Frozen',
531
+ ReadOnly: true,
532
+ };
533
+ }
534
+ return {
535
+ ...resolved,
536
+ ReadOnly: true,
537
+ ShareMode: resolved.ShareMode || 'Frozen',
538
+ };
539
+ }
540
+ catch (err) {
541
+ const msg = err instanceof Error ? err.message : String(err);
542
+ const isAuthErr = /unauth|401|expired|token/i.test(msg);
543
+ return {
544
+ Success: false,
545
+ Valid: false,
546
+ ErrorCode: isAuthErr ? 'ACCESS_DENIED' : 'INTERNAL_ERROR',
547
+ ErrorMessage: isAuthErr
548
+ ? 'Your Magic Link guest session is missing or expired. Please reopen the original share link.'
549
+ : 'Unable to reach the guest share verification service.',
550
+ ShareMode: 'Frozen',
551
+ ReadOnly: true,
552
+ };
553
+ }
554
+ }
555
+ buildReadOnlyArtifactVersion(payload) {
556
+ // Use Object.create so standalone /guest/artifact loads cleanly with minimal session scope.
557
+ const entity = Object.create(MJArtifactVersionEntity.prototype);
558
+ const versionNumber = payload.VersionNumber ?? 1;
559
+ const displayName = payload.Title ?? payload.ArtifactName ?? 'Shared Artifact';
560
+ const content = payload.Content ?? '';
561
+ const configuration = payload.Configuration ?? '';
562
+ Object.defineProperties(entity, {
563
+ ID: { value: payload.VersionID ?? 'guest-snapshot-version', configurable: true, enumerable: true },
564
+ ArtifactID: { value: '', configurable: true, enumerable: true },
565
+ VersionNumber: { value: versionNumber, configurable: true, enumerable: true },
566
+ ContentMode: { value: 'Text', configurable: true, enumerable: true },
567
+ Content: { value: content, configurable: true, enumerable: true },
568
+ Configuration: { value: configuration, configurable: true, enumerable: true },
569
+ Name: { value: displayName, configurable: true, enumerable: true },
570
+ Artifact: { value: payload.ArtifactName ?? displayName, configurable: true, enumerable: true },
571
+ Comments: { value: payload.Label ?? '', configurable: true, enumerable: true },
572
+ });
573
+ return entity;
574
+ }
575
+ static ɵfac = /*@__PURE__*/ (() => { let ɵPublicArtifactGuestComponent_BaseFactory; return function PublicArtifactGuestComponent_Factory(__ngFactoryType__) { return (ɵPublicArtifactGuestComponent_BaseFactory || (ɵPublicArtifactGuestComponent_BaseFactory = i0.ɵɵgetInheritedFactory(PublicArtifactGuestComponent)))(__ngFactoryType__ || PublicArtifactGuestComponent); }; })();
576
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PublicArtifactGuestComponent, selectors: [["mj-public-artifact-guest"]], inputs: { ViewerFallbackOnly: "ViewerFallbackOnly" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 17, vars: 3, consts: [[1, "guest-page"], [1, "guest-header"], [1, "guest-brand"], [1, "guest-badge"], ["aria-hidden", "true", 1, "fa-solid", "fa-user-shield"], [1, "guest-title"], [1, "guest-actions"], ["title", "Guest link expiration", 1, "guest-expiry"], ["href", "/", 1, "guest-signin-link", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-right-to-bracket"], [1, "guest-main"], ["role", "status", "aria-live", "polite", 1, "guest-state-card"], ["role", "alert", 1, "guest-error-banner"], [1, "guest-viewer-shell"], [1, "guest-meta-chip"], ["aria-hidden", "true", 1, "fa-solid", "fa-snowflake"], ["aria-hidden", "true", 1, "fa-solid", "fa-calendar-clock"], ["aria-hidden", "true", 1, "fa-solid", "fa-spinner", "fa-spin", "guest-state-icon"], [1, "guest-state-title"], [1, "guest-state-message"], ["aria-hidden", "true"], [1, "guest-error-body"], [1, "guest-error-title"], [1, "guest-error-message"], [1, "guest-error-actions"], ["type", "button", 1, "guest-retry-btn", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-rotate-right"], ["height", "100%", 3, "artifactVersion", "ArtifactTypeName", "DriverClass", "PreVerifiedFrozenSnapshots", "GuestSnapshotMode", "readonly"], [1, "guest-fallback-content"], ["height", "100%", 3, "PluginLoaded", "artifactVersion", "ArtifactTypeName", "DriverClass", "PreVerifiedFrozenSnapshots", "GuestSnapshotMode", "readonly"]], template: function PublicArtifactGuestComponent_Template(rf, ctx) { if (rf & 1) {
577
+ i0.ɵɵelementStart(0, "div", 0)(1, "header", 1)(2, "div", 2)(3, "span", 3);
578
+ i0.ɵɵelement(4, "i", 4);
579
+ i0.ɵɵtext(5, " Guest View ");
580
+ i0.ɵɵelementEnd();
581
+ i0.ɵɵconditionalCreate(6, PublicArtifactGuestComponent_Conditional_6_Template, 8, 5)(7, PublicArtifactGuestComponent_Conditional_7_Template, 2, 0, "h1", 5);
582
+ i0.ɵɵelementEnd();
583
+ i0.ɵɵelementStart(8, "div", 6);
584
+ i0.ɵɵconditionalCreate(9, PublicArtifactGuestComponent_Conditional_9_Template, 3, 1, "span", 7);
585
+ i0.ɵɵelementStart(10, "a", 8);
586
+ i0.ɵɵlistener("click", function PublicArtifactGuestComponent_Template_a_click_10_listener() { return ctx.OnSignInClick(); });
587
+ i0.ɵɵelement(11, "i", 9);
588
+ i0.ɵɵtext(12, " Sign In ");
589
+ i0.ɵɵelementEnd()()();
590
+ i0.ɵɵelementStart(13, "main", 10);
591
+ i0.ɵɵconditionalCreate(14, PublicArtifactGuestComponent_Conditional_14_Template, 6, 0, "div", 11)(15, PublicArtifactGuestComponent_Conditional_15_Template, 11, 4, "div", 12)(16, PublicArtifactGuestComponent_Conditional_16_Template, 3, 1, "div", 13);
592
+ i0.ɵɵelementEnd()();
593
+ } if (rf & 2) {
594
+ i0.ɵɵadvance(6);
595
+ i0.ɵɵconditional(ctx.Payload ? 6 : 7);
596
+ i0.ɵɵadvance(3);
597
+ i0.ɵɵconditional(ctx.FormattedExpiresAt ? 9 : -1);
598
+ i0.ɵɵadvance(5);
599
+ i0.ɵɵconditional(ctx.IsLoading ? 14 : ctx.ErrorMessage ? 15 : ctx.GuestArtifactVersion && ctx.Payload ? 16 : -1);
600
+ } }, dependencies: [i1.ArtifactTypePluginViewerComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n height: 100vh;\n width: 100%;\n background: var(--mj-bg-page);\n color: var(--mj-text-primary);\n }\n\n .guest-page[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: var(--mj-bg-page);\n }\n\n .guest-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n padding: 12px 20px;\n background: var(--mj-bg-surface);\n border-bottom: 1px solid var(--mj-border-default);\n flex-wrap: wrap;\n }\n\n .guest-brand[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n flex-wrap: wrap;\n }\n\n .guest-badge[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n border-radius: 999px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 12px;\n font-weight: 600;\n }\n\n .guest-title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .guest-meta-chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 3px 8px;\n border-radius: 6px;\n background: var(--mj-bg-surface-sunken);\n border: 1px solid var(--mj-border-default);\n color: var(--mj-text-secondary);\n font-size: 12px;\n font-weight: 500;\n }\n\n .guest-actions[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .guest-expiry[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n color: var(--mj-text-secondary);\n font-size: 12px;\n }\n\n .guest-signin-link[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n border-radius: 6px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-primary);\n text-decoration: none;\n font-size: 13px;\n font-weight: 500;\n }\n\n .guest-signin-link[_ngcontent-%COMP%]:hover {\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n }\n\n .guest-main[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n padding: 16px 20px;\n overflow: auto;\n }\n\n .guest-state-card[_ngcontent-%COMP%] {\n margin: auto;\n max-width: 440px;\n padding: 32px;\n border-radius: 12px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n text-align: center;\n }\n\n .guest-state-icon[_ngcontent-%COMP%] {\n font-size: 28px;\n color: var(--mj-brand-primary);\n margin-bottom: 12px;\n }\n\n .guest-state-title[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n font-size: 18px;\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .guest-state-message[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 14px;\n color: var(--mj-text-secondary);\n }\n\n .guest-error-banner[_ngcontent-%COMP%] {\n margin: 40px auto;\n max-width: 560px;\n width: 100%;\n display: flex;\n align-items: flex-start;\n gap: 14px;\n padding: 20px;\n border-radius: 10px;\n background: var(--mj-status-error-bg);\n border: 1px solid var(--mj-status-error);\n color: var(--mj-status-error-text);\n }\n\n .guest-error-icon[_ngcontent-%COMP%] {\n font-size: 22px;\n color: var(--mj-status-error);\n flex-shrink: 0;\n margin-top: 2px;\n }\n\n .guest-error-body[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n }\n\n .guest-error-title[_ngcontent-%COMP%] {\n margin: 0 0 6px 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .guest-error-message[_ngcontent-%COMP%] {\n margin: 0 0 14px 0;\n font-size: 14px;\n color: var(--mj-text-secondary);\n }\n\n .guest-error-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 10px;\n }\n\n .guest-retry-btn[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 7px 14px;\n border-radius: 6px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n }\n\n .guest-retry-btn[_ngcontent-%COMP%]:hover {\n border-color: var(--mj-brand-primary);\n }\n\n .guest-viewer-shell[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n overflow: hidden;\n }\n\n .guest-fallback-content[_ngcontent-%COMP%] {\n margin: 0;\n padding: 20px;\n flex: 1;\n overflow: auto;\n white-space: pre-wrap;\n word-break: break-word;\n font-size: 13px;\n line-height: 1.5;\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface-card);\n }"], changeDetection: 0 });
601
+ }
602
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PublicArtifactGuestComponent, [{
603
+ type: Component,
604
+ args: [{ standalone: false, selector: 'mj-public-artifact-guest', changeDetection: ChangeDetectionStrategy.OnPush, template: `
605
+ <div class="guest-page">
606
+ <header class="guest-header">
607
+ <div class="guest-brand">
608
+ <span class="guest-badge">
609
+ <i class="fa-solid fa-user-shield" aria-hidden="true"></i>
610
+ Guest View
611
+ </span>
612
+ @if (Payload) {
613
+ <h1 class="guest-title">{{ DisplayTitle }}</h1>
614
+ <span class="guest-meta-chip">
615
+ <i class="fa-solid fa-snowflake" aria-hidden="true"></i>
616
+ {{ Payload.ShareMode || 'Frozen' }}
617
+ @if (Payload.VersionNumber != null) {
618
+ <span>v{{ Payload.VersionNumber }}</span>
619
+ }
620
+ </span>
621
+ @if (Payload.ArtifactTypeName) {
622
+ <span class="guest-meta-chip">{{ Payload.ArtifactTypeName }}</span>
623
+ }
624
+ @if (Payload.Label) {
625
+ <span class="guest-meta-chip">{{ Payload.Label }}</span>
626
+ }
627
+ } @else {
628
+ <h1 class="guest-title">Shared Artifact</h1>
629
+ }
630
+ </div>
631
+ <div class="guest-actions">
632
+ @if (FormattedExpiresAt) {
633
+ <span class="guest-expiry" title="Guest link expiration">
634
+ <i class="fa-solid fa-calendar-clock" aria-hidden="true"></i>
635
+ Expires {{ FormattedExpiresAt }}
636
+ </span>
637
+ }
638
+ <a class="guest-signin-link" href="/" (click)="OnSignInClick()">
639
+ <i class="fa-solid fa-right-to-bracket" aria-hidden="true"></i>
640
+ Sign In
641
+ </a>
642
+ </div>
643
+ </header>
644
+
645
+ <main class="guest-main">
646
+ @if (IsLoading) {
647
+ <div class="guest-state-card" role="status" aria-live="polite">
648
+ <i class="fa-solid fa-spinner fa-spin guest-state-icon" aria-hidden="true"></i>
649
+ <h2 class="guest-state-title">Loading shared artifact...</h2>
650
+ <p class="guest-state-message">Verifying external guest link and preparing frozen snapshot.</p>
651
+ </div>
652
+ } @else if (ErrorMessage) {
653
+ <div class="guest-error-banner" role="alert">
654
+ <i [class]="ErrorIcon + ' guest-error-icon'" aria-hidden="true"></i>
655
+ <div class="guest-error-body">
656
+ <h2 class="guest-error-title">{{ ErrorTitle }}</h2>
657
+ <p class="guest-error-message">{{ ErrorMessage }}</p>
658
+ <div class="guest-error-actions">
659
+ <button type="button" class="guest-retry-btn" (click)="Retry()">
660
+ <i class="fa-solid fa-rotate-right" aria-hidden="true"></i>
661
+ Retry
662
+ </button>
663
+ </div>
664
+ </div>
665
+ </div>
666
+ } @else if (GuestArtifactVersion && Payload) {
667
+ <div class="guest-viewer-shell">
668
+ @if (!ViewerFallbackOnly) {
669
+ <mj-artifact-type-plugin-viewer
670
+ [artifactVersion]="GuestArtifactVersion"
671
+ [ArtifactTypeName]="Payload.ArtifactTypeName || 'Markdown Document'"
672
+ [DriverClass]="Payload.DriverClass || undefined"
673
+ [PreVerifiedFrozenSnapshots]="PreVerifiedFrozenSnapshots"
674
+ [GuestSnapshotMode]="true"
675
+ [readonly]="true"
676
+ height="100%"
677
+ (PluginLoaded)="OnPluginLoaded()"
678
+ ></mj-artifact-type-plugin-viewer>
679
+ } @else {
680
+ <pre class="guest-fallback-content">{{ SanitizedFallbackContent }}</pre>
681
+ }
682
+ </div>
683
+ }
684
+ </main>
685
+ </div>
686
+ `, styles: ["\n :host {\n display: block;\n height: 100vh;\n width: 100%;\n background: var(--mj-bg-page);\n color: var(--mj-text-primary);\n }\n\n .guest-page {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n background: var(--mj-bg-page);\n }\n\n .guest-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n padding: 12px 20px;\n background: var(--mj-bg-surface);\n border-bottom: 1px solid var(--mj-border-default);\n flex-wrap: wrap;\n }\n\n .guest-brand {\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n flex-wrap: wrap;\n }\n\n .guest-badge {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n border-radius: 999px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 12px;\n font-weight: 600;\n }\n\n .guest-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .guest-meta-chip {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 3px 8px;\n border-radius: 6px;\n background: var(--mj-bg-surface-sunken);\n border: 1px solid var(--mj-border-default);\n color: var(--mj-text-secondary);\n font-size: 12px;\n font-weight: 500;\n }\n\n .guest-actions {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .guest-expiry {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n color: var(--mj-text-secondary);\n font-size: 12px;\n }\n\n .guest-signin-link {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n border-radius: 6px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-primary);\n text-decoration: none;\n font-size: 13px;\n font-weight: 500;\n }\n\n .guest-signin-link:hover {\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n }\n\n .guest-main {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n padding: 16px 20px;\n overflow: auto;\n }\n\n .guest-state-card {\n margin: auto;\n max-width: 440px;\n padding: 32px;\n border-radius: 12px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n text-align: center;\n }\n\n .guest-state-icon {\n font-size: 28px;\n color: var(--mj-brand-primary);\n margin-bottom: 12px;\n }\n\n .guest-state-title {\n margin: 0 0 8px 0;\n font-size: 18px;\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .guest-state-message {\n margin: 0;\n font-size: 14px;\n color: var(--mj-text-secondary);\n }\n\n .guest-error-banner {\n margin: 40px auto;\n max-width: 560px;\n width: 100%;\n display: flex;\n align-items: flex-start;\n gap: 14px;\n padding: 20px;\n border-radius: 10px;\n background: var(--mj-status-error-bg);\n border: 1px solid var(--mj-status-error);\n color: var(--mj-status-error-text);\n }\n\n .guest-error-icon {\n font-size: 22px;\n color: var(--mj-status-error);\n flex-shrink: 0;\n margin-top: 2px;\n }\n\n .guest-error-body {\n flex: 1;\n min-width: 0;\n }\n\n .guest-error-title {\n margin: 0 0 6px 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .guest-error-message {\n margin: 0 0 14px 0;\n font-size: 14px;\n color: var(--mj-text-secondary);\n }\n\n .guest-error-actions {\n display: flex;\n gap: 10px;\n }\n\n .guest-retry-btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 7px 14px;\n border-radius: 6px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n }\n\n .guest-retry-btn:hover {\n border-color: var(--mj-brand-primary);\n }\n\n .guest-viewer-shell {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n overflow: hidden;\n }\n\n .guest-fallback-content {\n margin: 0;\n padding: 20px;\n flex: 1;\n overflow: auto;\n white-space: pre-wrap;\n word-break: break-word;\n font-size: 13px;\n line-height: 1.5;\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface-card);\n }\n "] }]
687
+ }], null, { ViewerFallbackOnly: [{
688
+ type: Input
689
+ }] }); })();
690
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PublicArtifactGuestComponent, { className: "PublicArtifactGuestComponent", filePath: "src/lib/public-guest/public-artifact-guest.component.ts", lineNumber: 554 }); })();
691
+ //# sourceMappingURL=public-artifact-guest.component.js.map