openlearn-next 0.7.6 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +66 -150
  2. package/dist/assets/{AcademicYearFilter-DUUGpDKt.js → AcademicYearFilter-Dm3no4Nb.js} +1 -1
  3. package/dist/assets/ActivityWorkspaceWidget-BXS1IamH.js +1 -0
  4. package/dist/assets/{AdminDirectoryView-DL9zZi-_.js → AdminDirectoryView-479SfYyD.js} +2 -2
  5. package/dist/assets/{AssessmentCenter-B2JzXBGe.js → AssessmentCenter-CJ-pchOQ.js} +1 -1
  6. package/dist/assets/{AssignmentFilePreview-Bk751Blz.js → AssignmentFilePreview-wjnrKjsp.js} +1 -1
  7. package/dist/assets/{BatchPickerModal-9ekXDUUj.js → BatchPickerModal-JvoD-1pF.js} +1 -1
  8. package/dist/assets/{ClassesView-PCt8I3MU.js → ClassesView-CB8q2kW0.js} +12 -12
  9. package/dist/assets/ClassroomCountdownWidget-BqzBpAvi.js +2 -0
  10. package/dist/assets/{CloudDriveModal-Mp59sr-C.js → CloudDriveModal-DHxOnL4m.js} +1 -1
  11. package/dist/assets/ComputerLabView-BEDe7WiU.js +1 -0
  12. package/dist/assets/CourseManagement-BjxQC6sq.js +1 -0
  13. package/dist/assets/{CourseWizardModal-B7-e8otR.js → CourseWizardModal-D3UPFtT_.js} +2 -2
  14. package/dist/assets/{CoursewareHubPanel-DLjH-UzF.js → CoursewareHubPanel-CqJqcZGs.js} +1 -1
  15. package/dist/assets/{Dashboard-D3LXLQNC.js → Dashboard-C3BaEHIG.js} +2 -2
  16. package/dist/assets/{ExportWeightModal-vd7XgaJ0.js → ExportWeightModal-iF0pVevG.js} +1 -1
  17. package/dist/assets/{HelpTour-BLuiS8rr.js → HelpTour-6ChRqWnB.js} +1 -1
  18. package/dist/assets/{HelpView-C4BHoNqR.js → HelpView-D3iYhzBz.js} +2 -2
  19. package/dist/assets/ImportLessonsModal-BOwj7ezj.js +1 -0
  20. package/dist/assets/{ImportModal-H5s5MyZY.js → ImportModal-DAHGdI9h.js} +1 -1
  21. package/dist/assets/{InteractiveCoursewareViewer-D9GzG28E.js → InteractiveCoursewareViewer-DX9xnk6j.js} +1 -1
  22. package/dist/assets/InteractiveWhiteboard-41mi9keH.js +65 -0
  23. package/dist/assets/LazyCourseware-DKyUHXaE.js +2 -0
  24. package/dist/assets/LazyWhiteboard-fXS2P44c.js +2 -0
  25. package/dist/assets/LessonEditorView-Dx-hOKtt.js +1 -0
  26. package/dist/assets/LiveClassroomView-m0hKdcVK.js +61 -0
  27. package/dist/assets/NotificationDetailModal-C2tg_IoJ.js +1 -0
  28. package/dist/assets/PluginView-BPRUpCjV.js +77 -0
  29. package/dist/assets/{ProcessLogsModal-_BwkmJVw.js → ProcessLogsModal-CULHzXp7.js} +1 -1
  30. package/dist/assets/{QuizGeneratorModal-DiItok6z.js → QuizGeneratorModal-CYxngpW9.js} +1 -1
  31. package/dist/assets/StudentAssignmentEvalPanel-Dfe4IOs5.js +1 -0
  32. package/dist/assets/{StudentAssignmentView-UK_7_MF3.js → StudentAssignmentView-IfRo3yJk.js} +1 -1
  33. package/dist/assets/StudentLessonView-Dw2uxBhq.js +1 -0
  34. package/dist/assets/StudentView-DVYUSrVU.js +2 -0
  35. package/dist/assets/{SystemResourceLibraryModal-dEdNKbk2.js → SystemResourceLibraryModal-BhbpfIBt.js} +1 -1
  36. package/dist/assets/TeacherView-CZjIejet.js +2 -0
  37. package/dist/assets/{TimetableView-AkReskNG.js → TimetableView-CupOIfEy.js} +1 -1
  38. package/dist/assets/{UTIF-4E-wdh3X.js → UTIF-BtQhea94.js} +1 -1
  39. package/dist/assets/index-BDFyco9S.css +1 -0
  40. package/dist/assets/index-BiHQqzdm.js +131 -0
  41. package/dist/assets/{index.es-WXdI0L-F.js → index.es-CijVATXs.js} +1 -1
  42. package/dist/assets/{pluginParsers-k90WUDrU.js → pluginParsers-C9W6GBVx.js} +1 -1
  43. package/dist/assets/{student-workspace-BDw1i4Vl.js → student-workspace-CsbA8Cs4.js} +1 -1
  44. package/dist/assets/{vendor-charts-SrpBsvM3.js → vendor-charts-skggaP9D.js} +1 -1
  45. package/dist/assets/{vendor-icons-hc6MjYFv.js → vendor-icons-DaYNfRAc.js} +2 -2
  46. package/dist/assets/{vendor-konva-Dne0Z-WC.js → vendor-konva-BOuJWFuE.js} +1 -1
  47. package/dist/assets/{vendor-pdf-By0fofA0.js → vendor-pdf-DVWGghIL.js} +3 -3
  48. package/dist/assets/{vendor-pptx-EjNUtdws.js → vendor-pptx-BqU7v5zS.js} +5 -5
  49. package/dist/assets/{vendor-react-Kv_JATwr.js → vendor-react-DHoBZpn2.js} +2 -2
  50. package/dist/assets/{vendor-utils-aM7aYvPP.js → vendor-utils-BxOuk3id.js} +1 -1
  51. package/dist/env-validation.cjs +7 -1
  52. package/dist/index.html +6 -6
  53. package/dist/server.cjs +343 -37
  54. package/migrations/044_students_gender.sql +8 -0
  55. package/migrations/README.md +1 -0
  56. package/migrations/schema-golden.json +3 -2
  57. package/package.json +2 -2
  58. package/dist/assets/ActivityWorkspaceWidget-0DUqiqFK.js +0 -1
  59. package/dist/assets/ClassroomCountdownWidget-HxelcHUp.js +0 -2
  60. package/dist/assets/ComputerLabView-FStILvFC.js +0 -1
  61. package/dist/assets/CourseManagement-BQw2idgZ.js +0 -1
  62. package/dist/assets/ImportLessonsModal-Y6uIIemO.js +0 -1
  63. package/dist/assets/InteractiveWhiteboard-DswIV-ES.js +0 -65
  64. package/dist/assets/LazyCourseware-BEoTTg5h.js +0 -2
  65. package/dist/assets/LazyWhiteboard-CMBBxnFX.js +0 -2
  66. package/dist/assets/LessonEditorView-BgJtG8Ks.js +0 -1
  67. package/dist/assets/LiveClassroomView-Czwt5WW-.js +0 -61
  68. package/dist/assets/NotificationDetailModal-D42vEs3S.js +0 -1
  69. package/dist/assets/PluginView-BcOWIjLu.js +0 -77
  70. package/dist/assets/StudentAssignmentEvalPanel-DHoZc3g0.js +0 -1
  71. package/dist/assets/StudentLessonView-C11Qkdi_.js +0 -1
  72. package/dist/assets/StudentView-j0hx3IOi.js +0 -2
  73. package/dist/assets/TeacherView-COZw2tFl.js +0 -2
  74. package/dist/assets/index-DN3E-Fmw.js +0 -131
  75. package/dist/assets/index-DPky2leG.css +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/UTIF-4E-wdh3X.js","assets/vendor-react-Kv_JATwr.js","assets/vendor-utils-aM7aYvPP.js","assets/GLTFLoader-CZJbo_y1.js","assets/three.module-iOYB3rD4.js","assets/OrbitControls-CQjN_uwS.js"])))=>i.map(i=>d[i]);
2
- import{c as NR,g as XIt,R as Tn,r as P,j as x,b as aO}from"./vendor-react-Kv_JATwr.js";import{_ as Ji,s as qIt,g as KIt}from"./vendor-pdf-By0fofA0.js";import{e as YIt,c as ZIt}from"./vendor-utils-aM7aYvPP.js";import{r as JIt}from"./vendor-charts-SrpBsvM3.js";var QIt=Object.create,Z9e=Object.defineProperty,e_t=Object.getOwnPropertyDescriptor,J9e=Object.getOwnPropertyNames,t_t=Object.getPrototypeOf,n_t=Object.prototype.hasOwnProperty,FR=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),r_t=(e,t)=>function(){try{return t||(0,e[J9e(e)[0]])((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Q9e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of J9e(t))!n_t.call(e,i)&&i!==n&&Z9e(e,i,{get:()=>t[i],enumerable:!(r=e_t(t,i))||r.enumerable});return e},i_t=(e,t,n)=>(Q9e(e,t,"default"),n),o_t=(e,t,n)=>(n=e!=null?QIt(t_t(e)):{},Q9e(Z9e(n,"default",{value:e,enumerable:!0}),e)),a_t=960,s_t=540,b1e=1.5,l_t="#ffffff";function eje(e,t,n){const r=w1e(e?.width,a_t),i=w1e(e?.height,s_t),o=Math.min(t/r,n/i);return{boxWidth:t,boxHeight:n,surfaceWidth:r,surfaceHeight:i,scale:o,backgroundColor:e?.backgroundColor||l_t,frameBorderWidth:o>0?b1e/o:b1e,frames:c_t(e?.placeholders)}}function c_t(e){const t=[];return e?.forEach((n,r)=>{const{x:i,y:o,width:a,height:s}=n;!j4(i)||!j4(o)||!j4(a)||!j4(s)||a<=0||s<=0||t.push({key:`${n.type}-${n.idx??r}`,type:n.type,left:i,top:o,width:a,height:s})}),t}function w1e(e,t){return j4(e)&&e>0?e:t}function j4(e){return typeof e=="number"&&Number.isFinite(e)}function qo(e){return!!e.isParagraphBreak||e.text===`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/UTIF-BtQhea94.js","assets/vendor-react-DHoBZpn2.js","assets/vendor-utils-BxOuk3id.js","assets/GLTFLoader-CZJbo_y1.js","assets/three.module-iOYB3rD4.js","assets/OrbitControls-CQjN_uwS.js"])))=>i.map(i=>d[i]);
2
+ import{c as NR,g as XIt,R as Tn,r as P,j as x,b as aO}from"./vendor-react-DHoBZpn2.js";import{_ as Ji,s as qIt,g as KIt}from"./vendor-pdf-DVWGghIL.js";import{e as YIt,c as ZIt}from"./vendor-utils-BxOuk3id.js";import{r as JIt}from"./vendor-charts-skggaP9D.js";var QIt=Object.create,Z9e=Object.defineProperty,e_t=Object.getOwnPropertyDescriptor,J9e=Object.getOwnPropertyNames,t_t=Object.getPrototypeOf,n_t=Object.prototype.hasOwnProperty,FR=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),r_t=(e,t)=>function(){try{return t||(0,e[J9e(e)[0]])((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Q9e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of J9e(t))!n_t.call(e,i)&&i!==n&&Z9e(e,i,{get:()=>t[i],enumerable:!(r=e_t(t,i))||r.enumerable});return e},i_t=(e,t,n)=>(Q9e(e,t,"default"),n),o_t=(e,t,n)=>(n=e!=null?QIt(t_t(e)):{},Q9e(Z9e(n,"default",{value:e,enumerable:!0}),e)),a_t=960,s_t=540,b1e=1.5,l_t="#ffffff";function eje(e,t,n){const r=w1e(e?.width,a_t),i=w1e(e?.height,s_t),o=Math.min(t/r,n/i);return{boxWidth:t,boxHeight:n,surfaceWidth:r,surfaceHeight:i,scale:o,backgroundColor:e?.backgroundColor||l_t,frameBorderWidth:o>0?b1e/o:b1e,frames:c_t(e?.placeholders)}}function c_t(e){const t=[];return e?.forEach((n,r)=>{const{x:i,y:o,width:a,height:s}=n;!j4(i)||!j4(o)||!j4(a)||!j4(s)||a<=0||s<=0||t.push({key:`${n.type}-${n.idx??r}`,type:n.type,left:i,top:o,width:a,height:s})}),t}function w1e(e,t){return j4(e)&&e>0?e:t}function j4(e){return typeof e=="number"&&Number.isFinite(e)}function qo(e){return!!e.isParagraphBreak||e.text===`
3
3
  `&&!e.isLineBreak}var u_t=new Set(["rawXml","rawTiming","inkPartRawXml","rawMediaReferenceXml"]);function d_t(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function HQ(e,t){if(Array.isArray(e)){const i=t.get(e);if(i!==void 0)return i;const o=new Array(e.length);t.set(e,o);for(let a=0;a<e.length;a++)o[a]=HQ(e[a],t);return o}if(!d_t(e))return e;const n=t.get(e);if(n!==void 0)return n;const r={};t.set(e,r);for(const i of Object.keys(e)){const o=e[i];r[i]=u_t.has(i)?o:HQ(o,t)}return r}function jI(e){return HQ(e,new WeakMap)}function tje(e){if(e)return jI(e)}function p_t(e){if(e)return jI(e)}function ay(e){return jI(e)}function dd(e){return jI(e)}function WB(e){const t={};return Object.entries(e).forEach(([n,r])=>{t[n]=r.map(ay)}),t}function zn(e){if(e)try{return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}catch(t){console.warn("Failed to clone XML object, returning undefined.",e,t);return}}var nje=new Set(["none","alignOff","begMarg","bendDist","begPad","bkPtFixedVal","b","bMarg","bOff","ctrX","ctrXOff","ctrY","ctrYOff","connDist","diam","endMarg","endPad","h","hArH","hOff","l","lMarg","lOff","r","rMarg","rOff","primFontSz","pyraAcctRatio","secFontSz","sibSp","secSibSp","sp","stemThick","t","tMarg","tOff",...Array.from({length:26},(e,t)=>`user${String.fromCharCode(65+t)}`),"w","wArH","wOff"]),rje=new Set(["self","ch","des"]),ije=new Set(["all","doc","node","norm","nonNorm","asst","nonAsst","parTrans","pres","sibTrans"]),h_t=new Set(["none","equ","gte","lte"]);function j3(e){if(e===void 0||e.trim()==="")return;if(e==="NaN")return Number.NaN;if(e==="INF")return Number.POSITIVE_INFINITY;if(e==="-INF")return Number.NEGATIVE_INFINITY;const t=Number(e);return Number.isNaN(t)?void 0:t}function f_t(e){return Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"INF":e===Number.NEGATIVE_INFINITY?"-INF":String(e)}function oje(e){return{for:e("for"),forName:e("forName"),pointType:e("ptType")}}function m_t(e,t){return{type:e("type")??"",...oje(e),referenceType:e("refType"),referenceFor:e("refFor"),referenceForName:e("refForName"),referencePointType:e("refPtType"),operator:e("op"),value:j3(e("val")),factor:j3(e("fact")),rawXml:t}}function g_t(e,t){return{type:e("type")??"",...oje(e),value:j3(e("val")),factor:j3(e("fact")),max:j3(e("max")),rawXml:t}}function S1e(e,t){const n=[];return nje.has(e.type)||n.push(`${t}.type is invalid`),e.for!==void 0&&!rje.has(e.for)&&n.push(`${t}.for is invalid`),e.pointType!==void 0&&!ije.has(e.pointType)&&n.push(`${t}.pointType is invalid`),n}function kse(e){const t=[];return e.constraints?.forEach((n,r)=>{const i=`constraints[${r}]`;t.push(...S1e(n,i)),n.referenceType!==void 0&&!nje.has(n.referenceType)&&t.push(`${i}.referenceType is invalid`),n.referenceFor!==void 0&&!rje.has(n.referenceFor)&&t.push(`${i}.referenceFor is invalid`),n.referencePointType!==void 0&&!ije.has(n.referencePointType)&&t.push(`${i}.referencePointType is invalid`),n.operator!==void 0&&!h_t.has(n.operator)&&t.push(`${i}.operator is invalid`)}),e.rules?.forEach((n,r)=>t.push(...S1e(n,`rules[${r}]`))),t}function GQ(e){return typeof e=="number"?f_t(e):e}function aje(e){return[["type",e.type],["for",e.for],["forName",e.forName],["ptType",e.pointType],["val",GQ(e.value)],["fact",GQ(e.factor)]]}function x_t(e){return[...aje(e),["refType",e.referenceType],["refFor",e.referenceFor],["refForName",e.referenceForName],["refPtType",e.referencePointType],["op",e.operator]]}function y_t(e){return[...aje(e),["max",GQ(e.max)]]}function XB(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function VQ(e,t,n){const r=XB(e,t,n),i=r?e[r]:void 0;return i&&typeof i=="object"&&!Array.isArray(i)?i:void 0}function WQ(e,t,n){const r=XB(e,t,n),i=r?e[r]:void 0;return Array.isArray(i)?i:i&&typeof i=="object"?[i]:[]}function v_t(e,t,n){const r=Object.keys(e).find(i=>i.startsWith("@_")&&n(i.replace(/^@_/u,""))===t);return r&&e[r]!==void 0?String(e[r]):void 0}function sje(e,t){return n=>v_t(e,n,t)}function XQ(e,t){return m_t(sje(e,t),zn(e))}function lje(e,t){return g_t(sje(e,t),zn(e))}function cje(e,t){const n=VQ(e,"constrLst",t),r=VQ(e,"ruleLst",t);return{constraints:n?WQ(n,"constr",t).map(i=>XQ(i,t)):void 0,rules:r?WQ(r,"rule",t).map(i=>lje(i,t)):void 0}}function b_t(e,t,n){for(const[r,i]of t){const o=Object.keys(e).find(a=>a.startsWith("@_")&&n(a.replace(/^@_/u,""))===r)??`@_${r}`;i===void 0?delete e[o]:e[o]=i}}function w_t(e){return e?.includes(":")?`${e.slice(0,e.indexOf(":"))}:`:"dgm:"}function uje(e,t,n){if(kse(t).length>0)return!1;for(const[r,i,o]of[["constrLst","constr",t.constraints],["ruleLst","rule",t.rules]]){if(o===void 0)continue;const a=XB(e,r,n)??`dgm:${r}`,s=VQ(e,r,n)??{},l=WQ(s,i,n),c=XB(s,i,n)??`${w_t(a)}${i}`;for(const u of Object.keys(s))n(u)===i&&delete s[u];s[c]=o.map((u,d)=>{const p=zn(l[d])??zn(u.rawXml)??{};return b_t(p,i==="constr"?x_t(u):y_t(u),n),p}),e[a]=s}return!0}function S_t(e,t,n){const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i[0]:i}function dje(e,t,n){const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i:i&&typeof i=="object"?[i]:[]}function $W(e){const t=String(e??"").trim();return t.length>0?t:void 0}function C_t(e,t){const n=S_t(e,"alg",t),r=n?$W(n["@_type"]):void 0;if(!n||!r)return;const i=Number(n["@_rev"]),o=Number.isInteger(i)&&i>=0&&i<=4294967295?i:void 0,a=dje(n,"param",t).map(s=>{const l=$W(s["@_type"]);return l?{type:l,value:$W(s["@_val"])}:void 0}).filter(s=>s!==void 0);return{type:r,...o===void 0?{}:{revision:o},...a.length===0?{}:{parameters:a}}}function T_t(e){const t=e.algorithm;if(!t)return[];const n=[];return t.type.trim()||n.push("algorithm.type is required"),t.revision!==void 0&&(!Number.isInteger(t.revision)||t.revision<0||t.revision>4294967295)&&n.push("algorithm.revision must be an unsigned 32-bit integer"),t.parameters?.forEach((r,i)=>{r.type.trim()||n.push(`algorithm.parameters[${i}].type is required`)}),n}function A_t(e,t){const n={};let r=!1;for(const[i,o]of Object.entries(e))!r&&!i.startsWith("@_")&&(n["dgm:alg"]=t,r=!0),n[i]=o;r||(n["dgm:alg"]=t);for(const i of Object.keys(e))delete e[i];Object.assign(e,n)}function E_t(e,t,n){const r=Object.keys(e).find(o=>n(o)==="alg");if(!t){r&&delete e[r];return}const i=r?e[r]:{};if(i["@_type"]=t.type,t.revision===void 0?delete i["@_rev"]:i["@_rev"]=String(t.revision),t.parameters!==void 0){const o=Object.keys(i).find(s=>n(s)==="param")??"dgm:param",a=dje(i,"param",n);i[o]=t.parameters.map((s,l)=>{const c=a[l]??{};return c["@_type"]=s.type,s.value===void 0?delete c["@_val"]:c["@_val"]=s.value,c})}r||A_t(e,i)}var pje=4294967295;function Qv(e){const t=(e??"").trim();return t.length>0?t:void 0}function qB(e){const t=Qv(e)?.split(/\s+/u);return t?.length?t:void 0}function k_t(e){const t=qB(e);if(!(!t||t.some(n=>!["0","1","true","false"].includes(n))))return t.map(n=>n==="1"||n==="true")}function HW(e,t=!1){const n=qB(e);if(!n)return;const r=n.map(Number);if(!r.some(i=>!Number.isInteger(i)||i<(t?0:-2147483648)||i>(t?pje:2147483647)))return r}function M_t(e){return t=>e.attrs[t]}function hje(e){return{name:Qv(e("name")),reference:Qv(e("ref")),axis:qB(e("axis")),pointTypes:qB(e("ptType")),hideLastTransition:k_t(e("hideLastTrans")),start:HW(e("st")),count:HW(e("cnt"),!0),step:HW(e("step"))}}function fje(e,t){const n=Qv(e("func")),r=Qv(e("op")),i=Qv(e("val"));return n&&r&&i?{...hje(e),function:n,argument:Qv(e("arg")),operator:r,value:i,rawXml:t}:void 0}function P_t(e){return fje(M_t(e),e)}function I_t(e){const t=[],n=(r,i)=>{for(const o of["start","step"])r[o]?.some(a=>!Number.isInteger(a)||a<-2147483648||a>2147483647)&&t.push(`${i}.${o} values must be signed 32-bit integers`);r.count?.some(o=>!Number.isInteger(o)||o<0||o>pje)&&t.push(`${i}.count values must be unsigned 32-bit integers`)};return e.forEach?.forEach((r,i)=>n(r,`forEach[${i}]`)),e.choose?.forEach((r,i)=>{r.when.length===0&&t.push(`choose[${i}].when requires at least one branch`),r.when.forEach((o,a)=>{const s=`choose[${i}].when[${a}]`;n(o,s);for(const l of["function","operator","value"])o[l].trim()||t.push(`${s}.${l} is required`)})}),t}function OR(e,t,n){const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i:i&&typeof i=="object"?[i]:[]}function mje(e){return t=>{const n=e[`@_${t}`];return n==null?void 0:String(n)}}function C1e(e){const t=String(e??"").trim();return t.length>0?t:void 0}function KB(e){return hje(mje(e))}function sT(e){return fje(mje(e),e)}function __t(e,t){const n=OR(e,"forEach",t).map(i=>({...KB(i),rawXml:i})),r=OR(e,"choose",t).map(i=>{const o=OR(i,"else",t)[0];return{name:C1e(i["@_name"]),when:OR(i,"if",t).map(sT).filter(a=>a!==void 0),otherwise:o?{name:C1e(o["@_name"]),rawXml:o}:void 0,rawXml:i}});return{...n.length?{forEach:n}:{},...r.length?{choose:r}:{}}}function cc(e,t,n){n===void 0?delete e[`@_${t}`]:e[`@_${t}`]=n}function gje(e,t){cc(e,"name",t.name),cc(e,"ref",t.reference),cc(e,"axis",t.axis?.join(" ")),cc(e,"ptType",t.pointTypes?.join(" ")),cc(e,"hideLastTrans",t.hideLastTransition?.map(n=>n?"1":"0").join(" ")),cc(e,"st",t.start?.join(" ")),cc(e,"cnt",t.count?.join(" ")),cc(e,"step",t.step?.join(" "))}function D_t(e){const t={...e.rawXml??{}};return gje(t,e),cc(t,"func",e.function),cc(t,"arg",e.argument),cc(t,"op",e.operator),cc(t,"val",e.value),t}function R_t(e,t){const n={...e.rawXml??{}};cc(n,"name",e.name);const r=Object.keys(n).find(o=>t(o)==="if")??"dgm:if";n[r]=e.when.map(D_t);const i=Object.keys(n).find(o=>t(o)==="else")??"dgm:else";if(e.otherwise===null)delete n[i];else if(e.otherwise){const o={...e.otherwise.rawXml??{}};cc(o,"name",e.otherwise.name),n[i]=o}return n}function T1e(e,t,n,r){if(n===void 0)return;const i=Object.keys(e).find(o=>r(o)===t)??`dgm:${t}`;n.length===0?delete e[i]:e[i]=n}function L_t(e,t,n){T1e(e,"forEach",t.forEach?.map(r=>{const i={...r.rawXml??{}};return gje(i,r),i}),n),T1e(e,"choose",t.choose?.map(r=>R_t(r,n)),n)}function N_t(e,t,n){const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i:i&&typeof i=="object"?[i]:[]}function F_t(e,t){const n=[],r=(i,o)=>{if(!(!i||typeof i!="object")){if(Array.isArray(i)){i.forEach(a=>r(a,o));return}for(const[a,s]of Object.entries(i)){if(a.startsWith("@_"))continue;const l=t(a);if(l!=="layoutNode"){if(l==="constrLst"){for(const c of Array.isArray(s)?s:[s])if(c&&typeof c=="object")for(const u of N_t(c,"constr",t))n.push({constr:u,guard:o});continue}if(l==="if"){for(const c of Array.isArray(s)?s:[s])if(c&&typeof c=="object"){const u=sT(c);r(c,u?[...o,u]:o)}continue}if(l==="else"){for(const c of Array.isArray(s)?s:[s])c&&typeof c=="object"&&r(c,o);continue}r(s,o)}}}};for(const[i,o]of Object.entries(e))!i.startsWith("@_")&&t(i)!=="extLst"&&r({[i]:o},[]);return n}function O_t(e,t){const n=F_t(e,t);return n.length>1?n:void 0}function xje(e,t,n){const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i:i&&typeof i=="object"?[i]:[]}function B_t(e,t){const n=[],r=i=>{if(!(!i||typeof i!="object")){if(Array.isArray(i)){i.forEach(r);return}for(const[o,a]of Object.entries(i)){if(o.startsWith("@_"))continue;const s=t(o);if(s!=="layoutNode"){if(s==="constrLst"){for(const l of Array.isArray(a)?a:[a])l&&typeof l=="object"&&n.push(...xje(l,"constr",t));continue}r(a)}}}};for(const[i,o]of Object.entries(e))!i.startsWith("@_")&&t(i)!=="extLst"&&r({[i]:o});return n}function j_t(e){return typeof e["@_axis"]=="string"&&e["@_axis"].trim().length>0}function yje(e,t){const n=[],r=(i,o)=>{if(!(!i||typeof i!="object")){if(Array.isArray(i)){i.forEach(a=>r(a,o));return}for(const[a,s]of Object.entries(i)){if(a.startsWith("@_"))continue;const l=t(a);if(l!=="layoutNode"){if(l==="presOf"){for(const c of Array.isArray(s)?s:[s])n.push({presOf:c&&typeof c=="object"?c:{},guard:o});continue}if(l==="if"){for(const c of Array.isArray(s)?s:[s])if(c&&typeof c=="object"){const u=sT(c);r(c,u?[...o,u]:o)}continue}if(l==="else"){for(const c of Array.isArray(s)?s:[s])c&&typeof c=="object"&&r(c,o);continue}r(s,o)}}}};for(const[i,o]of Object.entries(e))!i.startsWith("@_")&&t(i)!=="extLst"&&r({[i]:o},[]);return n}function U_t(e,t){const n=yje(e,t).map(r=>r.presOf);return n.find(j_t)??n[0]}function z_t(e,t){const n=yje(e,t);return n.length>1?n:void 0}function $_t(e,t){const n=[],r=(i,o)=>{if(!(!i||typeof i!="object")){if(Array.isArray(i)){i.forEach(a=>r(a,o));return}for(const[a,s]of Object.entries(i)){if(a.startsWith("@_"))continue;const l=t(a);if(l!=="layoutNode"){if(l==="ruleLst"){for(const c of Array.isArray(s)?s:[s])if(c&&typeof c=="object")for(const u of xje(c,"rule",t))n.push({rule:u,guard:o});continue}if(l==="if"){for(const c of Array.isArray(s)?s:[s])if(c&&typeof c=="object"){const u=sT(c);r(c,u?[...o,u]:o)}continue}if(l==="else"){for(const c of Array.isArray(s)?s:[s])c&&typeof c=="object"&&r(c,o);continue}r(s,o)}}}};for(const[i,o]of Object.entries(e))!i.startsWith("@_")&&t(i)!=="extLst"&&r({[i]:o},[]);return n}function H_t(e,t){const n=$_t(e,t);return n.length>1?n:void 0}function vje(e,t){const n=[];let r=0;const i=(o,a,s,l,c)=>{if(!(!o||typeof o!="object")){if(Array.isArray(o)){o.forEach(u=>i(u,a,s,l,c));return}for(const[u,d]of Object.entries(o)){if(u.startsWith("@_"))continue;const p=t(u);if(p==="layoutNode")for(const h of Array.isArray(d)?d:[d])h&&typeof h=="object"&&n.push({xml:h,origin:a,guard:s,guardOrigins:l,groups:c});else if(p==="forEach")for(const h of Array.isArray(d)?d:[d])h&&typeof h=="object"&&i(h,KB(h),s,l,c);else if(p==="choose")for(const h of Array.isArray(d)?d:[d]){if(!h||typeof h!="object")continue;const f=`choose${r++}`;let m=0;for(const[g,y]of Object.entries(h)){if(g.startsWith("@_"))continue;const v=t(g);if(v==="if"){for(const b of Array.isArray(y)?y:[y])if(b&&typeof b=="object"){const w=sT(b);i(b,a,w?[...s,w]:s,w?[...l,a]:l,[...c,{id:f,ordinal:m++,guard:w,origin:a}])}}else if(v==="else")for(const b of Array.isArray(y)?y:[y])b&&typeof b=="object"&&i(b,a,s,l,[...c,{id:f,ordinal:m++,origin:a}]);else i(y,a,s,l,c)}}else if(p==="if"){for(const h of Array.isArray(d)?d:[d])if(h&&typeof h=="object"){const f=sT(h);i(h,a,f?[...s,f]:s,f?[...l,a]:l,c)}}else if(p==="else")for(const h of Array.isArray(d)?d:[d])h&&typeof h=="object"&&i(h,a,s,l,c);else i(d,a,s,l,c)}}};for(const[o,a]of Object.entries(e))!o.startsWith("@_")&&t(o)!=="extLst"&&i({[o]:a},void 0,[],[],[]);return n}function bje(e,t,n){if(!e)return;const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i[0]:i}function G_t(e,t,n){if(!e)return[];const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i:i&&typeof i=="object"?[i]:[]}function V_t(e){const t=String(e["@_hideGeom"]??"").trim().toLowerCase();return t==="1"||t==="true"?!0:void 0}function W_t(e){if(!e)return!1;const t=String(e["@_lkTxEntry"]??"").trim().toLowerCase();return t==="1"||t==="true"}function X_t(e,t){const n=bje(e,"adjLst",t),r=G_t(n,"adj",t).map(i=>{const o=Number.parseInt(String(i["@_idx"]??""),10),a=Number.parseFloat(String(i["@_val"]??""));return Number.isInteger(o)&&Number.isFinite(a)?{index:o,value:a}:void 0}).filter(i=>!!i);return r.length>0?r:void 0}function q_t(e,t){const n=[],r=i=>{if(!(!i||typeof i!="object")){if(Array.isArray(i)){i.forEach(r);return}for(const[o,a]of Object.entries(i)){if(o.startsWith("@_"))continue;const s=t(o);if(s!=="layoutNode"){if(s==="shape"){for(const l of Array.isArray(a)?a:[a])n.push(l&&typeof l=="object"?l:{});continue}r(a)}}}};for(const[i,o]of Object.entries(e))!i.startsWith("@_")&&t(i)!=="extLst"&&r({[i]:o});return n}function K_t(e,t){const n=bje(e,"shape",t)??q_t(e,t)[0];if(!n)return;const r=String(n["@_type"]??"").trim()||void 0,i=V_t(n),o=X_t(n,t),a=W_t(n)||void 0;if(!(!r&&!i&&!o&&!a))return{...r?{presetGeometry:r}:{},...o?{adjustments:o}:{},...i?{hideGeometry:i}:{},...a?{lkTxEntry:a}:{}}}function Y_t(e,t,n){if(t===void 0)return;const r=Object.keys(e).find(a=>n(a)==="shape"),o=(r?e[r]:void 0)??{};if(t.presetGeometry!==void 0?o["@_type"]=t.presetGeometry:delete o["@_type"],t.hideGeometry?o["@_hideGeom"]="1":delete o["@_hideGeom"],t.lkTxEntry?o["@_lkTxEntry"]="1":delete o["@_lkTxEntry"],t.adjustments&&t.adjustments.length>0){const a=Object.keys(o).find(c=>n(c)==="adjLst")??"dgm:adjLst",s=o[a]??{},l=Object.keys(s).find(c=>n(c)==="adj")??"dgm:adj";s[l]=t.adjustments.map(c=>({"@_idx":String(c.index),"@_val":String(c.value)})),o[a]=s}e[r??"dgm:shape"]=o}function YB(e,t,n){if(!e)return;const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i[0]:i}function U3(e,t,n){if(!e)return[];const r=Object.keys(e).find(o=>n(o)===t),i=r?e[r]:void 0;return Array.isArray(i)?i:i&&typeof i=="object"?[i]:[]}function Fh(e){const t=String(e??"").trim();return t.length>0?t:void 0}function A1e(e){const t=Fh(e["@_val"]);return t?{value:t,language:Fh(e["@_lang"])}:void 0}function wje(e,t){const n=vje(e,t).map(u=>({...wje(u.xml,t),forEachOrigin:u.origin,chooseGuard:u.guard.length>0?u.guard:void 0,chooseGuardOrigins:u.guard.length>0?u.guardOrigins:void 0,chooseGroups:u.groups.length>0?u.groups:void 0})),r=Fh(e["@_chOrder"]),i=U_t(e,t),o=i?KB(i):void 0,a=B_t(e,t).map(u=>XQ(u,t)),s=z_t(e,t)?.map(u=>({guard:u.guard,presentationOf:KB(u.presOf)})),l=H_t(e,t)?.map(u=>({guard:u.guard,rule:lje(u.rule,t)})),c=O_t(e,t)?.map(u=>({guard:u.guard,constraint:XQ(u.constr,t)}));return{name:Fh(e["@_name"]),styleLabel:Fh(e["@_styleLbl"]),childOrder:r==="b"||r==="t"?r:void 0,moveWith:Fh(e["@_moveWith"]),algorithm:C_t(e,t),...__t(e,t),...cje(e,t),shape:K_t(e,t),presentationOf:o&&(o.axis?.length??0)>0?o:void 0,presentationOfCandidates:s,allConstraints:a.length>0?a:void 0,ruleCandidates:l,constraintCandidates:c,children:n.length>0?n:void 0}}function Mse(e,t){const n=YB(e,"layoutNode",t);if(!e||!n)return;const r=YB(e,"catLst",t),i=U3(r,"cat",t).map(o=>{const a=Fh(o["@_type"]),s=Number(o["@_pri"]);return a&&Number.isInteger(s)&&s>=0?{type:a,priority:s}:void 0}).filter(o=>!!o);return{uniqueId:Fh(e["@_uniqueId"]),minimumVersion:Fh(e["@_minVer"]),defaultStyle:Fh(e["@_defStyle"]),titles:U3(e,"title",t).map(A1e).filter(Boolean),descriptions:U3(e,"desc",t).map(A1e).filter(Boolean),categories:i.length>0?i:void 0,rootNode:wje(n,t),rawXml:JSON.parse(JSON.stringify(e))}}function Sje(e){const t=[],n=(r,i)=>{t.push(...kse(r).map(o=>`${i}.${o}`)),t.push(...T_t(r).map(o=>`${i}.${o}`)),t.push(...I_t(r).map(o=>`${i}.${o}`)),r.childOrder!==void 0&&r.childOrder!=="b"&&r.childOrder!=="t"&&t.push(`${i}.childOrder must be b or t`),r.children?.forEach((o,a)=>n(o,`${i}.children[${a}]`))};n(e.rootNode,"rootNode"),e.categories?.forEach((r,i)=>{r.type.trim()||t.push(`categories[${i}].type is required`),(!Number.isInteger(r.priority)||r.priority<0||r.priority>4294967295)&&t.push(`categories[${i}].priority must be an unsigned 32-bit integer`)});for(const[r,i]of[["titles",e.titles],["descriptions",e.descriptions]])i?.forEach((o,a)=>{o.value.trim()||t.push(`${r}[${a}].value is required`)});return t}function Ig(e,t,n){n===void 0?delete e[t]:e[t]=n}function Cje(e,t,n){Ig(e,"@_name",t.name),Ig(e,"@_styleLbl",t.styleLabel),Ig(e,"@_chOrder",t.childOrder),Ig(e,"@_moveWith",t.moveWith),E_t(e,t.algorithm,n),L_t(e,t,n),uje(e,t,n),Y_t(e,t.shape,n);const r=vje(e,n);t.children?.forEach((i,o)=>{r[o]&&Cje(r[o].xml,i,n)})}function E1e(e,t,n,r){if(n===void 0)return;const i=Object.keys(e).find(a=>r(a)===t)??`dgm:${t}`,o=U3(e,t,r);e[i]=n.map((a,s)=>{const l=o[s]??{};return l["@_val"]=a.value,Ig(l,"@_lang",a.language),l})}function Tje(e,t,n){if(Sje(t).length>0)return!1;const r=YB(e,"layoutNode",n);if(!r)return!1;if(Ig(e,"@_uniqueId",t.uniqueId),Ig(e,"@_minVer",t.minimumVersion),Ig(e,"@_defStyle",t.defaultStyle),E1e(e,"title",t.titles,n),E1e(e,"desc",t.descriptions,n),t.categories!==void 0){const i=YB(e,"catLst",n);if(i){const o=Object.keys(i).find(s=>n(s)==="cat")??"dgm:cat",a=U3(i,"cat",n);i[o]=t.categories.map((s,l)=>({...a[l]??{},"@_type":s.type,"@_pri":String(s.priority)}))}}return Cje(r,t.rootNode,n),!0}function go(e){return Math.min(1,Math.max(0,e))}function ZB(e,t="#111827"){if(!e||e==="transparent")return t;const n=e.startsWith("#")?e:`#${e}`;return/^#[0-9A-Fa-f]{6}$/.test(n)?n:t}function UI(e){const t=e.replace("#","");return/^[0-9a-fA-F]{6}$/.test(t)?{r:Number.parseInt(t.slice(0,2),16),g:Number.parseInt(t.slice(2,4),16),b:Number.parseInt(t.slice(4,6),16)}:null}function Z_t(e,t){if(t===void 0)return e;const n=UI(e);return n?`rgba(${n.r}, ${n.g}, ${n.b}, ${go(t)})`:e}function J_t(e,t){if(t===void 0)return e;const n=go(t);if(n>=1)return e;const r=UI(e);if(!r)return e;const i=o=>yp(o*n+255*(1-n));return`#${i(r.r)}${i(r.g)}${i(r.b)}`}function Q_t(e){return e.endsWith("%")?100:1e5}function _d(e){const t=String(e??"").trim(),n=Q_t(t),r=Number.parseFloat(n===100?t.slice(0,-1):t);if(Number.isFinite(r))return r/n}function a1(e){const t=_d(e);return t===void 0?void 0:go(t)}function yC(e){const t=Math.min(1,Math.max(0,e)),n=t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055;return Math.min(255,Math.max(0,Math.round(n*255)))}function yp(e){return Math.min(255,Math.max(0,Math.round(e))).toString(16).padStart(2,"0").toUpperCase()}function JB(e,t,n){const r=e/255,i=t/255,o=n/255,a=Math.max(r,i,o),s=Math.min(r,i,o),l=a-s,c=(a+s)/2;let u=0;l!==0&&(u=l/(1-Math.abs(2*c-1)));let d=0;return l!==0&&(a===r?d=60*((i-o)/l%6):a===i?d=60*((o-r)/l+2):d=60*((r-i)/l+4)),d<0&&(d+=360),{h:d,s:go(u),l:go(c)}}function lT(e,t,n,r=Math.round,i){const o=i?.clampSaturation===!1?t:go(t),a=go(n),s=(e%360+360)%360,l=(1-Math.abs(2*a-1))*o,c=l*(1-Math.abs(s/60%2-1)),u=a-l/2;let d=0,p=0,h=0;return s<60?(d=l,p=c,h=0):s<120?(d=c,p=l,h=0):s<180?(d=0,p=l,h=c):s<240?(d=0,p=c,h=l):s<300?(d=c,p=0,h=l):(d=l,p=0,h=c),{r:r((d+u)*255),g:r((p+u)*255),b:r((h+u)*255)}}function io(e){return _d(e)}function iM(e){const t=Number.parseFloat(String(e??"").trim());if(Number.isFinite(t))return t/6e4}function lS(e){const t=go(e/255);return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function cS(e){const t=go(e);return 255*(t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055)}function Zc(e,t){const n=UI(e);if(!n)return e;let r=n.r,i=n.g,o=n.b;const a=w=>t[w]?.["@_val"];if(t["a:gamma"]!==void 0){const w=eDt(r,i,o);r=w.r,i=w.g,o=w.b}if(t["a:invGamma"]!==void 0){const w=tDt(r,i,o);r=w.r,i=w.g,o=w.b}if(t["a:comp"]!==void 0){const w=JB(r,i,o);w.h=(w.h+180)%360;const S=lT(w.h,w.s,w.l);r=S.r,i=S.g,o=S.b}if(t["a:inv"]!==void 0&&(r=255-r,i=255-i,o=255-o),t["a:gray"]!==void 0){const w=Math.round(.299*r+.587*i+.114*o);r=w,i=w,o=w}const s=a1(a("a:shade"));s!==void 0&&(r=cS(lS(r)*s),i=cS(lS(i)*s),o=cS(lS(o)*s));const l=a1(a("a:tint"));if(l!==void 0&&(r=cS(1-(1-lS(r))*l),i=cS(1-(1-lS(i))*l),o=cS(1-(1-lS(o))*l)),["a:hue","a:hueMod","a:hueOff","a:sat","a:satMod","a:satOff","a:lum","a:lumMod","a:lumOff"].some(w=>t[w]!==void 0)){const w=JB(r,i,o),S=iM(a("a:hue"));S!==void 0&&(w.h=(S%360+360)%360);const T=io(a("a:hueMod"));T!==void 0&&(w.h=(w.h*T%360+360)%360);const A=iM(a("a:hueOff"));A!==void 0&&(w.h=((w.h+A)%360+360)%360);const E=io(a("a:sat"));E!==void 0&&(w.s=go(E));const k=io(a("a:satMod"));k!==void 0&&(w.s=go(w.s*k));const M=io(a("a:satOff"));M!==void 0&&(w.s=go(w.s+M));const I=io(a("a:lum"));I!==void 0&&(w.l=go(I));const D=io(a("a:lumMod"));D!==void 0&&(w.l=go(w.l*D));const R=io(a("a:lumOff"));R!==void 0&&(w.l=go(w.l+R));const _=lT(w.h,w.s,w.l);r=_.r,i=_.g,o=_.b}const d=io(a("a:red"));d!==void 0&&(r=Math.round(go(d)*255));const p=io(a("a:redMod"));p!==void 0&&(r=Math.min(255,Math.max(0,Math.round(r*p))));const h=io(a("a:redOff"));h!==void 0&&(r=Math.min(255,Math.max(0,Math.round(r+255*h))));const f=io(a("a:green"));f!==void 0&&(i=Math.round(go(f)*255));const m=io(a("a:greenMod"));m!==void 0&&(i=Math.min(255,Math.max(0,Math.round(i*m))));const g=io(a("a:greenOff"));g!==void 0&&(i=Math.min(255,Math.max(0,Math.round(i+255*g))));const y=io(a("a:blue"));y!==void 0&&(o=Math.round(go(y)*255));const v=io(a("a:blueMod"));v!==void 0&&(o=Math.min(255,Math.max(0,Math.round(o*v))));const b=io(a("a:blueOff"));return b!==void 0&&(o=Math.min(255,Math.max(0,Math.round(o+255*b)))),`#${yp(r)}${yp(i)}${yp(o)}`}function GW(e){const t=Math.min(1,Math.max(0,e/255)),n=t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055;return Math.min(255,Math.max(0,Math.round(n*255)))}function VW(e){const t=Math.min(1,Math.max(0,e/255)),n=t<=.04045?t/12.92:((t+.055)/1.055)**2.4;return Math.min(255,Math.max(0,Math.round(n*255)))}function eDt(e,t,n){return{r:GW(e),g:GW(t),b:GW(n)}}function tDt(e,t,n){return{r:VW(e),g:VW(t),b:VW(n)}}var nDt=new Set(["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink","bg1","tx1","bg2","tx2","phClr"]);function Aje(e){return typeof e=="string"&&nDt.has(e)}var rDt={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2"};function hk(e){return String(Math.round(e*1e5))}function XU(e){const t={"@_val":e.scheme};return e.tint!==void 0&&(t["a:tint"]={"@_val":hk(e.tint)}),e.shade!==void 0&&(t["a:shade"]={"@_val":hk(e.shade)}),e.lumMod!==void 0&&(t["a:lumMod"]={"@_val":hk(e.lumMod)}),e.lumOff!==void 0&&(t["a:lumOff"]={"@_val":hk(e.lumOff)}),e.alpha!==void 0&&(t["a:alpha"]={"@_val":hk(e.alpha)}),t}function qQ(e){return{"a:schemeClr":XU(e)}}function Pse(e,t){return e.alpha===void 0&&typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<1?qQ({...e,alpha:Math.max(0,Math.min(1,t))}):qQ(e)}function fk(e,t){const n=e[t]?.["@_val"];if(n==null||n==="")return;const r=String(n).trim(),i=Number.parseFloat(r);if(Number.isFinite(i))return r.endsWith("%")?i/100:i/1e5}var iDt=new Set(["@_val","a:tint","a:shade","a:lumMod","a:lumOff","a:alpha"]);function zI(e){if(!e)return;const t=e["@_val"];if(!Aje(t)||Object.keys(e).some(l=>!iDt.has(l)))return;const n={scheme:t},r=fk(e,"a:tint"),i=fk(e,"a:shade"),o=fk(e,"a:lumMod"),a=fk(e,"a:lumOff"),s=fk(e,"a:alpha");return r!==void 0&&(n.tint=r),i!==void 0&&(n.shade=i),o!==void 0&&(n.lumMod=o),a!==void 0&&(n.lumOff=a),s!==void 0&&(n.alpha=s),n}function nf(e){return zI(e?.["a:schemeClr"])}function Bp(e,t){if(!t)return;const n=t[e.scheme]??t[rDt[e.scheme]??""];if(!n)return;const r=XU(e);return delete r["a:alpha"],ZB(Zc(ZB(n),r)).toLowerCase()}function BR(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var WW={exports:{}};/*!
4
4
 
5
5
  JSZip v3.10.2 - A JavaScript class for generating and reading zip files
@@ -343,12 +343,12 @@ ${t}`:t,this.syncSegmentsFromNotes(),this}Add(e){return this.add(e)}set(e){const
343
343
  <Relationships xmlns="${wCn}"><Relationship Id="rId1" Type="${SCn}/${e}" Target="${t}"/></Relationships>`}function vet(e){const t=e.replace(/^?<\?xml[^>]*\?>\s*/u,"");return`${P_}\r
344
344
  ${t}`}async function bet(e){const t=new La;for(const[n,r]of e)t.file(n,r);return t.generateAsync({type:"uint8array",compression:"DEFLATE"})}function TCn(e){const t="drs/slideMasters/slideMaster1.xml";return bet([["[Content_Types].xml",yet([[t,"presentationml.slideMaster+xml"]])],["_rels/.rels",Ene("slideMaster",t)],[t,vet(e)]])}function ACn(e){const t="theme/theme/themeManager.xml";return bet([["[Content_Types].xml",yet([[t,"themeManager+xml"],["theme/theme/theme1.xml","theme+xml"]])],["_rels/.rels",Ene("officeDocument",t)],[t,`${P_}\r
345
345
  <a:themeManager xmlns:a="${xet}"/>`],["theme/theme/_rels/themeManager.xml.rels",Ene("theme","theme1.xml")],["theme/theme/theme1.xml",vet(e)]])}function ECn(e){const t=e.replace(/\s*xmlns(?::\w+)?="[^"]*"/gu,"").trim();return new TextEncoder().encode(`${P_}\r
346
- <a:clrMap xmlns:a="${xet}" ${t}/>`)}async function BEe(e){return{placeholders:e.placeholders,schemeColors:e.schemeColors,themeFonts:e.themeFonts,oartTextStyles:e.txStylesXml?await TCn(e.txStylesXml):void 0,theme:e.themeXml?await ACn(e.themeXml):void 0,colorMapping:e.clrMapAttributes?ECn(e.clrMapAttributes):void 0}}async function kCn(e){const t=await La.loadAsync(e),n=await get(t),r=[...new Set(n)];if(r.length===0)return{masterPaths:[],masters:[await BEe(await OEe(t))],slideMasterIndex:[]};const i=await Promise.all(r.map(async o=>BEe(await OEe(t,o))));return{masterPaths:r,masters:i,slideMasterIndex:n.map(o=>r.indexOf(o))}}var MCn=["@napi-rs","canvas"].join("/"),jEe;function UEe(e){const t=e;return typeof t?.createCanvas=="function"&&typeof t.loadImage=="function"}function PCn(){return jEe??=(async()=>{if(globalThis.process?.versions?.node)try{const t=await import(MCn),n=t;return UEe(t)?t:UEe(n.default)?n.default:void 0}catch{return}})(),jEe}async function ICn(e,t){const n=await PCn();if(n)try{const r=await n.loadImage(e),{width:i,height:o}=t(r.width,r.height),a=n.createCanvas(i,o);return a.getContext("2d").drawImage(r,0,0,i,o),new Uint8Array(a.toBuffer("image/png"))}catch{return}}var _Cn=2048;function DCn(){return typeof document<"u"&&typeof Image<"u"&&typeof URL<"u"&&typeof URL.createObjectURL=="function"}function wet(e,t,n,r){const i=e||n,o=t||r,a=Math.min(2,_Cn/Math.max(i,o,1));return{width:Math.max(1,Math.round(i*a)),height:Math.max(1,Math.round(o*a))}}function RCn(e){return new Promise(t=>{const n=new Image;n.onload=()=>t(n),n.onerror=()=>t(void 0),n.src=e})}async function LCn(e,t,n){const r=URL.createObjectURL(new Blob([e.slice()],{type:"image/svg+xml"}));try{const i=await RCn(r);if(!i)return;const o=wet(i.naturalWidth,i.naturalHeight,t,n),a=document.createElement("canvas");a.width=o.width,a.height=o.height;const s=a.getContext("2d");if(!s)return;s.drawImage(i,0,0,a.width,a.height);const l=await new Promise(c=>{a.toBlob(c,"image/png")});return l?new Uint8Array(await l.arrayBuffer()):void 0}catch{return}finally{URL.revokeObjectURL(r)}}async function Cet(e,t,n){const r=DCn()?await LCn(e,t,n):await ICn(e,(i,o)=>wet(i,o,t,n));return r?{extension:"png",bytes:r}:void 0}async function NCn(e){try{const t=await Ji(()=>import("./UTIF-4E-wdh3X.js").then(s=>s.U),__vite__mapDeps([0,1,2])),n="default"in t?t.default:t,r=e.slice().buffer,i=n.decode(r)[0];if(!i)return;n.decodeImage(r,i);const o=Number(i.width),a=Number(i.height);return o>0&&a>0?{extension:"png",bytes:kle(o,a,new Uint8Array(n.toRGBA8(i)))}:void 0}catch{return}}async function FCn(e){if(!(!e?.startsWith("blob:")||typeof fetch>"u"))try{return new Uint8Array(await(await fetch(e)).arrayBuffer())}catch{return}}function OCn(e){const t=/\.([^./\\]+)$/u.exec(e)?.[1]?.toLowerCase();return t==="jpg"?"jpeg":t==="tif"?"tiff":t}async function Bq(e,t){const n=Jde(e);return n==="tiff"?NCn(e):n==="svg"?Cet(e,t.width||1,t.height||1):Qde(e)}async function BCn(e,t,n){const r=TQe(t.inline),i=r?Jde(r):void 0,o=t.partPath?OCn(t.partPath):void 0;if(r&&(!o||o===i))return i==="tiff"||i==="svg"?Bq(r,e):void 0;const a=t.partPath?await n(t.partPath):void 0,s=a?await Bq(a,e):void 0;if(s)return s;if(r&&Qde(r))return;const l=await FCn(t.inline),c=l?await Bq(l,e):void 0;if(c||!t.svgPath)return c;const u=await n(t.svgPath);return u?Cet(u,e.width||1,e.height||1):void 0}async function jCn(e,t){const n=[],r=o=>{for(const a of o){const s=CQe(a);s?n.push([a,s]):a.type==="group"&&r(a.children)}};for(const o of e)r(o.elements);const i=new Map;return await Promise.all(n.map(async([o,a])=>{const s=await BCn(o,a,t);s&&i.set(o,s)})),i}var UCn=e=>e.replace(/^.*:/u,"");function uf(e,t){return Object.keys(e).find(n=>UCn(n)===t)}function NC(e,t,n){const r=uf(e,t);if(r)return r;const i=Object.keys(e).find(o=>!o.startsWith("@_")&&o.includes(":"));return i?`${i.slice(0,i.indexOf(":"))}:${t}`:n}function Li(e,t){const n=uf(e,t),r=n?e[n]:void 0;return r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}function k1(e){const t=Number(e);return Number.isSafeInteger(t)?t:void 0}function zEe(e){if(!e)return;const t=k1(e["@_n"]),n=k1(e["@_d"]);return t!==void 0&&n!==void 0&&n!==0?{n:t,d:n}:void 0}function kne(e){const t=Li(e,"cViewPr")??e,n=Li(t,"origin"),r=k1(n?.["@_x"]),i=k1(n?.["@_y"]),o=Li(t,"scale"),a=zEe(o?Li(o,"sx"):void 0),s=zEe(o?Li(o,"sy"):void 0),l=t["@_varScale"];return{origin:r!==void 0&&i!==void 0?{x:r,y:i}:void 0,scale:a?{...a,...s&&(s.n!==a.n||s.d!==a.d)?{sy:s}:{}}:void 0,variableScale:l===void 0?void 0:String(l)!=="0"}}function zCn(e){const t=Li(e,"guideLst");if(!t)return;const n=uf(t,"guide"),r=n?t[n]:void 0;return(Array.isArray(r)?r:r?[r]:[]).map(o=>{const a=o,s=a["@_orient"];return{orientation:s==="horz"||s==="vert"?s:void 0,position:k1(a["@_pos"])}})}function jq(e){return{...kne(e),snapToGrid:Uq(e["@_snapToGrid"]),snapToObjects:Uq(e["@_snapToObjects"]),showGuides:Uq(e["@_showGuides"]),guides:zCn(e)}}function Uq(e){return e===void 0?void 0:e!=="0"&&e!==!1}function $Cn(e){const t=Li(e,"gridSpacing"),n=k1(t?.["@_cx"]),r=k1(t?.["@_cy"]);return n!==void 0&&n>0&&r!==void 0&&r>0?{cx:n,cy:r}:void 0}function $Ee(e,t){if(!Number.isSafeInteger(e.n)||!Number.isSafeInteger(e.d)||e.d===0)throw new RangeError(`${t} must contain safe integer n and non-zero d values`)}function HCn(e,t){const n={...t};if(e.variableScale!==void 0&&(n["@_varScale"]=e.variableScale?"1":"0"),e.scale){$Ee(e.scale,"scale"),e.scale.sy&&$Ee(e.scale.sy,"scale.sy");const r=NC(n,"scale","p:scale"),i={...n[r]};i[uf(i,"sx")??"a:sx"]=HEe(e.scale),i[uf(i,"sy")??"a:sy"]=HEe(e.scale.sy??e.scale),n[r]=i}if(e.origin){if(!Number.isSafeInteger(e.origin.x)||!Number.isSafeInteger(e.origin.y))throw new RangeError("origin coordinates must be safe integers");const r=NC(n,"origin","p:origin");n[r]={...n[r]??{},"@_x":`${e.origin.x}`,"@_y":`${e.origin.y}`}}return n}var HEe=e=>({"@_n":`${e.n}`,"@_d":`${e.d}`});function Tet(e,t={}){const n={...t};zq(n,"snapToGrid",e.snapToGrid),zq(n,"snapToObjects",e.snapToObjects),zq(n,"showGuides",e.showGuides);const r=NC(n,"cViewPr","p:cViewPr");if(n[r]=HCn(e,Li(n,"cViewPr")??{}),e.guides){const i=NC(n,"guideLst","p:guideLst"),o={...n[i]??{}};o[NC(o,"guide","p:guide")]=e.guides.map(GCn),n[i]=o}return n}function zq(e,t,n){n!==void 0&&(e[`@_${t}`]=n?"1":"0")}function GCn(e){if(e.position!==void 0&&!Number.isSafeInteger(e.position))throw new RangeError("guide position must be a safe integer");return{...e.orientation?{"@_orient":e.orientation}:{},...e.position!==void 0?{"@_pos":`${e.position}`}:{}}}function VCn(e,t){if(!t)return;if(!Number.isSafeInteger(t.cx)||t.cx<=0||!Number.isSafeInteger(t.cy)||t.cy<=0)throw new RangeError("grid spacing cx and cy must be positive safe integers");const n=NC(e,"gridSpacing","p:gridSpacing");e[n]={...e[n]??{},"@_cx":`${t.cx}`,"@_cy":`${t.cy}`}}function WCn(e){const t={},n=String(e["@_lastView"]||"").trim();n.length>0&&(t.lastView=n);const r=e["@_showComments"];r!==void 0&&(t.showComments=r!=="0");const i=Li(e,"normalViewPr");i&&(t.normalViewPr=XCn(i));const o=Li(e,"slideViewPr");if(o){const u=Li(o,"cSldViewPr");u&&(t.slideViewPr=jq(u))}const a=Li(e,"outlineViewPr");if(a){const u=Li(a,"cSldViewPr");u&&(t.outlineViewPr=jq(u))}const s=Li(e,"notesTextViewPr");if(s){const u=Li(s,"cViewPr")??Li(s,"cSldViewPr");u&&(t.notesTextViewPr=kne(u))}const l=Li(e,"sorterViewPr");if(l){const u=Li(l,"cViewPr")??Li(l,"cSldViewPr");t.sorterViewPr={scale:u?kne(u).scale:void 0}}const c=Li(e,"notesViewPr");if(c){const u=Li(c,"cSldViewPr");u&&(t.notesViewPr=jq(u))}return t.gridSpacing=$Cn(e),t.rawXml=e,t}function XCn(e){const t={},n=e["@_showOutlineIcons"];n!==void 0&&(t.showOutlineIcons=n!=="0");const r=e["@_snapVertSplitter"];r!==void 0&&(t.snapVertSplitter=r==="1");const i=String(e["@_vertBarState"]||"").trim();i.length>0&&(t.vertBarState=i);const o=String(e["@_horzBarState"]||"").trim();o.length>0&&(t.horzBarState=o);const a=e["@_preferSingleView"];a!==void 0&&(t.preferSingleView=a==="1");const s=Li(e,"restoredLeft");s&&(t.restoredLeft=GEe(s));const l=Li(e,"restoredTop");return l&&(t.restoredTop=GEe(l)),t}function GEe(e){const t=parseInt(String(e["@_sz"]??"0"),10),n=e["@_autoAdjust"];return{sz:Number.isFinite(t)?t:0,autoAdjust:n!==void 0?n!=="0":void 0}}function qCn(e){const t=e.rawXml?{...e.rawXml}:{"@_xmlns:p":"http://schemas.openxmlformats.org/presentationml/2006/main","@_xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","@_xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"};if(e.lastView&&(t["@_lastView"]=e.lastView),e.showComments!==void 0&&(t["@_showComments"]=e.showComments?"1":"0"),e.normalViewPr){const n=uf(t,"normalViewPr")??"p:normalViewPr";t[n]=KCn(e.normalViewPr,Li(t,"normalViewPr"))}return e.slideViewPr&&$q(t,"slideViewPr",e.slideViewPr),e.outlineViewPr&&$q(t,"outlineViewPr",e.outlineViewPr),e.notesTextViewPr&&WEe(t,"notesTextViewPr",e.notesTextViewPr),e.sorterViewPr?.scale&&WEe(t,"sorterViewPr",e.sorterViewPr),e.notesViewPr&&$q(t,"notesViewPr",e.notesViewPr),VCn(t,e.gridSpacing),{"p:viewPr":t}}function KCn(e,t){const n={...t};return e.showOutlineIcons!==void 0&&(n["@_showOutlineIcons"]=e.showOutlineIcons?"1":"0"),e.snapVertSplitter!==void 0&&(n["@_snapVertSplitter"]=e.snapVertSplitter?"1":"0"),e.vertBarState&&(n["@_vertBarState"]=e.vertBarState),e.horzBarState&&(n["@_horzBarState"]=e.horzBarState),e.preferSingleView!==void 0&&(n["@_preferSingleView"]=e.preferSingleView?"1":"0"),e.restoredLeft&&(n["p:restoredLeft"]=VEe(e.restoredLeft)),e.restoredTop&&(n["p:restoredTop"]=VEe(e.restoredTop)),n}function VEe(e){const t={"@_sz":String(e.sz)};return e.autoAdjust!==void 0&&(t["@_autoAdjust"]=e.autoAdjust?"1":"0"),t}function $q(e,t,n){const r=uf(e,t)??`p:${t}`,i={...e[r]??{}},o=uf(i,"cSldViewPr")??"p:cSldViewPr";i[o]=Tet(n,Li(i,"cSldViewPr")),e[r]=i}function WEe(e,t,n){const r=uf(e,t)??`p:${t}`,i={...e[r]??{}},o=uf(i,"cViewPr")??"p:cViewPr",a=Tet(n,{"p:cViewPr":Li(i,"cViewPr")??{}});i[o]=Li(a,"cViewPr"),e[r]=i}var YCn=new Set(["cycle","withinLinear","acrossLinear"]),XEe=new Set(["scrgbClr","srgbClr","hslClr","sysClr","schemeClr","prstClr"]);function Mne(e){return e.replace(/^.*:/u,"")}function ZCn(e){const t=Object.keys(e).find(r=>Mne(r)==="colorStyle"),n=t?e[t]:e;return n&&typeof n=="object"&&!Array.isArray(n)?n:e}function JCn(e){const t=e.replace(/^#/u,"").toUpperCase();if(!/^[0-9A-F]{6}$/u.test(t))throw new RangeError(`chart palette colour must be six-digit RGB: ${e}`);return t}function Aet(e,t,n){if(!t.length)throw new RangeError("chart colorPalette must not be empty");if(!YCn.has(n))throw new RangeError("chart colorMethod must be cycle, withinLinear, or acrossLinear");const r=ZCn(e);r["@_meth"]=n;const i=Object.entries(r);for(const a of Object.keys(r))!a.startsWith("@_")&&XEe.has(Mne(a))&&delete r[a];const o=Object.entries(r);for(const a of Object.keys(r))delete r[a];for(const[a,s]of o.filter(([l])=>l.startsWith("@_")))r[a]=s;r["a:srgbClr"]=t.map(a=>({"@_val":JCn(a)}));for(const[a,s]of i)!a.startsWith("@_")&&!XEe.has(Mne(a))&&(r[a]=s)}function QCn(e,t){const n={"cs:colorStyle":{"@_xmlns:cs":"http://schemas.microsoft.com/office/drawing/2012/chartStyle","@_xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","@_meth":t,"@_id":"10"}};return Aet(n,e,t),n}function Pne(e){return{"@_pos":e==="t"||e==="b"||e==="l"?e:"r","@_align":"ctr","@_overlay":"0"}}var eTn="http://schemas.microsoft.com/office/drawing/2014/chartex",tTn="http://schemas.openxmlformats.org/drawingml/2006/main",nTn="http://schemas.openxmlformats.org/officeDocument/2006/relationships",rTn="http://schemas.openxmlformats.org/drawingml/2006/chart";function iTn(e){return e.map((t,n)=>({"@_idx":String(n),"#text":String(t)}))}function Hq(e,t){return e.map((n,r)=>({"@_idx":String(t?.[r]??r),"#text":String(n)}))}function Eet(e){const t=e.color?.replace(/^#/u,"").toUpperCase();return t?{"a:solidFill":{"a:srgbClr":{"@_val":t}}}:void 0}function oTn(e){const t=e.histogramOptions,n={};return t?.intervalClosed&&(n["@_intervalClosed"]=t.intervalClosed),t?.underflow!==void 0&&(n["@_underflow"]=String(t.underflow)),t?.overflow!==void 0&&(n["@_overflow"]=String(t.overflow)),t?.binSize!==void 0?n["cx:binSize"]=String(t.binSize):t?.binCount!==void 0&&(n["cx:binCount"]=String(t.binCount)),n}function p5(e,t,n){const r=e.chartType==="regionMap"?t.regionMapOptions:void 0,i=(e.chartType==="sunburst"||e.chartType==="treemap")&&e.categoryLevels?.length?e.categoryLevels:[e.categories],o=[{"@_type":"cat","cx:lvl":i.map(a=>({"@_ptCount":String(a.length),"cx:pt":e.chartType==="regionMap"&&a===i[0]?Hq(a,r?.categorySourceIndices):iTn(a)}))}];return e.chartType==="regionMap"&&t.regionMapOptions?.entityIds?.length&&o.push({"@_type":"entityId","cx:lvl":{"@_ptCount":String(t.regionMapOptions.entityIds.length),"cx:pt":Hq(t.regionMapOptions.entityIds,t.regionMapOptions.entityIdSourceIndices)}}),{"@_id":String(n),"cx:strDim":o,"cx:numDim":{"@_type":e.chartType==="treemap"||e.chartType==="sunburst"?"size":e.chartType==="regionMap"?"colorVal":"val","cx:lvl":{"@_ptCount":String(t.values.length),"@_formatCode":"General","cx:pt":Hq(t.values,r?.valueSourceIndices)}}}}function ket(e,t){return e.chartType==="waterfall"?"waterfall":e.chartType==="treemap"?"treemap":e.chartType==="sunburst"?"sunburst":e.chartType==="boxWhisker"?"boxWhisker":e.chartType==="histogram"?t.histogramOptions?.layout==="pareto"?"paretoLine":"clusteredColumn":e.chartType==="regionMap"?"regionMap":"funnel"}function aTn(e){return Eet(e)}function Met(){return{"cx:visibility":{"@_categoryName":"1","@_value":"1","@_seriesName":"0"}}}function Pet(e,t,n){const r={"@_layoutId":ket(e,t),"cx:tx":{"cx:txData":{"cx:v":t.name}}},i=Eet(t);if(i&&(r["cx:spPr"]=i),e.style?.hasDataLabels&&(r["cx:dataLabels"]=Met()),r["cx:dataId"]={"@_val":String(n)},e.chartType==="boxWhisker"&&t.boxWhiskerOptions){const o=t.boxWhiskerOptions,a={};o.showMeanLine!==void 0&&(a["@_meanLine"]=o.showMeanLine?"1":"0"),o.showMeanMarker!==void 0&&(a["@_meanMarker"]=o.showMeanMarker?"1":"0"),o.showInnerPoints!==void 0&&(a["@_nonoutliers"]=o.showInnerPoints?"1":"0"),o.showOutlierPoints!==void 0&&(a["@_outliers"]=o.showOutlierPoints?"1":"0");const s={};Object.keys(a).length>0&&(s["cx:visibility"]=a),o.quartileMethod&&(s["cx:statistics"]={"@_quartileMethod":o.quartileMethod}),Object.keys(s).length>0&&(r["cx:layoutPr"]=s)}if(e.chartType==="histogram")if(t.histogramOptions?.aggregateByCategory)r["cx:layoutPr"]={"cx:aggregation":{}};else{const o=oTn(t);(t.histogramOptions?.layout!=="pareto"||Object.keys(o).length>0)&&(r["cx:layoutPr"]={"cx:binning":o})}if(e.chartType==="waterfall"&&t.waterfallOptions){const o=t.waterfallOptions,a={};o.connectorLines!==void 0&&(a["cx:visibility"]={"@_connectorLines":o.connectorLines?"1":"0"}),o.subtotalIndices!==void 0&&(a["cx:subtotals"]={"cx:idx":o.subtotalIndices.filter(s=>Number.isInteger(s)&&s>=0).map(s=>({"@_val":String(s)}))}),Object.keys(a).length>0&&(r["cx:layoutPr"]=a)}if(e.chartType==="treemap"&&t.treemapOptions?.parentLabelLayout&&(r["cx:layoutPr"]={"cx:parentLabelLayout":{"@_val":t.treemapOptions.parentLabelLayout}}),e.chartType==="regionMap"){const o=t.regionMapOptions,a={};o?.regionLabelLayout&&(a["cx:regionLabelLayout"]={"@_val":o.regionLabelLayout}),a["cx:geography"]={...o?.projectionType?{"@_projectionType":o.projectionType}:{},...o?.viewedRegionType?{"@_viewedRegionType":o.viewedRegionType}:{},"@_cultureLanguage":o?.cultureLanguage??"en-US","@_cultureRegion":o?.cultureRegion??"US","@_attribution":o?.attribution??"Microsoft",...o?.geographyCache?{"cx:geoCache":o.geographyCache}:{}},r["cx:layoutPr"]=a}return r}function _$(e){return e.chartType==="funnel"||e.chartType==="waterfall"||e.chartType==="treemap"||e.chartType==="sunburst"||e.chartType==="boxWhisker"||e.chartType==="histogram"||e.chartType==="regionMap"}function dpe(e){if(!_$(e))throw new Error(`ChartEx generation is not implemented for ${e.chartType}`);const t={};e.title&&(t["cx:title"]={"cx:tx":{"cx:rich":{"a:p":{"a:r":{"a:t":e.title}}}}}),t["cx:plotArea"]={"cx:plotAreaRegion":{"cx:series":e.series.map((r,i)=>Pet(e,r,i))}},e.style?.hasLegend&&(t["cx:legend"]=Pne(e.style.legendPosition));const n={"@_xmlns:cx":eTn,"@_xmlns:a":tTn,"@_xmlns:r":nTn,"cx:chartData":{"cx:data":e.series.map((r,i)=>p5(e,r,i))},"cx:chart":t};return J7e(e.userShapesXml)&&(n["@_xmlns:c"]=rTn,n["c:userShapes"]=e.userShapesXml),{"cx:chartSpace":n}}var sTn=new Set(["bestFit","b","ctr","inBase","inEnd","l","outEnd","r","t"]),qEe=["dLbl","delete","numFmt","spPr","txPr","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines","leaderLines","extLst"],lTn=new Set(["delete","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines"]);function cTn(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function Xy(e){return{"@_val":e?"1":"0"}}function Iet(e,t,n){const r=Object.entries(e??{}).filter(([i])=>!lTn.has(n(i)));return r.push(...Object.entries(t)),r.sort(([i],[o])=>{const a=s=>{const l=qEe.indexOf(n(s));return l<0?qEe.length-1:l};return a(i)-a(o)}),Object.fromEntries(r)}function KEe(e,t,n){const r=Object.keys(e);let i=-1;r.forEach((s,l)=>{n(s)==="ser"&&(i=l)});const o=r.map(s=>[s,e[s]]),a=i===-1?o.length:i+1;o.splice(a,0,["c:dLbls",t]);for(const s of r)delete e[s];for(const[s,l]of o)e[s]=l}function uTn(e,t,n){const r={};if(t.numberFormat!==void 0&&(r["c:numFmt"]={"@_formatCode":t.numberFormat,"@_sourceLinked":"0"}),t.position){if(!sTn.has(t.position))throw new RangeError(`Invalid data label position: ${t.position}`);r["c:dLblPos"]={"@_val":t.position}}r["c:showLegendKey"]=Xy(t.showLegendKey),r["c:showVal"]=Xy(t.showValue),r["c:showCatName"]=Xy(t.showCategory),r["c:showSerName"]=Xy(t.showSeriesName),r["c:showPercent"]=Xy(t.showPercent),r["c:showBubbleSize"]=Xy(t.showBubbleSize),t.separator!==void 0&&(r["c:separator"]=t.separator),t.showLeaderLines!==void 0&&(r["c:showLeaderLines"]=Xy(t.showLeaderLines));const i=t.numberFormat===void 0||!e?e:Object.fromEntries(Object.entries(e).filter(([o])=>n(o)!=="numFmt"));return Iet(i,r,n)}function _et(e,t,n){if(t.hasDataLabels===void 0)return;const r=Object.keys(e).filter(i=>n(i).endsWith("Chart"));for(const i of r){const o=e[i];if(!o||typeof o!="object")continue;const a=cTn(o,"dLbls",n);if(t.hasDataLabels===!1){const p=a?o[a]:void 0,h=Iet(p,{"c:delete":{"@_val":"1"}},n);a?o[a]=h:KEe(o,h,n);continue}const s=t.dataLabels??{},c=s.showValue||s.showCategory||s.showSeriesName||s.showPercent||s.showLegendKey||s.showBubbleSize?s:{...s,showValue:!0},u=a?o[a]:void 0,d=uTn(u,c,n);WGe(d,s.dataLabelsRange,s.showDataLabelsRange,n),a?o[a]=d:KEe(o,d,n)}}var Gq=["showHorzBorder","showVertBorder","showOutline","showKeys","spPr","txPr","extLst"],dTn=["layout","areaChart","area3DChart","lineChart","line3DChart","stockChart","radarChart","scatterChart","pieChart","pie3DChart","doughnutChart","barChart","bar3DChart","ofPieChart","surfaceChart","surface3DChart","bubbleChart","valAx","catAx","dateAx","serAx","dTable","spPr","extLst"],pTn=["showHorzBorder","showVertBorder","showOutline","showKeys"];function t3(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function UL(e,t,n,r,i){const o=t3(e,t,i);if(o){e[o]=n;return}const a=Object.entries(e),s=r.indexOf(t),l=a.findIndex(([c])=>{const u=r.indexOf(i(c));return u>=0&&u>s});a.splice(l<0?a.length:l,0,[`c:${t}`,n]);for(const c of Object.keys(e))delete e[c];for(const[c,u]of a)e[c]=u}function Det(e,t,n,r){if(t===void 0)return;const i=t3(e,"dTable",n);if(t===null){i&&delete e[i];return}const o={...i?e[i]:void 0};for(const a of pTn){const s=t[a];s!==void 0&&UL(o,a,{"@_val":s?"1":"0"},Gq,n)}if(t.spPr){const a=t3(o,"spPr",n),s=Qp(a?o[a]:void 0,t.spPr,n,r);UL(o,"spPr",s,Gq,n)}if(t.txPr){const a=t3(o,"txPr",n),s=zp(a?o[a]:void 0,{getChildByLocalName:(c,u)=>{if(!c)return;const d=t3(c,u,n);return d?c[d]:void 0}}),l=jz(t.txPr,s,r);l&&UL(o,"txPr",l,Gq,n)}i?e[i]=o:UL(e,"dTable",o,dTn,n)}function GO(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function hTn(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function fTn(e){if(e.val!==void 0&&!Number.isFinite(e.val))throw new RangeError("error-bar value must be finite");for(const t of[...e.customPlus??[],...e.customMinus??[]])if(!Number.isFinite(t))throw new RangeError("custom error-bar values must be finite")}function mTn(e,t,n,r){return Qp(e,{strokeColor:t.color,strokeWidth:t.width,strokeDashStyle:t.dashStyle},n,r)}function YEe(e){return{"c:ptCount":{"@_val":String(e.length)},"c:pt":e.map((t,n)=>({"@_idx":String(n),"c:v":String(t)}))}}function gTn(e,t,n,r){fTn(t);const i={"c:errDir":{"@_val":t.direction},"c:errBarType":{"@_val":t.barType},"c:errValType":{"@_val":t.valType}};if(t.noEndCap!==void 0)i["c:noEndCap"]={"@_val":t.noEndCap?"1":"0"};else if(e){const s=GO(e,"noEndCap",n);s&&(i["c:noEndCap"]=e[s])}t.valType==="cust"?(t.customPlus&&t.customPlus.length>0&&(i["c:plus"]={"c:numLit":YEe(t.customPlus)}),t.customMinus&&t.customMinus.length>0&&(i["c:minus"]={"c:numLit":YEe(t.customMinus)})):t.val!==void 0&&(i["c:val"]={"@_val":String(t.val)});const o=e?GO(e,"spPr",n):void 0,a=o?e?.[o]:void 0;if(t.color||t.width!==void 0||t.dashStyle?i["c:spPr"]=mTn(a,t,n,r):a&&(i["c:spPr"]=a),e){const s=GO(e,"extLst",n);s&&(i["c:extLst"]=e[s])}return i}function Ret(e,t,n,r){const i=GO(e,"errBars",n),o=i?hTn(e[i]):[],a=t.map((p,h)=>gTn(o[h],p,n,r));if(i&&delete e[i],a.length===0)return;const s=Object.keys(e),l=s.findIndex(p=>{const h=n(p);return h==="cat"||h==="val"||h==="xVal"||h==="yVal"}),c=a.length===1?a[0]:a,u=s.map(p=>[p,e[p]]),d=l===-1?u.length:l;u.splice(d,0,["c:errBars",c]);for(const p of s)delete e[p];for(const[p,h]of u)e[p]=h}function Ine(e){const t=Array.isArray(e)?e[0]:e;return t&&typeof t=="object"?t:void 0}function h5(e,t,n){const r=$o(e,t,n);return r?Ine(e[r]):void 0}function xTn(e,t){for(const n of["r","fld"]){const r=h5(e,n,t),i=r?h5(r,"rPr",t):void 0;if(i)return i}return h5(e,"endParaRPr",t)}function yTn(e,t,n){const r=e?$o(e,"rich",n):void 0,i=r?Ine(e?.[r]):void 0;if(!e||!r||!i)return{"c:rich":{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:r":{"a:t":t}}}};const o=[];if(Aw(i,n,o),o.join("")===t)return e;const a=$o(i,"p",n)??"a:p",s=Ine(i[a])??{},l=h5(s,"pPr",n),c=xTn(s,n),u=h5(s,"endParaRPr",n),d=c?{"a:rPr":c,"a:t":t}:{"a:t":t},p={};l&&(p["a:pPr"]=l),p["a:r"]=d,u&&(p["a:endParaRPr"]=u);const h={...i};h[a]=p;const f={...e};return f[r]=h,f}function td(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function qy(e){return{"@_val":e?"1":"0"}}var ZEe=["idx","delete","layout","tx","numFmt","spPr","txPr","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines","leaderLines","extLst"],vTn=new Set(["bestFit","b","ctr","inBase","inEnd","l","outEnd","r","t"]);function JEe(e,t,n,r){const i=Object.entries(e??{}).filter(([o])=>!n.has(r(o)));return i.push(...Object.entries(t)),i.sort(([o],[a])=>{const s=l=>{const c=ZEe.indexOf(r(l));return c<0?ZEe.length-1:c};return s(o)-s(a)}),Object.fromEntries(i)}function bTn(e,t,n,r){if(!Number.isInteger(t.idx)||t.idx<0||t.idx>4294967295)throw new RangeError("data label idx must be an unsigned 32-bit integer");const i={},o=new Set(["idx","delete","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines"]);i["c:idx"]={"@_val":String(t.idx)};const s=t.showVal!==void 0||t.showCatName!==void 0||t.showSerName!==void 0||t.showPercent!==void 0||t.showLegendKey!==void 0||t.showBubbleSize!==void 0||t.position!==void 0||t.text!==void 0||t.separator!==void 0||t.showLeaderLines!==void 0||t.numberFormat!==void 0||t.layout!==void 0||t.txPr!==void 0||t.spPr!==void 0;if(t.deleted===!0||!s&&t.deleted===void 0)return i["c:delete"]={"@_val":"1"},JEe(e,i,o,n);if(t.deleted===!1&&(i["c:delete"]={"@_val":"0"}),e&&t.layout===void 0){const l=td(e,"layout",n);l&&(i[l]=e[l])}if(t.layout!==void 0&&(o.add("layout"),Db(i,t.layout,n)),t.text!==void 0&&!t.textFromCells){o.add("tx");const l=e?td(e,"tx",n):void 0,c=l?e?.[l]:void 0;i[l??"c:tx"]=yTn(c,t.text,n)}else if(e){const l=td(e,"tx",n);l&&(i[l]=e[l])}if(e)for(const l of["numFmt","spPr","txPr"]){if(l==="numFmt"&&t.numberFormat!==void 0||l==="spPr"&&t.spPr!==void 0||l==="txPr"&&t.txPr!==void 0)continue;const c=td(e,l,n);c&&(i[c]=e[c])}if(t.numberFormat!==void 0&&(o.add("numFmt"),i["c:numFmt"]={"@_formatCode":t.numberFormat,"@_sourceLinked":"0"}),t.spPr!==void 0){o.add("spPr");const l=e?e[td(e,"spPr",n)??""]:void 0;i["c:spPr"]=Qp(l,t.spPr,n,r)}if(t.txPr!==void 0){o.add("txPr");const l=e?e[td(e,"txPr",n)??""]:void 0,c=l?l[td(l,"p",n)??""]:void 0,u=c?c[td(c,"pPr",n)??""]:void 0,d=u?u[td(u,"defRPr",n)??""]:void 0,p=jz(t.txPr,d,r);p&&(i["c:txPr"]=p)}if(t.position!==void 0){if(!vTn.has(t.position))throw new RangeError(`Invalid data label position: ${t.position}`);i["c:dLblPos"]={"@_val":t.position}}return t.showLegendKey!==void 0&&(i["c:showLegendKey"]=qy(t.showLegendKey)),t.showVal!==void 0&&(i["c:showVal"]=qy(t.showVal)),t.showCatName!==void 0&&(i["c:showCatName"]=qy(t.showCatName)),t.showSerName!==void 0&&(i["c:showSerName"]=qy(t.showSerName)),t.showPercent!==void 0&&(i["c:showPercent"]=qy(t.showPercent)),t.showBubbleSize!==void 0&&(i["c:showBubbleSize"]=qy(t.showBubbleSize)),t.separator!==void 0&&(i["c:separator"]=t.separator),t.showLeaderLines!==void 0&&(i["c:showLeaderLines"]=qy(t.showLeaderLines)),JEe(e,i,o,n)}var wTn=new Set(["cat","val","xVal","yVal","bubbleSize","smooth","extLst"]),zL=["numFmt","spPr","txPr","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines","leaderLines","extLst"];function Let(e,t,n,r){const i=td(e,"dLbls",n),o=t??[],a=new Map;let s=[];if(i){const m=e[i],g=td(m,"dLbl",n);if(g){const y=Array.isArray(m[g])?m[g]:[m[g]];for(const v of y){const b=td(v,"idx",n),w=b?v[b]:void 0,S=w?Number.parseInt(String(w["@_val"]),10):NaN;Number.isFinite(S)&&a.set(S,v)}}s=Object.keys(m).filter(y=>n(y)!=="dLbl").map(y=>[y,m[y]])}if(o.length===0&&s.length===0){i&&delete e[i];return}const l=[...o].sort((m,g)=>m.idx-g.idx).map(m=>bTn(a.get(m.idx),m,n,r)),c={};l.length>0&&(c["c:dLbl"]=l.length===1?l[0]:l);const u=[...s].sort((m,g)=>{const y=zL.indexOf(n(m[0])),v=zL.indexOf(n(g[0]));return(y===-1?zL.length:y)-(v===-1?zL.length:v)});for(const[m,g]of u)c[m]=g;if(i){e[i]=c;return}const d=Object.keys(e),p=d.findIndex(m=>wTn.has(n(m))),h=d.map(m=>[m,e[m]]),f=p===-1?h.length:p;h.splice(f,0,["c:dLbls",c]);for(const m of d)delete e[m];for(const[m,g]of h)e[m]=g}function STn(e,t){mvn(e,t.protection);const n=e["c:chartSpace"];t.pivotSource&&n&&typeof n=="object"&&!Array.isArray(n)&&XJe(n,t.pivotSource,r=>r.replace(/^.*:/u,""))}var CTn={linear:"linear",exponential:"exp",logarithmic:"log",polynomial:"poly",power:"power",movingAvg:"movingAvg"};function n3(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function TTn(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function Vq(e,t){if(e!==void 0&&!Number.isFinite(e))throw new RangeError(`${t} must be finite`)}function ATn(e){if(e.order!==void 0&&(!Number.isInteger(e.order)||e.order<2||e.order>6))throw new RangeError("trendline order must be an integer from 2 through 6");if(e.period!==void 0&&(!Number.isInteger(e.period)||e.period<2||e.period>4294967295))throw new RangeError("trendline period must be an integer from 2 through 4294967295");Vq(e.forward,"trendline forward"),Vq(e.backward,"trendline backward"),Vq(e.intercept,"trendline intercept")}function ETn(e,t,n,r){return!t.color&&t.lineWidth===void 0&&!t.lineDashStyle?e:Qp(e,{strokeColor:t.color,strokeWidth:t.lineWidth,strokeDashStyle:t.lineDashStyle},n,r)}function kTn(e,t,n,r){ATn(t);const i={},o=e?n3(e,"name",n):void 0;t.name!==void 0?i["c:name"]=t.name:e&&o&&(i["c:name"]=e[o]);const a=ETn(e?e[n3(e,"spPr",n)??""]:void 0,t,n,r);a&&(i["c:spPr"]=a),i["c:trendlineType"]={"@_val":CTn[t.trendlineType]},t.trendlineType==="polynomial"&&(i["c:order"]={"@_val":String(t.order??2)}),t.trendlineType==="movingAvg"&&(i["c:period"]={"@_val":String(t.period??2)}),t.forward!==void 0&&(i["c:forward"]={"@_val":String(t.forward)}),t.backward!==void 0&&(i["c:backward"]={"@_val":String(t.backward)}),t.intercept!==void 0&&(i["c:intercept"]={"@_val":String(t.intercept)}),t.displayRSq!==void 0&&(i["c:dispRSqr"]={"@_val":t.displayRSq?"1":"0"}),t.displayEq!==void 0&&(i["c:dispEq"]={"@_val":t.displayEq?"1":"0"});const s=e?n3(e,"trendlineLbl",n):void 0;if(t.label?i["c:trendlineLbl"]=oZt(s?e?.[s]:void 0,t.label,n):t.label===void 0&&e&&s&&(i["c:trendlineLbl"]=e[s]),e){const l=n3(e,"extLst",n);l&&(i["c:extLst"]=e[l])}return i}function Net(e,t,n,r){const i=n3(e,"trendline",n),o=i?TTn(e[i]):[],a=t.map((p,h)=>kTn(o[h],p,n,r));if(i&&delete e[i],a.length===0)return;const s=Object.keys(e),l=s.findIndex(p=>{const h=n(p);return h==="cat"||h==="val"||h==="xVal"||h==="yVal"}),c=a.length===1?a[0]:a,u=s.map(p=>[p,e[p]]),d=l===-1?u.length:l;u.splice(d,0,["c:trendline",c]);for(const p of s)delete e[p];for(const[p,h]of u)e[p]=h}var MTn=new Set(["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"]),QEe=new Set(["effectLst","effectDag","scene3d","sp3d","extLst"]),PTn=new Set(["noFill","solidFill","gradFill","pattFill"]);function px(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function IT(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function eke(e,t,n){if(!e)return;if(px(e,"noFill",t)!==void 0)return"none";const r=IT(e[px(e,"solidFill",t)??""]);return r?n(r):void 0}function Fet(e,t,n,r){const i=e?IT(e[px(e,"spPr",t)??""]):void 0;if(!i)return{};const o={},a=eke(i,t,n);a!==void 0&&(o.fill=a);const s=r?.(i);s&&(o.gradient=s);const l=IT(i[px(i,"ln",t)??""]),c=eke(l,t,n);return c!==void 0&&(o.border=c),o}function tke(e){return e==="none"?{"a:noFill":{}}:{"a:solidFill":{"a:srgbClr":{"@_val":jce(e)}}}}function nke(e){const t={};return e.gradient?t["a:gradFill"]=Oz(e.gradient):e.fill!==void 0&&Object.assign(t,tke(e.fill)),e.border!==void 0&&(t["a:ln"]=tke(e.border)),Object.keys(t).length>0?t:void 0}function Oet(e,t){return e===void 0||t===void 0||e==="none"||t==="none"?e===t:ku(e,t)}function ITn(e,t){return e.gradient||t.gradient?!!(e.gradient&&t.gradient&&NGe(e.gradient,t.gradient)):Oet(e.fill,t.fill)}function Wq(e,t,n,r,i){const o=Object.entries(e).filter(([a])=>!n.has(i(a)));if(t){const a=o.findIndex(([s])=>r.has(i(s)));o.splice(a===-1?o.length:a,0,t)}for(const a of Object.keys(e))delete e[a];for(const[a,s]of o)e[a]=s}function rke(e,t,n,r){if(e===void 0)return;if(e==="none")return["a:noFill",{}];const i=IT(t[px(t,"solidFill",n)??""]);return["a:solidFill",R8(i,e,r)]}function ike(e,t,n,r){const i=Fet(e,n,r.resolveColor,r.parseGradient),o=!ITn(t,i),a=!Oet(t.border,i.border);if(!o&&!a)return!1;let s=IT(e[px(e,"spPr",n)??""]);if(s||(s={},r.insertSpPr(e,s)),o)if(t.gradient)Uce(s,t.gradient,n,r);else{const l=rke(t.fill,s,n,r.resolveColor);Wq(s,l,MTn,new Set(["ln",...QEe]),n)}if(a){const l=px(s,"ln",n),c=IT(l?s[l]:void 0)??{},u=rke(t.border,c,n,r.resolveColor);Wq(c,u,PTn,new Set(["prstDash","custDash","round","bevel","miter","headEnd","tailEnd","extLst"]),n),Object.keys(c).length===0?l&&delete s[l]:l||Wq(s,["a:ln",c],new Set,QEe,n)}if(Object.keys(s).length===0){const l=px(e,"spPr",n);l&&delete e[l]}return!0}var Bet=new Set(["AlternateContent","style","clrMapOvr","pivotSource","protection","chart","spPr","txPr","externalData","printSettings","userShapes","extLst"]),jet=new Set(["txPr","externalData","printSettings","userShapes","extLst"]);function _Tn(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function FC(e,t,n,r,i){const o=Object.entries(e),a=o.findIndex(([s])=>!s.startsWith("@_")&&r.has(i(s)));o.splice(a===-1?o.length:a,0,[t,n]);for(const s of Object.keys(e))delete e[s];for(const[s,l]of o)e[s]=l}function Uet(e){const t=e.style;return{...t?.chartAreaFill!==void 0?{fill:t.chartAreaFill}:{},...t?.chartAreaGradient?{gradient:t.chartAreaGradient}:{},...t?.chartAreaBorder!==void 0?{border:t.chartAreaBorder}:{}}}function zet(e){const t=e.style;return{...t?.plotAreaFill!==void 0?{fill:t.plotAreaFill}:{},...t?.plotAreaGradient?{gradient:t.plotAreaGradient}:{},...t?.plotAreaBorder!==void 0?{border:t.plotAreaBorder}:{}}}function DTn(e,t){const n=e["c:chartSpace"];if(!n)return;const r=s=>s.replace(/^.*:/u,""),i=n["c:chart"]?.["c:plotArea"],o=nke(zet(t));i&&o&&FC(i,"c:spPr",o,new Set(["extLst"]),r);const a=nke(Uet(t));a&&FC(n,"c:spPr",a,jet,r),t.roundedCorners!==void 0&&FC(n,"c:roundedCorners",{"@_val":t.roundedCorners?"1":"0"},Bet,r)}function RTn(e){if(e===void 0)return;const t=e&&typeof e=="object"?e["@_val"]:void 0;return t==null||t===""?!0:!(t==="0"||t==="false")}function LTn(e,t,n,r,i){let o=!1;const a=_Tn(e,"roundedCorners",r),s=a?RTn(e[a]):void 0;if(n.roundedCorners===void 0)a&&(delete e[a],o=!0);else if(n.roundedCorners!==s){const l={"@_val":n.roundedCorners?"1":"0"};a?e[a]=l:FC(e,"c:roundedCorners",l,Bet,r),o=!0}return o=ike(e,Uet(n),r,{...i,insertSpPr:(l,c)=>FC(l,"c:spPr",c,jet,r)})||o,t&&(o=ike(t,zet(n),r,{...i,insertSpPr:(l,c)=>FC(l,"c:spPr",c,new Set(["extLst"]),r)})||o),o}var $et=new Set(["minorGridlines","title","numFmt","majorTickMark","minorTickMark","tickLblPos","spPr","txPr","crossAx","crosses","crossesAt","crossBetween","majorUnit","minorUnit","dispUnits","extLst"]),NTn=new Set([...$et].filter(e=>e!=="minorGridlines"));function mb(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function FTn(e,t,n,r,i){const o=Object.keys(e),a=o.findIndex(c=>r.has(i(c))),s=o.map(c=>[c,e[c]]),l=a===-1?s.length:a;s.splice(l,0,[t,n]);for(const c of o)delete e[c];for(const[c,u]of s)e[c]=u}function oke(e,t,n,r,i,o){if(r===void 0)return;const a=mb(e,t,o);if(!r){a&&delete e[a];return}a||FTn(e,n,{},i,o)}function Het(e,t,n,r){oke(e,"majorGridlines","c:majorGridlines",t.majorGridlines,$et,n),oke(e,"minorGridlines","c:minorGridlines",t.minorGridlines,NTn,n),ake(e,"majorGridlines",t.majorGridlinesSpPr,n,r),ake(e,"minorGridlines",t.minorGridlinesSpPr,n,r)}function OTn(e){return e.replace(/^#/u,"").toUpperCase()}function BTn(e,t,n,r){const i=e?{...e}:{},o=mb(i,"ln",n)??"a:ln",a={...i[o]??{}};if(t.strokeWidth!==void 0&&(a["@_w"]=String(Math.round(t.strokeWidth*12700))),t.strokeColor){const s=mb(a,"solidFill",n)??"a:solidFill",l=mb(a,"noFill",n);l&&delete a[l];const c=a[s];a[s]=uT(c,c&&r?r(c):void 0,OTn(t.strokeColor))}if(t.strokeDashStyle){const s=mb(a,"prstDash",n)??"a:prstDash";a[s]={"@_val":t.strokeDashStyle}}return i[o]=a,i}function ake(e,t,n,r,i){if(!n)return;const o=mb(e,t,r);if(!o)return;const a={...e[o]??{}},s=mb(a,"spPr",r)??"c:spPr";a[s]=BTn(a[s],n,r,i),e[o]=a}function Rk(e,t,n,r){const i={"c:axId":{"@_val":String(e)},"c:scaling":{"c:orientation":{"@_val":"minMax"}},"c:delete":{"@_val":r?.deleted?"1":"0"},"c:axPos":{"@_val":n},"c:crossAx":{"@_val":String(t)}};if(r){const o=a=>a.replace(/^.*:/u,"");tVe(i["c:scaling"],r,o),eVe(i,r,o),lb(i,"majorUnit",r.majorUnit===void 0?void 0:String(r.majorUnit),o),lb(i,"minorUnit",r.minorUnit===void 0?void 0:String(r.minorUnit),o),nVe(i,r,o),Het(i,r,o)}return r?.displayUnits&&QGe(i,r,o=>o.replace(/^.*:/u,"")),i}var jTn={pie:{tag:"c:pieChart",family:"pie"},pie3D:{tag:"c:pie3DChart",family:"pie"},ofPie:{tag:"c:ofPieChart",family:"ofPie"},doughnut:{tag:"c:doughnutChart",family:"doughnut"},scatter:{tag:"c:scatterChart",family:"scatter"},bubble:{tag:"c:bubbleChart",family:"bubble"},line:{tag:"c:lineChart",family:"line"},line3D:{tag:"c:line3DChart",family:"line"},area:{tag:"c:areaChart",family:"area"},area3D:{tag:"c:area3DChart",family:"area"},radar:{tag:"c:radarChart",family:"radar"},stock:{tag:"c:stockChart",family:"stock"},surface:{tag:"c:surfaceChart",family:"surface"},bar:{tag:"c:barChart",family:"bar"},bar3D:{tag:"c:bar3DChart",family:"bar"}};function UTn(e){return jTn[e]??{tag:"c:barChart",family:"bar"}}var Get=new Set(["line","radar","scatter"]);function Vet(e){return Get.has(e)||e==="stock"}function zTn(e,t){if(e.gradientFill&&!Vet(t))return{"a:gradFill":Oz(e.gradientFill)};if(!e.color)return;const n={"a:solidFill":{"a:srgbClr":{"@_val":e.color.replace(/^#/u,"").toUpperCase()}}};return Get.has(t)?{"a:ln":n}:n}var $Tn="http://schemas.openxmlformats.org/drawingml/2006/chart",HTn="http://schemas.openxmlformats.org/drawingml/2006/main",GTn="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Nm=111111111,Fm=222222222,Xq=333333333,VTn=new Set(["scatter","bubble"]);function Wet(e){return e.map((t,n)=>({"@_idx":String(n),"c:v":t}))}function Lk(e,t="General"){return{"c:numLit":{"c:formatCode":t,"c:ptCount":{"@_val":String(e.length)},"c:pt":Wet(e.map(String))}}}function WTn(e){return{"c:strLit":{"c:ptCount":{"@_val":String(e.length)},"c:pt":Wet(e)}}}function XTn(e,t,n,r,i){const o={"c:idx":{"@_val":String(n)},"c:order":{"@_val":String(n)},"c:tx":{"c:v":t.name}},a=zTn(t,e);if(a&&(o["c:spPr"]=a),t.marker!==void 0&&OGe(o,t.marker,s=>s.replace(/^.*:/u,"")),t.dataPoints!==void 0&&jGe(o,t.dataPoints,s=>s.replace(/^.*:/u,""),void 0,{lineDrawn:Vet(e)}),e==="scatter"||e==="bubble"){const s=r.map((l,c)=>{const u=Number.parseFloat(l);return Number.isFinite(u)?u:c+1});o["c:xVal"]=Lk(s),o["c:yVal"]=Lk(t.values),e==="bubble"&&(o["c:bubbleSize"]=Lk(t.values.map(()=>1)))}else o["c:cat"]=i?Lk(i.values,i.formatCode):WTn(r),o["c:val"]=Lk(t.values),e==="bar"&&t.shape&&(o["c:shape"]={"@_val":t.shape});return t.dataLabels!==void 0&&Let(o,t.dataLabels,s=>s.replace(/^.*:/u,"")),t.trendlines!==void 0&&Net(o,t.trendlines,s=>s.replace(/^.*:/u,"")),t.errBars!==void 0&&Ret(o,t.errBars,s=>s.replace(/^.*:/u,"")),o}function ES(e,t,n,r=0){return e.axes?.find(i=>i.axisId===n)??e.axes?.filter(i=>i.axisType===t)[r]}function qTn(e,t,n,r){const i={};return t==="bar"?(i["c:barDir"]={"@_val":e.barDirection==="bar"?"bar":"col"},i["c:grouping"]={"@_val":e.groupingStandard&&(e.grouping??"clustered")==="clustered"?"standard":e.grouping??"clustered"},i["c:varyColors"]={"@_val":"0"}):t==="line"||t==="area"?(i["c:grouping"]={"@_val":e.grouping??"standard"},i["c:varyColors"]={"@_val":"0"}):t==="radar"?(i["c:radarStyle"]={"@_val":e.radarStyle??"marker"},i["c:varyColors"]={"@_val":"0"}):t==="scatter"?(i["c:scatterStyle"]={"@_val":"lineMarker"},i["c:varyColors"]={"@_val":"0"}):t==="ofPie"?(i["c:ofPieType"]={"@_val":"pie"},i["c:varyColors"]={"@_val":"1"}):t==="stock"||(t==="surface"?i["c:wireframe"]={"@_val":e.wireframe===!1?"0":"1"}:i["c:varyColors"]={"@_val":t==="bubble"?"0":"1"}),i["c:ser"]=e.series.map((o,a)=>XTn(t,o,a,e.categories,e.dateCategories)),t==="bubble"&&e.bubbleOptions&&Due(i,e.bubbleOptions,o=>o.replace(/^.*:/u,"")),t==="line"&&e.upDownBars!==void 0&&Lue(i,e.upDownBars,o=>o.replace(/^.*:/u,"")),t==="bar"&&e.chartType==="bar3D"&&e.barShape&&(i["c:shape"]={"@_val":e.barShape}),t==="stock"&&(i["c:hiLowLines"]={}),r.length>0&&(i["c:axId"]=r.map(o=>({"@_val":String(o)}))),pln(i,n,e),i}function KTn(e,t,n){const r=n!=="pie"&&n!=="doughnut"&&n!=="ofPie",i=e.chartType==="line3D"||n==="surface",o=r?[Nm,Fm,...i?[Xq]:[]]:[],a={"c:layout":{}};if(a[t]=qTn(e,n,t.replace(/^.*:/u,""),o),e.style&&_et(a,e.style,s=>s.replace(/^.*:/u,"")),r&&VTn.has(e.chartType))a["c:valAx"]=[Rk(Nm,Fm,"b",ES(e,"valAx",Nm,0)),Rk(Fm,Nm,"l",ES(e,"valAx",Fm,1))];else if(r){const s=e.dateCategories?ES(e,"dateAx",Nm):void 0;a[s?"c:dateAx":"c:catAx"]=Rk(Nm,Fm,"b",s??ES(e,"catAx",Nm)),a["c:valAx"]=Rk(Fm,Nm,"l",ES(e,"valAx",Fm))}return i&&(a["c:serAx"]=Rk(Xq,Fm,"b",ES(e,"serAx",Xq))),Det(a,e.dataTable,s=>s.replace(/^.*:/u,"")),a}function Xet(e){const t=UTn(e.chartType),{family:n}=t,r=n==="surface"&&e.surfaceTopView===!1?"c:surface3DChart":t.tag,i={};e.title?(i["c:title"]={"c:tx":{"c:rich":{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:r":{"a:t":e.title}}}},"c:overlay":{"@_val":"0"}},i["c:autoTitleDeleted"]={"@_val":"0"}):i["c:autoTitleDeleted"]={"@_val":"1"},i["c:plotArea"]=KTn(e,r,n),e.style?.hasLegend&&(i["c:legend"]={"c:legendPos":{"@_val":e.style.legendPosition??"r"},"c:overlay":{"@_val":"0"}}),i["c:plotVisOnly"]={"@_val":"1"},i["c:dispBlanksAs"]={"@_val":"gap"},e.layouts&&Bce(i,e.layouts,a=>a.replace(/^.*:/u,""));const o={"c:chartSpace":{"@_xmlns:c":$Tn,"@_xmlns:a":HTn,"@_xmlns:r":GTn,"c:chart":i}};return STn(o,e),DTn(o,e),o}function YTn(e){const t={};return e.paragraphProperties&&Object.keys(e.paragraphProperties).length>0&&(t.paragraphProperties=e.paragraphProperties),e.endParaRunProperties&&typeof e.endParaRunProperties=="object"&&(t.endParaRunProperties=e.endParaRunProperties),typeof e.paragraphLevel=="number"&&e.paragraphLevel>=0&&(t.paragraphLevel=e.paragraphLevel),e.bulletInfo&&(t.bulletInfo=e.bulletInfo),e.emptyParagraphPropertiesAuthored&&(t.emptyParagraphPropertiesAuthored=!0),e.bareParagraph&&(t.bareParagraph=!0),t}function qet(e){return e.paragraphProperties===void 0&&e.endParaRunProperties===void 0&&e.paragraphLevel===void 0&&e.bulletInfo===void 0&&e.emptyParagraphPropertiesAuthored===void 0&&e.bareParagraph===void 0}function D$(e){return e.replace(/\r\n/g,`
346
+ <a:clrMap xmlns:a="${xet}" ${t}/>`)}async function BEe(e){return{placeholders:e.placeholders,schemeColors:e.schemeColors,themeFonts:e.themeFonts,oartTextStyles:e.txStylesXml?await TCn(e.txStylesXml):void 0,theme:e.themeXml?await ACn(e.themeXml):void 0,colorMapping:e.clrMapAttributes?ECn(e.clrMapAttributes):void 0}}async function kCn(e){const t=await La.loadAsync(e),n=await get(t),r=[...new Set(n)];if(r.length===0)return{masterPaths:[],masters:[await BEe(await OEe(t))],slideMasterIndex:[]};const i=await Promise.all(r.map(async o=>BEe(await OEe(t,o))));return{masterPaths:r,masters:i,slideMasterIndex:n.map(o=>r.indexOf(o))}}var MCn=["@napi-rs","canvas"].join("/"),jEe;function UEe(e){const t=e;return typeof t?.createCanvas=="function"&&typeof t.loadImage=="function"}function PCn(){return jEe??=(async()=>{if(globalThis.process?.versions?.node)try{const t=await import(MCn),n=t;return UEe(t)?t:UEe(n.default)?n.default:void 0}catch{return}})(),jEe}async function ICn(e,t){const n=await PCn();if(n)try{const r=await n.loadImage(e),{width:i,height:o}=t(r.width,r.height),a=n.createCanvas(i,o);return a.getContext("2d").drawImage(r,0,0,i,o),new Uint8Array(a.toBuffer("image/png"))}catch{return}}var _Cn=2048;function DCn(){return typeof document<"u"&&typeof Image<"u"&&typeof URL<"u"&&typeof URL.createObjectURL=="function"}function wet(e,t,n,r){const i=e||n,o=t||r,a=Math.min(2,_Cn/Math.max(i,o,1));return{width:Math.max(1,Math.round(i*a)),height:Math.max(1,Math.round(o*a))}}function RCn(e){return new Promise(t=>{const n=new Image;n.onload=()=>t(n),n.onerror=()=>t(void 0),n.src=e})}async function LCn(e,t,n){const r=URL.createObjectURL(new Blob([e.slice()],{type:"image/svg+xml"}));try{const i=await RCn(r);if(!i)return;const o=wet(i.naturalWidth,i.naturalHeight,t,n),a=document.createElement("canvas");a.width=o.width,a.height=o.height;const s=a.getContext("2d");if(!s)return;s.drawImage(i,0,0,a.width,a.height);const l=await new Promise(c=>{a.toBlob(c,"image/png")});return l?new Uint8Array(await l.arrayBuffer()):void 0}catch{return}finally{URL.revokeObjectURL(r)}}async function Cet(e,t,n){const r=DCn()?await LCn(e,t,n):await ICn(e,(i,o)=>wet(i,o,t,n));return r?{extension:"png",bytes:r}:void 0}async function NCn(e){try{const t=await Ji(()=>import("./UTIF-BtQhea94.js").then(s=>s.U),__vite__mapDeps([0,1,2])),n="default"in t?t.default:t,r=e.slice().buffer,i=n.decode(r)[0];if(!i)return;n.decodeImage(r,i);const o=Number(i.width),a=Number(i.height);return o>0&&a>0?{extension:"png",bytes:kle(o,a,new Uint8Array(n.toRGBA8(i)))}:void 0}catch{return}}async function FCn(e){if(!(!e?.startsWith("blob:")||typeof fetch>"u"))try{return new Uint8Array(await(await fetch(e)).arrayBuffer())}catch{return}}function OCn(e){const t=/\.([^./\\]+)$/u.exec(e)?.[1]?.toLowerCase();return t==="jpg"?"jpeg":t==="tif"?"tiff":t}async function Bq(e,t){const n=Jde(e);return n==="tiff"?NCn(e):n==="svg"?Cet(e,t.width||1,t.height||1):Qde(e)}async function BCn(e,t,n){const r=TQe(t.inline),i=r?Jde(r):void 0,o=t.partPath?OCn(t.partPath):void 0;if(r&&(!o||o===i))return i==="tiff"||i==="svg"?Bq(r,e):void 0;const a=t.partPath?await n(t.partPath):void 0,s=a?await Bq(a,e):void 0;if(s)return s;if(r&&Qde(r))return;const l=await FCn(t.inline),c=l?await Bq(l,e):void 0;if(c||!t.svgPath)return c;const u=await n(t.svgPath);return u?Cet(u,e.width||1,e.height||1):void 0}async function jCn(e,t){const n=[],r=o=>{for(const a of o){const s=CQe(a);s?n.push([a,s]):a.type==="group"&&r(a.children)}};for(const o of e)r(o.elements);const i=new Map;return await Promise.all(n.map(async([o,a])=>{const s=await BCn(o,a,t);s&&i.set(o,s)})),i}var UCn=e=>e.replace(/^.*:/u,"");function uf(e,t){return Object.keys(e).find(n=>UCn(n)===t)}function NC(e,t,n){const r=uf(e,t);if(r)return r;const i=Object.keys(e).find(o=>!o.startsWith("@_")&&o.includes(":"));return i?`${i.slice(0,i.indexOf(":"))}:${t}`:n}function Li(e,t){const n=uf(e,t),r=n?e[n]:void 0;return r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}function k1(e){const t=Number(e);return Number.isSafeInteger(t)?t:void 0}function zEe(e){if(!e)return;const t=k1(e["@_n"]),n=k1(e["@_d"]);return t!==void 0&&n!==void 0&&n!==0?{n:t,d:n}:void 0}function kne(e){const t=Li(e,"cViewPr")??e,n=Li(t,"origin"),r=k1(n?.["@_x"]),i=k1(n?.["@_y"]),o=Li(t,"scale"),a=zEe(o?Li(o,"sx"):void 0),s=zEe(o?Li(o,"sy"):void 0),l=t["@_varScale"];return{origin:r!==void 0&&i!==void 0?{x:r,y:i}:void 0,scale:a?{...a,...s&&(s.n!==a.n||s.d!==a.d)?{sy:s}:{}}:void 0,variableScale:l===void 0?void 0:String(l)!=="0"}}function zCn(e){const t=Li(e,"guideLst");if(!t)return;const n=uf(t,"guide"),r=n?t[n]:void 0;return(Array.isArray(r)?r:r?[r]:[]).map(o=>{const a=o,s=a["@_orient"];return{orientation:s==="horz"||s==="vert"?s:void 0,position:k1(a["@_pos"])}})}function jq(e){return{...kne(e),snapToGrid:Uq(e["@_snapToGrid"]),snapToObjects:Uq(e["@_snapToObjects"]),showGuides:Uq(e["@_showGuides"]),guides:zCn(e)}}function Uq(e){return e===void 0?void 0:e!=="0"&&e!==!1}function $Cn(e){const t=Li(e,"gridSpacing"),n=k1(t?.["@_cx"]),r=k1(t?.["@_cy"]);return n!==void 0&&n>0&&r!==void 0&&r>0?{cx:n,cy:r}:void 0}function $Ee(e,t){if(!Number.isSafeInteger(e.n)||!Number.isSafeInteger(e.d)||e.d===0)throw new RangeError(`${t} must contain safe integer n and non-zero d values`)}function HCn(e,t){const n={...t};if(e.variableScale!==void 0&&(n["@_varScale"]=e.variableScale?"1":"0"),e.scale){$Ee(e.scale,"scale"),e.scale.sy&&$Ee(e.scale.sy,"scale.sy");const r=NC(n,"scale","p:scale"),i={...n[r]};i[uf(i,"sx")??"a:sx"]=HEe(e.scale),i[uf(i,"sy")??"a:sy"]=HEe(e.scale.sy??e.scale),n[r]=i}if(e.origin){if(!Number.isSafeInteger(e.origin.x)||!Number.isSafeInteger(e.origin.y))throw new RangeError("origin coordinates must be safe integers");const r=NC(n,"origin","p:origin");n[r]={...n[r]??{},"@_x":`${e.origin.x}`,"@_y":`${e.origin.y}`}}return n}var HEe=e=>({"@_n":`${e.n}`,"@_d":`${e.d}`});function Tet(e,t={}){const n={...t};zq(n,"snapToGrid",e.snapToGrid),zq(n,"snapToObjects",e.snapToObjects),zq(n,"showGuides",e.showGuides);const r=NC(n,"cViewPr","p:cViewPr");if(n[r]=HCn(e,Li(n,"cViewPr")??{}),e.guides){const i=NC(n,"guideLst","p:guideLst"),o={...n[i]??{}};o[NC(o,"guide","p:guide")]=e.guides.map(GCn),n[i]=o}return n}function zq(e,t,n){n!==void 0&&(e[`@_${t}`]=n?"1":"0")}function GCn(e){if(e.position!==void 0&&!Number.isSafeInteger(e.position))throw new RangeError("guide position must be a safe integer");return{...e.orientation?{"@_orient":e.orientation}:{},...e.position!==void 0?{"@_pos":`${e.position}`}:{}}}function VCn(e,t){if(!t)return;if(!Number.isSafeInteger(t.cx)||t.cx<=0||!Number.isSafeInteger(t.cy)||t.cy<=0)throw new RangeError("grid spacing cx and cy must be positive safe integers");const n=NC(e,"gridSpacing","p:gridSpacing");e[n]={...e[n]??{},"@_cx":`${t.cx}`,"@_cy":`${t.cy}`}}function WCn(e){const t={},n=String(e["@_lastView"]||"").trim();n.length>0&&(t.lastView=n);const r=e["@_showComments"];r!==void 0&&(t.showComments=r!=="0");const i=Li(e,"normalViewPr");i&&(t.normalViewPr=XCn(i));const o=Li(e,"slideViewPr");if(o){const u=Li(o,"cSldViewPr");u&&(t.slideViewPr=jq(u))}const a=Li(e,"outlineViewPr");if(a){const u=Li(a,"cSldViewPr");u&&(t.outlineViewPr=jq(u))}const s=Li(e,"notesTextViewPr");if(s){const u=Li(s,"cViewPr")??Li(s,"cSldViewPr");u&&(t.notesTextViewPr=kne(u))}const l=Li(e,"sorterViewPr");if(l){const u=Li(l,"cViewPr")??Li(l,"cSldViewPr");t.sorterViewPr={scale:u?kne(u).scale:void 0}}const c=Li(e,"notesViewPr");if(c){const u=Li(c,"cSldViewPr");u&&(t.notesViewPr=jq(u))}return t.gridSpacing=$Cn(e),t.rawXml=e,t}function XCn(e){const t={},n=e["@_showOutlineIcons"];n!==void 0&&(t.showOutlineIcons=n!=="0");const r=e["@_snapVertSplitter"];r!==void 0&&(t.snapVertSplitter=r==="1");const i=String(e["@_vertBarState"]||"").trim();i.length>0&&(t.vertBarState=i);const o=String(e["@_horzBarState"]||"").trim();o.length>0&&(t.horzBarState=o);const a=e["@_preferSingleView"];a!==void 0&&(t.preferSingleView=a==="1");const s=Li(e,"restoredLeft");s&&(t.restoredLeft=GEe(s));const l=Li(e,"restoredTop");return l&&(t.restoredTop=GEe(l)),t}function GEe(e){const t=parseInt(String(e["@_sz"]??"0"),10),n=e["@_autoAdjust"];return{sz:Number.isFinite(t)?t:0,autoAdjust:n!==void 0?n!=="0":void 0}}function qCn(e){const t=e.rawXml?{...e.rawXml}:{"@_xmlns:p":"http://schemas.openxmlformats.org/presentationml/2006/main","@_xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","@_xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"};if(e.lastView&&(t["@_lastView"]=e.lastView),e.showComments!==void 0&&(t["@_showComments"]=e.showComments?"1":"0"),e.normalViewPr){const n=uf(t,"normalViewPr")??"p:normalViewPr";t[n]=KCn(e.normalViewPr,Li(t,"normalViewPr"))}return e.slideViewPr&&$q(t,"slideViewPr",e.slideViewPr),e.outlineViewPr&&$q(t,"outlineViewPr",e.outlineViewPr),e.notesTextViewPr&&WEe(t,"notesTextViewPr",e.notesTextViewPr),e.sorterViewPr?.scale&&WEe(t,"sorterViewPr",e.sorterViewPr),e.notesViewPr&&$q(t,"notesViewPr",e.notesViewPr),VCn(t,e.gridSpacing),{"p:viewPr":t}}function KCn(e,t){const n={...t};return e.showOutlineIcons!==void 0&&(n["@_showOutlineIcons"]=e.showOutlineIcons?"1":"0"),e.snapVertSplitter!==void 0&&(n["@_snapVertSplitter"]=e.snapVertSplitter?"1":"0"),e.vertBarState&&(n["@_vertBarState"]=e.vertBarState),e.horzBarState&&(n["@_horzBarState"]=e.horzBarState),e.preferSingleView!==void 0&&(n["@_preferSingleView"]=e.preferSingleView?"1":"0"),e.restoredLeft&&(n["p:restoredLeft"]=VEe(e.restoredLeft)),e.restoredTop&&(n["p:restoredTop"]=VEe(e.restoredTop)),n}function VEe(e){const t={"@_sz":String(e.sz)};return e.autoAdjust!==void 0&&(t["@_autoAdjust"]=e.autoAdjust?"1":"0"),t}function $q(e,t,n){const r=uf(e,t)??`p:${t}`,i={...e[r]??{}},o=uf(i,"cSldViewPr")??"p:cSldViewPr";i[o]=Tet(n,Li(i,"cSldViewPr")),e[r]=i}function WEe(e,t,n){const r=uf(e,t)??`p:${t}`,i={...e[r]??{}},o=uf(i,"cViewPr")??"p:cViewPr",a=Tet(n,{"p:cViewPr":Li(i,"cViewPr")??{}});i[o]=Li(a,"cViewPr"),e[r]=i}var YCn=new Set(["cycle","withinLinear","acrossLinear"]),XEe=new Set(["scrgbClr","srgbClr","hslClr","sysClr","schemeClr","prstClr"]);function Mne(e){return e.replace(/^.*:/u,"")}function ZCn(e){const t=Object.keys(e).find(r=>Mne(r)==="colorStyle"),n=t?e[t]:e;return n&&typeof n=="object"&&!Array.isArray(n)?n:e}function JCn(e){const t=e.replace(/^#/u,"").toUpperCase();if(!/^[0-9A-F]{6}$/u.test(t))throw new RangeError(`chart palette colour must be six-digit RGB: ${e}`);return t}function Aet(e,t,n){if(!t.length)throw new RangeError("chart colorPalette must not be empty");if(!YCn.has(n))throw new RangeError("chart colorMethod must be cycle, withinLinear, or acrossLinear");const r=ZCn(e);r["@_meth"]=n;const i=Object.entries(r);for(const a of Object.keys(r))!a.startsWith("@_")&&XEe.has(Mne(a))&&delete r[a];const o=Object.entries(r);for(const a of Object.keys(r))delete r[a];for(const[a,s]of o.filter(([l])=>l.startsWith("@_")))r[a]=s;r["a:srgbClr"]=t.map(a=>({"@_val":JCn(a)}));for(const[a,s]of i)!a.startsWith("@_")&&!XEe.has(Mne(a))&&(r[a]=s)}function QCn(e,t){const n={"cs:colorStyle":{"@_xmlns:cs":"http://schemas.microsoft.com/office/drawing/2012/chartStyle","@_xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","@_meth":t,"@_id":"10"}};return Aet(n,e,t),n}function Pne(e){return{"@_pos":e==="t"||e==="b"||e==="l"?e:"r","@_align":"ctr","@_overlay":"0"}}var eTn="http://schemas.microsoft.com/office/drawing/2014/chartex",tTn="http://schemas.openxmlformats.org/drawingml/2006/main",nTn="http://schemas.openxmlformats.org/officeDocument/2006/relationships",rTn="http://schemas.openxmlformats.org/drawingml/2006/chart";function iTn(e){return e.map((t,n)=>({"@_idx":String(n),"#text":String(t)}))}function Hq(e,t){return e.map((n,r)=>({"@_idx":String(t?.[r]??r),"#text":String(n)}))}function Eet(e){const t=e.color?.replace(/^#/u,"").toUpperCase();return t?{"a:solidFill":{"a:srgbClr":{"@_val":t}}}:void 0}function oTn(e){const t=e.histogramOptions,n={};return t?.intervalClosed&&(n["@_intervalClosed"]=t.intervalClosed),t?.underflow!==void 0&&(n["@_underflow"]=String(t.underflow)),t?.overflow!==void 0&&(n["@_overflow"]=String(t.overflow)),t?.binSize!==void 0?n["cx:binSize"]=String(t.binSize):t?.binCount!==void 0&&(n["cx:binCount"]=String(t.binCount)),n}function p5(e,t,n){const r=e.chartType==="regionMap"?t.regionMapOptions:void 0,i=(e.chartType==="sunburst"||e.chartType==="treemap")&&e.categoryLevels?.length?e.categoryLevels:[e.categories],o=[{"@_type":"cat","cx:lvl":i.map(a=>({"@_ptCount":String(a.length),"cx:pt":e.chartType==="regionMap"&&a===i[0]?Hq(a,r?.categorySourceIndices):iTn(a)}))}];return e.chartType==="regionMap"&&t.regionMapOptions?.entityIds?.length&&o.push({"@_type":"entityId","cx:lvl":{"@_ptCount":String(t.regionMapOptions.entityIds.length),"cx:pt":Hq(t.regionMapOptions.entityIds,t.regionMapOptions.entityIdSourceIndices)}}),{"@_id":String(n),"cx:strDim":o,"cx:numDim":{"@_type":e.chartType==="treemap"||e.chartType==="sunburst"?"size":e.chartType==="regionMap"?"colorVal":"val","cx:lvl":{"@_ptCount":String(t.values.length),"@_formatCode":"General","cx:pt":Hq(t.values,r?.valueSourceIndices)}}}}function ket(e,t){return e.chartType==="waterfall"?"waterfall":e.chartType==="treemap"?"treemap":e.chartType==="sunburst"?"sunburst":e.chartType==="boxWhisker"?"boxWhisker":e.chartType==="histogram"?t.histogramOptions?.layout==="pareto"?"paretoLine":"clusteredColumn":e.chartType==="regionMap"?"regionMap":"funnel"}function aTn(e){return Eet(e)}function Met(){return{"cx:visibility":{"@_categoryName":"1","@_value":"1","@_seriesName":"0"}}}function Pet(e,t,n){const r={"@_layoutId":ket(e,t),"cx:tx":{"cx:txData":{"cx:v":t.name}}},i=Eet(t);if(i&&(r["cx:spPr"]=i),e.style?.hasDataLabels&&(r["cx:dataLabels"]=Met()),r["cx:dataId"]={"@_val":String(n)},e.chartType==="boxWhisker"&&t.boxWhiskerOptions){const o=t.boxWhiskerOptions,a={};o.showMeanLine!==void 0&&(a["@_meanLine"]=o.showMeanLine?"1":"0"),o.showMeanMarker!==void 0&&(a["@_meanMarker"]=o.showMeanMarker?"1":"0"),o.showInnerPoints!==void 0&&(a["@_nonoutliers"]=o.showInnerPoints?"1":"0"),o.showOutlierPoints!==void 0&&(a["@_outliers"]=o.showOutlierPoints?"1":"0");const s={};Object.keys(a).length>0&&(s["cx:visibility"]=a),o.quartileMethod&&(s["cx:statistics"]={"@_quartileMethod":o.quartileMethod}),Object.keys(s).length>0&&(r["cx:layoutPr"]=s)}if(e.chartType==="histogram")if(t.histogramOptions?.aggregateByCategory)r["cx:layoutPr"]={"cx:aggregation":{}};else{const o=oTn(t);(t.histogramOptions?.layout!=="pareto"||Object.keys(o).length>0)&&(r["cx:layoutPr"]={"cx:binning":o})}if(e.chartType==="waterfall"&&t.waterfallOptions){const o=t.waterfallOptions,a={};o.connectorLines!==void 0&&(a["cx:visibility"]={"@_connectorLines":o.connectorLines?"1":"0"}),o.subtotalIndices!==void 0&&(a["cx:subtotals"]={"cx:idx":o.subtotalIndices.filter(s=>Number.isInteger(s)&&s>=0).map(s=>({"@_val":String(s)}))}),Object.keys(a).length>0&&(r["cx:layoutPr"]=a)}if(e.chartType==="treemap"&&t.treemapOptions?.parentLabelLayout&&(r["cx:layoutPr"]={"cx:parentLabelLayout":{"@_val":t.treemapOptions.parentLabelLayout}}),e.chartType==="regionMap"){const o=t.regionMapOptions,a={};o?.regionLabelLayout&&(a["cx:regionLabelLayout"]={"@_val":o.regionLabelLayout}),a["cx:geography"]={...o?.projectionType?{"@_projectionType":o.projectionType}:{},...o?.viewedRegionType?{"@_viewedRegionType":o.viewedRegionType}:{},"@_cultureLanguage":o?.cultureLanguage??"en-US","@_cultureRegion":o?.cultureRegion??"US","@_attribution":o?.attribution??"Microsoft",...o?.geographyCache?{"cx:geoCache":o.geographyCache}:{}},r["cx:layoutPr"]=a}return r}function _$(e){return e.chartType==="funnel"||e.chartType==="waterfall"||e.chartType==="treemap"||e.chartType==="sunburst"||e.chartType==="boxWhisker"||e.chartType==="histogram"||e.chartType==="regionMap"}function dpe(e){if(!_$(e))throw new Error(`ChartEx generation is not implemented for ${e.chartType}`);const t={};e.title&&(t["cx:title"]={"cx:tx":{"cx:rich":{"a:p":{"a:r":{"a:t":e.title}}}}}),t["cx:plotArea"]={"cx:plotAreaRegion":{"cx:series":e.series.map((r,i)=>Pet(e,r,i))}},e.style?.hasLegend&&(t["cx:legend"]=Pne(e.style.legendPosition));const n={"@_xmlns:cx":eTn,"@_xmlns:a":tTn,"@_xmlns:r":nTn,"cx:chartData":{"cx:data":e.series.map((r,i)=>p5(e,r,i))},"cx:chart":t};return J7e(e.userShapesXml)&&(n["@_xmlns:c"]=rTn,n["c:userShapes"]=e.userShapesXml),{"cx:chartSpace":n}}var sTn=new Set(["bestFit","b","ctr","inBase","inEnd","l","outEnd","r","t"]),qEe=["dLbl","delete","numFmt","spPr","txPr","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines","leaderLines","extLst"],lTn=new Set(["delete","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines"]);function cTn(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function Xy(e){return{"@_val":e?"1":"0"}}function Iet(e,t,n){const r=Object.entries(e??{}).filter(([i])=>!lTn.has(n(i)));return r.push(...Object.entries(t)),r.sort(([i],[o])=>{const a=s=>{const l=qEe.indexOf(n(s));return l<0?qEe.length-1:l};return a(i)-a(o)}),Object.fromEntries(r)}function KEe(e,t,n){const r=Object.keys(e);let i=-1;r.forEach((s,l)=>{n(s)==="ser"&&(i=l)});const o=r.map(s=>[s,e[s]]),a=i===-1?o.length:i+1;o.splice(a,0,["c:dLbls",t]);for(const s of r)delete e[s];for(const[s,l]of o)e[s]=l}function uTn(e,t,n){const r={};if(t.numberFormat!==void 0&&(r["c:numFmt"]={"@_formatCode":t.numberFormat,"@_sourceLinked":"0"}),t.position){if(!sTn.has(t.position))throw new RangeError(`Invalid data label position: ${t.position}`);r["c:dLblPos"]={"@_val":t.position}}r["c:showLegendKey"]=Xy(t.showLegendKey),r["c:showVal"]=Xy(t.showValue),r["c:showCatName"]=Xy(t.showCategory),r["c:showSerName"]=Xy(t.showSeriesName),r["c:showPercent"]=Xy(t.showPercent),r["c:showBubbleSize"]=Xy(t.showBubbleSize),t.separator!==void 0&&(r["c:separator"]=t.separator),t.showLeaderLines!==void 0&&(r["c:showLeaderLines"]=Xy(t.showLeaderLines));const i=t.numberFormat===void 0||!e?e:Object.fromEntries(Object.entries(e).filter(([o])=>n(o)!=="numFmt"));return Iet(i,r,n)}function _et(e,t,n){if(t.hasDataLabels===void 0)return;const r=Object.keys(e).filter(i=>n(i).endsWith("Chart"));for(const i of r){const o=e[i];if(!o||typeof o!="object")continue;const a=cTn(o,"dLbls",n);if(t.hasDataLabels===!1){const p=a?o[a]:void 0,h=Iet(p,{"c:delete":{"@_val":"1"}},n);a?o[a]=h:KEe(o,h,n);continue}const s=t.dataLabels??{},c=s.showValue||s.showCategory||s.showSeriesName||s.showPercent||s.showLegendKey||s.showBubbleSize?s:{...s,showValue:!0},u=a?o[a]:void 0,d=uTn(u,c,n);WGe(d,s.dataLabelsRange,s.showDataLabelsRange,n),a?o[a]=d:KEe(o,d,n)}}var Gq=["showHorzBorder","showVertBorder","showOutline","showKeys","spPr","txPr","extLst"],dTn=["layout","areaChart","area3DChart","lineChart","line3DChart","stockChart","radarChart","scatterChart","pieChart","pie3DChart","doughnutChart","barChart","bar3DChart","ofPieChart","surfaceChart","surface3DChart","bubbleChart","valAx","catAx","dateAx","serAx","dTable","spPr","extLst"],pTn=["showHorzBorder","showVertBorder","showOutline","showKeys"];function t3(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function UL(e,t,n,r,i){const o=t3(e,t,i);if(o){e[o]=n;return}const a=Object.entries(e),s=r.indexOf(t),l=a.findIndex(([c])=>{const u=r.indexOf(i(c));return u>=0&&u>s});a.splice(l<0?a.length:l,0,[`c:${t}`,n]);for(const c of Object.keys(e))delete e[c];for(const[c,u]of a)e[c]=u}function Det(e,t,n,r){if(t===void 0)return;const i=t3(e,"dTable",n);if(t===null){i&&delete e[i];return}const o={...i?e[i]:void 0};for(const a of pTn){const s=t[a];s!==void 0&&UL(o,a,{"@_val":s?"1":"0"},Gq,n)}if(t.spPr){const a=t3(o,"spPr",n),s=Qp(a?o[a]:void 0,t.spPr,n,r);UL(o,"spPr",s,Gq,n)}if(t.txPr){const a=t3(o,"txPr",n),s=zp(a?o[a]:void 0,{getChildByLocalName:(c,u)=>{if(!c)return;const d=t3(c,u,n);return d?c[d]:void 0}}),l=jz(t.txPr,s,r);l&&UL(o,"txPr",l,Gq,n)}i?e[i]=o:UL(e,"dTable",o,dTn,n)}function GO(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function hTn(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function fTn(e){if(e.val!==void 0&&!Number.isFinite(e.val))throw new RangeError("error-bar value must be finite");for(const t of[...e.customPlus??[],...e.customMinus??[]])if(!Number.isFinite(t))throw new RangeError("custom error-bar values must be finite")}function mTn(e,t,n,r){return Qp(e,{strokeColor:t.color,strokeWidth:t.width,strokeDashStyle:t.dashStyle},n,r)}function YEe(e){return{"c:ptCount":{"@_val":String(e.length)},"c:pt":e.map((t,n)=>({"@_idx":String(n),"c:v":String(t)}))}}function gTn(e,t,n,r){fTn(t);const i={"c:errDir":{"@_val":t.direction},"c:errBarType":{"@_val":t.barType},"c:errValType":{"@_val":t.valType}};if(t.noEndCap!==void 0)i["c:noEndCap"]={"@_val":t.noEndCap?"1":"0"};else if(e){const s=GO(e,"noEndCap",n);s&&(i["c:noEndCap"]=e[s])}t.valType==="cust"?(t.customPlus&&t.customPlus.length>0&&(i["c:plus"]={"c:numLit":YEe(t.customPlus)}),t.customMinus&&t.customMinus.length>0&&(i["c:minus"]={"c:numLit":YEe(t.customMinus)})):t.val!==void 0&&(i["c:val"]={"@_val":String(t.val)});const o=e?GO(e,"spPr",n):void 0,a=o?e?.[o]:void 0;if(t.color||t.width!==void 0||t.dashStyle?i["c:spPr"]=mTn(a,t,n,r):a&&(i["c:spPr"]=a),e){const s=GO(e,"extLst",n);s&&(i["c:extLst"]=e[s])}return i}function Ret(e,t,n,r){const i=GO(e,"errBars",n),o=i?hTn(e[i]):[],a=t.map((p,h)=>gTn(o[h],p,n,r));if(i&&delete e[i],a.length===0)return;const s=Object.keys(e),l=s.findIndex(p=>{const h=n(p);return h==="cat"||h==="val"||h==="xVal"||h==="yVal"}),c=a.length===1?a[0]:a,u=s.map(p=>[p,e[p]]),d=l===-1?u.length:l;u.splice(d,0,["c:errBars",c]);for(const p of s)delete e[p];for(const[p,h]of u)e[p]=h}function Ine(e){const t=Array.isArray(e)?e[0]:e;return t&&typeof t=="object"?t:void 0}function h5(e,t,n){const r=$o(e,t,n);return r?Ine(e[r]):void 0}function xTn(e,t){for(const n of["r","fld"]){const r=h5(e,n,t),i=r?h5(r,"rPr",t):void 0;if(i)return i}return h5(e,"endParaRPr",t)}function yTn(e,t,n){const r=e?$o(e,"rich",n):void 0,i=r?Ine(e?.[r]):void 0;if(!e||!r||!i)return{"c:rich":{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:r":{"a:t":t}}}};const o=[];if(Aw(i,n,o),o.join("")===t)return e;const a=$o(i,"p",n)??"a:p",s=Ine(i[a])??{},l=h5(s,"pPr",n),c=xTn(s,n),u=h5(s,"endParaRPr",n),d=c?{"a:rPr":c,"a:t":t}:{"a:t":t},p={};l&&(p["a:pPr"]=l),p["a:r"]=d,u&&(p["a:endParaRPr"]=u);const h={...i};h[a]=p;const f={...e};return f[r]=h,f}function td(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function qy(e){return{"@_val":e?"1":"0"}}var ZEe=["idx","delete","layout","tx","numFmt","spPr","txPr","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines","leaderLines","extLst"],vTn=new Set(["bestFit","b","ctr","inBase","inEnd","l","outEnd","r","t"]);function JEe(e,t,n,r){const i=Object.entries(e??{}).filter(([o])=>!n.has(r(o)));return i.push(...Object.entries(t)),i.sort(([o],[a])=>{const s=l=>{const c=ZEe.indexOf(r(l));return c<0?ZEe.length-1:c};return s(o)-s(a)}),Object.fromEntries(i)}function bTn(e,t,n,r){if(!Number.isInteger(t.idx)||t.idx<0||t.idx>4294967295)throw new RangeError("data label idx must be an unsigned 32-bit integer");const i={},o=new Set(["idx","delete","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines"]);i["c:idx"]={"@_val":String(t.idx)};const s=t.showVal!==void 0||t.showCatName!==void 0||t.showSerName!==void 0||t.showPercent!==void 0||t.showLegendKey!==void 0||t.showBubbleSize!==void 0||t.position!==void 0||t.text!==void 0||t.separator!==void 0||t.showLeaderLines!==void 0||t.numberFormat!==void 0||t.layout!==void 0||t.txPr!==void 0||t.spPr!==void 0;if(t.deleted===!0||!s&&t.deleted===void 0)return i["c:delete"]={"@_val":"1"},JEe(e,i,o,n);if(t.deleted===!1&&(i["c:delete"]={"@_val":"0"}),e&&t.layout===void 0){const l=td(e,"layout",n);l&&(i[l]=e[l])}if(t.layout!==void 0&&(o.add("layout"),Db(i,t.layout,n)),t.text!==void 0&&!t.textFromCells){o.add("tx");const l=e?td(e,"tx",n):void 0,c=l?e?.[l]:void 0;i[l??"c:tx"]=yTn(c,t.text,n)}else if(e){const l=td(e,"tx",n);l&&(i[l]=e[l])}if(e)for(const l of["numFmt","spPr","txPr"]){if(l==="numFmt"&&t.numberFormat!==void 0||l==="spPr"&&t.spPr!==void 0||l==="txPr"&&t.txPr!==void 0)continue;const c=td(e,l,n);c&&(i[c]=e[c])}if(t.numberFormat!==void 0&&(o.add("numFmt"),i["c:numFmt"]={"@_formatCode":t.numberFormat,"@_sourceLinked":"0"}),t.spPr!==void 0){o.add("spPr");const l=e?e[td(e,"spPr",n)??""]:void 0;i["c:spPr"]=Qp(l,t.spPr,n,r)}if(t.txPr!==void 0){o.add("txPr");const l=e?e[td(e,"txPr",n)??""]:void 0,c=l?l[td(l,"p",n)??""]:void 0,u=c?c[td(c,"pPr",n)??""]:void 0,d=u?u[td(u,"defRPr",n)??""]:void 0,p=jz(t.txPr,d,r);p&&(i["c:txPr"]=p)}if(t.position!==void 0){if(!vTn.has(t.position))throw new RangeError(`Invalid data label position: ${t.position}`);i["c:dLblPos"]={"@_val":t.position}}return t.showLegendKey!==void 0&&(i["c:showLegendKey"]=qy(t.showLegendKey)),t.showVal!==void 0&&(i["c:showVal"]=qy(t.showVal)),t.showCatName!==void 0&&(i["c:showCatName"]=qy(t.showCatName)),t.showSerName!==void 0&&(i["c:showSerName"]=qy(t.showSerName)),t.showPercent!==void 0&&(i["c:showPercent"]=qy(t.showPercent)),t.showBubbleSize!==void 0&&(i["c:showBubbleSize"]=qy(t.showBubbleSize)),t.separator!==void 0&&(i["c:separator"]=t.separator),t.showLeaderLines!==void 0&&(i["c:showLeaderLines"]=qy(t.showLeaderLines)),JEe(e,i,o,n)}var wTn=new Set(["cat","val","xVal","yVal","bubbleSize","smooth","extLst"]),zL=["numFmt","spPr","txPr","dLblPos","showLegendKey","showVal","showCatName","showSerName","showPercent","showBubbleSize","separator","showLeaderLines","leaderLines","extLst"];function Let(e,t,n,r){const i=td(e,"dLbls",n),o=t??[],a=new Map;let s=[];if(i){const m=e[i],g=td(m,"dLbl",n);if(g){const y=Array.isArray(m[g])?m[g]:[m[g]];for(const v of y){const b=td(v,"idx",n),w=b?v[b]:void 0,S=w?Number.parseInt(String(w["@_val"]),10):NaN;Number.isFinite(S)&&a.set(S,v)}}s=Object.keys(m).filter(y=>n(y)!=="dLbl").map(y=>[y,m[y]])}if(o.length===0&&s.length===0){i&&delete e[i];return}const l=[...o].sort((m,g)=>m.idx-g.idx).map(m=>bTn(a.get(m.idx),m,n,r)),c={};l.length>0&&(c["c:dLbl"]=l.length===1?l[0]:l);const u=[...s].sort((m,g)=>{const y=zL.indexOf(n(m[0])),v=zL.indexOf(n(g[0]));return(y===-1?zL.length:y)-(v===-1?zL.length:v)});for(const[m,g]of u)c[m]=g;if(i){e[i]=c;return}const d=Object.keys(e),p=d.findIndex(m=>wTn.has(n(m))),h=d.map(m=>[m,e[m]]),f=p===-1?h.length:p;h.splice(f,0,["c:dLbls",c]);for(const m of d)delete e[m];for(const[m,g]of h)e[m]=g}function STn(e,t){mvn(e,t.protection);const n=e["c:chartSpace"];t.pivotSource&&n&&typeof n=="object"&&!Array.isArray(n)&&XJe(n,t.pivotSource,r=>r.replace(/^.*:/u,""))}var CTn={linear:"linear",exponential:"exp",logarithmic:"log",polynomial:"poly",power:"power",movingAvg:"movingAvg"};function n3(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function TTn(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function Vq(e,t){if(e!==void 0&&!Number.isFinite(e))throw new RangeError(`${t} must be finite`)}function ATn(e){if(e.order!==void 0&&(!Number.isInteger(e.order)||e.order<2||e.order>6))throw new RangeError("trendline order must be an integer from 2 through 6");if(e.period!==void 0&&(!Number.isInteger(e.period)||e.period<2||e.period>4294967295))throw new RangeError("trendline period must be an integer from 2 through 4294967295");Vq(e.forward,"trendline forward"),Vq(e.backward,"trendline backward"),Vq(e.intercept,"trendline intercept")}function ETn(e,t,n,r){return!t.color&&t.lineWidth===void 0&&!t.lineDashStyle?e:Qp(e,{strokeColor:t.color,strokeWidth:t.lineWidth,strokeDashStyle:t.lineDashStyle},n,r)}function kTn(e,t,n,r){ATn(t);const i={},o=e?n3(e,"name",n):void 0;t.name!==void 0?i["c:name"]=t.name:e&&o&&(i["c:name"]=e[o]);const a=ETn(e?e[n3(e,"spPr",n)??""]:void 0,t,n,r);a&&(i["c:spPr"]=a),i["c:trendlineType"]={"@_val":CTn[t.trendlineType]},t.trendlineType==="polynomial"&&(i["c:order"]={"@_val":String(t.order??2)}),t.trendlineType==="movingAvg"&&(i["c:period"]={"@_val":String(t.period??2)}),t.forward!==void 0&&(i["c:forward"]={"@_val":String(t.forward)}),t.backward!==void 0&&(i["c:backward"]={"@_val":String(t.backward)}),t.intercept!==void 0&&(i["c:intercept"]={"@_val":String(t.intercept)}),t.displayRSq!==void 0&&(i["c:dispRSqr"]={"@_val":t.displayRSq?"1":"0"}),t.displayEq!==void 0&&(i["c:dispEq"]={"@_val":t.displayEq?"1":"0"});const s=e?n3(e,"trendlineLbl",n):void 0;if(t.label?i["c:trendlineLbl"]=oZt(s?e?.[s]:void 0,t.label,n):t.label===void 0&&e&&s&&(i["c:trendlineLbl"]=e[s]),e){const l=n3(e,"extLst",n);l&&(i["c:extLst"]=e[l])}return i}function Net(e,t,n,r){const i=n3(e,"trendline",n),o=i?TTn(e[i]):[],a=t.map((p,h)=>kTn(o[h],p,n,r));if(i&&delete e[i],a.length===0)return;const s=Object.keys(e),l=s.findIndex(p=>{const h=n(p);return h==="cat"||h==="val"||h==="xVal"||h==="yVal"}),c=a.length===1?a[0]:a,u=s.map(p=>[p,e[p]]),d=l===-1?u.length:l;u.splice(d,0,["c:trendline",c]);for(const p of s)delete e[p];for(const[p,h]of u)e[p]=h}var MTn=new Set(["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"]),QEe=new Set(["effectLst","effectDag","scene3d","sp3d","extLst"]),PTn=new Set(["noFill","solidFill","gradFill","pattFill"]);function px(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function IT(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function eke(e,t,n){if(!e)return;if(px(e,"noFill",t)!==void 0)return"none";const r=IT(e[px(e,"solidFill",t)??""]);return r?n(r):void 0}function Fet(e,t,n,r){const i=e?IT(e[px(e,"spPr",t)??""]):void 0;if(!i)return{};const o={},a=eke(i,t,n);a!==void 0&&(o.fill=a);const s=r?.(i);s&&(o.gradient=s);const l=IT(i[px(i,"ln",t)??""]),c=eke(l,t,n);return c!==void 0&&(o.border=c),o}function tke(e){return e==="none"?{"a:noFill":{}}:{"a:solidFill":{"a:srgbClr":{"@_val":jce(e)}}}}function nke(e){const t={};return e.gradient?t["a:gradFill"]=Oz(e.gradient):e.fill!==void 0&&Object.assign(t,tke(e.fill)),e.border!==void 0&&(t["a:ln"]=tke(e.border)),Object.keys(t).length>0?t:void 0}function Oet(e,t){return e===void 0||t===void 0||e==="none"||t==="none"?e===t:ku(e,t)}function ITn(e,t){return e.gradient||t.gradient?!!(e.gradient&&t.gradient&&NGe(e.gradient,t.gradient)):Oet(e.fill,t.fill)}function Wq(e,t,n,r,i){const o=Object.entries(e).filter(([a])=>!n.has(i(a)));if(t){const a=o.findIndex(([s])=>r.has(i(s)));o.splice(a===-1?o.length:a,0,t)}for(const a of Object.keys(e))delete e[a];for(const[a,s]of o)e[a]=s}function rke(e,t,n,r){if(e===void 0)return;if(e==="none")return["a:noFill",{}];const i=IT(t[px(t,"solidFill",n)??""]);return["a:solidFill",R8(i,e,r)]}function ike(e,t,n,r){const i=Fet(e,n,r.resolveColor,r.parseGradient),o=!ITn(t,i),a=!Oet(t.border,i.border);if(!o&&!a)return!1;let s=IT(e[px(e,"spPr",n)??""]);if(s||(s={},r.insertSpPr(e,s)),o)if(t.gradient)Uce(s,t.gradient,n,r);else{const l=rke(t.fill,s,n,r.resolveColor);Wq(s,l,MTn,new Set(["ln",...QEe]),n)}if(a){const l=px(s,"ln",n),c=IT(l?s[l]:void 0)??{},u=rke(t.border,c,n,r.resolveColor);Wq(c,u,PTn,new Set(["prstDash","custDash","round","bevel","miter","headEnd","tailEnd","extLst"]),n),Object.keys(c).length===0?l&&delete s[l]:l||Wq(s,["a:ln",c],new Set,QEe,n)}if(Object.keys(s).length===0){const l=px(e,"spPr",n);l&&delete e[l]}return!0}var Bet=new Set(["AlternateContent","style","clrMapOvr","pivotSource","protection","chart","spPr","txPr","externalData","printSettings","userShapes","extLst"]),jet=new Set(["txPr","externalData","printSettings","userShapes","extLst"]);function _Tn(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function FC(e,t,n,r,i){const o=Object.entries(e),a=o.findIndex(([s])=>!s.startsWith("@_")&&r.has(i(s)));o.splice(a===-1?o.length:a,0,[t,n]);for(const s of Object.keys(e))delete e[s];for(const[s,l]of o)e[s]=l}function Uet(e){const t=e.style;return{...t?.chartAreaFill!==void 0?{fill:t.chartAreaFill}:{},...t?.chartAreaGradient?{gradient:t.chartAreaGradient}:{},...t?.chartAreaBorder!==void 0?{border:t.chartAreaBorder}:{}}}function zet(e){const t=e.style;return{...t?.plotAreaFill!==void 0?{fill:t.plotAreaFill}:{},...t?.plotAreaGradient?{gradient:t.plotAreaGradient}:{},...t?.plotAreaBorder!==void 0?{border:t.plotAreaBorder}:{}}}function DTn(e,t){const n=e["c:chartSpace"];if(!n)return;const r=s=>s.replace(/^.*:/u,""),i=n["c:chart"]?.["c:plotArea"],o=nke(zet(t));i&&o&&FC(i,"c:spPr",o,new Set(["extLst"]),r);const a=nke(Uet(t));a&&FC(n,"c:spPr",a,jet,r),t.roundedCorners!==void 0&&FC(n,"c:roundedCorners",{"@_val":t.roundedCorners?"1":"0"},Bet,r)}function RTn(e){if(e===void 0)return;const t=e&&typeof e=="object"?e["@_val"]:void 0;return t==null||t===""?!0:!(t==="0"||t==="false")}function LTn(e,t,n,r,i){let o=!1;const a=_Tn(e,"roundedCorners",r),s=a?RTn(e[a]):void 0;if(n.roundedCorners===void 0)a&&(delete e[a],o=!0);else if(n.roundedCorners!==s){const l={"@_val":n.roundedCorners?"1":"0"};a?e[a]=l:FC(e,"c:roundedCorners",l,Bet,r),o=!0}return o=ike(e,Uet(n),r,{...i,insertSpPr:(l,c)=>FC(l,"c:spPr",c,jet,r)})||o,t&&(o=ike(t,zet(n),r,{...i,insertSpPr:(l,c)=>FC(l,"c:spPr",c,new Set(["extLst"]),r)})||o),o}var $et=new Set(["minorGridlines","title","numFmt","majorTickMark","minorTickMark","tickLblPos","spPr","txPr","crossAx","crosses","crossesAt","crossBetween","majorUnit","minorUnit","dispUnits","extLst"]),NTn=new Set([...$et].filter(e=>e!=="minorGridlines"));function mb(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function FTn(e,t,n,r,i){const o=Object.keys(e),a=o.findIndex(c=>r.has(i(c))),s=o.map(c=>[c,e[c]]),l=a===-1?s.length:a;s.splice(l,0,[t,n]);for(const c of o)delete e[c];for(const[c,u]of s)e[c]=u}function oke(e,t,n,r,i,o){if(r===void 0)return;const a=mb(e,t,o);if(!r){a&&delete e[a];return}a||FTn(e,n,{},i,o)}function Het(e,t,n,r){oke(e,"majorGridlines","c:majorGridlines",t.majorGridlines,$et,n),oke(e,"minorGridlines","c:minorGridlines",t.minorGridlines,NTn,n),ake(e,"majorGridlines",t.majorGridlinesSpPr,n,r),ake(e,"minorGridlines",t.minorGridlinesSpPr,n,r)}function OTn(e){return e.replace(/^#/u,"").toUpperCase()}function BTn(e,t,n,r){const i=e?{...e}:{},o=mb(i,"ln",n)??"a:ln",a={...i[o]??{}};if(t.strokeWidth!==void 0&&(a["@_w"]=String(Math.round(t.strokeWidth*12700))),t.strokeColor){const s=mb(a,"solidFill",n)??"a:solidFill",l=mb(a,"noFill",n);l&&delete a[l];const c=a[s];a[s]=uT(c,c&&r?r(c):void 0,OTn(t.strokeColor))}if(t.strokeDashStyle){const s=mb(a,"prstDash",n)??"a:prstDash";a[s]={"@_val":t.strokeDashStyle}}return i[o]=a,i}function ake(e,t,n,r,i){if(!n)return;const o=mb(e,t,r);if(!o)return;const a={...e[o]??{}},s=mb(a,"spPr",r)??"c:spPr";a[s]=BTn(a[s],n,r,i),e[o]=a}function Rk(e,t,n,r){const i={"c:axId":{"@_val":String(e)},"c:scaling":{"c:orientation":{"@_val":"minMax"}},"c:delete":{"@_val":r?.deleted?"1":"0"},"c:axPos":{"@_val":n},"c:crossAx":{"@_val":String(t)}};if(r){const o=a=>a.replace(/^.*:/u,"");tVe(i["c:scaling"],r,o),eVe(i,r,o),lb(i,"majorUnit",r.majorUnit===void 0?void 0:String(r.majorUnit),o),lb(i,"minorUnit",r.minorUnit===void 0?void 0:String(r.minorUnit),o),nVe(i,r,o),Het(i,r,o)}return r?.displayUnits&&QGe(i,r,o=>o.replace(/^.*:/u,"")),i}var jTn={pie:{tag:"c:pieChart",family:"pie"},pie3D:{tag:"c:pie3DChart",family:"pie"},ofPie:{tag:"c:ofPieChart",family:"ofPie"},doughnut:{tag:"c:doughnutChart",family:"doughnut"},scatter:{tag:"c:scatterChart",family:"scatter"},bubble:{tag:"c:bubbleChart",family:"bubble"},line:{tag:"c:lineChart",family:"line"},line3D:{tag:"c:line3DChart",family:"line"},area:{tag:"c:areaChart",family:"area"},area3D:{tag:"c:area3DChart",family:"area"},radar:{tag:"c:radarChart",family:"radar"},stock:{tag:"c:stockChart",family:"stock"},surface:{tag:"c:surfaceChart",family:"surface"},bar:{tag:"c:barChart",family:"bar"},bar3D:{tag:"c:bar3DChart",family:"bar"}};function UTn(e){return jTn[e]??{tag:"c:barChart",family:"bar"}}var Get=new Set(["line","radar","scatter"]);function Vet(e){return Get.has(e)||e==="stock"}function zTn(e,t){if(e.gradientFill&&!Vet(t))return{"a:gradFill":Oz(e.gradientFill)};if(!e.color)return;const n={"a:solidFill":{"a:srgbClr":{"@_val":e.color.replace(/^#/u,"").toUpperCase()}}};return Get.has(t)?{"a:ln":n}:n}var $Tn="http://schemas.openxmlformats.org/drawingml/2006/chart",HTn="http://schemas.openxmlformats.org/drawingml/2006/main",GTn="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Nm=111111111,Fm=222222222,Xq=333333333,VTn=new Set(["scatter","bubble"]);function Wet(e){return e.map((t,n)=>({"@_idx":String(n),"c:v":t}))}function Lk(e,t="General"){return{"c:numLit":{"c:formatCode":t,"c:ptCount":{"@_val":String(e.length)},"c:pt":Wet(e.map(String))}}}function WTn(e){return{"c:strLit":{"c:ptCount":{"@_val":String(e.length)},"c:pt":Wet(e)}}}function XTn(e,t,n,r,i){const o={"c:idx":{"@_val":String(n)},"c:order":{"@_val":String(n)},"c:tx":{"c:v":t.name}},a=zTn(t,e);if(a&&(o["c:spPr"]=a),t.marker!==void 0&&OGe(o,t.marker,s=>s.replace(/^.*:/u,"")),t.dataPoints!==void 0&&jGe(o,t.dataPoints,s=>s.replace(/^.*:/u,""),void 0,{lineDrawn:Vet(e)}),e==="scatter"||e==="bubble"){const s=r.map((l,c)=>{const u=Number.parseFloat(l);return Number.isFinite(u)?u:c+1});o["c:xVal"]=Lk(s),o["c:yVal"]=Lk(t.values),e==="bubble"&&(o["c:bubbleSize"]=Lk(t.values.map(()=>1)))}else o["c:cat"]=i?Lk(i.values,i.formatCode):WTn(r),o["c:val"]=Lk(t.values),e==="bar"&&t.shape&&(o["c:shape"]={"@_val":t.shape});return t.dataLabels!==void 0&&Let(o,t.dataLabels,s=>s.replace(/^.*:/u,"")),t.trendlines!==void 0&&Net(o,t.trendlines,s=>s.replace(/^.*:/u,"")),t.errBars!==void 0&&Ret(o,t.errBars,s=>s.replace(/^.*:/u,"")),o}function ES(e,t,n,r=0){return e.axes?.find(i=>i.axisId===n)??e.axes?.filter(i=>i.axisType===t)[r]}function qTn(e,t,n,r){const i={};return t==="bar"?(i["c:barDir"]={"@_val":e.barDirection==="bar"?"bar":"col"},i["c:grouping"]={"@_val":e.groupingStandard&&(e.grouping??"clustered")==="clustered"?"standard":e.grouping??"clustered"},i["c:varyColors"]={"@_val":"0"}):t==="line"||t==="area"?(i["c:grouping"]={"@_val":e.grouping??"standard"},i["c:varyColors"]={"@_val":"0"}):t==="radar"?(i["c:radarStyle"]={"@_val":e.radarStyle??"marker"},i["c:varyColors"]={"@_val":"0"}):t==="scatter"?(i["c:scatterStyle"]={"@_val":"lineMarker"},i["c:varyColors"]={"@_val":"0"}):t==="ofPie"?(i["c:ofPieType"]={"@_val":"pie"},i["c:varyColors"]={"@_val":"1"}):t==="stock"||(t==="surface"?i["c:wireframe"]={"@_val":e.wireframe===!1?"0":"1"}:i["c:varyColors"]={"@_val":t==="bubble"?"0":"1"}),i["c:ser"]=e.series.map((o,a)=>XTn(t,o,a,e.categories,e.dateCategories)),t==="bubble"&&e.bubbleOptions&&Due(i,e.bubbleOptions,o=>o.replace(/^.*:/u,"")),t==="line"&&e.upDownBars!==void 0&&Lue(i,e.upDownBars,o=>o.replace(/^.*:/u,"")),t==="bar"&&e.chartType==="bar3D"&&e.barShape&&(i["c:shape"]={"@_val":e.barShape}),t==="stock"&&(i["c:hiLowLines"]={}),r.length>0&&(i["c:axId"]=r.map(o=>({"@_val":String(o)}))),pln(i,n,e),i}function KTn(e,t,n){const r=n!=="pie"&&n!=="doughnut"&&n!=="ofPie",i=e.chartType==="line3D"||n==="surface",o=r?[Nm,Fm,...i?[Xq]:[]]:[],a={"c:layout":{}};if(a[t]=qTn(e,n,t.replace(/^.*:/u,""),o),e.style&&_et(a,e.style,s=>s.replace(/^.*:/u,"")),r&&VTn.has(e.chartType))a["c:valAx"]=[Rk(Nm,Fm,"b",ES(e,"valAx",Nm,0)),Rk(Fm,Nm,"l",ES(e,"valAx",Fm,1))];else if(r){const s=e.dateCategories?ES(e,"dateAx",Nm):void 0;a[s?"c:dateAx":"c:catAx"]=Rk(Nm,Fm,"b",s??ES(e,"catAx",Nm)),a["c:valAx"]=Rk(Fm,Nm,"l",ES(e,"valAx",Fm))}return i&&(a["c:serAx"]=Rk(Xq,Fm,"b",ES(e,"serAx",Xq))),Det(a,e.dataTable,s=>s.replace(/^.*:/u,"")),a}function Xet(e){const t=UTn(e.chartType),{family:n}=t,r=n==="surface"&&e.surfaceTopView===!1?"c:surface3DChart":t.tag,i={};e.title?(i["c:title"]={"c:tx":{"c:rich":{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:r":{"a:t":e.title}}}},"c:overlay":{"@_val":"0"}},i["c:autoTitleDeleted"]={"@_val":"0"}):i["c:autoTitleDeleted"]={"@_val":"1"},i["c:plotArea"]=KTn(e,r,n),e.style?.hasLegend&&(i["c:legend"]={"c:legendPos":{"@_val":e.style.legendPosition??"r"},"c:overlay":{"@_val":"0"}}),i["c:plotVisOnly"]={"@_val":"1"},i["c:dispBlanksAs"]={"@_val":"gap"},e.layouts&&Bce(i,e.layouts,a=>a.replace(/^.*:/u,""));const o={"c:chartSpace":{"@_xmlns:c":$Tn,"@_xmlns:a":HTn,"@_xmlns:r":GTn,"c:chart":i}};return STn(o,e),DTn(o,e),o}function YTn(e){const t={};return e.paragraphProperties&&Object.keys(e.paragraphProperties).length>0&&(t.paragraphProperties=e.paragraphProperties),e.endParaRunProperties&&typeof e.endParaRunProperties=="object"&&(t.endParaRunProperties=e.endParaRunProperties),typeof e.paragraphLevel=="number"&&e.paragraphLevel>=0&&(t.paragraphLevel=e.paragraphLevel),e.bulletInfo&&(t.bulletInfo=e.bulletInfo),e.emptyParagraphPropertiesAuthored&&(t.emptyParagraphPropertiesAuthored=!0),e.bareParagraph&&(t.bareParagraph=!0),t}function qet(e){return e.paragraphProperties===void 0&&e.endParaRunProperties===void 0&&e.paragraphLevel===void 0&&e.bulletInfo===void 0&&e.emptyParagraphPropertiesAuthored===void 0&&e.bareParagraph===void 0}function D$(e){return e.replace(/\r\n/g,`
347
347
  `).replace(/\r/g,`
348
348
  `)}function Ket(e){return e.isLineBreak?0:D$(String(e.text??"")).split(`
349
349
  `).length-1}function ZTn(e){return D$(e.map(t=>String(t.text??"")).join(""))}function JTn(e){const t=[];let n={},r=!1;for(const i of e){r||(n=YTn(i),r=!0);for(let o=0;o<Ket(i);o++)t.push(n),n={},r=!1}return t.push(n),t}function QTn(e){const t=D$(e).split(`
350
350
  `);return t.map((n,r)=>({text:r<t.length-1?`${n}
351
- `:n,style:{}}))}function eAn(e,t){const n=[];let r=0,i=!1;for(const o of e){let a=o;if(!i){i=!0;const s=t[r];s&&!qet(s)&&(a={...o},s.paragraphProperties&&a.paragraphProperties===void 0&&(a.paragraphProperties=s.paragraphProperties),s.endParaRunProperties&&a.endParaRunProperties===void 0&&(a.endParaRunProperties=s.endParaRunProperties),s.paragraphLevel!==void 0&&a.paragraphLevel===void 0&&(a.paragraphLevel=s.paragraphLevel),s.bulletInfo&&a.bulletInfo===void 0&&(a.bulletInfo=s.bulletInfo),s.emptyParagraphPropertiesAuthored&&(a.emptyParagraphPropertiesAuthored=!0),s.bareParagraph&&(a.bareParagraph=!0))}n.push(a);for(let s=0;s<Ket(a);s++)r++,i=!1}return n}function tAn(e,t,n){if(!n||n.length===0)return e;if(e===void 0&&n.some(i=>i.isLineBreak)&&ZTn(n)===D$(t))return n;const r=JTn(n);return r.every(qet)?e:eAn(e??QTn(t),r)}var nAn=["p:present","p:browse","p:kiosk"],rAn=["p:sldAll","p:sldRg","p:custShow"];function iAn(e){return e.showType!==void 0||e.loopContinuously!==void 0||e.showWithNarration!==void 0||e.showWithAnimation!==void 0||e.advanceMode!==void 0||e.showSlidesMode!==void 0||e.showSlidesFrom!==void 0||e.showSlidesTo!==void 0||e.showSlidesCustomShowId!==void 0||e.kioskRestartTime!==void 0||e.penColor!==void 0||e.showScrollbar!==void 0}var Yet=(e,t)=>{for(const n of t)if(e[n]!==void 0)return[n,e[n]]};function oAn(e,t,n){if(n.showType==="browsed"){const i={},o=t["p:browse"];n.showScrollbar!==void 0?i["@_showScrollbar"]=n.showScrollbar?"1":"0":o?.["@_showScrollbar"]!==void 0&&(i["@_showScrollbar"]=o["@_showScrollbar"]),e["p:browse"]=i;return}if(n.showType==="kiosk"){const i={};n.kioskRestartTime!==void 0&&n.kioskRestartTime>0&&(i["@_restart"]=String(n.kioskRestartTime)),e["p:kiosk"]=i;return}if(n.showType==="presented"){e["p:present"]={};return}const r=Yet(t,nAn);r?e[r[0]]=r[1]:e["p:present"]={}}function aAn(e,t,n){if(n.showSlidesMode==="range"){e["p:sldRg"]={"@_st":String(n.showSlidesFrom??1),"@_end":String(n.showSlidesTo??1)};return}if(n.showSlidesMode==="customShow"&&n.showSlidesCustomShowId){e["p:custShow"]={"@_id":n.showSlidesCustomShowId};return}if(n.showSlidesMode==="all"){e["p:sldAll"]={};return}const r=Yet(t,rAn);r?e[r[0]]=r[1]:e["p:sldAll"]={}}function sAn(e,t){if(!e&&!iAn(t))return;const n=e??{},r={};for(const i of Object.keys(n))i.startsWith("@_")&&(r[i]=n[i]);if(t.loopContinuously!==void 0&&(r["@_loop"]=t.loopContinuously?"1":"0"),t.showWithNarration!==void 0&&(r["@_showNarration"]=t.showWithNarration?"1":"0"),t.showWithAnimation!==void 0&&(r["@_showAnimation"]=t.showWithAnimation?"1":"0"),t.advanceMode!==void 0&&(r["@_useTimings"]=t.advanceMode==="useTimings"?"1":"0"),oAn(r,n,t),aAn(r,n,t),t.penColor){const i=t.penColorXml!==void 0&&ku(t.penColorOriginal,t.penColor);r["p:penClr"]=i?t.penColorXml:{"a:srgbClr":{"@_val":t.penColor.replace("#","")}}}else n["p:penClr"]!==void 0&&(r["p:penClr"]=n["p:penClr"]);return n["p:sldLst"]!==void 0&&(r["p:sldLst"]=n["p:sldLst"]),n["p:extLst"]!==void 0&&(r["p:extLst"]=n["p:extLst"]),r}var lAn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",cAn="application/xml";async function uAn(e,t,n){let r=bAn(e)+1;const i=new Map;for(const o of t){const a=await e.file(o.sourcePartPath)?.async("string");if(!a)continue;const s=n.parse(a),l=pAn(s,o.location);if(!l)continue;const c=xAn(o.sourcePartPath),u=await e.file(c)?.async("string"),d=u?n.parse(u):{Relationships:{"@_xmlns":"http://schemas.openxmlformats.org/package/2006/relationships"}},p=d.Relationships??={},h=w9(p.Relationship),f=[];for(const g of o.entries){const v=(g.id?lf("",g.id):null)||`customXml/item${r++}.xml`;if(g.data===void 0&&!e.file(v))continue;g.id=v,g.contentType??=cAn,g.data!==void 0&&e.file(v,g.data);const b=hAn(h,g,yAn(o.sourcePartPath,v));g.relId=String(b["@_Id"]);const w={...g.rawXml??{},"@_r:id":g.relId};g.rawXml=w,f.push(w),i.set(v,g.contentType)}const m=l["p:custDataLst"]??{};m["p:custData"]=f,mAn(l,m,o.location),p.Relationship=h,e.file(c,n.build(d)),e.file(o.sourcePartPath,n.build(s))}await gAn(e,n,i)}async function dAn(e,t,n){const r=await e.file("[Content_Types].xml")?.async("string");if(!r)return;const i=t.parse(r).Types,o=w9(i?.Override).find(l=>l["@_PartName"]===`/${n}`);if(o?.["@_ContentType"])return String(o["@_ContentType"]);const a=n.split(".").pop()?.toLowerCase(),s=w9(i?.Default).find(l=>String(l["@_Extension"]??"").toLowerCase()===a);return s?.["@_ContentType"]?String(s["@_ContentType"]):void 0}function pAn(e,t){return t==="presentation"?e["p:presentation"]:e["p:sld"]?.["p:cSld"]}function hAn(e,t,n){let r=e.find(i=>String(i["@_Id"]??"")===t.relId&&fAn(i["@_Type"]));return r||(t.relId=vAn(e),r={},e.push(r)),r["@_Id"]=t.relId,r["@_Type"]=lAn,r["@_Target"]=n,delete r["@_TargetMode"],r}function fAn(e){return String(e??"").endsWith("/relationships/customXml")}function mAn(e,t,n){const r=n==="presentation"?new Set(["p:kinsoku","p:defaultTextStyle","p:modifyVerifier","p:extLst"]):new Set(["p:controls","p:extLst"]),i={};let o=!1;for(const[a,s]of Object.entries(e))a!=="p:custDataLst"&&(!o&&r.has(a)&&(i["p:custDataLst"]=t,o=!0),i[a]=s);o||(i["p:custDataLst"]=t);for(const a of Object.keys(e))delete e[a];Object.assign(e,i)}async function gAn(e,t,n){const r=await e.file("[Content_Types].xml")?.async("string");if(!r||n.size===0)return;const i=t.parse(r),o=i.Types,a=w9(o.Override);for(const[s,l]of n){const c=`/${s}`,u=a.find(d=>d["@_PartName"]===c);u?u["@_ContentType"]=l:a.push({"@_PartName":c,"@_ContentType":l})}o.Override=a,e.file("[Content_Types].xml",t.build(i))}function xAn(e){const t=e.lastIndexOf("/");return`${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function yAn(e,t){const n=e.split("/").slice(0,-1),r=t.split("/");for(;n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...n.map(()=>".."),...r].join("/")}function vAn(e){const t=new Set(e.map(r=>String(r["@_Id"]??"")));let n=1;for(;t.has(`rId${n}`);)n+=1;return`rId${n}`}function bAn(e){return e.file(/^customXml\/item\d+\.xml$/u).reduce((t,n)=>Math.max(t,Number(n.name.match(/item(\d+)\.xml$/u)?.[1]??0)),0)}function w9(e){return e==null?[]:Array.isArray(e)?e:[e]}var wAn=["p:sld","p:notes","p:sldLayout","p:sldMaster","p:handoutMaster"],SAn=new Set(["p:kinsoku","p:defaultTextStyle","p:modifyVerifier","p:extLst"]),CAn=new Set(["p:controls","p:extLst"]);function Zet(e){const t=e["p:presentation"];if(t)return{container:t,insertBefore:SAn};for(const n of wAn){const r=e[n];if(r)return{container:r["p:cSld"]??={},insertBefore:CAn}}}function TAn(e,t,n,r){const i={};let o=!1;for(const[a,s]of Object.entries(e))a!==t&&(!o&&r.has(a)&&(i[t]=n,o=!0),i[a]=s);o||(i[t]=n);for(const a of Object.keys(e))delete e[a];Object.assign(e,i)}async function AAn(e,t,n,r){const i=await e.file(n)?.async("string");if(!i)return;const o=t.parse(i),a=Zet(o);if(!a)return;const{container:s,insertBefore:l}=a,c={...s["p:custDataLst"]??{}};c["p:tags"]={"@_r:id":r},TAn(s,"p:custDataLst",c,l),e.file(n,t.build(o))}async function EAn(e,t,n){const r=await e.file(n)?.async("string");if(!r)return;const i=t.parse(r),o=Zet(i);if(!o)return;const a=o.container["p:custDataLst"];!a||a["p:tags"]===void 0||(delete a["p:tags"],Object.keys(a).length===0&&delete o.container["p:custDataLst"],e.file(n,t.build(i)))}var S9="http://schemas.openxmlformats.org/officeDocument/2006/relationships/tags",ske="application/vnd.openxmlformats-officedocument.presentationml.tags+xml";async function kAn(e,t){const n=[],r=new Set;for(const i of e.file(/\.rels$/u)){const o=LAn(i.name);if(!o)continue;const s=t.parse(await i.async("string")).Relationships;for(const l of hE(s?.Relationship)){if(String(l["@_Type"]??"")!==S9)continue;const c=o.slice(0,o.lastIndexOf("/")),u=lf(c,String(l["@_Target"]??""));if(!u||r.has(u))continue;const d=await lke(e,t,u);d&&(d.owner=NAn(o),d.sourcePartPath=o,d.relationshipId=String(l["@_Id"]??"")||void 0,n.push(d),r.add(u))}}for(const i of e.file(/^ppt\/tags\/tag\d+\.xml$/u)){if(r.has(i.name))continue;const o=await lke(e,t,i.name);o&&(o.owner="part",n.push(o))}return n}async function MAn(e,t,n){let r=jAn(e)+1;const i=new Set;for(const o of t){if(o.tags.length===0){await PAn(e,n,o);continue}if(o.path??=`ppt/tags/tag${r++}.xml`,o.owner??="presentation",o.sourcePartPath??=FAn(o.owner),!o.sourcePartPath)continue;const a=o.rawXml?.["p:tagLst"]??{};a["@_xmlns:a"]??="http://schemas.openxmlformats.org/drawingml/2006/main",a["@_xmlns:p"]??="http://schemas.openxmlformats.org/presentationml/2006/main",a["@_xmlns:r"]??="http://schemas.openxmlformats.org/officeDocument/2006/relationships",a["p:tag"]=o.tags.map(s=>({"@_name":s.name,"@_val":s.value})),o.rawXml={...o.rawXml??{},"p:tagLst":a},e.file(o.path,n.build(o.rawXml)),await DAn(e,n,o),await AAn(e,n,o.sourcePartPath,o.relationshipId),i.add(o.path)}await RAn(e,n,i)}async function PAn(e,t,n){!n.path||!n.sourcePartPath||(await EAn(e,t,n.sourcePartPath),await IAn(e,t,n),e.remove(n.path),await _An(e,t,n.path))}async function IAn(e,t,n){const r=Jet(n.sourcePartPath),i=await e.file(r)?.async("string");if(!i)return;const o=t.parse(i),a=o.Relationships;a&&(a.Relationship=hE(a.Relationship).filter(s=>!(String(s["@_Id"]??"")===n.relationshipId&&String(s["@_Type"]??"")===S9)),e.file(r,t.build(o)))}async function _An(e,t,n){const r=await e.file("[Content_Types].xml")?.async("string");if(!r)return;const i=t.parse(r),o=i.Types;o.Override=hE(o.Override).filter(a=>a["@_PartName"]!==`/${n}`),e.file("[Content_Types].xml",t.build(i))}async function lke(e,t,n){const r=await e.file(n)?.async("string");if(!r)return;const i=t.parse(r),o=i["p:tagLst"];if(!o)return;const a=hE(o["p:tag"]).map(s=>({name:String(s["@_name"]??"").trim(),value:String(s["@_val"]??"").trim()})).filter(s=>s.name.length>0);return{path:n,tags:a,rawXml:i}}async function DAn(e,t,n){const r=n.sourcePartPath,i=Jet(r),o=await e.file(i)?.async("string"),a=o?t.parse(o):{Relationships:{"@_xmlns":"http://schemas.openxmlformats.org/package/2006/relationships"}},s=a.Relationships??={},l=hE(s.Relationship);let c=l.find(u=>String(u["@_Id"]??"")===n.relationshipId&&String(u["@_Type"]??"")===S9);c||(n.relationshipId=BAn(l),c={},l.push(c)),c["@_Id"]=n.relationshipId,c["@_Type"]=S9,c["@_Target"]=OAn(r,n.path),s.Relationship=l,e.file(i,t.build(a))}async function RAn(e,t,n){const r=await e.file("[Content_Types].xml")?.async("string");if(!r||n.size===0)return;const i=t.parse(r),o=i.Types,a=hE(o.Override);for(const s of n){const l=`/${s}`,c=a.find(u=>u["@_PartName"]===l);c?c["@_ContentType"]=ske:a.push({"@_PartName":l,"@_ContentType":ske})}o.Override=a,e.file("[Content_Types].xml",t.build(i))}function LAn(e){const t=e.match(/^(?<dir>.*)\/_rels\/(?<file>[^/]+)\.rels$/u);return t?.groups?`${t.groups.dir}/${t.groups.file}`:void 0}function Jet(e){const t=e.lastIndexOf("/");return`${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function NAn(e){return e==="ppt/presentation.xml"?"presentation":/^ppt\/slides\/slide\d+\.xml$/u.test(e)?"slide":"part"}function FAn(e){return e==="presentation"?"ppt/presentation.xml":void 0}function OAn(e,t){const n=e.split("/").slice(0,-1),r=t.split("/");for(;n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...n.map(()=>".."),...r].join("/")}function BAn(e){const t=new Set(e.map(r=>String(r["@_Id"]??"")));let n=1;for(;t.has(`rId${n}`);)n+=1;return`rId${n}`}function jAn(e){return e.file(/^ppt\/tags\/tag\d+\.xml$/u).reduce((t,n)=>Math.max(t,Number(n.name.match(/tag(\d+)\.xml$/u)?.[1]??0)),0)}function hE(e){return e==null?[]:Array.isArray(e)?e:[e]}function UAn(e){if(e===void 0)return!1;const t=e&&typeof e=="object"?e["@_val"]:void 0;return t==null||t===""?!0:!(t==="0"||t==="false")}function zAn(e,t,n){if(t===void 0)return!1;const r=Object.keys(e).find(s=>n(s)==="delete");if(UAn(r?e[r]:void 0)===t)return!1;const i={"@_val":t?"1":"0"};if(r)return e[r]=i,!0;const o=Object.entries(e),a=o.findIndex(([s])=>{const l=n(s);return l!=="axId"&&l!=="scaling"&&!s.startsWith("@_")});o.splice(a===-1?o.length:a,0,["c:delete",i]);for(const s of Object.keys(e))delete e[s];for(const[s,l]of o)e[s]=l;return!0}var $An=new Set(["numFmt","majorTickMark","minorTickMark","tickLblPos","spPr","txPr","crossAx","crosses","crossesAt","auto","lblAlgn","lblOffset","tickLblSkip","tickMarkSkip","noMultiLvlLbl","dispUnits","majorUnit","minorUnit","baseTimeUnit","majorTimeUnit","minorTimeUnit"]);function cke(e,t){for(const[n,r]of Object.entries(e))if(["r","fld"].includes(t(n))){for(const i of Array.isArray(r)?r:[r])if(i&&typeof i=="object"&&!Array.isArray(i)&&$o(i,"t",t))return[n,i]}}function HAn(e,t,n){const r=$o(e,"tx",n)??"c:tx",i=e[r],o=[];if(i&&typeof i=="object"&&Aw(i,n,o),o.join("")===t)return;const a=i&&typeof i=="object"?$o(i,"rich",n):void 0,s=a?i[a]:void 0;if(!s||typeof s!="object"||Array.isArray(s)){const S=_ne(t)["c:tx"];r in e?e[r]=S:K3(e,0,r,S);return}const l=$o(s,"p",n)??"a:p",c=s[l],u=(Array.isArray(c)?c:[c]).filter(S=>!!S&&typeof S=="object"&&!Array.isArray(S)),d=u.find(S=>cke(S,n))??u[0]??{},p=cke(d,n),h=p?.[1]??{},f=p?p[0].replace(/[^:]+$/u,"r"):"a:r",m=$o(h,"rPr",n),g=p&&n(p[0])==="r"?{...h}:m?{[m]:h[m]}:{},y=$o(h,"t",n)??"a:t",v=h[y],b=v&&typeof v=="object"&&!Array.isArray(v)?v:void 0;g[y]=b?{...b,"#text":t}:t;const w=Object.entries(d);s[l]=Object.fromEntries([...w.filter(([S])=>S.startsWith("@_")||n(S)==="pPr"),[f,g],...w.filter(([S])=>n(S)==="endParaRPr")])}function _ne(e){return{"c:tx":{"c:rich":{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:r":{"a:t":e}}}},"c:overlay":{"@_val":"0"}}}function GAn(e,t,n){const r=Object.keys(e),i=r.findIndex(s=>$An.has(n(s))),o=r.map(s=>[s,e[s]]),a=i===-1?o.length:i;o.splice(a,0,["c:title",t]);for(const s of r)delete e[s];for(const[s,l]of o)e[s]=l}function VAn(e,t,n){if(t===void 0)return;const r=$o(e,"title",n);if(t===""){r&&delete e[r];return}if(r){const i=e[r];i&&typeof i=="object"&&!Array.isArray(i)?HAn(i,t,n):e[r]=_ne(t);return}GAn(e,_ne(t),n)}function WAn(e,t,n){const r={};return e.fontSize!==void 0&&(r["@_sz"]=String(Math.round(e.fontSize*100))),e.fontBold!==void 0&&(r["@_b"]=e.fontBold?"1":"0"),e.fontColor&&(r["a:solidFill"]=t["a:solidFill"],CM(r,"a:solidFill",e.fontColor,n)),e.fontFamily&&(r["a:latin"]={"@_typeface":e.fontFamily}),t["a:ea"]&&(r["a:ea"]=t["a:ea"]),r}function XAn(e,t,n,r){if(!(t.fontFamily!==void 0||t.fontSize!==void 0||t.fontBold!==void 0||t.fontColor!==void 0))return;const o=$o(e,"title",n);if(!o)return;const a={...e[o]??{}},s=$o(a,"txPr",n)??"c:txPr",l={...a[s]??{}};l[$o(l,"bodyPr",n)??"a:bodyPr"]||(l["a:bodyPr"]={}),l[$o(l,"lstStyle",n)??"a:lstStyle"]||(l["a:lstStyle"]={});const c=$o(l,"p",n)??"a:p",u=l[c],d={...(Array.isArray(u)?u[0]:u)??{}},p=$o(d,"pPr",n)??"a:pPr",h={...Oi(d,p,"first")},f=$o(h,"defRPr",n)??"a:defRPr",m=h[f]??{};h[f]={...m,...WAn(t,m,r)},d[p]=h,l[c]=d,a[s]=l,e[o]=a}function uke(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function qAn(e){if(!e)return"c";const t=e.indexOf(":");return t===-1?"c":e.slice(0,t)}function KAn(e,t,n){if(t===void 0)return;const r=uke(e,"clrMapOvr",n);if(t===null||Object.keys(t).length===0){r&&delete e[r];return}const i={};for(const[c,u]of Object.entries(t))i[`@_${c}`]=u;if(r){e[r]=i;return}const o=uke(e,"chart",n),a=qAn(o),s=Object.entries(e);for(const c of Object.keys(e))delete e[c];let l=!1;for(const[c,u]of s)!l&&n(c)==="chart"&&(e[`${a}:clrMapOvr`]=i,l=!0),e[c]=u;l||(e[`${a}:clrMapOvr`]=i)}function C9(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function Qet(e,t){return Object.keys(e).filter(n=>t(n)!=="ser").map(n=>[n,e[n]])}function ett(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function YAn(e,t){const n=Object.keys(e).filter(l=>t(l).endsWith("Chart"));if(n.length===0)return;const r=n[0],i=new Map;for(const l of n){const c=e[l];c&&i.set(t(l),Qet(c,t))}if(n.length===1)return{primaryKey:r,containerChildren:i};const o=e[r];if(!o)return{primaryKey:r,containerChildren:i};const a=C9(o,"ser",t)??"c:ser",s=[];for(const l of n){const c=e[l];if(!c)continue;const u=C9(c,"ser",t);u&&s.push(...ett(c[u])),l!==r&&delete e[l]}return o[a]=s.length===1?s[0]:s,{primaryKey:r,containerChildren:i}}function ZAn(e,t){return e.map(n=>u$(n.seriesChartType??t))}function JAn(e,t,n,r,i,o,a){const s=ZAn(n,r);if(s.some(w=>w===void 0))return!1;const l=s;if(new Set(l).size<=1)return!1;const u=e[t];if(!u)return!1;const d=C9(u,"ser",i)??"c:ser",p=ett(u[d]);if(p.length!==n.length)return!1;const h=Qet(u,i),f=new Map,m=[];for(let w=0;w<p.length;w++){const S=l[w];f.has(S)||(f.set(S,[]),m.push(S)),f.get(S).push(p[w])}const g=Object.keys(e),y=g.map(w=>[w,e[w]]),v=g.indexOf(t),b=[];for(const w of m){const S={};for(const[A,E]of a?.get(w)??h)S[A]=JSON.parse(JSON.stringify(E));const T=f.get(w);S[d]=T.length===1?T[0]:T,QAn(S,n.filter((A,E)=>l[E]===w),o,i),Hqe(S,w,i),Pw(S,w,i),b.push([`c:${w}`,S])}y.splice(v,1,...b);for(const w of g)delete e[w];for(const[w,S]of y)e[w]=S;return!0}function QAn(e,t,n,r){const i=new Set(t.map(c=>c.axisId).filter(c=>c!==void 0));if(i.size!==1)return;const o=[...i][0],s=n?.find(c=>c.axisId===o)?.crossAxisId??n?.find(c=>c.crossAxisId===o)?.axisId;if(o===void 0||s===void 0)return;const l=C9(e,"axId",r)??"c:axId";e[l]=[{"@_val":String(s)},{"@_val":String(o)}]}function dke(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function pke(e){return e.map((t,n)=>({"@_idx":String(n),"c:v":t}))}function eEn(e){const t=e.replace(/Chart$/u,"");return`filtered${t.charAt(0).toUpperCase()}${t.slice(1)}Series`}function tEn(e,t){const n=e.categories??t,r={"c:idx":{"@_val":String(e.idx)},"c:order":{"@_val":String(e.order)}};return e.name!==void 0&&(r["c:tx"]={"c:v":e.name}),n.length>0&&(r["c:cat"]={"c:strLit":{"c:ptCount":{"@_val":String(n.length)},"c:pt":pke(n)}}),e.values&&(r["c:val"]={"c:numLit":{"c:formatCode":"General","c:ptCount":{"@_val":String(e.values.length)},"c:pt":pke(e.values.map(String))}}),e.uniqueId&&(r["c:extLst"]={"c:ext":{"@_uri":"{C3380CC4-5D6E-409C-BE32-E72D297353CC}","@_xmlns:c16":"http://schemas.microsoft.com/office/drawing/2014/chart","c16:uniqueId":{"@_val":e.uniqueId}}}),r}function nEn(e,t,n){const r=Ude(e,n);return!t||t.length===0?!r||r.length===0:!r||r.length!==t.length?!1:t.every((i,o)=>{const a=r[o];return i.idx===a.idx&&i.order===a.order&&i.name===a.name&&i.uniqueId===a.uniqueId&&JSON.stringify(i.values??null)===JSON.stringify(a.values??null)&&JSON.stringify(i.categories??null)===JSON.stringify(a.categories??null)})}function rEn(e,t,n,r,i){const o=dke(e,"extLst",i)??"c:extLst",a={...e[o]??{}},s=dke(a,"ext",i),l=s?Array.isArray(a[s])?[...a[s]]:[a[s]]:[],c=l.filter(h=>h["@_uri"]!==UO),u={...l.find(h=>h["@_uri"]===UO)??{}};for(const h of Object.keys(u))/^filtered.*series$/iu.test(i(h))&&delete u[h];if(t&&t.length>0){u["@_uri"]=UO,u["@_xmlns:c15"]="http://schemas.microsoft.com/office/drawing/2012/chart";const h=t.map(f=>tEn(f,n));u[`c15:${eEn(r)}`]={"c15:ser":h.length===1?h[0]:h}}const p=Object.keys(u).some(h=>!h.startsWith("@_")&&!h.startsWith("xmlns"))?[...c,u]:c;if(p.length===0){delete e[o];return}a[s??"c:ext"]=p.length===1?p[0]:p,e[o]=a}function jg(e,t,n){if(!e)return;const r=Object.keys(e).find(i=>n(i)===t);return r?e[r]:void 0}function iEn(e,t,n,r){const i=Object.keys(e).find(s=>t(s)==="legendEntry"),o=i?e[i]:void 0;return(o?Array.isArray(o)?o:[o]:[]).flatMap(s=>{const l=s,c=Number.parseInt(String(jg(l,"idx",t)?.["@_val"]??""),10);if(!Number.isFinite(c)||c<0)return[];const u={index:c},d=jg(l,"delete",t);if(d){const m=d["@_val"];u.deleted=m!=="0"&&m!=="false"}const p={getChildByLocalName:(m,g)=>jg(m,g,t)},h=zp(jg(l,"txPr",t),p),f=Ld(h,p,{parseColor:n},r);return f&&(u.textStyle=f),[u]})}function hke(e,t,n,r){if(t in e){e[t]=n;return}const i=Object.entries(e),o=i.findIndex(([a])=>r(a)==="extLst");i.splice(o<0?i.length:o,0,[t,n]);for(const a of Object.keys(e))delete e[a];for(const[a,s]of i)e[a]=s}function oEn(e,t,n){const r=t?e[t]:void 0,i=r?jg(r,"p",n):void 0,o=i?jg(i,"pPr",n):void 0;return o?jg(o,"defRPr",n):void 0}function fke(e,t,n,r){if(!t)return;const i=Object.keys(e).find(d=>n(d)==="legendEntry"),o=i?e[i]:void 0,a=o?Array.isArray(o)?o:[o]:[],s=new Map(a.map(d=>[Number(jg(d,"idx",n)?.["@_val"]),d])),l=[...a];for(const d of t){let p=s.get(d.index);p||(p={"c:idx":{"@_val":String(d.index)}},l.push(p));const h=Object.keys(p).find(g=>n(g)==="delete"),f=Object.keys(p).find(g=>n(g)==="txPr"),m=jz(d.textStyle,oEn(p,f,n),r);m?(h&&delete p[h],hke(p,f??"c:txPr",m,n)):d.deleted!==void 0&&(f&&delete p[f],hke(p,h??"c:delete",{"@_val":d.deleted?"1":"0"},n))}if(l.length===0)return;if(i){e[i]=l;return}const c=Object.entries(e),u=c.findIndex(([d])=>n(d)!=="legendPos");c.splice(u<0?c.length:u,0,["c:legendEntry",l]);for(const d of Object.keys(e))delete e[d];for(const[d,p]of c)e[d]=p}function mke(e,t,n,r,i,o=!1){const a=Object.keys(e),s=a.findIndex(u=>i(u)===r),l=a.map(u=>[u,e[u]]),c=s===-1?o?0:l.length:s+1;l.splice(c,0,[t,n]);for(const u of a)delete e[u];for(const[u,d]of l)e[u]=d}function aEn(e,t,n,r){const i=Object.keys(e).find(a=>n(a)==="legend");if(t.hasLegend===!1){i&&delete e[i];return}if(t.hasLegend!==!0&&t.legendEntries===void 0)return;const o=i?e[i]:void 0;if(!o){mke(e,"c:legend",{"c:legendPos":{"@_val":t.legendPosition??"r"},"c:overlay":{"@_val":"0"}},"plotArea",n);const a=e["c:legend"];fke(a,t.legendEntries,n,r);return}if(t.legendPosition!==void 0){const a=Object.keys(o).find(s=>n(s)==="legendPos");a?o[a]["@_val"]=t.legendPosition:mke(o,"c:legendPos",{"@_val":t.legendPosition},"__none__",n,!0)}fke(o,t.legendEntries,n,r)}var gke=["grouping","varyColors","ser","dLbls","dropLines","hiLowLines","upDownBars","marker","smooth","gapWidth","gapDepth","shape","axId","extLst"];function Dne(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function sEn(e,t,n,r){const i=Dne(e,t,r);if(i){e[i]=n;return}const o=Object.entries(e),a=gke.indexOf(t),s=o.findIndex(([l])=>{const c=gke.indexOf(r(l));return c>=0&&c>a});o.splice(s<0?o.length:s,0,[`c:${t}`,n]);for(const l of Object.keys(e))delete e[l];for(const[l,c]of o)e[l]=c}function xke(e,t,n,r,i){if(n===void 0)return;const o=Dne(e,t,r);if(n===null){o&&delete e[o];return}const s={...o?e[o]:void 0};if(n.color||n.width!==void 0||n.dashStyle){const c=Dne(s,"spPr",r)??"c:spPr";s[c]=Qp(s[c],{strokeColor:n.color,strokeWidth:n.width,strokeDashStyle:n.dashStyle},r,i)}sEn(e,t,s,r)}var lEn=new Set(["noFill","gradFill","blipFill","pattFill","grpFill"]);function Gv(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function cEn(e,t,n,r){const i=Object.keys(e),o=i.findIndex(l=>r(l)==="ln"),a=i.map(l=>[l,e[l]]),s=o===-1?a.length:o;a.splice(s,0,[t,n]);for(const l of i)delete e[l];for(const[l,c]of a)e[l]=c}function uEn(e,t,n){const r=Object.keys(e),i=r.map(o=>[o,e[o]]);for(const o of r)delete e[o];e[t]=n;for(const[o,a]of i)e[o]=a}function yke(e,t,n,r,i){const o=t.replace(/^#/u,"");if(n){const c=Gv(e,"ln",r)??"a:ln",u=e[c]??{},d=!!e[c],p=Gv(u,"noFill",r);p&&delete u[p];const h=Gv(u,"solidFill",r)??"a:solidFill",f=u[h],m=uT(f,f?i(f):void 0,o);f?u[h]=m:uEn(u,h,m),d||(e[c]=u);return}const a=Gv(e,"solidFill",r)??"a:solidFill",s=e[a],l=uT(s,s?i(s):void 0,o);if(s){const c=Gv(e,"noFill",r);c&&delete e[c],e[a]=l}else{for(const c of Object.keys(e))lEn.has(r(c))&&delete e[c];cEn(e,a,l,r)}}var dEn=new Set(["invertIfNegative","pictureOptions","marker","explosion","dPt","dLbls","trendline","errBars","cat","val","xVal","yVal","smooth","shape","bubbleSize","bubble3D","extLst"]);function ttt(e,t){const n=Gv(e,"spPr",t);if(n)return e[n];const r={},i=Object.entries(e),o=i.findIndex(([a])=>dEn.has(t(a)));i.splice(o===-1?i.length:o,0,["c:spPr",r]);for(const a of Object.keys(e))delete e[a];for(const[a,s]of i)e[a]=s;return r}function vke(e,t,n,r={}){if(r.lineDrawn)return!1;const i=Gv(e,"spPr",n);if(!i&&!t)return!1;const o=i?e[i]:ttt(e,n);return Uce(o,t,n,r)}function ntt(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function R$(e,t,n,r){const i=ntt(e,t,r);if(n===void 0){i&&delete e[i];return}i?e[i]={...e[i],"@_val":n}:e[`c:${t}`]={"@_val":n}}function pEn(e,t,n,r){R$(e,"shape",n,r),Pw(e,t,r)}function hEn(e,t,n,r){R$(e,"gapDepth",n===void 0?void 0:String(n),r),Pw(e,t,r)}function fEn(e,t,n,r){R$(e,"radarStyle",n,r),Pw(e,t,r)}function mEn(e,t,n,r){R$(e,"wireframe",n===void 0?void 0:n?"1":"0",r),Pw(e,t,r)}var gEn=new Set(["extLst"]);function xEn(e,t,n){const r=ntt(e,"shape",n);if(t===void 0){r&&delete e[r];return}if(r){e[r]={"@_val":t};return}const i=Object.keys(e),o=i.findIndex(l=>gEn.has(n(l))),a=i.map(l=>[l,e[l]]),s=o===-1?a.length:o;a.splice(s,0,["c:shape",{"@_val":t}]);for(const l of i)delete e[l];for(const[l,c]of a)e[l]=c}function Rne(e,t){const n=e==="c"?{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:r":{"a:t":t}}}:{"a:p":{"a:r":{"a:t":t}}},r={};return r[`${e}:rich`]=n,r}function yEn(e){const t={};return e.bold!==void 0&&(t["@_b"]=e.bold?"1":"0"),e.italic!==void 0&&(t["@_i"]=e.italic?"1":"0"),e.fontSize!==void 0&&(t["@_sz"]=String(Math.round(e.fontSize*100))),e.color&&(t["a:solidFill"]={"a:srgbClr":{"@_val":e.color.replace(/^#/u,"").toUpperCase()}}),Object.keys(t).length>0?t:void 0}function Lne(e,t){const n=t.map(a=>{const s=yEn(a);return{...s?{"a:rPr":s}:{},"a:t":a.text}}),r={"a:r":n.length===1?n[0]:n},i=e==="c"?{"a:bodyPr":{},"a:lstStyle":{},"a:p":r}:{"a:p":r},o={};return o[`${e}:rich`]=i,o}function vEn(e,t,n){const r={};return n&&n.length>0?r[`${e}:tx`]=Lne(e,n):t!==void 0&&(r[`${e}:tx`]=Rne(e,t)),e==="c"&&(r["c:overlay"]={"@_val":"0"}),r}function bEn(e,t){if(e.length===0)return;const n=new Array(e.length).fill("");let r=0,i=0;for(;i<e.length;){const o=e[i]??"";if(t.startsWith(o,r)){n[i]=o,r+=o.length,i++;continue}let a=-1,s=-1;for(let l=i+1;l<e.length;l++){const c=e[l];if(!c)continue;const u=t.indexOf(c,r);if(u!==-1){a=u,s=l;break}}if(s===-1)return;n[i]=t.slice(r,a);for(let l=i+1;l<s;l++)n[l]="";r=a,i=s}return r<t.length&&(n[n.length-1]+=t.slice(r)),n}function wEn(e,t){const n=bEn(e.map(r=>r.text),t);return n?e.map((r,i)=>({...r,text:n[i]??""})):[{...e[0],text:t}]}function rtt(e,t,n,r={prefix:"c"}){const{prefix:i}=r,o=$o(e,"title",n);if(t.hasTitle===!1||t.title===""&&t.hasTitle!==!0)return o&&delete e[o],i==="c"&&u2e(e,!0,n),!1;if(t.title===void 0&&t.hasTitle!==!0)return o!==void 0;const s=t.titleRuns?.[0]?.text,l=t.title!==void 0&&s!==void 0&&t.title!==s;let c=i==="c"&&t.titleRuns&&t.titleRuns.length>0&&!l?t.titleRuns:void 0;const u=t.titleRuns;i==="c"&&l&&t.title!==void 0&&u&&u.length>1&&(c=wEn(u,t.title));let d=o?e[o]:void 0;if(c&&d&&typeof d=="object"){const p=[];Aw(d,n,p);const h=c.map(f=>f.text);p.length===h.length&&p.every((f,m)=>f===h[m])&&(c=void 0)}if(!d||typeof d!="object")d=vEn(i,t.title,c),o?e[o]=d:K3(e,0,`${i}:title`,d);else if(c){const p=$o(d,"tx",n);p?d[p]=Lne(i,c):K3(d,0,`${i}:tx`,Lne(i,c))}else if(t.title!==void 0&&!XGe(d,t.title,n)){const p=$o(d,"tx",n);p?d[p]=Rne(i,t.title):K3(d,0,`${i}:tx`,Rne(i,t.title))}return i==="c"&&u2e(e,!1,n),!0}function Tl(e,t,n){return Object.keys(e).find(r=>n(r)===t)}var bke={spPr:["txPr","extLst"],txPr:["extLst"]};function wke(e,t,n,r,i,o){if(n){e[n]=r;return}const a=Object.keys(e),s=a.findIndex(c=>i.includes(o(c))),l=a.map(c=>[c,e[c]]);l.splice(s===-1?l.length:s,0,[t,r]);for(const c of a)delete e[c];for(const[c,u]of l)e[c]=u}function Nne(e,t,n){const r={};return e.fontSize!==void 0&&(r["@_sz"]=String(Math.round(e.fontSize*100))),e.fontBold!==void 0&&(r["@_b"]=e.fontBold?"1":"0"),e.fontColor&&(r["a:solidFill"]=t["a:solidFill"],CM(r,"a:solidFill",e.fontColor,n)),e.fontFamily&&(r["a:latin"]={"@_typeface":e.fontFamily}),r}function Ske(e){return Array.isArray(e)?e:e&&typeof e=="object"?[e]:[]}function SEn(e,t,n,r){const i=Tl(e,"tx",n),o=i?e[i]:void 0,a=o?Tl(o,"rich",n):void 0,s=a&&o?o[a]:void 0;if(!o||!s||!i||!a)return;if(!(t.fontFamily!==void 0||t.fontSize!==void 0||t.fontBold!==void 0||t.fontColor!==void 0))return i;const c=Tl(s,"p",n)??"a:p",u=Ske(s[c]).map(h=>{const f={...h},m=Tl(f,"pPr",n)??"a:pPr",g={...Oi(f,m,"first")},y=Tl(g,"defRPr",n)??"a:defRPr",v=g[y]??{};g[y]={...v,...Nne(t,v,r)},f[m]=g;const b=Tl(f,"r",n);if(b){const w=Ske(f[b]).map(S=>{const T=Tl(S,"rPr",n)??"a:rPr",A=S[T]??{},E={...S};return Oi(E,T,"first"),E[T]={...A,...Nne(t,A,r)},E});f[b]=Array.isArray(f[b])?w:w[0]}return f}),d={...s};d[c]=Array.isArray(s[c])?u:u[0];const p={...o};return p[a]=d,e[i]=p,i}function CEn(e,t,n,r={prefix:"c"},i){const o=t.fontFamily!==void 0||t.fontSize!==void 0||t.fontBold!==void 0||t.fontColor!==void 0;if(!o&&t.spPr===void 0)return;const{prefix:a}=r,s=Tl(e,"title",n);if(!s)return;const l={...e[s]??{}};if(t.spPr!==void 0){const u=Tl(l,"spPr",n);if(t.spPr===null)u&&delete l[u];else{const d=Qp(u?l[u]:void 0,t.spPr,n,i);wke(l,`${a}:spPr`,u,d,bke.spPr,n)}}const c=SEn(l,t,n,i);if(o&&c===void 0){const u=Tl(l,"txPr",n),d=u??`${a}:txPr`,p={...l[d]??{}};p[Tl(p,"bodyPr",n)??"a:bodyPr"]||(p["a:bodyPr"]={}),p[Tl(p,"lstStyle",n)??"a:lstStyle"]||(p["a:lstStyle"]={});const h=Tl(p,"p",n)??"a:p",f=p[h],m={...(Array.isArray(f)?f[0]:f)??{}},g=Tl(m,"pPr",n)??"a:pPr",y={...Oi(m,g,"first")},v=Tl(y,"defRPr",n)??"a:defRPr",b=y[v]??{};y[v]={...b,...Nne(t,b,i)},m[g]=y,p[h]=m,wke(l,d,u,p,bke.txPr,n)}e[s]=l}function TEn(e,t,n,r){if(!t)return;const i=e.getChildByLocalName(t,n?"numRef":"strRef"),o=i?e.getScalarChildByLocalName(i,"f"):void 0;return o?{formula:o,isNumeric:n,values:r}:void 0}function AEn(){return new hw({ignoreAttributes:!1,attributeNamePrefix:"@_",trimValues:!1,tagValueProcessor:(e,t)=>pz(e)?t:t.trim()})}function EEn(){return new Na({ignoreAttributes:!1,attributeNamePrefix:"@_",suppressBooleanAttributes:!1,format:!1})}async function kEn(e,t){const n=new Map,r=e.file("xl/workbook.xml"),i=e.file("xl/_rels/workbook.xml.rels");if(!r||!i)return n;try{const o=t.parse(await r.async("string")),a=t.parse(await i.async("string")),s=new Map,l=Dt(a,"Relationships");for(const d of Su(l,"Relationship")){const p=lr(d,"Id"),h=lr(d,"Target");p&&h&&s.set(p,h)}const c=Dt(o,"workbook"),u=Dt(c,"sheets");for(const d of Su(u,"sheet")){const p=lr(d,"name"),h=lr(d,"r:id")??lr(d,"id"),f=h?s.get(h):void 0;p&&f&&n.set(p.toLowerCase(),MEn(f))}}catch{}return n}function MEn(e){return e.startsWith("/")?e.slice(1):`xl/${e}`}async function PEn(e,t){if(t.length===0)return{unresolved:0};let n;try{n=await La.loadAsync(e)}catch{return{unresolved:t.length}}const r=AEn(),i=await kEn(n,r),o=new Map;let a=0;for(const u of t){const d=h9t(u.formula),p=d?i.get(d.sheetName.toLowerCase()):void 0,h=d?f9t(d,u.values.length):void 0;if(!d||!p||!h){a+=1;continue}const f=o.get(p)??[];f.push({refs:h,values:u.values,isNumeric:u.isNumeric}),o.set(p,f)}const s=EEn();let l=!1;for(const[u,d]of o){const p=n.file(u);if(!p){a+=d.length;continue}try{const h=r.parse(await p.async("string")),f=d.flatMap(({refs:m,values:g,isNumeric:y})=>m.map((v,b)=>({ref:v,isNumeric:y,value:g[b]})));tUe(h,f)&&(n.file(u,s.build(h)),l=!0)}catch{a+=d.length}}return l?{bytes:await n.generateAsync({type:"uint8array",compression:"DEFLATE",compressionOptions:{level:6}}),unresolved:a}:{unresolved:a}}function T9(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function A9(e){return e==null?[]:(Array.isArray(e)?e:[e]).filter(t=>!!t&&typeof t=="object")}function qq(e){return String(e["@_type"]??"")}function IEn(e,t,n){const r=T9(e,"lvl",n)??"cx:lvl",i=T9(t,"lvl",n),o=A9(e[r]),a=A9(i?t[i]:void 0).map((s,l)=>{const c=o[l];if(!c)return s;const u={};for(const d of Object.keys(c))d.startsWith("@_")&&d!=="@_ptCount"&&(u[d]=c[d]);return{...s,...u}});e[r]=a.length===1?a[0]:a}function Cke(e,t,n){for(const r of["strDim","numDim"]){const i=T9(e,r,n)??`cx:${r}`,o=T9(t,r,n),a=A9(e[i]),s=A9(o?t[o]:void 0);for(const l of s){const c=qq(l);let u=a.find(d=>qq(d)===c);!u&&r==="numDim"&&(u=a[0]),!u&&r==="strDim"&&c==="cat"&&(u=a.find(d=>qq(d)==="")),u?IEn(u,l,n):a.push(l)}a.length>0&&(e[i]=a.length===1?a[0]:a)}}function Zh(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function Sc(e,t,n){if(!e)return;const r=Zh(e,t,n),i=r?e[r]:void 0;return i&&typeof i=="object"&&!Array.isArray(i)?i:void 0}function Fne(e){return e==null?[]:(Array.isArray(e)?e:[e]).filter(t=>!!t&&typeof t=="object")}function M1(e,t,n,r,i){const o=Object.keys(e).map(s=>[s,e[s]]);let a=o.findIndex(([s])=>!s.startsWith("@_")&&r.includes(i(s)));a===-1&&(a=o.length),o.splice(a,0,[t,n]);for(const s of Object.keys(e))delete e[s];for(const[s,l]of o)e[s]=l}var itt=["spPr","valueColors","valueColorPositions","dataPt","dataLabels","dataId","layoutPr","axisId","extLst"];function _En(e,t,n){const r=Sc(e,"tx",n),i=Sc(r,"txData",n);if(r&&i){const a=Zh(i,"v",n)??"cx:v";i[a]=t;return}const o=Zh(e,"tx",n);o&&delete e[o],M1(e,"cx:tx",{"cx:txData":{"cx:v":t}},itt,n)}var DEn=["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"],REn=["ln","effectLst","effectDag","scene3d","sp3d","extLst"];function LEn(e,t){const r=Sc(Sc(Sc(e,"spPr",t),"solidFill",t),"srgbClr",t)?.["@_val"];return typeof r=="string"?r.toUpperCase():void 0}function NEn(e,t,n){const r=aTn(t);if(!r||t.color?.replace(/^#/u,"").toUpperCase()===LEn(e,n))return;const o=Sc(e,"spPr",n);if(!o){M1(e,"cx:spPr",r,itt.slice(1),n);return}for(const a of Object.keys(o))DEn.includes(n(a))&&delete o[a];M1(o,"a:solidFill",r["a:solidFill"],REn,n)}function FEn(e,t,n){if(t===void 0)return;const r=Zh(e,"dataLabels",n);if(!t){r&&delete e[r];return}r||M1(e,"cx:dataLabels",Met(),["dataId","layoutPr","axisId","extLst"],n)}function ott(e){let t=-1;for(const n of e){const r=Number.parseInt(String(n["@_id"]??""),10);Number.isFinite(r)&&r>t&&(t=r)}return t+1}function OEn(e,t,n,r,i){const o=Sc(e,"dataId",i),a=o?String(o["@_val"]??""):void 0,s=a!==void 0?t.find(u=>String(u["@_id"])===a):void 0;if(s){Cke(s,p5(n,r,Number(a)),i);return}const l=Zh(e,"data",i);if(l&&!o){const u=e[l];if(u&&typeof u=="object"&&!Array.isArray(u)){Cke(u,p5(n,r,0),i);return}}const c=ott(t);t.push(p5(n,r,c)),o?o["@_val"]=String(c):M1(e,"cx:dataId",{"@_val":String(c)},["layoutPr","axisId","extLst"],i)}function BEn(e,t,n){const r=t.style;if(!r||r.hasLegend===void 0)return;const i=Zh(e,"legend",n);if(!r.hasLegend){i&&delete e[i];return}const o=i?e[i]:void 0;if(o&&typeof o=="object"&&!Array.isArray(o)){r.legendPosition!==void 0&&(o["@_pos"]=Pne(r.legendPosition)["@_pos"]);return}i&&delete e[i];const a=Pne(r.legendPosition);M1(e,"cx:legend",a,["extLst"],n)}function jEn(e,t,n){const r=Sc(Sc(Sc(e,"chart",n),"plotArea",n),"plotAreaRegion",n),i=r?Zh(r,"series",n):void 0,o=r&&i?Fne(r[i])[0]:void 0,a=String(o?.["@_layoutId"]??"").toLowerCase(),s=t.series[0];return!a||!s?!1:ket(t,s).toLowerCase()!==a}function UEn(e,t,n){const r=Sc(e,"chart",n),i=Sc(r,"plotArea",n),o=Sc(i,"plotAreaRegion",n);if(!r||!o)return!1;const a=Zh(e,"chartData",n),s=(a?e[a]:void 0)??{},l=Zh(s,"data",n)??"cx:data",c=Fne(s[l]),u=Zh(o,"series",n)??"cx:series",d=Fne(o[u]),p=[];t.series.forEach((y,v)=>{const b=d[v];if(!b){const w=ott(c);c.push(p5(t,y,w)),p.push(Pet(t,y,w));return}y.name!==void 0&&_En(b,y.name,n),NEn(b,y,n),FEn(b,t.style?.hasDataLabels,n),OEn(b,c,t,y,n),p.push(b)});const h=y=>String(Sc(y,"dataId",n)?.["@_val"]),f=new Set(p.map(h)),m=new Set(d.slice(t.series.length).map(h)),g=c.filter(y=>{const v=String(y["@_id"]);return f.has(v)||!m.has(v)});return o[u]=p.length===1?p[0]:p,s[l]=g.length===1?g[0]:g,a||M1(e,"cx:chartData",s,["chart"],n),rtt(r,{title:t.title,hasTitle:t.style?.hasTitle},n,{prefix:"cx"}),BEn(r,t,n),!0}async function zEn(e,t,n,r,i){if(i.length===0||!r?.targetPath)return;const o=e.resolveImagePath(t,r.targetPath);if(!(o.includes("embeddings/")&&/\.xlsx$/iu.test(o))){e.reportWarning({code:"CHART_EXTERNAL_DATA_WRITEBACK_UNSUPPORTED",message:"Chart data changes were saved to the cached values only: the linked data source is external or not an embedded .xlsx workbook, so it was not updated.",severity:"info",scope:"save",slideId:n,xmlPath:t});return}const s=e.zip.file(o);if(!s){e.reportWarning({code:"CHART_EMBEDDED_WORKBOOK_MISSING",message:"Chart data changes were saved to the cached values only: the referenced embedded workbook was not found in the package.",severity:"warning",scope:"save",slideId:n,xmlPath:o});return}let l;try{l=await s.async("uint8array")}catch{e.reportWarning({code:"CHART_EMBEDDED_WORKBOOK_UNREADABLE",message:"Chart data changes were saved to the cached values only: the referenced embedded workbook could not be read.",severity:"warning",scope:"save",slideId:n,xmlPath:o});return}const c=await PEn(l,i);c.bytes&&e.zip.file(o,c.bytes),c.unresolved>0&&e.reportWarning({code:"CHART_EMBEDDED_WORKBOOK_PARTIAL_WRITEBACK",message:`${c.unresolved} chart data update(s) could not be matched to a cell in the linked workbook and were saved to the cached values only.`,severity:"info",scope:"save",slideId:n,xmlPath:o})}var Tke="http://schemas.openxmlformats.org/drawingml/2006/chart",Ake="http://schemas.microsoft.com/office/drawing/2014/chartex",Eke="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function ppe(e){return e==null?[]:(Array.isArray(e)?e:[e]).filter(t=>!!t&&typeof t=="object")}function $En(e,t){let n=1;for(;e.file(`${t}/chart${n}.xml`);)n+=1;return`${t}/chart${n}.xml`}function HEn(e,t){if(t.startsWith("/"))return t.slice(1);const n=e.split("/").slice(0,-1);for(const r of t.split("/"))r===".."?n.pop():r!=="."&&r!==""&&n.push(r);return n.join("/")}function att(e,t){const n=e.split("/").slice(0,-1),r=t.split("/");let i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>".."),...r.slice(i)].join("/")}async function stt(e,t,n){const r=await e.zip.file("[Content_Types].xml")?.async("string");if(!r)return;const i=e.parser.parse(r),o=i.Types??{},a=ppe(o.Override),s=`/${t}`;a.some(l=>String(l["@_PartName"])===s)||(a.push({"@_PartName":s,"@_ContentType":n}),o.Override=a,i.Types=o,e.zip.file("[Content_Types].xml",e.builder.build(i)))}async function GEn(e,t,n){const r=t.lastIndexOf("/"),i=`${t.slice(0,r+1)}_rels/${t.slice(r+1)}.rels`,o=await e.zip.file(i)?.async("string");if(!o)return;const a=e.parser.parse(o),s=a.Relationships,l=ppe(s?.Relationship),c=l.find(u=>String(u["@_Id"])===n.relationshipId)??l.find(u=>HEn(t,String(u["@_Target"]??""))===n.oldPartPath);if(!(!c||!s))return c["@_Type"]=n.relationshipType,c["@_Target"]=att(t,n.newPartPath),delete c["@_TargetMode"],s.Relationship=l.length===1?l[0]:l,e.zip.file(i,e.builder.build(a)),String(c["@_Id"])}function VEn(e,t,n){for(const r of Object.keys(e))delete e[r];e["@_uri"]=n?Ake:Tke,n?e["cx:chart"]={"@_xmlns:cx":Ake,"@_xmlns:r":Eke,"@_r:id":t}:e["c:chart"]={"@_xmlns:c":Tke,"@_xmlns:r":Eke,"@_r:id":t}}function One(e,t,n,r){if(!e||typeof e!="object")return 0;if(Array.isArray(e))return e.reduce((a,s)=>a+One(s,t,n,r),0);const i=e;let o=0;for(const a of Object.keys(i)){if(a.startsWith("@_"))continue;const s=i[a];if(r(a)==="graphicData"&&s&&typeof s=="object"){for(const l of ppe(s)){const c=Object.keys(l).find(d=>r(d)==="chart"),u=c?l[c]:void 0;u&&String(u["@_r:id"])===t&&(VEn(l,t,n),o+=1)}continue}o+=One(s,t,n,r)}return o}async function WEn(e,t,n,r){const i=await e.zip.file(t)?.async("string");if(!i)return 0;const o=e.parser.parse(i),a=One(o,n,r,e.getLocalName);return a>0&&e.zip.file(t,e.builder.build(o)),a}var XEn="application/vnd.ms-office.chartex+xml",qEn="application/vnd.openxmlformats-officedocument.drawingml.chart+xml",KEn="http://schemas.microsoft.com/office/2014/relationships/chartEx",YEn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart";function ZEn(e,t){const n=Object.keys(e);if(n.some(l=>t(l)==="chartData"))return"chartEx";const r=n.find(l=>t(l)==="chart"),i=r?e[r]:void 0,o=i?Object.keys(i).find(l=>t(l)==="plotArea"):void 0,a=o&&i?i[o]:void 0;return(a&&typeof a=="object"?Object.keys(a):[]).some(l=>{const c=t(l);return c==="plotAreaRegion"||c==="plotSurface"})?"chartEx":"chart"}function JEn(e){return _$(e)?"chartEx":u$(e.chartType)?"chart":void 0}async function QEn(e,t,n,r){const i=t.chartPartPath;if(!i)return;const o=r==="chartEx",a=o?dpe(t):Xet(t),s=$En(e.zip,o?"ppt/extendedCharts":"ppt/charts"),l=await GEn(e,n,{relationshipId:t.chartRelationshipId,oldPartPath:i,newPartPath:s,relationshipType:o?KEn:YEn});if(l)return e.zip.file(s,e.builder.build(a)),await stt(e,s,o?XEn:qEn),await WEn(e,n,l,o),t.chartPartPath=s,t.chartRelationshipId=l,s}function ekn(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function Ug(e,t){if(e)return Object.keys(e).find(n=>!n.startsWith("@_")&&ekn(n)===t)}function ltt(e,t){if(t===void 0)return;const n=Ug(e,"nvPicPr")??"cdr:nvPicPr",r=e[n]??{},i=Ug(r,"cNvPr")??"cdr:cNvPr",o=r[i]??{};o["@_descr"]=t,r[i]=o,e[n]=r}function tkn(e,t,n){const r=Ug(e,"spPr"),i=r?e[r]??e:e,o=Ug(i,"xfrm");if(!o)return;const a=i[o],s=Ug(a,"off")??"a:off",l=Ug(a,"ext")??"a:ext";a[s]={"@_x":String(Math.round(t.x)),"@_y":String(Math.round(t.y))},a[l]={"@_cx":String(Math.round(n.cx)),"@_cy":String(Math.round(n.cy))}}function ctt(e,t,n,r){const i=Ug(e,"spPr"),o=i?e[i]??e:e,a=Ug(o,"xfrm");if(!a&&!(!!t||!!n||!!r))return;const l=a?o[a]:{};t?l["@_rot"]=String(Math.round(t*6e4)):delete l["@_rot"],n?l["@_flipH"]="1":delete l["@_flipH"],r?l["@_flipV"]="1":delete l["@_flipV"],o[a??"a:xfrm"]=l,i&&(e[i]=o)}var nkn={off:{x:0,y:0},ext:{cx:0,cy:0},chOff:{x:0,y:0},chExt:{cx:0,cy:0}};function Bne(e){return e.startsWith("#")?e.slice(1):e}function rkn(e){const t={};let n=!1;return e.fontSize!==void 0&&(t["@_sz"]=String(Math.round(e.fontSize*100)),n=!0),e.bold&&(t["@_b"]="1",n=!0),e.italic&&(t["@_i"]="1",n=!0),e.color&&(t["a:solidFill"]={"a:srgbClr":{"@_val":Bne(e.color)}},n=!0),n?t:void 0}function ikn(e){const t={};e.align&&(t["a:pPr"]={"@_algn":e.align});const n=rkn(e);return t["a:r"]={...n?{"a:rPr":n}:{},"a:t":e.text},t}function okn(e){if(!e||e.length===0)return;const t=e.map(ikn);return{"a:bodyPr":{},"a:lstStyle":{},"a:p":t.length===1?t[0]:t}}function akn(e,t){const n=t?{...t}:{};return e.rotation&&(n["@_rot"]=String(Math.round(e.rotation*6e4))),e.flipH&&(n["@_flipH"]="1"),e.flipV&&(n["@_flipV"]="1"),Object.keys(n).length>0?n:void 0}function utt(e,t,n){const r={},i=akn(e,n);if(i&&(r["a:xfrm"]=i),t&&(r["a:prstGeom"]={"@_prst":e.prst??"rect","a:avLst":{}}),e.fill&&(r["a:solidFill"]={"a:srgbClr":{"@_val":Bne(e.fill)}}),e.stroke){const o={"a:solidFill":{"a:srgbClr":{"@_val":Bne(e.stroke)}}};e.strokeWidth!==void 0&&(o["@_w"]=String(Math.round(e.strokeWidth*12700))),r["a:ln"]=o}return r}function dtt(e,t,n){const r={"cdr:nvSpPr":{"cdr:cNvPr":{"@_id":String(t),"@_name":`Shape ${t}`},"cdr:cNvSpPr":{}},"cdr:spPr":utt(e,!0,n)},i=e.kind==="sp"?okn(e.paragraphs):void 0;return i&&(r["cdr:txBody"]=i),r}function ptt(e,t,n){return{"cdr:nvCxnSpPr":{"cdr:cNvPr":{"@_id":String(t),"@_name":`Connector ${t}`},"cdr:cNvCxnSpPr":{}},"cdr:spPr":utt(e,!1,n)}}function htt(e,t){return{"a:off":{"@_x":String(Math.round(e.x)),"@_y":String(Math.round(e.y))},"a:ext":{"@_cx":String(Math.round(t.cx)),"@_cy":String(Math.round(t.cy))}}}function kke(e){return htt(e.off,e.ext)}function skn(e){const t={...htt(e.off,e.ext),"a:chOff":{"@_x":String(Math.round(e.chOff.x)),"@_y":String(Math.round(e.chOff.y))},"a:chExt":{"@_cx":String(Math.round(e.chExt.cx)),"@_cy":String(Math.round(e.chExt.cy))}};return e.rotation&&(t["@_rot"]=String(Math.round(e.rotation*6e4))),e.flipH&&(t["@_flipH"]="1"),e.flipV&&(t["@_flipV"]="1"),t}function lkn(e,t,n){if(e.kind==="grpSp")return e.rawXml?{key:"grpSp",node:zn(e.rawXml)??{}}:{key:"grpSp",node:ftt(e,t,n)};const r=(e.kind==="pic"||e.kind==="graphicFrame")&&e.rawXml?e.kind:void 0;if(r){const i=zn(e.rawXml)??{};return tkn(i,e.off,e.ext),ctt(i,e.rotation,e.flipH,e.flipV),r==="pic"&&ltt(i,e.altText),{key:r,node:i}}return e.kind==="cxnSp"?{key:"cxnSp",node:ptt(e,t,kke(e))}:{key:"sp",node:dtt(e,t,kke(e))}}function ckn(e,t,n){const r={sp:[],cxnSp:[],pic:[],grpSp:[],graphicFrame:[]};for(const i of t){const o=n.next++,{key:a,node:s}=lkn(i,o,n);r[a].push(s)}for(const i of["sp","cxnSp","pic","grpSp","graphicFrame"])r[i].length>0&&(e[`cdr:${i}`]=r[i].length===1?r[i][0]:r[i])}function ftt(e,t,n){const r=e.transform??nkn,i={"cdr:nvGrpSpPr":{"cdr:cNvPr":{"@_id":String(t),"@_name":`Group ${t}`},"cdr:cNvGrpSpPr":{}},"cdr:grpSpPr":{"a:xfrm":skn(r)}};return ckn(i,e.children??[],n),i}function ukn(e){const t={"cdr:from":{"cdr:x":String(e.from.x),"cdr:y":String(e.from.y)}};if(e.anchor==="rel"){const n=e.to??e.from;t["cdr:to"]={"cdr:x":String(n.x),"cdr:y":String(n.y)}}else{const n=e.ext??{cx:0,cy:0};t["cdr:ext"]={"@_cx":String(Math.round(n.cx)),"@_cy":String(Math.round(n.cy))}}return t}function Mke(e,t){const n=ukn(e),r=t.next++;if(e.kind==="grpSp")return n["cdr:grpSp"]=e.rawXml?zn(e.rawXml)??{}:ftt(e,r,t),n["cdr:clientData"]={},n;const i=(e.kind==="pic"||e.kind==="graphicFrame")&&e.rawXml?`cdr:${e.kind}`:void 0;if(i){const o=zn(e.rawXml)??{};ctt(o,e.rotation,e.flipH,e.flipV),e.kind==="pic"&&ltt(o,e.altText),n[i]=o}else e.kind==="cxnSp"?n["cdr:cxnSp"]=ptt(e,r):n["cdr:sp"]=dtt(e,r);return n["cdr:clientData"]={},n}function dkn(e){const t=e.filter(o=>o.anchor==="rel"),n=e.filter(o=>o.anchor==="abs"),r={next:2},i={"@_xmlns:cdr":"http://schemas.openxmlformats.org/drawingml/2006/chartDrawing","@_xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","@_xmlns:c":"http://schemas.openxmlformats.org/drawingml/2006/chart","@_xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"};if(t.length>0){const o=t.map(a=>Mke(a,r));i["cdr:relSizeAnchor"]=o.length===1?o[0]:o}if(n.length>0){const o=n.map(a=>Mke(a,r));i["cdr:absSizeAnchor"]=o.length===1?o[0]:o}return{"c:userShapes":i}}var pkn=new Set(["title","ctrtitle"]),hkn=new Set(["body","obj","subtitle","pic","chart","tbl","media","clipart","dgm"]);function Pke(e){const t=(e??"").trim().toLowerCase()||"body";return pkn.has(t)?"title":hkn.has(t)?"content":t}function fkn(e){switch(e.type){case"image":case"picture":return["pic","obj","body"];case"chart":return["chart","obj","body"];case"table":return["tbl","obj","body"];case"media":case"model3d":return["media","pic","obj","body"];case"smartArt":return["dgm","obj","body"];case"text":return["body","subtitle","obj"];default:return["obj","body"]}}function mkn(e,t,n){if(Pke(t.type)!==Pke(n.type))return-1;const r=Ike(t.type),i=Ike(n.type);let o=1;t.idx!==void 0&&t.idx===n.idx&&(o+=100),r===i&&(o+=50);const a=fkn(e).indexOf(i);return a>=0&&(o+=30-a*5),i==="obj"&&(o+=10),o}function Ike(e){return(e??"").trim().toLowerCase()||"body"}function gkn(e){for(const t of["p:nvSpPr","p:nvPicPr","p:nvGraphicFramePr"]){const r=e[t]?.["p:nvPr"];if(r)return r}}function xkn(e,t){const n=gkn(e);if(!n)return;const r=n["p:ph"]??{};n["p:ph"]=r,t.type?r["@_type"]=t.type:delete r["@_type"],t.idx!==void 0?r["@_idx"]=t.idx:delete r["@_idx"]}function ykn(e,t,n,r,i){const o=e["p:spPr"];if(!o)return;const a=o["a:xfrm"]??{};o["a:xfrm"]=a;const s=a["a:off"]??{};a["a:off"]=s,s["@_x"]=String(t),s["@_y"]=String(n);const l=a["a:ext"]??{};a["a:ext"]=l,l["@_cx"]=String(r),l["@_cy"]=String(i)}function vkn(e,t,n,r,i,o){if(r<=0||i<=0)return null;const a={};e.type&&(a["@_type"]=e.type),e.idx!==void 0&&(a["@_idx"]=e.idx);const s={"p:nvSpPr":{"p:cNvPr":{"@_id":o,"@_name":`Placeholder ${e.type||"content"}`},"p:cNvSpPr":{"a:spLocks":{"@_noGrp":"1"}},"p:nvPr":{"p:ph":a}},"p:spPr":{"a:xfrm":{"a:off":{"@_x":String(t),"@_y":String(n)},"a:ext":{"@_cx":String(r),"@_cy":String(i)}}},"p:txBody":{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:endParaRPr":{"@_lang":"en-US"}}}};return{type:"text",id:`ph-${e.type||"content"}-${e.idx??"0"}-${o}`,x:Math.round(t/jr),y:Math.round(n/jr),width:Math.round(r/jr),height:Math.round(i/jr),text:"",rawXml:s}}function bkn(e,t,n,r){const i=e["a:blip"],o=String(i?.["@_r:embed"]||i?.["@_r:link"]||""),a=o?t(o):void 0;if(!a)return;const s=e["a:tile"]!==void 0?"tile":"stretch";return a.startsWith("http://")||a.startsWith("https://")?r?{url:a,mode:s}:void 0:a.startsWith("data:")?{url:a,mode:s}:{url:n(a),mode:s}}var hpe="{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}",wkn="http://schemas.microsoft.com/office/drawing/2010/main",I_=e=>e.split(":").at(-1)??e;function WM(e,t){if(e)for(const n of Object.keys(e)){if(I_(n)!==t)continue;const r=e[n],i=Array.isArray(r)?r[0]:r;if(i&&typeof i=="object")return i}}function fpe(e,t){if(!e)return[];const n=[];for(const r of Object.keys(e)){if(I_(r)!==t)continue;const i=e[r];for(const o of Array.isArray(i)?i:[i])o&&typeof o=="object"&&n.push(o)}return n}function E9(e,t){if(e){for(const n of Object.keys(e))if(n.startsWith("@_")&&I_(n.slice(2))===t){const r=e[n];return r==null?void 0:String(r)}}}function O2(e,t){const n=E9(e,t);if(n===void 0)return;const r=Number(n.endsWith("%")?n.slice(0,-1):n);return Number.isFinite(r)?r:void 0}function zg(e,t){const n=O2(e,t);return n===void 0?void 0:n/1e5}function _ke(e){const t=WM(e,"extLst");return fpe(t,"ext")}var mtt={artisticBlur:"radius",artisticCement:"crackSpacing",artisticChalkSketch:"pressure",artisticCrisscrossEtching:"pressure",artisticCutout:"numberOfShades",artisticFilmGrain:"grainSize",artisticGlass:"scaling",artisticGlowDiffused:"intensity",artisticGlowEdges:"smoothness",artisticLightScreen:"gridSize",artisticLineDrawing:"pencilSize",artisticMarker:"size",artisticMosiaicBubbles:"pressure",artisticPaintBrush:"brushSize",artisticPaintStrokes:"intensity",artisticPastelsSmooth:"scaling",artisticPencilGrayscale:"pencilSize",artisticPencilSketch:"pressure",artisticPhotocopy:"detail",artisticPlasticWrap:"smoothness",artisticTexturizer:"scaling",artisticWatercolorSponge:"brushSize"},Skn=new Set(["trans","visible"]);function Dke(e,t){const n=[];for(const r of fpe(e,t)){const i=zg(r,"x1"),o=zg(r,"y1"),a=zg(r,"x2"),s=zg(r,"y2");i===void 0||o===void 0||a===void 0||s===void 0||n.push({x1:i,y1:o,x2:a,y2:s})}return n.length>0?n:void 0}function Ckn(e){const t=zg(e,"t"),n=zg(e,"b"),r=zg(e,"l"),i=zg(e,"r");if(t===void 0||n===void 0||r===void 0||i===void 0)return;const o={top:t,bottom:n,left:r,right:i,rawXml:e},a=Dke(e,"foregroundMark");a&&(o.foregroundMarks=a);const s=Dke(e,"backgroundMark");return s&&(o.backgroundMarks=s),o}function Tkn(e){const t={};for(const n of Object.keys(e)){if(!n.startsWith("@_"))continue;const r=Number(e[n]);Number.isFinite(r)&&(t[I_(n.slice(2))]=r)}return t}function Akn(e,t){const n=mtt[e],r=n!==void 0&&n in t?n:Object.keys(t).find(o=>!Skn.has(o));if(r===void 0)return;const i=t[r];return r==="radius"?i:i/1e3}function Ekn(e,t,n){if(e==="sharpenSoften"){const r=O2(t,"amount");return r!==void 0&&(n.sharpenSoften??={amount:r}),!0}if(e==="brightnessContrast"){const r=O2(t,"bright"),i=O2(t,"contrast");return(r!==void 0||i!==void 0)&&(n.brightnessContrast??={...r!==void 0?{bright:r}:{},...i!==void 0?{contrast:i}:{}}),!0}if(e==="colorTemperature"){const r=O2(t,"colorTemp");return r!==void 0&&(n.colorTemperature??={colorTemp:r}),!0}if(e==="saturation"){const r=O2(t,"sat");return r!==void 0&&(n.colorSaturation??={sat:r}),!0}return!1}function kkn(e,t){for(const n of Object.keys(e)){if(n.startsWith("@_"))continue;const r=I_(n),i=WM(e,r)??{};if(r==="backgroundRemoval"){t.backgroundRemoval??=Ckn(i);continue}if(Ekn(r,i,t)||!r.startsWith("artistic")||t.artisticEffect!==void 0)continue;t.artisticEffect=r;const o=Tkn(i);if(Object.keys(o).length>0){t.artisticParams=o;const a=Akn(r,o);a!==void 0&&(t.artisticRadius=a)}}}function Mkn(e){const t={};for(const n of e){if(E9(n,"uri")!==hpe)continue;const r=WM(n,"imgProps")??n,i=WM(r,"imgLayer"),o=E9(i,"embed");o&&(t.originalImageRelId=o);for(const a of fpe(i??r,"imgEffect"))kkn(a,t)}return Object.keys(t).length>0?t:void 0}var Pkn={blur:"artisticBlur",cement:"artisticCement",chalkSketch:"artisticChalkSketch",crisscrossEtching:"artisticCrisscrossEtching",cutout:"artisticCutout",filmGrain:"artisticFilmGrain",glass:"artisticGlass",glowDiffused:"artisticGlowDiffused",glow_edges:"artisticGlowEdges",glowEdges:"artisticGlowEdges",lightScreen:"artisticLightScreen",lineDrawing:"artisticLineDrawing",marker:"artisticMarker",mosaic:"artisticMosiaicBubbles",mosaicBubbles:"artisticMosiaicBubbles",paint:"artisticPaintBrush",paintBrush:"artisticPaintBrush",paintStrokes:"artisticPaintStrokes",pastelsSmooth:"artisticPastelsSmooth",pencilGrayscale:"artisticPencilGrayscale",pencilSketch:"artisticPencilSketch",photocopy:"artisticPhotocopy",plasticWrap:"artisticPlasticWrap",texturizer:"artisticTexturizer",watercolorSponge:"artisticWatercolorSponge"};function Ikn(e){const t=(e??"").trim();if(!(t.length===0||t==="none"))return t.startsWith("artistic")?t:Pkn[t]}var Xs=e=>String(Math.round(e));function _kn(e,t){const n={},r=e.artisticParams;if(r&&Object.keys(r).length>0){for(const[a,s]of Object.entries(r))Number.isFinite(s)&&(n[`@_${a}`]=Xs(s));return n}const i=e.artisticRadius,o=mtt[t];return o!==void 0&&typeof i=="number"&&Number.isFinite(i)&&(n[`@_${o}`]=Xs(o==="radius"?i:i*1e3)),n}function Rke(e){return(e??[]).map(t=>({"@_x1":Xs(t.x1*1e5),"@_y1":Xs(t.y1*1e5),"@_x2":Xs(t.x2*1e5),"@_y2":Xs(t.y2*1e5)}))}function Dkn(e){if(e.rawXml)return e.rawXml;const t={"@_t":Xs(e.top*1e5),"@_b":Xs(e.bottom*1e5),"@_l":Xs(e.left*1e5),"@_r":Xs(e.right*1e5)},n=Rke(e.foregroundMarks);n.length>0&&(t["a14:foregroundMark"]=n);const r=Rke(e.backgroundMarks);return r.length>0&&(t["a14:backgroundMark"]=r),t}var Ky=e=>typeof e=="number"&&Number.isFinite(e);function Rkn(e){const t=[];e.backgroundRemoval&&t.push({"a14:backgroundRemoval":Dkn(e.backgroundRemoval)}),Ky(e.sharpenSoften?.amount)&&t.push({"a14:sharpenSoften":{"@_amount":Xs(e.sharpenSoften.amount)}});const n=e.brightnessContrast;if(n&&(Ky(n.bright)||Ky(n.contrast))){const i={};Ky(n.bright)&&(i["@_bright"]=Xs(n.bright)),Ky(n.contrast)&&(i["@_contrast"]=Xs(n.contrast)),t.push({"a14:brightnessContrast":i})}Ky(e.colorTemperature?.colorTemp)&&t.push({"a14:colorTemperature":{"@_colorTemp":Xs(e.colorTemperature.colorTemp)}}),Ky(e.colorSaturation?.sat)&&t.push({"a14:saturation":{"@_sat":Xs(e.colorSaturation.sat)}});const r=Ikn(e.artisticEffect);if(r!==void 0){const i={};i[`a14:${r}`]=_kn(e,r),t.push(i)}return t}function Lkn(e){const t=Rkn(e);if(t.length===0)return;const n={},r=(e.originalImageRelId??"").trim();return r.length>0&&(n["@_r:embed"]=r),n["a14:imgEffect"]=t,{"@_uri":hpe,"a14:imgProps":{"@_xmlns:a14":wkn,"a14:imgLayer":n}}}function Nkn(e,t){const n=Lkn(t),r=_ke(e).filter(c=>E9(c,"uri")!==hpe),i=n?[...r,n]:r,o=Object.keys(e).find(c=>c.endsWith("extLst"))??"a:extLst";if(i.length===0){if(o in e&&_ke(e).length===0)return;delete e[o];return}const a=WM(e,"extLst"),s=a?Object.keys(a).find(c=>c.endsWith("ext")&&!c.endsWith("extLst"))??"a:ext":"a:ext",l=a??{};l[s]=i.length===1?i[0]:i,e[o]=l}var k9=e=>e.split(":").at(-1)??e;function Sh(e,t){if(!e)return;const n=Object.keys(e).find(i=>k9(i)===t);if(!n)return;const r=e[n];return r===""||r===null?{}:r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}function op(e,t,n){const r=Object.keys(e).find(i=>k9(i)===t);r?n?e[r]=n:delete e[r]:n&&(e[`a:${t}`]=n)}function gtt(e){const t=Ea(e),[n,r]=Object.entries(t??{})[0]??[];if(!n||!r||typeof r!="object")return;const i={};for(const[o,a]of Object.entries(r))i[o.startsWith("@_")?o:`a:${k9(o)}`]=a;return{[`a:${k9(n)}`]:i}}function r3(e,t){const n=String(e??"").trim();if(!n)return;const r=n.endsWith("%"),i=Number(r?n.slice(0,-1):n)/(r?1:1e3);if(!(!Number.isFinite(i)||i<0||t&&i>100))return i}function Kq(e,t,n,r,i){const o=e?.[`@_${t}`];if(e&&(o===void 0&&n===i||r3(o,r)===n))return e;const a={...e??{}};return a[`@_${t}`]=String(Math.round(n*1e3)),a}function Fkn(e,t){const n={},r=Sh(e,"alphaModFix");r&&(n.alphaModFix=r3(r["@_amt"],!1)??100,n.alphaModFixRawXml=r);const i=Sh(e,"alphaInv");if(i){const u=t(gtt(i));n.alphaInv={...u?{color:u}:{},rawXml:i}}const o=Sh(e,"alphaCeiling");o&&(n.alphaCeiling=!0,n.alphaCeilingRawXml=o);const a=Sh(e,"alphaFloor");a&&(n.alphaFloor=!0,n.alphaFloorRawXml=a);const s=Sh(e,"alphaMod");if(s){const u=Sh(s,"cont"),d=Sh(u,"alphaModFix"),p=d?r3(d["@_amt"],!1):void 0;n.alphaMod={...u?{contRawXml:u}:{},...p!==void 0?{amt:p}:{},rawXml:s}}const l=Sh(e,"alphaRepl");if(l){const u=r3(l["@_a"],!0);u!==void 0&&(n.alphaRepl=u,n.alphaReplRawXml=l)}const c=Sh(e,"alphaBiLevel");if(c){const u=r3(c["@_thresh"],!0);u!==void 0&&(n.alphaBiLevel=u,n.alphaBiLevelRawXml=c)}return n}function Okn(e,t,n){const r=t.alphaModFix;op(e,"alphaModFix",typeof r=="number"&&Number.isFinite(r)&&r>=0?Kq(t.alphaModFixRawXml,"amt",r,!1,100):void 0);const i=t.alphaInv;if(i){const s=i.rawXml,l=n(gtt(s)),c={...s??{}};if(i.color&&!ku(l,i.color)){for(const u of Object.keys(c))Ea({[u]:c[u]})&&delete c[u];Object.assign(c,nx(i.color))}op(e,"alphaInv",c)}else op(e,"alphaInv",void 0);if(op(e,"alphaCeiling",t.alphaCeiling?t.alphaCeilingRawXml??{}:void 0),op(e,"alphaFloor",t.alphaFloor?t.alphaFloorRawXml??{}:void 0),t.alphaMod){const s={...t.alphaMod.rawXml??{}};t.alphaMod.contRawXml&&op(s,"cont",t.alphaMod.contRawXml),Sh(s,"cont")||t.alphaMod.rawXml?op(e,"alphaMod",s):op(e,"alphaMod",void 0)}else op(e,"alphaMod",void 0);const o=t.alphaRepl;op(e,"alphaRepl",typeof o=="number"&&Number.isFinite(o)&&o>=0&&o<=100?Kq(t.alphaReplRawXml,"a",o,!0):void 0);const a=t.alphaBiLevel;op(e,"alphaBiLevel",typeof a=="number"&&Number.isFinite(a)&&a>=0&&a<=100?Kq(t.alphaBiLevelRawXml,"thresh",a,!0):void 0)}var P1=e=>e.split(":").at(-1)??e;function a0(e,t){if(!e)return;const n=Object.keys(e).find(i=>P1(i)===t);if(!n)return;const r=e[n];return r===""||r===null?{}:r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}function xtt(e){const t=[];for(const[n,r]of Object.entries(e))if(["srgbClr","schemeClr","sysClr","prstClr","scrgbClr","hslClr"].includes(P1(n)))for(const i of Array.isArray(r)?r:[r])i&&typeof i=="object"&&t.push({[n]:i});return t}function ytt(e){const t=Ea(e);if(!t)return;const[n,r]=Object.entries(t)[0]??[];if(!n||!r||typeof r!="object")return;const i={};for(const[o,a]of Object.entries(r))i[o.startsWith("@_")?o:`a:${P1(o)}`]=a;return{[`a:${P1(n)}`]:i}}function i3(e,t){return t(ytt(e))}function vtt(e,t){return t(ytt(e))}function Bkn(e,t,n){const r={},i=a0(e,"grayscl");i&&(r.grayscale=!0,r.grayscaleRawXml=i);const o=a0(e,"biLevel");if(o){const p=Number(o["@_thresh"]);Number.isFinite(p)&&(r.biLevel=p/1e3),r.biLevelRawXml=o}const a=a0(e,"clrChange"),s=a0(a,"clrFrom"),l=a0(a,"clrTo");a&&s&&l&&(r.clrChange={clrFrom:i3(s,t)??"#000000",clrTo:i3(l,t)??"#FFFFFF",clrToTransparent:(vtt(l,n)??1)<=0,rawXml:a});const c=a0(e,"clrRepl"),u=i3(c,t);c&&u&&(r.clrRepl={color:u,rawXml:c});const d=a0(e,"duotone");if(d){const p=xtt(d).map(h=>i3(h,t));p[0]&&p[1]&&(r.duotone={color1:p[0],color2:p[1],rawXml:d})}return r}function Yy(e,t,n){return ku(i3(e,n),t)}function $L(e,t){const n={...e??{}};for(const o of Object.keys(n))Ea({[o]:n[o]})&&delete n[o];const r=Object.keys(n).find(o=>P1(o)==="extLst"),i=r?n[r]:void 0;return r&&delete n[r],Object.assign(n,t),r&&(n[r]=i),n}function Gu(e,t,n){const r=Object.keys(e).find(a=>P1(a)===t);if(r){n?e[r]=n:delete e[r];return}if(!n)return;const i=Object.keys(e).find(a=>P1(a)==="extLst"),o=i?e[i]:void 0;i&&delete e[i],e[`a:${t}`]=n,i&&(e[i]=o)}function jkn(e,t,n,r){Gu(e,"grayscl",t.grayscale?t.grayscaleRawXml??{}:void 0);let i;if(typeof t.biLevel=="number"&&Number.isFinite(t.biLevel)){const l=String(Math.round(Math.max(0,Math.min(100,t.biLevel))*1e3));i={...t.biLevelRawXml??{},"@_thresh":l}}Gu(e,"biLevel",i);const o=t.clrChange;if(o){const l=a0(o.rawXml,"clrFrom"),c=a0(o.rawXml,"clrTo"),u=c?(vtt(c,r)??1)<=0:void 0;if(Yy(l,o.clrFrom,n)&&Yy(c,o.clrTo,n)&&(u===void 0||o.clrToTransparent===u)&&o.rawXml)Gu(e,"clrChange",o.rawXml);else{const p=Yy(l,o.clrFrom,n)?Ea(l):nx(o.clrFrom),f=Yy(c,o.clrTo,n)&&u===o.clrToTransparent?Ea(c):nx(o.clrTo,o.clrToTransparent?0:void 0),m={...o.rawXml??{}};Gu(m,"clrFrom",$L(l,p??{})),Gu(m,"clrTo",$L(c,f??{})),Gu(e,"clrChange",m)}}else Gu(e,"clrChange",void 0);const a=t.clrRepl;if(a){const l=a.rawXml;Gu(e,"clrRepl",Yy(l,a.color,n)&&l?l:$L(l,nx(a.color)))}else Gu(e,"clrRepl",void 0);const s=t.duotone;if(s){const l=s.rawXml?xtt(s.rawXml):[];s.rawXml&&Yy(l[0],s.color1,n)&&Yy(l[1],s.color2,n)?Gu(e,"duotone",s.rawXml):Gu(e,"duotone",$L(s.rawXml,{"a:srgbClr":[{"@_val":s.color1.replace(/^#/u,"")},{"@_val":s.color2.replace(/^#/u,"")}]}))}else Gu(e,"duotone",void 0)}function Zf(e){if(typeof e!="number"||!Number.isFinite(e))return 0;const t=Math.min(.95,Math.abs(e));return e<0?-t:t}function Ukn(e){const t=Zf(e.cropLeft),n=Zf(e.cropTop),r=Zf(e.cropRight),i=Zf(e.cropBottom);if(!(Math.round(t*1e5)!==0||Math.round(n*1e5)!==0||Math.round(r*1e5)!==0||Math.round(i*1e5)!==0))return;const a=t+r,s=n+i,l=a>=.99?.99/a:1,c=s>=.99?.99/s:1,u=Zf(t*l),d=Zf(r*l),p=Zf(n*c),h=Zf(i*c),f={};return e.cropLeft!==void 0&&(f["@_l"]=String(Math.round(u*1e5))),e.cropTop!==void 0&&(f["@_t"]=String(Math.round(p*1e5))),e.cropRight!==void 0&&(f["@_r"]=String(Math.round(d*1e5))),e.cropBottom!==void 0&&(f["@_b"]=String(Math.round(h*1e5))),f}var zkn={"@_lang":"en-US"};function L$(e){return typeof e=="object"&&e!==null?e:void 0}function $kn(e){const t=L$(e);return t===void 0||Object.keys(t).length===0}function Hkn(e){const t=L$(e);return t?Object.keys(t).length===1&&t["@_lang"]===zkn["@_lang"]:!1}function HL(e){return e===""?{}:L$(e)}var btt=new Set(["a:pPr","a:endParaRPr"]);function Lke(e){return Object.keys(e).every(t=>t.startsWith("@_")||btt.has(t))}function Gkn(e,t,n){const r={};for(const i of Object.keys(e))i.startsWith("@_")&&(r[i]=e[i]);t!==void 0&&(r["a:pPr"]=t);for(const i of Object.keys(e))!i.startsWith("@_")&&!btt.has(i)&&(r[i]=e[i]);return n!==void 0&&(r["a:endParaRPr"]=n),r}function Vkn(e,t){for(let n=0;n<t.length;n++){const r=HL(e[n]),i=L$(t[n]);if(!r||!i)continue;let o=HL(i["a:pPr"]);const a=HL(r["a:pPr"]);a&&$kn(o)&&(o=a);let s=i["a:endParaRPr"];const l=HL(r["a:endParaRPr"]),c=Hkn(s);l&&(s===void 0||c)?s=l:!l&&c&&Lke(r)&&Lke(i)&&(s=void 0),t[n]=Gkn(i,o,s)}return t}function Wkn(e,t,n){if(!t?.inheritedRunStyle)return e;const r=n({...t,...t.inheritedRunStyle,...t.authoredRunStyle}),i=n(t),o={},a=new Map;for(const c of new Set([...Object.keys(r),...Object.keys(i)]))JSON.stringify(r[c])!==JSON.stringify(i[c])&&(c.startsWith("@_")?o[c.slice(2)]=i[c]===void 0?null:String(i[c]):a.set(c,i[c]??null));if(Object.keys(o).length===0&&a.size===0)return e;const s=["a:noFill","a:solidFill","a:gradFill","a:blipFill","a:pattFill","a:grpFill"],l=s.find(c=>a.get(c));if(l)for(const c of s)c!==l&&a.set(c,null);return b_(e,o,a,TKe)}function Yq(e,t){const{[t]:n,...r}=e;return r}function Xkn(e){const t=e;if(t.__isField)return{tag:"a:fld",value:Yq(e,"__isField")};if(t.__isLineBreak)return{tag:"a:br",value:Yq(e,"__isLineBreak")};if(!t.__isEquation)return{tag:"a:r",value:Yq(e,"__isField")};const n=t.__equationXml;if(n)return n["mc:AlternateContent"]?{tag:"mc:AlternateContent",value:n["mc:AlternateContent"]}:n["m:oMathPara"]?{tag:"m:oMathPara",value:n["m:oMathPara"]}:n["m:oMath"]?{tag:"m:oMath",value:n["m:oMath"]}:n["a14:m"]?{tag:"a14:m",value:n["a14:m"]}:{tag:"m:oMath",value:n}}function qkn(e){const t=new Set;let n="";for(const{tag:r}of e){if(r!==n&&t.has(r))return!1;t.add(r),n=r}return!0}function Kkn(e,t){if(qkn(t)){const r=new Map;for(const{tag:i,value:o}of t){const a=r.get(i);a?a.push(o):r.set(i,[o])}for(const[i,o]of r)e[i]=o.length>1?o:o[0];return}const n=new Map;for(const{tag:r}of t)n.set(r,(n.get(r)??0)+1);for(const[r,{tag:i,value:o}]of t.entries())e[(n.get(i)??0)>1?fw(i,r):i]=o}function Ykn(e,t){const n={};return["fontFamily","fontSize","bold","italic","underline","strikethrough","rtl","hyperlink","color","align"].forEach(i=>{const o=e?.[i];if(o===void 0)return;const a=e?.inheritedRunStyle;if(a&&o===(e?.authoredRunStyle?.[i]??a[i]))return;const s=t[0]?.style?.[i];t.every(c=>c.style?.[i]===s)&&(i==="fontFamily"&&typeof o=="string"?n.fontFamily=o:i==="fontSize"&&typeof o=="number"?n.fontSize=o:i==="bold"&&typeof o=="boolean"?n.bold=o:i==="italic"&&typeof o=="boolean"?n.italic=o:i==="underline"&&typeof o=="boolean"?n.underline=o:i==="strikethrough"&&typeof o=="boolean"?n.strikethrough=o:i==="rtl"&&typeof o=="boolean"?n.rtl=o:i==="hyperlink"&&typeof o=="string"?n.hyperlink=o:i==="color"&&typeof o=="string"?n.color=o:i==="align"&&(o==="left"||o==="center"||o==="right"||o==="justify")&&(n.align=o))}),n}var GL=GI;function Zkn(e,t){if(e)return r=>e[r]!==void 0;const n=typeof t=="number"&&Number.isFinite(t)&&t>0;return()=>!n}function wtt(e,t,n,r,i,o){const a={},s=Zkn(o,i);return typeof i=="number"&&Number.isFinite(i)&&i>=0&&(a["@_lvl"]=String(Math.min(Math.max(Math.round(i),0),8))),t&&s("align")&&(a["@_algn"]=t),e?.rtl!==void 0&&s("rtl")&&(a["@_rtl"]=e.rtl?"1":"0"),typeof e?.paragraphMarginLeft=="number"&&Number.isFinite(e.paragraphMarginLeft)&&s("paragraphMarginLeft")&&(a["@_marL"]=String(Math.round(e.paragraphMarginLeft*GL))),typeof e?.paragraphMarginRight=="number"&&Number.isFinite(e.paragraphMarginRight)&&s("paragraphMarginRight")&&(a["@_marR"]=String(Math.round(e.paragraphMarginRight*GL))),typeof e?.paragraphIndent=="number"&&Number.isFinite(e.paragraphIndent)&&s("paragraphIndent")&&(a["@_indent"]=String(Math.round(e.paragraphIndent*GL))),typeof e?.defaultTabSize=="number"&&Number.isFinite(e.defaultTabSize)&&s("defaultTabSize")&&(a["@_defTabSz"]=String(Math.round(e.defaultTabSize*GL))),e?.eaLineBreak!==void 0&&s("eaLineBreak")&&(a["@_eaLnBrk"]=e.eaLineBreak?"1":"0"),e?.latinLineBreak!==void 0&&s("latinLineBreak")&&(a["@_latinLnBrk"]=e.latinLineBreak?"1":"0"),e?.fontAlignment&&s("fontAlignment")&&(a["@_fontAlgn"]=e.fontAlignment),e?.hangingPunctuation!==void 0&&s("hangingPunctuation")&&(a["@_hangingPunct"]=e.hangingPunctuation?"1":"0"),r.lineSpacing&&s("lineSpacing")?a["a:lnSpc"]=r.lineSpacing:typeof r.lineSpacingExactPt=="number"&&Number.isFinite(r.lineSpacingExactPt)&&s("lineSpacingExactPt")&&(a["a:lnSpc"]={"a:spcPts":{"@_val":String(Math.round(r.lineSpacingExactPt*100))}}),r.spacingBefore&&s("paragraphSpacingBefore")&&(a["a:spcBef"]=r.spacingBefore),r.spacingAfter&&s("paragraphSpacingAfter")&&(a["a:spcAft"]=r.spacingAfter),n&&n.ownedByParagraph!==!1?Jkn(a,n):Hbn(a,o?.paragraphBulletPropertiesXml),e?.tabStops&&e.tabStops.length>0&&s("tabStops")?a["a:tabLst"]={"a:tab":e.tabStops.map(sze)}:o?.tabStopsExplicitEmpty&&(a["a:tabLst"]={}),e?.paragraphDefaultRunPropertiesXml&&s("paragraphDefaultRunPropertiesXml")&&(a["a:defRPr"]=e.paragraphDefaultRunPropertiesXml),e?.paragraphPropertiesExtLstXml&&s("paragraphPropertiesExtLstXml")&&(a["a:extLst"]=e.paragraphPropertiesExtLstXml),a}function Jkn(e,t){if(t.colorInherit)e["a:buClrTx"]={};else if(t.colorRef)e["a:buClr"]=Pse(t.colorRef);else if(t.colorXml)e["a:buClr"]=t.colorXml;else if(t.color){const n=t.color.replace("#","");e["a:buClr"]={"a:srgbClr":{"@_val":n}}}if(t.sizeInherit?e["a:buSzTx"]={}:t.sizePercent!==void 0?e["a:buSzPct"]={"@_val":String(Math.round(t.sizePercent*1e3))}:t.sizePts!==void 0&&(e["a:buSzPts"]={"@_val":String(Math.round(t.sizePts*100))}),t.fontInherit)e["a:buFontTx"]={};else if(t.fontFamily){const n={"@_typeface":t.fontFamily};t.fontPanose&&(n["@_panose"]=t.fontPanose),t.fontPitchFamily!==void 0&&(n["@_pitchFamily"]=String(t.fontPitchFamily)),t.fontCharset!==void 0&&(n["@_charset"]=String(t.fontCharset)),e["a:buFont"]=n}if(t.none){e["a:buNone"]={};return}if(t.char&&(e["a:buChar"]={"@_char":t.char}),t.autoNumType){const n={"@_type":t.autoNumType};t.autoNumStartAt!==void 0&&t.autoNumStartAt!==1&&(n["@_startAt"]=String(t.autoNumStartAt)),e["a:buAutoNum"]=n}t.imageBlipFillXml?e["a:buBlip"]=t.imageBlipFillXml:t.imageRelId&&(e["a:buBlip"]={"a:blip":{"@_r:embed":t.imageRelId}})}function Qkn(e,t,n,r){const i={};(Object.keys(t).length>0||r?.emptyParagraphPropertiesAuthored)&&(i["a:pPr"]=t);const o=e.map(a=>Xkn(a)).filter(a=>a!==void 0);return o.length>0?Kkn(i,o):i["a:r"]=e.length>1?e:e[0],n&&typeof n=="object"?i["a:endParaRPr"]=n:e.length===0&&!r?.bareParagraph&&(i["a:endParaRPr"]={"@_lang":"en-US"}),i}function e4n(e,t,n){const r=e[n],i=t[n];return typeof r=="boolean"||typeof i=="boolean"?!!r!=!!i:r!==i}function t4n(e){const t=e?.inheritedRunStyle;if(!e||!t)return()=>!0;const n=e.authoredRunStyle;return(...r)=>r.some(i=>n?.[i]!==void 0||e4n(e,t,i))}var n4n=["showVal","showCatName","showSerName","showPercent","showBubbleSize"];function M9(e,t,n){if(!Object.keys(e).some(i=>i.slice(i.lastIndexOf(":")+1)===t))return!1;const r=n.getChildByLocalName(e,t)?.["@_val"];return r===void 0||r==="1"||r==="true"}function Nke(e,t){return M9(e,"delete",t)?!1:n4n.some(n=>M9(e,n,t))}function Fke(e,t){return!e||M9(e,"delete",t)?!1:Nke(e,t)?!0:t.getChildrenArrayByLocalName(e,"dLbl").some(n=>Nke(n,t))}function r4n(e,t){return e!==void 0&&M9(e,"delete",t)}function i4n(e,t,n,r){const i={},o=Sa(t.getChildByLocalName(e,"spPr"),t,n);o&&(i.titleSpPr=o);const a=t.getChildByLocalName(t.getChildByLocalName(e,"tx"),"rich"),s=zp(a,t)??zp(t.getChildByLocalName(e,"txPr"),t),l=Ld(s,t,n,r);return l?.fontFamily!==void 0&&(i.titleFontFamily=l.fontFamily),l?.eastAsiaFontFamily!==void 0&&(i.titleEastAsiaFontFamily=l.eastAsiaFontFamily),l?.fontSize!==void 0&&(i.titleFontSize=l.fontSize),l?.bold!==void 0&&(i.titleFontBold=l.bold),l?.color!==void 0&&(i.titleFontColor=l.color),i}function Nk(e,t){if(e===!0||e===1)return!0;if(e===!1||e===0)return!1;const n=String(e??"").trim().toLowerCase();return n==="true"||n==="1"?!0:n==="false"||n==="0"?!1:t}function o4n(e,t){const n={};if(e["p:present"])n.showType="presented";else if(e["p:browse"]){n.showType="browsed";const a=e["p:browse"];a?.["@_showScrollbar"]!==void 0&&(n.showScrollbar=Nk(a["@_showScrollbar"],!0))}else if(e["p:kiosk"]){n.showType="kiosk";const s=e["p:kiosk"]?.["@_restart"];if(s!==void 0){const l=Number.parseInt(String(s),10);Number.isFinite(l)&&l>0&&(n.kioskRestartTime=l)}}n.loopContinuously=Nk(e["@_loop"],!1),n.showWithNarration=Nk(e["@_showNarration"],!0),n.showWithAnimation=Nk(e["@_showAnimation"],!0),Nk(e["@_useTimings"],!0)?n.advanceMode="useTimings":n.advanceMode="manual";const r=e["p:penClr"];if(r){const a=t?t(r):(()=>{const s=r["a:srgbClr"],l=String(s?.["@_val"]||"").trim();return l.length>0?`#${l}`:void 0})();a&&(n.penColor=a,n.penColorOriginal=a,n.penColorXml=r)}const i=e["p:sldRg"],o=e["p:custShow"];if(i){n.showSlidesMode="range";const a=Number.parseInt(String(i["@_st"]??"1"),10),s=Number.parseInt(String(i["@_end"]??"1"),10);Number.isFinite(a)&&(n.showSlidesFrom=a),Number.isFinite(s)&&(n.showSlidesTo=s)}else if(o){n.showSlidesMode="customShow";const a=String(o["@_id"]??"").trim();a.length>0&&(n.showSlidesCustomShowId=a)}else n.showSlidesMode="all";return n}function a4n(e,t,n){const r=t.filter(u=>String(u["@_Type"]??"").includes("/slideLayout")),i=new Map;for(const u of r){const d=String(u["@_Id"]??""),p=String(u["@_Target"]??"");d&&p&&i.set(d,p)}const o=e?s4n(Dt(e,"p:sldLayoutIdLst")?.["p:sldLayoutId"]):[],a=[],s=new Set,l=new Set,c=(u,d)=>{const p=n(d);!p||s.has(p)||(s.add(p),l.add(u),a.push(p))};for(const u of o){const d=lr(u,"r:id"),p=d?i.get(d):void 0;d&&p&&c(d,p)}for(const u of r){const d=String(u["@_Id"]??""),p=String(u["@_Target"]??"");p&&!l.has(d)&&c(d,p)}return a}function s4n(e){return e==null?[]:Array.isArray(e)?e:[e]}function Oke(e){if(!e)return;const t={};for(const n of dy){const r=String(e[`@_${n}`]??"").trim();r&&(t[n]=r)}return Object.keys(t).length>0?t:void 0}var l4n=/^#?[0-9a-f]{6}$/iu;function Zq(e,t){return!e||l4n.test(e)?e:t(e)??e}function Stt(e,t){return{...e,fromColor:Zq(e.fromColor,t),toColor:Zq(e.toColor,t),byColor:Zq(e.byColor,t),components:e.components?.map(n=>Stt(n,t))}}function c4n(e,t){return e.map(n=>n.colorAnimation?{...n,colorAnimation:Stt(n.colorAnimation,t)}:n)}var u4n=/<svg\b([^>]*)>/iu,Bke=/\spreserveAspectRatio\s*=\s*(?:"[^"]*"|'[^']*')/iu;function d4n(e){const t=u4n.exec(e);if(!t)return e;const n=t[1],r=Bke.test(n)?n.replace(Bke,' preserveAspectRatio="none"'):`${n} preserveAspectRatio="none"`;return`${e.slice(0,t.index)}<svg${r}>${e.slice(t.index+t[0].length)}`}function p4n(e,t){let n=!1;t.artisticEffect!==void 0&&(e.artisticEffect=t.artisticEffect,t.originalImageRelId!==void 0&&(e.artisticPrerenderedEffect=t.artisticEffect),t.artisticRadius!==void 0&&(e.artisticRadius=t.artisticRadius),t.artisticParams&&(e.artisticParams=t.artisticParams),n=!0),t.backgroundRemoval&&(e.backgroundRemoval=t.backgroundRemoval,n=!0),t.originalImageRelId!==void 0&&(e.originalImageRelId=t.originalImageRelId,n=!0);const r={};return t.sharpenSoften&&(e.sharpenSoften=t.sharpenSoften,r.sharpenSoften={...t.sharpenSoften}),t.brightnessContrast&&(e.brightnessContrast=t.brightnessContrast,r.brightnessContrast={...t.brightnessContrast}),t.colorTemperature&&(e.colorTemperature=t.colorTemperature,r.colorTemperature={...t.colorTemperature}),t.colorSaturation&&(e.colorSaturation=t.colorSaturation,r.colorSaturation={...t.colorSaturation}),Object.keys(r).length>0&&(t.originalImageRelId!==void 0&&(e.prerenderedCorrections=r),n=!0),n}var h4n=class{baselines=new Map;stale=new WeakSet;pending=new Map;seen=new Map;reset(){this.baselines.clear(),this.pending.clear(),this.seen.clear(),this.stale=new WeakSet}recordBaselines(e){for(const t of e)this.baselines.has(t.id)||this.baselines.set(t.id,OAe(t))}beginSave(){this.pending.clear(),this.seen.clear()}shouldWriteBack(e){if(this.stale.has(e))return!1;const t=OAe(e);this.remember(e,t);const n=this.baselines.get(e.id);return n!==void 0&&n===t?!1:(this.pending.set(e.id,t),!0)}commitSave(){for(const[e,t]of this.pending){const n=this.baselines.get(e);for(const r of this.seen.get(e)??[])r.signature!==t&&r.signature===n&&this.stale.add(r.element);this.baselines.set(e,t)}this.pending.clear(),this.seen.clear()}remember(e,t){const n=this.seen.get(e.id);n?n.push({element:e,signature:t}):this.seen.set(e.id,[{element:e,signature:t}])}},f4n=class{zip;parser;builder;presentationData=null;slideMap=new Map;savedSlideFingerprints=new Map;chartDataBaselines=new Map;slideRelsMap=new Map;externalRelsMap=new Map;layoutCache=new Map;masterCache=new Map;templateElementBaselines=new h4n;layoutXmlMap=new Map;masterXmlMap=new Map;layoutPlaceholderDefaultsCache=new Map;masterPlaceholderDefaultsCache=new Map;presentationDefaultTextStyle;imageDataCache=new Map;blobUrlCache=new Set;eagerDecodeImages=!1;allowExternalImages=!1;orderedSlidePaths=[];themeColorMap={};themeFontMap={};themeFormatScheme;themeOverrideCache=new Map;currentSlideClrMapOverride=null;masterClrMaps=new Map;masterThemeColorMaps=new Map;masterThemeFontMaps=new Map;masterThemeFormatSchemes=new Map;masterThemePaths=new Map;masterThemeMajorFontScripts=new Map;masterThemeMinorFontScripts=new Map;masterThemeNames=new Map;masterThemeFontSchemeNames=new Map;masterThemeColorSchemeNames=new Map;originalThemeXmlByPath=new Map;dirtyThemePaths=new Set;masterTxStylesCache=new Map;masterThemeObjectDefaults=new Map;masterThemeExtraClrSchemeLst=new Map;masterThemeCustClrLst=new Map;masterThemeExtLst=new Map;currentMasterClrMap=null;globalThemeColorMapSnapshot={};globalThemeFontMapSnapshot={};globalThemeFormatSchemeSnapshot;thumbnailData=null;vbaProjectBin=null;vbaRelatedParts=new Map;signatureDetection=null;customXmlParts=[];alternateContentBlockByRawXml=new WeakMap;loadedEmbeddedFonts=[];loadedEmbeddedFontList;loadedViewProperties;loadedTableStylesDefaultId;commentAuthorMap=new Map;commentAuthorDetails=new Map;commentAuthorsRootXml;modernCommentAuthors=new Map;modernCommentAuthorsRootXml;modernCommentAuthorsPartPath;modernCommentAuthorsRelationshipId;modernCommentParts=new Map;layoutOptions=[];compatibilityService;slideLoaderService;slideTransitionService;editorAnimationService;nativeAnimationService;animationWriteService;templateBackgroundService;xmlLookupService;dependencyFactory;rawSlideWidthEmu=0;rawSlideHeightEmu=0;rawSlideSizeType;elementXmlBuilder;contentTypesBuilder;elementTransformUpdater;presentationSaveBuilder;presentationSlidesReconciler;slideBackgroundBuilder;slideCommentPartWriter;slideMediaRelationshipBuilder;slideNotesPartUpdater;slideCommentsXmlFactory;commentAuthorsXmlFactory;colorStyleCodec;connectorParser;shapeStyleExtractor;tableDataParser;mediaDataParser;graphicFrameParser;documentPropertiesUpdater;static EMU_PER_PX=9525;static EDITOR_META_EXTENSION_URI="{A6F62C1B-B45C-4E8A-8B0A-1B3E5F8C8D4A}";static EDITOR_META_NAMESPACE_URI="http://schemas.pptx.ai/pptx/editor-meta";isStrictOoxml=!1;_originalParser=null;detectAndSetStrictConformance(e){if(rWe(e)&&(this.isStrictOoxml=!0,kM(e),!this._originalParser)){this._originalParser=this.parser;const t=this.parser;this.parser=new Proxy(t,{get(n,r,i){return r==="parse"?function(o,a){const s=n.parse(o,a??!1);return typeof s=="object"&&s!==null&&kM(s),s}:Reflect.get(n,r,i)}})}}async loadPartRelationships(e,t){const n=await this.zip.file(t??ux(e))?.async("string");if(!n)return;const o=this.parser.parse(n)?.Relationships?.Relationship,a=Array.isArray(o)?o:o?[o]:[],s=new Map,l=new Set;for(const c of a){const u=c["@_Id"],d=c["@_Target"];!u||!d||(s.set(String(u),String(d)),String(c["@_TargetMode"]??"").toLowerCase()==="external"&&l.add(String(u)))}this.slideRelsMap.set(e,s),l.size>0&&this.externalRelsMap.set(e,l)}restoreOriginalParser(){this._originalParser&&(this.parser=this._originalParser,this._originalParser=null)}},I1=["wholeTbl","band1H","band2H","band1V","band2V","lastCol","firstCol","lastRow","seCell","swCell","firstRow","neCell","nwCell"];function _c(e){const t=e.trim().toUpperCase();return t.startsWith("{")?t:`{${t}}`}function Ctt(...e){for(const t of e)if(t?.schemeColor?.startsWith("accent"))return t.schemeColor}function mpe(e,t,n){if(!e)return;const r=e["a:fill"],o=(r?.["a:solidFill"]??e["a:solidFill"])?.["a:schemeClr"],a=o&&String(o["@_val"]||"").trim()||void 0,s=a?{schemeColor:a}:void 0,l=!!e["a:effectLst"],c=r?void 0:e["a:fillRef"],u=x4n(c),d=s??(u?m4n(u,t,n):void 0);if(!(!d&&!l&&!u))return{...d?{fill:d}:{},...u?{fillRef:u}:{},...l?{hasEffectLst:l}:{}}}function m4n(e,t,n){if(e.idx===0||e.idx===1e3)return{schemeColor:"",noFill:!0};if(!t)return;const r=e.idx>=1001?t.backgroundFillStyles[e.idx-1001]:t.fillStyles[e.idx-1];if(!r)return;const i=e.color?.schemeColor,o=i&&n?n[i]:void 0;if(r.kind==="gradient"&&r.rawNode){const a=g4n(r.rawNode,o);if(a)return{schemeColor:"",gradient:a}}if(o&&r.rawNode){const a=r.rawNode["a:schemeClr"];return{schemeColor:"",color:a?Zc(o,a):o}}return r.color?{schemeColor:"",color:r.color}:void 0}function g4n(e,t){if(!t)return;const r=e["a:gsLst"]?.["a:gs"],i=Array.isArray(r)?r:r?[r]:[],o=[];for(const s of i){const l=s["a:schemeClr"],c=l?Zc(t,l):void 0;if(!c)continue;const u=(parseInt(String(s["@_pos"]||"0"),10)||0)/1e3;o.push({position:u,fill:{schemeColor:"",color:c}})}if(o.length===0)return;const a=e["a:lin"];if(a){const l=((parseInt(String(a["@_ang"]||"0"),10)||0)/6e4%360+360)%360;return{stops:o,angle:l,type:"linear"}}return e["a:path"]!==void 0?{stops:o,type:"radial"}:{stops:o,type:"linear"}}function x4n(e){if(!e)return;const t=parseInt(String(e["@_idx"]??""),10);if(!Number.isFinite(t))return;const n=e["a:schemeClr"],r=fde(e),i=e["a:srgbClr"];if(r)return{idx:t,color:r};if(!n&&i){const o=String(i["@_val"]||"").trim();if(o)return{idx:t,color:{schemeColor:"",color:o.startsWith("#")?o:`#${o}`}}}return{idx:t}}function y4n(e,t,n){const r=String(e["@_styleId"]||"").trim();if(!r)return;const i=_c(r),o=String(e["@_styleName"]||"").trim()||void 0,a=h=>e[`a:${h}`],s={},l={},c={},u={};for(const h of I1){const f=a(h),m=mde(f,t);m&&(s[`${h}Fill`]=m);const g=gde(f);g&&(l[`${h}Text`]=g);const y=f?.["a:tcStyle"],v=i9(y);v&&(c[`${h}Borders`]=v);const b=YKe(y);b&&(u[`${h}Cell3D`]=b)}const d=mpe(e["a:tblBg"],n?.formatScheme,n?.colorMap),p=Ctt(s.wholeTblFill,s.band1HFill,s.band1VFill,s.firstRowFill);return{styleId:i,styleName:o,accentKey:p,...d?{tableBackground:d}:{},...s,...l,...c,...u}}function v4n(e,t,n,r){const i=e["a:tblStyleLst"];if(!i)return;const o=String(i["@_def"]||"").trim(),a=o?_c(o):void 0,s={};for(const l of t(i["a:tblStyle"])){const c=y4n(l,n,r);c&&(s[c.styleId]=c)}if(!(Object.keys(s).length===0&&!a))return{map:s,...a?{defaultStyleId:a}:{}}}var b4n="ppt/tableStyles.xml",w4n="ppt/_rels/tableStyles.xml.rels",S4n=960,C4n=540,T4n=class jne extends f4n{async exportSlides(t,n){const r=this.resolveExportIndices(t,n);if(n.format!=="svg")throw this.compatibilityService.reportWarning({code:"EXPORT_BACKEND_UNAVAILABLE",message:`Export to "${n.format}" requires a platform-specific rendering backend. No export backend is configured in this runtime.`,severity:"warning",scope:"presentation"}),new Error(`exportSlides: "${n.format}" needs a rendering backend that pptx-viewer-core does not ship. Use format "svg" for headless output, a viewer binding's browser export pipeline for PNG/PDF, or override exportSlides with your own backend.`);const{width:i,height:o}=this.resolveExportViewport(n),a=new TextEncoder,s=new Map;for(const l of r){const c=t[l];c.hidden&&!n.includeHidden||s.set(l,a.encode(s$.exportSlide(c,i,o)))}return s}resolveExportViewport(t){const n=this.rawSlideWidthEmu/jne.EMU_PER_PX,r=this.rawSlideHeightEmu/jne.EMU_PER_PX,i=n>0?n:S4n,o=r>0?r:C4n;return!t.width||t.width<=0?{width:i,height:o}:{width:t.width,height:o*t.width/i}}resolveExportIndices(t,n){return(n.slideIndices&&n.slideIndices.length>0?n.slideIndices:t.map((i,o)=>o)).filter(i=>Number.isInteger(i)&&i>=0&&i<t.length)}normalizeTableStyleGuid(t){return _c(t)}deriveTableStyleAccentKey(...t){return Ctt(...t)}extractTableBackground(t){return mpe(t,this.globalThemeFormatSchemeSnapshot,this.globalThemeColorMapSnapshot)}extractTableStyleSectionFill(t){return mde(t)}extractTableStyleSectionBorders(t){return i9(t?.["a:tcStyle"])}extractTableStyleSectionText(t){return gde(t)}ensureArray(t){return t?Array.isArray(t)?t:[t]:[]}async parseTableStyles(){this.loadedTableStylesDefaultId=void 0;const t=await this.zip.file(b4n)?.async("string");if(t)try{const n=this.parser.parse(t),r=await this.buildTableStylesImageResolver(),i=v4n(n,o=>this.ensureArray(o),r,{formatScheme:this.globalThemeFormatSchemeSnapshot,colorMap:this.globalThemeColorMapSnapshot});return this.loadedTableStylesDefaultId=i?.defaultStyleId,!i||Object.keys(i.map).length===0?void 0:i.map}catch(n){console.warn("Failed to parse ppt/tableStyles.xml:",n);return}}async buildTableStylesImageResolver(){const t=await this.zip.file(w4n)?.async("string");if(!t)return;let n;try{const r=this.parser.parse(t),i=this.ensureArray(Dt(r,"Relationships")?.Relationship);n=new Map;for(const o of i){const a=String(o?.["@_Id"]||""),s=String(o?.["@_Target"]||"");if(!a||!s)continue;const l=s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:");n.set(a,l?s:s.startsWith("/")?s.substring(1):`ppt/${s}`)}}catch(r){console.warn("Failed to parse ppt/_rels/tableStyles.xml.rels:",r);return}if(n.size!==0)return(r,i)=>{const o=r||i;if(!o)return;const a=n.get(o);if(a)return a.startsWith("http://")||a.startsWith("https://")?this.allowExternalImages===!0?a:void 0:a}}},A4n=class extends T4n{serializeSingleAction(e,t,n,r){if(!n){delete e[t];return}const i={};let o=n.rId;if(!o&&n.url){const s=/^ppaction:\/\/(program|hlinkfile|hlinkpres)\b/iu.test(n.action??"");o=r(n.url,s)??void 0}i["@_r:id"]=o??"",n.action&&(i["@_action"]=n.action),n.tooltip&&(i["@_tooltip"]=n.tooltip),n.highlightClick&&(i["@_highlightClick"]="1"),n.endSnd&&(i["@_endSnd"]="1");const a=n.soundRId;a&&(i["a:snd"]={"@_r:embed":a}),e[t]=i}getTreeBucketKeyForElementType(e){return e==="picture"||e==="image"?"p:pic":e==="connector"?"p:cxnSp":e==="group"?"p:grpSp":e==="table"||e==="chart"||e==="smartArt"||e==="ole"||e==="media"?"p:graphicFrame":"p:sp"}getCnvPrNode(e,t){const n=xr(e,"p:nvContentPartPr","p:cNvPr");if(n)return n;const r=ITe(e,t);return xr(e,r?.nvKey??"p:nvSpPr","p:cNvPr")}serializeElementActions(e,t,n){const r=this.getTreeBucketKeyForElementType(t.type),i=this.getCnvPrNode(e,r);if(!i)return;const o="actionClick"in t?t.actionClick:void 0,a="actionHover"in t?t.actionHover:void 0;this.serializeSingleAction(i,"a:hlinkClick",o,n),this.serializeSingleAction(i,"a:hlinkHover",a,n);const s="isDecorative"in t?t.isDecorative:void 0;kbn(i,s)}serializeShapeLocks(e,t){const n=ITe(e,this.getTreeBucketKeyForElementType(t.type));if(!n)return;const r="locks"in t?t.locks:void 0,i=aq(e,n,!1),o=n.cNvKey==="p:cNvPicPr"&&"preferRelativeResize"in t?t.preferRelativeResize:void 0;if(o!==void 0){const l=i??aq(e,n,!0);l&&(l["@_preferRelativeResize"]=o?"1":"0")}const a=dpn(r,n,i?.[n.lockTag]);if(!a){i&&delete i[n.lockTag];return}const s=i??aq(e,n,!0);s&&(s[n.lockTag]=a)}},E4n=class extends A4n{parseAction(e,t,n){if(!e)return;const r=String(e["@_r:id"]||e["@_id"]||"").trim(),i=String(e["@_action"]||"").trim(),o=String(e["@_tooltip"]||"").trim(),a=String(e["@_highlightClick"]||"").trim(),s=String(e["@_endSnd"]||"").trim();if(r.length===0&&i.length===0&&o.length===0&&s.length===0)return;const l={};r.length>0&&(l.rId=r),i.length>0&&(l.action=i),o.length>0&&(l.tooltip=o),(a==="1"||a==="true")&&(l.highlightClick=!0),(s==="1"||s==="true")&&(l.endSnd=!0);const c=e["a:snd"],u=String(c?.["@_r:embed"]||c?.["@_r:link"]||"").trim();if(u.length>0&&(l.soundRId=u),r.length>0&&t){const d=t.get(r);if(d){l.url=d;const p=d.match(/slide(\d+)\.xml$/i);if(p){const h=parseInt(p[1],10),f=n.findIndex(m=>{const g=m.match(/slide(\d+)\.xml$/i);return g?parseInt(g[1],10)===h:!1});f>=0&&(l.targetSlideIndex=f)}}}if(l.soundRId&&t){const d=t.get(l.soundRId);d&&(l.soundPath=d)}return l}parseElementActions(e,t,n){if(!e)return{};const r={},i=e["a:hlinkClick"],o=e["a:hlinkHover"],a=this.parseAction(i,t,n),s=this.parseAction(o,t,n);return a&&(r.actionClick=a),s&&(r.actionHover=s),r}parseColor(e,t){return this.colorStyleCodec.parseColor(e,t)}extractTextFillVariants(e){const t={};if(!e)return t;const n=e["a:gradFill"];if(n){const o=n["a:gsLst"];if(o){const a=this.ensureArray(o["a:gs"]);if(a.length>=2){const s=a.map(d=>{const p=parseInt(String(d["@_pos"]||"0"))/1e3;return`${this.parseColor(d)||"#000000"} ${p}%`}),l=n["a:lin"]?parseInt(String(n["a:lin"]["@_ang"]||"0"))/6e4:0,c=n["a:path"]?"radial":"linear";t.textFillGradient=`linear-gradient(${XA(l)}deg, ${s.join(", ")})`;const u=[];for(const d of a){const p=d,h=this.parseColor(p)||"#000000",f=parseInt(String(p["@_pos"]||"0"),10),m=Number.isFinite(f)?f/1e5*100:0,g=this.extractColorOpacity(p);u.push({color:h,position:m,...g!==void 0?{opacity:g}:{}})}t.textFillGradientStops=u,t.textFillGradientAngle=l,t.textFillGradientType=c}}}const r=e["a:pattFill"];if(r){t.textFillPattern=String(r["@_prst"]||"");const o=r["a:fgClr"],a=r["a:bgClr"];o&&(t.textFillPatternForeground=this.parseColor(o)),a&&(t.textFillPatternBackground=this.parseColor(a))}const i=e["a:blipFill"];return i&&(t.textFillBlipXml=i),t}extractColorOpacity(e){return this.colorStyleCodec.extractColorOpacity(e)}},k4n=class extends E4n{extractImageEffects(e){if(!e)return null;const t={};let n=!1;const r=e["@_bright"]??e["@_brt"];if(r!==null){const h=parseInt(String(r));Number.isFinite(h)&&(t.brightness=h/1e3,n=!0)}const i=e["@_contrast"]??e["@_cont"];if(i!==null){const h=parseInt(String(i));Number.isFinite(h)&&(t.contrast=h/1e3,n=!0)}const o=Bkn(e,h=>this.parseColor(h),h=>this.extractColorOpacity(h));Object.assign(t,o),Object.keys(o).length>0&&(n=!0);const a=Fkn(e,h=>this.parseColor(h));Object.assign(t,a),Object.keys(a).length>0&&(n=!0);const s=e["a:lum"];if(s){const h={},f=s["@_bright"],m=s["@_contrast"];if(f!==void 0){const g=parseInt(String(f))/1e3;Number.isFinite(g)&&(h.bright=g)}if(m!==void 0){const g=parseInt(String(m))/1e3;Number.isFinite(g)&&(h.contrast=g)}t.lum=h,n=!0}const l=e["a:hsl"];if(l){const h={},f=l["@_hue"],m=l["@_sat"],g=l["@_lum"];if(f!==void 0){const y=parseInt(String(f))/6e4;Number.isFinite(y)&&(h.hue=y)}if(m!==void 0){const y=parseInt(String(m))/1e3;Number.isFinite(y)&&(h.sat=y)}if(g!==void 0){const y=parseInt(String(g))/1e3;Number.isFinite(y)&&(h.lum=y)}t.hsl=h,n=!0}const c=e["a:tint"];if(c){const h={},f=c["@_hue"],m=c["@_amt"];if(f!==void 0){const g=parseInt(String(f))/6e4;Number.isFinite(g)&&(h.hue=g)}if(m!==void 0){const g=parseInt(String(m))/1e3;Number.isFinite(g)&&(h.amt=g)}t.tint=h,n=!0}const u=e["a:fillOverlay"];if(u){const h=String(u["@_blend"]||"over"),f=["over","mult","screen","darken","lighten"].includes(h)?h:"over",m={};for(const A of Object.keys(u))A!=="@_blend"&&(m[A]=u[A]);const g=u["a:solidFill"],y=g?this.parseColor(g):void 0,v=g?this.extractColorOpacity(g)??1:void 0,b=u["a:gradFill"],w=b?this.resolveFillOverlayGradient(b):void 0,S=u["a:pattFill"],T=S?this.resolveFillOverlayPattern(S):void 0;t.fillOverlay={blend:f,fillRawXml:m,...y?{resolvedColor:y,resolvedOpacity:v}:{},...w?{resolvedGradient:w}:{},...T?{resolvedPattern:T}:{}},n=!0}const d=e["a:blur"];if(d){const h={},f=d["@_rad"];if(f!==void 0){const g=parseInt(String(f));Number.isFinite(g)&&(h.rad=g)}const m=d["@_grow"];if(m!==void 0){const g=String(m).toLowerCase();h.grow=g==="1"||g==="true"}t.blur=h,n=!0}const p=Dt(e,"a:extLst");if(p){const h=Mkn(this.ensureArray(p["a:ext"]));h&&p4n(t,h)&&(n=!0)}return n?t:null}resolveFillOverlayGradient(e){const t=e["a:gsLst"],n=this.ensureArray(t?.["a:gs"]),r=[];for(const o of n){const a=o,s=this.parseColor(a);if(!s)continue;const l=(parseInt(String(a["@_pos"]||"0"),10)||0)/1e5,c=this.extractColorOpacity(a);r.push({color:s,position:l,...c!==void 0?{opacity:c}:{}})}if(r.length===0)return;const i=e["a:lin"];return i?{type:"linear",angle:((parseInt(String(i["@_ang"]||"0"),10)||0)/6e4%360+360)%360,stops:r}:e["a:path"]!==void 0?{type:"radial",stops:r}:{type:"linear",angle:0,stops:r}}resolveFillOverlayPattern(e){const t=String(e["@_prst"]||"").trim();if(!t)return;const n=this.parseColor(e["a:fgClr"]),r=this.parseColor(e["a:bgClr"]);return{preset:t,foreground:n,background:r}}inspectArtisticEffects(e,t,n){}extractSvgBlipRelId(e){if(!e)return;const t=Dt(e,"a:extLst");if(!t)return;const n=this.ensureArray(t["a:ext"]);for(const r of n)if((lr(r,"uri")||"")==="{96DAC541-7B7A-43D3-8B79-37D633B846F1}"){const o=Dt(r,"asvg:svgBlip")||Dt(r,"a16:svgBlip");if(o)return lr(o,"r:embed")||lr(o,"r:link")||""}}resolveRelationshipTarget(e,t){return this.mediaDataParser.resolveRelationshipTarget(e,t)}},M4n=class extends k4n{walkMediaTimingTree(e,t,n){if(!e)return;for(const i of["p:video","p:audio"]){const o=this.ensureArray(e[i]);for(const a of o){const s=a["p:cMediaNode"];if(!s)continue;const l=s["p:tgtEl"],c=x$(l),u=c?.type==="shape"?c.subShapeId??c.shapeId:void 0;if(!u)continue;const d=s["p:cTn"],p=opn(d,i),h=s["@_fullScrn"]==="1";let f;const m=s["@_vol"];if(m!==void 0){const w=parseInt(String(m));Number.isFinite(w)&&(f=Math.max(0,Math.min(1,w/1e5)))}const g=s["@_showWhenStopped"]==="0",y=lYe(s,p.playAcrossSlides,i);let v;const b=s["@_posterFrame"];b&&(v=this.resolveRelationshipTarget(n,String(b))),t.set(u,{fullScreen:h||void 0,loop:p.loop||void 0,posterFramePath:v,volume:f,autoPlay:p.autoPlay||void 0,playAcrossSlides:y||void 0,hideWhenNotPlaying:g||void 0})}}const r=e["p:cTn"];if(r){const i=r["p:childTnLst"];if(i){for(const o of["p:par","p:seq","p:excl"]){const a=this.ensureArray(i[o]);for(const s of a)this.walkMediaTimingTree(s,t,n)}this.walkMediaTimingTree(i,t,n)}}for(const i of["p:par","p:seq","p:excl","p:tnLst"]){const o=this.ensureArray(e[i]);for(const a of o)this.walkMediaTimingTree(a,t,n)}}extractMediaTimingMap(e,t){const n=new Map;try{const r=kde(e?.["p:sld"]);if(!r)return n;this.walkMediaTimingTree(r,n,t)}catch(r){console.warn("Failed to parse media timing data:",r)}return n}getXmlShapeId(e){return npn(e)}getPathExtension(e){return sYe(e)}getImageMimeType(e){return rpn(e)}async getMediaArrayBuffer(e){if(!e)return;const t=this.zip.file(e);if(t)try{return await t.async("arraybuffer")}catch{return}}};async function P4n(e){if(typeof document>"u")return;const t=await Ji(()=>import("./UTIF-4E-wdh3X.js").then(u=>u.U),__vite__mapDeps([0,1,2])),n="default"in t?t.default:t,r=n.decode(e)[0];if(!r)return;n.decodeImage(e,r);const i=Number(r.width),o=Number(r.height);if(!Number.isFinite(i)||i<=0||!Number.isFinite(o)||o<=0)return;const a=new Uint8ClampedArray(n.toRGBA8(r)),s=document.createElement("canvas");s.width=i,s.height=o;const l=s.getContext("2d");if(!l)return;const c=l.createImageData(i,o);return c.data.set(a),l.putImageData(c,0,0),await new Promise(u=>{s.toBlob(d=>u(d??void 0),"image/png")})}var I4n=typeof globalThis.URL?.createObjectURL=="function"&&typeof globalThis.Blob<"u",_4n=class extends M4n{resolveThemeColor(e){}createImageUrl(e,t){if(I4n&&!ipn(t)){const i=new Blob([new Uint8Array(e)],{type:t}),o=URL.createObjectURL(i);return this.blobUrlCache.add(o),o}const n=new Uint8Array(e);let r="";for(let i=0;i<n.length;i++)r+=String.fromCharCode(n[i]);return`data:${t};base64,${btoa(r)}`}async getImageData(e){if(!e)return;const t=this.getPathExtension(e);if(e.startsWith("http://")||e.startsWith("https://"))return this.allowExternalImages!==!0?void 0:e;if(e.startsWith("data:"))return e;if(this.imageDataCache.has(e))return this.imageDataCache.get(e);const n=this.zip.file(e);if(!n){console.warn(`[pptx] Image file not found in archive: ${e}`);return}try{if(t==="emf"||t==="wmf"){const o=await n.async("arraybuffer"),a=await DVe(o);if(a)return this.imageDataCache.set(e,a),a;const s=e.replace(/\.[^.]+$/,"");for(const l of["png","jpg","jpeg","gif"]){const c=`${s}.${l}`,u=this.zip.file(c);if(u)try{const d=await u.async("arraybuffer"),p=l==="jpg"?"image/jpeg":`image/${l}`,h=this.createImageUrl(d,p);return this.imageDataCache.set(e,h),h}catch{}}return}if(t==="tif"||t==="tiff"){const o=await n.async("arraybuffer"),a=await P4n(o);if(a){const l=this.createImageUrl(await a.arrayBuffer(),"image/png");return this.imageDataCache.set(e,l),l}const s=this.createImageUrl(o,this.getImageMimeType(e));return this.imageDataCache.set(e,s),s}if(t==="svg"){const o=await n.async("string"),a=d4n(o),s=new TextEncoder().encode(a),l=this.createImageUrl(s.buffer,"image/svg+xml");return this.imageDataCache.set(e,l),l}const r=await n.async("arraybuffer"),i=this.createImageUrl(r,this.getImageMimeType(e));return this.imageDataCache.set(e,i),i}catch(r){console.warn(`[pptx] Failed to load image: ${e}`,r);return}}async getImageDataAsDataUrl(e){const t=await this.getImageData(e);return!t||!t.startsWith("blob:")?t:vqe(t,this.getImageMimeType(e))}async enrichMediaElementsWithTiming(e,t,n=0){if(!(n>32)){for(const i of e){if(i.type!=="media")continue;const o=this.getXmlShapeId(i.rawXml);if(!o)continue;const a=t.get(o);if(a&&(a.fullScreen!==void 0&&(i.fullScreen=a.fullScreen),a.loop!==void 0&&(i.loop=a.loop),a.volume!==void 0&&(i.volume=a.volume),a.autoPlay!==void 0&&(i.autoPlay=a.autoPlay),a.playAcrossSlides!==void 0&&(i.playAcrossSlides=a.playAcrossSlides),a.hideWhenNotPlaying!==void 0&&(i.hideWhenNotPlaying=a.hideWhenNotPlaying),a.posterFramePath)){i.posterFramePath=a.posterFramePath;try{const s=await this.getImageData(a.posterFramePath);s&&(i.posterFrameData=s)}catch{}}}for(const i of e)i.type==="group"&&i.children&&await this.enrichMediaElementsWithTiming(i.children,t,n+1)}}parseNativeAnimations(e,t){const n=this.nativeAnimationService.parseNativeAnimations(e);if(!n)return;const r=c4n(n,i=>this.resolveThemeColor(i));for(const i of r)i.soundRId&&(i.soundPath=this.resolveRelationshipTarget(t,i.soundRId));return r}},D4n=class extends _4n{buildRelativeTargetPath(e,t){const n=e.split("/"),r=t.split("/");for(n.pop();n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...Array.from({length:n.length}).fill(".."),...r].join("/")}async setMasterThemeRelationship(e,t){const n=e.replace(/ppt\/slideMasters\/(slideMaster\d+)\.xml/,"ppt/slideMasters/_rels/$1.xml.rels"),r=this.zip.file(n);if(!r)return;const i=await r.async("string"),o=this.parser.parse(i),a=o.Relationships||{},s=this.ensureArray(a.Relationship),l=s.find(c=>String(c["@_Type"]||"").includes("/theme"));l&&(l["@_Target"]=this.buildRelativeTargetPath(e,t),a.Relationship=s,o.Relationships=a,this.zip.file(n,this.builder.build(o)))}async setPresentationTheme(e,t=!0){const n=e.trim().replace(/\\/g,"/");if(!n.startsWith("ppt/theme/"))return;const r=this.zip.file(/^ppt\/slideMasters\/slideMaster\d+\.xml$/);if(!r||r.length===0)return;const i=t?r:[r[0]];await Promise.all(i.map(async o=>{await this.setMasterThemeRelationship(o.name,n)}))}async readPartText(e){return this.zip.file(e)?.async("string")}async parseAppProperties(){try{const e=await this.readPartText("docProps/app.xml");return e===void 0?void 0:lhn(pKe(e))}catch(e){console.warn("Failed to parse app properties:",e);return}}async parseCoreProperties(){try{const e=await this.readPartText("docProps/core.xml");return e===void 0?void 0:shn(lKe(e))}catch(e){console.warn("Failed to parse core properties:",e);return}}async parseCustomProperties(){try{const e=await this.readPartText("docProps/custom.xml");return chn(Ocn(e))}catch(e){return console.warn("Failed to parse custom properties:",e),[]}}async parseCustDataLst(e,t,n){if(!e)return[];const r=e["p:custDataLst"];if(!r)return[];const i=this.ensureArray(r["p:custData"]);if(i.length===0)return[];const o=this.zip.file(t);if(!o)return[];const a=await o.async("string"),l=this.parser.parse(a).Relationships||{},c=this.ensureArray(l.Relationship),u=new Map;for(const p of c){const h=String(p["@_Id"]||"").trim(),f=String(p["@_Target"]||"").trim(),m=String(p["@_Type"]||"").trim();h&&f&&m.endsWith("/relationships/customXml")&&u.set(h,f)}const d=[];for(const p of i){const h=String(p["@_r:id"]||"").trim();if(!h)continue;const f=u.get(h);if(!f)continue;const m=n.slice(0,n.lastIndexOf("/")),g=lf(m,f);if(!g)continue;let y;try{const b=this.zip.file(g);b&&(y=await b.async("string"))}catch{}const v=await dAn(this.zip,{parse:b=>this.parser.parse(b)},g);d.push({id:g,relId:h,data:y,contentType:v,rawXml:p})}return d}async parsePresentationCustomerData(){try{const e=this.presentationData?.["p:presentation"];return await this.parseCustDataLst(e,"ppt/_rels/presentation.xml.rels","ppt/presentation.xml")}catch(e){return console.warn("Failed to parse presentation customer data:",e),[]}}async parseSlideCustomerData(e,t){try{const r=e["p:sld"]?.["p:cSld"],i=`${t.replace("slides/","slides/_rels/")}.rels`;return await this.parseCustDataLst(r,i,t)}catch(n){return console.warn(`Failed to parse slide customer data for ${t}:`,n),[]}}parseSlideActiveXControls(e){return aWe(e)}async parseThumbnail(){const e=["docProps/thumbnail.jpeg","docProps/thumbnail.jpg","docProps/thumbnail.png","docProps/thumbnail.emf"];for(const t of e){const n=this.zip.file(t);if(n)try{return await n.async("uint8array")}catch{}}return null}async parseTags(){try{return await kAn(this.zip,{parse:e=>this.parser.parse(e)})}catch(e){return console.warn("Failed to parse tags:",e),[]}}},R4n=class Une extends D4n{parseBackgroundColor(t){if(!t)return;const n=Dt(t,"p:bgPr");if(n)return this.parseColor(Dt(n,"a:solidFill"));const r=Dt(t,"p:bgRef");if(r)return this.parseColor(r)}extractPlaceholderList(t){if(!t)return[];const n=this.ensureArray(t["p:sp"]),r=[];for(const i of n){const o=xr(i,"p:nvSpPr","p:nvPr","p:ph");if(!o)continue;const a=(lr(o,"type")??"body").trim(),s=lr(o,"idx"),l=xr(i,"p:spPr","a:xfrm"),c=Dt(l,"a:off"),u=Dt(l,"a:ext");r.push({type:a,idx:s,...VL("x",rb(c,"x")),...VL("y",rb(c,"y")),...VL("width",rb(u,"cx")),...VL("height",rb(u,"cy"))})}return r}static ALLOWED_PATH_ROOTS=new Set(["ppt","customXml","docProps","_rels"]);resolvePath(t,n){const r=t.split("/").filter(Boolean),i=n.split("/");r.length>0&&!t.endsWith("/")&&r.pop();for(const s of i)if(s===".."){if(r.length===0)return"";r.pop()}else s!=="."&&r.push(s);const o=r.join("/");if(o.length===0)return"";const a=r[0];return Une.ALLOWED_PATH_ROOTS.has(a)?o:""}resolveImagePath(t,n){const r=t.substring(0,t.lastIndexOf("/")+1),i=n.startsWith("..")?this.resolvePath(r,n):n.startsWith("/")?n.substring(1):r+n;if(i.length===0)return"";const o=i.indexOf("/"),a=o===-1?i:i.substring(0,o);return Une.ALLOWED_PATH_ROOTS.has(a)?i:""}async parseSlideMasters(){const t=[];try{const n=this.zip.file(/^ppt\/slideMasters\/slideMaster\d+\.xml$/);if(!n||n.length===0)return t;for(const r of n){const i=r.name,o=await r.async("string"),a=this.parser.parse(o),s=a?.["p:sldMaster"];if(!s)continue;this.masterXmlMap.has(i)||this.masterXmlMap.set(i,a);const l=(lr(s["p:cSld"],"name")??"").trim(),c=s["p:cSld"]?.["p:bg"],u=this.parseBackgroundColor(c),d=s["p:cSld"]?.["p:spTree"],p=this.extractPlaceholderList(d);let h;const f=s["@_preserve"];if(f!==void 0){const w=String(f).trim().toLowerCase();h=w==="1"||w==="true"}let m;const g=i.replace(/ppt\/slideMasters\/(slideMaster\d+)\.xml/,"ppt/slideMasters/_rels/$1.xml.rels"),y=this.zip.file(g);if(y){const w=await y.async("string"),S=this.parser.parse(w),T=this.ensureArray(Dt(S,"Relationships")?.Relationship);for(const A of T)if(String(A["@_Type"]||"").includes("/theme")){m=this.resolveImagePath(i,String(A["@_Target"]||""));break}}const v=[];if(y){const w=await y.async("string"),S=this.parser.parse(w),T=this.ensureArray(Dt(S,"Relationships")?.Relationship);v.push(...a4n(s,T,A=>this.resolveImagePath(i,A)))}const b=[];for(const w of v){const S=await this.parseSlideLayoutAttributes(w);S&&b.push(S)}t.push({path:i,name:l.length>0?l:void 0,backgroundColor:u,themePath:m,layoutPaths:v.length>0?v:void 0,layouts:b.length>0?b:void 0,placeholders:p.length>0?p:void 0,preserve:h})}}catch(n){console.warn("Failed to parse slide masters:",n)}return t}async parseHandoutMaster(){try{const t=this.zip.file(/^ppt\/handoutMasters\/handoutMaster\d+\.xml$/);if(!t||t.length===0)return;const n=t[0].name,r=await t[0].async("string"),o=this.parser.parse(r)?.["p:handoutMaster"];if(!o)return;const a=xr(o,"p:cSld","p:bg"),s=this.parseBackgroundColor(a),l=xr(o,"p:cSld","p:spTree"),c=this.extractPlaceholderList(l),u={path:n,backgroundColor:s,placeholders:c};u.clrMap=Oke(o["p:clrMap"]);const d=qO(o["p:hf"]);return d&&(u.headerFooter=d),u}catch(t){console.warn("Failed to parse handout master:",t);return}}async parseNotesMaster(){try{const t=this.zip.file(/^ppt\/notesMasters\/notesMaster\d+\.xml$/);if(!t||t.length===0)return;const n=t[0].name,r=await t[0].async("string"),o=this.parser.parse(r)?.["p:notesMaster"];if(!o)return;const a=xr(o,"p:cSld","p:bg"),s=this.parseBackgroundColor(a),l=xr(o,"p:cSld","p:spTree"),c=this.extractPlaceholderList(l),u={path:n,backgroundColor:s,placeholders:c};u.clrMap=Oke(o["p:clrMap"]);const d=qO(o["p:hf"]);return d&&(u.headerFooter=d),u}catch(t){console.warn("Failed to parse notes master:",t);return}}async parseSlideLayoutAttributes(t){try{const n=this.zip.file(t);if(!n)return;const r=await n.async("string"),i=this.parser.parse(r),o=i?.["p:sldLayout"];if(!o)return;this.layoutXmlMap.has(t)||this.layoutXmlMap.set(t,i),this.slideRelsMap.has(t)||await this.loadPartRelationships(t);const a={path:t},s=(lr(Dt(o,"p:cSld"),"name")??"").trim();s&&(a.name=s);const l=String(o["@_matchingName"]||"").trim();l&&(a.matchingName=l);const c=o["@_preserve"];if(c!==void 0){const v=String(c).trim().toLowerCase();a.preserve=v==="1"||v==="true"}const u=o["@_showMasterPhAnim"];if(u!==void 0){const v=String(u).trim().toLowerCase();a.showMasterPhAnim=v!=="0"&&v!=="false"}const d=o["@_userDrawn"];if(d!==void 0){const v=String(d).trim().toLowerCase();a.userDrawn=v==="1"||v==="true"}const p=qO(o["p:hf"]);p&&(a.headerFooter=p);const h=o["p:clrMapOvr"];if(h&&h["a:masterClrMapping"]===void 0){const v=h["a:overrideClrMapping"],b=v?rQe(v,(w,S)=>{console.warn(`Slide layout ${t}: dropping clrMapOvr ${w}="${S}" (not an ST_ColorSchemeIndex token).`)}):null;b&&(a.clrMapOverride=b)}const f=xr(o,"p:cSld","p:bg"),m=this.parseBackgroundColor(f);m&&(a.backgroundColor=m);const g=xr(o,"p:cSld","p:spTree"),y=this.extractPlaceholderList(g);return y.length>0&&(a.placeholders=y),a}catch(n){console.warn("Failed to parse slide layout attributes:",n);return}}parseCustomShows(){try{return sle(this.presentationData,this.xmlLookupService)}catch(t){console.warn("Failed to parse custom slide shows:",t);return}}};function VL(e,t){return t===void 0?{}:{[e]:t/jr}}var L4n=class extends R4n{resolveThemeTypeface(e){throw new Error("resolveThemeTypeface not yet initialised")}async parsePresentationProperties(){try{const e=await this.zip.file("ppt/_rels/presentation.xml.rels")?.async("string");if(!e)return;const t=this.parser.parse(e),r=this.ensureArray(t?.Relationships?.Relationship).find(f=>String(f?.["@_Type"]||"").includes("presProps")||String(f?.["@_Target"]||"").includes("presProps")),i=r?String(r["@_Target"]||""):"presProps.xml",o=i.startsWith("/")?i.substring(1):`ppt/${i}`,a=await this.zip.file(o)?.async("string");if(!a)return;const s=this.parser.parse(a),l=Object.keys(s??{}).find(f=>this.compatibilityService.getXmlLocalName(f)==="presentationPr"),c=l?s[l]:void 0;if(!c)return;const u={},d=c["p:showPr"];d&&Object.assign(u,o4n(d,f=>this.parseColor(f)));const p=s1n(c,"prnPr");p&&(u.printProperties=o1n(p));const h=c["p:clrMru"];if(h){const m=this.ensureArray(h["a:srgbClr"]).map(g=>{const y=String(g?.["@_val"]||"").trim();return y.length>0?`#${y}`:""}).filter(g=>g.length>0);m.length>0&&(u.mruColors=m)}return u}catch(e){console.warn("Failed to parse presentation properties:",e);return}}async parseViewProperties(){try{const e=await this.zip.file("ppt/viewProps.xml")?.async("string");if(!e)return;const t=this.parser.parse(e),n=Object.keys(t??{}).find(i=>i.replace(/^.*:/u,"")==="viewPr"),r=n?t[n]:void 0;return r?WCn(r):void 0}catch(e){console.warn("Failed to parse view properties:",e);return}}parseChartContainerFormat(e){return Fet(e,t=>this.compatibilityService.getXmlLocalName(t),t=>this.parseColor(t))}resolveLegendOverlay(e,t){const n=o=>o==="0"||o==="false"||o===!1,r=this.xmlLookupService.getChildByLocalName(t,"overlay");return r?!n(r["@_val"]):t["@_overlay"]!==void 0?!n(t["@_overlay"]):this.xmlLookupService.getChildByLocalName(e,"chartData")?void 0:!0}extractChartStyle(e,t){if(!e&&!t)return;const n={};let r=!1;const i=this.xmlLookupService.getChildByLocalName(e,"style")??this.xmlLookupService.getChildrenArrayByLocalName(e,"AlternateContent").map(l=>this.xmlLookupService.getChildByLocalName(this.xmlLookupService.getChildByLocalName(l,"Fallback"),"style")).find(l=>l?.["@_val"]!==void 0);i?.["@_val"]&&(n.styleId=parseInt(String(i["@_val"])),r=!0);const o=this.parseChartContainerFormat(e);o.fill&&(n.chartAreaFill=o.fill,r=!0),o.border&&(n.chartAreaBorder=o.border,r=!0);const a=kT(this.xmlLookupService.getChildByLocalName(e,"spPr"),this.xmlLookupService,this.colorStyleCodec);a&&(n.chartAreaGradient=a,r=!0);const s=UZt(e,this.xmlLookupService,{parseColor:l=>this.parseColor(l)},l=>this.resolveThemeTypeface(l)??l);if(s&&(n.textStyle=s,r=!0),t){const l=this.xmlLookupService.getChildByLocalName(t,"legend");if(l){n.hasLegend=!0,r=!0;const p=this.xmlLookupService.getChildByLocalName(l,"legendPos")?.["@_val"]??l["@_pos"];p&&(n.legendPosition=String(p));const h=this.resolveLegendOverlay(e,l);h!==void 0&&(n.legendOverlay=h);const f=iEn(l,b=>this.compatibilityService.getXmlLocalName(b),b=>this.parseColor(b),b=>this.resolveThemeTypeface(b)??b);f.length>0&&(n.legendEntries=f);const m=this.xmlLookupService.getChildByLocalName(l,"txPr"),g=this.xmlLookupService.getChildByLocalName(e,"txPr"),y=zp(m??g,this.xmlLookupService),v=Ld(y,this.xmlLookupService,{parseColor:b=>this.parseColor(b)},b=>this.resolveThemeTypeface(b)??b);v&&(n.legendTextStyle=v)}const c=this.xmlLookupService.getChildByLocalName(t,"title");c&&(n.hasTitle=!0,r=!0,Object.assign(n,i4n(c,this.xmlLookupService,{parseColor:(d,p)=>this.parseColor(d,p)},d=>this.resolveThemeTypeface(d)??d)));const u=this.xmlLookupService.getChildByLocalName(t,"plotArea");if(u){const d=kT(this.xmlLookupService.getChildByLocalName(u,"spPr"),this.xmlLookupService,this.colorStyleCodec);d&&(n.plotAreaGradient=d);const p=this.parseChartContainerFormat(u);p.fill&&(n.plotAreaFill=p.fill,r=!0),p.border&&(n.plotAreaBorder=p.border,r=!0);const h=this.xmlLookupService.getChildByLocalName(u,"valAx");h&&this.xmlLookupService.getChildByLocalName(h,"majorGridlines")&&(n.hasGridlines=!0,r=!0);const f=Object.keys(u).filter(m=>this.compatibilityService.getXmlLocalName(m).endsWith("Chart"));for(const m of f){const g=u[m];if(!g)continue;const y=this.xmlLookupService.getChildByLocalName(g,"dLbls");if(y&&!n.dataLabels&&(r4n(y,this.xmlLookupService)?n.hasDataLabels=!1:Fke(y,this.xmlLookupService)&&(n.hasDataLabels=!0),n.dataLabels=Vce(y,this.xmlLookupService,{parseColor:(v,b)=>this.parseColor(v,b)},v=>this.resolveThemeTypeface(v)??v),r=!0),!n.hasDataLabels){const v=this.xmlLookupService.getChildrenArrayByLocalName(g,"ser");for(const b of v){const w=this.xmlLookupService.getChildByLocalName(b,"dLbls");Fke(w,this.xmlLookupService)&&(n.hasDataLabels=!0,r=!0)}}}}}return r?n:void 0}toPresentationTarget(e){const t=e.startsWith("/")?e.substring(1):e;return t.startsWith("ppt/")?t.substring(4):t}toSlidePathFromTarget(e){const t=e.startsWith("/")?e.substring(1):e;return t.startsWith("ppt/")?t:`ppt/${t}`}toSlideRelsPath(e){return`${e.replace("slides/","slides/_rels/")}.rels`}},N4n=class extends L4n{createEmptySlideXml(){return{"p:sld":{"@_xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","@_xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","@_xmlns:p":"http://schemas.openxmlformats.org/presentationml/2006/main","p:cSld":{"p:spTree":{"p:nvGrpSpPr":{"p:cNvPr":{"@_id":"1","@_name":""},"p:cNvGrpSpPr":{},"p:nvPr":{}},"p:grpSpPr":{"a:xfrm":{"a:off":{"@_x":"0","@_y":"0"},"a:ext":{"@_cx":"0","@_cy":"0"},"a:chOff":{"@_x":"0","@_y":"0"},"a:chExt":{"@_cx":"0","@_cy":"0"}}}}},"p:clrMapOvr":{"a:masterClrMapping":{}}}}}deepCloneXml(e){if(e)try{return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}catch{return}}findSourceSlidePath(e){if(e&&this.slideMap.has(e)&&e.startsWith("ppt/slides/slide"))return e}async loadSlideRelationships(e,t){await this.loadPartRelationships(e,t)}async reconcilePresentationSlidesForSave(e){return await this.presentationSlidesReconciler.reconcile({...e,zip:this.zip,parser:this.parser,xmlBuilder:this.builder,presentationData:this.presentationData,slideMap:this.slideMap,slideRelsMap:this.slideRelsMap,toPresentationTarget:t=>this.toPresentationTarget(t),toSlidePathFromTarget:t=>this.toSlidePathFromTarget(t),toSlideRelsPath:t=>this.toSlideRelsPath(t),createEmptySlideXml:()=>this.createEmptySlideXml(),deepCloneXml:t=>this.deepCloneXml(t),findSourceSlidePath:t=>this.findSourceSlidePath(t),loadSlideRelationships:(t,n)=>this.loadSlideRelationships(t,n),onSlidePartsDuplicated:t=>{for(const[n,r]of t){const i=this.chartDataBaselines.get(n);if(!i)continue;const o=JSON.parse(i);cde(o,t),this.chartDataBaselines.set(r,JSON.stringify(o))}}})}buildSlideTransitionXml(e){return this.slideTransitionService.buildSlideTransitionXml(e)}embedTransitionSound(e,t){if(typeof e.soundData!="string"||e.soundData.length===0)return;const n=this.parseDataUrlToBytes(e.soundData);if(!n){this.compatibilityService.reportWarning({code:"SAVE_TRANSITION_SOUND_PAYLOAD_UNSUPPORTED",message:"Transition sound payload could not be converted to an embedded media part and was dropped.",scope:"save",slideId:t.slideId}),delete e.soundData;return}const r=t.saveSession.nextMediaPath(n.extension,"audio");this.zip.file(r,n.bytes);const i=t.slideRelationshipRegistry.nextRelationshipId();t.slideRelationshipRegistry.upsertRelationship(i,t.slideAudioRelationshipType,r.replace(/^ppt\//u,"../")),e.soundRId=i,e.soundPath=r,delete e.soundData}applyEditorAnimations(e,t){this.editorAnimationService.applyEditorAnimations(e,t)}ensureSlideTree(e){e["p:sld"]||(e["p:sld"]={});const t=e["p:sld"];t["p:cSld"]||(t["p:cSld"]={});const n=t["p:cSld"];if(!n["p:spTree"]){const r=this.createEmptySlideXml(),i=r["p:sld"]?.["p:cSld"]?.["p:spTree"];i&&(n["p:spTree"]=i)}return t["p:cSld"]=n,e["p:sld"]=t,n["p:spTree"]}parseDataUrlToBytes(e){return wu(e)}async resolveMediaToBytes(e){const t=wu(e);return t||F7e(e)}textAlignToDrawingValue(e){if(e==="left")return"l";if(e==="center")return"ctr";if(e==="right")return"r";if(e==="justify")return"just";if(e==="justLow")return"justLow";if(e==="dist")return"dist";if(e==="thaiDist")return"thaiDist"}pixelsToPoints(e){return e*(72/96)}createParagraphSpacingXmlFromPx(e){if(typeof e!="number"||!Number.isFinite(e))return;const t=Math.max(0,this.pixelsToPoints(e));return{"a:spcPts":{"@_val":String(Math.round(t*100))}}}createLineSpacingXmlFromMultiplier(e){if(typeof e!="number"||!Number.isFinite(e))return;const t=Math.max(.1,Math.min(5,e));return{"a:spcPct":{"@_val":String(Math.round(t*1e5))}}}},df=9525;function F4n(e,t){const n=!!e.textShadowColor||typeof e.textShadowBlur=="number"&&e.textShadowBlur>0,r=!!e.textInnerShadowColor||typeof e.textInnerShadowBlur=="number"&&e.textInnerShadowBlur>0,i=!!e.textPresetShadowName,o=!!e.textGlowColor||typeof e.textGlowRadius=="number"&&e.textGlowRadius>0,a=!!e.textReflection,s=typeof e.textBlurRadius=="number"&&e.textBlurRadius>0,l=typeof e.textSoftEdgeRadius=="number"&&e.textSoftEdgeRadius>0,c=typeof e.textAlphaModFix=="number",u=typeof e.textAlphaMod=="number",d=typeof e.textHslHue=="number"||typeof e.textHslSaturation=="number"||typeof e.textHslLuminance=="number",p=!!e.textClrChangeFrom&&!!e.textClrChangeTo,h=!!e.textDuotone;if(!(n||r||i||o||a||s||l||c||u||d||p||h))return;const m={};return n&&(m["a:outerShdw"]=O4n(e)),r&&(m["a:innerShdw"]=B4n(e,t)),i&&(m["a:prstShdw"]=j4n(e)),o&&(m["a:glow"]=U4n(e,t)),a&&(m["a:reflection"]=z4n(e)),s&&(m["a:blur"]={"@_rad":String(Math.round((e.textBlurRadius??0)*df))}),l&&(m["a:softEdge"]={"@_rad":String(Math.round((e.textSoftEdgeRadius??0)*df))}),c&&(m["a:alphaModFix"]={"@_amt":String(Math.round((e.textAlphaModFix??100)*1e3))}),u&&(m["a:alphaMod"]={"@_amt":String(Math.round((e.textAlphaMod??100)*1e3))}),d&&(m["a:hsl"]=$4n(e)),p&&(m["a:clrChange"]=H4n(e)),h&&e.textDuotone&&(m["a:duotone"]={"a:srgbClr":[{"@_val":e.textDuotone.color1.replace("#","")},{"@_val":e.textDuotone.color2.replace("#","")}]}),m}function Ttt(e,t){const n=e.replace("#",""),r=typeof t=="number"?Math.round(t*1e5):void 0;return{"@_val":n,...r!==void 0?{"a:alpha":{"@_val":String(r)}}:{}}}function O4n(e){const t=e.textShadowOffsetX??0,n=e.textShadowOffsetY??0,{distance:r,directionDegrees:i}=Eb(t,n);return{"@_blurRad":String(Math.round((e.textShadowBlur??4)*df)),"@_dist":String(Math.round(r*df)),"@_dir":_p(i),"a:srgbClr":Ttt(e.textShadowColor||"#000000",e.textShadowOpacity)}}function B4n(e,t){const n=e.textInnerShadowOffsetX??0,r=e.textInnerShadowOffsetY??0,{distance:i,directionDegrees:o}=Eb(n,r),a=e.textInnerShadowColor||"#000000",s=e.textInnerShadowColorXml?t?.(e.textInnerShadowColorXml):void 0;return{"@_blurRad":String(Math.round((e.textInnerShadowBlur??3)*df)),"@_dist":String(Math.round(i*df)),"@_dir":_p(o),...Ex(e.textInnerShadowColorRef,e.textInnerShadowColorXml,s,a,e.textInnerShadowOpacity)}}function j4n(e){const t={"@_prst":e.textPresetShadowName};return typeof e.textPresetShadowDistance=="number"&&(t["@_dist"]=String(Math.round(e.textPresetShadowDistance*df))),typeof e.textPresetShadowDirection=="number"&&(t["@_dir"]=_p(e.textPresetShadowDirection)),e.textPresetShadowColor&&(t["a:srgbClr"]=Ttt(e.textPresetShadowColor,e.textPresetShadowOpacity)),t}function U4n(e,t){const n=e.textGlowColor||"#ffff00",r=e.textGlowColorXml?t?.(e.textGlowColorXml):void 0;return{"@_rad":String(Math.round((e.textGlowRadius??6)*df)),...Ex(e.textGlowColorRef,e.textGlowColorXml,r,n,e.textGlowOpacity)}}function z4n(e){const t={};return typeof e.textReflectionBlur=="number"&&(t["@_blurRad"]=String(Math.round(e.textReflectionBlur*df))),typeof e.textReflectionStartOpacity=="number"&&(t["@_stA"]=String(Math.round(e.textReflectionStartOpacity*1e5))),typeof e.textReflectionEndOpacity=="number"&&(t["@_endA"]=String(Math.round(e.textReflectionEndOpacity*1e5))),typeof e.textReflectionEndPosition=="number"&&(t["@_endPos"]=String(Math.round(e.textReflectionEndPosition*1e5))),typeof e.textReflectionOffset=="number"&&(t["@_dist"]=String(Math.round(e.textReflectionOffset*df))),typeof e.textReflectionDirection=="number"&&(t["@_dir"]=_p(e.textReflectionDirection)),typeof e.textReflectionScaleX=="number"&&(t["@_sx"]=String(Math.round(e.textReflectionScaleX))),typeof e.textReflectionScaleY=="number"&&(t["@_sy"]=String(Math.round(e.textReflectionScaleY))),typeof e.textReflectionSkewX=="number"&&(t["@_kx"]=String(Math.round(e.textReflectionSkewX))),typeof e.textReflectionSkewY=="number"&&(t["@_ky"]=String(Math.round(e.textReflectionSkewY))),typeof e.textReflectionRotation=="number"&&(t["@_rot"]=String(Math.round(e.textReflectionRotation*6e4))),typeof e.textReflectionFadeDirection=="number"&&(t["@_fadeDir"]=_p(e.textReflectionFadeDirection)),e.textReflectionAlignment&&(t["@_algn"]=e.textReflectionAlignment),t}function $4n(e){const t={};return typeof e.textHslHue=="number"&&(t["@_hue"]=String(Math.round(e.textHslHue*6e4))),typeof e.textHslSaturation=="number"&&(t["@_sat"]=String(Math.round(e.textHslSaturation*1e3))),typeof e.textHslLuminance=="number"&&(t["@_lum"]=String(Math.round(e.textHslLuminance*1e3))),t}function H4n(e){return{"a:clrFrom":{"a:srgbClr":{"@_val":(e.textClrChangeFrom||"").replace("#","")}},"a:clrTo":{"a:srgbClr":{"@_val":(e.textClrChangeTo||"").replace("#","")}}}}function G4n(e,t,n,r){return t&&t.length>0&&(e["@_panose"]=t),typeof n=="number"&&Number.isFinite(n)&&(e["@_pitchFamily"]=String(n)),typeof r=="number"&&Number.isFinite(r)&&(e["@_charset"]=String(r)),e}function Jq(e,t,n,r,i){const o=e.authoredRunStyle,a=e.inheritedRunStyle;return o===void 0&&a===void 0?e[t]:o?.[t]!==void 0?o[t]:(a?.[r]??a?.[n])===i?a?.[t]:void 0}function V4n(e){const t={};return typeof e.widthEmu=="number"&&Number.isFinite(e.widthEmu)&&(t["@_w"]=String(Math.round(e.widthEmu))),e.compound&&(t["@_cmpd"]=e.compound),e.cap&&(t["@_cap"]=e.cap),e.algn&&(t["@_algn"]=e.algn),e.prstDash&&(t["a:prstDash"]={"@_val":e.prstDash}),e.headEndXml&&(t["a:headEnd"]=e.headEndXml),e.tailEndXml&&(t["a:tailEnd"]=e.tailEndXml),t}var W4n=class Att extends N4n{createRunPropertiesFromTextStyle(t,n){if(!t)return{"@_lang":"en-US","@_dirty":"0"};const r=t4n(t),i={};r("language")&&(i["@_lang"]=t.language||"en-US"),typeof t.fontSize=="number"&&Number.isFinite(t.fontSize)&&r("fontSize")&&(i["@_sz"]=String(Math.round(t.fontSize*(72/96)*100))),t.bold!==void 0&&r("bold")&&(i["@_b"]=t.bold?"1":"0"),t.italic!==void 0&&r("italic")&&(i["@_i"]=t.italic?"1":"0");const o=r("underline","underlineStyle","underlineExplicitNone");if(t.underline&&o?i["@_u"]=t.underlineStyle||"sng":t.underlineExplicitNone&&o&&(i["@_u"]="none"),t.strikethrough!==void 0&&r("strikethrough","strikeType")&&(i["@_strike"]=t.strikethrough?t.strikeType||"sngStrike":"noStrike"),typeof t.baseline=="number"&&r("baseline")){const h=t.authoredRunStyle?.baseline!==void 0||(t.inheritedRunStyle?.baseline??0)!==0;(t.baseline!==0||h)&&(i["@_baseline"]=String(t.baseline))}typeof t.characterSpacing=="number"&&t.characterSpacing!==0&&r("characterSpacing")&&(i["@_spc"]=String(t.characterSpacing)),typeof t.kerning=="number"&&t.kerning!==0&&r("kerning")&&(i["@_kern"]=String(t.kerning));const a=r("textCaps","textCapsExplicitNone");if(t.textCaps&&t.textCaps!=="none"&&a?i["@_cap"]=t.textCaps:t.textCapsExplicitNone&&a&&(i["@_cap"]="none"),t.kumimoji!==void 0&&r("kumimoji")&&(i["@_kumimoji"]=t.kumimoji?"1":"0"),t.normalizeHeight!==void 0&&r("normalizeHeight")&&(i["@_normalizeH"]=t.normalizeHeight?"1":"0"),t.noProof!==void 0&&r("noProof")&&(i["@_noProof"]=t.noProof?"1":"0"),r("dirty")&&(i["@_dirty"]=t.dirty?"1":"0"),t.spellingError!==void 0&&r("spellingError")&&(i["@_err"]=t.spellingError?"1":"0"),t.smartTagClean!==void 0&&r("smartTagClean")&&(i["@_smtClean"]=t.smartTagClean?"1":"0"),t.bookmark&&r("bookmark")&&(i["@_bmk"]=t.bookmark),t.altLanguage&&r("altLanguage")&&(i["@_altLang"]=t.altLanguage),typeof t.smartTagId=="number"&&Number.isFinite(t.smartTagId)&&r("smartTagId")&&(i["@_smtId"]=String(t.smartTagId)),(t.textOutlineWidth||t.textOutlineColor)&&r("textOutlineWidth","textOutlineColor","textOutlineDash")){const h={};typeof t.textOutlineWidth=="number"&&t.textOutlineWidth>0&&(h["@_w"]=String(Math.round(t.textOutlineWidth*Att.EMU_PER_PX))),t.textOutlineColor&&(h["a:solidFill"]={"a:srgbClr":{"@_val":t.textOutlineColor.replace("#","")}}),t.textOutlineDash&&(h["a:prstDash"]={"@_val":t.textOutlineDash}),i["a:ln"]=h}const s=r("textFillNone","color","textFillGradientStops","textFillGradientType","textFillPattern","textFillBlipXml");if(s&&t.textFillNone)i["a:noFill"]={};else if(s&&t.color){const h=t.colorXml?this.parseColor(t.colorXml):void 0;i["a:solidFill"]=Ex(t.colorRef,t.colorXml,h,t.color)}else if(s&&t.textFillGradientStops&&t.textFillGradientStops.length>0){const h=t.textFillGradientStops.filter(f=>!!f?.color).map(f=>{const m=(f.position??0)/100,g=Math.round(Math.max(0,Math.min(1,m))*1e5),y={"@_pos":String(g),"a:srgbClr":{"@_val":String(f.color||"").replace("#","")}};return typeof f.opacity=="number"&&Number.isFinite(f.opacity)&&f.opacity<1&&(y["a:srgbClr"]["a:alpha"]={"@_val":String(Math.round(f.opacity*1e5))}),y});if(h.length>0){const f={"a:gsLst":{"a:gs":h}};if((t.textFillGradientType||"linear")==="linear"){const g=typeof t.textFillGradientAngle=="number"&&Number.isFinite(t.textFillGradientAngle)?t.textFillGradientAngle:0;f["a:lin"]={"@_ang":String(Math.round(g*6e4)),"@_scaled":"1"}}else f["a:path"]={"@_path":"circle"};i["a:gradFill"]=f}}else if(s&&t.textFillPattern){const h={"@_prst":t.textFillPattern};t.textFillPatternForeground&&(h["a:fgClr"]={"a:srgbClr":{"@_val":t.textFillPatternForeground.replace("#","")}}),t.textFillPatternBackground&&(h["a:bgClr"]={"a:srgbClr":{"@_val":t.textFillPatternBackground.replace("#","")}}),i["a:pattFill"]=h}else s&&t.textFillBlipXml&&(i["a:blipFill"]=t.textFillBlipXml);const l=F4n(t,h=>this.parseColor(h));if(l?i["a:effectLst"]=l:t.textEffectsExplicitNone&&(i["a:effectLst"]={}),t.textEffectDagXml&&(i["a:effectDag"]=t.textEffectDagXml),t.highlightColor&&r("highlightColor")){const h=t.highlightColorXml?this.parseColor(t.highlightColorXml):void 0;i["a:highlight"]=Ex(void 0,t.highlightColorXml,h,t.highlightColor)}t.underlineLineFollowsText&&r("underlineLineFollowsText")?i["a:uLnTx"]={}:t.underlineLine&&r("underlineLine")&&(i["a:uLn"]=V4n(t.underlineLine)),t.underlineFillFollowsText&&r("underlineFillFollowsText")?i["a:uFillTx"]={}:t.underline&&t.underlineColor&&r("underlineColor")&&(i["a:uFill"]={"a:solidFill":{"a:srgbClr":{"@_val":t.underlineColor.replace("#","")}}});const c=(h,f,m,g)=>G4n({"@_typeface":h},Jq(t,`${f}Panose`,m,g,h),Jq(t,`${f}PitchFamily`,m,g,h),Jq(t,`${f}Charset`,m,g,h)),u=t.latinFontThemeToken??t.fontFamily;u&&r("fontFamily","latinFontThemeToken")&&(i["a:latin"]=c(u,"latinFont","fontFamily","latinFontThemeToken"));const d=t.eastAsiaFontThemeToken??t.eastAsiaFont;d&&r("eastAsiaFont","eastAsiaFontThemeToken")&&(i["a:ea"]=c(d,"eastAsiaFont","eastAsiaFont","eastAsiaFontThemeToken"));const p=t.complexScriptFontThemeToken??t.complexScriptFont;if(p&&r("complexScriptFont","complexScriptFontThemeToken")&&(i["a:cs"]=c(p,"complexScriptFont","complexScriptFont","complexScriptFontThemeToken")),t.symbolFont&&r("symbolFont")&&(i["a:sym"]=c(t.symbolFont,"symbolFont","symbolFont","symbolFont")),t.hyperlink&&n){const h=String(t.hyperlink).trim();if(h.startsWith("ppaction://")){const f={"@_action":h};t.hyperlinkTooltip&&(f["@_tooltip"]=t.hyperlinkTooltip),t.hyperlinkRId&&(f["@_r:id"]=t.hyperlinkRId),this.applyHyperlinkExtraAttrs(f,t),i["a:hlinkClick"]=f}else if(h.length>0){const f=n(h);if(f){const m={"@_r:id":f};t.hyperlinkTooltip&&(m["@_tooltip"]=t.hyperlinkTooltip),t.hyperlinkAction&&(m["@_action"]=t.hyperlinkAction),this.applyHyperlinkExtraAttrs(m,t),i["a:hlinkClick"]=m}}}if(t.hyperlinkMouseOver&&n){const h=String(t.hyperlinkMouseOver).trim();if(h.length>0){const f=n(h);if(f){const m={"@_r:id":f};t.hyperlinkMouseOverSoundXml&&typeof t.hyperlinkMouseOverSoundXml=="object"&&(m["a:snd"]=t.hyperlinkMouseOverSoundXml),i["a:hlinkMouseOver"]=m}}}return t.rtl!==void 0&&r("rtl")&&(i["a:rtl"]={"@_val":t.rtl?"1":"0"}),t.runPropertiesExtLstXml&&typeof t.runPropertiesExtLstXml=="object"&&(i["a:extLst"]=t.runPropertiesExtLstXml),Object.keys(i).length>0?i:void 0}applyHyperlinkExtraAttrs(t,n){n.hyperlinkInvalidUrl&&(t["@_invalidUrl"]=n.hyperlinkInvalidUrl),n.hyperlinkTargetFrame&&(t["@_tgtFrame"]=n.hyperlinkTargetFrame),n.hyperlinkHistory!==void 0&&(t["@_history"]=n.hyperlinkHistory?"1":"0"),n.hyperlinkHighlightClick!==void 0&&(t["@_highlightClick"]=n.hyperlinkHighlightClick?"1":"0"),n.hyperlinkEndSound!==void 0&&(t["@_endSnd"]=n.hyperlinkEndSound?"1":"0"),n.hyperlinkSoundXml&&typeof n.hyperlinkSoundXml=="object"&&(t["a:snd"]=n.hyperlinkSoundXml),n.hyperlinkExtensionXml&&typeof n.hyperlinkExtensionXml=="object"&&(t["a:extLst"]=n.hyperlinkExtensionXml)}},X4n=new Set(["authoredRunStyle","inheritedRunStyle"]);function jke(e,t){const n=e.inheritedRunStyle;if(!n)return e;const r=e.authoredRunStyle,i=t??{},o={...n,...i};for(const[a,s]of Object.entries(e)){if(X4n.has(a))continue;const l=a,c=r?.[l]??n[l];s!==c&&(o[a]=s)}return o.authoredRunStyle=i,o.inheritedRunStyle=n,o}function q4n(e){const t=e.rubyPropertiesXml;if(t){const r={...t},i=String(t["@_algn"]??t["a:rubyAlign"]?.["@_val"]??"ctr").trim();return e.rubyAlignment&&e.rubyAlignment!==i&&(r["@_algn"]=e.rubyAlignment),r}const n={};return e.rubyAlignment&&(n["@_algn"]=e.rubyAlignment),e.rubyFontSize!==void 0&&(n["@_hps"]=String(Math.round(e.rubyFontSize*2))),n}function Uke(e,t){const n={};return e&&(n["a:rPr"]=e),n["a:t"]=t,n}function K4n(e,t,n){const r=e.rubyRunAuthoredStyles,i=r?jke(t,r.outer):t,o=r?jke(t,r.base):t,a={},s=n(i);return s&&(a["a:rPr"]=s),a["a:ruby"]={"a:rubyPr":q4n(e),"a:rt":{"a:r":Uke(n(e.rubyStyle??t),e.rubyText??"")},"a:rubyBase":{"a:r":Uke(n(o),e.text)}},a}function Y4n(e){if(!e||e.rtl===void 0)return e;const{rtl:t,...n}=e;return n}function Z4n(e){const t=e?.inheritedRunStyle;if(!e||!t)return e;const n=e.authoredRunStyle,r={};for(const[i,o]of Object.entries(e)){const a=i,s=n?.[a]??t[a];s!==void 0&&s===o||(r[i]=o)}return r}var J4n=class extends W4n{createParagraphsFromTextContent(e,t,n,r){const i=Y4n(t),o=(S,T,A,E,k,M)=>{const I=k?{...t,...k}:t,D=this.textAlignToDrawingValue(I?.align),R={spacingBefore:this.createParagraphSpacingXmlFromPx(I?.paragraphSpacingBefore),spacingAfter:this.createParagraphSpacingXmlFromPx(I?.paragraphSpacingAfter),lineSpacing:this.createLineSpacingXmlFromMultiplier(I?.lineSpacing),lineSpacingExactPt:I?.lineSpacingExactPt},_=wtt(I,D,T,R,A,k);return Qkn(S,_,E,M)},a=S=>S,s=(S,T)=>{const A=this.createRunPropertiesFromTextStyle(T,r),E={};return A&&(E["a:rPr"]=A),E["a:t"]=a(S),E},l=(S,T,A,E,k,M)=>{const I={"@_type":A};E&&(k==="uuid"?I["@_uuid"]=E:I["@_id"]=E);const D=this.createRunPropertiesFromTextStyle(T,r);return D&&(I["a:rPr"]=D),M&&typeof M=="object"&&(I["a:pPr"]=M),I["a:t"]=a(S),I},c=(S,T)=>K4n(S,T,A=>this.createRunPropertiesFromTextStyle(A,r)),u=[];let d=[],p,h,f,m,g={},y=!1;const v=()=>{const S=o(d,p,h,f,m,g);d.length===0&&delete S["a:r"],u.push(S),d=[],p=void 0,h=void 0,f=void 0,m=void 0,g={},y=!1};if(n&&n.length>0){const S=Ykn(i,n),T=Z4n(i);return n.forEach(A=>{const E={...A.style?.inheritedRunStyle?T:i,...A.style,...S};if(y||(A.bulletInfo&&(p=A.bulletInfo),A.paragraphLevel!==void 0&&(h=A.paragraphLevel),A.endParaRunProperties&&(f=A.endParaRunProperties),f=Wkn(f,A.paragraphInsertionStyle,D=>this.createRunPropertiesFromTextStyle(D,r)??{}),A.paragraphProperties&&(m=A.paragraphProperties),g={emptyParagraphPropertiesAuthored:A.emptyParagraphPropertiesAuthored,bareParagraph:A.bareParagraph},y=!0),AQe(A))return;if(A.isLineBreak){const D={};if(A.breakRunProperties&&typeof A.breakRunProperties=="object")D["a:rPr"]={...A.breakRunProperties};else{const R=this.createRunPropertiesFromTextStyle(E,r);R&&(D["a:rPr"]=R)}D.__isLineBreak=!0,d.push(D);return}if(A.equationXml&&typeof A.equationXml=="object"){const D={__isEquation:!0,__equationXml:A.equationSourceXml??A.equationXml};d.push(D);return}const k=A.isParagraphBreak?`
351
+ `:n,style:{}}))}function eAn(e,t){const n=[];let r=0,i=!1;for(const o of e){let a=o;if(!i){i=!0;const s=t[r];s&&!qet(s)&&(a={...o},s.paragraphProperties&&a.paragraphProperties===void 0&&(a.paragraphProperties=s.paragraphProperties),s.endParaRunProperties&&a.endParaRunProperties===void 0&&(a.endParaRunProperties=s.endParaRunProperties),s.paragraphLevel!==void 0&&a.paragraphLevel===void 0&&(a.paragraphLevel=s.paragraphLevel),s.bulletInfo&&a.bulletInfo===void 0&&(a.bulletInfo=s.bulletInfo),s.emptyParagraphPropertiesAuthored&&(a.emptyParagraphPropertiesAuthored=!0),s.bareParagraph&&(a.bareParagraph=!0))}n.push(a);for(let s=0;s<Ket(a);s++)r++,i=!1}return n}function tAn(e,t,n){if(!n||n.length===0)return e;if(e===void 0&&n.some(i=>i.isLineBreak)&&ZTn(n)===D$(t))return n;const r=JTn(n);return r.every(qet)?e:eAn(e??QTn(t),r)}var nAn=["p:present","p:browse","p:kiosk"],rAn=["p:sldAll","p:sldRg","p:custShow"];function iAn(e){return e.showType!==void 0||e.loopContinuously!==void 0||e.showWithNarration!==void 0||e.showWithAnimation!==void 0||e.advanceMode!==void 0||e.showSlidesMode!==void 0||e.showSlidesFrom!==void 0||e.showSlidesTo!==void 0||e.showSlidesCustomShowId!==void 0||e.kioskRestartTime!==void 0||e.penColor!==void 0||e.showScrollbar!==void 0}var Yet=(e,t)=>{for(const n of t)if(e[n]!==void 0)return[n,e[n]]};function oAn(e,t,n){if(n.showType==="browsed"){const i={},o=t["p:browse"];n.showScrollbar!==void 0?i["@_showScrollbar"]=n.showScrollbar?"1":"0":o?.["@_showScrollbar"]!==void 0&&(i["@_showScrollbar"]=o["@_showScrollbar"]),e["p:browse"]=i;return}if(n.showType==="kiosk"){const i={};n.kioskRestartTime!==void 0&&n.kioskRestartTime>0&&(i["@_restart"]=String(n.kioskRestartTime)),e["p:kiosk"]=i;return}if(n.showType==="presented"){e["p:present"]={};return}const r=Yet(t,nAn);r?e[r[0]]=r[1]:e["p:present"]={}}function aAn(e,t,n){if(n.showSlidesMode==="range"){e["p:sldRg"]={"@_st":String(n.showSlidesFrom??1),"@_end":String(n.showSlidesTo??1)};return}if(n.showSlidesMode==="customShow"&&n.showSlidesCustomShowId){e["p:custShow"]={"@_id":n.showSlidesCustomShowId};return}if(n.showSlidesMode==="all"){e["p:sldAll"]={};return}const r=Yet(t,rAn);r?e[r[0]]=r[1]:e["p:sldAll"]={}}function sAn(e,t){if(!e&&!iAn(t))return;const n=e??{},r={};for(const i of Object.keys(n))i.startsWith("@_")&&(r[i]=n[i]);if(t.loopContinuously!==void 0&&(r["@_loop"]=t.loopContinuously?"1":"0"),t.showWithNarration!==void 0&&(r["@_showNarration"]=t.showWithNarration?"1":"0"),t.showWithAnimation!==void 0&&(r["@_showAnimation"]=t.showWithAnimation?"1":"0"),t.advanceMode!==void 0&&(r["@_useTimings"]=t.advanceMode==="useTimings"?"1":"0"),oAn(r,n,t),aAn(r,n,t),t.penColor){const i=t.penColorXml!==void 0&&ku(t.penColorOriginal,t.penColor);r["p:penClr"]=i?t.penColorXml:{"a:srgbClr":{"@_val":t.penColor.replace("#","")}}}else n["p:penClr"]!==void 0&&(r["p:penClr"]=n["p:penClr"]);return n["p:sldLst"]!==void 0&&(r["p:sldLst"]=n["p:sldLst"]),n["p:extLst"]!==void 0&&(r["p:extLst"]=n["p:extLst"]),r}var lAn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",cAn="application/xml";async function uAn(e,t,n){let r=bAn(e)+1;const i=new Map;for(const o of t){const a=await e.file(o.sourcePartPath)?.async("string");if(!a)continue;const s=n.parse(a),l=pAn(s,o.location);if(!l)continue;const c=xAn(o.sourcePartPath),u=await e.file(c)?.async("string"),d=u?n.parse(u):{Relationships:{"@_xmlns":"http://schemas.openxmlformats.org/package/2006/relationships"}},p=d.Relationships??={},h=w9(p.Relationship),f=[];for(const g of o.entries){const v=(g.id?lf("",g.id):null)||`customXml/item${r++}.xml`;if(g.data===void 0&&!e.file(v))continue;g.id=v,g.contentType??=cAn,g.data!==void 0&&e.file(v,g.data);const b=hAn(h,g,yAn(o.sourcePartPath,v));g.relId=String(b["@_Id"]);const w={...g.rawXml??{},"@_r:id":g.relId};g.rawXml=w,f.push(w),i.set(v,g.contentType)}const m=l["p:custDataLst"]??{};m["p:custData"]=f,mAn(l,m,o.location),p.Relationship=h,e.file(c,n.build(d)),e.file(o.sourcePartPath,n.build(s))}await gAn(e,n,i)}async function dAn(e,t,n){const r=await e.file("[Content_Types].xml")?.async("string");if(!r)return;const i=t.parse(r).Types,o=w9(i?.Override).find(l=>l["@_PartName"]===`/${n}`);if(o?.["@_ContentType"])return String(o["@_ContentType"]);const a=n.split(".").pop()?.toLowerCase(),s=w9(i?.Default).find(l=>String(l["@_Extension"]??"").toLowerCase()===a);return s?.["@_ContentType"]?String(s["@_ContentType"]):void 0}function pAn(e,t){return t==="presentation"?e["p:presentation"]:e["p:sld"]?.["p:cSld"]}function hAn(e,t,n){let r=e.find(i=>String(i["@_Id"]??"")===t.relId&&fAn(i["@_Type"]));return r||(t.relId=vAn(e),r={},e.push(r)),r["@_Id"]=t.relId,r["@_Type"]=lAn,r["@_Target"]=n,delete r["@_TargetMode"],r}function fAn(e){return String(e??"").endsWith("/relationships/customXml")}function mAn(e,t,n){const r=n==="presentation"?new Set(["p:kinsoku","p:defaultTextStyle","p:modifyVerifier","p:extLst"]):new Set(["p:controls","p:extLst"]),i={};let o=!1;for(const[a,s]of Object.entries(e))a!=="p:custDataLst"&&(!o&&r.has(a)&&(i["p:custDataLst"]=t,o=!0),i[a]=s);o||(i["p:custDataLst"]=t);for(const a of Object.keys(e))delete e[a];Object.assign(e,i)}async function gAn(e,t,n){const r=await e.file("[Content_Types].xml")?.async("string");if(!r||n.size===0)return;const i=t.parse(r),o=i.Types,a=w9(o.Override);for(const[s,l]of n){const c=`/${s}`,u=a.find(d=>d["@_PartName"]===c);u?u["@_ContentType"]=l:a.push({"@_PartName":c,"@_ContentType":l})}o.Override=a,e.file("[Content_Types].xml",t.build(i))}function xAn(e){const t=e.lastIndexOf("/");return`${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function yAn(e,t){const n=e.split("/").slice(0,-1),r=t.split("/");for(;n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...n.map(()=>".."),...r].join("/")}function vAn(e){const t=new Set(e.map(r=>String(r["@_Id"]??"")));let n=1;for(;t.has(`rId${n}`);)n+=1;return`rId${n}`}function bAn(e){return e.file(/^customXml\/item\d+\.xml$/u).reduce((t,n)=>Math.max(t,Number(n.name.match(/item(\d+)\.xml$/u)?.[1]??0)),0)}function w9(e){return e==null?[]:Array.isArray(e)?e:[e]}var wAn=["p:sld","p:notes","p:sldLayout","p:sldMaster","p:handoutMaster"],SAn=new Set(["p:kinsoku","p:defaultTextStyle","p:modifyVerifier","p:extLst"]),CAn=new Set(["p:controls","p:extLst"]);function Zet(e){const t=e["p:presentation"];if(t)return{container:t,insertBefore:SAn};for(const n of wAn){const r=e[n];if(r)return{container:r["p:cSld"]??={},insertBefore:CAn}}}function TAn(e,t,n,r){const i={};let o=!1;for(const[a,s]of Object.entries(e))a!==t&&(!o&&r.has(a)&&(i[t]=n,o=!0),i[a]=s);o||(i[t]=n);for(const a of Object.keys(e))delete e[a];Object.assign(e,i)}async function AAn(e,t,n,r){const i=await e.file(n)?.async("string");if(!i)return;const o=t.parse(i),a=Zet(o);if(!a)return;const{container:s,insertBefore:l}=a,c={...s["p:custDataLst"]??{}};c["p:tags"]={"@_r:id":r},TAn(s,"p:custDataLst",c,l),e.file(n,t.build(o))}async function EAn(e,t,n){const r=await e.file(n)?.async("string");if(!r)return;const i=t.parse(r),o=Zet(i);if(!o)return;const a=o.container["p:custDataLst"];!a||a["p:tags"]===void 0||(delete a["p:tags"],Object.keys(a).length===0&&delete o.container["p:custDataLst"],e.file(n,t.build(i)))}var S9="http://schemas.openxmlformats.org/officeDocument/2006/relationships/tags",ske="application/vnd.openxmlformats-officedocument.presentationml.tags+xml";async function kAn(e,t){const n=[],r=new Set;for(const i of e.file(/\.rels$/u)){const o=LAn(i.name);if(!o)continue;const s=t.parse(await i.async("string")).Relationships;for(const l of hE(s?.Relationship)){if(String(l["@_Type"]??"")!==S9)continue;const c=o.slice(0,o.lastIndexOf("/")),u=lf(c,String(l["@_Target"]??""));if(!u||r.has(u))continue;const d=await lke(e,t,u);d&&(d.owner=NAn(o),d.sourcePartPath=o,d.relationshipId=String(l["@_Id"]??"")||void 0,n.push(d),r.add(u))}}for(const i of e.file(/^ppt\/tags\/tag\d+\.xml$/u)){if(r.has(i.name))continue;const o=await lke(e,t,i.name);o&&(o.owner="part",n.push(o))}return n}async function MAn(e,t,n){let r=jAn(e)+1;const i=new Set;for(const o of t){if(o.tags.length===0){await PAn(e,n,o);continue}if(o.path??=`ppt/tags/tag${r++}.xml`,o.owner??="presentation",o.sourcePartPath??=FAn(o.owner),!o.sourcePartPath)continue;const a=o.rawXml?.["p:tagLst"]??{};a["@_xmlns:a"]??="http://schemas.openxmlformats.org/drawingml/2006/main",a["@_xmlns:p"]??="http://schemas.openxmlformats.org/presentationml/2006/main",a["@_xmlns:r"]??="http://schemas.openxmlformats.org/officeDocument/2006/relationships",a["p:tag"]=o.tags.map(s=>({"@_name":s.name,"@_val":s.value})),o.rawXml={...o.rawXml??{},"p:tagLst":a},e.file(o.path,n.build(o.rawXml)),await DAn(e,n,o),await AAn(e,n,o.sourcePartPath,o.relationshipId),i.add(o.path)}await RAn(e,n,i)}async function PAn(e,t,n){!n.path||!n.sourcePartPath||(await EAn(e,t,n.sourcePartPath),await IAn(e,t,n),e.remove(n.path),await _An(e,t,n.path))}async function IAn(e,t,n){const r=Jet(n.sourcePartPath),i=await e.file(r)?.async("string");if(!i)return;const o=t.parse(i),a=o.Relationships;a&&(a.Relationship=hE(a.Relationship).filter(s=>!(String(s["@_Id"]??"")===n.relationshipId&&String(s["@_Type"]??"")===S9)),e.file(r,t.build(o)))}async function _An(e,t,n){const r=await e.file("[Content_Types].xml")?.async("string");if(!r)return;const i=t.parse(r),o=i.Types;o.Override=hE(o.Override).filter(a=>a["@_PartName"]!==`/${n}`),e.file("[Content_Types].xml",t.build(i))}async function lke(e,t,n){const r=await e.file(n)?.async("string");if(!r)return;const i=t.parse(r),o=i["p:tagLst"];if(!o)return;const a=hE(o["p:tag"]).map(s=>({name:String(s["@_name"]??"").trim(),value:String(s["@_val"]??"").trim()})).filter(s=>s.name.length>0);return{path:n,tags:a,rawXml:i}}async function DAn(e,t,n){const r=n.sourcePartPath,i=Jet(r),o=await e.file(i)?.async("string"),a=o?t.parse(o):{Relationships:{"@_xmlns":"http://schemas.openxmlformats.org/package/2006/relationships"}},s=a.Relationships??={},l=hE(s.Relationship);let c=l.find(u=>String(u["@_Id"]??"")===n.relationshipId&&String(u["@_Type"]??"")===S9);c||(n.relationshipId=BAn(l),c={},l.push(c)),c["@_Id"]=n.relationshipId,c["@_Type"]=S9,c["@_Target"]=OAn(r,n.path),s.Relationship=l,e.file(i,t.build(a))}async function RAn(e,t,n){const r=await e.file("[Content_Types].xml")?.async("string");if(!r||n.size===0)return;const i=t.parse(r),o=i.Types,a=hE(o.Override);for(const s of n){const l=`/${s}`,c=a.find(u=>u["@_PartName"]===l);c?c["@_ContentType"]=ske:a.push({"@_PartName":l,"@_ContentType":ske})}o.Override=a,e.file("[Content_Types].xml",t.build(i))}function LAn(e){const t=e.match(/^(?<dir>.*)\/_rels\/(?<file>[^/]+)\.rels$/u);return t?.groups?`${t.groups.dir}/${t.groups.file}`:void 0}function Jet(e){const t=e.lastIndexOf("/");return`${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function NAn(e){return e==="ppt/presentation.xml"?"presentation":/^ppt\/slides\/slide\d+\.xml$/u.test(e)?"slide":"part"}function FAn(e){return e==="presentation"?"ppt/presentation.xml":void 0}function OAn(e,t){const n=e.split("/").slice(0,-1),r=t.split("/");for(;n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...n.map(()=>".."),...r].join("/")}function BAn(e){const t=new Set(e.map(r=>String(r["@_Id"]??"")));let n=1;for(;t.has(`rId${n}`);)n+=1;return`rId${n}`}function jAn(e){return e.file(/^ppt\/tags\/tag\d+\.xml$/u).reduce((t,n)=>Math.max(t,Number(n.name.match(/tag(\d+)\.xml$/u)?.[1]??0)),0)}function hE(e){return e==null?[]:Array.isArray(e)?e:[e]}function UAn(e){if(e===void 0)return!1;const t=e&&typeof e=="object"?e["@_val"]:void 0;return t==null||t===""?!0:!(t==="0"||t==="false")}function zAn(e,t,n){if(t===void 0)return!1;const r=Object.keys(e).find(s=>n(s)==="delete");if(UAn(r?e[r]:void 0)===t)return!1;const i={"@_val":t?"1":"0"};if(r)return e[r]=i,!0;const o=Object.entries(e),a=o.findIndex(([s])=>{const l=n(s);return l!=="axId"&&l!=="scaling"&&!s.startsWith("@_")});o.splice(a===-1?o.length:a,0,["c:delete",i]);for(const s of Object.keys(e))delete e[s];for(const[s,l]of o)e[s]=l;return!0}var $An=new Set(["numFmt","majorTickMark","minorTickMark","tickLblPos","spPr","txPr","crossAx","crosses","crossesAt","auto","lblAlgn","lblOffset","tickLblSkip","tickMarkSkip","noMultiLvlLbl","dispUnits","majorUnit","minorUnit","baseTimeUnit","majorTimeUnit","minorTimeUnit"]);function cke(e,t){for(const[n,r]of Object.entries(e))if(["r","fld"].includes(t(n))){for(const i of Array.isArray(r)?r:[r])if(i&&typeof i=="object"&&!Array.isArray(i)&&$o(i,"t",t))return[n,i]}}function HAn(e,t,n){const r=$o(e,"tx",n)??"c:tx",i=e[r],o=[];if(i&&typeof i=="object"&&Aw(i,n,o),o.join("")===t)return;const a=i&&typeof i=="object"?$o(i,"rich",n):void 0,s=a?i[a]:void 0;if(!s||typeof s!="object"||Array.isArray(s)){const S=_ne(t)["c:tx"];r in e?e[r]=S:K3(e,0,r,S);return}const l=$o(s,"p",n)??"a:p",c=s[l],u=(Array.isArray(c)?c:[c]).filter(S=>!!S&&typeof S=="object"&&!Array.isArray(S)),d=u.find(S=>cke(S,n))??u[0]??{},p=cke(d,n),h=p?.[1]??{},f=p?p[0].replace(/[^:]+$/u,"r"):"a:r",m=$o(h,"rPr",n),g=p&&n(p[0])==="r"?{...h}:m?{[m]:h[m]}:{},y=$o(h,"t",n)??"a:t",v=h[y],b=v&&typeof v=="object"&&!Array.isArray(v)?v:void 0;g[y]=b?{...b,"#text":t}:t;const w=Object.entries(d);s[l]=Object.fromEntries([...w.filter(([S])=>S.startsWith("@_")||n(S)==="pPr"),[f,g],...w.filter(([S])=>n(S)==="endParaRPr")])}function _ne(e){return{"c:tx":{"c:rich":{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:r":{"a:t":e}}}},"c:overlay":{"@_val":"0"}}}function GAn(e,t,n){const r=Object.keys(e),i=r.findIndex(s=>$An.has(n(s))),o=r.map(s=>[s,e[s]]),a=i===-1?o.length:i;o.splice(a,0,["c:title",t]);for(const s of r)delete e[s];for(const[s,l]of o)e[s]=l}function VAn(e,t,n){if(t===void 0)return;const r=$o(e,"title",n);if(t===""){r&&delete e[r];return}if(r){const i=e[r];i&&typeof i=="object"&&!Array.isArray(i)?HAn(i,t,n):e[r]=_ne(t);return}GAn(e,_ne(t),n)}function WAn(e,t,n){const r={};return e.fontSize!==void 0&&(r["@_sz"]=String(Math.round(e.fontSize*100))),e.fontBold!==void 0&&(r["@_b"]=e.fontBold?"1":"0"),e.fontColor&&(r["a:solidFill"]=t["a:solidFill"],CM(r,"a:solidFill",e.fontColor,n)),e.fontFamily&&(r["a:latin"]={"@_typeface":e.fontFamily}),t["a:ea"]&&(r["a:ea"]=t["a:ea"]),r}function XAn(e,t,n,r){if(!(t.fontFamily!==void 0||t.fontSize!==void 0||t.fontBold!==void 0||t.fontColor!==void 0))return;const o=$o(e,"title",n);if(!o)return;const a={...e[o]??{}},s=$o(a,"txPr",n)??"c:txPr",l={...a[s]??{}};l[$o(l,"bodyPr",n)??"a:bodyPr"]||(l["a:bodyPr"]={}),l[$o(l,"lstStyle",n)??"a:lstStyle"]||(l["a:lstStyle"]={});const c=$o(l,"p",n)??"a:p",u=l[c],d={...(Array.isArray(u)?u[0]:u)??{}},p=$o(d,"pPr",n)??"a:pPr",h={...Oi(d,p,"first")},f=$o(h,"defRPr",n)??"a:defRPr",m=h[f]??{};h[f]={...m,...WAn(t,m,r)},d[p]=h,l[c]=d,a[s]=l,e[o]=a}function uke(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function qAn(e){if(!e)return"c";const t=e.indexOf(":");return t===-1?"c":e.slice(0,t)}function KAn(e,t,n){if(t===void 0)return;const r=uke(e,"clrMapOvr",n);if(t===null||Object.keys(t).length===0){r&&delete e[r];return}const i={};for(const[c,u]of Object.entries(t))i[`@_${c}`]=u;if(r){e[r]=i;return}const o=uke(e,"chart",n),a=qAn(o),s=Object.entries(e);for(const c of Object.keys(e))delete e[c];let l=!1;for(const[c,u]of s)!l&&n(c)==="chart"&&(e[`${a}:clrMapOvr`]=i,l=!0),e[c]=u;l||(e[`${a}:clrMapOvr`]=i)}function C9(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function Qet(e,t){return Object.keys(e).filter(n=>t(n)!=="ser").map(n=>[n,e[n]])}function ett(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function YAn(e,t){const n=Object.keys(e).filter(l=>t(l).endsWith("Chart"));if(n.length===0)return;const r=n[0],i=new Map;for(const l of n){const c=e[l];c&&i.set(t(l),Qet(c,t))}if(n.length===1)return{primaryKey:r,containerChildren:i};const o=e[r];if(!o)return{primaryKey:r,containerChildren:i};const a=C9(o,"ser",t)??"c:ser",s=[];for(const l of n){const c=e[l];if(!c)continue;const u=C9(c,"ser",t);u&&s.push(...ett(c[u])),l!==r&&delete e[l]}return o[a]=s.length===1?s[0]:s,{primaryKey:r,containerChildren:i}}function ZAn(e,t){return e.map(n=>u$(n.seriesChartType??t))}function JAn(e,t,n,r,i,o,a){const s=ZAn(n,r);if(s.some(w=>w===void 0))return!1;const l=s;if(new Set(l).size<=1)return!1;const u=e[t];if(!u)return!1;const d=C9(u,"ser",i)??"c:ser",p=ett(u[d]);if(p.length!==n.length)return!1;const h=Qet(u,i),f=new Map,m=[];for(let w=0;w<p.length;w++){const S=l[w];f.has(S)||(f.set(S,[]),m.push(S)),f.get(S).push(p[w])}const g=Object.keys(e),y=g.map(w=>[w,e[w]]),v=g.indexOf(t),b=[];for(const w of m){const S={};for(const[A,E]of a?.get(w)??h)S[A]=JSON.parse(JSON.stringify(E));const T=f.get(w);S[d]=T.length===1?T[0]:T,QAn(S,n.filter((A,E)=>l[E]===w),o,i),Hqe(S,w,i),Pw(S,w,i),b.push([`c:${w}`,S])}y.splice(v,1,...b);for(const w of g)delete e[w];for(const[w,S]of y)e[w]=S;return!0}function QAn(e,t,n,r){const i=new Set(t.map(c=>c.axisId).filter(c=>c!==void 0));if(i.size!==1)return;const o=[...i][0],s=n?.find(c=>c.axisId===o)?.crossAxisId??n?.find(c=>c.crossAxisId===o)?.axisId;if(o===void 0||s===void 0)return;const l=C9(e,"axId",r)??"c:axId";e[l]=[{"@_val":String(s)},{"@_val":String(o)}]}function dke(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function pke(e){return e.map((t,n)=>({"@_idx":String(n),"c:v":t}))}function eEn(e){const t=e.replace(/Chart$/u,"");return`filtered${t.charAt(0).toUpperCase()}${t.slice(1)}Series`}function tEn(e,t){const n=e.categories??t,r={"c:idx":{"@_val":String(e.idx)},"c:order":{"@_val":String(e.order)}};return e.name!==void 0&&(r["c:tx"]={"c:v":e.name}),n.length>0&&(r["c:cat"]={"c:strLit":{"c:ptCount":{"@_val":String(n.length)},"c:pt":pke(n)}}),e.values&&(r["c:val"]={"c:numLit":{"c:formatCode":"General","c:ptCount":{"@_val":String(e.values.length)},"c:pt":pke(e.values.map(String))}}),e.uniqueId&&(r["c:extLst"]={"c:ext":{"@_uri":"{C3380CC4-5D6E-409C-BE32-E72D297353CC}","@_xmlns:c16":"http://schemas.microsoft.com/office/drawing/2014/chart","c16:uniqueId":{"@_val":e.uniqueId}}}),r}function nEn(e,t,n){const r=Ude(e,n);return!t||t.length===0?!r||r.length===0:!r||r.length!==t.length?!1:t.every((i,o)=>{const a=r[o];return i.idx===a.idx&&i.order===a.order&&i.name===a.name&&i.uniqueId===a.uniqueId&&JSON.stringify(i.values??null)===JSON.stringify(a.values??null)&&JSON.stringify(i.categories??null)===JSON.stringify(a.categories??null)})}function rEn(e,t,n,r,i){const o=dke(e,"extLst",i)??"c:extLst",a={...e[o]??{}},s=dke(a,"ext",i),l=s?Array.isArray(a[s])?[...a[s]]:[a[s]]:[],c=l.filter(h=>h["@_uri"]!==UO),u={...l.find(h=>h["@_uri"]===UO)??{}};for(const h of Object.keys(u))/^filtered.*series$/iu.test(i(h))&&delete u[h];if(t&&t.length>0){u["@_uri"]=UO,u["@_xmlns:c15"]="http://schemas.microsoft.com/office/drawing/2012/chart";const h=t.map(f=>tEn(f,n));u[`c15:${eEn(r)}`]={"c15:ser":h.length===1?h[0]:h}}const p=Object.keys(u).some(h=>!h.startsWith("@_")&&!h.startsWith("xmlns"))?[...c,u]:c;if(p.length===0){delete e[o];return}a[s??"c:ext"]=p.length===1?p[0]:p,e[o]=a}function jg(e,t,n){if(!e)return;const r=Object.keys(e).find(i=>n(i)===t);return r?e[r]:void 0}function iEn(e,t,n,r){const i=Object.keys(e).find(s=>t(s)==="legendEntry"),o=i?e[i]:void 0;return(o?Array.isArray(o)?o:[o]:[]).flatMap(s=>{const l=s,c=Number.parseInt(String(jg(l,"idx",t)?.["@_val"]??""),10);if(!Number.isFinite(c)||c<0)return[];const u={index:c},d=jg(l,"delete",t);if(d){const m=d["@_val"];u.deleted=m!=="0"&&m!=="false"}const p={getChildByLocalName:(m,g)=>jg(m,g,t)},h=zp(jg(l,"txPr",t),p),f=Ld(h,p,{parseColor:n},r);return f&&(u.textStyle=f),[u]})}function hke(e,t,n,r){if(t in e){e[t]=n;return}const i=Object.entries(e),o=i.findIndex(([a])=>r(a)==="extLst");i.splice(o<0?i.length:o,0,[t,n]);for(const a of Object.keys(e))delete e[a];for(const[a,s]of i)e[a]=s}function oEn(e,t,n){const r=t?e[t]:void 0,i=r?jg(r,"p",n):void 0,o=i?jg(i,"pPr",n):void 0;return o?jg(o,"defRPr",n):void 0}function fke(e,t,n,r){if(!t)return;const i=Object.keys(e).find(d=>n(d)==="legendEntry"),o=i?e[i]:void 0,a=o?Array.isArray(o)?o:[o]:[],s=new Map(a.map(d=>[Number(jg(d,"idx",n)?.["@_val"]),d])),l=[...a];for(const d of t){let p=s.get(d.index);p||(p={"c:idx":{"@_val":String(d.index)}},l.push(p));const h=Object.keys(p).find(g=>n(g)==="delete"),f=Object.keys(p).find(g=>n(g)==="txPr"),m=jz(d.textStyle,oEn(p,f,n),r);m?(h&&delete p[h],hke(p,f??"c:txPr",m,n)):d.deleted!==void 0&&(f&&delete p[f],hke(p,h??"c:delete",{"@_val":d.deleted?"1":"0"},n))}if(l.length===0)return;if(i){e[i]=l;return}const c=Object.entries(e),u=c.findIndex(([d])=>n(d)!=="legendPos");c.splice(u<0?c.length:u,0,["c:legendEntry",l]);for(const d of Object.keys(e))delete e[d];for(const[d,p]of c)e[d]=p}function mke(e,t,n,r,i,o=!1){const a=Object.keys(e),s=a.findIndex(u=>i(u)===r),l=a.map(u=>[u,e[u]]),c=s===-1?o?0:l.length:s+1;l.splice(c,0,[t,n]);for(const u of a)delete e[u];for(const[u,d]of l)e[u]=d}function aEn(e,t,n,r){const i=Object.keys(e).find(a=>n(a)==="legend");if(t.hasLegend===!1){i&&delete e[i];return}if(t.hasLegend!==!0&&t.legendEntries===void 0)return;const o=i?e[i]:void 0;if(!o){mke(e,"c:legend",{"c:legendPos":{"@_val":t.legendPosition??"r"},"c:overlay":{"@_val":"0"}},"plotArea",n);const a=e["c:legend"];fke(a,t.legendEntries,n,r);return}if(t.legendPosition!==void 0){const a=Object.keys(o).find(s=>n(s)==="legendPos");a?o[a]["@_val"]=t.legendPosition:mke(o,"c:legendPos",{"@_val":t.legendPosition},"__none__",n,!0)}fke(o,t.legendEntries,n,r)}var gke=["grouping","varyColors","ser","dLbls","dropLines","hiLowLines","upDownBars","marker","smooth","gapWidth","gapDepth","shape","axId","extLst"];function Dne(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function sEn(e,t,n,r){const i=Dne(e,t,r);if(i){e[i]=n;return}const o=Object.entries(e),a=gke.indexOf(t),s=o.findIndex(([l])=>{const c=gke.indexOf(r(l));return c>=0&&c>a});o.splice(s<0?o.length:s,0,[`c:${t}`,n]);for(const l of Object.keys(e))delete e[l];for(const[l,c]of o)e[l]=c}function xke(e,t,n,r,i){if(n===void 0)return;const o=Dne(e,t,r);if(n===null){o&&delete e[o];return}const s={...o?e[o]:void 0};if(n.color||n.width!==void 0||n.dashStyle){const c=Dne(s,"spPr",r)??"c:spPr";s[c]=Qp(s[c],{strokeColor:n.color,strokeWidth:n.width,strokeDashStyle:n.dashStyle},r,i)}sEn(e,t,s,r)}var lEn=new Set(["noFill","gradFill","blipFill","pattFill","grpFill"]);function Gv(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function cEn(e,t,n,r){const i=Object.keys(e),o=i.findIndex(l=>r(l)==="ln"),a=i.map(l=>[l,e[l]]),s=o===-1?a.length:o;a.splice(s,0,[t,n]);for(const l of i)delete e[l];for(const[l,c]of a)e[l]=c}function uEn(e,t,n){const r=Object.keys(e),i=r.map(o=>[o,e[o]]);for(const o of r)delete e[o];e[t]=n;for(const[o,a]of i)e[o]=a}function yke(e,t,n,r,i){const o=t.replace(/^#/u,"");if(n){const c=Gv(e,"ln",r)??"a:ln",u=e[c]??{},d=!!e[c],p=Gv(u,"noFill",r);p&&delete u[p];const h=Gv(u,"solidFill",r)??"a:solidFill",f=u[h],m=uT(f,f?i(f):void 0,o);f?u[h]=m:uEn(u,h,m),d||(e[c]=u);return}const a=Gv(e,"solidFill",r)??"a:solidFill",s=e[a],l=uT(s,s?i(s):void 0,o);if(s){const c=Gv(e,"noFill",r);c&&delete e[c],e[a]=l}else{for(const c of Object.keys(e))lEn.has(r(c))&&delete e[c];cEn(e,a,l,r)}}var dEn=new Set(["invertIfNegative","pictureOptions","marker","explosion","dPt","dLbls","trendline","errBars","cat","val","xVal","yVal","smooth","shape","bubbleSize","bubble3D","extLst"]);function ttt(e,t){const n=Gv(e,"spPr",t);if(n)return e[n];const r={},i=Object.entries(e),o=i.findIndex(([a])=>dEn.has(t(a)));i.splice(o===-1?i.length:o,0,["c:spPr",r]);for(const a of Object.keys(e))delete e[a];for(const[a,s]of i)e[a]=s;return r}function vke(e,t,n,r={}){if(r.lineDrawn)return!1;const i=Gv(e,"spPr",n);if(!i&&!t)return!1;const o=i?e[i]:ttt(e,n);return Uce(o,t,n,r)}function ntt(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function R$(e,t,n,r){const i=ntt(e,t,r);if(n===void 0){i&&delete e[i];return}i?e[i]={...e[i],"@_val":n}:e[`c:${t}`]={"@_val":n}}function pEn(e,t,n,r){R$(e,"shape",n,r),Pw(e,t,r)}function hEn(e,t,n,r){R$(e,"gapDepth",n===void 0?void 0:String(n),r),Pw(e,t,r)}function fEn(e,t,n,r){R$(e,"radarStyle",n,r),Pw(e,t,r)}function mEn(e,t,n,r){R$(e,"wireframe",n===void 0?void 0:n?"1":"0",r),Pw(e,t,r)}var gEn=new Set(["extLst"]);function xEn(e,t,n){const r=ntt(e,"shape",n);if(t===void 0){r&&delete e[r];return}if(r){e[r]={"@_val":t};return}const i=Object.keys(e),o=i.findIndex(l=>gEn.has(n(l))),a=i.map(l=>[l,e[l]]),s=o===-1?a.length:o;a.splice(s,0,["c:shape",{"@_val":t}]);for(const l of i)delete e[l];for(const[l,c]of a)e[l]=c}function Rne(e,t){const n=e==="c"?{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:r":{"a:t":t}}}:{"a:p":{"a:r":{"a:t":t}}},r={};return r[`${e}:rich`]=n,r}function yEn(e){const t={};return e.bold!==void 0&&(t["@_b"]=e.bold?"1":"0"),e.italic!==void 0&&(t["@_i"]=e.italic?"1":"0"),e.fontSize!==void 0&&(t["@_sz"]=String(Math.round(e.fontSize*100))),e.color&&(t["a:solidFill"]={"a:srgbClr":{"@_val":e.color.replace(/^#/u,"").toUpperCase()}}),Object.keys(t).length>0?t:void 0}function Lne(e,t){const n=t.map(a=>{const s=yEn(a);return{...s?{"a:rPr":s}:{},"a:t":a.text}}),r={"a:r":n.length===1?n[0]:n},i=e==="c"?{"a:bodyPr":{},"a:lstStyle":{},"a:p":r}:{"a:p":r},o={};return o[`${e}:rich`]=i,o}function vEn(e,t,n){const r={};return n&&n.length>0?r[`${e}:tx`]=Lne(e,n):t!==void 0&&(r[`${e}:tx`]=Rne(e,t)),e==="c"&&(r["c:overlay"]={"@_val":"0"}),r}function bEn(e,t){if(e.length===0)return;const n=new Array(e.length).fill("");let r=0,i=0;for(;i<e.length;){const o=e[i]??"";if(t.startsWith(o,r)){n[i]=o,r+=o.length,i++;continue}let a=-1,s=-1;for(let l=i+1;l<e.length;l++){const c=e[l];if(!c)continue;const u=t.indexOf(c,r);if(u!==-1){a=u,s=l;break}}if(s===-1)return;n[i]=t.slice(r,a);for(let l=i+1;l<s;l++)n[l]="";r=a,i=s}return r<t.length&&(n[n.length-1]+=t.slice(r)),n}function wEn(e,t){const n=bEn(e.map(r=>r.text),t);return n?e.map((r,i)=>({...r,text:n[i]??""})):[{...e[0],text:t}]}function rtt(e,t,n,r={prefix:"c"}){const{prefix:i}=r,o=$o(e,"title",n);if(t.hasTitle===!1||t.title===""&&t.hasTitle!==!0)return o&&delete e[o],i==="c"&&u2e(e,!0,n),!1;if(t.title===void 0&&t.hasTitle!==!0)return o!==void 0;const s=t.titleRuns?.[0]?.text,l=t.title!==void 0&&s!==void 0&&t.title!==s;let c=i==="c"&&t.titleRuns&&t.titleRuns.length>0&&!l?t.titleRuns:void 0;const u=t.titleRuns;i==="c"&&l&&t.title!==void 0&&u&&u.length>1&&(c=wEn(u,t.title));let d=o?e[o]:void 0;if(c&&d&&typeof d=="object"){const p=[];Aw(d,n,p);const h=c.map(f=>f.text);p.length===h.length&&p.every((f,m)=>f===h[m])&&(c=void 0)}if(!d||typeof d!="object")d=vEn(i,t.title,c),o?e[o]=d:K3(e,0,`${i}:title`,d);else if(c){const p=$o(d,"tx",n);p?d[p]=Lne(i,c):K3(d,0,`${i}:tx`,Lne(i,c))}else if(t.title!==void 0&&!XGe(d,t.title,n)){const p=$o(d,"tx",n);p?d[p]=Rne(i,t.title):K3(d,0,`${i}:tx`,Rne(i,t.title))}return i==="c"&&u2e(e,!1,n),!0}function Tl(e,t,n){return Object.keys(e).find(r=>n(r)===t)}var bke={spPr:["txPr","extLst"],txPr:["extLst"]};function wke(e,t,n,r,i,o){if(n){e[n]=r;return}const a=Object.keys(e),s=a.findIndex(c=>i.includes(o(c))),l=a.map(c=>[c,e[c]]);l.splice(s===-1?l.length:s,0,[t,r]);for(const c of a)delete e[c];for(const[c,u]of l)e[c]=u}function Nne(e,t,n){const r={};return e.fontSize!==void 0&&(r["@_sz"]=String(Math.round(e.fontSize*100))),e.fontBold!==void 0&&(r["@_b"]=e.fontBold?"1":"0"),e.fontColor&&(r["a:solidFill"]=t["a:solidFill"],CM(r,"a:solidFill",e.fontColor,n)),e.fontFamily&&(r["a:latin"]={"@_typeface":e.fontFamily}),r}function Ske(e){return Array.isArray(e)?e:e&&typeof e=="object"?[e]:[]}function SEn(e,t,n,r){const i=Tl(e,"tx",n),o=i?e[i]:void 0,a=o?Tl(o,"rich",n):void 0,s=a&&o?o[a]:void 0;if(!o||!s||!i||!a)return;if(!(t.fontFamily!==void 0||t.fontSize!==void 0||t.fontBold!==void 0||t.fontColor!==void 0))return i;const c=Tl(s,"p",n)??"a:p",u=Ske(s[c]).map(h=>{const f={...h},m=Tl(f,"pPr",n)??"a:pPr",g={...Oi(f,m,"first")},y=Tl(g,"defRPr",n)??"a:defRPr",v=g[y]??{};g[y]={...v,...Nne(t,v,r)},f[m]=g;const b=Tl(f,"r",n);if(b){const w=Ske(f[b]).map(S=>{const T=Tl(S,"rPr",n)??"a:rPr",A=S[T]??{},E={...S};return Oi(E,T,"first"),E[T]={...A,...Nne(t,A,r)},E});f[b]=Array.isArray(f[b])?w:w[0]}return f}),d={...s};d[c]=Array.isArray(s[c])?u:u[0];const p={...o};return p[a]=d,e[i]=p,i}function CEn(e,t,n,r={prefix:"c"},i){const o=t.fontFamily!==void 0||t.fontSize!==void 0||t.fontBold!==void 0||t.fontColor!==void 0;if(!o&&t.spPr===void 0)return;const{prefix:a}=r,s=Tl(e,"title",n);if(!s)return;const l={...e[s]??{}};if(t.spPr!==void 0){const u=Tl(l,"spPr",n);if(t.spPr===null)u&&delete l[u];else{const d=Qp(u?l[u]:void 0,t.spPr,n,i);wke(l,`${a}:spPr`,u,d,bke.spPr,n)}}const c=SEn(l,t,n,i);if(o&&c===void 0){const u=Tl(l,"txPr",n),d=u??`${a}:txPr`,p={...l[d]??{}};p[Tl(p,"bodyPr",n)??"a:bodyPr"]||(p["a:bodyPr"]={}),p[Tl(p,"lstStyle",n)??"a:lstStyle"]||(p["a:lstStyle"]={});const h=Tl(p,"p",n)??"a:p",f=p[h],m={...(Array.isArray(f)?f[0]:f)??{}},g=Tl(m,"pPr",n)??"a:pPr",y={...Oi(m,g,"first")},v=Tl(y,"defRPr",n)??"a:defRPr",b=y[v]??{};y[v]={...b,...Nne(t,b,i)},m[g]=y,p[h]=m,wke(l,d,u,p,bke.txPr,n)}e[s]=l}function TEn(e,t,n,r){if(!t)return;const i=e.getChildByLocalName(t,n?"numRef":"strRef"),o=i?e.getScalarChildByLocalName(i,"f"):void 0;return o?{formula:o,isNumeric:n,values:r}:void 0}function AEn(){return new hw({ignoreAttributes:!1,attributeNamePrefix:"@_",trimValues:!1,tagValueProcessor:(e,t)=>pz(e)?t:t.trim()})}function EEn(){return new Na({ignoreAttributes:!1,attributeNamePrefix:"@_",suppressBooleanAttributes:!1,format:!1})}async function kEn(e,t){const n=new Map,r=e.file("xl/workbook.xml"),i=e.file("xl/_rels/workbook.xml.rels");if(!r||!i)return n;try{const o=t.parse(await r.async("string")),a=t.parse(await i.async("string")),s=new Map,l=Dt(a,"Relationships");for(const d of Su(l,"Relationship")){const p=lr(d,"Id"),h=lr(d,"Target");p&&h&&s.set(p,h)}const c=Dt(o,"workbook"),u=Dt(c,"sheets");for(const d of Su(u,"sheet")){const p=lr(d,"name"),h=lr(d,"r:id")??lr(d,"id"),f=h?s.get(h):void 0;p&&f&&n.set(p.toLowerCase(),MEn(f))}}catch{}return n}function MEn(e){return e.startsWith("/")?e.slice(1):`xl/${e}`}async function PEn(e,t){if(t.length===0)return{unresolved:0};let n;try{n=await La.loadAsync(e)}catch{return{unresolved:t.length}}const r=AEn(),i=await kEn(n,r),o=new Map;let a=0;for(const u of t){const d=h9t(u.formula),p=d?i.get(d.sheetName.toLowerCase()):void 0,h=d?f9t(d,u.values.length):void 0;if(!d||!p||!h){a+=1;continue}const f=o.get(p)??[];f.push({refs:h,values:u.values,isNumeric:u.isNumeric}),o.set(p,f)}const s=EEn();let l=!1;for(const[u,d]of o){const p=n.file(u);if(!p){a+=d.length;continue}try{const h=r.parse(await p.async("string")),f=d.flatMap(({refs:m,values:g,isNumeric:y})=>m.map((v,b)=>({ref:v,isNumeric:y,value:g[b]})));tUe(h,f)&&(n.file(u,s.build(h)),l=!0)}catch{a+=d.length}}return l?{bytes:await n.generateAsync({type:"uint8array",compression:"DEFLATE",compressionOptions:{level:6}}),unresolved:a}:{unresolved:a}}function T9(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function A9(e){return e==null?[]:(Array.isArray(e)?e:[e]).filter(t=>!!t&&typeof t=="object")}function qq(e){return String(e["@_type"]??"")}function IEn(e,t,n){const r=T9(e,"lvl",n)??"cx:lvl",i=T9(t,"lvl",n),o=A9(e[r]),a=A9(i?t[i]:void 0).map((s,l)=>{const c=o[l];if(!c)return s;const u={};for(const d of Object.keys(c))d.startsWith("@_")&&d!=="@_ptCount"&&(u[d]=c[d]);return{...s,...u}});e[r]=a.length===1?a[0]:a}function Cke(e,t,n){for(const r of["strDim","numDim"]){const i=T9(e,r,n)??`cx:${r}`,o=T9(t,r,n),a=A9(e[i]),s=A9(o?t[o]:void 0);for(const l of s){const c=qq(l);let u=a.find(d=>qq(d)===c);!u&&r==="numDim"&&(u=a[0]),!u&&r==="strDim"&&c==="cat"&&(u=a.find(d=>qq(d)==="")),u?IEn(u,l,n):a.push(l)}a.length>0&&(e[i]=a.length===1?a[0]:a)}}function Zh(e,t,n){return Object.keys(e).find(r=>n(r)===t)}function Sc(e,t,n){if(!e)return;const r=Zh(e,t,n),i=r?e[r]:void 0;return i&&typeof i=="object"&&!Array.isArray(i)?i:void 0}function Fne(e){return e==null?[]:(Array.isArray(e)?e:[e]).filter(t=>!!t&&typeof t=="object")}function M1(e,t,n,r,i){const o=Object.keys(e).map(s=>[s,e[s]]);let a=o.findIndex(([s])=>!s.startsWith("@_")&&r.includes(i(s)));a===-1&&(a=o.length),o.splice(a,0,[t,n]);for(const s of Object.keys(e))delete e[s];for(const[s,l]of o)e[s]=l}var itt=["spPr","valueColors","valueColorPositions","dataPt","dataLabels","dataId","layoutPr","axisId","extLst"];function _En(e,t,n){const r=Sc(e,"tx",n),i=Sc(r,"txData",n);if(r&&i){const a=Zh(i,"v",n)??"cx:v";i[a]=t;return}const o=Zh(e,"tx",n);o&&delete e[o],M1(e,"cx:tx",{"cx:txData":{"cx:v":t}},itt,n)}var DEn=["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"],REn=["ln","effectLst","effectDag","scene3d","sp3d","extLst"];function LEn(e,t){const r=Sc(Sc(Sc(e,"spPr",t),"solidFill",t),"srgbClr",t)?.["@_val"];return typeof r=="string"?r.toUpperCase():void 0}function NEn(e,t,n){const r=aTn(t);if(!r||t.color?.replace(/^#/u,"").toUpperCase()===LEn(e,n))return;const o=Sc(e,"spPr",n);if(!o){M1(e,"cx:spPr",r,itt.slice(1),n);return}for(const a of Object.keys(o))DEn.includes(n(a))&&delete o[a];M1(o,"a:solidFill",r["a:solidFill"],REn,n)}function FEn(e,t,n){if(t===void 0)return;const r=Zh(e,"dataLabels",n);if(!t){r&&delete e[r];return}r||M1(e,"cx:dataLabels",Met(),["dataId","layoutPr","axisId","extLst"],n)}function ott(e){let t=-1;for(const n of e){const r=Number.parseInt(String(n["@_id"]??""),10);Number.isFinite(r)&&r>t&&(t=r)}return t+1}function OEn(e,t,n,r,i){const o=Sc(e,"dataId",i),a=o?String(o["@_val"]??""):void 0,s=a!==void 0?t.find(u=>String(u["@_id"])===a):void 0;if(s){Cke(s,p5(n,r,Number(a)),i);return}const l=Zh(e,"data",i);if(l&&!o){const u=e[l];if(u&&typeof u=="object"&&!Array.isArray(u)){Cke(u,p5(n,r,0),i);return}}const c=ott(t);t.push(p5(n,r,c)),o?o["@_val"]=String(c):M1(e,"cx:dataId",{"@_val":String(c)},["layoutPr","axisId","extLst"],i)}function BEn(e,t,n){const r=t.style;if(!r||r.hasLegend===void 0)return;const i=Zh(e,"legend",n);if(!r.hasLegend){i&&delete e[i];return}const o=i?e[i]:void 0;if(o&&typeof o=="object"&&!Array.isArray(o)){r.legendPosition!==void 0&&(o["@_pos"]=Pne(r.legendPosition)["@_pos"]);return}i&&delete e[i];const a=Pne(r.legendPosition);M1(e,"cx:legend",a,["extLst"],n)}function jEn(e,t,n){const r=Sc(Sc(Sc(e,"chart",n),"plotArea",n),"plotAreaRegion",n),i=r?Zh(r,"series",n):void 0,o=r&&i?Fne(r[i])[0]:void 0,a=String(o?.["@_layoutId"]??"").toLowerCase(),s=t.series[0];return!a||!s?!1:ket(t,s).toLowerCase()!==a}function UEn(e,t,n){const r=Sc(e,"chart",n),i=Sc(r,"plotArea",n),o=Sc(i,"plotAreaRegion",n);if(!r||!o)return!1;const a=Zh(e,"chartData",n),s=(a?e[a]:void 0)??{},l=Zh(s,"data",n)??"cx:data",c=Fne(s[l]),u=Zh(o,"series",n)??"cx:series",d=Fne(o[u]),p=[];t.series.forEach((y,v)=>{const b=d[v];if(!b){const w=ott(c);c.push(p5(t,y,w)),p.push(Pet(t,y,w));return}y.name!==void 0&&_En(b,y.name,n),NEn(b,y,n),FEn(b,t.style?.hasDataLabels,n),OEn(b,c,t,y,n),p.push(b)});const h=y=>String(Sc(y,"dataId",n)?.["@_val"]),f=new Set(p.map(h)),m=new Set(d.slice(t.series.length).map(h)),g=c.filter(y=>{const v=String(y["@_id"]);return f.has(v)||!m.has(v)});return o[u]=p.length===1?p[0]:p,s[l]=g.length===1?g[0]:g,a||M1(e,"cx:chartData",s,["chart"],n),rtt(r,{title:t.title,hasTitle:t.style?.hasTitle},n,{prefix:"cx"}),BEn(r,t,n),!0}async function zEn(e,t,n,r,i){if(i.length===0||!r?.targetPath)return;const o=e.resolveImagePath(t,r.targetPath);if(!(o.includes("embeddings/")&&/\.xlsx$/iu.test(o))){e.reportWarning({code:"CHART_EXTERNAL_DATA_WRITEBACK_UNSUPPORTED",message:"Chart data changes were saved to the cached values only: the linked data source is external or not an embedded .xlsx workbook, so it was not updated.",severity:"info",scope:"save",slideId:n,xmlPath:t});return}const s=e.zip.file(o);if(!s){e.reportWarning({code:"CHART_EMBEDDED_WORKBOOK_MISSING",message:"Chart data changes were saved to the cached values only: the referenced embedded workbook was not found in the package.",severity:"warning",scope:"save",slideId:n,xmlPath:o});return}let l;try{l=await s.async("uint8array")}catch{e.reportWarning({code:"CHART_EMBEDDED_WORKBOOK_UNREADABLE",message:"Chart data changes were saved to the cached values only: the referenced embedded workbook could not be read.",severity:"warning",scope:"save",slideId:n,xmlPath:o});return}const c=await PEn(l,i);c.bytes&&e.zip.file(o,c.bytes),c.unresolved>0&&e.reportWarning({code:"CHART_EMBEDDED_WORKBOOK_PARTIAL_WRITEBACK",message:`${c.unresolved} chart data update(s) could not be matched to a cell in the linked workbook and were saved to the cached values only.`,severity:"info",scope:"save",slideId:n,xmlPath:o})}var Tke="http://schemas.openxmlformats.org/drawingml/2006/chart",Ake="http://schemas.microsoft.com/office/drawing/2014/chartex",Eke="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function ppe(e){return e==null?[]:(Array.isArray(e)?e:[e]).filter(t=>!!t&&typeof t=="object")}function $En(e,t){let n=1;for(;e.file(`${t}/chart${n}.xml`);)n+=1;return`${t}/chart${n}.xml`}function HEn(e,t){if(t.startsWith("/"))return t.slice(1);const n=e.split("/").slice(0,-1);for(const r of t.split("/"))r===".."?n.pop():r!=="."&&r!==""&&n.push(r);return n.join("/")}function att(e,t){const n=e.split("/").slice(0,-1),r=t.split("/");let i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>".."),...r.slice(i)].join("/")}async function stt(e,t,n){const r=await e.zip.file("[Content_Types].xml")?.async("string");if(!r)return;const i=e.parser.parse(r),o=i.Types??{},a=ppe(o.Override),s=`/${t}`;a.some(l=>String(l["@_PartName"])===s)||(a.push({"@_PartName":s,"@_ContentType":n}),o.Override=a,i.Types=o,e.zip.file("[Content_Types].xml",e.builder.build(i)))}async function GEn(e,t,n){const r=t.lastIndexOf("/"),i=`${t.slice(0,r+1)}_rels/${t.slice(r+1)}.rels`,o=await e.zip.file(i)?.async("string");if(!o)return;const a=e.parser.parse(o),s=a.Relationships,l=ppe(s?.Relationship),c=l.find(u=>String(u["@_Id"])===n.relationshipId)??l.find(u=>HEn(t,String(u["@_Target"]??""))===n.oldPartPath);if(!(!c||!s))return c["@_Type"]=n.relationshipType,c["@_Target"]=att(t,n.newPartPath),delete c["@_TargetMode"],s.Relationship=l.length===1?l[0]:l,e.zip.file(i,e.builder.build(a)),String(c["@_Id"])}function VEn(e,t,n){for(const r of Object.keys(e))delete e[r];e["@_uri"]=n?Ake:Tke,n?e["cx:chart"]={"@_xmlns:cx":Ake,"@_xmlns:r":Eke,"@_r:id":t}:e["c:chart"]={"@_xmlns:c":Tke,"@_xmlns:r":Eke,"@_r:id":t}}function One(e,t,n,r){if(!e||typeof e!="object")return 0;if(Array.isArray(e))return e.reduce((a,s)=>a+One(s,t,n,r),0);const i=e;let o=0;for(const a of Object.keys(i)){if(a.startsWith("@_"))continue;const s=i[a];if(r(a)==="graphicData"&&s&&typeof s=="object"){for(const l of ppe(s)){const c=Object.keys(l).find(d=>r(d)==="chart"),u=c?l[c]:void 0;u&&String(u["@_r:id"])===t&&(VEn(l,t,n),o+=1)}continue}o+=One(s,t,n,r)}return o}async function WEn(e,t,n,r){const i=await e.zip.file(t)?.async("string");if(!i)return 0;const o=e.parser.parse(i),a=One(o,n,r,e.getLocalName);return a>0&&e.zip.file(t,e.builder.build(o)),a}var XEn="application/vnd.ms-office.chartex+xml",qEn="application/vnd.openxmlformats-officedocument.drawingml.chart+xml",KEn="http://schemas.microsoft.com/office/2014/relationships/chartEx",YEn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart";function ZEn(e,t){const n=Object.keys(e);if(n.some(l=>t(l)==="chartData"))return"chartEx";const r=n.find(l=>t(l)==="chart"),i=r?e[r]:void 0,o=i?Object.keys(i).find(l=>t(l)==="plotArea"):void 0,a=o&&i?i[o]:void 0;return(a&&typeof a=="object"?Object.keys(a):[]).some(l=>{const c=t(l);return c==="plotAreaRegion"||c==="plotSurface"})?"chartEx":"chart"}function JEn(e){return _$(e)?"chartEx":u$(e.chartType)?"chart":void 0}async function QEn(e,t,n,r){const i=t.chartPartPath;if(!i)return;const o=r==="chartEx",a=o?dpe(t):Xet(t),s=$En(e.zip,o?"ppt/extendedCharts":"ppt/charts"),l=await GEn(e,n,{relationshipId:t.chartRelationshipId,oldPartPath:i,newPartPath:s,relationshipType:o?KEn:YEn});if(l)return e.zip.file(s,e.builder.build(a)),await stt(e,s,o?XEn:qEn),await WEn(e,n,l,o),t.chartPartPath=s,t.chartRelationshipId=l,s}function ekn(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function Ug(e,t){if(e)return Object.keys(e).find(n=>!n.startsWith("@_")&&ekn(n)===t)}function ltt(e,t){if(t===void 0)return;const n=Ug(e,"nvPicPr")??"cdr:nvPicPr",r=e[n]??{},i=Ug(r,"cNvPr")??"cdr:cNvPr",o=r[i]??{};o["@_descr"]=t,r[i]=o,e[n]=r}function tkn(e,t,n){const r=Ug(e,"spPr"),i=r?e[r]??e:e,o=Ug(i,"xfrm");if(!o)return;const a=i[o],s=Ug(a,"off")??"a:off",l=Ug(a,"ext")??"a:ext";a[s]={"@_x":String(Math.round(t.x)),"@_y":String(Math.round(t.y))},a[l]={"@_cx":String(Math.round(n.cx)),"@_cy":String(Math.round(n.cy))}}function ctt(e,t,n,r){const i=Ug(e,"spPr"),o=i?e[i]??e:e,a=Ug(o,"xfrm");if(!a&&!(!!t||!!n||!!r))return;const l=a?o[a]:{};t?l["@_rot"]=String(Math.round(t*6e4)):delete l["@_rot"],n?l["@_flipH"]="1":delete l["@_flipH"],r?l["@_flipV"]="1":delete l["@_flipV"],o[a??"a:xfrm"]=l,i&&(e[i]=o)}var nkn={off:{x:0,y:0},ext:{cx:0,cy:0},chOff:{x:0,y:0},chExt:{cx:0,cy:0}};function Bne(e){return e.startsWith("#")?e.slice(1):e}function rkn(e){const t={};let n=!1;return e.fontSize!==void 0&&(t["@_sz"]=String(Math.round(e.fontSize*100)),n=!0),e.bold&&(t["@_b"]="1",n=!0),e.italic&&(t["@_i"]="1",n=!0),e.color&&(t["a:solidFill"]={"a:srgbClr":{"@_val":Bne(e.color)}},n=!0),n?t:void 0}function ikn(e){const t={};e.align&&(t["a:pPr"]={"@_algn":e.align});const n=rkn(e);return t["a:r"]={...n?{"a:rPr":n}:{},"a:t":e.text},t}function okn(e){if(!e||e.length===0)return;const t=e.map(ikn);return{"a:bodyPr":{},"a:lstStyle":{},"a:p":t.length===1?t[0]:t}}function akn(e,t){const n=t?{...t}:{};return e.rotation&&(n["@_rot"]=String(Math.round(e.rotation*6e4))),e.flipH&&(n["@_flipH"]="1"),e.flipV&&(n["@_flipV"]="1"),Object.keys(n).length>0?n:void 0}function utt(e,t,n){const r={},i=akn(e,n);if(i&&(r["a:xfrm"]=i),t&&(r["a:prstGeom"]={"@_prst":e.prst??"rect","a:avLst":{}}),e.fill&&(r["a:solidFill"]={"a:srgbClr":{"@_val":Bne(e.fill)}}),e.stroke){const o={"a:solidFill":{"a:srgbClr":{"@_val":Bne(e.stroke)}}};e.strokeWidth!==void 0&&(o["@_w"]=String(Math.round(e.strokeWidth*12700))),r["a:ln"]=o}return r}function dtt(e,t,n){const r={"cdr:nvSpPr":{"cdr:cNvPr":{"@_id":String(t),"@_name":`Shape ${t}`},"cdr:cNvSpPr":{}},"cdr:spPr":utt(e,!0,n)},i=e.kind==="sp"?okn(e.paragraphs):void 0;return i&&(r["cdr:txBody"]=i),r}function ptt(e,t,n){return{"cdr:nvCxnSpPr":{"cdr:cNvPr":{"@_id":String(t),"@_name":`Connector ${t}`},"cdr:cNvCxnSpPr":{}},"cdr:spPr":utt(e,!1,n)}}function htt(e,t){return{"a:off":{"@_x":String(Math.round(e.x)),"@_y":String(Math.round(e.y))},"a:ext":{"@_cx":String(Math.round(t.cx)),"@_cy":String(Math.round(t.cy))}}}function kke(e){return htt(e.off,e.ext)}function skn(e){const t={...htt(e.off,e.ext),"a:chOff":{"@_x":String(Math.round(e.chOff.x)),"@_y":String(Math.round(e.chOff.y))},"a:chExt":{"@_cx":String(Math.round(e.chExt.cx)),"@_cy":String(Math.round(e.chExt.cy))}};return e.rotation&&(t["@_rot"]=String(Math.round(e.rotation*6e4))),e.flipH&&(t["@_flipH"]="1"),e.flipV&&(t["@_flipV"]="1"),t}function lkn(e,t,n){if(e.kind==="grpSp")return e.rawXml?{key:"grpSp",node:zn(e.rawXml)??{}}:{key:"grpSp",node:ftt(e,t,n)};const r=(e.kind==="pic"||e.kind==="graphicFrame")&&e.rawXml?e.kind:void 0;if(r){const i=zn(e.rawXml)??{};return tkn(i,e.off,e.ext),ctt(i,e.rotation,e.flipH,e.flipV),r==="pic"&&ltt(i,e.altText),{key:r,node:i}}return e.kind==="cxnSp"?{key:"cxnSp",node:ptt(e,t,kke(e))}:{key:"sp",node:dtt(e,t,kke(e))}}function ckn(e,t,n){const r={sp:[],cxnSp:[],pic:[],grpSp:[],graphicFrame:[]};for(const i of t){const o=n.next++,{key:a,node:s}=lkn(i,o,n);r[a].push(s)}for(const i of["sp","cxnSp","pic","grpSp","graphicFrame"])r[i].length>0&&(e[`cdr:${i}`]=r[i].length===1?r[i][0]:r[i])}function ftt(e,t,n){const r=e.transform??nkn,i={"cdr:nvGrpSpPr":{"cdr:cNvPr":{"@_id":String(t),"@_name":`Group ${t}`},"cdr:cNvGrpSpPr":{}},"cdr:grpSpPr":{"a:xfrm":skn(r)}};return ckn(i,e.children??[],n),i}function ukn(e){const t={"cdr:from":{"cdr:x":String(e.from.x),"cdr:y":String(e.from.y)}};if(e.anchor==="rel"){const n=e.to??e.from;t["cdr:to"]={"cdr:x":String(n.x),"cdr:y":String(n.y)}}else{const n=e.ext??{cx:0,cy:0};t["cdr:ext"]={"@_cx":String(Math.round(n.cx)),"@_cy":String(Math.round(n.cy))}}return t}function Mke(e,t){const n=ukn(e),r=t.next++;if(e.kind==="grpSp")return n["cdr:grpSp"]=e.rawXml?zn(e.rawXml)??{}:ftt(e,r,t),n["cdr:clientData"]={},n;const i=(e.kind==="pic"||e.kind==="graphicFrame")&&e.rawXml?`cdr:${e.kind}`:void 0;if(i){const o=zn(e.rawXml)??{};ctt(o,e.rotation,e.flipH,e.flipV),e.kind==="pic"&&ltt(o,e.altText),n[i]=o}else e.kind==="cxnSp"?n["cdr:cxnSp"]=ptt(e,r):n["cdr:sp"]=dtt(e,r);return n["cdr:clientData"]={},n}function dkn(e){const t=e.filter(o=>o.anchor==="rel"),n=e.filter(o=>o.anchor==="abs"),r={next:2},i={"@_xmlns:cdr":"http://schemas.openxmlformats.org/drawingml/2006/chartDrawing","@_xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","@_xmlns:c":"http://schemas.openxmlformats.org/drawingml/2006/chart","@_xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"};if(t.length>0){const o=t.map(a=>Mke(a,r));i["cdr:relSizeAnchor"]=o.length===1?o[0]:o}if(n.length>0){const o=n.map(a=>Mke(a,r));i["cdr:absSizeAnchor"]=o.length===1?o[0]:o}return{"c:userShapes":i}}var pkn=new Set(["title","ctrtitle"]),hkn=new Set(["body","obj","subtitle","pic","chart","tbl","media","clipart","dgm"]);function Pke(e){const t=(e??"").trim().toLowerCase()||"body";return pkn.has(t)?"title":hkn.has(t)?"content":t}function fkn(e){switch(e.type){case"image":case"picture":return["pic","obj","body"];case"chart":return["chart","obj","body"];case"table":return["tbl","obj","body"];case"media":case"model3d":return["media","pic","obj","body"];case"smartArt":return["dgm","obj","body"];case"text":return["body","subtitle","obj"];default:return["obj","body"]}}function mkn(e,t,n){if(Pke(t.type)!==Pke(n.type))return-1;const r=Ike(t.type),i=Ike(n.type);let o=1;t.idx!==void 0&&t.idx===n.idx&&(o+=100),r===i&&(o+=50);const a=fkn(e).indexOf(i);return a>=0&&(o+=30-a*5),i==="obj"&&(o+=10),o}function Ike(e){return(e??"").trim().toLowerCase()||"body"}function gkn(e){for(const t of["p:nvSpPr","p:nvPicPr","p:nvGraphicFramePr"]){const r=e[t]?.["p:nvPr"];if(r)return r}}function xkn(e,t){const n=gkn(e);if(!n)return;const r=n["p:ph"]??{};n["p:ph"]=r,t.type?r["@_type"]=t.type:delete r["@_type"],t.idx!==void 0?r["@_idx"]=t.idx:delete r["@_idx"]}function ykn(e,t,n,r,i){const o=e["p:spPr"];if(!o)return;const a=o["a:xfrm"]??{};o["a:xfrm"]=a;const s=a["a:off"]??{};a["a:off"]=s,s["@_x"]=String(t),s["@_y"]=String(n);const l=a["a:ext"]??{};a["a:ext"]=l,l["@_cx"]=String(r),l["@_cy"]=String(i)}function vkn(e,t,n,r,i,o){if(r<=0||i<=0)return null;const a={};e.type&&(a["@_type"]=e.type),e.idx!==void 0&&(a["@_idx"]=e.idx);const s={"p:nvSpPr":{"p:cNvPr":{"@_id":o,"@_name":`Placeholder ${e.type||"content"}`},"p:cNvSpPr":{"a:spLocks":{"@_noGrp":"1"}},"p:nvPr":{"p:ph":a}},"p:spPr":{"a:xfrm":{"a:off":{"@_x":String(t),"@_y":String(n)},"a:ext":{"@_cx":String(r),"@_cy":String(i)}}},"p:txBody":{"a:bodyPr":{},"a:lstStyle":{},"a:p":{"a:endParaRPr":{"@_lang":"en-US"}}}};return{type:"text",id:`ph-${e.type||"content"}-${e.idx??"0"}-${o}`,x:Math.round(t/jr),y:Math.round(n/jr),width:Math.round(r/jr),height:Math.round(i/jr),text:"",rawXml:s}}function bkn(e,t,n,r){const i=e["a:blip"],o=String(i?.["@_r:embed"]||i?.["@_r:link"]||""),a=o?t(o):void 0;if(!a)return;const s=e["a:tile"]!==void 0?"tile":"stretch";return a.startsWith("http://")||a.startsWith("https://")?r?{url:a,mode:s}:void 0:a.startsWith("data:")?{url:a,mode:s}:{url:n(a),mode:s}}var hpe="{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}",wkn="http://schemas.microsoft.com/office/drawing/2010/main",I_=e=>e.split(":").at(-1)??e;function WM(e,t){if(e)for(const n of Object.keys(e)){if(I_(n)!==t)continue;const r=e[n],i=Array.isArray(r)?r[0]:r;if(i&&typeof i=="object")return i}}function fpe(e,t){if(!e)return[];const n=[];for(const r of Object.keys(e)){if(I_(r)!==t)continue;const i=e[r];for(const o of Array.isArray(i)?i:[i])o&&typeof o=="object"&&n.push(o)}return n}function E9(e,t){if(e){for(const n of Object.keys(e))if(n.startsWith("@_")&&I_(n.slice(2))===t){const r=e[n];return r==null?void 0:String(r)}}}function O2(e,t){const n=E9(e,t);if(n===void 0)return;const r=Number(n.endsWith("%")?n.slice(0,-1):n);return Number.isFinite(r)?r:void 0}function zg(e,t){const n=O2(e,t);return n===void 0?void 0:n/1e5}function _ke(e){const t=WM(e,"extLst");return fpe(t,"ext")}var mtt={artisticBlur:"radius",artisticCement:"crackSpacing",artisticChalkSketch:"pressure",artisticCrisscrossEtching:"pressure",artisticCutout:"numberOfShades",artisticFilmGrain:"grainSize",artisticGlass:"scaling",artisticGlowDiffused:"intensity",artisticGlowEdges:"smoothness",artisticLightScreen:"gridSize",artisticLineDrawing:"pencilSize",artisticMarker:"size",artisticMosiaicBubbles:"pressure",artisticPaintBrush:"brushSize",artisticPaintStrokes:"intensity",artisticPastelsSmooth:"scaling",artisticPencilGrayscale:"pencilSize",artisticPencilSketch:"pressure",artisticPhotocopy:"detail",artisticPlasticWrap:"smoothness",artisticTexturizer:"scaling",artisticWatercolorSponge:"brushSize"},Skn=new Set(["trans","visible"]);function Dke(e,t){const n=[];for(const r of fpe(e,t)){const i=zg(r,"x1"),o=zg(r,"y1"),a=zg(r,"x2"),s=zg(r,"y2");i===void 0||o===void 0||a===void 0||s===void 0||n.push({x1:i,y1:o,x2:a,y2:s})}return n.length>0?n:void 0}function Ckn(e){const t=zg(e,"t"),n=zg(e,"b"),r=zg(e,"l"),i=zg(e,"r");if(t===void 0||n===void 0||r===void 0||i===void 0)return;const o={top:t,bottom:n,left:r,right:i,rawXml:e},a=Dke(e,"foregroundMark");a&&(o.foregroundMarks=a);const s=Dke(e,"backgroundMark");return s&&(o.backgroundMarks=s),o}function Tkn(e){const t={};for(const n of Object.keys(e)){if(!n.startsWith("@_"))continue;const r=Number(e[n]);Number.isFinite(r)&&(t[I_(n.slice(2))]=r)}return t}function Akn(e,t){const n=mtt[e],r=n!==void 0&&n in t?n:Object.keys(t).find(o=>!Skn.has(o));if(r===void 0)return;const i=t[r];return r==="radius"?i:i/1e3}function Ekn(e,t,n){if(e==="sharpenSoften"){const r=O2(t,"amount");return r!==void 0&&(n.sharpenSoften??={amount:r}),!0}if(e==="brightnessContrast"){const r=O2(t,"bright"),i=O2(t,"contrast");return(r!==void 0||i!==void 0)&&(n.brightnessContrast??={...r!==void 0?{bright:r}:{},...i!==void 0?{contrast:i}:{}}),!0}if(e==="colorTemperature"){const r=O2(t,"colorTemp");return r!==void 0&&(n.colorTemperature??={colorTemp:r}),!0}if(e==="saturation"){const r=O2(t,"sat");return r!==void 0&&(n.colorSaturation??={sat:r}),!0}return!1}function kkn(e,t){for(const n of Object.keys(e)){if(n.startsWith("@_"))continue;const r=I_(n),i=WM(e,r)??{};if(r==="backgroundRemoval"){t.backgroundRemoval??=Ckn(i);continue}if(Ekn(r,i,t)||!r.startsWith("artistic")||t.artisticEffect!==void 0)continue;t.artisticEffect=r;const o=Tkn(i);if(Object.keys(o).length>0){t.artisticParams=o;const a=Akn(r,o);a!==void 0&&(t.artisticRadius=a)}}}function Mkn(e){const t={};for(const n of e){if(E9(n,"uri")!==hpe)continue;const r=WM(n,"imgProps")??n,i=WM(r,"imgLayer"),o=E9(i,"embed");o&&(t.originalImageRelId=o);for(const a of fpe(i??r,"imgEffect"))kkn(a,t)}return Object.keys(t).length>0?t:void 0}var Pkn={blur:"artisticBlur",cement:"artisticCement",chalkSketch:"artisticChalkSketch",crisscrossEtching:"artisticCrisscrossEtching",cutout:"artisticCutout",filmGrain:"artisticFilmGrain",glass:"artisticGlass",glowDiffused:"artisticGlowDiffused",glow_edges:"artisticGlowEdges",glowEdges:"artisticGlowEdges",lightScreen:"artisticLightScreen",lineDrawing:"artisticLineDrawing",marker:"artisticMarker",mosaic:"artisticMosiaicBubbles",mosaicBubbles:"artisticMosiaicBubbles",paint:"artisticPaintBrush",paintBrush:"artisticPaintBrush",paintStrokes:"artisticPaintStrokes",pastelsSmooth:"artisticPastelsSmooth",pencilGrayscale:"artisticPencilGrayscale",pencilSketch:"artisticPencilSketch",photocopy:"artisticPhotocopy",plasticWrap:"artisticPlasticWrap",texturizer:"artisticTexturizer",watercolorSponge:"artisticWatercolorSponge"};function Ikn(e){const t=(e??"").trim();if(!(t.length===0||t==="none"))return t.startsWith("artistic")?t:Pkn[t]}var Xs=e=>String(Math.round(e));function _kn(e,t){const n={},r=e.artisticParams;if(r&&Object.keys(r).length>0){for(const[a,s]of Object.entries(r))Number.isFinite(s)&&(n[`@_${a}`]=Xs(s));return n}const i=e.artisticRadius,o=mtt[t];return o!==void 0&&typeof i=="number"&&Number.isFinite(i)&&(n[`@_${o}`]=Xs(o==="radius"?i:i*1e3)),n}function Rke(e){return(e??[]).map(t=>({"@_x1":Xs(t.x1*1e5),"@_y1":Xs(t.y1*1e5),"@_x2":Xs(t.x2*1e5),"@_y2":Xs(t.y2*1e5)}))}function Dkn(e){if(e.rawXml)return e.rawXml;const t={"@_t":Xs(e.top*1e5),"@_b":Xs(e.bottom*1e5),"@_l":Xs(e.left*1e5),"@_r":Xs(e.right*1e5)},n=Rke(e.foregroundMarks);n.length>0&&(t["a14:foregroundMark"]=n);const r=Rke(e.backgroundMarks);return r.length>0&&(t["a14:backgroundMark"]=r),t}var Ky=e=>typeof e=="number"&&Number.isFinite(e);function Rkn(e){const t=[];e.backgroundRemoval&&t.push({"a14:backgroundRemoval":Dkn(e.backgroundRemoval)}),Ky(e.sharpenSoften?.amount)&&t.push({"a14:sharpenSoften":{"@_amount":Xs(e.sharpenSoften.amount)}});const n=e.brightnessContrast;if(n&&(Ky(n.bright)||Ky(n.contrast))){const i={};Ky(n.bright)&&(i["@_bright"]=Xs(n.bright)),Ky(n.contrast)&&(i["@_contrast"]=Xs(n.contrast)),t.push({"a14:brightnessContrast":i})}Ky(e.colorTemperature?.colorTemp)&&t.push({"a14:colorTemperature":{"@_colorTemp":Xs(e.colorTemperature.colorTemp)}}),Ky(e.colorSaturation?.sat)&&t.push({"a14:saturation":{"@_sat":Xs(e.colorSaturation.sat)}});const r=Ikn(e.artisticEffect);if(r!==void 0){const i={};i[`a14:${r}`]=_kn(e,r),t.push(i)}return t}function Lkn(e){const t=Rkn(e);if(t.length===0)return;const n={},r=(e.originalImageRelId??"").trim();return r.length>0&&(n["@_r:embed"]=r),n["a14:imgEffect"]=t,{"@_uri":hpe,"a14:imgProps":{"@_xmlns:a14":wkn,"a14:imgLayer":n}}}function Nkn(e,t){const n=Lkn(t),r=_ke(e).filter(c=>E9(c,"uri")!==hpe),i=n?[...r,n]:r,o=Object.keys(e).find(c=>c.endsWith("extLst"))??"a:extLst";if(i.length===0){if(o in e&&_ke(e).length===0)return;delete e[o];return}const a=WM(e,"extLst"),s=a?Object.keys(a).find(c=>c.endsWith("ext")&&!c.endsWith("extLst"))??"a:ext":"a:ext",l=a??{};l[s]=i.length===1?i[0]:i,e[o]=l}var k9=e=>e.split(":").at(-1)??e;function Sh(e,t){if(!e)return;const n=Object.keys(e).find(i=>k9(i)===t);if(!n)return;const r=e[n];return r===""||r===null?{}:r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}function op(e,t,n){const r=Object.keys(e).find(i=>k9(i)===t);r?n?e[r]=n:delete e[r]:n&&(e[`a:${t}`]=n)}function gtt(e){const t=Ea(e),[n,r]=Object.entries(t??{})[0]??[];if(!n||!r||typeof r!="object")return;const i={};for(const[o,a]of Object.entries(r))i[o.startsWith("@_")?o:`a:${k9(o)}`]=a;return{[`a:${k9(n)}`]:i}}function r3(e,t){const n=String(e??"").trim();if(!n)return;const r=n.endsWith("%"),i=Number(r?n.slice(0,-1):n)/(r?1:1e3);if(!(!Number.isFinite(i)||i<0||t&&i>100))return i}function Kq(e,t,n,r,i){const o=e?.[`@_${t}`];if(e&&(o===void 0&&n===i||r3(o,r)===n))return e;const a={...e??{}};return a[`@_${t}`]=String(Math.round(n*1e3)),a}function Fkn(e,t){const n={},r=Sh(e,"alphaModFix");r&&(n.alphaModFix=r3(r["@_amt"],!1)??100,n.alphaModFixRawXml=r);const i=Sh(e,"alphaInv");if(i){const u=t(gtt(i));n.alphaInv={...u?{color:u}:{},rawXml:i}}const o=Sh(e,"alphaCeiling");o&&(n.alphaCeiling=!0,n.alphaCeilingRawXml=o);const a=Sh(e,"alphaFloor");a&&(n.alphaFloor=!0,n.alphaFloorRawXml=a);const s=Sh(e,"alphaMod");if(s){const u=Sh(s,"cont"),d=Sh(u,"alphaModFix"),p=d?r3(d["@_amt"],!1):void 0;n.alphaMod={...u?{contRawXml:u}:{},...p!==void 0?{amt:p}:{},rawXml:s}}const l=Sh(e,"alphaRepl");if(l){const u=r3(l["@_a"],!0);u!==void 0&&(n.alphaRepl=u,n.alphaReplRawXml=l)}const c=Sh(e,"alphaBiLevel");if(c){const u=r3(c["@_thresh"],!0);u!==void 0&&(n.alphaBiLevel=u,n.alphaBiLevelRawXml=c)}return n}function Okn(e,t,n){const r=t.alphaModFix;op(e,"alphaModFix",typeof r=="number"&&Number.isFinite(r)&&r>=0?Kq(t.alphaModFixRawXml,"amt",r,!1,100):void 0);const i=t.alphaInv;if(i){const s=i.rawXml,l=n(gtt(s)),c={...s??{}};if(i.color&&!ku(l,i.color)){for(const u of Object.keys(c))Ea({[u]:c[u]})&&delete c[u];Object.assign(c,nx(i.color))}op(e,"alphaInv",c)}else op(e,"alphaInv",void 0);if(op(e,"alphaCeiling",t.alphaCeiling?t.alphaCeilingRawXml??{}:void 0),op(e,"alphaFloor",t.alphaFloor?t.alphaFloorRawXml??{}:void 0),t.alphaMod){const s={...t.alphaMod.rawXml??{}};t.alphaMod.contRawXml&&op(s,"cont",t.alphaMod.contRawXml),Sh(s,"cont")||t.alphaMod.rawXml?op(e,"alphaMod",s):op(e,"alphaMod",void 0)}else op(e,"alphaMod",void 0);const o=t.alphaRepl;op(e,"alphaRepl",typeof o=="number"&&Number.isFinite(o)&&o>=0&&o<=100?Kq(t.alphaReplRawXml,"a",o,!0):void 0);const a=t.alphaBiLevel;op(e,"alphaBiLevel",typeof a=="number"&&Number.isFinite(a)&&a>=0&&a<=100?Kq(t.alphaBiLevelRawXml,"thresh",a,!0):void 0)}var P1=e=>e.split(":").at(-1)??e;function a0(e,t){if(!e)return;const n=Object.keys(e).find(i=>P1(i)===t);if(!n)return;const r=e[n];return r===""||r===null?{}:r&&typeof r=="object"&&!Array.isArray(r)?r:void 0}function xtt(e){const t=[];for(const[n,r]of Object.entries(e))if(["srgbClr","schemeClr","sysClr","prstClr","scrgbClr","hslClr"].includes(P1(n)))for(const i of Array.isArray(r)?r:[r])i&&typeof i=="object"&&t.push({[n]:i});return t}function ytt(e){const t=Ea(e);if(!t)return;const[n,r]=Object.entries(t)[0]??[];if(!n||!r||typeof r!="object")return;const i={};for(const[o,a]of Object.entries(r))i[o.startsWith("@_")?o:`a:${P1(o)}`]=a;return{[`a:${P1(n)}`]:i}}function i3(e,t){return t(ytt(e))}function vtt(e,t){return t(ytt(e))}function Bkn(e,t,n){const r={},i=a0(e,"grayscl");i&&(r.grayscale=!0,r.grayscaleRawXml=i);const o=a0(e,"biLevel");if(o){const p=Number(o["@_thresh"]);Number.isFinite(p)&&(r.biLevel=p/1e3),r.biLevelRawXml=o}const a=a0(e,"clrChange"),s=a0(a,"clrFrom"),l=a0(a,"clrTo");a&&s&&l&&(r.clrChange={clrFrom:i3(s,t)??"#000000",clrTo:i3(l,t)??"#FFFFFF",clrToTransparent:(vtt(l,n)??1)<=0,rawXml:a});const c=a0(e,"clrRepl"),u=i3(c,t);c&&u&&(r.clrRepl={color:u,rawXml:c});const d=a0(e,"duotone");if(d){const p=xtt(d).map(h=>i3(h,t));p[0]&&p[1]&&(r.duotone={color1:p[0],color2:p[1],rawXml:d})}return r}function Yy(e,t,n){return ku(i3(e,n),t)}function $L(e,t){const n={...e??{}};for(const o of Object.keys(n))Ea({[o]:n[o]})&&delete n[o];const r=Object.keys(n).find(o=>P1(o)==="extLst"),i=r?n[r]:void 0;return r&&delete n[r],Object.assign(n,t),r&&(n[r]=i),n}function Gu(e,t,n){const r=Object.keys(e).find(a=>P1(a)===t);if(r){n?e[r]=n:delete e[r];return}if(!n)return;const i=Object.keys(e).find(a=>P1(a)==="extLst"),o=i?e[i]:void 0;i&&delete e[i],e[`a:${t}`]=n,i&&(e[i]=o)}function jkn(e,t,n,r){Gu(e,"grayscl",t.grayscale?t.grayscaleRawXml??{}:void 0);let i;if(typeof t.biLevel=="number"&&Number.isFinite(t.biLevel)){const l=String(Math.round(Math.max(0,Math.min(100,t.biLevel))*1e3));i={...t.biLevelRawXml??{},"@_thresh":l}}Gu(e,"biLevel",i);const o=t.clrChange;if(o){const l=a0(o.rawXml,"clrFrom"),c=a0(o.rawXml,"clrTo"),u=c?(vtt(c,r)??1)<=0:void 0;if(Yy(l,o.clrFrom,n)&&Yy(c,o.clrTo,n)&&(u===void 0||o.clrToTransparent===u)&&o.rawXml)Gu(e,"clrChange",o.rawXml);else{const p=Yy(l,o.clrFrom,n)?Ea(l):nx(o.clrFrom),f=Yy(c,o.clrTo,n)&&u===o.clrToTransparent?Ea(c):nx(o.clrTo,o.clrToTransparent?0:void 0),m={...o.rawXml??{}};Gu(m,"clrFrom",$L(l,p??{})),Gu(m,"clrTo",$L(c,f??{})),Gu(e,"clrChange",m)}}else Gu(e,"clrChange",void 0);const a=t.clrRepl;if(a){const l=a.rawXml;Gu(e,"clrRepl",Yy(l,a.color,n)&&l?l:$L(l,nx(a.color)))}else Gu(e,"clrRepl",void 0);const s=t.duotone;if(s){const l=s.rawXml?xtt(s.rawXml):[];s.rawXml&&Yy(l[0],s.color1,n)&&Yy(l[1],s.color2,n)?Gu(e,"duotone",s.rawXml):Gu(e,"duotone",$L(s.rawXml,{"a:srgbClr":[{"@_val":s.color1.replace(/^#/u,"")},{"@_val":s.color2.replace(/^#/u,"")}]}))}else Gu(e,"duotone",void 0)}function Zf(e){if(typeof e!="number"||!Number.isFinite(e))return 0;const t=Math.min(.95,Math.abs(e));return e<0?-t:t}function Ukn(e){const t=Zf(e.cropLeft),n=Zf(e.cropTop),r=Zf(e.cropRight),i=Zf(e.cropBottom);if(!(Math.round(t*1e5)!==0||Math.round(n*1e5)!==0||Math.round(r*1e5)!==0||Math.round(i*1e5)!==0))return;const a=t+r,s=n+i,l=a>=.99?.99/a:1,c=s>=.99?.99/s:1,u=Zf(t*l),d=Zf(r*l),p=Zf(n*c),h=Zf(i*c),f={};return e.cropLeft!==void 0&&(f["@_l"]=String(Math.round(u*1e5))),e.cropTop!==void 0&&(f["@_t"]=String(Math.round(p*1e5))),e.cropRight!==void 0&&(f["@_r"]=String(Math.round(d*1e5))),e.cropBottom!==void 0&&(f["@_b"]=String(Math.round(h*1e5))),f}var zkn={"@_lang":"en-US"};function L$(e){return typeof e=="object"&&e!==null?e:void 0}function $kn(e){const t=L$(e);return t===void 0||Object.keys(t).length===0}function Hkn(e){const t=L$(e);return t?Object.keys(t).length===1&&t["@_lang"]===zkn["@_lang"]:!1}function HL(e){return e===""?{}:L$(e)}var btt=new Set(["a:pPr","a:endParaRPr"]);function Lke(e){return Object.keys(e).every(t=>t.startsWith("@_")||btt.has(t))}function Gkn(e,t,n){const r={};for(const i of Object.keys(e))i.startsWith("@_")&&(r[i]=e[i]);t!==void 0&&(r["a:pPr"]=t);for(const i of Object.keys(e))!i.startsWith("@_")&&!btt.has(i)&&(r[i]=e[i]);return n!==void 0&&(r["a:endParaRPr"]=n),r}function Vkn(e,t){for(let n=0;n<t.length;n++){const r=HL(e[n]),i=L$(t[n]);if(!r||!i)continue;let o=HL(i["a:pPr"]);const a=HL(r["a:pPr"]);a&&$kn(o)&&(o=a);let s=i["a:endParaRPr"];const l=HL(r["a:endParaRPr"]),c=Hkn(s);l&&(s===void 0||c)?s=l:!l&&c&&Lke(r)&&Lke(i)&&(s=void 0),t[n]=Gkn(i,o,s)}return t}function Wkn(e,t,n){if(!t?.inheritedRunStyle)return e;const r=n({...t,...t.inheritedRunStyle,...t.authoredRunStyle}),i=n(t),o={},a=new Map;for(const c of new Set([...Object.keys(r),...Object.keys(i)]))JSON.stringify(r[c])!==JSON.stringify(i[c])&&(c.startsWith("@_")?o[c.slice(2)]=i[c]===void 0?null:String(i[c]):a.set(c,i[c]??null));if(Object.keys(o).length===0&&a.size===0)return e;const s=["a:noFill","a:solidFill","a:gradFill","a:blipFill","a:pattFill","a:grpFill"],l=s.find(c=>a.get(c));if(l)for(const c of s)c!==l&&a.set(c,null);return b_(e,o,a,TKe)}function Yq(e,t){const{[t]:n,...r}=e;return r}function Xkn(e){const t=e;if(t.__isField)return{tag:"a:fld",value:Yq(e,"__isField")};if(t.__isLineBreak)return{tag:"a:br",value:Yq(e,"__isLineBreak")};if(!t.__isEquation)return{tag:"a:r",value:Yq(e,"__isField")};const n=t.__equationXml;if(n)return n["mc:AlternateContent"]?{tag:"mc:AlternateContent",value:n["mc:AlternateContent"]}:n["m:oMathPara"]?{tag:"m:oMathPara",value:n["m:oMathPara"]}:n["m:oMath"]?{tag:"m:oMath",value:n["m:oMath"]}:n["a14:m"]?{tag:"a14:m",value:n["a14:m"]}:{tag:"m:oMath",value:n}}function qkn(e){const t=new Set;let n="";for(const{tag:r}of e){if(r!==n&&t.has(r))return!1;t.add(r),n=r}return!0}function Kkn(e,t){if(qkn(t)){const r=new Map;for(const{tag:i,value:o}of t){const a=r.get(i);a?a.push(o):r.set(i,[o])}for(const[i,o]of r)e[i]=o.length>1?o:o[0];return}const n=new Map;for(const{tag:r}of t)n.set(r,(n.get(r)??0)+1);for(const[r,{tag:i,value:o}]of t.entries())e[(n.get(i)??0)>1?fw(i,r):i]=o}function Ykn(e,t){const n={};return["fontFamily","fontSize","bold","italic","underline","strikethrough","rtl","hyperlink","color","align"].forEach(i=>{const o=e?.[i];if(o===void 0)return;const a=e?.inheritedRunStyle;if(a&&o===(e?.authoredRunStyle?.[i]??a[i]))return;const s=t[0]?.style?.[i];t.every(c=>c.style?.[i]===s)&&(i==="fontFamily"&&typeof o=="string"?n.fontFamily=o:i==="fontSize"&&typeof o=="number"?n.fontSize=o:i==="bold"&&typeof o=="boolean"?n.bold=o:i==="italic"&&typeof o=="boolean"?n.italic=o:i==="underline"&&typeof o=="boolean"?n.underline=o:i==="strikethrough"&&typeof o=="boolean"?n.strikethrough=o:i==="rtl"&&typeof o=="boolean"?n.rtl=o:i==="hyperlink"&&typeof o=="string"?n.hyperlink=o:i==="color"&&typeof o=="string"?n.color=o:i==="align"&&(o==="left"||o==="center"||o==="right"||o==="justify")&&(n.align=o))}),n}var GL=GI;function Zkn(e,t){if(e)return r=>e[r]!==void 0;const n=typeof t=="number"&&Number.isFinite(t)&&t>0;return()=>!n}function wtt(e,t,n,r,i,o){const a={},s=Zkn(o,i);return typeof i=="number"&&Number.isFinite(i)&&i>=0&&(a["@_lvl"]=String(Math.min(Math.max(Math.round(i),0),8))),t&&s("align")&&(a["@_algn"]=t),e?.rtl!==void 0&&s("rtl")&&(a["@_rtl"]=e.rtl?"1":"0"),typeof e?.paragraphMarginLeft=="number"&&Number.isFinite(e.paragraphMarginLeft)&&s("paragraphMarginLeft")&&(a["@_marL"]=String(Math.round(e.paragraphMarginLeft*GL))),typeof e?.paragraphMarginRight=="number"&&Number.isFinite(e.paragraphMarginRight)&&s("paragraphMarginRight")&&(a["@_marR"]=String(Math.round(e.paragraphMarginRight*GL))),typeof e?.paragraphIndent=="number"&&Number.isFinite(e.paragraphIndent)&&s("paragraphIndent")&&(a["@_indent"]=String(Math.round(e.paragraphIndent*GL))),typeof e?.defaultTabSize=="number"&&Number.isFinite(e.defaultTabSize)&&s("defaultTabSize")&&(a["@_defTabSz"]=String(Math.round(e.defaultTabSize*GL))),e?.eaLineBreak!==void 0&&s("eaLineBreak")&&(a["@_eaLnBrk"]=e.eaLineBreak?"1":"0"),e?.latinLineBreak!==void 0&&s("latinLineBreak")&&(a["@_latinLnBrk"]=e.latinLineBreak?"1":"0"),e?.fontAlignment&&s("fontAlignment")&&(a["@_fontAlgn"]=e.fontAlignment),e?.hangingPunctuation!==void 0&&s("hangingPunctuation")&&(a["@_hangingPunct"]=e.hangingPunctuation?"1":"0"),r.lineSpacing&&s("lineSpacing")?a["a:lnSpc"]=r.lineSpacing:typeof r.lineSpacingExactPt=="number"&&Number.isFinite(r.lineSpacingExactPt)&&s("lineSpacingExactPt")&&(a["a:lnSpc"]={"a:spcPts":{"@_val":String(Math.round(r.lineSpacingExactPt*100))}}),r.spacingBefore&&s("paragraphSpacingBefore")&&(a["a:spcBef"]=r.spacingBefore),r.spacingAfter&&s("paragraphSpacingAfter")&&(a["a:spcAft"]=r.spacingAfter),n&&n.ownedByParagraph!==!1?Jkn(a,n):Hbn(a,o?.paragraphBulletPropertiesXml),e?.tabStops&&e.tabStops.length>0&&s("tabStops")?a["a:tabLst"]={"a:tab":e.tabStops.map(sze)}:o?.tabStopsExplicitEmpty&&(a["a:tabLst"]={}),e?.paragraphDefaultRunPropertiesXml&&s("paragraphDefaultRunPropertiesXml")&&(a["a:defRPr"]=e.paragraphDefaultRunPropertiesXml),e?.paragraphPropertiesExtLstXml&&s("paragraphPropertiesExtLstXml")&&(a["a:extLst"]=e.paragraphPropertiesExtLstXml),a}function Jkn(e,t){if(t.colorInherit)e["a:buClrTx"]={};else if(t.colorRef)e["a:buClr"]=Pse(t.colorRef);else if(t.colorXml)e["a:buClr"]=t.colorXml;else if(t.color){const n=t.color.replace("#","");e["a:buClr"]={"a:srgbClr":{"@_val":n}}}if(t.sizeInherit?e["a:buSzTx"]={}:t.sizePercent!==void 0?e["a:buSzPct"]={"@_val":String(Math.round(t.sizePercent*1e3))}:t.sizePts!==void 0&&(e["a:buSzPts"]={"@_val":String(Math.round(t.sizePts*100))}),t.fontInherit)e["a:buFontTx"]={};else if(t.fontFamily){const n={"@_typeface":t.fontFamily};t.fontPanose&&(n["@_panose"]=t.fontPanose),t.fontPitchFamily!==void 0&&(n["@_pitchFamily"]=String(t.fontPitchFamily)),t.fontCharset!==void 0&&(n["@_charset"]=String(t.fontCharset)),e["a:buFont"]=n}if(t.none){e["a:buNone"]={};return}if(t.char&&(e["a:buChar"]={"@_char":t.char}),t.autoNumType){const n={"@_type":t.autoNumType};t.autoNumStartAt!==void 0&&t.autoNumStartAt!==1&&(n["@_startAt"]=String(t.autoNumStartAt)),e["a:buAutoNum"]=n}t.imageBlipFillXml?e["a:buBlip"]=t.imageBlipFillXml:t.imageRelId&&(e["a:buBlip"]={"a:blip":{"@_r:embed":t.imageRelId}})}function Qkn(e,t,n,r){const i={};(Object.keys(t).length>0||r?.emptyParagraphPropertiesAuthored)&&(i["a:pPr"]=t);const o=e.map(a=>Xkn(a)).filter(a=>a!==void 0);return o.length>0?Kkn(i,o):i["a:r"]=e.length>1?e:e[0],n&&typeof n=="object"?i["a:endParaRPr"]=n:e.length===0&&!r?.bareParagraph&&(i["a:endParaRPr"]={"@_lang":"en-US"}),i}function e4n(e,t,n){const r=e[n],i=t[n];return typeof r=="boolean"||typeof i=="boolean"?!!r!=!!i:r!==i}function t4n(e){const t=e?.inheritedRunStyle;if(!e||!t)return()=>!0;const n=e.authoredRunStyle;return(...r)=>r.some(i=>n?.[i]!==void 0||e4n(e,t,i))}var n4n=["showVal","showCatName","showSerName","showPercent","showBubbleSize"];function M9(e,t,n){if(!Object.keys(e).some(i=>i.slice(i.lastIndexOf(":")+1)===t))return!1;const r=n.getChildByLocalName(e,t)?.["@_val"];return r===void 0||r==="1"||r==="true"}function Nke(e,t){return M9(e,"delete",t)?!1:n4n.some(n=>M9(e,n,t))}function Fke(e,t){return!e||M9(e,"delete",t)?!1:Nke(e,t)?!0:t.getChildrenArrayByLocalName(e,"dLbl").some(n=>Nke(n,t))}function r4n(e,t){return e!==void 0&&M9(e,"delete",t)}function i4n(e,t,n,r){const i={},o=Sa(t.getChildByLocalName(e,"spPr"),t,n);o&&(i.titleSpPr=o);const a=t.getChildByLocalName(t.getChildByLocalName(e,"tx"),"rich"),s=zp(a,t)??zp(t.getChildByLocalName(e,"txPr"),t),l=Ld(s,t,n,r);return l?.fontFamily!==void 0&&(i.titleFontFamily=l.fontFamily),l?.eastAsiaFontFamily!==void 0&&(i.titleEastAsiaFontFamily=l.eastAsiaFontFamily),l?.fontSize!==void 0&&(i.titleFontSize=l.fontSize),l?.bold!==void 0&&(i.titleFontBold=l.bold),l?.color!==void 0&&(i.titleFontColor=l.color),i}function Nk(e,t){if(e===!0||e===1)return!0;if(e===!1||e===0)return!1;const n=String(e??"").trim().toLowerCase();return n==="true"||n==="1"?!0:n==="false"||n==="0"?!1:t}function o4n(e,t){const n={};if(e["p:present"])n.showType="presented";else if(e["p:browse"]){n.showType="browsed";const a=e["p:browse"];a?.["@_showScrollbar"]!==void 0&&(n.showScrollbar=Nk(a["@_showScrollbar"],!0))}else if(e["p:kiosk"]){n.showType="kiosk";const s=e["p:kiosk"]?.["@_restart"];if(s!==void 0){const l=Number.parseInt(String(s),10);Number.isFinite(l)&&l>0&&(n.kioskRestartTime=l)}}n.loopContinuously=Nk(e["@_loop"],!1),n.showWithNarration=Nk(e["@_showNarration"],!0),n.showWithAnimation=Nk(e["@_showAnimation"],!0),Nk(e["@_useTimings"],!0)?n.advanceMode="useTimings":n.advanceMode="manual";const r=e["p:penClr"];if(r){const a=t?t(r):(()=>{const s=r["a:srgbClr"],l=String(s?.["@_val"]||"").trim();return l.length>0?`#${l}`:void 0})();a&&(n.penColor=a,n.penColorOriginal=a,n.penColorXml=r)}const i=e["p:sldRg"],o=e["p:custShow"];if(i){n.showSlidesMode="range";const a=Number.parseInt(String(i["@_st"]??"1"),10),s=Number.parseInt(String(i["@_end"]??"1"),10);Number.isFinite(a)&&(n.showSlidesFrom=a),Number.isFinite(s)&&(n.showSlidesTo=s)}else if(o){n.showSlidesMode="customShow";const a=String(o["@_id"]??"").trim();a.length>0&&(n.showSlidesCustomShowId=a)}else n.showSlidesMode="all";return n}function a4n(e,t,n){const r=t.filter(u=>String(u["@_Type"]??"").includes("/slideLayout")),i=new Map;for(const u of r){const d=String(u["@_Id"]??""),p=String(u["@_Target"]??"");d&&p&&i.set(d,p)}const o=e?s4n(Dt(e,"p:sldLayoutIdLst")?.["p:sldLayoutId"]):[],a=[],s=new Set,l=new Set,c=(u,d)=>{const p=n(d);!p||s.has(p)||(s.add(p),l.add(u),a.push(p))};for(const u of o){const d=lr(u,"r:id"),p=d?i.get(d):void 0;d&&p&&c(d,p)}for(const u of r){const d=String(u["@_Id"]??""),p=String(u["@_Target"]??"");p&&!l.has(d)&&c(d,p)}return a}function s4n(e){return e==null?[]:Array.isArray(e)?e:[e]}function Oke(e){if(!e)return;const t={};for(const n of dy){const r=String(e[`@_${n}`]??"").trim();r&&(t[n]=r)}return Object.keys(t).length>0?t:void 0}var l4n=/^#?[0-9a-f]{6}$/iu;function Zq(e,t){return!e||l4n.test(e)?e:t(e)??e}function Stt(e,t){return{...e,fromColor:Zq(e.fromColor,t),toColor:Zq(e.toColor,t),byColor:Zq(e.byColor,t),components:e.components?.map(n=>Stt(n,t))}}function c4n(e,t){return e.map(n=>n.colorAnimation?{...n,colorAnimation:Stt(n.colorAnimation,t)}:n)}var u4n=/<svg\b([^>]*)>/iu,Bke=/\spreserveAspectRatio\s*=\s*(?:"[^"]*"|'[^']*')/iu;function d4n(e){const t=u4n.exec(e);if(!t)return e;const n=t[1],r=Bke.test(n)?n.replace(Bke,' preserveAspectRatio="none"'):`${n} preserveAspectRatio="none"`;return`${e.slice(0,t.index)}<svg${r}>${e.slice(t.index+t[0].length)}`}function p4n(e,t){let n=!1;t.artisticEffect!==void 0&&(e.artisticEffect=t.artisticEffect,t.originalImageRelId!==void 0&&(e.artisticPrerenderedEffect=t.artisticEffect),t.artisticRadius!==void 0&&(e.artisticRadius=t.artisticRadius),t.artisticParams&&(e.artisticParams=t.artisticParams),n=!0),t.backgroundRemoval&&(e.backgroundRemoval=t.backgroundRemoval,n=!0),t.originalImageRelId!==void 0&&(e.originalImageRelId=t.originalImageRelId,n=!0);const r={};return t.sharpenSoften&&(e.sharpenSoften=t.sharpenSoften,r.sharpenSoften={...t.sharpenSoften}),t.brightnessContrast&&(e.brightnessContrast=t.brightnessContrast,r.brightnessContrast={...t.brightnessContrast}),t.colorTemperature&&(e.colorTemperature=t.colorTemperature,r.colorTemperature={...t.colorTemperature}),t.colorSaturation&&(e.colorSaturation=t.colorSaturation,r.colorSaturation={...t.colorSaturation}),Object.keys(r).length>0&&(t.originalImageRelId!==void 0&&(e.prerenderedCorrections=r),n=!0),n}var h4n=class{baselines=new Map;stale=new WeakSet;pending=new Map;seen=new Map;reset(){this.baselines.clear(),this.pending.clear(),this.seen.clear(),this.stale=new WeakSet}recordBaselines(e){for(const t of e)this.baselines.has(t.id)||this.baselines.set(t.id,OAe(t))}beginSave(){this.pending.clear(),this.seen.clear()}shouldWriteBack(e){if(this.stale.has(e))return!1;const t=OAe(e);this.remember(e,t);const n=this.baselines.get(e.id);return n!==void 0&&n===t?!1:(this.pending.set(e.id,t),!0)}commitSave(){for(const[e,t]of this.pending){const n=this.baselines.get(e);for(const r of this.seen.get(e)??[])r.signature!==t&&r.signature===n&&this.stale.add(r.element);this.baselines.set(e,t)}this.pending.clear(),this.seen.clear()}remember(e,t){const n=this.seen.get(e.id);n?n.push({element:e,signature:t}):this.seen.set(e.id,[{element:e,signature:t}])}},f4n=class{zip;parser;builder;presentationData=null;slideMap=new Map;savedSlideFingerprints=new Map;chartDataBaselines=new Map;slideRelsMap=new Map;externalRelsMap=new Map;layoutCache=new Map;masterCache=new Map;templateElementBaselines=new h4n;layoutXmlMap=new Map;masterXmlMap=new Map;layoutPlaceholderDefaultsCache=new Map;masterPlaceholderDefaultsCache=new Map;presentationDefaultTextStyle;imageDataCache=new Map;blobUrlCache=new Set;eagerDecodeImages=!1;allowExternalImages=!1;orderedSlidePaths=[];themeColorMap={};themeFontMap={};themeFormatScheme;themeOverrideCache=new Map;currentSlideClrMapOverride=null;masterClrMaps=new Map;masterThemeColorMaps=new Map;masterThemeFontMaps=new Map;masterThemeFormatSchemes=new Map;masterThemePaths=new Map;masterThemeMajorFontScripts=new Map;masterThemeMinorFontScripts=new Map;masterThemeNames=new Map;masterThemeFontSchemeNames=new Map;masterThemeColorSchemeNames=new Map;originalThemeXmlByPath=new Map;dirtyThemePaths=new Set;masterTxStylesCache=new Map;masterThemeObjectDefaults=new Map;masterThemeExtraClrSchemeLst=new Map;masterThemeCustClrLst=new Map;masterThemeExtLst=new Map;currentMasterClrMap=null;globalThemeColorMapSnapshot={};globalThemeFontMapSnapshot={};globalThemeFormatSchemeSnapshot;thumbnailData=null;vbaProjectBin=null;vbaRelatedParts=new Map;signatureDetection=null;customXmlParts=[];alternateContentBlockByRawXml=new WeakMap;loadedEmbeddedFonts=[];loadedEmbeddedFontList;loadedViewProperties;loadedTableStylesDefaultId;commentAuthorMap=new Map;commentAuthorDetails=new Map;commentAuthorsRootXml;modernCommentAuthors=new Map;modernCommentAuthorsRootXml;modernCommentAuthorsPartPath;modernCommentAuthorsRelationshipId;modernCommentParts=new Map;layoutOptions=[];compatibilityService;slideLoaderService;slideTransitionService;editorAnimationService;nativeAnimationService;animationWriteService;templateBackgroundService;xmlLookupService;dependencyFactory;rawSlideWidthEmu=0;rawSlideHeightEmu=0;rawSlideSizeType;elementXmlBuilder;contentTypesBuilder;elementTransformUpdater;presentationSaveBuilder;presentationSlidesReconciler;slideBackgroundBuilder;slideCommentPartWriter;slideMediaRelationshipBuilder;slideNotesPartUpdater;slideCommentsXmlFactory;commentAuthorsXmlFactory;colorStyleCodec;connectorParser;shapeStyleExtractor;tableDataParser;mediaDataParser;graphicFrameParser;documentPropertiesUpdater;static EMU_PER_PX=9525;static EDITOR_META_EXTENSION_URI="{A6F62C1B-B45C-4E8A-8B0A-1B3E5F8C8D4A}";static EDITOR_META_NAMESPACE_URI="http://schemas.pptx.ai/pptx/editor-meta";isStrictOoxml=!1;_originalParser=null;detectAndSetStrictConformance(e){if(rWe(e)&&(this.isStrictOoxml=!0,kM(e),!this._originalParser)){this._originalParser=this.parser;const t=this.parser;this.parser=new Proxy(t,{get(n,r,i){return r==="parse"?function(o,a){const s=n.parse(o,a??!1);return typeof s=="object"&&s!==null&&kM(s),s}:Reflect.get(n,r,i)}})}}async loadPartRelationships(e,t){const n=await this.zip.file(t??ux(e))?.async("string");if(!n)return;const o=this.parser.parse(n)?.Relationships?.Relationship,a=Array.isArray(o)?o:o?[o]:[],s=new Map,l=new Set;for(const c of a){const u=c["@_Id"],d=c["@_Target"];!u||!d||(s.set(String(u),String(d)),String(c["@_TargetMode"]??"").toLowerCase()==="external"&&l.add(String(u)))}this.slideRelsMap.set(e,s),l.size>0&&this.externalRelsMap.set(e,l)}restoreOriginalParser(){this._originalParser&&(this.parser=this._originalParser,this._originalParser=null)}},I1=["wholeTbl","band1H","band2H","band1V","band2V","lastCol","firstCol","lastRow","seCell","swCell","firstRow","neCell","nwCell"];function _c(e){const t=e.trim().toUpperCase();return t.startsWith("{")?t:`{${t}}`}function Ctt(...e){for(const t of e)if(t?.schemeColor?.startsWith("accent"))return t.schemeColor}function mpe(e,t,n){if(!e)return;const r=e["a:fill"],o=(r?.["a:solidFill"]??e["a:solidFill"])?.["a:schemeClr"],a=o&&String(o["@_val"]||"").trim()||void 0,s=a?{schemeColor:a}:void 0,l=!!e["a:effectLst"],c=r?void 0:e["a:fillRef"],u=x4n(c),d=s??(u?m4n(u,t,n):void 0);if(!(!d&&!l&&!u))return{...d?{fill:d}:{},...u?{fillRef:u}:{},...l?{hasEffectLst:l}:{}}}function m4n(e,t,n){if(e.idx===0||e.idx===1e3)return{schemeColor:"",noFill:!0};if(!t)return;const r=e.idx>=1001?t.backgroundFillStyles[e.idx-1001]:t.fillStyles[e.idx-1];if(!r)return;const i=e.color?.schemeColor,o=i&&n?n[i]:void 0;if(r.kind==="gradient"&&r.rawNode){const a=g4n(r.rawNode,o);if(a)return{schemeColor:"",gradient:a}}if(o&&r.rawNode){const a=r.rawNode["a:schemeClr"];return{schemeColor:"",color:a?Zc(o,a):o}}return r.color?{schemeColor:"",color:r.color}:void 0}function g4n(e,t){if(!t)return;const r=e["a:gsLst"]?.["a:gs"],i=Array.isArray(r)?r:r?[r]:[],o=[];for(const s of i){const l=s["a:schemeClr"],c=l?Zc(t,l):void 0;if(!c)continue;const u=(parseInt(String(s["@_pos"]||"0"),10)||0)/1e3;o.push({position:u,fill:{schemeColor:"",color:c}})}if(o.length===0)return;const a=e["a:lin"];if(a){const l=((parseInt(String(a["@_ang"]||"0"),10)||0)/6e4%360+360)%360;return{stops:o,angle:l,type:"linear"}}return e["a:path"]!==void 0?{stops:o,type:"radial"}:{stops:o,type:"linear"}}function x4n(e){if(!e)return;const t=parseInt(String(e["@_idx"]??""),10);if(!Number.isFinite(t))return;const n=e["a:schemeClr"],r=fde(e),i=e["a:srgbClr"];if(r)return{idx:t,color:r};if(!n&&i){const o=String(i["@_val"]||"").trim();if(o)return{idx:t,color:{schemeColor:"",color:o.startsWith("#")?o:`#${o}`}}}return{idx:t}}function y4n(e,t,n){const r=String(e["@_styleId"]||"").trim();if(!r)return;const i=_c(r),o=String(e["@_styleName"]||"").trim()||void 0,a=h=>e[`a:${h}`],s={},l={},c={},u={};for(const h of I1){const f=a(h),m=mde(f,t);m&&(s[`${h}Fill`]=m);const g=gde(f);g&&(l[`${h}Text`]=g);const y=f?.["a:tcStyle"],v=i9(y);v&&(c[`${h}Borders`]=v);const b=YKe(y);b&&(u[`${h}Cell3D`]=b)}const d=mpe(e["a:tblBg"],n?.formatScheme,n?.colorMap),p=Ctt(s.wholeTblFill,s.band1HFill,s.band1VFill,s.firstRowFill);return{styleId:i,styleName:o,accentKey:p,...d?{tableBackground:d}:{},...s,...l,...c,...u}}function v4n(e,t,n,r){const i=e["a:tblStyleLst"];if(!i)return;const o=String(i["@_def"]||"").trim(),a=o?_c(o):void 0,s={};for(const l of t(i["a:tblStyle"])){const c=y4n(l,n,r);c&&(s[c.styleId]=c)}if(!(Object.keys(s).length===0&&!a))return{map:s,...a?{defaultStyleId:a}:{}}}var b4n="ppt/tableStyles.xml",w4n="ppt/_rels/tableStyles.xml.rels",S4n=960,C4n=540,T4n=class jne extends f4n{async exportSlides(t,n){const r=this.resolveExportIndices(t,n);if(n.format!=="svg")throw this.compatibilityService.reportWarning({code:"EXPORT_BACKEND_UNAVAILABLE",message:`Export to "${n.format}" requires a platform-specific rendering backend. No export backend is configured in this runtime.`,severity:"warning",scope:"presentation"}),new Error(`exportSlides: "${n.format}" needs a rendering backend that pptx-viewer-core does not ship. Use format "svg" for headless output, a viewer binding's browser export pipeline for PNG/PDF, or override exportSlides with your own backend.`);const{width:i,height:o}=this.resolveExportViewport(n),a=new TextEncoder,s=new Map;for(const l of r){const c=t[l];c.hidden&&!n.includeHidden||s.set(l,a.encode(s$.exportSlide(c,i,o)))}return s}resolveExportViewport(t){const n=this.rawSlideWidthEmu/jne.EMU_PER_PX,r=this.rawSlideHeightEmu/jne.EMU_PER_PX,i=n>0?n:S4n,o=r>0?r:C4n;return!t.width||t.width<=0?{width:i,height:o}:{width:t.width,height:o*t.width/i}}resolveExportIndices(t,n){return(n.slideIndices&&n.slideIndices.length>0?n.slideIndices:t.map((i,o)=>o)).filter(i=>Number.isInteger(i)&&i>=0&&i<t.length)}normalizeTableStyleGuid(t){return _c(t)}deriveTableStyleAccentKey(...t){return Ctt(...t)}extractTableBackground(t){return mpe(t,this.globalThemeFormatSchemeSnapshot,this.globalThemeColorMapSnapshot)}extractTableStyleSectionFill(t){return mde(t)}extractTableStyleSectionBorders(t){return i9(t?.["a:tcStyle"])}extractTableStyleSectionText(t){return gde(t)}ensureArray(t){return t?Array.isArray(t)?t:[t]:[]}async parseTableStyles(){this.loadedTableStylesDefaultId=void 0;const t=await this.zip.file(b4n)?.async("string");if(t)try{const n=this.parser.parse(t),r=await this.buildTableStylesImageResolver(),i=v4n(n,o=>this.ensureArray(o),r,{formatScheme:this.globalThemeFormatSchemeSnapshot,colorMap:this.globalThemeColorMapSnapshot});return this.loadedTableStylesDefaultId=i?.defaultStyleId,!i||Object.keys(i.map).length===0?void 0:i.map}catch(n){console.warn("Failed to parse ppt/tableStyles.xml:",n);return}}async buildTableStylesImageResolver(){const t=await this.zip.file(w4n)?.async("string");if(!t)return;let n;try{const r=this.parser.parse(t),i=this.ensureArray(Dt(r,"Relationships")?.Relationship);n=new Map;for(const o of i){const a=String(o?.["@_Id"]||""),s=String(o?.["@_Target"]||"");if(!a||!s)continue;const l=s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:");n.set(a,l?s:s.startsWith("/")?s.substring(1):`ppt/${s}`)}}catch(r){console.warn("Failed to parse ppt/_rels/tableStyles.xml.rels:",r);return}if(n.size!==0)return(r,i)=>{const o=r||i;if(!o)return;const a=n.get(o);if(a)return a.startsWith("http://")||a.startsWith("https://")?this.allowExternalImages===!0?a:void 0:a}}},A4n=class extends T4n{serializeSingleAction(e,t,n,r){if(!n){delete e[t];return}const i={};let o=n.rId;if(!o&&n.url){const s=/^ppaction:\/\/(program|hlinkfile|hlinkpres)\b/iu.test(n.action??"");o=r(n.url,s)??void 0}i["@_r:id"]=o??"",n.action&&(i["@_action"]=n.action),n.tooltip&&(i["@_tooltip"]=n.tooltip),n.highlightClick&&(i["@_highlightClick"]="1"),n.endSnd&&(i["@_endSnd"]="1");const a=n.soundRId;a&&(i["a:snd"]={"@_r:embed":a}),e[t]=i}getTreeBucketKeyForElementType(e){return e==="picture"||e==="image"?"p:pic":e==="connector"?"p:cxnSp":e==="group"?"p:grpSp":e==="table"||e==="chart"||e==="smartArt"||e==="ole"||e==="media"?"p:graphicFrame":"p:sp"}getCnvPrNode(e,t){const n=xr(e,"p:nvContentPartPr","p:cNvPr");if(n)return n;const r=ITe(e,t);return xr(e,r?.nvKey??"p:nvSpPr","p:cNvPr")}serializeElementActions(e,t,n){const r=this.getTreeBucketKeyForElementType(t.type),i=this.getCnvPrNode(e,r);if(!i)return;const o="actionClick"in t?t.actionClick:void 0,a="actionHover"in t?t.actionHover:void 0;this.serializeSingleAction(i,"a:hlinkClick",o,n),this.serializeSingleAction(i,"a:hlinkHover",a,n);const s="isDecorative"in t?t.isDecorative:void 0;kbn(i,s)}serializeShapeLocks(e,t){const n=ITe(e,this.getTreeBucketKeyForElementType(t.type));if(!n)return;const r="locks"in t?t.locks:void 0,i=aq(e,n,!1),o=n.cNvKey==="p:cNvPicPr"&&"preferRelativeResize"in t?t.preferRelativeResize:void 0;if(o!==void 0){const l=i??aq(e,n,!0);l&&(l["@_preferRelativeResize"]=o?"1":"0")}const a=dpn(r,n,i?.[n.lockTag]);if(!a){i&&delete i[n.lockTag];return}const s=i??aq(e,n,!0);s&&(s[n.lockTag]=a)}},E4n=class extends A4n{parseAction(e,t,n){if(!e)return;const r=String(e["@_r:id"]||e["@_id"]||"").trim(),i=String(e["@_action"]||"").trim(),o=String(e["@_tooltip"]||"").trim(),a=String(e["@_highlightClick"]||"").trim(),s=String(e["@_endSnd"]||"").trim();if(r.length===0&&i.length===0&&o.length===0&&s.length===0)return;const l={};r.length>0&&(l.rId=r),i.length>0&&(l.action=i),o.length>0&&(l.tooltip=o),(a==="1"||a==="true")&&(l.highlightClick=!0),(s==="1"||s==="true")&&(l.endSnd=!0);const c=e["a:snd"],u=String(c?.["@_r:embed"]||c?.["@_r:link"]||"").trim();if(u.length>0&&(l.soundRId=u),r.length>0&&t){const d=t.get(r);if(d){l.url=d;const p=d.match(/slide(\d+)\.xml$/i);if(p){const h=parseInt(p[1],10),f=n.findIndex(m=>{const g=m.match(/slide(\d+)\.xml$/i);return g?parseInt(g[1],10)===h:!1});f>=0&&(l.targetSlideIndex=f)}}}if(l.soundRId&&t){const d=t.get(l.soundRId);d&&(l.soundPath=d)}return l}parseElementActions(e,t,n){if(!e)return{};const r={},i=e["a:hlinkClick"],o=e["a:hlinkHover"],a=this.parseAction(i,t,n),s=this.parseAction(o,t,n);return a&&(r.actionClick=a),s&&(r.actionHover=s),r}parseColor(e,t){return this.colorStyleCodec.parseColor(e,t)}extractTextFillVariants(e){const t={};if(!e)return t;const n=e["a:gradFill"];if(n){const o=n["a:gsLst"];if(o){const a=this.ensureArray(o["a:gs"]);if(a.length>=2){const s=a.map(d=>{const p=parseInt(String(d["@_pos"]||"0"))/1e3;return`${this.parseColor(d)||"#000000"} ${p}%`}),l=n["a:lin"]?parseInt(String(n["a:lin"]["@_ang"]||"0"))/6e4:0,c=n["a:path"]?"radial":"linear";t.textFillGradient=`linear-gradient(${XA(l)}deg, ${s.join(", ")})`;const u=[];for(const d of a){const p=d,h=this.parseColor(p)||"#000000",f=parseInt(String(p["@_pos"]||"0"),10),m=Number.isFinite(f)?f/1e5*100:0,g=this.extractColorOpacity(p);u.push({color:h,position:m,...g!==void 0?{opacity:g}:{}})}t.textFillGradientStops=u,t.textFillGradientAngle=l,t.textFillGradientType=c}}}const r=e["a:pattFill"];if(r){t.textFillPattern=String(r["@_prst"]||"");const o=r["a:fgClr"],a=r["a:bgClr"];o&&(t.textFillPatternForeground=this.parseColor(o)),a&&(t.textFillPatternBackground=this.parseColor(a))}const i=e["a:blipFill"];return i&&(t.textFillBlipXml=i),t}extractColorOpacity(e){return this.colorStyleCodec.extractColorOpacity(e)}},k4n=class extends E4n{extractImageEffects(e){if(!e)return null;const t={};let n=!1;const r=e["@_bright"]??e["@_brt"];if(r!==null){const h=parseInt(String(r));Number.isFinite(h)&&(t.brightness=h/1e3,n=!0)}const i=e["@_contrast"]??e["@_cont"];if(i!==null){const h=parseInt(String(i));Number.isFinite(h)&&(t.contrast=h/1e3,n=!0)}const o=Bkn(e,h=>this.parseColor(h),h=>this.extractColorOpacity(h));Object.assign(t,o),Object.keys(o).length>0&&(n=!0);const a=Fkn(e,h=>this.parseColor(h));Object.assign(t,a),Object.keys(a).length>0&&(n=!0);const s=e["a:lum"];if(s){const h={},f=s["@_bright"],m=s["@_contrast"];if(f!==void 0){const g=parseInt(String(f))/1e3;Number.isFinite(g)&&(h.bright=g)}if(m!==void 0){const g=parseInt(String(m))/1e3;Number.isFinite(g)&&(h.contrast=g)}t.lum=h,n=!0}const l=e["a:hsl"];if(l){const h={},f=l["@_hue"],m=l["@_sat"],g=l["@_lum"];if(f!==void 0){const y=parseInt(String(f))/6e4;Number.isFinite(y)&&(h.hue=y)}if(m!==void 0){const y=parseInt(String(m))/1e3;Number.isFinite(y)&&(h.sat=y)}if(g!==void 0){const y=parseInt(String(g))/1e3;Number.isFinite(y)&&(h.lum=y)}t.hsl=h,n=!0}const c=e["a:tint"];if(c){const h={},f=c["@_hue"],m=c["@_amt"];if(f!==void 0){const g=parseInt(String(f))/6e4;Number.isFinite(g)&&(h.hue=g)}if(m!==void 0){const g=parseInt(String(m))/1e3;Number.isFinite(g)&&(h.amt=g)}t.tint=h,n=!0}const u=e["a:fillOverlay"];if(u){const h=String(u["@_blend"]||"over"),f=["over","mult","screen","darken","lighten"].includes(h)?h:"over",m={};for(const A of Object.keys(u))A!=="@_blend"&&(m[A]=u[A]);const g=u["a:solidFill"],y=g?this.parseColor(g):void 0,v=g?this.extractColorOpacity(g)??1:void 0,b=u["a:gradFill"],w=b?this.resolveFillOverlayGradient(b):void 0,S=u["a:pattFill"],T=S?this.resolveFillOverlayPattern(S):void 0;t.fillOverlay={blend:f,fillRawXml:m,...y?{resolvedColor:y,resolvedOpacity:v}:{},...w?{resolvedGradient:w}:{},...T?{resolvedPattern:T}:{}},n=!0}const d=e["a:blur"];if(d){const h={},f=d["@_rad"];if(f!==void 0){const g=parseInt(String(f));Number.isFinite(g)&&(h.rad=g)}const m=d["@_grow"];if(m!==void 0){const g=String(m).toLowerCase();h.grow=g==="1"||g==="true"}t.blur=h,n=!0}const p=Dt(e,"a:extLst");if(p){const h=Mkn(this.ensureArray(p["a:ext"]));h&&p4n(t,h)&&(n=!0)}return n?t:null}resolveFillOverlayGradient(e){const t=e["a:gsLst"],n=this.ensureArray(t?.["a:gs"]),r=[];for(const o of n){const a=o,s=this.parseColor(a);if(!s)continue;const l=(parseInt(String(a["@_pos"]||"0"),10)||0)/1e5,c=this.extractColorOpacity(a);r.push({color:s,position:l,...c!==void 0?{opacity:c}:{}})}if(r.length===0)return;const i=e["a:lin"];return i?{type:"linear",angle:((parseInt(String(i["@_ang"]||"0"),10)||0)/6e4%360+360)%360,stops:r}:e["a:path"]!==void 0?{type:"radial",stops:r}:{type:"linear",angle:0,stops:r}}resolveFillOverlayPattern(e){const t=String(e["@_prst"]||"").trim();if(!t)return;const n=this.parseColor(e["a:fgClr"]),r=this.parseColor(e["a:bgClr"]);return{preset:t,foreground:n,background:r}}inspectArtisticEffects(e,t,n){}extractSvgBlipRelId(e){if(!e)return;const t=Dt(e,"a:extLst");if(!t)return;const n=this.ensureArray(t["a:ext"]);for(const r of n)if((lr(r,"uri")||"")==="{96DAC541-7B7A-43D3-8B79-37D633B846F1}"){const o=Dt(r,"asvg:svgBlip")||Dt(r,"a16:svgBlip");if(o)return lr(o,"r:embed")||lr(o,"r:link")||""}}resolveRelationshipTarget(e,t){return this.mediaDataParser.resolveRelationshipTarget(e,t)}},M4n=class extends k4n{walkMediaTimingTree(e,t,n){if(!e)return;for(const i of["p:video","p:audio"]){const o=this.ensureArray(e[i]);for(const a of o){const s=a["p:cMediaNode"];if(!s)continue;const l=s["p:tgtEl"],c=x$(l),u=c?.type==="shape"?c.subShapeId??c.shapeId:void 0;if(!u)continue;const d=s["p:cTn"],p=opn(d,i),h=s["@_fullScrn"]==="1";let f;const m=s["@_vol"];if(m!==void 0){const w=parseInt(String(m));Number.isFinite(w)&&(f=Math.max(0,Math.min(1,w/1e5)))}const g=s["@_showWhenStopped"]==="0",y=lYe(s,p.playAcrossSlides,i);let v;const b=s["@_posterFrame"];b&&(v=this.resolveRelationshipTarget(n,String(b))),t.set(u,{fullScreen:h||void 0,loop:p.loop||void 0,posterFramePath:v,volume:f,autoPlay:p.autoPlay||void 0,playAcrossSlides:y||void 0,hideWhenNotPlaying:g||void 0})}}const r=e["p:cTn"];if(r){const i=r["p:childTnLst"];if(i){for(const o of["p:par","p:seq","p:excl"]){const a=this.ensureArray(i[o]);for(const s of a)this.walkMediaTimingTree(s,t,n)}this.walkMediaTimingTree(i,t,n)}}for(const i of["p:par","p:seq","p:excl","p:tnLst"]){const o=this.ensureArray(e[i]);for(const a of o)this.walkMediaTimingTree(a,t,n)}}extractMediaTimingMap(e,t){const n=new Map;try{const r=kde(e?.["p:sld"]);if(!r)return n;this.walkMediaTimingTree(r,n,t)}catch(r){console.warn("Failed to parse media timing data:",r)}return n}getXmlShapeId(e){return npn(e)}getPathExtension(e){return sYe(e)}getImageMimeType(e){return rpn(e)}async getMediaArrayBuffer(e){if(!e)return;const t=this.zip.file(e);if(t)try{return await t.async("arraybuffer")}catch{return}}};async function P4n(e){if(typeof document>"u")return;const t=await Ji(()=>import("./UTIF-BtQhea94.js").then(u=>u.U),__vite__mapDeps([0,1,2])),n="default"in t?t.default:t,r=n.decode(e)[0];if(!r)return;n.decodeImage(e,r);const i=Number(r.width),o=Number(r.height);if(!Number.isFinite(i)||i<=0||!Number.isFinite(o)||o<=0)return;const a=new Uint8ClampedArray(n.toRGBA8(r)),s=document.createElement("canvas");s.width=i,s.height=o;const l=s.getContext("2d");if(!l)return;const c=l.createImageData(i,o);return c.data.set(a),l.putImageData(c,0,0),await new Promise(u=>{s.toBlob(d=>u(d??void 0),"image/png")})}var I4n=typeof globalThis.URL?.createObjectURL=="function"&&typeof globalThis.Blob<"u",_4n=class extends M4n{resolveThemeColor(e){}createImageUrl(e,t){if(I4n&&!ipn(t)){const i=new Blob([new Uint8Array(e)],{type:t}),o=URL.createObjectURL(i);return this.blobUrlCache.add(o),o}const n=new Uint8Array(e);let r="";for(let i=0;i<n.length;i++)r+=String.fromCharCode(n[i]);return`data:${t};base64,${btoa(r)}`}async getImageData(e){if(!e)return;const t=this.getPathExtension(e);if(e.startsWith("http://")||e.startsWith("https://"))return this.allowExternalImages!==!0?void 0:e;if(e.startsWith("data:"))return e;if(this.imageDataCache.has(e))return this.imageDataCache.get(e);const n=this.zip.file(e);if(!n){console.warn(`[pptx] Image file not found in archive: ${e}`);return}try{if(t==="emf"||t==="wmf"){const o=await n.async("arraybuffer"),a=await DVe(o);if(a)return this.imageDataCache.set(e,a),a;const s=e.replace(/\.[^.]+$/,"");for(const l of["png","jpg","jpeg","gif"]){const c=`${s}.${l}`,u=this.zip.file(c);if(u)try{const d=await u.async("arraybuffer"),p=l==="jpg"?"image/jpeg":`image/${l}`,h=this.createImageUrl(d,p);return this.imageDataCache.set(e,h),h}catch{}}return}if(t==="tif"||t==="tiff"){const o=await n.async("arraybuffer"),a=await P4n(o);if(a){const l=this.createImageUrl(await a.arrayBuffer(),"image/png");return this.imageDataCache.set(e,l),l}const s=this.createImageUrl(o,this.getImageMimeType(e));return this.imageDataCache.set(e,s),s}if(t==="svg"){const o=await n.async("string"),a=d4n(o),s=new TextEncoder().encode(a),l=this.createImageUrl(s.buffer,"image/svg+xml");return this.imageDataCache.set(e,l),l}const r=await n.async("arraybuffer"),i=this.createImageUrl(r,this.getImageMimeType(e));return this.imageDataCache.set(e,i),i}catch(r){console.warn(`[pptx] Failed to load image: ${e}`,r);return}}async getImageDataAsDataUrl(e){const t=await this.getImageData(e);return!t||!t.startsWith("blob:")?t:vqe(t,this.getImageMimeType(e))}async enrichMediaElementsWithTiming(e,t,n=0){if(!(n>32)){for(const i of e){if(i.type!=="media")continue;const o=this.getXmlShapeId(i.rawXml);if(!o)continue;const a=t.get(o);if(a&&(a.fullScreen!==void 0&&(i.fullScreen=a.fullScreen),a.loop!==void 0&&(i.loop=a.loop),a.volume!==void 0&&(i.volume=a.volume),a.autoPlay!==void 0&&(i.autoPlay=a.autoPlay),a.playAcrossSlides!==void 0&&(i.playAcrossSlides=a.playAcrossSlides),a.hideWhenNotPlaying!==void 0&&(i.hideWhenNotPlaying=a.hideWhenNotPlaying),a.posterFramePath)){i.posterFramePath=a.posterFramePath;try{const s=await this.getImageData(a.posterFramePath);s&&(i.posterFrameData=s)}catch{}}}for(const i of e)i.type==="group"&&i.children&&await this.enrichMediaElementsWithTiming(i.children,t,n+1)}}parseNativeAnimations(e,t){const n=this.nativeAnimationService.parseNativeAnimations(e);if(!n)return;const r=c4n(n,i=>this.resolveThemeColor(i));for(const i of r)i.soundRId&&(i.soundPath=this.resolveRelationshipTarget(t,i.soundRId));return r}},D4n=class extends _4n{buildRelativeTargetPath(e,t){const n=e.split("/"),r=t.split("/");for(n.pop();n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...Array.from({length:n.length}).fill(".."),...r].join("/")}async setMasterThemeRelationship(e,t){const n=e.replace(/ppt\/slideMasters\/(slideMaster\d+)\.xml/,"ppt/slideMasters/_rels/$1.xml.rels"),r=this.zip.file(n);if(!r)return;const i=await r.async("string"),o=this.parser.parse(i),a=o.Relationships||{},s=this.ensureArray(a.Relationship),l=s.find(c=>String(c["@_Type"]||"").includes("/theme"));l&&(l["@_Target"]=this.buildRelativeTargetPath(e,t),a.Relationship=s,o.Relationships=a,this.zip.file(n,this.builder.build(o)))}async setPresentationTheme(e,t=!0){const n=e.trim().replace(/\\/g,"/");if(!n.startsWith("ppt/theme/"))return;const r=this.zip.file(/^ppt\/slideMasters\/slideMaster\d+\.xml$/);if(!r||r.length===0)return;const i=t?r:[r[0]];await Promise.all(i.map(async o=>{await this.setMasterThemeRelationship(o.name,n)}))}async readPartText(e){return this.zip.file(e)?.async("string")}async parseAppProperties(){try{const e=await this.readPartText("docProps/app.xml");return e===void 0?void 0:lhn(pKe(e))}catch(e){console.warn("Failed to parse app properties:",e);return}}async parseCoreProperties(){try{const e=await this.readPartText("docProps/core.xml");return e===void 0?void 0:shn(lKe(e))}catch(e){console.warn("Failed to parse core properties:",e);return}}async parseCustomProperties(){try{const e=await this.readPartText("docProps/custom.xml");return chn(Ocn(e))}catch(e){return console.warn("Failed to parse custom properties:",e),[]}}async parseCustDataLst(e,t,n){if(!e)return[];const r=e["p:custDataLst"];if(!r)return[];const i=this.ensureArray(r["p:custData"]);if(i.length===0)return[];const o=this.zip.file(t);if(!o)return[];const a=await o.async("string"),l=this.parser.parse(a).Relationships||{},c=this.ensureArray(l.Relationship),u=new Map;for(const p of c){const h=String(p["@_Id"]||"").trim(),f=String(p["@_Target"]||"").trim(),m=String(p["@_Type"]||"").trim();h&&f&&m.endsWith("/relationships/customXml")&&u.set(h,f)}const d=[];for(const p of i){const h=String(p["@_r:id"]||"").trim();if(!h)continue;const f=u.get(h);if(!f)continue;const m=n.slice(0,n.lastIndexOf("/")),g=lf(m,f);if(!g)continue;let y;try{const b=this.zip.file(g);b&&(y=await b.async("string"))}catch{}const v=await dAn(this.zip,{parse:b=>this.parser.parse(b)},g);d.push({id:g,relId:h,data:y,contentType:v,rawXml:p})}return d}async parsePresentationCustomerData(){try{const e=this.presentationData?.["p:presentation"];return await this.parseCustDataLst(e,"ppt/_rels/presentation.xml.rels","ppt/presentation.xml")}catch(e){return console.warn("Failed to parse presentation customer data:",e),[]}}async parseSlideCustomerData(e,t){try{const r=e["p:sld"]?.["p:cSld"],i=`${t.replace("slides/","slides/_rels/")}.rels`;return await this.parseCustDataLst(r,i,t)}catch(n){return console.warn(`Failed to parse slide customer data for ${t}:`,n),[]}}parseSlideActiveXControls(e){return aWe(e)}async parseThumbnail(){const e=["docProps/thumbnail.jpeg","docProps/thumbnail.jpg","docProps/thumbnail.png","docProps/thumbnail.emf"];for(const t of e){const n=this.zip.file(t);if(n)try{return await n.async("uint8array")}catch{}}return null}async parseTags(){try{return await kAn(this.zip,{parse:e=>this.parser.parse(e)})}catch(e){return console.warn("Failed to parse tags:",e),[]}}},R4n=class Une extends D4n{parseBackgroundColor(t){if(!t)return;const n=Dt(t,"p:bgPr");if(n)return this.parseColor(Dt(n,"a:solidFill"));const r=Dt(t,"p:bgRef");if(r)return this.parseColor(r)}extractPlaceholderList(t){if(!t)return[];const n=this.ensureArray(t["p:sp"]),r=[];for(const i of n){const o=xr(i,"p:nvSpPr","p:nvPr","p:ph");if(!o)continue;const a=(lr(o,"type")??"body").trim(),s=lr(o,"idx"),l=xr(i,"p:spPr","a:xfrm"),c=Dt(l,"a:off"),u=Dt(l,"a:ext");r.push({type:a,idx:s,...VL("x",rb(c,"x")),...VL("y",rb(c,"y")),...VL("width",rb(u,"cx")),...VL("height",rb(u,"cy"))})}return r}static ALLOWED_PATH_ROOTS=new Set(["ppt","customXml","docProps","_rels"]);resolvePath(t,n){const r=t.split("/").filter(Boolean),i=n.split("/");r.length>0&&!t.endsWith("/")&&r.pop();for(const s of i)if(s===".."){if(r.length===0)return"";r.pop()}else s!=="."&&r.push(s);const o=r.join("/");if(o.length===0)return"";const a=r[0];return Une.ALLOWED_PATH_ROOTS.has(a)?o:""}resolveImagePath(t,n){const r=t.substring(0,t.lastIndexOf("/")+1),i=n.startsWith("..")?this.resolvePath(r,n):n.startsWith("/")?n.substring(1):r+n;if(i.length===0)return"";const o=i.indexOf("/"),a=o===-1?i:i.substring(0,o);return Une.ALLOWED_PATH_ROOTS.has(a)?i:""}async parseSlideMasters(){const t=[];try{const n=this.zip.file(/^ppt\/slideMasters\/slideMaster\d+\.xml$/);if(!n||n.length===0)return t;for(const r of n){const i=r.name,o=await r.async("string"),a=this.parser.parse(o),s=a?.["p:sldMaster"];if(!s)continue;this.masterXmlMap.has(i)||this.masterXmlMap.set(i,a);const l=(lr(s["p:cSld"],"name")??"").trim(),c=s["p:cSld"]?.["p:bg"],u=this.parseBackgroundColor(c),d=s["p:cSld"]?.["p:spTree"],p=this.extractPlaceholderList(d);let h;const f=s["@_preserve"];if(f!==void 0){const w=String(f).trim().toLowerCase();h=w==="1"||w==="true"}let m;const g=i.replace(/ppt\/slideMasters\/(slideMaster\d+)\.xml/,"ppt/slideMasters/_rels/$1.xml.rels"),y=this.zip.file(g);if(y){const w=await y.async("string"),S=this.parser.parse(w),T=this.ensureArray(Dt(S,"Relationships")?.Relationship);for(const A of T)if(String(A["@_Type"]||"").includes("/theme")){m=this.resolveImagePath(i,String(A["@_Target"]||""));break}}const v=[];if(y){const w=await y.async("string"),S=this.parser.parse(w),T=this.ensureArray(Dt(S,"Relationships")?.Relationship);v.push(...a4n(s,T,A=>this.resolveImagePath(i,A)))}const b=[];for(const w of v){const S=await this.parseSlideLayoutAttributes(w);S&&b.push(S)}t.push({path:i,name:l.length>0?l:void 0,backgroundColor:u,themePath:m,layoutPaths:v.length>0?v:void 0,layouts:b.length>0?b:void 0,placeholders:p.length>0?p:void 0,preserve:h})}}catch(n){console.warn("Failed to parse slide masters:",n)}return t}async parseHandoutMaster(){try{const t=this.zip.file(/^ppt\/handoutMasters\/handoutMaster\d+\.xml$/);if(!t||t.length===0)return;const n=t[0].name,r=await t[0].async("string"),o=this.parser.parse(r)?.["p:handoutMaster"];if(!o)return;const a=xr(o,"p:cSld","p:bg"),s=this.parseBackgroundColor(a),l=xr(o,"p:cSld","p:spTree"),c=this.extractPlaceholderList(l),u={path:n,backgroundColor:s,placeholders:c};u.clrMap=Oke(o["p:clrMap"]);const d=qO(o["p:hf"]);return d&&(u.headerFooter=d),u}catch(t){console.warn("Failed to parse handout master:",t);return}}async parseNotesMaster(){try{const t=this.zip.file(/^ppt\/notesMasters\/notesMaster\d+\.xml$/);if(!t||t.length===0)return;const n=t[0].name,r=await t[0].async("string"),o=this.parser.parse(r)?.["p:notesMaster"];if(!o)return;const a=xr(o,"p:cSld","p:bg"),s=this.parseBackgroundColor(a),l=xr(o,"p:cSld","p:spTree"),c=this.extractPlaceholderList(l),u={path:n,backgroundColor:s,placeholders:c};u.clrMap=Oke(o["p:clrMap"]);const d=qO(o["p:hf"]);return d&&(u.headerFooter=d),u}catch(t){console.warn("Failed to parse notes master:",t);return}}async parseSlideLayoutAttributes(t){try{const n=this.zip.file(t);if(!n)return;const r=await n.async("string"),i=this.parser.parse(r),o=i?.["p:sldLayout"];if(!o)return;this.layoutXmlMap.has(t)||this.layoutXmlMap.set(t,i),this.slideRelsMap.has(t)||await this.loadPartRelationships(t);const a={path:t},s=(lr(Dt(o,"p:cSld"),"name")??"").trim();s&&(a.name=s);const l=String(o["@_matchingName"]||"").trim();l&&(a.matchingName=l);const c=o["@_preserve"];if(c!==void 0){const v=String(c).trim().toLowerCase();a.preserve=v==="1"||v==="true"}const u=o["@_showMasterPhAnim"];if(u!==void 0){const v=String(u).trim().toLowerCase();a.showMasterPhAnim=v!=="0"&&v!=="false"}const d=o["@_userDrawn"];if(d!==void 0){const v=String(d).trim().toLowerCase();a.userDrawn=v==="1"||v==="true"}const p=qO(o["p:hf"]);p&&(a.headerFooter=p);const h=o["p:clrMapOvr"];if(h&&h["a:masterClrMapping"]===void 0){const v=h["a:overrideClrMapping"],b=v?rQe(v,(w,S)=>{console.warn(`Slide layout ${t}: dropping clrMapOvr ${w}="${S}" (not an ST_ColorSchemeIndex token).`)}):null;b&&(a.clrMapOverride=b)}const f=xr(o,"p:cSld","p:bg"),m=this.parseBackgroundColor(f);m&&(a.backgroundColor=m);const g=xr(o,"p:cSld","p:spTree"),y=this.extractPlaceholderList(g);return y.length>0&&(a.placeholders=y),a}catch(n){console.warn("Failed to parse slide layout attributes:",n);return}}parseCustomShows(){try{return sle(this.presentationData,this.xmlLookupService)}catch(t){console.warn("Failed to parse custom slide shows:",t);return}}};function VL(e,t){return t===void 0?{}:{[e]:t/jr}}var L4n=class extends R4n{resolveThemeTypeface(e){throw new Error("resolveThemeTypeface not yet initialised")}async parsePresentationProperties(){try{const e=await this.zip.file("ppt/_rels/presentation.xml.rels")?.async("string");if(!e)return;const t=this.parser.parse(e),r=this.ensureArray(t?.Relationships?.Relationship).find(f=>String(f?.["@_Type"]||"").includes("presProps")||String(f?.["@_Target"]||"").includes("presProps")),i=r?String(r["@_Target"]||""):"presProps.xml",o=i.startsWith("/")?i.substring(1):`ppt/${i}`,a=await this.zip.file(o)?.async("string");if(!a)return;const s=this.parser.parse(a),l=Object.keys(s??{}).find(f=>this.compatibilityService.getXmlLocalName(f)==="presentationPr"),c=l?s[l]:void 0;if(!c)return;const u={},d=c["p:showPr"];d&&Object.assign(u,o4n(d,f=>this.parseColor(f)));const p=s1n(c,"prnPr");p&&(u.printProperties=o1n(p));const h=c["p:clrMru"];if(h){const m=this.ensureArray(h["a:srgbClr"]).map(g=>{const y=String(g?.["@_val"]||"").trim();return y.length>0?`#${y}`:""}).filter(g=>g.length>0);m.length>0&&(u.mruColors=m)}return u}catch(e){console.warn("Failed to parse presentation properties:",e);return}}async parseViewProperties(){try{const e=await this.zip.file("ppt/viewProps.xml")?.async("string");if(!e)return;const t=this.parser.parse(e),n=Object.keys(t??{}).find(i=>i.replace(/^.*:/u,"")==="viewPr"),r=n?t[n]:void 0;return r?WCn(r):void 0}catch(e){console.warn("Failed to parse view properties:",e);return}}parseChartContainerFormat(e){return Fet(e,t=>this.compatibilityService.getXmlLocalName(t),t=>this.parseColor(t))}resolveLegendOverlay(e,t){const n=o=>o==="0"||o==="false"||o===!1,r=this.xmlLookupService.getChildByLocalName(t,"overlay");return r?!n(r["@_val"]):t["@_overlay"]!==void 0?!n(t["@_overlay"]):this.xmlLookupService.getChildByLocalName(e,"chartData")?void 0:!0}extractChartStyle(e,t){if(!e&&!t)return;const n={};let r=!1;const i=this.xmlLookupService.getChildByLocalName(e,"style")??this.xmlLookupService.getChildrenArrayByLocalName(e,"AlternateContent").map(l=>this.xmlLookupService.getChildByLocalName(this.xmlLookupService.getChildByLocalName(l,"Fallback"),"style")).find(l=>l?.["@_val"]!==void 0);i?.["@_val"]&&(n.styleId=parseInt(String(i["@_val"])),r=!0);const o=this.parseChartContainerFormat(e);o.fill&&(n.chartAreaFill=o.fill,r=!0),o.border&&(n.chartAreaBorder=o.border,r=!0);const a=kT(this.xmlLookupService.getChildByLocalName(e,"spPr"),this.xmlLookupService,this.colorStyleCodec);a&&(n.chartAreaGradient=a,r=!0);const s=UZt(e,this.xmlLookupService,{parseColor:l=>this.parseColor(l)},l=>this.resolveThemeTypeface(l)??l);if(s&&(n.textStyle=s,r=!0),t){const l=this.xmlLookupService.getChildByLocalName(t,"legend");if(l){n.hasLegend=!0,r=!0;const p=this.xmlLookupService.getChildByLocalName(l,"legendPos")?.["@_val"]??l["@_pos"];p&&(n.legendPosition=String(p));const h=this.resolveLegendOverlay(e,l);h!==void 0&&(n.legendOverlay=h);const f=iEn(l,b=>this.compatibilityService.getXmlLocalName(b),b=>this.parseColor(b),b=>this.resolveThemeTypeface(b)??b);f.length>0&&(n.legendEntries=f);const m=this.xmlLookupService.getChildByLocalName(l,"txPr"),g=this.xmlLookupService.getChildByLocalName(e,"txPr"),y=zp(m??g,this.xmlLookupService),v=Ld(y,this.xmlLookupService,{parseColor:b=>this.parseColor(b)},b=>this.resolveThemeTypeface(b)??b);v&&(n.legendTextStyle=v)}const c=this.xmlLookupService.getChildByLocalName(t,"title");c&&(n.hasTitle=!0,r=!0,Object.assign(n,i4n(c,this.xmlLookupService,{parseColor:(d,p)=>this.parseColor(d,p)},d=>this.resolveThemeTypeface(d)??d)));const u=this.xmlLookupService.getChildByLocalName(t,"plotArea");if(u){const d=kT(this.xmlLookupService.getChildByLocalName(u,"spPr"),this.xmlLookupService,this.colorStyleCodec);d&&(n.plotAreaGradient=d);const p=this.parseChartContainerFormat(u);p.fill&&(n.plotAreaFill=p.fill,r=!0),p.border&&(n.plotAreaBorder=p.border,r=!0);const h=this.xmlLookupService.getChildByLocalName(u,"valAx");h&&this.xmlLookupService.getChildByLocalName(h,"majorGridlines")&&(n.hasGridlines=!0,r=!0);const f=Object.keys(u).filter(m=>this.compatibilityService.getXmlLocalName(m).endsWith("Chart"));for(const m of f){const g=u[m];if(!g)continue;const y=this.xmlLookupService.getChildByLocalName(g,"dLbls");if(y&&!n.dataLabels&&(r4n(y,this.xmlLookupService)?n.hasDataLabels=!1:Fke(y,this.xmlLookupService)&&(n.hasDataLabels=!0),n.dataLabels=Vce(y,this.xmlLookupService,{parseColor:(v,b)=>this.parseColor(v,b)},v=>this.resolveThemeTypeface(v)??v),r=!0),!n.hasDataLabels){const v=this.xmlLookupService.getChildrenArrayByLocalName(g,"ser");for(const b of v){const w=this.xmlLookupService.getChildByLocalName(b,"dLbls");Fke(w,this.xmlLookupService)&&(n.hasDataLabels=!0,r=!0)}}}}}return r?n:void 0}toPresentationTarget(e){const t=e.startsWith("/")?e.substring(1):e;return t.startsWith("ppt/")?t.substring(4):t}toSlidePathFromTarget(e){const t=e.startsWith("/")?e.substring(1):e;return t.startsWith("ppt/")?t:`ppt/${t}`}toSlideRelsPath(e){return`${e.replace("slides/","slides/_rels/")}.rels`}},N4n=class extends L4n{createEmptySlideXml(){return{"p:sld":{"@_xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","@_xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","@_xmlns:p":"http://schemas.openxmlformats.org/presentationml/2006/main","p:cSld":{"p:spTree":{"p:nvGrpSpPr":{"p:cNvPr":{"@_id":"1","@_name":""},"p:cNvGrpSpPr":{},"p:nvPr":{}},"p:grpSpPr":{"a:xfrm":{"a:off":{"@_x":"0","@_y":"0"},"a:ext":{"@_cx":"0","@_cy":"0"},"a:chOff":{"@_x":"0","@_y":"0"},"a:chExt":{"@_cx":"0","@_cy":"0"}}}}},"p:clrMapOvr":{"a:masterClrMapping":{}}}}}deepCloneXml(e){if(e)try{return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}catch{return}}findSourceSlidePath(e){if(e&&this.slideMap.has(e)&&e.startsWith("ppt/slides/slide"))return e}async loadSlideRelationships(e,t){await this.loadPartRelationships(e,t)}async reconcilePresentationSlidesForSave(e){return await this.presentationSlidesReconciler.reconcile({...e,zip:this.zip,parser:this.parser,xmlBuilder:this.builder,presentationData:this.presentationData,slideMap:this.slideMap,slideRelsMap:this.slideRelsMap,toPresentationTarget:t=>this.toPresentationTarget(t),toSlidePathFromTarget:t=>this.toSlidePathFromTarget(t),toSlideRelsPath:t=>this.toSlideRelsPath(t),createEmptySlideXml:()=>this.createEmptySlideXml(),deepCloneXml:t=>this.deepCloneXml(t),findSourceSlidePath:t=>this.findSourceSlidePath(t),loadSlideRelationships:(t,n)=>this.loadSlideRelationships(t,n),onSlidePartsDuplicated:t=>{for(const[n,r]of t){const i=this.chartDataBaselines.get(n);if(!i)continue;const o=JSON.parse(i);cde(o,t),this.chartDataBaselines.set(r,JSON.stringify(o))}}})}buildSlideTransitionXml(e){return this.slideTransitionService.buildSlideTransitionXml(e)}embedTransitionSound(e,t){if(typeof e.soundData!="string"||e.soundData.length===0)return;const n=this.parseDataUrlToBytes(e.soundData);if(!n){this.compatibilityService.reportWarning({code:"SAVE_TRANSITION_SOUND_PAYLOAD_UNSUPPORTED",message:"Transition sound payload could not be converted to an embedded media part and was dropped.",scope:"save",slideId:t.slideId}),delete e.soundData;return}const r=t.saveSession.nextMediaPath(n.extension,"audio");this.zip.file(r,n.bytes);const i=t.slideRelationshipRegistry.nextRelationshipId();t.slideRelationshipRegistry.upsertRelationship(i,t.slideAudioRelationshipType,r.replace(/^ppt\//u,"../")),e.soundRId=i,e.soundPath=r,delete e.soundData}applyEditorAnimations(e,t){this.editorAnimationService.applyEditorAnimations(e,t)}ensureSlideTree(e){e["p:sld"]||(e["p:sld"]={});const t=e["p:sld"];t["p:cSld"]||(t["p:cSld"]={});const n=t["p:cSld"];if(!n["p:spTree"]){const r=this.createEmptySlideXml(),i=r["p:sld"]?.["p:cSld"]?.["p:spTree"];i&&(n["p:spTree"]=i)}return t["p:cSld"]=n,e["p:sld"]=t,n["p:spTree"]}parseDataUrlToBytes(e){return wu(e)}async resolveMediaToBytes(e){const t=wu(e);return t||F7e(e)}textAlignToDrawingValue(e){if(e==="left")return"l";if(e==="center")return"ctr";if(e==="right")return"r";if(e==="justify")return"just";if(e==="justLow")return"justLow";if(e==="dist")return"dist";if(e==="thaiDist")return"thaiDist"}pixelsToPoints(e){return e*(72/96)}createParagraphSpacingXmlFromPx(e){if(typeof e!="number"||!Number.isFinite(e))return;const t=Math.max(0,this.pixelsToPoints(e));return{"a:spcPts":{"@_val":String(Math.round(t*100))}}}createLineSpacingXmlFromMultiplier(e){if(typeof e!="number"||!Number.isFinite(e))return;const t=Math.max(.1,Math.min(5,e));return{"a:spcPct":{"@_val":String(Math.round(t*1e5))}}}},df=9525;function F4n(e,t){const n=!!e.textShadowColor||typeof e.textShadowBlur=="number"&&e.textShadowBlur>0,r=!!e.textInnerShadowColor||typeof e.textInnerShadowBlur=="number"&&e.textInnerShadowBlur>0,i=!!e.textPresetShadowName,o=!!e.textGlowColor||typeof e.textGlowRadius=="number"&&e.textGlowRadius>0,a=!!e.textReflection,s=typeof e.textBlurRadius=="number"&&e.textBlurRadius>0,l=typeof e.textSoftEdgeRadius=="number"&&e.textSoftEdgeRadius>0,c=typeof e.textAlphaModFix=="number",u=typeof e.textAlphaMod=="number",d=typeof e.textHslHue=="number"||typeof e.textHslSaturation=="number"||typeof e.textHslLuminance=="number",p=!!e.textClrChangeFrom&&!!e.textClrChangeTo,h=!!e.textDuotone;if(!(n||r||i||o||a||s||l||c||u||d||p||h))return;const m={};return n&&(m["a:outerShdw"]=O4n(e)),r&&(m["a:innerShdw"]=B4n(e,t)),i&&(m["a:prstShdw"]=j4n(e)),o&&(m["a:glow"]=U4n(e,t)),a&&(m["a:reflection"]=z4n(e)),s&&(m["a:blur"]={"@_rad":String(Math.round((e.textBlurRadius??0)*df))}),l&&(m["a:softEdge"]={"@_rad":String(Math.round((e.textSoftEdgeRadius??0)*df))}),c&&(m["a:alphaModFix"]={"@_amt":String(Math.round((e.textAlphaModFix??100)*1e3))}),u&&(m["a:alphaMod"]={"@_amt":String(Math.round((e.textAlphaMod??100)*1e3))}),d&&(m["a:hsl"]=$4n(e)),p&&(m["a:clrChange"]=H4n(e)),h&&e.textDuotone&&(m["a:duotone"]={"a:srgbClr":[{"@_val":e.textDuotone.color1.replace("#","")},{"@_val":e.textDuotone.color2.replace("#","")}]}),m}function Ttt(e,t){const n=e.replace("#",""),r=typeof t=="number"?Math.round(t*1e5):void 0;return{"@_val":n,...r!==void 0?{"a:alpha":{"@_val":String(r)}}:{}}}function O4n(e){const t=e.textShadowOffsetX??0,n=e.textShadowOffsetY??0,{distance:r,directionDegrees:i}=Eb(t,n);return{"@_blurRad":String(Math.round((e.textShadowBlur??4)*df)),"@_dist":String(Math.round(r*df)),"@_dir":_p(i),"a:srgbClr":Ttt(e.textShadowColor||"#000000",e.textShadowOpacity)}}function B4n(e,t){const n=e.textInnerShadowOffsetX??0,r=e.textInnerShadowOffsetY??0,{distance:i,directionDegrees:o}=Eb(n,r),a=e.textInnerShadowColor||"#000000",s=e.textInnerShadowColorXml?t?.(e.textInnerShadowColorXml):void 0;return{"@_blurRad":String(Math.round((e.textInnerShadowBlur??3)*df)),"@_dist":String(Math.round(i*df)),"@_dir":_p(o),...Ex(e.textInnerShadowColorRef,e.textInnerShadowColorXml,s,a,e.textInnerShadowOpacity)}}function j4n(e){const t={"@_prst":e.textPresetShadowName};return typeof e.textPresetShadowDistance=="number"&&(t["@_dist"]=String(Math.round(e.textPresetShadowDistance*df))),typeof e.textPresetShadowDirection=="number"&&(t["@_dir"]=_p(e.textPresetShadowDirection)),e.textPresetShadowColor&&(t["a:srgbClr"]=Ttt(e.textPresetShadowColor,e.textPresetShadowOpacity)),t}function U4n(e,t){const n=e.textGlowColor||"#ffff00",r=e.textGlowColorXml?t?.(e.textGlowColorXml):void 0;return{"@_rad":String(Math.round((e.textGlowRadius??6)*df)),...Ex(e.textGlowColorRef,e.textGlowColorXml,r,n,e.textGlowOpacity)}}function z4n(e){const t={};return typeof e.textReflectionBlur=="number"&&(t["@_blurRad"]=String(Math.round(e.textReflectionBlur*df))),typeof e.textReflectionStartOpacity=="number"&&(t["@_stA"]=String(Math.round(e.textReflectionStartOpacity*1e5))),typeof e.textReflectionEndOpacity=="number"&&(t["@_endA"]=String(Math.round(e.textReflectionEndOpacity*1e5))),typeof e.textReflectionEndPosition=="number"&&(t["@_endPos"]=String(Math.round(e.textReflectionEndPosition*1e5))),typeof e.textReflectionOffset=="number"&&(t["@_dist"]=String(Math.round(e.textReflectionOffset*df))),typeof e.textReflectionDirection=="number"&&(t["@_dir"]=_p(e.textReflectionDirection)),typeof e.textReflectionScaleX=="number"&&(t["@_sx"]=String(Math.round(e.textReflectionScaleX))),typeof e.textReflectionScaleY=="number"&&(t["@_sy"]=String(Math.round(e.textReflectionScaleY))),typeof e.textReflectionSkewX=="number"&&(t["@_kx"]=String(Math.round(e.textReflectionSkewX))),typeof e.textReflectionSkewY=="number"&&(t["@_ky"]=String(Math.round(e.textReflectionSkewY))),typeof e.textReflectionRotation=="number"&&(t["@_rot"]=String(Math.round(e.textReflectionRotation*6e4))),typeof e.textReflectionFadeDirection=="number"&&(t["@_fadeDir"]=_p(e.textReflectionFadeDirection)),e.textReflectionAlignment&&(t["@_algn"]=e.textReflectionAlignment),t}function $4n(e){const t={};return typeof e.textHslHue=="number"&&(t["@_hue"]=String(Math.round(e.textHslHue*6e4))),typeof e.textHslSaturation=="number"&&(t["@_sat"]=String(Math.round(e.textHslSaturation*1e3))),typeof e.textHslLuminance=="number"&&(t["@_lum"]=String(Math.round(e.textHslLuminance*1e3))),t}function H4n(e){return{"a:clrFrom":{"a:srgbClr":{"@_val":(e.textClrChangeFrom||"").replace("#","")}},"a:clrTo":{"a:srgbClr":{"@_val":(e.textClrChangeTo||"").replace("#","")}}}}function G4n(e,t,n,r){return t&&t.length>0&&(e["@_panose"]=t),typeof n=="number"&&Number.isFinite(n)&&(e["@_pitchFamily"]=String(n)),typeof r=="number"&&Number.isFinite(r)&&(e["@_charset"]=String(r)),e}function Jq(e,t,n,r,i){const o=e.authoredRunStyle,a=e.inheritedRunStyle;return o===void 0&&a===void 0?e[t]:o?.[t]!==void 0?o[t]:(a?.[r]??a?.[n])===i?a?.[t]:void 0}function V4n(e){const t={};return typeof e.widthEmu=="number"&&Number.isFinite(e.widthEmu)&&(t["@_w"]=String(Math.round(e.widthEmu))),e.compound&&(t["@_cmpd"]=e.compound),e.cap&&(t["@_cap"]=e.cap),e.algn&&(t["@_algn"]=e.algn),e.prstDash&&(t["a:prstDash"]={"@_val":e.prstDash}),e.headEndXml&&(t["a:headEnd"]=e.headEndXml),e.tailEndXml&&(t["a:tailEnd"]=e.tailEndXml),t}var W4n=class Att extends N4n{createRunPropertiesFromTextStyle(t,n){if(!t)return{"@_lang":"en-US","@_dirty":"0"};const r=t4n(t),i={};r("language")&&(i["@_lang"]=t.language||"en-US"),typeof t.fontSize=="number"&&Number.isFinite(t.fontSize)&&r("fontSize")&&(i["@_sz"]=String(Math.round(t.fontSize*(72/96)*100))),t.bold!==void 0&&r("bold")&&(i["@_b"]=t.bold?"1":"0"),t.italic!==void 0&&r("italic")&&(i["@_i"]=t.italic?"1":"0");const o=r("underline","underlineStyle","underlineExplicitNone");if(t.underline&&o?i["@_u"]=t.underlineStyle||"sng":t.underlineExplicitNone&&o&&(i["@_u"]="none"),t.strikethrough!==void 0&&r("strikethrough","strikeType")&&(i["@_strike"]=t.strikethrough?t.strikeType||"sngStrike":"noStrike"),typeof t.baseline=="number"&&r("baseline")){const h=t.authoredRunStyle?.baseline!==void 0||(t.inheritedRunStyle?.baseline??0)!==0;(t.baseline!==0||h)&&(i["@_baseline"]=String(t.baseline))}typeof t.characterSpacing=="number"&&t.characterSpacing!==0&&r("characterSpacing")&&(i["@_spc"]=String(t.characterSpacing)),typeof t.kerning=="number"&&t.kerning!==0&&r("kerning")&&(i["@_kern"]=String(t.kerning));const a=r("textCaps","textCapsExplicitNone");if(t.textCaps&&t.textCaps!=="none"&&a?i["@_cap"]=t.textCaps:t.textCapsExplicitNone&&a&&(i["@_cap"]="none"),t.kumimoji!==void 0&&r("kumimoji")&&(i["@_kumimoji"]=t.kumimoji?"1":"0"),t.normalizeHeight!==void 0&&r("normalizeHeight")&&(i["@_normalizeH"]=t.normalizeHeight?"1":"0"),t.noProof!==void 0&&r("noProof")&&(i["@_noProof"]=t.noProof?"1":"0"),r("dirty")&&(i["@_dirty"]=t.dirty?"1":"0"),t.spellingError!==void 0&&r("spellingError")&&(i["@_err"]=t.spellingError?"1":"0"),t.smartTagClean!==void 0&&r("smartTagClean")&&(i["@_smtClean"]=t.smartTagClean?"1":"0"),t.bookmark&&r("bookmark")&&(i["@_bmk"]=t.bookmark),t.altLanguage&&r("altLanguage")&&(i["@_altLang"]=t.altLanguage),typeof t.smartTagId=="number"&&Number.isFinite(t.smartTagId)&&r("smartTagId")&&(i["@_smtId"]=String(t.smartTagId)),(t.textOutlineWidth||t.textOutlineColor)&&r("textOutlineWidth","textOutlineColor","textOutlineDash")){const h={};typeof t.textOutlineWidth=="number"&&t.textOutlineWidth>0&&(h["@_w"]=String(Math.round(t.textOutlineWidth*Att.EMU_PER_PX))),t.textOutlineColor&&(h["a:solidFill"]={"a:srgbClr":{"@_val":t.textOutlineColor.replace("#","")}}),t.textOutlineDash&&(h["a:prstDash"]={"@_val":t.textOutlineDash}),i["a:ln"]=h}const s=r("textFillNone","color","textFillGradientStops","textFillGradientType","textFillPattern","textFillBlipXml");if(s&&t.textFillNone)i["a:noFill"]={};else if(s&&t.color){const h=t.colorXml?this.parseColor(t.colorXml):void 0;i["a:solidFill"]=Ex(t.colorRef,t.colorXml,h,t.color)}else if(s&&t.textFillGradientStops&&t.textFillGradientStops.length>0){const h=t.textFillGradientStops.filter(f=>!!f?.color).map(f=>{const m=(f.position??0)/100,g=Math.round(Math.max(0,Math.min(1,m))*1e5),y={"@_pos":String(g),"a:srgbClr":{"@_val":String(f.color||"").replace("#","")}};return typeof f.opacity=="number"&&Number.isFinite(f.opacity)&&f.opacity<1&&(y["a:srgbClr"]["a:alpha"]={"@_val":String(Math.round(f.opacity*1e5))}),y});if(h.length>0){const f={"a:gsLst":{"a:gs":h}};if((t.textFillGradientType||"linear")==="linear"){const g=typeof t.textFillGradientAngle=="number"&&Number.isFinite(t.textFillGradientAngle)?t.textFillGradientAngle:0;f["a:lin"]={"@_ang":String(Math.round(g*6e4)),"@_scaled":"1"}}else f["a:path"]={"@_path":"circle"};i["a:gradFill"]=f}}else if(s&&t.textFillPattern){const h={"@_prst":t.textFillPattern};t.textFillPatternForeground&&(h["a:fgClr"]={"a:srgbClr":{"@_val":t.textFillPatternForeground.replace("#","")}}),t.textFillPatternBackground&&(h["a:bgClr"]={"a:srgbClr":{"@_val":t.textFillPatternBackground.replace("#","")}}),i["a:pattFill"]=h}else s&&t.textFillBlipXml&&(i["a:blipFill"]=t.textFillBlipXml);const l=F4n(t,h=>this.parseColor(h));if(l?i["a:effectLst"]=l:t.textEffectsExplicitNone&&(i["a:effectLst"]={}),t.textEffectDagXml&&(i["a:effectDag"]=t.textEffectDagXml),t.highlightColor&&r("highlightColor")){const h=t.highlightColorXml?this.parseColor(t.highlightColorXml):void 0;i["a:highlight"]=Ex(void 0,t.highlightColorXml,h,t.highlightColor)}t.underlineLineFollowsText&&r("underlineLineFollowsText")?i["a:uLnTx"]={}:t.underlineLine&&r("underlineLine")&&(i["a:uLn"]=V4n(t.underlineLine)),t.underlineFillFollowsText&&r("underlineFillFollowsText")?i["a:uFillTx"]={}:t.underline&&t.underlineColor&&r("underlineColor")&&(i["a:uFill"]={"a:solidFill":{"a:srgbClr":{"@_val":t.underlineColor.replace("#","")}}});const c=(h,f,m,g)=>G4n({"@_typeface":h},Jq(t,`${f}Panose`,m,g,h),Jq(t,`${f}PitchFamily`,m,g,h),Jq(t,`${f}Charset`,m,g,h)),u=t.latinFontThemeToken??t.fontFamily;u&&r("fontFamily","latinFontThemeToken")&&(i["a:latin"]=c(u,"latinFont","fontFamily","latinFontThemeToken"));const d=t.eastAsiaFontThemeToken??t.eastAsiaFont;d&&r("eastAsiaFont","eastAsiaFontThemeToken")&&(i["a:ea"]=c(d,"eastAsiaFont","eastAsiaFont","eastAsiaFontThemeToken"));const p=t.complexScriptFontThemeToken??t.complexScriptFont;if(p&&r("complexScriptFont","complexScriptFontThemeToken")&&(i["a:cs"]=c(p,"complexScriptFont","complexScriptFont","complexScriptFontThemeToken")),t.symbolFont&&r("symbolFont")&&(i["a:sym"]=c(t.symbolFont,"symbolFont","symbolFont","symbolFont")),t.hyperlink&&n){const h=String(t.hyperlink).trim();if(h.startsWith("ppaction://")){const f={"@_action":h};t.hyperlinkTooltip&&(f["@_tooltip"]=t.hyperlinkTooltip),t.hyperlinkRId&&(f["@_r:id"]=t.hyperlinkRId),this.applyHyperlinkExtraAttrs(f,t),i["a:hlinkClick"]=f}else if(h.length>0){const f=n(h);if(f){const m={"@_r:id":f};t.hyperlinkTooltip&&(m["@_tooltip"]=t.hyperlinkTooltip),t.hyperlinkAction&&(m["@_action"]=t.hyperlinkAction),this.applyHyperlinkExtraAttrs(m,t),i["a:hlinkClick"]=m}}}if(t.hyperlinkMouseOver&&n){const h=String(t.hyperlinkMouseOver).trim();if(h.length>0){const f=n(h);if(f){const m={"@_r:id":f};t.hyperlinkMouseOverSoundXml&&typeof t.hyperlinkMouseOverSoundXml=="object"&&(m["a:snd"]=t.hyperlinkMouseOverSoundXml),i["a:hlinkMouseOver"]=m}}}return t.rtl!==void 0&&r("rtl")&&(i["a:rtl"]={"@_val":t.rtl?"1":"0"}),t.runPropertiesExtLstXml&&typeof t.runPropertiesExtLstXml=="object"&&(i["a:extLst"]=t.runPropertiesExtLstXml),Object.keys(i).length>0?i:void 0}applyHyperlinkExtraAttrs(t,n){n.hyperlinkInvalidUrl&&(t["@_invalidUrl"]=n.hyperlinkInvalidUrl),n.hyperlinkTargetFrame&&(t["@_tgtFrame"]=n.hyperlinkTargetFrame),n.hyperlinkHistory!==void 0&&(t["@_history"]=n.hyperlinkHistory?"1":"0"),n.hyperlinkHighlightClick!==void 0&&(t["@_highlightClick"]=n.hyperlinkHighlightClick?"1":"0"),n.hyperlinkEndSound!==void 0&&(t["@_endSnd"]=n.hyperlinkEndSound?"1":"0"),n.hyperlinkSoundXml&&typeof n.hyperlinkSoundXml=="object"&&(t["a:snd"]=n.hyperlinkSoundXml),n.hyperlinkExtensionXml&&typeof n.hyperlinkExtensionXml=="object"&&(t["a:extLst"]=n.hyperlinkExtensionXml)}},X4n=new Set(["authoredRunStyle","inheritedRunStyle"]);function jke(e,t){const n=e.inheritedRunStyle;if(!n)return e;const r=e.authoredRunStyle,i=t??{},o={...n,...i};for(const[a,s]of Object.entries(e)){if(X4n.has(a))continue;const l=a,c=r?.[l]??n[l];s!==c&&(o[a]=s)}return o.authoredRunStyle=i,o.inheritedRunStyle=n,o}function q4n(e){const t=e.rubyPropertiesXml;if(t){const r={...t},i=String(t["@_algn"]??t["a:rubyAlign"]?.["@_val"]??"ctr").trim();return e.rubyAlignment&&e.rubyAlignment!==i&&(r["@_algn"]=e.rubyAlignment),r}const n={};return e.rubyAlignment&&(n["@_algn"]=e.rubyAlignment),e.rubyFontSize!==void 0&&(n["@_hps"]=String(Math.round(e.rubyFontSize*2))),n}function Uke(e,t){const n={};return e&&(n["a:rPr"]=e),n["a:t"]=t,n}function K4n(e,t,n){const r=e.rubyRunAuthoredStyles,i=r?jke(t,r.outer):t,o=r?jke(t,r.base):t,a={},s=n(i);return s&&(a["a:rPr"]=s),a["a:ruby"]={"a:rubyPr":q4n(e),"a:rt":{"a:r":Uke(n(e.rubyStyle??t),e.rubyText??"")},"a:rubyBase":{"a:r":Uke(n(o),e.text)}},a}function Y4n(e){if(!e||e.rtl===void 0)return e;const{rtl:t,...n}=e;return n}function Z4n(e){const t=e?.inheritedRunStyle;if(!e||!t)return e;const n=e.authoredRunStyle,r={};for(const[i,o]of Object.entries(e)){const a=i,s=n?.[a]??t[a];s!==void 0&&s===o||(r[i]=o)}return r}var J4n=class extends W4n{createParagraphsFromTextContent(e,t,n,r){const i=Y4n(t),o=(S,T,A,E,k,M)=>{const I=k?{...t,...k}:t,D=this.textAlignToDrawingValue(I?.align),R={spacingBefore:this.createParagraphSpacingXmlFromPx(I?.paragraphSpacingBefore),spacingAfter:this.createParagraphSpacingXmlFromPx(I?.paragraphSpacingAfter),lineSpacing:this.createLineSpacingXmlFromMultiplier(I?.lineSpacing),lineSpacingExactPt:I?.lineSpacingExactPt},_=wtt(I,D,T,R,A,k);return Qkn(S,_,E,M)},a=S=>S,s=(S,T)=>{const A=this.createRunPropertiesFromTextStyle(T,r),E={};return A&&(E["a:rPr"]=A),E["a:t"]=a(S),E},l=(S,T,A,E,k,M)=>{const I={"@_type":A};E&&(k==="uuid"?I["@_uuid"]=E:I["@_id"]=E);const D=this.createRunPropertiesFromTextStyle(T,r);return D&&(I["a:rPr"]=D),M&&typeof M=="object"&&(I["a:pPr"]=M),I["a:t"]=a(S),I},c=(S,T)=>K4n(S,T,A=>this.createRunPropertiesFromTextStyle(A,r)),u=[];let d=[],p,h,f,m,g={},y=!1;const v=()=>{const S=o(d,p,h,f,m,g);d.length===0&&delete S["a:r"],u.push(S),d=[],p=void 0,h=void 0,f=void 0,m=void 0,g={},y=!1};if(n&&n.length>0){const S=Ykn(i,n),T=Z4n(i);return n.forEach(A=>{const E={...A.style?.inheritedRunStyle?T:i,...A.style,...S};if(y||(A.bulletInfo&&(p=A.bulletInfo),A.paragraphLevel!==void 0&&(h=A.paragraphLevel),A.endParaRunProperties&&(f=A.endParaRunProperties),f=Wkn(f,A.paragraphInsertionStyle,D=>this.createRunPropertiesFromTextStyle(D,r)??{}),A.paragraphProperties&&(m=A.paragraphProperties),g={emptyParagraphPropertiesAuthored:A.emptyParagraphPropertiesAuthored,bareParagraph:A.bareParagraph},y=!0),AQe(A))return;if(A.isLineBreak){const D={};if(A.breakRunProperties&&typeof A.breakRunProperties=="object")D["a:rPr"]={...A.breakRunProperties};else{const R=this.createRunPropertiesFromTextStyle(E,r);R&&(D["a:rPr"]=R)}D.__isLineBreak=!0,d.push(D);return}if(A.equationXml&&typeof A.equationXml=="object"){const D={__isEquation:!0,__equationXml:A.equationSourceXml??A.equationXml};d.push(D);return}const k=A.isParagraphBreak?`
352
352
  `:String(A.text??"");if(k===""&&(A.paragraphInsertionStyle||A.bareParagraph)&&!A.fieldType&&A.rubyText===void 0)return;const M=k.split(`
353
353
  `),I=M.length>1;M.forEach((D,R)=>{if(I&&D.length===0){R<M.length-1&&v();return}if(A.rubyText!==void 0){const _={...A,text:D};d.push(c(_,E))}else if(A.fieldType){const _=l(D,E,A.fieldType,A.fieldGuid,A.fieldGuidAttr,A.fieldParagraphPropertiesXml);_.__isField=!0,d.push(_)}else d.push(s(D,E));R<M.length-1&&v()})}),(d.length>0||u.length===0||y)&&v(),u}return(typeof e=="string"?e:"").split(`
354
354
  `).forEach(S=>{u.push(o([s(S,i)]))}),u.length===0&&u.push(o([s("",i)])),u}},Q4n=class extends J4n{updateNotesXmlText(e,t,n){const i=e?.["p:notes"]?.["p:cSld"]?.["p:spTree"];if(!i)return!1;const o=this.ensureArray(i["p:sp"]);if(o.length===0)return!1;const a=o.find(u=>{const d=u?.["p:nvSpPr"]?.["p:nvPr"]?.["p:ph"];return String(d?.["@_type"]||"").trim().toLowerCase()==="body"})||o.find(u=>!!u?.["p:txBody"])||o[0];if(!a)return!1;a["p:txBody"]||(a["p:txBody"]={"a:bodyPr":{},"a:lstStyle":{}});const s=a["p:txBody"];let l=n;n&&n.length>0&&t!==void 0&&n.map(d=>String(d.text??"")).join("")!==t&&(l=void 0);const c=this.ensureArray(s["a:p"]);return s["a:p"]=Vkn(c,this.createParagraphsFromTextContent(t,void 0,l)),!0}createPictureXml(e,t){return this.elementXmlBuilder.createPictureXml(e,t)}createMediaGraphicFrameXml(e,t){return this.elementXmlBuilder.createMediaGraphicFrameXml(e,t)}getMediaMimeType(e){return this.mediaDataParser.getMediaMimeType(e)}createElementXml(e){return this.elementXmlBuilder.createElementXml(e)}createConnectorXml(e){return this.elementXmlBuilder.createConnectorXml(e)}};function Wp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function N$(e,t){const n=[];for(const i of t){const o=n.at(-1);o&&o.tag===i.tag?o.nodes.push(i.node):n.push({tag:i.tag,nodes:[i.node]})}const r=new Set;n.forEach((i,o)=>{const a=r.has(i.tag)?fw(i.tag,o):i.tag;r.add(i.tag),Wp(e,a,i.nodes.length===1?i.nodes[0]:i.nodes)})}function e3n(e,t,n,r){const i=r?r.extWidthEmu:n?n.widthEmu:No(e.width,e.widthEmu,t),o=r?r.extHeightEmu:n?n.heightEmu:No(e.height,e.heightEmu,t);let a,s;if(r)a=r.offXEmu,s=r.offYEmu;else if(n)a=n.xEmu,s=n.yEmu;else{const c=No(e.x,e.xEmu,t),u=No(e.y,e.yEmu,t),d=h$({rotationDeg:e.rotation,oldOffXEmu:e.xEmu,oldOffYEmu:e.yEmu,oldExtWidthEmu:e.widthEmu,oldExtHeightEmu:e.heightEmu,newExtWidthEmu:i,newExtHeightEmu:o,naiveOffXEmu:c,naiveOffYEmu:u});a=d?d.offXEmu:c,s=d?d.offYEmu:u}const l={};return typeof e.rotation=="number"&&e.rotation!==0&&(l["@_rot"]=String(Math.round(e.rotation*6e4))),e.flipHorizontal&&(l["@_flipH"]="1"),e.flipVertical&&(l["@_flipV"]="1"),l["a:off"]={"@_x":String(a),"@_y":String(s)},l["a:ext"]={"@_cx":String(i),"@_cy":String(o)},r?(l["a:chOff"]={"@_x":String(r.chOffXEmu),"@_y":String(r.chOffYEmu)},l["a:chExt"]={"@_cx":String(r.chExtWidthEmu),"@_cy":String(r.chExtHeightEmu)}):f$(e)?(l["a:chOff"]={"@_x":String(e.chOffXEmu),"@_y":String(e.chOffYEmu)},l["a:chExt"]={"@_cx":String(e.chExtWidthEmu),"@_cy":String(e.chExtHeightEmu)}):(l["a:chOff"]={"@_x":"0","@_y":"0"},l["a:chExt"]={"@_cx":String(i),"@_cy":String(o)}),l}function t3n(e,t,n,r,i){const o=e["p:spPr"],a=e["p:grpSpPr"],s=o?.["a:xfrm"]??e["p:xfrm"]??a?.["a:xfrm"];if(!s)return;s["a:off"]??={},s["a:ext"]??={};const l=i??(r?dde(t,r,n):void 0);s["a:off"]["@_x"]=String(l?l.xEmu:No(t.x,t.xEmu,n)),s["a:off"]["@_y"]=String(l?l.yEmu:No(t.y,t.yEmu,n)),s["a:ext"]["@_cx"]=String(l?l.widthEmu:No(t.width,t.widthEmu,n)),s["a:ext"]["@_cy"]=String(l?l.heightEmu:No(t.height,t.heightEmu,n))}var n3n={text:"p:sp",shape:"p:sp",ink:"p:sp",connector:"p:cxnSp",picture:"p:pic",image:"p:pic",group:"p:grpSp",contentPart:"p:contentPart",table:"p:graphicFrame",chart:"p:graphicFrame",smartArt:"p:graphicFrame",ole:"p:graphicFrame",media:"p:graphicFrame",model3d:"p16:model3D"};function Ett(e,t){return t["p:nvGrpSpPr"]?"p:grpSp":t["p:nvPicPr"]?"p:pic":t["p:nvCxnSpPr"]?"p:cxnSp":t["p:nvGraphicFramePr"]||t["a:graphic"]&&t["p:xfrm"]?"p:graphicFrame":t["p16:model3Drel"]?"p16:model3D":t["pslz:sldZmObj"]?"pslz:sldZm":t["psezm:sectionZmObj"]?"psezm:sectionZm":t["psuz:summaryZmObj"]?"psuz:summaryZm":t["p:nvSpPr"]?"p:sp":n3n[e]??null}function ktt(e){return JSON.parse(JSON.stringify(e))}function zke(e,t,n,r){const i=e?.["p:nvGrpSpPr"];if(!i)return{"p:cNvPr":{"@_id":r??"0","@_name":t??n},"p:cNvGrpSpPr":{},"p:nvPr":{}};const o=ktt(i),a=o["p:cNvPr"]??{};return r!==void 0&&(a["@_id"]=r),(typeof a["@_id"]!="string"||a["@_id"].length===0)&&(a["@_id"]="0"),t!==void 0?a["@_name"]=t:typeof a["@_name"]!="string"&&(a["@_name"]=n),o["p:cNvPr"]=a,o["p:cNvGrpSpPr"]??={},o["p:nvPr"]??={},o}function r3n(e,t){const n=e?.["p:grpSpPr"];if(!n)return{"a:xfrm":t};const r=ktt(n);return delete r["a:xfrm"],{"a:xfrm":t,...r}}function i3n(e,t){const n=e["p:extLst"];n!==void 0&&delete e["p:extLst"],N$(e,t.map(r=>({tag:r.tag,node:r.xml}))),n!==void 0&&(e["p:extLst"]=n)}var $ke={shapes:"p:sp",pics:"p:pic",connectors:"p:cxnSp",graphicFrames:"p:graphicFrame",groups:"p:grpSp",model3ds:"p16:model3D",contentParts:"p:contentPart"};function o3n(){return{shapes:[],pics:[],connectors:[],graphicFrames:[],groups:[],model3ds:[],contentParts:[],zooms:[]}}function a3n(e){for(const n of Object.keys($ke)){const r=e[n][0];if(r)return{tag:$ke[n],xml:r}}const t=e.zooms[0];if(t){const n=Ett("zoom",t);return n?{tag:n,xml:t}:null}return null}function s3n(e,t){const n=e.groupFill;return n&&n.fillMode!=="group"?n:t}function zne(e,t){return e===void 0||t===void 0?e===t:e.toLowerCase()===t.toLowerCase()}function l3n(e,t){return e===void 0||t===void 0?e===t:e.length===t.length&&e.every((n,r)=>{const i=t[r];return zne(n.color,i.color)&&n.position===i.position&&n.opacity===i.opacity})}function c3n(e,t){return!t||t.fillMode==="group"?!1:e.fillMode===t.fillMode&&zne(e.fillColor,t.fillColor)&&e.fillOpacity===t.fillOpacity&&e.fillGradient===t.fillGradient&&e.fillGradientAngle===t.fillGradientAngle&&e.fillGradientType===t.fillGradientType&&e.fillPatternPreset===t.fillPatternPreset&&zne(e.fillPatternBackgroundColor,t.fillPatternBackgroundColor)&&l3n(e.fillGradientStops,t.fillGradientStops)}var u3n="http://schemas.openxmlformats.org/drawingml/2006/chart",Hke="http://schemas.microsoft.com/office/drawing/2014/chartex",d3n="http://schemas.openxmlformats.org/drawingml/2006/chart",Gke="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function p3n(e,t){e.locks={noGrouping:!0,...e.locks};const n=String(Math.round(e.x*t)),r=String(Math.round(e.y*t)),i=String(Math.round(Math.max(e.width,1)*t)),o=String(Math.round(Math.max(e.height,1)*t)),a={"@_firstRow":e.tableData?.firstRowHeader?"1":"0","@_bandRow":e.tableData?.bandedRows?"1":"0"};return e.tableData?.tableStyleId&&(a["a:tableStyleId"]=e.tableData.tableStyleId),{"p:nvGraphicFramePr":{"p:cNvPr":{"@_id":"0","@_name":e.name||"Table"},"p:cNvGraphicFramePr":{"a:graphicFrameLocks":{"@_noGrp":"1"}},"p:nvPr":{}},"p:xfrm":{"a:off":{"@_x":n,"@_y":r},"a:ext":{"@_cx":i,"@_cy":o}},"a:graphic":{"a:graphicData":{"@_uri":"http://schemas.openxmlformats.org/drawingml/2006/table","a:tbl":{"a:tblPr":a,"a:tblGrid":{}}}}}}function h3n(e,t,n,r=!1){const i=String(Math.round(e.x*t)),o=String(Math.round(e.y*t)),a=String(Math.round(Math.max(e.width,1)*t)),s=String(Math.round(Math.max(e.height,1)*t));return{"p:nvGraphicFramePr":{"p:cNvPr":{"@_id":"0","@_name":e.name||"Chart"},"p:cNvGraphicFramePr":{},"p:nvPr":{}},"p:xfrm":{"a:off":{"@_x":i,"@_y":o},"a:ext":{"@_cx":a,"@_cy":s}},"a:graphic":{"a:graphicData":r?{"@_uri":Hke,"cx:chart":{"@_xmlns:cx":Hke,"@_xmlns:r":Gke,"@_r:id":n}}:{"@_uri":u3n,"c:chart":{"@_xmlns:c":d3n,"@_xmlns:r":Gke,"@_r:id":n}}}}}function f3n(e,t){const n=String(Math.round(e.x*t)),r=String(Math.round(e.y*t)),i=String(Math.round(Math.max(e.width,1)*t)),o=String(Math.round(Math.max(e.height,1)*t)),a=e.inkPaths.map(p=>{const h=[],f=[],m=p.matchAll(/(?<cmd>[ML])\s*(?<x>[\d.eE+-]+)[,\s]+(?<y>[\d.eE+-]+)/giu);for(const y of m){const v=parseFloat(String(y.groups?.x)),b=parseFloat(String(y.groups?.y));if(!Number.isFinite(v)||!Number.isFinite(b))continue;const w={"@_x":String(Math.round(v*t)),"@_y":String(Math.round(b*t))};y.groups?.cmd?.toUpperCase()==="M"?h.push({"a:pt":w}):f.push({"a:pt":w})}const g={"@_w":i,"@_h":o,"@_stroke":"1","@_fill":"none"};return h.length>0&&(g["a:moveTo"]=h.length===1?h[0]:h),f.length>0&&(g["a:lnTo"]=f.length===1?f[0]:f),g}),s=e.inkColors?.[0]??"#000000",l=e.inkWidths?.[0]??2,c=e.inkOpacities?.[0]??1,u=s.replace("#","");return{"p:nvSpPr":{"p:cNvPr":{"@_id":"0","@_name":e.id},"p:cNvSpPr":{},"p:nvPr":{}},"p:spPr":{"a:xfrm":{"a:off":{"@_x":n,"@_y":r},"a:ext":{"@_cx":i,"@_cy":o}},"a:custGeom":{"a:avLst":{},"a:gdLst":{},"a:ahLst":{},"a:cxnLst":{},"a:rect":{"@_l":"0","@_t":"0","@_r":i,"@_b":o},"a:pathLst":{"a:path":a.length===1?a[0]:a}},"a:noFill":{},"a:ln":{"@_w":String(Math.round(l*t)),"@_cap":"rnd","a:solidFill":{"a:srgbClr":{"@_val":u,...c<1?{"a:alpha":{"@_val":String(Math.round(c*1e5))}}:{}}},"a:round":{}}}}}var $ne="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject",m3n="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",g3n="http://schemas.openxmlformats.org/presentationml/2006/ole";function x3n(e,t,n){e.locks={noChangeAspect:!0,...e.locks};const r=String(Math.round(e.x*t)),i=String(Math.round(e.y*t)),o=String(Math.round(Math.max(e.width,1)*t)),a=String(Math.round(Math.max(e.height,1)*t)),s={"@_showAsIcon":e.oleShowAsIcon?"1":"0","@_imgW":e.oleImgW!==void 0?String(e.oleImgW):o,"@_imgH":e.oleImgH!==void 0?String(e.oleImgH):a};return e.oleProgId&&(s["@_progId"]=e.oleProgId),e.oleName&&(s["@_name"]=e.oleName),e.oleClsId&&(s["@_classid"]=e.oleClsId),n&&(s["@_r:id"]=n),e.isLinked?s["p:link"]={"@_r:id":n,"@_updateAutomatic":hYe(e),...e.oleFollowColorScheme!==void 0?{"@_followColorScheme":e.oleFollowColorScheme}:{}}:s["p:embed"]={},s["p:pic"]={"p:nvPicPr":{"p:cNvPr":{"@_id":"0","@_name":e.oleName||"OleObject"},"p:cNvPicPr":{},"p:nvPr":{}},"p:blipFill":{"a:blip":{},"a:stretch":{"a:fillRect":{}}},"p:spPr":{"a:xfrm":{"a:off":{"@_x":r,"@_y":i},"a:ext":{"@_cx":o,"@_cy":a}},"a:prstGeom":{"@_prst":"rect","a:avLst":{}}}},{"p:nvGraphicFramePr":{"p:cNvPr":{"@_id":"0","@_name":e.oleName||e.fileName||"OleObject"},"p:cNvGraphicFramePr":{"a:graphicFrameLocks":{"@_noChangeAspect":"1"}},"p:nvPr":{}},"p:xfrm":{"a:off":{"@_x":r,"@_y":i},"a:ext":{"@_cx":o,"@_cy":a}},"a:graphic":{"a:graphicData":{"@_uri":g3n,"p:oleObj":s}}}}function y3n(e,t){const n=e["a:graphic"]?.["a:graphicData"];for(const r of yde(n))v3n(r,t)}function v3n(e,t){if(t.oleProgId&&(e["@_progId"]=t.oleProgId),t.oleName!==void 0&&(t.oleName.length>0?e["@_name"]=t.oleName:delete e["@_name"]),t.oleClsId&&(e["@_classid"]=t.oleClsId),t.oleShowAsIcon!==void 0&&(e["@_showAsIcon"]=t.oleShowAsIcon?"1":"0"),t.oleImgW!==void 0&&(e["@_imgW"]=String(t.oleImgW)),t.oleImgH!==void 0&&(e["@_imgH"]=String(t.oleImgH)),t.isLinked===!0){if(!e["p:link"]){const r=String(e["p:embed"]?.["@_r:id"]||e["@_r:id"]||"").trim(),i=hYe(t);e["p:link"]=r?{"@_r:id":r,"@_updateAutomatic":i}:{"@_updateAutomatic":i}}delete e["p:embed"]}else t.isLinked===!1&&(e["p:embed"]||(e["p:embed"]={}),delete e["p:link"]);const n=e["p:link"];n&&(t.oleFollowColorScheme!==void 0?n["@_followColorScheme"]=t.oleFollowColorScheme:delete n["@_followColorScheme"],t.oleUpdateAutomatic!==void 0&&(n["@_updateAutomatic"]=t.oleUpdateAutomatic?"1":"0"))}function b3n(e,t){if(!t)return;const r=t.replace(/^ppt\//u,"../").replace(/^\/+/u,"").toLowerCase();for(const a of e){if(String(a?.["@_Type"]||"")!==$ne)continue;const l=String(a?.["@_Target"]||"").toLowerCase().trim();if(l===r||l.endsWith(r)||r.endsWith(l)){const c=String(a?.["@_Id"]||"").trim();if(c.length>0)return c}}const i=e.find(a=>String(a?.["@_Type"]||"")===$ne),o=String(i?.["@_Id"]||"").trim();return o.length>0?o:void 0}var w3n="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",S3n="application/vnd.openxmlformats-officedocument.drawingml.chart+xml",C3n=class Jf extends Q4n{createTableGraphicFrameXml(t){return p3n(t,Jf.EMU_PER_PX)}createChartGraphicFrameXml(t,n,r=!1){return h3n(t,Jf.EMU_PER_PX,n,r)}createOleGraphicFrameXml(t,n){return x3n(t,Jf.EMU_PER_PX,n)}applyOleTypedFieldUpdates(t,n){y3n(t,n)}resolveOleEmbedRelationshipId(t,n){return b3n(t,n)}static OLE_OBJECT_RELATIONSHIP_TYPE=$ne;static OLE_IMAGE_RELATIONSHIP_TYPE=m3n;createInkShapeXml(t){return f3n(t,Jf.EMU_PER_PX)}buildGroupShapeXml(t,n,r){if(t.rawXml&&t.children.length===0)return{...t.rawXml,"p:nvGrpSpPr":zke(t.rawXml,t.name,t.id,t.shapeId)};const i=Jf.EMU_PER_PX,o=t.rawXml,a=pde(t,i),s=e3n(t,i,r,a),l=t,c={"p:nvGrpSpPr":zke(o,t.name,t.id,t.shapeId),"p:grpSpPr":r3n(o,s)},u=o?.["p:extLst"];u!==void 0&&(c["p:extLst"]=u);const d=n?{...n,inheritedGroupFill:s3n(t,n.inheritedGroupFill),preserveGroupChildSpace:l}:void 0,p=[];for(const h of t.children){const f=d?this.serializeGroupChildViaElementWriter(h,d):this.serializeGroupChildFromRawXml(h,l);f&&p.push(f)}return i3n(c,p),c}serializeGroupChildViaElementWriter(t,n){if(t.type==="group"){const i=n.preserveGroupChildSpace?zte(t,n.preserveGroupChildSpace,Jf.EMU_PER_PX):void 0,o=this.buildGroupShapeXml(t,n,i);return o?(this.serializeShapeLocks(o,t),{tag:"p:grpSp",xml:o}):null}const r=o3n();return this.processSlideElement(t,r,n),a3n(r)}serializeGroupChildFromRawXml(t,n){const r=n?zte(t,n,Jf.EMU_PER_PX):void 0,i=t.type==="group"?r:void 0,o=this.buildGroupChildXml(t,i);if(!o)return null;t3n(o,t,Jf.EMU_PER_PX,n,r);const a=Ett(t.type,o);return a?{tag:a,xml:o}:(this.compatibilityService.reportWarning({code:"SAVE_GROUP_CHILD_SKIPPED",message:`Group child '${t.id}' (${t.type}) has no valid CT_GroupShape slot and was skipped during save.`,scope:"save",elementId:t.id}),null)}buildGroupChildXml(t,n){if(t.type==="group")return this.buildGroupShapeXml(t,void 0,n)??void 0;const r=t.rawXml;if(r)return r;if(t.type==="text"||t.type==="shape")return this.createElementXml(t);if(t.type==="connector")return this.createConnectorXml(t);if(t.type==="ink")return this.createInkShapeXml(t);if(t.type==="table")return this.createTableGraphicFrameXml(t)}},T3n=class extends C3n{clampCropForSave(e){return Zf(e)}applyImageCropToBlipFill(e,t){if(GXe(t),!e||!(t.cropLeft!==void 0||t.cropTop!==void 0||t.cropRight!==void 0||t.cropBottom!==void 0))return;const r=Ukn(t);if(!r){delete e["a:srcRect"];return}e["a:srcRect"]=r}applyImageEffectsToBlip(e,t){if(!e)return;const n=e["a:blip"];if(!n)return;const r=t??{};if(typeof r.brightness=="number"&&Number.isFinite(r.brightness)?n["@_bright"]=String(Math.round(r.brightness*1e3)):(delete n["@_bright"],delete n["@_brt"]),typeof r.contrast=="number"&&Number.isFinite(r.contrast)?n["@_contrast"]=String(Math.round(r.contrast*1e3)):(delete n["@_contrast"],delete n["@_cont"]),jkn(n,r,i=>this.parseColor(i),i=>this.extractColorOpacity(i)),Okn(n,r,i=>this.parseColor(i)),r.lum){const i={};typeof r.lum.bright=="number"&&Number.isFinite(r.lum.bright)&&(i["@_bright"]=String(Math.round(r.lum.bright*1e3))),typeof r.lum.contrast=="number"&&Number.isFinite(r.lum.contrast)&&(i["@_contrast"]=String(Math.round(r.lum.contrast*1e3))),n["a:lum"]=i}else delete n["a:lum"];if(r.hsl){const i={};typeof r.hsl.hue=="number"&&Number.isFinite(r.hsl.hue)&&(i["@_hue"]=String(Math.round(r.hsl.hue*6e4))),typeof r.hsl.sat=="number"&&Number.isFinite(r.hsl.sat)&&(i["@_sat"]=String(Math.round(r.hsl.sat*1e3))),typeof r.hsl.lum=="number"&&Number.isFinite(r.hsl.lum)&&(i["@_lum"]=String(Math.round(r.hsl.lum*1e3))),n["a:hsl"]=i}else delete n["a:hsl"];if(r.tint){const i={};typeof r.tint.hue=="number"&&Number.isFinite(r.tint.hue)&&(i["@_hue"]=String(Math.round(r.tint.hue*6e4))),typeof r.tint.amt=="number"&&Number.isFinite(r.tint.amt)&&(i["@_amt"]=String(Math.round(r.tint.amt*1e3))),n["a:tint"]=i}else delete n["a:tint"];if(r.fillOverlay){const i={"@_blend":r.fillOverlay.blend};if(r.fillOverlay.fillRawXml)for(const o of Object.keys(r.fillOverlay.fillRawXml))i[o]=r.fillOverlay.fillRawXml[o];n["a:fillOverlay"]=i}else delete n["a:fillOverlay"];if(r.blur){const i={};typeof r.blur.rad=="number"&&Number.isFinite(r.blur.rad)&&(i["@_rad"]=String(Math.round(r.blur.rad))),typeof r.blur.grow=="boolean"&&(i["@_grow"]=r.blur.grow?"1":"0"),n["a:blur"]=i}else delete n["a:blur"];Nkn(n,r)}normalizePresetGeometry(e){return this.elementXmlBuilder.normalizePresetGeometry(e)}buildGradientFillXml(e){return this.colorStyleCodec.buildGradientFillXml(e)}clampUnitInterval(e){return this.colorStyleCodec.clampUnitInterval(e)}buildOuterShadowXml(e){return this.colorStyleCodec.buildOuterShadowXml(e)}buildPresetShadowXml(e){return this.colorStyleCodec.buildPresetShadowXml(e)}buildInnerShadowXml(e){return this.colorStyleCodec.buildInnerShadowXml(e)}buildGlowXml(e){return this.colorStyleCodec.buildGlowXml(e)}buildSoftEdgeXml(e){return this.colorStyleCodec.buildSoftEdgeXml(e)}buildReflectionXml(e){return this.colorStyleCodec.buildReflectionXml(e)}buildBlurXml(e){return this.colorStyleCodec.buildBlurXml(e)}buildFillOverlayXml(e){return this.colorStyleCodec.buildFillOverlayXml(e)}buildLineEffectListXml(e){return this.colorStyleCodec.buildLineEffectListXml(e)}textVerticalAlignToDrawingValue(e){if(e==="top")return"t";if(e==="middle")return"ctr";if(e==="bottom")return"b";if(e==="distributed")return"dist";if(e==="justified")return"just"}textDirectionToDrawingValue(e){if(e==="vertical")return"vert";if(e==="vertical270")return"vert270";if(e==="eaVert")return"eaVert";if(e==="wordArtVert")return"wordArtVert";if(e==="wordArtVertRtl")return"wordArtVertRtl";if(e==="mongolianVert")return"mongolianVert"}normalizeTextColumnCount(e){const t=typeof e=="number"&&Number.isFinite(e)?e:Number.parseInt(String(e??""),10);if(Number.isFinite(t))return Math.max(1,Math.min(16,Math.round(t)))}normalizeTextLineBreaks(e){return e.replace(/\r\n/g,`
@@ -11308,4 +11308,4 @@ void main() {
11308
11308
 
11309
11309
  }`,YPi=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Kbe(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Xd({vertexShader:qPi,fragmentShader:KPi,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new pa(new LW(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},ZPi=class extends nh{constructor(e,t){super();const n=this;let r=null,i=1,o=null,a="local-floor",s=1,l=null,c=null,u=null,d=null,p=null,h=null;const f=typeof XRWebGLBinding<"u",m=new YPi,g={},y=t.getContextAttributes();let v=null,b=null;const w=[],S=[],T=new kt;let A=null,E=null;const k=new ps;k.viewport=new Ui;const M=new ps;M.viewport=new Ui;const I=[k,M],D=new TIt;let R=null,_=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ae){let de=w[ae];return de===void 0&&(de=new GB,w[ae]=de),de.getTargetRaySpace()},this.getControllerGrip=function(ae){let de=w[ae];return de===void 0&&(de=new GB,w[ae]=de),de.getGripSpace()},this.getHand=function(ae){let de=w[ae];return de===void 0&&(de=new GB,w[ae]=de),de.getHandSpace()};function L(ae){const de=S.indexOf(ae.inputSource);if(de===-1)return;const ne=w[de];ne!==void 0&&(ne.update(ae.inputSource,ae.frame,l||o),ne.dispatchEvent({type:ae.type,data:ae.inputSource}))}function B(){r.removeEventListener("select",L),r.removeEventListener("selectstart",L),r.removeEventListener("selectend",L),r.removeEventListener("squeeze",L),r.removeEventListener("squeezestart",L),r.removeEventListener("squeezeend",L),r.removeEventListener("end",B),r.removeEventListener("inputsourceschange",O);for(let ae=0;ae<w.length;ae++){const de=S[ae];de!==null&&(S[ae]=null,w[ae].disconnect(de))}R=null,_=null,m.reset();for(const ae in g)delete g[ae];if(e.setRenderTarget(v),p=null,d=null,u=null,r=null,b=null,se.stop(),n.isPresenting=!1,e.setPixelRatio(A),e.setSize(T.width,T.height,!1),E!==null){const ae=E.camera;ae.fov=E.fov,ae.zoom=E.zoom,ae.updateProjectionMatrix(),E=null}n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ae){i=ae,n.isPresenting===!0&&en("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ae){a=ae,n.isPresenting===!0&&en("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(ae){l=ae},this.getBaseLayer=function(){return d!==null?d:p},this.getBinding=function(){return u===null&&f&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return h},this.getSession=function(){return r},this.setSession=async function(ae){if(r=ae,r!==null){if(v=e.getRenderTarget(),r.addEventListener("select",L),r.addEventListener("selectstart",L),r.addEventListener("selectend",L),r.addEventListener("squeeze",L),r.addEventListener("squeezestart",L),r.addEventListener("squeezeend",L),r.addEventListener("end",B),r.addEventListener("inputsourceschange",O),y.xrCompatible!==!0&&await t.makeXRCompatible(),A=e.getPixelRatio(),e.getSize(T),f&&"createProjectionLayer"in XRWebGLBinding.prototype){let ne=null,me=null,xe=null;y.depth&&(xe=y.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ne=y.stencil?tx:Sf,me=y.stencil?FA:Wd);const ge={colorFormat:t.RGBA8,depthFormat:xe,scaleFactor:i};u=this.getBinding(),d=u.createProjectionLayer(ge),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),b=new Mc(d.textureWidth,d.textureHeight,{format:Bl,type:wc,depthTexture:new jA(d.textureWidth,d.textureHeight,me,void 0,void 0,void 0,void 0,void 0,void 0,ne),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1,storeMultisampledDepthBuffer:d.ignoreDepthValues===!1,storeMultisampledStencilBuffer:d.ignoreDepthValues===!1})}else{const ne={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:i};p=new XRWebGLLayer(r,t,ne),r.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),b=new Mc(p.framebufferWidth,p.framebufferHeight,{format:Bl,type:wc,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1,storeMultisampledDepthBuffer:p.ignoreDepthValues===!1,storeMultisampledStencilBuffer:p.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(s),l=null,o=await r.requestReferenceSpace(a),se.setContext(r),se.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function O(ae){for(let de=0;de<ae.removed.length;de++){const ne=ae.removed[de],me=S.indexOf(ne);me>=0&&(S[me]=null,w[me].disconnect(ne))}for(let de=0;de<ae.added.length;de++){const ne=ae.added[de];let me=S.indexOf(ne);if(me===-1){for(let ge=0;ge<w.length;ge++)if(ge>=S.length){S.push(ne),me=ge;break}else if(S[ge]===null){S[ge]=ne,me=ge;break}if(me===-1)break}const xe=w[me];xe&&xe.connect(ne)}}const X=new _e,H=new _e;function U(ae,de,ne){X.setFromMatrixPosition(de.matrixWorld),H.setFromMatrixPosition(ne.matrixWorld);const me=X.distanceTo(H),xe=de.projectionMatrix.elements,ge=ne.projectionMatrix.elements,Re=xe[14]/(xe[10]-1),Oe=xe[14]/(xe[10]+1),V=(xe[9]+1)/xe[5],ie=(xe[9]-1)/xe[5],Q=(xe[8]-1)/xe[0],Y=(ge[8]+1)/ge[0],Z=Re*Q,q=Re*Y,N=me/(-Q+Y),$=N*-Q;if(de.matrixWorld.decompose(ae.position,ae.quaternion,ae.scale),ae.translateX($),ae.translateZ(N),ae.matrixWorld.compose(ae.position,ae.quaternion,ae.scale),ae.matrixWorldInverse.copy(ae.matrixWorld).invert(),xe[10]===-1)ae.projectionMatrix.copy(de.projectionMatrix),ae.projectionMatrixInverse.copy(de.projectionMatrixInverse);else{const F=Re+N,le=Oe+N,fe=Z-$,he=q+(me-$),ee=V*Oe/le*F,J=ie*Oe/le*F;ae.projectionMatrix.makePerspective(fe,he,ee,J,F,le),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert()}}function j(ae,de){de===null?ae.matrixWorld.copy(ae.matrix):ae.matrixWorld.multiplyMatrices(de.matrixWorld,ae.matrix),ae.matrixWorldInverse.copy(ae.matrixWorld).invert()}this.updateCamera=function(ae){if(r===null)return;let de=ae.near,ne=ae.far;m.texture!==null&&(m.depthNear>0&&(de=m.depthNear),m.depthFar>0&&(ne=m.depthFar)),D.near=M.near=k.near=de,D.far=M.far=k.far=ne,(R!==D.near||_!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),R=D.near,_=D.far),D.layers.mask=ae.layers.mask|6,k.layers.mask=D.layers.mask&-5,M.layers.mask=D.layers.mask&-3;const me=ae.parent,xe=D.cameras;j(D,me);for(let ge=0;ge<xe.length;ge++)j(xe[ge],me);xe.length===2?U(D,k,M):D.projectionMatrix.copy(k.projectionMatrix),E===null&&ae.isPerspectiveCamera&&(E={camera:ae,fov:ae.fov,zoom:ae.zoom}),z(ae,D,me)};function z(ae,de,ne){ne===null?ae.matrix.copy(de.matrixWorld):(ae.matrix.copy(ne.matrixWorld),ae.matrix.invert(),ae.matrix.multiply(de.matrixWorld)),ae.matrix.decompose(ae.position,ae.quaternion,ae.scale),ae.updateMatrixWorld(!0),ae.projectionMatrix.copy(de.projectionMatrix),ae.projectionMatrixInverse.copy(de.projectionMatrixInverse),ae.isPerspectiveCamera&&(ae.fov=OA*2*Math.atan(1/ae.projectionMatrix.elements[5]),ae.zoom=1)}this.getCamera=function(){return D},this.getFoveation=function(){if(!(d===null&&p===null))return s},this.setFoveation=function(ae){s=ae,d!==null&&(d.fixedFoveation=ae),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=ae)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(D)},this.getCameraTexture=function(ae){return g[ae]};let W=null;function te(ae,de){if(c=de.getViewerPose(l||o),h=de,c!==null){const ne=c.views;p!==null&&(e.setRenderTargetFramebuffer(b,p.framebuffer),e.setRenderTarget(b));let me=!1;ne.length!==D.cameras.length&&(D.cameras.length=0,me=!0);for(let Oe=0;Oe<ne.length;Oe++){const V=ne[Oe];let ie=null;if(p!==null)ie=p.getViewport(V);else{const Y=u.getViewSubImage(d,V);ie=Y.viewport,Oe===0&&(e.setRenderTargetTextures(b,Y.colorTexture,Y.depthStencilTexture),e.setRenderTarget(b))}let Q=I[Oe];Q===void 0&&(Q=new ps,Q.layers.enable(Oe),Q.viewport=new Ui,I[Oe]=Q),Q.matrix.fromArray(V.transform.matrix),Q.matrix.decompose(Q.position,Q.quaternion,Q.scale),Q.projectionMatrix.fromArray(V.projectionMatrix),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert(),Q.viewport.set(ie.x,ie.y,ie.width,ie.height),Oe===0&&(D.matrix.copy(Q.matrix),D.matrix.decompose(D.position,D.quaternion,D.scale)),me===!0&&D.cameras.push(Q)}const xe=r.enabledFeatures;if(xe&&xe.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&f){u=n.getBinding();const Oe=u.getDepthInformation(ne[0]);Oe&&Oe.isValid&&Oe.texture&&m.init(Oe,r.renderState)}if(xe&&xe.includes("camera-access")&&f){e.state.unbindTexture(),u=n.getBinding();for(let Oe=0;Oe<ne.length;Oe++){const V=ne[Oe].camera;if(V){let ie=g[V];ie||(ie=new Kbe,g[V]=ie);const Q=u.getCameraImage(V);ie.sourceTexture=Q}}}}for(let ne=0;ne<w.length;ne++){const me=S[ne],xe=w[ne];me!==null&&xe!==void 0&&xe.update(me,de,l||o)}W&&W(ae,de),de.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:de}),h=null}const se=new RIt;se.setAnimationLoop(te),this.setAnimationLoop=function(ae){W=ae},this.dispose=function(){}}},JPi=new wr,UIt=new kr;UIt.set(-1,0,0,0,1,0,0,0,1);function QPi(e,t){function n(g,y){g.matrixAutoUpdate===!0&&g.updateMatrix(),y.value.copy(g.matrix)}function r(g,y){y.color.getRGB(g.fogColor.value,KPt(e)),y.isFog?(g.fogNear.value=y.near,g.fogFar.value=y.far):y.isFogExp2&&(g.fogDensity.value=y.density)}function i(g,y,v,b,w){y.isNodeMaterial?y.uniformsNeedUpdate=!1:y.isMeshBasicMaterial?o(g,y):y.isMeshLambertMaterial?(o(g,y),y.envMap&&(g.envMapIntensity.value=y.envMapIntensity)):y.isMeshToonMaterial?(o(g,y),d(g,y)):y.isMeshPhongMaterial?(o(g,y),u(g,y),y.envMap&&(g.envMapIntensity.value=y.envMapIntensity)):y.isMeshStandardMaterial?(o(g,y),p(g,y),y.isMeshPhysicalMaterial&&h(g,y,w)):y.isMeshMatcapMaterial?(o(g,y),f(g,y)):y.isMeshDepthMaterial?o(g,y):y.isMeshDistanceMaterial?(o(g,y),m(g,y)):y.isMeshNormalMaterial?o(g,y):y.isLineBasicMaterial?(a(g,y),y.isLineDashedMaterial&&s(g,y)):y.isPointsMaterial?l(g,y,v,b):y.isSpriteMaterial?c(g,y):y.isShadowMaterial?(g.color.value.copy(y.color),g.opacity.value=y.opacity):y.isShaderMaterial&&(y.uniformsNeedUpdate=!1)}function o(g,y){g.opacity.value=y.opacity,y.color&&g.diffuse.value.copy(y.color),y.emissive&&g.emissive.value.copy(y.emissive).multiplyScalar(y.emissiveIntensity),y.map&&(g.map.value=y.map,n(y.map,g.mapTransform)),y.alphaMap&&(g.alphaMap.value=y.alphaMap,n(y.alphaMap,g.alphaMapTransform)),y.bumpMap&&(g.bumpMap.value=y.bumpMap,n(y.bumpMap,g.bumpMapTransform),g.bumpScale.value=y.bumpScale,y.side===zl&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,n(y.normalMap,g.normalMapTransform),g.normalScale.value.copy(y.normalScale),y.side===zl&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,n(y.displacementMap,g.displacementMapTransform),g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),y.emissiveMap&&(g.emissiveMap.value=y.emissiveMap,n(y.emissiveMap,g.emissiveMapTransform)),y.specularMap&&(g.specularMap.value=y.specularMap,n(y.specularMap,g.specularMapTransform)),y.alphaTest>0&&(g.alphaTest.value=y.alphaTest);const v=t.get(y),b=v.envMap,w=v.envMapRotation;b&&(g.envMap.value=b,g.envMapRotation.value.setFromMatrix4(JPi.makeRotationFromEuler(w)).transpose(),b.isCubeTexture&&b.isRenderTargetTexture===!1&&g.envMapRotation.value.premultiply(UIt),g.reflectivity.value=y.reflectivity,g.ior.value=y.ior,g.refractionRatio.value=y.refractionRatio),y.lightMap&&(g.lightMap.value=y.lightMap,g.lightMapIntensity.value=y.lightMapIntensity,n(y.lightMap,g.lightMapTransform)),y.aoMap&&(g.aoMap.value=y.aoMap,g.aoMapIntensity.value=y.aoMapIntensity,n(y.aoMap,g.aoMapTransform))}function a(g,y){g.diffuse.value.copy(y.color),g.opacity.value=y.opacity,y.map&&(g.map.value=y.map,n(y.map,g.mapTransform))}function s(g,y){g.dashSize.value=y.dashSize,g.totalSize.value=y.dashSize+y.gapSize,g.scale.value=y.scale}function l(g,y,v,b){g.diffuse.value.copy(y.color),g.opacity.value=y.opacity,g.size.value=y.size*v,g.scale.value=b*.5,y.map&&(g.map.value=y.map,n(y.map,g.uvTransform)),y.alphaMap&&(g.alphaMap.value=y.alphaMap,n(y.alphaMap,g.alphaMapTransform)),y.alphaTest>0&&(g.alphaTest.value=y.alphaTest)}function c(g,y){g.diffuse.value.copy(y.color),g.opacity.value=y.opacity,g.rotation.value=y.rotation,y.map&&(g.map.value=y.map,n(y.map,g.mapTransform)),y.alphaMap&&(g.alphaMap.value=y.alphaMap,n(y.alphaMap,g.alphaMapTransform)),y.alphaTest>0&&(g.alphaTest.value=y.alphaTest)}function u(g,y){g.specular.value.copy(y.specular),g.shininess.value=Math.max(y.shininess,1e-4)}function d(g,y){y.gradientMap&&(g.gradientMap.value=y.gradientMap)}function p(g,y){g.metalness.value=y.metalness,y.metalnessMap&&(g.metalnessMap.value=y.metalnessMap,n(y.metalnessMap,g.metalnessMapTransform)),g.roughness.value=y.roughness,y.roughnessMap&&(g.roughnessMap.value=y.roughnessMap,n(y.roughnessMap,g.roughnessMapTransform)),y.envMap&&(g.envMapIntensity.value=y.envMapIntensity)}function h(g,y,v){g.ior.value=y.ior,y.sheen>0&&(g.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),g.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(g.sheenColorMap.value=y.sheenColorMap,n(y.sheenColorMap,g.sheenColorMapTransform)),y.sheenRoughnessMap&&(g.sheenRoughnessMap.value=y.sheenRoughnessMap,n(y.sheenRoughnessMap,g.sheenRoughnessMapTransform))),y.clearcoat>0&&(g.clearcoat.value=y.clearcoat,g.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(g.clearcoatMap.value=y.clearcoatMap,n(y.clearcoatMap,g.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,n(y.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(g.clearcoatNormalMap.value=y.clearcoatNormalMap,n(y.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===zl&&g.clearcoatNormalScale.value.negate())),y.dispersion>0&&(g.dispersion.value=y.dispersion),y.retroreflectivity>0&&(g.retroreflectivity.value=y.retroreflectivity),y.iridescence>0&&(g.iridescence.value=y.iridescence,g.iridescenceIOR.value=y.iridescenceIOR,g.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(g.iridescenceMap.value=y.iridescenceMap,n(y.iridescenceMap,g.iridescenceMapTransform)),y.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=y.iridescenceThicknessMap,n(y.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),y.transmission>0&&(g.transmission.value=y.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),y.transmissionMap&&(g.transmissionMap.value=y.transmissionMap,n(y.transmissionMap,g.transmissionMapTransform)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap,n(y.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=y.attenuationDistance,g.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(g.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(g.anisotropyMap.value=y.anisotropyMap,n(y.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=y.specularIntensity,g.specularColor.value.copy(y.specularColor),y.specularColorMap&&(g.specularColorMap.value=y.specularColorMap,n(y.specularColorMap,g.specularColorMapTransform)),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap,n(y.specularIntensityMap,g.specularIntensityMapTransform))}function f(g,y){y.matcap&&(g.matcap.value=y.matcap)}function m(g,y){const v=t.get(y).light;g.referencePosition.value.setFromMatrixPosition(v.matrixWorld),g.nearDistance.value=v.shadow.camera.near,g.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function eIi(e,t,n,r){let i={},o={},a=[];const s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(w,S){const T=S.program;r.uniformBlockBinding(w,T)}function c(w,S){let T=i[w.id];T===void 0&&(g(w),T=u(w),i[w.id]=T,w.addEventListener("dispose",v));const A=S.program;r.updateUBOMapping(w,A);const E=t.render.frame;o[w.id]!==E&&(p(w),o[w.id]=E)}function u(w){const S=d();w.__bindingPointIndex=S;const T=e.createBuffer(),A=w.__size,E=w.usage;return e.bindBuffer(e.UNIFORM_BUFFER,T),e.bufferData(e.UNIFORM_BUFFER,A,E),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,S,T),T}function d(){for(let w=0;w<s;w++)if(a.indexOf(w)===-1)return a.push(w),w;return Fn("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(w){const S=i[w.id],T=w.uniforms,A=w.__cache;e.bindBuffer(e.UNIFORM_BUFFER,S);for(let E=0,k=T.length;E<k;E++){const M=T[E];if(Array.isArray(M))for(let I=0,D=M.length;I<D;I++)h(M[I],E,I,A);else h(M,E,0,A)}e.bindBuffer(e.UNIFORM_BUFFER,null)}function h(w,S,T,A){if(m(w,S,T,A)===!0){const E=w.__offset,k=w.value;if(Array.isArray(k)){let M=0;for(let I=0;I<k.length;I++){const D=k[I],R=y(D);f(D,w.__data,M),typeof D!="number"&&typeof D!="boolean"&&!D.isMatrix3&&!ArrayBuffer.isView(D)&&(M+=R.storage/Float32Array.BYTES_PER_ELEMENT)}}else f(k,w.__data,0);e.bufferSubData(e.UNIFORM_BUFFER,E,w.__data)}}function f(w,S,T){typeof w=="number"||typeof w=="boolean"?S[0]=w:w.isMatrix3?(S[0]=w.elements[0],S[1]=w.elements[1],S[2]=w.elements[2],S[3]=0,S[4]=w.elements[3],S[5]=w.elements[4],S[6]=w.elements[5],S[7]=0,S[8]=w.elements[6],S[9]=w.elements[7],S[10]=w.elements[8],S[11]=0):ArrayBuffer.isView(w)?S.set(new w.constructor(w.buffer,w.byteOffset,S.length)):w.toArray(S,T)}function m(w,S,T,A){const E=w.value,k=S+"_"+T;if(A[k]===void 0)return typeof E=="number"||typeof E=="boolean"?A[k]=E:ArrayBuffer.isView(E)?A[k]=E.slice():A[k]=E.clone(),!0;{const M=A[k];if(typeof E=="number"||typeof E=="boolean"){if(M!==E)return A[k]=E,!0}else{if(ArrayBuffer.isView(E))return!0;if(M.equals(E)===!1)return M.copy(E),!0}}return!1}function g(w){const S=w.uniforms;let T=0;const A=16;for(let k=0,M=S.length;k<M;k++){const I=Array.isArray(S[k])?S[k]:[S[k]];for(let D=0,R=I.length;D<R;D++){const _=I[D],L=Array.isArray(_.value)?_.value:[_.value];for(let B=0,O=L.length;B<O;B++){const X=L[B],H=y(X),U=T%A,j=U%H.boundary,z=U+j;T+=j,z!==0&&A-z<H.storage&&(T+=A-z),_.__data=new Float32Array(H.storage/Float32Array.BYTES_PER_ELEMENT),_.__offset=T,T+=H.storage}}}const E=T%A;return E>0&&(T+=A-E),w.__size=T,w.__cache={},this}function y(w){const S={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(S.boundary=4,S.storage=4):w.isVector2?(S.boundary=8,S.storage=8):w.isVector3||w.isColor?(S.boundary=16,S.storage=12):w.isVector4?(S.boundary=16,S.storage=16):w.isMatrix3?(S.boundary=48,S.storage=48):w.isMatrix4?(S.boundary=64,S.storage=64):w.isTexture?en("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(w)?(S.boundary=16,S.storage=w.byteLength):en("WebGLRenderer: Unsupported uniform value type.",w),S}function v(w){const S=w.target;S.removeEventListener("dispose",v);const T=a.indexOf(S.__bindingPointIndex);a.splice(T,1),e.deleteBuffer(i[S.id]),delete i[S.id],delete o[S.id]}function b(){for(const w in i)e.deleteBuffer(i[w]);a=[],i={},o={}}return{bind:l,update:c,dispose:b}}var tIi=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),wh=null;function nIi(){return wh===null&&(wh=new Id(tIi,16,16,ry,Zp),wh.name="DFG_LUT",wh.minFilter=Qi,wh.magFilter=Qi,wh.wrapS=Ec,wh.wrapT=Ec,wh.generateMipmaps=!1,wh.needsUpdate=!0),wh}var rIi=class{constructor(e={}){const{canvas:t=PMt(),context:n=null,depth:r=!0,stencil:i=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:p=wc}=e;this.isWebGLRenderer=!0;let h;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=n.getContextAttributes().alpha}else h=o;const f=p,m=new Set([CW,SW,kR]),g=new Set([wc,Wd,NA,FA,vW,bW]),y=new Uint32Array(4),v=new Int32Array(4),b=new _e;let w=null,S=null;const T=[],A=[];let E=null;this.domElement=t,this.debug={checkShaderErrors:!0,diagnostics:{keywords:!1},onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Op,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const k=this;let M=!1,I=null,D=null,R=null,_=null;this._outputColorSpace=gc;let L=0,B=0,O=null,X=-1,H=null;const U=new Ui,j=new Ui;let z=null;const W=new bn(0);let te=0,se=t.width,ae=t.height,de=1,ne=null,me=null;const xe=new Ui(0,0,se,ae),ge=new Ui(0,0,se,ae);let Re=!1;const Oe=new dw;let V=!1,ie=!1;const Q=new wr,Y=new _e,Z=new Ui,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let N=!1;function $(){return O===null?de:1}let F=n;function le(pe,je){return t.getContext(pe,je)}let fe,he,ee,J,ue,Ce,Ne,$e,Je,Be,De,Ue,lt,ct,ut,It,Mt,Zt,Le,mt,qe,bt,Nt;try{const pe={alpha:!0,depth:r,stencil:i,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${gW}`),t.addEventListener("webglcontextlost",Wt,!1),t.addEventListener("webglcontextrestored",Sn,!1),t.addEventListener("webglcontextcreationerror",qt,!1),F===null){const je="webgl2";if(F=le(je,pe),F===null)throw le(je)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}rt()}catch(pe){throw t.removeEventListener("webglcontextlost",Wt,!1),t.removeEventListener("webglcontextrestored",Sn,!1),t.removeEventListener("webglcontextcreationerror",qt,!1),Fn("WebGLRenderer: "+pe.message),pe}function rt(){fe=new rMi(F),fe.init(),qe=new jIt(F,fe),he=new X5i(F,fe,e,qe),ee=new WPi(F,fe),he.reversedDepthBuffer&&d&&ee.buffers.depth.setReversed(!0),D=F.createFramebuffer(),R=F.createFramebuffer(),_=F.createFramebuffer(),J=new aMi(F),ue=new DPi,Ce=new XPi(F,fe,ee,ue,he,qe,J),Ne=new nMi(k),$e=new l4i(F),bt=new V5i(F,$e),Je=new iMi(F,$e,J,bt),Be=new lMi(F,Je,$e,bt,J),Zt=new sMi(F,he,Ce),ut=new q5i(ue),De=new _Pi(k,Ne,fe,he,bt,ut),Ue=new QPi(k,ue),lt=new LPi,ct=new UPi(fe),Mt=new G5i(k,Ne,ee,Be,h,s),It=new VPi(k,Be,he),Nt=new eIi(F,J,he,ee),Le=new W5i(F,fe,J),mt=new oMi(F,fe,J),J.programs=De.programs,k.capabilities=he,k.extensions=fe,k.properties=ue,k.renderLists=lt,k.shadowMap=It,k.state=ee,k.info=J}f!==wc&&(E=new uMi(f,t.width,t.height,a,r,i));const Pt=new ZPi(k,F);this.xr=Pt,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){const pe=fe.get("WEBGL_lose_context");pe&&pe.loseContext()},this.forceContextRestore=function(){const pe=fe.get("WEBGL_lose_context");pe&&pe.restoreContext()},this.getPixelRatio=function(){return de},this.setPixelRatio=function(pe){pe!==void 0&&(de=pe,this.setSize(se,ae,!1))},this.getSize=function(pe){return pe.set(se,ae)},this.setSize=function(pe,je,Qe=!0){if(Pt.isPresenting){en("WebGLRenderer: Can't change size while VR device is presenting.");return}se=pe,ae=je,t.width=Math.floor(pe*de),t.height=Math.floor(je*de),Qe===!0&&(t.style.width=pe+"px",t.style.height=je+"px"),E!==null&&E.setSize(t.width,t.height),this.setViewport(0,0,pe,je)},this.getDrawingBufferSize=function(pe){return pe.set(se*de,ae*de).floor()},this.setDrawingBufferSize=function(pe,je,Qe){se=pe,ae=je,de=Qe,t.width=Math.floor(pe*Qe),t.height=Math.floor(je*Qe),this.setViewport(0,0,pe,je)},this.setEffects=function(pe){if(f===wc){Fn("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(pe){for(let je=0;je<pe.length;je++)if(pe[je].isOutputPass===!0){en("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}E.setEffects(pe||[])},this.getCurrentViewport=function(pe){return pe.copy(U)},this.getViewport=function(pe){return pe.copy(xe)},this.setViewport=function(pe,je,Qe,He){pe.isVector4?xe.set(pe.x,pe.y,pe.z,pe.w):xe.set(pe,je,Qe,He),ee.viewport(U.copy(xe).multiplyScalar(de).round())},this.getScissor=function(pe){return pe.copy(ge)},this.setScissor=function(pe,je,Qe,He){pe.isVector4?ge.set(pe.x,pe.y,pe.z,pe.w):ge.set(pe,je,Qe,He),ee.scissor(j.copy(ge).multiplyScalar(de).round())},this.getScissorTest=function(){return Re},this.setScissorTest=function(pe){ee.setScissorTest(Re=pe)},this.setOpaqueSort=function(pe){ne=pe},this.setTransparentSort=function(pe){me=pe},this.getClearColor=function(pe){return pe.copy(Mt.getClearColor())},this.setClearColor=function(){Mt.setClearColor(...arguments)},this.getClearAlpha=function(){return Mt.getClearAlpha()},this.setClearAlpha=function(){Mt.setClearAlpha(...arguments)},this.clear=function(pe=!0,je=!0,Qe=!0){let He=0;if(pe){let Xe=!1;if(O!==null){const Lt=O.texture.format;Xe=m.has(Lt)}if(Xe){const Lt=O.texture.type,St=g.has(Lt),jt=Mt.getClearColor(),cn=Mt.getClearAlpha(),Kt=jt.r,Qn=jt.g,dr=jt.b;St?(y[0]=Kt,y[1]=Qn,y[2]=dr,y[3]=cn,F.clearBufferuiv(F.COLOR,0,y)):(v[0]=Kt,v[1]=Qn,v[2]=dr,v[3]=cn,F.clearBufferiv(F.COLOR,0,v))}else He|=F.COLOR_BUFFER_BIT}je&&(He|=F.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),Qe&&(He|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),He!==0&&F.clear(He)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(pe){pe.setRenderer(this),I=pe},this.dispose=function(){t.removeEventListener("webglcontextlost",Wt,!1),t.removeEventListener("webglcontextrestored",Sn,!1),t.removeEventListener("webglcontextcreationerror",qt,!1),Mt.dispose(),lt.dispose(),ct.dispose(),ue.dispose(),Ne.dispose(),Be.dispose(),bt.dispose(),Nt.dispose(),De.dispose(),Pt.dispose(),Pt.removeEventListener("sessionstart",ce),Pt.removeEventListener("sessionend",oe),Fe.stop()};function Wt(pe){pe.preventDefault(),_I("WebGLRenderer: Context Lost."),M=!0}function Sn(){_I("WebGLRenderer: Context Restored."),M=!1;const pe=J.autoReset,je=It.enabled,Qe=It.autoUpdate,He=It.needsUpdate,Xe=It.type;rt(),J.autoReset=pe,It.enabled=je,It.autoUpdate=Qe,It.needsUpdate=He,It.type=Xe}function qt(pe){Fn("WebGLRenderer: A WebGL context could not be created. Reason: ",pe.statusMessage)}function ur(pe){const je=pe.target;je.removeEventListener("dispose",ur),Kr(je)}function Kr(pe){Ri(pe),ue.remove(pe)}function Ri(pe){const je=ue.get(pe).programs;je!==void 0&&(je.forEach(function(Qe){De.releaseProgram(Qe)}),pe.isShaderMaterial&&De.releaseShaderCache(pe))}this.renderBufferDirect=function(pe,je,Qe,He,Xe,Lt){je===null&&(je=q);const St=Xe.isMesh&&Xe.matrixWorld.determinantAffine()<0,jt=vi(pe,je,Qe,He,Xe);ee.setMaterial(He,St);let cn=Qe.index,Kt=1;if(He.wireframe===!0){if(cn=Je.getWireframeAttribute(Qe),cn===void 0)return;Kt=2}const Qn=Qe.drawRange,dr=Qe.attributes.position;let tn=Qn.start*Kt,yr=(Qn.start+Qn.count)*Kt;Lt!==null&&(tn=Math.max(tn,Lt.start*Kt),yr=Math.min(yr,(Lt.start+Lt.count)*Kt)),cn!==null?(tn=Math.max(tn,0),yr=Math.min(yr,cn.count)):dr!=null&&(tn=Math.max(tn,0),yr=Math.min(yr,dr.count));const no=yr-tn;if(no<0||no===1/0)return;bt.setup(Xe,He,jt,Qe,cn);let ui,di=Le;if(cn!==null&&(ui=$e.get(cn),di=mt,di.setIndex(ui)),Xe.isMesh)He.wireframe===!0?(ee.setLineWidth(He.wireframeLinewidth*$()),di.setMode(F.LINES)):di.setMode(F.TRIANGLES);else if(Xe.isLine){let Oo=He.linewidth;Oo===void 0&&(Oo=1),ee.setLineWidth(Oo*$()),Xe.isLineSegments?di.setMode(F.LINES):Xe.isLineLoop?di.setMode(F.LINE_LOOP):di.setMode(F.LINE_STRIP)}else Xe.isPoints?di.setMode(F.POINTS):Xe.isSprite&&di.setMode(F.TRIANGLES);if(Xe.isBatchedMesh)if(fe.get("WEBGL_multi_draw"))di.renderMultiDraw(Xe._multiDrawStarts,Xe._multiDrawCounts,Xe._multiDrawCount);else{const Oo=Xe._multiDrawStarts,pn=Xe._multiDrawCounts,ea=Xe._multiDrawCount,Wn=cn?$e.get(cn).bytesPerElement:1,ta=ue.get(He).currentProgram.getUniforms();for(let Ns=0;Ns<ea;Ns++)ta.setValue(F,"_gl_DrawID",Ns),di.render(Oo[Ns]/Wn,pn[Ns])}else if(Xe.isInstancedMesh)di.renderInstances(tn,no,Xe.count);else if(Qe.isInstancedBufferGeometry){const Oo=Qe._maxInstanceCount!==void 0?Qe._maxInstanceCount:1/0,pn=Math.min(Qe.instanceCount,Oo);di.renderInstances(tn,no,pn)}else di.render(tn,no)};function xa(pe,je,Qe,He){I!==null&&pe.isNodeMaterial&&I.setObject(He,pe),V===!0&&ut.setState(pe,Qe,!1),pe.transparent===!0&&pe.side===Nh&&pe.forceSinglePass===!1?(pe.side=zl,pe.needsUpdate=!0,yt(pe,je,He),pe.side=ty,pe.needsUpdate=!0,yt(pe,je,He),pe.side=Nh):yt(pe,je,He)}this.compile=function(pe,je,Qe=null){Qe===null&&(Qe=pe),I!==null&&I.renderStart(pe,je,Qe),S=ct.get(Qe),S.init(je),A.push(S),Qe.traverseVisible(function(Xe){Xe.isLight&&Xe.layers.test(je.layers)&&(S.pushLight(Xe),Xe.castShadow&&S.pushShadow(Xe))}),pe!==Qe&&pe.traverseVisible(function(Xe){Xe.isLight&&Xe.layers.test(je.layers)&&(S.pushLight(Xe),Xe.castShadow&&S.pushShadow(Xe))}),S.setupLights(),I!==null&&I.updateLights(S.state.lightsArray),ie=this.localClippingEnabled,V=ut.init(this.clippingPlanes,ie),V===!0&&ut.setGlobalState(this.clippingPlanes,je),I!==null&&It.render(S.state.shadowsArray,Qe,je);const He=new Set;return pe.traverse(function(Xe){if(!(Xe.isMesh||Xe.isPoints||Xe.isLine||Xe.isSprite))return;const Lt=Xe.material;if(Lt)if(Array.isArray(Lt))for(let St=0;St<Lt.length;St++){const jt=Lt[St];xa(jt,Qe,je,Xe),He.add(jt)}else xa(Lt,Qe,je,Xe),He.add(Lt)}),S=A.pop(),I!==null&&I.renderEnd(),He},this.compileAsync=function(pe,je,Qe=null){const He=this.compile(pe,je,Qe);return new Promise(Xe=>{function Lt(){if(He.forEach(function(St){const cn=ue.get(St).currentProgram;(cn===void 0||cn.isReady())&&He.delete(St)}),He.size===0){Xe(pe);return}setTimeout(Lt,10)}fe.get("KHR_parallel_shader_compile")!==null?Lt():setTimeout(Lt,10)})};let po=null;function re(pe){po&&po(pe)}function ce(){Fe.stop()}function oe(){Fe.start()}const Fe=new RIt;Fe.setAnimationLoop(re),typeof self<"u"&&Fe.setContext(self),this.setAnimationLoop=function(pe){po=pe,Pt.setAnimationLoop(pe),pe===null?Fe.stop():Fe.start()},Pt.addEventListener("sessionstart",ce),Pt.addEventListener("sessionend",oe),this.render=function(pe,je){if(je!==void 0&&je.isCamera!==!0){Fn("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;I!==null&&I.renderStart(pe,je);const Qe=Pt.enabled===!0&&Pt.isPresenting===!0,He=E!==null&&(O===null||Qe)&&E.begin(k,O);if(pe.matrixWorldAutoUpdate===!0&&pe.updateMatrixWorld(),je.parent===null&&je.matrixWorldAutoUpdate===!0&&je.updateMatrixWorld(),Pt.enabled===!0&&Pt.isPresenting===!0&&(E===null||E.isCompositing()===!1)&&(Pt.cameraAutoUpdate===!0&&Pt.updateCamera(je),je=Pt.getCamera()),pe.isScene===!0&&pe.onBeforeRender(k,pe,je,O),S=ct.get(pe,A.length),S.init(je),S.state.textureUnits=Ce.getTextureUnits(),A.push(S),Q.multiplyMatrices(je.projectionMatrix,je.matrixWorldInverse),Oe.setFromProjectionMatrix(Q,hu,je.reversedDepth),ie=this.localClippingEnabled,V=ut.init(this.clippingPlanes,ie),w=lt.get(pe,T.length),w.init(),T.push(w),Pt.enabled===!0&&Pt.isPresenting===!0){const St=k.xr.getDepthSensingMesh();St!==null&&Ge(St,je,-1/0,k.sortObjects)}Ge(pe,je,0,k.sortObjects),w.finish(),I!==null&&I.updateLights(S.state.lightsArray),k.sortObjects===!0&&w.sort(ne,me),N=Pt.enabled===!1||Pt.isPresenting===!1||Pt.hasDepthSensing()===!1,N&&Mt.addToRenderList(w,pe),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),V===!0&&ut.beginShadows();const Xe=S.state.shadowsArray;if(It.render(Xe,pe,je),V===!0&&ut.endShadows(),(He&&E.hasRenderPass())===!1){const St=w.opaque,jt=w.transmissive;if(S.setupLights(),je.isArrayCamera){const cn=je.cameras;if(jt.length>0)for(let Kt=0,Qn=cn.length;Kt<Qn;Kt++){const dr=cn[Kt];Bt(St,jt,pe,dr)}N&&Mt.render(pe);for(let Kt=0,Qn=cn.length;Kt<Qn;Kt++){const dr=cn[Kt];dt(w,pe,dr,dr.viewport)}}else jt.length>0&&Bt(St,jt,pe,je),N&&Mt.render(pe),dt(w,pe,je)}O!==null&&B===0&&(Ce.updateMultisampleRenderTarget(O),Ce.updateRenderTargetMipmap(O)),He&&E.end(k),pe.isScene===!0&&pe.onAfterRender(k,pe,je),bt.resetDefaultState(),X=-1,H=null,A.pop(),A.length>0?(S=A[A.length-1],Ce.setTextureUnits(S.state.textureUnits),V===!0&&ut.setGlobalState(k.clippingPlanes,S.state.camera)):S=null,T.pop(),T.length>0?w=T[T.length-1]:w=null,I!==null&&I.renderEnd()};function Ge(pe,je,Qe,He){if(pe.visible===!1)return;if(pe.layers.test(je.layers)){if(pe.isGroup)Qe=pe.renderOrder;else if(pe.isLOD)pe.autoUpdate===!0&&pe.update(je);else if(pe.isLightProbeGrid)S.pushLightProbeGrid(pe);else if(pe.isLight)S.pushLight(pe),pe.castShadow&&S.pushShadow(pe);else if(pe.isSprite){if(!pe.frustumCulled||pe.intersectsFrustum(Oe)){He&&Z.setFromMatrixPosition(pe.matrixWorld).applyMatrix4(Q);const St=Be.update(pe),jt=pe.material;jt.visible&&w.push(pe,St,jt,Qe,Z.z,null,je)}}else if((pe.isMesh||pe.isLine||pe.isPoints)&&(!pe.frustumCulled||pe.intersectsFrustum(Oe))){const St=Be.update(pe),jt=pe.material;if(He&&(pe.boundingSphere!==void 0?(pe.boundingSphere===null&&pe.computeBoundingSphere(),Z.copy(pe.boundingSphere.center)):(St.boundingSphere===null&&St.computeBoundingSphere(),Z.copy(St.boundingSphere.center)),Z.applyMatrix4(pe.matrixWorld).applyMatrix4(Q)),Array.isArray(jt)){const cn=St.groups;for(let Kt=0,Qn=cn.length;Kt<Qn;Kt++){const dr=cn[Kt],tn=jt[dr.materialIndex];tn&&tn.visible&&w.push(pe,St,tn,Qe,Z.z,dr,je)}}else jt.visible&&w.push(pe,St,jt,Qe,Z.z,null,je)}}const Lt=pe.children;for(let St=0,jt=Lt.length;St<jt;St++)Ge(Lt[St],je,Qe,He)}function dt(pe,je,Qe,He){const{opaque:Xe,transmissive:Lt,transparent:St}=pe;S.setupLightsView(Qe),V===!0&&ut.setGlobalState(k.clippingPlanes,Qe),He&&ee.viewport(U.copy(He)),Xe.length>0&&nr(Xe,je,Qe),Lt.length>0&&nr(Lt,je,Qe),St.length>0&&nr(St,je,Qe),ee.buffers.depth.setTest(!0),ee.buffers.depth.setMask(!0),ee.buffers.color.setMask(!0),ee.setPolygonOffset(!1)}function Bt(pe,je,Qe,He){if((Qe.isScene===!0?Qe.overrideMaterial:null)!==null)return;if(S.state.transmissionRenderTarget[He.id]===void 0){const tn=fe.has("EXT_color_buffer_half_float")||fe.has("EXT_color_buffer_float");S.state.transmissionRenderTarget[He.id]=new Mc(1,1,{generateMipmaps:!0,type:tn?Zp:wc,minFilter:Wh,samples:Math.max(4,he.samples),stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,storeMultisampledDepthBuffer:!1,storeMultisampledStencilBuffer:!1,colorSpace:Wr.workingColorSpace})}const Lt=S.state.transmissionRenderTarget[He.id],St=He.viewport||U;Lt.setSize(St.z*k.transmissionResolutionScale,St.w*k.transmissionResolutionScale);const jt=k.getRenderTarget(),cn=k.getActiveCubeFace(),Kt=k.getActiveMipmapLevel();k.setRenderTarget(Lt),k.getClearColor(W),te=k.getClearAlpha(),te<1&&k.setClearColor(16777215,.5),k.clear(),N&&Mt.render(Qe);const Qn=k.toneMapping;k.toneMapping=Op;const dr=He.viewport;if(He.viewport!==void 0&&(He.viewport=void 0),S.setupLightsView(He),V===!0&&ut.setGlobalState(k.clippingPlanes,He),nr(pe,Qe,He),Ce.updateMultisampleRenderTarget(Lt),Ce.updateRenderTargetMipmap(Lt),fe.has("WEBGL_multisampled_render_to_texture")===!1){let tn=!1;for(let yr=0,no=je.length;yr<no;yr++){const ui=je[yr],{object:di,geometry:Oo,material:pn,group:ea}=ui;if(pn.side===Nh&&di.layers.test(He.layers)){const Wn=pn.side;pn.side=zl,pn.needsUpdate=!0,Sr(di,Qe,He,Oo,pn,ea),pn.side=Wn,pn.needsUpdate=!0,tn=!0}}tn===!0&&(Ce.updateMultisampleRenderTarget(Lt),Ce.updateRenderTargetMipmap(Lt))}k.setRenderTarget(jt,cn,Kt),k.setClearColor(W,te),dr!==void 0&&(He.viewport=dr),k.toneMapping=Qn}function nr(pe,je,Qe){const He=je.isScene===!0?je.overrideMaterial:null;for(let Xe=0,Lt=pe.length;Xe<Lt;Xe++){const St=pe[Xe],{object:jt,geometry:cn,group:Kt}=St;let Qn=St.material;Qn.allowOverride===!0&&He!==null&&(Qn=He),jt.layers.test(Qe.layers)&&Sr(jt,je,Qe,cn,Qn,Kt)}}function Sr(pe,je,Qe,He,Xe,Lt){I!==null&&Xe.isNodeMaterial&&I.setObject(pe,Xe),pe.onBeforeRender(k,je,Qe,He,Xe,Lt),pe.modelViewMatrix.multiplyMatrices(Qe.matrixWorldInverse,pe.matrixWorld),pe.normalMatrix.getNormalMatrix(pe.modelViewMatrix),Xe.onBeforeRender(k,je,Qe,He,pe,Lt),Xe.transparent===!0&&Xe.side===Nh&&Xe.forceSinglePass===!1?(Xe.side=zl,Xe.needsUpdate=!0,k.renderBufferDirect(Qe,je,He,Xe,pe,Lt),Xe.side=ty,Xe.needsUpdate=!0,k.renderBufferDirect(Qe,je,He,Xe,pe,Lt),Xe.side=Nh):k.renderBufferDirect(Qe,je,He,Xe,pe,Lt),pe.onAfterRender(k,je,Qe,He,Xe,Lt)}function yt(pe,je,Qe){je.isScene!==!0&&(je=q);const He=ue.get(pe),Xe=S.state.lights,Lt=S.state.shadowsArray,St=Xe.state.version,jt=De.getParameters(pe,Xe.state,Lt,je,Qe,S.state.lightProbeGridArray),cn=De.getProgramCacheKey(jt);let Kt=He.programs;He.environment=pe.isMeshStandardMaterial||pe.isMeshLambertMaterial||pe.isMeshPhongMaterial?je.environment:null,He.fog=je.fog;const Qn=pe.isMeshStandardMaterial||pe.isMeshLambertMaterial&&!pe.envMap||pe.isMeshPhongMaterial&&!pe.envMap;He.envMap=Ne.get(pe.envMap||He.environment,Qn),He.envMapRotation=He.environment!==null&&pe.envMap===null?je.environmentRotation:pe.envMapRotation,Kt===void 0&&(pe.addEventListener("dispose",ur),Kt=new Map,He.programs=Kt);let dr=Kt.get(cn);if(dr!==void 0){if(He.currentProgram===dr&&He.lightsStateVersion===St)return En(pe,jt),dr}else jt.uniforms=De.getUniforms(pe),I!==null&&pe.isNodeMaterial&&I.build(pe,Qe,jt),pe.onBeforeCompile(jt,k),dr=De.acquireProgram(jt,cn),Kt.set(cn,dr),He.uniforms=jt.uniforms;const tn=He.uniforms;return(!pe.isShaderMaterial&&!pe.isRawShaderMaterial||pe.clipping===!0)&&(tn.clippingPlanes=ut.uniform),En(pe,jt),He.needsLights=Eo(pe),He.lightsStateVersion=St,He.needsLights&&(tn.ambientLightColor.value=Xe.state.ambient,tn.lightProbe.value=Xe.state.probe,tn.sunLights.value=Xe.state.sun,tn.sunLightShadows.value=Xe.state.sunShadow,tn.directionalLights.value=Xe.state.directional,tn.directionalLightShadows.value=Xe.state.directionalShadow,tn.spotLights.value=Xe.state.spot,tn.spotLightShadows.value=Xe.state.spotShadow,tn.rectAreaLights.value=Xe.state.rectArea,tn.ltc_1.value=Xe.state.rectAreaLTC1,tn.ltc_2.value=Xe.state.rectAreaLTC2,tn.pointLights.value=Xe.state.point,tn.pointLightShadows.value=Xe.state.pointShadow,tn.hemisphereLights.value=Xe.state.hemi,tn.sunShadowMatrix.value=Xe.state.sunShadowMatrix,tn.sunShadowCascade.value=Xe.state.sunShadowCascade,tn.directionalShadowMatrix.value=Xe.state.directionalShadowMatrix,tn.spotLightMatrix.value=Xe.state.spotLightMatrix,tn.spotLightMap.value=Xe.state.spotLightMap,tn.pointShadowMatrix.value=Xe.state.pointShadowMatrix),He.lightProbeGrid=S.state.lightProbeGridArray.length>0,He.currentProgram=dr,He.uniformsList=null,dr}function ni(pe){if(pe.uniformsList===null){const je=pe.currentProgram.getUniforms();pe.uniformsList=VB.seqWithValue(je.seq,pe.uniforms)}return pe.uniformsList}function En(pe,je){const Qe=ue.get(pe);Qe.outputColorSpace=je.outputColorSpace,Qe.batching=je.batching,Qe.batchingColor=je.batchingColor,Qe.instancing=je.instancing,Qe.instancingColor=je.instancingColor,Qe.instancingMorph=je.instancingMorph,Qe.skinning=je.skinning,Qe.morphTargets=je.morphTargets,Qe.morphNormals=je.morphNormals,Qe.morphColors=je.morphColors,Qe.morphTargetsCount=je.morphTargetsCount,Qe.numClippingPlanes=je.numClippingPlanes,Qe.numIntersection=je.numClipIntersection,Qe.vertexAlphas=je.vertexAlphas,Qe.vertexTangents=je.vertexTangents,Qe.toneMapping=je.toneMapping}function ri(pe,je){if(pe.length===0)return null;if(pe.length===1)return pe[0].texture!==null?pe[0]:null;b.setFromMatrixPosition(je.matrixWorld);for(let Qe=0,He=pe.length;Qe<He;Qe++){const Xe=pe[Qe];if(Xe.texture!==null&&Xe.boundingBox.containsPoint(b))return Xe}return null}function vi(pe,je,Qe,He,Xe){je.isScene!==!0&&(je=q),Ce.resetTextureUnits();const Lt=je.fog,St=He.isMeshStandardMaterial||He.isMeshLambertMaterial||He.isMeshPhongMaterial?je.environment:null,jt=O===null?k.outputColorSpace:O.isXRRenderTarget===!0?O.texture.colorSpace:Wr.workingColorSpace,cn=He.isMeshStandardMaterial||He.isMeshLambertMaterial&&!He.envMap||He.isMeshPhongMaterial&&!He.envMap,Kt=Ne.get(He.envMap||St,cn),Qn=He.vertexColors===!0&&!!Qe.attributes.color&&Qe.attributes.color.itemSize===4,dr=!!Qe.attributes.tangent&&(!!He.normalMap||He.anisotropy>0),tn=!!Qe.morphAttributes.position,yr=!!Qe.morphAttributes.normal,no=!!Qe.morphAttributes.color;let ui=Op;He.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(ui=k.toneMapping);const di=Qe.morphAttributes.position||Qe.morphAttributes.normal||Qe.morphAttributes.color,Oo=di!==void 0?di.length:0,pn=ue.get(He),ea=S.state.lights;if(V===!0&&(ie===!0||pe!==H)){const $r=pe===H&&He.id===X;ut.setState(He,pe,$r)}let Wn=!1;He.version===pn.__version?(pn.needsLights&&pn.lightsStateVersion!==ea.state.version||pn.outputColorSpace!==jt||Xe.isBatchedMesh&&pn.batching===!1||!Xe.isBatchedMesh&&pn.batching===!0||Xe.isBatchedMesh&&pn.batchingColor===!0&&Xe._colorsTexture===null||Xe.isBatchedMesh&&pn.batchingColor===!1&&Xe._colorsTexture!==null||Xe.isInstancedMesh&&pn.instancing===!1||!Xe.isInstancedMesh&&pn.instancing===!0||Xe.isSkinnedMesh&&pn.skinning===!1||!Xe.isSkinnedMesh&&pn.skinning===!0||Xe.isInstancedMesh&&pn.instancingColor===!0&&Xe.instanceColor===null||Xe.isInstancedMesh&&pn.instancingColor===!1&&Xe.instanceColor!==null||Xe.isInstancedMesh&&pn.instancingMorph===!0&&Xe.morphTexture===null||Xe.isInstancedMesh&&pn.instancingMorph===!1&&Xe.morphTexture!==null||pn.envMap!==Kt||He.fog===!0&&pn.fog!==Lt||pn.numClippingPlanes!==void 0&&(pn.numClippingPlanes!==ut.numPlanes||pn.numIntersection!==ut.numIntersection)||pn.vertexAlphas!==Qn||pn.vertexTangents!==dr||pn.morphTargets!==tn||pn.morphNormals!==yr||pn.morphColors!==no||pn.toneMapping!==ui||pn.morphTargetsCount!==Oo||!!pn.lightProbeGrid!=S.state.lightProbeGridArray.length>0)&&(Wn=!0):(Wn=!0,pn.__version=He.version);let ta=pn.currentProgram;Wn===!0&&(ta=yt(He,je,Xe),I&&He.isNodeMaterial&&I.onUpdateProgram(He,ta,pn));let Ns=!1,ro=!1,Bo=!1;const Dr=ta.getUniforms(),mi=pn.uniforms;if(ee.useProgram(ta.program)&&(Ns=!0,ro=!0,Bo=!0),He.id!==X&&(X=He.id,ro=!0),pn.needsLights){const $r=ri(S.state.lightProbeGridArray,Xe);pn.lightProbeGrid!==$r&&(pn.lightProbeGrid=$r,ro=!0)}if(Ns||H!==pe){ee.buffers.depth.getReversed()&&pe.reversedDepth!==!0&&(pe._reversedDepth=!0,pe.updateProjectionMatrix()),Dr.setValue(F,"projectionMatrix",pe.projectionMatrix),Dr.setValue(F,"viewMatrix",pe.matrixWorldInverse);const as=Dr.map.cameraPosition;as!==void 0&&as.setValue(F,Y.setFromMatrixPosition(pe.matrixWorld)),he.logarithmicDepthBuffer&&Dr.setValue(F,"logDepthBufFC",2/(Math.log(pe.far+1)/Math.LN2)),(He.isMeshPhongMaterial||He.isMeshToonMaterial||He.isMeshLambertMaterial||He.isMeshBasicMaterial||He.isMeshStandardMaterial||He.isShaderMaterial)&&Dr.setValue(F,"isOrthographic",pe.isOrthographicCamera===!0),H!==pe&&(H=pe,ro=!0,Bo=!0)}if(pn.needsLights&&(ea.state.sunShadowMap.length>0&&Dr.setValue(F,"sunShadowMap",ea.state.sunShadowMap,Ce),ea.state.directionalShadowMap.length>0&&Dr.setValue(F,"directionalShadowMap",ea.state.directionalShadowMap,Ce),ea.state.spotShadowMap.length>0&&Dr.setValue(F,"spotShadowMap",ea.state.spotShadowMap,Ce),ea.state.pointShadowMap.length>0&&Dr.setValue(F,"pointShadowMap",ea.state.pointShadowMap,Ce)),Xe.isSkinnedMesh){Dr.setOptional(F,Xe,"bindMatrix"),Dr.setOptional(F,Xe,"bindMatrixInverse");const $r=Xe.skeleton;$r&&($r.boneTexture===null&&$r.computeBoneTexture(),Dr.setValue(F,"boneTexture",$r.boneTexture,Ce))}Xe.isBatchedMesh&&(Dr.setOptional(F,Xe,"batchingTexture"),Dr.setValue(F,"batchingTexture",Xe._matricesTexture,Ce),Dr.setOptional(F,Xe,"batchingIdTexture"),Dr.setValue(F,"batchingIdTexture",Xe._indirectTexture,Ce),Dr.setOptional(F,Xe,"batchingColorTexture"),Xe._colorsTexture!==null&&Dr.setValue(F,"batchingColorTexture",Xe._colorsTexture,Ce));const ko=Qe.morphAttributes;if((ko.position!==void 0||ko.normal!==void 0||ko.color!==void 0)&&Zt.update(Xe,Qe,ta),(ro||pn.receiveShadow!==Xe.receiveShadow)&&(pn.receiveShadow=Xe.receiveShadow,Dr.setValue(F,"receiveShadow",Xe.receiveShadow)),(He.isMeshStandardMaterial||He.isMeshLambertMaterial||He.isMeshPhongMaterial)&&He.envMap===null&&je.environment!==null&&(mi.envMapIntensity.value=je.environmentIntensity),mi.dfgLUT!==void 0&&(mi.dfgLUT.value=nIi()),ro){if(Dr.setValue(F,"toneMappingExposure",k.toneMappingExposure),pn.needsLights&&qi(mi,Bo),Lt&&He.fog===!0&&Ue.refreshFogUniforms(mi,Lt),Ue.refreshMaterialUniforms(mi,He,de,ae,S.state.transmissionRenderTarget[pe.id]),pn.needsLights&&pn.lightProbeGrid){const $r=pn.lightProbeGrid;mi.probesSH.value=$r.texture,mi.probesMin.value.copy($r.boundingBox.min),mi.probesMax.value.copy($r.boundingBox.max),mi.probesResolution.value.copy($r.resolution)}VB.upload(F,ni(pn),mi,Ce)}if(He.isShaderMaterial&&He.uniformsNeedUpdate===!0&&(VB.upload(F,ni(pn),mi,Ce),He.uniformsNeedUpdate=!1),He.isSpriteMaterial&&Dr.setValue(F,"center",Xe.center),Dr.setValue(F,"modelViewMatrix",Xe.modelViewMatrix),Dr.setValue(F,"normalMatrix",Xe.normalMatrix),Dr.setValue(F,"modelMatrix",Xe.matrixWorld),He.uniformsGroups!==void 0){const $r=He.uniformsGroups;for(let as=0,Yr=$r.length;as<Yr;as++){const Ny=$r[as];Nt.update(Ny,ta),Nt.bind(Ny,ta)}}return ta}function qi(pe,je){pe.ambientLightColor.needsUpdate=je,pe.lightProbe.needsUpdate=je,pe.sunLights.needsUpdate=je,pe.sunLightShadows.needsUpdate=je,pe.directionalLights.needsUpdate=je,pe.directionalLightShadows.needsUpdate=je,pe.pointLights.needsUpdate=je,pe.pointLightShadows.needsUpdate=je,pe.spotLights.needsUpdate=je,pe.spotLightShadows.needsUpdate=je,pe.rectAreaLights.needsUpdate=je,pe.hemisphereLights.needsUpdate=je}function Eo(pe){return pe.isMeshLambertMaterial||pe.isMeshToonMaterial||pe.isMeshPhongMaterial||pe.isMeshStandardMaterial||pe.isShadowMaterial||pe.isShaderMaterial&&pe.lights===!0}this.getActiveCubeFace=function(){return L},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return O},this.setRenderTargetTextures=function(pe,je,Qe){const He=ue.get(pe);He.__autoAllocateDepthBuffer=pe.resolveDepthBuffer===!1,He.__autoAllocateDepthBuffer===!1&&(He.__useRenderToTexture=!1),ue.get(pe.texture).__webglTexture=je,ue.get(pe.depthTexture).__webglTexture=He.__autoAllocateDepthBuffer?void 0:Qe,He.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(pe,je){const Qe=ue.get(pe);Qe.__webglFramebuffer=je,Qe.__useDefaultFramebuffer=je===void 0},this.setRenderTarget=function(pe,je=0,Qe=0){O=pe,L=je,B=Qe;let He=null,Xe=!1,Lt=!1;if(pe){const jt=ue.get(pe);if(jt.__useDefaultFramebuffer!==void 0){ee.bindFramebuffer(F.FRAMEBUFFER,jt.__webglFramebuffer),U.copy(pe.viewport),j.copy(pe.scissor),z=pe.scissorTest,ee.viewport(U),ee.scissor(j),ee.setScissorTest(z),X=-1;return}else if(jt.__webglFramebuffer===void 0)Ce.setupRenderTarget(pe);else if(jt.__hasExternalTextures)Ce.rebindTextures(pe,ue.get(pe.texture).__webglTexture,ue.get(pe.depthTexture).__webglTexture);else if(pe.depthBuffer){const Qn=pe.depthTexture;if(jt.__boundDepthTexture!==Qn){if(Qn!==null&&ue.has(Qn)&&(pe.width!==Qn.image.width||pe.height!==Qn.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");Ce.setupDepthRenderbuffer(pe)}}const cn=pe.texture;(cn.isData3DTexture||cn.isDataArrayTexture||cn.isCompressedArrayTexture)&&(Lt=!0);const Kt=ue.get(pe).__webglFramebuffer;pe.isWebGLCubeRenderTarget?(Array.isArray(Kt[je])?He=Kt[je][Qe]:He=Kt[je],Xe=!0):pe.samples>0&&Ce.useMultisampledRTT(pe)===!1?He=ue.get(pe).__webglMultisampledFramebuffer:Array.isArray(Kt)?He=Kt[Qe]:He=Kt,U.copy(pe.viewport),j.copy(pe.scissor),z=pe.scissorTest}else U.copy(xe).multiplyScalar(de).floor(),j.copy(ge).multiplyScalar(de).floor(),z=Re;if(Qe!==0&&(He=D),ee.bindFramebuffer(F.FRAMEBUFFER,He)&&ee.drawBuffers(pe,He),ee.viewport(U),ee.scissor(j),ee.setScissorTest(z),Xe){const jt=ue.get(pe.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+je,jt.__webglTexture,Qe)}else if(Lt){const jt=je;for(let cn=0;cn<pe.textures.length;cn++){const Kt=ue.get(pe.textures[cn]);F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+cn,Kt.__webglTexture,Qe,jt)}}else if(pe!==null&&Qe!==0){const jt=ue.get(pe.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,jt.__webglTexture,Qe)}X=-1};function Ls(pe){const je=ue.get(pe);return(je.__readFormat!==pe.format||je.__readType!==pe.type)&&(je.__readFormat=pe.format,je.__readType=pe.type,je.__formatReadable=he.textureFormatReadable(pe.format),je.__typeReadable=he.textureTypeReadable(pe.type)),je}this.readRenderTargetPixels=function(pe,je,Qe,He,Xe,Lt,St,jt=0){if(!(pe&&pe.isWebGLRenderTarget)){Fn("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let cn=ue.get(pe).__webglFramebuffer;if(pe.isWebGLCubeRenderTarget&&St!==void 0&&(cn=cn[St]),cn){ee.bindFramebuffer(F.FRAMEBUFFER,cn);try{const Kt=pe.textures[jt],Qn=Kt.format,dr=Kt.type;pe.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+jt);const tn=Ls(Kt);if(tn.__formatReadable===!1){Fn("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(tn.__typeReadable===!1){Fn("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}je>=0&&je<=pe.width-He&&Qe>=0&&Qe<=pe.height-Xe&&F.readPixels(je,Qe,He,Xe,qe.convert(Qn),qe.convert(dr),Lt)}finally{const Kt=O!==null?ue.get(O).__webglFramebuffer:null;ee.bindFramebuffer(F.FRAMEBUFFER,Kt)}}},this.readRenderTargetPixelsAsync=async function(pe,je,Qe,He,Xe,Lt,St,jt=0){if(!(pe&&pe.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let cn=ue.get(pe).__webglFramebuffer;if(pe.isWebGLCubeRenderTarget&&St!==void 0&&(cn=cn[St]),cn)if(je>=0&&je<=pe.width-He&&Qe>=0&&Qe<=pe.height-Xe){ee.bindFramebuffer(F.FRAMEBUFFER,cn);const Kt=pe.textures[jt],Qn=Kt.format,dr=Kt.type;pe.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+jt);const tn=Ls(Kt);if(tn.__formatReadable===!1)throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(tn.__typeReadable===!1)throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const yr=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,yr),F.bufferData(F.PIXEL_PACK_BUFFER,Lt.byteLength,F.STREAM_READ),F.readPixels(je,Qe,He,Xe,qe.convert(Qn),qe.convert(dr),0),F.bindBuffer(F.PIXEL_PACK_BUFFER,null);const no=O!==null?ue.get(O).__webglFramebuffer:null;ee.bindFramebuffer(F.FRAMEBUFFER,no);const ui=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return F.flush(),await eAi(F,ui,4),F.bindBuffer(F.PIXEL_PACK_BUFFER,yr),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,Lt),F.bindBuffer(F.PIXEL_PACK_BUFFER,null),F.deleteBuffer(yr),F.deleteSync(ui),Lt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(pe,je=null,Qe=0){const He=Math.pow(2,-Qe),Xe=Math.floor(pe.image.width*He),Lt=Math.floor(pe.image.height*He),St=je!==null?je.x:0,jt=je!==null?je.y:0;Ce.setTexture2D(pe,0),F.copyTexSubImage2D(F.TEXTURE_2D,Qe,0,0,St,jt,Xe,Lt),ee.unbindTexture()},this.copyTextureToTexture=function(pe,je,Qe=null,He=null,Xe=0,Lt=0){let St,jt,cn,Kt,Qn,dr,tn,yr,no;const ui=pe.isCompressedTexture?pe.mipmaps[Lt]:pe.image;if(Qe!==null)St=Qe.max.x-Qe.min.x,jt=Qe.max.y-Qe.min.y,cn=Qe.isBox3?Qe.max.z-Qe.min.z:1,Kt=Qe.min.x,Qn=Qe.min.y,dr=Qe.isBox3?Qe.min.z:0;else{const mi=Math.pow(2,-Xe);St=Math.floor(ui.width*mi),jt=Math.floor(ui.height*mi),pe.isDataArrayTexture?cn=ui.depth:pe.isData3DTexture?cn=Math.floor(ui.depth*mi):cn=1,Kt=0,Qn=0,dr=0}He!==null?(tn=He.x,yr=He.y,no=He.z):(tn=0,yr=0,no=0);const di=qe.convert(je.format),Oo=qe.convert(je.type);let pn;je.isData3DTexture?(Ce.setTexture3D(je,0),pn=F.TEXTURE_3D):je.isDataArrayTexture||je.isCompressedArrayTexture?(Ce.setTexture2DArray(je,0),pn=F.TEXTURE_2D_ARRAY):(Ce.setTexture2D(je,0),pn=F.TEXTURE_2D),ee.activeTexture(F.TEXTURE0),ee.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,je.flipY),ee.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,je.premultiplyAlpha),ee.pixelStorei(F.UNPACK_ALIGNMENT,je.unpackAlignment);const ea=ee.getParameter(F.UNPACK_ROW_LENGTH),Wn=ee.getParameter(F.UNPACK_IMAGE_HEIGHT),ta=ee.getParameter(F.UNPACK_SKIP_PIXELS),Ns=ee.getParameter(F.UNPACK_SKIP_ROWS),ro=ee.getParameter(F.UNPACK_SKIP_IMAGES);ee.pixelStorei(F.UNPACK_ROW_LENGTH,ui.width),ee.pixelStorei(F.UNPACK_IMAGE_HEIGHT,ui.height),ee.pixelStorei(F.UNPACK_SKIP_PIXELS,Kt),ee.pixelStorei(F.UNPACK_SKIP_ROWS,Qn),ee.pixelStorei(F.UNPACK_SKIP_IMAGES,dr);const Bo=pe.isDataArrayTexture||pe.isData3DTexture,Dr=je.isDataArrayTexture||je.isData3DTexture;if(pe.isDepthTexture){const mi=ue.get(pe),ko=ue.get(je),$r=ue.get(mi.__renderTarget),as=ue.get(ko.__renderTarget);ee.bindFramebuffer(F.READ_FRAMEBUFFER,$r.__webglFramebuffer),ee.bindFramebuffer(F.DRAW_FRAMEBUFFER,as.__webglFramebuffer);for(let Yr=0;Yr<cn;Yr++)Bo&&(F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,ue.get(pe).__webglTexture,Xe,dr+Yr),F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,ue.get(je).__webglTexture,Lt,no+Yr)),F.blitFramebuffer(Kt,Qn,St,jt,tn,yr,St,jt,F.DEPTH_BUFFER_BIT,F.NEAREST);ee.bindFramebuffer(F.READ_FRAMEBUFFER,null),ee.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else if(Xe!==0||pe.isRenderTargetTexture||ue.has(pe)){const mi=ue.get(pe),ko=ue.get(je);ee.bindFramebuffer(F.READ_FRAMEBUFFER,R),ee.bindFramebuffer(F.DRAW_FRAMEBUFFER,_);for(let $r=0;$r<cn;$r++)Bo?F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,mi.__webglTexture,Xe,dr+$r):F.framebufferTexture2D(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,mi.__webglTexture,Xe),Dr?F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,ko.__webglTexture,Lt,no+$r):F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,ko.__webglTexture,Lt),Xe!==0?F.blitFramebuffer(Kt,Qn,St,jt,tn,yr,St,jt,F.COLOR_BUFFER_BIT,F.NEAREST):Dr?F.copyTexSubImage3D(pn,Lt,tn,yr,no+$r,Kt,Qn,St,jt):F.copyTexSubImage2D(pn,Lt,tn,yr,Kt,Qn,St,jt);ee.bindFramebuffer(F.READ_FRAMEBUFFER,null),ee.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else Dr?pe.isDataTexture||pe.isData3DTexture?F.texSubImage3D(pn,Lt,tn,yr,no,St,jt,cn,di,Oo,ui.data):je.isCompressedArrayTexture?F.compressedTexSubImage3D(pn,Lt,tn,yr,no,St,jt,cn,di,ui.data):F.texSubImage3D(pn,Lt,tn,yr,no,St,jt,cn,di,Oo,ui):pe.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,Lt,tn,yr,St,jt,di,Oo,ui.data):pe.isCompressedTexture?F.compressedTexSubImage2D(F.TEXTURE_2D,Lt,tn,yr,ui.width,ui.height,di,ui.data):F.texSubImage2D(F.TEXTURE_2D,Lt,tn,yr,St,jt,di,Oo,ui);ee.pixelStorei(F.UNPACK_ROW_LENGTH,ea),ee.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Wn),ee.pixelStorei(F.UNPACK_SKIP_PIXELS,ta),ee.pixelStorei(F.UNPACK_SKIP_ROWS,Ns),ee.pixelStorei(F.UNPACK_SKIP_IMAGES,ro),Lt===0&&je.generateMipmaps&&F.generateMipmap(pn),ee.unbindTexture()},this.initRenderTarget=function(pe){ue.get(pe).__webglFramebuffer===void 0&&Ce.setupRenderTarget(pe)},this.initTexture=function(pe){pe.isCubeTexture?Ce.setTextureCube(pe,0):pe.isData3DTexture?Ce.setTexture3D(pe,0):pe.isDataArrayTexture||pe.isCompressedArrayTexture?Ce.setTexture2DArray(pe,0):Ce.setTexture2D(pe,0),ee.unbindTexture()},this.resetState=function(){L=0,B=0,O=null,ee.reset(),bt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return hu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Wr._getDrawingBufferColorSpace(e),t.unpackColorSpace=Wr._getUnpackColorSpace()}};const iIi=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Ibe,AddEquation:Jv,AddOperation:fMt,AdditiveAnimationBlendMode:zbe,AdditiveBlending:cse,AgXToneMapping:Dbe,AlphaFormat:jbe,AlwaysCompare:kMt,AlwaysDepth:sU,AlwaysStencilFunc:wMt,AmbientLight:gIt,AnimationAction:MIt,AnimationClip:OI,AnimationLoader:YEi,AnimationMixer:Eki,AnimationObjectGroup:Tki,AnimationUtils:GEi,ArcCurve:gPt,ArrayCamera:TIt,ArrowHelper:Qki,AttachedBindMode:pse,Audio:EIt,AudioAnalyser:fki,AudioContext:m1e,AudioListener:dki,AudioLoader:ski,AxesHelper:e4i,BackSide:zl,BasicDepthPacking:vMt,BasicShadowMap:aTi,BatchedMesh:ePt,BezierInterpolant:lIt,Bone:Xbe,BooleanKeyframeTrack:iS,Box2:_It,Box3:nl,Box3Helper:Zki,BoxGeometry:PR,BoxHelper:Yki,BufferAttribute:zi,BufferGeometry:Ir,BufferGeometryLoader:SIt,ByteType:Nbe,Cache:Xh,Camera:BW,CameraHelper:Kki,CanvasTexture:cEi,CapsuleGeometry:aPt,CatmullRomCurve3:xPt,CineonToneMapping:Pbe,CircleGeometry:lPt,ClampToEdgeWrapping:Ec,Clock:Lki,Color:bn,ColorKeyframeTrack:d1e,ColorManagement:Wr,Compatibility:qTi,CompressedArrayTexture:sEi,CompressedCubeTexture:lEi,CompressedTexture:DW,CompressedTextureLoader:ZEi,ConeGeometry:Zbe,ConstantAlphaFactor:dMt,ConstantColorFactor:cMt,Controls:n4i,CubeCamera:CIt,CubeDepthTexture:iPt,CubeReflectionMapping:wf,CubeRefractionMapping:ny,CubeTexture:MR,CubeTextureLoader:JEi,CubeUVReflectionMapping:sk,CubicBezierCurve:Qbe,CubicBezierCurve3:yPt,CubicInterpolant:aIt,CullFaceBack:lse,CullFaceFront:X5t,CullFaceFrontBack:oTi,CullFaceNone:W5t,Curve:rh,CurvePath:bPt,CustomBlending:K5t,CustomToneMapping:_be,CylinderGeometry:Ybe,Cylindrical:Fki,Data3DTexture:PW,DataArrayTexture:MW,DataTexture:Id,DataTextureLoader:QEi,DataUtils:RAi,DecrementStencilOp:ATi,DecrementWrapStencilOp:kTi,DefaultLoadingManager:dIt,DepthFormat:Sf,DepthStencilFormat:tx,DepthTexture:jA,DetachedBindMode:mMt,DirectionalLight:mIt,DirectionalLightHelper:qki,DiscreteInterpolant:sIt,DodecahedronGeometry:hPt,DoubleSide:Nh,DstAlphaFactor:iMt,DstColorFactor:aMt,DynamicCopyUsage:$Ti,DynamicDrawUsage:FTi,DynamicReadUsage:jTi,EdgesGeometry:mPt,EllipseCurve:RW,EqualCompare:TMt,EqualDepth:cU,EqualStencilFunc:_Ti,EquirectangularReflectionMapping:X5,EquirectangularRefractionMapping:q5,Euler:nm,EventDispatcher:nh,ExternalTexture:Kbe,ExtrudeGeometry:EPt,FileLoader:rm,Float16BufferAttribute:UAi,Float32BufferAttribute:An,FloatType:Ol,Fog:UMt,FogExp2:BMt,FramebufferTexture:aEi,FrontSide:ty,Frustum:dw,FrustumArray:JMt,GLBufferAttribute:Dki,GLSL1:GTi,GLSL3:fse,GreaterCompare:AMt,GreaterDepth:dU,GreaterEqualCompare:EW,GreaterEqualDepth:uU,GreaterEqualStencilFunc:NTi,GreaterStencilFunc:RTi,GridHelper:Wki,Group:gC,HTMLTexture:uEi,HalfFloatType:Zp,HemisphereLight:pIt,HemisphereLightHelper:Vki,IcosahedronGeometry:MPt,ImageBitmapLoader:aki,ImageLoader:BI,ImageUtils:LMt,IncrementStencilOp:TTi,IncrementWrapStencilOp:ETi,InstancedBufferAttribute:BA,InstancedBufferGeometry:wIt,InstancedInterleavedBuffer:_ki,InstancedMesh:ZMt,Int16BufferAttribute:BAi,Int32BufferAttribute:jAi,Int8BufferAttribute:NAi,IntType:yW,InterleavedBuffer:_W,InterleavedBufferAttribute:DI,Interpolant:uk,InterpolateBezier:hse,InterpolateDiscrete:EI,InterpolateLinear:HU,InterpolateSmooth:UB,InterpolationSamplingMode:XTi,InterpolationSamplingType:WTi,InvertStencilOp:MTi,KeepStencilOp:zB,KeyframeTrack:tp,LOD:XMt,LatheGeometry:IPt,Layers:IW,LessCompare:CMt,LessDepth:lU,LessEqualCompare:AW,LessEqualDepth:LA,LessEqualStencilFunc:DTi,LessStencilFunc:ITi,Light:Ly,LightProbe:yIt,LightShadow:OW,Line:oy,Line3:Uki,LineBasicMaterial:Jl,LineCurve:e1e,LineCurve3:vPt,LineDashedMaterial:rIt,LineLoop:tPt,LineSegments:_f,LinearFilter:Qi,LinearInterpolant:u1e,LinearMipMapLinearFilter:dTi,LinearMipMapNearestFilter:uTi,LinearMipmapLinearFilter:Wh,LinearMipmapNearestFilter:K5,LinearSRGBColorSpace:MI,LinearToneMapping:kbe,LinearTransfer:PI,Loader:Fc,LoaderUtils:bse,LoadingManager:h1e,LoopOnce:gMt,LoopPingPong:yMt,LoopRepeat:xMt,MOUSE:rTi,Material:Is,MaterialBlending:sTi,MaterialLoader:vIt,MathUtils:yAi,Matrix2:Oki,Matrix3:kr,Matrix4:wr,MaxEquation:Q5t,Mesh:pa,MeshBasicMaterial:Ry,MeshDepthMaterial:l1e,MeshDistanceMaterial:c1e,MeshLambertMaterial:tIt,MeshMatcapMaterial:nIt,MeshNormalMaterial:eIt,MeshPhongMaterial:JPt,MeshPhysicalMaterial:ZPt,MeshStandardMaterial:s1e,MeshToonMaterial:QPt,MinEquation:J5t,MirroredRepeatWrapping:CI,MixOperation:hMt,MultiplyBlending:dse,MultiplyOperation:ER,NearestFilter:Xo,NearestMipMapLinearFilter:cTi,NearestMipMapNearestFilter:lTi,NearestMipmapLinearFilter:fC,NearestMipmapNearestFilter:Lbe,NeutralToneMapping:Rbe,NeverCompare:SMt,NeverDepth:aU,NeverStencilFunc:PTi,NoBlending:tf,NoColorSpace:p0,NoNormalPacking:vTi,NoToneMapping:Op,NormalAnimationBlendMode:TW,NormalBlending:oT,NormalGAPacking:wTi,NormalRGPacking:bTi,NotEqualCompare:EMt,NotEqualDepth:pU,NotEqualStencilFunc:LTi,NumberKeyframeTrack:NW,Object3D:Ai,ObjectLoader:iki,ObjectSpaceNormalMap:bMt,OctahedronGeometry:i1e,OneFactor:tMt,OneMinusConstantAlphaFactor:pMt,OneMinusConstantColorFactor:uMt,OneMinusDstAlphaFactor:oMt,OneMinusDstColorFactor:sMt,OneMinusSrcAlphaFactor:Ebe,OneMinusSrcColorFactor:rMt,OrthographicCamera:_R,PCFShadowMap:W5,PCFSoftShadowMap:q5t,PMREMGenerator:Cse,Path:RI,PerspectiveCamera:ps,Plane:c0,PlaneGeometry:LW,PlaneHelper:Jki,PointLight:fIt,PointLightHelper:Hki,Points:nPt,PointsMaterial:qbe,PolarGridHelper:Xki,PolyhedronGeometry:ck,PositionalAudio:hki,PropertyBinding:Ni,PropertyMixer:kIt,QuadraticBezierCurve:t1e,QuadraticBezierCurve3:n1e,Quaternion:$l,QuaternionKeyframeTrack:FW,QuaternionLinearInterpolant:uIt,R11_EAC_Format:bU,RED_GREEN_RGTC2_Format:AI,RED_RGTC1_Format:UU,REVISION:gW,RG11_EAC_Format:TI,RGBADepthPacking:gTi,RGBAFormat:Bl,RGBAIntegerFormat:CW,RGBA_ASTC_10x10_Format:LU,RGBA_ASTC_10x5_Format:_U,RGBA_ASTC_10x6_Format:DU,RGBA_ASTC_10x8_Format:RU,RGBA_ASTC_12x10_Format:NU,RGBA_ASTC_12x12_Format:FU,RGBA_ASTC_4x4_Format:CU,RGBA_ASTC_5x4_Format:TU,RGBA_ASTC_5x5_Format:AU,RGBA_ASTC_6x5_Format:EU,RGBA_ASTC_6x6_Format:kU,RGBA_ASTC_8x5_Format:MU,RGBA_ASTC_8x6_Format:PU,RGBA_ASTC_8x8_Format:IU,RGBA_BPTC_Format:OU,RGBA_ETC2_EAC_Format:vU,RGBA_PVRTC_2BPPV1_Format:gU,RGBA_PVRTC_4BPPV1_Format:mU,RGBA_S3TC_DXT1_Format:Z5,RGBA_S3TC_DXT3_Format:J5,RGBA_S3TC_DXT5_Format:Q5,RGBDepthPacking:xTi,RGBFormat:Ube,RGBIntegerFormat:pTi,RGB_BPTC_SIGNED_Format:BU,RGB_BPTC_UNSIGNED_Format:jU,RGB_ETC1_Format:xU,RGB_ETC2_Format:yU,RGB_PVRTC_2BPPV1_Format:fU,RGB_PVRTC_4BPPV1_Format:hU,RGB_S3TC_DXT1_Format:Y5,RGDepthPacking:yTi,RGFormat:ry,RGIntegerFormat:SW,RawShaderMaterial:a1e,Ray:lk,Raycaster:Rki,RectAreaLight:xIt,RedFormat:wW,RedIntegerFormat:kR,ReinhardToneMapping:Mbe,RenderObjectRefreshType:KTi,RenderTarget:Hbe,RenderTarget3D:kki,RepeatWrapping:SI,ReplaceStencilOp:CTi,ReverseSubtractEquation:Z5t,RingGeometry:LPt,SIGNED_R11_EAC_Format:wU,SIGNED_RED_GREEN_RGTC2_Format:$U,SIGNED_RED_RGTC1_Format:zU,SIGNED_RG11_EAC_Format:SU,SRGBColorSpace:gc,SRGBTransfer:gi,Scene:$Mt,ShaderChunk:Nr,ShaderLib:Sp,ShaderMaterial:Xd,ShadowMaterial:qPt,Shape:IR,ShapeGeometry:FPt,ShapePath:t4i,ShapeUtils:C0,ShortType:Fbe,Skeleton:KMt,SkeletonHelper:$ki,SkinnedMesh:qMt,Source:wAi,Sphere:Cs,SphereGeometry:o1e,Spherical:Nki,SphericalHarmonics3:f1e,SplineCurve:r1e,SpotLight:hIt,SpotLightHelper:zki,Sprite:WMt,SpriteMaterial:Wbe,SrcAlphaFactor:Abe,SrcAlphaSaturateFactor:lMt,SrcColorFactor:nMt,StaticCopyUsage:zTi,StaticDrawUsage:kW,StaticReadUsage:BTi,StereoCamera:lki,StreamCopyUsage:HTi,StreamDrawUsage:OTi,StreamReadUsage:UTi,StringKeyframeTrack:oS,SubtractEquation:Y5t,SubtractiveBlending:use,TOUCH:iTi,TangentSpaceNormalMap:tm,TetrahedronGeometry:jPt,Texture:Oa,TextureLoader:eki,TextureSource:S0,TextureUtils:s4i,Timer:AIt,TimestampQuery:VTi,TorusGeometry:zPt,TorusKnotGeometry:HPt,Triangle:Pg,TriangleFanDrawMode:mTi,TriangleStripDrawMode:fTi,TrianglesDrawMode:hTi,TubeGeometry:VPt,UVMapping:xW,Uint16BufferAttribute:Gbe,Uint32BufferAttribute:Vbe,Uint8BufferAttribute:FAi,Uint8ClampedBufferAttribute:OAi,Uniform:Mki,UniformsGroup:Iki,UniformsLib:rn,UniformsUtils:YPt,UnsignedByteType:wc,UnsignedInt101111Type:Bbe,UnsignedInt248Type:FA,UnsignedInt5999Type:Obe,UnsignedIntType:Wd,UnsignedShort4444Type:vW,UnsignedShort5551Type:bW,UnsignedShortType:NA,VSMShadowMap:hC,Vector2:kt,Vector3:_e,Vector4:Ui,VectorKeyframeTrack:p1e,VideoFrameTexture:oEi,VideoTexture:rPt,WebGL3DRenderTarget:TAi,WebGLArrayRenderTarget:CAi,WebGLCoordinateSystem:hu,WebGLCubeRenderTarget:y1e,WebGLRenderTarget:Mc,WebGLRenderer:rIi,WebGLUtils:jIt,WebGPUCoordinateSystem:uw,WebXRController:GB,WireframeGeometry:XPt,WrapAroundEnding:kI,ZeroCurvatureEnding:Tb,ZeroFactor:eMt,ZeroSlopeEnding:Ab,ZeroStencilOp:STi,createCanvasElement:PMt,error:Fn,getConsoleFunction:QTi,log:_I,setConsoleFunction:JTi,warn:en,warnOnce:N0},Symbol.toStringTag,{value:"Module"}));var Yc="chats",v1e="deckId";function Ese(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error??new Error("IndexedDB request failed."))})}function B3(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>n(e.error??new Error("IndexedDB transaction failed.")),e.onabort=()=>n(e.error??new Error("IndexedDB transaction aborted."))})}function oIi(e){const t=typeof indexedDB<"u"?indexedDB:void 0;if(!t)throw new Error("IndexedDB is not available in this environment.");return new Promise((n,r)=>{const i=t.open(e,1);i.onupgradeneeded=()=>{const o=i.result;o.objectStoreNames.contains(Yc)||o.createObjectStore(Yc,{keyPath:"id"}).createIndex(v1e,"deckId",{unique:!1})},i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error??new Error("Failed to open IndexedDB.")),i.onblocked=()=>r(new Error("IndexedDB open blocked by another connection."))})}async function aIi(e,t){const n=e.transaction(Yc,"readonly"),r=n.objectStore(Yc),i=t===void 0?r.getAll():r.index(v1e).getAll(IDBKeyRange.only(t)),o=await Ese(i);return await B3(n),o}function sIi(e){return{async list(t){return(await aIi(e,t)).map(ibt).sort((r,i)=>i.updatedAt-r.updatedAt)},async load(t){const n=e.transaction(Yc,"readonly"),r=await Ese(n.objectStore(Yc).get(t));return await B3(n),r??null},async save(t){const n=e.transaction(Yc,"readwrite");n.objectStore(Yc).put(t),await B3(n)},async remove(t){const n=e.transaction(Yc,"readwrite");n.objectStore(Yc).delete(t),await B3(n)},async clear(t){const n=e.transaction(Yc,"readwrite"),r=n.objectStore(Yc);if(t===void 0)r.clear();else{const i=await Ese(r.index(v1e).getAllKeys(IDBKeyRange.only(t)));for(const o of i)r.delete(o)}await B3(n)}}}const lIi=Object.freeze(Object.defineProperty({__proto__:null,CHAT_STORE:Yc,createIdbBackend:sIi,openChatDb:oIi},Symbol.toStringTag,{value:"Module"}));function cIi(e,t){const n=P.useRef(t),[r,i]=P.useState("checking"),[o,a]=P.useState(null),[s,l]=P.useState(void 0);return P.useEffect(()=>{let c=!1;return i("checking"),a(null),l(void 0),(async()=>{try{const u=await Wdi();if(c)return;if(!u){i("unavailable");return}const d=await zpi(e,n.current);if(c)return;a(d),i("ready")}catch(u){if(c)return;l(u instanceof Error?u:new Error(String(u))),i("error")}})(),()=>{c=!0}},[e]),{state:r,session:o,initError:s}}function uIi(e,t){const n=dIi(e);if(n<0)return e;const r=e[n],i={type:"text",text:`Current deck context (for your reference; do not repeat it back verbatim):
11310
11310
 
11311
- ${t}`},o=e.slice();return o[n]={...r,parts:[i,...r.parts]},o}function dIi(e){for(let t=e.length-1;t>=0;t--)if(e[t].role==="user")return t;return-1}function pIi(e,t,n){return{async sendMessages(r){if(n==="none"&&!t.getFocusedTargets)return e.sendMessages(r);let i="";try{i=await ipi(t,{strategy:n,focus:{}})}catch{i=""}return i.trim()?e.sendMessages({...r,messages:uIi(r.messages,i)}):e.sendMessages(r)},reconnectToStream(r){return e.reconnectToStream(r)}}}function hIi(e,t,n,r,i={}){const[,o]=P.useReducer(y=>y+1,0),a=P.useRef(null),s=P.useRef(i.onToolTarget);s.current=i.onToolTarget;const l=P.useRef(new Set),c=t.clientExecutesTools,u=P.useMemo(()=>pIi(t.transport,r,n.contextStrategy??"outline"),[t,r,n.contextStrategy]),d=e({transport:u,sendAutomaticallyWhen:c?t.sendAutomaticallyWhen:void 0,onError:y=>n.onError?.(y),onToolCall:c?async({toolCall:y})=>{const{toolName:v,toolCallId:b,input:w}=y,S=a.current;if(!S)return;const T=S.addToolOutput;try{const A=await t.executeToolCall(v,w);T({tool:v,toolCallId:b,output:A})}catch(A){T({tool:v,toolCallId:b,state:"output-error",errorText:A instanceof Error?A.message:String(A)})}o()}:void 0});a.current=d,P.useEffect(()=>{const y=l.current;for(const v of qOe(d.messages))y.has(v.toolCallId)||(y.add(v.toolCallId),s.current?.(mhi(v.toolName,v.input)))},[d.messages]);const p=P.useCallback(y=>{const v=y.trim();v.length!==0&&d.sendMessage({text:v})},[d]),h=P.useCallback(y=>{t.proposals.apply(y),o()},[t]),f=P.useCallback(y=>{t.proposals.revert(y),o()},[t]),m=P.useCallback(()=>{t.proposals.acceptAll(),o()},[t]),g=P.useCallback(y=>{d.setMessages(y);for(const v of qOe(y))l.current.add(v.toolCallId);t.proposals.clear(),o()},[d,t]);return{messages:d.messages,status:d.status,error:d.error,isStreaming:d.status==="submitted"||d.status==="streaming",send:p,stop:()=>void d.stop(),setMessages:g,clearError:()=>d.clearError(),proposals:t.proposals.list(),applyProposal:h,rejectProposal:f,acceptAllProposals:m}}var fIi=800,Y9e=40;function oO(){return`chat-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function mIi(e){for(const t of e){if(t.role!=="user")continue;const n=t.parts.filter(r=>r.type==="text").map(r=>r.text).join(" ").trim();if(n)return n.length>Y9e?`${n.slice(0,Y9e).trimEnd()}…`:n}return""}function gIi(e){const{deckId:t,messages:n,setMessages:r}=e,i=P.useMemo(()=>e.store??PG(),[e.store]),[o,a]=P.useState(oO),[s,l]=P.useState([]),c=P.useRef(Date.now()),u=P.useRef(null),d=P.useCallback(async()=>{l(await i.listChats({deckId:t}))},[i,t]);P.useEffect(()=>{a(oO()),c.current=Date.now(),d()},[d]),P.useEffect(()=>{if(n.length!==0)return u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{(async()=>(await i.saveChat({id:o,title:mIi(n)||"Untitled chat",deckId:t,messages:n,createdAt:c.current,updatedAt:Date.now()}),await d()))()},fIi),()=>{u.current&&clearTimeout(u.current)}},[n,o,t,i,d]);const p=P.useCallback(()=>{a(oO()),c.current=Date.now(),r([])},[r]),h=P.useCallback(()=>{r([])},[r]),f=P.useCallback(async g=>{const y=await i.loadChat(g);y&&(a(y.id),c.current=y.createdAt,r(y.messages))},[i,r]),m=P.useCallback(async g=>{await i.deleteChat(g),g===o&&(a(oO()),c.current=Date.now(),r([])),await d()},[i,o,r,d]);return{chats:s,activeChatId:o,refresh:d,newChat:p,resumeChat:f,clearCurrent:h,deleteChat:m}}function xIi({isStreaming:e,onSend:t,onStop:n,prefillText:r,prefillNonce:i}){const{t:o}=Ie(),[a,s]=P.useState(""),l=P.useRef(null),c=P.useRef(void 0);P.useEffect(()=>{i===void 0||i===c.current||(c.current=i,r&&s(r),l.current?.focus())},[i,r]);const u=P.useCallback(()=>{const p=a.trim();p.length===0||e||(t(p),s(""))},[a,e,t]),d=P.useCallback(p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),u())},[u]);return x.jsx("div",{className:"border-t border-border p-2",children:x.jsxs("div",{className:"flex items-end gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 focus-within:border-ring",children:[x.jsx("textarea",{ref:l,value:a,onChange:p=>s(p.target.value),onKeyDown:d,rows:1,placeholder:o("pptx.ai.placeholder"),"aria-label":o("pptx.ai.placeholder"),className:"max-h-32 min-h-[1.5rem] flex-1 resize-none bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground"}),e?x.jsx("button",{type:"button",onClick:n,title:o("pptx.ai.stop"),"aria-label":o("pptx.ai.stop"),className:"shrink-0 rounded-sm p-1.5 text-muted-foreground transition-colors hover:bg-accent",children:x.jsx(Kyt,{className:"w-4 h-4"})}):x.jsx("button",{type:"button",onClick:u,disabled:a.trim().length===0,title:o("pptx.ai.send"),"aria-label":o("pptx.ai.send"),className:pt("shrink-0 rounded-sm p-1.5 transition-colors",a.trim().length===0?"text-muted-foreground/50":"bg-primary text-primary-foreground hover:bg-primary/90"),children:x.jsx(gUr,{className:"w-4 h-4"})})]})})}function yIi({targets:e,slides:t,isPinned:n,onPin:r,onClearPin:i,onSendDirective:o,pickMode:a,hasPicks:s,onStartPick:l,onStopPick:c,onClearPicks:u}){const{t:d}=Ie(),p=rhi(e,t),h=ihi(e,t);return x.jsxs("div",{className:"border-b border-border bg-secondary/30",children:[x.jsxs("div",{className:"flex flex-wrap items-center gap-1 px-2.5 py-1.5",children:[x.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:d("pptx.ai.focusScope")}),p.map(f=>x.jsx("span",{className:pt("inline-flex max-w-[10rem] items-center rounded-full px-2 py-0.5 text-[11px]",s||n?"bg-primary/15 text-primary":"bg-muted text-muted-foreground"),title:f.title,children:x.jsx("span",{className:"truncate",children:f.label})},f.key)),n&&x.jsx("span",{className:"rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:d("pptx.ai.pinnedFocus")}),x.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[h&&x.jsxs("button",{type:"button",onClick:()=>o(ohi(h.slideIndex,h.elementIdA,h.elementIdB)),className:"inline-flex items-center gap-1 rounded-sm bg-primary/90 px-1.5 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary max-md:min-h-[44px]!",children:[x.jsx(VUr,{className:"w-3 h-3"}),d("pptx.ai.mergeSelectedTables")]}),x.jsx("button",{type:"button",onClick:a?c:l,title:d("pptx.ai.pickElement"),"aria-label":d("pptx.ai.pickAria"),"aria-pressed":a,className:pt("rounded-sm p-1 max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",a?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:x.jsx(L6e,{className:"w-3.5 h-3.5"})}),s&&x.jsx("button",{type:"button",onClick:u,title:d("pptx.ai.pickClear"),"aria-label":d("pptx.ai.pickClear"),className:"rounded-sm p-1 text-muted-foreground hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:x.jsx(yi,{className:"w-3.5 h-3.5"})}),!s&&x.jsx("button",{type:"button",onClick:n?i:r,title:d(n?"pptx.ai.clearFocus":"pptx.ai.pinFocus"),"aria-label":d(n?"pptx.ai.clearFocus":"pptx.ai.pinFocus"),className:"rounded-sm p-1 text-muted-foreground hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:n?x.jsx(TUr,{className:"w-3.5 h-3.5"}):x.jsx(CUr,{className:"w-3.5 h-3.5"})})]})]}),a&&x.jsxs("div",{className:"flex items-center gap-2 border-t border-primary/20 bg-primary/5 px-2.5 py-1",children:[x.jsx(L6e,{className:"w-3.5 h-3.5 shrink-0 animate-pulse text-primary"}),x.jsx("span",{className:"text-[11px] font-medium text-primary",children:d("pptx.ai.pickElementHint")}),x.jsx("button",{type:"button",onClick:c,className:"ml-auto rounded-sm bg-primary px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary/90",children:d("pptx.ai.pickDone")})]})]})}function vIi(e,t=Date.now()){const n=Math.max(0,Math.round((t-e)/1e3));if(n<45)return"just now";const r=Math.round(n/60);if(r<60)return`${r}m ago`;const i=Math.round(r/60);if(i<24)return`${i}h ago`;const o=Math.round(i/24);return o<7?`${o}d ago`:`${Math.round(o/7)}w ago`}function bIi({chats:e,activeChatId:t,onResume:n,onDelete:r}){const{t:i}=Ie();return e.length===0?x.jsx("p",{className:"px-3 py-4 text-center text-[12px] text-muted-foreground",children:i("pptx.ai.historyEmpty")}):x.jsx("ul",{className:"max-h-64 overflow-y-auto py-1",children:e.map(o=>x.jsxs("li",{className:"group flex items-center gap-1 px-1",children:[x.jsxs("button",{type:"button",onClick:()=>n(o.id),className:pt("flex min-w-0 flex-1 items-start gap-2 rounded-sm px-2 py-1.5 text-left hover:bg-accent",o.id===t&&"bg-accent/60"),children:[x.jsx(vG,{className:"mt-0.5 w-3.5 h-3.5 shrink-0 text-muted-foreground"}),x.jsxs("span",{className:"min-w-0 flex-1",children:[x.jsx("span",{className:"block truncate text-[12px] font-medium text-foreground",children:o.title||i("pptx.ai.untitledChat")}),x.jsxs("span",{className:"block text-[10px] text-muted-foreground",children:[vIi(o.updatedAt)," ·"," ",i("pptx.ai.messageCount",{count:o.messageCount})]})]})]}),x.jsx("button",{type:"button",onClick:()=>r(o.id),title:i("pptx.ai.deleteChat"),"aria-label":i("pptx.ai.deleteChat"),className:"shrink-0 rounded-sm p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",children:x.jsx(Kp,{className:"w-3.5 h-3.5"})})]},o.id))})}function wIi({chats:e,activeChatId:t,onResume:n,onDelete:r,onNewChat:i,onClose:o}){const{t:a}=Ie(),s=P.useRef(null);return P.useEffect(()=>{const l=c=>{s.current&&!s.current.contains(c.target)&&o()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[o]),x.jsxs("div",{ref:s,className:"absolute right-2 top-10 z-40 w-64 rounded-md border border-border bg-popover shadow-xl",children:[x.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2.5 py-1.5",children:[x.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:a("pptx.ai.historyTitle")}),x.jsxs("button",{type:"button",onClick:()=>{i(),o()},className:"inline-flex items-center gap-1 rounded-sm bg-primary/90 px-1.5 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",children:[x.jsx(Ud,{className:"w-3 h-3"}),a("pptx.ai.newChat")]})]}),x.jsx(bIi,{chats:e,activeChatId:t,onResume:l=>{n(l),o()},onDelete:r}),x.jsx("p",{className:"border-t border-border px-2.5 py-1.5 text-[10px] text-muted-foreground",children:a("pptx.ai.historyHint")})]})}var SIi=new Set(["apply_theme_preset","update_theme_colors","update_theme_fonts"]);function CIi(e){if(!SIi.has(e.toolName)||e.state!=="output-available")return null;const t=e.output;return t?.applied?{summary:t.summary??"Theme updated",previous:t.previous??{}}:null}function TIi({summary:e,onUndo:t}){const{t:n}=Ie(),[r,i]=P.useState(!1);return x.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-primary/30 bg-primary/5 px-2.5 py-1.5 text-[12px]",children:[x.jsx(tge,{className:"w-3.5 h-3.5 shrink-0 text-primary"}),x.jsxs("span",{className:"min-w-0 flex-1 break-words text-foreground",children:[x.jsxs("span",{className:"font-medium text-primary",children:[n("pptx.ai.applied"),":"]})," ",e]}),!r&&x.jsxs("button",{type:"button",onClick:()=>{t(),i(!0)},className:"inline-flex shrink-0 items-center gap-1 rounded-sm px-1.5 py-0.5 text-[11px] text-muted-foreground hover:bg-accent hover:text-foreground",children:[x.jsx(cUr,{className:"w-3 h-3"}),n("pptx.ai.undo")]})]})}var AIi={view:VE,text:gm,shape:Zyt,theme:tge,table:hUr,slide:OUr,chart:ozr,move:Goe,delete:Kp,search:ege,nav:IUr,animation:XUr,notes:qyt,tool:Hyt};function EIi({part:e}){const{t}=Ie(),n=e.state==="output-error",r=e.state==="output-available",i=!n&&!r,o=fhi(e.toolName,e.input,i?"present":"past"),a=AIi[o.icon]??Hyt,s=dhi(e.input),l=t(n?"pptx.ai.toolFailed":r?"pptx.ai.toolDone":"pptx.ai.toolRunning");return x.jsxs("div",{className:"text-[12px]",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(a,{className:pt("w-3.5 h-3.5 shrink-0",n?"text-destructive":"text-muted-foreground")}),x.jsx("span",{className:pt("truncate",n?"text-destructive":"text-foreground"),children:o.label}),x.jsxs("span",{className:pt("ml-auto inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px]",n?"bg-destructive/15 text-destructive":r?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:[i&&x.jsx(nge,{className:"w-3 h-3 animate-spin"}),r&&x.jsx(zd,{className:"w-3 h-3"}),n&&x.jsx(jP,{className:"w-3 h-3"}),l]})]}),n&&e.errorText&&x.jsx("div",{className:"mt-1 pl-5 text-[11px] text-destructive",children:e.errorText}),s&&x.jsxs("details",{className:"group mt-0.5 pl-5",children:[x.jsx("summary",{className:"cursor-pointer list-none text-[10px] text-muted-foreground/70 hover:text-muted-foreground",children:t("pptx.ai.toolDetails")}),x.jsxs("div",{className:"mt-0.5 break-words font-mono text-[10px] text-muted-foreground/80",children:[S4t(e.toolName),": ",s]})]})]})}function kIi({messages:e,isStreaming:t,bridge:n}){const{t:r}=Ie(),i=P.useRef(null);return P.useEffect(()=>{i.current?.scrollIntoView({block:"end"})},[e,t]),e.length===0?x.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[x.jsx(gG,{className:"w-7 h-7 text-primary/70"}),x.jsx("p",{className:"text-sm font-medium text-foreground",children:r("pptx.ai.emptyTitle")}),x.jsx("p",{className:"text-[12px] text-muted-foreground",children:r("pptx.ai.emptyHint")})]}):x.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto px-3 py-3",children:[e.map(o=>{const a=o.role==="user",s=b4t(o);return s.length===0&&!a?null:x.jsxs("div",{className:"flex gap-2",children:[x.jsx("div",{className:pt("mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",a?"bg-secondary text-muted-foreground":"bg-primary/15 text-primary"),"aria-label":r(a?"pptx.ai.you":"pptx.ai.assistant"),children:a?x.jsx(Xyt,{className:"w-3.5 h-3.5"}):x.jsx(pzr,{className:"w-3.5 h-3.5"})}),x.jsx("div",{className:"min-w-0 flex-1 space-y-1.5",children:s.map((l,c)=>{if(l.kind==="text")return x.jsx("p",{className:"whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground",children:l.text},c);const u=CIi(l);return u?x.jsx(TIi,{summary:u.summary,onUndo:()=>n.applyTheme(u.previous)},l.toolCallId||c):x.jsx(EIi,{part:l},l.toolCallId||c)})})]},o.id)}),t&&x.jsxs("div",{className:"flex items-center gap-2 pl-8 text-[12px] text-muted-foreground",children:[x.jsxs("span",{className:"inline-flex gap-1",children:[x.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.2s]"}),x.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.1s]"}),x.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground"})]}),r("pptx.ai.thinking")]}),x.jsx("div",{ref:i})]})}function MIi({proposal:e,onAccept:t,onReject:n}){const{t:r}=Ie(),i=e.summary.map(spi);return x.jsxs("div",{className:"rounded-md border border-primary/40 bg-primary/5 p-2.5",children:[x.jsx("div",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary",children:r("pptx.ai.proposedChange")}),x.jsx("div",{className:"text-[12px] font-medium text-foreground",children:e.label}),i.length>0&&x.jsx("ul",{className:"mt-1 max-h-40 space-y-0.5 overflow-y-auto text-[11px] text-muted-foreground",children:i.map((o,a)=>x.jsx("li",{className:"break-words",children:o},a))}),x.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[x.jsxs("button",{type:"button",onClick:()=>t(e.id),className:"inline-flex items-center gap-1 rounded-sm bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[x.jsx(zd,{className:"w-3.5 h-3.5"}),r("pptx.ai.accept")]}),x.jsxs("button",{type:"button",onClick:()=>n(e.id),className:"inline-flex items-center gap-1 rounded-sm border border-border px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent",children:[x.jsx(yi,{className:"w-3.5 h-3.5"}),r("pptx.ai.reject")]})]})]})}function PIi({useChat:e,session:t,config:n,bridge:r,aiPanel:i,deckId:o}){const{t:a}=Ie(),s=hIi(e,t,n,r,{onToolTarget:y=>{y&&y.slideIndex!==void 0&&r.goToSlide(y.slideIndex),i.flashToolTarget(y)}}),l=gIi({deckId:o,messages:s.messages,setMessages:s.setMessages}),[c,u]=P.useState(!1),{showChangeBatch:d}=i;P.useEffect(()=>t.changeAnimator.subscribe(y=>{y&&r.goToSlide(y.slideIndex),d(y)}),[t,r,d]);const p=i.pickTargets.length>0,h=p?i.pickTargets:i.pinnedFocus??i.liveFocusTargets,f=!p&&i.pinnedFocus!==null,m=y=>{i.flashToolTarget(null),s.applyProposal(y)},g=()=>{i.flashToolTarget(null),s.acceptAllProposals()};return x.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[x.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1",children:[x.jsxs("button",{type:"button",onClick:()=>u(y=>!y),className:"inline-flex items-center gap-1 rounded-sm px-1.5 py-1 text-[12px] text-muted-foreground hover:bg-accent max-md:min-h-[44px]!",children:[x.jsx(nvt,{className:"w-3.5 h-3.5"}),a("pptx.ai.chats")]}),x.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[x.jsx("button",{type:"button",onClick:l.newChat,title:a("pptx.ai.newChat"),"aria-label":a("pptx.ai.newChat"),className:"rounded-sm p-1 text-muted-foreground hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:x.jsx(DUr,{className:"w-3.5 h-3.5"})}),x.jsx("button",{type:"button",onClick:l.clearCurrent,title:a("pptx.ai.clearChat"),"aria-label":a("pptx.ai.clearChat"),disabled:s.messages.length===0,className:"rounded-sm p-1 text-muted-foreground hover:bg-accent disabled:opacity-40 max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:x.jsx(Kp,{className:"w-3.5 h-3.5"})})]})]}),c&&x.jsx(wIi,{chats:l.chats,activeChatId:l.activeChatId,onResume:y=>void l.resumeChat(y),onDelete:y=>void l.deleteChat(y),onNewChat:l.newChat,onClose:()=>u(!1)}),x.jsx(yIi,{targets:h,slides:r.getSlides(),isPinned:f,onPin:i.pinFocus,onClearPin:i.clearPinnedFocus,onSendDirective:s.send,pickMode:i.pickMode,hasPicks:p,onStartPick:i.startPicking,onStopPick:i.stopPicking,onClearPicks:i.clearPicks}),x.jsx(kIi,{messages:s.messages,isStreaming:s.isStreaming,bridge:r}),s.error&&x.jsxs("div",{className:"mx-3 mb-2 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-1.5 text-[12px] text-destructive",children:[x.jsx(jP,{className:"mt-0.5 w-3.5 h-3.5 shrink-0"}),x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("div",{className:"font-medium",children:a("pptx.ai.errorPrefix")}),x.jsx("div",{className:"max-h-24 overflow-y-auto break-words text-[11px] opacity-80",children:s.error.message})]}),x.jsx("button",{type:"button",onClick:s.clearError,className:"shrink-0 rounded-sm px-1.5 py-0.5 text-[11px] underline-offset-2 hover:underline",children:a("pptx.ai.retry")})]}),s.proposals.length>0&&x.jsxs("div",{className:"max-h-[38%] space-y-2 overflow-y-auto border-t border-border bg-background px-3 py-2",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:a("pptx.ai.pendingChanges",{count:s.proposals.length})}),s.proposals.length>1&&x.jsx("button",{type:"button",onClick:g,className:"rounded-sm bg-primary/90 px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",children:a("pptx.ai.acceptAll")})]}),s.proposals.map(y=>x.jsx(MIi,{proposal:y,onAccept:m,onReject:s.rejectProposal},y.id))]}),x.jsx(xIi,{isStreaming:s.isStreaming,onSend:s.send,onStop:s.stop,prefillText:i.prefill.text,prefillNonce:i.prefill.nonce})]})}function IIi({useChat:e,bridge:t,config:n,aiPanel:r,onClose:i,panelWidth:o}){const{t:a}=Ie(),{state:s,session:l,initError:c}=cIi(t,n),u=P.useMemo(()=>ahi(t),[t]);return x.jsxs("div",{"data-pptx-ai-panel":"",className:"absolute right-0 top-0 z-30 flex h-full w-80 flex-col border-l border-border bg-card shadow-xl max-md:inset-x-0 max-md:top-auto max-md:bottom-0 max-md:h-[75dvh] max-md:w-full max-md:rounded-t-2xl max-md:border-l-0 max-md:border-t max-md:shadow-2xl",style:o?{width:o}:void 0,children:[x.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[x.jsx(gG,{className:"w-4 h-4 text-primary"}),x.jsx("span",{className:"text-sm font-semibold text-foreground",children:a("pptx.ai.title")}),x.jsx("button",{type:"button",onClick:i,title:a("pptx.ai.close"),"aria-label":a("pptx.ai.close"),className:"ml-auto rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:x.jsx(yi,{className:"w-4 h-4"})})]}),s==="checking"&&x.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground",children:x.jsx(nge,{className:"w-5 h-5 animate-spin"})}),(s==="unavailable"||s==="error")&&x.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[x.jsx(jP,{className:"w-6 h-6 text-muted-foreground"}),x.jsx("p",{className:"text-sm font-medium text-foreground",children:a("pptx.ai.unavailableTitle")}),x.jsx("p",{className:"text-[12px] text-muted-foreground",children:c?.message??a("pptx.ai.unavailableHint")})]}),s==="ready"&&l&&x.jsx(PIi,{useChat:e,session:l,config:n,bridge:t,aiPanel:r,deckId:u})]})}const _Ii=Object.freeze(Object.defineProperty({__proto__:null,default:IIi},Symbol.toStringTag,{value:"Module"}));export{SVn as L,D1i as P,VIi as a,BR as c,Lc as i,OIi as k,FIi as p,ca as t};
11311
+ ${t}`},o=e.slice();return o[n]={...r,parts:[i,...r.parts]},o}function dIi(e){for(let t=e.length-1;t>=0;t--)if(e[t].role==="user")return t;return-1}function pIi(e,t,n){return{async sendMessages(r){if(n==="none"&&!t.getFocusedTargets)return e.sendMessages(r);let i="";try{i=await ipi(t,{strategy:n,focus:{}})}catch{i=""}return i.trim()?e.sendMessages({...r,messages:uIi(r.messages,i)}):e.sendMessages(r)},reconnectToStream(r){return e.reconnectToStream(r)}}}function hIi(e,t,n,r,i={}){const[,o]=P.useReducer(y=>y+1,0),a=P.useRef(null),s=P.useRef(i.onToolTarget);s.current=i.onToolTarget;const l=P.useRef(new Set),c=t.clientExecutesTools,u=P.useMemo(()=>pIi(t.transport,r,n.contextStrategy??"outline"),[t,r,n.contextStrategy]),d=e({transport:u,sendAutomaticallyWhen:c?t.sendAutomaticallyWhen:void 0,onError:y=>n.onError?.(y),onToolCall:c?async({toolCall:y})=>{const{toolName:v,toolCallId:b,input:w}=y,S=a.current;if(!S)return;const T=S.addToolOutput;try{const A=await t.executeToolCall(v,w);T({tool:v,toolCallId:b,output:A})}catch(A){T({tool:v,toolCallId:b,state:"output-error",errorText:A instanceof Error?A.message:String(A)})}o()}:void 0});a.current=d,P.useEffect(()=>{const y=l.current;for(const v of qOe(d.messages))y.has(v.toolCallId)||(y.add(v.toolCallId),s.current?.(mhi(v.toolName,v.input)))},[d.messages]);const p=P.useCallback(y=>{const v=y.trim();v.length!==0&&d.sendMessage({text:v})},[d]),h=P.useCallback(y=>{t.proposals.apply(y),o()},[t]),f=P.useCallback(y=>{t.proposals.revert(y),o()},[t]),m=P.useCallback(()=>{t.proposals.acceptAll(),o()},[t]),g=P.useCallback(y=>{d.setMessages(y);for(const v of qOe(y))l.current.add(v.toolCallId);t.proposals.clear(),o()},[d,t]);return{messages:d.messages,status:d.status,error:d.error,isStreaming:d.status==="submitted"||d.status==="streaming",send:p,stop:()=>void d.stop(),setMessages:g,clearError:()=>d.clearError(),proposals:t.proposals.list(),applyProposal:h,rejectProposal:f,acceptAllProposals:m}}var fIi=800,Y9e=40;function oO(){return`chat-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function mIi(e){for(const t of e){if(t.role!=="user")continue;const n=t.parts.filter(r=>r.type==="text").map(r=>r.text).join(" ").trim();if(n)return n.length>Y9e?`${n.slice(0,Y9e).trimEnd()}…`:n}return""}function gIi(e){const{deckId:t,messages:n,setMessages:r}=e,i=P.useMemo(()=>e.store??PG(),[e.store]),[o,a]=P.useState(oO),[s,l]=P.useState([]),c=P.useRef(Date.now()),u=P.useRef(null),d=P.useCallback(async()=>{l(await i.listChats({deckId:t}))},[i,t]);P.useEffect(()=>{a(oO()),c.current=Date.now(),d()},[d]),P.useEffect(()=>{if(n.length!==0)return u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{(async()=>(await i.saveChat({id:o,title:mIi(n)||"Untitled chat",deckId:t,messages:n,createdAt:c.current,updatedAt:Date.now()}),await d()))()},fIi),()=>{u.current&&clearTimeout(u.current)}},[n,o,t,i,d]);const p=P.useCallback(()=>{a(oO()),c.current=Date.now(),r([])},[r]),h=P.useCallback(()=>{r([])},[r]),f=P.useCallback(async g=>{const y=await i.loadChat(g);y&&(a(y.id),c.current=y.createdAt,r(y.messages))},[i,r]),m=P.useCallback(async g=>{await i.deleteChat(g),g===o&&(a(oO()),c.current=Date.now(),r([])),await d()},[i,o,r,d]);return{chats:s,activeChatId:o,refresh:d,newChat:p,resumeChat:f,clearCurrent:h,deleteChat:m}}function xIi({isStreaming:e,onSend:t,onStop:n,prefillText:r,prefillNonce:i}){const{t:o}=Ie(),[a,s]=P.useState(""),l=P.useRef(null),c=P.useRef(void 0);P.useEffect(()=>{i===void 0||i===c.current||(c.current=i,r&&s(r),l.current?.focus())},[i,r]);const u=P.useCallback(()=>{const p=a.trim();p.length===0||e||(t(p),s(""))},[a,e,t]),d=P.useCallback(p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),u())},[u]);return x.jsx("div",{className:"border-t border-border p-2",children:x.jsxs("div",{className:"flex items-end gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 focus-within:border-ring",children:[x.jsx("textarea",{ref:l,value:a,onChange:p=>s(p.target.value),onKeyDown:d,rows:1,placeholder:o("pptx.ai.placeholder"),"aria-label":o("pptx.ai.placeholder"),className:"max-h-32 min-h-[1.5rem] flex-1 resize-none bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground"}),e?x.jsx("button",{type:"button",onClick:n,title:o("pptx.ai.stop"),"aria-label":o("pptx.ai.stop"),className:"shrink-0 rounded-sm p-1.5 text-muted-foreground transition-colors hover:bg-accent",children:x.jsx(Kyt,{className:"w-4 h-4"})}):x.jsx("button",{type:"button",onClick:u,disabled:a.trim().length===0,title:o("pptx.ai.send"),"aria-label":o("pptx.ai.send"),className:pt("shrink-0 rounded-sm p-1.5 transition-colors",a.trim().length===0?"text-muted-foreground/50":"bg-primary text-primary-foreground hover:bg-primary/90"),children:x.jsx(gUr,{className:"w-4 h-4"})})]})})}function yIi({targets:e,slides:t,isPinned:n,onPin:r,onClearPin:i,onSendDirective:o,pickMode:a,hasPicks:s,onStartPick:l,onStopPick:c,onClearPicks:u}){const{t:d}=Ie(),p=rhi(e,t),h=ihi(e,t);return x.jsxs("div",{className:"border-b border-border bg-secondary/30",children:[x.jsxs("div",{className:"flex flex-wrap items-center gap-1 px-2.5 py-1.5",children:[x.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:d("pptx.ai.focusScope")}),p.map(f=>x.jsx("span",{className:pt("inline-flex max-w-[10rem] items-center rounded-full px-2 py-0.5 text-[11px]",s||n?"bg-primary/15 text-primary":"bg-muted text-muted-foreground"),title:f.title,children:x.jsx("span",{className:"truncate",children:f.label})},f.key)),n&&x.jsx("span",{className:"rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:d("pptx.ai.pinnedFocus")}),x.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[h&&x.jsxs("button",{type:"button",onClick:()=>o(ohi(h.slideIndex,h.elementIdA,h.elementIdB)),className:"inline-flex items-center gap-1 rounded-sm bg-primary/90 px-1.5 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary max-md:min-h-[44px]!",children:[x.jsx(VUr,{className:"w-3 h-3"}),d("pptx.ai.mergeSelectedTables")]}),x.jsx("button",{type:"button",onClick:a?c:l,title:d("pptx.ai.pickElement"),"aria-label":d("pptx.ai.pickAria"),"aria-pressed":a,className:pt("rounded-sm p-1 max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",a?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:x.jsx(L6e,{className:"w-3.5 h-3.5"})}),s&&x.jsx("button",{type:"button",onClick:u,title:d("pptx.ai.pickClear"),"aria-label":d("pptx.ai.pickClear"),className:"rounded-sm p-1 text-muted-foreground hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:x.jsx(yi,{className:"w-3.5 h-3.5"})}),!s&&x.jsx("button",{type:"button",onClick:n?i:r,title:d(n?"pptx.ai.clearFocus":"pptx.ai.pinFocus"),"aria-label":d(n?"pptx.ai.clearFocus":"pptx.ai.pinFocus"),className:"rounded-sm p-1 text-muted-foreground hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:n?x.jsx(TUr,{className:"w-3.5 h-3.5"}):x.jsx(CUr,{className:"w-3.5 h-3.5"})})]})]}),a&&x.jsxs("div",{className:"flex items-center gap-2 border-t border-primary/20 bg-primary/5 px-2.5 py-1",children:[x.jsx(L6e,{className:"w-3.5 h-3.5 shrink-0 animate-pulse text-primary"}),x.jsx("span",{className:"text-[11px] font-medium text-primary",children:d("pptx.ai.pickElementHint")}),x.jsx("button",{type:"button",onClick:c,className:"ml-auto rounded-sm bg-primary px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary/90",children:d("pptx.ai.pickDone")})]})]})}function vIi(e,t=Date.now()){const n=Math.max(0,Math.round((t-e)/1e3));if(n<45)return"just now";const r=Math.round(n/60);if(r<60)return`${r}m ago`;const i=Math.round(r/60);if(i<24)return`${i}h ago`;const o=Math.round(i/24);return o<7?`${o}d ago`:`${Math.round(o/7)}w ago`}function bIi({chats:e,activeChatId:t,onResume:n,onDelete:r}){const{t:i}=Ie();return e.length===0?x.jsx("p",{className:"px-3 py-4 text-center text-[12px] text-muted-foreground",children:i("pptx.ai.historyEmpty")}):x.jsx("ul",{className:"max-h-64 overflow-y-auto py-1",children:e.map(o=>x.jsxs("li",{className:"group flex items-center gap-1 px-1",children:[x.jsxs("button",{type:"button",onClick:()=>n(o.id),className:pt("flex min-w-0 flex-1 items-start gap-2 rounded-sm px-2 py-1.5 text-left hover:bg-accent",o.id===t&&"bg-accent/60"),children:[x.jsx(vG,{className:"mt-0.5 w-3.5 h-3.5 shrink-0 text-muted-foreground"}),x.jsxs("span",{className:"min-w-0 flex-1",children:[x.jsx("span",{className:"block truncate text-[12px] font-medium text-foreground",children:o.title||i("pptx.ai.untitledChat")}),x.jsxs("span",{className:"block text-[10px] text-muted-foreground",children:[vIi(o.updatedAt)," ·"," ",i("pptx.ai.messageCount",{count:o.messageCount})]})]})]}),x.jsx("button",{type:"button",onClick:()=>r(o.id),title:i("pptx.ai.deleteChat"),"aria-label":i("pptx.ai.deleteChat"),className:"shrink-0 rounded-sm p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",children:x.jsx(Kp,{className:"w-3.5 h-3.5"})})]},o.id))})}function wIi({chats:e,activeChatId:t,onResume:n,onDelete:r,onNewChat:i,onClose:o}){const{t:a}=Ie(),s=P.useRef(null);return P.useEffect(()=>{const l=c=>{s.current&&!s.current.contains(c.target)&&o()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[o]),x.jsxs("div",{ref:s,className:"absolute right-2 top-10 z-40 w-64 rounded-md border border-border bg-popover shadow-xl",children:[x.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2.5 py-1.5",children:[x.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:a("pptx.ai.historyTitle")}),x.jsxs("button",{type:"button",onClick:()=>{i(),o()},className:"inline-flex items-center gap-1 rounded-sm bg-primary/90 px-1.5 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",children:[x.jsx(Ud,{className:"w-3 h-3"}),a("pptx.ai.newChat")]})]}),x.jsx(bIi,{chats:e,activeChatId:t,onResume:l=>{n(l),o()},onDelete:r}),x.jsx("p",{className:"border-t border-border px-2.5 py-1.5 text-[10px] text-muted-foreground",children:a("pptx.ai.historyHint")})]})}var SIi=new Set(["apply_theme_preset","update_theme_colors","update_theme_fonts"]);function CIi(e){if(!SIi.has(e.toolName)||e.state!=="output-available")return null;const t=e.output;return t?.applied?{summary:t.summary??"Theme updated",previous:t.previous??{}}:null}function TIi({summary:e,onUndo:t}){const{t:n}=Ie(),[r,i]=P.useState(!1);return x.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-primary/30 bg-primary/5 px-2.5 py-1.5 text-[12px]",children:[x.jsx(tge,{className:"w-3.5 h-3.5 shrink-0 text-primary"}),x.jsxs("span",{className:"min-w-0 flex-1 break-words text-foreground",children:[x.jsxs("span",{className:"font-medium text-primary",children:[n("pptx.ai.applied"),":"]})," ",e]}),!r&&x.jsxs("button",{type:"button",onClick:()=>{t(),i(!0)},className:"inline-flex shrink-0 items-center gap-1 rounded-sm px-1.5 py-0.5 text-[11px] text-muted-foreground hover:bg-accent hover:text-foreground",children:[x.jsx(cUr,{className:"w-3 h-3"}),n("pptx.ai.undo")]})]})}var AIi={view:VE,text:gm,shape:Zyt,theme:tge,table:hUr,slide:OUr,chart:ozr,move:Goe,delete:Kp,search:ege,nav:IUr,animation:XUr,notes:qyt,tool:Hyt};function EIi({part:e}){const{t}=Ie(),n=e.state==="output-error",r=e.state==="output-available",i=!n&&!r,o=fhi(e.toolName,e.input,i?"present":"past"),a=AIi[o.icon]??Hyt,s=dhi(e.input),l=t(n?"pptx.ai.toolFailed":r?"pptx.ai.toolDone":"pptx.ai.toolRunning");return x.jsxs("div",{className:"text-[12px]",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(a,{className:pt("w-3.5 h-3.5 shrink-0",n?"text-destructive":"text-muted-foreground")}),x.jsx("span",{className:pt("truncate",n?"text-destructive":"text-foreground"),children:o.label}),x.jsxs("span",{className:pt("ml-auto inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px]",n?"bg-destructive/15 text-destructive":r?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:[i&&x.jsx(nge,{className:"w-3 h-3 animate-spin"}),r&&x.jsx(zd,{className:"w-3 h-3"}),n&&x.jsx(jP,{className:"w-3 h-3"}),l]})]}),n&&e.errorText&&x.jsx("div",{className:"mt-1 pl-5 text-[11px] text-destructive",children:e.errorText}),s&&x.jsxs("details",{className:"group mt-0.5 pl-5",children:[x.jsx("summary",{className:"cursor-pointer list-none text-[10px] text-muted-foreground/70 hover:text-muted-foreground",children:t("pptx.ai.toolDetails")}),x.jsxs("div",{className:"mt-0.5 break-words font-mono text-[10px] text-muted-foreground/80",children:[S4t(e.toolName),": ",s]})]})]})}function kIi({messages:e,isStreaming:t,bridge:n}){const{t:r}=Ie(),i=P.useRef(null);return P.useEffect(()=>{i.current?.scrollIntoView({block:"end"})},[e,t]),e.length===0?x.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[x.jsx(gG,{className:"w-7 h-7 text-primary/70"}),x.jsx("p",{className:"text-sm font-medium text-foreground",children:r("pptx.ai.emptyTitle")}),x.jsx("p",{className:"text-[12px] text-muted-foreground",children:r("pptx.ai.emptyHint")})]}):x.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto px-3 py-3",children:[e.map(o=>{const a=o.role==="user",s=b4t(o);return s.length===0&&!a?null:x.jsxs("div",{className:"flex gap-2",children:[x.jsx("div",{className:pt("mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",a?"bg-secondary text-muted-foreground":"bg-primary/15 text-primary"),"aria-label":r(a?"pptx.ai.you":"pptx.ai.assistant"),children:a?x.jsx(Xyt,{className:"w-3.5 h-3.5"}):x.jsx(pzr,{className:"w-3.5 h-3.5"})}),x.jsx("div",{className:"min-w-0 flex-1 space-y-1.5",children:s.map((l,c)=>{if(l.kind==="text")return x.jsx("p",{className:"whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground",children:l.text},c);const u=CIi(l);return u?x.jsx(TIi,{summary:u.summary,onUndo:()=>n.applyTheme(u.previous)},l.toolCallId||c):x.jsx(EIi,{part:l},l.toolCallId||c)})})]},o.id)}),t&&x.jsxs("div",{className:"flex items-center gap-2 pl-8 text-[12px] text-muted-foreground",children:[x.jsxs("span",{className:"inline-flex gap-1",children:[x.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.2s]"}),x.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.1s]"}),x.jsx("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground"})]}),r("pptx.ai.thinking")]}),x.jsx("div",{ref:i})]})}function MIi({proposal:e,onAccept:t,onReject:n}){const{t:r}=Ie(),i=e.summary.map(spi);return x.jsxs("div",{className:"rounded-md border border-primary/40 bg-primary/5 p-2.5",children:[x.jsx("div",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-primary",children:r("pptx.ai.proposedChange")}),x.jsx("div",{className:"text-[12px] font-medium text-foreground",children:e.label}),i.length>0&&x.jsx("ul",{className:"mt-1 max-h-40 space-y-0.5 overflow-y-auto text-[11px] text-muted-foreground",children:i.map((o,a)=>x.jsx("li",{className:"break-words",children:o},a))}),x.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[x.jsxs("button",{type:"button",onClick:()=>t(e.id),className:"inline-flex items-center gap-1 rounded-sm bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[x.jsx(zd,{className:"w-3.5 h-3.5"}),r("pptx.ai.accept")]}),x.jsxs("button",{type:"button",onClick:()=>n(e.id),className:"inline-flex items-center gap-1 rounded-sm border border-border px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent",children:[x.jsx(yi,{className:"w-3.5 h-3.5"}),r("pptx.ai.reject")]})]})]})}function PIi({useChat:e,session:t,config:n,bridge:r,aiPanel:i,deckId:o}){const{t:a}=Ie(),s=hIi(e,t,n,r,{onToolTarget:y=>{y&&y.slideIndex!==void 0&&r.goToSlide(y.slideIndex),i.flashToolTarget(y)}}),l=gIi({deckId:o,messages:s.messages,setMessages:s.setMessages}),[c,u]=P.useState(!1),{showChangeBatch:d}=i;P.useEffect(()=>t.changeAnimator.subscribe(y=>{y&&r.goToSlide(y.slideIndex),d(y)}),[t,r,d]);const p=i.pickTargets.length>0,h=p?i.pickTargets:i.pinnedFocus??i.liveFocusTargets,f=!p&&i.pinnedFocus!==null,m=y=>{i.flashToolTarget(null),s.applyProposal(y)},g=()=>{i.flashToolTarget(null),s.acceptAllProposals()};return x.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[x.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1",children:[x.jsxs("button",{type:"button",onClick:()=>u(y=>!y),className:"inline-flex items-center gap-1 rounded-sm px-1.5 py-1 text-[12px] text-muted-foreground hover:bg-accent max-md:min-h-[44px]!",children:[x.jsx(nvt,{className:"w-3.5 h-3.5"}),a("pptx.ai.chats")]}),x.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[x.jsx("button",{type:"button",onClick:l.newChat,title:a("pptx.ai.newChat"),"aria-label":a("pptx.ai.newChat"),className:"rounded-sm p-1 text-muted-foreground hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:x.jsx(DUr,{className:"w-3.5 h-3.5"})}),x.jsx("button",{type:"button",onClick:l.clearCurrent,title:a("pptx.ai.clearChat"),"aria-label":a("pptx.ai.clearChat"),disabled:s.messages.length===0,className:"rounded-sm p-1 text-muted-foreground hover:bg-accent disabled:opacity-40 max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:x.jsx(Kp,{className:"w-3.5 h-3.5"})})]})]}),c&&x.jsx(wIi,{chats:l.chats,activeChatId:l.activeChatId,onResume:y=>void l.resumeChat(y),onDelete:y=>void l.deleteChat(y),onNewChat:l.newChat,onClose:()=>u(!1)}),x.jsx(yIi,{targets:h,slides:r.getSlides(),isPinned:f,onPin:i.pinFocus,onClearPin:i.clearPinnedFocus,onSendDirective:s.send,pickMode:i.pickMode,hasPicks:p,onStartPick:i.startPicking,onStopPick:i.stopPicking,onClearPicks:i.clearPicks}),x.jsx(kIi,{messages:s.messages,isStreaming:s.isStreaming,bridge:r}),s.error&&x.jsxs("div",{className:"mx-3 mb-2 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-1.5 text-[12px] text-destructive",children:[x.jsx(jP,{className:"mt-0.5 w-3.5 h-3.5 shrink-0"}),x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("div",{className:"font-medium",children:a("pptx.ai.errorPrefix")}),x.jsx("div",{className:"max-h-24 overflow-y-auto break-words text-[11px] opacity-80",children:s.error.message})]}),x.jsx("button",{type:"button",onClick:s.clearError,className:"shrink-0 rounded-sm px-1.5 py-0.5 text-[11px] underline-offset-2 hover:underline",children:a("pptx.ai.retry")})]}),s.proposals.length>0&&x.jsxs("div",{className:"max-h-[38%] space-y-2 overflow-y-auto border-t border-border bg-background px-3 py-2",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:a("pptx.ai.pendingChanges",{count:s.proposals.length})}),s.proposals.length>1&&x.jsx("button",{type:"button",onClick:g,className:"rounded-sm bg-primary/90 px-2 py-0.5 text-[11px] font-medium text-primary-foreground hover:bg-primary",children:a("pptx.ai.acceptAll")})]}),s.proposals.map(y=>x.jsx(MIi,{proposal:y,onAccept:m,onReject:s.rejectProposal},y.id))]}),x.jsx(xIi,{isStreaming:s.isStreaming,onSend:s.send,onStop:s.stop,prefillText:i.prefill.text,prefillNonce:i.prefill.nonce})]})}function IIi({useChat:e,bridge:t,config:n,aiPanel:r,onClose:i,panelWidth:o}){const{t:a}=Ie(),{state:s,session:l,initError:c}=cIi(t,n),u=P.useMemo(()=>ahi(t),[t]);return x.jsxs("div",{"data-pptx-ai-panel":"",className:"absolute right-0 top-0 z-30 flex h-full w-80 flex-col border-l border-border bg-card shadow-xl max-md:inset-x-0 max-md:top-auto max-md:bottom-0 max-md:h-[75dvh] max-md:w-full max-md:rounded-t-2xl max-md:border-l-0 max-md:border-t max-md:shadow-2xl",style:o?{width:o}:void 0,children:[x.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[x.jsx(gG,{className:"w-4 h-4 text-primary"}),x.jsx("span",{className:"text-sm font-semibold text-foreground",children:a("pptx.ai.title")}),x.jsx("button",{type:"button",onClick:i,title:a("pptx.ai.close"),"aria-label":a("pptx.ai.close"),className:"ml-auto rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent max-md:min-w-[44px]! max-md:min-h-[44px]! flex items-center justify-center",children:x.jsx(yi,{className:"w-4 h-4"})})]}),s==="checking"&&x.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground",children:x.jsx(nge,{className:"w-5 h-5 animate-spin"})}),(s==="unavailable"||s==="error")&&x.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[x.jsx(jP,{className:"w-6 h-6 text-muted-foreground"}),x.jsx("p",{className:"text-sm font-medium text-foreground",children:a("pptx.ai.unavailableTitle")}),x.jsx("p",{className:"text-[12px] text-muted-foreground",children:c?.message??a("pptx.ai.unavailableHint")})]}),s==="ready"&&l&&x.jsx(PIi,{useChat:e,session:l,config:n,bridge:t,aiPanel:r,deckId:u})]})}const _Ii=Object.freeze(Object.defineProperty({__proto__:null,default:IIi},Symbol.toStringTag,{value:"Module"}));export{D1i as P,VIi as a,BR as c,Lc as i,OIi as k,FIi as p,ca as t};