@pptx-editor.dev/pro 0.4.0 → 0.5.1-canary.20261116033339.sha-dc95409

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 CHANGED
@@ -27,7 +27,7 @@ Commercial capabilities for PPTX Editor, delivered as `EditorModule`s, in the sa
27
27
  - **Status:** `statusSnapshot()` and `subscribeStatus()` report the state and a typed `CollaborationFailureCode`, as in DOCX Editor. Call `setConnected()` from your provider's status event.
28
28
  - **Concurrent edits:** two peers that add or replace an element that a slide, shape, or paragraph holds once end with one element, and the other peer's copy stays hidden in the room until the winner undoes. Property elements merge. Concurrent splits of one run keep its text once, and a node moved into content that a peer removes at once goes back. The `collaboration.realtime` row in `docs/site/data/pptx-features.ts` states what is supported and its limits. A room from a pre-release build (room format 1) refuses to attach.
29
29
  - **Presence:** with a Yjs `awareness` (`y-protocols/awareness`), the editor publishes its selection, and the canvas shows each peer's selected shapes and text caret, with the peer's name and color. Your caret stays on its character while peers type before it.
30
- - `drawingModule()` from `@pptx-editor.dev/pro/drawing`: paints the shape and picture effects glow, inner shadow, reflection, soft edge, and blur (ECMA-376 Part 1, 20.1.8), and 3-D shapes: bevels, contours, extrusion, and camera rotation (20.1.5). The free engine paints outer and preset shadows. Without the module, a shape or picture paints without these effects, and the editor chrome does not offer them: Shape Effects shows only the outer shadows, and Picture Styles shows only the frame styles. Removing an effect needs no module: when the selection has a reflection, glow, soft edge, bevel, or turned camera, Shape Effects offers its No row, and No shadow also removes an inner shadow. The effect commands still write every effect, and save keeps it. PDF export (`@pptx-editor.dev/pptx-to-pdf`) always includes the module. It also draws charts from the values cached in their chart parts (ECMA-376 Part 1, 21.2); see [Charts](#charts).
30
+ - `drawingModule()` from `@pptx-editor.dev/pro/drawing`: paints the shape, picture, and group effects glow, inner shadow, reflection, soft edge, and blur (ECMA-376 Part 1, 20.1.8), and 3-D shapes: bevels, contours, extrusion, and camera rotation (20.1.5). The free engine paints outer and preset shadows. Without the module, a shape or picture paints without these effects, and the editor chrome does not offer them: Shape Effects shows only the outer shadows, and Picture Styles shows only the frame styles. Removing an effect needs no module: when the selection has a reflection, glow, soft edge, bevel, or turned camera, Shape Effects offers its No row, and No shadow also removes an inner shadow. The effect commands still write every effect, and save keeps it. PDF export (`@pptx-editor.dev/pptx-to-pdf`) always includes the module. It also draws charts from the values cached in their chart parts (ECMA-376 Part 1, 21.2); see [Charts](#charts).
31
31
 
32
32
  This package uses the EigenPal Pro License (`LICENSE.md`). Evaluation is permitted. Production use requires a commercial agreement.
33
33
 
package/dist/drawing.d.ts CHANGED
@@ -35,6 +35,13 @@ interface SpreadBlur {
35
35
  * @internal
36
36
  */
37
37
  declare function glowSpread(rad: number): SpreadBlur;
38
+ /**
39
+ * A soft edge of radius `rad`: the outline shrinks by 0.84 `rad` and blurs with a radius of
40
+ * `rad`, so the alpha rises from 0 on the outline to 1 at about 1.84 `rad` inside it.
41
+ *
42
+ * @internal
43
+ */
44
+ declare function softEdgeSpread(rad: number): SpreadBlur;
38
45
  /**
39
46
  * How far an inner shadow moves the shape's inverse, in slide space (ECMA-376 Part 1, 20.1.8,
40
47
  * CT_InnerShadowEffect: `dist` at `dir`). The shadow shows on the side that `dir` points to: in
@@ -79,6 +86,17 @@ interface ReflectionFade {
79
86
  */
80
87
  declare function reflectionFade(ref: NonNullable<ResolvedEffects['reflection']>, shape: Matrix, w: number, h: number): ReflectionFade;
81
88
 
89
+ /**
90
+ * The most a glow grows, or a soft edge shrinks, the outline: 100 pt, in EMU. The browser's
91
+ * `feMorphology` costs time in proportion to its radius on every paint, so a radius of a few
92
+ * inches stops the page for seconds. Glows of up to 200 pt and soft edges of up to 100 pt draw
93
+ * as stored. A larger glow draws as a 200 pt glow, and a larger soft edge shrinks the outline
94
+ * by 100 pt and keeps its blur.
95
+ *
96
+ * @internal
97
+ */
98
+ declare const MAX_MORPH_SPREAD = 1270000;
99
+
82
100
  /**
83
101
  * `@pptx-editor.dev/pro/drawing`: advanced drawing rendering.
84
102
  *
@@ -138,5 +156,5 @@ declare function installDrawing(options?: ProLicenseOptions): void;
138
156
  */
139
157
  declare function drawingModule(options?: ProLicenseOptions): EditorModule;
140
158
 
141
- export { ProLicenseOptions, drawingModule, glowSpread, innerShadowShift, installDrawing, reflectionBlurSigma, reflectionFade };
159
+ export { MAX_MORPH_SPREAD, ProLicenseOptions, drawingModule, glowSpread, innerShadowShift, installDrawing, reflectionBlurSigma, reflectionFade, softEdgeSpread };
142
160
  export type { ReflectionFade, SpreadBlur };
package/dist/drawing.js CHANGED
@@ -3,5 +3,5 @@ Copyright (c) 2026 Eigenpal, Inc. All rights reserved.
3
3
  Licensed under the EigenPal Pro Evaluation License 1.0. See LICENSE.md in this package.
4
4
  Production use requires a commercial agreement: licensing@eigenpal.com
5
5
  */
6
- import{a as Zt}from"./chunk-HCD7IVOL.js";import{installDrawingRenderers as Wl}from"@pptx-editor.dev/core/layout";import{resolveThemeFont as wr}from"@pptx-editor.dev/core/cascade";import{isValidXmlText as Rr}from"@pptx-editor.dev/core/store";import{resolveColor as Lr}from"@pptx-editor.dev/core/cascade";import{NS as Ze}from"@pptx-editor.dev/core/store";var en=Ze.c,me=Ze.a;function ee(e){return e?.type==="element"}function q(e,t){for(let n of e)if(n.type==="element"&&n.ns===t.namespaceUri&&n.local===t.localName)return n;return null}function Y(e,t){for(let n of e)if(n.local===t&&n.ns==="")return n.value}var vr=20116800;function tn(e){if(e===void 0||!/^-?\d{1,15}$/.test(e))return null;let t=Number(e);return Number.isFinite(t)?Math.min(Math.max(t,0),vr):null}function Tr(e){let t=n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0");return{hex:`${t(e.r)}${t(e.g)}${t(e.b)}`.toUpperCase(),alpha:e.a}}function xe(e,t){if(!ee(e)||!t)return null;let n=Lr(e,t);return n?Tr(n):null}var Ar=new Set(["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"]);function nn(e,t){let n=e.children.find(o=>o.type==="element"&&o.ns===Ze.a&&Ar.has(o.local));if(!n)return{present:!1,color:null};if(n.local!=="solidFill")return{present:!0,color:null};let r=n.children.find(ee);return{present:!0,color:xe(r,t)}}var Jt=0;function Ct(e,t,n=[]){return Jt+=1,{type:"element",id:`chart-generated-${Jt}`,kind:"generic",ns:Ze.a,local:e,nsDecls:[],attrs:Object.entries(t).map(([r,o])=>({ns:"",local:r,value:o})),children:n}}var Se=me,Ne=512,Ir=128,Nr=16,Or=.952,Dr=.268;function rn(e,t){let n=Y(e.attrs,t);return n==="1"||n==="true"?!0:n==="0"||n==="false"?!1:null}function Mt(e,t){let n=q(e.children,{namespaceUri:Se,localName:t}),r=n?Y(n.attrs,"typeface"):void 0;return r&&r.length<=Ir&&Rr(r)?r:null}function Oe(e,t,n){if(!t)return e;let r=Y(t.attrs,"sz"),o=r&&/^\d{3,6}$/.test(r)?Number(r)/100:null,a=q(t.children,{namespaceUri:Se,localName:"solidFill"})?.children.find(ee),i=a?xe(a,n):null,s=Y(t.attrs,"u");return{sizePt:o!==null&&o>=1&&o<=400?o:e.sizePt,bold:rn(t,"b")??e.bold,italic:rn(t,"i")??e.italic,underline:s===void 0?e.underline:s!=="none",colorHex:i?.hex??e.colorHex,latin:Mt(t,"latin")??e.latin,eastAsian:Mt(t,"ea")??e.eastAsian,complex:Mt(t,"cs")??e.complex}}function Pt(e){if(!e)return null;let t=q(e.children,{namespaceUri:Se,localName:"p"}),n=t?q(t.children,{namespaceUri:Se,localName:"pPr"}):null;return n?q(n.children,{namespaceUri:Se,localName:"defRPr"}):null}function De(e){let t=e?q(e.children,{namespaceUri:Se,localName:"bodyPr"}):null;if(!t)return null;let n=Y(t.attrs,"vert");if(n==="vert")return 90;if(n==="vert270")return-90;let r=Y(t.attrs,"rot");if(r===void 0||!/^-?\d{1,9}$/.test(r))return null;let o=Number(r);return o===-6e7||Math.abs(o)>54e5?null:o/6e4}var pe=null;function on(e,t){let n=pe;pe=e;try{return t()}finally{pe=n}}function Fe(e,t){return wr(e,t)??t.minorFont.latin??"Calibri"}function ln(e,{measurer:t,theme:n}){return t.resolve({family:Fe(e.latin,n),bold:e.bold,italic:e.italic})}function Z(e,t){if(!pe)return 0;let n=e.length>Ne?e.slice(0,Ne):e;if(n==="")return 0;let r=ln(t,pe),o=0;for(let l of pe.measurer.advances(r,n))o+=l;return o*t.sizePt}function an(e){let t=pe?ln(e,pe).metrics:null;return t&&t.ascent>0&&t.descent>=0?t:{ascent:Or,descent:Dr}}function J(e){let{ascent:t,descent:n}=an(e);return e.sizePt*(t+n)}function kt(e){return e.sizePt*an(e).ascent}function Be(e,t){let n=0;for(let r of e)n+=r.length>0?Math.max(...r.map(o=>J(o.style))):J(t);return n}function Je(e){let t=0;for(let n of e)t=Math.max(t,n.reduce((r,o)=>r+Z(o.text,o.style),0));return t}function sn(e){let t=[];for(let n of e){let r=[];for(let o of n){let l=o.text.split(/\r\n|\r|\n/);for(let[a,i]of l.entries())a>0&&(t.push(r),r=[]),i!==""&&r.push({text:i,style:o.style})}t.push(r)}return t.slice(0,Nr)}var Fr=12700,Br=4096,cn=2,be=e=>Math.round(e*Fr);function Ur(e){let t=/^[0-9a-f]{6}$/i.test(e.hex)?Number.parseInt(e.hex,16):0,n=Number.isFinite(e.alpha)?Math.min(1,Math.max(0,e.alpha)):1;return{r:t>>16&255,g:t>>8&255,b:t&255,a:n}}function St(e){return{type:"solid",color:Ur(e)}}function Vr(e,t){return{fill:St(e),width:be(e.widthPt),cap:e.cap==="round"?"rnd":e.cap==="square"?"sq":"flat",join:t??"miter",miterLimit:8,dash:e.dash?"custom":"solid",...e.dash?{dashes:e.dash}:{},compound:"sng"}}var un=e=>e!==null&&/^[0-9a-f]{6}$/i.test(e.hex);function zr(e,t,n){let r=[];for(let o of e.subpaths){for(let[l,a]of o.entries())r.push({op:l===0?"M":"L",x:be(a.x),y:be(a.y)});e.closed&&r.push({op:"Z"})}return{commands:r,fill:t?"norm":"none",stroke:n}}function fn(e,t,n){let r=e.frame;return{nodeId:`${r.nodeId}#chart-${n}:${t}`,partName:r.partName,layer:r.layer,name:"",hidden:!1}}function $r(e,t,n){let r=e.closed&&un(e.fill)?e.fill:null,o=e.stroke&&un(e.stroke)?e.stroke:null;if(!r&&!o)return null;let{cx:l,cy:a}=n.frame.xfrm;return{...fn(n,t,"shape"),kind:"shape",xfrm:{x:0,y:0,cx:l,cy:a,rot:0,flipH:!1,flipV:!1},geometry:{kind:"paths",paths:[zr(e,!!r,!!o)]},fill:r?St(r):{type:"none"},...o?{line:Vr(o,e.join)}:{}}}var Hr={lIns:0,tIns:0,rIns:0,bIns:0,anchor:"ctr",anchorCtr:!1,wrap:"square",vert:"horz",rot:0,upright:!1,numCol:1,spcCol:0,autofit:{kind:"none"},spcFirstLastPara:!1};function dn(e,t){let n=e.style,r=n.latin.startsWith("+mj")?"major":n.latin.startsWith("+mn")?"minor":void 0,o=Fe(n.latin,t);return{size:Math.round(n.sizePt*100),bold:n.bold,italic:n.italic,underline:n.underline?"sng":"none",strike:"noStrike",caps:"none",spacing:0,baseline:0,latin:o,...r?{latinTheme:r}:{},ea:n.eastAsian?Fe(n.eastAsian,t):o,cs:n.complex?Fe(n.complex,t):o,fill:St({hex:n.colorHex,alpha:1})}}function Gr(e,t,n,r){let o=e.filter(a=>a.text!==""),l=o.reduce((a,i)=>i.style.sizePt<a.style.sizePt?i:a);return{nodeId:`${n}:p`,level:0,align:t,marL:0,marR:0,indent:0,lineSpacing:{pct:1},spaceBefore:{pts:0},spaceAfter:{pts:0},bullet:null,defaultTab:914400,tabs:[],rtl:!1,eaLineBreak:!0,latinLineBreak:!1,hangingPunct:!1,runs:o.map((a,i)=>({kind:"text",nodeId:`${n}:r${i}`,text:a.text.length>Ne?a.text.slice(0,Ne):a.text,props:dn(a,r)})),endProps:dn(l,r)}}function Wr(e,t,n){let r=`${n.frame.nodeId}#chart-label:${t}`,o=[];for(let[s,c]of sn(e.paragraphs).entries())c.some(u=>u.text!=="")&&o.push(Gr(c,e.align,`${r}:${s}`,n.theme));if(o.length===0)return null;let l=e.align==="l"?0:cn,a=e.align==="r"?0:cn,i=(e.rotation%360+360)%360;return{...fn(n,t,"label"),kind:"shape",xfrm:{x:be(e.x-l),y:be(e.y),cx:Math.max(1,be(e.width+l+a)),cy:Math.max(1,be(e.height)),rot:Number.isFinite(i)?i:0,flipH:!1,flipV:!1},geometry:{kind:"preset",preset:"rect",adjust:new Map},fill:{type:"none"},text:{body:Hr,paragraphs:o}}}function hn(e,t,n,r){if(t.length>Br)return null;let o={frame:n,theme:r},l=[];for(let[a,i]of e.entries()){let s=$r(i,a,o);s&&l.push(s)}for(let[a,i]of t.entries()){let s=Wr(i,a,o);s&&l.push(s)}return l}var Lt=en,Xr=8,_t=255,nt=4096,jr=32768,mn=1024,yn=new Map([["barChart",{kind:"bar",threeD:!1}],["bar3DChart",{kind:"bar",threeD:!0}],["lineChart",{kind:"line",threeD:!1}],["line3DChart",{kind:"line",threeD:!0}],["areaChart",{kind:"area",threeD:!1}],["area3DChart",{kind:"area",threeD:!0}],["pieChart",{kind:"pie",threeD:!1}],["pie3DChart",{kind:"pie",threeD:!0}],["doughnutChart",{kind:"doughnut",threeD:!1}],["scatterChart",{kind:"scatter",threeD:!1}],["radarChart",{kind:"radar",threeD:!1}],["bubbleChart",{kind:"bubble",threeD:!1}],["stockChart",{kind:"line",threeD:!1}],["ofPieChart",{kind:"ofPie",threeD:!1}],["surfaceChart",{kind:"surface",threeD:!1}],["surface3DChart",{kind:"surface",threeD:!0}]]);function E(e,t){return e?q(e.children,{namespaceUri:Lt,localName:t}):null}function oe(e,t){let n=[];for(let r of e?.children??[])ee(r)&&r.ns===Lt&&r.local===t&&n.push(r);return n}function $(e,t){let n=E(e,t);return n?Y(n.attrs,"val"):void 0}function re(e,t,n){let r=E(e,t);if(!r)return n;let o=Y(r.attrs,"val");return o===void 0?!0:o==="1"||o==="true"}function K(e,t,n,r){let o=$(e,t);if(o===void 0||o.length>40)return null;let l=Number(o);return Number.isFinite(l)&&l>=n&&l<=r?l:null}function Et(e){let t="";for(let n of e?.children??[])n.type==="text"&&(t+=n.value);return t.length>mn?t.slice(0,mn):t}function xn(e,t){let n=$(e,"ptCount")?.trim(),r=K(e,"ptCount",0,nt);return E(e,"ptCount")&&(!n||!/^\+?\d+$/.test(n)||r===null)?(t.remaining=-1,null):r}function tt(e,t){if(!e)return null;let n=xn(e,t);if(t.remaining<0)return null;let r=oe(e,"pt"),o=n??0,l=[];for(let i of r){let s=Y(i.attrs,"idx"),c=s!==void 0&&/^\d{1,6}$/.test(s)?Number(s):-1;if(c<0||c>=nt||n!==null&&c>=n)return t.remaining=-1,null;l.push([c,Et(E(i,"v"))]),n===null&&(o=Math.max(o,c+1))}if(o>nt||(t.remaining-=o,t.remaining<0))return null;let a=Array.from({length:o},()=>null);for(let[i,s]of l)a[i]=s;return a}function et(e,t){let n={text:null,numbers:null,formatCode:null};if(!e)return n;let r=E(e,"numRef"),o=E(r,"numCache")??E(e,"numLit");if(o){let c=tt(o,t),u=Et(E(o,"formatCode"))||null;return{text:c,numbers:c?.map(f=>bn(f))??null,formatCode:u}}let l=E(e,"strRef"),a=E(l,"strCache")??E(e,"strLit");if(a)return{text:tt(a,t),numbers:null,formatCode:null};let i=E(E(e,"multiLvlStrRef"),"multiLvlStrCache");if(i){let c=oe(i,"lvl")[0]??null;if(c){let u=xn(i,t),f=tt(c,t)??[],h=u??f.length;return h<f.length?(t.remaining=-1,n):(t.remaining-=Math.max(0,h-f.length),t.remaining<0?n:{text:Array.from({length:h},(p,y)=>f[y]??null),numbers:null,formatCode:null})}}let s=E(e,"v");return s?{text:[Et(s)],numbers:null,formatCode:null}:n}function bn(e){if(e===null)return null;let t=e.trim();if(t===""||t.length>40)return null;let n=Number(t);return Number.isFinite(n)?n:null}function Kr(e){return e?{symbol:$(e,"symbol")??null,size:K(e,"size",2,72),spPr:E(e,"spPr")}:null}function Yr(e,t,n){let r=et(E(e,"tx"),n).text?.[0]??null,o=t==="scatter"||t==="bubble",l=et(E(e,o?"xVal":"cat"),n),a=et(E(e,o?"yVal":"val"),n);if(n.remaining<0)return null;let i=new Map;for(let s of oe(e,"dPt")){let c=K(s,"idx",0,nt-1);c!==null&&i.set(c,s)}return{index:K(e,"idx",0,2**31)??0,order:K(e,"order",0,2**31)??0,name:r,categories:o?null:l.text,categoryNumbers:o?null:l.numbers,categoryFormat:l.formatCode,xValues:o?l.numbers:null,values:a.numbers??(a.text??[]).map(bn),formatCode:a.formatCode,spPr:E(e,"spPr"),marker:Kr(E(e,"marker")),dLbls:E(e,"dLbls"),points:i,smooth:re(e,"smooth",!1),explosion:K(e,"explosion",0,400)??0,invertIfNegative:re(e,"invertIfNegative",!1),bubbleSizes:t==="bubble"?et(E(e,"bubbleSize"),n).numbers??null:null,trendlines:oe(e,"trendline").slice(0,8),errorBars:oe(e,"errBars").slice(0,2),labelRange:tt(Qr(e),n)}}function pn(e,t){for(let n of e?.children??[])if(ee(n)&&n.local===t)return n;return null}function Qr(e){for(let t of oe(E(e,"extLst"),"ext")){let n=pn(pn(t,"datalabelsRange"),"dlblRangeCache");if(n)return n}return null}var qr=new Set(["clustered","stacked","percentStacked","standard"]);function Zr(e,t){let n=yn.get(e.local);if(!n)return null;let r=[];for(let a of oe(e,"ser")){if(r.length>=_t)return null;let i=Yr(a,n.kind,t);if(!i||t.remaining<0)return null;r.push(i)}r.sort((a,i)=>a.order-i.order);let o=$(e,"grouping"),l=n.kind;return{kind:l,threeD:n.threeD,element:e,horizontal:l==="bar"&&$(e,"barDir")==="bar",grouping:o&&qr.has(o)?o:l==="bar"?"clustered":"standard",varyColors:re(e,"varyColors",l==="pie"||l==="doughnut"),gapWidth:K(e,"gapWidth",0,500)??150,overlap:K(e,"overlap",-100,100)??0,gapDepth:K(e,"gapDepth",0,500)??150,series:r,axisIds:oe(e,"axId").map(a=>Y(a.attrs,"val")??""),dLbls:E(e,"dLbls"),firstSliceAngle:K(e,"firstSliceAng",0,360)??0,holeSize:K(e,"holeSize",1,90)??50,markers:re(e,"marker",!0),scatterStyle:$(e,"scatterStyle")??null,radarStyle:$(e,"radarStyle")??null,hiLowLines:E(e,"hiLowLines"),upDownBars:E(e,"upDownBars"),bubbleScale:K(e,"bubbleScale",0,300)??100,bubbleArea:$(e,"sizeRepresents")!=="w",ofPie:l==="ofPie"?{type:$(e,"ofPieType")==="bar"?"bar":"pie",splitType:$(e,"splitType")??"auto",splitPos:K(e,"splitPos",-1e300,1e300),secondSize:K(e,"secondPieSize",5,200)??75,serLines:E(e,"serLines")}:null,wireframe:l==="surface"&&re(e,"wireframe",!1),bandFormats:l==="surface"?Jr(e):new Map}}function Jr(e){let t=new Map;for(let n of oe(E(e,"bandFmts"),"bandFmt").slice(0,_t)){let r=K(n,"idx",0,_t),o=E(n,"spPr");r!==null&&o&&t.set(r,o)}return t}var eo=new Set(["b","t","l","r"]);function to(e){let t=e.local==="catAx"?"category":e.local==="valAx"?"value":e.local==="dateAx"?"date":e.local==="serAx"?"series":null;if(!t)return null;let n=$(e,"axId");if(!n)return null;let r=E(e,"scaling"),o=E(e,"numFmt"),l=$(e,"axPos"),a=K(e,"crossesAt",-1e300,1e300),i=$(e,"crosses"),s=$(e,"majorTickMark"),c=$(e,"minorTickMark"),u=$(e,"tickLblPos"),f=$(e,"crossBetween"),h=$(e,"baseTimeUnit");return{id:n,kind:t,element:e,deleted:re(e,"delete",!1),position:l&&eo.has(l)?l:"b",crossAxisId:$(e,"crossAx")??null,reversed:$(r,"orientation")==="maxMin",min:K(r,"min",-1e300,1e300),max:K(r,"max",-1e300,1e300),majorUnit:K(e,"majorUnit",1e-300,1e300),minorUnit:K(e,"minorUnit",1e-300,1e300),logBase:K(r,"logBase",2,1e3),formatCode:o?Y(o.attrs,"formatCode")??null:null,sourceLinked:o?Y(o.attrs,"sourceLinked")==="1":!0,majorGridlines:E(e,"majorGridlines"),minorGridlines:E(e,"minorGridlines"),majorTickMark:s==="none"||s==="in"||s==="out"||s==="cross"?s:"cross",minorTickMark:c==="none"||c==="in"||c==="out"||c==="cross"?c:"cross",tickLabelPosition:u==="low"||u==="high"||u==="none"?u:"nextTo",spPr:E(e,"spPr"),txPr:E(e,"txPr"),title:E(e,"title"),crosses:a!==null?a:i==="min"||i==="max"?i:"autoZero",crossBetween:f==="between"||f==="midCat"?f:null,tickLabelSkip:K(e,"tickLblSkip",1,32e3),baseTimeUnit:h==="days"||h==="months"||h==="years"?h:null}}function rt(e){let t=E(e,"manualLayout");if(!t)return null;let n=i=>K(t,i,-10,10),r=n("x"),o=n("y"),l=n("w"),a=n("h");return r===null||o===null||$(t,"xMode")==="factor"||$(t,"yMode")==="factor"?null:{inner:$(t,"layoutTarget")!=="outer",x:r,y:o,w:l??0,h:a??0}}function no(e){if(!e)return null;let t=$(e,"legendPos"),n=new Set;for(let r of oe(e,"legendEntry")){let o=K(r,"idx",0,1e5);o!==null&&re(r,"delete",!1)&&n.add(o)}return{element:e,position:t==="b"||t==="t"||t==="l"||t==="tr"?t:"r",overlay:re(e,"overlay",!1),txPr:E(e,"txPr"),spPr:E(e,"spPr"),layout:rt(E(e,"layout")),deleted:n}}function ro(e){let t=K(e,"style",1,48);if(t!==null)return t;for(let n of e.children)if(!(!ee(n)||n.local!=="AlternateContent"))for(let r of n.children){if(!ee(r)||r.local!=="Fallback")continue;let o=K(r,"style",1,48);if(o!==null)return o}return 2}function gn(e){let t=E(e,"chart"),n=E(t,"plotArea");if(!t||!n)return null;let r={remaining:jr},o=[],l=new Map;for(let a of n.children){if(!ee(a)||a.ns!==Lt)continue;if(yn.has(a.local)){if(o.length>=Xr)return null;let s=Zr(a,r);if(!s)return null;o.push(s);continue}let i=to(a);i&&l.set(i.id,i)}return o.length===0?null:{chartSpace:e,date1904:re(e,"date1904",!1),style:ro(e),roundedCorners:re(e,"roundedCorners",!0),spPr:E(e,"spPr"),txPr:E(e,"txPr"),title:E(t,"title"),autoTitleDeleted:re(t,"autoTitleDeleted",!1),plotSpPr:E(n,"spPr"),plotLayout:rt(E(n,"layout")),plots:o,axes:l,legend:no(E(t,"legend")),view3D:E(t,"view3D"),floor:E(t,"floor"),sideWall:E(t,"sideWall"),backWall:E(t,"backWall")}}var vt=["January","February","March","April","May","June","July","August","September","October","November","December"],Cn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Tt(e){if(!Number.isFinite(e))return"";if(e===0)return"0";let t=Math.abs(e);if(t>=1e11||t<1e-9){let[o,l]=e.toExponential(5).split("e"),a=o.replace(/\.?0+$/,""),i=Number(l);return`${a}E${i<0?"-":"+"}${String(Math.abs(i)).padStart(2,"0")}`}let n=Math.max(0,10-Math.max(1,Math.floor(Math.log10(t))+1)),r=e.toFixed(Math.min(n,20));return r.includes(".")?r.replace(/\.?0+$/,""):r}function Mn(e){let t=[],n="",r=!1,o=!1;for(let l=0;l<e.length;l+=1){let a=e[l];if(a==="\\"&&!r&&l+1<e.length){n+=a+e[l+1],l+=1;continue}if(a==='"'?r=!r:!r&&a==="["?o=!0:!r&&a==="]"&&(o=!1),a===";"&&!r&&!o){t.push(n),n="";continue}n+=a}return t.push(n),t}function Pn(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(r==='"'){let o=e.indexOf('"',n+1),l=o===-1?e.length:o;t.push({kind:"literal",text:e.slice(n+1,l)}),n=l}else if(r==="\\"&&n+1<e.length)t.push({kind:"literal",text:e[n+1]}),n+=1;else if(r==="_"&&n+1<e.length)t.push({kind:"literal",text:" "}),n+=1;else if(r==="*"&&n+1<e.length)n+=1;else if(r==="["){let o=e.indexOf("]",n+1),l=o===-1?e.length:o,a=e.slice(n+1,l);if(/^(?:h+|m+|s+)$/i.test(a))t.push({kind:"code",text:`[${a}]`});else if(a.startsWith("$")){let i=a.indexOf("-");t.push({kind:"literal",text:a.slice(1,i===-1?a.length:i)})}n=l}else"$-+/():!^&'~{}<>= ".includes(r)?t.push({kind:"literal",text:r}):t.push({kind:"code",text:r})}return t}function ot(e){return(e[0]==="["?e[1]:e[0]).toLowerCase()}function kn(e){let t=!1,n="",r=!1;for(let o of e){if(o.kind!=="code")continue;let l=ot(o.text);if(l===".")r=n==="s";else{if(l==="0"&&r)continue;if(l==="0"||l==="#"||l==="?")return!1;r=!1}"ymdhs".includes(l)&&(t=!0),n=l}return t}function oo(e){let t="";for(let n=0;n<e.length;n+=1)n>0&&(e.length-n)%3===0&&(t+=","),t+=e[n];return t}function lo(e,t){let n=t.map(b=>b.kind==="code"?b.text:""),r=n.findIndex(b=>b==="E"||b==="e"),o=b=>b==="0"||b==="#"||b==="?",l=0,a=-1,i=-1,s=-1;for(let b=0;b<n.length&&!(r!==-1&&b>=r);b+=1){let M=n[b];M==="%"&&(l+=1),M==="."&&a===-1&&(a=b),o(M)&&(s===-1&&(s=b),i=b)}if(s===-1)return t.map(b=>b.kind==="literal"?b.text:"").join("");let c=e*100**Math.min(l,3),u=i+1;for(;u<n.length&&n[u]===",";)c/=1e3,u+=1;let f=a===-1?i+1:a,h=!1,p=0;for(let b=s;b<f;b+=1)n[b]===","&&(h=!0),n[b]==="0"&&(p+=1);let y=0,x=0;if(a!==-1)for(let b=a+1;b<=i;b+=1)o(n[b])&&(x+=1,n[b]==="0"&&(y=x));x=Math.min(x,30),y=Math.min(y,x);let m;if(r!==-1){let b=x,[M,v]=Math.abs(c).toExponential(b).split("e"),O=Number(v),T=t[r+1]?.text==="+"||t[r+1]?.text==="-",w=O<0?"-":t[r+1]?.text==="+"?"+":"",S=0;for(let V=r+(T?2:1);V<n.length&&o(n[V]);V+=1)S+=1;m=`${M}E${w}${String(Math.abs(O)).padStart(Math.max(1,S),"0")}`}else{let b=Math.abs(c).toFixed(x),[M,v=""]=b.split(".");for(;v.length>y&&v.endsWith("0");)v=v.slice(0,-1);M==="0"&&p===0&&(M=""),M=M.padStart(p,"0"),h&&(M=oo(M)),m=a===-1?M:`${M}.${v}`}let k="",L="";for(let b=0;b<t.length;b+=1){let M=t[b],v=M.kind==="literal"?M.text:M.text==="%"?"%":"";b<s?k+=v:b>(r!==-1?n.length:i)&&M.text!==","&&(L+=v)}return k+m+L}function ye(e,t){return String(e).padStart(t,"0")}function ao(e,t){if(!Number.isFinite(e)||e<0||e>2958465)return null;let n=t?e+1462:e<61?e+1:e,r=Math.round((n-25569)*864e5);return new Date(r)}function io(e,t,n){let r=ao(Math.abs(e),n);if(!r)return Tt(e);let o=[];for(let i of t){let s=o[o.length-1];s&&s.kind==="code"&&i.kind==="code"&&s.text[0]!=="["&&i.text[0]!=="["&&s.text[0].toLowerCase()===i.text.toLowerCase()?s.text+=i.text:o.push({kind:i.kind,text:i.text})}let l=t.some(i=>i.kind==="code"&&i.text.toLowerCase()==="a"),a="";for(let i=0;i<o.length;i+=1){let s=o[i];if(s.kind==="literal"){a+=s.text;continue}let c=s.text.toLowerCase(),u=ot(s.text),f=s.text.length;if(c[0]==="["){let h=u==="h"?24:u==="m"?1440:86400;a+=ye(Math.floor(Math.abs(e)*h+1e-9),f-2)}else if(u==="0"&&o[i-1]?.text==="."){let h=r.getUTCMilliseconds();a+=ye(Math.floor(h/10**(3-Math.min(f,3))),Math.min(f,3)).padEnd(f,"0")}else if(u==="y")a+=f<=2?ye(r.getUTCFullYear()%100,2):String(r.getUTCFullYear());else if(u==="d")f>=4?a+=Cn[r.getUTCDay()]:f===3?a+=Cn[r.getUTCDay()].slice(0,3):a+=f===2?ye(r.getUTCDate(),2):String(r.getUTCDate());else if(u==="m"){let h=o.slice(0,i).reverse().find(x=>x.kind==="code"),p=o.slice(i+1).find(x=>x.kind==="code");f<=2&&(h&&ot(h.text)==="h"||p&&ot(p.text)==="s")?a+=f===2?ye(r.getUTCMinutes(),2):String(r.getUTCMinutes()):f>=5?a+=vt[r.getUTCMonth()][0]:f===4?a+=vt[r.getUTCMonth()]:f===3?a+=vt[r.getUTCMonth()].slice(0,3):a+=f===2?ye(r.getUTCMonth()+1,2):String(r.getUTCMonth()+1)}else if(u==="h"){let h=r.getUTCHours();l&&(h=h%12===0?12:h%12),a+=f>=2?ye(h,2):String(h)}else if(u==="s")a+=f>=2?ye(r.getUTCSeconds(),2):String(r.getUTCSeconds());else if(u==="a"){let h=r.getUTCHours()>=12,p=o[i+2]?.text.toLowerCase()==="p";for(a+=p?h?"P":"A":h?"PM":"AM";i+1<o.length&&/^[mp/]/i.test(o[i+1].text);)i+=1}else if(u==="e")a+=String(r.getUTCFullYear());else{if(u==="g"||u==="b")continue;a+=s.text}}return a}function ue(e,t,n=!1){if(!Number.isFinite(e))return"";if(!t||t.length>256||/^general$/i.test(t.trim()))return Tt(e);let r=Mn(t),o=r[0],l=e;if(e<0&&r.length>=2?(o=r[1],l=-e):e===0&&r.length>=3&&(o=r[2]),/^general$/i.test(o.trim()))return Tt(l);let a=Pn(o);if(kn(a))return io(e,a,n);let i=lo(l,a),s=/^[^1-9]*$/.test(i);return l<0&&!s?`-${i}`:i}function Sn(e){return!e||e.length>256||/^general$/i.test(e.trim())?!1:kn(Pn(Mn(e)[0]))}function lt(e,t,n){let r=e.categoryNumbers?.[t];return r!=null&&e.categoryFormat?ue(r,e.categoryFormat,n):e.categories?.[t]??null}function Ln(e,t){if(e.logBase!==void 0){if(!(t>0))return 0;let n=Math.log(e.max/e.min)||1;return Math.log(t/e.min)/n}return(t-e.min)/(e.max-e.min||1)}function vn(e,t,n,r,o){let l=f=>Math.log(f)/Math.log(n),a=e>0?e:1,i=t>0?Math.max(t,a):a,s=r!==null&&r>0?r:n**Math.floor(l(a)+1e-9),c=o!==null&&o>0?o:n**Math.ceil(l(i)-1e-9);c>s||(c=s*n);let u=[];for(let f=0;f<=1e3;f+=1){let h=Number((s*n**f).toPrecision(12));if(h>c*(1+1e-9))break;u.push(h)}return{min:s,max:c,major:n,ticks:u,logBase:n}}function _n(e){let t=10**Math.floor(Math.log10(e));return[1,2,5,10,20].map(n=>n*t)}function En(e,t){return Number((Math.round(e/t)*t).toPrecision(12))}function at(e){let t=Number.isFinite(e.dataMin)?e.dataMin:0,n=Number.isFinite(e.dataMax)?e.dataMax:1;t>n&&([t,n]=[n,t]),e.fixedMin!==null&&(t=Math.min(t,e.fixedMin)),e.fixedMax!==null&&(n=Math.max(n,e.fixedMax)),t===n&&(n===0?n=1:n>0?t=0:n=0);let r=t,o=n;e.fixedMin===null&&t>=0&&(r=t>5/6*n?t-(n-t)/2:0),e.fixedMax===null&&n<=0&&(o=n<5/6*t?n+(n-t)/2:0);let l=e.noHeadroom?0:.05*(o-r),a=e.fixedMax??(o>0?o+l:o),i=e.fixedMin??(r<0?r-l:r),s=Math.max(a-i,Number.EPSILON),c=Math.max(1,Math.floor(e.lengthPt/Math.max(1,e.minIntervalPt))),u=e.fixedMajor??0;if(!(u>0)||s/u>1e3){u=0;let y=e.roomOnly===!0||e.fixedMin!==null&&e.fixedMax!==null,x=(e.fixedMax??o)-(e.fixedMin??r);for(let m of _n(s/10)){let k=Math.ceil(a/m-1e-9)-Math.floor(i/m+1e-9),L=e.roomOnly?Math.min(c,10):c;if(k<=L&&(y||x/m<=9.5)){u=m;break}}u===0&&(u=_n(s)[2])}let f=e.fixedMin??En(Math.floor(i/u+1e-9)*u,u),h=e.fixedMax??En(Math.ceil(a/u-1e-9)*u,u);h<=f&&(h=f+u);let p=[];for(let y=0;y<=1e3;y+=1){let x=Number((f+y*u).toPrecision(12));if(x>h+u*1e-9)break;p.push(x)}return{min:f,max:h,major:u,ticks:p}}var so=1,co=1.4;function ge(e,t,n){let r=t.axisIds.map(o=>e.axes.get(o)).filter(o=>o!==void 0);if(t.kind==="scatter"||t.kind==="bubble"){let o=i=>i.position==="b"||i.position==="t",l=r.find(o)??r[0]??null,a=r.find(i=>i!==l)??null;return n==="value"?a:n==="x"?l:null}return n==="value"?r.find(o=>o.kind==="value")??null:r.find(o=>o.kind==="category"||o.kind==="date")??null}function it(e,t,n){let r=0,o=null,l=null,a=null;for(let y of t)for(let x of y.series)r=Math.max(r,x.values.length),!o&&x.categories&&(o=[...x.categories],l=x.categoryNumbers?[...x.categoryNumbers]:null,a=x.categoryFormat);let i=t.length>0?ge(e,t[0],"category"):null;o&&(r=Math.max(r,o.length)),r=Math.min(r,n);let c=(i&&!i.sourceLinked?i.formatCode:null)??a,u=l!==null&&(i?.kind==="date"||i?.kind!=="category"&&Sn(c))&&l.every(y=>y!==null),f=[];for(let y=0;y<r;y+=1){let x=l?.[y];x!=null&&c?f.push(ue(x,c,e.date1904)):f.push(o?.[y]??String(y+1))}let h=t.length>0?ge(e,t[0],"value"):null,p=h?.crossBetween==="midCat"||h?.crossBetween===null&&t.every(y=>y.kind==="area");return{axis:i,count:r,labels:f,serials:u?uo(l.slice(0,r),i,e.date1904):null,between:!p}}function uo(e,t,n){let r=a=>e.map(i=>{let s=n?i+1462:i<61?i+1:i,c=new Date(Math.round((s-25569)*864e5)),u=c.getUTCFullYear();return a==="years"?u:u*12+c.getUTCMonth()}),o=t?.baseTimeUnit??null;if(o==="days")return[...e];if(o!==null)return r(o);let l=new Set(e).size;for(let a of["years","months"]){let i=r(a);if(new Set(i).size===l)return i}return[...e]}function Ue(e,t,n,r){let o=r-n;if(e.serials&&e.serials.length>0){let l=Math.min(...e.serials),a=Math.max(...e.serials),i=Math.max(1,a-l+(e.between?1:0)),s=(e.serials[t]??l)-l+(e.between?.5:0);return n+s/i*o}return e.between?n+(t+.5)/Math.max(1,e.count)*o:e.count<=1?n+o/2:n+t/(e.count-1)*o}function Ve(e,t){if(e.serials&&e.serials.length>1){let n=[...e.serials].sort((i,s)=>i-s),r=1/0;for(let i=1;i<n.length;i+=1){let s=n[i]-n[i-1];s>0&&(r=Math.min(r,s))}let o=n[0],l=n[n.length-1],a=Math.max(1,l-o+1);return Number.isFinite(r)?r/a*t:t/e.count}return t/Math.max(1,e.between?e.count:Math.max(1,e.count-1))}function ze(e,t,n=!1){let r=t.grouping==="stacked"||t.grouping==="percentStacked";if(t.grouping==="percentStacked"&&t.kind!=="scatter"&&t.kind!=="bubble"){e.percent=!0;let o=!1;for(let l of t.series)for(let a of l.values)a!==null&&a<0&&(o=!0);e.dataMin=Math.min(e.dataMin,o?-1:0),e.dataMax=Math.max(e.dataMax,1);return}if(r&&t.kind!=="scatter"&&t.kind!=="bubble"){let o=Math.max(0,...t.series.map(l=>l.values.length));for(let l=0;l<o;l+=1){let a=0,i=0,s=0;for(let c of t.series){let u=c.values[l]??0;t.kind==="bar"?u>=0?a+=u:i+=u:(s+=u,a=Math.max(a,s),i=Math.min(i,s))}e.dataMin=Math.min(e.dataMin,i),e.dataMax=Math.max(e.dataMax,a)}return}for(let o of t.series){let l=n?o.xValues??o.values.map((a,i)=>i+1):o.values;for(let a of l)a===null||!Number.isFinite(a)||(e.dataMin=Math.min(e.dataMin,a),e.dataMax=Math.max(e.dataMax,a))}}function $e(e,t){let n=e.axis;return n&&!n.sourceLinked&&n.formatCode?n.formatCode:e.percent?"0%":t??n?.formatCode??null}function Tn(e,t,n,r,o,l=!1){let a=e.dataMin>e.dataMax,i=a?0:e.dataMin,s=a?1:e.dataMax,c=e.axis,u=e.percent,f=ue(Math.max(Math.abs(i),Math.abs(s)),e.formatCode,o),h=Z(f,r);if(c?.logBase&&!u)return vn(i,s,c.logBase,c.min,c.max);let p=n?(l?co:1.6)*r.sizePt:h+so*r.sizePt,y=Math.floor(t/p)+(u?1:0);return at({dataMin:i,dataMax:s,lengthPt:Math.max(1,y)*p,minIntervalPt:p,fixedMin:c?.min??(u?i<0?-1:0:null),fixedMax:c?.max??(u?1:null),fixedMajor:c?.majorUnit??null,noHeadroom:l,roomOnly:l})}function At(e,t,n,r,o){let l=Ln(e,t);return o?r+(n-r)*l:n+(r-n)*l}var _e=me,fo=16,ho=128,An={sizePt:10,bold:!1,italic:!1,underline:!1,colorHex:"000000",latin:"+mn-lt",eastAsian:"+mn-ea",complex:"+mn-cs"};function wn(e,t,n){let r=n?{...An,themeFaces:n}:An;return Oe(r,Pt(e.txPr),t)}function ae(e,t,n,r={}){return Oe({...e,...r},Pt(t),n)}function Ee(e,t,n,r,o){let l=E(e,"tx"),a=E(l,"rich");if(a){let s=[],c=0;for(let u of a.children){if(!ee(u)||u.ns!==_e||u.local!=="p")continue;if(s.length>=fo)break;let f=q(u.children,{namespaceUri:_e,localName:"pPr"}),h=f?q(f.children,{namespaceUri:_e,localName:"defRPr"}):null,p=Oe(t,h,r),y=[];for(let x of u.children){if(!ee(x)||x.ns!==_e)continue;if(++c>ho)break;if(x.local==="br"){s.push(y),y=[];continue}if(x.local!=="r"&&x.local!=="fld")continue;let m=q(x.children,{namespaceUri:_e,localName:"rPr"}),k=q(x.children,{namespaceUri:_e,localName:"t"}),L="";for(let b of k?.children??[])b.type==="text"&&(L+=b.value);x.local==="fld"&&o&&(L=o(Y(x.attrs,"type"),L)),y.push({text:L,style:Oe(p,m,r)})}s.push(y)}if(s.some(u=>u.some(f=>f.text.trim()!=="")))return s}let i=E(E(l,"strRef"),"strCache");if(i){let s=oe(i,"pt")[0],c="";for(let u of E(s,"v")?.children??[])u.type==="text"&&(c+=u.value);if(c.trim()!=="")return[[{text:c,style:t}]]}return n?[[{text:n,style:t}]]:[]}function mo(e){let t=E(E(e,"layout"),"manualLayout"),n=i=>{let s=$(t,i),c=s!==void 0&&s.length<=32?Number(s):NaN;return Number.isFinite(c)&&Math.abs(c)<=10?c:null},r=n("x"),o=n("y");if(r===null&&o===null)return null;let l=$(t,"xMode")==="edge"&&r!==null,a=$(t,"yMode")==="edge"&&o!==null;return{x:r??0,y:o??0,xEdge:l,yEdge:a}}function wt(e,t){if(re(e,"delete",!1))return null;let n=E(e,"numFmt"),r=n?Y(n.attrs,"sourceLinked")==="1":!0,o=t?.separator??null,l=E(e,"separator");if(l){let a="";for(let i of l.children)i.type==="text"&&(a+=i.value);o=a.slice(0,16)}return{showValue:re(e,"showVal",t?.showValue??!1),showPercent:re(e,"showPercent",t?.showPercent??!1),showCategory:re(e,"showCatName",t?.showCategory??!1),showSeries:re(e,"showSerName",t?.showSeries??!1),separator:o,position:$(e,"dLblPos")??t?.position??null,formatCode:n&&!r?Y(n.attrs,"formatCode")??null:t?.formatCode??null,txPr:E(e,"txPr")??t?.txPr??null,spPr:E(e,"spPr")??t?.spPr??null,custom:null,moved:null}}function Ce(e,t,n){let r=e.dLbls?wt(e.dLbls,null):null,o=t.dLbls?wt(t.dLbls,r):r,l=o;for(let s of oe(t.dLbls,"dLbl")){if($(s,"idx")!==String(n))continue;let c=wt(s,o??r);l=c&&{...c,custom:E(s,"tx")?s:null,moved:mo(s)};break}if(!l||!(l.showValue||l.showPercent||l.showCategory||l.showSeries)&&!l.custom)return null;let i=e.kind==="pie"||e.kind==="doughnut"||e.kind==="ofPie";return l.separator===null?{...l,separator:i?`
7
- `:", "}:l}function st(e,t,n){switch(n){case"VALUE":return ue(t.value,e.formatCode??t.seriesFormat,t.date1904);case"PERCENTAGE":return t.percent===null?"":ue(t.percent,e.formatCode&&e.formatCode.includes("%")?e.formatCode:"0%",t.date1904);case"CATEGORYNAME":return t.category??"";case"SERIESNAME":return t.seriesName??"";case"CELLRANGE":return t.cell??"";default:return null}}function ct(e,t){let n=[];return e.showSeries&&t.seriesName&&n.push(t.seriesName),e.showCategory&&t.category&&n.push(t.category),e.showValue&&n.push(st(e,t,"VALUE")),e.showPercent&&t.percent!==null&&n.push(st(e,t,"PERCENTAGE")),n.join(e.separator??", ")}var ut=class{components=[];points=0;ok=!0;path(t,n,r,o,l){if(!this.ok||!r&&!o)return;for(let s of t)for(let c of s)if(!Number.isFinite(c.x*12700)||!Number.isFinite(c.y*12700)){this.ok=!1;return}if(o&&o.dash&&!n&&!r){this.dashed(t,o,l);return}let a=t.filter(s=>s.length>=2);if(a.length===0)return;for(let s of a)this.points+=s.length;if(this.points>2e5){this.ok=!1;return}let i=o?Math.max(0,o.widthPt):0;this.components.push({subpaths:a,closed:n,fill:n?r:null,stroke:o&&i>0?{...o,widthPt:i}:null,...l?{join:l}:{}})}rect(t,n,r,o,l,a){let i=Math.min(t,t+r),s=Math.min(n,n+o),c=Math.max(t,t+r),u=Math.max(n,n+o);this.path([[{x:i,y:s},{x:c,y:s},{x:c,y:u},{x:i,y:u}]],!0,l,a)}line(t,n,r){n&&this.path([t],!1,null,n,r)}dashed(t,n,r){let o=Math.max(n.widthPt,.5),l=n.cap!=="butt",a=n.dash.map((s,c)=>{let u=s*o;return l?c%2===0?Math.max(.01,u-o):u+o:Math.max(.1,u)}),i=[];for(let s of t){let c=0,u=a[0],f=!0,h=[s[0]];for(let p=1;p<s.length;p+=1){let y=s[p-1],x=s[p],m=Math.hypot(x.x-y.x,x.y-y.y);for(;m>0&&i.length<2e3;){let k=Math.min(u,m),L=k/m,b={x:y.x+(x.x-y.x)*L,y:y.y+(x.y-y.y)*L};f&&h.push(b),m-=k,u-=k,y=b,u<=1e-9&&(f&&h.length>=2&&i.push(h),f=!f,c=(c+1)%a.length,u=a[c],h=[b])}}f&&h.length>=2&&i.push(h)}i.length>0&&this.path(i,!1,null,{...n,dash:null},r)}};function Rt(e,t,n,r,o=24){let l=[];for(let a=0;a<o;a+=1){let i=a/o*Math.PI*2;l.push({x:e+n*Math.cos(i),y:t+r*Math.sin(i)})}return l}function Rn(e,t,n,r,o,l){let a=Math.max(0,l-o);if(!Number.isFinite(a)||a>360+1e-6)throw new RangeError("Chart slice exceeds the angular limit");let i=Math.min(180,Math.max(2,Math.ceil(a/2))),s=(u,f)=>{let h=f*Math.PI/180;return{x:e+u*Math.sin(h),y:t-u*Math.cos(h)}},c=[];for(let u=0;u<=i;u+=1)c.push(s(n,o+a*u/i));if(r>0)for(let u=i;u>=0;u-=1)c.push(s(r,o+a*u/i));else a<360&&c.push({x:e,y:t});return c}function It(e,t=10){if(e.length<3)return[...e];let n=[e[0]];for(let r=0;r<e.length-1;r+=1){let o=e[Math.max(0,r-1)],l=e[r],a=e[r+1],i=e[Math.min(e.length-1,r+2)],s={x:l.x+(a.x-o.x)/6,y:l.y+(a.y-o.y)/6},c={x:a.x-(i.x-l.x)/6,y:a.y-(i.y-l.y)/6};for(let u=1;u<=t;u+=1){let f=u/t,h=1-f;n.push({x:h*h*h*l.x+3*h*h*f*s.x+3*h*f*f*c.x+f*f*f*a.x,y:h*h*h*l.y+3*h*h*f*s.y+3*h*f*f*c.y+f*f*f*a.y})}}return n}function Le(e,t,n,r){let o=r/2;switch(e){case"square":return[[{x:t-o,y:n-o},{x:t+o,y:n-o},{x:t+o,y:n+o},{x:t-o,y:n+o}]];case"diamond":return[[{x:t,y:n-o},{x:t+o,y:n},{x:t,y:n+o},{x:t-o,y:n}]];case"triangle":return[[{x:t,y:n-o},{x:t+o,y:n+o},{x:t-o,y:n+o}]];case"dash":return[[{x:t-o,y:n-r*.1},{x:t+o,y:n-r*.1},{x:t+o,y:n+r*.1},{x:t-o,y:n+r*.1}]];case"dot":return[[{x:t,y:n-r*.12},{x:t+r*.55,y:n-r*.12},{x:t+r*.55,y:n+r*.12},{x:t,y:n+r*.12}]];case"x":case"star":case"plus":return[];default:return[Rt(t,n,o,o,16)]}}function ve(e,t,n,r){let o=r/2,l=[[{x:t-o,y:n-o},{x:t+o,y:n+o}],[{x:t-o,y:n+o},{x:t+o,y:n-o}]],a=[[{x:t-o,y:n},{x:t+o,y:n}],[{x:t,y:n-o},{x:t,y:n+o}]];return e==="x"?l:e==="plus"?a:e==="star"?[...l,a[1]]:[]}var Te=me,po=12700,yo=new Map([["dash",[4,3]],["dashDot",[4,3,1,3]],["dot",[1,3]],["lgDash",[8,3]],["lgDashDot",[8,3,1,3]],["lgDashDotDot",[8,3,1,3,1,3]],["sysDash",[3,1]],["sysDashDot",[3,1,1,1]],["sysDashDotDot",[3,1,1,1,1,1]],["sysDot",[1,1]]]);function xo(e,t){let n=q(e.children,{namespaceUri:Te,localName:"gsLst"}),r=0,o=0,l=0,a=0,i=0;for(let c of n?.children??[]){if(!ee(c)||c.local!=="gs"||i>=16)continue;let u=c.children.find(ee),f=u?xe(u,t):null;f&&(r+=Number.parseInt(f.hex.slice(0,2),16),o+=Number.parseInt(f.hex.slice(2,4),16),l+=Number.parseInt(f.hex.slice(4,6),16),a+=f.alpha,i+=1)}return i===0?null:{hex:[r,o,l].map(c=>Math.round(c/i).toString(16).padStart(2,"0")).join("").toUpperCase(),alpha:a/i}}function In(e,t){let n=nn(e,t);if(!n.present)return;if(n.color)return n.color;let r=q(e.children,{namespaceUri:Te,localName:"gradFill"});if(r)return xo(r,t);let o=q(e.children,{namespaceUri:Te,localName:"pattFill"});if(o){let a=q(o.children,{namespaceUri:Te,localName:"fgClr"})?.children.find(ee);return a?xe(a,t):null}return null}function ne(e,t){if(!e)return{fill:void 0,line:void 0};let n=In(e,t),r=q(e.children,{namespaceUri:Te,localName:"ln"});if(!r)return{fill:n,line:void 0};let o=In(r,t),l=tn(Y(r.attrs,"w")),a=Y(r.attrs,"cap"),i=q(r.children,{namespaceUri:Te,localName:"prstDash"}),s=i?Y(i.attrs,"val"):void 0;return o===null?{fill:n,line:null}:{fill:n,line:o===void 0&&l===null&&s===void 0?void 0:{hex:o?.hex??"",alpha:o?.alpha??1,widthPt:l!==null?l/po:.75,cap:a==="rnd"?"round":a==="sq"?"square":"butt",dash:s?yo.get(s)??null:null}}}function ce(e,t){return e===null?null:e===void 0?t:e.hex!==""?e:t?{...e,hex:t.hex,alpha:t.alpha}:null}var Nn=[[],[["lumMod",6e4],["lumOff",4e4]],[["lumMod",6e4]],[["lumMod",8e4],["lumOff",2e4]],[["lumMod",8e4]],[["lumMod",5e4]],[["lumMod",7e4],["lumOff",3e4]],[["lumMod",7e4]],[["lumMod",5e4],["lumOff",5e4]]];function dt(e,t,n){let r=Ct("schemeClr",{val:e},t.map(([o,l])=>Ct(o,{val:String(l)})));return xe(r,n)}function On(e,t,n,r){let o=(e-1)%8|0,l;if(o===1){let a=t%6+1,i=Nn[Math.floor(t/6)%Nn.length];l=dt(`accent${a}`,i,r)}else{let a=o===0?"tx1":`accent${o-1}`,i=n>1?t/(n-1):.5,s=Math.round((n>1?.6+i*.8:1)*1e5),c=o===0?[["lumMod",Math.round((.2+i*.6)*1e5)],["lumOff",Math.round((.35+i*.4)*1e5)]]:s<=1e5?[["shade",s]]:[["tint",2e5-s]];l=dt(a,c,r)}return l??{hex:"4472C4",alpha:1}}var Dn=["diamond","square","triangle","x","star","circle","plus","dot","dash"];function ft(e){return e.kind==="line"||e.kind==="scatter"||e.kind==="radar"&&e.radarStyle!=="filled"}function Me(e){return e.varyColors?e.kind==="pie"||e.kind==="doughnut"||e.kind==="ofPie"?!0:e.kind==="bar"&&e.series.length===1:!1}function bo(e,t,n,r,o){if(!ft(e))return null;let l=t.marker,a=e.kind==="scatter"&&(e.scatterStyle==="line"||e.scatterStyle==="smooth");if(l?.symbol==="none")return null;let i=e.kind==="line"?e.markers:e.kind==="radar"?e.radarStyle==="marker":!a;if(!l?.symbol&&!i)return null;let s=l?.symbol??Dn[o%Dn.length],c=ne(l?.spPr??null,r.colors),u=c.fill===void 0?n:c.fill,f=ce(c.line,{...n,widthPt:.75,cap:"round",dash:null});return{symbol:s,size:l?.size??(l?.symbol?5:7),fill:u,line:f}}function de(e,t,n,r){let o=r!==void 0&&Me(e),l=o?r.index:t.index,a=o?r.count:n.seriesCount,i=On(n.model.style,l,a,n.colors),s=ne(t.spPr,n.colors),c=r?t.points.get(r.index):void 0,u=c?ne(E(c,"spPr"),n.colors):{fill:void 0,line:void 0},f=o?void 0:s.fill,h=ft(e),p=h?{...i,widthPt:2.25,cap:"round",dash:null}:null,y=h?null:u.fill!==void 0?u.fill:f!==void 0?f:i,x=ce(u.line!==void 0?u.line:s.line,p??(y?{...y,widthPt:.75,cap:"butt",dash:null}:null)),m=h||u.line!==void 0||s.line!==void 0?x:null,k=(h?m??null:y)??i;return{fill:y,line:m,marker:bo(e,t,{hex:k.hex,alpha:k.alpha},n,l)}}var go=me,Co=12700,Mo=.2,Po=3,ko=16;function Bn(e,t){for(let n of[E(E(e.custom,"tx"),"rich"),e.txPr]){let r=n?q(n.children,{namespaceUri:go,localName:"bodyPr"}):null,o=r?Y(r.attrs,t):void 0;if(o!==void 0)return o}}function Fn(e,t){let n=Bn(e,t);return n!==void 0&&/^\d{1,8}$/.test(n)?Number(n)/Co:Po}function So(e,t){return t===null||!(t>0)||Bn(e,"wrap")==="none"?null:t*Mo-Fn(e,"lIns")-Fn(e,"rIns")}function _o(e){let t=[];for(let n of e){let r=[];for(let o of n)for(let[l,a]of o.text.split(/\r\n|\r|\n/).entries())l>0&&(t.push(r),r=[]),a!==""&&r.push({text:a,style:o.style});t.push(r)}return t.slice(0,ko)}function Eo(e,t){let n=[];for(let s of e)for(let c of s.text.match(/\S+|\s+/g)??[]){let u=Z(c,s.style);/^\s/.test(c)?n.length>0&&(n[n.length-1].space+=u):n.push({width:u,space:0})}if(n.length===0)return{count:1,widest:0,word:0};let r=1,o=0,l=0,a=0,i=0;for(let s of n)i=Math.max(i,s.width),l>0&&t!==null&&l+a+s.width>t?(o=Math.max(o,l),r+=1,l=s.width):l+=a+s.width,a=s.space;return{count:r,widest:Math.max(o,l),word:i}}function Ae(e,t,n,r,o){let l=ct(e,t),a=e.custom?Ee(e.custom,n,l,o,(p,y)=>st(e,t,p)??y):[[{text:l,style:n}]],i=So(e,r),s=0,c=0,u=!1,f=0;for(let p of _o(a)){let y=Eo(p,i);s=Math.max(s,y.widest),f=Math.max(f,y.word),u||=y.count>1;let x=Math.max(J(n),...p.map(m=>J(m.style)));c+=y.count*x}let h=i!==null&&u?Math.max(i,f):s*1.3+n.sizePt*2;return{paragraphs:a,width:s,height:c,frame:h}}function ht(e,t,n,r,o,l){if(!e||!t)return{x:n,y:r,moved:!1};let a=t.r-t.l,i=t.b-t.t;return{x:e.xEdge?t.l+e.x*a+o/2:n+e.x*a,y:e.yEdge?t.t+e.y*i+l/2:r+e.y*i,moved:!0}}var Lo={hex:"FFFFFF",alpha:1};function zn(e,t,n,r,o,l){let{scene:a}=o,i=o.look,s=r.categories?.count??0,c=e.grouping==="percentStacked",u=e.grouping==="stacked"||c,f=[];if(c)for(let x=0;x<s;x+=1){let m=0;for(let k of e.series)m+=Math.abs(k.values[x]??0);f.push(m||1)}let h=(x,m)=>c?x/f[m]:x,p=(x,m)=>r.horizontal?{x:r.valueAt(t,m),y:r.categoryAt(x)}:{x:r.categoryAt(x),y:r.valueAt(t,m)},y=(x,m,k,L,b)=>{let M=Ce(e,x,m);if(!M)return;let v=ae(o.baseText,M.txPr,i.colors),O=r.categories?.labels[m]??null,T={value:k,percent:c?k/f[m]:null,category:O,seriesName:x.name,seriesFormat:x.formatCode,date1904:o.model.date1904,cell:x.labelRange?.[m]??null};if(!M.custom&&ct(M,T)==="")return;let w=Ae(M,T,v,o.chartWidth,i.colors),S=w.width,V=w.height,H=w.frame,_=.48*v.sizePt,D=L.x,N=L.y;if(b.kind==="bar"){let P=M.position??(u?"ctr":"outEnd"),{start:g,end:A}=b,I=Math.sign(A.x-g.x)||1,C=Math.sign(A.y-g.y)||-1;if(P==="ctr")D=(g.x+A.x)/2,N=(g.y+A.y)/2;else if(r.horizontal)D=P==="inBase"?g.x+I*(_+S/2):P==="inEnd"?A.x-I*(_+S/2):A.x+I*(_+S/2),N=A.y;else{let R=P==="inBase"?g.y+C*(_+V/2):P==="inEnd"?A.y-C*(_+V/2):A.y+C*(_+V/2);D=A.x,N=R}}else{let P=M.position??(e.kind==="area"?"ctr":"r"),g=b.markerHalf+_;P==="r"?D=L.x+g+S/2:P==="l"?D=L.x-g-S/2:P==="t"?N=L.y-g-V/2:P==="b"&&(N=L.y+g+V/2)}let F={l:0,t:0,r:o.chartWidth,b:o.chartHeight},d=ht(M.moved,F,D,N,S,V);l.push({paragraphs:w.paragraphs,align:"ctr",x:d.x-H/2,y:d.y-V/2,width:H,height:V,rotation:0})};if(e.kind==="bar"&&r.categories){let x=r.horizontal?r.plot.b-r.plot.t:r.plot.r-r.plot.l,m=Ve(r.categories,x),k=e.gapWidth/100,L=u?1:e.series.length,b=u?1:e.overlap/100,M=m/(L-(L-1)*b+k),v=[],O=[];for(let[T,w]of e.series.entries()){let S=Me(e),V=de(e,w,i),H=[];for(let _=0;_<Math.min(s,w.values.length);_+=1){let D=w.values[_];if(D==null)continue;let N=h(D,_),F=n,d=N;if(u){let Q=N>=0?v:O;F=Q[_]??0,d=F+N,Q[_]=d}let P=r.categoryAt(_),g=-m/2+k*M/2+(u?0:T*M*(1-b)),A=r.horizontal?P-g:P+g,I=r.horizontal?A-M:A+M,C=r.valueAt(t,F),R=r.valueAt(t,d),U=S||w.points.has(_)?de(e,w,i,{index:_,count:w.values.length}):V,G=w.invertIfNegative&&N<0?Lo:U.fill;r.horizontal?(a.rect(Math.min(C,R),Math.min(A,I),Math.abs(R-C),M,G,U.line),H.push({index:_,start:{x:C,y:(A+I)/2},end:{x:R,y:(A+I)/2},value:D})):(a.rect(Math.min(A,I),Math.min(C,R),M,Math.abs(R-C),G,U.line),H.push({index:_,start:{x:(A+I)/2,y:C},end:{x:(A+I)/2,y:R},value:D}))}for(let _ of H)y(w,_.index,_.value,_.end,{kind:"bar",start:_.start,end:_.end})}return}if((e.kind==="line"||e.kind==="area")&&r.categories){let x=[],m=null;for(let k of e.series){let L=de(e,k,i),b=[],M=[];for(let v=0;v<s;v+=1){let O=k.values[v]??null;if(O===null&&(o.blanks==="zero"||e.kind==="area"||u)&&(O=0),O===null){b.push(null),M.push(0);continue}let T=h(O,v);u&&(T+=x[v]??0,x[v]=T),M.push(O),b.push(p(v,T))}if(e.kind==="area"){let v=b.filter(T=>T!==null),O=m??v.map(T=>r.horizontal?{x:r.valueAt(t,n),y:T.y}:{x:T.x,y:r.valueAt(t,n)});v.length>=2&&a.path([[...v,...[...O].reverse()]],!0,L.fill,L.line),u&&(m=v)}else{let v=[],O=[];for(let T of b){if(T===null){o.blanks!=="span"&&(O.length&&v.push(O),O=[]);continue}O.push(T)}if(O.length&&v.push(O),L.line)for(let T of v)a.line(k.smooth?It(T):T,L.line,"round");Un(b,L.marker,a)}for(let[v,O]of b.entries())O&&y(k,v,M[v],O,{kind:"point",markerHalf:L.marker?L.marker.size/2:0})}e.kind==="line"&&Ao(e,t,r,o);return}if(e.kind==="scatter"&&r.xInfo?.scale)for(let x of e.series){let m=de(e,x,i),k=[];for(let M=0;M<x.values.length;M+=1){let v=x.values[M],O=x.xValues?x.xValues[M]:M+1;if(v==null||O===null||O===void 0){k.push(null);continue}k.push({x:r.valueAt(r.xInfo,O),y:r.valueAt(t,v)})}let L=k.filter(M=>M!==null);if(m.line!==null&&e.scatterStyle!=="marker"&&e.scatterStyle!=="none"&&L.length>=2){let M=x.smooth||e.scatterStyle==="smooth"||e.scatterStyle==="smoothMarker";a.line(M?It(L):L,m.line,"round")}Un(k,m.marker,a);for(let[M,v]of k.entries())v&&y(x,M,x.values[M],v,{kind:"point",markerHalf:m.marker?m.marker.size/2:0})}}function Un(e,t,n){if(!t)return;let r=t.size*.96,o=[],l=[];for(let a of e)if(a){for(let i of Le(t.symbol,a.x,a.y,r))o.push(i);for(let i of ve(t.symbol,a.x,a.y,r))l.push(i)}o.length>0&&n.path(o,!0,t.fill,t.line),l.length>0&&n.path(l,!1,null,t.line)}var Vn={hex:"000000",alpha:1,widthPt:.75,cap:"butt",dash:null},vo={hex:"FFFFFF",alpha:1},To={hex:"000000",alpha:1};function Ao(e,t,n,r){let o=n.categories;if(!o||e.series.length<2)return;let l=r.look.colors,a=(s,c)=>n.horizontal?{x:n.valueAt(t,c),y:n.categoryAt(s)}:{x:n.categoryAt(s),y:n.valueAt(t,c)};if(e.hiLowLines){let s=ce(ne(E(e.hiLowLines,"spPr"),l).line,Vn),c=[];for(let u=0;u<o.count;u+=1){let f=e.series.map(h=>h.values[u]).filter(h=>h!=null);f.length<2||c.push([a(u,Math.min(...f)),a(u,Math.max(...f))])}s&&c.length>0&&r.scene.path(c,!1,null,s)}let i=e.upDownBars;if(i){let s=(Number($(i,"gapWidth")??150)||150)/100,u=Ve(o,n.horizontal?n.plot.b-n.plot.t:n.plot.r-n.plot.l)/(1+s),f=(m,k)=>{let L=ne(E(E(i,m),"spPr"),l);return{fill:L.fill===void 0?k:L.fill,line:ce(L.line,Vn)}},h=f("upBars",vo),p=f("downBars",To),y=e.series[0],x=e.series[e.series.length-1];for(let m=0;m<o.count;m+=1){let k=y.values[m],L=x.values[m];if(k==null||L===null||L===void 0)continue;let b=a(m,k),M=a(m,L),v=L>=k?h:p;n.horizontal?r.scene.rect(Math.min(b.x,M.x),b.y-u/2,Math.abs(M.x-b.x),u,v.fill,v.line):r.scene.rect(b.x-u/2,Math.min(b.y,M.y),u,Math.abs(M.y-b.y),v.fill,v.line)}}}var wo=4096,Ro=3.1,Io=2.3,Dt=5e3,He=.08,$n=.91,we=.64,Nt=4.5,No=7,jn={hex:"000000",alpha:1,widthPt:.5,cap:"butt",dash:null};function le(e){return e==="l"||e==="r"}function Oo(e,t){if(!e)return null;let n=ne(e.spPr,t.look.colors);return ce(n.line,jn)}function Do(e,t){if(!e)return null;let n=ne(E(e,"spPr"),t.look.colors);return ce(n.line,jn)}function Ot(e,t){let n=e.value;return n.scale?n.scale.ticks.map(r=>ue(Math.abs(r)<n.scale.major*1e-9?0:r,n.formatCode,t.date1904)):[]}function Hn(e,t){let n=0;for(let r of e)n=Math.max(n,Z(r,t));return n}function Gn(e,t,n){let r=Z(" ",t),o=1,l=0;for(let a of e.split(/\s+/).slice(0,256)){let i=Z(a,t);l>0&&l+r+i>n?(o+=1,l=i):l+=(l>0?r:0)+i}return o}function Kn(e,t,n){let{model:r}=n,o=d=>d.kind==="scatter"||d.kind==="bubble",l=e.filter(o),a=e.filter(d=>!o(d));if(l.length>0&&a.length>0)return!1;let i=a.some(d=>d.kind==="bar"&&d.horizontal);if(i&&a.some(d=>d.kind!=="bar"||!d.horizontal))return!1;let s=n.look.colors,c=new Map,u=d=>{let P=d?.id??"",g=c.get(P);return g||(g={axis:d,id:P,dataMin:1/0,dataMax:-1/0,percent:!1,scale:null,formatCode:null},c.set(P,g)),g},f=new Map,h=null;for(let d of e){let P=u(ge(r,d,"value"));if(ze(P,d),P.formatCode??=d.series.find(g=>g.formatCode)?.formatCode??null,f.set(d,P),o(d)){let g=ge(r,d,"x");h??={axis:g,id:`x:${g?.id??""}`,dataMin:1/0,dataMax:-1/0,percent:!1,scale:null,formatCode:null},ze(h,d,!0)}}for(let d of c.values())d.formatCode=$e(d,d.formatCode);h&&(h.formatCode=$e(h,null));let p=a.length>0?it(r,a,wo):null,y=[],x=d=>ae(n.baseText,d?.txPr??null,s),m=d=>d!==null&&!d.deleted,k=d=>m(d)&&d.tickLabelPosition!=="none";if(p){let d=p.axis;y.push({axis:d,role:"category",side:i?d?.position==="r"?"r":"l":d?.position==="t"?"t":"b",style:x(d),labelled:k(d),value:null,title:null})}else h&&y.push({axis:h.axis,role:"x",side:h.axis?.position==="t"?"t":"b",style:x(h.axis),labelled:k(h.axis),value:h,title:null});let L=!0;for(let d of c.values()){let P=d.axis,g=i?L?"b":"t":L?"l":"r",A=P?.position??g;y.push({axis:P,role:"value",side:i?A==="t"?"t":"b":A==="r"?"r":"l",style:x(P),labelled:k(P),value:d,title:null}),L=!1}for(let d of y){if(!m(d.axis)||!d.axis.title)continue;let P=ae(n.baseText,E(d.axis.title,"txPr"),s,{bold:!0}),g=Ee(d.axis.title,P,"Axis Title",s);if(g.length===0)continue;let A=E(E(d.axis.title,"tx"),"rich");d.title={paragraphs:g,style:P,rotation:De(A??E(d.axis.title,"txPr"))}}let b=y.find(d=>d.role==="category")??null,M=r.plotLayout,v=y.find(d=>d.role==="value")??null,O=()=>{if(M&&M.inner){let C=n.chartWidth,R=n.chartHeight;return{plot:{l:M.x*C,t:M.y*R,r:(M.x+M.w)*C,b:(M.y+M.h)*R},categoryRotation:0,categorySkip:1,categoryWrap:0}}let d=M&&!M.inner?{l:M.x*n.chartWidth,t:M.y*n.chartHeight,r:(M.x+M.w)*n.chartWidth,b:(M.y+M.h)*n.chartHeight}:{...t};for(let C of y){if(!C.title)continue;let R=Be(C.title.paragraphs,C.title.style)+9;C.side==="l"?d.l+=R:C.side==="r"?d.r-=R:C.side==="t"?d.t+=R:d.b-=R}for(let C of y){if(!C.labelled||!le(C.side))continue;let R=C.value?Ot(C,r):p?.labels??[],U=C.value?ue(C.value.dataMax>-1/0?C.value.dataMax:1,C.value.formatCode,r.date1904):"",G=Hn(R.length?R:[U],C.style)+$n*C.style.sizePt-Nt;C.side==="l"?d.l+=G:d.r-=G}let P=0;for(let C of y){if(!C.labelled||!C.value||!le(C.side))continue;let R=J(C.style)/2+He*C.style.sizePt;P=Math.max(P,R-No)}d.t+=P;let g=0,A=1,I=0;for(let C of y){if(!C.labelled||le(C.side))continue;let R=C.style.sizePt,U=J(C.style)+we*R-Nt;if(C.role==="category"&&p){let G=Ve(p,d.r-d.l),Q=Hn(p.labels,C.style),X=De(C.axis?.txPr??null),te=p.labels.every(z=>z.split(/\s+/).slice(0,256).every(j=>Z(j,C.style)<=G*.98));if(X!==null&&X!==0?g=X:Q>G*.98&&p.count>1&&(te?I=G:g=-45),I>0){let z=Math.max(...p.labels.map(j=>Gn(j,C.style,I)));U+=(z-1)*J(C.style)}if(g!==0){let z=Math.abs(g)*Math.PI/180;U=Q*Math.sin(z)+J(C.style)*Math.cos(z)+we*R-Nt;let j=J(C.style)/Math.sin(z);A=Math.max(1,Math.ceil(j/Math.max(G,1e-6)))}C.axis?.tickLabelSkip&&(A=C.axis.tickLabelSkip),v?.value?.scale&&Wn(C,v.value.scale)&&(U=0)}C.side==="t"?d.t+=U:d.b-=U}for(let C of y){if(!C.labelled||le(C.side)||!C.value)continue;let R=Ot(C,r);R.length>0&&(d.r-=Z(R[R.length-1],C.style)/2)}return{plot:d,categoryRotation:g,categorySkip:A,categoryWrap:I}},T=d=>{for(let P of y){if(!P.value)continue;let g=le(P.side)?d.b-d.t:d.r-d.l;P.value.scale=Tn(P.value,Math.max(1,g),le(P.side),P.style,r.date1904)}},w=O();T(w.plot),w=O(),T(w.plot);let S=w.plot;if(!(S.r-S.l>1)||!(S.b-S.t>1))return!0;let V=b?.axis?.reversed??!1,H=d=>p?i?V?Ue(p,d,S.t,S.b):Ue(p,d,S.b,S.t):V?Ue(p,d,S.r,S.l):Ue(p,d,S.l,S.r):0,_=(d,P)=>{let g=d.scale,A=d.axis?.reversed??!1;return i||d===h?At(g,P,S.l,S.r,A):At(g,P,S.b,S.t,A)},D=(d,P)=>{let g=P?.crosses??"autoZero";if(g==="min")return d.min;if(g==="max")return d.max;let A=typeof g=="number"?g:0;return Math.min(d.max,Math.max(d.min,A))},N=ne(r.plotSpPr,s);n.scene.rect(S.l,S.t,S.r-S.l,S.b-S.t,N.fill??null,N.line??null);for(let d of y)if(!(!d.axis||d.axis.deleted&&!d.axis.majorGridlines))for(let[P,g]of[[d.axis.minorGridlines,!0],[d.axis.majorGridlines,!1]]){let A=Do(P,n);if(!A)continue;let I=[];if(d.value?.scale){let C=d.value.scale;for(let R of Fo(C,g,Xn(C,d.axis))){let U=_(d.value,R);I.push(le(d.side)?[{x:S.l,y:U},{x:S.r,y:U}]:[{x:U,y:S.t},{x:U,y:S.b}])}}else if(p&&!g){let C=p.between?p.count+1:p.count;for(let R=0;R<C;R+=1){let U=p.between?H(R)-(H(1)-H(0))/2:H(R);I.push(le(d.side)?[{x:S.l,y:U},{x:S.r,y:U}]:[{x:U,y:S.t},{x:U,y:S.b}])}}I.length>0&&n.scene.path(I,!1,null,A)}let F=[];for(let d of e){let P=f.get(d);if(!P.scale)continue;let g=D(P.scale,b?.axis??null);zn(d,P,g,{categoryAt:H,valueAt:_,categories:p,horizontal:i,xInfo:h,plot:S},n,F)}for(let d of y){if(!m(d.axis))continue;let P=Oo(d.axis,n);if(!P)continue;let g;if(d.role==="category"||d.role==="x"){let z=v?.value;g=z?.scale?_(z,D(z.scale,d.axis)):le(d.side)?S.l:S.b}else{let j=d.axis.crosses==="max";g=le(d.side)?d.side==="r"||j?S.r:S.l:d.side==="t"||j?S.t:S.b,h?.scale&&d.value!==h&&!i&&(g=_(h,D(h.scale,d.axis)))}let A=le(d.side)?[{x:g,y:S.t},{x:g,y:S.b}]:[{x:S.l,y:g},{x:S.r,y:g}];n.scene.line(A,P);let I=d.axis.majorTickMark,C=d.side==="l"||d.side==="t"?-1:1,R=[];if(d.value?.scale)for(let z of d.value.scale.ticks)R.push(_(d.value,z));else if(p){let z=p.between?p.count+1:p.count;for(let j=0;j<z;j+=1)R.push(p.between?H(j)-(H(1)-H(0))/2:H(j))}let U=(z,j)=>ie=>{let fe=z==="cross"?-j:0,se=z==="in"?-j:j;return le(d.side)?[{x:g+C*fe,y:ie},{x:g+C*se,y:ie}]:[{x:ie,y:g+C*fe},{x:ie,y:g+C*se}]},G=d.axis.minorTickMark,Q=[],X=d.value?.scale,te=X?Xn(X,d.axis):0;if(G!=="none"&&X&&X.logBase===void 0&&te>0){let z=Math.min(Dt,Math.floor((X.max-X.min)/te+1e-9));for(let j=0;j<=z;j+=1)Q.push(_(d.value,X.min+j*te))}else if(G!=="none"&&!X&&p?.between)for(let z=0;z<Math.min(p.count,Dt);z+=1)Q.push(H(z));Q.length>0&&n.scene.path(Q.map(U(G,Io)),!1,null,P),!(I==="none"||R.length===0)&&n.scene.path(R.map(U(I,Ro)),!1,null,P)}for(let d of F)n.labels.push(d);for(let d of y){if(!d.labelled)continue;let P=d.style.sizePt,g=J(d.style),A=$n*P;if(d.value?.scale){let C=Ot(d,r);for(let[R,U]of d.value.scale.ticks.entries()){let G=C[R],X=Z(G,d.style)*1.3+P*2,te=_(d.value,U);if(le(d.side)){let z=d.side==="l";n.labels.push({paragraphs:[[{text:G,style:d.style}]],align:z?"r":"l",x:z?S.l-A-X:S.r+A,y:te-g/2-He*P,width:X,height:g,rotation:0})}else{let z=d.side==="b"?S.b+we*P:S.t-we*P-g;n.labels.push({paragraphs:[[{text:G,style:d.style}]],align:"ctr",x:te-X/2,y:z,width:X,height:g,rotation:0})}}continue}if(!p)continue;let I=v?.value?.scale&&Wn(d,v.value.scale)?_(v.value,D(v.value.scale,d.axis)):null;for(let C=0;C<p.count;C+=w.categorySkip){let R=p.labels[C];if(R==="")continue;let G=Z(R,d.style)*1.3+P*2,Q=H(C);if(le(d.side)){let fe=I??(d.side==="l"?S.l:S.r),se=d.side==="l";n.labels.push({paragraphs:[[{text:R,style:d.style}]],align:se?"r":"l",x:se?fe-A-G:fe+A,y:Q-g/2-He*P,width:G,height:g,rotation:0});continue}let X=I??(d.side==="b"?S.b:S.t),te=d.side==="b"?X+we*P:X-we*P-g;if(w.categoryRotation!==0){let fe=w.categoryRotation*Math.PI/180,se=G/2,ke=Q,Qe=te+g/2,qe=ke-se*Math.cos(fe),Ie=Qe-se*Math.sin(fe);n.labels.push({paragraphs:[[{text:R,style:d.style}]],align:"r",x:qe-se,y:Ie-g/2,width:G,height:g,rotation:w.categoryRotation});continue}let z=w.categoryWrap,j=z>0?Gn(R,d.style,z):1,ie=z>0?z:G;n.labels.push({paragraphs:[[{text:R,style:d.style}]],align:"ctr",x:Q-ie/2,y:d.side==="b"?te:te-(j-1)*g,width:ie,height:g*j,rotation:0})}}for(let d of y){if(!d.title)continue;let P=d.title.style,g=Be(d.title.paragraphs,P),I=Je(d.title.paragraphs)*1.3+P.sizePt*2;if(le(d.side)){let C=d.title.rotation??-90,R=d.side==="l"?t.l+1.5+g/2:t.r-1.5-g/2,U=(S.t+S.b)/2,G=Math.abs(Math.abs(C)-90)<1;n.labels.push({paragraphs:d.title.paragraphs,align:"ctr",x:R-I/2,y:U-g/2,width:I,height:g,rotation:C})}else{let C=d.side==="b"?t.b-1.4-g:t.t+1.5;n.labels.push({paragraphs:d.title.paragraphs,align:"ctr",x:(S.l+S.r)/2-I/2,y:C,width:I,height:g,rotation:d.title.rotation??0})}}return!0}function Wn(e,t){return e.role!=="category"||e.axis?.tickLabelPosition!=="nextTo"||e.axis.crosses!=="autoZero"?!1:t.min<0&&t.max>0}function Xn(e,t){let n=t.minorUnit;return n!==null&&n>0&&(e.max-e.min)/n<=Dt?n:e.major>0?e.major/5:0}function Fo(e,t,n){let r=[];if(e.logBase!==void 0){if(!t)return[...e.ticks];let l=Math.min(Math.floor(e.logBase),100);for(let a of e.ticks)for(let i=2;i<l&&r.length<1e3;i+=1)a*i<e.max&&r.push(a*i);return r}let o=t?n:e.major;if(!(o>0))return r;for(let l=0,a=e.min;a<=e.max+o*1e-9&&l<1e3;l+=1,a=e.min+l*o)r.push(a);return r}var Yn=256;function qn(e,t,n){let r=[],o=t.position==="l"||t.position==="r"||t.position==="tr";for(let l of e.plots){let a=[],i=ft(l),s=e.plots.length===1&&l.series.length===1,c=Me(l);if(c||s&&l.series[0].points.size>0&&!i){let u=l.series[0],f=u.values.length;for(let h=0;h<f&&h<Yn;h+=1){let p=lt(u,h,e.date1904)??String(h+1),y=c||u.points.has(h)?{index:h,count:f}:void 0;a.push({text:p,look:de(l,u,n,y),line:i,point:!0})}}else{for(let u of l.series){if(a.length>=Yn)break;a.push({text:u.name??`Series${u.index+1}`,look:de(l,u,n),line:i,round:l.kind==="bubble"})}Bo(l,o)&&a.reverse()}for(let u of a)r.push(u)}return r.filter((l,a)=>!t.deleted.has(a))}function Bo(e,t){let n=e.grouping==="stacked"||e.grouping==="percentStacked";return e.kind==="bar"&&e.horizontal?e.grouping==="clustered":t?n&&(e.kind==="bar"||e.kind==="area"||e.kind==="line"):!1}function Ge(e,t){if(e.line&&e.look.line){let l=6.43+.386*t;return{key:Qn,text:Qn+2.03,after:l,shift:1.76,gap:15.66}}let n=.55*t,r=n+Math.max(0,.275*t-.4),o=(e.point?1.615:1.65)*t-r;return{key:n,text:r,after:o,shift:.55+.138*t,gap:13.25+n/2}}var Qn=19.2,Uo=5.85,Ft=.27;function Vo(e){return 9+.6045*e}function zo(e){return 14.2+.59*e}var Pe=11,$o=16.5;function Zn(e,t,n,r,o,l){let a=n.sizePt,i=J(n),s={...l},c=[],u=kt(n);if(t.length===0)return{layout:{items:c},plot:s};let f=e.layout;if(e.position==="b"||e.position==="t"){let T=r-20,w=[[]],S=0;for(let d of t){let P=Ge(d,a),g=P.text+Z(d.text,n),A=w[w.length-1],I=A.length>0?A[A.length-1].after:0;S+I+g>T&&A.length>0?(w.push([]),S=0):S+=I,S+=g,w[w.length-1].push({entry:d,width:g,after:P.after})}let V=1.84*a,H=Vo(a),_=e.position==="b"?o-H-(w.length-1)*V:l.t-Pe+H,D=Ge(t[0],a).shift,N=_+(w.length-1)*V,F=f?f.y*o:null;for(let[d,P]of w.entries()){let g=P.reduce((C,R,U)=>C+R.width+(U>0?P[U-1].after:0),0),A=f?f.x*r:r/2+D-g/2,I=F===null?_+d*V+Ft*a:F+d*V+u;for(let C of P)c.push({entry:C.entry,x:A,baseline:I}),A+=C.width+C.after}if(!e.overlay&&!f){let d=zo(a);e.position==="b"?s.b=Math.min(s.b,_-d):s.t=Math.max(s.t,N+d)}return{layout:{items:c},plot:s}}let h=i+Uo,p=Math.max(...t.map(T=>Z(T.text,n))),y=Math.max(...t.map(T=>Ge(T,a).text)),x=f&&f.h>0?f.h*o:o-20,m=Math.max(1,Math.floor((x-i)/h)+1),k=t.slice(0,m),L=i+(k.length-1)*h,b=f?f.x*r:e.position==="l"?10.7:r-10-p-y,M=(l.t+o-Pe)/2,v=f?f.y*o+Math.max(0,(x-L)/2):e.position==="tr"?l.t:M-L/2,O=!f&&e.position!=="tr";for(let[T,w]of k.entries()){let S=O?M+(T-(k.length-1)/2)*h+Ft*a:v+T*h+u;c.push({entry:w,x:b,baseline:S})}if(!e.overlay&&!f)if(e.position==="l")s.l=Math.max(s.l,b+y+p+$o);else{let T=Math.max(...t.map(w=>Ge(w,a).gap));s.r=Math.min(s.r,b-T)}return{layout:{items:c},plot:s}}function Jn(e,t,n,r){let o=t.sizePt,l=J(t);for(let a of e.items){let{entry:i}=a,s=Ge(i,o),c=a.baseline-Ft*o;if(i.line){i.look.line&&n.line([{x:a.x,y:c},{x:a.x+s.key,y:c}],i.look.line,"round");let h=i.look.marker;if(h){let p=a.x+s.key/2;n.path(Le(h.symbol,p,c,h.size*.96),!0,h.fill,h.line);for(let y of ve(h.symbol,p,c,h.size*.96))n.line(y,h.line)}}else if(i.round){let h=s.key/2;n.path([Rt(a.x+h,c,h,h)],!0,i.look.fill,i.look.line)}else{let h=s.key/2;n.rect(a.x,c-h,s.key,s.key,i.look.fill,i.look.line)}let u=a.x+s.text,f=Z(i.text,t);r.push({paragraphs:[[{text:i.text,style:t}]],align:"l",x:u,y:a.baseline-kt(t),width:f*1.3+o*2,height:l,rotation:0})}}function Ho(e,t,n){let r=e.series[t],o=r.points.get(n),l=o?$(o,"explosion"):void 0,a=l!==void 0&&/^\d{1,3}$/.test(l)?Number(l):NaN;return a>=0&&a<=400?a:r.explosion}var er=.85,tr=.5,nr=.16,Go=.75;function Wo(e){return e*Xo+jo}var Xo=.123,jo=3.5,mt=10,rr={hex:"A6A6A6",alpha:1,widthPt:.75,cap:"butt",dash:null};function Ko(e,t){let r=E(e,"leaderLines");if(!r)for(let l of oe(E(e,"extLst"),"ext"))for(let a of l.children)ee(a)&&a.local==="leaderLines"&&(r=a);let o=ne(E(r,"spPr"),t.look.colors);return ce(o.line,rr)??rr}function Yo(e,t,n){return((e-t)%360+360)%360<=n}function Qo(e,t,n,r,o){if(o.sweep>=359.9)return!0;for(let[l,a]of[[-1,-1],[1,-1],[1,1],[-1,1]]){let i=e+l*n*er/2-o.cx,s=t+a*r*er/2-o.cy,c=Math.hypot(i,s);if(c>o.outer||c<o.inner)return!1;let u=Math.atan2(i,-s)*180/Math.PI;if(!Yo(u,o.from,o.sweep))return!1}return!0}function lr(e,t,n){let r=e.series.filter(m=>m.values.some(k=>k!==null&&k>0));if(r.length===0)return;let o=e.kind==="doughnut",l=o?r:r.slice(0,1),a=l.some(m=>m.values.some((k,L)=>{let b=Ce(e,m,L);return b!==null&&b.position!=="inEnd"&&b.position!=="ctr"})),i=Math.min(t.r-t.l,t.b-t.t),s=a&&!n.placed?Wo(i):0,c=Math.max(1,i-s),u=(t.l+t.r)/2,f=(t.t+t.b)/2,h=(m,k)=>{let L=o?m*e.holeSize/100:0,b=(m-L)/l.length,M=[];for(let[v,O]of l.entries()){let T=O.values.reduce((_,D)=>_+(D!==null&&D>0?D:0),0);if(!Number.isFinite(T))return n.scene.ok=!1,[];if(!(T>0))continue;let w=o?L+v*b:0,S=o?w+b:m,V=e.firstSliceAngle,H=O.values.length;for(let _=0;_<H;_+=1){let D=O.values[_];if(D==null||!(D>0))continue;let N=D/T*360,F=V+N/2,d=Ho(e,e.series.indexOf(O),_)/100*m,P=F*Math.PI/180,g=u+d*Math.sin(P),A=f-d*Math.cos(P),I=de(e,O,n.look,Me(e)||O.points.has(_)?{index:_,count:H}:void 0);k&&n.scene.path([Rn(g,A,S,w,V,V+N)],!0,I.fill,I.line,"round");let C=Ce(e,O,_);if(C){let R=ae(n.baseText,C.txPr,n.look.colors),U={value:D,percent:D/T,category:lt(O,_,n.date1904),seriesName:O.name,seriesFormat:O.formatCode,date1904:n.date1904,cell:O.labelRange?.[_]??null},G=Ae(C,U,R,n.bounds?n.bounds.r-n.bounds.l:null,n.look.colors),Q=G.width,X=G.height,te=Math.sin(P),z=Math.cos(P),j=Q/2*Math.abs(te)+X/2*Math.abs(z),ie=C.position??(o?"ctr":"bestFit"),fe={cx:g,cy:A,inner:w,outer:S,from:V,sweep:N},se=ie==="ctr"||o?(w+S)/2:S-j-4,ke=ie==="outEnd";ie==="bestFit"&&(ke=!Qo(g+se*te,A-se*z,Q,X,fe));let Qe=ke?S+j+(ie==="outEnd"?6:0):se,qe=G.frame,Ie=ht(C.moved,n.bounds,g+Qe*te,A-Qe*z,Q,X);Ie.moved&&(ke=!1);let bt=Ie.x,gt=Ie.y;M.push({label:{paragraphs:G.paragraphs,align:"ctr",x:bt-qe/2,y:gt-X/2,width:qe,height:X,rotation:0},anchor:{x:g+S*te,y:A-S*z},outside:ke,right:te>=0,cx:bt,cy:gt,naturalX:bt,naturalY:gt,angle:F,middle:F,origin:{x:g,y:A},reach:S+(ie==="outEnd"?6:0),drift:0,lineHeight:J(R),size:R.sizePt,width:Q,height:X})}V+=N}}return M},p=c/2;for(let m=0;m<3&&!n.placed;m+=1){let k=0;for(let L of h(p,!1))L.outside&&(k=Math.max(k,L.cx+L.width/2-(t.r+mt),t.l-mt-(L.cx-L.width/2),t.t-mt-(L.cy-L.height/2),L.cy+L.height/2-(t.b+mt)));if(k<=.5)break;p=Math.max(c/4,p-k)}let y=h(p,!0);rl(y,n.avoid??[],n.bounds??null);let x=Ko(l[0]?.dLbls??e.dLbls,n);for(let m of y){let k={...m.label,x:m.label.x+(m.cx-m.naturalX),y:m.cy-m.height/2};n.labels.push(k);let L=We(m),b=Math.max(L.l-m.anchor.x,0,m.anchor.x-L.r),M=Math.max(L.t-m.anchor.y,0,m.anchor.y-L.b),v=Math.hypot(m.cx-m.naturalX,m.cy-m.naturalY);m.outside&&v>1&&Math.hypot(b,M)>Go*m.size&&n.scene.line(qo(m,f),x)}}function qo(e,t){let n=e.cy-e.height/2,r=Math.max(1,Math.round(e.height/e.lineHeight)),o=e.cy<t?r-1:0,l=n+(o+1)*e.lineHeight-.35*e.size,a=e.cx-e.width/2,i=e.cx+e.width/2,s=e.anchor.x<e.cx,c=s?a-nr*e.size:i+nr*e.size,u=s?c-tr*e.size:c+tr*e.size;return[{x:e.anchor.x,y:e.anchor.y},{x:u,y:l},{x:c,y:l}]}function or(e,t){return e.l<t.r&&t.l<e.r&&e.t<t.b&&t.t<e.b}function We(e,t=0){let n=t*e.size;return{l:e.cx-e.width/2-n,r:e.cx+e.width/2+n,t:e.cy-e.height/2,b:e.cy+e.height/2}}var Bt=.25,Zo=.5,Jo=150,el=1e3;function tl(e){let t=e.angle*Math.PI/180,n=Math.sin(t),r=Math.cos(t),o=e.width/2*Math.abs(n)+e.height/2*Math.abs(r);e.cx=e.origin.x+(e.reach+o)*n,e.cy=e.origin.y-(e.reach+o)*r}function nl(e,t,n,r){let o=Math.atan2((t.l+t.r)/2-n,r-(t.t+t.b)/2)*180/Math.PI;return((e.angle-o)%360+540)%360-180>=0?1:-1}function rl(e,t,n){let r=e.filter(c=>c.outside);if(r.length===0)return;let o=[...t];for(let c of e)c.outside||o.push(We(c));let l=r[0].origin.x,a=r[0].origin.y,i=c=>n!==null&&(c.l<n.l||c.r>n.r||c.t<n.t||c.b>n.b),s=(c,u)=>{let f=c.angle+u*Zo;return Math.abs(f-c.middle)>Jo?!1:(c.angle=f,c.drift=u,tl(c),!0)};for(let c=0;c<el;c+=1){let u=!1,f=[...r].sort((p,y)=>(p.angle%360+360)%360-(y.angle%360+360)%360),h=f.length>2?f.length:f.length-1;for(let p=0;p<h;p+=1){let y=f[p],x=f[(p+1)%f.length];or(We(y,Bt),We(x,Bt))&&(u=s(y,-1)||u,u=s(x,1)||u)}for(let p of r){let y=We(p,Bt),x=o.find(m=>or(y,m));if(x)u=s(p,p.drift||nl(p,x,l,a))||u;else if(i(y)){let m=y.t<n.t?0:y.b>n.b?180:y.l<n.l?270:90,k=((p.angle-m)%360+540)%360-180;u=s(p,p.drift||(k>=0?1:-1))||u}}if(!u)break}}var ol=1024;function ll(e){return Math.max(0,.9275*e-5.25)}var al=.04,il=.08,sl=1,cl={hex:"000000",alpha:1,widthPt:.5,cap:"butt",dash:null};function ar(e,t,n){let{model:r,scene:o}=n,l=n.look.colors,a=it(r,e,ol),i=a.count;if(i<1)return;let s=ge(r,e[0],"value"),c=a.axis,u={axis:s,id:s?.id??"",dataMin:1/0,dataMax:-1/0,percent:!1,scale:null,formatCode:null};for(let _ of e)ze(u,_);u.formatCode=$e(u,e[0].series.find(_=>_.formatCode)?.formatCode??null);let f=ae(n.baseText,s?.txPr??null,l),h=ae(n.baseText,c?.txPr??null,l),p=J(h),y=Math.max(0,...a.labels.map(_=>Z(_,h))),x=c!==null&&!c.deleted&&c.tickLabelPosition!=="none",m=ll(h.sizePt),k=Math.max(1,Math.min((t.b-t.t)/2-(x?p/2+m:0),(t.r-t.l)/2-(x?y+m:0))),L=(t.l+t.r)/2,b=(t.t+t.b)/2,M=u.dataMin>u.dataMax,v=at({dataMin:M?0:u.dataMin,dataMax:M?1:u.dataMax,lengthPt:k,minIntervalPt:1.6*f.sizePt,fixedMin:s?.min??null,fixedMax:s?.max??null,fixedMajor:s?.majorUnit??null,noHeadroom:!0}),O=v.max-v.min||1,T=(_,D)=>{let N=_/i*Math.PI*2,F=(D-v.min)/O*k;return{x:L+F*Math.sin(N),y:b-F*Math.cos(N)}},w=_=>_?ce(ne(E(_,"spPr"),l).line,cl):null,S=w(s?.majorGridlines??null);if(S){let _=[];for(let D of v.ticks){if(D<=v.min)continue;let N=[];for(let F=0;F<i;F+=1)N.push(T(F,D));_.push(N)}o.path(_,!0,null,S)}let V=w(c?.majorGridlines??null);if(V){let _=[];for(let D=0;D<i;D+=1)_.push([{x:L,y:b},T(D,v.max)]);o.path(_,!1,null,V)}let H=[];for(let _ of e){let D=_.radarStyle==="filled";for(let N of _.series){let F=de(_,N,n.look),d=[];for(let A=0;A<i;A+=1){let I=N.values[A];d.push(I==null?null:T(A,I))}let P=d.filter(A=>A!==null);D?P.length>=3&&o.path([P],!0,F.fill,F.line):F.line&&P.length>=2&&o.path([P],P.length===i&&P.length>=3,null,F.line,"round");let g=D?null:F.marker;if(g){let A=g.size*.96,I=[],C=[];for(let R of P){for(let U of Le(g.symbol,R.x,R.y,A))I.push(U);for(let U of ve(g.symbol,R.x,R.y,A))C.push(U)}I.length&&o.path(I,!0,g.fill,g.line),C.length&&o.path(C,!1,null,g.line)}for(let[A,I]of d.entries()){let C=I?Ce(_,N,A):null;if(!C||!I)continue;let R=ae(n.baseText,C.txPr,l),U={value:N.values[A],percent:null,category:a.labels[A]??null,seriesName:N.name,seriesFormat:N.formatCode,date1904:r.date1904,cell:N.labelRange?.[A]??null},G=Ae(C,U,R,null,l),Q=G.height,X=G.frame;H.push({paragraphs:G.paragraphs,align:"ctr",x:I.x-X/2,y:I.y-Q-2,width:X,height:Q,rotation:0})}}}if(s&&!s.deleted&&s.tickLabelPosition!=="none"){let _=J(f);for(let D of v.ticks){let N=ue(D,u.formatCode,r.date1904),F=Z(N,f)*1.3+f.sizePt*2,d=T(0,D);n.labels.push({paragraphs:[[{text:N,style:f}]],align:"r",x:d.x-sl*f.sizePt-F,y:d.y-_/2,width:F,height:_,rotation:0})}}if(x)for(let _=0;_<i;_+=1){let D=a.labels[_],N=_/i*Math.PI*2,F=Math.sin(N),d=Math.cos(N),P=T(_,v.max),g=Z(D,h),A=al*k,I=A+il*h.sizePt,C=P.x+A*F+g/2*F,R=P.y-I*d-p/2*d-He*h.sizePt,U=g*1.3+h.sizePt*2;n.labels.push({paragraphs:[[{text:D,style:h}]],align:"ctr",x:C-U/2,y:R-p/2,width:U,height:p,rotation:0})}for(let _ of H)n.labels.push(_)}function ul(e,t,n){return{l:e.x*t,t:e.y*n,r:(e.x+e.w)*t,b:(e.y+e.h)*n}}function ir(e,t,n,r){let o=new ut,l=[],a=wn(e,r),i=e.plots.reduce((T,w)=>T+w.series.length,0),s={model:e,colors:r,seriesCount:i},c=ne(e.spPr,r),u=c.fill===void 0?dt("bg1",[],r)??{hex:"FFFFFF",alpha:1}:c.fill;o.rect(0,0,t,n,u,c.line??null);let f={l:Pe,t:Pe,r:t-Pe,b:n-Pe},h=[],p=i===1?e.plots.find(T=>T.series.length===1).series[0]:null;if(e.title!==null||!e.autoTitleDeleted&&p!==null){let T=e.title,w=ae(a,E(T,"txPr"),r,{sizePt:a.sizePt*1.8,bold:!0}),S=p?.name??(i>1?"Chart Title":null),V=T?Ee(T,w,S,r):S?[[{text:S,style:w}]]:[];if(V.length>0){let H=Je(V),_=rt(E(T,"layout")),D=$(T,"overlay")==="1",N=E(E(T,"tx"),"rich"),F=t*.8,d=!_&&H>F,P=d?F:H*1.3+w.sizePt*2,g=Be(V,w)*(d?Math.ceil(H/F):1),A=_?_.y*n:f.t-3.4,I=_?_.x*t+H/2:t/2;l.push({paragraphs:V,align:"ctr",x:I-P/2,y:A,width:P,height:g,rotation:De(N)??0}),!_&&!D&&(f.t=A+g+12.5);let C=(d?F:H)/2+w.sizePt*.66;h.push({l:I-C,r:I+C,t:A,b:A+g})}}let x=e.legend?ae(a,e.legend.txPr,r):null,m=null;if(e.legend&&x){let T=qn(e,e.legend,s),w=Zn(e.legend,T,x,t,n,f);m=w.layout,Object.assign(f,w.plot)}let k=$(E(e.chartSpace,"chart"),"dispBlanksAs"),L=k==="zero"||k==="span"?k:"gap",b=e.plots.filter(T=>T.kind==="pie"||T.kind==="doughnut"),M=e.plots.filter(T=>T.kind==="radar"),v=e.plots.filter(T=>!b.includes(T)&&!M.includes(T));if([b,M,v].filter(T=>T.length>0).length!==1)return null;if(M.length>0)ar(M,e.plotLayout?.inner?ul(e.plotLayout,t,n):f,{model:e,look:s,scene:o,labels:l,baseText:a});else if(v.length>0){if(!Kn(v,f,{model:e,look:s,scene:o,labels:l,baseText:a,blanks:L,chartWidth:t,chartHeight:n}))return null}else{let T=e.plotLayout?{l:e.plotLayout.x*t,t:e.plotLayout.y*n,r:(e.plotLayout.x+e.plotLayout.w)*t,b:(e.plotLayout.y+e.plotLayout.h)*n}:f,w=ne(e.plotSpPr,r);(w.fill||w.line)&&o.rect(T.l,T.t,T.r-T.l,T.b-T.t,w.fill??null,w.line??null);for(let S of b)lr(S,T,{look:s,scene:o,labels:l,baseText:a,date1904:e.date1904,placed:e.plotLayout?.inner===!0,avoid:h,bounds:{l:0,t:0,r:t,b:n}})}return m&&x&&Jn(m,x,o,l),!o.ok||l.some(T=>[T.x,T.y,T.width,T.height,T.rotation].some(w=>!Number.isFinite(w*12700)))?null:{scene:o,labels:l}}var sr=12700;function dl(e){if(e.plots.length===0)return!1;for(let t of e.plots){if(t.threeD||t.element.local==="stockChart"||!["bar","line","area","scatter","pie","doughnut","radar"].includes(t.kind))return!1;for(let n of t.series)if(n.trendlines.length>0||n.errorBars.length>0)return!1}return!0}var cr=new WeakMap;function fl({chart:e}){let t=[...e.colors.scheme].map(([o,l])=>`${o}=${l.r},${l.g},${l.b},${l.a}`),n=[...e.colors.colorMap].map(([o,l])=>`${o}=${l}`),r=[e.theme.majorFont.latin,e.theme.minorFont.latin];return[...t,...n,...r].join("|")}function ur(e){let{frame:t,chart:n,measurer:r}=e,{cx:o,cy:l}=t.xfrm;if(!(o>0)||!(l>0))return null;let a=`${t.partName}|${t.layer}|${t.nodeId}`,i=fl(e),s=cr.get(n.chartSpace);if(s&&s.cx===o&&s.cy===l&&s.measurer===r&&s.owner===a&&s.theme===i)return s.result;let c=hl(e);return cr.set(n.chartSpace,{cx:o,cy:l,measurer:r,owner:a,theme:i,result:c}),c}function hl({frame:e,chart:t,measurer:n}){let r=gn(t.chartSpace);return!r||!dl(r)?null:on({measurer:n,theme:t.theme},()=>{let o=ir(r,e.xfrm.cx/sr,e.xfrm.cy/sr,t.colors);return o?hn(o.scene.components,o.labels,e,t.theme):null})}import{toCss as kr}from"@pptx-editor.dev/core/cascade";import{apply as Fl}from"@pptx-editor.dev/core/layout";import{blurSigma as Sr}from"@pptx-editor.dev/core/output";import{blurSigma as fr,effectMatrix as ml}from"@pptx-editor.dev/core/output";import{apply as pt,multiply as pl}from"@pptx-editor.dev/core/layout";var Ut=Math.PI/180,he=9525,yl=.5;function Vt(e){return Math.max(0,e)*yl}function zt(e){let t=Math.max(0,e)/2;return{spread:t,sigma:fr(t)}}var xl=.84;function hr(e){let t=Math.max(0,e);return{spread:-t*xl,sigma:fr(t)}}function $t(e,t){let n=t*Ut;return{dx:-Math.cos(n)*e,dy:-Math.sin(n)*e}}function Ht(e){let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let l of e)t=Math.min(t,l.x),n=Math.min(n,l.y),r=Math.max(r,l.x),o=Math.max(o,l.y);return{x:t,y:n,r,b:o}}function bl(e,t,n){return[pt(e,0,0),pt(e,t,0),pt(e,t,n),pt(e,0,n)]}function Re(e,t){return{x:e.x-t,y:e.y-t,r:e.r+t,b:e.b+t}}function gl(e,t){let n=Math.cos(t*Ut),r=Math.sin(t*Ut),l=[{x:e.x,y:e.y},{x:e.r,y:e.y},{x:e.r,y:e.b},{x:e.x,y:e.b}].map(f=>f.x*n+f.y*r),a=l.reduce((f,h)=>Math.min(f,h),1/0),i=l.reduce((f,h)=>Math.max(f,h),-1/0),s=(e.x+e.r)/2,c=(e.y+e.b)/2,u=s*n+c*r;return{x1:s+(a-u)*n,y1:c+(a-u)*r,x2:s+(i-u)*n,y2:c+(i-u)*r}}var dr=e=>Math.max(0,Math.min(1,e));function Gt(e,t,n,r){let o=ml(e,t,n,r),l=Ht(bl(pl(o,t),n,r)),a=e.rotWithShape?Math.atan2(t[1],t[0])*180/Math.PI:0,i=dr(e.startPos);return{matrix:o,line:gl(l,e.fadeDir+a),start:i,end:Math.max(i,dr(e.endPos))}}import{apply as Ke}from"@pptx-editor.dev/core/layout";var Xe=Math.PI/180,Cl={isometricBottomDown:[2124e3,18883200,17990400],isometricBottomUp:[2124e3,2716800,3609600],isometricLeftDown:[21e5,27e5,0],isometricLeftUp:[195e5,27e5,0],isometricOffAxis1Left:[108e4,384e4,0],isometricOffAxis1Right:[108e4,2004e4,0],isometricOffAxis1Top:[18075600,18393e3,3458400],isometricOffAxis2Left:[108e4,156e4,0],isometricOffAxis2Right:[108e4,1776e4,0],isometricOffAxis2Top:[18075600,3207e3,18141600],isometricOffAxis3Bottom:[3524400,18393e3,18141600],isometricOffAxis3Left:[2052e4,384e4,0],isometricOffAxis3Right:[2052e4,2004e4,0],isometricOffAxis4Bottom:[3524400,3207e3,3458400],isometricOffAxis4Left:[2052e4,156e4,0],isometricOffAxis4Right:[2052e4,1776e4,0],isometricRightDown:[195e5,189e5,0],isometricRightUp:[21e5,189e5,0],isometricTopDown:[19476e3,2716800,17990400],isometricTopUp:[19476e3,18883200,3609600],perspectiveAbove:[204e5,0,0],perspectiveAboveLeftFacing:[2358600,860400,20467200],perspectiveAboveRightFacing:[2358600,20739600,1132800],perspectiveBelow:[12e5,0,0],perspectiveContrastingLeftFacing:[624e3,2636400,21387e3],perspectiveContrastingRightFacing:[624e3,18963600,213e3],perspectiveHeroicExtremeLeftFacing:[487200,2067600,21425400],perspectiveHeroicExtremeRightFacing:[487200,19532400,174600],perspectiveHeroicLeftFacing:[20938800,857400,157800],perspectiveHeroicRightFacing:[20938800,20742600,21442200],perspectiveLeft:[0,12e5,0],perspectiveRelaxed:[18573600,0,0],perspectiveRelaxedModerately:[19490400,0,0],perspectiveRight:[0,204e5,0]},Ml={obliqueTopLeft:[-45,.3],obliqueTop:[-90,.3],obliqueTopRight:[-135,.3],obliqueLeft:[0,.3],obliqueRight:[180,.3],obliqueBottomLeft:[45,.3],obliqueBottom:[90,.3],obliqueBottomRight:[135,.3],legacyObliqueTopLeft:[-45,.5],legacyObliqueTop:[-90,.5],legacyObliqueTopRight:[-135,.5],legacyObliqueLeft:[0,.5],legacyObliqueRight:[180,.5],legacyObliqueBottomLeft:[45,.5],legacyObliqueBottom:[90,.5],legacyObliqueBottomRight:[135,.5]};function mr(e,t){let n=r=>[r[0]*t[0][0]+r[1]*t[1][0]+r[2]*t[2][0],r[0]*t[0][1]+r[1]*t[1][1]+r[2]*t[2][1],r[0]*t[0][2]+r[1]*t[1][2]+r[2]*t[2][2]];return[n(e[0]),n(e[1]),n(e[2])]}function xr(e,t){return[e[0][0]*t[0]+e[0][1]*t[1]+e[0][2]*t[2],e[1][0]*t[0]+e[1][1]*t[1]+e[1][2]*t[2],e[2][0]*t[0]+e[2][1]*t[1]+e[2][2]*t[2]]}function br(e){let t=Cl[e.camera],n=e.cameraRot?[e.cameraRot.lat,e.cameraRot.lon,e.cameraRot.rev]:t?[t[0]/6e4,t[1]/6e4,t[2]/6e4]:void 0;if(n&&(n[0]!==0||n[1]!==0||n[2]!==0)){let[o,l,a]=n.map(u=>u*Xe),i=[[Math.cos(l),0,Math.sin(l)],[0,1,0],[-Math.sin(l),0,Math.cos(l)]],s=[[1,0,0],[0,Math.cos(o),-Math.sin(o)],[0,Math.sin(o),Math.cos(o)]],c=[[Math.cos(-a),-Math.sin(-a),0],[Math.sin(-a),Math.cos(-a),0],[0,0,1]];return{kind:"turn",rotation:mr(c,mr(s,i))}}let r=e.cameraRot?void 0:Ml[e.camera];if(r){let[o,l]=r;return{kind:"oblique",dx:-Math.cos(o*Xe)*l,dy:Math.sin(o*Xe)*l}}return{kind:"front"}}var Pl=.044,pr={dir:[-.017,-.707,.707],k:1.07},yr={dir:[-.227,.924,.307],k:.774},Wt={dir:[-.189,-.405,.894],k:.452,power:32.7},kl={t:0,tl:-90,l:-90,bl:-135,b:180,br:135,r:90,tr:45};function Sl(e){return/^(matte|powder|translucentPowder|dkEdge|softEdge|clear)$/.test(e)?0:/^(metal|softmetal)$/.test(e)?2:1}var Xt=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2];function jt(e,t){let n=Math.cos(t*Xe),r=Math.sin(t*Xe);return[e[0]*n-e[1]*r,e[0]*r+e[1]*n,e[2]]}function Kt(e){let t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]}function gr(e){if(e.material==="flat"||e.material==="legacyWireframe"||/^(flat|legacyFlat\d)$/.test(e.lightRig))return{shade:()=>({level:1,white:0})};let t=kl[e.lightDir]??0,n=jt(pr.dir,t),r=jt(yr.dir,t),o=jt(Wt.dir,t),l=Sl(e.material)*Wt.k,a=s=>({level:Pl+pr.k*Math.max(0,Xt(s,n))+yr.k*Math.max(0,Xt(s,r)),white:l*Math.max(0,Xt(s,o))**Wt.power}),i=a([0,0,1]);return{shade:s=>{let c=a(s);return{level:c.level/i.level,white:Math.max(0,c.white-i.white)}}}}var je=8,yt=12,_l=4096,El=1024,Ll={circle:e=>Math.sqrt(Math.max(0,1-(1-e)**2)),angle:e=>e,relaxedInset:e=>{if(e<.4)return Math.sqrt(Math.max(0,1-(1-e/.4)**2));let t=(e-.4)/.6;return 1-.5*t*(2-t)},slope:e=>Math.min(1,e/.6),cross:e=>1-.5*Math.max(0,1-Math.abs(e-.45)/.1),softRound:e=>1-(1-e)**3,convex:e=>Math.sin(Math.PI*e/2),coolSlant:e=>e<.2?.6*e/.2:.6+.4*(e-.2)/.8,divot:e=>e<.5?Math.sqrt(Math.max(0,1-(1-e/.5)**2)):1-.3*Math.sin(Math.PI*(e-.5)/.5),riblet:e=>.5*e+.5*Math.abs(Math.sin(2*Math.PI*e)),hardEdge:e=>Math.min(1,e/.15),artDeco:e=>e<.15?e/.3:e<.35?.5:e<.5?.5+(e-.35)/.3:1};function vl(e){let t=[],n=0;for(let r of e){if(r.fill==="none")continue;let o=[],l={x:0,y:0},a=()=>{let s=o[o.length-1];s&&o.length>1&&Math.hypot(s.x-o[0].x,s.y-o[0].y)<1&&o.pop(),o.length>=3&&t.push(o),n+=o.length,o=[]},i=s=>{let c=o[o.length-1];(!c||Math.hypot(c.x-s.x,c.y-s.y)>=1)&&o.push(s),l=s};for(let s of r.commands){if(s.op==="M")a(),i({x:s.x,y:s.y});else if(s.op==="L")i({x:s.x,y:s.y});else if(s.op==="C"){let c=l;for(let u=1;u<=yt;u+=1){let f=u/yt,h=1-f;i({x:h*h*h*c.x+3*h*h*f*s.x1+3*h*f*f*s.x2+f*f*f*s.x,y:h*h*h*c.y+3*h*h*f*s.y1+3*h*f*f*s.y2+f*f*f*s.y})}}else if(s.op==="Q"){let c=l;for(let u=1;u<=yt;u+=1){let f=u/yt,h=1-f;i({x:h*h*c.x+2*h*f*s.x1+f*f*s.x,y:h*h*c.y+2*h*f*s.y1+f*f*s.y})}}else if(s.op==="Z"){let c=o[0];a(),c&&(l=c)}if(n+o.length>_l)return null}a()}return t}function Tl(e){let t=e.reduce((r,o)=>r+o.length,0),n=Math.ceil(t/El);return n<=1?[...e]:e.map(r=>r.filter((o,l)=>l%n===0)).filter(r=>r.length>=3)}function Cr(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e[n],o=e[(n+1)%e.length];t+=r.x*o.y-o.x*r.y}return t/2}function xt(e){let t=Cr(e)>=0?1:-1;return e.map((n,r)=>{let o=e[(r+1)%e.length],l=o.x-n.x,a=o.y-n.y,i=Math.hypot(l,a)||1;return{x:t*a/i,y:t*-l/i}})}function Mr(e,t,n){let r=e.length;return e.map((o,l)=>{let a=t[(l-1+r)%r],i=t[l],s=Math.max(.125,1+a.x*i.x+a.y*i.y),c=(a.x+i.x)/s,u=(a.y+i.y)/s,f=Math.hypot(c,u);return f>4&&(c*=4/f,u*=4/f),{x:o.x-c*n,y:o.y-u*n}})}function Qt(e,t,n){let r=Number.isFinite(t)?t:1,o=Number.isFinite(n)?n:0,l=a=>Math.max(0,Math.min(255,a*r+255*o));return{r:l(e.r),g:l(e.g),b:l(e.b),a:e.a}}var Al=1,wl=e=>e.points.every(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))&&[e.color.r,e.color.g,e.color.b,e.color.a].every(Number.isFinite),Rl=e=>`${Math.round(e.r)},${Math.round(e.g)},${Math.round(e.b)},${Math.round(e.a*1e3)}`;function Yt(e){let t=[];for(let n of e){if(!wl(n))continue;let r=Rl(n.color),o=t[t.length-1];o?.key===r?o.polygons.push(n.points):t.push({polygons:[n.points],color:n.color,key:r})}return t.map(({polygons:n,color:r})=>({polygons:n,color:r}))}function Il(e,t,n,r,o,l){let a=Math.min(n.w,r);if(!(a>0)||!(Math.abs(Cr(e))>=Al))return[];let i=xt(e),s=Ll[n.preset],c=Array.from({length:je+1},(f,h)=>Mr(e,i,a*h/je)),u=[];for(let f=0;f<je;f+=1){let h=f/je,p=(f+1)/je,y=(s(p)-s(h))/(p-h)*(n.h/a),x=c[f],m=c[f+1];for(let k=0;k<e.length;k+=1){let L=(k+1)%e.length,b=t[k],{level:M,white:v}=l.shade(Kt([b.x*y,b.y*y,1]));u.push({points:[x[k],x[L],m[L],m[k]],color:Qt(o,M,v)})}}return u}function Nl(e,t){return xt(e.map(n=>Ke(t,n.x,n.y)))}var Ol=[1,0,0,1,0,0],Dl=1e-6;function Pr(e){let t=e.effects.threeD;if(!t)return null;let n=vl(e.paths);if(!n||n.length===0)return null;let r=Tl(n),o=br(t),l=gr(t),a=e.matrix,i=Ke(a,e.width/2,e.height/2),s=o.kind==="turn"?(()=>{let m=o.rotation,k=m[0][0],L=m[1][0],b=m[0][1],M=m[1][1];return[k,L,b,M,i.x-k*i.x-b*i.y,i.y-L*i.x-M*i.y]})():Ol,c={...e.color,a:1},u=[],f=[],h=[],p=Math.max(0,Math.min(e.width,e.height)/2);if(t.bevelTop)for(let m of r)u.push(...Il(m,Nl(m,a),t.bevelTop,p,c,l));if(t.contourW>0){let m=t.contourColor?{...t.contourColor}:c;for(let k of r){let L=xt(k),b=Mr(k,L,-t.contourW);for(let M=0;M<k.length;M+=1){let v=(M+1)%k.length;f.push({points:[b[M],b[v],k[v],k[M]],color:m})}}}let y=t.extrusionH+(t.bevelBottom?.h??0)+(t.bevelTop?.h??0);if(y>0&&o.kind!=="front"){let m=t.extrusionColor?{...t.extrusionColor,a:1}:c,k=[];for(let L of r){let b=L.map(v=>Ke(a,v.x,v.y)),M=xt(b);for(let v=0;v<b.length;v+=1){let O=b[v],T=b[(v+1)%b.length],w=M[v];if(o.kind==="oblique"){if(w.x*o.dx+w.y*o.dy<=0)continue;let N={x:o.dx*y,y:o.dy*y},{level:F,white:d}=l.shade(Kt([w.x,w.y,.35]));k.push({facet:{points:[O,T,{x:T.x+N.x,y:T.y+N.y},{x:O.x+N.x,y:O.y+N.y}],color:Qt(m,F,d)},z:0});continue}let S=o.rotation,V=(N,F)=>{let d=xr(S,[N.x-i.x,N.y-i.y,F]);return{x:i.x+d[0],y:i.y+d[1],z:d[2]}},H=[V(O,0),V(T,0),V(T,y),V(O,y)],{level:_,white:D}=l.shade([w.x,w.y,0]);k.push({facet:{points:H.map(({x:N,y:F})=>({x:N,y:F})),color:Qt(m,_,D)},z:H.reduce((N,F)=>N+F.z,0)/4})}}k.sort((L,b)=>b.z-L.z),h.push(...k.map(L=>L.facet));for(let L of r){let b=L.map(M=>{let v=Ke(a,M.x,M.y);return Ke(s,v.x,v.y)});h.push({points:b,color:m})}}if(u.length===0&&f.length===0&&h.length===0&&o.kind!=="turn")return null;let x=Math.abs(s[0]*s[3]-s[1]*s[2])>=Dl;return{front:s,showsFace:x,behind:Yt(h),under:Yt(f),over:Yt(u)}}function W(e){if(!Number.isFinite(e))return"0";let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)}function B(e,t={},n=[]){return n.length>0?{tag:e,attrs:t,children:n}:{tag:e,attrs:t}}function Bl(e){return`matrix(${e.map(W).join(" ")})`}function Ye(e){return{filterUnits:"userSpaceOnUse",x:W(e.x),y:W(e.y),width:W(Math.max(1,e.r-e.x)),height:W(Math.max(1,e.b-e.y)),"color-interpolation-filters":"sRGB"}}var qt=127e4,Ul="0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1",Vl="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0";function _r(e,t,n){let r=Math.min(Math.abs(e),qt),o=Re(n,r+he),l={x:W(o.x),y:W(o.y),width:W(Math.max(1,o.r-o.x)),height:W(Math.max(1,o.b-o.y))},a=e>0,i=r/Math.SQRT2,s=Math.min(he,r),c=(f,h,p)=>B("feMorphology",{...l,in:`${t}-g`,operator:a?"dilate":"erode",radius:`${W(f)} ${W(h)}`,result:p}),u=a?"lighten":"darken";return[B("feColorMatrix",{...l,in:"SourceAlpha",type:"matrix",values:Ul,result:`${t}-g`}),c(r,s,`${t}-h`),c(s,r,`${t}-v`),c(i,i,`${t}-d`),B("feBlend",{...l,in:`${t}-h`,in2:`${t}-v`,mode:u,result:`${t}-hv`}),B("feBlend",{...l,in:`${t}-d`,in2:`${t}-hv`,mode:u,result:`${t}-m`}),B("feColorMatrix",{...l,in:`${t}-m`,type:"matrix",values:Vl,result:t})]}function zl(e,t,n){let r=[],{softEdge:o,innerShadow:l}=e,a="SourceGraphic",i=Math.max(t.r-t.x,t.b-t.y)/10+he;if(l){let c=Sr(l.blur),{dx:u,dy:f}=$t(l.dist,l.dir);i+=Math.abs(l.dist)+3*c,r.push(B("feComponentTransfer",{in:"SourceAlpha",result:"ia"},[B("feFuncA",{type:"table",tableValues:"1 0"})]),B("feGaussianBlur",{in:"ia",stdDeviation:W(c),result:"ib"}),B("feOffset",{in:"ib",dx:W(u),dy:W(f),result:"io"}),B("feFlood",{"flood-color":kr({...l.color,a:1}),"flood-opacity":W(l.color.a),result:"ic"}),B("feComposite",{in:"ic",in2:"io",operator:"in",result:"ish"}),B("feComposite",{in:"ish",in2:"SourceAlpha",operator:"in",result:"isc"}),B("feMerge",{result:"inner"},[B("feMergeNode",{in:"SourceGraphic"}),B("feMergeNode",{in:"isc"})])),a="inner"}if(o&&o.radius>0){let{spread:c,sigma:u}=hr(o.radius);if(Math.abs(c)>Math.min(t.r-t.x,t.b-t.y)/2){let f=n.id("fx"),h=B("feFlood",{"flood-opacity":"0"});return{defs:[B("filter",{id:f,...Ye(t)},[h])],filter:f}}i=Math.max(i,Math.min(Math.abs(c),qt)+he),r.push(..._r(c,"se",t),B("feGaussianBlur",{in:"se",stdDeviation:W(u),result:"sm"}),B("feComponentTransfer",{in:a,result:"so"},[B("feFuncA",{type:"discrete",tableValues:"1"})]),B("feComposite",{in:"so",in2:"sm",operator:"in",result:"sc"}),B("feComponentTransfer",{in:"SourceAlpha",result:"sb"},[B("feFuncA",{type:"linear",slope:"255",intercept:"0"})]),B("feComposite",{in:"sc",in2:"sb",operator:"in",result:"soft"}))}if(r.length===0)return null;let s=n.id("fx");return{defs:[B("filter",{id:s,...Ye(Re(t,i))},r)],filter:s}}function $l(e,t,n,r=!1){let o=e.glow;if(!o||o.radius<=0)return null;let l=n.id("glow"),{spread:a,sigma:i}=zt(Math.min(o.radius,2*qt));return{defs:[B("filter",{id:l,...Ye(Re(t,a+3*i+he))},[..._r(a,"gd",t),B("feGaussianBlur",{in:"gd",stdDeviation:W(i),result:"gb"}),B("feFlood",{"flood-color":kr({...o.color,a:1}),"flood-opacity":W(o.color.a),result:"gc"}),B("feComposite",{in:"gc",in2:"gb",operator:"in",result:"glow"}),...r?[]:[B("feMerge",{},[B("feMergeNode",{in:"glow"}),B("feMergeNode",{in:"SourceGraphic"})])]])],filter:l}}function Hl(e,t,n){let r=e.reflection;if(!r||r.startAlpha<=0&&r.endAlpha<=0)return null;let{matrix:o,line:l,start:a,end:i}=Gt(r,t.matrix,t.width,t.height),s=Vt(r.blur),c=Re(Ht(t.corners.map(x=>Fl(o,x.x,x.y))),3*s+he),u=[],f=n.id("fade");u.push(B("linearGradient",{id:f,gradientUnits:"userSpaceOnUse",x1:W(l.x1),y1:W(l.y1),x2:W(l.x2),y2:W(l.y2)},[B("stop",{offset:W(a),"stop-color":"#ffffff","stop-opacity":W(r.startAlpha)}),B("stop",{offset:W(i),"stop-color":"#ffffff","stop-opacity":W(r.endAlpha)})]));let h=n.id("reflect"),p={x:W(c.x),y:W(c.y),width:W(Math.max(1,c.r-c.x)),height:W(Math.max(1,c.b-c.y))};u.push(B("mask",{id:h,maskUnits:"userSpaceOnUse",...p},[B("rect",{...p,fill:`url(#${f})`})]));let y=B("use",{href:`#${t.contentId}`,transform:Bl(o)});if(s>0){let x=n.id("rblur");u.push(B("filter",{id:x,...Ye(c)},[B("feGaussianBlur",{in:"SourceGraphic",stdDeviation:W(s)})])),y=B("g",{filter:`url(#${x})`},[y])}return{defs:u,node:B("g",{mask:`url(#${h})`,"data-effect":"reflection"},[y])}}function Gl(e,t,n){let r=e.blur,o=r?Sr(r.radius):0;if(!r||o<=0)return null;let l=n.id("blur"),a=[B("feGaussianBlur",{in:"SourceGraphic",stdDeviation:W(o),result:"bl"}),...r.grow?[]:[B("feComposite",{in:"bl",in2:"SourceAlpha",operator:"in",result:"bi"})]],i=r.grow?3*o+he:he;return{defs:[B("filter",{id:l,...Ye(Re(t,i))},a)],filter:l}}var Er=Object.freeze({body:zl,glow:$l,reflection:Hl,blur:Gl,threeD:Pr});function Xl(e={}){Zt(e.licenseKey),Wl({effects:Er,chart:ur})}function ji(e={}){return Xl(e),Object.freeze({id:"drawing"})}export{ji as drawingModule,zt as glowSpread,$t as innerShadowShift,Xl as installDrawing,Vt as reflectionBlurSigma,Gt as reflectionFade};
6
+ import{a as tn}from"./chunk-HCD7IVOL.js";import{installDrawingRenderers as oa}from"@pptx-editor.dev/core/layout";import{resolveThemeFont as Nr}from"@pptx-editor.dev/core/cascade";import{isValidXmlText as Or}from"@pptx-editor.dev/core/store";import{resolveColor as Ar}from"@pptx-editor.dev/core/cascade";import{NS as Je}from"@pptx-editor.dev/core/store";var rn=Je.c,pe=Je.a;function ee(e){return e?.type==="element"}function Z(e,t){for(let n of e)if(n.type==="element"&&n.ns===t.namespaceUri&&n.local===t.localName)return n;return null}function Q(e,t){for(let n of e)if(n.local===t&&n.ns==="")return n.value}var vr=20116800;function on(e){if(e===void 0||!/^-?\d{1,15}$/.test(e))return null;let t=Number(e);return Number.isFinite(t)?Math.min(Math.max(t,0),vr):null}function Rr(e){let t=n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0");return{hex:`${t(e.r)}${t(e.g)}${t(e.b)}`.toUpperCase(),alpha:e.a}}function ge(e,t){if(!ee(e)||!t)return null;let n=Ar(e,t);return n?Rr(n):null}var Ir=new Set(["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"]);function ln(e,t){let n=e.children.find(o=>o.type==="element"&&o.ns===Je.a&&Ir.has(o.local));if(!n)return{present:!1,color:null};if(n.local!=="solidFill")return{present:!0,color:null};let r=n.children.find(ee);return{present:!0,color:ge(r,t)}}var nn=0;function St(e,t,n=[]){return nn+=1,{type:"element",id:`chart-generated-${nn}`,kind:"generic",ns:Je.a,local:e,nsDecls:[],attrs:Object.entries(t).map(([r,o])=>({ns:"",local:r,value:o})),children:n}}var _e=pe,Oe=512,Dr=128,Fr=16,Br=.952,Ur=.268;function an(e,t){let n=Q(e.attrs,t);return n==="1"||n==="true"?!0:n==="0"||n==="false"?!1:null}function _t(e,t){let n=Z(e.children,{namespaceUri:_e,localName:t}),r=n?Q(n.attrs,"typeface"):void 0;return r&&r.length<=Dr&&Or(r)?r:null}function De(e,t,n){if(!t)return e;let r=Q(t.attrs,"sz"),o=r&&/^\d{3,6}$/.test(r)?Number(r)/100:null,a=Z(t.children,{namespaceUri:_e,localName:"solidFill"})?.children.find(ee),i=a?ge(a,n):null,s=Q(t.attrs,"u");return{sizePt:o!==null&&o>=1&&o<=400?o:e.sizePt,bold:an(t,"b")??e.bold,italic:an(t,"i")??e.italic,underline:s===void 0?e.underline:s!=="none",colorHex:i?.hex??e.colorHex,latin:_t(t,"latin")??e.latin,eastAsian:_t(t,"ea")??e.eastAsian,complex:_t(t,"cs")??e.complex}}function Et(e){if(!e)return null;let t=Z(e.children,{namespaceUri:_e,localName:"p"}),n=t?Z(t.children,{namespaceUri:_e,localName:"pPr"}):null;return n?Z(n.children,{namespaceUri:_e,localName:"defRPr"}):null}function Fe(e){let t=e?Z(e.children,{namespaceUri:_e,localName:"bodyPr"}):null;if(!t)return null;let n=Q(t.attrs,"vert");if(n==="vert")return 90;if(n==="vert270")return-90;let r=Q(t.attrs,"rot");if(r===void 0||!/^-?\d{1,9}$/.test(r))return null;let o=Number(r);return o===-6e7||Math.abs(o)>54e5?null:o/6e4}var ye=null;function sn(e,t){let n=ye;ye=e;try{return t()}finally{ye=n}}function Be(e,t){return Nr(e,t)??t.minorFont.latin??"Calibri"}function cn(e,{measurer:t,theme:n}){return t.resolve({family:Be(e.latin,n),bold:e.bold,italic:e.italic})}function J(e,t){if(!ye)return 0;let n=e.length>Oe?e.slice(0,Oe):e;if(n==="")return 0;let r=cn(t,ye),o=0;for(let l of ye.measurer.advances(r,n))o+=l;return o*t.sizePt}function un(e){let t=ye?cn(e,ye).metrics:null;return t&&t.ascent>0&&t.descent>=0?t:{ascent:Br,descent:Ur}}function q(e){let{ascent:t,descent:n}=un(e);return e.sizePt*(t+n)}function Lt(e){return e.sizePt*un(e).ascent}function Ue(e,t){let n=0;for(let r of e)n+=r.length>0?Math.max(...r.map(o=>q(o.style))):q(t);return n}function et(e){let t=0;for(let n of e)t=Math.max(t,n.reduce((r,o)=>r+J(o.text,o.style),0));return t}function dn(e){let t=[];for(let n of e){let r=[];for(let o of n){let l=o.text.split(/\r\n|\r|\n/);for(let[a,i]of l.entries())a>0&&(t.push(r),r=[]),i!==""&&r.push({text:i,style:o.style})}t.push(r)}return t.slice(0,Fr)}var Vr=12700,zr=4096,fn=2,Ce=e=>Math.round(e*Vr);function $r(e){let t=/^[0-9a-f]{6}$/i.test(e.hex)?Number.parseInt(e.hex,16):0,n=Number.isFinite(e.alpha)?Math.min(1,Math.max(0,e.alpha)):1;return{r:t>>16&255,g:t>>8&255,b:t&255,a:n}}function Tt(e){return{type:"solid",color:$r(e)}}function Hr(e,t){return{fill:Tt(e),width:Ce(e.widthPt),cap:e.cap==="round"?"rnd":e.cap==="square"?"sq":"flat",join:t??"miter",miterLimit:8,dash:e.dash?"custom":"solid",...e.dash?{dashes:e.dash}:{},compound:"sng"}}var hn=e=>e!==null&&/^[0-9a-f]{6}$/i.test(e.hex);function Wr(e,t,n){let r=[];for(let o of e.subpaths){for(let[l,a]of o.entries())r.push({op:l===0?"M":"L",x:Ce(a.x),y:Ce(a.y)});e.closed&&r.push({op:"Z"})}return{commands:r,fill:t?"norm":"none",stroke:n}}function pn(e,t,n){let r=e.frame;return{nodeId:`${r.nodeId}#chart-${n}:${t}`,partName:r.partName,layer:r.layer,name:"",hidden:!1}}function Gr(e,t,n){let r=e.closed&&hn(e.fill)?e.fill:null,o=e.stroke&&hn(e.stroke)?e.stroke:null;if(!r&&!o)return null;let{cx:l,cy:a}=n.frame.xfrm;return{...pn(n,t,"shape"),kind:"shape",xfrm:{x:0,y:0,cx:l,cy:a,rot:0,flipH:!1,flipV:!1},geometry:{kind:"paths",paths:[Wr(e,!!r,!!o)]},fill:r?Tt(r):{type:"none"},...o?{line:Hr(o,e.join)}:{}}}var Xr={lIns:0,tIns:0,rIns:0,bIns:0,anchor:"ctr",anchorCtr:!1,wrap:"square",vert:"horz",rot:0,upright:!1,numCol:1,spcCol:0,autofit:{kind:"none"},spcFirstLastPara:!1};function mn(e,t){let n=e.style,r=n.latin.startsWith("+mj")?"major":n.latin.startsWith("+mn")?"minor":void 0,o=Be(n.latin,t);return{size:Math.round(n.sizePt*100),bold:n.bold,italic:n.italic,underline:n.underline?"sng":"none",strike:"noStrike",caps:"none",spacing:0,baseline:0,latin:o,...r?{latinTheme:r}:{},ea:n.eastAsian?Be(n.eastAsian,t):o,cs:n.complex?Be(n.complex,t):o,fill:Tt({hex:n.colorHex,alpha:1})}}function jr(e,t,n,r){let o=e.filter(a=>a.text!==""),l=o.reduce((a,i)=>i.style.sizePt<a.style.sizePt?i:a);return{nodeId:`${n}:p`,level:0,align:t,marL:0,marR:0,indent:0,lineSpacing:{pct:1},spaceBefore:{pts:0},spaceAfter:{pts:0},bullet:null,defaultTab:914400,tabs:[],rtl:!1,eaLineBreak:!0,latinLineBreak:!1,hangingPunct:!1,runs:o.map((a,i)=>({kind:"text",nodeId:`${n}:r${i}`,text:a.text.length>Oe?a.text.slice(0,Oe):a.text,props:mn(a,r)})),endProps:mn(l,r)}}function Kr(e,t,n){let r=`${n.frame.nodeId}#chart-label:${t}`,o=[];for(let[s,c]of dn(e.paragraphs).entries())c.some(u=>u.text!=="")&&o.push(jr(c,e.align,`${r}:${s}`,n.theme));if(o.length===0)return null;let l=e.align==="l"?0:fn,a=e.align==="r"?0:fn,i=(e.rotation%360+360)%360;return{...pn(n,t,"label"),kind:"shape",xfrm:{x:Ce(e.x-l),y:Ce(e.y),cx:Math.max(1,Ce(e.width+l+a)),cy:Math.max(1,Ce(e.height)),rot:Number.isFinite(i)?i:0,flipH:!1,flipV:!1},geometry:{kind:"preset",preset:"rect",adjust:new Map},fill:{type:"none"},text:{body:Xr,paragraphs:o}}}function yn(e,t,n,r){if(t.length>zr)return null;let o={frame:n,theme:r},l=[];for(let[a,i]of e.entries()){let s=Gr(i,a,o);s&&l.push(s)}for(let[a,i]of t.entries()){let s=Kr(i,a,o);s&&l.push(s)}return l}var vt=rn,Yr=8,wt=255,rt=4096,Qr=32768,xn=1024,gn=new Map([["barChart",{kind:"bar",threeD:!1}],["bar3DChart",{kind:"bar",threeD:!0}],["lineChart",{kind:"line",threeD:!1}],["line3DChart",{kind:"line",threeD:!0}],["areaChart",{kind:"area",threeD:!1}],["area3DChart",{kind:"area",threeD:!0}],["pieChart",{kind:"pie",threeD:!1}],["pie3DChart",{kind:"pie",threeD:!0}],["doughnutChart",{kind:"doughnut",threeD:!1}],["scatterChart",{kind:"scatter",threeD:!1}],["radarChart",{kind:"radar",threeD:!1}],["bubbleChart",{kind:"bubble",threeD:!1}],["stockChart",{kind:"line",threeD:!1}],["ofPieChart",{kind:"ofPie",threeD:!1}],["surfaceChart",{kind:"surface",threeD:!1}],["surface3DChart",{kind:"surface",threeD:!0}]]);function E(e,t){return e?Z(e.children,{namespaceUri:vt,localName:t}):null}function oe(e,t){let n=[];for(let r of e?.children??[])ee(r)&&r.ns===vt&&r.local===t&&n.push(r);return n}function H(e,t){let n=E(e,t);return n?Q(n.attrs,"val"):void 0}function re(e,t,n){let r=E(e,t);if(!r)return n;let o=Q(r.attrs,"val");return o===void 0?!0:o==="1"||o==="true"}function K(e,t,n,r){let o=H(e,t);if(o===void 0||o.length>40)return null;let l=Number(o);return Number.isFinite(l)&&l>=n&&l<=r?l:null}function At(e){let t="";for(let n of e?.children??[])n.type==="text"&&(t+=n.value);return t.length>xn?t.slice(0,xn):t}function Cn(e,t){let n=H(e,"ptCount")?.trim(),r=K(e,"ptCount",0,rt);return E(e,"ptCount")&&(!n||!/^\+?\d+$/.test(n)||r===null)?(t.remaining=-1,null):r}function nt(e,t){if(!e)return null;let n=Cn(e,t);if(t.remaining<0)return null;let r=oe(e,"pt"),o=n??0,l=[];for(let i of r){let s=Q(i.attrs,"idx"),c=s!==void 0&&/^\d{1,6}$/.test(s)?Number(s):-1;if(c<0||c>=rt||n!==null&&c>=n)return t.remaining=-1,null;l.push([c,At(E(i,"v"))]),n===null&&(o=Math.max(o,c+1))}if(o>rt||(t.remaining-=o,t.remaining<0))return null;let a=Array.from({length:o},()=>null);for(let[i,s]of l)a[i]=s;return a}function tt(e,t){let n={text:null,numbers:null,formatCode:null};if(!e)return n;let r=E(e,"numRef"),o=E(r,"numCache")??E(e,"numLit");if(o){let c=nt(o,t),u=At(E(o,"formatCode"))||null;return{text:c,numbers:c?.map(d=>Mn(d))??null,formatCode:u}}let l=E(e,"strRef"),a=E(l,"strCache")??E(e,"strLit");if(a)return{text:nt(a,t),numbers:null,formatCode:null};let i=E(E(e,"multiLvlStrRef"),"multiLvlStrCache");if(i){let c=oe(i,"lvl")[0]??null;if(c){let u=Cn(i,t),d=nt(c,t)??[],h=u??d.length;return h<d.length?(t.remaining=-1,n):(t.remaining-=Math.max(0,h-d.length),t.remaining<0?n:{text:Array.from({length:h},(m,x)=>d[x]??null),numbers:null,formatCode:null})}}let s=E(e,"v");return s?{text:[At(s)],numbers:null,formatCode:null}:n}function Mn(e){if(e===null)return null;let t=e.trim();if(t===""||t.length>40)return null;let n=Number(t);return Number.isFinite(n)?n:null}function Zr(e){return e?{symbol:H(e,"symbol")??null,size:K(e,"size",2,72),spPr:E(e,"spPr")}:null}function qr(e,t,n){let r=tt(E(e,"tx"),n).text?.[0]??null,o=t==="scatter"||t==="bubble",l=tt(E(e,o?"xVal":"cat"),n),a=tt(E(e,o?"yVal":"val"),n);if(n.remaining<0)return null;let i=new Map;for(let s of oe(e,"dPt")){let c=K(s,"idx",0,rt-1);c!==null&&i.set(c,s)}return{index:K(e,"idx",0,2**31)??0,order:K(e,"order",0,2**31)??0,name:r,categories:o?null:l.text,categoryNumbers:o?null:l.numbers,categoryFormat:l.formatCode,xValues:o?l.numbers:null,values:a.numbers??(a.text??[]).map(Mn),formatCode:a.formatCode,spPr:E(e,"spPr"),marker:Zr(E(e,"marker")),dLbls:E(e,"dLbls"),points:i,smooth:re(e,"smooth",!1),explosion:K(e,"explosion",0,400)??0,invertIfNegative:re(e,"invertIfNegative",!1),bubbleSizes:t==="bubble"?tt(E(e,"bubbleSize"),n).numbers??null:null,trendlines:oe(e,"trendline").slice(0,8),errorBars:oe(e,"errBars").slice(0,2),labelRange:nt(Jr(e),n)}}function bn(e,t){for(let n of e?.children??[])if(ee(n)&&n.local===t)return n;return null}function Jr(e){for(let t of oe(E(e,"extLst"),"ext")){let n=bn(bn(t,"datalabelsRange"),"dlblRangeCache");if(n)return n}return null}var eo=new Set(["clustered","stacked","percentStacked","standard"]);function to(e,t){let n=gn.get(e.local);if(!n)return null;let r=[];for(let a of oe(e,"ser")){if(r.length>=wt)return null;let i=qr(a,n.kind,t);if(!i||t.remaining<0)return null;r.push(i)}r.sort((a,i)=>a.order-i.order);let o=H(e,"grouping"),l=n.kind;return{kind:l,threeD:n.threeD,element:e,horizontal:l==="bar"&&H(e,"barDir")==="bar",grouping:o&&eo.has(o)?o:l==="bar"?"clustered":"standard",varyColors:re(e,"varyColors",l==="pie"||l==="doughnut"),gapWidth:K(e,"gapWidth",0,500)??150,overlap:K(e,"overlap",-100,100)??0,gapDepth:K(e,"gapDepth",0,500)??150,series:r,axisIds:oe(e,"axId").map(a=>Q(a.attrs,"val")??""),dLbls:E(e,"dLbls"),firstSliceAngle:K(e,"firstSliceAng",0,360)??0,holeSize:K(e,"holeSize",1,90)??50,markers:re(e,"marker",!0),scatterStyle:H(e,"scatterStyle")??null,radarStyle:H(e,"radarStyle")??null,hiLowLines:E(e,"hiLowLines"),upDownBars:E(e,"upDownBars"),bubbleScale:K(e,"bubbleScale",0,300)??100,bubbleArea:H(e,"sizeRepresents")!=="w",ofPie:l==="ofPie"?{type:H(e,"ofPieType")==="bar"?"bar":"pie",splitType:H(e,"splitType")??"auto",splitPos:K(e,"splitPos",-1e300,1e300),secondSize:K(e,"secondPieSize",5,200)??75,serLines:E(e,"serLines")}:null,wireframe:l==="surface"&&re(e,"wireframe",!1),bandFormats:l==="surface"?no(e):new Map}}function no(e){let t=new Map;for(let n of oe(E(e,"bandFmts"),"bandFmt").slice(0,wt)){let r=K(n,"idx",0,wt),o=E(n,"spPr");r!==null&&o&&t.set(r,o)}return t}var ro=new Set(["b","t","l","r"]);function oo(e){let t=e.local==="catAx"?"category":e.local==="valAx"?"value":e.local==="dateAx"?"date":e.local==="serAx"?"series":null;if(!t)return null;let n=H(e,"axId");if(!n)return null;let r=E(e,"scaling"),o=E(e,"numFmt"),l=H(e,"axPos"),a=K(e,"crossesAt",-1e300,1e300),i=H(e,"crosses"),s=H(e,"majorTickMark"),c=H(e,"minorTickMark"),u=H(e,"tickLblPos"),d=H(e,"crossBetween"),h=H(e,"baseTimeUnit");return{id:n,kind:t,element:e,deleted:re(e,"delete",!1),position:l&&ro.has(l)?l:"b",crossAxisId:H(e,"crossAx")??null,reversed:H(r,"orientation")==="maxMin",min:K(r,"min",-1e300,1e300),max:K(r,"max",-1e300,1e300),majorUnit:K(e,"majorUnit",1e-300,1e300),minorUnit:K(e,"minorUnit",1e-300,1e300),logBase:K(r,"logBase",2,1e3),formatCode:o?Q(o.attrs,"formatCode")??null:null,sourceLinked:o?Q(o.attrs,"sourceLinked")==="1":!0,majorGridlines:E(e,"majorGridlines"),minorGridlines:E(e,"minorGridlines"),majorTickMark:s==="none"||s==="in"||s==="out"||s==="cross"?s:"cross",minorTickMark:c==="none"||c==="in"||c==="out"||c==="cross"?c:"cross",tickLabelPosition:u==="low"||u==="high"||u==="none"?u:"nextTo",spPr:E(e,"spPr"),txPr:E(e,"txPr"),title:E(e,"title"),crosses:a!==null?a:i==="min"||i==="max"?i:"autoZero",crossBetween:d==="between"||d==="midCat"?d:null,tickLabelSkip:K(e,"tickLblSkip",1,32e3),baseTimeUnit:h==="days"||h==="months"||h==="years"?h:null}}function ot(e){let t=E(e,"manualLayout");if(!t)return null;let n=i=>K(t,i,-10,10),r=n("x"),o=n("y"),l=n("w"),a=n("h");return r===null||o===null||H(t,"xMode")==="factor"||H(t,"yMode")==="factor"?null:{inner:H(t,"layoutTarget")!=="outer",x:r,y:o,w:l??0,h:a??0}}function lo(e){if(!e)return null;let t=H(e,"legendPos"),n=new Set;for(let r of oe(e,"legendEntry")){let o=K(r,"idx",0,1e5);o!==null&&re(r,"delete",!1)&&n.add(o)}return{element:e,position:t==="b"||t==="t"||t==="l"||t==="tr"?t:"r",overlay:re(e,"overlay",!1),txPr:E(e,"txPr"),spPr:E(e,"spPr"),layout:ot(E(e,"layout")),deleted:n}}function ao(e){let t=K(e,"style",1,48);if(t!==null)return t;for(let n of e.children)if(!(!ee(n)||n.local!=="AlternateContent"))for(let r of n.children){if(!ee(r)||r.local!=="Fallback")continue;let o=K(r,"style",1,48);if(o!==null)return o}return 2}function Pn(e){let t=E(e,"chart"),n=E(t,"plotArea");if(!t||!n)return null;let r={remaining:Qr},o=[],l=new Map;for(let a of n.children){if(!ee(a)||a.ns!==vt)continue;if(gn.has(a.local)){if(o.length>=Yr)return null;let s=to(a,r);if(!s)return null;o.push(s);continue}let i=oo(a);i&&l.set(i.id,i)}return o.length===0?null:{chartSpace:e,date1904:re(e,"date1904",!1),style:ao(e),roundedCorners:re(e,"roundedCorners",!0),spPr:E(e,"spPr"),txPr:E(e,"txPr"),title:E(t,"title"),autoTitleDeleted:re(t,"autoTitleDeleted",!1),plotSpPr:E(n,"spPr"),plotLayout:ot(E(n,"layout")),plots:o,axes:l,legend:lo(E(t,"legend")),view3D:E(t,"view3D"),floor:E(t,"floor"),sideWall:E(t,"sideWall"),backWall:E(t,"backWall")}}var Rt=["January","February","March","April","May","June","July","August","September","October","November","December"],kn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function It(e){if(!Number.isFinite(e))return"";if(e===0)return"0";let t=Math.abs(e);if(t>=1e11||t<1e-9){let[o,l]=e.toExponential(5).split("e"),a=o.replace(/\.?0+$/,""),i=Number(l);return`${a}E${i<0?"-":"+"}${String(Math.abs(i)).padStart(2,"0")}`}let n=Math.max(0,10-Math.max(1,Math.floor(Math.log10(t))+1)),r=e.toFixed(Math.min(n,20));return r.includes(".")?r.replace(/\.?0+$/,""):r}function Sn(e){let t=[],n="",r=!1,o=!1;for(let l=0;l<e.length;l+=1){let a=e[l];if(a==="\\"&&!r&&l+1<e.length){n+=a+e[l+1],l+=1;continue}if(a==='"'?r=!r:!r&&a==="["?o=!0:!r&&a==="]"&&(o=!1),a===";"&&!r&&!o){t.push(n),n="";continue}n+=a}return t.push(n),t}function _n(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(r==='"'){let o=e.indexOf('"',n+1),l=o===-1?e.length:o;t.push({kind:"literal",text:e.slice(n+1,l)}),n=l}else if(r==="\\"&&n+1<e.length)t.push({kind:"literal",text:e[n+1]}),n+=1;else if(r==="_"&&n+1<e.length)t.push({kind:"literal",text:" "}),n+=1;else if(r==="*"&&n+1<e.length)n+=1;else if(r==="["){let o=e.indexOf("]",n+1),l=o===-1?e.length:o,a=e.slice(n+1,l);if(/^(?:h+|m+|s+)$/i.test(a))t.push({kind:"code",text:`[${a}]`});else if(a.startsWith("$")){let i=a.indexOf("-");t.push({kind:"literal",text:a.slice(1,i===-1?a.length:i)})}n=l}else"$-+/():!^&'~{}<>= ".includes(r)?t.push({kind:"literal",text:r}):t.push({kind:"code",text:r})}return t}function lt(e){return(e[0]==="["?e[1]:e[0]).toLowerCase()}function En(e){let t=!1,n="",r=!1;for(let o of e){if(o.kind!=="code")continue;let l=lt(o.text);if(l===".")r=n==="s";else{if(l==="0"&&r)continue;if(l==="0"||l==="#"||l==="?")return!1;r=!1}"ymdhs".includes(l)&&(t=!0),n=l}return t}function io(e){let t="";for(let n=0;n<e.length;n+=1)n>0&&(e.length-n)%3===0&&(t+=","),t+=e[n];return t}function so(e,t){let n=t.map(g=>g.kind==="code"?g.text:""),r=n.findIndex(g=>g==="E"||g==="e"),o=g=>g==="0"||g==="#"||g==="?",l=0,a=-1,i=-1,s=-1;for(let g=0;g<n.length&&!(r!==-1&&g>=r);g+=1){let M=n[g];M==="%"&&(l+=1),M==="."&&a===-1&&(a=g),o(M)&&(s===-1&&(s=g),i=g)}if(s===-1)return t.map(g=>g.kind==="literal"?g.text:"").join("");let c=e*100**Math.min(l,3),u=i+1;for(;u<n.length&&n[u]===",";)c/=1e3,u+=1;let d=a===-1?i+1:a,h=!1,m=0;for(let g=s;g<d;g+=1)n[g]===","&&(h=!0),n[g]==="0"&&(m+=1);let x=0,p=0;if(a!==-1)for(let g=a+1;g<=i;g+=1)o(n[g])&&(p+=1,n[g]==="0"&&(x=p));p=Math.min(p,30),x=Math.min(x,p);let y;if(r!==-1){let g=p,[M,L]=Math.abs(c).toExponential(g).split("e"),I=Number(L),k=t[r+1]?.text==="+"||t[r+1]?.text==="-",v=I<0?"-":t[r+1]?.text==="+"?"+":"",S=0;for(let U=r+(k?2:1);U<n.length&&o(n[U]);U+=1)S+=1;y=`${M}E${v}${String(Math.abs(I)).padStart(Math.max(1,S),"0")}`}else{let g=Math.abs(c).toFixed(p),[M,L=""]=g.split(".");for(;L.length>x&&L.endsWith("0");)L=L.slice(0,-1);M==="0"&&m===0&&(M=""),M=M.padStart(m,"0"),h&&(M=io(M)),y=a===-1?M:`${M}.${L}`}let T="",A="";for(let g=0;g<t.length;g+=1){let M=t[g],L=M.kind==="literal"?M.text:M.text==="%"?"%":"";g<s?T+=L:g>(r!==-1?n.length:i)&&M.text!==","&&(A+=L)}return T+y+A}function xe(e,t){return String(e).padStart(t,"0")}function co(e,t){if(!Number.isFinite(e)||e<0||e>2958465)return null;let n=t?e+1462:e<61?e+1:e,r=Math.round((n-25569)*864e5);return new Date(r)}function uo(e,t,n){let r=co(Math.abs(e),n);if(!r)return It(e);let o=[];for(let i of t){let s=o[o.length-1];s&&s.kind==="code"&&i.kind==="code"&&s.text[0]!=="["&&i.text[0]!=="["&&s.text[0].toLowerCase()===i.text.toLowerCase()?s.text+=i.text:o.push({kind:i.kind,text:i.text})}let l=t.some(i=>i.kind==="code"&&i.text.toLowerCase()==="a"),a="";for(let i=0;i<o.length;i+=1){let s=o[i];if(s.kind==="literal"){a+=s.text;continue}let c=s.text.toLowerCase(),u=lt(s.text),d=s.text.length;if(c[0]==="["){let h=u==="h"?24:u==="m"?1440:86400;a+=xe(Math.floor(Math.abs(e)*h+1e-9),d-2)}else if(u==="0"&&o[i-1]?.text==="."){let h=r.getUTCMilliseconds();a+=xe(Math.floor(h/10**(3-Math.min(d,3))),Math.min(d,3)).padEnd(d,"0")}else if(u==="y")a+=d<=2?xe(r.getUTCFullYear()%100,2):String(r.getUTCFullYear());else if(u==="d")d>=4?a+=kn[r.getUTCDay()]:d===3?a+=kn[r.getUTCDay()].slice(0,3):a+=d===2?xe(r.getUTCDate(),2):String(r.getUTCDate());else if(u==="m"){let h=o.slice(0,i).reverse().find(p=>p.kind==="code"),m=o.slice(i+1).find(p=>p.kind==="code");d<=2&&(h&&lt(h.text)==="h"||m&&lt(m.text)==="s")?a+=d===2?xe(r.getUTCMinutes(),2):String(r.getUTCMinutes()):d>=5?a+=Rt[r.getUTCMonth()][0]:d===4?a+=Rt[r.getUTCMonth()]:d===3?a+=Rt[r.getUTCMonth()].slice(0,3):a+=d===2?xe(r.getUTCMonth()+1,2):String(r.getUTCMonth()+1)}else if(u==="h"){let h=r.getUTCHours();l&&(h=h%12===0?12:h%12),a+=d>=2?xe(h,2):String(h)}else if(u==="s")a+=d>=2?xe(r.getUTCSeconds(),2):String(r.getUTCSeconds());else if(u==="a"){let h=r.getUTCHours()>=12,m=o[i+2]?.text.toLowerCase()==="p";for(a+=m?h?"P":"A":h?"PM":"AM";i+1<o.length&&/^[mp/]/i.test(o[i+1].text);)i+=1}else if(u==="e")a+=String(r.getUTCFullYear());else{if(u==="g"||u==="b")continue;a+=s.text}}return a}function ue(e,t,n=!1){if(!Number.isFinite(e))return"";if(!t||t.length>256||/^general$/i.test(t.trim()))return It(e);let r=Sn(t),o=r[0],l=e;if(e<0&&r.length>=2?(o=r[1],l=-e):e===0&&r.length>=3&&(o=r[2]),/^general$/i.test(o.trim()))return It(l);let a=_n(o);if(En(a))return uo(e,a,n);let i=so(l,a),s=/^[^1-9]*$/.test(i);return l<0&&!s?`-${i}`:i}function Ln(e){return!e||e.length>256||/^general$/i.test(e.trim())?!1:En(_n(Sn(e)[0]))}function at(e,t,n){let r=e.categoryNumbers?.[t];return r!=null&&e.categoryFormat?ue(r,e.categoryFormat,n):e.categories?.[t]??null}function An(e,t){if(e.logBase!==void 0){if(!(t>0))return 0;let n=Math.log(e.max/e.min)||1;return Math.log(t/e.min)/n}return(t-e.min)/(e.max-e.min||1)}function vn(e,t,n,r,o){let l=d=>Math.log(d)/Math.log(n),a=e>0?e:1,i=t>0?Math.max(t,a):a,s=r!==null&&r>0?r:n**Math.floor(l(a)+1e-9),c=o!==null&&o>0?o:n**Math.ceil(l(i)-1e-9);c>s||(c=s*n);let u=[];for(let d=0;d<=1e3;d+=1){let h=Number((s*n**d).toPrecision(12));if(h>c*(1+1e-9))break;u.push(h)}return{min:s,max:c,major:n,ticks:u,logBase:n}}function Tn(e){let t=10**Math.floor(Math.log10(e));return[1,2,5,10,20].map(n=>n*t)}function wn(e,t){return Number((Math.round(e/t)*t).toPrecision(12))}function it(e){let t=Number.isFinite(e.dataMin)?e.dataMin:0,n=Number.isFinite(e.dataMax)?e.dataMax:1;t>n&&([t,n]=[n,t]),e.fixedMin!==null&&(t=Math.min(t,e.fixedMin)),e.fixedMax!==null&&(n=Math.max(n,e.fixedMax)),t===n&&(n===0?n=1:n>0?t=0:n=0);let r=t,o=n;e.fixedMin===null&&t>=0&&(r=t>5/6*n?t-(n-t)/2:0),e.fixedMax===null&&n<=0&&(o=n<5/6*t?n+(n-t)/2:0);let l=e.noHeadroom?0:.05*(o-r),a=e.fixedMax??(o>0?o+l:o),i=e.fixedMin??(r<0?r-l:r),s=Math.max(a-i,Number.EPSILON),c=Math.max(1,Math.floor(e.lengthPt/Math.max(1,e.minIntervalPt))),u=e.fixedMajor??0;if(!(u>0)||s/u>1e3){u=0;let x=e.roomOnly===!0||e.fixedMin!==null&&e.fixedMax!==null,p=(e.fixedMax??o)-(e.fixedMin??r);for(let y of Tn(s/10)){let T=Math.ceil(a/y-1e-9)-Math.floor(i/y+1e-9),A=e.roomOnly?Math.min(c,10):c;if(T<=A&&(x||p/y<=9.5)){u=y;break}}u===0&&(u=Tn(s)[2])}let d=e.fixedMin??wn(Math.floor(i/u+1e-9)*u,u),h=e.fixedMax??wn(Math.ceil(a/u-1e-9)*u,u);h<=d&&(h=d+u);let m=[];for(let x=0;x<=1e3;x+=1){let p=Number((d+x*u).toPrecision(12));if(p>h+u*1e-9)break;m.push(p)}return{min:d,max:h,major:u,ticks:m}}var fo=1,ho=1.4;function Nt(e){return q(e)}function Me(e,t,n){let r=t.axisIds.map(o=>e.axes.get(o)).filter(o=>o!==void 0);if(t.kind==="scatter"||t.kind==="bubble"){let o=i=>i.position==="b"||i.position==="t",l=r.find(o)??r[0]??null,a=r.find(i=>i!==l)??null;return n==="value"?a:n==="x"?l:null}return n==="value"?r.find(o=>o.kind==="value")??null:r.find(o=>o.kind==="category"||o.kind==="date")??null}function st(e,t,n){let r=0,o=null,l=null,a=null;for(let x of t)for(let p of x.series)r=Math.max(r,p.values.length),!o&&p.categories&&(o=[...p.categories],l=p.categoryNumbers?[...p.categoryNumbers]:null,a=p.categoryFormat);let i=t.length>0?Me(e,t[0],"category"):null;o&&(r=Math.max(r,o.length)),r=Math.min(r,n);let c=(i&&!i.sourceLinked?i.formatCode:null)??a,u=l!==null&&(i?.kind==="date"||i?.kind!=="category"&&Ln(c))&&l.every(x=>x!==null),d=[];for(let x=0;x<r;x+=1){let p=l?.[x];p!=null&&c?d.push(ue(p,c,e.date1904)):d.push(o?.[x]??String(x+1))}let h=t.length>0?Me(e,t[0],"value"):null,m=h?.crossBetween==="midCat"||h?.crossBetween===null&&t.every(x=>x.kind==="area");return{axis:i,count:r,labels:d,serials:u?mo(l.slice(0,r),i,e.date1904):null,between:!m}}function mo(e,t,n){let r=a=>e.map(i=>{let s=n?i+1462:i<61?i+1:i,c=new Date(Math.round((s-25569)*864e5)),u=c.getUTCFullYear();return a==="years"?u:u*12+c.getUTCMonth()}),o=t?.baseTimeUnit??null;if(o==="days")return[...e];if(o!==null)return r(o);let l=new Set(e).size;for(let a of["years","months"]){let i=r(a);if(new Set(i).size===l)return i}return[...e]}function Ve(e,t,n,r){let o=r-n;if(e.serials&&e.serials.length>0){let l=Math.min(...e.serials),a=Math.max(...e.serials),i=Math.max(1,a-l+(e.between?1:0)),s=(e.serials[t]??l)-l+(e.between?.5:0);return n+s/i*o}return e.between?n+(t+.5)/Math.max(1,e.count)*o:e.count<=1?n+o/2:n+t/(e.count-1)*o}function ze(e,t){if(e.serials&&e.serials.length>1){let n=[...e.serials].sort((i,s)=>i-s),r=1/0;for(let i=1;i<n.length;i+=1){let s=n[i]-n[i-1];s>0&&(r=Math.min(r,s))}let o=n[0],l=n[n.length-1],a=Math.max(1,l-o+1);return Number.isFinite(r)?r/a*t:t/e.count}return t/Math.max(1,e.between?e.count:Math.max(1,e.count-1))}function $e(e,t,n=!1){let r=t.grouping==="stacked"||t.grouping==="percentStacked";if(t.grouping==="percentStacked"&&t.kind!=="scatter"&&t.kind!=="bubble"){e.percent=!0;let o=!1;for(let l of t.series)for(let a of l.values)a!==null&&a<0&&(o=!0);e.dataMin=Math.min(e.dataMin,o?-1:0),e.dataMax=Math.max(e.dataMax,1);return}if(r&&t.kind!=="scatter"&&t.kind!=="bubble"){let o=Math.max(0,...t.series.map(l=>l.values.length));for(let l=0;l<o;l+=1){let a=0,i=0,s=0;for(let c of t.series){let u=c.values[l]??0;t.kind==="bar"?u>=0?a+=u:i+=u:(s+=u,a=Math.max(a,s),i=Math.min(i,s))}e.dataMin=Math.min(e.dataMin,i),e.dataMax=Math.max(e.dataMax,a)}return}for(let o of t.series){let l=n?o.xValues??o.values.map((a,i)=>i+1):o.values;for(let a of l)a===null||!Number.isFinite(a)||(e.dataMin=Math.min(e.dataMin,a),e.dataMax=Math.max(e.dataMax,a))}}function He(e,t){let n=e.axis;return n&&!n.sourceLinked&&n.formatCode?n.formatCode:e.percent?"0%":t??n?.formatCode??null}function Rn(e,t,n,r,o,l=!1){let a=e.dataMin>e.dataMax,i=a?0:e.dataMin,s=a?1:e.dataMax,c=e.axis,u=e.percent,d=ue(Math.max(Math.abs(i),Math.abs(s)),e.formatCode,o),h=J(d,r);if(c?.logBase&&!u)return vn(i,s,c.logBase,c.min,c.max);let m=n?l?ho*r.sizePt:Nt(r):h+fo*r.sizePt,x=Math.floor(t/m)+(u?1:0);return it({dataMin:i,dataMax:s,lengthPt:Math.max(1,x)*m,minIntervalPt:m,fixedMin:c?.min??(u?i<0?-1:0:null),fixedMax:c?.max??(u?1:null),fixedMajor:c?.majorUnit??null,noHeadroom:l,roomOnly:l})}function Ot(e,t,n,r,o){let l=An(e,t);return o?r+(n-r)*l:n+(r-n)*l}var Ee=pe,po=16,yo=128,In={sizePt:10,bold:!1,italic:!1,underline:!1,colorHex:"000000",latin:"+mn-lt",eastAsian:"+mn-ea",complex:"+mn-cs"};function Nn(e,t,n){let r=n?{...In,themeFaces:n}:In;return De(r,Et(e.txPr),t)}function ie(e,t,n,r={}){return De({...e,...r},Et(t),n)}function Le(e,t,n,r,o){let l=E(e,"tx"),a=E(l,"rich");if(a){let s=[],c=0;for(let u of a.children){if(!ee(u)||u.ns!==Ee||u.local!=="p")continue;if(s.length>=po)break;let d=Z(u.children,{namespaceUri:Ee,localName:"pPr"}),h=d?Z(d.children,{namespaceUri:Ee,localName:"defRPr"}):null,m=De(t,h,r),x=[];for(let p of u.children){if(!ee(p)||p.ns!==Ee)continue;if(++c>yo)break;if(p.local==="br"){s.push(x),x=[];continue}if(p.local!=="r"&&p.local!=="fld")continue;let y=Z(p.children,{namespaceUri:Ee,localName:"rPr"}),T=Z(p.children,{namespaceUri:Ee,localName:"t"}),A="";for(let g of T?.children??[])g.type==="text"&&(A+=g.value);p.local==="fld"&&o&&(A=o(Q(p.attrs,"type"),A)),x.push({text:A,style:De(m,y,r)})}s.push(x)}if(s.some(u=>u.some(d=>d.text.trim()!=="")))return s}let i=E(E(l,"strRef"),"strCache");if(i){let s=oe(i,"pt")[0],c="";for(let u of E(s,"v")?.children??[])u.type==="text"&&(c+=u.value);if(c.trim()!=="")return[[{text:c,style:t}]]}return n?[[{text:n,style:t}]]:[]}function xo(e){let t=E(E(e,"layout"),"manualLayout"),n=i=>{let s=H(t,i),c=s!==void 0&&s.length<=32?Number(s):NaN;return Number.isFinite(c)&&Math.abs(c)<=10?c:null},r=n("x"),o=n("y");if(r===null&&o===null)return null;let l=H(t,"xMode")==="edge"&&r!==null,a=H(t,"yMode")==="edge"&&o!==null;return{x:r??0,y:o??0,xEdge:l,yEdge:a}}function Dt(e,t){if(re(e,"delete",!1))return null;let n=E(e,"numFmt"),r=n?Q(n.attrs,"sourceLinked")==="1":!0,o=t?.separator??null,l=E(e,"separator");if(l){let a="";for(let i of l.children)i.type==="text"&&(a+=i.value);o=a.slice(0,16)}return{showValue:re(e,"showVal",t?.showValue??!1),showPercent:re(e,"showPercent",t?.showPercent??!1),showCategory:re(e,"showCatName",t?.showCategory??!1),showSeries:re(e,"showSerName",t?.showSeries??!1),separator:o,position:H(e,"dLblPos")??t?.position??null,formatCode:n&&!r?Q(n.attrs,"formatCode")??null:t?.formatCode??null,txPr:E(e,"txPr")??t?.txPr??null,spPr:E(e,"spPr")??t?.spPr??null,custom:null,moved:null}}function Pe(e,t,n){let r=e.dLbls?Dt(e.dLbls,null):null,o=t.dLbls?Dt(t.dLbls,r):r,l=o;for(let s of oe(t.dLbls,"dLbl")){if(H(s,"idx")!==String(n))continue;let c=Dt(s,o??r);l=c&&{...c,custom:E(s,"tx")?s:null,moved:xo(s)};break}if(!l||!(l.showValue||l.showPercent||l.showCategory||l.showSeries)&&!l.custom)return null;let i=e.kind==="pie"||e.kind==="doughnut"||e.kind==="ofPie";return l.separator===null?{...l,separator:i?`
7
+ `:", "}:l}function ct(e,t,n){switch(n){case"VALUE":return ue(t.value,e.formatCode??t.seriesFormat,t.date1904);case"PERCENTAGE":return t.percent===null?"":ue(t.percent,e.formatCode&&e.formatCode.includes("%")?e.formatCode:"0%",t.date1904);case"CATEGORYNAME":return t.category??"";case"SERIESNAME":return t.seriesName??"";case"CELLRANGE":return t.cell??"";default:return null}}function ut(e,t){let n=[];return e.showSeries&&t.seriesName&&n.push(t.seriesName),e.showCategory&&t.category&&n.push(t.category),e.showValue&&n.push(ct(e,t,"VALUE")),e.showPercent&&t.percent!==null&&n.push(ct(e,t,"PERCENTAGE")),n.join(e.separator??", ")}var dt=class{components=[];points=0;ok=!0;path(t,n,r,o,l){if(!this.ok||!r&&!o)return;for(let s of t)for(let c of s)if(!Number.isFinite(c.x*12700)||!Number.isFinite(c.y*12700)){this.ok=!1;return}if(o&&o.dash&&!n&&!r){this.dashed(t,o,l);return}let a=t.filter(s=>s.length>=2);if(a.length===0)return;for(let s of a)this.points+=s.length;if(this.points>2e5){this.ok=!1;return}let i=o?Math.max(0,o.widthPt):0;this.components.push({subpaths:a,closed:n,fill:n?r:null,stroke:o&&i>0?{...o,widthPt:i}:null,...l?{join:l}:{}})}rect(t,n,r,o,l,a){let i=Math.min(t,t+r),s=Math.min(n,n+o),c=Math.max(t,t+r),u=Math.max(n,n+o);this.path([[{x:i,y:s},{x:c,y:s},{x:c,y:u},{x:i,y:u}]],!0,l,a)}line(t,n,r){n&&this.path([t],!1,null,n,r)}dashed(t,n,r){let o=Math.max(n.widthPt,.5),l=n.cap!=="butt",a=n.dash.map((s,c)=>{let u=s*o;return l?c%2===0?Math.max(.01,u-o):u+o:Math.max(.1,u)}),i=[];for(let s of t){let c=0,u=a[0],d=!0,h=[s[0]];for(let m=1;m<s.length;m+=1){let x=s[m-1],p=s[m],y=Math.hypot(p.x-x.x,p.y-x.y);for(;y>0&&i.length<2e3;){let T=Math.min(u,y),A=T/y,g={x:x.x+(p.x-x.x)*A,y:x.y+(p.y-x.y)*A};d&&h.push(g),y-=T,u-=T,x=g,u<=1e-9&&(d&&h.length>=2&&i.push(h),d=!d,c=(c+1)%a.length,u=a[c],h=[g])}}d&&h.length>=2&&i.push(h)}i.length>0&&this.path(i,!1,null,{...n,dash:null},r)}};function Ft(e,t,n,r,o=24){let l=[];for(let a=0;a<o;a+=1){let i=a/o*Math.PI*2;l.push({x:e+n*Math.cos(i),y:t+r*Math.sin(i)})}return l}function On(e,t,n,r,o,l){let a=Math.max(0,l-o);if(!Number.isFinite(a)||a>360+1e-6)throw new RangeError("Chart slice exceeds the angular limit");let i=Math.min(180,Math.max(2,Math.ceil(a/2))),s=(u,d)=>{let h=d*Math.PI/180;return{x:e+u*Math.sin(h),y:t-u*Math.cos(h)}},c=[];for(let u=0;u<=i;u+=1)c.push(s(n,o+a*u/i));if(r>0)for(let u=i;u>=0;u-=1)c.push(s(r,o+a*u/i));else a<360&&c.push({x:e,y:t});return c}function Bt(e,t=10){if(e.length<3)return[...e];let n=[e[0]];for(let r=0;r<e.length-1;r+=1){let o=e[Math.max(0,r-1)],l=e[r],a=e[r+1],i=e[Math.min(e.length-1,r+2)],s={x:l.x+(a.x-o.x)/6,y:l.y+(a.y-o.y)/6},c={x:a.x-(i.x-l.x)/6,y:a.y-(i.y-l.y)/6};for(let u=1;u<=t;u+=1){let d=u/t,h=1-d;n.push({x:h*h*h*l.x+3*h*h*d*s.x+3*h*d*d*c.x+d*d*d*a.x,y:h*h*h*l.y+3*h*h*d*s.y+3*h*d*d*c.y+d*d*d*a.y})}}return n}function Te(e,t,n,r){let o=r/2;switch(e){case"square":return[[{x:t-o,y:n-o},{x:t+o,y:n-o},{x:t+o,y:n+o},{x:t-o,y:n+o}]];case"diamond":return[[{x:t,y:n-o},{x:t+o,y:n},{x:t,y:n+o},{x:t-o,y:n}]];case"triangle":return[[{x:t,y:n-o},{x:t+o,y:n+o},{x:t-o,y:n+o}]];case"dash":return[[{x:t-o,y:n-r*.1},{x:t+o,y:n-r*.1},{x:t+o,y:n+r*.1},{x:t-o,y:n+r*.1}]];case"dot":return[[{x:t,y:n-r*.12},{x:t+r*.55,y:n-r*.12},{x:t+r*.55,y:n+r*.12},{x:t,y:n+r*.12}]];case"x":case"star":case"plus":return[];default:return[Ft(t,n,o,o,16)]}}function we(e,t,n,r){let o=r/2,l=[[{x:t-o,y:n-o},{x:t+o,y:n+o}],[{x:t-o,y:n+o},{x:t+o,y:n-o}]],a=[[{x:t-o,y:n},{x:t+o,y:n}],[{x:t,y:n-o},{x:t,y:n+o}]];return e==="x"?l:e==="plus"?a:e==="star"?[...l,a[1]]:[]}var Ae=pe,bo=12700,go=new Map([["dash",[4,3]],["dashDot",[4,3,1,3]],["dot",[1,3]],["lgDash",[8,3]],["lgDashDot",[8,3,1,3]],["lgDashDotDot",[8,3,1,3,1,3]],["sysDash",[3,1]],["sysDashDot",[3,1,1,1]],["sysDashDotDot",[3,1,1,1,1,1]],["sysDot",[1,1]]]);function Co(e,t){let n=Z(e.children,{namespaceUri:Ae,localName:"gsLst"}),r=0,o=0,l=0,a=0,i=0;for(let c of n?.children??[]){if(!ee(c)||c.local!=="gs"||i>=16)continue;let u=c.children.find(ee),d=u?ge(u,t):null;d&&(r+=Number.parseInt(d.hex.slice(0,2),16),o+=Number.parseInt(d.hex.slice(2,4),16),l+=Number.parseInt(d.hex.slice(4,6),16),a+=d.alpha,i+=1)}return i===0?null:{hex:[r,o,l].map(c=>Math.round(c/i).toString(16).padStart(2,"0")).join("").toUpperCase(),alpha:a/i}}function Dn(e,t){let n=ln(e,t);if(!n.present)return;if(n.color)return n.color;let r=Z(e.children,{namespaceUri:Ae,localName:"gradFill"});if(r)return Co(r,t);let o=Z(e.children,{namespaceUri:Ae,localName:"pattFill"});if(o){let a=Z(o.children,{namespaceUri:Ae,localName:"fgClr"})?.children.find(ee);return a?ge(a,t):null}return null}function ne(e,t){if(!e)return{fill:void 0,line:void 0};let n=Dn(e,t),r=Z(e.children,{namespaceUri:Ae,localName:"ln"});if(!r)return{fill:n,line:void 0};let o=Dn(r,t),l=on(Q(r.attrs,"w")),a=Q(r.attrs,"cap"),i=Z(r.children,{namespaceUri:Ae,localName:"prstDash"}),s=i?Q(i.attrs,"val"):void 0;return o===null?{fill:n,line:null}:{fill:n,line:o===void 0&&l===null&&s===void 0?void 0:{hex:o?.hex??"",alpha:o?.alpha??1,widthPt:l!==null?l/bo:.75,cap:a==="rnd"?"round":a==="sq"?"square":"butt",dash:s?go.get(s)??null:null}}}function ce(e,t){return e===null?null:e===void 0?t:e.hex!==""?e:t?{...e,hex:t.hex,alpha:t.alpha}:null}var Fn=[[],[["lumMod",6e4],["lumOff",4e4]],[["lumMod",6e4]],[["lumMod",8e4],["lumOff",2e4]],[["lumMod",8e4]],[["lumMod",5e4]],[["lumMod",7e4],["lumOff",3e4]],[["lumMod",7e4]],[["lumMod",5e4],["lumOff",5e4]]];function ft(e,t,n){let r=St("schemeClr",{val:e},t.map(([o,l])=>St(o,{val:String(l)})));return ge(r,n)}function Bn(e,t,n,r){let o=(e-1)%8|0,l;if(o===1){let a=t%6+1,i=Fn[Math.floor(t/6)%Fn.length];l=ft(`accent${a}`,i,r)}else{let a=o===0?"tx1":`accent${o-1}`,i=n>1?t/(n-1):.5,s=Math.round((n>1?.6+i*.8:1)*1e5),c=o===0?[["lumMod",Math.round((.2+i*.6)*1e5)],["lumOff",Math.round((.35+i*.4)*1e5)]]:s<=1e5?[["shade",s]]:[["tint",2e5-s]];l=ft(a,c,r)}return l??{hex:"4472C4",alpha:1}}var Un=["diamond","square","triangle","x","star","circle","plus","dot","dash"];function ht(e){return e.kind==="line"||e.kind==="scatter"||e.kind==="radar"&&e.radarStyle!=="filled"}function ke(e){return e.varyColors?e.kind==="pie"||e.kind==="doughnut"||e.kind==="ofPie"?!0:e.kind==="bar"&&e.series.length===1:!1}function Mo(e,t,n,r,o){if(!ht(e))return null;let l=t.marker,a=e.kind==="scatter"&&(e.scatterStyle==="line"||e.scatterStyle==="smooth");if(l?.symbol==="none")return null;let i=e.kind==="line"?e.markers:e.kind==="radar"?e.radarStyle==="marker":!a;if(!l?.symbol&&!i)return null;let s=l?.symbol??Un[o%Un.length],c=ne(l?.spPr??null,r.colors),u=c.fill===void 0?n:c.fill,d=ce(c.line,{...n,widthPt:.75,cap:"round",dash:null});return{symbol:s,size:l?.size??(l?.symbol?5:7),fill:u,line:d}}function de(e,t,n,r){let o=r!==void 0&&ke(e),l=o?r.index:t.index,a=o?r.count:n.seriesCount,i=Bn(n.model.style,l,a,n.colors),s=ne(t.spPr,n.colors),c=r?t.points.get(r.index):void 0,u=c?ne(E(c,"spPr"),n.colors):{fill:void 0,line:void 0},d=o?void 0:s.fill,h=ht(e),m=h?{...i,widthPt:2.25,cap:"round",dash:null}:null,x=h?null:u.fill!==void 0?u.fill:d!==void 0?d:i,p=ce(u.line!==void 0?u.line:s.line,m??(x?{...x,widthPt:.75,cap:"butt",dash:null}:null)),y=h||u.line!==void 0||s.line!==void 0?p:null,T=(h?y??null:x)??i;return{fill:x,line:y,marker:Mo(e,t,{hex:T.hex,alpha:T.alpha},n,l)}}var Po=pe,ko=12700,So=.2,_o=3,Eo=16;function zn(e,t){for(let n of[E(E(e.custom,"tx"),"rich"),e.txPr]){let r=n?Z(n.children,{namespaceUri:Po,localName:"bodyPr"}):null,o=r?Q(r.attrs,t):void 0;if(o!==void 0)return o}}function Vn(e,t){let n=zn(e,t);return n!==void 0&&/^\d{1,8}$/.test(n)?Number(n)/ko:_o}function Lo(e,t){return t===null||!(t>0)||zn(e,"wrap")==="none"?null:t*So-Vn(e,"lIns")-Vn(e,"rIns")}function To(e){let t=[];for(let n of e){let r=[];for(let o of n)for(let[l,a]of o.text.split(/\r\n|\r|\n/).entries())l>0&&(t.push(r),r=[]),a!==""&&r.push({text:a,style:o.style});t.push(r)}return t.slice(0,Eo)}function wo(e,t){let n=[];for(let s of e)for(let c of s.text.match(/\S+|\s+/g)??[]){let u=J(c,s.style);/^\s/.test(c)?n.length>0&&(n[n.length-1].space+=u):n.push({width:u,space:0})}if(n.length===0)return{count:1,widest:0,word:0};let r=1,o=0,l=0,a=0,i=0;for(let s of n)i=Math.max(i,s.width),l>0&&t!==null&&l+a+s.width>t?(o=Math.max(o,l),r+=1,l=s.width):l+=a+s.width,a=s.space;return{count:r,widest:Math.max(o,l),word:i}}function ve(e,t,n,r,o){let l=ut(e,t),a=e.custom?Le(e.custom,n,l,o,(m,x)=>ct(e,t,m)??x):[[{text:l,style:n}]],i=Lo(e,r),s=0,c=0,u=!1,d=0;for(let m of To(a)){let x=wo(m,i);s=Math.max(s,x.widest),d=Math.max(d,x.word),u||=x.count>1;let p=Math.max(q(n),...m.map(y=>q(y.style)));c+=x.count*p}let h=i!==null&&u?Math.max(i,d):s*1.3+n.sizePt*2;return{paragraphs:a,width:s,height:c,frame:h}}function mt(e,t,n,r,o,l){if(!e||!t)return{x:n,y:r,moved:!1};let a=t.r-t.l,i=t.b-t.t;return{x:e.xEdge?t.l+e.x*a+o/2:n+e.x*a,y:e.yEdge?t.t+e.y*i+l/2:r+e.y*i,moved:!0}}var Ao={hex:"FFFFFF",alpha:1};function Wn(e,t,n,r,o,l){let{scene:a}=o,i=o.look,s=r.categories?.count??0,c=e.grouping==="percentStacked",u=e.grouping==="stacked"||c,d=[];if(c)for(let p=0;p<s;p+=1){let y=0;for(let T of e.series)y+=Math.abs(T.values[p]??0);d.push(y||1)}let h=(p,y)=>c?p/d[y]:p,m=(p,y)=>r.horizontal?{x:r.valueAt(t,y),y:r.categoryAt(p)}:{x:r.categoryAt(p),y:r.valueAt(t,y)},x=(p,y,T,A,g)=>{let M=Pe(e,p,y);if(!M)return;let L=ie(o.baseText,M.txPr,i.colors),I=r.categories?.labels[y]??null,k={value:T,percent:c?T/d[y]:null,category:I,seriesName:p.name,seriesFormat:p.formatCode,date1904:o.model.date1904,cell:p.labelRange?.[y]??null};if(!M.custom&&ut(M,k)==="")return;let v=ve(M,k,L,o.chartWidth,i.colors),S=v.width,U=v.height,z=v.frame,_=.48*L.sizePt,O=A.x,D=A.y;if(g.kind==="bar"){let P=M.position??(u?"ctr":"outEnd"),{start:b,end:w}=g,N=Math.sign(w.x-b.x)||1,C=Math.sign(w.y-b.y)||-1;if(P==="ctr")O=(b.x+w.x)/2,D=(b.y+w.y)/2;else if(r.horizontal)O=P==="inBase"?b.x+N*(_+S/2):P==="inEnd"?w.x-N*(_+S/2):w.x+N*(_+S/2),D=w.y;else{let R=P==="inBase"?b.y+C*(_+U/2):P==="inEnd"?w.y-C*(_+U/2):w.y+C*(_+U/2);O=w.x,D=R}}else{let P=M.position??(e.kind==="area"?"ctr":"r"),b=g.markerHalf+_;P==="r"?O=A.x+b+S/2:P==="l"?O=A.x-b-S/2:P==="t"?D=A.y-b-U/2:P==="b"&&(D=A.y+b+U/2)}let V={l:0,t:0,r:o.chartWidth,b:o.chartHeight},f=mt(M.moved,V,O,D,S,U);l.push({paragraphs:v.paragraphs,align:"ctr",x:f.x-z/2,y:f.y-U/2,width:z,height:U,rotation:0})};if(e.kind==="bar"&&r.categories){let p=r.horizontal?r.plot.b-r.plot.t:r.plot.r-r.plot.l,y=ze(r.categories,p),T=e.gapWidth/100,A=u?1:e.series.length,g=u?1:e.overlap/100,M=y/(A-(A-1)*g+T),L=[],I=[];for(let[k,v]of e.series.entries()){let S=ke(e),U=de(e,v,i),z=[];for(let _=0;_<Math.min(s,v.values.length);_+=1){let O=v.values[_];if(O==null)continue;let D=h(O,_),V=n,f=D;if(u){let Y=D>=0?L:I;V=Y[_]??0,f=V+D,Y[_]=f}let P=r.categoryAt(_),b=-y/2+T*M/2+(u?0:k*M*(1-g)),w=r.horizontal?P-b:P+b,N=r.horizontal?w-M:w+M,C=r.valueAt(t,V),R=r.valueAt(t,f),F=S||v.points.has(_)?de(e,v,i,{index:_,count:v.values.length}):U,W=v.invertIfNegative&&D<0?Ao:F.fill;r.horizontal?(a.rect(Math.min(C,R),Math.min(w,N),Math.abs(R-C),M,W,F.line),z.push({index:_,start:{x:C,y:(w+N)/2},end:{x:R,y:(w+N)/2},value:O})):(a.rect(Math.min(w,N),Math.min(C,R),M,Math.abs(R-C),W,F.line),z.push({index:_,start:{x:(w+N)/2,y:C},end:{x:(w+N)/2,y:R},value:O}))}for(let _ of z)x(v,_.index,_.value,_.end,{kind:"bar",start:_.start,end:_.end})}return}if((e.kind==="line"||e.kind==="area")&&r.categories){let p=[],y=null;for(let T of e.series){let A=de(e,T,i),g=[],M=[];for(let L=0;L<s;L+=1){let I=T.values[L]??null;if(I===null&&(o.blanks==="zero"||e.kind==="area"||u)&&(I=0),I===null){g.push(null),M.push(0);continue}let k=h(I,L);u&&(k+=p[L]??0,p[L]=k),M.push(I),g.push(m(L,k))}if(e.kind==="area"){let L=g.filter(k=>k!==null),I=y??L.map(k=>r.horizontal?{x:r.valueAt(t,n),y:k.y}:{x:k.x,y:r.valueAt(t,n)});L.length>=2&&a.path([[...L,...[...I].reverse()]],!0,A.fill,A.line),u&&(y=L)}else{let L=[],I=[];for(let k of g){if(k===null){o.blanks!=="span"&&(I.length&&L.push(I),I=[]);continue}I.push(k)}if(I.length&&L.push(I),A.line)for(let k of L)a.line(T.smooth?Bt(k):k,A.line,"round");$n(g,A.marker,a)}for(let[L,I]of g.entries())I&&x(T,L,M[L],I,{kind:"point",markerHalf:A.marker?A.marker.size/2:0})}e.kind==="line"&&Io(e,t,r,o);return}if(e.kind==="scatter"&&r.xInfo?.scale)for(let p of e.series){let y=de(e,p,i),T=[];for(let M=0;M<p.values.length;M+=1){let L=p.values[M],I=p.xValues?p.xValues[M]:M+1;if(L==null||I===null||I===void 0){T.push(null);continue}T.push({x:r.valueAt(r.xInfo,I),y:r.valueAt(t,L)})}let A=T.filter(M=>M!==null);if(y.line!==null&&e.scatterStyle!=="marker"&&e.scatterStyle!=="none"&&A.length>=2){let M=p.smooth||e.scatterStyle==="smooth"||e.scatterStyle==="smoothMarker";a.line(M?Bt(A):A,y.line,"round")}$n(T,y.marker,a);for(let[M,L]of T.entries())L&&x(p,M,p.values[M],L,{kind:"point",markerHalf:y.marker?y.marker.size/2:0})}}function $n(e,t,n){if(!t)return;let r=t.size*.96,o=[],l=[];for(let a of e)if(a){for(let i of Te(t.symbol,a.x,a.y,r))o.push(i);for(let i of we(t.symbol,a.x,a.y,r))l.push(i)}o.length>0&&n.path(o,!0,t.fill,t.line),l.length>0&&n.path(l,!1,null,t.line)}var Hn={hex:"000000",alpha:1,widthPt:.75,cap:"butt",dash:null},vo={hex:"FFFFFF",alpha:1},Ro={hex:"000000",alpha:1};function Io(e,t,n,r){let o=n.categories;if(!o||e.series.length<2)return;let l=r.look.colors,a=(s,c)=>n.horizontal?{x:n.valueAt(t,c),y:n.categoryAt(s)}:{x:n.categoryAt(s),y:n.valueAt(t,c)};if(e.hiLowLines){let s=ce(ne(E(e.hiLowLines,"spPr"),l).line,Hn),c=[];for(let u=0;u<o.count;u+=1){let d=e.series.map(h=>h.values[u]).filter(h=>h!=null);d.length<2||c.push([a(u,Math.min(...d)),a(u,Math.max(...d))])}s&&c.length>0&&r.scene.path(c,!1,null,s)}let i=e.upDownBars;if(i){let s=(Number(H(i,"gapWidth")??150)||150)/100,u=ze(o,n.horizontal?n.plot.b-n.plot.t:n.plot.r-n.plot.l)/(1+s),d=(y,T)=>{let A=ne(E(E(i,y),"spPr"),l);return{fill:A.fill===void 0?T:A.fill,line:ce(A.line,Hn)}},h=d("upBars",vo),m=d("downBars",Ro),x=e.series[0],p=e.series[e.series.length-1];for(let y=0;y<o.count;y+=1){let T=x.values[y],A=p.values[y];if(T==null||A===null||A===void 0)continue;let g=a(y,T),M=a(y,A),L=A>=T?h:m;n.horizontal?r.scene.rect(Math.min(g.x,M.x),g.y-u/2,Math.abs(M.x-g.x),u,L.fill,L.line):r.scene.rect(g.x-u/2,Math.min(g.y,M.y),u,Math.abs(M.y-g.y),L.fill,L.line)}}}var No=4096,Oo=3.1,Do=2.3,zt=5e3,We=.08,Gn=.91,Re=.64,Ut=4.5,Fo=6.5,Bo=.05,Qn={hex:"000000",alpha:1,widthPt:.5,cap:"butt",dash:null};function le(e){return e==="l"||e==="r"}function Uo(e,t){if(!e)return null;let n=ne(e.spPr,t.look.colors);return ce(n.line,Qn)}function Vo(e,t){if(!e)return null;let n=ne(E(e,"spPr"),t.look.colors);return ce(n.line,Qn)}function Vt(e,t){let n=e.value;return n.scale?n.scale.ticks.map(r=>ue(Math.abs(r)<n.scale.major*1e-9?0:r,n.formatCode,t.date1904)):[]}function Xn(e,t){let n=0;for(let r of e)n=Math.max(n,J(r,t));return n}function jn(e,t,n){let r=J(" ",t),o=1,l=0;for(let a of e.split(/\s+/).slice(0,256)){let i=J(a,t);l>0&&l+r+i>n?(o+=1,l=i):l+=(l>0?r:0)+i}return o}function Zn(e,t,n){let{model:r}=n,o=f=>f.kind==="scatter"||f.kind==="bubble",l=e.filter(o),a=e.filter(f=>!o(f));if(l.length>0&&a.length>0)return!1;let i=a.some(f=>f.kind==="bar"&&f.horizontal);if(i&&a.some(f=>f.kind!=="bar"||!f.horizontal))return!1;let s=n.look.colors,c=new Map,u=f=>{let P=f?.id??"",b=c.get(P);return b||(b={axis:f,id:P,dataMin:1/0,dataMax:-1/0,percent:!1,scale:null,formatCode:null},c.set(P,b)),b},d=new Map,h=null;for(let f of e){let P=u(Me(r,f,"value"));if($e(P,f),P.formatCode??=f.series.find(b=>b.formatCode)?.formatCode??null,d.set(f,P),o(f)){let b=Me(r,f,"x");h??={axis:b,id:`x:${b?.id??""}`,dataMin:1/0,dataMax:-1/0,percent:!1,scale:null,formatCode:null},$e(h,f,!0)}}for(let f of c.values())f.formatCode=He(f,f.formatCode);h&&(h.formatCode=He(h,null));let m=a.length>0?st(r,a,No):null,x=[],p=f=>ie(n.baseText,f?.txPr??null,s),y=f=>f!==null&&!f.deleted,T=f=>y(f)&&f.tickLabelPosition!=="none";if(m){let f=m.axis;x.push({axis:f,role:"category",side:i?f?.position==="r"?"r":"l":f?.position==="t"?"t":"b",style:p(f),labelled:T(f),value:null,title:null})}else h&&x.push({axis:h.axis,role:"x",side:h.axis?.position==="t"?"t":"b",style:p(h.axis),labelled:T(h.axis),value:h,title:null});let A=!0;for(let f of c.values()){let P=f.axis,b=i?A?"b":"t":A?"l":"r",w=P?.position??b;x.push({axis:P,role:"value",side:i?w==="t"?"t":"b":w==="r"?"r":"l",style:p(P),labelled:T(P),value:f,title:null}),A=!1}for(let f of x){if(!y(f.axis)||!f.axis.title)continue;let P=ie(n.baseText,E(f.axis.title,"txPr"),s,{bold:!0}),b=Le(f.axis.title,P,"Axis Title",s);if(b.length===0)continue;let w=E(E(f.axis.title,"tx"),"rich");f.title={paragraphs:b,style:P,rotation:Fe(w??E(f.axis.title,"txPr"))}}let g=x.find(f=>f.role==="category")??null,M=r.plotLayout,L=x.find(f=>f.role==="value")??null,I=()=>{if(M&&M.inner){let C=n.chartWidth,R=n.chartHeight;return{plot:{l:M.x*C,t:M.y*R,r:(M.x+M.w)*C,b:(M.y+M.h)*R},categoryRotation:0,categorySkip:1,categoryWrap:0}}let f=M&&!M.inner?{l:M.x*n.chartWidth,t:M.y*n.chartHeight,r:(M.x+M.w)*n.chartWidth,b:(M.y+M.h)*n.chartHeight}:{...t};for(let C of x){if(!C.title)continue;let R=Ue(C.title.paragraphs,C.title.style)+9;C.side==="l"?f.l+=R:C.side==="r"?f.r-=R:C.side==="t"?f.t+=R:f.b-=R}for(let C of x){if(!C.labelled||!le(C.side))continue;let R=C.value?Vt(C,r):m?.labels??[],F=C.value?ue(C.value.dataMax>-1/0?C.value.dataMax:1,C.value.formatCode,r.date1904):"",W=Xn(R.length?R:[F],C.style)+Gn*C.style.sizePt-Ut;C.side==="l"?f.l+=W:f.r-=W}let P=0;for(let C of x){if(!C.labelled||!C.value||!le(C.side))continue;let R=q(C.style)/2+We*C.style.sizePt,F=Fo+Bo*C.style.sizePt;P=Math.max(P,R-F)}f.t+=P;let b=0,w=1,N=0;for(let C of x){if(!C.labelled||le(C.side))continue;let R=C.style.sizePt,F=q(C.style)+Re*R-Ut;if(C.role==="category"&&m){let W=ze(m,f.r-f.l),Y=Xn(m.labels,C.style),G=Fe(C.axis?.txPr??null),te=m.labels.every($=>$.split(/\s+/).slice(0,256).every(j=>J(j,C.style)<=W*.98));if(G!==null&&G!==0?b=G:Y>W*.98&&m.count>1&&(te?N=W:b=-45),N>0){let $=Math.max(...m.labels.map(j=>jn(j,C.style,N)));F+=($-1)*q(C.style)}if(b!==0){let $=Math.abs(b)*Math.PI/180;F=Y*Math.sin($)+q(C.style)*Math.cos($)+Re*R-Ut;let j=q(C.style)/Math.sin($);w=Math.max(1,Math.ceil(j/Math.max(W,1e-6)))}C.axis?.tickLabelSkip&&(w=C.axis.tickLabelSkip),L?.value?.scale&&Kn(C,L.value.scale)&&(F=0)}C.side==="t"?f.t+=F:f.b-=F}for(let C of x){if(!C.labelled||le(C.side)||!C.value)continue;let R=Vt(C,r);R.length>0&&(f.r-=J(R[R.length-1],C.style)/2)}return{plot:f,categoryRotation:b,categorySkip:w,categoryWrap:N}},k=f=>{for(let P of x){if(!P.value)continue;let b=le(P.side)?f.b-f.t:f.r-f.l;P.value.scale=Rn(P.value,Math.max(1,b),le(P.side),P.style,r.date1904)}},v=I();k(v.plot),v=I(),k(v.plot);let S=v.plot;if(!(S.r-S.l>1)||!(S.b-S.t>1))return!0;let U=g?.axis?.reversed??!1,z=f=>m?i?U?Ve(m,f,S.t,S.b):Ve(m,f,S.b,S.t):U?Ve(m,f,S.r,S.l):Ve(m,f,S.l,S.r):0,_=(f,P)=>{let b=f.scale,w=f.axis?.reversed??!1;return i||f===h?Ot(b,P,S.l,S.r,w):Ot(b,P,S.b,S.t,w)},O=(f,P)=>{let b=P?.crosses??"autoZero";if(b==="min")return f.min;if(b==="max")return f.max;let w=typeof b=="number"?b:0;return Math.min(f.max,Math.max(f.min,w))},D=ne(r.plotSpPr,s);n.scene.rect(S.l,S.t,S.r-S.l,S.b-S.t,D.fill??null,D.line??null);for(let f of x)if(!(!f.axis||f.axis.deleted&&!f.axis.majorGridlines))for(let[P,b]of[[f.axis.minorGridlines,!0],[f.axis.majorGridlines,!1]]){let w=Vo(P,n);if(!w)continue;let N=[];if(f.value?.scale){let C=f.value.scale;for(let R of zo(C,b,Yn(C,f.axis))){let F=_(f.value,R);N.push(le(f.side)?[{x:S.l,y:F},{x:S.r,y:F}]:[{x:F,y:S.t},{x:F,y:S.b}])}}else if(m&&!b){let C=m.between?m.count+1:m.count;for(let R=0;R<C;R+=1){let F=m.between?z(R)-(z(1)-z(0))/2:z(R);N.push(le(f.side)?[{x:S.l,y:F},{x:S.r,y:F}]:[{x:F,y:S.t},{x:F,y:S.b}])}}N.length>0&&n.scene.path(N,!1,null,w)}let V=[];for(let f of e){let P=d.get(f);if(!P.scale)continue;let b=O(P.scale,g?.axis??null);Wn(f,P,b,{categoryAt:z,valueAt:_,categories:m,horizontal:i,xInfo:h,plot:S},n,V)}for(let f of x){if(!y(f.axis))continue;let P=Uo(f.axis,n);if(!P)continue;let b;if(f.role==="category"||f.role==="x"){let $=L?.value;b=$?.scale?_($,O($.scale,f.axis)):le(f.side)?S.l:S.b}else{let j=f.axis.crosses==="max";b=le(f.side)?f.side==="r"||j?S.r:S.l:f.side==="t"||j?S.t:S.b,h?.scale&&f.value!==h&&!i&&(b=_(h,O(h.scale,f.axis)))}let w=le(f.side)?[{x:b,y:S.t},{x:b,y:S.b}]:[{x:S.l,y:b},{x:S.r,y:b}];n.scene.line(w,P);let N=f.axis.majorTickMark,C=f.side==="l"||f.side==="t"?-1:1,R=[];if(f.value?.scale)for(let $ of f.value.scale.ticks)R.push(_(f.value,$));else if(m){let $=m.between?m.count+1:m.count;for(let j=0;j<$;j+=1)R.push(m.between?z(j)-(z(1)-z(0))/2:z(j))}let F=($,j)=>ae=>{let fe=$==="cross"?-j:0,se=$==="in"?-j:j;return le(f.side)?[{x:b+C*fe,y:ae},{x:b+C*se,y:ae}]:[{x:ae,y:b+C*fe},{x:ae,y:b+C*se}]},W=f.axis.minorTickMark,Y=[],G=f.value?.scale,te=G?Yn(G,f.axis):0;if(W!=="none"&&G&&G.logBase===void 0&&te>0){let $=Math.min(zt,Math.floor((G.max-G.min)/te+1e-9));for(let j=0;j<=$;j+=1)Y.push(_(f.value,G.min+j*te))}else if(W!=="none"&&!G&&m?.between)for(let $=0;$<Math.min(m.count,zt);$+=1)Y.push(z($));Y.length>0&&n.scene.path(Y.map(F(W,Do)),!1,null,P),!(N==="none"||R.length===0)&&n.scene.path(R.map(F(N,Oo)),!1,null,P)}for(let f of V)n.labels.push(f);for(let f of x){if(!f.labelled)continue;let P=f.style.sizePt,b=q(f.style),w=Gn*P;if(f.value?.scale){let C=Vt(f,r);for(let[R,F]of f.value.scale.ticks.entries()){let W=C[R],G=J(W,f.style)*1.3+P*2,te=_(f.value,F);if(le(f.side)){let $=f.side==="l";n.labels.push({paragraphs:[[{text:W,style:f.style}]],align:$?"r":"l",x:$?S.l-w-G:S.r+w,y:te-b/2-We*P,width:G,height:b,rotation:0})}else{let $=f.side==="b"?S.b+Re*P:S.t-Re*P-b;n.labels.push({paragraphs:[[{text:W,style:f.style}]],align:"ctr",x:te-G/2,y:$,width:G,height:b,rotation:0})}}continue}if(!m)continue;let N=L?.value?.scale&&Kn(f,L.value.scale)?_(L.value,O(L.value.scale,f.axis)):null;for(let C=0;C<m.count;C+=v.categorySkip){let R=m.labels[C];if(R==="")continue;let W=J(R,f.style)*1.3+P*2,Y=z(C);if(le(f.side)){let fe=N??(f.side==="l"?S.l:S.r),se=f.side==="l";n.labels.push({paragraphs:[[{text:R,style:f.style}]],align:se?"r":"l",x:se?fe-w-W:fe+w,y:Y-b/2-We*P,width:W,height:b,rotation:0});continue}let G=N??(f.side==="b"?S.b:S.t),te=f.side==="b"?G+Re*P:G-Re*P-b;if(v.categoryRotation!==0){let fe=v.categoryRotation*Math.PI/180,se=W/2,be=Y,Ne=te+b/2,Ze=be-se*Math.cos(fe),qe=Ne-se*Math.sin(fe);n.labels.push({paragraphs:[[{text:R,style:f.style}]],align:"r",x:Ze-se,y:qe-b/2,width:W,height:b,rotation:v.categoryRotation});continue}let $=v.categoryWrap,j=$>0?jn(R,f.style,$):1,ae=$>0?$:W;n.labels.push({paragraphs:[[{text:R,style:f.style}]],align:"ctr",x:Y-ae/2,y:f.side==="b"?te:te-(j-1)*b,width:ae,height:b*j,rotation:0})}}for(let f of x){if(!f.title)continue;let P=f.title.style,b=Ue(f.title.paragraphs,P),N=et(f.title.paragraphs)*1.3+P.sizePt*2;if(le(f.side)){let C=f.title.rotation??-90,R=f.side==="l"?t.l+1.5+b/2:t.r-1.5-b/2,F=(S.t+S.b)/2,W=Math.abs(Math.abs(C)-90)<1;n.labels.push({paragraphs:f.title.paragraphs,align:"ctr",x:R-N/2,y:F-b/2,width:N,height:b,rotation:C})}else{let C=f.side==="b"?t.b-1.4-b:t.t+1.5;n.labels.push({paragraphs:f.title.paragraphs,align:"ctr",x:(S.l+S.r)/2-N/2,y:C,width:N,height:b,rotation:f.title.rotation??0})}}return!0}function Kn(e,t){return e.role!=="category"||e.axis?.tickLabelPosition!=="nextTo"||e.axis.crosses!=="autoZero"?!1:t.min<0&&t.max>0}function Yn(e,t){let n=t.minorUnit;return n!==null&&n>0&&(e.max-e.min)/n<=zt?n:e.major>0?e.major/5:0}function zo(e,t,n){let r=[];if(e.logBase!==void 0){if(!t)return[...e.ticks];let l=Math.min(Math.floor(e.logBase),100);for(let a of e.ticks)for(let i=2;i<l&&r.length<1e3;i+=1)a*i<e.max&&r.push(a*i);return r}let o=t?n:e.major;if(!(o>0))return r;for(let l=0,a=e.min;a<=e.max+o*1e-9&&l<1e3;l+=1,a=e.min+l*o)r.push(a);return r}var qn=256;function er(e,t,n){let r=[],o=t.position==="l"||t.position==="r"||t.position==="tr";for(let l of e.plots){let a=[],i=ht(l),s=e.plots.length===1&&l.series.length===1,c=ke(l);if(c||s&&l.series[0].points.size>0&&!i){let u=l.series[0],d=u.values.length;for(let h=0;h<d&&h<qn;h+=1){let m=at(u,h,e.date1904)??String(h+1),x=c||u.points.has(h)?{index:h,count:d}:void 0;a.push({text:m,look:de(l,u,n,x),line:i,point:!0})}}else{for(let u of l.series){if(a.length>=qn)break;a.push({text:u.name??`Series${u.index+1}`,look:de(l,u,n),line:i,round:l.kind==="bubble"})}$o(l,o)&&a.reverse()}for(let u of a)r.push(u)}return r.filter((l,a)=>!t.deleted.has(a))}function $o(e,t){let n=e.grouping==="stacked"||e.grouping==="percentStacked";return e.kind==="bar"&&e.horizontal?e.grouping==="clustered":t?n&&(e.kind==="bar"||e.kind==="area"||e.kind==="line"):!1}function Ge(e,t){if(e.line&&e.look.line){let l=6.43+.386*t;return{key:Jn,text:Jn+2.03,after:l,shift:1.76,gap:15.66}}let n=.55*t,r=n+Math.max(0,.275*t-.4),o=(e.point?1.615:1.65)*t-r;return{key:n,text:r,after:o,shift:.55+.138*t,gap:13.25+n/2}}var Jn=19.2,Ho=5.85,$t=.27;function Wo(e){return 9+.6045*e}function Go(e){return 14.2+.59*e}var Se=11,Xo=16.5;function tr(e,t,n,r,o,l){let a=n.sizePt,i=q(n),s={...l},c=[],u=Lt(n);if(t.length===0)return{layout:{items:c},plot:s};let d=e.layout;if(e.position==="b"||e.position==="t"){let k=r-20,v=[[]],S=0;for(let f of t){let P=Ge(f,a),b=P.text+J(f.text,n),w=v[v.length-1],N=w.length>0?w[w.length-1].after:0;S+N+b>k&&w.length>0?(v.push([]),S=0):S+=N,S+=b,v[v.length-1].push({entry:f,width:b,after:P.after})}let U=1.84*a,z=Wo(a),_=e.position==="b"?o-z-(v.length-1)*U:l.t-Se+z,O=Ge(t[0],a).shift,D=_+(v.length-1)*U,V=d?d.y*o:null;for(let[f,P]of v.entries()){let b=P.reduce((C,R,F)=>C+R.width+(F>0?P[F-1].after:0),0),w=d?d.x*r:r/2+O-b/2,N=V===null?_+f*U+$t*a:V+f*U+u;for(let C of P)c.push({entry:C.entry,x:w,baseline:N}),w+=C.width+C.after}if(!e.overlay&&!d){let f=Go(a);e.position==="b"?s.b=Math.min(s.b,_-f):s.t=Math.max(s.t,D+f)}return{layout:{items:c},plot:s}}let h=i+Ho,m=Math.max(...t.map(k=>J(k.text,n))),x=Math.max(...t.map(k=>Ge(k,a).text)),p=d&&d.h>0?d.h*o:o-20,y=Math.max(1,Math.floor((p-i)/h)+1),T=t.slice(0,y),A=i+(T.length-1)*h,g=d?d.x*r:e.position==="l"?10.7:r-10-m-x,M=(l.t+o-Se)/2,L=d?d.y*o+Math.max(0,(p-A)/2):e.position==="tr"?l.t:M-A/2,I=!d&&e.position!=="tr";for(let[k,v]of T.entries()){let S=I?M+(k-(T.length-1)/2)*h+$t*a:L+k*h+u;c.push({entry:v,x:g,baseline:S})}if(!e.overlay&&!d)if(e.position==="l")s.l=Math.max(s.l,g+x+m+Xo);else{let k=Math.max(...t.map(v=>Ge(v,a).gap));s.r=Math.min(s.r,g-k)}return{layout:{items:c},plot:s}}function nr(e,t,n,r){let o=t.sizePt,l=q(t);for(let a of e.items){let{entry:i}=a,s=Ge(i,o),c=a.baseline-$t*o;if(i.line){i.look.line&&n.line([{x:a.x,y:c},{x:a.x+s.key,y:c}],i.look.line,"round");let h=i.look.marker;if(h){let m=a.x+s.key/2;n.path(Te(h.symbol,m,c,h.size*.96),!0,h.fill,h.line);for(let x of we(h.symbol,m,c,h.size*.96))n.line(x,h.line)}}else if(i.round){let h=s.key/2;n.path([Ft(a.x+h,c,h,h)],!0,i.look.fill,i.look.line)}else{let h=s.key/2;n.rect(a.x,c-h,s.key,s.key,i.look.fill,i.look.line)}let u=a.x+s.text,d=J(i.text,t);r.push({paragraphs:[[{text:i.text,style:t}]],align:"l",x:u,y:a.baseline-Lt(t),width:d*1.3+o*2,height:l,rotation:0})}}function jo(e,t,n){let r=e.series[t],o=r.points.get(n),l=o?H(o,"explosion"):void 0,a=l!==void 0&&/^\d{1,3}$/.test(l)?Number(l):NaN;return a>=0&&a<=400?a:r.explosion}var rr=.85,or=.5,lr=.16,Ko=.75;function Yo(e){return e*Qo+Zo}var Qo=.123,Zo=3.5,pt=10,ar={hex:"A6A6A6",alpha:1,widthPt:.75,cap:"butt",dash:null};function qo(e,t){let r=E(e,"leaderLines");if(!r)for(let l of oe(E(e,"extLst"),"ext"))for(let a of l.children)ee(a)&&a.local==="leaderLines"&&(r=a);let o=ne(E(r,"spPr"),t.look.colors);return ce(o.line,ar)??ar}function Jo(e,t,n){return((e-t)%360+360)%360<=n}function el(e,t,n,r,o){if(o.sweep>=359.9)return!0;for(let[l,a]of[[-1,-1],[1,-1],[1,1],[-1,1]]){let i=e+l*n*rr/2-o.cx,s=t+a*r*rr/2-o.cy,c=Math.hypot(i,s);if(c>o.outer||c<o.inner)return!1;let u=Math.atan2(i,-s)*180/Math.PI;if(!Jo(u,o.from,o.sweep))return!1}return!0}var tl=4;function nl(e,t,n){let r=e/2,o=t/2,l=n.outer-tl,a=h=>{let m=h*Math.PI/180,x=Math.sin(m),p=Math.cos(m),y=r*Math.abs(x)+o*Math.abs(p),T=r*r+o*o-l*l,A=Math.max(0,-y+Math.sqrt(Math.max(0,y*y-T)));return{x:A*x,y:A*p}},i=(h,m,x)=>{let p=m*Math.PI/180,y=Math.cos(p)*x,T=-Math.sin(p)*x;return h.x*y+h.y*T-r*Math.abs(y)-o*Math.abs(T)},s=h=>{let m=a(h);return i(m,n.from,1)-i(m,n.from+n.sweep,-1)},c=n.from+n.sweep/2,u=c;if(Math.abs(n.sweep-180)>1e-6){let h=Math.min(n.sweep/2,45),m=c-h,x=c+h,p=Math.sign(s(m));if(p!==0&&p!==Math.sign(s(x))){for(let y=0;y<40;y+=1){let T=(m+x)/2;Math.sign(s(T))===p?m=T:x=T}u=(m+x)/2}}let d=a(u);return{x:n.cx+d.x,y:n.cy-d.y}}function sr(e,t,n){let r=e.series.filter(y=>y.values.some(T=>T!==null&&T>0));if(r.length===0)return;let o=e.kind==="doughnut",l=o?r:r.slice(0,1),a=l.some(y=>y.values.some((T,A)=>{let g=Pe(e,y,A);return g!==null&&g.position!=="inEnd"&&g.position!=="ctr"})),i=Math.min(t.r-t.l,t.b-t.t),s=a&&!n.placed?Yo(i):0,c=Math.max(1,i-s),u=(t.l+t.r)/2,d=(t.t+t.b)/2,h=(y,T)=>{let A=o?y*e.holeSize/100:0,g=(y-A)/l.length,M=[];for(let[L,I]of l.entries()){let k=I.values.reduce((_,O)=>_+(O!==null&&O>0?O:0),0);if(!Number.isFinite(k))return n.scene.ok=!1,[];if(!(k>0))continue;let v=o?A+L*g:0,S=o?v+g:y,U=e.firstSliceAngle,z=I.values.length;for(let _=0;_<z;_+=1){let O=I.values[_];if(O==null||!(O>0))continue;let D=O/k*360,V=U+D/2,f=jo(e,e.series.indexOf(I),_)/100*y,P=V*Math.PI/180,b=u+f*Math.sin(P),w=d-f*Math.cos(P),N=de(e,I,n.look,ke(e)||I.points.has(_)?{index:_,count:z}:void 0);T&&n.scene.path([On(b,w,S,v,U,U+D)],!0,N.fill,N.line,"round");let C=Pe(e,I,_);if(C){let R=ie(n.baseText,C.txPr,n.look.colors),F={value:O,percent:O/k,category:at(I,_,n.date1904),seriesName:I.name,seriesFormat:I.formatCode,date1904:n.date1904,cell:I.labelRange?.[_]??null},W=ve(C,F,R,n.bounds?n.bounds.r-n.bounds.l:null,n.look.colors),Y=W.width,G=W.height,te=Math.sin(P),$=Math.cos(P),j=Y/2*Math.abs(te)+G/2*Math.abs($),ae=C.position??(o?"ctr":"bestFit"),fe={cx:b,cy:w,inner:v,outer:S,from:U,sweep:D},se=ae==="ctr"||o?(v+S)/2:S-j-4,be=ae==="outEnd",Ne=ae==="bestFit"&&!o?nl(Y,G,fe):null;if(ae==="bestFit"){let en=Ne??{x:b+se*te,y:w-se*$};be=!el(en.x,en.y,Y,G,fe)}let Ze=be?S+j+(ae==="outEnd"?6:0):se,qe=W.frame,Jt=Ne&&!be?Ne:{x:b+Ze*te,y:w-Ze*$},Mt=mt(C.moved,n.bounds,Jt.x,Jt.y,Y,G);Mt.moved&&(be=!1);let Pt=Mt.x,kt=Mt.y;M.push({label:{paragraphs:W.paragraphs,align:"ctr",x:Pt-qe/2,y:kt-G/2,width:qe,height:G,rotation:0},anchor:{x:b+S*te,y:w-S*$},outside:be,right:te>=0,cx:Pt,cy:kt,naturalX:Pt,naturalY:kt,angle:V,middle:V,origin:{x:b,y:w},reach:S+(ae==="outEnd"?6:0),drift:0,lineHeight:q(R),size:R.sizePt,width:Y,height:G})}U+=D}}return M},m=c/2;for(let y=0;y<3&&!n.placed;y+=1){let T=0;for(let A of h(m,!1))A.outside&&(T=Math.max(T,A.cx+A.width/2-(t.r+pt),t.l-pt-(A.cx-A.width/2),t.t-pt-(A.cy-A.height/2),A.cy+A.height/2-(t.b+pt)));if(T<=.5)break;m=Math.max(c/4,m-T)}let x=h(m,!0);cl(x,n.avoid??[],n.bounds??null);let p=qo(l[0]?.dLbls??e.dLbls,n);for(let y of x){let T={...y.label,x:y.label.x+(y.cx-y.naturalX),y:y.cy-y.height/2};n.labels.push(T);let A=Xe(y),g=Math.max(A.l-y.anchor.x,0,y.anchor.x-A.r),M=Math.max(A.t-y.anchor.y,0,y.anchor.y-A.b),L=Math.hypot(y.cx-y.naturalX,y.cy-y.naturalY);y.outside&&L>1&&Math.hypot(g,M)>Ko*y.size&&n.scene.line(rl(y,d),p)}}function rl(e,t){let n=e.cy-e.height/2,r=Math.max(1,Math.round(e.height/e.lineHeight)),o=e.cy<t?r-1:0,l=n+(o+1)*e.lineHeight-.35*e.size,a=e.cx-e.width/2,i=e.cx+e.width/2,s=e.anchor.x<e.cx,c=s?a-lr*e.size:i+lr*e.size,u=s?c-or*e.size:c+or*e.size;return[{x:e.anchor.x,y:e.anchor.y},{x:u,y:l},{x:c,y:l}]}function ir(e,t){return e.l<t.r&&t.l<e.r&&e.t<t.b&&t.t<e.b}function Xe(e,t=0){let n=t*e.size;return{l:e.cx-e.width/2-n,r:e.cx+e.width/2+n,t:e.cy-e.height/2,b:e.cy+e.height/2}}var Ht=.25,ol=.5,ll=150,al=1e3;function il(e){let t=e.angle*Math.PI/180,n=Math.sin(t),r=Math.cos(t),o=e.width/2*Math.abs(n)+e.height/2*Math.abs(r);e.cx=e.origin.x+(e.reach+o)*n,e.cy=e.origin.y-(e.reach+o)*r}function sl(e,t,n,r){let o=Math.atan2((t.l+t.r)/2-n,r-(t.t+t.b)/2)*180/Math.PI;return((e.angle-o)%360+540)%360-180>=0?1:-1}function cl(e,t,n){let r=e.filter(c=>c.outside);if(r.length===0)return;let o=[...t];for(let c of e)c.outside||o.push(Xe(c));let l=r[0].origin.x,a=r[0].origin.y,i=c=>n!==null&&(c.l<n.l||c.r>n.r||c.t<n.t||c.b>n.b),s=(c,u)=>{let d=c.angle+u*ol;return Math.abs(d-c.middle)>ll?!1:(c.angle=d,c.drift=u,il(c),!0)};for(let c=0;c<al;c+=1){let u=!1,d=[...r].sort((m,x)=>(m.angle%360+360)%360-(x.angle%360+360)%360),h=d.length>2?d.length:d.length-1;for(let m=0;m<h;m+=1){let x=d[m],p=d[(m+1)%d.length];ir(Xe(x,Ht),Xe(p,Ht))&&(u=s(x,-1)||u,u=s(p,1)||u)}for(let m of r){let x=Xe(m,Ht),p=o.find(y=>ir(x,y));if(p)u=s(m,m.drift||sl(m,p,l,a))||u;else if(i(x)){let y=x.t<n.t?0:x.b>n.b?180:x.l<n.l?270:90,T=((m.angle-y)%360+540)%360-180;u=s(m,m.drift||(T>=0?1:-1))||u}}if(!u)break}}var ul=1024;function dl(e){return Math.max(0,.9275*e-5.25)}var fl=.04,hl=.08,ml=1,pl={hex:"000000",alpha:1,widthPt:.5,cap:"butt",dash:null};function cr(e,t,n){let{model:r,scene:o}=n,l=n.look.colors,a=st(r,e,ul),i=a.count;if(i<1)return;let s=Me(r,e[0],"value"),c=a.axis,u={axis:s,id:s?.id??"",dataMin:1/0,dataMax:-1/0,percent:!1,scale:null,formatCode:null};for(let _ of e)$e(u,_);u.formatCode=He(u,e[0].series.find(_=>_.formatCode)?.formatCode??null);let d=ie(n.baseText,s?.txPr??null,l),h=ie(n.baseText,c?.txPr??null,l),m=q(h),x=Math.max(0,...a.labels.map(_=>J(_,h))),p=c!==null&&!c.deleted&&c.tickLabelPosition!=="none",y=dl(h.sizePt),T=Math.max(1,Math.min((t.b-t.t)/2-(p?m/2+y:0),(t.r-t.l)/2-(p?x+y:0))),A=(t.l+t.r)/2,g=(t.t+t.b)/2,M=u.dataMin>u.dataMax,L=it({dataMin:M?0:u.dataMin,dataMax:M?1:u.dataMax,lengthPt:T,minIntervalPt:Nt(d),fixedMin:s?.min??null,fixedMax:s?.max??null,fixedMajor:s?.majorUnit??null,noHeadroom:!0}),I=L.max-L.min||1,k=(_,O)=>{let D=_/i*Math.PI*2,V=(O-L.min)/I*T;return{x:A+V*Math.sin(D),y:g-V*Math.cos(D)}},v=_=>_?ce(ne(E(_,"spPr"),l).line,pl):null,S=v(s?.majorGridlines??null);if(S){let _=[];for(let O of L.ticks){if(O<=L.min)continue;let D=[];for(let V=0;V<i;V+=1)D.push(k(V,O));_.push(D)}o.path(_,!0,null,S)}let U=v(c?.majorGridlines??null);if(U){let _=[];for(let O=0;O<i;O+=1)_.push([{x:A,y:g},k(O,L.max)]);o.path(_,!1,null,U)}let z=[];for(let _ of e){let O=_.radarStyle==="filled";for(let D of _.series){let V=de(_,D,n.look),f=[];for(let w=0;w<i;w+=1){let N=D.values[w];f.push(N==null?null:k(w,N))}let P=f.filter(w=>w!==null);O?P.length>=3&&o.path([P],!0,V.fill,V.line):V.line&&P.length>=2&&o.path([P],P.length===i&&P.length>=3,null,V.line,"round");let b=O?null:V.marker;if(b){let w=b.size*.96,N=[],C=[];for(let R of P){for(let F of Te(b.symbol,R.x,R.y,w))N.push(F);for(let F of we(b.symbol,R.x,R.y,w))C.push(F)}N.length&&o.path(N,!0,b.fill,b.line),C.length&&o.path(C,!1,null,b.line)}for(let[w,N]of f.entries()){let C=N?Pe(_,D,w):null;if(!C||!N)continue;let R=ie(n.baseText,C.txPr,l),F={value:D.values[w],percent:null,category:a.labels[w]??null,seriesName:D.name,seriesFormat:D.formatCode,date1904:r.date1904,cell:D.labelRange?.[w]??null},W=ve(C,F,R,null,l),Y=W.height,G=W.frame;z.push({paragraphs:W.paragraphs,align:"ctr",x:N.x-G/2,y:N.y-Y-2,width:G,height:Y,rotation:0})}}}if(s&&!s.deleted&&s.tickLabelPosition!=="none"){let _=q(d);for(let O of L.ticks){let D=ue(O,u.formatCode,r.date1904),V=J(D,d)*1.3+d.sizePt*2,f=k(0,O);n.labels.push({paragraphs:[[{text:D,style:d}]],align:"r",x:f.x-ml*d.sizePt-V,y:f.y-_/2,width:V,height:_,rotation:0})}}if(p)for(let _=0;_<i;_+=1){let O=a.labels[_],D=_/i*Math.PI*2,V=Math.sin(D),f=Math.cos(D),P=k(_,L.max),b=J(O,h),w=fl*T,N=w+hl*h.sizePt,C=P.x+w*V+b/2*V,R=P.y-N*f-m/2*f-We*h.sizePt,F=b*1.3+h.sizePt*2;n.labels.push({paragraphs:[[{text:O,style:h}]],align:"ctr",x:C-F/2,y:R-m/2,width:F,height:m,rotation:0})}for(let _ of z)n.labels.push(_)}function yl(e,t,n){return{l:e.x*t,t:e.y*n,r:(e.x+e.w)*t,b:(e.y+e.h)*n}}function ur(e,t,n,r){let o=new dt,l=[],a=Nn(e,r),i=e.plots.reduce((k,v)=>k+v.series.length,0),s={model:e,colors:r,seriesCount:i},c=ne(e.spPr,r),u=c.fill===void 0?ft("bg1",[],r)??{hex:"FFFFFF",alpha:1}:c.fill;o.rect(0,0,t,n,u,c.line??null);let d={l:Se,t:Se,r:t-Se,b:n-Se},h=[],m=i===1?e.plots.find(k=>k.series.length===1).series[0]:null;if(e.title!==null||!e.autoTitleDeleted&&m!==null){let k=e.title,v=ie(a,E(k,"txPr"),r,{sizePt:a.sizePt*1.8,bold:!0}),S=m?.name??(i>1?"Chart Title":null),U=k?Le(k,v,S,r):S?[[{text:S,style:v}]]:[];if(U.length>0){let z=et(U),_=ot(E(k,"layout")),O=H(k,"overlay")==="1",D=E(E(k,"tx"),"rich"),V=t*.8,f=!_&&z>V,P=f?V:z*1.3+v.sizePt*2,b=Ue(U,v)*(f?Math.ceil(z/V):1),w=_?_.y*n:d.t-3.4,N=_?_.x*t+z/2:t/2;l.push({paragraphs:U,align:"ctr",x:N-P/2,y:w,width:P,height:b,rotation:Fe(D)??0}),!_&&!O&&(d.t=w+b+12.5);let C=(f?V:z)/2+v.sizePt*.66;h.push({l:N-C,r:N+C,t:w,b:w+b})}}let p=e.legend?ie(a,e.legend.txPr,r):null,y=null;if(e.legend&&p){let k=er(e,e.legend,s),v=tr(e.legend,k,p,t,n,d);y=v.layout,Object.assign(d,v.plot)}let T=H(E(e.chartSpace,"chart"),"dispBlanksAs"),A=T==="zero"||T==="span"?T:"gap",g=e.plots.filter(k=>k.kind==="pie"||k.kind==="doughnut"),M=e.plots.filter(k=>k.kind==="radar"),L=e.plots.filter(k=>!g.includes(k)&&!M.includes(k));if([g,M,L].filter(k=>k.length>0).length!==1)return null;if(M.length>0)cr(M,e.plotLayout?.inner?yl(e.plotLayout,t,n):d,{model:e,look:s,scene:o,labels:l,baseText:a});else if(L.length>0){if(!Zn(L,d,{model:e,look:s,scene:o,labels:l,baseText:a,blanks:A,chartWidth:t,chartHeight:n}))return null}else{let k=e.plotLayout?{l:e.plotLayout.x*t,t:e.plotLayout.y*n,r:(e.plotLayout.x+e.plotLayout.w)*t,b:(e.plotLayout.y+e.plotLayout.h)*n}:d,v=ne(e.plotSpPr,r);(v.fill||v.line)&&o.rect(k.l,k.t,k.r-k.l,k.b-k.t,v.fill??null,v.line??null);for(let S of g)sr(S,k,{look:s,scene:o,labels:l,baseText:a,date1904:e.date1904,placed:e.plotLayout?.inner===!0,avoid:h,bounds:{l:0,t:0,r:t,b:n}})}return y&&p&&nr(y,p,o,l),!o.ok||l.some(k=>[k.x,k.y,k.width,k.height,k.rotation].some(v=>!Number.isFinite(v*12700)))?null:{scene:o,labels:l}}var dr=12700;function xl(e){if(e.plots.length===0)return!1;for(let t of e.plots){if(t.threeD||t.element.local==="stockChart"||!["bar","line","area","scatter","pie","doughnut","radar"].includes(t.kind))return!1;for(let n of t.series)if(n.trendlines.length>0||n.errorBars.length>0)return!1}return!0}var fr=new WeakMap;function bl({chart:e}){let t=[...e.colors.scheme].map(([o,l])=>`${o}=${l.r},${l.g},${l.b},${l.a}`),n=[...e.colors.colorMap].map(([o,l])=>`${o}=${l}`),r=[e.theme.majorFont.latin,e.theme.minorFont.latin];return[...t,...n,...r].join("|")}function hr(e){let{frame:t,chart:n,measurer:r}=e,{cx:o,cy:l}=t.xfrm;if(!(o>0)||!(l>0))return null;let a=`${t.partName}|${t.layer}|${t.nodeId}`,i=bl(e),s=fr.get(n.chartSpace);if(s&&s.cx===o&&s.cy===l&&s.measurer===r&&s.owner===a&&s.theme===i)return s.result;let c=gl(e);return fr.set(n.chartSpace,{cx:o,cy:l,measurer:r,owner:a,theme:i,result:c}),c}function gl({frame:e,chart:t,measurer:n}){let r=Pn(t.chartSpace);return!r||!xl(r)?null:sn({measurer:n,theme:t.theme},()=>{let o=ur(r,e.xfrm.cx/dr,e.xfrm.cy/dr,t.colors);return o?yn(o.scene.components,o.labels,e,t.theme):null})}import{toCss as Er}from"@pptx-editor.dev/core/cascade";import{apply as Ql}from"@pptx-editor.dev/core/layout";import{blurSigma as Lr,matrixAttr as Zl}from"@pptx-editor.dev/core/output";import{blurSigma as pr,effectMatrix as Cl}from"@pptx-editor.dev/core/output";import{apply as yt,multiply as Ml}from"@pptx-editor.dev/core/layout";var Wt=Math.PI/180,he=9525,Pl=.5;function Gt(e){return Math.max(0,e)*Pl}function Xt(e){let t=Math.max(0,e)/2;return{spread:t,sigma:pr(t)}}var kl=.84;function jt(e){let t=Math.max(0,e);return{spread:-t*kl,sigma:pr(t)}}function Kt(e,t){let n=t*Wt;return{dx:-Math.cos(n)*e,dy:-Math.sin(n)*e}}function Yt(e){let t=1/0,n=1/0,r=-1/0,o=-1/0;for(let l of e)t=Math.min(t,l.x),n=Math.min(n,l.y),r=Math.max(r,l.x),o=Math.max(o,l.y);return{x:t,y:n,r,b:o}}function Sl(e,t,n){return[yt(e,0,0),yt(e,t,0),yt(e,t,n),yt(e,0,n)]}function Ie(e,t){return{x:e.x-t,y:e.y-t,r:e.r+t,b:e.b+t}}function _l(e,t){let n=Math.cos(t*Wt),r=Math.sin(t*Wt),l=[{x:e.x,y:e.y},{x:e.r,y:e.y},{x:e.r,y:e.b},{x:e.x,y:e.b}].map(d=>d.x*n+d.y*r),a=l.reduce((d,h)=>Math.min(d,h),1/0),i=l.reduce((d,h)=>Math.max(d,h),-1/0),s=(e.x+e.r)/2,c=(e.y+e.b)/2,u=s*n+c*r;return{x1:s+(a-u)*n,y1:c+(a-u)*r,x2:s+(i-u)*n,y2:c+(i-u)*r}}var mr=e=>Math.max(0,Math.min(1,e));function Qt(e,t,n,r){let o=Cl(e,t,n,r),l=Yt(Sl(Ml(o,t),n,r)),a=e.rotWithShape?Math.atan2(t[1],t[0])*180/Math.PI:0,i=mr(e.startPos);return{matrix:o,line:_l(l,e.fadeDir+a),start:i,end:Math.max(i,mr(e.endPos))}}import{apply as Ye}from"@pptx-editor.dev/core/layout";var je=Math.PI/180,El={isometricBottomDown:[2124e3,18883200,17990400],isometricBottomUp:[2124e3,2716800,3609600],isometricLeftDown:[21e5,27e5,0],isometricLeftUp:[195e5,27e5,0],isometricOffAxis1Left:[108e4,384e4,0],isometricOffAxis1Right:[108e4,2004e4,0],isometricOffAxis1Top:[18075600,18393e3,3458400],isometricOffAxis2Left:[108e4,156e4,0],isometricOffAxis2Right:[108e4,1776e4,0],isometricOffAxis2Top:[18075600,3207e3,18141600],isometricOffAxis3Bottom:[3524400,18393e3,18141600],isometricOffAxis3Left:[2052e4,384e4,0],isometricOffAxis3Right:[2052e4,2004e4,0],isometricOffAxis4Bottom:[3524400,3207e3,3458400],isometricOffAxis4Left:[2052e4,156e4,0],isometricOffAxis4Right:[2052e4,1776e4,0],isometricRightDown:[195e5,189e5,0],isometricRightUp:[21e5,189e5,0],isometricTopDown:[19476e3,2716800,17990400],isometricTopUp:[19476e3,18883200,3609600],perspectiveAbove:[204e5,0,0],perspectiveAboveLeftFacing:[2358600,860400,20467200],perspectiveAboveRightFacing:[2358600,20739600,1132800],perspectiveBelow:[12e5,0,0],perspectiveContrastingLeftFacing:[624e3,2636400,21387e3],perspectiveContrastingRightFacing:[624e3,18963600,213e3],perspectiveHeroicExtremeLeftFacing:[487200,2067600,21425400],perspectiveHeroicExtremeRightFacing:[487200,19532400,174600],perspectiveHeroicLeftFacing:[20938800,857400,157800],perspectiveHeroicRightFacing:[20938800,20742600,21442200],perspectiveLeft:[0,12e5,0],perspectiveRelaxed:[18573600,0,0],perspectiveRelaxedModerately:[19490400,0,0],perspectiveRight:[0,204e5,0]},Ll={obliqueTopLeft:[-45,.3],obliqueTop:[-90,.3],obliqueTopRight:[-135,.3],obliqueLeft:[0,.3],obliqueRight:[180,.3],obliqueBottomLeft:[45,.3],obliqueBottom:[90,.3],obliqueBottomRight:[135,.3],legacyObliqueTopLeft:[-45,.5],legacyObliqueTop:[-90,.5],legacyObliqueTopRight:[-135,.5],legacyObliqueLeft:[0,.5],legacyObliqueRight:[180,.5],legacyObliqueBottomLeft:[45,.5],legacyObliqueBottom:[90,.5],legacyObliqueBottomRight:[135,.5]};function yr(e,t){let n=r=>[r[0]*t[0][0]+r[1]*t[1][0]+r[2]*t[2][0],r[0]*t[0][1]+r[1]*t[1][1]+r[2]*t[2][1],r[0]*t[0][2]+r[1]*t[1][2]+r[2]*t[2][2]];return[n(e[0]),n(e[1]),n(e[2])]}function br(e,t){return[e[0][0]*t[0]+e[0][1]*t[1]+e[0][2]*t[2],e[1][0]*t[0]+e[1][1]*t[1]+e[1][2]*t[2],e[2][0]*t[0]+e[2][1]*t[1]+e[2][2]*t[2]]}function gr(e){let t=El[e.camera],n=e.cameraRot?[e.cameraRot.lat,e.cameraRot.lon,e.cameraRot.rev]:t?[t[0]/6e4,t[1]/6e4,t[2]/6e4]:void 0;if(n&&(n[0]!==0||n[1]!==0||n[2]!==0)){let[o,l,a]=n.map(u=>u*je),i=[[Math.cos(l),0,Math.sin(l)],[0,1,0],[-Math.sin(l),0,Math.cos(l)]],s=[[1,0,0],[0,Math.cos(o),-Math.sin(o)],[0,Math.sin(o),Math.cos(o)]],c=[[Math.cos(-a),-Math.sin(-a),0],[Math.sin(-a),Math.cos(-a),0],[0,0,1]];return{kind:"turn",rotation:yr(c,yr(s,i))}}let r=e.cameraRot?void 0:Ll[e.camera];if(r){let[o,l]=r;return{kind:"oblique",dx:-Math.cos(o*je)*l,dy:Math.sin(o*je)*l}}return{kind:"front"}}var Cr={ambient:.1253,lights:[{dir:[-.194,-.722,.664],k:.857},{dir:[-.027,.669,.743],k:.486},{dir:[-.286,.571,-.769],k:.929}],highlights:[{dir:[-.355,-.719,.597],k:.484,power:28.5},{dir:[-.457,.459,-.762],k:1.125,power:82.4},{dir:[0,.485,-.875],k:.13,power:24},{dir:[.307,.851,.426],k:.169,power:37.3}]},Tl={threePt:Cr,balanced:{ambient:.201,lights:[{dir:[-.305,.466,.831],k:.992},{dir:[.534,-.794,-.291],k:1.324}],highlights:[{dir:[-.346,-.919,.186],k:.278,power:15.1}]},harsh:{ambient:.2826,lights:[{dir:[-.733,.597,.325],k:.941},{dir:[-.585,-.741,.329],k:.698}],highlights:[{dir:[-.718,-.645,-.262],k:3.764,power:23.9}]}},wl={t:0,tl:-32,l:-90,bl:-135,b:180,br:135,r:90,tr:45},Al={gloss:0,sharpness:1,rim:0,rimPower:1},vl={gloss:1,sharpness:1,rim:0,rimPower:1},Rl={gloss:1.51,sharpness:1,rim:0,rimPower:1},Il={gloss:4.97,sharpness:1.54,rim:1.26,rimPower:4.5},Nl={gloss:2,sharpness:1,rim:0,rimPower:1};function Ol(e){return/^(matte|powder|translucentPowder|dkEdge|softEdge|clear)$/.test(e)?Al:e==="metal"?Il:e==="plastic"?Rl:e==="softmetal"?Nl:vl}function Mr(e){if(e.kind==="turn"){let t=e.rotation;return me([-t[2][0],-t[2][1],t[2][2]])}return e.kind==="oblique"?me([e.dx,e.dy,1]):[0,0,1]}var Zt=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2];function xr(e,t){let n=Math.cos(t*je),r=Math.sin(t*je);return[e[0]*n-e[1]*r,e[0]*r+e[1]*n,e[2]]}function me(e){let t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]}function Pr(e,t=[0,0,1]){if(e.material==="flat"||e.material==="legacyWireframe"||/^(flat|legacyFlat\d)$/.test(e.lightRig))return{shade:()=>({level:1,white:0})};let n=wl[e.lightDir]??0,r=Tl[e.lightRig]??Cr,o=r.lights.map(s=>({dir:xr(me(s.dir),n),k:s.k})),l=Ol(e.material),a=r.highlights.map(s=>{let c=xr(me(s.dir),n);return{half:me([c[0]+t[0],c[1]+t[1],c[2]+t[2]]),k:l.gloss*s.k,power:l.sharpness*s.power}}),i=me(t);return{shade:s=>({level:o.reduce((c,u)=>c+u.k*Math.max(0,Zt(s,u.dir)),r.ambient),white:a.reduce((c,u)=>c+u.k*Math.max(0,Zt(s,u.half))**u.power,0)+(l.rim>0?l.rim*(1-Math.max(0,Zt(s,i)))**l.rimPower:0)})}}var Ke=12,xt=12,Dl=4096,Fl=1024,Bl={relaxedInset:[3.8,2.44,1.62,1.18,.86,.7,-1.02,-1.26,-.96,-.74,-.32,-.1],cross:[1.04,.02,0,0,0,.88,1.02,0,0,0,0,0],coolSlant:[3.62,2.8,2.5,2.08,1.04,.64,.14,0,0,0,0,0],softRound:[4.8,2.3,-1.18,-1.82,-1.5,-1.3,-.88,-.68,-.6,-.3,-.18,-.06],convex:[.98,.06,.22,.56,.66,.78,.94,1.26,1.48,1.88,2.88,.84],slope:[4.64,3.88,1.7,.16,.04,0,-.1,-.78,-2.54,-4.52,-2.44,-.72],divot:[4.12,2.58,1.66,1.02,.76,.64,.14,0,0,0,.78,.08],riblet:[3.3,1.94,1.42,1.32,1.06,.9,.64,.14,.02,0,.82,.78],hardEdge:[4.58,4.52,.76,.02,0,0,0,-.78,-.84,-.6,-.24,-.1],artDeco:[2.16,.9,.6,.16,2.48,1.94,1,.76,.6,.3,.18,.06]};function Ul(e){let t=e.length,n=[0];for(let r of e)n.push(n[n.length-1]+r/t);return r=>{let o=Math.max(0,Math.min(1,r))*t,l=Math.min(t-1,Math.floor(o));return n[l]+(o-l)*(n[l+1]-n[l])}}var Vl={circle:e=>Math.sqrt(Math.max(0,1-(1-e)**2)),angle:e=>e,...Object.fromEntries(Object.entries(Bl).map(([e,t])=>[e,Ul(t)]))};function zl(e){let t=[],n=0;for(let r of e){if(r.fill==="none")continue;let o=[],l={x:0,y:0},a=()=>{let s=o[o.length-1];s&&o.length>1&&Math.hypot(s.x-o[0].x,s.y-o[0].y)<1&&o.pop(),o.length>=3&&t.push(o),n+=o.length,o=[]},i=s=>{let c=o[o.length-1];(!c||Math.hypot(c.x-s.x,c.y-s.y)>=1)&&o.push(s),l=s};for(let s of r.commands){if(s.op==="M")a(),i({x:s.x,y:s.y});else if(s.op==="L")i({x:s.x,y:s.y});else if(s.op==="C"){let c=l;for(let u=1;u<=xt;u+=1){let d=u/xt,h=1-d;i({x:h*h*h*c.x+3*h*h*d*s.x1+3*h*d*d*s.x2+d*d*d*s.x,y:h*h*h*c.y+3*h*h*d*s.y1+3*h*d*d*s.y2+d*d*d*s.y})}}else if(s.op==="Q"){let c=l;for(let u=1;u<=xt;u+=1){let d=u/xt,h=1-d;i({x:h*h*c.x+2*h*d*s.x1+d*d*s.x,y:h*h*c.y+2*h*d*s.y1+d*d*s.y})}}else if(s.op==="Z"){let c=o[0];a(),c&&(l=c)}if(n+o.length>Dl)return null}a()}return t}function $l(e){let t=e.reduce((r,o)=>r+o.length,0),n=Math.ceil(t/Fl);return n<=1?[...e]:e.map(r=>r.filter((o,l)=>l%n===0)).filter(r=>r.length>=3)}function kr(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e[n],o=e[(n+1)%e.length];t+=r.x*o.y-o.x*r.y}return t/2}function gt(e){let t=kr(e)>=0?1:-1;return e.map((n,r)=>{let o=e[(r+1)%e.length],l=o.x-n.x,a=o.y-n.y,i=Math.hypot(l,a)||1;return{x:t*a/i,y:t*-l/i}})}function Sr(e,t,n){let r=e.length;return e.map((o,l)=>{let a=t[(l-1+r)%r],i=t[l],s=Math.max(.125,1+a.x*i.x+a.y*i.y),c=(a.x+i.x)/s,u=(a.y+i.y)/s,d=Math.hypot(c,u);return d>4&&(c*=4/d,u*=4/d),{x:o.x-c*n,y:o.y-u*n}})}function bt(e,t,n){let r=Number.isFinite(t)?t:1,o=Number.isFinite(n)?n:0,l=a=>Math.max(0,Math.min(255,a*r+255*o));return{r:l(e.r),g:l(e.g),b:l(e.b),a:e.a}}var Hl=1,Wl=e=>e.points.every(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))&&[e.color.r,e.color.g,e.color.b,e.color.a].every(Number.isFinite),Gl=e=>`${Math.round(e.r)},${Math.round(e.g)},${Math.round(e.b)},${Math.round(e.a*1e3)}`;function qt(e){let t=[];for(let n of e){if(!Wl(n))continue;let r=Gl(n.color),o=t[t.length-1];o?.key===r?o.polygons.push(n.points):t.push({polygons:[n.points],color:n.color,key:r})}return t.map(({polygons:n,color:r})=>({polygons:n,color:r}))}function Xl(e,t,n,r,o,l){let a=Math.min(n.w,r);if(!(a>0)||!(Math.abs(kr(e))>=Hl))return[];let i=gt(e),s=Vl[n.preset],c=Array.from({length:Ke+1},(d,h)=>Sr(e,i,a*h/Ke)),u=[];for(let d=0;d<Ke;d+=1){let h=d/Ke,m=(d+1)/Ke,x=(s(m)-s(h))/(m-h)*(n.h/a),p=c[d],y=c[d+1];for(let T=0;T<e.length;T+=1){let A=(T+1)%e.length,g=t[T],{level:M,white:L}=l.shade(me([g.x*x,g.y*x,1]));u.push({points:[p[T],p[A],y[A],y[T]],color:bt(o,M,L)})}}return u}function jl(e,t){return gt(e.map(n=>Ye(t,n.x,n.y)))}var Kl=[1,0,0,1,0,0],Yl=1e-6;function _r(e){let t=e.effects.threeD;if(!t)return null;let n=zl(e.paths);if(!n||n.length===0)return null;let r=$l(n),o=gr(t),l=Mr(o),a=Pr(t,l),i=e.matrix,s=Ye(i,e.width/2,e.height/2),c=o.kind==="turn"?(()=>{let g=o.rotation,M=g[0][0],L=g[1][0],I=g[0][1],k=g[1][1];return[M,L,I,k,s.x-M*s.x-I*s.y,s.y-L*s.x-k*s.y]})():Kl,u={...e.color,a:1},d=[],h=[],m=[],x=Math.max(0,Math.min(e.width,e.height)/2);if(t.bevelTop)for(let g of r)d.push(...Xl(g,jl(g,i),t.bevelTop,x,u,a));if(t.contourW>0){let g=t.contourColor?{...t.contourColor}:u;for(let M of r){let L=gt(M),I=Sr(M,L,-t.contourW/2);for(let k=0;k<M.length;k+=1){let v=(k+1)%M.length;h.push({points:[I[k],I[v],M[v],M[k]],color:g})}}}let p=t.extrusionH+(t.bevelBottom?.h??0)+(t.bevelTop?.h??0),y=p>0&&o.kind==="turn"?{x:o.rotation[0][2]*p,y:o.rotation[1][2]*p}:void 0;if(p>0&&o.kind!=="front"){let g=t.extrusionColor?{...t.extrusionColor,a:1}:u,M=[];for(let L of r){let I=L.map(v=>Ye(i,v.x,v.y)),k=gt(I);for(let v=0;v<I.length;v+=1){let S=I[v],U=I[(v+1)%I.length],z=k[v];if(o.kind==="oblique"){if(z.x*o.dx+z.y*o.dy<=0)continue;let P={x:o.dx*p,y:o.dy*p},{level:b,white:w}=a.shade(me([z.x,z.y,.35]));M.push({facet:{points:[S,U,{x:U.x+P.x,y:U.y+P.y},{x:S.x+P.x,y:S.y+P.y}],color:bt(g,b,w)},z:0});continue}let _=o.rotation,O=(P,b)=>{let w=br(_,[P.x-s.x,P.y-s.y,b]);return{x:s.x+w[0],y:s.y+w[1],z:w[2]}},D=[O(S,0),O(U,0),O(U,p),O(S,p)],{level:V,white:f}=a.shade([z.x,z.y,0]);M.push({facet:{points:D.map(({x:P,y:b})=>({x:P,y:b})),color:bt(g,V,f)},z:D.reduce((P,b)=>P+b.z,0)/4})}}M.sort((L,I)=>I.z-L.z),m.push(...M.map(L=>L.facet));for(let L of r){let I=L.map(k=>{let v=Ye(i,k.x,k.y);return Ye(c,v.x,v.y)});m.push({points:I,color:g})}}if(d.length===0&&h.length===0&&m.length===0&&o.kind!=="turn")return null;let T=Math.abs(c[0]*c[3]-c[1]*c[2])>=Yl,A=a.shade([0,0,l[2]<0?-1:1]);return{front:c,showsFace:T,faceColor:bt(e.color,A.level,A.white),...y&&Number.isFinite(y.x)&&Number.isFinite(y.y)?{backOffset:y}:{},behind:qt(m),under:qt(h),over:qt(d)}}function X(e){if(!Number.isFinite(e))return"0";let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)}function B(e,t={},n=[]){return n.length>0?{tag:e,attrs:t,children:n}:{tag:e,attrs:t}}function Qe(e){return{filterUnits:"userSpaceOnUse",x:X(e.x),y:X(e.y),width:X(Math.max(1,e.r-e.x)),height:X(Math.max(1,e.b-e.y)),"color-interpolation-filters":"sRGB"}}var Ct=127e4,ql="0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1",Jl="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0";function Tr(e,t,n){let r=Math.min(Math.abs(e),Ct),o=Ie(n,r+he),l={x:X(o.x),y:X(o.y),width:X(Math.max(1,o.r-o.x)),height:X(Math.max(1,o.b-o.y))},a=e>0,i=r/Math.SQRT2,s=Math.min(he,r),c=(d,h,m)=>B("feMorphology",{...l,in:`${t}-g`,operator:a?"dilate":"erode",radius:`${X(d)} ${X(h)}`,result:m}),u=a?"lighten":"darken";return[B("feColorMatrix",{...l,in:"SourceAlpha",type:"matrix",values:ql,result:`${t}-g`}),c(r,s,`${t}-h`),c(s,r,`${t}-v`),c(i,i,`${t}-d`),B("feBlend",{...l,in:`${t}-h`,in2:`${t}-v`,mode:u,result:`${t}-hv`}),B("feBlend",{...l,in:`${t}-d`,in2:`${t}-hv`,mode:u,result:`${t}-m`}),B("feColorMatrix",{...l,in:`${t}-m`,type:"matrix",values:Jl,result:t})]}function ea(e,t,n){let r=[],{softEdge:o,innerShadow:l}=e,a="SourceGraphic",i=Math.max(t.r-t.x,t.b-t.y)/10+he;if(l){let c=Lr(l.blur),{dx:u,dy:d}=Kt(l.dist,l.dir);i+=Math.abs(l.dist)+3*c,r.push(B("feComponentTransfer",{in:"SourceAlpha",result:"ia"},[B("feFuncA",{type:"table",tableValues:"1 0"})]),B("feGaussianBlur",{in:"ia",stdDeviation:X(c),result:"ib"}),B("feOffset",{in:"ib",dx:X(u),dy:X(d),result:"io"}),B("feFlood",{"flood-color":Er({...l.color,a:1}),"flood-opacity":X(l.color.a),result:"ic"}),B("feComposite",{in:"ic",in2:"io",operator:"in",result:"ish"}),B("feComposite",{in:"ish",in2:"SourceAlpha",operator:"in",result:"isc"}),B("feMerge",{result:"inner"},[B("feMergeNode",{in:"SourceGraphic"}),B("feMergeNode",{in:"isc"})])),a="inner"}if(o&&o.radius>0){let{spread:c,sigma:u}=jt(o.radius);if(Math.abs(c)>Math.min(t.r-t.x,t.b-t.y)/2){let d=n.id("fx"),h=B("feFlood",{"flood-opacity":"0"});return{defs:[B("filter",{id:d,...Qe(t)},[h])],filter:d}}i=Math.max(i,Math.min(Math.abs(c),Ct)+he),r.push(...Tr(c,"se",t),B("feGaussianBlur",{in:"se",stdDeviation:X(u),result:"sm"}),B("feComponentTransfer",{in:a,result:"so"},[B("feFuncA",{type:"discrete",tableValues:"1"})]),B("feComposite",{in:"so",in2:"sm",operator:"in",result:"sc"}),B("feComponentTransfer",{in:"SourceAlpha",result:"sb"},[B("feFuncA",{type:"linear",slope:"255",intercept:"0"})]),B("feComposite",{in:"sc",in2:"sb",operator:"in",result:"soft"}))}if(r.length===0)return null;let s=n.id("fx");return{defs:[B("filter",{id:s,...Qe(Ie(t,i))},r)],filter:s}}function ta(e,t,n,r=!1){let o=e.glow;if(!o||o.radius<=0)return null;let l=n.id("glow"),{spread:a,sigma:i}=Xt(Math.min(o.radius,2*Ct));return{defs:[B("filter",{id:l,...Qe(Ie(t,a+3*i+he))},[...Tr(a,"gd",t),B("feGaussianBlur",{in:"gd",stdDeviation:X(i),result:"gb"}),B("feFlood",{"flood-color":Er({...o.color,a:1}),"flood-opacity":X(o.color.a),result:"gc"}),B("feComposite",{in:"gc",in2:"gb",operator:"in",result:"glow"}),...r?[]:[B("feMerge",{},[B("feMergeNode",{in:"glow"}),B("feMergeNode",{in:"SourceGraphic"})])]])],filter:l}}function na(e,t,n){let r=e.reflection;if(!r||r.startAlpha<=0&&r.endAlpha<=0)return null;let{matrix:o,line:l,start:a,end:i}=Qt(r,t.matrix,t.width,t.height),s=Gt(r.blur),c=Ie(Yt(t.corners.map(p=>Ql(o,p.x,p.y))),3*s+he),u=[],d=n.id("fade");u.push(B("linearGradient",{id:d,gradientUnits:"userSpaceOnUse",x1:X(l.x1),y1:X(l.y1),x2:X(l.x2),y2:X(l.y2)},[B("stop",{offset:X(a),"stop-color":"#ffffff","stop-opacity":X(r.startAlpha)}),B("stop",{offset:X(i),"stop-color":"#ffffff","stop-opacity":X(r.endAlpha)})]));let h=n.id("reflect"),m={x:X(c.x),y:X(c.y),width:X(Math.max(1,c.r-c.x)),height:X(Math.max(1,c.b-c.y))};u.push(B("mask",{id:h,maskUnits:"userSpaceOnUse",...m},[B("rect",{...m,fill:`url(#${d})`})]));let x=B("use",{href:`#${t.contentId}`,transform:Zl(o)});if(s>0){let p=n.id("rblur");u.push(B("filter",{id:p,...Qe(c)},[B("feGaussianBlur",{in:"SourceGraphic",stdDeviation:X(s)})])),x=B("g",{filter:`url(#${p})`},[x])}return{defs:u,node:B("g",{mask:`url(#${h})`,"data-effect":"reflection"},[x])}}function ra(e,t,n){let r=e.blur,o=r?Lr(r.radius):0;if(!r||o<=0)return null;let l=n.id("blur"),a=[B("feGaussianBlur",{in:"SourceGraphic",stdDeviation:X(o),result:"bl"}),...r.grow?[]:[B("feComposite",{in:"bl",in2:"SourceAlpha",operator:"in",result:"bi"})]],i=r.grow?3*o+he:he;return{defs:[B("filter",{id:l,...Qe(Ie(t,i))},a)],filter:l}}var wr=Object.freeze({body:ea,glow:ta,reflection:na,blur:ra,threeD:_r});function la(e={}){tn(e.licenseKey),oa({effects:wr,chart:hr})}function is(e={}){return la(e),Object.freeze({id:"drawing"})}export{Ct as MAX_MORPH_SPREAD,is as drawingModule,Xt as glowSpread,Kt as innerShadowShift,la as installDrawing,Gt as reflectionBlurSigma,Qt as reflectionFade,jt as softEdgeSpread};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pptx-editor.dev/pro",
3
- "version": "0.4.0",
3
+ "version": "0.5.1-canary.20261116033339.sha-dc95409",
4
4
  "description": "Commercial capabilities for PPTX Editor, as EditorModules: the review module with the comments pane and review hooks for React and Vue, realtime collaboration, and advanced drawing rendering (charts, glow, inner shadow, reflection, and soft edge).",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,9 +37,9 @@
37
37
  "api:check": "node ../../scripts/api-extractor.mjs --package @pptx-editor.dev/pro"
38
38
  },
39
39
  "peerDependencies": {
40
- "@pptx-editor.dev/core": "~0.4.0",
41
- "@pptx-editor.dev/react": "~0.4.0",
42
- "@pptx-editor.dev/vue": "~0.4.0",
40
+ "@pptx-editor.dev/core": "0.5.1-canary.20261116033339.sha-dc95409",
41
+ "@pptx-editor.dev/react": "0.5.1-canary.20261116033339.sha-dc95409",
42
+ "@pptx-editor.dev/vue": "0.5.1-canary.20261116033339.sha-dc95409",
43
43
  "react": "^18.0.0 || ^19.0.0",
44
44
  "vue": "^3.5.0"
45
45
  },