@aglyn/plugins-ai 1.9.1 → 1.11.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 (82) hide show
  1. package/package.json +17 -17
  2. package/src/lib/components/ai-job-requests.d.ts +5 -0
  3. package/src/lib/components/ai-job-requests.js +4 -0
  4. package/src/lib/components/ai-job-requests.js.map +1 -1
  5. package/src/lib/components/ai-site-build-page.component.js +10 -3
  6. package/src/lib/components/ai-site-build-page.component.js.map +1 -1
  7. package/src/lib/components/ai-site-import-finish.component.d.ts +40 -0
  8. package/src/lib/components/ai-site-import-finish.component.js +174 -0
  9. package/src/lib/components/ai-site-import-finish.component.js.map +1 -0
  10. package/src/lib/components/ai-site-import-job.component.d.ts +11 -3
  11. package/src/lib/components/ai-site-import-job.component.js +220 -135
  12. package/src/lib/components/ai-site-import-job.component.js.map +1 -1
  13. package/src/lib/components/ai-site-import-start.component.d.ts +11 -2
  14. package/src/lib/components/ai-site-import-start.component.js +27 -5
  15. package/src/lib/components/ai-site-import-start.component.js.map +1 -1
  16. package/src/lib/components/ai-site-start-card.component.js +1 -1
  17. package/src/lib/components/ai-site-start-card.component.js.map +1 -1
  18. package/src/lib/jobs/ai-build-capabilities.js +2 -2
  19. package/src/lib/jobs/ai-build-capabilities.js.map +1 -1
  20. package/src/lib/jobs/ai-job-import-step.d.ts +2 -0
  21. package/src/lib/jobs/ai-job-import-step.js +31 -8
  22. package/src/lib/jobs/ai-job-import-step.js.map +1 -1
  23. package/src/lib/jobs/ai-job-page-language.d.ts +40 -2
  24. package/src/lib/jobs/ai-job-page-language.js +188 -9
  25. package/src/lib/jobs/ai-job-page-language.js.map +1 -1
  26. package/src/lib/jobs/ai-job-page-step.js +2 -0
  27. package/src/lib/jobs/ai-job-page-step.js.map +1 -1
  28. package/src/lib/jobs/ai-job-privacy-step.d.ts +5 -0
  29. package/src/lib/jobs/ai-job-privacy-step.js +9 -4
  30. package/src/lib/jobs/ai-job-privacy-step.js.map +1 -1
  31. package/src/lib/jobs/ai-job-text-step.d.ts +7 -1
  32. package/src/lib/jobs/ai-job-text-step.js.map +1 -1
  33. package/src/lib/jobs/ai-site-import-compile.d.ts +13 -2
  34. package/src/lib/jobs/ai-site-import-compile.js +115 -21
  35. package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
  36. package/src/lib/jobs/ai-site-import-document.d.ts +5 -1
  37. package/src/lib/jobs/ai-site-import-document.js +5 -1
  38. package/src/lib/jobs/ai-site-import-document.js.map +1 -1
  39. package/src/lib/jobs/ai-site-import-look.d.ts +16 -4
  40. package/src/lib/jobs/ai-site-import-look.js +54 -13
  41. package/src/lib/jobs/ai-site-import-look.js.map +1 -1
  42. package/src/lib/jobs/ai-site-import-wording.d.ts +187 -0
  43. package/src/lib/jobs/ai-site-import-wording.js +747 -0
  44. package/src/lib/jobs/ai-site-import-wording.js.map +1 -0
  45. package/src/lib/layout-language/ai-layout-compiler.d.ts +12 -1
  46. package/src/lib/layout-language/ai-layout-compiler.js +29 -30
  47. package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
  48. package/src/lib/layout-language/ai-layout-language.d.ts +12 -0
  49. package/src/lib/layout-language/ai-layout-language.js.map +1 -1
  50. package/src/lib/model/ai-site-import-fidelity.d.ts +211 -2
  51. package/src/lib/model/ai-site-import-fidelity.js +1011 -14
  52. package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
  53. package/src/lib/model/ai-site-import-report.d.ts +52 -1
  54. package/src/lib/model/ai-site-import-report.js +102 -5
  55. package/src/lib/model/ai-site-import-report.js.map +1 -1
  56. package/src/lib/model/ai-site-import-view.d.ts +62 -2
  57. package/src/lib/model/ai-site-import-view.js +83 -4
  58. package/src/lib/model/ai-site-import-view.js.map +1 -1
  59. package/src/lib/model/ai-site-import.d.ts +122 -6
  60. package/src/lib/model/ai-site-import.js +202 -9
  61. package/src/lib/model/ai-site-import.js.map +1 -1
  62. package/src/lib/model/ai-site-look.d.ts +51 -0
  63. package/src/lib/model/ai-site-look.js +205 -29
  64. package/src/lib/model/ai-site-look.js.map +1 -1
  65. package/src/lib/runtime/ai-doctrine-validators.d.ts +19 -0
  66. package/src/lib/runtime/ai-doctrine-validators.js +25 -0
  67. package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
  68. package/src/lib/runtime/ai-doctrine.js +4 -1
  69. package/src/lib/runtime/ai-doctrine.js.map +1 -1
  70. package/src/lib/server/ai-allotments.js +4 -2
  71. package/src/lib/server/ai-allotments.js.map +1 -1
  72. package/src/lib/server/ai-jobs-resume.js +32 -5
  73. package/src/lib/server/ai-jobs-resume.js.map +1 -1
  74. package/src/lib/site-import/fixtures/site-import-fidelity-replay.d.ts +36 -10
  75. package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +48 -4
  76. package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
  77. package/src/lib/site-import/fixtures/site-look-slate.d.ts +27 -0
  78. package/src/lib/site-import/fixtures/site-look-slate.js +29 -0
  79. package/src/lib/site-import/fixtures/site-look-slate.js.map +1 -0
  80. package/src/lib/site-import/site-import-layout.d.ts +19 -5
  81. package/src/lib/site-import/site-import-layout.js +137 -16
  82. package/src/lib/site-import/site-import-layout.js.map +1 -1
@@ -21,11 +21,12 @@ import { buildRoute, Route } from "@aglyn/aglyn/app-utils/console-routes";
21
21
  import { mdiAlertCircle, mdiCheckCircle, mdiChevronDown, mdiClockOutline, mdiMinusCircleOutline, mdiOpenInNew } from "@aglyn/shared-data-mdi";
22
22
  import { AppLink, HelpTip, MdiIcon } from "@aglyn/shared-ui-jsx";
23
23
  import { Accordion, AccordionDetails, AccordionSummary, Alert, Box, Button, Card, CircularProgress, Container, LinearProgress, Stack, Typography } from "@mui/material";
24
- import { useCallback, useState } from "react";
25
- import { aiSiteImportReviewWave, aiSiteImportRunningWave } from "../model/ai-site-import.js";
26
- import { aiSiteImportFoundText, aiSiteImportHeldCopy, aiSiteImportLeftOutLines, aiSiteImportPhaseOf, aiSiteImportPlanText, aiSiteImportStartAction, aiSiteImportStartAllAction, aiSiteImportStoppedCopy, aiSiteImportVerdictNote, aiSiteImportWaveRows, aiSiteImportWaveSpent } from "../model/ai-site-import-view.js";
24
+ import { useCallback, useEffect, useState } from "react";
25
+ import { aiSiteImportReviewWave, aiSiteImportRunningWave, aiSiteImportWaveChoice } from "../model/ai-site-import.js";
26
+ import { AI_SITE_IMPORT_FINISH_COPY, aiSiteImportChoiceText, aiSiteImportFieldChoice, aiSiteImportFinishFieldOf, aiSiteImportFoundText, aiSiteImportHeldCopy, aiSiteImportLeftOutLines, aiSiteImportPhaseOf, aiSiteImportPlanText, aiSiteImportRunningLede, aiSiteImportStartAction, aiSiteImportStartAllAction, aiSiteImportStoppedCopy, aiSiteImportVerdictNote, aiSiteImportWaveHeading, aiSiteImportWaveRows, aiSiteImportWaveSpent, aiSiteImportWordingCreditsText } from "../model/ai-site-import-view.js";
27
27
  import { AiJobCancelButton } from "./ai-job-cancel.component.js";
28
28
  import { aiCreditsBillingHref, aiJobOutputHref } from "./ai-job-links.js";
29
+ import { AiSiteImportFinish } from "./ai-site-import-finish.component.js";
29
30
  import { AI_SITE_IMPORT_HELP } from "./ai-site-import-start.component.js";
30
31
  import { AiSiteOwnershipProof, postAiSiteOwnership } from "./ai-site-ownership-proof.component.js";
31
32
  const ROW_ICON = {
@@ -73,8 +74,9 @@ function RowIcon({ state }) {
73
74
  }
74
75
  /** One wave's pages: where each was, where it is now, how it went, and its draft to open. */ function WaveRows({ job, wave, orgSlug }) {
75
76
  const rows = aiSiteImportWaveRows(job, wave);
76
- return /*#__PURE__*/ _jsx(Box, {
77
+ return /*#__PURE__*/ _jsx(Stack, {
77
78
  component: "ol",
79
+ spacing: 2,
78
80
  "aria-label": wave.label,
79
81
  sx: {
80
82
  listStyle: 'none',
@@ -84,114 +86,111 @@ function RowIcon({ state }) {
84
86
  sm: 3
85
87
  }
86
88
  },
87
- children: /*#__PURE__*/ _jsx(Stack, {
88
- spacing: 2,
89
- children: rows.map((row)=>{
90
- const output = row.outputId ? job.outputs.find((entry)=>entry.id === row.outputId) : undefined;
91
- const href = output ? aiJobOutputHref(output, orgSlug) : null;
92
- return /*#__PURE__*/ _jsxs(Stack, {
93
- component: "li",
94
- direction: "row",
95
- spacing: 2,
96
- sx: {
97
- alignItems: 'flex-start'
98
- },
99
- children: [
100
- /*#__PURE__*/ _jsx(Box, {
101
- sx: {
102
- width: (theme)=>theme.spacing(3),
103
- display: 'flex',
104
- justifyContent: 'center'
105
- },
106
- children: /*#__PURE__*/ _jsx(RowIcon, {
107
- state: row.state
108
- })
109
- }),
110
- /*#__PURE__*/ _jsxs(Box, {
111
- sx: {
112
- flex: 1,
113
- minWidth: 0
114
- },
115
- children: [
116
- /*#__PURE__*/ _jsxs(Stack, {
117
- direction: "row",
118
- spacing: 1,
119
- sx: {
120
- alignItems: 'baseline',
121
- justifyContent: 'space-between'
122
- },
123
- children: [
124
- /*#__PURE__*/ _jsx(Typography, {
125
- variant: "body1",
126
- color: row.state === 'waiting' || row.state === 'skipped' ? 'text.secondary' : 'text.primary',
127
- children: row.title
128
- }),
129
- href && row.state === 'done' ? /*#__PURE__*/ _jsx(Button, {
130
- size: "small",
131
- component: AppLink,
132
- href: href,
133
- children: 'Open draft'
134
- }) : null
135
- ]
136
- }),
137
- /*#__PURE__*/ _jsxs(Stack, {
138
- direction: "row",
139
- spacing: 1,
140
- sx: {
141
- alignItems: 'baseline',
142
- flexWrap: 'wrap'
143
- },
144
- children: [
145
- /*#__PURE__*/ _jsx(Typography, {
146
- variant: "body2",
147
- color: "text.secondary",
148
- sx: {
149
- overflowWrap: 'anywhere'
150
- },
151
- children: `${row.from} → ${row.to}`
152
- }),
153
- /*#__PURE__*/ _jsx(Button, {
154
- size: "small",
155
- component: "a",
156
- href: row.oldPage,
157
- target: "_blank",
158
- rel: "noopener noreferrer",
159
- endIcon: /*#__PURE__*/ _jsx(MdiIcon, {
160
- path: mdiOpenInNew.path,
161
- "aria-hidden": true
162
- }),
163
- "aria-label": `Old page: ${row.from}, opens in a new tab`,
164
- sx: {
165
- minWidth: 0,
166
- py: 0
167
- },
168
- children: 'Old page'
169
- })
170
- ]
171
- }),
172
- row.build || row.words ? /*#__PURE__*/ _jsx(Typography, {
173
- variant: "body2",
174
- color: "text.secondary",
175
- children: [
176
- row.build,
177
- row.words
178
- ].filter(Boolean).join(' · ')
179
- }) : null,
180
- row.photos ? /*#__PURE__*/ _jsx(Typography, {
181
- variant: "body2",
182
- color: "text.secondary",
183
- children: row.photos
184
- }) : null,
185
- row.note && row.state !== 'done' ? /*#__PURE__*/ _jsx(Typography, {
186
- variant: "body2",
187
- color: "text.secondary",
188
- children: row.note
189
- }) : null
190
- ]
89
+ children: rows.map((row)=>{
90
+ const output = row.outputId ? job.outputs.find((entry)=>entry.id === row.outputId) : undefined;
91
+ const href = output ? aiJobOutputHref(output, orgSlug) : null;
92
+ return /*#__PURE__*/ _jsxs(Stack, {
93
+ component: "li",
94
+ direction: "row",
95
+ spacing: 2,
96
+ sx: {
97
+ alignItems: 'flex-start'
98
+ },
99
+ children: [
100
+ /*#__PURE__*/ _jsx(Box, {
101
+ sx: {
102
+ width: (theme)=>theme.spacing(3),
103
+ display: 'flex',
104
+ justifyContent: 'center'
105
+ },
106
+ children: /*#__PURE__*/ _jsx(RowIcon, {
107
+ state: row.state
191
108
  })
192
- ]
193
- }, row.slot);
194
- })
109
+ }),
110
+ /*#__PURE__*/ _jsxs(Box, {
111
+ sx: {
112
+ flex: 1,
113
+ minWidth: 0
114
+ },
115
+ children: [
116
+ /*#__PURE__*/ _jsxs(Stack, {
117
+ direction: "row",
118
+ spacing: 1,
119
+ sx: {
120
+ alignItems: 'baseline',
121
+ justifyContent: 'space-between'
122
+ },
123
+ children: [
124
+ /*#__PURE__*/ _jsx(Typography, {
125
+ variant: "body1",
126
+ color: row.state === 'waiting' || row.state === 'skipped' ? 'text.secondary' : 'text.primary',
127
+ children: row.title
128
+ }),
129
+ href && row.state === 'done' ? /*#__PURE__*/ _jsx(Button, {
130
+ size: "small",
131
+ component: AppLink,
132
+ href: href,
133
+ children: 'Open draft'
134
+ }) : null
135
+ ]
136
+ }),
137
+ /*#__PURE__*/ _jsxs(Stack, {
138
+ direction: "row",
139
+ spacing: 1,
140
+ sx: {
141
+ alignItems: 'baseline',
142
+ flexWrap: 'wrap'
143
+ },
144
+ children: [
145
+ /*#__PURE__*/ _jsx(Typography, {
146
+ variant: "body2",
147
+ color: "text.secondary",
148
+ sx: {
149
+ overflowWrap: 'anywhere'
150
+ },
151
+ children: `${row.from} → ${row.to}`
152
+ }),
153
+ /*#__PURE__*/ _jsx(Button, {
154
+ size: "small",
155
+ component: "a",
156
+ href: row.oldPage,
157
+ target: "_blank",
158
+ rel: "noopener noreferrer",
159
+ endIcon: /*#__PURE__*/ _jsx(MdiIcon, {
160
+ path: mdiOpenInNew.path,
161
+ "aria-hidden": true
162
+ }),
163
+ "aria-label": `Old page: ${row.from}, opens in a new tab`,
164
+ sx: {
165
+ minWidth: 0,
166
+ py: 0
167
+ },
168
+ children: 'Old page'
169
+ })
170
+ ]
171
+ }),
172
+ row.build || row.words ? /*#__PURE__*/ _jsx(Typography, {
173
+ variant: "body2",
174
+ color: "text.secondary",
175
+ children: [
176
+ row.build,
177
+ row.words
178
+ ].filter(Boolean).join(' · ')
179
+ }) : null,
180
+ row.photos ? /*#__PURE__*/ _jsx(Typography, {
181
+ variant: "body2",
182
+ color: "text.secondary",
183
+ children: row.photos
184
+ }) : null,
185
+ row.note && row.state !== 'done' ? /*#__PURE__*/ _jsx(Typography, {
186
+ variant: "body2",
187
+ color: "text.secondary",
188
+ children: row.note
189
+ }) : null
190
+ ]
191
+ })
192
+ ]
193
+ }, row.slot);
195
194
  })
196
195
  });
197
196
  }
@@ -247,12 +246,34 @@ function Frame({ siteName, heading, lede, children }) {
247
246
  * a wave in for its review with its drafts to open, and the next wave's
248
247
  * button — the only way the next one starts. A wave held for a new proof, the
249
248
  * day's limit or a site that could not be read says so and offers the way on.
249
+ *
250
+ * Before a wave starts, the page says how it will be built, Keep my site or
251
+ * Improve it, and Change opens the choice (AGL-4152); the wave's button posts
252
+ * it. Each wave that has started says how it was built, which never changes.
250
253
  */ export function AiSiteImportJob({ job, orgId, orgSlug, host, siteName, user, busy, notice, onResume, onStartAll, onJob }) {
251
- var _job_siteImport, _job_error;
254
+ var _job_siteImport, _ref, _ref1, _job_error;
252
255
  const phase = aiSiteImportPhaseOf(job);
253
256
  const state = (_job_siteImport = job.siteImport) != null ? _job_siteImport : null;
254
257
  const start = aiSiteImportStartAction(job);
255
258
  const startAll = onStartAll ? aiSiteImportStartAllAction(job) : null;
259
+ // Keep my site or Improve it (AGL-4152), changeable while the next wave has not started.
260
+ const choosable = (start == null ? void 0 : start.wave.status) === 'waiting';
261
+ const [field, setField] = useState(()=>aiSiteImportFinishFieldOf(state));
262
+ const [choosing, setChoosing] = useState(false);
263
+ const storedFinish = (_ref = state == null ? void 0 : state.finish) != null ? _ref : null;
264
+ const storedWording = (_ref1 = state == null ? void 0 : state.wording) != null ? _ref1 : null;
265
+ useEffect(()=>{
266
+ // The import's own choice, once it changes elsewhere, unless the person is choosing here.
267
+ if (!choosing) setField(aiSiteImportFinishFieldOf({
268
+ finish: storedFinish,
269
+ wording: storedWording
270
+ }));
271
+ }, [
272
+ storedFinish,
273
+ storedWording,
274
+ choosing
275
+ ]);
276
+ const choice = choosable ? aiSiteImportFieldChoice(field) : undefined;
256
277
  const held = aiSiteImportHeldCopy(job);
257
278
  const pagesHref = host && orgSlug ? buildRoute(Route.HOST_SCREENS, {
258
279
  orgSlug,
@@ -285,9 +306,40 @@ function Frame({ siteName, heading, lede, children }) {
285
306
  size: "small"
286
307
  })
287
308
  });
309
+ const finishChoice = start && choosable ? choosing ? /*#__PURE__*/ _jsx(AiSiteImportFinish, {
310
+ value: field,
311
+ onChange: setField,
312
+ wordingCredits: aiSiteImportWordingCreditsText({
313
+ job,
314
+ wave: start.wave
315
+ }),
316
+ help: AI_SITE_IMPORT_HELP.finish,
317
+ disabled: busy
318
+ }) : /*#__PURE__*/ _jsxs(Stack, {
319
+ direction: "row",
320
+ spacing: 1,
321
+ sx: {
322
+ alignItems: 'center',
323
+ flexWrap: 'wrap'
324
+ },
325
+ children: [
326
+ /*#__PURE__*/ _jsx(Typography, {
327
+ variant: "body2",
328
+ children: `${AI_SITE_IMPORT_FINISH_COPY.current}: ${aiSiteImportChoiceText(aiSiteImportFieldChoice(field))}`
329
+ }),
330
+ /*#__PURE__*/ _jsx(Button, {
331
+ size: "small",
332
+ disabled: busy,
333
+ onClick: ()=>setChoosing(true),
334
+ "aria-label": `${AI_SITE_IMPORT_FINISH_COPY.change} how your new site looks`,
335
+ children: AI_SITE_IMPORT_FINISH_COPY.change
336
+ })
337
+ ]
338
+ }) : null;
288
339
  const startButton = start ? /*#__PURE__*/ _jsxs(Stack, {
289
340
  spacing: 1,
290
341
  children: [
342
+ finishChoice,
291
343
  /*#__PURE__*/ _jsxs(Stack, {
292
344
  direction: {
293
345
  xs: 'column',
@@ -305,7 +357,7 @@ function Frame({ siteName, heading, lede, children }) {
305
357
  variant: "contained",
306
358
  size: "large",
307
359
  disabled: busy,
308
- onClick: onResume,
360
+ onClick: ()=>onResume(choice),
309
361
  children: busy ? 'Starting…' : start.label
310
362
  })
311
363
  }),
@@ -314,7 +366,7 @@ function Frame({ siteName, heading, lede, children }) {
314
366
  variant: "outlined",
315
367
  size: "large",
316
368
  disabled: busy,
317
- onClick: onStartAll,
369
+ onClick: ()=>onStartAll(choice),
318
370
  children: startAll.label
319
371
  })
320
372
  }) : null
@@ -347,6 +399,11 @@ function Frame({ siteName, heading, lede, children }) {
347
399
  const waves = state ? /*#__PURE__*/ _jsxs(Accordion, {
348
400
  variant: "outlined",
349
401
  disableGutters: true,
402
+ slotProps: {
403
+ heading: {
404
+ component: 'h2'
405
+ }
406
+ },
350
407
  sx: {
351
408
  borderRadius: 2,
352
409
  '&::before': {
@@ -360,6 +417,7 @@ function Frame({ siteName, heading, lede, children }) {
360
417
  }),
361
418
  children: /*#__PURE__*/ _jsx(Typography, {
362
419
  variant: "subtitle1",
420
+ component: "span",
363
421
  children: `Every wave (${state.waves.length})`
364
422
  })
365
423
  }),
@@ -374,7 +432,7 @@ function Frame({ siteName, heading, lede, children }) {
374
432
  children: state.waves.map((wave)=>/*#__PURE__*/ _jsx(Typography, {
375
433
  component: "li",
376
434
  variant: "body2",
377
- children: `${wave.label}: ${wave.slots.length} ${wave.slots.length === 1 ? 'page' : 'pages'}${wave.frame ? ', with your header and footer' : ''}${wave.status === 'done' || wave.status === 'review' ? ' (in)' : wave.status === 'running' ? ' (running)' : wave.status === 'stopped' ? wave.startedAt ? ' (stopped)' : ' (not started)' : ''}`
435
+ children: `${aiSiteImportWaveHeading(state, wave)}: ${wave.slots.length} ${wave.slots.length === 1 ? 'page' : 'pages'}${wave.frame ? ', with your header and footer' : ''}${wave.status === 'done' || wave.status === 'review' ? ' (in)' : wave.status === 'running' ? ' (running)' : wave.status === 'stopped' ? wave.startedAt ? ' (stopped)' : ' (not started)' : ''}`
378
436
  }, wave.index))
379
437
  })
380
438
  })
@@ -384,6 +442,11 @@ function Frame({ siteName, heading, lede, children }) {
384
442
  const leftOutCard = leftOut.length ? /*#__PURE__*/ _jsxs(Accordion, {
385
443
  variant: "outlined",
386
444
  disableGutters: true,
445
+ slotProps: {
446
+ heading: {
447
+ component: 'h2'
448
+ }
449
+ },
387
450
  sx: {
388
451
  borderRadius: 2,
389
452
  '&::before': {
@@ -397,6 +460,7 @@ function Frame({ siteName, heading, lede, children }) {
397
460
  }),
398
461
  children: /*#__PURE__*/ _jsx(Typography, {
399
462
  variant: "subtitle1",
463
+ component: "span",
400
464
  children: `Not brought in (${leftOut.reduce((total, line)=>total + line.count, 0)})`
401
465
  })
402
466
  }),
@@ -468,12 +532,12 @@ function Frame({ siteName, heading, lede, children }) {
468
532
  });
469
533
  }
470
534
  if (phase === 'ready' && state) {
471
- var _ref;
535
+ var _ref2;
472
536
  var _job_review;
473
537
  return /*#__PURE__*/ _jsxs(Frame, {
474
538
  siteName: siteName,
475
539
  heading: aiSiteImportStoppedCopy(job) ? 'Your import is waiting for you' : 'Your site is read',
476
- lede: (_ref = (_job_review = job.review) == null ? void 0 : _job_review.message) != null ? _ref : undefined,
540
+ lede: (_ref2 = (_job_review = job.review) == null ? void 0 : _job_review.message) != null ? _ref2 : undefined,
477
541
  children: [
478
542
  notice && /*#__PURE__*/ _jsx(Alert, {
479
543
  severity: "warning",
@@ -505,6 +569,7 @@ function Frame({ siteName, heading, lede, children }) {
505
569
  children: [
506
570
  /*#__PURE__*/ _jsx(Typography, {
507
571
  variant: "subtitle1",
572
+ component: "h2",
508
573
  sx: {
509
574
  px: {
510
575
  xs: 2,
@@ -515,7 +580,7 @@ function Frame({ siteName, heading, lede, children }) {
515
580
  sm: 3
516
581
  }
517
582
  },
518
- children: `First: ${start.wave.label}`
583
+ children: `First: ${aiSiteImportWaveHeading(state, start.wave)}`
519
584
  }),
520
585
  /*#__PURE__*/ _jsx(WaveRows, {
521
586
  job: job,
@@ -532,14 +597,15 @@ function Frame({ siteName, heading, lede, children }) {
532
597
  });
533
598
  }
534
599
  if ((phase === 'running' || phase === 'starting') && state) {
535
- var _ref1, _aiSiteImportRunningWave;
536
- const wave = (_ref1 = (_aiSiteImportRunningWave = aiSiteImportRunningWave(state)) != null ? _aiSiteImportRunningWave : start == null ? void 0 : start.wave) != null ? _ref1 : null;
600
+ var _ref3, _aiSiteImportRunningWave;
601
+ const wave = (_ref3 = (_aiSiteImportRunningWave = aiSiteImportRunningWave(state)) != null ? _aiSiteImportRunningWave : start == null ? void 0 : start.wave) != null ? _ref3 : null;
537
602
  const rows = wave ? aiSiteImportWaveRows(job, wave) : [];
538
603
  const done = rows.filter((row)=>row.state !== 'waiting' && row.state !== 'active').length;
539
604
  return /*#__PURE__*/ _jsxs(Frame, {
540
605
  siteName: siteName,
541
606
  heading: wave ? `Bringing in ${wave.label}` : 'Bringing in your site',
542
- lede: "Each page is rewritten into your new site’s design with its own words, facts and photos. You review the wave when it is in.",
607
+ // What the wave does with each page, the way it is built (AGL-4152).
608
+ lede: aiSiteImportRunningLede(wave ? aiSiteImportWaveChoice(state, wave) : aiSiteImportFieldChoice(field)),
543
609
  children: [
544
610
  /*#__PURE__*/ _jsxs(Card, {
545
611
  variant: "outlined",
@@ -567,12 +633,12 @@ function Frame({ siteName, heading, lede, children }) {
567
633
  });
568
634
  }
569
635
  if (phase === 'review' && state) {
570
- var _ref2;
636
+ var _ref4;
571
637
  var _job_sitePublish;
572
638
  const wave = aiSiteImportReviewWave(state);
573
639
  const spent = aiSiteImportWaveSpent(job, wave);
574
640
  // A site in preview has the wave's pages live for its team (AGL-4084); any other has them as drafts.
575
- const live = new Set(((_ref2 = (_job_sitePublish = job.sitePublish) == null ? void 0 : _job_sitePublish.published) != null ? _ref2 : []).map((page)=>page.id));
641
+ const live = new Set(((_ref4 = (_job_sitePublish = job.sitePublish) == null ? void 0 : _job_sitePublish.published) != null ? _ref4 : []).map((page)=>page.id));
576
642
  const inPreview = wave.slots.some((slot)=>{
577
643
  var _ref;
578
644
  var _state_pages_find;
@@ -587,16 +653,33 @@ function Frame({ siteName, heading, lede, children }) {
587
653
  severity: "warning",
588
654
  children: notice
589
655
  }),
590
- /*#__PURE__*/ _jsx(Card, {
656
+ /*#__PURE__*/ _jsxs(Card, {
591
657
  variant: "outlined",
592
658
  sx: {
593
659
  borderRadius: 2
594
660
  },
595
- children: /*#__PURE__*/ _jsx(WaveRows, {
596
- job: job,
597
- wave: wave,
598
- orgSlug: orgSlug
599
- })
661
+ children: [
662
+ /*#__PURE__*/ _jsx(Typography, {
663
+ variant: "subtitle1",
664
+ component: "h2",
665
+ sx: {
666
+ px: {
667
+ xs: 2,
668
+ sm: 3
669
+ },
670
+ pt: {
671
+ xs: 2,
672
+ sm: 3
673
+ }
674
+ },
675
+ children: aiSiteImportWaveHeading(state, wave)
676
+ }),
677
+ /*#__PURE__*/ _jsx(WaveRows, {
678
+ job: job,
679
+ wave: wave,
680
+ orgSlug: orgSlug
681
+ })
682
+ ]
600
683
  }),
601
684
  /*#__PURE__*/ _jsx(Typography, {
602
685
  variant: "body2",
@@ -619,6 +702,7 @@ function Frame({ siteName, heading, lede, children }) {
619
702
  children: [
620
703
  /*#__PURE__*/ _jsx(Typography, {
621
704
  variant: "subtitle1",
705
+ component: "h2",
622
706
  sx: {
623
707
  px: {
624
708
  xs: 2,
@@ -629,7 +713,7 @@ function Frame({ siteName, heading, lede, children }) {
629
713
  sm: 3
630
714
  }
631
715
  },
632
- children: `Next: ${start.wave.label}`
716
+ children: `Next: ${aiSiteImportWaveHeading(state, start.wave)}`
633
717
  }),
634
718
  /*#__PURE__*/ _jsx(WaveRows, {
635
719
  job: job,
@@ -670,7 +754,7 @@ function Frame({ siteName, heading, lede, children }) {
670
754
  /*#__PURE__*/ _jsx(Button, {
671
755
  variant: "contained",
672
756
  disabled: busy,
673
- onClick: onResume,
757
+ onClick: ()=>onResume(),
674
758
  children: busy ? 'Checking…' : held.action
675
759
  }),
676
760
  /*#__PURE__*/ _jsx(HelpTip, _extends({}, AI_SITE_IMPORT_HELP.turnedAway, {
@@ -684,7 +768,7 @@ function Frame({ siteName, heading, lede, children }) {
684
768
  });
685
769
  }
686
770
  if (phase === 'held' || phase === 'paused') {
687
- var _ref3, _ref4;
771
+ var _ref5, _ref6;
688
772
  var _job_review1, _job_review2;
689
773
  const ownership = ((_job_review1 = job.review) == null ? void 0 : _job_review1.reason) === 'ownership';
690
774
  return /*#__PURE__*/ _jsxs(Frame, {
@@ -697,7 +781,7 @@ function Frame({ siteName, heading, lede, children }) {
697
781
  }),
698
782
  /*#__PURE__*/ _jsx(Alert, {
699
783
  severity: "info",
700
- children: (_ref3 = (_ref4 = (_job_review2 = job.review) == null ? void 0 : _job_review2.message) != null ? _ref4 : job.error) != null ? _ref3 : 'It stopped for your decision.'
784
+ children: (_ref5 = (_ref6 = (_job_review2 = job.review) == null ? void 0 : _job_review2.message) != null ? _ref6 : job.error) != null ? _ref5 : 'It stopped for your decision.'
701
785
  }),
702
786
  ownership && orgId ? claim ? /*#__PURE__*/ _jsx(AiSiteOwnershipProof, {
703
787
  orgId: orgId,
@@ -735,7 +819,7 @@ function Frame({ siteName, heading, lede, children }) {
735
819
  /*#__PURE__*/ _jsx(Button, {
736
820
  variant: "contained",
737
821
  disabled: busy || ownership && !(claim == null ? void 0 : claim.current),
738
- onClick: onResume,
822
+ onClick: ()=>onResume(),
739
823
  children: busy ? 'Starting…' : phase === 'paused' ? 'Resume' : start ? `${start.label} again` : 'Read the site again'
740
824
  }),
741
825
  phase === 'paused' && orgSlug ? /*#__PURE__*/ _jsx(Button, {
@@ -776,6 +860,7 @@ function Frame({ siteName, heading, lede, children }) {
776
860
  children: [
777
861
  /*#__PURE__*/ _jsx(Typography, {
778
862
  variant: "subtitle1",
863
+ component: "h2",
779
864
  sx: {
780
865
  px: {
781
866
  xs: 2,
@@ -786,7 +871,7 @@ function Frame({ siteName, heading, lede, children }) {
786
871
  sm: 3
787
872
  }
788
873
  },
789
- children: wave.label
874
+ children: aiSiteImportWaveHeading(state, wave)
790
875
  }),
791
876
  /*#__PURE__*/ _jsx(WaveRows, {
792
877
  job: job,