@nice2dev/ui-presentations 1.2.2 → 1.3.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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),_=require("@nice2dev/ui"),d=require("react");function je(e){const{slideSize:t,theme:n,slides:i}=e,o=i.map((r,a)=>jt(r,t,n,a)).join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),T=require("@nice2dev/ui"),d=require("react");function Fe(e){const{slideSize:t,theme:n,slides:i}=e,o=i.map((r,a)=>Ft(r,t,n,a)).join(`
2
2
  `);return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
@@ -79,58 +79,58 @@ ${o}
79
79
  })();
80
80
  <\/script>
81
81
  </body>
82
- </html>`}function jt(e,t,n,i){const o=n.backgroundColor??"#fff",r=n.textColor??"#000000";let a="";const s=e.background;if(s.type==="gradient"&&s.gradientStops){const u=s.gradientStops.map(f=>`${f.color} ${f.position*100}%`).join(", ");a=`background: linear-gradient(${s.gradientDirection??180}deg, ${u});`}else s.type==="image"&&s.imageUrl?a=`background: url('${s.imageUrl}') center/${s.imageFit??"cover"} no-repeat; background-color: ${s.color??o};`:a=`background: ${s.color??o};`;const c=e.elements.map(u=>Ft(u,t,n)).join(`
82
+ </html>`}function Ft(e,t,n,i){const o=n.backgroundColor??"#fff",r=n.textColor??"#000000";let a="";const s=e.background;if(s.type==="gradient"&&s.gradientStops){const u=s.gradientStops.map(f=>`${f.color} ${f.position*100}%`).join(", ");a=`background: linear-gradient(${s.gradientDirection??180}deg, ${u});`}else s.type==="image"&&s.imageUrl?a=`background: url('${s.imageUrl}') center/${s.imageFit??"cover"} no-repeat; background-color: ${s.color??o};`:a=`background: ${s.color??o};`;const c=e.elements.map(u=>Lt(u,t,n)).join(`
83
83
  `);return`<div class="ndp-slide${i===0?" active":""}" style="${a} color: ${r};">
84
84
  ${c}
85
- </div>`}function Ft(e,t,n){const{position:i}=e,o=i.x/100*t.width,r=i.y/100*t.height,a=i.width/100*t.width,s=i.height/100*t.height,c=e.rotation?`transform: rotate(${e.rotation}deg);`:"",u=e.opacity!==void 0?`opacity: ${e.opacity};`:"",f=`position: absolute; left: ${o}px; top: ${r}px; width: ${a}px; height: ${s}px; ${c} ${u}`,h=e.content;switch(h.kind??h.type){case"text":{const p=h,m=p.fontSize??16,g=p.fontColor??n.textColor??"#000",b=p.fontFamily??n.fontFamily??"sans-serif",S=p.fontWeight??"normal",x=p.textAlign??"left";return`<div class="ndp-element ndp-element-text" style="${f} font-size: ${m}px; color: ${g}; font-family: ${b}; font-weight: ${S}; text-align: ${x};">${pe(p.text)}</div>`}case"image":{const p=h;return`<div class="ndp-element" style="${f}"><img src="${pe(p.src)}" alt="${pe(p.alt??"")}" style="width:100%;height:100%;object-fit:${p.objectFit??"contain"};border-radius:${p.borderRadius??0}px;" /></div>`}case"code":{const p=h;return`<div class="ndp-element" style="${f} background: ${p.theme==="light"?"#f5f5f5":"#1e1e1e"}; color: ${p.theme==="light"?"#333":"#d4d4d4"}; padding: var(--nice-space-4, 16px); border-radius: var(--nice-radius-lg, 8px); overflow: auto; font-family: monospace; font-size: ${p.fontSize??14}px; white-space: pre;">${pe(p.code)}</div>`}case"shape":{const p=h,m=p.fill??"#ccc";return`<div class="ndp-element" style="${f} background: ${m}; border-radius: ${p.shapeType==="ellipse"?"50%":"0"}; border: ${p.strokeWidth??0}px solid ${p.stroke??"transparent"};"></div>`}default:return`<div class="ndp-element" style="${f}"></div>`}}function pe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const ve={en:{"toolbar.addSlide":"Add Slide","toolbar.deleteSlide":"Delete Slide","toolbar.duplicateSlide":"Duplicate","toolbar.undo":"Undo","toolbar.redo":"Redo","toolbar.present":"Present","toolbar.export":"Export","toolbar.theme":"Theme","countdown.timeUp":"Time's up!","element.text":"Text","element.image":"Image","element.shape":"Shape","element.chart":"Chart","element.table":"Table","element.code":"Code","element.diagram":"Diagram","element.video":"Video","element.icon":"Icon","element.addElement":"Add Element","panel.slideProperties":"Slide Properties","panel.elementProperties":"Element Properties","panel.noSelection":"Select a slide or element","panel.layout":"Layout","panel.background":"Background","panel.transition":"Transition","panel.notes":"Speaker Notes","player.play":"Play","player.pause":"Pause","player.fullscreen":"Fullscreen","player.exit":"Exit","player.slideOf":"of","layout.blank":"Blank","layout.titleSlide":"Title Slide","layout.titleContent":"Title + Content","layout.twoColumn":"Two Column","layout.titleOnly":"Title Only","layout.sectionHeader":"Section Header","layout.comparison":"Comparison","layout.custom":"Custom","export.html":"HTML Presentation","export.ndp":".ndp.json","interactive.qna.title":"Questions & answers","interactive.qna.placeholder":"Ask a question...","interactive.qna.anonymously":"Anonymously","interactive.qna.anonymous":"Anonymous","interactive.qna.submit":"Submit question","interactive.qna.upvote":"Upvote","interactive.qna.alreadyUpvoted":"You already upvoted this","interactive.qna.markAnswered":"Mark as answered","interactive.qna.markUnanswered":"Mark as unanswered","interactive.qna.questionOne":"question","interactive.qna.questionMany":"questions","interactive.qna.closed":"Question submission is closed","interactive.qna.empty":"No questions yet. Be the first!","interactive.qna.moreQuestions":"more questions","interactive.qna.justNow":"Just now","interactive.qna.minutesAgo":"{n} min ago","interactive.qna.hoursAgo":"{n}h ago","interactive.quiz.correctFeedback":"Correct answer!","interactive.quiz.incorrectFeedback":"Sorry, that is not the correct answer.","interactive.quiz.points":"pts","interactive.quiz.submit":"Submit answer","interactive.quiz.explanation":"Explanation:","interactive.poll.vote":"Submit vote","interactive.poll.totalVotes":"Total votes:","interactive.poll.thanks":"Thanks for your vote!","panel.opacity":"Opacity","panel.fontSize":"Font Size","panel.deleteElement":"Delete Element","panel.title":"Title","presentationEditor.bringToFront":"Bring to front","presentationEditor.sendToBack":"Send to back","presentationEditor.duplicate":"Duplicate","presentationEditor.slideElements":"Slide elements","presentationEditor.noElementsYet":"No elements yet.","presentationPlayer.previous":"Previous","presentationPlayer.next":"Next","presentationPlayer.exitEsc":"Exit (Esc)","presentationPlayer.exit":"Exit","presentationPlayer.overviewG":"Overview (G)","presentationPlayer.overview":"Overview","presentationEditor.front":"Front","presentationEditor.back":"Back","countdown.timesUp":"Time's up!","presentationEditor.grid":"Grid","presentationEditor.elements":"Elements ({elements})","presentationPlayer.exitFullscreen":"Exit fullscreen","presentationPlayer.fullscreen":"Fullscreen","puppetPlayer.pause":"Pause","puppetPlayer.play":"Play","puppetPlayer.stop":"Stop","puppetPlayer.previousScene":"Previous Scene","puppetPlayer.nextScene":"Next Scene","puppetPlayer.unmute":"Unmute","puppetPlayer.mute":"Mute","puppetPlayer.loop":"Loop"},pl:{"toolbar.addSlide":"Dodaj slajd","toolbar.deleteSlide":"Usuń slajd","toolbar.duplicateSlide":"Duplikuj","toolbar.undo":"Cofnij","toolbar.redo":"Powtórz","toolbar.present":"Prezentuj","toolbar.export":"Eksport","toolbar.theme":"Motyw","countdown.timeUp":"Czas minął!","element.text":"Tekst","element.image":"Obraz","element.shape":"Kształt","element.chart":"Wykres","element.table":"Tabela","element.code":"Kod","element.diagram":"Diagram","element.video":"Wideo","element.icon":"Ikona","element.addElement":"Dodaj element","panel.slideProperties":"Właściwości slajdu","panel.elementProperties":"Właściwości elementu","panel.noSelection":"Wybierz slajd lub element","panel.layout":"Układ","panel.background":"Tło","panel.transition":"Przejście","panel.notes":"Notatki prelegenta","player.play":"Odtwórz","player.pause":"Pauza","player.fullscreen":"Pełny ekran","player.exit":"Wyjdź","player.slideOf":"z","layout.blank":"Puste","layout.titleSlide":"Slajd tytułowy","layout.titleContent":"Tytuł + treść","layout.twoColumn":"Dwie kolumny","layout.titleOnly":"Tylko tytuł","layout.sectionHeader":"Nagłówek sekcji","layout.comparison":"Porównanie","layout.custom":"Niestandardowy","export.html":"Prezentacja HTML","export.ndp":".ndp.json","interactive.qna.title":"Pytania i odpowiedzi","interactive.qna.placeholder":"Zadaj pytanie...","interactive.qna.anonymously":"Anonimowo","interactive.qna.anonymous":"Anonim","interactive.qna.submit":"Wyślij pytanie","interactive.qna.upvote":"Zagłosuj","interactive.qna.alreadyUpvoted":"Już zagłosowałeś","interactive.qna.markAnswered":"Oznacz jako odpowiedziane","interactive.qna.markUnanswered":"Oznacz jako nieodpowiedziane","interactive.qna.questionOne":"pytanie","interactive.qna.questionMany":"pytań","interactive.qna.closed":"Zadawanie pytań zostało zamknięte","interactive.qna.empty":"Brak pytań. Bądź pierwszy!","interactive.qna.moreQuestions":"więcej pytań","interactive.qna.justNow":"Teraz","interactive.qna.minutesAgo":"{n} min temu","interactive.qna.hoursAgo":"{n} godz. temu","interactive.quiz.correctFeedback":"Poprawna odpowiedź!","interactive.quiz.incorrectFeedback":"Niestety, to nie jest poprawna odpowiedź.","interactive.quiz.points":"pkt","interactive.quiz.submit":"Zatwierdź odpowiedź","interactive.quiz.explanation":"Wyjaśnienie:","interactive.poll.vote":"Oddaj głos","interactive.poll.totalVotes":"Łącznie głosów:","interactive.poll.thanks":"Dziękujemy za głos!","panel.opacity":"Krycie","panel.fontSize":"Rozmiar czcionki","panel.deleteElement":"Usuń element","panel.title":"Tytuł","presentationEditor.bringToFront":"Na wierzch","presentationEditor.sendToBack":"Na spód","presentationEditor.duplicate":"Duplikuj","presentationEditor.slideElements":"Elementy slajdu","presentationEditor.noElementsYet":"Brak elementów.","presentationPlayer.previous":"Poprzedni","presentationPlayer.next":"Następny","presentationPlayer.exitEsc":"Zakończ (Esc)","presentationPlayer.exit":"Zakończ","presentationPlayer.overviewG":"Przegląd (G)","presentationPlayer.overview":"Przegląd","presentationEditor.front":"Na wierzch","presentationEditor.back":"Na spód","countdown.timesUp":"Koniec czasu!","presentationEditor.grid":"Siatka","presentationEditor.elements":"Elementy ({elements})","presentationPlayer.exitFullscreen":"Zamknij pełny ekran","presentationPlayer.fullscreen":"Pełny ekran","puppetPlayer.pause":"Wstrzymaj","puppetPlayer.play":"Odtwórz","puppetPlayer.stop":"Zatrzymaj","puppetPlayer.previousScene":"Poprzednia scena","puppetPlayer.nextScene":"Następna scena","puppetPlayer.unmute":"Włącz dźwięk","puppetPlayer.mute":"Wycisz","puppetPlayer.loop":"Zapętl"},de:{"toolbar.addSlide":"Folie hinzufügen","toolbar.deleteSlide":"Folie löschen","toolbar.duplicateSlide":"Duplizieren","toolbar.undo":"Rückgängig","toolbar.redo":"Wiederholen","toolbar.present":"Präsentieren","toolbar.export":"Exportieren","toolbar.theme":"Design","countdown.timeUp":"Zeit abgelaufen!","element.text":"Text","element.image":"Bild","element.shape":"Form","element.chart":"Diagramm","element.table":"Tabelle","element.code":"Code","element.diagram":"Diagramm","element.video":"Video","element.icon":"Symbol","element.addElement":"Element hinzufügen","panel.slideProperties":"Folieneigenschaften","panel.elementProperties":"Elementeigenschaften","panel.noSelection":"Wählen Sie eine Folie oder ein Element","panel.layout":"Layout","panel.background":"Hintergrund","panel.transition":"Übergang","panel.notes":"Sprechernotizen","player.play":"Abspielen","player.pause":"Pause","player.fullscreen":"Vollbild","player.exit":"Beenden","player.slideOf":"von","layout.blank":"Leer","layout.titleSlide":"Titelfolie","layout.titleContent":"Titel + Inhalt","layout.twoColumn":"Zwei Spalten","layout.titleOnly":"Nur Titel","layout.sectionHeader":"Abschnittskopf","layout.comparison":"Vergleich","layout.custom":"Benutzerdefiniert","export.html":"HTML-Präsentation","export.ndp":".ndp.json","interactive.qna.title":"Fragen und Antworten","interactive.qna.placeholder":"Stellen Sie eine Frage...","interactive.qna.anonymously":"Anonym","interactive.qna.anonymous":"Anonym","interactive.qna.submit":"Frage senden","interactive.qna.upvote":"Zustimmen","interactive.qna.alreadyUpvoted":"Sie haben bereits abgestimmt","interactive.qna.markAnswered":"Als beantwortet markieren","interactive.qna.markUnanswered":"Als unbeantwortet markieren","interactive.qna.questionOne":"Frage","interactive.qna.questionMany":"Fragen","interactive.qna.closed":"Das Einreichen von Fragen ist geschlossen","interactive.qna.empty":"Noch keine Fragen. Seien Sie der Erste!","interactive.qna.moreQuestions":"weitere Fragen","interactive.qna.justNow":"Gerade eben","interactive.qna.minutesAgo":"vor {n} Min.","interactive.qna.hoursAgo":"vor {n} Std.","interactive.quiz.correctFeedback":"Richtige Antwort!","interactive.quiz.incorrectFeedback":"Leider ist das nicht die richtige Antwort.","interactive.quiz.points":"Pkt","interactive.quiz.submit":"Antwort bestätigen","interactive.quiz.explanation":"Erklärung:","interactive.poll.vote":"Stimme abgeben","interactive.poll.totalVotes":"Stimmen insgesamt:","interactive.poll.thanks":"Danke für Ihre Stimme!","panel.opacity":"Deckkraft","panel.fontSize":"Schriftgröße","panel.deleteElement":"Element löschen","panel.title":"Titel","presentationEditor.bringToFront":"In den Vordergrund","presentationEditor.sendToBack":"In den Hintergrund","presentationEditor.duplicate":"Duplizieren","presentationEditor.slideElements":"Folienelemente","presentationEditor.noElementsYet":"Noch keine Elemente.","presentationPlayer.previous":"Zurück","presentationPlayer.next":"Weiter","presentationPlayer.exitEsc":"Beenden (Esc)","presentationPlayer.exit":"Beenden","presentationPlayer.overviewG":"Übersicht (G)","presentationPlayer.overview":"Übersicht","presentationEditor.front":"Vorne","presentationEditor.back":"Hinten","countdown.timesUp":"Die Zeit ist um!","presentationEditor.grid":"Raster","presentationEditor.elements":"Elemente ({elements})","presentationPlayer.exitFullscreen":"Vollbild beenden","presentationPlayer.fullscreen":"Vollbild","puppetPlayer.pause":"Pause","puppetPlayer.play":"Abspielen","puppetPlayer.stop":"Stopp","puppetPlayer.previousScene":"Vorherige Szene","puppetPlayer.nextScene":"Nächste Szene","puppetPlayer.unmute":"Ton an","puppetPlayer.mute":"Stummschalten","puppetPlayer.loop":"Schleife"},fr:{"toolbar.addSlide":"Ajouter une diapositive","toolbar.deleteSlide":"Supprimer la diapositive","toolbar.duplicateSlide":"Dupliquer","toolbar.undo":"Annuler","toolbar.redo":"Rétablir","toolbar.present":"Présenter","toolbar.export":"Exporter","toolbar.theme":"Thème","countdown.timeUp":"Temps écoulé !","element.text":"Texte","element.image":"Image","element.shape":"Forme","element.chart":"Graphique","element.table":"Tableau","element.code":"Code","element.diagram":"Diagramme","element.video":"Vidéo","element.icon":"Icône","element.addElement":"Ajouter un élément","panel.slideProperties":"Propriétés de la diapositive","panel.elementProperties":"Propriétés de l'élément","panel.noSelection":"Sélectionnez une diapositive ou un élément","panel.layout":"Disposition","panel.background":"Arrière-plan","panel.transition":"Transition","panel.notes":"Notes du présentateur","player.play":"Lire","player.pause":"Pause","player.fullscreen":"Plein écran","player.exit":"Quitter","player.slideOf":"sur","layout.blank":"Vide","layout.titleSlide":"Diapositive de titre","layout.titleContent":"Titre + contenu","layout.twoColumn":"Deux colonnes","layout.titleOnly":"Titre seul","layout.sectionHeader":"En-tête de section","layout.comparison":"Comparaison","layout.custom":"Personnalisé","export.html":"Présentation HTML","export.ndp":".ndp.json","interactive.qna.title":"Questions et réponses","interactive.qna.placeholder":"Posez une question...","interactive.qna.anonymously":"Anonymement","interactive.qna.anonymous":"Anonyme","interactive.qna.submit":"Envoyer la question","interactive.qna.upvote":"Voter","interactive.qna.alreadyUpvoted":"Vous avez déjà voté","interactive.qna.markAnswered":"Marquer comme répondue","interactive.qna.markUnanswered":"Marquer comme non répondue","interactive.qna.questionOne":"question","interactive.qna.questionMany":"questions","interactive.qna.closed":"Les questions sont closes","interactive.qna.empty":"Aucune question. Soyez le premier !","interactive.qna.moreQuestions":"autres questions","interactive.qna.justNow":"À l'instant","interactive.qna.minutesAgo":"il y a {n} min","interactive.qna.hoursAgo":"il y a {n} h","interactive.quiz.correctFeedback":"Bonne réponse !","interactive.quiz.incorrectFeedback":"Désolé, ce n'est pas la bonne réponse.","interactive.quiz.points":"pts","interactive.quiz.submit":"Valider la réponse","interactive.quiz.explanation":"Explication :","interactive.poll.vote":"Voter","interactive.poll.totalVotes":"Total des votes :","interactive.poll.thanks":"Merci pour votre vote !","panel.opacity":"Opacité","panel.fontSize":"Taille de police","panel.deleteElement":"Supprimer l'élément","panel.title":"Titre","presentationEditor.bringToFront":"Mettre au premier plan","presentationEditor.sendToBack":"Mettre à l'arrière-plan","presentationEditor.duplicate":"Dupliquer","presentationEditor.slideElements":"Éléments de la diapositive","presentationEditor.noElementsYet":"Aucun élément pour l'instant.","presentationPlayer.previous":"Précédent","presentationPlayer.next":"Suivant","presentationPlayer.exitEsc":"Quitter (Échap)","presentationPlayer.exit":"Quitter","presentationPlayer.overviewG":"Vue d'ensemble (G)","presentationPlayer.overview":"Vue d'ensemble","presentationEditor.front":"Devant","presentationEditor.back":"Derrière","countdown.timesUp":"Temps écoulé !","presentationEditor.grid":"Grille","presentationEditor.elements":"Éléments ({elements})","presentationPlayer.exitFullscreen":"Quitter le plein écran","presentationPlayer.fullscreen":"Plein écran","puppetPlayer.pause":"Pause","puppetPlayer.play":"Lire","puppetPlayer.stop":"Arrêter","puppetPlayer.previousScene":"Scène précédente","puppetPlayer.nextScene":"Scène suivante","puppetPlayer.unmute":"Réactiver le son","puppetPlayer.mute":"Couper le son","puppetPlayer.loop":"Boucle"},es:{"toolbar.addSlide":"Añadir diapositiva","toolbar.deleteSlide":"Eliminar diapositiva","toolbar.duplicateSlide":"Duplicar","toolbar.undo":"Deshacer","toolbar.redo":"Rehacer","toolbar.present":"Presentar","toolbar.export":"Exportar","toolbar.theme":"Tema","countdown.timeUp":"¡Se acabó el tiempo!","element.text":"Texto","element.image":"Imagen","element.shape":"Forma","element.chart":"Gráfico","element.table":"Tabla","element.code":"Código","element.diagram":"Diagrama","element.video":"Vídeo","element.icon":"Icono","element.addElement":"Añadir elemento","panel.slideProperties":"Propiedades de la diapositiva","panel.elementProperties":"Propiedades del elemento","panel.noSelection":"Seleccione una diapositiva o un elemento","panel.layout":"Diseño","panel.background":"Fondo","panel.transition":"Transición","panel.notes":"Notas del presentador","player.play":"Reproducir","player.pause":"Pausa","player.fullscreen":"Pantalla completa","player.exit":"Salir","player.slideOf":"de","layout.blank":"En blanco","layout.titleSlide":"Diapositiva de título","layout.titleContent":"Título + contenido","layout.twoColumn":"Dos columnas","layout.titleOnly":"Solo título","layout.sectionHeader":"Encabezado de sección","layout.comparison":"Comparación","layout.custom":"Personalizado","export.html":"Presentación HTML","export.ndp":".ndp.json","interactive.qna.title":"Preguntas y respuestas","interactive.qna.placeholder":"Haz una pregunta...","interactive.qna.anonymously":"Anónimamente","interactive.qna.anonymous":"Anónimo","interactive.qna.submit":"Enviar pregunta","interactive.qna.upvote":"Votar","interactive.qna.alreadyUpvoted":"Ya has votado","interactive.qna.markAnswered":"Marcar como respondida","interactive.qna.markUnanswered":"Marcar como no respondida","interactive.qna.questionOne":"pregunta","interactive.qna.questionMany":"preguntas","interactive.qna.closed":"El envío de preguntas está cerrado","interactive.qna.empty":"No hay preguntas. ¡Sé el primero!","interactive.qna.moreQuestions":"preguntas más","interactive.qna.justNow":"Ahora mismo","interactive.qna.minutesAgo":"hace {n} min","interactive.qna.hoursAgo":"hace {n} h","interactive.quiz.correctFeedback":"¡Respuesta correcta!","interactive.quiz.incorrectFeedback":"Lo sentimos, esa no es la respuesta correcta.","interactive.quiz.points":"pts","interactive.quiz.submit":"Confirmar respuesta","interactive.quiz.explanation":"Explicación:","interactive.poll.vote":"Emitir voto","interactive.poll.totalVotes":"Votos totales:","interactive.poll.thanks":"¡Gracias por tu voto!","panel.opacity":"Opacidad","panel.fontSize":"Tamaño de fuente","panel.deleteElement":"Eliminar elemento","panel.title":"Título","presentationEditor.bringToFront":"Traer al frente","presentationEditor.sendToBack":"Enviar al fondo","presentationEditor.duplicate":"Duplicar","presentationEditor.slideElements":"Elementos de la diapositiva","presentationEditor.noElementsYet":"Aún no hay elementos.","presentationPlayer.previous":"Anterior","presentationPlayer.next":"Siguiente","presentationPlayer.exitEsc":"Salir (Esc)","presentationPlayer.exit":"Salir","presentationPlayer.overviewG":"Vista general (G)","presentationPlayer.overview":"Vista general","presentationEditor.front":"Al frente","presentationEditor.back":"Al fondo","countdown.timesUp":"¡Se acabó el tiempo!","presentationEditor.grid":"Cuadrícula","presentationEditor.elements":"Elementos ({elements})","presentationPlayer.exitFullscreen":"Salir de pantalla completa","presentationPlayer.fullscreen":"Pantalla completa","puppetPlayer.pause":"Pausa","puppetPlayer.play":"Reproducir","puppetPlayer.stop":"Detener","puppetPlayer.previousScene":"Escena anterior","puppetPlayer.nextScene":"Escena siguiente","puppetPlayer.unmute":"Activar sonido","puppetPlayer.mute":"Silenciar","puppetPlayer.loop":"Repetir"}},Fe=d.createContext(null),Le=d.createContext(null);function We(){const{lang:e}=_.useNiceTranslation();return ve[e]?e:"en"}function Ae(e){const t=ve[e]??ve.en;return(n,i)=>t[n]??ve.en[n]??i??n}const Be=({lang:e="en",children:t})=>{const n=Ae(e);return l.jsx(Le.Provider,{value:e,children:l.jsx(Fe.Provider,{value:n,children:t})})};function ie(){const e=d.useContext(Fe),t=We(),n=d.useMemo(()=>Ae(t),[t]);return e??n}function _e(){const e=d.useContext(Le),t=We();return e??t}function Lt(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"Invalid JSON"}}if(typeof t!="object"||t===null)return{ok:!1,error:"Root must be an object"};const n=t;return n.version!=="1.0"?{ok:!1,error:`Unsupported version: ${String(n.version)}`}:!n.id||typeof n.id!="string"?{ok:!1,error:'Missing or invalid "id"'}:!n.title||typeof n.title!="string"?{ok:!1,error:'Missing or invalid "title"'}:Array.isArray(n.slides)?!n.theme||typeof n.theme!="object"?{ok:!1,error:'Missing "theme"'}:{ok:!0,document:t}:{ok:!1,error:'"slides" must be an array'}}function Ve(e,t=!1){return JSON.stringify(e,null,t?2:void 0)}class Se{constructor(t){this.undoStack=[],this.redoStack=[],this.listeners=new Set,this.maxHistory=100,this.doc=t??Se.createEmpty()}static createEmpty(t="Untitled Presentation"){const n=new Date().toISOString(),i={id:oe(),title:"Title Slide",layout:"titleSlide",background:{type:"solid",color:"#fff"},elements:[{id:oe(),type:"text",position:{x:10,y:30,width:80,height:20},content:{kind:"text",text:t,fontSize:48,fontWeight:"bold",textAlign:"center"}},{id:oe(),type:"text",position:{x:20,y:55,width:60,height:10},content:{kind:"text",text:"Subtitle",fontSize:24,textAlign:"center",fontColor:"#666666"}}]};return{version:"1.0",id:oe(),title:t,slideSize:{width:1920,height:1080},slides:[i],theme:{name:"NiceToDev",backgroundColor:"#f8f9fa",primaryColor:"#6366f1",secondaryColor:"#8b5cf6",accentColor:"#06b6d4",textColor:"#334155",headingColor:"#1e293b",fontFamily:"Inter, sans-serif",headingFontFamily:'"Plus Jakarta Sans", Inter, sans-serif',codeFontFamily:'"Fira Code", monospace'},metadata:{createdAt:n,updatedAt:n}}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.doc.metadata.updatedAt=new Date().toISOString(),this.listeners.forEach(t=>t())}pushUndo(t){this.undoStack.push({label:t,snapshot:JSON.stringify(this.doc)}),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack.length=0}undo(){const t=this.undoStack.pop();t&&(this.redoStack.push({label:"redo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(t.snapshot),this.notify())}redo(){const t=this.redoStack.pop();t&&(this.undoStack.push({label:"undo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(t.snapshot),this.notify())}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}getDocument(){return this.doc}getSlides(){return this.doc.slides}getSlide(t){return this.doc.slides.find(n=>n.id===t)}getTheme(){return this.doc.theme}loadDocument(t){this.pushUndo("loadDocument"),this.doc=JSON.parse(JSON.stringify(t)),this.notify()}addSlide(t,n="titleContent"){this.pushUndo("addSlide");const i={id:oe(),title:`Slide ${this.doc.slides.length+1}`,layout:n,background:{type:"solid",color:this.doc.theme.backgroundColor},elements:[]},o=t!==void 0?t+1:this.doc.slides.length;return this.doc.slides.splice(o,0,i),this.notify(),i}removeSlide(t){this.pushUndo("removeSlide"),this.doc.slides=this.doc.slides.filter(n=>n.id!==t),this.notify()}moveSlide(t,n){const i=this.doc.slides.findIndex(r=>r.id===t);if(i===-1||i===n)return;this.pushUndo("moveSlide");const[o]=this.doc.slides.splice(i,1);this.doc.slides.splice(n,0,o),this.notify()}duplicateSlide(t){const n=this.getSlide(t);if(!n)return null;this.pushUndo("duplicateSlide");const i=JSON.parse(JSON.stringify(n));i.id=oe(),i.title=`${n.title} (copy)`,i.elements.forEach(r=>{r.id=oe()});const o=this.doc.slides.findIndex(r=>r.id===t);return this.doc.slides.splice(o+1,0,i),this.notify(),i}updateSlide(t,n){const i=this.doc.slides.find(o=>o.id===t);i&&(this.pushUndo("updateSlide"),Object.assign(i,n),this.notify())}addElement(t,n){const i=this.doc.slides.find(r=>r.id===t);if(!i)return null;this.pushUndo("addElement");const o={...n,id:oe()};return i.elements.push(o),this.notify(),o}updateElement(t,n,i){const o=this.doc.slides.find(a=>a.id===t);if(!o)return;const r=o.elements.find(a=>a.id===n);r&&(this.pushUndo("updateElement"),Object.assign(r,i),this.notify())}removeElement(t,n){const i=this.doc.slides.find(o=>o.id===t);i&&(this.pushUndo("removeElement"),i.elements=i.elements.filter(o=>o.id!==n),this.notify())}moveElement(t,n,i){this.updateElement(t,n,{position:i})}setTheme(t){this.pushUndo("setTheme"),this.doc.theme={...t},this.notify()}}function oe(){return`ndp_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function Ue(e){const t=d.useRef(null);t.current||(t.current=new Se(e));const n=t.current,[,i]=d.useState(0),o=d.useCallback(()=>i(c=>c+1),[]),[r,a]=d.useState(0);d.useEffect(()=>n.subscribe(o),[n,o]);const s=n.getDocument();return d.useMemo(()=>({document:s,slides:s.slides,theme:s.theme,currentSlideIndex:r,currentSlide:s.slides[r],setCurrentSlideIndex:a,addSlide:(c,u)=>n.addSlide(c,u),removeSlide:c=>n.removeSlide(c),moveSlide:(c,u)=>n.moveSlide(c,u),duplicateSlide:c=>n.duplicateSlide(c),updateSlide:(c,u)=>n.updateSlide(c,u),addElement:(c,u)=>n.addElement(c,u),updateElement:(c,u,f)=>n.updateElement(c,u,f),removeElement:(c,u)=>n.removeElement(c,u),moveElement:(c,u,f)=>n.moveElement(c,u,f),setTheme:c=>n.setTheme(c),undo:()=>n.undo(),redo:()=>n.redo(),canUndo:n.canUndo(),canRedo:n.canRedo(),loadDocument:c=>n.loadDocument(c),model:n}),[s,n,r])}const Wt=["text","image","shape","chart","table","code","diagram","icon"],Bt=["blank","titleSlide","titleContent","twoColumn","titleOnly","sectionHeader","comparison"],we=({onAddElement:e,onAddSlide:t,onUndo:n,onRedo:i,canUndo:o=!1,canRedo:r=!1,onPresent:a,onExport:s,className:c})=>{const u=ie(),[f,h]=d.useState(!1),[y,p]=d.useState(!1),[m,g]=d.useState(!1),b=d.useCallback(x=>{e==null||e(x),h(!1)},[e]),S=d.useCallback(x=>{t==null||t(x),p(!1)},[t]);return l.jsxs("div",{className:`nice-pres-toolbar ${c??""}`,children:[l.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[l.jsxs(_.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>p(x=>!x),children:[l.jsx(_.NiceIcon,{name:"plus",size:14})," ",u("toolbar.addSlide")]}),y&&l.jsx("div",{className:"nice-pres-toolbar__dropdown",children:Bt.map(x=>l.jsx(_.NiceButton,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>S(x),children:u(`layout.${x}`)},x))})]}),l.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[l.jsxs(_.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>h(x=>!x),children:[l.jsx(_.NiceIcon,{name:"plus",size:14})," ",u("element.addElement")]}),f&&l.jsx("div",{className:"nice-pres-toolbar__dropdown",children:Wt.map(x=>l.jsx(_.NiceButton,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>b(x),children:u(`element.${x}`)},x))})]}),l.jsxs("div",{className:"nice-pres-toolbar__group",children:[l.jsx(_.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:n,disabled:!o,title:u("toolbar.undo"),children:"↩"}),l.jsx(_.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:i,disabled:!r,title:u("toolbar.redo"),children:"↪"})]}),l.jsx("div",{className:"nice-pres-toolbar__group",children:l.jsxs(_.NiceButton,{className:"nice-pres-toolbar__btn nice-pres-toolbar__btn--primary",variant:"primary",size:"sm",onClick:a,children:[l.jsx(_.NiceIcon,{name:"play",size:14})," ",u("toolbar.present")]})}),l.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[l.jsxs(_.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>g(x=>!x),children:[l.jsx(_.NiceIcon,{name:"download",size:14})," ",u("toolbar.export")]}),m&&l.jsxs("div",{className:"nice-pres-toolbar__dropdown",children:[l.jsx(_.NiceButton,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{s==null||s("ndp"),g(!1)},children:u("export.ndp")}),l.jsx(_.NiceButton,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{s==null||s("html"),g(!1)},children:u("export.html")})]})]})]})};process.env.NODE_ENV!=="production"&&(we.displayName="PresentationToolbar");function Te(e){return e.series&&e.series.length>0?e.series:e.datasets&&e.datasets.length>0?e.datasets.map(t=>({name:t.label??"",values:t.data,color:t.color??t.backgroundColor})):[]}function He(e,t,n){const i=e.data,o=e.options??{},r=o.colors??["#6366f1","#06b6d4","#10b981","#f59e0b","#ef4444","#8b5cf6"];switch(e.chartType){case"bar":return Ne(i,t,n,r,o);case"line":return Vt(i,t,n,r);case"pie":case"doughnut":return Ut(i,t,n,r,e.chartType==="doughnut");default:return Ne(i,t,n,r,o)}}function Ne(e,t,n,i,o){const r={top:20,right:20,bottom:40,left:50},a=t-r.left-r.right,s=n-r.top-r.bottom,c=Te(e),u=c.flatMap(T=>T.values),f=Math.max(...u,1),h=e.labels.length,y=c.length,p=a/h,m=p*.7/y,g=p*.15,b=[],S=[];for(let T=0;T<h;T++){const $=r.left+T*p;S.push(`<text x="${$+p/2}" y="${n-10}" text-anchor="middle" font-size="11" fill="#666">${$e(e.labels[T])}</text>`);for(let N=0;N<y;N++){const H=(c[N].values[T]??0)/f*s,A=$+g+N*m,q=r.top+s-H,W=c[N].color??i[N%i.length];b.push(`<rect x="${A}" y="${q}" width="${m}" height="${H}" fill="${W}" rx="2" />`)}}const x=[];for(let T=0;T<=4;T++){const $=Math.round(f/4*T),N=r.top+s-T/4*s;x.push(`<text x="${r.left-8}" y="${N+4}" text-anchor="end" font-size="10" fill="#999">${$}</text>`),o.showGrid!==!1&&x.push(`<line x1="${r.left}" y1="${N}" x2="${r.left+a}" y2="${N}" stroke="#eee" />`)}return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
85
+ </div>`}function Lt(e,t,n){const{position:i}=e,o=i.x/100*t.width,r=i.y/100*t.height,a=i.width/100*t.width,s=i.height/100*t.height,c=e.rotation?`transform: rotate(${e.rotation}deg);`:"",u=e.opacity!==void 0?`opacity: ${e.opacity};`:"",f=`position: absolute; left: ${o}px; top: ${r}px; width: ${a}px; height: ${s}px; ${c} ${u}`,h=e.content;switch(h.kind??h.type){case"text":{const p=h,m=p.fontSize??16,g=p.fontColor??n.textColor??"#000",b=p.fontFamily??n.fontFamily??"sans-serif",S=p.fontWeight??"normal",x=p.textAlign??"left";return`<div class="ndp-element ndp-element-text" style="${f} font-size: ${m}px; color: ${g}; font-family: ${b}; font-weight: ${S}; text-align: ${x};">${pe(p.text)}</div>`}case"image":{const p=h;return`<div class="ndp-element" style="${f}"><img src="${pe(p.src)}" alt="${pe(p.alt??"")}" style="width:100%;height:100%;object-fit:${p.objectFit??"contain"};border-radius:${p.borderRadius??0}px;" /></div>`}case"code":{const p=h;return`<div class="ndp-element" style="${f} background: ${p.theme==="light"?"#f5f5f5":"#1e1e1e"}; color: ${p.theme==="light"?"#333":"#d4d4d4"}; padding: var(--nice-space-4, 16px); border-radius: var(--nice-radius-lg, 8px); overflow: auto; font-family: monospace; font-size: ${p.fontSize??14}px; white-space: pre;">${pe(p.code)}</div>`}case"shape":{const p=h,m=p.fill??"#ccc";return`<div class="ndp-element" style="${f} background: ${m}; border-radius: ${p.shapeType==="ellipse"?"50%":"0"}; border: ${p.strokeWidth??0}px solid ${p.stroke??"transparent"};"></div>`}default:return`<div class="ndp-element" style="${f}"></div>`}}function pe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const Se={en:{"toolbar.addSlide":"Add Slide","toolbar.deleteSlide":"Delete Slide","toolbar.duplicateSlide":"Duplicate","toolbar.undo":"Undo","toolbar.redo":"Redo","toolbar.present":"Present","toolbar.export":"Export","toolbar.theme":"Theme","countdown.timeUp":"Time's up!","element.text":"Text","element.image":"Image","element.shape":"Shape","element.chart":"Chart","element.table":"Table","element.code":"Code","element.diagram":"Diagram","element.video":"Video","element.icon":"Icon","element.addElement":"Add Element","panel.slideProperties":"Slide Properties","panel.elementProperties":"Element Properties","panel.noSelection":"Select a slide or element","panel.layout":"Layout","panel.background":"Background","panel.transition":"Transition","panel.notes":"Speaker Notes","player.play":"Play","player.pause":"Pause","player.fullscreen":"Fullscreen","player.exit":"Exit","player.slideOf":"of","layout.blank":"Blank","layout.titleSlide":"Title Slide","layout.titleContent":"Title + Content","layout.twoColumn":"Two Column","layout.titleOnly":"Title Only","layout.sectionHeader":"Section Header","layout.comparison":"Comparison","layout.custom":"Custom","export.html":"HTML Presentation","export.ndp":".ndp.json","interactive.qna.title":"Questions & answers","interactive.qna.placeholder":"Ask a question...","interactive.qna.anonymously":"Anonymously","interactive.qna.anonymous":"Anonymous","interactive.qna.submit":"Submit question","interactive.qna.upvote":"Upvote","interactive.qna.alreadyUpvoted":"You already upvoted this","interactive.qna.markAnswered":"Mark as answered","interactive.qna.markUnanswered":"Mark as unanswered","interactive.qna.questionOne":"question","interactive.qna.questionMany":"questions","interactive.qna.closed":"Question submission is closed","interactive.qna.empty":"No questions yet. Be the first!","interactive.qna.moreQuestions":"more questions","interactive.qna.justNow":"Just now","interactive.qna.minutesAgo":"{n} min ago","interactive.qna.hoursAgo":"{n}h ago","interactive.quiz.correctFeedback":"Correct answer!","interactive.quiz.incorrectFeedback":"Sorry, that is not the correct answer.","interactive.quiz.points":"pts","interactive.quiz.submit":"Submit answer","interactive.quiz.explanation":"Explanation:","interactive.poll.vote":"Submit vote","interactive.poll.totalVotes":"Total votes:","interactive.poll.thanks":"Thanks for your vote!","panel.opacity":"Opacity","panel.fontSize":"Font Size","panel.deleteElement":"Delete Element","panel.title":"Title","presentationEditor.bringToFront":"Bring to front","presentationEditor.sendToBack":"Send to back","presentationEditor.duplicate":"Duplicate","presentationEditor.slideElements":"Slide elements","presentationEditor.noElementsYet":"No elements yet.","presentationPlayer.previous":"Previous","presentationPlayer.next":"Next","presentationPlayer.exitEsc":"Exit (Esc)","presentationPlayer.exit":"Exit","presentationPlayer.overviewG":"Overview (G)","presentationPlayer.overview":"Overview","presentationEditor.front":"Front","presentationEditor.back":"Back","countdown.timesUp":"Time's up!","presentationEditor.grid":"Grid","presentationEditor.elements":"Elements ({elements})","presentationPlayer.exitFullscreen":"Exit fullscreen","presentationPlayer.fullscreen":"Fullscreen","puppetPlayer.pause":"Pause","puppetPlayer.play":"Play","puppetPlayer.stop":"Stop","puppetPlayer.previousScene":"Previous Scene","puppetPlayer.nextScene":"Next Scene","puppetPlayer.unmute":"Unmute","puppetPlayer.mute":"Mute","puppetPlayer.loop":"Loop"},pl:{"toolbar.addSlide":"Dodaj slajd","toolbar.deleteSlide":"Usuń slajd","toolbar.duplicateSlide":"Duplikuj","toolbar.undo":"Cofnij","toolbar.redo":"Powtórz","toolbar.present":"Prezentuj","toolbar.export":"Eksport","toolbar.theme":"Motyw","countdown.timeUp":"Czas minął!","element.text":"Tekst","element.image":"Obraz","element.shape":"Kształt","element.chart":"Wykres","element.table":"Tabela","element.code":"Kod","element.diagram":"Diagram","element.video":"Wideo","element.icon":"Ikona","element.addElement":"Dodaj element","panel.slideProperties":"Właściwości slajdu","panel.elementProperties":"Właściwości elementu","panel.noSelection":"Wybierz slajd lub element","panel.layout":"Układ","panel.background":"Tło","panel.transition":"Przejście","panel.notes":"Notatki prelegenta","player.play":"Odtwórz","player.pause":"Pauza","player.fullscreen":"Pełny ekran","player.exit":"Wyjdź","player.slideOf":"z","layout.blank":"Puste","layout.titleSlide":"Slajd tytułowy","layout.titleContent":"Tytuł + treść","layout.twoColumn":"Dwie kolumny","layout.titleOnly":"Tylko tytuł","layout.sectionHeader":"Nagłówek sekcji","layout.comparison":"Porównanie","layout.custom":"Niestandardowy","export.html":"Prezentacja HTML","export.ndp":".ndp.json","interactive.qna.title":"Pytania i odpowiedzi","interactive.qna.placeholder":"Zadaj pytanie...","interactive.qna.anonymously":"Anonimowo","interactive.qna.anonymous":"Anonim","interactive.qna.submit":"Wyślij pytanie","interactive.qna.upvote":"Zagłosuj","interactive.qna.alreadyUpvoted":"Już zagłosowałeś","interactive.qna.markAnswered":"Oznacz jako odpowiedziane","interactive.qna.markUnanswered":"Oznacz jako nieodpowiedziane","interactive.qna.questionOne":"pytanie","interactive.qna.questionMany":"pytań","interactive.qna.closed":"Zadawanie pytań zostało zamknięte","interactive.qna.empty":"Brak pytań. Bądź pierwszy!","interactive.qna.moreQuestions":"więcej pytań","interactive.qna.justNow":"Teraz","interactive.qna.minutesAgo":"{n} min temu","interactive.qna.hoursAgo":"{n} godz. temu","interactive.quiz.correctFeedback":"Poprawna odpowiedź!","interactive.quiz.incorrectFeedback":"Niestety, to nie jest poprawna odpowiedź.","interactive.quiz.points":"pkt","interactive.quiz.submit":"Zatwierdź odpowiedź","interactive.quiz.explanation":"Wyjaśnienie:","interactive.poll.vote":"Oddaj głos","interactive.poll.totalVotes":"Łącznie głosów:","interactive.poll.thanks":"Dziękujemy za głos!","panel.opacity":"Krycie","panel.fontSize":"Rozmiar czcionki","panel.deleteElement":"Usuń element","panel.title":"Tytuł","presentationEditor.bringToFront":"Na wierzch","presentationEditor.sendToBack":"Na spód","presentationEditor.duplicate":"Duplikuj","presentationEditor.slideElements":"Elementy slajdu","presentationEditor.noElementsYet":"Brak elementów.","presentationPlayer.previous":"Poprzedni","presentationPlayer.next":"Następny","presentationPlayer.exitEsc":"Zakończ (Esc)","presentationPlayer.exit":"Zakończ","presentationPlayer.overviewG":"Przegląd (G)","presentationPlayer.overview":"Przegląd","presentationEditor.front":"Na wierzch","presentationEditor.back":"Na spód","countdown.timesUp":"Koniec czasu!","presentationEditor.grid":"Siatka","presentationEditor.elements":"Elementy ({elements})","presentationPlayer.exitFullscreen":"Zamknij pełny ekran","presentationPlayer.fullscreen":"Pełny ekran","puppetPlayer.pause":"Wstrzymaj","puppetPlayer.play":"Odtwórz","puppetPlayer.stop":"Zatrzymaj","puppetPlayer.previousScene":"Poprzednia scena","puppetPlayer.nextScene":"Następna scena","puppetPlayer.unmute":"Włącz dźwięk","puppetPlayer.mute":"Wycisz","puppetPlayer.loop":"Zapętl"},de:{"toolbar.addSlide":"Folie hinzufügen","toolbar.deleteSlide":"Folie löschen","toolbar.duplicateSlide":"Duplizieren","toolbar.undo":"Rückgängig","toolbar.redo":"Wiederholen","toolbar.present":"Präsentieren","toolbar.export":"Exportieren","toolbar.theme":"Design","countdown.timeUp":"Zeit abgelaufen!","element.text":"Text","element.image":"Bild","element.shape":"Form","element.chart":"Diagramm","element.table":"Tabelle","element.code":"Code","element.diagram":"Diagramm","element.video":"Video","element.icon":"Symbol","element.addElement":"Element hinzufügen","panel.slideProperties":"Folieneigenschaften","panel.elementProperties":"Elementeigenschaften","panel.noSelection":"Wählen Sie eine Folie oder ein Element","panel.layout":"Layout","panel.background":"Hintergrund","panel.transition":"Übergang","panel.notes":"Sprechernotizen","player.play":"Abspielen","player.pause":"Pause","player.fullscreen":"Vollbild","player.exit":"Beenden","player.slideOf":"von","layout.blank":"Leer","layout.titleSlide":"Titelfolie","layout.titleContent":"Titel + Inhalt","layout.twoColumn":"Zwei Spalten","layout.titleOnly":"Nur Titel","layout.sectionHeader":"Abschnittskopf","layout.comparison":"Vergleich","layout.custom":"Benutzerdefiniert","export.html":"HTML-Präsentation","export.ndp":".ndp.json","interactive.qna.title":"Fragen und Antworten","interactive.qna.placeholder":"Stellen Sie eine Frage...","interactive.qna.anonymously":"Anonym","interactive.qna.anonymous":"Anonym","interactive.qna.submit":"Frage senden","interactive.qna.upvote":"Zustimmen","interactive.qna.alreadyUpvoted":"Sie haben bereits abgestimmt","interactive.qna.markAnswered":"Als beantwortet markieren","interactive.qna.markUnanswered":"Als unbeantwortet markieren","interactive.qna.questionOne":"Frage","interactive.qna.questionMany":"Fragen","interactive.qna.closed":"Das Einreichen von Fragen ist geschlossen","interactive.qna.empty":"Noch keine Fragen. Seien Sie der Erste!","interactive.qna.moreQuestions":"weitere Fragen","interactive.qna.justNow":"Gerade eben","interactive.qna.minutesAgo":"vor {n} Min.","interactive.qna.hoursAgo":"vor {n} Std.","interactive.quiz.correctFeedback":"Richtige Antwort!","interactive.quiz.incorrectFeedback":"Leider ist das nicht die richtige Antwort.","interactive.quiz.points":"Pkt","interactive.quiz.submit":"Antwort bestätigen","interactive.quiz.explanation":"Erklärung:","interactive.poll.vote":"Stimme abgeben","interactive.poll.totalVotes":"Stimmen insgesamt:","interactive.poll.thanks":"Danke für Ihre Stimme!","panel.opacity":"Deckkraft","panel.fontSize":"Schriftgröße","panel.deleteElement":"Element löschen","panel.title":"Titel","presentationEditor.bringToFront":"In den Vordergrund","presentationEditor.sendToBack":"In den Hintergrund","presentationEditor.duplicate":"Duplizieren","presentationEditor.slideElements":"Folienelemente","presentationEditor.noElementsYet":"Noch keine Elemente.","presentationPlayer.previous":"Zurück","presentationPlayer.next":"Weiter","presentationPlayer.exitEsc":"Beenden (Esc)","presentationPlayer.exit":"Beenden","presentationPlayer.overviewG":"Übersicht (G)","presentationPlayer.overview":"Übersicht","presentationEditor.front":"Vorne","presentationEditor.back":"Hinten","countdown.timesUp":"Die Zeit ist um!","presentationEditor.grid":"Raster","presentationEditor.elements":"Elemente ({elements})","presentationPlayer.exitFullscreen":"Vollbild beenden","presentationPlayer.fullscreen":"Vollbild","puppetPlayer.pause":"Pause","puppetPlayer.play":"Abspielen","puppetPlayer.stop":"Stopp","puppetPlayer.previousScene":"Vorherige Szene","puppetPlayer.nextScene":"Nächste Szene","puppetPlayer.unmute":"Ton an","puppetPlayer.mute":"Stummschalten","puppetPlayer.loop":"Schleife"},fr:{"toolbar.addSlide":"Ajouter une diapositive","toolbar.deleteSlide":"Supprimer la diapositive","toolbar.duplicateSlide":"Dupliquer","toolbar.undo":"Annuler","toolbar.redo":"Rétablir","toolbar.present":"Présenter","toolbar.export":"Exporter","toolbar.theme":"Thème","countdown.timeUp":"Temps écoulé !","element.text":"Texte","element.image":"Image","element.shape":"Forme","element.chart":"Graphique","element.table":"Tableau","element.code":"Code","element.diagram":"Diagramme","element.video":"Vidéo","element.icon":"Icône","element.addElement":"Ajouter un élément","panel.slideProperties":"Propriétés de la diapositive","panel.elementProperties":"Propriétés de l'élément","panel.noSelection":"Sélectionnez une diapositive ou un élément","panel.layout":"Disposition","panel.background":"Arrière-plan","panel.transition":"Transition","panel.notes":"Notes du présentateur","player.play":"Lire","player.pause":"Pause","player.fullscreen":"Plein écran","player.exit":"Quitter","player.slideOf":"sur","layout.blank":"Vide","layout.titleSlide":"Diapositive de titre","layout.titleContent":"Titre + contenu","layout.twoColumn":"Deux colonnes","layout.titleOnly":"Titre seul","layout.sectionHeader":"En-tête de section","layout.comparison":"Comparaison","layout.custom":"Personnalisé","export.html":"Présentation HTML","export.ndp":".ndp.json","interactive.qna.title":"Questions et réponses","interactive.qna.placeholder":"Posez une question...","interactive.qna.anonymously":"Anonymement","interactive.qna.anonymous":"Anonyme","interactive.qna.submit":"Envoyer la question","interactive.qna.upvote":"Voter","interactive.qna.alreadyUpvoted":"Vous avez déjà voté","interactive.qna.markAnswered":"Marquer comme répondue","interactive.qna.markUnanswered":"Marquer comme non répondue","interactive.qna.questionOne":"question","interactive.qna.questionMany":"questions","interactive.qna.closed":"Les questions sont closes","interactive.qna.empty":"Aucune question. Soyez le premier !","interactive.qna.moreQuestions":"autres questions","interactive.qna.justNow":"À l'instant","interactive.qna.minutesAgo":"il y a {n} min","interactive.qna.hoursAgo":"il y a {n} h","interactive.quiz.correctFeedback":"Bonne réponse !","interactive.quiz.incorrectFeedback":"Désolé, ce n'est pas la bonne réponse.","interactive.quiz.points":"pts","interactive.quiz.submit":"Valider la réponse","interactive.quiz.explanation":"Explication :","interactive.poll.vote":"Voter","interactive.poll.totalVotes":"Total des votes :","interactive.poll.thanks":"Merci pour votre vote !","panel.opacity":"Opacité","panel.fontSize":"Taille de police","panel.deleteElement":"Supprimer l'élément","panel.title":"Titre","presentationEditor.bringToFront":"Mettre au premier plan","presentationEditor.sendToBack":"Mettre à l'arrière-plan","presentationEditor.duplicate":"Dupliquer","presentationEditor.slideElements":"Éléments de la diapositive","presentationEditor.noElementsYet":"Aucun élément pour l'instant.","presentationPlayer.previous":"Précédent","presentationPlayer.next":"Suivant","presentationPlayer.exitEsc":"Quitter (Échap)","presentationPlayer.exit":"Quitter","presentationPlayer.overviewG":"Vue d'ensemble (G)","presentationPlayer.overview":"Vue d'ensemble","presentationEditor.front":"Devant","presentationEditor.back":"Derrière","countdown.timesUp":"Temps écoulé !","presentationEditor.grid":"Grille","presentationEditor.elements":"Éléments ({elements})","presentationPlayer.exitFullscreen":"Quitter le plein écran","presentationPlayer.fullscreen":"Plein écran","puppetPlayer.pause":"Pause","puppetPlayer.play":"Lire","puppetPlayer.stop":"Arrêter","puppetPlayer.previousScene":"Scène précédente","puppetPlayer.nextScene":"Scène suivante","puppetPlayer.unmute":"Réactiver le son","puppetPlayer.mute":"Couper le son","puppetPlayer.loop":"Boucle"},es:{"toolbar.addSlide":"Añadir diapositiva","toolbar.deleteSlide":"Eliminar diapositiva","toolbar.duplicateSlide":"Duplicar","toolbar.undo":"Deshacer","toolbar.redo":"Rehacer","toolbar.present":"Presentar","toolbar.export":"Exportar","toolbar.theme":"Tema","countdown.timeUp":"¡Se acabó el tiempo!","element.text":"Texto","element.image":"Imagen","element.shape":"Forma","element.chart":"Gráfico","element.table":"Tabla","element.code":"Código","element.diagram":"Diagrama","element.video":"Vídeo","element.icon":"Icono","element.addElement":"Añadir elemento","panel.slideProperties":"Propiedades de la diapositiva","panel.elementProperties":"Propiedades del elemento","panel.noSelection":"Seleccione una diapositiva o un elemento","panel.layout":"Diseño","panel.background":"Fondo","panel.transition":"Transición","panel.notes":"Notas del presentador","player.play":"Reproducir","player.pause":"Pausa","player.fullscreen":"Pantalla completa","player.exit":"Salir","player.slideOf":"de","layout.blank":"En blanco","layout.titleSlide":"Diapositiva de título","layout.titleContent":"Título + contenido","layout.twoColumn":"Dos columnas","layout.titleOnly":"Solo título","layout.sectionHeader":"Encabezado de sección","layout.comparison":"Comparación","layout.custom":"Personalizado","export.html":"Presentación HTML","export.ndp":".ndp.json","interactive.qna.title":"Preguntas y respuestas","interactive.qna.placeholder":"Haz una pregunta...","interactive.qna.anonymously":"Anónimamente","interactive.qna.anonymous":"Anónimo","interactive.qna.submit":"Enviar pregunta","interactive.qna.upvote":"Votar","interactive.qna.alreadyUpvoted":"Ya has votado","interactive.qna.markAnswered":"Marcar como respondida","interactive.qna.markUnanswered":"Marcar como no respondida","interactive.qna.questionOne":"pregunta","interactive.qna.questionMany":"preguntas","interactive.qna.closed":"El envío de preguntas está cerrado","interactive.qna.empty":"No hay preguntas. ¡Sé el primero!","interactive.qna.moreQuestions":"preguntas más","interactive.qna.justNow":"Ahora mismo","interactive.qna.minutesAgo":"hace {n} min","interactive.qna.hoursAgo":"hace {n} h","interactive.quiz.correctFeedback":"¡Respuesta correcta!","interactive.quiz.incorrectFeedback":"Lo sentimos, esa no es la respuesta correcta.","interactive.quiz.points":"pts","interactive.quiz.submit":"Confirmar respuesta","interactive.quiz.explanation":"Explicación:","interactive.poll.vote":"Emitir voto","interactive.poll.totalVotes":"Votos totales:","interactive.poll.thanks":"¡Gracias por tu voto!","panel.opacity":"Opacidad","panel.fontSize":"Tamaño de fuente","panel.deleteElement":"Eliminar elemento","panel.title":"Título","presentationEditor.bringToFront":"Traer al frente","presentationEditor.sendToBack":"Enviar al fondo","presentationEditor.duplicate":"Duplicar","presentationEditor.slideElements":"Elementos de la diapositiva","presentationEditor.noElementsYet":"Aún no hay elementos.","presentationPlayer.previous":"Anterior","presentationPlayer.next":"Siguiente","presentationPlayer.exitEsc":"Salir (Esc)","presentationPlayer.exit":"Salir","presentationPlayer.overviewG":"Vista general (G)","presentationPlayer.overview":"Vista general","presentationEditor.front":"Al frente","presentationEditor.back":"Al fondo","countdown.timesUp":"¡Se acabó el tiempo!","presentationEditor.grid":"Cuadrícula","presentationEditor.elements":"Elementos ({elements})","presentationPlayer.exitFullscreen":"Salir de pantalla completa","presentationPlayer.fullscreen":"Pantalla completa","puppetPlayer.pause":"Pausa","puppetPlayer.play":"Reproducir","puppetPlayer.stop":"Detener","puppetPlayer.previousScene":"Escena anterior","puppetPlayer.nextScene":"Escena siguiente","puppetPlayer.unmute":"Activar sonido","puppetPlayer.mute":"Silenciar","puppetPlayer.loop":"Repetir"}},Le=d.createContext(null),We=d.createContext(null);function Be(){const{lang:e}=T.useNiceTranslation();return Se[e]?e:"en"}function _e(e){const t=Se[e]??Se.en;return(n,i)=>t[n]??Se.en[n]??i??n}const Ue=({lang:e="en",children:t})=>{const n=_e(e);return l.jsx(We.Provider,{value:e,children:l.jsx(Le.Provider,{value:n,children:t})})};function ne(){const e=d.useContext(Le),t=Be(),n=d.useMemo(()=>_e(t),[t]);return e??n}function Te(){const e=d.useContext(We),t=Be();return e??t}function Wt(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"Invalid JSON"}}if(typeof t!="object"||t===null)return{ok:!1,error:"Root must be an object"};const n=t;return n.version!=="1.0"?{ok:!1,error:`Unsupported version: ${String(n.version)}`}:!n.id||typeof n.id!="string"?{ok:!1,error:'Missing or invalid "id"'}:!n.title||typeof n.title!="string"?{ok:!1,error:'Missing or invalid "title"'}:Array.isArray(n.slides)?!n.theme||typeof n.theme!="object"?{ok:!1,error:'Missing "theme"'}:{ok:!0,document:t}:{ok:!1,error:'"slides" must be an array'}}function Ve(e,t=!1){return JSON.stringify(e,null,t?2:void 0)}class we{constructor(t){this.undoStack=[],this.redoStack=[],this.listeners=new Set,this.maxHistory=100,this.doc=t??we.createEmpty()}static createEmpty(t="Untitled Presentation"){const n=new Date().toISOString(),i={id:oe(),title:"Title Slide",layout:"titleSlide",background:{type:"solid",color:"#fff"},elements:[{id:oe(),type:"text",position:{x:10,y:30,width:80,height:20},content:{kind:"text",text:t,fontSize:48,fontWeight:"bold",textAlign:"center"}},{id:oe(),type:"text",position:{x:20,y:55,width:60,height:10},content:{kind:"text",text:"Subtitle",fontSize:24,textAlign:"center",fontColor:"#666666"}}]};return{version:"1.0",id:oe(),title:t,slideSize:{width:1920,height:1080},slides:[i],theme:{name:"NiceToDev",backgroundColor:"#f8f9fa",primaryColor:"#6366f1",secondaryColor:"#8b5cf6",accentColor:"#06b6d4",textColor:"#334155",headingColor:"#1e293b",fontFamily:"Inter, sans-serif",headingFontFamily:'"Plus Jakarta Sans", Inter, sans-serif',codeFontFamily:'"Fira Code", monospace'},metadata:{createdAt:n,updatedAt:n}}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.doc.metadata.updatedAt=new Date().toISOString(),this.listeners.forEach(t=>t())}pushUndo(t){this.undoStack.push({label:t,snapshot:JSON.stringify(this.doc)}),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack.length=0}undo(){const t=this.undoStack.pop();t&&(this.redoStack.push({label:"redo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(t.snapshot),this.notify())}redo(){const t=this.redoStack.pop();t&&(this.undoStack.push({label:"undo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(t.snapshot),this.notify())}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}getDocument(){return this.doc}getSlides(){return this.doc.slides}getSlide(t){return this.doc.slides.find(n=>n.id===t)}getTheme(){return this.doc.theme}loadDocument(t){this.pushUndo("loadDocument"),this.doc=JSON.parse(JSON.stringify(t)),this.notify()}addSlide(t,n="titleContent"){this.pushUndo("addSlide");const i={id:oe(),title:`Slide ${this.doc.slides.length+1}`,layout:n,background:{type:"solid",color:this.doc.theme.backgroundColor},elements:[]},o=t!==void 0?t+1:this.doc.slides.length;return this.doc.slides.splice(o,0,i),this.notify(),i}removeSlide(t){this.pushUndo("removeSlide"),this.doc.slides=this.doc.slides.filter(n=>n.id!==t),this.notify()}moveSlide(t,n){const i=this.doc.slides.findIndex(r=>r.id===t);if(i===-1||i===n)return;this.pushUndo("moveSlide");const[o]=this.doc.slides.splice(i,1);this.doc.slides.splice(n,0,o),this.notify()}duplicateSlide(t){const n=this.getSlide(t);if(!n)return null;this.pushUndo("duplicateSlide");const i=JSON.parse(JSON.stringify(n));i.id=oe(),i.title=`${n.title} (copy)`,i.elements.forEach(r=>{r.id=oe()});const o=this.doc.slides.findIndex(r=>r.id===t);return this.doc.slides.splice(o+1,0,i),this.notify(),i}updateSlide(t,n){const i=this.doc.slides.find(o=>o.id===t);i&&(this.pushUndo("updateSlide"),Object.assign(i,n),this.notify())}addElement(t,n){const i=this.doc.slides.find(r=>r.id===t);if(!i)return null;this.pushUndo("addElement");const o={...n,id:oe()};return i.elements.push(o),this.notify(),o}updateElement(t,n,i){const o=this.doc.slides.find(a=>a.id===t);if(!o)return;const r=o.elements.find(a=>a.id===n);r&&(this.pushUndo("updateElement"),Object.assign(r,i),this.notify())}removeElement(t,n){const i=this.doc.slides.find(o=>o.id===t);i&&(this.pushUndo("removeElement"),i.elements=i.elements.filter(o=>o.id!==n),this.notify())}moveElement(t,n,i){this.updateElement(t,n,{position:i})}setTheme(t){this.pushUndo("setTheme"),this.doc.theme={...t},this.notify()}}function oe(){return`ndp_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function He(e){const t=d.useRef(null);t.current||(t.current=new we(e));const n=t.current,[,i]=d.useState(0),o=d.useCallback(()=>i(c=>c+1),[]),[r,a]=d.useState(0);d.useEffect(()=>n.subscribe(o),[n,o]);const s=n.getDocument();return d.useMemo(()=>({document:s,slides:s.slides,theme:s.theme,currentSlideIndex:r,currentSlide:s.slides[r],setCurrentSlideIndex:a,addSlide:(c,u)=>n.addSlide(c,u),removeSlide:c=>n.removeSlide(c),moveSlide:(c,u)=>n.moveSlide(c,u),duplicateSlide:c=>n.duplicateSlide(c),updateSlide:(c,u)=>n.updateSlide(c,u),addElement:(c,u)=>n.addElement(c,u),updateElement:(c,u,f)=>n.updateElement(c,u,f),removeElement:(c,u)=>n.removeElement(c,u),moveElement:(c,u,f)=>n.moveElement(c,u,f),setTheme:c=>n.setTheme(c),undo:()=>n.undo(),redo:()=>n.redo(),canUndo:n.canUndo(),canRedo:n.canRedo(),loadDocument:c=>n.loadDocument(c),model:n}),[s,n,r])}const Bt=["text","image","shape","chart","table","code","diagram","icon"],Ut=["blank","titleSlide","titleContent","twoColumn","titleOnly","sectionHeader","comparison"],ke=({onAddElement:e,onAddSlide:t,onUndo:n,onRedo:i,canUndo:o=!1,canRedo:r=!1,onPresent:a,onExport:s,className:c})=>{const u=ne(),[f,h]=d.useState(!1),[y,p]=d.useState(!1),[m,g]=d.useState(!1),b=d.useCallback(x=>{e==null||e(x),h(!1)},[e]),S=d.useCallback(x=>{t==null||t(x),p(!1)},[t]);return l.jsxs("div",{className:`nice-pres-toolbar ${c??""}`,children:[l.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[l.jsxs(T.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>p(x=>!x),children:[l.jsx(T.NiceIcon,{name:"plus",size:14})," ",u("toolbar.addSlide")]}),y&&l.jsx("div",{className:"nice-pres-toolbar__dropdown",children:Ut.map(x=>l.jsx(T.NiceButton,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>S(x),children:u(`layout.${x}`)},x))})]}),l.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[l.jsxs(T.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>h(x=>!x),children:[l.jsx(T.NiceIcon,{name:"plus",size:14})," ",u("element.addElement")]}),f&&l.jsx("div",{className:"nice-pres-toolbar__dropdown",children:Bt.map(x=>l.jsx(T.NiceButton,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>b(x),children:u(`element.${x}`)},x))})]}),l.jsxs("div",{className:"nice-pres-toolbar__group",children:[l.jsx(T.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:n,disabled:!o,title:u("toolbar.undo"),children:"↩"}),l.jsx(T.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:i,disabled:!r,title:u("toolbar.redo"),children:"↪"})]}),l.jsx("div",{className:"nice-pres-toolbar__group",children:l.jsxs(T.NiceButton,{className:"nice-pres-toolbar__btn nice-pres-toolbar__btn--primary",variant:"primary",size:"sm",onClick:a,children:[l.jsx(T.NiceIcon,{name:"play",size:14})," ",u("toolbar.present")]})}),l.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[l.jsxs(T.NiceButton,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>g(x=>!x),children:[l.jsx(T.NiceIcon,{name:"download",size:14})," ",u("toolbar.export")]}),m&&l.jsxs("div",{className:"nice-pres-toolbar__dropdown",children:[l.jsx(T.NiceButton,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{s==null||s("ndp"),g(!1)},children:u("export.ndp")}),l.jsx(T.NiceButton,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{s==null||s("html"),g(!1)},children:u("export.html")})]})]})]})};process.env.NODE_ENV!=="production"&&(ke.displayName="PresentationToolbar");function $e(e){return e.series&&e.series.length>0?e.series:e.datasets&&e.datasets.length>0?e.datasets.map(t=>({name:t.label??"",values:t.data,color:t.color??t.backgroundColor})):[]}function Qe(e,t,n){const i=e.data,o=e.options??{},r=o.colors??["#6366f1","#06b6d4","#10b981","#f59e0b","#ef4444","#8b5cf6"];switch(e.chartType){case"bar":return Re(i,t,n,r,o);case"line":return Vt(i,t,n,r);case"pie":case"doughnut":return Ht(i,t,n,r,e.chartType==="doughnut");default:return Re(i,t,n,r,o)}}function Re(e,t,n,i,o){const r={top:20,right:20,bottom:40,left:50},a=t-r.left-r.right,s=n-r.top-r.bottom,c=$e(e),u=c.flatMap($=>$.values),f=Math.max(...u,1),h=e.labels.length,y=c.length,p=a/h,m=p*.7/y,g=p*.15,b=[],S=[];for(let $=0;$<h;$++){const E=r.left+$*p;S.push(`<text x="${E+p/2}" y="${n-10}" text-anchor="middle" font-size="11" fill="#666">${Ee(e.labels[$])}</text>`);for(let R=0;R<y;R++){const V=(c[R].values[$]??0)/f*s,_=E+g+R*m,D=r.top+s-V,L=c[R].color??i[R%i.length];b.push(`<rect x="${_}" y="${D}" width="${m}" height="${V}" fill="${L}" rx="2" />`)}}const x=[];for(let $=0;$<=4;$++){const E=Math.round(f/4*$),R=r.top+s-$/4*s;x.push(`<text x="${r.left-8}" y="${R+4}" text-anchor="end" font-size="10" fill="#999">${E}</text>`),o.showGrid!==!1&&x.push(`<line x1="${r.left}" y1="${R}" x2="${r.left+a}" y2="${R}" stroke="#eee" />`)}return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
86
86
  ${x.join(`
87
87
  `)}
88
88
  ${b.join(`
89
89
  `)}
90
90
  ${S.join(`
91
91
  `)}
92
- </svg>`}function Vt(e,t,n,i,o){const r={top:20,right:20,bottom:40,left:50},a=t-r.left-r.right,s=n-r.top-r.bottom,c=Te(e),u=c.flatMap(g=>g.values),f=Math.max(...u,1),h=e.labels.length,y=a/Math.max(h-1,1),p=[];for(let g=0;g<c.length;g++){const b=c[g].color??i[g%i.length],S=c[g].values.map((x,T)=>{const $=r.left+T*y,N=r.top+s-x/f*s;return`${$},${N}`});p.push(`<polyline points="${S.join(" ")}" fill="none" stroke="${b}" stroke-width="2" />`),c[g].values.forEach((x,T)=>{const $=r.left+T*y,N=r.top+s-x/f*s;p.push(`<circle cx="${$}" cy="${N}" r="3" fill="${b}" />`)})}const m=e.labels.map((g,b)=>`<text x="${r.left+b*y}" y="${n-10}" text-anchor="middle" font-size="11" fill="#666">${$e(g)}</text>`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
92
+ </svg>`}function Vt(e,t,n,i,o){const r={top:20,right:20,bottom:40,left:50},a=t-r.left-r.right,s=n-r.top-r.bottom,c=$e(e),u=c.flatMap(g=>g.values),f=Math.max(...u,1),h=e.labels.length,y=a/Math.max(h-1,1),p=[];for(let g=0;g<c.length;g++){const b=c[g].color??i[g%i.length],S=c[g].values.map((x,$)=>{const E=r.left+$*y,R=r.top+s-x/f*s;return`${E},${R}`});p.push(`<polyline points="${S.join(" ")}" fill="none" stroke="${b}" stroke-width="2" />`),c[g].values.forEach((x,$)=>{const E=r.left+$*y,R=r.top+s-x/f*s;p.push(`<circle cx="${E}" cy="${R}" r="3" fill="${b}" />`)})}const m=e.labels.map((g,b)=>`<text x="${r.left+b*y}" y="${n-10}" text-anchor="middle" font-size="11" fill="#666">${Ee(g)}</text>`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
93
93
  ${p.join(`
94
94
  `)}
95
95
  ${m.join(`
96
96
  `)}
97
- </svg>`}function Ut(e,t,n,i,o){const r=Te(e);if(r.length===0)return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" />`;const a=r[0].values,s=a.reduce((m,g)=>m+g,0)||1,c=t/2,u=n/2,f=Math.min(t,n)*.38,h=o?f*.55:0,y=[];let p=-Math.PI/2;return a.forEach((m,g)=>{const b=m/s*Math.PI*2,S=p+b,x=b>Math.PI?1:0,T=i[g%i.length],$=c+f*Math.cos(p),N=u+f*Math.sin(p),C=c+f*Math.cos(S),H=u+f*Math.sin(S);if(o){const K=c+h*Math.cos(p),I=u+h*Math.sin(p),P=c+h*Math.cos(S),v=u+h*Math.sin(S);y.push(`<path d="M ${$} ${N} A ${f} ${f} 0 ${x} 1 ${C} ${H} L ${P} ${v} A ${h} ${h} 0 ${x} 0 ${K} ${I} Z" fill="${T}" />`)}else y.push(`<path d="M ${c} ${u} L ${$} ${N} A ${f} ${f} 0 ${x} 1 ${C} ${H} Z" fill="${T}" />`);const A=p+b/2,q=f*1.15,W=c+q*Math.cos(A),Y=u+q*Math.sin(A);e.labels[g]&&y.push(`<text x="${W}" y="${Y}" text-anchor="middle" font-size="11" fill="#444">${$e(e.labels[g])}</text>`),p=S}),`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
97
+ </svg>`}function Ht(e,t,n,i,o){const r=$e(e);if(r.length===0)return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" />`;const a=r[0].values,s=a.reduce((m,g)=>m+g,0)||1,c=t/2,u=n/2,f=Math.min(t,n)*.38,h=o?f*.55:0,y=[];let p=-Math.PI/2;return a.forEach((m,g)=>{const b=m/s*Math.PI*2,S=p+b,x=b>Math.PI?1:0,$=i[g%i.length],E=c+f*Math.cos(p),R=u+f*Math.sin(p),z=c+f*Math.cos(S),V=u+f*Math.sin(S);if(o){const G=c+h*Math.cos(p),I=u+h*Math.sin(p),N=c+h*Math.cos(S),v=u+h*Math.sin(S);y.push(`<path d="M ${E} ${R} A ${f} ${f} 0 ${x} 1 ${z} ${V} L ${N} ${v} A ${h} ${h} 0 ${x} 0 ${G} ${I} Z" fill="${$}" />`)}else y.push(`<path d="M ${c} ${u} L ${E} ${R} A ${f} ${f} 0 ${x} 1 ${z} ${V} Z" fill="${$}" />`);const _=p+b/2,D=f*1.15,L=c+D*Math.cos(_),K=u+D*Math.sin(_);e.labels[g]&&y.push(`<text x="${L}" y="${K}" text-anchor="middle" font-size="11" fill="#444">${Ee(e.labels[g])}</text>`),p=S}),`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
98
98
  ${y.join(`
99
99
  `)}
100
- </svg>`}function $e(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const ae=({slide:e,slideSize:t,theme:n,scale:i=1,selectedElementId:o,onSelectElement:r,onElementDrag:a,onElementResize:s,onElementRotate:c,interactive:u=!1,showGrid:f=!1,gridSnap:h=0,className:y})=>{const[p,m]=d.useState(null),[g,b]=d.useState(null),S=d.useCallback(A=>h>0?Math.round(A/h)*h:A,[h]),x=d.useMemo(()=>{const A=e.background;if(A.type==="gradient"&&A.gradientStops){const q=A.gradientStops.map(W=>`${W.color} ${W.position*100}%`).join(", ");return{background:`linear-gradient(${A.gradientDirection??180}deg, ${q})`}}return A.type==="image"&&A.imageUrl?{backgroundImage:`url(${A.imageUrl})`,backgroundSize:A.imageFit??"cover",backgroundPosition:"center",backgroundColor:A.color??n.backgroundColor}:{backgroundColor:A.color??n.backgroundColor}},[e.background,n.backgroundColor]),T=d.useCallback((A,q)=>{!u||q.locked||(A.stopPropagation(),r==null||r(q.id),m({id:q.id,startX:A.clientX,startY:A.clientY,elStartX:q.position.x,elStartY:q.position.y}))},[u,r]),$=d.useCallback(A=>{if(p&&a){const q=(A.clientX-p.startX)/i,W=(A.clientY-p.startY)/i,Y=S(p.elStartX+q/t.width*100),K=S(p.elStartY+W/t.height*100);a(p.id,Y,K)}if(g&&s){const q=(A.clientX-g.startX)/i/t.width*100,W=(A.clientY-g.startY)/i/t.height*100,Y=g.elPos;let{x:K,y:I,width:P,height:v}=Y;const D=g.handle;D.includes("e")&&(P=S(Math.max(2,Y.width+q))),D.includes("w")&&(P=S(Math.max(2,Y.width-q)),K=S(Y.x+(Y.width-P))),D.includes("s")&&(v=S(Math.max(2,Y.height+W))),D.includes("n")&&(v=S(Math.max(2,Y.height-W)),I=S(Y.y+(Y.height-v))),s(g.id,P,v,K,I)}},[p,g,a,s,i,t,S]),N=d.useCallback(()=>{m(null),b(null)},[]),C=d.useCallback((A,q,W)=>{u&&(A.stopPropagation(),A.preventDefault(),b({id:q.id,handle:W,startX:A.clientX,startY:A.clientY,elPos:{...q.position}}))},[u]),H=d.useCallback(A=>{A.target.classList.contains("nice-slide-canvas__surface")&&(r==null||r(null))},[r]);return l.jsxs("div",{className:`nice-slide-canvas ${y??""}`,style:{width:t.width*i,height:t.height*i,...x,color:n.textColor,fontFamily:n.fontFamily},onMouseMove:$,onMouseUp:N,onMouseLeave:N,onClick:H,children:[l.jsx("div",{className:"nice-slide-canvas__surface"}),f&&l.jsx("svg",{style:{position:"absolute",inset:0,width:"100%",height:"100%",pointerEvents:"none",opacity:.15},children:Array.from({length:9},(A,q)=>{const W=(q+1)*10;return l.jsxs(d.Fragment,{children:[l.jsx("line",{x1:`${W}%`,y1:"0",x2:`${W}%`,y2:"100%",stroke:"var(--nice-text-secondary, #666)",strokeWidth:"0.5"}),l.jsx("line",{x1:"0",y1:`${W}%`,x2:"100%",y2:`${W}%`,stroke:"var(--nice-text-secondary, #666)",strokeWidth:"0.5"})]},q)})}),[...e.elements].sort((A,q)=>(A.zIndex??0)-(q.zIndex??0)).map(A=>l.jsx(Gt,{element:A,slideSize:t,scale:i,theme:n,isSelected:o===A.id,onMouseDown:q=>T(q,A),onResizeStart:(q,W)=>C(q,A,W),interactive:u},A.id))]})};process.env.NODE_ENV!=="production"&&(ae.displayName="SlideCanvas");const Ht=["nw","n","ne","e","se","s","sw","w"],Qt={nw:"nwse-resize",n:"ns-resize",ne:"nesw-resize",e:"ew-resize",se:"nwse-resize",s:"ns-resize",sw:"nesw-resize",w:"ew-resize"},Yt={nw:{top:-4,left:-4},n:{top:-4,left:"50%",marginLeft:-4},ne:{top:-4,right:-4},e:{top:"50%",right:-4,marginTop:-4},se:{bottom:-4,right:-4},s:{bottom:-4,left:"50%",marginLeft:-4},sw:{bottom:-4,left:-4},w:{top:"50%",left:-4,marginTop:-4}},Gt=({element:e,slideSize:t,scale:n,theme:i,isSelected:o,onMouseDown:r,onResizeStart:a,interactive:s})=>{const{position:c,content:u,rotation:f,opacity:h}=e,y=c.x/100*t.width*n,p=c.y/100*t.height*n,m=c.width/100*t.width*n,g=c.height/100*t.height*n,b={position:"absolute",left:y,top:p,width:m,height:g,opacity:h??1,transform:f?`rotate(${f}deg)`:void 0,cursor:s&&!e.locked?"move":"default",outline:o?"2px solid var(--nice-primary, #2196f3)":void 0,outlineOffset:o?2:void 0,zIndex:e.zIndex??0};return l.jsxs("div",{style:b,onMouseDown:r,children:[Kt(u,m,g,n,i),o&&s&&!e.locked&&Ht.map(S=>l.jsx("div",{style:{position:"absolute",width:8,height:8,background:"var(--nice-primary, #2196f3)",border:"1px solid var(--nice-bg, #FFF)",borderRadius:2,cursor:Qt[S],zIndex:10,...Yt[S]},onMouseDown:x=>a(x,S)},S))]})};function Kt(e,t,n,i,o){switch(e.kind){case"text":{const r=e;return l.jsx("div",{style:{width:"100%",height:"100%",fontSize:(r.fontSize??16)*i,fontFamily:r.fontFamily??o.fontFamily,fontWeight:r.fontWeight??"normal",color:r.fontColor??o.textColor,textAlign:r.textAlign??"left",lineHeight:r.lineHeight??1.4,whiteSpace:"pre-wrap",wordBreak:"break-word",overflow:"hidden"},children:r.text})}case"image":{const r=e;return l.jsx("img",{src:r.src,alt:r.alt??"",style:{width:"100%",height:"100%",objectFit:r.objectFit??"contain",borderRadius:r.borderRadius??0,boxShadow:r.shadow?"0 4px 16px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))":void 0}})}case"shape":{const r=e;return l.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:r.fill??"var(--nice-border, #ccc)",border:r.strokeWidth?`${r.strokeWidth}px solid ${r.stroke??"var(--nice-text, #333)"}`:void 0,borderRadius:r.shapeType==="ellipse"?"50%":0}})}case"code":{const r=e;return l.jsx("pre",{style:{width:"100%",height:"100%",margin:0,padding:12*i,fontSize:(r.fontSize??14)*i,fontFamily:o.codeFontFamily??"monospace",backgroundColor:r.theme==="light"?"var(--nice-bg-secondary, #f5f5f5)":"var(--nice-bg, #1e1e1e)",color:r.theme==="light"?"var(--nice-text, #333)":"var(--nice-text, #d4d4d4)",borderRadius:8,overflow:"auto",whiteSpace:"pre"},children:l.jsx("code",{children:r.code})})}case"chart":{const a=He(e,t,n);return l.jsx("div",{style:{width:"100%",height:"100%"},dangerouslySetInnerHTML:{__html:a}})}case"table":{const r=e;return l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14*i},children:[l.jsx("thead",{children:l.jsx("tr",{children:r.headers.map((a,s)=>l.jsx("th",{style:{padding:`${6*i}px ${8*i}px`,backgroundColor:r.headerBg??o.primaryColor,color:r.headerColor??"var(--nice-color-white, #fff)",textAlign:"left",borderBottom:`2px solid ${r.borderColor??"var(--nice-border, #ddd)"}`},children:a},s))})}),l.jsx("tbody",{children:r.rows.map((a,s)=>l.jsx("tr",{style:{backgroundColor:r.stripedRows&&s%2===1?"var(--nice-overlay-3, rgba(0, 0, 0, 0.03))":void 0},children:a.map((c,u)=>l.jsx("td",{style:{padding:`${4*i}px ${8*i}px`,borderBottom:`1px solid ${r.borderColor??"var(--nice-border, #eee)"}`},children:c},u))},s))})]})}default:return l.jsx("div",{style:{width:"100%",height:"100%",background:"var(--nice-bg-secondary, #f0f0f0)",borderRadius:4}})}}const Xt=["blank","titleSlide","titleContent","twoColumn","titleOnly","sectionHeader","comparison","custom"],ke=({slide:e,selectedElement:t,onSlideChange:n,onElementChange:i,onRemoveElement:o,className:r})=>{const a=ie();return e?t&&e?l.jsxs("div",{className:`nice-pres-panel ${r??""}`,children:[l.jsx("h3",{className:"nice-pres-panel__title",children:a("panel.elementProperties")}),l.jsxs("div",{className:"nice-pres-panel__row",children:[l.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["X (%)",l.jsx(_.NiceNumberInput,{value:Math.round(t.position.x*10)/10,min:0,max:100,step:.5,onChange:s=>i==null?void 0:i(e.id,t.id,{position:{...t.position,x:s??0}}),className:"nice-pres-panel__input"})]}),l.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["Y (%)",l.jsx(_.NiceNumberInput,{value:Math.round(t.position.y*10)/10,min:0,max:100,step:.5,onChange:s=>i==null?void 0:i(e.id,t.id,{position:{...t.position,y:s??0}}),className:"nice-pres-panel__input"})]})]}),l.jsxs("div",{className:"nice-pres-panel__row",children:[l.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["W (%)",l.jsx(_.NiceNumberInput,{value:Math.round(t.position.width*10)/10,min:1,max:100,step:.5,onChange:s=>i==null?void 0:i(e.id,t.id,{position:{...t.position,width:s??1}}),className:"nice-pres-panel__input"})]}),l.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["H (%)",l.jsx(_.NiceNumberInput,{value:Math.round(t.position.height*10)/10,min:1,max:100,step:.5,onChange:s=>i==null?void 0:i(e.id,t.id,{position:{...t.position,height:s??1}}),className:"nice-pres-panel__input"})]})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.opacity","Opacity"),l.jsx(_.NiceSlider,{min:0,max:1,step:.05,value:t.opacity??1,onChange:s=>i==null?void 0:i(e.id,t.id,{opacity:s})})]}),t.content.kind==="text"&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"nice-pres-panel__label",children:[a("element.text"),l.jsx("textarea",{value:t.content.text,onChange:s=>i==null?void 0:i(e.id,t.id,{content:{...t.content,text:s.target.value}}),className:"nice-pres-panel__textarea",rows:4})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.fontSize","Font Size"),l.jsx(_.NiceNumberInput,{value:t.content.fontSize??16,min:8,max:200,onChange:s=>i==null?void 0:i(e.id,t.id,{content:{...t.content,fontSize:s??16}}),className:"nice-pres-panel__input"})]})]}),l.jsx(_.NiceButton,{className:"nice-pres-panel__btn nice-pres-panel__btn--danger",variant:"ghost",size:"sm",onClick:()=>o==null?void 0:o(e.id,t.id),children:a("panel.deleteElement","Delete Element")})]}):l.jsxs("div",{className:`nice-pres-panel ${r??""}`,children:[l.jsx("h3",{className:"nice-pres-panel__title",children:a("panel.slideProperties")}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.title","Title"),l.jsx(_.NiceTextInput,{value:e.title,onChange:s=>n==null?void 0:n(e.id,{title:s}),className:"nice-pres-panel__input"})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.layout"),l.jsx(_.NiceSelect,{value:e.layout,onChange:s=>n==null?void 0:n(e.id,{layout:s}),options:Xt.map(s=>({value:s,label:a(`layout.${s}`)})),className:"nice-pres-panel__select"})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.background"),l.jsx(_.NiceColorPicker,{value:e.background.color??"var(--nice-bg, #fff)",onChange:s=>n==null?void 0:n(e.id,{background:{...e.background,type:"solid",color:s}}),className:"nice-pres-panel__color"})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.notes"),l.jsx("textarea",{value:e.notes??"",onChange:s=>n==null?void 0:n(e.id,{notes:s.target.value||void 0}),className:"nice-pres-panel__textarea",rows:4,placeholder:a("panel.notes")})]})]}):l.jsx("div",{className:`nice-pres-panel nice-pres-panel--empty ${r??""}`,children:l.jsx("p",{children:a("panel.noSelection")})})};process.env.NODE_ENV!=="production"&&(ke.displayName="SlidePropertyPanel");const Jt=180,Ie=({slides:e,slideSize:t,theme:n,currentIndex:i,onSelectSlide:o,onAddSlide:r,onDuplicateSlide:a,onRemoveSlide:s,className:c})=>{const u=ie(),f=Jt/t.width;return l.jsxs("div",{className:`nice-slide-thumbs ${c??""}`,children:[e.map((h,y)=>l.jsxs("div",{className:`nice-slide-thumbs__item ${y===i?"nice-slide-thumbs__item--active":""}`,onClick:()=>o(y),children:[l.jsx("div",{className:"nice-slide-thumbs__preview",children:l.jsx(ae,{slide:h,slideSize:t,theme:n,scale:f})}),l.jsxs("div",{className:"nice-slide-thumbs__caption",children:[y+1,". ",h.title]}),(a||s)&&l.jsxs("div",{className:"nice-slide-thumbs__actions",children:[a&&l.jsx(_.NiceButton,{className:"nice-slide-thumbs__action-btn",variant:"ghost",size:"sm",onClick:p=>{p.stopPropagation(),a(h.id)},title:u("toolbar.duplicateSlide"),"aria-label":u("toolbar.duplicateSlide"),children:l.jsx(_.NiceIcon,{name:"copy",size:12})}),s&&e.length>1&&l.jsx(_.NiceButton,{className:"nice-slide-thumbs__action-btn nice-slide-thumbs__action-btn--danger",variant:"ghost",size:"sm",onClick:p=>{p.stopPropagation(),s(h.id)},title:u("toolbar.deleteSlide"),"aria-label":u("toolbar.deleteSlide"),children:l.jsx(_.NiceIcon,{name:"close",size:14})})]})]},h.id)),r&&l.jsxs(_.NiceButton,{className:"nice-slide-thumbs__add",variant:"ghost",size:"sm",onClick:r,children:[l.jsx(_.NiceIcon,{name:"plus",size:12})," ",u("toolbar.addSlide")]})]})};process.env.NODE_ENV!=="production"&&(Ie.displayName="SlideThumbnailList");const Zt=[{target:".nice-pres-editor",titleKey:"tutorial.presentationEditor.intro.title",title:"Presentation editor",contentKey:"tutorial.presentationEditor.intro.content",content:"Build slides from the thumbnail rail, add and arrange elements on the canvas, edit them in the property panel, then present or export.",placement:"auto"}];function en(e){const t={x:20,y:20,width:60,height:40};switch(e){case"text":return{position:{x:10,y:30,width:80,height:20},content:{kind:"text",text:"New Text",fontSize:24,textAlign:"left"}};case"shape":return{position:{x:30,y:30,width:40,height:30},content:{kind:"shape",shapeType:"rectangle",fill:"var(--nice-info, #6366f1)",stroke:"var(--nice-accent, #4f46e5)",strokeWidth:2}};case"code":return{position:{x:10,y:20,width:80,height:50},content:{kind:"code",code:`// Your code here
101
- console.log("Hello!");`,language:"typescript",theme:"dark"}};case"chart":return{position:t,content:{kind:"chart",chartType:"bar",data:{labels:["Q1","Q2","Q3","Q4"],series:[{name:"Revenue",values:[30,45,60,80],color:"var(--nice-info, #6366f1)"}]}}};case"table":return{position:{x:10,y:20,width:80,height:40},content:{kind:"table",headers:["Name","Value","Status"],rows:[["Item A","100","Active"],["Item B","200","Pending"]],stripedRows:!0}};case"image":return{position:t,content:{kind:"image",src:"",alt:"Image",objectFit:"contain"}};case"diagram":return{position:t,content:{kind:"diagram",autoPlayAnimations:!1}};case"icon":return{position:{x:45,y:40,width:10,height:15},content:{kind:"icon",name:"star",size:48,color:"var(--nice-info, #6366f1)"}};default:return{position:t,content:{kind:"text",text:e,fontSize:16}}}}const Qe=({initialDocument:e,onChange:t,onExport:n,onPresent:i,lang:o,showToolbar:r=!0,showThumbnails:a=!0,showPropertyPanel:s=!0,className:c,style:u,tutorial:f})=>{const h=_e(),y=o??h,p=d.useMemo(()=>Ae(y),[y]),m=Ue(e),[g,b]=d.useState(null),[S,x]=d.useState(!1),[T,$]=d.useState(5),N=d.useRef(m.document);m.document!==N.current&&(N.current=m.document,t==null||t(m.document));const C=m.currentSlide,H=d.useMemo(()=>g&&C?C.elements.find(E=>E.id===g)??null:null,[g,C]),A=d.useRef(null),[q,W]=d.useState(null);d.useEffect(()=>{const E=A.current;if(!E||typeof ResizeObserver>"u")return;const B=new ResizeObserver(([L])=>{W({w:L.contentRect.width,h:L.contentRect.height})});return B.observe(E),()=>B.disconnect()},[]);const Y=d.useMemo(()=>{const{width:E,height:B}=m.document.slideSize;return!q||q.w<=0||q.h<=0?Math.min(1,800/E):Math.min(1,q.w/E,q.h/B)},[m.document.slideSize,q]),K=d.useCallback(E=>{if(!C)return;const{content:B,position:L}=en(E),G=m.addElement(C.id,{type:E,position:L,content:B});G&&b(G.id)},[C,m]),I=d.useCallback(E=>{m.addSlide(m.currentSlideIndex,E),m.setCurrentSlideIndex(m.currentSlideIndex+1)},[m]),P=d.useCallback(E=>{m.removeSlide(E),m.currentSlideIndex>=m.slides.length-1&&m.setCurrentSlideIndex(Math.max(0,m.slides.length-2))},[m]),v=d.useCallback((E,B,L)=>{if(!C)return;const G=C.elements.find(Z=>Z.id===E);G&&m.moveElement(C.id,E,{...G.position,x:B,y:L})},[C,m]),D=d.useCallback((E,B,L,G,Z)=>{if(!C)return;const ee=C.elements.find(te=>te.id===E);ee&&m.moveElement(C.id,E,{...ee.position,width:B,height:L,...G!=null?{x:G}:{},...Z!=null?{y:Z}:{}})},[C,m]),V=d.useCallback(()=>{if(!C||!g)return;const E=Math.max(0,...C.elements.map(B=>B.zIndex??0));m.updateElement(C.id,g,{zIndex:E+1})},[C,g,m]),U=d.useCallback(()=>{if(!C||!g)return;const E=Math.min(0,...C.elements.map(B=>B.zIndex??0));m.updateElement(C.id,g,{zIndex:E-1})},[C,g,m]),X=d.useCallback(E=>{const B=m.document;let L;switch(E){case"ndp":L=Ve(B,!0);break;case"html":L=je(B);break}n==null||n(E,L)},[m,n]),R=d.useCallback(()=>{i==null||i(m.document,m.currentSlideIndex)},[m,i]),k=r?l.jsx(we,{onAddElement:K,onAddSlide:I,onUndo:m.undo,onRedo:m.redo,canUndo:m.canUndo,canRedo:m.canRedo,onPresent:R,onExport:X}):void 0,M=r?l.jsxs("div",{style:{display:"flex",gap:4,padding:"2px 8px",borderBottom:"1px solid var(--nice-border-color, #eee)",alignItems:"center",fontSize:"0.85em",flexWrap:"wrap"},children:[l.jsxs(_.NiceButton,{size:"sm",variant:S?"primary":"ghost",onClick:()=>x(E=>!E),children:[l.jsx(_.NiceIcon,{name:"grid",size:14})," ",p("presentationEditor.grid","Grid")]}),H&&l.jsxs(l.Fragment,{children:[l.jsxs(_.NiceButton,{size:"sm",variant:"ghost",onClick:V,title:p("presentationEditor.bringToFront","Bring to front"),children:[l.jsx(_.NiceIcon,{name:"arrow-up",size:14})," ",p("presentationEditor.front","Front")]}),l.jsxs(_.NiceButton,{size:"sm",variant:"ghost",onClick:U,title:p("presentationEditor.sendToBack","Send to back"),children:[l.jsx(_.NiceIcon,{name:"arrow-down",size:14})," ",p("presentationEditor.back","Back")]}),l.jsxs(_.NiceButton,{size:"sm",variant:"ghost",onClick:()=>{if(C&&g){const E={...H,id:`el-${Date.now().toString(36)}`,position:{...H.position,x:H.position.x+3,y:H.position.y+3}};m.addElement(C.id,E)}},title:p("presentationEditor.duplicate","Duplicate"),children:[l.jsx(_.NiceIcon,{name:"copy",size:14})," ",p("presentationEditor.duplicate","Duplicate")]})]})]}):void 0,O=a||C?l.jsxs("div",{style:{display:"flex",minHeight:0,height:"100%"},children:[a&&l.jsx("div",{style:{width:200,flexShrink:0,borderRight:"1px solid var(--nice-border-color, #ddd)",background:"var(--nice-bg-secondary, #fafafa)",overflowY:"auto"},children:l.jsx(Ie,{slides:m.slides,slideSize:m.document.slideSize,theme:m.theme,currentIndex:m.currentSlideIndex,onSelectSlide:m.setCurrentSlideIndex,onAddSlide:()=>I(),onDuplicateSlide:E=>m.duplicateSlide(E),onRemoveSlide:P})}),C&&l.jsxs("div",{style:{width:180,flexShrink:0,borderRight:"1px solid var(--nice-border-color, #ddd)",background:"var(--nice-bg-secondary, #fafafa)",overflowY:"auto",fontSize:"0.85em"},"aria-label":p("presentationEditor.slideElements","Slide elements"),children:[l.jsx("div",{style:{padding:"8px 10px",fontWeight:600,borderBottom:"1px solid var(--nice-border-color, #ddd)",position:"sticky",top:0,background:"var(--nice-bg-secondary, #fafafa)"},children:p("presentationEditor.elements","Elements ({elements})").replace("{elements}",String(C.elements.length))}),C.elements.length===0?l.jsx("div",{style:{padding:10,color:"var(--nice-text-secondary, #888)",fontStyle:"italic"},children:p("presentationEditor.noElementsYet","No elements yet.")}):l.jsx("ul",{style:{listStyle:"none",margin:0,padding:0},children:C.elements.map((E,B)=>{var Z;const L=E.id===g,G=E.content&&E.content.text?`“${E.content.text.slice(0,20)}”`:((Z=E.content)==null?void 0:Z.kind)||E.type;return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>b(E.id),style:{width:"100%",textAlign:"left",padding:"6px 10px",background:L?"var(--nice-color-primary, #6366f1)":"transparent",color:L?"var(--nice-color-white, #fff)":"inherit",border:"none",borderBottom:"1px solid var(--nice-border-color, #eee)",cursor:"pointer",display:"flex",justifyContent:"space-between",gap:6,font:"inherit"},children:[l.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[B+1,". ",G]}),l.jsx("span",{style:{opacity:.7,fontSize:"0.75em"},children:E.type})]})},E.id)})})]})]}):void 0,Q=s?l.jsx("div",{style:{width:260,height:"100%",borderLeft:"1px solid var(--nice-border-color, #ddd)",overflowY:"auto",background:"var(--nice-bg-secondary, #fafafa)"},children:l.jsx(ke,{slide:C,selectedElement:H,onSlideChange:m.updateSlide,onElementChange:m.updateElement,onRemoveElement:m.removeElement})}):void 0;return l.jsx(Be,{lang:y,children:l.jsxs("div",{className:`nice-pres-editor ${c??""}`,style:{position:"relative",height:"100%",maxWidth:"100%",overflow:"hidden",background:"var(--nice-bg-primary, #fff)",color:"var(--nice-text-primary, #111)",...u},children:[l.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:l.jsx(_.NiceTutorialButton,{steps:_.resolveTutorial(f,Zt)})}),l.jsx(_.NiceAppShell,{flush:!0,menubar:k,toolbar:M,sidebar:O,rightSidebar:Q,children:l.jsx("div",{ref:A,style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--nice-bg-tertiary, #e8e8e8)",overflow:"auto",padding:24,minWidth:0},children:C&&l.jsx(ae,{slide:C,slideSize:m.document.slideSize,theme:m.theme,scale:Y,selectedElementId:g,onSelectElement:b,onElementDrag:v,onElementResize:D,showGrid:S,gridSnap:T,interactive:!0})})})]})})};process.env.NODE_ENV!=="production"&&(Qe.displayName="NicePresentationEditor");const Re={linear:e=>e,easeIn:e=>e*e,easeOut:e=>e*(2-e),easeInOut:e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*.5)*Math.exp(-6*e),bounce:e=>{if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const n=e-.5454545454545454;return 7.5625*n*n+.75}if(e<2.5/2.75){const n=e-.8181818181818182;return 7.5625*n*n+.9375}const t=e-2.625/2.75;return 7.5625*t*t+.984375}},ge={opacity:1,transform:"",filter:"",visible:!0};function tn(e,t,n){if(!e)return{...ge};const i=e.entrance;if(!i)return{...ge};if((e.trigger==="onClick"||e.trigger==="afterPrevious")&&!n)return{...ge,opacity:0,visible:!1};const o=i.delayMs??0,r=t-o;if(r<0)return{...ge,opacity:0,visible:!1};const a=Math.min(r/i.durationMs,1),s=(Re[i.easing??"linear"]??Re.linear)(a);return nn(i.effect,s)}function nn(e,t){const n={opacity:1,transform:"",filter:"",visible:!0};switch(e){case"fadeIn":n.opacity=t;break;case"fadeOut":n.opacity=1-t;break;case"slideInLeft":n.transform=`translateX(${-100*(1-t)}%)`,n.opacity=t;break;case"slideInRight":n.transform=`translateX(${100*(1-t)}%)`,n.opacity=t;break;case"slideInTop":n.transform=`translateY(${-100*(1-t)}%)`,n.opacity=t;break;case"slideInBottom":n.transform=`translateY(${100*(1-t)}%)`,n.opacity=t;break;case"zoomIn":n.transform=`scale(${t})`,n.opacity=t;break;case"zoomOut":n.transform=`scale(${2-t})`,n.opacity=t;break;case"bounceIn":n.transform=`scale(${t>.8?1+.1*Math.sin((t-.8)/.2*Math.PI):t})`,n.opacity=t;break;case"flipInX":n.transform=`perspective(400px) rotateX(${90*(1-t)}deg)`,n.opacity=t;break;case"flipInY":n.transform=`perspective(400px) rotateY(${90*(1-t)}deg)`,n.opacity=t;break;case"rotateIn":n.transform=`rotate(${-180*(1-t)}deg) scale(${t})`,n.opacity=t;break;case"typewriter":n.opacity=t>0?1:0;break;case"wipeLeft":n.transform=`scaleX(${t})`,n.opacity=1;break;case"wipeRight":n.transform=`scaleX(${t})`,n.opacity=1;break;case"splitReveal":n.transform=`scaleY(${t})`,n.opacity=1;break;case"pulse":n.transform=`scale(${1+.05*Math.sin(t*Math.PI*4)})`;break;case"shake":n.transform=`translateX(${5*Math.sin(t*Math.PI*8)*(1-t)}px)`;break;case"glow":n.filter=`drop-shadow(0 0 ${8*t}px gold)`;break}return n}function Ye(e,t,n="left"){const i={},o={};switch(e){case"fade":i.opacity=1-t,o.opacity=t;break;case"slide":{const r=n==="right"||n==="down"?-1:1,a=n==="up"||n==="down"?"Y":"X";i.transform=`translate${a}(${-r*t*100}%)`,o.transform=`translate${a}(${r*(1-t)*100}%)`;break}case"zoom":i.transform=`scale(${1-t*.3})`,i.opacity=1-t,o.transform=`scale(${.7+t*.3})`,o.opacity=t;break;case"flip":i.transform=`perspective(1000px) rotateY(${t*90}deg)`,i.opacity=t>.5?0:1,o.transform=`perspective(1000px) rotateY(${(1-t)*-90}deg)`,o.opacity=t>.5?1:0;break;default:i.opacity=1-t,o.opacity=t;break}return{outgoing:i,incoming:o}}const on={width:1920,height:1080},rn={width:1024,height:768},an={width:2560,height:1440},Ge={name:"Corporate",backgroundColor:"#fff",primaryColor:"#1a365d",secondaryColor:"#2b6cb0",accentColor:"#ed8936",textColor:"#2d3748",headingColor:"#1a365d",fontFamily:'"Segoe UI", Roboto, sans-serif',headingFontFamily:'"Segoe UI", Roboto, sans-serif',codeFontFamily:'"Cascadia Code", "Fira Code", monospace'},sn={name:"Modern Dark",backgroundColor:"#1a1a2e",primaryColor:"#e94560",secondaryColor:"#0f3460",accentColor:"#16213e",textColor:"#e0e0e0",headingColor:"#fff",fontFamily:"Inter, sans-serif",headingFontFamily:"Inter, sans-serif",codeFontFamily:'"JetBrains Mono", monospace'},cn={name:"Minimal",backgroundColor:"#fafafa",primaryColor:"#333333",secondaryColor:"#666666",accentColor:"#2196f3",textColor:"#333333",headingColor:"#111111",fontFamily:'"Helvetica Neue", Arial, sans-serif',codeFontFamily:'"SF Mono", monospace'},ln={name:"NiceToDev",backgroundColor:"#f8f9fa",primaryColor:"#6366f1",secondaryColor:"#8b5cf6",accentColor:"#06b6d4",textColor:"#334155",headingColor:"#1e293b",fontFamily:"Inter, sans-serif",headingFontFamily:'"Plus Jakarta Sans", Inter, sans-serif',codeFontFamily:'"Fira Code", monospace'},dn=500,Ke=({document:e,startSlide:t=0,onExit:n,autoAdvanceMs:i=0,showNotes:o=!1,showSlideNumber:r=!0,showProgressBar:a=!0,showTimer:s=!1,enableTouch:c=!0,autoFullscreen:u=!1,className:f})=>{const h=ie(),[y,p]=d.useState(t),[m,g]=d.useState(0),[b,S]=d.useState(!1),[x,T]=d.useState(0),[$,N]=d.useState(null),[C,H]=d.useState(!1),[A,q]=d.useState(0),W=d.useRef(null),Y=d.useRef(0),K=d.useRef(null),I=d.useRef(null),P=e.slides,v=P[y]??null,D=$!==null?P[$]??null:null,V=e.theme??Ge,U=e.slideSize,X=P.length,R=d.useMemo(()=>{if(!v)return 0;const z=v.elements.filter(F=>{var j;return(j=F.animation)==null?void 0:j.entrance}).map(F=>{var j;return((j=F.animation)==null?void 0:j.buildOrder)??0});return z.length>0?Math.max(...z)+1:0},[v]),k=d.useCallback(z=>{var se,ce;if(z<0||z>=X||z===y||b)return;const F=P[z];if((((se=F==null?void 0:F.transition)==null?void 0:se.effect)??"none")==="none"){N(null),p(z),g(0);return}N(y),p(z),g(0),S(!0);const J=((ce=F==null?void 0:F.transition)==null?void 0:ce.durationMs)??dn,ne=performance.now(),ue=ye=>{const Pe=Math.min(1,(ye-ne)/J);T(Pe),Pe<1?Y.current=requestAnimationFrame(ue):(S(!1),N(null))};Y.current=requestAnimationFrame(ue)},[y,X,b,P]),M=d.useCallback(()=>{if(m<R){g(z=>z+1);return}y<X-1&&k(y+1)},[m,R,y,X,k]),O=d.useCallback(()=>{if(m>0){g(z=>z-1);return}y>0&&k(y-1)},[m,y,k]);d.useEffect(()=>{const z=F=>{switch(F.key){case"ArrowRight":case"ArrowDown":case" ":case"Enter":F.preventDefault(),M();break;case"ArrowLeft":case"ArrowUp":case"Backspace":F.preventDefault(),O();break;case"Escape":F.preventDefault(),n==null||n();break;case"Home":F.preventDefault(),k(0);break;case"End":F.preventDefault(),k(X-1);break}};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[M,O,n,k,X]);const Q=d.useCallback(z=>{if(!c)return;const F=z.touches[0];K.current={x:F.clientX,y:F.clientY,time:Date.now()}},[c]),E=d.useCallback(z=>{if(!c||!K.current)return;const F=z.changedTouches[0],j=F.clientX-K.current.x,J=F.clientY-K.current.y,ne=Date.now()-K.current.time;if(K.current=null,ne>500||Math.abs(j)<30&&Math.abs(J)<30){M();return}Math.abs(j)>Math.abs(J)&&(j<-30?M():j>30&&O())},[c,M,O]);d.useEffect(()=>{if(s)return I.current=setInterval(()=>q(z=>z+1e3),1e3),()=>{I.current&&clearInterval(I.current)}},[s]);const B=z=>{const F=Math.floor(z/1e3),j=Math.floor(F/60),J=Math.floor(j/60);return J>0?`${J}:${String(j%60).padStart(2,"0")}:${String(F%60).padStart(2,"0")}`:`${j}:${String(F%60).padStart(2,"0")}`};d.useEffect(()=>{const z=F=>{(F.key==="g"||F.key==="G")&&H(j=>!j)};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[]),d.useEffect(()=>{if(i<=0||b)return;const z=setTimeout(M,i);return()=>clearTimeout(z)},[i,M,b,y,m]),d.useEffect(()=>{var F;const z=W.current;return u&&z&&!window.document.fullscreenElement&&((F=z.requestFullscreen)==null||F.call(z).catch(()=>{})),()=>{var j,J;u&&window.document.fullscreenElement&&((J=(j=window.document).exitFullscreen)==null||J.call(j).catch(()=>{})),Y.current&&cancelAnimationFrame(Y.current)}},[]);const L=d.useMemo(()=>v?v.elements.filter(z=>{var j;return(j=z.animation)!=null&&j.entrance?(z.animation.buildOrder??0)<=m:!0}):[],[v,m]),G=d.useMemo(()=>{if(!b||!v)return{outgoing:{},incoming:{}};const z=v.transition??{effect:"fade"};return Ye(z.effect,x,z.direction)},[b,v,x]),[Z,ee]=d.useState(1),[te,de]=d.useState(!1);d.useEffect(()=>{const z=()=>{const j=U.width,J=U.height,ne=!!window.document.fullscreenElement;de(ne);const ue=W.current;let se,ce;if(ne||u)se=window.innerWidth,ce=window.innerHeight;else if(ue){const ye=ue.getBoundingClientRect();se=ye.width||j,ce=ye.height||J}else se=j,ce=J;ee(Math.min(se/j,ce/J))};z();const F=typeof ResizeObserver<"u"&&W.current?new ResizeObserver(z):null;return F&&W.current&&F.observe(W.current),window.addEventListener("resize",z),window.document.addEventListener("fullscreenchange",z),()=>{window.removeEventListener("resize",z),window.document.removeEventListener("fullscreenchange",z),F==null||F.disconnect()}},[U,u]);const me=d.useCallback(()=>{var F,j,J;const z=W.current;z&&(window.document.fullscreenElement?(j=(F=window.document).exitFullscreen)==null||j.call(F).catch(()=>{}):(J=z.requestFullscreen)==null||J.call(z).catch(()=>{}))},[]),he=u||te;return l.jsxs("div",{ref:W,className:`nice-pres-player ${f??""}`,style:he?{position:"fixed",inset:0,background:"#000",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",cursor:"none",zIndex:9999}:{position:"relative",width:"100%",height:"100%",minHeight:240,background:"#000",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},onClick:M,onContextMenu:z=>{z.preventDefault(),O()},onTouchStart:Q,onTouchEnd:E,children:[C&&l.jsx("div",{style:{position:"absolute",inset:0,zIndex:100,background:"var(--nice-overlay-90, rgba(0, 0, 0, 0.9))",overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:16,padding:24,alignContent:"start"},onClick:z=>z.stopPropagation(),children:P.map((z,F)=>l.jsxs("div",{style:{cursor:"pointer",border:F===y?"3px solid var(--nice-primary, #2196f3)":"2px solid transparent",borderRadius:4,overflow:"hidden"},onClick:()=>{k(F),H(!1)},children:[l.jsx(ae,{slide:z,slideSize:U,theme:V,scale:240/U.width,interactive:!1}),l.jsxs("div",{style:{color:"var(--nice-text-primary, #fff)",fontSize:12,textAlign:"center",padding:4},children:[F+1,". ",z.title]})]},z.id))}),b&&D&&l.jsx("div",{style:{position:"absolute",...G.outgoing},children:l.jsx(ae,{slide:D,slideSize:U,theme:V,scale:Z,interactive:!1})}),v&&l.jsx("div",{style:{position:"absolute",...b?G.incoming:{}},children:l.jsx(ae,{slide:{...v,elements:L},slideSize:U,theme:V,scale:Z,interactive:!1})}),r&&l.jsxs("div",{style:{position:"absolute",bottom:12,right:20,color:"var(--nice-overlay-light-50, rgba(255, 255, 255, 0.5))",fontSize:14,fontFamily:"sans-serif",pointerEvents:"none"},children:[y+1," / ",X]}),o&&(v==null?void 0:v.notes)&&l.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",color:"var(--nice-color-white, #fff)",padding:"12px 24px",fontSize:14,fontFamily:"sans-serif",maxHeight:"20vh",overflowY:"auto",pointerEvents:"none"},children:v.notes}),a&&l.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:3,background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",pointerEvents:"none",zIndex:50},children:l.jsx("div",{style:{height:"100%",width:`${(y+1)/X*100}%`,background:"var(--nice-primary, #2196f3)",transition:"width 0.3s ease"}})}),s&&l.jsx("div",{style:{position:"absolute",top:12,right:20,color:"var(--nice-overlay-light-50, rgba(255, 255, 255, 0.5))",fontSize:14,fontFamily:"monospace",pointerEvents:"none",zIndex:50},children:B(A)}),l.jsxs("div",{className:"nice-pres-player-controls",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,opacity:.3},onMouseEnter:z=>{z.currentTarget.style.opacity="0.9",z.currentTarget.style.cursor="pointer"},onMouseLeave:z=>{z.currentTarget.style.opacity="0.3"},children:[l.jsx(_.NiceButton,{variant:"ghost",size:"sm",onClick:z=>{z.stopPropagation(),O()},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:16},title:h("presentationPlayer.previous","Previous"),"aria-label":h("presentationPlayer.previous","Previous"),children:l.jsx(_.NiceIcon,{name:"chevron-left",size:16})}),l.jsx(_.NiceButton,{variant:"ghost",size:"sm",onClick:z=>{z.stopPropagation(),M()},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:16},title:h("presentationPlayer.next","Next"),"aria-label":h("presentationPlayer.next","Next"),children:l.jsx(_.NiceIcon,{name:"chevron-right",size:16})}),l.jsx(_.NiceButton,{variant:"ghost",size:"sm",onClick:z=>{z.stopPropagation(),n==null||n()},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:14},title:h("presentationPlayer.exitEsc","Exit (Esc)"),"aria-label":h("presentationPlayer.exit","Exit"),children:l.jsx(_.NiceIcon,{name:"close",size:14})}),l.jsx(_.NiceButton,{variant:"ghost",size:"sm",onClick:z=>{z.stopPropagation(),H(F=>!F)},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:14},title:h("presentationPlayer.overviewG","Overview (G)"),"aria-label":h("presentationPlayer.overview","Overview"),children:l.jsx(_.NiceIcon,{name:"grid",size:14})}),l.jsx(_.NiceButton,{variant:"ghost",size:"sm",onClick:z=>{z.stopPropagation(),me()},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:14},title:te?h("presentationPlayer.exitFullscreen","Exit fullscreen"):h("presentationPlayer.fullscreen","Fullscreen"),"aria-label":te?h("presentationPlayer.exitFullscreen","Exit fullscreen"):h("presentationPlayer.fullscreen","Fullscreen"),children:l.jsx(_.NiceIcon,{name:te?"collapse":"expand",size:14})})]})]})};process.env.NODE_ENV!=="production"&&(Ke.displayName="NicePresentationPlayer");const un="_interactiveElement_19xs5_13",pn="_interactiveButton_19xs5_27",fn="_disabled_19xs5_57",mn="_variant_primary_19xs5_87",hn="_variant_secondary_19xs5_101",yn="_variant_outline_19xs5_111",gn="_variant_ghost_19xs5_123",xn="_size_small_19xs5_143",bn="_size_medium_19xs5_153",vn="_size_large_19xs5_163",Sn="_buttonIcon_19xs5_173",wn="_buttonLabel_19xs5_181",kn="_interactivePoll_19xs5_193",In="_pollQuestion_19xs5_213",Cn="_pollOptions_19xs5_227",Mn="_pollOption_19xs5_227",zn="_pollOptionDisabled_19xs5_265",An="_pollOptionSelected_19xs5_275",_n="_pollOptionContent_19xs5_293",Tn="_pollOptionIcon_19xs5_309",$n="_pollOptionText_19xs5_317",En="_pollCheckbox_19xs5_325",Pn="_pollResultBar_19xs5_335",Nn="_pollResultFill_19xs5_357",Rn="_pollResultPercent_19xs5_369",qn="_pollResultCount_19xs5_385",Dn="_pollSubmitBtn_19xs5_399",On="_pollTotalVotes_19xs5_435",jn="_pollVotedMessage_19xs5_447",Fn="_interactiveQuiz_19xs5_489",Ln="_quizHeader_19xs5_509",Wn="_quizQuestion_19xs5_523",Bn="_quizTimer_19xs5_541",Vn="_quizTimerWarning_19xs5_559",Un="_timerPulse_19xs5_1",Hn="_quizPoints_19xs5_591",Qn="_quizAnswers_19xs5_609",Yn="_quizAnswer_19xs5_609",Gn="_quizAnswerDisabled_19xs5_647",Kn="_quizAnswerSelected_19xs5_657",Xn="_quizAnswerCorrect_19xs5_675",Jn="_quizAnswerIncorrect_19xs5_685",Zn="_quizAnswerMarker_19xs5_695",ei="_quizAnswerText_19xs5_705",ti="_quizCorrectMark_19xs5_717",ni="_quizIncorrectMark_19xs5_729",ii="_quizSubmitBtn_19xs5_741",oi="_quizFeedback_19xs5_789",ri="_quizFeedbackMessage_19xs5_797",ai="_quizFeedbackCorrect_19xs5_811",si="_quizFeedbackIncorrect_19xs5_821",ci="_quizExplanation_19xs5_831",li="_interactiveCountdown_19xs5_855",di="_countdownWarning_19xs5_871",ui="_countdownPulse_19xs5_1",pi="_countdownComplete_19xs5_899",fi="_countdownDigital_19xs5_909",mi="_countdownSeparator_19xs5_927",hi="_countdownDigit_19xs5_909",yi="_countdownCircular_19xs5_947",gi="_countdownCircleSvg_19xs5_959",xi="_countdownProgressRing_19xs5_971",bi="_countdownCircleText_19xs5_979",vi="_countdownLargeSeconds_19xs5_999",Si="_countdownFlip_19xs5_1009",wi="_flipCardContainer_19xs5_1021",ki="_flipCard_19xs5_1021",Ii="_flipLabel_19xs5_1065",Ci="_flipSeparator_19xs5_1079",Mi="_countdownMinimal_19xs5_1095",zi="_countdownCompleteMessage_19xs5_1107",Ai="_interactiveQnA_19xs5_1125",_i="_qnaHeader_19xs5_1149",Ti="_qnaTitle_19xs5_1165",$i="_qnaCount_19xs5_1179",Ei="_qnaInputForm_19xs5_1189",Pi="_qnaInputWrapper_19xs5_1201",Ni="_qnaInput_19xs5_1189",Ri="_qnaCharCount_19xs5_1251",qi="_qnaInputActions_19xs5_1267",Di="_qnaAnonymousToggle_19xs5_1281",Oi="_qnaSubmitBtn_19xs5_1311",ji="_qnaClosedMessage_19xs5_1353",Fi="_qnaQuestionsList_19xs5_1371",Li="_qnaQuestion_19xs5_1371",Wi="_qnaQuestionAnswered_19xs5_1413",Bi="_qnaQuestionContent_19xs5_1423",Vi="_qnaQuestionText_19xs5_1437",Ui="_qnaQuestionMeta_19xs5_1449",Hi="_qnaAuthor_19xs5_1463",Qi="_qnaQuestionActions_19xs5_1471",Yi="_qnaUpvoteBtn_19xs5_1485",Gi="_qnaUpvoted_19xs5_1521",Ki="_qnaUpvoteIcon_19xs5_1541",Xi="_qnaUpvoteCount_19xs5_1549",Ji="_qnaAnsweredBtn_19xs5_1559",Zi="_qnaMarkedAnswered_19xs5_1587",eo="_qnaEmptyState_19xs5_1599",to="_qnaMoreQuestions_19xs5_1613",no="_qnaStyle_stack_19xs5_1631",io="_qnaStyle_floating_19xs5_1641",w={interactiveElement:un,interactiveButton:pn,disabled:fn,variant_primary:mn,variant_secondary:hn,variant_outline:yn,variant_ghost:gn,size_small:xn,size_medium:bn,size_large:vn,buttonIcon:Sn,buttonLabel:wn,interactivePoll:kn,pollQuestion:In,pollOptions:Cn,pollOption:Mn,pollOptionDisabled:zn,pollOptionSelected:An,pollOptionContent:_n,pollOptionIcon:Tn,pollOptionText:$n,pollCheckbox:En,pollResultBar:Pn,pollResultFill:Nn,pollResultPercent:Rn,pollResultCount:qn,pollSubmitBtn:Dn,pollTotalVotes:On,pollVotedMessage:jn,"pollStyle_horizontal-bar":"_pollStyle_horizontal-bar_19xs5_467",interactiveQuiz:Fn,quizHeader:Ln,quizQuestion:Wn,quizTimer:Bn,quizTimerWarning:Vn,timerPulse:Un,quizPoints:Hn,quizAnswers:Qn,quizAnswer:Yn,quizAnswerDisabled:Gn,quizAnswerSelected:Kn,quizAnswerCorrect:Xn,quizAnswerIncorrect:Jn,quizAnswerMarker:Zn,quizAnswerText:ei,quizCorrectMark:ti,quizIncorrectMark:ni,quizSubmitBtn:ii,quizFeedback:oi,quizFeedbackMessage:ri,quizFeedbackCorrect:ai,quizFeedbackIncorrect:si,quizExplanation:ci,interactiveCountdown:li,countdownWarning:di,countdownPulse:ui,countdownComplete:pi,countdownDigital:fi,countdownSeparator:mi,countdownDigit:hi,countdownCircular:yi,countdownCircleSvg:gi,countdownProgressRing:xi,countdownCircleText:bi,countdownLargeSeconds:vi,countdownFlip:Si,flipCardContainer:wi,flipCard:ki,flipLabel:Ii,flipSeparator:Ci,countdownMinimal:Mi,countdownCompleteMessage:zi,interactiveQnA:Ai,qnaHeader:_i,qnaTitle:Ti,qnaCount:$i,qnaInputForm:Ei,qnaInputWrapper:Pi,qnaInput:Ni,qnaCharCount:Ri,qnaInputActions:qi,qnaAnonymousToggle:Di,qnaSubmitBtn:Oi,qnaClosedMessage:ji,qnaQuestionsList:Fi,qnaQuestion:Li,qnaQuestionAnswered:Wi,qnaQuestionContent:Bi,qnaQuestionText:Vi,qnaQuestionMeta:Ui,qnaAuthor:Hi,qnaQuestionActions:Qi,qnaUpvoteBtn:Yi,qnaUpvoted:Gi,qnaUpvoteIcon:Ki,qnaUpvoteCount:Xi,qnaAnsweredBtn:Ji,qnaMarkedAnswered:Zi,qnaEmptyState:eo,qnaMoreQuestions:to,qnaStyle_stack:no,qnaStyle_floating:io},oo=({content:e,onAction:t,disabled:n=!1,className:i,theme:o})=>{const{label:r,action:a,variant:s="primary",size:c="medium",icon:u,iconPosition:f="left",backgroundColor:h,textColor:y,borderRadius:p}=e,m=d.useCallback(()=>{if(!n){if(a.type==="openUrl"){const{url:x,newTab:T=!0}=a;T?window.open(x,"_blank","noopener,noreferrer"):window.location.href=x}t==null||t(a)}},[a,n,t]),g={backgroundColor:h??(s==="primary"?o==null?void 0:o.primaryColor:void 0),color:y,borderRadius:p!==void 0?`${p}px`:void 0,fontFamily:o==null?void 0:o.fontFamily},b=[w.interactiveButton,w[`variant_${s}`],w[`size_${c}`],n?w.disabled:"",i??""].filter(Boolean).join(" "),S=()=>u?l.jsx("span",{className:w.buttonIcon,children:l.jsx(_.NiceIcon,{name:ro(u),size:16})}):null;return l.jsxs("button",{className:b,style:g,onClick:m,disabled:n,type:"button",children:[f==="left"&&S(),l.jsx("span",{className:w.buttonLabel,children:r}),f==="right"&&S()]})};function ro(e){return{external:"external-link",share:"external-link",question:"help",heart:"heart",delete:"trash"}[e]??e}const ao=({content:e,onVote:t,onResultsUpdate:n,votingClosed:i=!1,userVote:o,className:r,theme:a})=>{const s=ie(),{question:c,options:u,multiSelect:f=!1,showResultsAfterVote:h=!0,liveResults:y=!1,displayStyle:p="buttons",resultColors:m,results:g={}}=e,[b,S]=d.useState(o??[]),[x,T]=d.useState(!!(o!=null&&o.length)),[$,N]=d.useState(g),C=d.useMemo(()=>Object.values($).reduce((I,P)=>I+P,0),[$]),H=[(a==null?void 0:a.primaryColor)??"var(--nice-info, #6366f1)","var(--nice-accent, #8b5cf6)","var(--nice-info, #06b6d4)","var(--nice-success, #10b981)","var(--nice-warning, #f59e0b)","var(--nice-danger, #ef4444)"],A=m??H,q=d.useCallback(I=>{x||i||S(P=>f?P.includes(I)?P.filter(v=>v!==I):[...P,I]:[I])},[x,i,f]),W=d.useCallback(()=>{if(b.length===0||x)return;const I={...$};b.forEach(P=>{I[P]=(I[P]??0)+1}),N(I),T(!0),t==null||t(b),n==null||n(I)},[b,x,$,t,n]),Y=y||h&&x,K=(I,P)=>{const v=b.includes(I.id),D=$[I.id]??0,V=C>0?D/C*100:0,U=I.color??A[P%A.length],X=[w.pollOption,w[`pollStyle_${p}`],v?w.pollOptionSelected:"",x||i?w.pollOptionDisabled:""].filter(Boolean).join(" ");return l.jsxs("button",{className:X,onClick:()=>q(I.id),disabled:x||i,type:"button",style:{"--poll-option-color":U,fontFamily:a==null?void 0:a.fontFamily},children:[l.jsxs("div",{className:w.pollOptionContent,children:[I.icon&&l.jsx("span",{className:w.pollOptionIcon,children:l.jsx(_.NiceIcon,{name:I.icon,size:16})}),l.jsx("span",{className:w.pollOptionText,children:I.text}),f&&!x&&l.jsx("span",{className:w.pollCheckbox,children:l.jsx(_.NiceIcon,{name:v?"check-square":"square",size:16})})]}),Y&&l.jsxs("div",{className:w.pollResultBar,children:[l.jsx("div",{className:w.pollResultFill,style:{width:`${V}%`,backgroundColor:U}}),l.jsxs("span",{className:w.pollResultPercent,children:[V.toFixed(0),"%"]}),l.jsxs("span",{className:w.pollResultCount,children:["(",D,")"]})]})]},I.id)};return l.jsxs("div",{className:`${w.interactivePoll} ${r??""}`,children:[l.jsx("h3",{className:w.pollQuestion,style:{fontFamily:a==null?void 0:a.fontFamily},children:c}),l.jsx("div",{className:w.pollOptions,children:u.map((I,P)=>K(I,P))}),!x&&!i&&b.length>0&&l.jsx("button",{className:w.pollSubmitBtn,onClick:W,style:{backgroundColor:a==null?void 0:a.primaryColor,fontFamily:a==null?void 0:a.fontFamily},children:s("interactive.poll.vote","Submit vote")}),Y&&C>0&&l.jsxs("div",{className:w.pollTotalVotes,children:[s("interactive.poll.totalVotes","Total votes:")," ",C]}),x&&l.jsxs("div",{className:w.pollVotedMessage,children:[l.jsx(_.NiceIcon,{name:"check",size:14})," ",s("interactive.poll.thanks","Thanks for your vote!")]})]})},so=({content:e,onSubmit:t,locked:n=!1,className:i,theme:o})=>{const r=ie(),{question:a,answers:s,quizType:c="single",showCorrectAfterSubmit:u=!0,timeLimitSeconds:f=0,points:h=10,correctFeedback:y,incorrectFeedback:p,explanation:m}=e,g=y??r("interactive.quiz.correctFeedback","Correct answer!"),b=p??r("interactive.quiz.incorrectFeedback","Sorry, that is not the correct answer."),S=r("interactive.quiz.points","pts"),[x,T]=d.useState([]),[$,N]=d.useState(!1),[C,H]=d.useState(!1),[A,q]=d.useState(f),W=d.useRef(null);d.useEffect(()=>{if(f>0&&!$&&!n)return q(f),W.current=setInterval(()=>{q(v=>v<=1?(clearInterval(W.current),0):v-1)},1e3),()=>{W.current&&clearInterval(W.current)}},[f,$,n]);const Y=d.useCallback(v=>{$||n||T(D=>c==="single"||c==="true-false"?[v]:D.includes(v)?D.filter(V=>V!==v):[...D,v])},[$,n,c]),K=d.useCallback(()=>{if($||x.length===0)return;W.current&&clearInterval(W.current);const v=s.filter(R=>R.isCorrect).map(R=>R.id),D=new Set(x),V=new Set(v),U=D.size===V.size&&[...D].every(R=>V.has(R));H(U),N(!0);const X=U?h:0;t==null||t(x,U,X)},[$,x,s,h,t]);d.useEffect(()=>{A===0&&f>0&&!$&&K()},[A,f,$,K]);const I=v=>{const D=Math.floor(v/60),V=v%60;return D>0?`${D}:${V.toString().padStart(2,"0")}`:`${V}s`},P=v=>{const D=x.includes(v.id),V=$&&u,U=[w.quizAnswer,D?w.quizAnswerSelected:"",$?w.quizAnswerDisabled:"",V&&v.isCorrect?w.quizAnswerCorrect:"",V&&D&&!v.isCorrect?w.quizAnswerIncorrect:""].filter(Boolean).join(" ");return l.jsxs("button",{className:U,onClick:()=>Y(v.id),disabled:$||n,type:"button",style:{fontFamily:o==null?void 0:o.fontFamily},children:[l.jsxs("span",{className:w.quizAnswerMarker,children:[c==="multiple"&&l.jsx(_.NiceIcon,{name:D?"check-square":"square",size:16}),(c==="single"||c==="true-false")&&l.jsx(_.NiceIcon,{name:D?"check":"circle",size:16})]}),l.jsx("span",{className:w.quizAnswerText,children:v.text}),V&&v.isCorrect&&l.jsx("span",{className:w.quizCorrectMark,children:l.jsx(_.NiceIcon,{name:"check",size:14})}),V&&D&&!v.isCorrect&&l.jsx("span",{className:w.quizIncorrectMark,children:l.jsx(_.NiceIcon,{name:"close",size:14})})]},v.id)};return l.jsxs("div",{className:`${w.interactiveQuiz} ${i??""}`,children:[l.jsxs("div",{className:w.quizHeader,children:[l.jsx("h3",{className:w.quizQuestion,style:{fontFamily:o==null?void 0:o.fontFamily},children:a}),f>0&&!$&&l.jsxs("div",{className:`${w.quizTimer} ${A<=10?w.quizTimerWarning:""}`,children:[l.jsx(_.NiceIcon,{name:"clock",size:14})," ",I(A)]}),h>0&&l.jsx("div",{className:w.quizPoints,children:$?C?`+${h} ${S}`:`0 ${S}`:`${h} ${S}`})]}),l.jsx("div",{className:w.quizAnswers,children:s.map(P)}),!$&&!n&&x.length>0&&l.jsx("button",{className:w.quizSubmitBtn,onClick:K,style:{backgroundColor:o==null?void 0:o.primaryColor,fontFamily:o==null?void 0:o.fontFamily},children:r("interactive.quiz.submit","Submit answer")}),$&&u&&l.jsxs("div",{className:w.quizFeedback,children:[l.jsx("div",{className:`${w.quizFeedbackMessage} ${C?w.quizFeedbackCorrect:w.quizFeedbackIncorrect}`,children:C?g:b}),m&&l.jsxs("div",{className:w.quizExplanation,children:[l.jsx("strong",{children:r("interactive.quiz.explanation","Explanation:")})," ",m]})]})]})},co=({content:e,onComplete:t,paused:n=!1,className:i,theme:o})=>{const{target:r,format:a="mm:ss",style:s="digital",showLabels:c=!0,onComplete:u,textColor:f,backgroundColor:h,warningThreshold:y=10,warningColor:p="var(--nice-danger, #ef4444)"}=e,[m,g]=d.useState(()=>{if(typeof r=="number")return r;const v=new Date(r),D=new Date;return Math.max(0,Math.floor((v.getTime()-D.getTime())/1e3))}),[b,S]=d.useState(!1),x=ie(),T=x("countdown.timeUp"),$=T==="countdown.timeUp"?x("countdown.timesUp","Time's up!"):T,N=d.useRef(null);d.useEffect(()=>{if(n||b){N.current&&(clearInterval(N.current),N.current=null);return}return N.current=setInterval(()=>{g(v=>v<=1?(clearInterval(N.current),S(!0),0):v-1)},1e3),()=>{N.current&&clearInterval(N.current)}},[n,b]),d.useEffect(()=>{b&&(t==null||t(u))},[b,t,u]);const C=d.useMemo(()=>{const v=Math.floor(m/3600),D=Math.floor(m%3600/60),V=m%60;return{hours:v,minutes:D,seconds:V}},[m]),H=m<=y&&m>0,A=(v,D=2)=>v.toString().padStart(D,"0"),q=()=>{const{hours:v,minutes:D,seconds:V}=C;let U=[];return a==="hh:mm:ss"||v>0?U=[A(v),A(D),A(V)]:a==="mm:ss"?U=[A(D),A(V)]:U=[V.toString()],l.jsx("div",{className:w.countdownDigital,children:U.map((X,R)=>l.jsxs(d.Fragment,{children:[R>0&&l.jsx("span",{className:w.countdownSeparator,children:":"}),l.jsx("span",{className:w.countdownDigit,children:X})]},R))})},W=()=>{const{hours:v,minutes:D,seconds:V}=C,U=typeof r=="number"?r:m,X=U>0?m/U:0,R=2*Math.PI*45;return l.jsxs("div",{className:w.countdownCircular,children:[l.jsxs("svg",{viewBox:"0 0 100 100",className:w.countdownCircleSvg,children:[l.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",opacity:"0.2"}),l.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:H?p:f??(o==null?void 0:o.primaryColor)??"var(--nice-info, #6366f1)",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:R,strokeDashoffset:R*(1-X),transform:"rotate(-90 50 50)",className:w.countdownProgressRing})]}),l.jsx("div",{className:w.countdownCircleText,children:a!=="ss"?l.jsxs(l.Fragment,{children:[v>0&&l.jsxs("span",{children:[A(v),":"]}),l.jsxs("span",{children:[A(D),":"]}),l.jsx("span",{children:A(V)})]}):l.jsx("span",{className:w.countdownLargeSeconds,children:V})})]})},Y=()=>{const{hours:v,minutes:D,seconds:V}=C,U=(X,R)=>l.jsxs("div",{className:w.flipCardContainer,children:[l.jsx("div",{className:w.flipCard,children:l.jsx("span",{children:X})}),c&&l.jsx("span",{className:w.flipLabel,children:R})]});return l.jsxs("div",{className:w.countdownFlip,children:[(a==="hh:mm:ss"||v>0)&&l.jsxs(l.Fragment,{children:[U(A(v),"godz."),l.jsx("span",{className:w.flipSeparator,children:":"})]}),a!=="ss"&&l.jsxs(l.Fragment,{children:[U(A(D),"min."),l.jsx("span",{className:w.flipSeparator,children:":"})]}),U(A(V),"sek.")]})},K=()=>{const{hours:v,minutes:D,seconds:V}=C;if(a==="ss")return l.jsxs("span",{className:w.countdownMinimal,children:[V,"s"]});let U="";return v>0&&(U+=`${v}h `),(D>0||v>0)&&(U+=`${D}m `),U+=`${V}s`,l.jsx("span",{className:w.countdownMinimal,children:U.trim()})},I={color:H?p:f,backgroundColor:h,fontFamily:o==null?void 0:o.fontFamily},P=[w.interactiveCountdown,w[`countdownStyle_${s}`],H?w.countdownWarning:"",b?w.countdownComplete:"",i??""].filter(Boolean).join(" ");return l.jsxs("div",{className:P,style:I,children:[s==="digital"&&q(),s==="circular"&&W(),s==="flip"&&Y(),s==="minimal"&&K(),b&&l.jsxs("div",{className:w.countdownCompleteMessage,children:[l.jsx(_.NiceIcon,{name:"clock",size:18})," ",$]})]})},lo=({content:e,userName:t,onSubmitQuestion:n,onUpvote:i,onMarkAnswered:o,submissionClosed:r=!1,isModerator:a=!1,upvotedQuestions:s=[],className:c,theme:u})=>{const f=ie(),h=_e(),{placeholder:y,allowAnonymous:p=!0,moderated:m=!1,allowUpvote:g=!0,maxVisible:b=10,displayStyle:S="list",charLimit:x=500,questions:T=[]}=e,$=y??f("interactive.qna.placeholder","Ask a question..."),[N,C]=d.useState(T),[H,A]=d.useState(""),[q,W]=d.useState(!1),[Y,K]=d.useState(new Set(s)),I=d.useMemo(()=>[...N].filter(R=>!m||R.answered||a).sort((R,k)=>k.upvotes!==R.upvotes?k.upvotes-R.upvotes:new Date(k.timestamp).getTime()-new Date(R.timestamp).getTime()).slice(0,b),[N,m,a,b]),P=d.useCallback(R=>{R.preventDefault();const k=H.trim();if(!k||r)return;const M={id:`q_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,text:k,author:q||!t?void 0:t,timestamp:new Date().toISOString(),upvotes:0,answered:!1};C(O=>[M,...O]),A(""),n==null||n({text:M.text,author:M.author,answered:!1})},[H,r,q,t,n]),v=d.useCallback(R=>{!g||Y.has(R)||(C(k=>k.map(M=>M.id===R?{...M,upvotes:M.upvotes+1}:M)),K(k=>new Set(k).add(R)),i==null||i(R))},[g,Y,i]),D=d.useCallback(R=>{a&&(C(k=>k.map(M=>M.id===R?{...M,answered:!M.answered}:M)),o==null||o(R))},[a,o]),V=()=>l.jsxs("form",{className:w.qnaInputForm,onSubmit:P,children:[l.jsxs("div",{className:w.qnaInputWrapper,children:[l.jsx("textarea",{className:w.qnaInput,placeholder:$,value:H,onChange:R=>A(R.target.value.slice(0,x)),disabled:r,rows:2,style:{fontFamily:u==null?void 0:u.fontFamily}}),l.jsxs("span",{className:w.qnaCharCount,children:[H.length,"/",x]})]}),l.jsxs("div",{className:w.qnaInputActions,children:[p&&l.jsxs("label",{className:w.qnaAnonymousToggle,children:[l.jsx("input",{type:"checkbox",checked:q,onChange:R=>W(R.target.checked)}),l.jsx("span",{children:f("interactive.qna.anonymously","Anonymously")})]}),l.jsx("button",{type:"submit",className:w.qnaSubmitBtn,disabled:!H.trim()||r,style:{backgroundColor:u==null?void 0:u.primaryColor,fontFamily:u==null?void 0:u.fontFamily},children:f("interactive.qna.submit","Submit question")})]})]}),U=R=>{const k=Y.has(R.id);return l.jsxs("div",{className:`${w.qnaQuestion} ${R.answered?w.qnaQuestionAnswered:""}`,children:[l.jsxs("div",{className:w.qnaQuestionContent,children:[l.jsx("span",{className:w.qnaQuestionText,style:{fontFamily:u==null?void 0:u.fontFamily},children:R.text}),l.jsxs("div",{className:w.qnaQuestionMeta,children:[l.jsx("span",{className:w.qnaAuthor,children:R.author?`@${R.author}`:l.jsxs(l.Fragment,{children:[l.jsx(_.NiceIcon,{name:"user",size:14})," ",f("interactive.qna.anonymous","Anonymous")]})}),l.jsx("span",{className:w.qnaTimestamp,children:uo(f,h,R.timestamp)})]})]}),l.jsxs("div",{className:w.qnaQuestionActions,children:[g&&l.jsxs("button",{className:`${w.qnaUpvoteBtn} ${k?w.qnaUpvoted:""}`,onClick:()=>v(R.id),disabled:k,title:k?f("interactive.qna.alreadyUpvoted","You already upvoted this"):f("interactive.qna.upvote","Upvote"),children:[l.jsx("span",{className:w.qnaUpvoteIcon,children:l.jsx(_.NiceIcon,{name:"arrow-up",size:14})}),l.jsx("span",{className:w.qnaUpvoteCount,children:R.upvotes})]}),a&&l.jsx("button",{className:`${w.qnaAnsweredBtn} ${R.answered?w.qnaMarkedAnswered:""}`,onClick:()=>D(R.id),title:R.answered?f("interactive.qna.markUnanswered","Mark as unanswered"):f("interactive.qna.markAnswered","Mark as answered"),"aria-label":R.answered?f("interactive.qna.markUnanswered","Mark as unanswered"):f("interactive.qna.markAnswered","Mark as answered"),children:l.jsx(_.NiceIcon,{name:R.answered?"check":"circle",size:16})})]})]},R.id)},X=[w.interactiveQnA,w[`qnaStyle_${S}`],c??""].filter(Boolean).join(" ");return l.jsxs("div",{className:X,children:[l.jsxs("div",{className:w.qnaHeader,children:[l.jsx("h3",{className:w.qnaTitle,style:{fontFamily:u==null?void 0:u.fontFamily},children:f("interactive.qna.title","Questions & answers")}),l.jsxs("span",{className:w.qnaCount,children:[N.length," ",N.length===1?f("interactive.qna.questionOne","question"):f("interactive.qna.questionMany","questions")]})]}),!r&&V(),r&&l.jsx("div",{className:w.qnaClosedMessage,children:f("interactive.qna.closed","Question submission is closed")}),l.jsx("div",{className:w.qnaQuestionsList,children:I.length===0?l.jsx("div",{className:w.qnaEmptyState,children:f("interactive.qna.empty","No questions yet. Be the first!")}):I.map(U)}),N.length>b&&l.jsxs("div",{className:w.qnaMoreQuestions,children:["+",N.length-b," ",f("interactive.qna.moreQuestions","more questions")]})]})};function uo(e,t,n){const i=new Date(n),r=new Date().getTime()-i.getTime(),a=Math.floor(r/6e4);if(a<1)return e("interactive.qna.justNow","Just now");if(a<60)return e("interactive.qna.minutesAgo","{n} min ago").replace("{n}",String(a));const s=Math.floor(a/60);return s<24?e("interactive.qna.hoursAgo","{n}h ago").replace("{n}",String(s)):i.toLocaleDateString(t,{day:"numeric",month:"short"})}const Xe={id:"fade",name:"Fade",description:"Smooth fade between slides",outgoingStyles:{from:{opacity:1},to:{opacity:0}},incomingStyles:{from:{opacity:0},to:{opacity:1}},defaultDuration:500,defaultEasing:"ease-in-out",category:"basic"},Je={id:"slide-left",name:"Slide Left",description:"Slide to the left",outgoingStyles:{from:{transform:"translateX(0%)"},to:{transform:"translateX(-100%)"}},incomingStyles:{from:{transform:"translateX(100%)"},to:{transform:"translateX(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},Ze={id:"slide-right",name:"Slide Right",description:"Slide to the right",outgoingStyles:{from:{transform:"translateX(0%)"},to:{transform:"translateX(100%)"}},incomingStyles:{from:{transform:"translateX(-100%)"},to:{transform:"translateX(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},et={id:"slide-up",name:"Slide Up",description:"Slide upward",outgoingStyles:{from:{transform:"translateY(0%)"},to:{transform:"translateY(-100%)"}},incomingStyles:{from:{transform:"translateY(100%)"},to:{transform:"translateY(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},tt={id:"slide-down",name:"Slide Down",description:"Slide downward",outgoingStyles:{from:{transform:"translateY(0%)"},to:{transform:"translateY(100%)"}},incomingStyles:{from:{transform:"translateY(-100%)"},to:{transform:"translateY(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},nt={id:"zoom-in",name:"Zoom In",description:"Zoom in from center",outgoingStyles:{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(1.2)",opacity:0}},incomingStyles:{from:{transform:"scale(0.8)",opacity:0},to:{transform:"scale(1)",opacity:1}},defaultDuration:500,defaultEasing:"ease-out",category:"zoom"},it={id:"zoom-out",name:"Zoom Out",description:"Zoom out to center",outgoingStyles:{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(0.8)",opacity:0}},incomingStyles:{from:{transform:"scale(1.2)",opacity:0},to:{transform:"scale(1)",opacity:1}},defaultDuration:500,defaultEasing:"ease-out",category:"zoom"},ot={id:"flip-horizontal",name:"Flip Horizontal",description:"3D flip around vertical axis",outgoingStyles:{from:{transform:"perspective(1000px) rotateY(0deg)",opacity:1},to:{transform:"perspective(1000px) rotateY(-90deg)",opacity:0}},incomingStyles:{from:{transform:"perspective(1000px) rotateY(90deg)",opacity:0},to:{transform:"perspective(1000px) rotateY(0deg)",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"3d"},rt={id:"flip-vertical",name:"Flip Vertical",description:"3D flip around horizontal axis",outgoingStyles:{from:{transform:"perspective(1000px) rotateX(0deg)",opacity:1},to:{transform:"perspective(1000px) rotateX(90deg)",opacity:0}},incomingStyles:{from:{transform:"perspective(1000px) rotateX(-90deg)",opacity:0},to:{transform:"perspective(1000px) rotateX(0deg)",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"3d"},at={id:"cube-left",name:"Cube Left",description:"3D cube rotation to the left",outgoingStyles:{from:{transform:"perspective(1000px) translateZ(0) rotateY(0deg)"},to:{transform:"perspective(1000px) translateZ(-50%) rotateY(90deg)"}},incomingStyles:{from:{transform:"perspective(1000px) translateZ(-50%) rotateY(-90deg)"},to:{transform:"perspective(1000px) translateZ(0) rotateY(0deg)"}},defaultDuration:800,defaultEasing:"ease-in-out",category:"3d"},st={id:"rotate-in",name:"Rotate In",description:"Rotate and fade in",outgoingStyles:{from:{transform:"rotate(0deg) scale(1)",opacity:1},to:{transform:"rotate(-15deg) scale(0.8)",opacity:0}},incomingStyles:{from:{transform:"rotate(15deg) scale(0.8)",opacity:0},to:{transform:"rotate(0deg) scale(1)",opacity:1}},defaultDuration:600,defaultEasing:"ease-out",category:"rotate"},ct={id:"blur-fade",name:"Blur Fade",description:"Fade with blur effect",outgoingStyles:{from:{filter:"blur(0px)",opacity:1},to:{filter:"blur(10px)",opacity:0}},incomingStyles:{from:{filter:"blur(10px)",opacity:0},to:{filter:"blur(0px)",opacity:1}},defaultDuration:600,defaultEasing:"ease-in-out",category:"blur"},lt={id:"wipe-left",name:"Wipe Left",description:"Wipe from right to left",outgoingStyles:{from:{clipPath:"inset(0 0 0 0)"},to:{clipPath:"inset(0 100% 0 0)"}},incomingStyles:{from:{clipPath:"inset(0 0 0 100%)"},to:{clipPath:"inset(0 0 0 0)"}},defaultDuration:600,defaultEasing:"ease-in-out",category:"creative"},dt={id:"wipe-right",name:"Wipe Right",description:"Wipe from left to right",outgoingStyles:{from:{clipPath:"inset(0 0 0 0)"},to:{clipPath:"inset(0 0 0 100%)"}},incomingStyles:{from:{clipPath:"inset(0 100% 0 0)"},to:{clipPath:"inset(0 0 0 0)"}},defaultDuration:600,defaultEasing:"ease-in-out",category:"creative"},ut={id:"circle-reveal",name:"Circle Reveal",description:"Reveal with expanding circle",outgoingStyles:{from:{clipPath:"circle(100% at 50% 50%)"},to:{clipPath:"circle(0% at 50% 50%)"}},incomingStyles:{from:{clipPath:"circle(0% at 50% 50%)"},to:{clipPath:"circle(100% at 50% 50%)"}},defaultDuration:700,defaultEasing:"ease-out",category:"creative"},pt={id:"glitch",name:"Glitch",description:"Digital glitch effect",outgoingStyles:{from:{transform:"translateX(0)",filter:"hue-rotate(0deg)"},keyframes:[{offset:.2,style:{transform:"translateX(-5px)",filter:"hue-rotate(90deg)"}},{offset:.4,style:{transform:"translateX(5px)",filter:"hue-rotate(180deg)"}},{offset:.6,style:{transform:"translateX(-3px)",filter:"hue-rotate(270deg)"}},{offset:.8,style:{transform:"translateX(3px)",filter:"hue-rotate(360deg)"}}],to:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:0}},incomingStyles:{from:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:0},keyframes:[{offset:.2,style:{transform:"translateX(5px)",filter:"hue-rotate(270deg)",opacity:.5}},{offset:.4,style:{transform:"translateX(-5px)",filter:"hue-rotate(180deg)",opacity:.7}},{offset:.6,style:{transform:"translateX(3px)",filter:"hue-rotate(90deg)",opacity:.9}},{offset:.8,style:{transform:"translateX(-3px)",filter:"hue-rotate(0deg)",opacity:1}}],to:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:1}},defaultDuration:500,defaultEasing:"linear",category:"creative"},ft={id:"morph",name:"Morph",description:"Smooth morphing effect",outgoingStyles:{from:{transform:"scale(1)",borderRadius:"0%",opacity:1},to:{transform:"scale(0.5)",borderRadius:"50%",opacity:0}},incomingStyles:{from:{transform:"scale(0.5)",borderRadius:"50%",opacity:0},to:{transform:"scale(1)",borderRadius:"0%",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"creative"},mt=[Xe,Je,Ze,et,tt,nt,it,ot,rt,at,st,ct,lt,dt,ut,pt,ft];class po{constructor(){this.transitions=new Map,mt.forEach(t=>this.transitions.set(t.id,t))}get(t){return this.transitions.get(t)}register(t){this.transitions.has(t.id)&&console.warn(`Transition "${t.id}" already exists and will be overwritten.`),this.transitions.set(t.id,t)}unregister(t){this.transitions.delete(t)}getAll(){return Array.from(this.transitions.values())}getByCategory(t){return this.getAll().filter(n=>n.category===t)}}const ht=new po;function qe(e,t,n,i){if(i&&i.length>0){const o=[{offset:0,style:e},...i,{offset:1,style:t}].sort((u,f)=>u.offset-f.offset);let r=o[0],a=o[o.length-1];for(let u=0;u<o.length-1;u++)if(n>=o[u].offset&&n<=o[u+1].offset){r=o[u],a=o[u+1];break}const s=a.offset-r.offset,c=s>0?(n-r.offset)/s:1;return De(r.style,a.style,c)}return De(e,t,n)}function De(e,t,n){const i={};return new Set([...Object.keys(e),...Object.keys(t)]).forEach(r=>{const a=e[r],s=t[r];a===void 0?i[r]=s:s===void 0?i[r]=a:typeof a=="number"&&typeof s=="number"?i[r]=a+(s-a)*n:i[r]=n<.5?a:s}),i}function fo(e,t){const n=ht.get(e);if(!n)return{progress:t,outgoingStyle:{opacity:1-t},incomingStyle:{opacity:t},isComplete:t>=1};const{outgoingStyles:i,incomingStyles:o}=n;return{progress:t,outgoingStyle:qe(i.from,i.to,t,i.keyframes),incomingStyle:qe(o.from,o.to,t,o.keyframes),isComplete:t>=1}}function mo(e,t){return{none:"fade",fade:"fade",slide:t==="right"?"slide-right":t==="up"?"slide-up":t==="down"?"slide-down":"slide-left",zoom:"zoom-in",flip:"flip-horizontal",cube:"cube-left",wipe:t==="right"?"wipe-right":"wipe-left",dissolve:"blur-fade",push:t==="right"?"slide-right":"slide-left",cover:"slide-left"}[e]??"fade"}function ho(e,t){switch(t){case"linear":return e;case"ease-in":return e*e;case"ease-out":return 1-Math.pow(1-e,2);case"ease-in-out":return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2;case"ease":default:return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}}function yo(e,t,n,i,o){return{id:e,name:t,outgoingStyles:n,incomingStyles:i,defaultDuration:(o==null?void 0:o.defaultDuration)??500,defaultEasing:(o==null?void 0:o.defaultEasing)??"ease-in-out",description:o==null?void 0:o.description,supportsDirection:o==null?void 0:o.supportsDirection,previewUrl:o==null?void 0:o.previewUrl,category:(o==null?void 0:o.category)??"custom"}}function go(e,t){const n=t==="outgoing"?e.outgoingStyles:e.incomingStyles,i=[];return i.push({...n.from,offset:0}),n.keyframes&&n.keyframes.forEach(o=>{i.push({...o.style,offset:o.offset})}),i.push({...n.to,offset:1}),i}function fe(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e)}function xe(e){return`${e>=0?"+":""}${e.toFixed(1)}%`}function be(e){return e>=0?"#10b981":"#ef4444"}function xo(e){return{id:"slide-title",title:"Title",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3b82f6",position:100}],gradientDirection:135},elements:[{id:"title-main",type:"text",position:{x:10,y:35,width:80,height:15,unit:"percent"},content:{type:"text",text:`${e.quarter} ${e.year} Quarterly Report`,style:{fontFamily:"Inter, sans-serif",fontSize:56,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:800,delayMs:200}},{id:"title-company",type:"text",position:{x:10,y:52,width:80,height:8,unit:"percent"},content:{type:"text",text:e.companyName,style:{fontFamily:"Inter, sans-serif",fontSize:32,fontWeight:400,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:600}},{id:"title-date",type:"text",position:{x:10,y:85,width:80,height:5,unit:"percent"},content:{type:"text",text:e.reportDate||new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),style:{fontFamily:"Inter, sans-serif",fontSize:18,color:"#bfdbfe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Welcome stakeholders. This presentation covers our Q"+e.quarter[1]+" results.",durationMs:3e4}}function bo(e){const t=[{id:"kpi-revenue",type:"shape",position:{x:5,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e5e7eb",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:200}},{id:"kpi-revenue-icon",type:"text",position:{x:7,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"💰",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-revenue-label",type:"text",position:{x:7,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Revenue",style:{fontSize:14,color:"#6b7280",textAlign:"center",fontWeight:500}}},{id:"kpi-revenue-value",type:"text",position:{x:7,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:fe(e.kpis.revenue.value),style:{fontSize:28,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"kpi-revenue-change",type:"text",position:{x:7,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:xe(e.kpis.revenue.change),style:{fontSize:16,fontWeight:600,color:be(e.kpis.revenue.change),textAlign:"center"}}},{id:"kpi-profit",type:"shape",position:{x:28,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e5e7eb",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:350}},{id:"kpi-profit-icon",type:"text",position:{x:30,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"📈",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-profit-label",type:"text",position:{x:30,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Profit",style:{fontSize:14,color:"#6b7280",textAlign:"center",fontWeight:500}}},{id:"kpi-profit-value",type:"text",position:{x:30,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:fe(e.kpis.profit.value),style:{fontSize:28,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"kpi-profit-change",type:"text",position:{x:30,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:xe(e.kpis.profit.change),style:{fontSize:16,fontWeight:600,color:be(e.kpis.profit.change),textAlign:"center"}}},{id:"kpi-customers",type:"shape",position:{x:51,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e5e7eb",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:500}},{id:"kpi-customers-icon",type:"text",position:{x:53,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"👥",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-customers-label",type:"text",position:{x:53,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Customers",style:{fontSize:14,color:"#6b7280",textAlign:"center",fontWeight:500}}},{id:"kpi-customers-value",type:"text",position:{x:53,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:e.kpis.customers.value.toLocaleString(),style:{fontSize:28,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"kpi-customers-change",type:"text",position:{x:53,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:xe(e.kpis.customers.change),style:{fontSize:16,fontWeight:600,color:be(e.kpis.customers.change),textAlign:"center"}}},{id:"kpi-satisfaction",type:"shape",position:{x:74,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e5e7eb",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:650}},{id:"kpi-satisfaction-icon",type:"text",position:{x:76,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"⭐",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-satisfaction-label",type:"text",position:{x:76,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Satisfaction",style:{fontSize:14,color:"#6b7280",textAlign:"center",fontWeight:500}}},{id:"kpi-satisfaction-value",type:"text",position:{x:76,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:`${e.kpis.satisfaction.value}%`,style:{fontSize:28,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"kpi-satisfaction-change",type:"text",position:{x:76,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:xe(e.kpis.satisfaction.change),style:{fontSize:16,fontWeight:600,color:be(e.kpis.satisfaction.change),textAlign:"center"}}}];return{id:"slide-kpis",title:"Key Performance Indicators",layout:"titleContent",background:{type:"solid",color:"#f3f4f6"},elements:[{id:"kpis-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Key Performance Indicators",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...t],notes:"Review each KPI and highlight the most significant changes from last quarter.",durationMs:45e3}}function vo(e){var n;const t={type:"chart",chartType:"bar",title:"Monthly Revenue",data:{labels:e.financials.revenueByMonth.map(i=>i.month),datasets:[{label:`${e.year}`,data:e.financials.revenueByMonth.map(i=>i.value),backgroundColor:"#3b82f6"},...((n=e.financials.revenueByMonth[0])==null?void 0:n.lastYear)!==void 0?[{label:`${e.year-1}`,data:e.financials.revenueByMonth.map(i=>i.lastYear||0),backgroundColor:"#93c5fd"}]:[]]},options:{showLegend:!0,showGridLines:!0,animation:!0}};return{id:"slide-revenue",title:"Revenue Analysis",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"revenue-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Revenue Analysis",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"revenue-chart",type:"chart",position:{x:5,y:18,width:90,height:75,unit:"percent"},content:t,animation:{effect:"fadeIn",durationMs:800,delayMs:400}}],notes:"Highlight the revenue trend and compare with last year if applicable.",durationMs:6e4}}function So(e){const t={type:"chart",chartType:"pie",title:"Cost Breakdown",data:{labels:e.financials.costBreakdown.map(n=>n.category),datasets:[{label:"Cost Distribution",data:e.financials.costBreakdown.map(n=>n.value),backgroundColor:["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#6366f1"]}]},options:{showLegend:!0,showDataLabels:!0,animation:!0}};return{id:"slide-costs",title:"Cost Analysis",layout:"twoColumn",background:{type:"solid",color:"#fff"},elements:[{id:"costs-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Cost Analysis",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"costs-chart",type:"chart",position:{x:5,y:18,width:45,height:70,unit:"percent"},content:t,animation:{effect:"zoomIn",durationMs:600,delayMs:400}},{id:"costs-table",type:"table",position:{x:52,y:18,width:43,height:70,unit:"percent"},content:{type:"table",headers:["Category","Amount","%"],rows:e.financials.costBreakdown.map(n=>[n.category,fe(n.value),`${n.percentage}%`]),style:{headerBackground:"#f3f4f6",headerColor:"#374151",cellPadding:12,fontSize:14,borderColor:"#e5e7eb"}},animation:{effect:"slideInRight",durationMs:600,delayMs:600}}],notes:"Discuss major cost categories and opportunities for optimization.",durationMs:6e4}}function wo(e){const t=e.pipeline.opportunities.map((i,o)=>({id:`pipeline-stage-${o}`,type:"shape",position:{x:5+o*2,y:25+o*12,width:90-o*4,height:10,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:`hsl(${220-o*15}, 70%, ${50+o*8}%)`,cornerRadius:6},animation:{effect:"slideInLeft",durationMs:400,delayMs:200+o*150}})),n=e.pipeline.opportunities.map((i,o)=>({id:`pipeline-label-${o}`,type:"text",position:{x:8+o*2,y:26.5+o*12,width:84-o*4,height:7,unit:"percent"},content:{type:"text",text:`${i.stage}: ${i.count} opportunities (${fe(i.value)})`,style:{fontSize:16,fontWeight:600,color:o<2?"#fff":"#1f2937",textAlign:"center"}}}));return{id:"slide-pipeline",title:"Sales Pipeline",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"pipeline-title",type:"text",position:{x:5,y:5,width:60,height:10,unit:"percent"},content:{type:"text",text:"Sales Pipeline",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"pipeline-total",type:"text",position:{x:65,y:5,width:30,height:10,unit:"percent"},content:{type:"text",text:`Total: ${fe(e.pipeline.totalValue)}`,style:{fontSize:28,fontWeight:700,color:"#3b82f6",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...t,...n],notes:"Walk through the pipeline stages and highlight key deals approaching close.",durationMs:6e4}}function ko(e){const t={high:"#ef4444",medium:"#f59e0b",low:"#10b981"},n=e.risks.slice(0,5).flatMap((i,o)=>[{id:`risk-card-${o}`,type:"shape",position:{x:5,y:20+o*15,width:90,height:13,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:t[i.impact],strokeWidth:2,cornerRadius:8},animation:{effect:"slideInLeft",durationMs:400,delayMs:200+o*100}},{id:`risk-name-${o}`,type:"text",position:{x:7,y:21.5+o*15,width:50,height:5,unit:"percent"},content:{type:"text",text:i.name,style:{fontSize:16,fontWeight:600,color:"#1f2937"}}},{id:`risk-impact-${o}`,type:"text",position:{x:58,y:21.5+o*15,width:15,height:5,unit:"percent"},content:{type:"text",text:`Impact: ${i.impact.toUpperCase()}`,style:{fontSize:12,fontWeight:500,color:t[i.impact]}}},{id:`risk-prob-${o}`,type:"text",position:{x:75,y:21.5+o*15,width:18,height:5,unit:"percent"},content:{type:"text",text:`Prob: ${i.probability.toUpperCase()}`,style:{fontSize:12,fontWeight:500,color:"#6b7280"}}},{id:`risk-mitigation-${o}`,type:"text",position:{x:7,y:27+o*15,width:86,height:4,unit:"percent"},content:{type:"text",text:`Mitigation: ${i.mitigation}`,style:{fontSize:12,color:"#6b7280"}}}]);return{id:"slide-risks",title:"Risks & Mitigation",layout:"titleContent",background:{type:"solid",color:"#f9fafb"},elements:[{id:"risks-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Risks & Mitigation",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...n],notes:"Discuss each risk, its current status, and mitigation actions in progress.",durationMs:9e4}}function Io(e){const t={"on-track":"#10b981","at-risk":"#f59e0b",completed:"#3b82f6","not-started":"#9ca3af"},n={"on-track":"✅","at-risk":"⚠️",completed:"🎉","not-started":"⏳"},i=e.plan.slice(0,6).flatMap((o,r)=>[{id:`plan-item-${r}`,type:"shape",position:{x:5,y:18+r*13,width:90,height:11,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:t[o.status],strokeWidth:2,cornerRadius:8},animation:{effect:"slideInRight",durationMs:400,delayMs:200+r*100}},{id:`plan-icon-${r}`,type:"text",position:{x:7,y:20+r*13,width:5,height:7,unit:"percent"},content:{type:"text",text:n[o.status],style:{fontSize:24}}},{id:`plan-goal-${r}`,type:"text",position:{x:13,y:20+r*13,width:60,height:7,unit:"percent"},content:{type:"text",text:o.goal,style:{fontSize:16,fontWeight:500,color:"#1f2937"}}},{id:`plan-status-${r}`,type:"text",position:{x:75,y:20+r*13,width:18,height:7,unit:"percent"},content:{type:"text",text:o.status.replace("-"," ").toUpperCase(),style:{fontSize:12,fontWeight:600,color:t[o.status],textAlign:"right"}}}]);return{id:"slide-plan",title:"Strategic Plan",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"plan-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Strategic Plan Status",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...i],notes:"Review progress on strategic initiatives and discuss any blockers.",durationMs:6e4}}function Co(e){const t=e.team||{headcount:0,newHires:0,departures:0,highlights:[]};return{id:"slide-team",title:"Team Updates",layout:"twoColumn",background:{type:"gradient",gradientStops:[{color:"#f0f9ff",position:0},{color:"#e0f2fe",position:100}],gradientDirection:180},elements:[{id:"team-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Team Updates",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"team-headcount-card",type:"shape",position:{x:5,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#3b82f6",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},{id:"team-headcount-icon",type:"text",position:{x:12,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"👥",style:{fontSize:40,textAlign:"center"}}},{id:"team-headcount-value",type:"text",position:{x:7,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:t.headcount.toString(),style:{fontSize:36,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"team-headcount-label",type:"text",position:{x:7,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"Total Headcount",style:{fontSize:12,color:"#6b7280",textAlign:"center"}}},{id:"team-new-card",type:"shape",position:{x:36,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#10b981",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:350}},{id:"team-new-icon",type:"text",position:{x:43,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"🆕",style:{fontSize:40,textAlign:"center"}}},{id:"team-new-value",type:"text",position:{x:38,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:`+${t.newHires||0}`,style:{fontSize:36,fontWeight:700,color:"#10b981",textAlign:"center"}}},{id:"team-new-label",type:"text",position:{x:38,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"New Hires",style:{fontSize:12,color:"#6b7280",textAlign:"center"}}},{id:"team-dept-card",type:"shape",position:{x:67,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#f59e0b",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:500}},{id:"team-dept-icon",type:"text",position:{x:74,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"👋",style:{fontSize:40,textAlign:"center"}}},{id:"team-dept-value",type:"text",position:{x:69,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:`-${t.departures||0}`,style:{fontSize:36,fontWeight:700,color:"#f59e0b",textAlign:"center"}}},{id:"team-dept-label",type:"text",position:{x:69,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"Departures",style:{fontSize:12,color:"#6b7280",textAlign:"center"}}},{id:"team-highlights-title",type:"text",position:{x:5,y:50,width:90,height:6,unit:"percent"},content:{type:"text",text:"Team Highlights",style:{fontSize:24,fontWeight:600,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}},...(t.highlights||[]).slice(0,4).map((n,i)=>({id:`team-highlight-${i}`,type:"text",position:{x:7,y:58+i*8,width:88,height:6,unit:"percent"},content:{type:"text",text:`• ${n}`,style:{fontSize:16,color:"#374151"}},animation:{effect:"slideInLeft",durationMs:300,delayMs:800+i*100}}))],notes:"Celebrate new team members and acknowledge departures. Highlight team achievements.",durationMs:45e3}}function Mo(e){return{id:"slide-qa",title:"Q&A",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3b82f6",position:100}],gradientDirection:135},elements:[{id:"qa-title",type:"text",position:{x:10,y:35,width:80,height:20,unit:"percent"},content:{type:"text",text:"Questions?",style:{fontFamily:"Inter, sans-serif",fontSize:72,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:800,delayMs:200}},{id:"qa-subtitle",type:"text",position:{x:10,y:55,width:80,height:10,unit:"percent"},content:{type:"text",text:"Thank you for your attention",style:{fontFamily:"Inter, sans-serif",fontSize:28,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:800}},{id:"qa-contact",type:"text",position:{x:10,y:85,width:80,height:5,unit:"percent"},content:{type:"text",text:e.preparedBy?`Prepared by: ${e.preparedBy}`:e.companyName,style:{fontSize:16,color:"#bfdbfe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Open floor for questions. Have backup slides ready for detailed questions.",durationMs:3e5}}function zo(e){return{version:"1.0",id:`quarterly-report-${e.quarter}-${e.year}`,title:`${e.quarter} ${e.year} Quarterly Report - ${e.companyName}`,author:e.preparedBy,slideSize:{width:1920,height:1080,unit:"px"},slides:[xo(e),bo(e),vo(e),So(e),wo(e),ko(e),Io(e),Co(e),Mo(e)],theme:{colors:{primary:"#3b82f6",secondary:"#10b981",background:"#fff",text:"#1f2937",accent:"#f59e0b"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["quarterly-report",e.quarter,e.year.toString()],templateId:"quarterly-report-v1"}}}function Ao(){return{quarter:"Q4",year:2024,companyName:"TechCorp Inc.",reportDate:"January 15, 2025",preparedBy:"Finance Team",kpis:{revenue:{value:125e5,change:15.3,target:12e6},profit:{value:28e5,change:8.7,target:25e5},customers:{value:1250,change:22.5,target:1e3},satisfaction:{value:92,change:3.2,target:90}},financials:{revenueByMonth:[{month:"Oct",value:38e5,lastYear:32e5},{month:"Nov",value:42e5,lastYear:35e5},{month:"Dec",value:45e5,lastYear:4e6}],costBreakdown:[{category:"Personnel",value:52e5,percentage:42},{category:"Infrastructure",value:23e5,percentage:18},{category:"Marketing",value:18e5,percentage:14},{category:"R&D",value:15e5,percentage:12},{category:"Operations",value:11e5,percentage:9},{category:"Other",value:6e5,percentage:5}],profitMargin:[{month:"Oct",margin:21},{month:"Nov",margin:22},{month:"Dec",margin:24}]},pipeline:{totalValue:185e5,opportunities:[{stage:"Qualified",count:45,value:85e5},{stage:"Proposal",count:28,value:52e5},{stage:"Negotiation",count:15,value:32e5},{stage:"Closing",count:8,value:16e5}]},risks:[{name:"Supply chain delays",impact:"high",probability:"medium",mitigation:"Diversifying suppliers and increasing inventory buffer",owner:"Operations"},{name:"Key talent retention",impact:"high",probability:"low",mitigation:"Competitive compensation review and career development programs",owner:"HR"},{name:"Market competition",impact:"medium",probability:"high",mitigation:"Accelerating product innovation and customer loyalty programs",owner:"Product"}],plan:[{goal:"Launch v2.0 platform",status:"on-track",dueDate:"Q1 2025",owner:"Engineering"},{goal:"Expand to EMEA market",status:"at-risk",dueDate:"Q2 2025",owner:"Sales"},{goal:"Achieve SOC2 certification",status:"completed",owner:"Security"},{goal:"Implement AI-powered support",status:"on-track",dueDate:"Q1 2025",owner:"Support"},{goal:"Reduce customer churn by 15%",status:"on-track",dueDate:"Q4 2024",owner:"Customer Success"}],team:{headcount:156,newHires:23,departures:8,highlights:["Promoted 12 team members to senior roles","Launched engineering mentorship program","Achieved 95% employee engagement score","Completed company-wide DEI training"]}}}function _o(e){const t=e.problem.painPoints.slice(0,4).map((n,i)=>({id:`pain-${i}`,type:"text",position:{x:55,y:28+i*15,width:40,height:12,unit:"percent"},content:{type:"text",text:`❌ ${n}`,style:{fontSize:20,color:"#374151",lineHeight:1.5}},animation:{effect:"slideInRight",durationMs:400,delayMs:400+i*200}}));return{id:"slide-problem",title:"The Problem",layout:"twoColumn",background:{type:"solid",color:"#fef2f2"},elements:[{id:"problem-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:e.problem.headline,style:{fontSize:48,fontWeight:700,color:"#991b1b"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"problem-icon",type:"text",position:{x:10,y:30,width:35,height:40,unit:"percent"},content:{type:"text",text:"😫",style:{fontSize:150,textAlign:"center"}},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},...t,...(e.problem.statistics||[]).slice(0,2).map((n,i)=>({id:`stat-${i}`,type:"shape",position:{x:5+i*47,y:80,width:43,height:15,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fee2e2",cornerRadius:8},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3+i*200}}))],notes:"Set up the problem. Make the audience feel the pain before presenting the solution.",durationMs:6e4}}function To(e){const t=e.solution.keyBenefits.slice(0,3).flatMap((n,i)=>[{id:`benefit-card-${i}`,type:"shape",position:{x:5+i*32,y:45,width:29,height:45,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#10b981",strokeWidth:2,cornerRadius:12},animation:{effect:"slideInUp",durationMs:500,delayMs:400+i*200}},{id:`benefit-icon-${i}`,type:"text",position:{x:10+i*32,y:50,width:19,height:12,unit:"percent"},content:{type:"text",text:n.icon||"✅",style:{fontSize:48,textAlign:"center"}}},{id:`benefit-title-${i}`,type:"text",position:{x:7+i*32,y:64,width:25,height:8,unit:"percent"},content:{type:"text",text:n.title,style:{fontSize:20,fontWeight:600,color:"#1f2937",textAlign:"center"}}},{id:`benefit-desc-${i}`,type:"text",position:{x:7+i*32,y:73,width:25,height:14,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:14,color:"#6b7280",textAlign:"center",lineHeight:1.4}}}]);return{id:"slide-solution",title:"The Solution",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#ecfdf5",position:0},{color:"#d1fae5",position:100}],gradientDirection:180},elements:[{id:"solution-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:e.solution.headline,style:{fontSize:48,fontWeight:700,color:"#047857"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"solution-desc",type:"text",position:{x:5,y:20,width:90,height:15,unit:"percent"},content:{type:"text",text:e.solution.description,style:{fontSize:24,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},...t],notes:"Introduce your solution as the hero. Emphasize key benefits.",durationMs:6e4}}function $o(e){var n,i;const t=(((n=e.demo)==null?void 0:n.features)||[]).slice(0,5).map((o,r)=>({id:`demo-feature-${r}`,type:"text",position:{x:55,y:25+r*12,width:40,height:10,unit:"percent"},content:{type:"text",text:`▸ ${o.name}`,style:{fontSize:18,color:"#374151",fontWeight:500}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+r*150}}));return{id:"slide-demo",title:"Product Demo",layout:"twoColumn",background:{type:"solid",color:"#fff"},elements:[{id:"demo-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:`See ${e.productName} in Action`,style:{fontSize:44,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"demo-screenshot",type:"shape",position:{x:5,y:22,width:45,height:70,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#f3f4f6",stroke:"#e5e7eb",strokeWidth:2,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:600,delayMs:300}},{id:"demo-placeholder",type:"text",position:{x:15,y:50,width:25,height:10,unit:"percent"},content:{type:"text",text:(i=e.demo)!=null&&i.screenshotUrl?"":"📱 Demo Screenshot",style:{fontSize:20,color:"#9ca3af",textAlign:"center"}}},{id:"features-title",type:"text",position:{x:55,y:18,width:40,height:6,unit:"percent"},content:{type:"text",text:"Key Features",style:{fontSize:24,fontWeight:600,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t],notes:"This is where you do the live demo or show screenshots. Keep it focused.",durationMs:12e4}}function Eo(e){const t=e.features.slice(0,6).flatMap((n,i)=>{const o=Math.floor(i/3),r=i%3,a=n.highlight;return[{id:`feature-card-${i}`,type:"shape",position:{x:5+r*32,y:22+o*38,width:29,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:a?"#3b82f6":"#fff",stroke:a?"#2563eb":"#e5e7eb",strokeWidth:a?3:1,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:200+i*100}},{id:`feature-icon-${i}`,type:"text",position:{x:10+r*32,y:26+o*38,width:19,height:10,unit:"percent"},content:{type:"text",text:n.icon||"⚡",style:{fontSize:36,textAlign:"center"}}},{id:`feature-name-${i}`,type:"text",position:{x:7+r*32,y:37+o*38,width:25,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:18,fontWeight:600,color:a?"#fff":"#1f2937",textAlign:"center"}}},{id:`feature-desc-${i}`,type:"text",position:{x:7+r*32,y:44+o*38,width:25,height:10,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:12,color:a?"#dbeafe":"#6b7280",textAlign:"center",lineHeight:1.3}}}]});return{id:"slide-features",title:"Features",layout:"titleContent",background:{type:"solid",color:"#f9fafb"},elements:[{id:"features-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"Powerful Features",style:{fontSize:44,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Highlight key features. Focus on benefits, not just functionality.",durationMs:6e4}}function Po(e){const t=e.pricing.plans.slice(0,3).flatMap((n,i)=>{const o=n.highlighted,r=o?18:22,a=o?72:65;return[{id:`pricing-card-${i}`,type:"shape",position:{x:5+i*32,y:r,width:29,height:a,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:o?"#3b82f6":"#fff",stroke:o?"#1d4ed8":"#e5e7eb",strokeWidth:o?3:1,cornerRadius:16},animation:{effect:"slideInUp",durationMs:500,delayMs:200+i*150}},...o?[{id:`pricing-badge-${i}`,type:"text",position:{x:10+i*32,y:r+2,width:19,height:4,unit:"percent"},content:{type:"text",text:"⭐ POPULAR",style:{fontSize:12,fontWeight:700,color:"#fcd34d",textAlign:"center"}}}]:[],{id:`pricing-name-${i}`,type:"text",position:{x:7+i*32,y:r+(o?8:5),width:25,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:24,fontWeight:600,color:o?"#fff":"#1f2937",textAlign:"center"}}},{id:`pricing-price-${i}`,type:"text",position:{x:7+i*32,y:r+(o?16:13),width:25,height:10,unit:"percent"},content:{type:"text",text:n.price==="custom"?"Custom":`${e.pricing.currency}${n.price}/${n.period==="month"?"mo":n.period==="year"?"yr":""}`,style:{fontSize:36,fontWeight:700,color:o?"#fff":"#3b82f6",textAlign:"center"}}},...n.features.slice(0,5).map((s,c)=>({id:`pricing-feature-${i}-${c}`,type:"text",position:{x:7+i*32,y:r+(o?28:25)+c*7,width:25,height:5,unit:"percent"},content:{type:"text",text:`✓ ${s}`,style:{fontSize:12,color:o?"#dbeafe":"#6b7280",textAlign:"center"}}})),{id:`pricing-cta-${i}`,type:"shape",position:{x:9+i*32,y:r+a-12,width:21,height:8,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:o?"#fff":"#3b82f6",cornerRadius:8}},{id:`pricing-cta-text-${i}`,type:"text",position:{x:9+i*32,y:r+a-10.5,width:21,height:5,unit:"percent"},content:{type:"text",text:n.cta||"Get Started",style:{fontSize:14,fontWeight:600,color:o?"#3b82f6":"#fff",textAlign:"center"}}}]});return{id:"slide-pricing",title:"Pricing",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"pricing-title",type:"text",position:{x:5,y:3,width:90,height:10,unit:"percent"},content:{type:"text",text:"Simple, Transparent Pricing",style:{fontSize:44,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Present pricing clearly. Emphasize value, not just cost.",durationMs:6e4}}function No(e){return{id:"slide-cta",title:"Call to Action",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1e40af",position:0},{color:"#3b82f6",position:50},{color:"#60a5fa",position:100}],gradientDirection:135},elements:[{id:"cta-headline",type:"text",position:{x:10,y:25,width:80,height:20,unit:"percent"},content:{type:"text",text:e.cta.headline,style:{fontSize:56,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:700,delayMs:0}},...e.cta.subheadline?[{id:"cta-subheadline",type:"text",position:{x:15,y:48,width:70,height:10,unit:"percent"},content:{type:"text",text:e.cta.subheadline,style:{fontSize:24,color:"#bfdbfe",textAlign:"center",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:500,delayMs:500}}]:[],{id:"cta-button",type:"shape",position:{x:35,y:65,width:30,height:12,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",cornerRadius:30},animation:{effect:"slideInUp",durationMs:500,delayMs:800}},{id:"cta-button-text",type:"text",position:{x:35,y:68,width:30,height:6,unit:"percent"},content:{type:"text",text:e.cta.buttonText,style:{fontSize:24,fontWeight:700,color:"#1e40af",textAlign:"center"}}},...e.cta.contactEmail?[{id:"cta-contact",type:"text",position:{x:20,y:82,width:60,height:6,unit:"percent"},content:{type:"text",text:`📧 ${e.cta.contactEmail}`,style:{fontSize:18,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}]:[],...e.cta.websiteUrl?[{id:"cta-website",type:"text",position:{x:20,y:88,width:60,height:5,unit:"percent"},content:{type:"text",text:`🌐 ${e.cta.websiteUrl}`,style:{fontSize:16,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1100}}]:[]],notes:"Strong call to action. Make it easy for them to take the next step.",durationMs:6e4}}function Ro(e){return{id:"slide-title",title:"Title",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#0f172a",position:0},{color:"#1e293b",position:100}],gradientDirection:180},elements:[{id:"title-product",type:"text",position:{x:10,y:30,width:80,height:20,unit:"percent"},content:{type:"text",text:e.productName,style:{fontSize:72,fontWeight:800,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:800,delayMs:200}},{id:"title-tagline",type:"text",position:{x:15,y:52,width:70,height:12,unit:"percent"},content:{type:"text",text:e.tagline,style:{fontSize:28,color:"#94a3b8",textAlign:"center",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:600,delayMs:800}},{id:"title-company",type:"text",position:{x:10,y:88,width:80,height:6,unit:"percent"},content:{type:"text",text:e.companyName,style:{fontSize:18,color:"#64748b",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Opening slide. Create intrigue and set the tone.",durationMs:15e3}}function qo(e){return{version:"1.0",id:`product-pitch-${e.productName.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.productName} - Product Pitch`,slideSize:{width:1920,height:1080,unit:"px"},slides:[Ro(e),_o(e),To(e),$o(e),Eo(e),Po(e),No(e)],theme:{colors:{primary:"#3b82f6",secondary:"#10b981",background:"#fff",text:"#1f2937",accent:"#f59e0b"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["product-pitch","sales"],templateId:"product-pitch-v1"}}}function Do(){return{productName:"FlowSync",tagline:"Seamless workflow automation that actually works",companyName:"FlowSync Inc.",problem:{headline:"Manual processes are killing productivity",painPoints:["Teams waste 20+ hours/week on repetitive tasks","Data silos cause costly errors and delays","No visibility into process bottlenecks","Integration nightmares with existing tools"],statistics:[{stat:"60%",description:"of knowledge workers spend time on busy work"},{stat:"$1.8T",description:"lost annually to inefficient processes"}]},solution:{headline:"Automate in minutes, not months",description:"FlowSync connects your existing tools and automates workflows with AI-powered intelligence. No coding required.",keyBenefits:[{title:"Easy Setup",description:"Connect apps in seconds with 200+ integrations",icon:"🔌"},{title:"AI-Powered",description:"Smart automation that learns from your workflows",icon:"🧠"},{title:"Real-time Insights",description:"Dashboard with live metrics and bottleneck detection",icon:"📊"}]},demo:{features:[{name:"Visual Workflow Builder",description:"Drag-and-drop interface"},{name:"Smart Triggers",description:"Event-based automation"},{name:"Error Handling",description:"Automatic retry and alerts"},{name:"Version Control",description:"Track changes and rollback"},{name:"Team Collaboration",description:"Share and comment on flows"}]},features:[{name:"Visual Builder",description:"Intuitive drag-and-drop workflow design",icon:"🎨",highlight:!0},{name:"200+ Integrations",description:"Connect to popular apps instantly",icon:"🔗"},{name:"AI Suggestions",description:"Get smart automation recommendations",icon:"🤖"},{name:"Real-time Monitoring",description:"Track all workflows in one dashboard",icon:"📈"},{name:"Enterprise Security",description:"SOC2 compliant, encrypted data",icon:"🔒"},{name:"24/7 Support",description:"Expert help whenever you need it",icon:"💬"}],pricing:{currency:"$",plans:[{name:"Starter",price:29,period:"month",features:["5 workflows","1,000 runs/month","10 integrations","Email support"],cta:"Start Free"},{name:"Professional",price:99,period:"month",features:["Unlimited workflows","50,000 runs/month","All integrations","Priority support","AI suggestions"],highlighted:!0,cta:"Try 14 Days Free"},{name:"Enterprise",price:"custom",period:"month",features:["Everything in Pro","Unlimited runs","Dedicated support","Custom integrations","SLA guarantee"],cta:"Contact Sales"}]},cta:{headline:"Ready to automate your workflow?",subheadline:"Join 10,000+ teams already saving hours every week",buttonText:"Start Your Free Trial",contactEmail:"hello@flowsync.io",websiteUrl:"flowsync.io"}}}function Oo(e){const t=Math.round(e.completed.totalPoints/e.completed.committedPoints*100);return{id:"slide-title",title:"Sprint Review",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3b82f6",position:100}],gradientDirection:135},elements:[{id:"title-sprint",type:"text",position:{x:10,y:25,width:80,height:15,unit:"percent"},content:{type:"text",text:`Sprint ${e.sprint.number} Review`,style:{fontSize:64,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"title-name",type:"text",position:{x:15,y:42,width:70,height:8,unit:"percent"},content:{type:"text",text:e.sprint.name,style:{fontSize:32,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},{id:"title-team",type:"text",position:{x:30,y:55,width:40,height:5,unit:"percent"},content:{type:"text",text:`Team ${e.team.name}`,style:{fontSize:20,color:"#bfdbfe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-dates",type:"text",position:{x:25,y:62,width:50,height:5,unit:"percent"},content:{type:"text",text:`${e.sprint.startDate} - ${e.sprint.endDate}`,style:{fontSize:18,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},{id:"title-completion",type:"text",position:{x:35,y:75,width:30,height:10,unit:"percent"},content:{type:"text",text:`${t}% Complete`,style:{fontSize:36,fontWeight:700,color:t>=80?"#4ade80":t>=60?"#fbbf24":"#f87171",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:600,delayMs:800}}],notes:"Welcome stakeholders. Quick overview of sprint completion.",durationMs:3e4}}function jo(e){return{id:"slide-goal",title:"Sprint Goal",layout:"titleContent",background:{type:"solid",color:"#f0f9ff"},elements:[{id:"goal-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Sprint Goal",style:{fontSize:44,fontWeight:700,color:"#1E3A8A"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"goal-card",type:"shape",position:{x:10,y:25,width:80,height:30,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#3b82f6",strokeWidth:3,cornerRadius:16},animation:{effect:"slideInUp",durationMs:500,delayMs:200}},{id:"goal-icon",type:"text",position:{x:15,y:30,width:10,height:15,unit:"percent"},content:{type:"text",text:"🎯",style:{fontSize:64}}},{id:"goal-text",type:"text",position:{x:27,y:32,width:58,height:20,unit:"percent"},content:{type:"text",text:e.sprint.goal,style:{fontSize:28,color:"#1f2937",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"goal-status",type:"text",position:{x:10,y:60,width:80,height:8,unit:"percent"},content:{type:"text",text:e.completed.totalPoints>=e.completed.committedPoints*.8?"✅ Goal Achieved":"⚠️ Goal Partially Met",style:{fontSize:32,fontWeight:600,color:e.completed.totalPoints>=e.completed.committedPoints*.8?"#059669":"#d97706",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:500,delayMs:700}}],notes:"Review whether the sprint goal was achieved and why.",durationMs:45e3}}function Fo(e){const t=e.completed.stories.slice(0,8).map((n,i)=>{const o=Math.floor(i/2),r=i%2,a=n.type==="feature"?"✨":n.type==="bug"?"🐛":n.type==="tech-debt"?"🔧":"🔬",s=n.type==="feature"?"#059669":n.type==="bug"?"#dc2626":n.type==="tech-debt"?"#7c3aed":"#0891b2";return{id:`story-${i}`,type:"text",position:{x:5+r*48,y:22+o*9,width:44,height:7,unit:"percent"},content:{type:"text",text:`${a} ${n.key}: ${n.title}`,style:{fontSize:16,color:s,fontWeight:n.demo?700:400}},animation:{effect:"slideInRight",durationMs:300,delayMs:300+i*100}}});return{id:"slide-completed",title:"Completed Work",layout:"titleContent",background:{type:"solid",color:"#f0fdf4"},elements:[{id:"completed-title",type:"text",position:{x:5,y:5,width:60,height:10,unit:"percent"},content:{type:"text",text:"Completed Work",style:{fontSize:44,fontWeight:700,color:"#166534"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"completed-points",type:"text",position:{x:70,y:5,width:25,height:12,unit:"percent"},content:{type:"text",text:`${e.completed.totalPoints} / ${e.completed.committedPoints} pts`,style:{fontSize:32,fontWeight:700,color:"#059669",textAlign:"right"}},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},...t,{id:"legend",type:"text",position:{x:5,y:90,width:90,height:5,unit:"percent"},content:{type:"text",text:"✨ Feature | 🐛 Bug Fix | 🔧 Tech Debt | 🔬 Spike",style:{fontSize:14,color:"#6b7280",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Walk through completed items. Highlight any notable achievements.",durationMs:9e4}}function Lo(e){const t=Math.max(...e.velocity.history.map(o=>o.points),e.velocity.current),n=e.velocity.history.slice(-5).map((o,r)=>{const a=o.points/t*45;return{id:`bar-${r}`,type:"shape",position:{x:10+r*16,y:75-a,width:12,height:a,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#93c5fd",cornerRadius:8},animation:{effect:"slideInUp",durationMs:500,delayMs:400+r*100}}}),i=e.velocity.current/t*45;return{id:"slide-velocity",title:"Velocity",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"velocity-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Sprint Velocity",style:{fontSize:44,fontWeight:700,color:"#1E3A8A"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...n,{id:"current-bar",type:"shape",position:{x:10+e.velocity.history.slice(-5).length*16,y:75-i,width:12,height:i,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#3b82f6",cornerRadius:8},animation:{effect:"slideInUp",durationMs:600,delayMs:900}},{id:"current-label",type:"text",position:{x:10+e.velocity.history.slice(-5).length*16,y:77,width:12,height:6,unit:"percent"},content:{type:"text",text:`S${e.sprint.number}`,style:{fontSize:14,color:"#1E3A8A",fontWeight:600,textAlign:"center"}}},{id:"current-value",type:"text",position:{x:10+e.velocity.history.slice(-5).length*16,y:70-i,width:12,height:5,unit:"percent"},content:{type:"text",text:`${e.velocity.current}`,style:{fontSize:18,color:"#3b82f6",fontWeight:700,textAlign:"center"}}},{id:"average-line",type:"text",position:{x:5,y:18,width:35,height:10,unit:"percent"},content:{type:"text",text:`Average: ${e.velocity.average} pts/sprint`,style:{fontSize:24,color:"#6b7280"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"trend",type:"text",position:{x:60,y:18,width:35,height:10,unit:"percent"},content:{type:"text",text:e.velocity.current>=e.velocity.average?"📈 On Track":"📉 Below Average",style:{fontSize:24,color:e.velocity.current>=e.velocity.average?"#059669":"#dc2626",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Review velocity trends. Discuss any significant changes.",durationMs:6e4}}function Wo(e){const t=(e.impediments||[]).slice(0,5).map((n,i)=>{const o=n.status==="resolved"?"✅":n.status==="ongoing"?"🔄":"🚨",r=n.status==="resolved"?"#059669":n.status==="ongoing"?"#d97706":"#dc2626";return{id:`impediment-${i}`,type:"text",position:{x:5,y:25+i*13,width:90,height:11,unit:"percent"},content:{type:"text",text:`${o} ${n.description}${n.owner?` (${n.owner})`:""}`,style:{fontSize:20,color:r,lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:400,delayMs:300+i*150}}});return{id:"slide-impediments",title:"Impediments",layout:"titleContent",background:{type:"solid",color:"#fef2f2"},elements:[{id:"impediments-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"Impediments & Blockers",style:{fontSize:44,fontWeight:700,color:"#991b1b"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t,{id:"legend-impediments",type:"text",position:{x:5,y:90,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Resolved | 🔄 Ongoing | 🚨 Escalated",style:{fontSize:14,color:"#6b7280",textAlign:"center"}}}],notes:"Discuss blockers and what help is needed from stakeholders.",durationMs:6e4}}function Bo(e){const t=e.nextSprint.topPriorities.slice(0,5).map((n,i)=>({id:`priority-${i}`,type:"text",position:{x:5,y:45+i*10,width:90,height:8,unit:"percent"},content:{type:"text",text:`${i+1}. ${n.key}: ${n.title}${n.points?` (${n.points} pts)`:""}`,style:{fontSize:20,color:"#374151",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+i*100}}));return{id:"slide-next",title:"Next Sprint",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#eef2ff",position:0},{color:"#e0e7ff",position:100}],gradientDirection:180},elements:[{id:"next-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:`Sprint ${e.sprint.number+1} Preview`,style:{fontSize:44,fontWeight:700,color:"#4338ca"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"next-goal-label",type:"text",position:{x:5,y:18,width:20,height:6,unit:"percent"},content:{type:"text",text:"Sprint Goal:",style:{fontSize:20,fontWeight:600,color:"#6366f1"}}},{id:"next-goal",type:"text",position:{x:5,y:25,width:90,height:12,unit:"percent"},content:{type:"text",text:e.nextSprint.goal,style:{fontSize:28,color:"#1f2937",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"priorities-label",type:"text",position:{x:5,y:40,width:30,height:5,unit:"percent"},content:{type:"text",text:"Top Priorities:",style:{fontSize:20,fontWeight:600,color:"#6366f1"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t,{id:"capacity",type:"text",position:{x:70,y:5,width:25,height:10,unit:"percent"},content:{type:"text",text:`Capacity: ${e.nextSprint.capacity} pts`,style:{fontSize:20,fontWeight:600,color:"#059669",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}}],notes:"Preview next sprint. Get stakeholder input on priorities.",durationMs:6e4}}function Vo(e){const t=[Oo(e),jo(e),Fo(e),Lo(e)];return e.impediments&&e.impediments.length>0&&t.push(Wo(e)),t.push(Bo(e)),{version:"1.0",id:`sprint-review-${e.sprint.number}`,title:`Sprint ${e.sprint.number} Review - ${e.team.name}`,slideSize:{width:1920,height:1080,unit:"px"},slides:t,theme:{colors:{primary:"#3b82f6",secondary:"#10b981",background:"#fff",text:"#1f2937",accent:"#8b5cf6"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["sprint-review","agile","scrum"],templateId:"sprint-review-v1"}}}function Uo(){return{sprint:{number:24,name:"Phoenix Release",startDate:"2024-03-04",endDate:"2024-03-15",goal:"Complete user authentication flow and improve dashboard performance by 50%"},team:{name:"Alpha",members:[{name:"Sarah Chen",role:"Tech Lead"},{name:"Mike Johnson",role:"Senior Dev"},{name:"Emily Davis",role:"Frontend Dev"},{name:"Alex Kim",role:"QA Engineer"}]},completed:{stories:[{key:"AUTH-123",title:"OAuth2 integration",points:8,assignee:"Sarah",type:"feature",demo:!0},{key:"AUTH-124",title:"Password reset flow",points:5,assignee:"Mike",type:"feature",demo:!0},{key:"DASH-45",title:"Query optimization",points:8,assignee:"Sarah",type:"tech-debt"},{key:"DASH-46",title:"Caching layer",points:5,assignee:"Mike",type:"feature"},{key:"BUG-89",title:"Login timeout issue",points:3,assignee:"Emily",type:"bug"},{key:"BUG-90",title:"Memory leak in charts",points:5,assignee:"Emily",type:"bug"}],totalPoints:34,committedPoints:40},notCompleted:[{key:"AUTH-125",title:"MFA implementation",points:6,reason:"Blocked by security review"}],demos:[{title:"OAuth2 Login",description:"Full OAuth2 flow with Google and GitHub",presenter:"Sarah"},{title:"Password Reset",description:"Email-based password reset with security tokens",presenter:"Mike"}],velocity:{current:34,history:[{sprint:"S20",points:28},{sprint:"S21",points:32},{sprint:"S22",points:35},{sprint:"S23",points:30}],average:31},metrics:{bugsFixed:2,bugsCreated:1,testCoverage:78,deployments:3,cycleTime:4.2},impediments:[{description:"Security review delayed MFA implementation",status:"ongoing",owner:"Security Team"},{description:"CI pipeline slow - 45min builds",status:"resolved",owner:"DevOps"}],nextSprint:{goal:"Complete MFA implementation and launch beta user onboarding",topPriorities:[{key:"AUTH-125",title:"MFA implementation",points:6},{key:"ONBOARD-01",title:"Welcome wizard",points:8},{key:"ONBOARD-02",title:"User tutorial system",points:5},{key:"DASH-50",title:"Real-time notifications",points:5}],capacity:32}}}function Ho(e){return{id:"slide-title",title:"Architecture Overview",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#0f172a",position:0},{color:"#1e293b",position:100}],gradientDirection:135},elements:[{id:"title-main",type:"text",position:{x:10,y:28,width:80,height:15,unit:"percent"},content:{type:"text",text:e.project.name,style:{fontSize:64,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"title-subtitle",type:"text",position:{x:15,y:45,width:70,height:8,unit:"percent"},content:{type:"text",text:"Architecture Overview",style:{fontSize:36,color:"#60a5fa",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},{id:"title-version",type:"text",position:{x:35,y:58,width:30,height:5,unit:"percent"},content:{type:"text",text:`v${e.project.version}`,style:{fontSize:20,color:"#94a3b8",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-desc",type:"text",position:{x:15,y:68,width:70,height:12,unit:"percent"},content:{type:"text",text:e.project.description,style:{fontSize:18,color:"#cbd5e1",textAlign:"center",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}},...e.project.team?[{id:"title-team",type:"text",position:{x:10,y:88,width:80,height:5,unit:"percent"},content:{type:"text",text:`Team: ${e.project.team}`,style:{fontSize:16,color:"#64748b",textAlign:"center"}}}]:[]],notes:"Introduction to the system architecture. Set context for the audience.",durationMs:3e4}}function Qo(e){const t=e.systemOverview.keyCharacteristics.slice(0,4).map((n,i)=>[{id:`char-card-${i}`,type:"shape",position:{x:5+i*24,y:65,width:22,height:28,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1e293b",stroke:"#334155",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInUp",durationMs:400,delayMs:600+i*100}},{id:`char-value-${i}`,type:"text",position:{x:7+i*24,y:70,width:18,height:10,unit:"percent"},content:{type:"text",text:n.value,style:{fontSize:32,fontWeight:700,color:"#60a5fa",textAlign:"center"}}},{id:`char-label-${i}`,type:"text",position:{x:7+i*24,y:82,width:18,height:8,unit:"percent"},content:{type:"text",text:n.label,style:{fontSize:14,color:"#94a3b8",textAlign:"center"}}}]).flat();return{id:"slide-overview",title:"System Overview",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"overview-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"System Overview",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"overview-summary",type:"text",position:{x:5,y:18,width:90,height:15,unit:"percent"},content:{type:"text",text:e.systemOverview.summary,style:{fontSize:22,color:"#cbd5e1",lineHeight:1.6}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"diagram-placeholder",type:"shape",position:{x:20,y:35,width:60,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1e293b",stroke:"#334155",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:400}},{id:"diagram-label",type:"text",position:{x:35,y:45,width:30,height:6,unit:"percent"},content:{type:"text",text:"📊 System Diagram",style:{fontSize:18,color:"#64748b",textAlign:"center"}}},...t],notes:"High-level system overview. Explain the main purpose and characteristics.",durationMs:6e4}}function Yo(e){const t={frontend:"#3b82f6",backend:"#10b981",service:"#8b5cf6",database:"#f59e0b",cache:"#ec4899",queue:"#06b6d4",external:"#6b7280"},n={frontend:"🖥️",backend:"⚙️",service:"🔧",database:"🗄️",cache:"⚡",queue:"📬",external:"🔗"},i=e.components.slice(0,6).flatMap((o,r)=>{const a=Math.floor(r/3),s=r%3,c=t[o.type]||"#6b7280",u=n[o.type]||"📦";return[{id:`comp-card-${r}`,type:"shape",position:{x:5+s*32,y:22+a*38,width:29,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1e293b",stroke:c,strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:200+r*100}},{id:`comp-icon-${r}`,type:"text",position:{x:7+s*32,y:25+a*38,width:6,height:8,unit:"percent"},content:{type:"text",text:u,style:{fontSize:28}}},{id:`comp-name-${r}`,type:"text",position:{x:14+s*32,y:26+a*38,width:18,height:6,unit:"percent"},content:{type:"text",text:o.name,style:{fontSize:18,fontWeight:600,color:"#f8fafc"}}},{id:`comp-tech-${r}`,type:"text",position:{x:7+s*32,y:34+a*38,width:25,height:5,unit:"percent"},content:{type:"text",text:o.technology,style:{fontSize:12,color:c,fontWeight:500}}},{id:`comp-desc-${r}`,type:"text",position:{x:7+s*32,y:40+a*38,width:25,height:14,unit:"percent"},content:{type:"text",text:o.description,style:{fontSize:12,color:"#94a3b8",lineHeight:1.4}}}]});return{id:"slide-components",title:"Components",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"components-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"System Components",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...i],notes:"Walk through each component. Explain responsibilities and interactions.",durationMs:9e4}}function Go(e){const n=[{key:"frontend",label:"Frontend",icon:"🖥️",color:"#3b82f6"},{key:"backend",label:"Backend",icon:"⚙️",color:"#10b981"},{key:"database",label:"Database",icon:"🗄️",color:"#f59e0b"},{key:"infrastructure",label:"Infrastructure",icon:"☁️",color:"#8b5cf6"}].flatMap((i,o)=>{const r=e.techStack[i.key];if(!r||r.length===0)return[];const a=o%2,s=Math.floor(o/2);return[{id:`tech-header-${i.key}`,type:"text",position:{x:5+a*48,y:20+s*40,width:44,height:6,unit:"percent"},content:{type:"text",text:`${i.icon} ${i.label}`,style:{fontSize:24,fontWeight:600,color:i.color}},animation:{effect:"fadeIn",durationMs:400,delayMs:200+o*100}},...r.slice(0,4).map((c,u)=>({id:`tech-item-${i.key}-${u}`,type:"text",position:{x:7+a*48,y:28+s*40+u*7,width:40,height:5,unit:"percent"},content:{type:"text",text:`• ${c.name}${c.version?` v${c.version}`:""} - ${c.purpose}`,style:{fontSize:14,color:"#cbd5e1",lineHeight:1.3}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+o*100+u*50}}))]});return{id:"slide-techstack",title:"Tech Stack",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"techstack-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Technology Stack",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...n],notes:"Overview of technologies used. Explain key decisions.",durationMs:6e4}}function Ko(e){const t=e.infrastructure.services.slice(0,8).map((n,i)=>{const o=i%4,r=Math.floor(i/4);return{id:`infra-svc-${i}`,type:"text",position:{x:5+o*24,y:50+r*15,width:22,height:12,unit:"percent"},content:{type:"text",text:`${n.icon||"☁️"} ${n.name}
102
- ${n.purpose}`,style:{fontSize:14,color:"#cbd5e1",textAlign:"center",lineHeight:1.4}},animation:{effect:"zoomIn",durationMs:300,delayMs:400+i*80}}});return{id:"slide-infrastructure",title:"Infrastructure",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#0f172a",position:0},{color:"#1E1B4B",position:100}],gradientDirection:180},elements:[{id:"infra-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Infrastructure",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"infra-provider",type:"text",position:{x:5,y:18,width:45,height:8,unit:"percent"},content:{type:"text",text:`☁️ Provider: ${e.infrastructure.provider}`,style:{fontSize:24,color:"#a78bfa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...e.infrastructure.regions?[{id:"infra-regions",type:"text",position:{x:55,y:18,width:40,height:8,unit:"percent"},content:{type:"text",text:`🌍 Regions: ${e.infrastructure.regions.join(", ")}`,style:{fontSize:18,color:"#94a3b8",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}}]:[],{id:"infra-diagram",type:"shape",position:{x:15,y:28,width:70,height:18,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1e293b",stroke:"#8b5cf6",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:350}},{id:"infra-diagram-text",type:"text",position:{x:35,y:35,width:30,height:5,unit:"percent"},content:{type:"text",text:"🏗️ Infrastructure Diagram",style:{fontSize:16,color:"#64748b",textAlign:"center"}}},...t],notes:"Explain infrastructure setup, scaling strategy, and deployment.",durationMs:6e4}}function Xo(e){if(!e.security)return{id:"slide-security",title:"Security",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"security-placeholder",type:"text",position:{x:30,y:45,width:40,height:10,unit:"percent"},content:{type:"text",text:"Security details to be added",style:{fontSize:24,color:"#64748b",textAlign:"center"}}}],durationMs:3e4};const t=e.security.practices.slice(0,6).map((n,i)=>({id:`practice-${i}`,type:"text",position:{x:5,y:55+i*7,width:90,height:5,unit:"percent"},content:{type:"text",text:`✓ ${n}`,style:{fontSize:18,color:"#4ade80"}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+i*100}}));return{id:"slide-security",title:"Security",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"security-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔒 Security",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"security-auth",type:"text",position:{x:5,y:20,width:45,height:10,unit:"percent"},content:{type:"text",text:`🔑 Auth: ${e.security.authMethod}`,style:{fontSize:22,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"security-encryption",type:"text",position:{x:5,y:30,width:45,height:10,unit:"percent"},content:{type:"text",text:`🔐 Encryption: ${e.security.encryption}`,style:{fontSize:22,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...e.security.compliance?[{id:"security-compliance",type:"text",position:{x:55,y:20,width:40,height:20,unit:"percent"},content:{type:"text",text:`📋 Compliance:
100
+ </svg>`}function Ee(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const ae=({slide:e,slideSize:t,theme:n,scale:i=1,selectedElementId:o,onSelectElement:r,onElementDrag:a,onElementResize:s,onElementRotate:c,interactive:u=!1,showGrid:f=!1,gridSnap:h=0,className:y})=>{const[p,m]=d.useState(null),[g,b]=d.useState(null),S=d.useCallback(_=>h>0?Math.round(_/h)*h:_,[h]),x=d.useMemo(()=>{const _=e.background;if(_.type==="gradient"&&_.gradientStops){const D=_.gradientStops.map(L=>`${L.color} ${L.position*100}%`).join(", ");return{background:`linear-gradient(${_.gradientDirection??180}deg, ${D})`}}return _.type==="image"&&_.imageUrl?{backgroundImage:`url(${_.imageUrl})`,backgroundSize:_.imageFit??"cover",backgroundPosition:"center",backgroundColor:_.color??n.backgroundColor}:{backgroundColor:_.color??n.backgroundColor}},[e.background,n.backgroundColor]),$=d.useCallback((_,D)=>{!u||D.locked||(_.stopPropagation(),r==null||r(D.id),m({id:D.id,startX:_.clientX,startY:_.clientY,elStartX:D.position.x,elStartY:D.position.y}))},[u,r]),E=d.useCallback(_=>{if(p&&a){const D=(_.clientX-p.startX)/i,L=(_.clientY-p.startY)/i,K=S(p.elStartX+D/t.width*100),G=S(p.elStartY+L/t.height*100);a(p.id,K,G)}if(g&&s){const D=(_.clientX-g.startX)/i/t.width*100,L=(_.clientY-g.startY)/i/t.height*100,K=g.elPos;let{x:G,y:I,width:N,height:v}=K;const O=g.handle;O.includes("e")&&(N=S(Math.max(2,K.width+D))),O.includes("w")&&(N=S(Math.max(2,K.width-D)),G=S(K.x+(K.width-N))),O.includes("s")&&(v=S(Math.max(2,K.height+L))),O.includes("n")&&(v=S(Math.max(2,K.height-L)),I=S(K.y+(K.height-v))),s(g.id,N,v,G,I)}},[p,g,a,s,i,t,S]),R=d.useCallback(()=>{m(null),b(null)},[]),z=d.useCallback((_,D,L)=>{u&&(_.stopPropagation(),_.preventDefault(),b({id:D.id,handle:L,startX:_.clientX,startY:_.clientY,elPos:{...D.position}}))},[u]),V=d.useCallback(_=>{_.target.classList.contains("nice-slide-canvas__surface")&&(r==null||r(null))},[r]);return l.jsxs("div",{role:"presentation",className:`nice-slide-canvas ${y??""}`,style:{width:t.width*i,height:t.height*i,...x,color:n.textColor,fontFamily:n.fontFamily},onMouseMove:E,onMouseUp:R,onMouseLeave:R,onClick:V,children:[l.jsx("div",{className:"nice-slide-canvas__surface"}),f&&l.jsx("svg",{style:{position:"absolute",inset:0,width:"100%",height:"100%",pointerEvents:"none",opacity:.15},children:Array.from({length:9},(_,D)=>{const L=(D+1)*10;return l.jsxs(d.Fragment,{children:[l.jsx("line",{x1:`${L}%`,y1:"0",x2:`${L}%`,y2:"100%",stroke:"var(--nice-text-secondary, #666)",strokeWidth:"0.5"}),l.jsx("line",{x1:"0",y1:`${L}%`,x2:"100%",y2:`${L}%`,stroke:"var(--nice-text-secondary, #666)",strokeWidth:"0.5"})]},D)})}),[...e.elements].sort((_,D)=>(_.zIndex??0)-(D.zIndex??0)).map(_=>l.jsx(Gt,{element:_,slideSize:t,scale:i,theme:n,isSelected:o===_.id,onMouseDown:D=>$(D,_),onResizeStart:(D,L)=>z(D,_,L),interactive:u},_.id))]})};process.env.NODE_ENV!=="production"&&(ae.displayName="SlideCanvas");const Qt=["nw","n","ne","e","se","s","sw","w"],Kt={nw:"nwse-resize",n:"ns-resize",ne:"nesw-resize",e:"ew-resize",se:"nwse-resize",s:"ns-resize",sw:"nesw-resize",w:"ew-resize"},Yt={nw:{top:-4,left:-4},n:{top:-4,left:"50%",marginLeft:-4},ne:{top:-4,right:-4},e:{top:"50%",right:-4,marginTop:-4},se:{bottom:-4,right:-4},s:{bottom:-4,left:"50%",marginLeft:-4},sw:{bottom:-4,left:-4},w:{top:"50%",left:-4,marginTop:-4}},Gt=({element:e,slideSize:t,scale:n,theme:i,isSelected:o,onMouseDown:r,onResizeStart:a,interactive:s})=>{const{position:c,content:u,rotation:f,opacity:h}=e,y=c.x/100*t.width*n,p=c.y/100*t.height*n,m=c.width/100*t.width*n,g=c.height/100*t.height*n,b={position:"absolute",left:y,top:p,width:m,height:g,opacity:h??1,transform:f?`rotate(${f}deg)`:void 0,cursor:s&&!e.locked?"move":"default",outline:o?"2px solid var(--nice-primary, #2196f3)":void 0,outlineOffset:o?2:void 0,zIndex:e.zIndex??0};return l.jsxs("div",{style:b,onMouseDown:r,children:[Xt(u,m,g,n,i),o&&s&&!e.locked&&Qt.map(S=>l.jsx("div",{style:{position:"absolute",width:8,height:8,background:"var(--nice-primary, #2196f3)",border:"1px solid var(--nice-bg, #FFF)",borderRadius:2,cursor:Kt[S],zIndex:10,...Yt[S]},onMouseDown:x=>a(x,S)},S))]})};function Xt(e,t,n,i,o){switch(e.kind){case"text":{const r=e;return l.jsx("div",{style:{width:"100%",height:"100%",fontSize:(r.fontSize??16)*i,fontFamily:r.fontFamily??o.fontFamily,fontWeight:r.fontWeight??"normal",color:r.fontColor??o.textColor,textAlign:r.textAlign??"left",lineHeight:r.lineHeight??1.4,whiteSpace:"pre-wrap",wordBreak:"break-word",overflow:"hidden"},children:r.text})}case"image":{const r=e;return l.jsx("img",{src:r.src,alt:r.alt??"",style:{width:"100%",height:"100%",objectFit:r.objectFit??"contain",borderRadius:r.borderRadius??0,boxShadow:r.shadow?"0 4px 16px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))":void 0}})}case"shape":{const r=e;return l.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:r.fill??"var(--nice-border, #ccc)",border:r.strokeWidth?`${r.strokeWidth}px solid ${r.stroke??"var(--nice-text, #333)"}`:void 0,borderRadius:r.shapeType==="ellipse"?"50%":0}})}case"code":{const r=e;return l.jsx("pre",{style:{width:"100%",height:"100%",margin:0,padding:12*i,fontSize:(r.fontSize??14)*i,fontFamily:o.codeFontFamily??"monospace",backgroundColor:r.theme==="light"?"var(--nice-bg-secondary, #f5f5f5)":"var(--nice-bg, #1e1e1e)",color:r.theme==="light"?"var(--nice-text, #333)":"var(--nice-text, #d4d4d4)",borderRadius:8,overflow:"auto",whiteSpace:"pre"},children:l.jsx("code",{children:r.code})})}case"chart":{const a=Qe(e,t,n);return l.jsx("div",{style:{width:"100%",height:"100%"},dangerouslySetInnerHTML:{__html:a}})}case"table":{const r=e;return l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14*i},children:[l.jsx("thead",{children:l.jsx("tr",{children:r.headers.map((a,s)=>l.jsx("th",{style:{padding:`${6*i}px ${8*i}px`,backgroundColor:r.headerBg??o.primaryColor,color:r.headerColor??"var(--nice-color-white, #fff)",textAlign:"left",borderBottom:`2px solid ${r.borderColor??"var(--nice-border, #ddd)"}`},children:a},s))})}),l.jsx("tbody",{children:r.rows.map((a,s)=>l.jsx("tr",{style:{backgroundColor:r.stripedRows&&s%2===1?"var(--nice-overlay-3, rgba(0, 0, 0, 0.03))":void 0},children:a.map((c,u)=>l.jsx("td",{style:{padding:`${4*i}px ${8*i}px`,borderBottom:`1px solid ${r.borderColor??"var(--nice-border, #eee)"}`},children:c},u))},s))})]})}default:return l.jsx("div",{style:{width:"100%",height:"100%",background:"var(--nice-bg-secondary, #f0f0f0)",borderRadius:4}})}}const Jt=["blank","titleSlide","titleContent","twoColumn","titleOnly","sectionHeader","comparison","custom"],Ie=({slide:e,selectedElement:t,onSlideChange:n,onElementChange:i,onRemoveElement:o,className:r})=>{const a=ne();return e?t&&e?l.jsxs("div",{className:`nice-pres-panel ${r??""}`,children:[l.jsx("h3",{className:"nice-pres-panel__title",children:a("panel.elementProperties")}),l.jsxs("div",{className:"nice-pres-panel__row",children:[l.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["X (%)",l.jsx(T.NiceNumberInput,{value:Math.round(t.position.x*10)/10,min:0,max:100,step:.5,onChange:s=>i==null?void 0:i(e.id,t.id,{position:{...t.position,x:s??0}}),className:"nice-pres-panel__input"})]}),l.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["Y (%)",l.jsx(T.NiceNumberInput,{value:Math.round(t.position.y*10)/10,min:0,max:100,step:.5,onChange:s=>i==null?void 0:i(e.id,t.id,{position:{...t.position,y:s??0}}),className:"nice-pres-panel__input"})]})]}),l.jsxs("div",{className:"nice-pres-panel__row",children:[l.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["W (%)",l.jsx(T.NiceNumberInput,{value:Math.round(t.position.width*10)/10,min:1,max:100,step:.5,onChange:s=>i==null?void 0:i(e.id,t.id,{position:{...t.position,width:s??1}}),className:"nice-pres-panel__input"})]}),l.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["H (%)",l.jsx(T.NiceNumberInput,{value:Math.round(t.position.height*10)/10,min:1,max:100,step:.5,onChange:s=>i==null?void 0:i(e.id,t.id,{position:{...t.position,height:s??1}}),className:"nice-pres-panel__input"})]})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.opacity","Opacity"),l.jsx(T.NiceSlider,{min:0,max:1,step:.05,value:t.opacity??1,onChange:s=>i==null?void 0:i(e.id,t.id,{opacity:s})})]}),t.content.kind==="text"&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"nice-pres-panel__label",children:[a("element.text"),l.jsx("textarea",{value:t.content.text,onChange:s=>i==null?void 0:i(e.id,t.id,{content:{...t.content,text:s.target.value}}),className:"nice-pres-panel__textarea",rows:4})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.fontSize","Font Size"),l.jsx(T.NiceNumberInput,{value:t.content.fontSize??16,min:8,max:200,onChange:s=>i==null?void 0:i(e.id,t.id,{content:{...t.content,fontSize:s??16}}),className:"nice-pres-panel__input"})]})]}),l.jsx(T.NiceButton,{className:"nice-pres-panel__btn nice-pres-panel__btn--danger",variant:"ghost",size:"sm",onClick:()=>o==null?void 0:o(e.id,t.id),children:a("panel.deleteElement","Delete Element")})]}):l.jsxs("div",{className:`nice-pres-panel ${r??""}`,children:[l.jsx("h3",{className:"nice-pres-panel__title",children:a("panel.slideProperties")}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.title","Title"),l.jsx(T.NiceTextInput,{value:e.title,onChange:s=>n==null?void 0:n(e.id,{title:s}),className:"nice-pres-panel__input"})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.layout"),l.jsx(T.NiceSelect,{value:e.layout,onChange:s=>n==null?void 0:n(e.id,{layout:s}),options:Jt.map(s=>({value:s,label:a(`layout.${s}`)})),className:"nice-pres-panel__select"})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.background"),l.jsx(T.NiceColorPicker,{value:e.background.color??"var(--nice-bg, #fff)",onChange:s=>n==null?void 0:n(e.id,{background:{...e.background,type:"solid",color:s}}),className:"nice-pres-panel__color"})]}),l.jsxs("label",{className:"nice-pres-panel__label",children:[a("panel.notes"),l.jsx("textarea",{value:e.notes??"",onChange:s=>n==null?void 0:n(e.id,{notes:s.target.value||void 0}),className:"nice-pres-panel__textarea",rows:4,placeholder:a("panel.notes")})]})]}):l.jsx("div",{className:`nice-pres-panel nice-pres-panel--empty ${r??""}`,children:l.jsx("p",{children:a("panel.noSelection")})})};process.env.NODE_ENV!=="production"&&(Ie.displayName="SlidePropertyPanel");const Zt=180,Ce=({slides:e,slideSize:t,theme:n,currentIndex:i,onSelectSlide:o,onAddSlide:r,onDuplicateSlide:a,onRemoveSlide:s,className:c})=>{const u=ne(),f=Zt/t.width;return l.jsxs("div",{className:`nice-slide-thumbs ${c??""}`,children:[e.map((h,y)=>l.jsxs("div",{role:"button",tabIndex:0,onKeyDown:T.clickOnActivationKey,className:`nice-slide-thumbs__item ${y===i?"nice-slide-thumbs__item--active":""}`,onClick:()=>o(y),children:[l.jsx("div",{className:"nice-slide-thumbs__preview",children:l.jsx(ae,{slide:h,slideSize:t,theme:n,scale:f})}),l.jsxs("div",{className:"nice-slide-thumbs__caption",children:[y+1,". ",h.title]}),(a||s)&&l.jsxs("div",{className:"nice-slide-thumbs__actions",children:[a&&l.jsx(T.NiceButton,{className:"nice-slide-thumbs__action-btn",variant:"ghost",size:"sm",onClick:p=>{p.stopPropagation(),a(h.id)},title:u("toolbar.duplicateSlide"),"aria-label":u("toolbar.duplicateSlide"),children:l.jsx(T.NiceIcon,{name:"copy",size:12})}),s&&e.length>1&&l.jsx(T.NiceButton,{className:"nice-slide-thumbs__action-btn nice-slide-thumbs__action-btn--danger",variant:"ghost",size:"sm",onClick:p=>{p.stopPropagation(),s(h.id)},title:u("toolbar.deleteSlide"),"aria-label":u("toolbar.deleteSlide"),children:l.jsx(T.NiceIcon,{name:"close",size:14})})]})]},h.id)),r&&l.jsxs(T.NiceButton,{className:"nice-slide-thumbs__add",variant:"ghost",size:"sm",onClick:r,children:[l.jsx(T.NiceIcon,{name:"plus",size:12})," ",u("toolbar.addSlide")]})]})};process.env.NODE_ENV!=="production"&&(Ce.displayName="SlideThumbnailList");const en=[{target:".nice-pres-editor",titleKey:"tutorial.presentationEditor.intro.title",title:"Presentation editor",contentKey:"tutorial.presentationEditor.intro.content",content:"Build slides from the thumbnail rail, add and arrange elements on the canvas, edit them in the property panel, then present or export.",placement:"auto"}];function tn(e){const t={x:20,y:20,width:60,height:40};switch(e){case"text":return{position:{x:10,y:30,width:80,height:20},content:{kind:"text",text:"New Text",fontSize:24,textAlign:"left"}};case"shape":return{position:{x:30,y:30,width:40,height:30},content:{kind:"shape",shapeType:"rectangle",fill:"var(--nice-info, #6366f1)",stroke:"var(--nice-accent, #4f46e5)",strokeWidth:2}};case"code":return{position:{x:10,y:20,width:80,height:50},content:{kind:"code",code:`// Your code here
101
+ console.log("Hello!");`,language:"typescript",theme:"dark"}};case"chart":return{position:t,content:{kind:"chart",chartType:"bar",data:{labels:["Q1","Q2","Q3","Q4"],series:[{name:"Revenue",values:[30,45,60,80],color:"var(--nice-info, #6366f1)"}]}}};case"table":return{position:{x:10,y:20,width:80,height:40},content:{kind:"table",headers:["Name","Value","Status"],rows:[["Item A","100","Active"],["Item B","200","Pending"]],stripedRows:!0}};case"image":return{position:t,content:{kind:"image",src:"",alt:"Image",objectFit:"contain"}};case"diagram":return{position:t,content:{kind:"diagram",autoPlayAnimations:!1}};case"icon":return{position:{x:45,y:40,width:10,height:15},content:{kind:"icon",name:"star",size:48,color:"var(--nice-info, #6366f1)"}};default:return{position:t,content:{kind:"text",text:e,fontSize:16}}}}const Ke=({initialDocument:e,onChange:t,onExport:n,onPresent:i,lang:o,showToolbar:r=!0,showThumbnails:a=!0,showPropertyPanel:s=!0,className:c,style:u,tutorial:f})=>{const h=Te(),y=o??h,p=d.useMemo(()=>_e(y),[y]),m=He(e),[g,b]=d.useState(null),[S,x]=d.useState(!1),[$,E]=d.useState(5),R=d.useRef(m.document);m.document!==R.current&&(R.current=m.document,t==null||t(m.document));const z=m.currentSlide,V=d.useMemo(()=>g&&z?z.elements.find(P=>P.id===g)??null:null,[g,z]),_=d.useRef(null),[D,L]=d.useState(null);d.useEffect(()=>{const P=_.current;if(!P||typeof ResizeObserver>"u")return;const W=new ResizeObserver(([F])=>{L({w:F.contentRect.width,h:F.contentRect.height})});return W.observe(P),()=>W.disconnect()},[]);const K=d.useMemo(()=>{const{width:P,height:W}=m.document.slideSize;return!D||D.w<=0||D.h<=0?Math.min(1,800/P):Math.min(1,D.w/P,D.h/W)},[m.document.slideSize,D]),G=d.useCallback(P=>{if(!z)return;const{content:W,position:F}=tn(P),Y=m.addElement(z.id,{type:P,position:F,content:W});Y&&b(Y.id)},[z,m]),I=d.useCallback(P=>{m.addSlide(m.currentSlideIndex,P),m.setCurrentSlideIndex(m.currentSlideIndex+1)},[m]),N=d.useCallback(P=>{m.removeSlide(P),m.currentSlideIndex>=m.slides.length-1&&m.setCurrentSlideIndex(Math.max(0,m.slides.length-2))},[m]),v=d.useCallback((P,W,F)=>{if(!z)return;const Y=z.elements.find(Z=>Z.id===P);Y&&m.moveElement(z.id,P,{...Y.position,x:W,y:F})},[z,m]),O=d.useCallback((P,W,F,Y,Z)=>{if(!z)return;const ee=z.elements.find(te=>te.id===P);ee&&m.moveElement(z.id,P,{...ee.position,width:W,height:F,...Y!=null?{x:Y}:{},...Z!=null?{y:Z}:{}})},[z,m]),B=d.useCallback(()=>{if(!z||!g)return;const P=Math.max(0,...z.elements.map(W=>W.zIndex??0));m.updateElement(z.id,g,{zIndex:P+1})},[z,g,m]),U=d.useCallback(()=>{if(!z||!g)return;const P=Math.min(0,...z.elements.map(W=>W.zIndex??0));m.updateElement(z.id,g,{zIndex:P-1})},[z,g,m]),X=d.useCallback(P=>{const W=m.document;let F;switch(P){case"ndp":F=Ve(W,!0);break;case"html":F=Fe(W);break}n==null||n(P,F)},[m,n]),q=d.useCallback(()=>{i==null||i(m.document,m.currentSlideIndex)},[m,i]),k=r?l.jsx(ke,{onAddElement:G,onAddSlide:I,onUndo:m.undo,onRedo:m.redo,canUndo:m.canUndo,canRedo:m.canRedo,onPresent:q,onExport:X}):void 0,A=r?l.jsxs("div",{style:{display:"flex",gap:4,padding:"2px 8px",borderBottom:"1px solid var(--nice-border-color, #eee)",alignItems:"center",fontSize:"0.85em",flexWrap:"wrap"},children:[l.jsxs(T.NiceButton,{size:"sm",variant:S?"primary":"ghost",onClick:()=>x(P=>!P),children:[l.jsx(T.NiceIcon,{name:"grid",size:14})," ",p("presentationEditor.grid","Grid")]}),V&&l.jsxs(l.Fragment,{children:[l.jsxs(T.NiceButton,{size:"sm",variant:"ghost",onClick:B,title:p("presentationEditor.bringToFront","Bring to front"),children:[l.jsx(T.NiceIcon,{name:"arrow-up",size:14})," ",p("presentationEditor.front","Front")]}),l.jsxs(T.NiceButton,{size:"sm",variant:"ghost",onClick:U,title:p("presentationEditor.sendToBack","Send to back"),children:[l.jsx(T.NiceIcon,{name:"arrow-down",size:14})," ",p("presentationEditor.back","Back")]}),l.jsxs(T.NiceButton,{size:"sm",variant:"ghost",onClick:()=>{if(z&&g){const P={...V,id:`el-${Date.now().toString(36)}`,position:{...V.position,x:V.position.x+3,y:V.position.y+3}};m.addElement(z.id,P)}},title:p("presentationEditor.duplicate","Duplicate"),children:[l.jsx(T.NiceIcon,{name:"copy",size:14})," ",p("presentationEditor.duplicate","Duplicate")]})]})]}):void 0,j=a||z?l.jsxs("div",{style:{display:"flex",minHeight:0,height:"100%"},children:[a&&l.jsx("div",{style:{width:200,flexShrink:0,borderRight:"1px solid var(--nice-border-color, #ddd)",background:"var(--nice-bg-secondary, #fafafa)",overflowY:"auto"},children:l.jsx(Ce,{slides:m.slides,slideSize:m.document.slideSize,theme:m.theme,currentIndex:m.currentSlideIndex,onSelectSlide:m.setCurrentSlideIndex,onAddSlide:()=>I(),onDuplicateSlide:P=>m.duplicateSlide(P),onRemoveSlide:N})}),z&&l.jsxs("div",{style:{width:180,flexShrink:0,borderRight:"1px solid var(--nice-border-color, #ddd)",background:"var(--nice-bg-secondary, #fafafa)",overflowY:"auto",fontSize:"0.85em"},"aria-label":p("presentationEditor.slideElements","Slide elements"),children:[l.jsx("div",{style:{padding:"8px 10px",fontWeight:600,borderBottom:"1px solid var(--nice-border-color, #ddd)",position:"sticky",top:0,background:"var(--nice-bg-secondary, #fafafa)"},children:p("presentationEditor.elements","Elements ({elements})").replace("{elements}",String(z.elements.length))}),z.elements.length===0?l.jsx("div",{style:{padding:10,color:"var(--nice-text-secondary, #888)",fontStyle:"italic"},children:p("presentationEditor.noElementsYet","No elements yet.")}):l.jsx("ul",{style:{listStyle:"none",margin:0,padding:0},children:z.elements.map((P,W)=>{var Z;const F=P.id===g,Y=P.content&&P.content.text?`“${P.content.text.slice(0,20)}”`:((Z=P.content)==null?void 0:Z.kind)||P.type;return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>b(P.id),style:{width:"100%",textAlign:"left",padding:"6px 10px",background:F?"var(--nice-color-primary, #6366f1)":"transparent",color:F?"var(--nice-color-white, #fff)":"inherit",border:"none",borderBottom:"1px solid var(--nice-border-color, #eee)",cursor:"pointer",display:"flex",justifyContent:"space-between",gap:6,font:"inherit"},children:[l.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[W+1,". ",Y]}),l.jsx("span",{style:{opacity:.7,fontSize:"0.75em"},children:P.type})]})},P.id)})})]})]}):void 0,H=s?l.jsx("div",{style:{width:260,height:"100%",borderLeft:"1px solid var(--nice-border-color, #ddd)",overflowY:"auto",background:"var(--nice-bg-secondary, #fafafa)"},children:l.jsx(Ie,{slide:z,selectedElement:V,onSlideChange:m.updateSlide,onElementChange:m.updateElement,onRemoveElement:m.removeElement})}):void 0;return l.jsx(Ue,{lang:y,children:l.jsxs("div",{className:`nice-pres-editor ${c??""}`,style:{position:"relative",height:"100%",maxWidth:"100%",overflow:"hidden",background:"var(--nice-bg-primary, #fff)",color:"var(--nice-text-primary, #111)",...u},children:[l.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:l.jsx(T.NiceTutorialButton,{steps:T.resolveTutorial(f,en)})}),l.jsx(T.NiceAppShell,{flush:!0,menubar:k,toolbar:A,sidebar:j,rightSidebar:H,children:l.jsx("div",{ref:_,style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--nice-bg-tertiary, #e8e8e8)",overflow:"auto",padding:24,minWidth:0},children:z&&l.jsx(ae,{slide:z,slideSize:m.document.slideSize,theme:m.theme,scale:K,selectedElementId:g,onSelectElement:b,onElementDrag:v,onElementResize:O,showGrid:S,gridSnap:$,interactive:!0})})})]})})};process.env.NODE_ENV!=="production"&&(Ke.displayName="NicePresentationEditor");const qe={linear:e=>e,easeIn:e=>e*e,easeOut:e=>e*(2-e),easeInOut:e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*.5)*Math.exp(-6*e),bounce:e=>{if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const n=e-.5454545454545454;return 7.5625*n*n+.75}if(e<2.5/2.75){const n=e-.8181818181818182;return 7.5625*n*n+.9375}const t=e-2.625/2.75;return 7.5625*t*t+.984375}},xe={opacity:1,transform:"",filter:"",visible:!0};function nn(e,t,n){if(!e)return{...xe};const i=e.entrance;if(!i)return{...xe};if((e.trigger==="onClick"||e.trigger==="afterPrevious")&&!n)return{...xe,opacity:0,visible:!1};const o=i.delayMs??0,r=t-o;if(r<0)return{...xe,opacity:0,visible:!1};const a=Math.min(r/i.durationMs,1),s=(qe[i.easing??"linear"]??qe.linear)(a);return on(i.effect,s)}function on(e,t){const n={opacity:1,transform:"",filter:"",visible:!0};switch(e){case"fadeIn":n.opacity=t;break;case"fadeOut":n.opacity=1-t;break;case"slideInLeft":n.transform=`translateX(${-100*(1-t)}%)`,n.opacity=t;break;case"slideInRight":n.transform=`translateX(${100*(1-t)}%)`,n.opacity=t;break;case"slideInTop":n.transform=`translateY(${-100*(1-t)}%)`,n.opacity=t;break;case"slideInBottom":n.transform=`translateY(${100*(1-t)}%)`,n.opacity=t;break;case"zoomIn":n.transform=`scale(${t})`,n.opacity=t;break;case"zoomOut":n.transform=`scale(${2-t})`,n.opacity=t;break;case"bounceIn":n.transform=`scale(${t>.8?1+.1*Math.sin((t-.8)/.2*Math.PI):t})`,n.opacity=t;break;case"flipInX":n.transform=`perspective(400px) rotateX(${90*(1-t)}deg)`,n.opacity=t;break;case"flipInY":n.transform=`perspective(400px) rotateY(${90*(1-t)}deg)`,n.opacity=t;break;case"rotateIn":n.transform=`rotate(${-180*(1-t)}deg) scale(${t})`,n.opacity=t;break;case"typewriter":n.opacity=t>0?1:0;break;case"wipeLeft":n.transform=`scaleX(${t})`,n.opacity=1;break;case"wipeRight":n.transform=`scaleX(${t})`,n.opacity=1;break;case"splitReveal":n.transform=`scaleY(${t})`,n.opacity=1;break;case"pulse":n.transform=`scale(${1+.05*Math.sin(t*Math.PI*4)})`;break;case"shake":n.transform=`translateX(${5*Math.sin(t*Math.PI*8)*(1-t)}px)`;break;case"glow":n.filter=`drop-shadow(0 0 ${8*t}px gold)`;break}return n}function Ye(e,t,n="left"){const i={},o={};switch(e){case"fade":i.opacity=1-t,o.opacity=t;break;case"slide":{const r=n==="right"||n==="down"?-1:1,a=n==="up"||n==="down"?"Y":"X";i.transform=`translate${a}(${-r*t*100}%)`,o.transform=`translate${a}(${r*(1-t)*100}%)`;break}case"zoom":i.transform=`scale(${1-t*.3})`,i.opacity=1-t,o.transform=`scale(${.7+t*.3})`,o.opacity=t;break;case"flip":i.transform=`perspective(1000px) rotateY(${t*90}deg)`,i.opacity=t>.5?0:1,o.transform=`perspective(1000px) rotateY(${(1-t)*-90}deg)`,o.opacity=t>.5?1:0;break;default:i.opacity=1-t,o.opacity=t;break}return{outgoing:i,incoming:o}}const rn={width:1920,height:1080},an={width:1024,height:768},sn={width:2560,height:1440},Ge={name:"Corporate",backgroundColor:"#fff",primaryColor:"#1a365d",secondaryColor:"#2b6cb0",accentColor:"#ed8936",textColor:"#2d3748",headingColor:"#1a365d",fontFamily:'"Segoe UI", Roboto, sans-serif',headingFontFamily:'"Segoe UI", Roboto, sans-serif',codeFontFamily:'"Cascadia Code", "Fira Code", monospace'},cn={name:"Modern Dark",backgroundColor:"#1a1a2e",primaryColor:"#e94560",secondaryColor:"#0f3460",accentColor:"#16213e",textColor:"#e0e0e0",headingColor:"#fff",fontFamily:"Inter, sans-serif",headingFontFamily:"Inter, sans-serif",codeFontFamily:'"JetBrains Mono", monospace'},ln={name:"Minimal",backgroundColor:"#fafafa",primaryColor:"#333333",secondaryColor:"#666666",accentColor:"#2196f3",textColor:"#333333",headingColor:"#111111",fontFamily:'"Helvetica Neue", Arial, sans-serif',codeFontFamily:'"SF Mono", monospace'},dn={name:"NiceToDev",backgroundColor:"#f8f9fa",primaryColor:"#6366f1",secondaryColor:"#8b5cf6",accentColor:"#06b6d4",textColor:"#334155",headingColor:"#1e293b",fontFamily:"Inter, sans-serif",headingFontFamily:'"Plus Jakarta Sans", Inter, sans-serif',codeFontFamily:'"Fira Code", monospace'},un=500,Xe=({document:e,startSlide:t=0,onExit:n,autoAdvanceMs:i=0,showNotes:o=!1,showSlideNumber:r=!0,showProgressBar:a=!0,showTimer:s=!1,enableTouch:c=!0,autoFullscreen:u=!1,className:f})=>{const h=ne(),[y,p]=d.useState(t),[m,g]=d.useState(0),[b,S]=d.useState(!1),[x,$]=d.useState(0),[E,R]=d.useState(null),[z,V]=d.useState(!1),[_,D]=d.useState(0),L=d.useRef(null),K=d.useRef(0),G=d.useRef(null),I=d.useRef(null),N=e.slides,v=N[y]??null,O=E!==null?N[E]??null:null,B=e.theme??Ge,U=e.slideSize,X=N.length,q=d.useMemo(()=>{if(!v)return 0;const C=v.elements.filter(M=>{var Q;return(Q=M.animation)==null?void 0:Q.entrance}).map(M=>{var Q;return((Q=M.animation)==null?void 0:Q.buildOrder)??0});return C.length>0?Math.max(...C)+1:0},[v]),k=d.useCallback(C=>{var se,ce;if(C<0||C>=X||C===y||b)return;const M=N[C];if((((se=M==null?void 0:M.transition)==null?void 0:se.effect)??"none")==="none"){R(null),p(C),g(0);return}R(y),p(C),g(0),S(!0);const J=((ce=M==null?void 0:M.transition)==null?void 0:ce.durationMs)??un,le=performance.now(),ue=ge=>{const Ne=Math.min(1,(ge-le)/J);$(Ne),Ne<1?K.current=requestAnimationFrame(ue):(S(!1),R(null))};K.current=requestAnimationFrame(ue)},[y,X,b,N]),A=d.useCallback(()=>{if(m<q){g(C=>C+1);return}y<X-1&&k(y+1)},[m,q,y,X,k]),j=d.useCallback(()=>{if(m>0){g(C=>C-1);return}y>0&&k(y-1)},[m,y,k]),H=d.useCallback(C=>{var J;const M=C.target instanceof HTMLElement?C.target:document.body;if(M.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(M.tagName)||M!==document.body&&!((J=L.current)!=null&&J.contains(M)))return!1;const Q=C.niceSource;return C.key.startsWith("Arrow")&&Q&&Q!=="keyboard"&&M!==document.body&&M!==L.current?!1:!((C.key===" "||C.key==="Enter")&&M.closest('button, a[href], [role="button"], [role="menuitem"], [role="tab"]'))},[]);d.useEffect(()=>{const C=M=>{if(H(M))switch(M.key){case"ArrowRight":case"ArrowDown":case" ":case"Enter":M.preventDefault(),A();break;case"ArrowLeft":case"ArrowUp":case"Backspace":M.preventDefault(),j();break;case"Escape":M.preventDefault(),n==null||n();break;case"Home":M.preventDefault(),k(0);break;case"End":M.preventDefault(),k(X-1);break}};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[H,A,j,n,k,X]);const P=d.useCallback(C=>{if(!c)return;const M=C.touches[0];G.current={x:M.clientX,y:M.clientY,time:Date.now()}},[c]),W=d.useCallback(C=>{if(!c||!G.current)return;const M=C.changedTouches[0],Q=M.clientX-G.current.x,J=M.clientY-G.current.y,le=Date.now()-G.current.time;if(G.current=null,le>500||Math.abs(Q)<30&&Math.abs(J)<30){A();return}Math.abs(Q)>Math.abs(J)&&(Q<-30?A():Q>30&&j())},[c,A,j]);d.useEffect(()=>{if(s)return I.current=setInterval(()=>D(C=>C+1e3),1e3),()=>{I.current&&clearInterval(I.current)}},[s]);const F=C=>{const M=Math.floor(C/1e3),Q=Math.floor(M/60),J=Math.floor(Q/60);return J>0?`${J}:${String(Q%60).padStart(2,"0")}:${String(M%60).padStart(2,"0")}`:`${Q}:${String(M%60).padStart(2,"0")}`};d.useEffect(()=>{const C=M=>{(M.key==="g"||M.key==="G")&&H(M)&&V(Q=>!Q)};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[H]),d.useEffect(()=>{if(i<=0||b)return;const C=setTimeout(A,i);return()=>clearTimeout(C)},[i,A,b,y,m]),d.useEffect(()=>{var M;const C=L.current;return u&&C&&!window.document.fullscreenElement&&((M=C.requestFullscreen)==null||M.call(C).catch(()=>{})),()=>{var Q,J;u&&window.document.fullscreenElement&&((J=(Q=window.document).exitFullscreen)==null||J.call(Q).catch(()=>{})),K.current&&cancelAnimationFrame(K.current)}},[]);const Y=d.useMemo(()=>v?v.elements.filter(C=>{var Q;return(Q=C.animation)!=null&&Q.entrance?(C.animation.buildOrder??0)<=m:!0}):[],[v,m]),Z=d.useMemo(()=>{if(!b||!v)return{outgoing:{},incoming:{}};const C=v.transition??{effect:"fade"};return Ye(C.effect,x,C.direction)},[b,v,x]),[ee,te]=d.useState(1),[ie,me]=d.useState(!1);d.useEffect(()=>{const C=()=>{const Q=U.width,J=U.height,le=!!window.document.fullscreenElement;me(le);const ue=L.current;let se,ce;if(le||u)se=window.innerWidth,ce=window.innerHeight;else if(ue){const ge=ue.getBoundingClientRect();se=ge.width||Q,ce=ge.height||J}else se=Q,ce=J;te(Math.min(se/Q,ce/J))};C();const M=typeof ResizeObserver<"u"&&L.current?new ResizeObserver(C):null;return M&&L.current&&M.observe(L.current),window.addEventListener("resize",C),window.document.addEventListener("fullscreenchange",C),()=>{window.removeEventListener("resize",C),window.document.removeEventListener("fullscreenchange",C),M==null||M.disconnect()}},[U,u]);const he=d.useCallback(()=>{var M,Q,J;const C=L.current;C&&(window.document.fullscreenElement?(Q=(M=window.document).exitFullscreen)==null||Q.call(M).catch(()=>{}):(J=C.requestFullscreen)==null||J.call(C).catch(()=>{}))},[]),ye=u||ie;return l.jsxs("div",{role:"presentation",ref:L,className:`nice-pres-player ${f??""}`,style:ye?{position:"fixed",inset:0,background:"#000",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",cursor:"none",zIndex:9999}:{position:"relative",width:"100%",height:"100%",minHeight:240,background:"#000",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},onClick:A,onContextMenu:C=>{C.preventDefault(),j()},onTouchStart:P,onTouchEnd:W,children:[z&&l.jsx("div",{role:"presentation",style:{position:"absolute",inset:0,zIndex:100,background:"var(--nice-overlay-90, rgba(0, 0, 0, 0.9))",overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:16,padding:24,alignContent:"start"},onClick:C=>C.stopPropagation(),children:N.map((C,M)=>l.jsxs("div",{role:"button",tabIndex:0,onKeyDown:T.clickOnActivationKey,style:{cursor:"pointer",border:M===y?"3px solid var(--nice-primary, #2196f3)":"2px solid transparent",borderRadius:4,overflow:"hidden"},onClick:()=>{k(M),V(!1)},children:[l.jsx(ae,{slide:C,slideSize:U,theme:B,scale:240/U.width,interactive:!1}),l.jsxs("div",{style:{color:"var(--nice-text-primary, #fff)",fontSize:12,textAlign:"center",padding:4},children:[M+1,". ",C.title]})]},C.id))}),b&&O&&l.jsx("div",{style:{position:"absolute",...Z.outgoing},children:l.jsx(ae,{slide:O,slideSize:U,theme:B,scale:ee,interactive:!1})}),v&&l.jsx("div",{style:{position:"absolute",...b?Z.incoming:{}},children:l.jsx(ae,{slide:{...v,elements:Y},slideSize:U,theme:B,scale:ee,interactive:!1})}),r&&l.jsxs("div",{style:{position:"absolute",bottom:12,right:20,color:"var(--nice-overlay-light-50, rgba(255, 255, 255, 0.5))",fontSize:14,fontFamily:"sans-serif",pointerEvents:"none"},children:[y+1," / ",X]}),o&&(v==null?void 0:v.notes)&&l.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",color:"var(--nice-color-white, #fff)",padding:"12px 24px",fontSize:14,fontFamily:"sans-serif",maxHeight:"20vh",overflowY:"auto",pointerEvents:"none"},children:v.notes}),a&&l.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:3,background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",pointerEvents:"none",zIndex:50},children:l.jsx("div",{style:{height:"100%",width:`${(y+1)/X*100}%`,background:"var(--nice-primary, #2196f3)",transition:"width 0.3s ease"}})}),s&&l.jsx("div",{style:{position:"absolute",top:12,right:20,color:"var(--nice-overlay-light-50, rgba(255, 255, 255, 0.5))",fontSize:14,fontFamily:"monospace",pointerEvents:"none",zIndex:50},children:F(_)}),l.jsxs("div",{className:"nice-pres-player-controls",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,opacity:.3},onMouseEnter:C=>{C.currentTarget.style.opacity="0.9",C.currentTarget.style.cursor="pointer"},onMouseLeave:C=>{C.currentTarget.style.opacity="0.3"},children:[l.jsx(T.NiceButton,{variant:"ghost",size:"sm",onClick:C=>{C.stopPropagation(),j()},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:16},title:h("presentationPlayer.previous","Previous"),"aria-label":h("presentationPlayer.previous","Previous"),children:l.jsx(T.NiceIcon,{name:"chevron-left",size:16})}),l.jsx(T.NiceButton,{variant:"ghost",size:"sm",onClick:C=>{C.stopPropagation(),A()},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:16},title:h("presentationPlayer.next","Next"),"aria-label":h("presentationPlayer.next","Next"),children:l.jsx(T.NiceIcon,{name:"chevron-right",size:16})}),l.jsx(T.NiceButton,{variant:"ghost",size:"sm",onClick:C=>{C.stopPropagation(),n==null||n()},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:14},title:h("presentationPlayer.exitEsc","Exit (Esc)"),"aria-label":h("presentationPlayer.exit","Exit"),children:l.jsx(T.NiceIcon,{name:"close",size:14})}),l.jsx(T.NiceButton,{variant:"ghost",size:"sm",onClick:C=>{C.stopPropagation(),V(M=>!M)},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:14},title:h("presentationPlayer.overviewG","Overview (G)"),"aria-label":h("presentationPlayer.overview","Overview"),children:l.jsx(T.NiceIcon,{name:"grid",size:14})}),l.jsx(T.NiceButton,{variant:"ghost",size:"sm",onClick:C=>{C.stopPropagation(),he()},style:{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",color:"var(--nice-color-white, #fff)",padding:"6px 14px",borderRadius:4,fontSize:14},title:ie?h("presentationPlayer.exitFullscreen","Exit fullscreen"):h("presentationPlayer.fullscreen","Fullscreen"),"aria-label":ie?h("presentationPlayer.exitFullscreen","Exit fullscreen"):h("presentationPlayer.fullscreen","Fullscreen"),children:l.jsx(T.NiceIcon,{name:ie?"collapse":"expand",size:14})})]})]})};process.env.NODE_ENV!=="production"&&(Xe.displayName="NicePresentationPlayer");const pn="_interactiveElement_19xs5_13",fn="_interactiveButton_19xs5_27",mn="_disabled_19xs5_57",hn="_variant_primary_19xs5_87",yn="_variant_secondary_19xs5_101",gn="_variant_outline_19xs5_111",xn="_variant_ghost_19xs5_123",bn="_size_small_19xs5_143",vn="_size_medium_19xs5_153",Sn="_size_large_19xs5_163",wn="_buttonIcon_19xs5_173",kn="_buttonLabel_19xs5_181",In="_interactivePoll_19xs5_193",Cn="_pollQuestion_19xs5_213",Mn="_pollOptions_19xs5_227",zn="_pollOption_19xs5_227",An="_pollOptionDisabled_19xs5_265",_n="_pollOptionSelected_19xs5_275",Tn="_pollOptionContent_19xs5_293",$n="_pollOptionIcon_19xs5_309",En="_pollOptionText_19xs5_317",Pn="_pollCheckbox_19xs5_325",Nn="_pollResultBar_19xs5_335",Rn="_pollResultFill_19xs5_357",qn="_pollResultPercent_19xs5_369",Dn="_pollResultCount_19xs5_385",On="_pollSubmitBtn_19xs5_399",jn="_pollTotalVotes_19xs5_435",Fn="_pollVotedMessage_19xs5_447",Ln="_interactiveQuiz_19xs5_489",Wn="_quizHeader_19xs5_509",Bn="_quizQuestion_19xs5_523",Un="_quizTimer_19xs5_541",Vn="_quizTimerWarning_19xs5_559",Hn="_timerPulse_19xs5_1",Qn="_quizPoints_19xs5_591",Kn="_quizAnswers_19xs5_609",Yn="_quizAnswer_19xs5_609",Gn="_quizAnswerDisabled_19xs5_647",Xn="_quizAnswerSelected_19xs5_657",Jn="_quizAnswerCorrect_19xs5_675",Zn="_quizAnswerIncorrect_19xs5_685",ei="_quizAnswerMarker_19xs5_695",ti="_quizAnswerText_19xs5_705",ni="_quizCorrectMark_19xs5_717",ii="_quizIncorrectMark_19xs5_729",oi="_quizSubmitBtn_19xs5_741",ri="_quizFeedback_19xs5_789",ai="_quizFeedbackMessage_19xs5_797",si="_quizFeedbackCorrect_19xs5_811",ci="_quizFeedbackIncorrect_19xs5_821",li="_quizExplanation_19xs5_831",di="_interactiveCountdown_19xs5_855",ui="_countdownWarning_19xs5_871",pi="_countdownPulse_19xs5_1",fi="_countdownComplete_19xs5_899",mi="_countdownDigital_19xs5_909",hi="_countdownSeparator_19xs5_927",yi="_countdownDigit_19xs5_909",gi="_countdownCircular_19xs5_947",xi="_countdownCircleSvg_19xs5_959",bi="_countdownProgressRing_19xs5_971",vi="_countdownCircleText_19xs5_979",Si="_countdownLargeSeconds_19xs5_999",wi="_countdownFlip_19xs5_1009",ki="_flipCardContainer_19xs5_1021",Ii="_flipCard_19xs5_1021",Ci="_flipLabel_19xs5_1065",Mi="_flipSeparator_19xs5_1079",zi="_countdownMinimal_19xs5_1095",Ai="_countdownCompleteMessage_19xs5_1107",_i="_interactiveQnA_19xs5_1125",Ti="_qnaHeader_19xs5_1149",$i="_qnaTitle_19xs5_1165",Ei="_qnaCount_19xs5_1179",Pi="_qnaInputForm_19xs5_1189",Ni="_qnaInputWrapper_19xs5_1201",Ri="_qnaInput_19xs5_1189",qi="_qnaCharCount_19xs5_1251",Di="_qnaInputActions_19xs5_1267",Oi="_qnaAnonymousToggle_19xs5_1281",ji="_qnaSubmitBtn_19xs5_1311",Fi="_qnaClosedMessage_19xs5_1353",Li="_qnaQuestionsList_19xs5_1371",Wi="_qnaQuestion_19xs5_1371",Bi="_qnaQuestionAnswered_19xs5_1413",Ui="_qnaQuestionContent_19xs5_1423",Vi="_qnaQuestionText_19xs5_1437",Hi="_qnaQuestionMeta_19xs5_1449",Qi="_qnaAuthor_19xs5_1463",Ki="_qnaQuestionActions_19xs5_1471",Yi="_qnaUpvoteBtn_19xs5_1485",Gi="_qnaUpvoted_19xs5_1521",Xi="_qnaUpvoteIcon_19xs5_1541",Ji="_qnaUpvoteCount_19xs5_1549",Zi="_qnaAnsweredBtn_19xs5_1559",eo="_qnaMarkedAnswered_19xs5_1587",to="_qnaEmptyState_19xs5_1599",no="_qnaMoreQuestions_19xs5_1613",io="_qnaStyle_stack_19xs5_1631",oo="_qnaStyle_floating_19xs5_1641",w={interactiveElement:pn,interactiveButton:fn,disabled:mn,variant_primary:hn,variant_secondary:yn,variant_outline:gn,variant_ghost:xn,size_small:bn,size_medium:vn,size_large:Sn,buttonIcon:wn,buttonLabel:kn,interactivePoll:In,pollQuestion:Cn,pollOptions:Mn,pollOption:zn,pollOptionDisabled:An,pollOptionSelected:_n,pollOptionContent:Tn,pollOptionIcon:$n,pollOptionText:En,pollCheckbox:Pn,pollResultBar:Nn,pollResultFill:Rn,pollResultPercent:qn,pollResultCount:Dn,pollSubmitBtn:On,pollTotalVotes:jn,pollVotedMessage:Fn,"pollStyle_horizontal-bar":"_pollStyle_horizontal-bar_19xs5_467",interactiveQuiz:Ln,quizHeader:Wn,quizQuestion:Bn,quizTimer:Un,quizTimerWarning:Vn,timerPulse:Hn,quizPoints:Qn,quizAnswers:Kn,quizAnswer:Yn,quizAnswerDisabled:Gn,quizAnswerSelected:Xn,quizAnswerCorrect:Jn,quizAnswerIncorrect:Zn,quizAnswerMarker:ei,quizAnswerText:ti,quizCorrectMark:ni,quizIncorrectMark:ii,quizSubmitBtn:oi,quizFeedback:ri,quizFeedbackMessage:ai,quizFeedbackCorrect:si,quizFeedbackIncorrect:ci,quizExplanation:li,interactiveCountdown:di,countdownWarning:ui,countdownPulse:pi,countdownComplete:fi,countdownDigital:mi,countdownSeparator:hi,countdownDigit:yi,countdownCircular:gi,countdownCircleSvg:xi,countdownProgressRing:bi,countdownCircleText:vi,countdownLargeSeconds:Si,countdownFlip:wi,flipCardContainer:ki,flipCard:Ii,flipLabel:Ci,flipSeparator:Mi,countdownMinimal:zi,countdownCompleteMessage:Ai,interactiveQnA:_i,qnaHeader:Ti,qnaTitle:$i,qnaCount:Ei,qnaInputForm:Pi,qnaInputWrapper:Ni,qnaInput:Ri,qnaCharCount:qi,qnaInputActions:Di,qnaAnonymousToggle:Oi,qnaSubmitBtn:ji,qnaClosedMessage:Fi,qnaQuestionsList:Li,qnaQuestion:Wi,qnaQuestionAnswered:Bi,qnaQuestionContent:Ui,qnaQuestionText:Vi,qnaQuestionMeta:Hi,qnaAuthor:Qi,qnaQuestionActions:Ki,qnaUpvoteBtn:Yi,qnaUpvoted:Gi,qnaUpvoteIcon:Xi,qnaUpvoteCount:Ji,qnaAnsweredBtn:Zi,qnaMarkedAnswered:eo,qnaEmptyState:to,qnaMoreQuestions:no,qnaStyle_stack:io,qnaStyle_floating:oo},ro=({content:e,onAction:t,disabled:n=!1,className:i,theme:o})=>{const{label:r,action:a,variant:s="primary",size:c="medium",icon:u,iconPosition:f="left",backgroundColor:h,textColor:y,borderRadius:p}=e,m=d.useCallback(()=>{if(!n){if(a.type==="openUrl"){const{url:x,newTab:$=!0}=a;$?window.open(x,"_blank","noopener,noreferrer"):window.location.href=x}t==null||t(a)}},[a,n,t]),g={backgroundColor:h??(s==="primary"?o==null?void 0:o.primaryColor:void 0),color:y,borderRadius:p!==void 0?`${p}px`:void 0,fontFamily:o==null?void 0:o.fontFamily},b=[w.interactiveButton,w[`variant_${s}`],w[`size_${c}`],n?w.disabled:"",i??""].filter(Boolean).join(" "),S=()=>u?l.jsx("span",{className:w.buttonIcon,children:l.jsx(T.NiceIcon,{name:ao(u),size:16})}):null;return l.jsxs("button",{className:b,style:g,onClick:m,disabled:n,type:"button",children:[f==="left"&&S(),l.jsx("span",{className:w.buttonLabel,children:r}),f==="right"&&S()]})};function ao(e){return{external:"external-link",share:"external-link",question:"help",heart:"heart",delete:"trash"}[e]??e}const so=({content:e,onVote:t,onResultsUpdate:n,votingClosed:i=!1,userVote:o,className:r,theme:a})=>{const s=ne(),{question:c,options:u,multiSelect:f=!1,showResultsAfterVote:h=!0,liveResults:y=!1,displayStyle:p="buttons",resultColors:m,results:g={}}=e,[b,S]=d.useState(o??[]),[x,$]=d.useState(!!(o!=null&&o.length)),[E,R]=d.useState(g),z=d.useMemo(()=>Object.values(E).reduce((I,N)=>I+N,0),[E]),V=[(a==null?void 0:a.primaryColor)??"var(--nice-info, #6366f1)","var(--nice-accent, #8b5cf6)","var(--nice-info, #06b6d4)","var(--nice-success, #10b981)","var(--nice-warning, #f59e0b)","var(--nice-danger, #ef4444)"],_=m??V,D=d.useCallback(I=>{x||i||S(N=>f?N.includes(I)?N.filter(v=>v!==I):[...N,I]:[I])},[x,i,f]),L=d.useCallback(()=>{if(b.length===0||x)return;const I={...E};b.forEach(N=>{I[N]=(I[N]??0)+1}),R(I),$(!0),t==null||t(b),n==null||n(I)},[b,x,E,t,n]),K=y||h&&x,G=(I,N)=>{const v=b.includes(I.id),O=E[I.id]??0,B=z>0?O/z*100:0,U=I.color??_[N%_.length],X=[w.pollOption,w[`pollStyle_${p}`],v?w.pollOptionSelected:"",x||i?w.pollOptionDisabled:""].filter(Boolean).join(" ");return l.jsxs("button",{className:X,onClick:()=>D(I.id),disabled:x||i,type:"button",style:{"--poll-option-color":U,fontFamily:a==null?void 0:a.fontFamily},children:[l.jsxs("div",{className:w.pollOptionContent,children:[I.icon&&l.jsx("span",{className:w.pollOptionIcon,children:l.jsx(T.NiceIcon,{name:I.icon,size:16})}),l.jsx("span",{className:w.pollOptionText,children:I.text}),f&&!x&&l.jsx("span",{className:w.pollCheckbox,children:l.jsx(T.NiceIcon,{name:v?"check-square":"square",size:16})})]}),K&&l.jsxs("div",{className:w.pollResultBar,children:[l.jsx("div",{className:w.pollResultFill,style:{width:`${B}%`,backgroundColor:U}}),l.jsxs("span",{className:w.pollResultPercent,children:[B.toFixed(0),"%"]}),l.jsxs("span",{className:w.pollResultCount,children:["(",O,")"]})]})]},I.id)};return l.jsxs("div",{className:`${w.interactivePoll} ${r??""}`,children:[l.jsx("h3",{className:w.pollQuestion,style:{fontFamily:a==null?void 0:a.fontFamily},children:c}),l.jsx("div",{className:w.pollOptions,children:u.map((I,N)=>G(I,N))}),!x&&!i&&b.length>0&&l.jsx("button",{className:w.pollSubmitBtn,onClick:L,style:{backgroundColor:a==null?void 0:a.primaryColor,fontFamily:a==null?void 0:a.fontFamily},children:s("interactive.poll.vote","Submit vote")}),K&&z>0&&l.jsxs("div",{className:w.pollTotalVotes,children:[s("interactive.poll.totalVotes","Total votes:")," ",z]}),x&&l.jsxs("div",{className:w.pollVotedMessage,children:[l.jsx(T.NiceIcon,{name:"check",size:14})," ",s("interactive.poll.thanks","Thanks for your vote!")]})]})},co=({content:e,onSubmit:t,locked:n=!1,className:i,theme:o})=>{const r=ne(),{question:a,answers:s,quizType:c="single",showCorrectAfterSubmit:u=!0,timeLimitSeconds:f=0,points:h=10,correctFeedback:y,incorrectFeedback:p,explanation:m}=e,g=y??r("interactive.quiz.correctFeedback","Correct answer!"),b=p??r("interactive.quiz.incorrectFeedback","Sorry, that is not the correct answer."),S=r("interactive.quiz.points","pts"),[x,$]=d.useState([]),[E,R]=d.useState(!1),[z,V]=d.useState(!1),[_,D]=d.useState(f),L=d.useRef(null);d.useEffect(()=>{if(f>0&&!E&&!n)return D(f),L.current=setInterval(()=>{D(v=>v<=1?(clearInterval(L.current),0):v-1)},1e3),()=>{L.current&&clearInterval(L.current)}},[f,E,n]);const K=d.useCallback(v=>{E||n||$(O=>c==="single"||c==="true-false"?[v]:O.includes(v)?O.filter(B=>B!==v):[...O,v])},[E,n,c]),G=d.useCallback(()=>{if(E||x.length===0)return;L.current&&clearInterval(L.current);const v=s.filter(q=>q.isCorrect).map(q=>q.id),O=new Set(x),B=new Set(v),U=O.size===B.size&&[...O].every(q=>B.has(q));V(U),R(!0);const X=U?h:0;t==null||t(x,U,X)},[E,x,s,h,t]);d.useEffect(()=>{_===0&&f>0&&!E&&G()},[_,f,E,G]);const I=v=>{const O=Math.floor(v/60),B=v%60;return O>0?`${O}:${B.toString().padStart(2,"0")}`:`${B}s`},N=v=>{const O=x.includes(v.id),B=E&&u,U=[w.quizAnswer,O?w.quizAnswerSelected:"",E?w.quizAnswerDisabled:"",B&&v.isCorrect?w.quizAnswerCorrect:"",B&&O&&!v.isCorrect?w.quizAnswerIncorrect:""].filter(Boolean).join(" ");return l.jsxs("button",{className:U,onClick:()=>K(v.id),disabled:E||n,type:"button",style:{fontFamily:o==null?void 0:o.fontFamily},children:[l.jsxs("span",{className:w.quizAnswerMarker,children:[c==="multiple"&&l.jsx(T.NiceIcon,{name:O?"check-square":"square",size:16}),(c==="single"||c==="true-false")&&l.jsx(T.NiceIcon,{name:O?"check":"circle",size:16})]}),l.jsx("span",{className:w.quizAnswerText,children:v.text}),B&&v.isCorrect&&l.jsx("span",{className:w.quizCorrectMark,children:l.jsx(T.NiceIcon,{name:"check",size:14})}),B&&O&&!v.isCorrect&&l.jsx("span",{className:w.quizIncorrectMark,children:l.jsx(T.NiceIcon,{name:"close",size:14})})]},v.id)};return l.jsxs("div",{className:`${w.interactiveQuiz} ${i??""}`,children:[l.jsxs("div",{className:w.quizHeader,children:[l.jsx("h3",{className:w.quizQuestion,style:{fontFamily:o==null?void 0:o.fontFamily},children:a}),f>0&&!E&&l.jsxs("div",{className:`${w.quizTimer} ${_<=10?w.quizTimerWarning:""}`,children:[l.jsx(T.NiceIcon,{name:"clock",size:14})," ",I(_)]}),h>0&&l.jsx("div",{className:w.quizPoints,children:E?z?`+${h} ${S}`:`0 ${S}`:`${h} ${S}`})]}),l.jsx("div",{className:w.quizAnswers,children:s.map(N)}),!E&&!n&&x.length>0&&l.jsx("button",{className:w.quizSubmitBtn,onClick:G,style:{backgroundColor:o==null?void 0:o.primaryColor,fontFamily:o==null?void 0:o.fontFamily},children:r("interactive.quiz.submit","Submit answer")}),E&&u&&l.jsxs("div",{className:w.quizFeedback,children:[l.jsx("div",{className:`${w.quizFeedbackMessage} ${z?w.quizFeedbackCorrect:w.quizFeedbackIncorrect}`,children:z?g:b}),m&&l.jsxs("div",{className:w.quizExplanation,children:[l.jsx("strong",{children:r("interactive.quiz.explanation","Explanation:")})," ",m]})]})]})},lo=({content:e,onComplete:t,paused:n=!1,className:i,theme:o})=>{const{target:r,format:a="mm:ss",style:s="digital",showLabels:c=!0,onComplete:u,textColor:f,backgroundColor:h,warningThreshold:y=10,warningColor:p="var(--nice-danger, #ef4444)"}=e,[m,g]=d.useState(()=>{if(typeof r=="number")return r;const v=new Date(r),O=new Date;return Math.max(0,Math.floor((v.getTime()-O.getTime())/1e3))}),[b,S]=d.useState(!1),x=ne(),$=x("countdown.timeUp"),E=$==="countdown.timeUp"?x("countdown.timesUp","Time's up!"):$,R=d.useRef(null);d.useEffect(()=>{if(n||b){R.current&&(clearInterval(R.current),R.current=null);return}return R.current=setInterval(()=>{g(v=>v<=1?(clearInterval(R.current),S(!0),0):v-1)},1e3),()=>{R.current&&clearInterval(R.current)}},[n,b]),d.useEffect(()=>{b&&(t==null||t(u))},[b,t,u]);const z=d.useMemo(()=>{const v=Math.floor(m/3600),O=Math.floor(m%3600/60),B=m%60;return{hours:v,minutes:O,seconds:B}},[m]),V=m<=y&&m>0,_=(v,O=2)=>v.toString().padStart(O,"0"),D=()=>{const{hours:v,minutes:O,seconds:B}=z;let U=[];return a==="hh:mm:ss"||v>0?U=[_(v),_(O),_(B)]:a==="mm:ss"?U=[_(O),_(B)]:U=[B.toString()],l.jsx("div",{className:w.countdownDigital,children:U.map((X,q)=>l.jsxs(d.Fragment,{children:[q>0&&l.jsx("span",{className:w.countdownSeparator,children:":"}),l.jsx("span",{className:w.countdownDigit,children:X})]},q))})},L=()=>{const{hours:v,minutes:O,seconds:B}=z,U=typeof r=="number"?r:m,X=U>0?m/U:0,q=2*Math.PI*45;return l.jsxs("div",{className:w.countdownCircular,children:[l.jsxs("svg",{viewBox:"0 0 100 100",className:w.countdownCircleSvg,children:[l.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",opacity:"0.2"}),l.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:V?p:f??(o==null?void 0:o.primaryColor)??"var(--nice-info, #6366f1)",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:q,strokeDashoffset:q*(1-X),transform:"rotate(-90 50 50)",className:w.countdownProgressRing})]}),l.jsx("div",{className:w.countdownCircleText,children:a!=="ss"?l.jsxs(l.Fragment,{children:[v>0&&l.jsxs("span",{children:[_(v),":"]}),l.jsxs("span",{children:[_(O),":"]}),l.jsx("span",{children:_(B)})]}):l.jsx("span",{className:w.countdownLargeSeconds,children:B})})]})},K=()=>{const{hours:v,minutes:O,seconds:B}=z,U=(X,q)=>l.jsxs("div",{className:w.flipCardContainer,children:[l.jsx("div",{className:w.flipCard,children:l.jsx("span",{children:X})}),c&&l.jsx("span",{className:w.flipLabel,children:q})]});return l.jsxs("div",{className:w.countdownFlip,children:[(a==="hh:mm:ss"||v>0)&&l.jsxs(l.Fragment,{children:[U(_(v),"godz."),l.jsx("span",{className:w.flipSeparator,children:":"})]}),a!=="ss"&&l.jsxs(l.Fragment,{children:[U(_(O),"min."),l.jsx("span",{className:w.flipSeparator,children:":"})]}),U(_(B),"sek.")]})},G=()=>{const{hours:v,minutes:O,seconds:B}=z;if(a==="ss")return l.jsxs("span",{className:w.countdownMinimal,children:[B,"s"]});let U="";return v>0&&(U+=`${v}h `),(O>0||v>0)&&(U+=`${O}m `),U+=`${B}s`,l.jsx("span",{className:w.countdownMinimal,children:U.trim()})},I={color:V?p:f,backgroundColor:h,fontFamily:o==null?void 0:o.fontFamily},N=[w.interactiveCountdown,w[`countdownStyle_${s}`],V?w.countdownWarning:"",b?w.countdownComplete:"",i??""].filter(Boolean).join(" ");return l.jsxs("div",{className:N,style:I,children:[s==="digital"&&D(),s==="circular"&&L(),s==="flip"&&K(),s==="minimal"&&G(),b&&l.jsxs("div",{className:w.countdownCompleteMessage,children:[l.jsx(T.NiceIcon,{name:"clock",size:18})," ",E]})]})},uo=({content:e,userName:t,onSubmitQuestion:n,onUpvote:i,onMarkAnswered:o,submissionClosed:r=!1,isModerator:a=!1,upvotedQuestions:s=[],className:c,theme:u})=>{const f=ne(),h=Te(),{placeholder:y,allowAnonymous:p=!0,moderated:m=!1,allowUpvote:g=!0,maxVisible:b=10,displayStyle:S="list",charLimit:x=500,questions:$=[]}=e,E=y??f("interactive.qna.placeholder","Ask a question..."),[R,z]=d.useState($),[V,_]=d.useState(""),[D,L]=d.useState(!1),[K,G]=d.useState(new Set(s)),I=d.useMemo(()=>[...R].filter(q=>!m||q.answered||a).sort((q,k)=>k.upvotes!==q.upvotes?k.upvotes-q.upvotes:new Date(k.timestamp).getTime()-new Date(q.timestamp).getTime()).slice(0,b),[R,m,a,b]),N=d.useCallback(q=>{q.preventDefault();const k=V.trim();if(!k||r)return;const A={id:`q_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,text:k,author:D||!t?void 0:t,timestamp:new Date().toISOString(),upvotes:0,answered:!1};z(j=>[A,...j]),_(""),n==null||n({text:A.text,author:A.author,answered:!1})},[V,r,D,t,n]),v=d.useCallback(q=>{!g||K.has(q)||(z(k=>k.map(A=>A.id===q?{...A,upvotes:A.upvotes+1}:A)),G(k=>new Set(k).add(q)),i==null||i(q))},[g,K,i]),O=d.useCallback(q=>{a&&(z(k=>k.map(A=>A.id===q?{...A,answered:!A.answered}:A)),o==null||o(q))},[a,o]),B=()=>l.jsxs("form",{className:w.qnaInputForm,onSubmit:N,children:[l.jsxs("div",{className:w.qnaInputWrapper,children:[l.jsx("textarea",{className:w.qnaInput,placeholder:E,value:V,onChange:q=>_(q.target.value.slice(0,x)),disabled:r,rows:2,style:{fontFamily:u==null?void 0:u.fontFamily}}),l.jsxs("span",{className:w.qnaCharCount,children:[V.length,"/",x]})]}),l.jsxs("div",{className:w.qnaInputActions,children:[p&&l.jsxs("label",{className:w.qnaAnonymousToggle,children:[l.jsx("input",{type:"checkbox",checked:D,onChange:q=>L(q.target.checked)}),l.jsx("span",{children:f("interactive.qna.anonymously","Anonymously")})]}),l.jsx("button",{type:"submit",className:w.qnaSubmitBtn,disabled:!V.trim()||r,style:{backgroundColor:u==null?void 0:u.primaryColor,fontFamily:u==null?void 0:u.fontFamily},children:f("interactive.qna.submit","Submit question")})]})]}),U=q=>{const k=K.has(q.id);return l.jsxs("div",{className:`${w.qnaQuestion} ${q.answered?w.qnaQuestionAnswered:""}`,children:[l.jsxs("div",{className:w.qnaQuestionContent,children:[l.jsx("span",{className:w.qnaQuestionText,style:{fontFamily:u==null?void 0:u.fontFamily},children:q.text}),l.jsxs("div",{className:w.qnaQuestionMeta,children:[l.jsx("span",{className:w.qnaAuthor,children:q.author?`@${q.author}`:l.jsxs(l.Fragment,{children:[l.jsx(T.NiceIcon,{name:"user",size:14})," ",f("interactive.qna.anonymous","Anonymous")]})}),l.jsx("span",{className:w.qnaTimestamp,children:po(f,h,q.timestamp)})]})]}),l.jsxs("div",{className:w.qnaQuestionActions,children:[g&&l.jsxs("button",{className:`${w.qnaUpvoteBtn} ${k?w.qnaUpvoted:""}`,onClick:()=>v(q.id),disabled:k,title:k?f("interactive.qna.alreadyUpvoted","You already upvoted this"):f("interactive.qna.upvote","Upvote"),children:[l.jsx("span",{className:w.qnaUpvoteIcon,children:l.jsx(T.NiceIcon,{name:"arrow-up",size:14})}),l.jsx("span",{className:w.qnaUpvoteCount,children:q.upvotes})]}),a&&l.jsx("button",{className:`${w.qnaAnsweredBtn} ${q.answered?w.qnaMarkedAnswered:""}`,onClick:()=>O(q.id),title:q.answered?f("interactive.qna.markUnanswered","Mark as unanswered"):f("interactive.qna.markAnswered","Mark as answered"),"aria-label":q.answered?f("interactive.qna.markUnanswered","Mark as unanswered"):f("interactive.qna.markAnswered","Mark as answered"),children:l.jsx(T.NiceIcon,{name:q.answered?"check":"circle",size:16})})]})]},q.id)},X=[w.interactiveQnA,w[`qnaStyle_${S}`],c??""].filter(Boolean).join(" ");return l.jsxs("div",{className:X,children:[l.jsxs("div",{className:w.qnaHeader,children:[l.jsx("h3",{className:w.qnaTitle,style:{fontFamily:u==null?void 0:u.fontFamily},children:f("interactive.qna.title","Questions & answers")}),l.jsxs("span",{className:w.qnaCount,children:[R.length," ",R.length===1?f("interactive.qna.questionOne","question"):f("interactive.qna.questionMany","questions")]})]}),!r&&B(),r&&l.jsx("div",{className:w.qnaClosedMessage,children:f("interactive.qna.closed","Question submission is closed")}),l.jsx("div",{className:w.qnaQuestionsList,children:I.length===0?l.jsx("div",{className:w.qnaEmptyState,children:f("interactive.qna.empty","No questions yet. Be the first!")}):I.map(U)}),R.length>b&&l.jsxs("div",{className:w.qnaMoreQuestions,children:["+",R.length-b," ",f("interactive.qna.moreQuestions","more questions")]})]})};function po(e,t,n){const i=new Date(n),r=new Date().getTime()-i.getTime(),a=Math.floor(r/6e4);if(a<1)return e("interactive.qna.justNow","Just now");if(a<60)return e("interactive.qna.minutesAgo","{n} min ago").replace("{n}",String(a));const s=Math.floor(a/60);return s<24?e("interactive.qna.hoursAgo","{n}h ago").replace("{n}",String(s)):i.toLocaleDateString(t,{day:"numeric",month:"short"})}const Je={id:"fade",name:"Fade",description:"Smooth fade between slides",outgoingStyles:{from:{opacity:1},to:{opacity:0}},incomingStyles:{from:{opacity:0},to:{opacity:1}},defaultDuration:500,defaultEasing:"ease-in-out",category:"basic"},Ze={id:"slide-left",name:"Slide Left",description:"Slide to the left",outgoingStyles:{from:{transform:"translateX(0%)"},to:{transform:"translateX(-100%)"}},incomingStyles:{from:{transform:"translateX(100%)"},to:{transform:"translateX(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},et={id:"slide-right",name:"Slide Right",description:"Slide to the right",outgoingStyles:{from:{transform:"translateX(0%)"},to:{transform:"translateX(100%)"}},incomingStyles:{from:{transform:"translateX(-100%)"},to:{transform:"translateX(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},tt={id:"slide-up",name:"Slide Up",description:"Slide upward",outgoingStyles:{from:{transform:"translateY(0%)"},to:{transform:"translateY(-100%)"}},incomingStyles:{from:{transform:"translateY(100%)"},to:{transform:"translateY(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},nt={id:"slide-down",name:"Slide Down",description:"Slide downward",outgoingStyles:{from:{transform:"translateY(0%)"},to:{transform:"translateY(100%)"}},incomingStyles:{from:{transform:"translateY(-100%)"},to:{transform:"translateY(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},it={id:"zoom-in",name:"Zoom In",description:"Zoom in from center",outgoingStyles:{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(1.2)",opacity:0}},incomingStyles:{from:{transform:"scale(0.8)",opacity:0},to:{transform:"scale(1)",opacity:1}},defaultDuration:500,defaultEasing:"ease-out",category:"zoom"},ot={id:"zoom-out",name:"Zoom Out",description:"Zoom out to center",outgoingStyles:{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(0.8)",opacity:0}},incomingStyles:{from:{transform:"scale(1.2)",opacity:0},to:{transform:"scale(1)",opacity:1}},defaultDuration:500,defaultEasing:"ease-out",category:"zoom"},rt={id:"flip-horizontal",name:"Flip Horizontal",description:"3D flip around vertical axis",outgoingStyles:{from:{transform:"perspective(1000px) rotateY(0deg)",opacity:1},to:{transform:"perspective(1000px) rotateY(-90deg)",opacity:0}},incomingStyles:{from:{transform:"perspective(1000px) rotateY(90deg)",opacity:0},to:{transform:"perspective(1000px) rotateY(0deg)",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"3d"},at={id:"flip-vertical",name:"Flip Vertical",description:"3D flip around horizontal axis",outgoingStyles:{from:{transform:"perspective(1000px) rotateX(0deg)",opacity:1},to:{transform:"perspective(1000px) rotateX(90deg)",opacity:0}},incomingStyles:{from:{transform:"perspective(1000px) rotateX(-90deg)",opacity:0},to:{transform:"perspective(1000px) rotateX(0deg)",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"3d"},st={id:"cube-left",name:"Cube Left",description:"3D cube rotation to the left",outgoingStyles:{from:{transform:"perspective(1000px) translateZ(0) rotateY(0deg)"},to:{transform:"perspective(1000px) translateZ(-50%) rotateY(90deg)"}},incomingStyles:{from:{transform:"perspective(1000px) translateZ(-50%) rotateY(-90deg)"},to:{transform:"perspective(1000px) translateZ(0) rotateY(0deg)"}},defaultDuration:800,defaultEasing:"ease-in-out",category:"3d"},ct={id:"rotate-in",name:"Rotate In",description:"Rotate and fade in",outgoingStyles:{from:{transform:"rotate(0deg) scale(1)",opacity:1},to:{transform:"rotate(-15deg) scale(0.8)",opacity:0}},incomingStyles:{from:{transform:"rotate(15deg) scale(0.8)",opacity:0},to:{transform:"rotate(0deg) scale(1)",opacity:1}},defaultDuration:600,defaultEasing:"ease-out",category:"rotate"},lt={id:"blur-fade",name:"Blur Fade",description:"Fade with blur effect",outgoingStyles:{from:{filter:"blur(0px)",opacity:1},to:{filter:"blur(10px)",opacity:0}},incomingStyles:{from:{filter:"blur(10px)",opacity:0},to:{filter:"blur(0px)",opacity:1}},defaultDuration:600,defaultEasing:"ease-in-out",category:"blur"},dt={id:"wipe-left",name:"Wipe Left",description:"Wipe from right to left",outgoingStyles:{from:{clipPath:"inset(0 0 0 0)"},to:{clipPath:"inset(0 100% 0 0)"}},incomingStyles:{from:{clipPath:"inset(0 0 0 100%)"},to:{clipPath:"inset(0 0 0 0)"}},defaultDuration:600,defaultEasing:"ease-in-out",category:"creative"},ut={id:"wipe-right",name:"Wipe Right",description:"Wipe from left to right",outgoingStyles:{from:{clipPath:"inset(0 0 0 0)"},to:{clipPath:"inset(0 0 0 100%)"}},incomingStyles:{from:{clipPath:"inset(0 100% 0 0)"},to:{clipPath:"inset(0 0 0 0)"}},defaultDuration:600,defaultEasing:"ease-in-out",category:"creative"},pt={id:"circle-reveal",name:"Circle Reveal",description:"Reveal with expanding circle",outgoingStyles:{from:{clipPath:"circle(100% at 50% 50%)"},to:{clipPath:"circle(0% at 50% 50%)"}},incomingStyles:{from:{clipPath:"circle(0% at 50% 50%)"},to:{clipPath:"circle(100% at 50% 50%)"}},defaultDuration:700,defaultEasing:"ease-out",category:"creative"},ft={id:"glitch",name:"Glitch",description:"Digital glitch effect",outgoingStyles:{from:{transform:"translateX(0)",filter:"hue-rotate(0deg)"},keyframes:[{offset:.2,style:{transform:"translateX(-5px)",filter:"hue-rotate(90deg)"}},{offset:.4,style:{transform:"translateX(5px)",filter:"hue-rotate(180deg)"}},{offset:.6,style:{transform:"translateX(-3px)",filter:"hue-rotate(270deg)"}},{offset:.8,style:{transform:"translateX(3px)",filter:"hue-rotate(360deg)"}}],to:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:0}},incomingStyles:{from:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:0},keyframes:[{offset:.2,style:{transform:"translateX(5px)",filter:"hue-rotate(270deg)",opacity:.5}},{offset:.4,style:{transform:"translateX(-5px)",filter:"hue-rotate(180deg)",opacity:.7}},{offset:.6,style:{transform:"translateX(3px)",filter:"hue-rotate(90deg)",opacity:.9}},{offset:.8,style:{transform:"translateX(-3px)",filter:"hue-rotate(0deg)",opacity:1}}],to:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:1}},defaultDuration:500,defaultEasing:"linear",category:"creative"},mt={id:"morph",name:"Morph",description:"Smooth morphing effect",outgoingStyles:{from:{transform:"scale(1)",borderRadius:"0%",opacity:1},to:{transform:"scale(0.5)",borderRadius:"50%",opacity:0}},incomingStyles:{from:{transform:"scale(0.5)",borderRadius:"50%",opacity:0},to:{transform:"scale(1)",borderRadius:"0%",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"creative"},ht=[Je,Ze,et,tt,nt,it,ot,rt,at,st,ct,lt,dt,ut,pt,ft,mt];class fo{constructor(){this.transitions=new Map,ht.forEach(t=>this.transitions.set(t.id,t))}get(t){return this.transitions.get(t)}register(t){this.transitions.has(t.id)&&console.warn(`Transition "${t.id}" already exists and will be overwritten.`),this.transitions.set(t.id,t)}unregister(t){this.transitions.delete(t)}getAll(){return Array.from(this.transitions.values())}getByCategory(t){return this.getAll().filter(n=>n.category===t)}}const yt=new fo;function De(e,t,n,i){if(i&&i.length>0){const o=[{offset:0,style:e},...i,{offset:1,style:t}].sort((u,f)=>u.offset-f.offset);let r=o[0],a=o[o.length-1];for(let u=0;u<o.length-1;u++)if(n>=o[u].offset&&n<=o[u+1].offset){r=o[u],a=o[u+1];break}const s=a.offset-r.offset,c=s>0?(n-r.offset)/s:1;return Oe(r.style,a.style,c)}return Oe(e,t,n)}function Oe(e,t,n){const i={};return new Set([...Object.keys(e),...Object.keys(t)]).forEach(r=>{const a=e[r],s=t[r];a===void 0?i[r]=s:s===void 0?i[r]=a:typeof a=="number"&&typeof s=="number"?i[r]=a+(s-a)*n:i[r]=n<.5?a:s}),i}function mo(e,t){const n=yt.get(e);if(!n)return{progress:t,outgoingStyle:{opacity:1-t},incomingStyle:{opacity:t},isComplete:t>=1};const{outgoingStyles:i,incomingStyles:o}=n;return{progress:t,outgoingStyle:De(i.from,i.to,t,i.keyframes),incomingStyle:De(o.from,o.to,t,o.keyframes),isComplete:t>=1}}function ho(e,t){return{none:"fade",fade:"fade",slide:t==="right"?"slide-right":t==="up"?"slide-up":t==="down"?"slide-down":"slide-left",zoom:"zoom-in",flip:"flip-horizontal",cube:"cube-left",wipe:t==="right"?"wipe-right":"wipe-left",dissolve:"blur-fade",push:t==="right"?"slide-right":"slide-left",cover:"slide-left"}[e]??"fade"}function yo(e,t){switch(t){case"linear":return e;case"ease-in":return e*e;case"ease-out":return 1-Math.pow(1-e,2);case"ease-in-out":return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2;case"ease":default:return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}}function go(e,t,n,i,o){return{id:e,name:t,outgoingStyles:n,incomingStyles:i,defaultDuration:(o==null?void 0:o.defaultDuration)??500,defaultEasing:(o==null?void 0:o.defaultEasing)??"ease-in-out",description:o==null?void 0:o.description,supportsDirection:o==null?void 0:o.supportsDirection,previewUrl:o==null?void 0:o.previewUrl,category:(o==null?void 0:o.category)??"custom"}}function xo(e,t){const n=t==="outgoing"?e.outgoingStyles:e.incomingStyles,i=[];return i.push({...n.from,offset:0}),n.keyframes&&n.keyframes.forEach(o=>{i.push({...o.style,offset:o.offset})}),i.push({...n.to,offset:1}),i}function fe(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e)}function be(e){return`${e>=0?"+":""}${e.toFixed(1)}%`}function ve(e){return e>=0?"#10b981":"#ef4444"}function bo(e){return{id:"slide-title",title:"Title",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3b82f6",position:100}],gradientDirection:135},elements:[{id:"title-main",type:"text",position:{x:10,y:35,width:80,height:15,unit:"percent"},content:{type:"text",text:`${e.quarter} ${e.year} Quarterly Report`,style:{fontFamily:"Inter, sans-serif",fontSize:56,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:800,delayMs:200}},{id:"title-company",type:"text",position:{x:10,y:52,width:80,height:8,unit:"percent"},content:{type:"text",text:e.companyName,style:{fontFamily:"Inter, sans-serif",fontSize:32,fontWeight:400,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:600}},{id:"title-date",type:"text",position:{x:10,y:85,width:80,height:5,unit:"percent"},content:{type:"text",text:e.reportDate||new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),style:{fontFamily:"Inter, sans-serif",fontSize:18,color:"#bfdbfe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Welcome stakeholders. This presentation covers our Q"+e.quarter[1]+" results.",durationMs:3e4}}function vo(e){const t=[{id:"kpi-revenue",type:"shape",position:{x:5,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e5e7eb",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:200}},{id:"kpi-revenue-icon",type:"text",position:{x:7,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"💰",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-revenue-label",type:"text",position:{x:7,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Revenue",style:{fontSize:14,color:"#6b7280",textAlign:"center",fontWeight:500}}},{id:"kpi-revenue-value",type:"text",position:{x:7,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:fe(e.kpis.revenue.value),style:{fontSize:28,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"kpi-revenue-change",type:"text",position:{x:7,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:be(e.kpis.revenue.change),style:{fontSize:16,fontWeight:600,color:ve(e.kpis.revenue.change),textAlign:"center"}}},{id:"kpi-profit",type:"shape",position:{x:28,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e5e7eb",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:350}},{id:"kpi-profit-icon",type:"text",position:{x:30,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"📈",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-profit-label",type:"text",position:{x:30,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Profit",style:{fontSize:14,color:"#6b7280",textAlign:"center",fontWeight:500}}},{id:"kpi-profit-value",type:"text",position:{x:30,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:fe(e.kpis.profit.value),style:{fontSize:28,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"kpi-profit-change",type:"text",position:{x:30,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:be(e.kpis.profit.change),style:{fontSize:16,fontWeight:600,color:ve(e.kpis.profit.change),textAlign:"center"}}},{id:"kpi-customers",type:"shape",position:{x:51,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e5e7eb",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:500}},{id:"kpi-customers-icon",type:"text",position:{x:53,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"👥",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-customers-label",type:"text",position:{x:53,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Customers",style:{fontSize:14,color:"#6b7280",textAlign:"center",fontWeight:500}}},{id:"kpi-customers-value",type:"text",position:{x:53,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:e.kpis.customers.value.toLocaleString(),style:{fontSize:28,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"kpi-customers-change",type:"text",position:{x:53,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:be(e.kpis.customers.change),style:{fontSize:16,fontWeight:600,color:ve(e.kpis.customers.change),textAlign:"center"}}},{id:"kpi-satisfaction",type:"shape",position:{x:74,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e5e7eb",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:650}},{id:"kpi-satisfaction-icon",type:"text",position:{x:76,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"⭐",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-satisfaction-label",type:"text",position:{x:76,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Satisfaction",style:{fontSize:14,color:"#6b7280",textAlign:"center",fontWeight:500}}},{id:"kpi-satisfaction-value",type:"text",position:{x:76,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:`${e.kpis.satisfaction.value}%`,style:{fontSize:28,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"kpi-satisfaction-change",type:"text",position:{x:76,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:be(e.kpis.satisfaction.change),style:{fontSize:16,fontWeight:600,color:ve(e.kpis.satisfaction.change),textAlign:"center"}}}];return{id:"slide-kpis",title:"Key Performance Indicators",layout:"titleContent",background:{type:"solid",color:"#f3f4f6"},elements:[{id:"kpis-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Key Performance Indicators",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...t],notes:"Review each KPI and highlight the most significant changes from last quarter.",durationMs:45e3}}function So(e){var n;const t={type:"chart",chartType:"bar",title:"Monthly Revenue",data:{labels:e.financials.revenueByMonth.map(i=>i.month),datasets:[{label:`${e.year}`,data:e.financials.revenueByMonth.map(i=>i.value),backgroundColor:"#3b82f6"},...((n=e.financials.revenueByMonth[0])==null?void 0:n.lastYear)!==void 0?[{label:`${e.year-1}`,data:e.financials.revenueByMonth.map(i=>i.lastYear||0),backgroundColor:"#93c5fd"}]:[]]},options:{showLegend:!0,showGridLines:!0,animation:!0}};return{id:"slide-revenue",title:"Revenue Analysis",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"revenue-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Revenue Analysis",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"revenue-chart",type:"chart",position:{x:5,y:18,width:90,height:75,unit:"percent"},content:t,animation:{effect:"fadeIn",durationMs:800,delayMs:400}}],notes:"Highlight the revenue trend and compare with last year if applicable.",durationMs:6e4}}function wo(e){const t={type:"chart",chartType:"pie",title:"Cost Breakdown",data:{labels:e.financials.costBreakdown.map(n=>n.category),datasets:[{label:"Cost Distribution",data:e.financials.costBreakdown.map(n=>n.value),backgroundColor:["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#6366f1"]}]},options:{showLegend:!0,showDataLabels:!0,animation:!0}};return{id:"slide-costs",title:"Cost Analysis",layout:"twoColumn",background:{type:"solid",color:"#fff"},elements:[{id:"costs-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Cost Analysis",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"costs-chart",type:"chart",position:{x:5,y:18,width:45,height:70,unit:"percent"},content:t,animation:{effect:"zoomIn",durationMs:600,delayMs:400}},{id:"costs-table",type:"table",position:{x:52,y:18,width:43,height:70,unit:"percent"},content:{type:"table",headers:["Category","Amount","%"],rows:e.financials.costBreakdown.map(n=>[n.category,fe(n.value),`${n.percentage}%`]),style:{headerBackground:"#f3f4f6",headerColor:"#374151",cellPadding:12,fontSize:14,borderColor:"#e5e7eb"}},animation:{effect:"slideInRight",durationMs:600,delayMs:600}}],notes:"Discuss major cost categories and opportunities for optimization.",durationMs:6e4}}function ko(e){const t=e.pipeline.opportunities.map((i,o)=>({id:`pipeline-stage-${o}`,type:"shape",position:{x:5+o*2,y:25+o*12,width:90-o*4,height:10,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:`hsl(${220-o*15}, 70%, ${50+o*8}%)`,cornerRadius:6},animation:{effect:"slideInLeft",durationMs:400,delayMs:200+o*150}})),n=e.pipeline.opportunities.map((i,o)=>({id:`pipeline-label-${o}`,type:"text",position:{x:8+o*2,y:26.5+o*12,width:84-o*4,height:7,unit:"percent"},content:{type:"text",text:`${i.stage}: ${i.count} opportunities (${fe(i.value)})`,style:{fontSize:16,fontWeight:600,color:o<2?"#fff":"#1f2937",textAlign:"center"}}}));return{id:"slide-pipeline",title:"Sales Pipeline",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"pipeline-title",type:"text",position:{x:5,y:5,width:60,height:10,unit:"percent"},content:{type:"text",text:"Sales Pipeline",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"pipeline-total",type:"text",position:{x:65,y:5,width:30,height:10,unit:"percent"},content:{type:"text",text:`Total: ${fe(e.pipeline.totalValue)}`,style:{fontSize:28,fontWeight:700,color:"#3b82f6",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...t,...n],notes:"Walk through the pipeline stages and highlight key deals approaching close.",durationMs:6e4}}function Io(e){const t={high:"#ef4444",medium:"#f59e0b",low:"#10b981"},n=e.risks.slice(0,5).flatMap((i,o)=>[{id:`risk-card-${o}`,type:"shape",position:{x:5,y:20+o*15,width:90,height:13,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:t[i.impact],strokeWidth:2,cornerRadius:8},animation:{effect:"slideInLeft",durationMs:400,delayMs:200+o*100}},{id:`risk-name-${o}`,type:"text",position:{x:7,y:21.5+o*15,width:50,height:5,unit:"percent"},content:{type:"text",text:i.name,style:{fontSize:16,fontWeight:600,color:"#1f2937"}}},{id:`risk-impact-${o}`,type:"text",position:{x:58,y:21.5+o*15,width:15,height:5,unit:"percent"},content:{type:"text",text:`Impact: ${i.impact.toUpperCase()}`,style:{fontSize:12,fontWeight:500,color:t[i.impact]}}},{id:`risk-prob-${o}`,type:"text",position:{x:75,y:21.5+o*15,width:18,height:5,unit:"percent"},content:{type:"text",text:`Prob: ${i.probability.toUpperCase()}`,style:{fontSize:12,fontWeight:500,color:"#6b7280"}}},{id:`risk-mitigation-${o}`,type:"text",position:{x:7,y:27+o*15,width:86,height:4,unit:"percent"},content:{type:"text",text:`Mitigation: ${i.mitigation}`,style:{fontSize:12,color:"#6b7280"}}}]);return{id:"slide-risks",title:"Risks & Mitigation",layout:"titleContent",background:{type:"solid",color:"#f9fafb"},elements:[{id:"risks-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Risks & Mitigation",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...n],notes:"Discuss each risk, its current status, and mitigation actions in progress.",durationMs:9e4}}function Co(e){const t={"on-track":"#10b981","at-risk":"#f59e0b",completed:"#3b82f6","not-started":"#9ca3af"},n={"on-track":"✅","at-risk":"⚠️",completed:"🎉","not-started":"⏳"},i=e.plan.slice(0,6).flatMap((o,r)=>[{id:`plan-item-${r}`,type:"shape",position:{x:5,y:18+r*13,width:90,height:11,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:t[o.status],strokeWidth:2,cornerRadius:8},animation:{effect:"slideInRight",durationMs:400,delayMs:200+r*100}},{id:`plan-icon-${r}`,type:"text",position:{x:7,y:20+r*13,width:5,height:7,unit:"percent"},content:{type:"text",text:n[o.status],style:{fontSize:24}}},{id:`plan-goal-${r}`,type:"text",position:{x:13,y:20+r*13,width:60,height:7,unit:"percent"},content:{type:"text",text:o.goal,style:{fontSize:16,fontWeight:500,color:"#1f2937"}}},{id:`plan-status-${r}`,type:"text",position:{x:75,y:20+r*13,width:18,height:7,unit:"percent"},content:{type:"text",text:o.status.replace("-"," ").toUpperCase(),style:{fontSize:12,fontWeight:600,color:t[o.status],textAlign:"right"}}}]);return{id:"slide-plan",title:"Strategic Plan",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"plan-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Strategic Plan Status",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...i],notes:"Review progress on strategic initiatives and discuss any blockers.",durationMs:6e4}}function Mo(e){const t=e.team||{headcount:0,newHires:0,departures:0,highlights:[]};return{id:"slide-team",title:"Team Updates",layout:"twoColumn",background:{type:"gradient",gradientStops:[{color:"#f0f9ff",position:0},{color:"#e0f2fe",position:100}],gradientDirection:180},elements:[{id:"team-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Team Updates",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"team-headcount-card",type:"shape",position:{x:5,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#3b82f6",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},{id:"team-headcount-icon",type:"text",position:{x:12,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"👥",style:{fontSize:40,textAlign:"center"}}},{id:"team-headcount-value",type:"text",position:{x:7,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:t.headcount.toString(),style:{fontSize:36,fontWeight:700,color:"#1f2937",textAlign:"center"}}},{id:"team-headcount-label",type:"text",position:{x:7,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"Total Headcount",style:{fontSize:12,color:"#6b7280",textAlign:"center"}}},{id:"team-new-card",type:"shape",position:{x:36,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#10b981",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:350}},{id:"team-new-icon",type:"text",position:{x:43,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"🆕",style:{fontSize:40,textAlign:"center"}}},{id:"team-new-value",type:"text",position:{x:38,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:`+${t.newHires||0}`,style:{fontSize:36,fontWeight:700,color:"#10b981",textAlign:"center"}}},{id:"team-new-label",type:"text",position:{x:38,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"New Hires",style:{fontSize:12,color:"#6b7280",textAlign:"center"}}},{id:"team-dept-card",type:"shape",position:{x:67,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#f59e0b",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:500}},{id:"team-dept-icon",type:"text",position:{x:74,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"👋",style:{fontSize:40,textAlign:"center"}}},{id:"team-dept-value",type:"text",position:{x:69,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:`-${t.departures||0}`,style:{fontSize:36,fontWeight:700,color:"#f59e0b",textAlign:"center"}}},{id:"team-dept-label",type:"text",position:{x:69,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"Departures",style:{fontSize:12,color:"#6b7280",textAlign:"center"}}},{id:"team-highlights-title",type:"text",position:{x:5,y:50,width:90,height:6,unit:"percent"},content:{type:"text",text:"Team Highlights",style:{fontSize:24,fontWeight:600,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}},...(t.highlights||[]).slice(0,4).map((n,i)=>({id:`team-highlight-${i}`,type:"text",position:{x:7,y:58+i*8,width:88,height:6,unit:"percent"},content:{type:"text",text:`• ${n}`,style:{fontSize:16,color:"#374151"}},animation:{effect:"slideInLeft",durationMs:300,delayMs:800+i*100}}))],notes:"Celebrate new team members and acknowledge departures. Highlight team achievements.",durationMs:45e3}}function zo(e){return{id:"slide-qa",title:"Q&A",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3b82f6",position:100}],gradientDirection:135},elements:[{id:"qa-title",type:"text",position:{x:10,y:35,width:80,height:20,unit:"percent"},content:{type:"text",text:"Questions?",style:{fontFamily:"Inter, sans-serif",fontSize:72,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:800,delayMs:200}},{id:"qa-subtitle",type:"text",position:{x:10,y:55,width:80,height:10,unit:"percent"},content:{type:"text",text:"Thank you for your attention",style:{fontFamily:"Inter, sans-serif",fontSize:28,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:800}},{id:"qa-contact",type:"text",position:{x:10,y:85,width:80,height:5,unit:"percent"},content:{type:"text",text:e.preparedBy?`Prepared by: ${e.preparedBy}`:e.companyName,style:{fontSize:16,color:"#bfdbfe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Open floor for questions. Have backup slides ready for detailed questions.",durationMs:3e5}}function Ao(e){return{version:"1.0",id:`quarterly-report-${e.quarter}-${e.year}`,title:`${e.quarter} ${e.year} Quarterly Report - ${e.companyName}`,author:e.preparedBy,slideSize:{width:1920,height:1080,unit:"px"},slides:[bo(e),vo(e),So(e),wo(e),ko(e),Io(e),Co(e),Mo(e),zo(e)],theme:{colors:{primary:"#3b82f6",secondary:"#10b981",background:"#fff",text:"#1f2937",accent:"#f59e0b"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["quarterly-report",e.quarter,e.year.toString()],templateId:"quarterly-report-v1"}}}function _o(){return{quarter:"Q4",year:2024,companyName:"TechCorp Inc.",reportDate:"January 15, 2025",preparedBy:"Finance Team",kpis:{revenue:{value:125e5,change:15.3,target:12e6},profit:{value:28e5,change:8.7,target:25e5},customers:{value:1250,change:22.5,target:1e3},satisfaction:{value:92,change:3.2,target:90}},financials:{revenueByMonth:[{month:"Oct",value:38e5,lastYear:32e5},{month:"Nov",value:42e5,lastYear:35e5},{month:"Dec",value:45e5,lastYear:4e6}],costBreakdown:[{category:"Personnel",value:52e5,percentage:42},{category:"Infrastructure",value:23e5,percentage:18},{category:"Marketing",value:18e5,percentage:14},{category:"R&D",value:15e5,percentage:12},{category:"Operations",value:11e5,percentage:9},{category:"Other",value:6e5,percentage:5}],profitMargin:[{month:"Oct",margin:21},{month:"Nov",margin:22},{month:"Dec",margin:24}]},pipeline:{totalValue:185e5,opportunities:[{stage:"Qualified",count:45,value:85e5},{stage:"Proposal",count:28,value:52e5},{stage:"Negotiation",count:15,value:32e5},{stage:"Closing",count:8,value:16e5}]},risks:[{name:"Supply chain delays",impact:"high",probability:"medium",mitigation:"Diversifying suppliers and increasing inventory buffer",owner:"Operations"},{name:"Key talent retention",impact:"high",probability:"low",mitigation:"Competitive compensation review and career development programs",owner:"HR"},{name:"Market competition",impact:"medium",probability:"high",mitigation:"Accelerating product innovation and customer loyalty programs",owner:"Product"}],plan:[{goal:"Launch v2.0 platform",status:"on-track",dueDate:"Q1 2025",owner:"Engineering"},{goal:"Expand to EMEA market",status:"at-risk",dueDate:"Q2 2025",owner:"Sales"},{goal:"Achieve SOC2 certification",status:"completed",owner:"Security"},{goal:"Implement AI-powered support",status:"on-track",dueDate:"Q1 2025",owner:"Support"},{goal:"Reduce customer churn by 15%",status:"on-track",dueDate:"Q4 2024",owner:"Customer Success"}],team:{headcount:156,newHires:23,departures:8,highlights:["Promoted 12 team members to senior roles","Launched engineering mentorship program","Achieved 95% employee engagement score","Completed company-wide DEI training"]}}}function To(e){const t=e.problem.painPoints.slice(0,4).map((n,i)=>({id:`pain-${i}`,type:"text",position:{x:55,y:28+i*15,width:40,height:12,unit:"percent"},content:{type:"text",text:`❌ ${n}`,style:{fontSize:20,color:"#374151",lineHeight:1.5}},animation:{effect:"slideInRight",durationMs:400,delayMs:400+i*200}}));return{id:"slide-problem",title:"The Problem",layout:"twoColumn",background:{type:"solid",color:"#fef2f2"},elements:[{id:"problem-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:e.problem.headline,style:{fontSize:48,fontWeight:700,color:"#991b1b"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"problem-icon",type:"text",position:{x:10,y:30,width:35,height:40,unit:"percent"},content:{type:"text",text:"😫",style:{fontSize:150,textAlign:"center"}},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},...t,...(e.problem.statistics||[]).slice(0,2).map((n,i)=>({id:`stat-${i}`,type:"shape",position:{x:5+i*47,y:80,width:43,height:15,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fee2e2",cornerRadius:8},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3+i*200}}))],notes:"Set up the problem. Make the audience feel the pain before presenting the solution.",durationMs:6e4}}function $o(e){const t=e.solution.keyBenefits.slice(0,3).flatMap((n,i)=>[{id:`benefit-card-${i}`,type:"shape",position:{x:5+i*32,y:45,width:29,height:45,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#10b981",strokeWidth:2,cornerRadius:12},animation:{effect:"slideInUp",durationMs:500,delayMs:400+i*200}},{id:`benefit-icon-${i}`,type:"text",position:{x:10+i*32,y:50,width:19,height:12,unit:"percent"},content:{type:"text",text:n.icon||"✅",style:{fontSize:48,textAlign:"center"}}},{id:`benefit-title-${i}`,type:"text",position:{x:7+i*32,y:64,width:25,height:8,unit:"percent"},content:{type:"text",text:n.title,style:{fontSize:20,fontWeight:600,color:"#1f2937",textAlign:"center"}}},{id:`benefit-desc-${i}`,type:"text",position:{x:7+i*32,y:73,width:25,height:14,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:14,color:"#6b7280",textAlign:"center",lineHeight:1.4}}}]);return{id:"slide-solution",title:"The Solution",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#ecfdf5",position:0},{color:"#d1fae5",position:100}],gradientDirection:180},elements:[{id:"solution-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:e.solution.headline,style:{fontSize:48,fontWeight:700,color:"#047857"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"solution-desc",type:"text",position:{x:5,y:20,width:90,height:15,unit:"percent"},content:{type:"text",text:e.solution.description,style:{fontSize:24,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},...t],notes:"Introduce your solution as the hero. Emphasize key benefits.",durationMs:6e4}}function Eo(e){var n,i;const t=(((n=e.demo)==null?void 0:n.features)||[]).slice(0,5).map((o,r)=>({id:`demo-feature-${r}`,type:"text",position:{x:55,y:25+r*12,width:40,height:10,unit:"percent"},content:{type:"text",text:`▸ ${o.name}`,style:{fontSize:18,color:"#374151",fontWeight:500}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+r*150}}));return{id:"slide-demo",title:"Product Demo",layout:"twoColumn",background:{type:"solid",color:"#fff"},elements:[{id:"demo-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:`See ${e.productName} in Action`,style:{fontSize:44,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"demo-screenshot",type:"shape",position:{x:5,y:22,width:45,height:70,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#f3f4f6",stroke:"#e5e7eb",strokeWidth:2,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:600,delayMs:300}},{id:"demo-placeholder",type:"text",position:{x:15,y:50,width:25,height:10,unit:"percent"},content:{type:"text",text:(i=e.demo)!=null&&i.screenshotUrl?"":"📱 Demo Screenshot",style:{fontSize:20,color:"#9ca3af",textAlign:"center"}}},{id:"features-title",type:"text",position:{x:55,y:18,width:40,height:6,unit:"percent"},content:{type:"text",text:"Key Features",style:{fontSize:24,fontWeight:600,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t],notes:"This is where you do the live demo or show screenshots. Keep it focused.",durationMs:12e4}}function Po(e){const t=e.features.slice(0,6).flatMap((n,i)=>{const o=Math.floor(i/3),r=i%3,a=n.highlight;return[{id:`feature-card-${i}`,type:"shape",position:{x:5+r*32,y:22+o*38,width:29,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:a?"#3b82f6":"#fff",stroke:a?"#2563eb":"#e5e7eb",strokeWidth:a?3:1,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:200+i*100}},{id:`feature-icon-${i}`,type:"text",position:{x:10+r*32,y:26+o*38,width:19,height:10,unit:"percent"},content:{type:"text",text:n.icon||"⚡",style:{fontSize:36,textAlign:"center"}}},{id:`feature-name-${i}`,type:"text",position:{x:7+r*32,y:37+o*38,width:25,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:18,fontWeight:600,color:a?"#fff":"#1f2937",textAlign:"center"}}},{id:`feature-desc-${i}`,type:"text",position:{x:7+r*32,y:44+o*38,width:25,height:10,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:12,color:a?"#dbeafe":"#6b7280",textAlign:"center",lineHeight:1.3}}}]});return{id:"slide-features",title:"Features",layout:"titleContent",background:{type:"solid",color:"#f9fafb"},elements:[{id:"features-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"Powerful Features",style:{fontSize:44,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Highlight key features. Focus on benefits, not just functionality.",durationMs:6e4}}function No(e){const t=e.pricing.plans.slice(0,3).flatMap((n,i)=>{const o=n.highlighted,r=o?18:22,a=o?72:65;return[{id:`pricing-card-${i}`,type:"shape",position:{x:5+i*32,y:r,width:29,height:a,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:o?"#3b82f6":"#fff",stroke:o?"#1d4ed8":"#e5e7eb",strokeWidth:o?3:1,cornerRadius:16},animation:{effect:"slideInUp",durationMs:500,delayMs:200+i*150}},...o?[{id:`pricing-badge-${i}`,type:"text",position:{x:10+i*32,y:r+2,width:19,height:4,unit:"percent"},content:{type:"text",text:"⭐ POPULAR",style:{fontSize:12,fontWeight:700,color:"#fcd34d",textAlign:"center"}}}]:[],{id:`pricing-name-${i}`,type:"text",position:{x:7+i*32,y:r+(o?8:5),width:25,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:24,fontWeight:600,color:o?"#fff":"#1f2937",textAlign:"center"}}},{id:`pricing-price-${i}`,type:"text",position:{x:7+i*32,y:r+(o?16:13),width:25,height:10,unit:"percent"},content:{type:"text",text:n.price==="custom"?"Custom":`${e.pricing.currency}${n.price}/${n.period==="month"?"mo":n.period==="year"?"yr":""}`,style:{fontSize:36,fontWeight:700,color:o?"#fff":"#3b82f6",textAlign:"center"}}},...n.features.slice(0,5).map((s,c)=>({id:`pricing-feature-${i}-${c}`,type:"text",position:{x:7+i*32,y:r+(o?28:25)+c*7,width:25,height:5,unit:"percent"},content:{type:"text",text:`✓ ${s}`,style:{fontSize:12,color:o?"#dbeafe":"#6b7280",textAlign:"center"}}})),{id:`pricing-cta-${i}`,type:"shape",position:{x:9+i*32,y:r+a-12,width:21,height:8,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:o?"#fff":"#3b82f6",cornerRadius:8}},{id:`pricing-cta-text-${i}`,type:"text",position:{x:9+i*32,y:r+a-10.5,width:21,height:5,unit:"percent"},content:{type:"text",text:n.cta||"Get Started",style:{fontSize:14,fontWeight:600,color:o?"#3b82f6":"#fff",textAlign:"center"}}}]});return{id:"slide-pricing",title:"Pricing",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"pricing-title",type:"text",position:{x:5,y:3,width:90,height:10,unit:"percent"},content:{type:"text",text:"Simple, Transparent Pricing",style:{fontSize:44,fontWeight:700,color:"#1f2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Present pricing clearly. Emphasize value, not just cost.",durationMs:6e4}}function Ro(e){return{id:"slide-cta",title:"Call to Action",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1e40af",position:0},{color:"#3b82f6",position:50},{color:"#60a5fa",position:100}],gradientDirection:135},elements:[{id:"cta-headline",type:"text",position:{x:10,y:25,width:80,height:20,unit:"percent"},content:{type:"text",text:e.cta.headline,style:{fontSize:56,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:700,delayMs:0}},...e.cta.subheadline?[{id:"cta-subheadline",type:"text",position:{x:15,y:48,width:70,height:10,unit:"percent"},content:{type:"text",text:e.cta.subheadline,style:{fontSize:24,color:"#bfdbfe",textAlign:"center",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:500,delayMs:500}}]:[],{id:"cta-button",type:"shape",position:{x:35,y:65,width:30,height:12,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",cornerRadius:30},animation:{effect:"slideInUp",durationMs:500,delayMs:800}},{id:"cta-button-text",type:"text",position:{x:35,y:68,width:30,height:6,unit:"percent"},content:{type:"text",text:e.cta.buttonText,style:{fontSize:24,fontWeight:700,color:"#1e40af",textAlign:"center"}}},...e.cta.contactEmail?[{id:"cta-contact",type:"text",position:{x:20,y:82,width:60,height:6,unit:"percent"},content:{type:"text",text:`📧 ${e.cta.contactEmail}`,style:{fontSize:18,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}]:[],...e.cta.websiteUrl?[{id:"cta-website",type:"text",position:{x:20,y:88,width:60,height:5,unit:"percent"},content:{type:"text",text:`🌐 ${e.cta.websiteUrl}`,style:{fontSize:16,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1100}}]:[]],notes:"Strong call to action. Make it easy for them to take the next step.",durationMs:6e4}}function qo(e){return{id:"slide-title",title:"Title",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#0f172a",position:0},{color:"#1e293b",position:100}],gradientDirection:180},elements:[{id:"title-product",type:"text",position:{x:10,y:30,width:80,height:20,unit:"percent"},content:{type:"text",text:e.productName,style:{fontSize:72,fontWeight:800,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:800,delayMs:200}},{id:"title-tagline",type:"text",position:{x:15,y:52,width:70,height:12,unit:"percent"},content:{type:"text",text:e.tagline,style:{fontSize:28,color:"#94a3b8",textAlign:"center",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:600,delayMs:800}},{id:"title-company",type:"text",position:{x:10,y:88,width:80,height:6,unit:"percent"},content:{type:"text",text:e.companyName,style:{fontSize:18,color:"#64748b",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Opening slide. Create intrigue and set the tone.",durationMs:15e3}}function Do(e){return{version:"1.0",id:`product-pitch-${e.productName.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.productName} - Product Pitch`,slideSize:{width:1920,height:1080,unit:"px"},slides:[qo(e),To(e),$o(e),Eo(e),Po(e),No(e),Ro(e)],theme:{colors:{primary:"#3b82f6",secondary:"#10b981",background:"#fff",text:"#1f2937",accent:"#f59e0b"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["product-pitch","sales"],templateId:"product-pitch-v1"}}}function Oo(){return{productName:"FlowSync",tagline:"Seamless workflow automation that actually works",companyName:"FlowSync Inc.",problem:{headline:"Manual processes are killing productivity",painPoints:["Teams waste 20+ hours/week on repetitive tasks","Data silos cause costly errors and delays","No visibility into process bottlenecks","Integration nightmares with existing tools"],statistics:[{stat:"60%",description:"of knowledge workers spend time on busy work"},{stat:"$1.8T",description:"lost annually to inefficient processes"}]},solution:{headline:"Automate in minutes, not months",description:"FlowSync connects your existing tools and automates workflows with AI-powered intelligence. No coding required.",keyBenefits:[{title:"Easy Setup",description:"Connect apps in seconds with 200+ integrations",icon:"🔌"},{title:"AI-Powered",description:"Smart automation that learns from your workflows",icon:"🧠"},{title:"Real-time Insights",description:"Dashboard with live metrics and bottleneck detection",icon:"📊"}]},demo:{features:[{name:"Visual Workflow Builder",description:"Drag-and-drop interface"},{name:"Smart Triggers",description:"Event-based automation"},{name:"Error Handling",description:"Automatic retry and alerts"},{name:"Version Control",description:"Track changes and rollback"},{name:"Team Collaboration",description:"Share and comment on flows"}]},features:[{name:"Visual Builder",description:"Intuitive drag-and-drop workflow design",icon:"🎨",highlight:!0},{name:"200+ Integrations",description:"Connect to popular apps instantly",icon:"🔗"},{name:"AI Suggestions",description:"Get smart automation recommendations",icon:"🤖"},{name:"Real-time Monitoring",description:"Track all workflows in one dashboard",icon:"📈"},{name:"Enterprise Security",description:"SOC2 compliant, encrypted data",icon:"🔒"},{name:"24/7 Support",description:"Expert help whenever you need it",icon:"💬"}],pricing:{currency:"$",plans:[{name:"Starter",price:29,period:"month",features:["5 workflows","1,000 runs/month","10 integrations","Email support"],cta:"Start Free"},{name:"Professional",price:99,period:"month",features:["Unlimited workflows","50,000 runs/month","All integrations","Priority support","AI suggestions"],highlighted:!0,cta:"Try 14 Days Free"},{name:"Enterprise",price:"custom",period:"month",features:["Everything in Pro","Unlimited runs","Dedicated support","Custom integrations","SLA guarantee"],cta:"Contact Sales"}]},cta:{headline:"Ready to automate your workflow?",subheadline:"Join 10,000+ teams already saving hours every week",buttonText:"Start Your Free Trial",contactEmail:"hello@flowsync.io",websiteUrl:"flowsync.io"}}}function jo(e){const t=Math.round(e.completed.totalPoints/e.completed.committedPoints*100);return{id:"slide-title",title:"Sprint Review",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3b82f6",position:100}],gradientDirection:135},elements:[{id:"title-sprint",type:"text",position:{x:10,y:25,width:80,height:15,unit:"percent"},content:{type:"text",text:`Sprint ${e.sprint.number} Review`,style:{fontSize:64,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"title-name",type:"text",position:{x:15,y:42,width:70,height:8,unit:"percent"},content:{type:"text",text:e.sprint.name,style:{fontSize:32,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},{id:"title-team",type:"text",position:{x:30,y:55,width:40,height:5,unit:"percent"},content:{type:"text",text:`Team ${e.team.name}`,style:{fontSize:20,color:"#bfdbfe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-dates",type:"text",position:{x:25,y:62,width:50,height:5,unit:"percent"},content:{type:"text",text:`${e.sprint.startDate} - ${e.sprint.endDate}`,style:{fontSize:18,color:"#93c5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},{id:"title-completion",type:"text",position:{x:35,y:75,width:30,height:10,unit:"percent"},content:{type:"text",text:`${t}% Complete`,style:{fontSize:36,fontWeight:700,color:t>=80?"#4ade80":t>=60?"#fbbf24":"#f87171",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:600,delayMs:800}}],notes:"Welcome stakeholders. Quick overview of sprint completion.",durationMs:3e4}}function Fo(e){return{id:"slide-goal",title:"Sprint Goal",layout:"titleContent",background:{type:"solid",color:"#f0f9ff"},elements:[{id:"goal-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Sprint Goal",style:{fontSize:44,fontWeight:700,color:"#1E3A8A"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"goal-card",type:"shape",position:{x:10,y:25,width:80,height:30,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#3b82f6",strokeWidth:3,cornerRadius:16},animation:{effect:"slideInUp",durationMs:500,delayMs:200}},{id:"goal-icon",type:"text",position:{x:15,y:30,width:10,height:15,unit:"percent"},content:{type:"text",text:"🎯",style:{fontSize:64}}},{id:"goal-text",type:"text",position:{x:27,y:32,width:58,height:20,unit:"percent"},content:{type:"text",text:e.sprint.goal,style:{fontSize:28,color:"#1f2937",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"goal-status",type:"text",position:{x:10,y:60,width:80,height:8,unit:"percent"},content:{type:"text",text:e.completed.totalPoints>=e.completed.committedPoints*.8?"✅ Goal Achieved":"⚠️ Goal Partially Met",style:{fontSize:32,fontWeight:600,color:e.completed.totalPoints>=e.completed.committedPoints*.8?"#059669":"#d97706",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:500,delayMs:700}}],notes:"Review whether the sprint goal was achieved and why.",durationMs:45e3}}function Lo(e){const t=e.completed.stories.slice(0,8).map((n,i)=>{const o=Math.floor(i/2),r=i%2,a=n.type==="feature"?"✨":n.type==="bug"?"🐛":n.type==="tech-debt"?"🔧":"🔬",s=n.type==="feature"?"#059669":n.type==="bug"?"#dc2626":n.type==="tech-debt"?"#7c3aed":"#0891b2";return{id:`story-${i}`,type:"text",position:{x:5+r*48,y:22+o*9,width:44,height:7,unit:"percent"},content:{type:"text",text:`${a} ${n.key}: ${n.title}`,style:{fontSize:16,color:s,fontWeight:n.demo?700:400}},animation:{effect:"slideInRight",durationMs:300,delayMs:300+i*100}}});return{id:"slide-completed",title:"Completed Work",layout:"titleContent",background:{type:"solid",color:"#f0fdf4"},elements:[{id:"completed-title",type:"text",position:{x:5,y:5,width:60,height:10,unit:"percent"},content:{type:"text",text:"Completed Work",style:{fontSize:44,fontWeight:700,color:"#166534"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"completed-points",type:"text",position:{x:70,y:5,width:25,height:12,unit:"percent"},content:{type:"text",text:`${e.completed.totalPoints} / ${e.completed.committedPoints} pts`,style:{fontSize:32,fontWeight:700,color:"#059669",textAlign:"right"}},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},...t,{id:"legend",type:"text",position:{x:5,y:90,width:90,height:5,unit:"percent"},content:{type:"text",text:"✨ Feature | 🐛 Bug Fix | 🔧 Tech Debt | 🔬 Spike",style:{fontSize:14,color:"#6b7280",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Walk through completed items. Highlight any notable achievements.",durationMs:9e4}}function Wo(e){const t=Math.max(...e.velocity.history.map(o=>o.points),e.velocity.current),n=e.velocity.history.slice(-5).map((o,r)=>{const a=o.points/t*45;return{id:`bar-${r}`,type:"shape",position:{x:10+r*16,y:75-a,width:12,height:a,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#93c5fd",cornerRadius:8},animation:{effect:"slideInUp",durationMs:500,delayMs:400+r*100}}}),i=e.velocity.current/t*45;return{id:"slide-velocity",title:"Velocity",layout:"titleContent",background:{type:"solid",color:"#fff"},elements:[{id:"velocity-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Sprint Velocity",style:{fontSize:44,fontWeight:700,color:"#1E3A8A"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...n,{id:"current-bar",type:"shape",position:{x:10+e.velocity.history.slice(-5).length*16,y:75-i,width:12,height:i,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#3b82f6",cornerRadius:8},animation:{effect:"slideInUp",durationMs:600,delayMs:900}},{id:"current-label",type:"text",position:{x:10+e.velocity.history.slice(-5).length*16,y:77,width:12,height:6,unit:"percent"},content:{type:"text",text:`S${e.sprint.number}`,style:{fontSize:14,color:"#1E3A8A",fontWeight:600,textAlign:"center"}}},{id:"current-value",type:"text",position:{x:10+e.velocity.history.slice(-5).length*16,y:70-i,width:12,height:5,unit:"percent"},content:{type:"text",text:`${e.velocity.current}`,style:{fontSize:18,color:"#3b82f6",fontWeight:700,textAlign:"center"}}},{id:"average-line",type:"text",position:{x:5,y:18,width:35,height:10,unit:"percent"},content:{type:"text",text:`Average: ${e.velocity.average} pts/sprint`,style:{fontSize:24,color:"#6b7280"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"trend",type:"text",position:{x:60,y:18,width:35,height:10,unit:"percent"},content:{type:"text",text:e.velocity.current>=e.velocity.average?"📈 On Track":"📉 Below Average",style:{fontSize:24,color:e.velocity.current>=e.velocity.average?"#059669":"#dc2626",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Review velocity trends. Discuss any significant changes.",durationMs:6e4}}function Bo(e){const t=(e.impediments||[]).slice(0,5).map((n,i)=>{const o=n.status==="resolved"?"✅":n.status==="ongoing"?"🔄":"🚨",r=n.status==="resolved"?"#059669":n.status==="ongoing"?"#d97706":"#dc2626";return{id:`impediment-${i}`,type:"text",position:{x:5,y:25+i*13,width:90,height:11,unit:"percent"},content:{type:"text",text:`${o} ${n.description}${n.owner?` (${n.owner})`:""}`,style:{fontSize:20,color:r,lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:400,delayMs:300+i*150}}});return{id:"slide-impediments",title:"Impediments",layout:"titleContent",background:{type:"solid",color:"#fef2f2"},elements:[{id:"impediments-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"Impediments & Blockers",style:{fontSize:44,fontWeight:700,color:"#991b1b"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t,{id:"legend-impediments",type:"text",position:{x:5,y:90,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Resolved | 🔄 Ongoing | 🚨 Escalated",style:{fontSize:14,color:"#6b7280",textAlign:"center"}}}],notes:"Discuss blockers and what help is needed from stakeholders.",durationMs:6e4}}function Uo(e){const t=e.nextSprint.topPriorities.slice(0,5).map((n,i)=>({id:`priority-${i}`,type:"text",position:{x:5,y:45+i*10,width:90,height:8,unit:"percent"},content:{type:"text",text:`${i+1}. ${n.key}: ${n.title}${n.points?` (${n.points} pts)`:""}`,style:{fontSize:20,color:"#374151",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+i*100}}));return{id:"slide-next",title:"Next Sprint",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#eef2ff",position:0},{color:"#e0e7ff",position:100}],gradientDirection:180},elements:[{id:"next-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:`Sprint ${e.sprint.number+1} Preview`,style:{fontSize:44,fontWeight:700,color:"#4338ca"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"next-goal-label",type:"text",position:{x:5,y:18,width:20,height:6,unit:"percent"},content:{type:"text",text:"Sprint Goal:",style:{fontSize:20,fontWeight:600,color:"#6366f1"}}},{id:"next-goal",type:"text",position:{x:5,y:25,width:90,height:12,unit:"percent"},content:{type:"text",text:e.nextSprint.goal,style:{fontSize:28,color:"#1f2937",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"priorities-label",type:"text",position:{x:5,y:40,width:30,height:5,unit:"percent"},content:{type:"text",text:"Top Priorities:",style:{fontSize:20,fontWeight:600,color:"#6366f1"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t,{id:"capacity",type:"text",position:{x:70,y:5,width:25,height:10,unit:"percent"},content:{type:"text",text:`Capacity: ${e.nextSprint.capacity} pts`,style:{fontSize:20,fontWeight:600,color:"#059669",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}}],notes:"Preview next sprint. Get stakeholder input on priorities.",durationMs:6e4}}function Vo(e){const t=[jo(e),Fo(e),Lo(e),Wo(e)];return e.impediments&&e.impediments.length>0&&t.push(Bo(e)),t.push(Uo(e)),{version:"1.0",id:`sprint-review-${e.sprint.number}`,title:`Sprint ${e.sprint.number} Review - ${e.team.name}`,slideSize:{width:1920,height:1080,unit:"px"},slides:t,theme:{colors:{primary:"#3b82f6",secondary:"#10b981",background:"#fff",text:"#1f2937",accent:"#8b5cf6"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["sprint-review","agile","scrum"],templateId:"sprint-review-v1"}}}function Ho(){return{sprint:{number:24,name:"Phoenix Release",startDate:"2024-03-04",endDate:"2024-03-15",goal:"Complete user authentication flow and improve dashboard performance by 50%"},team:{name:"Alpha",members:[{name:"Sarah Chen",role:"Tech Lead"},{name:"Mike Johnson",role:"Senior Dev"},{name:"Emily Davis",role:"Frontend Dev"},{name:"Alex Kim",role:"QA Engineer"}]},completed:{stories:[{key:"AUTH-123",title:"OAuth2 integration",points:8,assignee:"Sarah",type:"feature",demo:!0},{key:"AUTH-124",title:"Password reset flow",points:5,assignee:"Mike",type:"feature",demo:!0},{key:"DASH-45",title:"Query optimization",points:8,assignee:"Sarah",type:"tech-debt"},{key:"DASH-46",title:"Caching layer",points:5,assignee:"Mike",type:"feature"},{key:"BUG-89",title:"Login timeout issue",points:3,assignee:"Emily",type:"bug"},{key:"BUG-90",title:"Memory leak in charts",points:5,assignee:"Emily",type:"bug"}],totalPoints:34,committedPoints:40},notCompleted:[{key:"AUTH-125",title:"MFA implementation",points:6,reason:"Blocked by security review"}],demos:[{title:"OAuth2 Login",description:"Full OAuth2 flow with Google and GitHub",presenter:"Sarah"},{title:"Password Reset",description:"Email-based password reset with security tokens",presenter:"Mike"}],velocity:{current:34,history:[{sprint:"S20",points:28},{sprint:"S21",points:32},{sprint:"S22",points:35},{sprint:"S23",points:30}],average:31},metrics:{bugsFixed:2,bugsCreated:1,testCoverage:78,deployments:3,cycleTime:4.2},impediments:[{description:"Security review delayed MFA implementation",status:"ongoing",owner:"Security Team"},{description:"CI pipeline slow - 45min builds",status:"resolved",owner:"DevOps"}],nextSprint:{goal:"Complete MFA implementation and launch beta user onboarding",topPriorities:[{key:"AUTH-125",title:"MFA implementation",points:6},{key:"ONBOARD-01",title:"Welcome wizard",points:8},{key:"ONBOARD-02",title:"User tutorial system",points:5},{key:"DASH-50",title:"Real-time notifications",points:5}],capacity:32}}}function Qo(e){return{id:"slide-title",title:"Architecture Overview",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#0f172a",position:0},{color:"#1e293b",position:100}],gradientDirection:135},elements:[{id:"title-main",type:"text",position:{x:10,y:28,width:80,height:15,unit:"percent"},content:{type:"text",text:e.project.name,style:{fontSize:64,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"title-subtitle",type:"text",position:{x:15,y:45,width:70,height:8,unit:"percent"},content:{type:"text",text:"Architecture Overview",style:{fontSize:36,color:"#60a5fa",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},{id:"title-version",type:"text",position:{x:35,y:58,width:30,height:5,unit:"percent"},content:{type:"text",text:`v${e.project.version}`,style:{fontSize:20,color:"#94a3b8",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-desc",type:"text",position:{x:15,y:68,width:70,height:12,unit:"percent"},content:{type:"text",text:e.project.description,style:{fontSize:18,color:"#cbd5e1",textAlign:"center",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}},...e.project.team?[{id:"title-team",type:"text",position:{x:10,y:88,width:80,height:5,unit:"percent"},content:{type:"text",text:`Team: ${e.project.team}`,style:{fontSize:16,color:"#64748b",textAlign:"center"}}}]:[]],notes:"Introduction to the system architecture. Set context for the audience.",durationMs:3e4}}function Ko(e){const t=e.systemOverview.keyCharacteristics.slice(0,4).map((n,i)=>[{id:`char-card-${i}`,type:"shape",position:{x:5+i*24,y:65,width:22,height:28,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1e293b",stroke:"#334155",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInUp",durationMs:400,delayMs:600+i*100}},{id:`char-value-${i}`,type:"text",position:{x:7+i*24,y:70,width:18,height:10,unit:"percent"},content:{type:"text",text:n.value,style:{fontSize:32,fontWeight:700,color:"#60a5fa",textAlign:"center"}}},{id:`char-label-${i}`,type:"text",position:{x:7+i*24,y:82,width:18,height:8,unit:"percent"},content:{type:"text",text:n.label,style:{fontSize:14,color:"#94a3b8",textAlign:"center"}}}]).flat();return{id:"slide-overview",title:"System Overview",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"overview-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"System Overview",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"overview-summary",type:"text",position:{x:5,y:18,width:90,height:15,unit:"percent"},content:{type:"text",text:e.systemOverview.summary,style:{fontSize:22,color:"#cbd5e1",lineHeight:1.6}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"diagram-placeholder",type:"shape",position:{x:20,y:35,width:60,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1e293b",stroke:"#334155",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:400}},{id:"diagram-label",type:"text",position:{x:35,y:45,width:30,height:6,unit:"percent"},content:{type:"text",text:"📊 System Diagram",style:{fontSize:18,color:"#64748b",textAlign:"center"}}},...t],notes:"High-level system overview. Explain the main purpose and characteristics.",durationMs:6e4}}function Yo(e){const t={frontend:"#3b82f6",backend:"#10b981",service:"#8b5cf6",database:"#f59e0b",cache:"#ec4899",queue:"#06b6d4",external:"#6b7280"},n={frontend:"🖥️",backend:"⚙️",service:"🔧",database:"🗄️",cache:"⚡",queue:"📬",external:"🔗"},i=e.components.slice(0,6).flatMap((o,r)=>{const a=Math.floor(r/3),s=r%3,c=t[o.type]||"#6b7280",u=n[o.type]||"📦";return[{id:`comp-card-${r}`,type:"shape",position:{x:5+s*32,y:22+a*38,width:29,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1e293b",stroke:c,strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:200+r*100}},{id:`comp-icon-${r}`,type:"text",position:{x:7+s*32,y:25+a*38,width:6,height:8,unit:"percent"},content:{type:"text",text:u,style:{fontSize:28}}},{id:`comp-name-${r}`,type:"text",position:{x:14+s*32,y:26+a*38,width:18,height:6,unit:"percent"},content:{type:"text",text:o.name,style:{fontSize:18,fontWeight:600,color:"#f8fafc"}}},{id:`comp-tech-${r}`,type:"text",position:{x:7+s*32,y:34+a*38,width:25,height:5,unit:"percent"},content:{type:"text",text:o.technology,style:{fontSize:12,color:c,fontWeight:500}}},{id:`comp-desc-${r}`,type:"text",position:{x:7+s*32,y:40+a*38,width:25,height:14,unit:"percent"},content:{type:"text",text:o.description,style:{fontSize:12,color:"#94a3b8",lineHeight:1.4}}}]});return{id:"slide-components",title:"Components",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"components-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"System Components",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...i],notes:"Walk through each component. Explain responsibilities and interactions.",durationMs:9e4}}function Go(e){const n=[{key:"frontend",label:"Frontend",icon:"🖥️",color:"#3b82f6"},{key:"backend",label:"Backend",icon:"⚙️",color:"#10b981"},{key:"database",label:"Database",icon:"🗄️",color:"#f59e0b"},{key:"infrastructure",label:"Infrastructure",icon:"☁️",color:"#8b5cf6"}].flatMap((i,o)=>{const r=e.techStack[i.key];if(!r||r.length===0)return[];const a=o%2,s=Math.floor(o/2);return[{id:`tech-header-${i.key}`,type:"text",position:{x:5+a*48,y:20+s*40,width:44,height:6,unit:"percent"},content:{type:"text",text:`${i.icon} ${i.label}`,style:{fontSize:24,fontWeight:600,color:i.color}},animation:{effect:"fadeIn",durationMs:400,delayMs:200+o*100}},...r.slice(0,4).map((c,u)=>({id:`tech-item-${i.key}-${u}`,type:"text",position:{x:7+a*48,y:28+s*40+u*7,width:40,height:5,unit:"percent"},content:{type:"text",text:`• ${c.name}${c.version?` v${c.version}`:""} - ${c.purpose}`,style:{fontSize:14,color:"#cbd5e1",lineHeight:1.3}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+o*100+u*50}}))]});return{id:"slide-techstack",title:"Tech Stack",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"techstack-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Technology Stack",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...n],notes:"Overview of technologies used. Explain key decisions.",durationMs:6e4}}function Xo(e){const t=e.infrastructure.services.slice(0,8).map((n,i)=>{const o=i%4,r=Math.floor(i/4);return{id:`infra-svc-${i}`,type:"text",position:{x:5+o*24,y:50+r*15,width:22,height:12,unit:"percent"},content:{type:"text",text:`${n.icon||"☁️"} ${n.name}
102
+ ${n.purpose}`,style:{fontSize:14,color:"#cbd5e1",textAlign:"center",lineHeight:1.4}},animation:{effect:"zoomIn",durationMs:300,delayMs:400+i*80}}});return{id:"slide-infrastructure",title:"Infrastructure",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#0f172a",position:0},{color:"#1E1B4B",position:100}],gradientDirection:180},elements:[{id:"infra-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Infrastructure",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"infra-provider",type:"text",position:{x:5,y:18,width:45,height:8,unit:"percent"},content:{type:"text",text:`☁️ Provider: ${e.infrastructure.provider}`,style:{fontSize:24,color:"#a78bfa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...e.infrastructure.regions?[{id:"infra-regions",type:"text",position:{x:55,y:18,width:40,height:8,unit:"percent"},content:{type:"text",text:`🌍 Regions: ${e.infrastructure.regions.join(", ")}`,style:{fontSize:18,color:"#94a3b8",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}}]:[],{id:"infra-diagram",type:"shape",position:{x:15,y:28,width:70,height:18,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1e293b",stroke:"#8b5cf6",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:350}},{id:"infra-diagram-text",type:"text",position:{x:35,y:35,width:30,height:5,unit:"percent"},content:{type:"text",text:"🏗️ Infrastructure Diagram",style:{fontSize:16,color:"#64748b",textAlign:"center"}}},...t],notes:"Explain infrastructure setup, scaling strategy, and deployment.",durationMs:6e4}}function Jo(e){if(!e.security)return{id:"slide-security",title:"Security",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"security-placeholder",type:"text",position:{x:30,y:45,width:40,height:10,unit:"percent"},content:{type:"text",text:"Security details to be added",style:{fontSize:24,color:"#64748b",textAlign:"center"}}}],durationMs:3e4};const t=e.security.practices.slice(0,6).map((n,i)=>({id:`practice-${i}`,type:"text",position:{x:5,y:55+i*7,width:90,height:5,unit:"percent"},content:{type:"text",text:`✓ ${n}`,style:{fontSize:18,color:"#4ade80"}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+i*100}}));return{id:"slide-security",title:"Security",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"security-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔒 Security",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"security-auth",type:"text",position:{x:5,y:20,width:45,height:10,unit:"percent"},content:{type:"text",text:`🔑 Auth: ${e.security.authMethod}`,style:{fontSize:22,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"security-encryption",type:"text",position:{x:5,y:30,width:45,height:10,unit:"percent"},content:{type:"text",text:`🔐 Encryption: ${e.security.encryption}`,style:{fontSize:22,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...e.security.compliance?[{id:"security-compliance",type:"text",position:{x:55,y:20,width:40,height:20,unit:"percent"},content:{type:"text",text:`📋 Compliance:
103
103
  ${e.security.compliance.join(`
104
- `)}`,style:{fontSize:18,color:"#94a3b8",lineHeight:1.6}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}}]:[],{id:"practices-header",type:"text",position:{x:5,y:45,width:90,height:8,unit:"percent"},content:{type:"text",text:"Security Practices",style:{fontSize:24,fontWeight:600,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t],notes:"Cover security measures and compliance requirements.",durationMs:6e4}}function Jo(e){const t=[Ho(e),Qo(e),Yo(e),Go(e),Ko(e)];return e.security&&t.push(Xo(e)),{version:"1.0",id:`architecture-${e.project.name.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.project.name} - Architecture Overview`,slideSize:{width:1920,height:1080,unit:"px"},slides:t,theme:{colors:{primary:"#3b82f6",secondary:"#8b5cf6",background:"#0f172a",text:"#f8fafc",accent:"#10b981"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["architecture","technical","system-design"],templateId:"architecture-overview-v1"}}}function Zo(){return{project:{name:"E-Commerce Platform",version:"2.5.0",description:"Scalable microservices-based e-commerce platform serving 10M+ users",team:"Platform Engineering"},systemOverview:{summary:"A modern e-commerce platform built on microservices architecture, designed for high availability, horizontal scaling, and real-time inventory management. The system handles 50K+ concurrent users with sub-100ms response times.",keyCharacteristics:[{label:"Services",value:"12"},{label:"Availability",value:"99.9%"},{label:"Response Time",value:"<100ms"},{label:"Daily Orders",value:"500K+"}]},components:[{name:"Web App",type:"frontend",description:"React SPA with SSR support",technology:"Next.js 14"},{name:"Mobile BFF",type:"backend",description:"Backend for mobile apps",technology:"Node.js/Express"},{name:"Order Service",type:"service",description:"Order processing and management",technology:"Go"},{name:"Inventory Service",type:"service",description:"Real-time stock management",technology:"Rust"},{name:"PostgreSQL",type:"database",description:"Primary transactional database",technology:"PostgreSQL 15"},{name:"Redis Cluster",type:"cache",description:"Session and caching layer",technology:"Redis 7"}],dataFlow:{description:"Request flows from CDN through API Gateway to microservices",steps:[{from:"Client",to:"CDN",description:"Static assets",protocol:"HTTPS"},{from:"Client",to:"API Gateway",description:"API requests",protocol:"HTTPS"},{from:"API Gateway",to:"Services",description:"Routed requests",protocol:"gRPC"},{from:"Services",to:"Message Queue",description:"Async events",protocol:"AMQP"}]},techStack:{frontend:[{name:"Next.js",version:"14",purpose:"React framework with SSR"},{name:"TypeScript",version:"5.3",purpose:"Type safety"},{name:"Tailwind CSS",version:"3.4",purpose:"Styling"}],backend:[{name:"Go",version:"1.21",purpose:"High-performance services"},{name:"Node.js",version:"20",purpose:"BFF and tooling"},{name:"gRPC",purpose:"Service communication"}],database:[{name:"PostgreSQL",version:"15",purpose:"Primary OLTP"},{name:"Redis",version:"7",purpose:"Caching"},{name:"Elasticsearch",version:"8",purpose:"Search"}],infrastructure:[{name:"Kubernetes",purpose:"Container orchestration"},{name:"Terraform",purpose:"Infrastructure as Code"},{name:"ArgoCD",purpose:"GitOps deployments"}]},infrastructure:{provider:"AWS",regions:["us-east-1","eu-west-1","ap-southeast-1"],services:[{name:"EKS",purpose:"Kubernetes",icon:"⚙️"},{name:"RDS",purpose:"PostgreSQL",icon:"🗄️"},{name:"ElastiCache",purpose:"Redis",icon:"⚡"},{name:"S3",purpose:"Object Storage",icon:"📦"},{name:"CloudFront",purpose:"CDN",icon:"🌐"},{name:"Route 53",purpose:"DNS",icon:"🔗"},{name:"SQS/SNS",purpose:"Messaging",icon:"📬"},{name:"CloudWatch",purpose:"Monitoring",icon:"📊"}]},security:{authMethod:"OAuth 2.0 + JWT",encryption:"AES-256 at rest, TLS 1.3 in transit",compliance:["SOC 2 Type II","PCI DSS","GDPR"],practices:["Zero-trust network architecture","Secrets managed via HashiCorp Vault","Regular penetration testing","Automated vulnerability scanning","Role-based access control (RBAC)","Audit logging for all operations"]}}}function er(e){return{id:"slide-welcome",title:"Welcome",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#7c3aed",position:0},{color:"#a78bfa",position:50},{color:"#c4b5fd",position:100}],gradientDirection:135},elements:[{id:"welcome-title",type:"text",position:{x:10,y:20,width:80,height:15,unit:"percent"},content:{type:"text",text:`Welcome to ${e.company.name}! 🎉`,style:{fontSize:56,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:700,delayMs:0}},{id:"welcome-name",type:"text",position:{x:15,y:42,width:70,height:12,unit:"percent"},content:{type:"text",text:e.newHire.name,style:{fontSize:48,fontWeight:600,color:"#fff",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:400}},{id:"welcome-role",type:"text",position:{x:20,y:56,width:60,height:8,unit:"percent"},content:{type:"text",text:e.newHire.role,style:{fontSize:28,color:"#ede9fe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:600}},{id:"welcome-team",type:"text",position:{x:25,y:66,width:50,height:6,unit:"percent"},content:{type:"text",text:`Team: ${e.newHire.team}`,style:{fontSize:22,color:"#ddd6fe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:750}},{id:"welcome-date",type:"text",position:{x:30,y:75,width:40,height:5,unit:"percent"},content:{type:"text",text:`Start Date: ${e.newHire.startDate}`,style:{fontSize:18,color:"#c4b5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:900}},...e.company.tagline?[{id:"welcome-tagline",type:"text",position:{x:15,y:88,width:70,height:5,unit:"percent"},content:{type:"text",text:`"${e.company.tagline}"`,style:{fontSize:18,fontStyle:"italic",color:"#ede9fe",textAlign:"center"}}}]:[]],notes:"Warm welcome! Make the new hire feel excited to join.",durationMs:3e4}}function tr(e){const t=e.culture.values.slice(0,4).flatMap((n,i)=>{const o=i%2,r=Math.floor(i/2);return[{id:`value-card-${i}`,type:"shape",position:{x:5+o*48,y:45+r*27,width:44,height:24,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e9d5ff",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:500+i*150}},{id:`value-icon-${i}`,type:"text",position:{x:8+o*48,y:48+r*27,width:8,height:10,unit:"percent"},content:{type:"text",text:n.icon||"✨",style:{fontSize:36}}},{id:`value-name-${i}`,type:"text",position:{x:17+o*48,y:49+r*27,width:30,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:20,fontWeight:600,color:"#6d28d9"}}},{id:`value-desc-${i}`,type:"text",position:{x:8+o*48,y:58+r*27,width:38,height:10,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:14,color:"#6b7280",lineHeight:1.4}}}]});return{id:"slide-culture",title:"Culture & Values",layout:"titleContent",background:{type:"solid",color:"#faf5ff"},elements:[{id:"culture-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Our Culture & Values",style:{fontSize:44,fontWeight:700,color:"#6d28d9"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"culture-mission-label",type:"text",position:{x:5,y:18,width:20,height:5,unit:"percent"},content:{type:"text",text:"🎯 Our Mission",style:{fontSize:18,fontWeight:600,color:"#7c3aed"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"culture-mission",type:"text",position:{x:5,y:25,width:90,height:15,unit:"percent"},content:{type:"text",text:e.culture.mission,style:{fontSize:24,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:500,delayMs:350}},...t],notes:"Explain company culture and core values. Share real examples.",durationMs:9e4}}function nr(e){const t=e.team.members.slice(0,8).map((n,i)=>{const o=i%4,r=Math.floor(i/4);return{id:`member-${i}`,type:"text",position:{x:5+o*24,y:40+r*25,width:22,height:22,unit:"percent"},content:{type:"text",text:`👤
104
+ `)}`,style:{fontSize:18,color:"#94a3b8",lineHeight:1.6}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}}]:[],{id:"practices-header",type:"text",position:{x:5,y:45,width:90,height:8,unit:"percent"},content:{type:"text",text:"Security Practices",style:{fontSize:24,fontWeight:600,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t],notes:"Cover security measures and compliance requirements.",durationMs:6e4}}function Zo(e){const t=[Qo(e),Ko(e),Yo(e),Go(e),Xo(e)];return e.security&&t.push(Jo(e)),{version:"1.0",id:`architecture-${e.project.name.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.project.name} - Architecture Overview`,slideSize:{width:1920,height:1080,unit:"px"},slides:t,theme:{colors:{primary:"#3b82f6",secondary:"#8b5cf6",background:"#0f172a",text:"#f8fafc",accent:"#10b981"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["architecture","technical","system-design"],templateId:"architecture-overview-v1"}}}function er(){return{project:{name:"E-Commerce Platform",version:"2.5.0",description:"Scalable microservices-based e-commerce platform serving 10M+ users",team:"Platform Engineering"},systemOverview:{summary:"A modern e-commerce platform built on microservices architecture, designed for high availability, horizontal scaling, and real-time inventory management. The system handles 50K+ concurrent users with sub-100ms response times.",keyCharacteristics:[{label:"Services",value:"12"},{label:"Availability",value:"99.9%"},{label:"Response Time",value:"<100ms"},{label:"Daily Orders",value:"500K+"}]},components:[{name:"Web App",type:"frontend",description:"React SPA with SSR support",technology:"Next.js 14"},{name:"Mobile BFF",type:"backend",description:"Backend for mobile apps",technology:"Node.js/Express"},{name:"Order Service",type:"service",description:"Order processing and management",technology:"Go"},{name:"Inventory Service",type:"service",description:"Real-time stock management",technology:"Rust"},{name:"PostgreSQL",type:"database",description:"Primary transactional database",technology:"PostgreSQL 15"},{name:"Redis Cluster",type:"cache",description:"Session and caching layer",technology:"Redis 7"}],dataFlow:{description:"Request flows from CDN through API Gateway to microservices",steps:[{from:"Client",to:"CDN",description:"Static assets",protocol:"HTTPS"},{from:"Client",to:"API Gateway",description:"API requests",protocol:"HTTPS"},{from:"API Gateway",to:"Services",description:"Routed requests",protocol:"gRPC"},{from:"Services",to:"Message Queue",description:"Async events",protocol:"AMQP"}]},techStack:{frontend:[{name:"Next.js",version:"14",purpose:"React framework with SSR"},{name:"TypeScript",version:"5.3",purpose:"Type safety"},{name:"Tailwind CSS",version:"3.4",purpose:"Styling"}],backend:[{name:"Go",version:"1.21",purpose:"High-performance services"},{name:"Node.js",version:"20",purpose:"BFF and tooling"},{name:"gRPC",purpose:"Service communication"}],database:[{name:"PostgreSQL",version:"15",purpose:"Primary OLTP"},{name:"Redis",version:"7",purpose:"Caching"},{name:"Elasticsearch",version:"8",purpose:"Search"}],infrastructure:[{name:"Kubernetes",purpose:"Container orchestration"},{name:"Terraform",purpose:"Infrastructure as Code"},{name:"ArgoCD",purpose:"GitOps deployments"}]},infrastructure:{provider:"AWS",regions:["us-east-1","eu-west-1","ap-southeast-1"],services:[{name:"EKS",purpose:"Kubernetes",icon:"⚙️"},{name:"RDS",purpose:"PostgreSQL",icon:"🗄️"},{name:"ElastiCache",purpose:"Redis",icon:"⚡"},{name:"S3",purpose:"Object Storage",icon:"📦"},{name:"CloudFront",purpose:"CDN",icon:"🌐"},{name:"Route 53",purpose:"DNS",icon:"🔗"},{name:"SQS/SNS",purpose:"Messaging",icon:"📬"},{name:"CloudWatch",purpose:"Monitoring",icon:"📊"}]},security:{authMethod:"OAuth 2.0 + JWT",encryption:"AES-256 at rest, TLS 1.3 in transit",compliance:["SOC 2 Type II","PCI DSS","GDPR"],practices:["Zero-trust network architecture","Secrets managed via HashiCorp Vault","Regular penetration testing","Automated vulnerability scanning","Role-based access control (RBAC)","Audit logging for all operations"]}}}function tr(e){return{id:"slide-welcome",title:"Welcome",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#7c3aed",position:0},{color:"#a78bfa",position:50},{color:"#c4b5fd",position:100}],gradientDirection:135},elements:[{id:"welcome-title",type:"text",position:{x:10,y:20,width:80,height:15,unit:"percent"},content:{type:"text",text:`Welcome to ${e.company.name}! 🎉`,style:{fontSize:56,fontWeight:700,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:700,delayMs:0}},{id:"welcome-name",type:"text",position:{x:15,y:42,width:70,height:12,unit:"percent"},content:{type:"text",text:e.newHire.name,style:{fontSize:48,fontWeight:600,color:"#fff",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:400}},{id:"welcome-role",type:"text",position:{x:20,y:56,width:60,height:8,unit:"percent"},content:{type:"text",text:e.newHire.role,style:{fontSize:28,color:"#ede9fe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:600}},{id:"welcome-team",type:"text",position:{x:25,y:66,width:50,height:6,unit:"percent"},content:{type:"text",text:`Team: ${e.newHire.team}`,style:{fontSize:22,color:"#ddd6fe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:750}},{id:"welcome-date",type:"text",position:{x:30,y:75,width:40,height:5,unit:"percent"},content:{type:"text",text:`Start Date: ${e.newHire.startDate}`,style:{fontSize:18,color:"#c4b5fd",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:900}},...e.company.tagline?[{id:"welcome-tagline",type:"text",position:{x:15,y:88,width:70,height:5,unit:"percent"},content:{type:"text",text:`"${e.company.tagline}"`,style:{fontSize:18,fontStyle:"italic",color:"#ede9fe",textAlign:"center"}}}]:[]],notes:"Warm welcome! Make the new hire feel excited to join.",durationMs:3e4}}function nr(e){const t=e.culture.values.slice(0,4).flatMap((n,i)=>{const o=i%2,r=Math.floor(i/2);return[{id:`value-card-${i}`,type:"shape",position:{x:5+o*48,y:45+r*27,width:44,height:24,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e9d5ff",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:500+i*150}},{id:`value-icon-${i}`,type:"text",position:{x:8+o*48,y:48+r*27,width:8,height:10,unit:"percent"},content:{type:"text",text:n.icon||"✨",style:{fontSize:36}}},{id:`value-name-${i}`,type:"text",position:{x:17+o*48,y:49+r*27,width:30,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:20,fontWeight:600,color:"#6d28d9"}}},{id:`value-desc-${i}`,type:"text",position:{x:8+o*48,y:58+r*27,width:38,height:10,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:14,color:"#6b7280",lineHeight:1.4}}}]});return{id:"slide-culture",title:"Culture & Values",layout:"titleContent",background:{type:"solid",color:"#faf5ff"},elements:[{id:"culture-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Our Culture & Values",style:{fontSize:44,fontWeight:700,color:"#6d28d9"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"culture-mission-label",type:"text",position:{x:5,y:18,width:20,height:5,unit:"percent"},content:{type:"text",text:"🎯 Our Mission",style:{fontSize:18,fontWeight:600,color:"#7c3aed"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"culture-mission",type:"text",position:{x:5,y:25,width:90,height:15,unit:"percent"},content:{type:"text",text:e.culture.mission,style:{fontSize:24,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:500,delayMs:350}},...t],notes:"Explain company culture and core values. Share real examples.",durationMs:9e4}}function ir(e){const t=e.team.members.slice(0,8).map((n,i)=>{const o=i%4,r=Math.floor(i/4);return{id:`member-${i}`,type:"text",position:{x:5+o*24,y:40+r*25,width:22,height:22,unit:"percent"},content:{type:"text",text:`👤
105
105
  ${n.name}
106
- ${n.role}`,style:{fontSize:14,color:"#374151",textAlign:"center",lineHeight:1.6}},animation:{effect:"zoomIn",durationMs:300,delayMs:400+i*80}}});return{id:"slide-team",title:"Meet the Team",layout:"titleContent",background:{type:"solid",color:"#f0fdf4"},elements:[{id:"team-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:`Meet Team ${e.team.name} 👋`,style:{fontSize:44,fontWeight:700,color:"#166534"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"team-desc",type:"text",position:{x:5,y:18,width:90,height:12,unit:"percent"},content:{type:"text",text:e.team.description,style:{fontSize:20,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...e.newHire.manager?[{id:"team-manager",type:"text",position:{x:5,y:32,width:45,height:6,unit:"percent"},content:{type:"text",text:`📋 Manager: ${e.newHire.manager}`,style:{fontSize:18,color:"#059669"}}}]:[],...e.newHire.buddy?[{id:"team-buddy",type:"text",position:{x:50,y:32,width:45,height:6,unit:"percent"},content:{type:"text",text:`🤝 Onboarding Buddy: ${e.newHire.buddy}`,style:{fontSize:18,color:"#059669"}}}]:[],...t],notes:"Introduce team members. Share their roles and how to reach them.",durationMs:9e4}}function ir(e){const t=e.tools.filter(r=>r.priority==="essential"),n=e.tools.filter(r=>r.priority==="recommended"),i=t.slice(0,4).map((r,a)=>({id:`tool-essential-${a}`,type:"text",position:{x:5,y:28+a*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${r.icon||"🔧"} ${r.name} - ${r.purpose}`,style:{fontSize:16,color:"#374151",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+a*100}})),o=n.slice(0,4).map((r,a)=>({id:`tool-recommended-${a}`,type:"text",position:{x:52,y:28+a*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${r.icon||"📦"} ${r.name} - ${r.purpose}`,style:{fontSize:16,color:"#6b7280",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+a*100}}));return{id:"slide-tools",title:"Tools & Access",layout:"twoColumn",background:{type:"solid",color:"#f0f9ff"},elements:[{id:"tools-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🛠️ Tools & Access",style:{fontSize:44,fontWeight:700,color:"#1e40af"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"tools-essential-header",type:"text",position:{x:5,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"⭐ Essential (Day 1)",style:{fontSize:22,fontWeight:600,color:"#1d4ed8"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"tools-recommended-header",type:"text",position:{x:52,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"📦 Recommended",style:{fontSize:22,fontWeight:600,color:"#3b82f6"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...i,...o,{id:"tools-note",type:"text",position:{x:5,y:85,width:90,height:8,unit:"percent"},content:{type:"text",text:"💡 IT will help set up your accounts. Contact IT Support if you have issues.",style:{fontSize:16,color:"#6b7280",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Review all tools needed for day 1. Ensure access is set up.",durationMs:6e4}}function or(e){const t=e.firstTasks.slice(0,5).flatMap((n,i)=>[{id:`day-header-${i}`,type:"text",position:{x:5+i*19,y:22,width:17,height:8,unit:"percent"},content:{type:"text",text:`Day ${n.day}`,style:{fontSize:20,fontWeight:700,color:"#6d28d9",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200+i*100}},{id:`day-card-${i}`,type:"shape",position:{x:5+i*19,y:32,width:17,height:58,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e9d5ff",strokeWidth:1,cornerRadius:8},animation:{effect:"slideInUp",durationMs:400,delayMs:300+i*100}},...n.tasks.slice(0,4).map((o,r)=>({id:`task-${i}-${r}`,type:"text",position:{x:6+i*19,y:35+r*12,width:15,height:10,unit:"percent"},content:{type:"text",text:`☐ ${o.task}`,style:{fontSize:11,color:"#374151",lineHeight:1.3}}}))]);return{id:"slide-firstweek",title:"First Week",layout:"titleContent",background:{type:"solid",color:"#faf5ff"},elements:[{id:"firstweek-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"📅 Your First Week",style:{fontSize:44,fontWeight:700,color:"#6d28d9"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Walk through first week schedule. Be realistic about expectations.",durationMs:9e4}}function rr(e){const t=[];let n=0;return e.contacts.hr&&(t.push({id:"contact-hr",type:"text",position:{x:5+n*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`👥 HR
106
+ ${n.role}`,style:{fontSize:14,color:"#374151",textAlign:"center",lineHeight:1.6}},animation:{effect:"zoomIn",durationMs:300,delayMs:400+i*80}}});return{id:"slide-team",title:"Meet the Team",layout:"titleContent",background:{type:"solid",color:"#f0fdf4"},elements:[{id:"team-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:`Meet Team ${e.team.name} 👋`,style:{fontSize:44,fontWeight:700,color:"#166534"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"team-desc",type:"text",position:{x:5,y:18,width:90,height:12,unit:"percent"},content:{type:"text",text:e.team.description,style:{fontSize:20,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...e.newHire.manager?[{id:"team-manager",type:"text",position:{x:5,y:32,width:45,height:6,unit:"percent"},content:{type:"text",text:`📋 Manager: ${e.newHire.manager}`,style:{fontSize:18,color:"#059669"}}}]:[],...e.newHire.buddy?[{id:"team-buddy",type:"text",position:{x:50,y:32,width:45,height:6,unit:"percent"},content:{type:"text",text:`🤝 Onboarding Buddy: ${e.newHire.buddy}`,style:{fontSize:18,color:"#059669"}}}]:[],...t],notes:"Introduce team members. Share their roles and how to reach them.",durationMs:9e4}}function or(e){const t=e.tools.filter(r=>r.priority==="essential"),n=e.tools.filter(r=>r.priority==="recommended"),i=t.slice(0,4).map((r,a)=>({id:`tool-essential-${a}`,type:"text",position:{x:5,y:28+a*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${r.icon||"🔧"} ${r.name} - ${r.purpose}`,style:{fontSize:16,color:"#374151",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+a*100}})),o=n.slice(0,4).map((r,a)=>({id:`tool-recommended-${a}`,type:"text",position:{x:52,y:28+a*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${r.icon||"📦"} ${r.name} - ${r.purpose}`,style:{fontSize:16,color:"#6b7280",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+a*100}}));return{id:"slide-tools",title:"Tools & Access",layout:"twoColumn",background:{type:"solid",color:"#f0f9ff"},elements:[{id:"tools-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🛠️ Tools & Access",style:{fontSize:44,fontWeight:700,color:"#1e40af"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"tools-essential-header",type:"text",position:{x:5,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"⭐ Essential (Day 1)",style:{fontSize:22,fontWeight:600,color:"#1d4ed8"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"tools-recommended-header",type:"text",position:{x:52,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"📦 Recommended",style:{fontSize:22,fontWeight:600,color:"#3b82f6"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...i,...o,{id:"tools-note",type:"text",position:{x:5,y:85,width:90,height:8,unit:"percent"},content:{type:"text",text:"💡 IT will help set up your accounts. Contact IT Support if you have issues.",style:{fontSize:16,color:"#6b7280",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Review all tools needed for day 1. Ensure access is set up.",durationMs:6e4}}function rr(e){const t=e.firstTasks.slice(0,5).flatMap((n,i)=>[{id:`day-header-${i}`,type:"text",position:{x:5+i*19,y:22,width:17,height:8,unit:"percent"},content:{type:"text",text:`Day ${n.day}`,style:{fontSize:20,fontWeight:700,color:"#6d28d9",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200+i*100}},{id:`day-card-${i}`,type:"shape",position:{x:5+i*19,y:32,width:17,height:58,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#fff",stroke:"#e9d5ff",strokeWidth:1,cornerRadius:8},animation:{effect:"slideInUp",durationMs:400,delayMs:300+i*100}},...n.tasks.slice(0,4).map((o,r)=>({id:`task-${i}-${r}`,type:"text",position:{x:6+i*19,y:35+r*12,width:15,height:10,unit:"percent"},content:{type:"text",text:`☐ ${o.task}`,style:{fontSize:11,color:"#374151",lineHeight:1.3}}}))]);return{id:"slide-firstweek",title:"First Week",layout:"titleContent",background:{type:"solid",color:"#faf5ff"},elements:[{id:"firstweek-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"📅 Your First Week",style:{fontSize:44,fontWeight:700,color:"#6d28d9"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Walk through first week schedule. Be realistic about expectations.",durationMs:9e4}}function ar(e){const t=[];let n=0;return e.contacts.hr&&(t.push({id:"contact-hr",type:"text",position:{x:5+n*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`👥 HR
107
107
  ${e.contacts.hr.name}
108
108
  ${e.contacts.hr.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:400}}),n++),e.contacts.it&&(t.push({id:"contact-it",type:"text",position:{x:5+n*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`💻 IT Support
109
109
  ${e.contacts.it.name}
110
110
  ${e.contacts.it.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:500}}),n++),e.contacts.facilities&&t.push({id:"contact-facilities",type:"text",position:{x:5+n*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`🏢 Facilities
111
111
  ${e.contacts.facilities.name}
112
- ${e.contacts.facilities.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:600}}),{id:"slide-contacts",title:"Key Contacts",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#7c3aed",position:0},{color:"#8b5cf6",position:100}],gradientDirection:180},elements:[{id:"contacts-title",type:"text",position:{x:5,y:10,width:90,height:12,unit:"percent"},content:{type:"text",text:"📞 Key Contacts",style:{fontSize:44,fontWeight:700,color:"#fff"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"contacts-subtitle",type:"text",position:{x:10,y:25,width:80,height:10,unit:"percent"},content:{type:"text",text:"Your go-to people for help",style:{fontSize:24,color:"#ddd6fe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...t,{id:"contacts-welcome",type:"text",position:{x:15,y:80,width:70,height:12,unit:"percent"},content:{type:"text",text:"We're excited to have you on the team! 🚀",style:{fontSize:28,fontWeight:600,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:600,delayMs:800}}],notes:"Share key contacts. Encourage asking questions.",durationMs:45e3}}function ar(e){return{version:"1.0",id:`onboarding-${e.newHire.name.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.newHire.name} - Welcome to ${e.company.name}`,slideSize:{width:1920,height:1080,unit:"px"},slides:[er(e),tr(e),nr(e),ir(e),or(e),rr(e)],theme:{colors:{primary:"#7c3aed",secondary:"#10b981",background:"#fff",text:"#1f2937",accent:"#f59e0b"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["onboarding","new-hire","welcome"],templateId:"onboarding-v1"}}}function sr(){return{company:{name:"TechCorp",tagline:"Building the future, together",founded:"2015"},newHire:{name:"Alex Johnson",role:"Senior Software Engineer",team:"Platform",startDate:"March 20, 2024",manager:"Sarah Chen",buddy:"Mike Rodriguez"},culture:{mission:"To empower developers worldwide with tools that make their work more productive, enjoyable, and impactful.",values:[{name:"Innovation",description:"We embrace new ideas and technologies to solve problems in creative ways.",icon:"💡"},{name:"Collaboration",description:"Great things happen when we work together. We value every voice.",icon:"🤝"},{name:"Quality",description:"We take pride in our craft and deliver excellence in everything we do.",icon:"⭐"},{name:"Growth",description:"We invest in learning and support each other's professional development.",icon:"🌱"}]},team:{name:"Platform",description:"We build and maintain the core infrastructure that powers all TechCorp products. Our focus is on reliability, scalability, and developer experience.",members:[{name:"Sarah Chen",role:"Engineering Manager"},{name:"Mike Rodriguez",role:"Staff Engineer"},{name:"Emily Park",role:"Senior Engineer"},{name:"James Wilson",role:"Senior Engineer"},{name:"Priya Sharma",role:"Engineer II"},{name:"David Kim",role:"Engineer I"}],channels:[{name:"#platform-team",purpose:"Team discussions"},{name:"#platform-oncall",purpose:"On-call coordination"}]},tools:[{name:"Slack",purpose:"Team communication",icon:"💬",priority:"essential"},{name:"GitHub",purpose:"Code repository",icon:"🐙",priority:"essential"},{name:"Jira",purpose:"Project tracking",icon:"📋",priority:"essential"},{name:"Notion",purpose:"Documentation",icon:"📝",priority:"essential"},{name:"Figma",purpose:"Design collaboration",icon:"🎨",priority:"recommended"},{name:"1Password",purpose:"Password management",icon:"🔐",priority:"recommended"},{name:"Zoom",purpose:"Video meetings",icon:"📹",priority:"recommended"}],processes:[{name:"Daily Standup",description:"15min sync every morning at 9:30am",frequency:"Daily"},{name:"Sprint Planning",description:"Plan upcoming sprint work",frequency:"Bi-weekly"},{name:"Code Review",description:"All PRs require 2 approvals",frequency:"Per PR"},{name:"1:1 with Manager",description:"Regular check-in with your manager",frequency:"Weekly"}],firstTasks:[{day:1,tasks:[{task:"Complete HR paperwork"},{task:"Set up laptop"},{task:"Join Slack channels"},{task:"Meet your buddy"}]},{day:2,tasks:[{task:"Dev environment setup"},{task:"Read team docs"},{task:"Shadow code review"},{task:"Team lunch 🍕"}]},{day:3,tasks:[{task:"First small PR"},{task:"Attend standup"},{task:"Architecture overview"},{task:"1:1 with manager"}]},{day:4,tasks:[{task:"Deep-dive session"},{task:"Continue coding"},{task:"Ask questions!"}]},{day:5,tasks:[{task:"Week 1 retro"},{task:"Set goals for week 2"},{task:"Friday demo"}]}],resources:[{category:"Engineering",items:[{name:"Engineering Handbook",url:"notion.so/engineering",description:"Our engineering practices"},{name:"Architecture Docs",url:"notion.so/architecture",description:"System design docs"}]}],contacts:{hr:{name:"Lisa Thompson",email:"lisa.t@techcorp.com"},it:{name:"IT Help Desk",email:"it-support@techcorp.com"},facilities:{name:"Office Admin",email:"facilities@techcorp.com"}}}}function cr(e){return{P1:"#dc2626",P2:"#f59e0b",P3:"#3b82f6",P4:"#6b7280"}[e]||"#6b7280"}function lr(e){return{P1:"Critical",P2:"High",P3:"Medium",P4:"Low"}[e]||"Unknown"}function dr(e){const t=cr(e.incident.severity);return{id:"slide-title",title:"Incident Report",layout:"titleSlide",background:{type:"solid",color:"#0f172a"},elements:[{id:"title-badge",type:"shape",position:{x:35,y:15,width:30,height:8,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:t,cornerRadius:20},animation:{effect:"zoomIn",durationMs:400,delayMs:0}},{id:"title-severity",type:"text",position:{x:35,y:16.5,width:30,height:5,unit:"percent"},content:{type:"text",text:`${e.incident.severity} - ${lr(e.incident.severity)}`,style:{fontSize:24,fontWeight:700,color:"#fff",textAlign:"center"}}},{id:"title-main",type:"text",position:{x:5,y:28,width:90,height:18,unit:"percent"},content:{type:"text",text:`Incident Report:
113
- ${e.incident.title}`,style:{fontSize:44,fontWeight:700,color:"#f8fafc",textAlign:"center",lineHeight:1.3}},animation:{effect:"fadeIn",durationMs:600,delayMs:200}},{id:"title-id",type:"text",position:{x:35,y:50,width:30,height:5,unit:"percent"},content:{type:"text",text:`ID: ${e.incident.id}`,style:{fontSize:18,color:"#94a3b8",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}},{id:"title-date",type:"text",position:{x:25,y:60,width:50,height:5,unit:"percent"},content:{type:"text",text:`Date: ${e.incident.date} | Duration: ${e.incident.duration}`,style:{fontSize:20,color:"#cbd5e1",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-status",type:"text",position:{x:35,y:70,width:30,height:5,unit:"percent"},content:{type:"text",text:`Status: ${e.incident.status.toUpperCase()}`,style:{fontSize:22,fontWeight:600,color:e.incident.status==="resolved"?"#4ade80":"#fbbf24",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},...e.incident.commander?[{id:"title-commander",type:"text",position:{x:30,y:80,width:40,height:5,unit:"percent"},content:{type:"text",text:`Incident Commander: ${e.incident.commander}`,style:{fontSize:16,color:"#64748b",textAlign:"center"}}}]:[]],notes:"Set the context. State severity and basic facts.",durationMs:3e4}}function ur(e){return{id:"slide-summary",title:"Executive Summary",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"summary-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Executive Summary",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"summary-what-label",type:"text",position:{x:5,y:20,width:90,height:5,unit:"percent"},content:{type:"text",text:"❓ What Happened",style:{fontSize:22,fontWeight:600,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"summary-what",type:"text",position:{x:5,y:27,width:90,height:15,unit:"percent"},content:{type:"text",text:e.summary.whatHappened,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"summary-impact-label",type:"text",position:{x:5,y:45,width:90,height:5,unit:"percent"},content:{type:"text",text:"💥 Impact",style:{fontSize:22,fontWeight:600,color:"#f87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}},{id:"summary-impact",type:"text",position:{x:5,y:52,width:90,height:12,unit:"percent"},content:{type:"text",text:e.summary.impact,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"summary-resolution-label",type:"text",position:{x:5,y:68,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Resolution",style:{fontSize:22,fontWeight:600,color:"#4ade80"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},{id:"summary-resolution",type:"text",position:{x:5,y:75,width:90,height:15,unit:"percent"},content:{type:"text",text:e.summary.resolution,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}}],notes:"High-level summary for executives. Keep it brief and factual.",durationMs:6e4}}function pr(e){const t={detection:"#f59e0b",escalation:"#ef4444",action:"#3b82f6",resolution:"#10b981",communication:"#8b5cf6"},n={detection:"🔍",escalation:"🚨",action:"⚡",resolution:"✅",communication:"📢"},i=e.timeline.slice(0,10).flatMap((o,r)=>{const a=22+r*7.5,s=t[o.type]||"#6b7280",c=n[o.type]||"•";return[{id:`timeline-time-${r}`,type:"text",position:{x:5,y:a,width:12,height:6,unit:"percent"},content:{type:"text",text:o.time,style:{fontSize:14,fontWeight:600,color:"#94a3b8"}},animation:{effect:"fadeIn",durationMs:200,delayMs:300+r*100}},{id:`timeline-dot-${r}`,type:"text",position:{x:18,y:a,width:4,height:6,unit:"percent"},content:{type:"text",text:c,style:{fontSize:16}}},{id:`timeline-event-${r}`,type:"text",position:{x:23,y:a,width:72,height:6,unit:"percent"},content:{type:"text",text:o.event,style:{fontSize:15,color:s}},animation:{effect:"slideInRight",durationMs:300,delayMs:350+r*100}}]});return{id:"slide-timeline",title:"Timeline",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"timeline-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"📅 Incident Timeline",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"timeline-line",type:"shape",position:{x:20,y:22,width:.5,height:70,unit:"percent"},content:{type:"shape",shape:"rect",fill:"#334155"},animation:{effect:"fadeIn",durationMs:300,delayMs:200}},...i,{id:"timeline-legend",type:"text",position:{x:5,y:92,width:90,height:5,unit:"percent"},content:{type:"text",text:"🔍 Detection | 🚨 Escalation | ⚡ Action | ✅ Resolution | 📢 Communication",style:{fontSize:12,color:"#64748b",textAlign:"center"}}}],notes:"Walk through the timeline. Identify key decision points.",durationMs:12e4}}function fr(e){const t=[];let n=0;e.impact.usersAffected&&(t.push({id:"impact-users",type:"text",position:{x:5+n*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`👥
112
+ ${e.contacts.facilities.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:600}}),{id:"slide-contacts",title:"Key Contacts",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#7c3aed",position:0},{color:"#8b5cf6",position:100}],gradientDirection:180},elements:[{id:"contacts-title",type:"text",position:{x:5,y:10,width:90,height:12,unit:"percent"},content:{type:"text",text:"📞 Key Contacts",style:{fontSize:44,fontWeight:700,color:"#fff"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"contacts-subtitle",type:"text",position:{x:10,y:25,width:80,height:10,unit:"percent"},content:{type:"text",text:"Your go-to people for help",style:{fontSize:24,color:"#ddd6fe",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...t,{id:"contacts-welcome",type:"text",position:{x:15,y:80,width:70,height:12,unit:"percent"},content:{type:"text",text:"We're excited to have you on the team! 🚀",style:{fontSize:28,fontWeight:600,color:"#fff",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:600,delayMs:800}}],notes:"Share key contacts. Encourage asking questions.",durationMs:45e3}}function sr(e){return{version:"1.0",id:`onboarding-${e.newHire.name.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.newHire.name} - Welcome to ${e.company.name}`,slideSize:{width:1920,height:1080,unit:"px"},slides:[tr(e),nr(e),ir(e),or(e),rr(e),ar(e)],theme:{colors:{primary:"#7c3aed",secondary:"#10b981",background:"#fff",text:"#1f2937",accent:"#f59e0b"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["onboarding","new-hire","welcome"],templateId:"onboarding-v1"}}}function cr(){return{company:{name:"TechCorp",tagline:"Building the future, together",founded:"2015"},newHire:{name:"Alex Johnson",role:"Senior Software Engineer",team:"Platform",startDate:"March 20, 2024",manager:"Sarah Chen",buddy:"Mike Rodriguez"},culture:{mission:"To empower developers worldwide with tools that make their work more productive, enjoyable, and impactful.",values:[{name:"Innovation",description:"We embrace new ideas and technologies to solve problems in creative ways.",icon:"💡"},{name:"Collaboration",description:"Great things happen when we work together. We value every voice.",icon:"🤝"},{name:"Quality",description:"We take pride in our craft and deliver excellence in everything we do.",icon:"⭐"},{name:"Growth",description:"We invest in learning and support each other's professional development.",icon:"🌱"}]},team:{name:"Platform",description:"We build and maintain the core infrastructure that powers all TechCorp products. Our focus is on reliability, scalability, and developer experience.",members:[{name:"Sarah Chen",role:"Engineering Manager"},{name:"Mike Rodriguez",role:"Staff Engineer"},{name:"Emily Park",role:"Senior Engineer"},{name:"James Wilson",role:"Senior Engineer"},{name:"Priya Sharma",role:"Engineer II"},{name:"David Kim",role:"Engineer I"}],channels:[{name:"#platform-team",purpose:"Team discussions"},{name:"#platform-oncall",purpose:"On-call coordination"}]},tools:[{name:"Slack",purpose:"Team communication",icon:"💬",priority:"essential"},{name:"GitHub",purpose:"Code repository",icon:"🐙",priority:"essential"},{name:"Jira",purpose:"Project tracking",icon:"📋",priority:"essential"},{name:"Notion",purpose:"Documentation",icon:"📝",priority:"essential"},{name:"Figma",purpose:"Design collaboration",icon:"🎨",priority:"recommended"},{name:"1Password",purpose:"Password management",icon:"🔐",priority:"recommended"},{name:"Zoom",purpose:"Video meetings",icon:"📹",priority:"recommended"}],processes:[{name:"Daily Standup",description:"15min sync every morning at 9:30am",frequency:"Daily"},{name:"Sprint Planning",description:"Plan upcoming sprint work",frequency:"Bi-weekly"},{name:"Code Review",description:"All PRs require 2 approvals",frequency:"Per PR"},{name:"1:1 with Manager",description:"Regular check-in with your manager",frequency:"Weekly"}],firstTasks:[{day:1,tasks:[{task:"Complete HR paperwork"},{task:"Set up laptop"},{task:"Join Slack channels"},{task:"Meet your buddy"}]},{day:2,tasks:[{task:"Dev environment setup"},{task:"Read team docs"},{task:"Shadow code review"},{task:"Team lunch 🍕"}]},{day:3,tasks:[{task:"First small PR"},{task:"Attend standup"},{task:"Architecture overview"},{task:"1:1 with manager"}]},{day:4,tasks:[{task:"Deep-dive session"},{task:"Continue coding"},{task:"Ask questions!"}]},{day:5,tasks:[{task:"Week 1 retro"},{task:"Set goals for week 2"},{task:"Friday demo"}]}],resources:[{category:"Engineering",items:[{name:"Engineering Handbook",url:"notion.so/engineering",description:"Our engineering practices"},{name:"Architecture Docs",url:"notion.so/architecture",description:"System design docs"}]}],contacts:{hr:{name:"Lisa Thompson",email:"lisa.t@techcorp.com"},it:{name:"IT Help Desk",email:"it-support@techcorp.com"},facilities:{name:"Office Admin",email:"facilities@techcorp.com"}}}}function lr(e){return{P1:"#dc2626",P2:"#f59e0b",P3:"#3b82f6",P4:"#6b7280"}[e]||"#6b7280"}function dr(e){return{P1:"Critical",P2:"High",P3:"Medium",P4:"Low"}[e]||"Unknown"}function ur(e){const t=lr(e.incident.severity);return{id:"slide-title",title:"Incident Report",layout:"titleSlide",background:{type:"solid",color:"#0f172a"},elements:[{id:"title-badge",type:"shape",position:{x:35,y:15,width:30,height:8,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:t,cornerRadius:20},animation:{effect:"zoomIn",durationMs:400,delayMs:0}},{id:"title-severity",type:"text",position:{x:35,y:16.5,width:30,height:5,unit:"percent"},content:{type:"text",text:`${e.incident.severity} - ${dr(e.incident.severity)}`,style:{fontSize:24,fontWeight:700,color:"#fff",textAlign:"center"}}},{id:"title-main",type:"text",position:{x:5,y:28,width:90,height:18,unit:"percent"},content:{type:"text",text:`Incident Report:
113
+ ${e.incident.title}`,style:{fontSize:44,fontWeight:700,color:"#f8fafc",textAlign:"center",lineHeight:1.3}},animation:{effect:"fadeIn",durationMs:600,delayMs:200}},{id:"title-id",type:"text",position:{x:35,y:50,width:30,height:5,unit:"percent"},content:{type:"text",text:`ID: ${e.incident.id}`,style:{fontSize:18,color:"#94a3b8",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}},{id:"title-date",type:"text",position:{x:25,y:60,width:50,height:5,unit:"percent"},content:{type:"text",text:`Date: ${e.incident.date} | Duration: ${e.incident.duration}`,style:{fontSize:20,color:"#cbd5e1",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-status",type:"text",position:{x:35,y:70,width:30,height:5,unit:"percent"},content:{type:"text",text:`Status: ${e.incident.status.toUpperCase()}`,style:{fontSize:22,fontWeight:600,color:e.incident.status==="resolved"?"#4ade80":"#fbbf24",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},...e.incident.commander?[{id:"title-commander",type:"text",position:{x:30,y:80,width:40,height:5,unit:"percent"},content:{type:"text",text:`Incident Commander: ${e.incident.commander}`,style:{fontSize:16,color:"#64748b",textAlign:"center"}}}]:[]],notes:"Set the context. State severity and basic facts.",durationMs:3e4}}function pr(e){return{id:"slide-summary",title:"Executive Summary",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"summary-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Executive Summary",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"summary-what-label",type:"text",position:{x:5,y:20,width:90,height:5,unit:"percent"},content:{type:"text",text:"❓ What Happened",style:{fontSize:22,fontWeight:600,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"summary-what",type:"text",position:{x:5,y:27,width:90,height:15,unit:"percent"},content:{type:"text",text:e.summary.whatHappened,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"summary-impact-label",type:"text",position:{x:5,y:45,width:90,height:5,unit:"percent"},content:{type:"text",text:"💥 Impact",style:{fontSize:22,fontWeight:600,color:"#f87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}},{id:"summary-impact",type:"text",position:{x:5,y:52,width:90,height:12,unit:"percent"},content:{type:"text",text:e.summary.impact,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"summary-resolution-label",type:"text",position:{x:5,y:68,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Resolution",style:{fontSize:22,fontWeight:600,color:"#4ade80"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},{id:"summary-resolution",type:"text",position:{x:5,y:75,width:90,height:15,unit:"percent"},content:{type:"text",text:e.summary.resolution,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}}],notes:"High-level summary for executives. Keep it brief and factual.",durationMs:6e4}}function fr(e){const t={detection:"#f59e0b",escalation:"#ef4444",action:"#3b82f6",resolution:"#10b981",communication:"#8b5cf6"},n={detection:"🔍",escalation:"🚨",action:"⚡",resolution:"✅",communication:"📢"},i=e.timeline.slice(0,10).flatMap((o,r)=>{const a=22+r*7.5,s=t[o.type]||"#6b7280",c=n[o.type]||"•";return[{id:`timeline-time-${r}`,type:"text",position:{x:5,y:a,width:12,height:6,unit:"percent"},content:{type:"text",text:o.time,style:{fontSize:14,fontWeight:600,color:"#94a3b8"}},animation:{effect:"fadeIn",durationMs:200,delayMs:300+r*100}},{id:`timeline-dot-${r}`,type:"text",position:{x:18,y:a,width:4,height:6,unit:"percent"},content:{type:"text",text:c,style:{fontSize:16}}},{id:`timeline-event-${r}`,type:"text",position:{x:23,y:a,width:72,height:6,unit:"percent"},content:{type:"text",text:o.event,style:{fontSize:15,color:s}},animation:{effect:"slideInRight",durationMs:300,delayMs:350+r*100}}]});return{id:"slide-timeline",title:"Timeline",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"timeline-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"📅 Incident Timeline",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"timeline-line",type:"shape",position:{x:20,y:22,width:.5,height:70,unit:"percent"},content:{type:"shape",shape:"rect",fill:"#334155"},animation:{effect:"fadeIn",durationMs:300,delayMs:200}},...i,{id:"timeline-legend",type:"text",position:{x:5,y:92,width:90,height:5,unit:"percent"},content:{type:"text",text:"🔍 Detection | 🚨 Escalation | ⚡ Action | ✅ Resolution | 📢 Communication",style:{fontSize:12,color:"#64748b",textAlign:"center"}}}],notes:"Walk through the timeline. Identify key decision points.",durationMs:12e4}}function mr(e){const t=[];let n=0;e.impact.usersAffected&&(t.push({id:"impact-users",type:"text",position:{x:5+n*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`👥
114
114
  ${e.impact.usersAffected}
115
115
  Users Affected`,style:{fontSize:18,color:"#f87171",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+n*100}}),n++),e.impact.revenueImpact&&(t.push({id:"impact-revenue",type:"text",position:{x:5+n*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`💰
116
116
  ${e.impact.revenueImpact}
117
117
  Revenue Impact`,style:{fontSize:18,color:"#fbbf24",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+n*100}}),n++),e.impact.slaViolation!==void 0&&(t.push({id:"impact-sla",type:"text",position:{x:5+n*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`📋
118
118
  ${e.impact.slaViolation?"Yes":"No"}
119
- SLA Violation`,style:{fontSize:18,color:e.impact.slaViolation?"#f87171":"#4ade80",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+n*100}}),n++);const i=e.impact.affectedServices.slice(0,6).map((o,r)=>({id:`impact-svc-${r}`,type:"text",position:{x:5+r%3*32,y:55+Math.floor(r/3)*10,width:30,height:8,unit:"percent"},content:{type:"text",text:`⚠️ ${o}`,style:{fontSize:16,color:"#f87171"}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+r*80}}));return{id:"slide-impact",title:"Impact Assessment",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"impact-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"💥 Impact Assessment",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t,{id:"impact-services-label",type:"text",position:{x:5,y:48,width:90,height:6,unit:"percent"},content:{type:"text",text:"Affected Services",style:{fontSize:22,fontWeight:600,color:"#94a3b8"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...i,...e.impact.dataLoss?[{id:"impact-dataloss",type:"text",position:{x:5,y:80,width:90,height:10,unit:"percent"},content:{type:"text",text:`📊 Data Loss: ${e.impact.dataLoss}`,style:{fontSize:18,color:"#f87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:900}}]:[]],notes:"Quantify the impact. Be specific about affected users and services.",durationMs:6e4}}function mr(e){const t=e.rootCause.contributing.slice(0,4).map((n,i)=>({id:`contributing-${i}`,type:"text",position:{x:5,y:68+i*7,width:90,height:6,unit:"percent"},content:{type:"text",text:`• ${n}`,style:{fontSize:16,color:"#94a3b8",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:800+i*100}}));return{id:"slide-rootcause",title:"Root Cause Analysis",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"rootcause-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔍 Root Cause Analysis",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"rootcause-immediate-label",type:"text",position:{x:5,y:18,width:90,height:5,unit:"percent"},content:{type:"text",text:"⚡ Immediate Cause",style:{fontSize:20,fontWeight:600,color:"#f87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"rootcause-immediate",type:"text",position:{x:5,y:25,width:90,height:12,unit:"percent"},content:{type:"text",text:e.rootCause.immediate,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:350}},{id:"rootcause-underlying-label",type:"text",position:{x:5,y:40,width:90,height:5,unit:"percent"},content:{type:"text",text:"🎯 Underlying Root Cause",style:{fontSize:20,fontWeight:600,color:"#fbbf24"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"rootcause-underlying",type:"text",position:{x:5,y:47,width:90,height:12,unit:"percent"},content:{type:"text",text:e.rootCause.underlying,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:650}},{id:"rootcause-contributing-label",type:"text",position:{x:5,y:62,width:90,height:5,unit:"percent"},content:{type:"text",text:"📋 Contributing Factors",style:{fontSize:20,fontWeight:600,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:750}},...t],notes:"Be blameless. Focus on systems and processes, not individuals.",durationMs:9e4}}function hr(e){const t=e.remediation.immediate.slice(0,4).map((i,o)=>{const r=i.status==="done"?"✅":i.status==="in-progress"?"🔄":"📋",a=i.status==="done"?"#4ade80":i.status==="in-progress"?"#fbbf24":"#94a3b8";return{id:`remediation-immediate-${o}`,type:"text",position:{x:5,y:28+o*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${r} ${i.action}
119
+ SLA Violation`,style:{fontSize:18,color:e.impact.slaViolation?"#f87171":"#4ade80",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+n*100}}),n++);const i=e.impact.affectedServices.slice(0,6).map((o,r)=>({id:`impact-svc-${r}`,type:"text",position:{x:5+r%3*32,y:55+Math.floor(r/3)*10,width:30,height:8,unit:"percent"},content:{type:"text",text:`⚠️ ${o}`,style:{fontSize:16,color:"#f87171"}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+r*80}}));return{id:"slide-impact",title:"Impact Assessment",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"impact-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"💥 Impact Assessment",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t,{id:"impact-services-label",type:"text",position:{x:5,y:48,width:90,height:6,unit:"percent"},content:{type:"text",text:"Affected Services",style:{fontSize:22,fontWeight:600,color:"#94a3b8"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...i,...e.impact.dataLoss?[{id:"impact-dataloss",type:"text",position:{x:5,y:80,width:90,height:10,unit:"percent"},content:{type:"text",text:`📊 Data Loss: ${e.impact.dataLoss}`,style:{fontSize:18,color:"#f87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:900}}]:[]],notes:"Quantify the impact. Be specific about affected users and services.",durationMs:6e4}}function hr(e){const t=e.rootCause.contributing.slice(0,4).map((n,i)=>({id:`contributing-${i}`,type:"text",position:{x:5,y:68+i*7,width:90,height:6,unit:"percent"},content:{type:"text",text:`• ${n}`,style:{fontSize:16,color:"#94a3b8",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:800+i*100}}));return{id:"slide-rootcause",title:"Root Cause Analysis",layout:"titleContent",background:{type:"solid",color:"#0f172a"},elements:[{id:"rootcause-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔍 Root Cause Analysis",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"rootcause-immediate-label",type:"text",position:{x:5,y:18,width:90,height:5,unit:"percent"},content:{type:"text",text:"⚡ Immediate Cause",style:{fontSize:20,fontWeight:600,color:"#f87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"rootcause-immediate",type:"text",position:{x:5,y:25,width:90,height:12,unit:"percent"},content:{type:"text",text:e.rootCause.immediate,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:350}},{id:"rootcause-underlying-label",type:"text",position:{x:5,y:40,width:90,height:5,unit:"percent"},content:{type:"text",text:"🎯 Underlying Root Cause",style:{fontSize:20,fontWeight:600,color:"#fbbf24"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"rootcause-underlying",type:"text",position:{x:5,y:47,width:90,height:12,unit:"percent"},content:{type:"text",text:e.rootCause.underlying,style:{fontSize:18,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:650}},{id:"rootcause-contributing-label",type:"text",position:{x:5,y:62,width:90,height:5,unit:"percent"},content:{type:"text",text:"📋 Contributing Factors",style:{fontSize:20,fontWeight:600,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:750}},...t],notes:"Be blameless. Focus on systems and processes, not individuals.",durationMs:9e4}}function yr(e){const t=e.remediation.immediate.slice(0,4).map((i,o)=>{const r=i.status==="done"?"✅":i.status==="in-progress"?"🔄":"📋",a=i.status==="done"?"#4ade80":i.status==="in-progress"?"#fbbf24":"#94a3b8";return{id:`remediation-immediate-${o}`,type:"text",position:{x:5,y:28+o*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${r} ${i.action}
120
120
  Owner: ${i.owner}`,style:{fontSize:14,color:a,lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+o*100}}}),n=e.remediation.longTerm.slice(0,4).map((i,o)=>{const r=i.priority==="high"?"🔴":i.priority==="medium"?"🟡":"🟢";return{id:`remediation-longterm-${o}`,type:"text",position:{x:52,y:28+o*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${r} ${i.action}
121
- Owner: ${i.owner}`,style:{fontSize:14,color:"#cbd5e1",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+o*100}}});return{id:"slide-remediation",title:"Remediation",layout:"twoColumn",background:{type:"solid",color:"#0f172a"},elements:[{id:"remediation-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔧 Remediation Actions",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"remediation-immediate-header",type:"text",position:{x:5,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"⚡ Immediate Actions",style:{fontSize:22,fontWeight:600,color:"#f87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"remediation-longterm-header",type:"text",position:{x:52,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"📅 Long-term Actions",style:{fontSize:22,fontWeight:600,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...t,...n,{id:"remediation-legend",type:"text",position:{x:5,y:88,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Done | 🔄 In Progress | 📋 Planned || 🔴 High | 🟡 Medium | 🟢 Low",style:{fontSize:12,color:"#64748b",textAlign:"center"}}}],notes:"Track action items. Ensure clear ownership and deadlines.",durationMs:6e4}}function yr(e){const t=e.lessons.slice(0,6).map((n,i)=>({id:`lesson-${i}`,type:"text",position:{x:5,y:25+i*12,width:90,height:10,unit:"percent"},content:{type:"text",text:`${i+1}. ${n}`,style:{fontSize:20,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"slideInRight",durationMs:400,delayMs:300+i*150}}));return{id:"slide-lessons",title:"Lessons Learned",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#0f172a",position:0},{color:"#1E3A8A",position:100}],gradientDirection:180},elements:[{id:"lessons-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"💡 Lessons Learned",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Key takeaways. Focus on actionable improvements.",durationMs:9e4}}function gr(e){return{version:"1.0",id:`incident-${e.incident.id}`,title:`Incident Report - ${e.incident.id}: ${e.incident.title}`,slideSize:{width:1920,height:1080,unit:"px"},slides:[dr(e),ur(e),pr(e),fr(e),mr(e),hr(e),yr(e)],theme:{colors:{primary:"#3b82f6",secondary:"#f87171",background:"#0f172a",text:"#f8fafc",accent:"#4ade80"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["incident","postmortem","PIR"],templateId:"incident-report-v1"}}}function xr(){return{incident:{id:"INC-2024-0342",title:"Payment Service Outage",severity:"P1",status:"resolved",date:"March 15, 2024",duration:"2h 34m",commander:"Emily Chen"},summary:{whatHappened:"The payment processing service became unresponsive due to a database connection pool exhaustion, preventing customers from completing purchases.",impact:"Approximately 15,000 users were unable to complete transactions, resulting in an estimated revenue loss of $127,000.",resolution:"Database connection pool limits were increased, and a connection leak in the payment service was identified and fixed."},timeline:[{time:"14:23",event:"Automated alert: Payment service error rate >5%",type:"detection"},{time:"14:25",event:"On-call engineer acknowledges alert",type:"action"},{time:"14:32",event:"Incident declared, Emily Chen as IC",type:"escalation"},{time:"14:35",event:"Status page updated",type:"communication"},{time:"14:45",event:"Database team joined",type:"escalation"},{time:"15:12",event:"Root cause identified: connection pool exhaustion",type:"action"},{time:"15:28",event:"Emergency fix deployed",type:"action"},{time:"16:15",event:"Service fully recovered",type:"resolution"},{time:"16:57",event:"Incident marked resolved",type:"resolution"}],impact:{usersAffected:"~15,000",revenueImpact:"$127,000",slaViolation:!0,affectedServices:["Payment Gateway","Checkout Flow","Order Service","Mobile App"],regions:["North America","Europe"]},rootCause:{immediate:"Database connection pool was exhausted due to connections not being properly released after use.",underlying:"A recent code change introduced a connection leak in the retry logic of the payment service.",contributing:["Insufficient connection pool monitoring alerts","Code review did not catch the connection leak","No automated testing for connection handling","Documentation for database client usage was outdated"]},response:{detectionTime:"2 minutes",responseTime:"9 minutes",resolutionTime:"2h 34m",whatWorked:["Automated alerting triggered quickly","Clear incident commander assignment","Good cross-team communication"],whatDidntWork:["Initial diagnosis took too long","Runbooks were outdated","No quick rollback option available"]},remediation:{immediate:[{action:"Increase connection pool size",owner:"Platform Team",status:"done"},{action:"Fix connection leak in payment service",owner:"Payments Team",status:"done"},{action:"Add connection pool metrics to dashboard",owner:"SRE Team",status:"in-progress"}],longTerm:[{action:"Implement automated connection leak detection",owner:"Platform Team",priority:"high",dueDate:"Q2 2024"},{action:"Update code review checklist",owner:"Engineering Leads",priority:"medium",dueDate:"April 2024"},{action:"Improve runbooks for database issues",owner:"SRE Team",priority:"medium",dueDate:"April 2024"},{action:"Add integration tests for connection handling",owner:"Payments Team",priority:"high",dueDate:"Q2 2024"}]},lessons:["Connection pool monitoring should be a standard metric for all services","Code changes affecting database connections need explicit review","Having a quick rollback plan is critical for payment systems","Runbooks must be tested and updated regularly","Cross-team communication during incidents was effective and should be maintained"],team:[{name:"Emily Chen",role:"Incident Commander"},{name:"Marcus Johnson",role:"On-call Engineer"},{name:"Priya Patel",role:"Database Expert"},{name:"Alex Kim",role:"Payments Team Lead"}]}}function yt(e){return{name:e.name,primaryColor:e.colors.primary,secondaryColor:e.colors.secondary,accentColor:e.colors.accent,backgroundColor:e.colors.background,textColor:e.colors.text,headingColor:e.colors.heading,fontFamily:e.fonts.body,headingFontFamily:e.fonts.heading,codeFontFamily:e.fonts.code??"monospace",colors:e.colors.palette}}function br(e,t){const n=yt(t),i=e.slides.map(o=>{let r=[...o.elements];if(t.logo&&!r.some(s=>s.id===`brand-logo-${t.id}`)){const s=Sr(t.logo);r=[...r,{id:`brand-logo-${t.id}`,type:"image",position:s,content:{type:"image",src:t.logo.url,alt:`${t.name} logo`,objectFit:"contain"},opacity:.9}]}return{...o,elements:r}});return{...e,theme:n,slides:i,metadata:{...e.metadata,updatedAt:new Date().toISOString()}}}function vr(e,t){const n=e.slides.map(i=>({...i,elements:i.elements.filter(o=>o.id!==`brand-logo-${t}`)}));return{...e,slides:n,metadata:{...e.metadata,updatedAt:new Date().toISOString()}}}function Sr(e){const t=e.width??8,n=e.height??5,i=e.position??"bottom-right",o={"top-left":{x:2,y:2},"top-right":{x:90,y:2},"bottom-left":{x:2,y:93},"bottom-right":{x:90,y:93}},{x:r,y:a}=o[i];return{x:r,y:a,width:t,height:n,unit:"percent"}}const wr={id:"nice2dev",name:"NiceToDev",colors:{primary:"#6366f1",secondary:"#8b5cf6",accent:"#06b6d4",background:"#0f172a",text:"#e2e8f0",heading:"#fff",palette:["#6366f1","#8b5cf6","#06b6d4","#10b981","#f59e0b"]},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"}},kr={id:"corporate",name:"Corporate Blue",colors:{primary:"#1a365d",secondary:"#2b6cb0",accent:"#ed8936",background:"#fff",text:"#2d3748",heading:"#1a365d",palette:["#1a365d","#2b6cb0","#4299E1","#ed8936","#48BB78"]},fonts:{heading:"Georgia, serif",body:"Arial, sans-serif",code:"Consolas, monospace"}},Ir={id:"startup",name:"Startup Fresh",colors:{primary:"#7c3aed",secondary:"#ec4899",accent:"#34d399",background:"#fafafa",text:"#374151",heading:"#111827",palette:["#7c3aed","#ec4899","#34d399","#f59e0b","#3b82f6"]},fonts:{heading:"Poppins, sans-serif",body:"Open Sans, sans-serif",code:"Fira Code, monospace"}};class gt{constructor(t,n={}){this.currentAnimation=null,this.frameIndex=0,this.elapsed=0,this.playing=!1,this.loop=!0,this.speed=1,this.onComplete=null,this.onEvent=null,this.character=t,this.onComplete=n.onAnimationComplete||null,this.onEvent=n.onFrameEvent||null}getCharacter(){return this.character}getCurrentAnimation(){return this.currentAnimation}getCurrentFrameIndex(){return this.frameIndex}isPlaying(){return this.playing}play(t,n={}){const i=this.character.animations.find(o=>o.id===t);if(!i){console.warn(`Animation "${t}" not found on character "${this.character.id}"`);return}this.currentAnimation=i,this.frameIndex=n.startFrame??0,this.elapsed=0,this.playing=!0,this.loop=n.loop??i.loop,this.speed=n.speed??1,this.checkFrameEvent()}stop(){this.playing=!1}pause(){this.playing=!1}resume(){this.currentAnimation&&(this.playing=!0)}setSpeed(t){this.speed=t}update(t){if(!this.playing||!this.currentAnimation)return;const n=this.currentAnimation,i=n.frames[this.frameIndex];if(!i)return;const o=1e3/n.fps,r=i.duration??o;for(this.elapsed+=t*this.speed;this.elapsed>=r&&this.playing;){if(this.elapsed-=r,this.frameIndex++,this.frameIndex>=n.frames.length)if(this.loop)this.frameIndex=0;else{this.frameIndex=n.frames.length-1,this.playing=!1,this.onComplete&&this.onComplete(n.id);return}this.checkFrameEvent()}}checkFrameEvent(){if(!this.currentAnimation||!this.onEvent)return;const t=this.currentAnimation.frames[this.frameIndex];t!=null&&t.event&&this.onEvent(this.currentAnimation.id,t.event)}getCurrentFrame(){return this.currentAnimation?this.currentAnimation.frames[this.frameIndex]??null:null}getSpriteRect(){const t=this.getCurrentFrame();if(!t||!this.character.visual.atlas)return null;const i=this.character.visual.atlas.frames[t.frameId];return i?i.frame:null}}function Cr(e,t,n,i,o){if(!o.visible||o.opacity===0||!i.getCurrentFrame())return;const a=i.getSpriteRect();if(!a)return;const{position:s,scale:c,rotation:u,opacity:f,flipX:h}=o,{anchor:y}=t;e.save(),e.translate(s.x,s.y),e.scale(h?-c:c,c),e.rotate(u*Math.PI/180),e.globalAlpha=f;const p=-y.x*a.w,m=-y.y*a.h;e.drawImage(n,a.x,a.y,a.w,a.h,p,m,a.w,a.h),e.restore()}function Mr({character:e,state:t,spriteSheet:n,className:i,style:o}){const[r,a]=d.useState(null);if(d.useEffect(()=>{if(!e.visual.atlas)return;const g=e.animations.find(x=>x.id===t.currentAnimation);if(!g)return;const b=g.frames[t.animationFrame];if(!b)return;const S=e.visual.atlas.frames[b.frameId];a(S||null)},[e,t.currentAnimation,t.animationFrame]),!t.visible||!r)return null;const{position:s,scale:c,rotation:u,opacity:f,flipX:h}=t,{frame:y}=r,p={position:"absolute",left:s.x,top:s.y,transform:`
121
+ Owner: ${i.owner}`,style:{fontSize:14,color:"#cbd5e1",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+o*100}}});return{id:"slide-remediation",title:"Remediation",layout:"twoColumn",background:{type:"solid",color:"#0f172a"},elements:[{id:"remediation-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔧 Remediation Actions",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"remediation-immediate-header",type:"text",position:{x:5,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"⚡ Immediate Actions",style:{fontSize:22,fontWeight:600,color:"#f87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"remediation-longterm-header",type:"text",position:{x:52,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"📅 Long-term Actions",style:{fontSize:22,fontWeight:600,color:"#60a5fa"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...t,...n,{id:"remediation-legend",type:"text",position:{x:5,y:88,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Done | 🔄 In Progress | 📋 Planned || 🔴 High | 🟡 Medium | 🟢 Low",style:{fontSize:12,color:"#64748b",textAlign:"center"}}}],notes:"Track action items. Ensure clear ownership and deadlines.",durationMs:6e4}}function gr(e){const t=e.lessons.slice(0,6).map((n,i)=>({id:`lesson-${i}`,type:"text",position:{x:5,y:25+i*12,width:90,height:10,unit:"percent"},content:{type:"text",text:`${i+1}. ${n}`,style:{fontSize:20,color:"#cbd5e1",lineHeight:1.5}},animation:{effect:"slideInRight",durationMs:400,delayMs:300+i*150}}));return{id:"slide-lessons",title:"Lessons Learned",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#0f172a",position:0},{color:"#1E3A8A",position:100}],gradientDirection:180},elements:[{id:"lessons-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"💡 Lessons Learned",style:{fontSize:44,fontWeight:700,color:"#f8fafc"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Key takeaways. Focus on actionable improvements.",durationMs:9e4}}function xr(e){return{version:"1.0",id:`incident-${e.incident.id}`,title:`Incident Report - ${e.incident.id}: ${e.incident.title}`,slideSize:{width:1920,height:1080,unit:"px"},slides:[ur(e),pr(e),fr(e),mr(e),hr(e),yr(e),gr(e)],theme:{colors:{primary:"#3b82f6",secondary:"#f87171",background:"#0f172a",text:"#f8fafc",accent:"#4ade80"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["incident","postmortem","PIR"],templateId:"incident-report-v1"}}}function br(){return{incident:{id:"INC-2024-0342",title:"Payment Service Outage",severity:"P1",status:"resolved",date:"March 15, 2024",duration:"2h 34m",commander:"Emily Chen"},summary:{whatHappened:"The payment processing service became unresponsive due to a database connection pool exhaustion, preventing customers from completing purchases.",impact:"Approximately 15,000 users were unable to complete transactions, resulting in an estimated revenue loss of $127,000.",resolution:"Database connection pool limits were increased, and a connection leak in the payment service was identified and fixed."},timeline:[{time:"14:23",event:"Automated alert: Payment service error rate >5%",type:"detection"},{time:"14:25",event:"On-call engineer acknowledges alert",type:"action"},{time:"14:32",event:"Incident declared, Emily Chen as IC",type:"escalation"},{time:"14:35",event:"Status page updated",type:"communication"},{time:"14:45",event:"Database team joined",type:"escalation"},{time:"15:12",event:"Root cause identified: connection pool exhaustion",type:"action"},{time:"15:28",event:"Emergency fix deployed",type:"action"},{time:"16:15",event:"Service fully recovered",type:"resolution"},{time:"16:57",event:"Incident marked resolved",type:"resolution"}],impact:{usersAffected:"~15,000",revenueImpact:"$127,000",slaViolation:!0,affectedServices:["Payment Gateway","Checkout Flow","Order Service","Mobile App"],regions:["North America","Europe"]},rootCause:{immediate:"Database connection pool was exhausted due to connections not being properly released after use.",underlying:"A recent code change introduced a connection leak in the retry logic of the payment service.",contributing:["Insufficient connection pool monitoring alerts","Code review did not catch the connection leak","No automated testing for connection handling","Documentation for database client usage was outdated"]},response:{detectionTime:"2 minutes",responseTime:"9 minutes",resolutionTime:"2h 34m",whatWorked:["Automated alerting triggered quickly","Clear incident commander assignment","Good cross-team communication"],whatDidntWork:["Initial diagnosis took too long","Runbooks were outdated","No quick rollback option available"]},remediation:{immediate:[{action:"Increase connection pool size",owner:"Platform Team",status:"done"},{action:"Fix connection leak in payment service",owner:"Payments Team",status:"done"},{action:"Add connection pool metrics to dashboard",owner:"SRE Team",status:"in-progress"}],longTerm:[{action:"Implement automated connection leak detection",owner:"Platform Team",priority:"high",dueDate:"Q2 2024"},{action:"Update code review checklist",owner:"Engineering Leads",priority:"medium",dueDate:"April 2024"},{action:"Improve runbooks for database issues",owner:"SRE Team",priority:"medium",dueDate:"April 2024"},{action:"Add integration tests for connection handling",owner:"Payments Team",priority:"high",dueDate:"Q2 2024"}]},lessons:["Connection pool monitoring should be a standard metric for all services","Code changes affecting database connections need explicit review","Having a quick rollback plan is critical for payment systems","Runbooks must be tested and updated regularly","Cross-team communication during incidents was effective and should be maintained"],team:[{name:"Emily Chen",role:"Incident Commander"},{name:"Marcus Johnson",role:"On-call Engineer"},{name:"Priya Patel",role:"Database Expert"},{name:"Alex Kim",role:"Payments Team Lead"}]}}function gt(e){return{name:e.name,primaryColor:e.colors.primary,secondaryColor:e.colors.secondary,accentColor:e.colors.accent,backgroundColor:e.colors.background,textColor:e.colors.text,headingColor:e.colors.heading,fontFamily:e.fonts.body,headingFontFamily:e.fonts.heading,codeFontFamily:e.fonts.code??"monospace",colors:e.colors.palette}}function vr(e,t){const n=gt(t),i=e.slides.map(o=>{let r=[...o.elements];if(t.logo&&!r.some(s=>s.id===`brand-logo-${t.id}`)){const s=wr(t.logo);r=[...r,{id:`brand-logo-${t.id}`,type:"image",position:s,content:{type:"image",src:t.logo.url,alt:`${t.name} logo`,objectFit:"contain"},opacity:.9}]}return{...o,elements:r}});return{...e,theme:n,slides:i,metadata:{...e.metadata,updatedAt:new Date().toISOString()}}}function Sr(e,t){const n=e.slides.map(i=>({...i,elements:i.elements.filter(o=>o.id!==`brand-logo-${t}`)}));return{...e,slides:n,metadata:{...e.metadata,updatedAt:new Date().toISOString()}}}function wr(e){const t=e.width??8,n=e.height??5,i=e.position??"bottom-right",o={"top-left":{x:2,y:2},"top-right":{x:90,y:2},"bottom-left":{x:2,y:93},"bottom-right":{x:90,y:93}},{x:r,y:a}=o[i];return{x:r,y:a,width:t,height:n,unit:"percent"}}const kr={id:"nice2dev",name:"NiceToDev",colors:{primary:"#6366f1",secondary:"#8b5cf6",accent:"#06b6d4",background:"#0f172a",text:"#e2e8f0",heading:"#fff",palette:["#6366f1","#8b5cf6","#06b6d4","#10b981","#f59e0b"]},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"}},Ir={id:"corporate",name:"Corporate Blue",colors:{primary:"#1a365d",secondary:"#2b6cb0",accent:"#ed8936",background:"#fff",text:"#2d3748",heading:"#1a365d",palette:["#1a365d","#2b6cb0","#4299E1","#ed8936","#48BB78"]},fonts:{heading:"Georgia, serif",body:"Arial, sans-serif",code:"Consolas, monospace"}},Cr={id:"startup",name:"Startup Fresh",colors:{primary:"#7c3aed",secondary:"#ec4899",accent:"#34d399",background:"#fafafa",text:"#374151",heading:"#111827",palette:["#7c3aed","#ec4899","#34d399","#f59e0b","#3b82f6"]},fonts:{heading:"Poppins, sans-serif",body:"Open Sans, sans-serif",code:"Fira Code, monospace"}};class xt{constructor(t,n={}){this.currentAnimation=null,this.frameIndex=0,this.elapsed=0,this.playing=!1,this.loop=!0,this.speed=1,this.onComplete=null,this.onEvent=null,this.character=t,this.onComplete=n.onAnimationComplete||null,this.onEvent=n.onFrameEvent||null}getCharacter(){return this.character}getCurrentAnimation(){return this.currentAnimation}getCurrentFrameIndex(){return this.frameIndex}isPlaying(){return this.playing}play(t,n={}){const i=this.character.animations.find(o=>o.id===t);if(!i){console.warn(`Animation "${t}" not found on character "${this.character.id}"`);return}this.currentAnimation=i,this.frameIndex=n.startFrame??0,this.elapsed=0,this.playing=!0,this.loop=n.loop??i.loop,this.speed=n.speed??1,this.checkFrameEvent()}stop(){this.playing=!1}pause(){this.playing=!1}resume(){this.currentAnimation&&(this.playing=!0)}setSpeed(t){this.speed=t}update(t){if(!this.playing||!this.currentAnimation)return;const n=this.currentAnimation,i=n.frames[this.frameIndex];if(!i)return;const o=1e3/n.fps,r=i.duration??o;for(this.elapsed+=t*this.speed;this.elapsed>=r&&this.playing;){if(this.elapsed-=r,this.frameIndex++,this.frameIndex>=n.frames.length)if(this.loop)this.frameIndex=0;else{this.frameIndex=n.frames.length-1,this.playing=!1,this.onComplete&&this.onComplete(n.id);return}this.checkFrameEvent()}}checkFrameEvent(){if(!this.currentAnimation||!this.onEvent)return;const t=this.currentAnimation.frames[this.frameIndex];t!=null&&t.event&&this.onEvent(this.currentAnimation.id,t.event)}getCurrentFrame(){return this.currentAnimation?this.currentAnimation.frames[this.frameIndex]??null:null}getSpriteRect(){const t=this.getCurrentFrame();if(!t||!this.character.visual.atlas)return null;const i=this.character.visual.atlas.frames[t.frameId];return i?i.frame:null}}function Mr(e,t,n,i,o){if(!o.visible||o.opacity===0||!i.getCurrentFrame())return;const a=i.getSpriteRect();if(!a)return;const{position:s,scale:c,rotation:u,opacity:f,flipX:h}=o,{anchor:y}=t;e.save(),e.translate(s.x,s.y),e.scale(h?-c:c,c),e.rotate(u*Math.PI/180),e.globalAlpha=f;const p=-y.x*a.w,m=-y.y*a.h;e.drawImage(n,a.x,a.y,a.w,a.h,p,m,a.w,a.h),e.restore()}function zr({character:e,state:t,spriteSheet:n,className:i,style:o}){const[r,a]=d.useState(null);if(d.useEffect(()=>{if(!e.visual.atlas)return;const g=e.animations.find(x=>x.id===t.currentAnimation);if(!g)return;const b=g.frames[t.animationFrame];if(!b)return;const S=e.visual.atlas.frames[b.frameId];a(S||null)},[e,t.currentAnimation,t.animationFrame]),!t.visible||!r)return null;const{position:s,scale:c,rotation:u,opacity:f,flipX:h}=t,{frame:y}=r,p={position:"absolute",left:s.x,top:s.y,transform:`
122
122
  translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
123
123
  scale(${h?-c:c}, ${c})
124
124
  rotate(${u}deg)
125
- `,opacity:f,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`,pointerEvents:"none",...o},m={width:y.w,height:y.h,backgroundImage:n?`url(${n.src})`:`url(${e.visual.spriteSheet})`,backgroundPosition:`-${y.x}px -${y.y}px`,backgroundRepeat:"no-repeat"};return d.createElement("div",{className:i,style:p},d.createElement("div",{style:m}))}class Ee{constructor(){this.characters=new Map,this.spriteSheets=new Map,this.loadingPromises=new Map}register(t){this.characters.set(t.id,t)}unregister(t){this.characters.delete(t),this.spriteSheets.delete(t)}get(t){return this.characters.get(t)}getAll(){return Array.from(this.characters.values())}async loadSpriteSheet(t){const n=this.spriteSheets.get(t);if(n)return n;const i=this.loadingPromises.get(t);if(i)return i;const o=this.characters.get(t);if(!(o!=null&&o.visual.spriteSheet))throw new Error(`Character ${t} has no sprite sheet`);const r=new Promise((a,s)=>{const c=new Image;c.onload=()=>{this.spriteSheets.set(t,c),this.loadingPromises.delete(t),a(c)},c.onerror=()=>{this.loadingPromises.delete(t),s(new Error(`Failed to load sprite sheet for ${t}`))},c.src=o.visual.spriteSheet});return this.loadingPromises.set(t,r),r}getSpriteSheet(t){return this.spriteSheets.get(t)}}function zr(e,t={}){const n=d.useRef(null),[i,o]=d.useState(0),[r,a]=d.useState(!1),[s,c]=d.useState(null);n.current||(n.current=new gt(e,{...t,onAnimationComplete:p=>{var m;(m=t.onAnimationComplete)==null||m.call(t,p),a(!1)},onFrameEvent:t.onFrameEvent})),d.useEffect(()=>{let p,m=performance.now();const g=b=>{const S=b-m;m=b,n.current&&(n.current.update(S),o(n.current.getCurrentFrameIndex()),c(n.current.getCurrentFrame()),a(n.current.isPlaying())),p=requestAnimationFrame(g)};return p=requestAnimationFrame(g),()=>{cancelAnimationFrame(p)}},[]);const u=d.useCallback((p,m)=>{var g;(g=n.current)==null||g.play(p,m),a(!0)},[]),f=d.useCallback(()=>{var p;(p=n.current)==null||p.stop(),a(!1)},[]),h=d.useCallback(()=>{var p;(p=n.current)==null||p.pause(),a(!1)},[]),y=d.useCallback(()=>{var p;(p=n.current)==null||p.resume(),a(!0)},[]);return{controller:n.current,currentFrame:s,frameIndex:i,isPlaying:r,play:u,stop:f,pause:h,resume:y}}function Ar(){const e=d.useRef(null);e.current||(e.current=new Ee);const t=d.useCallback(o=>{var r;(r=e.current)==null||r.register(o)},[]),n=d.useCallback(o=>{var r;return(r=e.current)==null?void 0:r.get(o)},[]),i=d.useCallback(o=>e.current.loadSpriteSheet(o),[]);return{registry:e.current,register:t,get:n,loadSpriteSheet:i}}function _r(e,t,n,i,o,r,a){const s={};for(let c=0;c<r;c++){const u=c%a,f=Math.floor(c/a);s[`frame_${c}`]={frame:{x:u*i,y:f*o,w:i,h:o},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:i,h:o},sourceSize:{w:i,h:o}}}return{id:e,name:t,type:"sprite",visual:{type:"sprite",spriteSheet:n,atlas:{frames:s,meta:{image:n,size:{w:a*i,h:Math.ceil(r/a)*o},scale:1}},width:i,height:o},animations:[],expressions:[],defaultScale:1,anchor:{x:.5,y:1}}}function Tr(e,t,n,i,o,r,a="custom"){const s=i.map(f=>({frameId:f})),c=s.length/o*1e3,u={id:t,name:n,category:a,frames:s,fps:o,loop:r,duration:c};return{...e,animations:[...e.animations,u]}}function $r(e,t,n,i,o,r){const a={id:t,name:n,emotion:i,frameId:o,overlay:r};return{...e,expressions:[...e.expressions,a]}}const Er=d.createContext(null);function Pr(){const e=d.useContext(Er);if(!e)throw new Error("usePuppetStage must be used within PuppetStageProvider");return e}function xt({background:e,width:t,height:n}){const i={position:"absolute",top:0,left:0,width:t,height:n,overflow:"hidden"};switch(e.type){case"solid":return d.createElement("div",{style:{...i,backgroundColor:e.color||"#000000"}});case"gradient":{const o=e.gradient;if(!o)return d.createElement("div",{style:{...i,backgroundColor:"#000000"}});const r=o.stops.map(s=>`${s.color} ${s.position*100}%`).join(", "),a=o.type==="radial"?`radial-gradient(circle, ${r})`:`linear-gradient(${o.angle||180}deg, ${r})`;return d.createElement("div",{style:{...i,background:a}})}case"image":return d.createElement("div",{style:{...i,backgroundImage:`url(${e.image})`,backgroundSize:"cover",backgroundPosition:"center"}});case"video":return d.createElement("div",{style:i},d.createElement("video",{src:e.video,autoPlay:!0,loop:!0,muted:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}));case"parallax":{const o=e.parallaxLayers||[];return d.createElement("div",{style:i},o.map((r,a)=>{var s,c;return d.createElement("div",{key:a,style:{position:"absolute",top:((s=r.offset)==null?void 0:s.y)||0,left:((c=r.offset)==null?void 0:c.x)||0,width:"100%",height:"100%",backgroundImage:`url(${r.image})`,backgroundRepeat:r.repeat?"repeat-x":"no-repeat",backgroundSize:"auto 100%"}})}))}default:return d.createElement("div",{style:{...i,backgroundColor:"#000000"}})}}function bt({effects:e,width:t,height:n}){return e.length===0?null:d.createElement(d.Fragment,null,e.map(i=>{const{effectId:o,type:r,params:a,progress:s}=i;switch(r){case"flash":return d.createElement("div",{key:o,style:{position:"absolute",top:0,left:0,width:t,height:n,backgroundColor:a.color||"#fff",opacity:1-s,pointerEvents:"none"}});case"vignette":return d.createElement("div",{key:o,style:{position:"absolute",top:0,left:0,width:t,height:n,background:`radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,${a.intensity||.5}) 100%)`,pointerEvents:"none"}});case"colorFilter":return d.createElement("div",{key:o,style:{position:"absolute",top:0,left:0,width:t,height:n,backgroundColor:a.color,opacity:a.intensity||.3,mixBlendMode:a.blendMode||"multiply",pointerEvents:"none"}});case"fog":return d.createElement("div",{key:o,style:{position:"absolute",top:0,left:0,width:t,height:n,background:`linear-gradient(to top, rgba(200,200,200,${a.density||.5}) 0%, transparent 70%)`,pointerEvents:"none"}});default:return null}}))}function vt({document:e,scene:t,characterStates:n,camera:i,activeEffects:o,characterRegistry:r,className:a,style:s,onCharacterClick:c}){const u=d.useRef(null),[f,h]=d.useState({width:0,height:0}),y=d.useMemo(()=>{if(f.width===0||f.height===0)return 1;const S=f.width/e.stageSize.width,x=f.height/e.stageSize.height;return Math.min(S,x)},[f,e.stageSize]);d.useEffect(()=>{const S=u.current;if(!S)return;const x=new ResizeObserver(T=>{const $=T[0];$&&h({width:$.contentRect.width,height:$.contentRect.height})});return x.observe(S),()=>x.disconnect()},[]);const p=e.stageSize.width,m=e.stageSize.height,g=d.useMemo(()=>{const{position:S,zoom:x,rotation:T}=i,$=p/2,N=m/2,C=$-S.x,H=N-S.y;return`translate(${C}px, ${H}px) scale(${x}) rotate(${T}deg)`},[i,p,m]),b=d.useMemo(()=>{const S=[];return t.cast.forEach(x=>{S.push({type:"character",data:x,zIndex:x.zIndex})}),t.scenery.forEach(x=>{S.push({type:"prop",data:x,zIndex:x.zIndex})}),S.sort((x,T)=>x.zIndex-T.zIndex)},[t.cast,t.scenery]);return d.createElement("div",{ref:u,className:a,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"#000000",...s}},d.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",width:p,height:m,transform:`translate(-50%, -50%) scale(${y})`,transformOrigin:"center center"}},d.createElement("div",{style:{position:"absolute",top:0,left:0,width:p,height:m,transform:g,transformOrigin:"center center"}},d.createElement(xt,{background:t.background,width:p,height:m}),b.map(({type:S,data:x})=>{if(S==="character"){const T=x,$=n.get(T.instanceId);if(!$||!$.visible)return null;const N=e.characters.find(C=>C.id===T.characterId);return N?d.createElement(Nr,{key:T.instanceId,characterDef:N,state:$,onClick:c?()=>c(T.instanceId):void 0}):null}else{const T=x,$=e.props.find(N=>N.id===T.propId);return $?d.createElement(Rr,{key:T.instanceId,propDef:$,state:T}):null}}),d.createElement(bt,{effects:o,width:p,height:m}))))}function Nr({characterDef:e,state:t,onClick:n}){const{position:i,scale:o,rotation:r,opacity:a,flipX:s,currentAnimation:c,animationFrame:u}=t,f=d.useMemo(()=>{const m=e.animations.find(b=>b.id===c);if(!m)return null;const g=m.frames[u];return!g||!e.visual.atlas?null:e.visual.atlas.frames[g.frameId]},[e,c,u]);if(!f)return null;const{frame:h}=f,y={position:"absolute",left:i.x,top:i.y,transform:`
125
+ `,opacity:f,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`,pointerEvents:"none",...o},m={width:y.w,height:y.h,backgroundImage:n?`url(${n.src})`:`url(${e.visual.spriteSheet})`,backgroundPosition:`-${y.x}px -${y.y}px`,backgroundRepeat:"no-repeat"};return d.createElement("div",{className:i,style:p},d.createElement("div",{style:m}))}class Pe{constructor(){this.characters=new Map,this.spriteSheets=new Map,this.loadingPromises=new Map}register(t){this.characters.set(t.id,t)}unregister(t){this.characters.delete(t),this.spriteSheets.delete(t)}get(t){return this.characters.get(t)}getAll(){return Array.from(this.characters.values())}async loadSpriteSheet(t){const n=this.spriteSheets.get(t);if(n)return n;const i=this.loadingPromises.get(t);if(i)return i;const o=this.characters.get(t);if(!(o!=null&&o.visual.spriteSheet))throw new Error(`Character ${t} has no sprite sheet`);const r=new Promise((a,s)=>{const c=new Image;c.onload=()=>{this.spriteSheets.set(t,c),this.loadingPromises.delete(t),a(c)},c.onerror=()=>{this.loadingPromises.delete(t),s(new Error(`Failed to load sprite sheet for ${t}`))},c.src=o.visual.spriteSheet});return this.loadingPromises.set(t,r),r}getSpriteSheet(t){return this.spriteSheets.get(t)}}function Ar(e,t={}){const n=d.useRef(null),[i,o]=d.useState(0),[r,a]=d.useState(!1),[s,c]=d.useState(null);n.current||(n.current=new xt(e,{...t,onAnimationComplete:p=>{var m;(m=t.onAnimationComplete)==null||m.call(t,p),a(!1)},onFrameEvent:t.onFrameEvent})),d.useEffect(()=>{let p,m=performance.now();const g=b=>{const S=b-m;m=b,n.current&&(n.current.update(S),o(n.current.getCurrentFrameIndex()),c(n.current.getCurrentFrame()),a(n.current.isPlaying())),p=requestAnimationFrame(g)};return p=requestAnimationFrame(g),()=>{cancelAnimationFrame(p)}},[]);const u=d.useCallback((p,m)=>{var g;(g=n.current)==null||g.play(p,m),a(!0)},[]),f=d.useCallback(()=>{var p;(p=n.current)==null||p.stop(),a(!1)},[]),h=d.useCallback(()=>{var p;(p=n.current)==null||p.pause(),a(!1)},[]),y=d.useCallback(()=>{var p;(p=n.current)==null||p.resume(),a(!0)},[]);return{controller:n.current,currentFrame:s,frameIndex:i,isPlaying:r,play:u,stop:f,pause:h,resume:y}}function _r(){const e=d.useRef(null);e.current||(e.current=new Pe);const t=d.useCallback(o=>{var r;(r=e.current)==null||r.register(o)},[]),n=d.useCallback(o=>{var r;return(r=e.current)==null?void 0:r.get(o)},[]),i=d.useCallback(o=>e.current.loadSpriteSheet(o),[]);return{registry:e.current,register:t,get:n,loadSpriteSheet:i}}function Tr(e,t,n,i,o,r,a){const s={};for(let c=0;c<r;c++){const u=c%a,f=Math.floor(c/a);s[`frame_${c}`]={frame:{x:u*i,y:f*o,w:i,h:o},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:i,h:o},sourceSize:{w:i,h:o}}}return{id:e,name:t,type:"sprite",visual:{type:"sprite",spriteSheet:n,atlas:{frames:s,meta:{image:n,size:{w:a*i,h:Math.ceil(r/a)*o},scale:1}},width:i,height:o},animations:[],expressions:[],defaultScale:1,anchor:{x:.5,y:1}}}function $r(e,t,n,i,o,r,a="custom"){const s=i.map(f=>({frameId:f})),c=s.length/o*1e3,u={id:t,name:n,category:a,frames:s,fps:o,loop:r,duration:c};return{...e,animations:[...e.animations,u]}}function Er(e,t,n,i,o,r){const a={id:t,name:n,emotion:i,frameId:o,overlay:r};return{...e,expressions:[...e.expressions,a]}}const Pr=d.createContext(null);function Nr(){const e=d.useContext(Pr);if(!e)throw new Error("usePuppetStage must be used within PuppetStageProvider");return e}function bt({background:e,width:t,height:n}){const i={position:"absolute",top:0,left:0,width:t,height:n,overflow:"hidden"};switch(e.type){case"solid":return d.createElement("div",{style:{...i,backgroundColor:e.color||"#000000"}});case"gradient":{const o=e.gradient;if(!o)return d.createElement("div",{style:{...i,backgroundColor:"#000000"}});const r=o.stops.map(s=>`${s.color} ${s.position*100}%`).join(", "),a=o.type==="radial"?`radial-gradient(circle, ${r})`:`linear-gradient(${o.angle||180}deg, ${r})`;return d.createElement("div",{style:{...i,background:a}})}case"image":return d.createElement("div",{style:{...i,backgroundImage:`url(${e.image})`,backgroundSize:"cover",backgroundPosition:"center"}});case"video":return d.createElement("div",{style:i},d.createElement("video",{src:e.video,autoPlay:!0,loop:!0,muted:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}));case"parallax":{const o=e.parallaxLayers||[];return d.createElement("div",{style:i},o.map((r,a)=>{var s,c;return d.createElement("div",{key:a,style:{position:"absolute",top:((s=r.offset)==null?void 0:s.y)||0,left:((c=r.offset)==null?void 0:c.x)||0,width:"100%",height:"100%",backgroundImage:`url(${r.image})`,backgroundRepeat:r.repeat?"repeat-x":"no-repeat",backgroundSize:"auto 100%"}})}))}default:return d.createElement("div",{style:{...i,backgroundColor:"#000000"}})}}function vt({effects:e,width:t,height:n}){return e.length===0?null:d.createElement(d.Fragment,null,e.map(i=>{const{effectId:o,type:r,params:a,progress:s}=i;switch(r){case"flash":return d.createElement("div",{key:o,style:{position:"absolute",top:0,left:0,width:t,height:n,backgroundColor:a.color||"#fff",opacity:1-s,pointerEvents:"none"}});case"vignette":return d.createElement("div",{key:o,style:{position:"absolute",top:0,left:0,width:t,height:n,background:`radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,${a.intensity||.5}) 100%)`,pointerEvents:"none"}});case"colorFilter":return d.createElement("div",{key:o,style:{position:"absolute",top:0,left:0,width:t,height:n,backgroundColor:a.color,opacity:a.intensity||.3,mixBlendMode:a.blendMode||"multiply",pointerEvents:"none"}});case"fog":return d.createElement("div",{key:o,style:{position:"absolute",top:0,left:0,width:t,height:n,background:`linear-gradient(to top, rgba(200,200,200,${a.density||.5}) 0%, transparent 70%)`,pointerEvents:"none"}});default:return null}}))}function St({document:e,scene:t,characterStates:n,camera:i,activeEffects:o,characterRegistry:r,className:a,style:s,onCharacterClick:c}){const u=d.useRef(null),[f,h]=d.useState({width:0,height:0}),y=d.useMemo(()=>{if(f.width===0||f.height===0)return 1;const S=f.width/e.stageSize.width,x=f.height/e.stageSize.height;return Math.min(S,x)},[f,e.stageSize]);d.useEffect(()=>{const S=u.current;if(!S)return;const x=new ResizeObserver($=>{const E=$[0];E&&h({width:E.contentRect.width,height:E.contentRect.height})});return x.observe(S),()=>x.disconnect()},[]);const p=e.stageSize.width,m=e.stageSize.height,g=d.useMemo(()=>{const{position:S,zoom:x,rotation:$}=i,E=p/2,R=m/2,z=E-S.x,V=R-S.y;return`translate(${z}px, ${V}px) scale(${x}) rotate(${$}deg)`},[i,p,m]),b=d.useMemo(()=>{const S=[];return t.cast.forEach(x=>{S.push({type:"character",data:x,zIndex:x.zIndex})}),t.scenery.forEach(x=>{S.push({type:"prop",data:x,zIndex:x.zIndex})}),S.sort((x,$)=>x.zIndex-$.zIndex)},[t.cast,t.scenery]);return d.createElement("div",{ref:u,className:a,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"#000000",...s}},d.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",width:p,height:m,transform:`translate(-50%, -50%) scale(${y})`,transformOrigin:"center center"}},d.createElement("div",{style:{position:"absolute",top:0,left:0,width:p,height:m,transform:g,transformOrigin:"center center"}},d.createElement(bt,{background:t.background,width:p,height:m}),b.map(({type:S,data:x})=>{if(S==="character"){const $=x,E=n.get($.instanceId);if(!E||!E.visible)return null;const R=e.characters.find(z=>z.id===$.characterId);return R?d.createElement(Rr,{key:$.instanceId,characterDef:R,state:E,onClick:c?()=>c($.instanceId):void 0}):null}else{const $=x,E=e.props.find(R=>R.id===$.propId);return E?d.createElement(qr,{key:$.instanceId,propDef:E,state:$}):null}}),d.createElement(vt,{effects:o,width:p,height:m}))))}function Rr({characterDef:e,state:t,onClick:n}){const{position:i,scale:o,rotation:r,opacity:a,flipX:s,currentAnimation:c,animationFrame:u}=t,f=d.useMemo(()=>{const m=e.animations.find(b=>b.id===c);if(!m)return null;const g=m.frames[u];return!g||!e.visual.atlas?null:e.visual.atlas.frames[g.frameId]},[e,c,u]);if(!f)return null;const{frame:h}=f,y={position:"absolute",left:i.x,top:i.y,transform:`
126
126
  translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
127
127
  scale(${s?-o:o}, ${o})
128
128
  rotate(${r}deg)
129
- `,opacity:a,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`,cursor:n?"pointer":"default"},p={width:h.w,height:h.h,backgroundImage:`url(${e.visual.spriteSheet})`,backgroundPosition:`-${h.x}px -${h.y}px`,backgroundRepeat:"no-repeat"};return d.createElement("div",{style:y,onClick:n},d.createElement("div",{style:p}))}function Rr({propDef:e,state:t}){const{position:n,scale:i,rotation:o,opacity:r}=t,a={position:"absolute",left:n.x,top:n.y,transform:`
129
+ `,opacity:a,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`,cursor:n?"pointer":"default"},p={width:h.w,height:h.h,backgroundImage:`url(${e.visual.spriteSheet})`,backgroundPosition:`-${h.x}px -${h.y}px`,backgroundRepeat:"no-repeat"};return d.createElement("div",{style:y,onClick:n},d.createElement("div",{style:p}))}function qr({propDef:e,state:t}){const{position:n,scale:i,rotation:o,opacity:r}=t,a={position:"absolute",left:n.x,top:n.y,transform:`
130
130
  translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
131
131
  scale(${i})
132
132
  rotate(${o}deg)
133
- `,opacity:r,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`};return e.type==="image"||e.type==="sprite"?d.createElement("img",{src:e.asset,style:{...a,width:e.width,height:e.height,pointerEvents:"none"},alt:e.name}):e.type==="vector"?d.createElement("div",{style:a,dangerouslySetInnerHTML:{__html:e.asset}}):e.type==="text"?d.createElement("div",{style:a},e.asset):d.createElement("div",{style:a})}function St({text:e,speakerName:t,style:n={},targetPosition:i,visible:o,typewriterProgress:r=1}){if(!o)return null;const{position:a="bottom",backgroundColor:s="rgba(0, 0, 0, 0.85)",textColor:c="#fff",fontSize:u=18,maxWidth:f=600}=n,h=e.slice(0,Math.floor(e.length*r)),y={position:"absolute",maxWidth:f,padding:"16px 24px",backgroundColor:s,color:c,fontSize:u,borderRadius:12,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.3)",zIndex:1e3};switch(a){case"bottom":Object.assign(y,{bottom:20,left:"50%",transform:"translateX(-50%)",width:"90%"});break;case"top":Object.assign(y,{top:20,left:"50%",transform:"translateX(-50%)",width:"90%"});break;case"center":Object.assign(y,{top:"50%",left:"50%",transform:"translate(-50%, -50%)"});break;case"bubble":i&&Object.assign(y,{left:i.x,bottom:i.y+20,transform:"translateX(-50%)"});break}return d.createElement("div",{style:y},t&&d.createElement("div",{style:{fontWeight:"bold",marginBottom:8,color:"#60a5fa"}},t),d.createElement("div",null,h))}function qr(e,t,n){const[i,o]=d.useState({offsetX:0,offsetY:0}),r=d.useRef(null);return d.useEffect(()=>{if(!n){o({offsetX:0,offsetY:0});return}r.current=performance.now();let a;const s=c=>{const u=c-r.current;if(u>=t){o({offsetX:0,offsetY:0});return}const h=1-u/t,y=(Math.random()-.5)*2*e*h,p=(Math.random()-.5)*2*e*h;o({offsetX:y,offsetY:p}),a=requestAnimationFrame(s)};return a=requestAnimationFrame(s),()=>{cancelAnimationFrame(a)}},[n,e,t]),i}const le={linear:e=>e,easeIn:e=>e*e,easeOut:e=>e*(2-e),easeInOut:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInElastic:e=>e===0||e===1?e:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI),easeOutElastic:e=>e===0||e===1?e:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1,easeInOutElastic:e=>e===0||e===1?e:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1),easeInBounce:e=>1-le.easeOutBounce(1-e),easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,easeInOutBounce:e=>e<.5?le.easeInBounce(e*2)*.5:le.easeOutBounce(e*2-1)*.5+.5,step:e=>Math.round(e)};function wt(e){return le[e]||le.linear}function re(e,t,n){return e+(t-e)*n}function Ce(e,t,n){return{x:re(e.x,t.x,n),y:re(e.y,t.y,n)}}class kt{constructor(t){this.currentTime=0,this.scene=t.scene,this.characterDefs=new Map(t.characterDefs.map(n=>[n.id,n])),this.typewriterSpeed=t.typewriterSpeed||30,this.onAudioCommand=t.onAudioCommand}evaluate(t){this.currentTime=t;const n=this.evaluateAllCharacters(t),i=this.evaluateCamera(t),o=this.evaluateDialogue(t),r=this.evaluateEffects(t),a=this.evaluateAudio(t);return{characterStates:n,camera:i,activeDialogue:o,activeEffects:r,audioCommands:a}}getDuration(){return this.scene.duration}findSurroundingKeyframes(t,n){const i=t.keyframes;if(i.length===0)return{prev:null,next:null,progress:0};let o=-1;for(let y=0;y<i.length&&i[y].time<=n;y++)o=y;if(o===-1)return{prev:null,next:i[0],progress:0};const r=i[o],a=i[o+1]||null;if(!a)return{prev:r,next:null,progress:1};const s=a.time-r.time,c=n-r.time,u=s>0?c/s:0,h=wt(r.easing||"linear")(Math.min(1,Math.max(0,u)));return{prev:r,next:a,progress:h}}evaluateAllCharacters(t){const n=new Map;for(const i of this.scene.cast){const o=this.evaluateCharacter(i.instanceId,t);n.set(i.instanceId,o)}return n}evaluateCharacter(t,n){var a;const i=this.scene.cast.find(s=>s.instanceId===t);if(!i)return this.createDefaultCharacterState();const o=this.characterDefs.get(i.characterId);let r={instanceId:t,characterId:i.characterId,position:{...i.position},scale:i.scale,rotation:i.rotation,opacity:i.opacity??1,flipX:i.flipX??!1,visible:!0,currentAnimation:i.initialAnimation||(((a=o==null?void 0:o.animations[0])==null?void 0:a.id)??""),animationFrame:0,animationStartTime:0,currentExpression:i.initialExpression??""};for(const s of this.scene.timeline)if(s.targetId===t)switch(s.type){case"animation":r=this.applyAnimationTrack(s,r,n);break;case"transform":r=this.applyTransformTrack(s,r,n);break;case"expression":r=this.applyExpressionTrack(s,r,n);break}if(o&&r.currentAnimation){const s=o.animations.find(c=>c.id===r.currentAnimation);if(s){const c=(n-r.animationStartTime)%(s.duration||s.frames.length/s.fps*1e3),u=Math.floor(c/1e3*s.fps)%s.frames.length;r.animationFrame=u}}return r}createDefaultCharacterState(){return{instanceId:"",characterId:"",position:{x:0,y:0},scale:1,rotation:0,opacity:1,flipX:!1,visible:!1,currentAnimation:"",animationFrame:0,animationStartTime:0,currentExpression:""}}applyAnimationTrack(t,n,i){const{prev:o}=this.findSurroundingKeyframes(t,i);if(o){const r=o.value;return{...n,currentAnimation:r.animationId,animationStartTime:o.time}}return n}applyTransformTrack(t,n,i){const{prev:o,next:r,progress:a}=this.findSurroundingKeyframes(t,i);if(!o)return n;const s=o.value,c=r?r.value:null;return c?{...n,position:s.position&&c.position?Ce(s.position,c.position,a):s.position??n.position,scale:s.scale!==void 0&&c.scale!==void 0?re(s.scale,c.scale,a):s.scale??n.scale,rotation:s.rotation!==void 0&&c.rotation!==void 0?re(s.rotation,c.rotation,a):s.rotation??n.rotation,opacity:s.opacity!==void 0&&c.opacity!==void 0?re(s.opacity,c.opacity,a):s.opacity??n.opacity}:{...n,position:s.position??n.position,scale:s.scale??n.scale,rotation:s.rotation??n.rotation,opacity:s.opacity??n.opacity}}applyExpressionTrack(t,n,i){const{prev:o}=this.findSurroundingKeyframes(t,i);if(o){const r=o.value;return{...n,currentExpression:r.expressionId}}return n}evaluateCamera(t){let n=this.scene.camera?{...this.scene.camera}:{position:{x:640,y:360},zoom:1,rotation:0};for(const i of this.scene.timeline){if(i.type!=="camera")continue;const{prev:o,next:r,progress:a}=this.findSurroundingKeyframes(i,t);if(!o)continue;const s=o.value,c=r?r.value:null;c?n={position:s.position&&c.position?Ce(s.position,c.position,a):s.position??n.position,zoom:s.zoom!==void 0&&c.zoom!==void 0?re(s.zoom,c.zoom,a):s.zoom??n.zoom,rotation:s.rotation!==void 0&&c.rotation!==void 0?re(s.rotation,c.rotation,a):s.rotation??n.rotation}:n={position:s.position??n.position,zoom:s.zoom??n.zoom,rotation:s.rotation??n.rotation}}return n}evaluateDialogue(t){for(const n of this.scene.timeline){if(n.type!=="dialogue")continue;const{prev:i}=this.findSurroundingKeyframes(n,t);if(i){const o=i.value,r=i.time+(i.duration??0);if(t>=i.time&&t<r){const a=t-i.time,s=o.text.length/this.typewriterSpeed*1e3,c=Math.min(1,a/s);return{text:o.text,speakerId:n.targetId,typewriterProgress:c}}}}return null}evaluateEffects(t){const n=[];for(const i of this.scene.timeline)if(i.type==="effect")for(const o of i.keyframes){const r=o.value,a=o.time+(o.duration??0);if(t>=o.time&&t<a){const s=o.duration?(t-o.time)/o.duration:1;n.push({effectId:i.id+"_"+o.time,type:r.effectType,params:r.params,startTime:o.time,duration:o.duration??0,progress:s})}}return n}evaluateAudio(t){const n=[];for(const i of this.scene.timeline)if(i.type==="audio")for(const o of i.keyframes){const r=o.value;Math.abs(t-o.time)<50&&n.push({trackId:i.targetId,command:r.action,time:t})}return n}}class Dr{constructor(t,n,i){this.track={id:i||`track_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:t,targetId:n,keyframes:[]}}addAnimationKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:(i==null?void 0:i.easing)??"linear",value:{type:"animation",animationId:n,speed:(i==null?void 0:i.speed)??1}}),this}addTransformKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:i??"easeInOut",value:{type:"transform",...n}}),this}addExpressionKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:(i==null?void 0:i.easing)??"easeOut",duration:(i==null?void 0:i.transition)??200,value:{type:"expression",expressionId:n}}),this}addDialogueKeyframe(t,n,i,o){return this.track.keyframes.push({time:t,duration:i,easing:(o==null?void 0:o.easing)??"linear",value:{type:"dialogue",text:n,audioClip:o==null?void 0:o.voiceOver,style:o==null?void 0:o.style}}),this}addCameraKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:i??"easeInOut",value:{type:"camera",...n}}),this}addEffectKeyframe(t,n,i,o,r){return this.track.keyframes.push({time:t,duration:i,easing:r??"linear",value:{type:"effect",effectType:n,params:o??{}}}),this}build(){return this.track.keyframes.sort((t,n)=>t.time-n.time),this.track}}class Or{constructor(t,n,i){this.scene={id:t,title:n,duration:i,background:{type:"solid",color:"#000000"},cast:[],scenery:[],timeline:[],camera:{position:{x:640,y:360},zoom:1,rotation:0}}}setBackground(t){return this.scene.background=t,this}setCamera(t){return this.scene.camera=t,this}setTransition(t){return this.scene.transition=t,this}addCastMember(t,n,i){return this.scene.cast.push({instanceId:t,characterId:n,position:i.position??{x:640,y:360},scale:i.scale??1,rotation:i.rotation??0,zIndex:i.zIndex??this.scene.cast.length,initialAnimation:i.initialAnimation,initialExpression:i.initialExpression,opacity:i.opacity??1,flipX:i.flipX??!1}),this}addProp(t,n,i){return this.scene.scenery.push({instanceId:t,propId:n,position:i.position??{x:640,y:360},scale:i.scale??1,rotation:i.rotation??0,zIndex:i.zIndex??this.scene.scenery.length,opacity:i.opacity??1}),this}addTrack(t){return this.scene.timeline.push(t),this}addAudio(t){return this.scene.audio=t,this}build(){return this.scene}}function jr(e){return JSON.parse(JSON.stringify(e))}function It(e){if(e.keyframes.length===0)return 0;const t=e.keyframes[e.keyframes.length-1];return"duration"in t&&typeof t.duration=="number"?t.time+t.duration:t.time}function Fr(e){let t=0;for(const n of e.timeline){const i=It(n);i>t&&(t=i)}return Math.max(e.duration,t)}function Lr(e,t){return Math.floor(e/1e3*t)}function Wr(e,t){return e/t*1e3}function Br(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),i=t%60,o=Math.floor(e%1e3/10);return`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}.${o.toString().padStart(2,"0")}`}function Vr(e){const t=e.match(/^(\d+):(\d{2})(?:\.(\d{2}))?$/);if(!t)return 0;const n=parseInt(t[1],10),i=parseInt(t[2],10),o=t[3]?parseInt(t[3],10)*10:0;return(n*60+i)*1e3+o}const Ct=d.createContext(null);function Ur(){const e=d.useContext(Ct);if(!e)throw new Error("usePuppetPlayer must be used within PuppetPlayerProvider");return e}class Hr{constructor(){this.audioElements=new Map,this.volume=1,this.muted=!1}preloadAudio(t,n){return new Promise((i,o)=>{const r=new Audio(n);r.preload="auto",r.volume=this.volume,r.muted=this.muted,r.addEventListener("canplaythrough",()=>i(),{once:!0}),r.addEventListener("error",o,{once:!0}),this.audioElements.set(t,r)})}play(t,n){const i=this.audioElements.get(t);i&&(n!==void 0&&(i.currentTime=n/1e3),i.play().catch(()=>{}))}pause(t){const n=this.audioElements.get(t);n&&n.pause()}stop(t){const n=this.audioElements.get(t);n&&(n.pause(),n.currentTime=0)}stopAll(){this.audioElements.forEach(t=>{t.pause(),t.currentTime=0})}setVolume(t){this.volume=Math.max(0,Math.min(1,t)),this.audioElements.forEach(n=>{n.volume=this.volume})}setMuted(t){this.muted=t,this.audioElements.forEach(n=>{n.muted=t})}dispose(){this.stopAll(),this.audioElements.clear()}}function Mt(e){const{document:t,autoPlay:n=!1,loop:i=!1,initialVolume:o=1,initialSpeed:r=1}=e,[a,s]=d.useState({isPlaying:!1,isPaused:!1,currentSceneIndex:0,currentTime:0,totalDuration:0,playbackSpeed:r,volume:o,isMuted:!1,characterStates:new Map,activeEffects:[],loop:i}),[c,u]=d.useState(null),f=d.useRef(null),h=d.useRef(0),y=d.useRef(new Hr),p=d.useRef(null),m=d.useRef(new Ee),g=d.useMemo(()=>t.scenes.reduce((I,P)=>I+P.duration,0),[t.scenes]),b=d.useMemo(()=>t.scenes[a.currentSceneIndex]||null,[t.scenes,a.currentSceneIndex]);d.useEffect(()=>{b&&(p.current=new kt({scene:b,characterDefs:t.characters,onAudioCommand:(I,P,v)=>{const D=y.current;switch(P){case"play":D.play(I,v);break;case"pause":D.pause(I);break;case"stop":D.stop(I);break}}}))},[b,t.characters]),d.useEffect(()=>{var P;const I=y.current;return(P=t.audioTracks)==null||P.forEach(v=>{v.src&&I.preloadAudio(v.id,v.src).catch(()=>{})}),()=>{I.dispose()}},[t.audioTracks]);const S=d.useCallback(I=>{if(!p.current)return;const P=I-h.current;h.current=I,s(v=>{var U,X,R;if(!v.isPlaying||v.isPaused)return v;const D=v.currentTime+P*v.playbackSpeed,V=(b==null?void 0:b.duration)??0;if(D>=V){const k=v.currentSceneIndex+1;return k>=t.scenes.length?v.loop?((U=e.onSceneChange)==null||U.call(e,0,t.scenes[0]),{...v,currentSceneIndex:0,currentTime:0}):((X=e.onEnd)==null||X.call(e),{...v,isPlaying:!1,isPaused:!1,currentTime:V}):((R=e.onSceneChange)==null||R.call(e,k,t.scenes[k]),{...v,currentSceneIndex:k,currentTime:0})}return{...v,currentTime:D}}),f.current=requestAnimationFrame(S)},[b,t.scenes,e]);d.useEffect(()=>(a.isPlaying&&!a.isPaused?(h.current=performance.now(),f.current=requestAnimationFrame(S)):f.current&&cancelAnimationFrame(f.current),()=>{f.current&&cancelAnimationFrame(f.current)}),[a.isPlaying,a.isPaused,S]),d.useEffect(()=>{if(p.current){const I=p.current.evaluate(a.currentTime);u(I),I.audioCommands.forEach(P=>{const v=y.current;switch(P.command){case"play":v.play(P.trackId);break;case"pause":v.pause(P.trackId);break;case"stop":v.stop(P.trackId);break}}),s(P=>({...P,characterStates:I.characterStates,activeEffects:I.activeEffects}))}},[a.currentTime]),d.useEffect(()=>{n&&s(I=>({...I,isPlaying:!0}))},[n]);const x=d.useCallback(()=>{s(I=>({...I,isPlaying:!0,isPaused:!1}))},[]),T=d.useCallback(()=>{s(I=>({...I,isPaused:!0})),y.current.stopAll()},[]),$=d.useCallback(()=>{s(I=>({...I,isPlaying:!1,isPaused:!1,currentTime:0,currentSceneIndex:0})),y.current.stopAll()},[]),N=d.useCallback(I=>{s(P=>({...P,currentTime:Math.max(0,Math.min(I,(b==null?void 0:b.duration)??0))}))},[b]),C=d.useCallback(I=>{var P;I>=0&&I<t.scenes.length&&(y.current.stopAll(),s(v=>({...v,currentSceneIndex:I,currentTime:0})),(P=e.onSceneChange)==null||P.call(e,I,t.scenes[I]))},[t.scenes,e]),H=d.useCallback(I=>{s(P=>({...P,playbackSpeed:Math.max(.25,Math.min(4,I))}))},[]),A=d.useCallback(I=>{const P=Math.max(0,Math.min(1,I));y.current.setVolume(P),s(v=>({...v,volume:P}))},[]),q=d.useCallback(()=>{s(I=>{const P=!I.isMuted;return y.current.setMuted(P),{...I,isMuted:P}})},[]),W=d.useCallback(()=>{C(a.currentSceneIndex+1)},[a.currentSceneIndex,C]),Y=d.useCallback(()=>{C(a.currentSceneIndex-1)},[a.currentSceneIndex,C]),K=d.useCallback(I=>{s(P=>({...P,loop:I}))},[]);return{playerState:{...a,totalDuration:g},timelineState:c,characterRegistry:m.current,play:x,pause:T,stop:$,seek:N,seekToScene:C,setPlaybackSpeed:H,setVolume:A,toggleMute:q,nextScene:W,previousScene:Y,setLoop:K}}function zt({document:e,autoPlay:t=!1,loop:n=!1,showControls:i=!0,className:o,style:r,onSceneChange:a,onEnd:s}){var H;const{playerState:c,timelineState:u,characterRegistry:f,play:h,pause:y,stop:p,seek:m,seekToScene:g,setPlaybackSpeed:b,setVolume:S,toggleMute:x,nextScene:T,previousScene:$,setLoop:N}=Mt({document:e,autoPlay:t,loop:n,onSceneChange:a,onEnd:s}),C=e.scenes[c.currentSceneIndex];return C?d.createElement(Ct.Provider,{value:{document:e,playerState:c,play:h,pause:y,stop:p,seek:m,seekToScene:g,setPlaybackSpeed:b,setVolume:S,toggleMute:x,nextScene:T,previousScene:$,setLoop:N}},d.createElement("div",{className:o,style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#000",...r}},d.createElement("div",{style:{flex:1,position:"relative"}},d.createElement(vt,{document:e,scene:C,characterStates:c.characterStates,camera:(u==null?void 0:u.camera)??C.camera??{position:{x:640,y:360},zoom:1,rotation:0},activeEffects:c.activeEffects,characterRegistry:f}),(u==null?void 0:u.activeDialogue)&&d.createElement(St,{text:u.activeDialogue.text,speakerName:(H=e.characters.find(A=>{var q;return A.id===((q=u.activeDialogue)==null?void 0:q.speakerId)}))==null?void 0:H.name,visible:!0,typewriterProgress:u.activeDialogue.typewriterProgress})),i&&d.createElement(Qr,{playerState:c,currentScene:C,totalScenes:e.scenes.length,onPlay:h,onPause:y,onStop:p,onSeek:m,onPreviousScene:$,onNextScene:T,onSpeedChange:b,onVolumeChange:S,onToggleMute:x,onToggleLoop:()=>N(!c.loop)}))):d.createElement("div",{className:o,style:r},"No scenes")}function Qr({playerState:e,currentScene:t,totalScenes:n,onPlay:i,onPause:o,onStop:r,onSeek:a,onPreviousScene:s,onNextScene:c,onSpeedChange:u,onVolumeChange:f,onToggleMute:h,onToggleLoop:y}){const p=ie(),m=T=>{const $=Math.floor(T/1e3),N=Math.floor($/60),C=$%60;return`${N}:${C.toString().padStart(2,"0")}`},g=t.duration>0?e.currentTime/t.duration*100:0,b={display:"flex",alignItems:"center",gap:8,padding:"12px 16px",backgroundColor:"var(--nice-overlay-90, rgba(0, 0, 0, 0.9))",color:"var(--nice-color-white, #fff)"},S={background:"none",border:"none",color:"#fff",cursor:"pointer",padding:"8px",fontSize:16,opacity:.9},x={flex:1,height:4,backgroundColor:"var(--nice-border-color, #444)",borderRadius:2,cursor:"pointer"};return d.createElement("div",{style:b},d.createElement("button",{style:S,onClick:e.isPlaying&&!e.isPaused?o:i,title:e.isPlaying&&!e.isPaused?p("puppetPlayer.pause","Pause"):p("puppetPlayer.play","Play")},d.createElement(_.NiceIcon,{name:e.isPlaying&&!e.isPaused?"pause":"play",size:16})),d.createElement("button",{style:S,onClick:r,title:p("puppetPlayer.stop","Stop"),"aria-label":p("puppetPlayer.stop","Stop")},d.createElement(_.NiceIcon,{name:"stop",size:16})),d.createElement("button",{style:{...S,opacity:e.currentSceneIndex>0?.9:.3},onClick:s,disabled:e.currentSceneIndex<=0,title:p("puppetPlayer.previousScene","Previous Scene"),"aria-label":p("puppetPlayer.previousScene","Previous Scene")},d.createElement(_.NiceIcon,{name:"skip-back",size:16})),d.createElement("button",{style:{...S,opacity:e.currentSceneIndex<n-1?.9:.3},onClick:c,disabled:e.currentSceneIndex>=n-1,title:p("puppetPlayer.nextScene","Next Scene"),"aria-label":p("puppetPlayer.nextScene","Next Scene")},d.createElement(_.NiceIcon,{name:"skip-forward",size:16})),d.createElement("span",{style:{fontSize:12,fontFamily:"monospace"}},`${m(e.currentTime)} / ${m(t.duration)}`),d.createElement("div",{style:x,onClick:T=>{const $=T.currentTarget.getBoundingClientRect(),C=(T.clientX-$.left)/$.width;a(C*t.duration)}},d.createElement("div",{style:{width:`${g}%`,height:"100%",backgroundColor:"var(--nice-primary-light, #60a5fa)",borderRadius:2}})),d.createElement("select",{value:e.playbackSpeed,onChange:T=>u(parseFloat(T.target.value)),style:{background:"var(--nice-text, #333)",color:"var(--nice-text-inverse, #fff)",border:"none",padding:"4px 8px",borderRadius:4,fontSize:12}},d.createElement("option",{value:.25},"0.25x"),d.createElement("option",{value:.5},"0.5x"),d.createElement("option",{value:1},"1x"),d.createElement("option",{value:1.5},"1.5x"),d.createElement("option",{value:2},"2x")),d.createElement("button",{style:S,onClick:h,title:e.isMuted?p("puppetPlayer.unmute","Unmute"):p("puppetPlayer.mute","Mute")},d.createElement(_.NiceIcon,{name:e.isMuted?"volume-off":"volume",size:16})),d.createElement("input",{type:"range",min:0,max:1,step:.1,value:e.volume,onChange:T=>f(parseFloat(T.target.value)),style:{width:60}}),d.createElement("button",{style:{...S,color:e.loop?"var(--nice-primary-light, #60a5fa)":"#fff"},onClick:y,title:p("puppetPlayer.loop","Loop"),"aria-label":p("puppetPlayer.loop","Loop"),"aria-pressed":e.loop},d.createElement(_.NiceIcon,{name:"refresh",size:16})),d.createElement("span",{style:{fontSize:12}},`Scene ${e.currentSceneIndex+1}/${n}`))}function Yr({document:e,width:t=320,height:n=240,autoPlay:i=!1,className:o,style:r}){return d.createElement(zt,{document:e,autoPlay:i,showControls:!1,className:o,style:{width:t,height:n,borderRadius:8,overflow:"hidden",...r}})}function At(e,t,n){var a,s,c,u;const i=t.assets.find(f=>f.id===e.assetId),o=[];if(e.animations)for(const[f,h]of Object.entries(e.animations)){const y=h.frames.map((p,m)=>({frameId:`${f}_frame_${m}`,duration:p.duration||1e3/h.fps,offset:{x:0,y:0}}));o.push({id:`anim_${f}`,name:f,category:Et(f),frames:y,fps:h.fps,loop:h.loop,duration:y.reduce((p,m)=>p+(m.duration??0),0)})}const r={};if(e.animations)for(const[f,h]of Object.entries(e.animations))h.frames.forEach((y,p)=>{r[`${f}_frame_${p}`]={frame:{x:y.srcRect.x,y:y.srcRect.y,w:y.srcRect.width,h:y.srcRect.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:y.srcRect.width,h:y.srcRect.height},sourceSize:{w:y.srcRect.width,h:y.srcRect.height}}});return{id:`char_${e.id}`,name:e.name,type:"sprite",visual:{type:"sprite",spriteSheet:(i==null?void 0:i.path)||"",atlas:{frames:r,meta:{image:(i==null?void 0:i.path)||"",size:{w:((a=i==null?void 0:i.metadata)==null?void 0:a.width)||e.width,h:((s=i==null?void 0:i.metadata)==null?void 0:s.height)||e.height},scale:1}},width:((c=i==null?void 0:i.metadata)==null?void 0:c.width)||e.width||100,height:((u=i==null?void 0:i.metadata)==null?void 0:u.height)||e.height||100},anchor:e.anchor||{x:.5,y:1},animations:o,expressions:[],defaultScale:1}}function _t(e,t,n){var u,f,h,y;const{sprite:i,animator:o,transform:r}=e.components;if(!i)return null;const a=t.assets.find(p=>p.id===i.assetId),s=[];if(o!=null&&o.animations)for(const[p,m]of Object.entries(o.animations)){const g=m.frames.map((b,S)=>({frameId:`${p}_frame_${S}`,duration:b.duration||1e3/m.fps,offset:{x:0,y:0}}));s.push({id:`anim_${p}`,name:p,category:Et(p),frames:g,fps:m.fps,loop:m.loop,duration:g.reduce((b,S)=>b+(S.duration??0),0)})}const c={};if(o!=null&&o.animations)for(const[p,m]of Object.entries(o.animations))m.frames.forEach((g,b)=>{c[`${p}_frame_${b}`]={frame:{x:g.srcRect.x,y:g.srcRect.y,w:g.srcRect.width,h:g.srcRect.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:g.srcRect.width,h:g.srcRect.height},sourceSize:{w:g.srcRect.width,h:g.srcRect.height}}});return{id:`char_${e.id}`,name:e.name,type:"sprite",visual:{type:"sprite",spriteSheet:(a==null?void 0:a.path)||"",atlas:{frames:c,meta:{image:(a==null?void 0:a.path)||"",size:{w:((u=a==null?void 0:a.metadata)==null?void 0:u.width)||i.width,h:((f=a==null?void 0:a.metadata)==null?void 0:f.height)||i.height},scale:1}},width:((h=a==null?void 0:a.metadata)==null?void 0:h.width)||i.width||100,height:((y=a==null?void 0:a.metadata)==null?void 0:y.height)||i.height||100},anchor:i.anchor||{x:.5,y:1},animations:s,expressions:[],defaultScale:1}}function Tt(e,t){var n,i;return e.type!=="image"&&e.type!=="spritesheet"?null:{id:`prop_${e.id}`,name:e.name,type:"image",asset:e.path,width:((n=e.metadata)==null?void 0:n.width)||100,height:((i=e.metadata)==null?void 0:i.height)||100,anchor:{x:.5,y:.5}}}function Gr(e,t){const n=[];for(const i of e.sprites)n.push(At(i,e));for(const i of e.entities){const o=_t(i,e);o&&n.push(o)}return n}function Kr(e,t){const n=[];for(const i of e.assets){const o=Tt(i);o&&n.push(o)}return n}function $t(e){const t={};for(const o of e.animations){const r=[];if(e.visual.atlas)for(const a of o.frames){const s=e.visual.atlas.frames[a.frameId];s&&r.push({assetId:e.id+"_sheet",srcRect:{x:s.frame.x,y:s.frame.y,width:s.frame.w,height:s.frame.h},duration:a.duration})}t[o.name]={frames:r,fps:o.fps,loop:o.loop}}let n=64,i=64;if(e.visual.atlas){const o=Object.keys(e.visual.atlas.frames)[0];if(o){const r=e.visual.atlas.frames[o];n=r.frame.w,i=r.frame.h}}return{id:e.id,name:e.name,assetId:e.id+"_sheet",width:n,height:i,anchor:e.anchor,animations:t}}function Xr(e,t){var i;const n=$t(e);return{id:e.id,name:e.name,components:{sprite:{assetId:n.assetId,width:n.width,height:n.height,anchor:n.anchor,visible:!0},animator:{currentAnimation:((i=e.animations[0])==null?void 0:i.name)||"",animations:n.animations||{},frame:0,elapsed:0,playing:!0,loop:!0},transform:{position:t||{x:0,y:0},rotation:0,scale:{x:1,y:1}}}}}function Et(e){const t=e.toLowerCase();return t.includes("idle")||t.includes("stand")?"idle":t.includes("walk")?"walk":t.includes("run")||t.includes("sprint")?"run":t.includes("jump")||t.includes("fall")||t.includes("attack")||t.includes("hit")||t.includes("shoot")?"action":t.includes("hurt")||t.includes("damage")||t.includes("die")?"emotion":(t.includes("special")||t.includes("skill"),"custom")}function Jr(e,t){const n=(t==null?void 0:t.columns)||Math.ceil(Math.sqrt(e.length)),i=(t==null?void 0:t.padding)||0;if(e.length===0)return{image:"",atlas:{frames:{},meta:{image:"",size:{w:0,h:0},scale:1}}};const o=e[0].width,r=e[0].height,a=Math.ceil(e.length/n),s=n*(o+i)-i,c=a*(r+i)-i,u={};return e.forEach((f,h)=>{const y=h%n,p=Math.floor(h/n);u[f.id]={frame:{x:y*(o+i),y:p*(r+i),w:o,h:r},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:o,h:r},sourceSize:{w:o,h:r}}}),{image:"",atlas:{frames:u,meta:{image:"",size:{w:s,h:c},scale:1}}}}function Zr(e,t,n,i,o){const r=o||Math.ceil(Math.sqrt(i)),a={};for(let c=0;c<i;c++){const u=c%r,f=Math.floor(c/r);a[`frame_${c}`]={frame:{x:u*t,y:f*n,w:t,h:n},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:t,h:n},sourceSize:{w:t,h:n}}}const s=Math.ceil(i/r);return{frames:a,meta:{image:e,size:{w:r*t,h:s*n},scale:1}}}function ea(e){const t=[],n=[];e.id||t.push("Project is missing an ID"),(!e.assets||e.assets.length===0)&&n.push("Project has no assets"),!e.sprites&&!e.entities&&t.push("Project has no sprites or entities to import");for(const i of e.sprites||[])e.assets.find(r=>r.id===i.assetId)||n.push(`Sprite "${i.name}" references missing asset: ${i.assetId}`);for(const i of e.sprites||[])(!i.animations||Object.keys(i.animations).length===0)&&n.push(`Sprite "${i.name}" has no animations`);return{valid:t.length===0,errors:t,warnings:n}}function ta(e,t){var s,c,u;const{flattenScenes:n=!1,includeCharacterSprites:i=!0,includeDialogue:o=!0,slideDuration:r=5e3}=t||{},a=[];if(n)for(const f of e.scenes){const h=na(f);for(let y=0;y<h.length;y++){const p=h[y],m=h[y+1]??f.duration,g=ia(e,f,p,m-p,i,o);a.push(g)}}else for(const f of e.scenes){const h=oa(e,f,i,o);a.push(h)}return{version:"1.0.0",id:e.id+"_presentation",title:e.title,description:(s=e.metadata)==null?void 0:s.description,author:(c=e.metadata)==null?void 0:c.author,createdAt:((u=e.metadata)==null?void 0:u.createdAt)||new Date().toISOString(),updatedAt:new Date().toISOString(),layout:{width:e.stageSize.width,height:e.stageSize.height,aspectRatio:`${e.stageSize.width}:${e.stageSize.height}`},slides:a,metadata:{sourcePuppetShow:e.id,convertedAt:new Date().toISOString()}}}function na(e){const t=new Set([0]);for(const n of e.timeline)for(const i of n.keyframes)t.add(i.time),"duration"in i&&typeof i.duration=="number"&&t.add(i.time+i.duration);return Array.from(t).sort((n,i)=>n-i)}function ia(e,t,n,i,o,r){var s,c;const a=[];if(o)for(const u of t.cast){const f=e.characters.find(p=>p.id===u.characterId);if(!f)continue;const h=ra(t,u.instanceId,n)||u.position,y=aa(t,u.instanceId,n);a.push({id:`char_${u.instanceId}_${n}`,type:"image",position:{x:h.x,y:h.y,rotation:(y==null?void 0:y.rotation)??u.rotation},size:{width:((s=f.visual.atlas)==null?void 0:s.meta.size.w)??100,height:((c=f.visual.atlas)==null?void 0:c.meta.size.h)??100},content:{src:f.visual.spriteSheet,alt:f.name},style:{opacity:(y==null?void 0:y.opacity)??u.opacity??1,transform:(y==null?void 0:y.scale)!==void 0?`scale(${u.flipX?-y.scale:y.scale}, ${y.scale})`:void 0},zIndex:u.zIndex})}if(r){const u=sa(t,n);if(u){const f=e.characters.find(h=>{const y=t.timeline.find(p=>p.type==="dialogue");return(y==null?void 0:y.targetId)===h.id});a.push({id:`dialogue_${n}`,type:"text",position:{x:e.stageSize.width/2,y:e.stageSize.height-100},size:{width:e.stageSize.width*.9,height:80},content:{text:f?`${f.name}: ${u.text}`:u.text},style:{backgroundColor:"rgba(0, 0, 0, 0.85)",borderRadius:12},zIndex:1e3})}}return{id:`slide_${t.id}_${n}`,title:t.title,elements:a,background:Pt(t.background),transition:t.transition?{type:t.transition.type,duration:t.transition.duration}:void 0,duration:i}}function oa(e,t,n,i){var r,a;const o=[];if(n)for(const s of t.cast){const c=e.characters.find(u=>u.id===s.characterId);c&&o.push({id:`char_${s.instanceId}`,type:"image",position:{x:s.position.x,y:s.position.y,rotation:s.rotation},size:{width:((r=c.visual.atlas)==null?void 0:r.meta.size.w)??100,height:((a=c.visual.atlas)==null?void 0:a.meta.size.h)??100},content:{src:c.visual.spriteSheet,alt:c.name},style:{opacity:s.opacity??1},animation:la(t,s.instanceId),zIndex:s.zIndex})}for(const s of t.scenery){const c=e.props.find(u=>u.id===s.propId);c&&o.push({id:`prop_${s.instanceId}`,type:"image",position:{x:s.position.x,y:s.position.y,rotation:s.rotation},size:{width:c.width,height:c.height},content:{src:c.asset,alt:c.name},style:{opacity:s.opacity??1},zIndex:s.zIndex})}return i&&ca(t).forEach((c,u)=>{const f=e.characters.find(h=>h.id===c.speakerId);o.push({id:`dialogue_${u}`,type:"text",position:{x:e.stageSize.width/2,y:e.stageSize.height-100},size:{width:e.stageSize.width*.9,height:80},content:{text:f?`${f.name}: ${c.text}`:c.text},style:{backgroundColor:"rgba(0, 0, 0, 0.85)",borderRadius:12},animation:{enter:{type:"fadeIn",duration:300,delay:c.time},exit:{type:"fadeOut",duration:300,delay:c.time+c.duration-300}},zIndex:1e3+u})}),{id:`slide_${t.id}`,title:t.title,elements:o,background:Pt(t.background),transition:t.transition?{type:t.transition.type,duration:t.transition.duration}:void 0,duration:t.duration,notes:`Converted from Puppet Show scene: ${t.title}`}}function ra(e,t,n){const i=e.timeline.find(a=>a.type==="transform"&&a.targetId===t);if(!i)return null;const o=i.keyframes;let r=null;for(const a of o){const s=a.value;a.time<=n&&s.position&&(r=s)}return(r==null?void 0:r.position)??null}function aa(e,t,n){const i=e.timeline.find(a=>a.type==="transform"&&a.targetId===t);if(!i)return null;const o=i.keyframes;let r=null;for(const a of o)a.time<=n&&(r=a.value);return r?{scale:r.scale,rotation:r.rotation,opacity:r.opacity}:null}function sa(e,t){for(const n of e.timeline)if(n.type==="dialogue")for(const i of n.keyframes){const o=i.value;if(t>=i.time&&t<i.time+(i.duration??0))return{text:o.text,speakerId:n.targetId}}return null}function ca(e){const t=[];for(const n of e.timeline)if(n.type==="dialogue")for(const i of n.keyframes){const o=i.value;t.push({text:o.text,speakerId:n.targetId,time:i.time,duration:i.duration??0})}return t.sort((n,i)=>n.time-i.time)}function Pt(e){var t,n;switch(e.type){case"solid":return{type:"solid",color:e.color};case"gradient":return e.gradient?{type:"gradient",gradient:e.gradient}:{type:"solid",color:"#000000"};case"image":return{type:"image",image:e.image};case"video":return{type:"video",video:e.video};case"parallax":return{type:"image",image:(n=(t=e.parallaxLayers)==null?void 0:t[0])==null?void 0:n.image};default:return{type:"solid",color:"#000000"}}}function la(e,t){const n=e.timeline.find(o=>o.type==="transform"&&o.targetId===t);return!n||n.keyframes.length===0?void 0:{timeline:n.keyframes.map(o=>{var a,s;const r=o.value;return{time:o.time,properties:{x:(a=r.position)==null?void 0:a.x,y:(s=r.position)==null?void 0:s.y,scale:r.scale,rotation:r.rotation,opacity:r.opacity},easing:o.easing}})}}function da(e,t){const n=[],i=[],o=[],r=new Map;for(const a of e.slides)for(const s of a.elements)s.type==="image"&&s.content.src&&(r.has(s.content.src)||r.set(s.content.src,new Set),r.get(s.content.src).add(s));if(t!=null&&t.createCharacterFromImages){for(const[a,s]of r)if(s.size>=2){const c=Array.from(s)[0],u=`char_${n.length}`;n.push({id:u,name:c.content.alt||`Character ${n.length+1}`,type:"sprite",visual:{type:"sprite",spriteSheet:a,atlas:{frames:{default:{frame:{x:0,y:0,w:c.size.width,h:c.size.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:c.size.width,h:c.size.height},sourceSize:{w:c.size.width,h:c.size.height}}},meta:{image:a,size:{w:c.size.width,h:c.size.height},scale:1}},width:c.size.width,height:c.size.height},anchor:{x:.5,y:1},animations:[{id:"idle",name:"Idle",category:"idle",frames:[{frameId:"default",duration:1e3,offset:{x:0,y:0}}],fps:1,loop:!0,duration:1e3}],expressions:[],defaultScale:1})}}for(const[a,s]of r)if(s.size<2||!(t!=null&&t.createCharacterFromImages)){const c=Array.from(s)[0];i.push({id:`prop_${i.length}`,name:c.content.alt||`Prop ${i.length+1}`,type:"image",asset:a,width:c.size.width,height:c.size.height,anchor:{x:.5,y:.5}})}for(const a of e.slides){const s=ua(a,e,n,i);o.push(s)}return{version:"1.0",id:e.id+"_puppetshow",title:e.title,stageSize:{width:e.layout.width,height:e.layout.height},scenes:o,characters:n,props:i,audioTracks:[],settings:{defaultFps:24,allowSpeedControl:!0,allowSeek:!0,autoPlay:!1,showControls:!0,loop:!1},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),duration:e.slides.reduce((a,s)=>a+(s.duration??5e3),0),sceneCount:o.length,characterCount:n.length,sourcePresentation:e.id,convertedAt:new Date().toISOString()}}}function ua(e,t,n,i){var u,f,h,y;const o=[],r=[],a=[];let s=0,c=0;for(const p of e.elements)if(p.type==="image"&&p.content.src){const m=n.find(g=>g.visual.spriteSheet===p.content.src);if(m){const g=`${m.id}_instance_${s++}`;if(o.push({instanceId:g,characterId:m.id,position:{x:p.position.x,y:p.position.y},scale:1,rotation:p.position.rotation??0,zIndex:p.zIndex??s,opacity:((u=p.style)==null?void 0:u.opacity)??1,flipX:!1}),(f=p.animation)!=null&&f.timeline&&p.animation.timeline.length>1){const b={id:`transform_${g}`,type:"transform",targetId:g,keyframes:p.animation.timeline.map(S=>{const x=S.properties;return{time:S.time,easing:S.easing??"easeInOut",value:{type:"transform",position:x.x!==void 0?{x:x.x,y:x.y??0}:void 0,scale:x.scale,rotation:x.rotation,opacity:x.opacity}}})};a.push(b)}}else{const g=i.find(b=>b.asset===p.content.src);g&&r.push({instanceId:`${g.id}_instance_${c++}`,propId:g.id,position:{x:p.position.x,y:p.position.y},scale:1,rotation:p.position.rotation??0,zIndex:p.zIndex??c,opacity:((h=p.style)==null?void 0:h.opacity)??1})}}else if(p.type==="text"&&p.content.text&&p.position.y>t.layout.height*.7){const g=((y=o[0])==null?void 0:y.characterId)??"narrator",b=a.find(x=>x.type==="dialogue"&&x.targetId===g),S={time:0,duration:e.duration??3e3,easing:"linear",value:{type:"dialogue",text:p.content.text}};b?b.keyframes.push(S):a.push({id:`dialogue_${g}`,type:"dialogue",targetId:g,keyframes:[S]})}return{id:e.id,title:e.title||"Untitled Scene",duration:e.duration??5e3,background:e.background?{type:e.background.type,color:e.background.color,gradient:e.background.gradient,image:e.background.image,video:e.background.video}:{type:"solid",color:"#000000"},cast:o,scenery:r,timeline:a,camera:{position:{x:t.layout.width/2,y:t.layout.height/2},zoom:1,rotation:0},transition:e.transition?{type:(()=>{const p=e.transition.type;return p==="fade"?"fade":p==="zoom"?"zoom":p==="slide"?"slideLeft":"cut"})(),duration:e.transition.duration??500}:void 0}}function pa(e){const t=[],n=[];e.id||t.push("Document missing id"),e.title||n.push("Document missing title"),e.version||n.push("Document missing version"),e.stageSize||t.push("Document missing stageSize"),(!e.scenes||e.scenes.length===0)&&t.push("Document has no scenes");const i=new Set(e.characters.map(r=>r.id));for(const r of e.scenes)for(const a of r.cast)i.has(a.characterId)||t.push(`Scene "${r.id}" references unknown character: ${a.characterId}`);const o=new Set(e.props.map(r=>r.id));for(const r of e.scenes)for(const a of r.scenery)o.has(a.propId)||t.push(`Scene "${r.id}" references unknown prop: ${a.propId}`);return{valid:t.length===0,errors:t,warnings:n}}function fa(e,t){if(e.length===0)throw new Error("Cannot merge empty array of puppet shows");const n={version:"1.0",id:`merged_${Date.now()}`,title:e.map(r=>r.title).join(" + "),stageSize:e[0].stageSize,scenes:[],characters:[],props:[],audioTracks:[],settings:e[0].settings,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),duration:e.reduce((r,a)=>{var s;return r+(((s=a.metadata)==null?void 0:s.duration)??0)},0),sceneCount:0,characterCount:0,mergedFrom:e.map(r=>r.id),mergedAt:new Date().toISOString()}},i=new Map,o=new Map;for(const r of e){for(const a of r.characters){if(t!=null&&t.deduplicateCharacters){const c=n.characters.find(u=>u.name===a.name);if(c){i.set(a.id,c.id);continue}}const s=`${r.id}_${a.id}`;i.set(a.id,s),n.characters.push({...a,id:s})}for(const a of r.props){const s=`${r.id}_${a.id}`;o.set(a.id,s),n.props.push({...a,id:s})}for(const a of r.scenes){const s={...a,id:`${r.id}_${a.id}`,cast:a.cast.map(c=>({...c,instanceId:`${r.id}_${c.instanceId}`,characterId:i.get(c.characterId)||c.characterId})),scenery:a.scenery.map(c=>({...c,instanceId:`${r.id}_${c.instanceId}`,propId:o.get(c.propId)||c.propId})),timeline:a.timeline.map(c=>({...c,id:`${r.id}_${c.id}`,targetId:i.get(c.targetId)||o.get(c.targetId)||`${r.id}_${c.targetId}`}))};n.scenes.push(s)}for(const a of r.audioTracks||[])n.audioTracks.push({...a,id:`${r.id}_${a.id}`})}return n}const Nt={good:"#4caf50",warning:"#ff9800",critical:"#f44336",info:"#2196f3",neutral:"#9e9e9e",background:"#fff",text:"#212121",textMuted:"#757575"};function ma(e){const t={...Nt,...e.colorScheme};return{id:e.id,title:e.title,type:"dashboard",layout:{columns:e.columns,rows:e.rows,gap:e.gap??16,padding:e.padding??24},widgets:e.widgets.map(n=>({...n,colSpan:n.colSpan??1,rowSpan:n.rowSpan??1,colors:{...t,...n.colors},animation:{countUp:!0,countUpDuration:1e3,entrance:"fadeIn",entranceDelay:0,...n.animation}})),dataSources:e.dataSources??[],refreshInterval:e.refreshInterval??3e4,colorScheme:t,background:e.background??t.background,showLastUpdated:e.showLastUpdated??!0,autoCycle:e.autoCycle??!1,autoCycleInterval:e.autoCycleInterval??5e3,lastUpdated:new Date().toISOString()}}function ha(e,t,n=!0){var o;if(!t||t.length===0)return"neutral";const i=[...t].sort((r,a)=>n?a.value-r.value:r.value-a.value);for(const r of i)if(n){if(e>=r.value)return r.status}else if(e<=r.value)return r.status;return((o=i[i.length-1])==null?void 0:o.status)??"neutral"}function ya(e,t){return t==null?"unknown":e>t?"up":e<t?"down":"flat"}function ga(e,t){if(typeof e=="string")return e;const{unit:n="",precision:i=0,compact:o=!1,locale:r="en-US"}=t??{};let a;return o&&Math.abs(e)>=1e3?a=new Intl.NumberFormat(r,{notation:"compact",maximumFractionDigits:1}).format(e):a=e.toLocaleString(r,{minimumFractionDigits:i,maximumFractionDigits:i}),n?`${a}${n}`:a}function Rt(e){return{id:"revenue",title:"Revenue",type:"number-tile",column:1,row:1,unit:"$",precision:0,icon:"dollar-sign",thresholds:[{value:1e6,status:"good"},{value:5e5,status:"warning"},{value:0,status:"critical"}],...e}}function qt(e){return{id:"customers",title:"Customers",type:"number-tile",column:2,row:1,icon:"users",thresholds:[{value:1e4,status:"good"},{value:5e3,status:"warning"},{value:0,status:"critical"}],...e}}function xa(e){return{id:"percentage-gauge",title:"Completion",type:"gauge",column:1,row:1,unit:"%",precision:1,gaugeConfig:{min:0,max:100,style:"semicircle",showNeedle:!0,showTicks:!0,tickCount:5,thickness:20},thresholds:[{value:80,status:"good"},{value:50,status:"warning"},{value:0,status:"critical"}],...e}}function ba(e){return{id:"sparkline-trend",title:"Weekly Trend",type:"sparkline",column:1,row:1,sparklineData:[],...e}}function va(e){return{id:"traffic-light",title:"System Status",type:"traffic-light",column:1,row:1,...e}}function Sa(e){return{id:"comparison",title:"Budget vs Actual",type:"comparison",column:1,row:1,targetValue:1e5,value:85e3,unit:"$",...e}}function wa(){return{id:"executive-dashboard",title:"Executive Summary",columns:4,rows:3,widgets:[Rt({column:1,row:1,colSpan:1}),qt({column:2,row:1,colSpan:1}),{id:"orders",title:"Orders",type:"number-tile",column:3,row:1,icon:"shopping-cart"},{id:"satisfaction",title:"CSAT Score",type:"gauge",column:4,row:1,unit:"%",gaugeConfig:{min:0,max:100,style:"semicircle"}},{id:"revenue-trend",title:"Revenue Trend",type:"sparkline",column:1,row:2,colSpan:2},{id:"top-products",title:"Top Products",type:"mini-bar",column:3,row:2,colSpan:2,chartData:[{label:"Product A",value:45e3},{label:"Product B",value:38e3},{label:"Product C",value:32e3},{label:"Product D",value:28e3},{label:"Product E",value:22e3}]},{id:"regional-breakdown",title:"Regional Sales",type:"mini-pie",column:1,row:3,colSpan:2,chartData:[{label:"North",value:35},{label:"South",value:25},{label:"East",value:22},{label:"West",value:18}]},{id:"budget-status",title:"Budget Status",type:"bullet-chart",column:3,row:3,colSpan:2,value:72e3,targetValue:1e5,unit:"$"}]}}function ka(){return{id:"operational-dashboard",title:"Operational Metrics",columns:3,rows:2,widgets:[{id:"uptime",title:"System Uptime",type:"gauge",column:1,row:1,value:99.9,unit:"%",gaugeConfig:{min:0,max:100,style:"full-circle"},thresholds:[{value:99.5,status:"good"},{value:99,status:"warning"},{value:0,status:"critical"}]},{id:"response-time",title:"Avg Response Time",type:"number-tile",column:2,row:1,value:145,unit:"ms",icon:"clock",thresholds:[{value:0,status:"good"},{value:200,status:"warning"},{value:500,status:"critical"}]},{id:"error-rate",title:"Error Rate",type:"traffic-light",column:3,row:1,value:.5,unit:"%"},{id:"throughput",title:"Requests/sec",type:"sparkline",column:1,row:2,colSpan:2,sparklineData:[120,135,128,145,152,148,160,155,170,165]},{id:"incidents",title:"Open Incidents",type:"number-tile",column:3,row:2,value:3,icon:"alert-triangle",thresholds:[{value:0,status:"good"},{value:5,status:"warning"},{value:10,status:"critical"}]}]}}function Ia(e){var t,n,i;return{id:e.id,type:"datagrid",title:e.title,subtitle:e.subtitle,config:{...e,columns:e.columns.map(o=>({width:"auto",align:"left",dataType:"string",sortable:!0,filterable:!1,...o})),interactiveSort:e.interactiveSort??!0,interactiveFilter:e.interactiveFilter??!1,enableSelection:e.enableSelection??!0,showRowNumbers:e.showRowNumbers??!1,showColumnBorders:e.showColumnBorders??!1,stripedRows:e.stripedRows??!0,pageSize:e.pageSize??10,animation:{rowEntrance:"fadeIn",staggerDelay:50,duration:300,progressiveReveal:!1,revealBatchSize:5,...e.animation},style:{headerBackground:"#f5f5f5",headerColor:"#212121",rowBackground:"#fff",rowBackgroundAlt:"#fafafa",cellColor:"#424242",borderColor:"#e0e0e0",fontSize:14,headerFontSize:14,rowHeight:48,cellPadding:12,borderRadius:8,...e.style}},state:{currentSort:e.defaultSort??[],currentFilters:e.defaultFilters??[],selectedCells:[],currentPage:0,revealedRowCount:(t=e.animation)!=null&&t.progressiveReveal?e.animation.revealBatchSize??5:((n=e.data)==null?void 0:n.length)??0,isFullyRevealed:!((i=e.animation)!=null&&i.progressiveReveal),lastUpdated:new Date().toISOString()}}}function Ca(e,t){return t.length===0?e:[...e].sort((n,i)=>{for(const o of t){const r=n[o.field],a=i[o.field];let s=0;if(r==null&&a==null?s=0:r==null?s=1:a==null?s=-1:typeof r=="number"&&typeof a=="number"?s=r-a:s=String(r).localeCompare(String(a)),s!==0)return o.direction==="desc"?-s:s}return 0})}function Ma(e,t){return t.length===0?e:e.filter(n=>t.every(i=>{const o=n[i.field],r=i.value;switch(i.operator){case"equals":return o===r;case"notEquals":return o!==r;case"contains":return String(o).toLowerCase().includes(String(r).toLowerCase());case"startsWith":return String(o).toLowerCase().startsWith(String(r).toLowerCase());case"endsWith":return String(o).toLowerCase().endsWith(String(r).toLowerCase());case"greaterThan":return Number(o)>Number(r);case"lessThan":return Number(o)<Number(r);case"between":return Number(o)>=Number(r)&&Number(o)<=Number(i.valueTo);case"in":return Array.isArray(r)&&r.includes(o);default:return!0}}))}function za(e,t){const n={};for(const i of t.columns){const o=e.map(r=>r[i.columnId]).filter(r=>r!=null);switch(i.aggregation){case"sum":n[i.columnId]=o.reduce((r,a)=>r+Number(a),0);break;case"avg":n[i.columnId]=o.length>0?o.reduce((r,a)=>r+Number(a),0)/o.length:0;break;case"min":n[i.columnId]=Math.min(...o.map(Number));break;case"max":n[i.columnId]=Math.max(...o.map(Number));break;case"count":n[i.columnId]=o.length;break;case"custom":n[i.columnId]=i.customValue??"";break}}return n}function Aa(e,t,n="en-US"){if(e==null)return"";switch(t.dataType){case"number":return Number(e).toLocaleString(n,{minimumFractionDigits:t.precision??0,maximumFractionDigits:t.precision??0});case"currency":return Number(e).toLocaleString(n,{style:"currency",currency:t.currency??"USD"});case"percent":return Number(e).toLocaleString(n,{style:"percent",minimumFractionDigits:t.precision??0});case"date":return new Date(String(e)).toLocaleDateString(n);case"boolean":return e?"✓":"✗";default:return String(e)}}function _a(e,t){if(!t)return null;for(const n of t){const{operator:i,value:o,valueTo:r}=n.condition;let a=!1;switch(i){case"equals":a=e===o;break;case"notEquals":a=e!==o;break;case"greaterThan":a=Number(e)>Number(o);break;case"lessThan":a=Number(e)<Number(o);break;case"between":a=Number(e)>=Number(o)&&Number(e)<=Number(r);break;case"contains":a=String(e).toLowerCase().includes(String(o).toLowerCase());break;case"isEmpty":a=e==null||e==="";break}if(a)return n.style}return null}function Ta(e){return{id:"sales-grid",title:"Sales Report",subtitle:"Q4 2025 Performance",columns:[{id:"region",header:"Region",field:"region",width:150},{id:"product",header:"Product",field:"product",width:200},{id:"units",header:"Units Sold",field:"units",dataType:"number",align:"right"},{id:"revenue",header:"Revenue",field:"revenue",dataType:"currency",align:"right",conditionalFormat:[{condition:{operator:"greaterThan",value:1e5},style:{backgroundColor:"#e8f5e9",color:"#2e7d32"}},{condition:{operator:"lessThan",value:5e4},style:{backgroundColor:"#ffebee",color:"#c62828"}}]},{id:"growth",header:"Growth %",field:"growth",dataType:"percent",align:"right",precision:1}],data:e??[{region:"North",product:"Widget Pro",units:1250,revenue:125e3,growth:.15},{region:"South",product:"Widget Pro",units:980,revenue:98e3,growth:.08},{region:"East",product:"Gadget Plus",units:1500,revenue:18e4,growth:.22},{region:"West",product:"Gadget Plus",units:1100,revenue:132e3,growth:.12}],summaryRow:{enabled:!0,columns:[{columnId:"units",aggregation:"sum",label:"Total"},{columnId:"revenue",aggregation:"sum"},{columnId:"growth",aggregation:"avg"}]},animation:{rowEntrance:"slideInLeft",staggerDelay:100}}}function $a(e){return{id:"employee-grid",title:"Team Directory",columns:[{id:"name",header:"Name",field:"name",width:180},{id:"role",header:"Role",field:"role",width:150},{id:"department",header:"Department",field:"department",width:120,filterable:!0},{id:"email",header:"Email",field:"email",width:200},{id:"status",header:"Status",field:"status",cellRenderer:"badge",width:100}],data:e??[],showRowNumbers:!0,interactiveFilter:!0}}function Ea(e){var n;const t={};return(n=e.parameters)==null||n.forEach(i=>{i.defaultValue!==void 0&&(t[i.name]=i.defaultValue)}),{id:e.id,type:"query",title:e.title,subtitle:e.subtitle,config:{...e,autoExecute:e.autoExecute??!1,showQueryEditor:e.showQueryEditor??!0,allowQueryEdit:e.allowQueryEdit??!1,showExecutionStats:e.showExecutionStats??!0,cacheDuration:e.cacheDuration??0,style:{editorTheme:"dark",editorFontSize:14,resultBackground:"#fff",accentColor:"#1976d2",borderRadius:8,...e.style}},state:{currentQuery:e.query,currentParameters:t,result:null,isExecuting:!1,lastExecutedAt:null,error:null,visualizationMode:e.visualization.mode,history:[]}}}function Pa(e,t){const n=[];switch(t){case"sql":{const i=e.matchAll(/[@:](\w+)/g);for(const o of i)n.includes(o[1])||n.push(o[1]);break}case"odata":{const i=e.matchAll(/\{(\w+)\}/g);for(const o of i)n.includes(o[1])||n.push(o[1]);break}case"graphql":{const i=e.matchAll(/\$(\w+)/g);for(const o of i)n.includes(o[1])||n.push(o[1]);break}case"kql":{const i=e.matchAll(/\{(\w+)\}/g);for(const o of i)n.includes(o[1])||n.push(o[1]);break}}return n}function Na(e,t,n){let i=e;for(const[o,r]of Object.entries(n)){const a=Ra(r);switch(t){case"sql":i=i.replace(new RegExp(`@${o}\\b`,"g"),a),i=i.replace(new RegExp(`:${o}\\b`,"g"),a);break;case"odata":case"kql":i=i.replace(new RegExp(`\\{${o}\\}`,"g"),a);break}}return i}function Ra(e){return e==null?"NULL":typeof e=="number"?String(e):typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof Date?`'${e.toISOString()}'`:`'${String(e).replace(/'/g,"''")}'`}function qa(e,t){const n={};for(const i of e){const o=t[i.name];if(i.required&&(o==null||o==="")){n[i.name]=`${i.label} is required`;continue}if(o!=null&&i.validation){if(i.type==="number"){const r=Number(o);i.validation.min!==void 0&&r<i.validation.min&&(n[i.name]=i.validation.message??`Minimum value is ${i.validation.min}`),i.validation.max!==void 0&&r>i.validation.max&&(n[i.name]=i.validation.message??`Maximum value is ${i.validation.max}`)}i.type==="string"&&i.validation.pattern&&(new RegExp(i.validation.pattern).test(String(o))||(n[i.name]=i.validation.message??"Invalid format"))}}return{valid:Object.keys(n).length===0,errors:n}}function Da(e){if(!e.success||e.rowCount===0)return"table";const t=e.columns.filter(i=>i.type==="number"),n=e.columns.filter(i=>i.type==="date");return e.rowCount===1&&t.length>=3?"metrics":n.length===1&&t.length>=1&&e.rowCount>3?"line-chart":t.length===1&&e.rowCount<=15?"bar-chart":t.length===1&&e.rowCount<=8?"pie-chart":"table"}function Oa(e,t){var s,c,u;if(!e.success||e.columns.length===0)return;const n=e.columns.filter(f=>f.type==="number"),i=e.columns.filter(f=>f.type!=="number"),r=((s=e.columns.filter(f=>f.type==="date")[0])==null?void 0:s.name)??((c=i[0])==null?void 0:c.name)??e.columns[0].name,a=n.length>0?n.length===1?n[0].name:n.slice(0,3).map(f=>f.name):(u=e.columns[1])==null?void 0:u.name;return{xAxis:r,yAxis:a,showLegend:Array.isArray(a)&&a.length>1,showGrid:!0,colorScheme:["#1976d2","#43a047","#fb8c00","#e53935","#8e24aa"]}}function ja(){return{id:"sales-query",title:"Sales Analysis",subtitle:"Query live sales data",language:"sql",query:`SELECT
133
+ `,opacity:r,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`};return e.type==="image"||e.type==="sprite"?d.createElement("img",{src:e.asset,style:{...a,width:e.width,height:e.height,pointerEvents:"none"},alt:e.name}):e.type==="vector"?d.createElement("div",{style:a,dangerouslySetInnerHTML:{__html:e.asset}}):e.type==="text"?d.createElement("div",{style:a},e.asset):d.createElement("div",{style:a})}function wt({text:e,speakerName:t,style:n={},targetPosition:i,visible:o,typewriterProgress:r=1}){if(!o)return null;const{position:a="bottom",backgroundColor:s="rgba(0, 0, 0, 0.85)",textColor:c="#fff",fontSize:u=18,maxWidth:f=600}=n,h=e.slice(0,Math.floor(e.length*r)),y={position:"absolute",maxWidth:f,padding:"16px 24px",backgroundColor:s,color:c,fontSize:u,borderRadius:12,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.3)",zIndex:1e3};switch(a){case"bottom":Object.assign(y,{bottom:20,left:"50%",transform:"translateX(-50%)",width:"90%"});break;case"top":Object.assign(y,{top:20,left:"50%",transform:"translateX(-50%)",width:"90%"});break;case"center":Object.assign(y,{top:"50%",left:"50%",transform:"translate(-50%, -50%)"});break;case"bubble":i&&Object.assign(y,{left:i.x,bottom:i.y+20,transform:"translateX(-50%)"});break}return d.createElement("div",{style:y},t&&d.createElement("div",{style:{fontWeight:"bold",marginBottom:8,color:"#60a5fa"}},t),d.createElement("div",null,h))}function Dr(e,t,n){const[i,o]=d.useState({offsetX:0,offsetY:0}),r=d.useRef(null);return d.useEffect(()=>{if(!n){o({offsetX:0,offsetY:0});return}r.current=performance.now();let a;const s=c=>{const u=c-r.current;if(u>=t){o({offsetX:0,offsetY:0});return}const h=1-u/t,y=(Math.random()-.5)*2*e*h,p=(Math.random()-.5)*2*e*h;o({offsetX:y,offsetY:p}),a=requestAnimationFrame(s)};return a=requestAnimationFrame(s),()=>{cancelAnimationFrame(a)}},[n,e,t]),i}const de={linear:e=>e,easeIn:e=>e*e,easeOut:e=>e*(2-e),easeInOut:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInElastic:e=>e===0||e===1?e:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI),easeOutElastic:e=>e===0||e===1?e:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1,easeInOutElastic:e=>e===0||e===1?e:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1),easeInBounce:e=>1-de.easeOutBounce(1-e),easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,easeInOutBounce:e=>e<.5?de.easeInBounce(e*2)*.5:de.easeOutBounce(e*2-1)*.5+.5,step:e=>Math.round(e)};function kt(e){return de[e]||de.linear}function re(e,t,n){return e+(t-e)*n}function Me(e,t,n){return{x:re(e.x,t.x,n),y:re(e.y,t.y,n)}}class It{constructor(t){this.currentTime=0,this.scene=t.scene,this.characterDefs=new Map(t.characterDefs.map(n=>[n.id,n])),this.typewriterSpeed=t.typewriterSpeed||30,this.onAudioCommand=t.onAudioCommand}evaluate(t){this.currentTime=t;const n=this.evaluateAllCharacters(t),i=this.evaluateCamera(t),o=this.evaluateDialogue(t),r=this.evaluateEffects(t),a=this.evaluateAudio(t);return{characterStates:n,camera:i,activeDialogue:o,activeEffects:r,audioCommands:a}}getDuration(){return this.scene.duration}findSurroundingKeyframes(t,n){const i=t.keyframes;if(i.length===0)return{prev:null,next:null,progress:0};let o=-1;for(let y=0;y<i.length&&i[y].time<=n;y++)o=y;if(o===-1)return{prev:null,next:i[0],progress:0};const r=i[o],a=i[o+1]||null;if(!a)return{prev:r,next:null,progress:1};const s=a.time-r.time,c=n-r.time,u=s>0?c/s:0,h=kt(r.easing||"linear")(Math.min(1,Math.max(0,u)));return{prev:r,next:a,progress:h}}evaluateAllCharacters(t){const n=new Map;for(const i of this.scene.cast){const o=this.evaluateCharacter(i.instanceId,t);n.set(i.instanceId,o)}return n}evaluateCharacter(t,n){var a;const i=this.scene.cast.find(s=>s.instanceId===t);if(!i)return this.createDefaultCharacterState();const o=this.characterDefs.get(i.characterId);let r={instanceId:t,characterId:i.characterId,position:{...i.position},scale:i.scale,rotation:i.rotation,opacity:i.opacity??1,flipX:i.flipX??!1,visible:!0,currentAnimation:i.initialAnimation||(((a=o==null?void 0:o.animations[0])==null?void 0:a.id)??""),animationFrame:0,animationStartTime:0,currentExpression:i.initialExpression??""};for(const s of this.scene.timeline)if(s.targetId===t)switch(s.type){case"animation":r=this.applyAnimationTrack(s,r,n);break;case"transform":r=this.applyTransformTrack(s,r,n);break;case"expression":r=this.applyExpressionTrack(s,r,n);break}if(o&&r.currentAnimation){const s=o.animations.find(c=>c.id===r.currentAnimation);if(s){const c=(n-r.animationStartTime)%(s.duration||s.frames.length/s.fps*1e3),u=Math.floor(c/1e3*s.fps)%s.frames.length;r.animationFrame=u}}return r}createDefaultCharacterState(){return{instanceId:"",characterId:"",position:{x:0,y:0},scale:1,rotation:0,opacity:1,flipX:!1,visible:!1,currentAnimation:"",animationFrame:0,animationStartTime:0,currentExpression:""}}applyAnimationTrack(t,n,i){const{prev:o}=this.findSurroundingKeyframes(t,i);if(o){const r=o.value;return{...n,currentAnimation:r.animationId,animationStartTime:o.time}}return n}applyTransformTrack(t,n,i){const{prev:o,next:r,progress:a}=this.findSurroundingKeyframes(t,i);if(!o)return n;const s=o.value,c=r?r.value:null;return c?{...n,position:s.position&&c.position?Me(s.position,c.position,a):s.position??n.position,scale:s.scale!==void 0&&c.scale!==void 0?re(s.scale,c.scale,a):s.scale??n.scale,rotation:s.rotation!==void 0&&c.rotation!==void 0?re(s.rotation,c.rotation,a):s.rotation??n.rotation,opacity:s.opacity!==void 0&&c.opacity!==void 0?re(s.opacity,c.opacity,a):s.opacity??n.opacity}:{...n,position:s.position??n.position,scale:s.scale??n.scale,rotation:s.rotation??n.rotation,opacity:s.opacity??n.opacity}}applyExpressionTrack(t,n,i){const{prev:o}=this.findSurroundingKeyframes(t,i);if(o){const r=o.value;return{...n,currentExpression:r.expressionId}}return n}evaluateCamera(t){let n=this.scene.camera?{...this.scene.camera}:{position:{x:640,y:360},zoom:1,rotation:0};for(const i of this.scene.timeline){if(i.type!=="camera")continue;const{prev:o,next:r,progress:a}=this.findSurroundingKeyframes(i,t);if(!o)continue;const s=o.value,c=r?r.value:null;c?n={position:s.position&&c.position?Me(s.position,c.position,a):s.position??n.position,zoom:s.zoom!==void 0&&c.zoom!==void 0?re(s.zoom,c.zoom,a):s.zoom??n.zoom,rotation:s.rotation!==void 0&&c.rotation!==void 0?re(s.rotation,c.rotation,a):s.rotation??n.rotation}:n={position:s.position??n.position,zoom:s.zoom??n.zoom,rotation:s.rotation??n.rotation}}return n}evaluateDialogue(t){for(const n of this.scene.timeline){if(n.type!=="dialogue")continue;const{prev:i}=this.findSurroundingKeyframes(n,t);if(i){const o=i.value,r=i.time+(i.duration??0);if(t>=i.time&&t<r){const a=t-i.time,s=o.text.length/this.typewriterSpeed*1e3,c=Math.min(1,a/s);return{text:o.text,speakerId:n.targetId,typewriterProgress:c}}}}return null}evaluateEffects(t){const n=[];for(const i of this.scene.timeline)if(i.type==="effect")for(const o of i.keyframes){const r=o.value,a=o.time+(o.duration??0);if(t>=o.time&&t<a){const s=o.duration?(t-o.time)/o.duration:1;n.push({effectId:i.id+"_"+o.time,type:r.effectType,params:r.params,startTime:o.time,duration:o.duration??0,progress:s})}}return n}evaluateAudio(t){const n=[];for(const i of this.scene.timeline)if(i.type==="audio")for(const o of i.keyframes){const r=o.value;Math.abs(t-o.time)<50&&n.push({trackId:i.targetId,command:r.action,time:t})}return n}}class Or{constructor(t,n,i){this.track={id:i||`track_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:t,targetId:n,keyframes:[]}}addAnimationKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:(i==null?void 0:i.easing)??"linear",value:{type:"animation",animationId:n,speed:(i==null?void 0:i.speed)??1}}),this}addTransformKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:i??"easeInOut",value:{type:"transform",...n}}),this}addExpressionKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:(i==null?void 0:i.easing)??"easeOut",duration:(i==null?void 0:i.transition)??200,value:{type:"expression",expressionId:n}}),this}addDialogueKeyframe(t,n,i,o){return this.track.keyframes.push({time:t,duration:i,easing:(o==null?void 0:o.easing)??"linear",value:{type:"dialogue",text:n,audioClip:o==null?void 0:o.voiceOver,style:o==null?void 0:o.style}}),this}addCameraKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:i??"easeInOut",value:{type:"camera",...n}}),this}addEffectKeyframe(t,n,i,o,r){return this.track.keyframes.push({time:t,duration:i,easing:r??"linear",value:{type:"effect",effectType:n,params:o??{}}}),this}build(){return this.track.keyframes.sort((t,n)=>t.time-n.time),this.track}}class jr{constructor(t,n,i){this.scene={id:t,title:n,duration:i,background:{type:"solid",color:"#000000"},cast:[],scenery:[],timeline:[],camera:{position:{x:640,y:360},zoom:1,rotation:0}}}setBackground(t){return this.scene.background=t,this}setCamera(t){return this.scene.camera=t,this}setTransition(t){return this.scene.transition=t,this}addCastMember(t,n,i){return this.scene.cast.push({instanceId:t,characterId:n,position:i.position??{x:640,y:360},scale:i.scale??1,rotation:i.rotation??0,zIndex:i.zIndex??this.scene.cast.length,initialAnimation:i.initialAnimation,initialExpression:i.initialExpression,opacity:i.opacity??1,flipX:i.flipX??!1}),this}addProp(t,n,i){return this.scene.scenery.push({instanceId:t,propId:n,position:i.position??{x:640,y:360},scale:i.scale??1,rotation:i.rotation??0,zIndex:i.zIndex??this.scene.scenery.length,opacity:i.opacity??1}),this}addTrack(t){return this.scene.timeline.push(t),this}addAudio(t){return this.scene.audio=t,this}build(){return this.scene}}function Fr(e){return JSON.parse(JSON.stringify(e))}function Ct(e){if(e.keyframes.length===0)return 0;const t=e.keyframes[e.keyframes.length-1];return"duration"in t&&typeof t.duration=="number"?t.time+t.duration:t.time}function Lr(e){let t=0;for(const n of e.timeline){const i=Ct(n);i>t&&(t=i)}return Math.max(e.duration,t)}function Wr(e,t){return Math.floor(e/1e3*t)}function Br(e,t){return e/t*1e3}function Ur(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),i=t%60,o=Math.floor(e%1e3/10);return`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}.${o.toString().padStart(2,"0")}`}function Vr(e){const t=e.match(/^(\d+):(\d{2})(?:\.(\d{2}))?$/);if(!t)return 0;const n=parseInt(t[1],10),i=parseInt(t[2],10),o=t[3]?parseInt(t[3],10)*10:0;return(n*60+i)*1e3+o}const Mt=d.createContext(null);function Hr(){const e=d.useContext(Mt);if(!e)throw new Error("usePuppetPlayer must be used within PuppetPlayerProvider");return e}class Qr{constructor(){this.audioElements=new Map,this.volume=1,this.muted=!1}preloadAudio(t,n){return new Promise((i,o)=>{const r=new Audio(n);r.preload="auto",r.volume=this.volume,r.muted=this.muted,r.addEventListener("canplaythrough",()=>i(),{once:!0}),r.addEventListener("error",o,{once:!0}),this.audioElements.set(t,r)})}play(t,n){const i=this.audioElements.get(t);i&&(n!==void 0&&(i.currentTime=n/1e3),i.play().catch(()=>{}))}pause(t){const n=this.audioElements.get(t);n&&n.pause()}stop(t){const n=this.audioElements.get(t);n&&(n.pause(),n.currentTime=0)}stopAll(){this.audioElements.forEach(t=>{t.pause(),t.currentTime=0})}setVolume(t){this.volume=Math.max(0,Math.min(1,t)),this.audioElements.forEach(n=>{n.volume=this.volume})}setMuted(t){this.muted=t,this.audioElements.forEach(n=>{n.muted=t})}dispose(){this.stopAll(),this.audioElements.clear()}}function zt(e){const{document:t,autoPlay:n=!1,loop:i=!1,initialVolume:o=1,initialSpeed:r=1}=e,[a,s]=d.useState({isPlaying:!1,isPaused:!1,currentSceneIndex:0,currentTime:0,totalDuration:0,playbackSpeed:r,volume:o,isMuted:!1,characterStates:new Map,activeEffects:[],loop:i}),[c,u]=d.useState(null),f=d.useRef(null),h=d.useRef(0),y=d.useRef(new Qr),p=d.useRef(null),m=d.useRef(new Pe),g=d.useMemo(()=>t.scenes.reduce((I,N)=>I+N.duration,0),[t.scenes]),b=d.useMemo(()=>t.scenes[a.currentSceneIndex]||null,[t.scenes,a.currentSceneIndex]);d.useEffect(()=>{b&&(p.current=new It({scene:b,characterDefs:t.characters,onAudioCommand:(I,N,v)=>{const O=y.current;switch(N){case"play":O.play(I,v);break;case"pause":O.pause(I);break;case"stop":O.stop(I);break}}}))},[b,t.characters]),d.useEffect(()=>{var N;const I=y.current;return(N=t.audioTracks)==null||N.forEach(v=>{v.src&&I.preloadAudio(v.id,v.src).catch(()=>{})}),()=>{I.dispose()}},[t.audioTracks]);const S=d.useCallback(I=>{if(!p.current)return;const N=I-h.current;h.current=I,s(v=>{var U,X,q;if(!v.isPlaying||v.isPaused)return v;const O=v.currentTime+N*v.playbackSpeed,B=(b==null?void 0:b.duration)??0;if(O>=B){const k=v.currentSceneIndex+1;return k>=t.scenes.length?v.loop?((U=e.onSceneChange)==null||U.call(e,0,t.scenes[0]),{...v,currentSceneIndex:0,currentTime:0}):((X=e.onEnd)==null||X.call(e),{...v,isPlaying:!1,isPaused:!1,currentTime:B}):((q=e.onSceneChange)==null||q.call(e,k,t.scenes[k]),{...v,currentSceneIndex:k,currentTime:0})}return{...v,currentTime:O}}),f.current=requestAnimationFrame(S)},[b,t.scenes,e]);d.useEffect(()=>(a.isPlaying&&!a.isPaused?(h.current=performance.now(),f.current=requestAnimationFrame(S)):f.current&&cancelAnimationFrame(f.current),()=>{f.current&&cancelAnimationFrame(f.current)}),[a.isPlaying,a.isPaused,S]),d.useEffect(()=>{if(p.current){const I=p.current.evaluate(a.currentTime);u(I),I.audioCommands.forEach(N=>{const v=y.current;switch(N.command){case"play":v.play(N.trackId);break;case"pause":v.pause(N.trackId);break;case"stop":v.stop(N.trackId);break}}),s(N=>({...N,characterStates:I.characterStates,activeEffects:I.activeEffects}))}},[a.currentTime]),d.useEffect(()=>{n&&s(I=>({...I,isPlaying:!0}))},[n]);const x=d.useCallback(()=>{s(I=>({...I,isPlaying:!0,isPaused:!1}))},[]),$=d.useCallback(()=>{s(I=>({...I,isPaused:!0})),y.current.stopAll()},[]),E=d.useCallback(()=>{s(I=>({...I,isPlaying:!1,isPaused:!1,currentTime:0,currentSceneIndex:0})),y.current.stopAll()},[]),R=d.useCallback(I=>{s(N=>({...N,currentTime:Math.max(0,Math.min(I,(b==null?void 0:b.duration)??0))}))},[b]),z=d.useCallback(I=>{var N;I>=0&&I<t.scenes.length&&(y.current.stopAll(),s(v=>({...v,currentSceneIndex:I,currentTime:0})),(N=e.onSceneChange)==null||N.call(e,I,t.scenes[I]))},[t.scenes,e]),V=d.useCallback(I=>{s(N=>({...N,playbackSpeed:Math.max(.25,Math.min(4,I))}))},[]),_=d.useCallback(I=>{const N=Math.max(0,Math.min(1,I));y.current.setVolume(N),s(v=>({...v,volume:N}))},[]),D=d.useCallback(()=>{s(I=>{const N=!I.isMuted;return y.current.setMuted(N),{...I,isMuted:N}})},[]),L=d.useCallback(()=>{z(a.currentSceneIndex+1)},[a.currentSceneIndex,z]),K=d.useCallback(()=>{z(a.currentSceneIndex-1)},[a.currentSceneIndex,z]),G=d.useCallback(I=>{s(N=>({...N,loop:I}))},[]);return{playerState:{...a,totalDuration:g},timelineState:c,characterRegistry:m.current,play:x,pause:$,stop:E,seek:R,seekToScene:z,setPlaybackSpeed:V,setVolume:_,toggleMute:D,nextScene:L,previousScene:K,setLoop:G}}function At({document:e,autoPlay:t=!1,loop:n=!1,showControls:i=!0,className:o,style:r,onSceneChange:a,onEnd:s}){var V;const{playerState:c,timelineState:u,characterRegistry:f,play:h,pause:y,stop:p,seek:m,seekToScene:g,setPlaybackSpeed:b,setVolume:S,toggleMute:x,nextScene:$,previousScene:E,setLoop:R}=zt({document:e,autoPlay:t,loop:n,onSceneChange:a,onEnd:s}),z=e.scenes[c.currentSceneIndex];return z?d.createElement(Mt.Provider,{value:{document:e,playerState:c,play:h,pause:y,stop:p,seek:m,seekToScene:g,setPlaybackSpeed:b,setVolume:S,toggleMute:x,nextScene:$,previousScene:E,setLoop:R}},d.createElement("div",{className:o,style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#000",...r}},d.createElement("div",{style:{flex:1,position:"relative"}},d.createElement(St,{document:e,scene:z,characterStates:c.characterStates,camera:(u==null?void 0:u.camera)??z.camera??{position:{x:640,y:360},zoom:1,rotation:0},activeEffects:c.activeEffects,characterRegistry:f}),(u==null?void 0:u.activeDialogue)&&d.createElement(wt,{text:u.activeDialogue.text,speakerName:(V=e.characters.find(_=>{var D;return _.id===((D=u.activeDialogue)==null?void 0:D.speakerId)}))==null?void 0:V.name,visible:!0,typewriterProgress:u.activeDialogue.typewriterProgress})),i&&d.createElement(Kr,{playerState:c,currentScene:z,totalScenes:e.scenes.length,onPlay:h,onPause:y,onStop:p,onSeek:m,onPreviousScene:E,onNextScene:$,onSpeedChange:b,onVolumeChange:S,onToggleMute:x,onToggleLoop:()=>R(!c.loop)}))):d.createElement("div",{className:o,style:r},"No scenes")}function Kr({playerState:e,currentScene:t,totalScenes:n,onPlay:i,onPause:o,onStop:r,onSeek:a,onPreviousScene:s,onNextScene:c,onSpeedChange:u,onVolumeChange:f,onToggleMute:h,onToggleLoop:y}){const p=ne(),m=$=>{const E=Math.floor($/1e3),R=Math.floor(E/60),z=E%60;return`${R}:${z.toString().padStart(2,"0")}`},g=t.duration>0?e.currentTime/t.duration*100:0,b={display:"flex",alignItems:"center",gap:8,padding:"12px 16px",backgroundColor:"var(--nice-overlay-90, rgba(0, 0, 0, 0.9))",color:"var(--nice-color-white, #fff)"},S={background:"none",border:"none",color:"#fff",cursor:"pointer",padding:"8px",fontSize:16,opacity:.9},x={flex:1,height:4,backgroundColor:"var(--nice-border-color, #444)",borderRadius:2,cursor:"pointer"};return d.createElement("div",{style:b},d.createElement("button",{style:S,onClick:e.isPlaying&&!e.isPaused?o:i,title:e.isPlaying&&!e.isPaused?p("puppetPlayer.pause","Pause"):p("puppetPlayer.play","Play")},d.createElement(T.NiceIcon,{name:e.isPlaying&&!e.isPaused?"pause":"play",size:16})),d.createElement("button",{style:S,onClick:r,title:p("puppetPlayer.stop","Stop"),"aria-label":p("puppetPlayer.stop","Stop")},d.createElement(T.NiceIcon,{name:"stop",size:16})),d.createElement("button",{style:{...S,opacity:e.currentSceneIndex>0?.9:.3},onClick:s,disabled:e.currentSceneIndex<=0,title:p("puppetPlayer.previousScene","Previous Scene"),"aria-label":p("puppetPlayer.previousScene","Previous Scene")},d.createElement(T.NiceIcon,{name:"skip-back",size:16})),d.createElement("button",{style:{...S,opacity:e.currentSceneIndex<n-1?.9:.3},onClick:c,disabled:e.currentSceneIndex>=n-1,title:p("puppetPlayer.nextScene","Next Scene"),"aria-label":p("puppetPlayer.nextScene","Next Scene")},d.createElement(T.NiceIcon,{name:"skip-forward",size:16})),d.createElement("span",{style:{fontSize:12,fontFamily:"monospace"}},`${m(e.currentTime)} / ${m(t.duration)}`),d.createElement("div",{style:x,onClick:$=>{const E=$.currentTarget.getBoundingClientRect(),z=($.clientX-E.left)/E.width;a(z*t.duration)}},d.createElement("div",{style:{width:`${g}%`,height:"100%",backgroundColor:"var(--nice-primary-light, #60a5fa)",borderRadius:2}})),d.createElement("select",{value:e.playbackSpeed,onChange:$=>u(parseFloat($.target.value)),style:{background:"var(--nice-text, #333)",color:"var(--nice-text-inverse, #fff)",border:"none",padding:"4px 8px",borderRadius:4,fontSize:12}},d.createElement("option",{value:.25},"0.25x"),d.createElement("option",{value:.5},"0.5x"),d.createElement("option",{value:1},"1x"),d.createElement("option",{value:1.5},"1.5x"),d.createElement("option",{value:2},"2x")),d.createElement("button",{style:S,onClick:h,title:e.isMuted?p("puppetPlayer.unmute","Unmute"):p("puppetPlayer.mute","Mute")},d.createElement(T.NiceIcon,{name:e.isMuted?"volume-off":"volume",size:16})),d.createElement("input",{type:"range",min:0,max:1,step:.1,value:e.volume,onChange:$=>f(parseFloat($.target.value)),style:{width:60}}),d.createElement("button",{style:{...S,color:e.loop?"var(--nice-primary-light, #60a5fa)":"#fff"},onClick:y,title:p("puppetPlayer.loop","Loop"),"aria-label":p("puppetPlayer.loop","Loop"),"aria-pressed":e.loop},d.createElement(T.NiceIcon,{name:"refresh",size:16})),d.createElement("span",{style:{fontSize:12}},`Scene ${e.currentSceneIndex+1}/${n}`))}function Yr({document:e,width:t=320,height:n=240,autoPlay:i=!1,className:o,style:r}){return d.createElement(At,{document:e,autoPlay:i,showControls:!1,className:o,style:{width:t,height:n,borderRadius:8,overflow:"hidden",...r}})}function _t(e,t,n){var a,s,c,u;const i=t.assets.find(f=>f.id===e.assetId),o=[];if(e.animations)for(const[f,h]of Object.entries(e.animations)){const y=h.frames.map((p,m)=>({frameId:`${f}_frame_${m}`,duration:p.duration||1e3/h.fps,offset:{x:0,y:0}}));o.push({id:`anim_${f}`,name:f,category:Pt(f),frames:y,fps:h.fps,loop:h.loop,duration:y.reduce((p,m)=>p+(m.duration??0),0)})}const r={};if(e.animations)for(const[f,h]of Object.entries(e.animations))h.frames.forEach((y,p)=>{r[`${f}_frame_${p}`]={frame:{x:y.srcRect.x,y:y.srcRect.y,w:y.srcRect.width,h:y.srcRect.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:y.srcRect.width,h:y.srcRect.height},sourceSize:{w:y.srcRect.width,h:y.srcRect.height}}});return{id:`char_${e.id}`,name:e.name,type:"sprite",visual:{type:"sprite",spriteSheet:(i==null?void 0:i.path)||"",atlas:{frames:r,meta:{image:(i==null?void 0:i.path)||"",size:{w:((a=i==null?void 0:i.metadata)==null?void 0:a.width)||e.width,h:((s=i==null?void 0:i.metadata)==null?void 0:s.height)||e.height},scale:1}},width:((c=i==null?void 0:i.metadata)==null?void 0:c.width)||e.width||100,height:((u=i==null?void 0:i.metadata)==null?void 0:u.height)||e.height||100},anchor:e.anchor||{x:.5,y:1},animations:o,expressions:[],defaultScale:1}}function Tt(e,t,n){var u,f,h,y;const{sprite:i,animator:o,transform:r}=e.components;if(!i)return null;const a=t.assets.find(p=>p.id===i.assetId),s=[];if(o!=null&&o.animations)for(const[p,m]of Object.entries(o.animations)){const g=m.frames.map((b,S)=>({frameId:`${p}_frame_${S}`,duration:b.duration||1e3/m.fps,offset:{x:0,y:0}}));s.push({id:`anim_${p}`,name:p,category:Pt(p),frames:g,fps:m.fps,loop:m.loop,duration:g.reduce((b,S)=>b+(S.duration??0),0)})}const c={};if(o!=null&&o.animations)for(const[p,m]of Object.entries(o.animations))m.frames.forEach((g,b)=>{c[`${p}_frame_${b}`]={frame:{x:g.srcRect.x,y:g.srcRect.y,w:g.srcRect.width,h:g.srcRect.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:g.srcRect.width,h:g.srcRect.height},sourceSize:{w:g.srcRect.width,h:g.srcRect.height}}});return{id:`char_${e.id}`,name:e.name,type:"sprite",visual:{type:"sprite",spriteSheet:(a==null?void 0:a.path)||"",atlas:{frames:c,meta:{image:(a==null?void 0:a.path)||"",size:{w:((u=a==null?void 0:a.metadata)==null?void 0:u.width)||i.width,h:((f=a==null?void 0:a.metadata)==null?void 0:f.height)||i.height},scale:1}},width:((h=a==null?void 0:a.metadata)==null?void 0:h.width)||i.width||100,height:((y=a==null?void 0:a.metadata)==null?void 0:y.height)||i.height||100},anchor:i.anchor||{x:.5,y:1},animations:s,expressions:[],defaultScale:1}}function $t(e,t){var n,i;return e.type!=="image"&&e.type!=="spritesheet"?null:{id:`prop_${e.id}`,name:e.name,type:"image",asset:e.path,width:((n=e.metadata)==null?void 0:n.width)||100,height:((i=e.metadata)==null?void 0:i.height)||100,anchor:{x:.5,y:.5}}}function Gr(e,t){const n=[];for(const i of e.sprites)n.push(_t(i,e));for(const i of e.entities){const o=Tt(i,e);o&&n.push(o)}return n}function Xr(e,t){const n=[];for(const i of e.assets){const o=$t(i);o&&n.push(o)}return n}function Et(e){const t={};for(const o of e.animations){const r=[];if(e.visual.atlas)for(const a of o.frames){const s=e.visual.atlas.frames[a.frameId];s&&r.push({assetId:e.id+"_sheet",srcRect:{x:s.frame.x,y:s.frame.y,width:s.frame.w,height:s.frame.h},duration:a.duration})}t[o.name]={frames:r,fps:o.fps,loop:o.loop}}let n=64,i=64;if(e.visual.atlas){const o=Object.keys(e.visual.atlas.frames)[0];if(o){const r=e.visual.atlas.frames[o];n=r.frame.w,i=r.frame.h}}return{id:e.id,name:e.name,assetId:e.id+"_sheet",width:n,height:i,anchor:e.anchor,animations:t}}function Jr(e,t){var i;const n=Et(e);return{id:e.id,name:e.name,components:{sprite:{assetId:n.assetId,width:n.width,height:n.height,anchor:n.anchor,visible:!0},animator:{currentAnimation:((i=e.animations[0])==null?void 0:i.name)||"",animations:n.animations||{},frame:0,elapsed:0,playing:!0,loop:!0},transform:{position:t||{x:0,y:0},rotation:0,scale:{x:1,y:1}}}}}function Pt(e){const t=e.toLowerCase();return t.includes("idle")||t.includes("stand")?"idle":t.includes("walk")?"walk":t.includes("run")||t.includes("sprint")?"run":t.includes("jump")||t.includes("fall")||t.includes("attack")||t.includes("hit")||t.includes("shoot")?"action":t.includes("hurt")||t.includes("damage")||t.includes("die")?"emotion":(t.includes("special")||t.includes("skill"),"custom")}function Zr(e,t){const n=(t==null?void 0:t.columns)||Math.ceil(Math.sqrt(e.length)),i=(t==null?void 0:t.padding)||0;if(e.length===0)return{image:"",atlas:{frames:{},meta:{image:"",size:{w:0,h:0},scale:1}}};const o=e[0].width,r=e[0].height,a=Math.ceil(e.length/n),s=n*(o+i)-i,c=a*(r+i)-i,u={};return e.forEach((f,h)=>{const y=h%n,p=Math.floor(h/n);u[f.id]={frame:{x:y*(o+i),y:p*(r+i),w:o,h:r},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:o,h:r},sourceSize:{w:o,h:r}}}),{image:"",atlas:{frames:u,meta:{image:"",size:{w:s,h:c},scale:1}}}}function ea(e,t,n,i,o){const r=o||Math.ceil(Math.sqrt(i)),a={};for(let c=0;c<i;c++){const u=c%r,f=Math.floor(c/r);a[`frame_${c}`]={frame:{x:u*t,y:f*n,w:t,h:n},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:t,h:n},sourceSize:{w:t,h:n}}}const s=Math.ceil(i/r);return{frames:a,meta:{image:e,size:{w:r*t,h:s*n},scale:1}}}function ta(e){const t=[],n=[];e.id||t.push("Project is missing an ID"),(!e.assets||e.assets.length===0)&&n.push("Project has no assets"),!e.sprites&&!e.entities&&t.push("Project has no sprites or entities to import");for(const i of e.sprites||[])e.assets.find(r=>r.id===i.assetId)||n.push(`Sprite "${i.name}" references missing asset: ${i.assetId}`);for(const i of e.sprites||[])(!i.animations||Object.keys(i.animations).length===0)&&n.push(`Sprite "${i.name}" has no animations`);return{valid:t.length===0,errors:t,warnings:n}}function na(e,t){var s,c,u;const{flattenScenes:n=!1,includeCharacterSprites:i=!0,includeDialogue:o=!0,slideDuration:r=5e3}=t||{},a=[];if(n)for(const f of e.scenes){const h=ia(f);for(let y=0;y<h.length;y++){const p=h[y],m=h[y+1]??f.duration,g=oa(e,f,p,m-p,i,o);a.push(g)}}else for(const f of e.scenes){const h=ra(e,f,i,o);a.push(h)}return{version:"1.0.0",id:e.id+"_presentation",title:e.title,description:(s=e.metadata)==null?void 0:s.description,author:(c=e.metadata)==null?void 0:c.author,createdAt:((u=e.metadata)==null?void 0:u.createdAt)||new Date().toISOString(),updatedAt:new Date().toISOString(),layout:{width:e.stageSize.width,height:e.stageSize.height,aspectRatio:`${e.stageSize.width}:${e.stageSize.height}`},slides:a,metadata:{sourcePuppetShow:e.id,convertedAt:new Date().toISOString()}}}function ia(e){const t=new Set([0]);for(const n of e.timeline)for(const i of n.keyframes)t.add(i.time),"duration"in i&&typeof i.duration=="number"&&t.add(i.time+i.duration);return Array.from(t).sort((n,i)=>n-i)}function oa(e,t,n,i,o,r){var s,c;const a=[];if(o)for(const u of t.cast){const f=e.characters.find(p=>p.id===u.characterId);if(!f)continue;const h=aa(t,u.instanceId,n)||u.position,y=sa(t,u.instanceId,n);a.push({id:`char_${u.instanceId}_${n}`,type:"image",position:{x:h.x,y:h.y,rotation:(y==null?void 0:y.rotation)??u.rotation},size:{width:((s=f.visual.atlas)==null?void 0:s.meta.size.w)??100,height:((c=f.visual.atlas)==null?void 0:c.meta.size.h)??100},content:{src:f.visual.spriteSheet,alt:f.name},style:{opacity:(y==null?void 0:y.opacity)??u.opacity??1,transform:(y==null?void 0:y.scale)!==void 0?`scale(${u.flipX?-y.scale:y.scale}, ${y.scale})`:void 0},zIndex:u.zIndex})}if(r){const u=ca(t,n);if(u){const f=e.characters.find(h=>{const y=t.timeline.find(p=>p.type==="dialogue");return(y==null?void 0:y.targetId)===h.id});a.push({id:`dialogue_${n}`,type:"text",position:{x:e.stageSize.width/2,y:e.stageSize.height-100},size:{width:e.stageSize.width*.9,height:80},content:{text:f?`${f.name}: ${u.text}`:u.text},style:{backgroundColor:"rgba(0, 0, 0, 0.85)",borderRadius:12},zIndex:1e3})}}return{id:`slide_${t.id}_${n}`,title:t.title,elements:a,background:Nt(t.background),transition:t.transition?{type:t.transition.type,duration:t.transition.duration}:void 0,duration:i}}function ra(e,t,n,i){var r,a;const o=[];if(n)for(const s of t.cast){const c=e.characters.find(u=>u.id===s.characterId);c&&o.push({id:`char_${s.instanceId}`,type:"image",position:{x:s.position.x,y:s.position.y,rotation:s.rotation},size:{width:((r=c.visual.atlas)==null?void 0:r.meta.size.w)??100,height:((a=c.visual.atlas)==null?void 0:a.meta.size.h)??100},content:{src:c.visual.spriteSheet,alt:c.name},style:{opacity:s.opacity??1},animation:da(t,s.instanceId),zIndex:s.zIndex})}for(const s of t.scenery){const c=e.props.find(u=>u.id===s.propId);c&&o.push({id:`prop_${s.instanceId}`,type:"image",position:{x:s.position.x,y:s.position.y,rotation:s.rotation},size:{width:c.width,height:c.height},content:{src:c.asset,alt:c.name},style:{opacity:s.opacity??1},zIndex:s.zIndex})}return i&&la(t).forEach((c,u)=>{const f=e.characters.find(h=>h.id===c.speakerId);o.push({id:`dialogue_${u}`,type:"text",position:{x:e.stageSize.width/2,y:e.stageSize.height-100},size:{width:e.stageSize.width*.9,height:80},content:{text:f?`${f.name}: ${c.text}`:c.text},style:{backgroundColor:"rgba(0, 0, 0, 0.85)",borderRadius:12},animation:{enter:{type:"fadeIn",duration:300,delay:c.time},exit:{type:"fadeOut",duration:300,delay:c.time+c.duration-300}},zIndex:1e3+u})}),{id:`slide_${t.id}`,title:t.title,elements:o,background:Nt(t.background),transition:t.transition?{type:t.transition.type,duration:t.transition.duration}:void 0,duration:t.duration,notes:`Converted from Puppet Show scene: ${t.title}`}}function aa(e,t,n){const i=e.timeline.find(a=>a.type==="transform"&&a.targetId===t);if(!i)return null;const o=i.keyframes;let r=null;for(const a of o){const s=a.value;a.time<=n&&s.position&&(r=s)}return(r==null?void 0:r.position)??null}function sa(e,t,n){const i=e.timeline.find(a=>a.type==="transform"&&a.targetId===t);if(!i)return null;const o=i.keyframes;let r=null;for(const a of o)a.time<=n&&(r=a.value);return r?{scale:r.scale,rotation:r.rotation,opacity:r.opacity}:null}function ca(e,t){for(const n of e.timeline)if(n.type==="dialogue")for(const i of n.keyframes){const o=i.value;if(t>=i.time&&t<i.time+(i.duration??0))return{text:o.text,speakerId:n.targetId}}return null}function la(e){const t=[];for(const n of e.timeline)if(n.type==="dialogue")for(const i of n.keyframes){const o=i.value;t.push({text:o.text,speakerId:n.targetId,time:i.time,duration:i.duration??0})}return t.sort((n,i)=>n.time-i.time)}function Nt(e){var t,n;switch(e.type){case"solid":return{type:"solid",color:e.color};case"gradient":return e.gradient?{type:"gradient",gradient:e.gradient}:{type:"solid",color:"#000000"};case"image":return{type:"image",image:e.image};case"video":return{type:"video",video:e.video};case"parallax":return{type:"image",image:(n=(t=e.parallaxLayers)==null?void 0:t[0])==null?void 0:n.image};default:return{type:"solid",color:"#000000"}}}function da(e,t){const n=e.timeline.find(o=>o.type==="transform"&&o.targetId===t);return!n||n.keyframes.length===0?void 0:{timeline:n.keyframes.map(o=>{var a,s;const r=o.value;return{time:o.time,properties:{x:(a=r.position)==null?void 0:a.x,y:(s=r.position)==null?void 0:s.y,scale:r.scale,rotation:r.rotation,opacity:r.opacity},easing:o.easing}})}}function ua(e,t){const n=[],i=[],o=[],r=new Map;for(const a of e.slides)for(const s of a.elements)s.type==="image"&&s.content.src&&(r.has(s.content.src)||r.set(s.content.src,new Set),r.get(s.content.src).add(s));if(t!=null&&t.createCharacterFromImages){for(const[a,s]of r)if(s.size>=2){const c=Array.from(s)[0],u=`char_${n.length}`;n.push({id:u,name:c.content.alt||`Character ${n.length+1}`,type:"sprite",visual:{type:"sprite",spriteSheet:a,atlas:{frames:{default:{frame:{x:0,y:0,w:c.size.width,h:c.size.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:c.size.width,h:c.size.height},sourceSize:{w:c.size.width,h:c.size.height}}},meta:{image:a,size:{w:c.size.width,h:c.size.height},scale:1}},width:c.size.width,height:c.size.height},anchor:{x:.5,y:1},animations:[{id:"idle",name:"Idle",category:"idle",frames:[{frameId:"default",duration:1e3,offset:{x:0,y:0}}],fps:1,loop:!0,duration:1e3}],expressions:[],defaultScale:1})}}for(const[a,s]of r)if(s.size<2||!(t!=null&&t.createCharacterFromImages)){const c=Array.from(s)[0];i.push({id:`prop_${i.length}`,name:c.content.alt||`Prop ${i.length+1}`,type:"image",asset:a,width:c.size.width,height:c.size.height,anchor:{x:.5,y:.5}})}for(const a of e.slides){const s=pa(a,e,n,i);o.push(s)}return{version:"1.0",id:e.id+"_puppetshow",title:e.title,stageSize:{width:e.layout.width,height:e.layout.height},scenes:o,characters:n,props:i,audioTracks:[],settings:{defaultFps:24,allowSpeedControl:!0,allowSeek:!0,autoPlay:!1,showControls:!0,loop:!1},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),duration:e.slides.reduce((a,s)=>a+(s.duration??5e3),0),sceneCount:o.length,characterCount:n.length,sourcePresentation:e.id,convertedAt:new Date().toISOString()}}}function pa(e,t,n,i){var u,f,h,y;const o=[],r=[],a=[];let s=0,c=0;for(const p of e.elements)if(p.type==="image"&&p.content.src){const m=n.find(g=>g.visual.spriteSheet===p.content.src);if(m){const g=`${m.id}_instance_${s++}`;if(o.push({instanceId:g,characterId:m.id,position:{x:p.position.x,y:p.position.y},scale:1,rotation:p.position.rotation??0,zIndex:p.zIndex??s,opacity:((u=p.style)==null?void 0:u.opacity)??1,flipX:!1}),(f=p.animation)!=null&&f.timeline&&p.animation.timeline.length>1){const b={id:`transform_${g}`,type:"transform",targetId:g,keyframes:p.animation.timeline.map(S=>{const x=S.properties;return{time:S.time,easing:S.easing??"easeInOut",value:{type:"transform",position:x.x!==void 0?{x:x.x,y:x.y??0}:void 0,scale:x.scale,rotation:x.rotation,opacity:x.opacity}}})};a.push(b)}}else{const g=i.find(b=>b.asset===p.content.src);g&&r.push({instanceId:`${g.id}_instance_${c++}`,propId:g.id,position:{x:p.position.x,y:p.position.y},scale:1,rotation:p.position.rotation??0,zIndex:p.zIndex??c,opacity:((h=p.style)==null?void 0:h.opacity)??1})}}else if(p.type==="text"&&p.content.text&&p.position.y>t.layout.height*.7){const g=((y=o[0])==null?void 0:y.characterId)??"narrator",b=a.find(x=>x.type==="dialogue"&&x.targetId===g),S={time:0,duration:e.duration??3e3,easing:"linear",value:{type:"dialogue",text:p.content.text}};b?b.keyframes.push(S):a.push({id:`dialogue_${g}`,type:"dialogue",targetId:g,keyframes:[S]})}return{id:e.id,title:e.title||"Untitled Scene",duration:e.duration??5e3,background:e.background?{type:e.background.type,color:e.background.color,gradient:e.background.gradient,image:e.background.image,video:e.background.video}:{type:"solid",color:"#000000"},cast:o,scenery:r,timeline:a,camera:{position:{x:t.layout.width/2,y:t.layout.height/2},zoom:1,rotation:0},transition:e.transition?{type:(()=>{const p=e.transition.type;return p==="fade"?"fade":p==="zoom"?"zoom":p==="slide"?"slideLeft":"cut"})(),duration:e.transition.duration??500}:void 0}}function fa(e){const t=[],n=[];e.id||t.push("Document missing id"),e.title||n.push("Document missing title"),e.version||n.push("Document missing version"),e.stageSize||t.push("Document missing stageSize"),(!e.scenes||e.scenes.length===0)&&t.push("Document has no scenes");const i=new Set(e.characters.map(r=>r.id));for(const r of e.scenes)for(const a of r.cast)i.has(a.characterId)||t.push(`Scene "${r.id}" references unknown character: ${a.characterId}`);const o=new Set(e.props.map(r=>r.id));for(const r of e.scenes)for(const a of r.scenery)o.has(a.propId)||t.push(`Scene "${r.id}" references unknown prop: ${a.propId}`);return{valid:t.length===0,errors:t,warnings:n}}function ma(e,t){if(e.length===0)throw new Error("Cannot merge empty array of puppet shows");const n={version:"1.0",id:`merged_${Date.now()}`,title:e.map(r=>r.title).join(" + "),stageSize:e[0].stageSize,scenes:[],characters:[],props:[],audioTracks:[],settings:e[0].settings,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),duration:e.reduce((r,a)=>{var s;return r+(((s=a.metadata)==null?void 0:s.duration)??0)},0),sceneCount:0,characterCount:0,mergedFrom:e.map(r=>r.id),mergedAt:new Date().toISOString()}},i=new Map,o=new Map;for(const r of e){for(const a of r.characters){if(t!=null&&t.deduplicateCharacters){const c=n.characters.find(u=>u.name===a.name);if(c){i.set(a.id,c.id);continue}}const s=`${r.id}_${a.id}`;i.set(a.id,s),n.characters.push({...a,id:s})}for(const a of r.props){const s=`${r.id}_${a.id}`;o.set(a.id,s),n.props.push({...a,id:s})}for(const a of r.scenes){const s={...a,id:`${r.id}_${a.id}`,cast:a.cast.map(c=>({...c,instanceId:`${r.id}_${c.instanceId}`,characterId:i.get(c.characterId)||c.characterId})),scenery:a.scenery.map(c=>({...c,instanceId:`${r.id}_${c.instanceId}`,propId:o.get(c.propId)||c.propId})),timeline:a.timeline.map(c=>({...c,id:`${r.id}_${c.id}`,targetId:i.get(c.targetId)||o.get(c.targetId)||`${r.id}_${c.targetId}`}))};n.scenes.push(s)}for(const a of r.audioTracks||[])n.audioTracks.push({...a,id:`${r.id}_${a.id}`})}return n}const Rt={good:"#4caf50",warning:"#ff9800",critical:"#f44336",info:"#2196f3",neutral:"#9e9e9e",background:"#fff",text:"#212121",textMuted:"#757575"};function ha(e){const t={...Rt,...e.colorScheme};return{id:e.id,title:e.title,type:"dashboard",layout:{columns:e.columns,rows:e.rows,gap:e.gap??16,padding:e.padding??24},widgets:e.widgets.map(n=>({...n,colSpan:n.colSpan??1,rowSpan:n.rowSpan??1,colors:{...t,...n.colors},animation:{countUp:!0,countUpDuration:1e3,entrance:"fadeIn",entranceDelay:0,...n.animation}})),dataSources:e.dataSources??[],refreshInterval:e.refreshInterval??3e4,colorScheme:t,background:e.background??t.background,showLastUpdated:e.showLastUpdated??!0,autoCycle:e.autoCycle??!1,autoCycleInterval:e.autoCycleInterval??5e3,lastUpdated:new Date().toISOString()}}function ya(e,t,n=!0){var o;if(!t||t.length===0)return"neutral";const i=[...t].sort((r,a)=>n?a.value-r.value:r.value-a.value);for(const r of i)if(n){if(e>=r.value)return r.status}else if(e<=r.value)return r.status;return((o=i[i.length-1])==null?void 0:o.status)??"neutral"}function ga(e,t){return t==null?"unknown":e>t?"up":e<t?"down":"flat"}function xa(e,t){if(typeof e=="string")return e;const{unit:n="",precision:i=0,compact:o=!1,locale:r="en-US"}=t??{};let a;return o&&Math.abs(e)>=1e3?a=new Intl.NumberFormat(r,{notation:"compact",maximumFractionDigits:1}).format(e):a=e.toLocaleString(r,{minimumFractionDigits:i,maximumFractionDigits:i}),n?`${a}${n}`:a}function qt(e){return{id:"revenue",title:"Revenue",type:"number-tile",column:1,row:1,unit:"$",precision:0,icon:"dollar-sign",thresholds:[{value:1e6,status:"good"},{value:5e5,status:"warning"},{value:0,status:"critical"}],...e}}function Dt(e){return{id:"customers",title:"Customers",type:"number-tile",column:2,row:1,icon:"users",thresholds:[{value:1e4,status:"good"},{value:5e3,status:"warning"},{value:0,status:"critical"}],...e}}function ba(e){return{id:"percentage-gauge",title:"Completion",type:"gauge",column:1,row:1,unit:"%",precision:1,gaugeConfig:{min:0,max:100,style:"semicircle",showNeedle:!0,showTicks:!0,tickCount:5,thickness:20},thresholds:[{value:80,status:"good"},{value:50,status:"warning"},{value:0,status:"critical"}],...e}}function va(e){return{id:"sparkline-trend",title:"Weekly Trend",type:"sparkline",column:1,row:1,sparklineData:[],...e}}function Sa(e){return{id:"traffic-light",title:"System Status",type:"traffic-light",column:1,row:1,...e}}function wa(e){return{id:"comparison",title:"Budget vs Actual",type:"comparison",column:1,row:1,targetValue:1e5,value:85e3,unit:"$",...e}}function ka(){return{id:"executive-dashboard",title:"Executive Summary",columns:4,rows:3,widgets:[qt({column:1,row:1,colSpan:1}),Dt({column:2,row:1,colSpan:1}),{id:"orders",title:"Orders",type:"number-tile",column:3,row:1,icon:"shopping-cart"},{id:"satisfaction",title:"CSAT Score",type:"gauge",column:4,row:1,unit:"%",gaugeConfig:{min:0,max:100,style:"semicircle"}},{id:"revenue-trend",title:"Revenue Trend",type:"sparkline",column:1,row:2,colSpan:2},{id:"top-products",title:"Top Products",type:"mini-bar",column:3,row:2,colSpan:2,chartData:[{label:"Product A",value:45e3},{label:"Product B",value:38e3},{label:"Product C",value:32e3},{label:"Product D",value:28e3},{label:"Product E",value:22e3}]},{id:"regional-breakdown",title:"Regional Sales",type:"mini-pie",column:1,row:3,colSpan:2,chartData:[{label:"North",value:35},{label:"South",value:25},{label:"East",value:22},{label:"West",value:18}]},{id:"budget-status",title:"Budget Status",type:"bullet-chart",column:3,row:3,colSpan:2,value:72e3,targetValue:1e5,unit:"$"}]}}function Ia(){return{id:"operational-dashboard",title:"Operational Metrics",columns:3,rows:2,widgets:[{id:"uptime",title:"System Uptime",type:"gauge",column:1,row:1,value:99.9,unit:"%",gaugeConfig:{min:0,max:100,style:"full-circle"},thresholds:[{value:99.5,status:"good"},{value:99,status:"warning"},{value:0,status:"critical"}]},{id:"response-time",title:"Avg Response Time",type:"number-tile",column:2,row:1,value:145,unit:"ms",icon:"clock",thresholds:[{value:0,status:"good"},{value:200,status:"warning"},{value:500,status:"critical"}]},{id:"error-rate",title:"Error Rate",type:"traffic-light",column:3,row:1,value:.5,unit:"%"},{id:"throughput",title:"Requests/sec",type:"sparkline",column:1,row:2,colSpan:2,sparklineData:[120,135,128,145,152,148,160,155,170,165]},{id:"incidents",title:"Open Incidents",type:"number-tile",column:3,row:2,value:3,icon:"alert-triangle",thresholds:[{value:0,status:"good"},{value:5,status:"warning"},{value:10,status:"critical"}]}]}}function Ca(e){var t,n,i;return{id:e.id,type:"datagrid",title:e.title,subtitle:e.subtitle,config:{...e,columns:e.columns.map(o=>({width:"auto",align:"left",dataType:"string",sortable:!0,filterable:!1,...o})),interactiveSort:e.interactiveSort??!0,interactiveFilter:e.interactiveFilter??!1,enableSelection:e.enableSelection??!0,showRowNumbers:e.showRowNumbers??!1,showColumnBorders:e.showColumnBorders??!1,stripedRows:e.stripedRows??!0,pageSize:e.pageSize??10,animation:{rowEntrance:"fadeIn",staggerDelay:50,duration:300,progressiveReveal:!1,revealBatchSize:5,...e.animation},style:{headerBackground:"#f5f5f5",headerColor:"#212121",rowBackground:"#fff",rowBackgroundAlt:"#fafafa",cellColor:"#424242",borderColor:"#e0e0e0",fontSize:14,headerFontSize:14,rowHeight:48,cellPadding:12,borderRadius:8,...e.style}},state:{currentSort:e.defaultSort??[],currentFilters:e.defaultFilters??[],selectedCells:[],currentPage:0,revealedRowCount:(t=e.animation)!=null&&t.progressiveReveal?e.animation.revealBatchSize??5:((n=e.data)==null?void 0:n.length)??0,isFullyRevealed:!((i=e.animation)!=null&&i.progressiveReveal),lastUpdated:new Date().toISOString()}}}function Ma(e,t){return t.length===0?e:[...e].sort((n,i)=>{for(const o of t){const r=n[o.field],a=i[o.field];let s=0;if(r==null&&a==null?s=0:r==null?s=1:a==null?s=-1:typeof r=="number"&&typeof a=="number"?s=r-a:s=String(r).localeCompare(String(a)),s!==0)return o.direction==="desc"?-s:s}return 0})}function za(e,t){return t.length===0?e:e.filter(n=>t.every(i=>{const o=n[i.field],r=i.value;switch(i.operator){case"equals":return o===r;case"notEquals":return o!==r;case"contains":return String(o).toLowerCase().includes(String(r).toLowerCase());case"startsWith":return String(o).toLowerCase().startsWith(String(r).toLowerCase());case"endsWith":return String(o).toLowerCase().endsWith(String(r).toLowerCase());case"greaterThan":return Number(o)>Number(r);case"lessThan":return Number(o)<Number(r);case"between":return Number(o)>=Number(r)&&Number(o)<=Number(i.valueTo);case"in":return Array.isArray(r)&&r.includes(o);default:return!0}}))}function Aa(e,t){const n={};for(const i of t.columns){const o=e.map(r=>r[i.columnId]).filter(r=>r!=null);switch(i.aggregation){case"sum":n[i.columnId]=o.reduce((r,a)=>r+Number(a),0);break;case"avg":n[i.columnId]=o.length>0?o.reduce((r,a)=>r+Number(a),0)/o.length:0;break;case"min":n[i.columnId]=Math.min(...o.map(Number));break;case"max":n[i.columnId]=Math.max(...o.map(Number));break;case"count":n[i.columnId]=o.length;break;case"custom":n[i.columnId]=i.customValue??"";break}}return n}function _a(e,t,n="en-US"){if(e==null)return"";switch(t.dataType){case"number":return Number(e).toLocaleString(n,{minimumFractionDigits:t.precision??0,maximumFractionDigits:t.precision??0});case"currency":return Number(e).toLocaleString(n,{style:"currency",currency:t.currency??"USD"});case"percent":return Number(e).toLocaleString(n,{style:"percent",minimumFractionDigits:t.precision??0});case"date":return new Date(String(e)).toLocaleDateString(n);case"boolean":return e?"✓":"✗";default:return String(e)}}function Ta(e,t){if(!t)return null;for(const n of t){const{operator:i,value:o,valueTo:r}=n.condition;let a=!1;switch(i){case"equals":a=e===o;break;case"notEquals":a=e!==o;break;case"greaterThan":a=Number(e)>Number(o);break;case"lessThan":a=Number(e)<Number(o);break;case"between":a=Number(e)>=Number(o)&&Number(e)<=Number(r);break;case"contains":a=String(e).toLowerCase().includes(String(o).toLowerCase());break;case"isEmpty":a=e==null||e==="";break}if(a)return n.style}return null}function $a(e){return{id:"sales-grid",title:"Sales Report",subtitle:"Q4 2025 Performance",columns:[{id:"region",header:"Region",field:"region",width:150},{id:"product",header:"Product",field:"product",width:200},{id:"units",header:"Units Sold",field:"units",dataType:"number",align:"right"},{id:"revenue",header:"Revenue",field:"revenue",dataType:"currency",align:"right",conditionalFormat:[{condition:{operator:"greaterThan",value:1e5},style:{backgroundColor:"#e8f5e9",color:"#2e7d32"}},{condition:{operator:"lessThan",value:5e4},style:{backgroundColor:"#ffebee",color:"#c62828"}}]},{id:"growth",header:"Growth %",field:"growth",dataType:"percent",align:"right",precision:1}],data:e??[{region:"North",product:"Widget Pro",units:1250,revenue:125e3,growth:.15},{region:"South",product:"Widget Pro",units:980,revenue:98e3,growth:.08},{region:"East",product:"Gadget Plus",units:1500,revenue:18e4,growth:.22},{region:"West",product:"Gadget Plus",units:1100,revenue:132e3,growth:.12}],summaryRow:{enabled:!0,columns:[{columnId:"units",aggregation:"sum",label:"Total"},{columnId:"revenue",aggregation:"sum"},{columnId:"growth",aggregation:"avg"}]},animation:{rowEntrance:"slideInLeft",staggerDelay:100}}}function Ea(e){return{id:"employee-grid",title:"Team Directory",columns:[{id:"name",header:"Name",field:"name",width:180},{id:"role",header:"Role",field:"role",width:150},{id:"department",header:"Department",field:"department",width:120,filterable:!0},{id:"email",header:"Email",field:"email",width:200},{id:"status",header:"Status",field:"status",cellRenderer:"badge",width:100}],data:e??[],showRowNumbers:!0,interactiveFilter:!0}}function Pa(e){var n;const t={};return(n=e.parameters)==null||n.forEach(i=>{i.defaultValue!==void 0&&(t[i.name]=i.defaultValue)}),{id:e.id,type:"query",title:e.title,subtitle:e.subtitle,config:{...e,autoExecute:e.autoExecute??!1,showQueryEditor:e.showQueryEditor??!0,allowQueryEdit:e.allowQueryEdit??!1,showExecutionStats:e.showExecutionStats??!0,cacheDuration:e.cacheDuration??0,style:{editorTheme:"dark",editorFontSize:14,resultBackground:"#fff",accentColor:"#1976d2",borderRadius:8,...e.style}},state:{currentQuery:e.query,currentParameters:t,result:null,isExecuting:!1,lastExecutedAt:null,error:null,visualizationMode:e.visualization.mode,history:[]}}}function Na(e,t){const n=[];switch(t){case"sql":{const i=e.matchAll(/[@:](\w+)/g);for(const o of i)n.includes(o[1])||n.push(o[1]);break}case"odata":{const i=e.matchAll(/\{(\w+)\}/g);for(const o of i)n.includes(o[1])||n.push(o[1]);break}case"graphql":{const i=e.matchAll(/\$(\w+)/g);for(const o of i)n.includes(o[1])||n.push(o[1]);break}case"kql":{const i=e.matchAll(/\{(\w+)\}/g);for(const o of i)n.includes(o[1])||n.push(o[1]);break}}return n}function Ra(e,t,n){let i=e;for(const[o,r]of Object.entries(n)){const a=qa(r);switch(t){case"sql":i=i.replace(new RegExp(`@${o}\\b`,"g"),a),i=i.replace(new RegExp(`:${o}\\b`,"g"),a);break;case"odata":case"kql":i=i.replace(new RegExp(`\\{${o}\\}`,"g"),a);break}}return i}function qa(e){return e==null?"NULL":typeof e=="number"?String(e):typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof Date?`'${e.toISOString()}'`:`'${String(e).replace(/'/g,"''")}'`}function Da(e,t){const n={};for(const i of e){const o=t[i.name];if(i.required&&(o==null||o==="")){n[i.name]=`${i.label} is required`;continue}if(o!=null&&i.validation){if(i.type==="number"){const r=Number(o);i.validation.min!==void 0&&r<i.validation.min&&(n[i.name]=i.validation.message??`Minimum value is ${i.validation.min}`),i.validation.max!==void 0&&r>i.validation.max&&(n[i.name]=i.validation.message??`Maximum value is ${i.validation.max}`)}i.type==="string"&&i.validation.pattern&&(new RegExp(i.validation.pattern).test(String(o))||(n[i.name]=i.validation.message??"Invalid format"))}}return{valid:Object.keys(n).length===0,errors:n}}function Oa(e){if(!e.success||e.rowCount===0)return"table";const t=e.columns.filter(i=>i.type==="number"),n=e.columns.filter(i=>i.type==="date");return e.rowCount===1&&t.length>=3?"metrics":n.length===1&&t.length>=1&&e.rowCount>3?"line-chart":t.length===1&&e.rowCount<=15?"bar-chart":t.length===1&&e.rowCount<=8?"pie-chart":"table"}function ja(e,t){var s,c,u;if(!e.success||e.columns.length===0)return;const n=e.columns.filter(f=>f.type==="number"),i=e.columns.filter(f=>f.type!=="number"),r=((s=e.columns.filter(f=>f.type==="date")[0])==null?void 0:s.name)??((c=i[0])==null?void 0:c.name)??e.columns[0].name,a=n.length>0?n.length===1?n[0].name:n.slice(0,3).map(f=>f.name):(u=e.columns[1])==null?void 0:u.name;return{xAxis:r,yAxis:a,showLegend:Array.isArray(a)&&a.length>1,showGrid:!0,colorScheme:["#1976d2","#43a047","#fb8c00","#e53935","#8e24aa"]}}function Fa(){return{id:"sales-query",title:"Sales Analysis",subtitle:"Query live sales data",language:"sql",query:`SELECT
134
134
  Region,
135
135
  ProductCategory,
136
136
  SUM(Revenue) as TotalRevenue,
@@ -139,7 +139,7 @@ SLA Violation`,style:{fontSize:18,color:e.impact.slaViolation?"#f87171":"#4ade80
139
139
  FROM Sales
140
140
  WHERE OrderDate >= @startDate AND OrderDate <= @endDate
141
141
  GROUP BY Region, ProductCategory
142
- ORDER BY TotalRevenue DESC`,parameters:[{name:"startDate",label:"Start Date",type:"date",required:!0,defaultValue:new Date(Date.now()-720*60*60*1e3).toISOString().split("T")[0]},{name:"endDate",label:"End Date",type:"date",required:!0,defaultValue:new Date().toISOString().split("T")[0]}],dataSource:{id:"sales-query-ds",name:"Sales Query Source",type:"rest-api",config:{type:"rest-api",url:"/api/query",method:"POST"},status:"idle"},visualization:{mode:"bar-chart",chartConfig:{xAxis:"Region",yAxis:"TotalRevenue",seriesField:"ProductCategory",showLegend:!0}},showQueryEditor:!0,showExecutionStats:!0}}function Fa(){return{id:"odata-query",title:"Product Catalog",subtitle:"OData Query Example",language:"odata",query:"Products?$filter=Category eq '{category}' and Price gt {minPrice}&$orderby=Price desc&$top=20&$select=Name,Category,Price,Stock",parameters:[{name:"category",label:"Category",type:"select",required:!0,defaultValue:"Electronics",options:[{value:"Electronics",label:"Electronics"},{value:"Clothing",label:"Clothing"},{value:"Books",label:"Books"}]},{name:"minPrice",label:"Minimum Price",type:"number",defaultValue:0,validation:{min:0}}],dataSource:{id:"odata-query-ds",name:"OData Query Source",type:"rest-api",config:{type:"rest-api",url:"https://api.example.com/odata",method:"GET"},status:"idle"},visualization:{mode:"table",tableConfig:{pageSize:10,sortable:!0}}}}function La(){return{id:"kql-query",title:"Application Insights",subtitle:"Request Performance Analysis",language:"kql",query:`requests
142
+ ORDER BY TotalRevenue DESC`,parameters:[{name:"startDate",label:"Start Date",type:"date",required:!0,defaultValue:new Date(Date.now()-720*60*60*1e3).toISOString().split("T")[0]},{name:"endDate",label:"End Date",type:"date",required:!0,defaultValue:new Date().toISOString().split("T")[0]}],dataSource:{id:"sales-query-ds",name:"Sales Query Source",type:"rest-api",config:{type:"rest-api",url:"/api/query",method:"POST"},status:"idle"},visualization:{mode:"bar-chart",chartConfig:{xAxis:"Region",yAxis:"TotalRevenue",seriesField:"ProductCategory",showLegend:!0}},showQueryEditor:!0,showExecutionStats:!0}}function La(){return{id:"odata-query",title:"Product Catalog",subtitle:"OData Query Example",language:"odata",query:"Products?$filter=Category eq '{category}' and Price gt {minPrice}&$orderby=Price desc&$top=20&$select=Name,Category,Price,Stock",parameters:[{name:"category",label:"Category",type:"select",required:!0,defaultValue:"Electronics",options:[{value:"Electronics",label:"Electronics"},{value:"Clothing",label:"Clothing"},{value:"Books",label:"Books"}]},{name:"minPrice",label:"Minimum Price",type:"number",defaultValue:0,validation:{min:0}}],dataSource:{id:"odata-query-ds",name:"OData Query Source",type:"rest-api",config:{type:"rest-api",url:"https://api.example.com/odata",method:"GET"},status:"idle"},visualization:{mode:"table",tableConfig:{pageSize:10,sortable:!0}}}}function Wa(){return{id:"kql-query",title:"Application Insights",subtitle:"Request Performance Analysis",language:"kql",query:`requests
143
143
  | where timestamp > ago({timeRange})
144
144
  | summarize
145
145
  RequestCount = count(),
@@ -147,6 +147,6 @@ ORDER BY TotalRevenue DESC`,parameters:[{name:"startDate",label:"Start Date",typ
147
147
  P95Duration = percentile(duration, 95),
148
148
  FailureRate = countif(success == false) * 100.0 / count()
149
149
  by bin(timestamp, 1h)
150
- | order by timestamp asc`,parameters:[{name:"timeRange",label:"Time Range",type:"select",defaultValue:"24h",options:[{value:"1h",label:"Last Hour"},{value:"24h",label:"Last 24 Hours"},{value:"7d",label:"Last 7 Days"},{value:"30d",label:"Last 30 Days"}]}],dataSource:{id:"kql-query-ds",name:"KQL Query Source",type:"rest-api",config:{type:"rest-api",url:"https://api.applicationinsights.azure.com/v1/apps/{app-id}/query",method:"POST"},status:"idle"},visualization:{mode:"line-chart",chartConfig:{xAxis:"timestamp",yAxis:["AvgDuration","P95Duration"],showLegend:!0,showGrid:!0}},autoExecute:!0}}class Wa{constructor(t,n,i){this.versions=new Map,this.branches=new Map,this.currentVersionId=null,this.currentBranch="main",this.autoSaveTimer=null,this.lastAutoSaveTime=0,this.presentationId=t,this.config={maxVersions:50,autoSaveInterval:6e4,autoSaveDebounce:5e3,preserveLabeledVersions:!0,enableBranching:!0,...n},this.onChange=i,this.branches.set("main",{name:"main",headVersionId:"",createdAt:new Date().toISOString(),createdBy:n.currentUser})}getVersionHistory(){return Array.from(this.versions.values()).filter(t=>!t.branchName||t.branchName===this.currentBranch).sort((t,n)=>n.versionNumber-t.versionNumber)}getVersion(t){return this.versions.get(t)}getCurrentVersion(){return this.currentVersionId?this.versions.get(this.currentVersionId):void 0}saveVersion(t,n={}){var u;const i=this.generateVersionId(),o=this.getCurrentVersion(),r=((o==null?void 0:o.versionNumber)??0)+1,a=o?this.calculateDiff(o.snapshot,t):void 0,s={versionId:i,versionNumber:r,snapshot:this.clonePresentation(t),createdAt:new Date().toISOString(),createdBy:this.config.currentUser,label:n.label,description:n.description??this.generateAutoDescription(a),tags:n.tags,isAutoSave:n.isAutoSave??!1,parentVersionId:this.currentVersionId??void 0,branchName:this.currentBranch,diff:a};this.versions.set(i,s),this.currentVersionId=i;const c=this.branches.get(this.currentBranch);return c&&(c.headVersionId=i),this.pruneVersions(),(u=this.onChange)==null||u.call(this,s),s}scheduleAutoSave(t){if(this.config.autoSaveInterval<=0)return;this.autoSaveTimer&&clearTimeout(this.autoSaveTimer);const i=Date.now()-this.lastAutoSaveTime,o=Math.max(this.config.autoSaveDebounce,this.config.autoSaveInterval-i);this.autoSaveTimer=setTimeout(()=>{this.saveVersion(t,{isAutoSave:!0}),this.lastAutoSaveTime=Date.now()},o)}cancelAutoSave(){this.autoSaveTimer&&(clearTimeout(this.autoSaveTimer),this.autoSaveTimer=null)}restoreVersion(t){const n=this.versions.get(t);if(!n)return null;const i=this.getCurrentVersion();return i&&this.saveVersion(i.snapshot,{label:`Before restore to v${n.versionNumber}`,description:`Auto-saved before restoring to version ${n.versionNumber}`}),this.saveVersion(n.snapshot,{description:`Restored from version ${n.versionNumber}`}).snapshot}previewVersion(t){const n=this.versions.get(t);return n?this.clonePresentation(n.snapshot):null}labelVersion(t,n){const i=this.versions.get(t);return i?(i.label=n,!0):!1}tagVersion(t,n){const i=this.versions.get(t);return i?(i.tags=[...new Set([...i.tags??[],...n])],!0):!1}createBranch(t,n){if(!this.config.enableBranching||this.branches.has(t))return null;const i={name:t,headVersionId:this.currentVersionId??"",createdAt:new Date().toISOString(),createdBy:this.config.currentUser,description:n};return this.branches.set(t,i),i}switchBranch(t){const n=this.branches.get(t);return n?(this.currentBranch=t,this.currentVersionId=n.headVersionId,!0):!1}getBranches(){return Array.from(this.branches.values())}getCurrentBranch(){return this.currentBranch}compareVersions(t,n){const i=this.versions.get(t),o=this.versions.get(n);return!i||!o?null:this.calculateDiff(i.snapshot,o.snapshot)}calculateDiff(t,n){const i=[],o=[],r=new Map(t.slides.map((m,g)=>[m.id,{slide:m,index:g}])),a=new Map(n.slides.map((m,g)=>[m.id,{slide:m,index:g}]));let s=0,c=0,u=0,f=0,h=0,y=0;for(const[m,{slide:g,index:b}]of a){const S=r.get(m);if(!S)s++,f+=g.elements.length,i.push({slideId:m,slideIndex:b,changeType:"added",slideTitle:this.getSlideTitle(g)});else{const x=this.calculateElementChanges(S.slide,g);if((x.length>0||S.index!==b)&&(S.index!==b&&i.push({slideId:m,slideIndex:b,changeType:"reordered",slideTitle:this.getSlideTitle(g),previousIndex:S.index}),x.length>0)){u++,i.push({slideId:m,slideIndex:b,changeType:"modified",slideTitle:this.getSlideTitle(g),elementChanges:x});for(const T of x)T.changeType==="added"?f++:T.changeType==="removed"?h++:y++}}}for(const[m,{slide:g,index:b}]of r)a.has(m)||(c++,h+=g.elements.length,i.push({slideId:m,slideIndex:b,changeType:"removed",slideTitle:this.getSlideTitle(g)}));const p=["title","author","theme"];for(const m of p)JSON.stringify(t[m])!==JSON.stringify(n[m])&&o.push({property:m,oldValue:t[m],newValue:n[m]});return{summary:{slidesAdded:s,slidesRemoved:c,slidesModified:u,elementsAdded:f,elementsRemoved:h,elementsModified:y,totalChanges:s+c+u+o.length},slideChanges:i,metadataChanges:o}}calculateElementChanges(t,n){const i=[],o=new Map(t.elements.map(a=>[a.id,a])),r=new Map(n.elements.map(a=>[a.id,a]));for(const[a,s]of r){const c=o.get(a);if(!c)i.push({elementId:a,elementType:s.type,changeType:"added"});else{const u=this.calculatePropertyChanges(c,s);u.length>0&&i.push({elementId:a,elementType:s.type,changeType:"modified",propertyChanges:u})}}for(const[a,s]of o)r.has(a)||i.push({elementId:a,elementType:s.type,changeType:"removed"});return i}calculatePropertyChanges(t,n){const i=[],o=t,r=n,a=new Set([...Object.keys(o),...Object.keys(r)]);for(const s of a)s!=="id"&&JSON.stringify(o[s])!==JSON.stringify(r[s])&&i.push({property:s,oldValue:o[s],newValue:r[s]});return i}getSlideTitle(t){const n=t.elements.find(i=>{var o;return i.type==="text"&&((o=i.content)==null?void 0:o.text)});if(n){const i=n.content.text;return i.substring(0,50)+(i.length>50?"...":"")}return`Slide ${t.id}`}generateAutoDescription(t){if(!t)return"Initial version";const n=[],{summary:i}=t;return i.slidesAdded>0&&n.push(`+${i.slidesAdded} slide(s)`),i.slidesRemoved>0&&n.push(`-${i.slidesRemoved} slide(s)`),i.slidesModified>0&&n.push(`~${i.slidesModified} slide(s) modified`),t.metadataChanges.length>0&&n.push("metadata updated"),n.length>0?n.join(", "):"No significant changes"}clonePresentation(t){return JSON.parse(JSON.stringify(t))}generateVersionId(){return`v_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}pruneVersions(){const t=Array.from(this.versions.values()).filter(o=>!o.branchName||o.branchName===this.currentBranch).sort((o,r)=>o.versionNumber-r.versionNumber),n=new Set;if(this.currentVersionId&&n.add(this.currentVersionId),this.config.preserveLabeledVersions)for(const o of t)o.label&&n.add(o.versionId);const i=t.slice(-this.config.maxVersions);for(const o of i)n.add(o.versionId);for(const o of t)n.has(o.versionId)||this.versions.delete(o.versionId)}exportHistory(){return JSON.stringify({presentationId:this.presentationId,currentVersionId:this.currentVersionId,currentBranch:this.currentBranch,versions:Array.from(this.versions.values()),branches:Array.from(this.branches.values())})}importHistory(t){const n=JSON.parse(t);this.presentationId=n.presentationId,this.currentVersionId=n.currentVersionId,this.currentBranch=n.currentBranch,this.versions=new Map(n.versions.map(i=>[i.versionId,i])),this.branches=new Map(n.branches.map(i=>[i.name,i]))}dispose(){this.cancelAutoSave()}}class Ba{constructor(t,n){this.slides=new Map,this.elements=new Map,this.templates=new Map,this.collections=new Map,this.linkedInstances=new Map,this.currentUser=t,this.onUpdate=n}addSlide(t,n){const i=this.generateId(),o=new Date().toISOString(),r={metadata:{id:i,type:"slide",name:n.name,description:n.description,tags:n.tags??[],collectionIds:n.collectionIds??[],createdBy:this.currentUser,createdAt:o,updatedAt:o,version:1,usageCount:0,visibility:n.visibility??"private"},slide:this.cloneSlide(t),placeholders:n.placeholders};return this.slides.set(i,r),this.updateCollectionCounts(),r}updateSlide(t,n){var o;const i=this.slides.get(t);return!i||i.metadata.createdBy.id!==this.currentUser.id?null:(n.slide&&(i.slide=this.cloneSlide(n.slide),i.metadata.version++),n.name!==void 0&&(i.metadata.name=n.name),n.description!==void 0&&(i.metadata.description=n.description),n.tags!==void 0&&(i.metadata.tags=n.tags),n.placeholders!==void 0&&(i.placeholders=n.placeholders),i.metadata.updatedAt=new Date().toISOString(),(o=this.onUpdate)==null||o.call(this,"slide",t),i)}removeSlide(t){const n=this.slides.get(t);return!n||n.metadata.createdBy.id!==this.currentUser.id?!1:(this.slides.delete(t),this.updateCollectionCounts(),!0)}getSlide(t){return this.slides.get(t)}useSlide(t,n){const i=this.slides.get(t);if(!i)return null;i.metadata.usageCount++;const o=this.cloneSlide(i.slide);if(o.id=this.generateId(),n!=null&&n.placeholderValues&&i.placeholders&&this.applyPlaceholderValues(o,i.placeholders,n.placeholderValues),n!=null&&n.elementOverrides)for(const r of o.elements){const a=n.elementOverrides[r.id];a&&Object.assign(r,a)}return n!=null&&n.backgroundOverride&&(o.background=n.backgroundOverride),o}linkSlide(t,n,i,o){const r=this.slides.get(t);if(!r)return null;const a=this.generateId(),s={instanceId:a,libraryItemId:t,presentationId:n,slideIndex:i,overrides:o,syncStatus:"synced",syncedVersion:r.metadata.version};return this.linkedInstances.set(a,s),r.metadata.usageCount++,s}syncLinkedSlide(t){const n=this.linkedInstances.get(t);if(!n)return null;const i=this.slides.get(n.libraryItemId);if(!i)return null;const o=this.useSlide(n.libraryItemId,n.overrides);return o&&(n.syncStatus="synced",n.syncedVersion=i.metadata.version),o}getOutdatedInstances(){const t=[];for(const n of this.linkedInstances.values()){const i=this.slides.get(n.libraryItemId);i&&i.metadata.version>n.syncedVersion&&(n.syncStatus="outdated",t.push(n))}return t}addElement(t,n){const i=this.generateId(),o=new Date().toISOString(),r={metadata:{id:i,type:"element",name:n.name,description:n.description,tags:n.tags??[],createdBy:this.currentUser,createdAt:o,updatedAt:o,version:1,usageCount:0,visibility:n.visibility??"private"},element:JSON.parse(JSON.stringify(t))};return this.elements.set(i,r),r}getElement(t){return this.elements.get(t)}useElement(t){const n=this.elements.get(t);if(!n)return null;n.metadata.usageCount++;const i=JSON.parse(JSON.stringify(n.element));return i.id=this.generateId(),i}addTemplate(t,n){const i=this.generateId(),o=new Date().toISOString(),r={metadata:{id:i,type:"template",name:n.name,description:n.description,tags:n.tags??[],createdBy:this.currentUser,createdAt:o,updatedAt:o,version:1,usageCount:0,visibility:n.visibility??"private"},slides:t.map(a=>this.cloneSlide(a)),variables:n.variables,useCases:n.useCases};return this.templates.set(i,r),r}getTemplate(t){return this.templates.get(t)}useTemplate(t,n){const i=this.templates.get(t);if(!i)return null;i.metadata.usageCount++;const o=i.slides.map(r=>{const a=this.cloneSlide(r);return a.id=this.generateId(),a});return n&&i.variables&&this.applyTemplateVariables(o,i.variables,n),o}createCollection(t){const n=this.generateId(),i={id:n,name:t.name,description:t.description,icon:t.icon,color:t.color,parentId:t.parentId,itemCount:0,createdBy:this.currentUser,createdAt:new Date().toISOString(),visibility:t.visibility??"private"};return this.collections.set(n,i),i}getCollections(){return Array.from(this.collections.values())}addToCollection(t,n){const i=this.slides.get(t),o=this.elements.get(t),r=this.templates.get(t),a=i??o??r;return!a||!this.collections.get(n)?!1:(a.metadata.collectionIds||(a.metadata.collectionIds=[]),a.metadata.collectionIds.includes(n)||(a.metadata.collectionIds.push(n),this.updateCollectionCounts()),!0)}search(t){let n=[];const i=t.types??["slide","element","template"];if(i.includes("slide")&&n.push(...Array.from(this.slides.values())),i.includes("element")&&n.push(...Array.from(this.elements.values())),i.includes("template")&&n.push(...Array.from(this.templates.values())),t.visibility&&(n=n.filter(u=>t.visibility.includes(u.metadata.visibility))),t.query){const u=t.query.toLowerCase();n=n.filter(f=>{var h,y;return f.metadata.name.toLowerCase().includes(u)||((h=f.metadata.description)==null?void 0:h.toLowerCase().includes(u))||((y=f.metadata.tags)==null?void 0:y.some(p=>p.toLowerCase().includes(u)))})}t.tags&&t.tags.length>0&&(n=n.filter(u=>t.tags.some(f=>{var h;return(h=u.metadata.tags)==null?void 0:h.includes(f)}))),t.collectionIds&&t.collectionIds.length>0&&(n=n.filter(u=>t.collectionIds.some(f=>{var h;return(h=u.metadata.collectionIds)==null?void 0:h.includes(f)}))),t.createdBy&&(n=n.filter(u=>u.metadata.createdBy.id===t.createdBy));const o=t.sortBy??"updatedAt",r=t.sortOrder??"desc";n.sort((u,f)=>{let h=0;switch(o){case"name":h=u.metadata.name.localeCompare(f.metadata.name);break;case"createdAt":h=u.metadata.createdAt.localeCompare(f.metadata.createdAt);break;case"updatedAt":h=u.metadata.updatedAt.localeCompare(f.metadata.updatedAt);break;case"usageCount":h=u.metadata.usageCount-f.metadata.usageCount;break}return r==="desc"?-h:h});const a=n.length,s=t.offset??0,c=t.limit??20;return n=n.slice(s,s+c),{items:n,totalCount:a,hasMore:s+n.length<a}}getRecent(t=10){return this.search({sortBy:"updatedAt",sortOrder:"desc",limit:t}).items}getFavorites(){return[...Array.from(this.slides.values()),...Array.from(this.elements.values()),...Array.from(this.templates.values())].filter(n=>n.metadata.isFavorite)}toggleFavorite(t){const n=this.slides.get(t)??this.elements.get(t)??this.templates.get(t);return n?(n.metadata.isFavorite=!n.metadata.isFavorite,!0):!1}generateId(){return`lib_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}cloneSlide(t){return JSON.parse(JSON.stringify(t))}applyPlaceholderValues(t,n,i){for(const o of n){const r=i[o.id];if(r===void 0)continue;const a=t.elements.find(s=>s.id===o.elementId);if(a)switch(o.type){case"text":a.type==="text"&&a.content&&(a.content.text=String(r));break;case"image":a.type==="image"&&a.content&&(a.content.src=String(r));break;case"chart-data":a.type==="chart"&&a.content&&(a.content.data=r);break;case"table-data":a.type==="table"&&a.content&&(a.content.rows=r);break}}}applyTemplateVariables(t,n,i){const o={};for(const r of n){const a=i[r.name]??r.defaultValue;a!==void 0&&(o[`{{${r.name}}}`]=String(a))}for(const r of t)for(const a of r.elements)if(a.type==="text"&&a.content){let s=a.content.text;for(const[c,u]of Object.entries(o))s=s.replace(new RegExp(c.replace(/[{}]/g,"\\$&"),"g"),u);a.content.text=s}}updateCollectionCounts(){for(const n of this.collections.values())n.itemCount=0;const t=[...Array.from(this.slides.values()),...Array.from(this.elements.values()),...Array.from(this.templates.values())];for(const n of t)for(const i of n.metadata.collectionIds??[]){const o=this.collections.get(i);o&&o.itemCount++}}exportLibrary(){return JSON.stringify({slides:Array.from(this.slides.values()),elements:Array.from(this.elements.values()),templates:Array.from(this.templates.values()),collections:Array.from(this.collections.values())})}importLibrary(t){const n=JSON.parse(t);this.slides=new Map(n.slides.map(i=>[i.metadata.id,i])),this.elements=new Map(n.elements.map(i=>[i.metadata.id,i])),this.templates=new Map(n.templates.map(i=>[i.metadata.id,i])),this.collections=new Map(n.collections.map(i=>[i.id,i]))}}function Dt(e){const t=e.data;if(typeof t=="string")return t;switch(t.type){case"url":return t.url;case"email":return`mailto:${t.to}${t.subject||t.body?"?":""}${t.subject?`subject=${encodeURIComponent(t.subject)}`:""}${t.subject&&t.body?"&":""}${t.body?`body=${encodeURIComponent(t.body)}`:""}`;case"phone":return`tel:${t.number}`;case"sms":return`sms:${t.number}${t.message?`?body=${encodeURIComponent(t.message)}`:""}`;case"vcard":return Va(t);case"wifi":return`WIFI:T:${t.encryption};S:${t.ssid};P:${t.password??""};H:${t.hidden?"true":"false"};;`;case"geo":return`geo:${t.latitude},${t.longitude}${t.altitude?`,${t.altitude}`:""}${t.label?`?q=${encodeURIComponent(t.label)}`:""}`;case"calendar":return Ua(t);case"presentation-link":return Ha(t);case"feedback-form":return`${Me()}/feedback/${t.formId}?p=${t.presentationId}`;case"poll":return`${Me()}/poll/${t.pollId}`;default:return String(t)}}function Va(e){const t=["BEGIN:VCARD","VERSION:3.0",`N:${e.lastName};${e.firstName};;;`,`FN:${e.firstName} ${e.lastName}`];if(e.organization&&t.push(`ORG:${e.organization}`),e.title&&t.push(`TITLE:${e.title}`),e.email&&t.push(`EMAIL:${e.email}`),e.phone&&t.push(`TEL;TYPE=WORK:${e.phone}`),e.mobile&&t.push(`TEL;TYPE=CELL:${e.mobile}`),e.website&&t.push(`URL:${e.website}`),e.note&&t.push(`NOTE:${e.note}`),e.address){const n=e.address;t.push(`ADR;TYPE=WORK:;;${n.street??""};${n.city??""};${n.state??""};${n.postalCode??""};${n.country??""}`)}return t.push("END:VCARD"),t.join(`
151
- `)}function Ua(e){const t=(i,o)=>{const r=new Date(i);return o?r.toISOString().replace(/[-:]/g,"").split("T")[0]:r.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")},n=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`DTSTART${e.allDay?";VALUE=DATE":""}:${t(e.startDate,e.allDay)}`,`DTEND${e.allDay?";VALUE=DATE":""}:${t(e.endDate,e.allDay)}`,`SUMMARY:${e.title}`];return e.description&&n.push(`DESCRIPTION:${e.description}`),e.location&&n.push(`LOCATION:${e.location}`),n.push("END:VEVENT","END:VCALENDAR"),n.join(`
152
- `)}function Ha(e){const t=`${Me()}/present/${e.presentationId}`,n=new URLSearchParams;e.slideIndex!==void 0&&n.set("slide",String(e.slideIndex)),e.accessCode&&n.set("code",e.accessCode),e.allowDownload&&n.set("download","1");const i=n.toString();return i?`${t}?${i}`:t}function Me(){return typeof window<"u"?window.location.origin:"https://app.nice2dev.com"}function Qa(e){const t=e.qrCodes.map(n=>({id:n.id,dataUrl:"",rawData:Dt(n),size:n.size??256,config:{...n,errorCorrection:n.errorCorrection??"M",style:{foregroundColor:"#000000",backgroundColor:"#fff",cornerSquareStyle:"square",dotStyle:"square",...n.style}}}));return{id:e.id,type:"qrcode",title:e.title,subtitle:e.subtitle,config:{...e,layout:e.layout??"single",showLabels:e.showLabels??!0,animate:e.animate??!0},qrCodes:t}}function Ya(e,t){return{id:"presentation-link-slide",title:(t==null?void 0:t.title)??"Join the Presentation",subtitle:"Scan to follow along on your device",layout:"single",qrCodes:[{id:"presentation-qr",type:"presentation-link",data:{type:"presentation-link",presentationId:e,accessCode:t==null?void 0:t.accessCode,expiresAt:t!=null&&t.expiresIn?new Date(Date.now()+t.expiresIn*60*60*1e3).toISOString():void 0},label:"Open Presentation",size:400,style:{cornerSquareStyle:"rounded",dotStyle:"rounded",frame:{style:"banner",text:"Scan Me",color:"#1976d2",textColor:"#fff"}}}],callToAction:"Scan the QR code to view on your device",showLabels:!0,animate:!0}}function Ga(e,t){return{id:"feedback-slide",title:"We Value Your Feedback",subtitle:"Help us improve",layout:"single",qrCodes:[{id:"feedback-qr",type:"feedback-form",data:{type:"feedback-form",formId:`feedback_${Date.now()}`,presentationId:e,questions:t??[{id:"q1",type:"rating",question:"How would you rate this presentation?",required:!0},{id:"q2",type:"text",question:"What did you find most valuable?",required:!1},{id:"q3",type:"text",question:"Any suggestions for improvement?",required:!1}],anonymous:!0},label:"Share Feedback",size:350,style:{foregroundColor:"#2e7d32",cornerSquareStyle:"rounded",dotStyle:"classy-rounded"}}],callToAction:"Your feedback helps us improve!",instructions:"Scan the code and answer a few quick questions",showLabels:!0}}function Ka(e,t,n){const i=`poll_${Date.now()}`;return{id:"poll-slide",title:"Live Poll",subtitle:e,layout:"single",qrCodes:[{id:"poll-qr",type:"poll",data:{type:"poll",pollId:i,question:e,options:t,allowMultiple:(n==null?void 0:n.allowMultiple)??!1,showResults:(n==null?void 0:n.showResults)??!0,closesAt:n!=null&&n.closesIn?new Date(Date.now()+n.closesIn*60*1e3).toISOString():void 0},label:"Vote Now",size:350,style:{foregroundColor:"#7b1fa2",cornerSquareStyle:"dot",dotStyle:"dots"}}],callToAction:"Cast your vote!",instructions:"Scan to participate in the poll",showLabels:!0,animate:!0}}function Xa(e){return{id:"contact-slide",title:"Connect With Me",subtitle:`${e.firstName} ${e.lastName}`,layout:"single",qrCodes:[{id:"contact-qr",type:"vcard",data:{type:"vcard",...e},label:"Save Contact",size:350,style:{cornerSquareStyle:"rounded",dotStyle:"rounded",frame:{style:"rounded",text:"Add to Contacts",color:"#424242",textColor:"#fff"}}}],callToAction:"Scan to save my contact information",showLabels:!0}}function Ja(e,t,n="WPA"){return{id:"wifi-slide",title:"WiFi Network",subtitle:e,layout:"single",qrCodes:[{id:"wifi-qr",type:"wifi",data:{type:"wifi",ssid:e,password:t,encryption:n},label:"Connect to WiFi",size:300,style:{foregroundColor:"#0288d1",cornerSquareStyle:"rounded",dotStyle:"rounded"}}],callToAction:"Scan to connect automatically",showLabels:!0}}function Za(e){return{id:"multi-qr-slide",title:"Resources & Links",layout:e.length<=2?"side-by-side":"grid",qrCodes:e.map((t,n)=>({id:`qr-${n}`,type:"url",data:t.url,label:t.label,size:e.length<=2?250:180,style:{foregroundColor:t.color??"#000000",cornerSquareStyle:"rounded",dotStyle:"rounded"}})),showLabels:!0,animate:!0}}const Oe=["#ff6b6b","#4ecdc4","#45b7d1","#96ceb4","#ffeaa7","#dda0dd","#98d8c8","#f7dc6f","#bb8fce","#85c1e9"];function es(e){return Oe[e%Oe.length]}function Ot(e,t){const n=e.toArray();return{version:"1.0",id:t.get("id")||Date.now().toString(),title:t.get("title")||"Untitled",author:t.get("author"),slideSize:t.get("slideSize")??{width:1920,height:1080},slides:n,theme:t.get("theme")??{backgroundColor:"#1a1a2e",textColor:"#fff",accentColor:"#4ecdc4",fontHeading:"Inter",fontBody:"Inter"},speakerSettings:t.get("speakerSettings"),metadata:t.get("metadata")??{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}}}function ze(e,t,n,i){i.transact(()=>{t.length>0&&t.delete(0,t.length),t.push(e.slides),n.set("id",e.id),n.set("version",e.version),n.set("title",e.title),n.set("author",e.author),n.set("slideSize",e.slideSize),n.set("theme",e.theme),n.set("speakerSettings",e.speakerSettings),n.set("metadata",{...e.metadata,updatedAt:new Date().toISOString()})})}function ts(e){const{provider:t,user:n,initialDocument:i,onSync:o,onUserJoin:r,onUserLeave:a,onConnectionChange:s,createYDoc:c,createProvider:u,createUndoManager:f}=e,h=d.useRef(null),y=d.useRef(null),p=d.useRef(null),[m,g]=d.useState({document:i||null,collaborators:[],collaboratorSlides:new Map,collaboratorEditing:new Map,cursors:new Map,selections:new Map,isConnected:!1,isSynced:!1,localUser:n,undoManager:null});d.useEffect(()=>{var E,B;if(!c)return;const k=c();h.current=k;const M=k.getArray("slides"),O=k.getMap("meta");if(i&&ze(i,M,O,k),f){const L=f(k,[M,O]);p.current=L,g(G=>({...G,undoManager:L}))}const Q=()=>{const L=Ot(M,O);g(G=>({...G,document:L})),o==null||o(L)};if(k.on("update",Q),t&&u){const L=u(k,t);y.current=L,L.on("sync",ee=>{g(te=>({...te,isSynced:ee})),ee&&Q()}),L.on("connection-error",()=>{g(ee=>({...ee,isConnected:!1})),s==null||s(!1)}),L.on("connection-close",()=>{g(ee=>({...ee,isConnected:!1})),s==null||s(!1)});const G=L.awareness;G.setLocalState({user:n,currentSlideId:(B=(E=i==null?void 0:i.slides)==null?void 0:E[0])==null?void 0:B.id});const Z=ee=>{const te=G.getStates(),de=[],me=new Map,he=new Map,z=new Map,F=new Map;te.forEach((j,J)=>{if(J===G.clientID||!(j!=null&&j.user))return;const ne={id:j.user.id,name:j.user.name,color:j.user.color||es(de.length),avatar:j.user.avatar};de.push(ne),j.currentSlideId&&me.set(ne.id,j.currentSlideId),j.editingElementId!==void 0&&he.set(ne.id,j.editingElementId),j.cursor&&z.set(ne.id,{x:j.cursor.x,y:j.cursor.y}),j.selection&&F.set(ne.id,j.selection)}),g(j=>({...j,collaborators:de,collaboratorSlides:me,collaboratorEditing:he,cursors:z,selections:F,isConnected:L.connected}));for(const j of ee.added){const J=te.get(j);J!=null&&J.user&&(r==null||r(J.user))}for(const j of ee.removed)a==null||a({id:String(j),name:"",color:""})};G.on("change",Z),L.connect(),g(ee=>({...ee,isConnected:L.connected})),s==null||s(L.connected)}return()=>{var L,G;k.off("update",Q),(L=y.current)==null||L.destroy(),(G=h.current)==null||G.destroy(),p.current=null,h.current=null,y.current=null}},[]);const b=d.useCallback((k,M)=>{const O=h.current;if(!O)return;const Q=O.getArray("slides");O.transact(()=>{M!==void 0&&M<Q.length?Q.insert(M,[k]):Q.push([k])})},[]),S=d.useCallback((k,M)=>{const O=h.current;if(!O)return;const Q=O.getArray("slides");O.transact(()=>{const E=Q.toArray(),B=E.findIndex(G=>G.id===k);if(B===-1)return;const L={...E[B],...M};Q.delete(B,1),Q.insert(B,[L])})},[]),x=d.useCallback(k=>{const M=h.current;if(!M)return;const O=M.getArray("slides");M.transact(()=>{const E=O.toArray().findIndex(B=>B.id===k);E!==-1&&O.delete(E,1)})},[]),T=d.useCallback(k=>{const M=h.current;if(!M)return;const O=M.getArray("slides");M.transact(()=>{const Q=O.toArray(),E=k.map(B=>Q.find(L=>L.id===B)).filter(Boolean);E.length===Q.length&&(O.delete(0,O.length),O.push(E))})},[]),$=d.useCallback((k,M)=>{const O=h.current;if(!O)return;const Q=O.getArray("slides");O.transact(()=>{const E=Q.toArray(),B=E.findIndex(Z=>Z.id===k);if(B===-1)return;const L=E[B],G={...L,elements:[...L.elements,M]};Q.delete(B,1),Q.insert(B,[G])})},[]),N=d.useCallback((k,M,O)=>{const Q=h.current;if(!Q)return;const E=Q.getArray("slides");Q.transact(()=>{const B=E.toArray(),L=B.findIndex(te=>te.id===k);if(L===-1)return;const G=B[L],Z=G.elements.map(te=>te.id===M?{...te,...O}:te),ee={...G,elements:Z};E.delete(L,1),E.insert(L,[ee])})},[]),C=d.useCallback((k,M)=>{const O=h.current;if(!O)return;const Q=O.getArray("slides");O.transact(()=>{const E=Q.toArray(),B=E.findIndex(Z=>Z.id===k);if(B===-1)return;const L=E[B],G={...L,elements:L.elements.filter(Z=>Z.id!==M)};Q.delete(B,1),Q.insert(B,[G])})},[]),H=d.useCallback(k=>{const M=h.current;if(!M)return;const O=M.getMap("meta");M.transact(()=>{const Q=O.get("theme")||{};O.set("theme",{...Q,...k})})},[]),A=d.useCallback(k=>{const M=h.current;if(!M)return;const O=M.getMap("meta");M.transact(()=>{const Q=O.get("metadata")||{};O.set("metadata",{...Q,...k,updatedAt:new Date().toISOString()})})},[]),q=d.useCallback(k=>{const M=h.current;if(!M)return;const O=M.getMap("meta");M.transact(()=>{O.set("title",k)})},[]),W=d.useCallback(k=>{var M;(M=y.current)==null||M.awareness.setLocalStateField("currentSlideId",k)},[]),Y=d.useCallback(k=>{var M;(M=y.current)==null||M.awareness.setLocalStateField("editingElementId",k)},[]),K=d.useCallback(k=>{var M,O;k?(M=y.current)==null||M.awareness.setLocalStateField("cursor",{...k,timestamp:Date.now()}):(O=y.current)==null||O.awareness.setLocalStateField("cursor",null)},[]),I=d.useCallback(k=>{var M;(M=y.current)==null||M.awareness.setLocalStateField("selection",k)},[]),P=d.useCallback(()=>{var k;(k=p.current)==null||k.undo()},[]),v=d.useCallback(()=>{var k;(k=p.current)==null||k.redo()},[]),D=d.useCallback(()=>{var k;(k=y.current)==null||k.connect()},[]),V=d.useCallback(()=>{var k;(k=y.current)==null||k.disconnect()},[]),U=d.useCallback(k=>{const M=h.current;if(!M){g(E=>({...E,document:k}));return}const O=M.getArray("slides"),Q=M.getMap("meta");ze(k,O,Q,M)},[]),X=d.useCallback(()=>m.document,[m.document]);return{state:m,actions:{addSlide:b,updateSlide:S,deleteSlide:x,reorderSlides:T,addElement:$,updateElement:N,deleteElement:C,updateTheme:H,updateMetadata:A,setTitle:q,setCurrentSlide:W,setEditingElement:Y,setCursor:K,setSelection:I,undo:P,redo:v,connect:D,disconnect:V,setDocument:U,getDocument:X}}}exports.BRAND_KIT_CORPORATE=kr;exports.BRAND_KIT_NICE2DEV=wr;exports.BRAND_KIT_STARTUP=Ir;exports.BUILT_IN_TRANSITIONS=mt;exports.BackgroundRenderer=xt;exports.CharacterRegistry=Ee;exports.DEFAULT_KPI_COLORS=Nt;exports.DialogueBox=St;exports.EffectRenderer=bt;exports.InteractiveButton=oo;exports.InteractiveCountdown=co;exports.InteractivePoll=ao;exports.InteractiveQnA=lo;exports.InteractiveQuiz=so;exports.NiceI18nProvider=Be;exports.NicePresentationEditor=Qe;exports.NicePresentationPlayer=Ke;exports.NicePresentationToolbar=we;exports.NiceSlideCanvas=ae;exports.NiceSlidePropertyPanel=ke;exports.NiceSlideThumbnailList=Ie;exports.PresentationModel=Se;exports.PresentationToolbar=we;exports.PresentationVersionManager=Wa;exports.PuppetAnimationController=gt;exports.PuppetCharacter=Mr;exports.PuppetSceneBuilder=Or;exports.PuppetShowMiniPlayer=Yr;exports.PuppetShowPlayer=zt;exports.PuppetStage=vt;exports.SLIDE_16_9=on;exports.SLIDE_4_3=rn;exports.SLIDE_WIDESCREEN=an;exports.SlideCanvas=ae;exports.SlideLibraryManager=Ba;exports.SlidePropertyPanel=ke;exports.SlideThumbnailList=Ie;exports.THEME_CORPORATE=Ge;exports.THEME_MINIMAL=cn;exports.THEME_MODERN_DARK=sn;exports.THEME_NICE2DEV=ln;exports.TRANSITION_BLUR_FADE=ct;exports.TRANSITION_CIRCLE_REVEAL=ut;exports.TRANSITION_CUBE_LEFT=at;exports.TRANSITION_FADE=Xe;exports.TRANSITION_FLIP_HORIZONTAL=ot;exports.TRANSITION_FLIP_VERTICAL=rt;exports.TRANSITION_GLITCH=pt;exports.TRANSITION_MORPH=ft;exports.TRANSITION_ROTATE_IN=st;exports.TRANSITION_SLIDE_DOWN=tt;exports.TRANSITION_SLIDE_LEFT=Je;exports.TRANSITION_SLIDE_RIGHT=Ze;exports.TRANSITION_SLIDE_UP=et;exports.TRANSITION_WIPE_LEFT=lt;exports.TRANSITION_WIPE_RIGHT=dt;exports.TRANSITION_ZOOM_IN=nt;exports.TRANSITION_ZOOM_OUT=it;exports.TimelineEngine=kt;exports.TimelineTrackBuilder=Dr;exports.addAnimationToCharacter=Tr;exports.addExpressionToCharacter=$r;exports.applyBrandKit=br;exports.applyEasing=ho;exports.applyFiltersToData=Ma;exports.applySortToData=Ca;exports.brandKitToTheme=yt;exports.calculateSummaryRow=za;exports.cloneTimeline=jr;exports.computeCustomTransitionState=fo;exports.computeElementState=tn;exports.computeKPIStatus=ha;exports.computeTransitionState=Ye;exports.computeTrend=ya;exports.createCharacterFromSpriteSheet=_r;exports.createComparisonWidget=Sa;exports.createContactSlide=Xa;exports.createCustomTransition=yo;exports.createCustomerCountWidget=qt;exports.createDashboardSlide=ma;exports.createDataGridSlide=Ia;exports.createEmployeeDataGrid=$a;exports.createExecutiveDashboard=wa;exports.createFeedbackSlide=Ga;exports.createKQLQuerySlide=La;exports.createMultiQRSlide=Za;exports.createODataQuerySlide=Fa;exports.createOperationalDashboard=ka;exports.createPercentageGauge=xa;exports.createPollSlide=Ka;exports.createPresentationLinkSlide=Ya;exports.createQRCodeSlide=Qa;exports.createQuerySlide=Ea;exports.createRevenueWidget=Rt;exports.createSalesDataGrid=Ta;exports.createSalesQuerySlide=ja;exports.createSampleArchitectureData=Zo;exports.createSampleIncidentReportData=xr;exports.createSampleOnboardingData=sr;exports.createSampleProductPitchData=Do;exports.createSampleQuarterlyReportData=Ao;exports.createSampleSprintReviewData=Uo;exports.createSparklineTrend=ba;exports.createSpriteSheetFromFrames=Jr;exports.createTrafficLight=va;exports.createWiFiSlide=Ja;exports.detectBestVisualization=Da;exports.easingFunctions=le;exports.encodeQRContent=Dt;exports.exportCharacterToEntity=Xr;exports.exportCharacterToSprite=$t;exports.exportToHtml=je;exports.extractQueryParameters=Pa;exports.formatCellValue=Aa;exports.formatKPIValue=ga;exports.formatTime=Br;exports.framesToTime=Wr;exports.generateArchitectureOverview=Jo;exports.generateChartConfig=Oa;exports.generateIncidentReport=gr;exports.generateOnboarding=ar;exports.generateProductPitch=qo;exports.generateQuarterlyReport=zo;exports.generateSprintReview=Vo;exports.getConditionalStyle=_a;exports.getEasingFunction=wt;exports.getSceneDuration=Fr;exports.getTrackDuration=It;exports.importAssetAsProp=Tt;exports.importEntityAsCharacter=_t;exports.importProjectCharacters=Gr;exports.importProjectProps=Kr;exports.importSpriteAsCharacter=At;exports.lerp=re;exports.lerpPosition=Ce;exports.mapTransitionEffectToId=mo;exports.mergePuppetShows=fa;exports.parseNdpJson=Lt;exports.parseSpriteSheetGrid=Zr;exports.parseTime=Vr;exports.presentationToPuppetShow=da;exports.puppetShowToPresentation=ta;exports.removeBrandKit=vr;exports.renderCharacterToCanvas=Cr;exports.renderChartSvg=He;exports.stringifyNdpJson=Ve;exports.substituteParameters=Na;exports.syncPresentationToYjs=ze;exports.syncYjsToPresentation=Ot;exports.timeToFrames=Lr;exports.transitionRegistry=ht;exports.transitionToKeyframes=go;exports.useCameraShake=qr;exports.useCharacterRegistry=Ar;exports.useCollaborativePresentation=ts;exports.useNiceLang=_e;exports.useNiceTranslation=ie;exports.usePresentationEditor=Ue;exports.usePuppetAnimation=zr;exports.usePuppetPlayer=Ur;exports.usePuppetShowPlayer=Mt;exports.usePuppetStage=Pr;exports.validateParameters=qa;exports.validateProjectForImport=ea;exports.validatePuppetShowDocument=pa;
150
+ | order by timestamp asc`,parameters:[{name:"timeRange",label:"Time Range",type:"select",defaultValue:"24h",options:[{value:"1h",label:"Last Hour"},{value:"24h",label:"Last 24 Hours"},{value:"7d",label:"Last 7 Days"},{value:"30d",label:"Last 30 Days"}]}],dataSource:{id:"kql-query-ds",name:"KQL Query Source",type:"rest-api",config:{type:"rest-api",url:"https://api.applicationinsights.azure.com/v1/apps/{app-id}/query",method:"POST"},status:"idle"},visualization:{mode:"line-chart",chartConfig:{xAxis:"timestamp",yAxis:["AvgDuration","P95Duration"],showLegend:!0,showGrid:!0}},autoExecute:!0}}class Ba{constructor(t,n,i){this.versions=new Map,this.branches=new Map,this.currentVersionId=null,this.currentBranch="main",this.autoSaveTimer=null,this.lastAutoSaveTime=0,this.presentationId=t,this.config={maxVersions:50,autoSaveInterval:6e4,autoSaveDebounce:5e3,preserveLabeledVersions:!0,enableBranching:!0,...n},this.onChange=i,this.branches.set("main",{name:"main",headVersionId:"",createdAt:new Date().toISOString(),createdBy:n.currentUser})}getVersionHistory(){return Array.from(this.versions.values()).filter(t=>!t.branchName||t.branchName===this.currentBranch).sort((t,n)=>n.versionNumber-t.versionNumber)}getVersion(t){return this.versions.get(t)}getCurrentVersion(){return this.currentVersionId?this.versions.get(this.currentVersionId):void 0}saveVersion(t,n={}){var u;const i=this.generateVersionId(),o=this.getCurrentVersion(),r=((o==null?void 0:o.versionNumber)??0)+1,a=o?this.calculateDiff(o.snapshot,t):void 0,s={versionId:i,versionNumber:r,snapshot:this.clonePresentation(t),createdAt:new Date().toISOString(),createdBy:this.config.currentUser,label:n.label,description:n.description??this.generateAutoDescription(a),tags:n.tags,isAutoSave:n.isAutoSave??!1,parentVersionId:this.currentVersionId??void 0,branchName:this.currentBranch,diff:a};this.versions.set(i,s),this.currentVersionId=i;const c=this.branches.get(this.currentBranch);return c&&(c.headVersionId=i),this.pruneVersions(),(u=this.onChange)==null||u.call(this,s),s}scheduleAutoSave(t){if(this.config.autoSaveInterval<=0)return;this.autoSaveTimer&&clearTimeout(this.autoSaveTimer);const i=Date.now()-this.lastAutoSaveTime,o=Math.max(this.config.autoSaveDebounce,this.config.autoSaveInterval-i);this.autoSaveTimer=setTimeout(()=>{this.saveVersion(t,{isAutoSave:!0}),this.lastAutoSaveTime=Date.now()},o)}cancelAutoSave(){this.autoSaveTimer&&(clearTimeout(this.autoSaveTimer),this.autoSaveTimer=null)}restoreVersion(t){const n=this.versions.get(t);if(!n)return null;const i=this.getCurrentVersion();return i&&this.saveVersion(i.snapshot,{label:`Before restore to v${n.versionNumber}`,description:`Auto-saved before restoring to version ${n.versionNumber}`}),this.saveVersion(n.snapshot,{description:`Restored from version ${n.versionNumber}`}).snapshot}previewVersion(t){const n=this.versions.get(t);return n?this.clonePresentation(n.snapshot):null}labelVersion(t,n){const i=this.versions.get(t);return i?(i.label=n,!0):!1}tagVersion(t,n){const i=this.versions.get(t);return i?(i.tags=[...new Set([...i.tags??[],...n])],!0):!1}createBranch(t,n){if(!this.config.enableBranching||this.branches.has(t))return null;const i={name:t,headVersionId:this.currentVersionId??"",createdAt:new Date().toISOString(),createdBy:this.config.currentUser,description:n};return this.branches.set(t,i),i}switchBranch(t){const n=this.branches.get(t);return n?(this.currentBranch=t,this.currentVersionId=n.headVersionId,!0):!1}getBranches(){return Array.from(this.branches.values())}getCurrentBranch(){return this.currentBranch}compareVersions(t,n){const i=this.versions.get(t),o=this.versions.get(n);return!i||!o?null:this.calculateDiff(i.snapshot,o.snapshot)}calculateDiff(t,n){const i=[],o=[],r=new Map(t.slides.map((m,g)=>[m.id,{slide:m,index:g}])),a=new Map(n.slides.map((m,g)=>[m.id,{slide:m,index:g}]));let s=0,c=0,u=0,f=0,h=0,y=0;for(const[m,{slide:g,index:b}]of a){const S=r.get(m);if(!S)s++,f+=g.elements.length,i.push({slideId:m,slideIndex:b,changeType:"added",slideTitle:this.getSlideTitle(g)});else{const x=this.calculateElementChanges(S.slide,g);if((x.length>0||S.index!==b)&&(S.index!==b&&i.push({slideId:m,slideIndex:b,changeType:"reordered",slideTitle:this.getSlideTitle(g),previousIndex:S.index}),x.length>0)){u++,i.push({slideId:m,slideIndex:b,changeType:"modified",slideTitle:this.getSlideTitle(g),elementChanges:x});for(const $ of x)$.changeType==="added"?f++:$.changeType==="removed"?h++:y++}}}for(const[m,{slide:g,index:b}]of r)a.has(m)||(c++,h+=g.elements.length,i.push({slideId:m,slideIndex:b,changeType:"removed",slideTitle:this.getSlideTitle(g)}));const p=["title","author","theme"];for(const m of p)JSON.stringify(t[m])!==JSON.stringify(n[m])&&o.push({property:m,oldValue:t[m],newValue:n[m]});return{summary:{slidesAdded:s,slidesRemoved:c,slidesModified:u,elementsAdded:f,elementsRemoved:h,elementsModified:y,totalChanges:s+c+u+o.length},slideChanges:i,metadataChanges:o}}calculateElementChanges(t,n){const i=[],o=new Map(t.elements.map(a=>[a.id,a])),r=new Map(n.elements.map(a=>[a.id,a]));for(const[a,s]of r){const c=o.get(a);if(!c)i.push({elementId:a,elementType:s.type,changeType:"added"});else{const u=this.calculatePropertyChanges(c,s);u.length>0&&i.push({elementId:a,elementType:s.type,changeType:"modified",propertyChanges:u})}}for(const[a,s]of o)r.has(a)||i.push({elementId:a,elementType:s.type,changeType:"removed"});return i}calculatePropertyChanges(t,n){const i=[],o=t,r=n,a=new Set([...Object.keys(o),...Object.keys(r)]);for(const s of a)s!=="id"&&JSON.stringify(o[s])!==JSON.stringify(r[s])&&i.push({property:s,oldValue:o[s],newValue:r[s]});return i}getSlideTitle(t){const n=t.elements.find(i=>{var o;return i.type==="text"&&((o=i.content)==null?void 0:o.text)});if(n){const i=n.content.text;return i.substring(0,50)+(i.length>50?"...":"")}return`Slide ${t.id}`}generateAutoDescription(t){if(!t)return"Initial version";const n=[],{summary:i}=t;return i.slidesAdded>0&&n.push(`+${i.slidesAdded} slide(s)`),i.slidesRemoved>0&&n.push(`-${i.slidesRemoved} slide(s)`),i.slidesModified>0&&n.push(`~${i.slidesModified} slide(s) modified`),t.metadataChanges.length>0&&n.push("metadata updated"),n.length>0?n.join(", "):"No significant changes"}clonePresentation(t){return JSON.parse(JSON.stringify(t))}generateVersionId(){return`v_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}pruneVersions(){const t=Array.from(this.versions.values()).filter(o=>!o.branchName||o.branchName===this.currentBranch).sort((o,r)=>o.versionNumber-r.versionNumber),n=new Set;if(this.currentVersionId&&n.add(this.currentVersionId),this.config.preserveLabeledVersions)for(const o of t)o.label&&n.add(o.versionId);const i=t.slice(-this.config.maxVersions);for(const o of i)n.add(o.versionId);for(const o of t)n.has(o.versionId)||this.versions.delete(o.versionId)}exportHistory(){return JSON.stringify({presentationId:this.presentationId,currentVersionId:this.currentVersionId,currentBranch:this.currentBranch,versions:Array.from(this.versions.values()),branches:Array.from(this.branches.values())})}importHistory(t){const n=JSON.parse(t);this.presentationId=n.presentationId,this.currentVersionId=n.currentVersionId,this.currentBranch=n.currentBranch,this.versions=new Map(n.versions.map(i=>[i.versionId,i])),this.branches=new Map(n.branches.map(i=>[i.name,i]))}dispose(){this.cancelAutoSave()}}class Ua{constructor(t,n){this.slides=new Map,this.elements=new Map,this.templates=new Map,this.collections=new Map,this.linkedInstances=new Map,this.currentUser=t,this.onUpdate=n}addSlide(t,n){const i=this.generateId(),o=new Date().toISOString(),r={metadata:{id:i,type:"slide",name:n.name,description:n.description,tags:n.tags??[],collectionIds:n.collectionIds??[],createdBy:this.currentUser,createdAt:o,updatedAt:o,version:1,usageCount:0,visibility:n.visibility??"private"},slide:this.cloneSlide(t),placeholders:n.placeholders};return this.slides.set(i,r),this.updateCollectionCounts(),r}updateSlide(t,n){var o;const i=this.slides.get(t);return!i||i.metadata.createdBy.id!==this.currentUser.id?null:(n.slide&&(i.slide=this.cloneSlide(n.slide),i.metadata.version++),n.name!==void 0&&(i.metadata.name=n.name),n.description!==void 0&&(i.metadata.description=n.description),n.tags!==void 0&&(i.metadata.tags=n.tags),n.placeholders!==void 0&&(i.placeholders=n.placeholders),i.metadata.updatedAt=new Date().toISOString(),(o=this.onUpdate)==null||o.call(this,"slide",t),i)}removeSlide(t){const n=this.slides.get(t);return!n||n.metadata.createdBy.id!==this.currentUser.id?!1:(this.slides.delete(t),this.updateCollectionCounts(),!0)}getSlide(t){return this.slides.get(t)}useSlide(t,n){const i=this.slides.get(t);if(!i)return null;i.metadata.usageCount++;const o=this.cloneSlide(i.slide);if(o.id=this.generateId(),n!=null&&n.placeholderValues&&i.placeholders&&this.applyPlaceholderValues(o,i.placeholders,n.placeholderValues),n!=null&&n.elementOverrides)for(const r of o.elements){const a=n.elementOverrides[r.id];a&&Object.assign(r,a)}return n!=null&&n.backgroundOverride&&(o.background=n.backgroundOverride),o}linkSlide(t,n,i,o){const r=this.slides.get(t);if(!r)return null;const a=this.generateId(),s={instanceId:a,libraryItemId:t,presentationId:n,slideIndex:i,overrides:o,syncStatus:"synced",syncedVersion:r.metadata.version};return this.linkedInstances.set(a,s),r.metadata.usageCount++,s}syncLinkedSlide(t){const n=this.linkedInstances.get(t);if(!n)return null;const i=this.slides.get(n.libraryItemId);if(!i)return null;const o=this.useSlide(n.libraryItemId,n.overrides);return o&&(n.syncStatus="synced",n.syncedVersion=i.metadata.version),o}getOutdatedInstances(){const t=[];for(const n of this.linkedInstances.values()){const i=this.slides.get(n.libraryItemId);i&&i.metadata.version>n.syncedVersion&&(n.syncStatus="outdated",t.push(n))}return t}addElement(t,n){const i=this.generateId(),o=new Date().toISOString(),r={metadata:{id:i,type:"element",name:n.name,description:n.description,tags:n.tags??[],createdBy:this.currentUser,createdAt:o,updatedAt:o,version:1,usageCount:0,visibility:n.visibility??"private"},element:JSON.parse(JSON.stringify(t))};return this.elements.set(i,r),r}getElement(t){return this.elements.get(t)}useElement(t){const n=this.elements.get(t);if(!n)return null;n.metadata.usageCount++;const i=JSON.parse(JSON.stringify(n.element));return i.id=this.generateId(),i}addTemplate(t,n){const i=this.generateId(),o=new Date().toISOString(),r={metadata:{id:i,type:"template",name:n.name,description:n.description,tags:n.tags??[],createdBy:this.currentUser,createdAt:o,updatedAt:o,version:1,usageCount:0,visibility:n.visibility??"private"},slides:t.map(a=>this.cloneSlide(a)),variables:n.variables,useCases:n.useCases};return this.templates.set(i,r),r}getTemplate(t){return this.templates.get(t)}useTemplate(t,n){const i=this.templates.get(t);if(!i)return null;i.metadata.usageCount++;const o=i.slides.map(r=>{const a=this.cloneSlide(r);return a.id=this.generateId(),a});return n&&i.variables&&this.applyTemplateVariables(o,i.variables,n),o}createCollection(t){const n=this.generateId(),i={id:n,name:t.name,description:t.description,icon:t.icon,color:t.color,parentId:t.parentId,itemCount:0,createdBy:this.currentUser,createdAt:new Date().toISOString(),visibility:t.visibility??"private"};return this.collections.set(n,i),i}getCollections(){return Array.from(this.collections.values())}addToCollection(t,n){const i=this.slides.get(t),o=this.elements.get(t),r=this.templates.get(t),a=i??o??r;return!a||!this.collections.get(n)?!1:(a.metadata.collectionIds||(a.metadata.collectionIds=[]),a.metadata.collectionIds.includes(n)||(a.metadata.collectionIds.push(n),this.updateCollectionCounts()),!0)}search(t){let n=[];const i=t.types??["slide","element","template"];if(i.includes("slide")&&n.push(...Array.from(this.slides.values())),i.includes("element")&&n.push(...Array.from(this.elements.values())),i.includes("template")&&n.push(...Array.from(this.templates.values())),t.visibility&&(n=n.filter(u=>t.visibility.includes(u.metadata.visibility))),t.query){const u=t.query.toLowerCase();n=n.filter(f=>{var h,y;return f.metadata.name.toLowerCase().includes(u)||((h=f.metadata.description)==null?void 0:h.toLowerCase().includes(u))||((y=f.metadata.tags)==null?void 0:y.some(p=>p.toLowerCase().includes(u)))})}t.tags&&t.tags.length>0&&(n=n.filter(u=>t.tags.some(f=>{var h;return(h=u.metadata.tags)==null?void 0:h.includes(f)}))),t.collectionIds&&t.collectionIds.length>0&&(n=n.filter(u=>t.collectionIds.some(f=>{var h;return(h=u.metadata.collectionIds)==null?void 0:h.includes(f)}))),t.createdBy&&(n=n.filter(u=>u.metadata.createdBy.id===t.createdBy));const o=t.sortBy??"updatedAt",r=t.sortOrder??"desc";n.sort((u,f)=>{let h=0;switch(o){case"name":h=u.metadata.name.localeCompare(f.metadata.name);break;case"createdAt":h=u.metadata.createdAt.localeCompare(f.metadata.createdAt);break;case"updatedAt":h=u.metadata.updatedAt.localeCompare(f.metadata.updatedAt);break;case"usageCount":h=u.metadata.usageCount-f.metadata.usageCount;break}return r==="desc"?-h:h});const a=n.length,s=t.offset??0,c=t.limit??20;return n=n.slice(s,s+c),{items:n,totalCount:a,hasMore:s+n.length<a}}getRecent(t=10){return this.search({sortBy:"updatedAt",sortOrder:"desc",limit:t}).items}getFavorites(){return[...Array.from(this.slides.values()),...Array.from(this.elements.values()),...Array.from(this.templates.values())].filter(n=>n.metadata.isFavorite)}toggleFavorite(t){const n=this.slides.get(t)??this.elements.get(t)??this.templates.get(t);return n?(n.metadata.isFavorite=!n.metadata.isFavorite,!0):!1}generateId(){return`lib_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}cloneSlide(t){return JSON.parse(JSON.stringify(t))}applyPlaceholderValues(t,n,i){for(const o of n){const r=i[o.id];if(r===void 0)continue;const a=t.elements.find(s=>s.id===o.elementId);if(a)switch(o.type){case"text":a.type==="text"&&a.content&&(a.content.text=String(r));break;case"image":a.type==="image"&&a.content&&(a.content.src=String(r));break;case"chart-data":a.type==="chart"&&a.content&&(a.content.data=r);break;case"table-data":a.type==="table"&&a.content&&(a.content.rows=r);break}}}applyTemplateVariables(t,n,i){const o={};for(const r of n){const a=i[r.name]??r.defaultValue;a!==void 0&&(o[`{{${r.name}}}`]=String(a))}for(const r of t)for(const a of r.elements)if(a.type==="text"&&a.content){let s=a.content.text;for(const[c,u]of Object.entries(o))s=s.replace(new RegExp(c.replace(/[{}]/g,"\\$&"),"g"),u);a.content.text=s}}updateCollectionCounts(){for(const n of this.collections.values())n.itemCount=0;const t=[...Array.from(this.slides.values()),...Array.from(this.elements.values()),...Array.from(this.templates.values())];for(const n of t)for(const i of n.metadata.collectionIds??[]){const o=this.collections.get(i);o&&o.itemCount++}}exportLibrary(){return JSON.stringify({slides:Array.from(this.slides.values()),elements:Array.from(this.elements.values()),templates:Array.from(this.templates.values()),collections:Array.from(this.collections.values())})}importLibrary(t){const n=JSON.parse(t);this.slides=new Map(n.slides.map(i=>[i.metadata.id,i])),this.elements=new Map(n.elements.map(i=>[i.metadata.id,i])),this.templates=new Map(n.templates.map(i=>[i.metadata.id,i])),this.collections=new Map(n.collections.map(i=>[i.id,i]))}}function Ot(e){const t=e.data;if(typeof t=="string")return t;switch(t.type){case"url":return t.url;case"email":return`mailto:${t.to}${t.subject||t.body?"?":""}${t.subject?`subject=${encodeURIComponent(t.subject)}`:""}${t.subject&&t.body?"&":""}${t.body?`body=${encodeURIComponent(t.body)}`:""}`;case"phone":return`tel:${t.number}`;case"sms":return`sms:${t.number}${t.message?`?body=${encodeURIComponent(t.message)}`:""}`;case"vcard":return Va(t);case"wifi":return`WIFI:T:${t.encryption};S:${t.ssid};P:${t.password??""};H:${t.hidden?"true":"false"};;`;case"geo":return`geo:${t.latitude},${t.longitude}${t.altitude?`,${t.altitude}`:""}${t.label?`?q=${encodeURIComponent(t.label)}`:""}`;case"calendar":return Ha(t);case"presentation-link":return Qa(t);case"feedback-form":return`${ze()}/feedback/${t.formId}?p=${t.presentationId}`;case"poll":return`${ze()}/poll/${t.pollId}`;default:return String(t)}}function Va(e){const t=["BEGIN:VCARD","VERSION:3.0",`N:${e.lastName};${e.firstName};;;`,`FN:${e.firstName} ${e.lastName}`];if(e.organization&&t.push(`ORG:${e.organization}`),e.title&&t.push(`TITLE:${e.title}`),e.email&&t.push(`EMAIL:${e.email}`),e.phone&&t.push(`TEL;TYPE=WORK:${e.phone}`),e.mobile&&t.push(`TEL;TYPE=CELL:${e.mobile}`),e.website&&t.push(`URL:${e.website}`),e.note&&t.push(`NOTE:${e.note}`),e.address){const n=e.address;t.push(`ADR;TYPE=WORK:;;${n.street??""};${n.city??""};${n.state??""};${n.postalCode??""};${n.country??""}`)}return t.push("END:VCARD"),t.join(`
151
+ `)}function Ha(e){const t=(i,o)=>{const r=new Date(i);return o?r.toISOString().replace(/[-:]/g,"").split("T")[0]:r.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")},n=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`DTSTART${e.allDay?";VALUE=DATE":""}:${t(e.startDate,e.allDay)}`,`DTEND${e.allDay?";VALUE=DATE":""}:${t(e.endDate,e.allDay)}`,`SUMMARY:${e.title}`];return e.description&&n.push(`DESCRIPTION:${e.description}`),e.location&&n.push(`LOCATION:${e.location}`),n.push("END:VEVENT","END:VCALENDAR"),n.join(`
152
+ `)}function Qa(e){const t=`${ze()}/present/${e.presentationId}`,n=new URLSearchParams;e.slideIndex!==void 0&&n.set("slide",String(e.slideIndex)),e.accessCode&&n.set("code",e.accessCode),e.allowDownload&&n.set("download","1");const i=n.toString();return i?`${t}?${i}`:t}function ze(){return typeof window<"u"?window.location.origin:"https://app.nice2dev.com"}function Ka(e){const t=e.qrCodes.map(n=>({id:n.id,dataUrl:"",rawData:Ot(n),size:n.size??256,config:{...n,errorCorrection:n.errorCorrection??"M",style:{foregroundColor:"#000000",backgroundColor:"#fff",cornerSquareStyle:"square",dotStyle:"square",...n.style}}}));return{id:e.id,type:"qrcode",title:e.title,subtitle:e.subtitle,config:{...e,layout:e.layout??"single",showLabels:e.showLabels??!0,animate:e.animate??!0},qrCodes:t}}function Ya(e,t){return{id:"presentation-link-slide",title:(t==null?void 0:t.title)??"Join the Presentation",subtitle:"Scan to follow along on your device",layout:"single",qrCodes:[{id:"presentation-qr",type:"presentation-link",data:{type:"presentation-link",presentationId:e,accessCode:t==null?void 0:t.accessCode,expiresAt:t!=null&&t.expiresIn?new Date(Date.now()+t.expiresIn*60*60*1e3).toISOString():void 0},label:"Open Presentation",size:400,style:{cornerSquareStyle:"rounded",dotStyle:"rounded",frame:{style:"banner",text:"Scan Me",color:"#1976d2",textColor:"#fff"}}}],callToAction:"Scan the QR code to view on your device",showLabels:!0,animate:!0}}function Ga(e,t){return{id:"feedback-slide",title:"We Value Your Feedback",subtitle:"Help us improve",layout:"single",qrCodes:[{id:"feedback-qr",type:"feedback-form",data:{type:"feedback-form",formId:`feedback_${Date.now()}`,presentationId:e,questions:t??[{id:"q1",type:"rating",question:"How would you rate this presentation?",required:!0},{id:"q2",type:"text",question:"What did you find most valuable?",required:!1},{id:"q3",type:"text",question:"Any suggestions for improvement?",required:!1}],anonymous:!0},label:"Share Feedback",size:350,style:{foregroundColor:"#2e7d32",cornerSquareStyle:"rounded",dotStyle:"classy-rounded"}}],callToAction:"Your feedback helps us improve!",instructions:"Scan the code and answer a few quick questions",showLabels:!0}}function Xa(e,t,n){const i=`poll_${Date.now()}`;return{id:"poll-slide",title:"Live Poll",subtitle:e,layout:"single",qrCodes:[{id:"poll-qr",type:"poll",data:{type:"poll",pollId:i,question:e,options:t,allowMultiple:(n==null?void 0:n.allowMultiple)??!1,showResults:(n==null?void 0:n.showResults)??!0,closesAt:n!=null&&n.closesIn?new Date(Date.now()+n.closesIn*60*1e3).toISOString():void 0},label:"Vote Now",size:350,style:{foregroundColor:"#7b1fa2",cornerSquareStyle:"dot",dotStyle:"dots"}}],callToAction:"Cast your vote!",instructions:"Scan to participate in the poll",showLabels:!0,animate:!0}}function Ja(e){return{id:"contact-slide",title:"Connect With Me",subtitle:`${e.firstName} ${e.lastName}`,layout:"single",qrCodes:[{id:"contact-qr",type:"vcard",data:{type:"vcard",...e},label:"Save Contact",size:350,style:{cornerSquareStyle:"rounded",dotStyle:"rounded",frame:{style:"rounded",text:"Add to Contacts",color:"#424242",textColor:"#fff"}}}],callToAction:"Scan to save my contact information",showLabels:!0}}function Za(e,t,n="WPA"){return{id:"wifi-slide",title:"WiFi Network",subtitle:e,layout:"single",qrCodes:[{id:"wifi-qr",type:"wifi",data:{type:"wifi",ssid:e,password:t,encryption:n},label:"Connect to WiFi",size:300,style:{foregroundColor:"#0288d1",cornerSquareStyle:"rounded",dotStyle:"rounded"}}],callToAction:"Scan to connect automatically",showLabels:!0}}function es(e){return{id:"multi-qr-slide",title:"Resources & Links",layout:e.length<=2?"side-by-side":"grid",qrCodes:e.map((t,n)=>({id:`qr-${n}`,type:"url",data:t.url,label:t.label,size:e.length<=2?250:180,style:{foregroundColor:t.color??"#000000",cornerSquareStyle:"rounded",dotStyle:"rounded"}})),showLabels:!0,animate:!0}}const je=["#ff6b6b","#4ecdc4","#45b7d1","#96ceb4","#ffeaa7","#dda0dd","#98d8c8","#f7dc6f","#bb8fce","#85c1e9"];function ts(e){return je[e%je.length]}function jt(e,t){const n=e.toArray();return{version:"1.0",id:t.get("id")||Date.now().toString(),title:t.get("title")||"Untitled",author:t.get("author"),slideSize:t.get("slideSize")??{width:1920,height:1080},slides:n,theme:t.get("theme")??{backgroundColor:"#1a1a2e",textColor:"#fff",accentColor:"#4ecdc4",fontHeading:"Inter",fontBody:"Inter"},speakerSettings:t.get("speakerSettings"),metadata:t.get("metadata")??{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}}}function Ae(e,t,n,i){i.transact(()=>{t.length>0&&t.delete(0,t.length),t.push(e.slides),n.set("id",e.id),n.set("version",e.version),n.set("title",e.title),n.set("author",e.author),n.set("slideSize",e.slideSize),n.set("theme",e.theme),n.set("speakerSettings",e.speakerSettings),n.set("metadata",{...e.metadata,updatedAt:new Date().toISOString()})})}function ns(e){const{provider:t,user:n,initialDocument:i,onSync:o,onUserJoin:r,onUserLeave:a,onConnectionChange:s,createYDoc:c,createProvider:u,createUndoManager:f}=e,h=d.useRef(null),y=d.useRef(null),p=d.useRef(null),[m,g]=d.useState({document:i||null,collaborators:[],collaboratorSlides:new Map,collaboratorEditing:new Map,cursors:new Map,selections:new Map,isConnected:!1,isSynced:!1,localUser:n,undoManager:null});d.useEffect(()=>{var P,W;if(!c)return;const k=c();h.current=k;const A=k.getArray("slides"),j=k.getMap("meta");if(i&&Ae(i,A,j,k),f){const F=f(k,[A,j]);p.current=F,g(Y=>({...Y,undoManager:F}))}const H=()=>{const F=jt(A,j);g(Y=>({...Y,document:F})),o==null||o(F)};if(k.on("update",H),t&&u){const F=u(k,t);y.current=F,F.on("sync",ee=>{g(te=>({...te,isSynced:ee})),ee&&H()}),F.on("connection-error",()=>{g(ee=>({...ee,isConnected:!1})),s==null||s(!1)}),F.on("connection-close",()=>{g(ee=>({...ee,isConnected:!1})),s==null||s(!1)});const Y=F.awareness;Y.setLocalState({user:n,currentSlideId:(W=(P=i==null?void 0:i.slides)==null?void 0:P[0])==null?void 0:W.id});const Z=ee=>{const te=Y.getStates(),ie=[],me=new Map,he=new Map,ye=new Map,C=new Map;te.forEach((M,Q)=>{if(Q===Y.clientID||!(M!=null&&M.user))return;const J={id:M.user.id,name:M.user.name,color:M.user.color||ts(ie.length),avatar:M.user.avatar};ie.push(J),M.currentSlideId&&me.set(J.id,M.currentSlideId),M.editingElementId!==void 0&&he.set(J.id,M.editingElementId),M.cursor&&ye.set(J.id,{x:M.cursor.x,y:M.cursor.y}),M.selection&&C.set(J.id,M.selection)}),g(M=>({...M,collaborators:ie,collaboratorSlides:me,collaboratorEditing:he,cursors:ye,selections:C,isConnected:F.connected}));for(const M of ee.added){const Q=te.get(M);Q!=null&&Q.user&&(r==null||r(Q.user))}for(const M of ee.removed)a==null||a({id:String(M),name:"",color:""})};Y.on("change",Z),F.connect(),g(ee=>({...ee,isConnected:F.connected})),s==null||s(F.connected)}return()=>{var F,Y;k.off("update",H),(F=y.current)==null||F.destroy(),(Y=h.current)==null||Y.destroy(),p.current=null,h.current=null,y.current=null}},[]);const b=d.useCallback((k,A)=>{const j=h.current;if(!j)return;const H=j.getArray("slides");j.transact(()=>{A!==void 0&&A<H.length?H.insert(A,[k]):H.push([k])})},[]),S=d.useCallback((k,A)=>{const j=h.current;if(!j)return;const H=j.getArray("slides");j.transact(()=>{const P=H.toArray(),W=P.findIndex(Y=>Y.id===k);if(W===-1)return;const F={...P[W],...A};H.delete(W,1),H.insert(W,[F])})},[]),x=d.useCallback(k=>{const A=h.current;if(!A)return;const j=A.getArray("slides");A.transact(()=>{const P=j.toArray().findIndex(W=>W.id===k);P!==-1&&j.delete(P,1)})},[]),$=d.useCallback(k=>{const A=h.current;if(!A)return;const j=A.getArray("slides");A.transact(()=>{const H=j.toArray(),P=k.map(W=>H.find(F=>F.id===W)).filter(Boolean);P.length===H.length&&(j.delete(0,j.length),j.push(P))})},[]),E=d.useCallback((k,A)=>{const j=h.current;if(!j)return;const H=j.getArray("slides");j.transact(()=>{const P=H.toArray(),W=P.findIndex(Z=>Z.id===k);if(W===-1)return;const F=P[W],Y={...F,elements:[...F.elements,A]};H.delete(W,1),H.insert(W,[Y])})},[]),R=d.useCallback((k,A,j)=>{const H=h.current;if(!H)return;const P=H.getArray("slides");H.transact(()=>{const W=P.toArray(),F=W.findIndex(te=>te.id===k);if(F===-1)return;const Y=W[F],Z=Y.elements.map(te=>te.id===A?{...te,...j}:te),ee={...Y,elements:Z};P.delete(F,1),P.insert(F,[ee])})},[]),z=d.useCallback((k,A)=>{const j=h.current;if(!j)return;const H=j.getArray("slides");j.transact(()=>{const P=H.toArray(),W=P.findIndex(Z=>Z.id===k);if(W===-1)return;const F=P[W],Y={...F,elements:F.elements.filter(Z=>Z.id!==A)};H.delete(W,1),H.insert(W,[Y])})},[]),V=d.useCallback(k=>{const A=h.current;if(!A)return;const j=A.getMap("meta");A.transact(()=>{const H=j.get("theme")||{};j.set("theme",{...H,...k})})},[]),_=d.useCallback(k=>{const A=h.current;if(!A)return;const j=A.getMap("meta");A.transact(()=>{const H=j.get("metadata")||{};j.set("metadata",{...H,...k,updatedAt:new Date().toISOString()})})},[]),D=d.useCallback(k=>{const A=h.current;if(!A)return;const j=A.getMap("meta");A.transact(()=>{j.set("title",k)})},[]),L=d.useCallback(k=>{var A;(A=y.current)==null||A.awareness.setLocalStateField("currentSlideId",k)},[]),K=d.useCallback(k=>{var A;(A=y.current)==null||A.awareness.setLocalStateField("editingElementId",k)},[]),G=d.useCallback(k=>{var A,j;k?(A=y.current)==null||A.awareness.setLocalStateField("cursor",{...k,timestamp:Date.now()}):(j=y.current)==null||j.awareness.setLocalStateField("cursor",null)},[]),I=d.useCallback(k=>{var A;(A=y.current)==null||A.awareness.setLocalStateField("selection",k)},[]),N=d.useCallback(()=>{var k;(k=p.current)==null||k.undo()},[]),v=d.useCallback(()=>{var k;(k=p.current)==null||k.redo()},[]),O=d.useCallback(()=>{var k;(k=y.current)==null||k.connect()},[]),B=d.useCallback(()=>{var k;(k=y.current)==null||k.disconnect()},[]),U=d.useCallback(k=>{const A=h.current;if(!A){g(P=>({...P,document:k}));return}const j=A.getArray("slides"),H=A.getMap("meta");Ae(k,j,H,A)},[]),X=d.useCallback(()=>m.document,[m.document]);return{state:m,actions:{addSlide:b,updateSlide:S,deleteSlide:x,reorderSlides:$,addElement:E,updateElement:R,deleteElement:z,updateTheme:V,updateMetadata:_,setTitle:D,setCurrentSlide:L,setEditingElement:K,setCursor:G,setSelection:I,undo:N,redo:v,connect:O,disconnect:B,setDocument:U,getDocument:X}}}exports.BRAND_KIT_CORPORATE=Ir;exports.BRAND_KIT_NICE2DEV=kr;exports.BRAND_KIT_STARTUP=Cr;exports.BUILT_IN_TRANSITIONS=ht;exports.BackgroundRenderer=bt;exports.CharacterRegistry=Pe;exports.DEFAULT_KPI_COLORS=Rt;exports.DialogueBox=wt;exports.EffectRenderer=vt;exports.InteractiveButton=ro;exports.InteractiveCountdown=lo;exports.InteractivePoll=so;exports.InteractiveQnA=uo;exports.InteractiveQuiz=co;exports.NiceI18nProvider=Ue;exports.NicePresentationEditor=Ke;exports.NicePresentationPlayer=Xe;exports.NicePresentationToolbar=ke;exports.NiceSlideCanvas=ae;exports.NiceSlidePropertyPanel=Ie;exports.NiceSlideThumbnailList=Ce;exports.PresentationModel=we;exports.PresentationToolbar=ke;exports.PresentationVersionManager=Ba;exports.PuppetAnimationController=xt;exports.PuppetCharacter=zr;exports.PuppetSceneBuilder=jr;exports.PuppetShowMiniPlayer=Yr;exports.PuppetShowPlayer=At;exports.PuppetStage=St;exports.SLIDE_16_9=rn;exports.SLIDE_4_3=an;exports.SLIDE_WIDESCREEN=sn;exports.SlideCanvas=ae;exports.SlideLibraryManager=Ua;exports.SlidePropertyPanel=Ie;exports.SlideThumbnailList=Ce;exports.THEME_CORPORATE=Ge;exports.THEME_MINIMAL=ln;exports.THEME_MODERN_DARK=cn;exports.THEME_NICE2DEV=dn;exports.TRANSITION_BLUR_FADE=lt;exports.TRANSITION_CIRCLE_REVEAL=pt;exports.TRANSITION_CUBE_LEFT=st;exports.TRANSITION_FADE=Je;exports.TRANSITION_FLIP_HORIZONTAL=rt;exports.TRANSITION_FLIP_VERTICAL=at;exports.TRANSITION_GLITCH=ft;exports.TRANSITION_MORPH=mt;exports.TRANSITION_ROTATE_IN=ct;exports.TRANSITION_SLIDE_DOWN=nt;exports.TRANSITION_SLIDE_LEFT=Ze;exports.TRANSITION_SLIDE_RIGHT=et;exports.TRANSITION_SLIDE_UP=tt;exports.TRANSITION_WIPE_LEFT=dt;exports.TRANSITION_WIPE_RIGHT=ut;exports.TRANSITION_ZOOM_IN=it;exports.TRANSITION_ZOOM_OUT=ot;exports.TimelineEngine=It;exports.TimelineTrackBuilder=Or;exports.addAnimationToCharacter=$r;exports.addExpressionToCharacter=Er;exports.applyBrandKit=vr;exports.applyEasing=yo;exports.applyFiltersToData=za;exports.applySortToData=Ma;exports.brandKitToTheme=gt;exports.calculateSummaryRow=Aa;exports.cloneTimeline=Fr;exports.computeCustomTransitionState=mo;exports.computeElementState=nn;exports.computeKPIStatus=ya;exports.computeTransitionState=Ye;exports.computeTrend=ga;exports.createCharacterFromSpriteSheet=Tr;exports.createComparisonWidget=wa;exports.createContactSlide=Ja;exports.createCustomTransition=go;exports.createCustomerCountWidget=Dt;exports.createDashboardSlide=ha;exports.createDataGridSlide=Ca;exports.createEmployeeDataGrid=Ea;exports.createExecutiveDashboard=ka;exports.createFeedbackSlide=Ga;exports.createKQLQuerySlide=Wa;exports.createMultiQRSlide=es;exports.createODataQuerySlide=La;exports.createOperationalDashboard=Ia;exports.createPercentageGauge=ba;exports.createPollSlide=Xa;exports.createPresentationLinkSlide=Ya;exports.createQRCodeSlide=Ka;exports.createQuerySlide=Pa;exports.createRevenueWidget=qt;exports.createSalesDataGrid=$a;exports.createSalesQuerySlide=Fa;exports.createSampleArchitectureData=er;exports.createSampleIncidentReportData=br;exports.createSampleOnboardingData=cr;exports.createSampleProductPitchData=Oo;exports.createSampleQuarterlyReportData=_o;exports.createSampleSprintReviewData=Ho;exports.createSparklineTrend=va;exports.createSpriteSheetFromFrames=Zr;exports.createTrafficLight=Sa;exports.createWiFiSlide=Za;exports.detectBestVisualization=Oa;exports.easingFunctions=de;exports.encodeQRContent=Ot;exports.exportCharacterToEntity=Jr;exports.exportCharacterToSprite=Et;exports.exportToHtml=Fe;exports.extractQueryParameters=Na;exports.formatCellValue=_a;exports.formatKPIValue=xa;exports.formatTime=Ur;exports.framesToTime=Br;exports.generateArchitectureOverview=Zo;exports.generateChartConfig=ja;exports.generateIncidentReport=xr;exports.generateOnboarding=sr;exports.generateProductPitch=Do;exports.generateQuarterlyReport=Ao;exports.generateSprintReview=Vo;exports.getConditionalStyle=Ta;exports.getEasingFunction=kt;exports.getSceneDuration=Lr;exports.getTrackDuration=Ct;exports.importAssetAsProp=$t;exports.importEntityAsCharacter=Tt;exports.importProjectCharacters=Gr;exports.importProjectProps=Xr;exports.importSpriteAsCharacter=_t;exports.lerp=re;exports.lerpPosition=Me;exports.mapTransitionEffectToId=ho;exports.mergePuppetShows=ma;exports.parseNdpJson=Wt;exports.parseSpriteSheetGrid=ea;exports.parseTime=Vr;exports.presentationToPuppetShow=ua;exports.puppetShowToPresentation=na;exports.removeBrandKit=Sr;exports.renderCharacterToCanvas=Mr;exports.renderChartSvg=Qe;exports.stringifyNdpJson=Ve;exports.substituteParameters=Ra;exports.syncPresentationToYjs=Ae;exports.syncYjsToPresentation=jt;exports.timeToFrames=Wr;exports.transitionRegistry=yt;exports.transitionToKeyframes=xo;exports.useCameraShake=Dr;exports.useCharacterRegistry=_r;exports.useCollaborativePresentation=ns;exports.useNiceLang=Te;exports.useNiceTranslation=ne;exports.usePresentationEditor=He;exports.usePuppetAnimation=Ar;exports.usePuppetPlayer=Hr;exports.usePuppetShowPlayer=zt;exports.usePuppetStage=Nr;exports.validateParameters=Da;exports.validateProjectForImport=ta;exports.validatePuppetShowDocument=fa;