pptx-vanilla-viewer 3.17.0 → 3.17.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,35 @@ 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.17.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.17.0) - 2026-10-01
11
+
12
+ ### Features
13
+
14
+ - **shared:** Add pptx-ui-ribbon-view shared View ribbon view (by @ChristopherVR) ([5025716](https://github.com/ChristopherVR/pptx-viewer/commit/502571643ca38099dae33cb3dfbe0e8d787aefdd))
15
+ - **shared,react:** Select inside a group like PowerPoint (by @pesnik) ([994f0a1](https://github.com/ChristopherVR/pptx-viewer/commit/994f0a11ade0e9fa8a0e34c300a382db90abeb7d))
16
+ - **vanilla:** Select inside a group like PowerPoint (by @pesnik) ([117871a](https://github.com/ChristopherVR/pptx-viewer/commit/117871a97a9aea07f5621e86aca3c7fababe3b86))
17
+
18
+ ### Bug Fixes
19
+
20
+ - **ui:** Centre the Design ribbon commands in the compact ribbon (by @ChristopherVR) ([62549ff](https://github.com/ChristopherVR/pptx-viewer/commit/62549fff46354746e0ef1b404db2e503a99a3333))
21
+
22
+ ### Refactor
23
+
24
+ - **ui:** Migrate Draw ribbon controls across five bindings (by @ChristopherVR) ([80f8d92](https://github.com/ChristopherVR/pptx-viewer/commit/80f8d9287069cd89e00f7fed4812ef3cfa318118))
25
+ - **ui:** Migrate View ribbon controls across five bindings (by @ChristopherVR) ([7c2dd6e](https://github.com/ChristopherVR/pptx-viewer/commit/7c2dd6e09ced1fd4b672f46392181c0219ed99b5))
26
+ - **core:** Make pptx-viewer-core a thin entry point over @christophervr/ooxml-core/pptx (by @ChristopherVR) ([caa5172](https://github.com/ChristopherVR/pptx-viewer/commit/caa517204c931206e0d624db81c7cea3565695b2))
27
+ - **ui:** Migrate Transitions ribbon controls across five bindings (by @ChristopherVR) ([1170313](https://github.com/ChristopherVR/pptx-viewer/commit/11703139c72f670c81cd7a26472068230320a458))
28
+ - **ui:** Migrate Animations ribbon controls across five bindings (by @ChristopherVR) ([7fa9c6e](https://github.com/ChristopherVR/pptx-viewer/commit/7fa9c6e235c391006023ec8e5913531cc82b2f7f))
29
+ - **ui:** Migrate Insert ribbon controls across five bindings (by @ChristopherVR) ([75e81ca](https://github.com/ChristopherVR/pptx-viewer/commit/75e81ca85f0bd87526ec455cc53a1aee738378a9))
30
+ - **ui:** Migrate Home clipboard controls across five bindings (by @ChristopherVR) ([877f08b](https://github.com/ChristopherVR/pptx-viewer/commit/877f08b7e10e864d8d21b3afc1e078a9249a70c2))
31
+ - **ui:** Migrate Home font controls across five bindings (by @ChristopherVR) ([b842cab](https://github.com/ChristopherVR/pptx-viewer/commit/b842cabcd903f521e54d27b5d757f8be13e1f885))
32
+ - **ui:** Migrate Home paragraph and editing controls across five bindings (by @ChristopherVR) ([b5f26b4](https://github.com/ChristopherVR/pptx-viewer/commit/b5f26b4803bc5f5ff5382f8c07a696bee14827bf))
33
+
34
+ ### Build & CI
35
+
36
+ - Build against ooxml-core, retarget scripts and docs at the moved engine (by @ChristopherVR) ([9b5146d](https://github.com/ChristopherVR/pptx-viewer/commit/9b5146d5f6af4afc2da623b929e81baa65e693c4))
37
+ - Consume the published @christophervr/ooxml-core ^0.1.0 (by @ChristopherVR) ([df84fe3](https://github.com/ChristopherVR/pptx-viewer/commit/df84fe3e53cb66e7b35a29e5ea797566b6a2998a))
38
+
10
39
  ## [3.16.1](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-vanilla-viewer@3.16.1) - 2026-10-01
11
40
 
12
41
  ### Bug Fixes
@@ -1 +1 @@
1
- 'use strict';var chunkGJUPSLKS_cjs=require('./chunk-GJUPSLKS.cjs');require('./chunk-ANLE2GSJ.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkGJUPSLKS_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkGJUPSLKS_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkGJUPSLKS_cjs.j(p,o.getSlides())){let b=chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkGJUPSLKS_cjs.k(p,o.getSlides());if(d){let r=chunkGJUPSLKS_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkGJUPSLKS_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkGJUPSLKS_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkGJUPSLKS_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkGJUPSLKS_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkGJUPSLKS_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkGJUPSLKS_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkGJUPSLKS_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkGJUPSLKS_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkGJUPSLKS_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkGJUPSLKS_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkGJUPSLKS_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkGJUPSLKS_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkGJUPSLKS_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkGJUPSLKS_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkGJUPSLKS_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkGJUPSLKS_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(chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-tool"),p=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkGJUPSLKS_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkGJUPSLKS_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkGJUPSLKS_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkGJUPSLKS_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkGJUPSLKS_cjs.r(t.input);if(g){let f=chunkGJUPSLKS_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkGJUPSLKS_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkGJUPSLKS_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkGJUPSLKS_cjs.K(o,h?"comment":"sparkles"));let m=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkGJUPSLKS_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=chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkGJUPSLKS_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkGJUPSLKS_cjs.w(o,"li");g.textContent=chunkGJUPSLKS_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkGJUPSLKS_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkGJUPSLKS_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkGJUPSLKS_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkGJUPSLKS_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-header"),h=chunkGJUPSLKS_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkGJUPSLKS_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(chunkGJUPSLKS_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkGJUPSLKS_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkGJUPSLKS_cjs.w(t,"form","pptxv-ai-composer"),d=chunkGJUPSLKS_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=chunkGJUPSLKS_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkGJUPSLKS_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkGJUPSLKS_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:chunkGJUPSLKS_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=>chunkGJUPSLKS_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=chunkGJUPSLKS_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 chunkLBO5I4DK_cjs=require('./chunk-LBO5I4DK.cjs');require('./chunk-NJ22ZLDN.cjs'),require('./chunk-B5PFHICE.cjs');function K(o){let{doc:t,t:n,controller:i}=o,a=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-focus"),h=(p,m,l)=>{let s=chunkLBO5I4DK_cjs.w(t,"button","pptxv-ai-focus-btn");return s.type="button",s.title=m,s.setAttribute("aria-label",m),s.appendChild(chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-focus-row"),f=chunkLBO5I4DK_cjs.w(t,"span","pptxv-ai-focus-label");f.textContent=n("pptx.ai.focusScope"),g.appendChild(f);for(let r of chunkLBO5I4DK_cjs.j(p,o.getSlides())){let b=chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(t,"span","pptxv-ai-focus-pinned");r.textContent=n("pptx.ai.pinnedFocus"),g.appendChild(r);}let C=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-focus-actions"),d=chunkLBO5I4DK_cjs.k(p,o.getSlides());if(d){let r=chunkLBO5I4DK_cjs.w(t,"button","pptxv-ai-focus-merge");r.type="button",r.append(chunkLBO5I4DK_cjs.K(t,"git-merge"),t.createTextNode(n("pptx.ai.mergeSelectedTables"))),r.addEventListener("click",()=>o.onSendDirective(chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-focus-pick"),b=chunkLBO5I4DK_cjs.K(t,"crosshair");b.classList.add("pptxv-ai-focus-pick-icon");let k=chunkLBO5I4DK_cjs.w(t,"span","pptxv-ai-focus-pick-hint");k.textContent=n("pptx.ai.pickElementHint");let T=chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(t,"button","pptxv-ai-chats");i.type="button",i.append(chunkLBO5I4DK_cjs.K(t,"history"),t.createTextNode(n("pptx.ai.chats")));let a=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-history");a.hidden=true;let h=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-history-head"),x=chunkLBO5I4DK_cjs.w(t,"span","pptxv-ai-history-title");x.textContent=n("pptx.ai.historyTitle");let c=chunkLBO5I4DK_cjs.w(t,"button","pptxv-ai-history-new");c.type="button",c.append(chunkLBO5I4DK_cjs.K(t,"plus"),t.createTextNode(n("pptx.ai.newChat"))),h.append(x,c);let p=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-history-body"),m=chunkLBO5I4DK_cjs.w(t,"p","pptxv-ai-history-hint");m.textContent=n("pptx.ai.historyHint"),a.append(h,p,m);let l=chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(t,"p","pptxv-ai-history-empty");d.textContent=n("pptx.ai.historyEmpty"),p.appendChild(d);return}let C=chunkLBO5I4DK_cjs.w(t,"ul","pptxv-ai-history-list");for(let d of f){let y=chunkLBO5I4DK_cjs.w(t,"li","pptxv-ai-history-row"),r=chunkLBO5I4DK_cjs.w(t,"button","pptxv-ai-history-resume");r.type="button",r.classList.toggle("is-active",d.id===l.activeChatId());let b=chunkLBO5I4DK_cjs.w(t,"span","pptxv-ai-history-text"),k=chunkLBO5I4DK_cjs.w(t,"span","pptxv-ai-history-name");k.textContent=d.title||n("pptx.ai.untitledChat");let T=chunkLBO5I4DK_cjs.w(t,"span","pptxv-ai-history-meta");T.textContent=n("pptx.ai.messageCount",{count:d.messageCount}),b.append(k,T),r.append(chunkLBO5I4DK_cjs.K(t,"comment"),b),r.addEventListener("click",()=>{l.resumeChat(d.id),a.hidden=true;});let P=chunkLBO5I4DK_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(chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.s(t.toolName,t.input,h?"present":"past"),c=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-tool"),p=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-tool-head"),m=chunkLBO5I4DK_cjs.K(o,_[x.icon]??"wrench");m.classList.add("pptxv-ai-tool-icon");let l=chunkLBO5I4DK_cjs.w(o,"span","pptxv-ai-tool-name");l.textContent=x.label;let s=chunkLBO5I4DK_cjs.w(o,"span","pptxv-ai-tool-state");if(i?(s.classList.add("is-error"),s.append(chunkLBO5I4DK_cjs.K(o,"alert"),o.createTextNode(n("pptx.ai.toolFailed")))):a?(s.classList.add("is-done"),s.append(chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-tool-error");f.textContent=t.errorText,c.appendChild(f);}let g=chunkLBO5I4DK_cjs.r(t.input);if(g){let f=chunkLBO5I4DK_cjs.w(o,"details","pptxv-ai-tool-details"),C=chunkLBO5I4DK_cjs.w(o,"summary");C.textContent=n("pptx.ai.toolDetails");let d=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-tool-raw");d.textContent=`${chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.f(a);if(x.length===0&&!h)continue;let c=chunkLBO5I4DK_cjs.w(o,"div",`pptxv-ai-msg pptxv-ai-msg-${a.role}`),p=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-msg-avatar");p.setAttribute("aria-label",i(h?"pptx.ai.you":"pptx.ai.assistant")),p.appendChild(chunkLBO5I4DK_cjs.K(o,h?"comment":"sparkles"));let m=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-msg-body");for(let l of x)if(l.kind==="text"){let s=chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-proposals-header"),x=chunkLBO5I4DK_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=chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-proposal");a.dataset.proposalId=t.id;let h=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-proposal-eyebrow");h.textContent=n("pptx.ai.proposedChange"),a.appendChild(h);let x=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-proposal-label");if(x.textContent=t.label,a.appendChild(x),t.summary.length>0){let l=chunkLBO5I4DK_cjs.w(o,"ul","pptxv-ai-proposal-summary");for(let s of t.summary){let g=chunkLBO5I4DK_cjs.w(o,"li");g.textContent=chunkLBO5I4DK_cjs.c(s),l.appendChild(g);}a.appendChild(l);}let c=chunkLBO5I4DK_cjs.w(o,"div","pptxv-ai-proposal-actions"),p=chunkLBO5I4DK_cjs.w(o,"button","pptxv-ai-proposal-btn is-accept");p.type="button",p.append(chunkLBO5I4DK_cjs.K(o,"check"),o.createTextNode(n("pptx.ai.accept"))),p.addEventListener("click",()=>i.accept(t.id));let m=chunkLBO5I4DK_cjs.w(o,"button","pptxv-ai-proposal-btn is-reject");return m.type="button",m.append(chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-header"),h=chunkLBO5I4DK_cjs.w(t,"span","pptxv-ai-title");h.textContent=i("pptx.ai.title");let x=chunkLBO5I4DK_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(chunkLBO5I4DK_cjs.K(t,"close")),x.addEventListener("click",()=>o.onClose?.()),a.append(chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-messages");l.setAttribute("role","log"),l.setAttribute("aria-live","polite");let s=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-empty");s.textContent=i("pptx.ai.emptyHint"),l.appendChild(s);let g=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-proposals");g.hidden=true;let f=chunkLBO5I4DK_cjs.w(t,"div","pptxv-ai-error");f.setAttribute("role","alert"),f.hidden=true;let C=chunkLBO5I4DK_cjs.w(t,"form","pptxv-ai-composer"),d=chunkLBO5I4DK_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=chunkLBO5I4DK_cjs.w(t,"button","pptxv-ai-send");y.type="submit",y.setAttribute("aria-label",i("pptx.ai.send")),y.appendChild(chunkLBO5I4DK_cjs.K(t,"send")),C.append(d,y),n.append(a,...m?[m.el]:[],l,g,f,C);try{c=await(o.createChat??chunkLBO5I4DK_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:chunkLBO5I4DK_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=>chunkLBO5I4DK_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=chunkLBO5I4DK_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-HLZVTGZZ.js';import'./chunk-255BQTPS.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-XE4BXFJI.js';import'./chunk-SPB2CY64.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
- 'use strict';var chunkANLE2GSJ_cjs=require('./chunk-ANLE2GSJ.cjs');var w="data-pptx-text-style-override";function z(n,i,r){chunkANLE2GSJ_cjs.ru(n,r?.textStyle);let a=chunkANLE2GSJ_cjs.qd(i,r?.textStyle),e=n.querySelector(`:scope > style[${w}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(w,""),n.prepend(e)),e.textContent=a;}var k="pptx-vanilla-presentation-keyframes",G="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(k))return;let i=n.createElement("style");i.id=k,i.textContent=`${chunkANLE2GSJ_cjs.pc}
2
- ${chunkANLE2GSJ_cjs.Sh}
3
- ${chunkANLE2GSJ_cjs.gm}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(G);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=G,(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":"";let d=r.has(t)||a.has(t);e.style.cursor=d?"pointer":"",e.toggleAttribute(chunkANLE2GSJ_cjs.fm,d),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(j(n,i,r,o));return t}function j(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=chunkANLE2GSJ_cjs.rg,o.style.zIndex=String(4+t);let d=(p,l,s,y,g)=>{let m=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?m.dataset.pptxMorphOutgoing="true":m.dataset.pptxMorphLifted="true",m.style.mixBlendMode=chunkANLE2GSJ_cjs.sg,m};return o.append(d(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),d(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function le(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=chunkANLE2GSJ_cjs.Vh(t),d=chunkANLE2GSJ_cjs.Wh(t),p=chunkANLE2GSJ_cjs.Qh(t.type,d,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"?chunkANLE2GSJ_cjs.ug(n.outgoingSlide,n.incomingSlide,d,chunkANLE2GSJ_cjs.tg(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,m=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),S=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),x=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=x?u(i,x,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){S.dataset.pptxMorphIncoming="true",m.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[chunkANLE2GSJ_cjs.vg(s,"data-pptx-morph-incoming","incoming"),chunkANLE2GSJ_cjs.vg(s,"data-pptx-morph-outgoing","outgoing"),chunkANLE2GSJ_cjs.vg(s,"data-pptx-morph-lifted","lifted")].join(`
1
+ 'use strict';var chunkNJ22ZLDN_cjs=require('./chunk-NJ22ZLDN.cjs');var w="data-pptx-text-style-override";function z(n,i,r){chunkNJ22ZLDN_cjs.ru(n,r?.textStyle);let a=chunkNJ22ZLDN_cjs.qd(i,r?.textStyle),e=n.querySelector(`:scope > style[${w}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(w,""),n.prepend(e)),e.textContent=a;}var k="pptx-vanilla-presentation-keyframes",G="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(k))return;let i=n.createElement("style");i.id=k,i.textContent=`${chunkNJ22ZLDN_cjs.pc}
2
+ ${chunkNJ22ZLDN_cjs.Sh}
3
+ ${chunkNJ22ZLDN_cjs.gm}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(G);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=G,(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":"";let d=r.has(t)||a.has(t);e.style.cursor=d?"pointer":"",e.toggleAttribute(chunkNJ22ZLDN_cjs.fm,d),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(j(n,i,r,o));return t}function j(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=chunkNJ22ZLDN_cjs.rg,o.style.zIndex=String(4+t);let d=(p,l,s,y,g)=>{let m=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?m.dataset.pptxMorphOutgoing="true":m.dataset.pptxMorphLifted="true",m.style.mixBlendMode=chunkNJ22ZLDN_cjs.sg,m};return o.append(d(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),d(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function le(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=chunkNJ22ZLDN_cjs.Vh(t),d=chunkNJ22ZLDN_cjs.Wh(t),p=chunkNJ22ZLDN_cjs.Qh(t.type,d,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"?chunkNJ22ZLDN_cjs.ug(n.outgoingSlide,n.incomingSlide,d,chunkNJ22ZLDN_cjs.tg(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,m=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),S=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),x=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=x?u(i,x,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){S.dataset.pptxMorphIncoming="true",m.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[chunkNJ22ZLDN_cjs.vg(s,"data-pptx-morph-incoming","incoming"),chunkNJ22ZLDN_cjs.vg(s,"data-pptx-morph-outgoing","outgoing"),chunkNJ22ZLDN_cjs.vg(s,"data-pptx-morph-lifted","lifted")].join(`
4
4
  `),l.appendChild(c);}l.append(m,S),f&&l.appendChild(f);for(let c of $)l.appendChild(c);r.appendChild(l);let h=false,v=()=>{h||(h=true,clearTimeout(B),l.remove(),n.onDone());},B=setTimeout(v,Math.max(0,d)+50);return v}exports.a=K;exports.b=W;exports.c=X;exports.d=le;
@@ -1,4 +1,4 @@
1
- import {pc,Sh,gm,fm,Vh,Wh,Qh,ug,tg,vg,ru,qd,rg,sg}from'./chunk-255BQTPS.js';var w="data-pptx-text-style-override";function z(n,i,r){ru(n,r?.textStyle);let a=qd(i,r?.textStyle),e=n.querySelector(`:scope > style[${w}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(w,""),n.prepend(e)),e.textContent=a;}var k="pptx-vanilla-presentation-keyframes",G="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(k))return;let i=n.createElement("style");i.id=k,i.textContent=`${pc}
1
+ import {pc,Sh,gm,fm,Vh,Wh,Qh,ug,tg,vg,ru,qd,rg,sg}from'./chunk-SPB2CY64.js';var w="data-pptx-text-style-override";function z(n,i,r){ru(n,r?.textStyle);let a=qd(i,r?.textStyle),e=n.querySelector(`:scope > style[${w}]`);if(!a){e?.remove();return}e||(e=n.ownerDocument.createElement("style"),e.setAttribute(w,""),n.prepend(e)),e.textContent=a;}var k="pptx-vanilla-presentation-keyframes",G="pptx-vanilla-slide-keyframes";function K(n){if(n.getElementById(k))return;let i=n.createElement("style");i.id=k,i.textContent=`${pc}
2
2
  ${Sh}
3
3
  ${gm}`,(n.head??n.documentElement).appendChild(i);}function W(n,i){let r=n.getElementById(G);if(!i){r?.remove();return}r||(r=n.createElement("style"),r.id=G,(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":"";let d=r.has(t)||a.has(t);e.style.cursor=d?"pointer":"",e.toggleAttribute(fm,d),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(j(n,i,r,o));return t}function j(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=rg,o.style.zIndex=String(4+t);let d=(p,l,s,y,g)=>{let m=u(n,T(p,[l]),y,g??"none",s);return s==="outgoing"?m.dataset.pptxMorphOutgoing="true":m.dataset.pptxMorphLifted="true",m.style.mixBlendMode=sg,m};return o.append(d(i.cloneNode(true),e.outgoing.id,"outgoing",0,e.outgoingAnimation),d(r.cloneNode(true),e.incoming.id,"lifted",1,e.incomingAnimation)),o})}function le(n){let{doc:i,stageWrap:r,outgoing:a,incoming:e,transition:t}=n;K(i);let o=Vh(t),d=Wh(t),p=Qh(t.type,d,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"?ug(n.outgoingSlide,n.incomingSlide,d,tg(t.morphOption)):void 0,y=s||o.outgoingOnTop?2:1,g=s||o.outgoingOnTop?1:2,m=!s&&p?.outgoing?M(i,a,p.outgoing,y,"outgoing"):u(i,a,y,s?"none":o.outgoing,"outgoing"),S=!s&&p?.incoming?M(i,e,p.incoming,g,"incoming"):u(i,e,g,s?"none":o.incoming,"incoming"),x=s&&s.overlayIncomingElements.length>0?T(e.cloneNode(true),s.overlayIncomingElements.map(c=>c.id)):void 0,f=x?u(i,x,3,"none","lifted"):void 0,$=q(i,a,e,s);if(s){S.dataset.pptxMorphIncoming="true",m.dataset.pptxMorphOutgoing="true",T(a,s.outgoingElements.map(Y=>Y.id)),f&&(f.dataset.pptxMorphLifted="true");let c=i.createElement("style");c.textContent=[vg(s,"data-pptx-morph-incoming","incoming"),vg(s,"data-pptx-morph-outgoing","outgoing"),vg(s,"data-pptx-morph-lifted","lifted")].join(`
4
4
  `),l.appendChild(c);}l.append(m,S),f&&l.appendChild(f);for(let c of $)l.appendChild(c);r.appendChild(l);let h=false,v=()=>{h||(h=true,clearTimeout(B),l.remove(),n.onDone());},B=setTimeout(v,Math.max(0,d)+50);return v}export{K as a,W as b,X as c,le as d};