inline-chat-kit 0.55.0 → 0.55.2

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.
package/dist/demo.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { Z as e, t } from "./ChatExperience-CRtVStGQ.js";
3
- import { useCallback as n, useRef as r, useState as i } from "react";
4
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
- import { AnimatePresence as s, motion as c } from "motion/react";
6
- var l = {
2
+ import { Q as e, n as t, t as n } from "./ChatExperience-BwjmNCvw.js";
3
+ import { useCallback as r, useRef as i, useState as a } from "react";
4
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import { AnimatePresence as c, motion as l } from "motion/react";
6
+ var u = {
7
7
  banner: "ick-banner-qe2q",
8
8
  header: "ick-header-v41q",
9
9
  headerIcon: "ick-headerIcon-hWUJ",
@@ -19,62 +19,62 @@ var l = {
19
19
  };
20
20
  //#endregion
21
21
  //#region src/demo/InlineChatBanner.tsx
22
- function u({ status: e }) {
23
- return /* @__PURE__ */ o("div", {
24
- className: l.banner,
25
- children: [/* @__PURE__ */ o("div", {
26
- className: l.header,
27
- children: [/* @__PURE__ */ o("svg", {
22
+ function d({ status: e }) {
23
+ return /* @__PURE__ */ s("div", {
24
+ className: u.banner,
25
+ children: [/* @__PURE__ */ s("div", {
26
+ className: u.header,
27
+ children: [/* @__PURE__ */ s("svg", {
28
28
  width: "16",
29
29
  height: "16",
30
30
  viewBox: "0 0 16 16",
31
31
  fill: "none",
32
32
  xmlns: "http://www.w3.org/2000/svg",
33
- className: l.headerIcon,
33
+ className: u.headerIcon,
34
34
  "aria-hidden": !0,
35
35
  children: [
36
- /* @__PURE__ */ a("circle", {
36
+ /* @__PURE__ */ o("circle", {
37
37
  cx: "8",
38
38
  cy: "8",
39
39
  r: "7",
40
40
  stroke: "currentColor",
41
41
  strokeWidth: "1.2"
42
42
  }),
43
- /* @__PURE__ */ a("path", {
43
+ /* @__PURE__ */ o("path", {
44
44
  d: "M8 7v4",
45
45
  stroke: "currentColor",
46
46
  strokeWidth: "1.2",
47
47
  strokeLinecap: "round"
48
48
  }),
49
- /* @__PURE__ */ a("circle", {
49
+ /* @__PURE__ */ o("circle", {
50
50
  cx: "8",
51
51
  cy: "5",
52
52
  r: "0.8",
53
53
  fill: "currentColor"
54
54
  })
55
55
  ]
56
- }), /* @__PURE__ */ o("div", {
57
- className: l.headerText,
58
- children: [/* @__PURE__ */ a("span", {
59
- className: l.title,
56
+ }), /* @__PURE__ */ s("div", {
57
+ className: u.headerText,
58
+ children: [/* @__PURE__ */ o("span", {
59
+ className: u.title,
60
60
  children: "Quick heads up"
61
- }), /* @__PURE__ */ a("span", {
62
- className: l.body,
61
+ }), /* @__PURE__ */ o("span", {
62
+ className: u.body,
63
63
  children: "The answers are scripted — there is no model behind this page. Everything else is the real component, so the list below is what you can actually try."
64
64
  })]
65
65
  })]
66
- }), /* @__PURE__ */ o("div", {
67
- className: l.columns,
66
+ }), /* @__PURE__ */ s("div", {
67
+ className: u.columns,
68
68
  children: [
69
- /* @__PURE__ */ a(d, {
69
+ /* @__PURE__ */ o(f, {
70
70
  label: "Works",
71
71
  items: e.works
72
72
  }),
73
- /* @__PURE__ */ a(d, {
73
+ /* @__PURE__ */ o(f, {
74
74
  label: "Not working",
75
75
  items: e.notWorking
76
76
  }),
77
- /* @__PURE__ */ a(d, {
77
+ /* @__PURE__ */ o(f, {
78
78
  label: "Soon",
79
79
  items: e.soon
80
80
  })
@@ -82,16 +82,16 @@ function u({ status: e }) {
82
82
  })]
83
83
  });
84
84
  }
85
- function d({ label: e, items: t }) {
86
- return /* @__PURE__ */ o("div", {
87
- className: l.column,
88
- children: [/* @__PURE__ */ a("span", {
89
- className: l.columnLabel,
85
+ function f({ label: e, items: t }) {
86
+ return /* @__PURE__ */ s("div", {
87
+ className: u.column,
88
+ children: [/* @__PURE__ */ o("span", {
89
+ className: u.columnLabel,
90
90
  children: e
91
- }), /* @__PURE__ */ a("div", {
92
- className: l.items,
93
- children: t.map((e) => /* @__PURE__ */ a("span", {
94
- className: l.item,
91
+ }), /* @__PURE__ */ o("div", {
92
+ className: u.items,
93
+ children: t.map((e) => /* @__PURE__ */ o("span", {
94
+ className: u.item,
95
95
  children: e
96
96
  }, e))
97
97
  })]
@@ -99,7 +99,7 @@ function d({ label: e, items: t }) {
99
99
  }
100
100
  //#endregion
101
101
  //#region src/demo/featureStatus.ts
102
- var f = {
102
+ var p = {
103
103
  works: [
104
104
  "Send, stop, edit",
105
105
  "Multiline input",
@@ -124,7 +124,7 @@ var f = {
124
124
  "Queue a message",
125
125
  "Saved conversations"
126
126
  ]
127
- }, p = {
127
+ }, m = {
128
128
  page: "ick-page-FfCm",
129
129
  container: "ick-container-o-mL",
130
130
  infoContainer: "ick-infoContainer-6g-x",
@@ -139,7 +139,7 @@ var f = {
139
139
  bannerWrapper: "ick-bannerWrapper-URah",
140
140
  buttonWrapper: "ick-buttonWrapper-3eYt",
141
141
  fyi: "ick-fyi-9rqo"
142
- }, m = {
142
+ }, h = {
143
143
  staggerIn: .07,
144
144
  stiffness: 100,
145
145
  damping: 36,
@@ -150,9 +150,9 @@ var f = {
150
150
  offsetOut: -10,
151
151
  blurOut: 10
152
152
  };
153
- function h({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: s = "This is inline chat experience", version: l = "v1.0.0", description: d = "Exploration of having the input be the same as response. Or better said input morphing into chat bubble and maintains the continuous experience.", status: h = f, motionConfig: g }) {
153
+ function g({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "This is inline chat experience", version: c = "v1.0.0", description: u = "Exploration of having the input be the same as response. Or better said input morphing into chat bubble and maintains the continuous experience.", status: f = p, motionConfig: g }) {
154
154
  let _ = {
155
- ...m,
155
+ ...h,
156
156
  ...g
157
157
  }, v = {
158
158
  hidden: {},
@@ -184,75 +184,75 @@ function h({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: s = "T
184
184
  transition: {
185
185
  duration: _.durationOut,
186
186
  ease: [
187
- .4,
188
- 0,
187
+ .23,
189
188
  1,
189
+ .32,
190
190
  1
191
191
  ]
192
192
  }
193
193
  }
194
194
  };
195
- return /* @__PURE__ */ a(c.div, {
196
- className: p.page,
195
+ return /* @__PURE__ */ o(l.div, {
196
+ className: m.page,
197
197
  variants: v,
198
198
  initial: "hidden",
199
199
  animate: "visible",
200
200
  exit: "exit",
201
- children: /* @__PURE__ */ o("div", {
202
- className: p.container,
201
+ children: /* @__PURE__ */ s("div", {
202
+ className: m.container,
203
203
  children: [
204
- /* @__PURE__ */ o("div", {
205
- className: p.infoContainer,
206
- children: [t && /* @__PURE__ */ a(c.div, {
204
+ /* @__PURE__ */ s("div", {
205
+ className: m.infoContainer,
206
+ children: [t && /* @__PURE__ */ o(l.div, {
207
207
  variants: y,
208
208
  children: t
209
- }), /* @__PURE__ */ o("div", {
210
- className: p.content,
211
- children: [/* @__PURE__ */ o("div", {
212
- className: p.introContent,
213
- children: [/* @__PURE__ */ o(c.div, {
214
- className: p.nameContent,
209
+ }), /* @__PURE__ */ s("div", {
210
+ className: m.content,
211
+ children: [/* @__PURE__ */ s("div", {
212
+ className: m.introContent,
213
+ children: [/* @__PURE__ */ s(l.div, {
214
+ className: m.nameContent,
215
215
  variants: y,
216
- children: [/* @__PURE__ */ a("span", {
217
- className: p.welcome,
216
+ children: [/* @__PURE__ */ o("span", {
217
+ className: m.welcome,
218
218
  children: i
219
- }), /* @__PURE__ */ a("span", {
220
- className: p.title,
221
- children: s
219
+ }), /* @__PURE__ */ o("span", {
220
+ className: m.title,
221
+ children: a
222
222
  })]
223
- }), /* @__PURE__ */ a(c.span, {
224
- className: p.version,
223
+ }), /* @__PURE__ */ o(l.span, {
224
+ className: m.version,
225
225
  variants: y,
226
- children: l
226
+ children: c
227
227
  })]
228
- }), /* @__PURE__ */ a(c.p, {
229
- className: p.description,
228
+ }), /* @__PURE__ */ o(l.p, {
229
+ className: m.description,
230
230
  variants: y,
231
- children: d
231
+ children: u
232
232
  })]
233
233
  })]
234
234
  }),
235
- /* @__PURE__ */ a(c.div, {
235
+ /* @__PURE__ */ o(l.div, {
236
236
  variants: y,
237
- className: p.bannerWrapper,
238
- children: /* @__PURE__ */ a(u, { status: h })
237
+ className: m.bannerWrapper,
238
+ children: /* @__PURE__ */ o(d, { status: f })
239
239
  }),
240
- /* @__PURE__ */ a(c.div, {
240
+ /* @__PURE__ */ o(l.div, {
241
241
  variants: y,
242
242
  style: { display: "none" }
243
243
  }),
244
- /* @__PURE__ */ a(c.div, {
244
+ /* @__PURE__ */ o(l.div, {
245
245
  variants: y,
246
246
  style: { display: "none" }
247
247
  }),
248
- /* @__PURE__ */ a(c.div, {
248
+ /* @__PURE__ */ o(l.div, {
249
249
  variants: y,
250
250
  style: { display: "none" }
251
251
  }),
252
- /* @__PURE__ */ o(c.div, {
252
+ /* @__PURE__ */ s(l.div, {
253
253
  variants: y,
254
- className: p.buttonWrapper,
255
- children: [/* @__PURE__ */ a(e, {
254
+ className: m.buttonWrapper,
255
+ children: [/* @__PURE__ */ o(e, {
256
256
  variant: "glass",
257
257
  size: "m",
258
258
  onClick: r,
@@ -265,20 +265,20 @@ function h({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: s = "T
265
265
  }
266
266
  //#endregion
267
267
  //#region src/demo/scriptedApi.ts
268
- var g = /* @__PURE__ */ new Map(), _ = [
268
+ var _ = /* @__PURE__ */ new Map(), v = [
269
269
  "Particle physics studies the most fundamental constituents of matter and the forces that act between them.",
270
270
  "The **Standard Model** organises them into three families:",
271
271
  "- twelve fermions — six quarks and six leptons\n- the force-carrying bosons\n- the Higgs, which gives the rest their mass",
272
272
  "The Higgs boson, found at CERN in 2012, completes the picture by giving elementary particles their mass through interaction with the Higgs field."
273
- ], v = [
273
+ ], y = [
274
274
  "The Higgs boson is a *point particle* — it has no measurable spatial extent at any scale we can currently probe.",
275
275
  "| property | value |\n| --- | --- |\n| mass | ~125 GeV/c² |\n| charge | 0 |\n| spin | 0 |",
276
276
  "So 'how big is it' has only one honest answer: it has no size, only `mass` and quantum numbers."
277
- ], y = ["Here is what I would do, in order. The first two are cheap and tell us whether the rest is worth doing."], b = [
277
+ ], b = ["Here is what I would do, in order. The first two are cheap and tell us whether the rest is worth doing."], x = [
278
278
  "The current combined figure is **125.25 GeV/c²**[^1], from ATLAS and CMS together — separately, neither experiment gets there.",
279
279
  "It is known to about a fifth of a percent[^2], which for a particle discovered in 2012 is a remarkably tight number.",
280
280
  "The uncertainty is now dominated by systematics rather than statistics[^3] — more collisions alone will not sharpen it much further."
281
- ], x = [
281
+ ], S = [
282
282
  {
283
283
  id: "atlas-cms",
284
284
  title: "Combined measurement of the Higgs boson mass",
@@ -298,7 +298,7 @@ var g = /* @__PURE__ */ new Map(), _ = [
298
298
  origin: "cms.cern",
299
299
  url: "https://example.com/systematics"
300
300
  }
301
- ], S = [
301
+ ], C = [
302
302
  {
303
303
  id: "read",
304
304
  label: "Read what is being asked",
@@ -314,7 +314,7 @@ var g = /* @__PURE__ */ new Map(), _ = [
314
314
  label: "Check which is the limiting one now",
315
315
  body: "Statistics used to dominate. It is systematics now, and that changes what more data would buy."
316
316
  }
317
- ], C = [
317
+ ], w = [
318
318
  {
319
319
  id: "setup",
320
320
  type: "inputs",
@@ -387,28 +387,28 @@ var g = /* @__PURE__ */ new Map(), _ = [
387
387
  }
388
388
  ]
389
389
  }
390
- ], w = (e) => new Promise((t) => setTimeout(t, e));
391
- async function* T(e) {
392
- for (let t of e.join("\n\n").split(/(\s+)/)) await w(24), yield t;
390
+ ], T = (e) => new Promise((t) => setTimeout(t, e));
391
+ async function* E(e) {
392
+ for (let t of e.join("\n\n").split(/(\s+)/)) await T(24), yield t;
393
393
  }
394
- async function* E(e, t) {
394
+ async function* D(e, t) {
395
395
  let n = "";
396
396
  for (let r of t) n += (n ? "\n\n" : "") + r, yield {
397
397
  kind: "reasoning",
398
398
  id: e,
399
399
  text: n,
400
400
  state: "thinking"
401
- }, await w(420);
401
+ }, await T(420);
402
402
  yield {
403
403
  kind: "reasoning",
404
404
  id: e,
405
405
  state: "done"
406
406
  };
407
407
  }
408
- var D = {
408
+ var O = {
409
409
  query: "higgs boson mass measurement",
410
410
  limit: 3
411
- }, O = {
411
+ }, k = {
412
412
  results: [{
413
413
  title: "ATLAS and CMS combined measurement",
414
414
  url: "https://example.com/atlas-cms",
@@ -420,25 +420,25 @@ var D = {
420
420
  }],
421
421
  took_ms: 412
422
422
  };
423
- async function* k(e) {
423
+ async function* A(e) {
424
424
  yield {
425
425
  kind: "tool",
426
426
  id: e,
427
427
  name: "search_web",
428
428
  state: "running",
429
429
  summary: "Searching the web",
430
- input: D
431
- }, await w(900), yield {
430
+ input: O
431
+ }, await T(900), yield {
432
432
  kind: "tool",
433
433
  id: e,
434
434
  name: "search_web",
435
435
  state: "done",
436
436
  summary: "2 results",
437
- output: O,
437
+ output: k,
438
438
  duration: 412
439
439
  };
440
440
  }
441
- var A = [
441
+ var j = [
442
442
  {
443
443
  id: "read",
444
444
  label: "Read the care plan"
@@ -456,42 +456,42 @@ var A = [
456
456
  label: "Draft the questions for the family"
457
457
  }
458
458
  ];
459
- async function* j(e) {
460
- for (let t = 0; t <= A.length; t++) yield {
459
+ async function* M(e) {
460
+ for (let t = 0; t <= j.length; t++) yield {
461
461
  kind: "tasks",
462
462
  id: e,
463
463
  title: "Plan",
464
464
  collapsible: !0,
465
- tasks: A.map((e, n) => ({
465
+ tasks: j.map((e, n) => ({
466
466
  ...e,
467
467
  state: n < t ? "done" : n === t ? "running" : "pending"
468
468
  }))
469
- }, await w(800);
469
+ }, await T(800);
470
470
  }
471
- async function* M(e) {
472
- for (let t = 0; t < S.length; t++) yield {
471
+ async function* N(e) {
472
+ for (let t = 0; t < C.length; t++) yield {
473
473
  kind: "chain",
474
474
  id: e,
475
475
  state: "thinking",
476
- steps: S.slice(0, t + 1).map((e, n) => ({
476
+ steps: C.slice(0, t + 1).map((e, n) => ({
477
477
  ...e,
478
478
  state: n < t ? "done" : "running"
479
479
  }))
480
- }, await w(700);
480
+ }, await T(700);
481
481
  yield {
482
482
  kind: "chain",
483
483
  id: e,
484
484
  state: "done",
485
- steps: S.map((e) => ({
485
+ steps: C.map((e) => ({
486
486
  ...e,
487
487
  state: "done"
488
488
  }))
489
489
  };
490
490
  }
491
- var N = (e, ...t) => {
491
+ var P = (e, ...t) => {
492
492
  let n = e.toLowerCase();
493
493
  return t.some((e) => n.includes(e));
494
- }, P = ["I can see it. Whatever you send along with a message arrives here the same way the text does — one `attachments` array on the turn, and the composer that held it is the same one that shows it afterwards.", "This demo does not read the picture; there is no model behind it. A real one would get the file and the sentence in the same request."], F = [[
494
+ }, F = ["I can see it. Whatever you send along with a message arrives here the same way the text does — one `attachments` array on the turn, and the composer that held it is the same one that shows it afterwards.", "This demo does not read the picture; there is no model behind it. A real one would get the file and the sentence in the same request."], I = [[
495
495
  "Another way to put it: particle physics is the study of what is left when you stop dividing.",
496
496
  "Everything in the Standard Model is there because dividing it further stopped producing anything smaller — twelve fermions, the bosons that carry the forces between them, and the Higgs.",
497
497
  "The interesting part is not the list. It is that the list is *short*, and that nothing found since 1973 has needed adding to it."
@@ -499,41 +499,41 @@ var N = (e, ...t) => {
499
499
  "Once more, from the other end. Start with the four forces and ask what carries each one.",
500
500
  "Electromagnetism has the photon. The strong force has gluons. The weak force has the W and Z. Gravity has no entry here at all — which is the honest shape of the field's biggest open problem.",
501
501
  "Matter is what those forces act on: quarks, which feel the strong force, and leptons, which do not."
502
- ]], I = "Week 1 — base\nMon rest\nTue 4 km easy, conversational pace\nWed cross-train, 30 min\nThu 5 × 400 m at 5k effort, 90 s jog between\nFri rest\nSat 6 km easy\nSun 20 min walk\n\nWeek 2 — base\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 6 × 400 m, 90 s jog between\nFri rest\nSat 7 km easy, last kilometre at pace\nSun 20 min walk\n\nWeek 3 — build\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 4 × 800 m at 5k effort, 2 min jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 4 — cut back\nMon rest\nTue 4 km easy\nWed cross-train, 30 min\nThu 5 × 400 m, 90 s jog between\nFri rest\nSat 5 km easy\nSun rest\n\nWeek 5 — build\nMon rest\nTue 6 km easy\nWed cross-train, 40 min\nThu 5 × 800 m, 2 min jog between\nFri rest\nSat 9 km easy\nSun 20 min walk\n\nWeek 6 — sharpen\nMon rest\nTue 6 km with 3 km at target pace\nWed cross-train, 30 min\nThu 8 × 400 m, 60 s jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 7 — sharpen\nMon rest\nTue 5 km with 4 km at target pace\nWed cross-train, 30 min\nThu 6 × 400 m, 60 s jog between\nFri rest\nSat 6 km easy\nSun rest\n\nWeek 8 — taper and race\nMon rest\nTue 4 km easy with 4 × 100 m strides\nWed rest\nThu 3 km easy\nFri rest\nSat race, 5 km\nSun 20 min walk\n\nNotes\nEasy means you can hold a conversation. If you cannot, it is not easy.\nEvery hard day is followed by a rest day; that is where the fitness is made.\nMiss a week and repeat it rather than skipping ahead to catch up.";
503
- async function* L(e, { attachments: t, turnId: n }) {
502
+ ]], L = "Week 1 — base\nMon rest\nTue 4 km easy, conversational pace\nWed cross-train, 30 min\nThu 5 × 400 m at 5k effort, 90 s jog between\nFri rest\nSat 6 km easy\nSun 20 min walk\n\nWeek 2 — base\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 6 × 400 m, 90 s jog between\nFri rest\nSat 7 km easy, last kilometre at pace\nSun 20 min walk\n\nWeek 3 — build\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 4 × 800 m at 5k effort, 2 min jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 4 — cut back\nMon rest\nTue 4 km easy\nWed cross-train, 30 min\nThu 5 × 400 m, 90 s jog between\nFri rest\nSat 5 km easy\nSun rest\n\nWeek 5 — build\nMon rest\nTue 6 km easy\nWed cross-train, 40 min\nThu 5 × 800 m, 2 min jog between\nFri rest\nSat 9 km easy\nSun 20 min walk\n\nWeek 6 — sharpen\nMon rest\nTue 6 km with 3 km at target pace\nWed cross-train, 30 min\nThu 8 × 400 m, 60 s jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 7 — sharpen\nMon rest\nTue 5 km with 4 km at target pace\nWed cross-train, 30 min\nThu 6 × 400 m, 60 s jog between\nFri rest\nSat 6 km easy\nSun rest\n\nWeek 8 — taper and race\nMon rest\nTue 4 km easy with 4 × 100 m strides\nWed rest\nThu 3 km easy\nFri rest\nSat race, 5 km\nSun 20 min walk\n\nNotes\nEasy means you can hold a conversation. If you cannot, it is not easy.\nEvery hard day is followed by a rest day; that is where the fitness is made.\nMiss a week and repeat it rather than skipping ahead to catch up.";
503
+ async function* R(e, { attachments: t, turnId: n }) {
504
504
  if (t.length > 0) {
505
- yield* E("r", [`${t.length === 1 ? "A file" : `${t.length} files`} came with this.`, "Say what arrived, and be honest that nothing here is looking at it."]), yield* T(P);
505
+ yield* D("r", [`${t.length === 1 ? "A file" : `${t.length} files`} came with this.`, "Say what arrived, and be honest that nothing here is looking at it."]), yield* E(F);
506
506
  return;
507
507
  }
508
- if (N(e, "plan", "training", "5k", "run ", "running", "trening", "trčanj", "trcanj")) {
509
- yield* E("r", ["Eight weeks is the shortest honest 5k build for somebody starting from a base.", "The plan is long. Put it behind a card rather than into the answer — an answer nobody can read past is not an answer."]), yield {
508
+ if (P(e, "plan", "training", "5k", "run ", "running", "trening", "trčanj", "trcanj")) {
509
+ yield* D("r", ["Eight weeks is the shortest honest 5k build for somebody starting from a base.", "The plan is long. Put it behind a card rather than into the answer — an answer nobody can read past is not an answer."]), yield {
510
510
  kind: "artifact",
511
511
  id: "plan",
512
512
  title: "5k training plan",
513
513
  state: "writing"
514
- }, yield "Here is an eight-week plan. Four sessions a week, one of them hard, and a cut-back week in the middle so the fourth week does not become the one you quit in.", await w(900), yield {
514
+ }, yield "Here is an eight-week plan. Four sessions a week, one of them hard, and a cut-back week in the middle so the fourth week does not become the one you quit in.", await T(900), yield {
515
515
  kind: "artifact",
516
516
  id: "plan",
517
517
  meta: "8 weeks · 4 sessions a week",
518
518
  preview: "text",
519
- content: I,
519
+ content: L,
520
520
  state: "done"
521
521
  }, yield " Open it to see the weeks.";
522
522
  return;
523
523
  }
524
- if (N(e, "question", "ask me", "set up", "double-slit", "experiment", "pitanj")) {
525
- yield* E("r", ["They want to be asked rather than to specify the whole thing up front.", "Three is the most anybody answers in one sitting: the geometry, then where the detector goes — which is the only choice that changes the physics — then what to plot."]), yield {
524
+ if (P(e, "question", "ask me", "set up", "double-slit", "experiment", "pitanj")) {
525
+ yield* D("r", ["They want to be asked rather than to specify the whole thing up front.", "Three is the most anybody answers in one sitting: the geometry, then where the detector goes — which is the only choice that changes the physics — then what to plot."]), yield {
526
526
  kind: "question",
527
527
  id: "q",
528
528
  title: "Setting up the run",
529
- questions: C,
529
+ questions: w,
530
530
  answers: {},
531
531
  activeIndex: 0
532
532
  };
533
533
  return;
534
534
  }
535
- if (N(e, "delete", "run ", "send an email", "permission", "approve")) {
536
- yield* E("r", ["This one changes something outside the conversation, so it is not mine to decide.", "Show what it would run, and wait."]), yield {
535
+ if (P(e, "delete", "run ", "send an email", "permission", "approve")) {
536
+ yield* D("r", ["This one changes something outside the conversation, so it is not mine to decide.", "Show what it would run, and wait."]), yield {
537
537
  kind: "approval",
538
538
  id: "ask",
539
539
  title: "Run a command in your shell",
@@ -548,69 +548,71 @@ async function* L(e, { attachments: t, turnId: n }) {
548
548
  };
549
549
  return;
550
550
  }
551
- if (N(e, "plan", "todo", "steps", "what would you do")) {
552
- yield* E("r", ["This is a sequence, not a single answer, so the plan is the answer.", "Order it so the cheap checks come first — if the medication list already matches, the rest is much smaller."]), yield* j("p"), yield* T(y);
551
+ if (P(e, "plan", "todo", "steps", "what would you do")) {
552
+ yield* D("r", ["This is a sequence, not a single answer, so the plan is the answer.", "Order it so the cheap checks come first — if the medication list already matches, the rest is much smaller."]), yield* M("p"), yield* E(b);
553
553
  return;
554
554
  }
555
- if (N(e, "sources", "cite", "how do you know", "izvor")) {
556
- yield* M("c"), yield {
555
+ if (P(e, "sources", "cite", "how do you know", "izvor")) {
556
+ yield* N("c"), yield {
557
557
  kind: "sources",
558
558
  id: "s",
559
- sources: x,
559
+ sources: S,
560
560
  title: "Sources",
561
561
  collapsible: !0
562
- }, yield* T(b);
562
+ }, yield* E(x);
563
563
  return;
564
564
  }
565
- if (N(e, "how big", "mass", "size", "weigh")) {
566
- yield* E("r", ["The question is about the Higgs boson's size, and the honest answer is that it does not have one.", "Better to give the mass instead, and say why size is the wrong question — but check the current figure first."]), yield* k("t"), yield* T(v);
565
+ if (P(e, "how big", "mass", "size", "weigh")) {
566
+ yield* D("r", ["The question is about the Higgs boson's size, and the honest answer is that it does not have one.", "Better to give the mass instead, and say why size is the wrong question — but check the current figure first."]), yield* A("t"), yield* E(y);
567
567
  return;
568
568
  }
569
- let r = (g.get(n) ?? 0) % (F.length + 1);
570
- if (g.set(n, r + 1), r > 0) {
571
- yield* E("r", ["Asked again, so the first answer did not land.", "Same physics, different way in — repeating it in other words is not answering it again."]), yield* T(F[r - 1]);
569
+ let r = (_.get(n) ?? 0) % (I.length + 1);
570
+ if (_.set(n, r + 1), r > 0) {
571
+ yield* D("r", ["Asked again, so the first answer did not land.", "Same physics, different way in — repeating it in other words is not answering it again."]), yield* E(I[r - 1]);
572
572
  return;
573
573
  }
574
- yield* E("r", ["A general question, so the answer should start from what the field is for rather than from a definition.", "Three families is the useful shape: fermions, bosons, and the Higgs."]), yield* T(_);
574
+ yield* D("r", ["A general question, so the answer should start from what the field is for rather than from a definition.", "Three families is the useful shape: fermions, bosons, and the Higgs."]), yield* E(v);
575
575
  }
576
- async function* R() {
577
- yield* T(["Marking a passage and asking about it keeps the question attached to what it is about — so the answer can be short.", "That is the whole of the thread: the quote, one question, one answer."]);
576
+ async function* z() {
577
+ yield* E(["Marking a passage and asking about it keeps the question attached to what it is about — so the answer can be short.", "That is the whole of the thread: the quote, one question, one answer."]);
578
578
  }
579
- async function* z(e, { signal: t }) {
579
+ async function* B(e, { signal: t }) {
580
580
  let n = `this is a scripted transcript standing in for about ${Math.max(1, Math.round(e.size / 12e3))} seconds of speech`.split(" ");
581
581
  for (let e of n) {
582
582
  if (await new Promise((e) => setTimeout(e, 90)), t.aborted) return;
583
583
  yield `${e} `;
584
584
  }
585
585
  }
586
- var B = { plan: "ick-plan-nXLe" }, V = 8e3, H = 900;
587
- function U({ logo: e, back: o, backHref: c = "/", backLabel: l = "Back to home", skipIntro: u = !1, theme: d, onThemeChange: f, cursor: p = !1, animationConfig: m, foldMotion: g, feedDelay: _, introMotion: v }) {
588
- let [y, b] = i(u), x = r({}), S = n((e, t, n, r, i) => {
586
+ var V = { plan: "ick-plan-nXLe" }, H = 8e3, U = 900;
587
+ function W({ logo: e, back: s, backHref: l = "/", backLabel: u = "Back to home", skipIntro: d = !1, theme: f, onThemeChange: p, cursor: m = !0, animationConfig: h, foldMotion: _, feedDelay: v, introMotion: y }) {
588
+ let [b, x] = a(d);
589
+ t(f === void 0 ? void 0 : f);
590
+ let S = i({}), C = r((e, t, n, r, i) => {
589
591
  let a = {
590
- ...x.current[n] ?? {},
592
+ ...S.current[n] ?? {},
591
593
  [r]: i
592
594
  };
593
- x.current[n] = a;
594
- let o = C.findIndex((e) => e.id === r) + 1, s = o >= C.length;
595
+ S.current[n] = a;
596
+ let o = w.findIndex((e) => e.id === r) + 1, s = o >= w.length;
595
597
  e(t, {
596
598
  kind: "question",
597
599
  id: n,
598
600
  title: "Setting up the run",
599
- questions: C,
601
+ questions: w,
600
602
  answers: a,
601
603
  activeIndex: s ? null : o,
602
604
  collapsible: s
603
605
  });
604
- }, []), w = n((e, t, n, r) => {
606
+ }, []), T = r((e, t, n, r) => {
605
607
  e(t, {
606
608
  kind: "question",
607
609
  id: n,
608
- questions: C,
609
- answers: x.current[n] ?? {},
610
+ questions: w,
611
+ answers: S.current[n] ?? {},
610
612
  activeIndex: r,
611
613
  collapsible: !1
612
614
  });
613
- }, []), T = n((e, t, n, r) => {
615
+ }, []), E = r((e, t, n, r) => {
614
616
  e(t, {
615
617
  kind: "approval",
616
618
  id: n,
@@ -634,15 +636,15 @@ function U({ logo: e, back: o, backHref: c = "/", backLabel: l = "Back to home",
634
636
  });
635
637
  }, 1100));
636
638
  }, []);
637
- return /* @__PURE__ */ a(s, {
639
+ return /* @__PURE__ */ o(c, {
638
640
  mode: "wait",
639
- children: y ? /* @__PURE__ */ a(t, {
640
- onSend: L,
641
- onTranscribe: z,
642
- onThreadReply: R,
641
+ children: b ? /* @__PURE__ */ o(n, {
642
+ onSend: R,
643
+ onTranscribe: B,
644
+ onThreadReply: z,
643
645
  title: "inline chat experience",
644
- backHref: c,
645
- backLabel: l,
646
+ backHref: l,
647
+ backLabel: u,
646
648
  placeholder: "Ask me about particle physics…",
647
649
  empty: {
648
650
  title: "Ask me about particle physics",
@@ -657,35 +659,35 @@ function U({ logo: e, back: o, backHref: c = "/", backLabel: l = "Back to home",
657
659
  "Delete the screenshots"
658
660
  ]
659
661
  },
660
- contextTotal: V,
661
- contextBase: H,
662
+ contextTotal: H,
663
+ contextBase: U,
662
664
  artifact: () => ({
663
665
  title: "5k training plan",
664
666
  meta: "8 weeks · 4 sessions a week",
665
- children: /* @__PURE__ */ a("pre", {
666
- className: B.plan,
667
- children: I
667
+ children: /* @__PURE__ */ o("pre", {
668
+ className: V.plan,
669
+ children: L
668
670
  })
669
671
  }),
670
- theme: d,
671
- onThemeChange: f,
672
- cursor: p,
672
+ theme: f,
673
+ onThemeChange: p,
674
+ cursor: m,
673
675
  selectionToggle: !0,
674
- animationConfig: m,
675
- foldMotion: g,
676
- feedDelay: _,
677
- onAnswerQuestion: S,
678
- onEditQuestion: w,
679
- onDecideApproval: T
680
- }, "chat") : /* @__PURE__ */ a(h, {
676
+ animationConfig: h,
677
+ foldMotion: _,
678
+ feedDelay: v,
679
+ onAnswerQuestion: C,
680
+ onEditQuestion: T,
681
+ onDecideApproval: E
682
+ }, "chat") : /* @__PURE__ */ o(g, {
681
683
  logo: e,
682
- back: o,
683
- onStart: () => b(!0),
684
- motionConfig: v
684
+ back: s,
685
+ onStart: () => x(!0),
686
+ motionConfig: y
685
687
  }, "intro")
686
688
  });
687
689
  }
688
690
  //#endregion
689
- export { U as ChatExperienceDemo, f as INLINE_CHAT_FEATURE_STATUS, u as InlineChatBanner, h as IntroLanding, C as QUESTIONS, I as RUNNING_PLAN, L as scriptedApi, z as scriptedTranscript, R as threadReply };
691
+ export { W as ChatExperienceDemo, p as INLINE_CHAT_FEATURE_STATUS, d as InlineChatBanner, g as IntroLanding, w as QUESTIONS, L as RUNNING_PLAN, R as scriptedApi, B as scriptedTranscript, z as threadReply };
690
692
 
691
693
  //# sourceMappingURL=demo.js.map