local-operator-ui 0.41.1 → 0.41.2

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 (80) hide show
  1. package/out/main/index.js +390 -26
  2. package/out/preload/index.js +19 -0
  3. package/out/renderer/assets/{_basePickBy-BP7Q8i4W.js → _basePickBy-BgapP5T6.js} +1 -1
  4. package/out/renderer/assets/{_baseUniq-D36dAcoY.js → _baseUniq-B9rnfho3.js} +1 -1
  5. package/out/renderer/assets/{agent-details-page-D3ljlPdf.js → agent-details-page-CKRUVtjJ.js} +1 -1
  6. package/out/renderer/assets/{agent-hub-page-BMyIHnNM.js → agent-hub-page-5qLVOZEV.js} +1 -1
  7. package/out/renderer/assets/{agents-page-mMqgQd2V.js → agents-page-tQooOOKH.js} +3 -3
  8. package/out/renderer/assets/{arc-GVvow4so.js → arc-Feq-cl9G.js} +1 -1
  9. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-BjGwXAtH.js → architectureDiagram-IEHRJDOE-BmZeJuzA.js} +1 -1
  10. package/out/renderer/assets/{blockDiagram-JOT3LUYC-BTuigKlt.js → blockDiagram-JOT3LUYC-DEqkKuOE.js} +1 -1
  11. package/out/renderer/assets/{browser-page-B3mjDx8k.js → browser-page-CB-_usY1.js} +1 -1
  12. package/out/renderer/assets/{browser-webauthn-prompt-CzYoJfO4.js → browser-webauthn-prompt-CKUBOIHd.js} +1 -1
  13. package/out/renderer/assets/{c4Diagram-VJAJSXHY-DK7eaKE8.js → c4Diagram-VJAJSXHY-EbhUbSdf.js} +1 -1
  14. package/out/renderer/assets/channel-CPGK3lub.js +1 -0
  15. package/out/renderer/assets/{chunk-4BMEZGHF-DkQrsDhM.js → chunk-4BMEZGHF-DIk7XDrx.js} +1 -1
  16. package/out/renderer/assets/{chunk-A2AXSNBT-guh0INPR.js → chunk-A2AXSNBT-D_MflthZ.js} +1 -1
  17. package/out/renderer/assets/{chunk-AEK57VVT-DvgIx6-r.js → chunk-AEK57VVT-C0iLgwbv.js} +1 -1
  18. package/out/renderer/assets/{chunk-D6G4REZN-FNdvnFYo.js → chunk-D6G4REZN-BbFuFCzc.js} +1 -1
  19. package/out/renderer/assets/{chunk-RZ5BOZE2-CgCQC9Mn.js → chunk-RZ5BOZE2-BxQo8VeZ.js} +1 -1
  20. package/out/renderer/assets/{chunk-XZIHB7SX-D1VRTTc4.js → chunk-XZIHB7SX-DnNtYGsR.js} +1 -1
  21. package/out/renderer/assets/classDiagram-GIVACNV2-hDc6ku-l.js +1 -0
  22. package/out/renderer/assets/classDiagram-v2-COTLJTTW-hDc6ku-l.js +1 -0
  23. package/out/renderer/assets/clone--PuuOIog.js +1 -0
  24. package/out/renderer/assets/{console-mirror-DRkz3vUY.js → console-mirror-Bxl6t4e9.js} +1 -1
  25. package/out/renderer/assets/{consoleCapture-BJfSUatx.js → consoleCapture-BzSftKjg.js} +1 -1
  26. package/out/renderer/assets/{conversation-input-sync-CJU5GIzR.js → conversation-input-sync-MZPvyAzc.js} +239 -239
  27. package/out/renderer/assets/{dagre-OKDRZEBW-DeeYQh6O.js → dagre-OKDRZEBW-qejdp-TF.js} +1 -1
  28. package/out/renderer/assets/{diagram-SSKATNLV-DD-xNxKH.js → diagram-SSKATNLV-qHrLhzXc.js} +1 -1
  29. package/out/renderer/assets/{diagram-VNBRO52H-YAoPlXaR.js → diagram-VNBRO52H-q0teJTmh.js} +1 -1
  30. package/out/renderer/assets/{erDiagram-Q7BY3M3F-OKzGXyMI.js → erDiagram-Q7BY3M3F-DI6rp9FR.js} +1 -1
  31. package/out/renderer/assets/{flowDiagram-4HSFHLVR-BG-3pPqS.js → flowDiagram-4HSFHLVR-xVi21DAI.js} +1 -1
  32. package/out/renderer/assets/{ganttDiagram-APWFNJXF-CRyD5vsE.js → ganttDiagram-APWFNJXF-BUKGBOB_.js} +1 -1
  33. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-aly2C__q.js → gitGraphDiagram-7IBYFJ6S-CdE3ZeMn.js} +1 -1
  34. package/out/renderer/assets/{graph-CCWwMmhg.js → graph-CRaHrZRK.js} +1 -1
  35. package/out/renderer/assets/{index-BaNzqqGN.js → index-B9E-fwX4.js} +1 -1
  36. package/out/renderer/assets/{index-CRjnV9wx.js → index-DknTGnAk.js} +208 -208
  37. package/out/renderer/assets/{index-DaCf2W9T.js → index-FsaxlHdZ.js} +1 -1
  38. package/out/renderer/assets/{infoDiagram-PH2N3AL5-BY536sF5.js → infoDiagram-PH2N3AL5-pOK9P20l.js} +1 -1
  39. package/out/renderer/assets/{journeyDiagram-U35MCT3I-DGvx__t6.js → journeyDiagram-U35MCT3I-D5Sg1JPA.js} +1 -1
  40. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-CG2Lgkpw.js → kanban-definition-NDS4AKOZ-BfhWqBCl.js} +1 -1
  41. package/out/renderer/assets/{layout-vpRrwE7T.js → layout-IqsTm240.js} +1 -1
  42. package/out/renderer/assets/{legacy-agents-page-D6Yma1Gm.js → legacy-agents-page-bdH6oKjE.js} +5 -5
  43. package/out/renderer/assets/{library-page-B0gC-rRh.js → library-page-DDvrG_aA.js} +3 -3
  44. package/out/renderer/assets/{mermaid.core-COeGB8I0.js → mermaid.core-D0YPuNli.js} +5 -5
  45. package/out/renderer/assets/{mesh-page-PabU05tN.js → mesh-page-DYFNof_0.js} +1 -1
  46. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-B0hkjZLY.js → mindmap-definition-ALO5MXBD-Tx5iMDRU.js} +1 -1
  47. package/out/renderer/assets/{mini-Df5C4rpd.js → mini-BoZCnSK9.js} +1 -1
  48. package/out/renderer/assets/{org-access-BacMtLkn.js → org-access-DoZK5gF3.js} +1 -1
  49. package/out/renderer/assets/{org-surface-gate-tkB025lu.js → org-surface-gate-Dy0B7mtt.js} +1 -1
  50. package/out/renderer/assets/path-utils-CRYGE4mK.js +58 -0
  51. package/out/renderer/assets/{pieDiagram-IB7DONF6-DfFtQXU5.js → pieDiagram-IB7DONF6-D0rED3_3.js} +1 -1
  52. package/out/renderer/assets/{projects-page-CoHTKLZH.js → projects-page-D7j1GOvI.js} +1 -1
  53. package/out/renderer/assets/{publication-validation-B0Mf3mmP.js → publication-validation-CLbFS0n9.js} +1 -1
  54. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-C4eDJWaK.js → quadrantDiagram-7GDLP6J5-D8jKSQt5.js} +1 -1
  55. package/out/renderer/assets/{radar-MK3ICKWK-BEv1HS9Q.js → radar-MK3ICKWK-Co2EJbaJ.js} +1 -1
  56. package/out/renderer/assets/{radient-auth-buttons-BX5vf982.js → radient-auth-buttons-B11cdRmS.js} +1 -1
  57. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-B7f3qUcB.js → requirementDiagram-KVF5MWMF-BI13h11j.js} +1 -1
  58. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-xM7E-74l.js → sankeyDiagram-QLVOVGJD-D4hZ6_ML.js} +1 -1
  59. package/out/renderer/assets/{schedules-page-5q7pvL1H.js → schedules-page-DFfDDHYC.js} +1 -1
  60. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-upwR02kU.js → sequenceDiagram-X6HHIX6F-U6CqBtco.js} +1 -1
  61. package/out/renderer/assets/{settings-page-DcnGr-GP.js → settings-page-CZ7NUDoe.js} +9 -9
  62. package/out/renderer/assets/{smartart-CYnMNs5u.js → smartart-BVm_cEaq.js} +1 -1
  63. package/out/renderer/assets/{stateDiagram-DGXRK772-BqTri7Q-.js → stateDiagram-DGXRK772-DBg11bkx.js} +1 -1
  64. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-jmaink9i.js +1 -0
  65. package/out/renderer/assets/team-bridge-page-u_OqiZGS.js +16 -0
  66. package/out/renderer/assets/{timeline-definition-BDJGKUSR-Bi2is17s.js → timeline-definition-BDJGKUSR-WQ6aYia6.js} +1 -1
  67. package/out/renderer/assets/{use-download-agent-mutation-PHtokPlg.js → use-download-agent-mutation-ZoivWizY.js} +2 -2
  68. package/out/renderer/assets/{use-session-snapshot-B5sxthdQ.js → use-session-snapshot-CdYiirKJ.js} +1 -1
  69. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-B0TrjzLJ.js → xychartDiagram-VJFVF3MP-f11BpHer.js} +1 -1
  70. package/out/renderer/console-capture.html +3 -3
  71. package/out/renderer/index.html +4 -4
  72. package/out/renderer/mini.html +4 -4
  73. package/package.json +4 -3
  74. package/out/renderer/assets/channel-B05rL6In.js +0 -1
  75. package/out/renderer/assets/classDiagram-GIVACNV2-DpB8-8cT.js +0 -1
  76. package/out/renderer/assets/classDiagram-v2-COTLJTTW-DpB8-8cT.js +0 -1
  77. package/out/renderer/assets/clone-BHHjv3HP.js +0 -1
  78. package/out/renderer/assets/path-utils-Ct0VTUZS.js +0 -58
  79. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-D8Sl1QhX.js +0 -1
  80. package/out/renderer/assets/team-bridge-page-vnNJdCi3.js +0 -16
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./smartart-CYnMNs5u.js","./index-BDzV3bGH.js","./index-ZovyVTxQ.css","./console-mirror-DRkz3vUY.js","./path-utils-Ct0VTUZS.js","./console-mirror-DOrYoP_4.css","./page-header-6mrV9W-E.js","./error-boundary-ZYkSCpZC.js","./index-CRjnV9wx.js","./conversation-input-sync-CJU5GIzR.js","./conversation-input-sync-CAX4_ErH.css","./index-DHKnfVbX.css","./heart-tKYqMVIH.js","./hash-BN0ECl3H.js","./use-session-snapshot-B5sxthdQ.js"])))=>i.map(i=>d[i]);
2
- import{t as T,r as E,j as f,c as ge}from"./index-BDzV3bGH.js";import{o as _s}from"./console-mirror-DRkz3vUY.js";import{a1 as wi,a2 as qn,a3 as xi,a4 as ki,a5 as _i,h as Nn,u as ft,a6 as Ge,d as Ae,a7 as Mn,r as en,a as An,c as yt,q as Si,Y as Pi,z as Ss,T as Ti,A as ji}from"./path-utils-Ct0VTUZS.js";import{P as Ci}from"./page-header-6mrV9W-E.js";import{c as jt,q as Ps,l as Dt,r as Ts,B as Z,s as js,w as $e,a9 as Fi,aa as Ni,ab as Mi,v as Wn,z as et,X as We,u as it,S as xt,x as Cs,ac as Ai,y as $i,A as bn,I as Ei,g as Ri,ad as zi,ae as Ii}from"./error-boundary-ZYkSCpZC.js";import{ci as Bt,cj as Kn,aO as $n,z as En,aL as Li,ck as Fs,cl as Di,cm as Bi,cn as Oi,co as Ui,cp as Gi,cq as qi,cc as Wi,cr as Ot,cs as Ki,ct as Vi,cu as wn}from"./index-CRjnV9wx.js";import{ap as qe,bx as Xi,az as Hi,by as xn,bz as Ns,bA as Yi,as as ct,aq as kn,T as Te,bB as Ms,bC as Et,bD as Qi,bE as Zi,bF as Ji,bG as Rn,bH as zn,bI as As,br as Vn,af as er,a7 as tr,a8 as nr,a9 as sr,ah as ir,bJ as rr,bK as or,bL as ar,bM as Xn,bd as tn,bN as $s,bk as In,bO as lr,bP as cr,bQ as Es,be as dr,bg as ur,bR as fr,bc as hr}from"./conversation-input-sync-CJU5GIzR.js";import{H as nn}from"./heart-tKYqMVIH.js";import{H as pr}from"./hash-BN0ECl3H.js";import{u as mr}from"./use-session-snapshot-B5sxthdQ.js";var gr=class extends wi{constructor(e,n){super(e,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:qn()})}getOptimisticResult(e){return e.behavior=qn(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,n){const{state:t}=e,s=super.createResult(e,n),{isFetching:i,isRefetching:r,isError:o,isRefetchError:l}=s,a=t.fetchMeta?.fetchMore?.direction,c=o&&a==="forward",d=i&&a==="forward",h=o&&a==="backward",u=i&&a==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ki(n,t.data),hasPreviousPage:xi(n,t.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:h,isFetchingPreviousPage:u,isRefetchError:l&&!c&&!h,isRefetching:r&&!d&&!u}}};function br(e,n){return _i(e,gr,n)}/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./smartart-BVm_cEaq.js","./index-BDzV3bGH.js","./index-ZovyVTxQ.css","./console-mirror-Bxl6t4e9.js","./path-utils-CRYGE4mK.js","./console-mirror-DOrYoP_4.css","./page-header-6mrV9W-E.js","./error-boundary-ZYkSCpZC.js","./index-DknTGnAk.js","./conversation-input-sync-MZPvyAzc.js","./conversation-input-sync-CAX4_ErH.css","./index-DHKnfVbX.css","./heart-tKYqMVIH.js","./hash-BN0ECl3H.js","./use-session-snapshot-CdYiirKJ.js"])))=>i.map(i=>d[i]);
2
+ import{t as T,r as E,j as f,c as ge}from"./index-BDzV3bGH.js";import{o as _s}from"./console-mirror-Bxl6t4e9.js";import{a1 as wi,a2 as qn,a3 as xi,a4 as ki,a5 as _i,h as Nn,u as ft,a6 as Ge,d as Ae,a7 as Mn,r as en,a as An,c as yt,q as Si,Y as Pi,z as Ss,T as Ti,A as ji}from"./path-utils-CRYGE4mK.js";import{P as Ci}from"./page-header-6mrV9W-E.js";import{c as jt,q as Ps,l as Dt,r as Ts,B as Z,s as js,w as $e,a9 as Fi,aa as Ni,ab as Mi,v as Wn,z as et,X as We,u as it,S as xt,x as Cs,ac as Ai,y as $i,A as bn,I as Ei,g as Ri,ad as zi,ae as Ii}from"./error-boundary-ZYkSCpZC.js";import{ck as Bt,cl as Kn,aO as $n,z as En,aL as Li,cm as Fs,cn as Di,co as Bi,cp as Oi,cq as Ui,cr as Gi,cs as qi,ce as Wi,ct as Ot,cu as Ki,cv as Vi,cw as wn}from"./index-DknTGnAk.js";import{ap as qe,bx as Xi,az as Hi,by as xn,bz as Ns,bA as Yi,as as ct,aq as kn,T as Te,bB as Ms,bC as Et,bD as Qi,bE as Zi,bF as Ji,bG as Rn,bH as zn,bI as As,br as Vn,af as er,a7 as tr,a8 as nr,a9 as sr,ah as ir,bJ as rr,bK as or,bL as ar,bM as Xn,bd as tn,bN as $s,bk as In,bO as lr,bP as cr,bQ as Es,be as dr,bg as ur,bR as fr,bc as hr}from"./conversation-input-sync-MZPvyAzc.js";import{H as nn}from"./heart-tKYqMVIH.js";import{H as pr}from"./hash-BN0ECl3H.js";import{u as mr}from"./use-session-snapshot-CdYiirKJ.js";var gr=class extends wi{constructor(e,n){super(e,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:qn()})}getOptimisticResult(e){return e.behavior=qn(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,n){const{state:t}=e,s=super.createResult(e,n),{isFetching:i,isRefetching:r,isError:o,isRefetchError:l}=s,a=t.fetchMeta?.fetchMore?.direction,c=o&&a==="forward",d=i&&a==="forward",h=o&&a==="backward",u=i&&a==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ki(n,t.data),hasPreviousPage:xi(n,t.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:h,isFetchingPreviousPage:u,isRefetchError:l&&!c&&!h,isRefetching:r&&!d&&!u}}};function br(e,n){return _i(e,gr,n)}/**
3
3
  * @license lucide-react v0.507.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
@@ -26,7 +26,7 @@ import{t as T,r as E,j as f,c as ge}from"./index-BDzV3bGH.js";import{o as _s}fro
26
26
  * See the LICENSE file in the root directory of this source tree.
27
27
  */const Pr=[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]],Tr=jt("tags",Pr),jr=["generated","created","mentioned"],_n=[{key:"image",labelKey:"ui.library.category.images",iconKind:"image"},{key:"sound",labelKey:"ui.library.category.sounds",iconKind:"audio"},{key:"document",labelKey:"ui.library.category.documents",iconKind:"markdown"},{key:"presentation",labelKey:"ui.library.category.presentations",iconKind:"pptx"},{key:"video",labelKey:"ui.library.category.video",iconKind:"video"},{key:"spreadsheet",labelKey:"ui.library.category.spreadsheets",iconKind:"spreadsheet"},{key:"code",labelKey:"ui.library.category.code",iconKind:"code"},{key:"other",labelKey:"ui.library.category.other",iconKind:"other"}],Cr=[{key:"recent",labelKey:"ui.library.sort.recent"},{key:"name",labelKey:"ui.library.sort.name"},{key:"kind",labelKey:"ui.library.sort.kind"},{key:"size",labelKey:"ui.library.sort.size"},{key:"created",labelKey:"ui.library.sort.created"},{key:"modified",labelKey:"ui.library.sort.modified"},{key:"organized",labelKey:"ui.library.sort.organized"}],Ut={q:"",scope:"final",tagMode:"all",highlighted:!1,sort:"recent",order:"desc"};function Fr(e){return e==="name"||e==="kind"?"asc":"desc"}function Yn(e,n){return e.status===n}function Nr(e){return!!(e.q.trim()||e.category||e.originGroup||e.tag||e.session||e.highlighted||e.status)}function Mr(e){if(e==="unorganized")return!1}function De(e){return e.name.trim()||e.derived_name.trim()||e.id}function Rs(e){const n=e.derived_name.trim();return n?n===e.name.trim()?e.ref.display_path:n:e.ref.display_path}function Ar(e){const n=new Map;for(const i of e){const r=i.category||"custom",o=n.get(r);o?o.push(i):n.set(r,[i])}const t=["topic","project","type","source","custom"],s=i=>{const r=t.indexOf(i);return r===-1?t.length:r};return[...n.entries()].sort(([i],[r])=>s(i)-s(r)).map(([i,r])=>({category:i,tags:r}))}function Xt(e){if(!Number.isFinite(e)||e<=0)return"0 B";const n=["B","KB","MB","GB","TB"],t=Math.min(n.length-1,Math.floor(Math.log(e)/Math.log(1024))),s=e/1024**t;return`${s>=10||t===0?Math.round(s):s.toFixed(1)} ${n[t]}`}function $r(e,n){if(!e)return"";const t=n-e*1e3;if(t<6e4)return T("ui.library.time.just_now");const s=Math.floor(t/6e4);if(s<60)return T("ui.library.time.minutes_m_ago",{minutes:s});const i=Math.floor(s/60);if(i<24)return T("ui.library.time.hours_h_ago",{hours:i});const r=Math.floor(i/24);if(r<30)return T("ui.library.time.days_d_ago",{days:r});const o=Math.floor(r/30);return o<12?T("ui.library.time.months_mo_ago",{months:o}):T("ui.library.time.years_y_ago",{years:Math.floor(o/12)})}function Er(e){if(!e||e<0)return"";const n=Math.round(e),t=Math.floor(n/60),s=n%60;return`${t}:${String(s).padStart(2,"0")}`}function sn(e){switch(e){case"generated":return"ui.library.origin.generated";case"created":return"ui.library.origin.created";case"mentioned":return"ui.library.origin.mentioned";default:return"ui.library.origin.other"}}const Ne={all:["desktop","library"],list:e=>["desktop","library","list",e],detail:e=>["desktop","library","detail",e],tags:["desktop","library","tags"],librarian:["desktop","library","librarian"]},Rr=60;function zr(e,n){return{op:"library.list",scope:e.scope,...e.q.trim()?{q:e.q.trim()}:{},...e.category?{category:e.category}:{},...e.originGroup?{origin_group:e.originGroup}:{},...e.tag?{tag:e.tag}:{},...e.session?{session_id:e.session}:{},...e.tag?{tag_mode:e.tagMode}:{},...e.highlighted?{highlighted:!0}:{},...e.status==="favorite"?{favorite:!0}:{},...(()=>{const t=Mr(e.status);return t!==void 0?{organized:t}:{}})(),sort:e.sort,order:e.order,limit:Rr,...n?{cursor:n}:{}}}function Ir(e,n){return br({queryKey:Ne.list(e),enabled:n,initialPageParam:void 0,queryFn:({pageParam:t})=>Ae(zr(e,t)),getNextPageParam:t=>t.next_cursor??void 0,retry:en,refetchInterval:t=>t.state.data?.pages.at(-1)?.state==="building"?2e3:!1,staleTime:1e4})}function Lr(e,n){return Nn({queryKey:Ne.detail(e??""),enabled:n&&!!e,queryFn:()=>Ae({op:"library.get",id:e}),retry:en,staleTime:5e3})}function Dr(e){return Nn({queryKey:Ne.tags,enabled:e,queryFn:()=>Ae({op:"library.tags"}),retry:en,staleTime:2e4})}function zs(e){return Nn({queryKey:Ne.librarian,enabled:e,queryFn:()=>Ae({op:"library.librarian",action:"status"}).then(n=>"librarian"in n?n.librarian:n),retry:en,staleTime:3e4})}function Xe(e){return e.invalidateQueries({queryKey:Ne.all})}function Qn(e,n){return{...e,...n}}function Is(){const e=ft();return qe({mutationFn:n=>Ae({op:"library.update",id:n.id,fields:n.fields}),onMutate:async n=>{await e.cancelQueries({queryKey:Ne.all});const t=e.getQueryData(Ne.detail(n.id)),s=e.getQueriesData({queryKey:[...Ne.all,"list"]});t&&e.setQueryData(Ne.detail(n.id),Qn(t,n.fields));for(const[i,r]of s)r&&e.setQueryData(i,{...r,pages:r.pages.map(o=>({...o,rows:o.rows.map(l=>l.id===n.id?Qn(l,n.fields):l)}))});return{detail:t,lists:s}},onSuccess:n=>(e.setQueryData(Ne.detail(n.id),n),Xe(e)),onError:(n,t,s)=>{s?.detail&&e.setQueryData(Ne.detail(t.id),s.detail);for(const[i,r]of s?.lists??[])e.setQueryData(i,r);e.invalidateQueries({queryKey:Ne.detail(t.id)}),e.invalidateQueries({queryKey:Ne.all})},retry:Ge})}function Br(){const e=ft();return qe({mutationFn:n=>Ae({op:"library.tags.assign",id:n.id,tags:n.tags,...n.primary?{primary:n.primary}:{}}),onSuccess:n=>(e.setQueryData(Ne.detail(n.id),n),Xe(e)),onError:()=>Xe(e),retry:Ge})}function Or(){const e=ft(),n=()=>Xe(e),t=qe({mutationFn:o=>Ae({op:"library.tags.create",name:o.name,...o.category?{category:o.category}:{}}),onSuccess:n,retry:Ge}),s=qe({mutationFn:o=>Ae({op:"library.tags.update",id:o.id,...o.name!==void 0?{name:o.name}:{},...o.category!==void 0?{category:o.category}:{}}),onSuccess:n,retry:Ge}),i=qe({mutationFn:o=>Ae({op:"library.tags.delete",id:o.id}),onSuccess:n,retry:Ge}),r=qe({mutationFn:o=>Ae({op:"library.tags.merge",id:o.id,into:o.into}),onSuccess:n,retry:Ge});return{create:t,update:s,remove:i,merge:r}}function Ur(){const e=ft();return qe({mutationFn:n=>Ae({op:"library.chat.link",id:n.id,sessionId:n.sessionId}),onSuccess:()=>Xe(e),onError:()=>Xe(e),retry:Ge})}function Ls(){const e=ft();return qe({mutationFn:n=>Ae({op:"library.chat.clear",id:n.id}),onSuccess:()=>Xe(e),retry:Ge})}function Gr(){const e=ft();return qe({mutationFn:n=>Ae({op:"library.librarian",action:n}).then(t=>"librarian"in t?t.librarian:t),onSuccess:()=>Xe(e),retry:Ge})}function ht(e,n,t,s=!1){const[i,r]=E.useState({bytes:null,mimeType:"",error:null,loading:!1});return E.useEffect(()=>{if(!t||!e){r({bytes:null,mimeType:"",error:null,loading:!1});return}let o=!1;return r({bytes:null,mimeType:"",error:null,loading:!0}),Mn(n==="thumbnail"?{op:"library.thumbnail",assetId:e,width:480}:{op:"library.content",assetId:e,download:s},null).then(a=>{if(!o){if(a.kind==="bytes"){r({bytes:a.data,mimeType:a.mimeType,error:null,loading:!1});return}r({bytes:null,mimeType:"",error:a.kind==="error"?a.detail:"This preview could not be loaded.",loading:!1})}}),()=>{o=!0}},[e,n,t,s]),i}function Ds(e,n=!0){const[t,s]=E.useState(()=>e?Ht.get(e)??null:null);return E.useEffect(()=>{if(!e){s(null);return}if(s(Ht.get(e)??null),!n)return;let i=!0;return Wr(e).then(r=>{i&&s(r)}),()=>{i=!1}},[e,n]),t}const Ht=new Map,Zn=new Map;async function qr(e){try{const n=await Mn({op:"library.waveform",assetId:e},null);return n.kind==="json"?Xi(n.body):null}catch{return null}}function Wr(e){const n=Zn.get(e);if(n)return n;const t=qr(e).then(s=>(Ht.set(e,s),s)).catch(()=>(Ht.set(e,null),null));return Zn.set(e,t),t}function pt(e,n){const[t,s]=E.useState(null);return E.useEffect(()=>{if(!e){s(null);return}const i=new Blob([e],{type:n||"application/octet-stream"}),r=URL.createObjectURL(i);return s(r),()=>URL.revokeObjectURL(r)},[e,n]),t}const Kr=/[\\/]/;function Vr(e){const t=De(e).split(Kr).pop()||e.id;if(t.includes("."))return t;const s=e.ref.display_path||e.ref.path||"",i=s.includes(".")?s.slice(s.lastIndexOf(".")):"";return`${t}${i}`}async function dt(e){const n=await Mn({op:"library.content",assetId:e.id,download:!0},null);if(n.kind!=="bytes")throw new Error(n.kind==="error"?n.detail:"The asset content could not be read.");const t=new Blob([n.data],{type:e.ref.content_type||n.mimeType||"application/octet-stream"}),s=URL.createObjectURL(t),i=document.createElement("a");i.href=s,i.download=Vr(e),i.rel="noopener",document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(s),3e4)}const Ln=({asset:e,onAsk:n,onEditMetadata:t,onEditTags:s,onToggleFavorite:i,onOpenConversation:r,onFilterSession:o,triggerClassName:l})=>{const a=async(u,p)=>{try{await navigator.clipboard.writeText(u),kn(p)}catch{Te(T("ui.library.menu.copy_failed"))}},c=async()=>{try{await dt(e),kn(T("ui.library.menu.saved_a_copy"))}catch{Te(T("ui.library.menu.save_failed"))}},d=!!(e.ref.type==="path"&&e.ref.path),h=e.occurrences;return f.jsxs(Ps,{children:[f.jsx(Dt,{content:T("ui.library.menu.asset_actions"),children:f.jsx(Ts,{asChild:!0,children:f.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":T("ui.library.menu.asset_actions_label",{name:e.name||e.derived_name}),className:l,onClick:u=>u.stopPropagation(),"data-library-asset-menu":"",children:f.jsx(Hi,{"aria-hidden":"true"})})})}),f.jsxs(js,{align:"end",className:"min-w-52",onClick:u=>u.stopPropagation(),children:[h.length===1?f.jsxs($e,{onSelect:()=>r(h[0].session_id),children:[f.jsx(Bt,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.open_source_conversation")})]}):h.length>1?f.jsxs(Fi,{children:[f.jsxs(Ni,{children:[f.jsx(Bt,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.open_source_conversation")})]}),f.jsx(Mi,{className:"min-w-60",children:h.map(u=>f.jsx($e,{onSelect:()=>r(u.session_id),children:f.jsx("span",{className:"truncate",children:u.session_title||u.session_id})},`${u.session_id}:${u.first_seq}`))})]}):null,f.jsxs($e,{onSelect:n,children:[f.jsx(Bt,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.ask_about_asset")})]}),h.length>0&&f.jsxs($e,{onSelect:()=>o(h[0].session_id),children:[f.jsx(xn,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.show_from_conversation")})]}),f.jsx(Wn,{}),f.jsxs($e,{onSelect:i,children:[f.jsx(nn,{"aria-hidden":"true",className:e.favorite?"fill-current text-accent":void 0}),f.jsx("span",{children:e.favorite?T("ui.library.menu.unfavorite"):T("ui.library.menu.favorite")})]}),f.jsxs($e,{onSelect:t,children:[f.jsx(Ns,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.edit_metadata")})]}),f.jsxs($e,{onSelect:s,children:[f.jsx(Tr,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.edit_tags")})]}),f.jsx(Wn,{}),e.ref.path?f.jsxs($e,{onSelect:()=>void a(e.ref.path,T("ui.library.menu.path_copied")),children:[f.jsx(Yi,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.copy_path")})]}):null,f.jsxs($e,{onSelect:()=>void a(e.id,T("ui.library.menu.asset_id_copied")),children:[f.jsx(pr,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.copy_asset_id")})]}),d?f.jsxs($e,{onSelect:()=>{e.ref.path&&window.api.showItemInFolder(e.ref.path)},children:[f.jsx(xn,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.reveal_in_finder")})]}):f.jsxs($e,{onSelect:()=>void c(),children:[f.jsx(ct,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.download")})]}),e.ref.type==="artifact"&&f.jsxs($e,{onSelect:()=>void c(),children:[f.jsx(ct,{"aria-hidden":"true"}),f.jsx("span",{children:T("ui.library.menu.save_a_copy")})]})]})]})},Xr={image:Ji,audio:Zi,video:Qi,pdf:Et,pptx:kr,docx:Et,markdown:Et,html:Kn,spreadsheet:Sr,text:Et,code:Kn,other:Ms};function Hr(e){return Xr[e]??Ms}function Ye({kind:e,size:n=20,className:t}){const s=Hr(e);return f.jsx(s,{size:n,"aria-hidden":"true",className:t})}const Bs=({group:e})=>f.jsx(et,{variant:e==="generated"?"accent":"neutral",children:T(sn(e))}),Os=({asset:e,large:n=!1})=>{const[t,s]=zn("300px"),i=e.kind==="image"&&e.exists&&s,r=ht(e.id,"thumbnail",i),o=pt(r.bytes,r.mimeType);return f.jsx("div",{ref:t,className:ge("relative flex shrink-0 items-center justify-center overflow-hidden bg-canvas",n?"aspect-[16/10] w-full":"h-24 w-32"),children:o?f.jsx("img",{src:o,alt:"",loading:"lazy",decoding:"async",className:"size-full object-cover"}):f.jsx(Ye,{kind:e.kind,size:n?28:22,className:"text-ink-dim"})})},Jn=()=>f.jsx("span",{className:"absolute top-1.5 left-1.5 flex size-5 items-center justify-center rounded-full bg-elevated",title:T("ui.library.card.highlighted"),children:f.jsx(En,{size:12,"aria-hidden":"true",className:"fill-current text-accent"})}),Us=()=>f.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-elevated",title:T("ui.library.menu.favorite"),"data-library-favorite-mark":"",children:f.jsx(nn,{size:12,"aria-hidden":"true",className:"fill-current text-accent"})}),Gs=({asset:e})=>{if(e.tags.length===0)return null;const n=e.tags.slice(0,2);return f.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[n.map(t=>f.jsx(et,{variant:"outline",children:t.name},t.id)),e.tags.length>n.length&&f.jsxs("span",{className:"text-meta text-ink-dim",children:["+",e.tags.length-n.length]})]})},Yr=({asset:e})=>{const[n,t]=zn("300px"),s=e.exists&&t,i=ht(e.id,"content",s),r=Ds(e.id,s),o=pt(i.bytes,i.mimeType||e.ref.content_type);return f.jsx("div",{ref:n,"data-library-audio-well":"",className:"relative flex aspect-[16/10] w-full shrink-0 items-center justify-center overflow-hidden bg-canvas px-2",children:o?f.jsx(As,{variant:"compact",ownerId:`sound:library:${e.id}`,src:o,label:De(e),peaks:r,durationHint:e.duration_s}):f.jsx(Ye,{kind:e.kind,size:28,className:"text-ink-dim"})})},Qr=({asset:e,selected:n,...t})=>{const s=e.kind==="audio",i=f.jsxs("div",{className:"flex w-full flex-col gap-1 p-3",children:[f.jsx("span",{className:"line-clamp-1 text-body-sm font-medium text-ink",children:De(e)}),f.jsx("span",{className:"line-clamp-1 text-meta text-ink-dim",children:Rs(e)}),f.jsxs("div",{className:"flex items-center gap-2 text-meta text-ink-muted",children:[f.jsx("span",{className:"truncate",children:e.kind}),f.jsx("span",{"aria-hidden":"true",children:"·"}),f.jsx("span",{children:Xt(e.size_bytes)}),e.duration_s?f.jsxs(f.Fragment,{children:[f.jsx("span",{"aria-hidden":"true",children:"·"}),f.jsx("span",{children:Er(e.duration_s)})]}):null]}),f.jsx(Gs,{asset:e}),e.occurrences[0]?.session_title&&f.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-meta text-ink-dim",children:[f.jsx(Bt,{size:12,"aria-hidden":"true"}),f.jsx("span",{className:"truncate",children:e.occurrences[0].session_title})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx(Bs,{group:e.origin_group}),f.jsxs("div",{className:"flex items-center gap-2",children:[e.session_count>1&&f.jsx("span",{className:"text-meta text-ink-dim",children:T("ui.library.card.conversations",{count:e.session_count})}),e.favorite&&f.jsx(Us,{})]})]})]}),r=f.jsxs("button",{type:"button",onClick:()=>t.onSelect(e.id),"aria-pressed":n,className:"flex w-full flex-1 flex-col text-left focus-visible:outline-offset-2",children:[s?null:f.jsxs("div",{className:"relative",children:[f.jsx(Os,{asset:e,large:!0}),e.highlighted&&f.jsx(Jn,{})]}),i]});return f.jsxs("article",{"data-library-card-id":e.id,"data-glass-block":"",className:ge("group relative flex flex-col overflow-hidden rounded-lg border border-hairline bg-surface",n&&$n),children:[s&&f.jsxs("div",{className:"relative",children:[f.jsx(Yr,{asset:e}),e.highlighted&&f.jsx(Jn,{})]}),r,f.jsx("div",{className:"invisible absolute top-1.5 right-1.5 group-focus-within:visible group-hover:visible [@media(pointer:coarse)]:visible",children:f.jsx(Ln,{asset:e,onAsk:()=>t.onAsk(e),onEditMetadata:()=>t.onEditMetadata(e),onEditTags:()=>t.onEditTags(e),onToggleFavorite:()=>t.onToggleFavorite(e),onOpenConversation:t.onOpenConversation,onFilterSession:t.onFilterSession,triggerClassName:"bg-elevated"})})]})},Zr=({asset:e,selected:n,...t})=>f.jsxs("article",{"data-library-card-id":e.id,"data-glass-block":"",className:ge("group relative flex items-center gap-3 rounded-md border border-hairline bg-surface px-3 py-2",n&&$n),children:[f.jsxs("button",{type:"button",onClick:()=>t.onSelect(e.id),"aria-pressed":n,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[f.jsx(Os,{asset:e}),f.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-1.5 truncate text-body-sm font-medium text-ink",children:[e.highlighted&&f.jsx(En,{size:12,"aria-hidden":"true",className:"shrink-0 fill-current text-accent"}),De(e)]}),f.jsx("span",{className:"truncate text-meta text-ink-dim",children:Rs(e)})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-3 text-meta text-ink-muted",children:[f.jsx(Gs,{asset:e}),f.jsx("span",{children:e.kind}),f.jsx("span",{children:Xt(e.size_bytes)}),f.jsx(Bs,{group:e.origin_group}),e.favorite&&f.jsx(Us,{})]})]}),f.jsx(Ln,{asset:e,onAsk:()=>t.onAsk(e),onEditMetadata:()=>t.onEditMetadata(e),onEditTags:()=>t.onEditTags(e),onToggleFavorite:()=>t.onToggleFavorite(e),onOpenConversation:t.onOpenConversation,onFilterSession:t.onFilterSession})]}),Jr=({assets:e,selectedId:n,view:t,hasMore:s,loadingMore:i,onLoadMore:r,...o})=>{const l=E.useRef(null);return E.useEffect(()=>{const a=l.current;if(!a||!s)return;const c=new IntersectionObserver(d=>{d.some(h=>h.isIntersecting)&&r()},{rootMargin:"600px 0px"});return c.observe(a),()=>c.disconnect()},[s,r,e.length]),f.jsxs("div",{className:"flex flex-col gap-4",children:[t==="grid"?f.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(208px,1fr))] gap-4",children:e.map(a=>f.jsx(Qr,{asset:a,selected:a.id===n,...o},a.id))}):f.jsx("div",{className:"flex flex-col gap-1.5",children:e.map(a=>f.jsx(Zr,{asset:a,selected:a.id===n,...o},a.id))}),f.jsxs("div",{ref:l,className:"flex justify-center py-6",children:[i&&f.jsxs("span",{className:"flex items-center gap-2 text-body-sm text-ink-muted",children:[f.jsx(Rn,{size:14,"aria-hidden":"true",className:"motion-safe:animate-spin"}),T("ui.library.grid.loading_more")]}),!i&&s&&f.jsx(Z,{variant:"ghost",size:"sm",onClick:r,children:T("ui.library.grid.load_more")})]})]})},eo=({view:e})=>e==="list"?f.jsx("div",{className:"flex flex-col gap-1.5","aria-hidden":"true","data-library-skeleton":"",children:Array.from({length:8},(n,t)=>f.jsxs("div",{className:"flex h-28 items-center gap-3 rounded-md border border-hairline bg-surface px-3",children:[f.jsx("div",{className:"h-24 w-32 rounded-sm bg-sunken"}),f.jsxs("div",{className:"flex flex-1 flex-col gap-2",children:[f.jsx("div",{className:"h-3 w-1/3 rounded-xs bg-sunken"}),f.jsx("div",{className:"h-3 w-1/2 rounded-xs bg-sunken"})]})]},t))}):f.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(208px,1fr))] gap-4","aria-hidden":"true","data-library-skeleton":"",children:Array.from({length:12},(n,t)=>f.jsxs("div",{className:"flex flex-col overflow-hidden rounded-lg border border-hairline bg-surface",children:[f.jsx("div",{className:"aspect-[16/10] bg-sunken"}),f.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[f.jsx("div",{className:"h-3 w-2/3 rounded-xs bg-sunken"}),f.jsx("div",{className:"h-3 w-1/2 rounded-xs bg-sunken"}),f.jsx("div",{className:"h-3 w-1/3 rounded-xs bg-sunken"})]})]},t))}),to=[{key:"highlighted",labelKey:"ui.library.status.highlighted"},{key:"unorganized",labelKey:"ui.library.status.unorganized"},{key:"favorite",labelKey:"ui.library.status.favorites"}],Ke=({label:e,count:n,active:t,onPress:s,icon:i,indent:r=!1})=>f.jsxs("button",{type:"button",onClick:s,"aria-pressed":t,className:ge("flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-body-sm",r&&"pl-6",t?$n:"text-ink-muted hover:bg-row-hover hover:text-ink"),children:[i,f.jsx("span",{className:"min-w-0 flex-1 truncate",children:e}),n!==void 0&&f.jsx("span",{className:"text-meta tabular-nums text-ink-dim",children:n})]}),bt=({label:e,children:n})=>f.jsxs("section",{className:"flex flex-col gap-1",children:[f.jsx("h3",{className:"px-2 text-meta font-medium tracking-wide text-ink-dim",children:e}),f.jsx("div",{className:"flex flex-col gap-0.5",children:n})]}),no=({filters:e,onChange:n,counts:t,tags:s,total:i,scopeTotal:r})=>{const o=Ar(s),l=t?.category??{},a=d=>n({...e,...d}),c=!!(e.category||e.originGroup||e.status||e.tag||e.session||e.highlighted);return f.jsxs("div",{"data-lo-sidebar-edge-cues":!0,className:"flex h-full flex-col gap-5 overflow-y-auto px-2 py-4","data-library-filter-rail":"",children:[c&&f.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start",onClick:()=>n({...e,category:void 0,originGroup:void 0,status:void 0,tag:void 0,session:void 0,highlighted:!1}),children:[f.jsx(We,{"aria-hidden":"true"}),T("ui.library.filter.clear_filters")]}),e.session&&f.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-sunken px-2 py-1.5 text-meta text-ink-muted",children:[f.jsx("span",{className:"min-w-0 flex-1 truncate",children:T("ui.library.filter.one_conversation")}),f.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":T("ui.library.filter.clear_conversation"),onClick:()=>a({session:void 0}),children:f.jsx(We,{"aria-hidden":"true"})})]}),f.jsxs(bt,{label:T("ui.library.filter.scope"),children:[f.jsx(Ke,{label:T("ui.library.filter.scope_final"),active:e.scope==="final",onPress:()=>a({scope:"final"})}),f.jsx(Ke,{label:T("ui.library.filter.scope_all"),count:r??void 0,active:e.scope==="all",onPress:()=>a({scope:"all"})})]}),f.jsxs(bt,{label:T("ui.library.filter.categories"),children:[f.jsx(Ke,{label:T("ui.library.category.all"),count:i,active:!e.category,onPress:()=>a({category:void 0})}),_n.map(d=>f.jsx(Ke,{label:T(d.labelKey),count:l[d.key]??0,active:e.category===d.key,onPress:()=>a({category:e.category===d.key?void 0:d.key}),icon:f.jsx(Ye,{kind:d.iconKind,size:14,className:"text-ink-dim"})},d.key)),Object.keys(l).filter(d=>!_n.some(h=>h.key===d)).sort().map(d=>f.jsx(Ke,{label:d,count:l[d],active:e.category===d,onPress:()=>a({category:e.category===d?void 0:d}),icon:f.jsx(Vn,{size:14,"aria-hidden":"true"})},d))]}),f.jsx(bt,{label:T("ui.library.filter.status"),children:to.map(d=>f.jsx(Ke,{label:T(d.labelKey),active:Yn(e,d.key),onPress:()=>a({status:Yn(e,d.key)?void 0:d.key}),icon:d.key==="favorite"?f.jsx(nn,{size:14,"aria-hidden":"true"}):d.key==="highlighted"?f.jsx(En,{size:14,"aria-hidden":"true"}):void 0},d.key))}),f.jsx(bt,{label:T("ui.library.filter.source"),children:jr.filter(d=>e.originGroup===d||e.scope==="all"||(t?.origin_group?.[d]??0)>0).map(d=>f.jsx(Ke,{label:T(sn(d)),count:t?.origin_group?.[d]??0,active:e.originGroup===d,onPress:()=>a({originGroup:e.originGroup===d?void 0:d})},d))}),o.length>0&&f.jsx(bt,{label:T("ui.library.filter.tags"),children:o.map(d=>f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx("span",{className:"px-2 pt-1 text-meta text-ink-dim",children:d.category}),d.tags.map(h=>f.jsx(Ke,{label:h.name,count:h.count??0,active:e.tag===h.id,onPress:()=>a({tag:e.tag===h.id?void 0:h.id}),icon:f.jsx(Vn,{size:13,"aria-hidden":"true"}),indent:!0},h.id))]},d.category))}),e.tag&&f.jsx(et,{variant:"neutral",children:T("ui.library.filter.tag_mode",{mode:e.tagMode.toUpperCase()})})]})},es=({value:e,onSave:n,label:t,placeholder:s="",multiline:i=!1,rows:r=3,textClassName:o,allowEmpty:l=!1,startSignal:a,field:c,className:d})=>{it();const[h,u]=E.useState(!1),[p,m]=E.useState(e),[g,S]=E.useState(!1),y=E.useRef("closed"),w=E.useRef(null),x=E.useRef(null),_=()=>{y.current==="closed"&&(m(e),y.current="edit",u(!0))},v=N=>{y.current="closed",N&&x.current?.focus(),u(!1)},k=async N=>{if(y.current!=="edit")return;const L=p.trim();if(!L&&!l||L===e){v(N);return}y.current="saving",S(!0);try{await n(L),y.current==="saving"&&v(N)}catch{y.current==="saving"&&(y.current="edit",w.current?.focus())}finally{S(!1)}};E.useEffect(()=>{if(!h)return;const N=setTimeout(()=>{const L=w.current;L&&(L.focus(),L.select(),L.scrollLeft=0,L instanceof HTMLTextAreaElement&&(L.scrollTop=0))},0);return()=>clearTimeout(N)},[h]),E.useEffect(()=>{y.current==="closed"&&m(e)},[e]);const j=E.useRef(a);E.useEffect(()=>{const N=j.current;j.current=a,!(a===N||!a)&&_()},[a]);const M=N=>{if(!(N.nativeEvent.isComposing||N.keyCode===229)){if(N.key==="Enter"){if(i&&N.shiftKey)return;N.preventDefault(),k(!0)}else if(N.key==="Escape"){if(N.preventDefault(),y.current==="saving")return;v(!0)}}},F=N=>{h&&N.preventDefault()},R=N=>{m(N.target.value)},$=e.trim()?f.jsx("span",{onDoubleClick:_,className:ge("block min-w-0 cursor-default select-none",i?"whitespace-pre-wrap break-words":"truncate",o),children:e}):f.jsx("button",{type:"button",onClick:_,className:ge("block min-w-0 cursor-pointer truncate text-start text-ink-dim","transition-colors duration-fast ease-out-quart hover:text-ink-muted",o),children:s});return f.jsxs("div",{"data-inline-edit":c,className:ge("group/inline flex min-w-0 items-center gap-1",!h&&"w-fit max-w-full",h&&"w-full",i&&h&&"items-start",d),children:[h?i?f.jsx("textarea",{"data-inline-edit-input":"",ref:N=>{w.current=N},value:p,rows:r,readOnly:g,"aria-label":t,"aria-busy":g||void 0,onChange:R,onKeyDown:M,onBlur:()=>void k(!1),spellCheck:!1,className:ge("min-w-0 flex-1 resize-none border-0 bg-transparent p-0 outline-none","text-ink",o)}):f.jsx("input",{"data-inline-edit-input":"",ref:N=>{w.current=N},value:p,readOnly:g,"aria-label":t,"aria-busy":g||void 0,onChange:R,onKeyDown:M,onBlur:()=>void k(!1),spellCheck:!1,className:ge("min-w-0 flex-1 border-0 bg-transparent p-0 outline-none","text-ink",o)}):f.jsx("div",{className:"min-w-0 flex-1",children:$}),f.jsx("button",{type:"button",ref:x,"data-inline-edit-control":"","aria-label":g?T("ui.common.forms.editable_field.saving"):h?T("ui.common.forms.autocomplete_field.cancel_editing",{label:t}):T("ui.common.forms.editable_field.edit_v2",{label:t}),title:g?T("ui.common.forms.editable_field.saving"):h?T("ui.common.forms.editable_field.cancel_escape"):T("ui.common.forms.editable_field.edit"),"aria-busy":g||void 0,"aria-disabled":g||void 0,onMouseDown:F,onClick:N=>{if(!(N.detail>1)&&y.current!=="saving"){if(h){v(!0);return}_()}},className:ge("inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-xs","text-ink-dim transition-opacity duration-base ease-out-quart","hover:text-ink-muted",!h&&"opacity-0 group-hover/inline:opacity-100 group-hover/inline:duration-fast",!h&&"group-focus-within/inline:opacity-100 group-focus-within/inline:duration-fast"),children:g?f.jsx(xt,{size:"xs"}):h?f.jsx(We,{className:"size-3","aria-hidden":"true"}):f.jsx(Ns,{className:"size-3","aria-hidden":"true"})})]})},so=({value:e,onChange:n,label:t,addLabel:s,saving:i=!1,startSignal:r})=>{it();const[o,l]=E.useState(!1),[a,c]=E.useState(""),d=E.useRef(null),h=E.useRef(null),u=()=>{i||o||l(!0)},p=()=>{c(""),l(!1)},m=x=>{const _=a.trim().toLowerCase();_&&!e.some(v=>v.toLowerCase()===_)&&n([...e,_]),c(""),x?d.current?.focus():l(!1)},g=E.useRef(!1);E.useEffect(()=>{if(i){g.current=!0;return}if(!o){g.current=!1;return}const x=g.current;g.current=!1;const _=setTimeout(()=>{if(x){const v=document.activeElement,k=h.current;if(!(!v||v===document.body||!!k?.contains(v)))return}d.current?.focus()},0);return()=>clearTimeout(_)},[o,i]);const S=E.useRef(r);E.useEffect(()=>{const x=S.current;S.current=r,!(r===x||!r)&&u()},[r]);const y=x=>{x.nativeEvent.isComposing||x.keyCode===229||(x.key==="Enter"?(x.preventDefault(),m(!0)):x.key==="Escape"&&(x.preventDefault(),p()))},w=i?f.jsx(xt,{size:"xs"}):o?f.jsx("input",{ref:d,value:a,"aria-label":t,onChange:x=>c(x.target.value),onKeyDown:y,onBlur:()=>a.trim()?m(!1):p(),spellCheck:!1,className:ge("w-28 min-w-0 border-0 bg-transparent p-0 outline-none","text-body-sm text-ink placeholder:text-ink-dim"),placeholder:s}):f.jsxs("button",{type:"button",onClick:u,className:ge("inline-flex items-center gap-1 rounded-xs text-ink-dim","text-body-sm transition-colors duration-fast ease-out-quart hover:text-ink-muted"),children:[f.jsx(Li,{className:"size-3","aria-hidden":"true"}),s]});return f.jsxs("div",{ref:h,"data-inline-tags":"",className:"flex min-w-0 flex-wrap items-center gap-2",children:[e.map(x=>f.jsxs(et,{variant:"neutral",shape:"pill",className:"gap-1 pr-1 text-ink",children:[x,f.jsx("button",{type:"button","aria-label":T("ui.chat.tags.remove_named",{name:x}),disabled:i,onClick:()=>n(e.filter(_=>_!==x)),className:ge("inline-flex size-5 -m-1 items-center justify-center rounded-xs","text-ink-dim","transition-colors duration-fast ease-out-quart","hover:text-danger disabled:text-ink-disabled"),children:f.jsx(We,{className:"size-3","aria-hidden":"true"})})]},x)),w]})},io=2e3;function Dn(e){return e.ref.type==="path"&&!!e.ref.path&&e.exists===!0}function ro(e,n){const t=Dn(e)?e.ref.path:null,[s,i]=E.useState({mtimeMs:null,sizeBytes:null,revision:0,missing:!1}),r=E.useRef(null),o=E.useRef(!1);E.useEffect(()=>{r.current=null,i({mtimeMs:null,sizeBytes:null,revision:0,missing:!1})},[t]);const l=E.useCallback(async()=>{if(!(!t||!window.api?.probeFiles)&&!o.current){o.current=!0;try{const[a]=await window.api.probeFiles([t],void 0,{fresh:!0});if(!a)return;const c=a.exists===!1&&!a.error,d=a.mtimeMs??null,h=d!==null&&d!==r.current;r.current=d,i(u=>({mtimeMs:d,sizeBytes:a.sizeBytes??null,revision:h?u.revision+1:u.revision,missing:c}))}finally{o.current=!1}}},[t]);return E.useEffect(()=>{l()},[l,n]),E.useEffect(()=>{if(!t)return;const a=()=>void l(),c=()=>{document.visibilityState==="visible"&&l()};window.addEventListener("focus",a),document.addEventListener("visibilitychange",c);const d=window.setInterval(()=>{document.visibilityState==="visible"&&l()},io);return()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",c),window.clearInterval(d)}},[t,l]),s}const oo=[];function ao(e){const n=e.ref.display_path||e.ref.path||(e.ref.digest?`attachment digest ${e.ref.digest}`:e.id);return`${De(e)} (${n})`}function lo(e,n,t){if(e.kind!=="image"||!n||n.length===0)return null;let s="";const i=32768;for(let o=0;o<n.length;o+=i)s+=String.fromCharCode(...n.subarray(o,Math.min(o+i,n.length)));return`data:${e.ref.content_type||t};base64,${btoa(s)}`}const co=({asset:e,focusSignal:n,onSessionChange:t,showLinkedRow:s,onOpenChat:i,refreshSignal:r=0,streaming:o})=>{it();const l=E.useRef(null),a=An(),{frontend:c,refresh:d}=mr(),h=E.useRef(!1),[u,p]=E.useState(!1),[m,g]=E.useState({}),[S,y]=E.useState(null),w=e.chat?.session_id??m[e.id]??null,x=m[e.id]??null,_=S===e.id,v=Ur(),k=Ls(),j=ht(e.id,"content",e.kind==="image"),M=w??`library:${e.id}`;E.useEffect(()=>{w&&d(w)},[w,d,r]),E.useEffect(()=>{n!==0&&l.current?.focusInput()},[n]);const F=async()=>{const $=x??e.chat?.session_id;if($)try{await v.mutateAsync({id:e.id,sessionId:$}),g(N=>{const L={...N};return delete L[e.id],L}),y(null)}catch{Te(T("ui.library.composer.link_failed_short"))}},R=async($,N,L)=>{const H=$.trim();if(!H||h.current)return!1;h.current=!0,p(!0);const D=o??c?.streaming===!0;let U=w;try{const q=lo(e,j.bytes,j.mimeType),{images:Q,unreadable:J,overflow:I}=await tr(q?[...N,q]:N,$),V=nr(J);if(V)return Te(V),!1;const oe=sr(I);if(oe)return Te(oe),!1;if(!U){const Y=Si.getState();if(U=await Y.createSession(Y.cwd||"~"),!U)throw new Error(Y.error??T("ui.library.composer.could_not_start"))}const ee=U,ae={op:"sessions.message",sessionId:ee,requestId:crypto.randomUUID(),text:`${H}
28
28
 
29
- ${ao(e)}`};if(Q.length>0&&(ae.images=Q),D&&(ae.mode="steer"),await Ae(ae),L?.(),g(Y=>({...Y,[e.id]:ee})),t(e.id,ee),!e.chat)try{await v.mutateAsync({id:e.id,sessionId:ee}),g(Y=>{const X={...Y};return delete X[e.id],X}),y(null)}catch(Y){y(e.id),Te(Y instanceof Error&&Y.message?T("ui.library.composer.link_failed",{message:Y.message}):T("ui.library.composer.link_failed_short"))}return!0}catch(q){return Te(q instanceof Error&&q.message?q.message:T("ui.library.composer.not_sent")),!1}finally{h.current=!1,p(!1)}},P=e.chat;return f.jsxs("div",{className:"flex flex-col gap-2 px-4 pb-3","data-library-composer":"","data-sending":u?"":void 0,children:[_&&x&&f.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md bg-sunken px-2 py-1 text-meta text-ink","data-library-link-failed":"",children:[f.jsx("span",{className:"min-w-0 flex-1",children:T("ui.library.composer.message_sent_link_failed")}),f.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>void F(),children:T("ui.library.composer.retry_link")}),f.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>i(x),children:T("ui.library.composer.open_chat")})]}),P&&s&&f.jsxs("div",{className:"flex items-center gap-2 text-meta text-ink-muted",children:[f.jsx(Fs,{size:13,"aria-hidden":"true"}),f.jsx("span",{className:"min-w-0 flex-1 truncate",children:T("ui.library.composer.chat_about",{title:P.title||P.session_id})}),f.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":T("ui.library.composer.unlink"),onClick:()=>k.mutate({id:e.id}),children:f.jsx(We,{"aria-hidden":"true"})})]}),f.jsx("div",{className:"min-w-0","data-sending":u?"":void 0,children:f.jsx(er,{ref:l,conversationId:M,messages:oo,isLoading:!1,ownGutter:!0,transcriptless:!0,autoFocus:!1,placeholderOverride:P||w?T("ui.library.composer.continue_placeholder"):T("ui.library.composer.ask_placeholder"),cwd:c?.cwd,cwdReadOnlyReason:T("ui.projects.project_quick_send.quick_send_follows_the_conversation_s_directory"),sessionStatus:c&&w?{frontend:c,costChannels:yt(a.data,"cost_channels")}:void 0,onSendMessage:R})})]})},uo=({sessionId:e,title:n,collapsed:t,onToggleCollapsed:s,onOpenChat:i,onUnlink:r,onTurnSettled:o,onStreamingChange:l})=>{it();const a=An(),c=Pi(e,!0,!0,e,{openFrame:yt(a.data,"open_frame"),journalOrder:yt(a.data,"journal_order"),peerJournalSource:yt(a.data,"peer_journal_source")}),d=E.useRef(null),u=(c.frontend??c.heldFrontend)?.streaming===!0,p=ir(c.frontend??c.heldFrontend),m=E.useRef(u);E.useEffect(()=>{m.current!==u&&(l(u),u||o()),m.current=u},[u,o,l]);const g=c.transcript.records.length===0&&c.awaitingHydration&&!c.missing;return f.jsxs("section",{"data-library-trajectory":"","data-collapsed":t?"":void 0,className:ge("flex min-h-0 flex-col bg-canvas",t?"shrink-0":"min-h-40 max-h-80 shrink-0 basis-[38%]"),children:[f.jsxs("header",{className:"flex shrink-0 items-center gap-2 px-4 py-1.5",children:[f.jsx(Fs,{size:13,"aria-hidden":"true",className:"text-ink-dim"}),f.jsxs("button",{type:"button","aria-expanded":!t,onClick:s,className:"flex min-w-0 flex-1 items-center gap-1 rounded-sm text-left text-meta text-ink-muted hover:text-ink focus-visible:outline-offset-1",children:[f.jsx("span",{className:"min-w-0 flex-1 truncate",children:T("ui.library.composer.chat_about",{title:n})}),f.jsx(Cs,{"aria-hidden":"true",className:ge("size-3.5 shrink-0 transition-transform duration-fast",t&&"rotate-180")})]}),f.jsx(Z,{variant:"ghost",size:"sm",onClick:i,children:T("ui.library.composer.open_chat")}),f.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":T("ui.library.composer.unlink"),onClick:r,children:f.jsx(We,{"aria-hidden":"true"})})]}),!t&&p&&f.jsxs("div",{"data-library-trajectory-gate":"",className:"flex shrink-0 items-center gap-2 px-4 pb-1.5",children:[f.jsx("span",{className:"min-w-0 flex-1 text-meta text-ink",children:T("ui.mesh.mesh_approvals.waiting_for_you")}),f.jsx(Z,{variant:"secondary",size:"sm",onClick:i,children:T("ui.library.composer.open_chat")})]}),!t&&f.jsx("div",{"data-lo-sidebar-edge-cues":!0,className:"flex min-h-0 grow flex-col overflow-hidden",children:g?f.jsx("div",{className:"flex flex-1 items-center justify-center",children:f.jsx(xt,{label:T("ui.library.preview.loading")})}):f.jsx(rr,{frontend:c.frontend,transcript:c.transcript,gate:p,waiting:u,starting:!1,loadingOlder:c.loadingOlder,onLoadOlder:c.loadOlder,onLoadOlderOutcome:c.loadOlderDetailed,olderFailed:c.olderFailed,containerRef:d,isSmallView:!1,status:c.status,failure:c.failure,awaitingHydration:c.awaitingHydration,hydrationProven:c.hydrated,missing:c.missing,onReconnect:c.retry})})]})};function fo(e,n,t){return{id:`library:${e.id}`,title:e.name.trim()||e.derived_name||e.ref.path||e.id,path:e.ref.path??"",content:n,type:"markdown",readMtimeMs:t??void 0,sizeBytes:e.size_bytes,availability:"present"}}const ho="h-[78px] w-[117px]",po=({asset:e,active:n,onSelect:t})=>{const[s,i]=zn("300px"),r=ht(e.id,"thumbnail",e.kind==="image"&&e.exists&&i),o=pt(r.bytes,r.mimeType),l=De(e);return f.jsx("li",{ref:s,className:ge("flex shrink-0 rounded-sm leading-none",n&&"ring-1 ring-ink"),children:f.jsx("button",{type:"button","aria-label":l,title:l,"aria-current":n?"true":void 0,onClick:t,"data-library-lightbox-tile":e.id,className:"block cursor-pointer overflow-hidden rounded-sm leading-none",children:f.jsx("div",{className:ge("flex items-center justify-center overflow-hidden bg-canvas",ho),children:o?f.jsx("img",{src:o,alt:"",loading:"lazy",decoding:"async",className:"size-full object-cover"}):f.jsx(Ye,{kind:e.kind,size:20,className:"text-ink-dim"})})})})},mo=({siblings:e,index:n,onSelect:t})=>f.jsx("ul",{role:"list","data-library-lightbox-strip":"",className:"flex max-w-full items-center gap-2 overflow-x-auto px-2 py-1 leading-none",children:e.map((s,i)=>f.jsx(po,{asset:s,active:i===n,onSelect:()=>t(i)},s.id))}),go=({open:e,siblings:n,index:t,onIndexChange:s,onClose:i,restoreFocusTo:r,resolved:o})=>{it();const l=or(t,n.length),a=n[l],c=o?.assetId===a.id,d=ht(a.id,"content",!c),h=pt(d.bytes,d.mimeType||a.ref.content_type),u=c?o?.url:h??void 0,p=De(a);return f.jsx(ar,{open:e,onOpenChange:m=>{m||i()},src:u,pending:!c&&(d.loading||u===void 0&&!d.error),label:p,mediaKind:a.kind==="video"?"video":"image",mediaLabel:"asset",restoreFocusTo:r,layerAttributes:{"data-library-lightbox":""},fallback:d.error||u!==void 0?f.jsx("p",{className:"max-w-90 text-center text-body-sm text-ink-muted",children:T("ui.library.preview.could_not_load")}):void 0,group:{index:l,count:n.length,onPrev:()=>s(Xn(l,n.length,-1)),onNext:()=>s(Xn(l,n.length,1)),filmstrip:n.length>1?f.jsx(mo,{siblings:n,index:l,onSelect:s}):void 0}})};async function qs(e){const n=e instanceof Uint8Array?e:new Uint8Array(e),t=new DataView(n.buffer,n.byteOffset,n.byteLength),s=101010256,i=101075792,r=117853008;let o=-1;const l=Math.max(0,n.length-65557);for(let m=n.length-22;m>=l;m--)if(t.getUint32(m,!0)===s){o=m;break}if(o===-1)throw new Error("Not a valid ZIP file: EOCD not found");let a,c;const d=o-20;if(d>=0&&t.getUint32(d,!0)===r){const m=Number(t.getBigUint64(d+8,!0));if(t.getUint32(m,!0)!==i)throw new Error("Invalid ZIP64 end record");a=Number(t.getBigUint64(m+48,!0)),c=Number(t.getBigUint64(m+32,!0))}else a=t.getUint32(o+16,!0),c=t.getUint16(o+8,!0);if(a+4>n.length)throw new Error("ZIP central directory offset is outside the file");const h=33639248,u={};let p=a;for(let m=0;m<c&&!(p+46>n.length||t.getUint32(p,!0)!==h);m++){const g=t.getUint16(p+10,!0);let S=t.getUint32(p+20,!0),y=t.getUint32(p+24,!0);const w=t.getUint16(p+28,!0),x=t.getUint16(p+30,!0),_=t.getUint16(p+32,!0);let v=t.getUint32(p+42,!0);const k=yo(n,p+46,w);if(S===4294967295||y===4294967295||v===4294967295){const P=p+46+w,$=P+x;let N=P;for(;N+4<=$;){const L=t.getUint16(N,!0),H=t.getUint16(N+2,!0);if(L===1){let D=N+4;y===4294967295&&D+8<=$&&(y=Number(t.getBigUint64(D,!0)),D+=8),S===4294967295&&D+8<=$&&(S=Number(t.getBigUint64(D,!0)),D+=8),v===4294967295&&D+8<=$&&(v=Number(t.getBigUint64(D,!0)));break}N+=4+H}}if(p+=46+w+x+_,k.endsWith("/")||g!==0&&g!==8||v+30>n.length)continue;const j=t.getUint16(v+26,!0),M=t.getUint16(v+28,!0),F=v+30+j+M;if(F+S>n.length)continue;const R=n.subarray(F,F+S);try{u[k]=g===0?R.slice():await bo(R)}catch(P){console.warn(`[zip.js] Failed to decompress "${k}":`,P.message)}}return u}async function bo(e){const n=new DecompressionStream("deflate-raw"),t=n.writable.getWriter(),s=n.readable.getReader();t.write(e),t.close();const i=[];let r=0;for(;;){const{value:a,done:c}=await s.read();if(c)break;i.push(a),r+=a.length}const o=new Uint8Array(r);let l=0;for(const a of i)o.set(a,l),l+=a.length;return o}function yo(e,n,t){return new TextDecoder().decode(e.subarray(n,n+t))}function Se(e){return new DOMParser().parseFromString(e,"application/xml")}function pe(e,n){if(!e)return[];const t=[],s=e.getElementsByTagName("*");for(let i=0;i<s.length;i++)s[i].localName===n&&t.push(s[i]);return t}function b(e,n){return pe(e,n)[0]??null}function G(e,n,t=null){if(!e)return t;const s=e.getAttribute(n);return s!==null?s:t}function C(e,n,t=0){const s=G(e,n);return s!==null?parseInt(s,10):t}function Le(e,n,t){return Math.max(n,Math.min(t,e))}const kt=12700,vo=Object.freeze(Object.defineProperty({__proto__:null,EMU_PER_PT:kt,attr:G,attrInt:C,clamp:Le,g1:b,gtn:pe,parseXml:Se},Symbol.toStringTag,{value:"Module"}));function wo(e){if(!e)return{colors:{},majorFont:"Calibri Light",minorFont:"Calibri"};const n=b(e,"clrScheme"),t={};if(n){const o=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];for(const l of o){const a=b(n,l);if(!a)continue;const c=b(a,"srgbClr"),d=b(a,"sysClr");c?t[l]=c.getAttribute("val")||"":d&&(t[l]=d.getAttribute("lastClr")||"")}}const s=b(e,"fontScheme");let i="Calibri Light",r="Calibri";if(s){const o=b(s,"majorFont"),l=b(s,"minorFont");if(o){const a=b(o,"latin");a&&(i=a.getAttribute("typeface")||i)}if(l){const a=b(l,"latin");a&&(r=a.getAttribute("typeface")||r)}}return{colors:t,majorFont:i,minorFont:r}}function xo(e){if(!e)return{};const n=b(e,"clrMap");if(!n)return{};const t={},s=["bg1","tx1","bg2","tx2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];for(const i of s){const r=n.getAttribute(i);r&&(t[i]=r)}return t}function ko(e,n){const t={...e.colors};for(const[s,i]of Object.entries(n))t[i]!==void 0&&(t[s]=t[i]);return t}const lt={calibri:{google:"Carlito",weights:[400,700],generic:"sans-serif"},"calibri light":{google:"Carlito",weights:[300],generic:"sans-serif"},"calibri (body)":{google:"Carlito",weights:[400,700],generic:"sans-serif"},cambria:{google:"Caladea",weights:[400,700],generic:"serif"},"cambria math":{google:"Caladea",weights:[400],generic:"serif"},aptos:{google:"Inter",weights:[300,400,600,700],generic:"sans-serif"},"aptos display":{google:"Inter",weights:[700,800],generic:"sans-serif"},"aptos narrow":{google:"Inter",weights:[400,700],generic:"sans-serif"},"aptos serif":{google:"Lora",weights:[400,700],generic:"serif"},"aptos mono":{google:"Roboto Mono",weights:[400,700],generic:"monospace"},arial:{google:null,weights:[],generic:"sans-serif"},"arial black":{google:null,weights:[],generic:"sans-serif"},"times new roman":{google:null,weights:[],generic:"serif"},times:{google:null,weights:[],generic:"serif"},helvetica:{google:null,weights:[],generic:"sans-serif"},verdana:{google:null,weights:[],generic:"sans-serif"},tahoma:{google:null,weights:[],generic:"sans-serif"},"trebuchet ms":{google:null,weights:[],generic:"sans-serif"},georgia:{google:null,weights:[],generic:"serif"},"courier new":{google:null,weights:[],generic:"monospace"},courier:{google:null,weights:[],generic:"monospace"},impact:{google:null,weights:[],generic:"sans-serif"},"comic sans ms":{google:null,weights:[],generic:"cursive"},palatino:{google:null,weights:[],generic:"serif"},"lucida console":{google:null,weights:[],generic:"monospace"},"lucida sans unicode":{google:null,weights:[],generic:"sans-serif"},"arial narrow":{google:"Arimo",weights:[400,700],generic:"sans-serif"},candara:{google:"Nunito",weights:[300,400,700],generic:"sans-serif"},consolas:{google:"Roboto Mono",weights:[400,700],generic:"monospace"},constantia:{google:"Libre Baskerville",weights:[400,700],generic:"serif"},corbel:{google:"Lato",weights:[300,400,700],generic:"sans-serif"},"franklin gothic medium":{google:"Libre Franklin",weights:[500],generic:"sans-serif"},"franklin gothic book":{google:"Libre Franklin",weights:[400],generic:"sans-serif"},"franklin gothic heavy":{google:"Libre Franklin",weights:[800],generic:"sans-serif"},"gill sans mt":{google:"Quattrocento Sans",weights:[400,700],generic:"sans-serif"},"gill sans":{google:"Quattrocento Sans",weights:[400,700],generic:"sans-serif"},"century gothic":{google:"Josefin Sans",weights:[300,400,700],generic:"sans-serif"},"century schoolbook":{google:"EB Garamond",weights:[400,700],generic:"serif"},garamond:{google:"EB Garamond",weights:[400,700],generic:"serif"},"palatino linotype":{google:"EB Garamond",weights:[400,700],generic:"serif"},"book antiqua":{google:"EB Garamond",weights:[400,700],generic:"serif"},rockwell:{google:"Roboto Slab",weights:[400,700],generic:"serif"},"rockwell extra bold":{google:"Roboto Slab",weights:[800],generic:"serif"},"segoe ui":{google:"Inter",weights:[300,400,600,700],generic:"sans-serif"},"segoe ui light":{google:"Inter",weights:[300],generic:"sans-serif"},"segoe ui semibold":{google:"Inter",weights:[600],generic:"sans-serif"},"segoe ui semilight":{google:"Inter",weights:[350],generic:"sans-serif"},"helvetica neue":{google:"Nunito Sans",weights:[300,400,700],generic:"sans-serif"},"myriad pro":{google:"Source Sans 3",weights:[300,400,600,700],generic:"sans-serif"},futura:{google:"Josefin Sans",weights:[300,400,700],generic:"sans-serif"},"tw cen mt":{google:"Pathway Gothic One",weights:[400],generic:"sans-serif"},"bookman old style":{google:"Libre Baskerville",weights:[400,700],generic:"serif"},frutiger:{google:"Raleway",weights:[300,400,700],generic:"sans-serif"},optima:{google:"Questrial",weights:[400],generic:"sans-serif"},univers:{google:"Nunito Sans",weights:[300,400,700],generic:"sans-serif"},"open sans":{google:"Open Sans",weights:[300,400,600,700],generic:"sans-serif"},lato:{google:"Lato",weights:[300,400,700],generic:"sans-serif"},montserrat:{google:"Montserrat",weights:[300,400,600,700],generic:"sans-serif"},raleway:{google:"Raleway",weights:[300,400,700],generic:"sans-serif"},roboto:{google:"Roboto",weights:[300,400,700],generic:"sans-serif"},"roboto mono":{google:"Roboto Mono",weights:[400,700],generic:"monospace"},"roboto slab":{google:"Roboto Slab",weights:[300,400,700],generic:"serif"},oswald:{google:"Oswald",weights:[400,700],generic:"sans-serif"},"playfair display":{google:"Playfair Display",weights:[400,700],generic:"serif"},merriweather:{google:"Merriweather",weights:[300,400,700],generic:"serif"},nunito:{google:"Nunito",weights:[300,400,700],generic:"sans-serif"},"nunito sans":{google:"Nunito Sans",weights:[300,400,700],generic:"sans-serif"},poppins:{google:"Poppins",weights:[300,400,600,700],generic:"sans-serif"},inter:{google:"Inter",weights:[300,400,600,700],generic:"sans-serif"},"work sans":{google:"Work Sans",weights:[300,400,600,700],generic:"sans-serif"},"dm sans":{google:"DM Sans",weights:[300,400,500,700],generic:"sans-serif"},"dm serif display":{google:"DM Serif Display",weights:[400],generic:"serif"},ubuntu:{google:"Ubuntu",weights:[300,400,700],generic:"sans-serif"},"ubuntu mono":{google:"Ubuntu Mono",weights:[400,700],generic:"monospace"},"source sans pro":{google:"Source Sans 3",weights:[300,400,600,700],generic:"sans-serif"},"source serif pro":{google:"Source Serif 4",weights:[300,400,700],generic:"serif"},"source code pro":{google:"Source Code Pro",weights:[400,700],generic:"monospace"},"exo 2":{google:"Exo 2",weights:[300,400,700],generic:"sans-serif"},"titillium web":{google:"Titillium Web",weights:[300,400,600,700],generic:"sans-serif"},"fira sans":{google:"Fira Sans",weights:[300,400,600,700],generic:"sans-serif"},"fira mono":{google:"Fira Mono",weights:[400,700],generic:"monospace"},"josefin sans":{google:"Josefin Sans",weights:[300,400,700],generic:"sans-serif"},"josefin slab":{google:"Josefin Slab",weights:[300,400,700],generic:"serif"},barlow:{google:"Barlow",weights:[300,400,600,700],generic:"sans-serif"},"barlow condensed":{google:"Barlow Condensed",weights:[300,400,600,700],generic:"sans-serif"},cabin:{google:"Cabin",weights:[400,700],generic:"sans-serif"},"crimson text":{google:"Crimson Text",weights:[400,700],generic:"serif"},"libre baskerville":{google:"Libre Baskerville",weights:[400,700],generic:"serif"},"libre franklin":{google:"Libre Franklin",weights:[400,700],generic:"sans-serif"},"eb garamond":{google:"EB Garamond",weights:[400,700],generic:"serif"},spectral:{google:"Spectral",weights:[300,400,700],generic:"serif"},arvo:{google:"Arvo",weights:[400,700],generic:"serif"},"pt sans":{google:"PT Sans",weights:[400,700],generic:"sans-serif"},"pt serif":{google:"PT Serif",weights:[400,700],generic:"serif"},"pt mono":{google:"PT Mono",weights:[400],generic:"monospace"},karla:{google:"Karla",weights:[300,400,700],generic:"sans-serif"},mukta:{google:"Mukta",weights:[300,400,700],generic:"sans-serif"},hind:{google:"Hind",weights:[300,400,700],generic:"sans-serif"},"noto sans":{google:"Noto Sans",weights:[300,400,700],generic:"sans-serif"},"noto serif":{google:"Noto Serif",weights:[300,400,700],generic:"serif"}},Gt=new Set,_t=new Map,qt=new Set;let ts=null,yn=null;function _o(){return yn||(ts=typeof OffscreenCanvas<"u"?new OffscreenCanvas(300,10):Object.assign(document.createElement("canvas"),{width:300,height:10}),yn=ts.getContext("2d")),yn}const ns="mmmmmmmmmmlllllllllliiiiiiiiiixxxxxxxxxx",So=[20,40];function Ws(e){if(qt.has(e))return!0;if(typeof document<"u"&&document.fonts&&document.fonts.check(`16px "${e}"`))return qt.add(e),!0;try{const n=_o(),t=["monospace","serif"];for(const s of So)for(const i of t){n.font=`${s}px ${i}`;const r=n.measureText(ns).width;n.font=`${s}px "${e}", ${i}`;const o=n.measureText(ns).width;if(Math.abs(o-r)>.5)return qt.add(e),!0}}catch{}return!1}async function Sn(e,n,t={}){let s;if(typeof n=="string"||n instanceof URL)s=n.toString();else if(n instanceof File||n instanceof Blob)s=await n.arrayBuffer();else if(n instanceof Uint8Array)s=n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);else if(n instanceof ArrayBuffer)s=n;else throw new TypeError("registerFont: unsupported source type. Expected string, URL, File, Blob, ArrayBuffer, or Uint8Array.");const i={weight:"normal",style:"normal",...t},r=new FontFace(e,typeof s=="string"?`url(${s})`:s,i);await r.load(),document.fonts.add(r);const o=_t.get(e)??[];o.push(r),_t.set(e,o),Gt.add(e),qt.add(e);const l=e.toLowerCase().trim();return lt[l]?lt[l]._custom=!0:lt[l]={google:null,weights:[],generic:"sans-serif",_custom:!0},console.log(`[pptx-canvas-renderer] Custom font registered: "${e}" (${i.weight} ${i.style})`),r}async function Po(e){const n=[];for(const[t,s]of Object.entries(e))if(typeof s=="string")n.push(Sn(t,s));else if(Array.isArray(s))for(const i of s){const{url:r,...o}=i;n.push(Sn(t,r,o))}await Promise.all(n)}function To(e,n){if(!e)return[];const t=b(e,"embeddedFontLst");if(!t)return[];const s=[];for(const i of t.children){if(i.localName!=="embeddedFont")continue;const r=b(i,"font"),o=r?r.getAttribute("typeface"):null;if(!o)continue;const l={regular:!1,bold:!1,italic:!1,boldItalic:!1},a=[];for(const c of["regular","bold","italic","boldItalic"]){const d=b(i,c);if(!d)continue;const h=d.getAttribute("r:id")||d.getAttribute("id"),u=n?.[h];u&&(a.push(u.fullPath),l[c]=!0)}s.push({family:o,hasRegular:l.regular,hasBold:l.bold,hasItalic:l.italic,hasBoldItalic:l.boldItalic,paths:a,note:".fntdata files are a proprietary Microsoft format and cannot be used as web fonts directly. Use registerFont() with a compatible woff2/ttf version instead."})}return s}function jo(e){if(!e)return"sans-serif";if(e==="+mj-lt"||e==="+mj")return"serif";if(e==="+mn-lt"||e==="+mn")return"sans-serif";if(_t.has(e))return e;const n=e.toLowerCase().trim(),t=lt[n];return t?t._custom||t.google===null?e:t.google&&Ws(t.google)?t.google:t.google||e:e}function Co(e){if(!e)return"sans-serif";const n=e.toLowerCase().trim();return lt[n]?.generic??"sans-serif"}async function Fo(e,n){const t=[...e];n?.majorFont&&t.push(n.majorFont),n?.minorFont&&t.push(n.minorFont);const s=new Map;for(const o of t){if(!o||o.startsWith("+")||o==="+mj-lt"||o==="+mn-lt"||o==="+mj"||o==="+mn"||_t.has(o))continue;const l=o.toLowerCase().trim(),a=lt[l];let c=null,d=[400,700];if(a){if(a._custom||a.google===null)continue;c=a.google,d=a.weights.length?a.weights:[400,700]}else c=o;if(!c||Gt.has(c))continue;if(Ws(c)){Gt.add(c);continue}const h=s.get(c)??new Set;d.forEach(u=>h.add(u)),s.set(c,h)}if(s.size===0)return;for(const o of s.keys())Gt.add(o);const r=`https://fonts.googleapis.com/css2?${[...s.entries()].map(([o,l])=>{const a=[...l].sort((d,h)=>d-h),c=[...a.map(d=>`0,${d}`),...a.map(d=>`1,${d}`)].join(";");return`family=${encodeURIComponent(`${o}:ital,wght@${c}`)}`}).join("&")}&display=swap`;try{const o=document.createElement("link");o.rel="stylesheet",o.href=r,document.head.appendChild(o),await new Promise(l=>{o.onload=l,o.onerror=()=>{console.warn("[pptx-canvas-renderer] Google Fonts failed to load:",r),l()},setTimeout(l,5e3)}),document.fonts?.ready&&await Promise.race([document.fonts.ready,new Promise(l=>setTimeout(l,2e3))])}catch(o){console.warn("[pptx-canvas-renderer] Font loading error:",o)}}function No(e){const n=new Set;for(const t of e){if(!t)continue;const s=t.getElementsByTagName("*");for(let i=0;i<s.length;i++){const r=s[i],o=r.localName;if(o==="latin"||o==="ea"||o==="cs"){const l=r.getAttribute("typeface");l&&!l.startsWith("+")&&n.add(l)}}}return n}function Ks(e,n,t,s,i=1800,r=null){let o=i;if(r){const y=r.getAttribute("sz");y&&(o=parseInt(y,10))}if(n){const y=n.getAttribute("sz");y&&(o=parseInt(y,10))}if(e){const y=e.getAttribute("sz");y&&(o=parseInt(y,10))}let l=!1,a=!1;if(r&&(r.getAttribute("b")==="1"&&(l=!0),r.getAttribute("i")==="1"&&(a=!0)),n){const y=n.getAttribute("b"),w=n.getAttribute("i");y==="1"?l=!0:y==="0"&&(l=!1),w==="1"?a=!0:w==="0"&&(a=!1)}if(e){const y=e.getAttribute("b"),w=e.getAttribute("i");y==="1"?l=!0:y==="0"&&(l=!1),w==="1"?a=!0:w==="0"&&(a=!1)}let c=s?.minorFont??"Calibri";function d(y){if(!y)return;const w=b(y,"latin"),x=w?w.getAttribute("typeface"):y.getAttribute("typeface");if(x){if(x==="+mj-lt"||x==="+mj"){c=s?.majorFont??c;return}if(x==="+mn-lt"||x==="+mn"){c=s?.minorFont??c;return}c=x}}d(r),d(n),d(e);const h=jo(c),u=Co(c),p=o*127*t;return{fontStr:`${a?"italic ":""}${l?"bold":"normal"} ${p}px "${h}", ${u}`,sz:o,szPx:p,bold:l,italic:a,family:h,generic:u,rawFamily:c}}function Mo(){const e=[];for(const[n,t]of _t)for(const s of t)e.push({family:n,weight:s.weight,style:s.style,status:s.status});return e}function Rt(e){const n=e.replace("#","");return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16)}}function Qe(e,n,t){e/=255,n/=255,t/=255;const s=Math.max(e,n,t),i=Math.min(e,n,t);let r=0,o=0;const l=(s+i)/2;if(s!==i){const a=s-i;switch(o=l>.5?a/(2-s-i):a/(s+i),s){case e:r=((n-t)/a+(n<t?6:0))/6;break;case n:r=((t-e)/a+2)/6;break;case t:r=((e-n)/a+4)/6;break}}return{h:r,l,s:o}}function Ve(e,n,t){if(t===0){const o=Math.round(n*255);return{r:o,g:o,b:o}}const s=n<.5?n*(1+t):n+t-n*t,i=2*n-s,r=(o,l,a)=>(a<0&&(a+=1),a>1&&(a-=1),a<1/6?o+(l-o)*6*a:a<1/2?l:a<2/3?o+(l-o)*(2/3-a)*6:o);return{r:Math.round(r(i,s,e+1/3)*255),g:Math.round(r(i,s,e)*255),b:Math.round(r(i,s,e-1/3)*255)}}const Ao={black:"000000",white:"FFFFFF",red:"FF0000",green:"008000",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF",orange:"FFA500",purple:"800080",pink:"FFC0CB",brown:"A52A2A",gray:"808080",grey:"808080",navy:"000080",teal:"008080",maroon:"800000",olive:"808000",lime:"00FF00",aqua:"00FFFF",fuchsia:"FF00FF",silver:"C0C0C0",coral:"FF7F50",salmon:"FA8072",gold:"FFD700",khaki:"F0E68C",lavender:"E6E6FA",beige:"F5F5DC",ivory:"FFFFF0",mintcream:"F5FFFA",azure:"F0FFFF",aliceblue:"F0F8FF",ghostwhite:"F8F8FF",darkred:"8B0000",darkgreen:"006400",darkblue:"00008B",darkcyan:"008B8B",darkmagenta:"8B008B",darkorange:"FF8C00",darkgray:"A9A9A9",darkgrey:"A9A9A9",lightgray:"D3D3D3",lightgrey:"D3D3D3",lightblue:"ADD8E6",lightgreen:"90EE90",lightpink:"FFB6C1",lightyellow:"FFFFE0",lightcyan:"E0FFFF",deepskyblue:"00BFFF",royalblue:"4169E1",steelblue:"4682B4",skyblue:"87CEEB",dodgerblue:"1E90FF",cornflowerblue:"6495ED",mediumblue:"0000CD",midnightblue:"191970",indigo:"4B0082",slateblue:"6A5ACD",blueviolet:"8A2BE2",mediumpurple:"9370DB",orchid:"DA70D6",violet:"EE82EE",plum:"DDA0DD",thistle:"D8BFD8",hotpink:"FF69B4",deeppink:"FF1493",crimson:"DC143C",firebrick:"B22222",tomato:"FF6347",orangered:"FF4500",darkorange2:"FF8C00",chocolate:"D2691E",saddlebrown:"8B4513",sienna:"A0522D",tan:"D2B48C",burlywood:"DEB887",wheat:"F5DEB3",moccasin:"FFE4B5",peachpuff:"FFDAB9",papayawhip:"FFEFD5",mistyrose:"FFE4E1",linen:"FAF0E6",oldlace:"FDF5E6",floralwhite:"FFFAF0",antiquewhite:"FAEBD7",bisque:"FFE4C4",blanchedalmond:"FFEBCD",cornsilk:"FFF8DC",lemonchiffon:"FFFACD",honeydew:"F0FFF0",palegreen:"98FB98",lightseagreen:"20B2AA",mediumseagreen:"3CB371",seagreen:"2E8B57",forestgreen:"228B22",yellowgreen:"9ACD32",olivedrab:"6B8E23",greenyellow:"ADFF2F",chartreuse:"7FFF00",springgreen:"00FF7F",mediumspringgreen:"00FA9A",aquamarine:"7FFFD4",turquoise:"40E0D0",mediumturquoise:"48D1CC",paleturquoise:"AFEEEE",cadetblue:"5F9EA0",powderblue:"B0E0E6",lightsteelblue:"B0C4DE",slategray:"708090",slategrey:"708090",dimgray:"696969",dimgrey:"696969",snow:"FFFAFA",seashell:"FFF5EE",whitesmoke:"F5F5F5",gainsboro:"DCDCDC"};function $o(e,n){if(!n)return e;let{r:t,g:s,b:i,a:r=1}=e;for(const o of n.children){const l=o.localName,a=parseInt(o.getAttribute("val")??"0",10);switch(l){case"lumMod":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h,Le(d.l*c,0,1),d.s);t=h.r,s=h.g,i=h.b;break}case"lumOff":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h,Le(d.l+c,0,1),d.s);t=h.r,s=h.g,i=h.b;break}case"tint":{const c=a/1e5;t=Math.round(t+(255-t)*(1-c)),s=Math.round(s+(255-s)*(1-c)),i=Math.round(i+(255-i)*(1-c));break}case"shade":{const c=a/1e5;t=Math.round(t*c),s=Math.round(s*c),i=Math.round(i*c);break}case"satMod":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h,d.l,Le(d.s*c,0,1));t=h.r,s=h.g,i=h.b;break}case"satOff":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h,d.l,Le(d.s+c,0,1));t=h.r,s=h.g,i=h.b;break}case"hueMod":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h*c%1,d.l,d.s);t=h.r,s=h.g,i=h.b;break}case"hueOff":{const c=a/216e5,d=Qe(t,s,i),h=Ve(((d.h+c)%1+1)%1,d.l,d.s);t=h.r,s=h.g,i=h.b;break}case"alpha":{r=a/1e5;break}case"alphaOff":{r=Le(r+a/1e5,0,1);break}case"alphaMod":{r=Le(r*a/1e5,0,1);break}case"inv":{t=255-t,s=255-s,i=255-i;break}case"gray":{t=s=i=Math.round(.2126*t+.7152*s+.0722*i);break}case"comp":{const c=Qe(t,s,i),d=Ve((c.h+.5)%1,c.l,c.s);t=d.r,s=d.g,i=d.b;break}}}return{r:Le(t,0,255),g:Le(s,0,255),b:Le(i,0,255),a:r}}function _e(e,n){if(!e)return null;const t=e.localName;let s=null,i=1;if(t==="srgbClr"){const r=e.getAttribute("val")||"";r.length>=6&&(s=Rt(r))}else if(t==="schemeClr"){const o=e.getAttribute("val")||"",l=n?.[o];l?s=Rt(l):s={r:0,g:0,b:0}}else if(t==="prstClr"){const r=(e.getAttribute("val")||"").toLowerCase(),o=Ao[r];o&&(s=Rt(o))}else if(t==="sysClr"){const r=e.getAttribute("lastClr");r?.length>=6?s=Rt(r):s={r:0,g:0,b:0}}else if(t==="hslClr"){const r=C(e,"hue",0)/216e5,o=C(e,"sat",0)/1e5,l=C(e,"lum",0)/1e5;s=Ve(r,l,o)}else if(t==="scRgbClr"){const r=C(e,"r",0)/1e5,o=C(e,"g",0)/1e5,l=C(e,"b",0)/1e5;s={r:Math.round(Math.pow(r,1/2.2)*255),g:Math.round(Math.pow(o,1/2.2)*255),b:Math.round(Math.pow(l,1/2.2)*255)}}return s?$o({...s,a:i},e):null}function we(e,n){if(!e)return"transparent";const t=n!==void 0?n:e.a??1;return t<1?`rgba(${e.r},${e.g},${e.b},${t.toFixed(3)})`:`rgb(${e.r},${e.g},${e.b})`}function xe(e){if(!e)return null;const n=["srgbClr","schemeClr","prstClr","sysClr","hslClr","scRgbClr"];for(const t of n){const s=b(e,t);if(s)return s}return null}function ss(e,n){if(!e)return null;const t=b(e,"solidFill");if(!t)return null;const s=xe(t),i=_e(s,n);return i?we(i):null}function Eo(e,n,t){const s=ss(e,t);return s||ss(n,t)}function Yt(e,n,t,s,i,r,o){const l=u=>u*Math.PI/180,a=(u,p=5e4)=>(o&&o[u]!==void 0?o[u]:p)/1e5,c=t+i/2,d=s+r/2,h=Math.min(i,r);switch(e.beginPath(),n){case"rect":case"snip1Rect":e.rect(t,s,i,r);break;case"roundRect":{const u=a(0,16667)*h*.5;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.arcTo(t+i,s,t+i,s+u,u),e.lineTo(t+i,s+r-u),e.arcTo(t+i,s+r,t+i-u,s+r,u),e.lineTo(t+u,s+r),e.arcTo(t,s+r,t,s+r-u,u),e.lineTo(t,s+u),e.arcTo(t,s,t+u,s,u),e.closePath();break}case"ellipse":case"oval":e.ellipse(c,d,i/2,r/2,0,0,Math.PI*2);break;case"triangle":case"isoscelesTriangle":e.moveTo(c,s),e.lineTo(t+i,s+r),e.lineTo(t,s+r),e.closePath();break;case"rightTriangle":e.moveTo(t,s),e.lineTo(t+i,s+r),e.lineTo(t,s+r),e.closePath();break;case"parallelogram":{const u=a(0,25e3),p=i*u;e.moveTo(t+p,s),e.lineTo(t+i,s),e.lineTo(t+i-p,s+r),e.lineTo(t,s+r),e.closePath();break}case"trapezoid":{const u=a(0,25e3),p=i*u;e.moveTo(t+p,s),e.lineTo(t+i-p,s),e.lineTo(t+i,s+r),e.lineTo(t,s+r),e.closePath();break}case"diamond":e.moveTo(c,s),e.lineTo(t+i,d),e.lineTo(c,s+r),e.lineTo(t,d),e.closePath();break;case"pentagon":ot(e,c,d,i/2,r/2,5,-Math.PI/2);break;case"hexagon":ot(e,c,d,i/2,r/2,6,0);break;case"heptagon":ot(e,c,d,i/2,r/2,7,-Math.PI/2);break;case"octagon":ot(e,c,d,i/2,r/2,8,Math.PI/8);break;case"decagon":ot(e,c,d,i/2,r/2,10,-Math.PI/2);break;case"dodecagon":ot(e,c,d,i/2,r/2,12,0);break;case"plus":case"cross":{const u=a(0,25e3),p=h*u,m=c-p/2,g=c+p/2,S=d-p/2,y=d+p/2;e.moveTo(m,s),e.lineTo(g,s),e.lineTo(g,S),e.lineTo(t+i,S),e.lineTo(t+i,y),e.lineTo(g,y),e.lineTo(g,s+r),e.lineTo(m,s+r),e.lineTo(m,y),e.lineTo(t,y),e.lineTo(t,S),e.lineTo(m,S),e.closePath();break}case"star4":Re(e,c,d,i/2,r/2,4,a(0,37500));break;case"star5":Re(e,c,d,i/2,r/2,5,a(0,19098),-Math.PI/2);break;case"star6":Re(e,c,d,i/2,r/2,6,a(0,28868),0);break;case"star7":Re(e,c,d,i/2,r/2,7,a(0,34601),-Math.PI/2);break;case"star8":Re(e,c,d,i/2,r/2,8,a(0,29289),Math.PI/8);break;case"star10":Re(e,c,d,i/2,r/2,10,a(0,30902),-Math.PI/2);break;case"star12":Re(e,c,d,i/2,r/2,12,a(0,37720),0);break;case"star16":Re(e,c,d,i/2,r/2,16,a(0,37500),0);break;case"star24":Re(e,c,d,i/2,r/2,24,a(0,37500),0);break;case"star32":Re(e,c,d,i/2,r/2,32,a(0,37500),0);break;case"rightArrow":{const u=a(0,5e4),p=a(1,5e4),m=(r-r*p)/2,g=t+i*(1-u);e.moveTo(t,s+m),e.lineTo(g,s+m),e.lineTo(g,s),e.lineTo(t+i,d),e.lineTo(g,s+r),e.lineTo(g,s+r-m),e.lineTo(t,s+r-m),e.closePath();break}case"leftArrow":{const u=a(0,5e4),p=a(1,5e4),m=(r-r*p)/2,g=t+i*u;e.moveTo(t+i,s+m),e.lineTo(g,s+m),e.lineTo(g,s),e.lineTo(t,d),e.lineTo(g,s+r),e.lineTo(g,s+r-m),e.lineTo(t+i,s+r-m),e.closePath();break}case"upArrow":{const u=a(0,5e4),p=a(1,5e4),m=(i-i*p)/2,g=s+r*u;e.moveTo(t+m,s+r),e.lineTo(t+m,g),e.lineTo(t,g),e.lineTo(c,s),e.lineTo(t+i,g),e.lineTo(t+i-m,g),e.lineTo(t+i-m,s+r),e.closePath();break}case"downArrow":{const u=a(0,5e4),p=a(1,5e4),m=(i-i*p)/2,g=s+r*(1-u);e.moveTo(t+m,s),e.lineTo(t+m,g),e.lineTo(t,g),e.lineTo(c,s+r),e.lineTo(t+i,g),e.lineTo(t+i-m,g),e.lineTo(t+i-m,s),e.closePath();break}case"leftRightArrow":{const u=a(0,25e3),p=a(1,5e4),m=(r-r*p)/2,g=t+i*u,S=t+i*(1-u);e.moveTo(t,d),e.lineTo(g,s),e.lineTo(g,s+m),e.lineTo(S,s+m),e.lineTo(S,s),e.lineTo(t+i,d),e.lineTo(S,s+r),e.lineTo(S,s+r-m),e.lineTo(g,s+r-m),e.lineTo(g,s+r),e.closePath();break}case"upDownArrow":{const u=a(0,25e3),p=a(1,5e4),m=(i-i*p)/2,g=s+r*u,S=s+r*(1-u);e.moveTo(c,s),e.lineTo(t+i,g),e.lineTo(t+i-m,g),e.lineTo(t+i-m,S),e.lineTo(t+i,S),e.lineTo(c,s+r),e.lineTo(t,S),e.lineTo(t+m,S),e.lineTo(t+m,g),e.lineTo(t,g),e.closePath();break}case"chevron":{const u=a(0,5e4),p=i*u;e.moveTo(t,s),e.lineTo(t+i-p,s),e.lineTo(t+i,d),e.lineTo(t+i-p,s+r),e.lineTo(t,s+r),e.lineTo(t+p,d),e.closePath();break}case"pentagon5":case"homePlate":{const u=a(0,5e4);e.moveTo(t,s),e.lineTo(t+i*(1-u),s),e.lineTo(t+i,d),e.lineTo(t+i*(1-u),s+r),e.lineTo(t,s+r),e.closePath();break}case"arc":{const u=a(0,270)*Math.PI/180,p=a(1,288e5/6e4)*Math.PI/180;e.moveTo(c,d),e.arc(c,d,Math.min(i,r)/2,u,u+p),e.closePath();break}case"blockArc":{const u=(a(0,0)*360-90)*Math.PI/180,p=a(1,25e3)*360*Math.PI/180,m=a(2,25e3)*Math.min(i,r)/2,g=Math.min(i,r)/2,S=g-m;e.moveTo(c+g*Math.cos(u),d+g*Math.sin(u)),e.arc(c,d,g,u,u+p),e.arc(c,d,Math.max(1,S),u+p,u,!0),e.closePath();break}case"line":case"straightConnector1":e.moveTo(t,d),e.lineTo(t+i,d);break;case"bentConnector3":case"bentConnector4":case"bentConnector5":case"elbowConnector":e.moveTo(t,s),e.lineTo(t,d),e.lineTo(t+i,d),e.lineTo(t+i,s+r);break;case"curvedConnector3":case"curvedConnector4":e.moveTo(t,s),e.bezierCurveTo(t,s+r/2,t+i,s+r/2,t+i,s+r);break;case"heart":{Ro(e,t,s,i,r);break}case"lightningBolt":{e.moveTo(t+i*.6,s),e.lineTo(t+i*.2,s+r*.45),e.lineTo(t+i*.5,s+r*.45),e.lineTo(t+i*.4,s+r),e.lineTo(t+i*.8,s+r*.55),e.lineTo(t+i*.5,s+r*.55),e.closePath();break}case"moon":{e.arc(c+i*.1,d,r*.5,l(-120),l(120)),e.arc(c+i*.4,d,r*.45,l(120),l(-120),!0),e.closePath();break}case"noSmoking":{const u=Math.min(i,r)/2;e.arc(c,d,u,0,Math.PI*2),e.moveTo(c-u*.7,d+u*.7),e.lineTo(c+u*.7,d-u*.7);break}case"flowChartProcess":e.rect(t,s,i,r);break;case"flowChartDecision":e.moveTo(c,s),e.lineTo(t+i,d),e.lineTo(c,s+r),e.lineTo(t,d),e.closePath();break;case"flowChartTerminator":{const u=r/2;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.arc(t+i-u,d,u,-Math.PI/2,Math.PI/2),e.lineTo(t+u,s+r),e.arc(t+u,d,u,Math.PI/2,-Math.PI/2),e.closePath();break}case"flowChartDocument":{e.moveTo(t,s),e.lineTo(t+i,s),e.lineTo(t+i,s+r*.8),e.bezierCurveTo(t+i*.75,s+r*.8,t+i*.75,s+r,t+i*.5,s+r),e.bezierCurveTo(t+i*.25,s+r,t+i*.25,s+r*.8,t,s+r*.8),e.closePath();break}case"flowChartDatabase":case"cylinder":{const u=r*.1;e.moveTo(t,s+u),e.ellipse(c,s+u,i/2,u,0,Math.PI,0),e.lineTo(t+i,s+r-u),e.ellipse(c,s+r-u,i/2,u,0,0,Math.PI),e.closePath();break}case"cube":{const u=i*.15;e.moveTo(t+u,s),e.lineTo(t+i,s),e.lineTo(t+i,s+r-u),e.lineTo(t+i-u,s+r),e.lineTo(t,s+r),e.lineTo(t,s+u),e.closePath(),e.moveTo(t+u,s),e.lineTo(t+u,s+u),e.lineTo(t,s+u),e.moveTo(t+u,s+u),e.lineTo(t+i,s+u);break}case"callout1":case"borderCallout1":case"wedgeRectCallout":{e.rect(t,s,i,r*.8),e.moveTo(c-i*.1,s+r*.8),e.lineTo(c,s+r),e.lineTo(c+i*.1,s+r*.8),e.closePath();break}case"wedgeRoundRectCallout":{const u=r*.05;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.arcTo(t+i,s,t+i,s+u,u),e.lineTo(t+i,s+r*.75-u),e.arcTo(t+i,s+r*.75,t+i-u,s+r*.75,u),e.lineTo(c+i*.1,s+r*.75),e.lineTo(c,s+r),e.lineTo(c-i*.1,s+r*.75),e.lineTo(t+u,s+r*.75),e.arcTo(t,s+r*.75,t,s+r*.75-u,u),e.lineTo(t,s+u),e.arcTo(t,s,t+u,s,u),e.closePath();break}case"wedgeEllipseCallout":{e.ellipse(c,d-r*.05,i/2,r*.45,0,0,Math.PI*2),e.moveTo(c-i*.1,d+r*.4),e.lineTo(c,s+r),e.lineTo(c+i*.1,d+r*.4),e.closePath();break}case"cloudCallout":case"cloud":{e.beginPath();const u=[{cx:c-i*.22,cy:d-r*.12,r:i*.16},{cx:c-i*.07,cy:d-r*.22,r:i*.18},{cx:c+i*.1,cy:d-r*.22,r:i*.17},{cx:c+i*.25,cy:d-r*.12,r:i*.15},{cx:c+i*.35,cy:d+r*.05,r:i*.13},{cx:c-i*.3,cy:d+r*.05,r:i*.13}];for(const p of u)e.arc(p.cx,p.cy,p.r,0,Math.PI*2);e.rect(c-i*.35,d,i*.7,r*.25);break}case"smileyFace":{e.arc(c,d,Math.min(i,r)/2,0,Math.PI*2);break}case"donut":{const u=Math.min(i,r)/2,p=u*a(0,25e3);e.arc(c,d,u,0,Math.PI*2),e.arc(c,d,p,Math.PI*2,0,!0);break}case"bracketPair":{const u=i*.2;e.moveTo(t+u,s),e.arcTo(t,s,t,s+u,u),e.lineTo(t,s+r-u),e.arcTo(t,s+r,t+u,s+r,u),e.moveTo(t+i-u,s),e.arcTo(t+i,s,t+i,s+u,u),e.lineTo(t+i,s+r-u),e.arcTo(t+i,s+r,t+i-u,s+r,u);break}case"bracePair":{const u=r*.15;e.moveTo(c-i*.35,s),e.bezierCurveTo(c-i*.45,s,c-i*.45,s,c-i*.45,s+u),e.lineTo(c-i*.45,d-u),e.bezierCurveTo(c-i*.45,d,c-i*.5,d,c-i*.5,d),e.bezierCurveTo(c-i*.5,d,c-i*.45,d,c-i*.45,d+u),e.lineTo(c-i*.45,s+r-u),e.bezierCurveTo(c-i*.45,s+r,c-i*.35,s+r,c-i*.35,s+r);break}case"irregularSeal1":case"irregularSeal2":{Re(e,c,d,i/2,r/2,12,a(0,42533),0);break}case"accentCallout1":case"accentCallout2":case"calloutWedgeRect":e.rect(t,s,i,r);break;case"flowChartAlternateProcess":{const u=r*.15;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.arcTo(t+i,s,t+i,s+u,u),e.lineTo(t+i,s+r-u),e.arcTo(t+i,s+r,t+i-u,s+r,u),e.lineTo(t+u,s+r),e.arcTo(t,s+r,t,s+r-u,u),e.lineTo(t,s+u),e.arcTo(t,s,t+u,s,u),e.closePath();break}case"flowChartConnector":e.arc(c,d,Math.min(i,r)/2,0,Math.PI*2);break;case"flowChartInputOutput":{const u=i*.2;e.moveTo(t+u,s),e.lineTo(t+i,s),e.lineTo(t+i-u,s+r),e.lineTo(t,s+r),e.closePath();break}case"flowChartPredefinedProcess":{e.rect(t,s,i,r),e.moveTo(t+i*.1,s),e.lineTo(t+i*.1,s+r),e.moveTo(t+i*.9,s),e.lineTo(t+i*.9,s+r);break}case"flowChartManualInput":{e.moveTo(t,s+r*.2),e.lineTo(t+i,s),e.lineTo(t+i,s+r),e.lineTo(t,s+r),e.closePath();break}case"flowChartPreparation":{const u=i*.2;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.lineTo(t+i,d),e.lineTo(t+i-u,s+r),e.lineTo(t+u,s+r),e.lineTo(t,d),e.closePath();break}case"ribbon":case"ribbon2":{const u=r*.3;e.moveTo(t,s+u/2),e.lineTo(t+i*.1,s),e.lineTo(t+i*.1,s+r-u),e.lineTo(t,s+r),e.lineTo(t+i*.5,s+r-u),e.lineTo(t+i,s+r),e.lineTo(t+i-i*.1,s+r-u),e.lineTo(t+i-i*.1,s),e.lineTo(t+i,s+u/2),e.lineTo(t+i*.5,s+u),e.closePath();break}case"ellipseRibbon":case"ellipseRibbon2":{e.ellipse(c,d,i/2,r/2,0,0,Math.PI*2);break}case"teardrop":{const u=Math.min(i,r)*.45;e.arc(c,d+u,u,-Math.PI,0),e.bezierCurveTo(c+u,d+u-u*.55,c+u*.1,d-r*.4,c,s),e.bezierCurveTo(c-u*.1,d-r*.4,c-u,d+u-u*.55,c-u,d+u),e.closePath();break}default:return e.rect(t,s,i,r),!1}return!0}function ot(e,n,t,s,i,r,o=0){for(let l=0;l<r;l++){const a=o+l/r*Math.PI*2,c=n+s*Math.cos(a),d=t+i*Math.sin(a);l===0?e.moveTo(c,d):e.lineTo(c,d)}e.closePath()}function Re(e,n,t,s,i,r,o=.5,l=-Math.PI/2){for(let a=0;a<r*2;a++){const c=l+a/(r*2)*Math.PI*2,d=a%2===1,h=d?s*o:s,u=d?i*o:i,p=n+h*Math.cos(c),m=t+u*Math.sin(c);a===0?e.moveTo(p,m):e.lineTo(p,m)}e.closePath()}function Ro(e,n,t,s,i){e.beginPath();const r=n+s/2,o=t+i*.25;e.moveTo(r,t+i*.9),e.bezierCurveTo(n-s*.1,t+i*.6,n-s*.1,o-i*.05,r-s*.25,o-i*.1),e.bezierCurveTo(r-s*.5+s*.05,t+i*.05,r-s*.03,t+i*.05,r,o-i*.15),e.bezierCurveTo(r+s*.03,t+i*.05,r+s*.5-s*.05,t+i*.05,r+s*.25,o-i*.1),e.bezierCurveTo(n+s*1.1,o-i*.05,n+s*1.1,t+i*.6,r,t+i*.9),e.closePath()}const is=["#4472C4","#ED7D31","#A9D18E","#FF0000","#FFC000","#5B9BD5","#70AD47","#C00000","#7030A0","#00B0F0","#FF7F00","#9E480E"];function zo(e){const n=e?.textContent?.trim();if(n==null||n==="")return null;const t=parseFloat(n);return isNaN(t)?n:t}function vt(e){if(!e)return[];const n=C(b(e,"ptCount"),"val",0),t=new Array(n).fill(null);for(const s of pe(e,"pt")){const i=C(s,"idx",0);t[i]=zo(b(s,"v"))}return t}function Ct(e){const n=b(e,"tx");if(!n)return null;const t=b(n,"v");if(t)return t.textContent.trim();const s=b(n,"strCache");if(s){const i=b(s,"pt"),r=i?b(i,"v"):null;return r?r.textContent.trim():null}return null}function rn(e){const n=b(e,"cat")||b(e,"xVal");return n?vt(b(n,"strCache")||b(n,"numCache")):[]}function Ft(e){const n=b(e,"val")||b(e,"yVal");return n?vt(b(n,"numCache")):[]}function tt(e,n,t){const s=b(e,"spPr");if(s){const r=b(s,"solidFill");if(r){const o=xe(r),l=_e(o,t);if(l)return we(l)}}const i=`accent${n%6+1}`;return t[i]?`#${t[i]}`:is[n%is.length]}function Vs(e,n){const t={};for(const s of pe(e,"dPt")){const i=C(b(s,"idx"),"val",-1);if(i<0)continue;const r=b(s,"spPr");if(!r)continue;const o=b(r,"solidFill");if(!o)continue;const l=xe(o),a=_e(l,n);a&&(t[i]=we(a))}return t}function on(e,n,t,s,i={}){const{padL:r=.12,padR:o=.06,padT:l=.08,padB:a=.1,legendH:c=.1,hasLegend:d=!0,hasTitle:h=!1}=i,u=h?s*.08:0,p=d?s*c:0;return{x:e+t*r,y:n+s*l+u,w:t*(1-r-o),h:s*(1-l-a)-p-u,legendY:n+s*(1-c*.7)}}function St(e,n,t,s,i,r=3){s<0&&(n+=s,s=-s),i<0&&(t+=i,i=-i),r=Math.min(r,Math.abs(s)/2,Math.abs(i)/2),e.beginPath(),e.moveTo(n+r,t),e.arcTo(n+s,t,n+s,t+i,r),e.arcTo(n+s,t+i,n,t+i,r),e.arcTo(n,t+i,n,t,r),e.arcTo(n,t,n+s,t,r),e.closePath()}function ze(e,n,t,s,i,r="#999",o=.7){e.save(),e.strokeStyle=r,e.lineWidth=o,e.setLineDash([]),e.beginPath(),e.moveTo(n,t),e.lineTo(s,i),e.stroke(),e.restore()}function nt(e,n,t,s,i){e.save(),e.strokeStyle="rgba(0,0,0,0.10)",e.lineWidth=.5,e.setLineDash([3,3]),e.beginPath(),e.moveTo(n,t),e.lineTo(s,i),e.stroke(),e.setLineDash([]),e.restore()}function Xs(e,n=5){const t=e/n,s=Math.pow(10,Math.floor(Math.log10(t))),i=t/s;let r;return i<1.5?r=1:i<3.5?r=2:i<7.5?r=5:r=10,r*s}function Pt(e,n=!0){const t=e.filter(o=>typeof o=="number"&&isFinite(o));if(!t.length)return{min:0,max:100,step:20};let s=n?Math.min(0,...t):Math.min(...t),i=Math.max(...t);s===i&&(s-=1,i+=1);const r=Xs(i-s);return i=Math.ceil(i/r)*r,s=Math.floor(s/r)*r,{min:s,max:i,step:r}}function st(e){return typeof e!="number"?String(e??""):Math.abs(e)>=1e9?(e/1e9).toFixed(1).replace(/\.0$/,"")+"B":Math.abs(e)>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":Math.abs(e)>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"K":Number.isInteger(e)?String(e):e.toFixed(1)}function Nt(e,n,t,s,i,r,o){if(!r.length)return;const l=Math.max(8,Math.min(14,s*.025))*o,a=s/Math.max(r.length,1);e.save(),e.font=`${l}px sans-serif`,e.textBaseline="middle";for(let c=0;c<r.length;c++){if(!r[c].name)continue;const d=n+a*c+l*.5;e.fillStyle=r[c].color,St(e,d,i-l/2,l*1.2,l),e.fill(),e.fillStyle="#444",e.fillText(r[c].name,d+l*1.5,i)}e.restore()}function Io(e,n,t,s,i,r,o,l){const a=b(n,"barChart")||b(n,"bar3DChart"),c=!a||G(a,"barDir","col")!=="bar",d=G(a,"grouping","clustered"),h=d==="stacked"||d==="percentStacked",u=d==="percentStacked",p=pe(a,"ser"),m=p.map((k,j)=>({name:Ct(k),values:Ft(k),color:tt(k,j,o),dptColors:Vs(k,o)}));if(!m.length)return;const g=rn(p[0])||[],S=Math.max(g.length,m[0]?.values.length||0,1),y=on(t,s,i,r,{hasLegend:m.length>1});let w;h?(w=Array.from({length:S},(k,j)=>m.reduce((M,F)=>M+(F.values[j]||0),0)),u&&(w=w.map(()=>100))):w=m.flatMap(k=>k.values);const x=Pt(w),_=Math.max(7,Math.min(11,y.w*.018))*l;e.font=`${_}px sans-serif`,e.textBaseline="middle";const v=Math.round((x.max-x.min)/x.step);if(c){e.save(),e.textAlign="right",e.fillStyle="#666";for(let P=0;P<=v;P++){const $=x.min+P*x.step,N=($-x.min)/(x.max-x.min),L=y.y+y.h-N*y.h;nt(e,y.x,L,y.x+y.w,L),e.fillText(u?$+"%":st($),y.x-4*l,L)}e.restore(),e.save(),e.textAlign="center",e.fillStyle="#666";const k=y.w/S;for(let P=0;P<S;P++){const $=y.x+k*P+k/2,N=String(g[P]??P+1);e.fillText(N,$,y.y+y.h+_*1.5)}e.restore(),ze(e,y.x,y.y,y.x,y.y+y.h),ze(e,y.x,y.y+y.h,y.x+y.w,y.y+y.h);const j=y.w/S,M=j*.15,F=j-M*2,R=h?F:F/m.length;for(let P=0;P<S;P++){const $=y.x+j*P+M;let N=0;for(let L=0;L<m.length;L++){const H=m[L];let D=H.values[P]??0;if(u){const ee=m.reduce((ae,Y)=>ae+(Y.values[P]||0),0);D=ee?D/ee*100:0}const U=H.dptColors[P]||H.color,q=Math.abs(D)/(x.max-x.min)*y.h,Q=h?$:$+L*R,J=h?(N-x.min)/(x.max-x.min):Math.max(0,-x.min)/(x.max-x.min),I=y.y+y.h-J*y.h,V=D>=0?I-q:I;e.save(),e.fillStyle=U,St(e,Q,V,h?F:R-1*l,q,2*l),e.fill();const oe=e.createLinearGradient(Q,V,Q,V+q*.3);oe.addColorStop(0,"rgba(255,255,255,0.18)"),oe.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=oe,e.fill(),e.restore(),h&&(N+=Math.abs(D))}}}else{e.save(),e.textAlign="right",e.fillStyle="#666";const k=y.h/S;for(let P=0;P<S;P++){const $=y.y+k*P+k/2,N=String(g[P]??P+1);e.fillText(N,y.x-4*l,$)}e.restore(),e.save(),e.textAlign="center",e.fillStyle="#666";for(let P=0;P<=v;P++){const $=x.min+P*x.step,N=($-x.min)/(x.max-x.min),L=y.x+N*y.w;nt(e,L,y.y,L,y.y+y.h),e.fillText(u?$+"%":st($),L,y.y+y.h+_*1.5)}e.restore(),ze(e,y.x,y.y+y.h,y.x+y.w,y.y+y.h),ze(e,y.x,y.y,y.x,y.y+y.h);const j=k*.15,M=k-j*2,F=h?M:M/m.length,R=y.x+-x.min/(x.max-x.min)*y.w;for(let P=0;P<S;P++){const $=y.y+k*P+j;let N=0;for(let L=0;L<m.length;L++){const H=m[L];let D=H.values[P]??0;if(u){const V=m.reduce((oe,ee)=>oe+(ee.values[P]||0),0);D=V?D/V*100:0}const U=H.dptColors[P]||H.color,q=Math.abs(D)/(x.max-x.min)*y.w,Q=h?$:$+L*F,J=h?R+N/(x.max-x.min)*y.w:R,I=D>=0?J:J-q;e.save(),e.fillStyle=U,St(e,I,Q,q,h?M:F-1*l,2*l),e.fill(),e.restore(),h&&(N+=Math.abs(D))}}}m.length>1&&Nt(e,t,s,i,y.legendY,m,l)}function Lo(e,n,t,s,i,r,o,l){const a=b(n,"lineChart")||b(n,"line3DChart"),c=pe(a,"ser"),d=c.map((y,w)=>({name:Ct(y),values:Ft(y),color:tt(y,w,o),marker:G(b(y,"marker"),"symbol","none")!=="none",smooth:G(b(y,"smooth"),"val","0")==="1"}));if(!d.length)return;const h=rn(c[0])||[],u=Math.max(h.length,d[0]?.values.length||0,1),p=on(t,s,i,r,{hasLegend:!0}),m=Pt(d.flatMap(y=>y.values)),g=Math.max(7,Math.min(11,p.w*.018))*l,S=Math.round((m.max-m.min)/m.step);e.save(),e.textAlign="right",e.fillStyle="#666",e.font=`${g}px sans-serif`;for(let y=0;y<=S;y++){const w=m.min+y*m.step,x=(w-m.min)/(m.max-m.min),_=p.y+p.h-x*p.h;nt(e,p.x,_,p.x+p.w,_),e.fillText(st(w),p.x-4*l,_)}e.restore(),e.save(),e.textAlign="center",e.fillStyle="#666",e.font=`${g}px sans-serif`;for(let y=0;y<u;y++){const w=p.x+y/(u-1||1)*p.w;nt(e,w,p.y,w,p.y+p.h);const x=String(h[y]??y+1);e.fillText(x,w,p.y+p.h+g*1.5)}e.restore(),ze(e,p.x,p.y,p.x,p.y+p.h),ze(e,p.x,p.y+p.h,p.x+p.w,p.y+p.h);for(const y of d){const w=y.values.map((_,v)=>{const k=u>1?v/(u-1):.5,j=(_-m.min)/(m.max-m.min);return{x:p.x+k*p.w,y:p.y+p.h-j*p.h,v:_}}).filter(_=>typeof _.v=="number");if(w.length<2)continue;e.save(),e.beginPath(),e.moveTo(w[0].x,p.y+p.h);for(const _ of w)e.lineTo(_.x,_.y);if(e.lineTo(w[w.length-1].x,p.y+p.h),e.closePath(),e.fillStyle=y.color+"22",e.fill(),e.restore(),e.save(),e.strokeStyle=y.color,e.lineWidth=2*l,e.lineJoin="round",e.lineCap="round",e.beginPath(),y.smooth&&w.length>2){e.moveTo(w[0].x,w[0].y);for(let _=1;_<w.length-1;_++){const v=(w[_].x+w[_+1].x)/2,k=(w[_].y+w[_+1].y)/2;e.quadraticCurveTo(w[_].x,w[_].y,v,k)}e.lineTo(w[w.length-1].x,w[w.length-1].y)}else{e.moveTo(w[0].x,w[0].y);for(const _ of w.slice(1))e.lineTo(_.x,_.y)}e.stroke(),e.restore();const x=3.5*l;for(const _ of w)e.save(),e.fillStyle=y.color,e.strokeStyle="#fff",e.lineWidth=1.5*l,e.beginPath(),e.arc(_.x,_.y,x,0,Math.PI*2),e.fill(),e.stroke(),e.restore()}Nt(e,t,s,i,p.legendY,d,l)}function Do(e,n,t,s,i,r,o,l){const a=b(n,"areaChart")||b(n,"area3DChart"),c=G(a,"grouping","standard"),d=c==="percentStacked",h=c==="stacked"||d,p=pe(a,"ser").map((v,k)=>({name:Ct(v),values:Ft(v),color:tt(v,k,o)})).reverse();if(!p.length)return;const m=Math.max(...p.map(v=>v.values.length),1),g=on(t,s,i,r,{hasLegend:!0});let S=0;if(d)S=100;else for(let v=0;v<m;v++){const k=p.reduce((j,M)=>j+(M.values[v]||0),0);S=Math.max(S,k)}const y={min:0,max:S||100,step:Xs(S||100)},w=Math.round((y.max-y.min)/y.step),x=Math.max(7,Math.min(11,g.w*.018))*l;e.save(),e.font=`${x}px sans-serif`,e.textAlign="right",e.fillStyle="#666";for(let v=0;v<=w;v++){const k=y.min+v*y.step,j=(k-y.min)/(y.max-y.min),M=g.y+g.h-j*g.h;nt(e,g.x,M,g.x+g.w,M),e.fillText(d?k+"%":st(k),g.x-4*l,M)}e.restore(),ze(e,g.x,g.y,g.x,g.y+g.h),ze(e,g.x,g.y+g.h,g.x+g.w,g.y+g.h);const _=new Array(m).fill(0);for(const v of p){e.save(),e.beginPath();const k=[];for(let j=0;j<m;j++){let M=v.values[j]??0;if(d){const L=p.reduce((H,D)=>H+(D.values[j]||0),0);M=L?M/L*100:0}const F=h?_[j]:0,R=F+Math.abs(M),P=(F-y.min)/(y.max-y.min),$=(R-y.min)/(y.max-y.min),N=g.x+j/(m-1||1)*g.w;k.push({x:N,y:g.y+g.h-$*g.h,baseY:g.y+g.h-P*g.h}),h&&(_[j]+=Math.abs(M))}e.moveTo(k[0].x,k[0].baseY);for(const j of k)e.lineTo(j.x,j.baseY);for(let j=k.length-1;j>=0;j--)e.lineTo(k[j].x,k[j].y);e.closePath(),e.fillStyle=v.color+"cc",e.fill(),e.beginPath(),e.moveTo(k[0].x,k[0].y);for(const j of k.slice(1))e.lineTo(j.x,j.y);e.strokeStyle=v.color,e.lineWidth=1.5*l,e.stroke(),e.restore()}Nt(e,t,s,i,g.legendY,[...p].reverse(),l)}function rs(e,n,t,s,i,r,o,l){const a=b(n,"pieChart")||b(n,"pie3DChart"),c=b(n,"doughnutChart"),d=a||c,h=!!c,u=pe(d,"ser");if(!u.length)return;const p=u[0],m=Ft(p).map(P=>typeof P=="number"&&P>0?P:0),g=rn(p),S=Vs(p,o),y=m.reduce((P,$)=>P+$,0);if(!y)return;const w=Math.min(i,r)*.38,x=t+i*.44,_=s+r*.5,v=h?w*.55:0;let k=-Math.PI/2;for(let P=0;P<m.length;P++){if(!m[P])continue;const $=m[P]/y*Math.PI*2,N=S[P]||tt(p,P,o),L=k+$/2,H=P===0?w*.04:0,D=H*Math.cos(L),U=H*Math.sin(L);e.save(),e.beginPath(),e.moveTo(x+D,_+U),e.arc(x+D,_+U,w,k,k+$),e.closePath(),e.fillStyle=N,e.fill(),e.shadowColor="rgba(0,0,0,0.12)",e.shadowBlur=4*l,e.strokeStyle="#fff",e.lineWidth=1.5*l,e.stroke(),e.restore(),v>0&&(e.save(),e.beginPath(),e.arc(x,_,v,0,Math.PI*2),e.fillStyle="#fff",e.fill(),e.restore());const q=m[P]/y;if(q>.05){const Q=x+D+w*.65*Math.cos(L),J=_+U+w*.65*Math.sin(L),I=Math.max(8,Math.min(13,w*.15))*l;e.save(),e.fillStyle="#fff",e.font=`bold ${I}px sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillText(Math.round(q*100)+"%",Q,J),e.restore()}k+=$}if(h){const P=Math.max(10,Math.min(16,w*.22))*l;e.save(),e.font=`bold ${P}px sans-serif`,e.fillStyle="#333",e.textAlign="center",e.textBaseline="middle",e.fillText(st(y),x,_),e.restore()}const j=t+i*.78,M=Math.max(8,Math.min(12,i*.022))*l;e.font=`${M}px sans-serif`,e.textBaseline="middle";const F=M*1.8,R=_-m.length*F/2;for(let P=0;P<m.length;P++){const $=j,N=R+P*F,L=S[P]||tt(p,P,o);e.fillStyle=L,St(e,$,N-M*.5,M*1.2,M),e.fill(),e.fillStyle="#444";const H=String(g[P]??`Item ${P+1}`);e.fillText(H,$+M*1.5,N)}}function Bo(e,n,t,s,i,r,o,l){const a=b(n,"scatterChart")||b(n,"bubbleChart"),d=pe(a,"ser").map((k,j)=>{const M=vt(b(b(k,"xVal"),"numCache")),F=vt(b(b(k,"yVal"),"numCache")),R=vt(b(b(k,"bubbleSize"),"numCache"));return{name:Ct(k),color:tt(k,j,o),points:M.map((P,$)=>({x:P,y:F[$],r:R[$]})).filter(P=>typeof P.x=="number"&&typeof P.y=="number")}});if(!d.length)return;const h=on(t,s,i,r,{hasLegend:d.length>1}),u=d.flatMap(k=>k.points.map(j=>j.x)),p=d.flatMap(k=>k.points.map(j=>j.y)),m=Pt(u,!1),g=Pt(p),S=Math.max(7,Math.min(11,h.w*.018))*l,y=Math.round((m.max-m.min)/m.step),w=Math.round((g.max-g.min)/g.step);e.font=`${S}px sans-serif`,e.save(),e.textAlign="center",e.fillStyle="#666";for(let k=0;k<=y;k++){const j=m.min+k*m.step,M=(j-m.min)/(m.max-m.min),F=h.x+M*h.w;nt(e,F,h.y,F,h.y+h.h),e.fillText(st(j),F,h.y+h.h+S*1.5)}e.textAlign="right";for(let k=0;k<=w;k++){const j=g.min+k*g.step,M=(j-g.min)/(g.max-g.min),F=h.y+h.h-M*h.h;nt(e,h.x,F,h.x+h.w,F),e.fillText(st(j),h.x-4*l,F)}e.restore(),ze(e,h.x,h.y,h.x,h.y+h.h),ze(e,h.x,h.y+h.h,h.x+h.w,h.y+h.h);const x=d.flatMap(k=>k.points.map(j=>j.r??1)),_=Math.max(...x.filter(k=>typeof k=="number"),1),v=Math.min(h.w,h.h)*.06;for(const k of d)for(const j of k.points){const M=h.x+(j.x-m.min)/(m.max-m.min)*h.w,F=h.y+h.h-(j.y-g.min)/(g.max-g.min)*h.h,R=j.r!=null?j.r/_*v:4*l;e.save(),e.fillStyle=k.color+"aa",e.strokeStyle=k.color,e.lineWidth=1*l,e.beginPath(),e.arc(M,F,R,0,Math.PI*2),e.fill(),e.stroke(),e.restore()}d.length>1&&Nt(e,t,s,i,h.legendY,d,l)}function Oo(e,n,t,s,i,r,o,l){const a=b(n,"radarChart"),c=pe(a,"ser"),d=c.map((w,x)=>({name:Ct(w),values:Ft(w),color:tt(w,x,o)}));if(!d.length)return;const h=rn(c[0])||[],u=h.length||d[0]?.values.length||0;if(u<3)return;const p=t+i*.5,m=s+r*.5,g=Math.min(i,r)*.34,S=Pt(d.flatMap(w=>w.values)),y=4;for(let w=1;w<=y;w++){const x=g*w/y;e.save(),e.beginPath();for(let _=0;_<u;_++){const v=_/u*Math.PI*2-Math.PI/2,k=p+x*Math.cos(v),j=m+x*Math.sin(v);_===0?e.moveTo(k,j):e.lineTo(k,j)}e.closePath(),e.strokeStyle="rgba(0,0,0,0.12)",e.lineWidth=.5,e.stroke(),e.restore()}for(let w=0;w<u;w++){const x=w/u*Math.PI*2-Math.PI/2;ze(e,p,m,p+g*Math.cos(x),m+g*Math.sin(x));const _=p+(g+16*l)*Math.cos(x),v=m+(g+16*l)*Math.sin(x);e.save(),e.font=`${Math.max(7,11*l)}px sans-serif`,e.fillStyle="#555",e.textAlign="center",e.textBaseline="middle",e.fillText(String(h[w]??w+1),_,v),e.restore()}for(const w of d){const x=w.values.map((_,v)=>{const k=v/u*Math.PI*2-Math.PI/2,j=(_-S.min)/(S.max-S.min);return{x:p+g*j*Math.cos(k),y:m+g*j*Math.sin(k)}});e.save(),e.beginPath(),e.moveTo(x[0].x,x[0].y);for(const _ of x.slice(1))e.lineTo(_.x,_.y);e.closePath(),e.fillStyle=w.color+"44",e.fill(),e.strokeStyle=w.color,e.lineWidth=1.5*l,e.stroke(),e.restore()}Nt(e,t,s,i,s+r-20*l,d,l)}function Uo(e,n,t,s,i,r){const o=b(b(n,"chart"),"title");if(!o)return!1;const l=b(o,"tx");if(!l)return!1;let a="";for(const d of pe(l,"t"))a+=d.textContent;if(!a.trim())return!1;const c=Math.max(10,Math.min(16,i*.03))*r;return e.save(),e.font=`bold ${c}px sans-serif`,e.fillStyle="#333",e.textAlign="center",e.textBaseline="top",e.fillText(a,t+i/2,s+6*r),e.restore(),!0}function Go(e,n,t,s,i,r,o,l){if(!n)return;const a=n;e.save(),e.fillStyle="#fff",St(e,t,s,i,r,4*l),e.fill(),e.strokeStyle="#ddd",e.lineWidth=.5,e.stroke(),e.restore();const d=Uo(e,a,t,s,i,l)?s+Math.min(r*.08,24*l):s,h=r-(d-s),u=b(a,"plotArea");if(!u)return;const p=b(u,"bar3DChart")||b(u,"barChart"),m=b(u,"line3DChart")||b(u,"lineChart"),g=b(u,"area3DChart")||b(u,"areaChart"),S=b(u,"pie3DChart")||b(u,"pieChart"),y=b(u,"doughnutChart"),w=b(u,"scatterChart")||b(u,"bubbleChart"),x=b(u,"radarChart");if(p)Io(e,u,t,d,i,h,o,l);else if(m)Lo(e,u,t,d,i,h,o,l);else if(g)Do(e,u,t,d,i,h,o,l);else if(y)rs(e,u,t,d,i,h,o,l);else if(S)rs(e,u,t,d,i,h,o,l);else if(w)Bo(e,u,t,d,i,h,o,l);else if(x)Oo(e,u,t,d,i,h,o,l);else{e.save(),e.fillStyle="#aaa",e.font=`${12*l}px sans-serif`,e.textAlign="center",e.textBaseline="middle";const _=u.firstElementChild;e.fillText(_?.localName??"Chart",t+i/2,s+r/2),e.restore()}}function Qt(e,n,t=0,s=1){return(e?parseInt(e.getAttribute(n)||t,10):t)*s}function Hs(e,n){if(!e)return null;const t=xe(e);if(!t)return null;const s=_e(t,n);return s?we(s):null}function qo(e,n,t,s,i,r,o){const l=b(n,"bevelT"),a=b(n,"bevelB"),c=l||a;if(!c)return;const d=Math.max(2*o,Qt(c,"w",76200,o)),h=Math.max(2*o,Qt(c,"h",76200,o)),p=G(c,"prst","circle").toLowerCase().includes("in"),m=Math.min(d,i*.3),g=Math.min(h,r*.3),S=p?"rgba(0,0,0,0.18)":"rgba(255,255,255,0.35)",y=p?"rgba(255,255,255,0.20)":"rgba(0,0,0,0.20)",w=e.createLinearGradient(t,s,t,s+g);w.addColorStop(0,S),w.addColorStop(1,"rgba(255,255,255,0)"),e.save(),e.fillStyle=w,e.fillRect(t,s,i,g);const x=e.createLinearGradient(t,s+r-g,t,s+r);x.addColorStop(0,"rgba(0,0,0,0)"),x.addColorStop(1,y),e.fillStyle=x,e.fillRect(t,s+r-g,i,g);const _=e.createLinearGradient(t,s,t+m,s);_.addColorStop(0,S),_.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=_,e.fillRect(t,s,m,r);const v=e.createLinearGradient(t+i-m,s,t+i,s);v.addColorStop(0,"rgba(0,0,0,0)"),v.addColorStop(1,y),e.fillStyle=v,e.fillRect(t+i-m,s,m,r),e.restore()}function Wo(e,n,t,s,i,r,o,l){const a=Qt(n,"extrusionH",0,l);if(a<1*l)return;const c=b(n,"extrusionClr")||b(n,"contourClr"),d=Hs(c,t)||"rgba(0,0,0,0.3)",h=Math.min(a/914400*72*l,Math.min(r,o)*.15),u=h*.7,p=h*.7;e.save(),e.fillStyle=d,e.beginPath(),e.moveTo(s+r,i),e.lineTo(s+r+u,i+p),e.lineTo(s+r+u,i+o+p),e.lineTo(s+r,i+o),e.closePath(),e.fill(),e.beginPath(),e.moveTo(s,i+o),e.lineTo(s+u,i+o+p),e.lineTo(s+r+u,i+o+p),e.lineTo(s+r,i+o),e.closePath(),e.fill(),e.restore()}function Ko(e,n,t,s,i,r,o,l){const a=Qt(n,"contourW",0,l);if(a<.5)return;const c=b(n,"contourClr"),d=Hs(c,t)||"#888888",h=Math.max(.5,a/914400*72*l);e.save(),e.strokeStyle=d,e.lineWidth=h,e.strokeRect(s,i,r,o),e.restore()}function Vo(e,n,t,s,i,r){if(!n)return()=>{};const o=b(n,"camera");if(!o)return()=>{};const l=G(o,"prst","orthographicFront"),a=b(o,"rot");if(l.toLowerCase().includes("orthographic")&&!a)return()=>{};const d=a?C(a,"lat",0)/6e4:0,h=a?C(a,"lon",0)/6e4:0;a&&C(a,"rev",0)/6e4;const u=d*Math.PI/180,p=h*Math.PI/180,m=Math.sin(p)*.15,g=Math.sin(u)*.08;return e.save(),e.transform(1,g,m,1,t*-m,s*-g),()=>e.restore()}function Xo(e,n,t,s,i,r){if(!n)return;const o=b(n,"lightRig");if(!o)return;const l=G(o,"dir","t"),a=G(o,"rig","balanced"),c={t:{gx:t+i/2,gy:s},b:{gx:t+i/2,gy:s+r},l:{gx:t,gy:s+r/2},r:{gx:t+i,gy:s+r/2},tl:{gx:t,gy:s},tr:{gx:t+i,gy:s},bl:{gx:t,gy:s+r},br:{gx:t+i,gy:s+r}},{gx:d,gy:h}=c[l]||c.t,u=a==="flat"?.08:a==="balanced"?.14:a==="sunrise"?.2:a==="harsh"?.28:.12,p=Math.sqrt(i*i+r*r),m=e.createRadialGradient(d,h,0,d,h,p);m.addColorStop(0,`rgba(255,255,255,${u})`),m.addColorStop(.5,"rgba(255,255,255,0)"),m.addColorStop(1,`rgba(0,0,0,${u*.5})`),e.save(),e.fillStyle=m,e.fillRect(t,s,i,r),e.restore()}function Ho(e,n,t,s,i,r,o,l){if(!n)return{applyCamera:()=>()=>{},overlay:()=>{}};const a=b(n,"sp3d")||b(n,"scene3d")?.parentNode&&null,c=b(n,"scene3d");a&&Wo(e,a,t,s,i,r,o,l);const d=Vo(e,c,s,i);return{overlay(){a&&(qo(e,a,s,i,r,o,l),Ko(e,a,t,s,i,r,o,l)),c&&Xo(e,c,s,i,r,o)},cleanup:d}}function Yo(e){return e?!!(b(e,"sp3d")||b(e,"scene3d")):!1}async function Tt(e,n,t,s,i,r,o,l,a){if(!n)return!1;const c=n.localName;if(c==="noFill")return!1;if(c==="solidFill"){const d=xe(n),h=_e(d,l);return h?(e.fillStyle=we(h),e.fill(),!0):!1}if(c==="gradFill"){const d=b(n,"gsLst");if(!d)return!1;const h=pe(d,"gs").map(y=>{const w=C(y,"pos",0)/1e5,x=xe(y),_=_e(x,l);return{pos:w,color:_}}).sort((y,w)=>y.pos-w.pos);if(h.length<2)return!1;const u=b(n,"lin"),p=b(n,"path"),m=t+i/2,g=s+r/2;let S;if(u||!u&&!p){const x=(C(u,"ang",0)/6e4-90)*Math.PI/180,_=Math.cos(x),v=Math.sin(x),k=Math.abs(i*_)+Math.abs(r*v),j=m-k/2*_,M=g-k/2*v,F=m+k/2*_,R=g+k/2*v;S=e.createLinearGradient(j,M,F,R)}else{const y=b(p,"fillToRect"),w=C(y,"l",5e4)/1e5,x=C(y,"t",5e4)/1e5,_=C(y,"r",5e4)/1e5,v=C(y,"b",5e4)/1e5,k=t+i*(w+(1-w-_)/2),j=s+r*(x+(1-x-v)/2),M=Math.sqrt(i*i+r*r)/2;S=e.createRadialGradient(k,j,0,m,g,M)}for(const y of h)y.color&&S.addColorStop(y.pos,we(y.color));return e.fillStyle=S,e.fill(),!0}if(c==="blipFill"){const d=b(n,"blip"),h=d?d.getAttribute("r:embed")||d.getAttribute("embed"):null;if(h&&a&&a[h]){const u=a[h],p=b(n,"stretch"),m=p?b(p,"fillRect"):null;let g=t,S=s,y=i,w=r;if(m){const k=C(m,"l",0)/1e5,j=C(m,"t",0)/1e5,M=C(m,"r",0)/1e5,F=C(m,"b",0)/1e5;g=t+i*k,S=s+r*j,y=i-i*k-i*M,w=r-r*j-r*F}if(b(n,"tile")){const k=e.createPattern(u,"repeat");if(k)return e.fillStyle=k,e.fill(),!0}const _=b(n,"alphaModFix")||b(d,"alphaModFix"),v=_?C(_,"amt",1e5)/1e5:1;return e.save(),e.clip(),v<1&&(e.globalAlpha=v),e.drawImage(u,g,S,y,w),e.restore(),!0}return!1}if(c==="pattFill"){const d=b(n,"fgClr"),h=b(n,"bgClr"),u=d?_e(xe(d),l):{r:0,g:0,b:0,a:1},p=h?_e(xe(h),l):{r:255,g:255,b:255,a:1},m=we(u),g=we(p),S=G(n,"prst","dotGrid");let y=null,w=null;try{w=typeof OffscreenCanvas<"u"?new OffscreenCanvas(8,8):document.createElement("canvas");const v=8;w.width=v,w.height=v,y=w.getContext("2d")}catch{}const x=8;if(!y)return e.fillStyle=we(u),e.fill(),!0;switch(y.fillStyle=g,y.fillRect(0,0,x,x),y.fillStyle=m,S){case"smGrid":case"dotGrid":case"dotDmnd":for(let v=0;v<x;v+=2)for(let k=0;k<x;k+=2)y.fillRect(v,k,1,1);break;case"lgGrid":case"cross":y.fillRect(0,0,x,1),y.fillRect(0,0,1,x);break;case"diagBd":case"fwdDiag":for(let v=0;v<x*2;v++)y.fillRect(v%x,Math.floor(v/x)*2,1,1);break;case"bkDiag":case"ltDnDiag":for(let v=0;v<x*2;v++)y.fillRect(x-1-v%x,Math.floor(v/x)*2,1,1);break;case"horzBrick":case"horz":y.fillRect(0,x/2,x,1);break;case"vert":case"vertBrick":y.fillRect(x/2,0,1,x);break;case"smCheck":case"lgCheck":for(let v=0;v<x;v++)for(let k=0;k<x;k++)(v+k)%2===0&&y.fillRect(k,v,1,1);break;default:for(let v=0;v<x;v+=4)y.fillRect(v,v,2,2)}const _=e.createPattern(w,"repeat");return _?(e.fillStyle=_,e.fill(),!0):(e.fillStyle=we(u,(u.a??1)*.4),e.fill(),!0)}return!1}async function Ue(e,n){const t=n.split("/"),s=t.pop(),i=[...t,"_rels",s+".rels"].join("/"),r=e[i];if(!r)return{};const o=new TextDecoder().decode(r),l=Se(o),a={};for(const c of Array.from(l.getElementsByTagName("Relationship"))){const d=c.getAttribute("Id"),h=c.getAttribute("Target"),u=c.getAttribute("Type")||"",p=c.getAttribute("TargetMode")||"Internal";let m=h;if(p!=="External")if(h.startsWith("/"))m=h.slice(1);else{const g=n.split("/");g.pop();const S=h.split("/");for(const y of S)y===".."?g.pop():y!=="."&&g.push(y);m=g.join("/")}a[d]={target:h,fullPath:m,type:u,external:p==="External"}}return a}async function Wt(e,n){const t={},s=new Set(["png","jpg","jpeg","gif","webp","bmp","tiff","tif","svg"]);for(const[i,r]of Object.entries(n)){if(r.external)continue;const o=r.fullPath.split(".").pop().toLowerCase();if(s.has(o))try{const l=e[r.fullPath];if(!l)continue;const c={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",svg:"image/svg+xml"}[o]||"image/png",d=new Blob([l],{type:c}),h=URL.createObjectURL(d),u=await new Promise((p,m)=>{const g=new Image;g.onload=()=>p(g),g.onerror=()=>p(null),g.src=h});t[i]=u}catch{}}return t}function Ys(e,n,t){if(!e)return n*1.2;const s=b(e,"spcPct"),i=b(e,"spcPts");return s?n*(C(s,"val",1e5)/1e5):i?C(i,"val",0)/100*12700*(t||1):n*1.2}function Qo(e,n,t,s){if(!e||b(e,"buNone"))return null;const i=b(e,"buChar"),r=b(e,"buAutoNum");if(!i&&!r)return null;let o=null;const l=b(e,"buClr");if(l){const m=xe(l);o=_e(m,t)}const a=b(e,"buSzPct"),c=b(e,"buSzPts");let d=1;a&&(d=C(a,"val",1e5)/1e5);const h=c?C(c,"val",0)/100:null;let u=null;const p=b(e,"buFont");if(p){const m=p.getAttribute("typeface");m&&(u=m)}return i?{type:"char",char:i.getAttribute("char")||"•",color:o,sizePct:d,sizePts:h,fontFamily:u}:r?{type:"autoNum",numType:r.getAttribute("type")||"arabicPeriod",startAt:C(r,"startAt",1),color:o,sizePct:d,sizePts:h,fontFamily:u}:null}function Zo(e,n){switch(e){case"arabicPeriod":return n+".";case"arabicParenR":return n+")";case"arabicParenBoth":return"("+n+")";case"romanLcPeriod":return os(n).toLowerCase()+".";case"romanUcPeriod":return os(n)+".";case"alphaLcParenR":return String.fromCharCode(96+n)+")";case"alphaUcParenR":return String.fromCharCode(64+n)+")";case"alphaLcPeriod":return String.fromCharCode(96+n)+".";case"alphaUcPeriod":return String.fromCharCode(64+n)+".";default:return n+"."}}function os(e){const n=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],t=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];let s="";for(let i=0;i<n.length;i++)for(;e>=n[i];)s+=t[i],e-=n[i];return s}function Jo(e,n,t,s,i){if(!n)return;const r=e.font.match(/(d+(?:.d+)?)px/),o=r?parseFloat(r[1]):16,l=n.sizePts!=null?n.sizePts*(o/12):o*n.sizePct;e.save(),n.color&&(e.fillStyle=we(n.color),e.strokeStyle=e.fillStyle);const a=n.fontFamily?'"'+n.fontFamily+'", sans-serif':e.font.split(/\d+px\s+/)[1]||"sans-serif";if(e.font=l+"px "+a,n.type==="char")e.fillText(n.char,t,s);else if(n.type==="autoNum"){const c=n.numType+":"+n.startAt;i[c]===void 0&&(i[c]=n.startAt);const d=Zo(n.numType,i[c]);i[c]++,e.fillText(d,t,s)}e.restore()}async function Zt(e,n,t,s,i,r,o,l,a,c=1800){if(!n)return;const d=b(n,"bodyPr"),h=G(d,"anchor","t"),u=G(d,"wrap","square"),p=G(d,"vert","horz"),m=C(d,"lIns",91440)*o,g=C(d,"tIns",45720)*o,S=C(d,"rIns",91440)*o,y=C(d,"bIns",45720)*o,w=t+m,x=s+g,_=i-m-S,v=r-g-y,k=u!=="none",j=p==="vert"||p==="vert270"||p==="eaVert";j&&(e.save(),p==="vert270"?(e.translate(t+i,s),e.rotate(Math.PI/2)):(e.translate(t,s+r),e.rotate(-Math.PI/2)));const M=b(d,"normAutoFit")||b(n,"normAutoFit");b(d,"spAutoFit")||b(n,"spAutoFit");const F=M?M.getAttribute("fontScale"):null;let R=F?parseInt(F,10)/1e5:1;const P=b(n,"lstStyle"),$=P?b(P,"defRPr"):null;function N(J,I,V,oe){const ee=J?J.getAttribute(V):null;if(ee!==null&&ee!=="")return ee;const ae=I?I.getAttribute(V):null;if(ae!==null&&ae!=="")return ae;const Y=$?$.getAttribute(V):null;return Y!==null&&Y!==""?Y:oe}const L=pe(n,"p"),H=[];let D=0;for(const J of L){const I=b(J,"pPr"),V=G(I,"algn","l");C(I,"lvl",0);const oe=C(I,"marL",0)*o,ee=C(I,"indent",0)*o,ae=I?Qo(I,ce,l):null,Y=b(I,"spcBef"),X=b(I,"spcAft"),ke=b(I,"lnSpc"),ce=b(I,"defRPr");let de=c;if($){const ne=$.getAttribute("sz");ne&&(de=parseInt(ne,10))}if(ce){const ne=ce.getAttribute("sz");ne&&(de=parseInt(ne,10))}let fe=0,W=0;if(Y){const ne=b(Y,"spcPct"),se=b(Y,"spcPts");ne?fe=de*127*o*(C(ne,"val",0)/1e5):se&&(fe=C(se,"val",0)*kt*o/100)}if(X){const ne=b(X,"spcPct"),se=b(X,"spcPts");ne?W=de*127*o*(C(ne,"val",0)/1e5):se&&(W=C(se,"val",0)*kt*o/100)}const le=[];for(const ne of J.children){const se=ne.localName;(se==="r"||se==="br"||se==="fld")&&le.push(ne)}if(le.length===0){const ne=b(J,"endParaRPr"),ie=C(ne||ce,"sz",de)*127*o*R;H.push({lines:[""],algn:V,marL:oe,spaceBefore:fe,spaceAfter:W,szPx:ie,lnSpc:ke,runs:[],emptyPara:!0,bullet:ae}),D+=fe+ie*1.2+W;continue}let me=[],he=[],B=0;for(const ne of le){if(ne.localName==="br"){me.push({runs:he,maxSzPx:Math.max(B,de*127*o)}),he=[],B=0;continue}const se=b(ne,"rPr"),ie=b(ne,"t");let z=ie?ie.textContent:"";const O=Ks(se,ce,o*R,a,de,$);e.font=O.fontStr;const re=O.szPx;re>B&&(B=re);const be=Eo(se,ce,l),ve=N(se,ce,"u","none")!=="none",je=N(se,ce,"strike","noStrike")!=="noStrike",Pe=parseInt(N(se,ce,"baseline","0"),10);if(k){const rt=z.split(" ");for(let mn=0;mn<rt.length;mn++){const gn=rt[mn];let Gn=ee+oe;for(const $t of he)e.font=$t.fontInfo.fontStr,Gn+=e.measureText($t.text).width;e.font=O.fontStr;const yi=e.measureText(gn).width,vi=he.length?e.measureText(" ").width:0;if(Gn+vi+yi>_&&he.length>0)me.push({runs:he,maxSzPx:Math.max(B,re)}),he=[{text:gn,rPr:se,fontInfo:O,color:be,underline:ve,strikethrough:je,baseline:Pe}],B=re;else{if(he.length>0){const $t={text:" ",rPr:se,fontInfo:O,color:be,underline:!1,strikethrough:!1,baseline:Pe};he.push($t)}he.push({text:gn,rPr:se,fontInfo:O,color:be,underline:ve,strikethrough:je,baseline:Pe})}}}else he.push({text:z,rPr:se,fontInfo:O,color:be,underline:ve,strikethrough:je,baseline:Pe}),re>B&&(B=re)}he.length>0&&me.push({runs:he,maxSzPx:Math.max(B,de*127*o)});const te=ke?Ys(ke,de*127*o*R,o):null;H.push({lines:me,algn:V,marL:oe,indent:ee,spaceBefore:fe,spaceAfter:W,lnSpcPx:te,emptyPara:!1,bullet:ae});for(const ne of me)D+=fe+(te||ne.maxSzPx*1.2)+W}if(M&&!F&&D>v&&v>0){let J=.3,I=1;for(let V=0;V<8;V++){const oe=(J+I)/2;let ee=0;for(const ae of L){const Y=b(ae,"pPr"),X=Y?b(Y,"defRPr"):null;let ke=c;if($){const te=$.getAttribute("sz");te&&(ke=parseInt(te,10))}if(X){const te=X.getAttribute("sz");te&&(ke=parseInt(te,10))}const ce=Array.from(ae.children).filter(te=>["r","br","fld"].includes(te.localName)),de=ke*127*o*oe;if(ce.length===0){ee+=de*1.2;continue}const fe=ce.reduce((te,ne)=>{const se=b(ne,"t");return te+(se?se.textContent.length:0)},0),W=_>0?_:i,le=fe>0?ce.reduce((te,ne)=>{const se=b(ne,"t");return te+(se?se.textContent:"")},"").slice(0,20):"W";e.font=`${de}px sans-serif`;const me=le.length>0?e.measureText(le).width/le.length:de*.6,he=Math.max(1,Math.floor(W/me)),B=Math.max(1,Math.ceil(fe/he));ee+=B*de*1.2}ee<=v?J=oe:I=oe}R=(J+I)/2}let U=x;h==="ctr"?U=x+(v-D)/2:h==="b"&&(U=x+v-D);let q=U;const Q={};for(const J of H){const{lines:I,algn:V,marL:oe,indent:ee,spaceBefore:ae,spaceAfter:Y,lnSpcPx:X,emptyPara:ke,bullet:ce}=J;if(q+=ae,ke){q+=I[0]?X||J.szPx*1.2:12*o,q+=Y;continue}for(const de of I){const{runs:fe,maxSzPx:W}=de,le=X||W*1.2,me=q+W*.85;let he=0;for(const ie of fe)e.font=ie.fontInfo.fontStr,he+=e.measureText(ie.text).width;let B=w+oe;V==="ctr"?B=w+(_-he)/2:V==="r"&&(B=w+_-he);const te=de===I[0];if(ce&&te){const ie=w+oe+ee;Jo(e,ce,ie,me,Q)}let ne=0;if(V==="just"&&!(de===I[I.length-1])){let z=0;for(const re of fe)e.font=re.fontInfo.fontStr,z+=(re.text.match(/ /g)||[]).length;const O=_-oe-he;z>0&&O>0&&(ne=O/z)}const se=(ie,z,O,re,be,ve)=>{e.font=re.fontStr;const je=e.measureText(ie).width;e.fillText(ie,z,O);const Pe=Math.max(.5,re.szPx*.07);return be&&(e.save(),e.strokeStyle=e.fillStyle,e.lineWidth=Pe,e.beginPath(),e.moveTo(z,O+Pe*1.5),e.lineTo(z+je,O+Pe*1.5),e.stroke(),e.restore()),ve&&(e.save(),e.strokeStyle=e.fillStyle,e.lineWidth=Pe,e.beginPath(),e.moveTo(z,O-re.szPx*.3),e.lineTo(z+je,O-re.szPx*.3),e.stroke(),e.restore()),je};for(const ie of fe){const z=ie.color;e.fillStyle=z?we(z):"#000000";let O=me,re=ie.fontInfo;if(ie.baseline!==0){const be=re.szPx*.65,ve=`${re.italic?"italic ":""}${re.bold?"bold ":""}${be}px "${re.family}", sans-serif`;re={...re,szPx:be,fontStr:ve},ie.baseline>0?O=me-ie.fontInfo.szPx*.38:O=me+ie.fontInfo.szPx*.12}if(ne>0&&ie.text.includes(" ")){e.font=re.fontStr;const be=ie.text.split(" ");for(let ve=0;ve<be.length;ve++){const je=se(be[ve],B,O,re,ie.underline,ie.strikethrough);B+=je,ve<be.length-1&&(e.font=re.fontStr,B+=e.measureText(" ").width+ne)}}else{e.font=re.fontStr;const be=e.measureText(ie.text).width;se(ie.text,B,O,re,ie.underline,ie.strikethrough),B+=be}}q+=le}q+=Y}j&&e.restore()}function Qs(e,n,t,s){const i=b(n,"effectLst");if(!i)return()=>{};const r=b(i,"outerShdw"),o=b(i,"innerShdw"),l=r||o;if(l){const c=C(l,"blurRad",38100)*s,d=C(l,"dist",38100)*s,u=C(l,"dir",27e5)/6e4*Math.PI/180,p=d*Math.cos(u),m=d*Math.sin(u),g=xe(l),S=_e(g,t),y=S?we(S):"rgba(0,0,0,0.35)";e.shadowBlur=Math.min(c,40),e.shadowOffsetX=p,e.shadowOffsetY=m,e.shadowColor=y}const a=b(i,"glow");if(a){const c=C(a,"rad",0)*s,d=xe(a),h=_e(d,t);h&&(e.shadowBlur=Math.min(c,30),e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowColor=we(h))}return()=>{e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowColor="transparent"}}async function an(e,n,t,s,i,r,o,l=null,a=null){const c=b(n,"spPr"),d=b(c,"xfrm");let h=0,u=0,p=0,m=0,g=0,S=!1,y=!1;if(d){const U=b(d,"off"),q=b(d,"ext");U&&(h=C(U,"x",0)*o,u=C(U,"y",0)*o),q&&(p=C(q,"cx",0)*o,m=C(q,"cy",0)*o),g=C(d,"rot",0)/6e4,S=G(d,"flipH","0")==="1",y=G(d,"flipV","0")==="1"}else{const U=ti(n,a);if(U)h=U.x*o,u=U.y*o,p=U.w*o,m=U.h*o;else return}if(p<=0||m<=0)return;if(l){const{grpOff:U,grpExt:q,chOff:Q,chExt:J}=l,I=q.cx/J.cx,V=q.cy/J.cy;h=U.x+(h/o-Q.x)*I*o,u=U.y+(u/o-Q.y)*V*o,p=p*I,m=m*V}const w=h+p/2,x=u+m/2;e.save(),(g!==0||S||y)&&(e.translate(w,x),g!==0&&e.rotate(g*Math.PI/180),S&&e.scale(-1,1),y&&e.scale(1,-1),e.translate(-w,-x));const _=b(c,"prstGeom"),v=b(c,"custGeom"),k=_?G(_,"prst","rect"):"rect",j={};if(_){const U=b(_,"avLst");if(U){let q=0;for(const Q of pe(U,"gd")){const I=G(Q,"fmla","").match(/val\s+(-?\d+)/);I&&(j[q]=parseInt(I[1])),q++}}}const M=()=>{const U=["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"];for(const Q of U){const J=b(c,Q);if(J)return J}const q=b(n,"style");if(q){const Q=b(q,"fillRef");if(Q){if(C(Q,"idx",1)===0)return Se("<noFill/>").documentElement;const I=xe(Q);if(I)return Se('<solidFill xmlns="'+"http://schemas.openxmlformats.org/drawingml/2006/main"+'">'+I.outerHTML+"</solidFill>").documentElement}}return null},F=()=>{const U=b(c,"ln");if(U)return U;const q=b(n,"style");if(q){const Q=b(q,"lnRef");if(Q){if(C(Q,"idx",1)===0)return null;const I=xe(Q);if(I)return Se('<ln xmlns="'+"http://schemas.openxmlformats.org/drawingml/2006/main"+'"><solidFill>'+I.outerHTML+"</solidFill></ln>").documentElement}}return null};if(v){const U=b(v,"pathLst");if(U)for(const Q of pe(U,"path")){const J=C(Q,"w",1)||1,I=C(Q,"h",1)||1,V=p/J,oe=m/I;e.beginPath();for(const Y of Q.children)switch(Y.localName){case"moveTo":{const X=b(Y,"pt");X&&e.moveTo(h+C(X,"x",0)*V,u+C(X,"y",0)*oe);break}case"lnTo":{const X=b(Y,"pt");X&&e.lineTo(h+C(X,"x",0)*V,u+C(X,"y",0)*oe);break}case"cubicBezTo":{const X=pe(Y,"pt");X.length>=3&&e.bezierCurveTo(h+C(X[0],"x",0)*V,u+C(X[0],"y",0)*oe,h+C(X[1],"x",0)*V,u+C(X[1],"y",0)*oe,h+C(X[2],"x",0)*V,u+C(X[2],"y",0)*oe);break}case"quadBezTo":{const X=pe(Y,"pt");X.length>=2&&e.quadraticCurveTo(h+C(X[0],"x",0)*V,u+C(X[0],"y",0)*oe,h+C(X[1],"x",0)*V,u+C(X[1],"y",0)*oe);break}case"arcTo":{const X=C(Y,"wR",0)*V,ke=C(Y,"hR",0)*oe,ce=C(Y,"stAng",0)/6e4*Math.PI/180,de=C(Y,"swAng",0)/6e4*Math.PI/180,fe=e._lastX||h,W=e._lastY||u,le=fe-X*Math.cos(ce),me=W-ke*Math.sin(ce);X===ke?e.arc(le,me,X,ce,ce+de,de<0):e.ellipse(le,me,X,ke,0,ce,ce+de,de<0);break}case"close":e.closePath();break}const ee=M();ee&&await Tt(e,ee,h,u,p,m,o,i,s);const ae=F();ae&&ut(e,ae,i,o)}e.restore();const q=b(n,"txBody");if(q){e.save(),e.beginPath(),e.rect(h,u,p,m),e.clip();const Q=Pn(n);await Zt(e,q,h,u,p,m,o,i,r,Q),e.restore()}return}e.beginPath(),Yt(e,k,h,u,p,m,j);const R=Qs(e,c,i,o),P=h,$=u,N=p,L=m,H=Yo(c)?Ho(e,c,i,P,$,N,L,o):null;try{const U=M();let q=!1;U&&(q=await Tt(e,U,h,u,p,m,o,i,s)),H&&H.overlay();const Q=F();Q?ut(e,Q,i,o):q||(k==="line"||k==="straightConnector1")&&(e.strokeStyle="#000",e.lineWidth=1,e.stroke())}finally{R(),H?.cleanup&&H.cleanup()}e.restore();const D=b(n,"txBody");if(D){e.save(),(g!==0||S||y)&&(e.translate(w,x),g!==0&&e.rotate(g*Math.PI/180),S&&e.scale(-1,1),y&&e.scale(1,-1),e.translate(-w,-x)),e.beginPath(),e.rect(h,u,p,m),e.clip();const U=Pn(n);await Zt(e,D,h,u,p,m,o,i,r,U),e.restore()}}function Pn(e,n){const t=b(e,"nvSpPr"),s=t?b(t,"nvPr"):null,i=s?b(s,"ph"):null;if(i){const r=G(i,"type","body");if(r==="title"||r==="ctrTitle")return 4400;if(r==="subTitle"||r==="body")return 2800}return 1800}function ut(e,n,t,s){if(!n||b(n,"noFill"))return;const r=b(n,"solidFill"),o=b(n,"gradFill"),l=C(n,"w",12700),a=Math.max(.5,l*s);let c="#000000";if(r){const p=xe(r),m=_e(p,t);m&&(c=we(m))}else o&&(c="#888888");const d=b(n,"prstDash"),h=d?G(d,"val","solid"):"solid",u=G(n,"cap","flat");switch(G(n,"cmpd","sng"),e.strokeStyle=c,e.lineWidth=a,e.lineCap=u==="rnd"?"round":u==="sq"?"square":"butt",e.lineJoin="round",h){case"dash":e.setLineDash([a*4,a*2]);break;case"dot":e.setLineDash([a,a*2]);break;case"dashDot":e.setLineDash([a*4,a*2,a,a*2]);break;case"lgDash":e.setLineDash([a*8,a*3]);break;case"lgDashDot":e.setLineDash([a*8,a*3,a,a*3]);break;default:e.setLineDash([])}e.stroke(),e.setLineDash([])}async function ln(e,n,t,s,i,r){const o=b(n,"spPr"),l=b(o,"xfrm");if(!l)return;const a=b(l,"off"),c=b(l,"ext");if(!a||!c)return;const d=C(a,"x",0)*r,h=C(a,"y",0)*r,u=C(c,"cx",0)*r,p=C(c,"cy",0)*r,m=C(l,"rot",0)/6e4,g=G(l,"flipH","0")==="1",S=G(l,"flipV","0")==="1";if(u<=0||p<=0)return;const y=b(n,"blipFill"),w=y?b(y,"blip"):null,x=w?w.getAttribute("r:embed")||w.getAttribute("embed"):null,_=d+u/2,v=h+p/2;if(e.save(),(m!==0||g||S)&&(e.translate(_,v),m!==0&&e.rotate(m*Math.PI/180),g&&e.scale(-1,1),S&&e.scale(1,-1),e.translate(-_,-v)),x&&s[x]){const k=s[x],j=b(o,"prstGeom"),M=j?G(j,"prst","rect"):"rect",F={};if(j){const $=b(j,"avLst");if($){let N=0;for(const L of pe($,"gd")){const H=(G(L,"fmla","")||"").match(/val\s+(-?\d+)/);H&&(F[N]=parseInt(H[1])),N++}}}e.beginPath(),Yt(e,M,d,h,u,p,F),e.clip();const R=y?b(y,"srcRect"):null;if(R){const $=C(R,"l",0)/1e5,N=C(R,"t",0)/1e5,L=C(R,"r",0)/1e5,H=C(R,"b",0)/1e5,D=k.naturalWidth*(1-$-L),U=k.naturalHeight*(1-N-H);e.drawImage(k,k.naturalWidth*$,k.naturalHeight*N,D,U,d,h,u,p)}else e.drawImage(k,d,h,u,p);const P=b(o,"ln");P&&(e.beginPath(),Yt(e,M,d,h,u,p,F),ut(e,P,i,r))}else e.fillStyle="#e0e0e0",e.fillRect(d,h,u,p),e.strokeStyle="#aaa",e.lineWidth=1,e.strokeRect(d,h,u,p),e.beginPath(),e.moveTo(d,h),e.lineTo(d+u,h+p),e.moveTo(d+u,h),e.lineTo(d,h+p),e.stroke();e.restore()}async function Zs(e,n,t,s,i){const r=b(n,"xfrm");if(!r)return;const o=b(r,"off"),l=b(r,"ext");if(!o||!l)return;const a=C(o,"x",0)*i,c=C(o,"y",0)*i;C(l,"cx",0)*i,C(l,"cy",0)*i;const d=b(n,"graphic"),h=d?b(d,"graphicData"):null,u=h?b(h,"tbl"):null;if(!u)return;const p=b(u,"tblPr"),m=p?G(p,"bandRow","0")==="1":!1;p&&G(p,"bandCol","0");const g=p?G(p,"firstRow","0")==="1":!1,S=p?G(p,"lastRow","0")==="1":!1;p&&G(p,"firstCol","0"),p&&G(p,"lastCol","0");const y=b(u,"tblGrid"),w=pe(y,"gridCol").map(v=>C(v,"w",0)*i),x=pe(u,"tr");let _=c;for(let v=0;v<x.length;v++){const k=x[v],j=C(k,"h",457200)*i,M=pe(k,"tc");let F=a;const R=v===0,P=v===x.length-1,$=v%2===1;for(let N=0;N<M.length;N++){const L=M[N],H=C(L,"gridSpan",1);G(L,"vMerge","0");let D=0;for(let I=0;I<H;I++)D+=w[N+I]||0;const U=b(L,"tcPr"),q=U?["noFill","solidFill","gradFill","blipFill","pattFill"].map(I=>b(U,I)).find(Boolean):null;if(e.save(),e.beginPath(),e.rect(F,_,D,j),q)await Tt(e,q,F,_,D,j,i,t,null);else{let I=null;g&&R?I=t.accent1?"#"+t.accent1.toLowerCase():"#4472C4":S&&P?I="#e0e0e0":m&&$&&(I="rgba(0,0,0,0.06)"),e.fillStyle=I||"transparent",I&&e.fill()}const Q=[{el:b(U,"lnL"),x1:F,y1:_,x2:F,y2:_+j},{el:b(U,"lnR"),x1:F+D,y1:_,x2:F+D,y2:_+j},{el:b(U,"lnT"),x1:F,y1:_,x2:F+D,y2:_},{el:b(U,"lnB"),x1:F,y1:_+j,x2:F+D,y2:_+j}];for(const I of Q)I.el?b(I.el,"noFill")||(e.beginPath(),e.moveTo(I.x1,I.y1),e.lineTo(I.x2,I.y2),ut(e,I.el,t,i)):(e.beginPath(),e.strokeStyle="#cccccc",e.lineWidth=.5,e.moveTo(I.x1,I.y1),e.lineTo(I.x2,I.y2),e.stroke());e.restore();const J=b(L,"txBody");J&&(e.save(),e.beginPath(),e.rect(F,_,D,j),e.clip(),await Zt(e,J,F,_,D,j,i,t,s,1400),e.restore()),F+=D}_+=j}}async function cn(e,n,t,s,i,r,o){const l=b(n,"grpSpPr"),a=b(l,"xfrm");if(!a)return;const c=b(a,"off"),d=b(a,"ext"),h=b(a,"chOff"),u=b(a,"chExt");if(!c||!d||!h||!u)return;const p=C(a,"rot",0)/6e4,m=G(a,"flipH","0")==="1",g=G(a,"flipV","0")==="1",S={grpOff:{x:C(c,"x",0)*o,y:C(c,"y",0)*o},grpExt:{cx:C(d,"cx",0)*o,cy:C(d,"cy",0)*o},chOff:{x:C(h,"x",0),y:C(h,"y",0)},chExt:{cx:C(u,"cx",1),cy:C(u,"cy",1)}},y=S.grpOff.x+S.grpExt.cx/2,w=S.grpOff.y+S.grpExt.cy/2;e.save(),(p!==0||m||g)&&(e.translate(y,w),p!==0&&e.rotate(p*Math.PI/180),m&&e.scale(-1,1),g&&e.scale(1,-1),e.translate(-y,-w));for(const x of n.children){const _=x.localName;_==="sp"?await an(e,x,t,s,i,r,o,S):_==="pic"?await ln(e,x,t,s,i,o):_==="grpSp"?await cn(e,x,t,s,i,r,o):_==="graphicFrame"?await un(e,x,i,r,o,files,t):_==="cxnSp"&&await dn(e,x,i,o)}e.restore()}function as(e,n,t,s,i,r,o,l,a){const c=b(n,t);if(!c)return;const d=c.getAttribute("type")||"none";if(d==="none")return;const h={sm:3,med:6,lg:9},u=Math.max(.5,C(n,"w",12700)*a),p=u*(h[c.getAttribute("w")||"med"]??6),m=u*(h[c.getAttribute("len")||"med"]??6),g=Math.atan2(o-i,r-s);switch(e.save(),e.fillStyle=e.strokeStyle,e.strokeStyle=e.strokeStyle,d){case"triangle":case"arrow":case"stealth":{const S=d==="arrow",y=d==="stealth"?m*.5:0;e.beginPath(),e.moveTo(s,i),e.lineTo(s+m*Math.cos(g)+p/2*Math.sin(g),i+m*Math.sin(g)-p/2*Math.cos(g)),S||e.lineTo(s+y*Math.cos(g),i+y*Math.sin(g)),e.lineTo(s+m*Math.cos(g)-p/2*Math.sin(g),i+m*Math.sin(g)+p/2*Math.cos(g)),e.closePath(),S?e.stroke():e.fill();break}case"diamond":{const S=m/2;e.beginPath(),e.moveTo(s,i),e.lineTo(s+S*Math.cos(g)+p/2*Math.sin(g),i+S*Math.sin(g)-p/2*Math.cos(g)),e.lineTo(s+m*Math.cos(g),i+m*Math.sin(g)),e.lineTo(s+S*Math.cos(g)-p/2*Math.sin(g),i+S*Math.sin(g)+p/2*Math.cos(g)),e.closePath(),e.fill();break}case"oval":{const S=m/2,y=p/2,w=s+S*Math.cos(g),x=i+S*Math.sin(g);e.beginPath(),e.save(),e.translate(w,x),e.rotate(g),e.scale(1,y/S),e.arc(0,0,S,0,Math.PI*2),e.restore(),e.fill();break}}e.restore()}async function dn(e,n,t,s){const i=b(n,"spPr"),r=b(i,"xfrm");if(!r)return;const o=b(r,"off"),l=b(r,"ext");if(!o||!l)return;const a=C(o,"x",0)*s,c=C(o,"y",0)*s,d=C(l,"cx",0)*s,h=C(l,"cy",0)*s,u=C(r,"rot",0)/6e4,p=G(r,"flipH","0")==="1",m=G(r,"flipV","0")==="1",g=a+d/2,S=c+h/2,y=b(i,"ln");e.save(),(u!==0||p||m)&&(e.translate(g,S),u!==0&&e.rotate(u*Math.PI/180),p&&e.scale(-1,1),m&&e.scale(1,-1),e.translate(-g,-S));const w=b(i,"prstGeom"),x=w?G(w,"prst","line"):"line",_=x==="line"||x==="straightConnector1";if(e.beginPath(),_){const v=p?a:a+d,k=m?c:c+h,j=p?a+d:a,M=m?c+h:c;e.moveTo(j,M),e.lineTo(v,k)}else Yt(e,x,a,c,d,h,{});if(y){if(ut(e,y,t,s),_){const v=p?a+d:a,k=m?c+h:c,j=p?a:a+d,M=m?c:c+h;as(e,y,"headEnd",j,M,v,k,t,s),as(e,y,"tailEnd",v,k,j,M,t,s)}}else e.strokeStyle="#000",e.lineWidth=1,e.stroke();e.restore()}async function Js(e,n,t,s,i,r,o,l,a,c,d){const h=c*a,u=d*a,p=x=>{const _=b(x,"cSld");if(!_)return null;const v=b(_,"bg");if(!v)return null;const k=b(v,"bgPr"),j=b(v,"bgRef");return{bgPr:k,bgRef:j}},m=n?p(n):null,g=s?p(s):null,S=t?p(t):null,y=m||g||S;let w=!1;if(y){const{bgPr:x,bgRef:_}=y;if(x){const v=["noFill","solidFill","gradFill","blipFill","pattFill"];for(const k of v){const j=b(x,k);if(j){e.beginPath(),e.rect(0,0,h,u);const M=y===S?Object.assign({},o):o;await Tt(e,j,0,0,h,u,1,l,M)&&(w=!0);break}}}else if(_){C(_,"idx",0);const v=xe(_),k=_e(v,l);k&&(e.fillStyle=we(k),e.fillRect(0,0,h,u),w=!0)}}w||(e.fillStyle="#ffffff",e.fillRect(0,0,h,u))}function ei(e){const n={};for(const t of e){if(!t)continue;const s=b(t,"cSld"),i=s?b(s,"spTree"):null;if(i)for(const r of pe(i,"sp")){const o=b(r,"nvSpPr"),l=o?b(o,"nvPr"):null,a=l?b(l,"ph"):null;if(!a)continue;const c=G(a,"type","body"),d=G(a,"idx","0"),h=`${c}:${d}`;if(n[h])continue;const u=b(r,"spPr"),p=b(u,"xfrm");if(!p)continue;const m=b(p,"off"),g=b(p,"ext");!m||!g||(n[h]={x:C(m,"x",0),y:C(m,"y",0),w:C(g,"cx",0),h:C(g,"cy",0),txBody:b(r,"txBody")})}}return n}function ti(e,n){if(!n)return null;const t=b(e,"nvSpPr"),s=t?b(t,"nvPr"):null,i=s?b(s,"ph"):null;if(!i)return null;const r=G(i,"type","body"),o=G(i,"idx","0");return n[`${r}:${o}`]||n[`${r}:0`]||n[`body:${o}`]||null}async function un(e,n,t,s,i,r,o){const l=b(n,"graphic"),a=l?b(l,"graphicData"):null,c=a?G(a,"uri",""):"";if(b(n,"tbl")||a&&b(a,"tbl"))return Zs(e,n,t,s,i);const d=b(n,"xfrm");if(!d)return;const h=b(d,"off"),u=b(d,"ext");if(!h||!u)return;const p=C(h,"x",0)*i,m=C(h,"y",0)*i,g=C(u,"cx",0)*i,S=C(u,"cy",0)*i;if(g<=0||S<=0)return;const y=c.includes("chart"),w=c.includes("diagram");if(y&&r&&o){const _=a?b(a,"chart"):null,v=_?_.getAttribute("r:id")||_.getAttribute("id"):null,k=v?o[v]:null;if(k&&r[k.fullPath]){const j=new TextDecoder().decode(r[k.fullPath]),M=Se(j);Go(e,M,p,m,g,S,t,i);return}}if(w&&r&&o){const _=a?b(a,"relIds"):null,v=_?_.getAttribute("r:dm")||_.getAttribute("dm"):null,k=v?o[v]:null;if(k&&r[k.fullPath]){const j=new TextDecoder().decode(r[k.fullPath]),M=Se(j),F=_?_.getAttribute("r:lo")||_.getAttribute("lo"):null,R=F?o[F]:null,P=R&&r[R.fullPath]?Se(new TextDecoder().decode(r[R.fullPath])):null,{renderSmartArt:$}=await tn(async()=>{const{renderSmartArt:N}=await import("./smartart-CYnMNs5u.js");return{renderSmartArt:N}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);$(e,M,P,p,m,g,S,t,i);return}}const x=y?"📊 Chart":w?"🔷 Diagram":"⬛ Graphic";e.save(),e.fillStyle="#f4f4f8",e.strokeStyle="#ccccdd",e.lineWidth=1,e.fillRect(p,m,g,S),e.strokeRect(p,m,g,S),e.fillStyle="#999",e.font=`${Math.min(g*.07,16*i)}px sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillText(x,p+g/2,m+S/2),e.textAlign="start",e.textBaseline="alphabetic",e.restore()}async function ni(e,n,t,s,i,r,o,l,a){if(n)for(const c of n.children){const d=c.localName;try{d==="sp"?await an(e,c,t,s,i,r,o,null,l):d==="pic"?await ln(e,c,t,s,i,o):d==="grpSp"?await cn(e,c,t,s,i,r,o):d==="graphicFrame"?await un(e,c,i,r,o,a,t):d==="cxnSp"&&await dn(e,c,i,o)}catch(h){console.warn("Error rendering shape:",d,h)}}}const ea=Object.freeze(Object.defineProperty({__proto__:null,applyEffects:Qs,applyFill:Tt,applyOutline:ut,buildPlaceholderMap:ei,computeLineHeight:Ys,getDefaultFontSize:Pn,getRels:Ue,loadImages:Wt,renderBackground:Js,renderConnector:dn,renderGraphicFrame:un,renderGroupShape:cn,renderPicture:ln,renderShape:an,renderSpTree:ni,renderTable:Zs,renderTextBody:Zt,resolvePlaceholderXfrm:ti},Symbol.toStringTag,{value:"Module"}));async function ta(e){const n=new CompressionStream("deflate-raw"),t=n.writable.getWriter(),s=n.readable.getReader();t.write(e),t.close();const i=[];let r=0;for(;;){const{value:a,done:c}=await s.read();if(c)break;i.push(a),r+=a.length}const o=new Uint8Array(r);let l=0;for(const a of i)o.set(a,l),l+=a.length;return o}const na=(()=>{const e=new Uint32Array(256);for(let n=0;n<256;n++){let t=n;for(let s=0;s<8;s++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e})();function sa(e){let n=4294967295;for(let t=0;t<e.length;t++)n=na[(n^e[t])&255]^n>>>8;return(n^4294967295)>>>0}class ia{constructor(){this._chunks=[],this._size=0}append(n){this._chunks.push(n),this._size+=n.length}get size(){return this._size}concat(){const n=new Uint8Array(this._size);let t=0;for(const s of this._chunks)n.set(s,t),t+=s.length;return n}}function ye(e){return new Uint8Array([e&255,e>>8&255])}function Ie(e){return new Uint8Array([e&255,e>>8&255,e>>16&255,e>>24&255])}const si=new TextEncoder;function ra(e){return si.encode(e)}const ls=18977,cs=0;class oa{constructor(){this._entries=[]}async addText(n,t){return this.addBytes(n,si.encode(t))}async addBytes(n,t,s=!0){const i=ra(n),r=sa(t),o=t.length;let l,a;if(s&&t.length>32){const c=await ta(t);c.length<t.length?(l=c,a=8):(l=t,a=0)}else l=t,a=0;this._entries.push({name:n,nameBytes:i,compData:l,uncompSize:o,crc:r,method:a,localOffset:0})}async finalize(){const n=new ia;for(const i of this._entries)i.localOffset=n.size,n.append(new Uint8Array([80,75,3,4])),n.append(ye(20)),n.append(ye(2048)),n.append(ye(i.method)),n.append(ye(cs)),n.append(ye(ls)),n.append(Ie(i.crc)),n.append(Ie(i.compData.length)),n.append(Ie(i.uncompSize)),n.append(ye(i.nameBytes.length)),n.append(ye(0)),n.append(i.nameBytes),n.append(i.compData);const t=n.size;for(const i of this._entries)n.append(new Uint8Array([80,75,1,2])),n.append(ye(798)),n.append(ye(20)),n.append(ye(2048)),n.append(ye(i.method)),n.append(ye(cs)),n.append(ye(ls)),n.append(Ie(i.crc)),n.append(Ie(i.compData.length)),n.append(Ie(i.uncompSize)),n.append(ye(i.nameBytes.length)),n.append(ye(0)),n.append(ye(0)),n.append(ye(0)),n.append(ye(0)),n.append(Ie(0)),n.append(Ie(i.localOffset)),n.append(i.nameBytes);const s=n.size-t;return n.append(new Uint8Array([80,75,5,6])),n.append(ye(0)),n.append(ye(0)),n.append(ye(this._entries.length)),n.append(ye(this._entries.length)),n.append(Ie(s)),n.append(Ie(t)),n.append(ye(0)),n.concat()}}async function aa(e){const n=new oa;for(const[t,s]of Object.entries(e))typeof s=="string"?await n.addText(t,s):await n.addBytes(t,s);return n.finalize()}const la=new TextDecoder,ii=new TextEncoder,Ce={p:"http://schemas.openxmlformats.org/presentationml/2006/main",a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",rel:"http://schemas.openxmlformats.org/package/2006/relationships",ct:"http://schemas.openxmlformats.org/package/2006/content-types"};function wt(e){return new DOMParser().parseFromString(e,"application/xml")}function ca(e){const n=new XMLSerializer().serializeToString(e);return n.startsWith("<?xml")?n:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
29
+ ${ao(e)}`};if(Q.length>0&&(ae.images=Q),D&&(ae.mode="steer"),await Ae(ae),L?.(),g(Y=>({...Y,[e.id]:ee})),t(e.id,ee),!e.chat)try{await v.mutateAsync({id:e.id,sessionId:ee}),g(Y=>{const X={...Y};return delete X[e.id],X}),y(null)}catch(Y){y(e.id),Te(Y instanceof Error&&Y.message?T("ui.library.composer.link_failed",{message:Y.message}):T("ui.library.composer.link_failed_short"))}return!0}catch(q){return Te(q instanceof Error&&q.message?q.message:T("ui.library.composer.not_sent")),!1}finally{h.current=!1,p(!1)}},P=e.chat;return f.jsxs("div",{className:"flex flex-col gap-2 px-4 pb-3","data-library-composer":"","data-sending":u?"":void 0,children:[_&&x&&f.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md bg-sunken px-2 py-1 text-meta text-ink","data-library-link-failed":"",children:[f.jsx("span",{className:"min-w-0 flex-1",children:T("ui.library.composer.message_sent_link_failed")}),f.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>void F(),children:T("ui.library.composer.retry_link")}),f.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>i(x),children:T("ui.library.composer.open_chat")})]}),P&&s&&f.jsxs("div",{className:"flex items-center gap-2 text-meta text-ink-muted",children:[f.jsx(Fs,{size:13,"aria-hidden":"true"}),f.jsx("span",{className:"min-w-0 flex-1 truncate",children:T("ui.library.composer.chat_about",{title:P.title||P.session_id})}),f.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":T("ui.library.composer.unlink"),onClick:()=>k.mutate({id:e.id}),children:f.jsx(We,{"aria-hidden":"true"})})]}),f.jsx("div",{className:"min-w-0","data-sending":u?"":void 0,children:f.jsx(er,{ref:l,conversationId:M,messages:oo,isLoading:!1,ownGutter:!0,transcriptless:!0,autoFocus:!1,placeholderOverride:P||w?T("ui.library.composer.continue_placeholder"):T("ui.library.composer.ask_placeholder"),cwd:c?.cwd,cwdReadOnlyReason:T("ui.projects.project_quick_send.quick_send_follows_the_conversation_s_directory"),sessionStatus:c&&w?{frontend:c,costChannels:yt(a.data,"cost_channels")}:void 0,onSendMessage:R})})]})},uo=({sessionId:e,title:n,collapsed:t,onToggleCollapsed:s,onOpenChat:i,onUnlink:r,onTurnSettled:o,onStreamingChange:l})=>{it();const a=An(),c=Pi(e,!0,!0,e,{openFrame:yt(a.data,"open_frame"),journalOrder:yt(a.data,"journal_order"),peerJournalSource:yt(a.data,"peer_journal_source")}),d=E.useRef(null),u=(c.frontend??c.heldFrontend)?.streaming===!0,p=ir(c.frontend??c.heldFrontend),m=E.useRef(u);E.useEffect(()=>{m.current!==u&&(l(u),u||o()),m.current=u},[u,o,l]);const g=c.transcript.records.length===0&&c.awaitingHydration&&!c.missing;return f.jsxs("section",{"data-library-trajectory":"","data-collapsed":t?"":void 0,className:ge("flex min-h-0 flex-col bg-canvas",t?"shrink-0":"min-h-40 max-h-80 shrink-0 basis-[38%]"),children:[f.jsxs("header",{className:"flex shrink-0 items-center gap-2 px-4 py-1.5",children:[f.jsx(Fs,{size:13,"aria-hidden":"true",className:"text-ink-dim"}),f.jsxs("button",{type:"button","aria-expanded":!t,onClick:s,className:"flex min-w-0 flex-1 items-center gap-1 rounded-sm text-left text-meta text-ink-muted hover:text-ink focus-visible:outline-offset-1",children:[f.jsx("span",{className:"min-w-0 flex-1 truncate",children:T("ui.library.composer.chat_about",{title:n})}),f.jsx(Cs,{"aria-hidden":"true",className:ge("size-3.5 shrink-0 transition-transform duration-fast",t&&"rotate-180")})]}),f.jsx(Z,{variant:"ghost",size:"sm",onClick:i,children:T("ui.library.composer.open_chat")}),f.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":T("ui.library.composer.unlink"),onClick:r,children:f.jsx(We,{"aria-hidden":"true"})})]}),!t&&p&&f.jsxs("div",{"data-library-trajectory-gate":"",className:"flex shrink-0 items-center gap-2 px-4 pb-1.5",children:[f.jsx("span",{className:"min-w-0 flex-1 text-meta text-ink",children:T("ui.mesh.mesh_approvals.waiting_for_you")}),f.jsx(Z,{variant:"secondary",size:"sm",onClick:i,children:T("ui.library.composer.open_chat")})]}),!t&&f.jsx("div",{"data-lo-sidebar-edge-cues":!0,className:"flex min-h-0 grow flex-col overflow-hidden",children:g?f.jsx("div",{className:"flex flex-1 items-center justify-center",children:f.jsx(xt,{label:T("ui.library.preview.loading")})}):f.jsx(rr,{frontend:c.frontend,transcript:c.transcript,gate:p,waiting:u,starting:!1,loadingOlder:c.loadingOlder,onLoadOlder:c.loadOlder,onLoadOlderOutcome:c.loadOlderDetailed,olderFailed:c.olderFailed,containerRef:d,isSmallView:!1,status:c.status,failure:c.failure,awaitingHydration:c.awaitingHydration,hydrationProven:c.hydrated,missing:c.missing,onReconnect:c.retry})})]})};function fo(e,n,t){return{id:`library:${e.id}`,title:e.name.trim()||e.derived_name||e.ref.path||e.id,path:e.ref.path??"",content:n,type:"markdown",readMtimeMs:t??void 0,sizeBytes:e.size_bytes,availability:"present"}}const ho="h-[78px] w-[117px]",po=({asset:e,active:n,onSelect:t})=>{const[s,i]=zn("300px"),r=ht(e.id,"thumbnail",e.kind==="image"&&e.exists&&i),o=pt(r.bytes,r.mimeType),l=De(e);return f.jsx("li",{ref:s,className:ge("flex shrink-0 rounded-sm leading-none",n&&"ring-1 ring-ink"),children:f.jsx("button",{type:"button","aria-label":l,title:l,"aria-current":n?"true":void 0,onClick:t,"data-library-lightbox-tile":e.id,className:"block cursor-pointer overflow-hidden rounded-sm leading-none",children:f.jsx("div",{className:ge("flex items-center justify-center overflow-hidden bg-canvas",ho),children:o?f.jsx("img",{src:o,alt:"",loading:"lazy",decoding:"async",className:"size-full object-cover"}):f.jsx(Ye,{kind:e.kind,size:20,className:"text-ink-dim"})})})})},mo=({siblings:e,index:n,onSelect:t})=>f.jsx("ul",{role:"list","data-library-lightbox-strip":"",className:"flex max-w-full items-center gap-2 overflow-x-auto px-2 py-1 leading-none",children:e.map((s,i)=>f.jsx(po,{asset:s,active:i===n,onSelect:()=>t(i)},s.id))}),go=({open:e,siblings:n,index:t,onIndexChange:s,onClose:i,restoreFocusTo:r,resolved:o})=>{it();const l=or(t,n.length),a=n[l],c=o?.assetId===a.id,d=ht(a.id,"content",!c),h=pt(d.bytes,d.mimeType||a.ref.content_type),u=c?o?.url:h??void 0,p=De(a);return f.jsx(ar,{open:e,onOpenChange:m=>{m||i()},src:u,pending:!c&&(d.loading||u===void 0&&!d.error),label:p,mediaKind:a.kind==="video"?"video":"image",mediaLabel:"asset",restoreFocusTo:r,layerAttributes:{"data-library-lightbox":""},fallback:d.error||u!==void 0?f.jsx("p",{className:"max-w-90 text-center text-body-sm text-ink-muted",children:T("ui.library.preview.could_not_load")}):void 0,group:{index:l,count:n.length,onPrev:()=>s(Xn(l,n.length,-1)),onNext:()=>s(Xn(l,n.length,1)),filmstrip:n.length>1?f.jsx(mo,{siblings:n,index:l,onSelect:s}):void 0}})};async function qs(e){const n=e instanceof Uint8Array?e:new Uint8Array(e),t=new DataView(n.buffer,n.byteOffset,n.byteLength),s=101010256,i=101075792,r=117853008;let o=-1;const l=Math.max(0,n.length-65557);for(let m=n.length-22;m>=l;m--)if(t.getUint32(m,!0)===s){o=m;break}if(o===-1)throw new Error("Not a valid ZIP file: EOCD not found");let a,c;const d=o-20;if(d>=0&&t.getUint32(d,!0)===r){const m=Number(t.getBigUint64(d+8,!0));if(t.getUint32(m,!0)!==i)throw new Error("Invalid ZIP64 end record");a=Number(t.getBigUint64(m+48,!0)),c=Number(t.getBigUint64(m+32,!0))}else a=t.getUint32(o+16,!0),c=t.getUint16(o+8,!0);if(a+4>n.length)throw new Error("ZIP central directory offset is outside the file");const h=33639248,u={};let p=a;for(let m=0;m<c&&!(p+46>n.length||t.getUint32(p,!0)!==h);m++){const g=t.getUint16(p+10,!0);let S=t.getUint32(p+20,!0),y=t.getUint32(p+24,!0);const w=t.getUint16(p+28,!0),x=t.getUint16(p+30,!0),_=t.getUint16(p+32,!0);let v=t.getUint32(p+42,!0);const k=yo(n,p+46,w);if(S===4294967295||y===4294967295||v===4294967295){const P=p+46+w,$=P+x;let N=P;for(;N+4<=$;){const L=t.getUint16(N,!0),H=t.getUint16(N+2,!0);if(L===1){let D=N+4;y===4294967295&&D+8<=$&&(y=Number(t.getBigUint64(D,!0)),D+=8),S===4294967295&&D+8<=$&&(S=Number(t.getBigUint64(D,!0)),D+=8),v===4294967295&&D+8<=$&&(v=Number(t.getBigUint64(D,!0)));break}N+=4+H}}if(p+=46+w+x+_,k.endsWith("/")||g!==0&&g!==8||v+30>n.length)continue;const j=t.getUint16(v+26,!0),M=t.getUint16(v+28,!0),F=v+30+j+M;if(F+S>n.length)continue;const R=n.subarray(F,F+S);try{u[k]=g===0?R.slice():await bo(R)}catch(P){console.warn(`[zip.js] Failed to decompress "${k}":`,P.message)}}return u}async function bo(e){const n=new DecompressionStream("deflate-raw"),t=n.writable.getWriter(),s=n.readable.getReader();t.write(e),t.close();const i=[];let r=0;for(;;){const{value:a,done:c}=await s.read();if(c)break;i.push(a),r+=a.length}const o=new Uint8Array(r);let l=0;for(const a of i)o.set(a,l),l+=a.length;return o}function yo(e,n,t){return new TextDecoder().decode(e.subarray(n,n+t))}function Se(e){return new DOMParser().parseFromString(e,"application/xml")}function pe(e,n){if(!e)return[];const t=[],s=e.getElementsByTagName("*");for(let i=0;i<s.length;i++)s[i].localName===n&&t.push(s[i]);return t}function b(e,n){return pe(e,n)[0]??null}function G(e,n,t=null){if(!e)return t;const s=e.getAttribute(n);return s!==null?s:t}function C(e,n,t=0){const s=G(e,n);return s!==null?parseInt(s,10):t}function Le(e,n,t){return Math.max(n,Math.min(t,e))}const kt=12700,vo=Object.freeze(Object.defineProperty({__proto__:null,EMU_PER_PT:kt,attr:G,attrInt:C,clamp:Le,g1:b,gtn:pe,parseXml:Se},Symbol.toStringTag,{value:"Module"}));function wo(e){if(!e)return{colors:{},majorFont:"Calibri Light",minorFont:"Calibri"};const n=b(e,"clrScheme"),t={};if(n){const o=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];for(const l of o){const a=b(n,l);if(!a)continue;const c=b(a,"srgbClr"),d=b(a,"sysClr");c?t[l]=c.getAttribute("val")||"":d&&(t[l]=d.getAttribute("lastClr")||"")}}const s=b(e,"fontScheme");let i="Calibri Light",r="Calibri";if(s){const o=b(s,"majorFont"),l=b(s,"minorFont");if(o){const a=b(o,"latin");a&&(i=a.getAttribute("typeface")||i)}if(l){const a=b(l,"latin");a&&(r=a.getAttribute("typeface")||r)}}return{colors:t,majorFont:i,minorFont:r}}function xo(e){if(!e)return{};const n=b(e,"clrMap");if(!n)return{};const t={},s=["bg1","tx1","bg2","tx2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];for(const i of s){const r=n.getAttribute(i);r&&(t[i]=r)}return t}function ko(e,n){const t={...e.colors};for(const[s,i]of Object.entries(n))t[i]!==void 0&&(t[s]=t[i]);return t}const lt={calibri:{google:"Carlito",weights:[400,700],generic:"sans-serif"},"calibri light":{google:"Carlito",weights:[300],generic:"sans-serif"},"calibri (body)":{google:"Carlito",weights:[400,700],generic:"sans-serif"},cambria:{google:"Caladea",weights:[400,700],generic:"serif"},"cambria math":{google:"Caladea",weights:[400],generic:"serif"},aptos:{google:"Inter",weights:[300,400,600,700],generic:"sans-serif"},"aptos display":{google:"Inter",weights:[700,800],generic:"sans-serif"},"aptos narrow":{google:"Inter",weights:[400,700],generic:"sans-serif"},"aptos serif":{google:"Lora",weights:[400,700],generic:"serif"},"aptos mono":{google:"Roboto Mono",weights:[400,700],generic:"monospace"},arial:{google:null,weights:[],generic:"sans-serif"},"arial black":{google:null,weights:[],generic:"sans-serif"},"times new roman":{google:null,weights:[],generic:"serif"},times:{google:null,weights:[],generic:"serif"},helvetica:{google:null,weights:[],generic:"sans-serif"},verdana:{google:null,weights:[],generic:"sans-serif"},tahoma:{google:null,weights:[],generic:"sans-serif"},"trebuchet ms":{google:null,weights:[],generic:"sans-serif"},georgia:{google:null,weights:[],generic:"serif"},"courier new":{google:null,weights:[],generic:"monospace"},courier:{google:null,weights:[],generic:"monospace"},impact:{google:null,weights:[],generic:"sans-serif"},"comic sans ms":{google:null,weights:[],generic:"cursive"},palatino:{google:null,weights:[],generic:"serif"},"lucida console":{google:null,weights:[],generic:"monospace"},"lucida sans unicode":{google:null,weights:[],generic:"sans-serif"},"arial narrow":{google:"Arimo",weights:[400,700],generic:"sans-serif"},candara:{google:"Nunito",weights:[300,400,700],generic:"sans-serif"},consolas:{google:"Roboto Mono",weights:[400,700],generic:"monospace"},constantia:{google:"Libre Baskerville",weights:[400,700],generic:"serif"},corbel:{google:"Lato",weights:[300,400,700],generic:"sans-serif"},"franklin gothic medium":{google:"Libre Franklin",weights:[500],generic:"sans-serif"},"franklin gothic book":{google:"Libre Franklin",weights:[400],generic:"sans-serif"},"franklin gothic heavy":{google:"Libre Franklin",weights:[800],generic:"sans-serif"},"gill sans mt":{google:"Quattrocento Sans",weights:[400,700],generic:"sans-serif"},"gill sans":{google:"Quattrocento Sans",weights:[400,700],generic:"sans-serif"},"century gothic":{google:"Josefin Sans",weights:[300,400,700],generic:"sans-serif"},"century schoolbook":{google:"EB Garamond",weights:[400,700],generic:"serif"},garamond:{google:"EB Garamond",weights:[400,700],generic:"serif"},"palatino linotype":{google:"EB Garamond",weights:[400,700],generic:"serif"},"book antiqua":{google:"EB Garamond",weights:[400,700],generic:"serif"},rockwell:{google:"Roboto Slab",weights:[400,700],generic:"serif"},"rockwell extra bold":{google:"Roboto Slab",weights:[800],generic:"serif"},"segoe ui":{google:"Inter",weights:[300,400,600,700],generic:"sans-serif"},"segoe ui light":{google:"Inter",weights:[300],generic:"sans-serif"},"segoe ui semibold":{google:"Inter",weights:[600],generic:"sans-serif"},"segoe ui semilight":{google:"Inter",weights:[350],generic:"sans-serif"},"helvetica neue":{google:"Nunito Sans",weights:[300,400,700],generic:"sans-serif"},"myriad pro":{google:"Source Sans 3",weights:[300,400,600,700],generic:"sans-serif"},futura:{google:"Josefin Sans",weights:[300,400,700],generic:"sans-serif"},"tw cen mt":{google:"Pathway Gothic One",weights:[400],generic:"sans-serif"},"bookman old style":{google:"Libre Baskerville",weights:[400,700],generic:"serif"},frutiger:{google:"Raleway",weights:[300,400,700],generic:"sans-serif"},optima:{google:"Questrial",weights:[400],generic:"sans-serif"},univers:{google:"Nunito Sans",weights:[300,400,700],generic:"sans-serif"},"open sans":{google:"Open Sans",weights:[300,400,600,700],generic:"sans-serif"},lato:{google:"Lato",weights:[300,400,700],generic:"sans-serif"},montserrat:{google:"Montserrat",weights:[300,400,600,700],generic:"sans-serif"},raleway:{google:"Raleway",weights:[300,400,700],generic:"sans-serif"},roboto:{google:"Roboto",weights:[300,400,700],generic:"sans-serif"},"roboto mono":{google:"Roboto Mono",weights:[400,700],generic:"monospace"},"roboto slab":{google:"Roboto Slab",weights:[300,400,700],generic:"serif"},oswald:{google:"Oswald",weights:[400,700],generic:"sans-serif"},"playfair display":{google:"Playfair Display",weights:[400,700],generic:"serif"},merriweather:{google:"Merriweather",weights:[300,400,700],generic:"serif"},nunito:{google:"Nunito",weights:[300,400,700],generic:"sans-serif"},"nunito sans":{google:"Nunito Sans",weights:[300,400,700],generic:"sans-serif"},poppins:{google:"Poppins",weights:[300,400,600,700],generic:"sans-serif"},inter:{google:"Inter",weights:[300,400,600,700],generic:"sans-serif"},"work sans":{google:"Work Sans",weights:[300,400,600,700],generic:"sans-serif"},"dm sans":{google:"DM Sans",weights:[300,400,500,700],generic:"sans-serif"},"dm serif display":{google:"DM Serif Display",weights:[400],generic:"serif"},ubuntu:{google:"Ubuntu",weights:[300,400,700],generic:"sans-serif"},"ubuntu mono":{google:"Ubuntu Mono",weights:[400,700],generic:"monospace"},"source sans pro":{google:"Source Sans 3",weights:[300,400,600,700],generic:"sans-serif"},"source serif pro":{google:"Source Serif 4",weights:[300,400,700],generic:"serif"},"source code pro":{google:"Source Code Pro",weights:[400,700],generic:"monospace"},"exo 2":{google:"Exo 2",weights:[300,400,700],generic:"sans-serif"},"titillium web":{google:"Titillium Web",weights:[300,400,600,700],generic:"sans-serif"},"fira sans":{google:"Fira Sans",weights:[300,400,600,700],generic:"sans-serif"},"fira mono":{google:"Fira Mono",weights:[400,700],generic:"monospace"},"josefin sans":{google:"Josefin Sans",weights:[300,400,700],generic:"sans-serif"},"josefin slab":{google:"Josefin Slab",weights:[300,400,700],generic:"serif"},barlow:{google:"Barlow",weights:[300,400,600,700],generic:"sans-serif"},"barlow condensed":{google:"Barlow Condensed",weights:[300,400,600,700],generic:"sans-serif"},cabin:{google:"Cabin",weights:[400,700],generic:"sans-serif"},"crimson text":{google:"Crimson Text",weights:[400,700],generic:"serif"},"libre baskerville":{google:"Libre Baskerville",weights:[400,700],generic:"serif"},"libre franklin":{google:"Libre Franklin",weights:[400,700],generic:"sans-serif"},"eb garamond":{google:"EB Garamond",weights:[400,700],generic:"serif"},spectral:{google:"Spectral",weights:[300,400,700],generic:"serif"},arvo:{google:"Arvo",weights:[400,700],generic:"serif"},"pt sans":{google:"PT Sans",weights:[400,700],generic:"sans-serif"},"pt serif":{google:"PT Serif",weights:[400,700],generic:"serif"},"pt mono":{google:"PT Mono",weights:[400],generic:"monospace"},karla:{google:"Karla",weights:[300,400,700],generic:"sans-serif"},mukta:{google:"Mukta",weights:[300,400,700],generic:"sans-serif"},hind:{google:"Hind",weights:[300,400,700],generic:"sans-serif"},"noto sans":{google:"Noto Sans",weights:[300,400,700],generic:"sans-serif"},"noto serif":{google:"Noto Serif",weights:[300,400,700],generic:"serif"}},Gt=new Set,_t=new Map,qt=new Set;let ts=null,yn=null;function _o(){return yn||(ts=typeof OffscreenCanvas<"u"?new OffscreenCanvas(300,10):Object.assign(document.createElement("canvas"),{width:300,height:10}),yn=ts.getContext("2d")),yn}const ns="mmmmmmmmmmlllllllllliiiiiiiiiixxxxxxxxxx",So=[20,40];function Ws(e){if(qt.has(e))return!0;if(typeof document<"u"&&document.fonts&&document.fonts.check(`16px "${e}"`))return qt.add(e),!0;try{const n=_o(),t=["monospace","serif"];for(const s of So)for(const i of t){n.font=`${s}px ${i}`;const r=n.measureText(ns).width;n.font=`${s}px "${e}", ${i}`;const o=n.measureText(ns).width;if(Math.abs(o-r)>.5)return qt.add(e),!0}}catch{}return!1}async function Sn(e,n,t={}){let s;if(typeof n=="string"||n instanceof URL)s=n.toString();else if(n instanceof File||n instanceof Blob)s=await n.arrayBuffer();else if(n instanceof Uint8Array)s=n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);else if(n instanceof ArrayBuffer)s=n;else throw new TypeError("registerFont: unsupported source type. Expected string, URL, File, Blob, ArrayBuffer, or Uint8Array.");const i={weight:"normal",style:"normal",...t},r=new FontFace(e,typeof s=="string"?`url(${s})`:s,i);await r.load(),document.fonts.add(r);const o=_t.get(e)??[];o.push(r),_t.set(e,o),Gt.add(e),qt.add(e);const l=e.toLowerCase().trim();return lt[l]?lt[l]._custom=!0:lt[l]={google:null,weights:[],generic:"sans-serif",_custom:!0},console.log(`[pptx-canvas-renderer] Custom font registered: "${e}" (${i.weight} ${i.style})`),r}async function Po(e){const n=[];for(const[t,s]of Object.entries(e))if(typeof s=="string")n.push(Sn(t,s));else if(Array.isArray(s))for(const i of s){const{url:r,...o}=i;n.push(Sn(t,r,o))}await Promise.all(n)}function To(e,n){if(!e)return[];const t=b(e,"embeddedFontLst");if(!t)return[];const s=[];for(const i of t.children){if(i.localName!=="embeddedFont")continue;const r=b(i,"font"),o=r?r.getAttribute("typeface"):null;if(!o)continue;const l={regular:!1,bold:!1,italic:!1,boldItalic:!1},a=[];for(const c of["regular","bold","italic","boldItalic"]){const d=b(i,c);if(!d)continue;const h=d.getAttribute("r:id")||d.getAttribute("id"),u=n?.[h];u&&(a.push(u.fullPath),l[c]=!0)}s.push({family:o,hasRegular:l.regular,hasBold:l.bold,hasItalic:l.italic,hasBoldItalic:l.boldItalic,paths:a,note:".fntdata files are a proprietary Microsoft format and cannot be used as web fonts directly. Use registerFont() with a compatible woff2/ttf version instead."})}return s}function jo(e){if(!e)return"sans-serif";if(e==="+mj-lt"||e==="+mj")return"serif";if(e==="+mn-lt"||e==="+mn")return"sans-serif";if(_t.has(e))return e;const n=e.toLowerCase().trim(),t=lt[n];return t?t._custom||t.google===null?e:t.google&&Ws(t.google)?t.google:t.google||e:e}function Co(e){if(!e)return"sans-serif";const n=e.toLowerCase().trim();return lt[n]?.generic??"sans-serif"}async function Fo(e,n){const t=[...e];n?.majorFont&&t.push(n.majorFont),n?.minorFont&&t.push(n.minorFont);const s=new Map;for(const o of t){if(!o||o.startsWith("+")||o==="+mj-lt"||o==="+mn-lt"||o==="+mj"||o==="+mn"||_t.has(o))continue;const l=o.toLowerCase().trim(),a=lt[l];let c=null,d=[400,700];if(a){if(a._custom||a.google===null)continue;c=a.google,d=a.weights.length?a.weights:[400,700]}else c=o;if(!c||Gt.has(c))continue;if(Ws(c)){Gt.add(c);continue}const h=s.get(c)??new Set;d.forEach(u=>h.add(u)),s.set(c,h)}if(s.size===0)return;for(const o of s.keys())Gt.add(o);const r=`https://fonts.googleapis.com/css2?${[...s.entries()].map(([o,l])=>{const a=[...l].sort((d,h)=>d-h),c=[...a.map(d=>`0,${d}`),...a.map(d=>`1,${d}`)].join(";");return`family=${encodeURIComponent(`${o}:ital,wght@${c}`)}`}).join("&")}&display=swap`;try{const o=document.createElement("link");o.rel="stylesheet",o.href=r,document.head.appendChild(o),await new Promise(l=>{o.onload=l,o.onerror=()=>{console.warn("[pptx-canvas-renderer] Google Fonts failed to load:",r),l()},setTimeout(l,5e3)}),document.fonts?.ready&&await Promise.race([document.fonts.ready,new Promise(l=>setTimeout(l,2e3))])}catch(o){console.warn("[pptx-canvas-renderer] Font loading error:",o)}}function No(e){const n=new Set;for(const t of e){if(!t)continue;const s=t.getElementsByTagName("*");for(let i=0;i<s.length;i++){const r=s[i],o=r.localName;if(o==="latin"||o==="ea"||o==="cs"){const l=r.getAttribute("typeface");l&&!l.startsWith("+")&&n.add(l)}}}return n}function Ks(e,n,t,s,i=1800,r=null){let o=i;if(r){const y=r.getAttribute("sz");y&&(o=parseInt(y,10))}if(n){const y=n.getAttribute("sz");y&&(o=parseInt(y,10))}if(e){const y=e.getAttribute("sz");y&&(o=parseInt(y,10))}let l=!1,a=!1;if(r&&(r.getAttribute("b")==="1"&&(l=!0),r.getAttribute("i")==="1"&&(a=!0)),n){const y=n.getAttribute("b"),w=n.getAttribute("i");y==="1"?l=!0:y==="0"&&(l=!1),w==="1"?a=!0:w==="0"&&(a=!1)}if(e){const y=e.getAttribute("b"),w=e.getAttribute("i");y==="1"?l=!0:y==="0"&&(l=!1),w==="1"?a=!0:w==="0"&&(a=!1)}let c=s?.minorFont??"Calibri";function d(y){if(!y)return;const w=b(y,"latin"),x=w?w.getAttribute("typeface"):y.getAttribute("typeface");if(x){if(x==="+mj-lt"||x==="+mj"){c=s?.majorFont??c;return}if(x==="+mn-lt"||x==="+mn"){c=s?.minorFont??c;return}c=x}}d(r),d(n),d(e);const h=jo(c),u=Co(c),p=o*127*t;return{fontStr:`${a?"italic ":""}${l?"bold":"normal"} ${p}px "${h}", ${u}`,sz:o,szPx:p,bold:l,italic:a,family:h,generic:u,rawFamily:c}}function Mo(){const e=[];for(const[n,t]of _t)for(const s of t)e.push({family:n,weight:s.weight,style:s.style,status:s.status});return e}function Rt(e){const n=e.replace("#","");return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16)}}function Qe(e,n,t){e/=255,n/=255,t/=255;const s=Math.max(e,n,t),i=Math.min(e,n,t);let r=0,o=0;const l=(s+i)/2;if(s!==i){const a=s-i;switch(o=l>.5?a/(2-s-i):a/(s+i),s){case e:r=((n-t)/a+(n<t?6:0))/6;break;case n:r=((t-e)/a+2)/6;break;case t:r=((e-n)/a+4)/6;break}}return{h:r,l,s:o}}function Ve(e,n,t){if(t===0){const o=Math.round(n*255);return{r:o,g:o,b:o}}const s=n<.5?n*(1+t):n+t-n*t,i=2*n-s,r=(o,l,a)=>(a<0&&(a+=1),a>1&&(a-=1),a<1/6?o+(l-o)*6*a:a<1/2?l:a<2/3?o+(l-o)*(2/3-a)*6:o);return{r:Math.round(r(i,s,e+1/3)*255),g:Math.round(r(i,s,e)*255),b:Math.round(r(i,s,e-1/3)*255)}}const Ao={black:"000000",white:"FFFFFF",red:"FF0000",green:"008000",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF",orange:"FFA500",purple:"800080",pink:"FFC0CB",brown:"A52A2A",gray:"808080",grey:"808080",navy:"000080",teal:"008080",maroon:"800000",olive:"808000",lime:"00FF00",aqua:"00FFFF",fuchsia:"FF00FF",silver:"C0C0C0",coral:"FF7F50",salmon:"FA8072",gold:"FFD700",khaki:"F0E68C",lavender:"E6E6FA",beige:"F5F5DC",ivory:"FFFFF0",mintcream:"F5FFFA",azure:"F0FFFF",aliceblue:"F0F8FF",ghostwhite:"F8F8FF",darkred:"8B0000",darkgreen:"006400",darkblue:"00008B",darkcyan:"008B8B",darkmagenta:"8B008B",darkorange:"FF8C00",darkgray:"A9A9A9",darkgrey:"A9A9A9",lightgray:"D3D3D3",lightgrey:"D3D3D3",lightblue:"ADD8E6",lightgreen:"90EE90",lightpink:"FFB6C1",lightyellow:"FFFFE0",lightcyan:"E0FFFF",deepskyblue:"00BFFF",royalblue:"4169E1",steelblue:"4682B4",skyblue:"87CEEB",dodgerblue:"1E90FF",cornflowerblue:"6495ED",mediumblue:"0000CD",midnightblue:"191970",indigo:"4B0082",slateblue:"6A5ACD",blueviolet:"8A2BE2",mediumpurple:"9370DB",orchid:"DA70D6",violet:"EE82EE",plum:"DDA0DD",thistle:"D8BFD8",hotpink:"FF69B4",deeppink:"FF1493",crimson:"DC143C",firebrick:"B22222",tomato:"FF6347",orangered:"FF4500",darkorange2:"FF8C00",chocolate:"D2691E",saddlebrown:"8B4513",sienna:"A0522D",tan:"D2B48C",burlywood:"DEB887",wheat:"F5DEB3",moccasin:"FFE4B5",peachpuff:"FFDAB9",papayawhip:"FFEFD5",mistyrose:"FFE4E1",linen:"FAF0E6",oldlace:"FDF5E6",floralwhite:"FFFAF0",antiquewhite:"FAEBD7",bisque:"FFE4C4",blanchedalmond:"FFEBCD",cornsilk:"FFF8DC",lemonchiffon:"FFFACD",honeydew:"F0FFF0",palegreen:"98FB98",lightseagreen:"20B2AA",mediumseagreen:"3CB371",seagreen:"2E8B57",forestgreen:"228B22",yellowgreen:"9ACD32",olivedrab:"6B8E23",greenyellow:"ADFF2F",chartreuse:"7FFF00",springgreen:"00FF7F",mediumspringgreen:"00FA9A",aquamarine:"7FFFD4",turquoise:"40E0D0",mediumturquoise:"48D1CC",paleturquoise:"AFEEEE",cadetblue:"5F9EA0",powderblue:"B0E0E6",lightsteelblue:"B0C4DE",slategray:"708090",slategrey:"708090",dimgray:"696969",dimgrey:"696969",snow:"FFFAFA",seashell:"FFF5EE",whitesmoke:"F5F5F5",gainsboro:"DCDCDC"};function $o(e,n){if(!n)return e;let{r:t,g:s,b:i,a:r=1}=e;for(const o of n.children){const l=o.localName,a=parseInt(o.getAttribute("val")??"0",10);switch(l){case"lumMod":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h,Le(d.l*c,0,1),d.s);t=h.r,s=h.g,i=h.b;break}case"lumOff":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h,Le(d.l+c,0,1),d.s);t=h.r,s=h.g,i=h.b;break}case"tint":{const c=a/1e5;t=Math.round(t+(255-t)*(1-c)),s=Math.round(s+(255-s)*(1-c)),i=Math.round(i+(255-i)*(1-c));break}case"shade":{const c=a/1e5;t=Math.round(t*c),s=Math.round(s*c),i=Math.round(i*c);break}case"satMod":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h,d.l,Le(d.s*c,0,1));t=h.r,s=h.g,i=h.b;break}case"satOff":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h,d.l,Le(d.s+c,0,1));t=h.r,s=h.g,i=h.b;break}case"hueMod":{const c=a/1e5,d=Qe(t,s,i),h=Ve(d.h*c%1,d.l,d.s);t=h.r,s=h.g,i=h.b;break}case"hueOff":{const c=a/216e5,d=Qe(t,s,i),h=Ve(((d.h+c)%1+1)%1,d.l,d.s);t=h.r,s=h.g,i=h.b;break}case"alpha":{r=a/1e5;break}case"alphaOff":{r=Le(r+a/1e5,0,1);break}case"alphaMod":{r=Le(r*a/1e5,0,1);break}case"inv":{t=255-t,s=255-s,i=255-i;break}case"gray":{t=s=i=Math.round(.2126*t+.7152*s+.0722*i);break}case"comp":{const c=Qe(t,s,i),d=Ve((c.h+.5)%1,c.l,c.s);t=d.r,s=d.g,i=d.b;break}}}return{r:Le(t,0,255),g:Le(s,0,255),b:Le(i,0,255),a:r}}function _e(e,n){if(!e)return null;const t=e.localName;let s=null,i=1;if(t==="srgbClr"){const r=e.getAttribute("val")||"";r.length>=6&&(s=Rt(r))}else if(t==="schemeClr"){const o=e.getAttribute("val")||"",l=n?.[o];l?s=Rt(l):s={r:0,g:0,b:0}}else if(t==="prstClr"){const r=(e.getAttribute("val")||"").toLowerCase(),o=Ao[r];o&&(s=Rt(o))}else if(t==="sysClr"){const r=e.getAttribute("lastClr");r?.length>=6?s=Rt(r):s={r:0,g:0,b:0}}else if(t==="hslClr"){const r=C(e,"hue",0)/216e5,o=C(e,"sat",0)/1e5,l=C(e,"lum",0)/1e5;s=Ve(r,l,o)}else if(t==="scRgbClr"){const r=C(e,"r",0)/1e5,o=C(e,"g",0)/1e5,l=C(e,"b",0)/1e5;s={r:Math.round(Math.pow(r,1/2.2)*255),g:Math.round(Math.pow(o,1/2.2)*255),b:Math.round(Math.pow(l,1/2.2)*255)}}return s?$o({...s,a:i},e):null}function we(e,n){if(!e)return"transparent";const t=n!==void 0?n:e.a??1;return t<1?`rgba(${e.r},${e.g},${e.b},${t.toFixed(3)})`:`rgb(${e.r},${e.g},${e.b})`}function xe(e){if(!e)return null;const n=["srgbClr","schemeClr","prstClr","sysClr","hslClr","scRgbClr"];for(const t of n){const s=b(e,t);if(s)return s}return null}function ss(e,n){if(!e)return null;const t=b(e,"solidFill");if(!t)return null;const s=xe(t),i=_e(s,n);return i?we(i):null}function Eo(e,n,t){const s=ss(e,t);return s||ss(n,t)}function Yt(e,n,t,s,i,r,o){const l=u=>u*Math.PI/180,a=(u,p=5e4)=>(o&&o[u]!==void 0?o[u]:p)/1e5,c=t+i/2,d=s+r/2,h=Math.min(i,r);switch(e.beginPath(),n){case"rect":case"snip1Rect":e.rect(t,s,i,r);break;case"roundRect":{const u=a(0,16667)*h*.5;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.arcTo(t+i,s,t+i,s+u,u),e.lineTo(t+i,s+r-u),e.arcTo(t+i,s+r,t+i-u,s+r,u),e.lineTo(t+u,s+r),e.arcTo(t,s+r,t,s+r-u,u),e.lineTo(t,s+u),e.arcTo(t,s,t+u,s,u),e.closePath();break}case"ellipse":case"oval":e.ellipse(c,d,i/2,r/2,0,0,Math.PI*2);break;case"triangle":case"isoscelesTriangle":e.moveTo(c,s),e.lineTo(t+i,s+r),e.lineTo(t,s+r),e.closePath();break;case"rightTriangle":e.moveTo(t,s),e.lineTo(t+i,s+r),e.lineTo(t,s+r),e.closePath();break;case"parallelogram":{const u=a(0,25e3),p=i*u;e.moveTo(t+p,s),e.lineTo(t+i,s),e.lineTo(t+i-p,s+r),e.lineTo(t,s+r),e.closePath();break}case"trapezoid":{const u=a(0,25e3),p=i*u;e.moveTo(t+p,s),e.lineTo(t+i-p,s),e.lineTo(t+i,s+r),e.lineTo(t,s+r),e.closePath();break}case"diamond":e.moveTo(c,s),e.lineTo(t+i,d),e.lineTo(c,s+r),e.lineTo(t,d),e.closePath();break;case"pentagon":ot(e,c,d,i/2,r/2,5,-Math.PI/2);break;case"hexagon":ot(e,c,d,i/2,r/2,6,0);break;case"heptagon":ot(e,c,d,i/2,r/2,7,-Math.PI/2);break;case"octagon":ot(e,c,d,i/2,r/2,8,Math.PI/8);break;case"decagon":ot(e,c,d,i/2,r/2,10,-Math.PI/2);break;case"dodecagon":ot(e,c,d,i/2,r/2,12,0);break;case"plus":case"cross":{const u=a(0,25e3),p=h*u,m=c-p/2,g=c+p/2,S=d-p/2,y=d+p/2;e.moveTo(m,s),e.lineTo(g,s),e.lineTo(g,S),e.lineTo(t+i,S),e.lineTo(t+i,y),e.lineTo(g,y),e.lineTo(g,s+r),e.lineTo(m,s+r),e.lineTo(m,y),e.lineTo(t,y),e.lineTo(t,S),e.lineTo(m,S),e.closePath();break}case"star4":Re(e,c,d,i/2,r/2,4,a(0,37500));break;case"star5":Re(e,c,d,i/2,r/2,5,a(0,19098),-Math.PI/2);break;case"star6":Re(e,c,d,i/2,r/2,6,a(0,28868),0);break;case"star7":Re(e,c,d,i/2,r/2,7,a(0,34601),-Math.PI/2);break;case"star8":Re(e,c,d,i/2,r/2,8,a(0,29289),Math.PI/8);break;case"star10":Re(e,c,d,i/2,r/2,10,a(0,30902),-Math.PI/2);break;case"star12":Re(e,c,d,i/2,r/2,12,a(0,37720),0);break;case"star16":Re(e,c,d,i/2,r/2,16,a(0,37500),0);break;case"star24":Re(e,c,d,i/2,r/2,24,a(0,37500),0);break;case"star32":Re(e,c,d,i/2,r/2,32,a(0,37500),0);break;case"rightArrow":{const u=a(0,5e4),p=a(1,5e4),m=(r-r*p)/2,g=t+i*(1-u);e.moveTo(t,s+m),e.lineTo(g,s+m),e.lineTo(g,s),e.lineTo(t+i,d),e.lineTo(g,s+r),e.lineTo(g,s+r-m),e.lineTo(t,s+r-m),e.closePath();break}case"leftArrow":{const u=a(0,5e4),p=a(1,5e4),m=(r-r*p)/2,g=t+i*u;e.moveTo(t+i,s+m),e.lineTo(g,s+m),e.lineTo(g,s),e.lineTo(t,d),e.lineTo(g,s+r),e.lineTo(g,s+r-m),e.lineTo(t+i,s+r-m),e.closePath();break}case"upArrow":{const u=a(0,5e4),p=a(1,5e4),m=(i-i*p)/2,g=s+r*u;e.moveTo(t+m,s+r),e.lineTo(t+m,g),e.lineTo(t,g),e.lineTo(c,s),e.lineTo(t+i,g),e.lineTo(t+i-m,g),e.lineTo(t+i-m,s+r),e.closePath();break}case"downArrow":{const u=a(0,5e4),p=a(1,5e4),m=(i-i*p)/2,g=s+r*(1-u);e.moveTo(t+m,s),e.lineTo(t+m,g),e.lineTo(t,g),e.lineTo(c,s+r),e.lineTo(t+i,g),e.lineTo(t+i-m,g),e.lineTo(t+i-m,s),e.closePath();break}case"leftRightArrow":{const u=a(0,25e3),p=a(1,5e4),m=(r-r*p)/2,g=t+i*u,S=t+i*(1-u);e.moveTo(t,d),e.lineTo(g,s),e.lineTo(g,s+m),e.lineTo(S,s+m),e.lineTo(S,s),e.lineTo(t+i,d),e.lineTo(S,s+r),e.lineTo(S,s+r-m),e.lineTo(g,s+r-m),e.lineTo(g,s+r),e.closePath();break}case"upDownArrow":{const u=a(0,25e3),p=a(1,5e4),m=(i-i*p)/2,g=s+r*u,S=s+r*(1-u);e.moveTo(c,s),e.lineTo(t+i,g),e.lineTo(t+i-m,g),e.lineTo(t+i-m,S),e.lineTo(t+i,S),e.lineTo(c,s+r),e.lineTo(t,S),e.lineTo(t+m,S),e.lineTo(t+m,g),e.lineTo(t,g),e.closePath();break}case"chevron":{const u=a(0,5e4),p=i*u;e.moveTo(t,s),e.lineTo(t+i-p,s),e.lineTo(t+i,d),e.lineTo(t+i-p,s+r),e.lineTo(t,s+r),e.lineTo(t+p,d),e.closePath();break}case"pentagon5":case"homePlate":{const u=a(0,5e4);e.moveTo(t,s),e.lineTo(t+i*(1-u),s),e.lineTo(t+i,d),e.lineTo(t+i*(1-u),s+r),e.lineTo(t,s+r),e.closePath();break}case"arc":{const u=a(0,270)*Math.PI/180,p=a(1,288e5/6e4)*Math.PI/180;e.moveTo(c,d),e.arc(c,d,Math.min(i,r)/2,u,u+p),e.closePath();break}case"blockArc":{const u=(a(0,0)*360-90)*Math.PI/180,p=a(1,25e3)*360*Math.PI/180,m=a(2,25e3)*Math.min(i,r)/2,g=Math.min(i,r)/2,S=g-m;e.moveTo(c+g*Math.cos(u),d+g*Math.sin(u)),e.arc(c,d,g,u,u+p),e.arc(c,d,Math.max(1,S),u+p,u,!0),e.closePath();break}case"line":case"straightConnector1":e.moveTo(t,d),e.lineTo(t+i,d);break;case"bentConnector3":case"bentConnector4":case"bentConnector5":case"elbowConnector":e.moveTo(t,s),e.lineTo(t,d),e.lineTo(t+i,d),e.lineTo(t+i,s+r);break;case"curvedConnector3":case"curvedConnector4":e.moveTo(t,s),e.bezierCurveTo(t,s+r/2,t+i,s+r/2,t+i,s+r);break;case"heart":{Ro(e,t,s,i,r);break}case"lightningBolt":{e.moveTo(t+i*.6,s),e.lineTo(t+i*.2,s+r*.45),e.lineTo(t+i*.5,s+r*.45),e.lineTo(t+i*.4,s+r),e.lineTo(t+i*.8,s+r*.55),e.lineTo(t+i*.5,s+r*.55),e.closePath();break}case"moon":{e.arc(c+i*.1,d,r*.5,l(-120),l(120)),e.arc(c+i*.4,d,r*.45,l(120),l(-120),!0),e.closePath();break}case"noSmoking":{const u=Math.min(i,r)/2;e.arc(c,d,u,0,Math.PI*2),e.moveTo(c-u*.7,d+u*.7),e.lineTo(c+u*.7,d-u*.7);break}case"flowChartProcess":e.rect(t,s,i,r);break;case"flowChartDecision":e.moveTo(c,s),e.lineTo(t+i,d),e.lineTo(c,s+r),e.lineTo(t,d),e.closePath();break;case"flowChartTerminator":{const u=r/2;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.arc(t+i-u,d,u,-Math.PI/2,Math.PI/2),e.lineTo(t+u,s+r),e.arc(t+u,d,u,Math.PI/2,-Math.PI/2),e.closePath();break}case"flowChartDocument":{e.moveTo(t,s),e.lineTo(t+i,s),e.lineTo(t+i,s+r*.8),e.bezierCurveTo(t+i*.75,s+r*.8,t+i*.75,s+r,t+i*.5,s+r),e.bezierCurveTo(t+i*.25,s+r,t+i*.25,s+r*.8,t,s+r*.8),e.closePath();break}case"flowChartDatabase":case"cylinder":{const u=r*.1;e.moveTo(t,s+u),e.ellipse(c,s+u,i/2,u,0,Math.PI,0),e.lineTo(t+i,s+r-u),e.ellipse(c,s+r-u,i/2,u,0,0,Math.PI),e.closePath();break}case"cube":{const u=i*.15;e.moveTo(t+u,s),e.lineTo(t+i,s),e.lineTo(t+i,s+r-u),e.lineTo(t+i-u,s+r),e.lineTo(t,s+r),e.lineTo(t,s+u),e.closePath(),e.moveTo(t+u,s),e.lineTo(t+u,s+u),e.lineTo(t,s+u),e.moveTo(t+u,s+u),e.lineTo(t+i,s+u);break}case"callout1":case"borderCallout1":case"wedgeRectCallout":{e.rect(t,s,i,r*.8),e.moveTo(c-i*.1,s+r*.8),e.lineTo(c,s+r),e.lineTo(c+i*.1,s+r*.8),e.closePath();break}case"wedgeRoundRectCallout":{const u=r*.05;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.arcTo(t+i,s,t+i,s+u,u),e.lineTo(t+i,s+r*.75-u),e.arcTo(t+i,s+r*.75,t+i-u,s+r*.75,u),e.lineTo(c+i*.1,s+r*.75),e.lineTo(c,s+r),e.lineTo(c-i*.1,s+r*.75),e.lineTo(t+u,s+r*.75),e.arcTo(t,s+r*.75,t,s+r*.75-u,u),e.lineTo(t,s+u),e.arcTo(t,s,t+u,s,u),e.closePath();break}case"wedgeEllipseCallout":{e.ellipse(c,d-r*.05,i/2,r*.45,0,0,Math.PI*2),e.moveTo(c-i*.1,d+r*.4),e.lineTo(c,s+r),e.lineTo(c+i*.1,d+r*.4),e.closePath();break}case"cloudCallout":case"cloud":{e.beginPath();const u=[{cx:c-i*.22,cy:d-r*.12,r:i*.16},{cx:c-i*.07,cy:d-r*.22,r:i*.18},{cx:c+i*.1,cy:d-r*.22,r:i*.17},{cx:c+i*.25,cy:d-r*.12,r:i*.15},{cx:c+i*.35,cy:d+r*.05,r:i*.13},{cx:c-i*.3,cy:d+r*.05,r:i*.13}];for(const p of u)e.arc(p.cx,p.cy,p.r,0,Math.PI*2);e.rect(c-i*.35,d,i*.7,r*.25);break}case"smileyFace":{e.arc(c,d,Math.min(i,r)/2,0,Math.PI*2);break}case"donut":{const u=Math.min(i,r)/2,p=u*a(0,25e3);e.arc(c,d,u,0,Math.PI*2),e.arc(c,d,p,Math.PI*2,0,!0);break}case"bracketPair":{const u=i*.2;e.moveTo(t+u,s),e.arcTo(t,s,t,s+u,u),e.lineTo(t,s+r-u),e.arcTo(t,s+r,t+u,s+r,u),e.moveTo(t+i-u,s),e.arcTo(t+i,s,t+i,s+u,u),e.lineTo(t+i,s+r-u),e.arcTo(t+i,s+r,t+i-u,s+r,u);break}case"bracePair":{const u=r*.15;e.moveTo(c-i*.35,s),e.bezierCurveTo(c-i*.45,s,c-i*.45,s,c-i*.45,s+u),e.lineTo(c-i*.45,d-u),e.bezierCurveTo(c-i*.45,d,c-i*.5,d,c-i*.5,d),e.bezierCurveTo(c-i*.5,d,c-i*.45,d,c-i*.45,d+u),e.lineTo(c-i*.45,s+r-u),e.bezierCurveTo(c-i*.45,s+r,c-i*.35,s+r,c-i*.35,s+r);break}case"irregularSeal1":case"irregularSeal2":{Re(e,c,d,i/2,r/2,12,a(0,42533),0);break}case"accentCallout1":case"accentCallout2":case"calloutWedgeRect":e.rect(t,s,i,r);break;case"flowChartAlternateProcess":{const u=r*.15;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.arcTo(t+i,s,t+i,s+u,u),e.lineTo(t+i,s+r-u),e.arcTo(t+i,s+r,t+i-u,s+r,u),e.lineTo(t+u,s+r),e.arcTo(t,s+r,t,s+r-u,u),e.lineTo(t,s+u),e.arcTo(t,s,t+u,s,u),e.closePath();break}case"flowChartConnector":e.arc(c,d,Math.min(i,r)/2,0,Math.PI*2);break;case"flowChartInputOutput":{const u=i*.2;e.moveTo(t+u,s),e.lineTo(t+i,s),e.lineTo(t+i-u,s+r),e.lineTo(t,s+r),e.closePath();break}case"flowChartPredefinedProcess":{e.rect(t,s,i,r),e.moveTo(t+i*.1,s),e.lineTo(t+i*.1,s+r),e.moveTo(t+i*.9,s),e.lineTo(t+i*.9,s+r);break}case"flowChartManualInput":{e.moveTo(t,s+r*.2),e.lineTo(t+i,s),e.lineTo(t+i,s+r),e.lineTo(t,s+r),e.closePath();break}case"flowChartPreparation":{const u=i*.2;e.moveTo(t+u,s),e.lineTo(t+i-u,s),e.lineTo(t+i,d),e.lineTo(t+i-u,s+r),e.lineTo(t+u,s+r),e.lineTo(t,d),e.closePath();break}case"ribbon":case"ribbon2":{const u=r*.3;e.moveTo(t,s+u/2),e.lineTo(t+i*.1,s),e.lineTo(t+i*.1,s+r-u),e.lineTo(t,s+r),e.lineTo(t+i*.5,s+r-u),e.lineTo(t+i,s+r),e.lineTo(t+i-i*.1,s+r-u),e.lineTo(t+i-i*.1,s),e.lineTo(t+i,s+u/2),e.lineTo(t+i*.5,s+u),e.closePath();break}case"ellipseRibbon":case"ellipseRibbon2":{e.ellipse(c,d,i/2,r/2,0,0,Math.PI*2);break}case"teardrop":{const u=Math.min(i,r)*.45;e.arc(c,d+u,u,-Math.PI,0),e.bezierCurveTo(c+u,d+u-u*.55,c+u*.1,d-r*.4,c,s),e.bezierCurveTo(c-u*.1,d-r*.4,c-u,d+u-u*.55,c-u,d+u),e.closePath();break}default:return e.rect(t,s,i,r),!1}return!0}function ot(e,n,t,s,i,r,o=0){for(let l=0;l<r;l++){const a=o+l/r*Math.PI*2,c=n+s*Math.cos(a),d=t+i*Math.sin(a);l===0?e.moveTo(c,d):e.lineTo(c,d)}e.closePath()}function Re(e,n,t,s,i,r,o=.5,l=-Math.PI/2){for(let a=0;a<r*2;a++){const c=l+a/(r*2)*Math.PI*2,d=a%2===1,h=d?s*o:s,u=d?i*o:i,p=n+h*Math.cos(c),m=t+u*Math.sin(c);a===0?e.moveTo(p,m):e.lineTo(p,m)}e.closePath()}function Ro(e,n,t,s,i){e.beginPath();const r=n+s/2,o=t+i*.25;e.moveTo(r,t+i*.9),e.bezierCurveTo(n-s*.1,t+i*.6,n-s*.1,o-i*.05,r-s*.25,o-i*.1),e.bezierCurveTo(r-s*.5+s*.05,t+i*.05,r-s*.03,t+i*.05,r,o-i*.15),e.bezierCurveTo(r+s*.03,t+i*.05,r+s*.5-s*.05,t+i*.05,r+s*.25,o-i*.1),e.bezierCurveTo(n+s*1.1,o-i*.05,n+s*1.1,t+i*.6,r,t+i*.9),e.closePath()}const is=["#4472C4","#ED7D31","#A9D18E","#FF0000","#FFC000","#5B9BD5","#70AD47","#C00000","#7030A0","#00B0F0","#FF7F00","#9E480E"];function zo(e){const n=e?.textContent?.trim();if(n==null||n==="")return null;const t=parseFloat(n);return isNaN(t)?n:t}function vt(e){if(!e)return[];const n=C(b(e,"ptCount"),"val",0),t=new Array(n).fill(null);for(const s of pe(e,"pt")){const i=C(s,"idx",0);t[i]=zo(b(s,"v"))}return t}function Ct(e){const n=b(e,"tx");if(!n)return null;const t=b(n,"v");if(t)return t.textContent.trim();const s=b(n,"strCache");if(s){const i=b(s,"pt"),r=i?b(i,"v"):null;return r?r.textContent.trim():null}return null}function rn(e){const n=b(e,"cat")||b(e,"xVal");return n?vt(b(n,"strCache")||b(n,"numCache")):[]}function Ft(e){const n=b(e,"val")||b(e,"yVal");return n?vt(b(n,"numCache")):[]}function tt(e,n,t){const s=b(e,"spPr");if(s){const r=b(s,"solidFill");if(r){const o=xe(r),l=_e(o,t);if(l)return we(l)}}const i=`accent${n%6+1}`;return t[i]?`#${t[i]}`:is[n%is.length]}function Vs(e,n){const t={};for(const s of pe(e,"dPt")){const i=C(b(s,"idx"),"val",-1);if(i<0)continue;const r=b(s,"spPr");if(!r)continue;const o=b(r,"solidFill");if(!o)continue;const l=xe(o),a=_e(l,n);a&&(t[i]=we(a))}return t}function on(e,n,t,s,i={}){const{padL:r=.12,padR:o=.06,padT:l=.08,padB:a=.1,legendH:c=.1,hasLegend:d=!0,hasTitle:h=!1}=i,u=h?s*.08:0,p=d?s*c:0;return{x:e+t*r,y:n+s*l+u,w:t*(1-r-o),h:s*(1-l-a)-p-u,legendY:n+s*(1-c*.7)}}function St(e,n,t,s,i,r=3){s<0&&(n+=s,s=-s),i<0&&(t+=i,i=-i),r=Math.min(r,Math.abs(s)/2,Math.abs(i)/2),e.beginPath(),e.moveTo(n+r,t),e.arcTo(n+s,t,n+s,t+i,r),e.arcTo(n+s,t+i,n,t+i,r),e.arcTo(n,t+i,n,t,r),e.arcTo(n,t,n+s,t,r),e.closePath()}function ze(e,n,t,s,i,r="#999",o=.7){e.save(),e.strokeStyle=r,e.lineWidth=o,e.setLineDash([]),e.beginPath(),e.moveTo(n,t),e.lineTo(s,i),e.stroke(),e.restore()}function nt(e,n,t,s,i){e.save(),e.strokeStyle="rgba(0,0,0,0.10)",e.lineWidth=.5,e.setLineDash([3,3]),e.beginPath(),e.moveTo(n,t),e.lineTo(s,i),e.stroke(),e.setLineDash([]),e.restore()}function Xs(e,n=5){const t=e/n,s=Math.pow(10,Math.floor(Math.log10(t))),i=t/s;let r;return i<1.5?r=1:i<3.5?r=2:i<7.5?r=5:r=10,r*s}function Pt(e,n=!0){const t=e.filter(o=>typeof o=="number"&&isFinite(o));if(!t.length)return{min:0,max:100,step:20};let s=n?Math.min(0,...t):Math.min(...t),i=Math.max(...t);s===i&&(s-=1,i+=1);const r=Xs(i-s);return i=Math.ceil(i/r)*r,s=Math.floor(s/r)*r,{min:s,max:i,step:r}}function st(e){return typeof e!="number"?String(e??""):Math.abs(e)>=1e9?(e/1e9).toFixed(1).replace(/\.0$/,"")+"B":Math.abs(e)>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":Math.abs(e)>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"K":Number.isInteger(e)?String(e):e.toFixed(1)}function Nt(e,n,t,s,i,r,o){if(!r.length)return;const l=Math.max(8,Math.min(14,s*.025))*o,a=s/Math.max(r.length,1);e.save(),e.font=`${l}px sans-serif`,e.textBaseline="middle";for(let c=0;c<r.length;c++){if(!r[c].name)continue;const d=n+a*c+l*.5;e.fillStyle=r[c].color,St(e,d,i-l/2,l*1.2,l),e.fill(),e.fillStyle="#444",e.fillText(r[c].name,d+l*1.5,i)}e.restore()}function Io(e,n,t,s,i,r,o,l){const a=b(n,"barChart")||b(n,"bar3DChart"),c=!a||G(a,"barDir","col")!=="bar",d=G(a,"grouping","clustered"),h=d==="stacked"||d==="percentStacked",u=d==="percentStacked",p=pe(a,"ser"),m=p.map((k,j)=>({name:Ct(k),values:Ft(k),color:tt(k,j,o),dptColors:Vs(k,o)}));if(!m.length)return;const g=rn(p[0])||[],S=Math.max(g.length,m[0]?.values.length||0,1),y=on(t,s,i,r,{hasLegend:m.length>1});let w;h?(w=Array.from({length:S},(k,j)=>m.reduce((M,F)=>M+(F.values[j]||0),0)),u&&(w=w.map(()=>100))):w=m.flatMap(k=>k.values);const x=Pt(w),_=Math.max(7,Math.min(11,y.w*.018))*l;e.font=`${_}px sans-serif`,e.textBaseline="middle";const v=Math.round((x.max-x.min)/x.step);if(c){e.save(),e.textAlign="right",e.fillStyle="#666";for(let P=0;P<=v;P++){const $=x.min+P*x.step,N=($-x.min)/(x.max-x.min),L=y.y+y.h-N*y.h;nt(e,y.x,L,y.x+y.w,L),e.fillText(u?$+"%":st($),y.x-4*l,L)}e.restore(),e.save(),e.textAlign="center",e.fillStyle="#666";const k=y.w/S;for(let P=0;P<S;P++){const $=y.x+k*P+k/2,N=String(g[P]??P+1);e.fillText(N,$,y.y+y.h+_*1.5)}e.restore(),ze(e,y.x,y.y,y.x,y.y+y.h),ze(e,y.x,y.y+y.h,y.x+y.w,y.y+y.h);const j=y.w/S,M=j*.15,F=j-M*2,R=h?F:F/m.length;for(let P=0;P<S;P++){const $=y.x+j*P+M;let N=0;for(let L=0;L<m.length;L++){const H=m[L];let D=H.values[P]??0;if(u){const ee=m.reduce((ae,Y)=>ae+(Y.values[P]||0),0);D=ee?D/ee*100:0}const U=H.dptColors[P]||H.color,q=Math.abs(D)/(x.max-x.min)*y.h,Q=h?$:$+L*R,J=h?(N-x.min)/(x.max-x.min):Math.max(0,-x.min)/(x.max-x.min),I=y.y+y.h-J*y.h,V=D>=0?I-q:I;e.save(),e.fillStyle=U,St(e,Q,V,h?F:R-1*l,q,2*l),e.fill();const oe=e.createLinearGradient(Q,V,Q,V+q*.3);oe.addColorStop(0,"rgba(255,255,255,0.18)"),oe.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=oe,e.fill(),e.restore(),h&&(N+=Math.abs(D))}}}else{e.save(),e.textAlign="right",e.fillStyle="#666";const k=y.h/S;for(let P=0;P<S;P++){const $=y.y+k*P+k/2,N=String(g[P]??P+1);e.fillText(N,y.x-4*l,$)}e.restore(),e.save(),e.textAlign="center",e.fillStyle="#666";for(let P=0;P<=v;P++){const $=x.min+P*x.step,N=($-x.min)/(x.max-x.min),L=y.x+N*y.w;nt(e,L,y.y,L,y.y+y.h),e.fillText(u?$+"%":st($),L,y.y+y.h+_*1.5)}e.restore(),ze(e,y.x,y.y+y.h,y.x+y.w,y.y+y.h),ze(e,y.x,y.y,y.x,y.y+y.h);const j=k*.15,M=k-j*2,F=h?M:M/m.length,R=y.x+-x.min/(x.max-x.min)*y.w;for(let P=0;P<S;P++){const $=y.y+k*P+j;let N=0;for(let L=0;L<m.length;L++){const H=m[L];let D=H.values[P]??0;if(u){const V=m.reduce((oe,ee)=>oe+(ee.values[P]||0),0);D=V?D/V*100:0}const U=H.dptColors[P]||H.color,q=Math.abs(D)/(x.max-x.min)*y.w,Q=h?$:$+L*F,J=h?R+N/(x.max-x.min)*y.w:R,I=D>=0?J:J-q;e.save(),e.fillStyle=U,St(e,I,Q,q,h?M:F-1*l,2*l),e.fill(),e.restore(),h&&(N+=Math.abs(D))}}}m.length>1&&Nt(e,t,s,i,y.legendY,m,l)}function Lo(e,n,t,s,i,r,o,l){const a=b(n,"lineChart")||b(n,"line3DChart"),c=pe(a,"ser"),d=c.map((y,w)=>({name:Ct(y),values:Ft(y),color:tt(y,w,o),marker:G(b(y,"marker"),"symbol","none")!=="none",smooth:G(b(y,"smooth"),"val","0")==="1"}));if(!d.length)return;const h=rn(c[0])||[],u=Math.max(h.length,d[0]?.values.length||0,1),p=on(t,s,i,r,{hasLegend:!0}),m=Pt(d.flatMap(y=>y.values)),g=Math.max(7,Math.min(11,p.w*.018))*l,S=Math.round((m.max-m.min)/m.step);e.save(),e.textAlign="right",e.fillStyle="#666",e.font=`${g}px sans-serif`;for(let y=0;y<=S;y++){const w=m.min+y*m.step,x=(w-m.min)/(m.max-m.min),_=p.y+p.h-x*p.h;nt(e,p.x,_,p.x+p.w,_),e.fillText(st(w),p.x-4*l,_)}e.restore(),e.save(),e.textAlign="center",e.fillStyle="#666",e.font=`${g}px sans-serif`;for(let y=0;y<u;y++){const w=p.x+y/(u-1||1)*p.w;nt(e,w,p.y,w,p.y+p.h);const x=String(h[y]??y+1);e.fillText(x,w,p.y+p.h+g*1.5)}e.restore(),ze(e,p.x,p.y,p.x,p.y+p.h),ze(e,p.x,p.y+p.h,p.x+p.w,p.y+p.h);for(const y of d){const w=y.values.map((_,v)=>{const k=u>1?v/(u-1):.5,j=(_-m.min)/(m.max-m.min);return{x:p.x+k*p.w,y:p.y+p.h-j*p.h,v:_}}).filter(_=>typeof _.v=="number");if(w.length<2)continue;e.save(),e.beginPath(),e.moveTo(w[0].x,p.y+p.h);for(const _ of w)e.lineTo(_.x,_.y);if(e.lineTo(w[w.length-1].x,p.y+p.h),e.closePath(),e.fillStyle=y.color+"22",e.fill(),e.restore(),e.save(),e.strokeStyle=y.color,e.lineWidth=2*l,e.lineJoin="round",e.lineCap="round",e.beginPath(),y.smooth&&w.length>2){e.moveTo(w[0].x,w[0].y);for(let _=1;_<w.length-1;_++){const v=(w[_].x+w[_+1].x)/2,k=(w[_].y+w[_+1].y)/2;e.quadraticCurveTo(w[_].x,w[_].y,v,k)}e.lineTo(w[w.length-1].x,w[w.length-1].y)}else{e.moveTo(w[0].x,w[0].y);for(const _ of w.slice(1))e.lineTo(_.x,_.y)}e.stroke(),e.restore();const x=3.5*l;for(const _ of w)e.save(),e.fillStyle=y.color,e.strokeStyle="#fff",e.lineWidth=1.5*l,e.beginPath(),e.arc(_.x,_.y,x,0,Math.PI*2),e.fill(),e.stroke(),e.restore()}Nt(e,t,s,i,p.legendY,d,l)}function Do(e,n,t,s,i,r,o,l){const a=b(n,"areaChart")||b(n,"area3DChart"),c=G(a,"grouping","standard"),d=c==="percentStacked",h=c==="stacked"||d,p=pe(a,"ser").map((v,k)=>({name:Ct(v),values:Ft(v),color:tt(v,k,o)})).reverse();if(!p.length)return;const m=Math.max(...p.map(v=>v.values.length),1),g=on(t,s,i,r,{hasLegend:!0});let S=0;if(d)S=100;else for(let v=0;v<m;v++){const k=p.reduce((j,M)=>j+(M.values[v]||0),0);S=Math.max(S,k)}const y={min:0,max:S||100,step:Xs(S||100)},w=Math.round((y.max-y.min)/y.step),x=Math.max(7,Math.min(11,g.w*.018))*l;e.save(),e.font=`${x}px sans-serif`,e.textAlign="right",e.fillStyle="#666";for(let v=0;v<=w;v++){const k=y.min+v*y.step,j=(k-y.min)/(y.max-y.min),M=g.y+g.h-j*g.h;nt(e,g.x,M,g.x+g.w,M),e.fillText(d?k+"%":st(k),g.x-4*l,M)}e.restore(),ze(e,g.x,g.y,g.x,g.y+g.h),ze(e,g.x,g.y+g.h,g.x+g.w,g.y+g.h);const _=new Array(m).fill(0);for(const v of p){e.save(),e.beginPath();const k=[];for(let j=0;j<m;j++){let M=v.values[j]??0;if(d){const L=p.reduce((H,D)=>H+(D.values[j]||0),0);M=L?M/L*100:0}const F=h?_[j]:0,R=F+Math.abs(M),P=(F-y.min)/(y.max-y.min),$=(R-y.min)/(y.max-y.min),N=g.x+j/(m-1||1)*g.w;k.push({x:N,y:g.y+g.h-$*g.h,baseY:g.y+g.h-P*g.h}),h&&(_[j]+=Math.abs(M))}e.moveTo(k[0].x,k[0].baseY);for(const j of k)e.lineTo(j.x,j.baseY);for(let j=k.length-1;j>=0;j--)e.lineTo(k[j].x,k[j].y);e.closePath(),e.fillStyle=v.color+"cc",e.fill(),e.beginPath(),e.moveTo(k[0].x,k[0].y);for(const j of k.slice(1))e.lineTo(j.x,j.y);e.strokeStyle=v.color,e.lineWidth=1.5*l,e.stroke(),e.restore()}Nt(e,t,s,i,g.legendY,[...p].reverse(),l)}function rs(e,n,t,s,i,r,o,l){const a=b(n,"pieChart")||b(n,"pie3DChart"),c=b(n,"doughnutChart"),d=a||c,h=!!c,u=pe(d,"ser");if(!u.length)return;const p=u[0],m=Ft(p).map(P=>typeof P=="number"&&P>0?P:0),g=rn(p),S=Vs(p,o),y=m.reduce((P,$)=>P+$,0);if(!y)return;const w=Math.min(i,r)*.38,x=t+i*.44,_=s+r*.5,v=h?w*.55:0;let k=-Math.PI/2;for(let P=0;P<m.length;P++){if(!m[P])continue;const $=m[P]/y*Math.PI*2,N=S[P]||tt(p,P,o),L=k+$/2,H=P===0?w*.04:0,D=H*Math.cos(L),U=H*Math.sin(L);e.save(),e.beginPath(),e.moveTo(x+D,_+U),e.arc(x+D,_+U,w,k,k+$),e.closePath(),e.fillStyle=N,e.fill(),e.shadowColor="rgba(0,0,0,0.12)",e.shadowBlur=4*l,e.strokeStyle="#fff",e.lineWidth=1.5*l,e.stroke(),e.restore(),v>0&&(e.save(),e.beginPath(),e.arc(x,_,v,0,Math.PI*2),e.fillStyle="#fff",e.fill(),e.restore());const q=m[P]/y;if(q>.05){const Q=x+D+w*.65*Math.cos(L),J=_+U+w*.65*Math.sin(L),I=Math.max(8,Math.min(13,w*.15))*l;e.save(),e.fillStyle="#fff",e.font=`bold ${I}px sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillText(Math.round(q*100)+"%",Q,J),e.restore()}k+=$}if(h){const P=Math.max(10,Math.min(16,w*.22))*l;e.save(),e.font=`bold ${P}px sans-serif`,e.fillStyle="#333",e.textAlign="center",e.textBaseline="middle",e.fillText(st(y),x,_),e.restore()}const j=t+i*.78,M=Math.max(8,Math.min(12,i*.022))*l;e.font=`${M}px sans-serif`,e.textBaseline="middle";const F=M*1.8,R=_-m.length*F/2;for(let P=0;P<m.length;P++){const $=j,N=R+P*F,L=S[P]||tt(p,P,o);e.fillStyle=L,St(e,$,N-M*.5,M*1.2,M),e.fill(),e.fillStyle="#444";const H=String(g[P]??`Item ${P+1}`);e.fillText(H,$+M*1.5,N)}}function Bo(e,n,t,s,i,r,o,l){const a=b(n,"scatterChart")||b(n,"bubbleChart"),d=pe(a,"ser").map((k,j)=>{const M=vt(b(b(k,"xVal"),"numCache")),F=vt(b(b(k,"yVal"),"numCache")),R=vt(b(b(k,"bubbleSize"),"numCache"));return{name:Ct(k),color:tt(k,j,o),points:M.map((P,$)=>({x:P,y:F[$],r:R[$]})).filter(P=>typeof P.x=="number"&&typeof P.y=="number")}});if(!d.length)return;const h=on(t,s,i,r,{hasLegend:d.length>1}),u=d.flatMap(k=>k.points.map(j=>j.x)),p=d.flatMap(k=>k.points.map(j=>j.y)),m=Pt(u,!1),g=Pt(p),S=Math.max(7,Math.min(11,h.w*.018))*l,y=Math.round((m.max-m.min)/m.step),w=Math.round((g.max-g.min)/g.step);e.font=`${S}px sans-serif`,e.save(),e.textAlign="center",e.fillStyle="#666";for(let k=0;k<=y;k++){const j=m.min+k*m.step,M=(j-m.min)/(m.max-m.min),F=h.x+M*h.w;nt(e,F,h.y,F,h.y+h.h),e.fillText(st(j),F,h.y+h.h+S*1.5)}e.textAlign="right";for(let k=0;k<=w;k++){const j=g.min+k*g.step,M=(j-g.min)/(g.max-g.min),F=h.y+h.h-M*h.h;nt(e,h.x,F,h.x+h.w,F),e.fillText(st(j),h.x-4*l,F)}e.restore(),ze(e,h.x,h.y,h.x,h.y+h.h),ze(e,h.x,h.y+h.h,h.x+h.w,h.y+h.h);const x=d.flatMap(k=>k.points.map(j=>j.r??1)),_=Math.max(...x.filter(k=>typeof k=="number"),1),v=Math.min(h.w,h.h)*.06;for(const k of d)for(const j of k.points){const M=h.x+(j.x-m.min)/(m.max-m.min)*h.w,F=h.y+h.h-(j.y-g.min)/(g.max-g.min)*h.h,R=j.r!=null?j.r/_*v:4*l;e.save(),e.fillStyle=k.color+"aa",e.strokeStyle=k.color,e.lineWidth=1*l,e.beginPath(),e.arc(M,F,R,0,Math.PI*2),e.fill(),e.stroke(),e.restore()}d.length>1&&Nt(e,t,s,i,h.legendY,d,l)}function Oo(e,n,t,s,i,r,o,l){const a=b(n,"radarChart"),c=pe(a,"ser"),d=c.map((w,x)=>({name:Ct(w),values:Ft(w),color:tt(w,x,o)}));if(!d.length)return;const h=rn(c[0])||[],u=h.length||d[0]?.values.length||0;if(u<3)return;const p=t+i*.5,m=s+r*.5,g=Math.min(i,r)*.34,S=Pt(d.flatMap(w=>w.values)),y=4;for(let w=1;w<=y;w++){const x=g*w/y;e.save(),e.beginPath();for(let _=0;_<u;_++){const v=_/u*Math.PI*2-Math.PI/2,k=p+x*Math.cos(v),j=m+x*Math.sin(v);_===0?e.moveTo(k,j):e.lineTo(k,j)}e.closePath(),e.strokeStyle="rgba(0,0,0,0.12)",e.lineWidth=.5,e.stroke(),e.restore()}for(let w=0;w<u;w++){const x=w/u*Math.PI*2-Math.PI/2;ze(e,p,m,p+g*Math.cos(x),m+g*Math.sin(x));const _=p+(g+16*l)*Math.cos(x),v=m+(g+16*l)*Math.sin(x);e.save(),e.font=`${Math.max(7,11*l)}px sans-serif`,e.fillStyle="#555",e.textAlign="center",e.textBaseline="middle",e.fillText(String(h[w]??w+1),_,v),e.restore()}for(const w of d){const x=w.values.map((_,v)=>{const k=v/u*Math.PI*2-Math.PI/2,j=(_-S.min)/(S.max-S.min);return{x:p+g*j*Math.cos(k),y:m+g*j*Math.sin(k)}});e.save(),e.beginPath(),e.moveTo(x[0].x,x[0].y);for(const _ of x.slice(1))e.lineTo(_.x,_.y);e.closePath(),e.fillStyle=w.color+"44",e.fill(),e.strokeStyle=w.color,e.lineWidth=1.5*l,e.stroke(),e.restore()}Nt(e,t,s,i,s+r-20*l,d,l)}function Uo(e,n,t,s,i,r){const o=b(b(n,"chart"),"title");if(!o)return!1;const l=b(o,"tx");if(!l)return!1;let a="";for(const d of pe(l,"t"))a+=d.textContent;if(!a.trim())return!1;const c=Math.max(10,Math.min(16,i*.03))*r;return e.save(),e.font=`bold ${c}px sans-serif`,e.fillStyle="#333",e.textAlign="center",e.textBaseline="top",e.fillText(a,t+i/2,s+6*r),e.restore(),!0}function Go(e,n,t,s,i,r,o,l){if(!n)return;const a=n;e.save(),e.fillStyle="#fff",St(e,t,s,i,r,4*l),e.fill(),e.strokeStyle="#ddd",e.lineWidth=.5,e.stroke(),e.restore();const d=Uo(e,a,t,s,i,l)?s+Math.min(r*.08,24*l):s,h=r-(d-s),u=b(a,"plotArea");if(!u)return;const p=b(u,"bar3DChart")||b(u,"barChart"),m=b(u,"line3DChart")||b(u,"lineChart"),g=b(u,"area3DChart")||b(u,"areaChart"),S=b(u,"pie3DChart")||b(u,"pieChart"),y=b(u,"doughnutChart"),w=b(u,"scatterChart")||b(u,"bubbleChart"),x=b(u,"radarChart");if(p)Io(e,u,t,d,i,h,o,l);else if(m)Lo(e,u,t,d,i,h,o,l);else if(g)Do(e,u,t,d,i,h,o,l);else if(y)rs(e,u,t,d,i,h,o,l);else if(S)rs(e,u,t,d,i,h,o,l);else if(w)Bo(e,u,t,d,i,h,o,l);else if(x)Oo(e,u,t,d,i,h,o,l);else{e.save(),e.fillStyle="#aaa",e.font=`${12*l}px sans-serif`,e.textAlign="center",e.textBaseline="middle";const _=u.firstElementChild;e.fillText(_?.localName??"Chart",t+i/2,s+r/2),e.restore()}}function Qt(e,n,t=0,s=1){return(e?parseInt(e.getAttribute(n)||t,10):t)*s}function Hs(e,n){if(!e)return null;const t=xe(e);if(!t)return null;const s=_e(t,n);return s?we(s):null}function qo(e,n,t,s,i,r,o){const l=b(n,"bevelT"),a=b(n,"bevelB"),c=l||a;if(!c)return;const d=Math.max(2*o,Qt(c,"w",76200,o)),h=Math.max(2*o,Qt(c,"h",76200,o)),p=G(c,"prst","circle").toLowerCase().includes("in"),m=Math.min(d,i*.3),g=Math.min(h,r*.3),S=p?"rgba(0,0,0,0.18)":"rgba(255,255,255,0.35)",y=p?"rgba(255,255,255,0.20)":"rgba(0,0,0,0.20)",w=e.createLinearGradient(t,s,t,s+g);w.addColorStop(0,S),w.addColorStop(1,"rgba(255,255,255,0)"),e.save(),e.fillStyle=w,e.fillRect(t,s,i,g);const x=e.createLinearGradient(t,s+r-g,t,s+r);x.addColorStop(0,"rgba(0,0,0,0)"),x.addColorStop(1,y),e.fillStyle=x,e.fillRect(t,s+r-g,i,g);const _=e.createLinearGradient(t,s,t+m,s);_.addColorStop(0,S),_.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=_,e.fillRect(t,s,m,r);const v=e.createLinearGradient(t+i-m,s,t+i,s);v.addColorStop(0,"rgba(0,0,0,0)"),v.addColorStop(1,y),e.fillStyle=v,e.fillRect(t+i-m,s,m,r),e.restore()}function Wo(e,n,t,s,i,r,o,l){const a=Qt(n,"extrusionH",0,l);if(a<1*l)return;const c=b(n,"extrusionClr")||b(n,"contourClr"),d=Hs(c,t)||"rgba(0,0,0,0.3)",h=Math.min(a/914400*72*l,Math.min(r,o)*.15),u=h*.7,p=h*.7;e.save(),e.fillStyle=d,e.beginPath(),e.moveTo(s+r,i),e.lineTo(s+r+u,i+p),e.lineTo(s+r+u,i+o+p),e.lineTo(s+r,i+o),e.closePath(),e.fill(),e.beginPath(),e.moveTo(s,i+o),e.lineTo(s+u,i+o+p),e.lineTo(s+r+u,i+o+p),e.lineTo(s+r,i+o),e.closePath(),e.fill(),e.restore()}function Ko(e,n,t,s,i,r,o,l){const a=Qt(n,"contourW",0,l);if(a<.5)return;const c=b(n,"contourClr"),d=Hs(c,t)||"#888888",h=Math.max(.5,a/914400*72*l);e.save(),e.strokeStyle=d,e.lineWidth=h,e.strokeRect(s,i,r,o),e.restore()}function Vo(e,n,t,s,i,r){if(!n)return()=>{};const o=b(n,"camera");if(!o)return()=>{};const l=G(o,"prst","orthographicFront"),a=b(o,"rot");if(l.toLowerCase().includes("orthographic")&&!a)return()=>{};const d=a?C(a,"lat",0)/6e4:0,h=a?C(a,"lon",0)/6e4:0;a&&C(a,"rev",0)/6e4;const u=d*Math.PI/180,p=h*Math.PI/180,m=Math.sin(p)*.15,g=Math.sin(u)*.08;return e.save(),e.transform(1,g,m,1,t*-m,s*-g),()=>e.restore()}function Xo(e,n,t,s,i,r){if(!n)return;const o=b(n,"lightRig");if(!o)return;const l=G(o,"dir","t"),a=G(o,"rig","balanced"),c={t:{gx:t+i/2,gy:s},b:{gx:t+i/2,gy:s+r},l:{gx:t,gy:s+r/2},r:{gx:t+i,gy:s+r/2},tl:{gx:t,gy:s},tr:{gx:t+i,gy:s},bl:{gx:t,gy:s+r},br:{gx:t+i,gy:s+r}},{gx:d,gy:h}=c[l]||c.t,u=a==="flat"?.08:a==="balanced"?.14:a==="sunrise"?.2:a==="harsh"?.28:.12,p=Math.sqrt(i*i+r*r),m=e.createRadialGradient(d,h,0,d,h,p);m.addColorStop(0,`rgba(255,255,255,${u})`),m.addColorStop(.5,"rgba(255,255,255,0)"),m.addColorStop(1,`rgba(0,0,0,${u*.5})`),e.save(),e.fillStyle=m,e.fillRect(t,s,i,r),e.restore()}function Ho(e,n,t,s,i,r,o,l){if(!n)return{applyCamera:()=>()=>{},overlay:()=>{}};const a=b(n,"sp3d")||b(n,"scene3d")?.parentNode&&null,c=b(n,"scene3d");a&&Wo(e,a,t,s,i,r,o,l);const d=Vo(e,c,s,i);return{overlay(){a&&(qo(e,a,s,i,r,o,l),Ko(e,a,t,s,i,r,o,l)),c&&Xo(e,c,s,i,r,o)},cleanup:d}}function Yo(e){return e?!!(b(e,"sp3d")||b(e,"scene3d")):!1}async function Tt(e,n,t,s,i,r,o,l,a){if(!n)return!1;const c=n.localName;if(c==="noFill")return!1;if(c==="solidFill"){const d=xe(n),h=_e(d,l);return h?(e.fillStyle=we(h),e.fill(),!0):!1}if(c==="gradFill"){const d=b(n,"gsLst");if(!d)return!1;const h=pe(d,"gs").map(y=>{const w=C(y,"pos",0)/1e5,x=xe(y),_=_e(x,l);return{pos:w,color:_}}).sort((y,w)=>y.pos-w.pos);if(h.length<2)return!1;const u=b(n,"lin"),p=b(n,"path"),m=t+i/2,g=s+r/2;let S;if(u||!u&&!p){const x=(C(u,"ang",0)/6e4-90)*Math.PI/180,_=Math.cos(x),v=Math.sin(x),k=Math.abs(i*_)+Math.abs(r*v),j=m-k/2*_,M=g-k/2*v,F=m+k/2*_,R=g+k/2*v;S=e.createLinearGradient(j,M,F,R)}else{const y=b(p,"fillToRect"),w=C(y,"l",5e4)/1e5,x=C(y,"t",5e4)/1e5,_=C(y,"r",5e4)/1e5,v=C(y,"b",5e4)/1e5,k=t+i*(w+(1-w-_)/2),j=s+r*(x+(1-x-v)/2),M=Math.sqrt(i*i+r*r)/2;S=e.createRadialGradient(k,j,0,m,g,M)}for(const y of h)y.color&&S.addColorStop(y.pos,we(y.color));return e.fillStyle=S,e.fill(),!0}if(c==="blipFill"){const d=b(n,"blip"),h=d?d.getAttribute("r:embed")||d.getAttribute("embed"):null;if(h&&a&&a[h]){const u=a[h],p=b(n,"stretch"),m=p?b(p,"fillRect"):null;let g=t,S=s,y=i,w=r;if(m){const k=C(m,"l",0)/1e5,j=C(m,"t",0)/1e5,M=C(m,"r",0)/1e5,F=C(m,"b",0)/1e5;g=t+i*k,S=s+r*j,y=i-i*k-i*M,w=r-r*j-r*F}if(b(n,"tile")){const k=e.createPattern(u,"repeat");if(k)return e.fillStyle=k,e.fill(),!0}const _=b(n,"alphaModFix")||b(d,"alphaModFix"),v=_?C(_,"amt",1e5)/1e5:1;return e.save(),e.clip(),v<1&&(e.globalAlpha=v),e.drawImage(u,g,S,y,w),e.restore(),!0}return!1}if(c==="pattFill"){const d=b(n,"fgClr"),h=b(n,"bgClr"),u=d?_e(xe(d),l):{r:0,g:0,b:0,a:1},p=h?_e(xe(h),l):{r:255,g:255,b:255,a:1},m=we(u),g=we(p),S=G(n,"prst","dotGrid");let y=null,w=null;try{w=typeof OffscreenCanvas<"u"?new OffscreenCanvas(8,8):document.createElement("canvas");const v=8;w.width=v,w.height=v,y=w.getContext("2d")}catch{}const x=8;if(!y)return e.fillStyle=we(u),e.fill(),!0;switch(y.fillStyle=g,y.fillRect(0,0,x,x),y.fillStyle=m,S){case"smGrid":case"dotGrid":case"dotDmnd":for(let v=0;v<x;v+=2)for(let k=0;k<x;k+=2)y.fillRect(v,k,1,1);break;case"lgGrid":case"cross":y.fillRect(0,0,x,1),y.fillRect(0,0,1,x);break;case"diagBd":case"fwdDiag":for(let v=0;v<x*2;v++)y.fillRect(v%x,Math.floor(v/x)*2,1,1);break;case"bkDiag":case"ltDnDiag":for(let v=0;v<x*2;v++)y.fillRect(x-1-v%x,Math.floor(v/x)*2,1,1);break;case"horzBrick":case"horz":y.fillRect(0,x/2,x,1);break;case"vert":case"vertBrick":y.fillRect(x/2,0,1,x);break;case"smCheck":case"lgCheck":for(let v=0;v<x;v++)for(let k=0;k<x;k++)(v+k)%2===0&&y.fillRect(k,v,1,1);break;default:for(let v=0;v<x;v+=4)y.fillRect(v,v,2,2)}const _=e.createPattern(w,"repeat");return _?(e.fillStyle=_,e.fill(),!0):(e.fillStyle=we(u,(u.a??1)*.4),e.fill(),!0)}return!1}async function Ue(e,n){const t=n.split("/"),s=t.pop(),i=[...t,"_rels",s+".rels"].join("/"),r=e[i];if(!r)return{};const o=new TextDecoder().decode(r),l=Se(o),a={};for(const c of Array.from(l.getElementsByTagName("Relationship"))){const d=c.getAttribute("Id"),h=c.getAttribute("Target"),u=c.getAttribute("Type")||"",p=c.getAttribute("TargetMode")||"Internal";let m=h;if(p!=="External")if(h.startsWith("/"))m=h.slice(1);else{const g=n.split("/");g.pop();const S=h.split("/");for(const y of S)y===".."?g.pop():y!=="."&&g.push(y);m=g.join("/")}a[d]={target:h,fullPath:m,type:u,external:p==="External"}}return a}async function Wt(e,n){const t={},s=new Set(["png","jpg","jpeg","gif","webp","bmp","tiff","tif","svg"]);for(const[i,r]of Object.entries(n)){if(r.external)continue;const o=r.fullPath.split(".").pop().toLowerCase();if(s.has(o))try{const l=e[r.fullPath];if(!l)continue;const c={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",svg:"image/svg+xml"}[o]||"image/png",d=new Blob([l],{type:c}),h=URL.createObjectURL(d),u=await new Promise((p,m)=>{const g=new Image;g.onload=()=>p(g),g.onerror=()=>p(null),g.src=h});t[i]=u}catch{}}return t}function Ys(e,n,t){if(!e)return n*1.2;const s=b(e,"spcPct"),i=b(e,"spcPts");return s?n*(C(s,"val",1e5)/1e5):i?C(i,"val",0)/100*12700*(t||1):n*1.2}function Qo(e,n,t,s){if(!e||b(e,"buNone"))return null;const i=b(e,"buChar"),r=b(e,"buAutoNum");if(!i&&!r)return null;let o=null;const l=b(e,"buClr");if(l){const m=xe(l);o=_e(m,t)}const a=b(e,"buSzPct"),c=b(e,"buSzPts");let d=1;a&&(d=C(a,"val",1e5)/1e5);const h=c?C(c,"val",0)/100:null;let u=null;const p=b(e,"buFont");if(p){const m=p.getAttribute("typeface");m&&(u=m)}return i?{type:"char",char:i.getAttribute("char")||"•",color:o,sizePct:d,sizePts:h,fontFamily:u}:r?{type:"autoNum",numType:r.getAttribute("type")||"arabicPeriod",startAt:C(r,"startAt",1),color:o,sizePct:d,sizePts:h,fontFamily:u}:null}function Zo(e,n){switch(e){case"arabicPeriod":return n+".";case"arabicParenR":return n+")";case"arabicParenBoth":return"("+n+")";case"romanLcPeriod":return os(n).toLowerCase()+".";case"romanUcPeriod":return os(n)+".";case"alphaLcParenR":return String.fromCharCode(96+n)+")";case"alphaUcParenR":return String.fromCharCode(64+n)+")";case"alphaLcPeriod":return String.fromCharCode(96+n)+".";case"alphaUcPeriod":return String.fromCharCode(64+n)+".";default:return n+"."}}function os(e){const n=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],t=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];let s="";for(let i=0;i<n.length;i++)for(;e>=n[i];)s+=t[i],e-=n[i];return s}function Jo(e,n,t,s,i){if(!n)return;const r=e.font.match(/(d+(?:.d+)?)px/),o=r?parseFloat(r[1]):16,l=n.sizePts!=null?n.sizePts*(o/12):o*n.sizePct;e.save(),n.color&&(e.fillStyle=we(n.color),e.strokeStyle=e.fillStyle);const a=n.fontFamily?'"'+n.fontFamily+'", sans-serif':e.font.split(/\d+px\s+/)[1]||"sans-serif";if(e.font=l+"px "+a,n.type==="char")e.fillText(n.char,t,s);else if(n.type==="autoNum"){const c=n.numType+":"+n.startAt;i[c]===void 0&&(i[c]=n.startAt);const d=Zo(n.numType,i[c]);i[c]++,e.fillText(d,t,s)}e.restore()}async function Zt(e,n,t,s,i,r,o,l,a,c=1800){if(!n)return;const d=b(n,"bodyPr"),h=G(d,"anchor","t"),u=G(d,"wrap","square"),p=G(d,"vert","horz"),m=C(d,"lIns",91440)*o,g=C(d,"tIns",45720)*o,S=C(d,"rIns",91440)*o,y=C(d,"bIns",45720)*o,w=t+m,x=s+g,_=i-m-S,v=r-g-y,k=u!=="none",j=p==="vert"||p==="vert270"||p==="eaVert";j&&(e.save(),p==="vert270"?(e.translate(t+i,s),e.rotate(Math.PI/2)):(e.translate(t,s+r),e.rotate(-Math.PI/2)));const M=b(d,"normAutoFit")||b(n,"normAutoFit");b(d,"spAutoFit")||b(n,"spAutoFit");const F=M?M.getAttribute("fontScale"):null;let R=F?parseInt(F,10)/1e5:1;const P=b(n,"lstStyle"),$=P?b(P,"defRPr"):null;function N(J,I,V,oe){const ee=J?J.getAttribute(V):null;if(ee!==null&&ee!=="")return ee;const ae=I?I.getAttribute(V):null;if(ae!==null&&ae!=="")return ae;const Y=$?$.getAttribute(V):null;return Y!==null&&Y!==""?Y:oe}const L=pe(n,"p"),H=[];let D=0;for(const J of L){const I=b(J,"pPr"),V=G(I,"algn","l");C(I,"lvl",0);const oe=C(I,"marL",0)*o,ee=C(I,"indent",0)*o,ae=I?Qo(I,ce,l):null,Y=b(I,"spcBef"),X=b(I,"spcAft"),ke=b(I,"lnSpc"),ce=b(I,"defRPr");let de=c;if($){const ne=$.getAttribute("sz");ne&&(de=parseInt(ne,10))}if(ce){const ne=ce.getAttribute("sz");ne&&(de=parseInt(ne,10))}let fe=0,W=0;if(Y){const ne=b(Y,"spcPct"),se=b(Y,"spcPts");ne?fe=de*127*o*(C(ne,"val",0)/1e5):se&&(fe=C(se,"val",0)*kt*o/100)}if(X){const ne=b(X,"spcPct"),se=b(X,"spcPts");ne?W=de*127*o*(C(ne,"val",0)/1e5):se&&(W=C(se,"val",0)*kt*o/100)}const le=[];for(const ne of J.children){const se=ne.localName;(se==="r"||se==="br"||se==="fld")&&le.push(ne)}if(le.length===0){const ne=b(J,"endParaRPr"),ie=C(ne||ce,"sz",de)*127*o*R;H.push({lines:[""],algn:V,marL:oe,spaceBefore:fe,spaceAfter:W,szPx:ie,lnSpc:ke,runs:[],emptyPara:!0,bullet:ae}),D+=fe+ie*1.2+W;continue}let me=[],he=[],B=0;for(const ne of le){if(ne.localName==="br"){me.push({runs:he,maxSzPx:Math.max(B,de*127*o)}),he=[],B=0;continue}const se=b(ne,"rPr"),ie=b(ne,"t");let z=ie?ie.textContent:"";const O=Ks(se,ce,o*R,a,de,$);e.font=O.fontStr;const re=O.szPx;re>B&&(B=re);const be=Eo(se,ce,l),ve=N(se,ce,"u","none")!=="none",je=N(se,ce,"strike","noStrike")!=="noStrike",Pe=parseInt(N(se,ce,"baseline","0"),10);if(k){const rt=z.split(" ");for(let mn=0;mn<rt.length;mn++){const gn=rt[mn];let Gn=ee+oe;for(const $t of he)e.font=$t.fontInfo.fontStr,Gn+=e.measureText($t.text).width;e.font=O.fontStr;const yi=e.measureText(gn).width,vi=he.length?e.measureText(" ").width:0;if(Gn+vi+yi>_&&he.length>0)me.push({runs:he,maxSzPx:Math.max(B,re)}),he=[{text:gn,rPr:se,fontInfo:O,color:be,underline:ve,strikethrough:je,baseline:Pe}],B=re;else{if(he.length>0){const $t={text:" ",rPr:se,fontInfo:O,color:be,underline:!1,strikethrough:!1,baseline:Pe};he.push($t)}he.push({text:gn,rPr:se,fontInfo:O,color:be,underline:ve,strikethrough:je,baseline:Pe})}}}else he.push({text:z,rPr:se,fontInfo:O,color:be,underline:ve,strikethrough:je,baseline:Pe}),re>B&&(B=re)}he.length>0&&me.push({runs:he,maxSzPx:Math.max(B,de*127*o)});const te=ke?Ys(ke,de*127*o*R,o):null;H.push({lines:me,algn:V,marL:oe,indent:ee,spaceBefore:fe,spaceAfter:W,lnSpcPx:te,emptyPara:!1,bullet:ae});for(const ne of me)D+=fe+(te||ne.maxSzPx*1.2)+W}if(M&&!F&&D>v&&v>0){let J=.3,I=1;for(let V=0;V<8;V++){const oe=(J+I)/2;let ee=0;for(const ae of L){const Y=b(ae,"pPr"),X=Y?b(Y,"defRPr"):null;let ke=c;if($){const te=$.getAttribute("sz");te&&(ke=parseInt(te,10))}if(X){const te=X.getAttribute("sz");te&&(ke=parseInt(te,10))}const ce=Array.from(ae.children).filter(te=>["r","br","fld"].includes(te.localName)),de=ke*127*o*oe;if(ce.length===0){ee+=de*1.2;continue}const fe=ce.reduce((te,ne)=>{const se=b(ne,"t");return te+(se?se.textContent.length:0)},0),W=_>0?_:i,le=fe>0?ce.reduce((te,ne)=>{const se=b(ne,"t");return te+(se?se.textContent:"")},"").slice(0,20):"W";e.font=`${de}px sans-serif`;const me=le.length>0?e.measureText(le).width/le.length:de*.6,he=Math.max(1,Math.floor(W/me)),B=Math.max(1,Math.ceil(fe/he));ee+=B*de*1.2}ee<=v?J=oe:I=oe}R=(J+I)/2}let U=x;h==="ctr"?U=x+(v-D)/2:h==="b"&&(U=x+v-D);let q=U;const Q={};for(const J of H){const{lines:I,algn:V,marL:oe,indent:ee,spaceBefore:ae,spaceAfter:Y,lnSpcPx:X,emptyPara:ke,bullet:ce}=J;if(q+=ae,ke){q+=I[0]?X||J.szPx*1.2:12*o,q+=Y;continue}for(const de of I){const{runs:fe,maxSzPx:W}=de,le=X||W*1.2,me=q+W*.85;let he=0;for(const ie of fe)e.font=ie.fontInfo.fontStr,he+=e.measureText(ie.text).width;let B=w+oe;V==="ctr"?B=w+(_-he)/2:V==="r"&&(B=w+_-he);const te=de===I[0];if(ce&&te){const ie=w+oe+ee;Jo(e,ce,ie,me,Q)}let ne=0;if(V==="just"&&!(de===I[I.length-1])){let z=0;for(const re of fe)e.font=re.fontInfo.fontStr,z+=(re.text.match(/ /g)||[]).length;const O=_-oe-he;z>0&&O>0&&(ne=O/z)}const se=(ie,z,O,re,be,ve)=>{e.font=re.fontStr;const je=e.measureText(ie).width;e.fillText(ie,z,O);const Pe=Math.max(.5,re.szPx*.07);return be&&(e.save(),e.strokeStyle=e.fillStyle,e.lineWidth=Pe,e.beginPath(),e.moveTo(z,O+Pe*1.5),e.lineTo(z+je,O+Pe*1.5),e.stroke(),e.restore()),ve&&(e.save(),e.strokeStyle=e.fillStyle,e.lineWidth=Pe,e.beginPath(),e.moveTo(z,O-re.szPx*.3),e.lineTo(z+je,O-re.szPx*.3),e.stroke(),e.restore()),je};for(const ie of fe){const z=ie.color;e.fillStyle=z?we(z):"#000000";let O=me,re=ie.fontInfo;if(ie.baseline!==0){const be=re.szPx*.65,ve=`${re.italic?"italic ":""}${re.bold?"bold ":""}${be}px "${re.family}", sans-serif`;re={...re,szPx:be,fontStr:ve},ie.baseline>0?O=me-ie.fontInfo.szPx*.38:O=me+ie.fontInfo.szPx*.12}if(ne>0&&ie.text.includes(" ")){e.font=re.fontStr;const be=ie.text.split(" ");for(let ve=0;ve<be.length;ve++){const je=se(be[ve],B,O,re,ie.underline,ie.strikethrough);B+=je,ve<be.length-1&&(e.font=re.fontStr,B+=e.measureText(" ").width+ne)}}else{e.font=re.fontStr;const be=e.measureText(ie.text).width;se(ie.text,B,O,re,ie.underline,ie.strikethrough),B+=be}}q+=le}q+=Y}j&&e.restore()}function Qs(e,n,t,s){const i=b(n,"effectLst");if(!i)return()=>{};const r=b(i,"outerShdw"),o=b(i,"innerShdw"),l=r||o;if(l){const c=C(l,"blurRad",38100)*s,d=C(l,"dist",38100)*s,u=C(l,"dir",27e5)/6e4*Math.PI/180,p=d*Math.cos(u),m=d*Math.sin(u),g=xe(l),S=_e(g,t),y=S?we(S):"rgba(0,0,0,0.35)";e.shadowBlur=Math.min(c,40),e.shadowOffsetX=p,e.shadowOffsetY=m,e.shadowColor=y}const a=b(i,"glow");if(a){const c=C(a,"rad",0)*s,d=xe(a),h=_e(d,t);h&&(e.shadowBlur=Math.min(c,30),e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowColor=we(h))}return()=>{e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowColor="transparent"}}async function an(e,n,t,s,i,r,o,l=null,a=null){const c=b(n,"spPr"),d=b(c,"xfrm");let h=0,u=0,p=0,m=0,g=0,S=!1,y=!1;if(d){const U=b(d,"off"),q=b(d,"ext");U&&(h=C(U,"x",0)*o,u=C(U,"y",0)*o),q&&(p=C(q,"cx",0)*o,m=C(q,"cy",0)*o),g=C(d,"rot",0)/6e4,S=G(d,"flipH","0")==="1",y=G(d,"flipV","0")==="1"}else{const U=ti(n,a);if(U)h=U.x*o,u=U.y*o,p=U.w*o,m=U.h*o;else return}if(p<=0||m<=0)return;if(l){const{grpOff:U,grpExt:q,chOff:Q,chExt:J}=l,I=q.cx/J.cx,V=q.cy/J.cy;h=U.x+(h/o-Q.x)*I*o,u=U.y+(u/o-Q.y)*V*o,p=p*I,m=m*V}const w=h+p/2,x=u+m/2;e.save(),(g!==0||S||y)&&(e.translate(w,x),g!==0&&e.rotate(g*Math.PI/180),S&&e.scale(-1,1),y&&e.scale(1,-1),e.translate(-w,-x));const _=b(c,"prstGeom"),v=b(c,"custGeom"),k=_?G(_,"prst","rect"):"rect",j={};if(_){const U=b(_,"avLst");if(U){let q=0;for(const Q of pe(U,"gd")){const I=G(Q,"fmla","").match(/val\s+(-?\d+)/);I&&(j[q]=parseInt(I[1])),q++}}}const M=()=>{const U=["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"];for(const Q of U){const J=b(c,Q);if(J)return J}const q=b(n,"style");if(q){const Q=b(q,"fillRef");if(Q){if(C(Q,"idx",1)===0)return Se("<noFill/>").documentElement;const I=xe(Q);if(I)return Se('<solidFill xmlns="'+"http://schemas.openxmlformats.org/drawingml/2006/main"+'">'+I.outerHTML+"</solidFill>").documentElement}}return null},F=()=>{const U=b(c,"ln");if(U)return U;const q=b(n,"style");if(q){const Q=b(q,"lnRef");if(Q){if(C(Q,"idx",1)===0)return null;const I=xe(Q);if(I)return Se('<ln xmlns="'+"http://schemas.openxmlformats.org/drawingml/2006/main"+'"><solidFill>'+I.outerHTML+"</solidFill></ln>").documentElement}}return null};if(v){const U=b(v,"pathLst");if(U)for(const Q of pe(U,"path")){const J=C(Q,"w",1)||1,I=C(Q,"h",1)||1,V=p/J,oe=m/I;e.beginPath();for(const Y of Q.children)switch(Y.localName){case"moveTo":{const X=b(Y,"pt");X&&e.moveTo(h+C(X,"x",0)*V,u+C(X,"y",0)*oe);break}case"lnTo":{const X=b(Y,"pt");X&&e.lineTo(h+C(X,"x",0)*V,u+C(X,"y",0)*oe);break}case"cubicBezTo":{const X=pe(Y,"pt");X.length>=3&&e.bezierCurveTo(h+C(X[0],"x",0)*V,u+C(X[0],"y",0)*oe,h+C(X[1],"x",0)*V,u+C(X[1],"y",0)*oe,h+C(X[2],"x",0)*V,u+C(X[2],"y",0)*oe);break}case"quadBezTo":{const X=pe(Y,"pt");X.length>=2&&e.quadraticCurveTo(h+C(X[0],"x",0)*V,u+C(X[0],"y",0)*oe,h+C(X[1],"x",0)*V,u+C(X[1],"y",0)*oe);break}case"arcTo":{const X=C(Y,"wR",0)*V,ke=C(Y,"hR",0)*oe,ce=C(Y,"stAng",0)/6e4*Math.PI/180,de=C(Y,"swAng",0)/6e4*Math.PI/180,fe=e._lastX||h,W=e._lastY||u,le=fe-X*Math.cos(ce),me=W-ke*Math.sin(ce);X===ke?e.arc(le,me,X,ce,ce+de,de<0):e.ellipse(le,me,X,ke,0,ce,ce+de,de<0);break}case"close":e.closePath();break}const ee=M();ee&&await Tt(e,ee,h,u,p,m,o,i,s);const ae=F();ae&&ut(e,ae,i,o)}e.restore();const q=b(n,"txBody");if(q){e.save(),e.beginPath(),e.rect(h,u,p,m),e.clip();const Q=Pn(n);await Zt(e,q,h,u,p,m,o,i,r,Q),e.restore()}return}e.beginPath(),Yt(e,k,h,u,p,m,j);const R=Qs(e,c,i,o),P=h,$=u,N=p,L=m,H=Yo(c)?Ho(e,c,i,P,$,N,L,o):null;try{const U=M();let q=!1;U&&(q=await Tt(e,U,h,u,p,m,o,i,s)),H&&H.overlay();const Q=F();Q?ut(e,Q,i,o):q||(k==="line"||k==="straightConnector1")&&(e.strokeStyle="#000",e.lineWidth=1,e.stroke())}finally{R(),H?.cleanup&&H.cleanup()}e.restore();const D=b(n,"txBody");if(D){e.save(),(g!==0||S||y)&&(e.translate(w,x),g!==0&&e.rotate(g*Math.PI/180),S&&e.scale(-1,1),y&&e.scale(1,-1),e.translate(-w,-x)),e.beginPath(),e.rect(h,u,p,m),e.clip();const U=Pn(n);await Zt(e,D,h,u,p,m,o,i,r,U),e.restore()}}function Pn(e,n){const t=b(e,"nvSpPr"),s=t?b(t,"nvPr"):null,i=s?b(s,"ph"):null;if(i){const r=G(i,"type","body");if(r==="title"||r==="ctrTitle")return 4400;if(r==="subTitle"||r==="body")return 2800}return 1800}function ut(e,n,t,s){if(!n||b(n,"noFill"))return;const r=b(n,"solidFill"),o=b(n,"gradFill"),l=C(n,"w",12700),a=Math.max(.5,l*s);let c="#000000";if(r){const p=xe(r),m=_e(p,t);m&&(c=we(m))}else o&&(c="#888888");const d=b(n,"prstDash"),h=d?G(d,"val","solid"):"solid",u=G(n,"cap","flat");switch(G(n,"cmpd","sng"),e.strokeStyle=c,e.lineWidth=a,e.lineCap=u==="rnd"?"round":u==="sq"?"square":"butt",e.lineJoin="round",h){case"dash":e.setLineDash([a*4,a*2]);break;case"dot":e.setLineDash([a,a*2]);break;case"dashDot":e.setLineDash([a*4,a*2,a,a*2]);break;case"lgDash":e.setLineDash([a*8,a*3]);break;case"lgDashDot":e.setLineDash([a*8,a*3,a,a*3]);break;default:e.setLineDash([])}e.stroke(),e.setLineDash([])}async function ln(e,n,t,s,i,r){const o=b(n,"spPr"),l=b(o,"xfrm");if(!l)return;const a=b(l,"off"),c=b(l,"ext");if(!a||!c)return;const d=C(a,"x",0)*r,h=C(a,"y",0)*r,u=C(c,"cx",0)*r,p=C(c,"cy",0)*r,m=C(l,"rot",0)/6e4,g=G(l,"flipH","0")==="1",S=G(l,"flipV","0")==="1";if(u<=0||p<=0)return;const y=b(n,"blipFill"),w=y?b(y,"blip"):null,x=w?w.getAttribute("r:embed")||w.getAttribute("embed"):null,_=d+u/2,v=h+p/2;if(e.save(),(m!==0||g||S)&&(e.translate(_,v),m!==0&&e.rotate(m*Math.PI/180),g&&e.scale(-1,1),S&&e.scale(1,-1),e.translate(-_,-v)),x&&s[x]){const k=s[x],j=b(o,"prstGeom"),M=j?G(j,"prst","rect"):"rect",F={};if(j){const $=b(j,"avLst");if($){let N=0;for(const L of pe($,"gd")){const H=(G(L,"fmla","")||"").match(/val\s+(-?\d+)/);H&&(F[N]=parseInt(H[1])),N++}}}e.beginPath(),Yt(e,M,d,h,u,p,F),e.clip();const R=y?b(y,"srcRect"):null;if(R){const $=C(R,"l",0)/1e5,N=C(R,"t",0)/1e5,L=C(R,"r",0)/1e5,H=C(R,"b",0)/1e5,D=k.naturalWidth*(1-$-L),U=k.naturalHeight*(1-N-H);e.drawImage(k,k.naturalWidth*$,k.naturalHeight*N,D,U,d,h,u,p)}else e.drawImage(k,d,h,u,p);const P=b(o,"ln");P&&(e.beginPath(),Yt(e,M,d,h,u,p,F),ut(e,P,i,r))}else e.fillStyle="#e0e0e0",e.fillRect(d,h,u,p),e.strokeStyle="#aaa",e.lineWidth=1,e.strokeRect(d,h,u,p),e.beginPath(),e.moveTo(d,h),e.lineTo(d+u,h+p),e.moveTo(d+u,h),e.lineTo(d,h+p),e.stroke();e.restore()}async function Zs(e,n,t,s,i){const r=b(n,"xfrm");if(!r)return;const o=b(r,"off"),l=b(r,"ext");if(!o||!l)return;const a=C(o,"x",0)*i,c=C(o,"y",0)*i;C(l,"cx",0)*i,C(l,"cy",0)*i;const d=b(n,"graphic"),h=d?b(d,"graphicData"):null,u=h?b(h,"tbl"):null;if(!u)return;const p=b(u,"tblPr"),m=p?G(p,"bandRow","0")==="1":!1;p&&G(p,"bandCol","0");const g=p?G(p,"firstRow","0")==="1":!1,S=p?G(p,"lastRow","0")==="1":!1;p&&G(p,"firstCol","0"),p&&G(p,"lastCol","0");const y=b(u,"tblGrid"),w=pe(y,"gridCol").map(v=>C(v,"w",0)*i),x=pe(u,"tr");let _=c;for(let v=0;v<x.length;v++){const k=x[v],j=C(k,"h",457200)*i,M=pe(k,"tc");let F=a;const R=v===0,P=v===x.length-1,$=v%2===1;for(let N=0;N<M.length;N++){const L=M[N],H=C(L,"gridSpan",1);G(L,"vMerge","0");let D=0;for(let I=0;I<H;I++)D+=w[N+I]||0;const U=b(L,"tcPr"),q=U?["noFill","solidFill","gradFill","blipFill","pattFill"].map(I=>b(U,I)).find(Boolean):null;if(e.save(),e.beginPath(),e.rect(F,_,D,j),q)await Tt(e,q,F,_,D,j,i,t,null);else{let I=null;g&&R?I=t.accent1?"#"+t.accent1.toLowerCase():"#4472C4":S&&P?I="#e0e0e0":m&&$&&(I="rgba(0,0,0,0.06)"),e.fillStyle=I||"transparent",I&&e.fill()}const Q=[{el:b(U,"lnL"),x1:F,y1:_,x2:F,y2:_+j},{el:b(U,"lnR"),x1:F+D,y1:_,x2:F+D,y2:_+j},{el:b(U,"lnT"),x1:F,y1:_,x2:F+D,y2:_},{el:b(U,"lnB"),x1:F,y1:_+j,x2:F+D,y2:_+j}];for(const I of Q)I.el?b(I.el,"noFill")||(e.beginPath(),e.moveTo(I.x1,I.y1),e.lineTo(I.x2,I.y2),ut(e,I.el,t,i)):(e.beginPath(),e.strokeStyle="#cccccc",e.lineWidth=.5,e.moveTo(I.x1,I.y1),e.lineTo(I.x2,I.y2),e.stroke());e.restore();const J=b(L,"txBody");J&&(e.save(),e.beginPath(),e.rect(F,_,D,j),e.clip(),await Zt(e,J,F,_,D,j,i,t,s,1400),e.restore()),F+=D}_+=j}}async function cn(e,n,t,s,i,r,o){const l=b(n,"grpSpPr"),a=b(l,"xfrm");if(!a)return;const c=b(a,"off"),d=b(a,"ext"),h=b(a,"chOff"),u=b(a,"chExt");if(!c||!d||!h||!u)return;const p=C(a,"rot",0)/6e4,m=G(a,"flipH","0")==="1",g=G(a,"flipV","0")==="1",S={grpOff:{x:C(c,"x",0)*o,y:C(c,"y",0)*o},grpExt:{cx:C(d,"cx",0)*o,cy:C(d,"cy",0)*o},chOff:{x:C(h,"x",0),y:C(h,"y",0)},chExt:{cx:C(u,"cx",1),cy:C(u,"cy",1)}},y=S.grpOff.x+S.grpExt.cx/2,w=S.grpOff.y+S.grpExt.cy/2;e.save(),(p!==0||m||g)&&(e.translate(y,w),p!==0&&e.rotate(p*Math.PI/180),m&&e.scale(-1,1),g&&e.scale(1,-1),e.translate(-y,-w));for(const x of n.children){const _=x.localName;_==="sp"?await an(e,x,t,s,i,r,o,S):_==="pic"?await ln(e,x,t,s,i,o):_==="grpSp"?await cn(e,x,t,s,i,r,o):_==="graphicFrame"?await un(e,x,i,r,o,files,t):_==="cxnSp"&&await dn(e,x,i,o)}e.restore()}function as(e,n,t,s,i,r,o,l,a){const c=b(n,t);if(!c)return;const d=c.getAttribute("type")||"none";if(d==="none")return;const h={sm:3,med:6,lg:9},u=Math.max(.5,C(n,"w",12700)*a),p=u*(h[c.getAttribute("w")||"med"]??6),m=u*(h[c.getAttribute("len")||"med"]??6),g=Math.atan2(o-i,r-s);switch(e.save(),e.fillStyle=e.strokeStyle,e.strokeStyle=e.strokeStyle,d){case"triangle":case"arrow":case"stealth":{const S=d==="arrow",y=d==="stealth"?m*.5:0;e.beginPath(),e.moveTo(s,i),e.lineTo(s+m*Math.cos(g)+p/2*Math.sin(g),i+m*Math.sin(g)-p/2*Math.cos(g)),S||e.lineTo(s+y*Math.cos(g),i+y*Math.sin(g)),e.lineTo(s+m*Math.cos(g)-p/2*Math.sin(g),i+m*Math.sin(g)+p/2*Math.cos(g)),e.closePath(),S?e.stroke():e.fill();break}case"diamond":{const S=m/2;e.beginPath(),e.moveTo(s,i),e.lineTo(s+S*Math.cos(g)+p/2*Math.sin(g),i+S*Math.sin(g)-p/2*Math.cos(g)),e.lineTo(s+m*Math.cos(g),i+m*Math.sin(g)),e.lineTo(s+S*Math.cos(g)-p/2*Math.sin(g),i+S*Math.sin(g)+p/2*Math.cos(g)),e.closePath(),e.fill();break}case"oval":{const S=m/2,y=p/2,w=s+S*Math.cos(g),x=i+S*Math.sin(g);e.beginPath(),e.save(),e.translate(w,x),e.rotate(g),e.scale(1,y/S),e.arc(0,0,S,0,Math.PI*2),e.restore(),e.fill();break}}e.restore()}async function dn(e,n,t,s){const i=b(n,"spPr"),r=b(i,"xfrm");if(!r)return;const o=b(r,"off"),l=b(r,"ext");if(!o||!l)return;const a=C(o,"x",0)*s,c=C(o,"y",0)*s,d=C(l,"cx",0)*s,h=C(l,"cy",0)*s,u=C(r,"rot",0)/6e4,p=G(r,"flipH","0")==="1",m=G(r,"flipV","0")==="1",g=a+d/2,S=c+h/2,y=b(i,"ln");e.save(),(u!==0||p||m)&&(e.translate(g,S),u!==0&&e.rotate(u*Math.PI/180),p&&e.scale(-1,1),m&&e.scale(1,-1),e.translate(-g,-S));const w=b(i,"prstGeom"),x=w?G(w,"prst","line"):"line",_=x==="line"||x==="straightConnector1";if(e.beginPath(),_){const v=p?a:a+d,k=m?c:c+h,j=p?a+d:a,M=m?c+h:c;e.moveTo(j,M),e.lineTo(v,k)}else Yt(e,x,a,c,d,h,{});if(y){if(ut(e,y,t,s),_){const v=p?a+d:a,k=m?c+h:c,j=p?a:a+d,M=m?c:c+h;as(e,y,"headEnd",j,M,v,k,t,s),as(e,y,"tailEnd",v,k,j,M,t,s)}}else e.strokeStyle="#000",e.lineWidth=1,e.stroke();e.restore()}async function Js(e,n,t,s,i,r,o,l,a,c,d){const h=c*a,u=d*a,p=x=>{const _=b(x,"cSld");if(!_)return null;const v=b(_,"bg");if(!v)return null;const k=b(v,"bgPr"),j=b(v,"bgRef");return{bgPr:k,bgRef:j}},m=n?p(n):null,g=s?p(s):null,S=t?p(t):null,y=m||g||S;let w=!1;if(y){const{bgPr:x,bgRef:_}=y;if(x){const v=["noFill","solidFill","gradFill","blipFill","pattFill"];for(const k of v){const j=b(x,k);if(j){e.beginPath(),e.rect(0,0,h,u);const M=y===S?Object.assign({},o):o;await Tt(e,j,0,0,h,u,1,l,M)&&(w=!0);break}}}else if(_){C(_,"idx",0);const v=xe(_),k=_e(v,l);k&&(e.fillStyle=we(k),e.fillRect(0,0,h,u),w=!0)}}w||(e.fillStyle="#ffffff",e.fillRect(0,0,h,u))}function ei(e){const n={};for(const t of e){if(!t)continue;const s=b(t,"cSld"),i=s?b(s,"spTree"):null;if(i)for(const r of pe(i,"sp")){const o=b(r,"nvSpPr"),l=o?b(o,"nvPr"):null,a=l?b(l,"ph"):null;if(!a)continue;const c=G(a,"type","body"),d=G(a,"idx","0"),h=`${c}:${d}`;if(n[h])continue;const u=b(r,"spPr"),p=b(u,"xfrm");if(!p)continue;const m=b(p,"off"),g=b(p,"ext");!m||!g||(n[h]={x:C(m,"x",0),y:C(m,"y",0),w:C(g,"cx",0),h:C(g,"cy",0),txBody:b(r,"txBody")})}}return n}function ti(e,n){if(!n)return null;const t=b(e,"nvSpPr"),s=t?b(t,"nvPr"):null,i=s?b(s,"ph"):null;if(!i)return null;const r=G(i,"type","body"),o=G(i,"idx","0");return n[`${r}:${o}`]||n[`${r}:0`]||n[`body:${o}`]||null}async function un(e,n,t,s,i,r,o){const l=b(n,"graphic"),a=l?b(l,"graphicData"):null,c=a?G(a,"uri",""):"";if(b(n,"tbl")||a&&b(a,"tbl"))return Zs(e,n,t,s,i);const d=b(n,"xfrm");if(!d)return;const h=b(d,"off"),u=b(d,"ext");if(!h||!u)return;const p=C(h,"x",0)*i,m=C(h,"y",0)*i,g=C(u,"cx",0)*i,S=C(u,"cy",0)*i;if(g<=0||S<=0)return;const y=c.includes("chart"),w=c.includes("diagram");if(y&&r&&o){const _=a?b(a,"chart"):null,v=_?_.getAttribute("r:id")||_.getAttribute("id"):null,k=v?o[v]:null;if(k&&r[k.fullPath]){const j=new TextDecoder().decode(r[k.fullPath]),M=Se(j);Go(e,M,p,m,g,S,t,i);return}}if(w&&r&&o){const _=a?b(a,"relIds"):null,v=_?_.getAttribute("r:dm")||_.getAttribute("dm"):null,k=v?o[v]:null;if(k&&r[k.fullPath]){const j=new TextDecoder().decode(r[k.fullPath]),M=Se(j),F=_?_.getAttribute("r:lo")||_.getAttribute("lo"):null,R=F?o[F]:null,P=R&&r[R.fullPath]?Se(new TextDecoder().decode(r[R.fullPath])):null,{renderSmartArt:$}=await tn(async()=>{const{renderSmartArt:N}=await import("./smartart-BVm_cEaq.js");return{renderSmartArt:N}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);$(e,M,P,p,m,g,S,t,i);return}}const x=y?"📊 Chart":w?"🔷 Diagram":"⬛ Graphic";e.save(),e.fillStyle="#f4f4f8",e.strokeStyle="#ccccdd",e.lineWidth=1,e.fillRect(p,m,g,S),e.strokeRect(p,m,g,S),e.fillStyle="#999",e.font=`${Math.min(g*.07,16*i)}px sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillText(x,p+g/2,m+S/2),e.textAlign="start",e.textBaseline="alphabetic",e.restore()}async function ni(e,n,t,s,i,r,o,l,a){if(n)for(const c of n.children){const d=c.localName;try{d==="sp"?await an(e,c,t,s,i,r,o,null,l):d==="pic"?await ln(e,c,t,s,i,o):d==="grpSp"?await cn(e,c,t,s,i,r,o):d==="graphicFrame"?await un(e,c,i,r,o,a,t):d==="cxnSp"&&await dn(e,c,i,o)}catch(h){console.warn("Error rendering shape:",d,h)}}}const ea=Object.freeze(Object.defineProperty({__proto__:null,applyEffects:Qs,applyFill:Tt,applyOutline:ut,buildPlaceholderMap:ei,computeLineHeight:Ys,getDefaultFontSize:Pn,getRels:Ue,loadImages:Wt,renderBackground:Js,renderConnector:dn,renderGraphicFrame:un,renderGroupShape:cn,renderPicture:ln,renderShape:an,renderSpTree:ni,renderTable:Zs,renderTextBody:Zt,resolvePlaceholderXfrm:ti},Symbol.toStringTag,{value:"Module"}));async function ta(e){const n=new CompressionStream("deflate-raw"),t=n.writable.getWriter(),s=n.readable.getReader();t.write(e),t.close();const i=[];let r=0;for(;;){const{value:a,done:c}=await s.read();if(c)break;i.push(a),r+=a.length}const o=new Uint8Array(r);let l=0;for(const a of i)o.set(a,l),l+=a.length;return o}const na=(()=>{const e=new Uint32Array(256);for(let n=0;n<256;n++){let t=n;for(let s=0;s<8;s++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e})();function sa(e){let n=4294967295;for(let t=0;t<e.length;t++)n=na[(n^e[t])&255]^n>>>8;return(n^4294967295)>>>0}class ia{constructor(){this._chunks=[],this._size=0}append(n){this._chunks.push(n),this._size+=n.length}get size(){return this._size}concat(){const n=new Uint8Array(this._size);let t=0;for(const s of this._chunks)n.set(s,t),t+=s.length;return n}}function ye(e){return new Uint8Array([e&255,e>>8&255])}function Ie(e){return new Uint8Array([e&255,e>>8&255,e>>16&255,e>>24&255])}const si=new TextEncoder;function ra(e){return si.encode(e)}const ls=18977,cs=0;class oa{constructor(){this._entries=[]}async addText(n,t){return this.addBytes(n,si.encode(t))}async addBytes(n,t,s=!0){const i=ra(n),r=sa(t),o=t.length;let l,a;if(s&&t.length>32){const c=await ta(t);c.length<t.length?(l=c,a=8):(l=t,a=0)}else l=t,a=0;this._entries.push({name:n,nameBytes:i,compData:l,uncompSize:o,crc:r,method:a,localOffset:0})}async finalize(){const n=new ia;for(const i of this._entries)i.localOffset=n.size,n.append(new Uint8Array([80,75,3,4])),n.append(ye(20)),n.append(ye(2048)),n.append(ye(i.method)),n.append(ye(cs)),n.append(ye(ls)),n.append(Ie(i.crc)),n.append(Ie(i.compData.length)),n.append(Ie(i.uncompSize)),n.append(ye(i.nameBytes.length)),n.append(ye(0)),n.append(i.nameBytes),n.append(i.compData);const t=n.size;for(const i of this._entries)n.append(new Uint8Array([80,75,1,2])),n.append(ye(798)),n.append(ye(20)),n.append(ye(2048)),n.append(ye(i.method)),n.append(ye(cs)),n.append(ye(ls)),n.append(Ie(i.crc)),n.append(Ie(i.compData.length)),n.append(Ie(i.uncompSize)),n.append(ye(i.nameBytes.length)),n.append(ye(0)),n.append(ye(0)),n.append(ye(0)),n.append(ye(0)),n.append(Ie(0)),n.append(Ie(i.localOffset)),n.append(i.nameBytes);const s=n.size-t;return n.append(new Uint8Array([80,75,5,6])),n.append(ye(0)),n.append(ye(0)),n.append(ye(this._entries.length)),n.append(ye(this._entries.length)),n.append(Ie(s)),n.append(Ie(t)),n.append(ye(0)),n.concat()}}async function aa(e){const n=new oa;for(const[t,s]of Object.entries(e))typeof s=="string"?await n.addText(t,s):await n.addBytes(t,s);return n.finalize()}const la=new TextDecoder,ii=new TextEncoder,Ce={p:"http://schemas.openxmlformats.org/presentationml/2006/main",a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",rel:"http://schemas.openxmlformats.org/package/2006/relationships",ct:"http://schemas.openxmlformats.org/package/2006/content-types"};function wt(e){return new DOMParser().parseFromString(e,"application/xml")}function ca(e){const n=new XMLSerializer().serializeToString(e);return n.startsWith("<?xml")?n:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
30
30
  `+n}function Ee(e){return ii.encode(ca(e))}function Be(e,n){const t=e[n];return t?wt(la.decode(t)):null}function ue(e,n){if(!e)return null;const t=e.getElementsByTagName("*");for(let s=0;s<t.length;s++)if(t[s].localName===n)return t[s];return null}function Oe(e,n){if(!e)return[];const t=[],s=e.getElementsByTagName("*");for(let i=0;i<s.length;i++)s[i].localName===n&&t.push(s[i]);return t}function da(e,n,t=null){if(!e)return t;const s=e.getAttribute(n);return s!==null?s:t}function Je(e){const n=e.split("/"),t=n.pop();return[...n,"_rels",t+".rels"].join("/")}function Ze(e,n){const t=Be(e,Je(n));if(!t)return{};const s={};for(const i of Array.from(t.getElementsByTagName("Relationship"))){const r=i.getAttribute("Id"),o=i.getAttribute("Target"),l=i.getAttribute("Type")||"";let a=o;if(!o.startsWith("/")&&!o.startsWith("http")){const c=n.split("/").slice(0,-1).join("/");a=c?c+"/"+o.replace(/^\.\.\//,""):o;const d=a.split("/"),h=[];for(const u of d)u===".."?h.pop():h.push(u);a=h.join("/")}s[r]={id:r,target:o,type:l,fullPath:a}}return s}function zt(e){const n=wt('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"/>'),t=n.documentElement;for(const s of Object.values(e)){const i=n.createElementNS(Ce.rel,"Relationship");i.setAttribute("Id",s.id),i.setAttribute("Type",s.type),i.setAttribute("Target",s.target),s.targetMode&&i.setAttribute("TargetMode",s.targetMode),t.appendChild(i)}return n}function It(e){const n=Object.keys(e).map(t=>parseInt(t.replace("rId",""),10)).filter(t=>!isNaN(t));return"rId"+((n.length?Math.max(...n):0)+1)}function Kt(e,n){for(const t of e.children){const s=t.localName;if(s==="sp"||s==="pic"||s==="cxnSp"){const i=ue(t,"nvSpPr")||ue(t,"nvPicPr")||ue(t,"nvCxnSpPr"),r=i?ue(i,"cNvPr"):null;if(r&&(r.getAttribute("name")||"")===n)return t}else if(s==="grpSp"){const i=Kt(t,n);if(i)return i}}return null}function at(e){const n=ue(e,"cSld");return n?ue(n,"spTree"):null}function Lt(e,n,t,s=!0){for(const i of Oe(e,"t")){const r=i.textContent;if(!r)continue;const o=s?r.split(n).join(t):r.replace(new RegExp(ua(n),"gi"),t);o!==r&&(i.textContent=o)}}function ua(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ds={"image/jpeg":"jpeg","image/jpg":"jpeg","image/png":"png","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg"},fa={jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml"};function us(e,n,t){const s="[Content_Types].xml",i=Be(e,s);if(!i)return;const r=i.documentElement;for(const l of Oe(i,"Override"))if(l.getAttribute("PartName")==="/"+t)return;const o=i.createElementNS(Ce.ct,"Override");o.setAttribute("PartName","/"+t),o.setAttribute("ContentType",fa[n]||"application/octet-stream"),r.appendChild(o),e[s]=Ee(i)}class Jt{constructor(n){this._files=n,this._presPath="ppt/presentation.xml",this._presDoc=Be(n,this._presPath),this._presRels=Ze(n,this._presPath),this._slidePaths=this._buildSlidePaths()}static fromRenderer(n){const t={};for(const[s,i]of Object.entries(n._files))t[s]=i instanceof Uint8Array?i.slice():i;return new Jt(t)}static async fromBytes(n){const t=await qs(n);return new Jt(t)}_buildSlidePaths(){if(!this._presDoc)return[];const n=ue(this._presDoc,"sldIdLst");if(!n)return[];const t=[];for(const s of n.children){if(s.localName!=="sldId")continue;const i=s.getAttribute("r:id")||s.getAttribute("id"),r=this._presRels[i];r&&t.push(r.fullPath)}return t}_savePresDoc(){this._files[this._presPath]=Ee(this._presDoc)}_savePresRels(){this._files[Je(this._presPath)]=Ee(zt(this._presRels))}getSlidePaths(){return[...this._slidePaths]}getSlideCount(){return this._slidePaths.length}_slideDoc(n){const t=this._slidePaths[n];if(!t)throw new RangeError(`Slide ${n} out of range`);return Be(this._files,t)}_saveSlideDoc(n,t){this._files[this._slidePaths[n]]=Ee(t)}applyTemplate(n,t={}){const{open:s="{{",close:i="}}",slides:r}=t,o=r??this._slidePaths.map((l,a)=>a);for(const l of o){const a=this._slideDoc(l);for(const[c,d]of Object.entries(n)){const h=s+c+i;Lt(a,h,String(d))}this._saveSlideDoc(l,a)}for(const l of o)this._applyTemplateToNotes(l,n,s,i)}_applyTemplateToNotes(n,t,s,i){const r=Ze(this._files,this._slidePaths[n]),o=Object.values(r).find(a=>a.type?.includes("notesSlide"));if(!o)return;const l=Be(this._files,o.fullPath);if(l){for(const[a,c]of Object.entries(t))Lt(l,s+a+i,String(c));this._files[o.fullPath]=Ee(l)}}replaceText(n,t,s={}){const{caseSensitive:i=!0,includeNotes:r=!1,slides:o}=s,l=o??this._slidePaths.map((a,c)=>c);for(const a of l){const c=this._slideDoc(a);if(Lt(c,n,t,i),this._saveSlideDoc(a,c),r){const d=Ze(this._files,this._slidePaths[a]),h=Object.values(d).find(u=>u.type?.includes("notesSlide"));if(h){const u=Be(this._files,h.fullPath);u&&(Lt(u,n,t,i),this._files[h.fullPath]=Ee(u))}}}}setShapeText(n,t,s,i={}){const{preserveFormatting:r=!0}=i,o=this._slideDoc(n),l=at(o);if(!l)return this;const a=Kt(l,t);if(!a)throw new Error(`Shape "${t}" not found on slide ${n}`);const c=ue(a,"txBody");if(!c)return this;const d=ue(c,"r"),h=d?ue(d,"rPr"):null,u=ue(ue(c,"p"),"pPr");for(const g of Oe(c,"p"))g.parentNode.removeChild(g);const p=s.split(`
31
31
  `),m=Ce.a;for(const g of p){const S=o.createElementNS(m,"a:p");u&&r&&S.appendChild(u.cloneNode(!0));const y=o.createElementNS(m,"a:r");h&&r&&y.appendChild(h.cloneNode(!0));const w=o.createElementNS(m,"a:t");w.textContent=g,y.appendChild(w),S.appendChild(y),c.appendChild(S)}return this._saveSlideDoc(n,o),this}getShapeText(n,t){const s=this._slideDoc(n),i=at(s);if(!i)return"";const r=Kt(i,t);return r?Oe(r,"t").map(o=>o.textContent).join(""):""}addTextBox(n,t,s={}){const{x:i=914400,y:r=914400,w:o=4572e3,h:l=914400,color:a="000000",fontSize:c=1800,bold:d=!1,align:h="l",fontFamily:u="Calibri"}=s,p=this._slideDoc(n),m=at(p);if(!m)return this;const S=Math.max(0,...Oe(m,"cNvPr").map(k=>parseInt(k.getAttribute("id")||"0",10)))+1,y=`TextBox ${S}`,w=Ce.a,_=`<p:sp xmlns:p="${Ce.p}" xmlns:a="${w}">
32
32
  <p:nvSpPr>