pptx-vanilla-viewer 3.7.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,147 @@ A release listed with no entries carried no Conventional Commit in this package'
7
7
  scope: scripts/release-plan.mjs re-releases a package whenever any of its files
8
8
  change, not only on conventional ones.
9
9
 
10
+ ## [3.8.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.8.0) - 2026-09-25
11
+
12
+ ### Features
13
+
14
+ - **core:** Resolve p:style references on demand for style galleries (by @ChristopherVR) ([e4303f7](https://github.com/ChristopherVR/pptx-viewer/commit/e4303f74a42c745929e9c4296f34686124c10bf9))
15
+ - **core:** Size smartart engine nodes from their own text (by @ChristopherVR) ([34c33cb](https://github.com/ChristopherVR/pptx-viewer/commit/34c33cbb48f225cda606a397f19b31ac841b82e2))
16
+ - **core:** Lay org-chart assistants out in the smartart engine (by @ChristopherVR) ([722a465](https://github.com/ChristopherVR/pptx-viewer/commit/722a465d5225e6d96bdae5cc3a4570c843e89c7b))
17
+ - **core:** Fit meet the team and process list grids in the smartart engine (by @ChristopherVR) ([6ee431c](https://github.com/ChristopherVR/pptx-viewer/commit/6ee431c4f1b3af4469c8824c02a7a5ec1be0abed))
18
+ - **core:** Keep c:grouping standard distinct from clustered (by @claude) ([c3472e2](https://github.com/ChristopherVR/pptx-viewer/commit/c3472e2cbf2bec39d8f8bbbcae2ec59084acc41f))
19
+ - **shared:** Lay out right-angle-axes 3D bar charts as PowerPoint does (by @claude) ([0985f9d](https://github.com/ChristopherVR/pptx-viewer/commit/0985f9d36253eabcc681115cfbb07c6253fcb868))
20
+ - **shared:** Draw cylinder, cone and pyramid 3D bars as PowerPoint does (by @claude) ([668aa8d](https://github.com/ChristopherVR/pptx-viewer/commit/668aa8d3446d3a6b5f72f421bf01e00affdaf00e))
21
+ - **shared:** Draw perspective 3D line and area charts as PowerPoint does (by @claude) ([0ab4a7d](https://github.com/ChristopherVR/pptx-viewer/commit/0ab4a7da69f3993a74a24b0c804685681fd707f2))
22
+ - **shared:** Draw 3D surface charts in value bands as PowerPoint does (by @claude) ([cc87ef4](https://github.com/ChristopherVR/pptx-viewer/commit/cc87ef4cba6574f6aee68dc5178b25c46082d1cf))
23
+ - **shared:** Draw 3D pie charts as PowerPoint does (by @claude) ([553a935](https://github.com/ChristopherVR/pptx-viewer/commit/553a935c2257b7ef0280dbd82abcbf22a1d790a5))
24
+ - **core:** Write SmartArt drawing-shape 3D properties back on save (by @claude) ([45ec2db](https://github.com/ChristopherVR/pptx-viewer/commit/45ec2db46147c9a022e2bdc9ba1e1e5c64f4d94f))
25
+ - **shared:** Render SmartArt bevel and scene quick styles in 3D (by @claude) ([3bdf7e9](https://github.com/ChristopherVR/pptx-viewer/commit/3bdf7e959fed36302350bcbfd2c664d07b0cad86))
26
+ - **shared:** Draw 3D columns without right-angle axes on the perspective box (by @claude) ([e65a8c9](https://github.com/ChristopherVR/pptx-viewer/commit/e65a8c9dba2bcb21ccd81fb471a7b2c019b40d51))
27
+ - **core:** Keep smartart quick-style 3d across structural edits (by @claude) ([a815448](https://github.com/ChristopherVR/pptx-viewer/commit/a815448a7ce291f1989fd3306df523670a2d3d1a))
28
+ - **shared:** Render structurally edited smartart with its quick-style 3d (by @claude) ([2c31bed](https://github.com/ChristopherVR/pptx-viewer/commit/2c31bede6f30886fe1f5f78cb55ad59492485838))
29
+ - **core:** Read SmartArt label colour from fontRef and keep fill alpha (by @claude) ([866c7ee](https://github.com/ChristopherVR/pptx-viewer/commit/866c7ee9227ecbc58f0ab8b691513dc072824c1f))
30
+ - **shared:** Light, extrude and fade SmartArt 3D scenes as PowerPoint does (by @claude) ([b6864d8](https://github.com/ChristopherVR/pptx-viewer/commit/b6864d8d9ca181e953d6cdd389629052f6712d5b))
31
+ - **shared:** Draw a turned SmartArt diagram past its element box (by @claude) ([f46c9b7](https://github.com/ChristopherVR/pptx-viewer/commit/f46c9b7af800e213ee0d7f29cca61d9b2a29c0c4))
32
+ - **core:** Rasterise fallback-less svg pictures for .ppt export in node (by @ChristopherVR) ([b2f86e8](https://github.com/ChristopherVR/pptx-viewer/commit/b2f86e8a675c899778275c163d1fd974df31f3ea))
33
+
34
+ ### Bug Fixes
35
+
36
+ - **shared:** Hang CJK punctuation and drop kinsoku like PowerPoint (by @ChristopherVR) ([770b708](https://github.com/ChristopherVR/pptx-viewer/commit/770b7081432d08acfa00a17de9bc83da22efc18b))
37
+ - **shared:** Draw data-label callouts on line, area, pie, xy and radar (by @ChristopherVR) ([a60aa17](https://github.com/ChristopherVR/pptx-viewer/commit/a60aa17d713848297264ffdd27e89ba9192321ed))
38
+ - **core:** Author the strips exit at presetID 18 (by @ChristopherVR) ([eb1daca](https://github.com/ChristopherVR/pptx-viewer/commit/eb1daca918d26168e07e52e8eb6e421d1af58bfe))
39
+ - **shared:** Play strips as a diagonal corner-to-corner sweep (by @ChristopherVR) ([1e15f73](https://github.com/ChristopherVR/pptx-viewer/commit/1e15f73c5624b0578ea4f1125ea573dfbc1bab73))
40
+ - **shared:** Play wedge as two sweeping wedges and circle exit as an iris (by @ChristopherVR) ([c7fe573](https://github.com/ChristopherVR/pptx-viewer/commit/c7fe5738e03c7b02efaead29621c743e071ecb1e))
41
+ - **shared:** Play the slide filter through a window, cover/push as a cut (by @ChristopherVR) ([a252b87](https://github.com/ChristopherVR/pptx-viewer/commit/a252b8753c2743eb9f91ca1f5b2f4ace86b5cac3))
42
+ - **shared:** Restore arc-length glyph placement for wordart envelopes (by @ChristopherVR) ([4264ab0](https://github.com/ChristopherVR/pptx-viewer/commit/4264ab0917b91f7bd6a7cf278d334135bec27883))
43
+ - **core:** Embed every picture format in the .ppt export (by @ChristopherVR) ([956f1dc](https://github.com/ChristopherVR/pptx-viewer/commit/956f1dc065eabb6977ee6581261662bd38b88162))
44
+ - **core:** Write placeholder text and master text styles in .ppt export (by @ChristopherVR) ([81681c8](https://github.com/ChristopherVR/pptx-viewer/commit/81681c8e52fec68f2d039bd3473023eb76d4a5cd))
45
+ - **core:** Keep an authored pPr lvl="0" on a rewritten slide (by @ChristopherVR) ([97a8cff](https://github.com/ChristopherVR/pptx-viewer/commit/97a8cff45834f963644067aac5bd4a5d2ae0a440))
46
+ - **core:** Stop the first run's b and err leaking onto later runs (by @ChristopherVR) ([4738cd4](https://github.com/ChristopherVR/pptx-viewer/commit/4738cd43c77aadee833d7ab41e071ab7506c3157))
47
+ - **core:** Do not invent an outline width on a rewritten slide (by @ChristopherVR) ([089362a](https://github.com/ChristopherVR/pptx-viewer/commit/089362ac0746031ea28d0bd1ac92bcce093eb4bd))
48
+ - **core:** Refresh app.xml notes and untitled titles like PowerPoint (by @ChristopherVR) ([52a8a53](https://github.com/ChristopherVR/pptx-viewer/commit/52a8a5395de8497553f8aceb9aa980b0bf25d838))
49
+ - **core:** Write each ruby run property set back as authored (by @ChristopherVR) ([94e7b76](https://github.com/ChristopherVR/pptx-viewer/commit/94e7b7656c32642a47748f6ad95c00955cb3fddb))
50
+ - **shared:** Composite pptx-three-view frames as premultiplied alpha (by @claude) ([074fd9e](https://github.com/ChristopherVR/pptx-viewer/commit/074fd9edf2df8d32e9b54327e53fb27b489c4267))
51
+ - **shared:** Size the chart title band from the title font (by @claude) ([c5f0254](https://github.com/ChristopherVR/pptx-viewer/commit/c5f0254036f578f80ab25ed68e250f0d34984523))
52
+ - **shared:** One html2canvas clone pass that snapshots 3D views (by @claude) ([56a8a81](https://github.com/ChristopherVR/pptx-viewer/commit/56a8a81a53ffb2bd9cd8863d6c2cb8d703104804))
53
+ - **react,vue,angular,svelte,vanilla:** Use the shared html2canvas clone pass (by @claude) ([ca9f608](https://github.com/ChristopherVR/pptx-viewer/commit/ca9f6089ed304dcc71abe216b984c41237cefbfb))
54
+ - **shared:** Read SmartArt label contrast from a gradient fill (by @claude) ([d43c866](https://github.com/ChristopherVR/pptx-viewer/commit/d43c866ec2eeb655d02dc586c546c02c93877558))
55
+ - **shared:** Fit the perspective 3D chart box to PowerPoint's height and centring (by @claude) ([157008a](https://github.com/ChristopherVR/pptx-viewer/commit/157008a988c95edba606c6bab5c11308967d0785))
56
+ - **shared:** Size standard-grouping 3D columns as PowerPoint does (by @claude) ([907223f](https://github.com/ChristopherVR/pptx-viewer/commit/907223f735c83b65afd42d5147848f8a28839e1c))
57
+ - **shared:** Shade exploded 3D pie cut faces as PowerPoint does (by @claude) ([5ad3905](https://github.com/ChristopherVR/pptx-viewer/commit/5ad3905503872041e5afc7da528cad0cae354a96))
58
+ - **core:** Follow ecma-376 for the trapezoid preset inset (by @claude) ([eca6c9f](https://github.com/ChristopherVR/pptx-viewer/commit/eca6c9f739a9d6a46d410801ba9bcb0a685f58da))
59
+ - **core:** Keep smartart drawing fill alpha and preset adjustments (by @claude) ([d8d2f37](https://github.com/ChristopherVR/pptx-viewer/commit/d8d2f37b85937e125021afc17b9245148edf9186))
60
+ - **shared:** Paint smartart drawing fill alpha in 2d and 3d (by @claude) ([070cda5](https://github.com/ChristopherVR/pptx-viewer/commit/070cda5a4927c68ea9352c6e7d40e6526d5080fe))
61
+ - **vanilla:** Bind smartart drawing fill-opacity (by @claude) ([7e681a0](https://github.com/ChristopherVR/pptx-viewer/commit/7e681a0d09301102810366af80812fe950722e0a))
62
+ - **core:** Drop the old preset's guides when a shape's geometry changes (by @ChristopherVR) ([118d8a0](https://github.com/ChristopherVR/pptx-viewer/commit/118d8a0651c18b4e5585286628946818f9c241c5))
63
+ - **core:** Relabel entrance/exit presets from PowerPoint COM ids (by @ChristopherVR) ([ade27dc](https://github.com/ChristopherVR/pptx-viewer/commit/ade27dce6d771ea7dee6068ae7da0a7aa067b6cf))
64
+ - **core:** Write PowerPoint's captured behaviour tree for every preset (by @ChristopherVR) ([b9fa2d6](https://github.com/ChristopherVR/pptx-viewer/commit/b9fa2d68f90c646ccd9abdc1584a78b5e3c2c39b))
65
+ - **shared:** Play steps without accel/decel linearly like PowerPoint (by @ChristopherVR) ([5c1158b](https://github.com/ChristopherVR/pptx-viewer/commit/5c1158b2240c96a234a312ea56aa07404b330fcc))
66
+ - **animation:** Ripple letters inside a by-paragraph text build (by @ChristopherVR) ([1676539](https://github.com/ChristopherVR/pptx-viewer/commit/16765398bd7e0d6966ee59c9cb97d0936bafcc80))
67
+ - **core:** Open PowerPoint's own password-protected .ppt files (by @ChristopherVR) ([ca38faa](https://github.com/ChristopherVR/pptx-viewer/commit/ca38faae35c761b0a3ae98ca79084251641026dc))
68
+ - **core:** Keep the node canvas import opaque to browser bundlers (by @ChristopherVR) ([22f61ea](https://github.com/ChristopherVR/pptx-viewer/commit/22f61ea3f6811d3c82530593eccad0afd957c0f1))
69
+
70
+ ### Documentation
71
+
72
+ - **core:** Record the eleventh smartart engine wave's measured numbers (by @ChristopherVR) ([8395cb8](https://github.com/ChristopherVR/pptx-viewer/commit/8395cb847ff5984c47908b270193622373e30fe0))
73
+
74
+ ### Testing
75
+
76
+ - **core:** Declare the new callout, CJK and org-chart assistant fixtures (by @ChristopherVR) ([1ff7f05](https://github.com/ChristopherVR/pptx-viewer/commit/1ff7f05d254f151a42005a0e4591897e7c508889))
77
+ - **core:** Lock the ECMA-376 trapezoid inset against the short side (by @claude) ([26462a0](https://github.com/ChristopherVR/pptx-viewer/commit/26462a034bb4752497244ff42e787af60f24406d))
78
+ - **core:** Declare the by-paragraph letter ripple fixture (by @ChristopherVR) ([532a448](https://github.com/ChristopherVR/pptx-viewer/commit/532a448c1b952051c5926e0ad25ef2d534a45818))
79
+ - **core:** Pin the browser canvas ahead of the node svg rasteriser (by @ChristopherVR) ([8ae3fed](https://github.com/ChristopherVR/pptx-viewer/commit/8ae3fedd58b236b77dc56533010683b9cd91a7a2))
80
+
81
+ ### Build & CI
82
+
83
+ - **react,vanilla:** Keep the optional node canvas peer external (by @ChristopherVR) ([6b0ae09](https://github.com/ChristopherVR/pptx-viewer/commit/6b0ae09448bab9ece71448ca50dfc969a7c72a02))
84
+
85
+ ## [3.7.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.7.0) - 2026-09-25
86
+
87
+ ### Features
88
+
89
+ - **shared:** Edit points model, sessions and freeform tools (by @ChristopherVR) ([481dd57](https://github.com/ChristopherVR/pptx-viewer/commit/481dd5758c023d726255cfaab6473e075453ba8a))
90
+ - **locales:** Translate edit points and freeform tool strings (by @ChristopherVR) ([eef2d4a](https://github.com/ChristopherVR/pptx-viewer/commit/eef2d4ab7a099697b9711748d30315e7d0ffd6ac))
91
+ - **shared:** Keep preset text box and place edit points menu in slide space (by @ChristopherVR) ([a4699df](https://github.com/ChristopherVR/pptx-viewer/commit/a4699dfc4ad3ea442ee2d43116b0f620882bb7bc))
92
+ - **vanilla:** Edit points and freeform shape / curve tools (by @ChristopherVR) ([715dc69](https://github.com/ChristopherVR/pptx-viewer/commit/715dc698c5a70ecac92b86a56a9f26556a377c41))
93
+ - **shared:** Merge shapes engine and on-canvas picture crop geometry (by @ChristopherVR) ([0e13020](https://github.com/ChristopherVR/pptx-viewer/commit/0e130203710ff109629330e6cf6efe097e962875))
94
+ - **locales:** Translate merge shapes and picture crop strings (by @ChristopherVR) ([2388efb](https://github.com/ChristopherVR/pptx-viewer/commit/2388efb4d4ed17c3ec212d5f64e9dba3cd18f268))
95
+ - **vanilla:** Merge shapes and on-canvas picture crop (by @ChristopherVR) ([14ab278](https://github.com/ChristopherVR/pptx-viewer/commit/14ab27843aaa73cea8b00d03e6328a8dc37b7624))
96
+ - **core:** Expose the zoom transition's in/out direction (by @ChristopherVR) ([e9d9da5](https://github.com/ChristopherVR/pptx-viewer/commit/e9d9da5a017f42b2318b6a93394dd8c3f6c34051))
97
+ - **core:** Read and write media-bookmark triggers the way PowerPoint does (by @ChristopherVR) ([cbe17f9](https://github.com/ChristopherVR/pptx-viewer/commit/cbe17f9a00c639fb3a5666b41222cc5de21d302e))
98
+ - **shared:** Add the "On bookmark" trigger and its bookmark picker model (by @ChristopherVR) ([95f07a7](https://github.com/ChristopherVR/pptx-viewer/commit/95f07a77ff3d0750acbf7495dc77fe84072817d3))
99
+ - **locales:** Translate the On bookmark trigger picker (by @ChristopherVR) ([e06e9dc](https://github.com/ChristopherVR/pptx-viewer/commit/e06e9dc000158534405c9b372d52a9827447465c))
100
+ - **vanilla:** Pick the media bookmark for an On bookmark trigger (by @ChristopherVR) ([2fcee92](https://github.com/ChristopherVR/pptx-viewer/commit/2fcee92be7e9422cf4140d0c909b97d24420553c))
101
+ - **core:** Break smartart engine-vs-legacy geometry ties on fonts (by @ChristopherVR) ([9b23ac0](https://github.com/ChristopherVR/pptx-viewer/commit/9b23ac04ad4366da7b67c80d1e5222675c564698))
102
+ - **core:** Lay smartart hierarchies out as packed outlines, then scale (by @ChristopherVR) ([74b7bce](https://github.com/ChristopherVR/pptx-viewer/commit/74b7bcea5fe2b985efdf93c0bfd3cfd6b05e04cc))
103
+ - **core:** Lay smartart snake grids out from their cells' own sizes (by @ChristopherVR) ([e9526ff](https://github.com/ChristopherVR/pptx-viewer/commit/e9526ffc30b0829eb2231c693da69c562a0ed454))
104
+ - **core:** Parse chart-area, plot-area and series gradient fills (by @ChristopherVR) ([4db5abc](https://github.com/ChristopherVR/pptx-viewer/commit/4db5abc3c3c57428b231a6cb4aed041b0e4b2d8b))
105
+ - **shared:** Paint chart gradient fills in all five bindings (by @ChristopherVR) ([7f22964](https://github.com/ChristopherVR/pptx-viewer/commit/7f229642cda0b1388df4c6be560478192152f051))
106
+ - **core:** Parse data-label boxes, callout shapes and c15 leader lines (by @ChristopherVR) ([763cadd](https://github.com/ChristopherVR/pptx-viewer/commit/763cadd268d5f57b91129c1597bef610cb7b3bf4))
107
+
108
+ ### Bug Fixes
109
+
110
+ - **shared:** Restore absent crop insets as undefined on cancel (by @ChristopherVR) ([33b5094](https://github.com/ChristopherVR/pptx-viewer/commit/33b509485634bfee452e5ce8a9f4fb7acc9bdc6e))
111
+ - **vanilla:** Accept the shared crop cancel update type (by @ChristopherVR) ([5a117a4](https://github.com/ChristopherVR/pptx-viewer/commit/5a117a45c79e09d0c7554f3de2627d3b5d2eaf3b))
112
+ - **core:** Keep runs apart that differ only by an authored baseline="0" (by @ChristopherVR) ([aea3c57](https://github.com/ChristopherVR/pptx-viewer/commit/aea3c57542823e311332a15ac85ff045cfbb3331))
113
+ - **shared:** Play the zoom transition as PowerPoint's box reveal (by @ChristopherVR) ([6194b84](https://github.com/ChristopherVR/pptx-viewer/commit/6194b846fcc7284efe9780d97037bf1e2706136e))
114
+ - **shared:** Fit the Bounce End settle curve to PowerPoint's own frames (by @ChristopherVR) ([5268384](https://github.com/ChristopherVR/pptx-viewer/commit/5268384724177b188da4a47fdf9678f2ba16acdb))
115
+ - **core:** Keep authored buClr on a rewritten paragraph (by @ChristopherVR) ([77f1f86](https://github.com/ChristopherVR/pptx-viewer/commit/77f1f86d946c8f058183f787696198d4035b7a81))
116
+ - **core:** Keep an authored tab-stop algn="l" on rewrite (by @ChristopherVR) ([e6050da](https://github.com/ChristopherVR/pptx-viewer/commit/e6050dae8683be269b1c9675bb195369d5dfda7a))
117
+ - **core:** Stop unedited animation metadata growing on save (by @ChristopherVR) ([d0fce7c](https://github.com/ChristopherVR/pptx-viewer/commit/d0fce7c59c599588dba6e950b66629276d4df481))
118
+ - **core:** Keep a source commentAuthors part nothing removed (by @ChristopherVR) ([03f6967](https://github.com/ChristopherVR/pptx-viewer/commit/03f6967ed3cdd57de1896e03e631c2999716149c))
119
+ - **core:** Read media bookmarks where PowerPoint nests them (by @ChristopherVR) ([7ec0f27](https://github.com/ChristopherVR/pptx-viewer/commit/7ec0f27c35c12458db1d8a480014049c8e81cfcf))
120
+ - **core:** Size smartart engine text from primFontSz rules and groups (by @ChristopherVR) ([e957395](https://github.com/ChristopherVR/pptx-viewer/commit/e957395722c0d80f878f81f282e2e271461d945f))
121
+ - **core:** Measure smartart text with kerned boundwidth aptos metrics (by @ChristopherVR) ([9603333](https://github.com/ChristopherVR/pptx-viewer/commit/960333342c7676a35b9c9e845017615fdd8a0b2a))
122
+ - **core:** Lay smartart engine text out by tx paragraph levels (by @ChristopherVR) ([ff90fd8](https://github.com/ChristopherVR/pptx-viewer/commit/ff90fd8e6277dbc5a396c887ac87f77c2e7d7a65))
123
+ - **core:** Draw smartart engine boxes that present text after a blank (by @ChristopherVR) ([e049efb](https://github.com/ChristopherVR/pptx-viewer/commit/e049efba80b8f79f544cf8223fa33379d11e2e59))
124
+ - **core:** Match PowerPoint's auto-number schemes past the basics (by @ChristopherVR) ([aa10890](https://github.com/ChristopherVR/pptx-viewer/commit/aa10890d99ea75f712170403ab0b1f6a9217d5cd))
125
+ - **core:** Render picture-filled text runs instead of solid black (by @ChristopherVR) ([e1021f9](https://github.com/ChristopherVR/pptx-viewer/commit/e1021f9f4fb8efe07bb0dbb70c63e342ec764d49))
126
+ - **shared:** Draw a dashed text outline for a:ln/a:prstDash (by @ChristopherVR) ([af7eb60](https://github.com/ChristopherVR/pptx-viewer/commit/af7eb60fb210a418ac3fb032039e1ca3b5d4c674))
127
+ - **shared:** Match PowerPoint's underline variants (by @ChristopherVR) ([46ad363](https://github.com/ChristopherVR/pptx-viewer/commit/46ad3637a88ed2d9b18c3fdee0aa98ba57207b3f))
128
+ - **core:** Let a paragraph's own rtl beat the level default on its runs (by @ChristopherVR) ([4ae3d68](https://github.com/ChristopherVR/pptx-viewer/commit/4ae3d68362a956680cfe12bf1022f13c9e877510))
129
+ - **shared:** Align decimal and right-to-left tab stops like PowerPoint (by @ChristopherVR) ([1575f61](https://github.com/ChristopherVR/pptx-viewer/commit/1575f61f3cefa9f703e21d2f914ec567e541f81a))
130
+ - **shared:** Ignore a paragraph's trailing spaces when aligning it (by @ChristopherVR) ([3973465](https://github.com/ChristopherVR/pptx-viewer/commit/39734651a091b43ecc9c41689ce5ce899e91b5ac))
131
+ - **shared:** Clip an overflowing text body at a whole line (by @ChristopherVR) ([7f77dcd](https://github.com/ChristopherVR/pptx-viewer/commit/7f77dcda9d17c9b569c5d2a7fddf2144ef196b6a))
132
+ - **shared:** Colour and label waterfall bars like PowerPoint (by @ChristopherVR) ([44a4fec](https://github.com/ChristopherVR/pptx-viewer/commit/44a4fec1284837b3249202e2a40053ef934ba85f))
133
+ - **shared:** Draw PowerPoint's automatic chart titles (by @ChristopherVR) ([8f435a4](https://github.com/ChristopherVR/pptx-viewer/commit/8f435a4d199250421ab947a12a360bd881273995))
134
+ - **shared:** Lay out pie-of-pie and bar-of-pie like PowerPoint (by @ChristopherVR) ([578d524](https://github.com/ChristopherVR/pptx-viewer/commit/578d524dd7fefcb09a583f0abafb787db866938d))
135
+ - **shared:** Format and place display-unit axis labels like PowerPoint (by @ChristopherVR) ([73acba4](https://github.com/ChristopherVR/pptx-viewer/commit/73acba45b8940cf44fe16164c564ca18661dba36))
136
+ - **shared:** Lay out chart data tables like PowerPoint (by @ChristopherVR) ([0220fd6](https://github.com/ChristopherVR/pptx-viewer/commit/0220fd62c63e1de4febeaeef963ff258b91cbcd4))
137
+ - **shared:** Draw data-label callouts and leader lines on bar charts (by @ChristopherVR) ([68296ef](https://github.com/ChristopherVR/pptx-viewer/commit/68296ef4e729ece9c0a51eff3b9e03b011b986e4))
138
+ - **core:** Parse series gradients through a pure helper (by @ChristopherVR) ([1f83eaf](https://github.com/ChristopherVR/pptx-viewer/commit/1f83eaf9f5c461430e7d54c1e212ee43b7519819))
139
+
140
+ ### Documentation
141
+
142
+ - **core:** Describe p14:bounceEnd as the bouncing share of the duration (by @ChristopherVR) ([80caab6](https://github.com/ChristopherVR/pptx-viewer/commit/80caab642e04a548a912fdbe8d937732096792f9))
143
+ - **core:** Record the smartart font, hierarchy and snake measurements (by @ChristopherVR) ([2187e69](https://github.com/ChristopherVR/pptx-viewer/commit/2187e692746fbde2e9f3c6399c1fde6a83ca57cb))
144
+
145
+ ### Testing
146
+
147
+ - **e2e:** Cover merge shapes and picture crop in every demo (by @ChristopherVR) ([a7e7bed](https://github.com/ChristopherVR/pptx-viewer/commit/a7e7bed63129981afba50ef12ae2cdd4ee854d3f))
148
+ - **e2e:** Author an On bookmark trigger in every demo and check the save (by @ChristopherVR) ([aa3ff3c](https://github.com/ChristopherVR/pptx-viewer/commit/aa3ff3c9764192dd81b65874668cdb09da0e81ce))
149
+ - **core,vanilla:** Register the edit-points fixture and type the bookmark test store (by @ChristopherVR) ([9114d7c](https://github.com/ChristopherVR/pptx-viewer/commit/9114d7cec7a1f60b44bab5ef21d1cf9bcbccb054))
150
+
10
151
  ## [3.6.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.6.0) - 2026-09-25
11
152
 
12
153
  ### Features
@@ -1 +1 @@
1
- 'use strict';var chunkGX4G423W_cjs=require('./chunk-GX4G423W.cjs');require('./chunk-TZD4KXQM.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkGX4G423W_cjs.K(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l=i.isPinned(),s=i.isPicking(),g=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkGX4G423W_cjs.j(p,o.getSlides())){let b=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-focus-chip");(m||l)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l){let r=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkGX4G423W_cjs.k(p,o.getSlides());if(d){let r=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkGX4G423W_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkGX4G423W_cjs.l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkGX4G423W_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n}=o,i=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkGX4G423W_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkGX4G423W_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkGX4G423W_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkGX4G423W_cjs.n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=chunkGX4G423W_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkGX4G423W_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkGX4G423W_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkGX4G423W_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n("pptx.ai.deleteChat"),P.setAttribute("aria-label",n("pptx.ai.deleteChat")),P.appendChild(chunkGX4G423W_cjs.K(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=chunkGX4G423W_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-tool"),p=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkGX4G423W_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkGX4G423W_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkGX4G423W_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkGX4G423W_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkGX4G423W_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s.classList.add("is-running"),s.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s),c.appendChild(p),i&&t.errorText){let f=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkGX4G423W_cjs.r(t.input);if(g){let f=chunkGX4G423W_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkGX4G423W_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkGX4G423W_cjs.q(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=chunkGX4G423W_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkGX4G423W_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkGX4G423W_cjs.K(o,h?"comment":"sparkles"));let m=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkGX4G423W_cjs.w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=chunkGX4G423W_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkGX4G423W_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkGX4G423W_cjs.w(o,"li");g.textContent=chunkGX4G423W_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkGX4G423W_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkGX4G423W_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkGX4G423W_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkGX4G423W_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkGX4G423W_cjs.K(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c.append(p,m),a.appendChild(c),a}async function wt(o){let{doc:t,host:n,t:i}=o;n.replaceChildren();let a=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-header"),h=chunkGX4G423W_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(chunkGX4G423W_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkGX4G423W_cjs.K(t,"sparkles"),h,x);let c,p=o.controller,m=p?K({doc:t,t:i,controller:p,getSlides:()=>o.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkGX4G423W_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkGX4G423W_cjs.w(t,"form","pptxv-ai-composer"),d=chunkGX4G423W_cjs.w(t,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=chunkGX4G423W_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkGX4G423W_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkGX4G423W_cjs.o)({bridge:o.bridge,config:o.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t,t:i,deckId:chunkGX4G423W_cjs.m(o.bridge),store:o.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>chunkGX4G423W_cjs.f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=chunkGX4G423W_cjs.t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f.hidden=!u.error,f.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m?.destroy(),n.replaceChildren();}}}exports.createAiPanel=wt;
1
+ 'use strict';var chunkIQ7MDPEN_cjs=require('./chunk-IQ7MDPEN.cjs');require('./chunk-5YHVN3PP.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkIQ7MDPEN_cjs.K(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l=i.isPinned(),s=i.isPicking(),g=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkIQ7MDPEN_cjs.j(p,o.getSlides())){let b=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-focus-chip");(m||l)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l){let r=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkIQ7MDPEN_cjs.k(p,o.getSlides());if(d){let r=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkIQ7MDPEN_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkIQ7MDPEN_cjs.l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkIQ7MDPEN_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n}=o,i=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkIQ7MDPEN_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkIQ7MDPEN_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkIQ7MDPEN_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkIQ7MDPEN_cjs.n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=chunkIQ7MDPEN_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkIQ7MDPEN_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkIQ7MDPEN_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkIQ7MDPEN_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n("pptx.ai.deleteChat"),P.setAttribute("aria-label",n("pptx.ai.deleteChat")),P.appendChild(chunkIQ7MDPEN_cjs.K(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=chunkIQ7MDPEN_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-tool"),p=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkIQ7MDPEN_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkIQ7MDPEN_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkIQ7MDPEN_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkIQ7MDPEN_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkIQ7MDPEN_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s.classList.add("is-running"),s.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s),c.appendChild(p),i&&t.errorText){let f=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkIQ7MDPEN_cjs.r(t.input);if(g){let f=chunkIQ7MDPEN_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkIQ7MDPEN_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkIQ7MDPEN_cjs.q(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=chunkIQ7MDPEN_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkIQ7MDPEN_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkIQ7MDPEN_cjs.K(o,h?"comment":"sparkles"));let m=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkIQ7MDPEN_cjs.w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=chunkIQ7MDPEN_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkIQ7MDPEN_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkIQ7MDPEN_cjs.w(o,"li");g.textContent=chunkIQ7MDPEN_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkIQ7MDPEN_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkIQ7MDPEN_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkIQ7MDPEN_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkIQ7MDPEN_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkIQ7MDPEN_cjs.K(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c.append(p,m),a.appendChild(c),a}async function wt(o){let{doc:t,host:n,t:i}=o;n.replaceChildren();let a=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-header"),h=chunkIQ7MDPEN_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(chunkIQ7MDPEN_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkIQ7MDPEN_cjs.K(t,"sparkles"),h,x);let c,p=o.controller,m=p?K({doc:t,t:i,controller:p,getSlides:()=>o.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkIQ7MDPEN_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkIQ7MDPEN_cjs.w(t,"form","pptxv-ai-composer"),d=chunkIQ7MDPEN_cjs.w(t,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=chunkIQ7MDPEN_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkIQ7MDPEN_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkIQ7MDPEN_cjs.o)({bridge:o.bridge,config:o.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t,t:i,deckId:chunkIQ7MDPEN_cjs.m(o.bridge),store:o.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>chunkIQ7MDPEN_cjs.f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=chunkIQ7MDPEN_cjs.t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f.hidden=!u.error,f.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m?.destroy(),n.replaceChildren();}}}exports.createAiPanel=wt;
@@ -1 +1 @@
1
- import {w,K as K$1,o,m,n,f,t,j,k,l,s,r,q as q$1,c}from'./chunk-LZWQ7EY2.js';import'./chunk-K7SLACZS.js';import'./chunk-62D2TNHX.js';function K(o){let{doc:t,t:n,controller:i}=o,a=w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(K$1(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l$1=i.isPinned(),s=i.isPicking(),g=w(t,"div","pptxv-ai-focus-row"),f=w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of j(p,o.getSlides())){let b=w(t,"span","pptxv-ai-focus-chip");(m||l$1)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l$1){let r=w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=w(t,"div","pptxv-ai-focus-actions"),d=k(p,o.getSlides());if(d){let r=w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(K$1(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l$1?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=w(t,"div","pptxv-ai-focus-pick"),b=K$1(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n$1}=o,i=w(t,"button","pptxv-ai-chats");i.type="button",i.append(K$1(t,"history"),t.createTextNode(n$1("pptx.ai.chats")));let a=w(t,"div","pptxv-ai-history");a.hidden=true;let h=w(t,"div","pptxv-ai-history-head"),x=w(t,"span","pptxv-ai-history-title");x.textContent=n$1("pptx.ai.historyTitle");let c=w(t,"button","pptxv-ai-history-new");c.type="button",c.append(K$1(t,"plus"),t.createTextNode(n$1("pptx.ai.newChat"))),h.append(x,c);let p=w(t,"div","pptxv-ai-history-body"),m=w(t,"p","pptxv-ai-history-hint");m.textContent=n$1("pptx.ai.historyHint"),a.append(h,p,m);let l=n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n$1("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=w(t,"p","pptxv-ai-history-empty");d.textContent=n$1("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=w(t,"li","pptxv-ai-history-row"),r=w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=w(t,"span","pptxv-ai-history-text"),k=w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n$1("pptx.ai.untitledChat");let T=w(t,"span","pptxv-ai-history-meta");T.textContent=n$1("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(K$1(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n$1("pptx.ai.deleteChat"),P.setAttribute("aria-label",n$1("pptx.ai.deleteChat")),P.appendChild(K$1(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=s(t.toolName,t.input,h?"present":"past"),c=w(o,"div","pptxv-ai-tool"),p=w(o,"div","pptxv-ai-tool-head"),m=K$1(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s$1=w(o,"span","pptxv-ai-tool-state");if(i?(s$1.classList.add("is-error"),s$1.append(K$1(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s$1.classList.add("is-done"),s$1.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s$1.classList.add("is-running"),s$1.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s$1),c.appendChild(p),i&&t.errorText){let f=w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=r(t.input);if(g){let f=w(o,"details","pptxv-ai-tool-details"),C=w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=w(o,"div","pptxv-ai-tool-raw");d.textContent=`${q$1(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=f(a);if(x.length===0&&!h)continue;let c=w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(K$1(o,h?"comment":"sparkles"));let m=w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=w(o,"div","pptxv-ai-proposals-header"),x=w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=w(o,"li");g.textContent=c(s),l.appendChild(g);}a.appendChild(l);}let c$1=w(o,"div","pptxv-ai-proposal-actions"),p=w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(K$1(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c$1.append(p,m),a.appendChild(c$1),a}async function wt(o$1){let{doc:t$1,host:n,t:i}=o$1;n.replaceChildren();let a=w(t$1,"div","pptxv-ai-header"),h=w(t$1,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=w(t$1,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(K$1(t$1,"close")),x.addEventListener("click",()=>o$1.onClose?.()),a.append(K$1(t$1,"sparkles"),h,x);let c,p=o$1.controller,m$1=p?K({doc:t$1,t:i,controller:p,getSlides:()=>o$1.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=w(t$1,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=w(t$1,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=w(t$1,"div","pptxv-ai-proposals");g.hidden=true;let f$1=w(t$1,"div","pptxv-ai-error");f$1.setAttribute("role","alert"),f$1.hidden=true;let C=w(t$1,"form","pptxv-ai-composer"),d=w(t$1,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=w(t$1,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(K$1(t$1,"send")),C.append(d,y),n.append(a,...m$1?[m$1.el]:[],l,g,f$1,C);try{c=await(o$1.createChat??o)({bridge:o$1.bridge,config:o$1.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m$1?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t$1,t:i,deckId:m(o$1.bridge),store:o$1.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o$1.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t$1,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t$1,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f$1.hidden=!u.error,f$1.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m$1?.destroy(),n.replaceChildren();}}}export{wt as createAiPanel};
1
+ import {w,K as K$1,o,m,n,f,t,j,k,l,s,r,q as q$1,c}from'./chunk-JCYH4YT3.js';import'./chunk-6U56MSXT.js';import'./chunk-62D2TNHX.js';function K(o){let{doc:t,t:n,controller:i}=o,a=w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(K$1(t,p)),s.addEventListener("click",l),s},x=()=>{a.replaceChildren();let p=i.getEffectiveTargets(),m=i.hasPicks(),l$1=i.isPinned(),s=i.isPicking(),g=w(t,"div","pptxv-ai-focus-row"),f=w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of j(p,o.getSlides())){let b=w(t,"span","pptxv-ai-focus-chip");(m||l$1)&&b.classList.add("is-strong"),b.title=r.title,b.textContent=r.label,g.appendChild(b);}if(l$1){let r=w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=w(t,"div","pptxv-ai-focus-actions"),d=k(p,o.getSlides());if(d){let r=w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(K$1(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(l(d.slideIndex,d.elementIdA,d.elementIdB))),C.appendChild(r);}let y=h("crosshair",n("pptx.ai.pickElement"),()=>s?i.stopPicking():i.startPicking());if(y.setAttribute("aria-pressed",String(s)),y.classList.toggle("is-active",s),C.appendChild(y),m?C.appendChild(h("close",n("pptx.ai.pickClear"),()=>i.clearPicks())):l$1?C.appendChild(h("pin-off",n("pptx.ai.clearFocus"),()=>i.clearPinnedFocus())):C.appendChild(h("pin",n("pptx.ai.pinFocus"),()=>i.pinFocus())),g.appendChild(C),a.appendChild(g),s){let r=w(t,"div","pptxv-ai-focus-pick"),b=K$1(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=w(t,"button","pptxv-ai-focus-pick-done");T.type="button",T.textContent=n("pptx.ai.pickDone"),T.addEventListener("click",()=>i.stopPicking()),r.append(b,k,T),a.appendChild(r);}},c=i.subscribe(x);return x(),{el:a,destroy(){c(),a.remove();}}}function O(o){let{doc:t,t:n$1}=o,i=w(t,"button","pptxv-ai-chats");i.type="button",i.append(K$1(t,"history"),t.createTextNode(n$1("pptx.ai.chats")));let a=w(t,"div","pptxv-ai-history");a.hidden=true;let h=w(t,"div","pptxv-ai-history-head"),x=w(t,"span","pptxv-ai-history-title");x.textContent=n$1("pptx.ai.historyTitle");let c=w(t,"button","pptxv-ai-history-new");c.type="button",c.append(K$1(t,"plus"),t.createTextNode(n$1("pptx.ai.newChat"))),h.append(x,c);let p=w(t,"div","pptxv-ai-history-body"),m=w(t,"p","pptxv-ai-history-hint");m.textContent=n$1("pptx.ai.historyHint"),a.append(h,p,m);let l=n({deckId:o.deckId,store:o.store,getMessages:o.getMessages,setMessages:o.setMessages,untitledLabel:n$1("pptx.ai.untitledChat"),onChatsChanged:()=>s()});function s(){p.replaceChildren();let f=l.chats();if(f.length===0){let d=w(t,"p","pptxv-ai-history-empty");d.textContent=n$1("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=w(t,"li","pptxv-ai-history-row"),r=w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=w(t,"span","pptxv-ai-history-text"),k=w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n$1("pptx.ai.untitledChat");let T=w(t,"span","pptxv-ai-history-meta");T.textContent=n$1("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(K$1(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=w(t,"button","pptxv-ai-history-delete");P.type="button",P.title=n$1("pptx.ai.deleteChat"),P.setAttribute("aria-label",n$1("pptx.ai.deleteChat")),P.appendChild(K$1(t,"trash")),P.addEventListener("click",()=>{l.deleteChat(d.id);}),y.append(r,P),C.appendChild(y);}p.appendChild(C);}s(),i.addEventListener("click",()=>{a.hidden=!a.hidden;}),c.addEventListener("click",()=>{l.newChat(),a.hidden=true;});let g=f=>{a.hidden||!(f.target instanceof Node)||!a.contains(f.target)&&!i.contains(f.target)&&(a.hidden=true);};return t.addEventListener("mousedown",g),{button:i,el:a,notifyMessagesChanged:()=>l.notifyMessagesChanged(),destroy(){t.removeEventListener("mousedown",g),l.dispose(),i.remove(),a.remove();}}}var _={view:"eye",text:"text-box",shape:"shapes",theme:"font-color",table:"table",slide:"layout",chart:"chart",move:"move-right",delete:"trash",search:"search",nav:"move-right",animation:"play",notes:"sticky-note",tool:"wrench"};function W(o,t,n){let i=t.state==="output-error",a=t.state==="output-available",h=!i&&!a,x=s(t.toolName,t.input,h?"present":"past"),c=w(o,"div","pptxv-ai-tool"),p=w(o,"div","pptxv-ai-tool-head"),m=K$1(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s$1=w(o,"span","pptxv-ai-tool-state");if(i?(s$1.classList.add("is-error"),s$1.append(K$1(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s$1.classList.add("is-done"),s$1.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.toolDone")))):(s$1.classList.add("is-running"),s$1.textContent=n("pptx.ai.toolRunning")),p.append(m,l,s$1),c.appendChild(p),i&&t.errorText){let f=w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=r(t.input);if(g){let f=w(o,"details","pptxv-ai-tool-details"),C=w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=w(o,"div","pptxv-ai-tool-raw");d.textContent=`${q$1(t.toolName)}: ${g}`,f.append(C,d),c.appendChild(f);}return c}function q(o,t,n,i){t.replaceChildren();for(let a of n){if(a.role==="system")continue;let h=a.role==="user",x=f(a);if(x.length===0&&!h)continue;let c=w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(K$1(o,h?"comment":"sparkles"));let m=w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=w(o,"div","pptxv-ai-msg-text");s.textContent=l.text,m.appendChild(s);}else m.appendChild(W(o,l,i));c.append(p,m),t.appendChild(c);}}function G(o,t,n,i,a){if(t.replaceChildren(),t.hidden=n.length===0,n.length===0)return;let h=w(o,"div","pptxv-ai-proposals-header"),x=w(o,"span","pptxv-ai-proposals-title");if(x.textContent=i("pptx.ai.pendingChanges",{count:n.length}),h.appendChild(x),n.length>1){let c=w(o,"button","pptxv-ai-proposal-btn is-accept-all");c.type="button",c.textContent=i("pptx.ai.acceptAll"),c.addEventListener("click",()=>a.acceptAll()),h.appendChild(c);}t.appendChild(h);for(let c of n)t.appendChild(tt(o,c,i,a));}function tt(o,t,n,i){let a=w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=w(o,"li");g.textContent=c(s),l.appendChild(g);}a.appendChild(l);}let c$1=w(o,"div","pptxv-ai-proposal-actions"),p=w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(K$1(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(K$1(o,"close"),o.createTextNode(n("pptx.ai.reject"))),m.addEventListener("click",()=>i.reject(t.id)),c$1.append(p,m),a.appendChild(c$1),a}async function wt(o$1){let{doc:t$1,host:n,t:i}=o$1;n.replaceChildren();let a=w(t$1,"div","pptxv-ai-header"),h=w(t$1,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=w(t$1,"button","pptxv-ai-close");x.type="button",x.title=i("pptx.ai.close"),x.setAttribute("aria-label",i("pptx.ai.close")),x.appendChild(K$1(t$1,"close")),x.addEventListener("click",()=>o$1.onClose?.()),a.append(K$1(t$1,"sparkles"),h,x);let c,p=o$1.controller,m$1=p?K({doc:t$1,t:i,controller:p,getSlides:()=>o$1.bridge.getSlides(),onSendDirective:u=>{c?.sendMessage(u);}}):null,l=w(t$1,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=w(t$1,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=w(t$1,"div","pptxv-ai-proposals");g.hidden=true;let f$1=w(t$1,"div","pptxv-ai-error");f$1.setAttribute("role","alert"),f$1.hidden=true;let C=w(t$1,"form","pptxv-ai-composer"),d=w(t$1,"textarea","pptxv-ai-input");d.rows=2,d.placeholder=i("pptx.ai.placeholder"),d.setAttribute("aria-label",i("pptx.ai.placeholder"));let y=w(t$1,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(K$1(t$1,"send")),C.append(d,y),n.append(a,...m$1?[m$1.el]:[],l,g,f$1,C);try{c=await(o$1.createChat??o)({bridge:o$1.bridge,config:o$1.config});}catch{return s.textContent=i("pptx.ai.unavailableTitle"),d.disabled=true,y.disabled=true,m$1?.destroy(),{destroy:()=>n.replaceChildren()}}let r=c,b=O({doc:t$1,t:i,deckId:m(o$1.bridge),store:o$1.historyStore,getMessages:()=>r.getSnapshot().messages,setMessages:u=>r.setMessages(u)});a.insertBefore(b.button,x),n.appendChild(b.el);let k=r.subscribe(()=>b.notifyMessagesChanged()),T=new Set,P=u=>{if(!p)return;let A=u.messages.flatMap(Y=>f(Y).filter(Z=>Z.kind==="tool")).at(-1);if(!A||A.kind!=="tool"||A.state==="input-streaming"||T.has(A.toolCallId))return;T.add(A.toolCallId);let L=t(A.toolName,A.input);L&&L.slideIndex!==void 0&&o$1.goToSlide?.(L.slideIndex),p.flashToolTarget(L);},M=u=>{q(t$1,l,u.messages,i),s.hidden=u.messages.length>0,u.messages.length===0&&l.appendChild(s),G(t$1,g,r.proposals.list(),i,{accept:A=>{p?.flashToolTarget(null),r.proposals.apply(A),M(r.getSnapshot());},reject:A=>{r.proposals.revert(A),M(r.getSnapshot());},acceptAll:()=>{p?.flashToolTarget(null),r.proposals.acceptAll(),M(r.getSnapshot());}});let w=u.status==="submitted"||u.status==="streaming";n.classList.toggle("is-busy",w),y.setAttribute("aria-label",i(w?"pptx.ai.stop":"pptx.ai.send")),f$1.hidden=!u.error,f$1.textContent=u.error?i("pptx.ai.errorPrefix"):"",l.scrollTop=l.scrollHeight,P(u);},S=()=>{if(n.classList.contains("is-busy")){r.stop();return}let u=d.value.trim();u&&(d.value="",r.sendMessage(u));};C.addEventListener("submit",u=>{u.preventDefault(),S();}),d.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),S());});let I=p?.getPrefill().nonce??0,J=()=>{if(!p)return;let u=p.getPrefill();u.nonce!==I&&(I=u.nonce,d.value=u.text,d.focus());},Q=p?.subscribe(J),X=r.subscribe(M);return M(r.getSnapshot()),{changeAnimator:r.changeAnimator,destroy(){X(),k(),b.destroy(),Q?.(),m$1?.destroy(),n.replaceChildren();}}}export{wt as createAiPanel};
@@ -1,4 +1,4 @@
1
- import {Dc,ai,ym,di,ei,_h,Gg,Fg,Hg,Et,Dd,Dg,Eg}from'./chunk-K7SLACZS.js';var R="data-pptx-text-style-override";function z(n,i,r){Et(n,r?.textStyle);let a=Dd(i,r?.textStyle),e=n.querySelector(`:scope > style[${R}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(R,""),n.prepend(e)),e.textContent=a;}var w="pptx-vanilla-presentation-keyframes",k="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(w))return;let i=n.createElement("style");i.id=w,i.textContent=`${Dc}
2
- ${ai}
3
- ${ym}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(k);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=k,(n.head??n.documentElement).appendChild(r)),r.textContent=i;}function X(n,i,r,a){n.querySelectorAll("[data-element-id]").forEach(e=>{let t=e.dataset.elementId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"",e.style.cursor=r.has(t)||a.has(t)?"pointer":"",z(e,t,o);}),n.querySelectorAll("[data-anim-id]").forEach(e=>{let t=e.dataset.animId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"";});}function M(n,i,r,a,e){let t=n.createElement("div");t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.dataset.pptxTransitionFragments=r.keyframesName,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex=String(a);for(let o of r.fragments)t.appendChild(B(n,i,r,o));return t}function B(n,i,r,a){let e=n.createElement("div");e.dataset.pptxTransitionFragment=a.id,e.style.position="absolute",e.style.inset="0",e.style.clipPath=a.clipPath,e.style.transformOrigin=a.transformOrigin,e.style.animationName=r.keyframesName,e.style.animationDuration=`${r.durationMs}ms`,e.style.animationTimingFunction=r.easing,e.style.animationDelay=`${a.delayMs}ms`,e.style.animationFillMode="forwards",e.style.willChange="transform, opacity";for(let[t,o]of Object.entries(a.vars))e.style.setProperty(t,o);return e.appendChild(i.cloneNode(true)),e}function u(n,i,r,a,e){let t=n.createElement("div");return t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.zIndex=String(r),t.style.willChange="transform, opacity, clip-path, filter",a!=="none"&&(t.style.animation=a),t.appendChild(i),t}function T(n,i){n.style.background="none",n.style.backgroundColor="transparent";let r=new Set(i),a=new Set;for(let e of n.querySelectorAll("[data-element-id]")){let t=e.dataset.elementId;if(!(t===void 0||!r.has(t))){for(let o=e;o&&o!==n;)a.add(o),o=o.parentElement;for(let o of e.querySelectorAll("[data-element-id]"))a.add(o);}}for(let e of [...n.querySelectorAll("[data-element-id]")])a.has(e)||e.remove();return n}function q(n,i,r,a){return (a?.crossfadeGroups??[]).map((e,t)=>{let o=n.createElement("div");o.dataset.pptxMorphCrossfade=e.incoming.id,o.style.cssText=Dg,o.style.zIndex=String(4+t);let m=(p,l,s,y,g)=>{let d=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?d.dataset.pptxMorphOutgoing="true":d.dataset.pptxMorphLifted="true",d.style.mixBlendMode=Eg,d};return o.append(m(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),m(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function se(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=di(t),m=ei(t),p=_h(t.type,m,t.direction,t.spokes,t.pattern),l=i.createElement("div");l.className="pptxv-transition-overlay",l.dataset.pptxTransitionOverlay="",l.dataset.pptxTransitionOverlay="",l.style.position="absolute",l.style.inset="0",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="30";let s=t.type==="morph"?Gg(n.outgoingSlide,n.incomingSlide,m,Fg(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,d=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),x=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),S=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=S?u(i,S,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){x.dataset.pptxMorphIncoming="true",d.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[Hg(s,"data-pptx-morph-incoming","incoming"),Hg(s,"data-pptx-morph-outgoing","outgoing"),Hg(s,"data-pptx-morph-lifted","lifted")].join(`
1
+ import {Fc,di,Bm,gi,hi,bi,Jg,Ig,Kg,Zt,Gd,Gg,Hg}from'./chunk-6U56MSXT.js';var R="data-pptx-text-style-override";function z(n,i,r){Zt(n,r?.textStyle);let a=Gd(i,r?.textStyle),e=n.querySelector(`:scope > style[${R}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(R,""),n.prepend(e)),e.textContent=a;}var w="pptx-vanilla-presentation-keyframes",k="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(w))return;let i=n.createElement("style");i.id=w,i.textContent=`${Fc}
2
+ ${di}
3
+ ${Bm}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(k);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=k,(n.head??n.documentElement).appendChild(r)),r.textContent=i;}function X(n,i,r,a){n.querySelectorAll("[data-element-id]").forEach(e=>{let t=e.dataset.elementId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"",e.style.cursor=r.has(t)||a.has(t)?"pointer":"",z(e,t,o);}),n.querySelectorAll("[data-anim-id]").forEach(e=>{let t=e.dataset.animId;if(!t)return;let o=i.get(t);e.style.animation=o?.cssAnimation??"",e.style.visibility=o?.visible===false?"hidden":"";});}function M(n,i,r,a,e){let t=n.createElement("div");t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.dataset.pptxTransitionFragments=r.keyframesName,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.zIndex=String(a);for(let o of r.fragments)t.appendChild(B(n,i,r,o));return t}function B(n,i,r,a){let e=n.createElement("div");e.dataset.pptxTransitionFragment=a.id,e.style.position="absolute",e.style.inset="0",e.style.clipPath=a.clipPath,e.style.transformOrigin=a.transformOrigin,e.style.animationName=r.keyframesName,e.style.animationDuration=`${r.durationMs}ms`,e.style.animationTimingFunction=r.easing,e.style.animationDelay=`${a.delayMs}ms`,e.style.animationFillMode="forwards",e.style.willChange="transform, opacity";for(let[t,o]of Object.entries(a.vars))e.style.setProperty(t,o);return e.appendChild(i.cloneNode(true)),e}function u(n,i,r,a,e){let t=n.createElement("div");return t.className="pptxv-transition-layer",t.dataset.pptxTransitionLayer=e,t.style.position="absolute",t.style.inset="0",t.style.overflow="hidden",t.style.zIndex=String(r),t.style.willChange="transform, opacity, clip-path, filter",a!=="none"&&(t.style.animation=a),t.appendChild(i),t}function T(n,i){n.style.background="none",n.style.backgroundColor="transparent";let r=new Set(i),a=new Set;for(let e of n.querySelectorAll("[data-element-id]")){let t=e.dataset.elementId;if(!(t===void 0||!r.has(t))){for(let o=e;o&&o!==n;)a.add(o),o=o.parentElement;for(let o of e.querySelectorAll("[data-element-id]"))a.add(o);}}for(let e of [...n.querySelectorAll("[data-element-id]")])a.has(e)||e.remove();return n}function q(n,i,r,a){return (a?.crossfadeGroups??[]).map((e,t)=>{let o=n.createElement("div");o.dataset.pptxMorphCrossfade=e.incoming.id,o.style.cssText=Gg,o.style.zIndex=String(4+t);let m=(p,l,s,y,g)=>{let d=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?d.dataset.pptxMorphOutgoing="true":d.dataset.pptxMorphLifted="true",d.style.mixBlendMode=Hg,d};return o.append(m(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),m(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function se(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=gi(t),m=hi(t),p=bi(t.type,m,t.direction,t.spokes,t.pattern),l=i.createElement("div");l.className="pptxv-transition-overlay",l.dataset.pptxTransitionOverlay="",l.dataset.pptxTransitionOverlay="",l.style.position="absolute",l.style.inset="0",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="30";let s=t.type==="morph"?Jg(n.outgoingSlide,n.incomingSlide,m,Ig(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,d=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),x=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),S=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=S?u(i,S,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){x.dataset.pptxMorphIncoming="true",d.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[Kg(s,"data-pptx-morph-incoming","incoming"),Kg(s,"data-pptx-morph-outgoing","outgoing"),Kg(s,"data-pptx-morph-lifted","lifted")].join(`
4
4
  `),l.appendChild(c);}l.append(d,x),f&&l.appendChild(f);for(let c of $)l.appendChild(c);r.appendChild(l);let h=false,v=()=>{h||(h=true,clearTimeout(G),l.remove(),n.onDone());},G=setTimeout(v,Math.max(0,m)+50);return v}export{K as a,W as b,X as c,se as d};