@fluxmail/core 0.27.0 → 0.29.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.
Files changed (49) hide show
  1. package/dist/folders.d.ts +27 -0
  2. package/dist/folders.d.ts.map +1 -0
  3. package/dist/folders.js +62 -0
  4. package/dist/folders.js.map +1 -0
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/mcp/apps.d.ts +204 -0
  10. package/dist/mcp/apps.d.ts.map +1 -0
  11. package/dist/mcp/apps.js +269 -0
  12. package/dist/mcp/apps.js.map +1 -0
  13. package/dist/mcp/index.d.ts +2 -0
  14. package/dist/mcp/index.d.ts.map +1 -1
  15. package/dist/mcp/index.js +2 -0
  16. package/dist/mcp/index.js.map +1 -1
  17. package/dist/mcp/invalidArguments.d.ts +49 -0
  18. package/dist/mcp/invalidArguments.d.ts.map +1 -0
  19. package/dist/mcp/invalidArguments.js +208 -0
  20. package/dist/mcp/invalidArguments.js.map +1 -0
  21. package/dist/mcp/pdf.d.ts +3 -1
  22. package/dist/mcp/pdf.d.ts.map +1 -1
  23. package/dist/mcp/pdf.js.map +1 -1
  24. package/dist/mcp/pdfMemory.d.ts +24 -0
  25. package/dist/mcp/pdfMemory.d.ts.map +1 -0
  26. package/dist/mcp/pdfMemory.js +107 -0
  27. package/dist/mcp/pdfMemory.js.map +1 -0
  28. package/dist/mcp/results.d.ts +6 -1
  29. package/dist/mcp/results.d.ts.map +1 -1
  30. package/dist/mcp/results.js +13 -2
  31. package/dist/mcp/results.js.map +1 -1
  32. package/dist/mcp/sendConfirmationView.d.ts +14 -0
  33. package/dist/mcp/sendConfirmationView.d.ts.map +1 -0
  34. package/dist/mcp/sendConfirmationView.js +816 -0
  35. package/dist/mcp/sendConfirmationView.js.map +1 -0
  36. package/dist/mcp/tools.d.ts +1 -1
  37. package/dist/mcp/tools.d.ts.map +1 -1
  38. package/dist/mcp/tools.generated.d.ts.map +1 -1
  39. package/dist/mcp/tools.generated.js +47 -0
  40. package/dist/mcp/tools.generated.js.map +1 -1
  41. package/dist/mcp/tools.js +10 -0
  42. package/dist/mcp/tools.js.map +1 -1
  43. package/dist/provider.d.ts +15 -0
  44. package/dist/provider.d.ts.map +1 -1
  45. package/dist/text.d.ts +13 -0
  46. package/dist/text.d.ts.map +1 -1
  47. package/dist/text.js +25 -0
  48. package/dist/text.js.map +1 -1
  49. package/package.json +5 -1
@@ -0,0 +1,816 @@
1
+ /**
2
+ * The send confirmation card: one self-contained HTML document for MCP Apps hosts. It loads nothing remote,
3
+ * builds every piece of mail content with DOM APIs (never innerHTML), and rebuilds an HTML body from an
4
+ * allowlist after parsing it inertly. The script speaks the MCP Apps postMessage protocol directly, so it needs
5
+ * no SDK bundle.
6
+ *
7
+ * Keep the script free of backticks and template placeholders: it lives inside this module's template literal.
8
+ */
9
+ /** The key a preview_send result's `_meta` uses for the card's data. Mirrored in the script below. */
10
+ export const SEND_CONFIRMATION_RESULT_META_KEY = 'ai.fluxmail/send-confirmation';
11
+ /** Characters of each body part the card receives. */
12
+ export const SEND_CONFIRMATION_MAX_BODY_CHARS = 50_000;
13
+ const STYLE = `
14
+ :root {
15
+ color-scheme: light dark;
16
+ --color-background-primary: light-dark(#ffffff, #1c1c1c);
17
+ --color-background-secondary: light-dark(#f5f5f4, #262626);
18
+ --color-text-primary: light-dark(#1c1917, #f5f5f4);
19
+ --color-text-secondary: light-dark(#57534e, #a8a29e);
20
+ --color-text-danger: light-dark(#b91c1c, #f87171);
21
+ --color-text-success: light-dark(#15803d, #4ade80);
22
+ --color-text-warning: light-dark(#a16207, #facc15);
23
+ --color-text-inverse: light-dark(#ffffff, #1c1917);
24
+ --color-background-inverse: light-dark(#1c1917, #f5f5f4);
25
+ --color-border-primary: light-dark(#d6d3d1, #44403c);
26
+ --color-border-secondary: light-dark(#e7e5e4, #333333);
27
+ --color-ring-primary: light-dark(#2563eb, #60a5fa);
28
+ --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
29
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
30
+ --font-text-sm-size: 13px;
31
+ --font-text-md-size: 14px;
32
+ --font-weight-medium: 500;
33
+ --font-weight-semibold: 600;
34
+ --border-radius-md: 8px;
35
+ --border-radius-lg: 12px;
36
+ --border-width-regular: 1px;
37
+ }
38
+ * { box-sizing: border-box; }
39
+ /* Only the body box may scroll sideways; the card itself never shows a horizontal scrollbar. */
40
+ html, body { margin: 0; padding: 0; overflow-x: hidden; }
41
+ body {
42
+ background: var(--color-background-primary);
43
+ color: var(--color-text-primary);
44
+ font-family: var(--font-sans);
45
+ font-size: var(--font-text-md-size);
46
+ line-height: 1.5;
47
+ overflow-wrap: anywhere;
48
+ -webkit-font-smoothing: antialiased;
49
+ }
50
+ /* The card has the same padding on every side. The footer carries the bottom padding; without it the content does. */
51
+ main { --pad: 16px; padding: var(--pad) var(--pad) 0; display: flex; flex-direction: column; }
52
+ .no-actions main { padding-bottom: var(--pad); }
53
+ .subject { margin: 0 0 14px; font-size: 18px; line-height: 1.3; font-weight: var(--font-weight-semibold); letter-spacing: -0.01em; }
54
+ .subject.placeholder { font-weight: 400; }
55
+ .fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 8px; margin: 0; }
56
+ .fields dt { min-width: 32px; white-space: nowrap; color: var(--color-text-secondary); font-size: var(--font-text-sm-size); line-height: 24px; }
57
+ .fields dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; min-height: 24px; }
58
+ /* Each person is a pill: the name when there is one, and always the address the mail goes to. */
59
+ .person {
60
+ display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; max-width: 100%;
61
+ padding: 2px 10px; border-radius: 12px; font-size: var(--font-text-sm-size); line-height: 18px;
62
+ background: var(--color-background-secondary);
63
+ border: var(--border-width-regular) solid var(--color-border-secondary);
64
+ }
65
+ .person .name { font-weight: var(--font-weight-medium); }
66
+ .person .email { color: var(--color-text-secondary); }
67
+ .person .email:only-child { color: var(--color-text-primary); }
68
+ .muted { color: var(--color-text-secondary); }
69
+ /* Space alone separates the header from a plain-text body, which sits on the card itself. With the body's line
70
+ spacing, 12px looks the same as the space under the subject. */
71
+ .body-section { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
72
+ /* The card grows with the body instead of scrolling inside the conversation; only wide tables scroll sideways. */
73
+ .body-box { overflow-x: auto; line-height: 1.6; }
74
+ .body-text { white-space: pre-wrap; margin: 0; font-family: inherit; }
75
+ .body-html .flush-top { margin-top: 0; }
76
+ .body-html .flush-bottom { margin-bottom: 0; }
77
+ .body-html img { max-width: 100%; height: auto; }
78
+ .body-html table { border-collapse: collapse; max-width: 100%; }
79
+ .body-html td, .body-html th { padding: 2px 4px; vertical-align: top; }
80
+ .body-html blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--color-border-primary); color: var(--color-text-secondary); }
81
+ .body-html pre, .body-html code { font-family: var(--font-mono); white-space: pre-wrap; }
82
+ .body-html .link { text-decoration: underline; }
83
+ .body-html .href { color: var(--color-text-secondary); font-size: var(--font-text-sm-size); }
84
+ /* Formatted mail sits on its own sheet, so its headings and images don't read as part of the card. It keeps the
85
+ sender's colors, which assume a light page: a light card outlines the sheet, and a dark card, which the script
86
+ marks from the background it resolves to, makes it white. */
87
+ .body-box.paper {
88
+ color: #1c1917; color-scheme: light; padding: 14px 16px; border-radius: var(--border-radius-lg);
89
+ border: var(--border-width-regular) solid var(--color-border-secondary);
90
+ }
91
+ .paper .placeholder, .paper .body-html .href { color: #57534e; }
92
+ .paper .body-html blockquote { color: #57534e; border-left-color: #d6d3d1; }
93
+ :root[data-surface="dark"] .body-box.paper { background: #ffffff; border-color: transparent; }
94
+ .placeholder { color: var(--color-text-secondary); font-style: italic; }
95
+ .conditional { border-left: 3px dashed var(--color-border-primary); padding-left: 8px; margin: 6px 0; }
96
+ /* Formatted or plain text: one control with two segments. */
97
+ .toggle {
98
+ display: inline-flex; align-self: flex-start; gap: 2px; padding: 2px;
99
+ border-radius: var(--border-radius-md); background: var(--color-background-secondary);
100
+ }
101
+ .toggle button {
102
+ font-size: 12px; line-height: 18px; padding: 2px 10px; border: 0; border-radius: 6px;
103
+ background: transparent; color: var(--color-text-secondary);
104
+ }
105
+ .toggle button[aria-pressed="true"] {
106
+ background: var(--color-background-primary); color: var(--color-text-primary);
107
+ font-weight: var(--font-weight-medium); box-shadow: 0 0 0 1px var(--color-border-secondary);
108
+ }
109
+ .note { font-size: var(--font-text-sm-size); color: var(--color-text-secondary); margin: 0; }
110
+ .attachments {
111
+ list-style: none; margin: 12px 0 0; padding: 0;
112
+ display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px;
113
+ }
114
+ .attachments li {
115
+ display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px;
116
+ border: var(--border-width-regular) solid var(--color-border-secondary); border-radius: var(--border-radius-md);
117
+ }
118
+ /* The file type, in place of an icon. */
119
+ .attachments .kind {
120
+ flex: none; min-width: 34px; height: 34px; padding: 0 4px; border-radius: 6px;
121
+ display: flex; align-items: center; justify-content: center;
122
+ background: var(--color-background-secondary); color: var(--color-text-secondary);
123
+ font-size: 10px; font-weight: var(--font-weight-semibold); letter-spacing: 0.04em; text-transform: uppercase;
124
+ }
125
+ .attachments .file { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
126
+ .attachments .filename {
127
+ font-size: var(--font-text-sm-size); font-weight: var(--font-weight-medium);
128
+ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
129
+ }
130
+ .attachments .size { color: var(--color-text-secondary); font-size: 12px; }
131
+ /* While the preview loads: the outline of an email. */
132
+ .skeleton { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 6px; }
133
+ .skeleton span {
134
+ display: block; height: 12px; border-radius: 6px;
135
+ background: color-mix(in srgb, var(--color-text-primary) 9%, transparent);
136
+ animation: pulse 1.4s ease-in-out infinite;
137
+ }
138
+ .skeleton span:nth-child(1) { width: 46%; height: 18px; }
139
+ .skeleton span:nth-child(2) { width: 62%; animation-delay: 0.1s; }
140
+ .skeleton span:nth-child(3) { width: 38%; animation-delay: 0.2s; }
141
+ .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
142
+ @keyframes pulse { 50% { opacity: 0.45; } }
143
+ @keyframes spin { to { transform: rotate(360deg); } }
144
+ /* Send stays in view when the host caps the card's height and the card scrolls. */
145
+ footer {
146
+ display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px;
147
+ position: sticky; bottom: 0; background: var(--color-background-primary);
148
+ /* With its top padding, the footer's content starts 16px below the body. */
149
+ margin: 4px calc(-1 * var(--pad)) 0; padding: 12px var(--pad) calc(var(--pad) + var(--safe-area-bottom, 0px));
150
+ }
151
+ #outcome { flex: 1 1 100%; display: flex; justify-content: flex-end; }
152
+ /* The outcome of a send: a tinted box with a short title and, when it helps, one line of detail. */
153
+ .banner {
154
+ --tone: var(--color-text-secondary);
155
+ display: flex; gap: 10px; align-items: flex-start;
156
+ padding: 10px 12px; border-radius: var(--border-radius-md);
157
+ background: color-mix(in srgb, var(--tone) 10%, transparent);
158
+ border: var(--border-width-regular) solid color-mix(in srgb, var(--tone) 22%, transparent);
159
+ font-size: var(--font-text-sm-size);
160
+ }
161
+ /* A title alone takes the Send button's place and size; one with detail spans the card. */
162
+ .banner:not(.compact) { flex: 1; }
163
+ .banner.compact { align-items: center; gap: 8px; padding: 7px 16px 7px 12px; font-size: var(--font-text-md-size); }
164
+ .banner.compact .mark { margin-top: 0; }
165
+ .banner.success { --tone: var(--color-text-success); }
166
+ .banner.error { --tone: var(--color-text-danger); }
167
+ .banner.warning { --tone: var(--color-text-warning); }
168
+ .banner .mark {
169
+ flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px;
170
+ display: flex; align-items: center; justify-content: center;
171
+ background: var(--tone); color: var(--color-text-inverse);
172
+ font-size: 11px; line-height: 1; font-weight: var(--font-weight-semibold);
173
+ }
174
+ .banner .title { color: var(--tone); font-weight: var(--font-weight-semibold); }
175
+ .banner .detail { display: block; color: var(--color-text-primary); }
176
+ button {
177
+ font: inherit;
178
+ color: var(--color-text-primary);
179
+ background: var(--color-background-primary);
180
+ border: var(--border-width-regular) solid var(--color-border-primary);
181
+ border-radius: var(--border-radius-md);
182
+ padding: 6px 14px;
183
+ cursor: pointer;
184
+ }
185
+ button.primary {
186
+ display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 16px 7px 14px;
187
+ background: var(--color-background-inverse);
188
+ color: var(--color-text-inverse);
189
+ border-color: var(--color-background-inverse);
190
+ font-weight: var(--font-weight-medium);
191
+ transition: opacity 0.15s ease, transform 0.05s ease;
192
+ }
193
+ button.primary:hover:not(:disabled) { opacity: 0.88; }
194
+ button.primary:active:not(:disabled) { transform: translateY(1px); }
195
+ button.primary svg { flex: none; }
196
+ .spinner {
197
+ display: none; width: 14px; height: 14px; border-radius: 50%;
198
+ border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
199
+ }
200
+ button.busy .spinner { display: block; }
201
+ button.busy svg { display: none; }
202
+ button:disabled { opacity: 0.5; cursor: default; }
203
+ button.busy:disabled { opacity: 0.8; }
204
+ button:focus-visible { outline: 2px solid var(--color-ring-primary); outline-offset: 2px; }
205
+ [hidden] { display: none !important; }
206
+ @media (prefers-reduced-motion: reduce) {
207
+ .skeleton span, .spinner { animation: none; }
208
+ button.primary { transition: none; }
209
+ }
210
+ @media (max-width: 360px) {
211
+ main { --pad: 14px; }
212
+ .body-box.paper { padding: 10px 12px; }
213
+ .subject { font-size: 16px; }
214
+ .attachments { grid-template-columns: 1fr; }
215
+ footer button { flex: 1; }
216
+ }
217
+ `;
218
+ const SCRIPT = `
219
+ (function () {
220
+ 'use strict';
221
+ var META_KEY = 'ai.fluxmail/send-confirmation';
222
+ var PROTOCOL_VERSION = '2026-01-26';
223
+ var MAX_NODES = 20000;
224
+ var MAX_DEPTH = 64;
225
+ var nextId = 1;
226
+ var pending = {};
227
+ var state = { input: null, preview: null, card: null, phase: 'waiting', bodyMode: 'html', outcome: null };
228
+
229
+ function $(id) { return document.getElementById(id); }
230
+ function el(tag, className, text) {
231
+ var node = document.createElement(tag);
232
+ if (className) node.className = className;
233
+ if (text !== undefined && text !== null) node.textContent = String(text);
234
+ return node;
235
+ }
236
+ function clear(node) { while (node.firstChild) node.removeChild(node.firstChild); }
237
+ function isObject(value) { return !!value && typeof value === 'object' && !Array.isArray(value); }
238
+ function str(value) { return typeof value === 'string' ? value : ''; }
239
+
240
+ function post(message) { window.parent.postMessage(message, '*'); }
241
+ function request(method, params) {
242
+ var id = nextId++;
243
+ post({ jsonrpc: '2.0', id: id, method: method, params: params });
244
+ return new Promise(function (resolve, reject) { pending[id] = { resolve: resolve, reject: reject }; });
245
+ }
246
+ function notify(method, params) { post({ jsonrpc: '2.0', method: method, params: params || {} }); }
247
+ function respond(id, result) { post({ jsonrpc: '2.0', id: id, result: result }); }
248
+
249
+ window.addEventListener('message', function (event) {
250
+ if (event.source !== window.parent) return;
251
+ var message = event.data;
252
+ if (!isObject(message) || message.jsonrpc !== '2.0') return;
253
+ if (message.method === undefined && (typeof message.id === 'number') && pending[message.id]) {
254
+ var waiter = pending[message.id];
255
+ delete pending[message.id];
256
+ if (message.error) waiter.reject(message.error);
257
+ else waiter.resolve(message.result);
258
+ return;
259
+ }
260
+ var params = isObject(message.params) ? message.params : {};
261
+ switch (message.method) {
262
+ case 'ui/notifications/tool-input':
263
+ state.input = isObject(params.arguments) ? params.arguments : null;
264
+ render();
265
+ break;
266
+ case 'ui/notifications/tool-result':
267
+ receiveResult(params);
268
+ break;
269
+ case 'ui/notifications/tool-cancelled':
270
+ if (!state.preview) { state.phase = 'cancelled'; render(); }
271
+ break;
272
+ case 'ui/notifications/host-context-changed':
273
+ applyHostContext(params);
274
+ break;
275
+ case 'ui/resource-teardown':
276
+ if (message.id !== undefined) respond(message.id, {});
277
+ break;
278
+ case 'ping':
279
+ if (message.id !== undefined) respond(message.id, {});
280
+ break;
281
+ default:
282
+ if (message.id !== undefined && message.method !== undefined) {
283
+ post({ jsonrpc: '2.0', id: message.id, error: { code: -32601, message: 'Method not found' } });
284
+ }
285
+ }
286
+ });
287
+
288
+ // Records whether the card's background is dark. The host can set it through the theme or its own variables,
289
+ // so the color the page resolves to decides; the theme stands in when that color can't be read.
290
+ function markSurface() {
291
+ var root = document.documentElement;
292
+ var theme = root.getAttribute('data-theme');
293
+ var dark = theme ? theme === 'dark' : !!(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches);
294
+ var color = /^rgba?\\(\\s*([\\d.]+)[,\\s]+([\\d.]+)[,\\s]+([\\d.]+)(?:[,\\s\\/]+([\\d.]+))?/.exec(getComputedStyle(document.body).backgroundColor || '');
295
+ if (color && color[4] !== '0') dark = 0.2126 * color[1] + 0.7152 * color[2] + 0.0722 * color[3] < 128;
296
+ root.setAttribute('data-surface', dark ? 'dark' : 'light');
297
+ }
298
+
299
+ function applyHostContext(context) {
300
+ if (!isObject(context)) return;
301
+ var root = document.documentElement;
302
+ if (context.theme === 'light' || context.theme === 'dark') {
303
+ root.setAttribute('data-theme', context.theme);
304
+ root.style.colorScheme = context.theme;
305
+ }
306
+ var styles = isObject(context.styles) ? context.styles : {};
307
+ var variables = isObject(styles.variables) ? styles.variables : {};
308
+ Object.keys(variables).forEach(function (name) {
309
+ var value = variables[name];
310
+ if (/^--[a-z0-9-]+$/.test(name) && typeof value === 'string') root.style.setProperty(name, value);
311
+ });
312
+ markSurface();
313
+ // Keep Send clear of the device's bottom inset on mobile hosts.
314
+ var insets = isObject(context.safeAreaInsets) ? context.safeAreaInsets : null;
315
+ if (insets && typeof insets.bottom === 'number' && insets.bottom >= 0 && insets.bottom <= 200) {
316
+ root.style.setProperty('--safe-area-bottom', insets.bottom + 'px');
317
+ }
318
+ var dims = isObject(context.containerDimensions) ? context.containerDimensions : null;
319
+ if (dims) {
320
+ if (typeof dims.maxHeight === 'number') {
321
+ root.style.maxHeight = dims.maxHeight + 'px';
322
+ root.style.overflowY = 'auto';
323
+ root.style.overflowX = 'hidden';
324
+ }
325
+ if (typeof dims.height === 'number') {
326
+ root.style.height = '100vh';
327
+ root.style.overflowY = 'auto';
328
+ root.style.overflowX = 'hidden';
329
+ }
330
+ if (typeof dims.maxWidth === 'number') root.style.maxWidth = dims.maxWidth + 'px';
331
+ }
332
+ }
333
+
334
+ function receiveResult(result) {
335
+ // A failed preview replaces any earlier one, so its error never sits above a stale preview with a Send button.
336
+ if (result.isError) { state.preview = null; state.card = null; state.phase = 'preview-error'; render(); return; }
337
+ var structured = isObject(result.structuredContent) ? result.structuredContent : {};
338
+ var data = isObject(structured.data) ? structured.data : null;
339
+ var meta = isObject(result._meta) ? result._meta[META_KEY] : null;
340
+ state.preview = data;
341
+ state.card = isObject(meta) && meta.version === 1 && typeof meta.idempotencyKey === 'string' ? meta : null;
342
+ state.bodyMode = 'html';
343
+ if (state.phase === 'waiting' || state.phase === 'cancelled' || state.phase === 'preview-error') state.phase = 'ready';
344
+ render();
345
+ }
346
+
347
+ // A person as a pill. The address is always shown, because it is where the mail goes.
348
+ function person(name, email) {
349
+ var pill = el('span', 'person');
350
+ if (name && name !== email) pill.appendChild(el('span', 'name', name));
351
+ pill.appendChild(el('span', 'email', email));
352
+ return pill;
353
+ }
354
+ function addresses(list) {
355
+ var dd = el('dd');
356
+ (Array.isArray(list) ? list : []).forEach(function (address) {
357
+ if (isObject(address)) dd.appendChild(person(str(address.name), str(address.email)));
358
+ });
359
+ return dd;
360
+ }
361
+ // A short label for a file's type, from its extension.
362
+ function kindLabel(filename) {
363
+ var match = /\\.([A-Za-z][A-Za-z0-9]{1,4})$/.exec(filename);
364
+ return match ? match[1] : 'file';
365
+ }
366
+ function sizeLabel(bytes) {
367
+ if (typeof bytes !== 'number' || !isFinite(bytes) || bytes < 0) return '';
368
+ if (bytes < 1024) return bytes + ' B';
369
+ if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(bytes < 10240 ? 1 : 0) + ' KB';
370
+ return (bytes / (1024 * 1024)).toFixed(1) + ' MB';
371
+ }
372
+
373
+ var KEEP = ' a abbr b bdi bdo big blockquote br caption cite code col colgroup dd del dfn div dl dt em font h1 h2 h3 h4 h5 h6 hr i img ins kbd li mark ol p pre q s samp small span strike strong sub sup table tbody td tfoot th thead tr tt u ul var ';
374
+ // Elements whose content no mail app shows.
375
+ var SKIP = ' base head link meta script style template title ';
376
+ // Elements shown as a placeholder because the card does not embed them.
377
+ var EMBEDDED = ' applet audio canvas embed frame frameset iframe math object svg video ';
378
+ // Containers mail apps lay out as blocks; the card shows them as plain blocks.
379
+ var BLOCKS = ' address article aside center details dialog fieldset figcaption figure footer form header hgroup legend main nav noscript section summary ';
380
+ var SAFE_IMAGE = /^data:image\\/(png|gif|jpe?g|webp);base64,[a-z0-9+\\/=\\s]+$/i;
381
+ var CONDITIONAL = /^\\s*\\[if[^\\]]*\\]>([\\s\\S]*)<!\\[endif\\]\\s*$/i;
382
+
383
+ function clipped(url) { return url.length > 200 ? url.slice(0, 200) + '...' : url; }
384
+ function sanitizedHtml(html) {
385
+ var parsed = new DOMParser().parseFromString(html, 'text/html');
386
+ var out = document.createDocumentFragment();
387
+ var budget = { nodes: 0 };
388
+ copyChildren(parsed.body, out, 0, budget);
389
+ // Conditional comments before <body> still reach Outlook.
390
+ copyConditionals(parsed.head, out, budget);
391
+ if (budget.nodes > MAX_NODES) out.appendChild(el('p', 'placeholder', 'The rest of the formatted body is too long to show here.'));
392
+ return out;
393
+ }
394
+ function copyConditionals(from, to, budget) {
395
+ for (var child = from.firstChild; child; child = child.nextSibling) {
396
+ if (child.nodeType === 8) copyComment(child, to, 0, budget);
397
+ }
398
+ }
399
+ function copyComment(node, to, depth, budget) {
400
+ var match = CONDITIONAL.exec(node.nodeValue || '');
401
+ if (!match || !match[1].trim()) return;
402
+ var box = el('div', 'conditional');
403
+ box.appendChild(el('div', 'placeholder', 'Shown only in some mail apps:'));
404
+ var inner = new DOMParser().parseFromString(match[1], 'text/html');
405
+ copyChildren(inner.body, box, depth + 1, budget);
406
+ to.appendChild(box);
407
+ }
408
+ function copyChildren(from, to, depth, budget) {
409
+ for (var child = from.firstChild; child; child = child.nextSibling) {
410
+ if (++budget.nodes > MAX_NODES) return;
411
+ if (child.nodeType === 3) { to.appendChild(document.createTextNode(child.nodeValue || '')); continue; }
412
+ if (child.nodeType === 8) { copyComment(child, to, depth, budget); continue; }
413
+ if (child.nodeType !== 1) continue;
414
+ var tag = child.localName.toLowerCase();
415
+ if (SKIP.indexOf(' ' + tag + ' ') >= 0) continue;
416
+ if (depth >= MAX_DEPTH) { to.appendChild(document.createTextNode(child.textContent || '')); continue; }
417
+ if (EMBEDDED.indexOf(' ' + tag + ' ') >= 0) {
418
+ to.appendChild(el('span', 'placeholder', '[Embedded ' + tag + ' not shown]'));
419
+ if (tag === 'object' || tag === 'video' || tag === 'audio' || tag === 'applet') copyChildren(child, to, depth + 1, budget);
420
+ continue;
421
+ }
422
+ if (tag === 'img') { to.appendChild(imageFor(child)); continue; }
423
+ if (tag === 'input') {
424
+ var value = child.getAttribute('value') || child.getAttribute('placeholder') || '';
425
+ to.appendChild(el('span', 'placeholder', '[Field' + (value ? ': ' + value.slice(0, 200) : '') + ']'));
426
+ continue;
427
+ }
428
+ if (tag === 'a') {
429
+ var link = el('span', 'link');
430
+ copyChildren(child, link, depth + 1, budget);
431
+ to.appendChild(link);
432
+ var href = (child.getAttribute('href') || '').trim();
433
+ if (href && href !== (link.textContent || '').trim() && !/^(javascript|data|vbscript):/i.test(href)) {
434
+ to.appendChild(el('span', 'href', ' (' + clipped(href) + ')'));
435
+ }
436
+ continue;
437
+ }
438
+ var name = BLOCKS.indexOf(' ' + tag + ' ') >= 0 ? 'div'
439
+ : KEEP.indexOf(' ' + tag + ' ') < 0 ? 'span'
440
+ : tag === 'font' || tag === 'big' || tag === 'tt' ? 'span' : tag;
441
+ var copy = document.createElement(name);
442
+ if (tag === 'td' || tag === 'th') {
443
+ ['colspan', 'rowspan'].forEach(function (attribute) {
444
+ var span = parseInt(child.getAttribute(attribute) || '', 10);
445
+ if (span > 1 && span <= 100) copy.setAttribute(attribute, String(span));
446
+ });
447
+ }
448
+ applyStyles(child, copy, tag);
449
+ copyChildren(child, copy, depth + 1, budget);
450
+ to.appendChild(copy);
451
+ }
452
+ }
453
+
454
+ // Text styling mail apps show, from a fixed list of properties with checked values. Layout, positioning,
455
+ // visibility and anything that loads a resource are left out.
456
+ var STYLE_PROPERTIES = ['color', 'background-color', 'font-weight', 'font-style', 'text-decoration-line', 'text-align', 'font-size'];
457
+ var FONT_SIZES = [0, 10, 13, 16, 18, 24, 32, 32];
458
+ function styleValue(property, value) {
459
+ value = String(value || '').trim().toLowerCase();
460
+ if (!value || value.length > 64 || /[^a-z0-9#%(),.\\s-]/.test(value) || /url|expression|var|attr|image/.test(value)) return '';
461
+ if (property === 'font-size') {
462
+ var size = /^(\\d+(?:\\.\\d+)?)(px|pt)$/.exec(value);
463
+ if (size) return Math.min(32, Math.max(10, parseFloat(size[1]) * (size[2] === 'pt' ? 4 / 3 : 1))) + 'px';
464
+ return /^(x-small|small|medium|large|x-large)$/.test(value) ? value : '';
465
+ }
466
+ if (property === 'text-align') return /^(left|right|center|justify|start|end)$/.test(value) ? value : '';
467
+ if (property === 'font-weight') return /^(normal|bold|bolder|lighter|[1-9]00)$/.test(value) ? value : '';
468
+ if (property === 'font-style') return /^(normal|italic|oblique)$/.test(value) ? value : '';
469
+ if (property === 'text-decoration-line') return /^(none|((underline|line-through|overline)\\s*)+)$/.test(value) ? value : '';
470
+ return /^(#[0-9a-f]{3,8}|rgba?\\([0-9.,%\\s]+\\)|hsla?\\([0-9.,%\\sdeg]+\\)|[a-z]+)$/.test(value) ? value : '';
471
+ }
472
+ function setStyle(copy, property, value) {
473
+ var safe = styleValue(property, value);
474
+ if (safe) copy.style.setProperty(property, safe);
475
+ }
476
+ function applyStyles(node, copy, tag) {
477
+ if (tag === 'font') {
478
+ setStyle(copy, 'color', node.getAttribute('color'));
479
+ var size = parseInt(node.getAttribute('size') || '', 10);
480
+ if (size >= 1 && size <= 7) copy.style.setProperty('font-size', FONT_SIZES[size] + 'px');
481
+ }
482
+ if (node.hasAttribute('bgcolor')) setStyle(copy, 'background-color', node.getAttribute('bgcolor'));
483
+ if (node.hasAttribute('align') && tag !== 'img' && tag !== 'table') setStyle(copy, 'text-align', node.getAttribute('align'));
484
+ var declared = node.style;
485
+ if (!declared) return;
486
+ STYLE_PROPERTIES.forEach(function (property) { setStyle(copy, property, declared.getPropertyValue(property)); });
487
+ }
488
+
489
+ function inlineImage(src) {
490
+ var images = state.card && isObject(state.card.body) && isObject(state.card.body.inlineImages) ? state.card.body.inlineImages : {};
491
+ var id = src.slice(4).trim().replace(/^<|>$/g, '');
492
+ try { id = decodeURIComponent(id); } catch (error) {}
493
+ var url = Object.prototype.hasOwnProperty.call(images, id) ? images[id] : '';
494
+ return typeof url === 'string' && SAFE_IMAGE.test(url) ? url : '';
495
+ }
496
+ function imageFor(node) {
497
+ var src = (node.getAttribute('src') || '').trim();
498
+ var alt = (node.getAttribute('alt') || '').slice(0, 200);
499
+ if (/^cid:/i.test(src)) src = inlineImage(src) || src;
500
+ if (SAFE_IMAGE.test(src)) {
501
+ var img = document.createElement('img');
502
+ img.alt = alt;
503
+ img.src = src;
504
+ return img;
505
+ }
506
+ var label = /^cid:/i.test(src) ? 'Inline image' : /^https?:/i.test(src) ? 'Image from ' + clipped(src) : 'Image';
507
+ return el('span', 'placeholder', '[' + label + (alt ? ': ' + alt : '') + ']');
508
+ }
509
+
510
+ // Removes the outer margin at one edge of the formatted body, so its first and last lines sit at the box's
511
+ // padding. Stops at text, which has no margin to remove.
512
+ function flush(node, edge) {
513
+ for (var depth = 0; depth < 8; depth++) {
514
+ var child = edge === 'top' ? node.firstChild : node.lastChild;
515
+ while (child && child.nodeType === 3 && !/\\S/.test(child.nodeValue || '')) child = edge === 'top' ? child.nextSibling : child.previousSibling;
516
+ if (!child || child.nodeType !== 1) return;
517
+ child.classList.add('flush-' + edge);
518
+ node = child;
519
+ }
520
+ }
521
+
522
+ function renderBody(container) {
523
+ var body = state.card && isObject(state.card.body) ? state.card.body : {};
524
+ var text = str(body.text);
525
+ var html = str(body.html);
526
+ var box = el('div', 'body-box');
527
+ box.setAttribute('aria-label', 'Message body');
528
+ var rendered = null;
529
+ if (html) {
530
+ try {
531
+ rendered = el('div', 'body-html');
532
+ rendered.appendChild(sanitizedHtml(html));
533
+ } catch (error) { rendered = null; }
534
+ // Formatting that shows nothing must not stand in for a text part that says something.
535
+ if (rendered && !(rendered.textContent || '').trim() && !rendered.querySelector('img')) rendered = null;
536
+ }
537
+ // Both parts are sent, so a message with both can be read either way.
538
+ if (rendered && text) {
539
+ var toggle = el('div', 'toggle');
540
+ toggle.setAttribute('role', 'group');
541
+ toggle.setAttribute('aria-label', 'Body format');
542
+ [['html', 'Formatted'], ['text', 'Plain text']].forEach(function (option) {
543
+ var button = el('button', '', option[1]);
544
+ button.type = 'button';
545
+ button.setAttribute('aria-pressed', String(state.bodyMode === option[0]));
546
+ button.addEventListener('click', function () { state.bodyMode = option[0]; render(); });
547
+ toggle.appendChild(button);
548
+ });
549
+ container.appendChild(toggle);
550
+ }
551
+ var formatted = !!rendered && (state.bodyMode === 'html' || !text);
552
+ // The sheet stays when the plain text is shown, so switching views doesn't reshape the card.
553
+ if (rendered) box.className = 'body-box paper';
554
+ if (formatted) {
555
+ flush(rendered, 'top');
556
+ flush(rendered, 'bottom');
557
+ box.appendChild(rendered);
558
+ } else if (text) {
559
+ box.appendChild(el('pre', 'body-text', text));
560
+ } else {
561
+ box.appendChild(el('span', 'placeholder', 'No message body'));
562
+ }
563
+ container.appendChild(box);
564
+ if ((formatted ? body.htmlTruncated : body.textTruncated) === true) {
565
+ container.appendChild(el('p', 'note', 'This shows only the start of the body. Fluxmail sends all of it.'));
566
+ }
567
+ }
568
+
569
+ function skeleton(label) {
570
+ var box = el('div', 'skeleton');
571
+ box.appendChild(el('span'));
572
+ box.appendChild(el('span'));
573
+ box.appendChild(el('span'));
574
+ box.appendChild(el('p', 'sr-only', label));
575
+ return box;
576
+ }
577
+
578
+ function render() {
579
+ var content = $('content');
580
+ var send = $('send');
581
+ clear(content);
582
+ if (state.phase === 'waiting') { content.appendChild(skeleton('Preparing the preview...')); }
583
+ else if (state.phase === 'cancelled') { content.appendChild(el('p', 'muted', 'The preview was canceled.')); }
584
+ else if (state.phase === 'preview-error') { content.appendChild(el('p', 'muted', 'Fluxmail could not prepare this email. Ask the assistant to fix it.')); }
585
+ if (state.preview) {
586
+ var preview = state.preview;
587
+ var subject = str(preview.subject);
588
+ content.appendChild(el('h2', subject ? 'subject' : 'subject placeholder', subject || 'No subject'));
589
+ var fields = el('dl', 'fields');
590
+ function row(label, value) { fields.appendChild(el('dt', '', label)); fields.appendChild(value); }
591
+ var from = el('dd');
592
+ // The name comes with the card's data only when the outgoing message will carry it.
593
+ from.appendChild(person(state.card ? str(state.card.fromName) : '', str(preview.from)));
594
+ row('From', from);
595
+ row('To', addresses(preview.to));
596
+ if (Array.isArray(preview.cc) && preview.cc.length) row('Cc', addresses(preview.cc));
597
+ if (Array.isArray(preview.bcc) && preview.bcc.length) row('Bcc', addresses(preview.bcc));
598
+ content.appendChild(fields);
599
+ // Attachments sit above the body, so a long body never pushes them out of view.
600
+ var attachments = Array.isArray(preview.attachments) ? preview.attachments : [];
601
+ if (attachments.length) {
602
+ var list = el('ul', 'attachments');
603
+ list.setAttribute('aria-label', 'Attachments');
604
+ attachments.forEach(function (attachment) {
605
+ var filename = isObject(attachment) ? str(attachment.filename) : '';
606
+ var item = el('li');
607
+ var kind = el('span', 'kind', kindLabel(filename));
608
+ kind.setAttribute('aria-hidden', 'true');
609
+ item.appendChild(kind);
610
+ var file = el('span', 'file');
611
+ var name = el('span', 'filename', filename);
612
+ name.title = filename;
613
+ file.appendChild(name);
614
+ var size = isObject(attachment) ? sizeLabel(attachment.sizeBytes) : '';
615
+ if (size) file.appendChild(el('span', 'size', size));
616
+ item.appendChild(file);
617
+ list.appendChild(item);
618
+ });
619
+ content.appendChild(list);
620
+ }
621
+ var section = el('div', 'body-section');
622
+ content.appendChild(section);
623
+ if (state.card) renderBody(section);
624
+ else section.appendChild(el('p', 'note', 'The body is not available in this view. Ask the assistant to show it.'));
625
+ }
626
+ var canSend = !!(state.preview && state.card && state.input);
627
+ var done = state.phase === 'sent' || state.phase === 'unsendable';
628
+ // Without the card's data or the call's arguments the card can't send, so it shows no button.
629
+ send.hidden = !canSend || done;
630
+ send.disabled = state.phase === 'sending';
631
+ send.classList.toggle('busy', state.phase === 'sending');
632
+ $('send-label').textContent = state.phase === 'sending' ? 'Sending...' : 'Send';
633
+ $('actions').hidden = send.hidden && !state.outcome;
634
+ document.body.classList.toggle('no-actions', $('actions').hidden);
635
+ var outcome = $('outcome');
636
+ clear(outcome);
637
+ outcome.hidden = !state.outcome;
638
+ if (state.outcome) outcome.appendChild(banner(state.outcome.tone, state.outcome.title, state.outcome.detail));
639
+ }
640
+
641
+ // A tinted box with a mark, a short title and an optional line of detail.
642
+ function banner(tone, title, detail) {
643
+ var box = el('div', 'banner ' + tone + (detail ? '' : ' compact'));
644
+ var mark = el('span', 'mark', tone === 'success' ? '\u2713' : '!');
645
+ mark.setAttribute('aria-hidden', 'true');
646
+ box.appendChild(mark);
647
+ var text = el('span');
648
+ text.appendChild(el('span', 'title', title));
649
+ if (detail) text.appendChild(el('span', 'detail', detail));
650
+ box.appendChild(text);
651
+ return box;
652
+ }
653
+
654
+ function sendArguments() {
655
+ var args = {};
656
+ Object.keys(state.input).forEach(function (key) { args[key] = state.input[key]; });
657
+ if (state.preview && typeof state.preview.accountId === 'string') args.accountId = state.preview.accountId;
658
+ args.idempotencyKey = state.card.idempotencyKey;
659
+ return args;
660
+ }
661
+
662
+ // Tell the model what happened, so it neither sends again nor claims a send that failed.
663
+ function report(contextText, messageText) {
664
+ request('ui/update-model-context', { content: [{ type: 'text', text: contextText }] }).catch(function () {
665
+ request('ui/message', { role: 'user', content: [{ type: 'text', text: messageText }] }).catch(function () {});
666
+ });
667
+ }
668
+
669
+ // A thrown tool error has no structured result; its text holds { error, message }.
670
+ function toolError(result) {
671
+ var data = isObject(result.structuredContent) && isObject(result.structuredContent.data) ? result.structuredContent.data : null;
672
+ if (data && isObject(data.error)) return { code: str(data.error.code), message: str(data.error.message) };
673
+ var first = Array.isArray(result.content) ? result.content[0] : null;
674
+ try {
675
+ var parsed = JSON.parse(isObject(first) ? str(first.text) : '');
676
+ if (isObject(parsed)) return { code: str(parsed.error), message: str(parsed.message) };
677
+ } catch (error) {}
678
+ return { code: '', message: '' };
679
+ }
680
+
681
+ function onSend() {
682
+ if (state.phase !== 'ready' && state.phase !== 'retry') return;
683
+ if (!state.input || !state.card) return;
684
+ state.phase = 'sending';
685
+ state.outcome = null;
686
+ render();
687
+ request('tools/call', { name: 'send_email', arguments: sendArguments() }).then(function (result) {
688
+ result = isObject(result) ? result : {};
689
+ var data = isObject(result.structuredContent) && isObject(result.structuredContent.data) ? result.structuredContent.data : {};
690
+ var status = str(data.status);
691
+ var operation = str(data.operationId);
692
+ if (!result.isError && (status === 'succeeded' || status === 'sending')) {
693
+ state.phase = 'sent';
694
+ state.outcome = status === 'sending'
695
+ ? { tone: 'success', title: 'Sending', detail: 'Fluxmail is finishing this delivery.' }
696
+ : { tone: 'success', title: 'Sent', detail: '' };
697
+ render();
698
+ report(
699
+ 'The user sent this email with the Fluxmail preview card (delivery operation ' + operation + ', status ' + status + '). Do not send it again.',
700
+ 'I sent the email from the preview. Do not send it again.'
701
+ );
702
+ return;
703
+ }
704
+ state.phase = 'unsendable';
705
+ if (status === 'uncertain') {
706
+ state.outcome = { tone: 'warning', title: 'Couldn\u2019t confirm the send', detail: 'Check your Sent folder before trying again.' };
707
+ report(
708
+ 'The user clicked Send on the Fluxmail preview card, but delivery operation ' + operation + ' has an uncertain outcome. ' +
709
+ 'The email may have been sent. Do not send it again unless the user confirms it is not in their Sent folder.',
710
+ 'I clicked Send on the email preview, but Fluxmail could not confirm whether it was sent. Do not send it again until I check my Sent folder.'
711
+ );
712
+ } else {
713
+ var error = toolError(result);
714
+ state.outcome = { tone: 'error', title: 'Not sent', detail: error.message };
715
+ report(
716
+ 'The user clicked Send on the Fluxmail preview card and the email was not sent' + (error.message ? ': ' + error.message : '.'),
717
+ 'I clicked Send on the email preview and it was not sent' + (error.message ? ': ' + error.message : '.')
718
+ );
719
+ }
720
+ render();
721
+ }, function (error) {
722
+ // The host did not run the call. Sending again reuses the key, so a send that did go out is not repeated.
723
+ state.phase = 'retry';
724
+ state.outcome = { tone: 'error', title: 'Not sent', detail: (isObject(error) && str(error.message)) || 'Something went wrong. Try again.' };
725
+ report(
726
+ 'The user clicked Send on the Fluxmail preview card and the host returned an error, so it is not known whether the email was sent. Do not send it yourself: a new send could deliver it twice. The user can click Send on the card again, which cannot send it twice.',
727
+ 'I clicked Send on the email preview and got an error, so I don\u2019t know whether it was sent. Do not send it again; I can retry from the card.'
728
+ );
729
+ render();
730
+ });
731
+ }
732
+
733
+ function watchSize() {
734
+ var scheduled = false, lastWidth = 0, lastHeight = 0;
735
+ function measure() {
736
+ if (scheduled) return;
737
+ scheduled = true;
738
+ requestAnimationFrame(function () {
739
+ scheduled = false;
740
+ var root = document.documentElement;
741
+ var previous = root.style.height;
742
+ root.style.height = 'max-content';
743
+ var height = Math.ceil(root.getBoundingClientRect().height);
744
+ root.style.height = previous;
745
+ var width = Math.ceil(window.innerWidth);
746
+ if (width !== lastWidth || height !== lastHeight) {
747
+ lastWidth = width;
748
+ lastHeight = height;
749
+ notify('ui/notifications/size-changed', { width: width, height: height });
750
+ }
751
+ });
752
+ }
753
+ measure();
754
+ if (typeof ResizeObserver === 'function') {
755
+ var observer = new ResizeObserver(measure);
756
+ observer.observe(document.documentElement);
757
+ observer.observe(document.body);
758
+ }
759
+ }
760
+
761
+ $('send').addEventListener('click', onSend);
762
+ render();
763
+ markSurface();
764
+ if (window.matchMedia) window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', markSurface);
765
+ request('ui/initialize', {
766
+ appInfo: { name: 'Fluxmail send confirmation', version: '1' },
767
+ appCapabilities: { availableDisplayModes: ['inline'] },
768
+ protocolVersion: PROTOCOL_VERSION
769
+ }).then(function (result) {
770
+ if (isObject(result)) applyHostContext(result.hostContext);
771
+ notify('ui/notifications/initialized', {});
772
+ watchSize();
773
+ }, function () {
774
+ notify('ui/notifications/initialized', {});
775
+ watchSize();
776
+ });
777
+ })();
778
+ `;
779
+ /**
780
+ * The view's own Content Security Policy, applied on top of the host's. It never relaxes the host's policy,
781
+ * and it leaves script-src and style-src to the host so host-injected bootstrap code keeps working.
782
+ */
783
+ const DOCUMENT_CSP = [
784
+ "connect-src 'none'",
785
+ 'img-src data:',
786
+ "media-src 'none'",
787
+ "font-src 'none'",
788
+ "frame-src 'none'",
789
+ "object-src 'none'",
790
+ "base-uri 'none'",
791
+ "form-action 'none'",
792
+ ].join('; ');
793
+ export const SEND_CONFIRMATION_HTML = `<!DOCTYPE html>
794
+ <html lang="en">
795
+ <head>
796
+ <meta charset="utf-8">
797
+ <meta name="viewport" content="width=device-width, initial-scale=1">
798
+ <meta http-equiv="Content-Security-Policy" content="${DOCUMENT_CSP}">
799
+ <meta name="referrer" content="no-referrer">
800
+ <title>Send email</title>
801
+ <style>${STYLE}</style>
802
+ </head>
803
+ <body>
804
+ <main>
805
+ <h1 class="sr-only">Send email</h1>
806
+ <div id="content" aria-live="polite"></div>
807
+ <footer id="actions" hidden>
808
+ <div id="outcome" role="status" hidden></div>
809
+ <button id="send" type="button" class="primary" hidden disabled><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 2 11 13"/><path d="M22 2 15 22l-4-9-9-4z"/></svg><span class="spinner" aria-hidden="true"></span><span id="send-label">Send</span></button>
810
+ </footer>
811
+ </main>
812
+ <script>${SCRIPT}</script>
813
+ </body>
814
+ </html>
815
+ `;
816
+ //# sourceMappingURL=sendConfirmationView.js.map