pptx-react-viewer 1.7.2 → 1.8.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.js CHANGED
@@ -4463,7 +4463,7 @@ ${o.join(`
4463
4463
  `),s=o.flat().find(u=>u.text.trim().length>0),a=s?.style?{...s.style}:r;function l(u,p){if(p.length===0)return u.length>0?[{text:u,style:{...a}}]:[{text:"",style:{...a}}];let h=p[0].bulletInfo;if(u.length===0){let y=[{text:"",style:{...p[0].style}}];return h&&(y[0].bulletInfo=h),y}if(p.reduce((g,y)=>g+y.text.length,0)===0){let g=[NB(p[0],{text:u,style:{...p[0].style}})];return h&&(g[0].bulletInfo=h),g}let m=[],x=0;for(let g=0;g<p.length;g++){let y=p[g],b=g===p.length-1,v=y.text.length;if(x>=u.length)break;let S;if(b?S=u.slice(x):S=u.slice(x,x+v),S.length>0){let w=NB(y,{text:S,style:{...y.style}});m.length===0&&h&&(w.bulletInfo=h),m.push(w);}x+=b?S.length:v;}if(m.length===0){let g=NB(p[0],{text:u,style:{...p[0].style}});return h&&(g.bulletInfo=h),[g]}return m}let c=[],d=o[o.length-1];for(let u=0;u<i.length;u++){if(u>0){let f=o[u-1]??[],m=f[0]?.style?{...f[0].style}:{...a};c.push({text:`
4464
4464
  `,style:m,isParagraphBreak:true});}let p=o[u]??d??[],h=l(i[u],p);c.push(...h);}return c.length>0?c:[{text:"",style:{...a}}]}function yU(t){return Math.max(qVe,Math.min(Jte,Math.round(t)))}function GA(t){let e=t.shapeAdjustments?.adj;return typeof e=="number"&&Number.isFinite(e)?yU(e):ZVe}function xT(t){let e=GA(t)/Jte;return Math.min(Math.max(t.width,1),Math.max(t.height,1))*.5*e}function yT(t){if(!Jt(t)||String(t.shapeType||"").toLowerCase()!=="roundrect")return null;let n=GA(t),r=xT(t),o=Math.max(t.width,KVe),i=5;return {key:"adj",left:Math.max(i,Math.min(o-i,Math.round(r))),top:-8,value:n,cursor:"ew-resize"}}function nGe(t){return QVe.test(t)}function WA(t){if(!nGe(t))throw new Error(`Invalid collaboration room ID: "${t}". Must be 1-128 alphanumeric characters, hyphens, or underscores.`);return t}function nne(t){return typeof t!="string"?"Anonymous":t.replace(tGe,"").trim().slice(0,64)||"Anonymous"}function XA(t,e=JVe){return typeof t!="string"?e:eGe.test(t)?t:e}function rne(t){if(typeof t=="string")try{let e=new URL(t);if(e.protocol==="https:"||e.protocol==="http:"||e.protocol==="data:")return t}catch{}}function one(t){return typeof t!="number"||!Number.isFinite(t)?0:Math.max(0,Math.floor(t))}function qB(t,e,n){return typeof t!="number"||!Number.isFinite(t)?0:Math.max(e-jQ,Math.min(n+jQ,t))}function ine(t,e=typeof window<"u"?window.location.protocol:void 0){if(e!=="https:")return false;let n;try{n=new URL(t);}catch{return false}return n.protocol!=="ws:"?false:!["localhost","127.0.0.1","[::1]"].includes(n.hostname)}function oGe(t){return rGe.includes(t)?t:void 0}function sne(t,e,n){return typeof t.clientId!="number"?null:{clientId:t.clientId,userName:nne(t.userName),userAvatar:rne(t.userAvatar),userColor:XA(t.userColor),activeSlideIndex:one(t.activeSlideIndex),cursorX:qB(t.cursorX,0,e),cursorY:qB(t.cursorY,0,n),lastUpdated:typeof t.lastUpdated=="string"?t.lastUpdated:new Date().toISOString(),selectedElementId:typeof t.selectedElementId=="string"?t.selectedElementId.slice(0,128):void 0,role:oGe(t.role)}}function iGe(t,e=Date.now(),n=tne){let r=new Date(t).getTime();return !Number.isNaN(r)&&e-r<=n}function ane(t,e,n,r,o=Date.now(),i=tne){let s=[];for(let[a,l]of t){if(a===e)continue;let c=l?.presence;if(!c||typeof c!="object")continue;let d=sne({...c,clientId:a},n,r);!d||!iGe(d.lastUpdated,o,i)||s.push(d);}return s}function vU(t){return typeof t=="object"&&t!==null&&typeof t.toDelta=="function"}function lne(t){let e={},n=t.style;return n&&typeof n=="object"&&Object.keys(n).length>0&&(e.s=JSON.stringify(n)),t.isParagraphBreak&&(e.pb="1"),t.isLineBreak&&(e.lb="1"),t.bulletInfo&&(e.bi=JSON.stringify(t.bulletInfo)),t.paragraphLevel!==void 0&&(e.pl=String(t.paragraphLevel)),t.endParaRunProperties&&(e.pr=JSON.stringify(t.endParaRunProperties)),typeof t.fieldType=="string"&&(e.ft=t.fieldType),typeof t.fieldGuid=="string"&&(e.fg=t.fieldGuid),(t.fieldGuidAttr==="uuid"||t.fieldGuidAttr==="id")&&(e.fga=t.fieldGuidAttr),t.fieldParagraphPropertiesXml&&(e.fp=JSON.stringify(t.fieldParagraphPropertiesXml)),t.equationXml&&(e.eq=JSON.stringify(t.equationXml)),typeof t.equationNumber=="string"&&(e.en=t.equationNumber),t.breakRunProperties&&(e.br=JSON.stringify(t.breakRunProperties)),typeof t.rubyText=="string"&&(e.rt=t.rubyText),typeof t.rubyAlignment=="string"&&(e.ra=t.rubyAlignment),t.rubyFontSize!==void 0&&(e.rfs=String(t.rubyFontSize)),t.rubyStyle&&(e.rs=JSON.stringify(t.rubyStyle)),e}function cne(t){return t.isParagraphBreak===true||t.isLineBreak===true?`
4465
4465
  `:typeof t.text=="string"&&t.text.length>0?t.text:"\u200B"}function dne(t,e){let n=0;for(let r of t){let o=r,i=lne(o),s=cne(o);e.insert(n,s,i),n+=s.length;}}function sGe(t){let e=[];for(let n of t){let r=n,o=lne(r),i=Object.keys(o).length>0?o:void 0,s=cne(r),a=e[e.length-1];a&&typeof a.insert=="string"&&JSON.stringify(a.attributes??null)===JSON.stringify(i??null)?a.insert+=s:e.push(i?{insert:s,attributes:i}:{insert:s});}return e}function ZB(t){let e=[];for(let n of t){if(typeof n.insert!="string"||n.insert==="")continue;let r=n.attributes??{},o={text:"",style:{}};if(r.s)try{o.style=JSON.parse(r.s);}catch{o.style={};}if(r.pb==="1"&&(o.isParagraphBreak=true),r.lb==="1"&&(o.isLineBreak=true),r.bi)try{o.bulletInfo=JSON.parse(r.bi);}catch{}if(r.pl!==void 0&&(o.paragraphLevel=Number(r.pl)),r.pr)try{o.endParaRunProperties=JSON.parse(r.pr);}catch{}if(r.ft&&(o.fieldType=r.ft),r.fg&&(o.fieldGuid=r.fg),(r.fga==="uuid"||r.fga==="id")&&(o.fieldGuidAttr=r.fga),r.fp)try{o.fieldParagraphPropertiesXml=JSON.parse(r.fp);}catch{}if(r.eq)try{o.equationXml=JSON.parse(r.eq);}catch{}if(r.en&&(o.equationNumber=r.en),r.br)try{o.breakRunProperties=JSON.parse(r.br);}catch{}if(r.rt&&(o.rubyText=r.rt),r.ra&&(o.rubyAlignment=r.ra),r.rfs!==void 0&&(o.rubyFontSize=Number(r.rfs)),r.rs)try{o.rubyStyle=JSON.parse(r.rs);}catch{}n.insert!==`
4466
- `&&n.insert!=="\u200B"&&(o.text=n.insert),e.push(o);}return e}function aGe(t){return ZB(t.toDelta())}function pne(t,e,n){let r=t;for(let[o,i]of Object.entries(r))if(i!==void 0)if(une.has(o))e.set(o,i);else if(o==="textSegments"){if(Array.isArray(i)){let s=n.createText();dne(i,s),e.set("textBody",s);}}else dA[o]&&e.set(dA[o],JSON.stringify(i));}function cGe(t){let e={};return t.forEach((n,r)=>{if(r==="textBody")vU(n)&&(e.textSegments=aGe(n));else if(YQ[r])try{e[YQ[r]]=JSON.parse(n);}catch{}else e[r]=n;}),e}function dGe(t,e,n){let r=t;for(let i of wU)r[i]!==void 0&&e.set(i,r[i]);for(let[i,s]of Object.entries(TU))r[i]!==void 0&&e.set(s,JSON.stringify(r[i]));let o=n.createArray();for(let i of t.elements){let s=n.createMap();pne(i,s,n),o.push([s]);}e.set("elements",o);}function uGe(t){let e={};for(let o of wU){let i=t.get(o);i!==void 0&&(e[o]=i);}for(let[o,i]of Object.entries(lGe)){let s=t.get(o);if(s!==void 0)try{e[i]=JSON.parse(s);}catch{}}let n=t.get("elements"),r=[];if(n)for(let o=0;o<n.length;o++)r.push(cGe(n.get(o)));return e.elements=r,e}function CU(t){let e=t.getArray(SU),n=[];for(let r=0;r<e.length;r++)n.push(uGe(e.get(r)));return n}function hne(t,e){let n=t.getArray(SU);return n.observeDeep(e),()=>n.unobserveDeep(e)}function pGe(t){return vU(t)&&typeof t.delete=="function"&&typeof t.format=="function"}function LB(t){let e="";for(let n of t)typeof n.insert=="string"&&(e+=n.insert);return e}function mGe(t,e){let n=Math.min(t.length,e.length),r=0;for(;r<n&&t.charCodeAt(r)===e.charCodeAt(r);)r++;return r>0&&hGe(t.charCodeAt(r-1))&&r--,r}function gGe(t,e,n){let r=Math.min(t.length,e.length)-n,o=0;for(;o<r&&t.charCodeAt(t.length-o-1)===e.charCodeAt(e.length-o-1);)o++;return o>0&&fGe(t.charCodeAt(t.length-o))&&o--,o}function xGe(t,e,n,r){let o=0,i=n;for(let s of e){if(typeof s.insert!="string")continue;let a=o+s.insert.length,l=Math.max(o,n),c=Math.min(a,r);if(l<c){let d=s.insert.slice(l-o,c-o);t.insert(i,d,s.attributes??{}),i+=d.length;}o=a;}}function yGe(t,e){let n=Object.keys(t);return n.length!==Object.keys(e).length?false:n.every(r=>t[r]===e[r])}function bGe(t,e){let n=t.toDelta().filter(s=>typeof s.insert=="string"),r=0,o=0,i=0;for(let s of e){if(typeof s.insert!="string")continue;let a=s.attributes??{},l=s.insert.length;for(;l>0&&r<n.length;){let c=n[r].insert,d=Math.min(c.length-o,l),u=n[r].attributes??{};if(!yGe(u,a)){let p={};for(let h of Object.keys(a))u[h]!==a[h]&&(p[h]=a[h]);for(let h of Object.keys(u))h in a||(p[h]=null);t.format(i,d,p);}i+=d,l-=d,o+=d,o>=c.length&&(r++,o=0);}}}function vGe(t,e){let n=LB(t.toDelta()),r=LB(e);if(n!==r){let o=mGe(n,r),i=gGe(n,r,o),s=n.length-o-i;if(s>0&&t.delete(o,s),xGe(t,e,o,r.length-i),LB(t.toDelta())!==r)return false}return bGe(t,e),true}function fne(t,e){return t===e||JSON.stringify(t)===JSON.stringify(e)}function mne(t,e,n){for(let r of n){let o=e[r],i=t.get(r);o===void 0?i!==void 0&&t.delete(r):fne(i,o)||t.set(r,o);}}function gne(t,e,n){for(let[r,o]of Object.entries(n)){let i=e[r]===void 0?void 0:JSON.stringify(e[r]),s=t.get(o);i===void 0?s!==void 0&&t.delete(o):s!==i&&t.set(o,i);}}function SGe(t,e,n){let r=e.textSegments,o=t.get("textBody");if(!Array.isArray(r)){o!==void 0&&t.delete("textBody");return}let i=sGe(r),s=ZB(i),a=vU(o)?ZB(o.toDelta()):void 0;if(a!==void 0&&fne(a,s)||pGe(o)&&vGe(o,i))return;let l=n.createText();dne(r,l),t.set("textBody",l);}function wGe(t,e,n){let r=e;mne(t,r,une),gne(t,r,dA),SGe(t,r,n);}function DB(t,e){let n=t.get(e);if(!n||typeof n.get!="function")return;let r=n.get("id");return typeof r=="string"?r:void 0}function xne(t,e,n){let r=new Set;for(let i of e){let s=n.idOf(i);typeof s=="string"&&r.add(s);}let o=new Set;for(let i=t.length-1;i>=0;i--){let s=DB(t,i);s!==void 0&&(!r.has(s)||o.has(s)?t.delete(i,1):o.add(s));}for(let i=0;i<e.length;i++){let s=e[i],a=n.idOf(s),l=i<t.length?DB(t,i):void 0;if(a===void 0){i<t.length&&l===void 0?n.update(t.get(i),s):t.insert(i,[n.create(s)]);continue}if(l===a){n.update(t.get(i),s);continue}let c=-1;for(let d=i+1;d<t.length;d++)if(DB(t,d)===a){c=d;break}c>=0&&t.delete(c,1),t.insert(i,[n.create(s)]);}t.length>e.length&&t.delete(e.length,t.length-e.length);}function CGe(t,e,n){let r=e;mne(t,r,wU),gne(t,r,TU);let o=t.get("elements");TGe(o)||(o=n.createArray(),t.set("elements",o)),xne(o,e.elements,{idOf:i=>typeof i.id=="string"?i.id:void 0,create:i=>{let s=n.createMap();return pne(i,s,n),s},update:(i,s)=>wGe(i,s,n)});}function yne(t,e,n,r=jA){e.transact(()=>{let o=e.getArray(SU);xne(o,t,{idOf:i=>typeof i.id=="string"?i.id:void 0,create:i=>{let s=n.createMap();return dGe(i,s,n),s},update:(i,s)=>CGe(i,s,n)});},r);}function JB(t){return ze(t)?t.textSegments&&t.textSegments.length>0?t.textSegments.map(e=>e.text).join(""):t.text??"":""}function Mm(t){let e=t.type.charAt(0).toUpperCase()+t.type.slice(1),n=JB(t);if(n.length>0){let r=n.length>30?`${n.slice(0,30)}...`:n;return `${e}: "${r}"`}return `${e} (${t.id})`}function QB(t){let e=[];for(let n of t)e.push(n),n.type==="group"&&n.children&&e.push(...QB(n.children));return e}function ZQ(t){let e=new Map;for(let n of t)e.set(n.id,n);return e}function MGe(t,e){let n=[],r=ZQ(QB(t)),o=ZQ(QB(e));for(let[i,s]of r)o.has(i)||n.push({elementId:i,label:Mm(s),kind:"removed",description:`Element removed: ${Mm(s)}`});for(let[i,s]of o)r.has(i)||n.push({elementId:i,label:Mm(s),kind:"added",description:`Element added: ${Mm(s)}`});for(let[i,s]of r){let a=o.get(i);if(!a)continue;(Math.abs(s.x-a.x)>KQ||Math.abs(s.y-a.y)>KQ)&&n.push({elementId:i,label:Mm(s),kind:"moved",description:`Moved from (${Math.round(s.x)}, ${Math.round(s.y)}) to (${Math.round(a.x)}, ${Math.round(a.y)})`}),(Math.abs(s.width-a.width)>qQ||Math.abs(s.height-a.height)>qQ)&&n.push({elementId:i,label:Mm(s),kind:"resized",description:`Resized from ${Math.round(s.width)}x${Math.round(s.height)} to ${Math.round(a.width)}x${Math.round(a.height)}`});let l=JB(s),c=JB(a);l!==c&&n.push({elementId:i,label:Mm(s),kind:"textChanged",description:"Text content changed"});}return n}function _Ge(t,e){let n=MGe(t.elements,e.elements);return t.backgroundColor!==e.backgroundColor&&n.push({elementId:"__background__",label:"Background",kind:"textChanged",description:`Background changed from ${t.backgroundColor??"default"} to ${e.backgroundColor??"default"}`}),(t.notes??"")!==(e.notes??"")&&n.push({elementId:"__notes__",label:"Speaker Notes",kind:"textChanged",description:"Speaker notes changed"}),n}function PGe(t,e){let n=[],r=Math.max(t.length,e.length),o=0,i=0,s=0,a=0;for(let l=0;l<r;l++){let c=t[l],d=e[l];if(c&&!d)n.push({status:"removed",baseIndex:l,compareIndex:-1,baseSlide:c,changes:[]}),i++;else if(!c&&d)n.push({status:"added",baseIndex:-1,compareIndex:l,compareSlide:d,changes:[]}),o++;else if(c&&d){let u=_Ge(c,d);u.length>0?(n.push({status:"changed",baseIndex:l,compareIndex:l,baseSlide:c,compareSlide:d,changes:u}),s++):(n.push({status:"unchanged",baseIndex:l,compareIndex:l,baseSlide:c,compareSlide:d,changes:[]}),a++);}}return {diffs:n,baseSlideCount:t.length,compareSlideCount:e.length,addedCount:o,removedCount:i,changedCount:s,unchangedCount:a}}function MU(t,e){return PGe(t.slides,e.slides)}function RGe(t,e){return e[t%e.length]}function $a(t,e,n){let r=t.style?.fillColor;return r&&r.length>0?r:RGe(e,n)}function eu(t,e){let n=t.style?.lineColor;return n&&n.length>0?n:e}function Fc(t,e,n){let r=n==="intense"?1:n==="moderate"?.92:.85;return e<=1?r:r-t/(e-1)*.15}function Hc(t){if(t==="intense")return "drop-shadow(0 2px 6px rgba(0,0,0,0.35))";if(t==="moderate")return "drop-shadow(0 1px 3px rgba(0,0,0,0.2))"}function oh(t){return t==="intense"?2:t==="moderate"?1.5:0}function Ha(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function Bl(t,e,n,r){let i=e/Math.max(1,t.length*.6),s=n*.5;return Math.max(6,Math.min(r,i,s))}function ih(t){return t>0?"rgba(255,255,255,0.3)":"none"}function kGe(t){if(t.some(o=>o.children!==void 0&&o.children.length>0)){let o=a=>({node:a,children:(a.children??[]).map(o)}),i=new Set(t.map(a=>a.id));return t.filter(a=>!a.parentId||!i.has(a.parentId)).map(o)}let n=new Map;for(let o of t)n.set(o.id,{node:o,children:[]});let r=[];for(let o of t){let i=n.get(o.id);o.parentId&&n.has(o.parentId)?n.get(o.parentId).children.push(i):r.push(i);}return r}function hy(t){return t.children.length===0?1:t.children.reduce((e,n)=>e+hy(n),0)}function bne(t){return t.children.length===0?1:1+Math.max(...t.children.map(bne))}function vne(t){let e=[],n=r=>{e.push(r);for(let o of r.children??[])n(o);};for(let r of t)n(r);return e}function IGe(t,e,n){if(n&&n in JQ)return JQ[n];if(e&&e in QQ){let o=QQ[e];if(o)return o}return t.some(o=>o.children&&o.children.length>0)?"hierarchy":"list"}function Sne(t,e,n,r,o){let{width:i,height:s}=e,a=8,l=4,c=s-a*2,d=t.length>0?(c-l*(t.length-1))/t.length:c,u=i-a*2,p=Math.min(6,d*.15),h=oh(r),f=ih(h);return {nodes:t.map((x,g)=>{let y=a+g*(d+l),b=Bl(x.text,u*.9,d,12);return {kind:"rect",key:`${o}-list-${x.id}-${g}`,x:a,y,width:u,height:d,rx:p,fill:$a(x,g,n),stroke:eu(x,f),strokeWidth:h,opacity:Fc(g,t.length,r),text:Ha(x.text,40),fontSize:b,textX:a+u/2,textY:y+d/2}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"list"}}function NGe(t,e,n,r,o){let{width:i,height:s}=e,a=8,l=4,c=Math.min(16,i*.04),d=i-a*2,u=t.length>0?(d-l*(t.length-1))/t.length:d,p=Math.min(s-a*2,s*.6),h=s/2,f=oh(r),m=ih(f);return {nodes:t.map((g,y)=>{let b=a+y*(u+l),v=p/2,S=y===0,w=y===t.length-1,C;S?C=[`${b},${h-v}`,`${b+u-c},${h-v}`,`${b+u},${h}`,`${b+u-c},${h+v}`,`${b},${h+v}`].join(" "):w?C=[`${b},${h-v}`,`${b+u},${h-v}`,`${b+u},${h+v}`,`${b},${h+v}`,`${b+c},${h}`].join(" "):C=[`${b},${h-v}`,`${b+u-c},${h-v}`,`${b+u},${h}`,`${b+u-c},${h+v}`,`${b},${h+v}`,`${b+c},${h}`].join(" ");let T=Bl(g.text,u*.7,p,12);return {kind:"polygon",key:`${o}-process-${g.id}-${y}`,points:C,fill:$a(g,y,n),stroke:eu(g,m),strokeWidth:f,opacity:Fc(y,t.length,r),text:Ha(g.text,25),fontSize:T,textX:b+u/2,textY:h}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"process"}}function LGe(t,e,n,r,o){let{width:i,height:s}=e,a=Math.min(i,s),l=i/2,c=s/2,d=a*.35,u=Math.max(a*.06,Math.min(a*.12,200/Math.max(1,t.length))),p=oh(r),h=ih(p),f=t.map((x,g)=>{let y=g/t.length*Math.PI*2-Math.PI/2,b=l+d*Math.cos(y),v=c+d*Math.sin(y),w=(g+1)%t.length/t.length*Math.PI*2-Math.PI/2,C=l+d*Math.cos(w),T=c+d*Math.sin(w),M=(y+w)/2,_=g===t.length-1?(y+w+Math.PI*2)/2:M,E=d*.15,R=l+(d+E)*Math.cos(_),I=c+(d+E)*Math.sin(_);return {key:`${o}-cycle-conn-${g}`,d:`M${b},${v} Q${R},${I} ${C},${T}`}});return {nodes:t.map((x,g)=>{let y=g/t.length*Math.PI*2-Math.PI/2,b=l+d*Math.cos(y),v=c+d*Math.sin(y),S=Bl(x.text,u*1.4,u*2,11);return {kind:"circle",key:`${o}-cycle-${x.id}-${g}`,cx:b,cy:v,r:u,fill:$a(x,g,n),stroke:eu(x,h),strokeWidth:p,opacity:Fc(g,t.length,r),text:Ha(x.text,20),fontSize:S}}),connectors:f,shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"cycle"}}function DGe(t,e,n,r,o){let i=kGe(t);if(i.length===0)return Sne(t,e,n,r,o);let{width:s,height:a}=e,l=i.reduce((w,C)=>w+hy(C),0),c=Math.max(...i.map(bne)),d=s/Math.max(1,l),u=a/Math.max(1,c),p=Math.min(d*.8,140),h=Math.min(u*.4,36),f=Math.min(6,h*.15),m=oh(r),x=ih(m),g=[],y=[],b=0;function v(w,C,T){let M=hy(w),_=(C+M/2)*d,E=T*u+u/2,R=b++,I=Bl(w.node.text,p*.9,h,11),L=C;for(let N of w.children){let D=hy(N),U=(L+D/2)*d,G=(T+1)*u+u/2,j=E+h/2+(G-h/2-(E+h/2))/2;y.push({key:`${o}-hier-conn-${w.node.id}-${N.node.id}`,d:`M${_},${E+h/2} L${_},${j} L${U},${j} L${U},${G-h/2}`}),L+=D;}let k={kind:"rect",key:`${o}-hier-${w.node.id}-${R}`,x:_-p/2,y:E-h/2,width:p,height:h,rx:f,fill:$a(w.node,R,n),stroke:eu(w.node,x),strokeWidth:m,opacity:Fc(R,t.length,r),text:Ha(w.node.text,40),fontSize:I,textX:_,textY:E};g.push(k);let F=C;for(let N of w.children)v(N,F,T+1),F+=hy(N);}let S=0;for(let w of i)v(w,S,0),S+=hy(w);return {nodes:g,connectors:y,shadowFilter:Hc(r),viewBox:`0 0 ${s} ${a}`,family:"hierarchy"}}function FGe(t,e,n,r,o){let{width:i,height:s}=e,a=Math.max(1,Math.ceil(Math.sqrt(t.length))),l=Math.max(1,Math.ceil(t.length/a)),c=8,d=6,u=i-c*2,p=s-c*2,h=(u-d*(a-1))/a,f=(p-d*(l-1))/l,m=Math.min(6,Math.min(h,f)*.1),x=oh(r),g=ih(x);return {nodes:t.map((b,v)=>{let S=v%a,w=Math.floor(v/a),C=c+S*(h+d),T=c+w*(f+d),M=Bl(b.text,h*.85,f,12);return {kind:"rect",key:`${o}-matrix-${b.id}-${v}`,x:C,y:T,width:h,height:f,rx:m,fill:$a(b,v,n),stroke:eu(b,g),strokeWidth:x,opacity:Fc(v,t.length,r),text:Ha(b.text,30),fontSize:M,textX:C+h/2,textY:T+f/2}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"matrix"}}function OGe(t,e,n,r,o){let{width:i,height:s}=e,a=i/2,l=s/2,c=Math.min(i,s),d=oh(r),u=ih(d);if(t.length===0)return {nodes:[],connectors:[],shadowFilter:void 0,viewBox:`0 0 ${i} ${s}`,family:"radial"};let[p,...h]=t,f=c*.14,m=c*.35,x=Math.max(c*.06,Math.min(c*.1,180/Math.max(1,h.length))),g=[],y=[],b=Bl(p.text,f*1.6,f*2,12);return g.push({kind:"circle",key:`${o}-radial-centre-0`,cx:a,cy:l,r:f,fill:$a(p,0,n),stroke:eu(p,u),strokeWidth:d,opacity:Fc(0,t.length,r),text:Ha(p.text,20),fontSize:b}),h.forEach((v,S)=>{let w=S+1,C=S/Math.max(1,h.length)*Math.PI*2-Math.PI/2,T=a+m*Math.cos(C),M=l+m*Math.sin(C),_=Bl(v.text,x*1.4,x*2,10),E=a+f*Math.cos(C),R=l+f*Math.sin(C);y.push({key:`${o}-radial-conn-${w}`,d:`M${E},${R} L${T},${M}`}),g.push({kind:"circle",key:`${o}-radial-${v.id}-${w}`,cx:T,cy:M,r:x,fill:$a(v,w,n),stroke:eu(v,u),strokeWidth:d,opacity:Fc(w,t.length,r),text:Ha(v.text,20),fontSize:_});}),{nodes:g,connectors:y,shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"radial"}}function BGe(t,e,n,r,o){let{width:i,height:s}=e,a=8,l=3,c=s-a*2,d=t.length>0?(c-l*(t.length-1))/t.length:c,u=i-a*2,p=oh(r),h=ih(p);return {nodes:t.map((m,x)=>{let g=.3+x/Math.max(t.length-1,1)*.7,y=x<t.length-1?.3+(x+1)/Math.max(t.length-1,1)*.7:1,b=u*g,v=u*y,S=a+x*(d+l),w=(i-b)/2,C=w+b,T=(i-v)/2,M=T+v,_=[`${w},${S}`,`${C},${S}`,`${M},${S+d}`,`${T},${S+d}`].join(" "),E=Bl(m.text,b*.85,d,12);return {kind:"polygon",key:`${o}-pyramid-${m.id}-${x}`,points:_,fill:$a(m,x,n),stroke:eu(m,h),strokeWidth:p,opacity:Fc(x,t.length,r),text:Ha(m.text,30),fontSize:E,textX:i/2,textY:S+d/2}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"pyramid"}}function UGe(t,e,n,r,o){let{width:i,height:s}=e,a=Hc(r);if(t.length<=4){let f=i/2,m=s/2,x=Math.min(i,s)*.28,g=x*.55;return {nodes:t.map((b,v)=>{let S=v/Math.max(1,t.length)*Math.PI*2-Math.PI/2,w=f+g*Math.cos(S),C=m+g*Math.sin(S),T=Bl(b.text,x*1.2,x*2,11);return {kind:"circle",key:`${o}-venn-${b.id}-${v}`,cx:w,cy:C,r:x,fill:$a(b,v,n),stroke:"none",strokeWidth:0,opacity:.35,text:Ha(b.text,20),fontSize:T}}),connectors:[],shadowFilter:a,viewBox:`0 0 ${i} ${s}`,family:"venn"}}let l=Math.min(s*.38,i/(t.length*.9)),c=l*.5,d=t.length*(l*2-c)+c,u=(i-d)/2+l,p=s/2;return {nodes:t.map((f,m)=>{let x=u+m*(l*2-c),g=Bl(f.text,l*1.2,l*2,10);return {kind:"circle",key:`${o}-venn-${f.id}-${m}`,cx:x,cy:p,r:l,fill:$a(f,m,n),stroke:"none",strokeWidth:0,opacity:.35,text:Ha(f.text,20),fontSize:g}}),connectors:[],shadowFilter:a,viewBox:`0 0 ${i} ${s}`,family:"venn"}}function $Ge(t,e,n,r,o){let{width:i,height:s}=e,a=8,l=i-a*2,c=t.length>0?(s-a*2)/t.length:s-a*2,d=oh(r),u=ih(d);return {nodes:t.map((h,f)=>{let m=l*(1-f/Math.max(1,t.length)),x=l*(1-(f+1)/Math.max(1,t.length)),g=a+f*c,y=(i-m)/2,b=y+m,v=(i-x)/2,S=v+x,w=[`${y},${g}`,`${b},${g}`,`${S},${g+c}`,`${v},${g+c}`].join(" "),C=Bl(h.text,m*.85,c,11);return {kind:"polygon",key:`${o}-funnel-${h.id}-${f}`,points:w,fill:$a(h,f,n),stroke:eu(h,u),strokeWidth:d,opacity:Fc(f,t.length,r),text:Ha(h.text,30),fontSize:C,textX:i/2,textY:g+c/2}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"funnel"}}function HGe(t,e,n,r,o){let{width:i,height:s}=e,a=i*.4,l=s/2,c=Math.min(a-8,l-8),d=Hc(r);return {nodes:t.map((p,h)=>{let f=c*((t.length-h)/Math.max(1,t.length));return {kind:"circle",key:`${o}-target-${p.id}-${h}`,cx:a,cy:l,r:Math.max(f,4),fill:$a(p,h,n),stroke:"none",strokeWidth:0,opacity:Fc(h,t.length,r),text:Ha(p.text,30),fontSize:Math.max(7,Math.min(10,c/Math.max(1,t.length+1)))}}),connectors:[],shadowFilter:d,viewBox:`0 0 ${i} ${s}`,family:"target"}}function _U(t,e,n,r,o,i,s){let a=vne(t);switch(IGe(t,i,s)){case "list":return Sne(a,e,n,r,o);case "process":return NGe(a,e,n,r,o);case "cycle":return LGe(a,e,n,r,o);case "hierarchy":return DGe(t,e,n,r,o);case "matrix":return FGe(a,e,n,r,o);case "radial":return OGe(a,e,n,r,o);case "pyramid":return BGe(a,e,n,r,o);case "venn":return UGe(a,e,n,r,o);case "funnel":return $Ge(a,e,n,r,o);case "target":return HGe(a,e,n,r,o)}}function zGe(t){let e=t.trim().split(/\s+/u).map(Number),n=e[2],r=e[3];return {width:Number.isFinite(n)&&n>0?n:1,height:Number.isFinite(r)&&r>0?r:1}}function VGe(t,e,n,r=4){let o=t/2,i=e/2,s=Math.max(0,Math.min(n,o,i));if(s<=0)return [{x:-o,y:-i},{x:o,y:-i},{x:o,y:i},{x:-o,y:i}];let a=[],l=[{cx:o-s,cy:-i+s,start:-Math.PI/2},{cx:o-s,cy:i-s,start:0},{cx:-o+s,cy:i-s,start:Math.PI/2},{cx:-o+s,cy:-i+s,start:Math.PI}];for(let{cx:c,cy:d,start:u}of l)for(let p=0;p<=r;p++){let h=u+p/r*(Math.PI/2);a.push({x:c+Math.cos(h)*s,y:d+Math.sin(h)*s});}return a}function GGe(t,e=48){let n=[];for(let r=0;r<e;r++){let o=r/e*Math.PI*2;n.push({x:Math.cos(o)*t,y:Math.sin(o)*t});}return n}function WGe(t){let e=[];for(let n of t.trim().split(/\s+/u)){let[r,o]=n.split(","),i=Number(r),s=Number(o);Number.isFinite(i)&&Number.isFinite(s)&&e.push({x:i,y:s});}return e}function XGe(t){let e=[],n=t.match(/[a-zA-Z]|-?\d*\.?\d+(?:e-?\d+)?/gu);if(!n)return e;let r=0,o="",i={x:0,y:0},s=()=>Number(n[r++]);for(;r<n.length;){let a=n[r];/[a-zA-Z]/u.test(a)&&(o=a,r++);let l=o===o.toLowerCase();switch(o.toUpperCase()){case "M":case "L":{let c=s(),d=s();i=l?{x:i.x+c,y:i.y+d}:{x:c,y:d},e.push(i);break}case "H":{let c=s();i={x:l?i.x+c:c,y:i.y},e.push(i);break}case "V":{let c=s();i={x:i.x,y:l?i.y+c:c},e.push(i);break}case "C":{s(),s(),s(),s();let c=s(),d=s();i=l?{x:i.x+c,y:i.y+d}:{x:c,y:d},e.push(i);break}case "Q":{s(),s();let c=s(),d=s();i=l?{x:i.x+c,y:i.y+d}:{x:c,y:d},e.push(i);break}default:r++;}}return e}function jGe(t){if(t.length===0)return {cx:0,cy:0,width:0,height:0};let e=1/0,n=1/0,r=-1/0,o=-1/0;for(let i of t)i.x<e&&(e=i.x),i.y<n&&(n=i.y),i.x>r&&(r=i.x),i.y>o&&(o=i.y);return {cx:(e+r)/2,cy:(n+o)/2,width:r-e,height:o-n}}function YGe(t){let e=t.trim().replace(/^#/u,"");return e.length===3&&(e=e.split("").map(n=>n+n).join("")),e.length!==6||/[^0-9a-fA-F]/u.test(e)?[128,128,128]:[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function KGe(t){let[e,n,r]=YGe(t);return (.299*e+.587*n+.114*r)/255>.6?"#1a1a1a":"#ffffff"}function eee(t,e){let n=Math.hypot(t,e),r=Math.atan2(t,e);return {pos:{x:n*Math.sin(r),y:0,z:n*Math.cos(r)},angle:r}}function qGe(t){let e=t.meshes.map(r=>{let{pos:o,angle:i}=eee(r.position.x,r.position.y);return {...r,position:o,rotation:{x:0,y:i,z:0}}}),n=t.connectors.map(r=>({...r,points:r.points.map(o=>eee(o.x,o.y).pos)}));return {...t,meshes:e,connectors:n}}function ZGe(t){if(t.meshes.length===0)return t;let e=-1/0,n=1/0;for(let l of t.meshes)l.position.y>e&&(e=l.position.y),l.position.y<n&&(n=l.position.y);let r=e-n||1,o=Math.max(t.bounds.width,t.bounds.height)*.6,i=l=>-((e-l)/r)*o,s=t.meshes.map(l=>({...l,position:{x:l.position.x,y:l.position.y,z:i(l.position.y)}})),a=t.connectors.map(l=>({...l,points:l.points.map(c=>({x:c.x,y:c.y,z:i(c.y)}))}));return {...t,meshes:s,connectors:a}}function JGe(t){switch(t.family){case "cycle":case "radial":return qGe(t);case "hierarchy":return ZGe(t);default:return t}}function tWe(t,e){if(typeof e.depth=="number"&&e.depth>0)return e.depth;let n=e.depthRatio??QGe;return Math.max(2,t*n)}function nWe(t,e,n,r){let o=m=>m-e/2,i=m=>n/2-m,s,a=false,l,c,d,u;if(t.kind==="rect")l=t.x+t.width/2,c=t.y+t.height/2,d=t.width/2,u=t.height/2,s=VGe(t.width,t.height,t.rx),a=t.rx>0;else if(t.kind==="circle")l=t.cx,c=t.cy,d=t.r,u=t.r,s=GGe(t.r),a=true;else {let m=WGe(t.points);if(m.length<3)return null;let x=jGe(m);l=x.cx,c=x.cy,d=x.width/2,u=x.height/2,s=m.map(g=>({x:g.x-x.cx,y:x.cy-g.y}));}let p=Math.max(2,Math.min(d,u)*2),h=tWe(p,r),f=h*(r.bevelRatio??eWe);return {id:t.key,outline:s,rounded:a,depth:h,bevel:f,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,position:{x:o(l),y:i(c),z:0},rotation:{x:0,y:0,z:0},text:t.text,textColor:KGe(t.fill),fontSize:t.fontSize,halfWidth:d,halfHeight:u}}function wne(t,e={}){let{width:n,height:r}=zGe(t.viewBox),o=[];for(let a of t.nodes){let l=nWe(a,n,r,e);l&&o.push(l);}let i=[];for(let a of t.connectors){let l=XGe(a.d);l.length<2||i.push({id:a.key,points:l.map(c=>({x:c.x-n/2,y:r/2-c.y,z:0})),color:"#888888",width:1.5});}let s={meshes:o,connectors:i,bounds:{width:n,height:r},family:t.family,background:e.background};return e.spatial?JGe(s):s}function oWe(t){return tee[t??"unknown"]??tee.unknown}function Tne(t){let e=[],n=r=>{e.push(r);for(let o of r.children??[])n(o);};for(let r of t)n(r);return e}function iWe(t){return Tne(t).map(e=>(e.text??"").trim()).filter(e=>e.length>0)}function sWe(t){let e=oWe(t.resolvedLayoutType),n=iWe(t.nodes??[]),r=n.length,o=`${e} SmartArt diagram`;if(r===0)return `${o} with no nodes`;let i=r===1?"node":"nodes",s=n.slice(0,rWe),a=r-s.length,l=a>0?`${s.join("; ")}; and ${a} more`:s.join("; ");return `${o} with ${r} ${i}: ${l}`}function aWe(t,e,n){let r=`Node ${e+1} of ${n}`,o=(t??"").trim();return o.length>0?`${r}: ${o}`:r}function Cne(t){let e=Tne(t.nodes??[]),n=e.length,r=e.map((o,i)=>({id:o.id,label:aWe(o.text,i,n)}));return {role:"img",label:sWe(t),nodes:r}}async function cWe(){try{return await Promise.resolve().then(()=>(Ic(),dy))}catch{return null}}async function dWe(){try{return (await Promise.resolve().then(()=>(SQ(),vQ))).GLTFLoader}catch{return null}}async function uWe(){try{return (await Promise.resolve().then(()=>(JE(),EB))).OrbitControls}catch{return null}}function pWe(t,e){return new Promise((n,r)=>{t.load(e,n,void 0,r);})}function hWe(t,e){let n=new t.Box3().setFromObject(e),r=new t.Vector3;n.getSize(r);let o=Math.max(r.x,r.y,r.z);o>0&&e.scale.setScalar(2/o);let i=new t.Vector3;n.getCenter(i),e.position.sub(i.multiplyScalar(e.scale.x));}async function Mne(t,e,n){let r=await cWe(),o=r?await dWe():null;if(!r||!o)return nee;let i=Math.max(1,n.width),s=Math.max(1,n.height),a=new r.WebGLRenderer({antialias:true,alpha:!n.background});a.setPixelRatio(Math.min(typeof window>"u"?1:window.devicePixelRatio||1,n.maxPixelRatio??2)),a.setSize(i,s,false);let l=a.domElement;l.style.width=`${i}px`,l.style.height=`${s}px`,l.style.display="block",l.style.willChange="transform",t.appendChild(l);let c=new r.Scene;n.background&&(c.background=new r.Color(n.background));let d=new r.PerspectiveCamera(lWe,i/s,.1,1e3);d.position.set(0,0,5),d.lookAt(0,0,0),c.add(new r.AmbientLight(16777215,.5));let u=new r.DirectionalLight(16777215,1);u.position.set(5,5,5),c.add(u);let p=new r.DirectionalLight(16777215,.3);p.position.set(-3,-3,2),c.add(p);let h;try{h=await pWe(new o,e);}catch{return a.dispose(),l.remove(),nee}let f=h.scene;hWe(r,f),c.add(f);let m=null,x=await uWe(),g=w=>{w&&!m&&x?(m=new x(d,l),m.enablePan=false,m.enableZoom=true,m.enableRotate=true,m.minDistance=2,m.maxDistance=20,m.update()):!w&&m&&(m.dispose(),m=null);};g(n.interactive??true);let y=0,b=false,v=()=>{b||(y=requestAnimationFrame(v),m?.update(),a.render(c,d));};y=requestAnimationFrame(v);let S=()=>{f.traverse(w=>{let C=w;C.geometry?.dispose();let T=C.material;if(Array.isArray(T))for(let M of T)M.dispose();else T?.dispose();});};return {ok:true,resize(w,C){let T=Math.max(1,w),M=Math.max(1,C);d.aspect=T/M,d.updateProjectionMatrix(),a.setSize(T,M,false),l.style.width=`${T}px`,l.style.height=`${M}px`;},setInteractive(w){g(w);},dispose(){b||(b=true,cancelAnimationFrame(y),m?.dispose(),S(),c.clear(),a.dispose(),l.remove());}}}function YA(t,e){return {gridWidth:Math.max(t-1,1)*ree,gridDepth:Math.max(e-1,1)*ree}}function fWe(t,e,n,r,o){let i=Math.max(e-1,0),s=Math.max(n-1,0),{gridWidth:a,gridDepth:l}=YA(e,n),c=new t.PlaneGeometry(a,l,i,s);c.rotateX(-Math.PI/2);let d=c.attributes.position,u=d.count,p=new Float32Array(u*3);for(let f=0;f<u;f++){let m=Math.floor(f/e),x=f%e,g=m*e+x,y=g<r.length?r[g]:0;d.setY(f,y*_ne);let b=g*3;p[f*3]=b<o.length?o[b]:.5,p[f*3+1]=b+1<o.length?o[b+1]:.5,p[f*3+2]=b+2<o.length?o[b+2]:.5;}c.setAttribute("color",new t.BufferAttribute(p,3)),c.computeVertexNormals(),d.needsUpdate=true;let h=new t.WireframeGeometry(c);return {geometry:c,wireGeometry:h}}function mWe(t,e,n,r,o=8,i=6){let{gridWidth:s,gridDepth:a}=YA(t,e),l=[],c=Math.max(1,Math.ceil(n.length/o));for(let u=0;u<n.length;u+=c){let p=-s/2+u/Math.max(t-1,1)*s;l.push({key:`cat-${u}`,text:n[u],anchor:[p,-0.15,a/2+.25],axis:"category"});}let d=Math.max(1,Math.ceil(r.length/i));for(let u=0;u<r.length;u+=d){let p=-a/2+u/Math.max(e-1,1)*a;l.push({key:`ser-${u}`,text:r[u],anchor:[s/2+.3,-0.15,p],axis:"series"});}return l.push({key:"value-axis",text:"Value",anchor:[-s/2-.35,.75,-a/2],axis:"value"}),l}function gWe(t,e){let{gridWidth:n,gridDepth:r}=YA(t,e),i=Math.max(n,r,_ne)*1.8;return {position:[i*.8,i*.7,i*.8],target:[0,.3,0]}}async function bWe(){try{return await Promise.resolve().then(()=>(Ic(),dy))}catch{return null}}async function vWe(){try{return (await Promise.resolve().then(()=>(JE(),EB))).OrbitControls}catch{return null}}function SWe(t,e){let n=t.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0",pointerEvents:"none",overflow:"hidden"});let r=e.map(o=>{let i=t.createElement("div");i.textContent=o.text;let s=o.axis==="value"?"#999":"#666";return Object.assign(i.style,{position:"absolute",fontSize:"9px",color:s,whiteSpace:"nowrap",userSelect:"none",transform:"translate(-50%, -50%)",willChange:"left, top"}),o.axis==="value"&&(i.style.writingMode="vertical-rl"),n.appendChild(i),i});return {layer:n,nodes:r}}async function Pne(t,e){let n=await bWe(),r=n?await vWe():null;if(!n||!r)return xWe;let{cols:o,rows:i}=e,s=Math.max(1,e.width),a=Math.max(1,e.height),l=new n.WebGLRenderer({antialias:true,alpha:true});l.setPixelRatio(Math.min(typeof window>"u"?1:window.devicePixelRatio||1,e.maxPixelRatio??2)),l.setSize(s,a,false);let c=l.domElement;c.style.width=`${s}px`,c.style.height=`${a}px`,c.style.display="block",c.style.willChange="transform",t.appendChild(c);let d=new n.Scene;d.add(new n.AmbientLight(16777215,.6));let u=new n.DirectionalLight(16777215,.8);u.position.set(5,8,5),d.add(u);let p=new n.DirectionalLight(16777215,.3);p.position.set(-3,4,-2),d.add(p);let h=new n.PerspectiveCamera(yWe,s/a,.1,1e3),f=gWe(o,i);h.position.set(...f.position);let m=new n.Vector3(...f.target);h.lookAt(m);let{gridWidth:x,gridDepth:g}=YA(o,i),y=Math.max(x,g)*1.2,b=new n.GridHelper(y,Math.max(o,i),13421772,15263976);b.position.y=-0.02,d.add(b);let{geometry:v,wireGeometry:S}=fWe(n,o,i,e.heightMap,e.colorMap),w=new n.MeshPhongMaterial({vertexColors:true,side:n.DoubleSide,shininess:30,transparent:true,opacity:.92}),C=new n.Mesh(v,w);d.add(C);let T=null;e.wireframe&&(T=new n.LineBasicMaterial({color:3355443,transparent:true,opacity:.25}),d.add(new n.LineSegments(S,T)));let M=new r(h,c);M.enablePan=true,M.enableZoom=true,M.enableRotate=true,M.minDistance=1,M.maxDistance=20,M.maxPolarAngle=Math.PI/2+.3,M.target.copy(m),M.update();let _=t.ownerDocument??document,E=mWe(o,i,e.categoryLabels,e.seriesNames),{layer:R,nodes:I}=SWe(_,E);t.appendChild(R);let L=E.map(G=>new n.Vector3(...G.anchor)),k=new n.Vector3,F=()=>{for(let G=0;G<I.length;G++){k.copy(L[G]).project(h);let j=I[G];if(k.z>1){j.style.display="none";continue}j.style.display="",j.style.left=`${(k.x+1)/2*s}px`,j.style.top=`${(-k.y+1)/2*a}px`;}},N=0,D=false,U=()=>{D||(N=requestAnimationFrame(U),M.update(),l.render(d,h),F());};return N=requestAnimationFrame(U),{ok:true,resize(G,j){s=Math.max(1,G),a=Math.max(1,j),h.aspect=s/a,h.updateProjectionMatrix(),l.setSize(s,a,false),c.style.width=`${s}px`,c.style.height=`${a}px`;},dispose(){D||(D=true,cancelAnimationFrame(N),M.dispose(),v.dispose(),S.dispose(),w.dispose(),T?.dispose(),b.dispose(),d.clear(),l.dispose(),c.remove(),R.remove());}}}function KA(t){return Number.isNaN(t)?0:Math.min(100,Math.max(0,Math.round(t)))}function ST(t,e,n=90){return e<=0?0:KA(t/e*n)}function Ene(t,e){return e<=0?45:KA(45+t/e*45)}function zy(t,e,n){return `${t} slide ${e+1} of ${n}...`}function wT(t){return t instanceof DOMException&&t.name==="AbortError"}function CWe(t={}){return new Promise(e=>{if(typeof document>"u"){e(null);return}let n=document.createElement("input");n.type="file",n.accept=t.accept??TWe,n.style.position="fixed",n.style.left="-9999px",n.style.opacity="0";let r=false,o=s=>{r||(r=true,n.remove(),e(s));};n.addEventListener("change",()=>o(n.files?.[0]??null)),n.addEventListener("cancel",()=>o(null));let i=()=>{window.removeEventListener("focus",i),setTimeout(()=>o(null),300);};window.addEventListener("focus",i),document.body.appendChild(n),n.click();})}async function Ane(t={}){let e=await CWe(t);return e?{file:e,buffer:await e.arrayBuffer()}:null}function Rne(t,e){return e<=0?"0 / 0":`${t+1} / ${e}`}function kne(t){return t<=0}function Ine(t,e){return t>=e-1}function zw(t){return String(t).padStart(2,"0")}function Nne(t,e){if(t==null)return 0;let n=e-t;return n>0?n:0}function Lne(t){let e=t>0?t:0,n=Math.floor(e/1e3),r=Math.floor(n/3600),o=Math.floor(n%3600/60),i=n%60;return r>0?`${zw(r)}:${zw(o)}:${zw(i)}`:`${zw(o)}:${zw(i)}`}function PU(t){let{layoutHeight:e,visualHeight:n,offsetTop:r}=t;if(!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(r)||e<=0||n<=0)return 0;let o=e-(n+r);return o<=0?0:Math.round(o)}function Dne(t,e=MWe){return t>=e}function EU(t=typeof window<"u"?window:void 0){if(!t)return null;let e=t.visualViewport;return e?{layoutHeight:t.innerHeight,visualHeight:e.height,offsetTop:e.offsetTop}:null}function Fne(t,e,n,r=16){let o=e-n;return t.bottom>o-r?t.bottom-(o-r):t.top<r?t.top-r:0}function One(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Bne(t){let e=Date.now()-t,n=Math.floor(e/6e4);if(n<1)return "Just now";if(n<60)return `${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function qA(t){return t.trim().length===0?"webrtc":"websocket"}function $ne(){return `broadcast-${Math.random().toString(36).slice(2,10)}`}function Hne(t,e,n){if(!n)return t;let r=encodeURIComponent(t),o=e.trim();if(o.length===0)return `${n.origin}${n.pathname}?broadcast=${r}&transport=webrtc`;let i=encodeURIComponent(o);return `${n.origin}${n.pathname}?broadcast=${r}&server=${i}`}function eR(t){return Math.max(ZA,Math.min(JA,t))}function RU(t){return t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Vy(t){let e=Math.floor(t/1e3),n=Math.floor(e/3600),r=Math.floor(e%3600/60),o=e%60;return n>0?`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`}function kU(t){return t.map((e,n)=>{if(e.isParagraphBreak)return {kind:"break",key:`br-${n}`};let r={};return e.style.bold&&(r.fontWeight="bold"),e.style.italic&&(r.fontStyle="italic"),e.style.underline&&(r.textDecoration="underline"),e.style.strikethrough&&(r.textDecoration=`${r.textDecoration?`${r.textDecoration} `:""}line-through`),e.style.color&&(r.color=e.style.color),e.style.fontSize&&(r.fontSize=`${e.style.fontSize}pt`),e.style.fontFamily&&(r.fontFamily=e.style.fontFamily),{kind:"text",key:`seg-${n}`,text:e.text,style:r}})}function IU(t,e){return `${t+1} / ${e}`}function jw(t){let e=t.replace(/^#/u,"");if(e.length!==6)return null;let n=parseInt(e,16);return Number.isFinite(n)?{r:n>>16&255,g:n>>8&255,b:n&255}:null}function zne(t,e){let n=t.r-e.r,r=t.g-e.g,o=t.b-e.b;return Math.sqrt(n*n+r*r+o*o)}function Gne(t){return Math.max(0,Math.min(100,t))/100*Vne}function Wne(t,e,n,r,o){let i=t.length;for(let s=0;s<i;s+=4){let a={r:t[s],g:t[s+1],b:t[s+2]};zne(a,e)<=r&&(o?(t[s]=0,t[s+1]=0,t[s+2]=0,t[s+3]=0):(t[s]=n.r,t[s+1]=n.g,t[s+2]=n.b));}}function LU(t,e,n,r=nR,o=false){return new Promise((i,s)=>{let a=jw(e),l=jw(n);if(!a||!l){s(new Error(`Invalid hex colour: from="${e}" to="${n}"`));return}let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let{naturalWidth:d,naturalHeight:u}=c;if(d===0||u===0){s(new Error("Image has zero dimensions"));return}let p=document.createElement("canvas");p.width=d,p.height=u;let h=p.getContext("2d");if(!h){s(new Error("Cannot create 2D canvas context"));return}h.drawImage(c,0,0);let f=h.getImageData(0,0,d,u),m=Gne(r);Wne(f.data,a,l,m,o),h.putImageData(f,0,0),i({dataUrl:p.toDataURL("image/png"),width:d,height:u});},c.onerror=()=>{s(new Error("Failed to load image for colour change processing"));},c.src=t;})}function DU(t,e,n,r,o){return `${t.length>64?t.slice(0,64):t}|${e}|${n}|${r}|${o}`}function TT(t){return Vw.get(t)}function FU(t,e){if(Vw.size>=PWe){let n=Vw.keys().next().value;n!==void 0&&Vw.delete(n);}Vw.set(t,e);}function Xne(t,e,n){let r=t.length;for(let o=0;o<r;o+=4){let s=(.2126*t[o]+.7152*t[o+1]+.0722*t[o+2])/255,a=1-s;t[o]=Math.round(e.r*a+n.r*s),t[o+1]=Math.round(e.g*a+n.g*s),t[o+2]=Math.round(e.b*a+n.b*s);}}function OU(t,e,n){return new Promise((r,o)=>{let i=jw(e),s=jw(n);if(!i||!s){o(new Error(`Invalid hex colour: shadow="${e}" highlight="${n}"`));return}let a=new Image;a.crossOrigin="anonymous",a.onload=()=>{let{naturalWidth:l,naturalHeight:c}=a;if(l===0||c===0){o(new Error("Image has zero dimensions"));return}let d=document.createElement("canvas");d.width=l,d.height=c;let u=d.getContext("2d");if(!u){o(new Error("Cannot create 2D canvas context"));return}u.drawImage(a,0,0);let p=u.getImageData(0,0,l,c);Xne(p.data,i,s),u.putImageData(p,0,0),r({dataUrl:d.toDataURL("image/png"),width:l,height:c});},a.onerror=()=>{o(new Error("Failed to load image for duotone processing"));},a.src=t;})}function BU(t,e,n){return `dt|${t.length>64?t.slice(0,64):t}|${e}|${n}`}function rR(t){return Gw.get(t)}function UU(t,e){if(Gw.size>=EWe){let n=Gw.keys().next().value;n!==void 0&&Gw.delete(n);}Gw.set(t,e);}function HU(t){switch(t.type){case "image":case "picture":return "img";case "table":return "table";case "group":return "group";case "chart":return "img";case "smartArt":return "img";case "connector":return "img";case "media":return "application";case "ink":return "img";case "model3d":return "img";case "text":return;case "shape":return ze(t)&&t.text?void 0:"img";default:return}}function zU(t){if((t.type==="image"||t.type==="picture")&&"altText"in t&&typeof t.altText=="string"&&t.altText.trim())return t.altText.trim();if(ze(t)&&t.text){let e=t.text.trim();if(e)return e.length>120?`${e.slice(0,117)}...`:e}if(t.type==="chart"&&"chartData"in t&&t.chartData){let e=t.chartData;return e.title?`Chart: ${e.title}`:"Chart"}return t.type==="smartArt"?"SmartArt diagram":t.type==="table"?"Table":t.type==="media"?"Media element":t.type==="group"?"Group of elements":t.type==="connector"?"Connector line":t.type==="ink"?"Ink drawing":t.type==="model3d"?"3D Model":t.type==="shape"?"shapeType"in t&&t.shapeType?`Shape: ${t.shapeType}`:"Shape":AWe(t.type)}function AWe(t){switch(t){case "text":return "Text box";case "shape":return "Shape";case "image":case "picture":return "Image";case "table":return "Table";case "chart":return "Chart";case "connector":return "Connector";case "group":return "Group";case "smartArt":return "SmartArt";case "media":return "Media";case "ink":return "Drawing";case "ole":return "Embedded object";case "contentPart":return "Content part";case "model3d":return "3D Model";default:return "Element"}}function VU(t){switch(t.type){case "shape":{let e="shapeType"in t&&typeof t.shapeType=="string"?t.shapeType:void 0;return e?`shape: ${e}`:"shape"}case "chart":return "chart";case "connector":return "connector line";case "smartArt":return "diagram";case "image":case "picture":return "image";case "table":return "data table";case "group":return "grouped elements";case "media":return "media player";case "ink":return "ink drawing";case "model3d":return "3D model";default:return}}function CT(t){let e=[],n=/-?\d+(?:\.\d+)?(?:e[+-]?\d+)?/giu,r=[],o;for(;(o=n.exec(t))!==null;)r.push(parseFloat(o[0]));for(let i=0;i<r.length-1;i+=2)e.push({x:r[i],y:r[i+1]});return e}function jne(t,e){if(t.length===0)return 1;if(t.length===1)return t[0];let r=Math.max(0,Math.min(1,e))*(t.length-1),o=Math.floor(r),i=Math.min(o+1,t.length-1),s=r-o;return t[o]*(1-s)+t[i]*s}function GU(t,e,n){if(t.length===0)return [];let r=n.minRadius,o=n.maxRadius??n.baseWidth;return t.map((i,s)=>{let a=t.length===1?.5:s/(t.length-1),l=jne(e,a),c=n.baseWidth>0?l/n.baseWidth:1,d=Math.max(r,Math.min(o,n.baseWidth/2*c));return {cx:i.x,cy:i.y,r:d}})}function Gy(t){if(t.length<=1)return false;let e=t[0];return t.some(n=>Math.abs(n-e)>.01)}function oR(t,e,n=.3,r=1.8){return t.map(o=>{let i=Math.max(0,Math.min(1,o));return e*(n+i*(r-n))})}function WU(t){if(t.length<2)return 0;let e=0;for(let n=1;n<t.length;n++){let r=t[n].x-t[n-1].x,o=t[n].y-t[n-1].y;e+=Math.sqrt(r*r+o*o);}return e}function jU(t,e,n={}){let r=n.strokeDurationMs??600,o=n.strokeDelayMs??200,i=n.easing??"ease-in-out",s=t*(r+o),a=Math.max(e,1);return {pathLength:a,animationDelay:`${s}ms`,animationDuration:`${r}ms`,animation:`${XU} ${r}ms ${i} ${s}ms forwards`,strokeDasharray:`${a}`,strokeDashoffset:`${a}`}}function YU(t,e={}){return t.inkPaths.map((n,r)=>{let o=CT(n),i=WU(o);return jU(r,i,e)})}function KU(t,e={}){return t.map((n,r)=>{let o=CT(n.path),i=WU(o);return jU(r,i,e)})}function qU(t,e){return !t||e>=t.length?1:Math.max(0,Math.min(1,t[e]))}function ZU(t,e,n="#000"){return !t||e>=t.length?n:t[e]||n}function JU(t,e,n=3){return !t||e>=t.length?n:t[e]>0?t[e]:n}function t4(t,e){let n=t.clientX-e.clientX,r=t.clientY-e.clientY;return Math.sqrt(n*n+r*r)}function Zne(t,e,n){return Math.min(Math.max(t,e),n)}function Jne(t){let{getScale:e,minScale:n,maxScale:r,callbacks:o}=t,i=0,s=1,a=false,l=0,c=0,d=0,u=0,p=null,h=0,f=0,m=()=>{p!==null&&(clearTimeout(p),p=null);},x=v=>{v.touches.length===2?(a=true,i=t4(v.touches[0],v.touches[1]),s=e(),m(),v.preventDefault()):v.touches.length===1&&(l=v.touches[0].clientX,c=v.touches[0].clientY,d=l,u=c,h=v.touches[0].clientX,f=v.touches[0].clientY,m(),p=setTimeout(()=>{p=null,o.onLongPress?.(h,f);},qne));},g=v=>{if(v.touches.length===2&&a){v.preventDefault();let S=t4(v.touches[0],v.touches[1]);if(i>0){let w=S/i,C=Zne(s*w,n,r);o.onPinchZoom?.(C);}}else if(v.touches.length===1){d=v.touches[0].clientX,u=v.touches[0].clientY;let S=v.touches[0].clientX-h,w=v.touches[0].clientY-f;(Math.abs(S)>e4||Math.abs(w)>e4)&&m();}},y=v=>{if(a){a=false,i=0;return}if(m(),v.touches.length===0){let S=v.changedTouches.length>=1?v.changedTouches[0].clientX:d,w=v.changedTouches.length>=1?v.changedTouches[0].clientY:u,C=S-l,T=w-c;Math.abs(C)>=Yne&&Math.abs(T)<Kne&&o.onSwipe?.(C>0?1:-1);}},b=()=>{a=false,i=0,m();};return {onTouchStart:x,onTouchMove:g,onTouchEnd:y,onTouchCancel:b,cancel:b}}function ere(t=QU,e){return nS(t,{categories:[...RWe],series:[{name:"Series 1",values:[...kWe]}],title:"Chart Title",hasLegend:true},{x:rA.x,y:rA.y,width:rA.width,height:rA.height})}function IWe(t){let e=t.trim().split(/\s+/u),n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e){let a=s.indexOf(",");if(a<0)continue;let l=parseFloat(s.slice(0,a)),c=parseFloat(s.slice(a+1));!isFinite(l)||!isFinite(c)||(l<n&&(n=l),l>o&&(o=l),c<r&&(r=c),c>i&&(i=c));}return isFinite(n)?{x:n,y:r,width:o-n,height:i-r}:{x:0,y:0,width:0,height:0}}function NWe(t,e,n){let r=`reflow-${n}-${e}`,o=t.text||void 0;if(t.kind==="rect")return {id:r,shapeType:t.rx>0?"roundRect":"rect",x:t.x,y:t.y,width:t.width,height:t.height,rotation:0,fillColor:t.fill,strokeColor:t.stroke,strokeWidth:t.strokeWidth,text:o,fontSize:t.fontSize};if(t.kind==="circle")return {id:r,shapeType:"ellipse",x:t.cx-t.r,y:t.cy-t.r,width:t.r*2,height:t.r*2,rotation:0,fillColor:t.fill,strokeColor:t.stroke,strokeWidth:t.strokeWidth,text:o,fontSize:t.fontSize};let i=IWe(t.points);return {id:r,shapeType:"chevron",x:i.x,y:i.y,width:i.width,height:i.height,rotation:0,fillColor:t.fill,strokeColor:t.stroke,strokeWidth:t.strokeWidth,text:o,fontSize:t.fontSize}}function LWe(t,e){let n=vne([...e]),r=t.family,o=[];for(let i=0;i<t.nodes.length;i++){let s=t.nodes[i],l=n[i]?.id??s.key;o.push(NWe(s,l,r));}return o}function MT(t,e,n,r,o,i){let s=t.drawingShapes;if(s!==void 0&&s.length>0||t.nodes.length===0)return t;let a=_U(t.nodes,i,n,r,o,t.resolvedLayoutType,e);return {...t,drawingShapes:LWe(a,t.nodes)}}function nre(t){let{autosaveState:e,isDirty:n,autosaveEnabled:r}=t;return r&&e==="saving"?"pptx.autosave.saving":r&&e==="error"?"pptx.autosave.error":n?"pptx.statusBar.unsavedChanges":"pptx.titleBar.savedToThisPc"}function ore(){return new Promise((t,e)=>{let n=indexedDB.open(DWe,FWe);n.onupgradeneeded=()=>{let r=n.result;r.objectStoreNames.contains(by)||r.createObjectStore(by,{keyPath:"key"});},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error);})}async function OWe(){let t=await ore();return new Promise(e=>{try{let n=t.transaction(by,"readwrite"),r=n.objectStore(by),o=null,i=1/0,s=r.openCursor();s.onsuccess=()=>{let a=s.result;if(a){let l=a.value;typeof l.timestamp=="number"&&l.timestamp<i&&(i=l.timestamp,o=a.primaryKey),a.continue();}else o!==null&&r.delete(o);},n.oncomplete=()=>{t.close(),e(o!==null);},n.onerror=()=>{t.close(),e(!1);};}catch{try{t.close();}catch{}e(false);}})}function oee(t,e){return ore().then(n=>new Promise((r,o)=>{let i=n.transaction(by,"readwrite");i.objectStore(by).put({key:t,data:e,timestamp:Date.now(),size:e.byteLength}),i.oncomplete=()=>{n.close(),r(true);},i.onerror=()=>{n.close(),o(i.error);};}))}async function ire(t,e){try{return await oee(t,e)}catch(n){if((n instanceof Error||n instanceof DOMException?n.name:"")!=="QuotaExceededError"||!await OWe())throw n;return oee(t,e)}}function are(t){if(typeof t!="string"||t.trim().length===0)return iee;let e=t.replace(/[\x00-\x1f\x7f"\\/:*?<>|]/gu,"_").replace(/\.\./gu,"__").replace(/^\.+/u,"").trim();if(e.length===0)return iee;if(e.length>200){let n=e.lastIndexOf(".");if(n>0&&e.length-n<=16){let r=e.slice(n);e=e.slice(0,200-r.length)+r;}else e=e.slice(0,200);}return e}function ru(t,e){let n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e,document.body.appendChild(r),r.click(),setTimeout(()=>{r.remove(),URL.revokeObjectURL(n);},sre);}function sR(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),setTimeout(()=>{n.remove();},sre);}function aR(t,e=.92){let r=t.toDataURL("image/jpeg",e).split(",")[1]??"",o=atob(r),i=new Uint8Array(o.length);for(let s=0;s<o.length;s++)i[s]=o.charCodeAt(s);return {bytes:i,w:t.width,h:t.height}}function t$(t,e={}){if(t.length===0)throw new Error("[gif-encoder] encodeGif: frames array must not be empty");let n=typeof e=="number"?{delayCs:e}:e,{delayCs:r=200,loopCount:o=0}=n,i=t[0].width,s=t[0].height,a=[];see(a,"GIF89a"),Jp(a,i),Jp(a,s),a.push(112),a.push(0),a.push(0),a.push(33,255,11),see(a,"NETSCAPE2.0"),a.push(3,1),Jp(a,o),a.push(0);for(let l of t){let{palette:c,indexed:d}=BWe(l.imageData);a.push(33,249,4),a.push(0),Jp(a,r),a.push(0),a.push(0),a.push(44),Jp(a,0),Jp(a,0),Jp(a,i),Jp(a,s),a.push(135);for(let f=0;f<256;f++)a.push(c[f*3]??0),a.push(c[f*3+1]??0),a.push(c[f*3+2]??0);let u=8;a.push(u);let p=$We(d,u),h=0;for(;h<p.length;){let f=Math.min(255,p.length-h);a.push(f);for(let m=0;m<f;m++)a.push(p[h+m]);h+=f;}a.push(0);}return a.push(59),new Uint8Array(a)}function Jp(t,e){t.push(e&255),t.push(e>>8&255);}function see(t,e){for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));}function BWe(t){let e=t.data,n=t.width*t.height,r=Math.max(1,Math.floor(n/1e4)),o=[];for(let c=0;c<n;c+=r){let d=c*4;o.push([e[d],e[d+1],e[d+2]]);}let i=n4(o,8),s=new Uint8Array(768),a=[];for(let c=0;c<256;c++)if(c<i.length&&i[c].length>0){let d=0,u=0,p=0;for(let[g,y,b]of i[c])d+=g,u+=y,p+=b;let h=i[c].length,f=Math.round(d/h),m=Math.round(u/h),x=Math.round(p/h);s[c*3]=f,s[c*3+1]=m,s[c*3+2]=x,a.push([f,m,x]);}else a.push([0,0,0]);let l=new Uint8Array(n);for(let c=0;c<n;c++){let d=c*4;l[c]=UWe(a,e[d],e[d+1],e[d+2]);}return {palette:s,indexed:l}}function n4(t,e){if(e===0||t.length<=1)return [t];let n=255,r=0,o=255,i=0,s=255,a=0;for(let[h,f,m]of t)h<n&&(n=h),h>r&&(r=h),f<o&&(o=f),f>i&&(i=f),m<s&&(s=m),m>a&&(a=m);let l=r-n,c=i-o,d=a-s,u=0;c>=l&&c>=d?u=1:d>=l&&d>=c&&(u=2),t.sort((h,f)=>h[u]-f[u]);let p=Math.floor(t.length/2);return [...n4(t.slice(0,p),e-1),...n4(t.slice(p),e-1)]}function UWe(t,e,n,r){let o=0,i=1/0;for(let s=0;s<t.length;s++){let[a,l,c]=t[s],d=(e-a)**2+(n-l)**2+(r-c)**2;d<i&&(i=d,o=s);}return o}function $We(t,e){let n=1<<e,r=n+1,o=[],i=e+1,s=r+1,a=4096,l=new Map,c=()=>{l.clear();for(let m=0;m<n;m++)l.set(String(m),m);i=e+1,s=r+1;},d=0,u=0,p=(m,x)=>{for(d|=m<<u,u+=x;u>=8;)o.push(d&255),d>>=8,u-=8;};c(),p(n,i);let h=String(t[0]);for(let m=1;m<t.length;m++){let x=`${h},${String(t[m])}`;if(l.has(x))h=x;else {let g=l.get(h);g!==void 0&&p(g,i),s<a?(l.set(x,s++),s>1<<i&&i<12&&i++):(p(n,i),c()),h=String(t[m]);}}let f=l.get(h);return f!==void 0&&p(f,i),p(r,i),u>0&&o.push(d&255),new Uint8Array(o)}function lre(t){return zWe[t]??{rows:3,columns:2}}function cre(t,e){return t<=0?0:Math.ceil(t/e)}function dre(t,e,n,r,o=Fl){let i=lre(e),s=o.width-o.marginLeft-o.marginRight,a=o.height-o.marginTop-o.marginBottom,l=e===3,c=[];if(l){let d=s*HWe,u=(a-py*(i.rows-1))/i.rows;for(let p=0;p<i.rows;p++){let h=r+p;c.push({slideIndex:h<n?h:-1,row:p,col:0,x:0,y:p*(u+py),width:d,height:u});}}else {let d=(s-py*(i.columns-1))/i.columns,u=(a-py*(i.rows-1))/i.rows,p=0;for(let h=0;h<i.rows;h++)for(let f=0;f<i.columns;f++){let m=r+p;c.push({slideIndex:m<n?m:-1,row:h,col:f,x:f*(d+py),y:h*(u+py),width:d,height:u}),p++;}}return {pageIndex:t,cells:c,hasNoteLines:l}}function lR(t,e,n="portrait"){let r=t.length;if(r===0)return [];let o=n==="landscape"?n$:Fl,i=cre(r,e),s=[];for(let a=0;a<i;a++){let l=a*e,c=dre(a,e,r,l,o),d=c.cells.map(u=>({...u,slideIndex:u.slideIndex>=0&&u.slideIndex<r?t[u.slideIndex]:-1}));s.push({...c,cells:d});}return s}function cR(t="portrait"){let e=t==="landscape"?n$:Fl;return {width:e.width-e.marginLeft-e.marginRight,height:e.height-e.marginTop-e.marginBottom}}function dR(){return 8}function ure(t,e,n=Fl){let r=n.width-n.marginLeft-n.marginRight,o=n.height-n.marginTop-n.marginBottom,i=o*VWe,s=r,a=s/aee;a>i&&(a=i,s=a*aee);let l=(r-s)/2,c=(i-a)/2,d=i+GWe,u=o-d;return {pageIndex:t,slideIndex:e,slideArea:{x:l,y:c,width:s,height:a},textArea:{x:0,y:d,width:r,height:Math.max(0,u)}}}function uR(t){return t.map((e,n)=>ure(n,e))}function pR(){return {width:Fl.width-Fl.marginLeft-Fl.marginRight,height:Fl.height-Fl.marginTop-Fl.marginBottom}}function fR(t,e){let n=Em-2*Ni,r=Lc-2*Ni,o=r*r$,i=r-o-Im,s=Math.min(n/t,o/e),a=t*s,l=e*s,c=Ni+(n-a)/2,u=Lc-Ni-l,p=u-Im,h=Wy*hR,f=Math.floor(i/h);return {contentWidth:n,contentHeight:r,slideAreaHeight:o,notesAreaHeight:i,imageWidth:a,imageHeight:l,imageX:c,imageY:u,notesTextY:p,maxNotesLines:f}}function mR(t,e,n){if(!t||t.trim().length===0)return [];let r=n*.5,o=Math.floor(e/r);if(o<=0)return [];let i=[],s=t.split(/\r?\n/u);for(let a of s){if(a.trim().length===0){i.push("");continue}let l=a.split(/\s+/u),c="";for(let d of l)c.length===0?c=d:c.length+1+d.length<=o?c+=` ${d}`:(i.push(c),c=d);c.length>0&&i.push(c);}return i}function gR(){let t=Lc-2*Ni,e=Yw+Im,n=t-e,r=Wy*hR;return Math.floor(n/r)}function vy(t){return t.replace(/\\/gu,"\\\\").replace(/\(/gu,"\\(").replace(/\)/gu,"\\)")}function uA(t,e){if(t.length===0)return "";let n=`BT /F1 ${Wy} Tf 0 0 0 rg `;n+=`${Ni} ${e.toFixed(2)} Td `;for(let r=0;r<t.length;r++){let o=t[r];r===0?n+=`(${vy(o)}) Tj `:n+=`0 ${(-15.399999999999999).toFixed(2)} Td (${vy(o)}) Tj `;}return n+=`ET
4466
+ `&&n.insert!=="\u200B"&&(o.text=n.insert),e.push(o);}return e}function aGe(t){return ZB(t.toDelta())}function pne(t,e,n){let r=t;for(let[o,i]of Object.entries(r))if(i!==void 0)if(une.has(o))e.set(o,i);else if(o==="textSegments"){if(Array.isArray(i)){let s=n.createText();dne(i,s),e.set("textBody",s);}}else dA[o]&&e.set(dA[o],JSON.stringify(i));}function cGe(t){let e={};return t.forEach((n,r)=>{if(r==="textBody")vU(n)&&(e.textSegments=aGe(n));else if(YQ[r])try{e[YQ[r]]=JSON.parse(n);}catch{}else e[r]=n;}),e}function dGe(t,e,n){let r=t;for(let i of wU)r[i]!==void 0&&e.set(i,r[i]);for(let[i,s]of Object.entries(TU))r[i]!==void 0&&e.set(s,JSON.stringify(r[i]));let o=n.createArray();for(let i of t.elements){let s=n.createMap();pne(i,s,n),o.push([s]);}e.set("elements",o);}function uGe(t){let e={};for(let o of wU){let i=t.get(o);i!==void 0&&(e[o]=i);}for(let[o,i]of Object.entries(lGe)){let s=t.get(o);if(s!==void 0)try{e[i]=JSON.parse(s);}catch{}}let n=t.get("elements"),r=[];if(n)for(let o=0;o<n.length;o++)r.push(cGe(n.get(o)));return e.elements=r,e}function CU(t){let e=t.getArray(SU),n=[];for(let r=0;r<e.length;r++)n.push(uGe(e.get(r)));return n}function hne(t,e){let n=t.getArray(SU);return n.observeDeep(e),()=>n.unobserveDeep(e)}function pGe(t){return vU(t)&&typeof t.delete=="function"&&typeof t.format=="function"}function LB(t){let e="";for(let n of t)typeof n.insert=="string"&&(e+=n.insert);return e}function mGe(t,e){let n=Math.min(t.length,e.length),r=0;for(;r<n&&t.charCodeAt(r)===e.charCodeAt(r);)r++;return r>0&&hGe(t.charCodeAt(r-1))&&r--,r}function gGe(t,e,n){let r=Math.min(t.length,e.length)-n,o=0;for(;o<r&&t.charCodeAt(t.length-o-1)===e.charCodeAt(e.length-o-1);)o++;return o>0&&fGe(t.charCodeAt(t.length-o))&&o--,o}function xGe(t,e,n,r){let o=0,i=n;for(let s of e){if(typeof s.insert!="string")continue;let a=o+s.insert.length,l=Math.max(o,n),c=Math.min(a,r);if(l<c){let d=s.insert.slice(l-o,c-o);t.insert(i,d,s.attributes??{}),i+=d.length;}o=a;}}function yGe(t,e){let n=Object.keys(t);return n.length!==Object.keys(e).length?false:n.every(r=>t[r]===e[r])}function bGe(t,e){let n=t.toDelta().filter(s=>typeof s.insert=="string"),r=0,o=0,i=0;for(let s of e){if(typeof s.insert!="string")continue;let a=s.attributes??{},l=s.insert.length;for(;l>0&&r<n.length;){let c=n[r].insert,d=Math.min(c.length-o,l),u=n[r].attributes??{};if(!yGe(u,a)){let p={};for(let h of Object.keys(a))u[h]!==a[h]&&(p[h]=a[h]);for(let h of Object.keys(u))h in a||(p[h]=null);t.format(i,d,p);}i+=d,l-=d,o+=d,o>=c.length&&(r++,o=0);}}}function vGe(t,e){let n=LB(t.toDelta()),r=LB(e);if(n!==r){let o=mGe(n,r),i=gGe(n,r,o),s=n.length-o-i;if(s>0&&t.delete(o,s),xGe(t,e,o,r.length-i),LB(t.toDelta())!==r)return false}return bGe(t,e),true}function fne(t,e){return t===e||JSON.stringify(t)===JSON.stringify(e)}function mne(t,e,n){for(let r of n){let o=e[r],i=t.get(r);o===void 0?i!==void 0&&t.delete(r):fne(i,o)||t.set(r,o);}}function gne(t,e,n){for(let[r,o]of Object.entries(n)){let i=e[r]===void 0?void 0:JSON.stringify(e[r]),s=t.get(o);i===void 0?s!==void 0&&t.delete(o):s!==i&&t.set(o,i);}}function SGe(t,e,n){let r=e.textSegments,o=t.get("textBody");if(!Array.isArray(r)){o!==void 0&&t.delete("textBody");return}let i=sGe(r),s=ZB(i),a=vU(o)?ZB(o.toDelta()):void 0;if(a!==void 0&&fne(a,s)||pGe(o)&&vGe(o,i))return;let l=n.createText();dne(r,l),t.set("textBody",l);}function wGe(t,e,n){let r=e;mne(t,r,une),gne(t,r,dA),SGe(t,r,n);}function DB(t,e){let n=t.get(e);if(!n||typeof n.get!="function")return;let r=n.get("id");return typeof r=="string"?r:void 0}function xne(t,e,n){let r=new Set;for(let i of e){let s=n.idOf(i);typeof s=="string"&&r.add(s);}let o=new Set;for(let i=t.length-1;i>=0;i--){let s=DB(t,i);s!==void 0&&(!r.has(s)||o.has(s)?t.delete(i,1):o.add(s));}for(let i=0;i<e.length;i++){let s=e[i],a=n.idOf(s),l=i<t.length?DB(t,i):void 0;if(a===void 0){i<t.length&&l===void 0?n.update(t.get(i),s):t.insert(i,[n.create(s)]);continue}if(l===a){n.update(t.get(i),s);continue}let c=-1;for(let d=i+1;d<t.length;d++)if(DB(t,d)===a){c=d;break}c>=0&&t.delete(c,1),t.insert(i,[n.create(s)]);}t.length>e.length&&t.delete(e.length,t.length-e.length);}function CGe(t,e,n){let r=e;mne(t,r,wU),gne(t,r,TU);let o=t.get("elements");TGe(o)||(o=n.createArray(),t.set("elements",o)),xne(o,e.elements,{idOf:i=>typeof i.id=="string"?i.id:void 0,create:i=>{let s=n.createMap();return pne(i,s,n),s},update:(i,s)=>wGe(i,s,n)});}function yne(t,e,n,r=jA){e.transact(()=>{let o=e.getArray(SU);xne(o,t,{idOf:i=>typeof i.id=="string"?i.id:void 0,create:i=>{let s=n.createMap();return dGe(i,s,n),s},update:(i,s)=>CGe(i,s,n)});},r);}function JB(t){return ze(t)?t.textSegments&&t.textSegments.length>0?t.textSegments.map(e=>e.text).join(""):t.text??"":""}function Mm(t){let e=t.type.charAt(0).toUpperCase()+t.type.slice(1),n=JB(t);if(n.length>0){let r=n.length>30?`${n.slice(0,30)}...`:n;return `${e}: "${r}"`}return `${e} (${t.id})`}function QB(t){let e=[];for(let n of t)e.push(n),n.type==="group"&&n.children&&e.push(...QB(n.children));return e}function ZQ(t){let e=new Map;for(let n of t)e.set(n.id,n);return e}function MGe(t,e){let n=[],r=ZQ(QB(t)),o=ZQ(QB(e));for(let[i,s]of r)o.has(i)||n.push({elementId:i,label:Mm(s),kind:"removed",description:`Element removed: ${Mm(s)}`});for(let[i,s]of o)r.has(i)||n.push({elementId:i,label:Mm(s),kind:"added",description:`Element added: ${Mm(s)}`});for(let[i,s]of r){let a=o.get(i);if(!a)continue;(Math.abs(s.x-a.x)>KQ||Math.abs(s.y-a.y)>KQ)&&n.push({elementId:i,label:Mm(s),kind:"moved",description:`Moved from (${Math.round(s.x)}, ${Math.round(s.y)}) to (${Math.round(a.x)}, ${Math.round(a.y)})`}),(Math.abs(s.width-a.width)>qQ||Math.abs(s.height-a.height)>qQ)&&n.push({elementId:i,label:Mm(s),kind:"resized",description:`Resized from ${Math.round(s.width)}x${Math.round(s.height)} to ${Math.round(a.width)}x${Math.round(a.height)}`});let l=JB(s),c=JB(a);l!==c&&n.push({elementId:i,label:Mm(s),kind:"textChanged",description:"Text content changed"});}return n}function _Ge(t,e){let n=MGe(t.elements,e.elements);return t.backgroundColor!==e.backgroundColor&&n.push({elementId:"__background__",label:"Background",kind:"textChanged",description:`Background changed from ${t.backgroundColor??"default"} to ${e.backgroundColor??"default"}`}),(t.notes??"")!==(e.notes??"")&&n.push({elementId:"__notes__",label:"Speaker Notes",kind:"textChanged",description:"Speaker notes changed"}),n}function PGe(t,e){let n=[],r=Math.max(t.length,e.length),o=0,i=0,s=0,a=0;for(let l=0;l<r;l++){let c=t[l],d=e[l];if(c&&!d)n.push({status:"removed",baseIndex:l,compareIndex:-1,baseSlide:c,changes:[]}),i++;else if(!c&&d)n.push({status:"added",baseIndex:-1,compareIndex:l,compareSlide:d,changes:[]}),o++;else if(c&&d){let u=_Ge(c,d);u.length>0?(n.push({status:"changed",baseIndex:l,compareIndex:l,baseSlide:c,compareSlide:d,changes:u}),s++):(n.push({status:"unchanged",baseIndex:l,compareIndex:l,baseSlide:c,compareSlide:d,changes:[]}),a++);}}return {diffs:n,baseSlideCount:t.length,compareSlideCount:e.length,addedCount:o,removedCount:i,changedCount:s,unchangedCount:a}}function MU(t,e){return PGe(t.slides,e.slides)}function RGe(t,e){return e[t%e.length]}function $a(t,e,n){let r=t.style?.fillColor;return r&&r.length>0?r:RGe(e,n)}function eu(t,e){let n=t.style?.lineColor;return n&&n.length>0?n:e}function Fc(t,e,n){let r=n==="intense"?1:n==="moderate"?.92:.85;return e<=1?r:r-t/(e-1)*.15}function Hc(t){if(t==="intense")return "drop-shadow(0 2px 6px rgba(0,0,0,0.35))";if(t==="moderate")return "drop-shadow(0 1px 3px rgba(0,0,0,0.2))"}function oh(t){return t==="intense"?2:t==="moderate"?1.5:0}function Ha(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function Bl(t,e,n,r){let i=e/Math.max(1,t.length*.6),s=n*.5;return Math.max(6,Math.min(r,i,s))}function ih(t){return t>0?"rgba(255,255,255,0.3)":"none"}function kGe(t){if(t.some(o=>o.children!==void 0&&o.children.length>0)){let o=a=>({node:a,children:(a.children??[]).map(o)}),i=new Set(t.map(a=>a.id));return t.filter(a=>!a.parentId||!i.has(a.parentId)).map(o)}let n=new Map;for(let o of t)n.set(o.id,{node:o,children:[]});let r=[];for(let o of t){let i=n.get(o.id);o.parentId&&n.has(o.parentId)?n.get(o.parentId).children.push(i):r.push(i);}return r}function hy(t){return t.children.length===0?1:t.children.reduce((e,n)=>e+hy(n),0)}function bne(t){return t.children.length===0?1:1+Math.max(...t.children.map(bne))}function vne(t){let e=[],n=r=>{e.push(r);for(let o of r.children??[])n(o);};for(let r of t)n(r);return e}function IGe(t,e,n){if(n&&n in JQ)return JQ[n];if(e&&e in QQ){let o=QQ[e];if(o)return o}return t.some(o=>o.children&&o.children.length>0)?"hierarchy":"list"}function Sne(t,e,n,r,o){let{width:i,height:s}=e,a=8,l=4,c=s-a*2,d=t.length>0?(c-l*(t.length-1))/t.length:c,u=i-a*2,p=Math.min(6,d*.15),h=oh(r),f=ih(h);return {nodes:t.map((x,g)=>{let y=a+g*(d+l),b=Bl(x.text,u*.9,d,12);return {kind:"rect",key:`${o}-list-${x.id}-${g}`,x:a,y,width:u,height:d,rx:p,fill:$a(x,g,n),stroke:eu(x,f),strokeWidth:h,opacity:Fc(g,t.length,r),text:Ha(x.text,40),fontSize:b,textX:a+u/2,textY:y+d/2}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"list"}}function NGe(t,e,n,r,o){let{width:i,height:s}=e,a=8,l=4,c=Math.min(16,i*.04),d=i-a*2,u=t.length>0?(d-l*(t.length-1))/t.length:d,p=Math.min(s-a*2,s*.6),h=s/2,f=oh(r),m=ih(f);return {nodes:t.map((g,y)=>{let b=a+y*(u+l),v=p/2,S=y===0,w=y===t.length-1,C;S?C=[`${b},${h-v}`,`${b+u-c},${h-v}`,`${b+u},${h}`,`${b+u-c},${h+v}`,`${b},${h+v}`].join(" "):w?C=[`${b},${h-v}`,`${b+u},${h-v}`,`${b+u},${h+v}`,`${b},${h+v}`,`${b+c},${h}`].join(" "):C=[`${b},${h-v}`,`${b+u-c},${h-v}`,`${b+u},${h}`,`${b+u-c},${h+v}`,`${b},${h+v}`,`${b+c},${h}`].join(" ");let T=Bl(g.text,u*.7,p,12);return {kind:"polygon",key:`${o}-process-${g.id}-${y}`,points:C,fill:$a(g,y,n),stroke:eu(g,m),strokeWidth:f,opacity:Fc(y,t.length,r),text:Ha(g.text,25),fontSize:T,textX:b+u/2,textY:h}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"process"}}function LGe(t,e,n,r,o){let{width:i,height:s}=e,a=Math.min(i,s),l=i/2,c=s/2,d=a*.35,u=Math.max(a*.06,Math.min(a*.12,200/Math.max(1,t.length))),p=oh(r),h=ih(p),f=t.map((x,g)=>{let y=g/t.length*Math.PI*2-Math.PI/2,b=l+d*Math.cos(y),v=c+d*Math.sin(y),w=(g+1)%t.length/t.length*Math.PI*2-Math.PI/2,C=l+d*Math.cos(w),T=c+d*Math.sin(w),M=(y+w)/2,_=g===t.length-1?(y+w+Math.PI*2)/2:M,E=d*.15,R=l+(d+E)*Math.cos(_),I=c+(d+E)*Math.sin(_);return {key:`${o}-cycle-conn-${g}`,d:`M${b},${v} Q${R},${I} ${C},${T}`}});return {nodes:t.map((x,g)=>{let y=g/t.length*Math.PI*2-Math.PI/2,b=l+d*Math.cos(y),v=c+d*Math.sin(y),S=Bl(x.text,u*1.4,u*2,11);return {kind:"circle",key:`${o}-cycle-${x.id}-${g}`,cx:b,cy:v,r:u,fill:$a(x,g,n),stroke:eu(x,h),strokeWidth:p,opacity:Fc(g,t.length,r),text:Ha(x.text,20),fontSize:S}}),connectors:f,shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"cycle"}}function DGe(t,e,n,r,o){let i=kGe(t);if(i.length===0)return Sne(t,e,n,r,o);let{width:s,height:a}=e,l=i.reduce((w,C)=>w+hy(C),0),c=Math.max(...i.map(bne)),d=s/Math.max(1,l),u=a/Math.max(1,c),p=Math.min(d*.8,140),h=Math.min(u*.4,36),f=Math.min(6,h*.15),m=oh(r),x=ih(m),g=[],y=[],b=0;function v(w,C,T){let M=hy(w),_=(C+M/2)*d,E=T*u+u/2,R=b++,I=Bl(w.node.text,p*.9,h,11),L=C;for(let N of w.children){let D=hy(N),U=(L+D/2)*d,G=(T+1)*u+u/2,j=E+h/2+(G-h/2-(E+h/2))/2;y.push({key:`${o}-hier-conn-${w.node.id}-${N.node.id}`,d:`M${_},${E+h/2} L${_},${j} L${U},${j} L${U},${G-h/2}`}),L+=D;}let k={kind:"rect",key:`${o}-hier-${w.node.id}-${R}`,x:_-p/2,y:E-h/2,width:p,height:h,rx:f,fill:$a(w.node,R,n),stroke:eu(w.node,x),strokeWidth:m,opacity:Fc(R,t.length,r),text:Ha(w.node.text,40),fontSize:I,textX:_,textY:E};g.push(k);let F=C;for(let N of w.children)v(N,F,T+1),F+=hy(N);}let S=0;for(let w of i)v(w,S,0),S+=hy(w);return {nodes:g,connectors:y,shadowFilter:Hc(r),viewBox:`0 0 ${s} ${a}`,family:"hierarchy"}}function FGe(t,e,n,r,o){let{width:i,height:s}=e,a=Math.max(1,Math.ceil(Math.sqrt(t.length))),l=Math.max(1,Math.ceil(t.length/a)),c=8,d=6,u=i-c*2,p=s-c*2,h=(u-d*(a-1))/a,f=(p-d*(l-1))/l,m=Math.min(6,Math.min(h,f)*.1),x=oh(r),g=ih(x);return {nodes:t.map((b,v)=>{let S=v%a,w=Math.floor(v/a),C=c+S*(h+d),T=c+w*(f+d),M=Bl(b.text,h*.85,f,12);return {kind:"rect",key:`${o}-matrix-${b.id}-${v}`,x:C,y:T,width:h,height:f,rx:m,fill:$a(b,v,n),stroke:eu(b,g),strokeWidth:x,opacity:Fc(v,t.length,r),text:Ha(b.text,30),fontSize:M,textX:C+h/2,textY:T+f/2}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"matrix"}}function OGe(t,e,n,r,o){let{width:i,height:s}=e,a=i/2,l=s/2,c=Math.min(i,s),d=oh(r),u=ih(d);if(t.length===0)return {nodes:[],connectors:[],shadowFilter:void 0,viewBox:`0 0 ${i} ${s}`,family:"radial"};let[p,...h]=t,f=c*.14,m=c*.35,x=Math.max(c*.06,Math.min(c*.1,180/Math.max(1,h.length))),g=[],y=[],b=Bl(p.text,f*1.6,f*2,12);return g.push({kind:"circle",key:`${o}-radial-centre-0`,cx:a,cy:l,r:f,fill:$a(p,0,n),stroke:eu(p,u),strokeWidth:d,opacity:Fc(0,t.length,r),text:Ha(p.text,20),fontSize:b}),h.forEach((v,S)=>{let w=S+1,C=S/Math.max(1,h.length)*Math.PI*2-Math.PI/2,T=a+m*Math.cos(C),M=l+m*Math.sin(C),_=Bl(v.text,x*1.4,x*2,10),E=a+f*Math.cos(C),R=l+f*Math.sin(C);y.push({key:`${o}-radial-conn-${w}`,d:`M${E},${R} L${T},${M}`}),g.push({kind:"circle",key:`${o}-radial-${v.id}-${w}`,cx:T,cy:M,r:x,fill:$a(v,w,n),stroke:eu(v,u),strokeWidth:d,opacity:Fc(w,t.length,r),text:Ha(v.text,20),fontSize:_});}),{nodes:g,connectors:y,shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"radial"}}function BGe(t,e,n,r,o){let{width:i,height:s}=e,a=8,l=3,c=s-a*2,d=t.length>0?(c-l*(t.length-1))/t.length:c,u=i-a*2,p=oh(r),h=ih(p);return {nodes:t.map((m,x)=>{let g=.3+x/Math.max(t.length-1,1)*.7,y=x<t.length-1?.3+(x+1)/Math.max(t.length-1,1)*.7:1,b=u*g,v=u*y,S=a+x*(d+l),w=(i-b)/2,C=w+b,T=(i-v)/2,M=T+v,_=[`${w},${S}`,`${C},${S}`,`${M},${S+d}`,`${T},${S+d}`].join(" "),E=Bl(m.text,b*.85,d,12);return {kind:"polygon",key:`${o}-pyramid-${m.id}-${x}`,points:_,fill:$a(m,x,n),stroke:eu(m,h),strokeWidth:p,opacity:Fc(x,t.length,r),text:Ha(m.text,30),fontSize:E,textX:i/2,textY:S+d/2}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"pyramid"}}function UGe(t,e,n,r,o){let{width:i,height:s}=e,a=Hc(r);if(t.length<=4){let f=i/2,m=s/2,x=Math.min(i,s)*.28,g=x*.55;return {nodes:t.map((b,v)=>{let S=v/Math.max(1,t.length)*Math.PI*2-Math.PI/2,w=f+g*Math.cos(S),C=m+g*Math.sin(S),T=Bl(b.text,x*1.2,x*2,11);return {kind:"circle",key:`${o}-venn-${b.id}-${v}`,cx:w,cy:C,r:x,fill:$a(b,v,n),stroke:"none",strokeWidth:0,opacity:.35,text:Ha(b.text,20),fontSize:T}}),connectors:[],shadowFilter:a,viewBox:`0 0 ${i} ${s}`,family:"venn"}}let l=Math.min(s*.38,i/(t.length*.9)),c=l*.5,d=t.length*(l*2-c)+c,u=(i-d)/2+l,p=s/2;return {nodes:t.map((f,m)=>{let x=u+m*(l*2-c),g=Bl(f.text,l*1.2,l*2,10);return {kind:"circle",key:`${o}-venn-${f.id}-${m}`,cx:x,cy:p,r:l,fill:$a(f,m,n),stroke:"none",strokeWidth:0,opacity:.35,text:Ha(f.text,20),fontSize:g}}),connectors:[],shadowFilter:a,viewBox:`0 0 ${i} ${s}`,family:"venn"}}function $Ge(t,e,n,r,o){let{width:i,height:s}=e,a=8,l=i-a*2,c=t.length>0?(s-a*2)/t.length:s-a*2,d=oh(r),u=ih(d);return {nodes:t.map((h,f)=>{let m=l*(1-f/Math.max(1,t.length)),x=l*(1-(f+1)/Math.max(1,t.length)),g=a+f*c,y=(i-m)/2,b=y+m,v=(i-x)/2,S=v+x,w=[`${y},${g}`,`${b},${g}`,`${S},${g+c}`,`${v},${g+c}`].join(" "),C=Bl(h.text,m*.85,c,11);return {kind:"polygon",key:`${o}-funnel-${h.id}-${f}`,points:w,fill:$a(h,f,n),stroke:eu(h,u),strokeWidth:d,opacity:Fc(f,t.length,r),text:Ha(h.text,30),fontSize:C,textX:i/2,textY:g+c/2}}),connectors:[],shadowFilter:Hc(r),viewBox:`0 0 ${i} ${s}`,family:"funnel"}}function HGe(t,e,n,r,o){let{width:i,height:s}=e,a=i*.4,l=s/2,c=Math.min(a-8,l-8),d=Hc(r);return {nodes:t.map((p,h)=>{let f=c*((t.length-h)/Math.max(1,t.length));return {kind:"circle",key:`${o}-target-${p.id}-${h}`,cx:a,cy:l,r:Math.max(f,4),fill:$a(p,h,n),stroke:"none",strokeWidth:0,opacity:Fc(h,t.length,r),text:Ha(p.text,30),fontSize:Math.max(7,Math.min(10,c/Math.max(1,t.length+1)))}}),connectors:[],shadowFilter:d,viewBox:`0 0 ${i} ${s}`,family:"target"}}function _U(t,e,n,r,o,i,s){let a=vne(t);switch(IGe(t,i,s)){case "list":return Sne(a,e,n,r,o);case "process":return NGe(a,e,n,r,o);case "cycle":return LGe(a,e,n,r,o);case "hierarchy":return DGe(t,e,n,r,o);case "matrix":return FGe(a,e,n,r,o);case "radial":return OGe(a,e,n,r,o);case "pyramid":return BGe(a,e,n,r,o);case "venn":return UGe(a,e,n,r,o);case "funnel":return $Ge(a,e,n,r,o);case "target":return HGe(a,e,n,r,o)}}function zGe(t){let e=t.trim().split(/\s+/u).map(Number),n=e[2],r=e[3];return {width:Number.isFinite(n)&&n>0?n:1,height:Number.isFinite(r)&&r>0?r:1}}function VGe(t,e,n,r=4){let o=t/2,i=e/2,s=Math.max(0,Math.min(n,o,i));if(s<=0)return [{x:-o,y:-i},{x:o,y:-i},{x:o,y:i},{x:-o,y:i}];let a=[],l=[{cx:o-s,cy:-i+s,start:-Math.PI/2},{cx:o-s,cy:i-s,start:0},{cx:-o+s,cy:i-s,start:Math.PI/2},{cx:-o+s,cy:-i+s,start:Math.PI}];for(let{cx:c,cy:d,start:u}of l)for(let p=0;p<=r;p++){let h=u+p/r*(Math.PI/2);a.push({x:c+Math.cos(h)*s,y:d+Math.sin(h)*s});}return a}function GGe(t,e=48){let n=[];for(let r=0;r<e;r++){let o=r/e*Math.PI*2;n.push({x:Math.cos(o)*t,y:Math.sin(o)*t});}return n}function WGe(t){let e=[];for(let n of t.trim().split(/\s+/u)){let[r,o]=n.split(","),i=Number(r),s=Number(o);Number.isFinite(i)&&Number.isFinite(s)&&e.push({x:i,y:s});}return e}function XGe(t){let e=[],n=t.match(/[a-zA-Z]|-?\d*\.?\d+(?:e-?\d+)?/gu);if(!n)return e;let r=0,o="",i={x:0,y:0},s=()=>Number(n[r++]);for(;r<n.length;){let a=n[r];/[a-zA-Z]/u.test(a)&&(o=a,r++);let l=o===o.toLowerCase();switch(o.toUpperCase()){case "M":case "L":{let c=s(),d=s();i=l?{x:i.x+c,y:i.y+d}:{x:c,y:d},e.push(i);break}case "H":{let c=s();i={x:l?i.x+c:c,y:i.y},e.push(i);break}case "V":{let c=s();i={x:i.x,y:l?i.y+c:c},e.push(i);break}case "C":{s(),s(),s(),s();let c=s(),d=s();i=l?{x:i.x+c,y:i.y+d}:{x:c,y:d},e.push(i);break}case "Q":{s(),s();let c=s(),d=s();i=l?{x:i.x+c,y:i.y+d}:{x:c,y:d},e.push(i);break}default:r++;}}return e}function jGe(t){if(t.length===0)return {cx:0,cy:0,width:0,height:0};let e=1/0,n=1/0,r=-1/0,o=-1/0;for(let i of t)i.x<e&&(e=i.x),i.y<n&&(n=i.y),i.x>r&&(r=i.x),i.y>o&&(o=i.y);return {cx:(e+r)/2,cy:(n+o)/2,width:r-e,height:o-n}}function YGe(t){let e=t.trim().replace(/^#/u,"");return e.length===3&&(e=e.split("").map(n=>n+n).join("")),e.length!==6||/[^0-9a-fA-F]/u.test(e)?[128,128,128]:[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function KGe(t){let[e,n,r]=YGe(t);return (.299*e+.587*n+.114*r)/255>.6?"#1a1a1a":"#ffffff"}function eee(t,e){let n=Math.hypot(t,e),r=Math.atan2(t,e);return {pos:{x:n*Math.sin(r),y:0,z:n*Math.cos(r)},angle:r}}function qGe(t){let e=t.meshes.map(r=>{let{pos:o,angle:i}=eee(r.position.x,r.position.y);return {...r,position:o,rotation:{x:0,y:i,z:0}}}),n=t.connectors.map(r=>({...r,points:r.points.map(o=>eee(o.x,o.y).pos)}));return {...t,meshes:e,connectors:n}}function ZGe(t){if(t.meshes.length===0)return t;let e=-1/0,n=1/0;for(let l of t.meshes)l.position.y>e&&(e=l.position.y),l.position.y<n&&(n=l.position.y);let r=e-n||1,o=Math.max(t.bounds.width,t.bounds.height)*.6,i=l=>-((e-l)/r)*o,s=t.meshes.map(l=>({...l,position:{x:l.position.x,y:l.position.y,z:i(l.position.y)}})),a=t.connectors.map(l=>({...l,points:l.points.map(c=>({x:c.x,y:c.y,z:i(c.y)}))}));return {...t,meshes:s,connectors:a}}function JGe(t){switch(t.family){case "cycle":case "radial":return qGe(t);case "hierarchy":return ZGe(t);default:return t}}function tWe(t,e){if(typeof e.depth=="number"&&e.depth>0)return e.depth;let n=e.depthRatio??QGe;return Math.max(2,t*n)}function nWe(t,e,n,r){let o=m=>m-e/2,i=m=>n/2-m,s,a=false,l,c,d,u;if(t.kind==="rect")l=t.x+t.width/2,c=t.y+t.height/2,d=t.width/2,u=t.height/2,s=VGe(t.width,t.height,t.rx),a=t.rx>0;else if(t.kind==="circle")l=t.cx,c=t.cy,d=t.r,u=t.r,s=GGe(t.r),a=true;else {let m=WGe(t.points);if(m.length<3)return null;let x=jGe(m);l=x.cx,c=x.cy,d=x.width/2,u=x.height/2,s=m.map(g=>({x:g.x-x.cx,y:x.cy-g.y}));}let p=Math.max(2,Math.min(d,u)*2),h=tWe(p,r),f=h*(r.bevelRatio??eWe);return {id:t.key,outline:s,rounded:a,depth:h,bevel:f,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,position:{x:o(l),y:i(c),z:0},rotation:{x:0,y:0,z:0},text:t.text,textColor:KGe(t.fill),fontSize:t.fontSize,halfWidth:d,halfHeight:u}}function wne(t,e={}){let{width:n,height:r}=zGe(t.viewBox),o=[];for(let a of t.nodes){let l=nWe(a,n,r,e);l&&o.push(l);}let i=[];for(let a of t.connectors){let l=XGe(a.d);l.length<2||i.push({id:a.key,points:l.map(c=>({x:c.x-n/2,y:r/2-c.y,z:0})),color:"#888888",width:1.5});}let s={meshes:o,connectors:i,bounds:{width:n,height:r},family:t.family,background:e.background};return e.spatial?JGe(s):s}function oWe(t){return tee[t??"unknown"]??tee.unknown}function Tne(t){let e=[],n=r=>{e.push(r);for(let o of r.children??[])n(o);};for(let r of t)n(r);return e}function iWe(t){return Tne(t).map(e=>(e.text??"").trim()).filter(e=>e.length>0)}function sWe(t){let e=oWe(t.resolvedLayoutType),n=iWe(t.nodes??[]),r=n.length,o=`${e} SmartArt diagram`;if(r===0)return `${o} with no nodes`;let i=r===1?"node":"nodes",s=n.slice(0,rWe),a=r-s.length,l=a>0?`${s.join("; ")}; and ${a} more`:s.join("; ");return `${o} with ${r} ${i}: ${l}`}function aWe(t,e,n){let r=`Node ${e+1} of ${n}`,o=(t??"").trim();return o.length>0?`${r}: ${o}`:r}function Cne(t){let e=Tne(t.nodes??[]),n=e.length,r=e.map((o,i)=>({id:o.id,label:aWe(o.text,i,n)}));return {role:"img",label:sWe(t),nodes:r}}async function cWe(){try{return await Promise.resolve().then(()=>(Ic(),dy))}catch{return null}}async function dWe(){try{return (await Promise.resolve().then(()=>(SQ(),vQ))).GLTFLoader}catch{return null}}async function uWe(){try{return (await Promise.resolve().then(()=>(JE(),EB))).OrbitControls}catch{return null}}function pWe(t,e){return new Promise((n,r)=>{t.load(e,n,void 0,r);})}function hWe(t,e){let n=new t.Box3().setFromObject(e),r=new t.Vector3;n.getSize(r);let o=Math.max(r.x,r.y,r.z);o>0&&e.scale.setScalar(2/o);let i=new t.Vector3;n.getCenter(i),e.position.sub(i.multiplyScalar(e.scale.x));}async function Mne(t,e,n){let r=await cWe(),o=r?await dWe():null;if(!r||!o)return nee;let i=Math.max(1,n.width),s=Math.max(1,n.height),a=new r.WebGLRenderer({antialias:true,alpha:!n.background});a.setPixelRatio(Math.min(typeof window>"u"?1:window.devicePixelRatio||1,n.maxPixelRatio??2)),a.setSize(i,s,false);let l=a.domElement;l.style.width=`${i}px`,l.style.height=`${s}px`,l.style.display="block",l.style.willChange="transform",t.appendChild(l);let c=new r.Scene;n.background&&(c.background=new r.Color(n.background));let d=new r.PerspectiveCamera(lWe,i/s,.1,1e3);d.position.set(0,0,5),d.lookAt(0,0,0),c.add(new r.AmbientLight(16777215,.5));let u=new r.DirectionalLight(16777215,1);u.position.set(5,5,5),c.add(u);let p=new r.DirectionalLight(16777215,.3);p.position.set(-3,-3,2),c.add(p);let h;try{h=await pWe(new o,e);}catch{return a.dispose(),l.remove(),nee}let f=h.scene;hWe(r,f),c.add(f);let m=null,x=await uWe(),g=w=>{w&&!m&&x?(m=new x(d,l),m.enablePan=false,m.enableZoom=true,m.enableRotate=true,m.minDistance=2,m.maxDistance=20,m.update()):!w&&m&&(m.dispose(),m=null);};g(n.interactive??true);let y=0,b=false,v=()=>{b||(y=requestAnimationFrame(v),m?.update(),a.render(c,d));};y=requestAnimationFrame(v);let S=()=>{f.traverse(w=>{let C=w;C.geometry?.dispose();let T=C.material;if(Array.isArray(T))for(let M of T)M.dispose();else T?.dispose();});};return {ok:true,resize(w,C){let T=Math.max(1,w),M=Math.max(1,C);d.aspect=T/M,d.updateProjectionMatrix(),a.setSize(T,M,false),l.style.width=`${T}px`,l.style.height=`${M}px`;},setInteractive(w){g(w);},dispose(){b||(b=true,cancelAnimationFrame(y),m?.dispose(),S(),c.clear(),a.dispose(),l.remove());}}}function YA(t,e){return {gridWidth:Math.max(t-1,1)*ree,gridDepth:Math.max(e-1,1)*ree}}function fWe(t,e,n,r,o){let i=Math.max(e-1,0),s=Math.max(n-1,0),{gridWidth:a,gridDepth:l}=YA(e,n),c=new t.PlaneGeometry(a,l,i,s);c.rotateX(-Math.PI/2);let d=c.attributes.position,u=d.count,p=new Float32Array(u*3);for(let f=0;f<u;f++){let m=Math.floor(f/e),x=f%e,g=m*e+x,y=g<r.length?r[g]:0;d.setY(f,y*_ne);let b=g*3;p[f*3]=b<o.length?o[b]:.5,p[f*3+1]=b+1<o.length?o[b+1]:.5,p[f*3+2]=b+2<o.length?o[b+2]:.5;}c.setAttribute("color",new t.BufferAttribute(p,3)),c.computeVertexNormals(),d.needsUpdate=true;let h=new t.WireframeGeometry(c);return {geometry:c,wireGeometry:h}}function mWe(t,e,n,r,o=8,i=6){let{gridWidth:s,gridDepth:a}=YA(t,e),l=[],c=Math.max(1,Math.ceil(n.length/o));for(let u=0;u<n.length;u+=c){let p=-s/2+u/Math.max(t-1,1)*s;l.push({key:`cat-${u}`,text:n[u],anchor:[p,-0.15,a/2+.25],axis:"category"});}let d=Math.max(1,Math.ceil(r.length/i));for(let u=0;u<r.length;u+=d){let p=-a/2+u/Math.max(e-1,1)*a;l.push({key:`ser-${u}`,text:r[u],anchor:[s/2+.3,-0.15,p],axis:"series"});}return l.push({key:"value-axis",text:"Value",anchor:[-s/2-.35,.75,-a/2],axis:"value"}),l}function gWe(t,e){let{gridWidth:n,gridDepth:r}=YA(t,e),i=Math.max(n,r,_ne)*1.8;return {position:[i*.8,i*.7,i*.8],target:[0,.3,0]}}async function bWe(){try{return await Promise.resolve().then(()=>(Ic(),dy))}catch{return null}}async function vWe(){try{return (await Promise.resolve().then(()=>(JE(),EB))).OrbitControls}catch{return null}}function SWe(t,e){let n=t.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0",pointerEvents:"none",overflow:"hidden"});let r=e.map(o=>{let i=t.createElement("div");i.textContent=o.text;let s=o.axis==="value"?"#999":"#666";return Object.assign(i.style,{position:"absolute",fontSize:"9px",color:s,whiteSpace:"nowrap",userSelect:"none",transform:"translate(-50%, -50%)",willChange:"left, top"}),o.axis==="value"&&(i.style.writingMode="vertical-rl"),n.appendChild(i),i});return {layer:n,nodes:r}}async function Pne(t,e){let n=await bWe(),r=n?await vWe():null;if(!n||!r)return xWe;let{cols:o,rows:i}=e,s=Math.max(1,e.width),a=Math.max(1,e.height),l=new n.WebGLRenderer({antialias:true,alpha:true});l.setPixelRatio(Math.min(typeof window>"u"?1:window.devicePixelRatio||1,e.maxPixelRatio??2)),l.setSize(s,a,false);let c=l.domElement;c.style.width=`${s}px`,c.style.height=`${a}px`,c.style.display="block",c.style.willChange="transform",t.appendChild(c);let d=new n.Scene;d.add(new n.AmbientLight(16777215,.6));let u=new n.DirectionalLight(16777215,.8);u.position.set(5,8,5),d.add(u);let p=new n.DirectionalLight(16777215,.3);p.position.set(-3,4,-2),d.add(p);let h=new n.PerspectiveCamera(yWe,s/a,.1,1e3),f=gWe(o,i);h.position.set(...f.position);let m=new n.Vector3(...f.target);h.lookAt(m);let{gridWidth:x,gridDepth:g}=YA(o,i),y=Math.max(x,g)*1.2,b=new n.GridHelper(y,Math.max(o,i),13421772,15263976);b.position.y=-0.02,d.add(b);let{geometry:v,wireGeometry:S}=fWe(n,o,i,e.heightMap,e.colorMap),w=new n.MeshPhongMaterial({vertexColors:true,side:n.DoubleSide,shininess:30,transparent:true,opacity:.92}),C=new n.Mesh(v,w);d.add(C);let T=null;e.wireframe&&(T=new n.LineBasicMaterial({color:3355443,transparent:true,opacity:.25}),d.add(new n.LineSegments(S,T)));let M=new r(h,c);M.enablePan=true,M.enableZoom=true,M.enableRotate=true,M.minDistance=1,M.maxDistance=20,M.maxPolarAngle=Math.PI/2+.3,M.target.copy(m),M.update();let _=t.ownerDocument??document,E=mWe(o,i,e.categoryLabels,e.seriesNames),{layer:R,nodes:I}=SWe(_,E);t.appendChild(R);let L=E.map(G=>new n.Vector3(...G.anchor)),k=new n.Vector3,F=()=>{for(let G=0;G<I.length;G++){k.copy(L[G]).project(h);let j=I[G];if(k.z>1){j.style.display="none";continue}j.style.display="",j.style.left=`${(k.x+1)/2*s}px`,j.style.top=`${(-k.y+1)/2*a}px`;}},N=0,D=false,U=()=>{D||(N=requestAnimationFrame(U),M.update(),l.render(d,h),F());};return N=requestAnimationFrame(U),{ok:true,resize(G,j){s=Math.max(1,G),a=Math.max(1,j),h.aspect=s/a,h.updateProjectionMatrix(),l.setSize(s,a,false),c.style.width=`${s}px`,c.style.height=`${a}px`;},dispose(){D||(D=true,cancelAnimationFrame(N),M.dispose(),v.dispose(),S.dispose(),w.dispose(),T?.dispose(),b.dispose(),d.clear(),l.dispose(),c.remove(),R.remove());}}}function KA(t){return Number.isNaN(t)?0:Math.min(100,Math.max(0,Math.round(t)))}function ST(t,e,n=90){return e<=0?0:KA(t/e*n)}function Ene(t,e){return e<=0?45:KA(45+t/e*45)}function zy(t,e,n){return `${t} slide ${e+1} of ${n}...`}function wT(t){return t instanceof DOMException&&t.name==="AbortError"}function CWe(t={}){return new Promise(e=>{if(typeof document>"u"){e(null);return}let n=document.createElement("input");n.type="file",n.accept=t.accept??TWe,n.style.position="fixed",n.style.left="-9999px",n.style.opacity="0";let r=false,o=s=>{r||(r=true,n.remove(),e(s));};n.addEventListener("change",()=>o(n.files?.[0]??null)),n.addEventListener("cancel",()=>o(null));let i=()=>{window.removeEventListener("focus",i),setTimeout(()=>o(null),300);};window.addEventListener("focus",i),document.body.appendChild(n),n.click();})}async function Ane(t={}){let e=await CWe(t);return e?{file:e,buffer:await e.arrayBuffer()}:null}function Rne(t,e){return e<=0?"0 / 0":`${t+1} / ${e}`}function kne(t){return t<=0}function Ine(t,e){return t>=e-1}function zw(t){return String(t).padStart(2,"0")}function Nne(t,e){if(t==null)return 0;let n=e-t;return n>0?n:0}function Lne(t){let e=t>0?t:0,n=Math.floor(e/1e3),r=Math.floor(n/3600),o=Math.floor(n%3600/60),i=n%60;return r>0?`${zw(r)}:${zw(o)}:${zw(i)}`:`${zw(o)}:${zw(i)}`}function PU(t){let{layoutHeight:e,visualHeight:n,offsetTop:r}=t;if(!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(r)||e<=0||n<=0)return 0;let o=e-(n+r);return o<=0?0:Math.round(o)}function Dne(t,e=MWe){return t>=e}function EU(t=typeof window<"u"?window:void 0){if(!t)return null;let e=t.visualViewport;return e?{layoutHeight:t.innerHeight,visualHeight:e.height,offsetTop:e.offsetTop}:null}function Fne(t,e,n,r=16){let o=e-n;return t.bottom>o-r?t.bottom-(o-r):t.top<r?t.top-r:0}function One(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Bne(t){let e=Date.now()-t,n=Math.floor(e/6e4);if(n<1)return "Just now";if(n<60)return `${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function qA(t){return t.trim().length===0?"webrtc":"websocket"}function $ne(){return `broadcast-${Math.random().toString(36).slice(2,10)}`}function Hne(t,e,n){if(!n)return t;let r=encodeURIComponent(t),o=e.trim();if(o.length===0)return `${n.origin}${n.pathname}?broadcast=${r}&transport=webrtc`;let i=encodeURIComponent(o);return `${n.origin}${n.pathname}?broadcast=${r}&server=${i}`}function eR(t){return Math.max(ZA,Math.min(JA,t))}function RU(t){return t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Vy(t){let e=Math.floor(t/1e3),n=Math.floor(e/3600),r=Math.floor(e%3600/60),o=e%60;return n>0?`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`}function kU(t){return t.map((e,n)=>{if(e.isParagraphBreak)return {kind:"break",key:`br-${n}`};let r={};return e.style.bold&&(r.fontWeight="bold"),e.style.italic&&(r.fontStyle="italic"),e.style.underline&&(r.textDecoration="underline"),e.style.strikethrough&&(r.textDecoration=`${r.textDecoration?`${r.textDecoration} `:""}line-through`),e.style.color&&(r.color=e.style.color),e.style.fontSize&&(r.fontSize=`${e.style.fontSize}pt`),e.style.fontFamily&&(r.fontFamily=e.style.fontFamily),{kind:"text",key:`seg-${n}`,text:e.text,style:r}})}function IU(t,e){return `${t+1} / ${e}`}function jw(t){let e=t.replace(/^#/u,"");if(e.length!==6)return null;let n=parseInt(e,16);return Number.isFinite(n)?{r:n>>16&255,g:n>>8&255,b:n&255}:null}function zne(t,e){let n=t.r-e.r,r=t.g-e.g,o=t.b-e.b;return Math.sqrt(n*n+r*r+o*o)}function Gne(t){return Math.max(0,Math.min(100,t))/100*Vne}function Wne(t,e,n,r,o){let i=t.length;for(let s=0;s<i;s+=4){let a={r:t[s],g:t[s+1],b:t[s+2]};zne(a,e)<=r&&(o?(t[s]=0,t[s+1]=0,t[s+2]=0,t[s+3]=0):(t[s]=n.r,t[s+1]=n.g,t[s+2]=n.b));}}function LU(t,e,n,r=nR,o=false){return new Promise((i,s)=>{let a=jw(e),l=jw(n);if(!a||!l){s(new Error(`Invalid hex colour: from="${e}" to="${n}"`));return}let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let{naturalWidth:d,naturalHeight:u}=c;if(d===0||u===0){s(new Error("Image has zero dimensions"));return}let p=document.createElement("canvas");p.width=d,p.height=u;let h=p.getContext("2d");if(!h){s(new Error("Cannot create 2D canvas context"));return}h.drawImage(c,0,0);let f=h.getImageData(0,0,d,u),m=Gne(r);Wne(f.data,a,l,m,o),h.putImageData(f,0,0),i({dataUrl:p.toDataURL("image/png"),width:d,height:u});},c.onerror=()=>{s(new Error("Failed to load image for colour change processing"));},c.src=t;})}function DU(t,e,n,r,o){return `${t.length>64?t.slice(0,64):t}|${e}|${n}|${r}|${o}`}function TT(t){return Vw.get(t)}function FU(t,e){if(Vw.size>=PWe){let n=Vw.keys().next().value;n!==void 0&&Vw.delete(n);}Vw.set(t,e);}function Xne(t,e,n){let r=t.length;for(let o=0;o<r;o+=4){let s=(.2126*t[o]+.7152*t[o+1]+.0722*t[o+2])/255,a=1-s;t[o]=Math.round(e.r*a+n.r*s),t[o+1]=Math.round(e.g*a+n.g*s),t[o+2]=Math.round(e.b*a+n.b*s);}}function OU(t,e,n){return new Promise((r,o)=>{let i=jw(e),s=jw(n);if(!i||!s){o(new Error(`Invalid hex colour: shadow="${e}" highlight="${n}"`));return}let a=new Image;a.crossOrigin="anonymous",a.onload=()=>{let{naturalWidth:l,naturalHeight:c}=a;if(l===0||c===0){o(new Error("Image has zero dimensions"));return}let d=document.createElement("canvas");d.width=l,d.height=c;let u=d.getContext("2d");if(!u){o(new Error("Cannot create 2D canvas context"));return}u.drawImage(a,0,0);let p=u.getImageData(0,0,l,c);Xne(p.data,i,s),u.putImageData(p,0,0),r({dataUrl:d.toDataURL("image/png"),width:l,height:c});},a.onerror=()=>{o(new Error("Failed to load image for duotone processing"));},a.src=t;})}function BU(t,e,n){return `dt|${t.length>64?t.slice(0,64):t}|${e}|${n}`}function rR(t){return Gw.get(t)}function UU(t,e){if(Gw.size>=EWe){let n=Gw.keys().next().value;n!==void 0&&Gw.delete(n);}Gw.set(t,e);}function HU(t){switch(t.type){case "image":case "picture":return "img";case "table":return "table";case "group":return "group";case "chart":return "img";case "smartArt":return "img";case "connector":return "img";case "media":return "application";case "ink":return "img";case "model3d":return "img";case "text":return;case "shape":return ze(t)&&t.text?void 0:"img";default:return}}function zU(t){if((t.type==="image"||t.type==="picture")&&"altText"in t&&typeof t.altText=="string"&&t.altText.trim())return t.altText.trim();if(ze(t)&&t.text){let e=t.text.trim();if(e)return e.length>120?`${e.slice(0,117)}...`:e}if(t.type==="chart"&&"chartData"in t&&t.chartData){let e=t.chartData;return e.title?`Chart: ${e.title}`:"Chart"}return t.type==="smartArt"?"SmartArt diagram":t.type==="table"?"Table":t.type==="media"?"Media element":t.type==="group"?"Group of elements":t.type==="connector"?"Connector line":t.type==="ink"?"Ink drawing":t.type==="model3d"?"3D Model":t.type==="shape"?"shapeType"in t&&t.shapeType?`Shape: ${t.shapeType}`:"Shape":AWe(t.type)}function AWe(t){switch(t){case "text":return "Text box";case "shape":return "Shape";case "image":case "picture":return "Image";case "table":return "Table";case "chart":return "Chart";case "connector":return "Connector";case "group":return "Group";case "smartArt":return "SmartArt";case "media":return "Media";case "ink":return "Drawing";case "ole":return "Embedded object";case "contentPart":return "Content part";case "model3d":return "3D Model";default:return "Element"}}function VU(t){switch(t.type){case "shape":{let e="shapeType"in t&&typeof t.shapeType=="string"?t.shapeType:void 0;return e?`shape: ${e}`:"shape"}case "chart":return "chart";case "connector":return "connector line";case "smartArt":return "diagram";case "image":case "picture":return "image";case "table":return "data table";case "group":return "grouped elements";case "media":return "media player";case "ink":return "ink drawing";case "model3d":return "3D model";default:return}}function CT(t){let e=[],n=/-?\d+(?:\.\d+)?(?:e[+-]?\d+)?/giu,r=[],o;for(;(o=n.exec(t))!==null;)r.push(parseFloat(o[0]));for(let i=0;i<r.length-1;i+=2)e.push({x:r[i],y:r[i+1]});return e}function jne(t,e){if(t.length===0)return 1;if(t.length===1)return t[0];let r=Math.max(0,Math.min(1,e))*(t.length-1),o=Math.floor(r),i=Math.min(o+1,t.length-1),s=r-o;return t[o]*(1-s)+t[i]*s}function GU(t,e,n){if(t.length===0)return [];let r=n.minRadius,o=n.maxRadius??n.baseWidth;return t.map((i,s)=>{let a=t.length===1?.5:s/(t.length-1),l=jne(e,a),c=n.baseWidth>0?l/n.baseWidth:1,d=Math.max(r,Math.min(o,n.baseWidth/2*c));return {cx:i.x,cy:i.y,r:d}})}function Gy(t){if(t.length<=1)return false;let e=t[0];return t.some(n=>Math.abs(n-e)>.01)}function oR(t,e,n=.3,r=1.8){return t.map(o=>{let i=Math.max(0,Math.min(1,o));return e*(n+i*(r-n))})}function WU(t){if(t.length<2)return 0;let e=0;for(let n=1;n<t.length;n++){let r=t[n].x-t[n-1].x,o=t[n].y-t[n-1].y;e+=Math.sqrt(r*r+o*o);}return e}function jU(t,e,n={}){let r=n.strokeDurationMs??600,o=n.strokeDelayMs??200,i=n.easing??"ease-in-out",s=t*(r+o),a=Math.max(e,1);return {pathLength:a,animationDelay:`${s}ms`,animationDuration:`${r}ms`,animation:`${XU} ${r}ms ${i} ${s}ms forwards`,strokeDasharray:`${a}`,strokeDashoffset:`${a}`}}function YU(t,e={}){return t.inkPaths.map((n,r)=>{let o=CT(n),i=WU(o);return jU(r,i,e)})}function KU(t,e={}){return t.map((n,r)=>{let o=CT(n.path),i=WU(o);return jU(r,i,e)})}function qU(t,e){return !t||e>=t.length?1:Math.max(0,Math.min(1,t[e]))}function ZU(t,e,n="#000"){return !t||e>=t.length?n:t[e]||n}function JU(t,e,n=3){return !t||e>=t.length?n:t[e]>0?t[e]:n}function t4(t,e){let n=t.clientX-e.clientX,r=t.clientY-e.clientY;return Math.sqrt(n*n+r*r)}function Zne(t,e,n){return Math.min(Math.max(t,e),n)}function Jne(t){let{getScale:e,minScale:n,maxScale:r,callbacks:o}=t,i=0,s=1,a=false,l=0,c=0,d=0,u=0,p=null,h=0,f=0,m=()=>{p!==null&&(clearTimeout(p),p=null);},x=v=>{v.touches.length===2?(a=true,i=t4(v.touches[0],v.touches[1]),s=e(),m(),v.preventDefault()):v.touches.length===1&&(l=v.touches[0].clientX,c=v.touches[0].clientY,d=l,u=c,h=v.touches[0].clientX,f=v.touches[0].clientY,m(),p=setTimeout(()=>{p=null,o.onLongPress?.(h,f);},qne));},g=v=>{if(v.touches.length===2&&a){v.preventDefault();let S=t4(v.touches[0],v.touches[1]);if(i>0){let w=S/i,C=Zne(s*w,n,r);o.onPinchZoom?.(C);}}else if(v.touches.length===1){d=v.touches[0].clientX,u=v.touches[0].clientY;let S=v.touches[0].clientX-h,w=v.touches[0].clientY-f;(Math.abs(S)>e4||Math.abs(w)>e4)&&m();}},y=v=>{if(a){a=false,i=0;return}if(m(),v.touches.length===0){let S=v.changedTouches.length>=1?v.changedTouches[0].clientX:d,w=v.changedTouches.length>=1?v.changedTouches[0].clientY:u,C=S-l,T=w-c;Math.abs(C)>=Yne&&Math.abs(T)<Kne&&o.onSwipe?.(C>0?1:-1);}},b=()=>{a=false,i=0,m();};return {onTouchStart:x,onTouchMove:g,onTouchEnd:y,onTouchCancel:b,cancel:b}}function ere(t=QU,e){return nS(t,{categories:[...RWe],series:[{name:"Series 1",values:[...kWe]}],title:"Chart Title",hasLegend:true},{x:rA.x,y:rA.y,width:rA.width,height:rA.height})}function IWe(t){let e=t.trim().split(/\s+/u),n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e){let a=s.indexOf(",");if(a<0)continue;let l=parseFloat(s.slice(0,a)),c=parseFloat(s.slice(a+1));!isFinite(l)||!isFinite(c)||(l<n&&(n=l),l>o&&(o=l),c<r&&(r=c),c>i&&(i=c));}return isFinite(n)?{x:n,y:r,width:o-n,height:i-r}:{x:0,y:0,width:0,height:0}}function NWe(t,e,n){let r=`reflow-${n}-${e}`,o=t.text||void 0;if(t.kind==="rect")return {id:r,shapeType:t.rx>0?"roundRect":"rect",x:t.x,y:t.y,width:t.width,height:t.height,rotation:0,fillColor:t.fill,strokeColor:t.stroke,strokeWidth:t.strokeWidth,text:o,fontSize:t.fontSize};if(t.kind==="circle")return {id:r,shapeType:"ellipse",x:t.cx-t.r,y:t.cy-t.r,width:t.r*2,height:t.r*2,rotation:0,fillColor:t.fill,strokeColor:t.stroke,strokeWidth:t.strokeWidth,text:o,fontSize:t.fontSize};let i=IWe(t.points);return {id:r,shapeType:"chevron",x:i.x,y:i.y,width:i.width,height:i.height,rotation:0,fillColor:t.fill,strokeColor:t.stroke,strokeWidth:t.strokeWidth,text:o,fontSize:t.fontSize}}function LWe(t,e){let n=vne([...e]),r=t.family,o=[];for(let i=0;i<t.nodes.length;i++){let s=t.nodes[i],l=n[i]?.id??s.key;o.push(NWe(s,l,r));}return o}function MT(t,e,n,r,o,i){let s=t.drawingShapes;if(s!==void 0&&s.length>0||t.nodes.length===0)return t;let a=_U(t.nodes,i,n,r,o,t.resolvedLayoutType,e);return {...t,drawingShapes:LWe(a,t.nodes)}}function nre(t){let{autosaveState:e,isDirty:n,autosaveEnabled:r,disabledReason:o}=t;return e==="disabled"?o==="no_file_path"?"pptx.autosave.disabledNoFilePath":o==="autosave_toggle_off"?"pptx.autosave.disabledToggleOff":"pptx.autosave.disabled":r&&e==="saving"?"pptx.autosave.saving":r&&e==="error"?"pptx.autosave.error":n?"pptx.statusBar.unsavedChanges":"pptx.titleBar.savedToThisPc"}function ore(){return new Promise((t,e)=>{let n=indexedDB.open(DWe,FWe);n.onupgradeneeded=()=>{let r=n.result;r.objectStoreNames.contains(by)||r.createObjectStore(by,{keyPath:"key"});},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error);})}async function OWe(){let t=await ore();return new Promise(e=>{try{let n=t.transaction(by,"readwrite"),r=n.objectStore(by),o=null,i=1/0,s=r.openCursor();s.onsuccess=()=>{let a=s.result;if(a){let l=a.value;typeof l.timestamp=="number"&&l.timestamp<i&&(i=l.timestamp,o=a.primaryKey),a.continue();}else o!==null&&r.delete(o);},n.oncomplete=()=>{t.close(),e(o!==null);},n.onerror=()=>{t.close(),e(!1);};}catch{try{t.close();}catch{}e(false);}})}function oee(t,e){return ore().then(n=>new Promise((r,o)=>{let i=n.transaction(by,"readwrite");i.objectStore(by).put({key:t,data:e,timestamp:Date.now(),size:e.byteLength}),i.oncomplete=()=>{n.close(),r(true);},i.onerror=()=>{n.close(),o(i.error);};}))}async function ire(t,e){try{return await oee(t,e)}catch(n){if((n instanceof Error||n instanceof DOMException?n.name:"")!=="QuotaExceededError"||!await OWe())throw n;return oee(t,e)}}function are(t){if(typeof t!="string"||t.trim().length===0)return iee;let e=t.replace(/[\x00-\x1f\x7f"\\/:*?<>|]/gu,"_").replace(/\.\./gu,"__").replace(/^\.+/u,"").trim();if(e.length===0)return iee;if(e.length>200){let n=e.lastIndexOf(".");if(n>0&&e.length-n<=16){let r=e.slice(n);e=e.slice(0,200-r.length)+r;}else e=e.slice(0,200);}return e}function ru(t,e){let n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e,document.body.appendChild(r),r.click(),setTimeout(()=>{r.remove(),URL.revokeObjectURL(n);},sre);}function sR(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),setTimeout(()=>{n.remove();},sre);}function aR(t,e=.92){let r=t.toDataURL("image/jpeg",e).split(",")[1]??"",o=atob(r),i=new Uint8Array(o.length);for(let s=0;s<o.length;s++)i[s]=o.charCodeAt(s);return {bytes:i,w:t.width,h:t.height}}function t$(t,e={}){if(t.length===0)throw new Error("[gif-encoder] encodeGif: frames array must not be empty");let n=typeof e=="number"?{delayCs:e}:e,{delayCs:r=200,loopCount:o=0}=n,i=t[0].width,s=t[0].height,a=[];see(a,"GIF89a"),Jp(a,i),Jp(a,s),a.push(112),a.push(0),a.push(0),a.push(33,255,11),see(a,"NETSCAPE2.0"),a.push(3,1),Jp(a,o),a.push(0);for(let l of t){let{palette:c,indexed:d}=BWe(l.imageData);a.push(33,249,4),a.push(0),Jp(a,r),a.push(0),a.push(0),a.push(44),Jp(a,0),Jp(a,0),Jp(a,i),Jp(a,s),a.push(135);for(let f=0;f<256;f++)a.push(c[f*3]??0),a.push(c[f*3+1]??0),a.push(c[f*3+2]??0);let u=8;a.push(u);let p=$We(d,u),h=0;for(;h<p.length;){let f=Math.min(255,p.length-h);a.push(f);for(let m=0;m<f;m++)a.push(p[h+m]);h+=f;}a.push(0);}return a.push(59),new Uint8Array(a)}function Jp(t,e){t.push(e&255),t.push(e>>8&255);}function see(t,e){for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));}function BWe(t){let e=t.data,n=t.width*t.height,r=Math.max(1,Math.floor(n/1e4)),o=[];for(let c=0;c<n;c+=r){let d=c*4;o.push([e[d],e[d+1],e[d+2]]);}let i=n4(o,8),s=new Uint8Array(768),a=[];for(let c=0;c<256;c++)if(c<i.length&&i[c].length>0){let d=0,u=0,p=0;for(let[g,y,b]of i[c])d+=g,u+=y,p+=b;let h=i[c].length,f=Math.round(d/h),m=Math.round(u/h),x=Math.round(p/h);s[c*3]=f,s[c*3+1]=m,s[c*3+2]=x,a.push([f,m,x]);}else a.push([0,0,0]);let l=new Uint8Array(n);for(let c=0;c<n;c++){let d=c*4;l[c]=UWe(a,e[d],e[d+1],e[d+2]);}return {palette:s,indexed:l}}function n4(t,e){if(e===0||t.length<=1)return [t];let n=255,r=0,o=255,i=0,s=255,a=0;for(let[h,f,m]of t)h<n&&(n=h),h>r&&(r=h),f<o&&(o=f),f>i&&(i=f),m<s&&(s=m),m>a&&(a=m);let l=r-n,c=i-o,d=a-s,u=0;c>=l&&c>=d?u=1:d>=l&&d>=c&&(u=2),t.sort((h,f)=>h[u]-f[u]);let p=Math.floor(t.length/2);return [...n4(t.slice(0,p),e-1),...n4(t.slice(p),e-1)]}function UWe(t,e,n,r){let o=0,i=1/0;for(let s=0;s<t.length;s++){let[a,l,c]=t[s],d=(e-a)**2+(n-l)**2+(r-c)**2;d<i&&(i=d,o=s);}return o}function $We(t,e){let n=1<<e,r=n+1,o=[],i=e+1,s=r+1,a=4096,l=new Map,c=()=>{l.clear();for(let m=0;m<n;m++)l.set(String(m),m);i=e+1,s=r+1;},d=0,u=0,p=(m,x)=>{for(d|=m<<u,u+=x;u>=8;)o.push(d&255),d>>=8,u-=8;};c(),p(n,i);let h=String(t[0]);for(let m=1;m<t.length;m++){let x=`${h},${String(t[m])}`;if(l.has(x))h=x;else {let g=l.get(h);g!==void 0&&p(g,i),s<a?(l.set(x,s++),s>1<<i&&i<12&&i++):(p(n,i),c()),h=String(t[m]);}}let f=l.get(h);return f!==void 0&&p(f,i),p(r,i),u>0&&o.push(d&255),new Uint8Array(o)}function lre(t){return zWe[t]??{rows:3,columns:2}}function cre(t,e){return t<=0?0:Math.ceil(t/e)}function dre(t,e,n,r,o=Fl){let i=lre(e),s=o.width-o.marginLeft-o.marginRight,a=o.height-o.marginTop-o.marginBottom,l=e===3,c=[];if(l){let d=s*HWe,u=(a-py*(i.rows-1))/i.rows;for(let p=0;p<i.rows;p++){let h=r+p;c.push({slideIndex:h<n?h:-1,row:p,col:0,x:0,y:p*(u+py),width:d,height:u});}}else {let d=(s-py*(i.columns-1))/i.columns,u=(a-py*(i.rows-1))/i.rows,p=0;for(let h=0;h<i.rows;h++)for(let f=0;f<i.columns;f++){let m=r+p;c.push({slideIndex:m<n?m:-1,row:h,col:f,x:f*(d+py),y:h*(u+py),width:d,height:u}),p++;}}return {pageIndex:t,cells:c,hasNoteLines:l}}function lR(t,e,n="portrait"){let r=t.length;if(r===0)return [];let o=n==="landscape"?n$:Fl,i=cre(r,e),s=[];for(let a=0;a<i;a++){let l=a*e,c=dre(a,e,r,l,o),d=c.cells.map(u=>({...u,slideIndex:u.slideIndex>=0&&u.slideIndex<r?t[u.slideIndex]:-1}));s.push({...c,cells:d});}return s}function cR(t="portrait"){let e=t==="landscape"?n$:Fl;return {width:e.width-e.marginLeft-e.marginRight,height:e.height-e.marginTop-e.marginBottom}}function dR(){return 8}function ure(t,e,n=Fl){let r=n.width-n.marginLeft-n.marginRight,o=n.height-n.marginTop-n.marginBottom,i=o*VWe,s=r,a=s/aee;a>i&&(a=i,s=a*aee);let l=(r-s)/2,c=(i-a)/2,d=i+GWe,u=o-d;return {pageIndex:t,slideIndex:e,slideArea:{x:l,y:c,width:s,height:a},textArea:{x:0,y:d,width:r,height:Math.max(0,u)}}}function uR(t){return t.map((e,n)=>ure(n,e))}function pR(){return {width:Fl.width-Fl.marginLeft-Fl.marginRight,height:Fl.height-Fl.marginTop-Fl.marginBottom}}function fR(t,e){let n=Em-2*Ni,r=Lc-2*Ni,o=r*r$,i=r-o-Im,s=Math.min(n/t,o/e),a=t*s,l=e*s,c=Ni+(n-a)/2,u=Lc-Ni-l,p=u-Im,h=Wy*hR,f=Math.floor(i/h);return {contentWidth:n,contentHeight:r,slideAreaHeight:o,notesAreaHeight:i,imageWidth:a,imageHeight:l,imageX:c,imageY:u,notesTextY:p,maxNotesLines:f}}function mR(t,e,n){if(!t||t.trim().length===0)return [];let r=n*.5,o=Math.floor(e/r);if(o<=0)return [];let i=[],s=t.split(/\r?\n/u);for(let a of s){if(a.trim().length===0){i.push("");continue}let l=a.split(/\s+/u),c="";for(let d of l)c.length===0?c=d:c.length+1+d.length<=o?c+=` ${d}`:(i.push(c),c=d);c.length>0&&i.push(c);}return i}function gR(){let t=Lc-2*Ni,e=Yw+Im,n=t-e,r=Wy*hR;return Math.floor(n/r)}function vy(t){return t.replace(/\\/gu,"\\\\").replace(/\(/gu,"\\(").replace(/\)/gu,"\\)")}function uA(t,e){if(t.length===0)return "";let n=`BT /F1 ${Wy} Tf 0 0 0 rg `;n+=`${Ni} ${e.toFixed(2)} Td `;for(let r=0;r<t.length;r++){let o=t[r];r===0?n+=`(${vy(o)}) Tj `:n+=`0 ${(-15.399999999999999).toFixed(2)} Td (${vy(o)}) Tj `;}return n+=`ET
4467
4467
  `,n}function i$(t){return t.replace(/[&<>"']/gu,e=>WWe[e]||e)}function xR(t,e,n,r={}){let{title:o="Print",orientation:i="landscape",colorFilter:s=""}=r,a=t.map((l,c)=>`<section class="print-slide-page" aria-label="Slide ${c+1}">
4468
4468
  ${l}
4469
4469
  </section>`).join(`
@@ -4804,7 +4804,7 @@ ${e}`),Qle=(t,e,n)=>{let r=Jn(e),o=sn(),i=vt(r),s=t.messageHandlers[i];return s?
4804
4804
  .notes-text .bullet { margin-right: 6px; }
4805
4805
  .notes-text .para { margin: 2px 0; }
4806
4806
  @media print { body { padding: 0; } }
4807
- </style></head><body>`);for(let a of t){let l=Wce(a),c=Bg(l);s.write('<div class="slide-page">'),s.write(`<div class="slide-header">${kh(n("pptx.notes.slideN",{n:a.slideNumber}))}</div>`),s.write(`<div class="slide-thumb">${kh(n("pptx.notes.slideN",{n:a.slideNumber}))}</div>`),s.write('<div class="notes-text">');let d=0;for(let u of c){u.bulletType==="numbered"?d++:d=0;let p=u.indentLevel*24,h="";u.bulletType==="bullet"?h="\u2022 ":u.bulletType==="numbered"&&(h=`${d}. `);let f=u.segments.filter(m=>!m.isParagraphBreak).map(m=>kh(m.text)).join("");s.write(`<div class="para" style="padding-left:${p}px">${kh(h)}${f}</div>`);}s.write("</div></div>");}s.write("</body></html>"),s.close(),setTimeout(()=>{i.contentWindow?.print();},200);},[t,n]);return jsxRuntime.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:jsxRuntime.jsxs("div",{className:"bg-background border border-border rounded-lg shadow-xl w-[640px] max-h-[80vh] flex flex-col max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-foreground",children:n("pptx.notes.printNotes")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"text-muted-foreground hover:text-foreground text-sm",children:n("common.close")})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:t.map(i=>{let s=Wce(i),a=JC(s).trim().length>0;return jsxRuntime.jsxs("div",{className:"border border-border/50 rounded p-3",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:n("pptx.notes.slideN",{n:i.slideNumber})}),jsxRuntime.jsx("div",{className:"w-full aspect-video bg-muted rounded mb-2 flex items-center justify-center text-muted-foreground text-sm",children:n("pptx.notes.slideN",{n:i.slideNumber})}),jsxRuntime.jsx("div",{className:"text-xs text-foreground whitespace-pre-wrap",children:a?FI(s):jsxRuntime.jsx("span",{className:"italic text-muted-foreground",children:n("pptx.notes.noNotes")})})]},i.id)})}),jsxRuntime.jsx("div",{className:"flex justify-end px-4 py-3 border-t border-border",children:jsxRuntime.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-xs bg-primary hover:bg-primary/80 text-white rounded",children:n("pptx.notes.print")})}),jsxRuntime.jsx("iframe",{ref:r,title:"print-notes",className:"hidden",sandbox:"allow-same-origin"})]})})}function Wce(t){return t.notesSegments&&t.notesSegments.length>0?t.notesSegments:Gb(t.notes??"")}function Yce({initialText:t,onInsert:e,onClose:n}){let{t:r}=reactI18next.useTranslation(),[o,i]=Jm.useState(""),[s,a]=Jm.useState(t),l=Jm.useRef(null);Jm.useEffect(()=>{l.current?.focus();},[]);let c=Jm.useCallback(d=>{if(d.preventDefault(),o.trim().length===0)return;let u=o.startsWith("http")?o:`https://${o}`;e(u,s||u);},[o,s,e]);return jsxRuntime.jsx("div",{className:"absolute bottom-full left-0 mb-1 z-10 bg-muted border border-border rounded-lg shadow-lg p-3 w-72",children:jsxRuntime.jsxs("form",{onSubmit:c,className:"space-y-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-[10px] text-muted-foreground mb-0.5",children:r("pptx.notes.linkUrl")}),jsxRuntime.jsx("input",{ref:l,type:"text",value:o,onChange:d=>i(d.target.value),placeholder:"https://...",className:"w-full px-2 py-1 text-xs bg-background border border-border rounded text-foreground focus:outline-none focus:border-primary"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-[10px] text-muted-foreground mb-0.5",children:r("pptx.notes.linkDisplayText")}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:d=>a(d.target.value),placeholder:r("pptx.notes.linkDisplayText"),className:"w-full px-2 py-1 text-xs bg-background border border-border rounded text-foreground focus:outline-none focus:border-primary"})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:n,className:"px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground",children:r("common.cancel")}),jsxRuntime.jsx("button",{type:"submit",className:"px-2 py-1 text-[10px] bg-primary hover:bg-primary/80 text-white rounded",children:r("pptx.notes.insertLink")})]})]})})}function qce({isRichEditEnabled:t,showLinkPopover:e,savedSelectionText:n,hasAllSlides:r,onApplyRichCommand:o,onToggleBulletList:i,onToggleNumberedList:s,onIndent:a,onOutdent:l,onLinkButtonClick:c,onInsertLink:d,onCloseLinkPopover:u,onPrintClick:p,onToggleRichEdit:h}){let{t:f}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"inline-flex items-center rounded bg-muted text-xs overflow-hidden border border-border/60 relative",children:[jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent",title:f("pptx.notes.bold"),onClick:()=>o("bold"),children:jsxRuntime.jsx(lu$1.LuBold,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.italic"),onClick:()=>o("italic"),children:jsxRuntime.jsx(lu$1.LuItalic,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.underline"),onClick:()=>o("underline"),children:jsxRuntime.jsx(lu$1.LuUnderline,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.strikethrough"),onClick:()=>o("strikeThrough"),children:jsxRuntime.jsx(lu$1.LuStrikethrough,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("div",{className:"w-px h-4 bg-border mx-0.5"}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent",title:f("pptx.notes.bulletList"),onClick:i,children:jsxRuntime.jsx(lu$1.LuList,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.numberedList"),onClick:s,children:jsxRuntime.jsx(lu$1.LuListOrdered,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("div",{className:"w-px h-4 bg-border mx-0.5"}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent",title:f("pptx.notes.indent"),onClick:a,children:jsxRuntime.jsx(lu$1.LuIndentIncrease,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.outdent"),onClick:l,children:jsxRuntime.jsx(lu$1.LuIndentDecrease,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("div",{className:"w-px h-4 bg-border mx-0.5"}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent",title:f("pptx.notes.insertLink"),onClick:c,children:jsxRuntime.jsx(lu$1.LuLink,{className:"w-3.5 h-3.5"})}),r&&jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.printNotes"),onClick:p,children:jsxRuntime.jsx(lu$1.LuPrinter,{className:"w-3.5 h-3.5"})}),e&&jsxRuntime.jsx(Yce,{initialText:n,onInsert:d,onClose:u})]}),jsxRuntime.jsx("button",{type:"button",className:"text-[10px] px-2 py-1 rounded bg-muted hover:bg-accent border border-border/60",onClick:h,title:f("pptx.notes.toggleRichPlainEditor"),children:f(t?"pptx.notes.plainEditor":"pptx.notes.richEditor")})]})}function Zce({activeSlide:t,isExpanded:e,canEdit:n,onToggle:r,onUpdateNotes:o}){let i=Jm.useMemo(()=>t?.notesSegments&&t.notesSegments.length>0?Wb(t.notesSegments):Gb(t?.notes??""),[t?.notes,t?.notesSegments]),[s,a]=Jm.useState(t?.notes??""),[l,c]=Jm.useState(i),[d,u]=Jm.useState(i.length>0),[p,h]=Jm.useState(false),[f,m]=Jm.useState(false),x=Jm.useRef(null),g=Jm.useRef(null),y=Jm.useRef(null),b=Jm.useRef(null),v=Jm.useRef(false),S=Jm.useRef(null);Jm.useEffect(()=>{let Y=t?.notes??"";if(Y===S.current)return;let ge=t?.notesSegments&&t.notesSegments.length>0?Wb(t.notesSegments):Gb(Y);a(Y),c(ge),u(ge.length>0);},[t?.id,t?.notes,t?.notesSegments]),Jm.useEffect(()=>{if(!(!d||!e||!n||!y.current)){if(v.current){v.current=false;return}y.current.innerHTML=Gce(l);}},[n,l,e,d]);let w=Jm.useCallback((Y,ge)=>{x.current&&(clearTimeout(x.current),x.current=null),S.current=Y,o(Y,ge);},[o]),C=Jm.useCallback((Y,ge)=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{S.current=Y,o(Y,ge),x.current=null;},600);},[o]);Jm.useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]);let T=Jm.useCallback(Y=>{let ge=Y.target.value,fe=Gb(ge);a(ge),c(fe),C(ge,fe);},[C]),M=Jm.useCallback(Y=>{Y.stopPropagation(),Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)&&(w(s,l),r());},[s,l,w,r]),_=Jm.useCallback(()=>{if(!y.current)return;v.current=true;let Y=Vce(y.current),ge=JC(Y);a(ge),c(Y),C(ge,Y);},[C]),E=Jm.useCallback(()=>{w(s,l);},[s,l,w]),R=Jm.useCallback(Y=>{if(!y.current)return;let ge=Hce(y.current,l),fe=Bg(l);ge>=0&&ge<fe.length&&(fe[ge]=Y(fe[ge],ge));let de=$ce(fe),J=JC(de);a(J),c(de),C(J,de);},[l,C]),I=Jm.useCallback(Y=>{document.execCommand(Y),_(),y.current?.focus();},[_]),L=Jm.useCallback(()=>{R(Y=>({...Y,bulletType:Y.bulletType==="bullet"?"none":"bullet"})),y.current?.focus();},[R]),k=Jm.useCallback(()=>{R(Y=>({...Y,bulletType:Y.bulletType==="numbered"?"none":"numbered"})),y.current?.focus();},[R]),F=Jm.useCallback(()=>{R(Y=>({...Y,indentLevel:Math.min(4,Y.indentLevel+1)})),y.current?.focus();},[R]),N=Jm.useCallback(()=>{R(Y=>({...Y,indentLevel:Math.max(0,Y.indentLevel-1)})),y.current?.focus();},[R]),D=Jm.useCallback(Y=>{if(Y.stopPropagation(),Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)){w(s,l),r();return}Y.key==="Tab"&&(Y.preventDefault(),Y.shiftKey?N():F());},[s,l,w,r,F,N]),U=Jm.useCallback(()=>{let Y=window.getSelection();b.current={text:Y?.toString()??""},h(true);},[]),G=Jm.useCallback((Y,ge)=>{if(h(false),!y.current)return;y.current.focus();let fe=window.getSelection();if(fe&&fe.rangeCount>0){let de=fe.getRangeAt(0);de.deleteContents();let J=document.createElement("a");J.href=Y,J.textContent=ge,J.style.color="#4a9eff",J.style.textDecoration="underline",J.style.cursor="pointer",J.setAttribute("data-hyperlink",Y),de.insertNode(J),de.setStartAfter(J),de.collapse(true),fe.removeAllRanges(),fe.addRange(de);}_();},[_]),j=Jm.useCallback(Y=>{let ge=Y.target;if(!(ge instanceof HTMLAnchorElement))return;let fe=ge.getAttribute("data-hyperlink")||ge.getAttribute("href");fe&&(Y.ctrlKey||Y.metaKey)&&(Y.preventDefault(),rh(fe));},[]);return {draft:s,draftSegments:l,isRichEditEnabled:d,setIsRichEditEnabled:u,showLinkPopover:p,setShowLinkPopover:h,showPrintDialog:f,setShowPrintDialog:m,textareaRef:g,richEditorRef:y,savedSelectionRef:b,handlePlainChange:T,handleRichInput:_,handleBlur:E,handleKeyDownPlain:M,handleKeyDownRich:D,applyRichCommand:I,toggleBulletList:L,toggleNumberedList:k,handleIndent:F,handleOutdent:N,handleLinkButtonClick:U,handleInsertLink:G,handleEditorClick:j}}var qH=({activeSlide:t,allSlides:e,isExpanded:n,canEdit:r,onToggle:o,onUpdateNotes:i,panelHeight:s})=>{let{t:a}=reactI18next.useTranslation(),{draft:l,draftSegments:c,isRichEditEnabled:d,setIsRichEditEnabled:u,showLinkPopover:p,setShowLinkPopover:h,showPrintDialog:f,setShowPrintDialog:m,textareaRef:x,richEditorRef:g,savedSelectionRef:y,handlePlainChange:b,handleRichInput:v,handleBlur:S,handleKeyDownPlain:w,handleKeyDownRich:C,applyRichCommand:T,toggleBulletList:M,toggleNumberedList:_,handleIndent:E,handleOutdent:R,handleLinkButtonClick:I,handleInsertLink:L,handleEditorClick:k}=Zce({activeSlide:t,isExpanded:n,canEdit:r,onToggle:o,onUpdateNotes:i}),F=l.trim().length>0,N=t?a("pptx.notes.slideN",{n:t.slideNumber}):a("pptx.notes.noSlide"),{dragY:D,handlers:U}=Lu(o);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx("button",{type:"button","aria-label":a("common.close"),onClick:o,className:"md:hidden fixed inset-0 z-20 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150"}),jsxRuntime.jsxs("div",{className:ie("flex flex-col border-t border-border/60 bg-background select-none",!n&&"max-md:hidden","max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:z-30 max-md:max-h-[75dvh] max-md:rounded-t-2xl max-md:border max-md:border-border max-md:shadow-2xl max-md:pb-[max(env(safe-area-inset-bottom),0px)]"),style:D>0?{transform:`translateY(${D}px)`,transition:"none"}:void 0,children:[n&&jsxRuntime.jsx("div",{className:"md:hidden flex items-center justify-center pt-3 pb-2 cursor-grab active:cursor-grabbing touch-none",onPointerDown:U.onPointerDown,onPointerMove:U.onPointerMove,onPointerUp:U.onPointerUp,onPointerCancel:U.onPointerCancel,children:jsxRuntime.jsx("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/40"})}),jsxRuntime.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 px-3 py-1 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent/30 transition-colors w-full text-left shrink-0 max-md:hidden","aria-expanded":n,"aria-controls":"slide-notes-content",children:["Notes",!n&&F&&jsxRuntime.jsx("span",{className:"text-muted-foreground/50 text-[10px]",children:"(has notes)"})]}),n&&jsxRuntime.jsxs("div",{id:"slide-notes-content",className:"px-3 pb-2 overflow-y-auto",style:{maxHeight:s??240},children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:N}),r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qce,{isRichEditEnabled:d,showLinkPopover:p,savedSelectionText:y.current?.text??"",hasAllSlides:e!==void 0&&e.length>0,onApplyRichCommand:T,onToggleBulletList:M,onToggleNumberedList:_,onIndent:E,onOutdent:R,onLinkButtonClick:I,onInsertLink:L,onCloseLinkPopover:()=>h(false),onPrintClick:()=>m(true),onToggleRichEdit:()=>u(G=>!G)}),d?jsxRuntime.jsx("div",{ref:g,contentEditable:true,suppressContentEditableWarning:true,onInput:v,onBlur:S,onKeyDown:C,onClick:k,className:"w-full overflow-y-auto rounded-md border border-border/50 bg-muted/60 px-2.5 py-1.5 text-xs text-foreground focus:border-primary/50 focus:outline-none focus:ring-1 focus:ring-primary/30 transition-colors whitespace-pre-wrap",style:{maxHeight:192,minHeight:72}}):jsxRuntime.jsx("textarea",{ref:x,name:"slide-notes",value:l,onChange:b,onBlur:S,onKeyDown:w,placeholder:a("pptx.notes.clickToAddNotes"),rows:4,className:"w-full resize-none rounded-md border border-border/50 bg-muted/60 px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:border-primary/50 focus:outline-none focus:ring-1 focus:ring-primary/30 transition-colors",style:{maxHeight:192}})]}):jsxRuntime.jsx("div",{className:"w-full rounded-md border border-border/30 bg-muted/40 px-2.5 py-1.5 text-xs text-muted-foreground overflow-y-auto whitespace-pre-wrap",style:{maxHeight:168,minHeight:60},children:F?FI(c):jsxRuntime.jsx("span",{className:"italic text-muted-foreground",children:a("pptx.notes.noNotes")})})]}),f&&e&&jsxRuntime.jsx(Xce,{slides:e,onClose:()=>m(false)})]})]})};Pe();var nQe="pptx-viewer-autosave",rQe=1,jb="recoveryVersions";function Qce(){return new Promise((t,e)=>{let n=indexedDB.open(nQe,rQe);n.onupgradeneeded=()=>{let r=n.result;r.objectStoreNames.contains(jb)||r.createObjectStore(jb,{keyPath:"key"});},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error);})}async function oQe(t){try{let e=await Qce();return new Promise(n=>{let i=e.transaction(jb,"readonly").objectStore(jb).get(t);i.onsuccess=()=>{e.close();let s=i.result;n(s?[s]:[]);},i.onerror=()=>{e.close(),n([]);};})}catch{return []}}async function iQe(t){try{let e=await Qce();return new Promise(n=>{let r=e.transaction(jb,"readwrite");r.objectStore(jb).delete(t),r.oncomplete=()=>{e.close(),n();},r.onerror=()=>{e.close(),n();};})}catch{}}function sQe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function JH({isOpen:t,filePath:e,onClose:n,onRestore:r}){let{t:o}=reactI18next.useTranslation(),[i,s]=Jm.useState([]),[a,l]=Jm.useState(false),[c,d]=Jm.useState(null),[u,p]=Jm.useState(null),h=Jm.useCallback(async()=>{if(e){l(true);try{let x=await oQe(e);s(x);}catch{s([]);}finally{l(false);}}},[e]);Jm.useEffect(()=>{t&&h();},[t,h]);let f=Jm.useCallback(async x=>{d(x.key);try{x.data&&(r(x.data),n());}finally{d(null);}},[r,n]),m=Jm.useCallback(async x=>{p(x.key);try{await iQe(x.key),await h();}finally{p(null);}},[h]);return t?jsxRuntime.jsxs("div",{className:"absolute inset-y-0 right-0 w-80 bg-background border-l border-border z-50 flex flex-col shadow-xl",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[jsxRuntime.jsx(lu$1.LuClock,{className:"w-4 h-4"}),o("pptx.versionHistory.title")]}),jsxRuntime.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a&&jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-xs text-muted-foreground",children:o("common.loading")}),!a&&i.length===0&&jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-xs text-muted-foreground",children:o("pptx.versionHistory.noVersions")}),!a&&i.map(x=>jsxRuntime.jsxs("div",{className:"px-3 py-2.5 border-b border-border hover:bg-muted/50 group",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"text-xs text-foreground",children:One(x.timestamp)}),jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground",children:Bne(x.timestamp)})]}),jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground mt-0.5",children:sQe(x.size)}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-1.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[jsxRuntime.jsxs("button",{onClick:()=>{f(x);},disabled:c===x.key,className:"inline-flex items-center gap-1 px-2 py-1 rounded text-[10px] bg-primary/20 text-primary hover:bg-primary/30 disabled:opacity-40",children:[jsxRuntime.jsx(lu$1.LuDownload,{className:"w-3 h-3"}),c===x.key?o("common.loading"):o("pptx.versionHistory.restore")]}),jsxRuntime.jsxs("button",{onClick:()=>{m(x);},disabled:u===x.key,className:"inline-flex items-center gap-1 px-2 py-1 rounded text-[10px] bg-red-600/20 text-red-400 hover:bg-red-600/30 disabled:opacity-40",children:[jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"}),o("common.delete")]})]})]},x.key))]})]}):null}function gQe({kind:t}){switch(t){case "added":return jsxRuntime.jsx(lu$1.LuPlus,{className:"w-3 h-3 text-green-400"});case "removed":return jsxRuntime.jsx(lu$1.LuMinus,{className:"w-3 h-3 text-red-400"});case "moved":return jsxRuntime.jsx(lu$1.LuMove,{className:"w-3 h-3 text-primary"});case "resized":return jsxRuntime.jsx(lu$1.LuMove,{className:"w-3 h-3 text-amber-400"});case "textChanged":return jsxRuntime.jsx(lu$1.LuType,{className:"w-3 h-3 text-purple-400"})}}function tde({diff:t,diffIndex:e,canvasSize:n,accepted:r,rejected:o,onAccept:i,onReject:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState(t.status==="changed"),d=(()=>{switch(t.status){case "added":return a("pptx.compare.statusAdded");case "removed":return a("pptx.compare.statusRemoved");case "changed":return a("pptx.compare.statusChanged");case "unchanged":return a("pptx.compare.statusUnchanged")}})(),u=(()=>{switch(t.status){case "added":return "text-green-400 bg-green-900/30";case "removed":return "text-red-400 bg-red-900/30";case "changed":return "text-amber-400 bg-amber-900/30";case "unchanged":return "text-muted-foreground bg-muted/30"}})();if(t.status==="unchanged")return null;let p=r||o,h=t.baseIndex>=0?t.baseIndex+1:t.compareIndex+1;return jsxRuntime.jsxs("div",{className:ie("rounded-lg border transition-colors",p?"border-border/60 bg-card/40 opacity-60":"border-border bg-background/70"),children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-2 text-left",onClick:()=>c(f=>!f),children:[l?jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}):jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:a("pptx.compare.slideNumber",{number:h})}),jsxRuntime.jsx("span",{className:ie("rounded-full px-2 py-0.5 text-[10px] font-medium",u),children:d}),t.changes.length>0&&jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[t.changes.length," ",t.changes.length===1?"change":"changes"]}),jsxRuntime.jsx("span",{className:"flex-1"}),p&&jsxRuntime.jsx("span",{className:ie("text-[10px] font-medium",r?"text-green-400":"text-muted-foreground"),children:a(r?"pptx.compare.accepted":"pptx.compare.rejected")})]}),l&&jsxRuntime.jsxs("div",{className:"px-3 pb-3 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex gap-2",children:[t.baseSlide&&jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:a("pptx.compare.current")}),jsxRuntime.jsx("div",{className:"rounded border border-border overflow-hidden",children:jsxRuntime.jsx(oa,{slide:t.baseSlide,templateElements:[],canvasSize:n})})]}),t.compareSlide&&jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:a("pptx.compare.incoming")}),jsxRuntime.jsx("div",{className:ie("rounded border overflow-hidden",t.status==="added"?"border-green-700/60":t.status==="changed"?"border-amber-700/60":"border-border"),children:jsxRuntime.jsx(oa,{slide:t.compareSlide,templateElements:[],canvasSize:n})})]})]}),t.changes.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:t.changes.map((f,m)=>jsxRuntime.jsxs("div",{className:"flex items-start gap-2 rounded bg-muted/60 px-2 py-1.5 text-[11px]",children:[jsxRuntime.jsx(gQe,{kind:f.kind}),jsxRuntime.jsx("span",{className:"text-foreground",children:f.description})]},`${f.elementId}-${f.kind}-${m}`))}),!p&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-green-700/80 px-2.5 py-1 text-[11px] text-green-50 hover:bg-green-600 transition-colors",onClick:()=>i(e),children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3 h-3"}),a("pptx.compare.accept")]}),jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-accent px-2.5 py-1 text-[11px] text-foreground hover:bg-accent/80 transition-colors",onClick:()=>s(e),children:[jsxRuntime.jsx(lu$1.LuX,{className:"w-3 h-3"}),a("pptx.compare.reject")]})]})]})]})}function ez({isOpen:t,compareResult:e,canvasSize:n,onClose:r,onAcceptSlide:o,onRejectSlide:i,onAcceptAll:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState({}),[d,u]=Jm.useState({}),p=Jm.useCallback(x=>{c(g=>({...g,[x]:true})),u(g=>{let y={...g};return delete y[x],y}),o(x);},[o]),h=Jm.useCallback(x=>{u(g=>({...g,[x]:true})),c(g=>{let y={...g};return delete y[x],y}),i(x);},[i]),f=Jm.useCallback(()=>{if(!e)return;let x={};e.diffs.forEach((g,y)=>{g.status!=="unchanged"&&(x[y]=true);}),c(x),u({}),s();},[e,s]);if(!t||!e)return null;let m=e.diffs.filter(x=>x.status!=="unchanged");return jsxRuntime.jsxs("div",{className:"fixed inset-y-0 right-0 z-50 flex flex-col w-[440px] max-w-full border-l border-border bg-popover backdrop-blur-lg shadow-2xl",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-medium text-foreground",children:a("pptx.compare.title")}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:a("pptx.compare.summary",{added:e.addedCount,removed:e.removedCount,changed:e.changedCount})})]}),jsxRuntime.jsx("button",{type:"button",className:"rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",onClick:r,title:a("pptx.compare.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),m.length>0&&jsxRuntime.jsx("div",{className:"px-4 py-2 border-b border-border/60",children:jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded bg-green-700/80 px-3 py-1.5 text-xs text-green-50 hover:bg-green-600 transition-colors",onClick:f,children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3.5 h-3.5"}),a("pptx.compare.acceptAll")]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-2",children:m.length===0?jsxRuntime.jsx("div",{className:"text-center py-8 text-xs text-muted-foreground",children:a("pptx.compare.noDifferences")}):e.diffs.map((x,g)=>jsxRuntime.jsx(tde,{diff:x,diffIndex:g,canvasSize:n,accepted:!!l[g],rejected:!!d[g],onAccept:p,onReject:h},`diff-${g}-${x.status}`))})]})}function _Qe(t){if(!t)return 0;let e=0;return t.length>=8&&e++,t.length>=12&&e++,/[A-Z]/u.test(t)&&/[a-z]/u.test(t)&&e++,/\d/u.test(t)&&e++,/[^A-Za-z0-9]/u.test(t)&&e++,Math.min(e,4)}var PQe=["bg-red-500","bg-orange-500","bg-yellow-500","bg-lime-500","bg-green-500"];function nz({isOpen:t,isCurrentlyProtected:e,onClose:n,onSetPassword:r,onRemovePassword:o}){let{t:i}=reactI18next.useTranslation(),[s,a]=Jm.useState(""),[l,c]=Jm.useState(""),[d,u]=Jm.useState(false),[p,h]=Jm.useState(""),f=Jm.useMemo(()=>_Qe(s),[s]),m=Jm.useMemo(()=>{let b=[i("pptx.security.strengthVeryWeak"),i("pptx.security.strengthWeak"),i("pptx.security.strengthFair"),i("pptx.security.strengthStrong"),i("pptx.security.strengthVeryStrong")];return s?b[f]:""},[f,s,i]),x=Jm.useCallback(()=>{if(h(""),!s){h(i("pptx.security.errorPasswordRequired"));return}if(s!==l){h(i("pptx.security.errorPasswordMismatch"));return}if(s.length<4){h(i("pptx.security.errorPasswordTooShort"));return}r(s),a(""),c(""),n();},[s,l,r,n,i]),g=Jm.useCallback(()=>{o(),a(""),c(""),n();},[o,n]),y=Jm.useCallback(()=>{a(""),c(""),h(""),n();},[n]);return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":i("common.close"),onClick:y}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[420px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuLock,{className:"w-5 h-5 text-primary"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:i("pptx.security.protectPresentation")})]}),jsxRuntime.jsx("button",{type:"button",onClick:y,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":i("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-green-900/30 border border-green-700/40 px-3 py-2",children:[jsxRuntime.jsx(lu$1.LuShieldCheck,{className:"w-4 h-4 text-green-400 shrink-0"}),jsxRuntime.jsx("span",{className:"text-xs text-green-300",children:i("pptx.security.currentlyProtected")})]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:i("pptx.security.description")}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-foreground mb-1",children:i("pptx.security.password")}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:d?"text":"password",className:"w-full rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",placeholder:i("pptx.security.passwordPlaceholder"),value:s,onChange:b=>{a(b.target.value),h("");}}),jsxRuntime.jsx("button",{type:"button",onClick:()=>u(!d),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":d?"Hide password":"Show password",children:d?jsxRuntime.jsx(lu$1.LuEyeOff,{className:"w-4 h-4"}):jsxRuntime.jsx(lu$1.LuEye,{className:"w-4 h-4"})})]})]}),s&&jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((b,v)=>jsxRuntime.jsx("div",{className:`h-1 flex-1 rounded-full transition-colors ${v<=f?PQe[f]:"bg-accent"}`},`str-${v}`))}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:m})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-foreground mb-1",children:i("pptx.security.confirmPassword")}),jsxRuntime.jsx("input",{type:d?"text":"password",className:"w-full rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",placeholder:i("pptx.security.confirmPasswordPlaceholder"),value:l,onChange:b=>{c(b.target.value),h("");}})]}),p&&jsxRuntime.jsx("p",{className:"text-xs text-red-400",children:p})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border/60",children:[jsxRuntime.jsx("div",{children:e&&jsxRuntime.jsx("button",{type:"button",onClick:g,className:"text-xs text-red-400 hover:text-red-300 transition-colors",children:i("pptx.security.removePassword")})}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:y,className:"px-3 py-1.5 text-xs rounded-lg border border-border text-foreground hover:bg-muted transition-colors",children:i("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:x,className:"px-3 py-1.5 text-xs rounded-lg bg-primary text-white hover:bg-primary/80 transition-colors",children:i(e?"pptx.security.updatePassword":"pptx.security.setPassword")})]})]})]})})]}):null}var AQe=120;function rz(t){let{slides:e,canvasSize:n,activeSlideIndex:r,templateElementsBySlideId:o,loading:i,error:s,hasActivePointerInteraction:a,pointerCommitNonce:l,setSlides:c,setCanvasSize:d,setActiveSlideIndex:u,setTemplateElementsBySlideId:p,setSelectedElementId:h,setSelectedElementIds:f}=t,m=Jm.useRef([]),x=Jm.useRef([]),g=Jm.useRef(null),y=Jm.useRef(""),b=Jm.useRef(""),v=Jm.useRef(false),S=Jm.useRef(null),[w,C]=Jm.useState(false),[T,M]=Jm.useState(false),[_,E]=Jm.useState(void 0),[R,I]=Jm.useState(void 0),[L,k]=Jm.useState(false),F=Jm.useCallback(()=>{C(m.current.length>0),M(x.current.length>0);let fe=m.current[m.current.length-1];E(fe?.actionLabel);let de=x.current[x.current.length-1];I(de?.actionLabel);},[]),N=Jm.useCallback(fe=>({width:n.width,height:n.height,activeSlideIndex:r,slides:e.map(aT),templateElementsBySlideId:lT(o),...fe?{actionLabel:fe}:{}}),[r,n,e,o]),D=Jm.useCallback(fe=>{let de=Math.max(fe.slides.length-1,0);d({width:fe.width,height:fe.height}),c(fe.slides.map(aT)),p(lT(fe.templateElementsBySlideId)),u(Math.min(fe.activeSlideIndex,de)),f([]),h(null);},[u,d,h,f,c,p]),U=Jm.useCallback(()=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{v.current=false;},0);},[]),G=Jm.useCallback(()=>{k(fe=>fe||true);},[]),j=Jm.useCallback(()=>{let fe=m.current.pop();if(!fe)return;let de=N();x.current.push(de),v.current=true;let J=ou(fe);g.current=ou(J),y.current=JSON.stringify(J),D(J),F(),U(),G();},[D,N,G,U,F]),Y=Jm.useCallback(()=>{let fe=x.current.pop();if(!fe)return;let de=N();m.current.push(de),v.current=true;let J=ou(fe);g.current=ou(J),y.current=JSON.stringify(J),D(J),F(),U(),G();},[D,N,G,U,F]),ge=Jm.useCallback(fe=>{if(m.current=[],x.current=[],fe){let de=ou(fe);g.current=de,y.current=JSON.stringify(de);}else g.current=null,y.current="";F();},[F]);return Jm.useEffect(()=>()=>{S.current&&(clearTimeout(S.current),S.current=null);},[]),Jm.useEffect(()=>{if(i||s||v.current||a())return;let fe=`${e.length}|${r}|${n.width}x${n.height}|${e.map(ce=>`${ce.id}:${ce.elements.length}`).join("/")}`;if(fe===b.current)return;let de=N(),J=JSON.stringify(de);if(J===y.current){b.current=fe;return}let re=g.current;if(!re){g.current=ou(de),y.current=J,b.current=fe,F();return}m.current.push(ou(re)),m.current.length>AQe&&m.current.shift(),x.current=[],g.current=ou(de),y.current=J,b.current=fe,F();},[r,N,n.height,n.width,s,a,i,l,e,F]),{canUndo:w,canRedo:T,undoLabel:_,redoLabel:R,handleUndo:j,handleRedo:Y,resetHistory:ge,markDirty:G,buildHistorySnapshot:N}}function iz({canvasSize:t,selectedElements:e}){let n=Jm.useRef(null),r=Jm.useRef(null),o=Jm.useRef(null),i=Jm.useRef(1),[s,a]=Jm.useState(1),[l,c]=Jm.useState(null),d=l||{width:t.width,height:t.height},u=Jm.useMemo(()=>{if(!d.width||!d.height)return 1;let S=d.width/t.width,w=d.height/t.height;return Math.min(S,w,1)},[t,d.height,d.width]),p=u*s;Jm.useEffect(()=>{i.current=p;},[p]),Jm.useEffect(()=>{let S=null,w=0,C=32,T=_=>{let E=Math.max(0,_.clientWidth-8),R=Math.max(0,_.clientHeight-C);E>0&&R>0&&c({width:E,height:R});},M=()=>{let _=o.current;if(!_){w=requestAnimationFrame(M);return}S=new ResizeObserver(()=>T(_)),S.observe(_),T(_);};return M(),()=>{cancelAnimationFrame(w),S?.disconnect();}},[]);let h=Jm.useCallback((S,w)=>{let C=n.current,T=o.current;if(!C||!T)return;let M=Math.min(Math.max(w,.2),5),_=u*M,E=(S.minX+S.maxX)/2,R=(S.minY+S.maxY)/2,I=T.offsetLeft+E*_-C.clientWidth/2,L=T.offsetTop+R*_-C.clientHeight/2;C.scrollTo({left:Math.max(I,0),top:Math.max(L,0),behavior:"smooth"});},[u]),f=Jm.useCallback(()=>{a(S=>Math.min(S+.1,5));},[]),m=Jm.useCallback(()=>{a(S=>Math.max(S-.1,.2));},[]),x=Jm.useCallback(()=>{a(1);},[]),g=Jm.useCallback(()=>{a(1);},[]),y=Jm.useCallback(()=>{if(e.length===0)return;let S=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;if(e.forEach(N=>{S=Math.min(S,N.x),w=Math.min(w,N.y),C=Math.max(C,N.x+Math.max(N.width,12)),T=Math.max(T,N.y+Math.max(N.height,12));}),!Number.isFinite(S)||!Number.isFinite(w)||!Number.isFinite(C)||!Number.isFinite(T))return;let M={minX:S,minY:w,maxX:C,maxY:T},_=Math.max(M.maxX-M.minX,12),E=Math.max(M.maxY-M.minY,12),R=Math.max(d.width-96,12),I=Math.max(d.height-96,12),L=Math.min(R/_,I/E),k=u>Number.EPSILON?u:Number.EPSILON,F=Math.min(Math.max(L/k,.2),5);a(F),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{h(M,F);});});},[h,d.height,d.width,u,e]),b=Jm.useCallback(S=>{if(!S.ctrlKey)return;S.preventDefault();let w=S.deltaY*-1e-3;a(C=>Math.min(Math.max(C+w,.2),5));},[]);Jm.useEffect(()=>{let S=o.current;if(S)return S.addEventListener("wheel",b,{passive:false}),()=>{S.removeEventListener("wheel",b);}},[b]);let v=Jm.useCallback((S,w)=>{let C=r.current;if(!C)return null;let T=C.getBoundingClientRect();if(T.width<=0||T.height<=0)return null;let M=(S-T.left)/p,_=(w-T.top)/p;return {x:Math.max(0,Math.min(t.width,M)),y:Math.max(0,Math.min(t.height,_))}},[t.height,t.width,p]);return {editWrapperRef:n,canvasStageRef:r,canvasViewportRef:o,renderScaleRef:i,scale:s,setScale:a,editorDimensions:l,setEditorDimensions:c,fitScale:u,editorScale:p,handleZoomIn:f,handleZoomOut:m,handleResetZoom:x,handleZoomToFit:g,handleZoomToSelection:y,handleWheel:b,centerBoundsInViewport:h,getCanvasPointFromClient:v}}bt();function ade(t){return !!t.loopContinuously||t.showType==="kiosk"}function lde(t,e){return t.map((n,r)=>{let o=e[r];return typeof o!="number"?n:{...n,transition:{...n.transition,type:n.transition?.type??"none",advanceAfterMs:o}}})}function cde(t,e){return Math.max(0,t||0)+e*60}function GI(){}function Yb(t,e,n,r){for(let o of t.steps)o.stopSound?GI():o.soundPath&&e&&e(o.soundPath);n(o=>{let i=new Map(o);for(let s of t.steps){let a=i.get(s.elementId)??{visible:true},l=s.presetClass==="exit"?a.visible:true;i.set(s.elementId,{visible:l,cssAnimation:s.cssAnimation});}return i});for(let o of t.steps){let i=window.setTimeout(()=>{n(s=>{let a=new Map(s),l=a.get(o.elementId)??{visible:true},c=o.presetClass==="exit"?false:l.visible;return a.set(o.elementId,{visible:c,cssAnimation:void 0}),a});},Math.max(0,o.delayMs+o.durationMs+8));r.current.push(i);}}function ude(t){let{slides:e,onPlayActionSound:n,showWithAnimation:r}=t,o=r!==false,[i,s]=Jm.useState([]),[a,l]=Jm.useState(new Map),[c,d]=Jm.useState(""),[u,p]=Jm.useState(new Set),[h,f]=Jm.useState(new Set),m=Jm.useRef([]),x=Jm.useRef(null),g=Jm.useCallback(()=>{m.current.forEach(M=>{window.clearTimeout(M);}),m.current=[];},[]),y=Jm.useCallback(M=>{if(!M.shouldAutoAdvance())return;let _=M.getAutoAdvanceDelay(),E=M.peekNext();if(!E)return;let R=_+(E.autoAdvanceDelayMs??0),I=window.setTimeout(()=>{let L=M.advance();L&&(Yb(L,n,l,m),y(M));},Math.max(0,R));m.current.push(I);},[n]),b=Jm.useCallback(M=>{let _=e[M];if(!_){x.current=null,l(new Map),d(""),p(new Set),f(new Set);return}let E=_.nativeAnimations??[],R=new Map;for(let F of E)if(F.buildType&&F.buildType!=="allAtOnce"&&F.targetId){let N=_.elements.find(D=>D.id===F.targetId);N&&ze(N)&&N.textSegments&&N.textSegments.length>0&&R.set(F.targetId,EA(N.textSegments));}let I=R.size>0?AA(E,R):E,L=RA.fromAnimations(I);x.current=L,d(L.getTimeline().keyframesCss),p(L.getInteractiveTriggerShapeIds()),f(L.getHoverTriggerShapeIds());let k=_.elements.map(F=>F.id);for(let F of I)F.targetId&&F.targetId.includes(ra)&&k.push(F.targetId);l(L.getElementStates(k));},[e]),v=Jm.useCallback(()=>{if(!o)return false;let M=x.current;if(!M||!M.hasMoreSteps())return false;let _=M.advance();return _?(Yb(_,n,l,m),y(M),true):false},[o,n,y]),S=Jm.useCallback(M=>{let _=x.current;if(!_||!_.hasInteractiveSequence(M))return false;let E=_.advanceInteractive(M);return E?(Yb(E,n,l,m),true):false},[n]),w=Jm.useCallback(M=>{if(!o)return false;let _=x.current;if(!_||!_.hasHoverSequence(M))return false;_.resetHover(M);let E=_.advanceHover(M);return E?(Yb(E,n,l,m),true):false},[o,n]),C=Jm.useCallback(M=>{let _=x.current;!_||!_.hasHoverSequence(M)||_.resetHover(M);},[]),T=Jm.useCallback(M=>{if(g(),!o){x.current=null,s([]),l(new Map),d(""),p(new Set),f(new Set);return}b(M);let _=e[M];if(!_){s([]);return}let E=x.current;if(E&&E.hasMoreSteps()){let I=E.peekNext();if(I&&I.autoAdvance){let L=window.setTimeout(()=>{let k=E.advance();k&&(Yb(k,n,l,m),y(E));},I.autoAdvanceDelayMs??0);m.current.push(L);}}let R=[..._.animations||[]].filter(I=>!!I.entrance).sort((I,L)=>(I.order||Number.MAX_SAFE_INTEGER)-(L.order||Number.MAX_SAFE_INTEGER));if(R.length===0){s([]);return}s(R.map(I=>({elementId:I.elementId,state:"hidden",animation:I}))),R.forEach((I,L)=>{let k=cde(I.delayMs,L),F=window.setTimeout(()=>{s(N=>N.map(D=>D.elementId===I.elementId?{...D,state:"visible"}:D));},k);m.current.push(F);});},[o,g,b,e,n,y]);return {presentationAnimations:i,presentationElementStates:a,presentationKeyframesCss:c,interactiveTriggerShapeIds:u,hoverTriggerShapeIds:h,clearPresentationTimers:g,playNextAnimationGroup:v,handleInteractiveShapeClick:S,handleHoverStart:w,handleHoverEnd:C,runPresentationEntranceAnimations:T,presentationTimersRef:m}}var kQe="pptx-viewer-audience";var Kb="content",pde="pptx-bytes";function hde(){return new Promise((t,e)=>{let n=indexedDB.open(kQe,1);n.onupgradeneeded=()=>{let r=n.result;r.objectStoreNames.contains(Kb)||r.createObjectStore(Kb);},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error);})}async function fde(t){let e=await hde();return new Promise((n,r)=>{let o=e.transaction(Kb,"readwrite"),i=o.objectStore(Kb),a={bytes:t instanceof Uint8Array?t:new Uint8Array(t),createdAt:Date.now()};i.put(a,pde),o.oncomplete=()=>{e.close(),n();},o.onerror=()=>{e.close(),r(o.error);};})}async function o2(){try{let t=await hde();return new Promise(e=>{let n=t.transaction(Kb,"readwrite");n.objectStore(Kb).delete(pde),n.oncomplete=()=>{t.close(),e();},n.onerror=()=>{t.close(),e();};})}catch{}}var sz="pptx-viewer-presenter",jI="#pptx-audience",YI="pptx-viewer-presenter",mde="nonce";function IQe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`s${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}function gde(){let t=window.location.hash;if(!t.startsWith(jI))return null;let e=t.slice(jI.length);return e?new URLSearchParams(e.replace(/^[&;?]/u,"")).get(mde):null}function az(){return window.location.hash.startsWith(jI)}function xde(t){let{currentSlideIndex:e,isPresenterMode:n,content:r}=t,o=Jm.useRef(null),i=Jm.useRef(null),s=Jm.useRef(null),a=Jm.useRef(""),l=Jm.useCallback(()=>(i.current||(i.current=new BroadcastChannel(sz)),i.current),[]),c=Jm.useCallback(()=>o.current!==null&&!o.current.closed,[]),d=Jm.useCallback(h=>{if(!a.current)return;let f={origin:YI,type:"presenter-slide-change",slideIndex:h,sessionId:a.current};try{l().postMessage(f);}catch{}},[l]),u=Jm.useCallback(()=>{if(a.current)try{let f={origin:YI,type:"presenter-exit",sessionId:a.current};l().postMessage(f);}catch{}let h=o.current;if(h&&!h.closed)try{h.close();}catch{}o.current=null,a.current="",s.current!==null&&(clearInterval(s.current),s.current=null),o2();},[l]),p=Jm.useCallback(()=>{c()&&u();let h=window.open("about:blank","_blank");if(!h)return false;o.current=h;let f=IQe();a.current=f;let m=new URL(window.location.href),x=new URLSearchParams;x.set(mde,f),m.hash=`${jI}&${x.toString()}`;let g=y=>{let b=o.current;if(!(!b||b.closed)){if(!y){try{b.close();}catch{}o.current=null,a.current="";return}try{b.location.replace(m.toString());}catch{try{b.close();}catch{}o.current=null,a.current="";}}};return r?fde(r).then(()=>g(true)).catch(()=>g(false)):g(true),window.setTimeout(()=>d(e),1500),s.current=setInterval(()=>{let y=o.current;(!y||y.closed)&&(o.current=null,a.current="",s.current!==null&&(clearInterval(s.current),s.current=null));},1e3),true},[c,u,d,e,r]);return Jm.useEffect(()=>{n&&c()&&d(e);},[e,n,c,d]),Jm.useEffect(()=>()=>{u();try{i.current?.close();}catch{}},[u]),Jm.useEffect(()=>{n||u();},[n,u]),Jm.useEffect(()=>{let h=()=>{o2();};return window.addEventListener("beforeunload",h),()=>window.removeEventListener("beforeunload",h)},[]),{openAudienceWindow:p,closeAudienceWindow:u,isAudienceWindowOpen:c,syncSlideToAudience:d}}function bde(t){let{onSetMode:n,onSetActiveSlideIndex:r,containerRef:o}=t,i=Jm.useRef(false);Jm.useEffect(()=>{if(!az()||i.current)return;i.current=true;let s=window.setTimeout(()=>{try{let a=o.current;a&&typeof a.requestFullscreen=="function"&&a.requestFullscreen().catch(()=>{});}catch{}n("present");},800);return ()=>window.clearTimeout(s)},[o,n]),Jm.useEffect(()=>{if(!az())return;let s=gde(),a;try{a=new BroadcastChannel(sz);}catch{return}return a.onmessage=l=>{let c=l.data;if(!(!c||c.origin!==YI)&&!(s&&c.sessionId!==s)&&(c.type==="presenter-slide-change"&&r(c.slideIndex),c.type==="presenter-exit")){o2(),n("edit");try{window.close();}catch{}}},()=>{try{a.close();}catch{}}},[n,r]);}function vde(t,e){return t==="Escape"?{action:"exit"}:t==="ArrowRight"||t==="PageDown"||t===" "?{action:"next"}:t==="ArrowLeft"||t==="PageUp"?{action:"prev"}:t==="l"||t==="L"?{action:"toggleLaser"}:t==="p"||t==="P"?{action:"togglePen"}:t==="e"||t==="E"?{action:"toggleEraser"}:t==="m"&&e?{action:"toggleToolbar"}:t==="n"||t==="N"?{action:"togglePresenterView"}:{action:"none"}}function Sde(t){let{mode:e,movePresentationSlide:n,onSetMode:r,onToggleLaser:o,onTogglePen:i,onToggleEraser:s,onToggleToolbar:a,onTogglePresenterView:l,rehearsing:c,recordCurrentSlideTime:d,presentationSlideIndex:u,setShowRehearsalSummary:p}=t;Jm.useEffect(()=>{if(e!=="present")return;let h=f=>{let m=vde(f.key,f.ctrlKey);if(m.action!=="none")switch(f.preventDefault(),m.action){case "exit":c&&(d(u),p(true)),r("edit");return;case "next":n(1);return;case "prev":n(-1);return;case "toggleLaser":o?.();return;case "togglePen":i?.();return;case "toggleEraser":s?.();return;case "toggleToolbar":a?.();return;case "togglePresenterView":l?.();break}};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h);}},[e,n,r,o,i,s,a,l,c,d,u,p]);}function Tde(t){let{containerRef:e,onSetMode:n,onSaveRehearsalTimings:r,setPresentationStartTime:o,setPresenterMode:i}=t,[s,a]=Jm.useState(false),[l,c]=Jm.useState({}),[d,u]=Jm.useState(null),[p,h]=Jm.useState(false),[f,m]=Jm.useState(false),x=Jm.useRef(0),g=Jm.useRef(null),y=Jm.useCallback(C=>{if(d===null)return;let T=x.current;g.current!==null&&(T+=Date.now()-g.current);let M=Date.now()-d-T;c(_=>({..._,[C]:Math.max(0,M)})),x.current=0,g.current=f?Date.now():null,u(Date.now());},[d,f]),b=Jm.useCallback(()=>{h(false),a(false),c({});},[]),v=Jm.useCallback(()=>{r?.(l),h(false),a(false);},[r,l]),S=Jm.useCallback(()=>{i(false),a(true),c({}),m(false),h(false),x.current=0,g.current=null;let C=Date.now();o(C),u(C);try{let T=e.current;T&&typeof T.requestFullscreen=="function"&&T.requestFullscreen().catch(()=>{});}catch{}n("present");},[e,n,o,i]),w=Jm.useCallback(()=>{m(C=>(C?g.current!==null&&(x.current+=Date.now()-g.current,g.current=null):g.current=Date.now(),!C));},[]);return {rehearsing:s,setRehearsing:a,recordedTimings:l,slideStartTime:d,showRehearsalSummary:p,setShowRehearsalSummary:h,rehearsalPaused:f,recordCurrentSlideTime:y,dismissRehearsalSummary:b,saveRehearsalTimings:v,enterRehearsalMode:S,toggleRehearsalPause:w}}function Cde(t,e){let n=t.action||"";if(t.soundPath&&e.onPlayActionSound&&e.onPlayActionSound(t.soundPath),typeof t.targetSlideIndex=="number"){let r=Math.max(0,Math.min(e.slidesLength-1,Math.floor(t.targetSlideIndex)));e.slidesLength>0&&e.navigateToSlide(r);return}if(n.includes("hlinkshowjump")){let r=n.toLowerCase();r.includes("nextslide")?e.movePresentationSlide(1):r.includes("previousslide")?e.movePresentationSlide(-1):r.includes("firstslide")?e.navigateToSlide(0):r.includes("lastslide")?e.navigateToSlide(e.slidesLength-1):r.includes("endshow")&&e.onSetMode("edit");return}n.includes("hlinksldjump")||t.url&&!n.includes("hlinksldjump")&&Lm(t.url)&&window.open(t.url,"_blank","noopener,noreferrer");}function lz(t,e){let n=e.slides[e.currentSlideIndex];n?.transition?.soundPath&&e.onPlayActionSound&&e.onPlayActionSound(n.transition.soundPath);let r=Math.max(120,n?.transition?.durationMs||320);e.setPresentationSlideVisible(false),e.clearPresentationTimers();let o=window.setTimeout(()=>{e.setPresentationSlideIndex(t),e.onSetActiveSlideIndex(t),e.setPresentationSlideVisible(true),e.runPresentationEntranceAnimations(t),e.scheduleAutoAdvanceForSlide?.(t);},Math.min(r,480));e.presentationTimersRef.current.push(o);}function Mde(t){let{slides:e,visibleSlideIndexes:n,presentationSlideIndex:r,setPresentationSlideIndex:o,setPresentationSlideVisible:i,onSetMode:s,onSetActiveSlideIndex:a,onPlayActionSound:l,loopContinuously:c,useTimings:d,playNextAnimationGroup:u,clearPresentationTimers:p,runPresentationEntranceAnimations:h,presentationTimersRef:f,rehearsing:m,recordCurrentSlideTime:x,setShowRehearsalSummary:g}=t,y=Jm.useRef(()=>{}),b=Jm.useCallback(C=>{if(d===false)return;let M=e[C]?.transition?.advanceAfterMs;if(typeof M!="number"||!Number.isFinite(M)||M<0)return;let _=window.setTimeout(()=>{y.current(1);},Math.max(0,M));f.current.push(_);},[e,f,d]),v=Jm.useCallback(C=>{if(C===1&&u())return;let T=n.length>0?n:e.map((L,k)=>k);if(T.length===0)return;let M=T.indexOf(r),E=(M>=0?M:0)+C;if(m&&C===1&&E>=T.length){x(r);try{document.fullscreenElement&&document.exitFullscreen().catch(()=>{});}catch{}s("edit"),g(true);return}let R;c&&!m&&C===1&&E>=T.length?R=0:R=Math.min(T.length-1,Math.max(0,E));let I=T[R];I===void 0||I===r||(m&&C===1&&x(r),lz(I,{slides:e,currentSlideIndex:r,onPlayActionSound:l,setPresentationSlideVisible:i,clearPresentationTimers:p,setPresentationSlideIndex:o,onSetActiveSlideIndex:a,runPresentationEntranceAnimations:h,scheduleAutoAdvanceForSlide:m?void 0:b,presentationTimersRef:f}));},[p,c,l,a,s,u,r,f,x,m,h,b,g,e,n,i,o]);y.current=v;let S=Jm.useCallback(C=>{C<0||C>=e.length||C!==r&&lz(C,{slides:e,currentSlideIndex:r,onPlayActionSound:l,setPresentationSlideVisible:i,clearPresentationTimers:p,setPresentationSlideIndex:o,onSetActiveSlideIndex:a,runPresentationEntranceAnimations:h,scheduleAutoAdvanceForSlide:b,presentationTimersRef:f});},[p,l,a,r,f,h,b,e,o,i]),w=Jm.useCallback(C=>{Cde(C,{movePresentationSlide:v,navigateToSlide:S,onPlayActionSound:l,onSetMode:s,slidesLength:e.length});},[v,S,l,s,e.length]);return {movePresentationSlide:v,navigateToSlide:S,handlePresentationAction:w,scheduleAutoAdvanceForSlide:b}}function _de(t){let{navigateToSlide:e}=t,n=Jm.useRef(null),r=Jm.useCallback((s,a)=>{n.current=a,e(s);},[e]),o=Jm.useCallback(()=>{let s=n.current;return s===null?false:(n.current=null,e(s),true)},[e]),i=Jm.useCallback(()=>{n.current=null;},[]);return {handleZoomClick:r,zoomReturnSlideIndex:n,returnToZoomSlide:o,clearZoomReturn:i}}function uz(t){let{mode:e,slides:n,visibleSlideIndexes:r,activeSlideIndex:o,containerRef:i,content:s,onSetMode:a,onSetActiveSlideIndex:l,onPlayActionSound:c,onToggleLaser:d,onTogglePen:u,onToggleEraser:p,onToggleToolbar:h,onSaveRehearsalTimings:f,loopContinuously:m,showWithAnimation:x,useTimings:g}=t,[y,b]=Jm.useState(0),[v,S]=Jm.useState(true),[w,C]=Jm.useState(false),[T,M]=Jm.useState(null),_=Jm.useRef(false),{presentationAnimations:E,presentationElementStates:R,presentationKeyframesCss:I,interactiveTriggerShapeIds:L,hoverTriggerShapeIds:k,clearPresentationTimers:F,playNextAnimationGroup:N,handleInteractiveShapeClick:D,handleHoverStart:U,handleHoverEnd:G,runPresentationEntranceAnimations:j,presentationTimersRef:Y}=ude({slides:n,onPlayActionSound:c,showWithAnimation:x}),{rehearsing:ge,setRehearsing:fe,recordedTimings:de,slideStartTime:J,showRehearsalSummary:re,setShowRehearsalSummary:ce,rehearsalPaused:ae,recordCurrentSlideTime:_e,dismissRehearsalSummary:xe,saveRehearsalTimings:Ee,enterRehearsalMode:W,toggleRehearsalPause:q}=Tde({containerRef:i,onSetMode:a,onSaveRehearsalTimings:f,setPresentationStartTime:M,setPresenterMode:C}),{movePresentationSlide:Q,navigateToSlide:se,handlePresentationAction:me,scheduleAutoAdvanceForSlide:P}=Mde({slides:n,visibleSlideIndexes:r,presentationSlideIndex:y,setPresentationSlideIndex:b,setPresentationSlideVisible:S,onSetMode:a,onSetActiveSlideIndex:l,onPlayActionSound:c,loopContinuously:m,useTimings:g,playNextAnimationGroup:N,clearPresentationTimers:F,runPresentationEntranceAnimations:j,presentationTimersRef:Y,rehearsing:ge,recordCurrentSlideTime:_e,setShowRehearsalSummary:ce}),{handleZoomClick:A,zoomReturnSlideIndex:O,returnToZoomSlide:z,clearZoomReturn:te}=_de({navigateToSlide:se}),{openAudienceWindow:$,closeAudienceWindow:Me,isAudienceWindowOpen:De,syncSlideToAudience:V}=xde({currentSlideIndex:y,isPresenterMode:w,content:s});bde({onSetMode:a,onSetActiveSlideIndex:l,containerRef:i});let B=Jm.useCallback(()=>{C(false),fe(false),M(Date.now());try{let ue=i.current;ue&&typeof ue.requestFullscreen=="function"&&ue.requestFullscreen().catch(()=>{});}catch{}a("present");},[i,a,fe]),ee=Jm.useCallback(()=>{C(true),fe(false),M(Date.now()),a("present");},[a,fe]),oe=Jm.useCallback(()=>{if(w){C(false);try{let ue=i.current;ue&&typeof ue.requestFullscreen=="function"&&ue.requestFullscreen().catch(()=>{});}catch{}}else {_.current=true;try{document.fullscreenElement&&document.exitFullscreen().catch(()=>{});}catch{}C(true),T||M(Date.now());}},[w,T,i]);Sde({mode:e,movePresentationSlide:Q,onSetMode:a,onToggleLaser:d,onTogglePen:u,onToggleEraser:p,onToggleToolbar:h,onTogglePresenterView:oe,rehearsing:ge,recordCurrentSlideTime:_e,presentationSlideIndex:y,setShowRehearsalSummary:ce});let pe=Jm.useRef(j);pe.current=j;let Ae=Jm.useRef(P);Ae.current=P;let Le=Jm.useRef(o);return Le.current=o,Jm.useEffect(()=>{if(e==="present"){let ue=Le.current;b(ue),pe.current(ue),Ae.current(ue);}},[e]),Jm.useEffect(()=>{if(e==="present")return ()=>{try{document.fullscreenElement&&document.exitFullscreen().catch(()=>{});}catch{}}},[e]),Jm.useEffect(()=>{if(e!=="present"||w)return;let ue=!!document.fullscreenElement,we=()=>{if(_.current){_.current=false,ue=!!document.fullscreenElement;return}let Ie=!!document.fullscreenElement;ue&&!Ie&&(ge&&(_e(y),ce(true)),a("edit")),ue=Ie;};return document.addEventListener("fullscreenchange",we),()=>{document.removeEventListener("fullscreenchange",we);}},[e,a,w,ge,_e,y,ce]),Jm.useEffect(()=>{let ue=Y;return ()=>{ue.current.forEach(we=>{window.clearTimeout(we);});}},[Y]),{presentationSlideIndex:y,setPresentationSlideIndex:b,presentationSlideVisible:v,presentationAnimations:E,presentationElementStates:R,presentationKeyframesCss:I,clearPresentationTimers:F,runPresentationEntranceAnimations:j,movePresentationSlide:Q,navigateToSlide:se,handlePresentationAction:me,handleInteractiveShapeClick:D,interactiveTriggerShapeIds:L,hoverTriggerShapeIds:k,handleHoverStart:U,handleHoverEnd:G,enterPresentMode:B,presenterMode:w,enterPresenterView:ee,togglePresenterView:oe,presentationStartTime:T,rehearsing:ge,enterRehearsalMode:W,recordedTimings:de,slideStartTime:J,showRehearsalSummary:re,dismissRehearsalSummary:xe,saveRehearsalTimings:Ee,rehearsalPaused:ae,toggleRehearsalPause:q,handleZoomClick:A,zoomReturnSlideIndex:O,returnToZoomSlide:z,clearZoomReturn:te,openAudienceWindow:$,closeAudienceWindow:Me,isAudienceWindowOpen:De,syncSlideToAudience:V}}var OQe=2.5,BQe=14,UQe=.4,Ede=16,Ade=0;function $Qe(){return Ade+=1,`stroke-${Ade}`}function pz(t){let{isActive:e,activeSlideIndex:n}=t,[r,o]=Jm.useState("none"),[i,s]=Jm.useState("#ff0000"),[a,l]=Jm.useState("#ffff00"),[c,d]=Jm.useState(null),[u,p]=Jm.useState(null),[h,f]=Jm.useState(false),m=Jm.useRef(new Map),[x,g]=Jm.useState([]),[y,b]=Jm.useState(0),v=Jm.useRef(false),S=Jm.useRef(n);S.current=n;let w=Jm.useRef(n);Jm.useEffect(()=>{e&&w.current!==n&&(g(U=>(U.length>0?m.current.set(w.current,U):m.current.delete(w.current),b(G=>G+1),m.current.get(n)??[])),w.current=n);},[e,n]);let C=Jm.useCallback(U=>{e&&o(G=>G===U?"none":U);},[e]),T=Jm.useCallback((U,G)=>{if(e&&(r==="pen"||r==="highlighter")){v.current=true;let j=r==="pen";d({id:$Qe(),points:[{x:U,y:G}],color:j?i:a,width:j?OQe:BQe,opacity:j?1:UQe});}},[e,r,i,a]),M=Jm.useCallback((U,G)=>{!e||!v.current||d(j=>j?{...j,points:[...j.points,{x:U,y:G}]}:null);},[e]),_=Jm.useCallback(()=>{v.current&&(v.current=false,d(U=>(U&&U.points.length>1&&g(G=>{if(G.some(Y=>Y.id===U.id))return G;let j=[...G,U];return m.current.set(S.current,j),b(Y=>Y+1),j}),null)));},[]),E=Jm.useCallback((U,G)=>{!e||r!=="laser"||p({x:U,y:G});},[e,r]),R=Jm.useCallback(()=>{p(null);},[]),I=Jm.useCallback((U,G)=>{!e||r!=="eraser"||g(j=>{let Y=j.filter(ge=>!ge.points.some(fe=>{let de=fe.x-U,J=fe.y-G;return de*de+J*J<Ede*Ede}));return Y.length>0?m.current.set(S.current,Y):m.current.delete(S.current),b(ge=>ge+1),Y});},[e,r]),L=Jm.useCallback(()=>{g([]),d(null),v.current=false,m.current.delete(S.current),b(U=>U+1);},[]),k=Jm.useCallback(()=>{g([]),d(null),v.current=false,m.current.clear(),b(U=>U+1);},[]),F=Jm.useRef(0);Jm.useEffect(()=>{if(!e){f(false),o("none"),d(null),p(null);return}let U=()=>{f(true),window.clearTimeout(F.current),F.current=window.setTimeout(()=>{f(false);},3e3);};return window.addEventListener("mousemove",U),()=>{window.removeEventListener("mousemove",U),window.clearTimeout(F.current);}},[e]);let N=Jm.useCallback(()=>{let U=new Map(m.current);return x.length>0&&U.set(n,x),U},[x,n]),D=y>=0&&(x.length>0||m.current.size>0);return {presentationTool:r,setPresentationTool:C,penColor:i,setPenColor:s,highlighterColor:a,setHighlighterColor:l,annotationStrokes:x,currentStroke:c,laserPosition:u,toolbarVisible:h,setToolbarVisible:f,handlePointerDown:T,handlePointerMove:M,handlePointerUp:_,handleLaserMove:E,handleLaserLeave:R,clearAnnotations:L,eraseAtPoint:I,allSlideAnnotations:N(),hasAnyAnnotations:D,clearAllAnnotations:k}}bt();function zQe(t,e,n){if(!e)return [];let r=[],o=n?e:e.toLowerCase();return t.forEach((i,s)=>{for(let a of i.elements||[]){if(!ze(a))continue;(a.textSegments??[]).forEach((c,d)=>{let u=n?c.text:(c.text||"").toLowerCase(),p=0;for(;p<u.length;){let h=u.indexOf(o,p);if(h===-1)break;r.push({slideIndex:s,elementId:a.id,segmentIndex:d,startOffset:h,length:e.length}),p=h+1;}});}}),r}function VQe(t,e,n){if(e.length===0)return t;let r=[...t],o=new Map;for(let i of e){let s=`${i.slideIndex}::${i.elementId}::${i.segmentIndex}`;o.has(s)||o.set(s,[]),o.get(s).push(i);}for(let[,i]of o){let s=[...i].sort((a,l)=>l.startOffset-a.startOffset);for(let a of s){let l=r[a.slideIndex];if(!l)continue;let c=(l.elements||[]).findIndex(x=>x.id===a.elementId);if(c===-1)continue;let d=l.elements[c];if(!ze(d))continue;let u=[...d.textSegments??[]],p=u[a.segmentIndex];if(!p)continue;let h=p.text.slice(0,a.startOffset),f=p.text.slice(a.startOffset+a.length);u[a.segmentIndex]={...p,text:h+n+f};let m=[...l.elements];m[c]={...d,text:u.map(x=>x.text).join(""),textSegments:u},r[a.slideIndex]={...l,elements:m};}}return r}function hz({slides:t,mode:e,onSetActiveSlideIndex:n,onSetSelectedElementId:r,onUpdateSlides:o,onMarkDirty:i}){let[s,a]=Jm.useState(false),[l,c]=Jm.useState(""),[d,u]=Jm.useState(""),[p,h]=Jm.useState(false),[f,m]=Jm.useState([]),[x,g]=Jm.useState(-1),y=Jm.useCallback(()=>{let C=zQe(t,l,p);if(!l){m([]),g(-1);return}m(C),g(C.length>0?0:-1),C.length>0&&(n(C[0].slideIndex),r(C[0].elementId));},[t,l,p,n,r]),b=Jm.useCallback(C=>{if(f.length===0)return;let T=(x+C+f.length)%f.length;g(T);let M=f[T];M&&(n(M.slideIndex),r(M.elementId));},[f,x,n,r]),v=Jm.useCallback(C=>{C.length!==0&&(o(T=>VQe(T,C,d)),i());},[d,o,i]),S=Jm.useCallback(()=>{f.length===0||x<0||(v([f[x]]),setTimeout(y,0));},[f,x,v,y]),w=Jm.useCallback(()=>{f.length!==0&&(v(f),setTimeout(y,0));},[f,v,y]);return Jm.useEffect(()=>{let C=T=>{if((T.metaKey||T.ctrlKey)&&T.key==="f"){if(e!=="edit")return;T.preventDefault(),a(M=>!M);}};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[e]),{findReplaceOpen:s,setFindReplaceOpen:a,findQuery:l,setFindQuery:c,replaceQuery:d,setReplaceQuery:u,findMatchCase:p,setFindMatchCase:h,findResults:f,findResultIndex:x,performFind:y,navigateFindResult:b,handleReplace:S,handleReplaceAll:w}}function pi(t,e=120){let[n,r]=Jm.useState(0),o=Jm.useRef(null),i=Jm.useCallback(l=>{l.pointerType!=="mouse"&&(l.target.closest('button, a, input, select, textarea, [role="button"]')||(o.current=l.clientY,l.target.setPointerCapture?.(l.pointerId)));},[]),s=Jm.useCallback(l=>{o.current!==null&&r(Math.max(0,l.clientY-o.current));},[]),a=Jm.useCallback(l=>{if(o.current===null)return;let c=l.clientY-o.current;o.current=null,l.target.releasePointerCapture?.(l.pointerId),c>e&&t(),r(0);},[t,e]);return {panelStyle:n>0?{transform:`translateY(${n}px)`,transition:"none"}:{transition:"transform 150ms ease-out"},handlers:{onPointerDown:i,onPointerMove:s,onPointerUp:a,onPointerCancel:a}}}function mz(){return `comment-${crypto.randomUUID()}`}function Rde(t,e,n){return t.map((r,o)=>o===e?{...r,comments:[...r.comments||[],n]}:r)}function kde(t,e,n){let r=false;return {slides:t.map((i,s)=>{if(s!==e)return i;let a=i.comments||[],l=a.filter(c=>{let d=c.id!==n;return d||(r=true),d});return l.length===a.length?i:{...i,comments:l}}),didDelete:r}}function Ide(t,e,n,r){let o=false;return {slides:t.map((s,a)=>{if(a!==e)return s;let l=(s.comments||[]).map(c=>c.id!==n?c:(o=true,{...c,text:r}));return o?{...s,comments:l}:s}),didUpdate:o}}function Nde(t,e,n){let r=false;return {slides:t.map((i,s)=>{if(s!==e)return i;let a=(i.comments||[]).map(l=>l.id!==n?l:(r=true,{...l,resolved:!l.resolved}));return r?{...i,comments:a}:i}),didUpdate:r}}function Lde(t,e){let n={},r=false;for(let[o,i]of Object.entries(t)){if(!e.has(o)){r=true;continue}n[o]=i;}return r?n:null}function gz({slides:t,canEdit:e,userName:n="You",selectedElementId:r,onUpdateSlides:o,onMarkDirty:i}){let[s,a]=Jm.useState({}),[l,c]=Jm.useState({}),[d,u]=Jm.useState({}),[p,h]=Jm.useState({}),[f,m]=Jm.useState(null),x=Jm.useCallback((R,I)=>{a(L=>({...L,[R]:I}));},[]),g=Jm.useCallback((R,I)=>{u(L=>({...L,[R]:I}));},[]),y=Jm.useCallback(R=>{if(!e)return;let I=t[R];if(!I)return;let L=String(s[I.id]||"").trim();if(L.length===0)return;let k={id:mz(),text:L,author:n,createdAt:new Date().toISOString(),elementId:r??void 0};o(F=>Rde(F,R,k)),a(F=>({...F,[I.id]:""})),i();},[e,s,i,o,r,t,n]),b=Jm.useCallback((R,I)=>{if(!e)return;let L=t[R];if(!L)return;let k=false;o(F=>{let N=kde(F,R,I);return k=N.didDelete,N.slides}),k&&(c(F=>({...F,[L.id]:null})),i());},[e,i,o,t]),v=Jm.useCallback((R,I)=>{let L=t.find(F=>F.id===R);if(!L)return;let k=(L.comments||[]).find(F=>F.id===I);k&&(c(F=>({...F,[R]:I})),u(F=>({...F,[I]:k.text||""})));},[t]),S=Jm.useCallback(R=>{c(I=>({...I,[R]:null}));},[]),w=Jm.useCallback((R,I)=>{if(!e)return;let L=t[R];if(!L)return;let k=String(d[I]||"").trim();if(k.length===0)return;let F=false;o(N=>{let D=Ide(N,R,I,k);return F=D.didUpdate,D.slides}),F&&(c(N=>({...N,[L.id]:null})),i());},[e,d,i,o,t]),C=Jm.useCallback((R,I)=>{if(!e||!t[R])return;let k=false;o(F=>{let N=Nde(F,R,I);return k=N.didUpdate,N.slides}),k&&i();},[e,i,o,t]),T=Jm.useCallback((R,I)=>{m(I),h(L=>({...L,[I]:""}));},[]),M=Jm.useCallback(()=>{m(null);},[]),_=Jm.useCallback((R,I)=>{h(L=>({...L,[R]:I}));},[]),E=Jm.useCallback((R,I)=>{if(!e)return;let L=t[R];if(!L)return;let k=(L.comments||[]).find(D=>D.id===I);if(!k)return;let F=String(p[I]||"").trim();if(F.length===0)return;let N={id:mz(),text:F,author:n,createdAt:new Date().toISOString(),threadId:I,elementId:k.elementId};o(D=>D.map((U,G)=>{if(G!==R)return U;let j=(U.comments||[]).map(Y=>Y.id!==I?Y:{...Y,replies:[...Y.replies||[],N]});return {...U,comments:j}})),m(null),h(D=>{let U={...D};return delete U[I],U}),i();},[e,i,o,p,t,n]);return Jm.useEffect(()=>{let R=new Set(t.map(I=>I.id));a(I=>Lde(I,R)??I);},[t]),{commentDraftBySlideId:s,editingCommentIdBySlideId:l,commentEditDraftByCommentId:d,replyingToCommentId:f,replyDraftByCommentId:p,handleCommentDraftChange:x,handleAddSlideComment:y,handleDeleteSlideComment:b,handleStartCommentEdit:v,handleCancelCommentEdit:S,handleSaveCommentEdit:w,handleSetCommentEditDraft:g,handleToggleCommentResolved:C,handleStartReply:T,handleCancelReply:M,handleReplyDraftChange:_,handleSubmitReply:E}}function jQe(t,e){let n=new Map;for(let r of t)n.set(r.id,r);for(let r of e)n.set(r.id,r);return n}function YQe(t,e){return e.length>0?e:t?[t]:[]}function KQe(t,e){if(!(e===null||!t?.layouts))return t.layouts[e]}function qQe(t,e){return e?e.elements??[]:t?t.elements??[]:[]}function Dde(t){let{slides:e,activeSlideIndex:n,templateElementsBySlideId:r,selectedElementId:o,selectedElementIds:i,slideMasters:s,activeMasterIndex:a,activeLayoutIndex:l,notesMaster:c,handoutMaster:d}=t,u=e[n],p=Jm.useMemo(()=>u?r[u.id]??[]:[],[u,r]),h=Jm.useMemo(()=>jQe(p,u?.elements??[]),[u,p]),f=Jm.useMemo(()=>o?h.get(o)??null:null,[h,o]),m=Jm.useMemo(()=>YQe(o,i),[o,i]),x=Jm.useMemo(()=>new Set(m),[m]),g=Jm.useMemo(()=>m.map(C=>h.get(C)).filter(Boolean),[m,h]),y=s[a],b=Jm.useMemo(()=>KQe(y,l),[y,l]),v=Jm.useMemo(()=>qQe(y,b),[y,b]),S=Jm.useMemo(()=>c?.elements??[],[c]),w=Jm.useMemo(()=>d?.elements??[],[d]);return {activeSlide:u,templateElements:p,elementLookup:h,selectedElement:f,effectiveSelectedIds:m,selectedElementIdSet:x,selectedElements:g,activeMaster:y,activeLayout:b,masterViewElements:v,notesMasterElements:S,handoutMasterElements:w}}function bz(t){let e=Jm.useRef(null),n=Jm.useRef(null),r=Jm.useRef(null),o=Jm.useRef(0),i=Jm.useRef(null),s=Jm.useRef(null),a=Jm.useRef(null),l=Jm.useRef(null),c=Jm.useRef(false),[d,u]=Jm.useState("edit"),[p,h]=Jm.useState(true),[f,m]=Jm.useState(null),[x,g]=Jm.useState([]),[y,b]=Jm.useState({}),[v,S]=Jm.useState({width:1280,height:720}),[w,C]=Jm.useState(0),[T,M]=Jm.useState(null),[_,E]=Jm.useState([]),[R,I]=Jm.useState(false),L=Jm.useRef(null),k=Jm.useRef(""),[F,N]=Jm.useState(null),[D,U]=Jm.useState(""),G=Jm.useCallback(vs=>{let rp=typeof vs=="function"?vs(L.current):vs;L.current=rp,N(vs);},[]),j=Jm.useCallback(vs=>{let rp=typeof vs=="function"?vs(k.current):vs;k.current=rp,U(vs);},[]),[Y,ge]=Jm.useState(false),[fe,de]=Jm.useState("rect"),[J,re]=Jm.useState(null),[ce,ae]=Jm.useState(0),[_e,xe]=Jm.useState({}),[Ee,W]=Jm.useState([]),[q,Q]=Jm.useState([]),[se,me]=Jm.useState(),[P,A]=Jm.useState(),[O,z]=Jm.useState([]),[te,$]=Jm.useState([]),[Me,De]=Jm.useState(null),[V,B]=Jm.useState([]),[ee,oe]=Jm.useState({}),[pe,Ae]=Jm.useState(),[Le,ue]=Jm.useState(),[we,Ie]=Jm.useState(),[He,Oe]=Jm.useState([]),[$e,ot]=Jm.useState([]),[at,gt]=Jm.useState(),[le,Ue]=Jm.useState(),[Te,Ve]=Jm.useState([]),[Fe,ke]=Jm.useState(false),[nt,st]=Jm.useState(false),[Xn,Cn]=Jm.useState(0),[Zi,bs]=Jm.useState(0),[p0,_v]=Jm.useState(null),[h0,of]=Jm.useState("edit"),[Pv,f0]=Jm.useState("slides"),[m0,pl]=Jm.useState(4),sf=Dde({slides:x,activeSlideIndex:w,templateElementsBySlideId:y,selectedElementId:T,selectedElementIds:_,slideMasters:q,activeMasterIndex:Zi,activeLayoutIndex:p0,notesMaster:pe,handoutMaster:Le});return {containerRef:e,imageInputRef:n,mediaInputRef:r,activeSlideIndexRef:o,inlineEditingElementIdRef:L,inlineEditingTextRef:k,dragStateRef:i,resizeStateRef:s,shapeAdjustmentDragStateRef:a,marqueeStateRef:l,isDrawingRef:c,mode:d,setMode:u,loading:p,setLoading:h,error:f,setError:m,slides:x,setSlides:g,templateElementsBySlideId:y,setTemplateElementsBySlideId:b,canvasSize:v,setCanvasSize:S,activeSlideIndex:w,setActiveSlideIndex:C,selectedElementId:T,setSelectedElementId:M,selectedElementIds:_,setSelectedElementIds:E,isDirty:R,setIsDirty:I,inlineEditingElementId:F,setInlineEditingElementId:G,inlineEditingText:D,setInlineEditingText:j,editTemplateMode:Y,setEditTemplateMode:ge,newShapeType:fe,setNewShapeType:de,clipboardPayload:J,setClipboardPayload:re,pointerCommitNonce:ce,setPointerCommitNonce:ae,headerFooter:_e,setHeaderFooter:xe,layoutOptions:Ee,setLayoutOptions:W,slideMasters:q,setSlideMasters:Q,theme:se,setTheme:me,tableStyleMap:P,setTableStyleMap:A,themeOptions:O,setThemeOptions:z,customShows:te,setCustomShows:$,activeCustomShowId:Me,setActiveCustomShowId:De,sections:V,setSections:B,presentationProperties:ee,setPresentationProperties:oe,notesMaster:pe,setNotesMaster:Ae,handoutMaster:Le,setHandoutMaster:ue,notesCanvasSize:we,setNotesCanvasSize:Ie,customProperties:He,setCustomProperties:Oe,tagCollections:$e,setTagCollections:ot,coreProperties:at,setCoreProperties:gt,appProperties:le,setAppProperties:Ue,embeddedFonts:Te,setEmbeddedFonts:Ve,hasMacros:Fe,setHasMacros:ke,hasDigitalSignatures:nt,setHasDigitalSignatures:st,digitalSignatureCount:Xn,setDigitalSignatureCount:Cn,activeMasterIndex:Zi,setActiveMasterIndex:bs,activeLayoutIndex:p0,setActiveLayoutIndex:_v,preMasterMode:h0,setPreMasterMode:of,masterViewTab:Pv,setMasterViewTab:f0,handoutSlidesPerPage:m0,setHandoutSlidesPerPage:pl,...sf}}function vz(){let[t,e]=Jm.useState(false),[n,r]=Jm.useState("home"),[o,i]=Jm.useState(()=>typeof window>"u"?true:window.innerWidth>=768),[s,a]=Jm.useState(false),[l,c]=Jm.useState(true),[d,u]=Jm.useState(false),[p,h]=Jm.useState(false),[f,m]=Jm.useState("properties"),[x,g]=Jm.useState(false),[y,b]=Jm.useState(false),[v,S]=Jm.useState(false),[w,C]=Jm.useState([]),[T,M]=Jm.useState(null),[_,E]=Jm.useState(null),[R,I]=Jm.useState(true),[L,k]=Jm.useState(false),[F,N]=Jm.useState(false),[D,U]=Jm.useState(true),[G,j]=Jm.useState(true),[Y,ge]=Jm.useState([]),[fe,de]=Jm.useState(null),[J,re]=Jm.useState([]),[ce,ae]=Jm.useState(new Map),[_e,xe]=Jm.useState("select"),[Ee,W]=Jm.useState("#000000"),[q,Q]=Jm.useState(3),[se,me]=Jm.useState(false),[P,A]=Jm.useState(false),[O,z]=Jm.useState(false),[te,$]=Jm.useState(false),[Me,De]=Jm.useState(false);return {isCompactToolbarOpen:t,setIsCompactToolbarOpen:e,toolbarSection:n,setToolbarSection:r,isSlidesPaneOpen:o,setIsSlidesPaneOpen:i,isInspectorPaneOpen:s,setIsInspectorPaneOpen:a,isSlideNotesCollapsed:l,setIsSlideNotesCollapsed:c,isOverflowMenuOpen:d,setIsOverflowMenuOpen:u,isSidebarCollapsed:p,setIsSidebarCollapsed:h,sidebarPanelMode:f,setSidebarPanelMode:m,showSlideSorter:x,setShowSlideSorter:g,isShortcutHelpOpen:y,setIsShortcutHelpOpen:b,isAccessibilityPanelOpen:v,setIsAccessibilityPanelOpen:S,accessibilityIssues:w,setAccessibilityIssues:C,contextMenuState:T,setContextMenuState:M,tableEditorState:_,setTableEditorState:E,spellCheckEnabled:R,setSpellCheckEnabled:I,showGrid:L,setShowGrid:k,showRulers:F,setShowRulers:N,snapToGrid:D,setSnapToGrid:U,snapToShape:G,setSnapToShape:j,guides:Y,setGuides:ge,marqueeSelectionState:fe,setMarqueeSelectionState:de,snapLines:J,setSnapLines:re,mediaDataUrls:ce,setMediaDataUrls:ae,activeTool:_e,setActiveTool:xe,drawingColor:Ee,setDrawingColor:W,drawingWidth:q,setDrawingWidth:Q,isThemeEditorOpen:se,setIsThemeEditorOpen:me,isThemeGalleryOpen:P,setIsThemeGalleryOpen:A,formatPainterActive:O,setFormatPainterActive:z,isSelectionPaneOpen:te,setIsSelectionPaneOpen:$,eyedropperActive:Me,setEyedropperActive:De}}function Sz(t){let e=bz(),n=vz();return {...e,...n}}bt();Pe();function Tz({content:t,clearSelection:e,history:n,setSlides:r,setTemplateElementsBySlideId:o,mediaDataUrls:i,setCanvasSize:s,setHeaderFooter:a,setLayoutOptions:l,setSlideMasters:c,setTheme:d,setTableStyleMap:u,setThemeOptions:p,setCustomShows:h,setSections:f,setPresentationProperties:m,setNotesMaster:x,setHandoutMaster:g,setNotesCanvasSize:y,setCustomProperties:b,setTagCollections:v,setCoreProperties:S,setAppProperties:w,setEmbeddedFonts:C,setActiveSlideIndex:T,setHasMacros:M,setHasDigitalSignatures:_,setDigitalSignatureCount:E,setGuides:R,setLoading:I,setError:L,setIsDirty:k,setIsEncrypted:F}){let N=Jm.useRef(null),D=Jm.useRef(null),U=Jm.useRef(0);return Jm.useEffect(()=>{if(!t)return;let G=false,j=++U.current,Y=[];return (async()=>{try{I(!0),L(null);let ge=t instanceof Uint8Array?t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength):t;D.current=ge instanceof ArrayBuffer?ge:null;let fe=ge instanceof ArrayBuffer?ge.byteLength/(1024*1024):0;fe>50&&console.warn(`[pptx] Large file detected (${fe.toFixed(1)} MB). Loading may use significant memory.`);let de=N.current,J=new Nd,re=await J.load(ge);if(G||j!==U.current){J.dispose();return}de&&de.dispose(),N.current=null;let ce=[];for(let W of re.slides)pA(W.elements,ce);for(let W of i.values())W.startsWith("blob:")&&URL.revokeObjectURL(W);i.clear(),await Promise.all(ce.map(async W=>{let q=W.mediaPath;if(!q){W.mediaMissing=!0;return}try{if(W.mediaType==="audio"||W.mediaType==="video"){let se=await J.getMediaArrayBuffer(q);if(se){let me=W.mediaMimeType||"application/octet-stream",P=new Blob([se],{type:me}),A=URL.createObjectURL(P);Y.push(A),i.set(q,A);}else W.mediaMissing=!0;}else {let se=await J.getImageData(q);se?i.set(q,se):W.mediaMissing=!0;}}catch{W.mediaMissing=!0;}}));let{paths:ae,refs:_e}=i4(re.slides),xe=re.slides;if(ae.size>0){let W=new Map;await Promise.all(Array.from(ae).map(async Q=>{try{let se=await J.getImageData(Q);se&&W.set(Q,se);}catch{}}));let q=new Map;for(let Q of _e){let se=W.get(Q.path);if(!se)continue;let me=Q.element.id,P=q.get(me)??{};P[Q.field]=se,q.set(me,P);}if(q.size>0){let Q=se=>{let me=!1,P=se.map(A=>{let O=A,z=q.get(A.id);if(z&&(O={...A,...z}),O.type==="group"&&O.children?.length){let te=Q(O.children);te!==O.children&&(O={...O,children:te});}return O!==A&&(me=!0),O});return me?P:se};xe=re.slides.map(se=>{let me=Q(se.elements);return me===se.elements?se:{...se,elements:me}});}}N.current=J;let Ee=Dre(xe);r(Ee.slides),o(Ee.templateElementsBySlideId),s({width:re.width??1280,height:re.height??720}),a(re.headerFooter??{}),l(re.layoutOptions??[]),c(re.slideMasters??[]),d(re.theme),u(re.tableStyleMap),p(re.themeOptions??[]),h(re.customShows??[]),f(re.sections??[]),m(re.presentationProperties??{}),x(re.notesMaster),g(re.handoutMaster),typeof re.notesWidthEmu=="number"&&typeof re.notesHeightEmu=="number"&&re.notesWidthEmu>0&&re.notesHeightEmu>0?y({width:Math.round(re.notesWidthEmu/9525),height:Math.round(re.notesHeightEmu/9525)}):y(void 0),b(re.customProperties??[]),v(re.tags??[]),S(re.coreProperties),w(re.appProperties),C(re.embeddedFonts??[]),M(re.hasMacros===!0),_(re.hasDigitalSignatures===!0),E(re.digitalSignatureCount??0),R(s4(re.presentationGuides,re.slides[0]?.guides)),T(0),e(),k(!1),n.resetHistory();}catch(ge){!G&&j===U.current&&(ge instanceof a_?F(true):L(ge instanceof Error?ge.message:String(ge)));}finally{!G&&j===U.current&&I(false);}})(),()=>{G=true;for(let ge of Y)URL.revokeObjectURL(ge);N.current&&(N.current.dispose(),N.current=null);}},[t]),{handlerRef:N}}Pe();function Ode(t){return Math.max(t,10)*1e3}function Cz(t){let{isDirty:e,filePath:n,serializeSlides:r,intervalSeconds:o=120,enabled:i=true}=t,[s,a]=Jm.useState({state:"idle"}),l=Jm.useRef(e),c=Jm.useRef(n),d=Jm.useRef(r),u=Jm.useRef(false);Jm.useEffect(()=>{l.current=e;},[e]),Jm.useEffect(()=>{c.current=n;},[n]),Jm.useEffect(()=>{d.current=r;},[r]);let p=Jm.useCallback(async()=>{if(c.current&&l.current&&!u.current){u.current=true,a({state:"saving"});try{let h=await d.current();if(!h){a({state:"idle"}),u.current=!1;return}await ire(c.current,h),a({state:"saved",timestamp:Date.now()});}catch(h){a({state:"error",message:h instanceof Error?h.message:"Autosave failed"});}finally{u.current=false;}}},[]);return Jm.useEffect(()=>{if(!i||!n)return;let h=Ode(o),f=setInterval(()=>{p();},h);return ()=>clearInterval(f)},[i,n,o,p]),{autosaveStatus:s,triggerAutosave:p}}bt();function Mz(t){let{activeSlide:e,activeSlideIndex:n,selectedElement:r,selectedElementId:o,editTemplateMode:i,templateElements:s,history:a,setSlides:l,setTemplateElementsBySlideId:c,setSelectedElementId:d,setSelectedElementIds:u,setInlineEditingElementId:p,setContextMenuState:h}=t,f=Jm.useCallback((T,M=[])=>{d(T),u(M);},[d,u]),m=Jm.useCallback(()=>{f(null,[]),p(null),h(null);},[f,p,h]),x=Jm.useCallback((T,M)=>{if(cT(T)){let _=e?.id;_&&c(E=>({...E,[_]:(E[_]??[]).map(R=>R.id===T?{...R,...M}:R)}));}else l(_=>_.map((E,R)=>R!==n?E:{...E,elements:E.elements.map(I=>I.id===T?{...I,...M}:I)}));a.markDirty();},[e?.id,n,a,l,c]),g=Jm.useCallback(T=>{o&&x(o,T);},[o,x]),y=Jm.useCallback(T=>{!r||!Jt(r)||g({shapeStyle:{...r.shapeStyle,...T}});},[r,g]),b=Jm.useCallback(T=>{if(!r||!ze(r))return;let M=pU(r.textSegments);if(M&&r.textSegments){let{newSegments:R,newSelection:I}=hU(r.textSegments,M,T);dU(I),g({textSegments:R});return}let _={...r.textStyle,...T},E=r.textSegments?.map(R=>({...R,style:{...R.style,...T}}));g({textStyle:_,textSegments:E});},[r,g]),v=Jm.useCallback(T=>{l(M=>T(M));},[l]),S=i?s:e?.elements??[],w=Jm.useCallback(T=>{if(i){let M=e?.id;if(!M)return;c(_=>({..._,[M]:T(_[M]??[])}));}else l(M=>M.map((_,E)=>E===n?{..._,elements:T(_.elements)}:_));},[i,e?.id,n,l,c]),C=Jm.useCallback(async()=>null,[]);return {applySelection:f,clearSelection:m,updateElementById:x,updateSelectedElement:g,updateSelectedShapeStyle:y,updateSelectedTextStyle:b,updateSlides:v,activeElements:S,updateActiveElements:w,serializeSlides:C}}Pe();function _z(t){let{sections:e,setSections:n,slides:r,setSlides:o,markDirty:i}=t,s=Jm.useCallback((p,h)=>{let f=vte(e,r,p,h);o(f.slides),n(f.sections),i();},[e,r,o,n,i]),a=Jm.useCallback((p,h)=>{let f=Ste(e,r,p,h);n(f.sections),o(f.slides),i();},[e,r,n,o,i]),l=Jm.useCallback(p=>{let h=wte(e,r,p);n(h.sections),o(h.slides),i();},[e,r,n,o,i]),c=Jm.useCallback(p=>{n(Tte(e,p)),i();},[e,n,i]),d=Jm.useCallback(p=>{n(Cte(e,p)),i();},[e,n,i]),u=Jm.useCallback((p,h)=>{let f=Mte(e,r,p,h);o(f.slides),n(f.sections),i();},[e,r,o,n,i]);return {addSection:s,renameSection:a,deleteSection:l,moveSectionUp:c,moveSectionDown:d,moveSlidesToSection:u}}Pe();function tet(t,e,n,r,o,i,s,a,l){let c=dte({x:e,y:n,width:r,height:o},t,i,s,1,{minSize:12}),d={x:c.x,y:c.y,width:c.width,height:c.height};return a?ute(d,t,l,12):d}function net(t,e,n){let o=e/(n||200);return Math.max(0,Math.min(1,t+o))}function Bde(t,e,n){let{editorScale:r,canvasStageRef:o,canvasSize:i,snapToGrid:s,snapToShape:a,gridSpacingPx:l,editTemplateMode:c,templateElements:d,activeSlide:u,guides:p,elementLookup:h,marqueeStateRef:f,dragStateRef:m,resizeStateRef:x,shapeAdjustmentDragStateRef:g,setMarqueeSelectionState:y,setSnapLines:b,updateElementById:v}=e,S=f.current;if(S){ret(t,S,o,i,r,y);return}let w=m.current;if(w){oet(t,w,r,s,a,l,c,d,u,p,h,n,b);return}let C=x.current;if(C){iet(t,C,r,s,l);return}let T=g.current;T&&set(t,T,r,v);}function ret(t,e,n,r,o,i){let s=n.current;if(!s)return;let a=s.getBoundingClientRect();e.currentX=Math.max(0,Math.min(r.width,(t.clientX-a.left)/o)),e.currentY=Math.max(0,Math.min(r.height,(t.clientY-a.top)/o)),i({...e});}function oet(t,e,n,r,o,i,s,a,l,c,d,u,p){let h=(t.clientX-e.startClientX)/n,f=(t.clientY-e.startClientY)/n;if(!e.moved&&(Math.abs(h)>2||Math.abs(f)>2)&&(e.moved=true),!e.moved)return;let m=h,x=f,g=Object.keys(e.startPositionsById),y=g[0],b=y?e.startPositionsById[y]:void 0,v=y?d.get(y):void 0;if(b&&v){let S=b.x+m,w=b.y+x;if(r&&(S=Math.round(S/i)*i,w=Math.round(w/i)*i),o){let T=(s?a:l?.elements??[]).map(R=>({id:R.id,x:R.x,y:R.y,width:R.width,height:R.height})),M=eU(S,w,v.width,v.height,T,new Set(g),c.map(R=>({axis:R.axis,position:R.position})));S=M.x,w=M.y;let _=M.lines.map(R=>({axis:R.axis==="v"?"x":"y",position:R.position})),E=JSON.stringify(_);E!==u.lastSnapLinesKey&&(u.lastSnapLinesKey=E,p(_));}else u.lastSnapLinesKey!=="[]"&&(u.lastSnapLinesKey="[]",p([]));m=S-b.x,x=w-b.y;}e.lastDx=m,e.lastDy=x;for(let[S,w]of e.domEls){let C=e.startPositionsById[S];C&&(w.style.left=`${C.x+m}px`,w.style.top=`${C.y+x}px`);}}function iet(t,e,n,r,o){let i=(t.clientX-e.startClientX)/n,s=(t.clientY-e.startClientY)/n;if(!e.moved&&(Math.abs(i)>2||Math.abs(s)>2)&&(e.moved=true),!e.moved)return;let a=tet(e.handle,e.startX,e.startY,e.startWidth,e.startHeight,i,s,r,o);e.lastX=a.x,e.lastY=a.y,e.lastWidth=a.width,e.lastHeight=a.height,e.domEl&&(e.domEl.style.left=`${a.x}px`,e.domEl.style.top=`${a.y}px`,e.domEl.style.width=`${Math.max(a.width,12)}px`,e.domEl.style.height=`${Math.max(a.height,12)}px`);}function set(t,e,n,r){let o=(t.clientX-e.startClientX)/n,i=net(e.startAdjustment,o,e.startWidth);!e.moved&&Math.abs(o)>2&&(e.moved=true),e.moved&&r(e.elementId,{shapeAdjustments:{[e.key]:i}});}Pe();function Ude(t){let{editTemplateMode:e,templateElements:n,activeSlide:r,activeSlideIndex:o,marqueeStateRef:i,dragStateRef:s,resizeStateRef:a,shapeAdjustmentDragStateRef:l,setMarqueeSelectionState:c,setSnapLines:d,setTemplateElementsBySlideId:u,setPointerCommitNonce:p,applySelection:h,clearSelection:f,updateSlides:m,updateElementById:x,markDirty:g}=t,y=i.current,b=s.current,v=a.current,S=l.current;if(y&&(aet(y,e,n,r,h,f),i.current=null,c(null)),b?.moved&&cet(b,e,r,o,u,m),v?.moved){let C=v.elementId,T={x:v.lastX,y:v.lastY,width:v.lastWidth,height:v.lastHeight};x(C,T);let M=new Set([C]);m(_=>_.map((E,R)=>{if(R!==o)return E;let I=zA(E.elements,M);return I.length===0?E:{...E,elements:VA(E.elements,I)}}));}let w=b?.moved||v?.moved||S?.moved;i.current=null,s.current=null,a.current=null,l.current=null,c(null),d([]),w&&(g(),p(C=>C+1));}function aet(t,e,n,r,o,i){let s=e?n:r?.elements??[],a=pte(t,s);if(t.additive){let l=hte(t.baseSelectionIds,a);l.length>0?o(l[0],l):i();}else a.length>0?o(a[0],a):i();}function cet(t,e,n,r,o,i){let s=t.lastDx,a=t.lastDy,l=new Set(Object.keys(t.startPositionsById)),c=d=>{let u=d.map(h=>{let f=t.startPositionsById[h.id];return f?{...h,x:f.x+s,y:f.y+a}:h}),p=zA(u,l);return VA(u,p)};if(e){let d=n?.id;if(!d)return;o(u=>({...u,[d]:c(u[d]??[])}));return}i(d=>d.map((u,p)=>p!==r?u:{...u,elements:c(u.elements)}));}function Pz(t){let{editorScale:e,canvasStageRef:n,canvasSize:r,activeSlide:o,activeSlideIndex:i,gridSpacingPx:s,dragStateRef:a,resizeStateRef:l,shapeAdjustmentDragStateRef:c,marqueeStateRef:d,editTemplateMode:u,snapToGrid:p,snapToShape:h,guides:f,templateElements:m,elementLookup:x,setMarqueeSelectionState:g,setSnapLines:y,setTemplateElementsBySlideId:b,setPointerCommitNonce:v,applySelection:S,clearSelection:w,updateSlides:C,updateElementById:T,markDirty:M}=t;Jm.useEffect(()=>{let _={rafId:0,pendingMoveEvent:null,lastSnapLinesKey:""},E=I=>{_.pendingMoveEvent=I,_.rafId===0&&(_.rafId=requestAnimationFrame(()=>{_.rafId=0,_.pendingMoveEvent&&(Bde(_.pendingMoveEvent,t,_),_.pendingMoveEvent=null);}));},R=()=>{_.rafId!==0&&(cancelAnimationFrame(_.rafId),_.rafId=0,_.pendingMoveEvent=null),Ude(t);};return document.addEventListener("pointermove",E),document.addEventListener("pointerup",R),()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",R),_.rafId!==0&&cancelAnimationFrame(_.rafId);}},[e,n,a,l,c,d,u,p,h,f,m,g,y,x,b,v,o,i,r.width,r.height,s,S,w,C,T,M,t]);}bt();Pe();function Ez(t){let{mode:e,canEdit:n,canvasSize:r,selectedElementId:o,selectedElementIds:i,selectedElementIdSet:s,inlineEditingElementId:a,effectiveSelectedIds:l,elementLookup:c,activeTool:d,editorScale:u,canvasStageRef:p,dragStateRef:h,resizeStateRef:f,shapeAdjustmentDragStateRef:m,marqueeStateRef:x,setInlineEditingElementId:g,setInlineEditingText:y,setContextMenuState:b,setMarqueeSelectionState:v,setSnapLines:S,inlineEditingText:w,ops:C,history:T,presentationHandleAction:M,setEditingEquationOmml:_,setIsEquationDialogOpen:E}=t,R=Jm.useRef(false),I=()=>{let de=a;if(!de)return;let J=c.get(de);if(J&&ze(J)){let re=gT(w,J.textSegments,J.textStyle);C.updateElementById(de,{text:w,textSegments:re}),T.markDirty();}g(null),y("");},L=de=>{if(!ze(de))return false;let J=de.textSegments?.find(re=>re.equationXml);return J?.equationXml?(_(J.equationXml),E(true),true):false};return {handleElementClick:(de,J)=>{if(J.stopPropagation(),e==="present"){let re=c.get(de);re?.actionClick&&M(re.actionClick);return}if(J.shiftKey||J.metaKey){let re=i.length?i:o?[o]:[],ce=re.includes(de)?re.filter(ae=>ae!==de):[...re,de];C.applySelection(ce[0]??null,ce);}else if(s.has(de)&&!a)if(R.current)R.current=false;else {let re=c.get(de);re&&ze(re)&&!re.locks?.noTextEdit&&(L(re)||(g(de),y(re.text??"")));}else C.applySelection(de);},handleElementDoubleClick:(de,J)=>{let re=c.get(de);re&&(L(re)||ze(re)&&(g(de),y(re.text??"")));},handleElementMouseDown:(de,J)=>{if(J.button!==0)return;a&&a!==de&&I();let re=s.has(de);re?R.current=false:(C.applySelection(de),R.current=true);let ce=re?l.length?l:[de]:[de],ae={},_e=new Map;for(let xe of ce){let Ee=c.get(xe);Ee&&(ae[xe]={x:Ee.x,y:Ee.y});let W=document.querySelector(`[data-element-id="${xe}"]`);W&&_e.set(xe,W);}h.current={elementId:de,startClientX:J.clientX,startClientY:J.clientY,startPositionsById:ae,domEls:_e,moved:false,lastDx:0,lastDy:0},S([]);},handleElementContextMenu:(de,J)=>{J.preventDefault(),J.stopPropagation(),s.has(de)||C.applySelection(de),b({x:J.clientX,y:J.clientY,elementId:de});},handleCanvasMouseDown:de=>{if(e!=="edit"||!n||de.button!==0||d!=="select")return;a&&I();let J=p.current;if(!J)return;let re=J.getBoundingClientRect(),ce=u||1,ae=Math.max(0,Math.min(r.width,(de.clientX-re.left)/ce)),_e=Math.max(0,Math.min(r.height,(de.clientY-re.top)/ce)),xe=de.shiftKey||de.metaKey,Ee={startX:ae,startY:_e,currentX:ae,currentY:_e,additive:xe,baseSelectionIds:xe?l:[]};x.current=Ee,v(Ee),b(null);},handleResizePointerDown:(de,J,re)=>{J.stopPropagation();let ce=c.get(de);ce&&(f.current={elementId:de,startClientX:J.clientX,startClientY:J.clientY,startX:ce.x,startY:ce.y,startWidth:ce.width,startHeight:ce.height,handle:re,moved:false,domEl:document.querySelector(`[data-element-id="${de}"]`),lastX:ce.x,lastY:ce.y,lastWidth:ce.width,lastHeight:ce.height});},handleAdjustmentPointerDown:(de,J)=>{J.stopPropagation();let re=c.get(de);if(!re||!("shapeType"in re)||!("shapeAdjustments"in re))return;let ce=Object.entries(re.shapeAdjustments??{});if(!ce.length)return;let[ae,_e]=ce[0];m.current={elementId:de,key:ae,shapeType:re.shapeType??"rect",startClientX:J.clientX,startClientY:J.clientY,startAdjustment:_e,startWidth:re.width,startHeight:re.height,moved:false};},handleRotate:(de,J)=>{let re=c.get(de);!re||re.locks?.noRotation||(C.updateElementById(de,{rotation:J}),T.markDirty());},handleUpdateSmartArtElement:(de,J)=>{c.has(de)&&C.updateElementById(de,J);},handleFormatText:de=>{C.updateSelectedTextStyle(de);},handleInlineEditCommit:I}}Pe();function $de(t){let{activeSlide:e,canvasSize:n,addElement:r}=t;return {handleImageFileChange:s=>{let a=s.target.files?.[0];if(!a||!e)return;s.target.value="";let l=new FileReader;l.onload=()=>{let c=l.result;if(!c)return;let d=new Image;d.onload=()=>{let h=d.naturalWidth||400,f=d.naturalHeight||300;if(h>500||f>400){let m=Math.min(500/h,400/f);h=Math.round(h*m),f=Math.round(f*m);}r({id:Pr(),type:"image",x:Math.round((n.width-h)/2),y:Math.round((n.height-f)/2),width:h,height:f,imageData:c});},d.onerror=()=>{r({id:Pr(),type:"image",x:100,y:100,width:400,height:300,imageData:c});},d.src=c;},l.readAsDataURL(a);},handleMediaFileChange:s=>{let a=s.target.files?.[0];if(!a||!e)return;s.target.value="";let l=a.type.startsWith("audio/")?"audio":a.type.startsWith("video/")?"video":null;if(!l)return;let c=a.path,d=(p,h,f)=>{r({id:Pr(),type:"media",mediaType:l,mediaMimeType:a.type||void 0,mediaData:p,x:Math.round((n.width-h)/2),y:Math.round((n.height-f)/2),width:h,height:f});};if(c){let p=c.replace(/\\/gu,"/");p.startsWith("/")||(p=`/${p}`);let h=`pptx-resource://media${encodeURI(p)}`;if(l==="audio"){d(h,420,64);return}let f=URL.createObjectURL(a),m=document.createElement("video");m.preload="metadata",m.onloadedmetadata=()=>{URL.revokeObjectURL(f);let x=640,g=360,y=m.videoWidth||x,b=m.videoHeight||g;if(y>x||b>g){let v=Math.min(x/y,g/b);y=Math.round(y*v),b=Math.round(b*v);}d(h,y,b);},m.onerror=()=>{URL.revokeObjectURL(f),d(h,640,360);},m.src=f;return}let u=new FileReader;u.onload=()=>{let p=u.result;if(!p)return;if(l==="audio"){d(p,420,64);return}let h=document.createElement("video");h.preload="metadata",h.onloadedmetadata=()=>{let x=h.videoWidth||640,g=h.videoHeight||360;if(x>640||g>360){let y=Math.min(640/x,360/g);x=Math.round(x*y),g=Math.round(g*y);}d(p,x,g);},h.onerror=()=>{d(p,640,360);},h.src=p;},u.readAsDataURL(a);}}}bt();var tN={"ppaction://hlinkshowjump?jump=nextslide":"nextSlide","ppaction://hlinkshowjump?jump=previousslide":"prevSlide","ppaction://hlinkshowjump?jump=firstslide":"firstSlide","ppaction://hlinkshowjump?jump=lastslide":"lastSlide","ppaction://hlinkshowjump?jump=endshow":"endShow"},Hde={nextSlide:"ppaction://hlinkshowjump?jump=nextslide",prevSlide:"ppaction://hlinkshowjump?jump=previousslide",firstSlide:"ppaction://hlinkshowjump?jump=firstslide",lastSlide:"ppaction://hlinkshowjump?jump=lastslide",endShow:"ppaction://hlinkshowjump?jump=endshow"};function zde(t,e){return e&&e.startsWith("ppaction://")?e.includes("hlinksldjump")?"slide":(tN[e.toLowerCase()],"action"):t?t.startsWith("mailto:")?"email":/^[a-zA-Z]:\\|^\.\.?[/\\]|^file:/i.test(t)?"file":"url":"url"}function Vde(t){if(!t.startsWith("mailto:"))return {address:t,subject:""};let e=t.slice(7),n=e.indexOf("?");if(n<0)return {address:e,subject:""};let r=e.slice(0,n),o=new URLSearchParams(e.slice(n+1));return {address:r,subject:o.get("subject")||""}}function Gde(t,e){if(e==="ppaction://hlinksldjump"&&t){let n=t.match(/slide(\d+)\.xml$/i);if(n)return parseInt(n[1],10)}if(t){let n=t.match(/#\s*Slide\s+(\d+)/i);if(n)return parseInt(n[1],10)}return 1}function Wde(t){let e=t.tooltip.trim()||void 0;switch(t.targetType){case "email":return {url:t.emailSubject?`mailto:${t.emailAddress}?subject=${encodeURIComponent(t.emailSubject)}`:`mailto:${t.emailAddress}`,tooltip:e};case "slide":return {url:`slide${t.slideNumber}.xml`,action:"ppaction://hlinksldjump",tooltip:e};case "file":return {url:t.filePath,tooltip:e};case "action":return {url:"",action:Hde[t.actionVerb],tooltip:e};default:return {url:t.url,tooltip:e}}}function Xde(t){let{activeSlide:e,activeSlideIndex:n,selectedElements:r,ops:o,history:i,addElement:s}=t;return {handleInsertSmartArt:(h,f)=>{if(!e)return;let m=f.map((g,y)=>`node-${Date.now()}-${y}-${Math.random().toString(36).slice(2,8)}`),x=f.map((g,y)=>{let b={id:m[y],text:g};return h==="hierarchy"&&y>0&&(b.parentId=m[0]),b});s({id:Pr(),type:"smartArt",x:100,y:120,width:600,height:340,smartArtData:{layout:h,colorScheme:"colorful1",style:"flat",nodes:x}});},handleInsertEquation:h=>{e&&s({id:Pr(),type:"shape",x:120,y:200,width:400,height:80,text:"[Equation]",textStyle:{fontSize:18,fontFamily:"Cambria Math"},textSegments:[{text:"[Equation]",style:{fontSize:18,fontFamily:"Cambria Math"},equationXml:h}]});},handleUpdateEquation:h=>{let f=r[0];if(!f)return;let m=[{text:"[Equation]",style:{fontSize:18,fontFamily:"Cambria Math"},equationXml:h}];o.updateElementById(f.id,{textSegments:m}),i.markDirty();},handleHyperlinkConfirm:h=>{let f=r[0];if(!f)return;let m=Wde(h),x={url:m.url||void 0,action:m.action,tooltip:m.tooltip};o.updateElementById(f.id,{actionClick:x}),i.markDirty();},handleInsertField:(h,f)=>{if(!e)return;let m={slidenum:String(n+1),datetime:new Date().toLocaleDateString(),header:"Header",footer:"Footer"},x=f||m[h]||h,g=`{${crypto.randomUUID().toUpperCase()}}`;s({id:Pr(),type:"shape",x:120,y:200,width:200,height:40,text:x,textStyle:{fontSize:14},textSegments:[{text:x,style:{fontSize:14},fieldType:h,fieldGuid:g}]});},handleAddActionButton:h=>{if(!e)return;let f=sh.find(x=>x.shapeType===h);if(!f)return;let m=aS({type:f.defaultAction});m&&(m.tooltip=f.label,m.highlightClick=true),s({id:Pr(),type:"shape",x:150,y:150,width:120,height:50,shapeType:f.shapeType,text:f.label,textStyle:{fontSize:11,fontColor:"#FFFFFF",align:"center",verticalAlign:"middle"},textSegments:[{text:f.label,style:{fontSize:11,fontColor:"#FFFFFF",bold:true}}],shapeStyle:{fillColor:"#4472C4",strokeColor:"#2F5597",strokeWidth:1},actionClick:m});}}}function Rz(t){let{activeSlide:e,activeSlideIndex:n,canvasSize:r,newShapeType:o,selectedElements:i,ops:s,history:a}=t,l=y=>{s.updateSlides(b=>b.map((v,S)=>S===n?{...v,elements:[...v.elements,y]}:v)),s.applySelection(y.id),a.markDirty();},c=()=>{e&&l({id:Pr(),type:"text",x:100,y:100,width:300,height:60,text:"",textStyle:{fontSize:24}});},d=()=>{e&&l({id:Pr(),type:"shape",x:150,y:150,width:200,height:150,shapeType:o,shapeStyle:{fillColor:"#3b82f6",strokeColor:"#1f2937",strokeWidth:2}});},u=()=>{if(!e)return;let y=Array.from({length:3},()=>({cells:Array.from({length:3},()=>({text:"",style:{}}))})),b=Array.from({length:3},()=>1/3);l({id:Pr(),type:"table",x:100,y:200,width:600,height:250,tableData:{rows:y,columnWidths:b}});},p=y=>{e&&l(ere(y));},h=Xde({activeSlide:e,activeSlideIndex:n,selectedElements:i,ops:s,history:a,addElement:l}),f=$de({activeSlide:e,canvasSize:r,addElement:l});return {handleAddTextBox:c,handleAddShape:d,handleAddTable:u,handleAddChart:p,...h,handleAddInkElement:y=>{e&&(s.updateSlides(b=>b.map((v,S)=>S===n?{...v,elements:[...v.elements,y]}:v)),a.markDirty());},handleAddFreeformShape:y=>{e&&l(y);},handleEraseInkElement:y=>{e&&(s.updateSlides(b=>b.map((v,S)=>S===n?{...v,elements:v.elements.filter(w=>w.id!==y)}:v)),a.markDirty());},...f}}function jde(t){let{activeSlide:e,selectedElement:n,effectiveSelectedIds:r,editTemplateMode:o,clipboardPayload:i,setClipboardPayload:s,ops:a,history:l}=t,c=()=>{n&&s({element:structuredClone(n),isTemplate:o});},d=()=>{let f=r;if(!f.length||!e)return;let m=new Set(f);a.updateActiveElements(x=>x.filter(g=>!m.has(g.id))),a.clearSelection(),l.markDirty();};return {handleCopy:c,handleCut:()=>{c(),d();},handlePaste:()=>{if(!i||!e)return;let f=structuredClone(i.element);f.id=AT(o,i.element.id),f.x+=20,f.y+=20,a.updateActiveElements(m=>[...m,f]),a.applySelection(f.id),l.markDirty();},handleDuplicate:()=>{if(!n||!e)return;let f=structuredClone(n);f.id=AT(o,n.id),f.x+=20,f.y+=20,a.updateActiveElements(m=>[...m,f]),a.applySelection(f.id),l.markDirty();},handleDelete:d}}Pe();bt();function het(t){return t.type==="shape"||t.type==="image"||t.type==="picture"}function fet(t){if("pathData"in t&&typeof t.pathData=="string"&&t.pathData)return t.pathData;if("shapeType"in t&&typeof t.shapeType=="string"){let e=mS(t.shapeType);if(e){let n=met(e,t.width,t.height);if(n)return n}}return `M 0 0 L ${t.width} 0 L ${t.width} ${t.height} L 0 ${t.height} Z`}function met(t,e,n){let r=t.match(/polygon\((?<points>[^)]+)\)/iu);if(!r?.groups)return null;let o=r.groups.points.split(",").map(a=>a.trim()),i=[];for(let a of o){let l=a.split(/\s+/u);if(l.length<2)continue;let c=l[0],d=l[1],u,p;c.endsWith("%")?u=parseFloat(c)/100*e:u=parseFloat(c),d.endsWith("%")?p=parseFloat(d)/100*n:p=parseFloat(d),!isNaN(u)&&!isNaN(p)&&i.push({x:u,y:p});}if(i.length<3)return null;let s=[`M ${i[0].x} ${i[0].y}`];for(let a=1;a<i.length;a++)s.push(`L ${i[a].x} ${i[a].y}`);return s.push("Z"),s.join(" ")}function get(t,e){let n=ni(t);if(n.length===0)return t;let r=e.width,o=e.height;"pathWidth"in e&&typeof e.pathWidth=="number"&&(r=e.pathWidth),"pathHeight"in e&&typeof e.pathHeight=="number"&&(o=e.pathHeight);let i=r>0?e.width/r:1,s=o>0?e.height/o:1,a=n.map(l=>l.map(c=>({x:c.x*i+e.x,y:c.y*s+e.y})));return qs(a)}function Yde(t,e,n,r,o){let i=ni(t);if(i.length===0)return t;let s=i.map(a=>a.map(l=>({x:l.x-e,y:l.y-n})));return qs(s)}function Kde(t){let e=ni(t),n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e)for(let a of s)a.x<n&&(n=a.x),a.y<r&&(r=a.y),a.x>o&&(o=a.x),a.y>i&&(i=a.y);return isFinite(n)?{x:n,y:r,width:o-n,height:i-r}:{x:0,y:0,width:0,height:0}}function qde(t){let{activeSlide:e,activeSlideIndex:n,selectedElements:r,effectiveSelectedIds:o,setSelectedElementIds:i,ops:s,history:a}=t,l=r.filter(het),c=l.length>=2;return {handleMergeShapes:u=>{if(!c||!e)return;let p=l;if(p.length<2)return;let h=p.map(f=>{let m=fet(f);return get(m,f)});if(u==="fragment"){let f=[],m=h[0];for(let y=1;y<h.length;y++){let b=__("fragment",m,h[y]);Array.isArray(b)&&(f=b),y<h.length-1&&f.length>0&&(m=f[0]);}if(f.length===0)return;let x=new Set(o),g=[];for(let y of f){if(!y)continue;let b=Kde(y);if(b.width<=0||b.height<=0)continue;let v=Yde(y,b.x,b.y),S={id:Pr(),type:"shape",x:b.x,y:b.y,width:b.width,height:b.height,rotation:0,flipHorizontal:false,flipVertical:false,hidden:false,opacity:p[0].opacity??1,rawXml:{},shapeStyle:{...p[0].shapeStyle},shapeType:"custGeom",pathData:v,pathWidth:b.width,pathHeight:b.height};g.push(S);}if(g.length===0)return;s.updateSlides(y=>y.map((b,v)=>v===n?{...b,elements:[...b.elements.filter(S=>!x.has(S.id)),...g]}:b)),i(g.map(y=>y.id)),a.markDirty();}else {let f=h[0];for(let v=1;v<h.length;v++){let S=__(u,f,h[v]);typeof S=="string"&&(f=S);}if(!f)return;let m=Kde(f);if(m.width<=0||m.height<=0)return;let x=Yde(f,m.x,m.y),g=p[0],y={id:Pr(),type:"shape",x:m.x,y:m.y,width:m.width,height:m.height,rotation:0,flipHorizontal:false,flipVertical:false,hidden:false,opacity:g.opacity??1,rawXml:{},shapeStyle:{...g.shapeStyle},shapeType:"custGeom",pathData:x,pathWidth:m.width,pathHeight:m.height},b=new Set(o);s.updateSlides(v=>v.map((S,w)=>w===n?{...S,elements:[...S.elements.filter(C=>!b.has(C.id)),y]}:S)),s.applySelection(y.id),a.markDirty();}},canMergeShapes:c}}var xet={left:"left",center:"centerH",right:"right",top:"top",middle:"middle",bottom:"bottom"};function Zde(t){let{activeSlide:e,activeSlideIndex:n,selectedElement:r,effectiveSelectedIds:o,selectedElements:i,elementLookup:s,setSelectedElementIds:a,ops:l,history:c}=t,d=()=>{let v=o;if(v.length<2||!e)return;let{elements:S,groupId:w}=fte(l.activeElements,v,Pr());w!==null&&(l.updateActiveElements(()=>S),l.applySelection(w),c.markDirty());},u=()=>{if(!r||r.type!=="group"||!e)return;let v=r,S=cT(v.id),w=v.children.map(C=>({...structuredClone(C),id:S?AT(true,C.id||v.id):C.id||Pr(),x:C.x+v.x,y:C.y+v.y}));l.updateActiveElements(C=>[...C.filter(T=>T.id!==v.id),...w]),a(w.map(C=>C.id)),c.markDirty();},p=v=>{if(!r)return;let S=v==="horizontal"?{flipHorizontal:!r.flipHorizontal}:{flipVertical:!r.flipVertical};l.updateSelectedElement(S),c.markDirty();},h=v=>{if(i.length<2)return;let S=xet[v];if(!S)return;let w=lte(i,S);for(let[C,T]of w){let M=s.get(C);M&&l.updateElementById(C,{x:T.x??M.x,y:T.y??M.y});}c.markDirty();},f=v=>{if(i.length<3)return;let S=v==="horizontal"||v==="vertical"?v:null;if(!S)return;let w=cte(i,S);for(let[C,T]of w){let M=s.get(C);M&&l.updateElementById(C,{x:T.x??M.x,y:T.y??M.y});}c.markDirty();},m=i.length>=3,x=v=>{if(!r||!e)return;let S=r.id;l.updateActiveElements(w=>v==="forward"?xte(w,S):v==="backward"?yte(w,S):w),c.markDirty();},g=v=>{if(!r||!e)return;let S=r.id;l.updateActiveElements(w=>v==="front"?mte(w,S):gte(w,S)),c.markDirty();},{handleMergeShapes:y,canMergeShapes:b}=qde({activeSlide:e,activeSlideIndex:n,selectedElements:i,effectiveSelectedIds:o,setSelectedElementIds:a,ops:l,history:c});return {handleGroupElements:d,handleUngroupElement:u,handleFlip:p,handleAlignElements:h,handleDistributeElements:f,canDistribute:m,handleMoveLayer:x,handleMoveLayerToEdge:g,handleMergeShapes:y,canMergeShapes:b}}function kz(t){let{setIsInspectorPaneOpen:e,setSidebarPanelMode:n,onOpenHyperlinkDialog:r}=t,{handleCopy:o,handleCut:i,handlePaste:s,handleDuplicate:a,handleDelete:l}=jde(t),{handleGroupElements:c,handleUngroupElement:d,handleFlip:u,handleAlignElements:p,handleDistributeElements:h,canDistribute:f,handleMoveLayer:m,handleMoveLayerToEdge:x,handleMergeShapes:g,canMergeShapes:y}=Zde(t);return {handleCopy:o,handleCut:i,handlePaste:s,handleDuplicate:a,handleGroupElements:c,handleUngroupElement:d,handleDelete:l,handleFlip:u,handleAlignElements:p,handleDistributeElements:h,canDistribute:f,handleMoveLayer:m,handleMoveLayerToEdge:x,handleMergeShapes:g,canMergeShapes:y,handleContextMenuAction:v=>{switch(v){case "copy":o();break;case "cut":i();break;case "paste":s();break;case "duplicate":a();break;case "delete":l();break;case "bring-forward":case "bringForward":m("forward");break;case "send-backward":case "sendBackward":m("backward");break;case "bring-front":case "bringToFront":x("front");break;case "send-back":case "sendToBack":x("back");break;case "comment":case "addComment":e(true),n("comments");break;case "group":c();break;case "ungroup":d();break;case "editHyperlink":r();break}}}}Pe();function yet(t,e,n){let r=[...t],o=Math.max(0,Math.min(e+1,r.length));return r.splice(o,0,n),r}function Iz(t){let{slides:e,activeSlideIndex:n,setActiveSlideIndex:r,ops:o,history:i,handlerRef:s}=t;return {handleAddSlide:()=>{let f=Q4(e.length+1);o.updateSlides(m=>{let x=[...m];return x.splice(n+1,0,f),x}),r(n+1),i.markDirty();},handleMoveSlide:(f,m)=>{f!==m&&(o.updateSlides(x=>{let g=[...x],[y]=g.splice(f,1);return g.splice(m,0,y),g}),r(m),i.markDirty());},handleSlideContextMenu:(f,m)=>{},handleDeleteSlides:f=>{if(f.length===0||e.length<=1)return;let m=[...f].sort((g,y)=>y-g);o.updateSlides(g=>{let y=[...g];for(let b of m)y.length>1&&y.splice(b,1);return y});let x=Math.min(...f);r(Math.min(x,e.length-f.length-1,Math.max(e.length-f.length-1,0))),i.markDirty();},handleDuplicateSlides:f=>{if(f.length===0)return;let m=[...f].sort((x,g)=>x-g);o.updateSlides(x=>{let g=[...x],y=0;for(let b of m){let v=g[b+y];if(!v)continue;let S={...v,id:J4(),elements:v.elements.map(w=>({...w,id:`${w.id}-dup-${Math.random().toString(36).slice(2,6)}`}))};g.splice(b+y+1,0,S),y++;}return g}),i.markDirty();},handleToggleHideSlides:f=>{f.length!==0&&(o.updateSlides(m=>{let x=[...m];for(let g of f){let y=x[g];y&&(x[g]={...y,hidden:!y.hidden});}return x}),i.markDirty());},handleInsertSlideFromLayout:(f,m)=>{let x=n+1,g={...Q4(e.length+1),layoutPath:f,...m?{layoutName:m}:{}},y=[];o.updateSlides(v=>(y=yet(v,n,g),y)),r(x),i.markDirty();let b=s?.current;b&&b.applyLayoutToSlide(x,f,y).then(v=>{o.updateSlides(S=>{if(S[x]?.id!==g.id)return S;let w=[...S];return w[x]=v,w});},()=>{});}}}function Jde(t){let{selectedElement:e,tableEditorState:n,setTableEditorState:r,ops:o,history:i}=t;return {handleMergeCellRight:()=>{if(!e||e.type!=="table"||!e.tableData||!n)return;let{rowIndex:d,columnIndex:u}=n,p=e.tableData,h=p.rows[d]?.cells[u];if(!h)return;let f=Math.max(1,h.gridSpan??1),m=u+f,x=p.rows[d]?.cells[m];if(!x||x.hMerge||x.vMerge)return;let g=Ly([{row:d,col:u},{row:d,col:m}],p),y={tableData:g},b=Sp(e,g);b&&(y.rawXml=b),o.updateSelectedElement(y),i.markDirty();},handleMergeCellDown:()=>{if(!e||e.type!=="table"||!e.tableData||!n)return;let{rowIndex:d,columnIndex:u}=n,p=e.tableData,h=p.rows[d]?.cells[u];if(!h)return;let f=Math.max(1,h.rowSpan??1),m=d+f;if(m>=p.rows.length)return;let x=p.rows[m]?.cells[u];if(!x||x.hMerge||x.vMerge)return;let g=Ly([{row:d,col:u},{row:m,col:u}],p),y={tableData:g},b=Sp(e,g);b&&(y.rawXml=b),o.updateSelectedElement(y),i.markDirty();},handleMergeSelectedCells:()=>{if(!e||e.type!=="table"||!e.tableData||!n||!n.selectedCells||n.selectedCells.length<2)return;let d=e.tableData,u=Ly(n.selectedCells,d),p={tableData:u},h=Sp(e,u);h&&(p.rawXml=h),o.updateSelectedElement(p),r({rowIndex:n.rowIndex,columnIndex:n.columnIndex}),i.markDirty();},handleSplitCell:()=>{if(!e||e.type!=="table"||!e.tableData||!n)return;let{rowIndex:d,columnIndex:u}=n,p=e.tableData,h=IA(d,u,p),f={tableData:h},m=Sp(e,h);m&&(f.rawXml=m),o.updateSelectedElement(f),i.markDirty();}}}Pe();function Qde(t){let{selectedElement:e,tableEditorState:n,elementLookup:r,setTableEditorState:o,ops:i,history:s}=t;return {handleCommitCellEdit:(m,x,g,y)=>{let b=r.get(m);if(!b||b.type!=="table")return;let v={};if(b.tableData){let S=b.tableData.rows.map((w,C)=>C!==x?w:{...w,cells:w.cells.map((T,M)=>M!==g?T:{...T,text:y})});v.tableData={...b.tableData,rows:S};}if(b.rawXml){let S=uS(b,x,g,y);S&&(v.rawXml=S);}Object.keys(v).length!==0&&(i.updateElementById(m,v),s.markDirty(),o({rowIndex:x,columnIndex:g,elementId:m}));},handleUpdateCellTextStyle:m=>{if(!e||e.type!=="table"||!n)return;let x=e.id,{rowIndex:g,columnIndex:y}=n,b={};if(e.rawXml){let v=pS(e,g,y,m);v&&(b.rawXml=v);}if(e.tableData){let v=e.tableData.rows.map((S,w)=>w!==g?S:{...S,cells:S.cells.map((C,T)=>T!==y?C:{...C,style:{...C.style,...m}})});b.tableData={...e.tableData,rows:v};}Object.keys(b).length!==0&&(i.updateElementById(x,b),s.markDirty());},handleResizeTableColumns:(m,x)=>{let g=r.get(m);!g||g.type!=="table"||!g.tableData||(i.updateElementById(m,{tableData:{...g.tableData,columnWidths:x}}),s.markDirty());},handleResizeTableRow:(m,x,g)=>{let y=r.get(m);if(!y||y.type!=="table"||!y.tableData)return;let b=y.tableData.rows.map((v,S)=>S===x?{...v,height:g}:v);i.updateElementById(m,{tableData:{...y.tableData,rows:b}}),s.markDirty();},handleInsertTableRow:m=>{if(!e||e.type!=="table"||!e.tableData)return;let x=n?.rowIndex??0,g=Yee(e.tableData,x,m),y={tableData:g},b=wp(e,g);b&&(y.rawXml=b),i.updateSelectedElement(y),s.markDirty();},handleDeleteTableRow:()=>{if(!e||e.type!=="table"||!e.tableData)return;let m=e.tableData,x=n?.rowIndex??0,g=Kee(m,x);if(g===m)return;let y={tableData:g},b=wp(e,g);b&&(y.rawXml=b),i.updateSelectedElement(y),s.markDirty();},handleInsertTableColumn:m=>{if(!e||e.type!=="table"||!e.tableData)return;let x=n?.columnIndex??0,g=Zee(e.tableData,x,m),y={tableData:g},b=wp(e,g);b&&(y.rawXml=b),i.updateSelectedElement(y),s.markDirty();},handleDeleteTableColumn:()=>{if(!e||e.type!=="table"||!e.tableData)return;let m=e.tableData,x=n?.columnIndex??0,g=Jee(m,x);if(g===m)return;let y={tableData:g},b=wp(e,g);b&&(y.rawXml=b),i.updateSelectedElement(y),s.markDirty();}}}function Nz(t){let e=Qde(t),n=Jde(t);return {...e,...n}}Pe();Pe();function u2(t){return t.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#39;")}function Lz(t,e){try{return window.prompt(t,e)}catch{return null}}function eue(t){try{return window.confirm(t)}catch{return false}}function nN(t,e){ru(t,are(e));}Pe();Pe();async function Dz(t,e={}){let n=e.onclone;return bet__default.default(t,{...e,onclone:async(r,o)=>{await yre(r,o),yR(o),typeof n=="function"&&n(r,o);}})}async function Bu(t,e=2,n){return await Dz(t,{scale:e,useCORS:true,allowTaint:true,backgroundColor:n??null,logging:false,ignoreElements:o=>{let i=o;return !!(i.dataset?.exportIgnore==="true"||i.classList?.contains("pointer-events-none")&&(i.classList.contains("z-50")||i.classList.contains("z-[60]")))}})}function Bh(t=100){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(e,t);});});})}async function Fz(t,e={}){let{scale:n=2,backgroundColor:r}=e,o=await Bu(t,n,r);return new Promise((i,s)=>{o.toBlob(a=>{a?i(a):s(new Error("Canvas toBlob returned null"));},"image/png");})}async function Oz(t,e,n={}){let r=await Fz(t,n);ru(r,`slide-${e+1}.png`);}async function Bz(t,e={}){let n=await Fz(t,e);await navigator.clipboard.write([new ClipboardItem({"image/png":n})]);}async function Uz(t,e,n,r,o="presentation.pdf",i={}){let{scale:s=2,onProgress:a,signal:l}=i,c=[];for(let u=0;u<e;u++){if(l?.aborted)throw new DOMException("Export cancelled","AbortError");a?.(u,e),n(u),await Bh(150);let p=t.current;if(!p){console.warn(`[export] Could not find slide stage element for slide ${u}`);continue}let h=await Bu(p,s);c.push(aR(h));}if(a?.(e,e),n(r),c.length===0)throw new Error("No slides were captured for PDF export");let d=i6(c);sR(d,o);}async function $z(t,e,n,r,o={}){let{scale:i=2,onProgress:s}=o,a=[];for(let l=0;l<e;l++){s?.(l,e),n(l),await Bh(150);let c=t.current;if(!c){console.warn(`[export] Could not find slide stage element for slide ${l}`);continue}let d=await Bu(c,i);a.push(d.toDataURL("image/png"));}return s?.(e,e),n(r),a}async function Hz(t,e,n,r,o,i="presentation-notes.pdf",s={}){let{scale:a=2,onProgress:l,signal:c}=s,d=[];for(let p=0;p<e;p++){if(c?.aborted)throw new DOMException("Export cancelled","AbortError");l?.(p,e),n(p),await Bh(150);let h=t.current;if(!h){console.warn(`[export] Could not find slide stage element for slide ${p}`);continue}let f=await Bu(h,a);d.push({canvas:f,notes:o[p],slideNumber:p+1});}if(l?.(e,e),n(r),d.length===0)throw new Error("No slides were captured for notes PDF export");let u=XR(d);sR(u,i);}Pe();async function zz(t,e,n,r,o={}){let{scale:i=1,slideDurationMs:s=3e3,slideTimingsMs:a,onProgress:l,onRecordProgress:c,signal:d}=o,u=[];for(let v=0;v<e;v++){if(d?.aborted)throw new DOMException("Export cancelled","AbortError");l?.(v,e),n(v),await Bh(150);let S=t.current;if(!S){console.warn(`[export] Could not find slide stage element for slide ${v}`);continue}let w=await Bu(S,i);u.push(w);}if(n(r),u.length===0)throw new Error("No slides were captured for video export");let p=u[0],h=document.createElement("canvas");h.width=p.width,h.height=p.height;let f=h.getContext("2d");if(!f)throw new Error("Failed to create 2D context for video recording");let m=30,x=h.captureStream(m),g=new MediaRecorder(x,{mimeType:Tre([...wre]),videoBitsPerSecond:5e6}),y=[];g.ondataavailable=v=>{v.data.size>0&&y.push(v.data);};let b=new Promise((v,S)=>{g.onstop=()=>v(),g.onerror=w=>S(w);});g.start();for(let v=0;v<u.length;v++){if(d?.aborted)throw g.stop(),new DOMException("Export cancelled","AbortError");c?.(v,u.length);let S=a?.[v]??s;f.clearRect(0,0,h.width,h.height),f.drawImage(u[v],0,0);let w=Cre(m),C=Mre(S,m);for(let T=0;T<C;T++){if(d?.aborted)throw g.stop(),new DOMException("Export cancelled","AbortError");f.drawImage(u[v],0,0),await new Promise(M=>{setTimeout(M,w);});}}return g.stop(),await b,l?.(e,e),new Blob(y,{type:"video/webm"})}Pe();async function Vz(t,e,n,r,o={}){let{scale:i=.5,slideDurationMs:s=2e3,onProgress:a,signal:l}=o,c=[];for(let p=0;p<e;p++){if(l?.aborted)throw new DOMException("Export cancelled","AbortError");a?.(p,e),n(p),await Bh(150);let h=t.current;if(!h)continue;let f=await Bu(h,i),m=f.getContext("2d");if(!m)continue;let x=m.getImageData(0,0,f.width,f.height);c.push({imageData:x,width:f.width,height:f.height});}if(n(r),c.length===0)throw new Error("No slides were captured for GIF export");let d=t$(c,Math.round(s/10));a?.(e,e);let u=new ArrayBuffer(d.length);return new Uint8Array(u).set(d),new Blob([u],{type:"image/gif"})}function Gz(t){return ["Presentation Package","====================","",`This folder contains the presentation "${t}" along with`,"all linked media files (images, audio, video) in the /media subfolder.","","To view this presentation:","1. Open the .pptx file with any compatible presentation software","2. Ensure the /media folder remains alongside the .pptx file","",`Packaged on ${new Date().toLocaleDateString()}`,""].join(`
4807
+ </style></head><body>`);for(let a of t){let l=Wce(a),c=Bg(l);s.write('<div class="slide-page">'),s.write(`<div class="slide-header">${kh(n("pptx.notes.slideN",{n:a.slideNumber}))}</div>`),s.write(`<div class="slide-thumb">${kh(n("pptx.notes.slideN",{n:a.slideNumber}))}</div>`),s.write('<div class="notes-text">');let d=0;for(let u of c){u.bulletType==="numbered"?d++:d=0;let p=u.indentLevel*24,h="";u.bulletType==="bullet"?h="\u2022 ":u.bulletType==="numbered"&&(h=`${d}. `);let f=u.segments.filter(m=>!m.isParagraphBreak).map(m=>kh(m.text)).join("");s.write(`<div class="para" style="padding-left:${p}px">${kh(h)}${f}</div>`);}s.write("</div></div>");}s.write("</body></html>"),s.close(),setTimeout(()=>{i.contentWindow?.print();},200);},[t,n]);return jsxRuntime.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:jsxRuntime.jsxs("div",{className:"bg-background border border-border rounded-lg shadow-xl w-[640px] max-h-[80vh] flex flex-col max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-foreground",children:n("pptx.notes.printNotes")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"text-muted-foreground hover:text-foreground text-sm",children:n("common.close")})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:t.map(i=>{let s=Wce(i),a=JC(s).trim().length>0;return jsxRuntime.jsxs("div",{className:"border border-border/50 rounded p-3",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:n("pptx.notes.slideN",{n:i.slideNumber})}),jsxRuntime.jsx("div",{className:"w-full aspect-video bg-muted rounded mb-2 flex items-center justify-center text-muted-foreground text-sm",children:n("pptx.notes.slideN",{n:i.slideNumber})}),jsxRuntime.jsx("div",{className:"text-xs text-foreground whitespace-pre-wrap",children:a?FI(s):jsxRuntime.jsx("span",{className:"italic text-muted-foreground",children:n("pptx.notes.noNotes")})})]},i.id)})}),jsxRuntime.jsx("div",{className:"flex justify-end px-4 py-3 border-t border-border",children:jsxRuntime.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-xs bg-primary hover:bg-primary/80 text-white rounded",children:n("pptx.notes.print")})}),jsxRuntime.jsx("iframe",{ref:r,title:"print-notes",className:"hidden",sandbox:"allow-same-origin"})]})})}function Wce(t){return t.notesSegments&&t.notesSegments.length>0?t.notesSegments:Gb(t.notes??"")}function Yce({initialText:t,onInsert:e,onClose:n}){let{t:r}=reactI18next.useTranslation(),[o,i]=Jm.useState(""),[s,a]=Jm.useState(t),l=Jm.useRef(null);Jm.useEffect(()=>{l.current?.focus();},[]);let c=Jm.useCallback(d=>{if(d.preventDefault(),o.trim().length===0)return;let u=o.startsWith("http")?o:`https://${o}`;e(u,s||u);},[o,s,e]);return jsxRuntime.jsx("div",{className:"absolute bottom-full left-0 mb-1 z-10 bg-muted border border-border rounded-lg shadow-lg p-3 w-72",children:jsxRuntime.jsxs("form",{onSubmit:c,className:"space-y-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-[10px] text-muted-foreground mb-0.5",children:r("pptx.notes.linkUrl")}),jsxRuntime.jsx("input",{ref:l,type:"text",value:o,onChange:d=>i(d.target.value),placeholder:"https://...",className:"w-full px-2 py-1 text-xs bg-background border border-border rounded text-foreground focus:outline-none focus:border-primary"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-[10px] text-muted-foreground mb-0.5",children:r("pptx.notes.linkDisplayText")}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:d=>a(d.target.value),placeholder:r("pptx.notes.linkDisplayText"),className:"w-full px-2 py-1 text-xs bg-background border border-border rounded text-foreground focus:outline-none focus:border-primary"})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:n,className:"px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground",children:r("common.cancel")}),jsxRuntime.jsx("button",{type:"submit",className:"px-2 py-1 text-[10px] bg-primary hover:bg-primary/80 text-white rounded",children:r("pptx.notes.insertLink")})]})]})})}function qce({isRichEditEnabled:t,showLinkPopover:e,savedSelectionText:n,hasAllSlides:r,onApplyRichCommand:o,onToggleBulletList:i,onToggleNumberedList:s,onIndent:a,onOutdent:l,onLinkButtonClick:c,onInsertLink:d,onCloseLinkPopover:u,onPrintClick:p,onToggleRichEdit:h}){let{t:f}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"inline-flex items-center rounded bg-muted text-xs overflow-hidden border border-border/60 relative",children:[jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent",title:f("pptx.notes.bold"),onClick:()=>o("bold"),children:jsxRuntime.jsx(lu$1.LuBold,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.italic"),onClick:()=>o("italic"),children:jsxRuntime.jsx(lu$1.LuItalic,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.underline"),onClick:()=>o("underline"),children:jsxRuntime.jsx(lu$1.LuUnderline,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.strikethrough"),onClick:()=>o("strikeThrough"),children:jsxRuntime.jsx(lu$1.LuStrikethrough,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("div",{className:"w-px h-4 bg-border mx-0.5"}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent",title:f("pptx.notes.bulletList"),onClick:i,children:jsxRuntime.jsx(lu$1.LuList,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.numberedList"),onClick:s,children:jsxRuntime.jsx(lu$1.LuListOrdered,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("div",{className:"w-px h-4 bg-border mx-0.5"}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent",title:f("pptx.notes.indent"),onClick:a,children:jsxRuntime.jsx(lu$1.LuIndentIncrease,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.outdent"),onClick:l,children:jsxRuntime.jsx(lu$1.LuIndentDecrease,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("div",{className:"w-px h-4 bg-border mx-0.5"}),jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent",title:f("pptx.notes.insertLink"),onClick:c,children:jsxRuntime.jsx(lu$1.LuLink,{className:"w-3.5 h-3.5"})}),r&&jsxRuntime.jsx("button",{type:"button",className:"px-2 py-1 hover:bg-accent border-l border-border/60",title:f("pptx.notes.printNotes"),onClick:p,children:jsxRuntime.jsx(lu$1.LuPrinter,{className:"w-3.5 h-3.5"})}),e&&jsxRuntime.jsx(Yce,{initialText:n,onInsert:d,onClose:u})]}),jsxRuntime.jsx("button",{type:"button",className:"text-[10px] px-2 py-1 rounded bg-muted hover:bg-accent border border-border/60",onClick:h,title:f("pptx.notes.toggleRichPlainEditor"),children:f(t?"pptx.notes.plainEditor":"pptx.notes.richEditor")})]})}function Zce({activeSlide:t,isExpanded:e,canEdit:n,onToggle:r,onUpdateNotes:o}){let i=Jm.useMemo(()=>t?.notesSegments&&t.notesSegments.length>0?Wb(t.notesSegments):Gb(t?.notes??""),[t?.notes,t?.notesSegments]),[s,a]=Jm.useState(t?.notes??""),[l,c]=Jm.useState(i),[d,u]=Jm.useState(i.length>0),[p,h]=Jm.useState(false),[f,m]=Jm.useState(false),x=Jm.useRef(null),g=Jm.useRef(null),y=Jm.useRef(null),b=Jm.useRef(null),v=Jm.useRef(false),S=Jm.useRef(null);Jm.useEffect(()=>{let Y=t?.notes??"";if(Y===S.current)return;let ge=t?.notesSegments&&t.notesSegments.length>0?Wb(t.notesSegments):Gb(Y);a(Y),c(ge),u(ge.length>0);},[t?.id,t?.notes,t?.notesSegments]),Jm.useEffect(()=>{if(!(!d||!e||!n||!y.current)){if(v.current){v.current=false;return}y.current.innerHTML=Gce(l);}},[n,l,e,d]);let w=Jm.useCallback((Y,ge)=>{x.current&&(clearTimeout(x.current),x.current=null),S.current=Y,o(Y,ge);},[o]),C=Jm.useCallback((Y,ge)=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{S.current=Y,o(Y,ge),x.current=null;},600);},[o]);Jm.useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]);let T=Jm.useCallback(Y=>{let ge=Y.target.value,fe=Gb(ge);a(ge),c(fe),C(ge,fe);},[C]),M=Jm.useCallback(Y=>{Y.stopPropagation(),Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)&&(w(s,l),r());},[s,l,w,r]),_=Jm.useCallback(()=>{if(!y.current)return;v.current=true;let Y=Vce(y.current),ge=JC(Y);a(ge),c(Y),C(ge,Y);},[C]),E=Jm.useCallback(()=>{w(s,l);},[s,l,w]),R=Jm.useCallback(Y=>{if(!y.current)return;let ge=Hce(y.current,l),fe=Bg(l);ge>=0&&ge<fe.length&&(fe[ge]=Y(fe[ge],ge));let de=$ce(fe),J=JC(de);a(J),c(de),C(J,de);},[l,C]),I=Jm.useCallback(Y=>{document.execCommand(Y),_(),y.current?.focus();},[_]),L=Jm.useCallback(()=>{R(Y=>({...Y,bulletType:Y.bulletType==="bullet"?"none":"bullet"})),y.current?.focus();},[R]),k=Jm.useCallback(()=>{R(Y=>({...Y,bulletType:Y.bulletType==="numbered"?"none":"numbered"})),y.current?.focus();},[R]),F=Jm.useCallback(()=>{R(Y=>({...Y,indentLevel:Math.min(4,Y.indentLevel+1)})),y.current?.focus();},[R]),N=Jm.useCallback(()=>{R(Y=>({...Y,indentLevel:Math.max(0,Y.indentLevel-1)})),y.current?.focus();},[R]),D=Jm.useCallback(Y=>{if(Y.stopPropagation(),Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)){w(s,l),r();return}Y.key==="Tab"&&(Y.preventDefault(),Y.shiftKey?N():F());},[s,l,w,r,F,N]),U=Jm.useCallback(()=>{let Y=window.getSelection();b.current={text:Y?.toString()??""},h(true);},[]),G=Jm.useCallback((Y,ge)=>{if(h(false),!y.current)return;y.current.focus();let fe=window.getSelection();if(fe&&fe.rangeCount>0){let de=fe.getRangeAt(0);de.deleteContents();let J=document.createElement("a");J.href=Y,J.textContent=ge,J.style.color="#4a9eff",J.style.textDecoration="underline",J.style.cursor="pointer",J.setAttribute("data-hyperlink",Y),de.insertNode(J),de.setStartAfter(J),de.collapse(true),fe.removeAllRanges(),fe.addRange(de);}_();},[_]),j=Jm.useCallback(Y=>{let ge=Y.target;if(!(ge instanceof HTMLAnchorElement))return;let fe=ge.getAttribute("data-hyperlink")||ge.getAttribute("href");fe&&(Y.ctrlKey||Y.metaKey)&&(Y.preventDefault(),rh(fe));},[]);return {draft:s,draftSegments:l,isRichEditEnabled:d,setIsRichEditEnabled:u,showLinkPopover:p,setShowLinkPopover:h,showPrintDialog:f,setShowPrintDialog:m,textareaRef:g,richEditorRef:y,savedSelectionRef:b,handlePlainChange:T,handleRichInput:_,handleBlur:E,handleKeyDownPlain:M,handleKeyDownRich:D,applyRichCommand:I,toggleBulletList:L,toggleNumberedList:k,handleIndent:F,handleOutdent:N,handleLinkButtonClick:U,handleInsertLink:G,handleEditorClick:j}}var qH=({activeSlide:t,allSlides:e,isExpanded:n,canEdit:r,onToggle:o,onUpdateNotes:i,panelHeight:s})=>{let{t:a}=reactI18next.useTranslation(),{draft:l,draftSegments:c,isRichEditEnabled:d,setIsRichEditEnabled:u,showLinkPopover:p,setShowLinkPopover:h,showPrintDialog:f,setShowPrintDialog:m,textareaRef:x,richEditorRef:g,savedSelectionRef:y,handlePlainChange:b,handleRichInput:v,handleBlur:S,handleKeyDownPlain:w,handleKeyDownRich:C,applyRichCommand:T,toggleBulletList:M,toggleNumberedList:_,handleIndent:E,handleOutdent:R,handleLinkButtonClick:I,handleInsertLink:L,handleEditorClick:k}=Zce({activeSlide:t,isExpanded:n,canEdit:r,onToggle:o,onUpdateNotes:i}),F=l.trim().length>0,N=t?a("pptx.notes.slideN",{n:t.slideNumber}):a("pptx.notes.noSlide"),{dragY:D,handlers:U}=Lu(o);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx("button",{type:"button","aria-label":a("common.close"),onClick:o,className:"md:hidden fixed inset-0 z-20 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150"}),jsxRuntime.jsxs("div",{className:ie("flex flex-col border-t border-border/60 bg-background select-none",!n&&"max-md:hidden","max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:z-30 max-md:max-h-[75dvh] max-md:rounded-t-2xl max-md:border max-md:border-border max-md:shadow-2xl max-md:pb-[max(env(safe-area-inset-bottom),0px)]"),style:D>0?{transform:`translateY(${D}px)`,transition:"none"}:void 0,children:[n&&jsxRuntime.jsx("div",{className:"md:hidden flex items-center justify-center pt-3 pb-2 cursor-grab active:cursor-grabbing touch-none",onPointerDown:U.onPointerDown,onPointerMove:U.onPointerMove,onPointerUp:U.onPointerUp,onPointerCancel:U.onPointerCancel,children:jsxRuntime.jsx("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/40"})}),jsxRuntime.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 px-3 py-1 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent/30 transition-colors w-full text-left shrink-0 max-md:hidden","aria-expanded":n,"aria-controls":"slide-notes-content",children:["Notes",!n&&F&&jsxRuntime.jsx("span",{className:"text-muted-foreground/50 text-[10px]",children:"(has notes)"})]}),n&&jsxRuntime.jsxs("div",{id:"slide-notes-content",className:"px-3 pb-2 overflow-y-auto",style:{maxHeight:s??240},children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:N}),r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qce,{isRichEditEnabled:d,showLinkPopover:p,savedSelectionText:y.current?.text??"",hasAllSlides:e!==void 0&&e.length>0,onApplyRichCommand:T,onToggleBulletList:M,onToggleNumberedList:_,onIndent:E,onOutdent:R,onLinkButtonClick:I,onInsertLink:L,onCloseLinkPopover:()=>h(false),onPrintClick:()=>m(true),onToggleRichEdit:()=>u(G=>!G)}),d?jsxRuntime.jsx("div",{ref:g,contentEditable:true,suppressContentEditableWarning:true,onInput:v,onBlur:S,onKeyDown:C,onClick:k,className:"w-full overflow-y-auto rounded-md border border-border/50 bg-muted/60 px-2.5 py-1.5 text-xs text-foreground focus:border-primary/50 focus:outline-none focus:ring-1 focus:ring-primary/30 transition-colors whitespace-pre-wrap",style:{maxHeight:192,minHeight:72}}):jsxRuntime.jsx("textarea",{ref:x,name:"slide-notes",value:l,onChange:b,onBlur:S,onKeyDown:w,placeholder:a("pptx.notes.clickToAddNotes"),rows:4,className:"w-full resize-none rounded-md border border-border/50 bg-muted/60 px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:border-primary/50 focus:outline-none focus:ring-1 focus:ring-primary/30 transition-colors",style:{maxHeight:192}})]}):jsxRuntime.jsx("div",{className:"w-full rounded-md border border-border/30 bg-muted/40 px-2.5 py-1.5 text-xs text-muted-foreground overflow-y-auto whitespace-pre-wrap",style:{maxHeight:168,minHeight:60},children:F?FI(c):jsxRuntime.jsx("span",{className:"italic text-muted-foreground",children:a("pptx.notes.noNotes")})})]}),f&&e&&jsxRuntime.jsx(Xce,{slides:e,onClose:()=>m(false)})]})]})};Pe();var nQe="pptx-viewer-autosave",rQe=1,jb="recoveryVersions";function Qce(){return new Promise((t,e)=>{let n=indexedDB.open(nQe,rQe);n.onupgradeneeded=()=>{let r=n.result;r.objectStoreNames.contains(jb)||r.createObjectStore(jb,{keyPath:"key"});},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error);})}async function oQe(t){try{let e=await Qce();return new Promise(n=>{let i=e.transaction(jb,"readonly").objectStore(jb).get(t);i.onsuccess=()=>{e.close();let s=i.result;n(s?[s]:[]);},i.onerror=()=>{e.close(),n([]);};})}catch{return []}}async function iQe(t){try{let e=await Qce();return new Promise(n=>{let r=e.transaction(jb,"readwrite");r.objectStore(jb).delete(t),r.oncomplete=()=>{e.close(),n();},r.onerror=()=>{e.close(),n();};})}catch{}}function sQe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function JH({isOpen:t,filePath:e,onClose:n,onRestore:r}){let{t:o}=reactI18next.useTranslation(),[i,s]=Jm.useState([]),[a,l]=Jm.useState(false),[c,d]=Jm.useState(null),[u,p]=Jm.useState(null),h=Jm.useCallback(async()=>{if(e){l(true);try{let x=await oQe(e);s(x);}catch{s([]);}finally{l(false);}}},[e]);Jm.useEffect(()=>{t&&h();},[t,h]);let f=Jm.useCallback(async x=>{d(x.key);try{x.data&&(r(x.data),n());}finally{d(null);}},[r,n]),m=Jm.useCallback(async x=>{p(x.key);try{await iQe(x.key),await h();}finally{p(null);}},[h]);return t?jsxRuntime.jsxs("div",{className:"absolute inset-y-0 right-0 w-80 bg-background border-l border-border z-50 flex flex-col shadow-xl",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[jsxRuntime.jsx(lu$1.LuClock,{className:"w-4 h-4"}),o("pptx.versionHistory.title")]}),jsxRuntime.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a&&jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-xs text-muted-foreground",children:o("common.loading")}),!a&&i.length===0&&jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-xs text-muted-foreground",children:o("pptx.versionHistory.noVersions")}),!a&&i.map(x=>jsxRuntime.jsxs("div",{className:"px-3 py-2.5 border-b border-border hover:bg-muted/50 group",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"text-xs text-foreground",children:One(x.timestamp)}),jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground",children:Bne(x.timestamp)})]}),jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground mt-0.5",children:sQe(x.size)}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-1.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[jsxRuntime.jsxs("button",{onClick:()=>{f(x);},disabled:c===x.key,className:"inline-flex items-center gap-1 px-2 py-1 rounded text-[10px] bg-primary/20 text-primary hover:bg-primary/30 disabled:opacity-40",children:[jsxRuntime.jsx(lu$1.LuDownload,{className:"w-3 h-3"}),c===x.key?o("common.loading"):o("pptx.versionHistory.restore")]}),jsxRuntime.jsxs("button",{onClick:()=>{m(x);},disabled:u===x.key,className:"inline-flex items-center gap-1 px-2 py-1 rounded text-[10px] bg-red-600/20 text-red-400 hover:bg-red-600/30 disabled:opacity-40",children:[jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"}),o("common.delete")]})]})]},x.key))]})]}):null}function gQe({kind:t}){switch(t){case "added":return jsxRuntime.jsx(lu$1.LuPlus,{className:"w-3 h-3 text-green-400"});case "removed":return jsxRuntime.jsx(lu$1.LuMinus,{className:"w-3 h-3 text-red-400"});case "moved":return jsxRuntime.jsx(lu$1.LuMove,{className:"w-3 h-3 text-primary"});case "resized":return jsxRuntime.jsx(lu$1.LuMove,{className:"w-3 h-3 text-amber-400"});case "textChanged":return jsxRuntime.jsx(lu$1.LuType,{className:"w-3 h-3 text-purple-400"})}}function tde({diff:t,diffIndex:e,canvasSize:n,accepted:r,rejected:o,onAccept:i,onReject:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState(t.status==="changed"),d=(()=>{switch(t.status){case "added":return a("pptx.compare.statusAdded");case "removed":return a("pptx.compare.statusRemoved");case "changed":return a("pptx.compare.statusChanged");case "unchanged":return a("pptx.compare.statusUnchanged")}})(),u=(()=>{switch(t.status){case "added":return "text-green-400 bg-green-900/30";case "removed":return "text-red-400 bg-red-900/30";case "changed":return "text-amber-400 bg-amber-900/30";case "unchanged":return "text-muted-foreground bg-muted/30"}})();if(t.status==="unchanged")return null;let p=r||o,h=t.baseIndex>=0?t.baseIndex+1:t.compareIndex+1;return jsxRuntime.jsxs("div",{className:ie("rounded-lg border transition-colors",p?"border-border/60 bg-card/40 opacity-60":"border-border bg-background/70"),children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-2 text-left",onClick:()=>c(f=>!f),children:[l?jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}):jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:a("pptx.compare.slideNumber",{number:h})}),jsxRuntime.jsx("span",{className:ie("rounded-full px-2 py-0.5 text-[10px] font-medium",u),children:d}),t.changes.length>0&&jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[t.changes.length," ",t.changes.length===1?"change":"changes"]}),jsxRuntime.jsx("span",{className:"flex-1"}),p&&jsxRuntime.jsx("span",{className:ie("text-[10px] font-medium",r?"text-green-400":"text-muted-foreground"),children:a(r?"pptx.compare.accepted":"pptx.compare.rejected")})]}),l&&jsxRuntime.jsxs("div",{className:"px-3 pb-3 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex gap-2",children:[t.baseSlide&&jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:a("pptx.compare.current")}),jsxRuntime.jsx("div",{className:"rounded border border-border overflow-hidden",children:jsxRuntime.jsx(oa,{slide:t.baseSlide,templateElements:[],canvasSize:n})})]}),t.compareSlide&&jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:a("pptx.compare.incoming")}),jsxRuntime.jsx("div",{className:ie("rounded border overflow-hidden",t.status==="added"?"border-green-700/60":t.status==="changed"?"border-amber-700/60":"border-border"),children:jsxRuntime.jsx(oa,{slide:t.compareSlide,templateElements:[],canvasSize:n})})]})]}),t.changes.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:t.changes.map((f,m)=>jsxRuntime.jsxs("div",{className:"flex items-start gap-2 rounded bg-muted/60 px-2 py-1.5 text-[11px]",children:[jsxRuntime.jsx(gQe,{kind:f.kind}),jsxRuntime.jsx("span",{className:"text-foreground",children:f.description})]},`${f.elementId}-${f.kind}-${m}`))}),!p&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-green-700/80 px-2.5 py-1 text-[11px] text-green-50 hover:bg-green-600 transition-colors",onClick:()=>i(e),children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3 h-3"}),a("pptx.compare.accept")]}),jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-accent px-2.5 py-1 text-[11px] text-foreground hover:bg-accent/80 transition-colors",onClick:()=>s(e),children:[jsxRuntime.jsx(lu$1.LuX,{className:"w-3 h-3"}),a("pptx.compare.reject")]})]})]})]})}function ez({isOpen:t,compareResult:e,canvasSize:n,onClose:r,onAcceptSlide:o,onRejectSlide:i,onAcceptAll:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState({}),[d,u]=Jm.useState({}),p=Jm.useCallback(x=>{c(g=>({...g,[x]:true})),u(g=>{let y={...g};return delete y[x],y}),o(x);},[o]),h=Jm.useCallback(x=>{u(g=>({...g,[x]:true})),c(g=>{let y={...g};return delete y[x],y}),i(x);},[i]),f=Jm.useCallback(()=>{if(!e)return;let x={};e.diffs.forEach((g,y)=>{g.status!=="unchanged"&&(x[y]=true);}),c(x),u({}),s();},[e,s]);if(!t||!e)return null;let m=e.diffs.filter(x=>x.status!=="unchanged");return jsxRuntime.jsxs("div",{className:"fixed inset-y-0 right-0 z-50 flex flex-col w-[440px] max-w-full border-l border-border bg-popover backdrop-blur-lg shadow-2xl",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-medium text-foreground",children:a("pptx.compare.title")}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:a("pptx.compare.summary",{added:e.addedCount,removed:e.removedCount,changed:e.changedCount})})]}),jsxRuntime.jsx("button",{type:"button",className:"rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",onClick:r,title:a("pptx.compare.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),m.length>0&&jsxRuntime.jsx("div",{className:"px-4 py-2 border-b border-border/60",children:jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded bg-green-700/80 px-3 py-1.5 text-xs text-green-50 hover:bg-green-600 transition-colors",onClick:f,children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3.5 h-3.5"}),a("pptx.compare.acceptAll")]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-2",children:m.length===0?jsxRuntime.jsx("div",{className:"text-center py-8 text-xs text-muted-foreground",children:a("pptx.compare.noDifferences")}):e.diffs.map((x,g)=>jsxRuntime.jsx(tde,{diff:x,diffIndex:g,canvasSize:n,accepted:!!l[g],rejected:!!d[g],onAccept:p,onReject:h},`diff-${g}-${x.status}`))})]})}function _Qe(t){if(!t)return 0;let e=0;return t.length>=8&&e++,t.length>=12&&e++,/[A-Z]/u.test(t)&&/[a-z]/u.test(t)&&e++,/\d/u.test(t)&&e++,/[^A-Za-z0-9]/u.test(t)&&e++,Math.min(e,4)}var PQe=["bg-red-500","bg-orange-500","bg-yellow-500","bg-lime-500","bg-green-500"];function nz({isOpen:t,isCurrentlyProtected:e,onClose:n,onSetPassword:r,onRemovePassword:o}){let{t:i}=reactI18next.useTranslation(),[s,a]=Jm.useState(""),[l,c]=Jm.useState(""),[d,u]=Jm.useState(false),[p,h]=Jm.useState(""),f=Jm.useMemo(()=>_Qe(s),[s]),m=Jm.useMemo(()=>{let b=[i("pptx.security.strengthVeryWeak"),i("pptx.security.strengthWeak"),i("pptx.security.strengthFair"),i("pptx.security.strengthStrong"),i("pptx.security.strengthVeryStrong")];return s?b[f]:""},[f,s,i]),x=Jm.useCallback(()=>{if(h(""),!s){h(i("pptx.security.errorPasswordRequired"));return}if(s!==l){h(i("pptx.security.errorPasswordMismatch"));return}if(s.length<4){h(i("pptx.security.errorPasswordTooShort"));return}r(s),a(""),c(""),n();},[s,l,r,n,i]),g=Jm.useCallback(()=>{o(),a(""),c(""),n();},[o,n]),y=Jm.useCallback(()=>{a(""),c(""),h(""),n();},[n]);return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":i("common.close"),onClick:y}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[420px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuLock,{className:"w-5 h-5 text-primary"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:i("pptx.security.protectPresentation")})]}),jsxRuntime.jsx("button",{type:"button",onClick:y,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":i("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-green-900/30 border border-green-700/40 px-3 py-2",children:[jsxRuntime.jsx(lu$1.LuShieldCheck,{className:"w-4 h-4 text-green-400 shrink-0"}),jsxRuntime.jsx("span",{className:"text-xs text-green-300",children:i("pptx.security.currentlyProtected")})]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:i("pptx.security.description")}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-foreground mb-1",children:i("pptx.security.password")}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:d?"text":"password",className:"w-full rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",placeholder:i("pptx.security.passwordPlaceholder"),value:s,onChange:b=>{a(b.target.value),h("");}}),jsxRuntime.jsx("button",{type:"button",onClick:()=>u(!d),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":d?"Hide password":"Show password",children:d?jsxRuntime.jsx(lu$1.LuEyeOff,{className:"w-4 h-4"}):jsxRuntime.jsx(lu$1.LuEye,{className:"w-4 h-4"})})]})]}),s&&jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((b,v)=>jsxRuntime.jsx("div",{className:`h-1 flex-1 rounded-full transition-colors ${v<=f?PQe[f]:"bg-accent"}`},`str-${v}`))}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:m})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-foreground mb-1",children:i("pptx.security.confirmPassword")}),jsxRuntime.jsx("input",{type:d?"text":"password",className:"w-full rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",placeholder:i("pptx.security.confirmPasswordPlaceholder"),value:l,onChange:b=>{c(b.target.value),h("");}})]}),p&&jsxRuntime.jsx("p",{className:"text-xs text-red-400",children:p})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border/60",children:[jsxRuntime.jsx("div",{children:e&&jsxRuntime.jsx("button",{type:"button",onClick:g,className:"text-xs text-red-400 hover:text-red-300 transition-colors",children:i("pptx.security.removePassword")})}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:y,className:"px-3 py-1.5 text-xs rounded-lg border border-border text-foreground hover:bg-muted transition-colors",children:i("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:x,className:"px-3 py-1.5 text-xs rounded-lg bg-primary text-white hover:bg-primary/80 transition-colors",children:i(e?"pptx.security.updatePassword":"pptx.security.setPassword")})]})]})]})})]}):null}var AQe=120;function rz(t){let{slides:e,canvasSize:n,activeSlideIndex:r,templateElementsBySlideId:o,loading:i,error:s,hasActivePointerInteraction:a,pointerCommitNonce:l,setSlides:c,setCanvasSize:d,setActiveSlideIndex:u,setTemplateElementsBySlideId:p,setSelectedElementId:h,setSelectedElementIds:f}=t,m=Jm.useRef([]),x=Jm.useRef([]),g=Jm.useRef(null),y=Jm.useRef(""),b=Jm.useRef(""),v=Jm.useRef(false),S=Jm.useRef(null),[w,C]=Jm.useState(false),[T,M]=Jm.useState(false),[_,E]=Jm.useState(void 0),[R,I]=Jm.useState(void 0),[L,k]=Jm.useState(false),F=Jm.useCallback(()=>{C(m.current.length>0),M(x.current.length>0);let fe=m.current[m.current.length-1];E(fe?.actionLabel);let de=x.current[x.current.length-1];I(de?.actionLabel);},[]),N=Jm.useCallback(fe=>({width:n.width,height:n.height,activeSlideIndex:r,slides:e.map(aT),templateElementsBySlideId:lT(o),...fe?{actionLabel:fe}:{}}),[r,n,e,o]),D=Jm.useCallback(fe=>{let de=Math.max(fe.slides.length-1,0);d({width:fe.width,height:fe.height}),c(fe.slides.map(aT)),p(lT(fe.templateElementsBySlideId)),u(Math.min(fe.activeSlideIndex,de)),f([]),h(null);},[u,d,h,f,c,p]),U=Jm.useCallback(()=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{v.current=false;},0);},[]),G=Jm.useCallback(()=>{k(fe=>fe||true);},[]),j=Jm.useCallback(()=>{let fe=m.current.pop();if(!fe)return;let de=N();x.current.push(de),v.current=true;let J=ou(fe);g.current=ou(J),y.current=JSON.stringify(J),D(J),F(),U(),G();},[D,N,G,U,F]),Y=Jm.useCallback(()=>{let fe=x.current.pop();if(!fe)return;let de=N();m.current.push(de),v.current=true;let J=ou(fe);g.current=ou(J),y.current=JSON.stringify(J),D(J),F(),U(),G();},[D,N,G,U,F]),ge=Jm.useCallback(fe=>{if(m.current=[],x.current=[],fe){let de=ou(fe);g.current=de,y.current=JSON.stringify(de);}else g.current=null,y.current="";F();},[F]);return Jm.useEffect(()=>()=>{S.current&&(clearTimeout(S.current),S.current=null);},[]),Jm.useEffect(()=>{if(i||s||v.current||a())return;let fe=`${e.length}|${r}|${n.width}x${n.height}|${e.map(ce=>`${ce.id}:${ce.elements.length}`).join("/")}`;if(fe===b.current)return;let de=N(),J=JSON.stringify(de);if(J===y.current){b.current=fe;return}let re=g.current;if(!re){g.current=ou(de),y.current=J,b.current=fe,F();return}m.current.push(ou(re)),m.current.length>AQe&&m.current.shift(),x.current=[],g.current=ou(de),y.current=J,b.current=fe,F();},[r,N,n.height,n.width,s,a,i,l,e,F]),{canUndo:w,canRedo:T,undoLabel:_,redoLabel:R,handleUndo:j,handleRedo:Y,resetHistory:ge,markDirty:G,buildHistorySnapshot:N}}function iz({canvasSize:t,selectedElements:e}){let n=Jm.useRef(null),r=Jm.useRef(null),o=Jm.useRef(null),i=Jm.useRef(1),[s,a]=Jm.useState(1),[l,c]=Jm.useState(null),d=l||{width:t.width,height:t.height},u=Jm.useMemo(()=>{if(!d.width||!d.height)return 1;let S=d.width/t.width,w=d.height/t.height;return Math.min(S,w,1)},[t,d.height,d.width]),p=u*s;Jm.useEffect(()=>{i.current=p;},[p]),Jm.useEffect(()=>{let S=null,w=0,C=32,T=_=>{let E=Math.max(0,_.clientWidth-8),R=Math.max(0,_.clientHeight-C);E>0&&R>0&&c({width:E,height:R});},M=()=>{let _=o.current;if(!_){w=requestAnimationFrame(M);return}S=new ResizeObserver(()=>T(_)),S.observe(_),T(_);};return M(),()=>{cancelAnimationFrame(w),S?.disconnect();}},[]);let h=Jm.useCallback((S,w)=>{let C=n.current,T=o.current;if(!C||!T)return;let M=Math.min(Math.max(w,.2),5),_=u*M,E=(S.minX+S.maxX)/2,R=(S.minY+S.maxY)/2,I=T.offsetLeft+E*_-C.clientWidth/2,L=T.offsetTop+R*_-C.clientHeight/2;C.scrollTo({left:Math.max(I,0),top:Math.max(L,0),behavior:"smooth"});},[u]),f=Jm.useCallback(()=>{a(S=>Math.min(S+.1,5));},[]),m=Jm.useCallback(()=>{a(S=>Math.max(S-.1,.2));},[]),x=Jm.useCallback(()=>{a(1);},[]),g=Jm.useCallback(()=>{a(1);},[]),y=Jm.useCallback(()=>{if(e.length===0)return;let S=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;if(e.forEach(N=>{S=Math.min(S,N.x),w=Math.min(w,N.y),C=Math.max(C,N.x+Math.max(N.width,12)),T=Math.max(T,N.y+Math.max(N.height,12));}),!Number.isFinite(S)||!Number.isFinite(w)||!Number.isFinite(C)||!Number.isFinite(T))return;let M={minX:S,minY:w,maxX:C,maxY:T},_=Math.max(M.maxX-M.minX,12),E=Math.max(M.maxY-M.minY,12),R=Math.max(d.width-96,12),I=Math.max(d.height-96,12),L=Math.min(R/_,I/E),k=u>Number.EPSILON?u:Number.EPSILON,F=Math.min(Math.max(L/k,.2),5);a(F),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{h(M,F);});});},[h,d.height,d.width,u,e]),b=Jm.useCallback(S=>{if(!S.ctrlKey)return;S.preventDefault();let w=S.deltaY*-1e-3;a(C=>Math.min(Math.max(C+w,.2),5));},[]);Jm.useEffect(()=>{let S=o.current;if(S)return S.addEventListener("wheel",b,{passive:false}),()=>{S.removeEventListener("wheel",b);}},[b]);let v=Jm.useCallback((S,w)=>{let C=r.current;if(!C)return null;let T=C.getBoundingClientRect();if(T.width<=0||T.height<=0)return null;let M=(S-T.left)/p,_=(w-T.top)/p;return {x:Math.max(0,Math.min(t.width,M)),y:Math.max(0,Math.min(t.height,_))}},[t.height,t.width,p]);return {editWrapperRef:n,canvasStageRef:r,canvasViewportRef:o,renderScaleRef:i,scale:s,setScale:a,editorDimensions:l,setEditorDimensions:c,fitScale:u,editorScale:p,handleZoomIn:f,handleZoomOut:m,handleResetZoom:x,handleZoomToFit:g,handleZoomToSelection:y,handleWheel:b,centerBoundsInViewport:h,getCanvasPointFromClient:v}}bt();function ade(t){return !!t.loopContinuously||t.showType==="kiosk"}function lde(t,e){return t.map((n,r)=>{let o=e[r];return typeof o!="number"?n:{...n,transition:{...n.transition,type:n.transition?.type??"none",advanceAfterMs:o}}})}function cde(t,e){return Math.max(0,t||0)+e*60}function GI(){}function Yb(t,e,n,r){for(let o of t.steps)o.stopSound?GI():o.soundPath&&e&&e(o.soundPath);n(o=>{let i=new Map(o);for(let s of t.steps){let a=i.get(s.elementId)??{visible:true},l=s.presetClass==="exit"?a.visible:true;i.set(s.elementId,{visible:l,cssAnimation:s.cssAnimation});}return i});for(let o of t.steps){let i=window.setTimeout(()=>{n(s=>{let a=new Map(s),l=a.get(o.elementId)??{visible:true},c=o.presetClass==="exit"?false:l.visible;return a.set(o.elementId,{visible:c,cssAnimation:void 0}),a});},Math.max(0,o.delayMs+o.durationMs+8));r.current.push(i);}}function ude(t){let{slides:e,onPlayActionSound:n,showWithAnimation:r}=t,o=r!==false,[i,s]=Jm.useState([]),[a,l]=Jm.useState(new Map),[c,d]=Jm.useState(""),[u,p]=Jm.useState(new Set),[h,f]=Jm.useState(new Set),m=Jm.useRef([]),x=Jm.useRef(null),g=Jm.useCallback(()=>{m.current.forEach(M=>{window.clearTimeout(M);}),m.current=[];},[]),y=Jm.useCallback(M=>{if(!M.shouldAutoAdvance())return;let _=M.getAutoAdvanceDelay(),E=M.peekNext();if(!E)return;let R=_+(E.autoAdvanceDelayMs??0),I=window.setTimeout(()=>{let L=M.advance();L&&(Yb(L,n,l,m),y(M));},Math.max(0,R));m.current.push(I);},[n]),b=Jm.useCallback(M=>{let _=e[M];if(!_){x.current=null,l(new Map),d(""),p(new Set),f(new Set);return}let E=_.nativeAnimations??[],R=new Map;for(let F of E)if(F.buildType&&F.buildType!=="allAtOnce"&&F.targetId){let N=_.elements.find(D=>D.id===F.targetId);N&&ze(N)&&N.textSegments&&N.textSegments.length>0&&R.set(F.targetId,EA(N.textSegments));}let I=R.size>0?AA(E,R):E,L=RA.fromAnimations(I);x.current=L,d(L.getTimeline().keyframesCss),p(L.getInteractiveTriggerShapeIds()),f(L.getHoverTriggerShapeIds());let k=_.elements.map(F=>F.id);for(let F of I)F.targetId&&F.targetId.includes(ra)&&k.push(F.targetId);l(L.getElementStates(k));},[e]),v=Jm.useCallback(()=>{if(!o)return false;let M=x.current;if(!M||!M.hasMoreSteps())return false;let _=M.advance();return _?(Yb(_,n,l,m),y(M),true):false},[o,n,y]),S=Jm.useCallback(M=>{let _=x.current;if(!_||!_.hasInteractiveSequence(M))return false;let E=_.advanceInteractive(M);return E?(Yb(E,n,l,m),true):false},[n]),w=Jm.useCallback(M=>{if(!o)return false;let _=x.current;if(!_||!_.hasHoverSequence(M))return false;_.resetHover(M);let E=_.advanceHover(M);return E?(Yb(E,n,l,m),true):false},[o,n]),C=Jm.useCallback(M=>{let _=x.current;!_||!_.hasHoverSequence(M)||_.resetHover(M);},[]),T=Jm.useCallback(M=>{if(g(),!o){x.current=null,s([]),l(new Map),d(""),p(new Set),f(new Set);return}b(M);let _=e[M];if(!_){s([]);return}let E=x.current;if(E&&E.hasMoreSteps()){let I=E.peekNext();if(I&&I.autoAdvance){let L=window.setTimeout(()=>{let k=E.advance();k&&(Yb(k,n,l,m),y(E));},I.autoAdvanceDelayMs??0);m.current.push(L);}}let R=[..._.animations||[]].filter(I=>!!I.entrance).sort((I,L)=>(I.order||Number.MAX_SAFE_INTEGER)-(L.order||Number.MAX_SAFE_INTEGER));if(R.length===0){s([]);return}s(R.map(I=>({elementId:I.elementId,state:"hidden",animation:I}))),R.forEach((I,L)=>{let k=cde(I.delayMs,L),F=window.setTimeout(()=>{s(N=>N.map(D=>D.elementId===I.elementId?{...D,state:"visible"}:D));},k);m.current.push(F);});},[o,g,b,e,n,y]);return {presentationAnimations:i,presentationElementStates:a,presentationKeyframesCss:c,interactiveTriggerShapeIds:u,hoverTriggerShapeIds:h,clearPresentationTimers:g,playNextAnimationGroup:v,handleInteractiveShapeClick:S,handleHoverStart:w,handleHoverEnd:C,runPresentationEntranceAnimations:T,presentationTimersRef:m}}var kQe="pptx-viewer-audience";var Kb="content",pde="pptx-bytes";function hde(){return new Promise((t,e)=>{let n=indexedDB.open(kQe,1);n.onupgradeneeded=()=>{let r=n.result;r.objectStoreNames.contains(Kb)||r.createObjectStore(Kb);},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error);})}async function fde(t){let e=await hde();return new Promise((n,r)=>{let o=e.transaction(Kb,"readwrite"),i=o.objectStore(Kb),a={bytes:t instanceof Uint8Array?t:new Uint8Array(t),createdAt:Date.now()};i.put(a,pde),o.oncomplete=()=>{e.close(),n();},o.onerror=()=>{e.close(),r(o.error);};})}async function o2(){try{let t=await hde();return new Promise(e=>{let n=t.transaction(Kb,"readwrite");n.objectStore(Kb).delete(pde),n.oncomplete=()=>{t.close(),e();},n.onerror=()=>{t.close(),e();};})}catch{}}var sz="pptx-viewer-presenter",jI="#pptx-audience",YI="pptx-viewer-presenter",mde="nonce";function IQe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`s${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}function gde(){let t=window.location.hash;if(!t.startsWith(jI))return null;let e=t.slice(jI.length);return e?new URLSearchParams(e.replace(/^[&;?]/u,"")).get(mde):null}function az(){return window.location.hash.startsWith(jI)}function xde(t){let{currentSlideIndex:e,isPresenterMode:n,content:r}=t,o=Jm.useRef(null),i=Jm.useRef(null),s=Jm.useRef(null),a=Jm.useRef(""),l=Jm.useCallback(()=>(i.current||(i.current=new BroadcastChannel(sz)),i.current),[]),c=Jm.useCallback(()=>o.current!==null&&!o.current.closed,[]),d=Jm.useCallback(h=>{if(!a.current)return;let f={origin:YI,type:"presenter-slide-change",slideIndex:h,sessionId:a.current};try{l().postMessage(f);}catch{}},[l]),u=Jm.useCallback(()=>{if(a.current)try{let f={origin:YI,type:"presenter-exit",sessionId:a.current};l().postMessage(f);}catch{}let h=o.current;if(h&&!h.closed)try{h.close();}catch{}o.current=null,a.current="",s.current!==null&&(clearInterval(s.current),s.current=null),o2();},[l]),p=Jm.useCallback(()=>{c()&&u();let h=window.open("about:blank","_blank");if(!h)return false;o.current=h;let f=IQe();a.current=f;let m=new URL(window.location.href),x=new URLSearchParams;x.set(mde,f),m.hash=`${jI}&${x.toString()}`;let g=y=>{let b=o.current;if(!(!b||b.closed)){if(!y){try{b.close();}catch{}o.current=null,a.current="";return}try{b.location.replace(m.toString());}catch{try{b.close();}catch{}o.current=null,a.current="";}}};return r?fde(r).then(()=>g(true)).catch(()=>g(false)):g(true),window.setTimeout(()=>d(e),1500),s.current=setInterval(()=>{let y=o.current;(!y||y.closed)&&(o.current=null,a.current="",s.current!==null&&(clearInterval(s.current),s.current=null));},1e3),true},[c,u,d,e,r]);return Jm.useEffect(()=>{n&&c()&&d(e);},[e,n,c,d]),Jm.useEffect(()=>()=>{u();try{i.current?.close();}catch{}},[u]),Jm.useEffect(()=>{n||u();},[n,u]),Jm.useEffect(()=>{let h=()=>{o2();};return window.addEventListener("beforeunload",h),()=>window.removeEventListener("beforeunload",h)},[]),{openAudienceWindow:p,closeAudienceWindow:u,isAudienceWindowOpen:c,syncSlideToAudience:d}}function bde(t){let{onSetMode:n,onSetActiveSlideIndex:r,containerRef:o}=t,i=Jm.useRef(false);Jm.useEffect(()=>{if(!az()||i.current)return;i.current=true;let s=window.setTimeout(()=>{try{let a=o.current;a&&typeof a.requestFullscreen=="function"&&a.requestFullscreen().catch(()=>{});}catch{}n("present");},800);return ()=>window.clearTimeout(s)},[o,n]),Jm.useEffect(()=>{if(!az())return;let s=gde(),a;try{a=new BroadcastChannel(sz);}catch{return}return a.onmessage=l=>{let c=l.data;if(!(!c||c.origin!==YI)&&!(s&&c.sessionId!==s)&&(c.type==="presenter-slide-change"&&r(c.slideIndex),c.type==="presenter-exit")){o2(),n("edit");try{window.close();}catch{}}},()=>{try{a.close();}catch{}}},[n,r]);}function vde(t,e){return t==="Escape"?{action:"exit"}:t==="ArrowRight"||t==="PageDown"||t===" "?{action:"next"}:t==="ArrowLeft"||t==="PageUp"?{action:"prev"}:t==="l"||t==="L"?{action:"toggleLaser"}:t==="p"||t==="P"?{action:"togglePen"}:t==="e"||t==="E"?{action:"toggleEraser"}:t==="m"&&e?{action:"toggleToolbar"}:t==="n"||t==="N"?{action:"togglePresenterView"}:{action:"none"}}function Sde(t){let{mode:e,movePresentationSlide:n,onSetMode:r,onToggleLaser:o,onTogglePen:i,onToggleEraser:s,onToggleToolbar:a,onTogglePresenterView:l,rehearsing:c,recordCurrentSlideTime:d,presentationSlideIndex:u,setShowRehearsalSummary:p}=t;Jm.useEffect(()=>{if(e!=="present")return;let h=f=>{let m=vde(f.key,f.ctrlKey);if(m.action!=="none")switch(f.preventDefault(),m.action){case "exit":c&&(d(u),p(true)),r("edit");return;case "next":n(1);return;case "prev":n(-1);return;case "toggleLaser":o?.();return;case "togglePen":i?.();return;case "toggleEraser":s?.();return;case "toggleToolbar":a?.();return;case "togglePresenterView":l?.();break}};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h);}},[e,n,r,o,i,s,a,l,c,d,u,p]);}function Tde(t){let{containerRef:e,onSetMode:n,onSaveRehearsalTimings:r,setPresentationStartTime:o,setPresenterMode:i}=t,[s,a]=Jm.useState(false),[l,c]=Jm.useState({}),[d,u]=Jm.useState(null),[p,h]=Jm.useState(false),[f,m]=Jm.useState(false),x=Jm.useRef(0),g=Jm.useRef(null),y=Jm.useCallback(C=>{if(d===null)return;let T=x.current;g.current!==null&&(T+=Date.now()-g.current);let M=Date.now()-d-T;c(_=>({..._,[C]:Math.max(0,M)})),x.current=0,g.current=f?Date.now():null,u(Date.now());},[d,f]),b=Jm.useCallback(()=>{h(false),a(false),c({});},[]),v=Jm.useCallback(()=>{r?.(l),h(false),a(false);},[r,l]),S=Jm.useCallback(()=>{i(false),a(true),c({}),m(false),h(false),x.current=0,g.current=null;let C=Date.now();o(C),u(C);try{let T=e.current;T&&typeof T.requestFullscreen=="function"&&T.requestFullscreen().catch(()=>{});}catch{}n("present");},[e,n,o,i]),w=Jm.useCallback(()=>{m(C=>(C?g.current!==null&&(x.current+=Date.now()-g.current,g.current=null):g.current=Date.now(),!C));},[]);return {rehearsing:s,setRehearsing:a,recordedTimings:l,slideStartTime:d,showRehearsalSummary:p,setShowRehearsalSummary:h,rehearsalPaused:f,recordCurrentSlideTime:y,dismissRehearsalSummary:b,saveRehearsalTimings:v,enterRehearsalMode:S,toggleRehearsalPause:w}}function Cde(t,e){let n=t.action||"";if(t.soundPath&&e.onPlayActionSound&&e.onPlayActionSound(t.soundPath),typeof t.targetSlideIndex=="number"){let r=Math.max(0,Math.min(e.slidesLength-1,Math.floor(t.targetSlideIndex)));e.slidesLength>0&&e.navigateToSlide(r);return}if(n.includes("hlinkshowjump")){let r=n.toLowerCase();r.includes("nextslide")?e.movePresentationSlide(1):r.includes("previousslide")?e.movePresentationSlide(-1):r.includes("firstslide")?e.navigateToSlide(0):r.includes("lastslide")?e.navigateToSlide(e.slidesLength-1):r.includes("endshow")&&e.onSetMode("edit");return}n.includes("hlinksldjump")||t.url&&!n.includes("hlinksldjump")&&Lm(t.url)&&window.open(t.url,"_blank","noopener,noreferrer");}function lz(t,e){let n=e.slides[e.currentSlideIndex];n?.transition?.soundPath&&e.onPlayActionSound&&e.onPlayActionSound(n.transition.soundPath);let r=Math.max(120,n?.transition?.durationMs||320);e.setPresentationSlideVisible(false),e.clearPresentationTimers();let o=window.setTimeout(()=>{e.setPresentationSlideIndex(t),e.onSetActiveSlideIndex(t),e.setPresentationSlideVisible(true),e.runPresentationEntranceAnimations(t),e.scheduleAutoAdvanceForSlide?.(t);},Math.min(r,480));e.presentationTimersRef.current.push(o);}function Mde(t){let{slides:e,visibleSlideIndexes:n,presentationSlideIndex:r,setPresentationSlideIndex:o,setPresentationSlideVisible:i,onSetMode:s,onSetActiveSlideIndex:a,onPlayActionSound:l,loopContinuously:c,useTimings:d,playNextAnimationGroup:u,clearPresentationTimers:p,runPresentationEntranceAnimations:h,presentationTimersRef:f,rehearsing:m,recordCurrentSlideTime:x,setShowRehearsalSummary:g}=t,y=Jm.useRef(()=>{}),b=Jm.useCallback(C=>{if(d===false)return;let M=e[C]?.transition?.advanceAfterMs;if(typeof M!="number"||!Number.isFinite(M)||M<0)return;let _=window.setTimeout(()=>{y.current(1);},Math.max(0,M));f.current.push(_);},[e,f,d]),v=Jm.useCallback(C=>{if(C===1&&u())return;let T=n.length>0?n:e.map((L,k)=>k);if(T.length===0)return;let M=T.indexOf(r),E=(M>=0?M:0)+C;if(m&&C===1&&E>=T.length){x(r);try{document.fullscreenElement&&document.exitFullscreen().catch(()=>{});}catch{}s("edit"),g(true);return}let R;c&&!m&&C===1&&E>=T.length?R=0:R=Math.min(T.length-1,Math.max(0,E));let I=T[R];I===void 0||I===r||(m&&C===1&&x(r),lz(I,{slides:e,currentSlideIndex:r,onPlayActionSound:l,setPresentationSlideVisible:i,clearPresentationTimers:p,setPresentationSlideIndex:o,onSetActiveSlideIndex:a,runPresentationEntranceAnimations:h,scheduleAutoAdvanceForSlide:m?void 0:b,presentationTimersRef:f}));},[p,c,l,a,s,u,r,f,x,m,h,b,g,e,n,i,o]);y.current=v;let S=Jm.useCallback(C=>{C<0||C>=e.length||C!==r&&lz(C,{slides:e,currentSlideIndex:r,onPlayActionSound:l,setPresentationSlideVisible:i,clearPresentationTimers:p,setPresentationSlideIndex:o,onSetActiveSlideIndex:a,runPresentationEntranceAnimations:h,scheduleAutoAdvanceForSlide:b,presentationTimersRef:f});},[p,l,a,r,f,h,b,e,o,i]),w=Jm.useCallback(C=>{Cde(C,{movePresentationSlide:v,navigateToSlide:S,onPlayActionSound:l,onSetMode:s,slidesLength:e.length});},[v,S,l,s,e.length]);return {movePresentationSlide:v,navigateToSlide:S,handlePresentationAction:w,scheduleAutoAdvanceForSlide:b}}function _de(t){let{navigateToSlide:e}=t,n=Jm.useRef(null),r=Jm.useCallback((s,a)=>{n.current=a,e(s);},[e]),o=Jm.useCallback(()=>{let s=n.current;return s===null?false:(n.current=null,e(s),true)},[e]),i=Jm.useCallback(()=>{n.current=null;},[]);return {handleZoomClick:r,zoomReturnSlideIndex:n,returnToZoomSlide:o,clearZoomReturn:i}}function uz(t){let{mode:e,slides:n,visibleSlideIndexes:r,activeSlideIndex:o,containerRef:i,content:s,onSetMode:a,onSetActiveSlideIndex:l,onPlayActionSound:c,onToggleLaser:d,onTogglePen:u,onToggleEraser:p,onToggleToolbar:h,onSaveRehearsalTimings:f,loopContinuously:m,showWithAnimation:x,useTimings:g}=t,[y,b]=Jm.useState(0),[v,S]=Jm.useState(true),[w,C]=Jm.useState(false),[T,M]=Jm.useState(null),_=Jm.useRef(false),{presentationAnimations:E,presentationElementStates:R,presentationKeyframesCss:I,interactiveTriggerShapeIds:L,hoverTriggerShapeIds:k,clearPresentationTimers:F,playNextAnimationGroup:N,handleInteractiveShapeClick:D,handleHoverStart:U,handleHoverEnd:G,runPresentationEntranceAnimations:j,presentationTimersRef:Y}=ude({slides:n,onPlayActionSound:c,showWithAnimation:x}),{rehearsing:ge,setRehearsing:fe,recordedTimings:de,slideStartTime:J,showRehearsalSummary:re,setShowRehearsalSummary:ce,rehearsalPaused:ae,recordCurrentSlideTime:_e,dismissRehearsalSummary:xe,saveRehearsalTimings:Ee,enterRehearsalMode:W,toggleRehearsalPause:q}=Tde({containerRef:i,onSetMode:a,onSaveRehearsalTimings:f,setPresentationStartTime:M,setPresenterMode:C}),{movePresentationSlide:Q,navigateToSlide:se,handlePresentationAction:me,scheduleAutoAdvanceForSlide:P}=Mde({slides:n,visibleSlideIndexes:r,presentationSlideIndex:y,setPresentationSlideIndex:b,setPresentationSlideVisible:S,onSetMode:a,onSetActiveSlideIndex:l,onPlayActionSound:c,loopContinuously:m,useTimings:g,playNextAnimationGroup:N,clearPresentationTimers:F,runPresentationEntranceAnimations:j,presentationTimersRef:Y,rehearsing:ge,recordCurrentSlideTime:_e,setShowRehearsalSummary:ce}),{handleZoomClick:A,zoomReturnSlideIndex:O,returnToZoomSlide:z,clearZoomReturn:te}=_de({navigateToSlide:se}),{openAudienceWindow:$,closeAudienceWindow:Me,isAudienceWindowOpen:De,syncSlideToAudience:V}=xde({currentSlideIndex:y,isPresenterMode:w,content:s});bde({onSetMode:a,onSetActiveSlideIndex:l,containerRef:i});let B=Jm.useCallback(()=>{C(false),fe(false),M(Date.now());try{let ue=i.current;ue&&typeof ue.requestFullscreen=="function"&&ue.requestFullscreen().catch(()=>{});}catch{}a("present");},[i,a,fe]),ee=Jm.useCallback(()=>{C(true),fe(false),M(Date.now()),a("present");},[a,fe]),oe=Jm.useCallback(()=>{if(w){C(false);try{let ue=i.current;ue&&typeof ue.requestFullscreen=="function"&&ue.requestFullscreen().catch(()=>{});}catch{}}else {_.current=true;try{document.fullscreenElement&&document.exitFullscreen().catch(()=>{});}catch{}C(true),T||M(Date.now());}},[w,T,i]);Sde({mode:e,movePresentationSlide:Q,onSetMode:a,onToggleLaser:d,onTogglePen:u,onToggleEraser:p,onToggleToolbar:h,onTogglePresenterView:oe,rehearsing:ge,recordCurrentSlideTime:_e,presentationSlideIndex:y,setShowRehearsalSummary:ce});let pe=Jm.useRef(j);pe.current=j;let Ae=Jm.useRef(P);Ae.current=P;let Le=Jm.useRef(o);return Le.current=o,Jm.useEffect(()=>{if(e==="present"){let ue=Le.current;b(ue),pe.current(ue),Ae.current(ue);}},[e]),Jm.useEffect(()=>{if(e==="present")return ()=>{try{document.fullscreenElement&&document.exitFullscreen().catch(()=>{});}catch{}}},[e]),Jm.useEffect(()=>{if(e!=="present"||w)return;let ue=!!document.fullscreenElement,we=()=>{if(_.current){_.current=false,ue=!!document.fullscreenElement;return}let Ie=!!document.fullscreenElement;ue&&!Ie&&(ge&&(_e(y),ce(true)),a("edit")),ue=Ie;};return document.addEventListener("fullscreenchange",we),()=>{document.removeEventListener("fullscreenchange",we);}},[e,a,w,ge,_e,y,ce]),Jm.useEffect(()=>{let ue=Y;return ()=>{ue.current.forEach(we=>{window.clearTimeout(we);});}},[Y]),{presentationSlideIndex:y,setPresentationSlideIndex:b,presentationSlideVisible:v,presentationAnimations:E,presentationElementStates:R,presentationKeyframesCss:I,clearPresentationTimers:F,runPresentationEntranceAnimations:j,movePresentationSlide:Q,navigateToSlide:se,handlePresentationAction:me,handleInteractiveShapeClick:D,interactiveTriggerShapeIds:L,hoverTriggerShapeIds:k,handleHoverStart:U,handleHoverEnd:G,enterPresentMode:B,presenterMode:w,enterPresenterView:ee,togglePresenterView:oe,presentationStartTime:T,rehearsing:ge,enterRehearsalMode:W,recordedTimings:de,slideStartTime:J,showRehearsalSummary:re,dismissRehearsalSummary:xe,saveRehearsalTimings:Ee,rehearsalPaused:ae,toggleRehearsalPause:q,handleZoomClick:A,zoomReturnSlideIndex:O,returnToZoomSlide:z,clearZoomReturn:te,openAudienceWindow:$,closeAudienceWindow:Me,isAudienceWindowOpen:De,syncSlideToAudience:V}}var OQe=2.5,BQe=14,UQe=.4,Ede=16,Ade=0;function $Qe(){return Ade+=1,`stroke-${Ade}`}function pz(t){let{isActive:e,activeSlideIndex:n}=t,[r,o]=Jm.useState("none"),[i,s]=Jm.useState("#ff0000"),[a,l]=Jm.useState("#ffff00"),[c,d]=Jm.useState(null),[u,p]=Jm.useState(null),[h,f]=Jm.useState(false),m=Jm.useRef(new Map),[x,g]=Jm.useState([]),[y,b]=Jm.useState(0),v=Jm.useRef(false),S=Jm.useRef(n);S.current=n;let w=Jm.useRef(n);Jm.useEffect(()=>{e&&w.current!==n&&(g(U=>(U.length>0?m.current.set(w.current,U):m.current.delete(w.current),b(G=>G+1),m.current.get(n)??[])),w.current=n);},[e,n]);let C=Jm.useCallback(U=>{e&&o(G=>G===U?"none":U);},[e]),T=Jm.useCallback((U,G)=>{if(e&&(r==="pen"||r==="highlighter")){v.current=true;let j=r==="pen";d({id:$Qe(),points:[{x:U,y:G}],color:j?i:a,width:j?OQe:BQe,opacity:j?1:UQe});}},[e,r,i,a]),M=Jm.useCallback((U,G)=>{!e||!v.current||d(j=>j?{...j,points:[...j.points,{x:U,y:G}]}:null);},[e]),_=Jm.useCallback(()=>{v.current&&(v.current=false,d(U=>(U&&U.points.length>1&&g(G=>{if(G.some(Y=>Y.id===U.id))return G;let j=[...G,U];return m.current.set(S.current,j),b(Y=>Y+1),j}),null)));},[]),E=Jm.useCallback((U,G)=>{!e||r!=="laser"||p({x:U,y:G});},[e,r]),R=Jm.useCallback(()=>{p(null);},[]),I=Jm.useCallback((U,G)=>{!e||r!=="eraser"||g(j=>{let Y=j.filter(ge=>!ge.points.some(fe=>{let de=fe.x-U,J=fe.y-G;return de*de+J*J<Ede*Ede}));return Y.length>0?m.current.set(S.current,Y):m.current.delete(S.current),b(ge=>ge+1),Y});},[e,r]),L=Jm.useCallback(()=>{g([]),d(null),v.current=false,m.current.delete(S.current),b(U=>U+1);},[]),k=Jm.useCallback(()=>{g([]),d(null),v.current=false,m.current.clear(),b(U=>U+1);},[]),F=Jm.useRef(0);Jm.useEffect(()=>{if(!e){f(false),o("none"),d(null),p(null);return}let U=()=>{f(true),window.clearTimeout(F.current),F.current=window.setTimeout(()=>{f(false);},3e3);};return window.addEventListener("mousemove",U),()=>{window.removeEventListener("mousemove",U),window.clearTimeout(F.current);}},[e]);let N=Jm.useCallback(()=>{let U=new Map(m.current);return x.length>0&&U.set(n,x),U},[x,n]),D=y>=0&&(x.length>0||m.current.size>0);return {presentationTool:r,setPresentationTool:C,penColor:i,setPenColor:s,highlighterColor:a,setHighlighterColor:l,annotationStrokes:x,currentStroke:c,laserPosition:u,toolbarVisible:h,setToolbarVisible:f,handlePointerDown:T,handlePointerMove:M,handlePointerUp:_,handleLaserMove:E,handleLaserLeave:R,clearAnnotations:L,eraseAtPoint:I,allSlideAnnotations:N(),hasAnyAnnotations:D,clearAllAnnotations:k}}bt();function zQe(t,e,n){if(!e)return [];let r=[],o=n?e:e.toLowerCase();return t.forEach((i,s)=>{for(let a of i.elements||[]){if(!ze(a))continue;(a.textSegments??[]).forEach((c,d)=>{let u=n?c.text:(c.text||"").toLowerCase(),p=0;for(;p<u.length;){let h=u.indexOf(o,p);if(h===-1)break;r.push({slideIndex:s,elementId:a.id,segmentIndex:d,startOffset:h,length:e.length}),p=h+1;}});}}),r}function VQe(t,e,n){if(e.length===0)return t;let r=[...t],o=new Map;for(let i of e){let s=`${i.slideIndex}::${i.elementId}::${i.segmentIndex}`;o.has(s)||o.set(s,[]),o.get(s).push(i);}for(let[,i]of o){let s=[...i].sort((a,l)=>l.startOffset-a.startOffset);for(let a of s){let l=r[a.slideIndex];if(!l)continue;let c=(l.elements||[]).findIndex(x=>x.id===a.elementId);if(c===-1)continue;let d=l.elements[c];if(!ze(d))continue;let u=[...d.textSegments??[]],p=u[a.segmentIndex];if(!p)continue;let h=p.text.slice(0,a.startOffset),f=p.text.slice(a.startOffset+a.length);u[a.segmentIndex]={...p,text:h+n+f};let m=[...l.elements];m[c]={...d,text:u.map(x=>x.text).join(""),textSegments:u},r[a.slideIndex]={...l,elements:m};}}return r}function hz({slides:t,mode:e,onSetActiveSlideIndex:n,onSetSelectedElementId:r,onUpdateSlides:o,onMarkDirty:i}){let[s,a]=Jm.useState(false),[l,c]=Jm.useState(""),[d,u]=Jm.useState(""),[p,h]=Jm.useState(false),[f,m]=Jm.useState([]),[x,g]=Jm.useState(-1),y=Jm.useCallback(()=>{let C=zQe(t,l,p);if(!l){m([]),g(-1);return}m(C),g(C.length>0?0:-1),C.length>0&&(n(C[0].slideIndex),r(C[0].elementId));},[t,l,p,n,r]),b=Jm.useCallback(C=>{if(f.length===0)return;let T=(x+C+f.length)%f.length;g(T);let M=f[T];M&&(n(M.slideIndex),r(M.elementId));},[f,x,n,r]),v=Jm.useCallback(C=>{C.length!==0&&(o(T=>VQe(T,C,d)),i());},[d,o,i]),S=Jm.useCallback(()=>{f.length===0||x<0||(v([f[x]]),setTimeout(y,0));},[f,x,v,y]),w=Jm.useCallback(()=>{f.length!==0&&(v(f),setTimeout(y,0));},[f,v,y]);return Jm.useEffect(()=>{let C=T=>{if((T.metaKey||T.ctrlKey)&&T.key==="f"){if(e!=="edit")return;T.preventDefault(),a(M=>!M);}};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[e]),{findReplaceOpen:s,setFindReplaceOpen:a,findQuery:l,setFindQuery:c,replaceQuery:d,setReplaceQuery:u,findMatchCase:p,setFindMatchCase:h,findResults:f,findResultIndex:x,performFind:y,navigateFindResult:b,handleReplace:S,handleReplaceAll:w}}function pi(t,e=120){let[n,r]=Jm.useState(0),o=Jm.useRef(null),i=Jm.useCallback(l=>{l.pointerType!=="mouse"&&(l.target.closest('button, a, input, select, textarea, [role="button"]')||(o.current=l.clientY,l.target.setPointerCapture?.(l.pointerId)));},[]),s=Jm.useCallback(l=>{o.current!==null&&r(Math.max(0,l.clientY-o.current));},[]),a=Jm.useCallback(l=>{if(o.current===null)return;let c=l.clientY-o.current;o.current=null,l.target.releasePointerCapture?.(l.pointerId),c>e&&t(),r(0);},[t,e]);return {panelStyle:n>0?{transform:`translateY(${n}px)`,transition:"none"}:{transition:"transform 150ms ease-out"},handlers:{onPointerDown:i,onPointerMove:s,onPointerUp:a,onPointerCancel:a}}}function mz(){return `comment-${crypto.randomUUID()}`}function Rde(t,e,n){return t.map((r,o)=>o===e?{...r,comments:[...r.comments||[],n]}:r)}function kde(t,e,n){let r=false;return {slides:t.map((i,s)=>{if(s!==e)return i;let a=i.comments||[],l=a.filter(c=>{let d=c.id!==n;return d||(r=true),d});return l.length===a.length?i:{...i,comments:l}}),didDelete:r}}function Ide(t,e,n,r){let o=false;return {slides:t.map((s,a)=>{if(a!==e)return s;let l=(s.comments||[]).map(c=>c.id!==n?c:(o=true,{...c,text:r}));return o?{...s,comments:l}:s}),didUpdate:o}}function Nde(t,e,n){let r=false;return {slides:t.map((i,s)=>{if(s!==e)return i;let a=(i.comments||[]).map(l=>l.id!==n?l:(r=true,{...l,resolved:!l.resolved}));return r?{...i,comments:a}:i}),didUpdate:r}}function Lde(t,e){let n={},r=false;for(let[o,i]of Object.entries(t)){if(!e.has(o)){r=true;continue}n[o]=i;}return r?n:null}function gz({slides:t,canEdit:e,userName:n="You",selectedElementId:r,onUpdateSlides:o,onMarkDirty:i}){let[s,a]=Jm.useState({}),[l,c]=Jm.useState({}),[d,u]=Jm.useState({}),[p,h]=Jm.useState({}),[f,m]=Jm.useState(null),x=Jm.useCallback((R,I)=>{a(L=>({...L,[R]:I}));},[]),g=Jm.useCallback((R,I)=>{u(L=>({...L,[R]:I}));},[]),y=Jm.useCallback(R=>{if(!e)return;let I=t[R];if(!I)return;let L=String(s[I.id]||"").trim();if(L.length===0)return;let k={id:mz(),text:L,author:n,createdAt:new Date().toISOString(),elementId:r??void 0};o(F=>Rde(F,R,k)),a(F=>({...F,[I.id]:""})),i();},[e,s,i,o,r,t,n]),b=Jm.useCallback((R,I)=>{if(!e)return;let L=t[R];if(!L)return;let k=false;o(F=>{let N=kde(F,R,I);return k=N.didDelete,N.slides}),k&&(c(F=>({...F,[L.id]:null})),i());},[e,i,o,t]),v=Jm.useCallback((R,I)=>{let L=t.find(F=>F.id===R);if(!L)return;let k=(L.comments||[]).find(F=>F.id===I);k&&(c(F=>({...F,[R]:I})),u(F=>({...F,[I]:k.text||""})));},[t]),S=Jm.useCallback(R=>{c(I=>({...I,[R]:null}));},[]),w=Jm.useCallback((R,I)=>{if(!e)return;let L=t[R];if(!L)return;let k=String(d[I]||"").trim();if(k.length===0)return;let F=false;o(N=>{let D=Ide(N,R,I,k);return F=D.didUpdate,D.slides}),F&&(c(N=>({...N,[L.id]:null})),i());},[e,d,i,o,t]),C=Jm.useCallback((R,I)=>{if(!e||!t[R])return;let k=false;o(F=>{let N=Nde(F,R,I);return k=N.didUpdate,N.slides}),k&&i();},[e,i,o,t]),T=Jm.useCallback((R,I)=>{m(I),h(L=>({...L,[I]:""}));},[]),M=Jm.useCallback(()=>{m(null);},[]),_=Jm.useCallback((R,I)=>{h(L=>({...L,[R]:I}));},[]),E=Jm.useCallback((R,I)=>{if(!e)return;let L=t[R];if(!L)return;let k=(L.comments||[]).find(D=>D.id===I);if(!k)return;let F=String(p[I]||"").trim();if(F.length===0)return;let N={id:mz(),text:F,author:n,createdAt:new Date().toISOString(),threadId:I,elementId:k.elementId};o(D=>D.map((U,G)=>{if(G!==R)return U;let j=(U.comments||[]).map(Y=>Y.id!==I?Y:{...Y,replies:[...Y.replies||[],N]});return {...U,comments:j}})),m(null),h(D=>{let U={...D};return delete U[I],U}),i();},[e,i,o,p,t,n]);return Jm.useEffect(()=>{let R=new Set(t.map(I=>I.id));a(I=>Lde(I,R)??I);},[t]),{commentDraftBySlideId:s,editingCommentIdBySlideId:l,commentEditDraftByCommentId:d,replyingToCommentId:f,replyDraftByCommentId:p,handleCommentDraftChange:x,handleAddSlideComment:y,handleDeleteSlideComment:b,handleStartCommentEdit:v,handleCancelCommentEdit:S,handleSaveCommentEdit:w,handleSetCommentEditDraft:g,handleToggleCommentResolved:C,handleStartReply:T,handleCancelReply:M,handleReplyDraftChange:_,handleSubmitReply:E}}function jQe(t,e){let n=new Map;for(let r of t)n.set(r.id,r);for(let r of e)n.set(r.id,r);return n}function YQe(t,e){return e.length>0?e:t?[t]:[]}function KQe(t,e){if(!(e===null||!t?.layouts))return t.layouts[e]}function qQe(t,e){return e?e.elements??[]:t?t.elements??[]:[]}function Dde(t){let{slides:e,activeSlideIndex:n,templateElementsBySlideId:r,selectedElementId:o,selectedElementIds:i,slideMasters:s,activeMasterIndex:a,activeLayoutIndex:l,notesMaster:c,handoutMaster:d}=t,u=e[n],p=Jm.useMemo(()=>u?r[u.id]??[]:[],[u,r]),h=Jm.useMemo(()=>jQe(p,u?.elements??[]),[u,p]),f=Jm.useMemo(()=>o?h.get(o)??null:null,[h,o]),m=Jm.useMemo(()=>YQe(o,i),[o,i]),x=Jm.useMemo(()=>new Set(m),[m]),g=Jm.useMemo(()=>m.map(C=>h.get(C)).filter(Boolean),[m,h]),y=s[a],b=Jm.useMemo(()=>KQe(y,l),[y,l]),v=Jm.useMemo(()=>qQe(y,b),[y,b]),S=Jm.useMemo(()=>c?.elements??[],[c]),w=Jm.useMemo(()=>d?.elements??[],[d]);return {activeSlide:u,templateElements:p,elementLookup:h,selectedElement:f,effectiveSelectedIds:m,selectedElementIdSet:x,selectedElements:g,activeMaster:y,activeLayout:b,masterViewElements:v,notesMasterElements:S,handoutMasterElements:w}}function bz(t){let e=Jm.useRef(null),n=Jm.useRef(null),r=Jm.useRef(null),o=Jm.useRef(0),i=Jm.useRef(null),s=Jm.useRef(null),a=Jm.useRef(null),l=Jm.useRef(null),c=Jm.useRef(false),[d,u]=Jm.useState("edit"),[p,h]=Jm.useState(true),[f,m]=Jm.useState(null),[x,g]=Jm.useState([]),[y,b]=Jm.useState({}),[v,S]=Jm.useState({width:1280,height:720}),[w,C]=Jm.useState(0),[T,M]=Jm.useState(null),[_,E]=Jm.useState([]),[R,I]=Jm.useState(false),L=Jm.useRef(null),k=Jm.useRef(""),[F,N]=Jm.useState(null),[D,U]=Jm.useState(""),G=Jm.useCallback(vs=>{let rp=typeof vs=="function"?vs(L.current):vs;L.current=rp,N(vs);},[]),j=Jm.useCallback(vs=>{let rp=typeof vs=="function"?vs(k.current):vs;k.current=rp,U(vs);},[]),[Y,ge]=Jm.useState(false),[fe,de]=Jm.useState("rect"),[J,re]=Jm.useState(null),[ce,ae]=Jm.useState(0),[_e,xe]=Jm.useState({}),[Ee,W]=Jm.useState([]),[q,Q]=Jm.useState([]),[se,me]=Jm.useState(),[P,A]=Jm.useState(),[O,z]=Jm.useState([]),[te,$]=Jm.useState([]),[Me,De]=Jm.useState(null),[V,B]=Jm.useState([]),[ee,oe]=Jm.useState({}),[pe,Ae]=Jm.useState(),[Le,ue]=Jm.useState(),[we,Ie]=Jm.useState(),[He,Oe]=Jm.useState([]),[$e,ot]=Jm.useState([]),[at,gt]=Jm.useState(),[le,Ue]=Jm.useState(),[Te,Ve]=Jm.useState([]),[Fe,ke]=Jm.useState(false),[nt,st]=Jm.useState(false),[Xn,Cn]=Jm.useState(0),[Zi,bs]=Jm.useState(0),[p0,_v]=Jm.useState(null),[h0,of]=Jm.useState("edit"),[Pv,f0]=Jm.useState("slides"),[m0,pl]=Jm.useState(4),sf=Dde({slides:x,activeSlideIndex:w,templateElementsBySlideId:y,selectedElementId:T,selectedElementIds:_,slideMasters:q,activeMasterIndex:Zi,activeLayoutIndex:p0,notesMaster:pe,handoutMaster:Le});return {containerRef:e,imageInputRef:n,mediaInputRef:r,activeSlideIndexRef:o,inlineEditingElementIdRef:L,inlineEditingTextRef:k,dragStateRef:i,resizeStateRef:s,shapeAdjustmentDragStateRef:a,marqueeStateRef:l,isDrawingRef:c,mode:d,setMode:u,loading:p,setLoading:h,error:f,setError:m,slides:x,setSlides:g,templateElementsBySlideId:y,setTemplateElementsBySlideId:b,canvasSize:v,setCanvasSize:S,activeSlideIndex:w,setActiveSlideIndex:C,selectedElementId:T,setSelectedElementId:M,selectedElementIds:_,setSelectedElementIds:E,isDirty:R,setIsDirty:I,inlineEditingElementId:F,setInlineEditingElementId:G,inlineEditingText:D,setInlineEditingText:j,editTemplateMode:Y,setEditTemplateMode:ge,newShapeType:fe,setNewShapeType:de,clipboardPayload:J,setClipboardPayload:re,pointerCommitNonce:ce,setPointerCommitNonce:ae,headerFooter:_e,setHeaderFooter:xe,layoutOptions:Ee,setLayoutOptions:W,slideMasters:q,setSlideMasters:Q,theme:se,setTheme:me,tableStyleMap:P,setTableStyleMap:A,themeOptions:O,setThemeOptions:z,customShows:te,setCustomShows:$,activeCustomShowId:Me,setActiveCustomShowId:De,sections:V,setSections:B,presentationProperties:ee,setPresentationProperties:oe,notesMaster:pe,setNotesMaster:Ae,handoutMaster:Le,setHandoutMaster:ue,notesCanvasSize:we,setNotesCanvasSize:Ie,customProperties:He,setCustomProperties:Oe,tagCollections:$e,setTagCollections:ot,coreProperties:at,setCoreProperties:gt,appProperties:le,setAppProperties:Ue,embeddedFonts:Te,setEmbeddedFonts:Ve,hasMacros:Fe,setHasMacros:ke,hasDigitalSignatures:nt,setHasDigitalSignatures:st,digitalSignatureCount:Xn,setDigitalSignatureCount:Cn,activeMasterIndex:Zi,setActiveMasterIndex:bs,activeLayoutIndex:p0,setActiveLayoutIndex:_v,preMasterMode:h0,setPreMasterMode:of,masterViewTab:Pv,setMasterViewTab:f0,handoutSlidesPerPage:m0,setHandoutSlidesPerPage:pl,...sf}}function vz(){let[t,e]=Jm.useState(false),[n,r]=Jm.useState("home"),[o,i]=Jm.useState(()=>typeof window>"u"?true:window.innerWidth>=768),[s,a]=Jm.useState(false),[l,c]=Jm.useState(true),[d,u]=Jm.useState(false),[p,h]=Jm.useState(false),[f,m]=Jm.useState("properties"),[x,g]=Jm.useState(false),[y,b]=Jm.useState(false),[v,S]=Jm.useState(false),[w,C]=Jm.useState([]),[T,M]=Jm.useState(null),[_,E]=Jm.useState(null),[R,I]=Jm.useState(true),[L,k]=Jm.useState(false),[F,N]=Jm.useState(false),[D,U]=Jm.useState(true),[G,j]=Jm.useState(true),[Y,ge]=Jm.useState([]),[fe,de]=Jm.useState(null),[J,re]=Jm.useState([]),[ce,ae]=Jm.useState(new Map),[_e,xe]=Jm.useState("select"),[Ee,W]=Jm.useState("#000000"),[q,Q]=Jm.useState(3),[se,me]=Jm.useState(false),[P,A]=Jm.useState(false),[O,z]=Jm.useState(false),[te,$]=Jm.useState(false),[Me,De]=Jm.useState(false);return {isCompactToolbarOpen:t,setIsCompactToolbarOpen:e,toolbarSection:n,setToolbarSection:r,isSlidesPaneOpen:o,setIsSlidesPaneOpen:i,isInspectorPaneOpen:s,setIsInspectorPaneOpen:a,isSlideNotesCollapsed:l,setIsSlideNotesCollapsed:c,isOverflowMenuOpen:d,setIsOverflowMenuOpen:u,isSidebarCollapsed:p,setIsSidebarCollapsed:h,sidebarPanelMode:f,setSidebarPanelMode:m,showSlideSorter:x,setShowSlideSorter:g,isShortcutHelpOpen:y,setIsShortcutHelpOpen:b,isAccessibilityPanelOpen:v,setIsAccessibilityPanelOpen:S,accessibilityIssues:w,setAccessibilityIssues:C,contextMenuState:T,setContextMenuState:M,tableEditorState:_,setTableEditorState:E,spellCheckEnabled:R,setSpellCheckEnabled:I,showGrid:L,setShowGrid:k,showRulers:F,setShowRulers:N,snapToGrid:D,setSnapToGrid:U,snapToShape:G,setSnapToShape:j,guides:Y,setGuides:ge,marqueeSelectionState:fe,setMarqueeSelectionState:de,snapLines:J,setSnapLines:re,mediaDataUrls:ce,setMediaDataUrls:ae,activeTool:_e,setActiveTool:xe,drawingColor:Ee,setDrawingColor:W,drawingWidth:q,setDrawingWidth:Q,isThemeEditorOpen:se,setIsThemeEditorOpen:me,isThemeGalleryOpen:P,setIsThemeGalleryOpen:A,formatPainterActive:O,setFormatPainterActive:z,isSelectionPaneOpen:te,setIsSelectionPaneOpen:$,eyedropperActive:Me,setEyedropperActive:De}}function Sz(t){let e=bz(),n=vz();return {...e,...n}}bt();Pe();function Tz({content:t,clearSelection:e,history:n,setSlides:r,setTemplateElementsBySlideId:o,mediaDataUrls:i,setCanvasSize:s,setHeaderFooter:a,setLayoutOptions:l,setSlideMasters:c,setTheme:d,setTableStyleMap:u,setThemeOptions:p,setCustomShows:h,setSections:f,setPresentationProperties:m,setNotesMaster:x,setHandoutMaster:g,setNotesCanvasSize:y,setCustomProperties:b,setTagCollections:v,setCoreProperties:S,setAppProperties:w,setEmbeddedFonts:C,setActiveSlideIndex:T,setHasMacros:M,setHasDigitalSignatures:_,setDigitalSignatureCount:E,setGuides:R,setLoading:I,setError:L,setIsDirty:k,setIsEncrypted:F}){let N=Jm.useRef(null),D=Jm.useRef(null),U=Jm.useRef(0);return Jm.useEffect(()=>{if(!t)return;let G=false,j=++U.current,Y=[];return (async()=>{try{I(!0),L(null);let ge=t instanceof Uint8Array?t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength):t;D.current=ge instanceof ArrayBuffer?ge:null;let fe=ge instanceof ArrayBuffer?ge.byteLength/(1024*1024):0;fe>50&&console.warn(`[pptx] Large file detected (${fe.toFixed(1)} MB). Loading may use significant memory.`);let de=N.current,J=new Nd,re=await J.load(ge);if(G||j!==U.current){J.dispose();return}de&&de.dispose(),N.current=null;let ce=[];for(let W of re.slides)pA(W.elements,ce);for(let W of i.values())W.startsWith("blob:")&&URL.revokeObjectURL(W);i.clear(),await Promise.all(ce.map(async W=>{let q=W.mediaPath;if(!q){W.mediaMissing=!0;return}try{if(W.mediaType==="audio"||W.mediaType==="video"){let se=await J.getMediaArrayBuffer(q);if(se){let me=W.mediaMimeType||"application/octet-stream",P=new Blob([se],{type:me}),A=URL.createObjectURL(P);Y.push(A),i.set(q,A);}else W.mediaMissing=!0;}else {let se=await J.getImageData(q);se?i.set(q,se):W.mediaMissing=!0;}}catch{W.mediaMissing=!0;}}));let{paths:ae,refs:_e}=i4(re.slides),xe=re.slides;if(ae.size>0){let W=new Map;await Promise.all(Array.from(ae).map(async Q=>{try{let se=await J.getImageData(Q);se&&W.set(Q,se);}catch{}}));let q=new Map;for(let Q of _e){let se=W.get(Q.path);if(!se)continue;let me=Q.element.id,P=q.get(me)??{};P[Q.field]=se,q.set(me,P);}if(q.size>0){let Q=se=>{let me=!1,P=se.map(A=>{let O=A,z=q.get(A.id);if(z&&(O={...A,...z}),O.type==="group"&&O.children?.length){let te=Q(O.children);te!==O.children&&(O={...O,children:te});}return O!==A&&(me=!0),O});return me?P:se};xe=re.slides.map(se=>{let me=Q(se.elements);return me===se.elements?se:{...se,elements:me}});}}N.current=J;let Ee=Dre(xe);r(Ee.slides),o(Ee.templateElementsBySlideId),s({width:re.width??1280,height:re.height??720}),a(re.headerFooter??{}),l(re.layoutOptions??[]),c(re.slideMasters??[]),d(re.theme),u(re.tableStyleMap),p(re.themeOptions??[]),h(re.customShows??[]),f(re.sections??[]),m(re.presentationProperties??{}),x(re.notesMaster),g(re.handoutMaster),typeof re.notesWidthEmu=="number"&&typeof re.notesHeightEmu=="number"&&re.notesWidthEmu>0&&re.notesHeightEmu>0?y({width:Math.round(re.notesWidthEmu/9525),height:Math.round(re.notesHeightEmu/9525)}):y(void 0),b(re.customProperties??[]),v(re.tags??[]),S(re.coreProperties),w(re.appProperties),C(re.embeddedFonts??[]),M(re.hasMacros===!0),_(re.hasDigitalSignatures===!0),E(re.digitalSignatureCount??0),R(s4(re.presentationGuides,re.slides[0]?.guides)),T(0),e(),k(!1),n.resetHistory();}catch(ge){!G&&j===U.current&&(ge instanceof a_?F(true):L(ge instanceof Error?ge.message:String(ge)));}finally{!G&&j===U.current&&I(false);}})(),()=>{G=true;for(let ge of Y)URL.revokeObjectURL(ge);N.current&&(N.current.dispose(),N.current=null);}},[t]),{handlerRef:N}}Pe();function Ode(t){return Math.max(t,10)*1e3}function Cz(t){let{isDirty:e,filePath:n,serializeSlides:r,intervalSeconds:o=120,enabled:i=true}=t,[s,a]=Jm.useState({state:"idle"}),l=Jm.useRef(e),c=Jm.useRef(n),d=Jm.useRef(r),u=Jm.useRef(false);Jm.useEffect(()=>{l.current=e;},[e]),Jm.useEffect(()=>{c.current=n;},[n]),Jm.useEffect(()=>{d.current=r;},[r]);let p=Jm.useCallback(async()=>{if(c.current&&l.current&&!u.current){u.current=true,a({state:"saving"});try{let h=await d.current();if(!h){a({state:"idle"}),u.current=!1;return}await ire(c.current,h),a({state:"saved",timestamp:Date.now()});}catch(h){a({state:"error",message:h instanceof Error?h.message:"Autosave failed"});}finally{u.current=false;}}},[]);return Jm.useEffect(()=>{if(!i){a({state:"disabled",reason:"autosave_toggle_off"});return}if(!n){a({state:"disabled",reason:"no_file_path"});return}a(m=>m.state==="disabled"?{state:"idle"}:m);let h=Ode(o),f=setInterval(()=>{p();},h);return ()=>clearInterval(f)},[i,n,o,p]),{autosaveStatus:s,triggerAutosave:p}}bt();function Mz(t){let{activeSlide:e,activeSlideIndex:n,selectedElement:r,selectedElementId:o,editTemplateMode:i,templateElements:s,history:a,setSlides:l,setTemplateElementsBySlideId:c,setSelectedElementId:d,setSelectedElementIds:u,setInlineEditingElementId:p,setContextMenuState:h}=t,f=Jm.useCallback((T,M=[])=>{d(T),u(M);},[d,u]),m=Jm.useCallback(()=>{f(null,[]),p(null),h(null);},[f,p,h]),x=Jm.useCallback((T,M)=>{if(cT(T)){let _=e?.id;_&&c(E=>({...E,[_]:(E[_]??[]).map(R=>R.id===T?{...R,...M}:R)}));}else l(_=>_.map((E,R)=>R!==n?E:{...E,elements:E.elements.map(I=>I.id===T?{...I,...M}:I)}));a.markDirty();},[e?.id,n,a,l,c]),g=Jm.useCallback(T=>{o&&x(o,T);},[o,x]),y=Jm.useCallback(T=>{!r||!Jt(r)||g({shapeStyle:{...r.shapeStyle,...T}});},[r,g]),b=Jm.useCallback(T=>{if(!r||!ze(r))return;let M=pU(r.textSegments);if(M&&r.textSegments){let{newSegments:R,newSelection:I}=hU(r.textSegments,M,T);dU(I),g({textSegments:R});return}let _={...r.textStyle,...T},E=r.textSegments?.map(R=>({...R,style:{...R.style,...T}}));g({textStyle:_,textSegments:E});},[r,g]),v=Jm.useCallback(T=>{l(M=>T(M));},[l]),S=i?s:e?.elements??[],w=Jm.useCallback(T=>{if(i){let M=e?.id;if(!M)return;c(_=>({..._,[M]:T(_[M]??[])}));}else l(M=>M.map((_,E)=>E===n?{..._,elements:T(_.elements)}:_));},[i,e?.id,n,l,c]),C=Jm.useCallback(async()=>null,[]);return {applySelection:f,clearSelection:m,updateElementById:x,updateSelectedElement:g,updateSelectedShapeStyle:y,updateSelectedTextStyle:b,updateSlides:v,activeElements:S,updateActiveElements:w,serializeSlides:C}}Pe();function _z(t){let{sections:e,setSections:n,slides:r,setSlides:o,markDirty:i}=t,s=Jm.useCallback((p,h)=>{let f=vte(e,r,p,h);o(f.slides),n(f.sections),i();},[e,r,o,n,i]),a=Jm.useCallback((p,h)=>{let f=Ste(e,r,p,h);n(f.sections),o(f.slides),i();},[e,r,n,o,i]),l=Jm.useCallback(p=>{let h=wte(e,r,p);n(h.sections),o(h.slides),i();},[e,r,n,o,i]),c=Jm.useCallback(p=>{n(Tte(e,p)),i();},[e,n,i]),d=Jm.useCallback(p=>{n(Cte(e,p)),i();},[e,n,i]),u=Jm.useCallback((p,h)=>{let f=Mte(e,r,p,h);o(f.slides),n(f.sections),i();},[e,r,o,n,i]);return {addSection:s,renameSection:a,deleteSection:l,moveSectionUp:c,moveSectionDown:d,moveSlidesToSection:u}}Pe();function tet(t,e,n,r,o,i,s,a,l){let c=dte({x:e,y:n,width:r,height:o},t,i,s,1,{minSize:12}),d={x:c.x,y:c.y,width:c.width,height:c.height};return a?ute(d,t,l,12):d}function net(t,e,n){let o=e/(n||200);return Math.max(0,Math.min(1,t+o))}function Bde(t,e,n){let{editorScale:r,canvasStageRef:o,canvasSize:i,snapToGrid:s,snapToShape:a,gridSpacingPx:l,editTemplateMode:c,templateElements:d,activeSlide:u,guides:p,elementLookup:h,marqueeStateRef:f,dragStateRef:m,resizeStateRef:x,shapeAdjustmentDragStateRef:g,setMarqueeSelectionState:y,setSnapLines:b,updateElementById:v}=e,S=f.current;if(S){ret(t,S,o,i,r,y);return}let w=m.current;if(w){oet(t,w,r,s,a,l,c,d,u,p,h,n,b);return}let C=x.current;if(C){iet(t,C,r,s,l);return}let T=g.current;T&&set(t,T,r,v);}function ret(t,e,n,r,o,i){let s=n.current;if(!s)return;let a=s.getBoundingClientRect();e.currentX=Math.max(0,Math.min(r.width,(t.clientX-a.left)/o)),e.currentY=Math.max(0,Math.min(r.height,(t.clientY-a.top)/o)),i({...e});}function oet(t,e,n,r,o,i,s,a,l,c,d,u,p){let h=(t.clientX-e.startClientX)/n,f=(t.clientY-e.startClientY)/n;if(!e.moved&&(Math.abs(h)>2||Math.abs(f)>2)&&(e.moved=true),!e.moved)return;let m=h,x=f,g=Object.keys(e.startPositionsById),y=g[0],b=y?e.startPositionsById[y]:void 0,v=y?d.get(y):void 0;if(b&&v){let S=b.x+m,w=b.y+x;if(r&&(S=Math.round(S/i)*i,w=Math.round(w/i)*i),o){let T=(s?a:l?.elements??[]).map(R=>({id:R.id,x:R.x,y:R.y,width:R.width,height:R.height})),M=eU(S,w,v.width,v.height,T,new Set(g),c.map(R=>({axis:R.axis,position:R.position})));S=M.x,w=M.y;let _=M.lines.map(R=>({axis:R.axis==="v"?"x":"y",position:R.position})),E=JSON.stringify(_);E!==u.lastSnapLinesKey&&(u.lastSnapLinesKey=E,p(_));}else u.lastSnapLinesKey!=="[]"&&(u.lastSnapLinesKey="[]",p([]));m=S-b.x,x=w-b.y;}e.lastDx=m,e.lastDy=x;for(let[S,w]of e.domEls){let C=e.startPositionsById[S];C&&(w.style.left=`${C.x+m}px`,w.style.top=`${C.y+x}px`);}}function iet(t,e,n,r,o){let i=(t.clientX-e.startClientX)/n,s=(t.clientY-e.startClientY)/n;if(!e.moved&&(Math.abs(i)>2||Math.abs(s)>2)&&(e.moved=true),!e.moved)return;let a=tet(e.handle,e.startX,e.startY,e.startWidth,e.startHeight,i,s,r,o);e.lastX=a.x,e.lastY=a.y,e.lastWidth=a.width,e.lastHeight=a.height,e.domEl&&(e.domEl.style.left=`${a.x}px`,e.domEl.style.top=`${a.y}px`,e.domEl.style.width=`${Math.max(a.width,12)}px`,e.domEl.style.height=`${Math.max(a.height,12)}px`);}function set(t,e,n,r){let o=(t.clientX-e.startClientX)/n,i=net(e.startAdjustment,o,e.startWidth);!e.moved&&Math.abs(o)>2&&(e.moved=true),e.moved&&r(e.elementId,{shapeAdjustments:{[e.key]:i}});}Pe();function Ude(t){let{editTemplateMode:e,templateElements:n,activeSlide:r,activeSlideIndex:o,marqueeStateRef:i,dragStateRef:s,resizeStateRef:a,shapeAdjustmentDragStateRef:l,setMarqueeSelectionState:c,setSnapLines:d,setTemplateElementsBySlideId:u,setPointerCommitNonce:p,applySelection:h,clearSelection:f,updateSlides:m,updateElementById:x,markDirty:g}=t,y=i.current,b=s.current,v=a.current,S=l.current;if(y&&(aet(y,e,n,r,h,f),i.current=null,c(null)),b?.moved&&cet(b,e,r,o,u,m),v?.moved){let C=v.elementId,T={x:v.lastX,y:v.lastY,width:v.lastWidth,height:v.lastHeight};x(C,T);let M=new Set([C]);m(_=>_.map((E,R)=>{if(R!==o)return E;let I=zA(E.elements,M);return I.length===0?E:{...E,elements:VA(E.elements,I)}}));}let w=b?.moved||v?.moved||S?.moved;i.current=null,s.current=null,a.current=null,l.current=null,c(null),d([]),w&&(g(),p(C=>C+1));}function aet(t,e,n,r,o,i){let s=e?n:r?.elements??[],a=pte(t,s);if(t.additive){let l=hte(t.baseSelectionIds,a);l.length>0?o(l[0],l):i();}else a.length>0?o(a[0],a):i();}function cet(t,e,n,r,o,i){let s=t.lastDx,a=t.lastDy,l=new Set(Object.keys(t.startPositionsById)),c=d=>{let u=d.map(h=>{let f=t.startPositionsById[h.id];return f?{...h,x:f.x+s,y:f.y+a}:h}),p=zA(u,l);return VA(u,p)};if(e){let d=n?.id;if(!d)return;o(u=>({...u,[d]:c(u[d]??[])}));return}i(d=>d.map((u,p)=>p!==r?u:{...u,elements:c(u.elements)}));}function Pz(t){let{editorScale:e,canvasStageRef:n,canvasSize:r,activeSlide:o,activeSlideIndex:i,gridSpacingPx:s,dragStateRef:a,resizeStateRef:l,shapeAdjustmentDragStateRef:c,marqueeStateRef:d,editTemplateMode:u,snapToGrid:p,snapToShape:h,guides:f,templateElements:m,elementLookup:x,setMarqueeSelectionState:g,setSnapLines:y,setTemplateElementsBySlideId:b,setPointerCommitNonce:v,applySelection:S,clearSelection:w,updateSlides:C,updateElementById:T,markDirty:M}=t;Jm.useEffect(()=>{let _={rafId:0,pendingMoveEvent:null,lastSnapLinesKey:""},E=I=>{_.pendingMoveEvent=I,_.rafId===0&&(_.rafId=requestAnimationFrame(()=>{_.rafId=0,_.pendingMoveEvent&&(Bde(_.pendingMoveEvent,t,_),_.pendingMoveEvent=null);}));},R=()=>{_.rafId!==0&&(cancelAnimationFrame(_.rafId),_.rafId=0,_.pendingMoveEvent=null),Ude(t);};return document.addEventListener("pointermove",E),document.addEventListener("pointerup",R),()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",R),_.rafId!==0&&cancelAnimationFrame(_.rafId);}},[e,n,a,l,c,d,u,p,h,f,m,g,y,x,b,v,o,i,r.width,r.height,s,S,w,C,T,M,t]);}bt();Pe();function Ez(t){let{mode:e,canEdit:n,canvasSize:r,selectedElementId:o,selectedElementIds:i,selectedElementIdSet:s,inlineEditingElementId:a,effectiveSelectedIds:l,elementLookup:c,activeTool:d,editorScale:u,canvasStageRef:p,dragStateRef:h,resizeStateRef:f,shapeAdjustmentDragStateRef:m,marqueeStateRef:x,setInlineEditingElementId:g,setInlineEditingText:y,setContextMenuState:b,setMarqueeSelectionState:v,setSnapLines:S,inlineEditingText:w,ops:C,history:T,presentationHandleAction:M,setEditingEquationOmml:_,setIsEquationDialogOpen:E}=t,R=Jm.useRef(false),I=()=>{let de=a;if(!de)return;let J=c.get(de);if(J&&ze(J)){let re=gT(w,J.textSegments,J.textStyle);C.updateElementById(de,{text:w,textSegments:re}),T.markDirty();}g(null),y("");},L=de=>{if(!ze(de))return false;let J=de.textSegments?.find(re=>re.equationXml);return J?.equationXml?(_(J.equationXml),E(true),true):false};return {handleElementClick:(de,J)=>{if(J.stopPropagation(),e==="present"){let re=c.get(de);re?.actionClick&&M(re.actionClick);return}if(J.shiftKey||J.metaKey){let re=i.length?i:o?[o]:[],ce=re.includes(de)?re.filter(ae=>ae!==de):[...re,de];C.applySelection(ce[0]??null,ce);}else if(s.has(de)&&!a)if(R.current)R.current=false;else {let re=c.get(de);re&&ze(re)&&!re.locks?.noTextEdit&&(L(re)||(g(de),y(re.text??"")));}else C.applySelection(de);},handleElementDoubleClick:(de,J)=>{let re=c.get(de);re&&(L(re)||ze(re)&&(g(de),y(re.text??"")));},handleElementMouseDown:(de,J)=>{if(J.button!==0)return;a&&a!==de&&I();let re=s.has(de);re?R.current=false:(C.applySelection(de),R.current=true);let ce=re?l.length?l:[de]:[de],ae={},_e=new Map;for(let xe of ce){let Ee=c.get(xe);Ee&&(ae[xe]={x:Ee.x,y:Ee.y});let W=document.querySelector(`[data-element-id="${xe}"]`);W&&_e.set(xe,W);}h.current={elementId:de,startClientX:J.clientX,startClientY:J.clientY,startPositionsById:ae,domEls:_e,moved:false,lastDx:0,lastDy:0},S([]);},handleElementContextMenu:(de,J)=>{J.preventDefault(),J.stopPropagation(),s.has(de)||C.applySelection(de),b({x:J.clientX,y:J.clientY,elementId:de});},handleCanvasMouseDown:de=>{if(e!=="edit"||!n||de.button!==0||d!=="select")return;a&&I();let J=p.current;if(!J)return;let re=J.getBoundingClientRect(),ce=u||1,ae=Math.max(0,Math.min(r.width,(de.clientX-re.left)/ce)),_e=Math.max(0,Math.min(r.height,(de.clientY-re.top)/ce)),xe=de.shiftKey||de.metaKey,Ee={startX:ae,startY:_e,currentX:ae,currentY:_e,additive:xe,baseSelectionIds:xe?l:[]};x.current=Ee,v(Ee),b(null);},handleResizePointerDown:(de,J,re)=>{J.stopPropagation();let ce=c.get(de);ce&&(f.current={elementId:de,startClientX:J.clientX,startClientY:J.clientY,startX:ce.x,startY:ce.y,startWidth:ce.width,startHeight:ce.height,handle:re,moved:false,domEl:document.querySelector(`[data-element-id="${de}"]`),lastX:ce.x,lastY:ce.y,lastWidth:ce.width,lastHeight:ce.height});},handleAdjustmentPointerDown:(de,J)=>{J.stopPropagation();let re=c.get(de);if(!re||!("shapeType"in re)||!("shapeAdjustments"in re))return;let ce=Object.entries(re.shapeAdjustments??{});if(!ce.length)return;let[ae,_e]=ce[0];m.current={elementId:de,key:ae,shapeType:re.shapeType??"rect",startClientX:J.clientX,startClientY:J.clientY,startAdjustment:_e,startWidth:re.width,startHeight:re.height,moved:false};},handleRotate:(de,J)=>{let re=c.get(de);!re||re.locks?.noRotation||(C.updateElementById(de,{rotation:J}),T.markDirty());},handleUpdateSmartArtElement:(de,J)=>{c.has(de)&&C.updateElementById(de,J);},handleFormatText:de=>{C.updateSelectedTextStyle(de);},handleInlineEditCommit:I}}Pe();function $de(t){let{activeSlide:e,canvasSize:n,addElement:r}=t;return {handleImageFileChange:s=>{let a=s.target.files?.[0];if(!a||!e)return;s.target.value="";let l=new FileReader;l.onload=()=>{let c=l.result;if(!c)return;let d=new Image;d.onload=()=>{let h=d.naturalWidth||400,f=d.naturalHeight||300;if(h>500||f>400){let m=Math.min(500/h,400/f);h=Math.round(h*m),f=Math.round(f*m);}r({id:Pr(),type:"image",x:Math.round((n.width-h)/2),y:Math.round((n.height-f)/2),width:h,height:f,imageData:c});},d.onerror=()=>{r({id:Pr(),type:"image",x:100,y:100,width:400,height:300,imageData:c});},d.src=c;},l.readAsDataURL(a);},handleMediaFileChange:s=>{let a=s.target.files?.[0];if(!a||!e)return;s.target.value="";let l=a.type.startsWith("audio/")?"audio":a.type.startsWith("video/")?"video":null;if(!l)return;let c=a.path,d=(p,h,f)=>{r({id:Pr(),type:"media",mediaType:l,mediaMimeType:a.type||void 0,mediaData:p,x:Math.round((n.width-h)/2),y:Math.round((n.height-f)/2),width:h,height:f});};if(c){let p=c.replace(/\\/gu,"/");p.startsWith("/")||(p=`/${p}`);let h=`pptx-resource://media${encodeURI(p)}`;if(l==="audio"){d(h,420,64);return}let f=URL.createObjectURL(a),m=document.createElement("video");m.preload="metadata",m.onloadedmetadata=()=>{URL.revokeObjectURL(f);let x=640,g=360,y=m.videoWidth||x,b=m.videoHeight||g;if(y>x||b>g){let v=Math.min(x/y,g/b);y=Math.round(y*v),b=Math.round(b*v);}d(h,y,b);},m.onerror=()=>{URL.revokeObjectURL(f),d(h,640,360);},m.src=f;return}let u=new FileReader;u.onload=()=>{let p=u.result;if(!p)return;if(l==="audio"){d(p,420,64);return}let h=document.createElement("video");h.preload="metadata",h.onloadedmetadata=()=>{let x=h.videoWidth||640,g=h.videoHeight||360;if(x>640||g>360){let y=Math.min(640/x,360/g);x=Math.round(x*y),g=Math.round(g*y);}d(p,x,g);},h.onerror=()=>{d(p,640,360);},h.src=p;},u.readAsDataURL(a);}}}bt();var tN={"ppaction://hlinkshowjump?jump=nextslide":"nextSlide","ppaction://hlinkshowjump?jump=previousslide":"prevSlide","ppaction://hlinkshowjump?jump=firstslide":"firstSlide","ppaction://hlinkshowjump?jump=lastslide":"lastSlide","ppaction://hlinkshowjump?jump=endshow":"endShow"},Hde={nextSlide:"ppaction://hlinkshowjump?jump=nextslide",prevSlide:"ppaction://hlinkshowjump?jump=previousslide",firstSlide:"ppaction://hlinkshowjump?jump=firstslide",lastSlide:"ppaction://hlinkshowjump?jump=lastslide",endShow:"ppaction://hlinkshowjump?jump=endshow"};function zde(t,e){return e&&e.startsWith("ppaction://")?e.includes("hlinksldjump")?"slide":(tN[e.toLowerCase()],"action"):t?t.startsWith("mailto:")?"email":/^[a-zA-Z]:\\|^\.\.?[/\\]|^file:/i.test(t)?"file":"url":"url"}function Vde(t){if(!t.startsWith("mailto:"))return {address:t,subject:""};let e=t.slice(7),n=e.indexOf("?");if(n<0)return {address:e,subject:""};let r=e.slice(0,n),o=new URLSearchParams(e.slice(n+1));return {address:r,subject:o.get("subject")||""}}function Gde(t,e){if(e==="ppaction://hlinksldjump"&&t){let n=t.match(/slide(\d+)\.xml$/i);if(n)return parseInt(n[1],10)}if(t){let n=t.match(/#\s*Slide\s+(\d+)/i);if(n)return parseInt(n[1],10)}return 1}function Wde(t){let e=t.tooltip.trim()||void 0;switch(t.targetType){case "email":return {url:t.emailSubject?`mailto:${t.emailAddress}?subject=${encodeURIComponent(t.emailSubject)}`:`mailto:${t.emailAddress}`,tooltip:e};case "slide":return {url:`slide${t.slideNumber}.xml`,action:"ppaction://hlinksldjump",tooltip:e};case "file":return {url:t.filePath,tooltip:e};case "action":return {url:"",action:Hde[t.actionVerb],tooltip:e};default:return {url:t.url,tooltip:e}}}function Xde(t){let{activeSlide:e,activeSlideIndex:n,selectedElements:r,ops:o,history:i,addElement:s}=t;return {handleInsertSmartArt:(h,f)=>{if(!e)return;let m=f.map((g,y)=>`node-${Date.now()}-${y}-${Math.random().toString(36).slice(2,8)}`),x=f.map((g,y)=>{let b={id:m[y],text:g};return h==="hierarchy"&&y>0&&(b.parentId=m[0]),b});s({id:Pr(),type:"smartArt",x:100,y:120,width:600,height:340,smartArtData:{layout:h,colorScheme:"colorful1",style:"flat",nodes:x}});},handleInsertEquation:h=>{e&&s({id:Pr(),type:"shape",x:120,y:200,width:400,height:80,text:"[Equation]",textStyle:{fontSize:18,fontFamily:"Cambria Math"},textSegments:[{text:"[Equation]",style:{fontSize:18,fontFamily:"Cambria Math"},equationXml:h}]});},handleUpdateEquation:h=>{let f=r[0];if(!f)return;let m=[{text:"[Equation]",style:{fontSize:18,fontFamily:"Cambria Math"},equationXml:h}];o.updateElementById(f.id,{textSegments:m}),i.markDirty();},handleHyperlinkConfirm:h=>{let f=r[0];if(!f)return;let m=Wde(h),x={url:m.url||void 0,action:m.action,tooltip:m.tooltip};o.updateElementById(f.id,{actionClick:x}),i.markDirty();},handleInsertField:(h,f)=>{if(!e)return;let m={slidenum:String(n+1),datetime:new Date().toLocaleDateString(),header:"Header",footer:"Footer"},x=f||m[h]||h,g=`{${crypto.randomUUID().toUpperCase()}}`;s({id:Pr(),type:"shape",x:120,y:200,width:200,height:40,text:x,textStyle:{fontSize:14},textSegments:[{text:x,style:{fontSize:14},fieldType:h,fieldGuid:g}]});},handleAddActionButton:h=>{if(!e)return;let f=sh.find(x=>x.shapeType===h);if(!f)return;let m=aS({type:f.defaultAction});m&&(m.tooltip=f.label,m.highlightClick=true),s({id:Pr(),type:"shape",x:150,y:150,width:120,height:50,shapeType:f.shapeType,text:f.label,textStyle:{fontSize:11,fontColor:"#FFFFFF",align:"center",verticalAlign:"middle"},textSegments:[{text:f.label,style:{fontSize:11,fontColor:"#FFFFFF",bold:true}}],shapeStyle:{fillColor:"#4472C4",strokeColor:"#2F5597",strokeWidth:1},actionClick:m});}}}function Rz(t){let{activeSlide:e,activeSlideIndex:n,canvasSize:r,newShapeType:o,selectedElements:i,ops:s,history:a}=t,l=y=>{s.updateSlides(b=>b.map((v,S)=>S===n?{...v,elements:[...v.elements,y]}:v)),s.applySelection(y.id),a.markDirty();},c=()=>{e&&l({id:Pr(),type:"text",x:100,y:100,width:300,height:60,text:"",textStyle:{fontSize:24}});},d=()=>{e&&l({id:Pr(),type:"shape",x:150,y:150,width:200,height:150,shapeType:o,shapeStyle:{fillColor:"#3b82f6",strokeColor:"#1f2937",strokeWidth:2}});},u=()=>{if(!e)return;let y=Array.from({length:3},()=>({cells:Array.from({length:3},()=>({text:"",style:{}}))})),b=Array.from({length:3},()=>1/3);l({id:Pr(),type:"table",x:100,y:200,width:600,height:250,tableData:{rows:y,columnWidths:b}});},p=y=>{e&&l(ere(y));},h=Xde({activeSlide:e,activeSlideIndex:n,selectedElements:i,ops:s,history:a,addElement:l}),f=$de({activeSlide:e,canvasSize:r,addElement:l});return {handleAddTextBox:c,handleAddShape:d,handleAddTable:u,handleAddChart:p,...h,handleAddInkElement:y=>{e&&(s.updateSlides(b=>b.map((v,S)=>S===n?{...v,elements:[...v.elements,y]}:v)),a.markDirty());},handleAddFreeformShape:y=>{e&&l(y);},handleEraseInkElement:y=>{e&&(s.updateSlides(b=>b.map((v,S)=>S===n?{...v,elements:v.elements.filter(w=>w.id!==y)}:v)),a.markDirty());},...f}}function jde(t){let{activeSlide:e,selectedElement:n,effectiveSelectedIds:r,editTemplateMode:o,clipboardPayload:i,setClipboardPayload:s,ops:a,history:l}=t,c=()=>{n&&s({element:structuredClone(n),isTemplate:o});},d=()=>{let f=r;if(!f.length||!e)return;let m=new Set(f);a.updateActiveElements(x=>x.filter(g=>!m.has(g.id))),a.clearSelection(),l.markDirty();};return {handleCopy:c,handleCut:()=>{c(),d();},handlePaste:()=>{if(!i||!e)return;let f=structuredClone(i.element);f.id=AT(o,i.element.id),f.x+=20,f.y+=20,a.updateActiveElements(m=>[...m,f]),a.applySelection(f.id),l.markDirty();},handleDuplicate:()=>{if(!n||!e)return;let f=structuredClone(n);f.id=AT(o,n.id),f.x+=20,f.y+=20,a.updateActiveElements(m=>[...m,f]),a.applySelection(f.id),l.markDirty();},handleDelete:d}}Pe();bt();function het(t){return t.type==="shape"||t.type==="image"||t.type==="picture"}function fet(t){if("pathData"in t&&typeof t.pathData=="string"&&t.pathData)return t.pathData;if("shapeType"in t&&typeof t.shapeType=="string"){let e=mS(t.shapeType);if(e){let n=met(e,t.width,t.height);if(n)return n}}return `M 0 0 L ${t.width} 0 L ${t.width} ${t.height} L 0 ${t.height} Z`}function met(t,e,n){let r=t.match(/polygon\((?<points>[^)]+)\)/iu);if(!r?.groups)return null;let o=r.groups.points.split(",").map(a=>a.trim()),i=[];for(let a of o){let l=a.split(/\s+/u);if(l.length<2)continue;let c=l[0],d=l[1],u,p;c.endsWith("%")?u=parseFloat(c)/100*e:u=parseFloat(c),d.endsWith("%")?p=parseFloat(d)/100*n:p=parseFloat(d),!isNaN(u)&&!isNaN(p)&&i.push({x:u,y:p});}if(i.length<3)return null;let s=[`M ${i[0].x} ${i[0].y}`];for(let a=1;a<i.length;a++)s.push(`L ${i[a].x} ${i[a].y}`);return s.push("Z"),s.join(" ")}function get(t,e){let n=ni(t);if(n.length===0)return t;let r=e.width,o=e.height;"pathWidth"in e&&typeof e.pathWidth=="number"&&(r=e.pathWidth),"pathHeight"in e&&typeof e.pathHeight=="number"&&(o=e.pathHeight);let i=r>0?e.width/r:1,s=o>0?e.height/o:1,a=n.map(l=>l.map(c=>({x:c.x*i+e.x,y:c.y*s+e.y})));return qs(a)}function Yde(t,e,n,r,o){let i=ni(t);if(i.length===0)return t;let s=i.map(a=>a.map(l=>({x:l.x-e,y:l.y-n})));return qs(s)}function Kde(t){let e=ni(t),n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e)for(let a of s)a.x<n&&(n=a.x),a.y<r&&(r=a.y),a.x>o&&(o=a.x),a.y>i&&(i=a.y);return isFinite(n)?{x:n,y:r,width:o-n,height:i-r}:{x:0,y:0,width:0,height:0}}function qde(t){let{activeSlide:e,activeSlideIndex:n,selectedElements:r,effectiveSelectedIds:o,setSelectedElementIds:i,ops:s,history:a}=t,l=r.filter(het),c=l.length>=2;return {handleMergeShapes:u=>{if(!c||!e)return;let p=l;if(p.length<2)return;let h=p.map(f=>{let m=fet(f);return get(m,f)});if(u==="fragment"){let f=[],m=h[0];for(let y=1;y<h.length;y++){let b=__("fragment",m,h[y]);Array.isArray(b)&&(f=b),y<h.length-1&&f.length>0&&(m=f[0]);}if(f.length===0)return;let x=new Set(o),g=[];for(let y of f){if(!y)continue;let b=Kde(y);if(b.width<=0||b.height<=0)continue;let v=Yde(y,b.x,b.y),S={id:Pr(),type:"shape",x:b.x,y:b.y,width:b.width,height:b.height,rotation:0,flipHorizontal:false,flipVertical:false,hidden:false,opacity:p[0].opacity??1,rawXml:{},shapeStyle:{...p[0].shapeStyle},shapeType:"custGeom",pathData:v,pathWidth:b.width,pathHeight:b.height};g.push(S);}if(g.length===0)return;s.updateSlides(y=>y.map((b,v)=>v===n?{...b,elements:[...b.elements.filter(S=>!x.has(S.id)),...g]}:b)),i(g.map(y=>y.id)),a.markDirty();}else {let f=h[0];for(let v=1;v<h.length;v++){let S=__(u,f,h[v]);typeof S=="string"&&(f=S);}if(!f)return;let m=Kde(f);if(m.width<=0||m.height<=0)return;let x=Yde(f,m.x,m.y),g=p[0],y={id:Pr(),type:"shape",x:m.x,y:m.y,width:m.width,height:m.height,rotation:0,flipHorizontal:false,flipVertical:false,hidden:false,opacity:g.opacity??1,rawXml:{},shapeStyle:{...g.shapeStyle},shapeType:"custGeom",pathData:x,pathWidth:m.width,pathHeight:m.height},b=new Set(o);s.updateSlides(v=>v.map((S,w)=>w===n?{...S,elements:[...S.elements.filter(C=>!b.has(C.id)),y]}:S)),s.applySelection(y.id),a.markDirty();}},canMergeShapes:c}}var xet={left:"left",center:"centerH",right:"right",top:"top",middle:"middle",bottom:"bottom"};function Zde(t){let{activeSlide:e,activeSlideIndex:n,selectedElement:r,effectiveSelectedIds:o,selectedElements:i,elementLookup:s,setSelectedElementIds:a,ops:l,history:c}=t,d=()=>{let v=o;if(v.length<2||!e)return;let{elements:S,groupId:w}=fte(l.activeElements,v,Pr());w!==null&&(l.updateActiveElements(()=>S),l.applySelection(w),c.markDirty());},u=()=>{if(!r||r.type!=="group"||!e)return;let v=r,S=cT(v.id),w=v.children.map(C=>({...structuredClone(C),id:S?AT(true,C.id||v.id):C.id||Pr(),x:C.x+v.x,y:C.y+v.y}));l.updateActiveElements(C=>[...C.filter(T=>T.id!==v.id),...w]),a(w.map(C=>C.id)),c.markDirty();},p=v=>{if(!r)return;let S=v==="horizontal"?{flipHorizontal:!r.flipHorizontal}:{flipVertical:!r.flipVertical};l.updateSelectedElement(S),c.markDirty();},h=v=>{if(i.length<2)return;let S=xet[v];if(!S)return;let w=lte(i,S);for(let[C,T]of w){let M=s.get(C);M&&l.updateElementById(C,{x:T.x??M.x,y:T.y??M.y});}c.markDirty();},f=v=>{if(i.length<3)return;let S=v==="horizontal"||v==="vertical"?v:null;if(!S)return;let w=cte(i,S);for(let[C,T]of w){let M=s.get(C);M&&l.updateElementById(C,{x:T.x??M.x,y:T.y??M.y});}c.markDirty();},m=i.length>=3,x=v=>{if(!r||!e)return;let S=r.id;l.updateActiveElements(w=>v==="forward"?xte(w,S):v==="backward"?yte(w,S):w),c.markDirty();},g=v=>{if(!r||!e)return;let S=r.id;l.updateActiveElements(w=>v==="front"?mte(w,S):gte(w,S)),c.markDirty();},{handleMergeShapes:y,canMergeShapes:b}=qde({activeSlide:e,activeSlideIndex:n,selectedElements:i,effectiveSelectedIds:o,setSelectedElementIds:a,ops:l,history:c});return {handleGroupElements:d,handleUngroupElement:u,handleFlip:p,handleAlignElements:h,handleDistributeElements:f,canDistribute:m,handleMoveLayer:x,handleMoveLayerToEdge:g,handleMergeShapes:y,canMergeShapes:b}}function kz(t){let{setIsInspectorPaneOpen:e,setSidebarPanelMode:n,onOpenHyperlinkDialog:r}=t,{handleCopy:o,handleCut:i,handlePaste:s,handleDuplicate:a,handleDelete:l}=jde(t),{handleGroupElements:c,handleUngroupElement:d,handleFlip:u,handleAlignElements:p,handleDistributeElements:h,canDistribute:f,handleMoveLayer:m,handleMoveLayerToEdge:x,handleMergeShapes:g,canMergeShapes:y}=Zde(t);return {handleCopy:o,handleCut:i,handlePaste:s,handleDuplicate:a,handleGroupElements:c,handleUngroupElement:d,handleDelete:l,handleFlip:u,handleAlignElements:p,handleDistributeElements:h,canDistribute:f,handleMoveLayer:m,handleMoveLayerToEdge:x,handleMergeShapes:g,canMergeShapes:y,handleContextMenuAction:v=>{switch(v){case "copy":o();break;case "cut":i();break;case "paste":s();break;case "duplicate":a();break;case "delete":l();break;case "bring-forward":case "bringForward":m("forward");break;case "send-backward":case "sendBackward":m("backward");break;case "bring-front":case "bringToFront":x("front");break;case "send-back":case "sendToBack":x("back");break;case "comment":case "addComment":e(true),n("comments");break;case "group":c();break;case "ungroup":d();break;case "editHyperlink":r();break}}}}Pe();function yet(t,e,n){let r=[...t],o=Math.max(0,Math.min(e+1,r.length));return r.splice(o,0,n),r}function Iz(t){let{slides:e,activeSlideIndex:n,setActiveSlideIndex:r,ops:o,history:i,handlerRef:s}=t;return {handleAddSlide:()=>{let f=Q4(e.length+1);o.updateSlides(m=>{let x=[...m];return x.splice(n+1,0,f),x}),r(n+1),i.markDirty();},handleMoveSlide:(f,m)=>{f!==m&&(o.updateSlides(x=>{let g=[...x],[y]=g.splice(f,1);return g.splice(m,0,y),g}),r(m),i.markDirty());},handleSlideContextMenu:(f,m)=>{},handleDeleteSlides:f=>{if(f.length===0||e.length<=1)return;let m=[...f].sort((g,y)=>y-g);o.updateSlides(g=>{let y=[...g];for(let b of m)y.length>1&&y.splice(b,1);return y});let x=Math.min(...f);r(Math.min(x,e.length-f.length-1,Math.max(e.length-f.length-1,0))),i.markDirty();},handleDuplicateSlides:f=>{if(f.length===0)return;let m=[...f].sort((x,g)=>x-g);o.updateSlides(x=>{let g=[...x],y=0;for(let b of m){let v=g[b+y];if(!v)continue;let S={...v,id:J4(),elements:v.elements.map(w=>({...w,id:`${w.id}-dup-${Math.random().toString(36).slice(2,6)}`}))};g.splice(b+y+1,0,S),y++;}return g}),i.markDirty();},handleToggleHideSlides:f=>{f.length!==0&&(o.updateSlides(m=>{let x=[...m];for(let g of f){let y=x[g];y&&(x[g]={...y,hidden:!y.hidden});}return x}),i.markDirty());},handleInsertSlideFromLayout:(f,m)=>{let x=n+1,g={...Q4(e.length+1),layoutPath:f,...m?{layoutName:m}:{}},y=[];o.updateSlides(v=>(y=yet(v,n,g),y)),r(x),i.markDirty();let b=s?.current;b&&b.applyLayoutToSlide(x,f,y).then(v=>{o.updateSlides(S=>{if(S[x]?.id!==g.id)return S;let w=[...S];return w[x]=v,w});},()=>{});}}}function Jde(t){let{selectedElement:e,tableEditorState:n,setTableEditorState:r,ops:o,history:i}=t;return {handleMergeCellRight:()=>{if(!e||e.type!=="table"||!e.tableData||!n)return;let{rowIndex:d,columnIndex:u}=n,p=e.tableData,h=p.rows[d]?.cells[u];if(!h)return;let f=Math.max(1,h.gridSpan??1),m=u+f,x=p.rows[d]?.cells[m];if(!x||x.hMerge||x.vMerge)return;let g=Ly([{row:d,col:u},{row:d,col:m}],p),y={tableData:g},b=Sp(e,g);b&&(y.rawXml=b),o.updateSelectedElement(y),i.markDirty();},handleMergeCellDown:()=>{if(!e||e.type!=="table"||!e.tableData||!n)return;let{rowIndex:d,columnIndex:u}=n,p=e.tableData,h=p.rows[d]?.cells[u];if(!h)return;let f=Math.max(1,h.rowSpan??1),m=d+f;if(m>=p.rows.length)return;let x=p.rows[m]?.cells[u];if(!x||x.hMerge||x.vMerge)return;let g=Ly([{row:d,col:u},{row:m,col:u}],p),y={tableData:g},b=Sp(e,g);b&&(y.rawXml=b),o.updateSelectedElement(y),i.markDirty();},handleMergeSelectedCells:()=>{if(!e||e.type!=="table"||!e.tableData||!n||!n.selectedCells||n.selectedCells.length<2)return;let d=e.tableData,u=Ly(n.selectedCells,d),p={tableData:u},h=Sp(e,u);h&&(p.rawXml=h),o.updateSelectedElement(p),r({rowIndex:n.rowIndex,columnIndex:n.columnIndex}),i.markDirty();},handleSplitCell:()=>{if(!e||e.type!=="table"||!e.tableData||!n)return;let{rowIndex:d,columnIndex:u}=n,p=e.tableData,h=IA(d,u,p),f={tableData:h},m=Sp(e,h);m&&(f.rawXml=m),o.updateSelectedElement(f),i.markDirty();}}}Pe();function Qde(t){let{selectedElement:e,tableEditorState:n,elementLookup:r,setTableEditorState:o,ops:i,history:s}=t;return {handleCommitCellEdit:(m,x,g,y)=>{let b=r.get(m);if(!b||b.type!=="table")return;let v={};if(b.tableData){let S=b.tableData.rows.map((w,C)=>C!==x?w:{...w,cells:w.cells.map((T,M)=>M!==g?T:{...T,text:y})});v.tableData={...b.tableData,rows:S};}if(b.rawXml){let S=uS(b,x,g,y);S&&(v.rawXml=S);}Object.keys(v).length!==0&&(i.updateElementById(m,v),s.markDirty(),o({rowIndex:x,columnIndex:g,elementId:m}));},handleUpdateCellTextStyle:m=>{if(!e||e.type!=="table"||!n)return;let x=e.id,{rowIndex:g,columnIndex:y}=n,b={};if(e.rawXml){let v=pS(e,g,y,m);v&&(b.rawXml=v);}if(e.tableData){let v=e.tableData.rows.map((S,w)=>w!==g?S:{...S,cells:S.cells.map((C,T)=>T!==y?C:{...C,style:{...C.style,...m}})});b.tableData={...e.tableData,rows:v};}Object.keys(b).length!==0&&(i.updateElementById(x,b),s.markDirty());},handleResizeTableColumns:(m,x)=>{let g=r.get(m);!g||g.type!=="table"||!g.tableData||(i.updateElementById(m,{tableData:{...g.tableData,columnWidths:x}}),s.markDirty());},handleResizeTableRow:(m,x,g)=>{let y=r.get(m);if(!y||y.type!=="table"||!y.tableData)return;let b=y.tableData.rows.map((v,S)=>S===x?{...v,height:g}:v);i.updateElementById(m,{tableData:{...y.tableData,rows:b}}),s.markDirty();},handleInsertTableRow:m=>{if(!e||e.type!=="table"||!e.tableData)return;let x=n?.rowIndex??0,g=Yee(e.tableData,x,m),y={tableData:g},b=wp(e,g);b&&(y.rawXml=b),i.updateSelectedElement(y),s.markDirty();},handleDeleteTableRow:()=>{if(!e||e.type!=="table"||!e.tableData)return;let m=e.tableData,x=n?.rowIndex??0,g=Kee(m,x);if(g===m)return;let y={tableData:g},b=wp(e,g);b&&(y.rawXml=b),i.updateSelectedElement(y),s.markDirty();},handleInsertTableColumn:m=>{if(!e||e.type!=="table"||!e.tableData)return;let x=n?.columnIndex??0,g=Zee(e.tableData,x,m),y={tableData:g},b=wp(e,g);b&&(y.rawXml=b),i.updateSelectedElement(y),s.markDirty();},handleDeleteTableColumn:()=>{if(!e||e.type!=="table"||!e.tableData)return;let m=e.tableData,x=n?.columnIndex??0,g=Jee(m,x);if(g===m)return;let y={tableData:g},b=wp(e,g);b&&(y.rawXml=b),i.updateSelectedElement(y),s.markDirty();}}}function Nz(t){let e=Qde(t),n=Jde(t);return {...e,...n}}Pe();Pe();function u2(t){return t.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#39;")}function Lz(t,e){try{return window.prompt(t,e)}catch{return null}}function eue(t){try{return window.confirm(t)}catch{return false}}function nN(t,e){ru(t,are(e));}Pe();Pe();async function Dz(t,e={}){let n=e.onclone;return bet__default.default(t,{...e,onclone:async(r,o)=>{await yre(r,o),yR(o),typeof n=="function"&&n(r,o);}})}async function Bu(t,e=2,n){return await Dz(t,{scale:e,useCORS:true,allowTaint:true,backgroundColor:n??null,logging:false,ignoreElements:o=>{let i=o;return !!(i.dataset?.exportIgnore==="true"||i.classList?.contains("pointer-events-none")&&(i.classList.contains("z-50")||i.classList.contains("z-[60]")))}})}function Bh(t=100){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(e,t);});});})}async function Fz(t,e={}){let{scale:n=2,backgroundColor:r}=e,o=await Bu(t,n,r);return new Promise((i,s)=>{o.toBlob(a=>{a?i(a):s(new Error("Canvas toBlob returned null"));},"image/png");})}async function Oz(t,e,n={}){let r=await Fz(t,n);ru(r,`slide-${e+1}.png`);}async function Bz(t,e={}){let n=await Fz(t,e);await navigator.clipboard.write([new ClipboardItem({"image/png":n})]);}async function Uz(t,e,n,r,o="presentation.pdf",i={}){let{scale:s=2,onProgress:a,signal:l}=i,c=[];for(let u=0;u<e;u++){if(l?.aborted)throw new DOMException("Export cancelled","AbortError");a?.(u,e),n(u),await Bh(150);let p=t.current;if(!p){console.warn(`[export] Could not find slide stage element for slide ${u}`);continue}let h=await Bu(p,s);c.push(aR(h));}if(a?.(e,e),n(r),c.length===0)throw new Error("No slides were captured for PDF export");let d=i6(c);sR(d,o);}async function $z(t,e,n,r,o={}){let{scale:i=2,onProgress:s}=o,a=[];for(let l=0;l<e;l++){s?.(l,e),n(l),await Bh(150);let c=t.current;if(!c){console.warn(`[export] Could not find slide stage element for slide ${l}`);continue}let d=await Bu(c,i);a.push(d.toDataURL("image/png"));}return s?.(e,e),n(r),a}async function Hz(t,e,n,r,o,i="presentation-notes.pdf",s={}){let{scale:a=2,onProgress:l,signal:c}=s,d=[];for(let p=0;p<e;p++){if(c?.aborted)throw new DOMException("Export cancelled","AbortError");l?.(p,e),n(p),await Bh(150);let h=t.current;if(!h){console.warn(`[export] Could not find slide stage element for slide ${p}`);continue}let f=await Bu(h,a);d.push({canvas:f,notes:o[p],slideNumber:p+1});}if(l?.(e,e),n(r),d.length===0)throw new Error("No slides were captured for notes PDF export");let u=XR(d);sR(u,i);}Pe();async function zz(t,e,n,r,o={}){let{scale:i=1,slideDurationMs:s=3e3,slideTimingsMs:a,onProgress:l,onRecordProgress:c,signal:d}=o,u=[];for(let v=0;v<e;v++){if(d?.aborted)throw new DOMException("Export cancelled","AbortError");l?.(v,e),n(v),await Bh(150);let S=t.current;if(!S){console.warn(`[export] Could not find slide stage element for slide ${v}`);continue}let w=await Bu(S,i);u.push(w);}if(n(r),u.length===0)throw new Error("No slides were captured for video export");let p=u[0],h=document.createElement("canvas");h.width=p.width,h.height=p.height;let f=h.getContext("2d");if(!f)throw new Error("Failed to create 2D context for video recording");let m=30,x=h.captureStream(m),g=new MediaRecorder(x,{mimeType:Tre([...wre]),videoBitsPerSecond:5e6}),y=[];g.ondataavailable=v=>{v.data.size>0&&y.push(v.data);};let b=new Promise((v,S)=>{g.onstop=()=>v(),g.onerror=w=>S(w);});g.start();for(let v=0;v<u.length;v++){if(d?.aborted)throw g.stop(),new DOMException("Export cancelled","AbortError");c?.(v,u.length);let S=a?.[v]??s;f.clearRect(0,0,h.width,h.height),f.drawImage(u[v],0,0);let w=Cre(m),C=Mre(S,m);for(let T=0;T<C;T++){if(d?.aborted)throw g.stop(),new DOMException("Export cancelled","AbortError");f.drawImage(u[v],0,0),await new Promise(M=>{setTimeout(M,w);});}}return g.stop(),await b,l?.(e,e),new Blob(y,{type:"video/webm"})}Pe();async function Vz(t,e,n,r,o={}){let{scale:i=.5,slideDurationMs:s=2e3,onProgress:a,signal:l}=o,c=[];for(let p=0;p<e;p++){if(l?.aborted)throw new DOMException("Export cancelled","AbortError");a?.(p,e),n(p),await Bh(150);let h=t.current;if(!h)continue;let f=await Bu(h,i),m=f.getContext("2d");if(!m)continue;let x=m.getImageData(0,0,f.width,f.height);c.push({imageData:x,width:f.width,height:f.height});}if(n(r),c.length===0)throw new Error("No slides were captured for GIF export");let d=t$(c,Math.round(s/10));a?.(e,e);let u=new ArrayBuffer(d.length);return new Uint8Array(u).set(d),new Blob([u],{type:"image/gif"})}function Gz(t){return ["Presentation Package","====================","",`This folder contains the presentation "${t}" along with`,"all linked media files (images, audio, video) in the /media subfolder.","","To view this presentation:","1. Open the .pptx file with any compatible presentation software","2. Ensure the /media folder remains alongside the .pptx file","",`Packaged on ${new Date().toLocaleDateString()}`,""].join(`
4808
4808
  `)}bt();function vet(t,e){if(!e.length)return t;let n=e.filter(i=>i.css.toLowerCase().includes("</style")?(console.warn(`[export-svg] Dropping @font-face entry for "${i.family}" containing "</style" - would break out of the <style> block.`),false):true);if(!n.length)return t;let r=`<style type="text/css">${n.map(i=>i.css).join(`
4809
4809
  `)}</style>`;if(t.includes("<defs>"))return t.replace("<defs>",`<defs>${r}`);let o=t.indexOf(">");return o===-1?t:`${t.slice(0,o+1)}<defs>${r}</defs>${t.slice(o+1)}`}function Wz(t,e={}){let{onProgress:n,embedFonts:r,fontFaces:o}=e,i={includeHidden:e.includeHidden,slideIndices:e.slideIndices,defaultFontFamily:e.defaultFontFamily,defaultFontSize:e.defaultFontSize},s=[],a=i.includeHidden??false,l=0;for(let c=0;c<t.slides.length;c++){if(i.slideIndices&&!i.slideIndices.includes(c))continue;let d=t.slides[c];if(d.hidden&&!a)continue;n?.(l,t.slides.length);let u=j3.exportSlide(d,t.width,t.height,i);r&&o?.length&&(u=vet(u,o)),s.push(u),l++;}return n?.(l,t.slides.length),s}Pe();Pe();bt();Pe();function tue(t){let{slides:e,templateElementsBySlideId:n,filePath:r,handlerRef:o,serializeSlides:i,headerFooter:s,presentationProperties:a,customShows:l,sections:c,coreProperties:d,appProperties:u,customProperties:p,notesMaster:h,handoutMaster:f,guides:m,activeSlideIndexForGuides:x,modalControls:g,password:y}=t,{setExportModalOpen:b,setExportModalTitle:v,setExportProgress:S,setExportStatusMessage:w,exportAbortRef:C}=g,T=async()=>{let L=new AbortController;C.current=L,v("Package for Sharing"),w("Preparing package..."),S(0),b(true);try{let k=new If__default.default,F=k.folder("presentation-package");S(10),w("Adding presentation...");let N=await i(),D=r?r.replace(/\\/gu,"/").split("/").pop()??"presentation.pptx":"presentation.pptx";N&&F.file(D,N),S(70),w("Writing README...");let U=Gz(D);if(F.file("README.txt",U),L.signal.aborted)throw new DOMException("Export cancelled","AbortError");S(85),w("Generating ZIP...");let G=await k.generateAsync({type:"blob"});S(95),w("Downloading...");let j=D.replace(/\.[^.]+$/u,"");ru(G,`${j}-package.zip`),S(100);}catch(k){k.name!=="AbortError"&&console.error("[PowerPointViewer] Package export failed:",k);}finally{C.current=null,b(false);}},M=async L=>{let k=o.current;if(!k)return;let F=L==="ppsx"?"ppsx":L==="pptm"?"pptm":"pptx",N=r?r.replace(/\\/gu,"/").split("/").pop()?.replace(/\.[^.]+$/u,"")??"presentation":"presentation";try{let D=await _(k,L),U=new Blob([D],{type:"application/vnd.openxmlformats-officedocument.presentationml.presentation"});ru(U,`${N}.${F}`);}catch(D){console.error(`[PowerPointViewer] Save as .${F} failed:`,D);}},_=async(L,k)=>{let F=e.map((U,G)=>{if(G!==x)return U;let j=m.map(Y=>({id:Y.id,orientation:Y.axis==="h"?"horz":"vert",positionEmu:iS(Y.position)}));return {...U,guides:j.length>0?j:void 0}}),N=Jy(F,n),D={headerFooter:s,presentationProperties:a,customShows:l.length>0?l:void 0,sections:c.length>0?c:void 0,coreProperties:d??void 0,appProperties:u??void 0,customProperties:p.length>0?p:void 0,notesMaster:h,handoutMaster:f,outputFormat:k};return y?L.saveEncrypted(N,y,D):L.save(N,D)};return {handlePackageForSharing:T,handleSaveAsFormat:M,handleSaveAsPptx:()=>{M("pptx");},handleSaveAsPpsx:()=>{M("ppsx");},handleSaveAsPptm:()=>{M("pptm");}}}function Xz(t){let{slides:e,templateElementsBySlideId:n,activeSlide:r,activeSlideIndex:o,filePath:i,canvasStageRef:s,setActiveSlideIndex:a,handlerRef:l,serializeSlides:c,headerFooter:d,presentationProperties:u,customShows:p,sections:h,coreProperties:f,appProperties:m,customProperties:x,notesMaster:g,handoutMaster:y,guides:b,activeSlideIndexForGuides:v,password:S}=t,[w,C]=Jm.useState(false),[T,M]=Jm.useState(""),[_,E]=Jm.useState(0),[R,I]=Jm.useState(""),L=Jm.useRef(null),k={setExportModalOpen:C,setExportModalTitle:M,setExportProgress:E,setExportStatusMessage:I,exportAbortRef:L},{handlePackageForSharing:F,handleSaveAsFormat:N,handleSaveAsPptx:D,handleSaveAsPpsx:U,handleSaveAsPptm:G}=tue({slides:e,templateElementsBySlideId:n,filePath:i,handlerRef:l,serializeSlides:c,headerFooter:d,presentationProperties:u,customShows:p,sections:h,coreProperties:f,appProperties:m,customProperties:x,notesMaster:g,handoutMaster:y,guides:b,activeSlideIndexForGuides:v,modalControls:k,password:S}),j=Jm.useCallback(async()=>{let ce=s.current;if(ce)try{await Oz(ce,o,{backgroundColor:r?.backgroundColor});}catch(ae){console.error("[PowerPointViewer] PNG export failed:",ae);}},[s,o,r?.backgroundColor]),Y=Jm.useCallback(async()=>{if(!s.current)return;let ce=new AbortController;L.current=ce,M("Export as PDF"),I("Capturing slides..."),E(0),C(true);try{await Uz(s,e.length,a,o,"presentation.pdf",{scale:2,onProgress:(ae,_e)=>{E(ST(ae,_e)),I(zy("Rendering",ae,_e));},signal:ce.signal}),E(bT),I("Building PDF..."),await new Promise(ae=>{setTimeout(ae,100);}),E(vT),I("Done!");}catch(ae){wT(ae)||console.error("[PowerPointViewer] PDF export failed:",ae);}finally{L.current=null,C(false);}},[s,e.length,a,o]),ge=Jm.useCallback(async()=>{if(!s.current)return;let ce=new AbortController;L.current=ce,M("Export as PDF (Notes)"),I("Capturing slides..."),E(0),C(true);try{let ae=e.map(_e=>_e.notes);await Hz(s,e.length,a,o,ae,"presentation-notes.pdf",{scale:2,onProgress:(_e,xe)=>{E(ST(_e,xe)),I(zy("Rendering",_e,xe));},signal:ce.signal}),E(bT),I("Building PDF..."),await new Promise(_e=>{setTimeout(_e,100);}),E(vT),I("Done!");}catch(ae){wT(ae)||console.error("[PowerPointViewer] Notes PDF export failed:",ae);}finally{L.current=null,C(false);}},[s,e,a,o]),fe=Jm.useCallback(async()=>{let ce=s.current;if(ce)try{await Bz(ce,{backgroundColor:r?.backgroundColor});}catch(ae){console.error("[PowerPointViewer] Copy slide as image failed:",ae);}},[s,r?.backgroundColor]),de=Jm.useCallback(async()=>{if(!s.current)return;let ce=new AbortController;L.current=ce,M("Export as Video"),I("Capturing slides..."),E(0),C(true);try{let ae=await zz(s,e.length,a,o,{scale:1,slideDurationMs:3e3,onProgress:(_e,xe)=>{E(ST(_e,xe,45)),I(zy("Capturing",_e,xe));},onRecordProgress:(_e,xe)=>{E(Ene(_e,xe)),I(zy("Recording",_e,xe));},signal:ce.signal});E(bT),I("Saving file..."),nN(ae,"presentation.webm"),E(vT);}catch(ae){wT(ae)||console.error("[PowerPointViewer] Video export failed:",ae);}finally{L.current=null,C(false);}},[s,e.length,a,o]),J=Jm.useCallback(async()=>{if(!s.current)return;let ce=new AbortController;L.current=ce,M("Export as GIF"),I("Capturing slides..."),E(0),C(true);try{let ae=await Vz(s,e.length,a,o,{scale:.5,slideDurationMs:2e3,onProgress:(_e,xe)=>{E(ST(_e,xe)),I(zy("Encoding",_e,xe));},signal:ce.signal});E(bT),I("Saving file..."),nN(ae,"presentation.gif"),E(vT);}catch(ae){wT(ae)||console.error("[PowerPointViewer] GIF export failed:",ae);}finally{L.current=null,C(false);}},[s,e.length,a,o]),re=Jm.useCallback(()=>{L.current?.abort(),L.current=null,C(false),E(0);},[]);return {handleExportPng:j,handleExportPdf:Y,handleExportNotesPdf:ge,handleCopySlideAsImage:fe,handleExportVideo:de,handleExportGif:J,handlePackageForSharing:F,handleSaveAsFormat:N,handleSaveAsPptx:D,handleSaveAsPpsx:U,handleSaveAsPptm:G,handleCancelExport:re,exportModalOpen:w,exportModalTitle:T,exportProgress:_,exportStatusMessage:R}}function Eet(t){return t.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#39;")}function oN(t){return typeof t!="string"||!t.startsWith("data:image/")?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgAAIAAAUAAen63NgAAAAASUVORK5CYII=":Eet(t)}function iN(t,e,n,r,o){let i=window.open("","_blank","noopener,noreferrer");if(!i)return false;let s=o?"img.slide-img, .notes-slide, .handout-cell img { border: 2px solid #000 !important; }":"";return i.document.open(),i.document.write(`<!doctype html>
4810
4810
  <html>
@@ -4866,7 +4866,7 @@ ${e}`),Qle=(t,e,n)=>{let r=Jn(e),o=sn(),i=vt(r),s=t.messageHandlers[i];return s?
4866
4866
  src: local("${s}"), local("${s} Regular");
4867
4867
  font-display: swap;
4868
4868
  }`]).join(`
4869
- `);return o.textContent=i,document.head.appendChild(o),()=>{let s=document.getElementById(xue);s&&document.head.removeChild(s);}},[n]);}function aV(t){let{content:e,filePath:n,autosaveEnabled:r=true,slides:o,state:i,history:s,ops:a,actionSoundHandlerRef:l,setIsEncryptedDialogOpen:c,password:d}=t,{handlerRef:u}=Tz({content:e,clearSelection:a.clearSelection,history:s,setSlides:i.setSlides,setTemplateElementsBySlideId:i.setTemplateElementsBySlideId,mediaDataUrls:i.mediaDataUrls,setCanvasSize:i.setCanvasSize,setHeaderFooter:i.setHeaderFooter,setLayoutOptions:i.setLayoutOptions,setSlideMasters:i.setSlideMasters,setTheme:i.setTheme,setTableStyleMap:i.setTableStyleMap,setThemeOptions:i.setThemeOptions,setCustomShows:i.setCustomShows,setSections:i.setSections,setPresentationProperties:i.setPresentationProperties,setNotesMaster:i.setNotesMaster,setHandoutMaster:i.setHandoutMaster,setNotesCanvasSize:i.setNotesCanvasSize,setCustomProperties:i.setCustomProperties,setTagCollections:i.setTagCollections,setCoreProperties:i.setCoreProperties,setAppProperties:i.setAppProperties,setEmbeddedFonts:i.setEmbeddedFonts,setActiveSlideIndex:i.setActiveSlideIndex,setHasMacros:i.setHasMacros,setHasDigitalSignatures:i.setHasDigitalSignatures,setDigitalSignatureCount:i.setDigitalSignatureCount,setGuides:i.setGuides,setLoading:i.setLoading,setError:i.setError,setIsDirty:i.setIsDirty,setIsEncrypted:c});Jm.useEffect(()=>{l.current=u.current;},[u,l,i.loading]),bue({embeddedFonts:i.embeddedFonts,slides:o});let p=tV({slides:o,templateElementsBySlideId:i.templateElementsBySlideId,activeSlideIndex:i.activeSlideIndex,guides:i.guides,headerFooter:i.headerFooter,presentationProperties:i.presentationProperties,customShows:i.customShows,sections:i.sections,coreProperties:i.coreProperties,appProperties:i.appProperties,customProperties:i.customProperties,notesMaster:i.notesMaster,handoutMaster:i.handoutMaster,handlerRef:u,inlineEditingElementIdRef:i.inlineEditingElementIdRef,inlineEditingTextRef:i.inlineEditingTextRef,password:d}),{autosaveStatus:h}=Cz({isDirty:i.isDirty,filePath:n,serializeSlides:p,enabled:r});return {handlerRef:u,serializeSlides:p,autosaveStatus:h}}var ltt=2,ctt=20;function vue(t){let e=Jm.useRef(t);e.current=t;let n=Jm.useCallback(r=>{let{mode:o,canEdit:i,inlineEditingElementId:s,tableEditorState:a,activeTool:l,hasSelection:c,onDelete:d,onCopy:u,onCut:p,onPaste:h,onDuplicate:f,onUndo:m,onRedo:x,onSelectAll:g,onEscape:y,onNudge:b,onPrevSlide:v,onNextSlide:S}=e.current;if(o!=="edit"||!i)return;let w=r.target,C=w?.tagName==="INPUT"||w?.tagName==="TEXTAREA"||w?.isContentEditable;if(r.key==="Escape"){r.preventDefault(),y();return}if(s||a?.isEditing||l!=="select"||C)return;let T=r.metaKey||r.ctrlKey;if((r.key==="Delete"||r.key==="Backspace")&&c){r.preventDefault(),d();return}if(T)switch(r.key.toLowerCase()){case "z":r.preventDefault(),r.shiftKey?x():m();return;case "y":r.preventDefault(),x();return;case "c":c&&(r.preventDefault(),u());return;case "x":c&&(r.preventDefault(),p());return;case "v":r.preventDefault(),h();return;case "d":c&&(r.preventDefault(),f());return;case "a":r.preventDefault(),g();return}if(c&&(r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="ArrowLeft"||r.key==="ArrowRight")){r.preventDefault();let M=r.shiftKey?ctt:ltt,_=0,E=0;switch(r.key){case "ArrowUp":E=-M;break;case "ArrowDown":E=M;break;case "ArrowLeft":_=-M;break;case "ArrowRight":_=M;break}b(_,E);return}!c&&(r.key==="ArrowLeft"||r.key==="ArrowRight")&&(r.preventDefault(),r.key==="ArrowLeft"?v?.():S?.());},[]);Jm.useEffect(()=>{let r=t.containerRef.current;return r&&r.addEventListener("keydown",n),window.addEventListener("keydown",n),()=>{r&&r.removeEventListener("keydown",n),window.removeEventListener("keydown",n);}},[t.containerRef,n]);}function lV(t){let{state:e,mode:n,canEdit:r,slides:o,activeSlide:i,ops:s,manipulation:a,history:l}=t;vue({containerRef:e.containerRef,mode:n,canEdit:r,inlineEditingElementId:e.inlineEditingElementId,tableEditorState:e.tableEditorState,activeTool:e.activeTool,hasSelection:e.effectiveSelectedIds.length>0,effectiveSelectedIds:e.effectiveSelectedIds,onDelete:a.handleDelete,onCopy:a.handleCopy,onCut:a.handleCut,onPaste:a.handlePaste,onDuplicate:a.handleDuplicate,onUndo:l.handleUndo,onRedo:l.handleRedo,onSelectAll:()=>{if(!i)return;let c=i.elements.map(d=>d.id);c.length>0&&s.applySelection(c[0],c);},onEscape:()=>{e.inlineEditingElementId?(e.setInlineEditingElementId(null),e.setInlineEditingText("")):e.contextMenuState?e.setContextMenuState(null):e.tableEditorState?e.setTableEditorState(null):s.clearSelection();},onNudge:(c,d)=>{let u=e.effectiveSelectedIds;if(u.length){for(let p of u){let h=e.elementLookup.get(p);h&&s.updateElementById(p,{x:h.x+c,y:h.y+d});}l.markDirty();}},onPrevSlide:()=>{o.length!==0&&e.setActiveSlideIndex(c=>Math.max(0,c-1));},onNextSlide:()=>{o.length!==0&&e.setActiveSlideIndex(c=>Math.min(o.length-1,c+1));}});}function cV(t){let{state:e,zoom:n,history:r,presentation:o,annotations:i,actionSoundHandlerRef:s,editorOps:a,dialogs:l,gridSpacingPx:c,content:d,filePath:u,autosaveEnabled:p,canEdit:h,mode:f,slides:m,activeSlide:x,activeSlideIndex:g,canvasSize:y,loading:b,error:v,ref:S,setContent:w,onContentChange:C,onDirtyChange:T,onActiveSlideChange:M,onModeChange:_,onZoomChange:E,onSelectionChange:R,onSlideCountChange:I}=t;Pz({editorScale:n.editorScale,canvasStageRef:n.canvasStageRef,canvasSize:y,activeSlide:x,activeSlideIndex:g,gridSpacingPx:c,dragStateRef:e.dragStateRef,resizeStateRef:e.resizeStateRef,shapeAdjustmentDragStateRef:e.shapeAdjustmentDragStateRef,marqueeStateRef:e.marqueeStateRef,editTemplateMode:e.editTemplateMode,snapToGrid:e.snapToGrid,snapToShape:e.snapToShape,guides:e.guides,templateElements:e.templateElements,elementLookup:e.elementLookup,setMarqueeSelectionState:e.setMarqueeSelectionState,setSnapLines:e.setSnapLines,setTemplateElementsBySlideId:e.setTemplateElementsBySlideId,setPointerCommitNonce:e.setPointerCommitNonce,effectiveSelectedIds:e.effectiveSelectedIds,applySelection:a.ops.applySelection,clearSelection:a.ops.clearSelection,updateSlides:a.ops.updateSlides,updateElementById:a.ops.updateElementById,markDirty:r.markDirty});let[L,k]=Jm.useState(false),{handlerRef:F,serializeSlides:N,autosaveStatus:D}=aV({content:d,filePath:u,autosaveEnabled:p,slides:m,state:e,history:r,ops:a.ops,actionSoundHandlerRef:s,setIsEncryptedDialogOpen:k,password:l.presentationPassword??void 0}),{exportHandlers:U,printHandlers:G,themeHandlers:j,propertyHandlers:Y}=iV({state:e,slides:m,activeSlideIndex:g,canvasSize:y,filePath:u,history:r,ops:a.ops,zoom:n,handlerRef:F,serializeSlides:N,setContent:w,onContentChange:C,password:l.presentationPassword??void 0}),{showKeepAnnotationsDialog:ge,handleSetMode:fe,handleKeepAnnotations:de,handleDiscardAnnotations:J,handleEnterPresenterView:re,handleEnterRehearsalMode:ce}=eV({mode:f,presentation:o,annotations:i,history:r,setMode:e.setMode,setSlides:e.setSlides});return nV({filePath:u,loading:b,error:v,slideCount:m.length,openVersionHistory:()=>Y.setIsVersionHistoryOpen(true)}),Jm.useImperativeHandle(S,()=>({async getContent(){let ae=await N();return ae&&C&&C(ae),ae??new Uint8Array(0)},goTo(ae){ae>=0&&ae<m.length&&e.setActiveSlideIndex(ae);},goPrev(){let ae=g-1;ae>=0&&e.setActiveSlideIndex(ae);},goNext(){let ae=g+1;ae<m.length&&e.setActiveSlideIndex(ae);},undo(){r.handleUndo();},redo(){r.handleRedo();},canUndo(){return r.canUndo},canRedo(){return r.canRedo},getZoom(){return n.scale},setZoom(ae){n.setScale(Math.min(Math.max(ae,.2),5));},zoomIn(){n.handleZoomIn();},zoomOut(){n.handleZoomOut();},zoomReset(){n.handleResetZoom();},getMode(){return f},setMode(ae){e.setMode(ae);},getActiveSlideIndex(){return g},getSlideCount(){return m.length},isDirty(){return e.isDirty},getSelectedElementIds(){return e.selectedElementIds},selectElements(ae){e.setSelectedElementIds(ae),e.setSelectedElementId(ae[0]??null);},clearSelection(){e.setSelectedElementIds([]),e.setSelectedElementId(null);},setActiveSlideIndex(ae){ae>=0&&ae<m.length&&e.setActiveSlideIndex(ae);},getSlides(){return m},getSlide(ae){return m[ae]},getActiveSlide(){return m[g]},addSlide(ae){a.slideOps.handleAddSlide();},deleteSlides(ae){a.slideOps.handleDeleteSlides(ae);},duplicateSlides(ae){a.slideOps.handleDuplicateSlides(ae);},moveSlide(ae,_e){a.slideOps.handleMoveSlide(ae,_e);},toggleHideSlides(ae){a.slideOps.handleToggleHideSlides(ae);},getElements(ae){return m[ae??g]?.elements??[]},getElementById(ae,_e){return m[_e??g]?.elements.find(W=>W.id===ae)},updateElement(ae,_e){a.ops.updateElementById(ae,_e);},deleteElements(ae){e.setSelectedElementIds(ae),e.setSelectedElementId(ae[0]??null),a.manipulation.handleDelete();},duplicateElement(ae){return e.setSelectedElementIds([ae]),e.setSelectedElementId(ae),a.manipulation.handleDuplicate(),e.selectedElementIds[0]}}),[N,C,m,g,e,r,n,f,a]),Jm.useEffect(()=>{T&&T(e.isDirty);},[e.isDirty,T]),Jm.useEffect(()=>{M&&M(g);},[g,M]),Jm.useEffect(()=>{e.activeSlideIndexRef.current=g;},[g,e.activeSlideIndexRef]),Jm.useEffect(()=>{_&&_(f);},[f,_]),Jm.useEffect(()=>{E&&E(n.scale);},[n.scale,E]),Jm.useEffect(()=>{R&&R(e.selectedElementIds);},[e.selectedElementIds,R]),Jm.useEffect(()=>{I&&I(m.length);},[m.length,I]),lV({state:e,mode:f,canEdit:h,slides:m,activeSlide:x,ops:a.ops,manipulation:a.manipulation,history:r}),{exportHandlers:U,printHandlers:G,themeHandlers:j,propertyHandlers:Y,showKeepAnnotationsDialog:ge,handleSetMode:fe,handleKeepAnnotations:de,handleDiscardAnnotations:J,handleEnterPresenterView:re,handleEnterRehearsalMode:ce,autosaveStatus:D,isEncryptedDialogOpen:L,setIsEncryptedDialogOpen:k}}function gtt(){return typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function xtt(){return false}function ytt(t){if(typeof window>"u")return ()=>{};let e=window.matchMedia("(prefers-reduced-motion: reduce)");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}function dV(){let t=Jm.useSyncExternalStore(ytt,gtt,xtt),[e,n]=Jm.useState(false),r=t||e,o=Jm.useCallback(()=>{n(i=>!i);},[]);return Jm.useEffect(()=>{let i=document.documentElement;return r?i.classList.add("pptx-reduced-motion"):i.classList.remove("pptx-reduced-motion"),()=>{i.classList.remove("pptx-reduced-motion");}},[r]),{osReducedMotion:t,manualReducedMotion:e,reducedMotion:r,toggleReducedMotion:o,setManualReducedMotion:n}}Pe();var btt=5e3;function uV({doc:t,slides:e,templateElementsBySlideId:n,setSlides:r,isConnected:o,isSynced:i=true,config:s,getSourceBytes:a}){let l=Jm.useRef(false),c=Jm.useRef(""),d=Jm.useRef(false),u=Jm.useRef(null),p=Jm.useRef(null),h=Jm.useCallback(async()=>{if(p.current)return p.current;let m=await Promise.resolve().then(()=>(BC(),OC)),x={createMap:()=>new m.Map,createArray:()=>new m.Array,createText:()=>new m.Text};return p.current=x,x},[]),f=Jm.useCallback(()=>{if(!s?.onWriteBack||s.role!=="owner"||!t)return;u.current!==null&&clearTimeout(u.current);let m=s.writeBackDebounceMs??btt;u.current=setTimeout(async()=>{if(u.current=null,!t||!s.onWriteBack)return;let x=a?.();if(x)try{let{PptxHandler:g}=await Promise.resolve().then(()=>(bt(),wq)),y=new g;await y.load(x.buffer);let b=CU(t),v=Jy(b,n),S=await y.save(v);s.onWriteBack(S);}catch{}},m);},[t,s,a,n]);Jm.useEffect(()=>{if(!o||!i||!t||l.current||e.length===0)return;let m=JSON.stringify(e);m!==c.current&&(c.current=m,(async()=>{let x=await h();yne(e,t,x,jA),f();})());},[t,e,o,i,h,f]),Jm.useEffect(()=>{if(!o||!t)return;let m=(g,y)=>{if(y?.origin===jA)return;let b=CU(t);if(b.length===0)return;let v=JSON.stringify(b);v!==c.current&&(c.current=v,l.current=true,r(b),requestAnimationFrame(()=>{l.current=false;}),f());},x=hne(t,m);return d.current||(d.current=true,t.getArray("pptx:slides").length>0&&m()),()=>{x(),u.current!==null&&(clearTimeout(u.current),u.current=null);}},[t,o,r,f]);}function pV({collab:t,activeSlideIndex:e,setActiveSlideIndex:n,slideCount:r,paused:o=false}){let i=Jm.useRef(-1);Jm.useEffect(()=>{if(!t||o||t.config.role!=="viewer")return;let s=t.remoteUsers.find(l=>l.role==="owner");if(!s)return;let a=s.activeSlideIndex;a<0||a>=r||a!==i.current&&(i.current=a,a!==e&&n(a));},[t,e,n,r,o]);}function fV({collab:t,activeSlideIndex:e,setActiveSlideIndex:n,slideCount:r}){let[o,i]=Jm.useState(null),s=Jm.useRef(-1),a=Jm.useCallback(d=>{s.current=-1,i(d);},[]),l=o===null?null:t?.remoteUsers.find(d=>d.clientId===o)??null;Jm.useEffect(()=>{o!==null&&t&&l===null&&i(null);},[t,o,l]);let c=l?.activeSlideIndex??null;return Jm.useEffect(()=>{if(!(c===null||c<0||c>=r)){if(c===e){s.current=c;return}s.current=c,n(c);}},[c,r,n]),Jm.useEffect(()=>{o!==null&&s.current!==-1&&e!==s.current&&i(null);},[e,o]),{followedClientId:o,followUser:a}}Pe();Pe();function gV(t){let{targetRef:e,currentScale:n,callbacks:r,enabled:o=true}=t,i=Jm.useRef(r);i.current=r;let s=Jm.useRef(n);s.current=n;let[a,l]=Jm.useState(0),c=Jm.useRef(null);e.current!==c.current&&(c.current=e.current,queueMicrotask(()=>l(d=>d+1))),Jm.useEffect(()=>{let d=e.current;if(!d||!o)return;let u=Jne({getScale:()=>s.current,minScale:.2,maxScale:5,callbacks:{onPinchZoom:x=>i.current.onPinchZoom?.(x),onSwipe:x=>i.current.onSwipe?.(x),onLongPress:(x,g)=>i.current.onLongPress?.(x,g)}}),p=x=>u.onTouchStart(x),h=x=>u.onTouchMove(x),f=x=>u.onTouchEnd(x),m=()=>u.onTouchCancel();return d.addEventListener("touchstart",p,{passive:false}),d.addEventListener("touchmove",h,{passive:false}),d.addEventListener("touchend",f,{passive:true}),d.addEventListener("touchcancel",m,{passive:true}),()=>{d.removeEventListener("touchstart",p),d.removeEventListener("touchmove",h),d.removeEventListener("touchend",f),d.removeEventListener("touchcancel",m),u.cancel();}},[e,o,a]);}Pe();function Rtt(t){if(!(t instanceof HTMLElement))return false;let e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||t.isContentEditable}function Tue(t){if(t<=0||typeof document>"u")return;let e=document.activeElement;if(!Rtt(e))return;let n=e.getBoundingClientRect(),r=Fne({top:n.top,bottom:n.bottom},window.innerHeight,t);r!==0&&window.scrollBy({top:r,behavior:"smooth"});}function xV(t=true){let[e,n]=Jm.useState(0);return Jm.useEffect(()=>{if(!t||typeof window>"u")return;let r=window.visualViewport;if(!r)return;let o=()=>{let s=EU(window),a=s?PU(s):0;n(a),a>0&&window.requestAnimationFrame(()=>Tue(a));};o(),r.addEventListener("resize",o),r.addEventListener("scroll",o);let i=()=>{window.requestAnimationFrame(()=>{let s=EU(window),a=s?PU(s):0;a>0&&Tue(a);});};return document.addEventListener("focusin",i),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o),document.removeEventListener("focusin",i);}},[t]),{keyboardInset:e,isKeyboardOpen:Dne(e)}}var Ltt=[{value:"lpwstr",labelKey:"pptx.documentProperties.custom.typeText"},{value:"i4",labelKey:"pptx.documentProperties.custom.typeNumber"},{value:"filetime",labelKey:"pptx.documentProperties.custom.typeDate"},{value:"bool",labelKey:"pptx.documentProperties.custom.typeYesNo"}];function yV({customProperties:t,onUpdate:e}){let{t:n}=reactI18next.useTranslation(),r=Jm.useCallback(()=>{e([...t,{name:"",value:"",type:"lpwstr"}]);},[t,e]),o=Jm.useCallback(l=>{e(t.filter((c,d)=>d!==l));},[t,e]),i=Jm.useCallback((l,c)=>{e(t.map((d,u)=>u===l?{...d,name:c}:d));},[t,e]),s=Jm.useCallback((l,c)=>{e(t.map((d,u)=>u===l?{...d,value:c}:d));},[t,e]),a=Jm.useCallback((l,c)=>{e(t.map((d,u)=>u===l?{...d,type:c}:d));},[t,e]);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:n("pptx.documentProperties.custom.description")}),jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr_1fr_100px_32px] gap-1 text-[11px] font-medium text-muted-foreground px-1",children:[jsxRuntime.jsx("span",{children:n("pptx.documentProperties.custom.name")}),jsxRuntime.jsx("span",{children:n("pptx.documentProperties.custom.value")}),jsxRuntime.jsx("span",{children:n("pptx.documentProperties.custom.type")}),jsxRuntime.jsx("span",{})]}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto space-y-1",children:t.map((l,c)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr_1fr_100px_32px] gap-1 items-center",children:[jsxRuntime.jsx("input",{type:"text",className:"w-full rounded border border-border bg-muted px-2 py-1 text-xs text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",placeholder:n("pptx.documentProperties.custom.namePlaceholder"),value:l.name,onChange:d=>i(c,d.target.value)}),l.type==="bool"?jsxRuntime.jsxs("select",{className:"w-full rounded border border-border bg-muted px-2 py-1 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:l.value,onChange:d=>s(c,d.target.value),children:[jsxRuntime.jsx("option",{value:"true",children:n("pptx.documentProperties.custom.yes")}),jsxRuntime.jsx("option",{value:"false",children:n("pptx.documentProperties.custom.no")})]}):jsxRuntime.jsx("input",{type:l.type==="i4"?"number":"text",className:"w-full rounded border border-border bg-muted px-2 py-1 text-xs text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",placeholder:n("pptx.documentProperties.custom.valuePlaceholder"),value:l.value,onChange:d=>s(c,d.target.value)}),jsxRuntime.jsx("select",{className:"w-full rounded border border-border bg-muted px-2 py-1 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:l.type,onChange:d=>a(c,d.target.value),children:Ltt.map(d=>jsxRuntime.jsx("option",{value:d.value,children:n(d.labelKey)},d.value))}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o(c),className:"p-1 rounded hover:bg-red-500/20 text-muted-foreground hover:text-red-400 transition-colors","aria-label":n("pptx.documentProperties.custom.deleteProperty"),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3.5 h-3.5"})})]},`custom-prop-${c}`))}),t.length===0&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground/60 text-center py-4",children:n("pptx.documentProperties.custom.empty")}),jsxRuntime.jsxs("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg border border-border text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuPlus,{className:"w-3.5 h-3.5"}),n("pptx.documentProperties.custom.addProperty")]})]})}var Ott=[{key:"application",labelKey:"pptx.documentProperties.statistics.application",editable:false},{key:"appVersion",labelKey:"pptx.documentProperties.statistics.appVersion",editable:false},{key:"presentationFormat",labelKey:"pptx.documentProperties.statistics.presentationFormat",editable:false},{key:"slides",labelKey:"pptx.documentProperties.statistics.slides",editable:false},{key:"hiddenSlides",labelKey:"pptx.documentProperties.statistics.hiddenSlides",editable:false},{key:"notes",labelKey:"pptx.documentProperties.statistics.notes",editable:false},{key:"totalTime",labelKey:"pptx.documentProperties.statistics.totalTime",editable:false},{key:"words",labelKey:"pptx.documentProperties.statistics.words",editable:false},{key:"paragraphs",labelKey:"pptx.documentProperties.statistics.paragraphs",editable:false},{key:"template",labelKey:"pptx.documentProperties.statistics.template",editable:false},{key:"company",labelKey:"pptx.documentProperties.summary.company",editable:true},{key:"manager",labelKey:"pptx.documentProperties.summary.manager",editable:true}];function Btt(t,e){if(t==null)return e("pptx.documentProperties.statistics.notAvailable");let n=Math.floor(t/60),r=t%60;return e("pptx.documentProperties.statistics.hoursMinutes",{hours:n,minutes:r})}function Utt(t,e,n){return t==="totalTime"?Btt(e,n):e==null?n("pptx.documentProperties.statistics.notAvailable"):String(e)}function bV({appProperties:t,onUpdateAppProperties:e,canEdit:n}){let{t:r}=reactI18next.useTranslation(),o=Jm.useCallback((i,s)=>{e({[i]:s});},[e]);return jsxRuntime.jsx("div",{className:"space-y-3",children:Ott.map(({key:i,labelKey:s,editable:a})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("label",{className:"block text-xs text-foreground w-[140px] shrink-0",children:r(s)}),a&&n?jsxRuntime.jsx("input",{type:"text",className:"flex-1 rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:String(t[i]??""),onChange:l=>o(i,l.target.value)}):jsxRuntime.jsx("span",{className:"flex-1 px-3 py-2 text-sm text-muted-foreground",children:Utt(i,t[i],r)})]},i))})}var Cue=[{key:"title",labelKey:"pptx.properties.titleLabel"},{key:"subject",labelKey:"pptx.properties.subject"},{key:"creator",labelKey:"pptx.properties.author"},{key:"keywords",labelKey:"pptx.properties.keywords"},{key:"description",labelKey:"pptx.documentProperties.summary.description",multiline:true},{key:"category",labelKey:"pptx.documentProperties.summary.category"}];function vV({isOpen:t,coreProperties:e,customProperties:n,appProperties:r,onClose:o,onSave:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState("summary"),[c,d]=Jm.useState({}),[u,p]=Jm.useState([]),[h,f]=Jm.useState({}),[m,x]=Jm.useState(false);t&&!m&&(d({...e}),p(n.map(M=>({...M}))),f({company:r?.company,manager:r?.manager}),l("summary")),t!==m&&x(t);let g=Jm.useCallback((M,_)=>{d(E=>({...E,[M]:_}));},[]),y=Jm.useMemo(()=>{if(Cue.some(({key:R})=>(c[R]??"")!==(e[R]??"")))return true;let _=(h.company??"")!==(r?.company??""),E=(h.manager??"")!==(r?.manager??"");return _||E||u.length!==n.length?true:u.some((R,I)=>R.name!==n[I]?.name||R.value!==n[I]?.value||R.type!==n[I]?.type)},[c,u,h,e,n,r]),b=Jm.useCallback(M=>{f(_=>({..._,...M}));},[]),v=Jm.useCallback(()=>{let M=(h.company??"")!==(r?.company??"")||(h.manager??"")!==(r?.manager??"");i(c,u,M?h:void 0),o();},[c,u,h,r,i,o]),S=Jm.useCallback(()=>{o();},[o]),{panelStyle:w,handlers:C}=pi(S);if(!t)return null;let T=[{id:"summary",labelKey:"pptx.documentProperties.tabs.general"},{id:"custom",labelKey:"pptx.documentProperties.tabs.custom"},{id:"statistics",labelKey:"pptx.documentProperties.tabs.statistics"}];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":s("common.close"),onClick:S}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{style:w,className:"pointer-events-auto w-[520px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...C,className:"flex items-center justify-between px-5 py-4 border-b border-border/60 touch-none",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuFileText,{className:"w-5 h-5 text-primary"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("pptx.documentProperties.dialogTitle")})]}),jsxRuntime.jsx("button",{type:"button",onClick:S,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":s("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"flex border-b border-border/60",children:T.map(M=>jsxRuntime.jsx("button",{type:"button",onClick:()=>l(M.id),className:`px-4 py-2 text-xs font-medium transition-colors ${a===M.id?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-foreground"}`,children:s(M.labelKey)},M.id))}),jsxRuntime.jsxs("div",{className:"px-5 py-4 min-h-[280px]",children:[a==="summary"&&jsxRuntime.jsx("div",{className:"space-y-3",children:Cue.map(({key:M,labelKey:_,multiline:E})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-foreground mb-1",children:s(_)}),E?jsxRuntime.jsx("textarea",{className:"w-full rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none resize-none",rows:3,value:c[M]??"",onChange:R=>g(M,R.target.value)}):jsxRuntime.jsx("input",{type:"text",className:"w-full rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:c[M]??"",onChange:R=>g(M,R.target.value)})]},M))}),a==="custom"&&jsxRuntime.jsx(yV,{customProperties:u,onUpdate:p}),a==="statistics"&&jsxRuntime.jsx(bV,{appProperties:{...r,company:h.company,manager:h.manager},onUpdateAppProperties:b,canEdit:true})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border/60",children:[jsxRuntime.jsx("button",{type:"button",onClick:S,className:"px-3 py-1.5 text-xs rounded-lg border border-border text-foreground hover:bg-muted transition-colors",children:s("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:v,disabled:!y,className:"px-3 py-1.5 text-xs rounded-lg bg-primary text-white hover:bg-primary/80 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:s("common.save")})]})]})})]})}function Qtt(t){if(typeof document>"u")return false;try{return document.fonts.check(`12px "${t}"`)}catch{return false}}function wV({isOpen:t,embedFontsEnabled:e,usedFontFamilies:n,embeddedFonts:r,onClose:o,onToggleEmbedFonts:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState(new Set),[c,d]=Jm.useState(false),[u,p]=Jm.useState(false),h=Jm.useCallback(async()=>{d(true);try{await document.fonts.ready;let x=new Set;for(let g of n)Qtt(g)&&x.add(g);l(x),p(!0);}catch{}finally{d(false);}},[n]);if(Jm.useEffect(()=>{t&&!u&&h();},[t,u,h]),!t)return null;let f=n.filter(x=>!a.has(x)),m=new Set(r);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":s("common.close"),onClick:o}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[460px] max-h-[80vh] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl flex flex-col max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60 shrink-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuType,{className:"w-5 h-5 text-primary"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("pptx.fonts.embedFonts")})]}),jsxRuntime.jsx("button",{type:"button",onClick:o,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":s("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsxs("div",{className:"px-5 py-4 space-y-4 overflow-y-auto flex-1",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:s("pptx.fonts.embedDescription")}),jsxRuntime.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"sr-only",checked:e,onChange:x=>i(x.target.checked)}),jsxRuntime.jsx("div",{className:`w-9 h-5 rounded-full transition-colors ${e?"bg-primary":"bg-muted-foreground"}`}),jsxRuntime.jsx("div",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${e?"translate-x-4":""}`})]}),jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:s("pptx.fonts.enableEmbedding")})]}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("h3",{className:"text-xs font-medium text-foreground",children:[s("pptx.fonts.usedFonts")," (",n.length,")"]}),c?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 py-4 justify-center",children:[jsxRuntime.jsx(lu$1.LuLoader,{className:"w-4 h-4 text-muted-foreground animate-spin"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:s("pptx.fonts.scanning")})]}):jsxRuntime.jsx("div",{className:"space-y-1 max-h-[280px] overflow-y-auto",children:n.map(x=>{let g=a.has(x),y=m.has(x);return jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-muted/60",children:[jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:x}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[y&&jsxRuntime.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-green-900/40 text-green-400 border border-green-700/40",children:s("pptx.fonts.embedded")}),g?jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3.5 h-3.5 text-green-400"}):jsxRuntime.jsx("span",{className:"text-[10px] text-yellow-400",children:s("pptx.fonts.notFound")})]})]},x)})})]}),f.length>0&&!c&&jsxRuntime.jsx("p",{className:"text-[11px] text-yellow-400/80",children:s("pptx.fonts.missingWarning",{count:f.length})})]}),jsxRuntime.jsx("div",{className:"flex items-center justify-end px-5 py-3 border-t border-border/60 shrink-0",children:jsxRuntime.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-xs rounded-lg bg-primary text-white hover:bg-primary/80 transition-colors",children:s("common.done")})})]})})]})}function CV({isOpen:t,onClose:e,hasSignatures:n,signatureCount:r}){let{t:o}=reactI18next.useTranslation();return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":o("common.close"),onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[420px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[n?jsxRuntime.jsx(lu$1.LuShieldCheck,{className:"w-5 h-5 text-green-400"}):jsxRuntime.jsx(lu$1.LuShieldAlert,{className:"w-5 h-5 text-amber-400"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:o("pptx.digitalSignatures.title")})]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":o("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"px-5 py-6 space-y-4",children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-green-900/20 border border-green-700/30 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuSignature,{className:"w-5 h-5 text-green-400 shrink-0 mt-0.5"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("p",{className:"text-xs text-green-200",children:o("pptx.digitalSignatures.signed")}),jsxRuntime.jsx("p",{className:"text-[11px] text-green-300/70",children:o("pptx.digitalSignatures.signatureCount",{count:r})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-amber-900/20 border border-amber-700/30 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuInfo,{className:"w-5 h-5 text-amber-400 shrink-0 mt-0.5"}),jsxRuntime.jsx("p",{className:"text-xs text-amber-200",children:o("pptx.digitalSignatures.editWarning")})]})]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-muted/30 border border-border/40 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuInfo,{className:"w-5 h-5 text-muted-foreground shrink-0 mt-0.5"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:o("pptx.digitalSignatures.noSignatures")})]})})}),jsxRuntime.jsx("div",{className:"flex items-center justify-end px-5 py-3 border-t border-border/60",children:jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-xs rounded-lg bg-accent text-foreground hover:bg-accent/80 transition-colors",children:o("common.close")})})]})})]}):null}function MV({hasSignatures:t,signatureCount:e,onClick:n}){let{t:r}=reactI18next.useTranslation();return !t||e===0?null:jsxRuntime.jsxs("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1 px-2 py-0.5 text-[11px] font-medium rounded-md bg-green-900/30 border border-green-700/40 text-green-300 hover:bg-green-900/50 transition-colors",title:r("pptx.digitalSignatures.signatureCount",{count:e}),children:[jsxRuntime.jsx(lu$1.LuShieldCheck,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:r("pptx.digitalSignatures.badge")})]})}function _V({isOpen:t,signatureCount:e,onConfirm:n,onCancel:r}){let{t:o}=reactI18next.useTranslation();return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":o("common.close"),onClick:r}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[440px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuTriangleAlert,{className:"w-5 h-5 text-amber-400"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:o("pptx.digitalSignatures.strippedTitle")})]}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":o("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"px-5 py-6",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-amber-900/20 border border-amber-700/30 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuTriangleAlert,{className:"w-5 h-5 text-amber-400 shrink-0 mt-0.5"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("p",{className:"text-xs text-amber-200",children:o("pptx.digitalSignatures.strippedMessage",{count:e})}),jsxRuntime.jsx("p",{className:"text-[11px] text-amber-300/70",children:o("pptx.digitalSignatures.editWarning")})]})]})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border/60",children:[jsxRuntime.jsx("button",{type:"button",onClick:r,className:"px-3 py-1.5 text-xs rounded-lg bg-accent text-foreground hover:bg-accent/80 transition-colors",children:o("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-xs rounded-lg bg-amber-600 text-white hover:bg-amber-500 transition-colors",children:o("pptx.digitalSignatures.strippedConfirm")})]})]})})]}):null}function PV({isOpen:t,onClose:e}){let{t:n}=reactI18next.useTranslation();return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":n("common.close"),onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[420px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuLock,{className:"w-5 h-5 text-red-400"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:n("pptx.encryptedFile.title")})]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":n("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"px-5 py-6 space-y-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-red-900/20 border border-red-700/30 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuInfo,{className:"w-5 h-5 text-red-400 shrink-0 mt-0.5"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("p",{className:"text-xs text-red-200",children:n("pptx.encryptedFile.message")}),jsxRuntime.jsx("p",{className:"text-[11px] text-red-300/70",children:n("pptx.encryptedFile.instructions")})]})]})}),jsxRuntime.jsx("div",{className:"flex items-center justify-end px-5 py-3 border-t border-border/60",children:jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-xs rounded-lg bg-accent text-foreground hover:bg-accent/80 transition-colors",children:n("common.close")})})]})})]}):null}Pe();Pe();function uN(t){return kU(t).map(e=>e.kind==="break"?Jm__default.default.createElement("br",{key:e.key}):Jm__default.default.createElement("span",{key:e.key,style:e.style},e.text))}bt();function Snt({slide:t,templateElements:e,canvasSize:n,className:r}){let o=Jm.useRef(null),[i,s]=Jm.useState(0);Jm.useEffect(()=>{let p=o.current;if(!p)return;let h=new ResizeObserver(f=>{let m=f[0];m&&s(m.contentRect.width);});return h.observe(p),()=>h.disconnect()},[]);let a=Math.max(n.width,1),l=Math.max(n.height,1),c=i>0?i/a:.2,d=Math.max(40,Math.round(l*c)),u=[...e,...t.elements].slice(0,80);return jsxRuntime.jsxs("div",{ref:o,className:`relative w-full overflow-hidden rounded border border-border bg-white ${r??""}`,style:{height:d},children:[t.backgroundColor&&t.backgroundColor!=="transparent"&&jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundColor:et(t.backgroundColor,"#ffffff")}}),t.backgroundImage&&jsxRuntime.jsx("img",{src:t.backgroundImage,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none",draggable:false}),t.backgroundGradient&&jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundImage:t.backgroundGradient}}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 origin-top-left",style:{width:a,height:l,transform:`scale(${c})`,transformOrigin:"top left"},children:u.map(p=>{let h=Math.max(p.width,1),f=Math.max(p.height,1),m=Jt(p)?p.shapeStyle:void 0,x=m?.fillColor!==void 0&&m?.fillColor!=="transparent"||!!(Oc(m)||m?.fillGradient)||m?.fillMode==="pattern"&&!!m.fillPatternPreset,g=et(m?.fillColor,Xy),y=Math.max(0,m?.strokeWidth||0),b=et(m?.strokeColor,iu),v=au(p,x,g,y,b),S=du(p,x,g,y,b),w=p.type==="shape"&&x?"#ffffff":Di,C=lh(p,w),T=uu(p),M=nu(p),_=ze(p)?p.text:void 0,E=ze(p)?p.textSegments:void 0,R=typeof _=="string"&&_.trim().length>0||(E?.length??0)>0,I=nb(p,M)?ii(p):"";return jsxRuntime.jsx("div",{className:"absolute overflow-hidden",style:{left:p.x,top:p.y,width:h,height:f,transform:$l(p),transformOrigin:"center"},children:(p.type==="picture"||p.type==="image")&&(p.svgData||p.imageData)?zc(p)?jsxRuntime.jsx("div",{className:"pointer-events-none w-full h-full",style:pu(p)}):jsxRuntime.jsx("img",{src:p.svgData||p.imageData,alt:"",className:"pointer-events-none",style:T,draggable:false}):jsxRuntime.jsxs("div",{className:"relative w-full h-full overflow-hidden",style:v,children:[S,M&&R&&jsxRuntime.jsx("div",{className:"w-full h-full whitespace-pre-wrap break-words px-1 py-0.5 leading-[1.3]",style:{...zl(p),...C,transform:tu(p),transformOrigin:"center"},children:Wa(p,w)}),!R&&I.length>0&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-[10px] text-muted-foreground",children:I})]})},p.id)})})]})}function wnt(t,e){return !(t.slide.id!==e.slide.id||t.slide.isDirty!==e.slide.isDirty||t.slide.hidden!==e.slide.hidden||t.slide.elements!==e.slide.elements||t.slide.backgroundColor!==e.slide.backgroundColor||t.slide.backgroundImage!==e.slide.backgroundImage||t.slide.backgroundGradient!==e.slide.backgroundGradient||t.templateElements!==e.templateElements||t.canvasSize.width!==e.canvasSize.width||t.canvasSize.height!==e.canvasSize.height||t.className!==e.className)}var Qb=Jm__default.default.memo(Snt,wnt);function AV({slides:t,currentSlideIndex:e,canvasSize:n,templateElements:r,presentationStartTime:o,onMovePresentationSlide:i,onExit:s,onOpenAudienceWindow:a,onCloseAudienceWindow:l,isAudienceWindowOpen:c}){let{t:d}=reactI18next.useTranslation(),[u,p]=Jm.useState(false);Jm.useEffect(()=>{let R=window.setTimeout(()=>p(true),300);return ()=>window.clearTimeout(R)},[]);let[h,f]=Jm.useState(Date.now());Jm.useEffect(()=>{let R=window.setInterval(()=>f(Date.now()),1e3);return ()=>window.clearInterval(R)},[]);let m=o?h-o:0,[x,g]=Jm.useState(AU),y=Jm.useCallback(()=>{g(R=>eR(R+QA));},[]),b=Jm.useCallback(()=>{g(R=>eR(R-QA));},[]),v=t[e],S=e+1<t.length?t[e+1]:void 0,w=v?.notes??"",C=v?.notesSegments,T=C&&C.length>0;if(!v)return jsxRuntime.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-card text-muted-foreground",children:d("pptx.presenter.noSlides")});let M=300*1e3,_=Math.min(100,m%M/M*100),E=Math.floor(m/M);return jsxRuntime.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col bg-card text-foreground",children:[jsxRuntime.jsxs("div",{className:"flex flex-1 min-h-0",children:[jsxRuntime.jsxs("div",{className:"flex-[7] flex flex-col items-center justify-center bg-black p-6 min-w-0",children:[jsxRuntime.jsx(Qb,{slide:v,templateElements:r,canvasSize:n}),jsxRuntime.jsx("div",{className:"mt-3 text-xs font-mono tabular-nums text-white/50 select-none",children:d("pptx.presenter.slideLabel",{current:e+1,total:t.length,defaultValue:`Slide ${e+1} of ${t.length}`})})]}),jsxRuntime.jsxs("div",{className:"flex-[3] flex flex-col bg-background border-l border-border min-w-[260px] max-w-[440px]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:d("pptx.presenter.currentTime")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums text-foreground",children:RU(new Date(h))})]}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:d("pptx.presenter.elapsed")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums text-primary",children:Vy(m)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[a&&u&&jsxRuntime.jsx("button",{type:"button",onClick:()=>{c?l?.():a();},className:"p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:d(c?"pptx.presenter.closeAudienceWindow":"pptx.presenter.openAudienceWindow"),"aria-label":d(c?"pptx.presenter.closeAudienceWindow":"pptx.presenter.openAudienceWindow"),children:c?jsxRuntime.jsx(lu$1.LuMonitorOff,{className:"w-5 h-5"}):jsxRuntime.jsx(lu$1.LuMonitor,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{type:"button",onClick:s,className:"p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:d("pptx.presenter.endPresentation"),"aria-label":d("pptx.presenter.endPresentation"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-5 h-5"})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border/60",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(-1),disabled:e===0,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded bg-muted hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-xs transition-colors",title:d("pptx.presenter.previousSlide"),children:[jsxRuntime.jsx(lu$1.LuChevronLeft,{className:"w-4 h-4"}),d("pptx.presenter.prev")]}),jsxRuntime.jsxs("span",{className:"text-sm font-mono tabular-nums text-foreground",children:[e+1," / ",t.length]}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(1),disabled:e>=t.length-1,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded bg-muted hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-xs transition-colors",title:d("pptx.presenter.nextSlide"),children:[d("pptx.presenter.next"),jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-4 h-4"})]})]}),jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b border-border/60",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-2",children:d("pptx.presenter.nextSlidePreview")}),S?jsxRuntime.jsx(Qb,{slide:S,templateElements:r,canvasSize:n}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-16 rounded border border-border/30 bg-muted/40 text-xs text-muted-foreground italic",children:d("pptx.presenter.endOfPresentation")})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-h-0 px-4 py-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:d("pptx.presenter.speakerNotes")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{type:"button",onClick:b,disabled:x<=ZA,className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:d("pptx.presenter.decreaseFontSize"),"aria-label":d("pptx.presenter.decreaseFontSize"),children:jsxRuntime.jsx(lu$1.LuMinus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsxs("span",{className:"text-[10px] font-mono tabular-nums text-muted-foreground min-w-[28px] text-center select-none",children:[x,"px"]}),jsxRuntime.jsx("button",{type:"button",onClick:y,disabled:x>=JA,className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:d("pptx.presenter.increaseFontSize"),"aria-label":d("pptx.presenter.increaseFontSize"),children:jsxRuntime.jsx(lu$1.LuPlus,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto rounded border border-border/30 bg-muted/40 px-3 py-2 text-foreground whitespace-pre-wrap leading-relaxed",style:{fontSize:`${x}px`},children:T?uN(C):w.trim().length>0?w:jsxRuntime.jsx("span",{className:"italic text-muted-foreground",children:d("pptx.presenter.noNotes")})})]})]})]}),jsxRuntime.jsx("div",{className:"h-1.5 w-full bg-muted/60 flex-shrink-0",role:"progressbar","aria-valuenow":Math.round(_),"aria-valuemin":0,"aria-valuemax":100,"aria-label":d("pptx.presenter.timerProgress"),title:`${Vy(m)} (segment ${E+1})`,children:jsxRuntime.jsx("div",{className:"h-full bg-primary transition-[width] duration-1000 ease-linear",style:{width:`${_}%`}})})]})}Pe();function RV({slides:t,currentSlideIndex:e,canvasSize:n,templateElements:r,presentationStartTime:o,onMovePresentationSlide:i,onExit:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState(Date.now());Jm.useEffect(()=>{let b=window.setInterval(()=>c(Date.now()),1e3);return ()=>window.clearInterval(b)},[]);let d=Nne(o,l),u=t[e],p=e+1<t.length?t[e+1]:void 0;if(!u)return jsxRuntime.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-card text-muted-foreground",children:a("pptx.presenter.noSlides")});let h=u.notes??"",f=u.notesSegments,m=f&&f.length>0,x=kne(e),g=Ine(e,t.length);return jsxRuntime.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col bg-card text-foreground",style:{paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)",paddingRight:"env(safe-area-inset-right, 0px)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 py-2 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:a("pptx.presenter.elapsed")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums text-primary",children:Lne(d)})]}),jsxRuntime.jsx("span",{className:"text-sm font-mono tabular-nums text-foreground",children:Rne(e,t.length)}),jsxRuntime.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center w-11 h-11 min-w-11 min-h-11 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:a("pptx.presenter.endPresentation"),"aria-label":a("pptx.presenter.endPresentation"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"flex items-center justify-center bg-black px-3 py-3",children:jsxRuntime.jsx("div",{className:"w-full max-w-[640px]",children:jsxRuntime.jsx(Qb,{slide:u,templateElements:r,canvasSize:n})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border/60",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:a("pptx.presenter.nextSlidePreview")}),jsxRuntime.jsx("div",{className:"w-[132px] flex-shrink-0",children:p?jsxRuntime.jsx(Qb,{slide:p,templateElements:r,canvasSize:n}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-12 rounded border border-border/30 bg-muted/40 text-[10px] text-muted-foreground italic",children:a("pptx.presenter.endOfPresentation")})})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-h-0 px-4 py-2",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:a("pptx.presenter.speakerNotes")}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto rounded border border-border/30 bg-muted/40 px-3 py-2 text-foreground whitespace-pre-wrap leading-relaxed text-[15px]",children:m?uN(f):h.trim().length>0?h:jsxRuntime.jsx("span",{className:"italic text-muted-foreground",children:a("pptx.presenter.noNotes")})})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 border-t border-border/60",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(-1),disabled:x,className:"inline-flex items-center justify-center gap-1.5 flex-1 h-11 rounded bg-muted hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-sm transition-colors",title:a("pptx.presenter.previousSlide"),"aria-label":a("pptx.presenter.previousSlide"),children:[jsxRuntime.jsx(lu$1.LuChevronLeft,{className:"w-5 h-5"}),a("pptx.presenter.prev")]}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(1),disabled:g,className:"inline-flex items-center justify-center gap-1.5 flex-1 h-11 rounded bg-muted hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-sm transition-colors",title:a("pptx.presenter.nextSlide"),"aria-label":a("pptx.presenter.nextSlide"),children:[a("pptx.presenter.next"),jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-5 h-5"})]})]})]})}function Iue(t){let e=Math.max(0,Math.floor(t/1e3)),n=Math.floor(e/60),r=e%60;return `${String(n)}:${String(r).padStart(2,"0")}`}function IV({presentationStartTime:t,slideStartTime:e,paused:n,onTogglePause:r}){let{t:o}=reactI18next.useTranslation(),[i,s]=Jm.useState(0);Jm.useEffect(()=>{if(n)return;let d=window.setInterval(()=>s(u=>u+1),250);return ()=>window.clearInterval(d)},[n]);let a=Date.now(),l=e!==null?a-e:0,c=t!==null?a-t:0;return jsxRuntime.jsxs("div",{className:"fixed bottom-4 left-4 z-[9999] flex items-center gap-3 rounded-lg bg-black/80 px-4 py-2 text-white shadow-xl backdrop-blur-sm select-none",children:[jsxRuntime.jsxs("div",{className:"flex flex-col text-xs leading-tight",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.rehearse.slideTime")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums",children:Iue(l)})]}),jsxRuntime.jsx("div",{className:"w-px h-8 bg-border"}),jsxRuntime.jsxs("div",{className:"flex flex-col text-xs leading-tight",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.rehearse.totalTime")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums",children:Iue(c)})]}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"ml-1 rounded p-1.5 hover:bg-white/20 transition-colors",title:o(n?"pptx.rehearse.resume":"pptx.rehearse.pause"),"aria-label":o(n?"pptx.rehearse.resume":"pptx.rehearse.pause"),children:n?jsxRuntime.jsx(lu$1.LuPlay,{className:"w-4 h-4"}):jsxRuntime.jsx(lu$1.LuPause,{className:"w-4 h-4"})})]})}function Nue(t){let e=Math.max(0,Math.floor(t/1e3)),n=Math.floor(e/60),r=e%60;return `${String(n)}:${String(r).padStart(2,"0")}`}function NV({slides:t,canvasSize:e,recordedTimings:n,onSave:r,onDiscard:o}){let{t:i}=reactI18next.useTranslation(),s=Object.values(n).reduce((l,c)=>l+c,0),a=Object.entries(n).map(([l,c])=>({slideIndex:Number(l),ms:c})).sort((l,c)=>l.slideIndex-c.slideIndex);return jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",children:jsxRuntime.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-border bg-background shadow-2xl",children:[jsxRuntime.jsxs("div",{className:"border-b border-border px-5 py-4",children:[jsxRuntime.jsx("h2",{className:"text-base font-semibold text-foreground",children:i("pptx.rehearse.summaryTitle")}),jsxRuntime.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[i("pptx.rehearse.totalPresentationTime"),":"," ",jsxRuntime.jsx("span",{className:"font-mono text-foreground",children:Nue(s)})]})]}),jsxRuntime.jsx("div",{className:"max-h-72 overflow-y-auto px-5 py-3",children:jsxRuntime.jsxs("table",{className:"w-full text-xs",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:"text-muted-foreground uppercase tracking-wide",children:[jsxRuntime.jsx("th",{className:"pb-2 text-left",children:"#"}),jsxRuntime.jsx("th",{className:"pb-2 text-left",children:i("pptx.rehearse.slide")}),jsxRuntime.jsx("th",{className:"pb-2 text-right",children:i("pptx.rehearse.time")})]})}),jsxRuntime.jsx("tbody",{children:a.map(({slideIndex:l,ms:c})=>{let d=t[l];return jsxRuntime.jsxs("tr",{className:"border-t border-border",children:[jsxRuntime.jsx("td",{className:"py-2 text-muted-foreground tabular-nums",children:l+1}),jsxRuntime.jsx("td",{className:"py-2",children:d&&jsxRuntime.jsx("div",{className:"w-20 rounded overflow-hidden bg-white",children:jsxRuntime.jsx(oa,{slide:d,templateElements:[],canvasSize:e})})}),jsxRuntime.jsx("td",{className:"py-2 text-right font-mono text-foreground tabular-nums",children:Nue(c)})]},l)})})]})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border px-5 py-3",children:[jsxRuntime.jsx("button",{type:"button",onClick:o,className:"rounded-lg px-4 py-2 text-sm text-foreground hover:bg-muted transition-colors",children:i("pptx.rehearse.discard")}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"rounded-lg bg-primary px-4 py-2 text-sm text-white hover:bg-primary/80 transition-colors",children:i("pptx.rehearse.saveTimings")})]})]})})}bt();function Ynt(t,e){return ze(t)&&t.text&&t.text.trim().length>0?t.text.trim().slice(0,32):`${{text:"Text Box",shape:"Shape",connector:"Connector",image:"Image",picture:"Picture",chart:"Chart",table:"Table",smartArt:"SmartArt",media:"Media",group:"Group",ink:"Ink",ole:"Object",unknown:"Object"}[t.type]??"Object"} ${e+1}`}function DV({slides:t,activeSlideIndex:e,selectedElementId:n,selectedElementIds:r,canEdit:o,setSelectedElementId:i,setSelectedElementIds:s,setSlides:a,markDirty:l,onClose:c}){let{t:d}=reactI18next.useTranslation(),p=t[e]?.elements??[],[h,f]=Jm.useState(null),[m,x]=Jm.useState(""),g=Jm.useRef(null),[y,b]=Jm.useState(null),[v,S]=Jm.useState(null),w=Jm.useCallback(L=>{i(L),s([L]);},[i,s]),C=Jm.useCallback(L=>{a(k=>{let F=[...k],N=F[e];if(!N)return k;let D=[...N.elements??[]],U=D.findIndex(G=>G.id===L);return U===-1?k:(D[U]={...D[U],hidden:!D[U].hidden},F[e]={...N,elements:D},F)}),l();},[e,a,l]),T=Jm.useCallback((L,k)=>{o&&(f(L.id),x(k),setTimeout(()=>g.current?.select(),0));},[o]),M=Jm.useCallback(()=>{f(null);},[]),_=Jm.useCallback(L=>{b(L);},[]),E=Jm.useCallback((L,k)=>{L.preventDefault(),y!==null&&y!==k&&S(k);},[y]),R=Jm.useCallback(L=>{if(y===null||y===L){b(null),S(null);return}a(k=>{let F=[...k],N=F[e];if(!N)return k;let D=[...N.elements??[]],[U]=D.splice(y,1);return D.splice(L,0,U),F[e]={...N,elements:D},F}),l(),b(null),S(null);},[y,e,a,l]),I=[...p].reverse();return jsxRuntime.jsxs("div",{className:"flex flex-col h-full bg-popover border-l border-border w-56",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-foreground",children:d("pptx.selectionPane.title")}),jsxRuntime.jsx("button",{type:"button",onClick:c,className:"text-muted-foreground hover:text-foreground text-xs",title:d("pptx.selectionPane.close"),children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto py-1",children:I.length===0?jsxRuntime.jsx("div",{className:"px-3 py-4 text-xs text-muted-foreground italic",children:d("pptx.selectionPane.empty")}):I.map((L,k)=>{let F=p.length-1-k,N=n===L.id||r.includes(L.id),D=Ynt(L,F),U=h===L.id;return jsxRuntime.jsxs("div",{draggable:o,onDragStart:()=>_(F),onDragOver:G=>E(G,F),onDrop:()=>R(F),onDragEnd:()=>{b(null),S(null);},className:ie("flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer transition-colors",N?"bg-primary/30 text-primary":"hover:bg-muted text-foreground",v===F?"border-t-2 border-primary":""),onClick:()=>w(L.id),onDoubleClick:()=>T(L,D),children:[o&&jsxRuntime.jsx(lu$1.LuGripVertical,{className:"w-3 h-3 text-muted-foreground flex-shrink-0 cursor-grab"}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:U?jsxRuntime.jsx("input",{ref:g,type:"text",value:m,onChange:G=>x(G.target.value),onBlur:M,onKeyDown:G=>{G.key==="Enter"&&M(),G.key==="Escape"&&f(null);},className:"w-full bg-muted text-xs px-1 py-0.5 rounded border border-border outline-none",onClick:G=>G.stopPropagation()}):D}),jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex-shrink-0",title:L.hidden?d("pptx.selectionPane.show"):d("pptx.selectionPane.hide"),onClick:G=>{G.stopPropagation(),C(L.id);},children:L.hidden?jsxRuntime.jsx(lu$1.LuEyeOff,{className:"w-3.5 h-3.5"}):jsxRuntime.jsx(lu$1.LuEye,{className:"w-3.5 h-3.5 opacity-50"})})]},L.id)})})]})}var Bue="inline-flex items-center justify-center px-2.5 py-1.5 max-md:min-h-[44px] max-md:min-w-[44px] active:scale-95 active:opacity-80",fr=`${Bue} border-r border-border hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed`,Jo=`${Bue} hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed`,to="inline-flex items-center rounded bg-muted text-xs overflow-hidden",Be="inline-flex items-center gap-1.5 px-2.5 py-1.5 max-md:min-h-[44px] rounded bg-muted hover:bg-accent text-xs transition-colors active:scale-95 active:opacity-80",qt=jsxRuntime.jsx("div",{className:"w-px self-stretch bg-border/40 mx-1 max-md:hidden"}),Ne="w-4 h-4",Gn="w-3.5 h-3.5";var Uue=[{k:"left",el:jsxRuntime.jsx(lu$1.LuAlignLeft,{className:Ne})},{k:"center",el:jsxRuntime.jsx(lu$1.LuAlignCenter,{className:Ne})},{k:"right",el:jsxRuntime.jsx(lu$1.LuAlignRight,{className:Ne})},{k:"top",el:jsxRuntime.jsx(lu$1.LuChevronUp,{className:Ne})},{k:"middle",el:jsxRuntime.jsx(lu$1.LuAlignCenter,{className:`${Ne} rotate-90`})},{k:"bottom",el:jsxRuntime.jsx(lu$1.LuChevronDown,{className:Ne})}],$ue=[{k:"horizontal",el:jsxRuntime.jsx(lu$1.LuAlignHorizontalSpaceAround,{className:Ne})},{k:"vertical",el:jsxRuntime.jsx(lu$1.LuAlignVerticalSpaceAround,{className:Ne})}],Hue=[{id:"select",icon:jsxRuntime.jsx(lu$1.LuMoveRight,{className:Ne}),labelKey:"pptx.ribbon.tool.select",ac:"bg-primary text-white"},{id:"pen",icon:jsxRuntime.jsx(lu$1.LuPencil,{className:Ne}),labelKey:"pptx.ribbon.tool.pen",ac:"bg-primary text-white"},{id:"highlighter",icon:jsxRuntime.jsx(lu$1.LuType,{className:Ne}),labelKey:"pptx.ribbon.tool.highlighter",ac:"bg-yellow-600 text-white"},{id:"eraser",icon:jsxRuntime.jsx(lu$1.LuMinus,{className:Ne}),labelKey:"pptx.ribbon.tool.eraser",ac:"bg-red-600 text-white"},{id:"freeform",icon:jsxRuntime.jsx(lu$1.LuSpline,{className:Ne}),labelKey:"pptx.ribbon.tool.freeform",ac:"bg-primary text-white"}],zue=[{k:"png",labelKey:"pptx.ribbon.exportPng",i:jsxRuntime.jsx(lu$1.LuDownload,{className:`${Gn} text-muted-foreground`})},{k:"pdf",labelKey:"pptx.ribbon.exportPdf",i:jsxRuntime.jsx(lu$1.LuFileText,{className:`${Gn} text-muted-foreground`})},{k:"video",labelKey:"pptx.ribbon.exportVideo",i:jsxRuntime.jsx(lu$1.LuVideo,{className:`${Gn} text-muted-foreground`})},{k:"gif",labelKey:"pptx.ribbon.exportGif",i:jsxRuntime.jsx(lu$1.LuImage,{className:`${Gn} text-muted-foreground`})},{k:"package",labelKey:"pptx.file.packageTooltip",i:jsxRuntime.jsx(lu$1.LuFolderOpen,{className:`${Gn} text-muted-foreground`})},{k:"pptx",labelKey:"pptx.file.saveAsPptxTooltip",i:jsxRuntime.jsx(lu$1.LuDownload,{className:`${Gn} text-muted-foreground`})},{k:"ppsx",labelKey:"pptx.file.saveAsPpsxTooltip",i:jsxRuntime.jsx(lu$1.LuPlay,{className:`${Gn} text-muted-foreground`})},{k:"pptm",labelKey:"pptx.file.saveAsPptmTooltip",i:jsxRuntime.jsx(lu$1.LuDatabase,{className:`${Gn} text-muted-foreground`})},{k:"---0",labelKey:"",i:null},{k:"print",labelKey:"pptx.print.printButton",i:jsxRuntime.jsx(lu$1.LuPrinter,{className:`${Gn} text-muted-foreground`})},{k:"copyImg",labelKey:"pptx.file.copyImageTooltip",i:jsxRuntime.jsx(lu$1.LuCopy,{className:`${Gn} text-muted-foreground`})},{k:"---",labelKey:"",i:null},{k:"a11y",labelKey:"pptx.ribbon.accessibilityCheck",i:jsxRuntime.jsx(lu$1.LuCheck,{className:`${Gn} text-muted-foreground`})},{k:"shortcuts",labelKey:"pptx.settings.keyboardShortcuts",i:jsxRuntime.jsx(lu$1.LuSearch,{className:`${Gn} text-muted-foreground`})},{k:"---2",labelKey:"",i:null},{k:"versionHistory",labelKey:"pptx.ribbon.versionHistory",i:jsxRuntime.jsx(lu$1.LuClock,{className:`${Gn} text-muted-foreground`})},{k:"---3",labelKey:"",i:null},{k:"documentProperties",labelKey:"pptx.ribbon.documentProperties",i:jsxRuntime.jsx(lu$1.LuInfo,{className:`${Gn} text-muted-foreground`})},{k:"passwordProtection",labelKey:"pptx.security.protectPresentation",i:jsxRuntime.jsx(lu$1.LuLock,{className:`${Gn} text-muted-foreground`})},{k:"fontEmbedding",labelKey:"pptx.ribbon.embedFonts",i:jsxRuntime.jsx(lu$1.LuType,{className:`${Gn} text-muted-foreground`})},{k:"digitalSignatures",labelKey:"pptx.viewer.digitalSignatures",i:jsxRuntime.jsx(lu$1.LuShieldAlert,{className:`${Gn} text-muted-foreground`})}],Vue=[{id:"bold",i:jsxRuntime.jsx(lu$1.LuBold,{className:Ne}),labelKey:"pptx.textPanel.bold"},{id:"italic",i:jsxRuntime.jsx(lu$1.LuItalic,{className:Ne}),labelKey:"pptx.textPanel.italic"},{id:"underline",i:jsxRuntime.jsx(lu$1.LuUnderline,{className:Ne}),labelKey:"pptx.textPanel.underline"},{id:"strikethrough",i:jsxRuntime.jsx(lu$1.LuStrikethrough,{className:Ne}),labelKey:"pptx.textPanel.strikethrough"}],Gue=[{id:"left",i:jsxRuntime.jsx(lu$1.LuAlignLeft,{className:Ne}),labelKey:"pptx.ribbon.alignLeft"},{id:"center",i:jsxRuntime.jsx(lu$1.LuAlignCenter,{className:Ne}),labelKey:"pptx.ribbon.alignCenter"},{id:"right",i:jsxRuntime.jsx(lu$1.LuAlignRight,{className:Ne}),labelKey:"pptx.ribbon.alignRight"},{id:"justify",i:jsxRuntime.jsx(lu$1.LuAlignJustify,{className:Ne}),labelKey:"pptx.ribbon.justify"}];var Rrt=[{group:"Entrance",items:[{value:"appear",label:"Appear"},{value:"fadeIn",label:"Fade In"},{value:"flyIn",label:"Fly In"}]},{group:"Emphasis",items:[{value:"pulse",label:"Pulse"},{value:"spin",label:"Spin"}]},{group:"Exit",items:[{value:"disappear",label:"Disappear"},{value:"fadeOut",label:"Fade Out"}]}];function hN(t){let{t:e}=reactI18next.useTranslation(),[n,r]=Jm.useState(false),o=t.selectedElement!==null,i=!t.canEdit||!o;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>{i||(r(true),setTimeout(()=>r(false),1200));},disabled:i,className:ie(Be,n?"bg-primary hover:bg-primary/80 text-white":""),title:e("pptx.animations.previewTooltip"),children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Ne}),e("pptx.animations.preview")]}),qt,jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:i,className:Be,title:e("pptx.animations.addTooltip"),children:[jsxRuntime.jsx(lu$1.LuSparkles,{className:Ne}),e("pptx.animations.addAnimation"),jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:flex flex-col w-44 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:Rrt.map(a=>jsxRuntime.jsxs(Jm__default.default.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:e(`pptx.animations.group.${a.group.toLowerCase()}`)}),a.items.map(l=>jsxRuntime.jsx("button",{type:"button",disabled:i,onClick:()=>t.onAddAnimation?.(l.value,a.group.toLowerCase()),className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:e("pptx.animations.applyAnimation",{name:e(`pptx.animations.preset.${l.value}`)}),children:e(`pptx.animations.preset.${l.value}`)},l.value))]},a.group))})})]}),qt,jsxRuntime.jsxs("button",{type:"button",disabled:i,onClick:t.onRemoveAnimation,className:Be,title:e("pptx.animations.removeTooltip"),children:[jsxRuntime.jsx(lu$1.LuTrash2,{className:Ne}),e("pptx.animations.remove")]}),qt,jsxRuntime.jsxs("button",{type:"button",onClick:t.onOpenAnimationPanel??t.onToggleInspector,className:ie(Be,t.isInspectorPaneOpen?"bg-primary hover:bg-primary/80 text-white":""),title:e("pptx.animations.openPanelTooltip"),children:[jsxRuntime.jsx(lu$1.LuPanelRight,{className:Ne}),e("pptx.animations.animationPanel")]})]})}function fN(t){let{t:e}=reactI18next.useTranslation(),n=!!t.selectedElement,r=n&&t.canEdit;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:to,children:Uue.map((o,i,s)=>jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onAlignElements(o.k),disabled:!r,className:i<s.length-1?fr:Jo,title:e("pptx.arrange.align",{direction:o.k}),children:o.el},o.k))}),jsxRuntime.jsx("div",{className:to,children:$ue.map((o,i,s)=>jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onDistributeElements(o.k),disabled:!t.canEdit||!t.canDistribute,className:i<s.length-1?fr:Jo,title:e(`pptx.arrange.distribute${o.k.charAt(0).toUpperCase()}${o.k.slice(1)}`),children:o.el},o.k))}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{onClick:t.onCopy,disabled:!n,className:fr,title:e("pptx.arrange.copy"),children:jsxRuntime.jsx(lu$1.LuCopy,{className:Ne})}),jsxRuntime.jsx("button",{onClick:t.onCut,disabled:!r,className:fr,title:e("pptx.arrange.cut"),children:e("pptx.arrange.cut")}),jsxRuntime.jsx("button",{onClick:t.onPaste,disabled:!t.clipboardPayload||!t.canEdit,className:Jo,title:e("pptx.arrange.paste"),children:jsxRuntime.jsx(lu$1.LuClipboardPaste,{className:Ne})})]}),t.onToggleFormatPainter&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleFormatPainter,disabled:!t.canEdit||t.canActivateFormatPainter===false&&!t.formatPainterActive,"data-testid":"format-painter-toggle","data-active":t.formatPainterActive?"true":"false",className:ie(Be,t.formatPainterActive?"bg-amber-600 hover:bg-amber-500 text-amber-50":""),title:e("pptx.arrange.formatPainter"),children:[jsxRuntime.jsx(lu$1.LuPaintbrush,{className:Ne}),e("pptx.arrange.format")]}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onFlip("horizontal"),disabled:!r,className:fr,title:e("pptx.arrange.flipHorizontally"),children:e("pptx.arrange.flipH")}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onFlip("vertical"),disabled:!r,className:Jo,title:e("pptx.arrange.flipVertically"),children:e("pptx.arrange.flipV")})]}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{onClick:()=>t.onMoveLayer("backward"),disabled:!r,className:fr,title:e("pptx.arrange.sendBackward"),children:jsxRuntime.jsx(lu$1.LuChevronDown,{className:Ne})}),jsxRuntime.jsx("button",{onClick:()=>t.onMoveLayer("forward"),disabled:!r,className:fr,title:e("pptx.arrange.bringForward"),children:jsxRuntime.jsx(lu$1.LuChevronUp,{className:Ne})}),jsxRuntime.jsx("button",{onClick:()=>t.onMoveLayerToEdge("back"),disabled:!r,className:fr,title:e("pptx.arrange.sendToBack"),children:e("pptx.arrange.back")}),jsxRuntime.jsx("button",{onClick:()=>t.onMoveLayerToEdge("front"),disabled:!r,className:Jo,title:e("pptx.arrange.bringToFront"),children:e("pptx.arrange.front")})]}),jsxRuntime.jsxs("button",{onClick:t.onDuplicate,disabled:!r,className:Be,title:e("pptx.arrange.duplicate"),children:[jsxRuntime.jsx(lu$1.LuCopy,{className:Ne}),e("pptx.arrange.duplicate")]}),jsxRuntime.jsxs("button",{onClick:t.onDelete,disabled:!r,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded bg-red-700/80 hover:bg-red-600 disabled:opacity-40 disabled:cursor-not-allowed text-xs transition-colors",title:e("pptx.arrange.delete"),children:[jsxRuntime.jsx(lu$1.LuTrash2,{className:Ne}),e("pptx.arrange.delete")]})]})}function mN(t){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:t.onToggleThemeGallery,disabled:!t.canEdit,className:ie(Be,t.isThemeGalleryOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Browse and apply built-in themes",children:[jsxRuntime.jsx(lu$1.LuPalette,{className:Gn}),"Browse Themes"]}),jsxRuntime.jsxs("button",{onClick:t.onToggleThemeEditor,disabled:!t.canEdit,className:ie(Be,t.isThemeEditorOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Edit presentation theme colors and fonts",children:[jsxRuntime.jsx(lu$1.LuPencil,{className:Gn}),"Edit Theme"]}),qt,t.onOpenDocumentProperties&&jsxRuntime.jsxs("button",{onClick:t.onOpenDocumentProperties,className:Be,title:"Change slide dimensions (16:9, 4:3, custom)",children:[jsxRuntime.jsx(lu$1.LuMonitor,{className:Gn}),"Slide Size"]}),t.onToggleInspector&&jsxRuntime.jsxs("button",{onClick:t.onToggleInspector,className:ie(Be,t.isInspectorPaneOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Open inspector to edit slide background",children:[jsxRuntime.jsx(lu$1.LuPaintBucket,{className:Gn}),"Format Background"]})]})}var Krt=[{value:"none",label:"None"},{value:"fade",label:"Fade"},{value:"push",label:"Push"},{value:"wipe",label:"Wipe"},{value:"split",label:"Split"},{value:"reveal",label:"Reveal"},{value:"cut",label:"Cut"},{value:"cover",label:"Cover"},{value:"uncover",label:"Uncover"}];function gN(t){let[e,n]=Jm__default.default.useState("none"),[r,o]=Jm__default.default.useState("00.50");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",className:Be,title:"Preview transition",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Gn}),"Preview"]}),qt,jsxRuntime.jsx("div",{className:"inline-flex items-center gap-0.5 overflow-x-auto max-w-[420px]",children:Krt.map(i=>jsxRuntime.jsx("button",{type:"button",onClick:()=>n(i.value),className:ie("flex-shrink-0 px-2 py-1 max-md:min-h-[44px] rounded border text-[11px] leading-tight transition-colors",e===i.value?"border-primary bg-primary/10 text-primary font-medium":"border-border bg-muted hover:bg-accent text-foreground"),title:`${i.label} transition`,children:i.label},i.value))}),qt,jsxRuntime.jsxs("label",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:"Duration:"}),jsxRuntime.jsx("input",{type:"text",value:r,onChange:i=>o(i.target.value),className:"w-14 px-1.5 py-1 rounded border border-border bg-muted text-xs text-foreground text-center",title:"Transition duration in seconds"})]}),qt,jsxRuntime.jsxs("button",{type:"button",className:Be,title:"Apply transition to all slides",children:[jsxRuntime.jsx(lu$1.LuCopy,{className:Gn}),"Apply to All"]}),qt,jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleInspector,className:ie(Be,t.isInspectorPaneOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Open Inspector for full transition options",children:[jsxRuntime.jsx(lu$1.LuPanelRight,{className:Ne}),"Inspector"]})]})}function xN(t){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t.onToggleComments&&jsxRuntime.jsxs("button",{onClick:t.onToggleComments,className:ie(Be,t.isCommentsPanelOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Toggle comments panel",children:[jsxRuntime.jsx(lu$1.LuMessageSquare,{className:Ne}),"Comments",(t.slideCommentCount??0)>0&&jsxRuntime.jsx("span",{className:"inline-flex items-center justify-center min-w-[16px] h-4 rounded-full bg-amber-500 text-[10px] font-medium text-white px-1",children:t.slideCommentCount})]}),jsxRuntime.jsxs("button",{onClick:()=>t.onSetSpellCheckEnabled(!t.spellCheckEnabled),className:ie(Be,t.spellCheckEnabled?"bg-primary hover:bg-primary/80 text-white":""),title:"Toggle spell check",children:[jsxRuntime.jsx(lu$1.LuSpellCheck,{className:Ne}),"Spelling"]}),t.onCompare&&jsxRuntime.jsxs("button",{onClick:t.onCompare,disabled:!t.canEdit,className:Be,title:"Compare with another presentation",children:[jsxRuntime.jsx(lu$1.LuGitCompare,{className:Ne}),"Compare"]})]})}function bN(t){let{t:e}=reactI18next.useTranslation();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:to,children:Hue.map((n,r,o)=>jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onSetActiveTool(n.id),className:ie(r<o.length-1?fr:Jo,t.activeTool===n.id?n.ac??"bg-accent text-foreground":""),title:e(n.labelKey),children:n.icon},n.id))}),jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-2 text-xs",children:[jsxRuntime.jsxs("label",{className:"inline-flex items-center gap-1 text-muted-foreground",title:e("pptx.ribbon.penColour"),children:[e("pptx.ribbon.colour"),jsxRuntime.jsx("input",{type:"color",value:t.drawingColor,onChange:n=>t.onSetDrawingColor(n.target.value),className:"w-6 h-6 rounded border border-border bg-transparent cursor-pointer"})]}),jsxRuntime.jsxs("label",{className:"inline-flex items-center gap-1 text-muted-foreground",title:e("pptx.ribbon.strokeWidth"),children:[e("pptx.ribbon.width"),jsxRuntime.jsx("input",{type:"range",min:1,max:12,value:t.drawingWidth,onChange:n=>t.onSetDrawingWidth(Number(n.target.value)),className:"w-16 h-1 accent-primary"}),jsxRuntime.jsx("span",{className:"text-foreground w-4 text-right",children:t.drawingWidth})]})]})]})}function vN(t){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t.onOpenFile&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:t.onOpenFile,className:Be,title:"Open another presentation",children:[jsxRuntime.jsx(lu$1.LuFolderOpen,{className:Ne}),"Open"]}),qt]}),jsxRuntime.jsxs("button",{onClick:t.onSaveAsPptx,className:Be,title:"Save as Presentation (.pptx)",children:[jsxRuntime.jsx(lu$1.LuDownload,{className:Ne}),"Save .pptx"]}),jsxRuntime.jsxs("button",{onClick:t.onSaveAsPpsx,className:Be,title:"Save as Slide Show (.ppsx)",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Ne}),"Save .ppsx"]}),t.hasMacros&&jsxRuntime.jsxs("button",{onClick:t.onSaveAsPptm,className:Be,title:"Save as Macro-Enabled (.pptm)",children:[jsxRuntime.jsx(lu$1.LuFileText,{className:Ne}),"Save .pptm"]}),jsxRuntime.jsxs("button",{onClick:t.onPackageForSharing,className:Be,title:"Package for Sharing",children:[jsxRuntime.jsx(lu$1.LuPackage,{className:Ne}),"Package"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onExportPng,className:Be,title:"Export as PNG",children:[jsxRuntime.jsx(lu$1.LuDownload,{className:Ne}),"PNG"]}),jsxRuntime.jsxs("button",{onClick:t.onExportPdf,className:Be,title:"Export as PDF",children:[jsxRuntime.jsx(lu$1.LuFileText,{className:Ne}),"PDF"]}),jsxRuntime.jsxs("button",{onClick:t.onExportVideo,className:Be,title:"Export as Video",children:[jsxRuntime.jsx(lu$1.LuVideo,{className:Ne}),"Video"]}),jsxRuntime.jsxs("button",{onClick:t.onExportGif,className:Be,title:"Export as GIF",children:[jsxRuntime.jsx(lu$1.LuImage,{className:Ne}),"GIF"]}),jsxRuntime.jsxs("button",{onClick:t.onCopySlideAsImage,className:Be,title:"Copy Slide as Image",children:[jsxRuntime.jsx(lu$1.LuCopy,{className:Ne}),"Copy Image"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onPrint,className:Be,title:"Print",children:[jsxRuntime.jsx(lu$1.LuPrinter,{className:Ne}),"Print"]}),qt,t.onOpenDocumentProperties&&jsxRuntime.jsxs("button",{onClick:t.onOpenDocumentProperties,className:Be,title:"Document Properties",children:[jsxRuntime.jsx(lu$1.LuInfo,{className:Ne}),"Properties"]}),t.onOpenPasswordProtection&&jsxRuntime.jsxs("button",{onClick:t.onOpenPasswordProtection,className:Be,title:"Protect Presentation",children:[jsxRuntime.jsx(lu$1.LuLock,{className:Ne}),"Protect"]}),t.onOpenFontEmbedding&&jsxRuntime.jsxs("button",{onClick:t.onOpenFontEmbedding,className:Be,title:"Embed Fonts",children:[jsxRuntime.jsx(lu$1.LuType,{className:Ne}),"Fonts"]}),t.onOpenDigitalSignatures&&jsxRuntime.jsxs("button",{onClick:t.onOpenDigitalSignatures,className:Be,title:"Digital Signatures",children:[jsxRuntime.jsx(lu$1.LuShieldAlert,{className:Ne}),"Signatures"]})]})}bt();function Que(t){let[e,n]=Jm.useState(false),[r,o]=Jm.useState(false),i=Jm.useRef(null),s=Jm.useRef(null),a=Jm.useCallback(()=>{if(t.layoutOptions.length>0){let l=t.layoutOptions[0];t.onInsertSlideFromLayout(l.path,l.name);}},[t]);return Jm.useEffect(()=>{if(!e)return;let l=c=>{i.current&&!i.current.contains(c.target)&&n(false);};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e]),Jm.useEffect(()=>{if(!r)return;let l=c=>{s.current&&!s.current.contains(c.target)&&o(false);};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative inline-flex items-center",ref:i,children:[jsxRuntime.jsxs("button",{type:"button",onClick:a,disabled:!t.canEdit||t.layoutOptions.length===0,className:ie(Be,"whitespace-nowrap",t.layoutOptions.length>0?"rounded-r-none":""),title:"New Slide",children:[jsxRuntime.jsx(lu$1.LuPlus,{className:Ne}),"New Slide"]}),t.layoutOptions.length>0&&jsxRuntime.jsx("button",{type:"button",disabled:!t.canEdit,className:"inline-flex items-center justify-center self-stretch px-1 rounded-r bg-muted hover:bg-accent text-xs transition-colors border-l border-border/40 active:scale-95 active:opacity-80",title:"Choose layout",onClick:()=>n(l=>!l),children:jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-48 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:t.layoutOptions.map(l=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onInsertSlideFromLayout(l.path,l.name),n(false);},children:l.name},l.path))})})]}),jsxRuntime.jsxs("div",{className:"relative inline-flex items-center",ref:s,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit||t.layoutOptions.length===0,className:Be,title:"Layout",onClick:()=>o(l=>!l),children:[jsxRuntime.jsx(lu$1.LuLayoutGrid,{className:Ne}),"Layout"]}),r&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-48 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:t.layoutOptions.map(l=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onApplyLayout?.(l.path),o(false);},children:l.name},l.path))})})]}),jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit,className:Be,title:"Reset Slide",onClick:t.onResetSlide,children:[jsxRuntime.jsx(lu$1.LuRotateCcw,{className:Ne}),"Reset"]}),jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit,className:Be,title:"Add Section",onClick:t.onAddSection,children:[jsxRuntime.jsx(lu$1.LuFolderPlus,{className:Ne}),"Section"]})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Slides"})]}),qt]})}function vot(t){let e={fontFamily:"Segoe UI",fontSize:"24"};if(!t||!ze(t))return e;let n=t.textSegments?.[0]?.style,r=t.textStyle,o=n?.fontFamily??r?.fontFamily??e.fontFamily,i=n?.fontSize??r?.fontSize;return {fontFamily:o,fontSize:i!=null?String(i):e.fontSize}}var Sot=["Arial","Calibri","Cambria","Comic Sans MS","Courier New","Georgia","Helvetica","Impact","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana"],wot=[8,9,10,11,12,14,16,18,20,24,28,32,36,40,44,48,54,60,72,96];function wN(t){let[e,n]=Jm.useState(false),[r,o]=Jm.useState(false),[i,s]=Jm.useState(false),[a,l]=Jm.useState(false),c=Jm.useRef(null),d=Jm.useRef(null),{fontFamily:u,fontSize:p}=vot(t.selectedElement);return Jm.useEffect(()=>{if(!e)return;let h=f=>{c.current&&!c.current.contains(f.target)&&n(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[e]),Jm.useEffect(()=>{if(!r)return;let h=f=>{d.current&&!d.current.contains(f.target)&&o(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",onClick:t.onPaste,disabled:!t.clipboardPayload||!t.canEdit,className:fr,title:"Paste",children:jsxRuntime.jsx(lu$1.LuClipboardPaste,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{t.onCut(),l(true),setTimeout(()=>l(false),600);},disabled:!t.canEdit,className:ie(fr,a&&"bg-green-600/20 text-green-400"),title:"Cut",children:jsxRuntime.jsx(lu$1.LuScissors,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{t.onCopy(),s(true),setTimeout(()=>s(false),600);},className:ie(fr,i&&"bg-green-600/20 text-green-400"),title:"Copy",children:jsxRuntime.jsx(lu$1.LuCopy,{className:Ne})}),t.onToggleFormatPainter&&jsxRuntime.jsx("button",{type:"button",onClick:t.onToggleFormatPainter,disabled:!t.canEdit||t.canActivateFormatPainter===false&&!t.formatPainterActive,"data-testid":"format-painter-toggle","data-active":t.formatPainterActive?"true":"false",className:ie(Jo,t.formatPainterActive?"bg-amber-600 hover:bg-amber-500 text-amber-50":""),title:"Format Painter",children:jsxRuntime.jsx(lu$1.LuPaintbrush,{className:Ne})})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Clipboard"})]}),qt,jsxRuntime.jsx(Que,{canEdit:t.canEdit,layoutOptions:t.layoutOptions,onInsertSlideFromLayout:t.onInsertSlideFromLayout,onApplyLayout:t.onApplyLayout,onResetSlide:t.onResetSlide,onAddSection:t.onAddSection}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",ref:c,children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>n(h=>!h),className:"inline-flex items-center justify-between px-2 py-1 rounded-sm border border-border/60 bg-background/60 text-[11px] text-foreground min-w-[120px] truncate hover:bg-accent/40 transition-colors cursor-pointer",children:[jsxRuntime.jsx("span",{className:"truncate",children:u}),jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3 ml-1 shrink-0 text-muted-foreground"})]}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-48 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:Sot.map(h=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",style:{fontFamily:h},onClick:()=>{t.onUpdateTextStyle?.({fontFamily:h}),n(false);},children:h},h))})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:d,children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>o(h=>!h),className:"inline-flex items-center justify-between px-2 py-1 rounded-sm border border-border/60 bg-background/60 text-[11px] text-foreground min-w-[50px] text-center hover:bg-accent/40 transition-colors cursor-pointer",children:[jsxRuntime.jsx("span",{className:"truncate",children:p}),jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3 ml-1 shrink-0 text-muted-foreground"})]}),r&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-48 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:wot.map(h=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onUpdateTextStyle?.({fontSize:h}),o(false);},children:h},h))})})]})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Font"})]}),qt]})}Pe();function CN(t){let{t:e}=reactI18next.useTranslation(),{canEdit:n}=t,[r,o]=Jm.useState(false),[i,s]=Jm.useState(""),[a,l]=Jm.useState("locale"),[c,d]=Jm.useState(QU),u=Jm.useRef(null),p=Jm.useCallback(()=>{let f=new Date,m=x=>String(x).padStart(2,"0");s(`${f.getFullYear()}-${m(f.getMonth()+1)}-${m(f.getDate())}T${m(f.getHours())}:${m(f.getMinutes())}`),l("locale"),o(true);},[]),h=Jm.useCallback(()=>{if(!t.onInsertField)return;let f=new Date(i);if(isNaN(f.getTime()))return;let m;switch(a){case "iso":m=f.toISOString().slice(0,10);break;case "long":m=f.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"});break;case "short":m=f.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});break;case "time":m=f.toLocaleString();break;default:m=f.toLocaleDateString();break}t.onInsertField("datetime",m),o(false);},[i,a,t]);return Jm.useEffect(()=>{if(!r)return;let f=m=>{u.current&&!u.current.contains(m.target)&&o(false);};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:t.onAddTextBox,disabled:!n,className:Be,title:"Add text box",children:[jsxRuntime.jsx(lu$1.LuType,{className:Ne}),"Text"]}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("select",{value:t.newShapeType,onChange:f=>t.onSetNewShapeType(f.target.value),className:"bg-transparent py-1.5 pl-2 pr-1 outline-none text-xs",title:"Shape type",children:Bm.map(f=>jsxRuntime.jsx("option",{value:f.type,className:"bg-background",children:f.label},f.type))}),jsxRuntime.jsxs("button",{onClick:t.onAddShape,disabled:!n,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 border-l border-border hover:bg-accent transition-colors text-xs",title:"Add shape",children:[Bm.find(f=>f.type===t.newShapeType)?.icon||jsxRuntime.jsx(lu$1.LuSquare,{className:Ne}),"Shape"]})]}),jsxRuntime.jsxs("button",{onClick:t.onOpenImagePicker,disabled:!n,className:Be,title:"Insert image",children:[jsxRuntime.jsx(lu$1.LuImage,{className:Ne}),"Image"]}),jsxRuntime.jsxs("button",{onClick:t.onOpenMediaPicker,disabled:!n,className:Be,title:"Insert audio or video",children:[jsxRuntime.jsx(lu$1.LuVideo,{className:Ne}),"Media"]}),jsxRuntime.jsxs("button",{onClick:t.onAddTable,disabled:!n,className:Be,title:"Insert table",children:[jsxRuntime.jsx(lu$1.LuDatabase,{className:Ne}),"Table"]}),t.onAddChart&&jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("select",{value:c,onChange:f=>d(f.target.value),className:"bg-transparent py-1.5 pl-2 pr-1 outline-none text-xs",title:"Chart type",children:Qne.map(f=>jsxRuntime.jsx("option",{value:f.type,className:"bg-background",children:f.label},f.type))}),jsxRuntime.jsxs("button",{onClick:()=>t.onAddChart(c),disabled:!n,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 border-l border-border hover:bg-accent transition-colors text-xs",title:"Insert chart",children:[jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M3 3v18h18"}),jsxRuntime.jsx("rect",{x:"7",y:"11",width:"3",height:"6"}),jsxRuntime.jsx("rect",{x:"12",y:"7",width:"3",height:"10"}),jsxRuntime.jsx("rect",{x:"17",y:"13",width:"3",height:"4"})]}),"Chart"]})]}),jsxRuntime.jsxs("button",{onClick:t.onAddSmartArt,disabled:!n,className:Be,title:"Insert SmartArt",children:[jsxRuntime.jsx(lu$1.LuLayers,{className:Ne}),"SmartArt"]}),jsxRuntime.jsxs("button",{onClick:t.onAddEquation,disabled:!n,className:Be,title:"Insert Equation",children:[jsxRuntime.jsx("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M4 17h6M7 14v6M14 7l4.5 10M15.5 14h5"})}),"Equation"]}),jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:!n,className:Be,title:"Insert action button",children:[jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntime.jsx("path",{d:"M13 7l4 5-4 5"})]}),"Action",jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:flex flex-col w-40 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:sh.map(f=>jsxRuntime.jsxs("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>t.onAddActionButton(f.shapeType),children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:f.iconPath})}),f.label]},f.shapeType))})})]}),t.onInsertField&&jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:!n,className:Be,title:e("pptx.field.insertField"),children:[jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M4 7h16M4 12h10M4 17h12"}),jsxRuntime.jsx("circle",{cx:"19",cy:"15",r:"3"})]}),e("pptx.field.field"),jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:flex flex-col w-44 pt-1",children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:[jsxRuntime.jsx("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>t.onInsertField("slidenum"),children:e("pptx.field.slideNumber")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:p,children:e("pptx.field.dateTime")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>t.onInsertField("header"),children:e("pptx.field.header")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>t.onInsertField("footer"),children:e("pptx.field.footer")})]})})]}),r&&jsxRuntime.jsx("div",{ref:u,className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/30",onMouseDown:f=>{f.target===f.currentTarget&&o(false);},children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover shadow-2xl p-4 w-72 space-y-3",children:[jsxRuntime.jsx("div",{className:"text-sm font-medium text-foreground",children:e("pptx.field.dateTime")}),jsxRuntime.jsx("input",{type:"datetime-local",className:"w-full rounded border border-border bg-muted px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:i,onChange:f=>s(f.target.value)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-[11px] text-muted-foreground mb-1",children:e("pptx.field.format","Format")}),jsxRuntime.jsxs("select",{className:"w-full rounded border border-border bg-muted px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:a,onChange:f=>l(f.target.value),children:[jsxRuntime.jsx("option",{value:"locale",children:new Date(i||Date.now()).toLocaleDateString()}),jsxRuntime.jsx("option",{value:"long",children:new Date(i||Date.now()).toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),jsxRuntime.jsx("option",{value:"short",children:new Date(i||Date.now()).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}),jsxRuntime.jsx("option",{value:"iso",children:new Date(i||Date.now()).toISOString().slice(0,10)}),jsxRuntime.jsx("option",{value:"time",children:new Date(i||Date.now()).toLocaleString()})]})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[jsxRuntime.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded border border-border text-foreground hover:bg-muted transition-colors",onClick:()=>o(false),children:e("pptx.common.cancel","Cancel")}),jsxRuntime.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded bg-primary text-white hover:bg-primary/90 transition-colors",onClick:h,children:e("pptx.common.insert","Insert")})]})]})})]})}function MN(t){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>t.onSetMode("present"),className:Be,title:"Start slide show from beginning",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Ne}),"From Beginning"]}),jsxRuntime.jsxs("button",{onClick:t.onPresent,className:Be,title:"Start slide show from current slide",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Ne}),"From Current Slide"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onEnterPresenterView,className:Be,title:"Presenter view",children:[jsxRuntime.jsx(lu$1.LuMonitor,{className:Ne}),"Presenter View"]}),jsxRuntime.jsxs("button",{onClick:t.onEnterRehearsalMode,className:Be,title:"Rehearse timings",children:[jsxRuntime.jsx(lu$1.LuClock,{className:Ne}),"Rehearse Timings"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onOpenSetUpSlideShow,className:Be,title:"Set up slide show",children:[jsxRuntime.jsx(lu$1.LuSettings,{className:Ne}),"Set Up Slide Show"]}),jsxRuntime.jsxs("button",{onClick:t.onOpenBroadcastDialog,className:Be,title:"Broadcast slide show",children:[jsxRuntime.jsx(lu$1.LuCast,{className:Ne}),"Broadcast"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onToggleSubtitles,className:ie(Be,t.showSubtitles?"bg-primary hover:bg-primary/80 text-white":""),title:"Toggle subtitles",children:[jsxRuntime.jsx(lu$1.LuCaptions,{className:Ne}),"Subtitles"]})]})}bt();var zot=[{label:"1.0",value:1},{label:"1.15",value:1.15},{label:"1.5",value:1.5},{label:"2.0",value:2},{label:"2.5",value:2.5},{label:"3.0",value:3}],Vot=[{label:"Horizontal",value:"horizontal"},{label:"Rotate 90\xB0",value:"vertical"},{label:"Rotate 270\xB0",value:"vertical270"},{label:"Stacked",value:"wordArtVert"}],Got=[{label:"1 Column",value:1},{label:"2 Columns",value:2},{label:"3 Columns",value:3}];function $V(t,e,n){Jm.useEffect(()=>{if(!e)return;let r=o=>{t.current&&!t.current.contains(o.target)&&n(false);};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t,n]);}function spe(t){let[e,n]=Jm.useState(false),r=Jm.useRef(null);return $V(r,e,n),jsxRuntime.jsxs("div",{className:"relative",ref:r,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canMut,onMouseDown:o=>o.preventDefault(),onClick:()=>n(o=>!o),className:Be,title:"Line Spacing","aria-label":"Line Spacing",children:jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"5",y1:"5",x2:"19",y2:"5"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"19",y2:"19"}),jsxRuntime.jsx("path",{d:"M2 8 L2 3 M2 3 L3.5 4.5 M2 3 L0.5 4.5"}),jsxRuntime.jsx("path",{d:"M2 16 L2 21 M2 21 L3.5 19.5 M2 21 L0.5 19.5"})]})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-28",children:zot.map(o=>jsxRuntime.jsxs("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:i=>i.preventDefault(),onClick:()=>{t.canFormat&&(t.onUpdateTextStyle({lineSpacing:o.value}),n(false));},children:[o.label,t.effectiveTs?.lineSpacing===o.value&&jsxRuntime.jsx("span",{className:"ml-auto text-primary",children:"\u2022"})]},o.value))})})]})}function ape(t){let[e,n]=Jm.useState(false),r=Jm.useRef(null);return $V(r,e,n),jsxRuntime.jsxs("div",{className:"relative",ref:r,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canMut,onMouseDown:o=>o.preventDefault(),onClick:()=>n(o=>!o),className:Be,title:"Text Direction","aria-label":"Text Direction",children:jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("text",{x:"3",y:"16",fontSize:"12",fill:"currentColor",stroke:"none",children:"A"}),jsxRuntime.jsx("path",{d:"M18 6 C21 6 21 10 18 10"}),jsxRuntime.jsx("path",{d:"M18 10 L19.5 8.5 M18 10 L16.5 8.5"})]})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-36",children:Vot.map(o=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:i=>i.preventDefault(),onClick:()=>{t.canFormat&&(t.onUpdateTextStyle({textDirection:o.value}),n(false));},children:o.label},o.value))})})]})}function lpe(t){let[e,n]=Jm.useState(false),r=Jm.useRef(null);return $V(r,e,n),jsxRuntime.jsxs("div",{className:"relative",ref:r,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canMut,onMouseDown:o=>o.preventDefault(),onClick:()=>n(o=>!o),className:Be,title:"Columns",children:jsxRuntime.jsx(lu$1.LuColumns3,{className:Ne})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-28",children:Got.map(o=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:i=>i.preventDefault(),onClick:()=>{t.canFormat&&(t.onUpdateTextStyle({columnCount:o.value}),n(false));},children:o.label},o.value))})})]})}function eit(t,e){if(t){if(ze(t))return t.textStyle;if(t.type==="table"&&e&&t.tableData)return t.tableData.rows[e.rowIndex]?.cells[e.columnIndex]?.style}}var tit=["#000000","#ffffff","#ff0000","#00aa00","#0000ff","#ff8800","#8800cc","#00cccc","#ff69b4","#808080"],nit=["#ffff00","#00ff00","#00ffff","#ff00ff","#0000ff","#ff0000","#000080","#008080","#008000","#800080"];function _N(t){let{t:e}=reactI18next.useTranslation(),n=!!t.selectedElement,r=n&&t.canEdit,o=n&&t.selectedElement!==null&&ze(t.selectedElement),i=n&&t.selectedElement?.type==="table",s=o||i,a=eit(t.selectedElement,t.tableEditorState),l=o&&t.selectedElement&&ze(t.selectedElement)?t.selectedElement.textSegments?.[0]?.style?.color??t.selectedElement.textStyle?.color??"#000000":a?.color??"#000000",c=o&&t.selectedElement&&ze(t.selectedElement)?t.selectedElement.textSegments?.[0]?.style?.highlightColor??t.selectedElement.textStyle?.highlightColor??"#ffff00":"#ffff00",d=Jm.useRef(null),u=Jm.useRef(null),p=Jm.useCallback(f=>{s&&t.onUpdateTextStyle({color:f});},[s,t]),h=Jm.useCallback(f=>{s&&t.onUpdateTextStyle({highlightColor:f});},[s,t]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("div",{className:to,children:Vue.map((f,m,x)=>jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:y=>y.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let y=a;switch(f.id){case "bold":t.onUpdateTextStyle({bold:!y?.bold});break;case "italic":t.onUpdateTextStyle({italic:!y?.italic});break;case "underline":t.onUpdateTextStyle({underline:!y?.underline});break;case "strikethrough":t.onUpdateTextStyle({strikethrough:!y?.strikethrough});break}},className:m<x.length-1?fr:Jo,title:e(f.labelKey),children:f.i},f.id))}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s)return;let f=!!a?.textShadowColor;t.onUpdateTextStyle(f?{textShadowColor:void 0,textShadowBlur:void 0,textShadowOffsetX:void 0,textShadowOffsetY:void 0}:{textShadowColor:"#000000",textShadowBlur:2,textShadowOffsetX:1,textShadowOffsetY:1,textShadowOpacity:.5});},className:Be,title:"Text Shadow","aria-label":"Text Shadow",children:jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("text",{x:"6",y:"17",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"S"}),jsxRuntime.jsx("text",{x:"7.5",y:"18.5",fontSize:"16",fontWeight:"bold",fill:"none",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.4",children:"S"})]})}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let f=a?.fontSize??18;t.onUpdateTextStyle({fontSize:f+2});},className:fr,title:"Increase Font Size",children:jsxRuntime.jsx(lu$1.LuAArrowUp,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let f=a?.fontSize??18;t.onUpdateTextStyle({fontSize:Math.max(1,f-2)});},className:fr,title:"Decrease Font Size",children:jsxRuntime.jsx(lu$1.LuAArrowDown,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{s&&t.onUpdateTextStyle({bold:false,italic:false,underline:false,strikethrough:false,highlightColor:void 0});},className:Jo,title:"Clear Formatting",children:jsxRuntime.jsx(lu$1.LuRemoveFormatting,{className:Ne})})]}),jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),className:Be,title:"Character Spacing","aria-label":"Character Spacing",children:jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[jsxRuntime.jsx("text",{x:"4",y:"16",fontSize:"11",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"AV"}),jsxRuntime.jsx("path",{d:"M3 20 L1 20 M3 20 L5 20",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M21 20 L19 20 M21 20 L23 20",strokeWidth:"1.5"})]})}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:block pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-32",children:[{label:"Very Tight",value:-150},{label:"Tight",value:-75},{label:"Normal",value:0},{label:"Loose",value:75},{label:"Very Loose",value:150}].map(f=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:m=>m.preventDefault(),onClick:()=>{s&&t.onUpdateTextStyle({characterSpacing:f.value});},children:f.label},f.label))})})]}),jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),className:Be,title:"Font Color","aria-label":"Font Color",children:[jsxRuntime.jsx("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M6 20h12M9.5 4h5L18 16H6L9.5 4z"})}),jsxRuntime.jsx("div",{className:"w-4 h-1 rounded-sm -mt-0.5",style:{backgroundColor:l}})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:block pt-1",children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl p-2 w-36",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1.5 mb-2",children:tit.map(f=>jsxRuntime.jsx("button",{type:"button","aria-label":f,className:`w-5 h-5 rounded-full border transition-transform hover:scale-125 ${l?.toLowerCase()===f?"border-primary ring-1 ring-primary":"border-border"}`,style:{backgroundColor:f},onMouseDown:m=>m.preventDefault(),onClick:()=>p(f)},f))}),jsxRuntime.jsx("button",{type:"button",className:"w-full text-[10px] text-muted-foreground hover:text-foreground py-1 transition-colors",onMouseDown:f=>f.preventDefault(),onClick:()=>d.current?.click(),children:"Custom colour..."}),jsxRuntime.jsx("input",{ref:d,type:"color",className:"sr-only",value:l,onChange:f=>p(f.target.value)})]})})]}),jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),className:Be,title:"Text Highlight Color","aria-label":"Text Highlight Color",children:[jsxRuntime.jsx(lu$1.LuHighlighter,{className:Ne}),jsxRuntime.jsx("div",{className:"w-4 h-1 rounded-sm -mt-0.5",style:{backgroundColor:c}})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:block pt-1",children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl p-2 w-36",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1.5 mb-2",children:nit.map(f=>jsxRuntime.jsx("button",{type:"button","aria-label":f,className:`w-5 h-5 rounded-full border transition-transform hover:scale-125 ${c?.toLowerCase()===f?"border-primary ring-1 ring-primary":"border-border"}`,style:{backgroundColor:f},onMouseDown:m=>m.preventDefault(),onClick:()=>h(f)},f))}),jsxRuntime.jsx("button",{type:"button",className:"w-full text-[10px] text-muted-foreground hover:text-foreground py-1 transition-colors",onMouseDown:f=>f.preventDefault(),onClick:()=>u.current?.click(),children:"Custom colour..."}),jsxRuntime.jsx("input",{ref:u,type:"color",className:"sr-only",value:c,onChange:f=>h(f.target.value)})]})})]})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Font"})]}),qt,jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{!s||!t.selectedElement||t.onUpdateTextStyle({listType:a?.listType==="bullet"?"none":"bullet"});},className:fr,title:"Bullet List",children:jsxRuntime.jsx(lu$1.LuList,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{!s||!t.selectedElement||t.onUpdateTextStyle({listType:a?.listType==="numbered"?"none":"numbered"});},className:Jo,title:"Numbered List",children:jsxRuntime.jsx(lu$1.LuListOrdered,{className:Ne})})]}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let f=a?.paragraphMarginLeft??0;t.onUpdateTextStyle({paragraphMarginLeft:Math.max(0,f-24)});},className:fr,title:"Decrease Indent",children:jsxRuntime.jsx(lu$1.LuIndentDecrease,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let f=a?.paragraphMarginLeft??0;t.onUpdateTextStyle({paragraphMarginLeft:f+24});},className:Jo,title:"Increase Indent",children:jsxRuntime.jsx(lu$1.LuIndentIncrease,{className:Ne})})]}),jsxRuntime.jsx("div",{className:to,children:Gue.map((f,m,x)=>jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:y=>y.preventDefault(),onClick:()=>{s&&t.onUpdateTextStyle({align:f.id});},className:m<x.length-1?fr:Jo,title:e(f.labelKey),children:f.i},f.id))}),jsxRuntime.jsx(spe,{canMut:r,canFormat:s,effectiveTs:a,onUpdateTextStyle:t.onUpdateTextStyle}),jsxRuntime.jsx(ape,{canMut:r,canFormat:s,onUpdateTextStyle:t.onUpdateTextStyle}),jsxRuntime.jsx(lpe,{canMut:r,canFormat:s,onUpdateTextStyle:t.onUpdateTextStyle})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Paragraph"})]})]})}function PN(t){let{t:e}=reactI18next.useTranslation();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:Be,title:"Normal view",children:"Normal"}),t.onToggleSlideSorter?jsxRuntime.jsx("button",{className:Be,onClick:t.onToggleSlideSorter,title:"Slide Sorter view",children:"Slide Sorter"}):jsxRuntime.jsx("button",{className:Be,title:"Slide Sorter view",children:"Slide Sorter"}),jsxRuntime.jsx("button",{className:Be,title:"Reading View",children:"Reading View"})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Presentation Views"})]}),qt,jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-0.5",children:jsxRuntime.jsx("button",{onClick:t.onEnterMasterView,disabled:!t.canEdit,className:Be,title:"Edit slide masters and layouts",children:"Slide Master"})}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Master Views"})]}),qt,jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-0.5",children:t.onZoomToFit&&jsxRuntime.jsx("button",{className:Be,onClick:t.onZoomToFit,title:"Zoom to fit slide in window",children:"Zoom to Fit"})}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Zoom"})]}),qt,jsxRuntime.jsx("button",{onClick:()=>t.onSetEditTemplateMode(!t.editTemplateMode),disabled:!t.canEdit,className:ie(Be,t.editTemplateMode?"bg-amber-600 hover:bg-amber-500 text-amber-50":""),title:"Toggle template/master element editing",children:t.editTemplateMode?"Templates On":"Templates Off"}),t.onToggleSelectionPane&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleSelectionPane,className:ie(Be,t.isSelectionPaneOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Selection Pane",children:[jsxRuntime.jsx(lu$1.LuList,{className:Ne}),"Selection"]}),t.onToggleEyedropper&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleEyedropper,disabled:!t.canEdit,className:ie(Be,t.eyedropperActive?"bg-purple-600 hover:bg-purple-500 text-purple-50":""),title:"Eyedropper \u2014 sample a colour from the slide",children:[jsxRuntime.jsx(lu$1.LuPipette,{className:Ne}),"Eyedropper"]}),jsxRuntime.jsx("button",{onClick:()=>t.onSetShowGrid(!t.showGrid),className:ie(Be,t.showGrid?"bg-primary text-white":""),title:e("pptx.grid.toggleGrid"),children:e("pptx.grid.grid")}),jsxRuntime.jsx("button",{onClick:()=>t.onSetShowRulers(!t.showRulers),className:ie(Be,t.showRulers?"bg-primary text-white":""),title:e("pptx.ruler.toggleRulers"),children:e("pptx.ruler.rulers")}),jsxRuntime.jsx("button",{onClick:()=>t.onSetSnapToGrid(!t.snapToGrid),className:ie(Be,t.snapToGrid?"bg-primary text-white":""),title:e("pptx.grid.snapToGrid"),children:e("pptx.grid.snapToGrid")}),jsxRuntime.jsx("button",{onClick:()=>t.onSetSnapToShape(!t.snapToShape),className:ie(Be,t.snapToShape?"bg-primary text-white":""),title:e("pptx.grid.snapToShape"),children:e("pptx.grid.snapToShape")}),jsxRuntime.jsx("button",{onClick:()=>t.onAddGuide("h"),className:Be,title:"Add horizontal guide",children:"H Guide"}),jsxRuntime.jsx("button",{onClick:()=>t.onAddGuide("v"),className:Be,title:"Add vertical guide",children:"V Guide"}),jsxRuntime.jsx("button",{onClick:()=>t.onSetSpellCheckEnabled(!t.spellCheckEnabled),className:ie(Be,t.spellCheckEnabled?"bg-primary text-white":""),title:"Toggle spell check",children:"Spell"})]})}function AN({open:t,onClose:e,title:n,children:r,heightFraction:o=.6,fullScreen:i=false,autoHeight:s=false,className:a,headerRight:l}){let c=Jm.useRef(null),{dragY:d,dragging:u,handlers:p}=Lu(e);if(Jm.useEffect(()=>{if(!t)return;let f=m=>{m.key==="Escape"&&e();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[t,e]),!t)return null;let h=s?{maxHeight:"calc(85dvh - env(safe-area-inset-top))"}:i?{height:"calc(100dvh - env(safe-area-inset-top))"}:{height:`${Math.round(o*100)}dvh`};return jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col justify-end",role:"dialog","aria-modal":"true",children:[jsxRuntime.jsx("button",{type:"button","aria-label":"Close",className:"absolute inset-0 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150",onClick:e}),jsxRuntime.jsxs("div",{ref:c,className:ie("relative bg-background border-t border-border rounded-t-2xl shadow-2xl flex flex-col overflow-hidden","animate-in slide-in-from-bottom duration-200",a),style:{...h,transform:d>0?`translateY(${d}px)`:void 0,transition:u?"none":"transform 150ms ease-out"},children:[jsxRuntime.jsxs("div",{className:"cursor-grab active:cursor-grabbing touch-none",onPointerDown:p.onPointerDown,onPointerMove:p.onPointerMove,onPointerUp:p.onPointerUp,onPointerCancel:p.onPointerCancel,children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center pt-2 pb-1",children:jsxRuntime.jsx("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/40"})}),(n||l)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 pb-2 border-b border-border/60",children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold text-foreground truncate",children:n}),l]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:r})]})]})}var Cit=[{key:"home",label:"Home",icon:lu$1.LuClipboardCopy},{key:"insert",label:"Insert",icon:lu$1.LuPlus},{key:"text",label:"Text",icon:lu$1.LuType},{key:"draw",label:"Draw",icon:lu$1.LuPaintbrush},{key:"arrange",label:"Arrange",icon:lu$1.LuShapes},{key:"design",label:"Design",icon:lu$1.LuLayoutGrid},{key:"transitions",label:"Transitions",icon:lu$1.LuSparkles},{key:"animations",label:"Animations",icon:lu$1.LuWand},{key:"slideShow",label:"Slide Show",icon:lu$1.LuPresentation},{key:"review",label:"Review",icon:lu$1.LuTextCursorInput},{key:"view",label:"View",icon:lu$1.LuSettings},{key:"file",label:"File",icon:lu$1.LuFile}];function upe(t){let{open:e,onClose:n}=t,[r,o]=Jm.useState("home");return jsxRuntime.jsx(AN,{open:e,onClose:n,autoHeight:true,title:"Menu",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("div",{className:"sticky top-0 z-10 bg-background border-b border-border",children:jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-2",children:Cit.map(({key:i,label:s,icon:a})=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>o(r===i?null:i),className:ie("inline-flex items-center gap-1.5 shrink-0 px-3 py-2 rounded-full text-[12px] font-medium border transition-colors min-h-[36px]",r===i?"bg-primary text-white border-primary":"border-border text-muted-foreground hover:text-foreground hover:bg-accent/40"),children:[jsxRuntime.jsx(a,{className:"w-4 h-4"}),s]},i))})}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsx(Mit,{active:r,...t})})]})})}function Mit({active:t,...e}){let n="flex flex-wrap items-center gap-2";switch(t){case "home":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(wN,{canEdit:e.canEdit,clipboardPayload:e.clipboardPayload,formatPainterActive:e.formatPainterActive,canActivateFormatPainter:e.canActivateFormatPainter,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onToggleFormatPainter:e.onToggleFormatPainter,layoutOptions:e.layoutOptions,onInsertSlideFromLayout:e.onInsertSlideFromLayout,selectedElement:e.selectedElement,onUpdateTextStyle:e.onUpdateTextStyle})});case "insert":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(CN,{canEdit:e.canEdit,newShapeType:e.newShapeType,onSetNewShapeType:e.onSetNewShapeType,onAddTextBox:e.onAddTextBox,onAddShape:e.onAddShape,onAddTable:e.onAddTable,onAddChart:e.onAddChart,onAddSmartArt:e.onAddSmartArt,onAddEquation:e.onAddEquation,onAddActionButton:e.onAddActionButton,onInsertField:e.onInsertField,onOpenImagePicker:e.onOpenImagePicker,onOpenMediaPicker:e.onOpenMediaPicker})});case "text":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(_N,{canEdit:e.canEdit,selectedElement:e.selectedElement,tableEditorState:e.tableEditorState,onUpdateTextStyle:e.onUpdateTextStyle})});case "draw":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(bN,{activeTool:e.activeTool,drawingColor:e.drawingColor,drawingWidth:e.drawingWidth,onSetActiveTool:e.onSetActiveTool,onSetDrawingColor:e.onSetDrawingColor,onSetDrawingWidth:e.onSetDrawingWidth})});case "arrange":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(fN,{canEdit:e.canEdit,selectedElement:e.selectedElement,clipboardPayload:e.clipboardPayload,onAlignElements:e.onAlignElements,onDistributeElements:e.onDistributeElements,canDistribute:e.canDistribute,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onFlip:e.onFlip,onMoveLayer:e.onMoveLayer,onMoveLayerToEdge:e.onMoveLayerToEdge,onDuplicate:e.onDuplicate,onDelete:e.onDelete,formatPainterActive:e.formatPainterActive,onToggleFormatPainter:e.onToggleFormatPainter,canActivateFormatPainter:e.canActivateFormatPainter})});case "design":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(mN,{canEdit:e.canEdit,onToggleThemeGallery:e.onToggleThemeGallery,isThemeGalleryOpen:e.isThemeGalleryOpen,onToggleThemeEditor:e.onToggleThemeEditor,isThemeEditorOpen:e.isThemeEditorOpen,onOpenDocumentProperties:e.onOpenDocumentProperties,onToggleInspector:e.onToggleInspector,isInspectorPaneOpen:e.isInspectorPaneOpen})});case "transitions":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(gN,{isInspectorPaneOpen:e.isInspectorPaneOpen,onToggleInspector:e.onToggleInspector})});case "animations":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(hN,{canEdit:e.canEdit,selectedElement:e.selectedElement,isInspectorPaneOpen:e.isInspectorPaneOpen,onToggleInspector:e.onToggleInspector,onOpenAnimationPanel:e.onOpenAnimationPanel,onAddAnimation:e.onAddAnimation,onRemoveAnimation:e.onRemoveAnimation})});case "slideShow":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(MN,{onPresent:()=>e.onSetMode("present"),onEnterPresenterView:e.onEnterPresenterView??(()=>{}),onEnterRehearsalMode:e.onEnterRehearsalMode??(()=>{}),onOpenSetUpSlideShow:e.onOpenSetUpSlideShow??(()=>{}),onOpenBroadcastDialog:e.onOpenBroadcastDialog??(()=>{}),onToggleSubtitles:e.onToggleSubtitles??(()=>{}),showSubtitles:e.showSubtitles??false,onSetMode:e.onSetMode})});case "review":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(xN,{canEdit:e.canEdit,spellCheckEnabled:e.spellCheckEnabled,onSetSpellCheckEnabled:e.onSetSpellCheckEnabled,onToggleComments:e.onToggleComments,isCommentsPanelOpen:e.isCommentsPanelOpen,slideCommentCount:e.slideCommentCount,onCompare:e.onCompare})});case "view":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(PN,{canEdit:e.canEdit,editTemplateMode:e.editTemplateMode,onSetEditTemplateMode:e.onSetEditTemplateMode,spellCheckEnabled:e.spellCheckEnabled,onSetSpellCheckEnabled:e.onSetSpellCheckEnabled,showGrid:e.showGrid,showRulers:e.showRulers,snapToGrid:e.snapToGrid,snapToShape:e.snapToShape,onSetShowGrid:e.onSetShowGrid,onSetShowRulers:e.onSetShowRulers,onSetSnapToGrid:e.onSetSnapToGrid,onSetSnapToShape:e.onSetSnapToShape,onAddGuide:e.onAddGuide,onEnterMasterView:e.onEnterMasterView,isSelectionPaneOpen:e.isSelectionPaneOpen,onToggleSelectionPane:e.onToggleSelectionPane,eyedropperActive:e.eyedropperActive,onToggleEyedropper:e.onToggleEyedropper})});case "file":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(vN,{onOpenFile:e.onOpenFile,onExportPng:e.onExportPng,onExportPdf:e.onExportPdf,onExportVideo:e.onExportVideo,onExportGif:e.onExportGif,onPackageForSharing:e.onPackageForSharing,onSaveAsPptx:e.onSaveAsPptx,onSaveAsPpsx:e.onSaveAsPpsx,onSaveAsPptm:e.onSaveAsPptm,hasMacros:e.hasMacros,onCopySlideAsImage:e.onCopySlideAsImage,onPrint:e.onPrint,onOpenDocumentProperties:e.onOpenDocumentProperties,onOpenPasswordProtection:e.onOpenPasswordProtection,onOpenFontEmbedding:e.onOpenFontEmbedding,onOpenDigitalSignatures:e.onOpenDigitalSignatures})});default:return jsxRuntime.jsxs("div",{className:"text-center text-sm text-muted-foreground py-8",children:[jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-5 h-5 inline-block opacity-50"})," Select a section above"]})}}function hpe(t){let{t:e}=reactI18next.useTranslation(),{mode:n,canUndo:r,canRedo:o,onUndo:i,onRedo:s,onSetMode:a,onSaveAsPptx:l}=t,[c,d]=Jm.useState(false),u=n==="edit"||n==="master",p="inline-flex items-center justify-center min-w-[44px] min-h-[44px] rounded-md text-foreground/80 hover:bg-accent/60 disabled:opacity-40 disabled:cursor-not-allowed active:scale-95 transition-transform";return jsxRuntime.jsxs("div",{role:"toolbar","aria-label":"Toolbar",className:"relative z-20 flex items-center gap-1 px-2 py-1 border-b border-border bg-secondary/50 min-h-[52px] pt-[max(env(safe-area-inset-top),0px)]",children:[u&&jsxRuntime.jsx("button",{type:"button",onClick:()=>d(true),className:p,title:"Menu","aria-label":"Menu",children:jsxRuntime.jsx(lu$1.LuMenu,{className:"w-5 h-5"})}),u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:i,disabled:!r,className:p,title:e("pptx.toolbar.undo"),"aria-label":e("pptx.toolbar.undo"),children:jsxRuntime.jsx(lu$1.LuUndo,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{type:"button",onClick:s,disabled:!o,className:p,title:e("pptx.toolbar.redo"),"aria-label":e("pptx.toolbar.redo"),children:jsxRuntime.jsx(lu$1.LuRedo,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{type:"button",onClick:l,className:p,title:e("pptx.toolbar.save","Save"),"aria-label":e("pptx.toolbar.save","Save"),children:jsxRuntime.jsx(lu$1.LuDownload,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>a("present"),className:ie(p,"text-primary"),title:e("pptx.toolbar.present"),"aria-label":e("pptx.toolbar.present"),children:jsxRuntime.jsx(lu$1.LuPresentation,{className:"w-5 h-5"})}),u&&jsxRuntime.jsx("button",{type:"button",onClick:t.onOpenShareDialog??t.onPackageForSharing,className:ie(p,"bg-primary text-white hover:bg-primary/90 px-3"),title:e("pptx.toolbar.share"),"aria-label":e("pptx.toolbar.share"),children:jsxRuntime.jsx(lu$1.LuShare2,{className:"w-4 h-4"})}),jsxRuntime.jsx(upe,{open:c,onClose:()=>d(false),...t})]})}var fpe=["#ffffff","#000000","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff","#008888","#888888"],$it=Bm.slice(0,12);function mpe(t){let[e,n]=Jm.useState(false),[r,o]=Jm.useState(false),[i,s]=Jm.useState(false),[a,l]=Jm.useState(false),c=Jm.useRef(null),d=Jm.useRef(null),u=Jm.useRef(null),p=Jm.useRef(null);return Jm.useEffect(()=>{if(!e)return;let h=f=>{c.current&&!c.current.contains(f.target)&&n(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[e]),Jm.useEffect(()=>{if(!r)return;let h=f=>{d.current&&!d.current.contains(f.target)&&o(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]),Jm.useEffect(()=>{if(!i)return;let h=f=>{u.current&&!u.current.contains(f.target)&&s(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[i]),Jm.useEffect(()=>{if(!a)return;let h=f=>{p.current&&!p.current.contains(f.target)&&l(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[a]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",ref:c,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit,className:Be,title:"Shapes",onClick:()=>n(h=>!h),children:[jsxRuntime.jsx(lu$1.LuShapes,{className:Ne}),"Shapes"]}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-52 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:$it.map(h=>jsxRuntime.jsxs("button",{type:"button",className:ie("flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",t.newShapeType===h.type&&"bg-accent"),onClick:()=>{t.onSetNewShapeType(h.type),t.onAddShape(),n(false);},children:[h.icon,h.label]},h.type))})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:d,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit||!t.selectedElement,className:Be,title:"Arrange",onClick:()=>o(h=>!h),children:[jsxRuntime.jsx(lu$1.LuLayers,{className:Ne}),"Arrange"]}),r&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-44 pt-1",children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:[jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onMoveLayer("forward"),o(false);},children:"Bring Forward"}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onMoveLayer("backward"),o(false);},children:"Send Backward"}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onMoveLayerToEdge("front"),o(false);},children:"Bring to Front"}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onMoveLayerToEdge("back"),o(false);},children:"Send to Back"})]})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:u,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canEdit||!t.selectedElement,className:Be,title:"Shape Fill",onClick:()=>s(h=>!h),children:jsxRuntime.jsx(lu$1.LuPaintBucket,{className:Ne})}),i&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl p-2 grid grid-cols-6 gap-1",children:fpe.map(h=>jsxRuntime.jsx("button",{type:"button","aria-label":`Fill colour ${h}`,className:"w-5 h-5 rounded border border-border/60 hover:scale-110 transition-transform",style:{backgroundColor:h},title:h,onClick:()=>{t.onUpdateElementStyle?.({fill:h}),s(false);}},h))})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:p,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canEdit||!t.selectedElement,className:Be,title:"Shape Outline",onClick:()=>l(h=>!h),children:jsxRuntime.jsx(lu$1.LuPenLine,{className:Ne})}),a&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl p-2 grid grid-cols-6 gap-1",children:fpe.map(h=>jsxRuntime.jsx("button",{type:"button","aria-label":`Outline colour ${h}`,className:"w-5 h-5 rounded border border-border/60 hover:scale-110 transition-transform",style:{backgroundColor:h},title:h,onClick:()=>{t.onUpdateElementStyle?.({outlineColor:h}),l(false);}},h))})})]}),jsxRuntime.jsx("button",{type:"button",disabled:true,className:ie(Be,"opacity-50 cursor-not-allowed"),title:"Shape Effects (not available)",children:jsxRuntime.jsx(lu$1.LuSparkles,{className:Ne})})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Drawing"})]}),qt]})}function gpe(t){let[e,n]=Jm.useState(false),r=Jm.useRef(null);return Jm.useEffect(()=>{if(!e)return;let o=i=>{r.current&&!r.current.contains(i.target)&&n(false);};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[e]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[qt,jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",onMouseDown:o=>o.preventDefault(),onClick:t.onToggleFindReplace,className:fr,title:"Find",children:jsxRuntime.jsx(lu$1.LuSearch,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",onMouseDown:o=>o.preventDefault(),onClick:t.onToggleFindReplace,className:Jo,title:"Replace",children:jsxRuntime.jsx(lu$1.LuReplace,{className:Ne})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:r,children:[jsxRuntime.jsx("button",{type:"button",onMouseDown:o=>o.preventDefault(),onClick:()=>n(o=>!o),className:Be,title:"Select",children:jsxRuntime.jsx(lu$1.LuMousePointer2,{className:Ne})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-32",children:jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:o=>o.preventDefault(),onClick:()=>{t.onSelectAll?.(),n(false);},children:"Select All"})})})]})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Editing"})]})]})}Pe();function xpe(t){let{t:e}=reactI18next.useTranslation(),n=No(),r=n&&n.status==="connected";return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 pr-1",children:[t.onEnterRehearsalMode&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onEnterRehearsalMode,className:e$.record,title:e("pptx.titleBar.record"),"aria-label":e("pptx.titleBar.record"),children:[jsxRuntime.jsx("span",{className:e$.recordDot,"aria-hidden":"true"}),jsxRuntime.jsx("span",{children:e("pptx.titleBar.record")})]}),jsxRuntime.jsxs("button",{type:"button",onClick:t.onOpenShareDialog??t.onPackageForSharing,className:ie("relative inline-flex items-center gap-1 px-2.5 py-1 rounded-sm text-[11px] font-medium transition-colors whitespace-nowrap",r?"bg-green-600 hover:bg-green-500 text-white":"bg-primary hover:bg-primary/90 text-white"),title:r?e("pptx.toolbar.sharingUsers",{count:n.connectedCount}):e("pptx.toolbar.share"),"aria-label":e("pptx.toolbar.share"),children:[jsxRuntime.jsx(lu$1.LuShare2,{className:"w-3 h-3"}),jsxRuntime.jsx("span",{children:r?e("pptx.toolbar.sharingCount",{count:n.connectedCount}):e("pptx.toolbar.share")})]})]})}function ype({customShows:t,activeCustomShowId:e,canEdit:n,isCurrentSlideInActiveShow:r,onSetActiveCustomShowId:o,onCreateCustomShow:i,onRenameActiveCustomShow:s,onDeleteActiveCustomShow:a,onToggleCurrentSlideInActiveShow:l}){return t.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[qt,jsxRuntime.jsxs("select",{value:e??"",onChange:c=>o(c.target.value||null),className:"h-6 px-1.5 text-[11px] rounded bg-muted text-foreground border border-border hover:bg-accent transition-colors cursor-pointer",title:"Custom show","aria-label":"Select custom show",children:[jsxRuntime.jsx("option",{value:"",children:"All Slides"}),t.map(c=>jsxRuntime.jsx("option",{value:c.id,children:c.name},c.id))]}),n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:i,className:"px-2 py-1 rounded bg-muted hover:bg-accent text-[11px] transition-colors",title:"Create custom show",children:"+ Show"}),e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:s,className:"px-2 py-1 rounded bg-muted hover:bg-accent text-[11px] transition-colors",title:"Rename active custom show",children:"Rename"}),jsxRuntime.jsx("button",{type:"button",onClick:a,className:"px-2 py-1 rounded bg-red-700/80 hover:bg-red-600 text-[11px] transition-colors",title:"Delete active custom show",children:"Delete"}),jsxRuntime.jsx("button",{type:"button",onClick:l,className:ie("px-2 py-1 rounded text-[11px] transition-colors",r?"bg-primary text-white":"bg-muted hover:bg-accent"),title:"Include/exclude current slide in active custom show",children:r?"In Show":"Add Slide"})]})]})]}):n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[qt,jsxRuntime.jsx("button",{type:"button",onClick:i,className:"px-2 py-1 rounded bg-muted hover:bg-accent text-[11px] transition-colors",title:"Create custom show",children:"+ Show"})]}):null}function bpe({isActive:t,onPresent:e,onPresenterView:n,onRehearse:r,onSetUpSlideShow:o,onBroadcast:i,onToggleSubtitles:s,showSubtitles:a}){let[l,c]=Jm.useState(false);return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("div",{className:"inline-flex border-l border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:ie("px-2 py-1 transition-colors",t?"bg-primary text-white":"hover:bg-accent text-foreground"),title:"Present (fullscreen)",children:"Present"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>c(d=>!d),className:ie("px-1 py-1 transition-colors border-l border-border",l?"bg-primary text-white":"hover:bg-accent text-foreground"),title:"Presentation options","aria-label":"Presentation options",children:jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})})]}),l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:"fixed inset-0 z-40","aria-label":"Close menu",onClick:()=>c(false)}),jsxRuntime.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 w-52 rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),e();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Present"]}),n&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),n();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuMonitor,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Presenter View"]}),r&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),r();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuClock,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Rehearse Timings"]}),jsxRuntime.jsx("div",{className:"my-1 border-t border-border/60"}),o&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),o();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuSettings,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Set Up Slide Show"]}),i&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),i();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuRadio,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Present Online"]}),s&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),s();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuCaptions,{className:"w-3.5 h-3.5 text-muted-foreground"}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:"Subtitles"}),a&&jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3 h-3 text-primary"})]})]})]})]})}function vpe({mode:t,onSetMode:e,onCloseMasterView:n,onEnterPresenterView:r,onEnterRehearsalMode:o,onOpenSetUpSlideShow:i,onOpenBroadcastDialog:s,onToggleSubtitles:a,showSubtitles:l}){return t==="master"?jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm bg-amber-600/90 text-[10px] text-amber-50",children:"Master View"}),jsxRuntime.jsx("button",{type:"button",onClick:n,className:"px-2 py-0.5 rounded-sm hover:bg-accent text-[10px] text-foreground transition-colors",title:"Close master view",children:"Close"})]}):jsxRuntime.jsx(bpe,{isActive:t==="present",onPresent:()=>e("present"),onPresenterView:r,onRehearse:o,onSetUpSlideShow:i,onBroadcast:s,onToggleSubtitles:a,showSubtitles:l})}function Spe(t){let{t:e}=reactI18next.useTranslation(),n=r=>{t.onSetOverflowMenuOpen(false),{png:t.onExportPng,pdf:t.onExportPdf,video:t.onExportVideo,gif:t.onExportGif,package:t.onPackageForSharing,pptx:t.onSaveAsPptx,ppsx:t.onSaveAsPpsx,pptm:t.onSaveAsPptm,print:t.onPrint,copyImg:t.onCopySlideAsImage,a11y:t.onRunAccessibilityCheck,shortcuts:t.onToggleShortcuts,versionHistory:t.onToggleVersionHistory,documentProperties:t.onOpenDocumentProperties,passwordProtection:t.onOpenPasswordProtection,fontEmbedding:t.onOpenFontEmbedding,digitalSignatures:t.onOpenDigitalSignatures}[r]?.();};return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onSetOverflowMenuOpen(!t.isOverflowMenuOpen),className:ie("p-1.5 rounded transition-colors",t.isOverflowMenuOpen?"bg-primary/80 text-white":"bg-muted hover:bg-accent"),title:e("pptx.ribbon.moreActions"),"aria-label":e("pptx.ribbon.moreActions"),children:jsxRuntime.jsx(lu$1.LuEllipsis,{className:Ne})}),t.isOverflowMenuOpen&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:"fixed inset-0 z-40","aria-label":e("pptx.overflow.closeMenu"),onClick:()=>t.onSetOverflowMenuOpen(false)}),jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 w-44 rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:zue.filter(r=>r.k!=="pptm"||t.hasMacros).map(r=>r.k.startsWith("---")?jsxRuntime.jsx("div",{className:"my-1 border-t border-border/60"},r.k):jsxRuntime.jsxs("button",{type:"button",onClick:()=>n(r.k),className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[r.i,e(r.labelKey)]},r.k))})]})]})}function Tpe(t){let{t:e}=reactI18next.useTranslation(),{mode:n,canEdit:r,isSidebarCollapsed:o,isInspectorPaneOpen:i,onToggleSidebar:s,onToggleInspector:a}=t,l=No(),c="p-1 max-md:p-2 max-md:min-h-[40px] max-md:min-w-[40px] rounded-sm transition-colors hover:bg-accent/60 disabled:opacity-40 disabled:cursor-not-allowed active:scale-90 active:opacity-70";return jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 max-md:gap-0 px-1.5 py-0.5 max-md:px-1",children:[n!=="present"&&jsxRuntime.jsx("button",{type:"button",onClick:s,className:ie(c,o?"text-muted-foreground":"text-foreground"),title:e("pptx.toolbar.toggleSlidesPanel"),"aria-label":e("pptx.toolbar.toggleSlidesPanel"),children:jsxRuntime.jsx(lu$1.LuPanelLeft,{className:Ne})}),jsxRuntime.jsx("div",{className:"flex-1 min-w-2 max-md:min-w-1"}),(n==="edit"||n==="master")&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleComments,className:ie(c,"relative max-md:hidden",t.isCommentsPanelOpen?"text-foreground":"text-muted-foreground"),title:e("pptx.toolbar.comments"),"aria-label":e("pptx.toolbar.comments"),children:[jsxRuntime.jsx(lu$1.LuMessageSquare,{className:Gn}),(t.slideCommentCount??0)>0&&jsxRuntime.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center w-3.5 h-3.5 rounded-full bg-primary text-[8px] text-white leading-none",children:t.slideCommentCount})]}),l&&(l.status==="connected"||l.status==="connecting")&&l.remoteUsers.length>0&&jsxRuntime.jsx("button",{type:"button",onClick:t.onOpenShareDialog,className:"mx-1 rounded-sm px-1 py-0.5 hover:bg-accent/60 transition-colors cursor-pointer",title:e("pptx.toolbar.sharingUsers",{count:l.connectedCount}),children:jsxRuntime.jsx(EH,{remoteUsers:l.remoteUsers,localUserName:l.config.userName,localUserColor:l.config.userColor??"#6366f1",localUserAvatar:l.config.userAvatar,status:l.status})}),jsxRuntime.jsx(vpe,{mode:t.mode,onSetMode:t.onSetMode,onCloseMasterView:t.onCloseMasterView,onToggleSlideSorter:t.onToggleSlideSorter,onEnterPresenterView:t.onEnterPresenterView,onEnterRehearsalMode:t.onEnterRehearsalMode,onOpenSetUpSlideShow:t.onOpenSetUpSlideShow,onOpenBroadcastDialog:t.onOpenBroadcastDialog,onToggleSubtitles:t.onToggleSubtitles,showSubtitles:t.showSubtitles}),jsxRuntime.jsx(ype,{customShows:t.customShows,activeCustomShowId:t.activeCustomShowId,canEdit:t.canEdit,isCurrentSlideInActiveShow:t.isCurrentSlideInActiveShow,onSetActiveCustomShowId:t.onSetActiveCustomShowId,onCreateCustomShow:t.onCreateCustomShow,onRenameActiveCustomShow:t.onRenameActiveCustomShow,onDeleteActiveCustomShow:t.onDeleteActiveCustomShow,onToggleCurrentSlideInActiveShow:t.onToggleCurrentSlideInActiveShow}),qt,(n==="edit"||n==="master")&&jsxRuntime.jsx("button",{type:"button",onClick:a,className:ie(c,i?"text-foreground":"text-muted-foreground"),title:e("pptx.toolbar.toggleInspector"),"aria-label":e("pptx.toolbar.toggleInspector"),children:jsxRuntime.jsx(lu$1.LuPanelRight,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",onClick:t.onOpenSettings??t.onToggleShortcuts,className:ie(c,"text-muted-foreground"),title:e("pptx.toolbar.settingsShortcuts"),"aria-label":e("pptx.toolbar.settings"),children:jsxRuntime.jsx(lu$1.LuSettings,{className:Gn})}),!r&&jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm bg-amber-600/90 text-[10px] text-amber-50",children:e("pptx.toolbar.readOnly")}),jsxRuntime.jsx(Spe,{...t})]})}function WV(t){let{mode:e,isNarrowViewport:n,isCompactToolbarOpen:r,toolbarSection:o,onSetToolbarSection:i}=t,{t:s}=reactI18next.useTranslation();if(n&&e!=="present")return jsxRuntime.jsx(hpe,{...t});let a=o==="file",l=o==="home",c=o==="insert",d=l||o==="text",u=l||o==="arrange",p=o==="draw",h=o==="design",f=o==="transitions",m=o==="animations",x=o==="slideShow",g=o==="record",y=o==="review",b=o==="view",v=o==="help",S=e==="edit"||e==="master";return jsxRuntime.jsxs("div",{role:"toolbar","aria-label":"Presentation toolbar",className:"relative z-20 border-b border-border bg-secondary/50 overflow-visible",children:[jsxRuntime.jsx(Tpe,{...t}),S&&jsxRuntime.jsxs("div",{className:"flex items-center border-b border-border/60 px-1 max-md:overflow-x-auto max-md:scrollbar-none",children:[Are.map(w=>jsxRuntime.jsx("button",{type:"button",onClick:()=>i(w.id),className:ie("relative px-3.5 py-2 text-[12px] font-medium whitespace-nowrap transition-colors max-md:min-h-[36px] max-md:px-3",o===w.id?w.id==="file"?"text-white bg-primary/80 rounded-sm":"text-foreground after:absolute after:-bottom-px after:left-0 after:right-0 after:h-[2.5px] after:bg-primary":w.id==="file"?"text-primary hover:bg-primary/15 rounded-sm":"text-muted-foreground hover:text-foreground hover:bg-accent/30"),children:s(w.labelKey)},w.id)),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx(xpe,{onEnterRehearsalMode:t.canEdit?t.onEnterRehearsalMode:void 0,onOpenShareDialog:t.onOpenShareDialog,onPackageForSharing:t.onPackageForSharing}),n&&jsxRuntime.jsx("button",{type:"button",onClick:t.onToggleCompactToolbar,className:ie("px-2 py-1 rounded text-[11px] transition-colors mr-1",r?"bg-primary/80 text-white":"text-muted-foreground hover:text-foreground"),title:s(r?"pptx.ribbon.collapseRibbon":"pptx.ribbon.expandRibbon"),children:s(r?"pptx.ribbon.collapseRibbon":"pptx.ribbon.expandRibbon")})]}),S&&jsxRuntime.jsxs("div",{className:ie("flex items-center gap-1.5 px-2 py-1 max-md:px-1 max-md:py-0.5 overflow-visible flex-nowrap",n&&!r&&"hidden"),children:[a&&jsxRuntime.jsx(vN,{onOpenFile:t.onOpenFile,onExportPng:t.onExportPng,onExportPdf:t.onExportPdf,onExportVideo:t.onExportVideo,onExportGif:t.onExportGif,onPackageForSharing:t.onPackageForSharing,onSaveAsPptx:t.onSaveAsPptx,onSaveAsPpsx:t.onSaveAsPpsx,onSaveAsPptm:t.onSaveAsPptm,hasMacros:t.hasMacros,onCopySlideAsImage:t.onCopySlideAsImage,onPrint:t.onPrint,onOpenDocumentProperties:t.onOpenDocumentProperties,onOpenPasswordProtection:t.onOpenPasswordProtection,onOpenFontEmbedding:t.onOpenFontEmbedding,onOpenDigitalSignatures:t.onOpenDigitalSignatures}),l&&jsxRuntime.jsx(wN,{canEdit:t.canEdit,clipboardPayload:t.clipboardPayload,formatPainterActive:t.formatPainterActive,canActivateFormatPainter:t.canActivateFormatPainter,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onToggleFormatPainter:t.onToggleFormatPainter,layoutOptions:t.layoutOptions,onInsertSlideFromLayout:t.onInsertSlideFromLayout,selectedElement:t.selectedElement,onUpdateTextStyle:t.onUpdateTextStyle}),c&&jsxRuntime.jsx(CN,{canEdit:t.canEdit,newShapeType:t.newShapeType,onSetNewShapeType:t.onSetNewShapeType,onAddTextBox:t.onAddTextBox,onAddShape:t.onAddShape,onAddTable:t.onAddTable,onAddChart:t.onAddChart,onAddSmartArt:t.onAddSmartArt,onAddEquation:t.onAddEquation,onAddActionButton:t.onAddActionButton,onInsertField:t.onInsertField,onOpenImagePicker:t.onOpenImagePicker,onOpenMediaPicker:t.onOpenMediaPicker}),d&&jsxRuntime.jsx(_N,{canEdit:t.canEdit,selectedElement:t.selectedElement,tableEditorState:t.tableEditorState,onUpdateTextStyle:t.onUpdateTextStyle}),l&&jsxRuntime.jsx(gpe,{onToggleFindReplace:t.onToggleFindReplace}),l&&jsxRuntime.jsx(mpe,{canEdit:t.canEdit,selectedElement:t.selectedElement,newShapeType:t.newShapeType,onSetNewShapeType:t.onSetNewShapeType,onAddShape:t.onAddShape,onMoveLayer:t.onMoveLayer,onMoveLayerToEdge:t.onMoveLayerToEdge}),p&&jsxRuntime.jsx(bN,{activeTool:t.activeTool,drawingColor:t.drawingColor,drawingWidth:t.drawingWidth,onSetActiveTool:t.onSetActiveTool,onSetDrawingColor:t.onSetDrawingColor,onSetDrawingWidth:t.onSetDrawingWidth}),u&&jsxRuntime.jsx(fN,{canEdit:t.canEdit,selectedElement:t.selectedElement,clipboardPayload:t.clipboardPayload,onAlignElements:t.onAlignElements,onDistributeElements:t.onDistributeElements,canDistribute:t.canDistribute,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onFlip:t.onFlip,onMoveLayer:t.onMoveLayer,onMoveLayerToEdge:t.onMoveLayerToEdge,onDuplicate:t.onDuplicate,onDelete:t.onDelete,formatPainterActive:t.formatPainterActive,onToggleFormatPainter:t.onToggleFormatPainter,canActivateFormatPainter:t.canActivateFormatPainter}),h&&jsxRuntime.jsx(mN,{canEdit:t.canEdit,onToggleThemeGallery:t.onToggleThemeGallery,isThemeGalleryOpen:t.isThemeGalleryOpen,onToggleThemeEditor:t.onToggleThemeEditor,isThemeEditorOpen:t.isThemeEditorOpen,onOpenDocumentProperties:t.onOpenDocumentProperties,onToggleInspector:t.onToggleInspector,isInspectorPaneOpen:t.isInspectorPaneOpen}),f&&jsxRuntime.jsx(gN,{isInspectorPaneOpen:t.isInspectorPaneOpen,onToggleInspector:t.onToggleInspector}),m&&jsxRuntime.jsx(hN,{canEdit:t.canEdit,selectedElement:t.selectedElement,isInspectorPaneOpen:t.isInspectorPaneOpen,onToggleInspector:t.onToggleInspector,onOpenAnimationPanel:t.onOpenAnimationPanel,onAddAnimation:t.onAddAnimation,onRemoveAnimation:t.onRemoveAnimation}),x&&jsxRuntime.jsx(MN,{onPresent:()=>t.onSetMode("present"),onEnterPresenterView:t.onEnterPresenterView??(()=>{}),onEnterRehearsalMode:t.onEnterRehearsalMode??(()=>{}),onOpenSetUpSlideShow:t.onOpenSetUpSlideShow??(()=>{}),onOpenBroadcastDialog:t.onOpenBroadcastDialog??(()=>{}),onToggleSubtitles:t.onToggleSubtitles??(()=>{}),showSubtitles:t.showSubtitles??false,onSetMode:t.onSetMode}),g&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-2",children:[jsxRuntime.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-red-500"}),jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:"Record"})]}),y&&jsxRuntime.jsx(xN,{canEdit:t.canEdit,spellCheckEnabled:t.spellCheckEnabled,onSetSpellCheckEnabled:t.onSetSpellCheckEnabled,onToggleComments:t.onToggleComments,isCommentsPanelOpen:t.isCommentsPanelOpen,slideCommentCount:t.slideCommentCount,onCompare:t.onCompare}),b&&jsxRuntime.jsx(PN,{canEdit:t.canEdit,editTemplateMode:t.editTemplateMode,onSetEditTemplateMode:t.onSetEditTemplateMode,spellCheckEnabled:t.spellCheckEnabled,onSetSpellCheckEnabled:t.onSetSpellCheckEnabled,showGrid:t.showGrid,showRulers:t.showRulers,snapToGrid:t.snapToGrid,snapToShape:t.snapToShape,onSetShowGrid:t.onSetShowGrid,onSetShowRulers:t.onSetShowRulers,onSetSnapToGrid:t.onSetSnapToGrid,onSetSnapToShape:t.onSetSnapToShape,onAddGuide:t.onAddGuide,onEnterMasterView:t.onEnterMasterView,isSelectionPaneOpen:t.isSelectionPaneOpen,onToggleSelectionPane:t.onToggleSelectionPane,eyedropperActive:t.eyedropperActive,onToggleEyedropper:t.onToggleEyedropper}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:t.onToggleShortcuts,className:Be,title:s("pptx.settings.keyboardShortcuts"),children:s("pptx.settings.keyboardShortcuts")}),jsxRuntime.jsx("button",{type:"button",onClick:t.onRunAccessibilityCheck,className:Be,title:s("pptx.ribbon.accessibilityCheck"),children:s("pptx.ribbon.accessibilityCheck")})]})]})]})}bt();Pe();var DN="bg-muted border border-border rounded px-2 py-1 w-full text-[11px]",Gu="bg-muted border border-border rounded px-2 py-1 w-full text-[11px]",Cpe=SR.filter(t=>t.value==="fadeIn"||t.value==="flyIn"||t.value==="zoomIn"),Mpe=SR.filter(t=>t.value==="fadeOut"||t.value==="flyOut"||t.value==="zoomOut"),_pe=SR.filter(t=>t.value==="spin"||t.value==="pulse"||t.value==="colorWave"||t.value==="bounce"||t.value==="flash"||t.value==="growShrink"||t.value==="teeter"),Ppe=[{value:"onClick",labelKey:"pptx.animation.trigger.onClick"},{value:"onShapeClick",labelKey:"pptx.animation.trigger.onShapeClick"},{value:"onHover",labelKey:"pptx.animation.trigger.onHover"},{value:"afterPrevious",labelKey:"pptx.animation.trigger.afterPrevious"},{value:"withPrevious",labelKey:"pptx.animation.trigger.withPrevious"}],Epe=[{value:"ease",labelKey:"pptx.animation.timingCurve.ease"},{value:"ease-in",labelKey:"pptx.animation.timingCurve.easeIn"},{value:"ease-out",labelKey:"pptx.animation.timingCurve.easeOut"},{value:"linear",labelKey:"pptx.animation.timingCurve.linear"}],Ape=[{value:"none",labelKey:"pptx.animation.repeatUntil.none"},{value:"untilNextClick",labelKey:"pptx.animation.repeatUntil.untilNextClick"},{value:"untilEndOfSlide",labelKey:"pptx.animation.repeatUntil.untilEndOfSlide"}],Rpe=[{value:"fromTop",labelKey:"pptx.animation.direction.fromTop",icon:lu$1.LuArrowDown},{value:"fromBottom",labelKey:"pptx.animation.direction.fromBottom",icon:lu$1.LuArrowUp},{value:"fromLeft",labelKey:"pptx.animation.direction.fromLeft",icon:lu$1.LuArrowRight},{value:"fromRight",labelKey:"pptx.animation.direction.fromRight",icon:lu$1.LuArrowLeft}],kpe=[{value:"asOne",labelKey:"pptx.animation.sequence.asOne"},{value:"byParagraph",labelKey:"pptx.animation.sequence.byParagraph"},{value:"byWord",labelKey:"pptx.animation.sequence.byWord"},{value:"byLetter",labelKey:"pptx.animation.sequence.byLetter"}];function Pst(t){return t.entrance?"bg-green-500/60":t.emphasis?"bg-yellow-500/60":t.exit?"bg-red-500/60":"bg-muted-foreground/40"}function Est(t){return t.entrance??t.emphasis??t.exit??"custom"}function Npe({selectedElementId:t,canEdit:e,handlers:n}){let{t:r}=reactI18next.useTranslation(),{sortedAnimations:o,dragIndex:i,dragOverIndex:s,timelineBarData:a,handleAnimationHover:l,handleAnimationHoverEnd:c,handleDragStart:d,handleDragOver:u,handleDragEnter:p,handleDragLeave:h,handleDrop:f,handleDragEnd:m,handleMoveUp:x,handleMoveDown:g,getTimelineLabel:y}=n;return o.length===0&&a.length===0?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a.length>0&&jsxRuntime.jsxs("div",{className:"mt-2 pt-2 border-t border-border",children:[jsxRuntime.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-1",children:r("pptx.animation.timelineBar")}),jsxRuntime.jsx("div",{className:"relative h-6 rounded bg-muted/50 border border-border overflow-hidden",children:a.map(b=>jsxRuntime.jsx("div",{className:ie("absolute top-0.5 bottom-0.5 rounded-sm transition-colors",Pst(b.anim),b.anim.elementId===t&&"ring-1 ring-primary"),style:{left:`${b.leftPercent}%`,width:`${Math.max(b.widthPercent,2)}%`},title:`${y(b.anim)} - ${Est(b.anim)} (${b.anim.durationMs??500}ms)`,onMouseEnter:()=>l(b.anim),onMouseLeave:c},b.anim.elementId))})]}),o.length>0&&jsxRuntime.jsxs("div",{className:"mt-2 pt-2 border-t border-border",children:[jsxRuntime.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-1",children:r("pptx.animation.timeline")}),jsxRuntime.jsx("div",{className:"space-y-0.5 max-h-40 overflow-y-auto",children:o.map((b,v)=>{let S=t===b.elementId;return jsxRuntime.jsxs("div",{draggable:e,onDragStart:T=>d(v,T),onDragOver:T=>u(v,T),onDragEnter:()=>p(v),onDragLeave:h,onDrop:T=>f(v,T),onDragEnd:m,onMouseEnter:()=>l(b),onMouseLeave:c,className:ie("flex items-center gap-1 px-1 py-0.5 rounded text-[10px] cursor-grab transition-colors",S?"bg-primary/30 text-primary":"bg-muted/50 text-muted-foreground",i===v&&"opacity-40",s===v&&"border-t-2 border-primary"),children:[e&&jsxRuntime.jsx(lu$1.LuGripVertical,{className:"w-3 h-3 text-muted-foreground/50 shrink-0"}),jsxRuntime.jsxs("span",{className:"text-muted-foreground w-4 shrink-0",children:[v+1,"."]}),jsxRuntime.jsx("span",{className:"truncate flex-1",children:y(b)}),b.entrance&&jsxRuntime.jsx(lu$1.LuMoveRight,{className:"w-3 h-3 text-green-400/70 shrink-0"}),b.emphasis&&jsxRuntime.jsx(lu$1.LuRotateCw,{className:"w-3 h-3 text-yellow-400/70 shrink-0"}),b.exit&&jsxRuntime.jsx(lu$1.LuMoveRight,{className:"w-3 h-3 text-red-400/70 rotate-180 shrink-0"}),e&&jsxRuntime.jsxs("div",{className:"flex gap-0.5 shrink-0",children:[jsxRuntime.jsx("button",{type:"button",disabled:v===0,className:"text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors",onClick:T=>{T.stopPropagation(),x(v);},title:r("pptx.animation.moveUp"),children:jsxRuntime.jsx(lu$1.LuChevronUp,{className:"w-3 h-3"})}),jsxRuntime.jsx("button",{type:"button",disabled:v===o.length-1,className:"text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors",onClick:T=>{T.stopPropagation(),g(v);},title:r("pptx.animation.moveDown"),children:jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})})]})]},b.elementId)})})]})]})}bt();Pe();function Dpe({canEdit:t,updateAnimations:e}){let[n,r]=Jm.useState(null),[o,i]=Jm.useState(null),s=Jm.useRef(0),a=Jm.useCallback((x,g)=>{t&&(r(x),g.dataTransfer.effectAllowed="move",g.dataTransfer.setData("text/plain",String(x)));},[t]),l=Jm.useCallback((x,g)=>{g.preventDefault(),g.dataTransfer.dropEffect="move",i(x);},[]),c=Jm.useCallback(x=>{s.current++,i(x);},[]),d=Jm.useCallback(()=>{s.current--,s.current<=0&&(i(null),s.current=0);},[]),u=Jm.useCallback((x,g)=>{e(y=>{let b=[...y].sort((S,w)=>(S.order??0)-(w.order??0)),[v]=b.splice(x,1);return b.splice(g,0,v),b.map((S,w)=>({...S,order:w}))});},[e]),p=Jm.useCallback((x,g)=>{g.preventDefault(),s.current=0;let y=n;r(null),i(null),!(y===null||y===x)&&u(y,x);},[n,u]),h=Jm.useCallback(()=>{r(null),i(null),s.current=0;},[]),f=Jm.useCallback(x=>{x<=0||u(x,x-1);},[u]),m=Jm.useCallback(x=>{e(g=>{let y=[...g].sort((v,S)=>(v.order??0)-(S.order??0));if(x>=y.length-1)return g;let b=y[x+1];return y[x+1]=y[x],y[x]=b,y.map((v,S)=>({...v,order:S}))});},[e]);return {dragIndex:n,dragOverIndex:o,handleDragStart:a,handleDragOver:l,handleDragEnter:c,handleDragLeave:d,handleDrop:p,handleDragEnd:h,handleMoveUp:f,handleMoveDown:m}}function Fpe({selectedElementId:t,selectedElementAnimation:e}){let n=Jm.useCallback(i=>{let s=i.entrance??i.emphasis??i.exit;!s||s==="none"||s6(i.elementId,s,{direction:i.direction,durationMs:i.durationMs??500,timingCurve:i.timingCurve});},[]),r=Jm.useCallback(()=>a6(),[]),o=Jm.useCallback(()=>{if(!e)return;let i=e.entrance??e.emphasis??e.exit;!i||i==="none"||s6(t,i,{direction:e.direction,durationMs:e.durationMs??500,timingCurve:e.timingCurve});},[t,e]);return {handleAnimationHover:n,handleAnimationHoverEnd:r,handlePreviewClick:o}}function Ope({selectedElement:t,activeSlide:e,canEdit:n,onUpdateSlide:r}){let o=Jm.useMemo(()=>(e.animations??[]).find(E=>E.elementId===t.id),[e,t]),i=Jm.useMemo(()=>[...e.animations??[]].sort((E,R)=>(E.order??0)-(R.order??0)),[e.animations]),s=Jm.useCallback(E=>{if(!n)return;let R=e.animations??[];r({animations:E([...R])});},[n,e.animations,r]),a=Jm.useCallback((E,R)=>{s(I=>I.map(L=>L.elementId===t.id?{...L,[E]:R}:L));},[s,t.id]),l=Jm.useCallback((E,R,I)=>{n&&s(L=>{let k=L.findIndex(N=>N.elementId===t.id),F=E||R||I;if(k>=0){if(!F)return L.filter(N=>N.elementId!==t.id);L[k]={...L[k],entrance:E,exit:R,emphasis:I};}else F&&L.push({elementId:t.id,entrance:E,exit:R,emphasis:I,durationMs:500,order:L.length,trigger:"onClick"});return L});},[n,s,t.id]),c=Jm.useCallback(E=>{let R=E.target.value;l(R==="none"?void 0:R,o?.exit,o?.emphasis);},[l,o]),d=Jm.useCallback(E=>{let R=E.target.value;l(o?.entrance,R==="none"?void 0:R,o?.emphasis);},[l,o]),u=Jm.useCallback(E=>{let R=E.target.value;l(o?.entrance,o?.exit,R==="none"?void 0:R);},[l,o]),p=Jm.useCallback(E=>{let R=E.target.value;a("trigger",R),R!=="onShapeClick"&&a("triggerShapeId",void 0);},[a]),h=Jm.useCallback(E=>a("triggerShapeId",E.target.value||void 0),[a]),f=Jm.useCallback(E=>a("timingCurve",E.target.value),[a]),m=Jm.useCallback(E=>a("durationMs",Math.max(100,Math.min(1e4,Number(E.target.value)||450))),[a]),x=Jm.useCallback(E=>a("delayMs",Math.max(0,Math.min(1e4,Number(E.target.value)||0))),[a]),g=Jm.useCallback(E=>a("repeatCount",Math.max(1,Math.min(100,Number(E.target.value)||1))),[a]),y=Jm.useCallback(E=>{let R=E.target.value;a("repeatMode",R==="none"?void 0:R);},[a]),b=Jm.useCallback(E=>a("direction",E),[a]),v=Jm.useCallback(E=>a("sequence",E.target.value),[a]),S=Fpe({selectedElementId:t.id,selectedElementAnimation:o}),w=Dpe({canEdit:n,updateAnimations:s}),C=Jm.useCallback(E=>{let R=e.elements?.find(L=>L.id===E.elementId);return R?(ze(R)?R.text:void 0)||ii(R):E.elementId.slice(0,8)},[e.elements]),T=!!(o?.entrance||o?.exit||o?.emphasis),M=T&&(oT.has(o?.entrance??"")||oT.has(o?.exit??"")),_=Jm.useMemo(()=>{if(i.length===0)return [];let E=0,R=i.map(L=>{let k=L.delayMs??0,F=L.durationMs??500,N=k+F;return N>E&&(E=N),{anim:L,startMs:k,durationMs:F,endMs:N}}),I=Math.max(E,1);return R.map(L=>({anim:L.anim,leftPercent:L.startMs/I*100,widthPercent:L.durationMs/I*100}))},[i]);return {selectedElementAnimation:o,sortedAnimations:i,hasAnimation:T,showDirectionPicker:M,timelineBarData:_,handleEntranceChange:c,handleExitChange:d,handleEmphasisChange:u,handleTriggerChange:p,handleTriggerShapeChange:h,handleTimingCurveChange:f,handleDurationChange:m,handleDelayChange:x,handleRepeatCountChange:g,handleRepeatModeChange:y,handleDirectionChange:b,handleSequenceChange:v,getTimelineLabel:C,...S,...w}}function Bpe({selectedElement:t,activeSlide:e,canEdit:n,onUpdateSlide:r}){let{t:o}=reactI18next.useTranslation(),i=Ope({selectedElement:t,activeSlide:e,canEdit:n,onUpdateSlide:r}),{selectedElementAnimation:s,hasAnimation:a,showDirectionPicker:l,handleEntranceChange:c,handleExitChange:d,handleEmphasisChange:u,handleTriggerChange:p,handleTriggerShapeChange:h,handleTimingCurveChange:f,handleDurationChange:m,handleDelayChange:x,handleRepeatCountChange:g,handleRepeatModeChange:y,handleDirectionChange:b,handleSequenceChange:v,handlePreviewClick:S}=i;return jsxRuntime.jsxs("div",{className:"rounded border border-border bg-card p-2 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:o("pptx.animation.title")}),a&&jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[10px] text-primary hover:text-primary/80 transition-colors",onClick:S,title:o("pptx.animation.preview"),children:[jsxRuntime.jsx(lu$1.LuPlay,{className:"w-3 h-3"}),o("pptx.animation.preview")]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.entrance")}),jsxRuntime.jsxs("select",{value:s?.entrance??"none",onChange:c,disabled:!n,className:Gu,children:[jsxRuntime.jsx("option",{value:"none",children:o("pptx.animation.none")}),Cpe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(`pptx.animation.preset.${w.value}`)},w.value))]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.emphasis")}),jsxRuntime.jsxs("select",{value:s?.emphasis??"none",onChange:u,disabled:!n,className:Gu,children:[jsxRuntime.jsx("option",{value:"none",children:o("pptx.animation.none")}),_pe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(`pptx.animation.preset.${w.value}`)},w.value))]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.exit")}),jsxRuntime.jsxs("select",{value:s?.exit??"none",onChange:d,disabled:!n,className:Gu,children:[jsxRuntime.jsx("option",{value:"none",children:o("pptx.animation.none")}),Mpe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(`pptx.animation.preset.${w.value}`)},w.value))]})]}),a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l&&jsxRuntime.jsxs("div",{className:"pt-1 border-t border-border",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px] block mb-1",children:o("pptx.animation.direction")}),jsxRuntime.jsx("div",{className:"flex gap-1",children:Rpe.map(w=>{let C=w.icon,T=s?.direction===w.value;return jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie("flex items-center justify-center w-7 h-7 rounded border transition-colors",T?"border-primary bg-primary/20 text-primary":"border-border bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>b(w.value),title:o(w.labelKey),children:jsxRuntime.jsx(C,{className:"w-3.5 h-3.5"})},w.value)})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.sequence")}),jsxRuntime.jsx("select",{value:s?.sequence??"asOne",onChange:v,disabled:!n,className:Gu,children:kpe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(w.labelKey)},w.value))})]}),jsxRuntime.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground pt-1 border-t border-border",children:o("pptx.animation.timing")}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.trigger")}),jsxRuntime.jsx("select",{value:s?.trigger??"onClick",onChange:p,disabled:!n,className:Gu,children:Ppe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(w.labelKey)},w.value))})]}),s?.trigger==="onShapeClick"&&jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.trigger.shapeLabel")}),jsxRuntime.jsxs("select",{value:s?.triggerShapeId??"",onChange:h,disabled:!n,className:Gu,children:[jsxRuntime.jsx("option",{value:"",children:o("pptx.animation.trigger.selectShape")}),e.elements.filter(w=>w.id!==t.id).map(w=>jsxRuntime.jsx("option",{value:w.id,children:ii(w)},w.id))]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.duration")}),jsxRuntime.jsx("input",{type:"number",min:100,max:1e4,step:50,disabled:!n,value:s?.durationMs??450,onChange:m,className:DN})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.delay")}),jsxRuntime.jsx("input",{type:"number",min:0,max:1e4,step:50,disabled:!n,value:s?.delayMs??0,onChange:x,className:DN})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.timingCurve")}),jsxRuntime.jsx("select",{value:s?.timingCurve??"ease",onChange:f,disabled:!n,className:Gu,children:Epe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(w.labelKey)},w.value))})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.repeatCount")}),jsxRuntime.jsx("input",{type:"number",min:1,max:100,step:1,disabled:!n,value:s?.repeatCount??1,onChange:g,className:DN})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.repeatUntil")}),jsxRuntime.jsx("select",{value:s?.repeatMode??"none",onChange:y,disabled:!n,className:Gu,children:Ape.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(w.labelKey)},w.value))})]})]}),jsxRuntime.jsx(Npe,{selectedElementId:t.id,canEdit:n,handlers:i})]})}bt();bt();var Upe=[{key:"elements",label:"Elements",icon:lu$1.LuLayers},{key:"properties",label:"Properties",icon:lu$1.LuSettings2},{key:"comments",label:"Comments",icon:lu$1.LuMessageSquare}],Gt="text-[11px] uppercase tracking-wide text-muted-foreground",Zt="rounded border border-border bg-card p-2 space-y-2",an="flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",xr="rounded bg-muted hover:bg-accent px-2 py-1 text-[11px] transition-colors",$pe=[["X","x"],["Y","y"],["W","width"],["H","height"]];var Bst=[{value:"none",label:"None"},{value:"url",label:"Go to URL"},{value:"slide",label:"Go to Slide"},{value:"firstSlide",label:"First Slide"},{value:"lastSlide",label:"Last Slide"},{value:"prevSlide",label:"Previous Slide"},{value:"nextSlide",label:"Next Slide"},{value:"endShow",label:"End Show"}];function zpe({selectedElement:t,slides:e,canEdit:n,onUpdateElement:r}){let{t:o}=reactI18next.useTranslation(),i=t.actionClick?o_(t.actionClick,"click"):void 0,s=t.actionHover?o_(t.actionHover,"hover"):void 0,a=i?.type??"none",l=s?.type??"none",c=(d,u,p,h)=>{let m=aS({type:u,url:p,slideIndex:h});r(d==="click"?{actionClick:m}:{actionHover:m});};return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.action.title","Action")}),jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px]",children:[jsxRuntime.jsx(Hpe,{label:o("pptx.action.onClick","On Click"),trigger:"click",activeType:a,action:i,fallbackUrl:t.actionClick?.url,fallbackSlideIndex:t.actionClick?.targetSlideIndex,canEdit:n,slideCount:e.length,onChangeType:d=>c("click",d,i?.url,i?.slideIndex),onChangeUrl:d=>c("click","url",d),onChangeSlide:d=>c("click","slide",void 0,d)}),jsxRuntime.jsx(Hpe,{label:o("pptx.action.onHover","On Hover"),trigger:"hover",activeType:l,action:s,fallbackUrl:t.actionHover?.url,fallbackSlideIndex:t.actionHover?.targetSlideIndex,canEdit:n,slideCount:e.length,onChangeType:d=>c("hover",d,s?.url,s?.slideIndex),onChangeUrl:d=>c("hover","url",d),onChangeSlide:d=>c("hover","slide",void 0,d)})]})]})}function Hpe({label:t,activeType:e,action:n,fallbackUrl:r,fallbackSlideIndex:o,canEdit:i,slideCount:s,onChangeType:a,onChangeUrl:l,onChangeSlide:c}){return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground font-medium",children:t}),jsxRuntime.jsx("select",{disabled:!i,className:ie(an,"w-full"),value:e,onChange:d=>a(d.target.value),children:Bst.map(d=>jsxRuntime.jsx("option",{value:d.value,children:d.label},d.value))}),e==="url"&&jsxRuntime.jsx("input",{type:"text",disabled:!i,className:ie(an,"w-full"),placeholder:"https://...",value:n?.url??r??"",onChange:d=>l(d.target.value)}),e==="slide"&&jsxRuntime.jsx("input",{type:"number",disabled:!i,className:ie(an,"w-full"),placeholder:"Slide number (1-based)",min:1,max:s,value:(n?.slideIndex??o??0)+1,onChange:d=>{let u=Number(d.target.value);Number.isFinite(u)&&c(Math.max(0,u-1));}})]})}bt();var er="text-[11px] uppercase tracking-wide text-muted-foreground",tr="rounded border border-border bg-card p-2 space-y-2",Rn="flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",KV="rounded bg-muted hover:bg-accent px-2 py-1 text-[11px] transition-colors",FN="bg-muted border border-border rounded px-1 py-0.5 text-[11px] w-full text-center",Vpe=[{value:"bar",labelKey:"pptx.chart.typeBar"},{value:"line",labelKey:"pptx.chart.typeLine"},{value:"pie",labelKey:"pptx.chart.typePie"},{value:"doughnut",labelKey:"pptx.chart.typeDoughnut"},{value:"area",labelKey:"pptx.chart.typeArea"},{value:"scatter",labelKey:"pptx.chart.typeScatter"},{value:"bubble",labelKey:"pptx.chart.typeBubble"},{value:"radar",labelKey:"pptx.chart.typeRadar"},{value:"stock",labelKey:"pptx.chart.typeStock"},{value:"waterfall",labelKey:"pptx.chart.typeWaterfall"},{value:"combo",labelKey:"pptx.chart.typeCombo"}],Gpe=[{value:"clustered",labelKey:"pptx.chart.groupingClustered"},{value:"stacked",labelKey:"pptx.chart.groupingStacked"},{value:"percentStacked",labelKey:"pptx.chart.groupingPercentStacked"}],Wpe=[{value:"t",labelKey:"pptx.chart.legendTop"},{value:"b",labelKey:"pptx.chart.legendBottom"},{value:"l",labelKey:"pptx.chart.legendLeft"},{value:"r",labelKey:"pptx.chart.legendRight"}],Xpe=[{value:"nextTo",labelKey:"pptx.chart.tickNextTo"},{value:"high",labelKey:"pptx.chart.tickHigh"},{value:"low",labelKey:"pptx.chart.tickLow"},{value:"none",labelKey:"pptx.chart.tickNone"}],jpe=[{value:"",labelKey:"pptx.chart.unitsNone"},{value:"hundreds",labelKey:"pptx.chart.unitsHundreds"},{value:"thousands",labelKey:"pptx.chart.unitsThousands"},{value:"tenThousands",labelKey:"pptx.chart.unitsTenThousands"},{value:"hundredThousands",labelKey:"pptx.chart.unitsHundredThousands"},{value:"millions",labelKey:"pptx.chart.unitsMillions"},{value:"tenMillions",labelKey:"pptx.chart.unitsTenMillions"},{value:"hundredMillions",labelKey:"pptx.chart.unitsHundredMillions"},{value:"billions",labelKey:"pptx.chart.unitsBillions"},{value:"trillions",labelKey:"pptx.chart.unitsTrillions"}];var Ype=[{key:"showValue",labelKey:"pptx.chart.labelValue"},{key:"showCategory",labelKey:"pptx.chart.labelCategory"},{key:"showSeriesName",labelKey:"pptx.chart.labelSeriesName"},{key:"showPercent",labelKey:"pptx.chart.labelPercent"},{key:"showLegendKey",labelKey:"pptx.chart.labelLegendKey"}],Kpe=[{value:"",labelKey:"pptx.chart.labelPosDefault"},{value:"ctr",labelKey:"pptx.chart.labelPosCenter"},{value:"inEnd",labelKey:"pptx.chart.labelPosInsideEnd"},{value:"inBase",labelKey:"pptx.chart.labelPosInsideBase"},{value:"outEnd",labelKey:"pptx.chart.labelPosOutsideEnd"},{value:"bestFit",labelKey:"pptx.chart.labelPosBestFit"}],qpe=[{value:"",labelKey:"pptx.chart.trendlineNone"},{value:"linear",labelKey:"pptx.chart.trendlineLinear"},{value:"exponential",labelKey:"pptx.chart.trendlineExponential"},{value:"logarithmic",labelKey:"pptx.chart.trendlineLogarithmic"},{value:"polynomial",labelKey:"pptx.chart.trendlinePolynomial"},{value:"power",labelKey:"pptx.chart.trendlinePower"},{value:"movingAvg",labelKey:"pptx.chart.trendlineMovingAvg"}],Zpe=new Set(["bar","line","area","scatter","bubble"]),Jpe=[{value:"",labelKey:"pptx.chart.errorBarNone"},{value:"fixedVal",labelKey:"pptx.chart.errorBarFixed"},{value:"percentage",labelKey:"pptx.chart.errorBarPercentage"},{value:"stdDev",labelKey:"pptx.chart.errorBarStdDev"},{value:"stdErr",labelKey:"pptx.chart.errorBarStdErr"}],Qpe=[{value:"both",labelKey:"pptx.chart.errorBarBoth"},{value:"plus",labelKey:"pptx.chart.errorBarPlus"},{value:"minus",labelKey:"pptx.chart.errorBarMinus"}],ehe=new Set(["fixedVal","percentage","stdDev"]),the=new Set(["bar","line","area","scatter","bubble"]),nhe=new Set(["bar","line","area"]),ON=[{value:"",labelKey:"pptx.chart.markerAuto"},{value:"none",labelKey:"pptx.chart.markerNone"},{value:"circle",labelKey:"pptx.chart.markerCircle"},{value:"square",labelKey:"pptx.chart.markerSquare"},{value:"diamond",labelKey:"pptx.chart.markerDiamond"},{value:"triangle",labelKey:"pptx.chart.markerTriangle"},{value:"x",labelKey:"pptx.chart.markerX"},{value:"star",labelKey:"pptx.chart.markerStar"},{value:"plus",labelKey:"pptx.chart.markerPlus"},{value:"dot",labelKey:"pptx.chart.markerDot"},{value:"dash",labelKey:"pptx.chart.markerDash"}],BN=new Set(["line","scatter","bubble","radar"]),rhe=[{value:"",labelKey:"pptx.chart.dashDefault"},{value:"solid",labelKey:"pptx.chart.dashSolid"},{value:"dash",labelKey:"pptx.chart.dashDash"},{value:"dot",labelKey:"pptx.chart.dashDot"},{value:"dashDot",labelKey:"pptx.chart.dashDashDot"},{value:"lgDash",labelKey:"pptx.chart.dashLong"}],ohe=[{value:"",labelKey:"pptx.chart.comboDefault"},{value:"bar",labelKey:"pptx.chart.typeBar"},{value:"line",labelKey:"pptx.chart.typeLine"},{value:"area",labelKey:"pptx.chart.typeArea"},{value:"scatter",labelKey:"pptx.chart.typeScatter"}],ihe=new Set(["bar","line","area","combo"]),she=new Set(["pie","pie3D","doughnut","ofPie"]);var $st=[{type:"valAx",labelKey:"pptx.chart.valueAxis",hasScale:true},{type:"dateAx",labelKey:"pptx.chart.dateAxis",hasScale:true},{type:"catAx",labelKey:"pptx.chart.categoryAxis",hasScale:false}];function ahe({axes:t,canEdit:e,onUpdateAxis:n}){let{t:r}=reactI18next.useTranslation(),o=$st.map(s=>({...s,axis:t?.find(a=>a.axisType===s.type)})).filter(s=>!!s.axis);if(o.length===0)return null;let i=(s,a,l,c)=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r(a)}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:Rn,value:l??"",placeholder:r("pptx.chart.auto"),onChange:d=>{let u=d.target.value;if(u===""){n(s,{[c]:void 0});return}let p=Number.parseFloat(u);Number.isFinite(p)&&n(s,{[c]:p});}})]});return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:r("pptx.chart.axes")}),o.map(({type:s,labelKey:a,hasScale:l,axis:c})=>jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-[11px] font-medium",children:r(a)}),l&&jsxRuntime.jsxs("div",{className:"space-y-1.5 ml-2",children:[i(s,"pptx.chart.min",c.min,"min"),i(s,"pptx.chart.max",c.max,"max"),i(s,"pptx.chart.majorUnit",c.majorUnit,"majorUnit"),i(s,"pptx.chart.minorUnit",c.minorUnit,"minorUnit"),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.displayUnits")}),jsxRuntime.jsx("select",{disabled:!e,className:Rn,value:c.displayUnits??"",onChange:d=>n(s,{displayUnits:d.target.value||void 0}),children:jpe.map(d=>jsxRuntime.jsx("option",{value:d.value,children:r(d.labelKey)},d.value))})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5 ml-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.axisTitle")}),jsxRuntime.jsx("input",{type:"text",disabled:!e,className:Rn,value:c.titleText??"",placeholder:r("pptx.chart.axisTitlePlaceholder"),onChange:d=>n(s,{titleText:d.target.value})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.numberFormat")}),jsxRuntime.jsx("input",{type:"text",disabled:!e,className:Rn,value:c.numFmt?.formatCode??"",placeholder:"General",onChange:d=>n(s,{numFmt:d.target.value?{formatCode:d.target.value,sourceLinked:false}:void 0})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.tickLabels")}),jsxRuntime.jsx("select",{disabled:!e,className:Rn,value:c.tickLblPos??"nextTo",onChange:d=>n(s,{tickLblPos:d.target.value}),children:Xpe.map(d=>jsxRuntime.jsx("option",{value:d.value,children:r(d.labelKey)},d.value))})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:c.majorGridlines??false,onChange:d=>n(s,{majorGridlines:d.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.majorGridlines")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:c.minorGridlines??false,onChange:d=>n(s,{minorGridlines:d.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.minorGridlines")})]})]})]},s))]})}var zst=[{type:"valAx",labelKey:"pptx.chart.valueAxis"},{type:"dateAx",labelKey:"pptx.chart.dateAxis"},{type:"catAx",labelKey:"pptx.chart.categoryAxis"}];function lhe({axes:t,canEdit:e,onSetLogScale:n,onSetTitleStyle:r,onSetGridlineStyle:o}){let{t:i}=reactI18next.useTranslation(),s=zst.map(a=>({...a,axis:t?.find(l=>l.axisType===a.type)})).filter(a=>!!a.axis);return s.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:i("pptx.chart.axisStyling")}),s.map(({type:a,labelKey:l,axis:c})=>{let d=a==="valAx"||a==="dateAx";return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-[11px] font-medium",children:i(l)}),jsxRuntime.jsxs("div",{className:"space-y-1.5 ml-2",children:[d&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:c.logScale??false,onChange:u=>n(a,{enabled:u.target.checked,base:c.logBase}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:i("pptx.chart.logScale")})]}),c.logScale&&jsxRuntime.jsx("input",{type:"number",min:2,disabled:!e,title:i("pptx.chart.logBase"),className:"w-16 bg-muted border border-border rounded px-1.5 py-0.5 text-[11px]",value:c.logBase??10,onChange:u=>{let p=Number.parseFloat(u.target.value);Number.isFinite(p)&&p>1&&n(a,{enabled:true,base:p});}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:i("pptx.chart.titleFont")}),jsxRuntime.jsx("input",{type:"text",disabled:!e,className:Rn,placeholder:i("pptx.chart.auto"),value:c.fontFamily??"",onChange:u=>r(a,{fontFamily:u.target.value||null})}),jsxRuntime.jsx("input",{type:"number",min:4,max:96,disabled:!e,title:i("pptx.chart.fontSize"),className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5",value:c.fontSize??"",placeholder:i("pptx.chart.auto"),onChange:u=>{let p=u.target.value,h=Number.parseFloat(p);r(a,{fontSize:Number.isFinite(h)?h:null});}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:c.fontBold??false,onChange:u=>r(a,{fontBold:u.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:i("pptx.chart.bold")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i("pptx.chart.titleColor")}),jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:c.fontColor??"#000000",onChange:u=>r(a,{fontColor:u.target.value})})]})]}),["major","minor"].map(u=>{let p=u==="major"?c.majorGridlinesSpPr:c.minorGridlinesSpPr;return (u==="major"?c.majorGridlines:c.minorGridlines)?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:i(u==="major"?"pptx.chart.majorGridlines":"pptx.chart.minorGridlines")}),jsxRuntime.jsx("input",{type:"color",disabled:!e,title:i("pptx.chart.gridlineColor"),className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:p?.strokeColor??"#d9d9d9",onChange:f=>o(a,u,{color:f.target.value})}),jsxRuntime.jsx("input",{type:"number",min:.25,step:.25,disabled:!e,title:i("pptx.chart.gridlineWidth"),className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5",value:p?.strokeWidth??"",placeholder:i("pptx.chart.auto"),onChange:f=>{let m=Number.parseFloat(f.target.value);o(a,u,{width:Number.isFinite(m)?m:null});}}),jsxRuntime.jsx("select",{disabled:!e,title:i("pptx.chart.gridlineDash"),className:Rn,value:p?.strokeDashStyle??"",onChange:f=>o(a,u,{dashStyle:f.target.value||null}),children:rhe.map(f=>jsxRuntime.jsx("option",{value:f.value,children:i(f.labelKey)},f.value))})]},u):null})]})]},a)})]})}function dhe({chartType:t,series:e,canEdit:n,onSetSeriesType:r}){let{t:o}=reactI18next.useTranslation();return !ihe.has(t)||e.length<2?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:o("pptx.chart.comboTypes")}),jsxRuntime.jsx("div",{className:"space-y-1.5",children:e.map((i,s)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:i.name,children:i.name}),jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:i.seriesChartType??"",onChange:a=>{let l=a.target.value;r(s,l===""?null:l);},children:ohe.map(a=>jsxRuntime.jsx("option",{value:a.value,children:o(a.labelKey)},a.value))})]},`${i.name}-${s}`))})]})}function hhe({series:t,categories:e,canEdit:n,onUpdateSeries:r,onUpdateCategoryLabel:o,onUpdateValue:i,onAddCategory:s,onRemoveCategory:a,onAddSeries:l,onRemoveSeries:c}){let{t:d}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:er,children:d("pptx.chart.data")}),n&&jsxRuntime.jsxs("div",{className:"flex gap-1",children:[jsxRuntime.jsxs("button",{type:"button",className:KV,title:d("pptx.chart.addCategory"),onClick:s,children:[jsxRuntime.jsx(lu$1.LuPlus,{className:"inline w-3 h-3 mr-0.5"}),d("pptx.chart.cat")]}),jsxRuntime.jsxs("button",{type:"button",className:KV,title:d("pptx.chart.addSeries"),onClick:l,children:[jsxRuntime.jsx(lu$1.LuPlus,{className:"inline w-3 h-3 mr-0.5"}),d("pptx.chart.seriesShort")]})]})]}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"w-full text-[11px] border-collapse",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{"aria-label":"Categories",className:"text-muted-foreground p-0.5 text-left min-w-[60px]"}),t.map((u,p)=>jsxRuntime.jsx("th",{className:"p-0.5 font-normal min-w-[72px]",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("input",{type:"text",disabled:!n,className:FN,value:u.name,onChange:h=>r(p,{name:h.target.value})}),n&&t.length>1&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-red-400 shrink-0",title:d("pptx.chart.removeSeries"),onClick:()=>c(p),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"})})]})},p))]})}),jsxRuntime.jsx("tbody",{children:e.map((u,p)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"p-0.5",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("input",{type:"text",disabled:!n,className:FN,value:u,onChange:h=>o(p,h.target.value)}),n&&e.length>1&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-red-400 shrink-0",title:d("pptx.chart.removeCategory"),onClick:()=>a(p),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"})})]})}),t.map((h,f)=>jsxRuntime.jsx("td",{className:"p-0.5",children:jsxRuntime.jsx("input",{type:"number","aria-label":`${h.name} value ${p+1}`,disabled:!n,className:FN,value:h.values[p]??0,onChange:m=>i(f,p,m.target.value)})},f))]},p))})]})})]})}function fhe({style:t,canEdit:e,onUpdateStyle:n}){let{t:r}=reactI18next.useTranslation();if(!t?.hasDataLabels)return null;let o=t.dataLabels??{},i=s=>n({dataLabels:{...o,...s}});return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:r("pptx.chart.dataLabels")}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[Ype.map(s=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:o[s.key]??false,onChange:a=>i({[s.key]:a.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r(s.labelKey)})]},s.key)),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.labelPosition")}),jsxRuntime.jsx("select",{disabled:!e,className:Rn,value:o.position??"",onChange:s=>i({position:s.target.value||void 0}),children:Kpe.map(s=>jsxRuntime.jsx("option",{value:s.value,children:r(s.labelKey)},s.value))})]})]})]})}var Yst=ON.filter(t=>t.value!=="");function mhe({chartType:t,categories:e,series:n,canEdit:r,onSetPointMarker:o}){let{t:i}=reactI18next.useTranslation(),[s,a]=Jm.useState(0);if(!BN.has(t)||n.length===0||e.length===0)return null;let l=n[Math.min(s,n.length-1)],c=d=>l.dataPoints?.find(u=>u.idx===d);return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:i("pptx.chart.pointMarkers")}),n.length>1&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:i("pptx.chart.series")}),jsxRuntime.jsx("select",{disabled:!r,className:"flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",value:Math.min(s,n.length-1),onChange:d=>a(Number.parseInt(d.target.value,10)),children:n.map((d,u)=>jsxRuntime.jsx("option",{value:u,children:d.name},`${d.name}-${u}`))})]}),jsxRuntime.jsx("div",{className:"space-y-2",children:e.map((d,u)=>{let p=c(u),h=p?.marker!==void 0;return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:d,children:d}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1 shrink-0",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!r,checked:h,onChange:f=>{o(s,u,f.target.checked?{symbol:"circle"}:null);}}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i("pptx.chart.markerOverride")})]})]}),h&&p?.marker&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 ml-2 flex-wrap",children:[jsxRuntime.jsx("select",{disabled:!r,className:"bg-muted border border-border rounded px-1.5 py-0.5 text-[11px]",value:p.marker.symbol,onChange:f=>o(s,u,{symbol:f.target.value}),children:Yst.map(f=>jsxRuntime.jsx("option",{value:f.value,children:i(f.labelKey)},f.value))}),jsxRuntime.jsx("input",{type:"number",min:1,max:20,disabled:!r,title:i("pptx.chart.markerSize"),className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5 text-[11px]",value:p.marker.size??"",placeholder:i("pptx.chart.auto"),onChange:f=>{let m=Number.parseInt(f.target.value,10);o(s,u,{size:Number.isFinite(m)?m:void 0});}}),jsxRuntime.jsx("input",{type:"color",disabled:!r,title:i("pptx.chart.markerFill"),className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:p.marker.spPr?.fillColor??"#4472c4",onChange:f=>o(s,u,{fillColor:f.target.value})})]})]},`${d}-${u}`)})})]})}function ghe({chartType:t,categories:e,series:n,canEdit:r,onSetPointFill:o,onSetPointExplosion:i,onSetPointLabel:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState(0);if(n.length===0||e.length===0)return null;let d=n[Math.min(l,n.length-1)],u=she.has(t),p=h=>d.dataPoints?.find(f=>f.idx===h);return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:a("pptx.chart.dataPoints")}),n.length>1&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:a("pptx.chart.series")}),jsxRuntime.jsx("select",{disabled:!r,className:Rn,value:Math.min(l,n.length-1),onChange:h=>c(Number.parseInt(h.target.value,10)),children:n.map((h,f)=>jsxRuntime.jsx("option",{value:f,children:h.name},`${h.name}-${f}`))})]}),jsxRuntime.jsx("div",{className:"space-y-1.5",children:e.map((h,f)=>{let m=p(f);return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:h,children:h}),jsxRuntime.jsx("input",{type:"text",disabled:!r,title:a("pptx.chart.pointLabelOverride"),className:"w-20 bg-muted border border-border rounded px-1.5 py-0.5 text-[11px]",value:d.dataLabels?.find(x=>x.idx===f)?.text??"",placeholder:a("pptx.chart.auto"),onChange:x=>{let g=x.target.value;s(l,f,g===""?null:g);}}),jsxRuntime.jsx("input",{type:"color",disabled:!r,title:a("pptx.chart.pointFill"),className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:m?.spPr?.fillColor??d.color??"#4472c4",onChange:x=>o(l,f,x.target.value)}),m?.spPr?.fillColor&&jsxRuntime.jsx("button",{type:"button",disabled:!r,title:a("pptx.chart.pointFillClear"),className:"text-muted-foreground hover:text-foreground",onClick:()=>o(l,f,null),children:"\xD7"}),u&&jsxRuntime.jsx("input",{type:"number",min:0,max:100,disabled:!r,title:a("pptx.chart.pointExplosion"),className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5",value:m?.explosion??"",placeholder:"0",onChange:x=>{let g=x.target.value;if(g===""){i(l,f,null);return}let y=Number.parseInt(g,10);Number.isFinite(y)&&i(l,f,y);}})]},`${h}-${f}`)})})]})}function xhe({style:t,canEdit:e,onUpdateStyle:n}){let{t:r}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:r("pptx.chart.display")}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:t?.hasTitle??false,onChange:o=>n({hasTitle:o.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.showTitle")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:t?.hasLegend??false,onChange:o=>n({hasLegend:o.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.showLegend")})]}),t?.hasLegend&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px] ml-4",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:r("pptx.chart.legendPosition")}),jsxRuntime.jsx("select",{disabled:!e,className:Rn,value:t.legendPosition??"b",onChange:o=>n({legendPosition:o.target.value}),children:Wpe.map(o=>jsxRuntime.jsx("option",{value:o.value,children:r(o.labelKey)},o.value))})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:t?.hasGridlines??false,onChange:o=>n({hasGridlines:o.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.showGridlines")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:t?.hasDataLabels??false,onChange:o=>n({hasDataLabels:o.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.showDataLabels")})]})]})]})}function yhe({chartType:t,series:e,canEdit:n,onSetErrorBars:r}){let{t:o}=reactI18next.useTranslation();return !the.has(t)||e.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:o("pptx.chart.errorBars")}),jsxRuntime.jsx("div",{className:"space-y-2",children:e.map((i,s)=>{let a=i.errBars?.[0],l=a?.valType??"",c=ehe.has(l);return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:i.name,children:i.name}),jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:l,onChange:d=>{let u=d.target.value;if(!u){r(s,null);return}r(s,{direction:a?.direction??"y",barType:a?.barType??"both",valType:u,val:a?.val});},children:Jpe.map(d=>jsxRuntime.jsx("option",{value:d.value,children:o(d.labelKey)},d.value))})]}),a&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:a.barType,onChange:d=>r(s,{...a,barType:d.target.value}),children:Qpe.map(d=>jsxRuntime.jsx("option",{value:d.value,children:o(d.labelKey)},d.value))}),c&&jsxRuntime.jsx("input",{type:"number",disabled:!n,className:Rn,value:a.val??"",placeholder:o("pptx.chart.errorBarAmount"),onChange:d=>{let u=d.target.value,p=u===""?void 0:Number.parseFloat(u);u!==""&&!Number.isFinite(p)||r(s,{...a,val:p});}})]})]},`${i.name}-${s}`)})})]})}function bhe({chartType:t,series:e,canEdit:n,onSetMarker:r}){let{t:o}=reactI18next.useTranslation();return !BN.has(t)||e.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:o("pptx.chart.markers")}),jsxRuntime.jsx("div",{className:"space-y-2",children:e.map((i,s)=>{let a=i.marker;return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:i.name,children:i.name}),jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:a?.symbol??"",onChange:l=>{let c=l.target.value;if(c===""){r(s,null);return}r(s,{symbol:c});},children:ON.map(l=>jsxRuntime.jsx("option",{value:l.value,children:o(l.labelKey)},l.value))})]}),a&&a.symbol!=="none"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3 ml-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.chart.markerSize")}),jsxRuntime.jsx("input",{type:"number",min:2,max:72,disabled:!n,className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5",value:a.size??"",placeholder:o("pptx.chart.auto"),onChange:l=>{let c=l.target.value,d=Number.parseInt(c,10);r(s,{size:Number.isFinite(d)?d:void 0});}})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.chart.markerFill")}),jsxRuntime.jsx("input",{type:"color",disabled:!n,className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:a.spPr?.fillColor??"#4472c4",onChange:l=>r(s,{fillColor:l.target.value})})]})]})]},`${i.name}-${s}`)})})]})}function Lo({value:t,disabled:e,className:n,ariaLabel:r,onCommit:o}){let[i,s]=Jm.useState(t),a=Jm.useRef(o);a.current=o,Jm.useEffect(()=>{s(t);},[t]);let l=Jm.useCallback(c=>{let d=c.target.value;s(d),a.current(d);},[]);return jsxRuntime.jsx("input",{type:"color","aria-label":r??"Color",disabled:e,value:i,className:n,onChange:l})}var aat="#4472c4";function She({series:t,canEdit:e,onSetColor:n}){let{t:r}=reactI18next.useTranslation();return t.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:r("pptx.chart.seriesColors")}),jsxRuntime.jsx("div",{className:"space-y-1",children:t.map((o,i)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:o.name,children:o.name}),jsxRuntime.jsx(Lo,{value:o.color??aat,disabled:!e,ariaLabel:r("pptx.chart.seriesColor",{name:o.name}),className:"h-6 w-8 cursor-pointer rounded border border-border bg-muted p-0",onCommit:s=>n(i,s)}),e&&o.color&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-red-400 shrink-0",title:r("pptx.chart.clearSeriesColor"),onClick:()=>n(i,null),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-3 h-3"})})]},`${o.name}-${i}`))})]})}function whe({chartType:t,series:e,canEdit:n,onSetTrendline:r}){let{t:o}=reactI18next.useTranslation();return !Zpe.has(t)||e.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:o("pptx.chart.trendlines")}),jsxRuntime.jsx("div",{className:"space-y-2",children:e.map((i,s)=>{let a=i.trendlines?.[0];return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:i.name,children:i.name}),jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:a?.trendlineType??"",onChange:l=>{let c=l.target.value;if(!c){r(s,null);return}r(s,{...a,trendlineType:c});},children:qpe.map(l=>jsxRuntime.jsx("option",{value:l.value,children:o(l.labelKey)},l.value))})]}),a&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3 ml-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1 text-[11px] cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!n,checked:a.displayEq??false,onChange:l=>r(s,{...a,displayEq:l.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:o("pptx.chart.trendlineEquation")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1 text-[11px] cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!n,checked:a.displayRSq??false,onChange:l=>r(s,{...a,displayRSq:l.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:o("pptx.chart.trendlineRSquared")})]})]})]},`${i.name}-${s}`)})})]})}function The({title:t,chartType:e,grouping:n,seriesCount:r,categoryCount:o,canEdit:i,onUpdateChartData:s}){let{t:a}=reactI18next.useTranslation(),l=nhe.has(e);return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:a("pptx.chart.heading")}),jsxRuntime.jsxs("div",{className:"text-[11px] text-muted-foreground mb-1",children:[r," ",a("pptx.chart.series")," \xB7 ",o," ",a("pptx.chart.categories")]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-10 text-muted-foreground shrink-0",children:a("pptx.chart.title")}),jsxRuntime.jsx("input",{type:"text",disabled:!i,className:Rn,value:t??"",onChange:c=>s({title:c.target.value})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-10 text-muted-foreground shrink-0",children:a("pptx.chart.type")}),jsxRuntime.jsx("select",{disabled:!i,className:Rn,value:e,onChange:c=>s({chartType:c.target.value}),children:Vpe.map(c=>jsxRuntime.jsx("option",{value:c.value,children:a(c.labelKey)},c.value))})]}),l&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-10 text-muted-foreground shrink-0",children:a("pptx.chart.grouping")}),jsxRuntime.jsx("select",{disabled:!i,className:Rn,value:n??"clustered",onChange:c=>s({grouping:c.target.value}),children:Gpe.map(c=>jsxRuntime.jsx("option",{value:c.value,children:a(c.labelKey)},c.value))})]})]})}function Che({selectedElement:t,canEdit:e,onUpdateElement:n}){let r=t.chartData,o=r?.title,i=r?.chartType,s=r?.categories,a=r?.series,l=r?.style,c=r?.grouping,d=Jm.useCallback(D=>{n({chartData:D});},[n]),u=Jm.useCallback(D=>{if(r){if(D.chartType&&D.chartType!==r.chartType){let U=XD(r,D.chartType),{chartType:G,...j}=D;d({...U,...j});return}n({chartData:{...r,...D}});}},[r,n,d]),p=Jm.useCallback(D=>{r&&n({chartData:{...r,style:{...l,...D}}});},[r,l,n]),h=Jm.useCallback((D,U)=>{if(!r)return;let G=r.axes?[...r.axes]:[],j=G.findIndex(Y=>Y.axisType===D);j===-1?G.push({axisType:D,...U}):G[j]={...G[j],...U},u({axes:G});},[r,u]),f=Jm.useCallback((D,U)=>{if(!a)return;let G=a.map((j,Y)=>Y===D?{...j,...U}:j);u({series:G});},[a,u]),m=Jm.useCallback((D,U)=>{if(!a)return;let G=a.map((j,Y)=>Y===D?{...j,trendlines:U?[U]:[]}:j);u({series:G});},[a,u]),x=Jm.useCallback((D,U)=>{if(!a)return;let G=a.map((j,Y)=>Y===D?{...j,errBars:U?[U]:[]}:j);u({series:G});},[a,u]),g=Jm.useCallback((D,U)=>{f(D,{color:U??void 0});},[f]),y=Jm.useCallback((D,U)=>{if(!s)return;let G=s.map((j,Y)=>Y===D?U:j);u({categories:G});},[s,u]),b=Jm.useCallback((D,U,G)=>{if(!r)return;let j=Number.parseFloat(G);Number.isFinite(j)&&d(WD(r,D,U,j));},[r,d]),v=Jm.useCallback(()=>{!r||!s||d(jD(r,`Cat ${s.length+1}`));},[r,s,d]),S=Jm.useCallback(D=>{!r||!s||s.length<=1||d(YD(r,D));},[r,s,d]),w=Jm.useCallback(()=>{!r||!s||!a||d(VD(r,{name:`Series ${a.length+1}`,values:s.map(()=>0)}));},[r,s,a,d]),C=Jm.useCallback(D=>{!r||!a||a.length<=1||d(GD(r,D));},[r,a,d]),T=Jm.useCallback(D=>{if(!r)return;let U={...t,chartData:structuredClone(r)};D(U),d(U.chartData);},[r,t,d]),M=Jm.useCallback((D,U)=>T(G=>I3(G,D,U)),[T]),_=Jm.useCallback((D,U)=>T(G=>N3(G,D,U)),[T]),E=Jm.useCallback((D,U,G)=>T(j=>L3(j,D,U,G)),[T]),R=Jm.useCallback((D,U)=>T(G=>D3(G,D,U)),[T]),I=Jm.useCallback((D,U)=>T(G=>F3(G,D,U)),[T]),L=Jm.useCallback((D,U,G)=>T(j=>B3(j,D,U,G)),[T]),k=Jm.useCallback((D,U,G)=>T(j=>U3(j,D,U,G)),[T]),F=Jm.useCallback((D,U,G)=>T(j=>$3(j,D,U,G)),[T]),N=Jm.useCallback((D,U,G)=>T(j=>H3(j,D,U,G!==null?{text:G}:null)),[T]);return !r||!s||!a?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(The,{title:o,chartType:i,grouping:c,seriesCount:a.length,categoryCount:s.length,canEdit:e,onUpdateChartData:u}),jsxRuntime.jsx(xhe,{style:l,canEdit:e,onUpdateStyle:p}),jsxRuntime.jsx(fhe,{style:l,canEdit:e,onUpdateStyle:p}),jsxRuntime.jsx(ahe,{axes:r.axes,canEdit:e,onUpdateAxis:h}),jsxRuntime.jsx(lhe,{axes:r.axes,canEdit:e,onSetLogScale:M,onSetTitleStyle:_,onSetGridlineStyle:E}),jsxRuntime.jsx(bhe,{chartType:i,series:a,canEdit:e,onSetMarker:R}),jsxRuntime.jsx(dhe,{chartType:i,series:a,canEdit:e,onSetSeriesType:I}),jsxRuntime.jsx(ghe,{chartType:i,categories:s,series:a,canEdit:e,onSetPointFill:L,onSetPointExplosion:k,onSetPointLabel:N}),jsxRuntime.jsx(mhe,{chartType:i,categories:s,series:a,canEdit:e,onSetPointMarker:F}),jsxRuntime.jsx(whe,{chartType:i,series:a,canEdit:e,onSetTrendline:m}),jsxRuntime.jsx(yhe,{chartType:i,series:a,canEdit:e,onSetErrorBars:x}),jsxRuntime.jsx(She,{series:a,canEdit:e,onSetColor:g}),jsxRuntime.jsx(hhe,{categories:s,series:a,canEdit:e,onUpdateSeries:f,onUpdateCategoryLabel:y,onUpdateValue:b,onAddCategory:v,onRemoveCategory:S,onAddSeries:w,onRemoveSeries:C})]})}bt();function Mhe({selectedElement:t,canEdit:e,onUpdateElementStyle:n}){return t.type!=="connector"?null:jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Connector"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[["Start","connectorStartArrow"],["End","connectorEndArrow"]].map(([r,o])=>jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsxs("span",{className:"text-muted-foreground",children:[r," Arrow"]}),jsxRuntime.jsxs("select",{disabled:!e,className:ie(an,"w-full"),value:t.shapeStyle?.[o]??"none",onChange:i=>n({[o]:i.target.value}),children:[jsxRuntime.jsx("option",{value:"none",children:"None"}),jsxRuntime.jsx("option",{value:"triangle",children:"Triangle"}),jsxRuntime.jsx("option",{value:"arrow",children:"Arrow"}),jsxRuntime.jsx("option",{value:"stealth",children:"Stealth"}),jsxRuntime.jsx("option",{value:"diamond",children:"Diamond"}),jsxRuntime.jsx("option",{value:"oval",children:"Oval"})]})]},o))})]})}function _he({selectedElement:t}){if(t.type!=="group")return null;let e=t;return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Group"}),jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground",children:Array.isArray(e.children)?`${e.children.length} children`:"Grouped element"})]})}function Phe({selectedElement:t}){let{t:e}=reactI18next.useTranslation();if(t.type!=="ole")return null;let n=t;return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:e("pptx.ole.title")}),jsxRuntime.jsxs("div",{className:"space-y-1.5 text-[11px]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:e("pptx.ole.type")}),jsxRuntime.jsx("span",{className:"text-foreground truncate",children:bD(n.oleObjectType)})]}),n.fileName&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:e("pptx.ole.fileName")}),jsxRuntime.jsx("span",{className:"text-foreground truncate",title:n.fileName,children:n.fileName})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:e("pptx.ole.linkStatus")}),jsxRuntime.jsx("span",{className:ie("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",n.isLinked?"bg-blue-500/20 text-blue-400":"bg-green-500/20 text-green-400"),children:n.isLinked?e("pptx.ole.linked"):e("pptx.ole.embedded")})]})]})]})}function Ehe({selectedElement:t,canEdit:e,onUpdateElement:n}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Transform"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Rotation (\xB0)"}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:an,value:Math.round(t.rotation||0),onChange:r=>n({rotation:Number(r.target.value)})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Opacity"}),jsxRuntime.jsx("input",{type:"range",disabled:!e,min:0,max:100,value:Math.round((t.opacity??1)*100),className:"accent-primary",onChange:r=>n({opacity:Number(r.target.value)/100})})]})]})]})}function Ahe({canEdit:t,onMoveLayer:e}){return jsxRuntime.jsxs("div",{className:"flex gap-1",children:[jsxRuntime.jsx("button",{type:"button",className:ie("flex-1",xr),disabled:!t,onClick:()=>e("forward"),children:"\u2191 Forward"}),jsxRuntime.jsx("button",{type:"button",className:ie("flex-1",xr),disabled:!t,onClick:()=>e("backward"),children:"\u2193 Backward"})]})}Pe();function khe({imgSrc:t,fx:e,canEdit:n,updateEffects:r}){let{t:o}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.image.artisticEffects")}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-1",children:tre.map(([i,s,a])=>{let l=i==="none"?!e?.artisticEffect:e?.artisticEffect===i;return jsxRuntime.jsxs("button",{type:"button",disabled:!n,className:ie("flex flex-col items-center gap-0.5 rounded border p-0.5 hover:bg-accent/50",l?"border-primary bg-primary/10":"border-border"),title:o(s),onClick:()=>r({artisticEffect:i==="none"?void 0:i,...i==="grayscale"?{grayscale:void 0}:{}}),children:[jsxRuntime.jsx("div",{className:"w-10 h-7 rounded overflow-hidden bg-muted",style:{backgroundImage:t?`url(${t})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:a||void 0}}),jsxRuntime.jsx("span",{className:"text-[8px] text-muted-foreground truncate w-full text-center",children:o(s)})]},i)})})]})}function Ihe({fx:t,canEdit:e,updateEffects:n}){let{t:r}=reactI18next.useTranslation(),o=t?.clrChange;return jsxRuntime.jsxs("div",{className:"space-y-1 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorChange")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!o,onChange:i=>n({clrChange:i.target.checked?{clrFrom:"#ffffff",clrTo:"#000000",clrToTransparent:false}:void 0})})]}),o&&jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorChangeFrom")}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(o.clrFrom,"#ffffff"),className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:i=>n({clrChange:{...o,clrFrom:i,clrTo:o.clrTo??"#000000"}})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorChangeTo")}),jsxRuntime.jsx(Lo,{disabled:!e||!!o.clrToTransparent,value:et(o.clrTo,"#000000"),className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:i=>n({clrChange:{...o,clrFrom:o.clrFrom??"#ffffff",clrTo:i}})})]}),jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2 col-span-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorChangeTransparent")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!o.clrToTransparent,onChange:i=>n({clrChange:{clrFrom:o.clrFrom??"#ffffff",clrTo:o.clrTo??"#000000",clrToTransparent:i.target.checked}})})]})]})]})}function Nhe({fx:t,canEdit:e,updateEffects:n}){let{t:r}=reactI18next.useTranslation(),o=t?.colorWash;return jsxRuntime.jsxs("div",{className:"space-y-1 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorWash")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!o,onChange:i=>n({colorWash:i.target.checked?{color:"#0066cc",opacity:40}:void 0})})]}),o&&jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.washColor")}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(o.color,"#0066cc"),className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:i=>n({colorWash:{color:i,opacity:o.opacity??40}})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.washOpacity")}),jsxRuntime.jsx("input",{type:"range",min:0,max:100,disabled:!e,className:"accent-primary",value:o.opacity,onChange:i=>n({colorWash:{color:o.color??"#0066cc",opacity:Number(i.target.value)}})})]})]})]})}function Fhe({value:t,disabled:e,className:n,onCommit:r}){let[o,i]=Jm.useState(t),s=Jm.useRef(r);s.current=r,Jm.useEffect(()=>{i(t);},[t]);let a=Jm.useCallback(d=>{i(d.target.value);},[]),l=Jm.useCallback(()=>{s.current(o);},[o]),c=Jm.useRef(null);return Jm.useEffect(()=>{let d=c.current;if(!d)return;let u=()=>{s.current(d.value);};return d.addEventListener("change",u),()=>d.removeEventListener("change",u)},[]),jsxRuntime.jsx("input",{ref:c,type:"color",disabled:e,className:n,value:o,onChange:a,onBlur:l})}function Ohe({selectedElement:t,canEdit:e,onUpdateElement:n}){let{t:r}=reactI18next.useTranslation(),o="imageEffects"in t?t.imageEffects:void 0,i=Jm.useCallback((c,d)=>{n({imageEffects:{...o,duotone:{color1:c,color2:d}}});},[o,n]),s=Jm.useCallback(()=>{n({imageEffects:{...o,duotone:void 0}});},[o,n]),a=et(o?.duotone?.color1,"#000000"),l=et(o?.duotone?.color2,"#ffffff");return jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px]",children:[jsxRuntime.jsx("div",{className:"text-muted-foreground font-medium",children:r("pptx.image.duotone")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.duotoneShadows")}),jsxRuntime.jsx(Fhe,{disabled:!e,value:a,className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:c=>i(c,l)})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.duotoneHighlights")}),jsxRuntime.jsx(Fhe,{disabled:!e,value:l,className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:c=>i(a,c)})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"text-muted-foreground text-[10px]",children:r("pptx.image.duotonePresets")}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-1",children:$U.map(c=>jsxRuntime.jsxs("button",{type:"button",disabled:!e,className:"flex flex-col items-center gap-0.5 rounded border border-border hover:bg-accent p-1 transition-colors",title:r(c.labelKey),onClick:()=>i(c.shadow,c.highlight),children:[jsxRuntime.jsxs("div",{className:"flex h-4 w-full rounded overflow-hidden",children:[jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:c.shadow}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:c.highlight}})]}),jsxRuntime.jsx("span",{className:"text-[8px] text-muted-foreground truncate w-full text-center",children:r(c.labelKey)})]},c.labelKey))})]}),o?.duotone&&jsxRuntime.jsx("button",{type:"button",disabled:!e,className:"w-full rounded bg-muted hover:bg-accent border border-border px-2 py-1 text-foreground transition-colors",onClick:s,children:r("pptx.image.duotoneClear")})]})}function Bhe({selectedElement:t,canEdit:e,onUpdateElement:n}){let{t:r}=reactI18next.useTranslation(),o=Jm.useMemo(()=>"imageEffects"in t?t.imageEffects:void 0,[t]),s=100-(o?.alphaModFix??100),a=o?.biLevel??0,l=o?.alphaModFix!==void 0||o?.biLevel!==void 0,c=Jm.useCallback(h=>{n({imageEffects:{...o,...h}});},[o,n]),d=Jm.useCallback(h=>{let f=Number(h.target.value);c({alphaModFix:100-f});},[c]),u=Jm.useCallback(h=>{c({biLevel:Number(h.target.value)});},[c]),p=Jm.useCallback(()=>{c({alphaModFix:void 0,biLevel:void 0});},[c]);return jsxRuntime.jsxs("div",{className:"space-y-3 text-[11px]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground font-medium",children:r("pptx.imageAdjustments.title")}),l&&jsxRuntime.jsx("button",{type:"button",disabled:!e,className:"rounded bg-muted hover:bg-accent border border-border px-1.5 py-0.5 text-[10px] text-foreground disabled:opacity-50",onClick:p,children:r("common.reset")})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.imageAdjustments.transparency")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"range",min:0,max:100,step:1,disabled:!e,className:"accent-primary flex-1",value:s,onChange:d}),jsxRuntime.jsxs("span",{className:"w-8 text-right tabular-nums text-muted-foreground",children:[s,"%"]})]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.imageAdjustments.biLevelThreshold")}),jsxRuntime.jsx("p",{className:"text-[10px] text-muted-foreground/70",children:r("pptx.imageAdjustments.biLevelDescription")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"range",min:0,max:100,step:1,disabled:!e,className:"accent-primary flex-1",value:a,onChange:u}),jsxRuntime.jsx("span",{className:"w-8 text-right tabular-nums text-muted-foreground",children:a})]})]})]})}function GN({label:t,disabled:e,value:n,onChange:r}){return jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:t}),jsxRuntime.jsx("input",{type:"range",min:-100,max:100,disabled:e,className:"accent-primary",value:n,onChange:o=>r(Number(o.target.value))})]})}function $he({selectedElement:t,canEdit:e,onUpdateElement:n}){let{t:r}=reactI18next.useTranslation(),o=t.imageEffects,i=s=>{n({imageEffects:{...o,...s}});};return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:r("pptx.image.properties")}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Alt Text"}),jsxRuntime.jsx("textarea",{rows:2,disabled:!e,className:ie(an,"resize-none text-[11px]"),value:t.altText??"",onChange:s=>n({altText:s.target.value})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsx(GN,{label:"Brightness",disabled:!e,value:o?.brightness??0,onChange:s=>i({brightness:s})}),jsxRuntime.jsx(GN,{label:"Contrast",disabled:!e,value:o?.contrast??0,onChange:s=>i({contrast:s})}),jsxRuntime.jsx(GN,{label:r("pptx.image.saturation"),disabled:!e,value:o?.saturation??0,onChange:s=>i({saturation:s})})]}),jsxRuntime.jsx(Bhe,{selectedElement:t,canEdit:e,onUpdateElement:n}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Grayscale"}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!o?.grayscale,onChange:s=>i({grayscale:s.target.checked})})]}),jsxRuntime.jsx(Ohe,{selectedElement:t,canEdit:e,onUpdateElement:n})]}),jsxRuntime.jsx(Nhe,{fx:o,canEdit:e,updateEffects:i}),jsxRuntime.jsx(Ihe,{fx:o,canEdit:e,updateEffects:i}),jsxRuntime.jsx(khe,{imgSrc:t.imageData,fx:o,canEdit:e,updateEffects:i}),jsxRuntime.jsx("button",{type:"button",disabled:!e,className:"w-full text-[11px] rounded bg-muted hover:bg-accent border border-border px-2 py-1 text-foreground",onClick:()=>n({imageEffects:{brightness:0,contrast:0,saturation:0,grayscale:false,artisticEffect:void 0,colorWash:void 0,alphaModFix:void 0,biLevel:void 0,duotone:void 0},cropShape:"none"}),children:r("pptx.image.resetImage")})]})]})}var Mat="text-[11px] uppercase tracking-wide text-muted-foreground",_at="rounded border border-border bg-card p-2 space-y-2",Pat="flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",Eat="rounded bg-muted hover:bg-accent px-2 py-1 text-[11px] transition-colors",Aat="flex items-center justify-between gap-2",Whe="text-muted-foreground";function WN(t){if(!Number.isFinite(t)||t<0)return "00:00";let e=Math.round(t/1e3),n=Math.floor(e/60),r=e%60;return `${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function Vhe(t){let e=t.trim();if(e.length===0)return;let n=e.indexOf(":");if(n>=0){let o=e.slice(0,n),i=e.slice(n+1),s=parseInt(o,10),a=parseInt(i,10);return !Number.isFinite(s)||!Number.isFinite(a)||s<0||a<0||a>=60?void 0:(s*60+a)*1e3}let r=parseInt(e,10);if(!(!Number.isFinite(r)||r<0))return r*1e3}function Rat(t,e,n){return t<0||e<0?"pptx.media.trimErrorNegative":e>0&&t>=e?"pptx.media.trimErrorStartAfterEnd":n>0&&t>n||n>0&&e>n?"pptx.media.trimErrorBeyondDuration":null}function Ghe({label:t,valueMs:e,maxMs:n,disabled:r,onChange:o}){let[i,s]=Jm.useState(null),[a,l]=Jm.useState(false),c=i??WN(e),d=Jm.useCallback(()=>{s(WN(e)),l(false);},[e]),u=Jm.useCallback(()=>{if(i!==null){let f=Vhe(i);f!==void 0&&f>=0&&(n<=0||f<=n)&&o(f),l(false);}s(null);},[i,n,o]),p=Jm.useCallback(f=>{let m=f.target.value;s(m);let x=Vhe(m);l(x===void 0);},[]),h=Jm.useCallback(f=>{f.key==="Enter"?f.currentTarget.blur():f.key==="Escape"&&(s(null),l(false));},[]);return jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Whe}`,children:t}),jsxRuntime.jsx("input",{type:"text",disabled:r,className:`${Pat} text-[11px] tabular-nums ${a?"border-red-400":""}`,value:c,placeholder:"00:00",onFocus:d,onBlur:u,onChange:p,onKeyDown:h})]})}function Xhe({element:t,canEdit:e,durationSeconds:n,onUpdateElement:r}){let{t:o}=reactI18next.useTranslation(),i=t.trimStartMs??0,s=t.trimEndMs??0,a=n*1e3,l=Jm.useMemo(()=>{let f=i,m=s>0?s:a;return m<=f||a<=0?WN(a):WN(m-f)},[i,s,a]),c=Jm.useMemo(()=>Rat(i,s,a),[i,s,a]),d=i>0||s>0,u=Jm.useCallback(f=>{r({trimStartMs:f});},[r]),p=Jm.useCallback(f=>{r({trimEndMs:f});},[r]),h=Jm.useCallback(()=>{r({trimStartMs:0,trimEndMs:0});},[r]);return jsxRuntime.jsxs("div",{className:_at,children:[jsxRuntime.jsxs("div",{className:Mat,children:[jsxRuntime.jsx(lu$1.LuScissors,{className:"inline w-3 h-3 mr-1"}),o("pptx.media.trim")]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsx(Ghe,{label:o("pptx.media.trimStartTime"),valueMs:i,maxMs:a,disabled:!e,onChange:u}),jsxRuntime.jsx(Ghe,{label:o("pptx.media.trimEndTime"),valueMs:s,maxMs:a,disabled:!e,onChange:p})]}),jsxRuntime.jsxs("div",{className:Aat,children:[jsxRuntime.jsxs("span",{className:`text-[11px] ${Whe}`,children:[jsxRuntime.jsx(lu$1.LuClock,{className:"inline w-3 h-3 mr-1"}),o("pptx.media.trimmedDuration")]}),jsxRuntime.jsx("span",{className:"text-[11px] tabular-nums font-medium",children:l})]}),c&&jsxRuntime.jsx("div",{className:"text-[10px] text-red-400",children:o(c)}),e&&d&&jsxRuntime.jsx("button",{type:"button",className:`${Eat} w-full text-center`,onClick:h,children:o("pptx.media.resetTrim")})]})}function jh(t){let e=Math.floor(t/60),n=Math.floor(t%60),r=Math.round(t%1*10);return `${e}:${String(n).padStart(2,"0")}.${r}`}function jhe(){return `bmk-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}var uv="text-[11px] uppercase tracking-wide text-muted-foreground",pv="rounded border border-border bg-card p-2 space-y-2",A2="flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",XN="rounded bg-muted hover:bg-accent px-2 py-1 text-[11px] transition-colors",il="flex items-center justify-between gap-2",Ki="text-muted-foreground";function Yhe({duration:t,trimStartMs:e,trimEndMs:n,currentTime:r,bookmarks:o,canEdit:i,onTrimChange:s,onSeek:a}){let l=Jm.useRef(null),[c,d]=Jm.useState(null),u=e/1e3,p=n>0?n/1e3:t,h=t>0?t:1,f=u/h*100,m=p/h*100,x=r/h*100,g=Jm.useCallback(b=>{let v=l.current;if(!v)return 0;let S=v.getBoundingClientRect();return Math.max(0,Math.min(1,(b-S.left)/S.width))*h},[h]);Jm.useEffect(()=>{if(!c)return;let b=S=>{let w=g(S.clientX);if(c==="start"){let C=Math.min(w,p-.1);s(Math.max(0,C)*1e3,n);}else {let C=Math.max(w,u+.1);s(e,Math.min(C,t)*1e3);}},v=()=>{d(null);};return window.addEventListener("pointermove",b),window.addEventListener("pointerup",v),()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",v);}},[c,t,g,s,n,p,e,u]);let y=b=>{let v=g(b.clientX);a(v);};return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[jsxRuntime.jsx("span",{children:jh(u)}),jsxRuntime.jsx("span",{children:jh(p)})]}),jsxRuntime.jsxs("div",{ref:l,className:"relative h-5 rounded bg-muted cursor-pointer select-none",onClick:y,children:[jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 bg-primary/30 rounded",style:{left:`${f}%`,width:`${m-f}%`}}),jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-white z-10",style:{left:`${Math.min(x,100)}%`}}),i&&jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 w-2 bg-primary rounded-l cursor-ew-resize z-20 hover:bg-primary/80",style:{left:`calc(${f}% - 4px)`},onPointerDown:b=>{b.stopPropagation(),d("start");}}),i&&jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 w-2 bg-primary rounded-r cursor-ew-resize z-20 hover:bg-primary/80",style:{left:`calc(${m}% - 4px)`},onPointerDown:b=>{b.stopPropagation(),d("end");}}),o.map(b=>{let v=b.time/h*100;return jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 w-1 bg-yellow-400/70 z-10 cursor-pointer",style:{left:`${v}%`},title:b.label,onClick:S=>{S.stopPropagation(),a(b.time);}},b.id)})]})]})}function qhe({element:t,canEdit:e,currentTime:n,bookmarks:r,onUpdateElement:o,onSeekTo:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState(""),c=Math.round((t.volume??1)*100),d=Jm.useCallback(()=>{let p=a.trim()||`${s("pptx.media.bookmark")} ${r.length+1}`,h={id:jhe(),time:n,label:p};o({bookmarks:[...r,h]}),l("");},[r,n,a,o,s]),u=Jm.useCallback(p=>{o({bookmarks:r.filter(h=>h.id!==p)});},[r,o]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:pv,children:[jsxRuntime.jsx("div",{className:uv,children:s("pptx.media.playback")}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.volume")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-1 max-w-[140px]",children:[jsxRuntime.jsx("input",{type:"range",min:0,max:100,step:1,disabled:!e,className:"flex-1",value:c,onChange:p=>o({volume:Number(p.target.value)/100})}),jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground w-7 text-right tabular-nums",children:[c,"%"]})]})]}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.speed")}),jsxRuntime.jsxs("select",{disabled:!e,className:`${A2} text-[11px] max-w-[100px]`,value:t.playbackSpeed??1,onChange:p=>o({playbackSpeed:Number(p.target.value)}),children:[jsxRuntime.jsx("option",{value:.25,children:"0.25x"}),jsxRuntime.jsx("option",{value:.5,children:"0.5x"}),jsxRuntime.jsx("option",{value:.75,children:"0.75x"}),jsxRuntime.jsx("option",{value:1,children:"1x"}),jsxRuntime.jsx("option",{value:1.25,children:"1.25x"}),jsxRuntime.jsx("option",{value:1.5,children:"1.5x"}),jsxRuntime.jsx("option",{value:2,children:"2x"}),jsxRuntime.jsx("option",{value:3,children:"3x"}),jsxRuntime.jsx("option",{value:4,children:"4x"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.fadeIn")}),jsxRuntime.jsx("input",{type:"number",min:0,step:.1,disabled:!e,className:`${A2} text-[11px]`,value:t.fadeInDuration??0,onChange:p=>o({fadeInDuration:Number(p.target.value)||void 0})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.fadeOut")}),jsxRuntime.jsx("input",{type:"number",min:0,step:.1,disabled:!e,className:`${A2} text-[11px]`,value:t.fadeOutDuration??0,onChange:p=>o({fadeOutDuration:Number(p.target.value)||void 0})})]})]}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.loop")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!t.loop,onChange:p=>o({loop:p.target.checked||void 0})})]}),jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.startTrigger")}),jsxRuntime.jsxs("select",{disabled:!e,className:"text-[11px] bg-transparent border border-border rounded px-1 py-0.5",value:t.autoPlay?"auto":"onClick",onChange:p=>o({autoPlay:p.target.value==="auto"||void 0}),children:[jsxRuntime.jsx("option",{value:"onClick",children:s("pptx.media.startOnClick")}),jsxRuntime.jsx("option",{value:"auto",children:s("pptx.media.startAutomatically")})]})]}),t.mediaType==="audio"&&jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.playAcrossSlides")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!t.playAcrossSlides,onChange:p=>o({playAcrossSlides:p.target.checked||void 0,...p.target.checked?{autoPlay:true}:{}})})]}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.fullScreen")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!t.fullScreen,onChange:p=>o({fullScreen:p.target.checked||void 0})})]}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.hideWhenNotPlaying")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!t.hideWhenNotPlaying,onChange:p=>o({hideWhenNotPlaying:p.target.checked||void 0})})]})]}),jsxRuntime.jsxs("div",{className:pv,children:[jsxRuntime.jsxs("div",{className:uv,children:[jsxRuntime.jsx(lu$1.LuBookmark,{className:"inline w-3 h-3 mr-1"}),s("pptx.media.bookmarks")]}),r.length>0&&jsxRuntime.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:r.slice().sort((p,h)=>p.time-h.time).map(p=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1 text-[11px] group",children:[jsxRuntime.jsx("button",{type:"button",className:"text-primary hover:text-primary/80 truncate flex-1 text-left",onClick:()=>i(p.time),title:s("pptx.media.seekToBookmark"),children:p.label}),jsxRuntime.jsx("span",{className:"text-muted-foreground tabular-nums text-[10px]",children:jh(p.time)}),e&&jsxRuntime.jsx("button",{type:"button",className:"opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-300 transition-opacity",onClick:()=>u(p.id),title:s("common.remove"),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"})})]},p.id))}),e&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("input",{type:"text",className:`${A2} text-[11px]`,placeholder:s("pptx.media.bookmarkLabel"),value:a,onChange:p=>l(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),d());}}),jsxRuntime.jsx("button",{type:"button",className:XN,onClick:d,title:s("pptx.media.addBookmark"),children:jsxRuntime.jsx(lu$1.LuPlus,{className:"w-3 h-3"})})]})]})]})}function Jhe({element:t,mediaDataUrls:e,canEdit:n,onUpdateElement:r}){let{t:o}=reactI18next.useTranslation(),i=Jm.useRef(null),[s,a]=Jm.useState(false),[l,c]=Jm.useState(0),[d,u]=Jm.useState(0),p=t.mediaData??(t.mediaPath?e.get(t.mediaPath):void 0),h=t.bookmarks??[],f=t.mediaType==="video";Jm.useEffect(()=>{let v=i.current;if(!v)return;let S=()=>c(v.currentTime),w=()=>{Number.isFinite(v.duration)&&u(v.duration);},C=()=>a(true),T=()=>a(false),M=()=>a(false);return v.addEventListener("timeupdate",S),v.addEventListener("durationchange",w),v.addEventListener("loadedmetadata",w),v.addEventListener("play",C),v.addEventListener("pause",T),v.addEventListener("ended",M),()=>{v.removeEventListener("timeupdate",S),v.removeEventListener("durationchange",w),v.removeEventListener("loadedmetadata",w),v.removeEventListener("play",C),v.removeEventListener("pause",T),v.removeEventListener("ended",M);}},[p]);let m=Jm.useCallback(()=>{let v=i.current;v&&(v.paused?v.play():v.pause());},[]),x=Jm.useCallback(v=>{let S=i.current;S&&(S.currentTime=v,c(v));},[]),g=Jm.useCallback((v,S)=>{r({trimStartMs:v,trimEndMs:S});},[r]),[y,b]=Jm.useState(t.metadata);return Jm.useEffect(()=>{let v=i.current;if(!v)return;if(t.metadata?.duration!==void 0){b(t.metadata);return}let S=()=>{if(!Number.isFinite(v.duration)||v.duration===0)return;let w={duration:v.duration};v instanceof HTMLVideoElement&&(v.videoWidth>0&&(w.videoWidth=v.videoWidth),v.videoHeight>0&&(w.videoHeight=v.videoHeight));let C=v.querySelector("source");C?.type&&(w.codecInfo=C.type),t.metadata=w,b(w);};return v.addEventListener("loadedmetadata",S),v.readyState>=1&&S(),()=>{v.removeEventListener("loadedmetadata",S);}},[p,t]),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:pv,children:[jsxRuntime.jsx("div",{className:uv,children:o("pptx.media.title")}),jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground",children:o(f?"pptx.media.videoClip":"pptx.media.audioClip")}),p&&jsxRuntime.jsxs("div",{className:"space-y-1",children:[f?jsxRuntime.jsx("video",{ref:i,className:"w-full rounded bg-black max-h-32 object-contain",src:p,preload:"metadata"}):jsxRuntime.jsx("audio",{ref:i,className:"w-full",src:p,preload:"metadata"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{type:"button",className:XN,onClick:m,title:o(s?"pptx.media.pause":"pptx.media.play"),children:s?jsxRuntime.jsx(lu$1.LuPause,{className:"w-3 h-3"}):jsxRuntime.jsx(lu$1.LuPlay,{className:"w-3 h-3"})}),jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:[jh(l)," / ",jh(d)]})]})]}),d>0&&jsxRuntime.jsx(Yhe,{duration:d,trimStartMs:t.trimStartMs??0,trimEndMs:t.trimEndMs??0,currentTime:l,bookmarks:h,canEdit:n,onTrimChange:g,onSeek:x})]}),jsxRuntime.jsx(Xhe,{element:t,canEdit:n,durationSeconds:d,onUpdateElement:r}),(y||t.posterFrameData)&&jsxRuntime.jsxs("div",{className:pv,children:[jsxRuntime.jsxs("div",{className:uv,children:[jsxRuntime.jsx(lu$1.LuInfo,{className:"inline w-3 h-3 mr-1"}),o("pptx.media.info")]}),t.posterFrameData&&jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:`text-[11px] ${Ki}`,children:o("pptx.media.posterFrame")}),jsxRuntime.jsx("img",{src:t.posterFrameData,alt:o("pptx.media.posterFrame"),className:"w-full max-h-20 object-contain rounded bg-black/20"})]}),y?.duration!==void 0&&jsxRuntime.jsxs("div",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:o("pptx.media.duration")}),jsxRuntime.jsx("span",{className:"text-[11px] tabular-nums",children:jh(y.duration)})]}),y?.videoWidth!==void 0&&y?.videoHeight!==void 0&&jsxRuntime.jsxs("div",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:o("pptx.media.resolution")}),jsxRuntime.jsxs("span",{className:"text-[11px] tabular-nums",children:[y.videoWidth," x ",y.videoHeight]})]}),y?.codecInfo&&jsxRuntime.jsxs("div",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:o("pptx.media.format")}),jsxRuntime.jsx("span",{className:"text-[11px] truncate max-w-[140px]",title:y.codecInfo,children:y.codecInfo})]}),t.mediaPath&&jsxRuntime.jsxs("div",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:o("pptx.media.filePath")}),jsxRuntime.jsx("span",{className:"text-[10px] truncate max-w-[140px] text-muted-foreground",title:t.mediaPath,children:t.mediaPath.split("/").pop()})]})]}),jsxRuntime.jsx(qhe,{element:t,canEdit:n,currentTime:l,bookmarks:h,onUpdateElement:r,onSeekTo:x})]})}bt();function Qhe({selectedElement:t,canEdit:e,onUpdateElement:n,onUpdateElementStyle:r,onUpdateTextStyle:o}){let{t:i}=reactI18next.useTranslation();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Jt(t)&&jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:i("pptx.shape.type","Shape Type")}),jsxRuntime.jsx("select",{value:t.shapeType||"rect",disabled:!e,className:ie(an,"w-full"),onChange:s=>n({shapeType:s.target.value}),children:Bm.filter(s=>s.type!=="connector").map(s=>jsxRuntime.jsx("option",{value:s.type,children:s.label},s.type))})]}),Jt(t)&&jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:i("pptx.shape.fillStroke","Fill & Stroke")}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Fill"}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(t.shapeStyle?.fillColor,"#3b82f6"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:s=>r({fillColor:s,fillMode:"solid"})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Stroke"}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(t.shapeStyle?.strokeColor,"#1f2937"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:s=>r({strokeColor:s})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1 col-span-2",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground",children:"Stroke W"}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:an,min:0,max:20,value:t.shapeStyle?.strokeWidth??1,onChange:s=>r({strokeWidth:Number(s.target.value)})})]})]})]}),ze(t)&&jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:i("pptx.text.title","Text")}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Size"}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:an,min:6,max:200,value:t.textStyle?.fontSize??18,onChange:s=>o({fontSize:Number(s.target.value)})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Color"}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(t.textStyle?.color,"#000000"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:s=>o({color:s})})]}),jsxRuntime.jsxs("div",{className:"flex gap-1 col-span-2",children:[jsxRuntime.jsx(QV,{label:"B",active:!!t.textStyle?.bold,disabled:!e,onClick:()=>o({bold:!t.textStyle?.bold})}),jsxRuntime.jsx(QV,{label:"I",active:!!t.textStyle?.italic,disabled:!e,italic:true,onClick:()=>o({italic:!t.textStyle?.italic})}),jsxRuntime.jsx(QV,{label:"U",active:!!t.textStyle?.underline,disabled:!e,underline:true,onClick:()=>o({underline:!t.textStyle?.underline})})]})]})]})]})}function QV({label:t,active:e,disabled:n,italic:r,underline:o,onClick:i}){return jsxRuntime.jsx("button",{type:"button",disabled:n,className:ie("px-2 py-1 rounded text-[11px] transition-colors",r&&"italic",o&&"underline",e?"bg-primary text-white":"bg-muted hover:bg-accent"),onClick:i,children:t})}bt();Pe();var Yat={venn:{min:2,max:3},matrix:{min:4,max:4},pyramid:{min:2,max:5},funnel:{min:2,max:5},target:{min:2,max:5},gear:{min:2,max:3},cycle:{min:3}},efe={min:1};function eG(t){return t?Yat[t]??efe:efe}function tG(t,e){let{max:n}=eG(t);return n===void 0||e<n}function YN(t,e){let{min:n}=eG(t);return e>n}function tfe(t){let{min:e,max:n}=eG(t);if(!(e<=1&&n===void 0))return n===void 0?`Works best with at least ${e} items.`:e===n?`This layout uses exactly ${n} items.`:`Works best with ${e} to ${n} items.`}bt();function nfe(t,e){let n=UD(t,"",e);if(n===t)return;let r=n.nodes.findIndex(i=>i.id===e),o=r>=0?n.nodes[r+1]:void 0;return {data:n,focusNodeId:o?.id}}function rfe(t,e){if(t.nodes.length<=1)return;let n=t.nodes.findIndex(i=>i.id===e),r=lS(t,e);if(r===t)return;let o=r.nodes[Math.max(0,n-1)];return {data:r,focusNodeId:o?.id}}function ofe(t,e){let n=zD(t,e);return n===t?void 0:n}function ife(t,e){let n=HD(t,e);return n===t?void 0:n}function sfe(t,e,n){let r=$D(t,e,n);return r===t?void 0:r}function afe(t,e){let n=t.nodes.find(o=>o.id===e);return n?t.nodes.filter(o=>o.parentId===n.parentId).findIndex(o=>o.id===e):-1}function lfe(t,e){let n=t.nodes.find(r=>r.id===e);return n?t.nodes.filter(r=>r.parentId===n.parentId).length:0}bt();function Kat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"2",y:"10",width:"10",height:"12",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M14 16 L17 16",stroke:"currentColor",strokeWidth:"1.5",opacity:.5}),jsxRuntime.jsx("rect",{x:"19",y:"10",width:"10",height:"12",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M31 16 L34 16",stroke:"currentColor",strokeWidth:"1.5",opacity:.5}),jsxRuntime.jsx("rect",{x:"36",y:"10",width:"10",height:"12",rx:"2",fill:"currentColor",opacity:.7})]})}function qat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"17",y:"2",width:"14",height:"8",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M24 10 L12 18 M24 10 L36 18",stroke:"currentColor",strokeWidth:"1",opacity:.5}),jsxRuntime.jsx("rect",{x:"4",y:"18",width:"14",height:"8",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"30",y:"18",width:"14",height:"8",rx:"2",fill:"currentColor",opacity:.7})]})}function Zat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"24",cy:"5",r:"4",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"37",cy:"20",r:"4",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"11",cy:"20",r:"4",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M28 6 L34 17 M33 23 L14 23 M14 18 L20 7",stroke:"currentColor",strokeWidth:"1",opacity:.4,fill:"none"})]})}function Jat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"4",y:"3",width:"18",height:"11",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"26",y:"3",width:"18",height:"11",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"4",y:"18",width:"18",height:"11",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"26",y:"18",width:"18",height:"11",rx:"2",fill:"currentColor",opacity:.7})]})}function Qat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"16",y:"2",width:"16",height:"8",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"10",y:"12",width:"28",height:"8",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"4",y:"22",width:"40",height:"8",rx:"2",fill:"currentColor",opacity:.7})]})}function elt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"4",y:"3",width:"40",height:"7",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"4",y:"13",width:"40",height:"7",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"4",y:"23",width:"40",height:"7",rx:"2",fill:"currentColor",opacity:.7})]})}function tlt(){return jsxRuntime.jsx("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:jsxRuntime.jsx("path",{d:"M4 3 L44 3 L28 16 L28 29 L20 29 L20 16 Z",fill:"currentColor",opacity:.7})})}function nlt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"24",cy:"16",r:"14",fill:"currentColor",opacity:.3}),jsxRuntime.jsx("circle",{cx:"24",cy:"16",r:"9",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("circle",{cx:"24",cy:"16",r:"4",fill:"currentColor",opacity:.8})]})}function rlt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"9",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"3",fill:"white",opacity:.9}),jsxRuntime.jsx("circle",{cx:"33",cy:"16",r:"6",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("circle",{cx:"33",cy:"16",r:"2",fill:"white",opacity:.9})]})}function olt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"19",cy:"16",r:"11",fill:"currentColor",opacity:.45}),jsxRuntime.jsx("circle",{cx:"29",cy:"16",r:"11",fill:"currentColor",opacity:.45})]})}function ilt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("path",{d:"M4 16 L44 16",stroke:"currentColor",strokeWidth:"1.5",opacity:.5}),jsxRuntime.jsx("circle",{cx:"10",cy:"16",r:"3",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"24",cy:"16",r:"3",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"38",cy:"16",r:"3",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"6",y:"4",width:"8",height:"6",rx:"1",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("rect",{x:"34",y:"4",width:"8",height:"6",rx:"1",fill:"currentColor",opacity:.5})]})}function slt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"14",cy:"16",r:"10",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("circle",{cx:"34",cy:"16",r:"10",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("path",{d:"M14 6 L34 26 M34 6 L14 26",stroke:"currentColor",strokeWidth:"1",opacity:.3})]})}function alt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("path",{d:"M2 8 L14 8 L20 16 L14 24 L2 24 L8 16 Z",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M17 8 L29 8 L35 16 L29 24 L17 24 L23 16 Z",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M32 8 L44 8 L44 24 L32 24 L38 16 Z",fill:"currentColor",opacity:.7})]})}function llt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"11",height:"9",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M13 7 L20 7 L20 16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:.5}),jsxRuntime.jsx("rect",{x:"19",y:"12",width:"11",height:"9",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M30 16 L37 16 L37 25",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:.5}),jsxRuntime.jsx("rect",{x:"35",y:"21",width:"11",height:"9",rx:"2",fill:"currentColor",opacity:.7})]})}var cfe={process:Kat,hierarchy:qat,cycle:Zat,matrix:Jat,pyramid:Qat,list:elt,funnel:tlt,target:nlt,gear:rlt,venn:olt,timeline:ilt,relationship:slt,chevron:alt,bending:llt};var dlt=d_.map(t=>({type:t,i18nKey:`pptx.smartart.category.${t}`}));function ufe({smartArtData:t,canEdit:e,onUpdateSmartArt:n}){let{t:r}=reactI18next.useTranslation(),o=t.resolvedLayoutType??"list",i=s=>{if(!e||s===o)return;let a=KD(t,s);n({layoutType:a.layoutType,resolvedLayoutType:a.resolvedLayoutType,layout:a.layout,drawingShapes:a.drawingShapes});};return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("span",{className:"text-[11px] text-muted-foreground",children:r("pptx.smartart.switchLayout")}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:dlt.map(({type:s,i18nKey:a})=>{let l=o===s,c=cfe[s];return jsxRuntime.jsxs("button",{type:"button",disabled:!e,className:ie("flex flex-col items-center gap-0.5 rounded border p-1.5 transition-colors","text-[9px] leading-tight",l?"border-primary bg-primary/15 text-primary":"border-border text-muted-foreground hover:bg-muted hover:text-foreground",!e&&"opacity-50 cursor-not-allowed"),onClick:()=>i(s),title:r(a),children:[jsxRuntime.jsx("div",{className:"w-10 h-7",children:c?jsxRuntime.jsx(c,{}):null}),jsxRuntime.jsx("span",{className:"truncate w-full text-center",children:r(a)})]},s)})})]})}var ult="#3b82f6",plt="#ffffff",pfe="px-1.5 py-0.5 text-[10px] rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed";function hfe({nodeId:t,style:e,label:n,canEdit:r,onChangeStyle:o}){let i=!!e?.bold,s=!!e?.italic;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 mt-1 pl-4",role:"group","aria-label":`Style for ${n}`,children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-0.5 text-[9px] text-muted-foreground",children:[jsxRuntime.jsx("span",{children:"Fill"}),jsxRuntime.jsx("input",{type:"color",disabled:!r,"aria-label":`Fill colour for ${n}`,className:"h-4 w-5 cursor-pointer rounded border border-border bg-transparent p-0 disabled:cursor-not-allowed",value:e?.fillColor??ult,onChange:a=>o(t,{fillColor:a.target.value})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-0.5 text-[9px] text-muted-foreground",children:[jsxRuntime.jsx("span",{children:"Text"}),jsxRuntime.jsx("input",{type:"color",disabled:!r,"aria-label":`Font colour for ${n}`,className:"h-4 w-5 cursor-pointer rounded border border-border bg-transparent p-0 disabled:cursor-not-allowed",value:e?.fontColor??plt,onChange:a=>o(t,{fontColor:a.target.value})})]}),jsxRuntime.jsx("button",{type:"button",disabled:!r,"aria-label":`Bold ${n}`,"aria-pressed":i,className:ie(pfe,"font-bold",i?"border-primary bg-primary/20 text-primary":"border-border text-muted-foreground"),onClick:()=>o(t,{bold:!i}),children:"B"}),jsxRuntime.jsx("button",{type:"button",disabled:!r,"aria-label":`Italic ${n}`,"aria-pressed":s,className:ie(pfe,"italic",s?"border-primary bg-primary/20 text-primary":"border-border text-muted-foreground"),onClick:()=>o(t,{italic:!s}),children:"I"})]})}var KN="text-[9px] text-muted-foreground hover:text-primary px-1 disabled:opacity-40 disabled:cursor-not-allowed";function ffe({nodeId:t,text:e,displayIndex:n,isChild:r,canEdit:o,removeDisabled:i,moveUpDisabled:s,moveDownDisabled:a,inputRef:l,style:c,onChangeText:d,onKeyDown:u,onAddSubItem:p,onMoveUp:h,onMoveDown:f,onRemove:m,onChangeStyle:x}){let g=r?`Sub-item: ${e||"empty"}`:`Item ${n}: ${e||"empty"}`;return jsxRuntime.jsxs("div",{role:"listitem",className:ie("rounded border bg-background/60 p-1.5",r?"border-border/60 ml-4":"border-border"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground w-3 shrink-0","aria-hidden":"true",children:r?"\u2022":`${n}`}),jsxRuntime.jsx("input",{ref:l,type:"text",disabled:!o,"aria-label":g,className:ie(an,"flex-1 text-[11px] py-0.5"),value:e,onChange:y=>d(t,y.target.value),onKeyDown:y=>u(y,t),placeholder:"Type here"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[jsxRuntime.jsx("button",{type:"button",disabled:!o||s,className:KN,onClick:()=>h(t),"aria-label":`Move ${g} up`,title:"Move up",children:"\u2191"}),jsxRuntime.jsx("button",{type:"button",disabled:!o||a,className:KN,onClick:()=>f(t),"aria-label":`Move ${g} down`,title:"Move down",children:"\u2193"}),!r&&jsxRuntime.jsx("button",{type:"button",disabled:!o,className:KN,onClick:()=>p(t),"aria-label":`Add sub-item under ${g}`,title:"Add sub-item",children:"+Sub"}),jsxRuntime.jsx("button",{type:"button",disabled:!o||i,className:ie(KN,"hover:text-red-400"),onClick:()=>m(t),"aria-label":`Remove ${g}`,title:i?"Layout minimum reached":"Remove",children:"x"})]})]}),jsxRuntime.jsx(hfe,{nodeId:t,style:c,label:g,canEdit:o,onChangeStyle:x})]})}var flt=["colorful1","colorful2","colorful3","monochromatic1","monochromatic2"],mlt=["flat","moderate","intense"],glt=new Set(["parOf","presParOf",void 0]);function mfe({smartArtData:t,canEdit:e,onUpdateElement:n,box:r}){let{t:o}=reactI18next.useTranslation(),i=t.nodes??[],s=t.resolvedLayoutType,a=i.filter(M=>!M.parentId).length,l=Jm__default.default.useRef(new Map),c=Jm__default.default.useRef(null);Jm__default.default.useEffect(()=>{let M=c.current;M&&(l.current.get(M)?.focus(),c.current=null);});let d=(M,_)=>{_&&(c.current=_);let E=r?MT(M,M.layout,$T(M),M.style??"flat","inspector",r):M;n({smartArtData:E});},u=M=>{d({...t,...M});},p=(M,_)=>{d(Nf(t,M,_));},h=(M,_)=>{let E=cS(t,M,_);E!==t&&d(E);},f=()=>{tG(s,a)&&d(s_(t));},m=M=>{d(s_(t,M,"Sub-item"));},x=M=>{!i.find(E=>E.id===M)?.parentId&&!YN(s,a)||d(lS(t,M));},g=(M,_)=>{let E=sfe(t,M,_);E&&d(E,M);},y=(M,_)=>{let E=i.find(I=>I.id===_),R=!E?.text;if(M.key==="Enter"){M.preventDefault();let I=nfe(t,_);I&&d(I.data,I.focusNodeId);}else if((M.key==="Backspace"||M.key==="Delete")&&R){if(!E?.parentId&&!YN(s,a))return;M.preventDefault();let L=rfe(t,_);L&&d(L.data,L.focusNodeId);}else if(M.key==="Tab"&&!M.shiftKey){M.preventDefault();let I=ofe(t,_);I&&d(I,_);}else if(M.key==="Tab"&&M.shiftKey){M.preventDefault();let I=ife(t,_);I&&d(I,_);}},b=M=>_=>{_?l.current.set(M,_):l.current.delete(M);},v=tfe(s),S=!e||!tG(s,a),w=(t.connections??[]).filter(M=>!glt.has(M.type)),C=Array.from(new Set(w.map(M=>M.type??"unknown"))).join(", "),T=0;return jsxRuntime.jsxs("div",{className:Zt,role:"group","aria-label":o("pptx.smartart.title"),children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.smartart.title")}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(ufe,{smartArtData:t,canEdit:e,onUpdateSmartArt:u}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.smartart.colorScheme")}),jsxRuntime.jsx("select",{disabled:!e,"aria-label":o("pptx.smartart.colorScheme"),className:ie(an,"w-full"),value:t.colorScheme??"colorful1",onChange:M=>u({colorScheme:M.target.value}),children:flt.map(M=>jsxRuntime.jsx("option",{value:M,children:M},M))})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.smartart.style")}),jsxRuntime.jsx("div",{className:"flex gap-1",role:"group","aria-label":o("pptx.smartart.style"),children:mlt.map(M=>jsxRuntime.jsx("button",{type:"button",disabled:!e,"aria-pressed":(t.style??"flat")===M,className:ie("flex-1 px-2 py-1 text-[10px] rounded border transition-colors",(t.style??"flat")===M?"border-primary bg-primary/20 text-primary":"border-border text-muted-foreground hover:bg-muted"),onClick:()=>u({style:M}),children:M},M))})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[o("pptx.smartart.textPane")," (",i.length,")"]}),jsxRuntime.jsx("button",{type:"button",disabled:S,className:xr,onClick:f,title:S?v:void 0,children:o("pptx.smartart.addItem")})]}),v&&jsxRuntime.jsx("div",{className:"text-[9px] text-muted-foreground",role:"note",children:v}),jsxRuntime.jsx("div",{className:"max-h-52 overflow-y-auto space-y-1 pr-1",role:"list",children:i.map(M=>{let _=!!M.parentId;_||(T+=1);let E=afe(t,M.id),R=lfe(t,M.id),I=i.length<=1||!_&&!YN(s,a);return jsxRuntime.jsx(ffe,{nodeId:M.id,text:M.text,displayIndex:T,isChild:_,canEdit:e,removeDisabled:I,moveUpDisabled:E<=0,moveDownDisabled:E<0||E>=R-1,inputRef:b(M.id),style:M.style,onChangeText:p,onKeyDown:y,onAddSubItem:m,onMoveUp:L=>g(L,-1),onMoveDown:L=>g(L,1),onRemove:x,onChangeStyle:h},M.id)})}),w.length>0&&jsxRuntime.jsxs("div",{className:"text-[9px] text-muted-foreground",role:"note","aria-label":`${w.length} non-tree relationship connection(s): ${C}`,children:[o("pptx.smartart.extraConnections",{count:w.length}),jsxRuntime.jsx("span",{className:"block opacity-80",children:C})]}),jsxRuntime.jsx("div",{className:"text-[9px] text-muted-foreground mt-1",children:o("pptx.smartart.tabHint")})]})]})}Pe();Pe();function gfe({cellStyle:t,canEdit:e,onUpdateCellStyle:n}){let{t:r}=reactI18next.useTranslation(),o=t.fillMode??"solid",i=s=>{let a=s;n(a==="gradient"?{fillMode:"gradient",gradientFillType:t.gradientFillType??"linear",gradientFillAngle:t.gradientFillAngle??90,gradientFillStops:t.gradientFillStops??[{color:"#FF0000",position:0},{color:"#0000FF",position:100}]}:a==="pattern"?{fillMode:"pattern",patternFillPreset:t.patternFillPreset??"ltDnDiag",patternFillForeground:t.patternFillForeground??"#000000",patternFillBackground:t.patternFillBackground??"#FFFFFF"}:{fillMode:a});};return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.fillMode")}),jsxRuntime.jsx("select",{disabled:!e,className:iT,value:o,onChange:s=>i(s.target.value),children:G4.map(s=>jsxRuntime.jsx("option",{value:s.value??"",children:r(s.i18nKey)},s.value))})]}),o==="gradient"&&jsxRuntime.jsx(xlt,{cellStyle:t,canEdit:e,onUpdateCellStyle:n}),o==="pattern"&&jsxRuntime.jsx(ylt,{cellStyle:t,canEdit:e,onUpdateCellStyle:n}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("span",{className:V4,children:r("pptx.table.margins")}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:[["marginTop","pptx.table.marginTop"],["marginBottom","pptx.table.marginBottom"],["marginLeft","pptx.table.marginLeft"],["marginRight","pptx.table.marginRight"]].map(([s,a])=>jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r(a)}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:sT,min:0,max:200,value:t[s]??0,onChange:l=>n({[s]:Number(l.target.value)})})]},s))})]})]})}function xlt({cellStyle:t,canEdit:e,onUpdateCellStyle:n}){let{t:r}=reactI18next.useTranslation(),o=t.gradientFillStops??[],i=t.gradientFillType??"linear",s=(l,c)=>{let d=o.map((u,p)=>p===l?{...u,...c}:u);n({gradientFillStops:d});},a=()=>{n({gradientFillStops:[...o,{color:"#888888",position:50}]});};return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.gradientType")}),jsxRuntime.jsx("select",{disabled:!e,className:iT,value:i,onChange:l=>n({gradientFillType:l.target.value}),children:W4.map(l=>jsxRuntime.jsx("option",{value:l.value,children:r(l.i18nKey)},l.value))})]}),i==="linear"&&jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.gradientAngle")}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:sT,min:0,max:360,value:t.gradientFillAngle??90,onChange:l=>n({gradientFillAngle:Number(l.target.value)})})]})]}),jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.gradientStops")}),o.map((l,c)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"h-6 w-6 rounded border border-border cursor-pointer",value:l.color,onChange:d=>s(c,{color:d.target.value})}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:sT,min:0,max:100,value:Math.round(l.position),onChange:d=>s(c,{position:Number(d.target.value)})}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:"%"})]},c)),jsxRuntime.jsx("button",{type:"button",disabled:!e,className:"text-[10px] text-primary hover:underline",onClick:a,children:r("pptx.table.gradientAddStop")})]})}function ylt({cellStyle:t,canEdit:e,onUpdateCellStyle:n}){let{t:r}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.patternPreset")}),jsxRuntime.jsx("select",{disabled:!e,className:iT,value:t.patternFillPreset??"ltDnDiag",onChange:o=>n({patternFillPreset:o.target.value}),children:X4.map(o=>jsxRuntime.jsx("option",{value:o,children:o},o))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.patternForeground")}),jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",value:t.patternFillForeground??"#000000",onChange:o=>n({patternFillForeground:o.target.value})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.patternBackground")}),jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",value:t.patternFillBackground??"#FFFFFF",onChange:o=>n({patternFillBackground:o.target.value})})]})]})]})}function xfe({tableData:t,tableEditorState:e,canEdit:n,onUpdateTableData:r}){let{t:o}=reactI18next.useTranslation(),{rowIndex:i,columnIndex:s}=e,a=t.rows[i]?.cells[s];if(!a)return null;let l=a.style??{},c=d=>{let u=t.rows.map((p,h)=>h!==i?p:{...p,cells:p.cells.map((f,m)=>m!==s?f:{...f,style:{...l,...d}})});r({rows:u});};return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.cell",{row:i+1,col:s+1})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-10 text-muted-foreground",children:o("pptx.table.fontSize")}),jsxRuntime.jsx("input",{type:"number",disabled:!n,className:an,min:6,max:200,value:l.fontSize??14,onChange:d=>c({fontSize:Number(d.target.value)})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.table.color")}),jsxRuntime.jsx(Lo,{disabled:!n,value:et(l.color,"#000000"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:d=>c({color:d})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.table.background")}),jsxRuntime.jsx(Lo,{disabled:!n,value:et(l.backgroundColor,"#ffffff"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:d=>c({backgroundColor:d})})]})]}),jsxRuntime.jsx(gfe,{cellStyle:l,canEdit:n,onUpdateCellStyle:c}),jsxRuntime.jsx("div",{className:"flex gap-1",children:[["bold","B","font-bold"],["italic","I","italic"],["underline","U","underline"]].map(([d,u,p])=>jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie("px-2 py-1 rounded text-[11px] transition-colors",p,l[d]?"bg-primary text-white":"bg-muted hover:bg-accent"),onClick:()=>c({[d]:!l[d]}),children:u},d))}),jsxRuntime.jsx("div",{className:"flex gap-1",children:[["left","L"],["center","C"],["right","R"]].map(([d,u])=>jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie("px-2 py-1 rounded text-[11px] transition-colors",l.align===d?"bg-primary text-white":"bg-muted hover:bg-accent"),onClick:()=>c({align:d}),children:u},d))}),jsxRuntime.jsx("div",{className:"flex gap-1",children:[["top","T"],["middle","M"],["bottom","B"]].map(([d,u])=>jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie("px-2 py-1 rounded text-[11px] transition-colors",l.vAlign===d?"bg-primary text-white":"bg-muted hover:bg-accent"),onClick:()=>c({vAlign:d}),children:u},d))}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.table.cellBorders")}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:[["Top","borderTopColor","borderTopWidth"],["Bottom","borderBottomColor","borderBottomWidth"],["Left","borderLeftColor","borderLeftWidth"],["Right","borderRightColor","borderRightWidth"]].map(([d,u,p])=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:o(`pptx.table.border${d}`)}),jsxRuntime.jsxs("div",{className:"flex gap-1 items-center",children:[jsxRuntime.jsx(Lo,{disabled:!n,value:et(l[u],"#374151"),className:"w-7 h-6 rounded border border-border bg-transparent cursor-pointer shrink-0",onCommit:h=>c({[u]:h})}),jsxRuntime.jsx("input",{type:"number",disabled:!n,className:ie(an,"w-14"),min:0,max:10,value:l[p]??1,onChange:h=>c({[p]:Number(h.target.value)})})]})]},d))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie(xr,"text-center"),onClick:()=>{let d=U4(t,i,s);d&&r({rows:d});},children:o("pptx.table.mergeRight")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie(xr,"text-center"),onClick:()=>{let d=$4(t,i,s);d&&r({rows:d});},children:o("pptx.table.mergeDown")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie(xr,"text-center"),onClick:()=>{let d=H4(t,i,s);d&&r({rows:d});},children:o("pptx.table.split")})]})]})]})}function yfe({tableElement:t,canEdit:e,onUpdateElement:n,tableEditorState:r}){let{t:o}=reactI18next.useTranslation(),i=t.tableData;if(!i)return null;let s=i.rows.length,a=i.columnWidths.length,l=c=>{n({tableData:{...i,...c}});};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.title")}),jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground mb-2",children:o("pptx.table.rowsColumns",{rows:s,cols:a})}),jsxRuntime.jsx("div",{className:"space-y-1",children:[["bandedRows","pptx.table.bandedRows"],["firstRowHeader","pptx.table.headerRow"],["bandedColumns","pptx.table.bandedColumns"],["firstCol","pptx.table.firstColumn"],["lastCol","pptx.table.lastColumn"],["lastRow","pptx.table.lastRow"]].map(([c,d])=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!i[c],onChange:u=>l({[c]:u.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:o(d)})]},c))}),i.bandedRows&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 mt-1",children:[jsxRuntime.jsx("span",{className:"text-[11px] text-muted-foreground",children:o("pptx.table.bandRowCycle")}),jsxRuntime.jsx("input",{type:"number",min:1,max:99,disabled:!e,value:i.bandRowCycle??1,onChange:c=>l({bandRowCycle:Math.max(1,parseInt(c.target.value,10)||1)}),className:"w-14 rounded border border-border bg-background px-1 py-0.5 text-[11px]"})]}),i.bandedColumns&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 mt-1",children:[jsxRuntime.jsx("span",{className:"text-[11px] text-muted-foreground",children:o("pptx.table.bandColCycle")}),jsxRuntime.jsx("input",{type:"number",min:1,max:99,disabled:!e,value:i.bandColCycle??1,onChange:c=>l({bandColCycle:Math.max(1,parseInt(c.target.value,10)||1)}),className:"w-14 rounded border border-border bg-background px-1 py-0.5 text-[11px]"})]})]}),jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.stylePresets")}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:z4.map(c=>jsxRuntime.jsx("button",{type:"button",disabled:!e,title:c.label,"aria-label":c.label,className:"rounded border border-border hover:border-primary overflow-hidden h-10 transition-colors",onClick:()=>{let d=i.rows.map((u,p)=>({...u,cells:u.cells.map(h=>({...h,style:{...h.style,backgroundColor:p===0&&i.firstRowHeader?c.headerBg:i.bandedRows&&(p-(i.firstRowHeader?1:0))%2===0?c.bandBg:void 0,color:p===0&&i.firstRowHeader?c.headerFg:h.style?.color,bold:p===0&&i.firstRowHeader?true:h.style?.bold,borderColor:c.borderColor}}))}));l({rows:d});},children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:c.headerBg}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:c.bandBg}}),jsxRuntime.jsx("div",{className:"flex-1 border-t",style:{borderColor:c.borderColor}})]})},c.id))})]}),jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.columnWidths")}),jsxRuntime.jsx("button",{type:"button",className:xr,disabled:!e,onClick:()=>{let c=1/a;l({columnWidths:Array(a).fill(c)});},children:o("pptx.table.even")})]}),jsxRuntime.jsx("div",{className:"space-y-1",children:i.columnWidths.map((c,d)=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-6 text-muted-foreground shrink-0",children:d+1}),jsxRuntime.jsx("input",{type:"range",disabled:!e,min:5,max:80,value:Math.round(c*100),className:"flex-1 accent-primary",onChange:u=>{let p=Number(u.target.value)/100,h=i.columnWidths[d],f=p-h,m=[...i.columnWidths];m[d]=p;let x=1-h;if(x>0)for(let b=0;b<m.length;b++)b!==d&&(m[b]=Math.max(.05,i.columnWidths[b]-f*(i.columnWidths[b]/x)));let g=m.reduce((b,v)=>b+v,0),y=m.map(b=>b/g);l({columnWidths:y});}}),jsxRuntime.jsxs("span",{className:"w-10 text-right text-muted-foreground",children:[Math.round(c*100),"%"]})]},d))})]}),jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.rowHeights")}),jsxRuntime.jsx("button",{type:"button",className:xr,disabled:!e,onClick:()=>{let c=Math.round(i.rows.reduce((d,u)=>d+(u.height??32),0)/s);l({rows:i.rows.map(d=>({...d,height:c}))});},children:o("pptx.table.even")})]}),jsxRuntime.jsx("div",{className:"space-y-1",children:i.rows.map((c,d)=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-6 text-muted-foreground shrink-0",children:d+1}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:an,min:16,max:500,value:c.height??32,onChange:u=>{let p=i.rows.map((h,f)=>f===d?{...h,height:Number(u.target.value)}:h);l({rows:p});}}),jsxRuntime.jsx("span",{className:"w-6 text-muted-foreground",children:"px"})]},d))})]}),r&&jsxRuntime.jsx(xfe,{tableData:i,tableEditorState:r,canEdit:e,onUpdateTableData:l})]})}function bfe({selectedElement:t,canEdit:e,slides:n,tableEditorState:r,mediaDataUrls:o,onUpdateElement:i,onUpdateElementStyle:s,onUpdateTextStyle:a,onMoveLayer:l}){let{t:c}=reactI18next.useTranslation(),d=!!(t.locks?.noMove||t.locks?.noSelect),u=()=>{e&&i(d?{locks:void 0}:{locks:{noMove:true,noResize:true,noSelect:true}});};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:Gt,children:c("pptx.inspector.element")}),jsxRuntime.jsx("button",{type:"button",onClick:u,disabled:!e,title:c(d?"pptx.inspector.unlock":"pptx.inspector.lock"),className:"p-1 rounded hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":d,children:d?jsxRuntime.jsx(lu$1.LuLock,{className:"w-3.5 h-3.5 text-amber-400"}):jsxRuntime.jsx(lu$1.LuLockOpen,{className:"w-3.5 h-3.5 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:$pe.map(([p,h])=>jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"w-4 text-muted-foreground",children:p}),jsxRuntime.jsx("input",{type:"number",className:an,disabled:!e,value:Math.round(t[h]??0),onChange:f=>i({[h]:Number(f.target.value)})})]},h))})]}),t.type==="table"&&jsxRuntime.jsx(yfe,{tableElement:t,canEdit:e,onUpdateElement:i,tableEditorState:r}),t.type==="chart"&&jsxRuntime.jsx(Che,{selectedElement:t,canEdit:e,onUpdateElement:i}),t.type==="smartArt"&&t.smartArtData&&jsxRuntime.jsx(mfe,{smartArtData:t.smartArtData,canEdit:e,onUpdateElement:i,box:{width:t.width,height:t.height}}),Vo(t)&&jsxRuntime.jsx($he,{selectedElement:t,canEdit:e,onUpdateElement:i}),t.type==="media"&&jsxRuntime.jsx(Jhe,{element:t,mediaDataUrls:o??new Map,canEdit:e,onUpdateElement:i}),jsxRuntime.jsx(Mhe,{selectedElement:t,canEdit:e,onUpdateElementStyle:s}),jsxRuntime.jsx(_he,{selectedElement:t}),jsxRuntime.jsx(Phe,{selectedElement:t}),jsxRuntime.jsx(Qhe,{selectedElement:t,canEdit:e,onUpdateElement:i,onUpdateElementStyle:s,onUpdateTextStyle:a}),jsxRuntime.jsx(zpe,{selectedElement:t,slides:n,canEdit:e,onUpdateElement:i}),jsxRuntime.jsx(Ehe,{selectedElement:t,canEdit:e,onUpdateElement:i}),jsxRuntime.jsx(Ahe,{canEdit:e,onMoveLayer:l})]})}function sG({comment:t,canEdit:e,activeSlide:n,editingCommentId:r,commentEditDraft:o,replyingToCommentId:i,replyDraftByCommentId:s,onStartEditComment:a,onSaveEditComment:l,onCancelEditComment:c,onSetCommentEditDraft:d,onDeleteComment:u,onToggleCommentResolved:p,onStartReply:h,onCancelReply:f,onReplyDraftChange:m,onSubmitReply:x,onSelectElement:g,depth:y=0}){let{t:b}=reactI18next.useTranslation(),v=r===t.id,S=i===t.id,w=s[t.id]??"",[C,T]=Jm.useState(true),M=t.replies??[],_=t.elementId?n?.elements?.find(E=>E.id===t.elementId)??null:null;return jsxRuntime.jsxs("div",{className:ie("rounded border border-border bg-card p-2",y>0&&"ml-3 border-l-2 border-l-primary/40"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[jsxRuntime.jsx("span",{className:"text-[11px] font-medium text-foreground truncate",children:t.author||"Author"}),t.resolved&&jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-full bg-green-900/40 px-1.5 py-0.5 text-[9px] font-medium text-green-300 flex-shrink-0",children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"h-2.5 w-2.5"}),b("pptx.comments.resolved")]})]}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:q4(t.createdAt)})]}),t.elementId&&(_?jsxRuntime.jsxs("button",{type:"button",className:"mt-1 inline-flex items-center gap-1 rounded bg-primary/20 px-1.5 py-0.5 text-[10px] text-primary hover:bg-primary/30 transition-colors",title:b("pptx.comments.commentingOn",{element:ii(_)}),onClick:()=>g(_.id),children:[jsxRuntime.jsx(lu$1.LuType,{className:"h-2.5 w-2.5"}),ii(_)]}):jsxRuntime.jsx("span",{className:"mt-1 inline-flex items-center gap-1 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:b("pptx.comments.deletedElement")})),v?jsxRuntime.jsxs("div",{className:"mt-1.5 space-y-1.5",children:[jsxRuntime.jsx("textarea",{value:o,onChange:E=>d(E.target.value),rows:3,className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground outline-none focus:border-primary resize-y"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[11px] text-white hover:bg-primary/80 disabled:opacity-40 disabled:cursor-not-allowed",onClick:()=>l(t.id),disabled:String(o).trim().length===0,children:b("pptx.comments.save")}),jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent",onClick:c,children:b("pptx.comments.cancel")})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"mt-1 whitespace-pre-wrap break-words text-[11px] text-foreground",children:t.text}),e&&jsxRuntime.jsxs("div",{className:"mt-1.5 inline-flex items-center rounded bg-muted overflow-hidden",children:[jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center justify-center p-1.5 hover:bg-accent text-foreground hover:text-foreground transition-colors",onClick:()=>a(t.id),title:b("pptx.comments.edit"),children:jsxRuntime.jsx(lu$1.LuPencil,{className:"h-3 w-3"})}),h&&y===0&&jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center justify-center p-1.5 border-l border-border hover:bg-accent text-foreground hover:text-foreground transition-colors",onClick:()=>h(t.id),title:b("pptx.comments.reply"),children:jsxRuntime.jsx(lu$1.LuReply,{className:"h-3 w-3"})}),p&&jsxRuntime.jsx("button",{type:"button",className:ie("inline-flex items-center justify-center p-1.5 border-l border-border transition-colors",t.resolved?"bg-green-900/40 text-green-300 hover:bg-green-900/60":"hover:bg-accent text-foreground hover:text-foreground"),onClick:()=>p(t.id),title:t.resolved?b("pptx.comments.unresolve"):b("pptx.comments.resolve"),children:jsxRuntime.jsx(lu$1.LuCheck,{className:"h-3 w-3"})}),jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center justify-center p-1.5 border-l border-border hover:bg-red-900/40 text-muted-foreground hover:text-red-300 transition-colors",onClick:()=>u(t.id),title:b("pptx.comments.delete"),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"h-3 w-3"})})]})]}),M.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",onClick:()=>T(E=>!E),children:[C?jsxRuntime.jsx(lu$1.LuChevronDown,{className:"h-3 w-3"}):jsxRuntime.jsx(lu$1.LuChevronRight,{className:"h-3 w-3"}),b("pptx.comments.repliesCount",{count:M.length})]}),C&&jsxRuntime.jsx("div",{className:"mt-1.5 space-y-1.5",children:M.map((E,R)=>jsxRuntime.jsx(sG,{comment:E,canEdit:e,activeSlide:n,editingCommentId:r,commentEditDraft:o,replyingToCommentId:i,replyDraftByCommentId:s,onStartEditComment:a,onSaveEditComment:l,onCancelEditComment:c,onSetCommentEditDraft:d,onDeleteComment:u,onToggleCommentResolved:p,onStartReply:h,onCancelReply:f,onReplyDraftChange:m,onSubmitReply:x,onSelectElement:g,depth:y+1},`${E.id}-${R}`))})]}),S&&f&&m&&x&&jsxRuntime.jsxs("div",{className:"mt-2 space-y-1.5 pl-3 border-l-2 border-l-primary/40",children:[jsxRuntime.jsx("textarea",{value:w,onChange:E=>m(t.id,E.target.value),rows:2,placeholder:b("pptx.comments.replyPlaceholder",{author:t.author||"Author"}),className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground outline-none focus:border-primary resize-y",onKeyDown:E=>{E.key==="Enter"&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),x(t.id));}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[11px] text-white hover:bg-primary/80 disabled:opacity-40 disabled:cursor-not-allowed",onClick:()=>x(t.id),disabled:w.trim().length===0,children:[jsxRuntime.jsx(lu$1.LuReply,{className:"h-3 w-3"}),b("pptx.comments.addReply")]}),jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent",onClick:f,children:b("pptx.comments.cancel")})]})]})]})}function wfe({comments:t,canEdit:e,activeSlide:n,selectedElement:r,editingCommentId:o,commentEditDraft:i,commentDraft:s,replyingToCommentId:a,replyDraftByCommentId:l,onSetCommentDraft:c,onAddComment:d,onDeleteComment:u,onStartEditComment:p,onSaveEditComment:h,onCancelEditComment:f,onSetCommentEditDraft:m,onToggleCommentResolved:x,onStartReply:g,onCancelReply:y,onReplyDraftChange:b,onSubmitReply:v,onSelectElement:S}){let{t:w}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:w("pptx.comments.slideComments")}),jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground",children:t.length})]}),t.length===0?jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:w("pptx.comments.noComments")}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-[42vh] overflow-y-auto pr-1",children:t.map((T,M)=>jsxRuntime.jsx(sG,{comment:T,canEdit:e,activeSlide:n,editingCommentId:o,commentEditDraft:i,replyingToCommentId:a,replyDraftByCommentId:l,onStartEditComment:p,onSaveEditComment:h,onCancelEditComment:f,onSetCommentEditDraft:m,onDeleteComment:u,onToggleCommentResolved:x,onStartReply:g,onCancelReply:y,onReplyDraftChange:b,onSubmitReply:v,onSelectElement:S},`${T.id}-${M}`))}),e&&jsxRuntime.jsxs("div",{className:"space-y-1.5 pt-1 border-t border-border",children:[r&&jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-1 rounded bg-primary/20 px-1.5 py-0.5 text-[10px] text-primary",children:[jsxRuntime.jsx(lu$1.LuType,{className:"h-2.5 w-2.5"}),w("pptx.comments.commentingOn",{element:ii(r)})]}),jsxRuntime.jsx("textarea",{rows:2,placeholder:r?w("pptx.comments.addOnElement",{element:ii(r)}):w("pptx.comments.addPlaceholder"),value:s,className:"w-full bg-muted border border-border rounded px-2 py-1 text-xs resize-y outline-none focus:border-primary",onChange:T=>c(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),d());}}),jsxRuntime.jsxs("button",{type:"button",onClick:d,disabled:!s.trim(),className:ie("w-full inline-flex items-center justify-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",s.trim()?"bg-primary hover:bg-primary/80 text-white":"bg-muted text-muted-foreground cursor-not-allowed"),children:[jsxRuntime.jsx(lu$1.LuMessageSquare,{className:"w-3.5 h-3.5"}),w("pptx.comments.addComment")]})]})]})}function aG({label:t,value:e}){return jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{children:t}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:e})]})}function ZN({label:t,disabled:e,value:n,onChange:r}){return jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:t}),jsxRuntime.jsx("input",{type:"text",className:an,disabled:e,value:n,onChange:o=>r(o.target.value)})]})}function Olt({customProperties:t,canEdit:e,onUpdate:n}){return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Custom Properties"}),e&&jsxRuntime.jsx("button",{type:"button",className:xr,onClick:()=>n([...t,{name:`Property ${t.length+1}`,value:"",type:"lpwstr"}]),children:"Add"})]}),t.length===0?jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground",children:"No custom properties"}):t.map((r,o)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr,1fr,auto] gap-1",children:[jsxRuntime.jsx("input",{type:"text",className:an,disabled:!e,value:r.name,onChange:i=>n(t.map((s,a)=>a===o?{...s,name:i.target.value}:s))}),jsxRuntime.jsx("input",{type:"text",className:an,disabled:!e,value:r.value,onChange:i=>n(t.map((s,a)=>a===o?{...s,value:i.target.value}:s))}),e&&jsxRuntime.jsx("button",{type:"button",className:ie(xr,"px-1.5 text-red-400 hover:text-red-300"),onClick:()=>n(t.filter((i,s)=>s!==o)),children:"\xD7"})]},`${r.name}-${o}`))]})}function Tfe({notesCanvasSize:t,notesMaster:e,handoutMaster:n}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Notes & Handout"}),jsxRuntime.jsxs("div",{className:"space-y-1 text-[11px] text-muted-foreground",children:[jsxRuntime.jsx(aG,{label:"Notes Size",value:t?`${t.width} \xD7 ${t.height}px`:"Not available"}),jsxRuntime.jsx(aG,{label:"Notes Master",value:e?`${e.placeholders?.length??0} placeholders`:"Not available"}),jsxRuntime.jsx(aG,{label:"Handout Master",value:n?`${n.placeholders?.length??0} placeholders`:"Not available"})]})]})}function Cfe({coreProperties:t,appProperties:e,customProperties:n,canEdit:r,onUpdateCoreProperties:o,onUpdateAppProperties:i,onUpdateCustomProperties:s}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Document"}),jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px] text-muted-foreground",children:[jsxRuntime.jsx(ZN,{label:"Title",disabled:!r,value:t?.title??"",onChange:a=>o({title:a})}),jsxRuntime.jsx(ZN,{label:"Author",disabled:!r,value:t?.creator??"",onChange:a=>o({creator:a})}),jsxRuntime.jsx(ZN,{label:"Company",disabled:!r,value:e?.company??"",onChange:a=>i({company:a})}),jsxRuntime.jsx(ZN,{label:"Application",disabled:!r,value:e?.application??"",onChange:a=>i({application:a})}),jsxRuntime.jsx(Olt,{customProperties:n,canEdit:r,onUpdate:s})]})]})}function JN({label:t,disabled:e,checked:n,onChange:r}){return jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:t}),jsxRuntime.jsx("input",{type:"checkbox",disabled:e,checked:n,onChange:o=>r(o.target.checked)})]})}function Mfe({presentationProperties:t,canEdit:e,onUpdate:n}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Presentation"}),jsxRuntime.jsxs("div",{className:"space-y-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Show Type"}),jsxRuntime.jsxs("select",{disabled:!e,className:ie(an,"w-28"),value:t.showType??"presented",onChange:r=>n({showType:r.target.value}),children:[jsxRuntime.jsx("option",{value:"presented",children:"Presented"}),jsxRuntime.jsx("option",{value:"browsed",children:"Browsed"}),jsxRuntime.jsx("option",{value:"kiosk",children:"Kiosk"})]})]}),jsxRuntime.jsx(JN,{label:"Loop Continuously",disabled:!e,checked:!!t.loopContinuously,onChange:r=>n({loopContinuously:r})}),jsxRuntime.jsx(JN,{label:"Show Narration",disabled:!e,checked:t.showWithNarration!==false,onChange:r=>n({showWithNarration:r})}),jsxRuntime.jsx(JN,{label:"Show Animation",disabled:!e,checked:t.showWithAnimation!==false,onChange:r=>n({showWithAnimation:r})}),jsxRuntime.jsx(JN,{label:"Frame Slides",disabled:!e,checked:!!t.printFrameSlides,onChange:r=>n({printFrameSlides:r})}),jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Slides/Page"}),jsxRuntime.jsx("input",{type:"number",min:1,max:16,disabled:!e,className:ie(an,"w-20"),value:t.printSlidesPerPage??1,onChange:r=>n({printSlidesPerPage:Number(r.target.value)})})]})]})]})}function _fe({themeOptions:t,selectedThemePath:e,setSelectedThemePath:n,canEdit:r,onApplyTheme:o}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Theme"}),jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Theme"}),jsxRuntime.jsx("select",{disabled:t.length===0,className:an,value:e,onChange:i=>n(i.target.value),children:t.length===0?jsxRuntime.jsx("option",{value:"",children:"No themes"}):t.map(i=>jsxRuntime.jsx("option",{value:i.path,children:i.name||i.path.split("/").pop()},i.path))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsx("button",{type:"button",className:xr,disabled:!r||!e,onClick:()=>o(e,false),children:"Apply First Master"}),jsxRuntime.jsx("button",{type:"button",className:xr,disabled:!r||!e,onClick:()=>o(e,true),children:"Apply All Masters"})]})]})]})}function Pfe({canvasSize:t,canEdit:e,onUpdate:n}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Slide Size"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[["W","width"],["H","height"]].map(([r,o])=>jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r}),jsxRuntime.jsx("input",{type:"number",className:an,disabled:!e,value:t[o],onChange:i=>n({...t,[o]:Number(i.target.value)})})]},o))})]})}bt();var Efe={bg1:"Background 1",tx1:"Text 1",bg2:"Background 2",tx2:"Text 2",accent1:"Accent 1",accent2:"Accent 2",accent3:"Accent 3",accent4:"Accent 4",accent5:"Accent 5",accent6:"Accent 6",hlink:"Hyperlink",folHlink:"Followed Hyperlink"};function Afe({activeSlide:t,theme:e,canEdit:n,onUpdateSlide:r}){let{t:o}=reactI18next.useTranslation(),i=t?.clrMapOverride,s=kD(i),a=Jm.useMemo(()=>[...hc],[]),l=Jm.useCallback(u=>{if(u){let p={};for(let h of fc)p[h]=mc[h];r({clrMapOverride:p});}else r({clrMapOverride:void 0});},[r]),c=Jm.useCallback((u,p)=>{let f={...i??{},[u]:p};for(let m of fc)f[m]||(f[m]=mc[m]);r({clrMapOverride:f});},[i,r]),d=Jm.useCallback(u=>e?.colorScheme?e.colorScheme[u]:void 0,[e]);return t?jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"inline-flex items-center gap-2 text-xs",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!n,checked:s,onChange:u=>l(u.target.checked)}),o("pptx.themeOverride.enableOverride")]}),s&&i&&jsxRuntime.jsx("div",{className:"space-y-1.5",children:fc.map(u=>{let p=i[u]??mc[u],h=d(p);return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-24 truncate text-muted-foreground",title:Efe[u],children:Efe[u]}),jsxRuntime.jsx("div",{className:"h-4 w-4 rounded-sm border border-border shrink-0",style:{backgroundColor:h?`#${h.replace(/^#/,"")}`:void 0}}),jsxRuntime.jsx("select",{disabled:!n,className:"flex-1 bg-muted border border-border rounded px-1 py-0.5 text-[11px]",value:p,onChange:f=>c(u,f.target.value),children:a.map(f=>jsxRuntime.jsx("option",{value:f,children:f},f))})]},u)})})]}):null}function Rfe({tagCollections:t,onUpdateTagCollections:e,canEdit:n}){let{t:r}=reactI18next.useTranslation(),[o,i]=Jm.useState(true),s=t.flatMap((d,u)=>d.tags.map((p,h)=>({...p,colIdx:u,tagIdx:h}))),a=(d,u,p,h)=>{let f=t.map((m,x)=>x!==d?m:{...m,tags:m.tags.map((g,y)=>y===u?{...g,[p]:h}:g)});e(f);},l=(d,u)=>{let p=t.map((h,f)=>f!==d?h:{...h,tags:h.tags.filter((m,x)=>x!==u)});e(p);},c=()=>{if(t.length===0)e([{path:"ppt/tags/tag1.xml",tags:[{name:"",value:""}]}]);else {let d=t.map((u,p)=>p!==0?u:{...u,tags:[...u.tags,{name:"",value:""}]});e(d);}};return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1 w-full",onClick:()=>i(!o),children:[o?jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-3 h-3 text-muted-foreground"}):jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3 text-muted-foreground"}),jsxRuntime.jsx("span",{className:Gt,children:r("pptx.tags.title")}),jsxRuntime.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:s.length})]}),!o&&jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[s.length===0?jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground",children:r("pptx.tags.noTags")}):s.map((d,u)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr,1fr,auto] gap-1 text-[11px]",children:[jsxRuntime.jsx("input",{type:"text",className:an,disabled:!n,placeholder:r("pptx.tags.name"),value:d.name,onChange:p=>a(d.colIdx,d.tagIdx,"name",p.target.value)}),jsxRuntime.jsx("input",{type:"text",className:an,disabled:!n,placeholder:r("pptx.tags.value"),value:d.value,onChange:p=>a(d.colIdx,d.tagIdx,"value",p.target.value)}),n&&jsxRuntime.jsx("button",{type:"button",className:ie(xr,"px-1.5 text-red-400 hover:text-red-300"),title:r("pptx.tags.deleteTag"),onClick:()=>l(d.colIdx,d.tagIdx),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"})})]},`${d.colIdx}-${d.tagIdx}-${u}`)),n&&jsxRuntime.jsx("button",{type:"button",className:xr,onClick:c,children:r("pptx.tags.addTag")})]})]})}function kfe({presentationProperties:t,canEdit:e,onUpdatePresentationProperties:n,themeOptions:r,selectedThemePath:o,setSelectedThemePath:i,onApplyTheme:s,activeSlide:a,theme:l,onUpdateSlide:c,canvasSize:d,onUpdateCanvasSize:u,notesCanvasSize:p,notesMaster:h,handoutMaster:f,coreProperties:m,onUpdateCoreProperties:x,appProperties:g,onUpdateAppProperties:y,customProperties:b,onUpdateCustomProperties:v,tagCollections:S,onUpdateTagCollections:w}){let{t:C}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Mfe,{presentationProperties:t,canEdit:e,onUpdate:n}),jsxRuntime.jsx(_fe,{themeOptions:r,selectedThemePath:o,setSelectedThemePath:i,canEdit:e,onApplyTheme:s}),jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:C("pptx.themeOverride.heading")}),jsxRuntime.jsx(Afe,{activeSlide:a,theme:l,canEdit:e,onUpdateSlide:c})]}),jsxRuntime.jsx(Pfe,{canvasSize:d,canEdit:e,onUpdate:u}),jsxRuntime.jsx(Tfe,{notesCanvasSize:p,notesMaster:h,handoutMaster:f}),jsxRuntime.jsx(Cfe,{coreProperties:m,appProperties:g,customProperties:b,canEdit:e,onUpdateCoreProperties:x,onUpdateAppProperties:y,onUpdateCustomProperties:v}),S&&w&&jsxRuntime.jsx(Rfe,{tagCollections:S,onUpdateTagCollections:w,canEdit:e}),a&&jsxRuntime.jsxs("div",{className:ie(Zt,"space-y-1"),children:[jsxRuntime.jsx("div",{className:Gt,children:"Slide"}),jsxRuntime.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[a.elements?.length??0," elements"]})]})]})}function Ife({activeSlide:t,canEdit:e,onUpdateSlide:n,editTemplateMode:r,slideMasters:o,onSetTemplateBackground:i,onGetTemplateBackgroundColor:s}){let a=Jm.useRef(null);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:ie(Zt,"space-y-2"),children:[jsxRuntime.jsx("div",{className:Gt,children:"Background"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-10 shrink-0",children:"Colour"}),jsxRuntime.jsx(Lo,{value:et(t.backgroundColor,"#ffffff"),disabled:!e,className:"h-6 w-8 rounded border border-border bg-muted cursor-pointer",onCommit:l=>n({backgroundColor:l})}),jsxRuntime.jsx("span",{className:"text-muted-foreground text-[10px] truncate",children:t.backgroundColor||"none"})]}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-10 shrink-0",children:"Image"}),jsxRuntime.jsx("input",{ref:a,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp,image/svg+xml",className:"hidden",disabled:!e,onChange:l=>{let c=l.target.files?.[0];if(!c)return;let d=new FileReader;d.onload=()=>{typeof d.result=="string"&&n({backgroundImage:d.result});},d.readAsDataURL(c),l.target.value="";}}),jsxRuntime.jsx("button",{type:"button",className:ie(xr,"flex-1 text-center"),disabled:!e,onClick:()=>a.current?.click(),children:t.backgroundImage?"Replace Image":"Choose Image"})]}),t.backgroundImage&&jsxRuntime.jsxs("div",{className:"relative mt-1",children:[jsxRuntime.jsx("img",{src:t.backgroundImage,alt:"Background preview",className:"w-full h-16 object-cover rounded border border-border"}),jsxRuntime.jsx("button",{type:"button",className:"absolute top-0.5 right-0.5 rounded bg-background/80 hover:bg-red-700 p-0.5 text-[10px] transition-colors",disabled:!e,title:"Remove background image",onClick:()=>n({backgroundImage:void 0}),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-3 h-3"})})]})]}),(t.backgroundColor||t.backgroundImage||t.backgroundGradient)&&jsxRuntime.jsx("button",{type:"button",className:ie(xr,"w-full text-center text-red-400 hover:text-red-300"),disabled:!e,onClick:()=>n({backgroundColor:void 0,backgroundImage:void 0,backgroundGradient:void 0}),children:"Clear Background"})]}),r&&i&&s&&jsxRuntime.jsx(Ylt,{activeSlide:t,slideMasters:o,canEdit:e,onSetTemplateBackground:i,onGetTemplateBackgroundColor:s})]})}function Ylt({activeSlide:t,slideMasters:e,canEdit:n,onSetTemplateBackground:r,onGetTemplateBackgroundColor:o}){return jsxRuntime.jsxs("div",{className:ie(Zt,"space-y-2"),children:[jsxRuntime.jsx("div",{className:Gt,children:"Template Backgrounds"}),t.layoutPath&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-14 shrink-0 truncate",title:t.layoutName??t.layoutPath,children:"Layout"}),jsxRuntime.jsx(Lo,{value:et(o(t.layoutPath),"#ffffff"),disabled:!n,className:"h-6 w-8 rounded border border-border bg-muted cursor-pointer",onCommit:i=>r(t.layoutPath,i)}),jsxRuntime.jsx("span",{className:"text-muted-foreground text-[10px] truncate",children:t.layoutName??"Layout"})]}),(()=>{let i=e?.find(s=>s.layoutPaths?.includes(t.layoutPath??""));return i?jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-14 shrink-0 truncate",title:i.name??i.path,children:"Master"}),jsxRuntime.jsx(Lo,{value:et(o(i.path),"#ffffff"),disabled:!n,className:"h-6 w-8 rounded border border-border bg-muted cursor-pointer",onCommit:s=>r(i.path,s)}),jsxRuntime.jsx("span",{className:"text-muted-foreground text-[10px] truncate",children:i.name??"Master"})]}):null})()]})}function uG(t){let{isOpen:e,canEdit:n,activeSlide:r,slides:o,canvasSize:i,selectedElement:s,selectedElementIds:a,tableEditorState:l,activeTab:c,onSetActiveTab:d,onClose:u,onUpdateElement:p,onSelectElement:h,onMoveLayer:f,presentationProperties:m,onUpdatePresentationProperties:x,notesMaster:g,handoutMaster:y,notesCanvasSize:b,coreProperties:v,appProperties:S,customProperties:w,themeOptions:C,onUpdateCoreProperties:T,onUpdateAppProperties:M,onUpdateCustomProperties:_,tagCollections:E,onUpdateTagCollections:R,onApplyTheme:I,comments:L,commentDraft:k,editingCommentId:F,commentEditDraft:N,onSetCommentDraft:D,onAddComment:U,onDeleteComment:G,onStartEditComment:j,onSaveEditComment:Y,onCancelEditComment:ge,onSetCommentEditDraft:fe,onToggleCommentResolved:de,onStartReply:J,onCancelReply:re,onReplyDraftChange:ce,onSubmitReply:ae,replyingToCommentId:_e,replyDraftByCommentId:xe,onUpdateCanvasSize:Ee,onUpdateElementStyle:W,onUpdateTextStyle:q,onUpdateSlide:Q,editTemplateMode:se,slideMasters:me,onSetTemplateBackground:P,onGetTemplateBackgroundColor:A,mediaDataUrls:O,theme:z,panelWidth:te}=t,$=s!==null,{t:Me}=reactI18next.useTranslation(),{dragY:De,handlers:V}=Lu(u),[B,ee]=Jm.useState(""),oe=80,pe=500,Ae=220,[Le,ue]=Jm.useState(Ae),we=Jm.useCallback(Ie=>{ue(He=>Math.min(pe,Math.max(oe,He-Ie)));},[]);return Jm.useEffect(()=>{let Ie=me?.[0]?.themePath;if(Ie&&Ie.length>0){ee(Ie);return}let He=C[0]?.path??"";ee(Oe=>Oe||He);},[me,C]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx("button",{type:"button","aria-label":Me("common.close"),onClick:u,className:"md:hidden fixed inset-0 z-20 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150"}),jsxRuntime.jsxs("div",{className:ie("bg-background flex flex-col text-xs text-foreground shadow-xl","max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[75dvh] max-md:rounded-t-2xl max-md:border-t max-md:border-border max-md:z-30 max-md:pb-[max(env(safe-area-inset-bottom),0px)]","max-md:transition-transform max-md:duration-200 max-md:ease-in-out",e?"max-md:translate-y-0":"max-md:translate-y-full","md:h-full md:border-l md:border-border",!te&&"md:w-72"),style:{...te?{width:te}:{},...De>0?{transform:`translateY(${De}px)`,transition:"none"}:{}},children:[jsxRuntime.jsx("div",{className:"md:hidden flex items-center justify-center pt-3 pb-2 cursor-grab active:cursor-grabbing touch-none",onPointerDown:V.onPointerDown,onPointerMove:V.onPointerMove,onPointerUp:V.onPointerUp,onPointerCancel:V.onPointerCancel,children:jsxRuntime.jsx("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/40"})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-1 rounded bg-muted p-0.5",children:Upe.map(({key:Ie,label:He,icon:Oe})=>jsxRuntime.jsxs("button",{type:"button",title:He,className:ie("flex items-center gap-1 px-2 py-1 rounded text-[11px] transition-colors",c===Ie?"bg-primary text-white":"text-muted-foreground hover:text-foreground hover:bg-accent"),onClick:()=>d(Ie),children:[jsxRuntime.jsx(Oe,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:He})]},Ie))}),jsxRuntime.jsx("button",{type:"button",onClick:u,title:Me("common.close"),className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[c==="elements"&&jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:ie(Gt,"mb-2"),children:Me("pptx.inspector.layerOrder")}),r?[...r.elements||[]].reverse().map((Ie,He)=>{let Oe=(r.elements||[]).length-1-He,$e=s?.id===Ie.id||a.includes(Ie.id),ot=(ze(Ie)?(Ie.text||"").slice(0,24):void 0)||Ie.type;return jsxRuntime.jsxs("div",{title:`${Ie.type} \u2014 ${Ie.id}`,className:ie("flex items-center gap-2 px-2 py-1 rounded cursor-pointer transition-colors",$e?"bg-primary/30 text-primary":"hover:bg-muted text-foreground"),onClick:()=>h(Ie.id),children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-4 text-right",children:Oe+1}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:ot})]},Ie.id)}):jsxRuntime.jsx("div",{className:"text-muted-foreground italic",children:Me("pptx.inspector.noSlideSelected")})]}),c==="properties"&&jsxRuntime.jsx("div",{className:"space-y-3",children:$&&s?jsxRuntime.jsx(bfe,{selectedElement:s,canEdit:n,slides:o,tableEditorState:l,mediaDataUrls:O,onUpdateElement:p,onUpdateElementStyle:W,onUpdateTextStyle:q,onMoveLayer:f}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(kfe,{canEdit:n,canvasSize:i,presentationProperties:m,onUpdatePresentationProperties:x,notesMaster:g,handoutMaster:y,notesCanvasSize:b,coreProperties:v,appProperties:S,customProperties:w,themeOptions:C,selectedThemePath:B,setSelectedThemePath:ee,onApplyTheme:I,onUpdateCoreProperties:T,onUpdateAppProperties:M,onUpdateCustomProperties:_,tagCollections:E,onUpdateTagCollections:R,onUpdateCanvasSize:Ee,activeSlide:r,theme:z,onUpdateSlide:Q}),r&&jsxRuntime.jsx(Ife,{activeSlide:r,canEdit:n,onUpdateSlide:Q,editTemplateMode:se,slideMasters:me,onSetTemplateBackground:P,onGetTemplateBackgroundColor:A})]})}),c==="comments"&&jsxRuntime.jsx(wfe,{comments:L,canEdit:n,activeSlide:r,selectedElement:s,editingCommentId:F,commentEditDraft:N,commentDraft:k,replyingToCommentId:_e??null,replyDraftByCommentId:xe??{},onSetCommentDraft:D,onAddComment:U,onDeleteComment:G,onStartEditComment:j,onSaveEditComment:Y,onCancelEditComment:ge,onSetCommentEditDraft:fe,onToggleCommentResolved:de,onStartReply:J,onCancelReply:re,onReplyDraftChange:ce,onSubmitReply:ae,onSelectElement:h})]}),$&&s&&r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(yu,{direction:"vertical",onResize:we}),jsxRuntime.jsx("div",{className:"border-t border-border p-3 overflow-y-auto flex-shrink-0",style:{height:Le},children:jsxRuntime.jsx(Bpe,{selectedElement:s,activeSlide:r,canEdit:n,onUpdateSlide:Q})})]})]})]})}function ect(t){if(t.length===0)return "";let e=t[0],n=`M ${e.x} ${e.y}`;for(let r=1;r<t.length;r++){let o=t[r];n+=` L ${o.x} ${o.y}`;}return n}function tct(t){switch(t){case "laser":return "none";case "pen":return "crosshair";case "highlighter":return "crosshair";case "eraser":return "crosshair";default:return "default"}}function hG({canvasSize:t,editorScale:e,presentationTool:n,annotationStrokes:r,currentStroke:o,laserPosition:i,onPointerDown:s,onPointerMove:a,onPointerUp:l,onLaserMove:c,onLaserLeave:d,onEraseAtPoint:u}){let p=Jm.useRef(null),h=Jm.useRef(false),f=Jm.useCallback((v,S)=>{let w=p.current;if(!w)return null;let C=w.getBoundingClientRect(),T=(v-C.left)/e,M=(S-C.top)/e;return {x:T,y:M}},[e]),m=Jm.useCallback(v=>{if(n==="none")return;v.preventDefault(),v.stopPropagation();let S=f(v.clientX,v.clientY);if(S){if(n==="eraser"){h.current=true,u(S.x,S.y);return}(n==="pen"||n==="highlighter")&&s(S.x,S.y);}},[n,f,s,u]),x=Jm.useCallback(v=>{if(n==="none")return;let S=f(v.clientX,v.clientY);if(S){if(n==="laser"){c(S.x,S.y);return}if(n==="eraser"&&h.current){u(S.x,S.y);return}(n==="pen"||n==="highlighter")&&a(S.x,S.y);}},[n,f,a,c,u]),g=Jm.useCallback(v=>{if(n!=="none"){if(v.preventDefault(),n==="eraser"){h.current=false;return}l();}},[n,l]),y=Jm.useCallback(()=>{n==="laser"&&d(),n==="eraser"&&(h.current=false),l();},[n,d,l]);if(n==="none")return null;let b=o?[...r,o]:r;return jsxRuntime.jsxs("div",{className:"absolute inset-0",style:{zIndex:60,cursor:tct(n),pointerEvents:"auto"},children:[jsxRuntime.jsx("svg",{ref:p,className:"absolute",style:{width:t.width,height:t.height,transformOrigin:"top left",transform:`scale(${e})`},viewBox:`0 0 ${t.width} ${t.height}`,onPointerDown:m,onPointerMove:x,onPointerUp:g,onPointerLeave:y,children:b.map(v=>jsxRuntime.jsx("path",{d:ect(v.points),fill:"none",stroke:v.color,strokeWidth:v.width,strokeLinecap:"round",strokeLinejoin:"round",opacity:v.opacity},v.id))}),n==="laser"&&i&&jsxRuntime.jsx("div",{className:"absolute rounded-full pointer-events-none",style:{width:24,height:24,left:i.x*e-12,top:i.y*e-12,backgroundColor:"rgba(255, 0, 0, 0.85)",boxShadow:"0 0 12px 6px rgba(255, 0, 0, 0.5), 0 0 24px 12px rgba(255, 0, 0, 0.25)",filter:"drop-shadow(0 0 8px rgba(255, 0, 0, 0.7))",zIndex:70}})]})}Pe();var xct=["#ff0000","#0000ff","#00aa00","#ff8800","#ffffff","#000000","#ff00ff","#00cccc"],yct=["#ffff00","#00ff00","#ff69b4","#00bfff","#ff8c00","#adff2f","#ff6347","#87ceeb"];function gG({presentationTool:t,penColor:e,highlighterColor:n,hasAnnotations:r,onSetTool:o,onSetPenColor:i,onSetHighlighterColor:s,onClearAnnotations:a,currentSlideIndex:l,totalSlides:c,onMovePresentationSlide:d,presentationStartTime:u,onEndPresentation:p,onTogglePresenterView:h,presenterMode:f}){let{t:m}=reactI18next.useTranslation(),[x,g]=Jm.useState(false),[y,b]=Jm.useState(false),v=Jm.useRef(null),[S,w]=Jm.useState(Date.now());Jm.useEffect(()=>{if(!u)return;let I=window.setInterval(()=>w(Date.now()),1e3);return ()=>window.clearInterval(I)},[u]);let C=u?S-u:0;Jm.useEffect(()=>{let I=L=>{v.current&&!v.current.contains(L.target)&&(g(false),b(false));};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let T=Jm.useCallback(I=>{o(I),g(false),b(false);},[o]),M=Jm.useCallback(I=>{I.preventDefault(),g(L=>!L),b(false);},[]),_=Jm.useCallback(I=>{I.preventDefault(),b(L=>!L),g(false);},[]),E=I=>`flex items-center justify-center w-9 h-9 rounded-md transition-colors ${t===I?"bg-white/25 text-white":"text-white/70 hover:text-white hover:bg-white/10"}`,R="flex items-center justify-center w-9 h-9 rounded-md transition-colors text-white/70 hover:text-white hover:bg-white/10 disabled:text-white/20 disabled:cursor-not-allowed";return jsxRuntime.jsxs("div",{ref:v,className:"flex items-center gap-1 px-3 py-2 rounded-xl bg-neutral-900/90 backdrop-blur-md border border-white/15 shadow-2xl",onClick:I=>I.stopPropagation(),children:[jsxRuntime.jsx("button",{type:"button",className:R,onClick:()=>d(-1),disabled:l===0,title:m("pptx.presenter.previousSlide"),"aria-label":m("pptx.presenter.previousSlide"),children:jsxRuntime.jsx(lu$1.LuChevronLeft,{size:18})}),jsxRuntime.jsx("span",{className:"text-xs font-mono tabular-nums text-white/80 px-1.5 select-none min-w-[48px] text-center",children:IU(l,c)}),jsxRuntime.jsx("button",{type:"button",className:R,onClick:()=>d(1),disabled:l>=c-1,title:m("pptx.presenter.nextSlide"),"aria-label":m("pptx.presenter.nextSlide"),children:jsxRuntime.jsx(lu$1.LuChevronRight,{size:18})}),jsxRuntime.jsx("div",{className:"w-px h-6 bg-white/20 mx-1"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-mono tabular-nums text-white/60 px-1 select-none",title:m("pptx.presenter.elapsed"),children:[jsxRuntime.jsx(lu$1.LuTimer,{size:14}),jsxRuntime.jsx("span",{children:Vy(C)})]}),jsxRuntime.jsx("div",{className:"w-px h-6 bg-white/20 mx-1"}),jsxRuntime.jsx("button",{type:"button",className:E("laser"),onClick:()=>T("laser"),title:m("pptx.presentation.laserPointer"),children:jsxRuntime.jsx(lu$1.LuMousePointer2,{size:18})}),jsxRuntime.jsxs("div",{className:"relative flex items-center",children:[jsxRuntime.jsxs("button",{type:"button",className:E("pen"),onClick:()=>T("pen"),onContextMenu:M,title:m("pptx.presentation.pen"),children:[jsxRuntime.jsx(lu$1.LuPenTool,{size:18}),jsxRuntime.jsx("div",{className:"absolute bottom-0.5 left-1/2 -translate-x-1/2 w-3 h-0.5 rounded-full",style:{backgroundColor:e}})]}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center justify-center w-7 h-9 -ml-1 rounded-r-md transition-colors text-white/50 hover:text-white hover:bg-white/10",onClick:()=>{g(I=>!I),b(false);},title:`${m("pptx.presentation.pen")} \u2014 color`,children:jsxRuntime.jsx(lu$1.LuChevronDown,{size:12})}),x&&jsxRuntime.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 p-3 bg-neutral-800 rounded-lg border border-white/20 shadow-xl grid grid-cols-4 gap-2",children:xct.map(I=>jsxRuntime.jsx("button",{type:"button","aria-label":`${m("pptx.presentation.pen")} ${I}`,className:`w-9 h-9 rounded-full border-2 transition-transform hover:scale-110 ${e===I?"border-white":"border-white/20"}`,style:{backgroundColor:I},onClick:()=>{i(I),g(false),t!=="pen"&&o("pen");}},I))})]}),jsxRuntime.jsxs("div",{className:"relative flex items-center",children:[jsxRuntime.jsxs("button",{type:"button",className:E("highlighter"),onClick:()=>T("highlighter"),onContextMenu:_,title:m("pptx.presentation.highlighter"),children:[jsxRuntime.jsx(lu$1.LuHighlighter,{size:18}),jsxRuntime.jsx("div",{className:"absolute bottom-0.5 left-1/2 -translate-x-1/2 w-3 h-0.5 rounded-full",style:{backgroundColor:n}})]}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center justify-center w-7 h-9 -ml-1 rounded-r-md transition-colors text-white/50 hover:text-white hover:bg-white/10",onClick:()=>{b(I=>!I),g(false);},title:`${m("pptx.presentation.highlighter")} \u2014 color`,children:jsxRuntime.jsx(lu$1.LuChevronDown,{size:12})}),y&&jsxRuntime.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 p-3 bg-neutral-800 rounded-lg border border-white/20 shadow-xl grid grid-cols-4 gap-2",children:yct.map(I=>jsxRuntime.jsx("button",{type:"button","aria-label":`${m("pptx.presentation.highlighter")} ${I}`,className:`w-9 h-9 rounded-full border-2 transition-transform hover:scale-110 ${n===I?"border-white":"border-white/20"}`,style:{backgroundColor:I},onClick:()=>{s(I),b(false),t!=="highlighter"&&o("highlighter");}},I))})]}),jsxRuntime.jsx("button",{type:"button",className:E("eraser"),onClick:()=>T("eraser"),title:m("pptx.presentation.eraser"),children:jsxRuntime.jsx(lu$1.LuEraser,{size:18})}),jsxRuntime.jsx("button",{type:"button",className:`flex items-center justify-center w-9 h-9 rounded-md transition-colors ${r?"text-white/70 hover:text-red-400 hover:bg-white/10":"text-white/30 cursor-not-allowed"}`,onClick:r?a:void 0,title:m("pptx.presentation.clearAnnotations"),disabled:!r,children:jsxRuntime.jsx(lu$1.LuTrash2,{size:18})}),jsxRuntime.jsx("div",{className:"w-px h-6 bg-white/20 mx-1"}),h&&jsxRuntime.jsx("button",{type:"button",className:`flex items-center justify-center w-9 h-9 rounded-md transition-colors ${f?"bg-white/25 text-white":"text-white/70 hover:text-white hover:bg-white/10"}`,onClick:h,title:m("pptx.presenter.presenterView",{defaultValue:"Presenter view (N)"}),"aria-label":m("pptx.presenter.presenterView",{defaultValue:"Presenter view"}),children:jsxRuntime.jsx(lu$1.LuPanelRight,{size:18})}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center justify-center w-9 h-9 rounded-md transition-colors text-white/70 hover:text-red-400 hover:bg-white/10",onClick:p,title:m("pptx.presenter.endPresentation"),"aria-label":m("pptx.presenter.endPresentation"),children:jsxRuntime.jsx(lu$1.LuX,{size:18})})]})}function xG({currentSlideIndex:t,totalSlides:e,onMovePresentationSlide:n,onEndPresentation:r}){let{t:o}=reactI18next.useTranslation(),{isTouchDevice:i}=f2();if(!i)return null;let s="pointer-events-auto flex items-center justify-center w-11 h-11 min-w-11 min-h-11 rounded-full bg-black/55 text-white shadow-lg active:bg-black/75",a=l=>{l.stopPropagation();};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:`fixed z-[90] ${s}`,style:{top:"calc(env(safe-area-inset-top, 0px) + 0.5rem)",right:"calc(env(safe-area-inset-right, 0px) + 0.5rem)",touchAction:"manipulation"},onClick:l=>{a(l),r();},"aria-label":o("pptx.presenter.endPresentation"),children:jsxRuntime.jsx(lu$1.LuX,{size:22})}),jsxRuntime.jsx("button",{type:"button",className:`fixed z-[90] top-1/2 -translate-y-1/2 ${s} disabled:opacity-30`,style:{left:"calc(env(safe-area-inset-left, 0px) + 0.5rem)",touchAction:"manipulation"},disabled:t<=0,onClick:l=>{a(l),n(-1);},"aria-label":o("pptx.presenter.previousSlide"),children:jsxRuntime.jsx(lu$1.LuChevronLeft,{size:26})}),jsxRuntime.jsx("button",{type:"button",className:`fixed z-[90] top-1/2 -translate-y-1/2 ${s} disabled:opacity-30`,style:{right:"calc(env(safe-area-inset-right, 0px) + 0.5rem)",touchAction:"manipulation"},disabled:t>=e-1,onClick:l=>{a(l),n(1);},"aria-label":o("pptx.presenter.nextSlide"),children:jsxRuntime.jsx(lu$1.LuChevronRight,{size:26})}),jsxRuntime.jsx("span",{className:"fixed z-[90] left-1/2 -translate-x-1/2 px-3 py-1 rounded-full bg-black/55 text-white text-xs font-mono tabular-nums pointer-events-none",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 0.5rem)"},children:e===0?"0 / 0":`${t+1} / ${e}`})]})}function bG({visible:t}){let{t:e}=reactI18next.useTranslation(),[n,r]=Jm.useState(""),[o,i]=Jm.useState("unknown"),s=Jm.useRef(null),a=Jm.useRef(false);if(Jm.useEffect(()=>{if(!t){a.current=false,s.current?.stop(),s.current=null,r("");return}a.current=true;let c=window,d=c.SpeechRecognition??c.webkitSpeechRecognition;if(!d){i("unsupported");return}i("supported");let u=new d;u.continuous=true,u.interimResults=true,u.lang=navigator.language||"en-US",u.onresult=p=>{let h="",f="";for(let x=p.resultIndex;x<p.results.length;x+=1){let g=p.results[x],y=g?.[0]?.transcript??"";g?.isFinal?h+=y:f+=y;}let m=`${h} ${f}`.trim();m.length>0&&r(m);},u.onerror=()=>{},u.onend=()=>{if(a.current)try{u.start();}catch{}},s.current=u;try{u.start();}catch{i("unsupported");}return ()=>{a.current=false,u.stop(),s.current=null;}},[t]),!t)return null;let l=o==="unsupported"?e("pptx.subtitles.notSupported"):n.length>0?n:e("pptx.subtitles.listening");return jsxRuntime.jsx("div",{className:"absolute bottom-14 left-1/2 -translate-x-1/2 z-[70] max-w-[80%] min-w-[300px]",children:jsxRuntime.jsx("div",{className:"px-6 py-3 rounded-lg bg-black/75 backdrop-blur-sm border border-white/10",children:jsxRuntime.jsx("p",{className:"text-center text-[15px] text-white/70 italic",children:l})})})}function vG({isOpen:t,annotationCount:e,slideCount:n,onKeep:r,onDiscard:o}){let{t:i}=reactI18next.useTranslation();return t?jsxRuntime.jsx("div",{style:{zIndex:1200},className:"fixed inset-0 flex items-center justify-center bg-black/50",children:jsxRuntime.jsxs("div",{className:"bg-background border border-border rounded-lg shadow-xl w-[420px] max-w-[90vw] p-6 animate-in fade-in zoom-in-95 duration-200",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full bg-primary/10",children:jsxRuntime.jsx(lu$1.LuPenTool,{className:"w-5 h-5 text-primary"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-base font-semibold text-foreground",children:i("pptx.presentation.keepAnnotationsTitle")}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:i("pptx.presentation.keepAnnotationsDescription",{count:e,slides:n})})]})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-md border border-border bg-background text-foreground hover:bg-accent transition-colors",onClick:o,children:[jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-4 h-4"}),i("pptx.presentation.discardAnnotations")]}),jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-md bg-primary text-white hover:bg-primary/90 transition-colors",onClick:r,children:[jsxRuntime.jsx(lu$1.LuPenTool,{className:"w-4 h-4"}),i("pptx.presentation.keepAnnotations")]})]})]})}):null}Pe();var ll=.9,Hfe=5;function SG({slideIndices:t,slides:e,frameSlides:n,maxPages:r=3}){let{t:o}=reactI18next.useTranslation(),i=Jm.useMemo(()=>uR(t),[t]),s=Jm.useMemo(()=>pR(),[]),a=i.slice(0,r),l=s.width*ll,c=s.height*ll;return t.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full text-xs text-muted-foreground",children:o("pptx.print.preview.noSlides")}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 py-2",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:o("pptx.print.preview.title")}),a.map(d=>{let p=!!e[d.slideIndex]?.notes;return jsxRuntime.jsxs("div",{className:"relative bg-white border border-gray-200 shadow-sm rounded",style:{width:l,height:c,overflow:"hidden"},children:[jsxRuntime.jsx("div",{className:`absolute flex items-center justify-center rounded-sm bg-gray-50 ${n?"border-2 border-gray-800":"border border-gray-300"}`,style:{left:d.slideArea.x*ll,top:d.slideArea.y*ll,width:d.slideArea.width*ll,height:d.slideArea.height*ll},children:jsxRuntime.jsx("span",{className:"text-[9px] font-medium text-gray-400",children:d.slideIndex+1})}),jsxRuntime.jsx("div",{className:"absolute left-1 right-1 border-b border-gray-200",style:{top:d.textArea.y*ll-1}}),jsxRuntime.jsx("div",{className:"absolute",style:{left:d.textArea.x*ll+4,top:d.textArea.y*ll,width:d.textArea.width*ll-8,height:d.textArea.height*ll},children:Array.from({length:Hfe},(f,m)=>{let x=d.textArea.height*ll/(Hfe+1);return jsxRuntime.jsx("div",{className:`absolute left-0 right-0 border-b ${p?"border-gray-300":"border-gray-200"}`,style:{top:x*(m+1)}},m)})})]},d.pageIndex)}),i.length>r&&jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:o("pptx.print.preview.morePages",{count:i.length-r})})]})}var xv=.9;function t5({slideIndices:t,slidesPerPage:e,orientation:n,frameSlides:r,maxPages:o=3}){let{t:i}=reactI18next.useTranslation(),s=Jm.useMemo(()=>lR(t,e,n),[t,e,n]),a=Jm.useMemo(()=>cR(n),[n]),l=s.slice(0,o),c=e===3,d=dR(),u=a.width*xv,p=a.height*xv,h=.5;return t.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full text-xs text-muted-foreground",children:i("pptx.print.preview.noSlides")}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 py-2",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:i("pptx.print.preview.title")}),l.map(f=>jsxRuntime.jsx("div",{className:"relative bg-white border border-gray-200 shadow-sm rounded",style:{width:u,height:p,overflow:"hidden"},children:f.cells.map((m,x)=>{let g=m.slideIndex<0,y=m.x*xv,b=m.y*xv,v=m.width*xv,S=m.height*xv;return jsxRuntime.jsxs("div",{className:"absolute flex items-start",style:{left:y,top:b,gap:c?2:0},children:[jsxRuntime.jsx("div",{className:`flex items-center justify-center rounded-sm bg-gray-50 ${g?"opacity-30":""} ${r?"border-2 border-gray-800":"border border-gray-300"}`,style:{width:v,height:S},children:!g&&jsxRuntime.jsx("span",{className:"text-[9px] font-medium text-gray-400",children:m.slideIndex+1})}),c&&!g&&jsxRuntime.jsx("div",{className:"relative border-l border-gray-200 pl-1",style:{width:u*h,height:S},children:Array.from({length:d},(C,T)=>{let M=S/(d+1)*(T+1);return jsxRuntime.jsx("div",{className:"absolute left-1 right-0 border-b border-gray-200",style:{top:M}},T)})})]},x)})},f.pageIndex)),s.length>o&&jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:i("pptx.print.preview.morePages",{count:s.length-o})})]})}Pe();var ma=t=>`flex items-center gap-2 px-3 py-2 rounded-lg border text-sm cursor-pointer transition-colors ${t?"border-primary bg-primary/10 text-foreground":"border-border bg-background text-muted-foreground hover:border-primary/40"}`;function Wfe({printWhat:t,onPrintWhatChange:e,orientation:n,onOrientationChange:r,colorMode:o,onColorModeChange:i,frameSlides:s,onFrameSlidesChange:a,slidesPerPage:l,onSlidesPerPageChange:c,slideRange:d,onSlideRangeChange:u,customFrom:p,onCustomFromChange:h,customTo:f,onCustomToChange:m,totalSlides:x,activeSlideIndex:g}){let{t:y}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"flex-1 space-y-5 min-w-0",children:[jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.printWhat")}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntime.jsxs("label",{className:ma(t==="slides"),children:[jsxRuntime.jsx("input",{type:"radio",name:"printWhat",className:"sr-only",checked:t==="slides",onChange:()=>e("slides")}),jsxRuntime.jsx(lu$1.LuFileText,{className:"w-4 h-4 shrink-0"}),y("pptx.print.fullPageSlides")]}),jsxRuntime.jsxs("label",{className:ma(t==="handouts"),children:[jsxRuntime.jsx("input",{type:"radio",name:"printWhat",className:"sr-only",checked:t==="handouts",onChange:()=>e("handouts")}),jsxRuntime.jsx(lu$1.LuGrid2X2,{className:"w-4 h-4 shrink-0"}),y("pptx.print.handouts")]}),jsxRuntime.jsxs("label",{className:ma(t==="notes"),children:[jsxRuntime.jsx("input",{type:"radio",name:"printWhat",className:"sr-only",checked:t==="notes",onChange:()=>e("notes")}),jsxRuntime.jsx(lu$1.LuStickyNote,{className:"w-4 h-4 shrink-0"}),y("pptx.print.notesPages")]}),jsxRuntime.jsxs("label",{className:ma(t==="outline"),children:[jsxRuntime.jsx("input",{type:"radio",name:"printWhat",className:"sr-only",checked:t==="outline",onChange:()=>e("outline")}),jsxRuntime.jsx(lu$1.LuList,{className:"w-4 h-4 shrink-0"}),y("pptx.print.outline")]})]})]}),t==="handouts"&&jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.slidesPerPage")}),jsxRuntime.jsx("div",{className:"flex gap-1.5 flex-wrap",children:_T.map(b=>jsxRuntime.jsx("button",{type:"button",onClick:()=>c(b),className:`px-3 py-1.5 rounded-md text-sm font-medium border transition-colors ${l===b?"border-primary bg-primary/10 text-foreground":"border-border bg-background text-muted-foreground hover:border-primary/40"}`,children:b},b))})]}),jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.slideRange")}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:ma(d==="all"),children:[jsxRuntime.jsx("input",{type:"radio",name:"slideRange",className:"sr-only",checked:d==="all",onChange:()=>u("all")}),y("pptx.print.allSlides")," (",x,")"]}),jsxRuntime.jsxs("label",{className:ma(d==="current"),children:[jsxRuntime.jsx("input",{type:"radio",name:"slideRange",className:"sr-only",checked:d==="current",onChange:()=>u("current")}),y("pptx.print.currentSlide")," (",g+1,")"]}),jsxRuntime.jsxs("label",{className:ma(d==="custom"),children:[jsxRuntime.jsx("input",{type:"radio",name:"slideRange",className:"sr-only",checked:d==="custom",onChange:()=>u("custom")}),y("pptx.print.customRange")]}),d==="custom"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 pl-6",children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:y("pptx.print.from")}),jsxRuntime.jsx("input",{type:"number",min:1,max:x,value:p,onChange:b=>h(Math.max(1,parseInt(b.target.value,10)||1)),className:"w-16 px-2 py-1 text-sm border border-border rounded bg-background text-foreground"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:y("pptx.print.to")}),jsxRuntime.jsx("input",{type:"number",min:1,max:x,value:f,onChange:b=>m(Math.max(1,parseInt(b.target.value,10)||1)),className:"w-16 px-2 py-1 text-sm border border-border rounded bg-background text-foreground"})]})]})]}),t==="slides"&&jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.orientation")}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("label",{className:ma(n==="landscape"),children:[jsxRuntime.jsx("input",{type:"radio",name:"orientation",className:"sr-only",checked:n==="landscape",onChange:()=>r("landscape")}),y("pptx.print.landscape")]}),jsxRuntime.jsxs("label",{className:ma(n==="portrait"),children:[jsxRuntime.jsx("input",{type:"radio",name:"orientation",className:"sr-only",checked:n==="portrait",onChange:()=>r("portrait")}),y("pptx.print.portrait")]})]})]}),jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.colorMode")}),jsxRuntime.jsxs("div",{className:"flex gap-2 flex-wrap",children:[jsxRuntime.jsxs("label",{className:ma(o==="color"),children:[jsxRuntime.jsx("input",{type:"radio",name:"colorMode",className:"sr-only",checked:o==="color",onChange:()=>i("color")}),y("pptx.print.color")]}),jsxRuntime.jsxs("label",{className:ma(o==="grayscale"),children:[jsxRuntime.jsx("input",{type:"radio",name:"colorMode",className:"sr-only",checked:o==="grayscale",onChange:()=>i("grayscale")}),y("pptx.print.grayscale")]}),jsxRuntime.jsxs("label",{className:ma(o==="blackAndWhite"),children:[jsxRuntime.jsx("input",{type:"radio",name:"colorMode",className:"sr-only",checked:o==="blackAndWhite",onChange:()=>i("blackAndWhite")}),y("pptx.print.blackAndWhite")]})]})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:s,onChange:b=>a(b.target.checked),className:"rounded border-border"}),jsxRuntime.jsx("span",{className:"text-sm text-foreground",children:y("pptx.print.frameSlides")})]})]})}function wG({open:t,onClose:e,onPrint:n,slides:r,activeSlideIndex:o,defaultSlidesPerPage:i,defaultFrameSlides:s}){let{t:a}=reactI18next.useTranslation(),{panelStyle:l,handlers:c}=pi(e),[d,u]=Jm.useState("slides"),[p,h]=Jm.useState("landscape"),[f,m]=Jm.useState("color"),[x,g]=Jm.useState(s??false),[y,b]=Jm.useState(_T.includes(i)?i:6),[v,S]=Jm.useState("all"),[w,C]=Jm.useState(1),[T,M]=Jm.useState(r.length),_=Jm.useMemo(()=>d==="notes"||d==="outline"||d==="handouts"?"portrait":p,[d,p]),E=Jm.useMemo(()=>{if(v==="all")return r.length;if(v==="current")return 1;let k=Math.max(1,Math.min(w,r.length));return Math.max(k,Math.min(T,r.length))-k+1},[v,r.length,w,T]),R=Jm.useMemo(()=>d==="slides"||d==="notes"?E:d==="outline"?1:Math.ceil(E/y),[d,E,y]),I=Jm.useMemo(()=>{if(v==="current")return [o];if(v==="custom"){let k=Math.max(0,w-1),F=Math.min(r.length-1,T-1);return Array.from({length:Math.max(0,F-k+1)},(N,D)=>k+D)}return Array.from({length:r.length},(k,F)=>F)},[v,o,w,T,r.length]),L=Jm.useCallback(()=>{n({printWhat:d,orientation:_,colorMode:f,frameSlides:x,slidesPerPage:y,slideRange:v,customRangeFrom:Math.max(1,Math.min(w,r.length)),customRangeTo:Math.max(1,Math.min(T,r.length))});},[d,_,f,x,y,v,w,T,r.length,n]);return t?jsxRuntime.jsx("div",{style:{zIndex:1200},className:"fixed inset-0 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:jsxRuntime.jsxs("div",{style:l,className:"w-[780px] max-h-[90vh] rounded-xl border border-border bg-background shadow-2xl flex flex-col max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...c,className:"flex items-center justify-between px-5 py-4 border-b border-border touch-none",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuPrinter,{className:"w-4 h-4 text-muted-foreground"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:a("pptx.print.title")})]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex gap-5",children:[jsxRuntime.jsx(Wfe,{printWhat:d,onPrintWhatChange:u,orientation:p,onOrientationChange:h,colorMode:f,onColorModeChange:m,frameSlides:x,onFrameSlidesChange:g,slidesPerPage:y,onSlidesPerPageChange:b,slideRange:v,onSlideRangeChange:S,customFrom:w,onCustomFromChange:C,customTo:T,onCustomToChange:M,totalSlides:r.length,activeSlideIndex:o}),d==="handouts"&&jsxRuntime.jsx("div",{className:"w-[230px] shrink-0 border-l border-border pl-4 overflow-y-auto",children:jsxRuntime.jsx(t5,{slideIndices:I,slidesPerPage:y,orientation:_,frameSlides:x})}),d==="notes"&&jsxRuntime.jsx("div",{className:"w-[230px] shrink-0 border-l border-border pl-4 overflow-y-auto",children:jsxRuntime.jsx(SG,{slideIndices:I,slides:r,frameSlides:x})})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border",children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:a("pptx.print.pageEstimate",{pages:R,slides:E})}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a("common.cancel")}),jsxRuntime.jsxs("button",{type:"button",onClick:L,className:"px-4 py-2 text-sm rounded-lg bg-primary text-white hover:bg-primary/90 transition-colors flex items-center gap-1.5",children:[jsxRuntime.jsx(lu$1.LuPrinter,{className:"w-3.5 h-3.5"}),a("pptx.print.printButton")]})]})]})]})}):null}function jfe({draft:t,update:e}){let{t:n}=reactI18next.useTranslation();return jsxRuntime.jsxs("fieldset",{className:"space-y-1.5",children:[jsxRuntime.jsx("legend",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:n("pptx.slideShow.showOptions")}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:!!t.loopContinuously,onChange:r=>e({loopContinuously:r.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:n("pptx.slideShow.loopContinuously")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:t.showWithNarration===false,onChange:r=>e({showWithNarration:!r.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:n("pptx.slideShow.showWithoutNarration")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:t.showWithAnimation===false,onChange:r=>e({showWithAnimation:!r.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:n("pptx.slideShow.showWithoutAnimation")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:!!t.showSubtitles,onChange:r=>e({showSubtitles:r.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:n("pptx.slideShow.showSubtitles")})]})]})}function Yfe({draft:t,update:e,showSlidesMode:n,slideCount:r,customShows:o}){let{t:i}=reactI18next.useTranslation();return jsxRuntime.jsxs("fieldset",{className:"space-y-1.5",children:[jsxRuntime.jsx("legend",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:i("pptx.slideShow.showSlides")}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"showSlides",value:"all",checked:n==="all",onChange:()=>e({showSlidesMode:"all"}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:i("pptx.slideShow.allSlides")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"showSlides",value:"range",checked:n==="range",onChange:()=>e({showSlidesMode:"range",showSlidesFrom:t.showSlidesFrom??1,showSlidesTo:t.showSlidesTo??r}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:i("pptx.slideShow.fromTo")})]}),n==="range"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 ml-6",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i("pptx.slideShow.from")}),jsxRuntime.jsx("input",{type:"number",min:1,max:r,value:t.showSlidesFrom??1,onChange:s=>e({showSlidesFrom:Math.max(1,Number.parseInt(s.target.value,10)||1)}),className:"w-14 px-1.5 py-0.5 rounded bg-muted border border-border text-foreground text-[11px]"})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i("pptx.slideShow.to")}),jsxRuntime.jsx("input",{type:"number",min:1,max:r,value:t.showSlidesTo??r,onChange:s=>e({showSlidesTo:Math.min(r,Number.parseInt(s.target.value,10)||r)}),className:"w-14 px-1.5 py-0.5 rounded bg-muted border border-border text-foreground text-[11px]"})]})]}),o.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"showSlides",value:"customShow",checked:n==="customShow",onChange:()=>e({showSlidesMode:"customShow",showSlidesCustomShowId:t.showSlidesCustomShowId??o[0]?.id}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:i("pptx.slideShow.customShow")})]}),n==="customShow"&&jsxRuntime.jsx("div",{className:"ml-6",children:jsxRuntime.jsx("select",{value:t.showSlidesCustomShowId??o[0]?.id??"",onChange:s=>e({showSlidesCustomShowId:s.target.value}),className:"w-full px-2 py-1 rounded bg-muted border border-border text-foreground text-[11px]",children:o.map(s=>jsxRuntime.jsx("option",{value:s.id,children:s.name},s.id))})})]})]})}function TG({open:t,onClose:e,properties:n,onSave:r,customShows:o,slideCount:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState({...n}),c=Jm.useCallback(h=>{l(f=>({...f,...h}));},[]),d=Jm.useCallback(()=>{r(a),e();},[a,r,e]);if(!t)return null;let u=a.showType??"presented",p=a.showSlidesMode??"all";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/50","aria-label":"Close dialog",onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto flex flex-col w-[440px] max-h-[90vh] rounded-xl border border-border bg-background shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("pptx.slideShow.setUpTitle")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex-1 px-5 py-4 space-y-5 text-[12px] text-foreground overflow-y-auto",children:[jsxRuntime.jsxs("fieldset",{className:"space-y-1.5",children:[jsxRuntime.jsx("legend",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:s("pptx.slideShow.showType")}),[["presented",s("pptx.slideShow.presentedBySpeaker")],["browsed",s("pptx.slideShow.browsedByIndividual")],["kiosk",s("pptx.slideShow.browsedAtKiosk")]].map(([h,f])=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"showType",value:h,checked:u===h,onChange:()=>c({showType:h,...h==="kiosk"?{loopContinuously:true}:{}}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:f})]},h))]}),jsxRuntime.jsx(Yfe,{draft:a,update:c,showSlidesMode:p,slideCount:i,customShows:o}),jsxRuntime.jsxs("fieldset",{className:"space-y-1.5",children:[jsxRuntime.jsx("legend",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:s("pptx.slideShow.advanceSlides")}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"advanceMode",value:"manual",checked:(a.advanceMode??"manual")==="manual",onChange:()=>c({advanceMode:"manual"}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:s("pptx.slideShow.manually")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"advanceMode",value:"useTimings",checked:a.advanceMode==="useTimings",onChange:()=>c({advanceMode:"useTimings"}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:s("pptx.slideShow.useTimings")})]})]}),jsxRuntime.jsx(jfe,{draft:a,update:c})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border shrink-0",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 rounded bg-muted hover:bg-accent text-[12px] text-foreground transition-colors",children:s("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:d,className:"px-3 py-1.5 rounded bg-primary hover:bg-primary/80 text-[12px] text-white transition-colors",children:s("common.ok")})]})]})})]})}Pe();function EG({open:t,onClose:e,onStartBroadcast:n,onStopBroadcast:r,onStartPresenting:o,defaultRoomId:i,defaultUserName:s,defaultServerUrl:a}){let{t:l}=reactI18next.useTranslation(),c=No(),d=c!==null&&c.status!=="disconnected"&&c.status!=="error"&&c.config.role==="owner",[u,p]=Jm.useState(""),[h,f]=Jm.useState(""),[m,x]=Jm.useState(""),[g,y]=Jm.useState(false),b=Jm.useRef(null),{panelStyle:v,handlers:S}=pi(e);Jm.useEffect(()=>{if(t&&!d){let I=i?`broadcast-${i}`:$ne();p(I),f(s??""),x(a??Une);}},[t,d,i,s,a]),Jm.useEffect(()=>{if(!t)return;function I(L){L.key==="Escape"&&e();}return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,e]),Jm.useEffect(()=>{t&&b.current&&b.current.focus();},[t]);let w=d?c.config.roomId:u,C=d?c.config.serverUrl:m,T=typeof window<"u"?Hne(w,C,window.location):w,M=Jm.useCallback(()=>{navigator.clipboard.writeText(T).then(()=>{y(true),setTimeout(()=>y(false),2e3);});},[T]),_=Jm.useCallback(()=>{if(!u.trim()||!h.trim())return;let I=m.trim();n?.({roomId:u.trim(),serverUrl:I,userName:h.trim(),role:"owner",transport:qA(I)}),setTimeout(()=>{o?.();},100),e();},[u,h,m,n,o,e]),E=Jm.useCallback(()=>{r?.(),e();},[r,e]),R=u.trim().length>0&&h.trim().length>0;return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/50","aria-label":"Close dialog",onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":l("pptx.broadcast.title"),tabIndex:-1,style:v,className:"pointer-events-auto w-full max-w-md rounded-xl border border-border bg-popover text-foreground shadow-2xl outline-none max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...S,className:"flex items-center justify-between px-5 py-3 border-b border-border touch-none",children:[jsxRuntime.jsxs("h2",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuCast,{className:"w-4 h-4"}),l(d?"pptx.broadcast.broadcasting":"pptx.broadcast.title")]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"px-5 py-4",children:d?jsxRuntime.jsx(edt,{collab:c,broadcastUrl:T,copied:g,onCopyUrl:M,onStopBroadcast:E}):jsxRuntime.jsx(Qct,{roomId:u,userName:h,serverUrl:m,onRoomIdChange:p,onUserNameChange:f,onServerUrlChange:x})}),!d&&jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 rounded bg-muted hover:bg-accent text-[12px] text-foreground transition-colors",children:l("common.close")}),jsxRuntime.jsx("button",{type:"button",disabled:!R,onClick:_,className:"px-3 py-1.5 rounded bg-primary hover:bg-primary/90 text-[12px] text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:l("pptx.broadcast.startBroadcast")})]})]})})]}):null}function Qct({roomId:t,userName:e,serverUrl:n,onRoomIdChange:r,onUserNameChange:o,onServerUrlChange:i}){let{t:s}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed",children:s("pptx.broadcast.description")}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"broadcast-room-id",className:"block text-[12px] font-medium text-foreground",children:s("pptx.broadcast.sessionName")}),jsxRuntime.jsx("input",{id:"broadcast-room-id",type:"text",value:t,onChange:a=>r(a.target.value),placeholder:"broadcast-abc123",className:"w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"broadcast-user-name",className:"block text-[12px] font-medium text-foreground",children:s("pptx.broadcast.displayName")}),jsxRuntime.jsx("input",{id:"broadcast-user-name",type:"text",value:e,onChange:a=>o(a.target.value),placeholder:"Presenter",className:"w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"broadcast-server-url",className:"block text-[12px] font-medium text-foreground",children:s("pptx.broadcast.serverLabel")}),jsxRuntime.jsx("input",{id:"broadcast-server-url",type:"text",value:n,onChange:a=>i(a.target.value),placeholder:"ws://localhost:1234",className:"w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground/70 leading-relaxed",children:n.trim().length===0?s("pptx.broadcast.p2pHint"):s("pptx.broadcast.hint")})]})}function edt({collab:t,broadcastUrl:e,copied:n,onCopyUrl:r,onStopBroadcast:o}){let{t:i}=reactI18next.useTranslation(),s=t.status==="connected"?"text-green-400":t.status==="connecting"?"text-yellow-400":"text-red-400",a=t.status==="connected"||t.status==="connecting"?jsxRuntime.jsx(lu$1.LuWifi,{className:"w-4 h-4"}):jsxRuntime.jsx(lu$1.LuWifiOff,{className:"w-4 h-4"}),l=t.remoteUsers.filter(c=>c.role==="viewer").length;return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:s,children:a}),jsxRuntime.jsx("span",{className:"text-[13px] font-medium text-foreground capitalize",children:t.status}),jsxRuntime.jsxs("span",{className:"text-[12px] text-muted-foreground ml-auto flex items-center gap-1",children:[jsxRuntime.jsx(lu$1.LuUsers,{className:"w-3.5 h-3.5"}),i("pptx.broadcast.viewerCount",{count:l})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"block text-[12px] font-medium text-foreground",children:i("pptx.broadcast.viewerLink")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex-1 px-3 py-1.5 rounded border border-border bg-background text-[11px] text-foreground select-all font-mono truncate",children:e}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"flex items-center gap-1 px-2.5 py-1.5 rounded border border-border bg-muted hover:bg-accent text-[12px] text-foreground transition-colors shrink-0",title:i("pptx.broadcast.copyLink"),children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3.5 h-3.5 text-green-400"}),jsxRuntime.jsx("span",{children:i("pptx.share.copied")})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lu$1.LuCopy,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:i("pptx.share.copyUrl")})]})})]}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:i("pptx.broadcast.shareHint")})]}),t.remoteUsers.length>0&&jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"block text-[12px] font-medium text-foreground",children:i("pptx.broadcast.viewers")}),jsxRuntime.jsx("div",{className:"rounded border border-border bg-background divide-y divide-border max-h-[120px] overflow-y-auto",children:t.remoteUsers.map(c=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-semibold text-white shrink-0",style:{backgroundColor:c.userColor},children:c.userName.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:"text-[12px] text-foreground truncate",children:c.userName}),jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground ml-auto",children:["Slide ",c.activeSlideIndex+1]})]},c.clientId))})]}),jsxRuntime.jsx("button",{type:"button",onClick:o,className:"w-full px-3 py-2 rounded border border-red-500/30 bg-red-500/10 hover:bg-red-500/20 text-[12px] text-red-400 font-medium transition-colors",children:i("pptx.broadcast.stopBroadcast")})]})}Pe();function Zfe(t){let e=t.trim().split(/\s+/u);return e.length>=2?(e[0][0]+e[e.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function Qfe(t){return t.transport==="webrtc"||!t.serverUrl?.trim()}function eme(t){if(typeof window>"u")return t.roomId;let e=`${window.location.origin}${window.location.pathname}`,n=encodeURIComponent(t.roomId);return Qfe(t)?`${e}?room=${n}&transport=webrtc`:`${e}?room=${n}&server=${encodeURIComponent(t.serverUrl??"")}`}function IG({open:t,onClose:e,activeCollaboration:n,onStartCollaboration:r,onStopCollaboration:o,preconfigured:i,defaultRoomId:s,defaultUserName:a,defaultServerUrl:l}){let c=No(),d=c!==null&&c.status!=="disconnected"&&c.status!=="error",{t:u}=reactI18next.useTranslation(),[p,h]=Jm.useState(s??""),[f,m]=Jm.useState(a??""),[x,g]=Jm.useState(l??""),[y,b]=Jm.useState(false),v=Jm.useRef(null),{panelStyle:S,handlers:w}=pi(e);Jm.useEffect(()=>{n&&(h(n.roomId),m(n.userName),g(n.serverUrl));},[n]),Jm.useEffect(()=>{if(!t)return;function _(E){E.key==="Escape"&&e();}return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[t,e]),Jm.useEffect(()=>{t&&v.current&&v.current.focus();},[t]);let C=Jm.useCallback(()=>{let _=n??{roomId:p,serverUrl:x};navigator.clipboard.writeText(eme(_)).then(()=>{b(true),setTimeout(()=>b(false),2e3);});},[n,p,x]),T=Jm.useCallback(()=>{if(!p.trim()||!f.trim())return;let _=x.trim();r?.({roomId:p.trim(),serverUrl:_,userName:f.trim(),transport:qA(_)});},[p,f,x,r]),M=p.trim().length>0&&f.trim().length>0;return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/50","aria-label":u("pptx.share.closeDialog"),onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{ref:v,role:"dialog","aria-modal":"true","aria-label":u("pptx.share.title"),tabIndex:-1,style:S,className:"pointer-events-auto w-full max-w-md rounded-xl border border-border bg-popover text-foreground shadow-2xl outline-none max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...w,className:"flex items-center justify-between px-5 py-3 border-b border-border touch-none",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:u(d?"pptx.share.collaborationActive":"pptx.share.title")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":u("pptx.share.close"),children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"px-5 py-4",children:d?jsxRuntime.jsx(adt,{collab:c,activeCollaboration:n,copied:y,onCopyRoomId:C,onStopCollaboration:o}):jsxRuntime.jsx(sdt,{roomId:p,userName:f,serverUrl:x,onRoomIdChange:h,onUserNameChange:m,onServerUrlChange:g,preconfigured:i,connectionFailed:c?.status==="error",onRetry:c?.retry})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 rounded bg-muted hover:bg-accent text-[12px] text-foreground transition-colors",children:u(d?"pptx.share.close":"pptx.share.cancel")}),!d&&jsxRuntime.jsx("button",{type:"button",disabled:!M,onClick:T,className:"px-3 py-1.5 rounded bg-primary hover:bg-primary/90 text-[12px] text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:u("pptx.share.startSharing")})]})]})})]}):null}function sdt({roomId:t,userName:e,serverUrl:n,onRoomIdChange:r,onUserNameChange:o,onServerUrlChange:i,preconfigured:s,connectionFailed:a,onRetry:l}){let{t:c}=reactI18next.useTranslation(),d=s?" opacity-70 cursor-not-allowed":"";return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed",children:c(s?"pptx.share.preconfiguredDescription":"pptx.share.description")}),a&&jsxRuntime.jsxs("div",{role:"alert",className:"flex items-start gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-[12px] text-red-400",children:[jsxRuntime.jsx(lu$1.LuWifiOff,{className:"w-4 h-4 mt-0.5 shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1 space-y-1",children:[jsxRuntime.jsx("p",{className:"font-medium",children:c("pptx.share.connectionError")}),l&&jsxRuntime.jsx("button",{type:"button",onClick:l,className:"underline underline-offset-2 hover:no-underline",children:c("pptx.collaboration.retry")})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"share-room-id",className:"block text-[12px] font-medium text-foreground",children:c("pptx.share.sessionName")}),jsxRuntime.jsx("input",{id:"share-room-id",type:"text","aria-label":c("pptx.share.sessionName"),value:t,onChange:u=>r(u.target.value),readOnly:s,placeholder:c("pptx.share.sessionPlaceholder"),className:`w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary${d}`}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:c("pptx.share.sessionHint")})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"share-user-name",className:"block text-[12px] font-medium text-foreground",children:c("pptx.share.displayName")}),jsxRuntime.jsx("input",{id:"share-user-name",type:"text","aria-label":c("pptx.share.displayName"),value:e,onChange:u=>o(u.target.value),readOnly:s,placeholder:c("pptx.share.namePlaceholder"),className:`w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary${d}`})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"share-server-url",className:"block text-[12px] font-medium text-foreground",children:c("pptx.share.serverLabel")}),jsxRuntime.jsx("input",{id:"share-server-url",type:"text","aria-label":c("pptx.share.serverLabel"),value:n,onChange:u=>i(u.target.value),readOnly:s,placeholder:c("pptx.share.serverPlaceholder"),className:`w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary${d}`})]}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:n.trim().length===0?c("pptx.share.p2pHint"):c("pptx.share.serverHint")})]})}function adt({collab:t,activeCollaboration:e,copied:n,onCopyRoomId:r,onStopCollaboration:o}){let{t:i}=reactI18next.useTranslation(),s=t.status==="connected"?"text-green-400":t.status==="connecting"?"text-yellow-400":"text-red-400",a=t.status==="connected"||t.status==="connecting"?jsxRuntime.jsx(lu$1.LuWifi,{className:"w-4 h-4"}):jsxRuntime.jsx(lu$1.LuWifiOff,{className:"w-4 h-4"});return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:s,children:a}),jsxRuntime.jsx("span",{className:"text-[13px] font-medium text-foreground capitalize",children:t.status}),jsxRuntime.jsxs("span",{className:"text-[12px] text-muted-foreground ml-auto flex items-center gap-1",children:[jsxRuntime.jsx(lu$1.LuUsers,{className:"w-3.5 h-3.5"}),i("pptx.collaboration.userCount",{count:t.connectedCount})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"block text-[12px] font-medium text-foreground",children:i("pptx.share.shareLink")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex-1 px-3 py-1.5 rounded border border-border bg-background text-[11px] text-foreground select-all font-mono truncate",children:eme(t.config)}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"flex items-center gap-1 px-2.5 py-1.5 rounded border border-border bg-muted hover:bg-accent text-[12px] text-foreground transition-colors shrink-0",title:i("pptx.share.copyLink"),children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3.5 h-3.5 text-green-400"}),jsxRuntime.jsx("span",{children:i("pptx.share.copied")})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lu$1.LuCopy,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:i("pptx.share.copyUrl")})]})})]}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:i("pptx.share.shareHint")})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-muted-foreground",children:[jsxRuntime.jsxs("span",{children:[i("pptx.share.room")," ",jsxRuntime.jsx("code",{className:"font-mono text-foreground",children:t.config.roomId})]}),jsxRuntime.jsxs("span",{children:[i("pptx.share.server")," ",jsxRuntime.jsx("code",{className:"font-mono text-foreground",children:Qfe(t.config)?i("pptx.share.p2pServerValue"):t.config.serverUrl})]})]}),t.remoteUsers.length>0&&jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"block text-[12px] font-medium text-foreground",children:i("pptx.share.connectedUsers")}),jsxRuntime.jsxs("div",{className:"rounded border border-border bg-background divide-y divide-border max-h-[140px] overflow-y-auto",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-semibold text-white shrink-0",style:{backgroundColor:t.config.userColor??"#6366f1"},children:Zfe(e?.userName??t.config.userName)}),jsxRuntime.jsx("span",{className:"text-[12px] text-foreground truncate",children:e?.userName??t.config.userName}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:i("pptx.share.you")})]}),t.remoteUsers.map(l=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-semibold text-white shrink-0",style:{backgroundColor:l.userColor},children:l.userAvatar?jsxRuntime.jsx("img",{src:l.userAvatar,alt:"",className:"w-full h-full rounded-full object-cover"}):Zfe(l.userName)}),jsxRuntime.jsx("span",{className:"text-[12px] text-foreground truncate",children:l.userName}),jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground ml-auto",children:["Slide ",l.activeSlideIndex+1]})]},l.clientId))]})]}),o&&jsxRuntime.jsx("button",{type:"button",onClick:o,className:"w-full px-3 py-2 rounded border border-red-500/30 bg-red-500/10 hover:bg-red-500/20 text-[12px] text-red-400 font-medium transition-colors",children:i("pptx.share.stopSharing")})]})}function tme({targetType:t,url:e,setUrl:n,tooltip:r,setTooltip:o,emailAddress:i,setEmailAddress:s,emailSubject:a,setEmailSubject:l,slideNumber:c,setSlideNumber:d,slideCount:u,filePath:p,setFilePath:h,actionVerb:f,setActionVerb:m,inputRef:x,inputCls:g,onEnterConfirm:y}){let{t:b}=reactI18next.useTranslation(),v=S=>{S.key==="Enter"&&y();};return jsxRuntime.jsxs("div",{className:"px-4 py-3 space-y-3",children:[t==="url"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.urlLabel")}),jsxRuntime.jsx("input",{ref:x,type:"url",className:g,placeholder:"https://example.com",value:e,onChange:S=>n(S.target.value),onKeyDown:v})]}),t==="email"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.emailLabel")}),jsxRuntime.jsx("input",{ref:x,type:"email",className:g,placeholder:"user@example.com",value:i,onChange:S=>s(S.target.value),onKeyDown:v})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.subjectLabel")}),jsxRuntime.jsx("input",{type:"text",className:g,value:a,onChange:S=>l(S.target.value)})]})]}),t==="slide"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.slideLabel")}),jsxRuntime.jsx("input",{ref:x,type:"number",min:1,max:u,className:g,value:c,onChange:S=>d(parseInt(S.target.value,10)||1),onKeyDown:v}),jsxRuntime.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:b("pptx.hyperlink.slideRange",{max:u})})]}),t==="file"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.fileLabel")}),jsxRuntime.jsx("input",{ref:x,type:"text",className:g,placeholder:"../documents/file.docx",value:p,onChange:S=>h(S.target.value),onKeyDown:v})]}),t==="action"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.actionLabel")}),jsxRuntime.jsxs("select",{className:g,value:f,onChange:S=>m(S.target.value),children:[jsxRuntime.jsx("option",{value:"nextSlide",children:b("pptx.hyperlink.actionNextSlide")}),jsxRuntime.jsx("option",{value:"prevSlide",children:b("pptx.hyperlink.actionPrevSlide")}),jsxRuntime.jsx("option",{value:"firstSlide",children:b("pptx.hyperlink.actionFirstSlide")}),jsxRuntime.jsx("option",{value:"lastSlide",children:b("pptx.hyperlink.actionLastSlide")}),jsxRuntime.jsx("option",{value:"endShow",children:b("pptx.hyperlink.actionEndShow")})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.tooltipLabel")}),jsxRuntime.jsx("input",{type:"text",className:g,value:r,onChange:S=>o(S.target.value)})]})]})}function NG({open:t,initialUrl:e,initialTooltip:n,initialAction:r,slideCount:o,onConfirm:i,onCancel:s}){let{t:a}=reactI18next.useTranslation(),{panelStyle:l,handlers:c}=pi(s),d=Jm.useRef(null),u=zde(e,r),p=Vde(e||""),h=Gde(e,r),f=r&&tN[r.toLowerCase()]||"nextSlide",[m,x]=Jm.useState(u),[g,y]=Jm.useState(u==="email"||u==="slide"||u==="action"?"":e||""),[b,v]=Jm.useState(n||""),[S,w]=Jm.useState(p.address),[C,T]=Jm.useState(p.subject),[M,_]=Jm.useState(h),[E,R]=Jm.useState(u==="file"&&e||""),[I,L]=Jm.useState(f);if(Jm.useEffect(()=>{t&&setTimeout(()=>d.current?.focus(),50);},[t]),!t)return null;let k=()=>{i({targetType:m,url:g,tooltip:b,emailAddress:S,emailSubject:C,slideNumber:M,filePath:E,actionVerb:I});},F=D=>ie("px-3 py-1.5 text-xs rounded-t border-b-2 transition-colors",D?"border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:border-border");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:{zIndex:1200},className:"fixed inset-0 bg-black/40",onClick:s}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{style:l,className:"pointer-events-auto w-[440px] rounded-lg border border-border bg-popover shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",onClick:D=>D.stopPropagation(),children:[jsxRuntime.jsxs("div",{...c,className:"flex items-center justify-between px-4 py-3 border-b border-border touch-none",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:a("pptx.hyperlink.editTitle")}),jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground",onClick:s,children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex gap-1 px-4 pt-2 border-b border-border",children:[jsxRuntime.jsx("button",{type:"button",className:F(m==="url"),onClick:()=>x("url"),children:a("pptx.hyperlink.tabUrl")}),jsxRuntime.jsx("button",{type:"button",className:F(m==="email"),onClick:()=>x("email"),children:a("pptx.hyperlink.tabEmail")}),jsxRuntime.jsx("button",{type:"button",className:F(m==="slide"),onClick:()=>x("slide"),children:a("pptx.hyperlink.tabSlide")}),jsxRuntime.jsx("button",{type:"button",className:F(m==="file"),onClick:()=>x("file"),children:a("pptx.hyperlink.tabFile")}),jsxRuntime.jsx("button",{type:"button",className:F(m==="action"),onClick:()=>x("action"),children:a("pptx.hyperlink.tabAction")})]}),jsxRuntime.jsx(tme,{targetType:m,url:g,setUrl:y,tooltip:b,setTooltip:v,emailAddress:S,setEmailAddress:w,emailSubject:C,setEmailSubject:T,slideNumber:M,setSlideNumber:_,slideCount:o,filePath:E,setFilePath:R,actionVerb:I,setActionVerb:L,inputRef:d,inputCls:"w-full rounded border border-border bg-background px-2.5 py-1.5 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary",onEnterConfirm:k}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded border border-border text-foreground hover:bg-muted",onClick:s,children:a("common.cancel")}),jsxRuntime.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded bg-primary text-white hover:bg-primary/90",onClick:k,children:a("common.apply")})]})]})})]})}function nme({guides:t,onDeleteGuide:e,onStartGuideDrag:n}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(r=>jsxRuntime.jsx("div",{className:"absolute z-[49] pointer-events-auto",style:r.axis==="h"?{left:0,right:0,top:r.position,height:1,backgroundColor:"rgba(250, 204, 21, 0.9)",cursor:"row-resize"}:{top:0,bottom:0,left:r.position,width:1,backgroundColor:"rgba(250, 204, 21, 0.9)",cursor:"col-resize"},onDoubleClick:o=>{o.stopPropagation(),e?.(r.id);},onPointerDown:o=>{o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId),n({id:r.id,axis:r.axis,pointerId:o.pointerId});},title:"Drag guide. Double-click to remove."},r.id))})}function rme({backgroundImage:t,backgroundGradient:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t&&jsxRuntime.jsx("img",{src:t,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none",draggable:false}),e&&jsxRuntime.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:e}})]})}function ome({marqueeSelectionState:t}){return t?jsxRuntime.jsx("div",{className:"absolute border border-primary bg-primary/10 pointer-events-none z-50",style:{left:Math.min(t.startX,t.currentX),top:Math.min(t.startY,t.currentY),width:Math.abs(t.currentX-t.startX),height:Math.abs(t.currentY-t.startY)}}):null}function ime({snapLines:t}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map((e,n)=>jsxRuntime.jsx("div",{className:"absolute bg-red-500 pointer-events-none z-50",style:e.axis==="x"?{left:e.position,top:0,width:1,height:"100%"}:{left:0,top:e.position,width:"100%",height:1}},n))})}function ame({comments:t,canvasSize:e,onCommentMarkerClick:n}){return jsxRuntime.jsx("div",{className:"absolute inset-0 pointer-events-none z-[45]",children:t.map((r,o)=>{let i=Z4(r,o,e.width,e.height);return jsxRuntime.jsx("div",{className:"absolute pointer-events-auto cursor-pointer",style:{left:i.x-10,top:i.y-10,width:20,height:20,borderRadius:"50%",backgroundColor:"rgba(255, 165, 0, 0.9)",border:"2px solid #fff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700,color:"#fff",lineHeight:1},title:`${r.author??"Comment"}: ${r.text}`,onClick:s=>{s.stopPropagation(),n?.(r.id);},children:o+1},r.id)})})}function lme({activeSlide:t,canvasSize:e,zoom:n,connectorDragState:r,onConnectionSiteDown:o,onConnectorDragMove:i,onConnectionSiteDrop:s,onConnectorDragEnd:a}){return jsxRuntime.jsxs("div",{className:"absolute inset-0 z-[55] pointer-events-none",onMouseMove:i,onMouseUp:a,style:{pointerEvents:r?"auto":"none"},children:[t.elements.filter(l=>l.type!=="connector").map(l=>Dc(l.width,l.height).map(d=>jsxRuntime.jsx("div",{className:"absolute rounded-full border-2 border-blue-500 bg-blue-400/60 hover:bg-blue-500 hover:scale-125 transition-transform cursor-crosshair",style:{left:l.x+d.x-5,top:l.y+d.y-5,width:10,height:10,pointerEvents:"auto",zIndex:56},onMouseDown:u=>o(l.id,d.index,u),onMouseUp:()=>r?s(l.id,d.index):void 0},`${l.id}-site-${d.index}`))),r&&jsxRuntime.jsx(gdt,{activeSlide:t,canvasSize:e,zoom:n,connectorDragState:r})]})}function gdt({activeSlide:t,canvasSize:e,zoom:n,connectorDragState:r}){let o=t.elements.find(f=>f.id===r.startElementId);if(!o)return null;let i=Dc(o.width,o.height),s=i[r.startSiteIndex]??i[0],a=o.x+s.x,l=o.y+s.y,c=n.canvasStageRef.current;if(!c)return null;let d=c.getBoundingClientRect(),u=n.editorScale||1,p=(r.currentX-d.left)/u,h=(r.currentY-d.top)/u;return jsxRuntime.jsx("svg",{className:"absolute inset-0",style:{width:e.width,height:e.height,pointerEvents:"none"},viewBox:`0 0 ${e.width} ${e.height}`,children:jsxRuntime.jsx("line",{x1:a,y1:l,x2:p,y2:h,stroke:"#3b82f6",strokeWidth:2,strokeDasharray:"6 4",strokeLinecap:"round"})})}function dme({canvasSize:t,activeTool:e,drawingColor:n,drawingWidth:r,isStrokeActive:o,liveStrokeD:i,onPointerDown:s,onPointerMove:a,onPointerUp:l}){return jsxRuntime.jsx("svg",{className:"absolute inset-0 z-[60]",style:{width:t.width,height:t.height,cursor:"crosshair",touchAction:"none"},viewBox:`0 0 ${t.width} ${t.height}`,onPointerDown:s,onPointerMove:a,onPointerUp:l,children:o&&i&&jsxRuntime.jsx("path",{d:i,fill:"none",stroke:n,strokeWidth:r,strokeOpacity:e==="highlighter"?.4:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function ume({canvasSize:t,gridSpacingPx:e=8,visible:n}){let r=Math.max(e,2),o=Jm.useMemo(()=>`grid-dot-pattern-${Math.random().toString(36).slice(2,8)}`,[]);return n?jsxRuntime.jsxs("svg",{className:"absolute inset-0 pointer-events-none z-[2]",width:t.width,height:t.height,xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("pattern",{id:o,width:r,height:r,patternUnits:"userSpaceOnUse",children:jsxRuntime.jsx("circle",{cx:r/2,cy:r/2,r:.6,fill:"rgba(156, 163, 175, 0.55)"})})}),jsxRuntime.jsx("rect",{width:t.width,height:t.height,fill:`url(#${o})`})]}):null}Pe();var DG=Jm__default.default.memo(({ticks:t,widthPx:e,highlight:n})=>jsxRuntime.jsxs("svg",{width:e,height:gn,className:"block select-none","aria-hidden":"true",children:[jsxRuntime.jsx("rect",{width:e,height:gn,className:"fill-gray-100 dark:fill-gray-800"}),jsxRuntime.jsx("line",{x1:0,y1:gn-.5,x2:e,y2:gn-.5,className:"stroke-border",strokeWidth:1}),n&&jsxRuntime.jsx("rect",{x:n.start,y:0,width:Math.max(n.end-n.start,1),height:gn,className:"fill-primary/20"}),t.map((r,o)=>{let i=r.isMajor?gn*.6:gn*.3;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:r.position,y1:gn,x2:r.position,y2:gn-i,className:"stroke-gray-400 dark:stroke-gray-500",strokeWidth:r.isMajor?1:.5}),r.label&&jsxRuntime.jsx("text",{x:r.position+2,y:Oy+1,fontSize:Oy,className:"fill-gray-500 dark:fill-gray-400",style:{fontFamily:"system-ui, sans-serif"},children:r.label})]},o)})]}));DG.displayName="HorizontalRuler";var FG=Jm__default.default.memo(({ticks:t,heightPx:e,highlight:n})=>jsxRuntime.jsxs("svg",{width:gn,height:e,className:"block select-none","aria-hidden":"true",children:[jsxRuntime.jsx("rect",{width:gn,height:e,className:"fill-gray-100 dark:fill-gray-800"}),jsxRuntime.jsx("line",{x1:gn-.5,y1:0,x2:gn-.5,y2:e,className:"stroke-border",strokeWidth:1}),n&&jsxRuntime.jsx("rect",{x:0,y:n.start,width:gn,height:Math.max(n.end-n.start,1),className:"fill-primary/20"}),t.map((r,o)=>{let i=r.isMajor?gn*.6:gn*.3;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:gn,y1:r.position,x2:gn-i,y2:r.position,className:"stroke-gray-400 dark:stroke-gray-500",strokeWidth:r.isMajor?1:.5}),r.label&&jsxRuntime.jsx("text",{x:2,y:r.position+Oy+2,fontSize:Oy,className:"fill-gray-500 dark:fill-gray-400",style:{fontFamily:"system-ui, sans-serif"},children:r.label})]},o)})]}));FG.displayName="VerticalRuler";function fme({canvasSize:t,editorScale:e,unit:n,visible:r,selectedBounds:o,onCreateGuideFromRuler:i}){let s=Jm.useMemo(()=>OA(t.width,e,n),[t.width,e,n]),a=Jm.useMemo(()=>OA(t.height,e,n),[t.height,e,n]),l=Jm.useMemo(()=>o?{start:o.x*e,end:(o.x+o.width)*e}:null,[o,e]),c=Jm.useMemo(()=>o?{start:o.y*e,end:(o.y+o.height)*e}:null,[o,e]),[d,u]=Jm.useState(null),p=Jm.useRef(null),h=Jm.useRef(null),f=Jm.useCallback(b=>{i&&(b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId),u({axis:"h",pointerId:b.pointerId}));},[i]),m=Jm.useCallback(b=>{i&&(b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId),u({axis:"v",pointerId:b.pointerId}));},[i]),x=Jm.useCallback(b=>{if(!d||!i)return;try{b.currentTarget.releasePointerCapture(d.pointerId);}catch{}let v=e||1;if(d.axis==="h"){let S=p.current;if(!S){u(null);return}let w=S.getBoundingClientRect(),C=b.clientY-w.top;if(C>gn){let T=(C-gn)/v;T>=0&&T<=t.height&&i("h",T);}}else {let S=h.current;if(!S){u(null);return}let w=S.getBoundingClientRect(),C=b.clientX-w.left;if(C>gn){let T=(C-gn)/v;T>=0&&T<=t.width&&i("v",T);}}u(null);},[d,i,e,t]);if(!r)return null;let g=t.width*e,y=t.height*e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute z-[51] bg-gray-100 dark:bg-gray-800 border-r border-b border-border",style:{top:0,left:0,width:gn,height:gn}}),jsxRuntime.jsx("div",{ref:p,className:"absolute z-[50] overflow-visible",style:{top:0,left:gn,width:g,height:gn,cursor:i?"row-resize":void 0},onPointerDown:f,onPointerUp:x,children:jsxRuntime.jsx(DG,{ticks:s,widthPx:g,highlight:l})}),jsxRuntime.jsx("div",{ref:h,className:"absolute z-[50] overflow-visible",style:{top:gn,left:0,width:gn,height:y,cursor:i?"col-resize":void 0},onPointerDown:m,onPointerUp:x,children:jsxRuntime.jsx(FG,{ticks:a,heightPx:y,highlight:c})})]})}function yv(t){let e=t.target;for(;e;){if(e.dataset?.pptxElement==="true")return e.dataset.elementId||null;e=e.parentElement;}return null}var Cdt=300;function Mdt(t,e){return t===e}function xme({cbRef:t,onCanvasMouseDown:e,findResults:n,findResultIndex:r,activeSlideIndex:o,selectedElement:i,zoom:s,onMoveGuide:a}){let l=Jm.useMemo(()=>{let w=new Map;if(!n||n.length===0||o===null)return w;for(let C=0;C<n.length;C++){let T=n[C];if(T.slideIndex!==o)continue;w.has(T.elementId)||w.set(T.elementId,new Map);let M=w.get(T.elementId);M.has(T.segmentIndex)||M.set(T.segmentIndex,[]),M.get(T.segmentIndex).push({startOffset:T.startOffset,length:T.length,isCurrent:C===(r??-1)});}return w},[n,r,o]),c=Jm.useMemo(()=>i?{x:i.x,y:i.y,width:i.width,height:i.height}:null,[i]),d=Jm.useCallback(w=>{let C=yv(w);C&&t.current.onClick(C,w);},[t]),u=Jm.useCallback(w=>{let C=yv(w);C&&t.current.onDoubleClick(C,w);},[t]),p=Jm.useRef(false),h=Jm.useCallback(w=>{if(p.current){p.current=false;return}let C=yv(w);if(C){t.current.onMouseDown(C,w);return}e?.(w);},[t,e]),f=Jm.useCallback(w=>{Mdt(w.target,w.currentTarget)&&e?.(w);},[e]),m=Jm.useRef(null),x=Jm.useCallback(w=>{if(w.pointerType==="mouse")return;p.current=true,w.currentTarget.setPointerCapture?.(w.pointerId);let C=yv(w);if(C){let T=w.timeStamp||Date.now(),M=m.current;if(M&&M.id===C&&T-M.time<Cdt){m.current=null,t.current.onDoubleClick(C,w);return}m.current={id:C,time:T},t.current.onMouseDown(C,w);return}m.current=null,e?.(w);},[t,e]),g=Jm.useCallback(w=>{let C=yv(w);C&&t.current.onContextMenu(C,w);},[t]),[y,b]=Jm.useState(null),v=Jm.useCallback(w=>{if(!y||!a)return;let C=s.canvasStageRef.current;if(!C)return;let T=C.getBoundingClientRect(),M=s.editorScale||1,_=y.axis==="h"?(w.clientY-T.top)/M:(w.clientX-T.left)/M;a(y.id,_);},[y,a,s.canvasStageRef,s.editorScale]),S=Jm.useCallback(w=>{if(y){try{w.currentTarget.releasePointerCapture(y.pointerId);}catch{}b(null);}},[y]);return {elementFindHighlightsMap:l,selectedBounds:c,handleStageClick:d,handleStageDblClick:u,handleStageMouseDown:h,handleViewportMouseDown:f,handleStagePointerDown:x,handleStageContextMenu:g,draggingGuide:y,setDraggingGuide:b,handleStagePointerMove:v,handleStagePointerUp:S}}function yme({activeSlide:t,zoom:e,onCreateConnector:n}){let[r,o]=Jm.useState(null),i=Jm.useCallback((c,d,u)=>{u.stopPropagation(),u.preventDefault(),o({startElementId:c,startSiteIndex:d,currentX:u.clientX,currentY:u.clientY});},[]),s=Jm.useCallback(c=>{r&&o(d=>d?{...d,currentX:c.clientX,currentY:c.clientY}:null);},[r]),a=Jm.useCallback((c,d)=>{if(!r||!n)return;if(r.startElementId===c){o(null);return}let u=t?.elements.find(_=>_.id===r.startElementId),p=t?.elements.find(_=>_.id===c);if(!u||!p){o(null);return}let h=Dc(u.width,u.height),f=Dc(p.width,p.height),m=h[r.startSiteIndex]??h[0],x=f[d]??f[0],g=u.x+m.x,y=u.y+m.y,b=p.x+x.x,v=p.y+x.y,S=Math.abs(b-g),w=Math.abs(v-y),C=Math.sqrt(S*S+w*w),T=C<100?"straightConnector1":C<300?"bentConnector3":"curvedConnector3",M={id:`conn-new-${Date.now()}`,type:"connector",x:Math.min(g,b),y:Math.min(y,v),width:Math.abs(b-g)||1,height:Math.abs(v-y)||1,shapeType:T,shapeStyle:{strokeColor:"#4472C4",strokeWidth:2,connectorStartConnection:{shapeId:r.startElementId,connectionSiteIndex:r.startSiteIndex},connectorEndConnection:{shapeId:c,connectionSiteIndex:d}}};n(M),o(null);},[r,n,t?.elements]),l=Jm.useCallback(()=>{o(null);},[]);return {connectorDragState:r,handleConnectionSiteDown:i,handleConnectorDragMove:s,handleConnectionSiteDrop:a,handleConnectorDragEnd:l}}function bme({activeTool:t,activeSlide:e,zoom:n,drawingColor:r,drawingWidth:o,isDrawingRef:i,onAddInkElement:s,onAddFreeformShape:a,onEraseInkElement:l}){let c=t!=="select",[d,u]=Jm.useState([]),[p,h]=Jm.useState([]),[f,m]=Jm.useState(false),x=Jm.useCallback(w=>{let C=n.canvasStageRef.current;if(!C)return null;let T=C.getBoundingClientRect(),M=n.editorScale||1;return {x:(w.clientX-T.left)/M,y:(w.clientY-T.top)/M}},[n.canvasStageRef,n.editorScale]),g=Jm.useCallback(w=>{if(w.length===0)return "";let C=[`M ${w[0].x} ${w[0].y}`];for(let T=1;T<w.length;T++)C.push(`L ${w[T].x} ${w[T].y}`);return C.join(" ")},[]),y=Jm.useCallback(w=>{if(t==="select")return;if(t==="eraser"&&e){let T=x(w);if(!T)return;let M=15;for(let _ of [...e.elements].reverse())if(_.type==="ink"&&T.x>=_.x-M&&T.x<=_.x+_.width+M&&T.y>=_.y-M&&T.y<=_.y+_.height+M){l?.(_.id);break}return}let C=x(w);C&&(w.preventDefault(),w.target.setPointerCapture(w.pointerId),u([C]),h([w.pressure]),m(true),i&&(i.current=true));},[t,e,x,i,l]),b=Jm.useCallback(w=>{if(!f||t==="select"||t==="eraser")return;let C=x(w);C&&(u(T=>[...T,C]),h(T=>[...T,w.pressure]));},[f,t,x]),v=Jm.useCallback(w=>{if(!f||t==="select"||t==="eraser")return;if(w.target.releasePointerCapture(w.pointerId),m(false),i&&(i.current=false),d.length<2){u([]);return}let C=1/0,T=1/0,M=-1/0,_=-1/0;for(let k of d)k.x<C&&(C=k.x),k.y<T&&(T=k.y),k.x>M&&(M=k.x),k.y>_&&(_=k.y);let E=o;C-=E,T-=E,M+=E,_+=E;let R=Math.max(M-C,1),I=Math.max(_-T,1),L=d.map(k=>({x:k.x-C,y:k.y-T}));if(t==="freeform"){let F=Math.round(R*100),N=Math.round(I*100),D=[];for(let G=0;G<L.length;G++){let j={x:Math.round(L[G].x*100),y:Math.round(L[G].y*100)};D.push(G===0?{type:"moveTo",pt:j}:{type:"lineTo",pt:j});}D.length>2&&D.push({type:"close"});let U={id:`shape-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"shape",x:C,y:T,width:R,height:I,shapeType:"custom",shapeStyle:{fillColor:"transparent",strokeColor:r,strokeWidth:o},customGeometryPaths:[{width:F,height:N,segments:D}]};a?.(U);}else {let k=g(L),F=t==="highlighter",N=p.length>=2&&p.some(U=>Math.abs(U-p[0])>.01),D={id:`ink-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"ink",x:C,y:T,width:R,height:I,inkPaths:[k],inkColors:[r],inkWidths:[o],inkOpacities:[F?.4:1],inkTool:F?"highlighter":"pen",...N?{inkPointPressures:[p]}:{}};s?.(D);}u([]),h([]);},[f,t,d,r,o,i,s,a,g,p]),S=Jm.useMemo(()=>f?g(d):"",[f,d,g]);return {isDrawing:c,isStrokeActive:f,liveStrokeD:S,currentStrokePoints:d,handleDrawPointerDown:y,handleDrawPointerMove:b,handleDrawPointerUp:v}}function vme(t){let e=Jm.useRef(t);e.current=t;let n=Jm.useCallback((f,m,x)=>e.current.onResizePointerDown(f,m,x),[]),r=Jm.useCallback((f,m)=>e.current.onAdjustmentPointerDown(f,m),[]),o=Jm.useCallback((f,m)=>e.current.onRotate?.(f,m),[]),i=Jm.useCallback(f=>e.current.onInlineEditChange(f),[]),s=Jm.useCallback(()=>e.current.onInlineEditCommit(),[]),a=Jm.useCallback(()=>e.current.onInlineEditCancel(),[]),l=Jm.useCallback((f,m)=>e.current.onTableCellSelect(f,m),[]),c=Jm.useCallback((f,m,x,g)=>e.current.onCommitCellEdit?.(f,m,x,g),[]),d=Jm.useCallback((f,m)=>e.current.onUpdateSmartArtElement?.(f,m),[]),u=Jm.useCallback(f=>e.current.onFormatText?.(f),[]),p=Jm.useCallback((f,m)=>e.current.onResizeTableColumns?.(f,m),[]),h=Jm.useCallback((f,m,x)=>e.current.onResizeTableRow?.(f,m,x),[]);return {cbRef:e,stableResizePointerDown:n,stableAdjustmentPointerDown:r,stableRotate:o,stableInlineEditChange:i,stableInlineEditCommit:s,stableInlineEditCancel:a,stableTableCellSelect:l,stableCommitCellEdit:c,stableUpdateSmartArtElement:d,stableFormatText:u,stableResizeTableColumns:p,stableResizeTableRow:h}}function UG({activeSlide:t,templateElements:e,canvasSize:n,zoom:r,mode:o,canEdit:i,editTemplateMode:s,selectedElementIdSet:a,selectedElement:l,inlineEditingElementId:c,inlineEditingText:d,spellCheckEnabled:u,mediaDataUrls:p,tableEditorState:h,marqueeSelectionState:f,snapLines:m,showGrid:x,gridSpacingPx:g,showRulers:y,rulerUnit:b="inches",guides:v,presentationElementStates:S,presentationKeyframesCss:w,onClick:C,onDoubleClick:T,onMouseDown:M,onContextMenu:_,onCanvasMouseDown:E,onResizePointerDown:R,onAdjustmentPointerDown:I,onRotate:L,onInlineEditChange:k,onInlineEditCommit:F,onInlineEditCancel:N,onTableCellSelect:D,onCommitCellEdit:U,onUpdateSmartArtElement:G,onFormatText:j,onResizeTableColumns:Y,onResizeTableRow:ge,findResults:fe,findResultIndex:de,activeSlideIndex:J,activeTool:re="select",drawingColor:ce="#000000",drawingWidth:ae=3,isDrawingRef:_e,onAddInkElement:xe,onAddFreeformShape:Ee,onEraseInkElement:W,onActionClick:q,onHyperlinkClick:Q,comments:se,showCommentMarkers:me=false,onCommentMarkerClick:P,onMoveGuide:A,onDeleteGuide:O,onCreateGuideFromRuler:z,connectorCreationMode:te=false,onCreateConnector:$,allSlides:Me,onZoomClick:De,sourceSlideIndex:V,fieldContext:B,tableStyleContext:ee,collaborationOverlay:oe}){let pe=(o==="edit"||o==="master")&&i,{cbRef:Ae,stableResizePointerDown:Le,stableAdjustmentPointerDown:ue,stableRotate:we,stableInlineEditChange:Ie,stableInlineEditCommit:He,stableInlineEditCancel:Oe,stableTableCellSelect:$e,stableCommitCellEdit:ot,stableUpdateSmartArtElement:at,stableFormatText:gt,stableResizeTableColumns:le,stableResizeTableRow:Ue}=vme({onClick:C,onDoubleClick:T,onMouseDown:M,onContextMenu:_,onResizePointerDown:R,onAdjustmentPointerDown:I,onRotate:L,onInlineEditChange:k,onInlineEditCommit:F,onInlineEditCancel:N,onTableCellSelect:D,onCommitCellEdit:U,onUpdateSmartArtElement:G,onFormatText:j,onResizeTableColumns:Y,onResizeTableRow:ge}),{elementFindHighlightsMap:Te,selectedBounds:Ve,handleStageClick:Fe,handleStageDblClick:ke,handleStageMouseDown:nt,handleViewportMouseDown:st,handleStagePointerDown:Xn,handleStageContextMenu:Cn,setDraggingGuide:Zi,handleStagePointerMove:bs,handleStagePointerUp:p0}=xme({cbRef:Ae,onCanvasMouseDown:E,findResults:fe,findResultIndex:de,activeSlideIndex:J,selectedElement:l,zoom:r,onMoveGuide:A}),{connectorDragState:_v,handleConnectionSiteDown:h0,handleConnectorDragMove:of,handleConnectionSiteDrop:Pv,handleConnectorDragEnd:f0}=yme({activeSlide:t,zoom:r,onCreateConnector:$}),{isDrawing:m0,isStrokeActive:pl,liveStrokeD:sf,handleDrawPointerDown:vs,handleDrawPointerMove:rp,handleDrawPointerUp:g0}=bme({activeTool:re,activeSlide:t,zoom:r,drawingColor:ce,drawingWidth:ae,isDrawingRef:_e,onAddInkElement:xe,onAddFreeformShape:Ee,onEraseInkElement:W}),af=y?gn:0;return jsxRuntime.jsx("div",{ref:r.canvasViewportRef,"data-pptx-viewport":true,className:"flex-1 overflow-auto relative",style:{touchAction:"pan-x pan-y"},onMouseDown:st,children:jsxRuntime.jsxs("div",{ref:r.editWrapperRef,className:"relative mx-auto my-4",style:{width:n.width*r.editorScale+af,height:n.height*r.editorScale+af},children:[jsxRuntime.jsx(fme,{canvasSize:n,editorScale:r.editorScale,unit:b,visible:y,selectedBounds:Ve,onCreateGuideFromRuler:z}),jsxRuntime.jsxs("div",{ref:r.canvasStageRef,role:"region","aria-label":`Slide ${(J??0)+1}`,"aria-roledescription":"slide",className:"relative shadow-2xl",style:{width:n.width,height:n.height,transform:`scale(${r.editorScale})`,transformOrigin:"top left",marginTop:af,marginLeft:af,touchAction:pe?"none":void 0,backgroundColor:t?.backgroundColor&&t.backgroundColor!=="transparent"?t.backgroundColor:"#ffffff"},onClick:Fe,onDoubleClick:ke,onMouseDown:nt,onPointerDown:pe?Xn:void 0,onContextMenu:Cn,onPointerMove:bs,onPointerUp:p0,children:[w&&jsxRuntime.jsx("style",{children:w}),jsxRuntime.jsx(ume,{canvasSize:n,gridSpacingPx:g,visible:x}),jsxRuntime.jsx(nme,{guides:v,onDeleteGuide:O,onStartGuideDrag:Zi}),jsxRuntime.jsx(rme,{backgroundImage:t?.backgroundImage,backgroundGradient:t?.backgroundGradient}),e.map((Tr,x0)=>jsxRuntime.jsx(dk,{element:Tr,activeSlide:t,isSelected:a.has(Tr.id),isInlineEditing:c===Tr.id,inlineEditingText:d,canInteract:(o==="edit"||o==="master")&&i&&s,spellCheckEnabled:u,mediaDataUrls:p,selectionColorClass:"blue-400",showHoverBorder:false,opacity:.95,templateEditing:s,zIndex:x0,imageAltText:"Template element",showResizeHandles:pe&&a.has(Tr.id)&&a.size<=1&&!c,renderInk:false,renderGroups:false,adjustmentHandleDescriptor:pe&&l?.id===Tr.id?yT(Tr):null,onResizePointerDown:Le,onAdjustmentPointerDown:ue,onRotate:we,onInlineEditChange:Ie,onInlineEditCommit:He,onInlineEditCancel:Oe,onUpdateSmartArtElement:at,onFormatText:gt,onActionClick:q,onHyperlinkClick:Q,animationState:S?.get(Tr.id),presentationElementStates:S,allSlides:Me,onZoomClick:De,sourceSlideIndex:V,fieldContext:B,tableStyleContext:ee},`tpl-${Tr.id}`)),t?.elements.map((Tr,x0)=>jsxRuntime.jsx(dk,{element:Tr,activeSlide:t,isSelected:a.has(Tr.id),isInlineEditing:c===Tr.id,inlineEditingText:d,canInteract:pe,spellCheckEnabled:u,mediaDataUrls:p,tableEditorState:h,selectionColorClass:"blue-500",showHoverBorder:true,zIndex:e.length+x0,imageAltText:"Slide element",showResizeHandles:pe&&a.has(Tr.id)&&a.size<=1&&!c,renderInk:true,renderGroups:true,adjustmentHandleDescriptor:pe&&l?.id===Tr.id?yT(Tr):null,onResizePointerDown:Le,onAdjustmentPointerDown:ue,onRotate:we,onInlineEditChange:Ie,onInlineEditCommit:He,onInlineEditCancel:Oe,onUpdateSmartArtElement:at,onFormatText:gt,onTableCellSelect:$e,onCommitCellEdit:ot,onResizeTableColumns:le,onResizeTableRow:Ue,findHighlights:Te.get(Tr.id),onActionClick:q,onHyperlinkClick:Q,animationState:S?.get(Tr.id),presentationElementStates:S,allSlides:Me,onZoomClick:De,sourceSlideIndex:V,fieldContext:B,tableStyleContext:ee},Tr.id)),jsxRuntime.jsx(ome,{marqueeSelectionState:f}),me&&se&&se.length>0&&jsxRuntime.jsx(ame,{comments:se,canvasSize:n,onCommentMarkerClick:P}),jsxRuntime.jsx(ime,{snapLines:m}),te&&t&&jsxRuntime.jsx(lme,{activeSlide:t,canvasSize:n,zoom:r,connectorDragState:_v,onConnectionSiteDown:h0,onConnectorDragMove:of,onConnectionSiteDrop:Pv,onConnectorDragEnd:f0}),m0&&jsxRuntime.jsx(dme,{canvasSize:n,activeTool:re,drawingColor:ce,drawingWidth:ae,isStrokeActive:pl,liveStrokeD:sf,onPointerDown:vs,onPointerMove:rp,onPointerUp:g0}),oe]})]})})}function HG({isShortcutHelpOpen:t,isAccessibilityPanelOpen:e,showSlideSorter:n,accessibilityIssues:r,slides:o,activeSlideIndex:i,canvasSize:s,canEdit:a,sectionGroups:l,onCloseShortcuts:c,onCloseAccessibility:d,onSelectSlide:u,onMoveSlide:p,onDeleteSlides:h,onDuplicateSlides:f,onToggleHideSlides:m,onCloseSorter:x,reducedMotion:g,onToggleReducedMotion:y}){return t||e||n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t&&jsxRuntime.jsx(h6,{isOpen:t,onClose:c}),e&&jsxRuntime.jsx(f6,{isOpen:e,issues:r,onClose:d,reducedMotion:g,onToggleReducedMotion:y}),n&&jsxRuntime.jsx(WH,{slides:o,activeSlideIndex:i,canvasSize:s,canEdit:a,sectionGroups:l,onSelectSlide:u,onMoveSlide:p,onDeleteSlides:h,onDuplicateSlides:f,onToggleHideSlides:m,onClose:x})]}):null}function VG({activeSlide:t,allSlides:e,isSlideNotesCollapsed:n,canEdit:r,slideCount:o,activeSlideIndex:i,isDirty:s,autosaveStatus:a,onToggleNotes:l,onUpdateNotes:c,collaborationSlot:d,notesPanelHeight:u,onResizeBottom:p,scale:h,onZoomIn:f,onZoomOut:m,onZoomToFit:x,mode:g,onSetMode:y,onToggleSlideSorter:b,hideStatusBar:v=false}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[p&&!n&&jsxRuntime.jsx(yu,{direction:"vertical",onResize:p}),jsxRuntime.jsx(qH,{activeSlide:t,allSlides:e,isExpanded:!n,canEdit:r,onToggle:l,onUpdateNotes:c,panelHeight:u}),!v&&jsxRuntime.jsx(x6,{slideCount:o,activeSlideIndex:i,isDirty:s,autosaveStatus:a,scale:h,onZoomIn:f,onZoomOut:m,onZoomToFit:x,isNotesExpanded:!n,onToggleNotes:l,mode:g,onSetMode:y,onToggleSlideSorter:b,collaborationSlot:d})]})}function GG({isOpen:t,canEdit:e,mode:n,activeSlide:r,slides:o,canvasSize:i,selectedElement:s,effectiveSelectedIds:a,tableEditorState:l,sidebarPanelMode:c,activeSlideIndex:d,comments:u,onSetSidebarPanelMode:p,onClose:h,onUpdateElementStyle:f,onUpdateTextStyle:m,onUpdateElement:x,onApplySelection:g,onSetCanvasSize:y,onMoveLayer:b,onMoveLayerToEdge:v,onDeleteElement:S,onUpdateSlide:w,presentationProperties:C,onUpdatePresentationProperties:T,notesMaster:M,handoutMaster:_,notesCanvasSize:E,coreProperties:R,appProperties:I,customProperties:L,themeOptions:k,onUpdateCoreProperties:F,onUpdateAppProperties:N,onUpdateCustomProperties:D,tagCollections:U,onUpdateTagCollections:G,onApplyTheme:j,editTemplateMode:Y,slideMasters:ge,onSetTemplateBackground:fe,onGetTemplateBackgroundColor:de,mediaDataUrls:J,theme:re,panelWidth:ce}){if(!t)return null;let ae=c;if(!s&&ae!=="comments"&&ae!=="properties")return null;let _e=r?.id??"",xe=u.commentDraftBySlideId[_e]??"",Ee=u.editingCommentIdBySlideId[_e]??null;return jsxRuntime.jsx("div",{role:"complementary","aria-label":"Properties",className:"h-full flex-shrink-0 max-md:absolute max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:z-30",style:ce?{width:ce}:void 0,children:jsxRuntime.jsx(uG,{isOpen:t,canEdit:e,mode:n,activeSlide:r,slides:o,canvasSize:i,selectedElement:s,selectedElementIds:a,tableEditorState:l,activeTab:c,onSetActiveTab:W=>p(W),onClose:h,onUpdateElementStyle:f,onUpdateTextStyle:m,onUpdateElement:x,onUpdateSlide:w,onSelectElement:W=>g(W),onMoveLayer:b,onMoveLayerToEdge:v,onDeleteElement:S,comments:r?.comments??[],presentationProperties:C,onUpdatePresentationProperties:T,notesMaster:M,handoutMaster:_,notesCanvasSize:E,coreProperties:R,appProperties:I,customProperties:L,themeOptions:k,onUpdateCoreProperties:F,onUpdateAppProperties:N,onUpdateCustomProperties:D,tagCollections:U,onUpdateTagCollections:G,onApplyTheme:j,commentDraft:xe,editingCommentId:Ee,commentEditDraft:Ee?u.commentEditDraftByCommentId[Ee]??"":"",onSetCommentDraft:W=>u.handleCommentDraftChange(_e,W),onAddComment:()=>u.handleAddSlideComment(d),onDeleteComment:W=>u.handleDeleteSlideComment(d,W),onStartEditComment:W=>u.handleStartCommentEdit(_e,W),onSaveEditComment:W=>u.handleSaveCommentEdit(d,W),onCancelEditComment:()=>u.handleCancelCommentEdit(_e),onSetCommentEditDraft:W=>u.handleSetCommentEditDraft(u.editingCommentIdBySlideId[_e]??"",W),onToggleCommentResolved:W=>u.handleToggleCommentResolved(d,W),onStartReply:W=>u.handleStartReply(d,W),onCancelReply:u.handleCancelReply,onReplyDraftChange:(W,q)=>u.handleReplyDraftChange(W,q),onSubmitReply:W=>u.handleSubmitReply(d,W),replyingToCommentId:u.replyingToCommentId,replyDraftByCommentId:u.replyDraftByCommentId,onUpdateCanvasSize:y,editTemplateMode:Y,slideMasters:ge,onSetTemplateBackground:fe,onGetTemplateBackgroundColor:de,mediaDataUrls:J,theme:re,panelWidth:ce})})}function Tme(t,e){if(!e?.layoutPath||!t.some(d=>d.masterPath))return t;let o=t.find(d=>d.path===e.layoutPath)?.masterPath;if(!o)return t;let i=t.filter(d=>d.masterPath===o),s=new Map;for(let d of i){let u=d.path===e.layoutPath;(!s.get(d.name)||u)&&s.set(d.name,d);}let a=new Set(Array.from(s.values()).map(d=>d.path)),l=[],c=new Set;for(let d of i)a.has(d.path)&&(c.has(d.name)||(c.add(d.name),l.push(d)));return l}Pe();function Mme(t){let{t:e}=reactI18next.useTranslation(),n=(t.mode==="edit"||t.mode==="master")&&t.canEdit,r=nre({autosaveState:t.autosaveStatus?.state??"idle",isDirty:t.isDirty,autosaveEnabled:t.autosaveEnabled});return jsxRuntime.jsxs("div",{className:Fn.container,"data-pptx-title-bar":"",children:[jsxRuntime.jsx("span",{className:Fn.logo,"aria-hidden":"true",children:"P"}),n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:Fn.autosaveGroup,children:[jsxRuntime.jsx("span",{className:Fn.autosaveLabel,children:e("pptx.titleBar.autoSave")}),jsxRuntime.jsx("button",{type:"button",role:"switch","aria-checked":t.autosaveEnabled,onClick:t.onToggleAutosave,className:ie(Fn.toggleTrack,t.autosaveEnabled?Fn.toggleTrackOn:Fn.toggleTrackOff),title:e("pptx.titleBar.toggleAutoSave"),"aria-label":e("pptx.titleBar.toggleAutoSave"),children:jsxRuntime.jsx("span",{className:ie(Fn.toggleKnob,t.autosaveEnabled?Fn.toggleKnobOn:Fn.toggleKnobOff)})}),jsxRuntime.jsx("span",{className:Fn.autosaveLabel,children:e(t.autosaveEnabled?"pptx.titleBar.autoSaveOn":"pptx.titleBar.autoSaveOff")})]}),jsxRuntime.jsx("div",{className:Fn.separator}),t.onSave&&jsxRuntime.jsx("button",{type:"button",onClick:t.onSave,className:Fn.quickButton,title:e("pptx.titleBar.save"),"aria-label":e("pptx.titleBar.save"),children:jsxRuntime.jsx(lu$1.LuSave,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",onClick:t.onUndo,disabled:!t.canUndo,className:Fn.quickButton,title:t.undoLabel?e("pptx.toolbar.undoAction",{action:t.undoLabel}):e("pptx.toolbar.undo"),"aria-label":e("pptx.toolbar.undo"),children:jsxRuntime.jsx(lu$1.LuUndo,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",onClick:t.onRedo,disabled:!t.canRedo,className:Fn.quickButton,title:t.redoLabel?e("pptx.toolbar.redoAction",{action:t.redoLabel}):e("pptx.toolbar.redo"),"aria-label":e("pptx.toolbar.redo"),children:jsxRuntime.jsx(lu$1.LuRedo,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("div",{className:Fn.separator})]}),jsxRuntime.jsxs("span",{className:Fn.fileGroup,children:[jsxRuntime.jsx("span",{className:Fn.fileName,children:t.fileName||e(rre)}),n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:Fn.statusDot,"aria-hidden":"true",children:"\u2022"}),jsxRuntime.jsx("span",{className:ie(Fn.statusText,t.autosaveStatus?.state==="error"&&t.autosaveEnabled&&Fn.statusError,t.autosaveStatus?.state==="saving"&&t.autosaveEnabled&&Fn.statusSaving),children:e(r)})]})]}),jsxRuntime.jsx("span",{className:Fn.searchWrap,children:(t.mode==="edit"||t.mode==="master")&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleFindReplace,className:ie(Fn.searchBox,t.findReplaceOpen&&"text-foreground bg-background"),title:e("pptx.findReplace.title"),"aria-label":e("pptx.titleBar.search"),children:[jsxRuntime.jsx(lu$1.LuSearch,{className:Fn.searchIcon}),jsxRuntime.jsx("span",{className:Fn.searchLabel,children:e("pptx.titleBar.search")})]})}),jsxRuntime.jsx("span",{className:Fn.rightSpacer})]})}function WG(t){let{mode:e,canEdit:n,state:r,selectedElement:o,activeSlide:i,zoom:s,history:a,findReplace:l,manipulation:c,insertHandlers:d,exportHandlers:u,printHandlers:p,propertyHandlers:h,dialogs:f,slideOps:m,ops:x,onSetMode:g,onEnterPresenterView:y,onEnterRehearsalMode:b,onOpenSettings:v,onOpenShareDialog:S,onOpenFile:w,onToggleFormatPainter:C,fileName:T,autosaveStatus:M,autosaveEnabled:_=true,onToggleAutosave:E}=t,R=Jm.useCallback((N,D)=>{if(!o||!i)return;let U=i.animations??[],G=U.find(Y=>Y.elementId===o.id),j=N;if(G){let Y=U.map(ge=>ge.elementId===o.id?{...ge,[D]:j}:ge);h.handleUpdateSlide({animations:Y});}else {let Y={elementId:o.id,[D]:j,durationMs:500,order:U.length,trigger:"onClick"};h.handleUpdateSlide({animations:[...U,Y]});}},[o,i,h]),I=Jm.useCallback(()=>{if(!o||!i)return;let D=(i.animations??[]).filter(U=>U.elementId!==o.id);h.handleUpdateSlide({animations:D});},[o,i,h]),L=Jm.useCallback(N=>{if(!i)return;let D=i.transition??{type:"none"};h.handleUpdateSlide({transition:{...D,...N}});},[i,h]),k=Jm__default.default.useMemo(()=>Tme(r.layoutOptions,i),[r.layoutOptions,i]),F=Jm.useCallback(()=>{let N=i?.transition;N&&(x.updateSlides(D=>D.map(U=>({...U,transition:N}))),a.markDirty());},[i,x,a]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!f.isNarrowViewport&&jsxRuntime.jsx(Mme,{mode:e,canEdit:n,fileName:T,isDirty:r.isDirty,autosaveStatus:M,autosaveEnabled:_,onToggleAutosave:E??(()=>{}),canUndo:a.canUndo,canRedo:a.canRedo,undoLabel:a.undoLabel,redoLabel:a.redoLabel,onUndo:a.handleUndo,onRedo:a.handleRedo,onSave:u.handleSaveAsPptx,findReplaceOpen:l.findReplaceOpen,onToggleFindReplace:()=>l.setFindReplaceOpen(!l.findReplaceOpen)}),jsxRuntime.jsx(WV,{mode:e,canEdit:n,isNarrowViewport:f.isNarrowViewport,isSidebarCollapsed:!r.isSlidesPaneOpen,isInspectorPaneOpen:r.isInspectorPaneOpen,isCompactToolbarOpen:r.isCompactToolbarOpen,toolbarSection:r.toolbarSection,scale:s.scale,canUndo:a.canUndo,canRedo:a.canRedo,undoLabel:a.undoLabel,redoLabel:a.redoLabel,findReplaceOpen:l.findReplaceOpen,selectedElement:o,tableEditorState:r.tableEditorState,editTemplateMode:r.editTemplateMode,newShapeType:r.newShapeType,activeTool:r.activeTool,drawingColor:r.drawingColor,drawingWidth:r.drawingWidth,clipboardPayload:r.clipboardPayload,onSetMode:g,onToggleSidebar:()=>r.setIsSlidesPaneOpen(N=>!N),onToggleInspector:()=>r.setIsInspectorPaneOpen(N=>!N),onOpenAnimationPanel:()=>{r.setIsInspectorPaneOpen(true),r.setSidebarPanelMode("properties");},onAddAnimation:R,onRemoveAnimation:I,onToggleCompactToolbar:()=>r.setIsCompactToolbarOpen(N=>!N),onSetToolbarSection:r.setToolbarSection,onZoomIn:s.handleZoomIn,onZoomOut:s.handleZoomOut,onZoomToFit:s.handleZoomToFit,onUndo:a.handleUndo,onRedo:a.handleRedo,onToggleFindReplace:()=>l.setFindReplaceOpen(!l.findReplaceOpen),onSetNewShapeType:r.setNewShapeType,onAddTextBox:d.handleAddTextBox,onAddShape:d.handleAddShape,onAddTable:d.handleAddTable,onAddChart:d.handleAddChart,onAddSmartArt:()=>f.setIsSmartArtDialogOpen(true),onAddEquation:()=>{f.setEditingEquationOmml(null),f.setIsEquationDialogOpen(true);},onAddActionButton:d.handleAddActionButton,onInsertField:d.handleInsertField,onOpenImagePicker:()=>r.imageInputRef.current?.click(),onOpenMediaPicker:()=>r.mediaInputRef.current?.click(),onSetActiveTool:r.setActiveTool,onSetDrawingColor:r.setDrawingColor,onSetDrawingWidth:r.setDrawingWidth,onSetEditTemplateMode:r.setEditTemplateMode,spellCheckEnabled:r.spellCheckEnabled,showGrid:r.showGrid,showRulers:r.showRulers,snapToGrid:r.snapToGrid,snapToShape:r.snapToShape,onSetSpellCheckEnabled:r.setSpellCheckEnabled,onSetShowGrid:r.setShowGrid,onSetShowRulers:r.setShowRulers,onSetSnapToGrid:r.setSnapToGrid,onSetSnapToShape:r.setSnapToShape,onAddGuide:f.handleAddGuide,onAlignElements:c.handleAlignElements,onDistributeElements:c.handleDistributeElements,canDistribute:c.canDistribute,onCopy:c.handleCopy,onCut:c.handleCut,onPaste:c.handlePaste,onFlip:c.handleFlip,onMoveLayer:c.handleMoveLayer,onMoveLayerToEdge:c.handleMoveLayerToEdge,onDuplicate:c.handleDuplicate,onDelete:c.handleDelete,onExportPng:u.handleExportPng,onExportPdf:u.handleExportPdf,onExportVideo:u.handleExportVideo,onExportGif:u.handleExportGif,onPackageForSharing:u.handlePackageForSharing,onOpenFile:w,onOpenShareDialog:S,onSaveAsPptx:u.handleSaveAsPptx,onSaveAsPpsx:u.handleSaveAsPpsx,onSaveAsPptm:u.handleSaveAsPptm,hasMacros:r.hasMacros,onCopySlideAsImage:u.handleCopySlideAsImage,onPrint:p.handlePrint,onToggleShortcuts:()=>r.setIsShortcutHelpOpen(N=>!N),onOpenSettings:v,onRunAccessibilityCheck:f.handleRunAccessibilityCheck,onToggleSlideSorter:()=>r.setShowSlideSorter(N=>!N),onUpdateTextStyle:x.updateSelectedTextStyle,isOverflowMenuOpen:r.isOverflowMenuOpen,onSetOverflowMenuOpen:r.setIsOverflowMenuOpen,layoutOptions:k,onInsertSlideFromLayout:m.handleInsertSlideFromLayout,customShows:r.customShows,activeCustomShowId:r.activeCustomShowId,onSetActiveCustomShowId:r.setActiveCustomShowId,onCreateCustomShow:f.handleCreateCustomShow,onRenameActiveCustomShow:f.handleRenameActiveCustomShow,onDeleteActiveCustomShow:f.handleDeleteActiveCustomShow,onToggleCurrentSlideInActiveShow:f.handleToggleCurrentSlideInActiveShow,isCurrentSlideInActiveShow:f.isCurrentSlideInActiveShow,onEnterMasterView:f.handleEnterMasterView,onCloseMasterView:f.handleCloseMasterView,onToggleVersionHistory:()=>h.setIsVersionHistoryOpen(N=>!N),onOpenPasswordProtection:()=>f.setIsPasswordDialogOpen(true),onOpenDocumentProperties:()=>f.setIsDocPropsDialogOpen(true),onOpenFontEmbedding:()=>f.setIsFontEmbeddingOpen(true),onOpenDigitalSignatures:()=>f.setIsDigitalSigDialogOpen(true),onEnterPresenterView:y,onEnterRehearsalMode:b,onToggleThemeEditor:()=>r.setIsThemeEditorOpen(N=>!N),isThemeEditorOpen:r.isThemeEditorOpen,onToggleThemeGallery:()=>r.setIsThemeGalleryOpen(N=>!N),isThemeGalleryOpen:r.isThemeGalleryOpen,onCompare:h.handleCompare,onToggleComments:()=>{r.setSidebarPanelMode("comments"),r.isInspectorPaneOpen||r.setIsInspectorPaneOpen(true);},isCommentsPanelOpen:r.isInspectorPaneOpen,slideCommentCount:i?.comments?.length??0,formatPainterActive:r.formatPainterActive,canActivateFormatPainter:xU(o),onToggleFormatPainter:C??(()=>r.setFormatPainterActive(N=>!N)),isSelectionPaneOpen:r.isSelectionPaneOpen,onToggleSelectionPane:()=>r.setIsSelectionPaneOpen(N=>!N),eyedropperActive:r.eyedropperActive,onToggleEyedropper:()=>r.setEyedropperActive(N=>!N),onOpenSetUpSlideShow:()=>f.setIsSetUpSlideShowOpen(true),onOpenBroadcastDialog:()=>f.setIsBroadcastDialogOpen(true),onToggleSubtitles:f.handleToggleSubtitles,showSubtitles:!!r.presentationProperties.showSubtitles,activeSlide:i,onTransitionChange:L,onApplyTransitionToAll:F}),r.hasDigitalSignatures&&jsxRuntime.jsx("div",{className:"flex items-center px-3 py-1 z-10",children:jsxRuntime.jsx(MV,{hasSignatures:r.hasDigitalSignatures,signatureCount:r.digitalSignatureCount,onClick:()=>f.setIsDigitalSigDialogOpen(true)})}),jsxRuntime.jsx("input",{ref:r.imageInputRef,type:"file",name:"image-upload",accept:"image/*",className:"hidden",onChange:d.handleImageFileChange}),jsxRuntime.jsx("input",{ref:r.mediaInputRef,type:"file",name:"media-upload",accept:"video/*,audio/*",className:"hidden",onChange:d.handleMediaFileChange})]})}Pe();function Ame(t){let e=C6e__default.default;return typeof e.sanitize!="function"?t:e.sanitize(t,{USE_PROFILES:{mathMl:true,svg:true}})}var Rme=[{label:"Fraction",latex:"\\frac{a}{b}",i18nKey:"pptx.equation.template.fraction"},{label:"Quadratic",latex:"x=\\frac{-b\\pm\\sqrt{b^{2}-4ac}}{2a}",i18nKey:"pptx.equation.template.quadratic"},{label:"Pythagorean",latex:"a^{2}+b^{2}=c^{2}",i18nKey:"pptx.equation.template.pythagorean"},{label:"Sum",latex:"\\sum_{i=1}^{n}{a_{i}}",i18nKey:"pptx.equation.template.sum"},{label:"Integral",latex:"\\int_{a}^{b}{f(x)}dx",i18nKey:"pptx.equation.template.integral"},{label:"Square Root",latex:"\\sqrt{x^{2}+y^{2}}",i18nKey:"pptx.equation.template.squareRoot"},{label:"Limit",latex:"\\lim_{x\\to\\infty}{f(x)}",i18nKey:"pptx.equation.template.limit"},{label:"Euler's",latex:"e^{i\\pi}+1=0",i18nKey:"pptx.equation.template.euler"},{label:"Matrix 2x2",latex:"\\left[a,b;c,d\\right]",i18nKey:"pptx.equation.template.matrix"},{label:"Binomial",latex:"\\left(a+b\\right)^{n}",i18nKey:"pptx.equation.template.binomial"},{label:"Derivative",latex:"\\frac{dy}{dx}",i18nKey:"pptx.equation.template.derivative"},{label:"Trig Identity",latex:"\\sin^{2}\\theta+\\cos^{2}\\theta=1",i18nKey:"pptx.equation.template.trigIdentity"}],Xdt=Rme.map(t=>{try{let e=eT(t.latex),n=_y(e);return n?Ame(n):""}catch{return ""}});function jdt({mathml:t}){let e=Jm.useRef(null);return Jm.useEffect(()=>{e.current&&(t?e.current.innerHTML=Ame(t):e.current.innerHTML="");},[t]),jsxRuntime.jsx("div",{ref:e,className:"flex items-center justify-center min-h-[80px] text-2xl text-foreground",style:{fontFamily:'"Cambria Math", "STIX Two Math", serif'}})}function kme({isOpen:t,onClose:e,onInsert:n,existingOmml:r}){let{t:o}=reactI18next.useTranslation(),{panelStyle:i,handlers:s}=pi(e),a=Jm.useMemo(()=>r?w4(r):"",[r]),[l,c]=Jm.useState(a),d=Jm.useDeferredValue(l),u=Jm.useRef(null);Jm.useEffect(()=>{t&&(c(a),setTimeout(()=>u.current?.focus(),50));},[t,a]);let{mathml:p,omml:h}=Jm.useMemo(()=>{if(!d.trim())return {mathml:"",omml:{}};try{let b=eT(d);return {mathml:_y(b),omml:b}}catch{return {mathml:"",omml:{}}}},[d]),f=Jm.useCallback(()=>{if(!l.trim())return;let b=h;try{let v=eT(l);v&&Object.keys(v).length>0&&(b=v);}catch{}n(b),e();},[l,h,n,e]),m=Jm.useCallback(b=>{c(b);},[]),x=Jm.useCallback(b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),f()),b.key==="Escape"&&(b.preventDefault(),e());},[f,e]);if(!t)return null;let g=!!r,y=l.trim().length>0&&Object.keys(h).length>0;return jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:b=>{b.target===b.currentTarget&&e();},onKeyDown:x,children:jsxRuntime.jsxs("div",{style:i,className:"bg-background border border-border rounded-xl shadow-2xl w-[640px] max-h-[85vh] flex flex-col overflow-hidden max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",onClick:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{...s,className:"flex items-center justify-between px-5 py-3 border-b border-border touch-none",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:g?o("pptx.equation.editTitle","Edit Equation"):o("pptx.equation.insertTitle","Insert Equation")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-muted/60 p-4 min-h-[80px] flex items-center justify-center",children:y?jsxRuntime.jsx(jdt,{mathml:p}):jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground italic",children:o("pptx.equation.previewPlaceholder","Equation preview will appear here")})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs font-medium text-muted-foreground mb-1.5",children:o("pptx.equation.latexInput","LaTeX Input")}),jsxRuntime.jsx("textarea",{ref:u,value:l,onChange:b=>c(b.target.value),placeholder:"\\\\frac{a}{b} + \\\\sqrt{c}",className:"w-full h-24 px-3 py-2 rounded-lg border border-border bg-muted text-foreground text-sm font-mono resize-none focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary placeholder:text-muted-foreground",spellCheck:false}),jsxRuntime.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:o("pptx.equation.latexHint","Use LaTeX syntax. Ctrl+Enter to insert.")})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:o("pptx.equation.templates","Common Templates")}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:Rme.map((b,v)=>{let S=Xdt[v];return jsxRuntime.jsxs("button",{type:"button",onClick:()=>m(b.latex),className:ie("flex flex-col items-center gap-1 p-2 rounded-lg border transition-colors",l===b.latex?"border-primary bg-primary/10":"border-border bg-muted/40 hover:bg-accent/60 hover:border-border"),title:o(b.i18nKey,b.label),children:[jsxRuntime.jsx("div",{className:"text-sm text-foreground h-8 flex items-center justify-center overflow-hidden",style:{fontFamily:'"Cambria Math", "STIX Two Math", serif'},dangerouslySetInnerHTML:{__html:S}}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground truncate w-full text-center",children:o(b.i18nKey,b.label)})]},b.latex)})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-4 py-1.5 rounded-lg text-xs text-foreground hover:bg-accent transition-colors",children:o("pptx.equation.cancel","Cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:f,disabled:!y,className:"px-4 py-1.5 rounded-lg text-xs font-medium bg-primary hover:bg-primary/80 text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:g?o("pptx.equation.update","Update"):o("pptx.equation.insert","Insert")})]})]})})}Pe();var dl=["#3b82f6","#22c55e","#f97316","#eab308"];function Kdt(){return jsxRuntime.jsx("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[0,1,2].map(t=>jsxRuntime.jsx("rect",{x:4,y:3+t*12,width:52,height:10,rx:2,fill:dl[t],opacity:.85},t))})}function qdt(){return jsxRuntime.jsx("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[0,1,2].map(t=>{let e=2+t*19,n=`${e},10 ${e+14},10 ${e+18},20 ${e+14},30 ${e},30 ${t>0?e+4:e},20`;return jsxRuntime.jsx("polygon",{points:n,fill:dl[t],opacity:.85},t)})})}function Zdt(){return jsxRuntime.jsx("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[0,1,2,3].map(t=>{let e=t/4*Math.PI*2-Math.PI/2,n=30+13*Math.cos(e),r=20+10*Math.sin(e);return jsxRuntime.jsx("circle",{cx:n,cy:r,r:6,fill:dl[t],opacity:.85},t)})})}function Jdt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:20,y:3,width:20,height:10,rx:2,fill:dl[0],opacity:.85}),jsxRuntime.jsx("line",{x1:30,y1:13,x2:30,y2:18,stroke:"#94a3b8",strokeWidth:1}),jsxRuntime.jsx("line",{x1:15,y1:18,x2:45,y2:18,stroke:"#94a3b8",strokeWidth:1}),jsxRuntime.jsx("rect",{x:4,y:20,width:18,height:10,rx:2,fill:dl[1],opacity:.85}),jsxRuntime.jsx("rect",{x:38,y:20,width:18,height:10,rx:2,fill:dl[2],opacity:.85}),jsxRuntime.jsx("line",{x1:15,y1:18,x2:15,y2:20,stroke:"#94a3b8",strokeWidth:1}),jsxRuntime.jsx("line",{x1:45,y1:18,x2:45,y2:20,stroke:"#94a3b8",strokeWidth:1})]})}function Qdt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:22,cy:20,r:14,fill:dl[0],opacity:.3}),jsxRuntime.jsx("circle",{cx:38,cy:20,r:14,fill:dl[1],opacity:.3}),jsxRuntime.jsx("circle",{cx:30,cy:10,r:14,fill:dl[2],opacity:.3})]})}function eut(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:30,cy:20,r:7,fill:dl[0],opacity:.85}),[0,1,2].map(t=>{let e=t/3*Math.PI*2-Math.PI/2,n=30+15*Math.cos(e),r=20+12*Math.sin(e);return jsxRuntime.jsxs(Jm__default.default.Fragment,{children:[jsxRuntime.jsx("line",{x1:30,y1:20,x2:n,y2:r,stroke:"#94a3b8",strokeWidth:1,opacity:.5}),jsxRuntime.jsx("circle",{cx:n,cy:r,r:5,fill:dl[t+1],opacity:.85})]},t)})]})}function tut(){return jsxRuntime.jsx("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[0,1,2].map(t=>jsxRuntime.jsx("rect",{x:4+t*18,y:8,width:16,height:24,rx:3,fill:dl[t],opacity:.85},t))})}function Ime(t){switch(t){case "basicBlockList":case "stackedList":case "tableList":case "horizontalBulletList":return jsxRuntime.jsx(Kdt,{});case "basicChevronProcess":case "segmentedProcess":case "continuousBlockProcess":case "upwardArrow":return jsxRuntime.jsx(qdt,{});case "basicCycle":case "basicPie":return jsxRuntime.jsx(Zdt,{});case "basicRadial":case "convergingRadial":return jsxRuntime.jsx(eut,{});case "hierarchy":return jsxRuntime.jsx(Jdt,{});case "basicVenn":case "linearVenn":return jsxRuntime.jsx(Qdt,{});default:return jsxRuntime.jsx(tut,{})}}function Lme({isOpen:t,onClose:e,onInsert:n}){let{t:r}=reactI18next.useTranslation(),{panelStyle:o,handlers:i}=pi(e),[s,a]=Jm.useState("list"),[l,c]=Jm.useState(null),d=tR.filter(p=>p.category===s),u=Jm.useCallback(()=>{if(!l)return;let p=tR.find(h=>h.layout===l);p&&(n(p.layout,p.defaultItems),e());},[l,n,e]);return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/50",onClick:e,"aria-label":"Close"}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{style:o,className:"pointer-events-auto w-[600px] max-w-[90vw] max-h-[80vh] rounded-lg border border-border bg-background shadow-2xl flex flex-col max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",role:"dialog","aria-modal":"true","aria-label":r("pptx.smartart.insertTitle"),children:[jsxRuntime.jsxs("div",{...i,className:"flex items-center justify-between px-4 py-3 border-b border-border touch-none",children:[jsxRuntime.jsx("h2",{className:"text-sm font-medium text-foreground",children:r("pptx.smartart.insertTitle")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-muted transition-colors","aria-label":r("pptx.smartart.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"w-40 border-r border-border py-2",children:NU.map(p=>jsxRuntime.jsx("button",{type:"button",onClick:()=>{a(p.id),c(null);},className:ie("w-full text-left px-3 py-1.5 text-xs transition-colors",s===p.id?"bg-primary text-white":"text-foreground hover:bg-muted"),children:r(p.label)},p.id))}),jsxRuntime.jsx("div",{className:"flex-1 p-3 overflow-y-auto",children:jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:d.map(p=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>c(p.layout),onDoubleClick:()=>{c(p.layout),n(p.layout,p.defaultItems),e();},className:ie("flex flex-col items-center gap-1 p-2 rounded border transition-colors",l===p.layout?"border-primary bg-primary/20":"border-border hover:border-border hover:bg-muted/50"),children:[jsxRuntime.jsx("div",{className:"w-16 h-12 flex items-center justify-center bg-muted rounded",children:Ime(p.layout)}),jsxRuntime.jsx("span",{className:"text-[10px] text-foreground text-center leading-tight",children:r(p.labelKey)})]},p.layout))})})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-xs rounded bg-muted hover:bg-accent text-foreground transition-colors",children:r("pptx.smartart.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:u,disabled:!l,className:ie("px-3 py-1.5 text-xs rounded transition-colors",l?"bg-primary hover:bg-primary/80 text-white":"bg-muted text-muted-foreground cursor-not-allowed"),children:r("pptx.smartart.insert")})]})]})})]}):null}function jG(t){let{dialogs:e,insertHandlers:n,exportHandlers:r,printHandlers:o,propertyHandlers:i,annotations:s,slides:a,activeSlideIndex:l,canvasSize:c,filePath:d,coreProperties:u,customProperties:p,appProperties:h,embeddedFonts:f,hasDigitalSignatures:m,digitalSignatureCount:x,presentationProperties:g,customShows:y,selectedElements:b,isEncryptedDialogOpen:v,setIsEncryptedDialogOpen:S,showKeepAnnotationsDialog:w,onKeepAnnotations:C,onDiscardAnnotations:T}=t;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(JH,{isOpen:i.isVersionHistoryOpen,filePath:d,onClose:()=>i.setIsVersionHistoryOpen(false),onRestore:i.handleRestoreVersion}),jsxRuntime.jsx(ez,{isOpen:i.isComparePanelOpen,compareResult:i.compareResult,canvasSize:c,onClose:()=>i.setIsComparePanelOpen(false),onAcceptSlide:i.handleAcceptSlide,onRejectSlide:i.handleRejectSlide,onAcceptAll:i.handleAcceptAllSlides}),jsxRuntime.jsx(nz,{isOpen:e.isPasswordDialogOpen,isCurrentlyProtected:e.isPasswordProtected,onClose:()=>e.setIsPasswordDialogOpen(false),onSetPassword:e.handleSetPassword,onRemovePassword:e.handleRemovePassword}),jsxRuntime.jsx(vV,{isOpen:e.isDocPropsDialogOpen,coreProperties:u??{},customProperties:p,appProperties:h,onClose:()=>e.setIsDocPropsDialogOpen(false),onSave:(M,_,E)=>{i.handleUpdateCoreProperties(M),i.handleUpdateCustomProperties(_),E&&i.handleUpdateAppProperties(E);}}),jsxRuntime.jsx(wV,{isOpen:e.isFontEmbeddingOpen,embedFontsEnabled:e.embedFontsEnabled,usedFontFamilies:i.usedFontFamilies,embeddedFonts:f.map(M=>M.name),onClose:()=>e.setIsFontEmbeddingOpen(false),onToggleEmbedFonts:e.setEmbedFontsEnabled}),jsxRuntime.jsx(CV,{isOpen:e.isDigitalSigDialogOpen,onClose:()=>e.setIsDigitalSigDialogOpen(false),hasSignatures:m,signatureCount:x}),jsxRuntime.jsx(_V,{isOpen:e.isSignatureStrippedDialogOpen,signatureCount:x,onConfirm:()=>e.setIsSignatureStrippedDialogOpen(false),onCancel:()=>e.setIsSignatureStrippedDialogOpen(false)}),jsxRuntime.jsx(PV,{isOpen:v,onClose:()=>S(false)}),jsxRuntime.jsx(Lme,{isOpen:e.isSmartArtDialogOpen,onClose:()=>e.setIsSmartArtDialogOpen(false),onInsert:n.handleInsertSmartArt}),jsxRuntime.jsx(kme,{isOpen:e.isEquationDialogOpen,onClose:()=>e.setIsEquationDialogOpen(false),onInsert:e.editingEquationOmml?n.handleUpdateEquation:n.handleInsertEquation,existingOmml:e.editingEquationOmml}),jsxRuntime.jsx(NG,{open:e.isHyperlinkDialogOpen,initialUrl:b[0]?.actionClick?.url,initialTooltip:b[0]?.actionClick?.tooltip,initialAction:b[0]?.actionClick?.action,slideCount:a.length,onConfirm:n.handleHyperlinkConfirm,onCancel:()=>e.setIsHyperlinkDialogOpen(false)}),jsxRuntime.jsx(g6,{isOpen:r.exportModalOpen,title:r.exportModalTitle,progress:r.exportProgress,statusMessage:r.exportStatusMessage,onCancel:r.handleCancelExport}),jsxRuntime.jsx(TG,{open:e.isSetUpSlideShowOpen,onClose:()=>e.setIsSetUpSlideShowOpen(false),properties:g,onSave:e.handleSaveSlideShowSettings,customShows:y,slideCount:a.length}),jsxRuntime.jsx(wG,{open:o.isPrintDialogOpen,onClose:()=>o.setIsPrintDialogOpen(false),onPrint:o.handlePrintWithSettings,slides:a,activeSlideIndex:l,defaultSlidesPerPage:g.printSlidesPerPage,defaultFrameSlides:g.printFrameSlides}),jsxRuntime.jsx(vG,{isOpen:w,annotationCount:Array.from(s.allSlideAnnotations.values()).reduce((M,_)=>M+_.length,0),slideCount:s.allSlideAnnotations.size,onKeep:C,onDiscard:T})]})}function YG(t){let{mode:e,slides:n,canvasSize:r,templateElements:o,presentation:i,onExitPresentation:s,isMobile:a}=t,l=e==="present"&&i.presenterMode;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l&&(a?jsxRuntime.jsx(RV,{slides:n,currentSlideIndex:i.presentationSlideIndex,canvasSize:r,templateElements:o,presentationStartTime:i.presentationStartTime,onMovePresentationSlide:i.movePresentationSlide,onExit:s}):jsxRuntime.jsx(AV,{slides:n,currentSlideIndex:i.presentationSlideIndex,canvasSize:r,templateElements:o,presentationStartTime:i.presentationStartTime,onMovePresentationSlide:i.movePresentationSlide,onExit:s,onOpenAudienceWindow:i.openAudienceWindow,onCloseAudienceWindow:i.closeAudienceWindow,isAudienceWindowOpen:i.isAudienceWindowOpen()})),e==="present"&&i.rehearsing&&jsxRuntime.jsx(IV,{presentationStartTime:i.presentationStartTime,slideStartTime:i.slideStartTime,paused:i.rehearsalPaused,onTogglePause:i.toggleRehearsalPause}),i.showRehearsalSummary&&jsxRuntime.jsx(NV,{slides:n,canvasSize:r,recordedTimings:i.recordedTimings,onSave:i.saveRehearsalTimings,onDiscard:i.dismissRehearsalSummary})]})}var uut=50;function Fme(t){let{enabled:e,onNext:n,onPrev:r}=t,o=Jm.useRef(null),i=Jm.useCallback(a=>{if(!e||a.changedTouches.length!==1){o.current=null;return}let l=a.changedTouches[0];o.current={x:l.clientX,y:l.clientY};},[e]),s=Jm.useCallback(a=>{let l=o.current;if(o.current=null,!e||l===null||a.changedTouches.length!==1)return;let c=a.changedTouches[0],d=c.clientX-l.x,u=c.clientY-l.y;Math.abs(d)<uut||Math.abs(d)<=Math.abs(u)||(d<0?n():r());},[e,n,r]);return {onTouchStart:i,onTouchEnd:s}}function KG(t){let{mode:e,canEdit:n,slides:r,activeSlide:o,masterPseudoSlide:i,templateElements:s,canvasSize:a,activeSlideIndex:l,gridSpacingPx:c,zoom:d,state:u,selectedElement:p,canvasHandlers:h,insertHandlers:f,tableOps:m,annotations:x,presentation:g,onEndPresentation:y,findReplace:b}=t,v=e==="master"?i:o,S=e==="master"?u.activeLayout?u.activeMaster?.elements??[]:[]:s,w=Jm.useMemo(()=>{let N=u.headerFooter,D;if(o)for(let U of o.elements){let G=U.placeholderType;if(G==="title"||G==="ctrTitle"){let j=U.text;if(j){D=j;break}}}return {slideNumber:o?.slideNumber,dateTimeText:N.dateTimeText,dateFormat:N.dateFormat,footerText:N.footerText,headerText:N.headerText,slideTitle:D,customProperties:u.customProperties.map(U=>({name:U.name,value:U.value}))}},[u.headerFooter,u.customProperties,o]),C=Jm.useMemo(()=>{if(!(!u.theme&&!u.tableStyleMap))return {theme:u.theme,tableStyleMap:u.tableStyleMap}},[u.theme,u.tableStyleMap]),T=Jm.useCallback((N,D)=>{e==="present"?g.handlePresentationAction(D):D.url&&rh(D.url);},[e,g]),M=Jm.useCallback(N=>{if(BA(N)){if(e==="present"){let D=tU(N);if(D){let U={action:D.action,targetSlideIndex:D.targetSlideIndex};g.handlePresentationAction(U);}}return}rh(N);},[e,g]),_=Jm.useRef(false),E=Jm.useCallback(()=>{_.current=true,x.setToolbarVisible(true);},[x]),R=Jm.useCallback(()=>{_.current=false;},[]),I=e==="preview"||e==="present",L=Jm.useCallback(()=>{e==="present"?g.movePresentationSlide(1):u.setActiveSlideIndex(N=>Math.min(r.length-1,N+1));},[e,g,u,r.length]),k=Jm.useCallback(()=>{e==="present"?g.movePresentationSlide(-1):u.setActiveSlideIndex(N=>Math.max(0,N-1));},[e,g,u]),F=Fme({enabled:I,onNext:L,onPrev:k});return jsxRuntime.jsxs("main",{"aria-label":"Slide editor",className:"flex-1 min-w-0 relative flex flex-col bg-background",onTouchStart:F.onTouchStart,onTouchEnd:F.onTouchEnd,children:[b.findReplaceOpen&&jsxRuntime.jsx(V6,{findQuery:b.findQuery,replaceQuery:b.replaceQuery,findMatchCase:b.findMatchCase,findResults:b.findResults,findResultIndex:b.findResultIndex,onSetFindQuery:b.setFindQuery,onSetReplaceQuery:b.setReplaceQuery,onSetFindMatchCase:b.setFindMatchCase,onPerformFind:b.performFind,onNavigateResult:b.navigateFindResult,onReplace:b.handleReplace,onReplaceAll:b.handleReplaceAll,onClose:()=>b.setFindReplaceOpen(false)}),e==="master"&&u.masterViewTab==="notes"?jsxRuntime.jsx(VH,{notesMaster:u.notesMaster,canvasSize:a,notesCanvasSize:u.notesCanvasSize}):e==="master"&&u.masterViewTab==="handout"?jsxRuntime.jsx(GH,{handoutMaster:u.handoutMaster,canvasSize:a,slidesPerPage:u.handoutSlidesPerPage}):jsxRuntime.jsx(UG,{activeSlide:v,templateElements:S,canvasSize:a,zoom:d,mode:e,canEdit:n,editTemplateMode:e==="master"||u.editTemplateMode,selectedElementIdSet:u.selectedElementIdSet,selectedElement:p,inlineEditingElementId:u.inlineEditingElementId,inlineEditingText:u.inlineEditingText,spellCheckEnabled:u.spellCheckEnabled,mediaDataUrls:u.mediaDataUrls,tableEditorState:u.tableEditorState,marqueeSelectionState:u.marqueeSelectionState,snapLines:u.snapLines,showGrid:u.showGrid,gridSpacingPx:c,showRulers:u.showRulers,guides:u.guides,presentationElementStates:e==="present"?g.presentationElementStates:void 0,presentationKeyframesCss:e==="present"?g.presentationKeyframesCss:void 0,onClick:h.handleElementClick,onDoubleClick:h.handleElementDoubleClick,onMouseDown:h.handleElementMouseDown,onContextMenu:h.handleElementContextMenu,onCanvasMouseDown:h.handleCanvasMouseDown,onResizePointerDown:h.handleResizePointerDown,onAdjustmentPointerDown:h.handleAdjustmentPointerDown,onRotate:h.handleRotate,onInlineEditChange:u.setInlineEditingText,onInlineEditCommit:h.handleInlineEditCommit,onInlineEditCancel:()=>u.setInlineEditingElementId(null),onTableCellSelect:(N,D)=>u.setTableEditorState(N?{...N,elementId:D}:null),onCommitCellEdit:m.handleCommitCellEdit,onUpdateSmartArtElement:h.handleUpdateSmartArtElement,onFormatText:h.handleFormatText,onResizeTableColumns:m.handleResizeTableColumns,onResizeTableRow:m.handleResizeTableRow,findResults:b.findResults,findResultIndex:b.findResultIndex,activeSlideIndex:l,activeTool:u.activeTool,drawingColor:u.drawingColor,drawingWidth:u.drawingWidth,isDrawingRef:u.isDrawingRef,onAddInkElement:f.handleAddInkElement,onAddFreeformShape:f.handleAddFreeformShape,onEraseInkElement:f.handleEraseInkElement,onActionClick:T,onHyperlinkClick:M,allSlides:e==="present"?r:void 0,onZoomClick:e==="present"?g.handleZoomClick:void 0,sourceSlideIndex:e==="present"?l:void 0,fieldContext:w,tableStyleContext:C,collaborationOverlay:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(DH,{elements:v?.elements??[],activeSlideIndex:l}),jsxRuntime.jsx(NH,{activeSlideIndex:l,canvasWidth:a.width,canvasHeight:a.height,selectedElementId:u.selectedElementId})]}),comments:o?.comments,showCommentMarkers:u.sidebarPanelMode==="comments",onCommentMarkerClick:()=>u.setSidebarPanelMode("comments"),onMoveGuide:(N,D)=>{u.setGuides(U=>U.map(G=>G.id===N?{...G,position:G.axis==="h"?Math.max(0,Math.min(a.height,D)):Math.max(0,Math.min(a.width,D))}:G));},onDeleteGuide:N=>{u.setGuides(D=>D.filter(U=>U.id!==N));},onCreateGuideFromRuler:(N,D)=>{u.setGuides(U=>[...U,{id:`guide-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,axis:N,position:D}]);}}),e==="present"&&x.presentationTool!=="none"&&jsxRuntime.jsx(hG,{canvasSize:a,editorScale:d.editorScale,presentationTool:x.presentationTool,annotationStrokes:x.annotationStrokes,currentStroke:x.currentStroke,laserPosition:x.laserPosition,onPointerDown:x.handlePointerDown,onPointerMove:x.handlePointerMove,onPointerUp:x.handlePointerUp,onLaserMove:x.handleLaserMove,onLaserLeave:x.handleLaserLeave,onEraseAtPoint:x.eraseAtPoint}),e==="present"&&jsxRuntime.jsx(bG,{visible:!!u.presentationProperties.showSubtitles}),e==="present"&&jsxRuntime.jsx(xG,{currentSlideIndex:g.presentationSlideIndex,totalSlides:r.length,onMovePresentationSlide:g.movePresentationSlide,onEndPresentation:y??(()=>{})}),e==="present"&&jsxRuntime.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 z-[80] transition-opacity duration-300",style:{opacity:x.toolbarVisible?1:0,pointerEvents:x.toolbarVisible?"auto":"none"},onMouseEnter:E,onMouseLeave:R,children:jsxRuntime.jsx(gG,{presentationTool:x.presentationTool,penColor:x.penColor,highlighterColor:x.highlighterColor,hasAnnotations:x.annotationStrokes.length>0,onSetTool:x.setPresentationTool,onSetPenColor:x.setPenColor,onSetHighlighterColor:x.setHighlighterColor,onClearAnnotations:x.clearAnnotations,currentSlideIndex:g.presentationSlideIndex,totalSlides:r.length,onMovePresentationSlide:g.movePresentationSlide,presentationStartTime:g.presentationStartTime,onEndPresentation:y??(()=>{}),onTogglePresenterView:g.togglePresenterView,presenterMode:g.presenterMode})})]})}var tf="rounded bg-muted/50 p-2.5 space-y-2",nf="text-[11px] font-medium uppercase tracking-wide text-muted-foreground mb-1.5",O2="w-full rounded border border-border bg-background px-2 py-1 text-xs text-foreground focus:border-primary focus:outline-none",Ume="rounded bg-primary px-3 py-1.5 text-xs font-medium text-white hover:bg-primary/80 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",$me="rounded bg-accent px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:cursor-not-allowed transition-colors";var h5=[{name:"Office",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#44546A",lt2:"#E7E6E6",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47",hlink:"#0563C1",folHlink:"#954F72"},majorFont:"Calibri Light",minorFont:"Calibri"},{name:"Facet",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#2C3C43",lt2:"#CFD7D9",accent1:"#90C226",accent2:"#54A021",accent3:"#E6B91E",accent4:"#E76618",accent5:"#C42F1A",accent6:"#918655",hlink:"#99CA3C",folHlink:"#B9D181"},majorFont:"Trebuchet MS",minorFont:"Trebuchet MS"},{name:"Integral",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#335B74",lt2:"#DFE3E5",accent1:"#1CADE4",accent2:"#2683C6",accent3:"#27CED7",accent4:"#42BA97",accent5:"#3E8853",accent6:"#62A39F",hlink:"#6BA5D1",folHlink:"#9DCCE0"},majorFont:"Tw Cen MT Condensed",minorFont:"Tw Cen MT"},{name:"Ion",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#262626",lt2:"#E1E1E1",accent1:"#B01513",accent2:"#EA6312",accent3:"#E6B729",accent4:"#6AAC90",accent5:"#5F9C9D",accent6:"#9B6BF2",hlink:"#F09415",folHlink:"#D14D0F"},majorFont:"Century Gothic",minorFont:"Century Gothic"},{name:"Retrospect",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#637052",lt2:"#CCDDEA",accent1:"#E48312",accent2:"#BD582C",accent3:"#865640",accent4:"#9B8357",accent5:"#C2BC80",accent6:"#94A088",hlink:"#3A7CCB",folHlink:"#8C8C8C"},majorFont:"Calibri Light",minorFont:"Calibri"},{name:"Organic",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#283138",lt2:"#E3DED1",accent1:"#83992A",accent2:"#3C9770",accent3:"#44709D",accent4:"#A23C33",accent5:"#D97828",accent6:"#DEB340",hlink:"#A8B97F",folHlink:"#89C2A3"},majorFont:"Garamond",minorFont:"Garamond"},{name:"Wisp",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#46393B",lt2:"#E8DCD8",accent1:"#A53010",accent2:"#DE7E18",accent3:"#9F8351",accent4:"#728653",accent5:"#92AA4C",accent6:"#6AAC91",hlink:"#FB4F14",folHlink:"#E25839"},majorFont:"Century Gothic",minorFont:"Century Gothic"},{name:"Berlin",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#3E5C61",lt2:"#D5E0D0",accent1:"#F09415",accent2:"#C1B56B",accent3:"#89C2A3",accent4:"#729BBE",accent5:"#9A90C2",accent6:"#BE8DBE",hlink:"#25A0DA",folHlink:"#FF7F00"},majorFont:"Trebuchet MS",minorFont:"Trebuchet MS"},{name:"Slice",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#2E3B4C",lt2:"#C7CDD3",accent1:"#E2751D",accent2:"#C53B23",accent3:"#A13D69",accent4:"#58599E",accent5:"#36749D",accent6:"#4EA39A",hlink:"#FD6B32",folHlink:"#D14D0F"},majorFont:"Century Gothic",minorFont:"Century Gothic"},{name:"Dividend",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#3D3D3D",lt2:"#E1E1E1",accent1:"#4D1434",accent2:"#903163",accent3:"#B2324B",accent4:"#D34817",accent5:"#E8971C",accent6:"#FDCB00",hlink:"#A03068",folHlink:"#C34882"},majorFont:"Gill Sans MT",minorFont:"Gill Sans MT"}],d0=["Arial","Calibri","Calibri Light","Cambria","Century Gothic","Comic Sans MS","Consolas","Garamond","Georgia","Gill Sans MT","Impact","Lucida Console","Palatino Linotype","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Tw Cen MT","Verdana"];bt();function Hme({editColors:t,canEdit:e,activePickerKey:n,majorFont:r,minorFont:o,onSetActivePickerKey:i,onColorChange:s,onMajorFontChange:a,onMinorFontChange:l}){let{t:c}=reactI18next.useTranslation(),d=Jm.useMemo(()=>cU(t),[t]),u=Jm.useCallback(p=>{n&&/^#[0-9a-fA-F]{6}$/.test(p)&&s(n,p);},[n,s]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:c("pptx.themeEditor.colorScheme")}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:hc.map(p=>jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsx("button",{type:"button",disabled:!e,className:`h-6 w-full rounded-sm border transition-colors ${n===p?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground"} disabled:opacity-40 disabled:cursor-not-allowed`,style:{backgroundColor:t[p]},title:`${Fm[p]}: ${t[p]}`,"aria-label":`${Fm[p]}: ${t[p]}`,onClick:()=>i(n===p?null:p)}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground truncate w-full text-center",children:Fm[p]})]},p))}),n&&jsxRuntime.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded bg-background p-2",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground min-w-[60px]",children:Fm[n]}),jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"h-6 w-8 cursor-pointer rounded border-0 bg-transparent p-0",value:t[n],onChange:p=>s(n,p.target.value)}),jsxRuntime.jsx("input",{type:"text",disabled:!e,className:"flex-1 rounded border border-border bg-muted px-1.5 py-0.5 text-[10px] text-foreground font-mono",value:t[n],onChange:p=>u(p.target.value)})]})]}),d&&jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:c("pptx.themeEditor.preview")}),jsxRuntime.jsx("div",{className:"flex flex-col gap-px",children:d.map((p,h)=>jsxRuntime.jsx("div",{className:"grid grid-cols-12 gap-px",children:p.map(f=>jsxRuntime.jsx("div",{className:"h-3.5 rounded-sm",style:{backgroundColor:f.hex},title:`${f.colLabel} -- ${f.rowLabel} (${f.hex})`},`${f.schemeKey}-${h}`))},h))})]}),jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:c("pptx.themeEditor.fonts")}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:c("pptx.themeEditor.headingFont")}),jsxRuntime.jsxs("select",{className:O2,disabled:!e,value:d0.includes(r)?r:"__custom__",onChange:p=>{p.target.value!=="__custom__"&&a(p.target.value);},children:[d0.map(p=>jsxRuntime.jsx("option",{value:p,children:p},p)),!d0.includes(r)&&jsxRuntime.jsx("option",{value:"__custom__",children:r})]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:c("pptx.themeEditor.bodyFont")}),jsxRuntime.jsxs("select",{className:O2,disabled:!e,value:d0.includes(o)?o:"__custom__",onChange:p=>{p.target.value!=="__custom__"&&l(p.target.value);},children:[d0.map(p=>jsxRuntime.jsx("option",{value:p,children:p},p)),!d0.includes(o)&&jsxRuntime.jsx("option",{value:"__custom__",children:o})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 pt-1 text-[10px] text-muted-foreground",children:[jsxRuntime.jsx("span",{style:{fontFamily:r},className:"text-foreground",children:c("pptx.themeEditor.headingSample")}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{style:{fontFamily:o},className:"text-foreground",children:c("pptx.themeEditor.bodySample")})]})]})]})]})}var but=["accent1","accent2","accent3","accent4","accent5","accent6"];function Vme({canEdit:t,currentThemeName:e,onSelectPreset:n}){let{t:r}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:r("pptx.themeEditor.presetThemes")}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:h5.map(o=>jsxRuntime.jsxs("button",{type:"button",disabled:!t,className:`flex flex-col items-start gap-1 rounded border p-1.5 text-left transition-colors ${e===o.name?"border-primary bg-primary/10":"border-border hover:border-muted-foreground hover:bg-muted"} disabled:opacity-40 disabled:cursor-not-allowed`,onClick:()=>n(o),title:o.name,children:[jsxRuntime.jsx("div",{className:"flex gap-px w-full",children:but.map(i=>jsxRuntime.jsx("div",{className:"h-3 flex-1 first:rounded-l-sm last:rounded-r-sm",style:{backgroundColor:o.colorScheme[i]}},i))}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground truncate w-full",children:o.name})]},o.name))})]})}function Gme({theme:t,canEdit:e,onUpdateColorScheme:n,onUpdateFontScheme:r,onUpdateThemeName:o,onApplyToPresentation:i,onClose:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState(()=>t?.colorScheme??h5[0].colorScheme),[d,u]=Jm.useState(()=>t?.fontScheme?.majorFont?.latin??"Calibri Light"),[p,h]=Jm.useState(()=>t?.fontScheme?.minorFont?.latin??"Calibri"),[f,m]=Jm.useState(()=>t?.name??"Custom Theme"),[x,g]=Jm.useState(null),y=Jm.useCallback((T,M)=>{let _={...l,[T]:M};c(_),n(_);},[l,n]),b=Jm.useCallback(T=>{c(T.colorScheme),u(T.majorFont),h(T.minorFont),m(T.name),n(T.colorScheme),r({majorFont:{latin:T.majorFont},minorFont:{latin:T.minorFont}}),o(T.name);},[n,r,o]),v=Jm.useCallback(()=>{t?.colorScheme&&(c(t.colorScheme),u(t.fontScheme?.majorFont?.latin??"Calibri Light"),h(t.fontScheme?.minorFont?.latin??"Calibri"),m(t.name??"Custom Theme"),n(t.colorScheme),r({majorFont:{latin:t.fontScheme?.majorFont?.latin??"Calibri Light"},minorFont:{latin:t.fontScheme?.minorFont?.latin??"Calibri"}}),o(t.name??"Custom Theme"));},[t,n,r,o]),S=Jm.useCallback(T=>{u(T),r({majorFont:{latin:T},minorFont:{latin:p}});},[p,r]),w=Jm.useCallback(T=>{h(T),r({majorFont:{latin:d},minorFont:{latin:T}});},[d,r]),C=Jm.useCallback(T=>{m(T),o(T);},[o]);return jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 overflow-y-auto max-h-[calc(100vh-120px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a("pptx.themeEditor.title")}),jsxRuntime.jsx("button",{type:"button",onClick:s,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",title:a("pptx.themeEditor.close"),"aria-label":a("pptx.themeEditor.close"),children:jsxRuntime.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:a("pptx.themeEditor.themeName")}),jsxRuntime.jsx("input",{type:"text",className:O2,disabled:!e,value:f,onChange:T=>C(T.target.value),placeholder:a("pptx.themeEditor.themeNamePlaceholder")})]}),jsxRuntime.jsx(Vme,{canEdit:e,currentThemeName:f,onSelectPreset:b}),jsxRuntime.jsx(Hme,{editColors:l,canEdit:e,activePickerKey:x,majorFont:d,minorFont:p,onSetActivePickerKey:g,onColorChange:y,onMajorFontChange:S,onMinorFontChange:w}),jsxRuntime.jsxs("div",{className:"flex gap-1.5 pt-1",children:[jsxRuntime.jsx("button",{type:"button",disabled:!e,className:Ume,onClick:i,children:a("pptx.themeEditor.applyToPresentation")}),jsxRuntime.jsx("button",{type:"button",disabled:!e,className:$me,onClick:v,children:a("pptx.themeEditor.reset")})]})]})}function ZG({onClose:t,className:e,children:n}){let{dragY:r,handlers:o}=Lu(t);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button","aria-label":"Close",onClick:t,className:"md:hidden fixed inset-0 z-20 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150"}),jsxRuntime.jsxs("div",{className:e,style:r>0?{transform:`translateY(${r}px)`,transition:"none"}:void 0,children:[jsxRuntime.jsx("div",{className:"md:hidden flex items-center justify-center pt-2 pb-1 cursor-grab active:cursor-grabbing touch-none",onPointerDown:o.onPointerDown,onPointerMove:o.onPointerMove,onPointerUp:o.onPointerUp,onPointerCancel:o.onPointerCancel,children:jsxRuntime.jsx("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/40"})}),n]})]})}var JG=[{id:"office",name:"Office",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#44546A",lt2:"#E7E6E6",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47",hlink:"#0563C1",folHlink:"#954F72"},fontScheme:{majorFont:"Calibri Light",minorFont:"Calibri"}},{id:"facet",name:"Facet",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#2C3C43",lt2:"#CFD7D9",accent1:"#90C226",accent2:"#54A021",accent3:"#E6B91E",accent4:"#E76618",accent5:"#C42F1A",accent6:"#918655",hlink:"#99CA3C",folHlink:"#B9D181"},fontScheme:{majorFont:"Trebuchet MS",minorFont:"Trebuchet MS"}},{id:"integral",name:"Integral",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#335B74",lt2:"#DFE3E5",accent1:"#1CADE4",accent2:"#2683C6",accent3:"#27CED7",accent4:"#42BA97",accent5:"#3E8853",accent6:"#62A39F",hlink:"#6BA5D1",folHlink:"#9DCCE0"},fontScheme:{majorFont:"Tw Cen MT Condensed",minorFont:"Tw Cen MT"}},{id:"ion",name:"Ion",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#262626",lt2:"#E1E1E1",accent1:"#B01513",accent2:"#EA6312",accent3:"#E6B729",accent4:"#6AAC90",accent5:"#5F9C9D",accent6:"#9B6BF2",hlink:"#F09415",folHlink:"#D14D0F"},fontScheme:{majorFont:"Century Gothic",minorFont:"Century Gothic"}},{id:"retrospect",name:"Retrospect",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#637052",lt2:"#CCDDEA",accent1:"#E48312",accent2:"#BD582C",accent3:"#865640",accent4:"#9B8357",accent5:"#C2BC80",accent6:"#94A088",hlink:"#3A7CCB",folHlink:"#8C8C8C"},fontScheme:{majorFont:"Calibri Light",minorFont:"Calibri"}},{id:"organic",name:"Organic",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#283138",lt2:"#E3DED1",accent1:"#83992A",accent2:"#3C9770",accent3:"#44709D",accent4:"#A23C33",accent5:"#D97828",accent6:"#DEB340",hlink:"#A8B97F",folHlink:"#89C2A3"},fontScheme:{majorFont:"Garamond",minorFont:"Garamond"}},{id:"wisp",name:"Wisp",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#46393B",lt2:"#E8DCD8",accent1:"#A53010",accent2:"#DE7E18",accent3:"#9F8351",accent4:"#728653",accent5:"#92AA4C",accent6:"#6AAC91",hlink:"#FB4F14",folHlink:"#E25839"},fontScheme:{majorFont:"Century Gothic",minorFont:"Century Gothic"}},{id:"berlin",name:"Berlin",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#3E5C61",lt2:"#D5E0D0",accent1:"#F09415",accent2:"#C1B56B",accent3:"#89C2A3",accent4:"#729BBE",accent5:"#9A90C2",accent6:"#BE8DBE",hlink:"#25A0DA",folHlink:"#FF7F00"},fontScheme:{majorFont:"Trebuchet MS",minorFont:"Trebuchet MS"}},{id:"slice",name:"Slice",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#2E3B4C",lt2:"#C7CDD3",accent1:"#E2751D",accent2:"#C53B23",accent3:"#A13D69",accent4:"#58599E",accent5:"#36749D",accent6:"#4EA39A",hlink:"#FD6B32",folHlink:"#D14D0F"},fontScheme:{majorFont:"Century Gothic",minorFont:"Century Gothic"}},{id:"dividend",name:"Dividend",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#3D3D3D",lt2:"#E1E1E1",accent1:"#4D1434",accent2:"#903163",accent3:"#B2324B",accent4:"#D34817",accent5:"#E8971C",accent6:"#FDCB00",hlink:"#A03068",folHlink:"#C34882"},fontScheme:{majorFont:"Gill Sans MT",minorFont:"Gill Sans MT"}}];function QG({theme:t,selected:e,onClick:n}){let{colorScheme:r}=t;return jsxRuntime.jsxs("button",{type:"button",onClick:n,className:ie("group relative flex flex-col rounded-lg border-2 transition-all overflow-hidden",e?"border-primary shadow-lg scale-[1.02]":"border-border hover:border-primary/50 hover:shadow-md"),title:t.name,children:[jsxRuntime.jsxs("div",{className:"h-24 flex flex-col",children:[jsxRuntime.jsxs("div",{className:"h-10 flex",children:[jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:r.accent1}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:r.accent2}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:r.accent3}})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex",children:[jsxRuntime.jsx("div",{className:"w-1/3",style:{backgroundColor:r.dk2}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:r.lt2}})]})]}),jsxRuntime.jsx("div",{className:"bg-background border-t border-border px-2 py-1.5",children:jsxRuntime.jsx("p",{className:"text-xs font-medium text-foreground text-center",children:t.name})}),e&&jsxRuntime.jsx("div",{className:"absolute top-1 right-1 bg-primary text-white rounded-full p-1",children:jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3 h-3"})})]})}function jme({open:t,currentTheme:e,canEdit:n,onClose:r,onApplyTheme:o,onImportTheme:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState(e??null),c=Jm.useRef(null);if(!t)return null;let d=()=>{a&&(o(a),r());},u=()=>{c.current?.click();},p=h=>{let f=h.target.files?.[0];f&&i&&i(f),h.target.value="";};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:"fixed inset-0 z-[100] bg-black/60 backdrop-blur-sm",onClick:r,"aria-label":s("common.close")}),jsxRuntime.jsx("div",{className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:jsxRuntime.jsxs("div",{className:"bg-background border border-border rounded-xl shadow-2xl max-w-5xl w-full max-h-[90vh] flex flex-col",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s("powerpoint.toolbar.themes.gallery.title")}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s("powerpoint.toolbar.themes.gallery.description")})]}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"p-2 rounded hover:bg-accent transition-colors","aria-label":s("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4",children:JG.map(h=>jsxRuntime.jsx(QG,{theme:h,selected:a?.id===h.id,onClick:()=>l(h)},h.id))})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",onClick:u,disabled:!n,className:"inline-flex items-center gap-2 px-3 py-1.5 rounded bg-accent hover:bg-accent/80 text-xs font-medium text-foreground transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[jsxRuntime.jsx(lu$1.LuUpload,{className:"w-3.5 h-3.5"}),s("powerpoint.toolbar.themes.gallery.importTheme")]}),jsxRuntime.jsx("input",{ref:c,type:"file",accept:".thmx,.pptx",className:"hidden",onChange:p})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:r,className:"px-3 py-1.5 rounded bg-accent hover:bg-accent/80 text-xs font-medium text-foreground transition-colors",children:s("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:d,disabled:!n||!a,className:"px-3 py-1.5 rounded bg-primary hover:bg-primary/80 text-xs font-medium text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:s("common.apply")})]})]})]})})]})}function eW(t){let{mode:e,canEdit:n,activeSlide:r,masterPseudoSlide:o,slides:i,canvasSize:s,activeSlideIndex:a,selectedElement:l,state:c,comments:d,ops:u,manipulation:p,propertyHandlers:h,themeHandlers:f,history:m,panelWidth:x,onResizeRight:g}=t,y=e==="master"?o:r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[(e==="edit"||e==="master")&&c.isInspectorPaneOpen&&g&&jsxRuntime.jsx(yu,{direction:"horizontal",onResize:g}),jsxRuntime.jsx(GG,{isOpen:(e==="edit"||e==="master")&&c.isInspectorPaneOpen,canEdit:n,mode:e,activeSlide:y,slides:i,canvasSize:s,selectedElement:l,effectiveSelectedIds:c.effectiveSelectedIds,tableEditorState:c.tableEditorState,sidebarPanelMode:c.sidebarPanelMode,activeSlideIndex:a,comments:d,onSetSidebarPanelMode:c.setSidebarPanelMode,onClose:()=>c.setIsInspectorPaneOpen(false),onUpdateElementStyle:u.updateSelectedShapeStyle,onUpdateTextStyle:u.updateSelectedTextStyle,onUpdateElement:u.updateSelectedElement,onApplySelection:u.applySelection,onSetCanvasSize:c.setCanvasSize,onMoveLayer:p.handleMoveLayer,onMoveLayerToEdge:p.handleMoveLayerToEdge,onDeleteElement:p.handleDelete,onUpdateSlide:h.handleUpdateSlide,presentationProperties:c.presentationProperties,onUpdatePresentationProperties:h.handleUpdatePresentationProperties,editTemplateMode:c.editTemplateMode,slideMasters:c.slideMasters,themeOptions:c.themeOptions,notesMaster:c.notesMaster,handoutMaster:c.handoutMaster,notesCanvasSize:c.notesCanvasSize,coreProperties:c.coreProperties,appProperties:c.appProperties,customProperties:c.customProperties,tagCollections:c.tagCollections,onUpdateTagCollections:c.setTagCollections,onUpdateCoreProperties:h.handleUpdateCoreProperties,onUpdateAppProperties:h.handleUpdateAppProperties,onUpdateCustomProperties:h.handleUpdateCustomProperties,onApplyTheme:f.handleApplyTheme,onSetTemplateBackground:f.handleSetTemplateBackground,onGetTemplateBackgroundColor:f.handleGetTemplateBackgroundColor,mediaDataUrls:c.mediaDataUrls,theme:c.theme,panelWidth:x}),c.isSelectionPaneOpen&&(e==="edit"||e==="master")&&jsxRuntime.jsx(ZG,{onClose:()=>c.setIsSelectionPaneOpen(false),className:"absolute right-0 top-0 z-30 h-full max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:h-auto max-md:max-h-[50vh] max-md:rounded-t-xl max-md:border-t max-md:border-border max-md:shadow-2xl max-md:bg-background",children:jsxRuntime.jsx(DV,{slides:i,activeSlideIndex:a,selectedElementId:c.selectedElementId,selectedElementIds:c.selectedElementIds,canEdit:n,setSelectedElementId:c.setSelectedElementId,setSelectedElementIds:c.setSelectedElementIds,setSlides:c.setSlides,markDirty:m.markDirty,onClose:()=>c.setIsSelectionPaneOpen(false)})}),c.isThemeEditorOpen&&e==="edit"&&jsxRuntime.jsx(ZG,{onClose:()=>c.setIsThemeEditorOpen(false),className:"absolute right-0 top-0 z-30 h-full w-72 overflow-y-auto border-l border-border bg-card p-2.5 shadow-xl max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:h-auto max-md:max-h-[60vh] max-md:rounded-t-xl max-md:border-t max-md:border-l-0",children:jsxRuntime.jsx(Gme,{theme:c.theme,canEdit:n,onUpdateColorScheme:f.handleUpdateThemeColorScheme,onUpdateFontScheme:f.handleUpdateThemeFontScheme,onUpdateThemeName:f.handleUpdateThemeName,onApplyToPresentation:f.handleApplyThemeToPresentation,onClose:()=>c.setIsThemeEditorOpen(false)})}),jsxRuntime.jsx(jme,{open:c.isThemeGalleryOpen,currentTheme:null,canEdit:n,onClose:()=>c.setIsThemeGalleryOpen(false),onApplyTheme:b=>{f.handleApplyThemeData(b.colorScheme,{majorFont:{latin:b.fontScheme.majorFont,eastAsia:b.fontScheme.majorFont,complexScript:b.fontScheme.majorFont},minorFont:{latin:b.fontScheme.minorFont,eastAsia:b.fontScheme.minorFont,complexScript:b.fontScheme.minorFont}},b.name);}})]})}function tW(t){let{mode:e,canEdit:n,slides:r,activeSlide:o,masterPseudoSlide:i,activeSlideIndex:s,canvasSize:a,gridSpacingPx:l,slideSectionGroups:c,showSlidesPane:d,showMasterPane:u,selectedElement:p,state:h,editorOps:f,dialogs:m,presentation:x,annotations:g,propertyHandlers:y,themeHandlers:b,history:v,comments:S,zoom:w,isMobile:C=false,isTouchDevice:T=false,onEndPresentation:M,leftPanelWidth:_,onResizeLeft:E,rightPanelWidth:R,onResizeRight:I}=t,{ops:L,sectionOps:k,canvasHandlers:F,insertHandlers:N,manipulation:D,slideOps:U,tableOps:G,findReplace:j}=f;return jsxRuntime.jsxs("div",{className:"relative z-10 flex flex-1 min-h-0",children:[d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(WC,{slides:r,activeSlideIndex:s,canvasSize:a,sectionGroups:c,isOpen:h.isSlidesPaneOpen,canEdit:n,onSelectSlide:h.setActiveSlideIndex,onSlideContextMenu:U.handleSlideContextMenu,onMoveSlide:U.handleMoveSlide,onAddSlide:U.handleAddSlide,onCollapse:()=>h.setIsSlidesPaneOpen(false),onAddSection:k.addSection,onRenameSection:k.renameSection,onDeleteSection:k.deleteSection,onMoveSectionUp:k.moveSectionUp,onMoveSectionDown:k.moveSectionDown,rehearsalTimings:Object.keys(x.recordedTimings).length>0?x.recordedTimings:void 0,panelWidth:_}),E&&jsxRuntime.jsx(yu,{direction:"horizontal",onResize:E})]}),u&&jsxRuntime.jsx(zH,{slideMasters:h.slideMasters,activeMasterIndex:h.activeMasterIndex,activeLayoutIndex:h.activeLayoutIndex,canvasSize:a,masterViewTab:h.masterViewTab,notesMaster:h.notesMaster,handoutMaster:h.handoutMaster,handoutSlidesPerPage:h.handoutSlidesPerPage,onSelectMaster:m.handleSelectMaster,onSelectLayout:m.handleSelectLayout,onCollapse:()=>h.setIsSlidesPaneOpen(false),onTabChange:h.setMasterViewTab,onHandoutSlidesPerPageChange:h.setHandoutSlidesPerPage}),jsxRuntime.jsx(KG,{mode:e,canEdit:n,slides:r,activeSlide:o,masterPseudoSlide:i,templateElements:h.templateElements,canvasSize:a,activeSlideIndex:s,gridSpacingPx:l,zoom:w,state:h,selectedElement:p,canvasHandlers:F,insertHandlers:N,tableOps:G,annotations:g,presentation:x,onEndPresentation:M,findReplace:j}),h.contextMenuState&&jsxRuntime.jsx(b6,{contextMenuState:h.contextMenuState,mode:e,selectedElement:p,tableEditorState:h.tableEditorState,hasMultiSelection:h.effectiveSelectedIds.length>1,onAction:D.handleContextMenuAction,onInsertTableRow:G.handleInsertTableRow,onDeleteTableRow:G.handleDeleteTableRow,onInsertTableColumn:G.handleInsertTableColumn,onDeleteTableColumn:G.handleDeleteTableColumn,onMergeCellRight:G.handleMergeCellRight,onMergeCellDown:G.handleMergeCellDown,onMergeSelectedCells:G.handleMergeSelectedCells,onSplitCell:G.handleSplitCell,onClose:()=>h.setContextMenuState(null)}),jsxRuntime.jsx(eW,{mode:e,canEdit:n,activeSlide:o,masterPseudoSlide:i,slides:r,canvasSize:a,activeSlideIndex:s,selectedElement:p,state:h,comments:S,ops:L,manipulation:D,propertyHandlers:y,themeHandlers:b,history:v,panelWidth:R,onResizeRight:I})]})}function Kme({onOpenSlides:t,onOpenInsert:e,onOpenInspector:n,onOpenComments:r,onToggleNotes:o,activeSheet:i,commentCount:s}){return jsxRuntime.jsx("nav",{"aria-label":"Editor actions",className:"flex items-stretch justify-around border-t border-border bg-secondary/80 backdrop-blur supports-[backdrop-filter]:bg-secondary/60 pb-[max(env(safe-area-inset-bottom),0px)]",children:[{key:"slides",label:"Slides",icon:lu$1.LuLayers,onClick:t},{key:"insert",label:"Insert",icon:lu$1.LuPlus,onClick:e},{key:"inspector",label:"Format",icon:lu$1.LuSettings2,onClick:n},{key:"comments",label:"Comments",icon:lu$1.LuMessageSquare,onClick:r,badge:s},{key:"notes",label:"Notes",icon:lu$1.LuStickyNote,onClick:o}].map(({key:l,label:c,icon:d,onClick:u,badge:p})=>{let h=i===l;return jsxRuntime.jsxs("button",{type:"button",onClick:u,className:ie("relative flex flex-col items-center justify-center gap-0.5 flex-1 min-h-[56px] py-1.5 text-[10px] font-medium transition-colors active:scale-95",h?"text-primary":"text-muted-foreground hover:text-foreground"),"aria-pressed":h,children:[jsxRuntime.jsx(d,{className:"w-5 h-5"}),jsxRuntime.jsx("span",{children:c}),p!==void 0&&p>0&&jsxRuntime.jsx("span",{className:"absolute top-1 right-1/4 flex items-center justify-center min-w-[16px] h-4 px-1 rounded-full bg-primary text-[9px] font-semibold text-white",children:p>99?"99+":p}),h&&jsxRuntime.jsx("span",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-8 h-0.5 rounded-full bg-primary"})]},l)})})}function qme({open:t,onClose:e,...n}){return jsxRuntime.jsx(AN,{open:t,onClose:e,heightFraction:.7,title:"Slides",children:jsxRuntime.jsx("div",{className:"h-full",children:jsxRuntime.jsx(WC,{...n})})})}function Zme(t){let{state:e,editorOps:n,presentation:r,slides:o,activeSlideIndex:i,canvasSize:s,slideSectionGroups:a,canEdit:l,commentCount:c}=t,{keyboardInset:d,isKeyboardOpen:u}=xV(),p=e.isSlidesPaneOpen?"slides":e.isInspectorPaneOpen?e.sidebarPanelMode==="comments"?"comments":"inspector":e.isSlideNotesCollapsed?null:"notes",h=()=>{e.setIsSlidesPaneOpen(false),e.setIsInspectorPaneOpen(false),e.setIsSlideNotesCollapsed(true);},f=m=>{switch(h(),m){case "slides":e.setIsSlidesPaneOpen(true);break;case "inspector":e.setSidebarPanelMode("properties"),e.setIsInspectorPaneOpen(true);break;case "comments":e.setSidebarPanelMode("comments"),e.setIsInspectorPaneOpen(true);break;case "notes":e.setIsSlideNotesCollapsed(false);break}};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qme,{open:e.isSlidesPaneOpen,onClose:()=>e.setIsSlidesPaneOpen(false),slides:o,activeSlideIndex:i,canvasSize:s,sectionGroups:a,isOpen:true,canEdit:l,onSelectSlide:m=>{e.setActiveSlideIndex(m),e.setIsSlidesPaneOpen(false);},onSlideContextMenu:n.slideOps.handleSlideContextMenu,onMoveSlide:n.slideOps.handleMoveSlide,onAddSlide:n.slideOps.handleAddSlide,onCollapse:()=>e.setIsSlidesPaneOpen(false),onAddSection:n.sectionOps.addSection,onRenameSection:n.sectionOps.renameSection,onDeleteSection:n.sectionOps.deleteSection,onMoveSectionUp:n.sectionOps.moveSectionUp,onMoveSectionDown:n.sectionOps.moveSectionDown,rehearsalTimings:Object.keys(r.recordedTimings).length>0?r.recordedTimings:void 0}),jsxRuntime.jsx("div",{className:"contents",style:d>0?{display:"block",transform:`translateY(-${d}px)`,transition:"transform 150ms ease-out",willChange:"transform"}:void 0,"data-keyboard-open":u?"true":void 0,children:jsxRuntime.jsx(Kme,{activeSheet:p,commentCount:c,onOpenSlides:()=>e.isSlidesPaneOpen?e.setIsSlidesPaneOpen(false):f("slides"),onOpenInsert:()=>{n.insertHandlers.handleAddTextBox();},onOpenInspector:()=>e.isInspectorPaneOpen&&e.sidebarPanelMode!=="comments"?e.setIsInspectorPaneOpen(false):f("inspector"),onOpenComments:()=>e.isInspectorPaneOpen&&e.sidebarPanelMode==="comments"?e.setIsInspectorPaneOpen(false):f("comments"),onToggleNotes:()=>e.isSlideNotesCollapsed?f("notes"):e.setIsSlideNotesCollapsed(true)})})]})}function Mv({label:t,enabled:e,onToggle:n}){return jsxRuntime.jsxs("div",{className:"flex items-center justify-between py-2.5 px-3",children:[jsxRuntime.jsx("span",{className:"text-sm text-foreground",children:t}),jsxRuntime.jsx("button",{type:"button",onClick:n,className:ie("relative inline-flex h-5 w-9 items-center rounded-full transition-colors",e?"bg-primary":"bg-muted-foreground/30"),role:"switch","aria-checked":e,"aria-label":t,children:jsxRuntime.jsx("span",{className:ie("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})]})}function Qme({isOpen:t,onClose:e,spellCheckEnabled:n=false,onSetSpellCheckEnabled:r,showGrid:o=false,onSetShowGrid:i,showRulers:s=false,onSetShowRulers:a,snapToGrid:l=false,onSetSnapToGrid:c,reducedMotion:d=false,onToggleReducedMotion:u}){let[p,h]=Jm.useState("general"),[f,m]=Jm.useState(true),{t:x}=reactI18next.useTranslation(),{panelStyle:g,handlers:y}=pi(e),b=Jm.useCallback(S=>{S.key==="Escape"&&e();},[e]);if(Jm.useEffect(()=>{if(t)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t,b]),!t)return null;let v=[{id:"general",label:x("pptx.settings.general")},{id:"shortcuts",label:x("pptx.settings.keyboardShortcuts")}];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":x("pptx.settings.closeSettings"),onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{style:g,className:"pointer-events-auto w-[min(32rem,calc(100%-2rem))] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...y,className:"flex items-center justify-between px-5 py-4 border-b border-border/60 touch-none",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuSettings,{className:"w-5 h-5 text-primary"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:x("pptx.settings.title")})]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":x("pptx.settings.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"flex border-b border-border/60 px-5",children:v.map(S=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>h(S.id),className:ie("px-3 py-2 text-xs font-medium transition-colors relative",p===S.id?"text-primary":"text-muted-foreground hover:text-foreground"),children:[S.label,p===S.id&&jsxRuntime.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-full"})]},S.id))}),jsxRuntime.jsxs("div",{className:"px-5 py-4 max-h-[60vh] overflow-y-auto",children:[p==="general"&&jsxRuntime.jsxs("div",{className:"space-y-0.5",children:[jsxRuntime.jsx(Mv,{label:x("pptx.settings.autoSave"),enabled:f,onToggle:()=>m(!f)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.spellCheck"),enabled:n,onToggle:()=>r?.(!n)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.showGrid"),enabled:o,onToggle:()=>i?.(!o)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.showRulers"),enabled:s,onToggle:()=>a?.(!s)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.snapToGrid"),enabled:l,onToggle:()=>c?.(!l)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.reducedMotion"),enabled:d,onToggle:()=>u?.()})]}),p==="shortcuts"&&jsxRuntime.jsx("div",{className:"space-y-0.5",children:vR.map((S,w)=>jsxRuntime.jsxs("div",{className:ie("flex items-center justify-between gap-3 rounded px-3 py-2",w%2===0?"bg-muted/60":""),children:[jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:x(S.actionKey)}),jsxRuntime.jsx("span",{className:"font-mono text-[11px] text-muted-foreground whitespace-nowrap",children:S.shortcut})]},S.actionKey))})]})]})})]})}var Wut=120,Xut=400,jut=180,Yut=220,Kut=480,qut=288,Zut=60,Jut=400,Qut=120;function ege(){let[t,e]=Jm.useState(jut),[n,r]=Jm.useState(qut),[o,i]=Jm.useState(Qut),s=Jm.useCallback(c=>{e(d=>Math.min(Xut,Math.max(Wut,d+c)));},[]),a=Jm.useCallback(c=>{r(d=>Math.min(Kut,Math.max(Yut,d-c)));},[]),l=Jm.useCallback(c=>{i(d=>Math.min(Jut,Math.max(Zut,d-c)));},[]);return {leftWidth:t,rightWidth:n,bottomHeight:o,onResizeLeft:s,onResizeRight:a,onResizeBottom:l}}var tge=Jm.forwardRef(function(e,n){let{content:r,filePath:o,fileName:i,canEdit:s=false,onContentChange:a,onDirtyChange:l,onActiveSlideChange:c,onModeChange:d,onZoomChange:u,onSelectionChange:p,onSlideCountChange:h,onOpenFile:f,theme:m,authorName:x,collaboration:g,onStartCollaboration:y,onStopCollaboration:b,shareDefaults:v,smartArt3D:S=false}=e,w=c$(m),[C,T]=Jm.useState(r);Jm.useEffect(()=>{T(r);},[r]);let M=Jm.useCallback(()=>{if(f){f();return}(async()=>{let Te=await Ane();Te&&T(Te.buffer);})();},[f]),[_,E]=Jm.useState(false),[R,I]=Jm.useState(true),[L,k]=Jm.useState(false),{reducedMotion:F,toggleReducedMotion:N}=dV(),D=Sz(),{containerRef:U,mode:G,slides:j,canvasSize:Y,loading:ge,error:fe,activeSlideIndex:de,selectedElementId:J,selectedElementIds:re,templateElementsBySlideId:ce,activeSlide:ae,selectedElement:_e}=D,xe=f2({containerRef:U}),{isMobile:Ee,isTouchDevice:W,isVirtualKeyboardOpen:q}=xe,Q=ege(),{gridSpacingPx:se,visibleSlideIndexes:me,slideSectionGroups:P,masterPseudoSlide:A}=Qz({slides:j,sections:D.sections,customShows:D.customShows,activeCustomShowId:D.activeCustomShowId,mode:G,activeLayout:D.activeLayout,activeMaster:D.activeMaster,presentationGridSpacing:D.presentationProperties.gridSpacing}),O=Jm.useCallback(()=>!!(D.dragStateRef.current||D.resizeStateRef.current||D.marqueeStateRef.current||D.shapeAdjustmentDragStateRef.current||D.isDrawingRef.current),[D.dragStateRef,D.resizeStateRef,D.marqueeStateRef,D.shapeAdjustmentDragStateRef,D.isDrawingRef]),z=iz({canvasSize:Y,selectedElements:D.selectedElements}),te=rz({slides:j,canvasSize:Y,activeSlideIndex:de,templateElementsBySlideId:ce,editTemplateMode:D.editTemplateMode,headerFooter:D.headerFooter,loading:ge,error:fe,hasActivePointerInteraction:O,pointerCommitNonce:D.pointerCommitNonce,setSlides:D.setSlides,setCanvasSize:D.setCanvasSize,setActiveSlideIndex:D.setActiveSlideIndex,setTemplateElementsBySlideId:D.setTemplateElementsBySlideId,setSelectedElementId:D.setSelectedElementId,setSelectedElementIds:D.setSelectedElementIds,setEditTemplateMode:D.setEditTemplateMode,setHeaderFooter:D.setHeaderFooter}),{presentation:$,annotations:Me,actionSoundHandlerRef:De}=rV({mode:G,slides:j,visibleSlideIndexes:me,activeSlideIndex:de,containerRef:U,content:C,mediaDataUrls:D.mediaDataUrls,presentationProperties:D.presentationProperties,setMode:D.setMode,setActiveSlideIndex:D.setActiveSlideIndex,setSlides:D.setSlides,history:te});gV({targetRef:z.canvasViewportRef,currentScale:z.scale,callbacks:{onPinchZoom:Te=>z.setScale(Te),onSwipe:G==="present"?Te=>$.movePresentationSlide(Te===1?-1:1):void 0,onLongPress:(Te,Ve)=>{G!=="edit"||!s||D.selectedElementId&&D.setContextMenuState({x:Te,y:Ve,elementId:D.selectedElementId});}},enabled:W});let V=Jz({mode:G,slides:j,activeSlide:ae,canvasSize:Y,containerRef:U,customShows:D.customShows,activeCustomShowId:D.activeCustomShowId,setCustomShows:D.setCustomShows,setActiveCustomShowId:D.setActiveCustomShowId,setGuides:D.setGuides,setPresentationProperties:D.setPresentationProperties,setAccessibilityIssues:D.setAccessibilityIssues,setIsAccessibilityPanelOpen:D.setIsAccessibilityPanelOpen,setMode:D.setMode,setPreMasterMode:D.setPreMasterMode,setActiveMasterIndex:D.setActiveMasterIndex,setActiveLayoutIndex:D.setActiveLayoutIndex,setSelectedElementId:D.setSelectedElementId,setSelectedElementIds:D.setSelectedElementIds,preMasterMode:D.preMasterMode,hasDigitalSignatures:D.hasDigitalSignatures,isDirty:D.isDirty,history:te});Jm.useEffect(()=>{D.setSelectedElementId(null),D.setSelectedElementIds([]),D.setInlineEditingElementId(null);},[de]),Jm.useEffect(()=>{G==="present"&&(D.setSelectedElementId(null),D.setSelectedElementIds([]),D.setInlineEditingElementId(null),z.handleZoomToFit(),z.canvasViewportRef.current?.scrollTo({left:0,top:0}));},[G]);let B=oV({state:D,history:te,zoom:z,mode:G,canEdit:s,slides:j,activeSlide:ae,activeSlideIndex:de,selectedElement:_e,selectedElementId:J,selectedElementIds:re,canvasSize:Y,dialogs:V,presentation:$,userName:x??g?.userName,handlerRef:De}),{exportHandlers:ee,printHandlers:oe,themeHandlers:pe,propertyHandlers:Ae,showKeepAnnotationsDialog:Le,handleSetMode:ue,handleKeepAnnotations:we,handleDiscardAnnotations:Ie,handleEnterPresenterView:He,handleEnterRehearsalMode:Oe,autosaveStatus:$e,isEncryptedDialogOpen:ot,setIsEncryptedDialogOpen:at}=cV({state:D,zoom:z,history:te,presentation:$,annotations:Me,actionSoundHandlerRef:De,editorOps:B,dialogs:V,gridSpacingPx:se,content:C,filePath:o,autosaveEnabled:R,canEdit:s,mode:G,slides:j,activeSlide:ae,activeSlideIndex:de,canvasSize:Y,loading:ge,error:fe,ref:n,setContent:T,onContentChange:a,onDirtyChange:l,onActiveSlideChange:c,onModeChange:d,onZoomChange:u,onSelectionChange:p,onSlideCountChange:h});if(ge)return jsxRuntime.jsx(d6,{});if(fe)return jsxRuntime.jsx(u6,{error:fe});let gt=G==="edit"&&!Ee&&!V.isNarrowViewport&&D.isSlidesPaneOpen,le=G==="master"&&!Ee&&D.isSlidesPaneOpen,Ue=jsxRuntime.jsxs("div",{style:w,"data-pptx-viewer":"",className:"h-full w-full bg-background text-foreground relative",children:[jsxRuntime.jsxs("div",{ref:U,tabIndex:0,className:"h-full w-full flex flex-col overflow-hidden outline-none",children:[G!=="present"&&jsxRuntime.jsx(WG,{mode:G,canEdit:s,state:D,selectedElement:_e,activeSlide:ae,zoom:z,history:te,findReplace:B.findReplace,manipulation:B.manipulation,insertHandlers:B.insertHandlers,exportHandlers:ee,printHandlers:oe,propertyHandlers:Ae,dialogs:V,slideOps:B.slideOps,ops:B.ops,onSetMode:ue,onEnterPresenterView:He,onEnterRehearsalMode:Oe,onOpenSettings:()=>E(true),onOpenShareDialog:()=>k(true),onOpenFile:M,fileName:i,autosaveStatus:$e,autosaveEnabled:R,onToggleAutosave:()=>I(Te=>!Te)}),jsxRuntime.jsx(tW,{mode:G,canEdit:s,slides:j,activeSlide:ae,masterPseudoSlide:A,activeSlideIndex:de,canvasSize:Y,gridSpacingPx:se,slideSectionGroups:P,showSlidesPane:gt,showMasterPane:le,selectedElement:_e,state:D,editorOps:B,dialogs:V,presentation:$,annotations:Me,propertyHandlers:Ae,themeHandlers:pe,history:te,comments:B.comments,zoom:z,isMobile:Ee,isTouchDevice:W,onEndPresentation:()=>ue("edit"),leftPanelWidth:Ee?void 0:Q.leftWidth,onResizeLeft:Ee?void 0:Q.onResizeLeft,rightPanelWidth:Ee?void 0:Q.rightWidth,onResizeRight:Ee?void 0:Q.onResizeRight}),G!=="present"&&(!q||!D.isSlideNotesCollapsed)&&jsxRuntime.jsx(VG,{activeSlide:ae,allSlides:j,isSlideNotesCollapsed:D.isSlideNotesCollapsed,canEdit:s,slideCount:j.length,activeSlideIndex:de,isDirty:D.isDirty,autosaveStatus:$e,onToggleNotes:()=>D.setIsSlideNotesCollapsed(Te=>!Te),onUpdateNotes:Ae.handleUpdateNotes,collaborationSlot:g?jsxRuntime.jsx(npt,{}):void 0,notesPanelHeight:Ee?void 0:Q.bottomHeight,onResizeBottom:Ee?void 0:Q.onResizeBottom,scale:z.scale,onZoomIn:z.handleZoomIn,onZoomOut:z.handleZoomOut,onZoomToFit:z.handleZoomToFit,mode:G,onSetMode:ue,onToggleSlideSorter:()=>D.setShowSlideSorter(Te=>!Te),hideStatusBar:Ee}),G!=="present"&&Ee&&jsxRuntime.jsx(Zme,{state:D,editorOps:B,presentation:$,slides:j,activeSlideIndex:de,canvasSize:Y,slideSectionGroups:P,canEdit:s,commentCount:ae?.comments?.length??0})]}),jsxRuntime.jsx(jG,{dialogs:V,insertHandlers:B.insertHandlers,exportHandlers:ee,printHandlers:oe,propertyHandlers:Ae,annotations:Me,slides:j,activeSlideIndex:de,canvasSize:Y,filePath:o,coreProperties:D.coreProperties,customProperties:D.customProperties,appProperties:D.appProperties,embeddedFonts:D.embeddedFonts,hasDigitalSignatures:D.hasDigitalSignatures,digitalSignatureCount:D.digitalSignatureCount,presentationProperties:D.presentationProperties,customShows:D.customShows,selectedElements:D.selectedElements,isEncryptedDialogOpen:ot,setIsEncryptedDialogOpen:at,showKeepAnnotationsDialog:Le,onKeepAnnotations:we,onDiscardAnnotations:Ie}),jsxRuntime.jsx(Qme,{isOpen:_,onClose:()=>E(false),spellCheckEnabled:D.spellCheckEnabled,onSetSpellCheckEnabled:D.setSpellCheckEnabled,showGrid:D.showGrid,onSetShowGrid:D.setShowGrid,showRulers:D.showRulers,onSetShowRulers:D.setShowRulers,snapToGrid:D.snapToGrid,onSetSnapToGrid:D.setSnapToGrid,reducedMotion:F,onToggleReducedMotion:N}),jsxRuntime.jsx(IG,{open:L,onClose:()=>k(false),activeCollaboration:g,onStartCollaboration:y,onStopCollaboration:b,preconfigured:!!g,defaultRoomId:v?.roomId,defaultUserName:v?.userName,defaultServerUrl:v?.serverUrl}),jsxRuntime.jsx(EG,{open:V.isBroadcastDialogOpen,onClose:()=>V.setIsBroadcastDialogOpen(false),onStartBroadcast:y,onStopBroadcast:b,onStartPresenting:()=>ue("present"),defaultRoomId:v?.roomId,defaultUserName:v?.userName,defaultServerUrl:v?.serverUrl}),jsxRuntime.jsx(HG,{isShortcutHelpOpen:D.isShortcutHelpOpen,isAccessibilityPanelOpen:D.isAccessibilityPanelOpen,showSlideSorter:D.showSlideSorter,accessibilityIssues:D.accessibilityIssues,slides:j,activeSlideIndex:de,canvasSize:Y,canEdit:s,sectionGroups:P,onCloseShortcuts:()=>D.setIsShortcutHelpOpen(false),onCloseAccessibility:()=>D.setIsAccessibilityPanelOpen(false),onSelectSlide:Te=>{D.setActiveSlideIndex(Te),D.setShowSlideSorter(false);},onMoveSlide:B.slideOps.handleMoveSlide,onDeleteSlides:B.slideOps.handleDeleteSlides,onDuplicateSlides:B.slideOps.handleDuplicateSlides,onToggleHideSlides:B.slideOps.handleToggleHideSlides,onCloseSorter:()=>D.setShowSlideSorter(false),reducedMotion:F,onToggleReducedMotion:N}),jsxRuntime.jsx(YG,{mode:G,slides:j,canvasSize:Y,templateElements:D.templateElements,presentation:$,onExitPresentation:()=>ue("edit"),isMobile:Ee})]});return jsxRuntime.jsx(QR.Provider,{value:S,children:jsxRuntime.jsx(bR,{theme:m,children:g?jsxRuntime.jsxs(MH,{config:g,canvasWidth:Y.width,canvasHeight:Y.height,children:[jsxRuntime.jsx(rpt,{slides:j,templateElementsBySlideId:ce,setSlides:D.setSlides,config:g,content:C}),jsxRuntime.jsx(opt,{activeSlideIndex:de,setActiveSlideIndex:D.setActiveSlideIndex,slideCount:j.length}),Ue]}):Ue})})});tge.displayName="PowerPointViewer";function npt(){let t=No();return t?jsxRuntime.jsx(IH,{status:t.status,connectedCount:t.connectedCount,onRetry:t.retry}):null}function rpt({slides:t,templateElementsBySlideId:e,setSlides:n,config:r,content:o}){let i=No(),s=Jm.useRef(o);s.current=o;let a=Jm.useCallback(()=>{let l=s.current;return l?l instanceof Uint8Array?l:new Uint8Array(l):null},[]);return uV({doc:i?.doc??null,slides:t,templateElementsBySlideId:e,setSlides:n,isConnected:i?.status==="connected",isSynced:i?.synced??true,config:r,getSourceBytes:a}),null}function opt({activeSlideIndex:t,setActiveSlideIndex:e,slideCount:n}){let r=No(),{followedClientId:o,followUser:i}=fV({collab:r,activeSlideIndex:t,setActiveSlideIndex:e,slideCount:n});return pV({collab:r,activeSlideIndex:t,setActiveSlideIndex:e,slideCount:n,paused:o!==null}),r?jsxRuntime.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-2 z-[1100] flex justify-center px-2",children:jsxRuntime.jsx("div",{className:"pointer-events-auto",children:jsxRuntime.jsx(RH,{presences:r.remoteUsers,followedClientId:o,onFollow:i})})}):null}/**
4869
+ `);return o.textContent=i,document.head.appendChild(o),()=>{let s=document.getElementById(xue);s&&document.head.removeChild(s);}},[n]);}function aV(t){let{content:e,filePath:n,autosaveEnabled:r=true,slides:o,state:i,history:s,ops:a,actionSoundHandlerRef:l,setIsEncryptedDialogOpen:c,password:d}=t,{handlerRef:u}=Tz({content:e,clearSelection:a.clearSelection,history:s,setSlides:i.setSlides,setTemplateElementsBySlideId:i.setTemplateElementsBySlideId,mediaDataUrls:i.mediaDataUrls,setCanvasSize:i.setCanvasSize,setHeaderFooter:i.setHeaderFooter,setLayoutOptions:i.setLayoutOptions,setSlideMasters:i.setSlideMasters,setTheme:i.setTheme,setTableStyleMap:i.setTableStyleMap,setThemeOptions:i.setThemeOptions,setCustomShows:i.setCustomShows,setSections:i.setSections,setPresentationProperties:i.setPresentationProperties,setNotesMaster:i.setNotesMaster,setHandoutMaster:i.setHandoutMaster,setNotesCanvasSize:i.setNotesCanvasSize,setCustomProperties:i.setCustomProperties,setTagCollections:i.setTagCollections,setCoreProperties:i.setCoreProperties,setAppProperties:i.setAppProperties,setEmbeddedFonts:i.setEmbeddedFonts,setActiveSlideIndex:i.setActiveSlideIndex,setHasMacros:i.setHasMacros,setHasDigitalSignatures:i.setHasDigitalSignatures,setDigitalSignatureCount:i.setDigitalSignatureCount,setGuides:i.setGuides,setLoading:i.setLoading,setError:i.setError,setIsDirty:i.setIsDirty,setIsEncrypted:c});Jm.useEffect(()=>{l.current=u.current;},[u,l,i.loading]),bue({embeddedFonts:i.embeddedFonts,slides:o});let p=tV({slides:o,templateElementsBySlideId:i.templateElementsBySlideId,activeSlideIndex:i.activeSlideIndex,guides:i.guides,headerFooter:i.headerFooter,presentationProperties:i.presentationProperties,customShows:i.customShows,sections:i.sections,coreProperties:i.coreProperties,appProperties:i.appProperties,customProperties:i.customProperties,notesMaster:i.notesMaster,handoutMaster:i.handoutMaster,handlerRef:u,inlineEditingElementIdRef:i.inlineEditingElementIdRef,inlineEditingTextRef:i.inlineEditingTextRef,password:d}),{autosaveStatus:h}=Cz({isDirty:i.isDirty,filePath:n,serializeSlides:p,enabled:r});return {handlerRef:u,serializeSlides:p,autosaveStatus:h}}var ltt=2,ctt=20;function vue(t){let e=Jm.useRef(t);e.current=t;let n=Jm.useCallback(r=>{let{mode:o,canEdit:i,inlineEditingElementId:s,tableEditorState:a,activeTool:l,hasSelection:c,onDelete:d,onCopy:u,onCut:p,onPaste:h,onDuplicate:f,onUndo:m,onRedo:x,onSelectAll:g,onEscape:y,onNudge:b,onPrevSlide:v,onNextSlide:S}=e.current;if(o!=="edit"||!i)return;let w=r.target,C=w?.tagName==="INPUT"||w?.tagName==="TEXTAREA"||w?.isContentEditable;if(r.key==="Escape"){r.preventDefault(),y();return}if(s||a?.isEditing||l!=="select"||C)return;let T=r.metaKey||r.ctrlKey;if((r.key==="Delete"||r.key==="Backspace")&&c){r.preventDefault(),d();return}if(T)switch(r.key.toLowerCase()){case "z":r.preventDefault(),r.shiftKey?x():m();return;case "y":r.preventDefault(),x();return;case "c":c&&(r.preventDefault(),u());return;case "x":c&&(r.preventDefault(),p());return;case "v":r.preventDefault(),h();return;case "d":c&&(r.preventDefault(),f());return;case "a":r.preventDefault(),g();return}if(c&&(r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="ArrowLeft"||r.key==="ArrowRight")){r.preventDefault();let M=r.shiftKey?ctt:ltt,_=0,E=0;switch(r.key){case "ArrowUp":E=-M;break;case "ArrowDown":E=M;break;case "ArrowLeft":_=-M;break;case "ArrowRight":_=M;break}b(_,E);return}!c&&(r.key==="ArrowLeft"||r.key==="ArrowRight")&&(r.preventDefault(),r.key==="ArrowLeft"?v?.():S?.());},[]);Jm.useEffect(()=>{let r=t.containerRef.current;return r&&r.addEventListener("keydown",n),window.addEventListener("keydown",n),()=>{r&&r.removeEventListener("keydown",n),window.removeEventListener("keydown",n);}},[t.containerRef,n]);}function lV(t){let{state:e,mode:n,canEdit:r,slides:o,activeSlide:i,ops:s,manipulation:a,history:l}=t;vue({containerRef:e.containerRef,mode:n,canEdit:r,inlineEditingElementId:e.inlineEditingElementId,tableEditorState:e.tableEditorState,activeTool:e.activeTool,hasSelection:e.effectiveSelectedIds.length>0,effectiveSelectedIds:e.effectiveSelectedIds,onDelete:a.handleDelete,onCopy:a.handleCopy,onCut:a.handleCut,onPaste:a.handlePaste,onDuplicate:a.handleDuplicate,onUndo:l.handleUndo,onRedo:l.handleRedo,onSelectAll:()=>{if(!i)return;let c=i.elements.map(d=>d.id);c.length>0&&s.applySelection(c[0],c);},onEscape:()=>{e.inlineEditingElementId?(e.setInlineEditingElementId(null),e.setInlineEditingText("")):e.contextMenuState?e.setContextMenuState(null):e.tableEditorState?e.setTableEditorState(null):s.clearSelection();},onNudge:(c,d)=>{let u=e.effectiveSelectedIds;if(u.length){for(let p of u){let h=e.elementLookup.get(p);h&&s.updateElementById(p,{x:h.x+c,y:h.y+d});}l.markDirty();}},onPrevSlide:()=>{o.length!==0&&e.setActiveSlideIndex(c=>Math.max(0,c-1));},onNextSlide:()=>{o.length!==0&&e.setActiveSlideIndex(c=>Math.min(o.length-1,c+1));}});}function cV(t){let{state:e,zoom:n,history:r,presentation:o,annotations:i,actionSoundHandlerRef:s,editorOps:a,dialogs:l,gridSpacingPx:c,content:d,filePath:u,autosaveEnabled:p,canEdit:h,mode:f,slides:m,activeSlide:x,activeSlideIndex:g,canvasSize:y,loading:b,error:v,ref:S,setContent:w,onContentChange:C,onDirtyChange:T,onActiveSlideChange:M,onModeChange:_,onZoomChange:E,onSelectionChange:R,onSlideCountChange:I}=t;Pz({editorScale:n.editorScale,canvasStageRef:n.canvasStageRef,canvasSize:y,activeSlide:x,activeSlideIndex:g,gridSpacingPx:c,dragStateRef:e.dragStateRef,resizeStateRef:e.resizeStateRef,shapeAdjustmentDragStateRef:e.shapeAdjustmentDragStateRef,marqueeStateRef:e.marqueeStateRef,editTemplateMode:e.editTemplateMode,snapToGrid:e.snapToGrid,snapToShape:e.snapToShape,guides:e.guides,templateElements:e.templateElements,elementLookup:e.elementLookup,setMarqueeSelectionState:e.setMarqueeSelectionState,setSnapLines:e.setSnapLines,setTemplateElementsBySlideId:e.setTemplateElementsBySlideId,setPointerCommitNonce:e.setPointerCommitNonce,effectiveSelectedIds:e.effectiveSelectedIds,applySelection:a.ops.applySelection,clearSelection:a.ops.clearSelection,updateSlides:a.ops.updateSlides,updateElementById:a.ops.updateElementById,markDirty:r.markDirty});let[L,k]=Jm.useState(false),{handlerRef:F,serializeSlides:N,autosaveStatus:D}=aV({content:d,filePath:u,autosaveEnabled:p,slides:m,state:e,history:r,ops:a.ops,actionSoundHandlerRef:s,setIsEncryptedDialogOpen:k,password:l.presentationPassword??void 0}),{exportHandlers:U,printHandlers:G,themeHandlers:j,propertyHandlers:Y}=iV({state:e,slides:m,activeSlideIndex:g,canvasSize:y,filePath:u,history:r,ops:a.ops,zoom:n,handlerRef:F,serializeSlides:N,setContent:w,onContentChange:C,password:l.presentationPassword??void 0}),{showKeepAnnotationsDialog:ge,handleSetMode:fe,handleKeepAnnotations:de,handleDiscardAnnotations:J,handleEnterPresenterView:re,handleEnterRehearsalMode:ce}=eV({mode:f,presentation:o,annotations:i,history:r,setMode:e.setMode,setSlides:e.setSlides});return nV({filePath:u,loading:b,error:v,slideCount:m.length,openVersionHistory:()=>Y.setIsVersionHistoryOpen(true)}),Jm.useImperativeHandle(S,()=>({async getContent(){let ae=await N();return ae&&C&&C(ae),ae??new Uint8Array(0)},goTo(ae){ae>=0&&ae<m.length&&e.setActiveSlideIndex(ae);},goPrev(){let ae=g-1;ae>=0&&e.setActiveSlideIndex(ae);},goNext(){let ae=g+1;ae<m.length&&e.setActiveSlideIndex(ae);},undo(){r.handleUndo();},redo(){r.handleRedo();},canUndo(){return r.canUndo},canRedo(){return r.canRedo},getZoom(){return n.scale},setZoom(ae){n.setScale(Math.min(Math.max(ae,.2),5));},zoomIn(){n.handleZoomIn();},zoomOut(){n.handleZoomOut();},zoomReset(){n.handleResetZoom();},getMode(){return f},setMode(ae){e.setMode(ae);},getActiveSlideIndex(){return g},getSlideCount(){return m.length},isDirty(){return e.isDirty},getSelectedElementIds(){return e.selectedElementIds},selectElements(ae){e.setSelectedElementIds(ae),e.setSelectedElementId(ae[0]??null);},clearSelection(){e.setSelectedElementIds([]),e.setSelectedElementId(null);},setActiveSlideIndex(ae){ae>=0&&ae<m.length&&e.setActiveSlideIndex(ae);},getSlides(){return m},getSlide(ae){return m[ae]},getActiveSlide(){return m[g]},addSlide(ae){a.slideOps.handleAddSlide();},deleteSlides(ae){a.slideOps.handleDeleteSlides(ae);},duplicateSlides(ae){a.slideOps.handleDuplicateSlides(ae);},moveSlide(ae,_e){a.slideOps.handleMoveSlide(ae,_e);},toggleHideSlides(ae){a.slideOps.handleToggleHideSlides(ae);},getElements(ae){return m[ae??g]?.elements??[]},getElementById(ae,_e){return m[_e??g]?.elements.find(W=>W.id===ae)},updateElement(ae,_e){a.ops.updateElementById(ae,_e);},deleteElements(ae){e.setSelectedElementIds(ae),e.setSelectedElementId(ae[0]??null),a.manipulation.handleDelete();},duplicateElement(ae){return e.setSelectedElementIds([ae]),e.setSelectedElementId(ae),a.manipulation.handleDuplicate(),e.selectedElementIds[0]}}),[N,C,m,g,e,r,n,f,a]),Jm.useEffect(()=>{T&&T(e.isDirty);},[e.isDirty,T]),Jm.useEffect(()=>{M&&M(g);},[g,M]),Jm.useEffect(()=>{e.activeSlideIndexRef.current=g;},[g,e.activeSlideIndexRef]),Jm.useEffect(()=>{_&&_(f);},[f,_]),Jm.useEffect(()=>{E&&E(n.scale);},[n.scale,E]),Jm.useEffect(()=>{R&&R(e.selectedElementIds);},[e.selectedElementIds,R]),Jm.useEffect(()=>{I&&I(m.length);},[m.length,I]),lV({state:e,mode:f,canEdit:h,slides:m,activeSlide:x,ops:a.ops,manipulation:a.manipulation,history:r}),{exportHandlers:U,printHandlers:G,themeHandlers:j,propertyHandlers:Y,showKeepAnnotationsDialog:ge,handleSetMode:fe,handleKeepAnnotations:de,handleDiscardAnnotations:J,handleEnterPresenterView:re,handleEnterRehearsalMode:ce,autosaveStatus:D,isEncryptedDialogOpen:L,setIsEncryptedDialogOpen:k}}function gtt(){return typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function xtt(){return false}function ytt(t){if(typeof window>"u")return ()=>{};let e=window.matchMedia("(prefers-reduced-motion: reduce)");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}function dV(){let t=Jm.useSyncExternalStore(ytt,gtt,xtt),[e,n]=Jm.useState(false),r=t||e,o=Jm.useCallback(()=>{n(i=>!i);},[]);return Jm.useEffect(()=>{let i=document.documentElement;return r?i.classList.add("pptx-reduced-motion"):i.classList.remove("pptx-reduced-motion"),()=>{i.classList.remove("pptx-reduced-motion");}},[r]),{osReducedMotion:t,manualReducedMotion:e,reducedMotion:r,toggleReducedMotion:o,setManualReducedMotion:n}}Pe();var btt=5e3;function uV({doc:t,slides:e,templateElementsBySlideId:n,setSlides:r,isConnected:o,isSynced:i=true,config:s,getSourceBytes:a}){let l=Jm.useRef(false),c=Jm.useRef(""),d=Jm.useRef(false),u=Jm.useRef(null),p=Jm.useRef(null),h=Jm.useCallback(async()=>{if(p.current)return p.current;let m=await Promise.resolve().then(()=>(BC(),OC)),x={createMap:()=>new m.Map,createArray:()=>new m.Array,createText:()=>new m.Text};return p.current=x,x},[]),f=Jm.useCallback(()=>{if(!s?.onWriteBack||s.role!=="owner"||!t)return;u.current!==null&&clearTimeout(u.current);let m=s.writeBackDebounceMs??btt;u.current=setTimeout(async()=>{if(u.current=null,!t||!s.onWriteBack)return;let x=a?.();if(x)try{let{PptxHandler:g}=await Promise.resolve().then(()=>(bt(),wq)),y=new g;await y.load(x.buffer);let b=CU(t),v=Jy(b,n),S=await y.save(v);s.onWriteBack(S);}catch{}},m);},[t,s,a,n]);Jm.useEffect(()=>{if(!o||!i||!t||l.current||e.length===0)return;let m=JSON.stringify(e);m!==c.current&&(c.current=m,(async()=>{let x=await h();yne(e,t,x,jA),f();})());},[t,e,o,i,h,f]),Jm.useEffect(()=>{if(!o||!t)return;let m=(g,y)=>{if(y?.origin===jA)return;let b=CU(t);if(b.length===0)return;let v=JSON.stringify(b);v!==c.current&&(c.current=v,l.current=true,r(b),requestAnimationFrame(()=>{l.current=false;}),f());},x=hne(t,m);return d.current||(d.current=true,t.getArray("pptx:slides").length>0&&m()),()=>{x(),u.current!==null&&(clearTimeout(u.current),u.current=null);}},[t,o,r,f]);}function pV({collab:t,activeSlideIndex:e,setActiveSlideIndex:n,slideCount:r,paused:o=false}){let i=Jm.useRef(-1);Jm.useEffect(()=>{if(!t||o||t.config.role!=="viewer")return;let s=t.remoteUsers.find(l=>l.role==="owner");if(!s)return;let a=s.activeSlideIndex;a<0||a>=r||a!==i.current&&(i.current=a,a!==e&&n(a));},[t,e,n,r,o]);}function fV({collab:t,activeSlideIndex:e,setActiveSlideIndex:n,slideCount:r}){let[o,i]=Jm.useState(null),s=Jm.useRef(-1),a=Jm.useCallback(d=>{s.current=-1,i(d);},[]),l=o===null?null:t?.remoteUsers.find(d=>d.clientId===o)??null;Jm.useEffect(()=>{o!==null&&t&&l===null&&i(null);},[t,o,l]);let c=l?.activeSlideIndex??null;return Jm.useEffect(()=>{if(!(c===null||c<0||c>=r)){if(c===e){s.current=c;return}s.current=c,n(c);}},[c,r,n]),Jm.useEffect(()=>{o!==null&&s.current!==-1&&e!==s.current&&i(null);},[e,o]),{followedClientId:o,followUser:a}}Pe();Pe();function gV(t){let{targetRef:e,currentScale:n,callbacks:r,enabled:o=true}=t,i=Jm.useRef(r);i.current=r;let s=Jm.useRef(n);s.current=n;let[a,l]=Jm.useState(0),c=Jm.useRef(null);e.current!==c.current&&(c.current=e.current,queueMicrotask(()=>l(d=>d+1))),Jm.useEffect(()=>{let d=e.current;if(!d||!o)return;let u=Jne({getScale:()=>s.current,minScale:.2,maxScale:5,callbacks:{onPinchZoom:x=>i.current.onPinchZoom?.(x),onSwipe:x=>i.current.onSwipe?.(x),onLongPress:(x,g)=>i.current.onLongPress?.(x,g)}}),p=x=>u.onTouchStart(x),h=x=>u.onTouchMove(x),f=x=>u.onTouchEnd(x),m=()=>u.onTouchCancel();return d.addEventListener("touchstart",p,{passive:false}),d.addEventListener("touchmove",h,{passive:false}),d.addEventListener("touchend",f,{passive:true}),d.addEventListener("touchcancel",m,{passive:true}),()=>{d.removeEventListener("touchstart",p),d.removeEventListener("touchmove",h),d.removeEventListener("touchend",f),d.removeEventListener("touchcancel",m),u.cancel();}},[e,o,a]);}Pe();function Rtt(t){if(!(t instanceof HTMLElement))return false;let e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||t.isContentEditable}function Tue(t){if(t<=0||typeof document>"u")return;let e=document.activeElement;if(!Rtt(e))return;let n=e.getBoundingClientRect(),r=Fne({top:n.top,bottom:n.bottom},window.innerHeight,t);r!==0&&window.scrollBy({top:r,behavior:"smooth"});}function xV(t=true){let[e,n]=Jm.useState(0);return Jm.useEffect(()=>{if(!t||typeof window>"u")return;let r=window.visualViewport;if(!r)return;let o=()=>{let s=EU(window),a=s?PU(s):0;n(a),a>0&&window.requestAnimationFrame(()=>Tue(a));};o(),r.addEventListener("resize",o),r.addEventListener("scroll",o);let i=()=>{window.requestAnimationFrame(()=>{let s=EU(window),a=s?PU(s):0;a>0&&Tue(a);});};return document.addEventListener("focusin",i),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o),document.removeEventListener("focusin",i);}},[t]),{keyboardInset:e,isKeyboardOpen:Dne(e)}}var Ltt=[{value:"lpwstr",labelKey:"pptx.documentProperties.custom.typeText"},{value:"i4",labelKey:"pptx.documentProperties.custom.typeNumber"},{value:"filetime",labelKey:"pptx.documentProperties.custom.typeDate"},{value:"bool",labelKey:"pptx.documentProperties.custom.typeYesNo"}];function yV({customProperties:t,onUpdate:e}){let{t:n}=reactI18next.useTranslation(),r=Jm.useCallback(()=>{e([...t,{name:"",value:"",type:"lpwstr"}]);},[t,e]),o=Jm.useCallback(l=>{e(t.filter((c,d)=>d!==l));},[t,e]),i=Jm.useCallback((l,c)=>{e(t.map((d,u)=>u===l?{...d,name:c}:d));},[t,e]),s=Jm.useCallback((l,c)=>{e(t.map((d,u)=>u===l?{...d,value:c}:d));},[t,e]),a=Jm.useCallback((l,c)=>{e(t.map((d,u)=>u===l?{...d,type:c}:d));},[t,e]);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:n("pptx.documentProperties.custom.description")}),jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr_1fr_100px_32px] gap-1 text-[11px] font-medium text-muted-foreground px-1",children:[jsxRuntime.jsx("span",{children:n("pptx.documentProperties.custom.name")}),jsxRuntime.jsx("span",{children:n("pptx.documentProperties.custom.value")}),jsxRuntime.jsx("span",{children:n("pptx.documentProperties.custom.type")}),jsxRuntime.jsx("span",{})]}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto space-y-1",children:t.map((l,c)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr_1fr_100px_32px] gap-1 items-center",children:[jsxRuntime.jsx("input",{type:"text",className:"w-full rounded border border-border bg-muted px-2 py-1 text-xs text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",placeholder:n("pptx.documentProperties.custom.namePlaceholder"),value:l.name,onChange:d=>i(c,d.target.value)}),l.type==="bool"?jsxRuntime.jsxs("select",{className:"w-full rounded border border-border bg-muted px-2 py-1 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:l.value,onChange:d=>s(c,d.target.value),children:[jsxRuntime.jsx("option",{value:"true",children:n("pptx.documentProperties.custom.yes")}),jsxRuntime.jsx("option",{value:"false",children:n("pptx.documentProperties.custom.no")})]}):jsxRuntime.jsx("input",{type:l.type==="i4"?"number":"text",className:"w-full rounded border border-border bg-muted px-2 py-1 text-xs text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",placeholder:n("pptx.documentProperties.custom.valuePlaceholder"),value:l.value,onChange:d=>s(c,d.target.value)}),jsxRuntime.jsx("select",{className:"w-full rounded border border-border bg-muted px-2 py-1 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:l.type,onChange:d=>a(c,d.target.value),children:Ltt.map(d=>jsxRuntime.jsx("option",{value:d.value,children:n(d.labelKey)},d.value))}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o(c),className:"p-1 rounded hover:bg-red-500/20 text-muted-foreground hover:text-red-400 transition-colors","aria-label":n("pptx.documentProperties.custom.deleteProperty"),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3.5 h-3.5"})})]},`custom-prop-${c}`))}),t.length===0&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground/60 text-center py-4",children:n("pptx.documentProperties.custom.empty")}),jsxRuntime.jsxs("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg border border-border text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuPlus,{className:"w-3.5 h-3.5"}),n("pptx.documentProperties.custom.addProperty")]})]})}var Ott=[{key:"application",labelKey:"pptx.documentProperties.statistics.application",editable:false},{key:"appVersion",labelKey:"pptx.documentProperties.statistics.appVersion",editable:false},{key:"presentationFormat",labelKey:"pptx.documentProperties.statistics.presentationFormat",editable:false},{key:"slides",labelKey:"pptx.documentProperties.statistics.slides",editable:false},{key:"hiddenSlides",labelKey:"pptx.documentProperties.statistics.hiddenSlides",editable:false},{key:"notes",labelKey:"pptx.documentProperties.statistics.notes",editable:false},{key:"totalTime",labelKey:"pptx.documentProperties.statistics.totalTime",editable:false},{key:"words",labelKey:"pptx.documentProperties.statistics.words",editable:false},{key:"paragraphs",labelKey:"pptx.documentProperties.statistics.paragraphs",editable:false},{key:"template",labelKey:"pptx.documentProperties.statistics.template",editable:false},{key:"company",labelKey:"pptx.documentProperties.summary.company",editable:true},{key:"manager",labelKey:"pptx.documentProperties.summary.manager",editable:true}];function Btt(t,e){if(t==null)return e("pptx.documentProperties.statistics.notAvailable");let n=Math.floor(t/60),r=t%60;return e("pptx.documentProperties.statistics.hoursMinutes",{hours:n,minutes:r})}function Utt(t,e,n){return t==="totalTime"?Btt(e,n):e==null?n("pptx.documentProperties.statistics.notAvailable"):String(e)}function bV({appProperties:t,onUpdateAppProperties:e,canEdit:n}){let{t:r}=reactI18next.useTranslation(),o=Jm.useCallback((i,s)=>{e({[i]:s});},[e]);return jsxRuntime.jsx("div",{className:"space-y-3",children:Ott.map(({key:i,labelKey:s,editable:a})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("label",{className:"block text-xs text-foreground w-[140px] shrink-0",children:r(s)}),a&&n?jsxRuntime.jsx("input",{type:"text",className:"flex-1 rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:String(t[i]??""),onChange:l=>o(i,l.target.value)}):jsxRuntime.jsx("span",{className:"flex-1 px-3 py-2 text-sm text-muted-foreground",children:Utt(i,t[i],r)})]},i))})}var Cue=[{key:"title",labelKey:"pptx.properties.titleLabel"},{key:"subject",labelKey:"pptx.properties.subject"},{key:"creator",labelKey:"pptx.properties.author"},{key:"keywords",labelKey:"pptx.properties.keywords"},{key:"description",labelKey:"pptx.documentProperties.summary.description",multiline:true},{key:"category",labelKey:"pptx.documentProperties.summary.category"}];function vV({isOpen:t,coreProperties:e,customProperties:n,appProperties:r,onClose:o,onSave:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState("summary"),[c,d]=Jm.useState({}),[u,p]=Jm.useState([]),[h,f]=Jm.useState({}),[m,x]=Jm.useState(false);t&&!m&&(d({...e}),p(n.map(M=>({...M}))),f({company:r?.company,manager:r?.manager}),l("summary")),t!==m&&x(t);let g=Jm.useCallback((M,_)=>{d(E=>({...E,[M]:_}));},[]),y=Jm.useMemo(()=>{if(Cue.some(({key:R})=>(c[R]??"")!==(e[R]??"")))return true;let _=(h.company??"")!==(r?.company??""),E=(h.manager??"")!==(r?.manager??"");return _||E||u.length!==n.length?true:u.some((R,I)=>R.name!==n[I]?.name||R.value!==n[I]?.value||R.type!==n[I]?.type)},[c,u,h,e,n,r]),b=Jm.useCallback(M=>{f(_=>({..._,...M}));},[]),v=Jm.useCallback(()=>{let M=(h.company??"")!==(r?.company??"")||(h.manager??"")!==(r?.manager??"");i(c,u,M?h:void 0),o();},[c,u,h,r,i,o]),S=Jm.useCallback(()=>{o();},[o]),{panelStyle:w,handlers:C}=pi(S);if(!t)return null;let T=[{id:"summary",labelKey:"pptx.documentProperties.tabs.general"},{id:"custom",labelKey:"pptx.documentProperties.tabs.custom"},{id:"statistics",labelKey:"pptx.documentProperties.tabs.statistics"}];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":s("common.close"),onClick:S}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{style:w,className:"pointer-events-auto w-[520px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...C,className:"flex items-center justify-between px-5 py-4 border-b border-border/60 touch-none",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuFileText,{className:"w-5 h-5 text-primary"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("pptx.documentProperties.dialogTitle")})]}),jsxRuntime.jsx("button",{type:"button",onClick:S,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":s("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"flex border-b border-border/60",children:T.map(M=>jsxRuntime.jsx("button",{type:"button",onClick:()=>l(M.id),className:`px-4 py-2 text-xs font-medium transition-colors ${a===M.id?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-foreground"}`,children:s(M.labelKey)},M.id))}),jsxRuntime.jsxs("div",{className:"px-5 py-4 min-h-[280px]",children:[a==="summary"&&jsxRuntime.jsx("div",{className:"space-y-3",children:Cue.map(({key:M,labelKey:_,multiline:E})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-foreground mb-1",children:s(_)}),E?jsxRuntime.jsx("textarea",{className:"w-full rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none resize-none",rows:3,value:c[M]??"",onChange:R=>g(M,R.target.value)}):jsxRuntime.jsx("input",{type:"text",className:"w-full rounded-lg border border-border bg-muted px-3 py-2 text-sm text-foreground placeholder-muted-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:c[M]??"",onChange:R=>g(M,R.target.value)})]},M))}),a==="custom"&&jsxRuntime.jsx(yV,{customProperties:u,onUpdate:p}),a==="statistics"&&jsxRuntime.jsx(bV,{appProperties:{...r,company:h.company,manager:h.manager},onUpdateAppProperties:b,canEdit:true})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border/60",children:[jsxRuntime.jsx("button",{type:"button",onClick:S,className:"px-3 py-1.5 text-xs rounded-lg border border-border text-foreground hover:bg-muted transition-colors",children:s("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:v,disabled:!y,className:"px-3 py-1.5 text-xs rounded-lg bg-primary text-white hover:bg-primary/80 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:s("common.save")})]})]})})]})}function Qtt(t){if(typeof document>"u")return false;try{return document.fonts.check(`12px "${t}"`)}catch{return false}}function wV({isOpen:t,embedFontsEnabled:e,usedFontFamilies:n,embeddedFonts:r,onClose:o,onToggleEmbedFonts:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState(new Set),[c,d]=Jm.useState(false),[u,p]=Jm.useState(false),h=Jm.useCallback(async()=>{d(true);try{await document.fonts.ready;let x=new Set;for(let g of n)Qtt(g)&&x.add(g);l(x),p(!0);}catch{}finally{d(false);}},[n]);if(Jm.useEffect(()=>{t&&!u&&h();},[t,u,h]),!t)return null;let f=n.filter(x=>!a.has(x)),m=new Set(r);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":s("common.close"),onClick:o}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[460px] max-h-[80vh] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl flex flex-col max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60 shrink-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuType,{className:"w-5 h-5 text-primary"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("pptx.fonts.embedFonts")})]}),jsxRuntime.jsx("button",{type:"button",onClick:o,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":s("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsxs("div",{className:"px-5 py-4 space-y-4 overflow-y-auto flex-1",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:s("pptx.fonts.embedDescription")}),jsxRuntime.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"sr-only",checked:e,onChange:x=>i(x.target.checked)}),jsxRuntime.jsx("div",{className:`w-9 h-5 rounded-full transition-colors ${e?"bg-primary":"bg-muted-foreground"}`}),jsxRuntime.jsx("div",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${e?"translate-x-4":""}`})]}),jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:s("pptx.fonts.enableEmbedding")})]}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("h3",{className:"text-xs font-medium text-foreground",children:[s("pptx.fonts.usedFonts")," (",n.length,")"]}),c?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 py-4 justify-center",children:[jsxRuntime.jsx(lu$1.LuLoader,{className:"w-4 h-4 text-muted-foreground animate-spin"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:s("pptx.fonts.scanning")})]}):jsxRuntime.jsx("div",{className:"space-y-1 max-h-[280px] overflow-y-auto",children:n.map(x=>{let g=a.has(x),y=m.has(x);return jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-muted/60",children:[jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:x}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[y&&jsxRuntime.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-green-900/40 text-green-400 border border-green-700/40",children:s("pptx.fonts.embedded")}),g?jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3.5 h-3.5 text-green-400"}):jsxRuntime.jsx("span",{className:"text-[10px] text-yellow-400",children:s("pptx.fonts.notFound")})]})]},x)})})]}),f.length>0&&!c&&jsxRuntime.jsx("p",{className:"text-[11px] text-yellow-400/80",children:s("pptx.fonts.missingWarning",{count:f.length})})]}),jsxRuntime.jsx("div",{className:"flex items-center justify-end px-5 py-3 border-t border-border/60 shrink-0",children:jsxRuntime.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-xs rounded-lg bg-primary text-white hover:bg-primary/80 transition-colors",children:s("common.done")})})]})})]})}function CV({isOpen:t,onClose:e,hasSignatures:n,signatureCount:r}){let{t:o}=reactI18next.useTranslation();return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":o("common.close"),onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[420px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[n?jsxRuntime.jsx(lu$1.LuShieldCheck,{className:"w-5 h-5 text-green-400"}):jsxRuntime.jsx(lu$1.LuShieldAlert,{className:"w-5 h-5 text-amber-400"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:o("pptx.digitalSignatures.title")})]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":o("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"px-5 py-6 space-y-4",children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-green-900/20 border border-green-700/30 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuSignature,{className:"w-5 h-5 text-green-400 shrink-0 mt-0.5"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("p",{className:"text-xs text-green-200",children:o("pptx.digitalSignatures.signed")}),jsxRuntime.jsx("p",{className:"text-[11px] text-green-300/70",children:o("pptx.digitalSignatures.signatureCount",{count:r})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-amber-900/20 border border-amber-700/30 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuInfo,{className:"w-5 h-5 text-amber-400 shrink-0 mt-0.5"}),jsxRuntime.jsx("p",{className:"text-xs text-amber-200",children:o("pptx.digitalSignatures.editWarning")})]})]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-muted/30 border border-border/40 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuInfo,{className:"w-5 h-5 text-muted-foreground shrink-0 mt-0.5"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:o("pptx.digitalSignatures.noSignatures")})]})})}),jsxRuntime.jsx("div",{className:"flex items-center justify-end px-5 py-3 border-t border-border/60",children:jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-xs rounded-lg bg-accent text-foreground hover:bg-accent/80 transition-colors",children:o("common.close")})})]})})]}):null}function MV({hasSignatures:t,signatureCount:e,onClick:n}){let{t:r}=reactI18next.useTranslation();return !t||e===0?null:jsxRuntime.jsxs("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1 px-2 py-0.5 text-[11px] font-medium rounded-md bg-green-900/30 border border-green-700/40 text-green-300 hover:bg-green-900/50 transition-colors",title:r("pptx.digitalSignatures.signatureCount",{count:e}),children:[jsxRuntime.jsx(lu$1.LuShieldCheck,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:r("pptx.digitalSignatures.badge")})]})}function _V({isOpen:t,signatureCount:e,onConfirm:n,onCancel:r}){let{t:o}=reactI18next.useTranslation();return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":o("common.close"),onClick:r}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[440px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuTriangleAlert,{className:"w-5 h-5 text-amber-400"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:o("pptx.digitalSignatures.strippedTitle")})]}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":o("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"px-5 py-6",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-amber-900/20 border border-amber-700/30 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuTriangleAlert,{className:"w-5 h-5 text-amber-400 shrink-0 mt-0.5"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("p",{className:"text-xs text-amber-200",children:o("pptx.digitalSignatures.strippedMessage",{count:e})}),jsxRuntime.jsx("p",{className:"text-[11px] text-amber-300/70",children:o("pptx.digitalSignatures.editWarning")})]})]})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border/60",children:[jsxRuntime.jsx("button",{type:"button",onClick:r,className:"px-3 py-1.5 text-xs rounded-lg bg-accent text-foreground hover:bg-accent/80 transition-colors",children:o("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-xs rounded-lg bg-amber-600 text-white hover:bg-amber-500 transition-colors",children:o("pptx.digitalSignatures.strippedConfirm")})]})]})})]}):null}function PV({isOpen:t,onClose:e}){let{t:n}=reactI18next.useTranslation();return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":n("common.close"),onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto w-[420px] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuLock,{className:"w-5 h-5 text-red-400"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:n("pptx.encryptedFile.title")})]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":n("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"px-5 py-6 space-y-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-red-900/20 border border-red-700/30 px-4 py-3",children:[jsxRuntime.jsx(lu$1.LuInfo,{className:"w-5 h-5 text-red-400 shrink-0 mt-0.5"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("p",{className:"text-xs text-red-200",children:n("pptx.encryptedFile.message")}),jsxRuntime.jsx("p",{className:"text-[11px] text-red-300/70",children:n("pptx.encryptedFile.instructions")})]})]})}),jsxRuntime.jsx("div",{className:"flex items-center justify-end px-5 py-3 border-t border-border/60",children:jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-xs rounded-lg bg-accent text-foreground hover:bg-accent/80 transition-colors",children:n("common.close")})})]})})]}):null}Pe();Pe();function uN(t){return kU(t).map(e=>e.kind==="break"?Jm__default.default.createElement("br",{key:e.key}):Jm__default.default.createElement("span",{key:e.key,style:e.style},e.text))}bt();function Snt({slide:t,templateElements:e,canvasSize:n,className:r}){let o=Jm.useRef(null),[i,s]=Jm.useState(0);Jm.useEffect(()=>{let p=o.current;if(!p)return;let h=new ResizeObserver(f=>{let m=f[0];m&&s(m.contentRect.width);});return h.observe(p),()=>h.disconnect()},[]);let a=Math.max(n.width,1),l=Math.max(n.height,1),c=i>0?i/a:.2,d=Math.max(40,Math.round(l*c)),u=[...e,...t.elements].slice(0,80);return jsxRuntime.jsxs("div",{ref:o,className:`relative w-full overflow-hidden rounded border border-border bg-white ${r??""}`,style:{height:d},children:[t.backgroundColor&&t.backgroundColor!=="transparent"&&jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundColor:et(t.backgroundColor,"#ffffff")}}),t.backgroundImage&&jsxRuntime.jsx("img",{src:t.backgroundImage,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none",draggable:false}),t.backgroundGradient&&jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundImage:t.backgroundGradient}}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 origin-top-left",style:{width:a,height:l,transform:`scale(${c})`,transformOrigin:"top left"},children:u.map(p=>{let h=Math.max(p.width,1),f=Math.max(p.height,1),m=Jt(p)?p.shapeStyle:void 0,x=m?.fillColor!==void 0&&m?.fillColor!=="transparent"||!!(Oc(m)||m?.fillGradient)||m?.fillMode==="pattern"&&!!m.fillPatternPreset,g=et(m?.fillColor,Xy),y=Math.max(0,m?.strokeWidth||0),b=et(m?.strokeColor,iu),v=au(p,x,g,y,b),S=du(p,x,g,y,b),w=p.type==="shape"&&x?"#ffffff":Di,C=lh(p,w),T=uu(p),M=nu(p),_=ze(p)?p.text:void 0,E=ze(p)?p.textSegments:void 0,R=typeof _=="string"&&_.trim().length>0||(E?.length??0)>0,I=nb(p,M)?ii(p):"";return jsxRuntime.jsx("div",{className:"absolute overflow-hidden",style:{left:p.x,top:p.y,width:h,height:f,transform:$l(p),transformOrigin:"center"},children:(p.type==="picture"||p.type==="image")&&(p.svgData||p.imageData)?zc(p)?jsxRuntime.jsx("div",{className:"pointer-events-none w-full h-full",style:pu(p)}):jsxRuntime.jsx("img",{src:p.svgData||p.imageData,alt:"",className:"pointer-events-none",style:T,draggable:false}):jsxRuntime.jsxs("div",{className:"relative w-full h-full overflow-hidden",style:v,children:[S,M&&R&&jsxRuntime.jsx("div",{className:"w-full h-full whitespace-pre-wrap break-words px-1 py-0.5 leading-[1.3]",style:{...zl(p),...C,transform:tu(p),transformOrigin:"center"},children:Wa(p,w)}),!R&&I.length>0&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-[10px] text-muted-foreground",children:I})]})},p.id)})})]})}function wnt(t,e){return !(t.slide.id!==e.slide.id||t.slide.isDirty!==e.slide.isDirty||t.slide.hidden!==e.slide.hidden||t.slide.elements!==e.slide.elements||t.slide.backgroundColor!==e.slide.backgroundColor||t.slide.backgroundImage!==e.slide.backgroundImage||t.slide.backgroundGradient!==e.slide.backgroundGradient||t.templateElements!==e.templateElements||t.canvasSize.width!==e.canvasSize.width||t.canvasSize.height!==e.canvasSize.height||t.className!==e.className)}var Qb=Jm__default.default.memo(Snt,wnt);function AV({slides:t,currentSlideIndex:e,canvasSize:n,templateElements:r,presentationStartTime:o,onMovePresentationSlide:i,onExit:s,onOpenAudienceWindow:a,onCloseAudienceWindow:l,isAudienceWindowOpen:c}){let{t:d}=reactI18next.useTranslation(),[u,p]=Jm.useState(false);Jm.useEffect(()=>{let R=window.setTimeout(()=>p(true),300);return ()=>window.clearTimeout(R)},[]);let[h,f]=Jm.useState(Date.now());Jm.useEffect(()=>{let R=window.setInterval(()=>f(Date.now()),1e3);return ()=>window.clearInterval(R)},[]);let m=o?h-o:0,[x,g]=Jm.useState(AU),y=Jm.useCallback(()=>{g(R=>eR(R+QA));},[]),b=Jm.useCallback(()=>{g(R=>eR(R-QA));},[]),v=t[e],S=e+1<t.length?t[e+1]:void 0,w=v?.notes??"",C=v?.notesSegments,T=C&&C.length>0;if(!v)return jsxRuntime.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-card text-muted-foreground",children:d("pptx.presenter.noSlides")});let M=300*1e3,_=Math.min(100,m%M/M*100),E=Math.floor(m/M);return jsxRuntime.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col bg-card text-foreground",children:[jsxRuntime.jsxs("div",{className:"flex flex-1 min-h-0",children:[jsxRuntime.jsxs("div",{className:"flex-[7] flex flex-col items-center justify-center bg-black p-6 min-w-0",children:[jsxRuntime.jsx(Qb,{slide:v,templateElements:r,canvasSize:n}),jsxRuntime.jsx("div",{className:"mt-3 text-xs font-mono tabular-nums text-white/50 select-none",children:d("pptx.presenter.slideLabel",{current:e+1,total:t.length,defaultValue:`Slide ${e+1} of ${t.length}`})})]}),jsxRuntime.jsxs("div",{className:"flex-[3] flex flex-col bg-background border-l border-border min-w-[260px] max-w-[440px]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:d("pptx.presenter.currentTime")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums text-foreground",children:RU(new Date(h))})]}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:d("pptx.presenter.elapsed")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums text-primary",children:Vy(m)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[a&&u&&jsxRuntime.jsx("button",{type:"button",onClick:()=>{c?l?.():a();},className:"p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:d(c?"pptx.presenter.closeAudienceWindow":"pptx.presenter.openAudienceWindow"),"aria-label":d(c?"pptx.presenter.closeAudienceWindow":"pptx.presenter.openAudienceWindow"),children:c?jsxRuntime.jsx(lu$1.LuMonitorOff,{className:"w-5 h-5"}):jsxRuntime.jsx(lu$1.LuMonitor,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{type:"button",onClick:s,className:"p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:d("pptx.presenter.endPresentation"),"aria-label":d("pptx.presenter.endPresentation"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-5 h-5"})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border/60",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(-1),disabled:e===0,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded bg-muted hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-xs transition-colors",title:d("pptx.presenter.previousSlide"),children:[jsxRuntime.jsx(lu$1.LuChevronLeft,{className:"w-4 h-4"}),d("pptx.presenter.prev")]}),jsxRuntime.jsxs("span",{className:"text-sm font-mono tabular-nums text-foreground",children:[e+1," / ",t.length]}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(1),disabled:e>=t.length-1,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded bg-muted hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-xs transition-colors",title:d("pptx.presenter.nextSlide"),children:[d("pptx.presenter.next"),jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-4 h-4"})]})]}),jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b border-border/60",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-2",children:d("pptx.presenter.nextSlidePreview")}),S?jsxRuntime.jsx(Qb,{slide:S,templateElements:r,canvasSize:n}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-16 rounded border border-border/30 bg-muted/40 text-xs text-muted-foreground italic",children:d("pptx.presenter.endOfPresentation")})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-h-0 px-4 py-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:d("pptx.presenter.speakerNotes")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{type:"button",onClick:b,disabled:x<=ZA,className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:d("pptx.presenter.decreaseFontSize"),"aria-label":d("pptx.presenter.decreaseFontSize"),children:jsxRuntime.jsx(lu$1.LuMinus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsxs("span",{className:"text-[10px] font-mono tabular-nums text-muted-foreground min-w-[28px] text-center select-none",children:[x,"px"]}),jsxRuntime.jsx("button",{type:"button",onClick:y,disabled:x>=JA,className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:d("pptx.presenter.increaseFontSize"),"aria-label":d("pptx.presenter.increaseFontSize"),children:jsxRuntime.jsx(lu$1.LuPlus,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto rounded border border-border/30 bg-muted/40 px-3 py-2 text-foreground whitespace-pre-wrap leading-relaxed",style:{fontSize:`${x}px`},children:T?uN(C):w.trim().length>0?w:jsxRuntime.jsx("span",{className:"italic text-muted-foreground",children:d("pptx.presenter.noNotes")})})]})]})]}),jsxRuntime.jsx("div",{className:"h-1.5 w-full bg-muted/60 flex-shrink-0",role:"progressbar","aria-valuenow":Math.round(_),"aria-valuemin":0,"aria-valuemax":100,"aria-label":d("pptx.presenter.timerProgress"),title:`${Vy(m)} (segment ${E+1})`,children:jsxRuntime.jsx("div",{className:"h-full bg-primary transition-[width] duration-1000 ease-linear",style:{width:`${_}%`}})})]})}Pe();function RV({slides:t,currentSlideIndex:e,canvasSize:n,templateElements:r,presentationStartTime:o,onMovePresentationSlide:i,onExit:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState(Date.now());Jm.useEffect(()=>{let b=window.setInterval(()=>c(Date.now()),1e3);return ()=>window.clearInterval(b)},[]);let d=Nne(o,l),u=t[e],p=e+1<t.length?t[e+1]:void 0;if(!u)return jsxRuntime.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-card text-muted-foreground",children:a("pptx.presenter.noSlides")});let h=u.notes??"",f=u.notesSegments,m=f&&f.length>0,x=kne(e),g=Ine(e,t.length);return jsxRuntime.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col bg-card text-foreground",style:{paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)",paddingRight:"env(safe-area-inset-right, 0px)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 py-2 border-b border-border/60",children:[jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:a("pptx.presenter.elapsed")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums text-primary",children:Lne(d)})]}),jsxRuntime.jsx("span",{className:"text-sm font-mono tabular-nums text-foreground",children:Rne(e,t.length)}),jsxRuntime.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center w-11 h-11 min-w-11 min-h-11 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:a("pptx.presenter.endPresentation"),"aria-label":a("pptx.presenter.endPresentation"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"flex items-center justify-center bg-black px-3 py-3",children:jsxRuntime.jsx("div",{className:"w-full max-w-[640px]",children:jsxRuntime.jsx(Qb,{slide:u,templateElements:r,canvasSize:n})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border/60",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider whitespace-nowrap",children:a("pptx.presenter.nextSlidePreview")}),jsxRuntime.jsx("div",{className:"w-[132px] flex-shrink-0",children:p?jsxRuntime.jsx(Qb,{slide:p,templateElements:r,canvasSize:n}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-12 rounded border border-border/30 bg-muted/40 text-[10px] text-muted-foreground italic",children:a("pptx.presenter.endOfPresentation")})})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-h-0 px-4 py-2",children:[jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:a("pptx.presenter.speakerNotes")}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto rounded border border-border/30 bg-muted/40 px-3 py-2 text-foreground whitespace-pre-wrap leading-relaxed text-[15px]",children:m?uN(f):h.trim().length>0?h:jsxRuntime.jsx("span",{className:"italic text-muted-foreground",children:a("pptx.presenter.noNotes")})})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 border-t border-border/60",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(-1),disabled:x,className:"inline-flex items-center justify-center gap-1.5 flex-1 h-11 rounded bg-muted hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-sm transition-colors",title:a("pptx.presenter.previousSlide"),"aria-label":a("pptx.presenter.previousSlide"),children:[jsxRuntime.jsx(lu$1.LuChevronLeft,{className:"w-5 h-5"}),a("pptx.presenter.prev")]}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(1),disabled:g,className:"inline-flex items-center justify-center gap-1.5 flex-1 h-11 rounded bg-muted hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-sm transition-colors",title:a("pptx.presenter.nextSlide"),"aria-label":a("pptx.presenter.nextSlide"),children:[a("pptx.presenter.next"),jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-5 h-5"})]})]})]})}function Iue(t){let e=Math.max(0,Math.floor(t/1e3)),n=Math.floor(e/60),r=e%60;return `${String(n)}:${String(r).padStart(2,"0")}`}function IV({presentationStartTime:t,slideStartTime:e,paused:n,onTogglePause:r}){let{t:o}=reactI18next.useTranslation(),[i,s]=Jm.useState(0);Jm.useEffect(()=>{if(n)return;let d=window.setInterval(()=>s(u=>u+1),250);return ()=>window.clearInterval(d)},[n]);let a=Date.now(),l=e!==null?a-e:0,c=t!==null?a-t:0;return jsxRuntime.jsxs("div",{className:"fixed bottom-4 left-4 z-[9999] flex items-center gap-3 rounded-lg bg-black/80 px-4 py-2 text-white shadow-xl backdrop-blur-sm select-none",children:[jsxRuntime.jsxs("div",{className:"flex flex-col text-xs leading-tight",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.rehearse.slideTime")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums",children:Iue(l)})]}),jsxRuntime.jsx("div",{className:"w-px h-8 bg-border"}),jsxRuntime.jsxs("div",{className:"flex flex-col text-xs leading-tight",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.rehearse.totalTime")}),jsxRuntime.jsx("span",{className:"text-lg font-mono tabular-nums",children:Iue(c)})]}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"ml-1 rounded p-1.5 hover:bg-white/20 transition-colors",title:o(n?"pptx.rehearse.resume":"pptx.rehearse.pause"),"aria-label":o(n?"pptx.rehearse.resume":"pptx.rehearse.pause"),children:n?jsxRuntime.jsx(lu$1.LuPlay,{className:"w-4 h-4"}):jsxRuntime.jsx(lu$1.LuPause,{className:"w-4 h-4"})})]})}function Nue(t){let e=Math.max(0,Math.floor(t/1e3)),n=Math.floor(e/60),r=e%60;return `${String(n)}:${String(r).padStart(2,"0")}`}function NV({slides:t,canvasSize:e,recordedTimings:n,onSave:r,onDiscard:o}){let{t:i}=reactI18next.useTranslation(),s=Object.values(n).reduce((l,c)=>l+c,0),a=Object.entries(n).map(([l,c])=>({slideIndex:Number(l),ms:c})).sort((l,c)=>l.slideIndex-c.slideIndex);return jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",children:jsxRuntime.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-border bg-background shadow-2xl",children:[jsxRuntime.jsxs("div",{className:"border-b border-border px-5 py-4",children:[jsxRuntime.jsx("h2",{className:"text-base font-semibold text-foreground",children:i("pptx.rehearse.summaryTitle")}),jsxRuntime.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[i("pptx.rehearse.totalPresentationTime"),":"," ",jsxRuntime.jsx("span",{className:"font-mono text-foreground",children:Nue(s)})]})]}),jsxRuntime.jsx("div",{className:"max-h-72 overflow-y-auto px-5 py-3",children:jsxRuntime.jsxs("table",{className:"w-full text-xs",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:"text-muted-foreground uppercase tracking-wide",children:[jsxRuntime.jsx("th",{className:"pb-2 text-left",children:"#"}),jsxRuntime.jsx("th",{className:"pb-2 text-left",children:i("pptx.rehearse.slide")}),jsxRuntime.jsx("th",{className:"pb-2 text-right",children:i("pptx.rehearse.time")})]})}),jsxRuntime.jsx("tbody",{children:a.map(({slideIndex:l,ms:c})=>{let d=t[l];return jsxRuntime.jsxs("tr",{className:"border-t border-border",children:[jsxRuntime.jsx("td",{className:"py-2 text-muted-foreground tabular-nums",children:l+1}),jsxRuntime.jsx("td",{className:"py-2",children:d&&jsxRuntime.jsx("div",{className:"w-20 rounded overflow-hidden bg-white",children:jsxRuntime.jsx(oa,{slide:d,templateElements:[],canvasSize:e})})}),jsxRuntime.jsx("td",{className:"py-2 text-right font-mono text-foreground tabular-nums",children:Nue(c)})]},l)})})]})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border px-5 py-3",children:[jsxRuntime.jsx("button",{type:"button",onClick:o,className:"rounded-lg px-4 py-2 text-sm text-foreground hover:bg-muted transition-colors",children:i("pptx.rehearse.discard")}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"rounded-lg bg-primary px-4 py-2 text-sm text-white hover:bg-primary/80 transition-colors",children:i("pptx.rehearse.saveTimings")})]})]})})}bt();function Ynt(t,e){return ze(t)&&t.text&&t.text.trim().length>0?t.text.trim().slice(0,32):`${{text:"Text Box",shape:"Shape",connector:"Connector",image:"Image",picture:"Picture",chart:"Chart",table:"Table",smartArt:"SmartArt",media:"Media",group:"Group",ink:"Ink",ole:"Object",unknown:"Object"}[t.type]??"Object"} ${e+1}`}function DV({slides:t,activeSlideIndex:e,selectedElementId:n,selectedElementIds:r,canEdit:o,setSelectedElementId:i,setSelectedElementIds:s,setSlides:a,markDirty:l,onClose:c}){let{t:d}=reactI18next.useTranslation(),p=t[e]?.elements??[],[h,f]=Jm.useState(null),[m,x]=Jm.useState(""),g=Jm.useRef(null),[y,b]=Jm.useState(null),[v,S]=Jm.useState(null),w=Jm.useCallback(L=>{i(L),s([L]);},[i,s]),C=Jm.useCallback(L=>{a(k=>{let F=[...k],N=F[e];if(!N)return k;let D=[...N.elements??[]],U=D.findIndex(G=>G.id===L);return U===-1?k:(D[U]={...D[U],hidden:!D[U].hidden},F[e]={...N,elements:D},F)}),l();},[e,a,l]),T=Jm.useCallback((L,k)=>{o&&(f(L.id),x(k),setTimeout(()=>g.current?.select(),0));},[o]),M=Jm.useCallback(()=>{f(null);},[]),_=Jm.useCallback(L=>{b(L);},[]),E=Jm.useCallback((L,k)=>{L.preventDefault(),y!==null&&y!==k&&S(k);},[y]),R=Jm.useCallback(L=>{if(y===null||y===L){b(null),S(null);return}a(k=>{let F=[...k],N=F[e];if(!N)return k;let D=[...N.elements??[]],[U]=D.splice(y,1);return D.splice(L,0,U),F[e]={...N,elements:D},F}),l(),b(null),S(null);},[y,e,a,l]),I=[...p].reverse();return jsxRuntime.jsxs("div",{className:"flex flex-col h-full bg-popover border-l border-border w-56",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-foreground",children:d("pptx.selectionPane.title")}),jsxRuntime.jsx("button",{type:"button",onClick:c,className:"text-muted-foreground hover:text-foreground text-xs",title:d("pptx.selectionPane.close"),children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto py-1",children:I.length===0?jsxRuntime.jsx("div",{className:"px-3 py-4 text-xs text-muted-foreground italic",children:d("pptx.selectionPane.empty")}):I.map((L,k)=>{let F=p.length-1-k,N=n===L.id||r.includes(L.id),D=Ynt(L,F),U=h===L.id;return jsxRuntime.jsxs("div",{draggable:o,onDragStart:()=>_(F),onDragOver:G=>E(G,F),onDrop:()=>R(F),onDragEnd:()=>{b(null),S(null);},className:ie("flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer transition-colors",N?"bg-primary/30 text-primary":"hover:bg-muted text-foreground",v===F?"border-t-2 border-primary":""),onClick:()=>w(L.id),onDoubleClick:()=>T(L,D),children:[o&&jsxRuntime.jsx(lu$1.LuGripVertical,{className:"w-3 h-3 text-muted-foreground flex-shrink-0 cursor-grab"}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:U?jsxRuntime.jsx("input",{ref:g,type:"text",value:m,onChange:G=>x(G.target.value),onBlur:M,onKeyDown:G=>{G.key==="Enter"&&M(),G.key==="Escape"&&f(null);},className:"w-full bg-muted text-xs px-1 py-0.5 rounded border border-border outline-none",onClick:G=>G.stopPropagation()}):D}),jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex-shrink-0",title:L.hidden?d("pptx.selectionPane.show"):d("pptx.selectionPane.hide"),onClick:G=>{G.stopPropagation(),C(L.id);},children:L.hidden?jsxRuntime.jsx(lu$1.LuEyeOff,{className:"w-3.5 h-3.5"}):jsxRuntime.jsx(lu$1.LuEye,{className:"w-3.5 h-3.5 opacity-50"})})]},L.id)})})]})}var Bue="inline-flex items-center justify-center px-2.5 py-1.5 max-md:min-h-[44px] max-md:min-w-[44px] active:scale-95 active:opacity-80",fr=`${Bue} border-r border-border hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed`,Jo=`${Bue} hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed`,to="inline-flex items-center rounded bg-muted text-xs overflow-hidden",Be="inline-flex items-center gap-1.5 px-2.5 py-1.5 max-md:min-h-[44px] rounded bg-muted hover:bg-accent text-xs transition-colors active:scale-95 active:opacity-80",qt=jsxRuntime.jsx("div",{className:"w-px self-stretch bg-border/40 mx-1 max-md:hidden"}),Ne="w-4 h-4",Gn="w-3.5 h-3.5";var Uue=[{k:"left",el:jsxRuntime.jsx(lu$1.LuAlignLeft,{className:Ne})},{k:"center",el:jsxRuntime.jsx(lu$1.LuAlignCenter,{className:Ne})},{k:"right",el:jsxRuntime.jsx(lu$1.LuAlignRight,{className:Ne})},{k:"top",el:jsxRuntime.jsx(lu$1.LuChevronUp,{className:Ne})},{k:"middle",el:jsxRuntime.jsx(lu$1.LuAlignCenter,{className:`${Ne} rotate-90`})},{k:"bottom",el:jsxRuntime.jsx(lu$1.LuChevronDown,{className:Ne})}],$ue=[{k:"horizontal",el:jsxRuntime.jsx(lu$1.LuAlignHorizontalSpaceAround,{className:Ne})},{k:"vertical",el:jsxRuntime.jsx(lu$1.LuAlignVerticalSpaceAround,{className:Ne})}],Hue=[{id:"select",icon:jsxRuntime.jsx(lu$1.LuMoveRight,{className:Ne}),labelKey:"pptx.ribbon.tool.select",ac:"bg-primary text-white"},{id:"pen",icon:jsxRuntime.jsx(lu$1.LuPencil,{className:Ne}),labelKey:"pptx.ribbon.tool.pen",ac:"bg-primary text-white"},{id:"highlighter",icon:jsxRuntime.jsx(lu$1.LuType,{className:Ne}),labelKey:"pptx.ribbon.tool.highlighter",ac:"bg-yellow-600 text-white"},{id:"eraser",icon:jsxRuntime.jsx(lu$1.LuMinus,{className:Ne}),labelKey:"pptx.ribbon.tool.eraser",ac:"bg-red-600 text-white"},{id:"freeform",icon:jsxRuntime.jsx(lu$1.LuSpline,{className:Ne}),labelKey:"pptx.ribbon.tool.freeform",ac:"bg-primary text-white"}],zue=[{k:"png",labelKey:"pptx.ribbon.exportPng",i:jsxRuntime.jsx(lu$1.LuDownload,{className:`${Gn} text-muted-foreground`})},{k:"pdf",labelKey:"pptx.ribbon.exportPdf",i:jsxRuntime.jsx(lu$1.LuFileText,{className:`${Gn} text-muted-foreground`})},{k:"video",labelKey:"pptx.ribbon.exportVideo",i:jsxRuntime.jsx(lu$1.LuVideo,{className:`${Gn} text-muted-foreground`})},{k:"gif",labelKey:"pptx.ribbon.exportGif",i:jsxRuntime.jsx(lu$1.LuImage,{className:`${Gn} text-muted-foreground`})},{k:"package",labelKey:"pptx.file.packageTooltip",i:jsxRuntime.jsx(lu$1.LuFolderOpen,{className:`${Gn} text-muted-foreground`})},{k:"pptx",labelKey:"pptx.file.saveAsPptxTooltip",i:jsxRuntime.jsx(lu$1.LuDownload,{className:`${Gn} text-muted-foreground`})},{k:"ppsx",labelKey:"pptx.file.saveAsPpsxTooltip",i:jsxRuntime.jsx(lu$1.LuPlay,{className:`${Gn} text-muted-foreground`})},{k:"pptm",labelKey:"pptx.file.saveAsPptmTooltip",i:jsxRuntime.jsx(lu$1.LuDatabase,{className:`${Gn} text-muted-foreground`})},{k:"---0",labelKey:"",i:null},{k:"print",labelKey:"pptx.print.printButton",i:jsxRuntime.jsx(lu$1.LuPrinter,{className:`${Gn} text-muted-foreground`})},{k:"copyImg",labelKey:"pptx.file.copyImageTooltip",i:jsxRuntime.jsx(lu$1.LuCopy,{className:`${Gn} text-muted-foreground`})},{k:"---",labelKey:"",i:null},{k:"a11y",labelKey:"pptx.ribbon.accessibilityCheck",i:jsxRuntime.jsx(lu$1.LuCheck,{className:`${Gn} text-muted-foreground`})},{k:"shortcuts",labelKey:"pptx.settings.keyboardShortcuts",i:jsxRuntime.jsx(lu$1.LuSearch,{className:`${Gn} text-muted-foreground`})},{k:"---2",labelKey:"",i:null},{k:"versionHistory",labelKey:"pptx.ribbon.versionHistory",i:jsxRuntime.jsx(lu$1.LuClock,{className:`${Gn} text-muted-foreground`})},{k:"---3",labelKey:"",i:null},{k:"documentProperties",labelKey:"pptx.ribbon.documentProperties",i:jsxRuntime.jsx(lu$1.LuInfo,{className:`${Gn} text-muted-foreground`})},{k:"passwordProtection",labelKey:"pptx.security.protectPresentation",i:jsxRuntime.jsx(lu$1.LuLock,{className:`${Gn} text-muted-foreground`})},{k:"fontEmbedding",labelKey:"pptx.ribbon.embedFonts",i:jsxRuntime.jsx(lu$1.LuType,{className:`${Gn} text-muted-foreground`})},{k:"digitalSignatures",labelKey:"pptx.viewer.digitalSignatures",i:jsxRuntime.jsx(lu$1.LuShieldAlert,{className:`${Gn} text-muted-foreground`})}],Vue=[{id:"bold",i:jsxRuntime.jsx(lu$1.LuBold,{className:Ne}),labelKey:"pptx.textPanel.bold"},{id:"italic",i:jsxRuntime.jsx(lu$1.LuItalic,{className:Ne}),labelKey:"pptx.textPanel.italic"},{id:"underline",i:jsxRuntime.jsx(lu$1.LuUnderline,{className:Ne}),labelKey:"pptx.textPanel.underline"},{id:"strikethrough",i:jsxRuntime.jsx(lu$1.LuStrikethrough,{className:Ne}),labelKey:"pptx.textPanel.strikethrough"}],Gue=[{id:"left",i:jsxRuntime.jsx(lu$1.LuAlignLeft,{className:Ne}),labelKey:"pptx.ribbon.alignLeft"},{id:"center",i:jsxRuntime.jsx(lu$1.LuAlignCenter,{className:Ne}),labelKey:"pptx.ribbon.alignCenter"},{id:"right",i:jsxRuntime.jsx(lu$1.LuAlignRight,{className:Ne}),labelKey:"pptx.ribbon.alignRight"},{id:"justify",i:jsxRuntime.jsx(lu$1.LuAlignJustify,{className:Ne}),labelKey:"pptx.ribbon.justify"}];var Rrt=[{group:"Entrance",items:[{value:"appear",label:"Appear"},{value:"fadeIn",label:"Fade In"},{value:"flyIn",label:"Fly In"}]},{group:"Emphasis",items:[{value:"pulse",label:"Pulse"},{value:"spin",label:"Spin"}]},{group:"Exit",items:[{value:"disappear",label:"Disappear"},{value:"fadeOut",label:"Fade Out"}]}];function hN(t){let{t:e}=reactI18next.useTranslation(),[n,r]=Jm.useState(false),o=t.selectedElement!==null,i=!t.canEdit||!o;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>{i||(r(true),setTimeout(()=>r(false),1200));},disabled:i,className:ie(Be,n?"bg-primary hover:bg-primary/80 text-white":""),title:e("pptx.animations.previewTooltip"),children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Ne}),e("pptx.animations.preview")]}),qt,jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:i,className:Be,title:e("pptx.animations.addTooltip"),children:[jsxRuntime.jsx(lu$1.LuSparkles,{className:Ne}),e("pptx.animations.addAnimation"),jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:flex flex-col w-44 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:Rrt.map(a=>jsxRuntime.jsxs(Jm__default.default.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:e(`pptx.animations.group.${a.group.toLowerCase()}`)}),a.items.map(l=>jsxRuntime.jsx("button",{type:"button",disabled:i,onClick:()=>t.onAddAnimation?.(l.value,a.group.toLowerCase()),className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:e("pptx.animations.applyAnimation",{name:e(`pptx.animations.preset.${l.value}`)}),children:e(`pptx.animations.preset.${l.value}`)},l.value))]},a.group))})})]}),qt,jsxRuntime.jsxs("button",{type:"button",disabled:i,onClick:t.onRemoveAnimation,className:Be,title:e("pptx.animations.removeTooltip"),children:[jsxRuntime.jsx(lu$1.LuTrash2,{className:Ne}),e("pptx.animations.remove")]}),qt,jsxRuntime.jsxs("button",{type:"button",onClick:t.onOpenAnimationPanel??t.onToggleInspector,className:ie(Be,t.isInspectorPaneOpen?"bg-primary hover:bg-primary/80 text-white":""),title:e("pptx.animations.openPanelTooltip"),children:[jsxRuntime.jsx(lu$1.LuPanelRight,{className:Ne}),e("pptx.animations.animationPanel")]})]})}function fN(t){let{t:e}=reactI18next.useTranslation(),n=!!t.selectedElement,r=n&&t.canEdit;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:to,children:Uue.map((o,i,s)=>jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onAlignElements(o.k),disabled:!r,className:i<s.length-1?fr:Jo,title:e("pptx.arrange.align",{direction:o.k}),children:o.el},o.k))}),jsxRuntime.jsx("div",{className:to,children:$ue.map((o,i,s)=>jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onDistributeElements(o.k),disabled:!t.canEdit||!t.canDistribute,className:i<s.length-1?fr:Jo,title:e(`pptx.arrange.distribute${o.k.charAt(0).toUpperCase()}${o.k.slice(1)}`),children:o.el},o.k))}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{onClick:t.onCopy,disabled:!n,className:fr,title:e("pptx.arrange.copy"),children:jsxRuntime.jsx(lu$1.LuCopy,{className:Ne})}),jsxRuntime.jsx("button",{onClick:t.onCut,disabled:!r,className:fr,title:e("pptx.arrange.cut"),children:e("pptx.arrange.cut")}),jsxRuntime.jsx("button",{onClick:t.onPaste,disabled:!t.clipboardPayload||!t.canEdit,className:Jo,title:e("pptx.arrange.paste"),children:jsxRuntime.jsx(lu$1.LuClipboardPaste,{className:Ne})})]}),t.onToggleFormatPainter&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleFormatPainter,disabled:!t.canEdit||t.canActivateFormatPainter===false&&!t.formatPainterActive,"data-testid":"format-painter-toggle","data-active":t.formatPainterActive?"true":"false",className:ie(Be,t.formatPainterActive?"bg-amber-600 hover:bg-amber-500 text-amber-50":""),title:e("pptx.arrange.formatPainter"),children:[jsxRuntime.jsx(lu$1.LuPaintbrush,{className:Ne}),e("pptx.arrange.format")]}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onFlip("horizontal"),disabled:!r,className:fr,title:e("pptx.arrange.flipHorizontally"),children:e("pptx.arrange.flipH")}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onFlip("vertical"),disabled:!r,className:Jo,title:e("pptx.arrange.flipVertically"),children:e("pptx.arrange.flipV")})]}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{onClick:()=>t.onMoveLayer("backward"),disabled:!r,className:fr,title:e("pptx.arrange.sendBackward"),children:jsxRuntime.jsx(lu$1.LuChevronDown,{className:Ne})}),jsxRuntime.jsx("button",{onClick:()=>t.onMoveLayer("forward"),disabled:!r,className:fr,title:e("pptx.arrange.bringForward"),children:jsxRuntime.jsx(lu$1.LuChevronUp,{className:Ne})}),jsxRuntime.jsx("button",{onClick:()=>t.onMoveLayerToEdge("back"),disabled:!r,className:fr,title:e("pptx.arrange.sendToBack"),children:e("pptx.arrange.back")}),jsxRuntime.jsx("button",{onClick:()=>t.onMoveLayerToEdge("front"),disabled:!r,className:Jo,title:e("pptx.arrange.bringToFront"),children:e("pptx.arrange.front")})]}),jsxRuntime.jsxs("button",{onClick:t.onDuplicate,disabled:!r,className:Be,title:e("pptx.arrange.duplicate"),children:[jsxRuntime.jsx(lu$1.LuCopy,{className:Ne}),e("pptx.arrange.duplicate")]}),jsxRuntime.jsxs("button",{onClick:t.onDelete,disabled:!r,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded bg-red-700/80 hover:bg-red-600 disabled:opacity-40 disabled:cursor-not-allowed text-xs transition-colors",title:e("pptx.arrange.delete"),children:[jsxRuntime.jsx(lu$1.LuTrash2,{className:Ne}),e("pptx.arrange.delete")]})]})}function mN(t){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:t.onToggleThemeGallery,disabled:!t.canEdit,className:ie(Be,t.isThemeGalleryOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Browse and apply built-in themes",children:[jsxRuntime.jsx(lu$1.LuPalette,{className:Gn}),"Browse Themes"]}),jsxRuntime.jsxs("button",{onClick:t.onToggleThemeEditor,disabled:!t.canEdit,className:ie(Be,t.isThemeEditorOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Edit presentation theme colors and fonts",children:[jsxRuntime.jsx(lu$1.LuPencil,{className:Gn}),"Edit Theme"]}),qt,t.onOpenDocumentProperties&&jsxRuntime.jsxs("button",{onClick:t.onOpenDocumentProperties,className:Be,title:"Change slide dimensions (16:9, 4:3, custom)",children:[jsxRuntime.jsx(lu$1.LuMonitor,{className:Gn}),"Slide Size"]}),t.onToggleInspector&&jsxRuntime.jsxs("button",{onClick:t.onToggleInspector,className:ie(Be,t.isInspectorPaneOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Open inspector to edit slide background",children:[jsxRuntime.jsx(lu$1.LuPaintBucket,{className:Gn}),"Format Background"]})]})}var Krt=[{value:"none",label:"None"},{value:"fade",label:"Fade"},{value:"push",label:"Push"},{value:"wipe",label:"Wipe"},{value:"split",label:"Split"},{value:"reveal",label:"Reveal"},{value:"cut",label:"Cut"},{value:"cover",label:"Cover"},{value:"uncover",label:"Uncover"}];function gN(t){let[e,n]=Jm__default.default.useState("none"),[r,o]=Jm__default.default.useState("00.50");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",className:Be,title:"Preview transition",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Gn}),"Preview"]}),qt,jsxRuntime.jsx("div",{className:"inline-flex items-center gap-0.5 overflow-x-auto max-w-[420px]",children:Krt.map(i=>jsxRuntime.jsx("button",{type:"button",onClick:()=>n(i.value),className:ie("flex-shrink-0 px-2 py-1 max-md:min-h-[44px] rounded border text-[11px] leading-tight transition-colors",e===i.value?"border-primary bg-primary/10 text-primary font-medium":"border-border bg-muted hover:bg-accent text-foreground"),title:`${i.label} transition`,children:i.label},i.value))}),qt,jsxRuntime.jsxs("label",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:"Duration:"}),jsxRuntime.jsx("input",{type:"text",value:r,onChange:i=>o(i.target.value),className:"w-14 px-1.5 py-1 rounded border border-border bg-muted text-xs text-foreground text-center",title:"Transition duration in seconds"})]}),qt,jsxRuntime.jsxs("button",{type:"button",className:Be,title:"Apply transition to all slides",children:[jsxRuntime.jsx(lu$1.LuCopy,{className:Gn}),"Apply to All"]}),qt,jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleInspector,className:ie(Be,t.isInspectorPaneOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Open Inspector for full transition options",children:[jsxRuntime.jsx(lu$1.LuPanelRight,{className:Ne}),"Inspector"]})]})}function xN(t){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t.onToggleComments&&jsxRuntime.jsxs("button",{onClick:t.onToggleComments,className:ie(Be,t.isCommentsPanelOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Toggle comments panel",children:[jsxRuntime.jsx(lu$1.LuMessageSquare,{className:Ne}),"Comments",(t.slideCommentCount??0)>0&&jsxRuntime.jsx("span",{className:"inline-flex items-center justify-center min-w-[16px] h-4 rounded-full bg-amber-500 text-[10px] font-medium text-white px-1",children:t.slideCommentCount})]}),jsxRuntime.jsxs("button",{onClick:()=>t.onSetSpellCheckEnabled(!t.spellCheckEnabled),className:ie(Be,t.spellCheckEnabled?"bg-primary hover:bg-primary/80 text-white":""),title:"Toggle spell check",children:[jsxRuntime.jsx(lu$1.LuSpellCheck,{className:Ne}),"Spelling"]}),t.onCompare&&jsxRuntime.jsxs("button",{onClick:t.onCompare,disabled:!t.canEdit,className:Be,title:"Compare with another presentation",children:[jsxRuntime.jsx(lu$1.LuGitCompare,{className:Ne}),"Compare"]})]})}function bN(t){let{t:e}=reactI18next.useTranslation();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:to,children:Hue.map((n,r,o)=>jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onSetActiveTool(n.id),className:ie(r<o.length-1?fr:Jo,t.activeTool===n.id?n.ac??"bg-accent text-foreground":""),title:e(n.labelKey),children:n.icon},n.id))}),jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-2 text-xs",children:[jsxRuntime.jsxs("label",{className:"inline-flex items-center gap-1 text-muted-foreground",title:e("pptx.ribbon.penColour"),children:[e("pptx.ribbon.colour"),jsxRuntime.jsx("input",{type:"color",value:t.drawingColor,onChange:n=>t.onSetDrawingColor(n.target.value),className:"w-6 h-6 rounded border border-border bg-transparent cursor-pointer"})]}),jsxRuntime.jsxs("label",{className:"inline-flex items-center gap-1 text-muted-foreground",title:e("pptx.ribbon.strokeWidth"),children:[e("pptx.ribbon.width"),jsxRuntime.jsx("input",{type:"range",min:1,max:12,value:t.drawingWidth,onChange:n=>t.onSetDrawingWidth(Number(n.target.value)),className:"w-16 h-1 accent-primary"}),jsxRuntime.jsx("span",{className:"text-foreground w-4 text-right",children:t.drawingWidth})]})]})]})}function vN(t){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t.onOpenFile&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:t.onOpenFile,className:Be,title:"Open another presentation",children:[jsxRuntime.jsx(lu$1.LuFolderOpen,{className:Ne}),"Open"]}),qt]}),jsxRuntime.jsxs("button",{onClick:t.onSaveAsPptx,className:Be,title:"Save as Presentation (.pptx)",children:[jsxRuntime.jsx(lu$1.LuDownload,{className:Ne}),"Save .pptx"]}),jsxRuntime.jsxs("button",{onClick:t.onSaveAsPpsx,className:Be,title:"Save as Slide Show (.ppsx)",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Ne}),"Save .ppsx"]}),t.hasMacros&&jsxRuntime.jsxs("button",{onClick:t.onSaveAsPptm,className:Be,title:"Save as Macro-Enabled (.pptm)",children:[jsxRuntime.jsx(lu$1.LuFileText,{className:Ne}),"Save .pptm"]}),jsxRuntime.jsxs("button",{onClick:t.onPackageForSharing,className:Be,title:"Package for Sharing",children:[jsxRuntime.jsx(lu$1.LuPackage,{className:Ne}),"Package"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onExportPng,className:Be,title:"Export as PNG",children:[jsxRuntime.jsx(lu$1.LuDownload,{className:Ne}),"PNG"]}),jsxRuntime.jsxs("button",{onClick:t.onExportPdf,className:Be,title:"Export as PDF",children:[jsxRuntime.jsx(lu$1.LuFileText,{className:Ne}),"PDF"]}),jsxRuntime.jsxs("button",{onClick:t.onExportVideo,className:Be,title:"Export as Video",children:[jsxRuntime.jsx(lu$1.LuVideo,{className:Ne}),"Video"]}),jsxRuntime.jsxs("button",{onClick:t.onExportGif,className:Be,title:"Export as GIF",children:[jsxRuntime.jsx(lu$1.LuImage,{className:Ne}),"GIF"]}),jsxRuntime.jsxs("button",{onClick:t.onCopySlideAsImage,className:Be,title:"Copy Slide as Image",children:[jsxRuntime.jsx(lu$1.LuCopy,{className:Ne}),"Copy Image"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onPrint,className:Be,title:"Print",children:[jsxRuntime.jsx(lu$1.LuPrinter,{className:Ne}),"Print"]}),qt,t.onOpenDocumentProperties&&jsxRuntime.jsxs("button",{onClick:t.onOpenDocumentProperties,className:Be,title:"Document Properties",children:[jsxRuntime.jsx(lu$1.LuInfo,{className:Ne}),"Properties"]}),t.onOpenPasswordProtection&&jsxRuntime.jsxs("button",{onClick:t.onOpenPasswordProtection,className:Be,title:"Protect Presentation",children:[jsxRuntime.jsx(lu$1.LuLock,{className:Ne}),"Protect"]}),t.onOpenFontEmbedding&&jsxRuntime.jsxs("button",{onClick:t.onOpenFontEmbedding,className:Be,title:"Embed Fonts",children:[jsxRuntime.jsx(lu$1.LuType,{className:Ne}),"Fonts"]}),t.onOpenDigitalSignatures&&jsxRuntime.jsxs("button",{onClick:t.onOpenDigitalSignatures,className:Be,title:"Digital Signatures",children:[jsxRuntime.jsx(lu$1.LuShieldAlert,{className:Ne}),"Signatures"]})]})}bt();function Que(t){let[e,n]=Jm.useState(false),[r,o]=Jm.useState(false),i=Jm.useRef(null),s=Jm.useRef(null),a=Jm.useCallback(()=>{if(t.layoutOptions.length>0){let l=t.layoutOptions[0];t.onInsertSlideFromLayout(l.path,l.name);}},[t]);return Jm.useEffect(()=>{if(!e)return;let l=c=>{i.current&&!i.current.contains(c.target)&&n(false);};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e]),Jm.useEffect(()=>{if(!r)return;let l=c=>{s.current&&!s.current.contains(c.target)&&o(false);};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative inline-flex items-center",ref:i,children:[jsxRuntime.jsxs("button",{type:"button",onClick:a,disabled:!t.canEdit||t.layoutOptions.length===0,className:ie(Be,"whitespace-nowrap",t.layoutOptions.length>0?"rounded-r-none":""),title:"New Slide",children:[jsxRuntime.jsx(lu$1.LuPlus,{className:Ne}),"New Slide"]}),t.layoutOptions.length>0&&jsxRuntime.jsx("button",{type:"button",disabled:!t.canEdit,className:"inline-flex items-center justify-center self-stretch px-1 rounded-r bg-muted hover:bg-accent text-xs transition-colors border-l border-border/40 active:scale-95 active:opacity-80",title:"Choose layout",onClick:()=>n(l=>!l),children:jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-48 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:t.layoutOptions.map(l=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onInsertSlideFromLayout(l.path,l.name),n(false);},children:l.name},l.path))})})]}),jsxRuntime.jsxs("div",{className:"relative inline-flex items-center",ref:s,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit||t.layoutOptions.length===0,className:Be,title:"Layout",onClick:()=>o(l=>!l),children:[jsxRuntime.jsx(lu$1.LuLayoutGrid,{className:Ne}),"Layout"]}),r&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-48 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:t.layoutOptions.map(l=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onApplyLayout?.(l.path),o(false);},children:l.name},l.path))})})]}),jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit,className:Be,title:"Reset Slide",onClick:t.onResetSlide,children:[jsxRuntime.jsx(lu$1.LuRotateCcw,{className:Ne}),"Reset"]}),jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit,className:Be,title:"Add Section",onClick:t.onAddSection,children:[jsxRuntime.jsx(lu$1.LuFolderPlus,{className:Ne}),"Section"]})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Slides"})]}),qt]})}function vot(t){let e={fontFamily:"Segoe UI",fontSize:"24"};if(!t||!ze(t))return e;let n=t.textSegments?.[0]?.style,r=t.textStyle,o=n?.fontFamily??r?.fontFamily??e.fontFamily,i=n?.fontSize??r?.fontSize;return {fontFamily:o,fontSize:i!=null?String(i):e.fontSize}}var Sot=["Arial","Calibri","Cambria","Comic Sans MS","Courier New","Georgia","Helvetica","Impact","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana"],wot=[8,9,10,11,12,14,16,18,20,24,28,32,36,40,44,48,54,60,72,96];function wN(t){let[e,n]=Jm.useState(false),[r,o]=Jm.useState(false),[i,s]=Jm.useState(false),[a,l]=Jm.useState(false),c=Jm.useRef(null),d=Jm.useRef(null),{fontFamily:u,fontSize:p}=vot(t.selectedElement);return Jm.useEffect(()=>{if(!e)return;let h=f=>{c.current&&!c.current.contains(f.target)&&n(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[e]),Jm.useEffect(()=>{if(!r)return;let h=f=>{d.current&&!d.current.contains(f.target)&&o(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",onClick:t.onPaste,disabled:!t.clipboardPayload||!t.canEdit,className:fr,title:"Paste",children:jsxRuntime.jsx(lu$1.LuClipboardPaste,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{t.onCut(),l(true),setTimeout(()=>l(false),600);},disabled:!t.canEdit,className:ie(fr,a&&"bg-green-600/20 text-green-400"),title:"Cut",children:jsxRuntime.jsx(lu$1.LuScissors,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{t.onCopy(),s(true),setTimeout(()=>s(false),600);},className:ie(fr,i&&"bg-green-600/20 text-green-400"),title:"Copy",children:jsxRuntime.jsx(lu$1.LuCopy,{className:Ne})}),t.onToggleFormatPainter&&jsxRuntime.jsx("button",{type:"button",onClick:t.onToggleFormatPainter,disabled:!t.canEdit||t.canActivateFormatPainter===false&&!t.formatPainterActive,"data-testid":"format-painter-toggle","data-active":t.formatPainterActive?"true":"false",className:ie(Jo,t.formatPainterActive?"bg-amber-600 hover:bg-amber-500 text-amber-50":""),title:"Format Painter",children:jsxRuntime.jsx(lu$1.LuPaintbrush,{className:Ne})})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Clipboard"})]}),qt,jsxRuntime.jsx(Que,{canEdit:t.canEdit,layoutOptions:t.layoutOptions,onInsertSlideFromLayout:t.onInsertSlideFromLayout,onApplyLayout:t.onApplyLayout,onResetSlide:t.onResetSlide,onAddSection:t.onAddSection}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",ref:c,children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>n(h=>!h),className:"inline-flex items-center justify-between px-2 py-1 rounded-sm border border-border/60 bg-background/60 text-[11px] text-foreground min-w-[120px] truncate hover:bg-accent/40 transition-colors cursor-pointer",children:[jsxRuntime.jsx("span",{className:"truncate",children:u}),jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3 ml-1 shrink-0 text-muted-foreground"})]}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-48 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:Sot.map(h=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",style:{fontFamily:h},onClick:()=>{t.onUpdateTextStyle?.({fontFamily:h}),n(false);},children:h},h))})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:d,children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>o(h=>!h),className:"inline-flex items-center justify-between px-2 py-1 rounded-sm border border-border/60 bg-background/60 text-[11px] text-foreground min-w-[50px] text-center hover:bg-accent/40 transition-colors cursor-pointer",children:[jsxRuntime.jsx("span",{className:"truncate",children:p}),jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3 ml-1 shrink-0 text-muted-foreground"})]}),r&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-48 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:wot.map(h=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onUpdateTextStyle?.({fontSize:h}),o(false);},children:h},h))})})]})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Font"})]}),qt]})}Pe();function CN(t){let{t:e}=reactI18next.useTranslation(),{canEdit:n}=t,[r,o]=Jm.useState(false),[i,s]=Jm.useState(""),[a,l]=Jm.useState("locale"),[c,d]=Jm.useState(QU),u=Jm.useRef(null),p=Jm.useCallback(()=>{let f=new Date,m=x=>String(x).padStart(2,"0");s(`${f.getFullYear()}-${m(f.getMonth()+1)}-${m(f.getDate())}T${m(f.getHours())}:${m(f.getMinutes())}`),l("locale"),o(true);},[]),h=Jm.useCallback(()=>{if(!t.onInsertField)return;let f=new Date(i);if(isNaN(f.getTime()))return;let m;switch(a){case "iso":m=f.toISOString().slice(0,10);break;case "long":m=f.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"});break;case "short":m=f.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});break;case "time":m=f.toLocaleString();break;default:m=f.toLocaleDateString();break}t.onInsertField("datetime",m),o(false);},[i,a,t]);return Jm.useEffect(()=>{if(!r)return;let f=m=>{u.current&&!u.current.contains(m.target)&&o(false);};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:t.onAddTextBox,disabled:!n,className:Be,title:"Add text box",children:[jsxRuntime.jsx(lu$1.LuType,{className:Ne}),"Text"]}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("select",{value:t.newShapeType,onChange:f=>t.onSetNewShapeType(f.target.value),className:"bg-transparent py-1.5 pl-2 pr-1 outline-none text-xs",title:"Shape type",children:Bm.map(f=>jsxRuntime.jsx("option",{value:f.type,className:"bg-background",children:f.label},f.type))}),jsxRuntime.jsxs("button",{onClick:t.onAddShape,disabled:!n,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 border-l border-border hover:bg-accent transition-colors text-xs",title:"Add shape",children:[Bm.find(f=>f.type===t.newShapeType)?.icon||jsxRuntime.jsx(lu$1.LuSquare,{className:Ne}),"Shape"]})]}),jsxRuntime.jsxs("button",{onClick:t.onOpenImagePicker,disabled:!n,className:Be,title:"Insert image",children:[jsxRuntime.jsx(lu$1.LuImage,{className:Ne}),"Image"]}),jsxRuntime.jsxs("button",{onClick:t.onOpenMediaPicker,disabled:!n,className:Be,title:"Insert audio or video",children:[jsxRuntime.jsx(lu$1.LuVideo,{className:Ne}),"Media"]}),jsxRuntime.jsxs("button",{onClick:t.onAddTable,disabled:!n,className:Be,title:"Insert table",children:[jsxRuntime.jsx(lu$1.LuDatabase,{className:Ne}),"Table"]}),t.onAddChart&&jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("select",{value:c,onChange:f=>d(f.target.value),className:"bg-transparent py-1.5 pl-2 pr-1 outline-none text-xs",title:"Chart type",children:Qne.map(f=>jsxRuntime.jsx("option",{value:f.type,className:"bg-background",children:f.label},f.type))}),jsxRuntime.jsxs("button",{onClick:()=>t.onAddChart(c),disabled:!n,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 border-l border-border hover:bg-accent transition-colors text-xs",title:"Insert chart",children:[jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M3 3v18h18"}),jsxRuntime.jsx("rect",{x:"7",y:"11",width:"3",height:"6"}),jsxRuntime.jsx("rect",{x:"12",y:"7",width:"3",height:"10"}),jsxRuntime.jsx("rect",{x:"17",y:"13",width:"3",height:"4"})]}),"Chart"]})]}),jsxRuntime.jsxs("button",{onClick:t.onAddSmartArt,disabled:!n,className:Be,title:"Insert SmartArt",children:[jsxRuntime.jsx(lu$1.LuLayers,{className:Ne}),"SmartArt"]}),jsxRuntime.jsxs("button",{onClick:t.onAddEquation,disabled:!n,className:Be,title:"Insert Equation",children:[jsxRuntime.jsx("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M4 17h6M7 14v6M14 7l4.5 10M15.5 14h5"})}),"Equation"]}),jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:!n,className:Be,title:"Insert action button",children:[jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntime.jsx("path",{d:"M13 7l4 5-4 5"})]}),"Action",jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:flex flex-col w-40 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:sh.map(f=>jsxRuntime.jsxs("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>t.onAddActionButton(f.shapeType),children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:f.iconPath})}),f.label]},f.shapeType))})})]}),t.onInsertField&&jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:!n,className:Be,title:e("pptx.field.insertField"),children:[jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M4 7h16M4 12h10M4 17h12"}),jsxRuntime.jsx("circle",{cx:"19",cy:"15",r:"3"})]}),e("pptx.field.field"),jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:flex flex-col w-44 pt-1",children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:[jsxRuntime.jsx("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>t.onInsertField("slidenum"),children:e("pptx.field.slideNumber")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:p,children:e("pptx.field.dateTime")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>t.onInsertField("header"),children:e("pptx.field.header")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>t.onInsertField("footer"),children:e("pptx.field.footer")})]})})]}),r&&jsxRuntime.jsx("div",{ref:u,className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/30",onMouseDown:f=>{f.target===f.currentTarget&&o(false);},children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover shadow-2xl p-4 w-72 space-y-3",children:[jsxRuntime.jsx("div",{className:"text-sm font-medium text-foreground",children:e("pptx.field.dateTime")}),jsxRuntime.jsx("input",{type:"datetime-local",className:"w-full rounded border border-border bg-muted px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:i,onChange:f=>s(f.target.value)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-[11px] text-muted-foreground mb-1",children:e("pptx.field.format","Format")}),jsxRuntime.jsxs("select",{className:"w-full rounded border border-border bg-muted px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",value:a,onChange:f=>l(f.target.value),children:[jsxRuntime.jsx("option",{value:"locale",children:new Date(i||Date.now()).toLocaleDateString()}),jsxRuntime.jsx("option",{value:"long",children:new Date(i||Date.now()).toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),jsxRuntime.jsx("option",{value:"short",children:new Date(i||Date.now()).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}),jsxRuntime.jsx("option",{value:"iso",children:new Date(i||Date.now()).toISOString().slice(0,10)}),jsxRuntime.jsx("option",{value:"time",children:new Date(i||Date.now()).toLocaleString()})]})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[jsxRuntime.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded border border-border text-foreground hover:bg-muted transition-colors",onClick:()=>o(false),children:e("pptx.common.cancel","Cancel")}),jsxRuntime.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded bg-primary text-white hover:bg-primary/90 transition-colors",onClick:h,children:e("pptx.common.insert","Insert")})]})]})})]})}function MN(t){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>t.onSetMode("present"),className:Be,title:"Start slide show from beginning",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Ne}),"From Beginning"]}),jsxRuntime.jsxs("button",{onClick:t.onPresent,className:Be,title:"Start slide show from current slide",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:Ne}),"From Current Slide"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onEnterPresenterView,className:Be,title:"Presenter view",children:[jsxRuntime.jsx(lu$1.LuMonitor,{className:Ne}),"Presenter View"]}),jsxRuntime.jsxs("button",{onClick:t.onEnterRehearsalMode,className:Be,title:"Rehearse timings",children:[jsxRuntime.jsx(lu$1.LuClock,{className:Ne}),"Rehearse Timings"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onOpenSetUpSlideShow,className:Be,title:"Set up slide show",children:[jsxRuntime.jsx(lu$1.LuSettings,{className:Ne}),"Set Up Slide Show"]}),jsxRuntime.jsxs("button",{onClick:t.onOpenBroadcastDialog,className:Be,title:"Broadcast slide show",children:[jsxRuntime.jsx(lu$1.LuCast,{className:Ne}),"Broadcast"]}),qt,jsxRuntime.jsxs("button",{onClick:t.onToggleSubtitles,className:ie(Be,t.showSubtitles?"bg-primary hover:bg-primary/80 text-white":""),title:"Toggle subtitles",children:[jsxRuntime.jsx(lu$1.LuCaptions,{className:Ne}),"Subtitles"]})]})}bt();var zot=[{label:"1.0",value:1},{label:"1.15",value:1.15},{label:"1.5",value:1.5},{label:"2.0",value:2},{label:"2.5",value:2.5},{label:"3.0",value:3}],Vot=[{label:"Horizontal",value:"horizontal"},{label:"Rotate 90\xB0",value:"vertical"},{label:"Rotate 270\xB0",value:"vertical270"},{label:"Stacked",value:"wordArtVert"}],Got=[{label:"1 Column",value:1},{label:"2 Columns",value:2},{label:"3 Columns",value:3}];function $V(t,e,n){Jm.useEffect(()=>{if(!e)return;let r=o=>{t.current&&!t.current.contains(o.target)&&n(false);};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t,n]);}function spe(t){let[e,n]=Jm.useState(false),r=Jm.useRef(null);return $V(r,e,n),jsxRuntime.jsxs("div",{className:"relative",ref:r,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canMut,onMouseDown:o=>o.preventDefault(),onClick:()=>n(o=>!o),className:Be,title:"Line Spacing","aria-label":"Line Spacing",children:jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"5",y1:"5",x2:"19",y2:"5"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"19",y2:"19"}),jsxRuntime.jsx("path",{d:"M2 8 L2 3 M2 3 L3.5 4.5 M2 3 L0.5 4.5"}),jsxRuntime.jsx("path",{d:"M2 16 L2 21 M2 21 L3.5 19.5 M2 21 L0.5 19.5"})]})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-28",children:zot.map(o=>jsxRuntime.jsxs("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:i=>i.preventDefault(),onClick:()=>{t.canFormat&&(t.onUpdateTextStyle({lineSpacing:o.value}),n(false));},children:[o.label,t.effectiveTs?.lineSpacing===o.value&&jsxRuntime.jsx("span",{className:"ml-auto text-primary",children:"\u2022"})]},o.value))})})]})}function ape(t){let[e,n]=Jm.useState(false),r=Jm.useRef(null);return $V(r,e,n),jsxRuntime.jsxs("div",{className:"relative",ref:r,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canMut,onMouseDown:o=>o.preventDefault(),onClick:()=>n(o=>!o),className:Be,title:"Text Direction","aria-label":"Text Direction",children:jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("text",{x:"3",y:"16",fontSize:"12",fill:"currentColor",stroke:"none",children:"A"}),jsxRuntime.jsx("path",{d:"M18 6 C21 6 21 10 18 10"}),jsxRuntime.jsx("path",{d:"M18 10 L19.5 8.5 M18 10 L16.5 8.5"})]})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-36",children:Vot.map(o=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:i=>i.preventDefault(),onClick:()=>{t.canFormat&&(t.onUpdateTextStyle({textDirection:o.value}),n(false));},children:o.label},o.value))})})]})}function lpe(t){let[e,n]=Jm.useState(false),r=Jm.useRef(null);return $V(r,e,n),jsxRuntime.jsxs("div",{className:"relative",ref:r,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canMut,onMouseDown:o=>o.preventDefault(),onClick:()=>n(o=>!o),className:Be,title:"Columns",children:jsxRuntime.jsx(lu$1.LuColumns3,{className:Ne})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-28",children:Got.map(o=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:i=>i.preventDefault(),onClick:()=>{t.canFormat&&(t.onUpdateTextStyle({columnCount:o.value}),n(false));},children:o.label},o.value))})})]})}function eit(t,e){if(t){if(ze(t))return t.textStyle;if(t.type==="table"&&e&&t.tableData)return t.tableData.rows[e.rowIndex]?.cells[e.columnIndex]?.style}}var tit=["#000000","#ffffff","#ff0000","#00aa00","#0000ff","#ff8800","#8800cc","#00cccc","#ff69b4","#808080"],nit=["#ffff00","#00ff00","#00ffff","#ff00ff","#0000ff","#ff0000","#000080","#008080","#008000","#800080"];function _N(t){let{t:e}=reactI18next.useTranslation(),n=!!t.selectedElement,r=n&&t.canEdit,o=n&&t.selectedElement!==null&&ze(t.selectedElement),i=n&&t.selectedElement?.type==="table",s=o||i,a=eit(t.selectedElement,t.tableEditorState),l=o&&t.selectedElement&&ze(t.selectedElement)?t.selectedElement.textSegments?.[0]?.style?.color??t.selectedElement.textStyle?.color??"#000000":a?.color??"#000000",c=o&&t.selectedElement&&ze(t.selectedElement)?t.selectedElement.textSegments?.[0]?.style?.highlightColor??t.selectedElement.textStyle?.highlightColor??"#ffff00":"#ffff00",d=Jm.useRef(null),u=Jm.useRef(null),p=Jm.useCallback(f=>{s&&t.onUpdateTextStyle({color:f});},[s,t]),h=Jm.useCallback(f=>{s&&t.onUpdateTextStyle({highlightColor:f});},[s,t]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("div",{className:to,children:Vue.map((f,m,x)=>jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:y=>y.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let y=a;switch(f.id){case "bold":t.onUpdateTextStyle({bold:!y?.bold});break;case "italic":t.onUpdateTextStyle({italic:!y?.italic});break;case "underline":t.onUpdateTextStyle({underline:!y?.underline});break;case "strikethrough":t.onUpdateTextStyle({strikethrough:!y?.strikethrough});break}},className:m<x.length-1?fr:Jo,title:e(f.labelKey),children:f.i},f.id))}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s)return;let f=!!a?.textShadowColor;t.onUpdateTextStyle(f?{textShadowColor:void 0,textShadowBlur:void 0,textShadowOffsetX:void 0,textShadowOffsetY:void 0}:{textShadowColor:"#000000",textShadowBlur:2,textShadowOffsetX:1,textShadowOffsetY:1,textShadowOpacity:.5});},className:Be,title:"Text Shadow","aria-label":"Text Shadow",children:jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("text",{x:"6",y:"17",fontSize:"16",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"S"}),jsxRuntime.jsx("text",{x:"7.5",y:"18.5",fontSize:"16",fontWeight:"bold",fill:"none",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.4",children:"S"})]})}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let f=a?.fontSize??18;t.onUpdateTextStyle({fontSize:f+2});},className:fr,title:"Increase Font Size",children:jsxRuntime.jsx(lu$1.LuAArrowUp,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let f=a?.fontSize??18;t.onUpdateTextStyle({fontSize:Math.max(1,f-2)});},className:fr,title:"Decrease Font Size",children:jsxRuntime.jsx(lu$1.LuAArrowDown,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{s&&t.onUpdateTextStyle({bold:false,italic:false,underline:false,strikethrough:false,highlightColor:void 0});},className:Jo,title:"Clear Formatting",children:jsxRuntime.jsx(lu$1.LuRemoveFormatting,{className:Ne})})]}),jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),className:Be,title:"Character Spacing","aria-label":"Character Spacing",children:jsxRuntime.jsxs("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[jsxRuntime.jsx("text",{x:"4",y:"16",fontSize:"11",fontWeight:"bold",fill:"currentColor",stroke:"none",children:"AV"}),jsxRuntime.jsx("path",{d:"M3 20 L1 20 M3 20 L5 20",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M21 20 L19 20 M21 20 L23 20",strokeWidth:"1.5"})]})}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:block pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-32",children:[{label:"Very Tight",value:-150},{label:"Tight",value:-75},{label:"Normal",value:0},{label:"Loose",value:75},{label:"Very Loose",value:150}].map(f=>jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:m=>m.preventDefault(),onClick:()=>{s&&t.onUpdateTextStyle({characterSpacing:f.value});},children:f.label},f.label))})})]}),jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),className:Be,title:"Font Color","aria-label":"Font Color",children:[jsxRuntime.jsx("svg",{className:Ne,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M6 20h12M9.5 4h5L18 16H6L9.5 4z"})}),jsxRuntime.jsx("div",{className:"w-4 h-1 rounded-sm -mt-0.5",style:{backgroundColor:l}})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:block pt-1",children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl p-2 w-36",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1.5 mb-2",children:tit.map(f=>jsxRuntime.jsx("button",{type:"button","aria-label":f,className:`w-5 h-5 rounded-full border transition-transform hover:scale-125 ${l?.toLowerCase()===f?"border-primary ring-1 ring-primary":"border-border"}`,style:{backgroundColor:f},onMouseDown:m=>m.preventDefault(),onClick:()=>p(f)},f))}),jsxRuntime.jsx("button",{type:"button",className:"w-full text-[10px] text-muted-foreground hover:text-foreground py-1 transition-colors",onMouseDown:f=>f.preventDefault(),onClick:()=>d.current?.click(),children:"Custom colour..."}),jsxRuntime.jsx("input",{ref:d,type:"color",className:"sr-only",value:l,onChange:f=>p(f.target.value)})]})})]}),jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),className:Be,title:"Text Highlight Color","aria-label":"Text Highlight Color",children:[jsxRuntime.jsx(lu$1.LuHighlighter,{className:Ne}),jsxRuntime.jsx("div",{className:"w-4 h-1 rounded-sm -mt-0.5",style:{backgroundColor:c}})]}),jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 hidden group-hover:block pt-1",children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl p-2 w-36",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1.5 mb-2",children:nit.map(f=>jsxRuntime.jsx("button",{type:"button","aria-label":f,className:`w-5 h-5 rounded-full border transition-transform hover:scale-125 ${c?.toLowerCase()===f?"border-primary ring-1 ring-primary":"border-border"}`,style:{backgroundColor:f},onMouseDown:m=>m.preventDefault(),onClick:()=>h(f)},f))}),jsxRuntime.jsx("button",{type:"button",className:"w-full text-[10px] text-muted-foreground hover:text-foreground py-1 transition-colors",onMouseDown:f=>f.preventDefault(),onClick:()=>u.current?.click(),children:"Custom colour..."}),jsxRuntime.jsx("input",{ref:u,type:"color",className:"sr-only",value:c,onChange:f=>h(f.target.value)})]})})]})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Font"})]}),qt,jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{!s||!t.selectedElement||t.onUpdateTextStyle({listType:a?.listType==="bullet"?"none":"bullet"});},className:fr,title:"Bullet List",children:jsxRuntime.jsx(lu$1.LuList,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{!s||!t.selectedElement||t.onUpdateTextStyle({listType:a?.listType==="numbered"?"none":"numbered"});},className:Jo,title:"Numbered List",children:jsxRuntime.jsx(lu$1.LuListOrdered,{className:Ne})})]}),jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let f=a?.paragraphMarginLeft??0;t.onUpdateTextStyle({paragraphMarginLeft:Math.max(0,f-24)});},className:fr,title:"Decrease Indent",children:jsxRuntime.jsx(lu$1.LuIndentDecrease,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:f=>f.preventDefault(),onClick:()=>{if(!s||!t.selectedElement)return;let f=a?.paragraphMarginLeft??0;t.onUpdateTextStyle({paragraphMarginLeft:f+24});},className:Jo,title:"Increase Indent",children:jsxRuntime.jsx(lu$1.LuIndentIncrease,{className:Ne})})]}),jsxRuntime.jsx("div",{className:to,children:Gue.map((f,m,x)=>jsxRuntime.jsx("button",{type:"button",disabled:!r,onMouseDown:y=>y.preventDefault(),onClick:()=>{s&&t.onUpdateTextStyle({align:f.id});},className:m<x.length-1?fr:Jo,title:e(f.labelKey),children:f.i},f.id))}),jsxRuntime.jsx(spe,{canMut:r,canFormat:s,effectiveTs:a,onUpdateTextStyle:t.onUpdateTextStyle}),jsxRuntime.jsx(ape,{canMut:r,canFormat:s,onUpdateTextStyle:t.onUpdateTextStyle}),jsxRuntime.jsx(lpe,{canMut:r,canFormat:s,onUpdateTextStyle:t.onUpdateTextStyle})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Paragraph"})]})]})}function PN(t){let{t:e}=reactI18next.useTranslation();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:Be,title:"Normal view",children:"Normal"}),t.onToggleSlideSorter?jsxRuntime.jsx("button",{className:Be,onClick:t.onToggleSlideSorter,title:"Slide Sorter view",children:"Slide Sorter"}):jsxRuntime.jsx("button",{className:Be,title:"Slide Sorter view",children:"Slide Sorter"}),jsxRuntime.jsx("button",{className:Be,title:"Reading View",children:"Reading View"})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Presentation Views"})]}),qt,jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-0.5",children:jsxRuntime.jsx("button",{onClick:t.onEnterMasterView,disabled:!t.canEdit,className:Be,title:"Edit slide masters and layouts",children:"Slide Master"})}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Master Views"})]}),qt,jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-0.5",children:t.onZoomToFit&&jsxRuntime.jsx("button",{className:Be,onClick:t.onZoomToFit,title:"Zoom to fit slide in window",children:"Zoom to Fit"})}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Zoom"})]}),qt,jsxRuntime.jsx("button",{onClick:()=>t.onSetEditTemplateMode(!t.editTemplateMode),disabled:!t.canEdit,className:ie(Be,t.editTemplateMode?"bg-amber-600 hover:bg-amber-500 text-amber-50":""),title:"Toggle template/master element editing",children:t.editTemplateMode?"Templates On":"Templates Off"}),t.onToggleSelectionPane&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleSelectionPane,className:ie(Be,t.isSelectionPaneOpen?"bg-primary hover:bg-primary/80 text-white":""),title:"Selection Pane",children:[jsxRuntime.jsx(lu$1.LuList,{className:Ne}),"Selection"]}),t.onToggleEyedropper&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleEyedropper,disabled:!t.canEdit,className:ie(Be,t.eyedropperActive?"bg-purple-600 hover:bg-purple-500 text-purple-50":""),title:"Eyedropper \u2014 sample a colour from the slide",children:[jsxRuntime.jsx(lu$1.LuPipette,{className:Ne}),"Eyedropper"]}),jsxRuntime.jsx("button",{onClick:()=>t.onSetShowGrid(!t.showGrid),className:ie(Be,t.showGrid?"bg-primary text-white":""),title:e("pptx.grid.toggleGrid"),children:e("pptx.grid.grid")}),jsxRuntime.jsx("button",{onClick:()=>t.onSetShowRulers(!t.showRulers),className:ie(Be,t.showRulers?"bg-primary text-white":""),title:e("pptx.ruler.toggleRulers"),children:e("pptx.ruler.rulers")}),jsxRuntime.jsx("button",{onClick:()=>t.onSetSnapToGrid(!t.snapToGrid),className:ie(Be,t.snapToGrid?"bg-primary text-white":""),title:e("pptx.grid.snapToGrid"),children:e("pptx.grid.snapToGrid")}),jsxRuntime.jsx("button",{onClick:()=>t.onSetSnapToShape(!t.snapToShape),className:ie(Be,t.snapToShape?"bg-primary text-white":""),title:e("pptx.grid.snapToShape"),children:e("pptx.grid.snapToShape")}),jsxRuntime.jsx("button",{onClick:()=>t.onAddGuide("h"),className:Be,title:"Add horizontal guide",children:"H Guide"}),jsxRuntime.jsx("button",{onClick:()=>t.onAddGuide("v"),className:Be,title:"Add vertical guide",children:"V Guide"}),jsxRuntime.jsx("button",{onClick:()=>t.onSetSpellCheckEnabled(!t.spellCheckEnabled),className:ie(Be,t.spellCheckEnabled?"bg-primary text-white":""),title:"Toggle spell check",children:"Spell"})]})}function AN({open:t,onClose:e,title:n,children:r,heightFraction:o=.6,fullScreen:i=false,autoHeight:s=false,className:a,headerRight:l}){let c=Jm.useRef(null),{dragY:d,dragging:u,handlers:p}=Lu(e);if(Jm.useEffect(()=>{if(!t)return;let f=m=>{m.key==="Escape"&&e();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[t,e]),!t)return null;let h=s?{maxHeight:"calc(85dvh - env(safe-area-inset-top))"}:i?{height:"calc(100dvh - env(safe-area-inset-top))"}:{height:`${Math.round(o*100)}dvh`};return jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col justify-end",role:"dialog","aria-modal":"true",children:[jsxRuntime.jsx("button",{type:"button","aria-label":"Close",className:"absolute inset-0 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150",onClick:e}),jsxRuntime.jsxs("div",{ref:c,className:ie("relative bg-background border-t border-border rounded-t-2xl shadow-2xl flex flex-col overflow-hidden","animate-in slide-in-from-bottom duration-200",a),style:{...h,transform:d>0?`translateY(${d}px)`:void 0,transition:u?"none":"transform 150ms ease-out"},children:[jsxRuntime.jsxs("div",{className:"cursor-grab active:cursor-grabbing touch-none",onPointerDown:p.onPointerDown,onPointerMove:p.onPointerMove,onPointerUp:p.onPointerUp,onPointerCancel:p.onPointerCancel,children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center pt-2 pb-1",children:jsxRuntime.jsx("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/40"})}),(n||l)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 pb-2 border-b border-border/60",children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold text-foreground truncate",children:n}),l]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:r})]})]})}var Cit=[{key:"home",label:"Home",icon:lu$1.LuClipboardCopy},{key:"insert",label:"Insert",icon:lu$1.LuPlus},{key:"text",label:"Text",icon:lu$1.LuType},{key:"draw",label:"Draw",icon:lu$1.LuPaintbrush},{key:"arrange",label:"Arrange",icon:lu$1.LuShapes},{key:"design",label:"Design",icon:lu$1.LuLayoutGrid},{key:"transitions",label:"Transitions",icon:lu$1.LuSparkles},{key:"animations",label:"Animations",icon:lu$1.LuWand},{key:"slideShow",label:"Slide Show",icon:lu$1.LuPresentation},{key:"review",label:"Review",icon:lu$1.LuTextCursorInput},{key:"view",label:"View",icon:lu$1.LuSettings},{key:"file",label:"File",icon:lu$1.LuFile}];function upe(t){let{open:e,onClose:n}=t,[r,o]=Jm.useState("home");return jsxRuntime.jsx(AN,{open:e,onClose:n,autoHeight:true,title:"Menu",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("div",{className:"sticky top-0 z-10 bg-background border-b border-border",children:jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-2",children:Cit.map(({key:i,label:s,icon:a})=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>o(r===i?null:i),className:ie("inline-flex items-center gap-1.5 shrink-0 px-3 py-2 rounded-full text-[12px] font-medium border transition-colors min-h-[36px]",r===i?"bg-primary text-white border-primary":"border-border text-muted-foreground hover:text-foreground hover:bg-accent/40"),children:[jsxRuntime.jsx(a,{className:"w-4 h-4"}),s]},i))})}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsx(Mit,{active:r,...t})})]})})}function Mit({active:t,...e}){let n="flex flex-wrap items-center gap-2";switch(t){case "home":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(wN,{canEdit:e.canEdit,clipboardPayload:e.clipboardPayload,formatPainterActive:e.formatPainterActive,canActivateFormatPainter:e.canActivateFormatPainter,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onToggleFormatPainter:e.onToggleFormatPainter,layoutOptions:e.layoutOptions,onInsertSlideFromLayout:e.onInsertSlideFromLayout,selectedElement:e.selectedElement,onUpdateTextStyle:e.onUpdateTextStyle})});case "insert":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(CN,{canEdit:e.canEdit,newShapeType:e.newShapeType,onSetNewShapeType:e.onSetNewShapeType,onAddTextBox:e.onAddTextBox,onAddShape:e.onAddShape,onAddTable:e.onAddTable,onAddChart:e.onAddChart,onAddSmartArt:e.onAddSmartArt,onAddEquation:e.onAddEquation,onAddActionButton:e.onAddActionButton,onInsertField:e.onInsertField,onOpenImagePicker:e.onOpenImagePicker,onOpenMediaPicker:e.onOpenMediaPicker})});case "text":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(_N,{canEdit:e.canEdit,selectedElement:e.selectedElement,tableEditorState:e.tableEditorState,onUpdateTextStyle:e.onUpdateTextStyle})});case "draw":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(bN,{activeTool:e.activeTool,drawingColor:e.drawingColor,drawingWidth:e.drawingWidth,onSetActiveTool:e.onSetActiveTool,onSetDrawingColor:e.onSetDrawingColor,onSetDrawingWidth:e.onSetDrawingWidth})});case "arrange":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(fN,{canEdit:e.canEdit,selectedElement:e.selectedElement,clipboardPayload:e.clipboardPayload,onAlignElements:e.onAlignElements,onDistributeElements:e.onDistributeElements,canDistribute:e.canDistribute,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onFlip:e.onFlip,onMoveLayer:e.onMoveLayer,onMoveLayerToEdge:e.onMoveLayerToEdge,onDuplicate:e.onDuplicate,onDelete:e.onDelete,formatPainterActive:e.formatPainterActive,onToggleFormatPainter:e.onToggleFormatPainter,canActivateFormatPainter:e.canActivateFormatPainter})});case "design":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(mN,{canEdit:e.canEdit,onToggleThemeGallery:e.onToggleThemeGallery,isThemeGalleryOpen:e.isThemeGalleryOpen,onToggleThemeEditor:e.onToggleThemeEditor,isThemeEditorOpen:e.isThemeEditorOpen,onOpenDocumentProperties:e.onOpenDocumentProperties,onToggleInspector:e.onToggleInspector,isInspectorPaneOpen:e.isInspectorPaneOpen})});case "transitions":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(gN,{isInspectorPaneOpen:e.isInspectorPaneOpen,onToggleInspector:e.onToggleInspector})});case "animations":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(hN,{canEdit:e.canEdit,selectedElement:e.selectedElement,isInspectorPaneOpen:e.isInspectorPaneOpen,onToggleInspector:e.onToggleInspector,onOpenAnimationPanel:e.onOpenAnimationPanel,onAddAnimation:e.onAddAnimation,onRemoveAnimation:e.onRemoveAnimation})});case "slideShow":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(MN,{onPresent:()=>e.onSetMode("present"),onEnterPresenterView:e.onEnterPresenterView??(()=>{}),onEnterRehearsalMode:e.onEnterRehearsalMode??(()=>{}),onOpenSetUpSlideShow:e.onOpenSetUpSlideShow??(()=>{}),onOpenBroadcastDialog:e.onOpenBroadcastDialog??(()=>{}),onToggleSubtitles:e.onToggleSubtitles??(()=>{}),showSubtitles:e.showSubtitles??false,onSetMode:e.onSetMode})});case "review":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(xN,{canEdit:e.canEdit,spellCheckEnabled:e.spellCheckEnabled,onSetSpellCheckEnabled:e.onSetSpellCheckEnabled,onToggleComments:e.onToggleComments,isCommentsPanelOpen:e.isCommentsPanelOpen,slideCommentCount:e.slideCommentCount,onCompare:e.onCompare})});case "view":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(PN,{canEdit:e.canEdit,editTemplateMode:e.editTemplateMode,onSetEditTemplateMode:e.onSetEditTemplateMode,spellCheckEnabled:e.spellCheckEnabled,onSetSpellCheckEnabled:e.onSetSpellCheckEnabled,showGrid:e.showGrid,showRulers:e.showRulers,snapToGrid:e.snapToGrid,snapToShape:e.snapToShape,onSetShowGrid:e.onSetShowGrid,onSetShowRulers:e.onSetShowRulers,onSetSnapToGrid:e.onSetSnapToGrid,onSetSnapToShape:e.onSetSnapToShape,onAddGuide:e.onAddGuide,onEnterMasterView:e.onEnterMasterView,isSelectionPaneOpen:e.isSelectionPaneOpen,onToggleSelectionPane:e.onToggleSelectionPane,eyedropperActive:e.eyedropperActive,onToggleEyedropper:e.onToggleEyedropper})});case "file":return jsxRuntime.jsx("div",{className:n,children:jsxRuntime.jsx(vN,{onOpenFile:e.onOpenFile,onExportPng:e.onExportPng,onExportPdf:e.onExportPdf,onExportVideo:e.onExportVideo,onExportGif:e.onExportGif,onPackageForSharing:e.onPackageForSharing,onSaveAsPptx:e.onSaveAsPptx,onSaveAsPpsx:e.onSaveAsPpsx,onSaveAsPptm:e.onSaveAsPptm,hasMacros:e.hasMacros,onCopySlideAsImage:e.onCopySlideAsImage,onPrint:e.onPrint,onOpenDocumentProperties:e.onOpenDocumentProperties,onOpenPasswordProtection:e.onOpenPasswordProtection,onOpenFontEmbedding:e.onOpenFontEmbedding,onOpenDigitalSignatures:e.onOpenDigitalSignatures})});default:return jsxRuntime.jsxs("div",{className:"text-center text-sm text-muted-foreground py-8",children:[jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-5 h-5 inline-block opacity-50"})," Select a section above"]})}}function hpe(t){let{t:e}=reactI18next.useTranslation(),{mode:n,canUndo:r,canRedo:o,onUndo:i,onRedo:s,onSetMode:a,onSaveAsPptx:l}=t,[c,d]=Jm.useState(false),u=n==="edit"||n==="master",p="inline-flex items-center justify-center min-w-[44px] min-h-[44px] rounded-md text-foreground/80 hover:bg-accent/60 disabled:opacity-40 disabled:cursor-not-allowed active:scale-95 transition-transform";return jsxRuntime.jsxs("div",{role:"toolbar","aria-label":"Toolbar",className:"relative z-20 flex items-center gap-1 px-2 py-1 border-b border-border bg-secondary/50 min-h-[52px] pt-[max(env(safe-area-inset-top),0px)]",children:[u&&jsxRuntime.jsx("button",{type:"button",onClick:()=>d(true),className:p,title:"Menu","aria-label":"Menu",children:jsxRuntime.jsx(lu$1.LuMenu,{className:"w-5 h-5"})}),u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:i,disabled:!r,className:p,title:e("pptx.toolbar.undo"),"aria-label":e("pptx.toolbar.undo"),children:jsxRuntime.jsx(lu$1.LuUndo,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{type:"button",onClick:s,disabled:!o,className:p,title:e("pptx.toolbar.redo"),"aria-label":e("pptx.toolbar.redo"),children:jsxRuntime.jsx(lu$1.LuRedo,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{type:"button",onClick:l,className:p,title:e("pptx.toolbar.save","Save"),"aria-label":e("pptx.toolbar.save","Save"),children:jsxRuntime.jsx(lu$1.LuDownload,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>a("present"),className:ie(p,"text-primary"),title:e("pptx.toolbar.present"),"aria-label":e("pptx.toolbar.present"),children:jsxRuntime.jsx(lu$1.LuPresentation,{className:"w-5 h-5"})}),u&&jsxRuntime.jsx("button",{type:"button",onClick:t.onOpenShareDialog??t.onPackageForSharing,className:ie(p,"bg-primary text-white hover:bg-primary/90 px-3"),title:e("pptx.toolbar.share"),"aria-label":e("pptx.toolbar.share"),children:jsxRuntime.jsx(lu$1.LuShare2,{className:"w-4 h-4"})}),jsxRuntime.jsx(upe,{open:c,onClose:()=>d(false),...t})]})}var fpe=["#ffffff","#000000","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff","#008888","#888888"],$it=Bm.slice(0,12);function mpe(t){let[e,n]=Jm.useState(false),[r,o]=Jm.useState(false),[i,s]=Jm.useState(false),[a,l]=Jm.useState(false),c=Jm.useRef(null),d=Jm.useRef(null),u=Jm.useRef(null),p=Jm.useRef(null);return Jm.useEffect(()=>{if(!e)return;let h=f=>{c.current&&!c.current.contains(f.target)&&n(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[e]),Jm.useEffect(()=>{if(!r)return;let h=f=>{d.current&&!d.current.contains(f.target)&&o(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]),Jm.useEffect(()=>{if(!i)return;let h=f=>{u.current&&!u.current.contains(f.target)&&s(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[i]),Jm.useEffect(()=>{if(!a)return;let h=f=>{p.current&&!p.current.contains(f.target)&&l(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[a]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",ref:c,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit,className:Be,title:"Shapes",onClick:()=>n(h=>!h),children:[jsxRuntime.jsx(lu$1.LuShapes,{className:Ne}),"Shapes"]}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-52 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 max-h-60 overflow-y-auto",children:$it.map(h=>jsxRuntime.jsxs("button",{type:"button",className:ie("flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",t.newShapeType===h.type&&"bg-accent"),onClick:()=>{t.onSetNewShapeType(h.type),t.onAddShape(),n(false);},children:[h.icon,h.label]},h.type))})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:d,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!t.canEdit||!t.selectedElement,className:Be,title:"Arrange",onClick:()=>o(h=>!h),children:[jsxRuntime.jsx(lu$1.LuLayers,{className:Ne}),"Arrange"]}),r&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 flex flex-col w-44 pt-1",children:jsxRuntime.jsxs("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:[jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onMoveLayer("forward"),o(false);},children:"Bring Forward"}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onMoveLayer("backward"),o(false);},children:"Send Backward"}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onMoveLayerToEdge("front"),o(false);},children:"Bring to Front"}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",onClick:()=>{t.onMoveLayerToEdge("back"),o(false);},children:"Send to Back"})]})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:u,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canEdit||!t.selectedElement,className:Be,title:"Shape Fill",onClick:()=>s(h=>!h),children:jsxRuntime.jsx(lu$1.LuPaintBucket,{className:Ne})}),i&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl p-2 grid grid-cols-6 gap-1",children:fpe.map(h=>jsxRuntime.jsx("button",{type:"button","aria-label":`Fill colour ${h}`,className:"w-5 h-5 rounded border border-border/60 hover:scale-110 transition-transform",style:{backgroundColor:h},title:h,onClick:()=>{t.onUpdateElementStyle?.({fill:h}),s(false);}},h))})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:p,children:[jsxRuntime.jsx("button",{type:"button",disabled:!t.canEdit||!t.selectedElement,className:Be,title:"Shape Outline",onClick:()=>l(h=>!h),children:jsxRuntime.jsx(lu$1.LuPenLine,{className:Ne})}),a&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl p-2 grid grid-cols-6 gap-1",children:fpe.map(h=>jsxRuntime.jsx("button",{type:"button","aria-label":`Outline colour ${h}`,className:"w-5 h-5 rounded border border-border/60 hover:scale-110 transition-transform",style:{backgroundColor:h},title:h,onClick:()=>{t.onUpdateElementStyle?.({outlineColor:h}),l(false);}},h))})})]}),jsxRuntime.jsx("button",{type:"button",disabled:true,className:ie(Be,"opacity-50 cursor-not-allowed"),title:"Shape Effects (not available)",children:jsxRuntime.jsx(lu$1.LuSparkles,{className:Ne})})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Drawing"})]}),qt]})}function gpe(t){let[e,n]=Jm.useState(false),r=Jm.useRef(null);return Jm.useEffect(()=>{if(!e)return;let o=i=>{r.current&&!r.current.contains(i.target)&&n(false);};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[e]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[qt,jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:to,children:[jsxRuntime.jsx("button",{type:"button",onMouseDown:o=>o.preventDefault(),onClick:t.onToggleFindReplace,className:fr,title:"Find",children:jsxRuntime.jsx(lu$1.LuSearch,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",onMouseDown:o=>o.preventDefault(),onClick:t.onToggleFindReplace,className:Jo,title:"Replace",children:jsxRuntime.jsx(lu$1.LuReplace,{className:Ne})})]}),jsxRuntime.jsxs("div",{className:"relative",ref:r,children:[jsxRuntime.jsx("button",{type:"button",onMouseDown:o=>o.preventDefault(),onClick:()=>n(o=>!o),className:Be,title:"Select",children:jsxRuntime.jsx(lu$1.LuMousePointer2,{className:Ne})}),e&&jsxRuntime.jsx("div",{className:"absolute left-0 top-full z-50 pt-1",children:jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1 w-32",children:jsxRuntime.jsx("button",{type:"button",className:"flex items-center w-full px-3 py-1.5 text-xs hover:bg-muted transition-colors",onMouseDown:o=>o.preventDefault(),onClick:()=>{t.onSelectAll?.(),n(false);},children:"Select All"})})})]})]}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground leading-none",children:"Editing"})]})]})}Pe();function xpe(t){let{t:e}=reactI18next.useTranslation(),n=No(),r=n&&n.status==="connected";return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 pr-1",children:[t.onEnterRehearsalMode&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onEnterRehearsalMode,className:e$.record,title:e("pptx.titleBar.record"),"aria-label":e("pptx.titleBar.record"),children:[jsxRuntime.jsx("span",{className:e$.recordDot,"aria-hidden":"true"}),jsxRuntime.jsx("span",{children:e("pptx.titleBar.record")})]}),jsxRuntime.jsxs("button",{type:"button",onClick:t.onOpenShareDialog??t.onPackageForSharing,className:ie("relative inline-flex items-center gap-1 px-2.5 py-1 rounded-sm text-[11px] font-medium transition-colors whitespace-nowrap",r?"bg-green-600 hover:bg-green-500 text-white":"bg-primary hover:bg-primary/90 text-white"),title:r?e("pptx.toolbar.sharingUsers",{count:n.connectedCount}):e("pptx.toolbar.share"),"aria-label":e("pptx.toolbar.share"),children:[jsxRuntime.jsx(lu$1.LuShare2,{className:"w-3 h-3"}),jsxRuntime.jsx("span",{children:r?e("pptx.toolbar.sharingCount",{count:n.connectedCount}):e("pptx.toolbar.share")})]})]})}function ype({customShows:t,activeCustomShowId:e,canEdit:n,isCurrentSlideInActiveShow:r,onSetActiveCustomShowId:o,onCreateCustomShow:i,onRenameActiveCustomShow:s,onDeleteActiveCustomShow:a,onToggleCurrentSlideInActiveShow:l}){return t.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[qt,jsxRuntime.jsxs("select",{value:e??"",onChange:c=>o(c.target.value||null),className:"h-6 px-1.5 text-[11px] rounded bg-muted text-foreground border border-border hover:bg-accent transition-colors cursor-pointer",title:"Custom show","aria-label":"Select custom show",children:[jsxRuntime.jsx("option",{value:"",children:"All Slides"}),t.map(c=>jsxRuntime.jsx("option",{value:c.id,children:c.name},c.id))]}),n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:i,className:"px-2 py-1 rounded bg-muted hover:bg-accent text-[11px] transition-colors",title:"Create custom show",children:"+ Show"}),e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:s,className:"px-2 py-1 rounded bg-muted hover:bg-accent text-[11px] transition-colors",title:"Rename active custom show",children:"Rename"}),jsxRuntime.jsx("button",{type:"button",onClick:a,className:"px-2 py-1 rounded bg-red-700/80 hover:bg-red-600 text-[11px] transition-colors",title:"Delete active custom show",children:"Delete"}),jsxRuntime.jsx("button",{type:"button",onClick:l,className:ie("px-2 py-1 rounded text-[11px] transition-colors",r?"bg-primary text-white":"bg-muted hover:bg-accent"),title:"Include/exclude current slide in active custom show",children:r?"In Show":"Add Slide"})]})]})]}):n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[qt,jsxRuntime.jsx("button",{type:"button",onClick:i,className:"px-2 py-1 rounded bg-muted hover:bg-accent text-[11px] transition-colors",title:"Create custom show",children:"+ Show"})]}):null}function bpe({isActive:t,onPresent:e,onPresenterView:n,onRehearse:r,onSetUpSlideShow:o,onBroadcast:i,onToggleSubtitles:s,showSubtitles:a}){let[l,c]=Jm.useState(false);return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("div",{className:"inline-flex border-l border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:ie("px-2 py-1 transition-colors",t?"bg-primary text-white":"hover:bg-accent text-foreground"),title:"Present (fullscreen)",children:"Present"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>c(d=>!d),className:ie("px-1 py-1 transition-colors border-l border-border",l?"bg-primary text-white":"hover:bg-accent text-foreground"),title:"Presentation options","aria-label":"Presentation options",children:jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})})]}),l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:"fixed inset-0 z-40","aria-label":"Close menu",onClick:()=>c(false)}),jsxRuntime.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 w-52 rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),e();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuPlay,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Present"]}),n&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),n();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuMonitor,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Presenter View"]}),r&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),r();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuClock,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Rehearse Timings"]}),jsxRuntime.jsx("div",{className:"my-1 border-t border-border/60"}),o&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),o();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuSettings,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Set Up Slide Show"]}),i&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),i();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuRadio,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Present Online"]}),s&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{c(false),s();},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[jsxRuntime.jsx(lu$1.LuCaptions,{className:"w-3.5 h-3.5 text-muted-foreground"}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:"Subtitles"}),a&&jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3 h-3 text-primary"})]})]})]})]})}function vpe({mode:t,onSetMode:e,onCloseMasterView:n,onEnterPresenterView:r,onEnterRehearsalMode:o,onOpenSetUpSlideShow:i,onOpenBroadcastDialog:s,onToggleSubtitles:a,showSubtitles:l}){return t==="master"?jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm bg-amber-600/90 text-[10px] text-amber-50",children:"Master View"}),jsxRuntime.jsx("button",{type:"button",onClick:n,className:"px-2 py-0.5 rounded-sm hover:bg-accent text-[10px] text-foreground transition-colors",title:"Close master view",children:"Close"})]}):jsxRuntime.jsx(bpe,{isActive:t==="present",onPresent:()=>e("present"),onPresenterView:r,onRehearse:o,onSetUpSlideShow:i,onBroadcast:s,onToggleSubtitles:a,showSubtitles:l})}function Spe(t){let{t:e}=reactI18next.useTranslation(),n=r=>{t.onSetOverflowMenuOpen(false),{png:t.onExportPng,pdf:t.onExportPdf,video:t.onExportVideo,gif:t.onExportGif,package:t.onPackageForSharing,pptx:t.onSaveAsPptx,ppsx:t.onSaveAsPpsx,pptm:t.onSaveAsPptm,print:t.onPrint,copyImg:t.onCopySlideAsImage,a11y:t.onRunAccessibilityCheck,shortcuts:t.onToggleShortcuts,versionHistory:t.onToggleVersionHistory,documentProperties:t.onOpenDocumentProperties,passwordProtection:t.onOpenPasswordProtection,fontEmbedding:t.onOpenFontEmbedding,digitalSignatures:t.onOpenDigitalSignatures}[r]?.();};return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>t.onSetOverflowMenuOpen(!t.isOverflowMenuOpen),className:ie("p-1.5 rounded transition-colors",t.isOverflowMenuOpen?"bg-primary/80 text-white":"bg-muted hover:bg-accent"),title:e("pptx.ribbon.moreActions"),"aria-label":e("pptx.ribbon.moreActions"),children:jsxRuntime.jsx(lu$1.LuEllipsis,{className:Ne})}),t.isOverflowMenuOpen&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:"fixed inset-0 z-40","aria-label":e("pptx.overflow.closeMenu"),onClick:()=>t.onSetOverflowMenuOpen(false)}),jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 w-44 rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1",children:zue.filter(r=>r.k!=="pptm"||t.hasMacros).map(r=>r.k.startsWith("---")?jsxRuntime.jsx("div",{className:"my-1 border-t border-border/60"},r.k):jsxRuntime.jsxs("button",{type:"button",onClick:()=>n(r.k),className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",children:[r.i,e(r.labelKey)]},r.k))})]})]})}function Tpe(t){let{t:e}=reactI18next.useTranslation(),{mode:n,canEdit:r,isSidebarCollapsed:o,isInspectorPaneOpen:i,onToggleSidebar:s,onToggleInspector:a}=t,l=No(),c="p-1 max-md:p-2 max-md:min-h-[40px] max-md:min-w-[40px] rounded-sm transition-colors hover:bg-accent/60 disabled:opacity-40 disabled:cursor-not-allowed active:scale-90 active:opacity-70";return jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 max-md:gap-0 px-1.5 py-0.5 max-md:px-1",children:[n!=="present"&&jsxRuntime.jsx("button",{type:"button",onClick:s,className:ie(c,o?"text-muted-foreground":"text-foreground"),title:e("pptx.toolbar.toggleSlidesPanel"),"aria-label":e("pptx.toolbar.toggleSlidesPanel"),children:jsxRuntime.jsx(lu$1.LuPanelLeft,{className:Ne})}),jsxRuntime.jsx("div",{className:"flex-1 min-w-2 max-md:min-w-1"}),(n==="edit"||n==="master")&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleComments,className:ie(c,"relative max-md:hidden",t.isCommentsPanelOpen?"text-foreground":"text-muted-foreground"),title:e("pptx.toolbar.comments"),"aria-label":e("pptx.toolbar.comments"),children:[jsxRuntime.jsx(lu$1.LuMessageSquare,{className:Gn}),(t.slideCommentCount??0)>0&&jsxRuntime.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center w-3.5 h-3.5 rounded-full bg-primary text-[8px] text-white leading-none",children:t.slideCommentCount})]}),l&&(l.status==="connected"||l.status==="connecting")&&l.remoteUsers.length>0&&jsxRuntime.jsx("button",{type:"button",onClick:t.onOpenShareDialog,className:"mx-1 rounded-sm px-1 py-0.5 hover:bg-accent/60 transition-colors cursor-pointer",title:e("pptx.toolbar.sharingUsers",{count:l.connectedCount}),children:jsxRuntime.jsx(EH,{remoteUsers:l.remoteUsers,localUserName:l.config.userName,localUserColor:l.config.userColor??"#6366f1",localUserAvatar:l.config.userAvatar,status:l.status})}),jsxRuntime.jsx(vpe,{mode:t.mode,onSetMode:t.onSetMode,onCloseMasterView:t.onCloseMasterView,onToggleSlideSorter:t.onToggleSlideSorter,onEnterPresenterView:t.onEnterPresenterView,onEnterRehearsalMode:t.onEnterRehearsalMode,onOpenSetUpSlideShow:t.onOpenSetUpSlideShow,onOpenBroadcastDialog:t.onOpenBroadcastDialog,onToggleSubtitles:t.onToggleSubtitles,showSubtitles:t.showSubtitles}),jsxRuntime.jsx(ype,{customShows:t.customShows,activeCustomShowId:t.activeCustomShowId,canEdit:t.canEdit,isCurrentSlideInActiveShow:t.isCurrentSlideInActiveShow,onSetActiveCustomShowId:t.onSetActiveCustomShowId,onCreateCustomShow:t.onCreateCustomShow,onRenameActiveCustomShow:t.onRenameActiveCustomShow,onDeleteActiveCustomShow:t.onDeleteActiveCustomShow,onToggleCurrentSlideInActiveShow:t.onToggleCurrentSlideInActiveShow}),qt,(n==="edit"||n==="master")&&jsxRuntime.jsx("button",{type:"button",onClick:a,className:ie(c,i?"text-foreground":"text-muted-foreground"),title:e("pptx.toolbar.toggleInspector"),"aria-label":e("pptx.toolbar.toggleInspector"),children:jsxRuntime.jsx(lu$1.LuPanelRight,{className:Ne})}),jsxRuntime.jsx("button",{type:"button",onClick:t.onOpenSettings??t.onToggleShortcuts,className:ie(c,"text-muted-foreground"),title:e("pptx.toolbar.settingsShortcuts"),"aria-label":e("pptx.toolbar.settings"),children:jsxRuntime.jsx(lu$1.LuSettings,{className:Gn})}),!r&&jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm bg-amber-600/90 text-[10px] text-amber-50",children:e("pptx.toolbar.readOnly")}),jsxRuntime.jsx(Spe,{...t})]})}function WV(t){let{mode:e,isNarrowViewport:n,isCompactToolbarOpen:r,toolbarSection:o,onSetToolbarSection:i}=t,{t:s}=reactI18next.useTranslation();if(n&&e!=="present")return jsxRuntime.jsx(hpe,{...t});let a=o==="file",l=o==="home",c=o==="insert",d=l||o==="text",u=l||o==="arrange",p=o==="draw",h=o==="design",f=o==="transitions",m=o==="animations",x=o==="slideShow",g=o==="record",y=o==="review",b=o==="view",v=o==="help",S=e==="edit"||e==="master";return jsxRuntime.jsxs("div",{role:"toolbar","aria-label":"Presentation toolbar",className:"relative z-20 border-b border-border bg-secondary/50 overflow-visible",children:[jsxRuntime.jsx(Tpe,{...t}),S&&jsxRuntime.jsxs("div",{className:"flex items-center border-b border-border/60 px-1 max-md:overflow-x-auto max-md:scrollbar-none",children:[Are.map(w=>jsxRuntime.jsx("button",{type:"button",onClick:()=>i(w.id),className:ie("relative px-3.5 py-2 text-[12px] font-medium whitespace-nowrap transition-colors max-md:min-h-[36px] max-md:px-3",o===w.id?w.id==="file"?"text-white bg-primary/80 rounded-sm":"text-foreground after:absolute after:-bottom-px after:left-0 after:right-0 after:h-[2.5px] after:bg-primary":w.id==="file"?"text-primary hover:bg-primary/15 rounded-sm":"text-muted-foreground hover:text-foreground hover:bg-accent/30"),children:s(w.labelKey)},w.id)),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx(xpe,{onEnterRehearsalMode:t.canEdit?t.onEnterRehearsalMode:void 0,onOpenShareDialog:t.onOpenShareDialog,onPackageForSharing:t.onPackageForSharing}),n&&jsxRuntime.jsx("button",{type:"button",onClick:t.onToggleCompactToolbar,className:ie("px-2 py-1 rounded text-[11px] transition-colors mr-1",r?"bg-primary/80 text-white":"text-muted-foreground hover:text-foreground"),title:s(r?"pptx.ribbon.collapseRibbon":"pptx.ribbon.expandRibbon"),children:s(r?"pptx.ribbon.collapseRibbon":"pptx.ribbon.expandRibbon")})]}),S&&jsxRuntime.jsxs("div",{className:ie("flex items-center gap-1.5 px-2 py-1 max-md:px-1 max-md:py-0.5 overflow-visible flex-nowrap",n&&!r&&"hidden"),children:[a&&jsxRuntime.jsx(vN,{onOpenFile:t.onOpenFile,onExportPng:t.onExportPng,onExportPdf:t.onExportPdf,onExportVideo:t.onExportVideo,onExportGif:t.onExportGif,onPackageForSharing:t.onPackageForSharing,onSaveAsPptx:t.onSaveAsPptx,onSaveAsPpsx:t.onSaveAsPpsx,onSaveAsPptm:t.onSaveAsPptm,hasMacros:t.hasMacros,onCopySlideAsImage:t.onCopySlideAsImage,onPrint:t.onPrint,onOpenDocumentProperties:t.onOpenDocumentProperties,onOpenPasswordProtection:t.onOpenPasswordProtection,onOpenFontEmbedding:t.onOpenFontEmbedding,onOpenDigitalSignatures:t.onOpenDigitalSignatures}),l&&jsxRuntime.jsx(wN,{canEdit:t.canEdit,clipboardPayload:t.clipboardPayload,formatPainterActive:t.formatPainterActive,canActivateFormatPainter:t.canActivateFormatPainter,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onToggleFormatPainter:t.onToggleFormatPainter,layoutOptions:t.layoutOptions,onInsertSlideFromLayout:t.onInsertSlideFromLayout,selectedElement:t.selectedElement,onUpdateTextStyle:t.onUpdateTextStyle}),c&&jsxRuntime.jsx(CN,{canEdit:t.canEdit,newShapeType:t.newShapeType,onSetNewShapeType:t.onSetNewShapeType,onAddTextBox:t.onAddTextBox,onAddShape:t.onAddShape,onAddTable:t.onAddTable,onAddChart:t.onAddChart,onAddSmartArt:t.onAddSmartArt,onAddEquation:t.onAddEquation,onAddActionButton:t.onAddActionButton,onInsertField:t.onInsertField,onOpenImagePicker:t.onOpenImagePicker,onOpenMediaPicker:t.onOpenMediaPicker}),d&&jsxRuntime.jsx(_N,{canEdit:t.canEdit,selectedElement:t.selectedElement,tableEditorState:t.tableEditorState,onUpdateTextStyle:t.onUpdateTextStyle}),l&&jsxRuntime.jsx(gpe,{onToggleFindReplace:t.onToggleFindReplace}),l&&jsxRuntime.jsx(mpe,{canEdit:t.canEdit,selectedElement:t.selectedElement,newShapeType:t.newShapeType,onSetNewShapeType:t.onSetNewShapeType,onAddShape:t.onAddShape,onMoveLayer:t.onMoveLayer,onMoveLayerToEdge:t.onMoveLayerToEdge}),p&&jsxRuntime.jsx(bN,{activeTool:t.activeTool,drawingColor:t.drawingColor,drawingWidth:t.drawingWidth,onSetActiveTool:t.onSetActiveTool,onSetDrawingColor:t.onSetDrawingColor,onSetDrawingWidth:t.onSetDrawingWidth}),u&&jsxRuntime.jsx(fN,{canEdit:t.canEdit,selectedElement:t.selectedElement,clipboardPayload:t.clipboardPayload,onAlignElements:t.onAlignElements,onDistributeElements:t.onDistributeElements,canDistribute:t.canDistribute,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onFlip:t.onFlip,onMoveLayer:t.onMoveLayer,onMoveLayerToEdge:t.onMoveLayerToEdge,onDuplicate:t.onDuplicate,onDelete:t.onDelete,formatPainterActive:t.formatPainterActive,onToggleFormatPainter:t.onToggleFormatPainter,canActivateFormatPainter:t.canActivateFormatPainter}),h&&jsxRuntime.jsx(mN,{canEdit:t.canEdit,onToggleThemeGallery:t.onToggleThemeGallery,isThemeGalleryOpen:t.isThemeGalleryOpen,onToggleThemeEditor:t.onToggleThemeEditor,isThemeEditorOpen:t.isThemeEditorOpen,onOpenDocumentProperties:t.onOpenDocumentProperties,onToggleInspector:t.onToggleInspector,isInspectorPaneOpen:t.isInspectorPaneOpen}),f&&jsxRuntime.jsx(gN,{isInspectorPaneOpen:t.isInspectorPaneOpen,onToggleInspector:t.onToggleInspector}),m&&jsxRuntime.jsx(hN,{canEdit:t.canEdit,selectedElement:t.selectedElement,isInspectorPaneOpen:t.isInspectorPaneOpen,onToggleInspector:t.onToggleInspector,onOpenAnimationPanel:t.onOpenAnimationPanel,onAddAnimation:t.onAddAnimation,onRemoveAnimation:t.onRemoveAnimation}),x&&jsxRuntime.jsx(MN,{onPresent:()=>t.onSetMode("present"),onEnterPresenterView:t.onEnterPresenterView??(()=>{}),onEnterRehearsalMode:t.onEnterRehearsalMode??(()=>{}),onOpenSetUpSlideShow:t.onOpenSetUpSlideShow??(()=>{}),onOpenBroadcastDialog:t.onOpenBroadcastDialog??(()=>{}),onToggleSubtitles:t.onToggleSubtitles??(()=>{}),showSubtitles:t.showSubtitles??false,onSetMode:t.onSetMode}),g&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-2",children:[jsxRuntime.jsx("span",{className:"inline-block w-3 h-3 rounded-full bg-red-500"}),jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:"Record"})]}),y&&jsxRuntime.jsx(xN,{canEdit:t.canEdit,spellCheckEnabled:t.spellCheckEnabled,onSetSpellCheckEnabled:t.onSetSpellCheckEnabled,onToggleComments:t.onToggleComments,isCommentsPanelOpen:t.isCommentsPanelOpen,slideCommentCount:t.slideCommentCount,onCompare:t.onCompare}),b&&jsxRuntime.jsx(PN,{canEdit:t.canEdit,editTemplateMode:t.editTemplateMode,onSetEditTemplateMode:t.onSetEditTemplateMode,spellCheckEnabled:t.spellCheckEnabled,onSetSpellCheckEnabled:t.onSetSpellCheckEnabled,showGrid:t.showGrid,showRulers:t.showRulers,snapToGrid:t.snapToGrid,snapToShape:t.snapToShape,onSetShowGrid:t.onSetShowGrid,onSetShowRulers:t.onSetShowRulers,onSetSnapToGrid:t.onSetSnapToGrid,onSetSnapToShape:t.onSetSnapToShape,onAddGuide:t.onAddGuide,onEnterMasterView:t.onEnterMasterView,isSelectionPaneOpen:t.isSelectionPaneOpen,onToggleSelectionPane:t.onToggleSelectionPane,eyedropperActive:t.eyedropperActive,onToggleEyedropper:t.onToggleEyedropper}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:t.onToggleShortcuts,className:Be,title:s("pptx.settings.keyboardShortcuts"),children:s("pptx.settings.keyboardShortcuts")}),jsxRuntime.jsx("button",{type:"button",onClick:t.onRunAccessibilityCheck,className:Be,title:s("pptx.ribbon.accessibilityCheck"),children:s("pptx.ribbon.accessibilityCheck")})]})]})]})}bt();Pe();var DN="bg-muted border border-border rounded px-2 py-1 w-full text-[11px]",Gu="bg-muted border border-border rounded px-2 py-1 w-full text-[11px]",Cpe=SR.filter(t=>t.value==="fadeIn"||t.value==="flyIn"||t.value==="zoomIn"),Mpe=SR.filter(t=>t.value==="fadeOut"||t.value==="flyOut"||t.value==="zoomOut"),_pe=SR.filter(t=>t.value==="spin"||t.value==="pulse"||t.value==="colorWave"||t.value==="bounce"||t.value==="flash"||t.value==="growShrink"||t.value==="teeter"),Ppe=[{value:"onClick",labelKey:"pptx.animation.trigger.onClick"},{value:"onShapeClick",labelKey:"pptx.animation.trigger.onShapeClick"},{value:"onHover",labelKey:"pptx.animation.trigger.onHover"},{value:"afterPrevious",labelKey:"pptx.animation.trigger.afterPrevious"},{value:"withPrevious",labelKey:"pptx.animation.trigger.withPrevious"}],Epe=[{value:"ease",labelKey:"pptx.animation.timingCurve.ease"},{value:"ease-in",labelKey:"pptx.animation.timingCurve.easeIn"},{value:"ease-out",labelKey:"pptx.animation.timingCurve.easeOut"},{value:"linear",labelKey:"pptx.animation.timingCurve.linear"}],Ape=[{value:"none",labelKey:"pptx.animation.repeatUntil.none"},{value:"untilNextClick",labelKey:"pptx.animation.repeatUntil.untilNextClick"},{value:"untilEndOfSlide",labelKey:"pptx.animation.repeatUntil.untilEndOfSlide"}],Rpe=[{value:"fromTop",labelKey:"pptx.animation.direction.fromTop",icon:lu$1.LuArrowDown},{value:"fromBottom",labelKey:"pptx.animation.direction.fromBottom",icon:lu$1.LuArrowUp},{value:"fromLeft",labelKey:"pptx.animation.direction.fromLeft",icon:lu$1.LuArrowRight},{value:"fromRight",labelKey:"pptx.animation.direction.fromRight",icon:lu$1.LuArrowLeft}],kpe=[{value:"asOne",labelKey:"pptx.animation.sequence.asOne"},{value:"byParagraph",labelKey:"pptx.animation.sequence.byParagraph"},{value:"byWord",labelKey:"pptx.animation.sequence.byWord"},{value:"byLetter",labelKey:"pptx.animation.sequence.byLetter"}];function Pst(t){return t.entrance?"bg-green-500/60":t.emphasis?"bg-yellow-500/60":t.exit?"bg-red-500/60":"bg-muted-foreground/40"}function Est(t){return t.entrance??t.emphasis??t.exit??"custom"}function Npe({selectedElementId:t,canEdit:e,handlers:n}){let{t:r}=reactI18next.useTranslation(),{sortedAnimations:o,dragIndex:i,dragOverIndex:s,timelineBarData:a,handleAnimationHover:l,handleAnimationHoverEnd:c,handleDragStart:d,handleDragOver:u,handleDragEnter:p,handleDragLeave:h,handleDrop:f,handleDragEnd:m,handleMoveUp:x,handleMoveDown:g,getTimelineLabel:y}=n;return o.length===0&&a.length===0?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a.length>0&&jsxRuntime.jsxs("div",{className:"mt-2 pt-2 border-t border-border",children:[jsxRuntime.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-1",children:r("pptx.animation.timelineBar")}),jsxRuntime.jsx("div",{className:"relative h-6 rounded bg-muted/50 border border-border overflow-hidden",children:a.map(b=>jsxRuntime.jsx("div",{className:ie("absolute top-0.5 bottom-0.5 rounded-sm transition-colors",Pst(b.anim),b.anim.elementId===t&&"ring-1 ring-primary"),style:{left:`${b.leftPercent}%`,width:`${Math.max(b.widthPercent,2)}%`},title:`${y(b.anim)} - ${Est(b.anim)} (${b.anim.durationMs??500}ms)`,onMouseEnter:()=>l(b.anim),onMouseLeave:c},b.anim.elementId))})]}),o.length>0&&jsxRuntime.jsxs("div",{className:"mt-2 pt-2 border-t border-border",children:[jsxRuntime.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-1",children:r("pptx.animation.timeline")}),jsxRuntime.jsx("div",{className:"space-y-0.5 max-h-40 overflow-y-auto",children:o.map((b,v)=>{let S=t===b.elementId;return jsxRuntime.jsxs("div",{draggable:e,onDragStart:T=>d(v,T),onDragOver:T=>u(v,T),onDragEnter:()=>p(v),onDragLeave:h,onDrop:T=>f(v,T),onDragEnd:m,onMouseEnter:()=>l(b),onMouseLeave:c,className:ie("flex items-center gap-1 px-1 py-0.5 rounded text-[10px] cursor-grab transition-colors",S?"bg-primary/30 text-primary":"bg-muted/50 text-muted-foreground",i===v&&"opacity-40",s===v&&"border-t-2 border-primary"),children:[e&&jsxRuntime.jsx(lu$1.LuGripVertical,{className:"w-3 h-3 text-muted-foreground/50 shrink-0"}),jsxRuntime.jsxs("span",{className:"text-muted-foreground w-4 shrink-0",children:[v+1,"."]}),jsxRuntime.jsx("span",{className:"truncate flex-1",children:y(b)}),b.entrance&&jsxRuntime.jsx(lu$1.LuMoveRight,{className:"w-3 h-3 text-green-400/70 shrink-0"}),b.emphasis&&jsxRuntime.jsx(lu$1.LuRotateCw,{className:"w-3 h-3 text-yellow-400/70 shrink-0"}),b.exit&&jsxRuntime.jsx(lu$1.LuMoveRight,{className:"w-3 h-3 text-red-400/70 rotate-180 shrink-0"}),e&&jsxRuntime.jsxs("div",{className:"flex gap-0.5 shrink-0",children:[jsxRuntime.jsx("button",{type:"button",disabled:v===0,className:"text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors",onClick:T=>{T.stopPropagation(),x(v);},title:r("pptx.animation.moveUp"),children:jsxRuntime.jsx(lu$1.LuChevronUp,{className:"w-3 h-3"})}),jsxRuntime.jsx("button",{type:"button",disabled:v===o.length-1,className:"text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors",onClick:T=>{T.stopPropagation(),g(v);},title:r("pptx.animation.moveDown"),children:jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3"})})]})]},b.elementId)})})]})]})}bt();Pe();function Dpe({canEdit:t,updateAnimations:e}){let[n,r]=Jm.useState(null),[o,i]=Jm.useState(null),s=Jm.useRef(0),a=Jm.useCallback((x,g)=>{t&&(r(x),g.dataTransfer.effectAllowed="move",g.dataTransfer.setData("text/plain",String(x)));},[t]),l=Jm.useCallback((x,g)=>{g.preventDefault(),g.dataTransfer.dropEffect="move",i(x);},[]),c=Jm.useCallback(x=>{s.current++,i(x);},[]),d=Jm.useCallback(()=>{s.current--,s.current<=0&&(i(null),s.current=0);},[]),u=Jm.useCallback((x,g)=>{e(y=>{let b=[...y].sort((S,w)=>(S.order??0)-(w.order??0)),[v]=b.splice(x,1);return b.splice(g,0,v),b.map((S,w)=>({...S,order:w}))});},[e]),p=Jm.useCallback((x,g)=>{g.preventDefault(),s.current=0;let y=n;r(null),i(null),!(y===null||y===x)&&u(y,x);},[n,u]),h=Jm.useCallback(()=>{r(null),i(null),s.current=0;},[]),f=Jm.useCallback(x=>{x<=0||u(x,x-1);},[u]),m=Jm.useCallback(x=>{e(g=>{let y=[...g].sort((v,S)=>(v.order??0)-(S.order??0));if(x>=y.length-1)return g;let b=y[x+1];return y[x+1]=y[x],y[x]=b,y.map((v,S)=>({...v,order:S}))});},[e]);return {dragIndex:n,dragOverIndex:o,handleDragStart:a,handleDragOver:l,handleDragEnter:c,handleDragLeave:d,handleDrop:p,handleDragEnd:h,handleMoveUp:f,handleMoveDown:m}}function Fpe({selectedElementId:t,selectedElementAnimation:e}){let n=Jm.useCallback(i=>{let s=i.entrance??i.emphasis??i.exit;!s||s==="none"||s6(i.elementId,s,{direction:i.direction,durationMs:i.durationMs??500,timingCurve:i.timingCurve});},[]),r=Jm.useCallback(()=>a6(),[]),o=Jm.useCallback(()=>{if(!e)return;let i=e.entrance??e.emphasis??e.exit;!i||i==="none"||s6(t,i,{direction:e.direction,durationMs:e.durationMs??500,timingCurve:e.timingCurve});},[t,e]);return {handleAnimationHover:n,handleAnimationHoverEnd:r,handlePreviewClick:o}}function Ope({selectedElement:t,activeSlide:e,canEdit:n,onUpdateSlide:r}){let o=Jm.useMemo(()=>(e.animations??[]).find(E=>E.elementId===t.id),[e,t]),i=Jm.useMemo(()=>[...e.animations??[]].sort((E,R)=>(E.order??0)-(R.order??0)),[e.animations]),s=Jm.useCallback(E=>{if(!n)return;let R=e.animations??[];r({animations:E([...R])});},[n,e.animations,r]),a=Jm.useCallback((E,R)=>{s(I=>I.map(L=>L.elementId===t.id?{...L,[E]:R}:L));},[s,t.id]),l=Jm.useCallback((E,R,I)=>{n&&s(L=>{let k=L.findIndex(N=>N.elementId===t.id),F=E||R||I;if(k>=0){if(!F)return L.filter(N=>N.elementId!==t.id);L[k]={...L[k],entrance:E,exit:R,emphasis:I};}else F&&L.push({elementId:t.id,entrance:E,exit:R,emphasis:I,durationMs:500,order:L.length,trigger:"onClick"});return L});},[n,s,t.id]),c=Jm.useCallback(E=>{let R=E.target.value;l(R==="none"?void 0:R,o?.exit,o?.emphasis);},[l,o]),d=Jm.useCallback(E=>{let R=E.target.value;l(o?.entrance,R==="none"?void 0:R,o?.emphasis);},[l,o]),u=Jm.useCallback(E=>{let R=E.target.value;l(o?.entrance,o?.exit,R==="none"?void 0:R);},[l,o]),p=Jm.useCallback(E=>{let R=E.target.value;a("trigger",R),R!=="onShapeClick"&&a("triggerShapeId",void 0);},[a]),h=Jm.useCallback(E=>a("triggerShapeId",E.target.value||void 0),[a]),f=Jm.useCallback(E=>a("timingCurve",E.target.value),[a]),m=Jm.useCallback(E=>a("durationMs",Math.max(100,Math.min(1e4,Number(E.target.value)||450))),[a]),x=Jm.useCallback(E=>a("delayMs",Math.max(0,Math.min(1e4,Number(E.target.value)||0))),[a]),g=Jm.useCallback(E=>a("repeatCount",Math.max(1,Math.min(100,Number(E.target.value)||1))),[a]),y=Jm.useCallback(E=>{let R=E.target.value;a("repeatMode",R==="none"?void 0:R);},[a]),b=Jm.useCallback(E=>a("direction",E),[a]),v=Jm.useCallback(E=>a("sequence",E.target.value),[a]),S=Fpe({selectedElementId:t.id,selectedElementAnimation:o}),w=Dpe({canEdit:n,updateAnimations:s}),C=Jm.useCallback(E=>{let R=e.elements?.find(L=>L.id===E.elementId);return R?(ze(R)?R.text:void 0)||ii(R):E.elementId.slice(0,8)},[e.elements]),T=!!(o?.entrance||o?.exit||o?.emphasis),M=T&&(oT.has(o?.entrance??"")||oT.has(o?.exit??"")),_=Jm.useMemo(()=>{if(i.length===0)return [];let E=0,R=i.map(L=>{let k=L.delayMs??0,F=L.durationMs??500,N=k+F;return N>E&&(E=N),{anim:L,startMs:k,durationMs:F,endMs:N}}),I=Math.max(E,1);return R.map(L=>({anim:L.anim,leftPercent:L.startMs/I*100,widthPercent:L.durationMs/I*100}))},[i]);return {selectedElementAnimation:o,sortedAnimations:i,hasAnimation:T,showDirectionPicker:M,timelineBarData:_,handleEntranceChange:c,handleExitChange:d,handleEmphasisChange:u,handleTriggerChange:p,handleTriggerShapeChange:h,handleTimingCurveChange:f,handleDurationChange:m,handleDelayChange:x,handleRepeatCountChange:g,handleRepeatModeChange:y,handleDirectionChange:b,handleSequenceChange:v,getTimelineLabel:C,...S,...w}}function Bpe({selectedElement:t,activeSlide:e,canEdit:n,onUpdateSlide:r}){let{t:o}=reactI18next.useTranslation(),i=Ope({selectedElement:t,activeSlide:e,canEdit:n,onUpdateSlide:r}),{selectedElementAnimation:s,hasAnimation:a,showDirectionPicker:l,handleEntranceChange:c,handleExitChange:d,handleEmphasisChange:u,handleTriggerChange:p,handleTriggerShapeChange:h,handleTimingCurveChange:f,handleDurationChange:m,handleDelayChange:x,handleRepeatCountChange:g,handleRepeatModeChange:y,handleDirectionChange:b,handleSequenceChange:v,handlePreviewClick:S}=i;return jsxRuntime.jsxs("div",{className:"rounded border border-border bg-card p-2 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:o("pptx.animation.title")}),a&&jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[10px] text-primary hover:text-primary/80 transition-colors",onClick:S,title:o("pptx.animation.preview"),children:[jsxRuntime.jsx(lu$1.LuPlay,{className:"w-3 h-3"}),o("pptx.animation.preview")]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.entrance")}),jsxRuntime.jsxs("select",{value:s?.entrance??"none",onChange:c,disabled:!n,className:Gu,children:[jsxRuntime.jsx("option",{value:"none",children:o("pptx.animation.none")}),Cpe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(`pptx.animation.preset.${w.value}`)},w.value))]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.emphasis")}),jsxRuntime.jsxs("select",{value:s?.emphasis??"none",onChange:u,disabled:!n,className:Gu,children:[jsxRuntime.jsx("option",{value:"none",children:o("pptx.animation.none")}),_pe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(`pptx.animation.preset.${w.value}`)},w.value))]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.exit")}),jsxRuntime.jsxs("select",{value:s?.exit??"none",onChange:d,disabled:!n,className:Gu,children:[jsxRuntime.jsx("option",{value:"none",children:o("pptx.animation.none")}),Mpe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(`pptx.animation.preset.${w.value}`)},w.value))]})]}),a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l&&jsxRuntime.jsxs("div",{className:"pt-1 border-t border-border",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px] block mb-1",children:o("pptx.animation.direction")}),jsxRuntime.jsx("div",{className:"flex gap-1",children:Rpe.map(w=>{let C=w.icon,T=s?.direction===w.value;return jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie("flex items-center justify-center w-7 h-7 rounded border transition-colors",T?"border-primary bg-primary/20 text-primary":"border-border bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>b(w.value),title:o(w.labelKey),children:jsxRuntime.jsx(C,{className:"w-3.5 h-3.5"})},w.value)})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.sequence")}),jsxRuntime.jsx("select",{value:s?.sequence??"asOne",onChange:v,disabled:!n,className:Gu,children:kpe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(w.labelKey)},w.value))})]}),jsxRuntime.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground pt-1 border-t border-border",children:o("pptx.animation.timing")}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.trigger")}),jsxRuntime.jsx("select",{value:s?.trigger??"onClick",onChange:p,disabled:!n,className:Gu,children:Ppe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(w.labelKey)},w.value))})]}),s?.trigger==="onShapeClick"&&jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.trigger.shapeLabel")}),jsxRuntime.jsxs("select",{value:s?.triggerShapeId??"",onChange:h,disabled:!n,className:Gu,children:[jsxRuntime.jsx("option",{value:"",children:o("pptx.animation.trigger.selectShape")}),e.elements.filter(w=>w.id!==t.id).map(w=>jsxRuntime.jsx("option",{value:w.id,children:ii(w)},w.id))]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.duration")}),jsxRuntime.jsx("input",{type:"number",min:100,max:1e4,step:50,disabled:!n,value:s?.durationMs??450,onChange:m,className:DN})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.delay")}),jsxRuntime.jsx("input",{type:"number",min:0,max:1e4,step:50,disabled:!n,value:s?.delayMs??0,onChange:x,className:DN})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.timingCurve")}),jsxRuntime.jsx("select",{value:s?.timingCurve??"ease",onChange:f,disabled:!n,className:Gu,children:Epe.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(w.labelKey)},w.value))})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.repeatCount")}),jsxRuntime.jsx("input",{type:"number",min:1,max:100,step:1,disabled:!n,value:s?.repeatCount??1,onChange:g,className:DN})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.animation.repeatUntil")}),jsxRuntime.jsx("select",{value:s?.repeatMode??"none",onChange:y,disabled:!n,className:Gu,children:Ape.map(w=>jsxRuntime.jsx("option",{value:w.value,children:o(w.labelKey)},w.value))})]})]}),jsxRuntime.jsx(Npe,{selectedElementId:t.id,canEdit:n,handlers:i})]})}bt();bt();var Upe=[{key:"elements",label:"Elements",icon:lu$1.LuLayers},{key:"properties",label:"Properties",icon:lu$1.LuSettings2},{key:"comments",label:"Comments",icon:lu$1.LuMessageSquare}],Gt="text-[11px] uppercase tracking-wide text-muted-foreground",Zt="rounded border border-border bg-card p-2 space-y-2",an="flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",xr="rounded bg-muted hover:bg-accent px-2 py-1 text-[11px] transition-colors",$pe=[["X","x"],["Y","y"],["W","width"],["H","height"]];var Bst=[{value:"none",label:"None"},{value:"url",label:"Go to URL"},{value:"slide",label:"Go to Slide"},{value:"firstSlide",label:"First Slide"},{value:"lastSlide",label:"Last Slide"},{value:"prevSlide",label:"Previous Slide"},{value:"nextSlide",label:"Next Slide"},{value:"endShow",label:"End Show"}];function zpe({selectedElement:t,slides:e,canEdit:n,onUpdateElement:r}){let{t:o}=reactI18next.useTranslation(),i=t.actionClick?o_(t.actionClick,"click"):void 0,s=t.actionHover?o_(t.actionHover,"hover"):void 0,a=i?.type??"none",l=s?.type??"none",c=(d,u,p,h)=>{let m=aS({type:u,url:p,slideIndex:h});r(d==="click"?{actionClick:m}:{actionHover:m});};return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.action.title","Action")}),jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px]",children:[jsxRuntime.jsx(Hpe,{label:o("pptx.action.onClick","On Click"),trigger:"click",activeType:a,action:i,fallbackUrl:t.actionClick?.url,fallbackSlideIndex:t.actionClick?.targetSlideIndex,canEdit:n,slideCount:e.length,onChangeType:d=>c("click",d,i?.url,i?.slideIndex),onChangeUrl:d=>c("click","url",d),onChangeSlide:d=>c("click","slide",void 0,d)}),jsxRuntime.jsx(Hpe,{label:o("pptx.action.onHover","On Hover"),trigger:"hover",activeType:l,action:s,fallbackUrl:t.actionHover?.url,fallbackSlideIndex:t.actionHover?.targetSlideIndex,canEdit:n,slideCount:e.length,onChangeType:d=>c("hover",d,s?.url,s?.slideIndex),onChangeUrl:d=>c("hover","url",d),onChangeSlide:d=>c("hover","slide",void 0,d)})]})]})}function Hpe({label:t,activeType:e,action:n,fallbackUrl:r,fallbackSlideIndex:o,canEdit:i,slideCount:s,onChangeType:a,onChangeUrl:l,onChangeSlide:c}){return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground font-medium",children:t}),jsxRuntime.jsx("select",{disabled:!i,className:ie(an,"w-full"),value:e,onChange:d=>a(d.target.value),children:Bst.map(d=>jsxRuntime.jsx("option",{value:d.value,children:d.label},d.value))}),e==="url"&&jsxRuntime.jsx("input",{type:"text",disabled:!i,className:ie(an,"w-full"),placeholder:"https://...",value:n?.url??r??"",onChange:d=>l(d.target.value)}),e==="slide"&&jsxRuntime.jsx("input",{type:"number",disabled:!i,className:ie(an,"w-full"),placeholder:"Slide number (1-based)",min:1,max:s,value:(n?.slideIndex??o??0)+1,onChange:d=>{let u=Number(d.target.value);Number.isFinite(u)&&c(Math.max(0,u-1));}})]})}bt();var er="text-[11px] uppercase tracking-wide text-muted-foreground",tr="rounded border border-border bg-card p-2 space-y-2",Rn="flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",KV="rounded bg-muted hover:bg-accent px-2 py-1 text-[11px] transition-colors",FN="bg-muted border border-border rounded px-1 py-0.5 text-[11px] w-full text-center",Vpe=[{value:"bar",labelKey:"pptx.chart.typeBar"},{value:"line",labelKey:"pptx.chart.typeLine"},{value:"pie",labelKey:"pptx.chart.typePie"},{value:"doughnut",labelKey:"pptx.chart.typeDoughnut"},{value:"area",labelKey:"pptx.chart.typeArea"},{value:"scatter",labelKey:"pptx.chart.typeScatter"},{value:"bubble",labelKey:"pptx.chart.typeBubble"},{value:"radar",labelKey:"pptx.chart.typeRadar"},{value:"stock",labelKey:"pptx.chart.typeStock"},{value:"waterfall",labelKey:"pptx.chart.typeWaterfall"},{value:"combo",labelKey:"pptx.chart.typeCombo"}],Gpe=[{value:"clustered",labelKey:"pptx.chart.groupingClustered"},{value:"stacked",labelKey:"pptx.chart.groupingStacked"},{value:"percentStacked",labelKey:"pptx.chart.groupingPercentStacked"}],Wpe=[{value:"t",labelKey:"pptx.chart.legendTop"},{value:"b",labelKey:"pptx.chart.legendBottom"},{value:"l",labelKey:"pptx.chart.legendLeft"},{value:"r",labelKey:"pptx.chart.legendRight"}],Xpe=[{value:"nextTo",labelKey:"pptx.chart.tickNextTo"},{value:"high",labelKey:"pptx.chart.tickHigh"},{value:"low",labelKey:"pptx.chart.tickLow"},{value:"none",labelKey:"pptx.chart.tickNone"}],jpe=[{value:"",labelKey:"pptx.chart.unitsNone"},{value:"hundreds",labelKey:"pptx.chart.unitsHundreds"},{value:"thousands",labelKey:"pptx.chart.unitsThousands"},{value:"tenThousands",labelKey:"pptx.chart.unitsTenThousands"},{value:"hundredThousands",labelKey:"pptx.chart.unitsHundredThousands"},{value:"millions",labelKey:"pptx.chart.unitsMillions"},{value:"tenMillions",labelKey:"pptx.chart.unitsTenMillions"},{value:"hundredMillions",labelKey:"pptx.chart.unitsHundredMillions"},{value:"billions",labelKey:"pptx.chart.unitsBillions"},{value:"trillions",labelKey:"pptx.chart.unitsTrillions"}];var Ype=[{key:"showValue",labelKey:"pptx.chart.labelValue"},{key:"showCategory",labelKey:"pptx.chart.labelCategory"},{key:"showSeriesName",labelKey:"pptx.chart.labelSeriesName"},{key:"showPercent",labelKey:"pptx.chart.labelPercent"},{key:"showLegendKey",labelKey:"pptx.chart.labelLegendKey"}],Kpe=[{value:"",labelKey:"pptx.chart.labelPosDefault"},{value:"ctr",labelKey:"pptx.chart.labelPosCenter"},{value:"inEnd",labelKey:"pptx.chart.labelPosInsideEnd"},{value:"inBase",labelKey:"pptx.chart.labelPosInsideBase"},{value:"outEnd",labelKey:"pptx.chart.labelPosOutsideEnd"},{value:"bestFit",labelKey:"pptx.chart.labelPosBestFit"}],qpe=[{value:"",labelKey:"pptx.chart.trendlineNone"},{value:"linear",labelKey:"pptx.chart.trendlineLinear"},{value:"exponential",labelKey:"pptx.chart.trendlineExponential"},{value:"logarithmic",labelKey:"pptx.chart.trendlineLogarithmic"},{value:"polynomial",labelKey:"pptx.chart.trendlinePolynomial"},{value:"power",labelKey:"pptx.chart.trendlinePower"},{value:"movingAvg",labelKey:"pptx.chart.trendlineMovingAvg"}],Zpe=new Set(["bar","line","area","scatter","bubble"]),Jpe=[{value:"",labelKey:"pptx.chart.errorBarNone"},{value:"fixedVal",labelKey:"pptx.chart.errorBarFixed"},{value:"percentage",labelKey:"pptx.chart.errorBarPercentage"},{value:"stdDev",labelKey:"pptx.chart.errorBarStdDev"},{value:"stdErr",labelKey:"pptx.chart.errorBarStdErr"}],Qpe=[{value:"both",labelKey:"pptx.chart.errorBarBoth"},{value:"plus",labelKey:"pptx.chart.errorBarPlus"},{value:"minus",labelKey:"pptx.chart.errorBarMinus"}],ehe=new Set(["fixedVal","percentage","stdDev"]),the=new Set(["bar","line","area","scatter","bubble"]),nhe=new Set(["bar","line","area"]),ON=[{value:"",labelKey:"pptx.chart.markerAuto"},{value:"none",labelKey:"pptx.chart.markerNone"},{value:"circle",labelKey:"pptx.chart.markerCircle"},{value:"square",labelKey:"pptx.chart.markerSquare"},{value:"diamond",labelKey:"pptx.chart.markerDiamond"},{value:"triangle",labelKey:"pptx.chart.markerTriangle"},{value:"x",labelKey:"pptx.chart.markerX"},{value:"star",labelKey:"pptx.chart.markerStar"},{value:"plus",labelKey:"pptx.chart.markerPlus"},{value:"dot",labelKey:"pptx.chart.markerDot"},{value:"dash",labelKey:"pptx.chart.markerDash"}],BN=new Set(["line","scatter","bubble","radar"]),rhe=[{value:"",labelKey:"pptx.chart.dashDefault"},{value:"solid",labelKey:"pptx.chart.dashSolid"},{value:"dash",labelKey:"pptx.chart.dashDash"},{value:"dot",labelKey:"pptx.chart.dashDot"},{value:"dashDot",labelKey:"pptx.chart.dashDashDot"},{value:"lgDash",labelKey:"pptx.chart.dashLong"}],ohe=[{value:"",labelKey:"pptx.chart.comboDefault"},{value:"bar",labelKey:"pptx.chart.typeBar"},{value:"line",labelKey:"pptx.chart.typeLine"},{value:"area",labelKey:"pptx.chart.typeArea"},{value:"scatter",labelKey:"pptx.chart.typeScatter"}],ihe=new Set(["bar","line","area","combo"]),she=new Set(["pie","pie3D","doughnut","ofPie"]);var $st=[{type:"valAx",labelKey:"pptx.chart.valueAxis",hasScale:true},{type:"dateAx",labelKey:"pptx.chart.dateAxis",hasScale:true},{type:"catAx",labelKey:"pptx.chart.categoryAxis",hasScale:false}];function ahe({axes:t,canEdit:e,onUpdateAxis:n}){let{t:r}=reactI18next.useTranslation(),o=$st.map(s=>({...s,axis:t?.find(a=>a.axisType===s.type)})).filter(s=>!!s.axis);if(o.length===0)return null;let i=(s,a,l,c)=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r(a)}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:Rn,value:l??"",placeholder:r("pptx.chart.auto"),onChange:d=>{let u=d.target.value;if(u===""){n(s,{[c]:void 0});return}let p=Number.parseFloat(u);Number.isFinite(p)&&n(s,{[c]:p});}})]});return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:r("pptx.chart.axes")}),o.map(({type:s,labelKey:a,hasScale:l,axis:c})=>jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-[11px] font-medium",children:r(a)}),l&&jsxRuntime.jsxs("div",{className:"space-y-1.5 ml-2",children:[i(s,"pptx.chart.min",c.min,"min"),i(s,"pptx.chart.max",c.max,"max"),i(s,"pptx.chart.majorUnit",c.majorUnit,"majorUnit"),i(s,"pptx.chart.minorUnit",c.minorUnit,"minorUnit"),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.displayUnits")}),jsxRuntime.jsx("select",{disabled:!e,className:Rn,value:c.displayUnits??"",onChange:d=>n(s,{displayUnits:d.target.value||void 0}),children:jpe.map(d=>jsxRuntime.jsx("option",{value:d.value,children:r(d.labelKey)},d.value))})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5 ml-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.axisTitle")}),jsxRuntime.jsx("input",{type:"text",disabled:!e,className:Rn,value:c.titleText??"",placeholder:r("pptx.chart.axisTitlePlaceholder"),onChange:d=>n(s,{titleText:d.target.value})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.numberFormat")}),jsxRuntime.jsx("input",{type:"text",disabled:!e,className:Rn,value:c.numFmt?.formatCode??"",placeholder:"General",onChange:d=>n(s,{numFmt:d.target.value?{formatCode:d.target.value,sourceLinked:false}:void 0})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.tickLabels")}),jsxRuntime.jsx("select",{disabled:!e,className:Rn,value:c.tickLblPos??"nextTo",onChange:d=>n(s,{tickLblPos:d.target.value}),children:Xpe.map(d=>jsxRuntime.jsx("option",{value:d.value,children:r(d.labelKey)},d.value))})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:c.majorGridlines??false,onChange:d=>n(s,{majorGridlines:d.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.majorGridlines")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:c.minorGridlines??false,onChange:d=>n(s,{minorGridlines:d.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.minorGridlines")})]})]})]},s))]})}var zst=[{type:"valAx",labelKey:"pptx.chart.valueAxis"},{type:"dateAx",labelKey:"pptx.chart.dateAxis"},{type:"catAx",labelKey:"pptx.chart.categoryAxis"}];function lhe({axes:t,canEdit:e,onSetLogScale:n,onSetTitleStyle:r,onSetGridlineStyle:o}){let{t:i}=reactI18next.useTranslation(),s=zst.map(a=>({...a,axis:t?.find(l=>l.axisType===a.type)})).filter(a=>!!a.axis);return s.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:i("pptx.chart.axisStyling")}),s.map(({type:a,labelKey:l,axis:c})=>{let d=a==="valAx"||a==="dateAx";return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-[11px] font-medium",children:i(l)}),jsxRuntime.jsxs("div",{className:"space-y-1.5 ml-2",children:[d&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:c.logScale??false,onChange:u=>n(a,{enabled:u.target.checked,base:c.logBase}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:i("pptx.chart.logScale")})]}),c.logScale&&jsxRuntime.jsx("input",{type:"number",min:2,disabled:!e,title:i("pptx.chart.logBase"),className:"w-16 bg-muted border border-border rounded px-1.5 py-0.5 text-[11px]",value:c.logBase??10,onChange:u=>{let p=Number.parseFloat(u.target.value);Number.isFinite(p)&&p>1&&n(a,{enabled:true,base:p});}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:i("pptx.chart.titleFont")}),jsxRuntime.jsx("input",{type:"text",disabled:!e,className:Rn,placeholder:i("pptx.chart.auto"),value:c.fontFamily??"",onChange:u=>r(a,{fontFamily:u.target.value||null})}),jsxRuntime.jsx("input",{type:"number",min:4,max:96,disabled:!e,title:i("pptx.chart.fontSize"),className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5",value:c.fontSize??"",placeholder:i("pptx.chart.auto"),onChange:u=>{let p=u.target.value,h=Number.parseFloat(p);r(a,{fontSize:Number.isFinite(h)?h:null});}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:c.fontBold??false,onChange:u=>r(a,{fontBold:u.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:i("pptx.chart.bold")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i("pptx.chart.titleColor")}),jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:c.fontColor??"#000000",onChange:u=>r(a,{fontColor:u.target.value})})]})]}),["major","minor"].map(u=>{let p=u==="major"?c.majorGridlinesSpPr:c.minorGridlinesSpPr;return (u==="major"?c.majorGridlines:c.minorGridlines)?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:i(u==="major"?"pptx.chart.majorGridlines":"pptx.chart.minorGridlines")}),jsxRuntime.jsx("input",{type:"color",disabled:!e,title:i("pptx.chart.gridlineColor"),className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:p?.strokeColor??"#d9d9d9",onChange:f=>o(a,u,{color:f.target.value})}),jsxRuntime.jsx("input",{type:"number",min:.25,step:.25,disabled:!e,title:i("pptx.chart.gridlineWidth"),className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5",value:p?.strokeWidth??"",placeholder:i("pptx.chart.auto"),onChange:f=>{let m=Number.parseFloat(f.target.value);o(a,u,{width:Number.isFinite(m)?m:null});}}),jsxRuntime.jsx("select",{disabled:!e,title:i("pptx.chart.gridlineDash"),className:Rn,value:p?.strokeDashStyle??"",onChange:f=>o(a,u,{dashStyle:f.target.value||null}),children:rhe.map(f=>jsxRuntime.jsx("option",{value:f.value,children:i(f.labelKey)},f.value))})]},u):null})]})]},a)})]})}function dhe({chartType:t,series:e,canEdit:n,onSetSeriesType:r}){let{t:o}=reactI18next.useTranslation();return !ihe.has(t)||e.length<2?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:o("pptx.chart.comboTypes")}),jsxRuntime.jsx("div",{className:"space-y-1.5",children:e.map((i,s)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:i.name,children:i.name}),jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:i.seriesChartType??"",onChange:a=>{let l=a.target.value;r(s,l===""?null:l);},children:ohe.map(a=>jsxRuntime.jsx("option",{value:a.value,children:o(a.labelKey)},a.value))})]},`${i.name}-${s}`))})]})}function hhe({series:t,categories:e,canEdit:n,onUpdateSeries:r,onUpdateCategoryLabel:o,onUpdateValue:i,onAddCategory:s,onRemoveCategory:a,onAddSeries:l,onRemoveSeries:c}){let{t:d}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:er,children:d("pptx.chart.data")}),n&&jsxRuntime.jsxs("div",{className:"flex gap-1",children:[jsxRuntime.jsxs("button",{type:"button",className:KV,title:d("pptx.chart.addCategory"),onClick:s,children:[jsxRuntime.jsx(lu$1.LuPlus,{className:"inline w-3 h-3 mr-0.5"}),d("pptx.chart.cat")]}),jsxRuntime.jsxs("button",{type:"button",className:KV,title:d("pptx.chart.addSeries"),onClick:l,children:[jsxRuntime.jsx(lu$1.LuPlus,{className:"inline w-3 h-3 mr-0.5"}),d("pptx.chart.seriesShort")]})]})]}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"w-full text-[11px] border-collapse",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{"aria-label":"Categories",className:"text-muted-foreground p-0.5 text-left min-w-[60px]"}),t.map((u,p)=>jsxRuntime.jsx("th",{className:"p-0.5 font-normal min-w-[72px]",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("input",{type:"text",disabled:!n,className:FN,value:u.name,onChange:h=>r(p,{name:h.target.value})}),n&&t.length>1&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-red-400 shrink-0",title:d("pptx.chart.removeSeries"),onClick:()=>c(p),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"})})]})},p))]})}),jsxRuntime.jsx("tbody",{children:e.map((u,p)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"p-0.5",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("input",{type:"text",disabled:!n,className:FN,value:u,onChange:h=>o(p,h.target.value)}),n&&e.length>1&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-red-400 shrink-0",title:d("pptx.chart.removeCategory"),onClick:()=>a(p),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"})})]})}),t.map((h,f)=>jsxRuntime.jsx("td",{className:"p-0.5",children:jsxRuntime.jsx("input",{type:"number","aria-label":`${h.name} value ${p+1}`,disabled:!n,className:FN,value:h.values[p]??0,onChange:m=>i(f,p,m.target.value)})},f))]},p))})]})})]})}function fhe({style:t,canEdit:e,onUpdateStyle:n}){let{t:r}=reactI18next.useTranslation();if(!t?.hasDataLabels)return null;let o=t.dataLabels??{},i=s=>n({dataLabels:{...o,...s}});return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:r("pptx.chart.dataLabels")}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[Ype.map(s=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:o[s.key]??false,onChange:a=>i({[s.key]:a.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r(s.labelKey)})]},s.key)),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground shrink-0",children:r("pptx.chart.labelPosition")}),jsxRuntime.jsx("select",{disabled:!e,className:Rn,value:o.position??"",onChange:s=>i({position:s.target.value||void 0}),children:Kpe.map(s=>jsxRuntime.jsx("option",{value:s.value,children:r(s.labelKey)},s.value))})]})]})]})}var Yst=ON.filter(t=>t.value!=="");function mhe({chartType:t,categories:e,series:n,canEdit:r,onSetPointMarker:o}){let{t:i}=reactI18next.useTranslation(),[s,a]=Jm.useState(0);if(!BN.has(t)||n.length===0||e.length===0)return null;let l=n[Math.min(s,n.length-1)],c=d=>l.dataPoints?.find(u=>u.idx===d);return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:i("pptx.chart.pointMarkers")}),n.length>1&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:i("pptx.chart.series")}),jsxRuntime.jsx("select",{disabled:!r,className:"flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",value:Math.min(s,n.length-1),onChange:d=>a(Number.parseInt(d.target.value,10)),children:n.map((d,u)=>jsxRuntime.jsx("option",{value:u,children:d.name},`${d.name}-${u}`))})]}),jsxRuntime.jsx("div",{className:"space-y-2",children:e.map((d,u)=>{let p=c(u),h=p?.marker!==void 0;return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:d,children:d}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1 shrink-0",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!r,checked:h,onChange:f=>{o(s,u,f.target.checked?{symbol:"circle"}:null);}}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i("pptx.chart.markerOverride")})]})]}),h&&p?.marker&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 ml-2 flex-wrap",children:[jsxRuntime.jsx("select",{disabled:!r,className:"bg-muted border border-border rounded px-1.5 py-0.5 text-[11px]",value:p.marker.symbol,onChange:f=>o(s,u,{symbol:f.target.value}),children:Yst.map(f=>jsxRuntime.jsx("option",{value:f.value,children:i(f.labelKey)},f.value))}),jsxRuntime.jsx("input",{type:"number",min:1,max:20,disabled:!r,title:i("pptx.chart.markerSize"),className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5 text-[11px]",value:p.marker.size??"",placeholder:i("pptx.chart.auto"),onChange:f=>{let m=Number.parseInt(f.target.value,10);o(s,u,{size:Number.isFinite(m)?m:void 0});}}),jsxRuntime.jsx("input",{type:"color",disabled:!r,title:i("pptx.chart.markerFill"),className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:p.marker.spPr?.fillColor??"#4472c4",onChange:f=>o(s,u,{fillColor:f.target.value})})]})]},`${d}-${u}`)})})]})}function ghe({chartType:t,categories:e,series:n,canEdit:r,onSetPointFill:o,onSetPointExplosion:i,onSetPointLabel:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState(0);if(n.length===0||e.length===0)return null;let d=n[Math.min(l,n.length-1)],u=she.has(t),p=h=>d.dataPoints?.find(f=>f.idx===h);return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:a("pptx.chart.dataPoints")}),n.length>1&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:a("pptx.chart.series")}),jsxRuntime.jsx("select",{disabled:!r,className:Rn,value:Math.min(l,n.length-1),onChange:h=>c(Number.parseInt(h.target.value,10)),children:n.map((h,f)=>jsxRuntime.jsx("option",{value:f,children:h.name},`${h.name}-${f}`))})]}),jsxRuntime.jsx("div",{className:"space-y-1.5",children:e.map((h,f)=>{let m=p(f);return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:h,children:h}),jsxRuntime.jsx("input",{type:"text",disabled:!r,title:a("pptx.chart.pointLabelOverride"),className:"w-20 bg-muted border border-border rounded px-1.5 py-0.5 text-[11px]",value:d.dataLabels?.find(x=>x.idx===f)?.text??"",placeholder:a("pptx.chart.auto"),onChange:x=>{let g=x.target.value;s(l,f,g===""?null:g);}}),jsxRuntime.jsx("input",{type:"color",disabled:!r,title:a("pptx.chart.pointFill"),className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:m?.spPr?.fillColor??d.color??"#4472c4",onChange:x=>o(l,f,x.target.value)}),m?.spPr?.fillColor&&jsxRuntime.jsx("button",{type:"button",disabled:!r,title:a("pptx.chart.pointFillClear"),className:"text-muted-foreground hover:text-foreground",onClick:()=>o(l,f,null),children:"\xD7"}),u&&jsxRuntime.jsx("input",{type:"number",min:0,max:100,disabled:!r,title:a("pptx.chart.pointExplosion"),className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5",value:m?.explosion??"",placeholder:"0",onChange:x=>{let g=x.target.value;if(g===""){i(l,f,null);return}let y=Number.parseInt(g,10);Number.isFinite(y)&&i(l,f,y);}})]},`${h}-${f}`)})})]})}function xhe({style:t,canEdit:e,onUpdateStyle:n}){let{t:r}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:r("pptx.chart.display")}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:t?.hasTitle??false,onChange:o=>n({hasTitle:o.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.showTitle")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:t?.hasLegend??false,onChange:o=>n({hasLegend:o.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.showLegend")})]}),t?.hasLegend&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px] ml-4",children:[jsxRuntime.jsx("span",{className:"w-12 text-muted-foreground shrink-0",children:r("pptx.chart.legendPosition")}),jsxRuntime.jsx("select",{disabled:!e,className:Rn,value:t.legendPosition??"b",onChange:o=>n({legendPosition:o.target.value}),children:Wpe.map(o=>jsxRuntime.jsx("option",{value:o.value,children:r(o.labelKey)},o.value))})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:t?.hasGridlines??false,onChange:o=>n({hasGridlines:o.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.showGridlines")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:t?.hasDataLabels??false,onChange:o=>n({hasDataLabels:o.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:r("pptx.chart.showDataLabels")})]})]})]})}function yhe({chartType:t,series:e,canEdit:n,onSetErrorBars:r}){let{t:o}=reactI18next.useTranslation();return !the.has(t)||e.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:o("pptx.chart.errorBars")}),jsxRuntime.jsx("div",{className:"space-y-2",children:e.map((i,s)=>{let a=i.errBars?.[0],l=a?.valType??"",c=ehe.has(l);return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:i.name,children:i.name}),jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:l,onChange:d=>{let u=d.target.value;if(!u){r(s,null);return}r(s,{direction:a?.direction??"y",barType:a?.barType??"both",valType:u,val:a?.val});},children:Jpe.map(d=>jsxRuntime.jsx("option",{value:d.value,children:o(d.labelKey)},d.value))})]}),a&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:a.barType,onChange:d=>r(s,{...a,barType:d.target.value}),children:Qpe.map(d=>jsxRuntime.jsx("option",{value:d.value,children:o(d.labelKey)},d.value))}),c&&jsxRuntime.jsx("input",{type:"number",disabled:!n,className:Rn,value:a.val??"",placeholder:o("pptx.chart.errorBarAmount"),onChange:d=>{let u=d.target.value,p=u===""?void 0:Number.parseFloat(u);u!==""&&!Number.isFinite(p)||r(s,{...a,val:p});}})]})]},`${i.name}-${s}`)})})]})}function bhe({chartType:t,series:e,canEdit:n,onSetMarker:r}){let{t:o}=reactI18next.useTranslation();return !BN.has(t)||e.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:o("pptx.chart.markers")}),jsxRuntime.jsx("div",{className:"space-y-2",children:e.map((i,s)=>{let a=i.marker;return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:i.name,children:i.name}),jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:a?.symbol??"",onChange:l=>{let c=l.target.value;if(c===""){r(s,null);return}r(s,{symbol:c});},children:ON.map(l=>jsxRuntime.jsx("option",{value:l.value,children:o(l.labelKey)},l.value))})]}),a&&a.symbol!=="none"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3 ml-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.chart.markerSize")}),jsxRuntime.jsx("input",{type:"number",min:2,max:72,disabled:!n,className:"w-14 bg-muted border border-border rounded px-1.5 py-0.5",value:a.size??"",placeholder:o("pptx.chart.auto"),onChange:l=>{let c=l.target.value,d=Number.parseInt(c,10);r(s,{size:Number.isFinite(d)?d:void 0});}})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.chart.markerFill")}),jsxRuntime.jsx("input",{type:"color",disabled:!n,className:"h-6 w-8 cursor-pointer rounded border border-border bg-transparent",value:a.spPr?.fillColor??"#4472c4",onChange:l=>r(s,{fillColor:l.target.value})})]})]})]},`${i.name}-${s}`)})})]})}function Lo({value:t,disabled:e,className:n,ariaLabel:r,onCommit:o}){let[i,s]=Jm.useState(t),a=Jm.useRef(o);a.current=o,Jm.useEffect(()=>{s(t);},[t]);let l=Jm.useCallback(c=>{let d=c.target.value;s(d),a.current(d);},[]);return jsxRuntime.jsx("input",{type:"color","aria-label":r??"Color",disabled:e,value:i,className:n,onChange:l})}var aat="#4472c4";function She({series:t,canEdit:e,onSetColor:n}){let{t:r}=reactI18next.useTranslation();return t.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:r("pptx.chart.seriesColors")}),jsxRuntime.jsx("div",{className:"space-y-1",children:t.map((o,i)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:o.name,children:o.name}),jsxRuntime.jsx(Lo,{value:o.color??aat,disabled:!e,ariaLabel:r("pptx.chart.seriesColor",{name:o.name}),className:"h-6 w-8 cursor-pointer rounded border border-border bg-muted p-0",onCommit:s=>n(i,s)}),e&&o.color&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-red-400 shrink-0",title:r("pptx.chart.clearSeriesColor"),onClick:()=>n(i,null),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-3 h-3"})})]},`${o.name}-${i}`))})]})}function whe({chartType:t,series:e,canEdit:n,onSetTrendline:r}){let{t:o}=reactI18next.useTranslation();return !Zpe.has(t)||e.length===0?null:jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:o("pptx.chart.trendlines")}),jsxRuntime.jsx("div",{className:"space-y-2",children:e.map((i,s)=>{let a=i.trendlines?.[0];return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"flex-1 truncate",title:i.name,children:i.name}),jsxRuntime.jsx("select",{disabled:!n,className:Rn,value:a?.trendlineType??"",onChange:l=>{let c=l.target.value;if(!c){r(s,null);return}r(s,{...a,trendlineType:c});},children:qpe.map(l=>jsxRuntime.jsx("option",{value:l.value,children:o(l.labelKey)},l.value))})]}),a&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3 ml-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1 text-[11px] cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!n,checked:a.displayEq??false,onChange:l=>r(s,{...a,displayEq:l.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:o("pptx.chart.trendlineEquation")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1 text-[11px] cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!n,checked:a.displayRSq??false,onChange:l=>r(s,{...a,displayRSq:l.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:o("pptx.chart.trendlineRSquared")})]})]})]},`${i.name}-${s}`)})})]})}function The({title:t,chartType:e,grouping:n,seriesCount:r,categoryCount:o,canEdit:i,onUpdateChartData:s}){let{t:a}=reactI18next.useTranslation(),l=nhe.has(e);return jsxRuntime.jsxs("div",{className:tr,children:[jsxRuntime.jsx("div",{className:er,children:a("pptx.chart.heading")}),jsxRuntime.jsxs("div",{className:"text-[11px] text-muted-foreground mb-1",children:[r," ",a("pptx.chart.series")," \xB7 ",o," ",a("pptx.chart.categories")]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-10 text-muted-foreground shrink-0",children:a("pptx.chart.title")}),jsxRuntime.jsx("input",{type:"text",disabled:!i,className:Rn,value:t??"",onChange:c=>s({title:c.target.value})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-10 text-muted-foreground shrink-0",children:a("pptx.chart.type")}),jsxRuntime.jsx("select",{disabled:!i,className:Rn,value:e,onChange:c=>s({chartType:c.target.value}),children:Vpe.map(c=>jsxRuntime.jsx("option",{value:c.value,children:a(c.labelKey)},c.value))})]}),l&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-10 text-muted-foreground shrink-0",children:a("pptx.chart.grouping")}),jsxRuntime.jsx("select",{disabled:!i,className:Rn,value:n??"clustered",onChange:c=>s({grouping:c.target.value}),children:Gpe.map(c=>jsxRuntime.jsx("option",{value:c.value,children:a(c.labelKey)},c.value))})]})]})}function Che({selectedElement:t,canEdit:e,onUpdateElement:n}){let r=t.chartData,o=r?.title,i=r?.chartType,s=r?.categories,a=r?.series,l=r?.style,c=r?.grouping,d=Jm.useCallback(D=>{n({chartData:D});},[n]),u=Jm.useCallback(D=>{if(r){if(D.chartType&&D.chartType!==r.chartType){let U=XD(r,D.chartType),{chartType:G,...j}=D;d({...U,...j});return}n({chartData:{...r,...D}});}},[r,n,d]),p=Jm.useCallback(D=>{r&&n({chartData:{...r,style:{...l,...D}}});},[r,l,n]),h=Jm.useCallback((D,U)=>{if(!r)return;let G=r.axes?[...r.axes]:[],j=G.findIndex(Y=>Y.axisType===D);j===-1?G.push({axisType:D,...U}):G[j]={...G[j],...U},u({axes:G});},[r,u]),f=Jm.useCallback((D,U)=>{if(!a)return;let G=a.map((j,Y)=>Y===D?{...j,...U}:j);u({series:G});},[a,u]),m=Jm.useCallback((D,U)=>{if(!a)return;let G=a.map((j,Y)=>Y===D?{...j,trendlines:U?[U]:[]}:j);u({series:G});},[a,u]),x=Jm.useCallback((D,U)=>{if(!a)return;let G=a.map((j,Y)=>Y===D?{...j,errBars:U?[U]:[]}:j);u({series:G});},[a,u]),g=Jm.useCallback((D,U)=>{f(D,{color:U??void 0});},[f]),y=Jm.useCallback((D,U)=>{if(!s)return;let G=s.map((j,Y)=>Y===D?U:j);u({categories:G});},[s,u]),b=Jm.useCallback((D,U,G)=>{if(!r)return;let j=Number.parseFloat(G);Number.isFinite(j)&&d(WD(r,D,U,j));},[r,d]),v=Jm.useCallback(()=>{!r||!s||d(jD(r,`Cat ${s.length+1}`));},[r,s,d]),S=Jm.useCallback(D=>{!r||!s||s.length<=1||d(YD(r,D));},[r,s,d]),w=Jm.useCallback(()=>{!r||!s||!a||d(VD(r,{name:`Series ${a.length+1}`,values:s.map(()=>0)}));},[r,s,a,d]),C=Jm.useCallback(D=>{!r||!a||a.length<=1||d(GD(r,D));},[r,a,d]),T=Jm.useCallback(D=>{if(!r)return;let U={...t,chartData:structuredClone(r)};D(U),d(U.chartData);},[r,t,d]),M=Jm.useCallback((D,U)=>T(G=>I3(G,D,U)),[T]),_=Jm.useCallback((D,U)=>T(G=>N3(G,D,U)),[T]),E=Jm.useCallback((D,U,G)=>T(j=>L3(j,D,U,G)),[T]),R=Jm.useCallback((D,U)=>T(G=>D3(G,D,U)),[T]),I=Jm.useCallback((D,U)=>T(G=>F3(G,D,U)),[T]),L=Jm.useCallback((D,U,G)=>T(j=>B3(j,D,U,G)),[T]),k=Jm.useCallback((D,U,G)=>T(j=>U3(j,D,U,G)),[T]),F=Jm.useCallback((D,U,G)=>T(j=>$3(j,D,U,G)),[T]),N=Jm.useCallback((D,U,G)=>T(j=>H3(j,D,U,G!==null?{text:G}:null)),[T]);return !r||!s||!a?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(The,{title:o,chartType:i,grouping:c,seriesCount:a.length,categoryCount:s.length,canEdit:e,onUpdateChartData:u}),jsxRuntime.jsx(xhe,{style:l,canEdit:e,onUpdateStyle:p}),jsxRuntime.jsx(fhe,{style:l,canEdit:e,onUpdateStyle:p}),jsxRuntime.jsx(ahe,{axes:r.axes,canEdit:e,onUpdateAxis:h}),jsxRuntime.jsx(lhe,{axes:r.axes,canEdit:e,onSetLogScale:M,onSetTitleStyle:_,onSetGridlineStyle:E}),jsxRuntime.jsx(bhe,{chartType:i,series:a,canEdit:e,onSetMarker:R}),jsxRuntime.jsx(dhe,{chartType:i,series:a,canEdit:e,onSetSeriesType:I}),jsxRuntime.jsx(ghe,{chartType:i,categories:s,series:a,canEdit:e,onSetPointFill:L,onSetPointExplosion:k,onSetPointLabel:N}),jsxRuntime.jsx(mhe,{chartType:i,categories:s,series:a,canEdit:e,onSetPointMarker:F}),jsxRuntime.jsx(whe,{chartType:i,series:a,canEdit:e,onSetTrendline:m}),jsxRuntime.jsx(yhe,{chartType:i,series:a,canEdit:e,onSetErrorBars:x}),jsxRuntime.jsx(She,{series:a,canEdit:e,onSetColor:g}),jsxRuntime.jsx(hhe,{categories:s,series:a,canEdit:e,onUpdateSeries:f,onUpdateCategoryLabel:y,onUpdateValue:b,onAddCategory:v,onRemoveCategory:S,onAddSeries:w,onRemoveSeries:C})]})}bt();function Mhe({selectedElement:t,canEdit:e,onUpdateElementStyle:n}){return t.type!=="connector"?null:jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Connector"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[["Start","connectorStartArrow"],["End","connectorEndArrow"]].map(([r,o])=>jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsxs("span",{className:"text-muted-foreground",children:[r," Arrow"]}),jsxRuntime.jsxs("select",{disabled:!e,className:ie(an,"w-full"),value:t.shapeStyle?.[o]??"none",onChange:i=>n({[o]:i.target.value}),children:[jsxRuntime.jsx("option",{value:"none",children:"None"}),jsxRuntime.jsx("option",{value:"triangle",children:"Triangle"}),jsxRuntime.jsx("option",{value:"arrow",children:"Arrow"}),jsxRuntime.jsx("option",{value:"stealth",children:"Stealth"}),jsxRuntime.jsx("option",{value:"diamond",children:"Diamond"}),jsxRuntime.jsx("option",{value:"oval",children:"Oval"})]})]},o))})]})}function _he({selectedElement:t}){if(t.type!=="group")return null;let e=t;return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Group"}),jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground",children:Array.isArray(e.children)?`${e.children.length} children`:"Grouped element"})]})}function Phe({selectedElement:t}){let{t:e}=reactI18next.useTranslation();if(t.type!=="ole")return null;let n=t;return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:e("pptx.ole.title")}),jsxRuntime.jsxs("div",{className:"space-y-1.5 text-[11px]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:e("pptx.ole.type")}),jsxRuntime.jsx("span",{className:"text-foreground truncate",children:bD(n.oleObjectType)})]}),n.fileName&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:e("pptx.ole.fileName")}),jsxRuntime.jsx("span",{className:"text-foreground truncate",title:n.fileName,children:n.fileName})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:e("pptx.ole.linkStatus")}),jsxRuntime.jsx("span",{className:ie("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",n.isLinked?"bg-blue-500/20 text-blue-400":"bg-green-500/20 text-green-400"),children:n.isLinked?e("pptx.ole.linked"):e("pptx.ole.embedded")})]})]})]})}function Ehe({selectedElement:t,canEdit:e,onUpdateElement:n}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Transform"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Rotation (\xB0)"}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:an,value:Math.round(t.rotation||0),onChange:r=>n({rotation:Number(r.target.value)})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Opacity"}),jsxRuntime.jsx("input",{type:"range",disabled:!e,min:0,max:100,value:Math.round((t.opacity??1)*100),className:"accent-primary",onChange:r=>n({opacity:Number(r.target.value)/100})})]})]})]})}function Ahe({canEdit:t,onMoveLayer:e}){return jsxRuntime.jsxs("div",{className:"flex gap-1",children:[jsxRuntime.jsx("button",{type:"button",className:ie("flex-1",xr),disabled:!t,onClick:()=>e("forward"),children:"\u2191 Forward"}),jsxRuntime.jsx("button",{type:"button",className:ie("flex-1",xr),disabled:!t,onClick:()=>e("backward"),children:"\u2193 Backward"})]})}Pe();function khe({imgSrc:t,fx:e,canEdit:n,updateEffects:r}){let{t:o}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.image.artisticEffects")}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-1",children:tre.map(([i,s,a])=>{let l=i==="none"?!e?.artisticEffect:e?.artisticEffect===i;return jsxRuntime.jsxs("button",{type:"button",disabled:!n,className:ie("flex flex-col items-center gap-0.5 rounded border p-0.5 hover:bg-accent/50",l?"border-primary bg-primary/10":"border-border"),title:o(s),onClick:()=>r({artisticEffect:i==="none"?void 0:i,...i==="grayscale"?{grayscale:void 0}:{}}),children:[jsxRuntime.jsx("div",{className:"w-10 h-7 rounded overflow-hidden bg-muted",style:{backgroundImage:t?`url(${t})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:a||void 0}}),jsxRuntime.jsx("span",{className:"text-[8px] text-muted-foreground truncate w-full text-center",children:o(s)})]},i)})})]})}function Ihe({fx:t,canEdit:e,updateEffects:n}){let{t:r}=reactI18next.useTranslation(),o=t?.clrChange;return jsxRuntime.jsxs("div",{className:"space-y-1 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorChange")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!o,onChange:i=>n({clrChange:i.target.checked?{clrFrom:"#ffffff",clrTo:"#000000",clrToTransparent:false}:void 0})})]}),o&&jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorChangeFrom")}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(o.clrFrom,"#ffffff"),className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:i=>n({clrChange:{...o,clrFrom:i,clrTo:o.clrTo??"#000000"}})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorChangeTo")}),jsxRuntime.jsx(Lo,{disabled:!e||!!o.clrToTransparent,value:et(o.clrTo,"#000000"),className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:i=>n({clrChange:{...o,clrFrom:o.clrFrom??"#ffffff",clrTo:i}})})]}),jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2 col-span-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorChangeTransparent")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!o.clrToTransparent,onChange:i=>n({clrChange:{clrFrom:o.clrFrom??"#ffffff",clrTo:o.clrTo??"#000000",clrToTransparent:i.target.checked}})})]})]})]})}function Nhe({fx:t,canEdit:e,updateEffects:n}){let{t:r}=reactI18next.useTranslation(),o=t?.colorWash;return jsxRuntime.jsxs("div",{className:"space-y-1 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.colorWash")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!o,onChange:i=>n({colorWash:i.target.checked?{color:"#0066cc",opacity:40}:void 0})})]}),o&&jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.washColor")}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(o.color,"#0066cc"),className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:i=>n({colorWash:{color:i,opacity:o.opacity??40}})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.washOpacity")}),jsxRuntime.jsx("input",{type:"range",min:0,max:100,disabled:!e,className:"accent-primary",value:o.opacity,onChange:i=>n({colorWash:{color:o.color??"#0066cc",opacity:Number(i.target.value)}})})]})]})]})}function Fhe({value:t,disabled:e,className:n,onCommit:r}){let[o,i]=Jm.useState(t),s=Jm.useRef(r);s.current=r,Jm.useEffect(()=>{i(t);},[t]);let a=Jm.useCallback(d=>{i(d.target.value);},[]),l=Jm.useCallback(()=>{s.current(o);},[o]),c=Jm.useRef(null);return Jm.useEffect(()=>{let d=c.current;if(!d)return;let u=()=>{s.current(d.value);};return d.addEventListener("change",u),()=>d.removeEventListener("change",u)},[]),jsxRuntime.jsx("input",{ref:c,type:"color",disabled:e,className:n,value:o,onChange:a,onBlur:l})}function Ohe({selectedElement:t,canEdit:e,onUpdateElement:n}){let{t:r}=reactI18next.useTranslation(),o="imageEffects"in t?t.imageEffects:void 0,i=Jm.useCallback((c,d)=>{n({imageEffects:{...o,duotone:{color1:c,color2:d}}});},[o,n]),s=Jm.useCallback(()=>{n({imageEffects:{...o,duotone:void 0}});},[o,n]),a=et(o?.duotone?.color1,"#000000"),l=et(o?.duotone?.color2,"#ffffff");return jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px]",children:[jsxRuntime.jsx("div",{className:"text-muted-foreground font-medium",children:r("pptx.image.duotone")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.duotoneShadows")}),jsxRuntime.jsx(Fhe,{disabled:!e,value:a,className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:c=>i(c,l)})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.image.duotoneHighlights")}),jsxRuntime.jsx(Fhe,{disabled:!e,value:l,className:"h-6 w-8 rounded border border-border bg-transparent cursor-pointer",onCommit:c=>i(a,c)})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"text-muted-foreground text-[10px]",children:r("pptx.image.duotonePresets")}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-1",children:$U.map(c=>jsxRuntime.jsxs("button",{type:"button",disabled:!e,className:"flex flex-col items-center gap-0.5 rounded border border-border hover:bg-accent p-1 transition-colors",title:r(c.labelKey),onClick:()=>i(c.shadow,c.highlight),children:[jsxRuntime.jsxs("div",{className:"flex h-4 w-full rounded overflow-hidden",children:[jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:c.shadow}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:c.highlight}})]}),jsxRuntime.jsx("span",{className:"text-[8px] text-muted-foreground truncate w-full text-center",children:r(c.labelKey)})]},c.labelKey))})]}),o?.duotone&&jsxRuntime.jsx("button",{type:"button",disabled:!e,className:"w-full rounded bg-muted hover:bg-accent border border-border px-2 py-1 text-foreground transition-colors",onClick:s,children:r("pptx.image.duotoneClear")})]})}function Bhe({selectedElement:t,canEdit:e,onUpdateElement:n}){let{t:r}=reactI18next.useTranslation(),o=Jm.useMemo(()=>"imageEffects"in t?t.imageEffects:void 0,[t]),s=100-(o?.alphaModFix??100),a=o?.biLevel??0,l=o?.alphaModFix!==void 0||o?.biLevel!==void 0,c=Jm.useCallback(h=>{n({imageEffects:{...o,...h}});},[o,n]),d=Jm.useCallback(h=>{let f=Number(h.target.value);c({alphaModFix:100-f});},[c]),u=Jm.useCallback(h=>{c({biLevel:Number(h.target.value)});},[c]),p=Jm.useCallback(()=>{c({alphaModFix:void 0,biLevel:void 0});},[c]);return jsxRuntime.jsxs("div",{className:"space-y-3 text-[11px]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground font-medium",children:r("pptx.imageAdjustments.title")}),l&&jsxRuntime.jsx("button",{type:"button",disabled:!e,className:"rounded bg-muted hover:bg-accent border border-border px-1.5 py-0.5 text-[10px] text-foreground disabled:opacity-50",onClick:p,children:r("common.reset")})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.imageAdjustments.transparency")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"range",min:0,max:100,step:1,disabled:!e,className:"accent-primary flex-1",value:s,onChange:d}),jsxRuntime.jsxs("span",{className:"w-8 text-right tabular-nums text-muted-foreground",children:[s,"%"]})]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r("pptx.imageAdjustments.biLevelThreshold")}),jsxRuntime.jsx("p",{className:"text-[10px] text-muted-foreground/70",children:r("pptx.imageAdjustments.biLevelDescription")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"range",min:0,max:100,step:1,disabled:!e,className:"accent-primary flex-1",value:a,onChange:u}),jsxRuntime.jsx("span",{className:"w-8 text-right tabular-nums text-muted-foreground",children:a})]})]})]})}function GN({label:t,disabled:e,value:n,onChange:r}){return jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:t}),jsxRuntime.jsx("input",{type:"range",min:-100,max:100,disabled:e,className:"accent-primary",value:n,onChange:o=>r(Number(o.target.value))})]})}function $he({selectedElement:t,canEdit:e,onUpdateElement:n}){let{t:r}=reactI18next.useTranslation(),o=t.imageEffects,i=s=>{n({imageEffects:{...o,...s}});};return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:r("pptx.image.properties")}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Alt Text"}),jsxRuntime.jsx("textarea",{rows:2,disabled:!e,className:ie(an,"resize-none text-[11px]"),value:t.altText??"",onChange:s=>n({altText:s.target.value})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsx(GN,{label:"Brightness",disabled:!e,value:o?.brightness??0,onChange:s=>i({brightness:s})}),jsxRuntime.jsx(GN,{label:"Contrast",disabled:!e,value:o?.contrast??0,onChange:s=>i({contrast:s})}),jsxRuntime.jsx(GN,{label:r("pptx.image.saturation"),disabled:!e,value:o?.saturation??0,onChange:s=>i({saturation:s})})]}),jsxRuntime.jsx(Bhe,{selectedElement:t,canEdit:e,onUpdateElement:n}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Grayscale"}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!o?.grayscale,onChange:s=>i({grayscale:s.target.checked})})]}),jsxRuntime.jsx(Ohe,{selectedElement:t,canEdit:e,onUpdateElement:n})]}),jsxRuntime.jsx(Nhe,{fx:o,canEdit:e,updateEffects:i}),jsxRuntime.jsx(Ihe,{fx:o,canEdit:e,updateEffects:i}),jsxRuntime.jsx(khe,{imgSrc:t.imageData,fx:o,canEdit:e,updateEffects:i}),jsxRuntime.jsx("button",{type:"button",disabled:!e,className:"w-full text-[11px] rounded bg-muted hover:bg-accent border border-border px-2 py-1 text-foreground",onClick:()=>n({imageEffects:{brightness:0,contrast:0,saturation:0,grayscale:false,artisticEffect:void 0,colorWash:void 0,alphaModFix:void 0,biLevel:void 0,duotone:void 0},cropShape:"none"}),children:r("pptx.image.resetImage")})]})]})}var Mat="text-[11px] uppercase tracking-wide text-muted-foreground",_at="rounded border border-border bg-card p-2 space-y-2",Pat="flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",Eat="rounded bg-muted hover:bg-accent px-2 py-1 text-[11px] transition-colors",Aat="flex items-center justify-between gap-2",Whe="text-muted-foreground";function WN(t){if(!Number.isFinite(t)||t<0)return "00:00";let e=Math.round(t/1e3),n=Math.floor(e/60),r=e%60;return `${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function Vhe(t){let e=t.trim();if(e.length===0)return;let n=e.indexOf(":");if(n>=0){let o=e.slice(0,n),i=e.slice(n+1),s=parseInt(o,10),a=parseInt(i,10);return !Number.isFinite(s)||!Number.isFinite(a)||s<0||a<0||a>=60?void 0:(s*60+a)*1e3}let r=parseInt(e,10);if(!(!Number.isFinite(r)||r<0))return r*1e3}function Rat(t,e,n){return t<0||e<0?"pptx.media.trimErrorNegative":e>0&&t>=e?"pptx.media.trimErrorStartAfterEnd":n>0&&t>n||n>0&&e>n?"pptx.media.trimErrorBeyondDuration":null}function Ghe({label:t,valueMs:e,maxMs:n,disabled:r,onChange:o}){let[i,s]=Jm.useState(null),[a,l]=Jm.useState(false),c=i??WN(e),d=Jm.useCallback(()=>{s(WN(e)),l(false);},[e]),u=Jm.useCallback(()=>{if(i!==null){let f=Vhe(i);f!==void 0&&f>=0&&(n<=0||f<=n)&&o(f),l(false);}s(null);},[i,n,o]),p=Jm.useCallback(f=>{let m=f.target.value;s(m);let x=Vhe(m);l(x===void 0);},[]),h=Jm.useCallback(f=>{f.key==="Enter"?f.currentTarget.blur():f.key==="Escape"&&(s(null),l(false));},[]);return jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Whe}`,children:t}),jsxRuntime.jsx("input",{type:"text",disabled:r,className:`${Pat} text-[11px] tabular-nums ${a?"border-red-400":""}`,value:c,placeholder:"00:00",onFocus:d,onBlur:u,onChange:p,onKeyDown:h})]})}function Xhe({element:t,canEdit:e,durationSeconds:n,onUpdateElement:r}){let{t:o}=reactI18next.useTranslation(),i=t.trimStartMs??0,s=t.trimEndMs??0,a=n*1e3,l=Jm.useMemo(()=>{let f=i,m=s>0?s:a;return m<=f||a<=0?WN(a):WN(m-f)},[i,s,a]),c=Jm.useMemo(()=>Rat(i,s,a),[i,s,a]),d=i>0||s>0,u=Jm.useCallback(f=>{r({trimStartMs:f});},[r]),p=Jm.useCallback(f=>{r({trimEndMs:f});},[r]),h=Jm.useCallback(()=>{r({trimStartMs:0,trimEndMs:0});},[r]);return jsxRuntime.jsxs("div",{className:_at,children:[jsxRuntime.jsxs("div",{className:Mat,children:[jsxRuntime.jsx(lu$1.LuScissors,{className:"inline w-3 h-3 mr-1"}),o("pptx.media.trim")]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsx(Ghe,{label:o("pptx.media.trimStartTime"),valueMs:i,maxMs:a,disabled:!e,onChange:u}),jsxRuntime.jsx(Ghe,{label:o("pptx.media.trimEndTime"),valueMs:s,maxMs:a,disabled:!e,onChange:p})]}),jsxRuntime.jsxs("div",{className:Aat,children:[jsxRuntime.jsxs("span",{className:`text-[11px] ${Whe}`,children:[jsxRuntime.jsx(lu$1.LuClock,{className:"inline w-3 h-3 mr-1"}),o("pptx.media.trimmedDuration")]}),jsxRuntime.jsx("span",{className:"text-[11px] tabular-nums font-medium",children:l})]}),c&&jsxRuntime.jsx("div",{className:"text-[10px] text-red-400",children:o(c)}),e&&d&&jsxRuntime.jsx("button",{type:"button",className:`${Eat} w-full text-center`,onClick:h,children:o("pptx.media.resetTrim")})]})}function jh(t){let e=Math.floor(t/60),n=Math.floor(t%60),r=Math.round(t%1*10);return `${e}:${String(n).padStart(2,"0")}.${r}`}function jhe(){return `bmk-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}var uv="text-[11px] uppercase tracking-wide text-muted-foreground",pv="rounded border border-border bg-card p-2 space-y-2",A2="flex-1 bg-muted border border-border rounded px-1.5 py-0.5 w-full",XN="rounded bg-muted hover:bg-accent px-2 py-1 text-[11px] transition-colors",il="flex items-center justify-between gap-2",Ki="text-muted-foreground";function Yhe({duration:t,trimStartMs:e,trimEndMs:n,currentTime:r,bookmarks:o,canEdit:i,onTrimChange:s,onSeek:a}){let l=Jm.useRef(null),[c,d]=Jm.useState(null),u=e/1e3,p=n>0?n/1e3:t,h=t>0?t:1,f=u/h*100,m=p/h*100,x=r/h*100,g=Jm.useCallback(b=>{let v=l.current;if(!v)return 0;let S=v.getBoundingClientRect();return Math.max(0,Math.min(1,(b-S.left)/S.width))*h},[h]);Jm.useEffect(()=>{if(!c)return;let b=S=>{let w=g(S.clientX);if(c==="start"){let C=Math.min(w,p-.1);s(Math.max(0,C)*1e3,n);}else {let C=Math.max(w,u+.1);s(e,Math.min(C,t)*1e3);}},v=()=>{d(null);};return window.addEventListener("pointermove",b),window.addEventListener("pointerup",v),()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",v);}},[c,t,g,s,n,p,e,u]);let y=b=>{let v=g(b.clientX);a(v);};return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[jsxRuntime.jsx("span",{children:jh(u)}),jsxRuntime.jsx("span",{children:jh(p)})]}),jsxRuntime.jsxs("div",{ref:l,className:"relative h-5 rounded bg-muted cursor-pointer select-none",onClick:y,children:[jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 bg-primary/30 rounded",style:{left:`${f}%`,width:`${m-f}%`}}),jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-white z-10",style:{left:`${Math.min(x,100)}%`}}),i&&jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 w-2 bg-primary rounded-l cursor-ew-resize z-20 hover:bg-primary/80",style:{left:`calc(${f}% - 4px)`},onPointerDown:b=>{b.stopPropagation(),d("start");}}),i&&jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 w-2 bg-primary rounded-r cursor-ew-resize z-20 hover:bg-primary/80",style:{left:`calc(${m}% - 4px)`},onPointerDown:b=>{b.stopPropagation(),d("end");}}),o.map(b=>{let v=b.time/h*100;return jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 w-1 bg-yellow-400/70 z-10 cursor-pointer",style:{left:`${v}%`},title:b.label,onClick:S=>{S.stopPropagation(),a(b.time);}},b.id)})]})]})}function qhe({element:t,canEdit:e,currentTime:n,bookmarks:r,onUpdateElement:o,onSeekTo:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState(""),c=Math.round((t.volume??1)*100),d=Jm.useCallback(()=>{let p=a.trim()||`${s("pptx.media.bookmark")} ${r.length+1}`,h={id:jhe(),time:n,label:p};o({bookmarks:[...r,h]}),l("");},[r,n,a,o,s]),u=Jm.useCallback(p=>{o({bookmarks:r.filter(h=>h.id!==p)});},[r,o]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:pv,children:[jsxRuntime.jsx("div",{className:uv,children:s("pptx.media.playback")}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.volume")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-1 max-w-[140px]",children:[jsxRuntime.jsx("input",{type:"range",min:0,max:100,step:1,disabled:!e,className:"flex-1",value:c,onChange:p=>o({volume:Number(p.target.value)/100})}),jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground w-7 text-right tabular-nums",children:[c,"%"]})]})]}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.speed")}),jsxRuntime.jsxs("select",{disabled:!e,className:`${A2} text-[11px] max-w-[100px]`,value:t.playbackSpeed??1,onChange:p=>o({playbackSpeed:Number(p.target.value)}),children:[jsxRuntime.jsx("option",{value:.25,children:"0.25x"}),jsxRuntime.jsx("option",{value:.5,children:"0.5x"}),jsxRuntime.jsx("option",{value:.75,children:"0.75x"}),jsxRuntime.jsx("option",{value:1,children:"1x"}),jsxRuntime.jsx("option",{value:1.25,children:"1.25x"}),jsxRuntime.jsx("option",{value:1.5,children:"1.5x"}),jsxRuntime.jsx("option",{value:2,children:"2x"}),jsxRuntime.jsx("option",{value:3,children:"3x"}),jsxRuntime.jsx("option",{value:4,children:"4x"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.fadeIn")}),jsxRuntime.jsx("input",{type:"number",min:0,step:.1,disabled:!e,className:`${A2} text-[11px]`,value:t.fadeInDuration??0,onChange:p=>o({fadeInDuration:Number(p.target.value)||void 0})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.fadeOut")}),jsxRuntime.jsx("input",{type:"number",min:0,step:.1,disabled:!e,className:`${A2} text-[11px]`,value:t.fadeOutDuration??0,onChange:p=>o({fadeOutDuration:Number(p.target.value)||void 0})})]})]}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.loop")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!t.loop,onChange:p=>o({loop:p.target.checked||void 0})})]}),jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.startTrigger")}),jsxRuntime.jsxs("select",{disabled:!e,className:"text-[11px] bg-transparent border border-border rounded px-1 py-0.5",value:t.autoPlay?"auto":"onClick",onChange:p=>o({autoPlay:p.target.value==="auto"||void 0}),children:[jsxRuntime.jsx("option",{value:"onClick",children:s("pptx.media.startOnClick")}),jsxRuntime.jsx("option",{value:"auto",children:s("pptx.media.startAutomatically")})]})]}),t.mediaType==="audio"&&jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.playAcrossSlides")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!t.playAcrossSlides,onChange:p=>o({playAcrossSlides:p.target.checked||void 0,...p.target.checked?{autoPlay:true}:{}})})]}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.fullScreen")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!t.fullScreen,onChange:p=>o({fullScreen:p.target.checked||void 0})})]}),jsxRuntime.jsxs("label",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:s("pptx.media.hideWhenNotPlaying")}),jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!t.hideWhenNotPlaying,onChange:p=>o({hideWhenNotPlaying:p.target.checked||void 0})})]})]}),jsxRuntime.jsxs("div",{className:pv,children:[jsxRuntime.jsxs("div",{className:uv,children:[jsxRuntime.jsx(lu$1.LuBookmark,{className:"inline w-3 h-3 mr-1"}),s("pptx.media.bookmarks")]}),r.length>0&&jsxRuntime.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:r.slice().sort((p,h)=>p.time-h.time).map(p=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1 text-[11px] group",children:[jsxRuntime.jsx("button",{type:"button",className:"text-primary hover:text-primary/80 truncate flex-1 text-left",onClick:()=>i(p.time),title:s("pptx.media.seekToBookmark"),children:p.label}),jsxRuntime.jsx("span",{className:"text-muted-foreground tabular-nums text-[10px]",children:jh(p.time)}),e&&jsxRuntime.jsx("button",{type:"button",className:"opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-300 transition-opacity",onClick:()=>u(p.id),title:s("common.remove"),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"})})]},p.id))}),e&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("input",{type:"text",className:`${A2} text-[11px]`,placeholder:s("pptx.media.bookmarkLabel"),value:a,onChange:p=>l(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),d());}}),jsxRuntime.jsx("button",{type:"button",className:XN,onClick:d,title:s("pptx.media.addBookmark"),children:jsxRuntime.jsx(lu$1.LuPlus,{className:"w-3 h-3"})})]})]})]})}function Jhe({element:t,mediaDataUrls:e,canEdit:n,onUpdateElement:r}){let{t:o}=reactI18next.useTranslation(),i=Jm.useRef(null),[s,a]=Jm.useState(false),[l,c]=Jm.useState(0),[d,u]=Jm.useState(0),p=t.mediaData??(t.mediaPath?e.get(t.mediaPath):void 0),h=t.bookmarks??[],f=t.mediaType==="video";Jm.useEffect(()=>{let v=i.current;if(!v)return;let S=()=>c(v.currentTime),w=()=>{Number.isFinite(v.duration)&&u(v.duration);},C=()=>a(true),T=()=>a(false),M=()=>a(false);return v.addEventListener("timeupdate",S),v.addEventListener("durationchange",w),v.addEventListener("loadedmetadata",w),v.addEventListener("play",C),v.addEventListener("pause",T),v.addEventListener("ended",M),()=>{v.removeEventListener("timeupdate",S),v.removeEventListener("durationchange",w),v.removeEventListener("loadedmetadata",w),v.removeEventListener("play",C),v.removeEventListener("pause",T),v.removeEventListener("ended",M);}},[p]);let m=Jm.useCallback(()=>{let v=i.current;v&&(v.paused?v.play():v.pause());},[]),x=Jm.useCallback(v=>{let S=i.current;S&&(S.currentTime=v,c(v));},[]),g=Jm.useCallback((v,S)=>{r({trimStartMs:v,trimEndMs:S});},[r]),[y,b]=Jm.useState(t.metadata);return Jm.useEffect(()=>{let v=i.current;if(!v)return;if(t.metadata?.duration!==void 0){b(t.metadata);return}let S=()=>{if(!Number.isFinite(v.duration)||v.duration===0)return;let w={duration:v.duration};v instanceof HTMLVideoElement&&(v.videoWidth>0&&(w.videoWidth=v.videoWidth),v.videoHeight>0&&(w.videoHeight=v.videoHeight));let C=v.querySelector("source");C?.type&&(w.codecInfo=C.type),t.metadata=w,b(w);};return v.addEventListener("loadedmetadata",S),v.readyState>=1&&S(),()=>{v.removeEventListener("loadedmetadata",S);}},[p,t]),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:pv,children:[jsxRuntime.jsx("div",{className:uv,children:o("pptx.media.title")}),jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground",children:o(f?"pptx.media.videoClip":"pptx.media.audioClip")}),p&&jsxRuntime.jsxs("div",{className:"space-y-1",children:[f?jsxRuntime.jsx("video",{ref:i,className:"w-full rounded bg-black max-h-32 object-contain",src:p,preload:"metadata"}):jsxRuntime.jsx("audio",{ref:i,className:"w-full",src:p,preload:"metadata"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{type:"button",className:XN,onClick:m,title:o(s?"pptx.media.pause":"pptx.media.play"),children:s?jsxRuntime.jsx(lu$1.LuPause,{className:"w-3 h-3"}):jsxRuntime.jsx(lu$1.LuPlay,{className:"w-3 h-3"})}),jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:[jh(l)," / ",jh(d)]})]})]}),d>0&&jsxRuntime.jsx(Yhe,{duration:d,trimStartMs:t.trimStartMs??0,trimEndMs:t.trimEndMs??0,currentTime:l,bookmarks:h,canEdit:n,onTrimChange:g,onSeek:x})]}),jsxRuntime.jsx(Xhe,{element:t,canEdit:n,durationSeconds:d,onUpdateElement:r}),(y||t.posterFrameData)&&jsxRuntime.jsxs("div",{className:pv,children:[jsxRuntime.jsxs("div",{className:uv,children:[jsxRuntime.jsx(lu$1.LuInfo,{className:"inline w-3 h-3 mr-1"}),o("pptx.media.info")]}),t.posterFrameData&&jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:`text-[11px] ${Ki}`,children:o("pptx.media.posterFrame")}),jsxRuntime.jsx("img",{src:t.posterFrameData,alt:o("pptx.media.posterFrame"),className:"w-full max-h-20 object-contain rounded bg-black/20"})]}),y?.duration!==void 0&&jsxRuntime.jsxs("div",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:o("pptx.media.duration")}),jsxRuntime.jsx("span",{className:"text-[11px] tabular-nums",children:jh(y.duration)})]}),y?.videoWidth!==void 0&&y?.videoHeight!==void 0&&jsxRuntime.jsxs("div",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:o("pptx.media.resolution")}),jsxRuntime.jsxs("span",{className:"text-[11px] tabular-nums",children:[y.videoWidth," x ",y.videoHeight]})]}),y?.codecInfo&&jsxRuntime.jsxs("div",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:o("pptx.media.format")}),jsxRuntime.jsx("span",{className:"text-[11px] truncate max-w-[140px]",title:y.codecInfo,children:y.codecInfo})]}),t.mediaPath&&jsxRuntime.jsxs("div",{className:il,children:[jsxRuntime.jsx("span",{className:`text-[11px] ${Ki}`,children:o("pptx.media.filePath")}),jsxRuntime.jsx("span",{className:"text-[10px] truncate max-w-[140px] text-muted-foreground",title:t.mediaPath,children:t.mediaPath.split("/").pop()})]})]}),jsxRuntime.jsx(qhe,{element:t,canEdit:n,currentTime:l,bookmarks:h,onUpdateElement:r,onSeekTo:x})]})}bt();function Qhe({selectedElement:t,canEdit:e,onUpdateElement:n,onUpdateElementStyle:r,onUpdateTextStyle:o}){let{t:i}=reactI18next.useTranslation();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Jt(t)&&jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:i("pptx.shape.type","Shape Type")}),jsxRuntime.jsx("select",{value:t.shapeType||"rect",disabled:!e,className:ie(an,"w-full"),onChange:s=>n({shapeType:s.target.value}),children:Bm.filter(s=>s.type!=="connector").map(s=>jsxRuntime.jsx("option",{value:s.type,children:s.label},s.type))})]}),Jt(t)&&jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:i("pptx.shape.fillStroke","Fill & Stroke")}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Fill"}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(t.shapeStyle?.fillColor,"#3b82f6"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:s=>r({fillColor:s,fillMode:"solid"})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Stroke"}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(t.shapeStyle?.strokeColor,"#1f2937"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:s=>r({strokeColor:s})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1 col-span-2",children:[jsxRuntime.jsx("span",{className:"w-16 text-muted-foreground",children:"Stroke W"}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:an,min:0,max:20,value:t.shapeStyle?.strokeWidth??1,onChange:s=>r({strokeWidth:Number(s.target.value)})})]})]})]}),ze(t)&&jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:i("pptx.text.title","Text")}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Size"}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:an,min:6,max:200,value:t.textStyle?.fontSize??18,onChange:s=>o({fontSize:Number(s.target.value)})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Color"}),jsxRuntime.jsx(Lo,{disabled:!e,value:et(t.textStyle?.color,"#000000"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:s=>o({color:s})})]}),jsxRuntime.jsxs("div",{className:"flex gap-1 col-span-2",children:[jsxRuntime.jsx(QV,{label:"B",active:!!t.textStyle?.bold,disabled:!e,onClick:()=>o({bold:!t.textStyle?.bold})}),jsxRuntime.jsx(QV,{label:"I",active:!!t.textStyle?.italic,disabled:!e,italic:true,onClick:()=>o({italic:!t.textStyle?.italic})}),jsxRuntime.jsx(QV,{label:"U",active:!!t.textStyle?.underline,disabled:!e,underline:true,onClick:()=>o({underline:!t.textStyle?.underline})})]})]})]})]})}function QV({label:t,active:e,disabled:n,italic:r,underline:o,onClick:i}){return jsxRuntime.jsx("button",{type:"button",disabled:n,className:ie("px-2 py-1 rounded text-[11px] transition-colors",r&&"italic",o&&"underline",e?"bg-primary text-white":"bg-muted hover:bg-accent"),onClick:i,children:t})}bt();Pe();var Yat={venn:{min:2,max:3},matrix:{min:4,max:4},pyramid:{min:2,max:5},funnel:{min:2,max:5},target:{min:2,max:5},gear:{min:2,max:3},cycle:{min:3}},efe={min:1};function eG(t){return t?Yat[t]??efe:efe}function tG(t,e){let{max:n}=eG(t);return n===void 0||e<n}function YN(t,e){let{min:n}=eG(t);return e>n}function tfe(t){let{min:e,max:n}=eG(t);if(!(e<=1&&n===void 0))return n===void 0?`Works best with at least ${e} items.`:e===n?`This layout uses exactly ${n} items.`:`Works best with ${e} to ${n} items.`}bt();function nfe(t,e){let n=UD(t,"",e);if(n===t)return;let r=n.nodes.findIndex(i=>i.id===e),o=r>=0?n.nodes[r+1]:void 0;return {data:n,focusNodeId:o?.id}}function rfe(t,e){if(t.nodes.length<=1)return;let n=t.nodes.findIndex(i=>i.id===e),r=lS(t,e);if(r===t)return;let o=r.nodes[Math.max(0,n-1)];return {data:r,focusNodeId:o?.id}}function ofe(t,e){let n=zD(t,e);return n===t?void 0:n}function ife(t,e){let n=HD(t,e);return n===t?void 0:n}function sfe(t,e,n){let r=$D(t,e,n);return r===t?void 0:r}function afe(t,e){let n=t.nodes.find(o=>o.id===e);return n?t.nodes.filter(o=>o.parentId===n.parentId).findIndex(o=>o.id===e):-1}function lfe(t,e){let n=t.nodes.find(r=>r.id===e);return n?t.nodes.filter(r=>r.parentId===n.parentId).length:0}bt();function Kat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"2",y:"10",width:"10",height:"12",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M14 16 L17 16",stroke:"currentColor",strokeWidth:"1.5",opacity:.5}),jsxRuntime.jsx("rect",{x:"19",y:"10",width:"10",height:"12",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M31 16 L34 16",stroke:"currentColor",strokeWidth:"1.5",opacity:.5}),jsxRuntime.jsx("rect",{x:"36",y:"10",width:"10",height:"12",rx:"2",fill:"currentColor",opacity:.7})]})}function qat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"17",y:"2",width:"14",height:"8",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M24 10 L12 18 M24 10 L36 18",stroke:"currentColor",strokeWidth:"1",opacity:.5}),jsxRuntime.jsx("rect",{x:"4",y:"18",width:"14",height:"8",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"30",y:"18",width:"14",height:"8",rx:"2",fill:"currentColor",opacity:.7})]})}function Zat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"24",cy:"5",r:"4",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"37",cy:"20",r:"4",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"11",cy:"20",r:"4",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M28 6 L34 17 M33 23 L14 23 M14 18 L20 7",stroke:"currentColor",strokeWidth:"1",opacity:.4,fill:"none"})]})}function Jat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"4",y:"3",width:"18",height:"11",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"26",y:"3",width:"18",height:"11",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"4",y:"18",width:"18",height:"11",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"26",y:"18",width:"18",height:"11",rx:"2",fill:"currentColor",opacity:.7})]})}function Qat(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"16",y:"2",width:"16",height:"8",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"10",y:"12",width:"28",height:"8",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"4",y:"22",width:"40",height:"8",rx:"2",fill:"currentColor",opacity:.7})]})}function elt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"4",y:"3",width:"40",height:"7",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"4",y:"13",width:"40",height:"7",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"4",y:"23",width:"40",height:"7",rx:"2",fill:"currentColor",opacity:.7})]})}function tlt(){return jsxRuntime.jsx("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:jsxRuntime.jsx("path",{d:"M4 3 L44 3 L28 16 L28 29 L20 29 L20 16 Z",fill:"currentColor",opacity:.7})})}function nlt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"24",cy:"16",r:"14",fill:"currentColor",opacity:.3}),jsxRuntime.jsx("circle",{cx:"24",cy:"16",r:"9",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("circle",{cx:"24",cy:"16",r:"4",fill:"currentColor",opacity:.8})]})}function rlt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"9",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"3",fill:"white",opacity:.9}),jsxRuntime.jsx("circle",{cx:"33",cy:"16",r:"6",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("circle",{cx:"33",cy:"16",r:"2",fill:"white",opacity:.9})]})}function olt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"19",cy:"16",r:"11",fill:"currentColor",opacity:.45}),jsxRuntime.jsx("circle",{cx:"29",cy:"16",r:"11",fill:"currentColor",opacity:.45})]})}function ilt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("path",{d:"M4 16 L44 16",stroke:"currentColor",strokeWidth:"1.5",opacity:.5}),jsxRuntime.jsx("circle",{cx:"10",cy:"16",r:"3",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"24",cy:"16",r:"3",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("circle",{cx:"38",cy:"16",r:"3",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("rect",{x:"6",y:"4",width:"8",height:"6",rx:"1",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("rect",{x:"34",y:"4",width:"8",height:"6",rx:"1",fill:"currentColor",opacity:.5})]})}function slt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"14",cy:"16",r:"10",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("circle",{cx:"34",cy:"16",r:"10",fill:"currentColor",opacity:.5}),jsxRuntime.jsx("path",{d:"M14 6 L34 26 M34 6 L14 26",stroke:"currentColor",strokeWidth:"1",opacity:.3})]})}function alt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("path",{d:"M2 8 L14 8 L20 16 L14 24 L2 24 L8 16 Z",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M17 8 L29 8 L35 16 L29 24 L17 24 L23 16 Z",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M32 8 L44 8 L44 24 L32 24 L38 16 Z",fill:"currentColor",opacity:.7})]})}function llt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 48 32",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"11",height:"9",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M13 7 L20 7 L20 16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:.5}),jsxRuntime.jsx("rect",{x:"19",y:"12",width:"11",height:"9",rx:"2",fill:"currentColor",opacity:.7}),jsxRuntime.jsx("path",{d:"M30 16 L37 16 L37 25",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:.5}),jsxRuntime.jsx("rect",{x:"35",y:"21",width:"11",height:"9",rx:"2",fill:"currentColor",opacity:.7})]})}var cfe={process:Kat,hierarchy:qat,cycle:Zat,matrix:Jat,pyramid:Qat,list:elt,funnel:tlt,target:nlt,gear:rlt,venn:olt,timeline:ilt,relationship:slt,chevron:alt,bending:llt};var dlt=d_.map(t=>({type:t,i18nKey:`pptx.smartart.category.${t}`}));function ufe({smartArtData:t,canEdit:e,onUpdateSmartArt:n}){let{t:r}=reactI18next.useTranslation(),o=t.resolvedLayoutType??"list",i=s=>{if(!e||s===o)return;let a=KD(t,s);n({layoutType:a.layoutType,resolvedLayoutType:a.resolvedLayoutType,layout:a.layout,drawingShapes:a.drawingShapes});};return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("span",{className:"text-[11px] text-muted-foreground",children:r("pptx.smartart.switchLayout")}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:dlt.map(({type:s,i18nKey:a})=>{let l=o===s,c=cfe[s];return jsxRuntime.jsxs("button",{type:"button",disabled:!e,className:ie("flex flex-col items-center gap-0.5 rounded border p-1.5 transition-colors","text-[9px] leading-tight",l?"border-primary bg-primary/15 text-primary":"border-border text-muted-foreground hover:bg-muted hover:text-foreground",!e&&"opacity-50 cursor-not-allowed"),onClick:()=>i(s),title:r(a),children:[jsxRuntime.jsx("div",{className:"w-10 h-7",children:c?jsxRuntime.jsx(c,{}):null}),jsxRuntime.jsx("span",{className:"truncate w-full text-center",children:r(a)})]},s)})})]})}var ult="#3b82f6",plt="#ffffff",pfe="px-1.5 py-0.5 text-[10px] rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed";function hfe({nodeId:t,style:e,label:n,canEdit:r,onChangeStyle:o}){let i=!!e?.bold,s=!!e?.italic;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 mt-1 pl-4",role:"group","aria-label":`Style for ${n}`,children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-0.5 text-[9px] text-muted-foreground",children:[jsxRuntime.jsx("span",{children:"Fill"}),jsxRuntime.jsx("input",{type:"color",disabled:!r,"aria-label":`Fill colour for ${n}`,className:"h-4 w-5 cursor-pointer rounded border border-border bg-transparent p-0 disabled:cursor-not-allowed",value:e?.fillColor??ult,onChange:a=>o(t,{fillColor:a.target.value})})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-0.5 text-[9px] text-muted-foreground",children:[jsxRuntime.jsx("span",{children:"Text"}),jsxRuntime.jsx("input",{type:"color",disabled:!r,"aria-label":`Font colour for ${n}`,className:"h-4 w-5 cursor-pointer rounded border border-border bg-transparent p-0 disabled:cursor-not-allowed",value:e?.fontColor??plt,onChange:a=>o(t,{fontColor:a.target.value})})]}),jsxRuntime.jsx("button",{type:"button",disabled:!r,"aria-label":`Bold ${n}`,"aria-pressed":i,className:ie(pfe,"font-bold",i?"border-primary bg-primary/20 text-primary":"border-border text-muted-foreground"),onClick:()=>o(t,{bold:!i}),children:"B"}),jsxRuntime.jsx("button",{type:"button",disabled:!r,"aria-label":`Italic ${n}`,"aria-pressed":s,className:ie(pfe,"italic",s?"border-primary bg-primary/20 text-primary":"border-border text-muted-foreground"),onClick:()=>o(t,{italic:!s}),children:"I"})]})}var KN="text-[9px] text-muted-foreground hover:text-primary px-1 disabled:opacity-40 disabled:cursor-not-allowed";function ffe({nodeId:t,text:e,displayIndex:n,isChild:r,canEdit:o,removeDisabled:i,moveUpDisabled:s,moveDownDisabled:a,inputRef:l,style:c,onChangeText:d,onKeyDown:u,onAddSubItem:p,onMoveUp:h,onMoveDown:f,onRemove:m,onChangeStyle:x}){let g=r?`Sub-item: ${e||"empty"}`:`Item ${n}: ${e||"empty"}`;return jsxRuntime.jsxs("div",{role:"listitem",className:ie("rounded border bg-background/60 p-1.5",r?"border-border/60 ml-4":"border-border"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground w-3 shrink-0","aria-hidden":"true",children:r?"\u2022":`${n}`}),jsxRuntime.jsx("input",{ref:l,type:"text",disabled:!o,"aria-label":g,className:ie(an,"flex-1 text-[11px] py-0.5"),value:e,onChange:y=>d(t,y.target.value),onKeyDown:y=>u(y,t),placeholder:"Type here"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[jsxRuntime.jsx("button",{type:"button",disabled:!o||s,className:KN,onClick:()=>h(t),"aria-label":`Move ${g} up`,title:"Move up",children:"\u2191"}),jsxRuntime.jsx("button",{type:"button",disabled:!o||a,className:KN,onClick:()=>f(t),"aria-label":`Move ${g} down`,title:"Move down",children:"\u2193"}),!r&&jsxRuntime.jsx("button",{type:"button",disabled:!o,className:KN,onClick:()=>p(t),"aria-label":`Add sub-item under ${g}`,title:"Add sub-item",children:"+Sub"}),jsxRuntime.jsx("button",{type:"button",disabled:!o||i,className:ie(KN,"hover:text-red-400"),onClick:()=>m(t),"aria-label":`Remove ${g}`,title:i?"Layout minimum reached":"Remove",children:"x"})]})]}),jsxRuntime.jsx(hfe,{nodeId:t,style:c,label:g,canEdit:o,onChangeStyle:x})]})}var flt=["colorful1","colorful2","colorful3","monochromatic1","monochromatic2"],mlt=["flat","moderate","intense"],glt=new Set(["parOf","presParOf",void 0]);function mfe({smartArtData:t,canEdit:e,onUpdateElement:n,box:r}){let{t:o}=reactI18next.useTranslation(),i=t.nodes??[],s=t.resolvedLayoutType,a=i.filter(M=>!M.parentId).length,l=Jm__default.default.useRef(new Map),c=Jm__default.default.useRef(null);Jm__default.default.useEffect(()=>{let M=c.current;M&&(l.current.get(M)?.focus(),c.current=null);});let d=(M,_)=>{_&&(c.current=_);let E=r?MT(M,M.layout,$T(M),M.style??"flat","inspector",r):M;n({smartArtData:E});},u=M=>{d({...t,...M});},p=(M,_)=>{d(Nf(t,M,_));},h=(M,_)=>{let E=cS(t,M,_);E!==t&&d(E);},f=()=>{tG(s,a)&&d(s_(t));},m=M=>{d(s_(t,M,"Sub-item"));},x=M=>{!i.find(E=>E.id===M)?.parentId&&!YN(s,a)||d(lS(t,M));},g=(M,_)=>{let E=sfe(t,M,_);E&&d(E,M);},y=(M,_)=>{let E=i.find(I=>I.id===_),R=!E?.text;if(M.key==="Enter"){M.preventDefault();let I=nfe(t,_);I&&d(I.data,I.focusNodeId);}else if((M.key==="Backspace"||M.key==="Delete")&&R){if(!E?.parentId&&!YN(s,a))return;M.preventDefault();let L=rfe(t,_);L&&d(L.data,L.focusNodeId);}else if(M.key==="Tab"&&!M.shiftKey){M.preventDefault();let I=ofe(t,_);I&&d(I,_);}else if(M.key==="Tab"&&M.shiftKey){M.preventDefault();let I=ife(t,_);I&&d(I,_);}},b=M=>_=>{_?l.current.set(M,_):l.current.delete(M);},v=tfe(s),S=!e||!tG(s,a),w=(t.connections??[]).filter(M=>!glt.has(M.type)),C=Array.from(new Set(w.map(M=>M.type??"unknown"))).join(", "),T=0;return jsxRuntime.jsxs("div",{className:Zt,role:"group","aria-label":o("pptx.smartart.title"),children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.smartart.title")}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(ufe,{smartArtData:t,canEdit:e,onUpdateSmartArt:u}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.smartart.colorScheme")}),jsxRuntime.jsx("select",{disabled:!e,"aria-label":o("pptx.smartart.colorScheme"),className:ie(an,"w-full"),value:t.colorScheme??"colorful1",onChange:M=>u({colorScheme:M.target.value}),children:flt.map(M=>jsxRuntime.jsx("option",{value:M,children:M},M))})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.smartart.style")}),jsxRuntime.jsx("div",{className:"flex gap-1",role:"group","aria-label":o("pptx.smartart.style"),children:mlt.map(M=>jsxRuntime.jsx("button",{type:"button",disabled:!e,"aria-pressed":(t.style??"flat")===M,className:ie("flex-1 px-2 py-1 text-[10px] rounded border transition-colors",(t.style??"flat")===M?"border-primary bg-primary/20 text-primary":"border-border text-muted-foreground hover:bg-muted"),onClick:()=>u({style:M}),children:M},M))})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[o("pptx.smartart.textPane")," (",i.length,")"]}),jsxRuntime.jsx("button",{type:"button",disabled:S,className:xr,onClick:f,title:S?v:void 0,children:o("pptx.smartart.addItem")})]}),v&&jsxRuntime.jsx("div",{className:"text-[9px] text-muted-foreground",role:"note",children:v}),jsxRuntime.jsx("div",{className:"max-h-52 overflow-y-auto space-y-1 pr-1",role:"list",children:i.map(M=>{let _=!!M.parentId;_||(T+=1);let E=afe(t,M.id),R=lfe(t,M.id),I=i.length<=1||!_&&!YN(s,a);return jsxRuntime.jsx(ffe,{nodeId:M.id,text:M.text,displayIndex:T,isChild:_,canEdit:e,removeDisabled:I,moveUpDisabled:E<=0,moveDownDisabled:E<0||E>=R-1,inputRef:b(M.id),style:M.style,onChangeText:p,onKeyDown:y,onAddSubItem:m,onMoveUp:L=>g(L,-1),onMoveDown:L=>g(L,1),onRemove:x,onChangeStyle:h},M.id)})}),w.length>0&&jsxRuntime.jsxs("div",{className:"text-[9px] text-muted-foreground",role:"note","aria-label":`${w.length} non-tree relationship connection(s): ${C}`,children:[o("pptx.smartart.extraConnections",{count:w.length}),jsxRuntime.jsx("span",{className:"block opacity-80",children:C})]}),jsxRuntime.jsx("div",{className:"text-[9px] text-muted-foreground mt-1",children:o("pptx.smartart.tabHint")})]})]})}Pe();Pe();function gfe({cellStyle:t,canEdit:e,onUpdateCellStyle:n}){let{t:r}=reactI18next.useTranslation(),o=t.fillMode??"solid",i=s=>{let a=s;n(a==="gradient"?{fillMode:"gradient",gradientFillType:t.gradientFillType??"linear",gradientFillAngle:t.gradientFillAngle??90,gradientFillStops:t.gradientFillStops??[{color:"#FF0000",position:0},{color:"#0000FF",position:100}]}:a==="pattern"?{fillMode:"pattern",patternFillPreset:t.patternFillPreset??"ltDnDiag",patternFillForeground:t.patternFillForeground??"#000000",patternFillBackground:t.patternFillBackground??"#FFFFFF"}:{fillMode:a});};return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.fillMode")}),jsxRuntime.jsx("select",{disabled:!e,className:iT,value:o,onChange:s=>i(s.target.value),children:G4.map(s=>jsxRuntime.jsx("option",{value:s.value??"",children:r(s.i18nKey)},s.value))})]}),o==="gradient"&&jsxRuntime.jsx(xlt,{cellStyle:t,canEdit:e,onUpdateCellStyle:n}),o==="pattern"&&jsxRuntime.jsx(ylt,{cellStyle:t,canEdit:e,onUpdateCellStyle:n}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("span",{className:V4,children:r("pptx.table.margins")}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:[["marginTop","pptx.table.marginTop"],["marginBottom","pptx.table.marginBottom"],["marginLeft","pptx.table.marginLeft"],["marginRight","pptx.table.marginRight"]].map(([s,a])=>jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r(a)}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:sT,min:0,max:200,value:t[s]??0,onChange:l=>n({[s]:Number(l.target.value)})})]},s))})]})]})}function xlt({cellStyle:t,canEdit:e,onUpdateCellStyle:n}){let{t:r}=reactI18next.useTranslation(),o=t.gradientFillStops??[],i=t.gradientFillType??"linear",s=(l,c)=>{let d=o.map((u,p)=>p===l?{...u,...c}:u);n({gradientFillStops:d});},a=()=>{n({gradientFillStops:[...o,{color:"#888888",position:50}]});};return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.gradientType")}),jsxRuntime.jsx("select",{disabled:!e,className:iT,value:i,onChange:l=>n({gradientFillType:l.target.value}),children:W4.map(l=>jsxRuntime.jsx("option",{value:l.value,children:r(l.i18nKey)},l.value))})]}),i==="linear"&&jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.gradientAngle")}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:sT,min:0,max:360,value:t.gradientFillAngle??90,onChange:l=>n({gradientFillAngle:Number(l.target.value)})})]})]}),jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.gradientStops")}),o.map((l,c)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"h-6 w-6 rounded border border-border cursor-pointer",value:l.color,onChange:d=>s(c,{color:d.target.value})}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:sT,min:0,max:100,value:Math.round(l.position),onChange:d=>s(c,{position:Number(d.target.value)})}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:"%"})]},c)),jsxRuntime.jsx("button",{type:"button",disabled:!e,className:"text-[10px] text-primary hover:underline",onClick:a,children:r("pptx.table.gradientAddStop")})]})}function ylt({cellStyle:t,canEdit:e,onUpdateCellStyle:n}){let{t:r}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.patternPreset")}),jsxRuntime.jsx("select",{disabled:!e,className:iT,value:t.patternFillPreset??"ltDnDiag",onChange:o=>n({patternFillPreset:o.target.value}),children:X4.map(o=>jsxRuntime.jsx("option",{value:o,children:o},o))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.patternForeground")}),jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",value:t.patternFillForeground??"#000000",onChange:o=>n({patternFillForeground:o.target.value})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:$c,children:r("pptx.table.patternBackground")}),jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",value:t.patternFillBackground??"#FFFFFF",onChange:o=>n({patternFillBackground:o.target.value})})]})]})]})}function xfe({tableData:t,tableEditorState:e,canEdit:n,onUpdateTableData:r}){let{t:o}=reactI18next.useTranslation(),{rowIndex:i,columnIndex:s}=e,a=t.rows[i]?.cells[s];if(!a)return null;let l=a.style??{},c=d=>{let u=t.rows.map((p,h)=>h!==i?p:{...p,cells:p.cells.map((f,m)=>m!==s?f:{...f,style:{...l,...d}})});r({rows:u});};return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.cell",{row:i+1,col:s+1})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-10 text-muted-foreground",children:o("pptx.table.fontSize")}),jsxRuntime.jsx("input",{type:"number",disabled:!n,className:an,min:6,max:200,value:l.fontSize??14,onChange:d=>c({fontSize:Number(d.target.value)})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.table.color")}),jsxRuntime.jsx(Lo,{disabled:!n,value:et(l.color,"#000000"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:d=>c({color:d})})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o("pptx.table.background")}),jsxRuntime.jsx(Lo,{disabled:!n,value:et(l.backgroundColor,"#ffffff"),className:"w-full h-7 rounded border border-border bg-transparent cursor-pointer",onCommit:d=>c({backgroundColor:d})})]})]}),jsxRuntime.jsx(gfe,{cellStyle:l,canEdit:n,onUpdateCellStyle:c}),jsxRuntime.jsx("div",{className:"flex gap-1",children:[["bold","B","font-bold"],["italic","I","italic"],["underline","U","underline"]].map(([d,u,p])=>jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie("px-2 py-1 rounded text-[11px] transition-colors",p,l[d]?"bg-primary text-white":"bg-muted hover:bg-accent"),onClick:()=>c({[d]:!l[d]}),children:u},d))}),jsxRuntime.jsx("div",{className:"flex gap-1",children:[["left","L"],["center","C"],["right","R"]].map(([d,u])=>jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie("px-2 py-1 rounded text-[11px] transition-colors",l.align===d?"bg-primary text-white":"bg-muted hover:bg-accent"),onClick:()=>c({align:d}),children:u},d))}),jsxRuntime.jsx("div",{className:"flex gap-1",children:[["top","T"],["middle","M"],["bottom","B"]].map(([d,u])=>jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie("px-2 py-1 rounded text-[11px] transition-colors",l.vAlign===d?"bg-primary text-white":"bg-muted hover:bg-accent"),onClick:()=>c({vAlign:d}),children:u},d))}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground text-[11px]",children:o("pptx.table.cellBorders")}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:[["Top","borderTopColor","borderTopWidth"],["Bottom","borderBottomColor","borderBottomWidth"],["Left","borderLeftColor","borderLeftWidth"],["Right","borderRightColor","borderRightWidth"]].map(([d,u,p])=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:o(`pptx.table.border${d}`)}),jsxRuntime.jsxs("div",{className:"flex gap-1 items-center",children:[jsxRuntime.jsx(Lo,{disabled:!n,value:et(l[u],"#374151"),className:"w-7 h-6 rounded border border-border bg-transparent cursor-pointer shrink-0",onCommit:h=>c({[u]:h})}),jsxRuntime.jsx("input",{type:"number",disabled:!n,className:ie(an,"w-14"),min:0,max:10,value:l[p]??1,onChange:h=>c({[p]:Number(h.target.value)})})]})]},d))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie(xr,"text-center"),onClick:()=>{let d=U4(t,i,s);d&&r({rows:d});},children:o("pptx.table.mergeRight")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie(xr,"text-center"),onClick:()=>{let d=$4(t,i,s);d&&r({rows:d});},children:o("pptx.table.mergeDown")}),jsxRuntime.jsx("button",{type:"button",disabled:!n,className:ie(xr,"text-center"),onClick:()=>{let d=H4(t,i,s);d&&r({rows:d});},children:o("pptx.table.split")})]})]})]})}function yfe({tableElement:t,canEdit:e,onUpdateElement:n,tableEditorState:r}){let{t:o}=reactI18next.useTranslation(),i=t.tableData;if(!i)return null;let s=i.rows.length,a=i.columnWidths.length,l=c=>{n({tableData:{...i,...c}});};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.title")}),jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground mb-2",children:o("pptx.table.rowsColumns",{rows:s,cols:a})}),jsxRuntime.jsx("div",{className:"space-y-1",children:[["bandedRows","pptx.table.bandedRows"],["firstRowHeader","pptx.table.headerRow"],["bandedColumns","pptx.table.bandedColumns"],["firstCol","pptx.table.firstColumn"],["lastCol","pptx.table.lastColumn"],["lastRow","pptx.table.lastRow"]].map(([c,d])=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!e,checked:!!i[c],onChange:u=>l({[c]:u.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{className:"text-[11px]",children:o(d)})]},c))}),i.bandedRows&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 mt-1",children:[jsxRuntime.jsx("span",{className:"text-[11px] text-muted-foreground",children:o("pptx.table.bandRowCycle")}),jsxRuntime.jsx("input",{type:"number",min:1,max:99,disabled:!e,value:i.bandRowCycle??1,onChange:c=>l({bandRowCycle:Math.max(1,parseInt(c.target.value,10)||1)}),className:"w-14 rounded border border-border bg-background px-1 py-0.5 text-[11px]"})]}),i.bandedColumns&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 mt-1",children:[jsxRuntime.jsx("span",{className:"text-[11px] text-muted-foreground",children:o("pptx.table.bandColCycle")}),jsxRuntime.jsx("input",{type:"number",min:1,max:99,disabled:!e,value:i.bandColCycle??1,onChange:c=>l({bandColCycle:Math.max(1,parseInt(c.target.value,10)||1)}),className:"w-14 rounded border border-border bg-background px-1 py-0.5 text-[11px]"})]})]}),jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.stylePresets")}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:z4.map(c=>jsxRuntime.jsx("button",{type:"button",disabled:!e,title:c.label,"aria-label":c.label,className:"rounded border border-border hover:border-primary overflow-hidden h-10 transition-colors",onClick:()=>{let d=i.rows.map((u,p)=>({...u,cells:u.cells.map(h=>({...h,style:{...h.style,backgroundColor:p===0&&i.firstRowHeader?c.headerBg:i.bandedRows&&(p-(i.firstRowHeader?1:0))%2===0?c.bandBg:void 0,color:p===0&&i.firstRowHeader?c.headerFg:h.style?.color,bold:p===0&&i.firstRowHeader?true:h.style?.bold,borderColor:c.borderColor}}))}));l({rows:d});},children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:c.headerBg}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:c.bandBg}}),jsxRuntime.jsx("div",{className:"flex-1 border-t",style:{borderColor:c.borderColor}})]})},c.id))})]}),jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.columnWidths")}),jsxRuntime.jsx("button",{type:"button",className:xr,disabled:!e,onClick:()=>{let c=1/a;l({columnWidths:Array(a).fill(c)});},children:o("pptx.table.even")})]}),jsxRuntime.jsx("div",{className:"space-y-1",children:i.columnWidths.map((c,d)=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-6 text-muted-foreground shrink-0",children:d+1}),jsxRuntime.jsx("input",{type:"range",disabled:!e,min:5,max:80,value:Math.round(c*100),className:"flex-1 accent-primary",onChange:u=>{let p=Number(u.target.value)/100,h=i.columnWidths[d],f=p-h,m=[...i.columnWidths];m[d]=p;let x=1-h;if(x>0)for(let b=0;b<m.length;b++)b!==d&&(m[b]=Math.max(.05,i.columnWidths[b]-f*(i.columnWidths[b]/x)));let g=m.reduce((b,v)=>b+v,0),y=m.map(b=>b/g);l({columnWidths:y});}}),jsxRuntime.jsxs("span",{className:"w-10 text-right text-muted-foreground",children:[Math.round(c*100),"%"]})]},d))})]}),jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("div",{className:Gt,children:o("pptx.table.rowHeights")}),jsxRuntime.jsx("button",{type:"button",className:xr,disabled:!e,onClick:()=>{let c=Math.round(i.rows.reduce((d,u)=>d+(u.height??32),0)/s);l({rows:i.rows.map(d=>({...d,height:c}))});},children:o("pptx.table.even")})]}),jsxRuntime.jsx("div",{className:"space-y-1",children:i.rows.map((c,d)=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-6 text-muted-foreground shrink-0",children:d+1}),jsxRuntime.jsx("input",{type:"number",disabled:!e,className:an,min:16,max:500,value:c.height??32,onChange:u=>{let p=i.rows.map((h,f)=>f===d?{...h,height:Number(u.target.value)}:h);l({rows:p});}}),jsxRuntime.jsx("span",{className:"w-6 text-muted-foreground",children:"px"})]},d))})]}),r&&jsxRuntime.jsx(xfe,{tableData:i,tableEditorState:r,canEdit:e,onUpdateTableData:l})]})}function bfe({selectedElement:t,canEdit:e,slides:n,tableEditorState:r,mediaDataUrls:o,onUpdateElement:i,onUpdateElementStyle:s,onUpdateTextStyle:a,onMoveLayer:l}){let{t:c}=reactI18next.useTranslation(),d=!!(t.locks?.noMove||t.locks?.noSelect),u=()=>{e&&i(d?{locks:void 0}:{locks:{noMove:true,noResize:true,noSelect:true}});};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:Gt,children:c("pptx.inspector.element")}),jsxRuntime.jsx("button",{type:"button",onClick:u,disabled:!e,title:c(d?"pptx.inspector.unlock":"pptx.inspector.lock"),className:"p-1 rounded hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":d,children:d?jsxRuntime.jsx(lu$1.LuLock,{className:"w-3.5 h-3.5 text-amber-400"}):jsxRuntime.jsx(lu$1.LuLockOpen,{className:"w-3.5 h-3.5 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:$pe.map(([p,h])=>jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"w-4 text-muted-foreground",children:p}),jsxRuntime.jsx("input",{type:"number",className:an,disabled:!e,value:Math.round(t[h]??0),onChange:f=>i({[h]:Number(f.target.value)})})]},h))})]}),t.type==="table"&&jsxRuntime.jsx(yfe,{tableElement:t,canEdit:e,onUpdateElement:i,tableEditorState:r}),t.type==="chart"&&jsxRuntime.jsx(Che,{selectedElement:t,canEdit:e,onUpdateElement:i}),t.type==="smartArt"&&t.smartArtData&&jsxRuntime.jsx(mfe,{smartArtData:t.smartArtData,canEdit:e,onUpdateElement:i,box:{width:t.width,height:t.height}}),Vo(t)&&jsxRuntime.jsx($he,{selectedElement:t,canEdit:e,onUpdateElement:i}),t.type==="media"&&jsxRuntime.jsx(Jhe,{element:t,mediaDataUrls:o??new Map,canEdit:e,onUpdateElement:i}),jsxRuntime.jsx(Mhe,{selectedElement:t,canEdit:e,onUpdateElementStyle:s}),jsxRuntime.jsx(_he,{selectedElement:t}),jsxRuntime.jsx(Phe,{selectedElement:t}),jsxRuntime.jsx(Qhe,{selectedElement:t,canEdit:e,onUpdateElement:i,onUpdateElementStyle:s,onUpdateTextStyle:a}),jsxRuntime.jsx(zpe,{selectedElement:t,slides:n,canEdit:e,onUpdateElement:i}),jsxRuntime.jsx(Ehe,{selectedElement:t,canEdit:e,onUpdateElement:i}),jsxRuntime.jsx(Ahe,{canEdit:e,onMoveLayer:l})]})}function sG({comment:t,canEdit:e,activeSlide:n,editingCommentId:r,commentEditDraft:o,replyingToCommentId:i,replyDraftByCommentId:s,onStartEditComment:a,onSaveEditComment:l,onCancelEditComment:c,onSetCommentEditDraft:d,onDeleteComment:u,onToggleCommentResolved:p,onStartReply:h,onCancelReply:f,onReplyDraftChange:m,onSubmitReply:x,onSelectElement:g,depth:y=0}){let{t:b}=reactI18next.useTranslation(),v=r===t.id,S=i===t.id,w=s[t.id]??"",[C,T]=Jm.useState(true),M=t.replies??[],_=t.elementId?n?.elements?.find(E=>E.id===t.elementId)??null:null;return jsxRuntime.jsxs("div",{className:ie("rounded border border-border bg-card p-2",y>0&&"ml-3 border-l-2 border-l-primary/40"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[jsxRuntime.jsx("span",{className:"text-[11px] font-medium text-foreground truncate",children:t.author||"Author"}),t.resolved&&jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-full bg-green-900/40 px-1.5 py-0.5 text-[9px] font-medium text-green-300 flex-shrink-0",children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"h-2.5 w-2.5"}),b("pptx.comments.resolved")]})]}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:q4(t.createdAt)})]}),t.elementId&&(_?jsxRuntime.jsxs("button",{type:"button",className:"mt-1 inline-flex items-center gap-1 rounded bg-primary/20 px-1.5 py-0.5 text-[10px] text-primary hover:bg-primary/30 transition-colors",title:b("pptx.comments.commentingOn",{element:ii(_)}),onClick:()=>g(_.id),children:[jsxRuntime.jsx(lu$1.LuType,{className:"h-2.5 w-2.5"}),ii(_)]}):jsxRuntime.jsx("span",{className:"mt-1 inline-flex items-center gap-1 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:b("pptx.comments.deletedElement")})),v?jsxRuntime.jsxs("div",{className:"mt-1.5 space-y-1.5",children:[jsxRuntime.jsx("textarea",{value:o,onChange:E=>d(E.target.value),rows:3,className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground outline-none focus:border-primary resize-y"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[11px] text-white hover:bg-primary/80 disabled:opacity-40 disabled:cursor-not-allowed",onClick:()=>l(t.id),disabled:String(o).trim().length===0,children:b("pptx.comments.save")}),jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent",onClick:c,children:b("pptx.comments.cancel")})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"mt-1 whitespace-pre-wrap break-words text-[11px] text-foreground",children:t.text}),e&&jsxRuntime.jsxs("div",{className:"mt-1.5 inline-flex items-center rounded bg-muted overflow-hidden",children:[jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center justify-center p-1.5 hover:bg-accent text-foreground hover:text-foreground transition-colors",onClick:()=>a(t.id),title:b("pptx.comments.edit"),children:jsxRuntime.jsx(lu$1.LuPencil,{className:"h-3 w-3"})}),h&&y===0&&jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center justify-center p-1.5 border-l border-border hover:bg-accent text-foreground hover:text-foreground transition-colors",onClick:()=>h(t.id),title:b("pptx.comments.reply"),children:jsxRuntime.jsx(lu$1.LuReply,{className:"h-3 w-3"})}),p&&jsxRuntime.jsx("button",{type:"button",className:ie("inline-flex items-center justify-center p-1.5 border-l border-border transition-colors",t.resolved?"bg-green-900/40 text-green-300 hover:bg-green-900/60":"hover:bg-accent text-foreground hover:text-foreground"),onClick:()=>p(t.id),title:t.resolved?b("pptx.comments.unresolve"):b("pptx.comments.resolve"),children:jsxRuntime.jsx(lu$1.LuCheck,{className:"h-3 w-3"})}),jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center justify-center p-1.5 border-l border-border hover:bg-red-900/40 text-muted-foreground hover:text-red-300 transition-colors",onClick:()=>u(t.id),title:b("pptx.comments.delete"),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"h-3 w-3"})})]})]}),M.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",onClick:()=>T(E=>!E),children:[C?jsxRuntime.jsx(lu$1.LuChevronDown,{className:"h-3 w-3"}):jsxRuntime.jsx(lu$1.LuChevronRight,{className:"h-3 w-3"}),b("pptx.comments.repliesCount",{count:M.length})]}),C&&jsxRuntime.jsx("div",{className:"mt-1.5 space-y-1.5",children:M.map((E,R)=>jsxRuntime.jsx(sG,{comment:E,canEdit:e,activeSlide:n,editingCommentId:r,commentEditDraft:o,replyingToCommentId:i,replyDraftByCommentId:s,onStartEditComment:a,onSaveEditComment:l,onCancelEditComment:c,onSetCommentEditDraft:d,onDeleteComment:u,onToggleCommentResolved:p,onStartReply:h,onCancelReply:f,onReplyDraftChange:m,onSubmitReply:x,onSelectElement:g,depth:y+1},`${E.id}-${R}`))})]}),S&&f&&m&&x&&jsxRuntime.jsxs("div",{className:"mt-2 space-y-1.5 pl-3 border-l-2 border-l-primary/40",children:[jsxRuntime.jsx("textarea",{value:w,onChange:E=>m(t.id,E.target.value),rows:2,placeholder:b("pptx.comments.replyPlaceholder",{author:t.author||"Author"}),className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground outline-none focus:border-primary resize-y",onKeyDown:E=>{E.key==="Enter"&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),x(t.id));}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[11px] text-white hover:bg-primary/80 disabled:opacity-40 disabled:cursor-not-allowed",onClick:()=>x(t.id),disabled:w.trim().length===0,children:[jsxRuntime.jsx(lu$1.LuReply,{className:"h-3 w-3"}),b("pptx.comments.addReply")]}),jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center gap-1 rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent",onClick:f,children:b("pptx.comments.cancel")})]})]})]})}function wfe({comments:t,canEdit:e,activeSlide:n,selectedElement:r,editingCommentId:o,commentEditDraft:i,commentDraft:s,replyingToCommentId:a,replyDraftByCommentId:l,onSetCommentDraft:c,onAddComment:d,onDeleteComment:u,onStartEditComment:p,onSaveEditComment:h,onCancelEditComment:f,onSetCommentEditDraft:m,onToggleCommentResolved:x,onStartReply:g,onCancelReply:y,onReplyDraftChange:b,onSubmitReply:v,onSelectElement:S}){let{t:w}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:w("pptx.comments.slideComments")}),jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground",children:t.length})]}),t.length===0?jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:w("pptx.comments.noComments")}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-[42vh] overflow-y-auto pr-1",children:t.map((T,M)=>jsxRuntime.jsx(sG,{comment:T,canEdit:e,activeSlide:n,editingCommentId:o,commentEditDraft:i,replyingToCommentId:a,replyDraftByCommentId:l,onStartEditComment:p,onSaveEditComment:h,onCancelEditComment:f,onSetCommentEditDraft:m,onDeleteComment:u,onToggleCommentResolved:x,onStartReply:g,onCancelReply:y,onReplyDraftChange:b,onSubmitReply:v,onSelectElement:S},`${T.id}-${M}`))}),e&&jsxRuntime.jsxs("div",{className:"space-y-1.5 pt-1 border-t border-border",children:[r&&jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-1 rounded bg-primary/20 px-1.5 py-0.5 text-[10px] text-primary",children:[jsxRuntime.jsx(lu$1.LuType,{className:"h-2.5 w-2.5"}),w("pptx.comments.commentingOn",{element:ii(r)})]}),jsxRuntime.jsx("textarea",{rows:2,placeholder:r?w("pptx.comments.addOnElement",{element:ii(r)}):w("pptx.comments.addPlaceholder"),value:s,className:"w-full bg-muted border border-border rounded px-2 py-1 text-xs resize-y outline-none focus:border-primary",onChange:T=>c(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),d());}}),jsxRuntime.jsxs("button",{type:"button",onClick:d,disabled:!s.trim(),className:ie("w-full inline-flex items-center justify-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",s.trim()?"bg-primary hover:bg-primary/80 text-white":"bg-muted text-muted-foreground cursor-not-allowed"),children:[jsxRuntime.jsx(lu$1.LuMessageSquare,{className:"w-3.5 h-3.5"}),w("pptx.comments.addComment")]})]})]})}function aG({label:t,value:e}){return jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{children:t}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:e})]})}function ZN({label:t,disabled:e,value:n,onChange:r}){return jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:t}),jsxRuntime.jsx("input",{type:"text",className:an,disabled:e,value:n,onChange:o=>r(o.target.value)})]})}function Olt({customProperties:t,canEdit:e,onUpdate:n}){return jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Custom Properties"}),e&&jsxRuntime.jsx("button",{type:"button",className:xr,onClick:()=>n([...t,{name:`Property ${t.length+1}`,value:"",type:"lpwstr"}]),children:"Add"})]}),t.length===0?jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground",children:"No custom properties"}):t.map((r,o)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr,1fr,auto] gap-1",children:[jsxRuntime.jsx("input",{type:"text",className:an,disabled:!e,value:r.name,onChange:i=>n(t.map((s,a)=>a===o?{...s,name:i.target.value}:s))}),jsxRuntime.jsx("input",{type:"text",className:an,disabled:!e,value:r.value,onChange:i=>n(t.map((s,a)=>a===o?{...s,value:i.target.value}:s))}),e&&jsxRuntime.jsx("button",{type:"button",className:ie(xr,"px-1.5 text-red-400 hover:text-red-300"),onClick:()=>n(t.filter((i,s)=>s!==o)),children:"\xD7"})]},`${r.name}-${o}`))]})}function Tfe({notesCanvasSize:t,notesMaster:e,handoutMaster:n}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Notes & Handout"}),jsxRuntime.jsxs("div",{className:"space-y-1 text-[11px] text-muted-foreground",children:[jsxRuntime.jsx(aG,{label:"Notes Size",value:t?`${t.width} \xD7 ${t.height}px`:"Not available"}),jsxRuntime.jsx(aG,{label:"Notes Master",value:e?`${e.placeholders?.length??0} placeholders`:"Not available"}),jsxRuntime.jsx(aG,{label:"Handout Master",value:n?`${n.placeholders?.length??0} placeholders`:"Not available"})]})]})}function Cfe({coreProperties:t,appProperties:e,customProperties:n,canEdit:r,onUpdateCoreProperties:o,onUpdateAppProperties:i,onUpdateCustomProperties:s}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Document"}),jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px] text-muted-foreground",children:[jsxRuntime.jsx(ZN,{label:"Title",disabled:!r,value:t?.title??"",onChange:a=>o({title:a})}),jsxRuntime.jsx(ZN,{label:"Author",disabled:!r,value:t?.creator??"",onChange:a=>o({creator:a})}),jsxRuntime.jsx(ZN,{label:"Company",disabled:!r,value:e?.company??"",onChange:a=>i({company:a})}),jsxRuntime.jsx(ZN,{label:"Application",disabled:!r,value:e?.application??"",onChange:a=>i({application:a})}),jsxRuntime.jsx(Olt,{customProperties:n,canEdit:r,onUpdate:s})]})]})}function JN({label:t,disabled:e,checked:n,onChange:r}){return jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:t}),jsxRuntime.jsx("input",{type:"checkbox",disabled:e,checked:n,onChange:o=>r(o.target.checked)})]})}function Mfe({presentationProperties:t,canEdit:e,onUpdate:n}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Presentation"}),jsxRuntime.jsxs("div",{className:"space-y-1.5 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Show Type"}),jsxRuntime.jsxs("select",{disabled:!e,className:ie(an,"w-28"),value:t.showType??"presented",onChange:r=>n({showType:r.target.value}),children:[jsxRuntime.jsx("option",{value:"presented",children:"Presented"}),jsxRuntime.jsx("option",{value:"browsed",children:"Browsed"}),jsxRuntime.jsx("option",{value:"kiosk",children:"Kiosk"})]})]}),jsxRuntime.jsx(JN,{label:"Loop Continuously",disabled:!e,checked:!!t.loopContinuously,onChange:r=>n({loopContinuously:r})}),jsxRuntime.jsx(JN,{label:"Show Narration",disabled:!e,checked:t.showWithNarration!==false,onChange:r=>n({showWithNarration:r})}),jsxRuntime.jsx(JN,{label:"Show Animation",disabled:!e,checked:t.showWithAnimation!==false,onChange:r=>n({showWithAnimation:r})}),jsxRuntime.jsx(JN,{label:"Frame Slides",disabled:!e,checked:!!t.printFrameSlides,onChange:r=>n({printFrameSlides:r})}),jsxRuntime.jsxs("label",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Slides/Page"}),jsxRuntime.jsx("input",{type:"number",min:1,max:16,disabled:!e,className:ie(an,"w-20"),value:t.printSlidesPerPage??1,onChange:r=>n({printSlidesPerPage:Number(r.target.value)})})]})]})]})}function _fe({themeOptions:t,selectedThemePath:e,setSelectedThemePath:n,canEdit:r,onApplyTheme:o}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Theme"}),jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px]",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Theme"}),jsxRuntime.jsx("select",{disabled:t.length===0,className:an,value:e,onChange:i=>n(i.target.value),children:t.length===0?jsxRuntime.jsx("option",{value:"",children:"No themes"}):t.map(i=>jsxRuntime.jsx("option",{value:i.path,children:i.name||i.path.split("/").pop()},i.path))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[jsxRuntime.jsx("button",{type:"button",className:xr,disabled:!r||!e,onClick:()=>o(e,false),children:"Apply First Master"}),jsxRuntime.jsx("button",{type:"button",className:xr,disabled:!r||!e,onClick:()=>o(e,true),children:"Apply All Masters"})]})]})]})}function Pfe({canvasSize:t,canEdit:e,onUpdate:n}){return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:"Slide Size"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-[11px]",children:[["W","width"],["H","height"]].map(([r,o])=>jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r}),jsxRuntime.jsx("input",{type:"number",className:an,disabled:!e,value:t[o],onChange:i=>n({...t,[o]:Number(i.target.value)})})]},o))})]})}bt();var Efe={bg1:"Background 1",tx1:"Text 1",bg2:"Background 2",tx2:"Text 2",accent1:"Accent 1",accent2:"Accent 2",accent3:"Accent 3",accent4:"Accent 4",accent5:"Accent 5",accent6:"Accent 6",hlink:"Hyperlink",folHlink:"Followed Hyperlink"};function Afe({activeSlide:t,theme:e,canEdit:n,onUpdateSlide:r}){let{t:o}=reactI18next.useTranslation(),i=t?.clrMapOverride,s=kD(i),a=Jm.useMemo(()=>[...hc],[]),l=Jm.useCallback(u=>{if(u){let p={};for(let h of fc)p[h]=mc[h];r({clrMapOverride:p});}else r({clrMapOverride:void 0});},[r]),c=Jm.useCallback((u,p)=>{let f={...i??{},[u]:p};for(let m of fc)f[m]||(f[m]=mc[m]);r({clrMapOverride:f});},[i,r]),d=Jm.useCallback(u=>e?.colorScheme?e.colorScheme[u]:void 0,[e]);return t?jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"inline-flex items-center gap-2 text-xs",children:[jsxRuntime.jsx("input",{type:"checkbox",disabled:!n,checked:s,onChange:u=>l(u.target.checked)}),o("pptx.themeOverride.enableOverride")]}),s&&i&&jsxRuntime.jsx("div",{className:"space-y-1.5",children:fc.map(u=>{let p=i[u]??mc[u],h=d(p);return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"w-24 truncate text-muted-foreground",title:Efe[u],children:Efe[u]}),jsxRuntime.jsx("div",{className:"h-4 w-4 rounded-sm border border-border shrink-0",style:{backgroundColor:h?`#${h.replace(/^#/,"")}`:void 0}}),jsxRuntime.jsx("select",{disabled:!n,className:"flex-1 bg-muted border border-border rounded px-1 py-0.5 text-[11px]",value:p,onChange:f=>c(u,f.target.value),children:a.map(f=>jsxRuntime.jsx("option",{value:f,children:f},f))})]},u)})})]}):null}function Rfe({tagCollections:t,onUpdateTagCollections:e,canEdit:n}){let{t:r}=reactI18next.useTranslation(),[o,i]=Jm.useState(true),s=t.flatMap((d,u)=>d.tags.map((p,h)=>({...p,colIdx:u,tagIdx:h}))),a=(d,u,p,h)=>{let f=t.map((m,x)=>x!==d?m:{...m,tags:m.tags.map((g,y)=>y===u?{...g,[p]:h}:g)});e(f);},l=(d,u)=>{let p=t.map((h,f)=>f!==d?h:{...h,tags:h.tags.filter((m,x)=>x!==u)});e(p);},c=()=>{if(t.length===0)e([{path:"ppt/tags/tag1.xml",tags:[{name:"",value:""}]}]);else {let d=t.map((u,p)=>p!==0?u:{...u,tags:[...u.tags,{name:"",value:""}]});e(d);}};return jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1 w-full",onClick:()=>i(!o),children:[o?jsxRuntime.jsx(lu$1.LuChevronRight,{className:"w-3 h-3 text-muted-foreground"}):jsxRuntime.jsx(lu$1.LuChevronDown,{className:"w-3 h-3 text-muted-foreground"}),jsxRuntime.jsx("span",{className:Gt,children:r("pptx.tags.title")}),jsxRuntime.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:s.length})]}),!o&&jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[s.length===0?jsxRuntime.jsx("div",{className:"text-[10px] text-muted-foreground",children:r("pptx.tags.noTags")}):s.map((d,u)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr,1fr,auto] gap-1 text-[11px]",children:[jsxRuntime.jsx("input",{type:"text",className:an,disabled:!n,placeholder:r("pptx.tags.name"),value:d.name,onChange:p=>a(d.colIdx,d.tagIdx,"name",p.target.value)}),jsxRuntime.jsx("input",{type:"text",className:an,disabled:!n,placeholder:r("pptx.tags.value"),value:d.value,onChange:p=>a(d.colIdx,d.tagIdx,"value",p.target.value)}),n&&jsxRuntime.jsx("button",{type:"button",className:ie(xr,"px-1.5 text-red-400 hover:text-red-300"),title:r("pptx.tags.deleteTag"),onClick:()=>l(d.colIdx,d.tagIdx),children:jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-3 h-3"})})]},`${d.colIdx}-${d.tagIdx}-${u}`)),n&&jsxRuntime.jsx("button",{type:"button",className:xr,onClick:c,children:r("pptx.tags.addTag")})]})]})}function kfe({presentationProperties:t,canEdit:e,onUpdatePresentationProperties:n,themeOptions:r,selectedThemePath:o,setSelectedThemePath:i,onApplyTheme:s,activeSlide:a,theme:l,onUpdateSlide:c,canvasSize:d,onUpdateCanvasSize:u,notesCanvasSize:p,notesMaster:h,handoutMaster:f,coreProperties:m,onUpdateCoreProperties:x,appProperties:g,onUpdateAppProperties:y,customProperties:b,onUpdateCustomProperties:v,tagCollections:S,onUpdateTagCollections:w}){let{t:C}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Mfe,{presentationProperties:t,canEdit:e,onUpdate:n}),jsxRuntime.jsx(_fe,{themeOptions:r,selectedThemePath:o,setSelectedThemePath:i,canEdit:e,onApplyTheme:s}),jsxRuntime.jsxs("div",{className:Zt,children:[jsxRuntime.jsx("div",{className:Gt,children:C("pptx.themeOverride.heading")}),jsxRuntime.jsx(Afe,{activeSlide:a,theme:l,canEdit:e,onUpdateSlide:c})]}),jsxRuntime.jsx(Pfe,{canvasSize:d,canEdit:e,onUpdate:u}),jsxRuntime.jsx(Tfe,{notesCanvasSize:p,notesMaster:h,handoutMaster:f}),jsxRuntime.jsx(Cfe,{coreProperties:m,appProperties:g,customProperties:b,canEdit:e,onUpdateCoreProperties:x,onUpdateAppProperties:y,onUpdateCustomProperties:v}),S&&w&&jsxRuntime.jsx(Rfe,{tagCollections:S,onUpdateTagCollections:w,canEdit:e}),a&&jsxRuntime.jsxs("div",{className:ie(Zt,"space-y-1"),children:[jsxRuntime.jsx("div",{className:Gt,children:"Slide"}),jsxRuntime.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[a.elements?.length??0," elements"]})]})]})}function Ife({activeSlide:t,canEdit:e,onUpdateSlide:n,editTemplateMode:r,slideMasters:o,onSetTemplateBackground:i,onGetTemplateBackgroundColor:s}){let a=Jm.useRef(null);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:ie(Zt,"space-y-2"),children:[jsxRuntime.jsx("div",{className:Gt,children:"Background"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-10 shrink-0",children:"Colour"}),jsxRuntime.jsx(Lo,{value:et(t.backgroundColor,"#ffffff"),disabled:!e,className:"h-6 w-8 rounded border border-border bg-muted cursor-pointer",onCommit:l=>n({backgroundColor:l})}),jsxRuntime.jsx("span",{className:"text-muted-foreground text-[10px] truncate",children:t.backgroundColor||"none"})]}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-10 shrink-0",children:"Image"}),jsxRuntime.jsx("input",{ref:a,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp,image/svg+xml",className:"hidden",disabled:!e,onChange:l=>{let c=l.target.files?.[0];if(!c)return;let d=new FileReader;d.onload=()=>{typeof d.result=="string"&&n({backgroundImage:d.result});},d.readAsDataURL(c),l.target.value="";}}),jsxRuntime.jsx("button",{type:"button",className:ie(xr,"flex-1 text-center"),disabled:!e,onClick:()=>a.current?.click(),children:t.backgroundImage?"Replace Image":"Choose Image"})]}),t.backgroundImage&&jsxRuntime.jsxs("div",{className:"relative mt-1",children:[jsxRuntime.jsx("img",{src:t.backgroundImage,alt:"Background preview",className:"w-full h-16 object-cover rounded border border-border"}),jsxRuntime.jsx("button",{type:"button",className:"absolute top-0.5 right-0.5 rounded bg-background/80 hover:bg-red-700 p-0.5 text-[10px] transition-colors",disabled:!e,title:"Remove background image",onClick:()=>n({backgroundImage:void 0}),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-3 h-3"})})]})]}),(t.backgroundColor||t.backgroundImage||t.backgroundGradient)&&jsxRuntime.jsx("button",{type:"button",className:ie(xr,"w-full text-center text-red-400 hover:text-red-300"),disabled:!e,onClick:()=>n({backgroundColor:void 0,backgroundImage:void 0,backgroundGradient:void 0}),children:"Clear Background"})]}),r&&i&&s&&jsxRuntime.jsx(Ylt,{activeSlide:t,slideMasters:o,canEdit:e,onSetTemplateBackground:i,onGetTemplateBackgroundColor:s})]})}function Ylt({activeSlide:t,slideMasters:e,canEdit:n,onSetTemplateBackground:r,onGetTemplateBackgroundColor:o}){return jsxRuntime.jsxs("div",{className:ie(Zt,"space-y-2"),children:[jsxRuntime.jsx("div",{className:Gt,children:"Template Backgrounds"}),t.layoutPath&&jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-14 shrink-0 truncate",title:t.layoutName??t.layoutPath,children:"Layout"}),jsxRuntime.jsx(Lo,{value:et(o(t.layoutPath),"#ffffff"),disabled:!n,className:"h-6 w-8 rounded border border-border bg-muted cursor-pointer",onCommit:i=>r(t.layoutPath,i)}),jsxRuntime.jsx("span",{className:"text-muted-foreground text-[10px] truncate",children:t.layoutName??"Layout"})]}),(()=>{let i=e?.find(s=>s.layoutPaths?.includes(t.layoutPath??""));return i?jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-14 shrink-0 truncate",title:i.name??i.path,children:"Master"}),jsxRuntime.jsx(Lo,{value:et(o(i.path),"#ffffff"),disabled:!n,className:"h-6 w-8 rounded border border-border bg-muted cursor-pointer",onCommit:s=>r(i.path,s)}),jsxRuntime.jsx("span",{className:"text-muted-foreground text-[10px] truncate",children:i.name??"Master"})]}):null})()]})}function uG(t){let{isOpen:e,canEdit:n,activeSlide:r,slides:o,canvasSize:i,selectedElement:s,selectedElementIds:a,tableEditorState:l,activeTab:c,onSetActiveTab:d,onClose:u,onUpdateElement:p,onSelectElement:h,onMoveLayer:f,presentationProperties:m,onUpdatePresentationProperties:x,notesMaster:g,handoutMaster:y,notesCanvasSize:b,coreProperties:v,appProperties:S,customProperties:w,themeOptions:C,onUpdateCoreProperties:T,onUpdateAppProperties:M,onUpdateCustomProperties:_,tagCollections:E,onUpdateTagCollections:R,onApplyTheme:I,comments:L,commentDraft:k,editingCommentId:F,commentEditDraft:N,onSetCommentDraft:D,onAddComment:U,onDeleteComment:G,onStartEditComment:j,onSaveEditComment:Y,onCancelEditComment:ge,onSetCommentEditDraft:fe,onToggleCommentResolved:de,onStartReply:J,onCancelReply:re,onReplyDraftChange:ce,onSubmitReply:ae,replyingToCommentId:_e,replyDraftByCommentId:xe,onUpdateCanvasSize:Ee,onUpdateElementStyle:W,onUpdateTextStyle:q,onUpdateSlide:Q,editTemplateMode:se,slideMasters:me,onSetTemplateBackground:P,onGetTemplateBackgroundColor:A,mediaDataUrls:O,theme:z,panelWidth:te}=t,$=s!==null,{t:Me}=reactI18next.useTranslation(),{dragY:De,handlers:V}=Lu(u),[B,ee]=Jm.useState(""),oe=80,pe=500,Ae=220,[Le,ue]=Jm.useState(Ae),we=Jm.useCallback(Ie=>{ue(He=>Math.min(pe,Math.max(oe,He-Ie)));},[]);return Jm.useEffect(()=>{let Ie=me?.[0]?.themePath;if(Ie&&Ie.length>0){ee(Ie);return}let He=C[0]?.path??"";ee(Oe=>Oe||He);},[me,C]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx("button",{type:"button","aria-label":Me("common.close"),onClick:u,className:"md:hidden fixed inset-0 z-20 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150"}),jsxRuntime.jsxs("div",{className:ie("bg-background flex flex-col text-xs text-foreground shadow-xl","max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[75dvh] max-md:rounded-t-2xl max-md:border-t max-md:border-border max-md:z-30 max-md:pb-[max(env(safe-area-inset-bottom),0px)]","max-md:transition-transform max-md:duration-200 max-md:ease-in-out",e?"max-md:translate-y-0":"max-md:translate-y-full","md:h-full md:border-l md:border-border",!te&&"md:w-72"),style:{...te?{width:te}:{},...De>0?{transform:`translateY(${De}px)`,transition:"none"}:{}},children:[jsxRuntime.jsx("div",{className:"md:hidden flex items-center justify-center pt-3 pb-2 cursor-grab active:cursor-grabbing touch-none",onPointerDown:V.onPointerDown,onPointerMove:V.onPointerMove,onPointerUp:V.onPointerUp,onPointerCancel:V.onPointerCancel,children:jsxRuntime.jsx("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/40"})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-1 rounded bg-muted p-0.5",children:Upe.map(({key:Ie,label:He,icon:Oe})=>jsxRuntime.jsxs("button",{type:"button",title:He,className:ie("flex items-center gap-1 px-2 py-1 rounded text-[11px] transition-colors",c===Ie?"bg-primary text-white":"text-muted-foreground hover:text-foreground hover:bg-accent"),onClick:()=>d(Ie),children:[jsxRuntime.jsx(Oe,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:He})]},Ie))}),jsxRuntime.jsx("button",{type:"button",onClick:u,title:Me("common.close"),className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[c==="elements"&&jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:ie(Gt,"mb-2"),children:Me("pptx.inspector.layerOrder")}),r?[...r.elements||[]].reverse().map((Ie,He)=>{let Oe=(r.elements||[]).length-1-He,$e=s?.id===Ie.id||a.includes(Ie.id),ot=(ze(Ie)?(Ie.text||"").slice(0,24):void 0)||Ie.type;return jsxRuntime.jsxs("div",{title:`${Ie.type} \u2014 ${Ie.id}`,className:ie("flex items-center gap-2 px-2 py-1 rounded cursor-pointer transition-colors",$e?"bg-primary/30 text-primary":"hover:bg-muted text-foreground"),onClick:()=>h(Ie.id),children:[jsxRuntime.jsx("span",{className:"text-muted-foreground w-4 text-right",children:Oe+1}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:ot})]},Ie.id)}):jsxRuntime.jsx("div",{className:"text-muted-foreground italic",children:Me("pptx.inspector.noSlideSelected")})]}),c==="properties"&&jsxRuntime.jsx("div",{className:"space-y-3",children:$&&s?jsxRuntime.jsx(bfe,{selectedElement:s,canEdit:n,slides:o,tableEditorState:l,mediaDataUrls:O,onUpdateElement:p,onUpdateElementStyle:W,onUpdateTextStyle:q,onMoveLayer:f}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(kfe,{canEdit:n,canvasSize:i,presentationProperties:m,onUpdatePresentationProperties:x,notesMaster:g,handoutMaster:y,notesCanvasSize:b,coreProperties:v,appProperties:S,customProperties:w,themeOptions:C,selectedThemePath:B,setSelectedThemePath:ee,onApplyTheme:I,onUpdateCoreProperties:T,onUpdateAppProperties:M,onUpdateCustomProperties:_,tagCollections:E,onUpdateTagCollections:R,onUpdateCanvasSize:Ee,activeSlide:r,theme:z,onUpdateSlide:Q}),r&&jsxRuntime.jsx(Ife,{activeSlide:r,canEdit:n,onUpdateSlide:Q,editTemplateMode:se,slideMasters:me,onSetTemplateBackground:P,onGetTemplateBackgroundColor:A})]})}),c==="comments"&&jsxRuntime.jsx(wfe,{comments:L,canEdit:n,activeSlide:r,selectedElement:s,editingCommentId:F,commentEditDraft:N,commentDraft:k,replyingToCommentId:_e??null,replyDraftByCommentId:xe??{},onSetCommentDraft:D,onAddComment:U,onDeleteComment:G,onStartEditComment:j,onSaveEditComment:Y,onCancelEditComment:ge,onSetCommentEditDraft:fe,onToggleCommentResolved:de,onStartReply:J,onCancelReply:re,onReplyDraftChange:ce,onSubmitReply:ae,onSelectElement:h})]}),$&&s&&r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(yu,{direction:"vertical",onResize:we}),jsxRuntime.jsx("div",{className:"border-t border-border p-3 overflow-y-auto flex-shrink-0",style:{height:Le},children:jsxRuntime.jsx(Bpe,{selectedElement:s,activeSlide:r,canEdit:n,onUpdateSlide:Q})})]})]})]})}function ect(t){if(t.length===0)return "";let e=t[0],n=`M ${e.x} ${e.y}`;for(let r=1;r<t.length;r++){let o=t[r];n+=` L ${o.x} ${o.y}`;}return n}function tct(t){switch(t){case "laser":return "none";case "pen":return "crosshair";case "highlighter":return "crosshair";case "eraser":return "crosshair";default:return "default"}}function hG({canvasSize:t,editorScale:e,presentationTool:n,annotationStrokes:r,currentStroke:o,laserPosition:i,onPointerDown:s,onPointerMove:a,onPointerUp:l,onLaserMove:c,onLaserLeave:d,onEraseAtPoint:u}){let p=Jm.useRef(null),h=Jm.useRef(false),f=Jm.useCallback((v,S)=>{let w=p.current;if(!w)return null;let C=w.getBoundingClientRect(),T=(v-C.left)/e,M=(S-C.top)/e;return {x:T,y:M}},[e]),m=Jm.useCallback(v=>{if(n==="none")return;v.preventDefault(),v.stopPropagation();let S=f(v.clientX,v.clientY);if(S){if(n==="eraser"){h.current=true,u(S.x,S.y);return}(n==="pen"||n==="highlighter")&&s(S.x,S.y);}},[n,f,s,u]),x=Jm.useCallback(v=>{if(n==="none")return;let S=f(v.clientX,v.clientY);if(S){if(n==="laser"){c(S.x,S.y);return}if(n==="eraser"&&h.current){u(S.x,S.y);return}(n==="pen"||n==="highlighter")&&a(S.x,S.y);}},[n,f,a,c,u]),g=Jm.useCallback(v=>{if(n!=="none"){if(v.preventDefault(),n==="eraser"){h.current=false;return}l();}},[n,l]),y=Jm.useCallback(()=>{n==="laser"&&d(),n==="eraser"&&(h.current=false),l();},[n,d,l]);if(n==="none")return null;let b=o?[...r,o]:r;return jsxRuntime.jsxs("div",{className:"absolute inset-0",style:{zIndex:60,cursor:tct(n),pointerEvents:"auto"},children:[jsxRuntime.jsx("svg",{ref:p,className:"absolute",style:{width:t.width,height:t.height,transformOrigin:"top left",transform:`scale(${e})`},viewBox:`0 0 ${t.width} ${t.height}`,onPointerDown:m,onPointerMove:x,onPointerUp:g,onPointerLeave:y,children:b.map(v=>jsxRuntime.jsx("path",{d:ect(v.points),fill:"none",stroke:v.color,strokeWidth:v.width,strokeLinecap:"round",strokeLinejoin:"round",opacity:v.opacity},v.id))}),n==="laser"&&i&&jsxRuntime.jsx("div",{className:"absolute rounded-full pointer-events-none",style:{width:24,height:24,left:i.x*e-12,top:i.y*e-12,backgroundColor:"rgba(255, 0, 0, 0.85)",boxShadow:"0 0 12px 6px rgba(255, 0, 0, 0.5), 0 0 24px 12px rgba(255, 0, 0, 0.25)",filter:"drop-shadow(0 0 8px rgba(255, 0, 0, 0.7))",zIndex:70}})]})}Pe();var xct=["#ff0000","#0000ff","#00aa00","#ff8800","#ffffff","#000000","#ff00ff","#00cccc"],yct=["#ffff00","#00ff00","#ff69b4","#00bfff","#ff8c00","#adff2f","#ff6347","#87ceeb"];function gG({presentationTool:t,penColor:e,highlighterColor:n,hasAnnotations:r,onSetTool:o,onSetPenColor:i,onSetHighlighterColor:s,onClearAnnotations:a,currentSlideIndex:l,totalSlides:c,onMovePresentationSlide:d,presentationStartTime:u,onEndPresentation:p,onTogglePresenterView:h,presenterMode:f}){let{t:m}=reactI18next.useTranslation(),[x,g]=Jm.useState(false),[y,b]=Jm.useState(false),v=Jm.useRef(null),[S,w]=Jm.useState(Date.now());Jm.useEffect(()=>{if(!u)return;let I=window.setInterval(()=>w(Date.now()),1e3);return ()=>window.clearInterval(I)},[u]);let C=u?S-u:0;Jm.useEffect(()=>{let I=L=>{v.current&&!v.current.contains(L.target)&&(g(false),b(false));};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let T=Jm.useCallback(I=>{o(I),g(false),b(false);},[o]),M=Jm.useCallback(I=>{I.preventDefault(),g(L=>!L),b(false);},[]),_=Jm.useCallback(I=>{I.preventDefault(),b(L=>!L),g(false);},[]),E=I=>`flex items-center justify-center w-9 h-9 rounded-md transition-colors ${t===I?"bg-white/25 text-white":"text-white/70 hover:text-white hover:bg-white/10"}`,R="flex items-center justify-center w-9 h-9 rounded-md transition-colors text-white/70 hover:text-white hover:bg-white/10 disabled:text-white/20 disabled:cursor-not-allowed";return jsxRuntime.jsxs("div",{ref:v,className:"flex items-center gap-1 px-3 py-2 rounded-xl bg-neutral-900/90 backdrop-blur-md border border-white/15 shadow-2xl",onClick:I=>I.stopPropagation(),children:[jsxRuntime.jsx("button",{type:"button",className:R,onClick:()=>d(-1),disabled:l===0,title:m("pptx.presenter.previousSlide"),"aria-label":m("pptx.presenter.previousSlide"),children:jsxRuntime.jsx(lu$1.LuChevronLeft,{size:18})}),jsxRuntime.jsx("span",{className:"text-xs font-mono tabular-nums text-white/80 px-1.5 select-none min-w-[48px] text-center",children:IU(l,c)}),jsxRuntime.jsx("button",{type:"button",className:R,onClick:()=>d(1),disabled:l>=c-1,title:m("pptx.presenter.nextSlide"),"aria-label":m("pptx.presenter.nextSlide"),children:jsxRuntime.jsx(lu$1.LuChevronRight,{size:18})}),jsxRuntime.jsx("div",{className:"w-px h-6 bg-white/20 mx-1"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-mono tabular-nums text-white/60 px-1 select-none",title:m("pptx.presenter.elapsed"),children:[jsxRuntime.jsx(lu$1.LuTimer,{size:14}),jsxRuntime.jsx("span",{children:Vy(C)})]}),jsxRuntime.jsx("div",{className:"w-px h-6 bg-white/20 mx-1"}),jsxRuntime.jsx("button",{type:"button",className:E("laser"),onClick:()=>T("laser"),title:m("pptx.presentation.laserPointer"),children:jsxRuntime.jsx(lu$1.LuMousePointer2,{size:18})}),jsxRuntime.jsxs("div",{className:"relative flex items-center",children:[jsxRuntime.jsxs("button",{type:"button",className:E("pen"),onClick:()=>T("pen"),onContextMenu:M,title:m("pptx.presentation.pen"),children:[jsxRuntime.jsx(lu$1.LuPenTool,{size:18}),jsxRuntime.jsx("div",{className:"absolute bottom-0.5 left-1/2 -translate-x-1/2 w-3 h-0.5 rounded-full",style:{backgroundColor:e}})]}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center justify-center w-7 h-9 -ml-1 rounded-r-md transition-colors text-white/50 hover:text-white hover:bg-white/10",onClick:()=>{g(I=>!I),b(false);},title:`${m("pptx.presentation.pen")} \u2014 color`,children:jsxRuntime.jsx(lu$1.LuChevronDown,{size:12})}),x&&jsxRuntime.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 p-3 bg-neutral-800 rounded-lg border border-white/20 shadow-xl grid grid-cols-4 gap-2",children:xct.map(I=>jsxRuntime.jsx("button",{type:"button","aria-label":`${m("pptx.presentation.pen")} ${I}`,className:`w-9 h-9 rounded-full border-2 transition-transform hover:scale-110 ${e===I?"border-white":"border-white/20"}`,style:{backgroundColor:I},onClick:()=>{i(I),g(false),t!=="pen"&&o("pen");}},I))})]}),jsxRuntime.jsxs("div",{className:"relative flex items-center",children:[jsxRuntime.jsxs("button",{type:"button",className:E("highlighter"),onClick:()=>T("highlighter"),onContextMenu:_,title:m("pptx.presentation.highlighter"),children:[jsxRuntime.jsx(lu$1.LuHighlighter,{size:18}),jsxRuntime.jsx("div",{className:"absolute bottom-0.5 left-1/2 -translate-x-1/2 w-3 h-0.5 rounded-full",style:{backgroundColor:n}})]}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center justify-center w-7 h-9 -ml-1 rounded-r-md transition-colors text-white/50 hover:text-white hover:bg-white/10",onClick:()=>{b(I=>!I),g(false);},title:`${m("pptx.presentation.highlighter")} \u2014 color`,children:jsxRuntime.jsx(lu$1.LuChevronDown,{size:12})}),y&&jsxRuntime.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 p-3 bg-neutral-800 rounded-lg border border-white/20 shadow-xl grid grid-cols-4 gap-2",children:yct.map(I=>jsxRuntime.jsx("button",{type:"button","aria-label":`${m("pptx.presentation.highlighter")} ${I}`,className:`w-9 h-9 rounded-full border-2 transition-transform hover:scale-110 ${n===I?"border-white":"border-white/20"}`,style:{backgroundColor:I},onClick:()=>{s(I),b(false),t!=="highlighter"&&o("highlighter");}},I))})]}),jsxRuntime.jsx("button",{type:"button",className:E("eraser"),onClick:()=>T("eraser"),title:m("pptx.presentation.eraser"),children:jsxRuntime.jsx(lu$1.LuEraser,{size:18})}),jsxRuntime.jsx("button",{type:"button",className:`flex items-center justify-center w-9 h-9 rounded-md transition-colors ${r?"text-white/70 hover:text-red-400 hover:bg-white/10":"text-white/30 cursor-not-allowed"}`,onClick:r?a:void 0,title:m("pptx.presentation.clearAnnotations"),disabled:!r,children:jsxRuntime.jsx(lu$1.LuTrash2,{size:18})}),jsxRuntime.jsx("div",{className:"w-px h-6 bg-white/20 mx-1"}),h&&jsxRuntime.jsx("button",{type:"button",className:`flex items-center justify-center w-9 h-9 rounded-md transition-colors ${f?"bg-white/25 text-white":"text-white/70 hover:text-white hover:bg-white/10"}`,onClick:h,title:m("pptx.presenter.presenterView",{defaultValue:"Presenter view (N)"}),"aria-label":m("pptx.presenter.presenterView",{defaultValue:"Presenter view"}),children:jsxRuntime.jsx(lu$1.LuPanelRight,{size:18})}),jsxRuntime.jsx("button",{type:"button",className:"flex items-center justify-center w-9 h-9 rounded-md transition-colors text-white/70 hover:text-red-400 hover:bg-white/10",onClick:p,title:m("pptx.presenter.endPresentation"),"aria-label":m("pptx.presenter.endPresentation"),children:jsxRuntime.jsx(lu$1.LuX,{size:18})})]})}function xG({currentSlideIndex:t,totalSlides:e,onMovePresentationSlide:n,onEndPresentation:r}){let{t:o}=reactI18next.useTranslation(),{isTouchDevice:i}=f2();if(!i)return null;let s="pointer-events-auto flex items-center justify-center w-11 h-11 min-w-11 min-h-11 rounded-full bg-black/55 text-white shadow-lg active:bg-black/75",a=l=>{l.stopPropagation();};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:`fixed z-[90] ${s}`,style:{top:"calc(env(safe-area-inset-top, 0px) + 0.5rem)",right:"calc(env(safe-area-inset-right, 0px) + 0.5rem)",touchAction:"manipulation"},onClick:l=>{a(l),r();},"aria-label":o("pptx.presenter.endPresentation"),children:jsxRuntime.jsx(lu$1.LuX,{size:22})}),jsxRuntime.jsx("button",{type:"button",className:`fixed z-[90] top-1/2 -translate-y-1/2 ${s} disabled:opacity-30`,style:{left:"calc(env(safe-area-inset-left, 0px) + 0.5rem)",touchAction:"manipulation"},disabled:t<=0,onClick:l=>{a(l),n(-1);},"aria-label":o("pptx.presenter.previousSlide"),children:jsxRuntime.jsx(lu$1.LuChevronLeft,{size:26})}),jsxRuntime.jsx("button",{type:"button",className:`fixed z-[90] top-1/2 -translate-y-1/2 ${s} disabled:opacity-30`,style:{right:"calc(env(safe-area-inset-right, 0px) + 0.5rem)",touchAction:"manipulation"},disabled:t>=e-1,onClick:l=>{a(l),n(1);},"aria-label":o("pptx.presenter.nextSlide"),children:jsxRuntime.jsx(lu$1.LuChevronRight,{size:26})}),jsxRuntime.jsx("span",{className:"fixed z-[90] left-1/2 -translate-x-1/2 px-3 py-1 rounded-full bg-black/55 text-white text-xs font-mono tabular-nums pointer-events-none",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 0.5rem)"},children:e===0?"0 / 0":`${t+1} / ${e}`})]})}function bG({visible:t}){let{t:e}=reactI18next.useTranslation(),[n,r]=Jm.useState(""),[o,i]=Jm.useState("unknown"),s=Jm.useRef(null),a=Jm.useRef(false);if(Jm.useEffect(()=>{if(!t){a.current=false,s.current?.stop(),s.current=null,r("");return}a.current=true;let c=window,d=c.SpeechRecognition??c.webkitSpeechRecognition;if(!d){i("unsupported");return}i("supported");let u=new d;u.continuous=true,u.interimResults=true,u.lang=navigator.language||"en-US",u.onresult=p=>{let h="",f="";for(let x=p.resultIndex;x<p.results.length;x+=1){let g=p.results[x],y=g?.[0]?.transcript??"";g?.isFinal?h+=y:f+=y;}let m=`${h} ${f}`.trim();m.length>0&&r(m);},u.onerror=()=>{},u.onend=()=>{if(a.current)try{u.start();}catch{}},s.current=u;try{u.start();}catch{i("unsupported");}return ()=>{a.current=false,u.stop(),s.current=null;}},[t]),!t)return null;let l=o==="unsupported"?e("pptx.subtitles.notSupported"):n.length>0?n:e("pptx.subtitles.listening");return jsxRuntime.jsx("div",{className:"absolute bottom-14 left-1/2 -translate-x-1/2 z-[70] max-w-[80%] min-w-[300px]",children:jsxRuntime.jsx("div",{className:"px-6 py-3 rounded-lg bg-black/75 backdrop-blur-sm border border-white/10",children:jsxRuntime.jsx("p",{className:"text-center text-[15px] text-white/70 italic",children:l})})})}function vG({isOpen:t,annotationCount:e,slideCount:n,onKeep:r,onDiscard:o}){let{t:i}=reactI18next.useTranslation();return t?jsxRuntime.jsx("div",{style:{zIndex:1200},className:"fixed inset-0 flex items-center justify-center bg-black/50",children:jsxRuntime.jsxs("div",{className:"bg-background border border-border rounded-lg shadow-xl w-[420px] max-w-[90vw] p-6 animate-in fade-in zoom-in-95 duration-200",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full bg-primary/10",children:jsxRuntime.jsx(lu$1.LuPenTool,{className:"w-5 h-5 text-primary"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-base font-semibold text-foreground",children:i("pptx.presentation.keepAnnotationsTitle")}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:i("pptx.presentation.keepAnnotationsDescription",{count:e,slides:n})})]})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-md border border-border bg-background text-foreground hover:bg-accent transition-colors",onClick:o,children:[jsxRuntime.jsx(lu$1.LuTrash2,{className:"w-4 h-4"}),i("pptx.presentation.discardAnnotations")]}),jsxRuntime.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-md bg-primary text-white hover:bg-primary/90 transition-colors",onClick:r,children:[jsxRuntime.jsx(lu$1.LuPenTool,{className:"w-4 h-4"}),i("pptx.presentation.keepAnnotations")]})]})]})}):null}Pe();var ll=.9,Hfe=5;function SG({slideIndices:t,slides:e,frameSlides:n,maxPages:r=3}){let{t:o}=reactI18next.useTranslation(),i=Jm.useMemo(()=>uR(t),[t]),s=Jm.useMemo(()=>pR(),[]),a=i.slice(0,r),l=s.width*ll,c=s.height*ll;return t.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full text-xs text-muted-foreground",children:o("pptx.print.preview.noSlides")}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 py-2",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:o("pptx.print.preview.title")}),a.map(d=>{let p=!!e[d.slideIndex]?.notes;return jsxRuntime.jsxs("div",{className:"relative bg-white border border-gray-200 shadow-sm rounded",style:{width:l,height:c,overflow:"hidden"},children:[jsxRuntime.jsx("div",{className:`absolute flex items-center justify-center rounded-sm bg-gray-50 ${n?"border-2 border-gray-800":"border border-gray-300"}`,style:{left:d.slideArea.x*ll,top:d.slideArea.y*ll,width:d.slideArea.width*ll,height:d.slideArea.height*ll},children:jsxRuntime.jsx("span",{className:"text-[9px] font-medium text-gray-400",children:d.slideIndex+1})}),jsxRuntime.jsx("div",{className:"absolute left-1 right-1 border-b border-gray-200",style:{top:d.textArea.y*ll-1}}),jsxRuntime.jsx("div",{className:"absolute",style:{left:d.textArea.x*ll+4,top:d.textArea.y*ll,width:d.textArea.width*ll-8,height:d.textArea.height*ll},children:Array.from({length:Hfe},(f,m)=>{let x=d.textArea.height*ll/(Hfe+1);return jsxRuntime.jsx("div",{className:`absolute left-0 right-0 border-b ${p?"border-gray-300":"border-gray-200"}`,style:{top:x*(m+1)}},m)})})]},d.pageIndex)}),i.length>r&&jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:o("pptx.print.preview.morePages",{count:i.length-r})})]})}var xv=.9;function t5({slideIndices:t,slidesPerPage:e,orientation:n,frameSlides:r,maxPages:o=3}){let{t:i}=reactI18next.useTranslation(),s=Jm.useMemo(()=>lR(t,e,n),[t,e,n]),a=Jm.useMemo(()=>cR(n),[n]),l=s.slice(0,o),c=e===3,d=dR(),u=a.width*xv,p=a.height*xv,h=.5;return t.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full text-xs text-muted-foreground",children:i("pptx.print.preview.noSlides")}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 py-2",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:i("pptx.print.preview.title")}),l.map(f=>jsxRuntime.jsx("div",{className:"relative bg-white border border-gray-200 shadow-sm rounded",style:{width:u,height:p,overflow:"hidden"},children:f.cells.map((m,x)=>{let g=m.slideIndex<0,y=m.x*xv,b=m.y*xv,v=m.width*xv,S=m.height*xv;return jsxRuntime.jsxs("div",{className:"absolute flex items-start",style:{left:y,top:b,gap:c?2:0},children:[jsxRuntime.jsx("div",{className:`flex items-center justify-center rounded-sm bg-gray-50 ${g?"opacity-30":""} ${r?"border-2 border-gray-800":"border border-gray-300"}`,style:{width:v,height:S},children:!g&&jsxRuntime.jsx("span",{className:"text-[9px] font-medium text-gray-400",children:m.slideIndex+1})}),c&&!g&&jsxRuntime.jsx("div",{className:"relative border-l border-gray-200 pl-1",style:{width:u*h,height:S},children:Array.from({length:d},(C,T)=>{let M=S/(d+1)*(T+1);return jsxRuntime.jsx("div",{className:"absolute left-1 right-0 border-b border-gray-200",style:{top:M}},T)})})]},x)})},f.pageIndex)),s.length>o&&jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:i("pptx.print.preview.morePages",{count:s.length-o})})]})}Pe();var ma=t=>`flex items-center gap-2 px-3 py-2 rounded-lg border text-sm cursor-pointer transition-colors ${t?"border-primary bg-primary/10 text-foreground":"border-border bg-background text-muted-foreground hover:border-primary/40"}`;function Wfe({printWhat:t,onPrintWhatChange:e,orientation:n,onOrientationChange:r,colorMode:o,onColorModeChange:i,frameSlides:s,onFrameSlidesChange:a,slidesPerPage:l,onSlidesPerPageChange:c,slideRange:d,onSlideRangeChange:u,customFrom:p,onCustomFromChange:h,customTo:f,onCustomToChange:m,totalSlides:x,activeSlideIndex:g}){let{t:y}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"flex-1 space-y-5 min-w-0",children:[jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.printWhat")}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntime.jsxs("label",{className:ma(t==="slides"),children:[jsxRuntime.jsx("input",{type:"radio",name:"printWhat",className:"sr-only",checked:t==="slides",onChange:()=>e("slides")}),jsxRuntime.jsx(lu$1.LuFileText,{className:"w-4 h-4 shrink-0"}),y("pptx.print.fullPageSlides")]}),jsxRuntime.jsxs("label",{className:ma(t==="handouts"),children:[jsxRuntime.jsx("input",{type:"radio",name:"printWhat",className:"sr-only",checked:t==="handouts",onChange:()=>e("handouts")}),jsxRuntime.jsx(lu$1.LuGrid2X2,{className:"w-4 h-4 shrink-0"}),y("pptx.print.handouts")]}),jsxRuntime.jsxs("label",{className:ma(t==="notes"),children:[jsxRuntime.jsx("input",{type:"radio",name:"printWhat",className:"sr-only",checked:t==="notes",onChange:()=>e("notes")}),jsxRuntime.jsx(lu$1.LuStickyNote,{className:"w-4 h-4 shrink-0"}),y("pptx.print.notesPages")]}),jsxRuntime.jsxs("label",{className:ma(t==="outline"),children:[jsxRuntime.jsx("input",{type:"radio",name:"printWhat",className:"sr-only",checked:t==="outline",onChange:()=>e("outline")}),jsxRuntime.jsx(lu$1.LuList,{className:"w-4 h-4 shrink-0"}),y("pptx.print.outline")]})]})]}),t==="handouts"&&jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.slidesPerPage")}),jsxRuntime.jsx("div",{className:"flex gap-1.5 flex-wrap",children:_T.map(b=>jsxRuntime.jsx("button",{type:"button",onClick:()=>c(b),className:`px-3 py-1.5 rounded-md text-sm font-medium border transition-colors ${l===b?"border-primary bg-primary/10 text-foreground":"border-border bg-background text-muted-foreground hover:border-primary/40"}`,children:b},b))})]}),jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.slideRange")}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:ma(d==="all"),children:[jsxRuntime.jsx("input",{type:"radio",name:"slideRange",className:"sr-only",checked:d==="all",onChange:()=>u("all")}),y("pptx.print.allSlides")," (",x,")"]}),jsxRuntime.jsxs("label",{className:ma(d==="current"),children:[jsxRuntime.jsx("input",{type:"radio",name:"slideRange",className:"sr-only",checked:d==="current",onChange:()=>u("current")}),y("pptx.print.currentSlide")," (",g+1,")"]}),jsxRuntime.jsxs("label",{className:ma(d==="custom"),children:[jsxRuntime.jsx("input",{type:"radio",name:"slideRange",className:"sr-only",checked:d==="custom",onChange:()=>u("custom")}),y("pptx.print.customRange")]}),d==="custom"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 pl-6",children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:y("pptx.print.from")}),jsxRuntime.jsx("input",{type:"number",min:1,max:x,value:p,onChange:b=>h(Math.max(1,parseInt(b.target.value,10)||1)),className:"w-16 px-2 py-1 text-sm border border-border rounded bg-background text-foreground"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:y("pptx.print.to")}),jsxRuntime.jsx("input",{type:"number",min:1,max:x,value:f,onChange:b=>m(Math.max(1,parseInt(b.target.value,10)||1)),className:"w-16 px-2 py-1 text-sm border border-border rounded bg-background text-foreground"})]})]})]}),t==="slides"&&jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.orientation")}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("label",{className:ma(n==="landscape"),children:[jsxRuntime.jsx("input",{type:"radio",name:"orientation",className:"sr-only",checked:n==="landscape",onChange:()=>r("landscape")}),y("pptx.print.landscape")]}),jsxRuntime.jsxs("label",{className:ma(n==="portrait"),children:[jsxRuntime.jsx("input",{type:"radio",name:"orientation",className:"sr-only",checked:n==="portrait",onChange:()=>r("portrait")}),y("pptx.print.portrait")]})]})]}),jsxRuntime.jsxs("fieldset",{children:[jsxRuntime.jsx("legend",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:y("pptx.print.colorMode")}),jsxRuntime.jsxs("div",{className:"flex gap-2 flex-wrap",children:[jsxRuntime.jsxs("label",{className:ma(o==="color"),children:[jsxRuntime.jsx("input",{type:"radio",name:"colorMode",className:"sr-only",checked:o==="color",onChange:()=>i("color")}),y("pptx.print.color")]}),jsxRuntime.jsxs("label",{className:ma(o==="grayscale"),children:[jsxRuntime.jsx("input",{type:"radio",name:"colorMode",className:"sr-only",checked:o==="grayscale",onChange:()=>i("grayscale")}),y("pptx.print.grayscale")]}),jsxRuntime.jsxs("label",{className:ma(o==="blackAndWhite"),children:[jsxRuntime.jsx("input",{type:"radio",name:"colorMode",className:"sr-only",checked:o==="blackAndWhite",onChange:()=>i("blackAndWhite")}),y("pptx.print.blackAndWhite")]})]})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:s,onChange:b=>a(b.target.checked),className:"rounded border-border"}),jsxRuntime.jsx("span",{className:"text-sm text-foreground",children:y("pptx.print.frameSlides")})]})]})}function wG({open:t,onClose:e,onPrint:n,slides:r,activeSlideIndex:o,defaultSlidesPerPage:i,defaultFrameSlides:s}){let{t:a}=reactI18next.useTranslation(),{panelStyle:l,handlers:c}=pi(e),[d,u]=Jm.useState("slides"),[p,h]=Jm.useState("landscape"),[f,m]=Jm.useState("color"),[x,g]=Jm.useState(s??false),[y,b]=Jm.useState(_T.includes(i)?i:6),[v,S]=Jm.useState("all"),[w,C]=Jm.useState(1),[T,M]=Jm.useState(r.length),_=Jm.useMemo(()=>d==="notes"||d==="outline"||d==="handouts"?"portrait":p,[d,p]),E=Jm.useMemo(()=>{if(v==="all")return r.length;if(v==="current")return 1;let k=Math.max(1,Math.min(w,r.length));return Math.max(k,Math.min(T,r.length))-k+1},[v,r.length,w,T]),R=Jm.useMemo(()=>d==="slides"||d==="notes"?E:d==="outline"?1:Math.ceil(E/y),[d,E,y]),I=Jm.useMemo(()=>{if(v==="current")return [o];if(v==="custom"){let k=Math.max(0,w-1),F=Math.min(r.length-1,T-1);return Array.from({length:Math.max(0,F-k+1)},(N,D)=>k+D)}return Array.from({length:r.length},(k,F)=>F)},[v,o,w,T,r.length]),L=Jm.useCallback(()=>{n({printWhat:d,orientation:_,colorMode:f,frameSlides:x,slidesPerPage:y,slideRange:v,customRangeFrom:Math.max(1,Math.min(w,r.length)),customRangeTo:Math.max(1,Math.min(T,r.length))});},[d,_,f,x,y,v,w,T,r.length,n]);return t?jsxRuntime.jsx("div",{style:{zIndex:1200},className:"fixed inset-0 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:jsxRuntime.jsxs("div",{style:l,className:"w-[780px] max-h-[90vh] rounded-xl border border-border bg-background shadow-2xl flex flex-col max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...c,className:"flex items-center justify-between px-5 py-4 border-b border-border touch-none",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuPrinter,{className:"w-4 h-4 text-muted-foreground"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:a("pptx.print.title")})]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex gap-5",children:[jsxRuntime.jsx(Wfe,{printWhat:d,onPrintWhatChange:u,orientation:p,onOrientationChange:h,colorMode:f,onColorModeChange:m,frameSlides:x,onFrameSlidesChange:g,slidesPerPage:y,onSlidesPerPageChange:b,slideRange:v,onSlideRangeChange:S,customFrom:w,onCustomFromChange:C,customTo:T,onCustomToChange:M,totalSlides:r.length,activeSlideIndex:o}),d==="handouts"&&jsxRuntime.jsx("div",{className:"w-[230px] shrink-0 border-l border-border pl-4 overflow-y-auto",children:jsxRuntime.jsx(t5,{slideIndices:I,slidesPerPage:y,orientation:_,frameSlides:x})}),d==="notes"&&jsxRuntime.jsx("div",{className:"w-[230px] shrink-0 border-l border-border pl-4 overflow-y-auto",children:jsxRuntime.jsx(SG,{slideIndices:I,slides:r,frameSlides:x})})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border",children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:a("pptx.print.pageEstimate",{pages:R,slides:E})}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a("common.cancel")}),jsxRuntime.jsxs("button",{type:"button",onClick:L,className:"px-4 py-2 text-sm rounded-lg bg-primary text-white hover:bg-primary/90 transition-colors flex items-center gap-1.5",children:[jsxRuntime.jsx(lu$1.LuPrinter,{className:"w-3.5 h-3.5"}),a("pptx.print.printButton")]})]})]})]})}):null}function jfe({draft:t,update:e}){let{t:n}=reactI18next.useTranslation();return jsxRuntime.jsxs("fieldset",{className:"space-y-1.5",children:[jsxRuntime.jsx("legend",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:n("pptx.slideShow.showOptions")}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:!!t.loopContinuously,onChange:r=>e({loopContinuously:r.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:n("pptx.slideShow.loopContinuously")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:t.showWithNarration===false,onChange:r=>e({showWithNarration:!r.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:n("pptx.slideShow.showWithoutNarration")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:t.showWithAnimation===false,onChange:r=>e({showWithAnimation:!r.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:n("pptx.slideShow.showWithoutAnimation")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:!!t.showSubtitles,onChange:r=>e({showSubtitles:r.target.checked}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:n("pptx.slideShow.showSubtitles")})]})]})}function Yfe({draft:t,update:e,showSlidesMode:n,slideCount:r,customShows:o}){let{t:i}=reactI18next.useTranslation();return jsxRuntime.jsxs("fieldset",{className:"space-y-1.5",children:[jsxRuntime.jsx("legend",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:i("pptx.slideShow.showSlides")}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"showSlides",value:"all",checked:n==="all",onChange:()=>e({showSlidesMode:"all"}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:i("pptx.slideShow.allSlides")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"showSlides",value:"range",checked:n==="range",onChange:()=>e({showSlidesMode:"range",showSlidesFrom:t.showSlidesFrom??1,showSlidesTo:t.showSlidesTo??r}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:i("pptx.slideShow.fromTo")})]}),n==="range"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 ml-6",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i("pptx.slideShow.from")}),jsxRuntime.jsx("input",{type:"number",min:1,max:r,value:t.showSlidesFrom??1,onChange:s=>e({showSlidesFrom:Math.max(1,Number.parseInt(s.target.value,10)||1)}),className:"w-14 px-1.5 py-0.5 rounded bg-muted border border-border text-foreground text-[11px]"})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i("pptx.slideShow.to")}),jsxRuntime.jsx("input",{type:"number",min:1,max:r,value:t.showSlidesTo??r,onChange:s=>e({showSlidesTo:Math.min(r,Number.parseInt(s.target.value,10)||r)}),className:"w-14 px-1.5 py-0.5 rounded bg-muted border border-border text-foreground text-[11px]"})]})]}),o.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"showSlides",value:"customShow",checked:n==="customShow",onChange:()=>e({showSlidesMode:"customShow",showSlidesCustomShowId:t.showSlidesCustomShowId??o[0]?.id}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:i("pptx.slideShow.customShow")})]}),n==="customShow"&&jsxRuntime.jsx("div",{className:"ml-6",children:jsxRuntime.jsx("select",{value:t.showSlidesCustomShowId??o[0]?.id??"",onChange:s=>e({showSlidesCustomShowId:s.target.value}),className:"w-full px-2 py-1 rounded bg-muted border border-border text-foreground text-[11px]",children:o.map(s=>jsxRuntime.jsx("option",{value:s.id,children:s.name},s.id))})})]})]})}function TG({open:t,onClose:e,properties:n,onSave:r,customShows:o,slideCount:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState({...n}),c=Jm.useCallback(h=>{l(f=>({...f,...h}));},[]),d=Jm.useCallback(()=>{r(a),e();},[a,r,e]);if(!t)return null;let u=a.showType??"presented",p=a.showSlidesMode??"all";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/50","aria-label":"Close dialog",onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{className:"pointer-events-auto flex flex-col w-[440px] max-h-[90vh] rounded-xl border border-border bg-background shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("pptx.slideShow.setUpTitle")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex-1 px-5 py-4 space-y-5 text-[12px] text-foreground overflow-y-auto",children:[jsxRuntime.jsxs("fieldset",{className:"space-y-1.5",children:[jsxRuntime.jsx("legend",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:s("pptx.slideShow.showType")}),[["presented",s("pptx.slideShow.presentedBySpeaker")],["browsed",s("pptx.slideShow.browsedByIndividual")],["kiosk",s("pptx.slideShow.browsedAtKiosk")]].map(([h,f])=>jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"showType",value:h,checked:u===h,onChange:()=>c({showType:h,...h==="kiosk"?{loopContinuously:true}:{}}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:f})]},h))]}),jsxRuntime.jsx(Yfe,{draft:a,update:c,showSlidesMode:p,slideCount:i,customShows:o}),jsxRuntime.jsxs("fieldset",{className:"space-y-1.5",children:[jsxRuntime.jsx("legend",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:s("pptx.slideShow.advanceSlides")}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"advanceMode",value:"manual",checked:(a.advanceMode??"manual")==="manual",onChange:()=>c({advanceMode:"manual"}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:s("pptx.slideShow.manually")})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:"advanceMode",value:"useTimings",checked:a.advanceMode==="useTimings",onChange:()=>c({advanceMode:"useTimings"}),className:"accent-primary"}),jsxRuntime.jsx("span",{children:s("pptx.slideShow.useTimings")})]})]}),jsxRuntime.jsx(jfe,{draft:a,update:c})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border shrink-0",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 rounded bg-muted hover:bg-accent text-[12px] text-foreground transition-colors",children:s("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:d,className:"px-3 py-1.5 rounded bg-primary hover:bg-primary/80 text-[12px] text-white transition-colors",children:s("common.ok")})]})]})})]})}Pe();function EG({open:t,onClose:e,onStartBroadcast:n,onStopBroadcast:r,onStartPresenting:o,defaultRoomId:i,defaultUserName:s,defaultServerUrl:a}){let{t:l}=reactI18next.useTranslation(),c=No(),d=c!==null&&c.status!=="disconnected"&&c.status!=="error"&&c.config.role==="owner",[u,p]=Jm.useState(""),[h,f]=Jm.useState(""),[m,x]=Jm.useState(""),[g,y]=Jm.useState(false),b=Jm.useRef(null),{panelStyle:v,handlers:S}=pi(e);Jm.useEffect(()=>{if(t&&!d){let I=i?`broadcast-${i}`:$ne();p(I),f(s??""),x(a??Une);}},[t,d,i,s,a]),Jm.useEffect(()=>{if(!t)return;function I(L){L.key==="Escape"&&e();}return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,e]),Jm.useEffect(()=>{t&&b.current&&b.current.focus();},[t]);let w=d?c.config.roomId:u,C=d?c.config.serverUrl:m,T=typeof window<"u"?Hne(w,C,window.location):w,M=Jm.useCallback(()=>{navigator.clipboard.writeText(T).then(()=>{y(true),setTimeout(()=>y(false),2e3);});},[T]),_=Jm.useCallback(()=>{if(!u.trim()||!h.trim())return;let I=m.trim();n?.({roomId:u.trim(),serverUrl:I,userName:h.trim(),role:"owner",transport:qA(I)}),setTimeout(()=>{o?.();},100),e();},[u,h,m,n,o,e]),E=Jm.useCallback(()=>{r?.(),e();},[r,e]),R=u.trim().length>0&&h.trim().length>0;return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/50","aria-label":"Close dialog",onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":l("pptx.broadcast.title"),tabIndex:-1,style:v,className:"pointer-events-auto w-full max-w-md rounded-xl border border-border bg-popover text-foreground shadow-2xl outline-none max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...S,className:"flex items-center justify-between px-5 py-3 border-b border-border touch-none",children:[jsxRuntime.jsxs("h2",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuCast,{className:"w-4 h-4"}),l(d?"pptx.broadcast.broadcasting":"pptx.broadcast.title")]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"px-5 py-4",children:d?jsxRuntime.jsx(edt,{collab:c,broadcastUrl:T,copied:g,onCopyUrl:M,onStopBroadcast:E}):jsxRuntime.jsx(Qct,{roomId:u,userName:h,serverUrl:m,onRoomIdChange:p,onUserNameChange:f,onServerUrlChange:x})}),!d&&jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 rounded bg-muted hover:bg-accent text-[12px] text-foreground transition-colors",children:l("common.close")}),jsxRuntime.jsx("button",{type:"button",disabled:!R,onClick:_,className:"px-3 py-1.5 rounded bg-primary hover:bg-primary/90 text-[12px] text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:l("pptx.broadcast.startBroadcast")})]})]})})]}):null}function Qct({roomId:t,userName:e,serverUrl:n,onRoomIdChange:r,onUserNameChange:o,onServerUrlChange:i}){let{t:s}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed",children:s("pptx.broadcast.description")}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"broadcast-room-id",className:"block text-[12px] font-medium text-foreground",children:s("pptx.broadcast.sessionName")}),jsxRuntime.jsx("input",{id:"broadcast-room-id",type:"text",value:t,onChange:a=>r(a.target.value),placeholder:"broadcast-abc123",className:"w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"broadcast-user-name",className:"block text-[12px] font-medium text-foreground",children:s("pptx.broadcast.displayName")}),jsxRuntime.jsx("input",{id:"broadcast-user-name",type:"text",value:e,onChange:a=>o(a.target.value),placeholder:"Presenter",className:"w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"broadcast-server-url",className:"block text-[12px] font-medium text-foreground",children:s("pptx.broadcast.serverLabel")}),jsxRuntime.jsx("input",{id:"broadcast-server-url",type:"text",value:n,onChange:a=>i(a.target.value),placeholder:"ws://localhost:1234",className:"w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground/70 leading-relaxed",children:n.trim().length===0?s("pptx.broadcast.p2pHint"):s("pptx.broadcast.hint")})]})}function edt({collab:t,broadcastUrl:e,copied:n,onCopyUrl:r,onStopBroadcast:o}){let{t:i}=reactI18next.useTranslation(),s=t.status==="connected"?"text-green-400":t.status==="connecting"?"text-yellow-400":"text-red-400",a=t.status==="connected"||t.status==="connecting"?jsxRuntime.jsx(lu$1.LuWifi,{className:"w-4 h-4"}):jsxRuntime.jsx(lu$1.LuWifiOff,{className:"w-4 h-4"}),l=t.remoteUsers.filter(c=>c.role==="viewer").length;return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:s,children:a}),jsxRuntime.jsx("span",{className:"text-[13px] font-medium text-foreground capitalize",children:t.status}),jsxRuntime.jsxs("span",{className:"text-[12px] text-muted-foreground ml-auto flex items-center gap-1",children:[jsxRuntime.jsx(lu$1.LuUsers,{className:"w-3.5 h-3.5"}),i("pptx.broadcast.viewerCount",{count:l})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"block text-[12px] font-medium text-foreground",children:i("pptx.broadcast.viewerLink")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex-1 px-3 py-1.5 rounded border border-border bg-background text-[11px] text-foreground select-all font-mono truncate",children:e}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"flex items-center gap-1 px-2.5 py-1.5 rounded border border-border bg-muted hover:bg-accent text-[12px] text-foreground transition-colors shrink-0",title:i("pptx.broadcast.copyLink"),children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3.5 h-3.5 text-green-400"}),jsxRuntime.jsx("span",{children:i("pptx.share.copied")})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lu$1.LuCopy,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:i("pptx.share.copyUrl")})]})})]}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:i("pptx.broadcast.shareHint")})]}),t.remoteUsers.length>0&&jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"block text-[12px] font-medium text-foreground",children:i("pptx.broadcast.viewers")}),jsxRuntime.jsx("div",{className:"rounded border border-border bg-background divide-y divide-border max-h-[120px] overflow-y-auto",children:t.remoteUsers.map(c=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-semibold text-white shrink-0",style:{backgroundColor:c.userColor},children:c.userName.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:"text-[12px] text-foreground truncate",children:c.userName}),jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground ml-auto",children:["Slide ",c.activeSlideIndex+1]})]},c.clientId))})]}),jsxRuntime.jsx("button",{type:"button",onClick:o,className:"w-full px-3 py-2 rounded border border-red-500/30 bg-red-500/10 hover:bg-red-500/20 text-[12px] text-red-400 font-medium transition-colors",children:i("pptx.broadcast.stopBroadcast")})]})}Pe();function Zfe(t){let e=t.trim().split(/\s+/u);return e.length>=2?(e[0][0]+e[e.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function Qfe(t){return t.transport==="webrtc"||!t.serverUrl?.trim()}function eme(t){if(typeof window>"u")return t.roomId;let e=`${window.location.origin}${window.location.pathname}`,n=encodeURIComponent(t.roomId);return Qfe(t)?`${e}?room=${n}&transport=webrtc`:`${e}?room=${n}&server=${encodeURIComponent(t.serverUrl??"")}`}function IG({open:t,onClose:e,activeCollaboration:n,onStartCollaboration:r,onStopCollaboration:o,preconfigured:i,defaultRoomId:s,defaultUserName:a,defaultServerUrl:l}){let c=No(),d=c!==null&&c.status!=="disconnected"&&c.status!=="error",{t:u}=reactI18next.useTranslation(),[p,h]=Jm.useState(s??""),[f,m]=Jm.useState(a??""),[x,g]=Jm.useState(l??""),[y,b]=Jm.useState(false),v=Jm.useRef(null),{panelStyle:S,handlers:w}=pi(e);Jm.useEffect(()=>{n&&(h(n.roomId),m(n.userName),g(n.serverUrl));},[n]),Jm.useEffect(()=>{if(!t)return;function _(E){E.key==="Escape"&&e();}return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[t,e]),Jm.useEffect(()=>{t&&v.current&&v.current.focus();},[t]);let C=Jm.useCallback(()=>{let _=n??{roomId:p,serverUrl:x};navigator.clipboard.writeText(eme(_)).then(()=>{b(true),setTimeout(()=>b(false),2e3);});},[n,p,x]),T=Jm.useCallback(()=>{if(!p.trim()||!f.trim())return;let _=x.trim();r?.({roomId:p.trim(),serverUrl:_,userName:f.trim(),transport:qA(_)});},[p,f,x,r]),M=p.trim().length>0&&f.trim().length>0;return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/50","aria-label":u("pptx.share.closeDialog"),onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{ref:v,role:"dialog","aria-modal":"true","aria-label":u("pptx.share.title"),tabIndex:-1,style:S,className:"pointer-events-auto w-full max-w-md rounded-xl border border-border bg-popover text-foreground shadow-2xl outline-none max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...w,className:"flex items-center justify-between px-5 py-3 border-b border-border touch-none",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:u(d?"pptx.share.collaborationActive":"pptx.share.title")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":u("pptx.share.close"),children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"px-5 py-4",children:d?jsxRuntime.jsx(adt,{collab:c,activeCollaboration:n,copied:y,onCopyRoomId:C,onStopCollaboration:o}):jsxRuntime.jsx(sdt,{roomId:p,userName:f,serverUrl:x,onRoomIdChange:h,onUserNameChange:m,onServerUrlChange:g,preconfigured:i,connectionFailed:c?.status==="error",onRetry:c?.retry})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 rounded bg-muted hover:bg-accent text-[12px] text-foreground transition-colors",children:u(d?"pptx.share.close":"pptx.share.cancel")}),!d&&jsxRuntime.jsx("button",{type:"button",disabled:!M,onClick:T,className:"px-3 py-1.5 rounded bg-primary hover:bg-primary/90 text-[12px] text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:u("pptx.share.startSharing")})]})]})})]}):null}function sdt({roomId:t,userName:e,serverUrl:n,onRoomIdChange:r,onUserNameChange:o,onServerUrlChange:i,preconfigured:s,connectionFailed:a,onRetry:l}){let{t:c}=reactI18next.useTranslation(),d=s?" opacity-70 cursor-not-allowed":"";return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed",children:c(s?"pptx.share.preconfiguredDescription":"pptx.share.description")}),a&&jsxRuntime.jsxs("div",{role:"alert",className:"flex items-start gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-[12px] text-red-400",children:[jsxRuntime.jsx(lu$1.LuWifiOff,{className:"w-4 h-4 mt-0.5 shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1 space-y-1",children:[jsxRuntime.jsx("p",{className:"font-medium",children:c("pptx.share.connectionError")}),l&&jsxRuntime.jsx("button",{type:"button",onClick:l,className:"underline underline-offset-2 hover:no-underline",children:c("pptx.collaboration.retry")})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"share-room-id",className:"block text-[12px] font-medium text-foreground",children:c("pptx.share.sessionName")}),jsxRuntime.jsx("input",{id:"share-room-id",type:"text","aria-label":c("pptx.share.sessionName"),value:t,onChange:u=>r(u.target.value),readOnly:s,placeholder:c("pptx.share.sessionPlaceholder"),className:`w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary${d}`}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:c("pptx.share.sessionHint")})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"share-user-name",className:"block text-[12px] font-medium text-foreground",children:c("pptx.share.displayName")}),jsxRuntime.jsx("input",{id:"share-user-name",type:"text","aria-label":c("pptx.share.displayName"),value:e,onChange:u=>o(u.target.value),readOnly:s,placeholder:c("pptx.share.namePlaceholder"),className:`w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary${d}`})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{htmlFor:"share-server-url",className:"block text-[12px] font-medium text-foreground",children:c("pptx.share.serverLabel")}),jsxRuntime.jsx("input",{id:"share-server-url",type:"text","aria-label":c("pptx.share.serverLabel"),value:n,onChange:u=>i(u.target.value),readOnly:s,placeholder:c("pptx.share.serverPlaceholder"),className:`w-full px-3 py-1.5 rounded border border-border bg-background text-foreground text-[13px] placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary${d}`})]}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:n.trim().length===0?c("pptx.share.p2pHint"):c("pptx.share.serverHint")})]})}function adt({collab:t,activeCollaboration:e,copied:n,onCopyRoomId:r,onStopCollaboration:o}){let{t:i}=reactI18next.useTranslation(),s=t.status==="connected"?"text-green-400":t.status==="connecting"?"text-yellow-400":"text-red-400",a=t.status==="connected"||t.status==="connecting"?jsxRuntime.jsx(lu$1.LuWifi,{className:"w-4 h-4"}):jsxRuntime.jsx(lu$1.LuWifiOff,{className:"w-4 h-4"});return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:s,children:a}),jsxRuntime.jsx("span",{className:"text-[13px] font-medium text-foreground capitalize",children:t.status}),jsxRuntime.jsxs("span",{className:"text-[12px] text-muted-foreground ml-auto flex items-center gap-1",children:[jsxRuntime.jsx(lu$1.LuUsers,{className:"w-3.5 h-3.5"}),i("pptx.collaboration.userCount",{count:t.connectedCount})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"block text-[12px] font-medium text-foreground",children:i("pptx.share.shareLink")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex-1 px-3 py-1.5 rounded border border-border bg-background text-[11px] text-foreground select-all font-mono truncate",children:eme(t.config)}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"flex items-center gap-1 px-2.5 py-1.5 rounded border border-border bg-muted hover:bg-accent text-[12px] text-foreground transition-colors shrink-0",title:i("pptx.share.copyLink"),children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3.5 h-3.5 text-green-400"}),jsxRuntime.jsx("span",{children:i("pptx.share.copied")})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lu$1.LuCopy,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:i("pptx.share.copyUrl")})]})})]}),jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:i("pptx.share.shareHint")})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-muted-foreground",children:[jsxRuntime.jsxs("span",{children:[i("pptx.share.room")," ",jsxRuntime.jsx("code",{className:"font-mono text-foreground",children:t.config.roomId})]}),jsxRuntime.jsxs("span",{children:[i("pptx.share.server")," ",jsxRuntime.jsx("code",{className:"font-mono text-foreground",children:Qfe(t.config)?i("pptx.share.p2pServerValue"):t.config.serverUrl})]})]}),t.remoteUsers.length>0&&jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"block text-[12px] font-medium text-foreground",children:i("pptx.share.connectedUsers")}),jsxRuntime.jsxs("div",{className:"rounded border border-border bg-background divide-y divide-border max-h-[140px] overflow-y-auto",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-semibold text-white shrink-0",style:{backgroundColor:t.config.userColor??"#6366f1"},children:Zfe(e?.userName??t.config.userName)}),jsxRuntime.jsx("span",{className:"text-[12px] text-foreground truncate",children:e?.userName??t.config.userName}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:i("pptx.share.you")})]}),t.remoteUsers.map(l=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-semibold text-white shrink-0",style:{backgroundColor:l.userColor},children:l.userAvatar?jsxRuntime.jsx("img",{src:l.userAvatar,alt:"",className:"w-full h-full rounded-full object-cover"}):Zfe(l.userName)}),jsxRuntime.jsx("span",{className:"text-[12px] text-foreground truncate",children:l.userName}),jsxRuntime.jsxs("span",{className:"text-[10px] text-muted-foreground ml-auto",children:["Slide ",l.activeSlideIndex+1]})]},l.clientId))]})]}),o&&jsxRuntime.jsx("button",{type:"button",onClick:o,className:"w-full px-3 py-2 rounded border border-red-500/30 bg-red-500/10 hover:bg-red-500/20 text-[12px] text-red-400 font-medium transition-colors",children:i("pptx.share.stopSharing")})]})}function tme({targetType:t,url:e,setUrl:n,tooltip:r,setTooltip:o,emailAddress:i,setEmailAddress:s,emailSubject:a,setEmailSubject:l,slideNumber:c,setSlideNumber:d,slideCount:u,filePath:p,setFilePath:h,actionVerb:f,setActionVerb:m,inputRef:x,inputCls:g,onEnterConfirm:y}){let{t:b}=reactI18next.useTranslation(),v=S=>{S.key==="Enter"&&y();};return jsxRuntime.jsxs("div",{className:"px-4 py-3 space-y-3",children:[t==="url"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.urlLabel")}),jsxRuntime.jsx("input",{ref:x,type:"url",className:g,placeholder:"https://example.com",value:e,onChange:S=>n(S.target.value),onKeyDown:v})]}),t==="email"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.emailLabel")}),jsxRuntime.jsx("input",{ref:x,type:"email",className:g,placeholder:"user@example.com",value:i,onChange:S=>s(S.target.value),onKeyDown:v})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.subjectLabel")}),jsxRuntime.jsx("input",{type:"text",className:g,value:a,onChange:S=>l(S.target.value)})]})]}),t==="slide"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.slideLabel")}),jsxRuntime.jsx("input",{ref:x,type:"number",min:1,max:u,className:g,value:c,onChange:S=>d(parseInt(S.target.value,10)||1),onKeyDown:v}),jsxRuntime.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:b("pptx.hyperlink.slideRange",{max:u})})]}),t==="file"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.fileLabel")}),jsxRuntime.jsx("input",{ref:x,type:"text",className:g,placeholder:"../documents/file.docx",value:p,onChange:S=>h(S.target.value),onKeyDown:v})]}),t==="action"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.actionLabel")}),jsxRuntime.jsxs("select",{className:g,value:f,onChange:S=>m(S.target.value),children:[jsxRuntime.jsx("option",{value:"nextSlide",children:b("pptx.hyperlink.actionNextSlide")}),jsxRuntime.jsx("option",{value:"prevSlide",children:b("pptx.hyperlink.actionPrevSlide")}),jsxRuntime.jsx("option",{value:"firstSlide",children:b("pptx.hyperlink.actionFirstSlide")}),jsxRuntime.jsx("option",{value:"lastSlide",children:b("pptx.hyperlink.actionLastSlide")}),jsxRuntime.jsx("option",{value:"endShow",children:b("pptx.hyperlink.actionEndShow")})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:b("pptx.hyperlink.tooltipLabel")}),jsxRuntime.jsx("input",{type:"text",className:g,value:r,onChange:S=>o(S.target.value)})]})]})}function NG({open:t,initialUrl:e,initialTooltip:n,initialAction:r,slideCount:o,onConfirm:i,onCancel:s}){let{t:a}=reactI18next.useTranslation(),{panelStyle:l,handlers:c}=pi(s),d=Jm.useRef(null),u=zde(e,r),p=Vde(e||""),h=Gde(e,r),f=r&&tN[r.toLowerCase()]||"nextSlide",[m,x]=Jm.useState(u),[g,y]=Jm.useState(u==="email"||u==="slide"||u==="action"?"":e||""),[b,v]=Jm.useState(n||""),[S,w]=Jm.useState(p.address),[C,T]=Jm.useState(p.subject),[M,_]=Jm.useState(h),[E,R]=Jm.useState(u==="file"&&e||""),[I,L]=Jm.useState(f);if(Jm.useEffect(()=>{t&&setTimeout(()=>d.current?.focus(),50);},[t]),!t)return null;let k=()=>{i({targetType:m,url:g,tooltip:b,emailAddress:S,emailSubject:C,slideNumber:M,filePath:E,actionVerb:I});},F=D=>ie("px-3 py-1.5 text-xs rounded-t border-b-2 transition-colors",D?"border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:border-border");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:{zIndex:1200},className:"fixed inset-0 bg-black/40",onClick:s}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{style:l,className:"pointer-events-auto w-[440px] rounded-lg border border-border bg-popover shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",onClick:D=>D.stopPropagation(),children:[jsxRuntime.jsxs("div",{...c,className:"flex items-center justify-between px-4 py-3 border-b border-border touch-none",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:a("pptx.hyperlink.editTitle")}),jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground",onClick:s,children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex gap-1 px-4 pt-2 border-b border-border",children:[jsxRuntime.jsx("button",{type:"button",className:F(m==="url"),onClick:()=>x("url"),children:a("pptx.hyperlink.tabUrl")}),jsxRuntime.jsx("button",{type:"button",className:F(m==="email"),onClick:()=>x("email"),children:a("pptx.hyperlink.tabEmail")}),jsxRuntime.jsx("button",{type:"button",className:F(m==="slide"),onClick:()=>x("slide"),children:a("pptx.hyperlink.tabSlide")}),jsxRuntime.jsx("button",{type:"button",className:F(m==="file"),onClick:()=>x("file"),children:a("pptx.hyperlink.tabFile")}),jsxRuntime.jsx("button",{type:"button",className:F(m==="action"),onClick:()=>x("action"),children:a("pptx.hyperlink.tabAction")})]}),jsxRuntime.jsx(tme,{targetType:m,url:g,setUrl:y,tooltip:b,setTooltip:v,emailAddress:S,setEmailAddress:w,emailSubject:C,setEmailSubject:T,slideNumber:M,setSlideNumber:_,slideCount:o,filePath:E,setFilePath:R,actionVerb:I,setActionVerb:L,inputRef:d,inputCls:"w-full rounded border border-border bg-background px-2.5 py-1.5 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary",onEnterConfirm:k}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded border border-border text-foreground hover:bg-muted",onClick:s,children:a("common.cancel")}),jsxRuntime.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded bg-primary text-white hover:bg-primary/90",onClick:k,children:a("common.apply")})]})]})})]})}function nme({guides:t,onDeleteGuide:e,onStartGuideDrag:n}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(r=>jsxRuntime.jsx("div",{className:"absolute z-[49] pointer-events-auto",style:r.axis==="h"?{left:0,right:0,top:r.position,height:1,backgroundColor:"rgba(250, 204, 21, 0.9)",cursor:"row-resize"}:{top:0,bottom:0,left:r.position,width:1,backgroundColor:"rgba(250, 204, 21, 0.9)",cursor:"col-resize"},onDoubleClick:o=>{o.stopPropagation(),e?.(r.id);},onPointerDown:o=>{o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId),n({id:r.id,axis:r.axis,pointerId:o.pointerId});},title:"Drag guide. Double-click to remove."},r.id))})}function rme({backgroundImage:t,backgroundGradient:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t&&jsxRuntime.jsx("img",{src:t,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none",draggable:false}),e&&jsxRuntime.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:e}})]})}function ome({marqueeSelectionState:t}){return t?jsxRuntime.jsx("div",{className:"absolute border border-primary bg-primary/10 pointer-events-none z-50",style:{left:Math.min(t.startX,t.currentX),top:Math.min(t.startY,t.currentY),width:Math.abs(t.currentX-t.startX),height:Math.abs(t.currentY-t.startY)}}):null}function ime({snapLines:t}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map((e,n)=>jsxRuntime.jsx("div",{className:"absolute bg-red-500 pointer-events-none z-50",style:e.axis==="x"?{left:e.position,top:0,width:1,height:"100%"}:{left:0,top:e.position,width:"100%",height:1}},n))})}function ame({comments:t,canvasSize:e,onCommentMarkerClick:n}){return jsxRuntime.jsx("div",{className:"absolute inset-0 pointer-events-none z-[45]",children:t.map((r,o)=>{let i=Z4(r,o,e.width,e.height);return jsxRuntime.jsx("div",{className:"absolute pointer-events-auto cursor-pointer",style:{left:i.x-10,top:i.y-10,width:20,height:20,borderRadius:"50%",backgroundColor:"rgba(255, 165, 0, 0.9)",border:"2px solid #fff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700,color:"#fff",lineHeight:1},title:`${r.author??"Comment"}: ${r.text}`,onClick:s=>{s.stopPropagation(),n?.(r.id);},children:o+1},r.id)})})}function lme({activeSlide:t,canvasSize:e,zoom:n,connectorDragState:r,onConnectionSiteDown:o,onConnectorDragMove:i,onConnectionSiteDrop:s,onConnectorDragEnd:a}){return jsxRuntime.jsxs("div",{className:"absolute inset-0 z-[55] pointer-events-none",onMouseMove:i,onMouseUp:a,style:{pointerEvents:r?"auto":"none"},children:[t.elements.filter(l=>l.type!=="connector").map(l=>Dc(l.width,l.height).map(d=>jsxRuntime.jsx("div",{className:"absolute rounded-full border-2 border-blue-500 bg-blue-400/60 hover:bg-blue-500 hover:scale-125 transition-transform cursor-crosshair",style:{left:l.x+d.x-5,top:l.y+d.y-5,width:10,height:10,pointerEvents:"auto",zIndex:56},onMouseDown:u=>o(l.id,d.index,u),onMouseUp:()=>r?s(l.id,d.index):void 0},`${l.id}-site-${d.index}`))),r&&jsxRuntime.jsx(gdt,{activeSlide:t,canvasSize:e,zoom:n,connectorDragState:r})]})}function gdt({activeSlide:t,canvasSize:e,zoom:n,connectorDragState:r}){let o=t.elements.find(f=>f.id===r.startElementId);if(!o)return null;let i=Dc(o.width,o.height),s=i[r.startSiteIndex]??i[0],a=o.x+s.x,l=o.y+s.y,c=n.canvasStageRef.current;if(!c)return null;let d=c.getBoundingClientRect(),u=n.editorScale||1,p=(r.currentX-d.left)/u,h=(r.currentY-d.top)/u;return jsxRuntime.jsx("svg",{className:"absolute inset-0",style:{width:e.width,height:e.height,pointerEvents:"none"},viewBox:`0 0 ${e.width} ${e.height}`,children:jsxRuntime.jsx("line",{x1:a,y1:l,x2:p,y2:h,stroke:"#3b82f6",strokeWidth:2,strokeDasharray:"6 4",strokeLinecap:"round"})})}function dme({canvasSize:t,activeTool:e,drawingColor:n,drawingWidth:r,isStrokeActive:o,liveStrokeD:i,onPointerDown:s,onPointerMove:a,onPointerUp:l}){return jsxRuntime.jsx("svg",{className:"absolute inset-0 z-[60]",style:{width:t.width,height:t.height,cursor:"crosshair",touchAction:"none"},viewBox:`0 0 ${t.width} ${t.height}`,onPointerDown:s,onPointerMove:a,onPointerUp:l,children:o&&i&&jsxRuntime.jsx("path",{d:i,fill:"none",stroke:n,strokeWidth:r,strokeOpacity:e==="highlighter"?.4:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function ume({canvasSize:t,gridSpacingPx:e=8,visible:n}){let r=Math.max(e,2),o=Jm.useMemo(()=>`grid-dot-pattern-${Math.random().toString(36).slice(2,8)}`,[]);return n?jsxRuntime.jsxs("svg",{className:"absolute inset-0 pointer-events-none z-[2]",width:t.width,height:t.height,xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("pattern",{id:o,width:r,height:r,patternUnits:"userSpaceOnUse",children:jsxRuntime.jsx("circle",{cx:r/2,cy:r/2,r:.6,fill:"rgba(156, 163, 175, 0.55)"})})}),jsxRuntime.jsx("rect",{width:t.width,height:t.height,fill:`url(#${o})`})]}):null}Pe();var DG=Jm__default.default.memo(({ticks:t,widthPx:e,highlight:n})=>jsxRuntime.jsxs("svg",{width:e,height:gn,className:"block select-none","aria-hidden":"true",children:[jsxRuntime.jsx("rect",{width:e,height:gn,className:"fill-gray-100 dark:fill-gray-800"}),jsxRuntime.jsx("line",{x1:0,y1:gn-.5,x2:e,y2:gn-.5,className:"stroke-border",strokeWidth:1}),n&&jsxRuntime.jsx("rect",{x:n.start,y:0,width:Math.max(n.end-n.start,1),height:gn,className:"fill-primary/20"}),t.map((r,o)=>{let i=r.isMajor?gn*.6:gn*.3;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:r.position,y1:gn,x2:r.position,y2:gn-i,className:"stroke-gray-400 dark:stroke-gray-500",strokeWidth:r.isMajor?1:.5}),r.label&&jsxRuntime.jsx("text",{x:r.position+2,y:Oy+1,fontSize:Oy,className:"fill-gray-500 dark:fill-gray-400",style:{fontFamily:"system-ui, sans-serif"},children:r.label})]},o)})]}));DG.displayName="HorizontalRuler";var FG=Jm__default.default.memo(({ticks:t,heightPx:e,highlight:n})=>jsxRuntime.jsxs("svg",{width:gn,height:e,className:"block select-none","aria-hidden":"true",children:[jsxRuntime.jsx("rect",{width:gn,height:e,className:"fill-gray-100 dark:fill-gray-800"}),jsxRuntime.jsx("line",{x1:gn-.5,y1:0,x2:gn-.5,y2:e,className:"stroke-border",strokeWidth:1}),n&&jsxRuntime.jsx("rect",{x:0,y:n.start,width:gn,height:Math.max(n.end-n.start,1),className:"fill-primary/20"}),t.map((r,o)=>{let i=r.isMajor?gn*.6:gn*.3;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:gn,y1:r.position,x2:gn-i,y2:r.position,className:"stroke-gray-400 dark:stroke-gray-500",strokeWidth:r.isMajor?1:.5}),r.label&&jsxRuntime.jsx("text",{x:2,y:r.position+Oy+2,fontSize:Oy,className:"fill-gray-500 dark:fill-gray-400",style:{fontFamily:"system-ui, sans-serif"},children:r.label})]},o)})]}));FG.displayName="VerticalRuler";function fme({canvasSize:t,editorScale:e,unit:n,visible:r,selectedBounds:o,onCreateGuideFromRuler:i}){let s=Jm.useMemo(()=>OA(t.width,e,n),[t.width,e,n]),a=Jm.useMemo(()=>OA(t.height,e,n),[t.height,e,n]),l=Jm.useMemo(()=>o?{start:o.x*e,end:(o.x+o.width)*e}:null,[o,e]),c=Jm.useMemo(()=>o?{start:o.y*e,end:(o.y+o.height)*e}:null,[o,e]),[d,u]=Jm.useState(null),p=Jm.useRef(null),h=Jm.useRef(null),f=Jm.useCallback(b=>{i&&(b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId),u({axis:"h",pointerId:b.pointerId}));},[i]),m=Jm.useCallback(b=>{i&&(b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId),u({axis:"v",pointerId:b.pointerId}));},[i]),x=Jm.useCallback(b=>{if(!d||!i)return;try{b.currentTarget.releasePointerCapture(d.pointerId);}catch{}let v=e||1;if(d.axis==="h"){let S=p.current;if(!S){u(null);return}let w=S.getBoundingClientRect(),C=b.clientY-w.top;if(C>gn){let T=(C-gn)/v;T>=0&&T<=t.height&&i("h",T);}}else {let S=h.current;if(!S){u(null);return}let w=S.getBoundingClientRect(),C=b.clientX-w.left;if(C>gn){let T=(C-gn)/v;T>=0&&T<=t.width&&i("v",T);}}u(null);},[d,i,e,t]);if(!r)return null;let g=t.width*e,y=t.height*e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute z-[51] bg-gray-100 dark:bg-gray-800 border-r border-b border-border",style:{top:0,left:0,width:gn,height:gn}}),jsxRuntime.jsx("div",{ref:p,className:"absolute z-[50] overflow-visible",style:{top:0,left:gn,width:g,height:gn,cursor:i?"row-resize":void 0},onPointerDown:f,onPointerUp:x,children:jsxRuntime.jsx(DG,{ticks:s,widthPx:g,highlight:l})}),jsxRuntime.jsx("div",{ref:h,className:"absolute z-[50] overflow-visible",style:{top:gn,left:0,width:gn,height:y,cursor:i?"col-resize":void 0},onPointerDown:m,onPointerUp:x,children:jsxRuntime.jsx(FG,{ticks:a,heightPx:y,highlight:c})})]})}function yv(t){let e=t.target;for(;e;){if(e.dataset?.pptxElement==="true")return e.dataset.elementId||null;e=e.parentElement;}return null}var Cdt=300;function Mdt(t,e){return t===e}function xme({cbRef:t,onCanvasMouseDown:e,findResults:n,findResultIndex:r,activeSlideIndex:o,selectedElement:i,zoom:s,onMoveGuide:a}){let l=Jm.useMemo(()=>{let w=new Map;if(!n||n.length===0||o===null)return w;for(let C=0;C<n.length;C++){let T=n[C];if(T.slideIndex!==o)continue;w.has(T.elementId)||w.set(T.elementId,new Map);let M=w.get(T.elementId);M.has(T.segmentIndex)||M.set(T.segmentIndex,[]),M.get(T.segmentIndex).push({startOffset:T.startOffset,length:T.length,isCurrent:C===(r??-1)});}return w},[n,r,o]),c=Jm.useMemo(()=>i?{x:i.x,y:i.y,width:i.width,height:i.height}:null,[i]),d=Jm.useCallback(w=>{let C=yv(w);C&&t.current.onClick(C,w);},[t]),u=Jm.useCallback(w=>{let C=yv(w);C&&t.current.onDoubleClick(C,w);},[t]),p=Jm.useRef(false),h=Jm.useCallback(w=>{if(p.current){p.current=false;return}let C=yv(w);if(C){t.current.onMouseDown(C,w);return}e?.(w);},[t,e]),f=Jm.useCallback(w=>{Mdt(w.target,w.currentTarget)&&e?.(w);},[e]),m=Jm.useRef(null),x=Jm.useCallback(w=>{if(w.pointerType==="mouse")return;p.current=true,w.currentTarget.setPointerCapture?.(w.pointerId);let C=yv(w);if(C){let T=w.timeStamp||Date.now(),M=m.current;if(M&&M.id===C&&T-M.time<Cdt){m.current=null,t.current.onDoubleClick(C,w);return}m.current={id:C,time:T},t.current.onMouseDown(C,w);return}m.current=null,e?.(w);},[t,e]),g=Jm.useCallback(w=>{let C=yv(w);C&&t.current.onContextMenu(C,w);},[t]),[y,b]=Jm.useState(null),v=Jm.useCallback(w=>{if(!y||!a)return;let C=s.canvasStageRef.current;if(!C)return;let T=C.getBoundingClientRect(),M=s.editorScale||1,_=y.axis==="h"?(w.clientY-T.top)/M:(w.clientX-T.left)/M;a(y.id,_);},[y,a,s.canvasStageRef,s.editorScale]),S=Jm.useCallback(w=>{if(y){try{w.currentTarget.releasePointerCapture(y.pointerId);}catch{}b(null);}},[y]);return {elementFindHighlightsMap:l,selectedBounds:c,handleStageClick:d,handleStageDblClick:u,handleStageMouseDown:h,handleViewportMouseDown:f,handleStagePointerDown:x,handleStageContextMenu:g,draggingGuide:y,setDraggingGuide:b,handleStagePointerMove:v,handleStagePointerUp:S}}function yme({activeSlide:t,zoom:e,onCreateConnector:n}){let[r,o]=Jm.useState(null),i=Jm.useCallback((c,d,u)=>{u.stopPropagation(),u.preventDefault(),o({startElementId:c,startSiteIndex:d,currentX:u.clientX,currentY:u.clientY});},[]),s=Jm.useCallback(c=>{r&&o(d=>d?{...d,currentX:c.clientX,currentY:c.clientY}:null);},[r]),a=Jm.useCallback((c,d)=>{if(!r||!n)return;if(r.startElementId===c){o(null);return}let u=t?.elements.find(_=>_.id===r.startElementId),p=t?.elements.find(_=>_.id===c);if(!u||!p){o(null);return}let h=Dc(u.width,u.height),f=Dc(p.width,p.height),m=h[r.startSiteIndex]??h[0],x=f[d]??f[0],g=u.x+m.x,y=u.y+m.y,b=p.x+x.x,v=p.y+x.y,S=Math.abs(b-g),w=Math.abs(v-y),C=Math.sqrt(S*S+w*w),T=C<100?"straightConnector1":C<300?"bentConnector3":"curvedConnector3",M={id:`conn-new-${Date.now()}`,type:"connector",x:Math.min(g,b),y:Math.min(y,v),width:Math.abs(b-g)||1,height:Math.abs(v-y)||1,shapeType:T,shapeStyle:{strokeColor:"#4472C4",strokeWidth:2,connectorStartConnection:{shapeId:r.startElementId,connectionSiteIndex:r.startSiteIndex},connectorEndConnection:{shapeId:c,connectionSiteIndex:d}}};n(M),o(null);},[r,n,t?.elements]),l=Jm.useCallback(()=>{o(null);},[]);return {connectorDragState:r,handleConnectionSiteDown:i,handleConnectorDragMove:s,handleConnectionSiteDrop:a,handleConnectorDragEnd:l}}function bme({activeTool:t,activeSlide:e,zoom:n,drawingColor:r,drawingWidth:o,isDrawingRef:i,onAddInkElement:s,onAddFreeformShape:a,onEraseInkElement:l}){let c=t!=="select",[d,u]=Jm.useState([]),[p,h]=Jm.useState([]),[f,m]=Jm.useState(false),x=Jm.useCallback(w=>{let C=n.canvasStageRef.current;if(!C)return null;let T=C.getBoundingClientRect(),M=n.editorScale||1;return {x:(w.clientX-T.left)/M,y:(w.clientY-T.top)/M}},[n.canvasStageRef,n.editorScale]),g=Jm.useCallback(w=>{if(w.length===0)return "";let C=[`M ${w[0].x} ${w[0].y}`];for(let T=1;T<w.length;T++)C.push(`L ${w[T].x} ${w[T].y}`);return C.join(" ")},[]),y=Jm.useCallback(w=>{if(t==="select")return;if(t==="eraser"&&e){let T=x(w);if(!T)return;let M=15;for(let _ of [...e.elements].reverse())if(_.type==="ink"&&T.x>=_.x-M&&T.x<=_.x+_.width+M&&T.y>=_.y-M&&T.y<=_.y+_.height+M){l?.(_.id);break}return}let C=x(w);C&&(w.preventDefault(),w.target.setPointerCapture(w.pointerId),u([C]),h([w.pressure]),m(true),i&&(i.current=true));},[t,e,x,i,l]),b=Jm.useCallback(w=>{if(!f||t==="select"||t==="eraser")return;let C=x(w);C&&(u(T=>[...T,C]),h(T=>[...T,w.pressure]));},[f,t,x]),v=Jm.useCallback(w=>{if(!f||t==="select"||t==="eraser")return;if(w.target.releasePointerCapture(w.pointerId),m(false),i&&(i.current=false),d.length<2){u([]);return}let C=1/0,T=1/0,M=-1/0,_=-1/0;for(let k of d)k.x<C&&(C=k.x),k.y<T&&(T=k.y),k.x>M&&(M=k.x),k.y>_&&(_=k.y);let E=o;C-=E,T-=E,M+=E,_+=E;let R=Math.max(M-C,1),I=Math.max(_-T,1),L=d.map(k=>({x:k.x-C,y:k.y-T}));if(t==="freeform"){let F=Math.round(R*100),N=Math.round(I*100),D=[];for(let G=0;G<L.length;G++){let j={x:Math.round(L[G].x*100),y:Math.round(L[G].y*100)};D.push(G===0?{type:"moveTo",pt:j}:{type:"lineTo",pt:j});}D.length>2&&D.push({type:"close"});let U={id:`shape-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"shape",x:C,y:T,width:R,height:I,shapeType:"custom",shapeStyle:{fillColor:"transparent",strokeColor:r,strokeWidth:o},customGeometryPaths:[{width:F,height:N,segments:D}]};a?.(U);}else {let k=g(L),F=t==="highlighter",N=p.length>=2&&p.some(U=>Math.abs(U-p[0])>.01),D={id:`ink-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:"ink",x:C,y:T,width:R,height:I,inkPaths:[k],inkColors:[r],inkWidths:[o],inkOpacities:[F?.4:1],inkTool:F?"highlighter":"pen",...N?{inkPointPressures:[p]}:{}};s?.(D);}u([]),h([]);},[f,t,d,r,o,i,s,a,g,p]),S=Jm.useMemo(()=>f?g(d):"",[f,d,g]);return {isDrawing:c,isStrokeActive:f,liveStrokeD:S,currentStrokePoints:d,handleDrawPointerDown:y,handleDrawPointerMove:b,handleDrawPointerUp:v}}function vme(t){let e=Jm.useRef(t);e.current=t;let n=Jm.useCallback((f,m,x)=>e.current.onResizePointerDown(f,m,x),[]),r=Jm.useCallback((f,m)=>e.current.onAdjustmentPointerDown(f,m),[]),o=Jm.useCallback((f,m)=>e.current.onRotate?.(f,m),[]),i=Jm.useCallback(f=>e.current.onInlineEditChange(f),[]),s=Jm.useCallback(()=>e.current.onInlineEditCommit(),[]),a=Jm.useCallback(()=>e.current.onInlineEditCancel(),[]),l=Jm.useCallback((f,m)=>e.current.onTableCellSelect(f,m),[]),c=Jm.useCallback((f,m,x,g)=>e.current.onCommitCellEdit?.(f,m,x,g),[]),d=Jm.useCallback((f,m)=>e.current.onUpdateSmartArtElement?.(f,m),[]),u=Jm.useCallback(f=>e.current.onFormatText?.(f),[]),p=Jm.useCallback((f,m)=>e.current.onResizeTableColumns?.(f,m),[]),h=Jm.useCallback((f,m,x)=>e.current.onResizeTableRow?.(f,m,x),[]);return {cbRef:e,stableResizePointerDown:n,stableAdjustmentPointerDown:r,stableRotate:o,stableInlineEditChange:i,stableInlineEditCommit:s,stableInlineEditCancel:a,stableTableCellSelect:l,stableCommitCellEdit:c,stableUpdateSmartArtElement:d,stableFormatText:u,stableResizeTableColumns:p,stableResizeTableRow:h}}function UG({activeSlide:t,templateElements:e,canvasSize:n,zoom:r,mode:o,canEdit:i,editTemplateMode:s,selectedElementIdSet:a,selectedElement:l,inlineEditingElementId:c,inlineEditingText:d,spellCheckEnabled:u,mediaDataUrls:p,tableEditorState:h,marqueeSelectionState:f,snapLines:m,showGrid:x,gridSpacingPx:g,showRulers:y,rulerUnit:b="inches",guides:v,presentationElementStates:S,presentationKeyframesCss:w,onClick:C,onDoubleClick:T,onMouseDown:M,onContextMenu:_,onCanvasMouseDown:E,onResizePointerDown:R,onAdjustmentPointerDown:I,onRotate:L,onInlineEditChange:k,onInlineEditCommit:F,onInlineEditCancel:N,onTableCellSelect:D,onCommitCellEdit:U,onUpdateSmartArtElement:G,onFormatText:j,onResizeTableColumns:Y,onResizeTableRow:ge,findResults:fe,findResultIndex:de,activeSlideIndex:J,activeTool:re="select",drawingColor:ce="#000000",drawingWidth:ae=3,isDrawingRef:_e,onAddInkElement:xe,onAddFreeformShape:Ee,onEraseInkElement:W,onActionClick:q,onHyperlinkClick:Q,comments:se,showCommentMarkers:me=false,onCommentMarkerClick:P,onMoveGuide:A,onDeleteGuide:O,onCreateGuideFromRuler:z,connectorCreationMode:te=false,onCreateConnector:$,allSlides:Me,onZoomClick:De,sourceSlideIndex:V,fieldContext:B,tableStyleContext:ee,collaborationOverlay:oe}){let pe=(o==="edit"||o==="master")&&i,{cbRef:Ae,stableResizePointerDown:Le,stableAdjustmentPointerDown:ue,stableRotate:we,stableInlineEditChange:Ie,stableInlineEditCommit:He,stableInlineEditCancel:Oe,stableTableCellSelect:$e,stableCommitCellEdit:ot,stableUpdateSmartArtElement:at,stableFormatText:gt,stableResizeTableColumns:le,stableResizeTableRow:Ue}=vme({onClick:C,onDoubleClick:T,onMouseDown:M,onContextMenu:_,onResizePointerDown:R,onAdjustmentPointerDown:I,onRotate:L,onInlineEditChange:k,onInlineEditCommit:F,onInlineEditCancel:N,onTableCellSelect:D,onCommitCellEdit:U,onUpdateSmartArtElement:G,onFormatText:j,onResizeTableColumns:Y,onResizeTableRow:ge}),{elementFindHighlightsMap:Te,selectedBounds:Ve,handleStageClick:Fe,handleStageDblClick:ke,handleStageMouseDown:nt,handleViewportMouseDown:st,handleStagePointerDown:Xn,handleStageContextMenu:Cn,setDraggingGuide:Zi,handleStagePointerMove:bs,handleStagePointerUp:p0}=xme({cbRef:Ae,onCanvasMouseDown:E,findResults:fe,findResultIndex:de,activeSlideIndex:J,selectedElement:l,zoom:r,onMoveGuide:A}),{connectorDragState:_v,handleConnectionSiteDown:h0,handleConnectorDragMove:of,handleConnectionSiteDrop:Pv,handleConnectorDragEnd:f0}=yme({activeSlide:t,zoom:r,onCreateConnector:$}),{isDrawing:m0,isStrokeActive:pl,liveStrokeD:sf,handleDrawPointerDown:vs,handleDrawPointerMove:rp,handleDrawPointerUp:g0}=bme({activeTool:re,activeSlide:t,zoom:r,drawingColor:ce,drawingWidth:ae,isDrawingRef:_e,onAddInkElement:xe,onAddFreeformShape:Ee,onEraseInkElement:W}),af=y?gn:0;return jsxRuntime.jsx("div",{ref:r.canvasViewportRef,"data-pptx-viewport":true,className:"flex-1 overflow-auto relative",style:{touchAction:"pan-x pan-y"},onMouseDown:st,children:jsxRuntime.jsxs("div",{ref:r.editWrapperRef,className:"relative mx-auto my-4",style:{width:n.width*r.editorScale+af,height:n.height*r.editorScale+af},children:[jsxRuntime.jsx(fme,{canvasSize:n,editorScale:r.editorScale,unit:b,visible:y,selectedBounds:Ve,onCreateGuideFromRuler:z}),jsxRuntime.jsxs("div",{ref:r.canvasStageRef,role:"region","aria-label":`Slide ${(J??0)+1}`,"aria-roledescription":"slide",className:"relative shadow-2xl",style:{width:n.width,height:n.height,transform:`scale(${r.editorScale})`,transformOrigin:"top left",marginTop:af,marginLeft:af,touchAction:pe?"none":void 0,backgroundColor:t?.backgroundColor&&t.backgroundColor!=="transparent"?t.backgroundColor:"#ffffff"},onClick:Fe,onDoubleClick:ke,onMouseDown:nt,onPointerDown:pe?Xn:void 0,onContextMenu:Cn,onPointerMove:bs,onPointerUp:p0,children:[w&&jsxRuntime.jsx("style",{children:w}),jsxRuntime.jsx(ume,{canvasSize:n,gridSpacingPx:g,visible:x}),jsxRuntime.jsx(nme,{guides:v,onDeleteGuide:O,onStartGuideDrag:Zi}),jsxRuntime.jsx(rme,{backgroundImage:t?.backgroundImage,backgroundGradient:t?.backgroundGradient}),e.map((Tr,x0)=>jsxRuntime.jsx(dk,{element:Tr,activeSlide:t,isSelected:a.has(Tr.id),isInlineEditing:c===Tr.id,inlineEditingText:d,canInteract:(o==="edit"||o==="master")&&i&&s,spellCheckEnabled:u,mediaDataUrls:p,selectionColorClass:"blue-400",showHoverBorder:false,opacity:.95,templateEditing:s,zIndex:x0,imageAltText:"Template element",showResizeHandles:pe&&a.has(Tr.id)&&a.size<=1&&!c,renderInk:false,renderGroups:false,adjustmentHandleDescriptor:pe&&l?.id===Tr.id?yT(Tr):null,onResizePointerDown:Le,onAdjustmentPointerDown:ue,onRotate:we,onInlineEditChange:Ie,onInlineEditCommit:He,onInlineEditCancel:Oe,onUpdateSmartArtElement:at,onFormatText:gt,onActionClick:q,onHyperlinkClick:Q,animationState:S?.get(Tr.id),presentationElementStates:S,allSlides:Me,onZoomClick:De,sourceSlideIndex:V,fieldContext:B,tableStyleContext:ee},`tpl-${Tr.id}`)),t?.elements.map((Tr,x0)=>jsxRuntime.jsx(dk,{element:Tr,activeSlide:t,isSelected:a.has(Tr.id),isInlineEditing:c===Tr.id,inlineEditingText:d,canInteract:pe,spellCheckEnabled:u,mediaDataUrls:p,tableEditorState:h,selectionColorClass:"blue-500",showHoverBorder:true,zIndex:e.length+x0,imageAltText:"Slide element",showResizeHandles:pe&&a.has(Tr.id)&&a.size<=1&&!c,renderInk:true,renderGroups:true,adjustmentHandleDescriptor:pe&&l?.id===Tr.id?yT(Tr):null,onResizePointerDown:Le,onAdjustmentPointerDown:ue,onRotate:we,onInlineEditChange:Ie,onInlineEditCommit:He,onInlineEditCancel:Oe,onUpdateSmartArtElement:at,onFormatText:gt,onTableCellSelect:$e,onCommitCellEdit:ot,onResizeTableColumns:le,onResizeTableRow:Ue,findHighlights:Te.get(Tr.id),onActionClick:q,onHyperlinkClick:Q,animationState:S?.get(Tr.id),presentationElementStates:S,allSlides:Me,onZoomClick:De,sourceSlideIndex:V,fieldContext:B,tableStyleContext:ee},Tr.id)),jsxRuntime.jsx(ome,{marqueeSelectionState:f}),me&&se&&se.length>0&&jsxRuntime.jsx(ame,{comments:se,canvasSize:n,onCommentMarkerClick:P}),jsxRuntime.jsx(ime,{snapLines:m}),te&&t&&jsxRuntime.jsx(lme,{activeSlide:t,canvasSize:n,zoom:r,connectorDragState:_v,onConnectionSiteDown:h0,onConnectorDragMove:of,onConnectionSiteDrop:Pv,onConnectorDragEnd:f0}),m0&&jsxRuntime.jsx(dme,{canvasSize:n,activeTool:re,drawingColor:ce,drawingWidth:ae,isStrokeActive:pl,liveStrokeD:sf,onPointerDown:vs,onPointerMove:rp,onPointerUp:g0}),oe]})]})})}function HG({isShortcutHelpOpen:t,isAccessibilityPanelOpen:e,showSlideSorter:n,accessibilityIssues:r,slides:o,activeSlideIndex:i,canvasSize:s,canEdit:a,sectionGroups:l,onCloseShortcuts:c,onCloseAccessibility:d,onSelectSlide:u,onMoveSlide:p,onDeleteSlides:h,onDuplicateSlides:f,onToggleHideSlides:m,onCloseSorter:x,reducedMotion:g,onToggleReducedMotion:y}){return t||e||n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t&&jsxRuntime.jsx(h6,{isOpen:t,onClose:c}),e&&jsxRuntime.jsx(f6,{isOpen:e,issues:r,onClose:d,reducedMotion:g,onToggleReducedMotion:y}),n&&jsxRuntime.jsx(WH,{slides:o,activeSlideIndex:i,canvasSize:s,canEdit:a,sectionGroups:l,onSelectSlide:u,onMoveSlide:p,onDeleteSlides:h,onDuplicateSlides:f,onToggleHideSlides:m,onClose:x})]}):null}function VG({activeSlide:t,allSlides:e,isSlideNotesCollapsed:n,canEdit:r,slideCount:o,activeSlideIndex:i,isDirty:s,autosaveStatus:a,onToggleNotes:l,onUpdateNotes:c,collaborationSlot:d,notesPanelHeight:u,onResizeBottom:p,scale:h,onZoomIn:f,onZoomOut:m,onZoomToFit:x,mode:g,onSetMode:y,onToggleSlideSorter:b,hideStatusBar:v=false}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[p&&!n&&jsxRuntime.jsx(yu,{direction:"vertical",onResize:p}),jsxRuntime.jsx(qH,{activeSlide:t,allSlides:e,isExpanded:!n,canEdit:r,onToggle:l,onUpdateNotes:c,panelHeight:u}),!v&&jsxRuntime.jsx(x6,{slideCount:o,activeSlideIndex:i,isDirty:s,autosaveStatus:a,scale:h,onZoomIn:f,onZoomOut:m,onZoomToFit:x,isNotesExpanded:!n,onToggleNotes:l,mode:g,onSetMode:y,onToggleSlideSorter:b,collaborationSlot:d})]})}function GG({isOpen:t,canEdit:e,mode:n,activeSlide:r,slides:o,canvasSize:i,selectedElement:s,effectiveSelectedIds:a,tableEditorState:l,sidebarPanelMode:c,activeSlideIndex:d,comments:u,onSetSidebarPanelMode:p,onClose:h,onUpdateElementStyle:f,onUpdateTextStyle:m,onUpdateElement:x,onApplySelection:g,onSetCanvasSize:y,onMoveLayer:b,onMoveLayerToEdge:v,onDeleteElement:S,onUpdateSlide:w,presentationProperties:C,onUpdatePresentationProperties:T,notesMaster:M,handoutMaster:_,notesCanvasSize:E,coreProperties:R,appProperties:I,customProperties:L,themeOptions:k,onUpdateCoreProperties:F,onUpdateAppProperties:N,onUpdateCustomProperties:D,tagCollections:U,onUpdateTagCollections:G,onApplyTheme:j,editTemplateMode:Y,slideMasters:ge,onSetTemplateBackground:fe,onGetTemplateBackgroundColor:de,mediaDataUrls:J,theme:re,panelWidth:ce}){if(!t)return null;let ae=c;if(!s&&ae!=="comments"&&ae!=="properties")return null;let _e=r?.id??"",xe=u.commentDraftBySlideId[_e]??"",Ee=u.editingCommentIdBySlideId[_e]??null;return jsxRuntime.jsx("div",{role:"complementary","aria-label":"Properties",className:"h-full flex-shrink-0 max-md:absolute max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:z-30",style:ce?{width:ce}:void 0,children:jsxRuntime.jsx(uG,{isOpen:t,canEdit:e,mode:n,activeSlide:r,slides:o,canvasSize:i,selectedElement:s,selectedElementIds:a,tableEditorState:l,activeTab:c,onSetActiveTab:W=>p(W),onClose:h,onUpdateElementStyle:f,onUpdateTextStyle:m,onUpdateElement:x,onUpdateSlide:w,onSelectElement:W=>g(W),onMoveLayer:b,onMoveLayerToEdge:v,onDeleteElement:S,comments:r?.comments??[],presentationProperties:C,onUpdatePresentationProperties:T,notesMaster:M,handoutMaster:_,notesCanvasSize:E,coreProperties:R,appProperties:I,customProperties:L,themeOptions:k,onUpdateCoreProperties:F,onUpdateAppProperties:N,onUpdateCustomProperties:D,tagCollections:U,onUpdateTagCollections:G,onApplyTheme:j,commentDraft:xe,editingCommentId:Ee,commentEditDraft:Ee?u.commentEditDraftByCommentId[Ee]??"":"",onSetCommentDraft:W=>u.handleCommentDraftChange(_e,W),onAddComment:()=>u.handleAddSlideComment(d),onDeleteComment:W=>u.handleDeleteSlideComment(d,W),onStartEditComment:W=>u.handleStartCommentEdit(_e,W),onSaveEditComment:W=>u.handleSaveCommentEdit(d,W),onCancelEditComment:()=>u.handleCancelCommentEdit(_e),onSetCommentEditDraft:W=>u.handleSetCommentEditDraft(u.editingCommentIdBySlideId[_e]??"",W),onToggleCommentResolved:W=>u.handleToggleCommentResolved(d,W),onStartReply:W=>u.handleStartReply(d,W),onCancelReply:u.handleCancelReply,onReplyDraftChange:(W,q)=>u.handleReplyDraftChange(W,q),onSubmitReply:W=>u.handleSubmitReply(d,W),replyingToCommentId:u.replyingToCommentId,replyDraftByCommentId:u.replyDraftByCommentId,onUpdateCanvasSize:y,editTemplateMode:Y,slideMasters:ge,onSetTemplateBackground:fe,onGetTemplateBackgroundColor:de,mediaDataUrls:J,theme:re,panelWidth:ce})})}function Tme(t,e){if(!e?.layoutPath||!t.some(d=>d.masterPath))return t;let o=t.find(d=>d.path===e.layoutPath)?.masterPath;if(!o)return t;let i=t.filter(d=>d.masterPath===o),s=new Map;for(let d of i){let u=d.path===e.layoutPath;(!s.get(d.name)||u)&&s.set(d.name,d);}let a=new Set(Array.from(s.values()).map(d=>d.path)),l=[],c=new Set;for(let d of i)a.has(d.path)&&(c.has(d.name)||(c.add(d.name),l.push(d)));return l}Pe();function Mme(t){let{t:e}=reactI18next.useTranslation(),n=(t.mode==="edit"||t.mode==="master")&&t.canEdit,r=nre({autosaveState:t.autosaveStatus?.state??"idle",isDirty:t.isDirty,autosaveEnabled:t.autosaveEnabled,disabledReason:t.autosaveStatus?.state==="disabled"?t.autosaveStatus.reason:void 0});return jsxRuntime.jsxs("div",{className:Fn.container,"data-pptx-title-bar":"",children:[jsxRuntime.jsx("span",{className:Fn.logo,"aria-hidden":"true",children:"P"}),n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:Fn.autosaveGroup,children:[jsxRuntime.jsx("span",{className:Fn.autosaveLabel,children:e("pptx.titleBar.autoSave")}),jsxRuntime.jsx("button",{type:"button",role:"switch","aria-checked":t.autosaveEnabled,onClick:t.onToggleAutosave,className:ie(Fn.toggleTrack,t.autosaveEnabled?Fn.toggleTrackOn:Fn.toggleTrackOff),title:e("pptx.titleBar.toggleAutoSave"),"aria-label":e("pptx.titleBar.toggleAutoSave"),children:jsxRuntime.jsx("span",{className:ie(Fn.toggleKnob,t.autosaveEnabled?Fn.toggleKnobOn:Fn.toggleKnobOff)})}),jsxRuntime.jsx("span",{className:Fn.autosaveLabel,children:e(t.autosaveEnabled?"pptx.titleBar.autoSaveOn":"pptx.titleBar.autoSaveOff")})]}),jsxRuntime.jsx("div",{className:Fn.separator}),t.onSave&&jsxRuntime.jsx("button",{type:"button",onClick:t.onSave,className:Fn.quickButton,title:e("pptx.titleBar.save"),"aria-label":e("pptx.titleBar.save"),children:jsxRuntime.jsx(lu$1.LuSave,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",onClick:t.onUndo,disabled:!t.canUndo,className:Fn.quickButton,title:t.undoLabel?e("pptx.toolbar.undoAction",{action:t.undoLabel}):e("pptx.toolbar.undo"),"aria-label":e("pptx.toolbar.undo"),children:jsxRuntime.jsx(lu$1.LuUndo,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",onClick:t.onRedo,disabled:!t.canRedo,className:Fn.quickButton,title:t.redoLabel?e("pptx.toolbar.redoAction",{action:t.redoLabel}):e("pptx.toolbar.redo"),"aria-label":e("pptx.toolbar.redo"),children:jsxRuntime.jsx(lu$1.LuRedo,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("div",{className:Fn.separator})]}),jsxRuntime.jsxs("span",{className:Fn.fileGroup,children:[jsxRuntime.jsx("span",{className:Fn.fileName,children:t.fileName||e(rre)}),n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:Fn.statusDot,"aria-hidden":"true",children:"\u2022"}),jsxRuntime.jsx("span",{className:ie(Fn.statusText,t.autosaveStatus?.state==="error"&&t.autosaveEnabled&&Fn.statusError,t.autosaveStatus?.state==="saving"&&t.autosaveEnabled&&Fn.statusSaving),children:e(r)})]})]}),jsxRuntime.jsx("span",{className:Fn.searchWrap,children:(t.mode==="edit"||t.mode==="master")&&jsxRuntime.jsxs("button",{type:"button",onClick:t.onToggleFindReplace,className:ie(Fn.searchBox,t.findReplaceOpen&&"text-foreground bg-background"),title:e("pptx.findReplace.title"),"aria-label":e("pptx.titleBar.search"),children:[jsxRuntime.jsx(lu$1.LuSearch,{className:Fn.searchIcon}),jsxRuntime.jsx("span",{className:Fn.searchLabel,children:e("pptx.titleBar.search")})]})}),jsxRuntime.jsx("span",{className:Fn.rightSpacer})]})}function WG(t){let{mode:e,canEdit:n,state:r,selectedElement:o,activeSlide:i,zoom:s,history:a,findReplace:l,manipulation:c,insertHandlers:d,exportHandlers:u,printHandlers:p,propertyHandlers:h,dialogs:f,slideOps:m,ops:x,onSetMode:g,onEnterPresenterView:y,onEnterRehearsalMode:b,onOpenSettings:v,onOpenShareDialog:S,onOpenFile:w,onToggleFormatPainter:C,fileName:T,autosaveStatus:M,autosaveEnabled:_=true,onToggleAutosave:E}=t,R=Jm.useCallback((N,D)=>{if(!o||!i)return;let U=i.animations??[],G=U.find(Y=>Y.elementId===o.id),j=N;if(G){let Y=U.map(ge=>ge.elementId===o.id?{...ge,[D]:j}:ge);h.handleUpdateSlide({animations:Y});}else {let Y={elementId:o.id,[D]:j,durationMs:500,order:U.length,trigger:"onClick"};h.handleUpdateSlide({animations:[...U,Y]});}},[o,i,h]),I=Jm.useCallback(()=>{if(!o||!i)return;let D=(i.animations??[]).filter(U=>U.elementId!==o.id);h.handleUpdateSlide({animations:D});},[o,i,h]),L=Jm.useCallback(N=>{if(!i)return;let D=i.transition??{type:"none"};h.handleUpdateSlide({transition:{...D,...N}});},[i,h]),k=Jm__default.default.useMemo(()=>Tme(r.layoutOptions,i),[r.layoutOptions,i]),F=Jm.useCallback(()=>{let N=i?.transition;N&&(x.updateSlides(D=>D.map(U=>({...U,transition:N}))),a.markDirty());},[i,x,a]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!f.isNarrowViewport&&jsxRuntime.jsx(Mme,{mode:e,canEdit:n,fileName:T,isDirty:r.isDirty,autosaveStatus:M,autosaveEnabled:_,onToggleAutosave:E??(()=>{}),canUndo:a.canUndo,canRedo:a.canRedo,undoLabel:a.undoLabel,redoLabel:a.redoLabel,onUndo:a.handleUndo,onRedo:a.handleRedo,onSave:u.handleSaveAsPptx,findReplaceOpen:l.findReplaceOpen,onToggleFindReplace:()=>l.setFindReplaceOpen(!l.findReplaceOpen)}),jsxRuntime.jsx(WV,{mode:e,canEdit:n,isNarrowViewport:f.isNarrowViewport,isSidebarCollapsed:!r.isSlidesPaneOpen,isInspectorPaneOpen:r.isInspectorPaneOpen,isCompactToolbarOpen:r.isCompactToolbarOpen,toolbarSection:r.toolbarSection,scale:s.scale,canUndo:a.canUndo,canRedo:a.canRedo,undoLabel:a.undoLabel,redoLabel:a.redoLabel,findReplaceOpen:l.findReplaceOpen,selectedElement:o,tableEditorState:r.tableEditorState,editTemplateMode:r.editTemplateMode,newShapeType:r.newShapeType,activeTool:r.activeTool,drawingColor:r.drawingColor,drawingWidth:r.drawingWidth,clipboardPayload:r.clipboardPayload,onSetMode:g,onToggleSidebar:()=>r.setIsSlidesPaneOpen(N=>!N),onToggleInspector:()=>r.setIsInspectorPaneOpen(N=>!N),onOpenAnimationPanel:()=>{r.setIsInspectorPaneOpen(true),r.setSidebarPanelMode("properties");},onAddAnimation:R,onRemoveAnimation:I,onToggleCompactToolbar:()=>r.setIsCompactToolbarOpen(N=>!N),onSetToolbarSection:r.setToolbarSection,onZoomIn:s.handleZoomIn,onZoomOut:s.handleZoomOut,onZoomToFit:s.handleZoomToFit,onUndo:a.handleUndo,onRedo:a.handleRedo,onToggleFindReplace:()=>l.setFindReplaceOpen(!l.findReplaceOpen),onSetNewShapeType:r.setNewShapeType,onAddTextBox:d.handleAddTextBox,onAddShape:d.handleAddShape,onAddTable:d.handleAddTable,onAddChart:d.handleAddChart,onAddSmartArt:()=>f.setIsSmartArtDialogOpen(true),onAddEquation:()=>{f.setEditingEquationOmml(null),f.setIsEquationDialogOpen(true);},onAddActionButton:d.handleAddActionButton,onInsertField:d.handleInsertField,onOpenImagePicker:()=>r.imageInputRef.current?.click(),onOpenMediaPicker:()=>r.mediaInputRef.current?.click(),onSetActiveTool:r.setActiveTool,onSetDrawingColor:r.setDrawingColor,onSetDrawingWidth:r.setDrawingWidth,onSetEditTemplateMode:r.setEditTemplateMode,spellCheckEnabled:r.spellCheckEnabled,showGrid:r.showGrid,showRulers:r.showRulers,snapToGrid:r.snapToGrid,snapToShape:r.snapToShape,onSetSpellCheckEnabled:r.setSpellCheckEnabled,onSetShowGrid:r.setShowGrid,onSetShowRulers:r.setShowRulers,onSetSnapToGrid:r.setSnapToGrid,onSetSnapToShape:r.setSnapToShape,onAddGuide:f.handleAddGuide,onAlignElements:c.handleAlignElements,onDistributeElements:c.handleDistributeElements,canDistribute:c.canDistribute,onCopy:c.handleCopy,onCut:c.handleCut,onPaste:c.handlePaste,onFlip:c.handleFlip,onMoveLayer:c.handleMoveLayer,onMoveLayerToEdge:c.handleMoveLayerToEdge,onDuplicate:c.handleDuplicate,onDelete:c.handleDelete,onExportPng:u.handleExportPng,onExportPdf:u.handleExportPdf,onExportVideo:u.handleExportVideo,onExportGif:u.handleExportGif,onPackageForSharing:u.handlePackageForSharing,onOpenFile:w,onOpenShareDialog:S,onSaveAsPptx:u.handleSaveAsPptx,onSaveAsPpsx:u.handleSaveAsPpsx,onSaveAsPptm:u.handleSaveAsPptm,hasMacros:r.hasMacros,onCopySlideAsImage:u.handleCopySlideAsImage,onPrint:p.handlePrint,onToggleShortcuts:()=>r.setIsShortcutHelpOpen(N=>!N),onOpenSettings:v,onRunAccessibilityCheck:f.handleRunAccessibilityCheck,onToggleSlideSorter:()=>r.setShowSlideSorter(N=>!N),onUpdateTextStyle:x.updateSelectedTextStyle,isOverflowMenuOpen:r.isOverflowMenuOpen,onSetOverflowMenuOpen:r.setIsOverflowMenuOpen,layoutOptions:k,onInsertSlideFromLayout:m.handleInsertSlideFromLayout,customShows:r.customShows,activeCustomShowId:r.activeCustomShowId,onSetActiveCustomShowId:r.setActiveCustomShowId,onCreateCustomShow:f.handleCreateCustomShow,onRenameActiveCustomShow:f.handleRenameActiveCustomShow,onDeleteActiveCustomShow:f.handleDeleteActiveCustomShow,onToggleCurrentSlideInActiveShow:f.handleToggleCurrentSlideInActiveShow,isCurrentSlideInActiveShow:f.isCurrentSlideInActiveShow,onEnterMasterView:f.handleEnterMasterView,onCloseMasterView:f.handleCloseMasterView,onToggleVersionHistory:()=>h.setIsVersionHistoryOpen(N=>!N),onOpenPasswordProtection:()=>f.setIsPasswordDialogOpen(true),onOpenDocumentProperties:()=>f.setIsDocPropsDialogOpen(true),onOpenFontEmbedding:()=>f.setIsFontEmbeddingOpen(true),onOpenDigitalSignatures:()=>f.setIsDigitalSigDialogOpen(true),onEnterPresenterView:y,onEnterRehearsalMode:b,onToggleThemeEditor:()=>r.setIsThemeEditorOpen(N=>!N),isThemeEditorOpen:r.isThemeEditorOpen,onToggleThemeGallery:()=>r.setIsThemeGalleryOpen(N=>!N),isThemeGalleryOpen:r.isThemeGalleryOpen,onCompare:h.handleCompare,onToggleComments:()=>{r.setSidebarPanelMode("comments"),r.isInspectorPaneOpen||r.setIsInspectorPaneOpen(true);},isCommentsPanelOpen:r.isInspectorPaneOpen,slideCommentCount:i?.comments?.length??0,formatPainterActive:r.formatPainterActive,canActivateFormatPainter:xU(o),onToggleFormatPainter:C??(()=>r.setFormatPainterActive(N=>!N)),isSelectionPaneOpen:r.isSelectionPaneOpen,onToggleSelectionPane:()=>r.setIsSelectionPaneOpen(N=>!N),eyedropperActive:r.eyedropperActive,onToggleEyedropper:()=>r.setEyedropperActive(N=>!N),onOpenSetUpSlideShow:()=>f.setIsSetUpSlideShowOpen(true),onOpenBroadcastDialog:()=>f.setIsBroadcastDialogOpen(true),onToggleSubtitles:f.handleToggleSubtitles,showSubtitles:!!r.presentationProperties.showSubtitles,activeSlide:i,onTransitionChange:L,onApplyTransitionToAll:F}),r.hasDigitalSignatures&&jsxRuntime.jsx("div",{className:"flex items-center px-3 py-1 z-10",children:jsxRuntime.jsx(MV,{hasSignatures:r.hasDigitalSignatures,signatureCount:r.digitalSignatureCount,onClick:()=>f.setIsDigitalSigDialogOpen(true)})}),jsxRuntime.jsx("input",{ref:r.imageInputRef,type:"file",name:"image-upload",accept:"image/*",className:"hidden",onChange:d.handleImageFileChange}),jsxRuntime.jsx("input",{ref:r.mediaInputRef,type:"file",name:"media-upload",accept:"video/*,audio/*",className:"hidden",onChange:d.handleMediaFileChange})]})}Pe();function Ame(t){let e=C6e__default.default;return typeof e.sanitize!="function"?t:e.sanitize(t,{USE_PROFILES:{mathMl:true,svg:true}})}var Rme=[{label:"Fraction",latex:"\\frac{a}{b}",i18nKey:"pptx.equation.template.fraction"},{label:"Quadratic",latex:"x=\\frac{-b\\pm\\sqrt{b^{2}-4ac}}{2a}",i18nKey:"pptx.equation.template.quadratic"},{label:"Pythagorean",latex:"a^{2}+b^{2}=c^{2}",i18nKey:"pptx.equation.template.pythagorean"},{label:"Sum",latex:"\\sum_{i=1}^{n}{a_{i}}",i18nKey:"pptx.equation.template.sum"},{label:"Integral",latex:"\\int_{a}^{b}{f(x)}dx",i18nKey:"pptx.equation.template.integral"},{label:"Square Root",latex:"\\sqrt{x^{2}+y^{2}}",i18nKey:"pptx.equation.template.squareRoot"},{label:"Limit",latex:"\\lim_{x\\to\\infty}{f(x)}",i18nKey:"pptx.equation.template.limit"},{label:"Euler's",latex:"e^{i\\pi}+1=0",i18nKey:"pptx.equation.template.euler"},{label:"Matrix 2x2",latex:"\\left[a,b;c,d\\right]",i18nKey:"pptx.equation.template.matrix"},{label:"Binomial",latex:"\\left(a+b\\right)^{n}",i18nKey:"pptx.equation.template.binomial"},{label:"Derivative",latex:"\\frac{dy}{dx}",i18nKey:"pptx.equation.template.derivative"},{label:"Trig Identity",latex:"\\sin^{2}\\theta+\\cos^{2}\\theta=1",i18nKey:"pptx.equation.template.trigIdentity"}],Xdt=Rme.map(t=>{try{let e=eT(t.latex),n=_y(e);return n?Ame(n):""}catch{return ""}});function jdt({mathml:t}){let e=Jm.useRef(null);return Jm.useEffect(()=>{e.current&&(t?e.current.innerHTML=Ame(t):e.current.innerHTML="");},[t]),jsxRuntime.jsx("div",{ref:e,className:"flex items-center justify-center min-h-[80px] text-2xl text-foreground",style:{fontFamily:'"Cambria Math", "STIX Two Math", serif'}})}function kme({isOpen:t,onClose:e,onInsert:n,existingOmml:r}){let{t:o}=reactI18next.useTranslation(),{panelStyle:i,handlers:s}=pi(e),a=Jm.useMemo(()=>r?w4(r):"",[r]),[l,c]=Jm.useState(a),d=Jm.useDeferredValue(l),u=Jm.useRef(null);Jm.useEffect(()=>{t&&(c(a),setTimeout(()=>u.current?.focus(),50));},[t,a]);let{mathml:p,omml:h}=Jm.useMemo(()=>{if(!d.trim())return {mathml:"",omml:{}};try{let b=eT(d);return {mathml:_y(b),omml:b}}catch{return {mathml:"",omml:{}}}},[d]),f=Jm.useCallback(()=>{if(!l.trim())return;let b=h;try{let v=eT(l);v&&Object.keys(v).length>0&&(b=v);}catch{}n(b),e();},[l,h,n,e]),m=Jm.useCallback(b=>{c(b);},[]),x=Jm.useCallback(b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),f()),b.key==="Escape"&&(b.preventDefault(),e());},[f,e]);if(!t)return null;let g=!!r,y=l.trim().length>0&&Object.keys(h).length>0;return jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:b=>{b.target===b.currentTarget&&e();},onKeyDown:x,children:jsxRuntime.jsxs("div",{style:i,className:"bg-background border border-border rounded-xl shadow-2xl w-[640px] max-h-[85vh] flex flex-col overflow-hidden max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",onClick:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{...s,className:"flex items-center justify-between px-5 py-3 border-b border-border touch-none",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:g?o("pptx.equation.editTitle","Edit Equation"):o("pptx.equation.insertTitle","Insert Equation")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-lg border border-border bg-muted/60 p-4 min-h-[80px] flex items-center justify-center",children:y?jsxRuntime.jsx(jdt,{mathml:p}):jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground italic",children:o("pptx.equation.previewPlaceholder","Equation preview will appear here")})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-xs font-medium text-muted-foreground mb-1.5",children:o("pptx.equation.latexInput","LaTeX Input")}),jsxRuntime.jsx("textarea",{ref:u,value:l,onChange:b=>c(b.target.value),placeholder:"\\\\frac{a}{b} + \\\\sqrt{c}",className:"w-full h-24 px-3 py-2 rounded-lg border border-border bg-muted text-foreground text-sm font-mono resize-none focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary placeholder:text-muted-foreground",spellCheck:false}),jsxRuntime.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:o("pptx.equation.latexHint","Use LaTeX syntax. Ctrl+Enter to insert.")})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:o("pptx.equation.templates","Common Templates")}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:Rme.map((b,v)=>{let S=Xdt[v];return jsxRuntime.jsxs("button",{type:"button",onClick:()=>m(b.latex),className:ie("flex flex-col items-center gap-1 p-2 rounded-lg border transition-colors",l===b.latex?"border-primary bg-primary/10":"border-border bg-muted/40 hover:bg-accent/60 hover:border-border"),title:o(b.i18nKey,b.label),children:[jsxRuntime.jsx("div",{className:"text-sm text-foreground h-8 flex items-center justify-center overflow-hidden",style:{fontFamily:'"Cambria Math", "STIX Two Math", serif'},dangerouslySetInnerHTML:{__html:S}}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground truncate w-full text-center",children:o(b.i18nKey,b.label)})]},b.latex)})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-4 py-1.5 rounded-lg text-xs text-foreground hover:bg-accent transition-colors",children:o("pptx.equation.cancel","Cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:f,disabled:!y,className:"px-4 py-1.5 rounded-lg text-xs font-medium bg-primary hover:bg-primary/80 text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:g?o("pptx.equation.update","Update"):o("pptx.equation.insert","Insert")})]})]})})}Pe();var dl=["#3b82f6","#22c55e","#f97316","#eab308"];function Kdt(){return jsxRuntime.jsx("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[0,1,2].map(t=>jsxRuntime.jsx("rect",{x:4,y:3+t*12,width:52,height:10,rx:2,fill:dl[t],opacity:.85},t))})}function qdt(){return jsxRuntime.jsx("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[0,1,2].map(t=>{let e=2+t*19,n=`${e},10 ${e+14},10 ${e+18},20 ${e+14},30 ${e},30 ${t>0?e+4:e},20`;return jsxRuntime.jsx("polygon",{points:n,fill:dl[t],opacity:.85},t)})})}function Zdt(){return jsxRuntime.jsx("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[0,1,2,3].map(t=>{let e=t/4*Math.PI*2-Math.PI/2,n=30+13*Math.cos(e),r=20+10*Math.sin(e);return jsxRuntime.jsx("circle",{cx:n,cy:r,r:6,fill:dl[t],opacity:.85},t)})})}function Jdt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[jsxRuntime.jsx("rect",{x:20,y:3,width:20,height:10,rx:2,fill:dl[0],opacity:.85}),jsxRuntime.jsx("line",{x1:30,y1:13,x2:30,y2:18,stroke:"#94a3b8",strokeWidth:1}),jsxRuntime.jsx("line",{x1:15,y1:18,x2:45,y2:18,stroke:"#94a3b8",strokeWidth:1}),jsxRuntime.jsx("rect",{x:4,y:20,width:18,height:10,rx:2,fill:dl[1],opacity:.85}),jsxRuntime.jsx("rect",{x:38,y:20,width:18,height:10,rx:2,fill:dl[2],opacity:.85}),jsxRuntime.jsx("line",{x1:15,y1:18,x2:15,y2:20,stroke:"#94a3b8",strokeWidth:1}),jsxRuntime.jsx("line",{x1:45,y1:18,x2:45,y2:20,stroke:"#94a3b8",strokeWidth:1})]})}function Qdt(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:22,cy:20,r:14,fill:dl[0],opacity:.3}),jsxRuntime.jsx("circle",{cx:38,cy:20,r:14,fill:dl[1],opacity:.3}),jsxRuntime.jsx("circle",{cx:30,cy:10,r:14,fill:dl[2],opacity:.3})]})}function eut(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:30,cy:20,r:7,fill:dl[0],opacity:.85}),[0,1,2].map(t=>{let e=t/3*Math.PI*2-Math.PI/2,n=30+15*Math.cos(e),r=20+12*Math.sin(e);return jsxRuntime.jsxs(Jm__default.default.Fragment,{children:[jsxRuntime.jsx("line",{x1:30,y1:20,x2:n,y2:r,stroke:"#94a3b8",strokeWidth:1,opacity:.5}),jsxRuntime.jsx("circle",{cx:n,cy:r,r:5,fill:dl[t+1],opacity:.85})]},t)})]})}function tut(){return jsxRuntime.jsx("svg",{viewBox:"0 0 60 40",className:"w-full h-full",children:[0,1,2].map(t=>jsxRuntime.jsx("rect",{x:4+t*18,y:8,width:16,height:24,rx:3,fill:dl[t],opacity:.85},t))})}function Ime(t){switch(t){case "basicBlockList":case "stackedList":case "tableList":case "horizontalBulletList":return jsxRuntime.jsx(Kdt,{});case "basicChevronProcess":case "segmentedProcess":case "continuousBlockProcess":case "upwardArrow":return jsxRuntime.jsx(qdt,{});case "basicCycle":case "basicPie":return jsxRuntime.jsx(Zdt,{});case "basicRadial":case "convergingRadial":return jsxRuntime.jsx(eut,{});case "hierarchy":return jsxRuntime.jsx(Jdt,{});case "basicVenn":case "linearVenn":return jsxRuntime.jsx(Qdt,{});default:return jsxRuntime.jsx(tut,{})}}function Lme({isOpen:t,onClose:e,onInsert:n}){let{t:r}=reactI18next.useTranslation(),{panelStyle:o,handlers:i}=pi(e),[s,a]=Jm.useState("list"),[l,c]=Jm.useState(null),d=tR.filter(p=>p.category===s),u=Jm.useCallback(()=>{if(!l)return;let p=tR.find(h=>h.layout===l);p&&(n(p.layout,p.defaultItems),e());},[l,n,e]);return t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/50",onClick:e,"aria-label":"Close"}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{style:o,className:"pointer-events-auto w-[600px] max-w-[90vw] max-h-[80vh] rounded-lg border border-border bg-background shadow-2xl flex flex-col max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-w-none max-md:max-h-[88dvh] max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",role:"dialog","aria-modal":"true","aria-label":r("pptx.smartart.insertTitle"),children:[jsxRuntime.jsxs("div",{...i,className:"flex items-center justify-between px-4 py-3 border-b border-border touch-none",children:[jsxRuntime.jsx("h2",{className:"text-sm font-medium text-foreground",children:r("pptx.smartart.insertTitle")}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-muted transition-colors","aria-label":r("pptx.smartart.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"w-40 border-r border-border py-2",children:NU.map(p=>jsxRuntime.jsx("button",{type:"button",onClick:()=>{a(p.id),c(null);},className:ie("w-full text-left px-3 py-1.5 text-xs transition-colors",s===p.id?"bg-primary text-white":"text-foreground hover:bg-muted"),children:r(p.label)},p.id))}),jsxRuntime.jsx("div",{className:"flex-1 p-3 overflow-y-auto",children:jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:d.map(p=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>c(p.layout),onDoubleClick:()=>{c(p.layout),n(p.layout,p.defaultItems),e();},className:ie("flex flex-col items-center gap-1 p-2 rounded border transition-colors",l===p.layout?"border-primary bg-primary/20":"border-border hover:border-border hover:bg-muted/50"),children:[jsxRuntime.jsx("div",{className:"w-16 h-12 flex items-center justify-center bg-muted rounded",children:Ime(p.layout)}),jsxRuntime.jsx("span",{className:"text-[10px] text-foreground text-center leading-tight",children:r(p.labelKey)})]},p.layout))})})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-xs rounded bg-muted hover:bg-accent text-foreground transition-colors",children:r("pptx.smartart.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:u,disabled:!l,className:ie("px-3 py-1.5 text-xs rounded transition-colors",l?"bg-primary hover:bg-primary/80 text-white":"bg-muted text-muted-foreground cursor-not-allowed"),children:r("pptx.smartart.insert")})]})]})})]}):null}function jG(t){let{dialogs:e,insertHandlers:n,exportHandlers:r,printHandlers:o,propertyHandlers:i,annotations:s,slides:a,activeSlideIndex:l,canvasSize:c,filePath:d,coreProperties:u,customProperties:p,appProperties:h,embeddedFonts:f,hasDigitalSignatures:m,digitalSignatureCount:x,presentationProperties:g,customShows:y,selectedElements:b,isEncryptedDialogOpen:v,setIsEncryptedDialogOpen:S,showKeepAnnotationsDialog:w,onKeepAnnotations:C,onDiscardAnnotations:T}=t;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(JH,{isOpen:i.isVersionHistoryOpen,filePath:d,onClose:()=>i.setIsVersionHistoryOpen(false),onRestore:i.handleRestoreVersion}),jsxRuntime.jsx(ez,{isOpen:i.isComparePanelOpen,compareResult:i.compareResult,canvasSize:c,onClose:()=>i.setIsComparePanelOpen(false),onAcceptSlide:i.handleAcceptSlide,onRejectSlide:i.handleRejectSlide,onAcceptAll:i.handleAcceptAllSlides}),jsxRuntime.jsx(nz,{isOpen:e.isPasswordDialogOpen,isCurrentlyProtected:e.isPasswordProtected,onClose:()=>e.setIsPasswordDialogOpen(false),onSetPassword:e.handleSetPassword,onRemovePassword:e.handleRemovePassword}),jsxRuntime.jsx(vV,{isOpen:e.isDocPropsDialogOpen,coreProperties:u??{},customProperties:p,appProperties:h,onClose:()=>e.setIsDocPropsDialogOpen(false),onSave:(M,_,E)=>{i.handleUpdateCoreProperties(M),i.handleUpdateCustomProperties(_),E&&i.handleUpdateAppProperties(E);}}),jsxRuntime.jsx(wV,{isOpen:e.isFontEmbeddingOpen,embedFontsEnabled:e.embedFontsEnabled,usedFontFamilies:i.usedFontFamilies,embeddedFonts:f.map(M=>M.name),onClose:()=>e.setIsFontEmbeddingOpen(false),onToggleEmbedFonts:e.setEmbedFontsEnabled}),jsxRuntime.jsx(CV,{isOpen:e.isDigitalSigDialogOpen,onClose:()=>e.setIsDigitalSigDialogOpen(false),hasSignatures:m,signatureCount:x}),jsxRuntime.jsx(_V,{isOpen:e.isSignatureStrippedDialogOpen,signatureCount:x,onConfirm:()=>e.setIsSignatureStrippedDialogOpen(false),onCancel:()=>e.setIsSignatureStrippedDialogOpen(false)}),jsxRuntime.jsx(PV,{isOpen:v,onClose:()=>S(false)}),jsxRuntime.jsx(Lme,{isOpen:e.isSmartArtDialogOpen,onClose:()=>e.setIsSmartArtDialogOpen(false),onInsert:n.handleInsertSmartArt}),jsxRuntime.jsx(kme,{isOpen:e.isEquationDialogOpen,onClose:()=>e.setIsEquationDialogOpen(false),onInsert:e.editingEquationOmml?n.handleUpdateEquation:n.handleInsertEquation,existingOmml:e.editingEquationOmml}),jsxRuntime.jsx(NG,{open:e.isHyperlinkDialogOpen,initialUrl:b[0]?.actionClick?.url,initialTooltip:b[0]?.actionClick?.tooltip,initialAction:b[0]?.actionClick?.action,slideCount:a.length,onConfirm:n.handleHyperlinkConfirm,onCancel:()=>e.setIsHyperlinkDialogOpen(false)}),jsxRuntime.jsx(g6,{isOpen:r.exportModalOpen,title:r.exportModalTitle,progress:r.exportProgress,statusMessage:r.exportStatusMessage,onCancel:r.handleCancelExport}),jsxRuntime.jsx(TG,{open:e.isSetUpSlideShowOpen,onClose:()=>e.setIsSetUpSlideShowOpen(false),properties:g,onSave:e.handleSaveSlideShowSettings,customShows:y,slideCount:a.length}),jsxRuntime.jsx(wG,{open:o.isPrintDialogOpen,onClose:()=>o.setIsPrintDialogOpen(false),onPrint:o.handlePrintWithSettings,slides:a,activeSlideIndex:l,defaultSlidesPerPage:g.printSlidesPerPage,defaultFrameSlides:g.printFrameSlides}),jsxRuntime.jsx(vG,{isOpen:w,annotationCount:Array.from(s.allSlideAnnotations.values()).reduce((M,_)=>M+_.length,0),slideCount:s.allSlideAnnotations.size,onKeep:C,onDiscard:T})]})}function YG(t){let{mode:e,slides:n,canvasSize:r,templateElements:o,presentation:i,onExitPresentation:s,isMobile:a}=t,l=e==="present"&&i.presenterMode;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l&&(a?jsxRuntime.jsx(RV,{slides:n,currentSlideIndex:i.presentationSlideIndex,canvasSize:r,templateElements:o,presentationStartTime:i.presentationStartTime,onMovePresentationSlide:i.movePresentationSlide,onExit:s}):jsxRuntime.jsx(AV,{slides:n,currentSlideIndex:i.presentationSlideIndex,canvasSize:r,templateElements:o,presentationStartTime:i.presentationStartTime,onMovePresentationSlide:i.movePresentationSlide,onExit:s,onOpenAudienceWindow:i.openAudienceWindow,onCloseAudienceWindow:i.closeAudienceWindow,isAudienceWindowOpen:i.isAudienceWindowOpen()})),e==="present"&&i.rehearsing&&jsxRuntime.jsx(IV,{presentationStartTime:i.presentationStartTime,slideStartTime:i.slideStartTime,paused:i.rehearsalPaused,onTogglePause:i.toggleRehearsalPause}),i.showRehearsalSummary&&jsxRuntime.jsx(NV,{slides:n,canvasSize:r,recordedTimings:i.recordedTimings,onSave:i.saveRehearsalTimings,onDiscard:i.dismissRehearsalSummary})]})}var uut=50;function Fme(t){let{enabled:e,onNext:n,onPrev:r}=t,o=Jm.useRef(null),i=Jm.useCallback(a=>{if(!e||a.changedTouches.length!==1){o.current=null;return}let l=a.changedTouches[0];o.current={x:l.clientX,y:l.clientY};},[e]),s=Jm.useCallback(a=>{let l=o.current;if(o.current=null,!e||l===null||a.changedTouches.length!==1)return;let c=a.changedTouches[0],d=c.clientX-l.x,u=c.clientY-l.y;Math.abs(d)<uut||Math.abs(d)<=Math.abs(u)||(d<0?n():r());},[e,n,r]);return {onTouchStart:i,onTouchEnd:s}}function KG(t){let{mode:e,canEdit:n,slides:r,activeSlide:o,masterPseudoSlide:i,templateElements:s,canvasSize:a,activeSlideIndex:l,gridSpacingPx:c,zoom:d,state:u,selectedElement:p,canvasHandlers:h,insertHandlers:f,tableOps:m,annotations:x,presentation:g,onEndPresentation:y,findReplace:b}=t,v=e==="master"?i:o,S=e==="master"?u.activeLayout?u.activeMaster?.elements??[]:[]:s,w=Jm.useMemo(()=>{let N=u.headerFooter,D;if(o)for(let U of o.elements){let G=U.placeholderType;if(G==="title"||G==="ctrTitle"){let j=U.text;if(j){D=j;break}}}return {slideNumber:o?.slideNumber,dateTimeText:N.dateTimeText,dateFormat:N.dateFormat,footerText:N.footerText,headerText:N.headerText,slideTitle:D,customProperties:u.customProperties.map(U=>({name:U.name,value:U.value}))}},[u.headerFooter,u.customProperties,o]),C=Jm.useMemo(()=>{if(!(!u.theme&&!u.tableStyleMap))return {theme:u.theme,tableStyleMap:u.tableStyleMap}},[u.theme,u.tableStyleMap]),T=Jm.useCallback((N,D)=>{e==="present"?g.handlePresentationAction(D):D.url&&rh(D.url);},[e,g]),M=Jm.useCallback(N=>{if(BA(N)){if(e==="present"){let D=tU(N);if(D){let U={action:D.action,targetSlideIndex:D.targetSlideIndex};g.handlePresentationAction(U);}}return}rh(N);},[e,g]),_=Jm.useRef(false),E=Jm.useCallback(()=>{_.current=true,x.setToolbarVisible(true);},[x]),R=Jm.useCallback(()=>{_.current=false;},[]),I=e==="preview"||e==="present",L=Jm.useCallback(()=>{e==="present"?g.movePresentationSlide(1):u.setActiveSlideIndex(N=>Math.min(r.length-1,N+1));},[e,g,u,r.length]),k=Jm.useCallback(()=>{e==="present"?g.movePresentationSlide(-1):u.setActiveSlideIndex(N=>Math.max(0,N-1));},[e,g,u]),F=Fme({enabled:I,onNext:L,onPrev:k});return jsxRuntime.jsxs("main",{"aria-label":"Slide editor",className:"flex-1 min-w-0 relative flex flex-col bg-background",onTouchStart:F.onTouchStart,onTouchEnd:F.onTouchEnd,children:[b.findReplaceOpen&&jsxRuntime.jsx(V6,{findQuery:b.findQuery,replaceQuery:b.replaceQuery,findMatchCase:b.findMatchCase,findResults:b.findResults,findResultIndex:b.findResultIndex,onSetFindQuery:b.setFindQuery,onSetReplaceQuery:b.setReplaceQuery,onSetFindMatchCase:b.setFindMatchCase,onPerformFind:b.performFind,onNavigateResult:b.navigateFindResult,onReplace:b.handleReplace,onReplaceAll:b.handleReplaceAll,onClose:()=>b.setFindReplaceOpen(false)}),e==="master"&&u.masterViewTab==="notes"?jsxRuntime.jsx(VH,{notesMaster:u.notesMaster,canvasSize:a,notesCanvasSize:u.notesCanvasSize}):e==="master"&&u.masterViewTab==="handout"?jsxRuntime.jsx(GH,{handoutMaster:u.handoutMaster,canvasSize:a,slidesPerPage:u.handoutSlidesPerPage}):jsxRuntime.jsx(UG,{activeSlide:v,templateElements:S,canvasSize:a,zoom:d,mode:e,canEdit:n,editTemplateMode:e==="master"||u.editTemplateMode,selectedElementIdSet:u.selectedElementIdSet,selectedElement:p,inlineEditingElementId:u.inlineEditingElementId,inlineEditingText:u.inlineEditingText,spellCheckEnabled:u.spellCheckEnabled,mediaDataUrls:u.mediaDataUrls,tableEditorState:u.tableEditorState,marqueeSelectionState:u.marqueeSelectionState,snapLines:u.snapLines,showGrid:u.showGrid,gridSpacingPx:c,showRulers:u.showRulers,guides:u.guides,presentationElementStates:e==="present"?g.presentationElementStates:void 0,presentationKeyframesCss:e==="present"?g.presentationKeyframesCss:void 0,onClick:h.handleElementClick,onDoubleClick:h.handleElementDoubleClick,onMouseDown:h.handleElementMouseDown,onContextMenu:h.handleElementContextMenu,onCanvasMouseDown:h.handleCanvasMouseDown,onResizePointerDown:h.handleResizePointerDown,onAdjustmentPointerDown:h.handleAdjustmentPointerDown,onRotate:h.handleRotate,onInlineEditChange:u.setInlineEditingText,onInlineEditCommit:h.handleInlineEditCommit,onInlineEditCancel:()=>u.setInlineEditingElementId(null),onTableCellSelect:(N,D)=>u.setTableEditorState(N?{...N,elementId:D}:null),onCommitCellEdit:m.handleCommitCellEdit,onUpdateSmartArtElement:h.handleUpdateSmartArtElement,onFormatText:h.handleFormatText,onResizeTableColumns:m.handleResizeTableColumns,onResizeTableRow:m.handleResizeTableRow,findResults:b.findResults,findResultIndex:b.findResultIndex,activeSlideIndex:l,activeTool:u.activeTool,drawingColor:u.drawingColor,drawingWidth:u.drawingWidth,isDrawingRef:u.isDrawingRef,onAddInkElement:f.handleAddInkElement,onAddFreeformShape:f.handleAddFreeformShape,onEraseInkElement:f.handleEraseInkElement,onActionClick:T,onHyperlinkClick:M,allSlides:e==="present"?r:void 0,onZoomClick:e==="present"?g.handleZoomClick:void 0,sourceSlideIndex:e==="present"?l:void 0,fieldContext:w,tableStyleContext:C,collaborationOverlay:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(DH,{elements:v?.elements??[],activeSlideIndex:l}),jsxRuntime.jsx(NH,{activeSlideIndex:l,canvasWidth:a.width,canvasHeight:a.height,selectedElementId:u.selectedElementId})]}),comments:o?.comments,showCommentMarkers:u.sidebarPanelMode==="comments",onCommentMarkerClick:()=>u.setSidebarPanelMode("comments"),onMoveGuide:(N,D)=>{u.setGuides(U=>U.map(G=>G.id===N?{...G,position:G.axis==="h"?Math.max(0,Math.min(a.height,D)):Math.max(0,Math.min(a.width,D))}:G));},onDeleteGuide:N=>{u.setGuides(D=>D.filter(U=>U.id!==N));},onCreateGuideFromRuler:(N,D)=>{u.setGuides(U=>[...U,{id:`guide-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,axis:N,position:D}]);}}),e==="present"&&x.presentationTool!=="none"&&jsxRuntime.jsx(hG,{canvasSize:a,editorScale:d.editorScale,presentationTool:x.presentationTool,annotationStrokes:x.annotationStrokes,currentStroke:x.currentStroke,laserPosition:x.laserPosition,onPointerDown:x.handlePointerDown,onPointerMove:x.handlePointerMove,onPointerUp:x.handlePointerUp,onLaserMove:x.handleLaserMove,onLaserLeave:x.handleLaserLeave,onEraseAtPoint:x.eraseAtPoint}),e==="present"&&jsxRuntime.jsx(bG,{visible:!!u.presentationProperties.showSubtitles}),e==="present"&&jsxRuntime.jsx(xG,{currentSlideIndex:g.presentationSlideIndex,totalSlides:r.length,onMovePresentationSlide:g.movePresentationSlide,onEndPresentation:y??(()=>{})}),e==="present"&&jsxRuntime.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 z-[80] transition-opacity duration-300",style:{opacity:x.toolbarVisible?1:0,pointerEvents:x.toolbarVisible?"auto":"none"},onMouseEnter:E,onMouseLeave:R,children:jsxRuntime.jsx(gG,{presentationTool:x.presentationTool,penColor:x.penColor,highlighterColor:x.highlighterColor,hasAnnotations:x.annotationStrokes.length>0,onSetTool:x.setPresentationTool,onSetPenColor:x.setPenColor,onSetHighlighterColor:x.setHighlighterColor,onClearAnnotations:x.clearAnnotations,currentSlideIndex:g.presentationSlideIndex,totalSlides:r.length,onMovePresentationSlide:g.movePresentationSlide,presentationStartTime:g.presentationStartTime,onEndPresentation:y??(()=>{}),onTogglePresenterView:g.togglePresenterView,presenterMode:g.presenterMode})})]})}var tf="rounded bg-muted/50 p-2.5 space-y-2",nf="text-[11px] font-medium uppercase tracking-wide text-muted-foreground mb-1.5",O2="w-full rounded border border-border bg-background px-2 py-1 text-xs text-foreground focus:border-primary focus:outline-none",Ume="rounded bg-primary px-3 py-1.5 text-xs font-medium text-white hover:bg-primary/80 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",$me="rounded bg-accent px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:cursor-not-allowed transition-colors";var h5=[{name:"Office",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#44546A",lt2:"#E7E6E6",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47",hlink:"#0563C1",folHlink:"#954F72"},majorFont:"Calibri Light",minorFont:"Calibri"},{name:"Facet",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#2C3C43",lt2:"#CFD7D9",accent1:"#90C226",accent2:"#54A021",accent3:"#E6B91E",accent4:"#E76618",accent5:"#C42F1A",accent6:"#918655",hlink:"#99CA3C",folHlink:"#B9D181"},majorFont:"Trebuchet MS",minorFont:"Trebuchet MS"},{name:"Integral",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#335B74",lt2:"#DFE3E5",accent1:"#1CADE4",accent2:"#2683C6",accent3:"#27CED7",accent4:"#42BA97",accent5:"#3E8853",accent6:"#62A39F",hlink:"#6BA5D1",folHlink:"#9DCCE0"},majorFont:"Tw Cen MT Condensed",minorFont:"Tw Cen MT"},{name:"Ion",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#262626",lt2:"#E1E1E1",accent1:"#B01513",accent2:"#EA6312",accent3:"#E6B729",accent4:"#6AAC90",accent5:"#5F9C9D",accent6:"#9B6BF2",hlink:"#F09415",folHlink:"#D14D0F"},majorFont:"Century Gothic",minorFont:"Century Gothic"},{name:"Retrospect",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#637052",lt2:"#CCDDEA",accent1:"#E48312",accent2:"#BD582C",accent3:"#865640",accent4:"#9B8357",accent5:"#C2BC80",accent6:"#94A088",hlink:"#3A7CCB",folHlink:"#8C8C8C"},majorFont:"Calibri Light",minorFont:"Calibri"},{name:"Organic",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#283138",lt2:"#E3DED1",accent1:"#83992A",accent2:"#3C9770",accent3:"#44709D",accent4:"#A23C33",accent5:"#D97828",accent6:"#DEB340",hlink:"#A8B97F",folHlink:"#89C2A3"},majorFont:"Garamond",minorFont:"Garamond"},{name:"Wisp",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#46393B",lt2:"#E8DCD8",accent1:"#A53010",accent2:"#DE7E18",accent3:"#9F8351",accent4:"#728653",accent5:"#92AA4C",accent6:"#6AAC91",hlink:"#FB4F14",folHlink:"#E25839"},majorFont:"Century Gothic",minorFont:"Century Gothic"},{name:"Berlin",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#3E5C61",lt2:"#D5E0D0",accent1:"#F09415",accent2:"#C1B56B",accent3:"#89C2A3",accent4:"#729BBE",accent5:"#9A90C2",accent6:"#BE8DBE",hlink:"#25A0DA",folHlink:"#FF7F00"},majorFont:"Trebuchet MS",minorFont:"Trebuchet MS"},{name:"Slice",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#2E3B4C",lt2:"#C7CDD3",accent1:"#E2751D",accent2:"#C53B23",accent3:"#A13D69",accent4:"#58599E",accent5:"#36749D",accent6:"#4EA39A",hlink:"#FD6B32",folHlink:"#D14D0F"},majorFont:"Century Gothic",minorFont:"Century Gothic"},{name:"Dividend",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#3D3D3D",lt2:"#E1E1E1",accent1:"#4D1434",accent2:"#903163",accent3:"#B2324B",accent4:"#D34817",accent5:"#E8971C",accent6:"#FDCB00",hlink:"#A03068",folHlink:"#C34882"},majorFont:"Gill Sans MT",minorFont:"Gill Sans MT"}],d0=["Arial","Calibri","Calibri Light","Cambria","Century Gothic","Comic Sans MS","Consolas","Garamond","Georgia","Gill Sans MT","Impact","Lucida Console","Palatino Linotype","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Tw Cen MT","Verdana"];bt();function Hme({editColors:t,canEdit:e,activePickerKey:n,majorFont:r,minorFont:o,onSetActivePickerKey:i,onColorChange:s,onMajorFontChange:a,onMinorFontChange:l}){let{t:c}=reactI18next.useTranslation(),d=Jm.useMemo(()=>cU(t),[t]),u=Jm.useCallback(p=>{n&&/^#[0-9a-fA-F]{6}$/.test(p)&&s(n,p);},[n,s]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:c("pptx.themeEditor.colorScheme")}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:hc.map(p=>jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[jsxRuntime.jsx("button",{type:"button",disabled:!e,className:`h-6 w-full rounded-sm border transition-colors ${n===p?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground"} disabled:opacity-40 disabled:cursor-not-allowed`,style:{backgroundColor:t[p]},title:`${Fm[p]}: ${t[p]}`,"aria-label":`${Fm[p]}: ${t[p]}`,onClick:()=>i(n===p?null:p)}),jsxRuntime.jsx("span",{className:"text-[9px] text-muted-foreground truncate w-full text-center",children:Fm[p]})]},p))}),n&&jsxRuntime.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded bg-background p-2",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground min-w-[60px]",children:Fm[n]}),jsxRuntime.jsx("input",{type:"color",disabled:!e,className:"h-6 w-8 cursor-pointer rounded border-0 bg-transparent p-0",value:t[n],onChange:p=>s(n,p.target.value)}),jsxRuntime.jsx("input",{type:"text",disabled:!e,className:"flex-1 rounded border border-border bg-muted px-1.5 py-0.5 text-[10px] text-foreground font-mono",value:t[n],onChange:p=>u(p.target.value)})]})]}),d&&jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:c("pptx.themeEditor.preview")}),jsxRuntime.jsx("div",{className:"flex flex-col gap-px",children:d.map((p,h)=>jsxRuntime.jsx("div",{className:"grid grid-cols-12 gap-px",children:p.map(f=>jsxRuntime.jsx("div",{className:"h-3.5 rounded-sm",style:{backgroundColor:f.hex},title:`${f.colLabel} -- ${f.rowLabel} (${f.hex})`},`${f.schemeKey}-${h}`))},h))})]}),jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:c("pptx.themeEditor.fonts")}),jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:c("pptx.themeEditor.headingFont")}),jsxRuntime.jsxs("select",{className:O2,disabled:!e,value:d0.includes(r)?r:"__custom__",onChange:p=>{p.target.value!=="__custom__"&&a(p.target.value);},children:[d0.map(p=>jsxRuntime.jsx("option",{value:p,children:p},p)),!d0.includes(r)&&jsxRuntime.jsx("option",{value:"__custom__",children:r})]})]}),jsxRuntime.jsxs("label",{className:"flex flex-col gap-0.5",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground",children:c("pptx.themeEditor.bodyFont")}),jsxRuntime.jsxs("select",{className:O2,disabled:!e,value:d0.includes(o)?o:"__custom__",onChange:p=>{p.target.value!=="__custom__"&&l(p.target.value);},children:[d0.map(p=>jsxRuntime.jsx("option",{value:p,children:p},p)),!d0.includes(o)&&jsxRuntime.jsx("option",{value:"__custom__",children:o})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 pt-1 text-[10px] text-muted-foreground",children:[jsxRuntime.jsx("span",{style:{fontFamily:r},className:"text-foreground",children:c("pptx.themeEditor.headingSample")}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{style:{fontFamily:o},className:"text-foreground",children:c("pptx.themeEditor.bodySample")})]})]})]})]})}var but=["accent1","accent2","accent3","accent4","accent5","accent6"];function Vme({canEdit:t,currentThemeName:e,onSelectPreset:n}){let{t:r}=reactI18next.useTranslation();return jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:r("pptx.themeEditor.presetThemes")}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:h5.map(o=>jsxRuntime.jsxs("button",{type:"button",disabled:!t,className:`flex flex-col items-start gap-1 rounded border p-1.5 text-left transition-colors ${e===o.name?"border-primary bg-primary/10":"border-border hover:border-muted-foreground hover:bg-muted"} disabled:opacity-40 disabled:cursor-not-allowed`,onClick:()=>n(o),title:o.name,children:[jsxRuntime.jsx("div",{className:"flex gap-px w-full",children:but.map(i=>jsxRuntime.jsx("div",{className:"h-3 flex-1 first:rounded-l-sm last:rounded-r-sm",style:{backgroundColor:o.colorScheme[i]}},i))}),jsxRuntime.jsx("span",{className:"text-[10px] text-muted-foreground truncate w-full",children:o.name})]},o.name))})]})}function Gme({theme:t,canEdit:e,onUpdateColorScheme:n,onUpdateFontScheme:r,onUpdateThemeName:o,onApplyToPresentation:i,onClose:s}){let{t:a}=reactI18next.useTranslation(),[l,c]=Jm.useState(()=>t?.colorScheme??h5[0].colorScheme),[d,u]=Jm.useState(()=>t?.fontScheme?.majorFont?.latin??"Calibri Light"),[p,h]=Jm.useState(()=>t?.fontScheme?.minorFont?.latin??"Calibri"),[f,m]=Jm.useState(()=>t?.name??"Custom Theme"),[x,g]=Jm.useState(null),y=Jm.useCallback((T,M)=>{let _={...l,[T]:M};c(_),n(_);},[l,n]),b=Jm.useCallback(T=>{c(T.colorScheme),u(T.majorFont),h(T.minorFont),m(T.name),n(T.colorScheme),r({majorFont:{latin:T.majorFont},minorFont:{latin:T.minorFont}}),o(T.name);},[n,r,o]),v=Jm.useCallback(()=>{t?.colorScheme&&(c(t.colorScheme),u(t.fontScheme?.majorFont?.latin??"Calibri Light"),h(t.fontScheme?.minorFont?.latin??"Calibri"),m(t.name??"Custom Theme"),n(t.colorScheme),r({majorFont:{latin:t.fontScheme?.majorFont?.latin??"Calibri Light"},minorFont:{latin:t.fontScheme?.minorFont?.latin??"Calibri"}}),o(t.name??"Custom Theme"));},[t,n,r,o]),S=Jm.useCallback(T=>{u(T),r({majorFont:{latin:T},minorFont:{latin:p}});},[p,r]),w=Jm.useCallback(T=>{h(T),r({majorFont:{latin:d},minorFont:{latin:T}});},[d,r]),C=Jm.useCallback(T=>{m(T),o(T);},[o]);return jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 overflow-y-auto max-h-[calc(100vh-120px)]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a("pptx.themeEditor.title")}),jsxRuntime.jsx("button",{type:"button",onClick:s,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",title:a("pptx.themeEditor.close"),"aria-label":a("pptx.themeEditor.close"),children:jsxRuntime.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),jsxRuntime.jsxs("div",{className:tf,children:[jsxRuntime.jsx("div",{className:nf,children:a("pptx.themeEditor.themeName")}),jsxRuntime.jsx("input",{type:"text",className:O2,disabled:!e,value:f,onChange:T=>C(T.target.value),placeholder:a("pptx.themeEditor.themeNamePlaceholder")})]}),jsxRuntime.jsx(Vme,{canEdit:e,currentThemeName:f,onSelectPreset:b}),jsxRuntime.jsx(Hme,{editColors:l,canEdit:e,activePickerKey:x,majorFont:d,minorFont:p,onSetActivePickerKey:g,onColorChange:y,onMajorFontChange:S,onMinorFontChange:w}),jsxRuntime.jsxs("div",{className:"flex gap-1.5 pt-1",children:[jsxRuntime.jsx("button",{type:"button",disabled:!e,className:Ume,onClick:i,children:a("pptx.themeEditor.applyToPresentation")}),jsxRuntime.jsx("button",{type:"button",disabled:!e,className:$me,onClick:v,children:a("pptx.themeEditor.reset")})]})]})}function ZG({onClose:t,className:e,children:n}){let{dragY:r,handlers:o}=Lu(t);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button","aria-label":"Close",onClick:t,className:"md:hidden fixed inset-0 z-20 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150"}),jsxRuntime.jsxs("div",{className:e,style:r>0?{transform:`translateY(${r}px)`,transition:"none"}:void 0,children:[jsxRuntime.jsx("div",{className:"md:hidden flex items-center justify-center pt-2 pb-1 cursor-grab active:cursor-grabbing touch-none",onPointerDown:o.onPointerDown,onPointerMove:o.onPointerMove,onPointerUp:o.onPointerUp,onPointerCancel:o.onPointerCancel,children:jsxRuntime.jsx("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/40"})}),n]})]})}var JG=[{id:"office",name:"Office",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#44546A",lt2:"#E7E6E6",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47",hlink:"#0563C1",folHlink:"#954F72"},fontScheme:{majorFont:"Calibri Light",minorFont:"Calibri"}},{id:"facet",name:"Facet",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#2C3C43",lt2:"#CFD7D9",accent1:"#90C226",accent2:"#54A021",accent3:"#E6B91E",accent4:"#E76618",accent5:"#C42F1A",accent6:"#918655",hlink:"#99CA3C",folHlink:"#B9D181"},fontScheme:{majorFont:"Trebuchet MS",minorFont:"Trebuchet MS"}},{id:"integral",name:"Integral",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#335B74",lt2:"#DFE3E5",accent1:"#1CADE4",accent2:"#2683C6",accent3:"#27CED7",accent4:"#42BA97",accent5:"#3E8853",accent6:"#62A39F",hlink:"#6BA5D1",folHlink:"#9DCCE0"},fontScheme:{majorFont:"Tw Cen MT Condensed",minorFont:"Tw Cen MT"}},{id:"ion",name:"Ion",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#262626",lt2:"#E1E1E1",accent1:"#B01513",accent2:"#EA6312",accent3:"#E6B729",accent4:"#6AAC90",accent5:"#5F9C9D",accent6:"#9B6BF2",hlink:"#F09415",folHlink:"#D14D0F"},fontScheme:{majorFont:"Century Gothic",minorFont:"Century Gothic"}},{id:"retrospect",name:"Retrospect",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#637052",lt2:"#CCDDEA",accent1:"#E48312",accent2:"#BD582C",accent3:"#865640",accent4:"#9B8357",accent5:"#C2BC80",accent6:"#94A088",hlink:"#3A7CCB",folHlink:"#8C8C8C"},fontScheme:{majorFont:"Calibri Light",minorFont:"Calibri"}},{id:"organic",name:"Organic",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#283138",lt2:"#E3DED1",accent1:"#83992A",accent2:"#3C9770",accent3:"#44709D",accent4:"#A23C33",accent5:"#D97828",accent6:"#DEB340",hlink:"#A8B97F",folHlink:"#89C2A3"},fontScheme:{majorFont:"Garamond",minorFont:"Garamond"}},{id:"wisp",name:"Wisp",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#46393B",lt2:"#E8DCD8",accent1:"#A53010",accent2:"#DE7E18",accent3:"#9F8351",accent4:"#728653",accent5:"#92AA4C",accent6:"#6AAC91",hlink:"#FB4F14",folHlink:"#E25839"},fontScheme:{majorFont:"Century Gothic",minorFont:"Century Gothic"}},{id:"berlin",name:"Berlin",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#3E5C61",lt2:"#D5E0D0",accent1:"#F09415",accent2:"#C1B56B",accent3:"#89C2A3",accent4:"#729BBE",accent5:"#9A90C2",accent6:"#BE8DBE",hlink:"#25A0DA",folHlink:"#FF7F00"},fontScheme:{majorFont:"Trebuchet MS",minorFont:"Trebuchet MS"}},{id:"slice",name:"Slice",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#2E3B4C",lt2:"#C7CDD3",accent1:"#E2751D",accent2:"#C53B23",accent3:"#A13D69",accent4:"#58599E",accent5:"#36749D",accent6:"#4EA39A",hlink:"#FD6B32",folHlink:"#D14D0F"},fontScheme:{majorFont:"Century Gothic",minorFont:"Century Gothic"}},{id:"dividend",name:"Dividend",colorScheme:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#3D3D3D",lt2:"#E1E1E1",accent1:"#4D1434",accent2:"#903163",accent3:"#B2324B",accent4:"#D34817",accent5:"#E8971C",accent6:"#FDCB00",hlink:"#A03068",folHlink:"#C34882"},fontScheme:{majorFont:"Gill Sans MT",minorFont:"Gill Sans MT"}}];function QG({theme:t,selected:e,onClick:n}){let{colorScheme:r}=t;return jsxRuntime.jsxs("button",{type:"button",onClick:n,className:ie("group relative flex flex-col rounded-lg border-2 transition-all overflow-hidden",e?"border-primary shadow-lg scale-[1.02]":"border-border hover:border-primary/50 hover:shadow-md"),title:t.name,children:[jsxRuntime.jsxs("div",{className:"h-24 flex flex-col",children:[jsxRuntime.jsxs("div",{className:"h-10 flex",children:[jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:r.accent1}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:r.accent2}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:r.accent3}})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex",children:[jsxRuntime.jsx("div",{className:"w-1/3",style:{backgroundColor:r.dk2}}),jsxRuntime.jsx("div",{className:"flex-1",style:{backgroundColor:r.lt2}})]})]}),jsxRuntime.jsx("div",{className:"bg-background border-t border-border px-2 py-1.5",children:jsxRuntime.jsx("p",{className:"text-xs font-medium text-foreground text-center",children:t.name})}),e&&jsxRuntime.jsx("div",{className:"absolute top-1 right-1 bg-primary text-white rounded-full p-1",children:jsxRuntime.jsx(lu$1.LuCheck,{className:"w-3 h-3"})})]})}function jme({open:t,currentTheme:e,canEdit:n,onClose:r,onApplyTheme:o,onImportTheme:i}){let{t:s}=reactI18next.useTranslation(),[a,l]=Jm.useState(e??null),c=Jm.useRef(null);if(!t)return null;let d=()=>{a&&(o(a),r());},u=()=>{c.current?.click();},p=h=>{let f=h.target.files?.[0];f&&i&&i(f),h.target.value="";};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:"fixed inset-0 z-[100] bg-black/60 backdrop-blur-sm",onClick:r,"aria-label":s("common.close")}),jsxRuntime.jsx("div",{className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:jsxRuntime.jsxs("div",{className:"bg-background border border-border rounded-xl shadow-2xl max-w-5xl w-full max-h-[90vh] flex flex-col",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s("powerpoint.toolbar.themes.gallery.title")}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s("powerpoint.toolbar.themes.gallery.description")})]}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"p-2 rounded hover:bg-accent transition-colors","aria-label":s("common.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4",children:JG.map(h=>jsxRuntime.jsx(QG,{theme:h,selected:a?.id===h.id,onClick:()=>l(h)},h.id))})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",onClick:u,disabled:!n,className:"inline-flex items-center gap-2 px-3 py-1.5 rounded bg-accent hover:bg-accent/80 text-xs font-medium text-foreground transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[jsxRuntime.jsx(lu$1.LuUpload,{className:"w-3.5 h-3.5"}),s("powerpoint.toolbar.themes.gallery.importTheme")]}),jsxRuntime.jsx("input",{ref:c,type:"file",accept:".thmx,.pptx",className:"hidden",onChange:p})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:r,className:"px-3 py-1.5 rounded bg-accent hover:bg-accent/80 text-xs font-medium text-foreground transition-colors",children:s("common.cancel")}),jsxRuntime.jsx("button",{type:"button",onClick:d,disabled:!n||!a,className:"px-3 py-1.5 rounded bg-primary hover:bg-primary/80 text-xs font-medium text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:s("common.apply")})]})]})]})})]})}function eW(t){let{mode:e,canEdit:n,activeSlide:r,masterPseudoSlide:o,slides:i,canvasSize:s,activeSlideIndex:a,selectedElement:l,state:c,comments:d,ops:u,manipulation:p,propertyHandlers:h,themeHandlers:f,history:m,panelWidth:x,onResizeRight:g}=t,y=e==="master"?o:r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[(e==="edit"||e==="master")&&c.isInspectorPaneOpen&&g&&jsxRuntime.jsx(yu,{direction:"horizontal",onResize:g}),jsxRuntime.jsx(GG,{isOpen:(e==="edit"||e==="master")&&c.isInspectorPaneOpen,canEdit:n,mode:e,activeSlide:y,slides:i,canvasSize:s,selectedElement:l,effectiveSelectedIds:c.effectiveSelectedIds,tableEditorState:c.tableEditorState,sidebarPanelMode:c.sidebarPanelMode,activeSlideIndex:a,comments:d,onSetSidebarPanelMode:c.setSidebarPanelMode,onClose:()=>c.setIsInspectorPaneOpen(false),onUpdateElementStyle:u.updateSelectedShapeStyle,onUpdateTextStyle:u.updateSelectedTextStyle,onUpdateElement:u.updateSelectedElement,onApplySelection:u.applySelection,onSetCanvasSize:c.setCanvasSize,onMoveLayer:p.handleMoveLayer,onMoveLayerToEdge:p.handleMoveLayerToEdge,onDeleteElement:p.handleDelete,onUpdateSlide:h.handleUpdateSlide,presentationProperties:c.presentationProperties,onUpdatePresentationProperties:h.handleUpdatePresentationProperties,editTemplateMode:c.editTemplateMode,slideMasters:c.slideMasters,themeOptions:c.themeOptions,notesMaster:c.notesMaster,handoutMaster:c.handoutMaster,notesCanvasSize:c.notesCanvasSize,coreProperties:c.coreProperties,appProperties:c.appProperties,customProperties:c.customProperties,tagCollections:c.tagCollections,onUpdateTagCollections:c.setTagCollections,onUpdateCoreProperties:h.handleUpdateCoreProperties,onUpdateAppProperties:h.handleUpdateAppProperties,onUpdateCustomProperties:h.handleUpdateCustomProperties,onApplyTheme:f.handleApplyTheme,onSetTemplateBackground:f.handleSetTemplateBackground,onGetTemplateBackgroundColor:f.handleGetTemplateBackgroundColor,mediaDataUrls:c.mediaDataUrls,theme:c.theme,panelWidth:x}),c.isSelectionPaneOpen&&(e==="edit"||e==="master")&&jsxRuntime.jsx(ZG,{onClose:()=>c.setIsSelectionPaneOpen(false),className:"absolute right-0 top-0 z-30 h-full max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:h-auto max-md:max-h-[50vh] max-md:rounded-t-xl max-md:border-t max-md:border-border max-md:shadow-2xl max-md:bg-background",children:jsxRuntime.jsx(DV,{slides:i,activeSlideIndex:a,selectedElementId:c.selectedElementId,selectedElementIds:c.selectedElementIds,canEdit:n,setSelectedElementId:c.setSelectedElementId,setSelectedElementIds:c.setSelectedElementIds,setSlides:c.setSlides,markDirty:m.markDirty,onClose:()=>c.setIsSelectionPaneOpen(false)})}),c.isThemeEditorOpen&&e==="edit"&&jsxRuntime.jsx(ZG,{onClose:()=>c.setIsThemeEditorOpen(false),className:"absolute right-0 top-0 z-30 h-full w-72 overflow-y-auto border-l border-border bg-card p-2.5 shadow-xl max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:h-auto max-md:max-h-[60vh] max-md:rounded-t-xl max-md:border-t max-md:border-l-0",children:jsxRuntime.jsx(Gme,{theme:c.theme,canEdit:n,onUpdateColorScheme:f.handleUpdateThemeColorScheme,onUpdateFontScheme:f.handleUpdateThemeFontScheme,onUpdateThemeName:f.handleUpdateThemeName,onApplyToPresentation:f.handleApplyThemeToPresentation,onClose:()=>c.setIsThemeEditorOpen(false)})}),jsxRuntime.jsx(jme,{open:c.isThemeGalleryOpen,currentTheme:null,canEdit:n,onClose:()=>c.setIsThemeGalleryOpen(false),onApplyTheme:b=>{f.handleApplyThemeData(b.colorScheme,{majorFont:{latin:b.fontScheme.majorFont,eastAsia:b.fontScheme.majorFont,complexScript:b.fontScheme.majorFont},minorFont:{latin:b.fontScheme.minorFont,eastAsia:b.fontScheme.minorFont,complexScript:b.fontScheme.minorFont}},b.name);}})]})}function tW(t){let{mode:e,canEdit:n,slides:r,activeSlide:o,masterPseudoSlide:i,activeSlideIndex:s,canvasSize:a,gridSpacingPx:l,slideSectionGroups:c,showSlidesPane:d,showMasterPane:u,selectedElement:p,state:h,editorOps:f,dialogs:m,presentation:x,annotations:g,propertyHandlers:y,themeHandlers:b,history:v,comments:S,zoom:w,isMobile:C=false,isTouchDevice:T=false,onEndPresentation:M,leftPanelWidth:_,onResizeLeft:E,rightPanelWidth:R,onResizeRight:I}=t,{ops:L,sectionOps:k,canvasHandlers:F,insertHandlers:N,manipulation:D,slideOps:U,tableOps:G,findReplace:j}=f;return jsxRuntime.jsxs("div",{className:"relative z-10 flex flex-1 min-h-0",children:[d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(WC,{slides:r,activeSlideIndex:s,canvasSize:a,sectionGroups:c,isOpen:h.isSlidesPaneOpen,canEdit:n,onSelectSlide:h.setActiveSlideIndex,onSlideContextMenu:U.handleSlideContextMenu,onMoveSlide:U.handleMoveSlide,onAddSlide:U.handleAddSlide,onCollapse:()=>h.setIsSlidesPaneOpen(false),onAddSection:k.addSection,onRenameSection:k.renameSection,onDeleteSection:k.deleteSection,onMoveSectionUp:k.moveSectionUp,onMoveSectionDown:k.moveSectionDown,rehearsalTimings:Object.keys(x.recordedTimings).length>0?x.recordedTimings:void 0,panelWidth:_}),E&&jsxRuntime.jsx(yu,{direction:"horizontal",onResize:E})]}),u&&jsxRuntime.jsx(zH,{slideMasters:h.slideMasters,activeMasterIndex:h.activeMasterIndex,activeLayoutIndex:h.activeLayoutIndex,canvasSize:a,masterViewTab:h.masterViewTab,notesMaster:h.notesMaster,handoutMaster:h.handoutMaster,handoutSlidesPerPage:h.handoutSlidesPerPage,onSelectMaster:m.handleSelectMaster,onSelectLayout:m.handleSelectLayout,onCollapse:()=>h.setIsSlidesPaneOpen(false),onTabChange:h.setMasterViewTab,onHandoutSlidesPerPageChange:h.setHandoutSlidesPerPage}),jsxRuntime.jsx(KG,{mode:e,canEdit:n,slides:r,activeSlide:o,masterPseudoSlide:i,templateElements:h.templateElements,canvasSize:a,activeSlideIndex:s,gridSpacingPx:l,zoom:w,state:h,selectedElement:p,canvasHandlers:F,insertHandlers:N,tableOps:G,annotations:g,presentation:x,onEndPresentation:M,findReplace:j}),h.contextMenuState&&jsxRuntime.jsx(b6,{contextMenuState:h.contextMenuState,mode:e,selectedElement:p,tableEditorState:h.tableEditorState,hasMultiSelection:h.effectiveSelectedIds.length>1,onAction:D.handleContextMenuAction,onInsertTableRow:G.handleInsertTableRow,onDeleteTableRow:G.handleDeleteTableRow,onInsertTableColumn:G.handleInsertTableColumn,onDeleteTableColumn:G.handleDeleteTableColumn,onMergeCellRight:G.handleMergeCellRight,onMergeCellDown:G.handleMergeCellDown,onMergeSelectedCells:G.handleMergeSelectedCells,onSplitCell:G.handleSplitCell,onClose:()=>h.setContextMenuState(null)}),jsxRuntime.jsx(eW,{mode:e,canEdit:n,activeSlide:o,masterPseudoSlide:i,slides:r,canvasSize:a,activeSlideIndex:s,selectedElement:p,state:h,comments:S,ops:L,manipulation:D,propertyHandlers:y,themeHandlers:b,history:v,panelWidth:R,onResizeRight:I})]})}function Kme({onOpenSlides:t,onOpenInsert:e,onOpenInspector:n,onOpenComments:r,onToggleNotes:o,activeSheet:i,commentCount:s}){return jsxRuntime.jsx("nav",{"aria-label":"Editor actions",className:"flex items-stretch justify-around border-t border-border bg-secondary/80 backdrop-blur supports-[backdrop-filter]:bg-secondary/60 pb-[max(env(safe-area-inset-bottom),0px)]",children:[{key:"slides",label:"Slides",icon:lu$1.LuLayers,onClick:t},{key:"insert",label:"Insert",icon:lu$1.LuPlus,onClick:e},{key:"inspector",label:"Format",icon:lu$1.LuSettings2,onClick:n},{key:"comments",label:"Comments",icon:lu$1.LuMessageSquare,onClick:r,badge:s},{key:"notes",label:"Notes",icon:lu$1.LuStickyNote,onClick:o}].map(({key:l,label:c,icon:d,onClick:u,badge:p})=>{let h=i===l;return jsxRuntime.jsxs("button",{type:"button",onClick:u,className:ie("relative flex flex-col items-center justify-center gap-0.5 flex-1 min-h-[56px] py-1.5 text-[10px] font-medium transition-colors active:scale-95",h?"text-primary":"text-muted-foreground hover:text-foreground"),"aria-pressed":h,children:[jsxRuntime.jsx(d,{className:"w-5 h-5"}),jsxRuntime.jsx("span",{children:c}),p!==void 0&&p>0&&jsxRuntime.jsx("span",{className:"absolute top-1 right-1/4 flex items-center justify-center min-w-[16px] h-4 px-1 rounded-full bg-primary text-[9px] font-semibold text-white",children:p>99?"99+":p}),h&&jsxRuntime.jsx("span",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-8 h-0.5 rounded-full bg-primary"})]},l)})})}function qme({open:t,onClose:e,...n}){return jsxRuntime.jsx(AN,{open:t,onClose:e,heightFraction:.7,title:"Slides",children:jsxRuntime.jsx("div",{className:"h-full",children:jsxRuntime.jsx(WC,{...n})})})}function Zme(t){let{state:e,editorOps:n,presentation:r,slides:o,activeSlideIndex:i,canvasSize:s,slideSectionGroups:a,canEdit:l,commentCount:c}=t,{keyboardInset:d,isKeyboardOpen:u}=xV(),p=e.isSlidesPaneOpen?"slides":e.isInspectorPaneOpen?e.sidebarPanelMode==="comments"?"comments":"inspector":e.isSlideNotesCollapsed?null:"notes",h=()=>{e.setIsSlidesPaneOpen(false),e.setIsInspectorPaneOpen(false),e.setIsSlideNotesCollapsed(true);},f=m=>{switch(h(),m){case "slides":e.setIsSlidesPaneOpen(true);break;case "inspector":e.setSidebarPanelMode("properties"),e.setIsInspectorPaneOpen(true);break;case "comments":e.setSidebarPanelMode("comments"),e.setIsInspectorPaneOpen(true);break;case "notes":e.setIsSlideNotesCollapsed(false);break}};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qme,{open:e.isSlidesPaneOpen,onClose:()=>e.setIsSlidesPaneOpen(false),slides:o,activeSlideIndex:i,canvasSize:s,sectionGroups:a,isOpen:true,canEdit:l,onSelectSlide:m=>{e.setActiveSlideIndex(m),e.setIsSlidesPaneOpen(false);},onSlideContextMenu:n.slideOps.handleSlideContextMenu,onMoveSlide:n.slideOps.handleMoveSlide,onAddSlide:n.slideOps.handleAddSlide,onCollapse:()=>e.setIsSlidesPaneOpen(false),onAddSection:n.sectionOps.addSection,onRenameSection:n.sectionOps.renameSection,onDeleteSection:n.sectionOps.deleteSection,onMoveSectionUp:n.sectionOps.moveSectionUp,onMoveSectionDown:n.sectionOps.moveSectionDown,rehearsalTimings:Object.keys(r.recordedTimings).length>0?r.recordedTimings:void 0}),jsxRuntime.jsx("div",{className:"contents",style:d>0?{display:"block",transform:`translateY(-${d}px)`,transition:"transform 150ms ease-out",willChange:"transform"}:void 0,"data-keyboard-open":u?"true":void 0,children:jsxRuntime.jsx(Kme,{activeSheet:p,commentCount:c,onOpenSlides:()=>e.isSlidesPaneOpen?e.setIsSlidesPaneOpen(false):f("slides"),onOpenInsert:()=>{n.insertHandlers.handleAddTextBox();},onOpenInspector:()=>e.isInspectorPaneOpen&&e.sidebarPanelMode!=="comments"?e.setIsInspectorPaneOpen(false):f("inspector"),onOpenComments:()=>e.isInspectorPaneOpen&&e.sidebarPanelMode==="comments"?e.setIsInspectorPaneOpen(false):f("comments"),onToggleNotes:()=>e.isSlideNotesCollapsed?f("notes"):e.setIsSlideNotesCollapsed(true)})})]})}function Mv({label:t,enabled:e,onToggle:n}){return jsxRuntime.jsxs("div",{className:"flex items-center justify-between py-2.5 px-3",children:[jsxRuntime.jsx("span",{className:"text-sm text-foreground",children:t}),jsxRuntime.jsx("button",{type:"button",onClick:n,className:ie("relative inline-flex h-5 w-9 items-center rounded-full transition-colors",e?"bg-primary":"bg-muted-foreground/30"),role:"switch","aria-checked":e,"aria-label":t,children:jsxRuntime.jsx("span",{className:ie("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})]})}function Qme({isOpen:t,onClose:e,spellCheckEnabled:n=false,onSetSpellCheckEnabled:r,showGrid:o=false,onSetShowGrid:i,showRulers:s=false,onSetShowRulers:a,snapToGrid:l=false,onSetSnapToGrid:c,reducedMotion:d=false,onToggleReducedMotion:u}){let[p,h]=Jm.useState("general"),[f,m]=Jm.useState(true),{t:x}=reactI18next.useTranslation(),{panelStyle:g,handlers:y}=pi(e),b=Jm.useCallback(S=>{S.key==="Escape"&&e();},[e]);if(Jm.useEffect(()=>{if(t)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t,b]),!t)return null;let v=[{id:"general",label:x("pptx.settings.general")},{id:"shortcuts",label:x("pptx.settings.keyboardShortcuts")}];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",style:{zIndex:1200},className:"fixed inset-0 bg-black/60","aria-label":x("pptx.settings.closeSettings"),onClick:e}),jsxRuntime.jsx("div",{style:{zIndex:1201},className:"fixed inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsxs("div",{style:g,className:"pointer-events-auto w-[min(32rem,calc(100%-2rem))] rounded-xl border border-border bg-popover backdrop-blur-xl shadow-2xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:w-full max-md:max-h-[88dvh] max-md:overflow-y-auto max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",children:[jsxRuntime.jsxs("div",{...y,className:"flex items-center justify-between px-5 py-4 border-b border-border/60 touch-none",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lu$1.LuSettings,{className:"w-5 h-5 text-primary"}),jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:x("pptx.settings.title")})]}),jsxRuntime.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":x("pptx.settings.close"),children:jsxRuntime.jsx(lu$1.LuX,{className:"w-4 h-4 text-muted-foreground"})})]}),jsxRuntime.jsx("div",{className:"flex border-b border-border/60 px-5",children:v.map(S=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>h(S.id),className:ie("px-3 py-2 text-xs font-medium transition-colors relative",p===S.id?"text-primary":"text-muted-foreground hover:text-foreground"),children:[S.label,p===S.id&&jsxRuntime.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary rounded-full"})]},S.id))}),jsxRuntime.jsxs("div",{className:"px-5 py-4 max-h-[60vh] overflow-y-auto",children:[p==="general"&&jsxRuntime.jsxs("div",{className:"space-y-0.5",children:[jsxRuntime.jsx(Mv,{label:x("pptx.settings.autoSave"),enabled:f,onToggle:()=>m(!f)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.spellCheck"),enabled:n,onToggle:()=>r?.(!n)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.showGrid"),enabled:o,onToggle:()=>i?.(!o)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.showRulers"),enabled:s,onToggle:()=>a?.(!s)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.snapToGrid"),enabled:l,onToggle:()=>c?.(!l)}),jsxRuntime.jsx(Mv,{label:x("pptx.settings.reducedMotion"),enabled:d,onToggle:()=>u?.()})]}),p==="shortcuts"&&jsxRuntime.jsx("div",{className:"space-y-0.5",children:vR.map((S,w)=>jsxRuntime.jsxs("div",{className:ie("flex items-center justify-between gap-3 rounded px-3 py-2",w%2===0?"bg-muted/60":""),children:[jsxRuntime.jsx("span",{className:"text-xs text-foreground",children:x(S.actionKey)}),jsxRuntime.jsx("span",{className:"font-mono text-[11px] text-muted-foreground whitespace-nowrap",children:S.shortcut})]},S.actionKey))})]})]})})]})}var Wut=120,Xut=400,jut=180,Yut=220,Kut=480,qut=288,Zut=60,Jut=400,Qut=120;function ege(){let[t,e]=Jm.useState(jut),[n,r]=Jm.useState(qut),[o,i]=Jm.useState(Qut),s=Jm.useCallback(c=>{e(d=>Math.min(Xut,Math.max(Wut,d+c)));},[]),a=Jm.useCallback(c=>{r(d=>Math.min(Kut,Math.max(Yut,d-c)));},[]),l=Jm.useCallback(c=>{i(d=>Math.min(Jut,Math.max(Zut,d-c)));},[]);return {leftWidth:t,rightWidth:n,bottomHeight:o,onResizeLeft:s,onResizeRight:a,onResizeBottom:l}}var tge=Jm.forwardRef(function(e,n){let{content:r,filePath:o,fileName:i,canEdit:s=false,onContentChange:a,onDirtyChange:l,onActiveSlideChange:c,onModeChange:d,onZoomChange:u,onSelectionChange:p,onSlideCountChange:h,onOpenFile:f,theme:m,authorName:x,collaboration:g,onStartCollaboration:y,onStopCollaboration:b,shareDefaults:v,smartArt3D:S=false}=e,w=c$(m),[C,T]=Jm.useState(r);Jm.useEffect(()=>{T(r);},[r]);let M=Jm.useCallback(()=>{if(f){f();return}(async()=>{let Te=await Ane();Te&&T(Te.buffer);})();},[f]),[_,E]=Jm.useState(false),[R,I]=Jm.useState(true),[L,k]=Jm.useState(false),{reducedMotion:F,toggleReducedMotion:N}=dV(),D=Sz(),{containerRef:U,mode:G,slides:j,canvasSize:Y,loading:ge,error:fe,activeSlideIndex:de,selectedElementId:J,selectedElementIds:re,templateElementsBySlideId:ce,activeSlide:ae,selectedElement:_e}=D,xe=f2({containerRef:U}),{isMobile:Ee,isTouchDevice:W,isVirtualKeyboardOpen:q}=xe,Q=ege(),{gridSpacingPx:se,visibleSlideIndexes:me,slideSectionGroups:P,masterPseudoSlide:A}=Qz({slides:j,sections:D.sections,customShows:D.customShows,activeCustomShowId:D.activeCustomShowId,mode:G,activeLayout:D.activeLayout,activeMaster:D.activeMaster,presentationGridSpacing:D.presentationProperties.gridSpacing}),O=Jm.useCallback(()=>!!(D.dragStateRef.current||D.resizeStateRef.current||D.marqueeStateRef.current||D.shapeAdjustmentDragStateRef.current||D.isDrawingRef.current),[D.dragStateRef,D.resizeStateRef,D.marqueeStateRef,D.shapeAdjustmentDragStateRef,D.isDrawingRef]),z=iz({canvasSize:Y,selectedElements:D.selectedElements}),te=rz({slides:j,canvasSize:Y,activeSlideIndex:de,templateElementsBySlideId:ce,editTemplateMode:D.editTemplateMode,headerFooter:D.headerFooter,loading:ge,error:fe,hasActivePointerInteraction:O,pointerCommitNonce:D.pointerCommitNonce,setSlides:D.setSlides,setCanvasSize:D.setCanvasSize,setActiveSlideIndex:D.setActiveSlideIndex,setTemplateElementsBySlideId:D.setTemplateElementsBySlideId,setSelectedElementId:D.setSelectedElementId,setSelectedElementIds:D.setSelectedElementIds,setEditTemplateMode:D.setEditTemplateMode,setHeaderFooter:D.setHeaderFooter}),{presentation:$,annotations:Me,actionSoundHandlerRef:De}=rV({mode:G,slides:j,visibleSlideIndexes:me,activeSlideIndex:de,containerRef:U,content:C,mediaDataUrls:D.mediaDataUrls,presentationProperties:D.presentationProperties,setMode:D.setMode,setActiveSlideIndex:D.setActiveSlideIndex,setSlides:D.setSlides,history:te});gV({targetRef:z.canvasViewportRef,currentScale:z.scale,callbacks:{onPinchZoom:Te=>z.setScale(Te),onSwipe:G==="present"?Te=>$.movePresentationSlide(Te===1?-1:1):void 0,onLongPress:(Te,Ve)=>{G!=="edit"||!s||D.selectedElementId&&D.setContextMenuState({x:Te,y:Ve,elementId:D.selectedElementId});}},enabled:W});let V=Jz({mode:G,slides:j,activeSlide:ae,canvasSize:Y,containerRef:U,customShows:D.customShows,activeCustomShowId:D.activeCustomShowId,setCustomShows:D.setCustomShows,setActiveCustomShowId:D.setActiveCustomShowId,setGuides:D.setGuides,setPresentationProperties:D.setPresentationProperties,setAccessibilityIssues:D.setAccessibilityIssues,setIsAccessibilityPanelOpen:D.setIsAccessibilityPanelOpen,setMode:D.setMode,setPreMasterMode:D.setPreMasterMode,setActiveMasterIndex:D.setActiveMasterIndex,setActiveLayoutIndex:D.setActiveLayoutIndex,setSelectedElementId:D.setSelectedElementId,setSelectedElementIds:D.setSelectedElementIds,preMasterMode:D.preMasterMode,hasDigitalSignatures:D.hasDigitalSignatures,isDirty:D.isDirty,history:te});Jm.useEffect(()=>{D.setSelectedElementId(null),D.setSelectedElementIds([]),D.setInlineEditingElementId(null);},[de]),Jm.useEffect(()=>{G==="present"&&(D.setSelectedElementId(null),D.setSelectedElementIds([]),D.setInlineEditingElementId(null),z.handleZoomToFit(),z.canvasViewportRef.current?.scrollTo({left:0,top:0}));},[G]);let B=oV({state:D,history:te,zoom:z,mode:G,canEdit:s,slides:j,activeSlide:ae,activeSlideIndex:de,selectedElement:_e,selectedElementId:J,selectedElementIds:re,canvasSize:Y,dialogs:V,presentation:$,userName:x??g?.userName,handlerRef:De}),{exportHandlers:ee,printHandlers:oe,themeHandlers:pe,propertyHandlers:Ae,showKeepAnnotationsDialog:Le,handleSetMode:ue,handleKeepAnnotations:we,handleDiscardAnnotations:Ie,handleEnterPresenterView:He,handleEnterRehearsalMode:Oe,autosaveStatus:$e,isEncryptedDialogOpen:ot,setIsEncryptedDialogOpen:at}=cV({state:D,zoom:z,history:te,presentation:$,annotations:Me,actionSoundHandlerRef:De,editorOps:B,dialogs:V,gridSpacingPx:se,content:C,filePath:o,autosaveEnabled:R,canEdit:s,mode:G,slides:j,activeSlide:ae,activeSlideIndex:de,canvasSize:Y,loading:ge,error:fe,ref:n,setContent:T,onContentChange:a,onDirtyChange:l,onActiveSlideChange:c,onModeChange:d,onZoomChange:u,onSelectionChange:p,onSlideCountChange:h});if(ge)return jsxRuntime.jsx(d6,{});if(fe)return jsxRuntime.jsx(u6,{error:fe});let gt=G==="edit"&&!Ee&&!V.isNarrowViewport&&D.isSlidesPaneOpen,le=G==="master"&&!Ee&&D.isSlidesPaneOpen,Ue=jsxRuntime.jsxs("div",{style:w,"data-pptx-viewer":"",className:"h-full w-full bg-background text-foreground relative",children:[jsxRuntime.jsxs("div",{ref:U,tabIndex:0,className:"h-full w-full flex flex-col overflow-hidden outline-none",children:[G!=="present"&&jsxRuntime.jsx(WG,{mode:G,canEdit:s,state:D,selectedElement:_e,activeSlide:ae,zoom:z,history:te,findReplace:B.findReplace,manipulation:B.manipulation,insertHandlers:B.insertHandlers,exportHandlers:ee,printHandlers:oe,propertyHandlers:Ae,dialogs:V,slideOps:B.slideOps,ops:B.ops,onSetMode:ue,onEnterPresenterView:He,onEnterRehearsalMode:Oe,onOpenSettings:()=>E(true),onOpenShareDialog:()=>k(true),onOpenFile:M,fileName:i,autosaveStatus:$e,autosaveEnabled:R,onToggleAutosave:()=>I(Te=>!Te)}),jsxRuntime.jsx(tW,{mode:G,canEdit:s,slides:j,activeSlide:ae,masterPseudoSlide:A,activeSlideIndex:de,canvasSize:Y,gridSpacingPx:se,slideSectionGroups:P,showSlidesPane:gt,showMasterPane:le,selectedElement:_e,state:D,editorOps:B,dialogs:V,presentation:$,annotations:Me,propertyHandlers:Ae,themeHandlers:pe,history:te,comments:B.comments,zoom:z,isMobile:Ee,isTouchDevice:W,onEndPresentation:()=>ue("edit"),leftPanelWidth:Ee?void 0:Q.leftWidth,onResizeLeft:Ee?void 0:Q.onResizeLeft,rightPanelWidth:Ee?void 0:Q.rightWidth,onResizeRight:Ee?void 0:Q.onResizeRight}),G!=="present"&&(!q||!D.isSlideNotesCollapsed)&&jsxRuntime.jsx(VG,{activeSlide:ae,allSlides:j,isSlideNotesCollapsed:D.isSlideNotesCollapsed,canEdit:s,slideCount:j.length,activeSlideIndex:de,isDirty:D.isDirty,autosaveStatus:$e,onToggleNotes:()=>D.setIsSlideNotesCollapsed(Te=>!Te),onUpdateNotes:Ae.handleUpdateNotes,collaborationSlot:g?jsxRuntime.jsx(npt,{}):void 0,notesPanelHeight:Ee?void 0:Q.bottomHeight,onResizeBottom:Ee?void 0:Q.onResizeBottom,scale:z.scale,onZoomIn:z.handleZoomIn,onZoomOut:z.handleZoomOut,onZoomToFit:z.handleZoomToFit,mode:G,onSetMode:ue,onToggleSlideSorter:()=>D.setShowSlideSorter(Te=>!Te),hideStatusBar:Ee}),G!=="present"&&Ee&&jsxRuntime.jsx(Zme,{state:D,editorOps:B,presentation:$,slides:j,activeSlideIndex:de,canvasSize:Y,slideSectionGroups:P,canEdit:s,commentCount:ae?.comments?.length??0})]}),jsxRuntime.jsx(jG,{dialogs:V,insertHandlers:B.insertHandlers,exportHandlers:ee,printHandlers:oe,propertyHandlers:Ae,annotations:Me,slides:j,activeSlideIndex:de,canvasSize:Y,filePath:o,coreProperties:D.coreProperties,customProperties:D.customProperties,appProperties:D.appProperties,embeddedFonts:D.embeddedFonts,hasDigitalSignatures:D.hasDigitalSignatures,digitalSignatureCount:D.digitalSignatureCount,presentationProperties:D.presentationProperties,customShows:D.customShows,selectedElements:D.selectedElements,isEncryptedDialogOpen:ot,setIsEncryptedDialogOpen:at,showKeepAnnotationsDialog:Le,onKeepAnnotations:we,onDiscardAnnotations:Ie}),jsxRuntime.jsx(Qme,{isOpen:_,onClose:()=>E(false),spellCheckEnabled:D.spellCheckEnabled,onSetSpellCheckEnabled:D.setSpellCheckEnabled,showGrid:D.showGrid,onSetShowGrid:D.setShowGrid,showRulers:D.showRulers,onSetShowRulers:D.setShowRulers,snapToGrid:D.snapToGrid,onSetSnapToGrid:D.setSnapToGrid,reducedMotion:F,onToggleReducedMotion:N}),jsxRuntime.jsx(IG,{open:L,onClose:()=>k(false),activeCollaboration:g,onStartCollaboration:y,onStopCollaboration:b,preconfigured:!!g,defaultRoomId:v?.roomId,defaultUserName:v?.userName,defaultServerUrl:v?.serverUrl}),jsxRuntime.jsx(EG,{open:V.isBroadcastDialogOpen,onClose:()=>V.setIsBroadcastDialogOpen(false),onStartBroadcast:y,onStopBroadcast:b,onStartPresenting:()=>ue("present"),defaultRoomId:v?.roomId,defaultUserName:v?.userName,defaultServerUrl:v?.serverUrl}),jsxRuntime.jsx(HG,{isShortcutHelpOpen:D.isShortcutHelpOpen,isAccessibilityPanelOpen:D.isAccessibilityPanelOpen,showSlideSorter:D.showSlideSorter,accessibilityIssues:D.accessibilityIssues,slides:j,activeSlideIndex:de,canvasSize:Y,canEdit:s,sectionGroups:P,onCloseShortcuts:()=>D.setIsShortcutHelpOpen(false),onCloseAccessibility:()=>D.setIsAccessibilityPanelOpen(false),onSelectSlide:Te=>{D.setActiveSlideIndex(Te),D.setShowSlideSorter(false);},onMoveSlide:B.slideOps.handleMoveSlide,onDeleteSlides:B.slideOps.handleDeleteSlides,onDuplicateSlides:B.slideOps.handleDuplicateSlides,onToggleHideSlides:B.slideOps.handleToggleHideSlides,onCloseSorter:()=>D.setShowSlideSorter(false),reducedMotion:F,onToggleReducedMotion:N}),jsxRuntime.jsx(YG,{mode:G,slides:j,canvasSize:Y,templateElements:D.templateElements,presentation:$,onExitPresentation:()=>ue("edit"),isMobile:Ee})]});return jsxRuntime.jsx(QR.Provider,{value:S,children:jsxRuntime.jsx(bR,{theme:m,children:g?jsxRuntime.jsxs(MH,{config:g,canvasWidth:Y.width,canvasHeight:Y.height,children:[jsxRuntime.jsx(rpt,{slides:j,templateElementsBySlideId:ce,setSlides:D.setSlides,config:g,content:C}),jsxRuntime.jsx(opt,{activeSlideIndex:de,setActiveSlideIndex:D.setActiveSlideIndex,slideCount:j.length}),Ue]}):Ue})})});tge.displayName="PowerPointViewer";function npt(){let t=No();return t?jsxRuntime.jsx(IH,{status:t.status,connectedCount:t.connectedCount,onRetry:t.retry}):null}function rpt({slides:t,templateElementsBySlideId:e,setSlides:n,config:r,content:o}){let i=No(),s=Jm.useRef(o);s.current=o;let a=Jm.useCallback(()=>{let l=s.current;return l?l instanceof Uint8Array?l:new Uint8Array(l):null},[]);return uV({doc:i?.doc??null,slides:t,templateElementsBySlideId:e,setSlides:n,isConnected:i?.status==="connected",isSynced:i?.synced??true,config:r,getSourceBytes:a}),null}function opt({activeSlideIndex:t,setActiveSlideIndex:e,slideCount:n}){let r=No(),{followedClientId:o,followUser:i}=fV({collab:r,activeSlideIndex:t,setActiveSlideIndex:e,slideCount:n});return pV({collab:r,activeSlideIndex:t,setActiveSlideIndex:e,slideCount:n,paused:o!==null}),r?jsxRuntime.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-2 z-[1100] flex justify-center px-2",children:jsxRuntime.jsx("div",{className:"pointer-events-auto",children:jsxRuntime.jsx(RH,{presences:r.remoteUsers,followedClientId:o,onFollow:i})})}):null}/**
4870
4870
  * @fileoverview Save-side writer for slide-layout parts (`p:sldLayout`).
4871
4871
  *
4872
4872
  * Strategy mirrors {@link PptxHandlerRuntimeSaveSlideMaster}: layouts are