ooxml-ui 1.28.1 → 1.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/{chunk-2EFIFIPB.js → chunk-LNHFMJ2P.js} +1 -1
  2. package/dist/{chunk-FHO7TEWA.js → chunk-WYKMVMX4.js} +14 -1
  3. package/dist/{chunk-WBE2Q5DC.js → chunk-YMZFOG2U.js} +2 -2
  4. package/dist/index.js +3 -3
  5. package/dist/pptx/ai/host.cjs +153 -0
  6. package/dist/pptx/ai/host.d.ts +44 -0
  7. package/dist/pptx/ai/host.d.ts.map +1 -0
  8. package/dist/pptx/ai/host.mjs +4 -0
  9. package/dist/pptx/ai/index.cjs +163 -1466
  10. package/dist/pptx/ai/index.mjs +8 -1428
  11. package/dist/pptx/chunk-BMMTD6PB.cjs +1467 -0
  12. package/dist/pptx/{chunk-34A7YWVZ.cjs → chunk-BXCXY4HB.cjs} +536 -144
  13. package/dist/pptx/{chunk-TOPXMCGQ.mjs → chunk-DVLU476S.mjs} +504 -96
  14. package/dist/pptx/{chunk-MJACF7Y2.mjs → chunk-EHIQ4ANA.mjs} +5 -0
  15. package/dist/pptx/{chunk-GWKTHP6U.cjs → chunk-PATUICO4.cjs} +5 -0
  16. package/dist/pptx/chunk-SMMEIEEJ.mjs +1427 -0
  17. package/dist/pptx/{chunk-BYSLCSDL.cjs → chunk-UTBHXIDK.cjs} +46 -46
  18. package/dist/pptx/{chunk-SJX7SFED.mjs → chunk-YO3EMGXD.mjs} +2 -2
  19. package/dist/pptx/dom/glyph-outline-cache.d.ts +3 -1
  20. package/dist/pptx/dom/glyph-outline-cache.d.ts.map +1 -1
  21. package/dist/pptx/dom/index.cjs +399 -398
  22. package/dist/pptx/dom/index.mjs +15 -14
  23. package/dist/pptx/dom/load-presentation.d.ts +7 -1
  24. package/dist/pptx/dom/load-presentation.d.ts.map +1 -1
  25. package/dist/pptx/export/html2canvas-clone.cjs +4 -4
  26. package/dist/pptx/export/html2canvas-clone.mjs +1 -1
  27. package/dist/pptx/export/print-document.cjs +18 -18
  28. package/dist/pptx/export/print-document.mjs +2 -2
  29. package/dist/pptx/i18n/index.cjs +6 -6
  30. package/dist/pptx/i18n/index.mjs +1 -1
  31. package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
  32. package/dist/pptx/index.cjs +3179 -3163
  33. package/dist/pptx/index.mjs +9 -9
  34. package/dist/pptx/render/embedded-font-trust.d.ts +7 -0
  35. package/dist/pptx/render/embedded-font-trust.d.ts.map +1 -1
  36. package/dist/pptx/render/embedded-fonts.d.ts +4 -3
  37. package/dist/pptx/render/embedded-fonts.d.ts.map +1 -1
  38. package/dist/pptx/render/glyph-outline-font-registration.d.ts +83 -0
  39. package/dist/pptx/render/glyph-outline-font-registration.d.ts.map +1 -0
  40. package/dist/pptx/render/index.d.ts +2 -0
  41. package/dist/pptx/render/index.d.ts.map +1 -1
  42. package/dist/pptx/render/load-limits.d.ts +18 -0
  43. package/dist/pptx/render/load-limits.d.ts.map +1 -0
  44. package/dist/pptx/render/text-warp-glyph-outline-lookup.d.ts +39 -0
  45. package/dist/pptx/render/text-warp-glyph-outline-lookup.d.ts.map +1 -0
  46. package/dist/pptx/render/text-warp-opentype-parser.d.ts +15 -2
  47. package/dist/pptx/render/text-warp-opentype-parser.d.ts.map +1 -1
  48. package/dist/pptx/render/text-warp-outline-font-cache.d.ts +116 -42
  49. package/dist/pptx/render/text-warp-outline-font-cache.d.ts.map +1 -1
  50. package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
  51. package/dist/pptx/{smartart-insert-preview-OW6RXM7M.cjs → smartart-insert-preview-DHQ47GXP.cjs} +11 -11
  52. package/dist/pptx/{smartart-insert-preview-RAWXO2RH.mjs → smartart-insert-preview-IQVC5LMF.mjs} +10 -10
  53. package/dist/{presentation-preview-KY56TONW.js → presentation-preview-XGJMARKI.js} +1 -1
  54. package/dist/teams/app/presentation-preview.d.ts +3 -0
  55. package/dist/teams.js +2 -2
  56. package/dist/xlsx.js +4 -4
  57. package/package.json +8 -8
  58. package/dist/pptx/{chunk-YMITEJST.cjs → chunk-3CYWRMYZ.cjs} +1 -1
  59. package/dist/pptx/{chunk-3LOVEO7U.mjs → chunk-5VSUIPDX.mjs} +1 -1
  60. /package/dist/pptx/{chunk-FM4C4MBJ.cjs → chunk-67UQWOEQ.cjs} +0 -0
  61. /package/dist/pptx/{chunk-AMW2AR7J.mjs → chunk-6MZFWTBS.mjs} +0 -0
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ var chunkBMMTD6PB_cjs = require('../chunk-BMMTD6PB.cjs');
3
4
  var chunkA5MANNJR_cjs = require('../chunk-A5MANNJR.cjs');
4
- var chunkY6DO6SVT_cjs = require('../chunk-Y6DO6SVT.cjs');
5
- var chunkPBZWDEXQ_cjs = require('../chunk-PBZWDEXQ.cjs');
5
+ require('../chunk-Y6DO6SVT.cjs');
6
+ require('../chunk-PBZWDEXQ.cjs');
6
7
  var pptx = require('ooxml-core/pptx');
7
8
  var zod = require('zod');
8
9
  var tableMerge = require('ooxml-core/pptx/editor/ai/table-merge');
@@ -50,446 +51,6 @@ function resetAiSdkCache() {
50
51
  cached = void 0;
51
52
  }
52
53
 
53
- // src/pptx/ai/deck-data-diff.ts
54
- function deckDataFieldChanged(a, b) {
55
- return JSON.stringify(a) !== JSON.stringify(b);
56
- }
57
- function applyElementUpdate(el, u) {
58
- if (u.x !== void 0) {
59
- el.x = u.x;
60
- }
61
- if (u.y !== void 0) {
62
- el.y = u.y;
63
- }
64
- if (u.width !== void 0) {
65
- el.width = u.width;
66
- }
67
- if (u.height !== void 0) {
68
- el.height = u.height;
69
- }
70
- if (u.rotation !== void 0) {
71
- el.rotation = u.rotation;
72
- }
73
- if (u.opacity !== void 0) {
74
- el.opacity = u.opacity;
75
- }
76
- if (u.hidden !== void 0) {
77
- el.hidden = u.hidden;
78
- }
79
- if (u.flipHorizontal !== void 0) {
80
- el.flipHorizontal = u.flipHorizontal;
81
- }
82
- if (u.flipVertical !== void 0) {
83
- el.flipVertical = u.flipVertical;
84
- }
85
- applyTextUpdate(el, u);
86
- applyShapeStyleUpdate(el, u);
87
- }
88
- function applyTextUpdate(el, u) {
89
- if (!pptx.hasTextProperties(el)) {
90
- return;
91
- }
92
- const textEl = el;
93
- if (u.text !== void 0) {
94
- textEl.text = u.text;
95
- if (textEl.textSegments && textEl.textSegments.length > 0) {
96
- textEl.textSegments[0].text = u.text;
97
- } else {
98
- textEl.textSegments = [{ text: u.text, style: {} }];
99
- }
100
- }
101
- if (u.fontSize === void 0 && u.fontFamily === void 0 && u.fontColor === void 0 && u.bold === void 0 && u.italic === void 0 && u.underline === void 0 && u.align === void 0) {
102
- return;
103
- }
104
- const textStyle = {};
105
- if (u.fontSize !== void 0) {
106
- textStyle.fontSize = u.fontSize;
107
- }
108
- if (u.fontFamily !== void 0) {
109
- textStyle.fontFamily = u.fontFamily;
110
- }
111
- if (u.fontColor !== void 0) {
112
- textStyle.color = u.fontColor;
113
- }
114
- if (u.bold !== void 0) {
115
- textStyle.bold = u.bold;
116
- }
117
- if (u.italic !== void 0) {
118
- textStyle.italic = u.italic;
119
- }
120
- if (u.underline !== void 0) {
121
- textStyle.underline = u.underline;
122
- }
123
- if (u.align !== void 0) {
124
- textStyle.align = u.align;
125
- }
126
- textEl.textStyle = { ...textEl.textStyle, ...textStyle };
127
- if (textEl.textSegments) {
128
- textEl.textSegments = textEl.textSegments.map((seg) => chunkPBZWDEXQ_cjs.updateTextSegmentStyle(seg, textStyle));
129
- }
130
- }
131
- function applyShapeStyleUpdate(el, u) {
132
- if (u.fillColor === void 0 && u.strokeColor === void 0 && u.strokeWidth === void 0) {
133
- return;
134
- }
135
- if (!pptx.hasShapeProperties(el)) {
136
- return;
137
- }
138
- const holder = el;
139
- holder.shapeStyle ??= {};
140
- const style = holder.shapeStyle;
141
- if (u.fillColor !== void 0) {
142
- style.fillColor = u.fillColor;
143
- }
144
- if (u.strokeColor !== void 0) {
145
- style.strokeColor = u.strokeColor;
146
- }
147
- if (u.strokeWidth !== void 0) {
148
- style.strokeWidth = u.strokeWidth;
149
- }
150
- }
151
-
152
- // src/pptx/ai/bridge-factory.ts
153
- var TITLE_MAX_LENGTH = 120;
154
- function pptxAiDeckTitle(slides) {
155
- for (const element of slides[0]?.elements ?? []) {
156
- const text = "text" in element && typeof element.text === "string" ? element.text.trim() : "";
157
- if (text) {
158
- return text.slice(0, TITLE_MAX_LENGTH);
159
- }
160
- }
161
- return void 0;
162
- }
163
- function copy(list) {
164
- return list ? [...list] : void 0;
165
- }
166
- function readDeckData(port) {
167
- const canvas = port.getCanvasSize();
168
- return {
169
- slides: [...port.getSlides()],
170
- width: canvas.width,
171
- height: canvas.height,
172
- theme: port.getTheme(),
173
- sections: copy(port.getSections()),
174
- presentationProperties: port.getPresentationProperties(),
175
- customProperties: copy(port.getCustomProperties()),
176
- coreProperties: port.getCoreProperties(),
177
- appProperties: port.getAppProperties(),
178
- viewProperties: port.getViewProperties(),
179
- tableStyleMap: port.getTableStyleMap(),
180
- tableStylesDefaultId: port.getTableStylesDefaultId(),
181
- tags: copy(port.getTagCollections())
182
- };
183
- }
184
- function commitDocumentProperties(port, before, after) {
185
- const differs = deckDataFieldChanged;
186
- const core = after.coreProperties ?? before.coreProperties;
187
- const app = after.appProperties ?? before.appProperties;
188
- const custom = after.customProperties ?? before.customProperties ?? [];
189
- const coreChanged = differs(before.coreProperties, core);
190
- if (!coreChanged && !differs(before.appProperties, app) && !differs(before.customProperties, custom)) {
191
- return false;
192
- }
193
- port.setDocumentProperties(core ?? {}, app ?? {}, custom);
194
- if (coreChanged && core) {
195
- port.onCorePropertiesChanged?.(core);
196
- }
197
- return true;
198
- }
199
- function commitDeckData(port, before, after, label) {
200
- const differs = deckDataFieldChanged;
201
- let changed = false;
202
- if (differs(before.slides, after.slides)) {
203
- port.updateSlides(() => after.slides, label);
204
- changed = true;
205
- }
206
- if (before.width !== after.width || before.height !== after.height) {
207
- port.setCanvasSize({ width: after.width, height: after.height });
208
- changed = true;
209
- }
210
- const sections = after.sections ?? before.sections ?? [];
211
- if (differs(before.sections, sections)) {
212
- port.setSections(sections);
213
- changed = true;
214
- }
215
- const presentation = after.presentationProperties ?? before.presentationProperties ?? {};
216
- if (differs(before.presentationProperties, presentation)) {
217
- port.setPresentationProperties(presentation);
218
- changed = true;
219
- }
220
- changed = commitDocumentProperties(port, before, after) || changed;
221
- if (differs(before.viewProperties, after.viewProperties)) {
222
- port.setViewProperties(after.viewProperties);
223
- changed = true;
224
- }
225
- if (differs(before.tableStyleMap, after.tableStyleMap)) {
226
- port.setTableStyleMap(after.tableStyleMap ?? {});
227
- changed = true;
228
- }
229
- if (differs(before.tableStylesDefaultId, after.tableStylesDefaultId)) {
230
- port.setTableStylesDefaultId(after.tableStylesDefaultId);
231
- changed = true;
232
- }
233
- const tags = after.tags ?? before.tags ?? [];
234
- if (differs(before.tags, tags)) {
235
- port.setTagCollections(tags);
236
- changed = true;
237
- }
238
- return changed;
239
- }
240
- function createPptxAiBridge(port) {
241
- const applySlidesUpdate = (updater, label) => {
242
- port.updateSlides((current) => updater(structuredClone([...current])), label);
243
- };
244
- const bridge = {
245
- getDeckMeta() {
246
- const slides = port.getSlides();
247
- const canvas = port.getCanvasSize();
248
- return {
249
- slideCount: slides.length,
250
- activeSlideIndex: port.getActiveSlideIndex(),
251
- title: port.getFileName?.() ?? pptxAiDeckTitle(slides),
252
- width: canvas.width,
253
- height: canvas.height
254
- };
255
- },
256
- getSlides: () => [...port.getSlides()],
257
- getActiveSlideIndex: () => port.getActiveSlideIndex(),
258
- getTheme: () => port.getTheme(),
259
- getHandler: () => port.getHandler() ?? void 0,
260
- goToSlide: (index) => port.goToSlide(index),
261
- selectElements: (slideIndex2, elementIds) => port.selectElements(slideIndex2, elementIds),
262
- applySlidesUpdate,
263
- updateElement(slideIndex2, elementId2, updates) {
264
- applySlidesUpdate((slides) => {
265
- const element = slides[slideIndex2]?.elements.find((el) => el.id === elementId2);
266
- if (element) {
267
- applyElementUpdate(element, updates);
268
- }
269
- return slides;
270
- }, `Update element ${elementId2}`);
271
- },
272
- applyTheme: (updates) => port.applyTheme(updates),
273
- getDeckData: () => readDeckData(port),
274
- applyDeckData(updater, label) {
275
- const before = readDeckData(port);
276
- const after = updater(structuredClone(before));
277
- if (commitDeckData(port, before, after, label)) {
278
- port.afterDeckUpdate?.();
279
- }
280
- }
281
- };
282
- if (port.getFocusedTargets) {
283
- bridge.getFocusedTargets = () => port.getFocusedTargets?.() ?? [];
284
- }
285
- if (port.notify) {
286
- bridge.notify = (message, level) => port.notify?.(message, level);
287
- }
288
- return bridge;
289
- }
290
-
291
- // src/pptx/ai/focus-targets.ts
292
- function computeFocusTargets(input) {
293
- const { activeSlideIndex, selectedElementIds, selectedElementId } = input;
294
- const ids = selectedElementIds.length > 0 ? [...selectedElementIds] : selectedElementId ? [selectedElementId] : [];
295
- if (ids.length === 0) {
296
- return [{ kind: "slide", slideIndex: activeSlideIndex }];
297
- }
298
- return ids.map((elementId2) => ({ kind: "element", slideIndex: activeSlideIndex, elementId: elementId2 }));
299
- }
300
- function elementTypeLabel(type) {
301
- if (type === "smartArt") {
302
- return "SmartArt";
303
- }
304
- if (type === "ole") {
305
- return "OLE";
306
- }
307
- return type.charAt(0).toUpperCase() + type.slice(1);
308
- }
309
- function shortElementId(id) {
310
- const trimmed = id.trimEnd();
311
- let start = trimmed.length;
312
- while (start > 0 && isAsciiDigit(trimmed.charCodeAt(start - 1))) {
313
- start -= 1;
314
- }
315
- if (start < trimmed.length) {
316
- return trimmed.slice(start);
317
- }
318
- const separator = Math.max(id.lastIndexOf("/"), id.lastIndexOf("."), id.lastIndexOf("-"));
319
- const tail = separator === -1 ? id : id.slice(separator + 1);
320
- return tail || id;
321
- }
322
- function isAsciiDigit(code) {
323
- return code >= 48 && code <= 57;
324
- }
325
- function focusTargetChips(targets, slides) {
326
- return targets.map((target, index) => {
327
- if (target.kind === "slide") {
328
- const label2 = `Slide ${target.slideIndex + 1}`;
329
- return { key: `slide-${target.slideIndex}-${index}`, label: label2, title: label2 };
330
- }
331
- const el = slides[target.slideIndex]?.elements.find((e) => e.id === target.elementId);
332
- const typeLabel = el ? elementTypeLabel(el.type) : "Element";
333
- const label = el ? `${typeLabel} ${shortElementId(target.elementId)}` : `${typeLabel} (missing)`;
334
- return {
335
- key: `el-${target.elementId}-${index}`,
336
- label,
337
- title: `${typeLabel}: ${target.elementId}`
338
- };
339
- });
340
- }
341
- function isTwoTableFocus(targets, slides) {
342
- if (targets.length !== 2 || targets.some((target) => target.kind !== "element")) {
343
- return false;
344
- }
345
- const [a, b] = targets;
346
- if (a.slideIndex !== b.slideIndex) {
347
- return false;
348
- }
349
- const slide = slides[a.slideIndex];
350
- const elA = slide?.elements.find((e) => e.id === a.elementId);
351
- const elB = slide?.elements.find((e) => e.id === b.elementId);
352
- if (elA?.type !== "table" || elB?.type !== "table") {
353
- return false;
354
- }
355
- return { slideIndex: a.slideIndex, elementIdA: a.elementId, elementIdB: b.elementId };
356
- }
357
- function mergeTablesDirective(slideIndex2, elementIdA, elementIdB) {
358
- return `Merge the two selected tables (elementIdA=${elementIdA}, elementIdB=${elementIdB}) on slide ${slideIndex2 + 1} using merge_tables; stage it now, do not ask me to confirm.`;
359
- }
360
-
361
- // src/pptx/ai/panel-controller.ts
362
- var AI_TOOL_FLASH_MS = 2600;
363
- function aiFixDirective(element, slideIndex2) {
364
- return `Review and fix any issues with this ${element.type} (id=${element.id}) on slide ${slideIndex2 + 1}.`;
365
- }
366
- function resolveAiEffectiveTargets(state, liveTargets) {
367
- if (state.pickTargets.length > 0) {
368
- return state.pickTargets;
369
- }
370
- if (state.pinnedFocus && state.pinnedFocus.length > 0) {
371
- return state.pinnedFocus;
372
- }
373
- return liveTargets;
374
- }
375
- function isAiFocusPinned(state) {
376
- return state.pickTargets.length === 0 && state.pinnedFocus !== null;
377
- }
378
- function buildHighlights(pickTargets, toolFocus) {
379
- const out = [];
380
- for (const target of pickTargets) {
381
- if (target.kind === "element") {
382
- out.push({ slideIndex: target.slideIndex, elementId: target.elementId, variant: "pick" });
383
- }
384
- }
385
- for (const elementId2 of toolFocus?.elementIds ?? []) {
386
- out.push({ slideIndex: toolFocus?.slideIndex ?? 0, elementId: elementId2, variant: "active" });
387
- }
388
- return out;
389
- }
390
- var INITIAL_STATE = {
391
- isOpen: false,
392
- pinnedFocus: null,
393
- prefill: { text: "", nonce: 0 },
394
- pickMode: false,
395
- pickTargets: [],
396
- canvasHighlights: [],
397
- canvasAnimating: false,
398
- changeBatch: null
399
- };
400
- function createPptxAiPanelController(deps) {
401
- const store = chunkY6DO6SVT_cjs.createControllerStore(INITIAL_STATE);
402
- let toolFocus = null;
403
- let flashing = false;
404
- let flashTimer = null;
405
- const update = (patch) => {
406
- store.update((current) => {
407
- const next = { ...current, ...patch };
408
- const canvasHighlights = buildHighlights(next.pickTargets, toolFocus);
409
- const sameHighlights = canvasHighlights.length === current.canvasHighlights.length && canvasHighlights.every((h, i) => {
410
- const prev = current.canvasHighlights[i];
411
- return prev?.elementId === h.elementId && prev.slideIndex === h.slideIndex && prev.variant === h.variant;
412
- });
413
- return {
414
- ...next,
415
- canvasHighlights: sameHighlights ? current.canvasHighlights : canvasHighlights,
416
- canvasAnimating: flashing || canvasHighlights.length > 0
417
- };
418
- });
419
- };
420
- const liveTargets = () => computeFocusTargets(deps.getSelection());
421
- const openPanel = (patch) => {
422
- update({ ...patch, isOpen: true });
423
- deps.onOpen?.();
424
- };
425
- const fixElement = (element, slideIndex2) => {
426
- const { prefill } = store.getSnapshot();
427
- openPanel({
428
- pinnedFocus: liveTargets(),
429
- prefill: {
430
- text: element ? aiFixDirective(element, slideIndex2) : "",
431
- nonce: prefill.nonce + 1
432
- }
433
- });
434
- };
435
- return {
436
- getSnapshot: store.getSnapshot,
437
- subscribe: store.subscribe,
438
- open: () => openPanel({}),
439
- close: () => update({ isOpen: false }),
440
- toggle() {
441
- if (store.getSnapshot().isOpen) {
442
- update({ isOpen: false });
443
- } else {
444
- openPanel({});
445
- }
446
- },
447
- getLiveTargets: liveTargets,
448
- getEffectiveTargets: () => resolveAiEffectiveTargets(store.getSnapshot(), liveTargets()),
449
- pinFocus: () => update({ pinnedFocus: liveTargets() }),
450
- clearPinnedFocus: () => update({ pinnedFocus: null }),
451
- askAboutSelection() {
452
- const { prefill } = store.getSnapshot();
453
- openPanel({ pinnedFocus: liveTargets(), prefill: { text: "", nonce: prefill.nonce + 1 } });
454
- },
455
- fixSelection() {
456
- fixElement(deps.getSelectedElement?.(), deps.getSelection().activeSlideIndex);
457
- },
458
- fixElement,
459
- startPicking: () => openPanel({ pickMode: true }),
460
- stopPicking: () => update({ pickMode: false }),
461
- addPick(slideIndex2, elementId2) {
462
- const { pickTargets } = store.getSnapshot();
463
- if (pickTargets.some((t) => t.kind === "element" && t.elementId === elementId2)) {
464
- return;
465
- }
466
- update({ pickTargets: [...pickTargets, { kind: "element", slideIndex: slideIndex2, elementId: elementId2 }] });
467
- },
468
- clearPicks: () => update({ pickTargets: [], pickMode: false }),
469
- flashToolTarget(target) {
470
- toolFocus = target && target.slideIndex !== void 0 && target.elementIds.length > 0 ? { slideIndex: target.slideIndex, elementIds: target.elementIds } : null;
471
- flashing = true;
472
- if (flashTimer) {
473
- clearTimeout(flashTimer);
474
- }
475
- flashTimer = setTimeout(() => {
476
- toolFocus = null;
477
- flashing = false;
478
- flashTimer = null;
479
- update({});
480
- }, AI_TOOL_FLASH_MS);
481
- update({});
482
- },
483
- showChangeBatch: (batch) => update({ changeBatch: batch }),
484
- dispose() {
485
- if (flashTimer) {
486
- clearTimeout(flashTimer);
487
- flashTimer = null;
488
- }
489
- }
490
- };
491
- }
492
-
493
54
  // src/pptx/ai/config.ts
494
55
  function resolveChatTransport(options) {
495
56
  const { sdk, connection } = options;
@@ -623,8 +184,8 @@ function bounds(el) {
623
184
  }
624
185
  function elementLine(el) {
625
186
  const text = "text" in el && typeof el.text === "string" ? el.text.trim().replace(/\s+/gu, " ") : "";
626
- const snippet2 = text ? `: "${text.slice(0, 60)}"` : "";
627
- return ` - ${el.type}#${el.id} ${bounds(el)}${snippet2}`;
187
+ const snippet = text ? `: "${text.slice(0, 60)}"` : "";
188
+ return ` - ${el.type}#${el.id} ${bounds(el)}${snippet}`;
628
189
  }
629
190
  function describeTable(el, maxCells) {
630
191
  if (el.type !== "table" || !el.tableData) {
@@ -718,71 +279,6 @@ async function buildDeckContext(bridge, options) {
718
279
  return parts.filter((part) => part.trim()).join("\n\n");
719
280
  }
720
281
 
721
- // src/pptx/ai/proposals-diff.ts
722
- function elementLabel(el) {
723
- const text = "text" in el && typeof el.text === "string" ? el.text.trim() : "";
724
- const snippet2 = text ? `: "${text.slice(0, 24)}${text.length > 24 ? "..." : ""}"` : "";
725
- return `${el.type} ${el.id}${snippet2}`;
726
- }
727
- function diffElements(index, before, after, out) {
728
- const beforeById = new Map(before.map((e) => [e.id, e]));
729
- const afterById = new Map(after.map((e) => [e.id, e]));
730
- for (const el of after) {
731
- if (!beforeById.has(el.id)) {
732
- out.push(`Slide ${index + 1}: add ${elementLabel(el)}`);
733
- }
734
- }
735
- for (const el of before) {
736
- if (!afterById.has(el.id)) {
737
- out.push(`Slide ${index + 1}: remove ${elementLabel(el)}`);
738
- }
739
- }
740
- for (const el of after) {
741
- const prev = beforeById.get(el.id);
742
- if (prev && JSON.stringify(prev) !== JSON.stringify(el)) {
743
- out.push(`Slide ${index + 1}: modify ${elementLabel(el)}`);
744
- }
745
- }
746
- }
747
- function diffSlides(before, after) {
748
- const out = [];
749
- if (after.length > before.length) {
750
- out.push(`Add ${after.length - before.length} slide(s) (total ${after.length}).`);
751
- } else if (after.length < before.length) {
752
- out.push(`Remove ${before.length - after.length} slide(s) (total ${after.length}).`);
753
- }
754
- const beforeById = new Map(before.map((s) => [s.id, s]));
755
- const pairCount = Math.min(before.length, after.length);
756
- for (let i = 0; i < pairCount; i++) {
757
- const nextSlide = after[i];
758
- const prevSlide = beforeById.get(nextSlide.id) ?? before[i];
759
- if (!prevSlide) {
760
- continue;
761
- }
762
- diffElements(i, prevSlide.elements, nextSlide.elements, out);
763
- if ((prevSlide.notes ?? "") !== (nextSlide.notes ?? "")) {
764
- out.push(`Slide ${i + 1}: update speaker notes`);
765
- }
766
- if (prevSlide.backgroundColor !== nextSlide.backgroundColor) {
767
- out.push(`Slide ${i + 1}: change background`);
768
- }
769
- }
770
- if (out.length === 0) {
771
- out.push("No detectable changes.");
772
- }
773
- return out;
774
- }
775
- function humanizeDiffLine(line) {
776
- return line.replace(
777
- /\b(add|remove|modify) (\w+) [^\s:]+(: )?/gu,
778
- (_match, verb, type, colon) => {
779
- const article = verb === "add" ? "a" : "the";
780
- const friendlyVerb = verb === "modify" ? "update" : verb;
781
- return `${friendlyVerb} ${article} ${type}${colon ? " " : ""}`;
782
- }
783
- );
784
- }
785
-
786
282
  // src/pptx/ai/proposals.ts
787
283
  var counter = 0;
788
284
  function nextId() {
@@ -819,7 +315,7 @@ var ProposalStore = class {
819
315
  const proposal = {
820
316
  id: nextId(),
821
317
  label,
822
- summary: diffSlides(before, after),
318
+ summary: chunkBMMTD6PB_cjs.diffSlides(before, after),
823
319
  createdAt: Date.now(),
824
320
  updater
825
321
  };
@@ -1713,145 +1209,6 @@ function buildToolSet(sdk, config, executors, options) {
1713
1209
  return { ...tools, ...config.tools?.extra ?? {} };
1714
1210
  }
1715
1211
 
1716
- // src/pptx/ai/change-diff.ts
1717
- function bounds2(el) {
1718
- return { x: el.x, y: el.y, width: el.width, height: el.height };
1719
- }
1720
- function moved(a, b) {
1721
- return Math.abs(a.x - b.x) > 0.5 || Math.abs(a.y - b.y) > 0.5;
1722
- }
1723
- function resized(a, b) {
1724
- return Math.abs(a.width - b.width) > 0.5 || Math.abs(a.height - b.height) > 0.5;
1725
- }
1726
- function textOf(el) {
1727
- return "text" in el && typeof el.text === "string" ? el.text : void 0;
1728
- }
1729
- function styleSignature(el) {
1730
- const rest = { ...el };
1731
- delete rest["x"];
1732
- delete rest["y"];
1733
- delete rest["width"];
1734
- delete rest["height"];
1735
- delete rest["id"];
1736
- delete rest["rotation"];
1737
- return JSON.stringify(rest);
1738
- }
1739
- function classify(before, after) {
1740
- if (moved(before, after)) {
1741
- return "moved";
1742
- }
1743
- if (resized(before, after)) {
1744
- return "resized";
1745
- }
1746
- if (textOf(before) !== textOf(after)) {
1747
- return "text";
1748
- }
1749
- if (styleSignature(before) !== styleSignature(after)) {
1750
- return "restyled";
1751
- }
1752
- return null;
1753
- }
1754
- function diffChangedElements(before, after) {
1755
- const changes = [];
1756
- const beforeById = new Map(before.map((s) => [s.id, s]));
1757
- after.forEach((afterSlide, slideIndex2) => {
1758
- const beforeSlide = beforeById.get(afterSlide.id) ?? before[slideIndex2];
1759
- const beforeEls = new Map((beforeSlide?.elements ?? []).map((e) => [e.id, e]));
1760
- const afterIds = new Set(afterSlide.elements.map((e) => e.id));
1761
- for (const el of afterSlide.elements) {
1762
- const prev = beforeEls.get(el.id);
1763
- if (!prev) {
1764
- changes.push({ slideIndex: slideIndex2, elementId: el.id, kind: "added", to: bounds2(el) });
1765
- continue;
1766
- }
1767
- const kind = classify(prev, el);
1768
- if (kind) {
1769
- changes.push({ slideIndex: slideIndex2, elementId: el.id, kind, from: bounds2(prev), to: bounds2(el) });
1770
- }
1771
- }
1772
- for (const prev of beforeSlide?.elements ?? []) {
1773
- if (!afterIds.has(prev.id)) {
1774
- changes.push({
1775
- slideIndex: slideIndex2,
1776
- elementId: prev.id,
1777
- kind: "removed",
1778
- from: bounds2(prev)
1779
- });
1780
- }
1781
- }
1782
- });
1783
- return changes;
1784
- }
1785
-
1786
- // src/pptx/ai/change-animator.ts
1787
- var DEFAULTS = {
1788
- enabled: true,
1789
- durationMs: 900,
1790
- glow: true,
1791
- tween: true,
1792
- color: "rgba(59,130,246,1)"
1793
- };
1794
- function resolveChangeAnimationConfig(config) {
1795
- return {
1796
- enabled: config?.enabled ?? DEFAULTS.enabled,
1797
- durationMs: config?.durationMs ?? DEFAULTS.durationMs,
1798
- glow: config?.glow ?? DEFAULTS.glow,
1799
- tween: config?.tween ?? DEFAULTS.tween,
1800
- color: config?.color ?? DEFAULTS.color
1801
- };
1802
- }
1803
- var defaultSchedule = (fn, ms) => {
1804
- const id = setTimeout(fn, ms);
1805
- return () => clearTimeout(id);
1806
- };
1807
- function createAiChangeAnimator(config, schedule = defaultSchedule) {
1808
- let resolved = resolveChangeAnimationConfig(config);
1809
- let batch = null;
1810
- let nonce = 0;
1811
- let cancelClear = null;
1812
- const listeners = /* @__PURE__ */ new Set();
1813
- const emit = () => {
1814
- for (const l of listeners) {
1815
- l(batch);
1816
- }
1817
- };
1818
- return {
1819
- publish(before, after) {
1820
- if (!resolved.enabled) {
1821
- return null;
1822
- }
1823
- const changes = diffChangedElements(before, after);
1824
- if (changes.length === 0) {
1825
- return null;
1826
- }
1827
- cancelClear?.();
1828
- nonce += 1;
1829
- batch = { changes, slideIndex: changes[0].slideIndex, nonce, config: resolved };
1830
- emit();
1831
- cancelClear = schedule(() => {
1832
- batch = null;
1833
- cancelClear = null;
1834
- emit();
1835
- }, resolved.durationMs + 250);
1836
- return batch;
1837
- },
1838
- subscribe(listener) {
1839
- listeners.add(listener);
1840
- return () => listeners.delete(listener);
1841
- },
1842
- current: () => batch,
1843
- configure(next) {
1844
- resolved = resolveChangeAnimationConfig(next);
1845
- },
1846
- dispose() {
1847
- cancelClear?.();
1848
- cancelClear = null;
1849
- listeners.clear();
1850
- batch = null;
1851
- }
1852
- };
1853
- }
1854
-
1855
1212
  // src/pptx/ai/session.ts
1856
1213
  async function createAiChatSession(bridge, config) {
1857
1214
  const sdk = await loadAiSdk();
@@ -1860,7 +1217,7 @@ async function createAiChatSession(bridge, config) {
1860
1217
  'The optional "ai" SDK is not installed. Install `ai` (>=6 <8) to enable the assistant.'
1861
1218
  );
1862
1219
  }
1863
- const changeAnimator = createAiChangeAnimator(config.changeAnimation);
1220
+ const changeAnimator = chunkBMMTD6PB_cjs.createAiChangeAnimator(config.changeAnimation);
1864
1221
  const proposals = new ProposalStore(bridge, changeAnimator);
1865
1222
  const executors = buildToolExecutors(bridge, proposals, config, changeAnimator);
1866
1223
  const tools = buildToolSet(sdk, config, executors, { withExecute: false });
@@ -1896,379 +1253,6 @@ async function createAiChatSession(bridge, config) {
1896
1253
  };
1897
1254
  }
1898
1255
 
1899
- // src/pptx/ai/change-animation-css.ts
1900
- var AI_CHANGE_ATTR = "data-pptx-ai-changed";
1901
- function aiChangeAnimationCss(config) {
1902
- const { color, durationMs } = config;
1903
- return `
1904
- @keyframes pptx-ai-change-glow {
1905
- 0% { box-shadow: 0 0 0 0 ${color}, 0 0 0 0 ${color}; }
1906
- 50% { box-shadow: 0 0 0 4px transparent, 0 0 16px 5px ${color}; }
1907
- 100% { box-shadow: 0 0 0 0 transparent, 0 0 10px 2px transparent; }
1908
- }
1909
- [${AI_CHANGE_ATTR}] {
1910
- animation: pptx-ai-change-glow ${durationMs}ms ease-out;
1911
- outline: 2px solid ${color};
1912
- outline-offset: 1px;
1913
- border-radius: 3px;
1914
- transition: color ${Math.round(durationMs / 2)}ms ease, fill ${Math.round(durationMs / 2)}ms ease,
1915
- stroke ${Math.round(durationMs / 2)}ms ease, background-color ${Math.round(durationMs / 2)}ms ease;
1916
- }
1917
- `;
1918
- }
1919
- var PAD = 3;
1920
- function changeGhostStyle(change, phase, config) {
1921
- const at = phase === "start" ? change.from ?? change.to : change.to ?? change.from;
1922
- const box = at ?? { x: 0, y: 0, width: 0, height: 0 };
1923
- const ms = config.durationMs;
1924
- const tween = config.tween;
1925
- let opacity = 1;
1926
- let transform = "scale(1)";
1927
- if (change.kind === "added") {
1928
- opacity = phase === "start" ? 0 : 1;
1929
- transform = phase === "start" ? "scale(0.92)" : "scale(1)";
1930
- } else if (change.kind === "removed") {
1931
- opacity = phase === "start" ? 0.9 : 0;
1932
- transform = phase === "start" ? "scale(1)" : "scale(0.92)";
1933
- } else {
1934
- opacity = phase === "start" ? 0.85 : 0;
1935
- }
1936
- const transition = tween ? `left ${ms}ms ease, top ${ms}ms ease, width ${ms}ms ease, height ${ms}ms ease, opacity ${ms}ms ease, transform ${ms}ms ease` : `opacity ${ms}ms ease`;
1937
- return {
1938
- position: "absolute",
1939
- left: box.x - PAD,
1940
- top: box.y - PAD,
1941
- width: box.width + PAD * 2,
1942
- height: box.height + PAD * 2,
1943
- opacity,
1944
- transform,
1945
- transition,
1946
- boxShadow: config.glow ? `0 0 14px 3px ${config.color}` : "none",
1947
- border: `2px solid ${config.color}`,
1948
- borderRadius: "4px",
1949
- pointerEvents: "none",
1950
- zIndex: 9997
1951
- };
1952
- }
1953
-
1954
- // src/pptx/ai/ui-parts.ts
1955
- function isTextPart(part) {
1956
- return part.type === "text";
1957
- }
1958
- function isToolPart(part) {
1959
- return typeof part.type === "string" && part.type.startsWith("tool-");
1960
- }
1961
- function isDynamicToolPart(part) {
1962
- return part.type === "dynamic-tool";
1963
- }
1964
- function toolNameOf(part) {
1965
- if (isDynamicToolPart(part)) {
1966
- return part.toolName ?? "tool";
1967
- }
1968
- return typeof part.type === "string" ? part.type.slice("tool-".length) : "tool";
1969
- }
1970
- var READY_TOOL_STATES = /* @__PURE__ */ new Set([
1971
- "input-available",
1972
- "output-available",
1973
- "output-error"
1974
- ]);
1975
- function extractReadyToolCalls(messages) {
1976
- const out = [];
1977
- for (const message of messages) {
1978
- for (const rawPart of message.parts) {
1979
- const part = rawPart;
1980
- if (!isToolPart(part) && !isDynamicToolPart(part)) {
1981
- continue;
1982
- }
1983
- const toolCallId = part.toolCallId ?? "";
1984
- if (toolCallId.length === 0 || part.input === void 0) {
1985
- continue;
1986
- }
1987
- if (!READY_TOOL_STATES.has(part.state ?? "")) {
1988
- continue;
1989
- }
1990
- out.push({ toolName: toolNameOf(part), toolCallId, input: part.input });
1991
- }
1992
- }
1993
- return out;
1994
- }
1995
- function toRenderableParts(message) {
1996
- const out = [];
1997
- for (const rawPart of message.parts) {
1998
- const part = rawPart;
1999
- if (isTextPart(part)) {
2000
- const text = part.text ?? "";
2001
- if (text.trim().length > 0) {
2002
- out.push({ kind: "text", text });
2003
- }
2004
- continue;
2005
- }
2006
- if (isToolPart(part) || isDynamicToolPart(part)) {
2007
- out.push({
2008
- kind: "tool",
2009
- toolName: toolNameOf(part),
2010
- toolCallId: part.toolCallId ?? "",
2011
- state: part.state ?? "input-streaming",
2012
- input: part.input,
2013
- output: part.output,
2014
- errorText: part.errorText
2015
- });
2016
- }
2017
- }
2018
- return out;
2019
- }
2020
-
2021
- // src/pptx/ai/chat-log-export.ts
2022
- function isoOf(ms) {
2023
- const n = Number.isFinite(ms) ? ms : 0;
2024
- return new Date(n).toISOString();
2025
- }
2026
- function toLogChat(chat, detailed) {
2027
- const messages = chat.messages.map((message) => {
2028
- const parts = toRenderableParts(message);
2029
- const textRuns = [];
2030
- const toolCalls = [];
2031
- for (const part of parts) {
2032
- if (part.kind === "text") {
2033
- textRuns.push(part.text);
2034
- continue;
2035
- }
2036
- toolCalls.push({
2037
- toolName: part.toolName,
2038
- toolCallId: part.toolCallId,
2039
- state: part.state,
2040
- input: detailed ? part.input : void 0,
2041
- output: detailed ? part.output : void 0,
2042
- errorText: part.errorText
2043
- });
2044
- }
2045
- return {
2046
- role: message.role,
2047
- text: textRuns.join("\n\n"),
2048
- toolCalls
2049
- };
2050
- });
2051
- return {
2052
- id: chat.id,
2053
- title: chat.title,
2054
- deckId: chat.deckId,
2055
- createdAt: chat.createdAt,
2056
- updatedAt: chat.updatedAt,
2057
- createdAtIso: isoOf(chat.createdAt),
2058
- updatedAtIso: isoOf(chat.updatedAt),
2059
- messageCount: chat.messages.length,
2060
- messages
2061
- };
2062
- }
2063
- function buildChatLogExport(chats, options) {
2064
- const detailed = options?.detailed ?? true;
2065
- const now = options?.now ?? Date.now();
2066
- return {
2067
- format: "pptx-ai-chat-log",
2068
- version: 1,
2069
- exportedAt: isoOf(now),
2070
- detailed,
2071
- chatCount: chats.length,
2072
- chats: chats.map((chat) => toLogChat(chat, detailed))
2073
- };
2074
- }
2075
- function toolCallLine(call, detailed) {
2076
- const lines = [`- Tool \`${call.toolName}\` (${call.state})`];
2077
- if (call.errorText) {
2078
- lines.push(` - error: ${call.errorText}`);
2079
- }
2080
- if (detailed) {
2081
- lines.push(" - input:");
2082
- lines.push(" ```json");
2083
- lines.push(JSON.stringify(call.input ?? null, null, 2));
2084
- lines.push(" ```");
2085
- lines.push(" - output:");
2086
- lines.push(" ```json");
2087
- lines.push(JSON.stringify(call.output ?? null, null, 2));
2088
- lines.push(" ```");
2089
- }
2090
- return lines.join("\n");
2091
- }
2092
- function buildChatLogMarkdown(doc) {
2093
- const out = [
2094
- `# AI chat logs`,
2095
- "",
2096
- `Exported: ${doc.exportedAt}`,
2097
- `Chats: ${doc.chatCount}`,
2098
- ""
2099
- ];
2100
- for (const chat of doc.chats) {
2101
- out.push(`## ${chat.title || chat.id}`);
2102
- out.push("");
2103
- out.push(`- id: ${chat.id}`);
2104
- if (chat.deckId) {
2105
- out.push(`- deck: ${chat.deckId}`);
2106
- }
2107
- out.push(`- created: ${chat.createdAtIso}`);
2108
- out.push(`- updated: ${chat.updatedAtIso}`);
2109
- out.push(`- messages: ${chat.messageCount}`);
2110
- out.push("");
2111
- for (const message of chat.messages) {
2112
- out.push(`### ${message.role}`);
2113
- out.push("");
2114
- if (message.text) {
2115
- out.push(message.text);
2116
- out.push("");
2117
- }
2118
- for (const call of message.toolCalls) {
2119
- out.push(toolCallLine(call, doc.detailed));
2120
- out.push("");
2121
- }
2122
- }
2123
- }
2124
- return out.join("\n");
2125
- }
2126
- async function collectStoredChats(store = chunkA5MANNJR_cjs.createChatHistoryStore()) {
2127
- const summaries = await store.listChats();
2128
- const chats = [];
2129
- for (const summary of summaries) {
2130
- const chat = await store.loadChat(summary.id);
2131
- if (chat) {
2132
- chats.push(chat);
2133
- }
2134
- }
2135
- return chats;
2136
- }
2137
- function timestampSlug(now) {
2138
- const d = new Date(now);
2139
- const p = (n) => String(n).padStart(2, "0");
2140
- return `${d.getFullYear()}${p(d.getMonth() + 1)}${p(d.getDate())}-${p(d.getHours())}${p(d.getMinutes())}${p(d.getSeconds())}`;
2141
- }
2142
- function exportAiChatLogs(chats, meta, save) {
2143
- if (chats.length === 0) {
2144
- return 0;
2145
- }
2146
- const now = meta?.now ?? Date.now();
2147
- const doc = buildChatLogExport(chats, { detailed: meta?.detailed ?? true, now });
2148
- const slug = timestampSlug(now);
2149
- const format = meta?.format ?? "json";
2150
- if (format === "markdown") {
2151
- save(`pptx-ai-chats-${slug}.md`, buildChatLogMarkdown(doc), "text/markdown");
2152
- } else {
2153
- save(`pptx-ai-chats-${slug}.json`, JSON.stringify(doc, null, 2), "application/json");
2154
- }
2155
- return chats.length;
2156
- }
2157
-
2158
- // src/pptx/ai/chat-history-controller.ts
2159
- var SAVE_DEBOUNCE_MS = 800;
2160
- var TITLE_MAX = 40;
2161
- function newChatId() {
2162
- return `chat-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
2163
- }
2164
- function deriveChatTitle(messages) {
2165
- for (const message of messages) {
2166
- if (message.role !== "user") {
2167
- continue;
2168
- }
2169
- const text = message.parts.filter((p) => p.type === "text").map((p) => p.text).join(" ").trim();
2170
- if (text) {
2171
- return text.length > TITLE_MAX ? `${text.slice(0, TITLE_MAX).trimEnd()}\u2026` : text;
2172
- }
2173
- }
2174
- return "";
2175
- }
2176
- function deckIdFromBridge(bridge) {
2177
- const meta = bridge.getDeckMeta();
2178
- const title = (meta.title ?? "deck").trim().toLowerCase().replace(/\s+/gu, "-").slice(0, 60);
2179
- return `${title || "deck"}::${meta.slideCount}`;
2180
- }
2181
- function createAiChatHistoryController(deps) {
2182
- const store = deps.store ?? chunkA5MANNJR_cjs.createChatHistoryStore();
2183
- let chats = [];
2184
- let activeChatId = newChatId();
2185
- let createdAt = Date.now();
2186
- let saveTimer = null;
2187
- let disposed = false;
2188
- const clearTimer = () => {
2189
- if (saveTimer) {
2190
- clearTimeout(saveTimer);
2191
- saveTimer = null;
2192
- }
2193
- };
2194
- const refresh = async () => {
2195
- const list = await store.listChats({ deckId: deps.deckId });
2196
- if (disposed) {
2197
- return;
2198
- }
2199
- chats = list;
2200
- deps.onChatsChanged?.(list);
2201
- };
2202
- void refresh();
2203
- const startNewChat = () => {
2204
- clearTimer();
2205
- activeChatId = newChatId();
2206
- createdAt = Date.now();
2207
- };
2208
- return {
2209
- chats: () => chats,
2210
- activeChatId: () => activeChatId,
2211
- refresh,
2212
- notifyMessagesChanged() {
2213
- clearTimer();
2214
- if (disposed || deps.getMessages().length === 0) {
2215
- return;
2216
- }
2217
- saveTimer = setTimeout(() => {
2218
- saveTimer = null;
2219
- const messages = deps.getMessages();
2220
- if (disposed || messages.length === 0) {
2221
- return;
2222
- }
2223
- void (async () => {
2224
- await store.saveChat({
2225
- id: activeChatId,
2226
- title: deriveChatTitle(messages) || (deps.untitledLabel ?? "Untitled chat"),
2227
- deckId: deps.deckId,
2228
- // JSON round-trip: the binding's transcript may be a framework
2229
- // reactive proxy (Vue deep ref / Svelte $state), which the store's
2230
- // structuredClone would reject with a DataCloneError.
2231
- messages: JSON.parse(JSON.stringify(messages)),
2232
- createdAt,
2233
- updatedAt: Date.now()
2234
- });
2235
- await refresh();
2236
- })();
2237
- }, SAVE_DEBOUNCE_MS);
2238
- },
2239
- newChat() {
2240
- startNewChat();
2241
- deps.setMessages([]);
2242
- },
2243
- async resumeChat(id) {
2244
- const chat = await store.loadChat(id);
2245
- if (!chat || disposed) {
2246
- return;
2247
- }
2248
- clearTimer();
2249
- activeChatId = chat.id;
2250
- createdAt = chat.createdAt;
2251
- deps.setMessages(chat.messages);
2252
- },
2253
- async deleteChat(id) {
2254
- await store.deleteChat(id);
2255
- if (id === activeChatId) {
2256
- startNewChat();
2257
- deps.setMessages([]);
2258
- }
2259
- await refresh();
2260
- },
2261
- clearCurrent() {
2262
- clearTimer();
2263
- deps.setMessages([]);
2264
- },
2265
- dispose() {
2266
- disposed = true;
2267
- clearTimer();
2268
- }
2269
- };
2270
- }
2271
-
2272
1256
  // src/pptx/ai/vanilla-chat.ts
2273
1257
  async function createVanillaChat(options) {
2274
1258
  const sdk = await loadAiSdk();
@@ -2379,410 +1363,162 @@ function buildPptxAiSystemPrompt(options = {}) {
2379
1363
  return buildSystemPrompt(options);
2380
1364
  }
2381
1365
 
2382
- // src/pptx/ai/tool-summary.ts
2383
- function toolLabel(toolName) {
2384
- if (!toolName) {
2385
- return "Tool";
2386
- }
2387
- const words = toolName.replace(/[_-]+/gu, " ").trim().split(/\s+/u);
2388
- return words.map((w, i) => i === 0 ? w.charAt(0).toUpperCase() + w.slice(1) : w).join(" ");
2389
- }
2390
- function formatValue(value) {
2391
- if (value === null || value === void 0) {
2392
- return "";
2393
- }
2394
- if (typeof value === "string") {
2395
- return value.length > 32 ? `"${value.slice(0, 32)}..."` : `"${value}"`;
2396
- }
2397
- if (typeof value === "number" || typeof value === "boolean") {
2398
- return String(value);
2399
- }
2400
- if (Array.isArray(value)) {
2401
- return `[${value.length}]`;
2402
- }
2403
- return "{...}";
2404
- }
2405
- function summarizeToolArgs(input) {
2406
- if (input === null || typeof input !== "object") {
2407
- return "";
2408
- }
2409
- const entries = Object.entries(input).filter(
2410
- ([, v]) => v !== void 0 && v !== null && v !== ""
2411
- );
2412
- if (entries.length === 0) {
2413
- return "";
2414
- }
2415
- const parts = [];
2416
- for (const [key, value] of entries.slice(0, 4)) {
2417
- if (key === "slideIndex" && typeof value === "number") {
2418
- parts.push(`slide ${value + 1}`);
2419
- continue;
2420
- }
2421
- parts.push(`${key}: ${formatValue(value)}`);
2422
- }
2423
- if (entries.length > 4) {
2424
- parts.push("...");
2425
- }
2426
- return parts.join(", ");
2427
- }
2428
- function asRecord(input) {
2429
- return input && typeof input === "object" ? input : {};
2430
- }
2431
- function slideNumber(input) {
2432
- const v = input.slideIndex;
2433
- return typeof v === "number" && Number.isFinite(v) ? v + 1 : void 0;
2434
- }
2435
- function onSlide(input) {
2436
- const n = slideNumber(input);
2437
- return n === void 0 ? "" : ` on slide ${n}`;
2438
- }
2439
- function snippet(value) {
2440
- if (typeof value !== "string" || value.trim().length === 0) {
2441
- return "";
2442
- }
2443
- const trimmed = value.trim();
2444
- return trimmed.length > 24 ? `"${trimmed.slice(0, 24)}..."` : `"${trimmed}"`;
2445
- }
2446
- var TOOL_PHRASES = {
2447
- // ── read ─────────────────────────────────────────────────────────────────
2448
- get_deck_overview: {
2449
- icon: "view",
2450
- present: () => "Reviewing the deck",
2451
- past: () => "Reviewed the deck"
2452
- },
2453
- get_slide: {
2454
- icon: "view",
2455
- present: (i) => `Looking at slide ${slideNumber(i) ?? ""}`.trim(),
2456
- past: (i) => `Looked at slide ${slideNumber(i) ?? ""}`.trim()
2457
- },
2458
- get_element: {
2459
- icon: "view",
2460
- present: (i) => `Inspecting an element${onSlide(i)}`,
2461
- past: (i) => `Inspected an element${onSlide(i)}`
2462
- },
2463
- get_speaker_notes: {
2464
- icon: "notes",
2465
- present: (i) => `Reading the notes${onSlide(i)}`,
2466
- past: (i) => `Read the notes${onSlide(i)}`
2467
- },
2468
- find_text: {
2469
- icon: "search",
2470
- present: (i) => `Searching for ${snippet(i.query) || "text"}`,
2471
- past: (i) => `Searched for ${snippet(i.query) || "text"}`
2472
- },
2473
- get_theme: {
2474
- icon: "theme",
2475
- present: () => "Checking the theme",
2476
- past: () => "Checked the theme"
2477
- },
2478
- // ── navigation ───────────────────────────────────────────────────────────
2479
- go_to_slide: {
2480
- icon: "nav",
2481
- present: (i) => `Going to slide ${slideNumber(i) ?? ""}`.trim(),
2482
- past: (i) => `Went to slide ${slideNumber(i) ?? ""}`.trim()
2483
- },
2484
- select_elements: {
2485
- icon: "view",
2486
- present: (i) => `Selecting elements${onSlide(i)}`,
2487
- past: (i) => `Selected elements${onSlide(i)}`
2488
- },
2489
- // ── MCP reads (no bespoke equivalent) ────────────────────────────────────────
2490
- get_metadata: {
2491
- icon: "view",
2492
- present: () => "Checking the file details",
2493
- past: () => "Checked the file details"
2494
- },
2495
- get_layouts: {
2496
- icon: "view",
2497
- present: () => "Looking at the layouts",
2498
- past: () => "Looked at the layouts"
2499
- },
2500
- find_placeholders: {
2501
- icon: "search",
2502
- present: () => "Finding placeholders",
2503
- past: () => "Found placeholders"
2504
- },
2505
- get_presentation_properties: {
2506
- icon: "view",
2507
- present: () => "Checking the slideshow settings",
2508
- past: () => "Checked the slideshow settings"
2509
- },
2510
- run_accessibility_check: {
2511
- icon: "view",
2512
- present: () => "Running an accessibility check",
2513
- past: () => "Ran an accessibility check"
2514
- },
2515
- convert_to_markdown: {
2516
- icon: "view",
2517
- present: () => "Exporting to Markdown",
2518
- past: () => "Exported to Markdown"
2519
- },
2520
- export_to_json: {
2521
- icon: "view",
2522
- present: () => "Exporting to JSON",
2523
- past: () => "Exported to JSON"
2524
- },
2525
- import_from_json: {
2526
- icon: "slide",
2527
- present: () => "Importing deck from JSON",
2528
- past: () => "Imported deck from JSON"
2529
- },
2530
- // ── element editing ────────────────────────────────────────────────────────
2531
- update_element: {
2532
- icon: "move",
2533
- present: (i) => `Updating an element${onSlide(i)}`,
2534
- past: (i) => `Updated an element${onSlide(i)}`
2535
- },
2536
- update_element_style: {
2537
- icon: "shape",
2538
- present: (i) => `Restyling an element${onSlide(i)}`,
2539
- past: (i) => `Restyled an element${onSlide(i)}`
2540
- },
2541
- add_element: {
2542
- icon: "shape",
2543
- present: (i) => `Adding a ${typeof i.type === "string" ? i.type : "element"}${onSlide(i)}`,
2544
- past: (i) => `Added a ${typeof i.type === "string" ? i.type : "element"}${onSlide(i)}`
2545
- },
2546
- delete_elements: {
2547
- icon: "delete",
2548
- present: (i) => `Deleting ${countLabel(i.elementIds, "element")}${onSlide(i)}`,
2549
- past: (i) => `Deleted ${countLabel(i.elementIds, "element")}${onSlide(i)}`
2550
- },
2551
- arrange_elements: {
2552
- icon: "move",
2553
- present: (i) => `Rearranging elements${onSlide(i)}`,
2554
- past: (i) => `Rearranged elements${onSlide(i)}`
2555
- },
2556
- clone_element: {
2557
- icon: "shape",
2558
- present: (i) => `Cloning an element${onSlide(i)}`,
2559
- past: (i) => `Cloned an element${onSlide(i)}`
2560
- },
2561
- group_elements: {
2562
- icon: "shape",
2563
- present: (i) => `Grouping elements${onSlide(i)}`,
2564
- past: (i) => `Grouped elements${onSlide(i)}`
2565
- },
2566
- ungroup_elements: {
2567
- icon: "shape",
2568
- present: (i) => `Ungrouping a group${onSlide(i)}`,
2569
- past: (i) => `Ungrouped a group${onSlide(i)}`
2570
- },
2571
- batch_update_elements: {
2572
- icon: "move",
2573
- present: (i) => `Updating several elements${onSlide(i)}`,
2574
- past: (i) => `Updated several elements${onSlide(i)}`
2575
- },
2576
- replace_geometry: {
2577
- icon: "shape",
2578
- present: (i) => `Reshaping an element${onSlide(i)}`,
2579
- past: (i) => `Reshaped an element${onSlide(i)}`
2580
- },
2581
- set_element_lock: {
2582
- icon: "shape",
2583
- present: (i) => `Locking an element${onSlide(i)}`,
2584
- past: (i) => `Locked an element${onSlide(i)}`
2585
- },
2586
- manage_hyperlinks: {
2587
- icon: "text",
2588
- present: (i) => `Updating a link${onSlide(i)}`,
2589
- past: (i) => `Updated a link${onSlide(i)}`
2590
- },
2591
- set_element_animation: {
2592
- icon: "animation",
2593
- present: (i) => `Adding an animation${onSlide(i)}`,
2594
- past: (i) => `Added an animation${onSlide(i)}`
2595
- },
2596
- // ── text / tables / charts / smartart ────────────────────────────────────────
2597
- replace_text: {
2598
- icon: "search",
2599
- present: () => "Replacing text across the deck",
2600
- past: () => "Replaced text across the deck"
2601
- },
2602
- manage_comments: {
2603
- icon: "notes",
2604
- present: (i) => `Updating comments${onSlide(i)}`,
2605
- past: (i) => `Updated comments${onSlide(i)}`
2606
- },
2607
- update_table_cells: {
2608
- icon: "table",
2609
- present: (i) => `Editing table cells${onSlide(i)}`,
2610
- past: (i) => `Edited table cells${onSlide(i)}`
2611
- },
2612
- manage_table_structure: {
2613
- icon: "table",
2614
- present: (i) => `Changing a table${onSlide(i)}`,
2615
- past: (i) => `Changed a table${onSlide(i)}`
2616
- },
2617
- merge_tables: {
2618
- icon: "table",
2619
- present: (i) => `Merging two tables${onSlide(i)}`,
2620
- past: (i) => `Merged two tables${onSlide(i)}`
2621
- },
2622
- create_chart: {
2623
- icon: "chart",
2624
- present: (i) => `Adding a ${chartKind(i.chartType)}chart${onSlide(i)}`,
2625
- past: (i) => `Added a ${chartKind(i.chartType)}chart${onSlide(i)}`
2626
- },
2627
- update_chart: {
2628
- icon: "chart",
2629
- present: (i) => `Updating a chart${onSlide(i)}`,
2630
- past: (i) => `Updated a chart${onSlide(i)}`
2631
- },
2632
- add_chart_series: {
2633
- icon: "chart",
2634
- present: (i) => `Adding a chart series${onSlide(i)}`,
2635
- past: (i) => `Added a chart series${onSlide(i)}`
2636
- },
2637
- remove_chart_series: {
2638
- icon: "chart",
2639
- present: (i) => `Removing a chart series${onSlide(i)}`,
2640
- past: (i) => `Removed a chart series${onSlide(i)}`
2641
- },
2642
- update_chart_series_data: {
2643
- icon: "chart",
2644
- present: (i) => `Updating chart data${onSlide(i)}`,
2645
- past: (i) => `Updated chart data${onSlide(i)}`
2646
- },
2647
- manage_smart_art: {
2648
- icon: "shape",
2649
- present: (i) => `Editing SmartArt${onSlide(i)}`,
2650
- past: (i) => `Edited SmartArt${onSlide(i)}`
2651
- },
2652
- apply_template: {
2653
- icon: "text",
2654
- present: () => "Filling in placeholders",
2655
- past: () => "Filled in placeholders"
2656
- },
2657
- // ── slide structure ──────────────────────────────────────────────────────────
2658
- add_slide: {
2659
- icon: "slide",
2660
- present: () => "Adding a slide",
2661
- past: () => "Added a slide"
2662
- },
2663
- duplicate_slide: {
2664
- icon: "slide",
2665
- present: (i) => `Duplicating slide ${slideNumber(i) ?? ""}`.trim(),
2666
- past: (i) => `Duplicated slide ${slideNumber(i) ?? ""}`.trim()
2667
- },
2668
- delete_slides: {
2669
- icon: "delete",
2670
- present: (i) => `Deleting ${countLabel(i.slideIndexes, "slide")}`,
2671
- past: (i) => `Deleted ${countLabel(i.slideIndexes, "slide")}`
2672
- },
2673
- reorder_slides: {
2674
- icon: "slide",
2675
- present: () => "Reordering the slides",
2676
- past: () => "Reordered the slides"
2677
- },
2678
- update_slide_properties: {
2679
- icon: "slide",
2680
- present: (i) => `Updating slide ${slideNumber(i) ?? ""}`.trim(),
2681
- past: (i) => `Updated slide ${slideNumber(i) ?? ""}`.trim()
2682
- },
2683
- set_slide_transition: {
2684
- icon: "animation",
2685
- present: (i) => `Setting a transition${onSlide(i)}`,
2686
- past: (i) => `Set a transition${onSlide(i)}`
2687
- },
2688
- // ── theme (applied immediately) ──────────────────────────────────────────────
2689
- apply_theme_preset: {
2690
- icon: "theme",
2691
- present: (i) => typeof i.presetName === "string" ? `Applying the ${i.presetName} theme` : "Applying a theme",
2692
- past: (i) => typeof i.presetName === "string" ? `Applied the ${i.presetName} theme` : "Applied a theme"
2693
- },
2694
- update_theme_colors: {
2695
- icon: "theme",
2696
- present: () => "Changing the theme colours",
2697
- past: () => "Changed the theme colours"
2698
- },
2699
- update_theme_fonts: {
2700
- icon: "theme",
2701
- present: () => "Changing the theme fonts",
2702
- past: () => "Changed the theme fonts"
2703
- },
2704
- // ── presentation-level ────────────────────────────────────────────────────────
2705
- set_canvas_size: {
2706
- icon: "slide",
2707
- present: () => "Resizing the slides",
2708
- past: () => "Resized the slides"
2709
- },
2710
- update_metadata: {
2711
- icon: "tool",
2712
- present: () => "Updating the file details",
2713
- past: () => "Updated the file details"
2714
- },
2715
- manage_sections: {
2716
- icon: "slide",
2717
- present: () => "Organising the sections",
2718
- past: () => "Organised the sections"
2719
- },
2720
- update_presentation_properties: {
2721
- icon: "tool",
2722
- present: () => "Updating the slideshow settings",
2723
- past: () => "Updated the slideshow settings"
2724
- },
2725
- apply_layout: {
2726
- icon: "slide",
2727
- present: (i) => `Applying a layout${onSlide(i)}`,
2728
- past: (i) => `Applied a layout${onSlide(i)}`
2729
- }
2730
- };
2731
- function chartKind(value) {
2732
- return typeof value === "string" && /^[a-z]+$/iu.test(value) ? `${value} ` : "";
2733
- }
2734
- function countLabel(value, noun) {
2735
- const n = Array.isArray(value) ? value.length : 0;
2736
- if (n <= 1) {
2737
- return `${n || 1} ${noun}`;
2738
- }
2739
- return `${n} ${noun}s`;
2740
- }
2741
- function describeToolActivity(toolName, input, tense = "past") {
2742
- const phrase = TOOL_PHRASES[toolName];
2743
- const record = asRecord(input);
2744
- if (!phrase) {
2745
- return { icon: "tool", label: toolLabel(toolName) };
2746
- }
2747
- return { icon: phrase.icon, label: phrase[tense](record) };
2748
- }
2749
-
2750
- // src/pptx/ai/tool-target.ts
2751
- function isFiniteNumber(value) {
2752
- return typeof value === "number" && Number.isFinite(value);
2753
- }
2754
- function pushId(ids, value) {
2755
- if (typeof value === "string" && value.length > 0) {
2756
- ids.push(value);
2757
- }
2758
- }
2759
- function toolCanvasTarget(toolName, input) {
2760
- const o = input && typeof input === "object" ? input : {};
2761
- const elementIds = [];
2762
- pushId(elementIds, o.elementId);
2763
- pushId(elementIds, o.elementIdA);
2764
- pushId(elementIds, o.elementIdB);
2765
- if (Array.isArray(o.elementIds)) {
2766
- for (const value of o.elementIds) {
2767
- pushId(elementIds, value);
2768
- }
2769
- }
2770
- let slideIndex2 = isFiniteNumber(o.slideIndex) ? o.slideIndex : void 0;
2771
- if (slideIndex2 === void 0 && Array.isArray(o.slideIndexes) && isFiniteNumber(o.slideIndexes[0])) {
2772
- slideIndex2 = o.slideIndexes[0];
2773
- }
2774
- if (slideIndex2 === void 0 && Array.isArray(o.newOrder) && isFiniteNumber(o.newOrder[0])) {
2775
- slideIndex2 = o.newOrder[0];
2776
- }
2777
- if (slideIndex2 === void 0 && toolName === "duplicate_slide" && isFiniteNumber(o.slideIndex)) {
2778
- slideIndex2 = o.slideIndex;
2779
- }
2780
- if (slideIndex2 === void 0 && elementIds.length === 0) {
2781
- return null;
2782
- }
2783
- return { slideIndex: slideIndex2, elementIds };
2784
- }
2785
-
1366
+ Object.defineProperty(exports, "AI_CHANGE_ATTR", {
1367
+ enumerable: true,
1368
+ get: function () { return chunkBMMTD6PB_cjs.AI_CHANGE_ATTR; }
1369
+ });
1370
+ Object.defineProperty(exports, "AI_TOOL_FLASH_MS", {
1371
+ enumerable: true,
1372
+ get: function () { return chunkBMMTD6PB_cjs.AI_TOOL_FLASH_MS; }
1373
+ });
1374
+ Object.defineProperty(exports, "aiChangeAnimationCss", {
1375
+ enumerable: true,
1376
+ get: function () { return chunkBMMTD6PB_cjs.aiChangeAnimationCss; }
1377
+ });
1378
+ Object.defineProperty(exports, "aiFixDirective", {
1379
+ enumerable: true,
1380
+ get: function () { return chunkBMMTD6PB_cjs.aiFixDirective; }
1381
+ });
1382
+ Object.defineProperty(exports, "applyElementUpdate", {
1383
+ enumerable: true,
1384
+ get: function () { return chunkBMMTD6PB_cjs.applyElementUpdate; }
1385
+ });
1386
+ Object.defineProperty(exports, "applyShapeStyleUpdate", {
1387
+ enumerable: true,
1388
+ get: function () { return chunkBMMTD6PB_cjs.applyShapeStyleUpdate; }
1389
+ });
1390
+ Object.defineProperty(exports, "applyTextUpdate", {
1391
+ enumerable: true,
1392
+ get: function () { return chunkBMMTD6PB_cjs.applyTextUpdate; }
1393
+ });
1394
+ Object.defineProperty(exports, "buildChatLogExport", {
1395
+ enumerable: true,
1396
+ get: function () { return chunkBMMTD6PB_cjs.buildChatLogExport; }
1397
+ });
1398
+ Object.defineProperty(exports, "buildChatLogMarkdown", {
1399
+ enumerable: true,
1400
+ get: function () { return chunkBMMTD6PB_cjs.buildChatLogMarkdown; }
1401
+ });
1402
+ Object.defineProperty(exports, "changeGhostStyle", {
1403
+ enumerable: true,
1404
+ get: function () { return chunkBMMTD6PB_cjs.changeGhostStyle; }
1405
+ });
1406
+ Object.defineProperty(exports, "collectStoredChats", {
1407
+ enumerable: true,
1408
+ get: function () { return chunkBMMTD6PB_cjs.collectStoredChats; }
1409
+ });
1410
+ Object.defineProperty(exports, "computeFocusTargets", {
1411
+ enumerable: true,
1412
+ get: function () { return chunkBMMTD6PB_cjs.computeFocusTargets; }
1413
+ });
1414
+ Object.defineProperty(exports, "createAiChangeAnimator", {
1415
+ enumerable: true,
1416
+ get: function () { return chunkBMMTD6PB_cjs.createAiChangeAnimator; }
1417
+ });
1418
+ Object.defineProperty(exports, "createAiChatHistoryController", {
1419
+ enumerable: true,
1420
+ get: function () { return chunkBMMTD6PB_cjs.createAiChatHistoryController; }
1421
+ });
1422
+ Object.defineProperty(exports, "createPptxAiBridge", {
1423
+ enumerable: true,
1424
+ get: function () { return chunkBMMTD6PB_cjs.createPptxAiBridge; }
1425
+ });
1426
+ Object.defineProperty(exports, "createPptxAiPanelController", {
1427
+ enumerable: true,
1428
+ get: function () { return chunkBMMTD6PB_cjs.createPptxAiPanelController; }
1429
+ });
1430
+ Object.defineProperty(exports, "deckDataFieldChanged", {
1431
+ enumerable: true,
1432
+ get: function () { return chunkBMMTD6PB_cjs.deckDataFieldChanged; }
1433
+ });
1434
+ Object.defineProperty(exports, "deckIdFromBridge", {
1435
+ enumerable: true,
1436
+ get: function () { return chunkBMMTD6PB_cjs.deckIdFromBridge; }
1437
+ });
1438
+ Object.defineProperty(exports, "deriveChatTitle", {
1439
+ enumerable: true,
1440
+ get: function () { return chunkBMMTD6PB_cjs.deriveChatTitle; }
1441
+ });
1442
+ Object.defineProperty(exports, "describeToolActivity", {
1443
+ enumerable: true,
1444
+ get: function () { return chunkBMMTD6PB_cjs.describeToolActivity; }
1445
+ });
1446
+ Object.defineProperty(exports, "diffChangedElements", {
1447
+ enumerable: true,
1448
+ get: function () { return chunkBMMTD6PB_cjs.diffChangedElements; }
1449
+ });
1450
+ Object.defineProperty(exports, "diffSlides", {
1451
+ enumerable: true,
1452
+ get: function () { return chunkBMMTD6PB_cjs.diffSlides; }
1453
+ });
1454
+ Object.defineProperty(exports, "exportAiChatLogs", {
1455
+ enumerable: true,
1456
+ get: function () { return chunkBMMTD6PB_cjs.exportAiChatLogs; }
1457
+ });
1458
+ Object.defineProperty(exports, "extractReadyToolCalls", {
1459
+ enumerable: true,
1460
+ get: function () { return chunkBMMTD6PB_cjs.extractReadyToolCalls; }
1461
+ });
1462
+ Object.defineProperty(exports, "focusTargetChips", {
1463
+ enumerable: true,
1464
+ get: function () { return chunkBMMTD6PB_cjs.focusTargetChips; }
1465
+ });
1466
+ Object.defineProperty(exports, "humanizeDiffLine", {
1467
+ enumerable: true,
1468
+ get: function () { return chunkBMMTD6PB_cjs.humanizeDiffLine; }
1469
+ });
1470
+ Object.defineProperty(exports, "isAiFocusPinned", {
1471
+ enumerable: true,
1472
+ get: function () { return chunkBMMTD6PB_cjs.isAiFocusPinned; }
1473
+ });
1474
+ Object.defineProperty(exports, "isTwoTableFocus", {
1475
+ enumerable: true,
1476
+ get: function () { return chunkBMMTD6PB_cjs.isTwoTableFocus; }
1477
+ });
1478
+ Object.defineProperty(exports, "mergeTablesDirective", {
1479
+ enumerable: true,
1480
+ get: function () { return chunkBMMTD6PB_cjs.mergeTablesDirective; }
1481
+ });
1482
+ Object.defineProperty(exports, "newChatId", {
1483
+ enumerable: true,
1484
+ get: function () { return chunkBMMTD6PB_cjs.newChatId; }
1485
+ });
1486
+ Object.defineProperty(exports, "pptxAiDeckTitle", {
1487
+ enumerable: true,
1488
+ get: function () { return chunkBMMTD6PB_cjs.pptxAiDeckTitle; }
1489
+ });
1490
+ Object.defineProperty(exports, "resolveAiEffectiveTargets", {
1491
+ enumerable: true,
1492
+ get: function () { return chunkBMMTD6PB_cjs.resolveAiEffectiveTargets; }
1493
+ });
1494
+ Object.defineProperty(exports, "resolveChangeAnimationConfig", {
1495
+ enumerable: true,
1496
+ get: function () { return chunkBMMTD6PB_cjs.resolveChangeAnimationConfig; }
1497
+ });
1498
+ Object.defineProperty(exports, "summarizeToolArgs", {
1499
+ enumerable: true,
1500
+ get: function () { return chunkBMMTD6PB_cjs.summarizeToolArgs; }
1501
+ });
1502
+ Object.defineProperty(exports, "toLogChat", {
1503
+ enumerable: true,
1504
+ get: function () { return chunkBMMTD6PB_cjs.toLogChat; }
1505
+ });
1506
+ Object.defineProperty(exports, "toRenderableParts", {
1507
+ enumerable: true,
1508
+ get: function () { return chunkBMMTD6PB_cjs.toRenderableParts; }
1509
+ });
1510
+ Object.defineProperty(exports, "toolCallLine", {
1511
+ enumerable: true,
1512
+ get: function () { return chunkBMMTD6PB_cjs.toolCallLine; }
1513
+ });
1514
+ Object.defineProperty(exports, "toolCanvasTarget", {
1515
+ enumerable: true,
1516
+ get: function () { return chunkBMMTD6PB_cjs.toolCanvasTarget; }
1517
+ });
1518
+ Object.defineProperty(exports, "toolLabel", {
1519
+ enumerable: true,
1520
+ get: function () { return chunkBMMTD6PB_cjs.toolLabel; }
1521
+ });
2786
1522
  Object.defineProperty(exports, "createChatHistoryStore", {
2787
1523
  enumerable: true,
2788
1524
  get: function () { return chunkA5MANNJR_cjs.createChatHistoryStore; }
@@ -2791,20 +1527,11 @@ Object.defineProperty(exports, "mergeTableElements", {
2791
1527
  enumerable: true,
2792
1528
  get: function () { return tableMerge.mergeTableElements; }
2793
1529
  });
2794
- exports.AI_CHANGE_ATTR = AI_CHANGE_ATTR;
2795
- exports.AI_TOOL_FLASH_MS = AI_TOOL_FLASH_MS;
2796
1530
  exports.BASE_SYSTEM_PROMPT = BASE_SYSTEM_PROMPT;
2797
1531
  exports.BESPOKE_TOOL_ENTRIES = BESPOKE_TOOL_ENTRIES;
2798
1532
  exports.MCP_TOOL_ENTRIES = MCP_TOOL_ENTRIES;
2799
1533
  exports.ProposalStore = ProposalStore;
2800
- exports.aiChangeAnimationCss = aiChangeAnimationCss;
2801
- exports.aiFixDirective = aiFixDirective;
2802
1534
  exports.allToolNames = allToolNames;
2803
- exports.applyElementUpdate = applyElementUpdate;
2804
- exports.applyShapeStyleUpdate = applyShapeStyleUpdate;
2805
- exports.applyTextUpdate = applyTextUpdate;
2806
- exports.buildChatLogExport = buildChatLogExport;
2807
- exports.buildChatLogMarkdown = buildChatLogMarkdown;
2808
1535
  exports.buildDeckContext = buildDeckContext;
2809
1536
  exports.buildDeckOutline = buildDeckOutline;
2810
1537
  exports.buildFocusedTargetsContext = buildFocusedTargetsContext;
@@ -2814,47 +1541,17 @@ exports.buildSlideMarkdown = buildSlideMarkdown;
2814
1541
  exports.buildSystemPrompt = buildSystemPrompt;
2815
1542
  exports.buildToolExecutors = buildToolExecutors;
2816
1543
  exports.buildToolSet = buildToolSet;
2817
- exports.changeGhostStyle = changeGhostStyle;
2818
1544
  exports.clampToTokenBudget = clampToTokenBudget;
2819
- exports.collectStoredChats = collectStoredChats;
2820
- exports.computeFocusTargets = computeFocusTargets;
2821
- exports.createAiChangeAnimator = createAiChangeAnimator;
2822
- exports.createAiChatHistoryController = createAiChatHistoryController;
2823
1545
  exports.createAiChatSession = createAiChatSession;
2824
- exports.createPptxAiBridge = createPptxAiBridge;
2825
- exports.createPptxAiPanelController = createPptxAiPanelController;
2826
1546
  exports.createVanillaChat = createVanillaChat;
2827
- exports.deckDataFieldChanged = deckDataFieldChanged;
2828
- exports.deckIdFromBridge = deckIdFromBridge;
2829
- exports.deriveChatTitle = deriveChatTitle;
2830
- exports.describeToolActivity = describeToolActivity;
2831
- exports.diffChangedElements = diffChangedElements;
2832
- exports.diffSlides = diffSlides;
2833
1547
  exports.enabledToolNames = enabledToolNames;
2834
1548
  exports.estimateTokens = estimateTokens;
2835
- exports.exportAiChatLogs = exportAiChatLogs;
2836
- exports.extractReadyToolCalls = extractReadyToolCalls;
2837
- exports.focusTargetChips = focusTargetChips;
2838
- exports.humanizeDiffLine = humanizeDiffLine;
2839
1549
  exports.isAiAvailable = isAiAvailable;
2840
- exports.isAiFocusPinned = isAiFocusPinned;
2841
- exports.isTwoTableFocus = isTwoTableFocus;
2842
1550
  exports.loadAiSdk = loadAiSdk;
2843
- exports.mergeTablesDirective = mergeTablesDirective;
2844
- exports.newChatId = newChatId;
2845
- exports.pptxAiDeckTitle = pptxAiDeckTitle;
2846
1551
  exports.requireElement = requireElement;
2847
1552
  exports.requireSlide = requireSlide;
2848
1553
  exports.resetAiSdkCache = resetAiSdkCache;
2849
- exports.resolveAiEffectiveTargets = resolveAiEffectiveTargets;
2850
- exports.resolveChangeAnimationConfig = resolveChangeAnimationConfig;
2851
1554
  exports.resolveChatTransport = resolveChatTransport;
2852
1555
  exports.routeWrite = routeWrite;
2853
1556
  exports.runSharedTool = runSharedTool;
2854
1557
  exports.slideTitle = slideTitle;
2855
- exports.summarizeToolArgs = summarizeToolArgs;
2856
- exports.toLogChat = toLogChat;
2857
- exports.toRenderableParts = toRenderableParts;
2858
- exports.toolCallLine = toolCallLine;
2859
- exports.toolCanvasTarget = toolCanvasTarget;
2860
- exports.toolLabel = toolLabel;