@quirekit/pptx-editor 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/README.zh-CN.md +21 -0
- package/dist/ai.d.mts +24 -1
- package/dist/ai.mjs +54 -54
- package/dist/index.d.mts +8 -2
- package/dist/index.mjs +39 -35
- package/dist/open-aKqKXJ6B.mjs +2 -0
- package/dist/styles.css +98 -41
- package/dist/svg-raster-BWlVOKxM.mjs +11 -0
- package/dist/templates.d.mts +575 -0
- package/dist/templates.mjs +1 -0
- package/dist/{types-Bed8XDUh.d.mts → types-Brh5JARz.d.mts} +437 -665
- package/dist/types-DeGx0c3N.d.mts +687 -0
- package/package.json +33 -29
- package/dist/svg-raster-DL19F7ez.mjs +0 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{A as Fr,C as Nr,E as Co,F as st,I as mn,L as ye,M as gn,N as be,O as Ir,P as To,R as xe,S as Po,b as Lr,d as Rr,j as te,k as jr,n as Eo,u as Ao,w as yn,x as Dr,y as Br,z as Oo}from"./open-aKqKXJ6B.mjs";import{BUILTIN_TABLE_STYLES as zr,_internalPackageOf as Wr,addBlankSlide as Fo,addSlideChart as No,addSlideLine as qr,addSlideMedia as Gr,addSlideShape as jt,addSlideTable as Ur,addSlideTextBox as Hr,addTitleSlide as _r,cm as we,createPresentation as bn,emu as B,findShapeById as ke,findSlideByPartName as Io,findSlidePlaceholder as Lo,getCoreProperties as Vr,getCustomProperties as ht,getCustomShows as Kr,getEffectiveColorMap as Yr,getGroupChildren as Ro,getParagraphPropertiesEffective as Xr,getPresentationTheme as ee,getShape3D as Zr,getShapeAltTitle as Jr,getShapeBodyPrEffective as jo,getShapeBounds as ve,getShapeBoundsResolved as xn,getShapeDescription as Qr,getShapeEffectsEffective as Do,getShapeFillColorResolved as ta,getShapeId as j,getShapeImageCrop as ea,getShapeImagePartName as na,getShapeKind as ne,getShapeMedia as oa,getShapeMediaPlayback as ia,getShapeName as wn,getShapeParagraphCount as Me,getShapeParagraphElements as Bo,getShapePlaceholderType as zo,getShapeRotation as Wo,getShapeRunCount as kn,getShapeRunFormat as qo,getShapeRunFormatEffective as vn,getShapeRunText as Mn,getShapeStrokeCompound as sa,getShapeText as Go,getShapeTextWrap as ra,getShapeXmlString as Mt,getShapeZIndex as aa,getSlideAnimations as Uo,getSlideBackground as la,getSlideIndex as ca,getSlideLayout as Se,getSlideLayoutBackground as ua,getSlideLayoutName as Sn,getSlideLayoutPartName as $e,getSlideLayoutShapes as da,getSlideLayoutType as Ho,getSlideLayouts as ha,getSlideMasterBackground as pa,getSlideMasterPartName as _o,getSlideMasterShapes as fa,getSlideNotes as ma,getSlidePartName as X,getSlideSections as ga,getSlideShapes as nt,getSlideShowProperties as ya,getSlideSize as Pt,getSlideTransition as ba,getSlideTransitionSound as xa,getSlideXmlString as Vo,getSlides as Q,getTableCell as wa,groupShapes as Ko,importSlide as $n,isShapeHidden as Yo,isShapePlaceholder as ka,isSlideHidden as Cn,listPackageParts as va,loadPresentation as Dt,moveSlide as Ma,readPackagePart as yt,removeShape as Sa,removeSlide as $a,renameShape as pt,resolveDeckBodyTextColor as Ca,savePresentation as Bt,setCoreProperties as Ta,setCustomProperty as Et,setMediaPartBytes as Xo,setParagraphLineSpacing as Zo,setPresentationFonts as Pa,setPresentationTheme as Jo,setShapeAdjustValues as Ce,setShapeAlignment as Tn,setShapeBounds as Ea,setShapeBulletStyle as Aa,setShapeClickAction as Oa,setShapeCustomGeometry as Pn,setShapeDescription as Fa,setShapeFill as Qo,setShapeGlow as Na,setShapeGradientFill as En,setShapeImageCrop as Ia,setShapeImageFill as La,setShapeNoFill as Te,setShapeNoStroke as oe,setShapeRotation as ie,setShapeShadow as Ra,setShapeSoftEdge as ja,setShapeStroke as Pe,setShapeStrokeArrow as ti,setShapeStrokeCap as ei,setShapeStrokeDash as An,setShapeStrokeJoin as ni,setShapeStyle as Da,setShapeText as oi,setShapeTextAnchor as On,setShapeTextDirection as Ba,setShapeTextField as za,setShapeTextFormat as zt,setShapeTextMargins as se,setShapeTextWrap as Fn,setShapeZIndex as Wa,setSlideBackground as qa,setSlideBackgroundGradientFill as Ga,setSlideHidden as Ua,setSlideNotes as Ha,setSlideSections as _a,setSlideSize as Ee,setTableCellAlignment as Va,setTableCellAnchor as Ka,setTableCellBorders as Ya,setTableCellFill as Xa,setTableCellMargins as Za,setTableCellTextFormat as Ja,setTableStyleId as Qa}from"@quirekit/office-kit-pptx";import{describeCommand as tl,getCommandDescription as el}from"@quirekit/extension-authoring";import{ommlToLatex as nl}from"@quirekit/math-omml";import{renderSlideToSvg as Nn}from"@quirekit/office-kit-pptx-preview";import{parseMathLatex as ol}from"@quirekit/math";import{buildAnimationStops as il,createAnimationPlayer as ii}from"@quirekit/office-kit-pptx-editor/internal/animation-player";function Wt(t){const{run:e,...n}=t;return tl(e,n)}var si=class extends Error{constructor(t){super(t),this.name="PptxCommandRefusal"}};const ri=2.54/72,sl=["一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十"];function T(t,e,n=1){const o={display:54,title:32,subtitle:20,body:18,small:12}[e];return Math.round((t?.type[e]??o)*n)}function E(t,e,n,o=1.3){const i=e*ri,s=Math.max(1,n/i);return t.split(`
|
|
2
|
+
`).reduce((r,a)=>r+Math.max(1,Math.ceil([...a].reduce((l,c)=>l+(c.charCodeAt(0)>11904?1:.55),0)/s)),0)*i*o+i*.2}function Ae(t,e){return t.numbers==="chinese"?sl[e]??String(e+1):t.numbers==="padded"?String(e+1).padStart(2,"0"):String(e+1)}function It(t){return t.skin.card==="surface"||t.skin.depth==="glass"?"text":t.ink}function re(t,e){const{skin:n}=t,o=n.depth==="glass"||n.card==="surface"?"surface":n.card==="tint"?t.emphasis:null,i=n.depth==="outline"||n.depth==="glow"||n.depth==="glass";return o===null&&!i?[]:[{kind:"shape",role:"decoration",shape:n.radius==="none"?"rect":"roundRect",radius:n.radius==="large"?.14:.06,...e,fill:o,...n.card==="tint"&&n.depth!=="glass"?{opacity:.1}:n.depth==="glass"?{opacity:.55}:{},...i?{line:n.depth==="glow"?t.emphasis:"muted",lineWidth:n.depth==="glow"?1.25:.75}:{},...n.depth==="shadow"?{shadow:"soft"}:n.depth==="lifted"?{shadow:"lifted"}:{},...n.depth==="glow"?{glow:{color:t.emphasis,size:6}}:{}}]}function In(t,e,n,o){const i={circle:"ellipse",rounded:"roundRect",square:"rect",diamond:"diamond",ring:"ellipse",seal:"roundRect"}[t.skin.badge],s=t.skin.badge==="ring",r=s?t.emphasis:t.onEmphasis,a={kind:"shape",role:"decoration",shape:i,radius:t.skin.badge==="seal"?.08:.25,...e,fill:s?null:t.emphasis,...s?{line:t.emphasis,lineWidth:1.75}:{}},l=e.w*(t.skin.badge==="diamond"?.3:.22);if(o&&o.length)return[a,{kind:"icon",role:"decoration",icon:"",x:e.x+l,y:e.y+l,w:e.w-l*2,h:e.h-l*2,color:r,paths:o}];const c=Math.max(8,Math.round(e.h/ri*(n&&n.length>2?.32:.42)));return[a,{kind:"text",role:"number",x:e.x,y:e.y,w:e.w,h:e.h,text:n??"",size:c,color:r,align:"center",anchor:"middle",bold:!0}]}function A(t,e,n,o,i,s={}){return{kind:"text",role:t,...e,text:n,size:o,color:i,...s}}const Ln=.6;function ai(t,e){const n=t.w<t.h?1:e<=4?e:Math.ceil(e/2),o=Math.ceil(e/n),i=Ln,s=(t.w-i*(n-1))/n,r=(t.h-i*(o-1))/o;return Array.from({length:e},(a,l)=>({x:t.x+l%n*(s+i),y:t.y+Math.floor(l/n)*(r+i),w:s,h:r}))}function rl(t){return{...t,ink:t.onEmphasis,emphasis:t.onEmphasis,onEmphasis:t.emphasis}}function qt(t,e,n,o,i,s){const{design:r,skin:a}=t,l=n.highlight===!0,c=i==="rule",u=i==="lead",d=!c&&(l||a.card!=="none"||a.depth!=="flat"),h=c?[{kind:"line",role:"decoration",x1:e.x,y1:e.y,x2:e.x+Math.min(e.w,l?e.w:2.4),y2:e.y,color:l?t.emphasis:"muted",width:l?3:1.5}]:l?al(t,e):re(t,e),f=l&&!c?rl(t):t,p=l&&!c?t.onEmphasis:It(t),m=d?Math.min(.7,e.w*.08):0,g=c?.45:m,y={x:e.x+m,y:e.y+g,w:e.w-m*2,h:e.h-g-m},b=[],x=Math.min(1.8,y.w*.22,y.h*.3);let w=y.x,k=y.y,v=y.w;if(i==="number"||c||u&&n.value){const G=n.value??Ae(a,o),I=u?Math.min(T(r,"display",1.5),Math.floor(v/Math.max(2,[...G].length*.6)/.0353)):T(r,"display",c?.55:.75),K=E("00",I,v,1.05);b.push(A("number",{x:w,y:k,w:v,h:K},G,I,f.emphasis,{bold:!0})),k+=K+.15}else i!=="plain"&&!u&&(b.push(...In(f,{x:w,y:k,w:x,h:x},Ae(a,o),n.paths)),i==="icon-left"?(w+=x+.5,v-=x+.5):k+=x+.45);let M=s?.head??(u?T(r,"title"):T(r,"subtitle",1.3)),$=s?.body??T(r,"body",u?1.2:1.1);const N=y.y+y.h-k;for(let G=0;!s&&G<8&&E(n.title??"",M,v)+(n.text?E(n.text,$,v,1.4)+.2:0)>N;G++)M=Math.max(12,M-2),$=Math.max(10,$-2);const U=l&&c?t.emphasis:p;if(n.title){const G=E(n.title,M,v);b.push(A("subtitle",{x:w,y:k,w:v,h:G},n.title,M,U,{bold:!0})),k+=Math.max(G,s?.title??0)+.2}const J=b.length;if(n.text&&b.push(A("body",{x:w,y:k,w:v,h:Math.max(.6,Math.min(E(n.text,$,v,1.4),y.y+y.h-k))},n.text,$,p,{lineSpacing:1.3})),!u)return{back:h,front:b,sizes:{head:M,body:$,title:n.title?E(n.title,M,v):0}};const lt=n.title?J-1:J,gt=y.y+y.h-li(b.slice(lt));return{back:h,front:gt>0?b.map((G,I)=>I>=lt&&"y"in G?{...G,y:G.y+gt}:G):b,sizes:{head:M,body:$}}}function al(t,e){const[n]=re({...t,skin:{...t.skin,card:"surface",depth:t.skin.depth==="glass"||t.skin.depth==="outline"||t.skin.depth==="glow"?"flat":t.skin.depth}},e);return n&&n.kind==="shape"?[{...n,fill:t.emphasis}]:[]}function li(t){return Math.max(0,...t.map(e=>"y2"in e?Math.max(e.y1,e.y2):"h"in e?e.y+e.h:0))}const ll=[{name:"cards",label:"卡片组",needs:["items"],items:[1,8],summary:"a row or grid of equal cards, one per item, each with a badge (the item's icon, or its number), heading and text, in the deck's card style",usage:"并列的要点、原因、做法、产品特性。一行最多四张,五张以上自动排两行;框高时排成一列。icon-left 适合文字多的卡片,number 用大数字代替徽章,rule 不画卡片底、只在顶上画一条细线,适合克制的商务和编辑风。确有主次时给最重要的一项写 highlight: true,它会填满强调色;三项以上才用,一组最多一项。",variants:[["icon-top","徽章在上"],["icon-left","徽章在左"],["number","大号编号或数值代替徽章"],["plain","只有标题和文字"],["rule","无卡片底,顶部细线加编号"]],build:(t,e,n,o)=>{const i=n.items??[],s=ai(e,i.length),r=o!=="rule"&&(i.some(y=>y.highlight)||t.skin.card!=="none"||t.skin.depth!=="flat")?Math.min(.7,(s[0]?.w??0)*.08):0,a=s.map((y,b)=>qt(t,y,i[b],b,o).sizes),l={head:Math.min(...a.map(y=>y.head)),body:Math.min(...a.map(y=>y.body))},c={...l,title:Math.max(...s.map((y,b)=>qt(t,y,i[b],b,o,l).sizes.title??0))},u=Math.max(...s.map((y,b)=>li(qt(t,y,i[b],b,o,c).front)-y.y+r)),d=new Set(s.map(y=>y.y)).size,h=s[0],f=s.find(y=>y.y>h.y),p=f?f.y-h.y-h.h:0,m=Math.min(h.h,u),g=Math.max(0,(e.h-d*m-(d-1)*p)/2);return s.map(y=>({...y,y:e.y+g+(y.y-e.y)/(h.h+p)*(m+p),h:m})).flatMap((y,b)=>{const x=qt(t,y,i[b],b,o,c);return[...x.back,...x.front]})}},{name:"stats",label:"指标组",needs:["items"],items:[1,4],summary:"key figures side by side: each item's value set very large in the primary colour, its title as the label and its text as a note; row divides them with rules, cards puts each in a card",usage:"汇报的核心数字、发布会的参数。value 写数字和单位(如 63%、128 万),title 写它是什么,text 写比较或来源。一页不超过四个。",variants:[["row","细线分隔的一排"],["cards","每个指标一张卡片"]],build:(t,e,n,o)=>{const i=n.items??[],s=[],r=(o==="cards"?1.2:0)+Math.max(...i.map(c=>E(c.value??"",T(t.design,"display",1.2),e.w/i.length,1.05)+(c.title?E(c.title,T(t.design,"subtitle"),e.w/i.length)+.1:0)+(c.text?E(c.text,T(t.design,"small"),e.w/i.length)+.1:0))),a={...e,h:Math.min(e.h,r)},l=Ln;return ai(a,i.length).forEach((c,u)=>{const d=i[u],h=o==="cards";h&&s.push(...re(t,c));const f=h?It(t):t.ink,p=h?.6:0,m=c.w-p*2,g=d.value??"",y=Math.min(T(t.design,"display",1.2),Math.floor(m/Math.max(2,[...g].length*.6)/.0353));let b=c.y+p;const x=E(g,y,m,1.05);if(s.push(A("number",{x:c.x+p,y:b,w:m,h:x},g,y,t.emphasis,{bold:!0})),b+=x+.1,d.title){const w=E(d.title,T(t.design,"subtitle"),m);s.push(A("subtitle",{x:c.x+p,y:b,w:m,h:w},d.title,T(t.design,"subtitle"),f,{bold:!0})),b+=w+.1}d.text&&s.push(A("label",{x:c.x+p,y:b,w:m,h:E(d.text,T(t.design,"small"),m)},d.text,T(t.design,"small"),f)),!h&&u>0&&s.push({kind:"line",role:"decoration",x1:c.x-l/2,y1:c.y,x2:c.x-l/2,y2:c.y+c.h,color:"muted",width:.75})}),s}}],cl=[{name:"steps",label:"步骤",needs:["items"],items:[2,6],summary:"numbered steps joined by a line: each item a badge (its icon or number) with heading and text; vertical stacks them top to bottom",usage:"流程、做法、操作顺序。横向适合三到五步,竖向适合文字多或步骤多的时候。",variants:[["horizontal","横向一排"],["vertical","竖向一列"]],build:(t,e,n,o)=>{const i=n.items??[],s=[],r=o==="vertical",a=i.length,l=Math.min(1.8,r?e.h/a*.6:e.w/a*.3),c=T(t.design,"subtitle",1.2),u=T(t.design,"body"),d=p=>r?{x:e.x,y:e.y+p*e.h/a}:{x:e.x+p*e.w/a,y:e.y},h=d(0),f=d(a-1);return s.push({kind:"line",role:"decoration",x1:h.x+l/2,y1:h.y+l/2,x2:f.x+l/2,y2:f.y+l/2,color:t.emphasis,width:1.5,dash:"dash"}),i.forEach((p,m)=>{const{x:g,y}=d(m);s.push(...In(t,{x:g,y,w:l,h:l},Ae(t.skin,m),p.paths));const b=r?g+l+.5:g,x=r?y:y+l+.4,w=r?e.w-l-.5:e.w/a-.5,k=p.title?E(p.title,c,w):0;p.title&&s.push(A("subtitle",{x:b,y:x,w,h:k},p.title,c,t.ink,{bold:!0})),p.text&&s.push(A("body",{x:b,y:x+k+.15,w,h:E(p.text,u,w,1.4)},p.text,u,t.ink,{lineSpacing:1.3}))}),s}},{name:"timeline",label:"时间轴",needs:["items"],items:[2,7],summary:"a horizontal timeline: a line with a node per item, its label (a date or year) above in the primary colour and its heading and text below",usage:"历程、里程碑、计划节点。label 写年份或日期,title 写事件,text 一句说明。",variants:[["line","直线加节点"]],build:(t,e,n)=>{const o=n.items??[],i=[],s=o.length,r=e.w/s,a=T(t.design,"subtitle",1.5),l=T(t.design,"subtitle"),c=T(t.design,"body",.85),u=e.y+Math.min(e.h*.35,a*.0353*1.6+.4);return i.push({kind:"line",role:"decoration",x1:e.x,y1:u,x2:e.x+e.w,y2:u,color:t.emphasis,width:2}),o.forEach((d,h)=>{const f=e.x+r*h,p=r-.4,m=.22;i.push({kind:"shape",role:"decoration",shape:"ellipse",x:f,y:u-m,w:m*2,h:m*2,fill:t.emphasis,line:"background",lineWidth:2}),d.label&&i.push(A("number",{x:f,y:u-.3-E(d.label,a,p,1.1),w:p,h:E(d.label,a,p,1.1)},d.label,a,t.emphasis,{bold:!0}));let g=u+.5;if(d.title){const y=E(d.title,l,p);i.push(A("subtitle",{x:f,y:g,w:p,h:y},d.title,l,t.ink,{bold:!0})),g+=y+.1}d.text&&i.push(A("body",{x:f,y:g,w:p,h:E(d.text,c,p,1.4)},d.text,c,t.ink,{lineSpacing:1.3}))}),i}},{name:"agenda",label:"目录",needs:["items"],items:[2,10],summary:"a table of contents: each item's number set large in the primary colour beside its title and an optional line of text; more than five items run in two columns",usage:"目录页。title 写章节名,text 可写一句说明;编号写法跟设计语言。",variants:[["list","编号加标题的列表"]],build:(t,e,n)=>{const o=n.items??[],i=o.length>5?2:1,s=Math.ceil(o.length/i),r=[],a=(e.w-(i-1)*1.2)/i,l=e.h/s,c=Math.min(T(t.design,"title",1.3),Math.floor(l*.7/.0353)),u=Math.min(T(t.design,"subtitle"),Math.floor(l*.45/.0353));return o.forEach((d,h)=>{const f=e.x+Math.floor(h/s)*(a+1.2),p=e.y+h%s*l,m=c*.0353*1.6;r.push(A("number",{x:f,y:p,w:m,h:l*.9},Ae(t.skin,h),c,t.emphasis,{bold:!0,anchor:"middle"})),r.push(A("subtitle",{x:f+m+.3,y:p,w:a-m-.3,h:d.text?l*.5:l*.9},d.title??"",u,t.ink,{bold:!0,anchor:d.text?"bottom":"middle"})),d.text&&r.push(A("label",{x:f+m+.3,y:p+l*.5,w:a-m-.3,h:l*.4},d.text,T(t.design,"small"),t.ink))}),r}},{name:"comparison",label:"对比栏",needs:["sides","items"],items:[1,6],summary:"two cards side by side under the two headings of sides, each item a row comparing its title (left) with its text (right), a VS badge between them",usage:"前后对比、新旧对比、正误对比。sides 写两栏标题,每个 item 的 title 是左栏一行、text 是右栏同一行。",variants:[["cards","两张卡片"]],build:(t,e,n)=>{const o=n.items??[],i=[],s=(e.w-2)/2;let r={...e,w:s},a={...e,x:e.x+s+2,w:s};const l=T(t.design,"subtitle",1.1),c=T(t.design,"body"),u=It(t),d=1.4+E(n.sides?.[0]??"",l,s-1.4)+.4+Math.max(...["title","text"].map(f=>o.reduce((p,m)=>p+E(m[f]??"",c,s-1.4,1.4)+.3,0)));r={...r,h:Math.min(e.h,d)},a={...a,h:Math.min(e.h,d)};for(const[f,p,m]of[[r,n.sides?.[0]??"","title"],[a,n.sides?.[1]??"","text"]]){i.push(...re(t,f));const g=.7,y=f.w-g*2;let b=f.y+g;const x=E(p,l,y);i.push(A("subtitle",{x:f.x+g,y:b,w:y,h:x},p,l,m==="text"?t.emphasis:u,{bold:!0})),b+=x+.4;for(const w of o){const k=w[m]??"",v=E(k,c,y,1.4);i.push(A("body",{x:f.x+g,y:b,w:y,h:v},k,c,u,{lineSpacing:1.3})),b+=v+.3}}const h=1.3;return i.push(...In(t,{x:e.x+e.w/2-h/2,y:r.y+r.h/2-h/2,w:h,h},"VS")),i}}],ul=.5;function Rn(t){return t.skin.card==="none"&&t.skin.depth==="flat"?{...t,skin:{...t.skin,card:"tint"}}:t}const dl=t=>t.value?"number":t.icon?"icon-left":"plain";function hl(t,e,n){const o=Ln,i=(t.w-o)*ul,s=t.w-o-i,r={x:n==="left"?t.x:t.x+s+o,y:t.y,w:i,h:t.h},a=n==="left"?t.x+i+o:t.x,l=e-1,c=l===4?2:1,u=Math.ceil(l/c),d=(s-o*(c-1))/c,h=(t.h-o*(u-1))/u;return[r,...Array.from({length:l},(f,p)=>({x:a+p%c*(d+o),y:t.y+Math.floor(p/c)*(h+o),w:d,h}))]}const pl=[{name:"bento",label:"主次格子",needs:["items"],items:[3,5],summary:"one large block and two to four smaller ones beside it, like a bento box: the first item is the large block, at about half the width and the full height, in the emphasis colour; the others stack beside it, two by two when there are four",usage:"一个核心加几个支撑点:核心产品与配套、主结论与依据、主打功能与次要功能。第一个条目是大块,写最重要的结论或数字(value 会画成大数字);其余 2–4 个是小块。框给满内容区最好看。left/right 决定大块在哪边。",variants:[["left","大块在左"],["right","大块在右"]],build:(t,e,n,o)=>{const i=n.items??[],s=Rn(t),r=hl(e,i.length,o==="right"?"right":"left"),a=i.some(l=>l.highlight)?-1:0;return r.flatMap((l,c)=>{const u=c===a?{...i[c],highlight:!0}:i[c],d=qt(s,l,u,c,c===0?"lead":dl(u));return[...d.back,...d.front]})}},{name:"matrix",label:"四象限矩阵",needs:["items"],items:[4,4],summary:"a two-by-two matrix: the four items fill the top left, top right, bottom left and bottom right quadrants; sides labels the horizontal axis from low to high and axes the vertical one, drawing the axes along the matrix",usage:"两个维度把对象分成四类:重要/紧急、投入/回报、SWOT。条目按左上、右上、左下、右下的顺序写;有坐标含义时 sides 写横轴从低到高,axes 写竖轴从低到高。要突出的象限写 highlight: true。",variants:[["quadrants","四个象限"]],build:(t,e,n)=>{const o=n.items??[],i=[],s=Rn(t),r=T(t.design,"body",.9),a=n.axes?Math.min(3,e.w*.14):0,l=n.sides?E("轴",r,e.w)+.3:0,c={x:e.x+a,y:e.y,w:e.w-a,h:e.h-l},u=.3,d=(c.w-u)/2,h=(c.h-u)/2;o.forEach((p,m)=>{const g=qt(s,{x:c.x+m%2*(d+u),y:c.y+Math.floor(m/2)*(h+u),w:d,h},p,m,p.icon?"icon-left":"plain");i.push(...g.back,...g.front)});const f={kind:"line",role:"decoration",color:"muted",width:1.25,arrow:"end"};if(n.sides){const p=c.y+c.h+.1;i.push({...f,x1:c.x,y1:p,x2:c.x+c.w,y2:p}),i.push(A("label",{x:c.x,y:p+.05,w:c.w/2,h:l-.2},n.sides[0],r,It(t))),i.push(A("label",{x:c.x+c.w/2,y:p+.05,w:c.w/2,h:l-.2},n.sides[1],r,It(t),{align:"right"}))}if(n.axes){const p=c.x-.15;i.push({...f,x1:p,y1:c.y+c.h,x2:p,y2:c.y}),i.push(A("label",{x:e.x,y:c.y+c.h-1.2,w:a-.3,h:1.2},n.axes[0],r,It(t),{align:"right",anchor:"bottom"})),i.push(A("label",{x:e.x,y:c.y,w:a-.3,h:1.2},n.axes[1],r,It(t),{align:"right"}))}return i}}];function fl(t,e){return re(Rn(t),e)}const Oe=.18,ml=(t,e)=>t<2?1:1-e/(t-1)*.6,gl=[{name:"pyramid",label:"层级",needs:["items"],items:[3,6],summary:"stacked layers that narrow upwards (pyramid) or downwards (funnel), each item's title inside its layer and its text beside it on the right, the top layer in the strongest colour",usage:"层次、优先级、转化漏斗。条目从上往下写:金字塔第一个是塔尖(最重要、最少),漏斗第一个是入口(最多)。title 写层名,短;text 写说明或数字,放在右侧。框宽一点,右侧说明才有地方。",variants:[["pyramid","金字塔,越往上越窄"],["funnel","漏斗,越往下越窄"]],build:(t,e,n,o)=>{const i=n.items??[],s=[],r=i.length,a=i.some(d=>d.text)?e.w*.55:e.w,l=(e.h-Oe*(r-1))/r,c=Math.min(T(t.design,"subtitle"),Math.floor(l/.0353*.45)),u=T(t.design,"body");return i.forEach((d,h)=>{const f=a*(.3+.7*((o==="funnel"?r-1-h:h)+1)/r),p=e.x+(a-f)/2,m=e.y+h*(l+Oe),g=ml(r,h),y=g>=.7||d.highlight===!0;if(s.push({kind:"shape",role:"decoration",shape:t.skin.radius==="none"?"rect":"roundRect",radius:.12,x:p,y:m,w:f,h:l,fill:t.emphasis,...d.highlight?{}:{opacity:g}}),s.push(A("subtitle",{x:p,y:m,w:f,h:l},d.title??"",c,y?t.onEmphasis:t.ink,{bold:!0,align:"center",anchor:"middle"})),d.text){const b=e.x+a+.8,x=e.x+e.w-b;s.push({kind:"line",role:"decoration",x1:p+f+.2,y1:m+l/2,x2:b-.2,y2:m+l/2,color:"muted",width:.75,dash:"dot"}),s.push(A("body",{x:b,y:m,w:x,h:l},d.text,Math.min(u,Math.floor(l/.0353*.4)),t.ink,{anchor:"middle"}))}}),s}},{name:"layers",label:"分层架构",needs:["items"],items:[2,6],summary:"an architecture of horizontal tiers from top to bottom: each item's title names its tier in a coloured label on the left, and its parts sit as modules across the rest of the tier (its text when it has no parts)",usage:"技术架构、业务分层、组织体系。条目从上往下写,title 是层名(应用层、平台层……),parts 列出这一层的模块,每层 2–6 个,名称要短;没有模块时写 text。要突出的层写 highlight: true。",variants:[["tiers","横向分层"]],build:(t,e,n)=>{const o=n.items??[],i=[],s=(e.h-Oe*(o.length-1))/o.length,r=Math.min(5,e.w*.2),a=T(t.design,"body"),l=Math.min(T(t.design,"subtitle"),Math.floor(s/.0353*.4));return o.forEach((c,u)=>{const d=e.y+u*(s+Oe),h={x:e.x+r+.3,y:d,w:e.w-r-.3,h:s};i.push({kind:"shape",role:"decoration",shape:t.skin.radius==="none"?"rect":"roundRect",radius:.12,x:e.x,y:d,w:r,h:s,fill:t.emphasis,...c.highlight?{}:{opacity:.9}}),i.push(A("subtitle",{x:e.x,y:d,w:r,h:s},c.title??"",l,t.onEmphasis,{bold:!0,align:"center",anchor:"middle"})),i.push(...fl(t,h));const f=c.parts??[];if(f.length===0){i.push(A("body",{x:h.x+.5,y:d,w:h.w-1,h:s},c.text??"",a,t.ink,{anchor:"middle"}));return}const p=Math.min(.35,s*.15),m=.25,g=(h.w-p*2-m*(f.length-1))/f.length,y=s-p*2,b=Math.min(a,Math.floor(y/.0353*.42),...f.map(x=>Math.floor(g/Math.max(2,[...x].length+1)/.0353)));f.forEach((x,w)=>{i.push({kind:"text",role:"label",x:h.x+p+w*(g+m),y:d+p,w:g,h:y,text:x,size:Math.max(9,b),color:c.highlight?t.onEmphasis:t.ink,align:"center",anchor:"middle",fill:c.highlight?t.emphasis:"background"})})}),i}}];function ci(t,e,n){return[{kind:"shape",role:"decoration",shape:t.skin.radius==="none"?"rect":"roundRect",radius:.04,...e,fill:"surface",line:"muted",lineWidth:.75,shadow:"lifted"},{kind:"line",role:"decoration",x1:e.x,y1:e.y+n,x2:e.x+e.w,y2:e.y+n,color:"muted",width:.75},...[0,1,2].map(o=>({kind:"shape",role:"decoration",shape:"ellipse",x:e.x+.4+o*.45,y:e.y+n/2-.13,w:.26,h:.26,fill:o===0?"accent":"muted",opacity:o===0?1:.5}))]}const yl=[{name:"mock-email",label:"模拟邮件",needs:["title","text"],summary:"a mocked-up email: from in the header, title as the subject, text as the body, and subtitle, when given, as a button in the accent colour",usage:"钓鱼邮件识别、通知公告、客户来信。from 写发件人地址,title 写主题,text 写正文,subtitle 写按钮文字(如“立即验证”)。",variants:[["window","邮件窗口"]],build:(t,e,n)=>{const o=T(t.design,"small"),i=T(t.design,"body",.85),s=T(t.design,"subtitle"),r=.9,a=.6,l=e.w-a*2,c=ci(t,e,r);let u=e.y+r+.35;n.from&&(c.push(A("label",{x:e.x+a,y:u,w:l,h:E(n.from,o,l)},`发件人:${n.from}`,o,"muted")),u+=E(n.from,o,l)+.15);const d=E(n.title??"",s,l);c.push(A("subtitle",{x:e.x+a,y:u,w:l,h:d},n.title??"",s,"text",{bold:!0})),u+=d+.3;const h=Math.min(E(n.text??"",i,l,1.4),e.y+e.h-u-(n.subtitle?1.6:.4));if(c.push(A("body",{x:e.x+a,y:u,w:l,h:Math.max(.6,h)},n.text??"",i,"text",{lineSpacing:1.35})),n.subtitle){const f=Math.min(l,[...n.subtitle].length*o*.0353+1.4);c.push({kind:"shape",role:"body",shape:t.skin.radius==="none"?"rect":"roundRect",radius:.2,x:e.x+a,y:e.y+e.h-1.3,w:f,h:.85,fill:"accent",text:n.subtitle,size:o,color:t.onEmphasis,align:"center",anchor:"middle",bold:!0,padding:.1})}return c}},{name:"mock-phone",label:"模拟手机聊天",needs:["items"],items:[1,8],summary:"a phone with a chat on its screen: title as the contact's name, each item a message bubble from its title (the sender) with its text; a sender of 我 sits on the right in the primary colour",usage:"群聊截图、客服对话、诈骗话术还原。每个 item 的 title 写发送者(“我”在右侧),text 写消息。手机框按 9:19 左右的比例放。",variants:[["chat","聊天界面"]],build:(t,e,n)=>{const o=T(t.design,"small",1.05),i=T(t.design,"small",.85),s=[],r=Math.min(e.w,e.h)*.045,a={x:e.x+r,y:e.y+r*2.2,w:e.w-r*2,h:e.h-r*3.4};s.push({kind:"shape",role:"decoration",shape:"roundRect",radius:.16,...e,fill:"dark",shadow:"lifted"}),s.push({kind:"shape",role:"decoration",shape:"roundRect",radius:.08,...a,fill:"surface"}),s.push({kind:"shape",role:"decoration",shape:"roundRect",radius:.5,x:e.x+e.w/2-e.w*.15,y:e.y+r*.7,w:e.w*.3,h:r*.9,fill:t.onEmphasis,opacity:.25});let l=a.y+.3;n.title&&(s.push(A("label",{x:a.x,y:l,w:a.w,h:.6},n.title,i,"text",{align:"center",bold:!0})),l+=.9,s.push({kind:"line",role:"decoration",x1:a.x,y1:l-.2,x2:a.x+a.w,y2:l-.2,color:"muted",width:.5}));for(const c of n.items??[]){const u=c.title==="我",d=a.w*.72,h=E(c.text??"",o,d-.6,1.3);if(l+h+.9>a.y+a.h)break;const f=u?a.x+a.w-d-.3:a.x+.3;!u&&c.title&&(s.push(A("label",{x:f,y:l,w:d,h:.45},c.title,i,"muted")),l+=.45),s.push({kind:"shape",role:"body",shape:"roundRect",radius:.25,x:f,y:l,w:d,h:h+.4,fill:u?t.emphasis:"background",...u?{}:{line:"muted",lineWidth:.5},text:c.text??"",size:o,color:u?t.onEmphasis:"text",padding:.2,lineSpacing:1.2}),l+=h+.7}return s}},{name:"mock-browser",label:"模拟网页",needs:["title"],summary:"a browser window: subtitle as the address in the address bar, title as the page heading and text as its body",usage:"产品界面、网站、后台系统的示意。subtitle 写网址,title 写页面标题,text 写页面要点。",variants:[["window","浏览器窗口"]],build:(t,e,n)=>{const o=T(t.design,"small"),i=T(t.design,"title",.8),s=T(t.design,"body",.85),r=1,a=.8,l=e.w-a*2,c=ci(t,e,r);n.subtitle&&c.push({kind:"shape",role:"label",shape:"roundRect",radius:.5,x:e.x+1.9,y:e.y+.2,w:e.w-2.4,h:r-.4,fill:"background",text:n.subtitle,size:o,color:"muted",anchor:"middle",padding:.15});let u=e.y+r+.6;const d=E(n.title??"",i,l);return c.push(A("subtitle",{x:e.x+a,y:u,w:l,h:d},n.title??"",i,"text",{bold:!0})),u+=d+.3,n.text&&c.push(A("body",{x:e.x+a,y:u,w:l,h:Math.max(.6,Math.min(E(n.text,s,l,1.4),e.y+e.h-u-.4))},n.text,s,"text",{lineSpacing:1.35})),c}}],Fe=[{name:"title-group",label:"标题组",needs:["title"],summary:"a cover or section title group stacked in its frame: eyebrow, title lines (a line holding accent in the primary colour), subtitle and byline in the deck's byline style",usage:"封面、章节、结尾的标题组。标题换行写在 title 里,accent 写要换主色的那一行或词所在的行;byline 写汇报人、单位、日期。",variants:[["left","左对齐"],["center","居中"]],build:(t,e,n,o)=>{const{design:i,skin:s,ink:r}=t,a=o==="center"?"center":"left",l=[],c=T(i,"display"),u=T(i,"subtitle"),d=T(i,"small");let h=e.y;n.eyebrow&&(l.push(A("eyebrow",{x:e.x,y:h,w:e.w,h:E(n.eyebrow,d,e.w)},n.eyebrow,d,t.emphasis,{align:a})),h+=E(n.eyebrow,d,e.w)+.3);for(const f of(n.title??"").split(`
|
|
3
|
+
`)){const p=E(f,c,e.w,1.15);l.push(A("title",{x:e.x,y:h,w:e.w,h:p},f,c,n.accent&&f.includes(n.accent)?t.emphasis:r,{align:a,bold:!0,lineSpacing:1.05})),h+=p}if(n.subtitle){h+=.3;const f=E(n.subtitle,u,e.w);l.push(A("subtitle",{x:e.x,y:h,w:e.w,h:f},n.subtitle,u,r,{align:a})),h+=f}if(n.byline){h+=.6;const f=E(n.byline,d,e.w),p=Math.min(e.w,[...n.byline].length*d*.0353*.95+1.2),m=a==="center"?e.x+(e.w-p)/2:e.x;s.byline==="pill"?l.push({kind:"shape",role:"decoration",shape:"roundRect",radius:.5,x:m,y:h-.15,w:p,h:f+.3,fill:t.emphasis},A("label",{x:m,y:h-.15,w:p,h:f+.3},n.byline,d,t.onEmphasis,{align:"center",anchor:"middle"})):(s.byline==="rule"&&l.push({kind:"line",role:"decoration",x1:m,y1:h-.25,x2:m+1.6,y2:h-.25,color:t.emphasis,width:2}),l.push(A("label",{x:e.x,y:h,w:e.w,h:f},n.byline,d,r,{align:a})))}return l}},{name:"header",label:"内容页标题区",needs:["title"],summary:"the title area of a content page in the deck's header style (plain, a full-width band or a chip), with an optional eyebrow; the frame is the area's width and height",usage:"内容页的标题区,同一套稿件每页用它,标题位置和样子就天然一致。band 样式的框通常从页面左上角铺满整宽。",variants:[["deck","按设计语言的页眉样式"]],build:(t,e,n)=>{const{design:o,skin:i,ink:s}=t,r=T(o,"title"),a=T(o,"small"),l=[],c=i.header==="band"?Math.min(1.6,o?.margin??1.6):0,u=i.header==="band"?t.onEmphasis:s;i.header==="band"&&l.push({kind:"shape",role:"decoration",shape:"rect",...e,fill:t.emphasis});let d=e.x+c,h=e.y+(i.header==="band"?(e.h-E(n.title??"",r,e.w-c*2))/2-(n.eyebrow?.4:0):0);if(i.header==="chip"){const f=r*.0353*.7;l.push({kind:"shape",role:"decoration",shape:i.radius==="none"?"rect":"roundRect",radius:.2,x:d,y:h+(n.eyebrow?E(n.eyebrow,a,e.w)+.2:0)+f*.35,w:f,h:f,fill:t.emphasis}),d+=f*1.7}if(n.eyebrow){const f=E(n.eyebrow,a,e.w);l.push(A("eyebrow",{x:d,y:h,w:e.w-(d-e.x)-c,h:f},n.eyebrow,a,i.header==="band"?t.onEmphasis:t.emphasis)),h+=f+.2}return l.push(A("title",{x:d,y:h,w:e.w-(d-e.x)-c,h:E(n.title??"",r,e.w-c*2)},n.title??"",r,u,{bold:!0})),l}},{name:"quote",label:"引言块",needs:["text"],summary:"a quotation set large with an oversized opening quote mark in the primary colour and the source beneath",usage:"名言、用户原话、政策原文的引用页;一页一句,字大,出处写在 from。",variants:[["left","左对齐"],["center","居中"]],build:(t,e,n,o)=>{const{design:i,ink:s}=t,r=T(i,"subtitle",1.5),a=T(i,"small"),l=T(i,"display",2),c=o==="center"?"center":"left",u=l*.0353*.8,d=E(n.text??"",r,e.w,1.4);return[A("decoration",{x:e.x,y:e.y-u*.15,w:e.w,h:u},"“",l,t.emphasis,{align:c,font:"heading",bold:!0}),A("quote",{x:e.x,y:e.y+u*.75,w:e.w,h:d},n.text??"",r,s,{align:c,lineSpacing:1.4}),...n.from?[A("label",{x:e.x,y:e.y+u*.75+d+.4,w:e.w,h:E(n.from,a,e.w)},`—— ${n.from}`,a,s,{align:c})]:[]]}},...ll,...pl,...gl,...cl,...yl];function ui(t){return t===void 0?void 0:Fe.find(e=>e.name===t)}const bl=[{key:"soft-3d",name:"柔光 3D 物件",idea:"一两个磨砂质感的 3D 小物在柔光里点题,页面轻、干净、有空气感。",moods:["轻盈","现代","友好","清爽"],hero:{kinds:["3d-object"],vector:"没有图片时用渐变圆、圆环(donut)和圆角方块拼一组“物件”:径向渐变做出球体高光,soft 投影让它落在页面上,半透明白色圆角面板做玻璃。",picture:"3D 渲染物件,磨砂或半透明玻璃材质,柔和渐变,柔光漫射,浅色背景,等距或轻俯视角,主题相关的小物"},dimensions:{color:"渐变光感:主色从浅到中的渐变,配一个同色系或邻近色的高光色。",surface:"浅色渐变或白底,大圆角卡片浮在背景上。",depth:"层叠投影或玻璃:卡片带柔和投影,半透明面板压在渐变上。",composition:"物件占一侧的分屏、物件居中被卡片环绕、便当盒网格。",type:"粗黑体标题,常规正文。"},tokens:{cover:"light",content:"light",primary:"mid",heading:["PingFang SC","Avenir Next"],body:["PingFang SC"],scale:[2.5,5],radius:"large",effects:["shadow","gradient","glass"]},elements:["渐变球","圆环","玻璃面板","柔光斑","胶囊标签"],motifs:["glow","rings","organic-blobs"],skin:{radius:"large",depth:"shadow",card:"surface",badge:"rounded",header:"chip",byline:"pill",numbers:"padded"},components:{titleGroup:"日期眉标、两行粗标题(关键词换主色)、一个主色胶囊写落款。",card:"大圆角白卡片或半透明玻璃卡片,soft 投影。",badge:"渐变圆里的白色图标。",header:"左上标题,右上一个缩小的物件。"},pages:{cover:"大圆角卡片浮在渐变底上,卡片里一侧标题、一侧物件。",section:"渐变底上巨大编号,旁边一个物件。",content:"便当盒网格:大小不一的卡片,各放图标或数字。",data:"白卡片里的图表,渐变色柱子。",closing:"物件居中,一句话。"},taboos:["深色压抑的底","物件比例与风格不一","每页都放大物件"],genres:["business","marketing","classroom","tech","recruitment"],sample:"浅蓝到白的渐变底,一张大圆角白卡片浮在中间;卡片右侧一组磨砂蓝色的 3D 圆环和小方块,左侧「2025/06」眉标、标题「数字化转型进展」,下方一个蓝色胶囊「汇报人:项目组」。"},{key:"bold-3d",name:"饱和 3D 物件",idea:"满版浓烈的颜色里放一个有分量的 3D 主体,像产品海报。",moods:["有力","醒目","自信","商业感"],hero:{kinds:["3d-object"],vector:"没有图片时用一个大号几何主体(大圆、立方体由三块平行四边形拼成、或大圆环),径向渐变加 strong 投影,压在满版色上。",picture:"3D 渲染主体,光滑或金属质感,强对比光影,纯色饱和背景,单一主体居中或偏置,海报感"},dimensions:{color:"单色浓郁:整版主色,深浅变化做层次,强调色用互补色。",surface:"满版饱和色或深色。",depth:"层叠投影与玻璃,强光影。",composition:"主体偏置加大字的海报构图、巨大数字、斜切分区。",type:"超粗黑体,标题大。"},tokens:{cover:"saturated",content:"any",primary:"high",heading:["PingFang SC","Futura"],body:["PingFang SC"],scale:[3,7],radius:"large",effects:["shadow","gradient","glow"]},elements:["大号几何主体","同色深浅渐变","斜切分区","高光"],motifs:["glow","diagonal-blocks","rings"],skin:{radius:"large",depth:"lifted",card:"surface",badge:"circle",header:"plain",byline:"pill",numbers:"padded"},components:{titleGroup:"超粗大标题白字,副标题细体。",card:"白色或深色卡片,strong 投影浮在彩色底上。",badge:"互补色实心圆,粗体编号。",header:"左上白字标题,主色底一直延续。"},pages:{cover:"满版主色,主体占右侧大半,标题左侧大字。",section:"同一主色的深一阶,巨大编号。",content:"彩色底上的白卡片网格。",data:"一个巨大数字配一个小图表。",closing:"主体换一个角度,一句话。"},taboos:["多个主体争夺焦点","低饱和灰色","细小密集的文字"],genres:["marketing","business","tech","recruitment"],sample:"满版宝蓝底,右侧一个大的蓝色玻璃质感立方体,带强烈的投影和高光;左侧白色超粗标题「年度增长 63%」,「63%」用明黄。"}],xl=[{key:"ink-paper",name:"水墨纸本",idea:"以宣纸留白和水墨晕染造意境,字少、气足、有呼吸。",moods:["雅致","宁静","留白","书卷气"],hero:{kinds:["ink-wash"],vector:"没有图片时用几层灰阶山形(三角形与弧形叠加,越远越淡、softEdge 柔边)画远山,配一枚朱红印章(小方块加白字)和竖排大字。",picture:"中国水墨画,远山云雾,留白大,宣纸纹理,淡墨晕染,可有飞鸟或竹枝"},dimensions:{color:"低饱和:墨色与纸色为主,一点朱红或石青做印章与强调。",surface:"宣纸米白或浅灰纸色,偶尔整页淡墨晕染。",depth:"扁平,柔边晕染。",composition:"大面积留白、偏置大字、竖排标题、圆形或扇形取景。",type:"宋体或书法感字体,竖排常见;正文用宋体或细黑体。"},tokens:{cover:"light",content:"light",primary:"low",heading:["Songti SC","Kaiti SC"],body:["Songti SC","PingFang SC"],scale:[2.5,7],radius:"none",effects:["softEdge","gradient"]},elements:["远山晕染","朱红印章","竖排大字","圆形画框","竹枝","飞鸟","细竖线"],motifs:["mountains","seal","window-lattice"],skin:{radius:"none",depth:"flat",card:"none",badge:"seal",header:"plain",byline:"rule",numbers:"chinese"},components:{titleGroup:"竖排宋体大字标题,旁边一枚朱红印章写副题。",card:"不用卡片;用细竖线分栏或淡墨色块。",badge:"印章式方块编号,或中文数字“壹 贰 叁”。",header:"标题竖排靠右或横排靠左,配一笔淡墨。"},pages:{cover:"下半页淡墨远山,标题竖排在留白处。",section:"整页淡墨晕染,中文数字编号。",content:"竖线分栏的文字,页角一枝竹或一只飞鸟。",data:"墨色与朱红两色的简洁图表。",closing:"一句诗意的话,印章落款。"},taboos:["高饱和色","科技光效与 3D","满页文字","西式卡片网格"],genres:["culture","classroom","academic","festival","civic"],sample:"宣纸米白底,下方三层由深到浅的淡墨远山,一只飞鸟;右侧竖排宋体大字「江南」,旁边一枚朱红方印「人文讲堂」。"},{key:"guochao",name:"国潮纹样",idea:"把传统纹样做成平面图形,用撞色和现代排版让它年轻起来。",moods:["热闹","年轻","有文化","有节奏"],hero:{kinds:["guochao"],vector:"用元素库的海浪纹、阶梯山峦(mountains flat)、圆形窗格和印章,颜色平涂;祥云、亭台这类具象纹样用生成图片,不用形状硬拼。",picture:"国潮平面插画,祥云海浪山峦亭台,平涂色块,撞色,传统纹样,现代排版"},dimensions:{color:"互补或撞色:朱红、石青、明黄、墨绿任取两三种,饱和但不刺眼。",surface:"暖纸色或浅色,章节页可以满版深色。",depth:"扁平平涂。",composition:"中轴对称、纹样框住标题、圆形窗格取景、横向卷轴。",type:"宋体或书法大字,配现代黑体小字。"},tokens:{cover:"any",content:"light",primary:"mid",heading:["Songti SC","Kaiti SC"],body:["PingFang SC"],scale:[2.5,6],radius:"mixed",effects:[]},elements:["祥云","海浪","阶梯山峦","圆形窗格","扇形","回纹边框","印章"],motifs:["sea-waves","mountains","window-lattice","seal"],skin:{radius:"small",depth:"outline",card:"tint",badge:"seal",header:"chip",byline:"rule",numbers:"chinese"},components:{titleGroup:"宋体大标题,被祥云或窗格框住;英文或拼音小字做装饰。",card:"回纹细边框的纸色卡片,或圆形窗格。",badge:"印章或圆形窗格里的编号。",header:"标题两侧各一朵小祥云。"},pages:{cover:"圆形窗格居中,里面山峦海浪,标题压在窗格上。",section:"满版深色,纹样框住编号。",content:"纸色底,回纹边框卡片。",data:"撞色的柱状图,纹样只在角落。",closing:"两侧祥云合拢,一句话。"},taboos:["写实照片","科技光效","纹样乱堆没有主次"],genres:["culture","festival","marketing","classroom"],sample:"暖米色底,中央一个大圆形窗格,里面是平涂的朱红太阳、石青海浪和阶梯山峦;窗格下方宋体大字「端午·粽情」,两侧各一朵祥云。"},{key:"red-ceremony",name:"红色庆典",idea:"红与金的仪式感:庄重对称,柔和的金色光晕和飘带烘托一句主题。",moods:["庄重","隆重","振奋","喜庆"],hero:{kinds:["civic","festive"],vector:"完全可以矢量绘制:深红到正红的渐变底、标题上方一团柔和的金色径向光晕(glow)、需要时一颗干净的实心金色五角星(star5,不加光芒)、弧形红绸(blockArc 加渐变)、金色细线框与角花(corner-frame)。建筑剪影、灯笼、烟花这类具象图形用生成图片,不用形状硬拼;不能生成图片时,用柔光、角花和宋体大字撑起画面。",picture:"红色与金色,庄重的仪式感,红绸飘带,柔和的金色光晕,建筑剪影,或节庆灯笼烟花,对称构图,无放射条纹"},dimensions:{color:"单色浓郁:正红与深红为主,金色做强调与线条。",surface:"封面、章节、结尾满版红或深红渐变;内容页用暖白或浅米底,保留红色页眉带和金线,不做整页大红。",depth:"发光与渐变:柔和的金色光晕、径向高光,不画任何放射线条。",composition:"中轴对称、居中大标题、横向时间轴、编号章节(一、二、三)。",type:"宋体或粗黑体,字重大、字距稳;节庆可以用书法大字。"},tokens:{cover:"saturated",content:"light",primary:"high",heading:["Songti SC","PingFang SC"],body:["PingFang SC","Songti SC"],scale:[2.5,6],radius:"none",effects:["gradient","glow"]},elements:["五角星","金色光晕","红绸飘带","建筑剪影","金色细线框","角花","灯笼","烟花"],motifs:["glow","corner-frame"],skin:{radius:"none",depth:"outline",card:"tint",badge:"seal",header:"band",byline:"rule",numbers:"chinese"},components:{titleGroup:"居中金色宋体大标题,上方一颗五角星或一行单位名,下方金色细线和落款。",card:"暖白卡片加红色页眉条,或红底上的金色细线框。",badge:"红底金字的圆或方块,中文编号。",header:"页面顶部红色带,标题白字或金字。"},pages:{cover:"满版红或深红渐变,中轴对称,标题上方一团柔和的金色光晕,宋体金色大字。",section:"深红底,金色“第二部分”与标题上下居中,两侧金线。",content:"暖白底配红色页眉带,分条加编号,金色细线收边。",data:"红金两色的柱状图,数字金色大字。",closing:"一句号召居中,红绸从两侧收拢。"},taboos:["国旗国徽党徽变形、拼贴、做底纹","仿制红头文件和组织部门的法定表格","卡通与网络流行语","内容页变成普通的灰白页","任何从一点向外放射的条纹、光束或光芒(无论大小,形似旭日旗)","自己画国旗、国徽、党徽或地图轮廓"],genres:["civic","festival"],sample:"深红到正红的径向渐变底,中央上方一团柔和的金色光晕;下方宋体金色大字「奋进新征程」,两侧一条弧形红绸,底部一行落款。"}],wl=[{key:"type-poster",name:"纯文字排版",idea:"不要任何图,只靠字号、字重和留白的对比造出海报般的画面。",moods:["直接","有力量","干净","自信"],hero:{kinds:["type"],vector:"完全可以矢量绘制:一个超大的字或词占满半页,可以被页边裁切、描边空心或换色,配极少的小字。"},dimensions:{color:"单色浓郁或黑白加一色:底色和字色两色为主。",surface:"满版色、深色或白底都可以,整套统一。",depth:"扁平。",composition:"超大字海报、一句话居中、大字与小字的强对比。",type:"超粗黑体或宋体大字,字号对比极大。"},tokens:{cover:"any",content:"any",primary:"any",heading:["PingFang SC","Songti SC"],body:["PingFang SC"],scale:[5,12],radius:"none",effects:[]},elements:["超大字","裁切的字","空心描边字","细线","编号"],motifs:["stripes","dot-grid"],skin:{radius:"none",depth:"flat",card:"none",badge:"ring",header:"plain",byline:"rule",numbers:"padded"},components:{titleGroup:"超大标题,副标题小到正文大小,形成反差。",card:"不用卡片。",badge:"大号数字本身。",header:"一句结论式标题就是整页。"},pages:{cover:"一个超大关键词,被页边裁掉一部分。",section:"巨大编号占满半页。",content:"一页一句话,或大标题加三行小字。",data:"一个巨大数字加一行解释。",closing:"一句话,字号最大。"},taboos:["加图标和插画填空","多种字体","字号对比不够"],genres:["social","marketing","business","tech"],sample:"满版墨绿底,一个巨大的白色「慢」字占满左半页并被页边裁掉一角;右下三行小字「2025 年度阅读报告」。"}],kl=[{key:"geometric",name:"几何构成",idea:"几何形本身就是画面:有机形色块显得柔和,硬朗的斜切、圆环和点阵显得锐利,选一种贯穿全套。",moods:["秩序","现代","简洁","有设计感"],hero:{kinds:["geometric"],vector:"完全可以矢量绘制。有机形子型:几块大的圆角或水滴形色块(teardrop、椭圆)互相交叠,配点阵。硬几何子型:斜切大色块(parallelogram、rtTriangle)、被页边裁掉的大圆环、平行斜线、点阵网格。"},dimensions:{color:"黑白加一色或单色浓郁;有机形子型可以用低饱和多色。",surface:"白底为主,也可以满版主色或深色。",depth:"扁平。",composition:"几何块切分页面、被裁切的大形、居中标题加对角构成、分区色块。",type:"粗黑体,硬几何子型可以配 Futura 等几何西文。"},tokens:{cover:"any",content:"light",primary:"any",heading:["PingFang SC","Futura"],body:["PingFang SC"],scale:[2.5,6],radius:"mixed",effects:[]},elements:["斜切色块","有机形色块","大圆环","点阵","平行斜线","箭头"],motifs:["organic-blobs","diagonal-blocks","rings","dot-grid","stripes"],skin:{radius:"none",depth:"flat",card:"tint",badge:"square",header:"chip",byline:"plain",numbers:"padded"},components:{titleGroup:"粗标题压在色块边缘,副标题细体。",card:"纯色块或细描边方框,不加投影。",badge:"几何形(圆、方、三角)里的编号,形状随风格子型。",header:"左上标题,页边一块小几何延续封面。"},pages:{cover:"一个大几何形占据半页并被页边裁掉,标题在另一侧。",section:"满版主色,一个几何形与巨大编号。",content:"几何块切出的分区,每区一个要点。",data:"几何化的图表:方块柱、圆环比例。",closing:"几何形收拢成一个点,一句话。"},taboos:["两种子型混用","几何形太小太淡当点缀","加厚重投影"],genres:["business","recruitment","academic","marketing"],sample:"白底,右侧一个被页边裁掉一半的深蓝大圆环,左下一块明黄斜切色块;标题「组织升级方案」粗黑体压在斜切块的上沿,旁边一组点阵。"}],vl=[{key:"line-sketch",name:"浅底线描",idea:"一支笔的线条加一种颜色,像在白纸上边讲边画。",moods:["简洁","灵动","思考感","轻松"],hero:{kinds:["line-art"],vector:"用线性图标放大成主视觉(线宽加粗、单色),配手绘感的圈注、箭头和下划线(细线加圆端点,略带倾斜)。",picture:"单色线描插画,细线条,无填色或只有一处色块点缀,白底,手绘感"},dimensions:{color:"黑白加一色:深墨线条,一种强调色只做高亮。",surface:"白底或米白纸色。",depth:"扁平。",composition:"大线描配短标题、草图式的流程和箭头、留白多的编辑排版。",type:"常规黑体或文楷,标题不必很粗。"},tokens:{cover:"light",content:"light",primary:"any",heading:["PingFang SC","LXGW WenKai"],body:["PingFang SC"],scale:[2,4],radius:"none",effects:[]},elements:["手绘圈注","箭头","荧光笔高亮条","虚线","便签"],motifs:["dot-grid","stripes","waves"],skin:{radius:"none",depth:"outline",card:"none",badge:"ring",header:"plain",byline:"rule",numbers:"arabic"},components:{titleGroup:"标题下面一笔强调色的高亮条,像荧光笔划过。",card:"不用填色卡片,用细线框或虚线框。",badge:"线圈里的编号。",header:"左上标题,右上一个小线描图标。"},pages:{cover:"一个大线描图占半页,标题配荧光笔高亮。",section:"一个手写感的大编号加一条箭头。",content:"草图式流程:图标、箭头、短标签。",data:"线图用细线,关键点用强调色圈出来。",closing:"一个打勾的手绘框加一句话。"},taboos:["厚重投影和渐变","多色混杂","密集的实心色块"],genres:["business","classroom","academic","social"],sample:"米白底,右侧一个放大的线描灯泡,线宽粗、深墨色;左侧标题「把复杂的事画简单」,「画简单」下面压一条明黄的荧光笔高亮。"},{key:"chalkboard",name:"黑板线描",idea:"把课堂搬到屏幕上:墨绿黑板、粉笔字和随手的涂鸦。",moods:["亲切","课堂感","有温度","专注"],hero:{kinds:["line-art"],vector:"墨绿或深灰底加一圈木色或白色边框;粉笔感用白色和浅黄的线条图标、虚线和手绘箭头,几处浅色 softEdge 光斑像擦过的粉笔灰。"},dimensions:{color:"低饱和:黑板色底,粉笔白为主,浅黄、浅粉、浅蓝做批注色。",surface:"整套深色(墨绿、深灰绿或深灰)。",depth:"扁平,柔边光斑做出黑板的擦痕。",composition:"板书式:标题在上、要点分条、例题框、圈注和箭头。",type:"楷体或文楷做标题,像手写;正文黑体保证清楚。"},tokens:{cover:"dark",content:"dark",primary:"low",heading:["LXGW WenKai","Kaiti SC"],body:["PingFang SC"],scale:[2,4],radius:"small",effects:["softEdge"]},elements:["粉笔虚线","手绘箭头","圈注","黑板边框","粉笔灰光斑","便签"],motifs:["grid","waves"],skin:{radius:"small",depth:"outline",card:"none",badge:"ring",header:"plain",byline:"rule",numbers:"arabic"},components:{titleGroup:"文楷大标题,下面一条粉笔虚线。",card:"细粉笔线框的例题框,或浅黄便签。",badge:"粉笔圈住的编号。",header:"左上板书标题,右上小图标像随手画的。"},pages:{cover:"黑板中央一句标题,四角几个粉笔涂鸦图标。",section:"大号手写编号加一行字。",content:"板书分条,关键词用浅黄粉笔圈出。",data:"粉笔线画的简单图表,数字手写感。",closing:"黑板上一句作业或口号,旁边一个笑脸。"},taboos:["高饱和亮色大面积","照片","玻璃和发光质感"],genres:["classroom"],sample:"墨绿底,外围一圈浅木色边框;中央文楷大字「分数的意义」,下面一条白色粉笔虚线,左上角一个粉笔画的披萨图标,右下角浅黄粉笔写「三年级 数学」。"},{key:"watercolor",name:"水彩植物",idea:"用水彩的花叶带来呼吸感,让内容像放在一张安静的画纸上。",moods:["清新","温柔","雅致","自然"],hero:{kinds:["watercolor"],vector:"没有图片时不画叶子:用同色系的有机形色块(低透明度、柔边)叠在页角做出晕染感,配细宋体标题和大量留白。",picture:"水彩植物插画,花叶从页角伸入,颜色晕染,大量留白,纸张质感,低饱和"},dimensions:{color:"低饱和:鼠尾草绿、雾粉、米黄等柔和色,一个稍深的同色系做文字。",surface:"白底或暖白纸色。",depth:"扁平,柔边制造晕染。",composition:"居中标题配四角花叶、留白多的编辑排版、细线分栏。",type:"宋体或细黑体,字重轻,字距略开。"},tokens:{cover:"light",content:"light",primary:"low",heading:["Songti SC","PingFang SC"],body:["PingFang SC"],scale:[2,4],radius:"small",effects:["softEdge"]},elements:["花叶角饰","水彩色斑","细线框","圆形画框"],motifs:["organic-blobs","glow"],skin:{radius:"small",depth:"flat",card:"none",badge:"ring",header:"plain",byline:"rule",numbers:"chinese"},components:{titleGroup:"细宋体标题,上下各一条短细线。",card:"白卡片加极细的同色描边,或只用留白。",badge:"浅色圆斑里放深色编号。",header:"标题居左,一枝小叶子做点缀。"},pages:{cover:"居中标题,花叶从左上和右下伸入。",section:"一大片水彩色斑上压编号。",content:"两栏文字,留白多,页角一片叶子。",data:"柔和色系的环形图或条形图。",closing:"与封面呼应的花叶,一句感谢或寄语。"},taboos:["高饱和撞色","粗黑体大字","科技光效"],genres:["academic","culture","medical","business"],sample:"暖白底,左上角和右下角伸入几枝水彩绿叶和一朵淡粉花;居中细宋体标题「城市里的四季」,下面一行字距拉开的小字「毕业设计答辩」。"}],Ml=[{key:"flat-illustration",name:"扁平插画",idea:"用扁平的人物和场景把抽象的事讲成一个有人在做的故事。",moods:["亲和","轻快","易懂","年轻"],hero:{kinds:["flat-illustration"],vector:"没有插画时不用形状硬拼人物:把大号线性图标放进同色系的有机形色块里,配一两个模拟物件(屏幕、手机、文件)组件做场景。",picture:"扁平矢量插画,人物与办公或学习场景,无描边或细描边,有限的几种平涂颜色,留白干净"},dimensions:{color:"高饱和多彩或互补撞色:一个主色加两三个辅色,饱和度统一。",surface:"白底或很浅的主色底,偶尔用整版浅色块托住插画。",depth:"扁平,不加投影。",composition:"插画占一侧的图文分屏、插画居中配短句、多个小插画配卡片网格。",type:"圆润或常规黑体,字重适中,不用宋体。"},tokens:{cover:"light",content:"light",primary:"high",heading:["PingFang SC"],body:["PingFang SC"],scale:[2.5,4.5],radius:"large",effects:[]},elements:["有机形色块","圆点","波浪线","对话气泡","线性图标"],motifs:["organic-blobs","dot-grid","waves"],skin:{radius:"large",depth:"flat",card:"tint",badge:"circle",header:"chip",byline:"pill",numbers:"arabic"},components:{titleGroup:"粗黑体标题,关键词换辅色;可以配一个小插画角标。",card:"大圆角浅色卡片,不同卡片用不同辅色的浅底区分。",badge:"彩色圆形里放白色图标或编号。",header:"左上标题,右侧一个与内容相关的小插画。"},pages:{cover:"大插画场景占半页,标题在另一侧。",section:"整版浅色底,一个人物插画指向章节标题。",content:"三到四张彩色卡片,每张一个图标一个短句。",data:"图表配一个人物在旁边“讲解”。",closing:"人物挥手或完成任务的插画,一句号召。"},taboos:["同一页混用多种插画风格","插画人物比例差别过大","深色压抑的底色"],genres:["classroom","business","kids","recruitment","marketing"],sample:"白底,左半页一个扁平插画:两个人在一块大屏幕前讨论,屏幕上是彩色柱状图;右侧标题「新人入职第一周」粗黑体,「第一周」用橙色,下面三个彩色圆点图标排成一行。"},{key:"toon-3d",name:"3D 卡通人物",idea:"一个圆润可爱的 3D 角色当主讲人,把距离感变成陪伴感。",moods:["友好","活泼","温暖","有陪伴感"],hero:{kinds:["3d-character"],vector:"没有图片时不硬画人物:改用大号圆润图标放进带投影的圆形徽章,配高饱和整版色和圆角色块。",picture:"3D 卡通角色,圆润比例,柔和材质与高光,干净纯色背景,正面或三分之二侧身,表情友好"},dimensions:{color:"单色浓郁或多彩:底色饱和但明亮,角色衣服用对比色。",surface:"浅色渐变或满版明亮色。",depth:"层叠投影:卡片和徽章浮在页面上。",composition:"角色占一侧的分屏、角色从卡片后探出、角色居中加对话气泡。",type:"粗黑体或圆润字体,字大。"},tokens:{cover:"any",content:"light",primary:"high",heading:["PingFang SC"],body:["PingFang SC"],scale:[2.5,5],radius:"large",effects:["shadow","gradient"]},elements:["对话气泡","圆角徽章","星星与闪光","胶囊标签","圆点"],motifs:["organic-blobs","glow"],skin:{radius:"large",depth:"shadow",card:"surface",badge:"circle",header:"chip",byline:"pill",numbers:"arabic"},components:{titleGroup:"超粗标题加圆角胶囊副标题。",card:"大圆角白卡片加柔和投影,浮在彩色底上。",badge:"高饱和圆形徽章,白色大号编号。",header:"标题左上,角色缩小出现在右下角呼应。"},pages:{cover:"角色占右半页,左侧大标题。",section:"角色指向巨大编号。",content:"卡片网格,角色只在关键页出现,不每页都放。",data:"简单的柱状图或环形图,配角色表情强调变化。",closing:"角色挥手,一句话。"},taboos:["每页都塞角色","角色与底色同色相","严肃题材用卡通"],genres:["classroom","kids","medical","business"],sample:"明黄底,右侧一个穿白大褂的 3D 卡通医生微笑举手;左侧标题「秋冬防流感」超粗黑体,下方一个圆角白色胶囊写「社区健康讲座」,卡片带柔和投影。"}],Sl=[{key:"business-photo",name:"商务影像",idea:"让真实的建筑、人和现场替结论作证,几何框把照片收进统一的秩序里。",moods:["可信","专业","开阔","务实"],hero:{kinds:["photo","geometric"],vector:"没有照片时不用形状拼建筑:用大块斜切色块配一个巨大的数字或一张模拟的报表、仪表盘做画面;不留空图框。",picture:"商业摄影,真实场景,自然光,干净背景,略带主色调的色彩分级,留出放字的空间"},dimensions:{color:"黑白加一色或单色浓郁:照片之外只用主色与中性色,强调色只标结论。",surface:"白底为主;封面和章节可以满版主色,照片压在色块上。",depth:"扁平;照片本身提供层次,不再加重投影。",composition:"图文分屏、照片放进斜切或圆形框、满版照片压暗后压字;同一套里至少换三种照片裁切方式。",type:"理性黑体,标题粗、正文常规,数字可以加大。"},tokens:{cover:"any",content:"light",primary:"mid",heading:["PingFang SC","Helvetica Neue"],body:["PingFang SC"],scale:[2.5,5],radius:"small",effects:["gradient"]},elements:["斜切色块","圆形或弧形照片框","照片压暗渐变","细分隔线","数据角标"],motifs:["diagonal-blocks","dot-grid"],skin:{radius:"small",depth:"flat",card:"surface",badge:"square",header:"plain",byline:"plain",numbers:"padded"},components:{titleGroup:"眉标小字加两行粗标题,关键词换主色;落款用小号常规字,不必加胶囊。",card:"白卡片或主色浅底卡片,小圆角,靠留白而不是投影分组。",badge:"主色实心方块或圆里放白色编号。",header:"左上标题加一行结论副标题;或页面顶部一条照片横幅压标题。"},pages:{cover:"半页照片加半页标题,或满版照片加深色渐变压字。",section:"满版主色底,巨大编号与一张小照片错位。",content:"左图右文、上图下文、三张照片并排配说明,轮换使用。",data:"白底大图表,照片退到角落做氛围。",closing:"与封面同一张照片的另一种裁切,留一句行动号召。"},taboos:["同一张照片在多页重复","照片上直接压浅色小字","照片与主色色调冲突"],genres:["business","academic","medical","recruitment","finance","civic"],sample:"白底,右侧三分之二是一张蓝调的城市建筑照片,被一条斜切的主色色块切开;左侧眉标「2025 年度」、标题「增长来自三个新市场」粗黑体两行,「三个新市场」用主色。"},{key:"dark-photo",name:"暗场影像",idea:"把照片压进黑暗里,只让一束光、一个主体和一句话浮出来。",moods:["沉稳","高级","克制","电影感"],hero:{kinds:["photo"],vector:"没有照片时用深色底上的径向光斑(大圆,softEdge 柔边,低透明度)加一条细亮线勾出主体轮廓。",picture:"低调摄影,暗部压黑,单一侧光,黑白或低饱和,主体轮廓清楚,电影感"},dimensions:{color:"黑白加一色:近黑底、灰阶照片,只有一种亮色做强调。",surface:"整套深色,内容页也是深色。",depth:"扁平,层次来自照片的明暗和渐隐。",composition:"满版照片压字、大面积留黑的偏置构图、一句话居中。",type:"细黑体或宋体大字,字距略开,克制的字号对比。"},tokens:{cover:"dark",content:"dark",primary:"any",heading:["PingFang SC","Songti SC","Didot"],body:["PingFang SC"],scale:[3,8],radius:"none",effects:["gradient","softEdge"]},elements:["照片渐隐到黑","细亮线","大字号数字","颗粒感光斑"],motifs:["glow","light-streak"],skin:{radius:"none",depth:"outline",card:"none",badge:"ring",header:"plain",byline:"rule",numbers:"padded"},components:{titleGroup:"细体大标题加一行全大写西文眉标,字距拉开。",card:"不用卡片;用细线框或只靠对齐分组。",badge:"亮色细线圆圈里的编号。",header:"左上小标题,大量留黑。"},pages:{cover:"满版暗调照片,标题偏置在照片的暗部。",section:"全黑底,一个亮色编号和一句话。",content:"照片占一侧并渐隐进黑底,另一侧三两行字。",data:"黑底上亮色线图,网格线极淡。",closing:"一张照片的局部特写加一句话。"},taboos:["高饱和多色","厚重投影和卡片","满页小字"],genres:["business","tech","finance","marketing"],sample:"全黑底,右侧一张黑白的高楼仰拍照片渐隐进黑暗;左下一行细黑体大字「下一个十年」,上方一行拉开字距的小字 ANNUAL REVIEW,强调色只出现在一条短亮线上。"}],$l=[{key:"tech-glow",name:"暗场光效",idea:"在深色空间里用光说话:发光的线、粒子和光带把视线引到参数上。",moods:["未来感","精密","冲击力","沉浸"],hero:{kinds:["tech-glow","fluid"],vector:"完全可以矢量绘制:深底上的径向光晕(大圆径向渐变加 softEdge)、发光细线(line 加 glow)、同心圆环与刻度(donut、arc)组成的 HUD、点阵网格、带渐隐的流体光带(弧形 blockArc 或 chord 加渐变)。",picture:"深色背景,发光粒子与光线,全息界面元素,霓虹青或电光紫,景深,科技感"},dimensions:{color:"单色浓郁或黑白加一色:近黑或深海军蓝底,一种霓虹色(青、电光蓝、紫)发光。",surface:"整套深色,内容页也是深色。",depth:"发光:光晕、发光线、半透明面板。",composition:"巨大参数、主体居中加光、HUD 框、便当盒网格。",type:"几何无衬线或粗黑体,数字特别大。"},tokens:{cover:"dark",content:"dark",primary:"high",heading:["PingFang SC","Avenir Next"],body:["PingFang SC"],scale:[3,8],radius:"small",effects:["glow","gradient","softEdge","glass"]},elements:["径向光晕","发光细线","HUD 圆环与刻度","点阵网格","流体光带","电路线条"],motifs:["glow","rings","particles","ribbon","grid","circuit","hud-frame","light-streak"],skin:{radius:"small",depth:"glow",card:"none",badge:"ring",header:"chip",byline:"rule",numbers:"padded"},components:{titleGroup:"白色粗标题,关键词用霓虹色加 glow;上方一行全大写西文眉标。",card:"深色半透明面板,细亮描边,不用白卡片。",badge:"发光细线圆环里的编号。",header:"左上白色标题,右上一条短发光线。"},pages:{cover:"中央或一侧一团光,标题压在光的边缘。",section:"黑底,一个发光的巨大编号。",content:"深色面板网格,每块一个图标和参数。",data:"发光折线或柱子,网格线极淡。",closing:"一束光收拢到一句话上。"},taboos:["白底白卡片","多种霓虹色混用","光效盖住文字"],genres:["tech","business","marketing","finance"],sample:"近黑底,右侧一团青色径向光晕,里面是同心的发光圆环和刻度;左侧眉标 AI PLATFORM,白色粗标题「推理成本降低 70%」,「70%」青色发光。"},{key:"light-flow",name:"浅色流体",idea:"柔和的渐变和流动的丝带撑起画面,没有具体物件也有空间和情绪。",moods:["流动","柔和","开阔","现代"],hero:{kinds:["gradient","fluid"],vector:"完全可以矢量绘制:大面积的多色渐变底(线性加径向叠加)、几条宽弧形丝带(blockArc、chord、波浪由多个椭圆叠成)带透明渐隐、柔边光斑。",picture:"抽象流体丝带,柔和渐变,丝绸质感,浅色背景,留白多"},dimensions:{color:"渐变光感:两到三个邻近色相的渐变,饱和适中。",surface:"浅色渐变或满版渐变。",depth:"扁平或微光,丝带的透明叠加做出深度。",composition:"标题居中或偏左,丝带从页边流过;大字海报;留白多。",type:"粗黑体或细黑体都可以,字少。"},tokens:{cover:"any",content:"light",primary:"mid",heading:["PingFang SC","Avenir Next"],body:["PingFang SC"],scale:[2.5,6],radius:"large",effects:["gradient","softEdge"]},elements:["流体丝带","多色渐变","柔边光斑","波浪线","点阵"],motifs:["ribbon","waves","glow","dot-grid"],skin:{radius:"large",depth:"glass",card:"surface",badge:"circle",header:"plain",byline:"pill",numbers:"padded"},components:{titleGroup:"大标题加一行细副标题,可以居中。",card:"白色或半透明卡片,大圆角,压在渐变上。",badge:"渐变圆里的编号。",header:"左上标题,页面一角一条细丝带延续封面。"},pages:{cover:"满版渐变,丝带从一角流向对角,标题在留白处。",section:"同色渐变换一个方向,编号大字。",content:"浅底,丝带缩小到页边,内容卡片。",data:"浅底大图表,用渐变色系的系列色。",closing:"丝带收拢到中央,一句话。"},taboos:["丝带穿过文字","颜色发脏的渐变","每页丝带位置都一样"],genres:["business","marketing","tech","classroom"],sample:"淡紫到浅蓝的渐变底,一条半透明的宽丝带从左下流向右上;左侧标题「年度复盘」粗黑体,下面一行细字「把经验变成方法」。"}],jn=[...Sl,...Ml,...$l,...bl,...kl,...xl,...vl,...wl],di=jn.map(t=>t.key);function hi(t){return t===void 0?void 0:jn.find(e=>e.key===t)}const Cl={radius:"small",depth:"shadow",card:"surface",badge:"circle",header:"plain",byline:"plain",numbers:"padded"},pi={radius:["none","small","large"],depth:["flat","shadow","lifted","glass","outline","glow"],card:["surface","tint","none"],badge:["circle","rounded","square","diamond","ring","seal"],header:["plain","band","chip"],byline:["plain","pill","rule"],numbers:["arabic","padded","chinese"]};function fi(t,e){return{...Cl,...hi(t)?.skin,...e}}function Tl(t){return t?.skin??fi(t?.style)}const mi={right:"l",left:"r",bottom:"u",top:"d"};function Pl(t){const{effect:e}=t,n=e==="push"||e==="wipe"||e==="cover"||e==="pull";return{effect:e,...n?{direction:mi[t.from??(e==="push"?"bottom":"right")]}:{},...e==="split"?{orientation:t.orientation??"vert",direction:t.inOut??"out"}:{},...e==="zoom"?{direction:t.inOut??"in"}:{},...!n&&e!=="split"&&e!=="zoom"&&t.direction?{direction:t.direction}:{},...(e==="fade"||e==="cut")&&t.thruBlack?{thruBlack:!0}:{},...e==="wheel"&&t.spokes?{spokes:t.spokes}:{},...t.durationMs===void 0||e==="none"?{}:{durationMs:Math.round(t.durationMs)},...t.advanceOnClick===!1?{advanceOnClick:!1}:{},...t.advanceAfterMs===void 0?{}:{advanceAfterMs:Math.round(t.advanceAfterMs)}}}function El(t){if(t===null)return{effect:"none",durationMs:0,advanceOnClick:!0};const e=Object.entries(mi).find(([,o])=>o===t.direction)?.[0],n={fast:500,med:750,slow:1e3};return{effect:t.effect,...e?{from:e}:{},...t.direction==="in"||t.direction==="out"?{inOut:t.direction}:{},...t.orientation?{orientation:t.orientation}:{},durationMs:t.durationMs??n[t.speed??"fast"]??500,advanceOnClick:t.advanceOnClick!==!1,...t.advanceAfterMs===void 0?{}:{advanceAfterMs:t.advanceAfterMs}}}function Al(t){return t==="flyIn"||t==="flyOut"?["bottom","left","right","top","bottomLeft","bottomRight","topLeft","topRight"]:/^(wipe|peek)(In|Out)$/u.test(t)?["bottom","left","right","top"]:/^strips(In|Out)$/u.test(t)?["bottomLeft","bottomRight","topLeft","topRight"]:[]}const Ne={calm:{transition:{effect:"fade",durationMs:500},sectionTransition:{effect:"fade",durationMs:900},entrance:{effect:"fadeIn",durationMs:500},hero:{effect:"zoomIn",durationMs:600}},keynote:{transition:{effect:"fade",durationMs:800},sectionTransition:{effect:"fade",thruBlack:!0,durationMs:1200},entrance:{effect:"fadeIn",durationMs:700},hero:{effect:"basicZoomIn",durationMs:900}},drawn:{transition:{effect:"push",from:"right",durationMs:600},sectionTransition:{effect:"wipe",from:"right",durationMs:800},entrance:{effect:"wipeIn",direction:"left",durationMs:600},hero:{effect:"zoomIn",durationMs:600}},playful:{transition:{effect:"push",from:"right",durationMs:500},sectionTransition:{effect:"zoom",inOut:"in",durationMs:700},entrance:{effect:"bounceIn",durationMs:700},hero:{effect:"basicZoomIn",durationMs:600}},technical:{transition:{effect:"wipe",from:"right",durationMs:400},sectionTransition:{effect:"wipe",from:"right",durationMs:700},entrance:{effect:"wipeIn",direction:"left",durationMs:400},hero:{effect:"fadeIn",durationMs:500}},ink:{transition:{effect:"fade",durationMs:1e3},sectionTransition:{effect:"fade",durationMs:1400},entrance:{effect:"fadeIn",durationMs:900},hero:{effect:"fadeIn",durationMs:1200}},structural:{transition:{effect:"push",from:"right",durationMs:500},sectionTransition:{effect:"split",orientation:"vert",inOut:"out",durationMs:700},entrance:{effect:"flyIn",direction:"left",durationMs:400},hero:{effect:"wipeIn",direction:"left",durationMs:500}},print:{transition:{effect:"cover",from:"right",durationMs:600},sectionTransition:{effect:"fade",durationMs:900},entrance:{effect:"wipeIn",direction:"top",durationMs:500},hero:{effect:"fadeIn",durationMs:600}}};function Ol(t){return t!==void 0&&t in Ne?Ne[t]:Ne.calm}const gi=.5522847498,Dn=(t,e)=>({kind:"moveTo",pt:{x:t,y:e}}),Bn=(t,e)=>({kind:"lnTo",pt:{x:t,y:e}}),Ie=()=>({kind:"close"}),ae=(t,e,n)=>({kind:"cubicBezTo",pts:[{x:t[0],y:t[1]},{x:e[0],y:e[1]},{x:n[0],y:n[1]}]});function bt(t,e,n,o=n){const i=n*gi,s=o*gi;return[Dn(t+n,e),ae([t+n,e+s],[t+i,e+o],[t,e+o]),ae([t-i,e+o],[t-n,e+s],[t-n,e]),ae([t-n,e-s],[t-i,e-o],[t,e-o]),ae([t+i,e-o],[t+n,e-s],[t+n,e]),Ie()]}function R(t,e=!0){const[n,...o]=t;return n?[Dn(n[0],n[1]),...o.map(i=>Bn(i[0],i[1])),...e?[Ie()]:[]]:[]}function Gt(t,e=!1){const n=t.length;if(n<2)return R(t,e);const o=r=>e?t[(r+n)%n]:t[Math.max(0,Math.min(n-1,r))],i=[Dn(t[0][0],t[0][1])],s=e?n:n-1;for(let r=0;r<s;r++){const a=o(r-1),l=o(r),c=o(r+1),u=o(r+2);i.push(ae([l[0]+(c[0]-a[0])/6,l[1]+(c[1]-a[1])/6],[c[0]-(u[0]-l[0])/6,c[1]-(u[1]-l[1])/6],c))}return e&&i.push(Ie()),i}function yi(t,e,n,o,i,s=n){const r=Math.max(4,Math.ceil(Math.abs(i-o)/6));return Array.from({length:r+1},(a,l)=>{const c=(o+(i-o)*l/r)*Math.PI/180;return[t+n*Math.cos(c),e+s*Math.sin(c)]})}function bi(t,e,n,o){let i=-1/0,s=1/0;for(const[r,a,l]of[[t[0],e[0],n],[t[1],e[1],o]]){if(Math.abs(a)<1e-9){if(r<0||r>l)return null;continue}const c=(0-r)/a,u=(l-r)/a;i=Math.max(i,Math.min(c,u)),s=Math.min(s,Math.max(c,u))}return i<s?[[t[0]+e[0]*i,t[1]+e[1]*i],[t[0]+e[0]*s,t[1]+e[1]*s]]:null}function xi(t,e,n){const o=n*Math.PI/180,i=t[0]-e[0],s=t[1]-e[1];return[e[0]+i*Math.cos(o)-s*Math.sin(o),e[1]+i*Math.sin(o)+s*Math.cos(o)]}const Fl=[{name:"corner-frame",label:"细线框与角花",category:"frame",summary:"a fine frame with ornamental corner brackets; corners draws only the corners",usage:"党政、庆典、国风与高端商务:金色细框沿页边内缩一圈,或只在四角放角花,显得庄重。",variants:[["full","细框加四角角花"],["corners","只有四角角花"]],build:({w:t,h:e,color:n,opacity:o,variant:i})=>{const s=Math.min(t,e)*.12,r=Math.min(t,e)*.03,a=[],l=[];for(const[u,d,h,f]of[[0,0,1,1],[t,0,-1,1],[0,e,1,-1],[t,e,-1,-1]]){a.push(R([[u+h*s,d],[u,d],[u,d+f*s]],!1)),a.push(R([[u+h*s*.6,d+f*r],[u+h*r,d+f*r],[u+h*r,d+f*s*.6]],!1));const p=[u+h*r*2.4,d+f*r*2.4],m=r*.7;l.push(R([[p[0],p[1]-m],[p[0]+m,p[1]],[p[0],p[1]+m],[p[0]-m,p[1]]]))}const c=r*.5;return[...i==="full"?[{paths:[R([[s+r,c],[t-s-r,c]],!1),R([[s+r,e-c],[t-s-r,e-c]],!1),R([[c,s+r],[c,e-s-r]],!1),R([[t-c,s+r],[t-c,e-s-r]],!1)],line:n,lineWidth:.75,opacity:o,fill:null}]:[],{paths:a,line:n,lineWidth:1.75,opacity:o,fill:null},{paths:l,fill:n,opacity:o}]}},{name:"hud-frame",label:"科技边框",category:"frame",summary:"a technical panel outline with cut corners, bright corner strokes and a short tick row",usage:"科技稿的面板与封面取景框:框住标题或数据,角上的亮色短线用第二色并发光。",variants:[["chamfer","切角边框"]],build:({w:t,h:e,color:n,color2:o,opacity:i})=>{const s=Math.min(t,e)*.08,r=Math.min(t,e)*.18,a=[[s,0],[t-s,0],[t,s],[t,e-s],[t-s,e],[s,e],[0,e-s],[0,s]],l=[R([[0,s+r],[0,s],[s,0],[s+r,0]],!1),R([[t,e-s-r],[t,e-s],[t-s,e],[t-s-r,e]],!1)],c=Array.from({length:6},(u,d)=>R([[t/2-s*1.5+d*s*.6,e-s*.25],[t/2-s*1.5+d*s*.6,e-s*.55]],!1));return[{paths:[R(a)],line:n,lineWidth:1,opacity:.7*i,fill:null},{paths:c,line:n,lineWidth:1,opacity:.6*i,fill:null},{paths:l,line:o,lineWidth:3,opacity:i,fill:null,glow:{color:o,size:5}}]}},{name:"retro-window",label:"复古窗口",category:"frame",summary:"a retro computer window: a title bar with its text and three buttons, a thick outline and a hard offset shadow",usage:"把封面做成一件实物:标题放进窗口里,几扇窗口错落叠放,最前面一扇放标题;窗口标题写文件名式的短语。",variants:[["classic","标题栏加三枚按钮"]],text:!0,colors:["primary","surface"],build:({w:t,h:e,color:n,color2:o,opacity:i,text:s})=>{const r=Math.min(t,e)*.04,a=Math.min(e*.18,1.1),l=a*.4,c={x:0,y:0,w:t-r,h:e-r};return[{frame:{...c,x:r,y:r},preset:"rect",fill:"text",opacity:i},{frame:c,preset:"rect",fill:o,opacity:i,line:"text",lineWidth:2},{frame:{...c,h:a},preset:"rect",fill:n,opacity:i,line:"text",lineWidth:2,text:{text:s??"",color:"#FFFFFF",size:Math.round(a*28.35*.42)}},{frame:{x:c.w-a*2.2,y:a*.3,w:a*1.9,h:l},paths:[0,1,2].map(u=>R([[u*l*1.6,0],[u*l*1.6+l,0],[u*l*1.6+l,l],[u*l*1.6,l]])),fill:"#FFFFFF",line:"text",lineWidth:1,opacity:i}]}}];function Nl(t){let e=(Math.floor(t)||1)>>>0;return()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}const tt=(t,e,n)=>e+(n-e)*t(),zn={sparse:.6,medium:1,dense:1.6},Il=[{name:"dot-grid",label:"点阵",category:"geometry",summary:"a grid of small dots; fade shrinks them toward the far corner",usage:"铺在页面一角或标题背后做肌理;fade 让点从一角向另一角变小,自然消失。点要小、要淡,不和文字抢。",variants:[["even","大小一致"],["fade","从左上向右下逐渐变小"]],build:({w:t,h:e,color:n,opacity:o,density:i,variant:s})=>{const r={sparse:1.2,medium:.8,dense:.55}[i],a=r*.11,l=Math.max(1,Math.floor(t/r)),c=Math.max(1,Math.floor(e/r)),u=(t-(l-1)*r)/2,d=(e-(c-1)*r)/2,h=[];for(let f=0;f<c;f++)for(let p=0;p<l;p++){const m=s==="fade"?1-(f/Math.max(1,c-1)+p/Math.max(1,l-1))/2.2:1;a*m>.015&&h.push(bt(u+p*r,d+f*r,a*m))}return[{paths:h,fill:n,opacity:.6*o}]}},{name:"rings",label:"同心圆环",category:"geometry",summary:"concentric rings; hud adds a tick scale, bright arcs and a centre dot, dashed draws them dashed",usage:"做被页边裁掉的大圆环、科技稿的 HUD 仪表;放大到超出页面一半,比完整放在页内更有张力。",variants:[["plain","细线同心圆"],["hud","刻度、亮色弧段与中心点,科技仪表感"],["dashed","虚线同心圆"]],build:({w:t,h:e,color:n,color2:o,opacity:i,density:s,count:r,variant:a})=>{const l=t/2,c=e/2,u=Math.min(t,e)/2,d=r??Math.round(4*zn[s]),h=Array.from({length:d},(g,y)=>bt(l,c,u*(y+1)/d)),f=[{paths:h,line:n,lineWidth:.75,opacity:i,...a==="dashed"?{dash:"dash"}:{}}];if(a!=="hud")return f;const p=Array.from({length:60},(g,y)=>{const b=y*6*Math.PI/180,x=u*(y%5===0?.88:.93);return R([[l+Math.cos(b)*x,c+Math.sin(b)*x],[l+Math.cos(b)*u*.97,c+Math.sin(b)*u*.97]],!1)}),m=[[-20,70],[150,215]].map(([g,y])=>R(yi(l,c,u*.8,g,y),!1));return[{paths:h.slice(0,-1),line:n,lineWidth:1,opacity:.6*i,fill:null},{paths:[bt(l,c,u)],line:n,lineWidth:1.5,opacity:i,fill:null},{paths:p,line:n,lineWidth:1,opacity:.8*i,fill:null},{paths:m,line:o,lineWidth:4,opacity:i,fill:null,glow:{color:o,size:6}},{paths:[bt(l,c,u*.05)],fill:o,opacity:i}]}},{name:"organic-blobs",label:"有机形色块",category:"geometry",summary:"soft irregular rounded blobs overlapping each other, in shades of one colour",usage:"柔和的几何构成、图标或组件背后的底形;两三块同色不同深浅的色块交叠,一块被页边裁掉。",variants:[["soft","平涂色块"]],build:({w:t,h:e,color:n,opacity:o,count:i,random:s})=>{const r=i??3;return Array.from({length:r},(a,l)=>{const c=Math.min(t,e)*tt(s,.3,.45),u=t*(l+.5)/r+tt(s,-.15,.15)*t/r,d=e*tt(s,.35,.65),h=Array.from({length:8},(p,m)=>{const g=m/8*Math.PI*2,y=c*tt(s,.78,1.12);return[u+Math.cos(g)*y,d+Math.sin(g)*y]}),f=[.75,.45,.25][l%3];return{paths:[Gt(h,!0)],fill:{from:n,to:n,radial:!0,fromOpacity:f*o,toOpacity:f*.35*o}}})}},{name:"diagonal-blocks",label:"斜切色块",category:"geometry",summary:"slanted parallelogram blocks across the frame; down slants the other way",usage:"切开页面、托住标题或照片;块要大,至少占画面三分之一,配一种主色一种辅色。",variants:[["up","向右上倾斜"],["down","向右下倾斜"]],build:({w:t,h:e,color:n,opacity:o,count:i,variant:s})=>{const r=i??2,a=t/(r+1),l=e*.45*(s==="down"?-1:1);return Array.from({length:r},(c,u)=>{const d=t-a*(u+1.4);return{paths:[R([[d+l,0],[d+a+l,0],[d+a,e],[d,e]].map(([h,f])=>[Math.max(0,Math.min(t,h)),f]))],fill:n,opacity:[1,.55,.3][u%3]*o}})}},{name:"stripes",label:"平行斜线",category:"geometry",summary:"parallel diagonal lines filling the frame; down slants the other way",usage:"做色块里的肌理、角落的强调;线细、间距均匀,不铺满整页。",variants:[["up","向右上"],["down","向右下"]],build:({w:t,h:e,color:n,opacity:o,density:i,variant:s})=>{const r={sparse:.9,medium:.55,dense:.35}[i],a=s==="down"?[1,1]:[1,-1],l=[];for(let c=-e;c<=t+e;c+=r*Math.SQRT2){const u=bi([c,0],a,t,e);u&&l.push(R(u,!1))}return[{paths:l,line:n,lineWidth:.75,opacity:.6*o,fill:null}]}},{name:"waves",label:"波浪",category:"geometry",summary:"flowing wave lines; bands stacks filled waves rising from the bottom of the frame",usage:"lines 做轻盈的流动线;bands 做页面底部层叠的波浪底,常见于清新、医疗、教育稿。",variants:[["lines","三条流动的细线"],["bands","从下方叠起的填色波浪"]],build:({w:t,h:e,color:n,opacity:o,count:i,variant:s})=>{const r=i??3,a=t/2.2,l=(c,u,d)=>Array.from({length:13},(h,f)=>{const p=t*f/12;return[p,c+u*Math.sin(p/a*Math.PI*2+d)]});return s==="bands"?Array.from({length:r},(c,u)=>({paths:[[...Gt(l(e*(.2+.6*u/Math.max(1,r)),e*.1,u*1.3)),...R([[t,e],[0,e]],!1).map(d=>d.kind==="moveTo"?{kind:"lnTo",pt:d.pt}:d),{kind:"close"}]],fill:{from:n,to:n,angle:90,fromOpacity:(.15+.55*(u+1)/r)*o,toOpacity:.04*o}})):Array.from({length:r},(c,u)=>({paths:[Gt(l(e*(.3+.4*u/Math.max(1,r-1)),e*.12,u*.9))],line:n,lineWidth:1,opacity:(1-u*.25)*o,fill:null}))}}],Ll=[{name:"glow",label:"光晕",category:"light",summary:"a radial glow fading out to nothing; core adds a bright centre",usage:"深色页上的光源、主体背后的光、浅色页上的柔和氛围光斑;放大、偏置、被页边裁切更自然。",variants:[["soft","单层渐隐光晕"],["core","带明亮的中心"]],build:({w:t,h:e,color:n,opacity:o,variant:i})=>[{paths:[bt(t/2,e/2,t/2,e/2)],fill:{from:n,to:n,radial:!0,fromOpacity:.85*o,toOpacity:0}},...i==="core"?[{frame:{x:t*.35,y:e*.35,w:t*.3,h:e*.3},paths:[bt(t*.15,e*.15,t*.15,e*.15)],fill:{from:"#FFFFFF",to:n,radial:!0,fromOpacity:.9*o,toOpacity:0}}]:[]]},{name:"ribbon",label:"流体丝带",category:"light",summary:"flowing silk-like ribbons crossing the frame, widening and thinning, shading from one colour to the other",usage:"浅色流体、发布会、年终总结的主视觉;从一角流向对角,穿过留白,不穿过文字。",variants:[["flow","平缓流动"],["twist","起伏更大、更扭转"]],build:({w:t,h:e,color:n,color2:o,opacity:i,density:s,count:r,variant:a,random:l})=>{const c=r??(s==="sparse"?1:s==="dense"?3:2),u=a==="twist"?.32:.2;return Array.from({length:c},(d,h)=>{const f=tt(l,0,Math.PI),p=e*(.35+.3*h/Math.max(1,c)),m=e*tt(l,.06,.12),g=Array.from({length:9},(w,k)=>[t*k/8,p+e*u*Math.sin(k/8*Math.PI*1.6+f)-e*.25*(k/8-.5)]),y=w=>m*(.25+Math.sin(w/8*Math.PI)*(a==="twist"?Math.abs(Math.cos(w/8*Math.PI*2+f)):1)),b=g.map(([w,k],v)=>[w,k-y(v)]),x=g.map(([w,k],v)=>[w,k+y(v)]).reverse();return{paths:[Gt([...b,...x],!0)],fill:{from:n,to:o,angle:0,fromOpacity:(.95-h*.25)*i,toOpacity:(.35-h*.08)*i}}})}},{name:"particles",label:"粒子",category:"light",summary:"small glowing particles of mixed size; cloud gathers them toward the centre, band along a diagonal, scatter evenly",usage:"科技与夜景的空气感;聚在光晕周围或沿一条斜带分布,越远越小越淡。",variants:[["cloud","向中心聚拢"],["band","沿对角斜带分布"],["scatter","均匀散布"]],build:({w:t,h:e,color:n,opacity:o,density:i,count:s,variant:r,random:a})=>{const l=s??Math.round(70*zn[i]),c=[[],[],[]],u=()=>(a()+a()+a()-1.5)/1.5;for(let d=0;d<l;d++){let h,f;if(r==="band"){const m=a();h=t*m,f=e*(1-m)+u()*e*.18}else r==="scatter"?(h=a()*t,f=a()*e):(h=t/2+u()*t/2,f=e/2+u()*e/2);if(h<0||h>t||f<0||f>e)continue;const p=d%3;c[p].push(bt(h,f,Math.min(t,e)*[.012,.007,.004][p]*tt(a,.7,1.4)))}return c.map((d,h)=>({paths:d,fill:n,opacity:[.95,.6,.35][h]*o})).filter(d=>d.paths.length>0)}},{name:"light-streak",label:"光线拖尾",category:"light",summary:"long thin streaks of light fading at both ends, like light trails",usage:"速度感与科技感:几条细长光线沿同一方向掠过页面下部或主体旁边。",variants:[["level","近乎水平"],["rising","向右上扬起"]],build:({w:t,h:e,color:n,color2:o,opacity:i,count:s,variant:r,random:a})=>{const l=s??3;return Array.from({length:l},(c,u)=>{const d=t*tt(a,.55,1),h=e*tt(a,.02,.05),f=e*(.3+.4*u/Math.max(1,l-1)),p=tt(a,0,t-d),m=(r==="rising"?-.25:-.04)*d;return{paths:[Gt([[p,f-m/2],[p+d/2,f-h],[p+d,f+m/2],[p+d/2,f+h]],!0)],fill:{from:u===0?o:n,to:n,radial:!0,fromOpacity:i,toOpacity:0},glow:{color:n,size:5}}})}}],Rl=[{name:"mountains",label:"远山",category:"nature",summary:"layered mountain ridges, paler toward the back; ink fades them like wash, flat stacks sharp terraced peaks, hills rolls them round",usage:"ink 做水墨远山(配纸色底与留白),flat 做国潮的层叠山峦,hills 做清新稿底部的起伏。放在页面下方,宽度铺满;同一颜色由浅到深表现远近。",variants:[["ink","水墨晕染、越远越淡"],["flat","国潮平涂的尖峰层叠"],["hills","圆润起伏的山丘"]],build:({w:t,h:e,color:n,opacity:o,count:i,variant:s,random:r})=>{const a=i??3;return Array.from({length:a},(l,c)=>{const u=(c+1)/a,d=e*(.15+.45*c/a),h=s==="flat"?5:7,f=Array.from({length:h+1},(m,g)=>[t*g/h,d+(g%2?0:e*.22)*tt(r,.4,1)+tt(r,-e*.06,e*.06)]),p=[[...s==="flat"?R(f,!1):Gt(f),Bn(t,e),Bn(0,e),Ie()]];return s==="ink"?{paths:p,fill:{from:n,to:n,angle:90,fromOpacity:(.25+.6*u)*o,toOpacity:.04},softEdge:4}:s==="flat"?{paths:p,fill:n,opacity:(.2+.55*u)*o}:{paths:p,fill:{from:n,to:n,angle:90,fromOpacity:(.15+.5*u)*o,toOpacity:.03*o}}})}},{name:"sea-waves",label:"海浪纹",category:"nature",summary:"the traditional overlapping wave-scale pattern of concentric arcs, row upon row",usage:"国潮与节庆稿的底部纹样,铺在页面下沿或画框里,线色比页面底色深一些即可。",variants:[["scales","青海波:同心半圆层层相叠"]],build:({w:t,h:e,color:n,opacity:o,density:i})=>{const s={sparse:1.8,medium:1.2,dense:.8}[i],r=[],a=([l,c],u,d)=>[u-s,u+s].some(h=>c<=d+s*.5&&Math.hypot(l-h,c-(d+s*.5))<s);for(let l=0,c=0;c<=e+s;l++,c+=s*.5)for(let u=l%2*s;u<=t+s;u+=s*2)for(const d of[1,.72,.44]){let h=[];const f=()=>{h.length>1&&r.push(R(h,!1)),h=[]};for(const p of yi(u,c,s*d,180,360))a(p,u,c)||p[0]<0||p[0]>t||p[1]<0||p[1]>e?f():h.push(p);f()}return[{paths:r,line:n,lineWidth:1.25,opacity:o,fill:null}]}},{name:"window-lattice",label:"圆形窗格",category:"nature",summary:"a round window frame with a lattice inside; diamond turns the lattice by forty-five degrees",usage:"国风与国潮的取景框:里面放标题、远山或节气元素;做主视觉时要大,至少占画面高度的六成。",variants:[["grid","横竖格"],["diamond","斜格"]],build:({w:t,h:e,color:n,opacity:o,density:i,variant:s})=>{const r=Math.min(t,e)/2,a=t/2,l=e/2,c=r*.9,u=c*{sparse:.5,medium:.33,dense:.22}[i],d=[],h=s==="diamond"?45:0;for(let f=-c+u;f<c-1e-6;f+=u){const p=Math.sqrt(c*c-f*f);for(const[m,g]of[[[a+f,l-p],[a+f,l+p]],[[a-p,l+f],[a+p,l+f]]])d.push(R([xi(m,[a,l],h),xi(g,[a,l],h)],!1))}return[{paths:d,line:n,lineWidth:1.5,opacity:.7*o,fill:null},{paths:[bt(a,l,r),bt(a,l,c)],line:n,lineWidth:2.5,opacity:o,fill:null}]}},{name:"seal",label:"印章",category:"nature",summary:"a carved seal with one to four characters reversed out of a solid colour; round draws a round seal",usage:"国风稿的落款或标题旁的点睛:小、一枚就够,字写两到四个,颜色用朱红。",variants:[["square","方印,四字两列"],["round","圆印"]],colors:["primary","#FFFFFF"],text:!0,build:({w:t,h:e,color:n,color2:o,opacity:i,variant:s,text:r})=>{const a=Math.min(t,e),l=[...(r??"印").replace(/\s/gu,"")].slice(0,4),c=l.length===4?[`${l[2]}${l[0]}`,`${l[3]}${l[1]}`]:l.length===3?[l[0],`${l[2]}${l[1]}`]:[l.join("")],u=Math.round(a*28.35*(l.length>=3?.28:l.length===2?.3:.5)*(s==="round"?.85:1)),d={x:(t-a)/2,y:(e-a)/2,w:a,h:a},h=a*.07,f={x:d.x+h,y:d.y+h,w:a-h*2,h:a-h*2};return[{frame:d,preset:s==="round"?"ellipse":"rect",fill:n,opacity:i,text:{text:c.join(`
|
|
4
|
+
`),color:o,size:u,lineSpacing:.85,serif:!0}},{frame:f,preset:s==="round"?"ellipse":"rect",fill:null,line:o,lineWidth:Math.max(.75,a*.4),opacity:.9*i}]}}],jl=[{name:"grid",label:"网格",category:"geometry",summary:"fine grid lines; perspective lays them as a floor running to the horizon",usage:"flat 做瑞士风栅格与科技底纹;perspective 做科技稿下半页的透视地面。线极细极淡。",variants:[["flat","均匀方格"],["perspective","向远处收拢的透视地面"]],build:({w:t,h:e,color:n,opacity:o,density:i,variant:s})=>{const r={sparse:1.6,medium:1,dense:.6}[i],a=[];if(s==="perspective"){const l=[t/2,-e*.6],c=Math.round(t/r);for(let u=-c;u<=c*2;u++){const d=[u*r,e],h=bi(d,[l[0]-d[0],l[1]-d[1]],t,e);h&&a.push(R(h,!1))}for(let u=1;u<=10;u++){const d=e*Math.pow(u/10,1.8);a.push(R([[0,d],[t,d]],!1))}}else{for(let l=0;l<=t+1e-6;l+=r)a.push(R([[l,0],[l,e]],!1));for(let l=0;l<=e+1e-6;l+=r)a.push(R([[0,l],[t,l]],!1))}return[{paths:a,line:n,lineWidth:.75,opacity:.3*o,fill:null}]}},{name:"circuit",label:"电路线",category:"geometry",summary:"circuit traces running in right angles with chamfered turns, ending in nodes",usage:"科技稿的角落与背景;从页边伸进来,节点用亮色,线不要穿过文字。",variants:[["traces","直角走线加节点"]],build:({w:t,h:e,color:n,color2:o,opacity:i,density:s,count:r,random:a})=>{const l=r??Math.round(8*zn[s]),c=Math.min(t,e)/8,u=[],d=[],h=[];for(let f=0;f<l;f++){const p=a()<.5;let m=p?0:t,g=tt(a,c,e-c);const y=[[m,g]],b=2+Math.floor(a()*3);for(let w=0;w<b;w++){const k=tt(a,c,c*3)*(p?1:-1);if(m=Math.max(0,Math.min(t,m+k)),y.push([m,g]),w<b-1){const v=tt(a,-c,c);m=Math.max(0,Math.min(t,m+Math.abs(v)*(p?1:-1))),g=Math.max(0,Math.min(e,g+v)),y.push([m,g])}}u.push(R(y,!1));const x=y[y.length-1];(a()<.5?d:h).push(bt(x[0],x[1],c*.12))}return[{paths:u,line:n,lineWidth:1.25,opacity:.8*i,fill:null},{paths:h,line:o,lineWidth:1.25,opacity:i,fill:null},{paths:d,fill:o,opacity:i,glow:{color:o,size:4}}].filter(f=>f.paths.length>0)}}],Ut=[...Il,...jl,...Ll,...Rl,...Fl];Ut.map(t=>t.name);function wi(t){return t===void 0?void 0:Ut.find(e=>e.name===t)}function Dl(t){const e=wi(t.motif);if(!e)return[];const[n,o]=e.colors??["primary","accent"];return e.build({w:t.w,h:t.h,color:t.color??n,color2:t.color2??o,opacity:t.opacity??1,density:t.density??"medium",count:t.count,variant:t.variant??e.variants[0][0],text:t.text,random:Nl(t.seed??1)})}const Wn=["cover","section","content","data","quote","closing"],Le={cover:null,content:null,section:"cover",quote:"section",closing:"cover",data:"content"};function Re(t,e){const n=typeof e=="string"?e:e.from;return/^#[0-9A-Fa-f]{6}$/u.test(n)?n.toUpperCase():t[n]??t.background}function ki(t,e){const n={},o=[];for(const i of["cover","content","section","data","quote","closing"]){const s=e?.[i],r=(s??(Le[i]?n[Le[i]]:void 0))?.background??(i==="cover"?"dark":"background"),a=Re(t,r),l=s?.text===void 0?void 0:zl(t,s.text),c=s?void 0:Le[i]?n[Le[i]]:void 0,u=l??c?.text??To(t,a);n[i]={background:r,text:u};const d=Fr(t[u],a);d<4.5&&o.push({foreground:u,background:`${i} page`,ratio:Math.round(d*10)/10})}return{pages:n,contrast:o}}const Bl=["text","background","surface","muted","dark","primary","accent"];function zl(t,e){if(!/^#[0-9A-Fa-f]{6}$/u.test(e))return e;const n=s=>[1,3,5].map(r=>Number.parseInt(s.slice(r,r+2),16)),o=n(e),i=s=>n(t[s]).reduce((r,a,l)=>r+(a-o[l])**2,0);return Bl.reduce((s,r)=>i(r)<i(s)?r:s)}const Wl=["rect","roundRect","ellipse","triangle","rtTriangle","diamond","parallelogram","trapezoid","pentagon","hexagon","octagon","chevron","homePlate","rightArrow","leftArrow","upArrow","downArrow","donut","blockArc","arc","pie","chord","star5","star6","plus","flowChartTerminator","snip1Rect","round1Rect","round2SameRect","teardrop","frame","halfFrame","corner"],xt={type:"string",pattern:`^(#[0-9A-Fa-f]{6}|${te.join("|")})$`,description:`A colour role of the design language (${te.join(", ")}) or #RRGGBB. Prefer roles.`},vi={type:"object",properties:{from:xt,to:xt,angle:{type:"number",description:"Degrees; 90 runs top to bottom, 0 left to right."},radial:{type:"boolean",description:"Spread from the centre outwards, like light or a glow."},fromOpacity:{type:"number",minimum:0,maximum:1},toOpacity:{type:"number",minimum:0,maximum:1,description:"Fade the end out to let what lies under it show."}},required:["from","to"],additionalProperties:!1},St=t=>({type:"number",description:t}),Mi={type:"object",properties:{kind:{enum:["text","shape","line","icon","motif","component","image","illustration","chart","table","pageNumber"],description:"text: a text box; shape: a preset shape, filled, outlined, optionally holding text; line: a straight line from x1,y1 to x2,y2; icon: a line icon drawn as an editable shape; motif: an element of the element library drawn in its frame; component: a component of the component library laid out in its frame from content, in the deck's skin; image: a picture the host generates from a prompt, only where the deck view says pictures can be generated; illustration: a picture you draw yourself as SVG, available everywhere; chart; table; pageNumber: the slide number, the same as a text object with role pageNumber."},role:{enum:["eyebrow","title","subtitle","body","number","label","quote","display","small","decoration","pageNumber"],description:"What the object is for. title marks the slide title; display is a statement line at the display size; small is a label or source at the small size; decoration marks shapes and lines that carry no content, which stay still when the slide builds; pageNumber shows the slide number and needs no text. Sets the default size and typeface of its text."},x:St("Left edge in cm from the slide's left."),y:St("Top edge in cm from the slide's top."),w:St("Width in cm."),h:St("Height in cm."),rotation:St("Clockwise rotation in degrees."),text:{type:"string",description:'Text, one paragraph per line. Wrap a key word or figure in ** to set it bold in the emphasis colour, as in "成本降低 **30%**"; with role number, a unit or currency sign beside a figure (42%, 1.2 亿, ¥80) is set at half size on its own.'},size:{type:"number",minimum:6,maximum:400,description:"Text size in points; the design language's size for the role when left out."},color:{...xt,description:"Text colour, or the colour of a line. "+xt.description},font:{enum:["heading","body"]},bold:{type:"boolean"},italic:{type:"boolean"},align:{enum:["left","center","right"]},anchor:{enum:["top","middle","bottom"]},lineSpacing:{type:"number",minimum:.8,maximum:3,description:"Line spacing as a multiple of single spacing."},bullets:{type:"boolean"},shape:{enum:[...Wl]},fill:{anyOf:[xt,vi,{type:"null"}],description:"Fill of a shape or text box: a colour or a gradient; none when left out or null."},opacity:{type:"number",minimum:0,maximum:1,description:"Opacity of a solid fill."},shadow:{enum:["soft","lifted","strong"],description:"Drop shadow of a shape or text box: soft rests on the page, lifted floats above it, strong gives heavy depth."},glow:{type:"object",properties:{color:xt,size:{type:"number",minimum:1,maximum:60,description:"Radius in points."}},required:["color","size"],additionalProperties:!1},softEdge:{type:"number",minimum:1,maximum:100,description:"Blurred edge in points, so a shape melts into the page."},line:{anyOf:[xt,{type:"null"}],description:"Outline colour of a shape; none when left out or null."},lineWidth:{type:"number",exclusiveMinimum:0,maximum:40,description:"Outline width in points; drawn at least 0.25."},radius:{type:"number",minimum:0,maximum:.5,description:"Corner radius of a roundRect as a share of its shorter side."},padding:{type:"number",minimum:0,maximum:5,description:"Inner margin of a shape's text in cm."},x1:St("Line start, cm."),y1:St("Line start, cm."),x2:St("Line end, cm."),y2:St("Line end, cm."),width:{type:"number",exclusiveMinimum:0,maximum:40,description:"Line width in points; drawn at least 0.25."},dash:{enum:["solid","dash","dot"],description:"Dash pattern of a line or of a shape's outline."},arrow:{enum:["none","end","both"]},chart:{enum:["column","bar","line","pie","doughnut","area"]},categories:{type:"array",items:{type:"string"}},highlight:{type:"array",items:{type:"string"},description:"Chart categories, or table rows by their first cell, to pick out: a single series of bars keeps them in full colour and fades the rest; table rows take the emphasis colour."},series:{type:"array",minItems:1,items:{type:"object",properties:{name:{type:"string"},values:{type:"array",items:{type:"number"}}},required:["name","values"],additionalProperties:!1}},icon:{type:"string",description:"Lucide icon name in kebab case, such as shield-check, lock, mail-warning, users, chart-line, lightbulb, map-pin."},motif:{enum:Ut.map(t=>t.name),description:`Element of a motif object, drawn to fill its frame (a frame may run off the slide to crop it): ${Ut.map(t=>`${t.name}: ${t.summary}${t.variants.length>1?` (variants ${t.variants.map(([e])=>e).join(", ")})`:""}`).join("; ")}.`},component:{enum:Fe.map(t=>t.name),description:`Component of a component object, laid out to fill its frame from content in the deck's component skin: ${Fe.map(t=>`${t.name}: ${t.summary}${t.variants.length>1?` (variants ${t.variants.map(([e])=>e).join(", ")})`:""}`).join("; ")}.`},title:{type:"string",description:"A component's content.title, when written beside the component instead."},content:{type:"object",description:"What a component shows; each component names the fields it uses.",properties:{eyebrow:{type:"string"},title:{type:"string",description:"Title; lines separated by line breaks."},accent:{type:"string",description:"Words of the title whose line takes the primary colour."},subtitle:{type:"string"},byline:{type:"string"},text:{type:"string"},from:{type:"string"},sides:{type:"array",minItems:2,maxItems:2,items:{type:"string"},description:"Headings of a comparison's two sides, or a matrix's horizontal axis from low to high."},axes:{type:"array",minItems:2,maxItems:2,items:{type:"string"},description:"A matrix's vertical axis from low to high."},items:{type:"array",minItems:1,maxItems:10,items:{type:"object",properties:{title:{type:"string"},text:{type:"string"},value:{type:"string"},number:{type:"string",description:"Same as value."},label:{type:"string"},icon:{type:"string",description:"Lucide icon name."},highlight:{type:"boolean",description:"The one item that matters most, set apart in the emphasis colour."},parts:{type:"array",items:{type:"string"},description:"Parts of the item, such as the modules of one layer."}},additionalProperties:!1}}},additionalProperties:!1},color2:{...xt,description:"Second colour of a motif. "+xt.description},density:{enum:["sparse","medium","dense"],description:"How densely a motif fills its frame."},count:{type:"integer",minimum:1,maximum:200,description:"Number of repeated units of a motif: rings, blobs, layers, lanterns, figures and the like."},seed:{type:"integer",minimum:1,maximum:9999,description:"Seed of a motif's random arrangement; another seed draws another arrangement."},variant:{type:"string",description:"Variant of a motif, one the motif lists; the first when left out."},prompt:{type:"string",description:"What a generated picture shows: subject, composition, style and mood, in a sentence or two."},svg:{type:"string",description:"An illustration's SVG markup: one <svg> with a viewBox, drawn as a flat illustration of characters, animals, objects or a simple scene. Use round, friendly shapes, a few large colour areas with the deck's hex colours, a darker outline or shading for depth, and expressive eyes for characters; no text, no external images, under 20k characters. Draw a character the same way on every slide it appears. It is kept in proportion inside x, y, w, h."},rows:{type:"array",minItems:2,items:{type:"array",items:{type:"string"}},description:"Table rows of cell text, the first row the header."},area:{type:"object",description:"Place the object on the page grid instead of giving x, y, w and h: columns of the twelve, rows of the band, and edges to bleed on to. The grid follows the design language's margin, so titles and content blocks land in the same place on every slide.",properties:{columns:{type:"array",minItems:2,maxItems:2,items:{type:"integer",minimum:1,maximum:12},description:"First and last column, counted from 1, such as [1, 7] for the left seven twelfths."},rows:{type:"array",minItems:2,maxItems:2,items:{type:"integer",minimum:1,maximum:6},description:"First and last row of the band, counted from 1; the content band has six rows, the title band one. The whole band when left out."},band:{enum:["title","content","page"],description:"title: the title band at the top; content: the content band below it (the default); page: the whole page within its margins."},bleed:{type:"array",items:{enum:["left","right","top","bottom"]},description:"Edges to run on to past the margin, such as the picture side of a split page."}},additionalProperties:!1}},required:["kind"],additionalProperties:!1},qn={anyOf:[xt,vi],description:"Slide background: a colour or a gradient; the background role when left out."},Si=t=>typeof t=="number"&&Number.isFinite(t);function ql(t){const e=["x","y","w","h"].every(n=>Si(t[n]));switch(t.kind){case"pageNumber":return e?{...t,kind:"text",role:"pageNumber",text:""}:"a page number needs x, y, w and h";case"text":return!e||typeof t.text!="string"?t.role==="pageNumber"&&e?{...t,kind:"text",text:""}:"a text object needs x, y, w, h and text":t;case"shape":return!e||typeof t.shape!="string"?"a shape needs x, y, w, h and shape":t;case"line":return["x1","y1","x2","y2"].every(n=>Si(t[n]))?t:"a line needs x1, y1, x2 and y2";case"chart":{const n=t.categories,o=t.series;return!e||typeof t.chart!="string"||!n?.length||!o?.length?"a chart needs x, y, w, h, chart, categories and series":o.every(i=>i.values.length===n.length)?t:"every chart series needs one value per category"}case"icon":return e&&typeof t.icon=="string"?t:"an icon needs x, y, w, h and icon";case"component":{const{title:n,...o}=t;t=o;const i=ui(typeof t.component=="string"?t.component:void 0),s={...typeof n=="string"?{title:n}:{},...t.content??{}};if(!e||!i)return"a component needs x, y, w, h and a component the component library holds";if(t.variant!==void 0&&!i.variants.some(([c])=>c===t.variant))return`the component ${i.name} has the variants ${i.variants.map(([c])=>c).join(", ")}`;const r=i.needs.filter(c=>s[c]===void 0||s[c]==="");if(r.length)return`the component ${i.name} needs content.${r.join(" and content.")}`;const a=Array.isArray(s.items)?s.items.length:0;if(i.items&&(a<i.items[0]||a>i.items[1]))return`the component ${i.name} takes ${i.items[0]} to ${i.items[1]} items`;const l=Array.isArray(s.items)?s.items.map(({number:c,...u})=>c===void 0||u.value!==void 0?u:{...u,value:c}):void 0;return{...t,content:l?{...s,items:l}:s}}case"motif":{const n=wi(typeof t.motif=="string"?t.motif:void 0);return!e||!n?"a motif needs x, y, w, h and a motif the element library holds":t.variant!==void 0&&!n.variants.some(([o])=>o===t.variant)?`the motif ${n.name} has the variants ${n.variants.map(([o])=>o).join(", ")}`:n.text&&(typeof t.text!="string"||!t.text.trim())?`the motif ${n.name} needs text`:{role:"decoration",...t}}case"image":return e&&typeof t.prompt=="string"&&t.prompt.trim()?t:"an image needs x, y, w, h and prompt";case"illustration":return e&&typeof t.svg=="string"&&t.svg.trim()?t:"an illustration needs x, y, w, h and svg";case"table":return e&&Array.isArray(t.rows)&&t.rows.length>=2?t:"a table needs x, y, w, h and at least two rows";default:return`there is no object kind ${JSON.stringify(t.kind)}`}}function $i(t){if(typeof t=="string"||t&&typeof t=="object"&&"from"in t&&"to"in t)return t}const Ci={display:54,title:32,subtitle:20,body:18,small:12},Gl={background:"The colour most pages sit on, decided for the subject: white, warm paper, deep red, ink, a saturated brand colour. Never assumed.",surface:"Panels and cards on the page colour.",text:"Running text on the page colour.",muted:"Secondary text: labels, sources, captions.",dark:"A page colour that contrasts the main one, for strong beats: deep on a light deck, the brand colour or a deeper shade on a dark one.",primary:"The colour that leads the deck.",accent:"The one sharp colour that marks what matters.",data3:"Third chart colour.",data4:"Fourth chart colour.",data5:"Fifth chart colour.",data6:"Sixth chart colour."},Ul={type:"string",pattern:"^#[0-9A-Fa-f]{6}$"},Ti={anyOf:[{type:"string",minLength:1,description:"Family for Chinese and Latin text."},{type:"object",properties:{chinese:{type:"string",minLength:1,description:"Family for Chinese text."},family:{type:"string",minLength:1,description:"Same as chinese."},latin:{type:"string",description:"Family for Latin text; the Chinese one when left out."},weight:{type:"string",description:"Not used: weight is set per text object."}},anyOf:[{required:["chinese"]},{required:["family"]}],additionalProperties:!1}]},Pi={type:"object",properties:{name:{type:"string",minLength:1,description:"Short name of the direction."},style:{enum:[...di],description:"Key of the style card from the style-library skill this design follows. Leave it out only for a style of the designer's own, such as one described by the user that no card fits."},blend:{enum:[...di],description:"Key of a second style card whose elements or page treatment are blended in."},palette:{type:"object",properties:Object.fromEntries(te.map(t=>[t,{...Ul,description:Gl[t]}])),required:["primary","background"],additionalProperties:!1},pages:{type:"object",description:"What each kind of page sits on, decided for this deck: a colour role, #RRGGBB or a gradient, and the text role that reads on it. Describe the cover and content pages at least; section, quote and closing pages follow the cover and data pages the content page unless given. Content pages need not be light: a red civic deck, a dark tech deck or a saturated kids' deck keeps its colour on content pages too.",properties:Object.fromEntries(Wn.map(t=>[t,{type:"object",properties:{background:qn,text:{type:"string",pattern:`^(#[0-9A-Fa-f]{6}|${te.join("|")})$`,description:"Text colour on the page: a colour role, or #RRGGBB, which takes the palette role closest to it."}},required:["background"],additionalProperties:!1}])),required:["cover","content"],additionalProperties:!1},fonts:{type:"object",properties:{heading:Ti,body:Ti},required:["heading","body"],additionalProperties:!1},type:{type:"object",properties:Object.fromEntries(Object.keys(Ci).map(t=>[t,{type:"number",minimum:8,maximum:200,description:`${t} size in points.`}])),additionalProperties:!1},margin:{type:"number",minimum:0,maximum:6,description:"Page margin in centimetres."},motif:{type:"string",minLength:1,description:"The recurring visual element and how it appears on each kind of slide."},imagery:{type:"string",description:"How pictures are used: photos, illustration, icons or none, and how they are cropped."},rhythm:{type:"string",description:"How the deck moves between kinds of page and where its strong beats fall."},motion:{enum:Object.keys(Ne),description:"Way of moving that applyMotion follows: calm fades for reports, keynote for launches with slow fades through black, drawn wipes for hand-drawn looks, playful bounces, technical short wipes, ink long dissolves, structural pushes along the grid, print pages covering one another."},skin:{type:"object",description:"How components draw, kept the same across the deck; the style card's skin for any field left out. radius: card corners; depth: flat, shadow, lifted, glass, outline or a glowing outline; card: surface fill, a light tint of the primary colour, or none; badge: shape of number and icon badges; header: content page titles plain, on a full-width band or after a colour chip; byline: plain, a pill or a short rule; numbers: 1, 01 or 一.",properties:Object.fromEntries(Object.entries(pi).map(([t,e])=>[t,{enum:[...e]}])),additionalProperties:!1},custom:{type:"object",description:"A style card of the deck's own, distilled from a reference picture, a template or the user's description when no library card fits; leave style out when giving it. Record the style only, never a reference's layout, pictures, text or brand.",properties:{name:{type:"string",minLength:1},idea:{type:"string",minLength:1,description:"The design claim in one sentence."},hero:{type:"string",minLength:1,description:"The hero visual: what it is and how it is drawn, with shapes and motifs or as a generated picture."},picture:{type:"string",description:"Style words for generated pictures."},elements:{type:"array",items:{type:"string"},description:"Element vocabulary: geometry, lines, textures, glyphs, symbols."},motifs:{type:"array",items:{enum:Ut.map(t=>t.name)},description:"Element library motifs that suit it."},taboos:{type:"array",items:{type:"string"}},source:{type:"string",description:"Where it came from, in a few words."}},required:["name","idea","hero","elements"],additionalProperties:!1},aspect:{enum:["16:9","9:16"],description:"Page shape: 9:16 for phone-first cards and vertical video. The deck keeps its shape when left out."}},required:["name","palette","pages","fonts","motif"],additionalProperties:!1},je="QuireKit.Theme",De=33.867;function Hl(t){const e=ht(t)[je];if(e===void 0)return null;try{const n=JSON.parse(e);return!n||typeof n.palette?.primary!="string"||typeof n.fonts?.heading?.chinese!="string"?null:n.pages?n:{...n,pages:ki(n.palette,void 0).pages}}catch{return null}}function Ei(t,e){const{palette:n,fonts:o}=e;Jo(t,{dark1:n.text,light1:n.background,dark2:n.dark,light2:n.surface,accent1:n.primary,accent2:n.accent,accent3:n.data3,accent4:n.data4,accent5:n.data5,accent6:n.data6,hyperlink:n.primary,followedHyperlink:n.muted,name:e.name}),Pa(t,{majorLatin:o.heading.latin,majorEastAsian:o.heading.chinese,minorLatin:o.body.latin,minorEastAsian:o.body.chinese}),Et(t,je,JSON.stringify(e))}function Be(t,e=De){const{palette:n,contrast:o}=jr(t.palette),{pages:i,contrast:s}=ki(n,t.pages),r=[...o,...s],a=u=>{if(typeof u=="string")return{chinese:u,latin:u};const d=u.chinese??u.family??"";return{chinese:d,latin:u.latin?.trim()||d}},l=e/De,c=Object.fromEntries(Object.entries(Ci).map(([u,d])=>[u,t.type?.[u]??Math.round(d*l)]));return{name:t.name,...t.style?{style:t.style}:{},...t.blend&&t.blend!==t.style?{blend:t.blend}:{},palette:n,contrast:r,pages:i,fonts:{heading:a(t.fonts.heading),body:a(t.fonts.body)},type:c,margin:t.margin??Math.round(e*.056*10)/10,motif:t.motif,imagery:t.imagery??"",rhythm:t.rhythm??"",motion:t.motion??"calm",skin:fi(t.style,t.skin),...t.custom&&!t.style?{custom:t.custom}:{}}}const _l={name:"designLanguage",addCommands:()=>({setDeckDesign:Wt({description:"Records the deck's design language, decided for this deck's subject, audience and the user's words: colour roles, typefaces, type sizes, margin, the recurring motif, the use of pictures and the rhythm across slide kinds. Give the primary colour and any role you have decided; the rest are derived from the primary in a perceptual colour space and text roles are adjusted until running text reads. Theme colours and fonts follow it, so tables, charts and new objects match. Write it before drawing slides and again, whole, to change direction.",params:Pi,category:"design",satisfied:(t,e)=>{const n=Pt(e.presentation);return ht(e.presentation)[je]===JSON.stringify(Be(t,n?n.width/36e4:De))},run:t=>({presentation:e,dispatch:n})=>{const o=Pt(e),i=o&&t.aspect!==void 0&&t.aspect==="9:16"!=o.height>o.width,s=o?Math.max(o.width,o.height):0,r=Math.round(s*9/16),a=Be(t,o?(i?t.aspect==="9:16"?r:s:o.width)/36e4:De),l=JSON.stringify(a);return!i&&ht(e)["QuireKit.Theme"]===l?!1:(n&&(i&&Ee(e,t.aspect==="9:16"?{width:B(r),height:B(s)}:{width:B(s),height:B(r)}),Ei(e,a)),!0)}})})},Vl=["column","bar","line","pie","doughnut","area","scatter","radar"];function ze(t,e=[]){return t==="pie"||t==="doughnut"?{kind:t,varyColors:!0,categories:["第一季度","第二季度","第三季度","第四季度"],series:[{name:"销售额",values:[8.2,3.2,1.4,1.2],...e.length>=4?{pointColors:e.slice(0,4)}:{}}]}:t==="scatter"?{kind:t,series:[{name:"Y 值",xValues:[.7,1.8,2.6],values:[2.7,3.2,.8]}]}:{kind:t,categories:["类别 1","类别 2","类别 3","类别 4"],series:[{name:"系列 1",values:[4.3,2.5,3.5,4.5]},{name:"系列 2",values:[2.4,4.4,1.8,2.8]},{name:"系列 3",values:[2,2,3,5]}]}}function Ai(t,e){const n=t.series?.[0]??{},o=t.kind==="pie"||t.kind==="doughnut",i=e.series.map((r,a)=>({...o&&a===0&&n.pointColors?{pointColors:n.pointColors}:{},name:r.name,values:[...r.values]})),s=o||i.length>1?{legend:{position:"b"}}:{};return{...t,categories:[...e.categories],series:i,...s}}function Kl(t,e,n){const o=Ai(ze(t,n),e);return o.kind==="pie"||o.kind==="doughnut"||n.length===0?o:{...o,series:o.series.map((i,s)=>({...i,color:n[s%n.length]}))}}const Yl={name:"insert",addCommands:()=>({addChart:Wt({description:"Adds a chart drawn in the theme's accent colours, with its categories and the values of each series, at a position and size in centimetres. The chart keeps its data, so it can be edited later.",params:{type:"object",properties:{kind:{enum:["column","bar","line","pie","doughnut","area"],description:"column: vertical bars; bar: horizontal bars; pie and doughnut take one series."},categories:{type:"array",minItems:1,items:{type:"string"},description:"Category labels in order, such as months."},series:{type:"array",minItems:1,items:{type:"object",properties:{name:{type:"string"},values:{type:"array",items:{type:"number"},description:"One value per category."}},required:["name","values"],additionalProperties:!1}},x:{type:"number"},y:{type:"number"},width:{type:"number",exclusiveMinimum:0},height:{type:"number",exclusiveMinimum:0}},required:["kind","categories","series","x","y","width","height"],additionalProperties:!1},target:"slide",category:"charts",adapt:(t,e)=>{const{kind:n,categories:o,series:i,x:s,y:r,width:a,height:l}=t;return e.slide===null||i.some(c=>c.values.length!==o.length)?null:{slide:e.slide,kind:n,x:we(s),y:we(r),width:we(a),height:we(l),data:{categories:o,series:i}}},run:t=>({presentation:e,dispatch:n})=>{const o=xe(e,t.slide);if(o===null||t.width<=0||t.height<=0||t.data&&t.data.series.some(r=>r.values.length!==t.data.categories.length))return!1;const i=ee(e),s=i?[i.accent1,i.accent2,i.accent3,i.accent4]:[];return n&&No(o,{spec:t.data?Ai(ze(t.kind,s),t.data):ze(t.kind,s),x:B(t.x),y:B(t.y),w:B(t.width),h:B(t.height)}),!0}}),addMedia:t=>({presentation:e,dispatch:n})=>{const o=xe(e,t.slide);if(o===null||t.bytes.length===0||t.width<=0||t.height<=0)return!1;if(!n)return!0;try{return Gr(o,{kind:t.kind,data:t.bytes,x:B(t.x),y:B(t.y),w:B(t.width),h:B(t.height),...t.name===void 0?{}:{name:t.name}}),!0}catch{return!1}},setShapeLink:t=>({presentation:e,dispatch:n})=>{const o=t.shapes.map(i=>ye(e,t.slide,i));if(o.length===0||o.some(i=>i===null||ne(i)==="group")||t.url!==null&&!/^(https?:|mailto:)/iu.test(t.url.trim()))return!1;if(n)for(const i of o)Oa(i,t.url===null?null:{kind:"url",url:t.url.trim()});return!0}})},ct=36e4,ut=12700,We={background:"lt1",surface:"lt2",text:"dk1",dark:"dk2",primary:"accent1",accent:"accent2",data3:"accent3",data4:"accent4",data5:"accent5",data6:"accent6"};function et(t,e,n=!1){if(/^#[0-9A-Fa-f]{6}$/u.test(e))return e.toUpperCase();const o=e;return!t||!(o in t.palette)?null:n||!We[o]||t.literal?.includes(o)?t.palette[o]:We[o]}const Ht=t=>B(Math.round(t*ct));function qe(t,e,n,o){if(n==null){Te(e);return}if(typeof n=="string"){const s=et(t.design,n);s&&Qo(e,o===void 0?s:{color:s,opacity:o});return}const i=Oi(t.design,n);i&&En(e,i)}function Oi(t,e){const n=et(t,e.from,!0),o=et(t,e.to,!0);return!n||!o?null:{stops:[{offset:0,color:n,...e.fromOpacity===void 0?{}:{opacity:e.fromOpacity}},{offset:1,color:o,...e.toOpacity===void 0?{}:{opacity:e.toOpacity}}],...e.radial?{path:"circle"}:{angleDeg:e.angle??90}}}function Gn(t,e,n){const o={soft:{blur:18,offset:4,opacity:.12},lifted:{blur:36,offset:12,opacity:.18},strong:{blur:24,offset:10,opacity:.35}};if(n.shadow){const s=o[n.shadow];Ra(e,{color:"#000000",blurEmu:s.blur*ut,offsetEmu:s.offset*ut,angleDeg:90,opacity:s.opacity})}const i=n.glow&&et(t.design,n.glow.color,!0);i&&n.glow&&Na(e,{color:i,radiusEmu:Math.round(n.glow.size*ut)}),n.softEdge&&ja(e,Math.round(n.softEdge*ut))}const At=t=>({x:Ht(t.x),y:Ht(t.y),w:B(Math.max(1,Math.round(t.w*ct))),h:B(Math.max(1,Math.round(t.h*ct)))});function Fi(t){const{design:e}=t,n=t.paper??e?.palette.background??"#FFFFFF",o=et(e,t.ink,!0)??"#1F2328";return{paper:n,ink:o,emphasis:e?et(e,gn(e,n).emphasis,!0)??o:o,muted:be(o,n,.4),hair:be(o,n,.82),face:e?.fonts.body,body:e?.type.body??16,small:e?.type.small??12}}const Xl=12;function Zl(t,e){const{design:n}=t,o=Fi(t),i=n?[n.palette.primary,n.palette.accent,n.palette.data3,n.palette.data4,n.palette.data5,n.palette.data6]:[],s=Kl(e.chart,{categories:e.categories,series:e.series},i),r=o.face?.chinese,a={...r?{font:r}:{},sizePt:o.small,color:o.muted},l={...a,color:o.ink,bold:!0},c={showValue:!1,showCategory:!1,showSeriesName:!1,showPercent:!1},u=new Set(e.highlight??[]),d=e.series.length>1,h={legend:{position:"b",textStyle:a}};if(e.chart==="pie"||e.chart==="doughnut"){const y=s.series.map(b=>({...b,lineColor:o.paper,lineWidthEmu:Math.round(1.5*ut)}));return{...s,series:y,chartAreaFill:o.paper,legend:{position:null},dataLabels:{...c,showCategory:!0,showPercent:!0,position:e.chart==="pie"?"outEnd":void 0,separator:`
|
|
5
|
+
`,textStyle:l},...e.chart==="doughnut"?{holeSizePct:62}:{}}}const f=e.chart==="column"||e.chart==="bar",p=f&&!d&&e.categories.length<=Xl,m=String(s.series[0]?.color??o.emphasis),g=s.series.map(y=>({...y,...e.chart==="line"?{lineWidthEmu:Math.round(2.25*ut),markerSymbol:"circle",markerSizePt:6,markerColor:y.color,markerLineColor:o.paper,smooth:!1}:{},...f&&!d&&u.size?{pointColors:e.categories.map(b=>u.has(b)?m:be(m,o.paper,.6))}:{}}));return{...s,series:g,chartAreaFill:o.paper,...d?h:{legend:{position:null}},categoryAxisLabelStyle:a,categoryAxisLineColor:o.hair,categoryAxisMajorTickMark:"none",valueAxisLabelStyle:a,valueAxisLineHidden:!0,valueAxisMajorTickMark:"none",valueAxisMajorGridlines:!p,valueAxisMajorGridlineColor:o.hair,valueAxisMajorGridlineWidthEmu:Math.round(.5*ut),...p?{valueAxisHidden:!0,dataLabels:{...c,showValue:!0,position:"outEnd",textStyle:l}}:{},...f?{gapWidthPct:70}:{},...(f||e.chart==="area")&&e.series.every(y=>y.values.every(b=>b>=0))?{valueAxis:{min:0}}:{}}}const Ni=8e4,Un=new Uint8Array([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,6,0,0,0,31,21,196,137,0,0,0,11,73,68,65,84,120,156,99,96,0,2,0,0,5,0,1,122,94,171,63,0,0,0,0,73,69,78,68,174,66,96,130]);function Jl(t){return t.length===Un.length&&t.every((e,n)=>e===Un[n])}function Ql(t){const e=t.trim().replace(/^<\?xml[^>]*>\s*/u,"");if(!/^<svg[\s>]/u.test(e)||!/<\/svg>\s*$/u.test(e))return{problem:"an illustration's svg must be one <svg>…</svg> element"};if(e.length>Ni)return{problem:`an illustration's svg must stay under ${Ni/1e3}k characters; draw fewer, larger shapes`};if(!Ii(e))return{problem:`an illustration's svg needs a viewBox, such as viewBox="0 0 400 300"`};const n=e.replace(/<script\b[\s\S]*?<\/script\s*>/giu,"").replace(/<foreignObject\b[\s\S]*?<\/foreignObject\s*>/giu,"").replace(/\son[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/giu,"").replace(/\s(?:xlink:)?href\s*=\s*("(?!#)[^"]*"|'(?!#)[^']*'|(?!["'#])[^\s>]+)/giu,"").replace(/@import\b[^;]*;?/giu,"").replace(/url\(\s*(["']?)(?!#)[^)]*\)/giu,"none");return{svg:/^<svg[^>]*\sxmlns=/u.test(n)?n:n.replace(/^<svg/u,'<svg xmlns="http://www.w3.org/2000/svg"')}}function Ii(t){const e=/<svg[^>]*\sviewBox\s*=\s*["']([^"']+)["']/u.exec(t)?.[1]?.trim().split(/[\s,]+/u).map(Number);return!e||e.length!==4||e.some(n=>!Number.isFinite(n))||e[2]<=0||e[3]<=0?null:{width:e[2],height:e[3]}}function tc(t,e){const n=Math.min(t.w/e.width,t.h/e.height),o=e.width*n,i=e.height*n;return{...t,x:t.x+(t.w-o)/2,y:t.y+(t.h-i)/2,w:o,h:i}}const ec=/^[\s+\-−±~≈约≤≥<>]*[[【((]?[\d.,X×x]*[\dX][\d.,X×x]*[\]】))]?\s*(?:%|‰|[A-Za-z]{1,3}|[万亿千百元倍个家人次天年月日点]{1,2})?[\s↑↓▲▼]*$/u;function nc(t,e,n,o=[]){const i=Fi(t),s=zr.find(h=>h.name==="No Style, No Grid");Qa(e,s?s.id:null);const r=Math.max(10,Math.round(i.body*.85)),a=i.face?{font:i.face.latin,fontEastAsian:i.face.chinese}:{},l=Math.max(...n.map(h=>h.length)),c=Array.from({length:l},(h,f)=>{const p=n.slice(1).map(m=>m[f]?.trim()??"").filter(Boolean);return f>0&&p.length>0&&p.filter(m=>ec.test(m)).length*3>=p.length*2}),u=(h,f)=>({color:h,widthEmu:Math.round(f*ut),dash:"solid"}),d=be(i.emphasis,i.paper,.88);n.forEach((h,f)=>{const p=f===0,m=f===n.length-1,g=!p&&o.includes(h[0]?.trim()??"");for(let y=0;y<h.length;y++){const b=wa(e,f,y);g&&Xa(b,d),Ya(b,{left:null,right:null,top:p?u(i.ink,1.25):null,bottom:p?u(i.emphasis,1.5):m?u(i.ink,1.25):u(i.hair,.5)}),Za(b,{left:Math.round(.2*ct),right:Math.round(.2*ct),top:Math.round(.1*ct),bottom:Math.round(.1*ct)}),Ka(b,"center"),Va(b,c[y]?"right":"left"),Ja(b,{...a,size:r,bold:p||g,color:p||g?i.emphasis:i.ink})}})}const oc=/^([¥$€£]?)([+\-−]?[\d.,X×x]*[\dX][\d.,]*)\s*(%|‰|[A-Za-z]{1,3}|[一-鿿]{1,2})?$/u,ic=.5;function Hn(t){const e=[];let n="",o=t;for(;;){const i=o.indexOf("**"),s=i<0?-1:o.indexOf("**",i+2);if(s<0||o.slice(i+2,s).includes(`
|
|
6
|
+
`)||s===i+2){n+=o;break}n+=o.slice(0,i),e.push({start:n.length,end:n.length+s-i-2}),n+=o.slice(i+2,s),o=o.slice(s+2)}return{text:n,strong:e}}function sc(t){const e=oc.exec(t);if(!e)return[];const n=[];return e[1]&&n.push({start:0,end:e[1].length}),e[3]&&n.push({start:t.length-e[3].length,end:t.length}),n}function rc(t){switch(t){case"title":return{step:"title",font:"heading",bold:!0};case"subtitle":return{step:"subtitle",font:"body",bold:!1};case"eyebrow":case"label":case"pageNumber":return{step:"small",font:"body",bold:t==="eyebrow"};case"number":return{step:"display",font:"heading",bold:!0,scale:1.4};case"quote":return{step:"subtitle",font:"heading",bold:!0,scale:1.4};case"display":return{step:"display",font:"heading",bold:!0};case"small":return{step:"small",font:"body",bold:!1};default:return{step:"body",font:"body",bold:!1}}}const ac=t=>t.ink==="text"?"muted":t.ink;function _n(t,e,n,o){const{design:i}=t,s=rc(o),r=i?.fonts[n.font??s.font],a=n.size??(i?Math.round(i.type[s.step]*(s.scale??1)):18),l=n.color??(o==="label"||o==="small"||o==="pageNumber"?ac(t):t.ink);Fn(e,"square"),zt(e,{size:a,bold:n.bold??s.bold,italic:n.italic??!1,color:et(i,l)??"dk1",...r?{font:r.latin,fontEastAsian:r.chinese}:{}}),Tn(e,n.align??"left"),On(e,n.anchor==="middle"?"center":n.anchor??"top"),n.bullets&&Aa(e,{char:"•"});const c=Hn(n.text??""),u=n.lineSpacing;if(u&&c.text.split(`
|
|
7
|
+
`).forEach((f,p)=>Zo(e,p,{kind:"pct",value:u})),o==="pageNumber"){za(e,"slidenum",{text:String(t.number)});return}const d=gn(i,t.paper).emphasis,h=d===l?null:et(i,d);for(const f of c.strong)zt(e,{bold:!0,...h?{color:h}:{}},{range:f});if(o==="number")for(const f of sc(c.text))zt(e,{size:Math.max(8,Math.round(a*ic))},{range:f})}const Li="AI 配图生成中…";function Ri(t,e,n,o){pt(e,n),qe(t,e,t.design?"surface":"#E9ECEF"),oi(e,Li),_n(t,e,{text:Li,align:"center",anchor:"middle"},"small"),Fa(e,o)}function lc(t,e,n){const o=Dl({...e,w:e.w,h:e.h}).flatMap(s=>cc(t,e,s,n)??[]);if(o.length===0)return;const i=o.length===1?o[0]:Ko(o,{name:n("motif")});o.length===1&&pt(i,n("motif")),e.rotation&&ie(i,e.rotation)}function cc(t,e,n,o){const i=n.frame??{x:0,y:0,w:e.w,h:e.h},s=l=>l===void 0?void 0:Math.max(0,Math.min(1,l));if(n={...n,opacity:s(n.opacity),...n.fill&&typeof n.fill=="object"?{fill:{...n.fill,...n.fill.fromOpacity===void 0?{}:{fromOpacity:s(n.fill.fromOpacity)},...n.fill.toOpacity===void 0?{}:{toOpacity:s(n.fill.toOpacity)}}}:{}},!n.preset&&!n.paths?.some(l=>l.length>1))return null;const r=jt(t.slide,{preset:n.preset??"rect",...At({x:e.x+i.x,y:e.y+i.y,w:i.w,h:i.h}),...n.text?{text:n.text.text}:{}});if(pt(r,o("motif-part")),n.paths){const l=Math.max(1,Math.round(i.w*ct)),c=Math.max(1,Math.round(i.h*ct)),u=h=>({x:Math.round(h.x*ct),y:Math.round(h.y*ct)}),d=n.paths.filter(h=>h.length>1).flat().map(h=>h.kind==="moveTo"||h.kind==="lnTo"?{kind:h.kind,pt:u(h.pt)}:h.kind==="cubicBezTo"?{kind:h.kind,pts:h.pts.map(u)}:h.kind==="quadBezTo"?{kind:h.kind,pts:h.pts.map(u)}:h);Pn(r,{paths:[{w:l,h:c,...n.fill?{}:{fill:"none"},commands:d}]})}n.preset==="roundRect"&&Ce(r,{adj:8e3}),qe(t,r,n.fill,n.opacity);const a=n.line?et(t.design,n.line):null;if(a?(Pe(r,{color:a,widthEmu:Math.round((n.lineWidth??1)*ut),...n.opacity===void 0||n.fill?{}:{opacity:n.opacity}}),n.dash&&An(r,n.dash),ei(r,"rnd"),ni(r,"round")):oe(r),Gn(t,r,{...n.glow?{glow:n.glow}:{},...n.softEdge?{softEdge:n.softEdge}:{}}),n.text){const l=n.text.serif?{latin:"Songti SC",chinese:"Songti SC"}:t.design?.fonts.heading;Fn(r,"square"),se(r,{left:0,right:0,top:0,bottom:0}),zt(r,{size:n.text.size,bold:!n.text.serif,color:et(t.design,n.text.color)??"lt1",...l?{font:l.latin,fontEastAsian:l.chinese}:{}}),Tn(r,"center"),On(r,"center");const c=n.text.lineSpacing;c&&n.text.text.split(`
|
|
8
|
+
`).forEach((u,d)=>Zo(r,d,{kind:"pct",value:c}))}return r}function ji(t,e,n){const{slide:o,design:i}=t,s=r=>t.name(n,"role"in e?e.role:void 0,r);switch(e.kind){case"text":{const r=Hr(o,{...At(e),text:Hn(e.text).text});pt(r,s("text")),se(r,{left:0,right:0,top:0,bottom:0}),qe(t,r,e.fill),_n(t,r,e,e.role),Gn(t,r,e),e.rotation&&ie(r,e.rotation);return}case"shape":{const r=jt(o,{preset:e.shape,...At(e),...e.text?{text:Hn(e.text).text}:{}});pt(r,s("shape")),qe(t,r,e.fill,e.opacity);const a=e.line===void 0||e.line===null?null:et(i,e.line);if(a?(Pe(r,{color:a,widthEmu:Math.round(Math.max(.25,e.lineWidth??1)*ut)}),e.dash&&e.dash!=="solid"&&An(r,e.dash)):oe(r),e.shape==="roundRect"&&Ce(r,{adj:Math.round(Math.min(.5,e.radius??.12)*1e5)}),e.text){const l=Math.round((e.padding??.3)*ct);se(r,{left:l,right:l,top:l,bottom:l}),_n(t,r,e,e.role)}Gn(t,r,e),e.rotation&&ie(r,e.rotation);return}case"line":{const r=et(i,e.color??"muted")??"dk1",a=qr(o,{from:{x:Ht(e.x1),y:Ht(e.y1)},to:{x:Ht(e.x2),y:Ht(e.y2)},color:r,widthEmu:Math.round(Math.max(.25,e.width??1.5)*ut)});pt(a,s("line")),e.dash&&e.dash!=="solid"&&An(a,e.dash),(e.arrow==="end"||e.arrow==="both")&&ti(a,"tail",{type:"triangle"}),e.arrow==="both"&&ti(a,"head",{type:"triangle"});return}case"icon":{if(!e.paths?.length)return;const r=Math.min(e.w,e.h),a=jt(o,{preset:"rect",...At({x:e.x+(e.w-r)/2,y:e.y+(e.h-r)/2,w:r,h:r})});pt(a,s("icon")),Pn(a,{paths:e.paths}),Te(a),Pe(a,{color:et(i,e.color??"primary")??"accent1",widthEmu:Math.round((e.lineWidth??r/12*28.35)*ut)}),ei(a,"rnd"),ni(a,"round"),e.rotation&&ie(a,e.rotation);return}case"motif":lc(t,e,s);return;case"component":{const r=ui(e.component);if(!r)return;const a={design:i,skin:Tl(i),ink:t.ink,...gn(i,t.paper)},l={x:e.x,y:e.y,w:e.w,h:e.h};for(const c of r.build(a,l,e.content,e.variant??r.variants[0][0]))ji(t,c,n);return}case"image":{const r=jt(o,{preset:e.radius?"roundRect":"rect",...At(e)});oe(r),e.radius&&Ce(r,{adj:Math.round(Math.min(.5,e.radius)*1e5)}),Ri(t,r,s("image"),e.prompt);return}case"illustration":{const r=jt(o,{preset:"rect",...At(tc(e,Ii(e.svg)??{width:e.w,height:e.h}))});pt(r,s("illustration")),oe(r),La(r,Un,{svg:new TextEncoder().encode(e.svg)});return}case"chart":pt(No(o,{spec:Zl(t,e),...At(e)}),s("chart"));return;case"table":{const r=Ur(o,{...At(e),rows:e.rows.map(a=>[...a]),firstRow:!0,bandRow:!1});pt(r,s("table")),nc(t,r,e.rows,e.highlight);return}}}const Di="qk:draw:";function Bi(t,e,n,o,i,s="text"){if(typeof n=="string"){const a=et(e,n,!0);a&&qa(t,a)}else if(n){const a=Oi(e,n);a&&Ga(t,a)}const r=zi(t,e,i,s,n);o.forEach((a,l)=>ji(r,a,l))}function zi(t,e,n,o="text",i){let s=0;return{slide:t,design:e,number:n,ink:o,paper:e?Re(e.palette,i??"background"):void 0,name:(r,a,l)=>`${Di}e${r+1}-${a==="pageNumber"?"page":a??"body"}:${a==="decoration"&&l!=="image"?"decoration":a==="pageNumber"?"page-number":l}:${++s}`}}const uc=.02,dc=.056,hc=32,pc=.0353,fc=1.3,Wi=36e4;function mc(t,e,n,o){const i=Math.round((n??t*dc)*100)/100,s=Math.round(t*uc*100)/100,r=(t-i*2-s*11)/12,a={y:i,h:Math.round((o??hc)*pc*fc*1.5*100)/100},l=a.y+a.h+i/2;return{width:t,height:e,margin:i,gutter:s,column:r,title:a,content:{y:l,h:e-i-l},page:{y:i,h:e-i*2}}}function qi(t,e,n){const o=Pt(t);return mc(o?o.width/Wi:33.867,o?o.height/Wi:19.05,e,n)}function gc(t,e){const n=e.band??"content",o=n==="content"?6:1,i=(m,g,y)=>{if(m===void 0)return[1,g];if(!Array.isArray(m)||m.length!==2||!m.every(Number.isInteger))return`area.${y} must be two whole numbers, the first and the last ${y.slice(0,-1)}`;const[b,x]=m;return b<1||x>g||b>x?`area.${y} runs from 1 to ${g}, the first no greater than the last`:[b,x]},s=i(e.columns,12,"columns"),r=i(e.rows,o,"rows");if(typeof s=="string")return s;if(typeof r=="string")return r;const a=t[n],l=(a.h-t.gutter*(o-1))/o;let c=t.margin+(s[0]-1)*(t.column+t.gutter),u=t.margin+s[1]*(t.column+t.gutter)-t.gutter,d=a.y+(r[0]-1)*(l+t.gutter),h=a.y+r[1]*(l+t.gutter)-t.gutter;const f=new Set(e.bleed??[]);f.has("left")&&(c=0),f.has("right")&&(u=t.width),f.has("top")&&(d=0),f.has("bottom")&&(h=t.height);const p=m=>Math.round(m*100)/100;return{x:p(c),y:p(d),w:p(u-c),h:p(h-d)}}function yc(t){const e=n=>`${Math.round(n*10)/10}`;return`page ${e(t.width)}×${e(t.height)} cm, margin ${e(t.margin)}, 12 columns of ${e(t.column)} with ${e(t.gutter)} gutters, title band y ${e(t.title.y)}–${e(t.title.y+t.title.h)}, content band y ${e(t.content.y)}–${e(t.content.y+t.content.h)} in 6 rows`}const Vn=1e3,Gi=24*Vn,Lt=t=>({x:t.x*Vn,y:t.y*Vn});function bc(t,e,n,o,i,s,r){if(e===0||n===0)return[[t,r,r]];const a=o*Math.PI/180,l=Math.cos(a),c=Math.sin(a),u=(t.x-r.x)/2,d=(t.y-r.y)/2,h=l*u+c*d,f=-c*u+l*d;let p=Math.abs(e),m=Math.abs(n);const g=h*h/(p*p)+f*f/(m*m);g>1&&(p*=Math.sqrt(g),m*=Math.sqrt(g));const y=(i===s?-1:1)*Math.sqrt(Math.max(0,(p*p*m*m-p*p*f*f-m*m*h*h)/(p*p*f*f+m*m*h*h))),b=y*p*f/m,x=-y*m*h/p,w=l*b-c*x+(t.x+r.x)/2,k=c*b+l*x+(t.y+r.y)/2,v=(I,K,D,Ct)=>Math.atan2(I*Ct-K*D,I*D+K*Ct),M=v(1,0,(h-b)/p,(f-x)/m);let $=v((h-b)/p,(f-x)/m,(-h-b)/p,(-f-x)/m);!s&&$>0&&($-=2*Math.PI),s&&$<0&&($+=2*Math.PI);const N=Math.max(1,Math.ceil(Math.abs($)/(Math.PI/2))),U=$/N,J=4/3*Math.tan(U/4),lt=I=>({x:w+p*Math.cos(I)*l-m*Math.sin(I)*c,y:k+p*Math.cos(I)*c+m*Math.sin(I)*l}),gt=I=>({x:-p*Math.sin(I)*l-m*Math.cos(I)*c,y:-p*Math.sin(I)*c+m*Math.cos(I)*l}),G=[];for(let I=0;I<N;I+=1){const K=M+U*I,D=K+U,Ct=lt(K),Nt=lt(D),Tt=gt(K),ge=gt(D);G.push([{x:Ct.x+J*Tt.x,y:Ct.y+J*Tt.y},{x:Nt.x-J*ge.x,y:Nt.y-J*ge.y},I===N-1?r:Nt])}return G}function xc(t){const e=[];let n=0,o={x:0,y:0},i={x:0,y:0},s=null,r=null;const a=()=>{for(;n<t.length&&/[\s,]/u.test(t[n]);)n+=1},l=()=>{a();const f=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/u.exec(t.slice(n));if(!f)throw new Error(`icon path: number expected at ${n}`);return n+=f[0].length,Number(f[0])},c=()=>{a();const f=t[n];return n+=1,f==="1"},u=f=>{e.push({kind:"lnTo",pt:Lt(f)}),o=f},d=(f,p,m)=>{e.push({kind:"cubicBezTo",pts:[Lt(f),Lt(p),Lt(m)]}),o=m,s=p};let h="";for(;a(),!(n>=t.length);){/[a-zA-Z]/u.test(t[n])&&(h=t[n],n+=1);const f=h===h.toLowerCase(),p=f?o:{x:0,y:0},m=()=>{const b=l(),x=l();return{x:p.x+b,y:p.y+x}},g=s,y=r;switch(s=null,r=null,h.toUpperCase()){case"M":{const b=m();e.push({kind:"moveTo",pt:Lt(b)}),o=i=b,h=f?"l":"L";break}case"L":u(m());break;case"H":u({x:(f?o.x:0)+l(),y:o.y});break;case"V":u({x:o.x,y:(f?o.y:0)+l()});break;case"C":d(m(),m(),m());break;case"S":d(g?{x:2*o.x-g.x,y:2*o.y-g.y}:o,m(),m());break;case"Q":case"T":{const b=h.toUpperCase()==="Q"?m():y?{x:2*o.x-y.x,y:2*o.y-y.y}:o,x=m();e.push({kind:"quadBezTo",pts:[Lt(b),Lt(x)]}),o=x,r=b;break}case"A":{const b=l(),x=l(),w=l(),k=c(),v=c(),M=m();for(const[$,N,U]of bc(o,b,x,w,k,v,M))d($,N,U);s=null;break}case"Z":e.push({kind:"close"}),o=i;break;default:throw new Error(`icon path: unknown command ${h}`)}}return e}const H=t=>Number(t??0)||0,Ui=(t,e,n,o)=>`M${t-n} ${e}A${n} ${o} 0 1 0 ${t+n} ${e}A${n} ${o} 0 1 0 ${t-n} ${e}Z`;function wc([t,e]){switch(t){case"path":return e.d??null;case"line":return`M${H(e.x1)} ${H(e.y1)}L${H(e.x2)} ${H(e.y2)}`;case"circle":return Ui(H(e.cx),H(e.cy),H(e.r),H(e.r));case"ellipse":return Ui(H(e.cx),H(e.cy),H(e.rx),H(e.ry));case"polyline":case"polygon":{const n=(e.points??"").trim().split(/[\s,]+/u).map(Number),o=n.flatMap((i,s)=>s%2===0?[`${i} ${n[s+1]??0}`]:[]);return o.length?`M${o.join("L")}${t==="polygon"?"Z":""}`:null}case"rect":{const n=H(e.x),o=H(e.y),i=H(e.width),s=H(e.height),r=Math.min(H(e.rx??e.ry),i/2),a=Math.min(H(e.ry??e.rx),s/2);return!r||!a?`M${n} ${o}H${n+i}V${o+s}H${n}Z`:`M${n+r} ${o}H${n+i-r}A${r} ${a} 0 0 1 ${n+i} ${o+a}V${o+s-a}A${r} ${a} 0 0 1 ${n+i-r} ${o+s}H${n+r}A${r} ${a} 0 0 1 ${n} ${o+s-a}V${o+a}A${r} ${a} 0 0 1 ${n+r} ${o}Z`}default:return null}}function Hi(t){return t.flatMap(e=>{const n=wc(e);return n?[{w:Gi,h:Gi,fill:"none",stroke:!0,commands:xc(n)}]:[]})}function _i(t,e,n,o){const i=[];let s;return t.forEach((r,a)=>{const l=f=>{s??=`${n} ${a+1}: ${f}.`},{area:c,...u}=r;let d=u;if(c!==void 0&&o){const f=gc(o,c);if(typeof f=="string")return l(f);d={...d,...f}}const h=ql(d);if(typeof h=="string")return l(h);if(h.kind==="icon"){if(!e.icons)return l("icons are not available yet; draw the idea with shapes for now");const f=e.icons[h.icon];if(!f){const p=h.icon.split("-"),m=Object.keys(e.icons).filter(g=>p.some(y=>y.length>2&&g.includes(y))).slice(0,8);return l(`there is no icon named "${h.icon}"${m.length?`; close names: ${m.join(", ")}`:""}`)}i.push({...h,paths:Hi(f)});return}if(h.kind==="component"){const f=h.content.items?.map((p,m)=>{if(!p.icon)return p;const g=e.icons?.[p.icon];return g?{...p,paths:Hi(g)}:(l(e.icons?`item ${m+1} has no icon named "${p.icon}"`:"icons are not available yet; leave item icons out for now"),p)});i.push(f?{...h,content:{...h.content,items:f}}:h);return}if(h.kind==="image"&&!e.pictures)return l("this editor cannot generate pictures; draw the picture yourself as an illustration object with svg instead");if(h.kind==="illustration"){const f=Ql(h.svg);if("problem"in f)return l(f.problem);i.push({...h,svg:f.svg});return}i.push(h)}),{elements:i,...s?{problem:s}:{}}}const Kn="QuireKit.Directions";function kc(t){const e=ht(t)[Kn];if(e===void 0)return[];try{const n=JSON.parse(e);return Array.isArray(n)?n.filter(o=>typeof o?.design?.palette?.primary=="string"&&Array.isArray(o.samples)):[]}catch{return[]}}function vc(t,e,n){const o=bn(),i=Pt(t);i&&Ee(o,i);const s=Be(e.design,i?i.width/36e4:void 0);Ei(o,s);const r=Q(o)[0]??Fo(o),a=e.samples[n];if(a){const l=s.pages[a.page??"content"],c=a.background!==void 0?To(s.palette,Re(s.palette,a.background)):l.text;Bi(r,s,a.background??l.background,a.elements,1,c)}return{presentation:o,slide:r}}const Mc={name:"directions",addCommands:()=>({setDeckDirections:Wt({description:"Offers two or three clearly different design directions for the user to choose from in the directions view, without changing the slides. Each is a full design language with up to three sample slides drawn in it from the deck's real content, usually the cover, a content slide and a data slide, placed with the same objects drawSlide takes. Stop after offering them; the user picks one, which records its design language, or describes what they want instead. An empty list withdraws them.",params:{type:"object",properties:{directions:{type:"array",maxItems:3,items:{type:"object",properties:{design:Pi,samples:{type:"array",minItems:1,maxItems:3,items:{type:"object",properties:{page:{enum:[...Wn]},background:qn,elements:{type:"array",minItems:1,maxItems:40,items:Mi}},required:["elements"],additionalProperties:!1}}},required:["design","samples"],additionalProperties:!1}}},required:["directions"],additionalProperties:!1},category:"design",planning:!0,adapt:(t,e)=>{const n=t.directions;let o;const i=n.map((a,l)=>({design:a.design,samples:a.samples.map((c,u)=>{const d=_i(c.elements,e,`Direction ${l+1}, sample ${u+1}, object`,qi(e.presentation,a.design.margin,a.design.type?.title));o??=d.problem;const h=$i(c.background);return{...c.page?{page:c.page}:{},...h===void 0?{}:{background:h},elements:d.elements}})})),s=i.map(a=>a.design.style).filter(a=>a!==void 0),r=s.find((a,l)=>s.indexOf(a)!==l);return r!==void 0&&(o??=`Two directions follow the style card ${r}; give each direction a different style card, or a style of its own`),{directions:i,...o?{problem:o}:{}}},run:t=>({presentation:e,dispatch:n})=>{if(t.problem)throw new si(t.problem);const o=t.directions.length===0?null:JSON.stringify(t.directions);return(ht(e)[Kn]??null)===o?!1:(n&&Et(e,Kn,o),!0)}})})},Yn="QuireKit.Brief";function Sc(t){const e=ht(t)[Yn];if(e===void 0)return null;try{const n=JSON.parse(e);return n.delivery!=="spoken"&&n.delivery!=="read"?null:{delivery:n.delivery,...typeof n.purpose=="string"&&n.purpose?{purpose:n.purpose}:{},...typeof n.audience=="string"&&n.audience?{audience:n.audience}:{},...typeof n.minutes=="number"&&n.minutes>0?{minutes:n.minutes}:{},...n.venue==="room"||n.venue==="screen"||n.venue==="phone"?{venue:n.venue}:{}}}catch{return null}}const $c={name:"brief",addCommands:()=>({setBrief:Wt({description:"Records the deck's brief in the file: what it is for, who watches, whether it is spoken or read, how many minutes and where it is seen. Design notes then judge word counts and type sizes against it. Record it once before designing or reworking a deck, and again when the user changes it.",params:{type:"object",properties:{purpose:{type:"string",description:"What the deck is for, in the user's words."},audience:{type:"string"},delivery:{enum:["spoken","read"],description:"spoken: a speaker presents it; read: people read it on their own."},minutes:{type:"number",minimum:1},venue:{enum:["room","screen","phone"],description:"room: projected; screen: shared on a screen or monitor; phone: read on a phone."}},required:["delivery"],additionalProperties:!1},category:"design",planning:!0,run:t=>({presentation:e,dispatch:n})=>{const o=JSON.stringify(t);return ht(e)[Yn]===o?!1:(n&&Et(e,Yn,o),!0)}})})},Xn="QuireKit.Plan";function Ge(t){const e=t;if(typeof e?.point!="string"||!e.point.trim())return null;const n=Array.isArray(e.missing)?e.missing.filter(o=>typeof o=="string"&&o.trim()!==""):[];return{point:e.point,proof:typeof e.proof=="string"?e.proof:"",...typeof e.section=="string"&&e.section.trim()?{section:e.section}:{},...n.length>0?{missing:n}:{}}}function Cc(t){const e=ht(t)[Xn];if(e===void 0)return null;try{const n=JSON.parse(e),o=Array.isArray(n.slides)?n.slides.map(Ge).filter(s=>s!==null):[];if(o.length===0)return null;const i=Array.isArray(n.built)?n.built.map(Ge).filter(s=>s!==null):[];return{status:n.status==="confirmed"?"confirmed":"draft",slides:o,...i.length>0?{built:i}:{}}}catch{return null}}const Tc={name:"plan",addCommands:()=>({setDeckPlan:Wt({description:"Records the deck's storyline in the file, which the user sees and edits in the storyline view (called 故事线 in the editor; name it so to the user): one entry per slide with its point as a sentence and what will show it, sections, and facts still missing. Write it as a draft when planning a new deck; the user confirms it there. Write it again, whole, to change it; an empty list removes it.",params:{type:"object",properties:{status:{enum:["draft","confirmed"],description:"draft while the user reviews it; confirmed only when the user has said to build it."},slides:{type:"array",items:{type:"object",properties:{point:{type:"string",minLength:1,description:"The slide's point as a sentence."},proof:{type:"string",description:"What shows it, such as a big number, three steps, a comparison or a chart."},section:{type:"string",description:"Section the slide belongs to."},missing:{type:"array",items:{type:"string"},description:"Facts the slide needs that the user has not given, such as the hotline number."}},required:["point","proof"],additionalProperties:!1}}},required:["status","slides"],additionalProperties:!1},category:"design",planning:!0,run:t=>({presentation:e,dispatch:n})=>{const o=t.slides.map(Ge).filter(r=>r!==null),i=(t.built??[]).map(Ge).filter(r=>r!==null),s=o.length===0?null:JSON.stringify({status:t.status,slides:o,...i.length>0?{built:i}:{}});return(ht(e)[Xn]??null)===s?!1:(n&&Et(e,Xn,s),!0)}})})};function Zn(t,e,n){const o=ye(t,e,n),i=mn(t,e,n),s=o===null?null:xn(t,o);if(o===null||i===null||s===null)return null;const r=i.map(yn);return r.some(a=>a===null)?null:{shape:o,groups:i,spaces:r,frame:Nr({x:s.x,y:s.y,width:s.w,height:s.h,rotation:Wo(o)},r)}}function Pc(t,e){const n=Po({...e,rotation:t.frame.rotation},t.spaces);Jn(t.shape,n),Vi(t.groups)}function Jn(t,e){Ea(t,{x:B(Math.round(e.x)),y:B(Math.round(e.y)),w:B(Math.max(1,Math.round(e.width))),h:B(Math.max(1,Math.round(e.height)))})}function Vi(t){for(const e of[...t].reverse()){const n=yn(e),o=Ro(e).flatMap(p=>{const m=ve(p);return m===null?[]:[{child:p,frame:{x:m.x,y:m.y,width:m.w,height:m.h,rotation:Wo(p)}}]});if(n===null||o.length===0)continue;const i=o.map(({frame:p})=>Dr(p)),s=Math.min(...i.map(p=>p.x)),r=Math.min(...i.map(p=>p.y)),a=Math.max(...i.map(p=>p.x+p.width)),l=Math.max(...i.map(p=>p.y+p.height)),c=Co({x:s,y:r,width:a-s,height:l-r,rotation:0},n),u=n.outer,d=(p,m)=>Math.abs(p-m)<1;if(d(c.x,u.x)&&d(c.y,u.y)&&d(c.width,u.w)&&d(c.height,u.h))continue;const h=o.map(({child:p,frame:m})=>({child:p,frame:Co(m,n)}));Jn(e,c);const f=yn(e);if(f!==null)for(const{child:p,frame:m}of h)Jn(p,Ir(m,f))}}function Ec(t,e){return Po({...t.frame,rotation:e},t.spaces).rotation}const Ac="http://schemas.openxmlformats.org/presentationml/2006/main",Ki=t=>t[Symbol.for("@office-kit/pptx.slide.document")]?.root,le=t=>Ki(t)?.children.find(e=>e.name?.localName==="timing")??null,Qn=t=>Ua(t,Cn(t));function F(t,e={},n=[]){return{kind:"element",name:{prefix:"p",localName:t,namespaceURI:Ac},prefixDecls:new Map,children:n,attrs:Object.entries(e).map(([o,i])=>({name:{prefix:"",localName:o,namespaceURI:""},value:i}))}}const O=(t,e)=>t?.children.find(n=>n.name?.localName===e),S=(t,e)=>t?.attrs.find(n=>n.name.localName===e)?.value;function ce(t,e,n){t.attrs=t.attrs.filter(o=>o.name.localName!==e),n!==null&&t.attrs.push({name:{prefix:"",localName:e,namespaceURI:""},value:n})}function _t(t,e,n=[]){if(e(t))return[...n,t];for(const o of t.children){if(o.kind!=="element")continue;const i=_t(o,e,[...n,t]);if(i)return i}return null}function Oc(t){let e=0;const n=o=>{o.name?.localName==="cTn"&&(e=Math.max(e,Number(S(o,"id"))||0)),o.children.forEach(i=>i.kind==="element"&&n(i))};return n(t),e}const Yi=t=>F("cond",{evt:"onClick",delay:"0"},[F("tgtEl",{},[F("spTgt",{spid:String(t)})])]);function to(t,e){return _t(t,n=>n.name?.localName==="cTn"&&S(n,"id")===String(e)&&S(n,"presetClass")!==void 0)}const Fc=t=>t.find(e=>e.name?.localName==="cTn"&&S(e,"nodeType")==="interactiveSeq");function ue(t,e){const n=le(t),o=n&&to(n,e),i=o?.at(-1);if(!o||!i)return null;const s=S(i,"repeatCount"),r=O(i,"endCondLst")?.children.some(u=>S(u,"evt")==="onNext")??!1,a=s==="indefinite"?r?"untilNextClick":"untilEnd":s&&Number(s)>1e3?Number(s)/1e3:null,l=Fc(o),c=l&&_t(l,u=>u.name?.localName==="spTgt")?.at(-1);return{repeat:a,rewind:S(i,"fill")==="remove",trigger:c?Number(S(c,"spid")):null}}function eo(t,e,n){const o=le(t),i=o&&to(o,e)?.at(-1);if(!i)return!1;if(n.repeat!==void 0){const s=n.repeat;if(ce(i,"repeatCount",s===null?null:typeof s=="number"?String(Math.round(s*1e3)):"indefinite"),i.children=i.children.filter(r=>r.name?.localName!=="endCondLst"),s==="untilNextClick"){const r=F("endCondLst",{},[F("cond",{evt:"onNext",delay:"0"},[F("tgtEl",{},[F("sldTgt")])])]),a=i.children.findIndex(l=>l.name?.localName==="stCondLst");i.children.splice(a+1,0,r)}}return n.rewind!==void 0&&ce(i,"fill",n.rewind?"remove":"hold"),Qn(t),!0}function no(t,e,n){return Nc(t,e,n)?(Qn(t),!0):!1}function Nc(t,e,n){const o=le(t),i=o&&to(o,e),s=o&&_t(o,f=>S(f,"nodeType")==="tmRoot")?.at(-1);if(!o||!i||!s)return!1;if((ue(t,e)?.trigger??null)===n)return!0;const r=i.at(-1),a=i.at(-2);Lc(i.slice(0,-1));let l=Oc(o);const c=f=>F("par",{},[F("cTn",{id:String(++l),fill:"hold"},[F("stCondLst",{},[F("cond",{delay:f})]),F("childTnLst",{},[F("par",{},[F("cTn",{id:String(++l),fill:"hold"},[F("stCondLst",{},[F("cond",{delay:"0"})]),F("childTnLst",{},[a])])])])])]);ce(r,"nodeType","clickEffect");let u=O(s,"childTnLst");if(u||s.children.push(u=F("childTnLst")),n===null)return O(O(Ic(u,()=>String(++l)),"cTn"),"childTnLst").children.push(c("indefinite")),!0;const d=u.children.find(f=>{const p=O(f,"cTn"),m=_t(O(p,"stCondLst")??F("stCondLst"),g=>g.name?.localName==="spTgt")?.at(-1);return S(p,"nodeType")==="interactiveSeq"&&S(m,"spid")===String(n)});if(d)return O(O(d,"cTn"),"childTnLst").children.push(c("0")),!0;const h=String(++l);return u.children.push(F("seq",{concurrent:"1",nextAc:"seek"},[F("cTn",{id:h,restart:"whenNotActive",fill:"hold",evtFilter:"cancelBubble",nodeType:"interactiveSeq"},[F("stCondLst",{},[Yi(n)]),F("endSync",{evt:"end",delay:"0"},[F("rtn",{val:"all"})]),F("childTnLst",{},[c("0")])]),F("nextCondLst",{},[Yi(n)])])),!0}function Ic(t,e){const n=t.children.find(s=>S(O(s,"cTn"),"nodeType")==="mainSeq");if(n)return n;const o=s=>F("cond",{evt:s,delay:"0"},[F("tgtEl",{},[F("sldTgt")])]),i=F("seq",{concurrent:"1",nextAc:"seek"},[F("cTn",{id:e(),dur:"indefinite",nodeType:"mainSeq"},[F("childTnLst")]),F("prevCondLst",{},[o("onPrev")]),F("nextCondLst",{},[o("onNext")])]);return t.children.unshift(i),i}function Lc(t){const e=t.findIndex(s=>["mainSeq","interactiveSeq"].includes(S(s,"nodeType")??"")),n=e>=0?t[e+2]:void 0,o=e>=0?t[e+1]:void 0;for(let s=t.length-1;s>0;){const r=t[s-1];r.children=r.children.filter(l=>l!==t[s]);const a=t[s-2];if(r.children.some(l=>l.kind==="element")||r.name?.localName!=="childTnLst"||!a||S(a,"nodeType")==="tmRoot")break;s-=3}if(!n||!o?.children.includes(n))return;const i=_t(n,s=>S(s,"presetClass")!==void 0)?.at(-1);i&&ce(i,"nodeType","clickEffect")}function Rc(t,e,n){const o=ue(t,e);if(!o||!o.rewind&&o.trigger===null)return n();o.rewind&&eo(t,e,{rewind:!1}),o.trigger!==null&&no(t,e,null);const i=n();return ue(t,e)&&(o.rewind&&eo(t,e,{rewind:!0}),o.trigger!==null&&no(t,e,o.trigger)),i}const Xi={p:"plain",b:"bold",i:"italic",bi:"boldItalic"},jc=Object.fromEntries(Object.entries(Xi).map(([t,e])=>[e,t])),Dc={bar:"bar",skw:"skewed",lin:"linear",noBar:"noBar"},Bc={skewed:"skw",linear:"lin",noBar:"noBar"},Vt=t=>Object.keys(t).find(e=>e!==":@"&&e!=="#text"),ft=t=>t[Vt(t)??""]??[],Ue=(t,e)=>ft(t).find(n=>Vt(n)===e);function dt(t,e){const n=t&&Ue(t,e);if(n)return n[":@"]?.["@_m:val"]??""}const oo=t=>t!==void 0&&t!=="0"&&t!=="off"&&t!=="false";function zc(t){return Kt(ft(t))}function Kt(t){return t.flatMap(e=>Wc(e))}const q=(t,e)=>{const n=Ue(t,e);return n?Kt(ft(n)):[]};function Wc(t){const e=Vt(t);if(e===void 0||e.endsWith("Pr")||e.startsWith("w:"))return[];const n=o=>Ue(t,o);switch(e){case"m:oMath":case"m:e":return Kt(ft(t));case"m:r":{const o=ft(Ue(t,"m:t")??{}).map(s=>s["#text"]??"").join(""),i=Xi[dt(n("m:rPr"),"m:sty")??""];return o?[{kind:"text",text:o,...i?{style:i}:{}}]:[]}case"m:f":{const o=Dc[dt(n("m:fPr"),"m:type")??""];return[{kind:"fraction",...o&&o!=="bar"?{type:o}:{},numerator:q(t,"m:num"),denominator:q(t,"m:den")}]}case"m:sSub":return[{kind:"subscript",base:q(t,"m:e"),sub:q(t,"m:sub")}];case"m:sSup":return[{kind:"superscript",base:q(t,"m:e"),sup:q(t,"m:sup")}];case"m:sSubSup":return[{kind:"subSuperscript",base:q(t,"m:e"),sub:q(t,"m:sub"),sup:q(t,"m:sup")}];case"m:rad":return[{kind:"radical",degree:oo(dt(n("m:radPr"),"m:degHide"))?null:q(t,"m:deg"),body:q(t,"m:e")}];case"m:nary":{const o=n("m:naryPr"),i=dt(o,"m:limLoc");return[{kind:"nary",...dt(o,"m:chr")?{operator:dt(o,"m:chr")}:{},...i==="undOvr"?{limitLocation:"underOver"}:i==="subSup"?{limitLocation:"subSup"}:{},sub:oo(dt(o,"m:subHide"))?null:q(t,"m:sub"),sup:oo(dt(o,"m:supHide"))?null:q(t,"m:sup"),body:q(t,"m:e")}]}case"m:d":{const o=n("m:dPr"),i=dt(o,"m:begChr"),s=dt(o,"m:endChr"),r=dt(o,"m:sepChr");return[{kind:"delimiter",...i===void 0?{}:{open:i},...s===void 0?{}:{close:s},...r===void 0?{}:{separator:r},items:ft(t).filter(a=>Vt(a)==="m:e").map(a=>Kt(ft(a)))}]}case"m:m":return[{kind:"matrix",rows:ft(t).filter(o=>Vt(o)==="m:mr").map(o=>ft(o).filter(i=>Vt(i)==="m:e").map(i=>Kt(ft(i))))}];case"m:acc":{const o=dt(n("m:accPr"),"m:chr");return[{kind:"accent",...o?{accent:o}:{},body:q(t,"m:e")}]}case"m:func":return[{kind:"function",name:q(t,"m:fName"),body:q(t,"m:e")}];case"m:limLow":return[{kind:"lowerLimit",base:q(t,"m:e"),limit:q(t,"m:lim")}];case"m:limUpp":return[{kind:"upperLimit",base:q(t,"m:e"),limit:q(t,"m:lim")}];default:return Kt(ft(t))}}function P(t,e=[],n){return{[t]:e,...n===void 0?{}:{":@":{"@_m:val":n}}}}function Zi(t,e){const n=P("m:oMath",Ji(t));return e?P("m:oMathPara",[n]):n}function Ji(t){return(t??[]).map(e=>qc(e))}const z=(t,e)=>P(t,Ji(e));function qc(t){switch(t.kind){case"text":{const e=t.style?jc[t.style]:void 0;return P("m:r",[...e?[P("m:rPr",[P("m:sty",[],e)])]:[],P("m:t",[{"#text":t.text}])])}case"fraction":{const e=t.type?Bc[t.type]:void 0;return P("m:f",[...e?[P("m:fPr",[P("m:type",[],e)])]:[],z("m:num",t.numerator),z("m:den",t.denominator)])}case"subscript":return P("m:sSub",[z("m:e",t.base),z("m:sub",t.sub)]);case"superscript":return P("m:sSup",[z("m:e",t.base),z("m:sup",t.sup)]);case"subSuperscript":return P("m:sSubSup",[z("m:e",t.base),z("m:sub",t.sub),z("m:sup",t.sup)]);case"radical":return P("m:rad",[...t.degree?[]:[P("m:radPr",[P("m:degHide",[],"1")])],z("m:deg",t.degree),z("m:e",t.body)]);case"nary":{const e=[...t.operator?[P("m:chr",[],t.operator)]:[],...t.limitLocation?[P("m:limLoc",[],t.limitLocation==="underOver"?"undOvr":"subSup")]:[],...t.sub?[]:[P("m:subHide",[],"1")],...t.sup?[]:[P("m:supHide",[],"1")]];return P("m:nary",[...e.length?[P("m:naryPr",e)]:[],z("m:sub",t.sub),z("m:sup",t.sup),z("m:e",t.body)])}case"delimiter":{const e=[...t.open===void 0?[]:[P("m:begChr",[],t.open)],...t.separator===void 0?[]:[P("m:sepChr",[],t.separator)],...t.close===void 0?[]:[P("m:endChr",[],t.close)]];return P("m:d",[...e.length?[P("m:dPr",e)]:[],...t.items.map(n=>z("m:e",n))])}case"matrix":{const e=Math.max(0,...t.rows.map(n=>n.length));return P("m:m",[P("m:mPr",[P("m:mcs",[P("m:mc",[P("m:mcPr",[P("m:count",[],String(e)),P("m:mcJc",[],"center")])])])]),...t.rows.map(n=>P("m:mr",n.map(o=>z("m:e",o))))])}case"accent":return P("m:acc",[...t.accent?[P("m:accPr",[P("m:chr",[],t.accent)])]:[],z("m:e",t.body)]);case"function":return P("m:func",[z("m:fName",t.name),z("m:e",t.body)]);case"lowerLimit":return P("m:limLow",[z("m:e",t.base),z("m:lim",t.limit)]);case"upperLimit":return P("m:limUpp",[z("m:e",t.base),z("m:lim",t.limit)]);default:return P("m:r",[P("m:t",[{"#text":"text"in t?t.text:""}])])}}function He(t,e,n,o){const i=n.map(s=>ye(t,e,s));return i.length===0||i.some(s=>s===null||!o.includes(st(s)))?null:i}const ot=12700,Gc=[["右下",45],["下",90],["左下",135],["右",0],["居中",null],["左",180],["右上",315],["上",270],["左上",225]],Uc=[["upper-left","左上对角透视",{scaleY:.23,skewX:20,alignment:"b",angleDeg:225,offsetEmu:0,blurEmu:5*ot,opacity:.15}],["upper-right","右上对角透视",{scaleY:.23,skewX:-20,alignment:"bl",angleDeg:315,offsetEmu:0,blurEmu:6*ot,opacity:.2}],["below","下方透视",{scaleX:.9,scaleY:-.19,alignment:"b",angleDeg:90,offsetEmu:25*ot,blurEmu:12*ot,opacity:.15}]],Qi=[...Gc.map(([t,e])=>({id:`outer-${t}`,label:`外部${t==="居中"?"居中":`向${t}偏移`}`,effect:{kind:"shadow",value:e===null?{color:"#000000",opacity:.4,blurEmu:5*ot,offsetEmu:0,angleDeg:0,alignment:"ctr"}:{color:"#000000",opacity:.4,blurEmu:4*ot,offsetEmu:3*ot,angleDeg:e}}})),...[["左上",45],["上",90],["右上",135],["居中",null],["下",270]].map(([t,e])=>({id:`inner-${t}`,label:`内部${t==="居中"?"居中":t}`,effect:{kind:"innerShadow",value:e===null?{color:"#000000",opacity:.5,blurEmu:9*ot,offsetEmu:0,angleDeg:0}:{color:"#000000",opacity:.5,blurEmu:5*ot,offsetEmu:4*ot,angleDeg:e}}})),...Uc.map(([t,e,n])=>({id:`perspective-${t}`,label:e,effect:{kind:"shadow",value:{color:"#000000",...n}}}))],Hc=[[5,"小"],[10,"中"],[18,"大"]];function _c(t,e){return{kind:"glow",value:{color:t,radiusEmu:e*ot,opacity:.6}}}const Vc=[["紧密倒影,接触",.35,0],["半倒影,接触",.55,0],["全倒影,接触",.9,0],["紧密倒影,4 磅偏移",.35,4],["半倒影,4 磅偏移",.55,4],["全倒影,8 磅偏移",.9,8]].map(([t,e,n],o)=>({id:`reflection-${o}`,label:t,effect:{kind:"reflection",value:{startOpacity:.5,opacity:0,startPosition:0,endPosition:e,offsetEmu:n*ot,angleDeg:90,scaleY:-1,alignment:"bl",rotateWithShape:!1}}})),Kc=[1,2.5,5,10,25,50],Yc=[["等轴右上",314.7,324.6,60],["等轴左下",45.3,35.4,300],["离轴 1 右",20,0,0],["离轴 1 左",340,0,0],["离轴 2 上",0,340,0],["离轴 2 下",0,20,0],["倾斜右上",30,330,0],["倾斜左下",330,30,0]].map(([t,e,n,o],i)=>({id:`rotation-${i}`,label:t,effect:{kind:"rotation",value:{longitudeDeg:e,latitudeDeg:n,revolutionDeg:o}}})),Xc=[["窄棱台",3,3],["棱台",6,6],["宽棱台",12,8]].map(([t,e,n],o)=>({id:`bevel-${o}`,label:t,effect:{kind:"bevel",value:{width:e*ot,height:n*ot}}})),Zc=["tx1","accent1","accent2","accent3","accent4","accent5","accent6"],Jc=["深色","强调 1","强调 2","强调 3","强调 4","强调 5","强调 6"],Qc={tx1:"#000000",bg1:"#FFFFFF",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47"};function io(t){const e=ee(t);return e?{tx1:e.dark1,bg1:e.light1,tx2:e.dark2,bg2:e.light2,dk1:e.dark1,lt1:e.light1,dk2:e.dark2,lt2:e.light2,accent1:e.accent1,accent2:e.accent2,accent3:e.accent3,accent4:e.accent4,accent5:e.accent5,accent6:e.accent6}:Qc}function Yt(t,e,n){const o=(i,s)=>Number.parseInt(i.slice(s,s+2),16);return`#${[1,3,5].map(i=>Math.round(o(t,i)+(o(e,i)-o(t,i))*n)).map(i=>i.toString(16).padStart(2,"0")).join("").toUpperCase()}`}function tu(t){const e=io(t),n=Qi.find(o=>o.id==="outer-右下").effect;return[(o,i)=>({id:`outline-${o}`,label:`彩色轮廓 - ${i}`,fill:{kind:"solid",color:"bg1"},line:{color:o,width:1},text:"tx1"}),(o,i)=>({id:`fill-${o}`,label:`彩色填充 - ${i}`,fill:{kind:"solid",color:o},line:{color:Yt(e[o],"#000000",.5),width:1},text:"bg1"}),(o,i)=>({id:`light-${o}`,label:`浅色填充 - ${i}`,fill:{kind:"solid",color:Yt(e[o],"#FFFFFF",.8)},line:{color:o,width:1},text:o==="tx1"?"tx1":Yt(e[o],"#000000",.5)}),(o,i)=>({id:`intense-${o}`,label:`强烈效果 - ${i}`,fill:{kind:"gradient",path:"linear",angle:90,stops:[{offset:0,color:Yt(e[o],"#FFFFFF",.3)},{offset:1,color:Yt(e[o],"#000000",.15)}]},line:{color:null},text:"bg1",effect:n})].flatMap(o=>Zc.map((i,s)=>o(i,Jc[s])))}function _e(t,e,n){const o=/<asvg:svgBlip\b[^>]*\br:embed="([^"]+)"/u.exec(Mt(n))?.[1],i=eu(e),s=o&&i?yt(t,i):null;if(!s)return null;const r=new TextDecoder().decode(s),a=new RegExp(`<Relationship\\b[^>]*\\bId="${o}"[^>]*>`,"u").exec(r)?.[0],l=a?/\bTarget="([^"]+)"/u.exec(a)?.[1]:void 0;if(!l||/\bTargetMode="External"/u.test(a))return null;const c=e.split("/").slice(0,-1);for(const u of l.split("/"))u===".."?c.pop():u!=="."&&c.push(u);return l.startsWith("/")?l:c.join("/")}function eu(t){const e=t.lastIndexOf("/");return e<0?null:`${t.slice(0,e)}/_rels/${t.slice(e+1)}.rels`}function ts(t,e,n="fill"){const o=s=>/^none$/iu.test(s.trim())?s:e,i=t.replace(new RegExp(`(\\s)${n}="([^"]*)"`,"gu"),(s,r,a)=>`${r}${n}="${o(a)}"`).replace(new RegExp(`([;{"\\s])${n}\\s*:\\s*([^;"}]+)`,"gu"),(s,r,a)=>`${r}${n}:${o(a)}`);return n==="stroke"?i:i.replace(/<svg\b([^>]*)>/u,(s,r)=>/\sfill=/u.test(r)?s:`<svg${r} fill="${e}">`)}function nu(t){return({presentation:e,dispatch:n})=>{if(!xe(e,t.slide)||!/^#[\da-f]{6}$/iu.test(t.color))return!1;const o=(He(e,t.slide,t.shapes,["picture"])??[]).flatMap(i=>{const s=_e(e,t.slide,i),r=s?yt(e,s):null;return s&&r?[{shape:i,part:s,bytes:r}]:[]});if(o.length===0)return!1;if(n)for(const{shape:i,part:s,bytes:r}of o){Xo(e,s,new TextEncoder().encode(ts(new TextDecoder().decode(r),t.color,t.paint)));const a=na(i),l=t.fallbacks?.get(j(i));l&&a&&a!==s&&Xo(e,a,l)}return!0}}const ou="http://schemas.openxmlformats.org/drawingml/2006/main";function Xt(t,e=[],n={}){return{kind:"element",name:{prefix:"a",localName:t,namespaceURI:ou},prefixDecls:new Map,children:e,attrs:Object.entries(n).map(([o,i])=>({name:{prefix:"",localName:o,namespaceURI:""},value:i}))}}function es(t){return t[Symbol.for("@office-kit/pptx.shape.element")]?.children.find(e=>e.name?.localName==="blipFill")?.children.find(e=>e.name?.localName==="blip")}function ns(t){const e=/<a:clrChange\b[^>]*>\s*<a:clrFrom>\s*<a:srgbClr val="([\dA-Fa-f]{6})"/u.exec(Mt(t));return e?`#${e[1].toUpperCase()}`:null}function iu(t,e){const n=es(t);if(!n)return!1;const o=n.children.filter(i=>i.name?.localName!=="clrChange");if(n.children.length=0,n.children.push(...o),e){const i=e.slice(1).toUpperCase(),s=Xt("clrChange",[Xt("clrFrom",[Xt("srgbClr",[],{val:i})]),Xt("clrTo",[Xt("srgbClr",[Xt("alpha",[],{val:"0"})],{val:i})])]);n.children.unshift(s)}return Ia(t,ea(t)??null),!0}function su(t){return({presentation:e,dispatch:n})=>{if(t.color!==null&&!/^#[\da-f]{6}$/iu.test(t.color))return!1;const o=(He(e,t.slide,t.shapes,["picture"])??[]).filter(i=>es(i));if(o.length===0)return!1;if(n)for(const i of o)iu(i,t.color);return!0}}const ru=["textStop","textTriangle","textTriangleInverted","textChevron","textChevronInverted","textRingInside","textRingOutside","textArchUp","textArchDown","textCircle","textButton","textArchUpPour","textArchDownPour","textCirclePour","textButtonPour","textCurveUp","textCurveDown","textCanUp","textCanDown","textWave1","textWave2","textDoubleWave1","textWave4","textInflate","textDeflate","textInflateBottom","textDeflateBottom","textInflateTop","textDeflateTop","textDeflateInflate","textDeflateInflateDeflate","textFadeRight","textFadeLeft","textFadeUp","textFadeDown","textSlantUp","textSlantDown","textCascadeUp","textCascadeDown"];function os(t){const e=/<a:bodyPr\b[^>]*?(?:\/>|>([\s\S]*?)<\/a:bodyPr>)/u.exec(Mt(t)),n=e?.[1]?/<a:prstTxWarp\b[^>]*\bprst="([A-Za-z0-9]+)"/u.exec(e[1])?.[1]??null:null;return n===null||n==="textNoShape"||n==="textPlain"?null:n}const au=Symbol.for("@office-kit/pptx.shape.element"),de=(t,e)=>typeof t=="object"&&t!==null&&t.kind==="element"&&t.name.localName===e;function is(t,e){const n=t[au]?.children.find(i=>de(i,"txBody")),o=de(n,"txBody")?n.children.find(i=>de(i,"bodyPr")):void 0;if(!de(o,"bodyPr"))return!1;if(o.children=o.children.filter(i=>!de(i,"prstTxWarp")),e!==null){const i=r=>({prefix:o.name.prefix,localName:r,namespaceURI:o.name.namespaceURI}),s={kind:"element",name:i("avLst"),attrs:[],prefixDecls:new Map,children:[]};o.children.unshift({kind:"element",name:i("prstTxWarp"),attrs:[{name:{prefix:"",localName:"prst",namespaceURI:""},value:e}],prefixDecls:new Map,children:[s]})}return Fn(t,ra(t)??"square"),!0}function lu(t){return({presentation:e,dispatch:n})=>{const o=t.warp===null||ru.includes(t.warp)?He(e,t.slide,t.shapes,["text"]):null;if(!o||o.some(i=>!/<a:bodyPr\b/u.test(Mt(i))))return!1;if(n)for(const i of o)is(i,t.warp);return!0}}function Ve(t,e){const n=Se(e),o=ha(t);if(!n)return o[0];const i=Sn(n),s=Ho(n);return o.find(r=>$e(r)===$e(n)&&Sn(r)===i)??(s&&s!=="cust"?o.find(r=>Ho(r)===s):void 0)??o.find(r=>Sn(r)===i)??o[0]}const cu={name:"slide-paste",addCommands:()=>({pasteSlides:t=>({presentation:e,dispatch:n})=>{const o=t.slides.map(s=>Io(t.source,s));if(o.length===0||o.some(s=>s===null))return!1;if(!n)return!0;const i=Math.max(0,Math.min(t.at,Q(e).length));return o.forEach((s,r)=>{Ma(e,$n(e,s,t.mode==="theme"?Ve(e,s):void 0),i+r)}),!0}})},uu={dk1:"dark1",lt1:"light1",dk2:"dark2",lt2:"light2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hyperlink",folHlink:"followedHyperlink"};function so(t,e,n){if(!n)return null;const o=/^#?([\da-f]{6})/iu.exec(n);if(o)return`#${o[1].toUpperCase()}`;const i=n.replace(/^scheme:/u,""),s=Yr(e)[i]??i,r=ee(t),a=uu[s];return r&&a?so(t,e,r[a]):null}function du(t,e){let n=la(e);const o=Se(e);return n.kind==="inherit"&&o&&(n=ua(o)),n.kind==="inherit"&&o&&(n=pa(t,o)),n.kind==="inherit"?"#FFFFFF":n.kind==="solid"?so(t,e,n.color):null}function ss(t){const[e,n,o]=[1,3,5].map(i=>{const s=Number.parseInt(t.slice(i,i+2),16)/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4});return .2126*e+.7152*n+.0722*o}function hu(t,e){const[n,o]=[ss(t),ss(e)].sort((i,s)=>s-i);return(n+.05)/(o+.05)}const pu=new Set(["picture","chart","media","group","other"]),fu=new Set(["dt","ftr","sldNum"]),ro=t=>{try{return Go(t)}catch{return""}};function rs(t){const e=Lo(t,"title")??Lo(t,"ctrTitle");return e?{shape:e,text:ro(e).trim()}:null}function as(t,e,n,o){const i=ta(t,n)??(o===void 0?du(t,e):o);if(!i)return null;let s=null;return ro(n).split(`
|
|
9
|
+
`).forEach((r,a)=>{if(!r.trim())return;let l=null;try{l=vn(t,n,a,0)}catch{return}const c=so(t,e,l?.color)??Ca(e);if(!c)return;const u=l?.size??18,d=u>=18||l?.bold===!0&&u>=14?3:4.5,h=hu(c,i);h<d&&(!s||h/d<s.ratio/s.needed)&&(s={ratio:h,needed:d})}),s}function ls(t,e){return Oo(e).filter(n=>!Yo(n)&&st(n)==="text").flatMap(n=>{const o=as(t,e,n);return o?[{kind:"low-contrast",severity:"warning",shape:j(n),label:wn(n),detail:`文字与背景对比度 ${o.ratio.toFixed(1)}:1,低于 ${o.needed}:1`}]:[]})}function mu(t,e,n){const o=rs(e)?.shape,i=n.filter(r=>!fu.has(zo(r)??""));if(o&&i.length>1&&i[0]!==o&&i.includes(o))return"标题不是最先读出的对象";const s=i.filter(r=>st(r)==="text"&&ro(r).trim()).map(r=>({shape:r,box:xn(t,r)})).filter(r=>r.box);return[...s].sort((r,a)=>Math.abs(r.box.y-a.box.y)<Math.min(r.box.h,a.box.h)/2?r.box.x-a.box.x:r.box.y-a.box.y).some((r,a)=>r.shape!==s[a].shape)?"文字的朗读顺序与版面上的顺序不一致":null}function cs(t,e,n=!0){const o=[],i=rs(e);i?.text||o.push({kind:"missing-title",severity:"error",shape:i?j(i.shape):null,label:i?"标题占位符为空":"没有标题占位符",detail:"幻灯片没有标题,屏幕阅读器无法用标题区分页面"});const s=Oo(e).filter(a=>!Yo(a));for(const a of s){const l=st(a),c=/decorative val="1"/u.test(Mt(a));pu.has(l)&&!c&&!(Qr(a)??Jr(a)??"").trim()&&o.push({kind:"missing-alt",severity:"error",shape:j(a),label:wn(a),detail:"缺少替代文字"})}n&&o.push(...ls(t,e));const r=mu(t,e,s);return r&&o.push({kind:"reading-order",severity:"warning",shape:null,label:"幻灯片",detail:r}),{title:i?.text?{shape:j(i.shape),text:i.text}:null,issues:o}}function gu(t,e=n=>cs(t,n)){const n=[],o=new Map;return Q(t).forEach((i,s)=>{const r=X(i),{title:a,issues:l}=e(i);a&&o.has(a.text)?n.push({kind:"duplicate-title",severity:"warning",slide:r,slideIndex:s,shape:a.shape,label:a.text,detail:`与第 ${o.get(a.text)+1} 张的标题相同`}):a&&o.set(a.text,s);for(const c of l)n.push({...c,slide:r,slideIndex:s})}),n}const rt=t=>(t.localName||t.tagName).replace(/^.*:/u,""),W=(t,e)=>t?[...t.children].find(n=>rt(n)===e)??null:null,us=(t,e)=>[...t.getElementsByTagName("*")].filter(n=>rt(n)===e),_=(t,e,n=0)=>Number(t?.getAttribute(e)??n)||n,yu=new Set(["tint","shade","alpha","alphaOff","alphaMod","hue","hueOff","hueMod","sat","satOff","satMod","lum","lumOff","lumMod"]);function Ke(t){const e=t?[...t.children].find(o=>rt(o)==="srgbClr"||rt(o)==="schemeClr"):void 0;if(!e)return null;const n=e.getAttribute("val")??"";return{color:rt(e)==="srgbClr"?`#${n}`:n,transforms:[...e.children].filter(o=>yu.has(rt(o))).map(o=>({kind:rt(o),value:_(o,"val")/(rt(o).startsWith("hue")?6e4:1e5)}))}}function ds(t){if(W(t,"noFill"))return"none";const e=W(W(t,"gradFill"),"gsLst");return Ke(W(t,"solidFill"))??(e?Ke(W(e,"gs")):null)}function bu(t){const e=W(t,"pathLst");if(!e)return[];const n=o=>({x:_(o,"x"),y:_(o,"y")});return[...e.children].filter(o=>rt(o)==="path").map(o=>{const i=[];for(const r of o.children){const a=[...r.children].filter(c=>rt(c)==="pt").map(n),l=rt(r);l==="moveTo"&&a[0]?i.push({kind:"moveTo",pt:a[0]}):l==="lnTo"&&a[0]?i.push({kind:"lnTo",pt:a[0]}):l==="cubicBezTo"&&a.length===3?i.push({kind:"cubicBezTo",pts:[a[0],a[1],a[2]]}):l==="quadBezTo"&&a.length===2?i.push({kind:"quadBezTo",pts:[a[0],a[1]]}):l==="arcTo"?i.push({kind:"arcTo",wR:_(r,"wR"),hR:_(r,"hR"),stAng:_(r,"stAng"),swAng:_(r,"swAng")}):l==="close"&&i.push({kind:"close"})}const s=o.getAttribute("fill");return{w:_(o,"w",1),h:_(o,"h",1),fill:s==="none"?"none":"norm",stroke:o.getAttribute("stroke")!=="0",commands:i}})}function hs(t){return us(new DOMParser().parseFromString(t,"application/xml"),"sp").map(e=>{const n=W(e,"spPr"),o=W(n,"xfrm"),i=W(e,"style"),s=W(o,"off"),r=W(o,"ext"),a=W(n,"prstGeom"),l=Object.fromEntries([...W(a,"avLst")?.children??[]].map(b=>[b.getAttribute("name")??"",Number(/val (-?\d+)/u.exec(b.getAttribute("fmla")??"")?.[1]??0)])),c=W(n,"ln"),u=W(e,"txBody"),d=[...u?.children??[]].filter(b=>rt(b)==="p"),h=d.flatMap(b=>[...b.children].filter(x=>rt(x)==="r"))[0],f=W(h,"rPr"),p=W(d[0],"pPr")?.getAttribute("algn"),m=W(u,"bodyPr"),g=m?.getAttribute("anchor"),y=Object.fromEntries(["left","top","right","bottom"].map(b=>[b,m?.getAttribute(`${b[0]}Ins`)]).filter(([,b])=>b!=null).map(([b,x])=>[b,Number(x)]));return{x:_(s,"x"),y:_(s,"y"),width:_(r,"cx"),height:_(r,"cy"),rotation:_(o,"rot")/6e4,preset:a?.getAttribute("prst")??null,adjust:l,paths:a?[]:bu(W(n,"custGeom")),fill:ds(n),fillStyle:_(W(i,"fillRef"),"idx",1),line:c?ds(c):null,lineStyle:_(W(i,"lnRef"),"idx",0),lineWidth:c?.getAttribute("w")?_(c,"w"):null,paragraphs:d.map(b=>us(b,"t").map(x=>x.textContent??"").join("")),size:f?.getAttribute("sz")?_(f,"sz")/100:null,textColor:Ke(W(f,"solidFill"))??Ke(W(i,"fontRef")),align:p==="ctr"?"center":p==="r"?"right":p==="l"?"left":null,anchor:g==="ctr"?"center":g==="b"?"bottom":g==="t"?"top":null,margins:y}})}function xu(t){const e=new DOMParser().parseFromString(t,"application/xml");return new Map([...e.getElementsByTagName("*")].filter(n=>(n.localName||n.tagName).endsWith("Relationship")).map(n=>[n.getAttribute("Id")??"",{type:n.getAttribute("Type")??"",target:n.getAttribute("Target")??""}]))}function ps(t,e){if(e.startsWith("/"))return e;const n=t.split("/").slice(0,-1);for(const o of e.split("/"))o===".."?n.pop():o!=="."&&n.push(o);return n.join("/")}const ao=(t,e)=>{const n=yt(t,e);return n?new TextDecoder().decode(n):null};function fs(t,e,n){const o=Mt(n),i=/drawingml\/2006\/diagram[\s\S]*?r:dm="([^"]+)"/u.exec(o)?.[1];if(!i)return null;const s=X(e),r=xu(ao(t,s.replace(/\/([^/]+)$/u,"/_rels/$1.rels"))??""),a=r.get(i),l=a?ao(t,ps(s,a.target)):null,c=l?/dataModelExt[^>]*relId="([^"]+)"/u.exec(l)?.[1]:void 0,u=c?r.get(c):[...r.values()].find(d=>d.type.endsWith("/diagramDrawing"));return u?ao(t,ps(s,u.target)):null}function ms(t){return/drawingml\/2006\/diagram/u.test(Mt(t))}const lo=(t,e)=>t?{color:t.color,...t.transforms.length?{colorTransforms:t.transforms}:{}}:{color:e};function gs(t,e,n){const o=jt(t,{preset:e.preset??"rect",x:B(Math.round(n.x+e.x)),y:B(Math.round(n.y+e.y)),w:B(Math.max(1,e.width)),h:B(Math.max(1,e.height))});return e.paths.length>0?Pn(o,{paths:e.paths}):Object.keys(e.adjust).length>0&&Ce(o,e.adjust),Da(o,{fill:{idx:e.fill==="none"?0:e.fillStyle||1,...lo(e.fill==="none"?null:e.fill,"accent1")},line:{idx:e.line==="none"?0:e.lineStyle,...lo(e.line==="none"?null:e.line,"accent1")},effect:{idx:0},font:{idx:"minor",...lo(e.textColor,"tx1")}}),e.fill==="none"&&Te(o),e.line==="none"?oe(o):e.lineWidth!==null&&Pe(o,{widthEmu:e.lineWidth}),e.rotation&&ie(o,e.rotation),oi(o,e.paragraphs.join(`
|
|
10
|
+
`)),e.size!==null&&e.paragraphs.some(i=>i.length>0)&&zt(o,{size:e.size}),On(o,e.anchor??"center"),Object.keys(e.margins).length>0&&se(o,e.margins),Tn(o,e.align??"center"),o}const wu={name:"smartart",addCommands:()=>({convertSmartArt:t=>({presentation:e,dispatch:n})=>{const o=xe(e,t.slide),i=ye(e,t.slide,t.shape),s=i?xn(e,i):null,r=o&&i?fs(e,o,i):null,a=r?hs(r):[];if(!o||!i||!s||a.length===0)return!1;if(!n)return!0;const l=aa(i),c=a.map(d=>gs(o,d,{x:s.x,y:s.y})),u=c.length>1?Ko(c,{name:"智能图形"}):c[0];return pt(u,"智能图形"),Sa(i),Wa(u,l),!0}})};function ku(t){return Math.ceil(t.members.length*(t.layout==="grid"?.75:.5))}const ys=Object.fromEntries([...["Cambria","Times New Roman","Times","Georgia","Garamond","Book Antiqua","Bookman Old Style","Palatino Linotype","Palatino","Constantia","Century","Century Schoolbook","Baskerville Old Face","Rockwell","Perpetua","Goudy Old Style","Cambria Math","宋体","SimSun","新宋体","NSimSun","仿宋","FangSong","华文宋体","STSong","华文仿宋","STFangsong","方正书宋_GBK","MS Mincho","MS 明朝","Yu Mincho","游明朝","Batang","바탕","PMingLiU","新細明體","MingLiU"].map(t=>[t,"serif"]),...["Courier New","Courier","Consolas","Lucida Console","Menlo","Monaco","Source Code Pro"].map(t=>[t,"monospace"]),...["Comic Sans MS","Brush Script MT","Segoe Script","Segoe Print","Lucida Handwriting","Script MT Bold","Mistral","Kristen ITC","楷体","KaiTi","楷体_GB2312","华文楷体","STKaiti","华文行楷","STXingkai","标楷体","DFKai-SB"].map(t=>[t,"cursive"])]),bs=new WeakMap;function vu(t,e){const n=t===void 0?0:t>>4;if(n===1)return"serif";if(n===3)return"monospace";if(n===4)return"cursive";if(n!==2&&e&&e.length>=4){const o=parseInt(e.slice(0,2),16),i=parseInt(e.slice(2,4),16);if(o===3)return"cursive";if(o===2&&i>=2&&i<=10)return"serif"}}function Mu(t){let e=bs.get(t);if(e)return e;e=new Map;const n=new TextDecoder;for(const{name:o}of va(t)){if(!/^\/ppt\/(?:slides|slideLayouts|slideMasters|theme)\/[^/]+\.xml$/u.test(o))continue;const i=n.decode(yt(t,o)??new Uint8Array);for(const s of i.matchAll(/<a:(?:latin|ea|cs|sym) typeface="([^"]+)"([^>]*)>/gu)){const r=/\bpitchFamily="(\d+)"/u.exec(s[2])?.[1],a=vu(r===void 0?void 0:Number(r),/\bpanose="([0-9A-Fa-f]+)"/u.exec(s[2])?.[1]);a&&!e.has(s[1])&&e.set(s[1],a)}}return bs.set(t,e),e}const xs="Calibri, 'Helvetica Neue', Arial, sans-serif",Su=xs.replace(/'/gu,"'"),$u=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui"]);function Cu(t,e){const n=Mu(t);return e.replace(/(font-family(?::|=")")([^&]+)(",\s*)(?=Calibri)/gu,(o,i,s,r)=>{const a=n.get(s)??ys[s];return a?`${i}${s}${r}${a}, `:o}).replace(/font-family="([^"&,]+)"/gu,(o,i)=>{if($u.has(i.trim()))return o;const s=n.get(i)??ys[i];return`font-family=""${i}", ${s?`${s}, `:""}${Su}"`})}const Tu=/(<div xmlns="http:\/\/www\.w3\.org\/1999\/xhtml" style=")display:flex;flex-direction:column;justify-content:[^;"]*;([^"]*\bcolumn-count:\d+[^"]*")/gu;function Pu(t){return t.replace(Tu,(e,n,o)=>`${n}display:block;column-fill:auto;${o}`)}function V(t,e){const n=/<g[\s>]|<\/g>/gu;n.lastIndex=e;let o=0;for(let i=n.exec(t);i;i=n.exec(t))if(o+=i[0]==="</g>"?-1:1,o===0)return i.index+4;return-1}function he(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e=Math.imul(e^t.charCodeAt(n),16777619);return(e>>>0).toString(36)}const Ye=1e5;function Eu(t,e,n,o){const i=(a,l)=>`<path d="${e}" fill="none" stroke="${a}" stroke-width="${l.toFixed(2)}"/>`,s=/z\s*$/iu.test(e.trim());let r;if(o==="tri")r=i("white",n)+i("black",n*3/5)+i("white",n/5);else if(o==="dbl"||!s)r=i("white",n)+i("black",n/3);else{const a=o==="thickThin"?`<path d="M-100000 -100000H${Ye}V${Ye}H-100000Z ${e}" fill="white" fill-rule="evenodd"/>`:`<path d="${e}" fill="white"/>`;r=i("white",n)+i("black",n/2)+a}return`<mask id="${t}" maskUnits="userSpaceOnUse" x="-100000" y="-100000" width="${2*Ye}" height="${2*Ye}">${r}</mask>`}function Au(t){const e=o=>new RegExp(`\\s${o}="([^"]+)"`,"u").exec(t)?.[1];if(t.startsWith("<path"))return e("d");if(t.startsWith("<line"))return`M${e("x1")} ${e("y1")}L${e("x2")} ${e("y2")}`;const n=e("points")?.trim().split(/[\s,]+/u);return n&&n.length>=4?`M${n.join(" ").replace(/^(\S+ \S+) /u,"$1L")}`:void 0}function Ou(t,e){const n=Au(t),o=Number(/\sstroke-width="([^"]+)"/u.exec(t)?.[1]);if(!n||!(o>0))return t;const i=`pptx-compound-${he(`${e}|${o}|${n}`)}`,s=/\sfill="none"/u.test(t)||!t.startsWith("<path")?"":t.replace(/\sstroke="[^"]*"/u,' stroke="none"'),r=(/\sfill=/u.test(t)?t.replace(/\sfill="[^"]*"/u,' fill="none"'):t).replace(/\s*\/>$/u,` mask="url(#${i})"/>`);return`${s}<defs>${Eu(i,n,o,e)}</defs>${r}`}function Fu(t,e,n){let o=n;for(const i of nt(e)){const s=sa(i,t);if(!s||s==="sng")continue;const r=o.indexOf(`<g data-pptx-shape-id="${j(i)}"`),a=r<0?-1:V(o,r);if(a<0)continue;const l=o.slice(r,a).replace(/<(?:path|line|polyline)\b[^>]*\sstroke="(?!none")[^"]*"[^>]*\sstroke-width="[^"]+"[^>]*\/>/gu,c=>c.includes("data-pptx")?c:Ou(c,s));o=o.slice(0,r)+l+o.slice(a)}return o}function Nu(t){const e=new Map;for(const n of t.matchAll(/<[a-z]+\b[^>]*\bstroke-opacity="([\d.]+)"[^>]*>/g))if(!(Number(n[1])>=1))for(const o of n[0].matchAll(/\bmarker-(?:start|end)="url\(#([^)]+)\)"/gu))e.set(o[1],n[1]);return e.size===0?t:t.replace(/<marker id="([^"]+)"[^>]*>[\s\S]*?<\/marker>/gu,(n,o)=>{const i=e.get(o);return i===void 0?n:n.replace(/<(path|polygon|circle|ellipse|rect)\b(?![^>]*\bfill-opacity=)/gu,`<$1 fill-opacity="${i}"`)})}const Iu="U+2E80-2FDF, U+3000-30FF, U+3100-31BF, U+3400-4DBF, U+4E00-9FFF, U+AC00-D7AF, U+F900-FAFF, U+FF00-FFEF",ws={song:[["Songti SC Regular","STSongti-SC-Regular","STSong","SimSun","Noto Serif CJK SC","Source Han Serif SC","Hiragino Mincho ProN W3"],["Songti SC Bold","STSongti-SC-Bold","SimSun","Noto Serif CJK SC Bold","Hiragino Mincho ProN W6"]],mincho:[["Hiragino Mincho ProN W3","HiraMinProN-W3","Yu Mincho Regular","YuMincho-Regular","MS Mincho","Songti SC Regular","STSongti-SC-Regular"],["Hiragino Mincho ProN W6","HiraMinProN-W6","Yu Mincho Demibold","YuMincho-Demibold","MS Mincho","Songti SC Bold"]],kai:[["Kaiti SC Regular","STKaitiSC-Regular","STKaiti","KaiTi","BiauKai","Kaiti TC Regular"],["Kaiti SC Bold","STKaitiSC-Bold","STKaiti","KaiTi"]],hei:[["PingFang SC Regular","PingFangSC-Regular","Hiragino Sans GB W3","Microsoft YaHei","Noto Sans CJK SC"],["PingFang SC Semibold","PingFangSC-Semibold","Hiragino Sans GB W6","Microsoft YaHei Bold","Noto Sans CJK SC Bold"]],gothic:[["Hiragino Kaku Gothic ProN W3","HiraKakuProN-W3","Yu Gothic Regular","Meiryo","PingFang SC Regular"],["Hiragino Kaku Gothic ProN W6","HiraKakuProN-W6","Yu Gothic Bold","Meiryo Bold","PingFang SC Semibold"]]},ks=t=>`qk-cjk-${t}`;function Lu(){return Object.keys(ws).flatMap(t=>ws[t].map((e,n)=>`@font-face{font-family:${ks(t)};font-weight:${n?700:400};src:${e.map(o=>`local("${o}")`).join(",")};unicode-range:${Iu}}`)).join("")}function co(t,e){return/楷|Kai/iu.test(t)?"kai":/明朝|Mincho|宋|Song|細明|Ming|仿宋|FangSong|教科書/iu.test(t)?e==="Jpan"?"mincho":"song":e==="Jpan"?"gothic":"hei"}const vs=new WeakMap;function Ms(t){let e=vs.get(t);if(e)return e;const n=new TextDecoder().decode(yt(t,"/ppt/theme/theme1.xml")??new Uint8Array),o=i=>{const s=new RegExp(`<a:${i}>([\\s\\S]*?)</a:${i}>`,"u").exec(n)?.[1]??"",r=new Map([["",/<a:ea typeface="([^"]*)"/u.exec(s)?.[1]??""]]);for(const a of s.matchAll(/<a:font script="([^"]+)" typeface="([^"]*)"/gu))r.set(a[1],a[2]);return r};return e={major:o("majorFont"),minor:o("minorFont")},vs.set(t,e),e}function Ru(t,e,n){if(/[\u3040-\u30ff]/u.test(e))return"Jpan";if(/[\uac00-\ud7af]/u.test(e))return"Hang";if(co(n.get("Hans")??"","Hans")===co(n.get("Hant")??"","Hant"))return"Hans";const o=/\blang="(ja|zh|ko)(-[A-Za-z]+)?"/u.exec(Mt(t));return o?.[1]==="ja"?"Jpan":/-(TW|HK|MO)/iu.test(o?.[2]??"")?"Hant":"Hans"}const ju=/[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af]/u,Ss=/>[^<]*[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af]/u;function Du(t,e){const n=zo(e),o=/title/iu.test(n??"");for(let i=0;i<Me(e);i+=1)for(let s=0;s<kn(e,i);s+=1){const r=Mn(e,i,s)??"";if(!ju.test(r))continue;let a=qo(e,i,s)?.fontEastAsian??(n?vn(t,e,i,s)?.fontEastAsian:void 0)??(o?"+mj-ea":"+mn-ea");const l=a==="+mj-ea"?Ms(t).major:Ms(t).minor,c=Ru(e,r,l);return(a==="+mj-ea"||a==="+mn-ea")&&(a=l.get("")||l.get(c)||""),co(a,c)}return null}function Bu(t,e,n){let o=n,i=!1;if(!Ss.test(n))return n;for(const s of nt(e)){const r=o.indexOf(`<g data-pptx-shape-id="${j(s)}"`),a=r<0?-1:V(o,r);if(a<0||!Ss.test(o.slice(r,a))||st(s)!=="text")continue;const l=Du(t,s);if(!l)continue;const c=l==="hei"||l==="gothic"?/(font-family(?::|=")"[^&]+",\s*)(?=(?:serif|cursive|monospace),)/gu:/(font-family(?::|=")"[^&]+",\s*)/gu,u=o.slice(r,a).replace(c,`$1${ks(l)}, `);u!==o.slice(r,a)&&(o=o.slice(0,r)+u+o.slice(a),i=!0)}return i?o.replace(/(<svg\b[^>]*>)/u,`$1<defs><style>${Lu()}</style></defs>`):o}const zu=/\s(?:eaLnBrk|latinLnBrk|hangingPunct)="/u,$s=new WeakMap;function uo(t,e){const n=e?yt(t,e):null;if(!n)return!1;let o=$s.get(n);return o===void 0&&(o=zu.test(new TextDecoder().decode(n)),$s.set(n,o)),o}function Wu(t){return[t.asianLineBreak===!1?"line-break:anywhere":"",t.latinLineBreak===!0?"word-break:break-all":"",t.hangingPunctuation===!0?"hanging-punctuation:allow-end":""].filter(Boolean).join(";")}function qu(t,e,n){if(!n.includes("data-pptx-paragraph"))return n;const o=Se(e);if(!(uo(t,X(e))||o!==null&&(uo(t,$e(o))||uo(t,_o(o)))))return n;const i=new Set;for(const r of n.matchAll(/<p data-pptx-paragraph=/gu)){const a=n.lastIndexOf('<g data-pptx-shape-id="',r.index);a>=0&&i.add(n.slice(a+23,n.indexOf('"',a+23)))}let s=n;for(const r of nt(e)){if(!i.has(String(j(r))))continue;const a=s.indexOf(`<g data-pptx-shape-id="${j(r)}"`),l=a<0?-1:V(s,a);if(l<0||st(r)!=="text"||!s.slice(a,l).includes("<p data-pptx-paragraph="))continue;let c=0;try{c=Me(r)}catch{continue}const u=Array.from({length:c},(h,f)=>{try{return Wu(Xr(t,r,f)??{})}catch{return""}});if(u.every(h=>!h))continue;const d=s.slice(a,l).replace(/<p data-pptx-paragraph="(\d+)" style="([^"]*)"/gu,(h,f,p)=>{const m=u[Number(f)];return m?`<p data-pptx-paragraph="${f}" style="${p.replace(/;?$/u,";")}${m}"`:h});s=s.slice(0,a)+d+s.slice(l)}return s}const Gu=/<linearGradient\b([^>]*\bgradientUnits="objectBoundingBox"[^>]*)>/gu,Uu=/<radialGradient\b([^>]*\bgradientUnits="objectBoundingBox"[^>]*)>/gu,Cs=(t,e)=>Number(new RegExp(`\\s${e}="([-\\d.]+)"`,"u").exec(t)?.[1]),Ts=t=>Number(t.toFixed(4)).toString();function Hu(t){return _u(t).replace(Uu,(e,n)=>{const o=l=>Cs(n,l),[i,s,r]=["cx","cy","r"].map(o);if(![i,s,r].every(Number.isFinite))return e;const a=Math.max(Math.hypot(i,s),Math.hypot(1-i,s),Math.hypot(i,1-s),Math.hypot(1-i,1-s));return r<a-1e-4?e.replace(/\sr="[-\d.]+"/u,` r="${Ts(a)}"`):e})}function _u(t){return t.replace(Gu,(e,n)=>{const o=y=>Cs(n,y),[i,s,r,a]=["x1","y1","x2","y2"].map(o);if(![i,s,r,a].every(Number.isFinite))return e;const l=r-i,c=a-s,u=Math.hypot(l,c);if(Math.abs(u-1)>.001)return e;const[d,h]=[l/u,c/u],f=(Math.abs(d)+Math.abs(h))/2,[p,m]=[(i+r)/2,(s+a)/2],g={x1:p-d*f,y1:m-h*f,x2:p+d*f,y2:m+h*f};return e.replace(/\s(x1|y1|x2|y2)="[-\d.]+"/gu,(y,b)=>` ${b}="${Ts(g[b])}"`)})}const Vu=/<g\b[^>]*>|<\/g>|<pattern\b[^>]*>|<\/pattern>|<[a-z]+\b[^>]*\bstroke-width="[^"]*"[^>]*>/g,Ku=/^<g data-pptx-shape-id="\d+"><g transform="[^"]*\bscale\(([-\d.e]+) ([-\d.e]+)\)">/u;function Yu(t){const e=[];let n=1,o=!1;return t.replace(Vu,(i,s)=>{if(i==="</pattern>")return o=!1,i;if(i==="</g>")return n/=e.pop()??1,i;if(i.startsWith("<g")&&!/\bstroke-width=/u.test(i)){const a=i.startsWith("<g transform=")?Ku.exec(t.slice(t.lastIndexOf("<g data-pptx-shape-id=",s),s+i.length)):null,l=a&&Math.sqrt(Math.abs(Number(a[1])*Number(a[2])))||1;return e.push(l),n*=l,i}if(i.startsWith("<g")&&e.push(1),Math.abs(n-1)<1e-6)return i;if(i.startsWith("<pattern"))return o=!0,/\bpatternTransform=/u.test(i)?i:i.replace(/^<pattern\b/u,`<pattern patternTransform="scale(${1/n})"`);if(o)return i;const r=a=>String(Number((Number(a)/n).toFixed(4)));return i.replace(/\bstroke-width="([\d.]+)"/u,(a,l)=>`stroke-width="${r(l)}"`).replace(/\bstroke-dasharray="([^"]+)"/u,(a,l)=>`stroke-dasharray="${l.split(/[\s,]+/u).map(r).join(" ")}"`)})}const Ps=9525,Es=1e5,As=/<line\b|marker-(?:start|end)=/u,Xe=t=>Number(t.toFixed(3)).toString();function Xu(t,e,n){if(!As.test(n))return n;let o=n;for(const i of nt(e)){const s=`<g data-pptx-shape-id="${j(i)}">`,r=o.indexOf(s),a=r<0?-1:V(o,r);if(a<0)continue;const l=o.slice(r,a);if(l.includes("filter=")||!As.test(l))continue;const c=Do(t,i).find(m=>m.kind==="outerShdw");if(!c||c.kind!=="outerShdw"||(c.scaleX??1)!==1||(c.scaleY??1)!==1||(c.skewX??0)!==0||(c.skewY??0)!==0)continue;const u=c.angleDeg*Math.PI/180,d=c.distEmu/Ps,h=`dx="${Xe(d*Math.cos(u))}" dy="${Xe(d*Math.sin(u))}" stdDeviation="${Xe(c.blurEmu/Ps/2)}" flood-color="${c.color}" flood-opacity="${Xe(c.opacity??1)}"`,f=`pptx-shadow-${he(h)}`,p=l.slice(s.length,-4);o=`${o.slice(0,r)}${s}<defs><filter id="${f}" filterUnits="userSpaceOnUse" x="-100000" y="-100000" width="${2*Es}" height="${2*Es}"><feDropShadow ${h}/></filter></defs><g filter="url(#${f})">${p}</g></g>${o.slice(a)}`}return o}function Ze(t,e,n){const o=X(e),i=j(n);if((mn(t,o,i)??[]).length===0){const r=Zn(t,o,i);return r?{x:r.frame.x,y:r.frame.y,width:r.frame.width,height:r.frame.height}:null}const s=ve(n);return s?{x:s.x,y:s.y,width:s.w,height:s.h}:null}const Je=9525;function Zu(t,e){const n=Do(t,e).find(l=>l.kind==="outerShdw");if(!n||n.kind!=="outerShdw")return null;const{scaleX:o=1,scaleY:i=1,skewX:s=0,skewY:r=0,alignment:a="b"}=n;return o===1&&i===1&&s===0&&r===0?null:{scaleX:o,scaleY:i,skewX:s,skewY:r,alignment:a}}function Ju(t,e){return[e.endsWith("l")?t.x:e.endsWith("r")?t.x+t.width:t.x+t.width/2,e.startsWith("t")?t.y:e.startsWith("b")?t.y+t.height:t.y+t.height/2]}const $t=t=>Number(t.toFixed(3)).toString();function Qu(t,e,n){let o=n;if(!n.includes("<feDropShadow"))return n;for(const i of nt(e)){const s=o.indexOf(`<g data-pptx-shape-id="${j(i)}"`),r=s<0?-1:V(o,s);if(r<0||!o.slice(s,r).includes("<feDropShadow"))continue;const a=Zu(t,i),l=a?Ze(t,e,i):null;!a||!l||(o=o.slice(0,s)+td(o.slice(s,r),a,l)+o.slice(r))}return o}function td(t,e,n){const o=/<feDropShadow\b([^>]*)\/>/u.exec(t),i=o?/<filter id="([^"]+)"/u.exec(t.slice(0,o.index).slice(t.slice(0,o.index).lastIndexOf("<filter")))?.[1]:void 0,s=i?t.indexOf(`<g filter="url(#${i})"`):-1,r=s<0?-1:V(t,s);if(!o||r<0)return t;const a=$=>new RegExp(`\\s${$}="([^"]*)"`,"u").exec(o[1])?.[1],[l,c,u]=["dx","dy","stdDeviation"].map($=>Number(a($)??0)),d=a("result"),h=t.replace(o[0],`<feFlood flood-opacity="0"${d?` result="${d}"`:""}/>`),[f,p]=Ju({x:n.x/Je,y:n.y/Je,width:n.width/Je,height:n.height/Je},e.alignment),{scaleX:m,scaleY:g,skewX:y,skewY:b}=e,x=`translate(${$t(f+l)} ${$t(p+c)}) skewX(${$t(y)}) skewY(${$t(b)}) scale(${$t(m)} ${$t(g)}) translate(${$t(-f)} ${$t(-p)})`,w=t.slice(s,r),k=`pptx-perspective-${he(w+x)}`,v=`<defs>${`<filter id="${k}" x="-50%" y="-50%" width="200%" height="200%"><feFlood flood-color="${a("flood-color")??"#000000"}" flood-opacity="${a("flood-opacity")??"1"}"/><feComposite in2="SourceAlpha" operator="in"/><feGaussianBlur stdDeviation="${$t(u)}"/></filter>`}</defs><g transform="${x}" filter="url(#${k})" data-pptx-perspective-shadow="">${w.replace(/^<g filter="url\(#[^"]+\)"/u,"<g")}</g>`,M=h.indexOf(w);return M<0?t:h.slice(0,M)+v+h.slice(M)}const ho=9525,Qe=76200,ed=t=>t*Math.PI/180;function nd(t,e,n){const{latitudeDeg:o,longitudeDeg:i,revolutionDeg:s}=t;if(o%360===0&&i%360===0&&s%360===0)return null;const[r,a,l]=[-i,-o,-s].map(ed),c=[Math.cos(r),Math.sin(r)*Math.sin(a)],u=[0,Math.cos(a)],d=g=>[Math.cos(l)*g[0]-Math.sin(l)*g[1],Math.sin(l)*g[0]+Math.cos(l)*g[1]],[h,f]=d(c),[p,m]=d(u);return`matrix(${[h,f,p,m,e-h*e-p*n,n-f*e-m*n].map(g=>g.toFixed(6)).join(" ")})`}function od(t,e,n){const o=Math.max(.5,e/ho/2),i=Math.min(8,Math.max(1,n/Math.max(1,e)*3)),s='<feDistantLight azimuth="225" elevation="45"/>';return`<filter id="${t}" x="-10%" y="-10%" width="120%" height="120%" color-interpolation-filters="sRGB"><feGaussianBlur in="SourceAlpha" stdDeviation="${o.toFixed(2)}" result="height"/><feDiffuseLighting in="height" surfaceScale="${i.toFixed(2)}" diffuseConstant="1.2" lighting-color="#fff" result="shade">${s}</feDiffuseLighting><feComposite in="SourceGraphic" in2="shade" operator="arithmetic" k1="1" result="lit"/><feSpecularLighting in="height" surfaceScale="${i.toFixed(2)}" specularConstant="0.6" specularExponent="20" lighting-color="#fff" result="gloss">${s}</feSpecularLighting><feComposite in="gloss" in2="SourceAlpha" operator="in" result="glossInside"/><feComposite in="lit" in2="glossInside" operator="arithmetic" k2="1" k3="1"/><feComposite in2="SourceAlpha" operator="in"/></filter>`}function id(t,e,n){let o=n;for(const i of nt(e)){const s=st(i)==="text"?Zr(i):null,r=s?.scene?.cameraRotation,a=s&&(r||s.bevelTop)?Ze(t,e,i):null,l=a?o.indexOf(`<g data-pptx-shape-id="${j(i)}"`):-1,c=l<0?-1:V(o,l);if(!s||!a||c<0)continue;let u=o.slice(l,c);const d=u.indexOf("<g data-pptx-shape-name=");if(d<0)continue;const h=V(u,d),f=u.indexOf(">",d)+1;let p=u.slice(f,h-4);if(s.bevelTop){const g=p.indexOf("<g"),y=g<0?-1:V(p,g);if(y>0){const b=`pptx-bevel-${he(`${s.bevelTop.widthEmu??Qe}|${s.bevelTop.heightEmu??Qe}`)}`,x=od(b,s.bevelTop.widthEmu??Qe,s.bevelTop.heightEmu??Qe);p=`${p.slice(0,g)}<defs>${x}</defs><g filter="url(#${b})">${p.slice(g,y)}</g>${p.slice(y)}`}}const m=r?nd(r,(a.x+a.width/2)/ho,(a.y+a.height/2)/ho):null;m&&(p=`<g transform="${m}">${p}</g>`),u=u.slice(0,f)+p+u.slice(h-4),o=o.slice(0,l)+u+o.slice(c)}return o}const tn=t=>[...t.children],Ot=t=>t.localName||t.tagName.replace(/^.*:/u,""),Z=(t,e)=>t?tn(t).find(n=>Ot(n)===e):void 0,it=(t,e)=>Number(t?.getAttribute(e)??NaN);function Os(t,e){const n=[...new DOMParser().parseFromString(t,"application/xml").getElementsByTagName("*")].filter(o=>Ot(o)==="sp");return n.length===e?n:null}const sd=new Set(["comp","inv","gray","gamma","invGamma"]),rd=new Set(["hue","hueOff"]);function Fs(t){const e=tn(t).find(i=>["srgbClr","schemeClr","prstClr"].includes(Ot(i))),n=e?.getAttribute("val");if(!e||!n)return null;const o=Ot(e)==="srgbClr"?`#${n}`:Ot(e)==="prstClr"?n==="white"?"#FFFFFF":n==="black"?"#000000":null:n;return o?{color:o,colorTransforms:tn(e).map(i=>{const s=Ot(i);return sd.has(s)?{kind:s}:{kind:s,value:it(i,"val")/(rd.has(s)?6e4:1e5)}})}:null}function ad(t){const e=tn(Z(t,"gsLst")??t).filter(a=>Ot(a)==="gs").map(a=>{const l=Fs(a);return l?{offset:it(a,"pos")/1e5,color:l.color,...l.colorTransforms.length?{colorTransforms:l.colorTransforms}:{}}:null});if(e.length<2||e.some(a=>a===null))return null;const n=Z(t,"lin"),o=Z(t,"path"),i=a=>({left:(it(a,"l")||0)/1e5,top:(it(a,"t")||0)/1e5,right:(it(a,"r")||0)/1e5,bottom:(it(a,"b")||0)/1e5}),s=Z(o,"fillToRect"),r=Z(t,"tileRect");return{stops:e,...n?{angleDeg:(it(n,"ang")||0)/6e4,scaled:n.getAttribute("scaled")==="1"}:{},...o?{path:o.getAttribute("path")??"circle"}:{},...s?{focus:i(s)}:{},...r?{tileRect:i(r)}:{}}}function ld(t,e){Os(t,e.length)?.forEach((n,o)=>{const i=e[o],s=Z(n,"spPr"),r=Z(s,"solidFill"),a=Z(s,"gradFill"),l=r?Fs(r):null;if(Z(s,"noFill"))Te(i);else if(a){const c=ad(a);c&&En(i,c)}else l&&!l.colorTransforms.length?Qo(i,l.color):l&&En(i,{stops:[0,1].map(c=>({offset:c,color:l.color,colorTransforms:l.colorTransforms}))})})}const cd=new Set(["horz","vert","vert270","wordArtVert","eaVert","mongolianVert","wordArtVertRtl"]),ud=[91440,45720,91440,45720];function Ns(t){const e=Z(t,"off"),n=Z(t,"ext"),o={x:it(e,"x"),y:it(e,"y"),width:it(n,"cx"),height:it(n,"cy")};return Object.values(o).every(Number.isFinite)?o:null}function dd(t){return["lIns","tIns","rIns","bIns"].map((e,n)=>{const o=it(t,e);return Number.isFinite(o)?o:ud[n]})}function hd(t){const e=[...t?.getElementsByTagName("*")??[]].find(s=>Ot(s)==="rPr"),n=s=>e?.getAttribute(s)==="1"?!0:e?.getAttribute(s)==="0"?!1:void 0,o=n("b"),i=n("i");return{...o===void 0?{}:{bold:o},...i===void 0?{}:{italic:i}}}function pd(t,e){Os(t,e.length)?.forEach((n,o)=>{const i=e[o],s=Z(n,"txBody"),r=Z(s,"bodyPr");if(!r)return;const a=hd(s);Object.keys(a).length>0&&/\S/u.test(s?.textContent??"")&&zt(i,a);const l=Z(Z(n,"spPr"),"xfrm"),c=Ns(l),u=Z(n,"txXfrm"),d=Ns(u),h=(it(l,"rot")||0)/6e4,f=(it(u,"rot")||0)/6e4,p=d?(f%360+360)%360:0,m=p===270?"vert270":p===90?"vert":r.getAttribute("vert");if(m&&m!=="horz"&&cd.has(m)&&Ba(i,m),!c||!d||p!==0&&p!==90&&p!==270)return;const g=p!==0?{width:c.height,height:c.width}:{width:c.width,height:c.height},y=-(h+f)*Math.PI/180,b=d.x+d.width/2-c.x-c.width/2,x=d.y+d.height/2-c.y-c.height/2,w={x:b*Math.cos(y)-x*Math.sin(y),y:b*Math.sin(y)+x*Math.cos(y)},[k,v,M,$]=dd(r),N={left:(g.width-d.width)/2+w.x+k,top:(g.height-d.height)/2+w.y+v,right:(g.width-d.width)/2-w.x+M,bottom:(g.height-d.height)/2-w.y+$};Object.values(N).every(U=>U>=0)&&N.left+N.right<g.width&&N.top+N.bottom<g.height&&se(i,Object.fromEntries(Object.entries(N).map(([U,J])=>[U,Math.round(J)])))})}const en=9525,fd=200,pe=new Map;function md(t,e,n,o=!1){const i=ee(t),s=he(`${o?"svg":"html"}|${JSON.stringify(i)}|${e}`),r=pe.get(s);if(r!==void 0)return r;const a=bn(),l=Pt(t);l&&Ee(a,l),i&&Jo(a,i),Fo(a);const c=Q(a)[0],u=hs(e).map(h=>gs(c,h,{x:0,y:0}));ld(e,u),pd(e,u);let d=n(a,c,Nn(a,c,{background:!1,...o?{textLayout:"svg"}:{}})).replace(/^[\s\S]*?<svg\b[^>]*>/u,"").replace(/<\/svg>\s*$/u,"").replace(/data-pptx-shape-id="/gu,'data-pptx-smartart-shape="');for(const h of new Set([...d.matchAll(/\sid="([^"]+)"/gu)].map(f=>f[1]))){const f=h.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");d=d.replace(new RegExp(`(\\sid="|url\\(#|href="#)${f}(?=[")])`,"gu"),`$1sa${s}-${h}`)}return pe.set(s,d),pe.size>fd&&pe.delete(pe.keys().next().value),d}function gd(t,e,n,o,i){const s=mn(t,e,j(n))?.[0],r=Zn(t,e,j(n)),a=ve(n),l=s?`<g data-pptx-shape-id="${j(s)}">`:"",c=l?o.indexOf(l):-1,u=c<0?-1:V(o,c);if(!r||!a||a.w<=0||a.h<=0||u<0)return o;const{frame:d}=r,h=`translate(${d.x/en} ${d.y/en}) scale(${d.width/a.w} ${d.height/a.h})`;return`${o.slice(0,u)}<g data-pptx-shape-id="${j(n)}"><g transform="${h}" data-pptx-smartart="">${i}</g></g>${o.slice(u)}`}function yd(t,e,n,o){if(typeof DOMParser>"u"||!n.includes("graphicFrame"))return n;let i=n;const s=X(e);for(const r of nt(e)){if(ne(r)!=="graphicFrame"||!ms(r))continue;const a=fs(t,e,r);if(!a)continue;const l=md(t,a,o,!n.includes("<foreignObject")),c=`<g data-pptx-shape-id="${j(r)}">`,u=i.indexOf(c),d=u<0?-1:V(i,u),h=Ze(t,e,r);if(d>=0&&h){const f=`<g transform="translate(${h.x/en} ${h.y/en})" data-pptx-smartart="">${l}</g>`;i=`${i.slice(0,u)}${c}${f}</g>${i.slice(d)}`;continue}i=gd(t,s,r,i,l)}return i}const bd=/<feMorphology in="SourceAlpha" operator="erode" radius="([\d.]+)" result="softCore(\d+)"\/><feGaussianBlur in="softCore\2" stdDeviation="[\d.]+" result="softMask\2"\/>/gu;function xd(t){return Sd(t.replace(bd,(e,n,o)=>`<feGaussianBlur in="SourceAlpha" stdDeviation="${n}" result="softBlur${o}"/><feComponentTransfer in="softBlur${o}" result="softMask${o}"><feFuncA type="linear" slope="2" intercept="-1"/></feComponentTransfer>`))}const wd=/<filter id="([^"]+)"[^>]*><feGaussianBlur in="SourceAlpha" stdDeviation="([\d.]+)" result="softBlur(\d+)"\/><feComponentTransfer in="softBlur\3" result="softMask\3"><feFuncA type="linear" slope="2" intercept="-1"\/><\/feComponentTransfer><feComposite in="SourceGraphic" in2="softMask\3" operator="in" result="softOut\3"\/><feMerge><feMergeNode in="softOut\3"\/><\/feMerge><\/filter>/gu,kd=/<g filter="url\(#([^)]+)\)"><path d="M([-\d.]+),([-\d.]+) C[-\d., ]+? ([-\d.]+),([-\d.]+) C[-\d., ]+? ([-\d.]+),([-\d.]+) C[-\d., ]+? ([-\d.]+),([-\d.]+) C[-\d., ]+ Z" fill="(#[0-9A-Fa-f]{6})"((?: fill-opacity="[\d.]+")?) stroke="none"[^>]*\/><\/g>/gu,vd=.5,Md=.02;function Is(t){const e=1/(1+.3275911*Math.abs(t)),n=1-((((1.061405429*e-1.453152027)*e+1.421413741)*e-.284496736)*e+.254829592)*e*Math.exp(-t*t);return t<0?-n:n}function Sd(t){const e=new Map;for(const o of t.matchAll(wd))e.set(o[1],Number(o[2]));if(e.size===0)return t;let n=0;return t.replace(kd,(o,i,...s)=>{const r=e.get(i),[a,l,c,u,d,h,f,p,m,g]=s;if(r===void 0)return o;const y=Number(a),b=Number(d),x=Number(u),w=Number(p),k=(b-y)/2,v=(w-x)/2;if(!(k>0)||Math.abs(k-v)>Md*k||Math.abs(Number(l)-Number(h))>.01||Math.abs(Number(c)-Number(f))>.01)return o;const M=g?Number(/[\d.]+/u.exec(g)[0]):1,$=(k+v)/2,N=Math.min(1,3*r/$),U=Array.from({length:9},(G,I)=>{const K=1-N*(1-I/8),D=Math.max(0,Is(($*(1-K)-vd)/(r*Math.SQRT2)));return`<stop offset="${K.toFixed(4)}" stop-color="${m}" stop-opacity="${(D*M).toFixed(4)}"/>`}),J=N<1?`<stop offset="0" stop-color="${m}" stop-opacity="${(Is($/(r*Math.SQRT2))*M).toFixed(4)}"/>`:"",lt=`${i}-soft${n++}`,gt=o.slice(o.indexOf("<path"),o.lastIndexOf("</g>"));return`<g><defs><radialGradient id="${lt}">${J}${U.join("")}</radialGradient></defs>${gt.replace(/ fill="#[0-9A-Fa-f]{6}"(?: fill-opacity="[\d.]+")?/u,` fill="url(#${lt})"`)}</g>`})}const nn=9525;function Ls(t){let e="";for(let n=0;n<t.length;n+=32768)e+=String.fromCharCode(...t.subarray(n,n+32768));return`data:image/svg+xml;base64,${btoa(e)}`}function Rs(t,e){if(/<image\b/u.test(t))return t.replace(/<image\b[^>]*>/g,l=>l.replace(/(\s(?:xlink:)?href=")[^"]*(")/g,`$1${e}$2`));const n=t.indexOf('data-pptx-fallback="image"');if(n<0)return t;const o=t.lastIndexOf("<g",n),i=V(t,o),s=/<rect x="([^"]+)" y="([^"]+)" width="([^"]+)" height="([^"]+)"/u.exec(t.slice(o,i)),r=/^<g[^>]*?(\stransform="[^"]*")/u.exec(t.slice(o))?.[1]??"";if(!s||i<0)return t;const a=`<g${r}><image x="${s[1]}" y="${s[2]}" width="${s[3]}" height="${s[4]}" href="${e}" preserveAspectRatio="none"/></g>`;return t.slice(0,o)+a+t.slice(i)}const on=t=>t.toFixed(2);function $d(t,e,n){const o=ve(e);if(!o)return t;const i=`<rect x="${on(o.x/nn)}" y="${on(o.y/nn)}" width="${on(o.w/nn)}" height="${on(o.h/nn)}"`;for(let s=t.indexOf('<g data-pptx-fallback="image"');s>=0;s=t.indexOf('<g data-pptx-fallback="image"',s+1)){const r=V(t,s);if(r>0&&t.slice(s,r).includes(i))return t.slice(0,s)+Rs(t.slice(s,r),n)+t.slice(r)}return t}function Cd(t,e,n){let o=n;const i=X(e);for(const l of nt(e)){const c=st(l)==="picture"?_e(t,i,l):null,u=c?yt(t,c):null,d=u?o.indexOf(`<g data-pptx-shape-id="${j(l)}"`):-1,h=d<0?-1:V(o,d);!u||h<0||(o=o.slice(0,d)+Rs(o.slice(d,h),Ls(u))+o.slice(h))}const s=Se(e);if(!s||!o.includes('data-pptx-fallback="image"'))return o;const r=_o(s),a=[...da(t,s).map(l=>[$e(s),l]),...r?fa(t,s).map(l=>[r,l]):[]];for(const[l,c]of a){const u=st(c)==="picture"?_e(t,l,c):null,d=u?yt(t,u):null;d&&(o=$d(o,c,Ls(d)))}return o}const js=32;function Td(t,e){const[n,o,i]=[1,3,5].map(a=>parseInt(e.slice(a,a+2),16)/255),s=(a,l,c)=>[0,1,2].map(u=>u===a?c*js:0).join(" ")+` 0 ${(-c*js*l).toFixed(3)}`,r=a=>`${s(0,n,a)} ${s(1,o,a)} ${s(2,i,a)} 0 0 0 1 0`;return`<filter id="${t}" color-interpolation-filters="sRGB"><feColorMatrix in="SourceGraphic" type="matrix" values="${r(1)}" result="above"/><feColorMatrix in="SourceGraphic" type="matrix" values="${r(-1)}" result="below"/><feComposite in="above" in2="below" operator="arithmetic" k2="1" k3="1" result="distance"/><feColorMatrix in="distance" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0" result="mask"/><feComposite in="SourceGraphic" in2="mask" operator="in"/></filter>`}function Pd(t,e){let n=e;for(const o of nt(t)){const i=st(o)==="picture"?ns(o):null,s=i?n.indexOf(`<g data-pptx-shape-id="${j(o)}"`):-1,r=s<0?-1:V(n,s);if(!i||r<0)continue;const a=`pptx-transparent-${i.slice(1)}`,l=n.slice(s,r).replace(/<image\b[^>]*\/>/,c=>`<defs>${Td(a,i)}</defs><g filter="url(#${a})">${c}</g>`);n=n.slice(0,s)+l+n.slice(r)}return n}function Ds(t,e,n){const o=qo(t,e,n)?.colorTransforms?.find(i=>i.kind==="alpha");return o&&"value"in o&&typeof o.value=="number"?o.value:1}function Ed(t){let e=null;for(let n=0;n<Me(t);n+=1)for(let o=0;o<kn(t,n);o+=1){if(!Mn(t,n,o))continue;const i=Ds(t,n,o);if(e!==null&&Math.abs(e-i)>.001)return null;e=i}return e}function Ad(t,e){let n=e;for(const o of nt(t)){const i=st(o)==="text"&&!os(o)?Ed(o):null,s=i!==null&&i<1?n.indexOf(`<g data-pptx-shape-id="${j(o)}"`):-1,r=s<0?-1:V(n,s);if(r<0)continue;const a=n.slice(s,r).replace(/<foreignObject\b/gu,`<foreignObject opacity="${i}"`).replace(/<g data-pptx-paragraph=/gu,`<g opacity="${i}" data-pptx-paragraph=`);n=n.slice(0,s)+a+n.slice(r)}return n}function Od(t,e){return e==="wordArtVert"?t.replace(/writing-mode:vertical-rl;text-orientation:upright/gu,"writing-mode:vertical-lr;text-orientation:upright"):t.replace(/(writing-mode:vertical-rl;text-orientation:upright);direction:rtl/gu,"$1")}function Fd(t,e,n){let o=n;if(!n.includes("writing-mode:vertical-rl"))return n;for(const i of nt(e)){const s=o.indexOf(`<g data-pptx-shape-id="${j(i)}"`),r=s<0?-1:V(o,s);if(r<0||!o.slice(s,r).includes("writing-mode:vertical-rl"))continue;const a=st(i)==="text"?jo(t,i).vert:null;if(a!=="vert"&&a!=="vert270"&&a!=="wordArtVert"&&a!=="wordArtVertRtl")continue;const l=o.slice(s,r),c=a==="vert"||a==="vert270"?l.replace(/writing-mode:vertical-rl(?!;text-orientation)/gu,"writing-mode:vertical-rl;text-orientation:sideways"):Od(l,a);o=o.slice(0,s)+c+o.slice(r)}return o}const po=t=>Math.min(Math.max(t,0),359.99999),Nd={archUp:t=>{const e=po(t),n=((540-2*e)%360+360)%360;return{start:e,sweep:n===0?360:n}},archDown:t=>{const e=po(t),n=((180-e)%360+360)%360;if(n===0)return{start:n,sweep:-180};const o=((e-n)%360+360)%360;return{start:n,sweep:o===0?-360:o-360}},circle:t=>{const e=po(t);return{start:e,sweep:2*(e>180?360-e:e<180?180-e:179.99999)}}},Id={archUp:180,archDown:0,circle:180};function Ld(t,e){if(t.kind!=="path")return t;const n=Nd[t.path](e===null?Id[t.path]:e/6e4);return{...t,start:n.start*Math.PI/180,sweep:n.sweep*Math.PI/180}}function Rd(t){const e=/<a:prstTxWarp\b[^>]*>([\s\S]*?)<\/a:prstTxWarp>/u.exec(t)?.[1]??"",n=/<a:gd name="adj1?" fmla="val (-?\d+)"/u.exec(e)?.[1];return n===void 0?null:Number(n)}const jd=.8,Bs=1.2,zs=t=>t.reduce((e,n)=>e+n.width,0),Ws=t=>Math.max(1,...t.map(e=>e.style.size));function Dd(t,e,n,o){const i=t.length,s=(r,a)=>({x:e.x+r*e.width,y:e.y+(n(r)+a*(o(r)-n(r)))*e.height});return t.flatMap((r,a)=>{const l=zs(r);if(l<=0)return[];const c=Ws(r);let u=0;return r.map(d=>{const h=(u+d.width/2)/l;u+=d.width;const f=s(h,(a+jd)/i),p=s(Math.max(0,h-.01),(a+.5)/i),m=s(Math.min(1,h+.01),(a+.5)/i),g=(o(h)-n(h))*e.height/i;return{glyph:d,x:f.x,y:f.y,angle:Math.atan2(m.y-p.y,m.x-p.x)*180/Math.PI,shear:!0,scaleX:e.width/l,scaleY:g/(c*Bs)}})})}function Bd(t,e,n){const{path:o}=n,i=e.x+e.width/2,s=e.y+e.height/2;let r=0;return t.flatMap(a=>{const l=Ws(a),c=Math.max(1,e.width/2-r),u=Math.max(1,e.height/2-r);r+=l*Bs;const[d,h]=n.start!==void 0&&n.sweep!==void 0?[n.start,n.sweep]:o==="archUp"?[Math.PI,Math.PI]:o==="archDown"?[Math.PI,-Math.PI]:[-Math.PI/2,2*Math.PI],f=360,p=[0];for(let x=1;x<=f;x+=1){const w=d+h*(x-1)/f,k=d+h*x/f;p.push(p[x-1]+Math.hypot(c*(Math.cos(k)-Math.cos(w)),u*(Math.sin(k)-Math.sin(w))))}const m=p[f],g=zs(a),y=g>m*.98?m*.98/g:1;let b=o==="circle"?0:(m-g*y)/2;return a.map(x=>{const w=b+x.width*y/2;b+=x.width*y;let k=p.findIndex($=>$>=w);k<0&&(k=f);const v=d+h*k/f,M=Math.atan2(u*Math.cos(v)*Math.sign(h),-c*Math.sin(v)*Math.sign(h));return{glyph:x,x:i+c*Math.cos(v),y:s+u*Math.sin(v),angle:M*180/Math.PI,shear:!1,scaleX:y,scaleY:1}})})}function zd(t,e,n){const o=t.filter(i=>i.length>0);return o.length===0||e.width<=0||e.height<=0?[]:n.kind==="path"?Bd(o,e,n):Dd(o,e,n.top,n.bottom)}const L=.2,at=t=>1-(2*t-1)**2,sn=t=>1-Math.abs(2*t-1),qs=t=>Math.max(0,1-Math.min(t,1-t)/.25),wt=t=>({kind:"envelope",top:e=>L+t(e),bottom:e=>1-L+t(e)}),Gs={textArchUp:{kind:"path",path:"archUp"},textArchDown:{kind:"path",path:"archDown"},textCircle:{kind:"path",path:"circle"},textButton:{kind:"path",path:"archUp"},textArchUpPour:{kind:"path",path:"archUp"},textArchDownPour:{kind:"path",path:"archDown"},textCirclePour:{kind:"path",path:"circle"},textButtonPour:{kind:"path",path:"archUp"},textStop:{kind:"envelope",top:t=>L*qs(t),bottom:t=>1-L*qs(t)},textWave1:wt(t=>-.2*Math.sin(2*Math.PI*t)),textWave2:wt(t=>L*Math.sin(2*Math.PI*t)),textDoubleWave1:wt(t=>-.2*Math.sin(4*Math.PI*t)),textWave4:wt(t=>L*Math.sin(4*Math.PI*t)),textCanUp:wt(t=>-.2*at(t)),textCanDown:wt(t=>L*at(t)),textCurveUp:wt(t=>-.2*Math.sin(Math.PI*t/2)),textCurveDown:wt(t=>-.2*Math.cos(Math.PI*t/2)),textChevron:wt(t=>-.2*sn(t)),textChevronInverted:wt(t=>L*sn(t)),textSlantUp:{kind:"envelope",top:t=>L*2*(1-t),bottom:t=>1-L*2*t},textSlantDown:{kind:"envelope",top:t=>L*2*t,bottom:t=>1-L*2*(1-t)},textInflate:{kind:"envelope",top:t=>L*(1-at(t)),bottom:t=>1-L*(1-at(t))},textDeflate:{kind:"envelope",top:t=>L*at(t),bottom:t=>1-L*at(t)},textInflateTop:{kind:"envelope",top:t=>2*L*(1-at(t)),bottom:()=>1},textInflateBottom:{kind:"envelope",top:()=>0,bottom:t=>1-2*L*(1-at(t))},textDeflateTop:{kind:"envelope",top:t=>2*L*at(t),bottom:()=>1},textDeflateBottom:{kind:"envelope",top:()=>0,bottom:t=>1-2*L*at(t)},textDeflateInflate:{kind:"envelope",top:()=>0,bottom:t=>1-L*at(t)},textDeflateInflateDeflate:{kind:"envelope",top:t=>L*at(t),bottom:t=>1-L*at(t)},textTriangle:{kind:"envelope",top:t=>.5*(1-sn(t)),bottom:()=>1},textTriangleInverted:{kind:"envelope",top:()=>0,bottom:t=>1-.5*(1-sn(t))},textFadeRight:{kind:"envelope",top:t=>L*t,bottom:t=>1-L*t},textFadeLeft:{kind:"envelope",top:t=>L*(1-t),bottom:t=>1-L*(1-t)}},Wd=96/72;function fo(t,e){return t?/^#?[\da-f]{6}$/iu.test(t)?t.startsWith("#")?t:`#${t}`:e[t.replace(/^scheme:/u,"")]??null:null}function qd(t,e,n,o){let i=fo(t.color,e)??"#000000";const s=t.textFill;if(s?.kind==="none")i="none";else if(s?.kind==="gradient"){const l=`${n.prefix}-${n.defs.length}`,c=(s.angleDeg??90)*Math.PI/180,[u,d]=[Math.cos(c)/2,Math.sin(c)/2],h=s.stops.map(f=>`<stop offset="${f.offset}" stop-color="${fo(f.resolvedColor??f.color,e)??"#000000"}"${f.opacity===void 0?"":` stop-opacity="${f.opacity}"`}/>`).join("");n.defs.push(`<linearGradient id="${l}" x1="${.5-u}" y1="${.5-d}" x2="${.5+u}" y2="${.5+d}">${h}</linearGradient>`),i=`url(#${l})`}const r=t.outline,a=r&&(r.widthEmu??0)>0?fo(r.color,e):null;return{size:(t.size??18)*Wd,family:`${t.font?`"${t.font}", `:""}${t.fontEastAsian?`"${t.fontEastAsian}", `:""}sans-serif`,bold:t.bold===!0,italic:t.italic===!0,fill:i,stroke:a,strokeWidth:a?(r.widthEmu??0)/9525:0,opacity:o}}function Gd(t,e,n,o){const i=io(t),s=[];for(let r=0;r<Me(e);r+=1){let a=[];for(let l=0;l<kn(e,r);l+=1){const c=qd(vn(t,e,r,l)??{},i,o,Ds(e,r,l));for(const u of Mn(e,r,l))u===`
|
|
11
|
+
`||u==="\v"?(s.push(a),a=[]):a.push({text:u,style:c,width:n(u,c)})}s.push(a)}return s}function Ud(){const t=typeof document>"u"?null:document.createElement("canvas").getContext("2d");return(e,n)=>t?(t.font=`${n.italic?"italic ":""}${n.bold?"bold ":""}${n.size}px ${n.family}`,t.measureText(e).width):n.size*(/[⺀-鿿가--]/u.test(e)?1:.56)}const rn=9525,Hd=t=>t.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">"),Rt=t=>String(Math.round(t*100)/100);function _d({glyph:t,x:e,y:n,angle:o,shear:i,scaleX:s,scaleY:r}){const{style:a}=t,l=a.stroke?` stroke="${a.stroke}" stroke-width="${Rt(a.strokeWidth)}" paint-order="stroke"`:"";return`<text x="0" y="0" text-anchor="middle" transform="translate(${Rt(e)} ${Rt(n)}) ${i?"skewY":"rotate"}(${Rt(o)}) scale(${Rt(s)} ${Rt(r)})" font-size="${Rt(a.size)}" font-family='${a.family}'${a.bold?' font-weight="bold"':""}${a.italic?' font-style="italic"':""} fill="${a.fill}"${a.opacity<1?` opacity="${a.opacity}"`:""}${l}>${Hd(t.text)}</text>`}function mo(t,e,n){const o=new RegExp(`<${n}[\\s>]|<\\/${n}>`,"gu");o.lastIndex=e;let i=0;for(let s=o.exec(t);s;s=o.exec(t))if(i+=s[0]===`</${n}>`?-1:1,i===0)return s.index+n.length+3;return-1}function Vd(t,e,n){const o=t.indexOf(`<g data-pptx-shape-id="${e}"`),i=o<0?-1:mo(t,o,"g");if(i<0)return t;let s=t.slice(o,i);const r=s.search(/<foreignObject\b[^>]*>(?=[\s\S]*?data-pptx-paragraph)/u);let a=r>=0;a&&(s=s.slice(0,r)+n+s.slice(mo(s,r,"foreignObject")));for(let l=s.indexOf("<g data-pptx-paragraph=");l>=0;l=s.indexOf("<g data-pptx-paragraph="))s=s.slice(0,l)+(a?"":n)+s.slice(mo(s,l,"g")),a=!0;return a?t.slice(0,o)+s+t.slice(i):t}function Kd(t,e,n,o=Ud()){let i=n;for(const s of nt(e)){const r=st(s)==="text"?os(s):null,a=r?Gs[r]:void 0,l=a?Ld(a,Rd(Mt(s))):void 0,c=l?Ze(t,e,s):null;if(!l||!c)continue;const u=jo(t,s).margins,[d,h,f,p]=[u.left??91440,u.top??45720,u.right??91440,u.bottom??45720],m={x:(c.x+d)/rn,y:(c.y+h)/rn,width:(c.width-d-f)/rn,height:(c.height-h-p)/rn},g={defs:[],prefix:`pptx-warp-${j(s)}`},y=zd(Gd(t,s,o,g),m,l);if(y.length===0)continue;const b=g.defs.length>0?`<defs>${g.defs.join("")}</defs>`:"";i=Vd(i,j(s),`<g data-pptx-warp="${r}">${b}${y.map(_d).join("")}</g>`)}return i}function an(t,e,n,o){if(!n.includes("data-pptx-shape-id"))return n;let i=Yu(n);return i=Cu(t,i),i=Bu(t,e,i),i=qu(t,e,i),i=Nu(i),i=Hu(i),i=Cd(t,e,i),i=Pd(e,i),i=Fu(t,e,i),i=id(t,e,i),i=Qu(t,e,i),i=Xu(t,e,i),i=Kd(t,e,i,o),i=Ad(e,i),i=Fd(t,e,i),i=xd(i),i=Pu(i),yd(t,e,i,(s,r,a)=>an(s,r,a,o))}const Us="g[data-pptx-shape-id]";function Yd(t){if(t.length===0)return null;const e=Math.min(...t.map(o=>o.left)),n=Math.min(...t.map(o=>o.top));return new DOMRect(e,n,Math.max(...t.map(o=>o.right))-e,Math.max(...t.map(o=>o.bottom))-n)}function Xd(t,e){const n=[];for(const o of t.querySelectorAll("foreignObject")){if(o.closest(Us)!==t)continue;const i=t.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_TEXT);for(let s=i.nextNode();s;s=i.nextNode())if(s.textContent?.trim()){e.selectNodeContents(s);for(const r of e.getClientRects())r.width>0&&r.height>0&&n.push(r)}}return n}function Zd(t,e){let n;return{measure(o,i){const s=Lr(o);n?.isConnected||(n=t.createElement("div"),n.setAttribute("aria-hidden","true"),n.style.cssText="position:fixed;left:-100000px;top:0;visibility:hidden;pointer-events:none;contain:layout style",t.body.append(n)),n.innerHTML=e?.(o,i)??an(o,i,Nn(o,i));const r=n.querySelector("svg"),a=r?.viewBox.baseVal,l=new Map;if(!r||!a||a.width===0)return l;r.setAttribute("width",String(a.width)),r.setAttribute("height",String(a.height));const c=r.getBoundingClientRect(),u=s.width/c.width,d=s.height/c.height,h=t.createRange();for(const f of n.querySelectorAll(Us)){const p=Yd(Xd(f,h));p&&l.set(Number(f.getAttribute("data-pptx-shape-id")),{x:Math.round((p.left-c.left)*u),y:Math.round((p.top-c.top)*d),width:Math.round(p.width*u),height:Math.round(p.height*d)})}return n.replaceChildren(),l}}}function Jd(t,e){const n={};for(const r of t)Object.assign(n,r.addCommands?.(e)??{});function o(r){return r.length===0?!0:r[0].command({presentation:e.presentation(),dispatch:!1})?e.transact(r.map(a=>a.name).join(", "),a=>r.every(l=>l.command({presentation:a,dispatch:!0}))):!1}function i(r){const a=n[r];if(!a)throw new Error(`PPTX command ${r} is not installed.`);return a}const s=Object.keys(n);return{factories:n,commands:Object.fromEntries(s.map(r=>[r,a=>o([{name:r,command:i(r)(a)}])])),chain(){const r=[],a=Object.fromEntries(s.map(l=>[l,c=>(r.push({name:l,command:i(l)(c)}),a)]));return a.run=()=>o(r),a},descriptors(){const r=new Map;for(const a of s){const l=el(n[a]);l&&r.set(a,l)}return r}}}function Hs(t){const e=Q(t)[0];return{slide:e?X(e):null,shapes:[]}}function ln(t,e,n=0){const o=Q(t);if(o.length===0)return{slide:null,shapes:[]};const i=e.slide===null?null:o.find(r=>X(r)===e.slide)??null;if(i===null)return{slide:X(o[Math.min(Math.max(0,n),o.length-1)]),shapes:[]};const s=e.shapes.filter(r=>ke(i,r)!==null);return s.length===e.shapes.length&&e.slide===X(i)?e:{slide:X(i),shapes:s}}function _s(t,e){return Math.max(0,Q(t).findIndex(n=>X(n)===e.slide))}function Qd(t,e){return t.slide===e.slide&&t.shapes.length===e.shapes.length&&t.shapes.every((n,o)=>e.shapes[o]===n)}function th(t){const e=Wr(t);if(!e||typeof e.save!="function"||!Array.isArray(e.parts)){const s=Bt(t);return()=>s}const n=e.parts.map(s=>({name:s.name,contentType:s.contentType,data:s.data})),o=structuredClone(e.contentTypes);let i;return()=>i??=Promise.resolve().then(()=>e.save.call({parts:n,contentTypes:o}))}function eh(t){let e=t,n=0,o=0,i=Hs(e),s=[],r=-1,a=0,l=!1,c=null;const u=new Set,d=g=>{for(const y of[...u])y(g)},h=g=>{s=[...s.slice(0,r+1),{id:++o,bytes:th(e),selection:i,label:g}].slice(-100),r=s.length-1};h("open"),a=s[r].id;const f=async(g,y,b)=>{const x=s[g];if(!x)return!1;const w=await Dt(await x.bytes());return e=w,r=g,l=!1,i=ln(w,b??x.selection),n+=1,d({content:!0,origin:y}),!0},p=g=>{const y=(c??Promise.resolve()).then(g,g).finally(()=>{c===y&&(c=null,d({content:!1,origin:"history"}))});return c=y,y},m=()=>{p(()=>f(r,"history"))};return{presentation:()=>e,version:()=>n,selection:()=>i,select(g){const y=ln(e,g);Qd(y,i)||(i=y,d({content:!1,origin:"user"}))},transact(g,y,b="user"){if(c!==null||l)return!1;const x=_s(e,i);let w;try{w=y(e)}catch(k){throw m(),k}return w===null?!1:w?(n+=1,i=ln(e,i,x),h(g),d({content:!0,origin:b}),!0):(m(),!1)},live(g){c===null&&(l=!0,g(e),n+=1,d({content:!0,origin:"user",live:!0}))},commit(g){l&&(l=!1,h(g),d({content:!0,origin:"user"}))},cancelLive(){return l?p(()=>f(r,"history")):Promise.resolve(!1)},canUndo:()=>c===null&&!l&&r>0,canRedo:()=>c===null&&!l&&r<s.length-1,undo(){return l||r<=0?Promise.resolve(!1):p(()=>f(r-1,"history",s[r]?.selection))},redo(){return l||r>=s.length-1?Promise.resolve(!1):p(()=>f(r+1,"history"))},discard(g){if(l||r<=0||r!==s.length-1||s[r].label!==g)return Promise.resolve(!1);const y=r;return p(async()=>{if(r!==y||s.length!==y+1)return!1;const b=await f(y-1,"history",s[y]?.selection);return b&&(s=s.slice(0,y)),b})},isDirty:()=>l||s[r]?.id!==a,markSaved(){a=s[r]?.id??a,d({content:!1,origin:"user"})},save:()=>Bt(e),adopt(g,y,b){return p(async()=>{let x;try{x=await Dt(g)}catch{return!1}const w=_s(e,i);return e=x,l=!1,i=ln(x,i,w),n+=1,h(y),d({content:!0,origin:b}),!0})},replace(g){return p(async()=>{let y;try{y=await Dt(g)}catch{return!1}return e=y,l=!1,i=Hs(y),s=[],r=-1,h("open"),a=s[r].id,n+=1,d({content:!0,origin:"file"}),!0})},subscribe(g){return u.add(g),()=>u.delete(g)}}}const cn='<g data-pptx-math="">',nh=/^<text\b([^>]*)><tspan dx="(-?[\d.]+)">​<\/tspan><\/text>$/u;function oh(t,e){if(!t.includes(cn))return t;let n="",o=0;for(let i=t.indexOf(cn);i>=0;i=t.indexOf(cn,i+21)){const s=sh(t,i),r=t.lastIndexOf("<text",i),a=r<0?null:nh.exec(t.slice(r,i)),l=a&&ih(t,i);if(!a||!l||s<0)continue;const c=t.slice(i,s),u=Number(Ks(c,/font-size="([\d.]+)"/gu)??NaN),d=Ks(c,/fill="(#[0-9a-fA-F]{3,8})"/gu)??"#000000",h=Number.isFinite(u)&&u>0?e(l,u,d):null;if(!h)continue;const f=Number(go(a[1],"x")),p=Number(go(a[1],"y")),m=Number(a[2]),g=go(a[1],"text-anchor"),y=(g==="middle"?f:g==="end"?f-m/2:f+m/2)-h.width*u/2,b=p-h.baseline*u;n+=t.slice(o,i)+`<g data-pptx-math="" data-quirekit-math="">${h.svg.replace("<svg ",`<svg x="${Vs(y)}" y="${Vs(b)}" `)}</g>`,o=s}return n+t.slice(o)}function ih(t,e){const n=t.lastIndexOf('data-pptx-shape-id="',e),o=t.lastIndexOf('data-pptx-paragraph="',e);if(n<0||o<n||t.lastIndexOf("data-pptx-cell=",e)>n)return null;const i=Number.parseInt(t.slice(n+20),10),s=Number.parseInt(t.slice(o+21),10),r=t.slice(o,e).split(cn).length-1;return Number.isInteger(i)&&Number.isInteger(s)?{shape:i,paragraph:s,index:r}:null}function sh(t,e){const n=/<g[\s>]|<\/g>/gu;n.lastIndex=e;let o=0;for(let i=n.exec(t);i;i=n.exec(t))if(o+=i[0]==="</g>"?-1:1,o===0)return i.index+4;return-1}const go=(t,e)=>new RegExp(`\\s${e}="([^"]*)"`,"u").exec(t)?.[1],Vs=t=>Math.round(t*100)/100;function Ks(t,e){const n=new Map;for(const o of t.matchAll(e))n.set(o[1],(n.get(o[1])??0)+1);return[...n].sort((o,i)=>i[1]-o[1])[0]?.[0]}function Ys(t=()=>{}){const e=new Map;let n,o,i=!1,s=0,r;function a(u){const d=e.get(u);if(d!==void 0)return d;const h=ol(u.slice(1));if(!h.ok)return e.set(u,null),null;n??=import("@quirekit/math-mathjax").then(p=>(o=p.serializeMathSvg,p.createMathJaxRenderer({maxEntries:256,maxBytes:16*1024*1024,maxPending:256})));const f=n.then(p=>p.render(h.document,{display:u[0]==="b"?"block":"inline"})).catch(()=>null).then(p=>(i||(e.set(u,p),l()),p));return e.set(u,f),f}function l(){r??=Promise.resolve().then(()=>{r=void 0,s+=1,i||t()})}function c(u,d){const h=ke(u,d.shape);if(!h||ne(h)!=="shape")return null;const f=Bo(h)[d.paragraph]?.filter(m=>m.kind==="math")[d.index];if(!f||f.kind!=="math")return null;const p=nl(Zi(f.math,f.display));return p.ok?(f.display?"b":"i")+p.latex:null}return{get generation(){return s},typeset(u,d){return i?u:oh(u,(h,f,p)=>{const m=c(d,h),g=m===null?null:a(m);return!g||g instanceof Promise||g.slots.length||!o?null:{svg:o(g,{fontSize:f,color:p}),width:g.width,baseline:g.baseline}})},async prepare(u){const d=[];for(const h of u)if(Vo(h).includes("oMath"))for(const f of rh(h))Bo(f).forEach((p,m)=>p.filter(g=>g.kind==="math").forEach((g,y)=>{const b=c(h,{shape:j(f),paragraph:m,index:y}),x=b===null?null:a(b);x instanceof Promise&&d.push(x)}));await Promise.all(d)},dispose(){i=!0,n?.then(u=>u.dispose()),e.clear()}}}function rh(t){const e=n=>n.flatMap(o=>ne(o)==="group"?e(Ro(o)):ne(o)==="shape"?[o]:[]);return e(nt(t))}const ah=20,lh=50;function un(t,e){for(const n of t.children)n.kind==="element"&&(e(n),un(n,e))}function ch(t){const e=le(t);if(!e)return[];const n=[];return un(e,o=>{if(o.name?.localName!=="cTn"||S(o,"nodeType")!=="interactiveSeq")return;let i=null;un(O(o,"stCondLst")??o,r=>{i===null&&r.name?.localName==="spTgt"&&(i=Number(S(r,"spid")))});let s=0;un(O(o,"childTnLst")??o,r=>{r.name?.localName==="cTn"&&S(r,"presetClass")!==void 0&&(s+=1)}),i!==null&&n.push({shape:i,effects:s})}),n}const Xs=(t,e,n)=>({...t,effect:e,presetClass:n,start:"afterPrevious",delayMs:0,durationMs:0,valueAfterEnd:"held"});function uh(t,e){if(!e||e.repeat===null&&!e.rewind)return[t];const n={...t,playable:!0},o=e.repeat===null?1:typeof e.repeat=="number"?Math.min(lh,Math.max(1,Math.ceil(e.repeat))):ah,i=Array.from({length:o},(s,r)=>r===0?n:{...n,start:"afterPrevious",delayMs:0});return e.rewind?t.presetClass==="entr"?[...i,Xs(n,"disappear","exit")]:t.presetClass==="exit"?[...i,Xs(n,"appear","entr")]:i.map(s=>({...s,valueAfterEnd:"removed"})):i}function Zs(t){const e=Uo(t),n=[];for(const o of e)o.sequence!=="interactiveSeq"&&n.push(...uh(o,o.id===null?null:ue(t,o.id)));return{main:n,triggers:Js(t,e)}}function dh(t){return Js(t,Uo(t))}function Js(t,e){const n=e.filter(s=>s.sequence==="interactiveSeq");if(n.length===0)return[];const o=[];let i=0;for(const s of ch(t)){const r=n.slice(i,i+s.effects).map(a=>({...a,sequence:"mainSeq",playable:!0}));i+=s.effects,r.length>0&&o.push({shape:s.shape,steps:r})}return o}function hh(t){const e=t.ownerDocument.createElement("div");e.hidden=!0,t.append(e);const n=new Map,o=i=>{const s=n.get(i);s?.element.pause(),s?.element.remove(),n.delete(i)};return{take(i){const s=n.get(i);return n.delete(i),s?.element??null},keep(i,s,r,a){return s.paused||s.ended||a<=r?!1:(n.set(i,{element:s,from:r,until:a}),e.append(s),!0)},arrive(i){for(const[s,r]of[...n])(i<r.from||i>r.until)&&o(s)},stop(){for(const i of[...n.keys()])o(i);e.remove()}}}function ph(){const t=new Map;return{address(e){if("url"in e.source)return e.source.url;let n=t.get(e.source.bytes);return n||t.set(e.source.bytes,n=URL.createObjectURL(new Blob([e.source.bytes],{type:e.source.type}))),n},release(){for(const e of t.values())URL.revokeObjectURL(e);t.clear()}}}function fh(t,e,n,o){const i=[],s=[],r=e.map(a=>{const l=a.playback,c=o!==void 0&&a.kind==="audio"&&(l?.slideCount??1)>1,u=`${o?.part}#${a.shape}`;l?.hideWhenStopped&&a.kind==="audio"&&mh(t,a.shape);const d=c?o.background.take(u):null,h=d??document.createElement(a.kind==="audio"?"audio":"video");if(c&&s.push({key:u,element:h,until:o.index+l.slideCount-1}),d)return t.append(d),d;h.controls=!0,h.preload="metadata",h.src=n.address(a),h.loop=l?.loop??!1,h.volume=Math.min(1,Math.max(0,l?.volume??1)),h.muted=l?.muted??!1,h instanceof HTMLVideoElement&&(h.playsInline=!0);const{x:f,y:p,width:m,height:g}=a.box;h.style.cssText=a.kind==="audio"?`position:absolute;z-index:4;left:${(f+m/2)*100}%;top:${(p+g)*100}%;transform:translateX(-50%);width:max(${m*100}%,240px);max-width:60%`:`position:absolute;z-index:4;left:${f*100}%;top:${p*100}%;width:${m*100}%;height:${g*100}%;object-fit:contain;background:transparent`,l?.hideWhenStopped&&a.kind==="audio"&&(h.style.visibility="hidden");for(const b of["click","pointerdown","contextmenu","dblclick"])h.addEventListener(b,x=>x.stopPropagation());for(const b of["play","pause"])h.addEventListener(b,()=>h.closest("[data-pptx-show-surface]")?.focus());const y=l?.trim;return y&&(h.addEventListener("loadedmetadata",()=>{h.currentTime=y.startMs/1e3},{once:!0}),h.addEventListener("timeupdate",()=>{h.duration&&h.currentTime>=h.duration-y.endMs/1e3&&(h.loop?h.currentTime=y.startMs/1e3:h.pause())})),l?.fullScreen&&h instanceof HTMLVideoElement&&h.addEventListener("play",()=>{h.style.inset="0",h.style.width=h.style.height="100%",h.style.left=h.style.top="0"}),l?.hideWhenStopped&&h.addEventListener("ended",()=>{h.style.visibility="hidden"}),l?.fade&&(l.fade.inMs>0||l.fade.outMs>0)&&gh(h,l.fade,y,h.volume),l?.rewindAfterPlaying&&h.addEventListener("ended",()=>{h.currentTime=(y?.startMs??0)/1e3}),l?.autoplay&&i.push(setTimeout(()=>{h.play().catch(()=>{})},Math.max(0,l.delayMs??0))),t.append(h),h});return{stop(){for(const a of i)clearTimeout(a);for(const a of r){const l=s.find(c=>c.element===a);(!l||!o?.background.keep(l.key,a,o.index,l.until))&&a.pause()}}}}function mh(t,e){for(const n of t.querySelectorAll(`g[data-pptx-shape-id="${e}"]`))n.style.visibility="hidden"}function gh(t,e,n,o){let i=0;const s=()=>{const r=t.currentTime*1e3-(n?.startMs??0),a=(Number.isFinite(t.duration)?t.duration*1e3:1/0)-(n?.endMs??0),l=e.inMs>0?Math.min(1,Math.max(0,r/e.inMs)):1,c=e.outMs>0&&Number.isFinite(a)?Math.min(1,Math.max(0,(a-t.currentTime*1e3)/e.outMs)):1;t.volume=o*l*c,t.paused||(i=requestAnimationFrame(s))};t.addEventListener("play",()=>{cancelAnimationFrame(i),s()}),t.addEventListener("pause",()=>cancelAnimationFrame(i))}function yh(t,e,n){return Br(t,e).flatMap(o=>{if(o.kind!=="media")return[];const i=ke(e,o.id),s=i?oa(i):null;return!i||!s?[]:[{shape:o.id,kind:s.kind==="audio"?"audio":"video",source:s.kind==="online"?{url:s.url}:{bytes:s.bytes,type:s.contentType},playback:ia(i),box:{x:o.x/n.width,y:o.y/n.height,width:o.width/n.width,height:o.height/n.height}}]})}function bh(t,e){const n=xa(e);if(!n)return null;if(n.kind==="stop")return{kind:"stop"};const o=/<p:snd\b[^>]*\br:embed="([^"]+)"/u.exec(Vo(e))?.[1],i=X(e),s=o?yt(t,i.replace(/([^/]+)$/u,"_rels/$1.rels")):null;if(!o||!s)return null;const r=new RegExp(`<Relationship\\b[^>]*\\bId="${o}"[^>]*\\bTarget="([^"]+)"`,"u").exec(new TextDecoder().decode(s))?.[1]??new RegExp(`<Relationship\\b[^>]*\\bTarget="([^"]+)"[^>]*\\bId="${o}"`,"u").exec(new TextDecoder().decode(s))?.[1];if(!r)return null;const a=yt(t,xh(i,r));return a?{kind:"play",bytes:a.slice(),loop:n.loop,name:n.name}:null}function xh(t,e){if(e.startsWith("/"))return e;const n=t.split("/").slice(0,-1);for(const o of e.split("/"))o===".."?n.pop():o!=="."&&n.push(o);return n.join("/")}function wh(){let t=null,e=null;const n=()=>{t?.pause(),t=null,e&&URL.revokeObjectURL(e),e=null};return{play(o){o&&(n(),o.kind!=="stop"&&(e=URL.createObjectURL(new Blob([o.bytes],{type:"audio/wav"})),t=new Audio(e),t.loop=o.loop,t.play().catch(()=>{})))},stop:n}}function Qs(t,e,n=!1){const o=Q(t).map((s,r)=>({slide:s,number:r+1}));if(e.kind==="customShow"){const s=Kr(t).find(r=>r.id===e.id);if(s)return s.slides.map(r=>({slide:r,number:o.findIndex(a=>a.slide===r)+1})).filter(r=>r.number>0)}const i=e.kind==="range"?o.filter(s=>s.number>=e.start&&s.number<=e.end):o;return n?i:i.filter(s=>!Cn(s.slide))}const kt=t=>({kind:"polygon",points:t}),Zt=(t,e,n,o)=>({kind:"inset",sides:[t,e,n,o]}),Jt=t=>Math.round(t*100)/100;function tr(t,e=[0,0,100,100],n=""){const[o,i,s,r]=e,a=u=>o+u*s/100,l=u=>i+u*r/100,c=n?` ${n}`:"";if(t.kind==="inset"){const[u,d,h,f]=t.sides;return`inset(${Jt(l(u))}% ${Jt(100-a(100-d))}% ${Jt(100-l(100-h))}% ${Jt(a(f))}%)${c}`}return`polygon(${t.points.map(([u,d])=>`${Jt(a(u))}% ${Jt(l(d))}%`).join(", ")})${c}`}function kh(t,e){const n=[];for(let o=0;o<t;o+=1){n.push([50,50]);for(let i=0;i<=8;i+=1){const s=2*Math.PI*(o+e*i/8)/t;n.push([50+100*Math.sin(s),50-100*Math.cos(s)])}}return kt(n)}function er(t,e){const n=(o,i)=>[50+o*e,50+i*e];return t==="diamond"?[n(0,-100),n(100,0),n(0,100),n(-100,0)]:t==="box"?[n(-50,-50),n(50,-50),n(50,50),n(-50,50)]:t==="plus"?[n(-50,-100),n(50,-100),n(50,-50),n(100,-50),n(100,50),n(50,50),n(50,100),n(-50,100),n(-50,50),n(-100,50),n(-100,-50),n(-50,-50)]:Array.from({length:32},(o,i)=>n(71*Math.cos(2*Math.PI*i/32),71*Math.sin(2*Math.PI*i/32)))}function vh(t,e){const n=/^(\w+)(?:\(([^)]*)\))?/.exec(t.trim()),o=n?.[1]??"fade",i=n?.[2]??"",s=Math.min(1,Math.max(0,e)),r=100*(1-s);switch(o){case"wipe":return i==="right"?{opacity:1,clip:Zt(0,0,0,r)}:i==="up"?{opacity:1,clip:Zt(0,0,r,0)}:i==="down"?{opacity:1,clip:Zt(r,0,0,0)}:{opacity:1,clip:Zt(0,r,0,0)};case"barn":{const a=50*s;return i==="outVertical"?{opacity:1,clip:Zt(0,50-a,0,50-a)}:i==="outHorizontal"?{opacity:1,clip:Zt(50-a,0,50-a,0)}:i==="inHorizontal"?{opacity:1,clip:kt([[0,0],[100,0],[100,a],[0,a],[0,100-a],[100,100-a],[100,100],[0,100]])}:{opacity:1,clip:kt([[0,0],[a,0],[a,100],[100-a,100],[100-a,0],[100,0],[100,100],[0,100]])}}case"wheel":return{opacity:1,clip:kh(Math.max(1,Number(i)||1),s)};case"circle":case"diamond":case"plus":case"box":if(i==="in"){const a=er(o,1-s);return{opacity:1,clip:kt([[0,0],[100,0],[100,100],[0,100],[0,0],...a,a[0]])}}return{opacity:1,clip:kt(er(o,s))};case"blinds":{const a=[],l=i!=="vertical";for(let c=0;c<6;c+=1){const u=100*c/6,d=u+100*s/6;l?a.push([0,u],[100,u],[100,d],[0,d],[0,u]):a.push([u,0],[u,100],[d,100],[d,0],[u,0])}return{opacity:1,clip:kt(a)}}case"strips":{const a=200*s;return i==="downRight"?{opacity:1,clip:kt([[0,0],[a,0],[0,a]])}:i==="upLeft"?{opacity:1,clip:kt([[100,100],[100-a,100],[100,100-a]])}:i==="upRight"?{opacity:1,clip:kt([[0,100],[a,100],[0,100-a]])}:{opacity:1,clip:kt([[100,0],[100-a,0],[100,a]])}}case"slide":return{opacity:s,clip:null};default:return{opacity:s,clip:null}}}const Mh={abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,deg:t=>t*180/Math.PI,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:t=>t*Math.PI/180,rand:t=>Math.random()*t,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan},nr=new Map;function or(t,e){let n=nr.get(t);if(!n){try{n=Sh(t)}catch{n=()=>NaN}nr.set(t,n)}return n(e)}function Sh(t){const e=t.match(/\d+\.?\d*(?:[eE][-+]?\d+)?|\.\d+|#?[a-zA-Z_$][\w]*|\$|[-+*/^(),%]/g)??[];let n=0;const o=()=>e[n];function i(){let u=s();for(;o()==="+"||o()==="-";){const d=e[n++],h=s(),f=u;u=d==="+"?p=>f(p)+h(p):p=>f(p)-h(p)}return u}function s(){let u=r();for(;o()==="*"||o()==="/"||o()==="%";){const d=e[n++],h=r(),f=u;u=d==="*"?p=>f(p)*h(p):d==="/"?p=>f(p)/h(p):p=>f(p)%h(p)}return u}function r(){const u=a();if(o()!=="^")return u;n+=1;const d=r();return h=>u(h)**d(h)}function a(){if(o()==="-"){n+=1;const u=a();return d=>-u(d)}return o()==="+"&&(n+=1),l()}function l(){const u=e[n++];if(u===void 0)throw new SyntaxError("Formula ends early.");if(u==="("){const f=i();if(e[n++]!==")")throw new SyntaxError("Unclosed bracket.");return f}if(/^[\d.]/.test(u)){const f=Number(u);return()=>f}const d=u.replace(/^#/,"");if(d==="pi")return()=>Math.PI;if(d==="e")return()=>Math.E;const h=Mh[d];if(h&&o()==="("){n+=1;const f=[];for(;o()!==")"&&n<e.length;)f.push(i()),o()===","&&(n+=1);return n+=1,p=>h(...f.map(m=>m(p)))}return f=>f[d]??NaN}const c=i();if(n<e.length)throw new SyntaxError("Formula has trailing text.");return c}const ir=16;function $h(t,e){const n=t.match(/[a-zA-Z]|-?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g)??[],o=[];let i=0,s="M",r=0,a=0,l=0,c=0;const u=()=>Number(n[i++]??0);for(;i<n.length;){const h=n[i];if(/^[a-zA-Z]$/.test(h)){if(s=h,i+=1,(s==="Z"||s==="z")&&(r=l,a=c,o.push([r,a])),s==="E"||s==="e")break;continue}const f=s===s.toLowerCase(),p=f?r:0,m=f?a:0;switch(s.toUpperCase()){case"M":r=p+u(),a=m+u(),l=r,c=a,o.push([r,a]),s=f?"l":"L";break;case"L":r=p+u(),a=m+u(),o.push([r,a]);break;case"C":{const g=[p+u(),m+u()],y=[p+u(),m+u()],b=[p+u(),m+u()];for(let x=1;x<=ir;x+=1){const w=x/ir,k=1-w;o.push([k*k*k*r+3*k*k*w*g[0]+3*k*w*w*y[0]+w*w*w*b[0],k*k*k*a+3*k*k*w*g[1]+3*k*w*w*y[1]+w*w*w*b[1]])}r=b[0],a=b[1];break}default:i+=1}}o.length===0&&o.push([0,0]);const d=[0];for(let h=1;h<o.length;h+=1){const[f,p]=o[h-1],[m,g]=o[h];d.push(d[h-1]+Math.hypot((m-f)*e,g-p))}return{points:o,lengths:d}}function Ch(t,e){const{points:n,lengths:o}=t,i=o.at(-1)??0;if(n.length===1||i<=0)return e<1?n[0]:n.at(-1);const s=Math.min(1,Math.max(0,e))*i;let r=1,a=o.length-1;for(;r<a;){const p=r+a>>1;o[p]<s?r=p+1:a=p}const l=o[r]-o[r-1],c=l>0?(s-o[r-1])/l:1,[u,d]=n[r-1],[h,f]=n[r];return[u+(h-u)*c,d+(f-d)*c]}const Th=1,Ph=500,fe=t=>t.paragraphs?`${t.shape}:${t.paragraphs[0]}-${t.paragraphs[1]}`:String(t.shape),Eh=t=>t.accel>0||t.decel>0||t.autoReverse||t.speed!==1||t.repeat!==1,sr=t=>t.repeat==="indefinite"?Number.POSITIVE_INFINITY:Math.max(0,t.repeat),yo=t=>t.simple*(t.autoReverse?2:1)*t.repeat;var Ah=class{behaviors=[];ends=new Map;waiting=new Map;order;constructor(t){this.order=t}get nextOrder(){return this.order}place(t,e){const{timing:n}=t;if(n.afterEndOf!==null){const o=this.ends.get(n.afterEndOf),i={...e,frames:[],presetClass:e.presetClass};if(o===void 0){const s=this.waiting.get(n.afterEndOf)??[];return s.push({node:t,base:i}),this.waiting.set(n.afterEndOf,s),null}return this.start(t,{...i,local:o,group:o},0)}return n.delay==="indefinite"?null:this.start(t,e,n.delay)}start(t,e,n){const{timing:o}=t,i=e.local+n,s=e.group+n,r=o.presetClass??e.presetClass,a=e.hold&&(t.effect!==null||t.target!==null?o.hold:!o.removes),l=t.effect!==null||t.target!==null?this.behavior(t,{local:i,group:s,frames:e.frames,presetClass:r,hold:a}):this.container(t,{local:i,group:s,frames:e.frames,presetClass:r,hold:a});o.id!==null&&this.finish(o.id,l.group);for(const c of t.sub)this.place(c,{local:l.group,group:l.group,frames:[],presetClass:r,hold:!0});return l}finish(t,e){this.ends.set(t,e);const n=this.waiting.get(t);if(n){this.waiting.delete(t);for(const o of n)this.start(o.node,{...o.base,local:e,group:e},o.node.timing.delay==="indefinite"?0:o.node.timing.delay)}}behavior(t,e){const{timing:n}=t,o=(n.duration==="indefinite"?Number.POSITIVE_INFINITY:n.duration)??(t.element==="set"?Th:Ph),i=Math.abs(n.speed)||1,s={begin:e.local,simple:o/i,accel:n.accel,decel:n.decel,autoReverse:n.autoReverse,reversed:n.speed<0,repeat:sr(n)},r=yo(s),a=e.group+r;return t.effect&&t.target&&this.behaviors.push({effect:t.effect,target:t.target,frames:[...e.frames,s],begin:e.group,end:a,hold:e.hold,presetClass:e.presetClass,order:this.order}),this.order+=1,{local:e.local+r,group:a}}container(t,e){const{timing:n}=t,o=Eh(n)?{begin:e.local,simple:0,accel:n.accel,decel:n.decel,autoReverse:n.autoReverse,reversed:n.speed<0,repeat:sr(n)}:null,i=o?{...e,local:0,frames:[...e.frames,o]}:e,s=this.behaviors.length;let r=i.local,a=i.group,l=i;for(const d of t.children){const h=this.place(d,t.element==="seq"?l:i);h&&(r=Math.max(r,h.local),a=Math.max(a,h.group),t.element==="seq"&&(l={...l,local:h.local,group:h.group}))}const c=typeof n.duration=="number"?n.duration:null;if(!o)return c===null?{local:r,group:a}:{local:i.local+c,group:i.group+c};o.simple=(c??r)/(Math.abs(n.speed)||1);const u=yo(o);for(let d=s;d<this.behaviors.length;d+=1){const h=this.behaviors[d];this.behaviors[d]={...h,end:Math.max(h.end,e.group+u)}}return{local:e.local+u,group:e.group+u}}};function Oh(t){const e=[];let n=0;for(const s of t){const r=new Ah(n),a=s.timing.withSequence||e.length===0&&s.timing.delay!=="indefinite";r.place({...s,timing:{...s.timing,delay:0,afterEndOf:null}},{local:0,group:0,frames:[],presetClass:null,hold:!0}),n=r.nextOrder;const l=r.behaviors.sort((u,d)=>u.begin-d.begin||u.order-d.order),c=l.reduce((u,d)=>Number.isFinite(d.end)?Math.max(u,d.end):u,0);e.push({auto:a,behaviors:l,length:c})}const o=new Set,i=new Set;for(const s of e)for(const r of s.behaviors){if(r.presetClass!=="entr"&&r.presetClass!=="exit")continue;const a=fe(r.target);i.has(a)||(i.add(a),r.presetClass==="entr"&&o.add(a))}return{stops:e,hiddenAtStart:o}}function Fh(t,e,n){if(e+n<=0)return t;const o=e+n,i=o>1?e/o:e,s=o>1?n/o:n,r=1/(1-i/2-s/2);if(t<i)return r*t*t/(2*i);if(t<=1-s)return r*(t-i/2);const a=1-t;return 1-r*a*a/(2*s)}function Nh(t,e){const{simple:n}=t;if(!(n>0))return 0;if(!Number.isFinite(n))return Math.max(0,e);const o=n*(t.autoReverse?2:1),i=yo(t),s=Math.max(0,e);let r;if(!Number.isFinite(s)&&!Number.isFinite(i))r=0;else if(s>=i){const l=t.repeat-Math.floor(t.repeat);r=l>1e-9?l*o:o}else r=s%o;t.autoReverse&&r>n&&(r=o-r);let a=Fh(Math.min(1,r/n),t.accel,t.decel);return t.reversed&&(a=1-a),a*n}function Ih(t,e){if(e<t.begin||!t.hold&&e>=t.end)return null;let n=e;for(const i of t.frames){const s=n-i.begin;if(s<0)return null;n=Nh(i,s)}const o=t.frames.at(-1);return!o||!(o.simple>0)?1:Number.isFinite(o.simple)?Math.min(1,Math.max(0,n/o.simple)):0}const rr=new Map;function Lh(t,e){const n=`${e}|${t}`;let o=rr.get(n);return o||(o=$h(t,e),rr.set(n,o)),o}function me(t,e){const n=typeof t.value=="number"?t.value:or(t.value,e);return t.formula?or(t.formula,{...e,$:n}):n}function Rh(t,e,n,o){if(t.length===1||e<=t[0].time)return me(t[0],o);for(let i=1;i<t.length;i+=1){const s=t[i];if(e>s.time&&i<t.length-1)continue;const r=t[i-1];if(n)return me(e>=s.time?s:r,o);const a=s.time-r.time,l=a>0?Math.min(1,(e-r.time)/a):1,c=me(r,o);return c+(me(s,o)-c)*l}return me(t.at(-1),o)}function jh(t,e,n,o,i){const{effect:s}=e;switch(s.kind){case"visibility":t.visible=s.visible;return;case"filter":{const r=vh(s.filter,s.entering?n:1-n);t.fade*=r.opacity,r.clip!==null&&(t.clip=r.clip);return}case"motion":t.motion=Ch(Lh(s.path,i),n);return;case"scale":t.sx*=1+(s.by[0]-1)*n,t.sy*=1+(s.by[1]-1)*n;return;case"rotate":t.turn+=s.by*n;return;case"anim":{const r={ppt_x:o.x,ppt_y:o.y,ppt_w:o.w,ppt_h:o.h,ppt_r:o.r,ppt_c:0},a=Rh(s.keys,n,s.discrete,r);if(!Number.isFinite(a))return;s.attribute==="ppt_x"?t.x=a:s.attribute==="ppt_y"?t.y=a:s.attribute==="ppt_w"?t.w=a:s.attribute==="ppt_h"?t.h=a:s.attribute==="r"?t.r=a:t.opacity=a}}}function Dh(t,e,n,o){const i=new Map,s=new Map,r=l=>{let c=i.get(l);return c||(c={visible:!t.hiddenAtStart.has(l),fade:1,opacity:null,motion:null,x:null,y:null,w:null,h:null,r:null,sx:1,sy:1,turn:0,clip:null},i.set(l,c)),c};for(const l of t.hiddenAtStart)r(l);t.stops.forEach((l,c)=>{for(const d of l.behaviors)r(fe(d.target));if(c>=e.cursor)return;const u=c===e.cursor-1?e.elapsed:Number.POSITIVE_INFINITY;for(const d of l.behaviors){const h=Ih(d,u);if(h===null)continue;const f=fe(d.target);s.has(f)||s.set(f,n(f));const p=s.get(f);p&&jh(r(f),d,h,p,o)}});const a=new Map;for(const[l,c]of i){const u=s.get(l)??null??{x:0,y:0,w:0,h:0,r:0};a.set(l,{visible:c.visible,opacity:Math.min(1,Math.max(0,(c.opacity??1)*c.fade)),dx:(c.x??u.x)-u.x+(c.motion?.[0]??0),dy:(c.y??u.y)-u.y+(c.motion?.[1]??0),sx:(u.w>0&&c.w!==null?c.w/u.w:1)*c.sx,sy:(u.h>0&&c.h!==null?c.h/u.h:1)*c.sy,rotate:(c.r??u.r)-u.r+c.turn,clip:c.clip})}return a}const Bh="http://www.w3.org/2000/svg",zh=.25,Wh=24;function qh(t,e){const n=new Map,o=t.querySelector("svg"),i=o?.viewBox.baseVal,s=t.getBoundingClientRect();if(!o||!i||i.width<=0||i.height<=0||s.height<=0||Math.abs(s.width/s.height-i.width/i.height)>.01)return n;const r=i.width,a=i.height,l=[...o.children],c=new Map;for(const f of l){const p=f instanceof SVGGElement?f.dataset.pptxShapeId:void 0;if(p===void 0||!e.has(p)||!(f instanceof SVGGElement))continue;const m=f.getBBox(),g=Math.max(Wh,zh*Math.max(m.width,m.height));c.set(f,[m.x-g,m.y-g,m.width+2*g,m.height+2*g])}if(c.size===0)return n;t.style.position||="absolute",o.style.position="absolute",o.style.left=o.style.top="0";const u=f=>{const p=document.createElementNS(Bh,"svg");return p.setAttribute("viewBox",f.join(" ")),p.setAttribute("preserveAspectRatio","none"),p.style.cssText=`position:absolute;left:${f[0]/r*100}%;top:${f[1]/a*100}%;width:${f[2]/r*100}%;height:${f[3]/a*100}%;overflow:visible`,p};let d=o,h=null;for(const f of l){const p=c.get(f);if(p){const m=u(p);m.append(f),d.after(m),d=m,h=null,n.set(f.dataset.pptxShapeId,{element:m,box:p});continue}d!==o&&(h||(h=u([0,0,r,a]),d.after(h),d=h),h.append(f))}return n}const bo=[1,0,0,1];function ar(t,e){const n=t instanceof SVGGraphicsElement?t:t.closest("foreignObject"),o=n instanceof SVGGraphicsElement?n.getScreenCTM():null,i=e.getScreenCTM();return!o||!i?null:DOMMatrix.fromMatrix(i).inverse().multiply(DOMMatrix.fromMatrix(o))}function Gh(t){const e=t?t.a*t.d-t.b*t.c:0;return t&&e!==0?[t.d/e,-t.b/e,-t.c/e,t.a/e]:bo}function Uh(t,e,n){const o=t.querySelector("svg"),i=o?.viewBox.baseVal,s=i&&i.width>0?i.width:1280,r=i&&i.height>0?i.height:720,a=new Set(e.hiddenAtStart);for(const p of e.stops)for(const m of p.behaviors)a.add(fe(m.target));const l=p=>[...t.querySelectorAll(`[data-pptx-shape-id="${p}"]`)],c=new Map,u=new Set;for(const p of a){const m=p.split(":")[0],g=l(m)[0];let y=null;const b=g&&o?ar(g,o):null;if(g&&b){const x=g.getBBox(),w=b.transformPoint(new DOMPoint(x.x+x.width/2,x.y+x.height/2));y={x:w.x/s,y:w.y/r,w:x.width*Math.hypot(b.a,b.b)/s,h:x.height*Math.hypot(b.c,b.d)/r,r:0}}else g&&(y={x:.5,y:.5,w:1,h:1,r:0});c.set(p,y);for(const x of l(m)){let w=x;for(let v=x.parentElement?.closest("[data-pptx-shape-id]");v;v=v.parentElement?.closest("[data-pptx-shape-id]"))w=v;const k=w instanceof SVGGElement?w.dataset.pptxShapeId:void 0;w.parentElement===o&&k&&u.add(k)}}const d=n?qh(t,u):new Map,h=new Map;for(const[p,m]of d)h.set(p,{element:m.element,layer:m.box,inverse:bo,written:""});const f=new Map;for(const p of a){const m=h.get(p);if(m){f.set(p,[m]);continue}const[g,y]=p.split(":");let b=l(g);if(y){const[x,w]=y.split("-").map(Number);b=b.flatMap(k=>[...k.querySelectorAll("[data-pptx-paragraph]")].filter(v=>v.closest("[data-pptx-shape-id]")===k).filter(v=>{const M=Number(v.dataset.pptxParagraph);return M>=x&&M<=w}))}f.set(p,b.map(x=>({element:x,layer:null,inverse:o&&x instanceof SVGGraphicsElement?Gh(ar(x,o)):bo,written:""})))}return{width:s,height:r,elementsOf:p=>f.get(p)??[],geometryOf:p=>c.get(p)??null,layers:h}}const vt=t=>Math.round(t*1e3)/1e3;function Hh(t,e,n){const{element:o,layer:i}=t,{width:s,height:r,geometry:a}=n,l=o instanceof SVGElement,c=e.dx!==0||e.dy!==0,u=e.sx!==1||e.sy!==1||e.rotate!==0;let d="",h="",f="";if(i){const[w,k,v,M]=i;c&&(d=`${vt(e.dx*s/v*100)}% ${vt(e.dy*r/M*100)}%`);const $=a??{x:(w+v/2)/s,y:(k+M/2)/r,w:v/s,h:M/r,r:0};if(u&&(h=`${vt(($.x*s-w)/v*100)}% ${vt(($.y*r-k)/M*100)}%`),e.clip){const N=(($.x-$.w/2)*s-w)/v*100,U=(($.y-$.h/2)*r-k)/M*100;f=tr(e.clip,[N,U,$.w*s/v*100,$.h*r/M*100])}}else{if(c&&l){const[w,k,v,M]=t.inverse,$=e.dx*s,N=e.dy*r;d=`${vt(w*$+v*N)}px ${vt(k*$+M*N)}px`}e.clip&&(f=tr(e.clip,void 0,l?"fill-box":"")),l&&(u||f!=="")&&(h="50% 50%")}const p=u&&(l||i)?`${vt(e.sx)} ${vt(e.sy)}`:"",m=u&&e.rotate!==0?`${vt(e.rotate)}deg`:"",g=e.opacity<1?String(vt(e.opacity)):"",y=e.visible?"":"hidden",b=`${y}|${g}|${d}|${p}|${m}|${f}|${h}`;if(b===t.written)return;t.written=b;const x=o.style;x.visibility=y,x.opacity=g,x.setProperty("translate",d),x.setProperty("scale",p),x.setProperty("rotate",m),x.clipPath=f,x.transformOrigin=h,i||(x.transformBox=h===""?"":"fill-box")}const _h=["visibility","opacity","translate","scale","rotate","clip-path","transform-box","transform-origin","will-change"],Vh=1.25;function Kh(t){const e=new Map,n=new Set;for(const i of t.behaviors){const s=fe(i.target),{effect:r}=i,a=e.get(s)??{size:1,low:1,high:1};e.set(s,a),r.kind==="anim"&&(r.attribute==="ppt_w"||r.attribute==="ppt_h")&&n.add(s),r.kind==="scale"&&(a.size*=Math.max(r.by[0],r.by[1],.001),a.low=Math.min(a.low,a.size),a.high=Math.max(a.high,a.size))}const o=new Set;for(const[i,s]of e)!n.has(i)&&s.high/s.low<=Vh&&o.add(i);return o}function Yh(t){const{root:e,timeline:n}=t,o=Uh(e,n,t.layered===!0),{width:i,height:s}=o,r=i/s;let a=0,l=0,c=Number.POSITIVE_INFINITY,u=null,d=[];const h=new Set;let f=!1;function p(){const k=Dh(n,{cursor:a,elapsed:c},o.geometryOf,r);for(const[v,M]of k){const $={width:i,height:s,geometry:o.geometryOf(v)};for(const N of o.elementsOf(v))h.add(N.element),Hh(N,M,$)}}function m(k){if(g(),!!k)for(const v of Kh(k)){const M=o.layers.get(v)?.element;M&&(M.style.willChange="transform, opacity",d.push(M))}}function g(){for(const k of d)k.style.willChange="";d=[]}function y(k){if(u=null,f)return;const v=n.stops[a-1];c=k-l;const M=!v||c>=v.length&&v.behaviors.every($=>Number.isFinite($.end));M&&(c=Number.POSITIVE_INFINITY),p(),M?g():u=requestAnimationFrame(y)}function b(){u!==null&&cancelAnimationFrame(u),u=null,g()}function x(k,v){f||(b(),a=Math.max(0,Math.min(n.stops.length,Math.trunc(k)||0)),c=v,p())}const w={get cursor(){return a},get stopCount(){return n.stops.length},get pending(){return a<n.stops.length},get running(){return u!==null},remainingMs(){const k=n.stops[a-1];return u===null||!k?0:Math.max(0,k.length-(performance.now()-l))},advance(){return f||a>=n.stops.length?!1:t.reducedMotion?.()?(x(a+1,Number.POSITIVE_INFINITY),!0):(x(a+1,0),l=performance.now(),m(n.stops[a-1]),u=requestAnimationFrame(y),!0)},back(){return f||a<=0?!1:(x(a-1,Number.POSITIVE_INFINITY),!0)},jumpTo:k=>x(k,Number.POSITIVE_INFINITY),seek:(k,v)=>x(k,Math.max(0,v)),reset(){x(0,Number.POSITIVE_INFINITY),n.stops[0]?.auto&&w.advance()},finish:()=>x(n.stops.length,Number.POSITIVE_INFINITY),dispose(){if(!f){b(),f=!0;for(const k of h)for(const v of _h)k.style.removeProperty(v)}}};return x(0,Number.POSITIVE_INFINITY),w}const Xh=new Set(["par","seq","excl"]),Zh=new Set(["ppt_x","ppt_y","ppt_w","ppt_h","r","style.opacity"]),Ft=t=>t?.children.filter(e=>e.kind==="element")??[],lr=t=>t.children.map(e=>e.kind==="text"?e.data:lr(e)).join(""),Qt=(t,e=0)=>t===void 0?e:Number(t)/1e5;function cr(t){const e=Ft(O(t,"stCondLst"));let n=0,o=null,i=!1;for(const l of e){const c=S(l,"delay"),u=S(l,"evt");u==="onBegin"?i=!0:u==="end"&&(o=Number(S(O(l,"tn"),"val"))),c==="indefinite"?i||(n="indefinite"):c!==void 0&&(n=Number(c)||0)}i&&n==="indefinite"&&(n=0);const s=S(t,"dur"),r=S(t,"repeatCount"),a=O(t,"iterate");return{id:S(t,"id")===void 0?null:Number(S(t,"id")),duration:s===void 0?null:s==="indefinite"?"indefinite":Number(s),delay:n,afterEndOf:o,withSequence:i,hold:S(t,"fill")==="hold"||S(t,"fill")==="freeze",removes:S(t,"fill")==="remove",accel:Qt(S(t,"accel")),decel:Qt(S(t,"decel")),autoReverse:S(t,"autoRev")==="1"||S(t,"autoRev")==="true",repeat:r===void 0?1:r==="indefinite"?"indefinite":Number(r)/1e3,speed:Qt(S(t,"spd"),1),presetClass:S(t,"presetClass")??null,presetId:S(t,"presetID")===void 0?null:Number(S(t,"presetID")),nodeType:S(t,"nodeType")??null,iterate:a?{by:S(a,"type")==="lt"?"letter":"word",share:O(a,"tmPct")?Qt(S(O(a,"tmPct"),"val")):null,ms:O(a,"tmAbs")?Number(S(O(a,"tmAbs"),"val")):null}:null}}function Jh(t){const e=O(O(t,"tgtEl"),"spTgt");if(!e)return null;const n=O(O(e,"txEl"),"pRg");return{shape:Number(S(e,"spid")),paragraphs:n?[Number(S(n,"st")),Number(S(n,"end"))]:null}}function ur(t){const e=Ft(O(t,"val")??t)[0];if(!e)return null;const n=S(e,"val");if(n===void 0)return null;const o=e.name?.localName;return o==="fltVal"||o==="intVal"?Number(n):n}function Qh(t,e){switch(t.name?.localName){case"set":{const n=ur(O(t,"to"));return e.includes("style.visibility")?{kind:"visibility",visible:n!=="hidden"}:e[0]==="style.opacity"&&n!==null?{kind:"anim",attribute:"style.opacity",keys:[{time:0,value:n,formula:null}],discrete:!0}:null}case"animEffect":return{kind:"filter",filter:S(t,"filter")??"fade",entering:S(t,"transition")!=="out"};case"animMotion":{const n=S(t,"path");if(n)return{kind:"motion",path:n};const o=O(t,"by"),i=O(t,"from"),s=O(t,"to"),r=i?`${Number(S(i,"x"))/1e5} ${Number(S(i,"y"))/1e5}`:"0 0";return s?{kind:"motion",path:`M ${r} L ${Number(S(s,"x"))/1e5} ${Number(S(s,"y"))/1e5}`}:o?{kind:"motion",path:`M 0 0 L ${Number(S(o,"x"))/1e5} ${Number(S(o,"y"))/1e5}`}:null}case"animScale":{const n=O(t,"by");return n?{kind:"scale",by:[Qt(S(n,"x"),1),Qt(S(n,"y"),1)]}:null}case"animRot":{const n=S(t,"by");return n===void 0?null:{kind:"rotate",by:Number(n)/6e4}}case"anim":return tp(t,e[0]);default:return null}}function tp(t,e){if(e===void 0||!Zh.has(e))return null;const n=e,o=S(t,"calcmode")==="discrete",i=Ft(O(t,"tavLst")),s=[];if(i.forEach((r,a)=>{const l=ur(r);if(l===null)return;const c=S(r,"tm"),u=c===void 0||c==="indefinite"?i.length<2?0:a/(i.length-1):Number(c)/1e5;s.push({time:u,value:l,formula:S(r,"fmla")??null})}),s.length===0){const r=S(t,"from"),a=S(t,"to"),l=S(t,"by"),c=`#${n}`;a!==void 0?s.push({time:0,value:r??c,formula:null},{time:1,value:a,formula:null}):l!==void 0&&s.push({time:0,value:r??c,formula:null},{time:1,value:`${r??c}+(${l})`,formula:null})}return s.length===0?null:{kind:"anim",attribute:n,keys:s,discrete:o}}function dn(t){const e=t.name?.localName??"";if(Xh.has(e)){const s=O(t,"cTn");return{element:e,timing:cr(s),children:Ft(O(s,"childTnLst")).map(dn).filter(r=>r!==null),sub:Ft(O(s,"subTnLst")).map(dn).filter(r=>r!==null),effect:null,target:null}}const n=O(t,"cBhvr");if(!n)return null;const o=Ft(O(n,"attrNameLst")).map(lr).map(s=>s.trim()),i=O(n,"cTn");return{element:e,timing:cr(i),children:[],sub:Ft(O(i,"subTnLst")).map(dn).filter(s=>s!==null),effect:Qh(t,o),target:Jh(n)}}function ep(t){const e=Ft(O(t??void 0,"tnLst"))[0],n=(e?dn(e):null)?.children.find(o=>o.timing.nodeType==="mainSeq");return n?[...n.children]:[]}const np=t=>Oh(ep(le(t))),dr=[{effect:"fade",directions:[],options:["thruBlack"]},{effect:"cut",directions:[],options:["thruBlack"]},{effect:"push",directions:["u","d","l","r"]},{effect:"pan",directions:["u","d","l","r"]},{effect:"wipe",directions:["l","r","u","d"]},{effect:"cover",directions:["l","r","u","d"]},{effect:"pull",directions:["l","r","u","d"]},{effect:"reveal",directions:["l","r"]},{effect:"split",directions:["out","in"],options:["orientation"]},{effect:"zoom",directions:["in","out"]},{effect:"warp",directions:["in","out"]},{effect:"flythrough",directions:["in","out"]},{effect:"doors",directions:["vert","horz"]},{effect:"window",directions:["vert","horz"]},{effect:"flip",directions:["l","r"]},{effect:"newsflash",directions:[]},{effect:"flash",directions:[]},{effect:"dissolve",directions:[]},{effect:"blinds",directions:["horz","vert"]},{effect:"checker",directions:["horz","vert"]},{effect:"comb",directions:["horz","vert"]},{effect:"randomBar",directions:["horz","vert"]},{effect:"strips",directions:["lu","ru","ld","rd"]},{effect:"circle",directions:[]},{effect:"diamond",directions:[]},{effect:"plus",directions:[]},{effect:"wedge",directions:[]},{effect:"wheel",directions:[],options:["spokes"]},{effect:"morph",directions:[]},{effect:"random",directions:[]}];function hr(){const t=dr.filter(e=>e.effect!=="random"&&e.effect!=="cut"&&e.effect!=="morph");return t[Math.floor(Math.random()*t.length)].effect}const xo={right:"100% 0",left:"-100% 0",bottom:"0 100%",top:"0 -100%"},op={right:"left",left:"right",bottom:"top",top:"bottom"},ip={right:"inset(0 0 0 100%)",left:"inset(0 100% 0 0)",bottom:"inset(100% 0 0 0)",top:"inset(0 0 100% 0)"};function sp(t){const e=t.from??"right",n=xo[op[e]],o=(t.orientation??(t.direction==="horz"?"horz":"vert"))==="horz"?"inset(50% 0 50% 0)":"inset(0 50% 0 50%)",i=t.inOut==="out";switch(t.effect){case"push":case"pan":return{incoming:[{translate:xo[e]},{translate:"0 0"}],outgoing:[{translate:"0 0"},{translate:n}]};case"cover":return{incoming:[{translate:xo[e]},{translate:"0 0"}]};case"pull":return{outgoing:[{translate:"0 0"},{translate:n}],outgoingOnTop:!0};case"reveal":return{outgoing:[{translate:"0 0",opacity:1},{translate:n,opacity:0}],outgoingOnTop:!0};case"wipe":return{incoming:[{clipPath:ip[e]},{clipPath:"inset(0 0 0 0)"}]};case"split":return t.inOut==="in"?{outgoing:[{clipPath:"inset(0 0 0 0)"},{clipPath:o}],outgoingOnTop:!0}:{incoming:[{clipPath:o},{clipPath:"inset(0 0 0 0)"}]};case"doors":case"window":return{incoming:[{clipPath:o,scale:"0.9"},{clipPath:"inset(0 0 0 0)",scale:"1"}]};case"zoom":return i?{outgoing:[{scale:"1",opacity:1},{scale:"1.6",opacity:0}],outgoingOnTop:!0}:{incoming:[{scale:"0.3",opacity:0},{scale:"1",opacity:1}]};case"warp":case"flythrough":return i?{incoming:[{scale:"1.8",opacity:0},{scale:"1",opacity:1}],outgoing:[{scale:"1",opacity:1},{scale:"0.4",opacity:0}]}:{incoming:[{scale:"0.4",opacity:0},{scale:"1",opacity:1}],outgoing:[{scale:"1",opacity:1},{scale:"1.8",opacity:0}],outgoingOnTop:!0};case"newsflash":return{incoming:[{rotate:"720deg",scale:"0"},{rotate:"0deg",scale:"1"}]};case"flash":return{incoming:[{opacity:0,filter:"brightness(4)"},{opacity:1,filter:"brightness(4)",offset:.3},{opacity:1,filter:"brightness(1)"}]};case"flip":{const s=e==="left"?-1:1;return{outgoing:[{rotate:"y 0deg",opacity:1},{rotate:`y ${90*s}deg`,opacity:1,offset:.5},{rotate:`y ${90*s}deg`,opacity:0}],incoming:[{rotate:`y ${-90*s}deg`,opacity:0},{rotate:`y ${-90*s}deg`,opacity:0,offset:.5},{rotate:`y ${-90*s}deg`,opacity:1,offset:.501},{rotate:"y 0deg",opacity:1}],outgoingOnTop:!0,perspective:!0}}case"cut":return t.thruBlack?{incoming:[{opacity:0},{opacity:0,offset:.5},{opacity:1,offset:.5},{opacity:1}],outgoing:[{opacity:0},{opacity:0}],outgoingOnTop:!0}:null;case"fade":return t.thruBlack?{incoming:[{opacity:0},{opacity:0,offset:.5},{opacity:1}],outgoing:[{opacity:1},{opacity:0,offset:.5},{opacity:0}],outgoingOnTop:!0}:{incoming:[{opacity:0},{opacity:1}]};default:return null}}function pr(t){const e=new Map;for(const n of t.querySelectorAll("svg > g[data-pptx-shape-id], svg > * > g[data-pptx-shape-id]")){if(n.parentElement?.closest("g[data-pptx-shape-id]"))continue;const o=n.querySelector("[data-pptx-shape-name]")?.getAttribute("data-pptx-shape-name");o&&!e.has(o)&&e.set(o,{element:n,name:o})}return e}function fr(t){const e=t.ownerSVGElement,n=e?.viewBox.baseVal,o=e?.getBoundingClientRect().width??0;return n&&n.width>0&&o>0?o/n.width:1}function mr(t,e,n){const o=e.width>0?t.width/e.width:1,i=e.height>0?t.height/e.height:1;return`translate(${(t.left-e.left)/n}px, ${(t.top-e.top)/n}px) scale(${o}, ${i})`}function rp(t,e,n){const o=pr(t),i=pr(e),s={duration:n,easing:"ease-in-out",fill:"forwards"},r=[];t.style.zIndex="1";for(const[a,l]of i){const c=o.get(a);if(!c)continue;const u=c.element.getBoundingClientRect(),d=l.element.getBoundingClientRect();if(!(u.width===0||d.width===0)){for(const{element:h}of[c,l])h.style.transformBox="fill-box",h.style.transformOrigin="0 0";r.push(l.element.animate([{transform:mr(u,d,fr(l.element))},{transform:"none"}],s)),r.push(c.element.animate([{transform:"none"},{transform:mr(d,u,fr(c.element))}],s))}}return r.push(t.animate([{opacity:1},{opacity:0}],s)),{done:Promise.all(r.map(a=>a.finished.catch(()=>{}))).then(()=>{for(const a of r)a.cancel();t.remove()}),finish:()=>{for(const a of r)a.finish()}}}const mt=(t,e,n,o)=>n<=0||o<=0?"":`M${t} ${e}h${n}v${o}h${-n}Z`,wo=t=>`M${t.map(([e,n])=>`${e} ${n}`).join("L")}Z`;function gr(t,e,n,o,i){if(i<=0)return"";const s=Math.max(2,Math.ceil(i/.1)),r=[[t,e]];for(let a=0;a<=s;a+=1){const l=o+i*a/s;r.push([t+n*Math.sin(l),e-n*Math.cos(l)])}return wo(r)}function yr(t){const e=Array.from({length:t},(n,o)=>o);for(let n=t-1;n>0;n-=1){const o=Math.floor(Math.random()*(n+1));[e[n],e[o]]=[e[o],e[n]]}return e}function br(t,e,n=4){const o=e==="vert";switch(t){case"circle":return(i,s,r)=>{const a=Math.hypot(s,r)/2*i;return a<=0?"":`M${s/2-a} ${r/2}a${a} ${a} 0 1 0 ${2*a} 0a${a} ${a} 0 1 0 ${-2*a} 0Z`};case"diamond":return(i,s,r)=>wo([[s/2,r/2-r*i],[s/2+s*i,r/2],[s/2,r/2+r*i],[s/2-s*i,r/2]]);case"plus":return(i,s,r)=>{const a=s/2*i,l=r/2*i,c=Math.max(s,r)*i;return mt(s/2-a,r/2-c,2*a,2*c)+mt(s/2-c,r/2-l,2*c,2*l)};case"wedge":return(i,s,r)=>gr(s/2,r/2,Math.hypot(s,r),-Math.PI*i,2*Math.PI*i);case"wheel":return(i,s,r)=>{const a=Math.max(1,Math.round(n)),l=2*Math.PI/a;return Array.from({length:a},(c,u)=>gr(s/2,r/2,Math.hypot(s,r),u*l,l*i)).join("")};case"blinds":return(i,s,r)=>Array.from({length:6},(a,l)=>o?mt(s/6*l,0,s/6*i,r):mt(0,r/6*l,s,r/6*i)).join("");case"checker":return(i,s,r)=>{const c=o?r:s,u=o?s:r,d=c/8*2,h=u/6;let f="";for(let p=0;p<6;p+=1){const m=p%2===0?0:d/2;for(let g=-1;g<8;g+=1){const y=g*d+m,b=Math.min(y+d*i,c),x=Math.max(0,y),w=b-x;f+=o?mt(p*h,x,h,w):mt(x,p*h,w,h)}}return f};case"comb":return(i,s,r)=>Array.from({length:8},(a,l)=>{const c=l%2===0;return o?mt(s/8*l,c?0:r*(1-i),s/8,r*i):mt(c?0:s*(1-i),r/8*l,s*i,r/8)}).join("");case"strips":return(i,s,r)=>{const a=e==="lu"||e==="ld",l=e==="lu"||e==="ru",c=2*i,u=h=>a?s*(1-h):s*h,d=h=>l?r*(1-h):r*h;return wo([[u(0),d(0)],[u(Math.min(1,c)),d(0)],[u(Math.min(1,c)),d(Math.max(0,c-1))],[u(Math.max(0,c-1)),d(Math.min(1,c))],[u(0),d(Math.min(1,c))]])};case"randomBar":{const s=yr(80);return(r,a,l)=>s.slice(0,Math.round(80*r)).map(c=>o?mt(a/80*c,0,a/80+.5,l):mt(0,l/80*c,a,l/80+.5)).join("")}case"dissolve":{const r=yr(576);return(a,l,c)=>r.slice(0,Math.round(r.length*a)).map(u=>mt(u%32*l/32,Math.floor(u/32)*c/18,l/32+.5,c/18+.5)).join("")}default:return null}}const ap=400;function xr(t,e,n,o=!1){if(!t||!n||n.effect==="none"||n.effect==="cut"&&!n.thruBlack||n.durationMs<=0)return t?.remove(),{done:Promise.resolve(),finish:()=>{}};const i=n.effect==="random"?{...n,effect:hr()}:n,s=o?null:br(i.effect,i.direction,i.spokes),r=i.effect==="cut"?ap:i.durationMs;return s?lp(t,e,s,r):typeof e.animate!="function"?(t.remove(),{done:Promise.resolve(),finish:()=>{}}):i.effect==="morph"&&!o?rp(t,e,r):o?wr(t,e,{incoming:[{opacity:0},{opacity:1}]},Math.min(200,i.durationMs)):wr(t,e,sp(i)??{incoming:[{opacity:0},{opacity:1}]},r)}function wr(t,e,n,o){n.outgoingOnTop&&(t.style.zIndex="1");const i=e.parentElement,s=n.perspective&&i?i.style.perspective:null;n.perspective&&i&&(i.style.perspective="2000px");const r={duration:o,easing:"ease-in-out",fill:"forwards"},a=[...n.incoming?[e.animate(n.incoming,r)]:[],...n.outgoing?[t.animate(n.outgoing,r)]:[]];return{done:Promise.all(a.map(l=>l.finished.catch(()=>{}))).then(()=>{for(const l of a)l.cancel();s!==null&&i&&(i.style.perspective=s),t.remove()}),finish:()=>{for(const l of a)l.finish()}}}function lp(t,e,n,o){const i=e.ownerDocument.defaultView,s=i?.requestAnimationFrame?.bind(i)??(f=>setTimeout(()=>f(performance.now()),16)),r=performance.now();let a=!1,l;const c=new Promise(f=>{l=f}),u=f=>{const p=e.getBoundingClientRect();e.style.clipPath=`path("${n(f,p.width,p.height)||"M0 0h0v0Z"}")`},d=()=>{a||(a=!0,e.style.clipPath="",t.remove(),l())},h=f=>{if(a)return;const p=Math.min(1,(f-r)/o);p>=1?d():(u(p),s(h))};return u(0),s(h),{done:c,finish:d}}function kr(t){return{...El(t),...t?.direction===void 0?{}:{direction:t.direction},...t?.spokes===void 0?{}:{spokes:t.spokes},...t?.thruBlack?{thruBlack:!0}:{}}}const vr=new WeakMap,cp={width:12192e3,height:6858e3};async function Mr(t,e={}){const n=await Dt(t),o=ya(n);let i=Qs(n,e.slides??o.slides,e.includeHidden);const s=Q(n),r=new Map,a=Ys();await a.prepare(s);const l=x=>{const w=i[x]?.slide;if(!w)throw new RangeError(`Slide ${x} is outside the show.`);return w},c=new Map,u=x=>{let w=c.get(x);return w||c.set(x,w=Zs(x)),w},d=new Map,h=x=>{let w=d.get(x);return w||d.set(x,w=dh(x)),w},f=new Map,p=x=>{let w=f.get(x);return w||f.set(x,w=np(x)),w},m=o.mode.kind==="kiosk",g=Pt(n),y=g?{width:g.width,height:g.height}:cp,b={get count(){return i.length},get parts(){return i.map(x=>X(x.slide))},get numbers(){return i.map(x=>x.number)},size:y,settings:{kiosk:m,loop:m||o.loop,useTimings:o.useTimings},render(x){const w=l(x);let k=r.get(w);return k===void 0&&(k=an(n,w,a.typeset(Nn(n,w,e.render),w)),r.set(w,k)),k},switchTo(x){const w={kind:"sequence"};return vr.set(w,i),i=Qs(n,x),w},restore(x){i=vr.get(x)??i},nextHidden(x){const w=i[x]?.number,k=w===void 0?void 0:s[w];return w!==void 0&&k&&Cn(k)?b.reveal(w+1):-1},reveal(x){const w=i.findIndex(M=>M.number===x);if(w>=0)return w;const k=s[x-1];if(!k)return-1;const v=i.reduce((M,$,N)=>$.number<x?N:M,-1);return i.splice(v+1,0,{slide:k,number:x}),v+1},transition:x=>kr(ba(l(x))),animations:x=>u(l(x)).main,triggers:x=>h(l(x)),timeline:x=>p(l(x)),notes:x=>ma(l(x))??"",writeNotes:(x,w)=>Ha(l(x),w,{preserveFormatting:!0}),media:x=>yh(n,l(x),y),sound:x=>bh(n,l(x))};return b}const ko={pen:{width:.0025,opacity:1},highlighter:{width:.014,opacity:.45}};function Sr(t,e,n,o){const[i,s,r,a,l,c]=[t.x,t.y*o,e.x,e.y*o,n.x,n.y*o],u=l-r,d=c-a,h=u*u+d*d,f=h===0?0:Math.max(0,Math.min(1,((i-r)*u+(s-a)*d)/h));return Math.hypot(i-(r+f*u),s-(a+f*d))}function up(t,e,n,o){const i=n+t.width/2,{points:s}=t;if(s.length===1)return Sr(e,s[0],s[0],o)<=i;for(let r=1;r<s.length;r+=1)if(Sr(e,s[r-1],s[r],o)<=i)return!0;return!1}function dp(t,e){return t.map(n=>({points:n.points.map(o=>({x:Math.round(o.x*e.width),y:Math.round(o.y*e.height)})),color:n.color,width:Math.max(1,Math.round(n.width*e.width)),opacity:ko[n.tool].opacity}))}function hp(t,e){return[...t].filter(([,n])=>n.length>0).map(([n,o])=>({slide:n,strokes:dp(o,e)}))}const pp=.012;function fp(t,e){const n=document.createElement("canvas");n.style.cssText="position:absolute;inset:0;width:100%;height:100%;z-index:5;pointer-events:none;touch-action:none";const o=document.createElement("div");o.style.cssText="position:absolute;z-index:6;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;pointer-events:none;display:none;background:radial-gradient(circle,#fff 0 18%,#ff2a1a 30% 55%,rgba(255,42,26,0) 72%);box-shadow:0 0 10px 3px rgba(255,42,26,.55)",t.append(n,o);const i=n.getContext("2d");let s=[],r="pointer",a="#E53935",l=null;const c=g=>{const y=t.getBoundingClientRect();return{x:(g.clientX-y.left)/(y.width||1),y:(g.clientY-y.top)/(y.height||1)}};function u(){const g=t.getBoundingClientRect(),y=window.devicePixelRatio||1,b=Math.round(g.width*y),x=Math.round(g.height*y);if((n.width!==b||n.height!==x)&&(n.width=b,n.height=x),!!i){i.clearRect(0,0,b,x),i.lineCap="round",i.lineJoin="round";for(const w of s){const[k,...v]=w.points;if(!k)continue;i.globalAlpha=ko[w.tool].opacity,i.strokeStyle=w.color,i.lineWidth=Math.max(1,w.width*b),i.beginPath(),i.moveTo(k.x*b,k.y*x),v.length===0&&i.lineTo(k.x*b+.01,k.y*x);let M=k;for(const $ of v)i.quadraticCurveTo(M.x*b,M.y*x,(M.x+$.x)/2*b,(M.y+$.y)/2*x),M=$;v.length>0&&i.lineTo(M.x*b,M.y*x),i.stroke()}i.globalAlpha=1}}function d(g){const y=t.getBoundingClientRect(),b=y.width===0?1:y.height/y.width,x=s.filter(w=>!up(w,g,pp,b));return x.length===s.length?!1:(s.splice(0,s.length,...x),!0)}n.addEventListener("pointerdown",g=>{if(g.button===0){if(g.preventDefault(),g.stopPropagation(),n.setPointerCapture?.(g.pointerId),r==="eraser"){d(c(g))&&(u(),e());return}r!=="pen"&&r!=="highlighter"||(l={tool:r,color:a,width:ko[r].width,points:[c(g)]},s.push(l),u())}}),n.addEventListener("pointermove",g=>{(g.buttons&1)!==0&&(l?(l.points.push(c(g)),u()):r==="eraser"&&d(c(g))&&(u(),e()))});const h=()=>{l&&(l=null,e())};n.addEventListener("pointerup",h),n.addEventListener("pointercancel",h),n.addEventListener("click",g=>g.stopPropagation());const f=g=>{if(r!=="laser")return;const y=t.getBoundingClientRect();o.style.left=`${g.clientX-y.left}px`,o.style.top=`${g.clientY-y.top}px`,o.style.display="block"},p=t.parentElement??t;p.addEventListener("pointermove",f);const m=typeof ResizeObserver=="function"?new ResizeObserver(()=>u()):null;return m?.observe(t),{show(g){s=g,l=null,u()},setTool(g,y){r=g,a=y;const b=r==="pen"||r==="highlighter"||r==="eraser";n.style.pointerEvents=b?"auto":"none",n.style.cursor=r==="eraser"?"cell":b?"crosshair":"",p.style.cursor=r==="laser"?"none":"default",r!=="laser"&&(o.style.display="none")},setVisible(g){n.style.visibility=g?"":"hidden"},dispose(){m?.disconnect(),p.removeEventListener("pointermove",f),n.remove(),o.remove()}}}const vo={start:.12,min:.04,max:.4};function mp(t){const e=document.createElement("div");e.style.cssText="position:absolute;inset:0;z-index:7;pointer-events:none;display:none",t.append(e);const n=t.parentElement??t;let o=!1,i=vo.start,s={x:.5,y:.5};const r=()=>{const c=t.getBoundingClientRect(),u=i*c.width;e.style.background=`radial-gradient(circle ${u}px at ${s.x*100}% ${s.y*100}%, transparent ${u-1}px, rgba(0,0,0,.8) ${u+1}px)`},a=c=>{if(!o)return;const u=t.getBoundingClientRect();s={x:(c.clientX-u.left)/(u.width||1),y:(c.clientY-u.top)/(u.height||1)},r()},l=c=>{o&&(c.preventDefault(),i=Math.min(vo.max,Math.max(vo.min,i*(c.deltaY<0?1.1:1/1.1))),r())};return n.addEventListener("pointermove",a),n.addEventListener("wheel",l,{passive:!1}),{set(c){o=c,e.style.display=o?"block":"none",o&&r()},dispose(){n.removeEventListener("pointermove",a),n.removeEventListener("wheel",l),e.remove()}}}const hn={size:.28,zoom:2,minZoom:1.5,maxZoom:4};function gp(t){const e=document.createElement("div");e.style.cssText="position:absolute;z-index:8;pointer-events:none;display:none;border-radius:50%;overflow:hidden;box-shadow:0 0 0 3px rgba(255,255,255,.9),0 6px 24px rgba(0,0,0,.45);background:#fff";const n=document.createElement("div");n.style.cssText="position:absolute;left:0;top:0;transform-origin:0 0",e.append(n),t.append(e);const o=t.parentElement??t;let i=!1,s=hn.zoom,r={x:.5,y:.5};const a=()=>{const d=t.getBoundingClientRect(),h=hn.size*d.width,f=r.x*d.width,p=r.y*d.height;e.style.width=e.style.height=`${h}px`,e.style.left=`${f-h/2}px`,e.style.top=`${p-h/2}px`,n.style.width=`${d.width}px`,n.style.height=`${d.height}px`,n.style.transform=`translate(${h/2-f*s}px, ${h/2-p*s}px) scale(${s})`},l=()=>{const d=[...t.children].filter(h=>h!==e&&h.tagName==="DIV"&&h.querySelector("svg")).at(-1);n.replaceChildren(...d?[d.cloneNode(!0)]:[])},c=d=>{if(!i)return;const h=t.getBoundingClientRect();r={x:(d.clientX-h.left)/(h.width||1),y:(d.clientY-h.top)/(h.height||1)},a()},u=d=>{i&&(d.preventDefault(),s=Math.min(hn.maxZoom,Math.max(hn.minZoom,s*(d.deltaY<0?1.15:1/1.15))),a())};return o.addEventListener("pointermove",c),o.addEventListener("wheel",u,{passive:!1}),{set(d){i=d,e.style.display=i?"block":"none",i&&(l(),a())},refresh(){i&&l()},dispose(){o.removeEventListener("pointermove",c),o.removeEventListener("wheel",u),e.remove()}}}function yp(t,e){switch(e.kind){case"next":t.next();break;case"previous":t.previous();break;case"first":t.go(0);break;case"last":t.go(t.deck.count-1);break;case"end":t.close();break;case"clear-ink":t.clearInk();break;case"unblank":t.setBlank(null);break;case"blank":t.setBlank(e.blank);break;case"tool":t.setTool(e.tool);break;case"pause":t.setPaused(!t.paused);break;case"ink-visible":t.setInkVisible(!t.inkVisible);break;case"next-hidden":{const n=t.deck.nextHidden(t.index);n>=0?t.go(n):t.next();break}case"go":{const n=t.deck.numbers.indexOf(e.number);n>=0&&t.go(n);break}}}const bp="[role='menu'],[role='listbox'],[role='dialog'],input,textarea,select";function xp(t,e,n){const{kiosk:o,links:i,playback:s}=n;t.addEventListener("click",a=>{const l=a.target instanceof Element?a.target.closest("a"):null,c=n.blank(),u=n.tool();if(l&&e.contains(l)){a.preventDefault(),a.stopPropagation(),c||i.follow(l.getAttribute("href")??l.getAttribute("xlink:href")??"",s.index);return}if(c||u!=="pointer"&&u!=="laser"&&u!=="spotlight"&&u!=="magnifier")return;const d=a.target instanceof Element?a.target.closest("[data-pptx-trigger]"):null;d&&e.contains(d)&&s.trigger(Number(d.dataset.pptxTrigger))||o||s.clickAdvances&&s.forward()}),t.addEventListener("contextmenu",a=>{a.preventDefault(),!o&&!n.blank()&&s.backward()});const r=a=>{const l=a.target instanceof Element?a.target.closest(bp):null;l&&l!==t||!n.handleKey(a)||(a.preventDefault(),a.stopPropagation())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)}const wp=new Set(["ArrowRight","ArrowDown","PageDown"," ","Enter","n","N"]),kp=new Set(["ArrowLeft","ArrowUp","PageUp","Backspace","p","P"]),vp={l:"laser",p:"pen",i:"highlighter",e:"eraser",a:"pointer"},Mp={b:"black",".":"black",w:"white",",":"white"};function Sp(){let t="";return{read(e,n){const o=e.key;if(e.ctrlKey||e.metaKey){if(o.toLowerCase()==="m"&&!e.altKey)return{kind:"ink-visible"};const r=vp[o.toLowerCase()];return!r||e.altKey?null:(t="",{kind:"tool",tool:r==="laser"&&n.tool==="laser"?"pointer":r})}if(/^[0-9]$/u.test(o))return t=`${t}${o}`.slice(-4),null;const i=t;if(t="",o==="Escape")return{kind:"end"};const s=Mp[o.toLowerCase()];return n.blank!==null?s===n.blank||!s?{kind:"unblank"}:{kind:"blank",blank:s}:s?{kind:"blank",blank:s}:o==="Enter"&&i!==""?{kind:"go",number:Number(i)}:wp.has(o)?{kind:"next"}:kp.has(o)?{kind:"previous"}:o==="Home"?{kind:"first"}:o==="End"?{kind:"last"}:o==="e"||o==="E"?{kind:"clear-ink"}:o==="s"||o==="S"||o==="+"?{kind:"pause"}:o==="h"||o==="H"?{kind:"next-hidden"}:null}}}function $p(t,e,n){let o=-1,i=null;return{follow(s,r){if(!s.startsWith("#"))return/^(https?:|mailto:|tel:)/iu.test(s)?(n(s),!0):!1;const a=/^#slide-(\d+)$/u.exec(s);if(a){const c=t.count,u=t.reveal(Number(a[1]));return t.count>c&&i!==null&&i>=u&&(i+=1),t.count>c&&o>=u&&(o+=1),u>=0&&e.go(u),!0}const l=/^#pptx-custom-show\?id=(\d+)&return=(true|false)$/u.exec(s);if(l)return o=-1,i=null,e.customShow(Number(l[1]),l[2]==="true"),!0;switch(s){case"#pptx-next-slide":return e.go(r+1),!0;case"#pptx-prev-slide":return r>0&&e.go(r-1),!0;case"#pptx-first-slide":return e.go(0),!0;case"#pptx-last-slide":return e.go(t.count-1),!0;case"#pptx-last-slide-viewed":return i!==null&&e.go(i),!0;case"#pptx-end-show":return e.close(),!0;default:return s.startsWith("#pptx-")}},arrived(s){s!==o&&(i=o<0?null:o,o=s)}}}const Cp=1e3;function Tp(t,e){const n=t.ownerDocument;let o=!1,i=0;function s(){n.fullscreenElement===t?o=!0:o&&(o=!1,performance.now()>i&&e())}return n.addEventListener("fullscreenchange",s),t.requestFullscreen?.().then(()=>{o=!0},()=>{}),{expectExit(){i=performance.now()+Cp},dispose(){n.removeEventListener("fullscreenchange",s),n.fullscreenElement===t&&n.exitFullscreen().catch(()=>{})}}}const Mo=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function $r(t,e,n,o=[],i=Mo){const s=document.createElement("div");s.style.cssText="position:absolute;inset:0;display:flex;align-items:center;justify-content:center",s.innerHTML=e;const r=s.querySelector("svg");r?.setAttribute("width","100%"),r?.setAttribute("height","100%"),t.append(s);const a="stops"in n?Yh({root:s,timeline:n,reducedMotion:i,layered:!0}):Pp(ii({root:s,steps:n.map(So),reducedMotion:i}),n);a.jumpTo(0);const l=new Map;for(const c of o){const u=ii({root:s,steps:c.steps.map(So),reducedMotion:i});u.jumpTo(0),l.set(c.shape,u);for(const d of s.querySelectorAll(`g[data-pptx-shape-id="${c.shape}"]`))d.dataset.pptxTrigger=String(c.shape)}return{element:s,player:a,triggers:l}}function Pp(t,e){const n=Cr(e);return{get cursor(){return t.cursor},get stopCount(){return t.stopCount},get pending(){return t.pending},get running(){return t.running},remainingMs:()=>t.running?Math.max(0,(n[t.cursor-1]??0)-(t.progress.elapsed??0)):0,advance:()=>t.advance(),back:()=>t.back(),jumpTo:o=>t.jumpTo(o),seek:(o,i)=>t.resume(o,i),reset:()=>t.reset(),finish:()=>t.finish(),dispose:()=>t.dispose()}}function Cr(t){return il(t.map(So)).stops.map(e=>Math.max(0,...e.items.map(n=>n.begin+(n.duration??0))))}function So(t){return t.valueAfterEnd==="unstated"&&(t.presetClass==="entr"||t.presetClass==="exit")?{...t,valueAfterEnd:"held"}:t}const Ep=8;function Ap(t,e){const n=typeof window>"u"?void 0:window.requestIdleCallback;function o(i,s){if(i>=t.count||s>=Ep)return;const r=()=>{if(e.open()){if(e.busy()){setTimeout(()=>o(i,s),250);return}try{t.render(i)}catch{}e.timed&&t.transition(i).advanceAfterMs!==void 0&&o(i+1,s+1)}};n?n(r,{timeout:1e3}):setTimeout(r,50)}return i=>o(i,0)}function Op(t,e,n){let o=Tr(n.start,e.count),i=null,s=null,r,a=null,l=null,c=!1,u=!0;const d=Ap(e,{timed:n.timed,open:()=>u,busy:()=>i?.player.running===!0});function h(g){if(clearTimeout(r),a=l=null,s?.finish(),e.count===0){t.textContent="没有可放映的幻灯片",t.style.color="#fff";return}const y=i,b=$r(t,e.render(o),e.timeline?.(o)??e.animations(o),e.triggers(o));i=b,n.drawn?.(b.element,o),g==="back"&&b.player.finish(),y?.player.dispose();for(const x of y?.triggers.values()??[])x.dispose();(s=xr(y?.element??null,b.element,g==="forward"?e.transition(o):null,Mo())).done.then(()=>{i===b&&(s=null,g!=="back"&&b.player.reset(),p(),d(o+1))}),n.arrived(o)}function f(g){clearTimeout(r),a=null,l=c?g:null,!c&&(a=performance.now()+g,r=setTimeout(()=>{a=null,m.forward()},g))}function p(){clearTimeout(r),a=l=null;const g=e.count>0&&n.timed?e.transition(o).advanceAfterMs:void 0;g!==void 0&&u&&f(Math.max(0,g,i?.player.remainingMs()??0))}const m={get index(){return o},get animation(){return{played:i?.player.cursor??0,total:i?.player.stopCount??0}},get paused(){return c},setPaused(g){g!==c&&(g&&a!==null&&(clearTimeout(r),l=Math.max(0,a-performance.now()),a=null),c=g,!c&&l!==null&&u&&f(l))},get clickAdvances(){return s!==null||i?.player.pending===!0||e.count===0||e.transition(o).advanceOnClick},go(g,y="jump"){if(!u)return;if(g>=e.count)if(n.loop()&&e.count>0)g=0;else{n.ended();return}const b=Tr(g,e.count);b===o&&y!=="forward"&&i||(o=b,h(y))},forward(){s?s.finish():i?.player.advance()?(p(),n.stepped?.()):m.go(o+1,"forward")},backward(){s?s.finish():i?.player.back()?n.stepped?.():o>0&&m.go(o-1,"back")},trigger(g){const y=i?.triggers.get(g);return!y||s?!1:(y.advance()||(y.jumpTo(0),y.advance()),n.stepped?.(),!0)},dispose(){u=!1,clearTimeout(r),s?.finish(),i?.player.dispose();for(const g of i?.triggers.values()??[])g.dispose()}};return h("jump"),m}function Tr(t,e){return Math.min(Math.max(0,Math.trunc(t)),Math.max(0,e-1))}function Fp(t=()=>performance.now()){const e=new Map;let n=null,o=t(),i=null,s=0;const r=()=>(i??t())-o;return{get paused(){return i!==null},slideMs:r,totalMs:()=>s+r(),toggle(){i===null?i=t():(o+=t()-i,i=null)},repeat(){o=i??t()},enter(a){if(n!==null){const l=r();e.set(n,(e.get(n)??0)+l),s+=l}n=a,o=i??t()},timings(){const a=new Map(e);return n!==null&&a.set(n,(a.get(n)??0)+r()),[...a].map(([l,c])=>({slide:l,ms:Math.round(c)}))}}}function Np(t,e){const n=[];return{start(o,i){const s=e().index,r=t.switchTo({kind:"customShow",id:o});i&&n.push({sequence:r,index:s}),e().go(0,"forward")},pending:()=>n.length>0,returned(){const o=n.pop();return o?(t.restore(o.sequence),e().go(o.index,"forward"),!0):!1}}}function Ip(){const t=document.createElement("div");t.setAttribute("role","dialog"),t.setAttribute("aria-label","幻灯片放映"),t.tabIndex=-1,t.style.cssText="position:fixed;inset:0;z-index:2147483000;background:#000;display:flex;align-items:center;justify-content:center;cursor:default;outline:none";const e=document.createElement("div");e.style.cssText="position:relative;width:100%;height:100%;overflow:hidden";const n=document.createElement("div");n.setAttribute("aria-live","polite"),n.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)",t.dataset.pptxShowSurface="";const o=document.createElement("style");o.textContent="[data-pptx-show-surface] a,[data-pptx-show-surface] [data-pptx-trigger]{cursor:pointer}[data-pptx-show-surface][data-tool=laser] a,[data-pptx-show-surface][data-tool=laser] [data-pptx-trigger]{cursor:none}";const i=document.createElement("div");return i.style.cssText="position:absolute;inset:0;z-index:10;display:none",t.append(o,e,i,n),{surface:t,stage:e,status:n,cover:i}}function Lp(t,e,n=0){if(e.width<=0||e.height<=0)return;const o=e.width/e.height,i=n>0?`(100vh - ${n}px)`:"100vh";t.style.width=`min(100vw, calc(${o} * ${i}))`,t.style.height=`min(calc(${i}), ${100/o}vw)`}function Pr(t,e={}){const n=e.container??document.body,{surface:o,stage:i,status:s,cover:r}=Ip(),a=e.windowed===!0;Lp(i,t.size,a?48:0),a&&(o.style.paddingBottom="48px");const l=new Set,c=new Map,u=Sp(),d=e.rehearse?Fp():null,h=performance.now(),{kiosk:f}=t.settings;let p="pointer";const m={pen:"#E53935",highlighter:"#FDD835"},g=()=>p==="highlighter"?m.highlighter:m.pen;let y=null,b=!0,x=!0,w;const k=new Promise(C=>{w=C}),v=gp(i),M=()=>{v.refresh();for(const C of[...l])C()},$=fp(i,M),N=mp(i),U=Np(t,()=>D),J=$p(t,{go:C=>D.go(C,"forward"),close:()=>Tt.close(),customShow:(C,Y)=>U.start(C,Y)},C=>{window.open(C,"_blank","noopener")}),lt=C=>{const Y=t.parts[C];if(Y===void 0)return[];let fn=c.get(Y);return fn||c.set(Y,fn=[]),fn},gt=ph(),G=wh(),I=hh(o);let K=null;const D=Op(i,t,{start:e.start??0,timed:t.settings.useTimings&&!d,loop:()=>t.settings.loop&&!U.pending(),arrived(C){J.arrived(C),G.play(t.sound(C)),$.show(lt(C)),d?.enter(t.parts[C]),s.textContent=`第 ${C+1} 页,共 ${t.count} 页`,M()},ended:()=>{U.returned()||Tt.close()},stepped:()=>M(),drawn(C,Y){K?.stop(),I.arrive(Y),K=fh(C,t.media(Y),gt,{index:Y,part:t.parts[Y],background:I})}});function Ct(C){const Y=u.read(C,{tool:p,blank:y});return Y?((!f||Y.kind==="end")&&yp(Tt,Y),!0):!1}let Nt=null;const Tt={get index(){return D.index},deck:t,surface:o,get tool(){return p},get inkColor(){return g()},get blank(){return y},get animation(){return D.animation},get hasInk(){return[...c.values()].some(C=>C.length>0)},rehearsal:d,windowed:a,elapsedMs:()=>performance.now()-h,closed:k,go:C=>D.go(C),next:()=>D.forward(),previous:()=>D.backward(),setTool(C){p=C,o.dataset.tool=p,N.set(p==="spotlight"),v.set(p==="magnifier"),$.setTool(p,g()),M()},setInkColor(C){p!=="pen"&&p!=="highlighter"&&(p="pen"),m[p]=C,o.dataset.tool=p,N.set(!1),v.set(!1),$.setTool(p,g()),M()},clearInk(C="slide"){if(C==="all")for(const Y of c.values())Y.length=0;else lt(D.index).length=0;$.show(lt(D.index)),M()},setBlank(C){y=C,r.style.display=y?"block":"none",r.style.background=y==="white"?"#fff":"#000",M()},handleKey:Ct,get paused(){return D.paused},setPaused(C){D.setPaused(C),d&&d.paused!==C&&d.toggle(),s.textContent=C?"已暂停自动放映":`第 ${D.index+1} 页,共 ${t.count} 页`,M()},get inkVisible(){return b},setInkVisible(C){b=C,$.setVisible(C),M()},goLastViewed:()=>{J.follow("#pptx-last-slide-viewed",D.index)},expectWindowed(){Nt?.expectExit()},subscribe(C){return l.add(C),()=>l.delete(C)},close(){if(!x)return;x=!1;const C=d?.timings()??null;D.dispose(),K?.stop(),I.stop(),gt.release(),G.stop(),$.dispose(),N.dispose(),v.dispose(),ge(),Nt?.dispose(),o.remove(),M(),l.clear(),w({ink:hp(c,t.size),timings:C})}},ge=xp(o,i,{blank:()=>y,tool:()=>p,kiosk:f,links:J,playback:D,handleKey:Ct});return n.append(o),o.focus(),a||(Nt=Tp(o,()=>Tt.close())),Tt}const Rp={lt1:"light1",lt2:"light2",dk1:"dark1",dk2:"dark2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6"};function jp(t){const{design:e,name:n}=t.manifest,o=ee(t.presentation),i=te.filter(r=>{const a=Rp[We[r]??""];return a!==void 0&&(o?.[a]??"").replace("#","").toUpperCase()!==e.palette[r].slice(1).toUpperCase()}),s={background:"background"};return{...Be({name:n,palette:e.palette,pages:{cover:s,section:s,content:s,data:s,quote:s,closing:s},fonts:e.fonts,type:e.type,margin:e.margin,motif:"the template's own graphics"}),literal:i}}function Er(t){const e=n=>{try{return!Go(n).trim()}catch{return!1}};return Q(t).every(n=>nt(n).every(o=>ka(o)&&e(o)))}async function Ar(t,e){const n=await Dt(await Bt(e.presentation)),o=[...Q(n)],i=await Dt(await Bt(t)),s=Pt(n),r=Pt(i);if(s&&r&&(s.width!==r.width||s.height!==r.height)&&Ee(i,{width:s.width,height:s.height},{content:"fit"}),Er(t)){const u=e.manifest.pages.find(h=>h.kind==="cover"&&"slide"in h.source),d=u&&"slide"in u.source?u.source.slide-1:-1;if(o[d])o.splice(d,1);else for(const h of Q(i))$n(n,h,Ve(n,h))}else for(const u of Q(i))$n(n,u,Ve(n,u));for(const u of o)$a(n,u);const a=Q(n),l=new Map(Q(i).map((u,d)=>[X(u),d]));_a(n,ga(i).map(u=>({name:u.name,slides:u.slides.flatMap(d=>a[l.get(X(d))]??[])})));const c=Vr(i);c&&Ta(n,c);for(const u of Object.keys(ht(n)))Et(n,u,null);for(const[u,d]of Object.entries(ht(i)))u!=="QuireKit.Template"&&Et(n,u,d);return Et(n,je,JSON.stringify(jp(e))),Et(n,Rr,JSON.stringify(e.reference)),Bt(n)}const Dp="file";function Bp(t,e){const n=new Map,o=new Set,i=l=>JSON.stringify([l.source,l.id]);async function s(l,c){const u=i({source:l,id:c}),d=await e.find(f=>f.id===l)?.load(c);if(!d)return n.get(u);const h=await Eo(d,l,c);return n.set(u,h),h}function r(){const l=Ao(t.presentation());!l||n.has(i(l))||o.has(i(l))||(o.add(i(l)),s(l.source,l.id).catch(()=>{}))}const a=t.subscribe(l=>{l.content&&l.origin!=="agent"&&!l.live&&r()});return r(),{sources:e,current(l){const c=Ao(l);return c?n.get(i(c)):void 0},async apply(l){let c;if("bytes"in l?(c=await Eo(l,Dp,l.name),n.set(i(c.reference),c)):c=await s(l.source,l.id),!c)return!1;const u=t.version(),d=await Ar(t.presentation(),c);return t.adopt(t.version()===u?d:await Ar(t.presentation(),c),"套用模板","command")},destroy:a}}const zp="未命名演示文稿.pptx",Wp="application/vnd.openxmlformats-officedocument.presentationml.presentation";function $o(){const t=bn();return _r(t,""),t}function pn(t){const e=t.trim()||"未命名演示文稿.pptx";return/\.pptx$/iu.test(e)?e:`${e}.pptx`}function qp(t,e){const n=URL.createObjectURL(new Blob([t],{type:Wp})),o=document.createElement("a");o.href=n,o.download=pn(e),o.rel="noopener",o.style.display="none",document.body.append(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)}const Or=new WeakSet;function Gp(t){if(!Or.has(t))throw new Error("Not a session of this editor.");return t}function Up(t,e,n={}){const o=eh($o()),i=new Set,s=new AbortController;let r=pn(t.initialDocument?.name??"未命名演示文稿.pptx"),a=!1,l=null,c;const u=y=>{for(const b of[...i])b(y)},d=o.subscribe(y=>{y.content&&u({type:"change",source:y.origin}),o.isDirty()!==a&&(a=o.isDirty(),u({type:"dirty",dirty:a})),y.content&&t.autoSave&&t.save&&(clearTimeout(c),c=setTimeout(()=>{p()},1200))}),h=Bp(o,t.templates??[]),f=Jd(e,{...n,template:h.current,presentation:()=>o.presentation(),transact:(y,b)=>o.transact(y,b,"command")});function p(){return l||(l=(async()=>{const y=o.version(),b=await o.save();let x;try{x=t.save?await t.save({name:r,bytes:b}):(qp(b,r),!0)}catch{x=!1}return x&&o.version()===y&&o.markSaved(),x})().finally(()=>{l=null}),l)}async function m(y,b){const x=r;r=pn(y);const w=await o.replace(b);return w||(r=x),w}const g={ready:(async()=>{const y=t.initialDocument;if(!y)return;let b;try{b=await y.read(s.signal)}catch{b=void 0}!s.signal.aborted&&b!==void 0&&await m(y.name,b)})(),document:o,table:f,templates:h,commands:f.commands,chain:()=>f.chain(),name:()=>r,isDirty:()=>o.isDirty(),selection(){const{slide:y,shapes:b}=o.selection(),x=o.presentation(),w=y===null?null:Io(x,y);if(w===null||y===null)return[];const k=ca(x,w);return b.flatMap(v=>{const M=ke(w,v);return M===null?[]:[{slide:y,slideIndex:k,shape:v,name:wn(M)??""}]})},snapshot:()=>o.save(),open(y,b){return s.abort(),m(y,b)},async createDocument(){s.abort(),await m(zp,await Bt($o()))},rename(y){r=pn(y)},save:p,applyTemplate:y=>h.apply(y),undo:()=>o.undo(),redo:()=>o.redo(),async present(y){const b=await Mr(await o.save()),x=o.selection().slide;return Pr(b,{start:y??Math.max(0,x===null?0:b.parts.indexOf(x))})},subscribe(y){return i.add(y),()=>i.delete(y)},destroy(){s.abort(),clearTimeout(c),d(),h.destroy(),i.clear()}};return Or.add(g),g}async function Hp(t,e,n,o){const i=URL.createObjectURL(new Blob([e],{type:"image/svg+xml"}));try{const s=t.createElement("img");s.src=i,await s.decode();const r=t.createElement("canvas");r.width=Math.max(1,Math.round(n)),r.height=Math.max(1,Math.round(o)),r.getContext("2d")?.drawImage(s,0,0,r.width,r.height);const a=await new Promise(l=>r.toBlob(l,"image/png"));return a?new Uint8Array(await a.arrayBuffer()):void 0}catch{return}finally{URL.revokeObjectURL(i)}}export{eo as $,cu as A,$i as At,io as B,hi as Bt,ms as C,et as Ct,cs as D,ze as Dt,ls as E,Vl as Et,ts as F,Ut as Ft,Yc as G,_c as H,Fe as Ht,nu as I,Ol as It,He as J,Qi as K,_e as L,Al as Lt,is as M,Mi as Mt,ns as N,Re as Nt,as as O,_l as Ot,su as P,Wn as Pt,Rc as Q,Yt as R,Pl as Rt,ku as S,Jl as St,gu as T,Yl as Tt,Hc as U,si as Ut,Xc as V,jn as Vt,Vc as W,Wt,zc as X,Zi as Y,ue as Z,Ys as _,yc as _t,Er as a,Ec as at,Gs as b,Di as bt,$r as c,Tc as ct,kr as d,Sc as dt,no as et,xr as f,Mc as ft,Zs as g,qi as gt,hr as h,_i as ht,$o as i,Pc as it,lu as j,qn as jt,Ve as k,Hl as kt,Mo as l,Cc as lt,dr as m,kc as mt,Up as n,ce as nt,Pr as o,Zn as ot,br as p,vc as pt,Kc as q,Gp as r,Ki as rt,Cr as s,Vi as st,Hp as t,Qn as tt,Mr as u,$c as ut,Zd as v,zi as vt,wu as w,We as wt,xs as x,Ri as xt,an as y,Bi as yt,tu as z,pi as zt};
|