@sheetxl/studio-mui 0.3.14 → 0.3.16
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/browser/cjs/{BNuSzQJqJbqHwotK.cjs → BC8OpnSKibObcQCS.cjs} +2 -2
- package/browser/cjs/{B-ux82mC3pdz1kz_.cjs → BCsTnmxYa2nkkNmF.cjs} +1 -1
- package/browser/cjs/{ivbAx6mvfpGeOeWC.cjs → BG2dbyP43Euv7Me7.cjs} +2 -2
- package/browser/cjs/{TsuMTKhj2O-5Vm_K.cjs → BbNv8rUw-_jnAOeQ.cjs} +1 -1
- package/browser/cjs/{CfR-erRBEERmc9wX.cjs → BhqHeaNkp2bF--sH.cjs} +2 -2
- package/browser/cjs/{lhF4xnajIhTMhNl3.cjs → C9PIQukfrQAmzgsA.cjs} +2 -2
- package/browser/cjs/{duIJEG2QfFHcyCNS.cjs → CJwc1R9z4nK1qEt1.cjs} +2 -2
- package/browser/cjs/{Da2vqZhCoygWa4Gd.cjs → CNR7ln7i58psqljv.cjs} +1 -1
- package/browser/cjs/{B0DBQadzoF7C4vlu.cjs → COuWkDpDO5rzQ1GV.cjs} +7 -7
- package/browser/cjs/{BC-7zTAFDNOpYXcQ.cjs → CQtxDFrOFhC-8DLy.cjs} +1 -1
- package/browser/cjs/{BIiFKMaRy0Seo_xY.cjs → CWDXq752xpp4KB69.cjs} +2 -2
- package/browser/cjs/{CB_V4Ok9VnnjqWQB.cjs → Cmn32qJ2r9Z39wnf.cjs} +1 -1
- package/browser/cjs/{Cq88W0KN7eeKf96-.cjs → Cu0BuB_lqZjaHi8K.cjs} +2 -2
- package/browser/cjs/{CFMdCpzsOvXxkNao.cjs → D2yTwMR0RspEdMM2.cjs} +3 -3
- package/browser/cjs/{Rw2yrV19tzTGGBPV.cjs → D3W3rh4uEYdSUiej.cjs} +1 -1
- package/browser/cjs/{DcFfMY3RZgcsj0C5.cjs → DGk854a2WKUuZJoA.cjs} +2 -2
- package/browser/cjs/{s_IQJahtZWmMiA6H.cjs → DHmoNuLTZwc5j2fy.cjs} +1 -1
- package/browser/cjs/{BIKJ2_bHsaXftgBA.cjs → DT1Xp2dyeGwQTMls.cjs} +2 -2
- package/browser/cjs/{CJLLfqCAwoVg1zFf.cjs → DVK1crpVU8AQmGFY.cjs} +2 -2
- package/browser/cjs/{Dd-24dPmZyIm2GZn.cjs → DXprWU7hSme3WoQH.cjs} +4 -4
- package/browser/cjs/{Vl02t3Ty3ttvNkaF.cjs → Di7PtE7OiDhSqLbA.cjs} +3 -3
- package/browser/cjs/{CODNX35VkrQ_uYLp.cjs → QNz96pRxo1BiPpIp.cjs} +1 -1
- package/browser/cjs/{CnFS2z2aIkAOecZl.cjs → TezDzZCJ3FLORSu4.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{D8CHP6b7A1ozVuVv.cjs → rzgB_i37yr7isxxX.cjs} +1 -1
- package/browser/cjs/{BeU89ZkkvdnHOF1P.cjs → vDzzMbYhm99c73sS.cjs} +2 -2
- package/browser/esm/{CNshvpoFM47orxx0.mjs → 5yItQ8NMdI3fG7Bs.mjs} +4 -4
- package/browser/esm/{BgZu4ONYiuE03g5E.mjs → 7ZgitaHkZFsjfBRC.mjs} +1 -1
- package/browser/esm/{DCyFgwVUUJCbr3b-.mjs → B-Zc8BP7axPhqpBp.mjs} +6 -6
- package/browser/esm/{BkJhQM8qXEY6xg0A.mjs → BE_7MVaMTDdN_ej0.mjs} +1 -1
- package/browser/esm/{BXMqtXcjrhd3mV_b.mjs → BKr5t_zxciCuVOvw.mjs} +1 -1
- package/browser/esm/{D5C01UlJ_WzGJb1U.mjs → BRtxm5aKgr42E6pw.mjs} +3 -3
- package/browser/esm/{CtSrx4nacWKKijnq.mjs → BTeqfCZTDDtcObr-.mjs} +2 -2
- package/browser/esm/{CPDWi1cSKW_R-qNz.mjs → ByatTTZdx2O3mzRm.mjs} +2 -2
- package/browser/esm/{D3_xTUNkwBvulPoy.mjs → C40NlSJ5kFj3SMxx.mjs} +3 -3
- package/browser/esm/{C-jaMTSM-mlUYQWc.mjs → CFCfJcs7kkj-aUE7.mjs} +1 -1
- package/browser/esm/{Df-0UQ7Oqnnr_YCR.mjs → CFWlXpI3uwW4bDQl.mjs} +4 -4
- package/browser/esm/{DJ-nuB993iuQ2dLR.mjs → CPFJpCB4CnWh7KuM.mjs} +2 -2
- package/browser/esm/{Dutwya1U4avCGOZJ.mjs → CWckHjx-B4xydp_y.mjs} +1 -1
- package/browser/esm/{rIOGES0P2u1T8gdG.mjs → C_p4zjsnLck0YWir.mjs} +2 -2
- package/browser/esm/{CWTqa3g0eIUrE5B3.mjs → D3oKt6dL45VOrNyU.mjs} +2 -2
- package/browser/esm/{CCp_VIhDZtSAxQ-y.mjs → DEgH1G7eqeYRi_UZ.mjs} +2 -2
- package/browser/esm/{DG2D4wrC2ecjUvbW.mjs → DHscQcE27UbOSu5Q.mjs} +2 -2
- package/browser/esm/{BrpIqbhfQOsETW-Z.mjs → DP5t8hWL2fpUWjfI.mjs} +1 -1
- package/browser/esm/{D2sGb-BBS93SaVfr.mjs → DSfgsFw2rq7dQqUA.mjs} +2 -2
- package/browser/esm/{D3s4Rb9aXGcQfRLP.mjs → DxVgauSl9_JoH9al.mjs} +2 -2
- package/browser/esm/{DREtSHtE37T0AmS_.mjs → DzY19gfsSXvuXW0s.mjs} +1 -1
- package/browser/esm/{C6M-ezBh1hG72jnT.mjs → TtT3pdRACsdQrQRL.mjs} +1 -1
- package/browser/esm/{D4fOozQcIpB_kEGh.mjs → U8r8W0Bjr6--AllJ.mjs} +1 -1
- package/browser/esm/{DvlcfUv1sOYogEJf.mjs → bdzUKzHgYt1V4NBg.mjs} +2 -2
- package/browser/esm/{CSv3pOHLylhWmH8d.mjs → dlVNQO-6uK29AorG.mjs} +8 -8
- package/browser/esm/index.mjs +2 -2
- package/licenses/dependencies.txt +6 -6
- package/node/esm/{O9nLv91VOHDe81St.mjs → 7Aj5Hwnq8JQiCOHu.mjs} +1 -1
- package/node/esm/{Z4ETLRjjeRuieug-.mjs → B0YZziWFHtpUBf4G.mjs} +1 -1
- package/node/esm/{B3aQ-fFB5yGiGNZu.mjs → BJ2XPAG8f_kdQ7kQ.mjs} +1 -1
- package/node/esm/{OVsHEKU-iS-n5eF_.mjs → BKgV3dt-jvJHKcOd.mjs} +5 -5
- package/node/esm/{CtOavd1Vs8YekqUA.mjs → Binotu4EACFuh9wY.mjs} +1 -1
- package/node/esm/{DnJpLOMDZ1Eja55K.mjs → CFX_9Za0VJKW9bDg.mjs} +1 -1
- package/node/esm/{BTrBLz8J87eNSGGC.mjs → CFh7YH1kenGzRruI.mjs} +1 -1
- package/node/esm/{B9wtGYSLb1z45fF5.mjs → CG53Gsuy3J5R9ywT.mjs} +1 -1
- package/node/esm/{CxGKKSUOrDlzNKTk.mjs → CKkUvlJzkzWeSk2r.mjs} +1 -1
- package/node/esm/{CvgIFzdCYUUT5sgy.mjs → CaT7R0epOOXNTEKJ.mjs} +1 -1
- package/node/esm/{DF1cEAzdzmVYXHdn.mjs → CgyR_3OW8b8VHgmw.mjs} +3 -3
- package/node/esm/{D9kW-cf46a2qJOgl.mjs → CjLhq6j34He_h-rq.mjs} +1 -1
- package/node/esm/{79z9w3OUJQUnnnTe.mjs → CjaZf6WwZEWGX58S.mjs} +1 -1
- package/node/esm/{DhY-IsMoPgxoGE0v.mjs → ClLTjUtpYUIjFnEA.mjs} +1 -1
- package/node/esm/{BoKKdS08-mpDe0Jc.mjs → CskvgjYKuQEB8DM_.mjs} +1 -1
- package/node/esm/{MUuB7IhyC7mkrpFl.mjs → D9Z996ZoXTFnt5F5.mjs} +1 -1
- package/node/esm/{BdrnOScBIZcLJeWZ.mjs → DLRn3bqii1d4_5BF.mjs} +1 -1
- package/node/esm/{-GRUm7YcLL_9P76x.mjs → D_D_zJDX9lHqjCHd.mjs} +3 -3
- package/node/esm/{j54okY-ax6T04nM8.mjs → DuEvr9BLccqVeILj.mjs} +1 -1
- package/node/esm/{XBeUWyM3aN4u_BdX.mjs → K9mYsBo0-skE4uuU.mjs} +1 -1
- package/node/esm/index.mjs +8 -8
- package/node/esm/{Cg-6-Y9Esur_JzgV.mjs → j7rrh7EA5kcH60Xp.mjs} +1 -1
- package/node/esm/{CAscK0b5hQqKD1_4.mjs → mol4TOvUO24zECCX.mjs} +1 -1
- package/node/esm/{CXTz7AVGH2Ne89GX.mjs → x-Eh9kgEvHJBk1gb.mjs} +2 -2
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.16
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./B0DBQadzoF7C4vlu.cjs"),p=require("./Vl02t3Ty3ttvNkaF.cjs"),d=require("@sheetxl/sdk");class G{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let s=0;s<this.list.length;s++)t(this.list[s],s,this)}}const W=u=>u===!0||u==="1"||u==="on"||u==="true"||u!==!1&&u!=="0"&&u!=="off"&&u!=="false"&&null,X=u=>{const t=parseInt(u);return isNaN(t)?null:t},$=u=>{const t=parseFloat(u);return isNaN(t)?null:t},K=new Map;class S{constructor(t,e,s,r,o,i=null,n){const l=(c,h,g)=>n?.getRef?.(c,h,g,n?.parsedRefs),a=c=>n?.getRefs?.(c,n?.parsedRefs);this._parent=t,this.sharedShared=e,this.currentPath=s,this.elemRoot=r,this.jsonRoot=o,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs):(i&&(this._fileLocation=i),l&&a&&(this._getRef=l),a&&(this._getRefs=a),this._onWarning=n?.onWarning,this._addPerson=n?.addPerson)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??K}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let s=[e];const r=t.split("/");for(let o=0;o<r.length;o++){const i=r[o];if(i===""||i===".")continue;let n=[];for(let l=0;l<s.length;l++){const a=s[l],c=a.childNodes;for(let h=0;c&&h<c.length;h++){const g=a.childNodes[h];g.localName!==i&&i!=="*"||n.push(g)}}s=n}return s.length===1?s[0]:s.length===0?null:new G(s)}getFromPath(t,e){return I.Yt.getFromPath(t,e)}setToPath(t,e,s){return I.Yt.setToPath(t,e,s)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return o==null?s:o==="1"||o==="on"||o==="true"||o!=="0"&&o!=="off"&&o!=="false"&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return W}get INT_COPY(){return X}get FLOAT_COPY(){return $}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o){if(Array.isArray(o)){for(let n=0;n<o.length;n++)if(i==null||(i=o[n](i),i==null))return}else if(i==null||(i=o(i),i==null))return}this.setToPath(s,r,i)}}class V{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class H{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);i.nodeType===1&&i.localName==="Relationship"&&this.processRelationship(t,i,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const D=(u,t)=>{if(u||!u.hasAttribute("rot"))return;const e=u.getAttribute("rot"),s=I.Yt.roundAccurately(p.p(e),2);s!==-1e3&&(t.rotation=s)},f=(u,t,e,s,r)=>{const o=u.getValAttrAsString(s,t);o!==null&&(e[r]=o)},A=(u,t,e,s,r=s,o=null)=>{const i=u.getValAttrAsBoolean(s,t,o);i!==null&&(e[r]=i)},C=(u,t,e,s,r)=>{const o=u.getValAttrAsInteger(s,t);o!==null&&(e[r]=o)},y=(u,t,e,s,r,o=1)=>{const i=u.getValAttrAsFloat(s,t);i!==null&&(e[r]=i*o)};class q{visit(t,e,s){return A(t,e,s,"roundedCorners","roundedCorners"),C(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let m=0;m<c.length;m++){const b=c[m];if(b.xAxisId){const v=b.xAxisId,P=a.get(v);o[m+""]=P,b.offsetXAxis=m,delete b.xAxisId,s.xAxes=o,o.length=++i}if(b.yAxisId){const v=b.yAxisId,P=a.get(v);n[m+""]=P,b.offsetYAxis=m,delete b.yAxisId,s.yAxes=n,n.length=++l}r[m+""]=b}r.length=c.length;const h=t.getVisitorParamsState().get("series");if(!h||h.length===0)return;const g={};s.series=g;for(let m=0;m<h.length;m++)g[m+""]=h[m];g.length=h.length}}class J{visit(t,e,s){return A(t,e,s,"plotVisOnly","plotVisOnly"),f(t,e,s,"dispBlanksAs","dispBlanksAs"),A(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),A(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(r===!0||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",i!==null)}catch(r){throw new Error("Unexpected Error parsing Chart: "+r)}}}class Q{visit(t,e,s){let r={};return s.plotArea=r,r}}class O{EnumMappings(){}static fromOoxmlGradientType(t){return t==="circle"?"radial":t}static fromOoxmlLineCap(t){if(t==="rnd")return"round";if(t==="flat")return"butt";if(t==="sq")return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return t==="sng"?"single":t}static fromOoxmlAlignment(t){return t==="ctr"?"center":t}}class M{visit(t,e,s){}processStroke(t,e,s){const r={},o=t.evaluate("ln",e);if(o){o.hasAttribute("algn")&&(r.align=O.fromOoxmlAlignment(o.getAttribute("algn"))),o.hasAttribute("cap")&&(r.lineCap=O.fromOoxmlLineCap(o.getAttribute("cap"))),o.hasAttribute("cmpd")&&(r.compound=O.fromOoxmlCompound(o.getAttribute("cmpd"))),o.hasAttribute("w")&&(r.width=p.t(o.getAttribute("w")));const i=t.evaluate("miter",o);i&&(r.lineJoin="miter",i.hasAttribute("lim")&&(r.miter=parseFloat(i.getAttribute("lim")))),t.evaluate("bevel",o)&&(r.lineJoin="bevel"),t.evaluate("round",o)&&(r.lineJoin="round");const n=t.evaluate("custDash",o);if(n){const c=t.evaluate("ds",n);if(c&&c.length>0){let h="";for(let g=0;g<c.length;g++){const m=c.item(g);h+=p.a(m.getAttribute("d"))+","+p.a(m.getAttribute("sp"))}r.dash=h}}const l=t.evaluate("prstDash",o);l&&l.hasAttribute("val")&&(r.dash=l.getAttribute("val")),this.parseEndElement(t,o,r,"headEnd","head"),this.parseEndElement(t,o,r,"tailEnd","tail");const a=this.processFill(t,o,s);r.fill=a}return r}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const n=i.getAttribute("len")?i.getAttribute("len"):"med",l=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=n+"-"+l}}processFill(t,e,s){const r={};if(t.evaluate("noFill",e))return r.none=!0,r;const o=t.evaluate("solidFill",e);if(o){const a=this.processAdjColor(t,o);return a&&(r.solid=a),r}const i=t.evaluate("gradFill",e);if(i){i.hasAttribute("rotWithShape")&&(r.isRotated=i.getAttribute("rotWithShape")==="1");const a=this.processGradFill(t,i);return r.gradient=a,r}const n=t.evaluate("pattFill",e);if(n){const a=this.processPatternFill(t,n);return r.pattern=a,r}const l=t.evaluate("blipFill",e);if(l){l.hasAttribute("rotWithShape")&&(r.isRotated=p.b(l.getAttribute("rotWithShape"))),l.hasAttribute("dpi")&&(r.dpi=l.getAttribute("dpi"));const a=this.processImageFill(t,l);return r.image=a,r}return r.none=!0,r}processGradFill(t,e){const s={},r=t.evaluate("lin",e);if(r){if(s.type="linear",r.hasAttribute("ang")){const c=p.p(r.getAttribute("ang"));s.angle=c}if(r.hasAttribute("scaled")){const c=p.b(r.getAttribute("scaled"));s.scaled=c}}const o={};e.hasAttribute("flip")&&(o.mirror=e.getAttribute("flip")),Object.keys(o).length>0&&(s.tile=o);const i=t.evaluate("path",e);if(i){i.hasAttribute("path")&&(s.type=O.fromOoxmlGradientType(i.getAttribute("path")));const c=t.evaluate("fillToRect",i);c&&(s.fillTo=this.getRect(c))}const n=t.evaluate("tileRect",e);n&&(s.tile.bounds=this.getRect(n));const l=[],a=t.evaluate("gsLst/gs",e);for(let c=0;a&&c<a.length;c++){const h=a.item(c),g={offset:p.a(h.getAttribute("pos")),color:this.processAdjColor(t,h)};l.push(g)}return l.length>0&&(s.stops=l),s}getRect(t){const e={};return t.hasAttribute("t")&&(e.t=p.a(t.getAttribute("t"))),t.hasAttribute("l")&&(e.l=p.a(t.getAttribute("l"))),t.hasAttribute("b")&&(e.b=p.a(t.getAttribute("b"))),t.hasAttribute("r")&&(e.r=p.a(t.getAttribute("r"))),Object.keys(e).length===0?null:e}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const n=this.processAdjColor(t,o);n&&(s.background=n)}const i=t.evaluate("fgClr",e);if(i){let n=this.processAdjColor(t,i);n&&(s.foreground=n)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,e){let s="lrgba("+p.a(e.getAttribute("r"))+","+p.a(e.getAttribute("g"))+","+p.a(e.getAttribute("b"))+")";return s+=this.processAdjustments(t,e),s}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,e){let s="hsl("+p.p(e.getAttribute("hue"))+","+p.a(e.getAttribute("sat"))+","+p.a(e.getAttribute("lum"))+")";return s+=this.processAdjustments(t,e),s}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1){let n=i.localName;s+=n==="hue"||n==="hueOff"||n==="hueMod"?this.processAdjustmentElement(t,e,n,6e4):n==="gray"||n==="comp"||n==="inv"||n==="gamma"||n==="invGamma"?this.processAdjustmentElement(t,e,n,1):this.processAdjustmentElement(t,e,n)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class L extends M{visit(t,e,s){try{const r=t.evaluate("xfrm",e);if(r){D(r,s);const l={x:0,y:0,width:0,height:0},a=t.evaluate("off",r);a&&(l.x=p.c(a.getAttribute("x"))??0,l.y=p.c(a.getAttribute("y"))??0);const c=t.evaluate("ext",r);a&&(l.width=p.c(c.getAttribute("cx"))??0,l.height=p.c(c.getAttribute("cy"))??0),s.bounds=l}const o=t.evaluate("prstGeom",e);o?.hasAttribute("prst")?s.geometry=o?.getAttribute("prst"):t.evaluate("customGeom",e)&&console.warn("customGeom not supported yet");const i=this.processFill(t,e,s);i&&Object.keys(i).length>0&&(s.fill=i);const n=this.processStroke(t,e,s);return n&&Object.keys(n).length>0&&(s.stroke=n),s}catch(r){throw console.warn(r),new Error("Unexpected Error parsing Shape Properties element")}}}class N{visit(t,e,s){let r={};if(f(t,e,r,"grouping","grouping"),A(t,e,r,"varyColors","varyColors"),y(t,e,r,"gapWidth","gapWidth",.01),y(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),C(t,e,r,"bubbleScale","bubbleScale"),A(t,e,r,"showNegBubbles","showNegativeBubbleValues"),A(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),C(t,e,r,"firstSliceAng","startAngle"),C(t,e,r,"holeSize","holeSize"),f(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let o=t.getVisitorParamsState().get("types");o||(o=[],t.getVisitorParamsState().set("types",o)),o.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(r.length===0)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class Z extends N{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type=r==="col"?"column":"bar")}}class w{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);i!==null&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),n===!0?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(A(t,e,r,"showBubbleSize","showBubbleSize"),A(t,e,r,"showCatName","showCatName"),A(t,e,r,"showLeaderLines","showLeaderLines"),A(t,e,r,"showPercent","showPercentage"),A(t,e,r,"showSerName","showSerName"),A(t,e,r,"showVal","showVal"),A(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return l!==null&&(r.separator=l.textContent),f(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const o=r.getAttribute("formatCode");s.formatCode=o,r.hasAttribute("sourceLinked")&&(s.sourceLinked=r.getAttribute("sourceLinked")==="1")}}}const U=(u,t,e)=>{if(u.getValAttrAsBoolean("invertIfNegative",t)===!0)if(u.evaluate("extLst/ext/invertSolidFillFmt",t)){if(e.fill&&e.fillNegative){const s=u.getFromPath(e,"fill.solid.adjs");s&&u.setToPath(e,"fillNegative.solid.adjs",s)}}else{const s={val:"FFFFFF"},r={};r.solid=s,e.fillNegative=r;const o={val:"000000"},i={};i.solid=o;const n={};n.fill=i,e.strokeNegative=n}};class tt{visit(t,e,s){const r={};C(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;o!==null&&o.firstChild!==null&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),i!==null&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),n!==null&&(l=this.parsePointsAsString(t,n))),l!==null&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),C(t,e,r,"idx","idx"),A(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(r!==null){const o=r.firstChild.nodeValue;t.setToPath(s,"title.range",o)}else{const o=t.evaluate("tx/v",e);o!==null&&t.setToPath(s,"title.text.simpleRun",o.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let n=0;o&&r&&n<r;n++){let l=null,a=t.evaluate("pt[@idx='"+n+"']/v",e);a instanceof Node&&(l=a.textContent),i[n]=l}for(let n=0;n<i.length;n++)n>0&&(s+=","),i[n]!==void 0&&(s+=i[n]);return s+="}",s}afterVisit(t,e,s){U(t,e,s);let r=t.getFromPath(s,"points");if(r){const o=Object.keys(r);for(let i=0;i<o.length;i++){const n=o[i],l=t.getFromPath(r,n);if(!l)continue;let a=t.getFromPath(l,"markers");a&&(t.setToPath(s,"markers.points."+n,a),delete l.markers)}}}}class et{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return n!==null&&(o[n]=i),A(t,e,i,"bubble3D","bubble3D"),C(t,e,i,"explosion","explosion"),U(t,e,i),i}}class rt{visit(t,e,s){const r=e.parentNode.localName;if(r==="ser"||r==="dPt"){const o={},i=t.getValAttrAsString("size",e);i!==null&&(o.size=i);const n=t.getValAttrAsString("symbol",e);return n&&(o.type=n),s.markers=o,o}return null}}class x{visit(t,e,s){let r={};this.parseScaling(t,e,r),y(t,e,r,"majorUnit","majorUnits"),y(t,e,r,"minorUnit","minorUnits"),A(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),f(t,e,r,"majorTickMark","majorTickMarks"),f(t,e,r,"minorTickMark","minorTickMarks"),f(t,e,r,"crosses","crosses"),y(t,e,r,"crossesAt","crosses"),f(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),C(t,e,r,"lblOffset","labelOffset"),f(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=o!==null&&o===0,C(t,e,r,"tickMarkSkip","tickMarkSkip"),C(t,e,r,"tickLblSkip","labelInterval"),this.parseDisplayCustOrBuiltInUnit(e,t,r),this.parseTimeUnits(t,e,r,"majorUnitDates","majorTimeUnit","majorUnit"),this.parseTimeUnits(t,e,r,"minorUnitDates","minorTimeUnit","minorUnit"),f(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(l!==null){n.dem=l;let a=t.getValAttrAsString(i,e);n.amt=a}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);r!==null&&(r==="ctr"?s.labelAlign="center":r==="l"?s.labelAlign="left":r==="r"&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);r!==null&&(r==="b"?s.orientation="bottom":r==="l"?s.orientation="left":r==="r"?s.orientation="right":r==="t"&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);o!==null&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked=o.getAttribute("sourceLinked")==="1")),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);r!==null&&(s.inverted=r!=="minMax");const o=t.getValAttrAsFloat("scaling/logBase",e);o!==null&&(s.logBase=o,s.scaleType="log"),y(t,e,s,"scaling/max","max"),y(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);r!==null&&(t.setToPath(s,"labels.shown",r!==!0),t.setToPath(s,"shown",r!==!0));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",i!==null);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",n!==null);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",l!==null)}}class F{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),new L().visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=c=>{const h={};let g=t.evaluate("t",c);const m=t.evaluate("rPr",c);m&&this.parseTextProperties(t,m,h),g?h.text=g.firstChild.textContent??"":c.textContent&&(h.text=c.textContent??""),i.push(h)};if(n?.length!==void 0)for(let c=0;n&&c<n.length;c++)l(n.item(c));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&D(a,s)}parseTextProperties(t,e,s){if(!e)return;e.hasAttribute("sz")&&(s.size=parseFloat(e.getAttribute("sz"))/100),e.hasAttribute("b")&&(s.weight=e.getAttribute("b")==="1"?700:400),e.hasAttribute("i")&&(s.italic=e.getAttribute("i")==="1"),e.hasAttribute("u")&&(s.underline=e.getAttribute("u")),e.hasAttribute("strike")&&(s.strike=e.getAttribute("strike"));const r=t.evaluate("latin",e);if(r&&!r.getAttribute("typeface").startsWith("+")){const o=s.font??{};if(r.hasAttribute("typeface")&&(o.family=r.getAttribute("typeface")),r.hasAttribute("panose")){const i=r.getAttribute("panose");i&&(o.fallbacks=[d.IFont.getPanoseFallback(i)])}r.hasAttribute("pitchFamily")&&(o.pitch=r.getAttribute("pitchFamily")),r.hasAttribute("charset")&&(o.charset=r.getAttribute("charset")),Object.keys(o).length>0&&(s.font=o)}}}class st{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let o=t.getFromPath(r,"title");o||(o={},t.setToPath(r,"title",o));let i=o,n=t.getValAttrAsBoolean("delete",e);return n!==null&&(i.shown=!n),i}return s}}class ot{visit(t,e,s){const r={};return A(t,e,r,"overlay","overlay"),f(t,e,r,"legendPos","position"),s.legend=r,r}}class it extends L{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class j extends F{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const o=r.firstElementChild.nodeValue;t.setToPath(s,"range",o)}}visit(t,e,s){const r={};A(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const r=s.text?.rotation??null;r!==null&&(s.rotation=parseInt(r),delete s.title.rotation)}}}class nt{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let o={};y(t,r,o,"x","x"),y(t,r,o,"y","y"),y(t,r,o,"w","w"),y(t,r,o,"h","h"),f(t,r,o,"xMode","xMode"),f(t,r,o,"yMode","yMode"),f(t,r,o,"wMode","wMode"),f(t,r,o,"hMode","hMode"),Object.keys(o).length>0&&(s.manualLayout=o)}return s}}class lt{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class at extends M{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1){let l=n.localName;const a=t.evaluate(l,e),c=this.processAdjColor(t,a);r[l]=c}}return Object.keys(r).length>0&&(s.colors=r),r}}class ct{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(t,e,s){if(!e)return;const r=t.evaluate("latin",e);if(!r)return;const o=r.getAttribute("typeface");o&&(s.family=o);const i=r.getAttribute("panose");return i&&(s.fallbacks=[d.IFont.getPanoseFallback(i)]),s}}class ut{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const i=t.getRef(o);typeof i=="string"&&(r.address=i)}return t.copyFromAttribute(e,"tooltip",r),t.copyFromAttribute(e,"history",r,"history",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tgtFrame",r,"target"),s.hyperlink=r,r}}class ht{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(t,e){const s={type:d.IAutoFilter.Type.Color};return t.copyFromAttribute(e,"cellColor",s,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(e,"dxfId",s,"styleId",t.INT_COPY),s}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(t,e){const s={type:d.IAutoFilter.Type.Custom};t.copyFromAttribute(e,"and",s,"and",t.BOOLEAN_COPY);const r=e.childNodes;s.filters=[];for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType!==1)continue;let n=null;i.localName==="customFilter"&&(n=this.processCustomFilter(t,i)),n&&s.filters.push(n)}return s}processDynamicFilter(t,e){const s={type:d.IAutoFilter.Type.Dynamic};return t.copyFromAttribute(e,"type",s,"dynamicType"),t.copyFromAttribute(e,"val",s,"val",t.INT_COPY),t.copyFromAttribute(e,"maxVal",s,"maxVal",t.INT_COPY),s}processDateGroupItem(t,e){const s={};return t.copyFromAttribute(e,"dateTimeGrouping",s,"group"),t.copyFromAttribute(e,"day",s,"day",t.INT_COPY),t.copyFromAttribute(e,"hour",s,"hour",t.INT_COPY),t.copyFromAttribute(e,"minute",s,"minute",t.INT_COPY),t.copyFromAttribute(e,"month",s,"month",t.INT_COPY),t.copyFromAttribute(e,"second",s,"second",t.INT_COPY),t.copyFromAttribute(e,"year",s,"year",t.INT_COPY),s}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(t,e){const s={type:d.IAutoFilter.Type.Items};t.copyFromAttribute(e,"blank",s,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(e,"calendarType",s,"calendarType");let r=[],o=[];const i=e.childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1){if(l.localName==="dateGroupItem"){const a=this.processDateGroupItem(t,l);a&&r.push(a)}else if(l.localName==="filter"){const a=this.processFilterItem(t,l);a!==void 0&&o.push(a)}}}return r.length>0&&(s.dateGroups=r),o.length>0&&(s.items=o),s}processIcon(t,e){const s={type:d.IAutoFilter.Type.Icon};return t.copyFromAttribute(e,"iconId",s,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",s),s}processTop10(t,e){const s={type:d.IAutoFilter.Type.Top10};return t.copyFromAttribute(e,"filterVal",s,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(e,"percent",s,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(e,"top",s,"top",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val",t.FLOAT_COPY),s}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType!==1)continue;let l=null;n.localName==="colorFilter"?l=this.processColorFilter(t,n):n.localName==="customFilters"?l=this.processCustomFilters(t,n):n.localName==="dynamicFilter"?l=this.processDynamicFilter(t,n):n.localName==="filters"?l=this.processFilters(t,n):n.localName==="iconFilter"?l=this.processIcon(t,n):n.localName==="top10"&&(l=this.processTop10(t,n)),l&&o.push(l)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,e){if(!e)return null;const s={};if(!e.hasAttribute("colId"))return;s.offset=parseInt(e.getAttribute("colId"));let r=!1;return e.hasAttribute("hiddenButton")&&(r=p.b(e.getAttribute("hiddenButton"))),r&&(s.hiddenButton=!0),e.hasAttribute("showButton")&&(s.showButton=p.b(e.getAttribute("showButton"))),this.processFilterCriteria(t,e,s),s}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType===1&&n.localName==="filterColumn"){const l=this.processFilterColumn(t,n);l&&o.push(l)}}return o.length>0&&(s.fields=o),o}}class pt{visit(t,e,s){if(!e)return;const r={};if(t.copyFromAttribute(e,"ref",r),e.hasAttribute("caseSensitive")){const n=p.b(e.getAttribute("caseSensitive"));r.collatorOptions=n?d.Sort.CaseSensitiveOptions:d.Sort.CaseInsensitiveOptions}const o=e.getAttribute("sortMethod");o!=null&&o!=="none"&&(o==="stroke"?r.collatorOptions={...r.collatorOptions,collation:"stroke"}:o==="pinYin"&&(r.collatorOptions={...r.collatorOptions,collation:"pinyin"})),e.hasAttribute("columnSort")&&p.b(e.getAttribute("columnSort"))&&(r.orientation=d.IRange.Orientation.Column);const i=d.AddressUtils.fastStringToRange(r.ref);return this.processSortConditions(t,e,r,i),Object.keys(r).length>0&&(s.sort=r),r}processSortCondition(t,e,s){if(!e)return null;const r={};if(e.hasAttribute("ref")){if(e.hasAttribute("ref")){const o=e.getAttribute("ref"),i=d.AddressUtils.fastStringToRange(o);r.offset=s?i.colStart-s.colStart:i.colStart}return r.reverse=!1,e.hasAttribute("descending")&&(r.reverse=p.b(e.getAttribute("descending"))),t.copyFromAttribute(e,"sortBy",r,"sortOn"),t.copyFromAttribute(e,"dxfId",r),t.copyFromAttribute(e,"iconSet",r),t.copyFromAttribute(e,"customList",r),r}console.warn("no ref for sort conditional",t.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let n=0;n<o.length;n++){const l=o.item(n);if(l.nodeType===1&&l.localName==="sortCondition"){const a=this.processSortCondition(t,l,r);a&&i.push(a)}}return i.length>0&&(s.fields=i),i}}class z{visit(t,e,s){}processDataBarColor(t,e,s,r,o="dk1"){if(!e)return;const i=p.d(n=>e.getAttribute(n),o);return i&&(s[r]=i),s}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType===1&&n.localName==="font"){const l={};this.processFont(t,n,l),s[o++]=l}}return s}processFont(t,e,s){t.getValAttrAsBoolean("b",e,!0)&&(s.weight=700),t.getValAttrAsBoolean("i",e,!0)&&(s.style=d.IFont.Style.Italic),t.getValAttrAsBoolean("strike",e,!0)&&(s.strike=!0);const r=t.evaluate("u",e);if(r){const n=r.getAttribute("val");s.underline=n||d.IFont.UnderlineStyle.Single}f(t,e,s,"vertAlign","verticalAlign"),s.verticalAlign==="superscript"?s.verticalAlign=d.IFont.VerticalAlignment.Super:s.verticalAlign==="subscript"&&(s.verticalAlign=d.IFont.VerticalAlignment.Sub),y(t,e,s,"sz","size");const o=t.evaluate("color",e);this.processDataBarColor(t,o,s,"fill"),s.fill||(s.fill="dk1"),f(t,e,s,"name","family"),f(t,e,s,"rFont","family");const i=t.evaluate("family",e);if(i){const n=i.getAttribute("val");if(n)switch(n){case"1":s.fallbacks=["serif"];break;case"2":s.fallbacks=["sans-serif"];break;case"3":s.fallbacks=["monospace"];break;case"4":s.fallbacks=["cursive"];break;case"5":s.fallbacks=["fantasy"]}}return f(t,e,s,"scheme","scheme"),A(t,e,s,"shadow","shadow",!0),A(t,e,s,"outline","outline",!0),t.getValAttrAsBoolean("condense",e,!0)&&(s.letterSpacing=-1),t.getValAttrAsBoolean("extend",e,!0)&&(s.letterSpacing=1),f(t,e,s,"charset","charset"),s}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="fill"&&this.processFill(t,n,s,o++)}return s}processFill(t,e,s,r){const o={type:d.IFill.Type.None},i=e.childNodes;let n=!1;for(let l=0;!n&&l<i.length;l++){const a=i.item(l);a.nodeType===1&&(a.localName==="gradientFill"?(this.processGradientFill(t,a,o),n=!0):a.localName==="patternFill"&&(this.processPatternFill(t,a,o),n=!0))}return s[r]=o,s}processGradientFill(t,e,s){if(!e)return;s.type=d.IFill.Type.Gradient;const r=[];s.stops=r,s.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const o=e.getAttribute("type");o&&(s.gradientType=o);const i=l=>{if(!l)return 0;const a=parseFloat(l);return isNaN(a)?0:a};(e.hasAttribute("left")||e.hasAttribute("top")||e.hasAttribute("right")||e.hasAttribute("bottom"))&&(s.fillTo={left:i(e.getAttribute("left")),top:i(e.getAttribute("top")),right:i(e.getAttribute("right")),bottom:i(e.getAttribute("bottom"))});const n=e.childNodes;for(let l=0;l<n.length;l++){const a=n.item(l);if(a.nodeType===1&&a.localName==="stop"){const c={};r.push(c);const h=parseFloat(a.getAttribute("position"));c.offset=h;const g=t.evaluate("color",a);this.processDataBarColor(t,g,c,"color")}}return s}processPatternFill(t,e,s){if(!e)return;const r=t.getVisitorParamsState().get("processingDXFs"),o=e.getAttribute("patternType")||(r?d.IFill.BuiltInSheetPattern.Solid:d.IFill.BuiltInSheetPattern.None);if(o===d.IFill.BuiltInSheetPattern.None)return{none:!0};s.type=d.IFill.Type.Pattern,o&&(s.patternType=o);let i,n="foreground",l="background";const a=s.patternType===d.IFill.BuiltInSheetPattern.Solid&&r;if(a){i="lt1";const g=n;n=l,l=g}const c=t.evaluate("fgColor",e);this.processDataBarColor(t,c,s,n,i);const h=t.evaluate("bgColor",e);return this.processDataBarColor(t,h,s,l,i),a&&!s.foreground&&(s.foreground=i),s}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let n=0;n<o.length;n++){const l=o.item(n);l.nodeType===1&&l.localName==="border"&&this.processBorder(t,l,s,i++,r)}return s}processBorder(t,e,s,r,o){if(!e)return;const i={};return this.processBorderStroke(t,e,i,d.IBorder.Edge.Left),this.processBorderStroke(t,e,i,d.IBorder.Edge.Right),o?(i.right||i.left)&&(i.right?i.vertical={...i.right}:i.vertical={...i.left}):this.processBorderStroke(t,e,i,d.IBorder.Edge.Vertical),this.processBorderStroke(t,e,i,d.IBorder.Edge.Top),this.processBorderStroke(t,e,i,d.IBorder.Edge.Bottom),o?(i.bottom||i.top)&&(i.right?i.horizontal={...i.bottom}:i.horizontal={...i.top}):this.processBorderStroke(t,e,i,d.IBorder.Edge.Horizontal),s[r]=i,s}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class gt extends z{visit(t,e,s){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const r={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),r.fonts),this.processFills(t,t.evaluate("fills",e),r.fills),this.processBorders(t,t.evaluate("borders",e),r.borders,!0),r.fills[0]={type:d.IFill.Type.None},r.fills[1]={type:d.IFill.Type.Pattern,patternType:d.IFill.BuiltInSheetPattern.Gray125},r.borders[0]={};const o=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),o,r,null,!1);const i=new Map;if(o.length>0){const a=[];this.processCellStyles(t,t.evaluate("cellStyles",e),a,o,i),s.named=a}const n=[];this.processXFs(t,t.evaluate("cellXfs",e),n,r,i),Object.keys(n).length>0&&(s.direct=n);const l=[];return this.processDXFs(t,t.evaluate("dxfs",e),l),this.processTableStyles(t,t.evaluate("tableStyles",e),s,l),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),s),this.processMruColors(t,t.evaluate("colors/mruColors",e),s),s}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="rgbColor"){const l={color:null};this.processDataBarColor(t,n,l,"color"),l.color&&r.push(l.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="color"){const l={color:null};this.processDataBarColor(t,n,l,"color"),l.color&&r.push(l.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="numFmt"){const l=n.getAttribute("numFmtId"),a=n.getAttribute("formatCode");if(l&&a){const c=a.replace(/\\(.)/g,"$1");r.set(parseInt(l),c)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let l=0;l<n.length;l++){const a=n.item(l);if(a.nodeType===1&&a.localName==="xf"){const c={};this.processXF(t,a,c,r,o,i),s.push(c)}}}processXF(t,e,s,r,o,i){if(!e)return;const n=e.getAttribute("xfId");if(n&&o){const c=o.get(parseInt(n));c&&c!==d.IStyle.BuiltInName.Normal&&(s.named=c)}const l=c=>!(!i&&e.hasAttribute(c))||p.b(e.getAttribute("applyFont"));if(l("applyFont")){const c=r.fonts[e.getAttribute("fontId")];c&&(s.font=c)}if(l("applyFill")){const c=r.fills[e.getAttribute("fillId")];c&&Object.keys(c).length>0&&(s.fill=c)}if(l("applyBorder")){const c=r.borders[e.getAttribute("borderId")];c&&Object.keys(c).length>0&&(s.border=c)}if(l("applyNumberFormat")){const c=e.getAttribute("numFmtId");if(c){const h=parseInt(c);let g;const m=t.getVisitorParamsState();if(m){const b=m.get("numFmts");b&&(g=b.get(h)),s.numberFormat=g??h}else console.warn("no visitor params state")}}l("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",e),s),l("applyProtection")&&this.processProtection(t,t.evaluate("protection",e),s);const a=p.b(e.getAttribute("quotePrefix"));a&&(s.quotePrefix=a)}processAlignment(t,e,s){const r={};if(e?.hasAttribute("horizontal")?r.horizontal=e.getAttribute("horizontal"):r.horizontal=d.ITextFrame.HorizontalAlignment.General,e?.hasAttribute("vertical")?r.vertical=e.getAttribute("vertical"):r.vertical=d.ITextFrame.VerticalAlignment.Bottom,e?.hasAttribute("indent")?r.indent=parseInt(e.getAttribute("indent")):r.indent=0,e?.hasAttribute("relativeIndent")?r.relativeIndent=parseInt(e.getAttribute("relativeIndent")):r.relativeIndent=0,p.b(e?.getAttribute("wrapText"))?r.overflow=d.ITextFrame.Overflow.Wrap:r.overflow=d.ITextFrame.Overflow.Visible,p.b(e?.getAttribute("shrinkToFit"))&&(r.overflow=d.ITextFrame.Overflow.Shrink),e?.hasAttribute("textRotation")){let i=parseFloat(e.getAttribute("textRotation"));i>0&&i<=90?i=360-i:i>90&&i<=180?i-=90:i===255&&(i=0,r.stacked=!0),r.rotation=i}else r.rotation=0;e?.hasAttribute("justifyLastLine")&&(r.justifyLastLine=p.b(e.getAttribute("justifyLastLine")));const o=e?.getAttribute("readingOrder");return o&&(o==="0"?r.readingDirection=d.ITextFrame.ReadingDirection.Auto:o==="1"?r.readingDirection=d.ITextFrame.ReadingDirection.LeftToRight:o==="2"?r.readingDirection=d.ITextFrame.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${o}`)),Object.keys(r).length>0&&(s.alignment=r),s}processProtection(t,e,s){if(!e)return;const r={},o=e.getAttribute("locked");o&&!p.b(o)&&(r.edit=!0);const i=e.getAttribute("hidden");return i&&p.b(i)&&(r.formulaHidden=!0),Object.keys(r).length>0&&(s.protection=r),s}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="font"){const n={};this.processFont(t,i,n),s.font=n}else if(i.nodeType===1&&i.localName==="fill"){const n=[];this.processFill(t,i,n,0),n.length>0&&n[0]&&(s.fill=n[0])}else if(i.nodeType===1&&i.localName==="border"){const n=[];this.processBorder(t,i,n,0,!1),n.length>0&&n[0]&&(s.border=n[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="dxf"){const l={};this.processDXF(t,n,l);const a=s.length;r.set(a,l),s.push(l)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,e,s,r,o=!1){const i=e.getAttribute("name"),n={name:i};e.hasAttribute("table")&&(n.table=p.b(e.getAttribute("table"))),e.hasAttribute("pivot")&&(n.pivot=p.b(e.getAttribute("pivot"))),o&&!n.pivot&&r.unshift(null);const l=e.childNodes;for(let a=0;a<l.length;a++){const c=l.item(a);if(c.nodeType===1&&c.localName==="tableStyleElement"){const h=c.getAttribute("type"),g=c.getAttribute("dxfId");let m=r?.[g];m||(console.warn("invalid dfx id",g),m={}),n[h]=m;let b=null;c.hasAttribute("size")&&(b=parseInt(c.getAttribute("size"))),b&&!isNaN(b)&&(m.size=b)}}delete n.name,s[i]=n}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let h=0;h<a.length;h++){const g=a.item(h);g.nodeType===1&&g.localName==="tableStyle"&&this.processTableStyle(t,g,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,e,s,r,o){if(!e)return;const i=e.childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1&&l.localName==="cellStyle"){const a=parseInt(l.getAttribute("xfId")),c=l.getAttribute("name");if(o.set(a,c),!r[a])continue;const h={name:c,style:r[a]};l.getAttribute("hidden")&&(h.hidden=p.b(l.getAttribute("hidden"))),l.getAttribute("iLevel")&&(h.iLevel=parseInt(l.getAttribute("iLevel"))),s.push(h)}}}afterVisit(t,e,s){}}class dt extends z{visit(t,e,s){return this.processSheetRefs(t,t.evaluate("sheets",e),s),this.processBookViews(t,t.evaluate("bookViews",e),s),this.processDefinedNames(t,t.evaluate("definedNames",e),s),this.processCalcPr(t,t.evaluate("calcPr",e),s),this.processWorkbookProtection(t,t.evaluate("workbookProtection",e),s),this.processWorkbookPr(t,t.evaluate("workbookPr",e),s),s}processPassword(t,e,s,r="password"){if(!e)return;const o={};t.copyFromAttribute(e,"algorithmName",o,"algorithmName"),t.copyFromAttribute(e,"hashValue",o,"hashValue"),t.copyFromAttribute(e,"saltValue",o,"saltValue",t.BOOLEAN_COPY),t.copyFromAttribute(e,"spinCount",o,"spinCount",t.INT_COPY),Object.keys(o).length>0&&(s[r]=o)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=i=>i!==!0&&i!=="1"&&i!=="on"&&i!=="true"&&(i===!1||i==="0"||i==="off"||i==="false"||null);return t.copyFromAttribute(e,"lockStructure",r,"structure",o),t.copyFromAttribute(e,"lockWindows",r,"windows",o),t.copyFromAttribute(e,"lockRevision",r,"revision",o),s.protection=r,s}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);n.nodeType===1&&n.localName==="sheet"&&this.processSheetRef(t,n,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="workbookView"&&(this.processWorkbookView(t,n,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,o=>o+1]),e.hasAttribute("activeTab")||(r.activeSheetId=1),t.copyFromAttribute(e,"showHorizontalScroll",r,"showHorizontalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showVerticalScroll",r,"showVerticalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showSheetTabs",r,"showTabs",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tabRatio",r,"tabRatio",[t.FLOAT_COPY,o=>o]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&i.nodeType===3&&(o.ref=i.textContent),t.copyFromAttribute(e,"name",o),t.copyFromAttribute(e,"comment",o),t.copyFromAttribute(e,"hidden",o,"hidden",t.BOOLEAN_COPY),e.hasAttribute("localSheetId")){const n=e.getAttribute("localSheetId");if(!r[n]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);o.scope=r[n].name}t.copyFromAttribute(e,"customMenu",o),t.copyFromAttribute(e,"description",o),t.copyFromAttribute(e,"statusBar",o),t.copyFromAttribute(e,"help",o),t.copyFromAttribute(e,"shortcutKey",o),t.copyFromAttribute(e,"function",o,"function",t.BOOLEAN_COPY),t.copyFromAttribute(e,"functionGroupId",o,"functionGroupId",t.INT_COPY),t.copyFromAttribute(e,"publishToServer",o,"publishToServer",t.BOOLEAN_COPY),t.copyFromAttribute(e,"vbProcedure",o,"vbProcedure",t.BOOLEAN_COPY),t.copyFromAttribute(e,"xlm",o,"xlm",t.BOOLEAN_COPY),Object.keys(o).length>0&&s.push(o)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);n.nodeType===1&&n.localName==="definedName"&&this.processDefineName(t,n,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class mt{visit(t,e,s){return t.copyFromAttribute(e,"name",s),t.copyFromAttribute(e,"displayName",s),t.copyFromAttribute(e,"ref",s),t.copyFromAttribute(e,"headerRowCount",s,"headerRowCount",t.INT_COPY),t.copyFromAttribute(e,"totalsRowCount",s,"totalsRowCount",t.INT_COPY),this.processTableColumns(t,e,s),this.processTableStyleInfo(t,e,s),s}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="tableStyleInfo"&&(t.copyFromAttribute(n,"name",o),t.copyFromAttribute(n,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="tableColumn"){const n={};t.copyFromAttribute(i,"name",n),t.copyFromAttribute(i,"uniqueName",n),s.push(n)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="tableColumns"&&this.processTableColumn(t,n,o)}o.length>0&&(s.columns=o)}}class bt{visit(t,e,s){return s}}class k{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"editAs",r,"anchorType"),r.anchor={},this.processOffsetCoord(t,t.evaluate("from",e),r.anchor,"from"),this.processOffsetCoord(t,t.evaluate("to",e),r.anchor,"to"),s.movables||(s.movables=[]),s.movables.push(r),r}processOffsetCoord(t,e,s,r){if(!e)return;const o={c:0,r:0,x:0,y:0};return t.evaluate("col",e)&&(o.c=parseInt(t.evaluate("col",e).textContent)),t.evaluate("row",e)&&(o.r=parseInt(t.evaluate("row",e).textContent)),t.evaluate("colOff",e)&&(o.x=p.c(t.evaluate("colOff",e).textContent)),t.evaluate("rowOff",e)&&(o.y=p.c(t.evaluate("rowOff",e).textContent)),r==="from"?s.tl=o:s.br=o,s}}class B{visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);return r&&(t.copyFromAttribute(r,"name",s),t.copyFromAttribute(r,"desc",s),t.copyFromAttribute(r,"hidden",s,"hidden",t.BOOLEAN_COPY),t.copyFromAttribute(r,"id",s)),s}}class At extends B{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const n=t.evaluate("graphicFrameLocks",r);if(n){n.hasAttribute("noChangeAspect")&&(s.lockAspect=n.getAttribute("noChangeAspect")==="1");const l={};Object.keys(l).length>0&&(s.locks=l)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1)try{let a=l.localName;a==="chart"&&(a="chart"),o.type=a;const c=l.getAttribute("r:id");c&&(o.json=t.getRef(c))}catch(a){console.warn("Unable to parse graphicFrame",a)}}return o&&(s.content=o),o}}class _ extends B{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const i=t.evaluate("spLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class ft extends B{visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const a=t.evaluate("picLocks",o);if(a){a.hasAttribute("noChangeAspect")&&(r.lockAspect=a.getAttribute("noChangeAspect")==="1");const c={};t.copyFromAttribute(a,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(c).length>0&&(r.locks=c)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const a=i.getAttribute("r:embed")??i.getAttribute("embed");if(!a)return void console.warn("no rId found for blip",i);n=t.getRef(a,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class yt extends _{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const i=t.evaluate("grpSpLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class vt extends _{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const i=t.evaluate("cxnSpLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const R="richTypes";class Ft{visit(t,e,s){let r=t.getVisitorParamsState().get(R);r||(r=[],t.getVisitorParamsState().set(R,r));const o=e.childNodes,i=o.length;for(let n=0;n<i;n++){const l=o.item(n);if(l.nodeType===1&&l.localName==="s"){const a={type:l.getAttribute("t")??"n",keys:[]};this.processKeys(t,l,a),r.push(a)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let n=0;n<o;n++){const l=r.item(n);if(l.nodeType===1&&l.localName==="k"){const a=l.getAttribute("n"),c=l.getAttribute("t");i.push([a,c])}}}}const E="richData";class Ct{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(E);o||(o=[],t.getVisitorParamsState().set(E,o));const i=e.childNodes,n=i.length;for(let l=0;l<n;l++){const a=i.item(l);if(a.nodeType===1&&a.localName==="rv"){const c=r[a.getAttribute("s")],h={type:c.type};this.processValues(t,a,h,c);const g=this.mapType(t,h);o.push(g)}}return s.richData=o,o}mapType(t,e){if(e.type==="_error"){const s=e.errorType;if(s)try{e=d.FormulaError.getBuiltInById(s+1)}catch{}}return e}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let l=0;l<i;l++){const a=o.item(l);if(a.nodeType===1&&a.localName==="v"){const c=n[l];if(!c)return void t.warn("Invalid richData");const h=c[0],g=c[1];let m=a.textContent;g==="i"&&(m=Number(m)),s[h]=m}}}}class wt{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="author"){const n=i.firstChild;n&&n.nodeType===3&&s.push(n.textContent)}}}}class Pt{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"authorId",r,"authorId",t.INT_COPY),r.asNote=!0,s.comments||(s.comments=[]),s.comments.push(r),r}}class Nt{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class Ot{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"id",r,"id",p.r),t.copyFromAttribute(e,"personId",r,"personId",p.r),t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"parentId",r,"parentId",p.r),t.copyFromAttribute(e,"dT",r),e.hasAttribute("done")&&(r.done=p.b(e.getAttribute("done"))),s.push(r),r}}class Tt{visit(t,e,s){const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="person"){const l={};t.copyFromAttribute(n,"id",l,"id",p.r),t.copyFromAttribute(n,"displayName",l),t.copyFromAttribute(n,"userId",l,"userId",p.r),t.copyFromAttribute(n,"providerId",l),r.push(l)}}return r.length>0&&(s.persons=r),r}}const St={};class Vt{constructor(t,e){this.path=t,this.visitor=e}}class Y{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new H),this.registerVisitor("spPr",new L),this.registerVisitor("txBody",new F),this.registerVisitor("txPr",new F),this.registerVisitor("c:chartSpace",new q),this.registerVisitor("c:chartSpace",new J,"chart"),this.registerVisitor("c:plotArea",new Q),this.registerVisitor("c:barChart",new Z),this.registerVisitor("c:doughnutChart",new N),this.registerVisitor("c:lineChart",new N),this.registerVisitor("c:ofPieType",new N),this.registerVisitor("c:pieChart",new N),this.registerVisitor("c:scatterChart",new N),this.registerVisitor("c:barChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new w("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new tt),this.registerVisitor("c:dPt",new et),this.registerVisitor("c:marker",new rt),this.registerVisitor("c:catAx",new x),this.registerVisitor("c:valAx",new x),this.registerVisitor("c:dateAx",new x),this.registerVisitor("c:majorGridlines",new V("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new V("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new F("labels.text"),"txPr"),this.registerVisitor("c:valAx",new F("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new F("labels.text"),"txPr"),this.registerVisitor("c:legend",new ot),this.registerVisitor("c:legend",new F("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new st),this.registerVisitor("c:ser",new it,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new w("labels"),"dLbls"),this.registerVisitor("c:dLbl",new w("points")),this.registerVisitor("c:title",new j),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new nt),this.registerVisitor("c:dispUnits",new V("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new j("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new F,"tx/rich"),this.registerVisitor("a:theme",new lt),this.registerVisitor("a:theme",new at,"themeElements/clrScheme"),this.registerVisitor("a:theme",new ct,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new ht),this.registerVisitor("sortState",new pt),this.registerVisitor("s:workbook",new dt),this.registerVisitor("styleSheet",new gt),this.registerVisitor("table",new mt),this.registerVisitor("hlinkClick",new ut),this.registerVisitor("wsDr",new bt),this.registerVisitor("twoCellAnchor",new k),this.registerVisitor("oneCellAnchor",new k),this.registerVisitor("absoluteAnchor",new k),this.registerVisitor("graphicFrame",new At),this.registerVisitor("sp",new _),this.registerVisitor("grpSp",new yt),this.registerVisitor("cxnSp",new vt),this.registerVisitor("pic",new ft),this.registerVisitor("rvStructures",new Ft),this.registerVisitor("rvData",new Ct),this.registerVisitor("comments",new wt),this.registerVisitor("commentList",new Pt,"comment"),this.registerVisitor("comment",new F("content"),"text"),this.registerVisitor("ThreadedComments",new Nt),this.registerVisitor("threadedComment",new Ot),this.registerVisitor("threadedComment",new F("content"),"text"),this.registerVisitor("personList",new Tt)}registerVisitor(t,e,s=null){t.indexOf(":")===-1&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new Vt(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=St){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);if(i||(i=this.visitorsByXmlTagName.get(r.localName)),!i)throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);const n="/"+r.localName,l=new S(null,this,n,r,o,e,s),a=[];this._doWalk(i,l,a,r,o,e,s);for(let c=0;c<a.length;c++){const h=a[c];try{h.visitor?.afterVisit?.(h.context,h.elemParent,h.jsonParent)}catch(g){console.warn(`Error in afterVisit: ${h.context.getPath()}`,g)}}return o}_walkScoped(t,e,s,r,o,i,n){const l=this.scopedVisitorsByXmlTagName.get(t);for(let a=0;l&&a<l.length;a++){const c=l[a];let h=null;try{h=e.evaluate(c.path,r)}catch{console.warn(`"Invalid path '${c.path}' for '${t}'.`)}if(!h)continue;const g=m=>{let b=m.localName,v=m.parentNode;for(;v&&v!==r;)b=v.localName+"/"+b,v=v.parentNode;const P=e.getPath()+"/"+b;if(c.visitor){const T=new S(e,this,P,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c.visitor,T,s,m,o,i,n)}};if(h.length>0){const m=h;for(let b=0;b<m.length;b++)g(m.item(b))}else g(h)}}_doWalk(t,e,s,r,o,i,n){let l=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),l=t.visit(e,r,o)),l||(l=o);const a=r.localName;this._walkScoped(a,e,s,r,l,i,n);const c=r.childNodes;for(let h=0;h<c.length;h++){const g=c.item(h);if(g.nodeType===1){const m=g,b=m.localName,v=this.visitorsByXmlTagName.get(b),P=e.getPath()+"/"+b,T=new S(e,this,P,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(v,T,s,m,l??o,i,n)}}return l}}exports.FromOOXMLConverter=Y,exports.default=Y;
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./COuWkDpDO5rzQ1GV.cjs"),p=require("./Di7PtE7OiDhSqLbA.cjs"),d=require("@sheetxl/sdk");class G{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let s=0;s<this.list.length;s++)t(this.list[s],s,this)}}const W=u=>u===!0||u==="1"||u==="on"||u==="true"||u!==!1&&u!=="0"&&u!=="off"&&u!=="false"&&null,X=u=>{const t=parseInt(u);return isNaN(t)?null:t},$=u=>{const t=parseFloat(u);return isNaN(t)?null:t},K=new Map;class S{constructor(t,e,s,r,o,i=null,n){const l=(c,h,g)=>n?.getRef?.(c,h,g,n?.parsedRefs),a=c=>n?.getRefs?.(c,n?.parsedRefs);this._parent=t,this.sharedShared=e,this.currentPath=s,this.elemRoot=r,this.jsonRoot=o,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs):(i&&(this._fileLocation=i),l&&a&&(this._getRef=l),a&&(this._getRefs=a),this._onWarning=n?.onWarning,this._addPerson=n?.addPerson)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??K}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let s=[e];const r=t.split("/");for(let o=0;o<r.length;o++){const i=r[o];if(i===""||i===".")continue;let n=[];for(let l=0;l<s.length;l++){const a=s[l],c=a.childNodes;for(let h=0;c&&h<c.length;h++){const g=a.childNodes[h];g.localName!==i&&i!=="*"||n.push(g)}}s=n}return s.length===1?s[0]:s.length===0?null:new G(s)}getFromPath(t,e){return I.Yt.getFromPath(t,e)}setToPath(t,e,s){return I.Yt.setToPath(t,e,s)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return o==null?s:o==="1"||o==="on"||o==="true"||o!=="0"&&o!=="off"&&o!=="false"&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return W}get INT_COPY(){return X}get FLOAT_COPY(){return $}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o){if(Array.isArray(o)){for(let n=0;n<o.length;n++)if(i==null||(i=o[n](i),i==null))return}else if(i==null||(i=o(i),i==null))return}this.setToPath(s,r,i)}}class V{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class H{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);i.nodeType===1&&i.localName==="Relationship"&&this.processRelationship(t,i,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const D=(u,t)=>{if(u||!u.hasAttribute("rot"))return;const e=u.getAttribute("rot"),s=I.Yt.roundAccurately(p.p(e),2);s!==-1e3&&(t.rotation=s)},f=(u,t,e,s,r)=>{const o=u.getValAttrAsString(s,t);o!==null&&(e[r]=o)},A=(u,t,e,s,r=s,o=null)=>{const i=u.getValAttrAsBoolean(s,t,o);i!==null&&(e[r]=i)},C=(u,t,e,s,r)=>{const o=u.getValAttrAsInteger(s,t);o!==null&&(e[r]=o)},y=(u,t,e,s,r,o=1)=>{const i=u.getValAttrAsFloat(s,t);i!==null&&(e[r]=i*o)};class q{visit(t,e,s){return A(t,e,s,"roundedCorners","roundedCorners"),C(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let m=0;m<c.length;m++){const b=c[m];if(b.xAxisId){const v=b.xAxisId,P=a.get(v);o[m+""]=P,b.offsetXAxis=m,delete b.xAxisId,s.xAxes=o,o.length=++i}if(b.yAxisId){const v=b.yAxisId,P=a.get(v);n[m+""]=P,b.offsetYAxis=m,delete b.yAxisId,s.yAxes=n,n.length=++l}r[m+""]=b}r.length=c.length;const h=t.getVisitorParamsState().get("series");if(!h||h.length===0)return;const g={};s.series=g;for(let m=0;m<h.length;m++)g[m+""]=h[m];g.length=h.length}}class J{visit(t,e,s){return A(t,e,s,"plotVisOnly","plotVisOnly"),f(t,e,s,"dispBlanksAs","dispBlanksAs"),A(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),A(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(r===!0||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",i!==null)}catch(r){throw new Error("Unexpected Error parsing Chart: "+r)}}}class Q{visit(t,e,s){let r={};return s.plotArea=r,r}}class O{EnumMappings(){}static fromOoxmlGradientType(t){return t==="circle"?"radial":t}static fromOoxmlLineCap(t){if(t==="rnd")return"round";if(t==="flat")return"butt";if(t==="sq")return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return t==="sng"?"single":t}static fromOoxmlAlignment(t){return t==="ctr"?"center":t}}class M{visit(t,e,s){}processStroke(t,e,s){const r={},o=t.evaluate("ln",e);if(o){o.hasAttribute("algn")&&(r.align=O.fromOoxmlAlignment(o.getAttribute("algn"))),o.hasAttribute("cap")&&(r.lineCap=O.fromOoxmlLineCap(o.getAttribute("cap"))),o.hasAttribute("cmpd")&&(r.compound=O.fromOoxmlCompound(o.getAttribute("cmpd"))),o.hasAttribute("w")&&(r.width=p.t(o.getAttribute("w")));const i=t.evaluate("miter",o);i&&(r.lineJoin="miter",i.hasAttribute("lim")&&(r.miter=parseFloat(i.getAttribute("lim")))),t.evaluate("bevel",o)&&(r.lineJoin="bevel"),t.evaluate("round",o)&&(r.lineJoin="round");const n=t.evaluate("custDash",o);if(n){const c=t.evaluate("ds",n);if(c&&c.length>0){let h="";for(let g=0;g<c.length;g++){const m=c.item(g);h+=p.a(m.getAttribute("d"))+","+p.a(m.getAttribute("sp"))}r.dash=h}}const l=t.evaluate("prstDash",o);l&&l.hasAttribute("val")&&(r.dash=l.getAttribute("val")),this.parseEndElement(t,o,r,"headEnd","head"),this.parseEndElement(t,o,r,"tailEnd","tail");const a=this.processFill(t,o,s);r.fill=a}return r}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const n=i.getAttribute("len")?i.getAttribute("len"):"med",l=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=n+"-"+l}}processFill(t,e,s){const r={};if(t.evaluate("noFill",e))return r.none=!0,r;const o=t.evaluate("solidFill",e);if(o){const a=this.processAdjColor(t,o);return a&&(r.solid=a),r}const i=t.evaluate("gradFill",e);if(i){i.hasAttribute("rotWithShape")&&(r.isRotated=i.getAttribute("rotWithShape")==="1");const a=this.processGradFill(t,i);return r.gradient=a,r}const n=t.evaluate("pattFill",e);if(n){const a=this.processPatternFill(t,n);return r.pattern=a,r}const l=t.evaluate("blipFill",e);if(l){l.hasAttribute("rotWithShape")&&(r.isRotated=p.b(l.getAttribute("rotWithShape"))),l.hasAttribute("dpi")&&(r.dpi=l.getAttribute("dpi"));const a=this.processImageFill(t,l);return r.image=a,r}return r.none=!0,r}processGradFill(t,e){const s={},r=t.evaluate("lin",e);if(r){if(s.type="linear",r.hasAttribute("ang")){const c=p.p(r.getAttribute("ang"));s.angle=c}if(r.hasAttribute("scaled")){const c=p.b(r.getAttribute("scaled"));s.scaled=c}}const o={};e.hasAttribute("flip")&&(o.mirror=e.getAttribute("flip")),Object.keys(o).length>0&&(s.tile=o);const i=t.evaluate("path",e);if(i){i.hasAttribute("path")&&(s.type=O.fromOoxmlGradientType(i.getAttribute("path")));const c=t.evaluate("fillToRect",i);c&&(s.fillTo=this.getRect(c))}const n=t.evaluate("tileRect",e);n&&(s.tile.bounds=this.getRect(n));const l=[],a=t.evaluate("gsLst/gs",e);for(let c=0;a&&c<a.length;c++){const h=a.item(c),g={offset:p.a(h.getAttribute("pos")),color:this.processAdjColor(t,h)};l.push(g)}return l.length>0&&(s.stops=l),s}getRect(t){const e={};return t.hasAttribute("t")&&(e.t=p.a(t.getAttribute("t"))),t.hasAttribute("l")&&(e.l=p.a(t.getAttribute("l"))),t.hasAttribute("b")&&(e.b=p.a(t.getAttribute("b"))),t.hasAttribute("r")&&(e.r=p.a(t.getAttribute("r"))),Object.keys(e).length===0?null:e}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const n=this.processAdjColor(t,o);n&&(s.background=n)}const i=t.evaluate("fgClr",e);if(i){let n=this.processAdjColor(t,i);n&&(s.foreground=n)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,e){let s="lrgba("+p.a(e.getAttribute("r"))+","+p.a(e.getAttribute("g"))+","+p.a(e.getAttribute("b"))+")";return s+=this.processAdjustments(t,e),s}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,e){let s="hsl("+p.p(e.getAttribute("hue"))+","+p.a(e.getAttribute("sat"))+","+p.a(e.getAttribute("lum"))+")";return s+=this.processAdjustments(t,e),s}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1){let n=i.localName;s+=n==="hue"||n==="hueOff"||n==="hueMod"?this.processAdjustmentElement(t,e,n,6e4):n==="gray"||n==="comp"||n==="inv"||n==="gamma"||n==="invGamma"?this.processAdjustmentElement(t,e,n,1):this.processAdjustmentElement(t,e,n)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class L extends M{visit(t,e,s){try{const r=t.evaluate("xfrm",e);if(r){D(r,s);const l={x:0,y:0,width:0,height:0},a=t.evaluate("off",r);a&&(l.x=p.c(a.getAttribute("x"))??0,l.y=p.c(a.getAttribute("y"))??0);const c=t.evaluate("ext",r);a&&(l.width=p.c(c.getAttribute("cx"))??0,l.height=p.c(c.getAttribute("cy"))??0),s.bounds=l}const o=t.evaluate("prstGeom",e);o?.hasAttribute("prst")?s.geometry=o?.getAttribute("prst"):t.evaluate("customGeom",e)&&console.warn("customGeom not supported yet");const i=this.processFill(t,e,s);i&&Object.keys(i).length>0&&(s.fill=i);const n=this.processStroke(t,e,s);return n&&Object.keys(n).length>0&&(s.stroke=n),s}catch(r){throw console.warn(r),new Error("Unexpected Error parsing Shape Properties element")}}}class N{visit(t,e,s){let r={};if(f(t,e,r,"grouping","grouping"),A(t,e,r,"varyColors","varyColors"),y(t,e,r,"gapWidth","gapWidth",.01),y(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),C(t,e,r,"bubbleScale","bubbleScale"),A(t,e,r,"showNegBubbles","showNegativeBubbleValues"),A(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),C(t,e,r,"firstSliceAng","startAngle"),C(t,e,r,"holeSize","holeSize"),f(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let o=t.getVisitorParamsState().get("types");o||(o=[],t.getVisitorParamsState().set("types",o)),o.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(r.length===0)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class Z extends N{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type=r==="col"?"column":"bar")}}class w{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);i!==null&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),n===!0?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(A(t,e,r,"showBubbleSize","showBubbleSize"),A(t,e,r,"showCatName","showCatName"),A(t,e,r,"showLeaderLines","showLeaderLines"),A(t,e,r,"showPercent","showPercentage"),A(t,e,r,"showSerName","showSerName"),A(t,e,r,"showVal","showVal"),A(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return l!==null&&(r.separator=l.textContent),f(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const o=r.getAttribute("formatCode");s.formatCode=o,r.hasAttribute("sourceLinked")&&(s.sourceLinked=r.getAttribute("sourceLinked")==="1")}}}const U=(u,t,e)=>{if(u.getValAttrAsBoolean("invertIfNegative",t)===!0)if(u.evaluate("extLst/ext/invertSolidFillFmt",t)){if(e.fill&&e.fillNegative){const s=u.getFromPath(e,"fill.solid.adjs");s&&u.setToPath(e,"fillNegative.solid.adjs",s)}}else{const s={val:"FFFFFF"},r={};r.solid=s,e.fillNegative=r;const o={val:"000000"},i={};i.solid=o;const n={};n.fill=i,e.strokeNegative=n}};class tt{visit(t,e,s){const r={};C(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;o!==null&&o.firstChild!==null&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),i!==null&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),n!==null&&(l=this.parsePointsAsString(t,n))),l!==null&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),C(t,e,r,"idx","idx"),A(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(r!==null){const o=r.firstChild.nodeValue;t.setToPath(s,"title.range",o)}else{const o=t.evaluate("tx/v",e);o!==null&&t.setToPath(s,"title.text.simpleRun",o.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let n=0;o&&r&&n<r;n++){let l=null,a=t.evaluate("pt[@idx='"+n+"']/v",e);a instanceof Node&&(l=a.textContent),i[n]=l}for(let n=0;n<i.length;n++)n>0&&(s+=","),i[n]!==void 0&&(s+=i[n]);return s+="}",s}afterVisit(t,e,s){U(t,e,s);let r=t.getFromPath(s,"points");if(r){const o=Object.keys(r);for(let i=0;i<o.length;i++){const n=o[i],l=t.getFromPath(r,n);if(!l)continue;let a=t.getFromPath(l,"markers");a&&(t.setToPath(s,"markers.points."+n,a),delete l.markers)}}}}class et{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return n!==null&&(o[n]=i),A(t,e,i,"bubble3D","bubble3D"),C(t,e,i,"explosion","explosion"),U(t,e,i),i}}class rt{visit(t,e,s){const r=e.parentNode.localName;if(r==="ser"||r==="dPt"){const o={},i=t.getValAttrAsString("size",e);i!==null&&(o.size=i);const n=t.getValAttrAsString("symbol",e);return n&&(o.type=n),s.markers=o,o}return null}}class x{visit(t,e,s){let r={};this.parseScaling(t,e,r),y(t,e,r,"majorUnit","majorUnits"),y(t,e,r,"minorUnit","minorUnits"),A(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),f(t,e,r,"majorTickMark","majorTickMarks"),f(t,e,r,"minorTickMark","minorTickMarks"),f(t,e,r,"crosses","crosses"),y(t,e,r,"crossesAt","crosses"),f(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),C(t,e,r,"lblOffset","labelOffset"),f(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=o!==null&&o===0,C(t,e,r,"tickMarkSkip","tickMarkSkip"),C(t,e,r,"tickLblSkip","labelInterval"),this.parseDisplayCustOrBuiltInUnit(e,t,r),this.parseTimeUnits(t,e,r,"majorUnitDates","majorTimeUnit","majorUnit"),this.parseTimeUnits(t,e,r,"minorUnitDates","minorTimeUnit","minorUnit"),f(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(l!==null){n.dem=l;let a=t.getValAttrAsString(i,e);n.amt=a}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);r!==null&&(r==="ctr"?s.labelAlign="center":r==="l"?s.labelAlign="left":r==="r"&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);r!==null&&(r==="b"?s.orientation="bottom":r==="l"?s.orientation="left":r==="r"?s.orientation="right":r==="t"&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);o!==null&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked=o.getAttribute("sourceLinked")==="1")),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);r!==null&&(s.inverted=r!=="minMax");const o=t.getValAttrAsFloat("scaling/logBase",e);o!==null&&(s.logBase=o,s.scaleType="log"),y(t,e,s,"scaling/max","max"),y(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);r!==null&&(t.setToPath(s,"labels.shown",r!==!0),t.setToPath(s,"shown",r!==!0));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",i!==null);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",n!==null);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",l!==null)}}class F{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),new L().visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=c=>{const h={};let g=t.evaluate("t",c);const m=t.evaluate("rPr",c);m&&this.parseTextProperties(t,m,h),g?h.text=g.firstChild.textContent??"":c.textContent&&(h.text=c.textContent??""),i.push(h)};if(n?.length!==void 0)for(let c=0;n&&c<n.length;c++)l(n.item(c));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&D(a,s)}parseTextProperties(t,e,s){if(!e)return;e.hasAttribute("sz")&&(s.size=parseFloat(e.getAttribute("sz"))/100),e.hasAttribute("b")&&(s.weight=e.getAttribute("b")==="1"?700:400),e.hasAttribute("i")&&(s.italic=e.getAttribute("i")==="1"),e.hasAttribute("u")&&(s.underline=e.getAttribute("u")),e.hasAttribute("strike")&&(s.strike=e.getAttribute("strike"));const r=t.evaluate("latin",e);if(r&&!r.getAttribute("typeface").startsWith("+")){const o=s.font??{};if(r.hasAttribute("typeface")&&(o.family=r.getAttribute("typeface")),r.hasAttribute("panose")){const i=r.getAttribute("panose");i&&(o.fallbacks=[d.IFont.getPanoseFallback(i)])}r.hasAttribute("pitchFamily")&&(o.pitch=r.getAttribute("pitchFamily")),r.hasAttribute("charset")&&(o.charset=r.getAttribute("charset")),Object.keys(o).length>0&&(s.font=o)}}}class st{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let o=t.getFromPath(r,"title");o||(o={},t.setToPath(r,"title",o));let i=o,n=t.getValAttrAsBoolean("delete",e);return n!==null&&(i.shown=!n),i}return s}}class ot{visit(t,e,s){const r={};return A(t,e,r,"overlay","overlay"),f(t,e,r,"legendPos","position"),s.legend=r,r}}class it extends L{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class j extends F{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const o=r.firstElementChild.nodeValue;t.setToPath(s,"range",o)}}visit(t,e,s){const r={};A(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const r=s.text?.rotation??null;r!==null&&(s.rotation=parseInt(r),delete s.title.rotation)}}}class nt{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let o={};y(t,r,o,"x","x"),y(t,r,o,"y","y"),y(t,r,o,"w","w"),y(t,r,o,"h","h"),f(t,r,o,"xMode","xMode"),f(t,r,o,"yMode","yMode"),f(t,r,o,"wMode","wMode"),f(t,r,o,"hMode","hMode"),Object.keys(o).length>0&&(s.manualLayout=o)}return s}}class lt{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class at extends M{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1){let l=n.localName;const a=t.evaluate(l,e),c=this.processAdjColor(t,a);r[l]=c}}return Object.keys(r).length>0&&(s.colors=r),r}}class ct{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(t,e,s){if(!e)return;const r=t.evaluate("latin",e);if(!r)return;const o=r.getAttribute("typeface");o&&(s.family=o);const i=r.getAttribute("panose");return i&&(s.fallbacks=[d.IFont.getPanoseFallback(i)]),s}}class ut{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const i=t.getRef(o);typeof i=="string"&&(r.address=i)}return t.copyFromAttribute(e,"tooltip",r),t.copyFromAttribute(e,"history",r,"history",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tgtFrame",r,"target"),s.hyperlink=r,r}}class ht{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(t,e){const s={type:d.IAutoFilter.Type.Color};return t.copyFromAttribute(e,"cellColor",s,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(e,"dxfId",s,"styleId",t.INT_COPY),s}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(t,e){const s={type:d.IAutoFilter.Type.Custom};t.copyFromAttribute(e,"and",s,"and",t.BOOLEAN_COPY);const r=e.childNodes;s.filters=[];for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType!==1)continue;let n=null;i.localName==="customFilter"&&(n=this.processCustomFilter(t,i)),n&&s.filters.push(n)}return s}processDynamicFilter(t,e){const s={type:d.IAutoFilter.Type.Dynamic};return t.copyFromAttribute(e,"type",s,"dynamicType"),t.copyFromAttribute(e,"val",s,"val",t.INT_COPY),t.copyFromAttribute(e,"maxVal",s,"maxVal",t.INT_COPY),s}processDateGroupItem(t,e){const s={};return t.copyFromAttribute(e,"dateTimeGrouping",s,"group"),t.copyFromAttribute(e,"day",s,"day",t.INT_COPY),t.copyFromAttribute(e,"hour",s,"hour",t.INT_COPY),t.copyFromAttribute(e,"minute",s,"minute",t.INT_COPY),t.copyFromAttribute(e,"month",s,"month",t.INT_COPY),t.copyFromAttribute(e,"second",s,"second",t.INT_COPY),t.copyFromAttribute(e,"year",s,"year",t.INT_COPY),s}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(t,e){const s={type:d.IAutoFilter.Type.Items};t.copyFromAttribute(e,"blank",s,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(e,"calendarType",s,"calendarType");let r=[],o=[];const i=e.childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1){if(l.localName==="dateGroupItem"){const a=this.processDateGroupItem(t,l);a&&r.push(a)}else if(l.localName==="filter"){const a=this.processFilterItem(t,l);a!==void 0&&o.push(a)}}}return r.length>0&&(s.dateGroups=r),o.length>0&&(s.items=o),s}processIcon(t,e){const s={type:d.IAutoFilter.Type.Icon};return t.copyFromAttribute(e,"iconId",s,"iconId",t.INT_COPY),t.copyFromAttribute(e,"iconSet",s),s}processTop10(t,e){const s={type:d.IAutoFilter.Type.Top10};return t.copyFromAttribute(e,"filterVal",s,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(e,"percent",s,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(e,"top",s,"top",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val",t.FLOAT_COPY),s}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType!==1)continue;let l=null;n.localName==="colorFilter"?l=this.processColorFilter(t,n):n.localName==="customFilters"?l=this.processCustomFilters(t,n):n.localName==="dynamicFilter"?l=this.processDynamicFilter(t,n):n.localName==="filters"?l=this.processFilters(t,n):n.localName==="iconFilter"?l=this.processIcon(t,n):n.localName==="top10"&&(l=this.processTop10(t,n)),l&&o.push(l)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,e){if(!e)return null;const s={};if(!e.hasAttribute("colId"))return;s.offset=parseInt(e.getAttribute("colId"));let r=!1;return e.hasAttribute("hiddenButton")&&(r=p.b(e.getAttribute("hiddenButton"))),r&&(s.hiddenButton=!0),e.hasAttribute("showButton")&&(s.showButton=p.b(e.getAttribute("showButton"))),this.processFilterCriteria(t,e,s),s}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType===1&&n.localName==="filterColumn"){const l=this.processFilterColumn(t,n);l&&o.push(l)}}return o.length>0&&(s.fields=o),o}}class pt{visit(t,e,s){if(!e)return;const r={};if(t.copyFromAttribute(e,"ref",r),e.hasAttribute("caseSensitive")){const n=p.b(e.getAttribute("caseSensitive"));r.collatorOptions=n?d.Sort.CaseSensitiveOptions:d.Sort.CaseInsensitiveOptions}const o=e.getAttribute("sortMethod");o!=null&&o!=="none"&&(o==="stroke"?r.collatorOptions={...r.collatorOptions,collation:"stroke"}:o==="pinYin"&&(r.collatorOptions={...r.collatorOptions,collation:"pinyin"})),e.hasAttribute("columnSort")&&p.b(e.getAttribute("columnSort"))&&(r.orientation=d.IRange.Orientation.Column);const i=d.AddressUtils.fastStringToRange(r.ref);return this.processSortConditions(t,e,r,i),Object.keys(r).length>0&&(s.sort=r),r}processSortCondition(t,e,s){if(!e)return null;const r={};if(e.hasAttribute("ref")){if(e.hasAttribute("ref")){const o=e.getAttribute("ref"),i=d.AddressUtils.fastStringToRange(o);r.offset=s?i.colStart-s.colStart:i.colStart}return r.reverse=!1,e.hasAttribute("descending")&&(r.reverse=p.b(e.getAttribute("descending"))),t.copyFromAttribute(e,"sortBy",r,"sortOn"),t.copyFromAttribute(e,"dxfId",r),t.copyFromAttribute(e,"iconSet",r),t.copyFromAttribute(e,"customList",r),r}console.warn("no ref for sort conditional",t.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let n=0;n<o.length;n++){const l=o.item(n);if(l.nodeType===1&&l.localName==="sortCondition"){const a=this.processSortCondition(t,l,r);a&&i.push(a)}}return i.length>0&&(s.fields=i),i}}class z{visit(t,e,s){}processDataBarColor(t,e,s,r,o="dk1"){if(!e)return;const i=p.d(n=>e.getAttribute(n),o);return i&&(s[r]=i),s}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;i<r.length;i++){const n=r.item(i);if(n.nodeType===1&&n.localName==="font"){const l={};this.processFont(t,n,l),s[o++]=l}}return s}processFont(t,e,s){t.getValAttrAsBoolean("b",e,!0)&&(s.weight=700),t.getValAttrAsBoolean("i",e,!0)&&(s.style=d.IFont.Style.Italic),t.getValAttrAsBoolean("strike",e,!0)&&(s.strike=!0);const r=t.evaluate("u",e);if(r){const n=r.getAttribute("val");s.underline=n||d.IFont.UnderlineStyle.Single}f(t,e,s,"vertAlign","verticalAlign"),s.verticalAlign==="superscript"?s.verticalAlign=d.IFont.VerticalAlignment.Super:s.verticalAlign==="subscript"&&(s.verticalAlign=d.IFont.VerticalAlignment.Sub),y(t,e,s,"sz","size");const o=t.evaluate("color",e);this.processDataBarColor(t,o,s,"fill"),s.fill||(s.fill="dk1"),f(t,e,s,"name","family"),f(t,e,s,"rFont","family");const i=t.evaluate("family",e);if(i){const n=i.getAttribute("val");if(n)switch(n){case"1":s.fallbacks=["serif"];break;case"2":s.fallbacks=["sans-serif"];break;case"3":s.fallbacks=["monospace"];break;case"4":s.fallbacks=["cursive"];break;case"5":s.fallbacks=["fantasy"]}}return f(t,e,s,"scheme","scheme"),A(t,e,s,"shadow","shadow",!0),A(t,e,s,"outline","outline",!0),t.getValAttrAsBoolean("condense",e,!0)&&(s.letterSpacing=-1),t.getValAttrAsBoolean("extend",e,!0)&&(s.letterSpacing=1),f(t,e,s,"charset","charset"),s}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="fill"&&this.processFill(t,n,s,o++)}return s}processFill(t,e,s,r){const o={type:d.IFill.Type.None},i=e.childNodes;let n=!1;for(let l=0;!n&&l<i.length;l++){const a=i.item(l);a.nodeType===1&&(a.localName==="gradientFill"?(this.processGradientFill(t,a,o),n=!0):a.localName==="patternFill"&&(this.processPatternFill(t,a,o),n=!0))}return s[r]=o,s}processGradientFill(t,e,s){if(!e)return;s.type=d.IFill.Type.Gradient;const r=[];s.stops=r,s.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const o=e.getAttribute("type");o&&(s.gradientType=o);const i=l=>{if(!l)return 0;const a=parseFloat(l);return isNaN(a)?0:a};(e.hasAttribute("left")||e.hasAttribute("top")||e.hasAttribute("right")||e.hasAttribute("bottom"))&&(s.fillTo={left:i(e.getAttribute("left")),top:i(e.getAttribute("top")),right:i(e.getAttribute("right")),bottom:i(e.getAttribute("bottom"))});const n=e.childNodes;for(let l=0;l<n.length;l++){const a=n.item(l);if(a.nodeType===1&&a.localName==="stop"){const c={};r.push(c);const h=parseFloat(a.getAttribute("position"));c.offset=h;const g=t.evaluate("color",a);this.processDataBarColor(t,g,c,"color")}}return s}processPatternFill(t,e,s){if(!e)return;const r=t.getVisitorParamsState().get("processingDXFs"),o=e.getAttribute("patternType")||(r?d.IFill.BuiltInSheetPattern.Solid:d.IFill.BuiltInSheetPattern.None);if(o===d.IFill.BuiltInSheetPattern.None)return{none:!0};s.type=d.IFill.Type.Pattern,o&&(s.patternType=o);let i,n="foreground",l="background";const a=s.patternType===d.IFill.BuiltInSheetPattern.Solid&&r;if(a){i="lt1";const g=n;n=l,l=g}const c=t.evaluate("fgColor",e);this.processDataBarColor(t,c,s,n,i);const h=t.evaluate("bgColor",e);return this.processDataBarColor(t,h,s,l,i),a&&!s.foreground&&(s.foreground=i),s}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let n=0;n<o.length;n++){const l=o.item(n);l.nodeType===1&&l.localName==="border"&&this.processBorder(t,l,s,i++,r)}return s}processBorder(t,e,s,r,o){if(!e)return;const i={};return this.processBorderStroke(t,e,i,d.IBorder.Edge.Left),this.processBorderStroke(t,e,i,d.IBorder.Edge.Right),o?(i.right||i.left)&&(i.right?i.vertical={...i.right}:i.vertical={...i.left}):this.processBorderStroke(t,e,i,d.IBorder.Edge.Vertical),this.processBorderStroke(t,e,i,d.IBorder.Edge.Top),this.processBorderStroke(t,e,i,d.IBorder.Edge.Bottom),o?(i.bottom||i.top)&&(i.right?i.horizontal={...i.bottom}:i.horizontal={...i.top}):this.processBorderStroke(t,e,i,d.IBorder.Edge.Horizontal),s[r]=i,s}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class gt extends z{visit(t,e,s){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const r={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),r.fonts),this.processFills(t,t.evaluate("fills",e),r.fills),this.processBorders(t,t.evaluate("borders",e),r.borders,!0),r.fills[0]={type:d.IFill.Type.None},r.fills[1]={type:d.IFill.Type.Pattern,patternType:d.IFill.BuiltInSheetPattern.Gray125},r.borders[0]={};const o=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),o,r,null,!1);const i=new Map;if(o.length>0){const a=[];this.processCellStyles(t,t.evaluate("cellStyles",e),a,o,i),s.named=a}const n=[];this.processXFs(t,t.evaluate("cellXfs",e),n,r,i),Object.keys(n).length>0&&(s.direct=n);const l=[];return this.processDXFs(t,t.evaluate("dxfs",e),l),this.processTableStyles(t,t.evaluate("tableStyles",e),s,l),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),s),this.processMruColors(t,t.evaluate("colors/mruColors",e),s),s}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="rgbColor"){const l={color:null};this.processDataBarColor(t,n,l,"color"),l.color&&r.push(l.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="color"){const l={color:null};this.processDataBarColor(t,n,l,"color"),l.color&&r.push(l.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="numFmt"){const l=n.getAttribute("numFmtId"),a=n.getAttribute("formatCode");if(l&&a){const c=a.replace(/\\(.)/g,"$1");r.set(parseInt(l),c)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let l=0;l<n.length;l++){const a=n.item(l);if(a.nodeType===1&&a.localName==="xf"){const c={};this.processXF(t,a,c,r,o,i),s.push(c)}}}processXF(t,e,s,r,o,i){if(!e)return;const n=e.getAttribute("xfId");if(n&&o){const c=o.get(parseInt(n));c&&c!==d.IStyle.BuiltInName.Normal&&(s.named=c)}const l=c=>!(!i&&e.hasAttribute(c))||p.b(e.getAttribute("applyFont"));if(l("applyFont")){const c=r.fonts[e.getAttribute("fontId")];c&&(s.font=c)}if(l("applyFill")){const c=r.fills[e.getAttribute("fillId")];c&&Object.keys(c).length>0&&(s.fill=c)}if(l("applyBorder")){const c=r.borders[e.getAttribute("borderId")];c&&Object.keys(c).length>0&&(s.border=c)}if(l("applyNumberFormat")){const c=e.getAttribute("numFmtId");if(c){const h=parseInt(c);let g;const m=t.getVisitorParamsState();if(m){const b=m.get("numFmts");b&&(g=b.get(h)),s.numberFormat=g??h}else console.warn("no visitor params state")}}l("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",e),s),l("applyProtection")&&this.processProtection(t,t.evaluate("protection",e),s);const a=p.b(e.getAttribute("quotePrefix"));a&&(s.quotePrefix=a)}processAlignment(t,e,s){const r={};if(e?.hasAttribute("horizontal")?r.horizontal=e.getAttribute("horizontal"):r.horizontal=d.ITextFrame.HorizontalAlignment.General,e?.hasAttribute("vertical")?r.vertical=e.getAttribute("vertical"):r.vertical=d.ITextFrame.VerticalAlignment.Bottom,e?.hasAttribute("indent")?r.indent=parseInt(e.getAttribute("indent")):r.indent=0,e?.hasAttribute("relativeIndent")?r.relativeIndent=parseInt(e.getAttribute("relativeIndent")):r.relativeIndent=0,p.b(e?.getAttribute("wrapText"))?r.overflow=d.ITextFrame.Overflow.Wrap:r.overflow=d.ITextFrame.Overflow.Visible,p.b(e?.getAttribute("shrinkToFit"))&&(r.overflow=d.ITextFrame.Overflow.Shrink),e?.hasAttribute("textRotation")){let i=parseFloat(e.getAttribute("textRotation"));i>0&&i<=90?i=360-i:i>90&&i<=180?i-=90:i===255&&(i=0,r.stacked=!0),r.rotation=i}else r.rotation=0;e?.hasAttribute("justifyLastLine")&&(r.justifyLastLine=p.b(e.getAttribute("justifyLastLine")));const o=e?.getAttribute("readingOrder");return o&&(o==="0"?r.readingDirection=d.ITextFrame.ReadingDirection.Auto:o==="1"?r.readingDirection=d.ITextFrame.ReadingDirection.LeftToRight:o==="2"?r.readingDirection=d.ITextFrame.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${o}`)),Object.keys(r).length>0&&(s.alignment=r),s}processProtection(t,e,s){if(!e)return;const r={},o=e.getAttribute("locked");o&&!p.b(o)&&(r.edit=!0);const i=e.getAttribute("hidden");return i&&p.b(i)&&(r.formulaHidden=!0),Object.keys(r).length>0&&(s.protection=r),s}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="font"){const n={};this.processFont(t,i,n),s.font=n}else if(i.nodeType===1&&i.localName==="fill"){const n=[];this.processFill(t,i,n,0),n.length>0&&n[0]&&(s.fill=n[0])}else if(i.nodeType===1&&i.localName==="border"){const n=[];this.processBorder(t,i,n,0,!1),n.length>0&&n[0]&&(s.border=n[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="dxf"){const l={};this.processDXF(t,n,l);const a=s.length;r.set(a,l),s.push(l)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,e,s,r,o=!1){const i=e.getAttribute("name"),n={name:i};e.hasAttribute("table")&&(n.table=p.b(e.getAttribute("table"))),e.hasAttribute("pivot")&&(n.pivot=p.b(e.getAttribute("pivot"))),o&&!n.pivot&&r.unshift(null);const l=e.childNodes;for(let a=0;a<l.length;a++){const c=l.item(a);if(c.nodeType===1&&c.localName==="tableStyleElement"){const h=c.getAttribute("type"),g=c.getAttribute("dxfId");let m=r?.[g];m||(console.warn("invalid dfx id",g),m={}),n[h]=m;let b=null;c.hasAttribute("size")&&(b=parseInt(c.getAttribute("size"))),b&&!isNaN(b)&&(m.size=b)}}delete n.name,s[i]=n}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let h=0;h<a.length;h++){const g=a.item(h);g.nodeType===1&&g.localName==="tableStyle"&&this.processTableStyle(t,g,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,e,s,r,o){if(!e)return;const i=e.childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1&&l.localName==="cellStyle"){const a=parseInt(l.getAttribute("xfId")),c=l.getAttribute("name");if(o.set(a,c),!r[a])continue;const h={name:c,style:r[a]};l.getAttribute("hidden")&&(h.hidden=p.b(l.getAttribute("hidden"))),l.getAttribute("iLevel")&&(h.iLevel=parseInt(l.getAttribute("iLevel"))),s.push(h)}}}afterVisit(t,e,s){}}class dt extends z{visit(t,e,s){return this.processSheetRefs(t,t.evaluate("sheets",e),s),this.processBookViews(t,t.evaluate("bookViews",e),s),this.processDefinedNames(t,t.evaluate("definedNames",e),s),this.processCalcPr(t,t.evaluate("calcPr",e),s),this.processWorkbookProtection(t,t.evaluate("workbookProtection",e),s),this.processWorkbookPr(t,t.evaluate("workbookPr",e),s),s}processPassword(t,e,s,r="password"){if(!e)return;const o={};t.copyFromAttribute(e,"algorithmName",o,"algorithmName"),t.copyFromAttribute(e,"hashValue",o,"hashValue"),t.copyFromAttribute(e,"saltValue",o,"saltValue",t.BOOLEAN_COPY),t.copyFromAttribute(e,"spinCount",o,"spinCount",t.INT_COPY),Object.keys(o).length>0&&(s[r]=o)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=i=>i!==!0&&i!=="1"&&i!=="on"&&i!=="true"&&(i===!1||i==="0"||i==="off"||i==="false"||null);return t.copyFromAttribute(e,"lockStructure",r,"structure",o),t.copyFromAttribute(e,"lockWindows",r,"windows",o),t.copyFromAttribute(e,"lockRevision",r,"revision",o),s.protection=r,s}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);n.nodeType===1&&n.localName==="sheet"&&this.processSheetRef(t,n,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="workbookView"&&(this.processWorkbookView(t,n,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,o=>o+1]),e.hasAttribute("activeTab")||(r.activeSheetId=1),t.copyFromAttribute(e,"showHorizontalScroll",r,"showHorizontalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showVerticalScroll",r,"showVerticalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showSheetTabs",r,"showTabs",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tabRatio",r,"tabRatio",[t.FLOAT_COPY,o=>o]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&i.nodeType===3&&(o.ref=i.textContent),t.copyFromAttribute(e,"name",o),t.copyFromAttribute(e,"comment",o),t.copyFromAttribute(e,"hidden",o,"hidden",t.BOOLEAN_COPY),e.hasAttribute("localSheetId")){const n=e.getAttribute("localSheetId");if(!r[n]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);o.scope=r[n].name}t.copyFromAttribute(e,"customMenu",o),t.copyFromAttribute(e,"description",o),t.copyFromAttribute(e,"statusBar",o),t.copyFromAttribute(e,"help",o),t.copyFromAttribute(e,"shortcutKey",o),t.copyFromAttribute(e,"function",o,"function",t.BOOLEAN_COPY),t.copyFromAttribute(e,"functionGroupId",o,"functionGroupId",t.INT_COPY),t.copyFromAttribute(e,"publishToServer",o,"publishToServer",t.BOOLEAN_COPY),t.copyFromAttribute(e,"vbProcedure",o,"vbProcedure",t.BOOLEAN_COPY),t.copyFromAttribute(e,"xlm",o,"xlm",t.BOOLEAN_COPY),Object.keys(o).length>0&&s.push(o)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);n.nodeType===1&&n.localName==="definedName"&&this.processDefineName(t,n,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class mt{visit(t,e,s){return t.copyFromAttribute(e,"name",s),t.copyFromAttribute(e,"displayName",s),t.copyFromAttribute(e,"ref",s),t.copyFromAttribute(e,"headerRowCount",s,"headerRowCount",t.INT_COPY),t.copyFromAttribute(e,"totalsRowCount",s,"totalsRowCount",t.INT_COPY),this.processTableColumns(t,e,s),this.processTableStyleInfo(t,e,s),s}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="tableStyleInfo"&&(t.copyFromAttribute(n,"name",o),t.copyFromAttribute(n,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(n,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="tableColumn"){const n={};t.copyFromAttribute(i,"name",n),t.copyFromAttribute(i,"uniqueName",n),s.push(n)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let i=0;i<r.length;i++){const n=r.item(i);n.nodeType===1&&n.localName==="tableColumns"&&this.processTableColumn(t,n,o)}o.length>0&&(s.columns=o)}}class bt{visit(t,e,s){return s}}class k{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"editAs",r,"anchorType"),r.anchor={},this.processOffsetCoord(t,t.evaluate("from",e),r.anchor,"from"),this.processOffsetCoord(t,t.evaluate("to",e),r.anchor,"to"),s.movables||(s.movables=[]),s.movables.push(r),r}processOffsetCoord(t,e,s,r){if(!e)return;const o={c:0,r:0,x:0,y:0};return t.evaluate("col",e)&&(o.c=parseInt(t.evaluate("col",e).textContent)),t.evaluate("row",e)&&(o.r=parseInt(t.evaluate("row",e).textContent)),t.evaluate("colOff",e)&&(o.x=p.c(t.evaluate("colOff",e).textContent)),t.evaluate("rowOff",e)&&(o.y=p.c(t.evaluate("rowOff",e).textContent)),r==="from"?s.tl=o:s.br=o,s}}class B{visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);return r&&(t.copyFromAttribute(r,"name",s),t.copyFromAttribute(r,"desc",s),t.copyFromAttribute(r,"hidden",s,"hidden",t.BOOLEAN_COPY),t.copyFromAttribute(r,"id",s)),s}}class At extends B{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const n=t.evaluate("graphicFrameLocks",r);if(n){n.hasAttribute("noChangeAspect")&&(s.lockAspect=n.getAttribute("noChangeAspect")==="1");const l={};Object.keys(l).length>0&&(s.locks=l)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let n=0;n<i.length;n++){const l=i.item(n);if(l.nodeType===1)try{let a=l.localName;a==="chart"&&(a="chart"),o.type=a;const c=l.getAttribute("r:id");c&&(o.json=t.getRef(c))}catch(a){console.warn("Unable to parse graphicFrame",a)}}return o&&(s.content=o),o}}class _ extends B{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const i=t.evaluate("spLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class ft extends B{visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const a=t.evaluate("picLocks",o);if(a){a.hasAttribute("noChangeAspect")&&(r.lockAspect=a.getAttribute("noChangeAspect")==="1");const c={};t.copyFromAttribute(a,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(a,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(c).length>0&&(r.locks=c)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const a=i.getAttribute("r:embed")??i.getAttribute("embed");if(!a)return void console.warn("no rId found for blip",i);n=t.getRef(a,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class yt extends _{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const i=t.evaluate("grpSpLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class vt extends _{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const i=t.evaluate("cxnSpLocks",r);if(i){i.hasAttribute("noChangeAspect")&&(s.lockAspect=i.getAttribute("noChangeAspect")==="1");const n={};Object.keys(n).length>0&&(s.locks=n)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const R="richTypes";class Ft{visit(t,e,s){let r=t.getVisitorParamsState().get(R);r||(r=[],t.getVisitorParamsState().set(R,r));const o=e.childNodes,i=o.length;for(let n=0;n<i;n++){const l=o.item(n);if(l.nodeType===1&&l.localName==="s"){const a={type:l.getAttribute("t")??"n",keys:[]};this.processKeys(t,l,a),r.push(a)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let n=0;n<o;n++){const l=r.item(n);if(l.nodeType===1&&l.localName==="k"){const a=l.getAttribute("n"),c=l.getAttribute("t");i.push([a,c])}}}}const E="richData";class Ct{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(E);o||(o=[],t.getVisitorParamsState().set(E,o));const i=e.childNodes,n=i.length;for(let l=0;l<n;l++){const a=i.item(l);if(a.nodeType===1&&a.localName==="rv"){const c=r[a.getAttribute("s")],h={type:c.type};this.processValues(t,a,h,c);const g=this.mapType(t,h);o.push(g)}}return s.richData=o,o}mapType(t,e){if(e.type==="_error"){const s=e.errorType;if(s)try{e=d.FormulaError.getBuiltInById(s+1)}catch{}}return e}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let l=0;l<i;l++){const a=o.item(l);if(a.nodeType===1&&a.localName==="v"){const c=n[l];if(!c)return void t.warn("Invalid richData");const h=c[0],g=c[1];let m=a.textContent;g==="i"&&(m=Number(m)),s[h]=m}}}}class wt{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(i.nodeType===1&&i.localName==="author"){const n=i.firstChild;n&&n.nodeType===3&&s.push(n.textContent)}}}}class Pt{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"authorId",r,"authorId",t.INT_COPY),r.asNote=!0,s.comments||(s.comments=[]),s.comments.push(r),r}}class Nt{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class Ot{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"id",r,"id",p.r),t.copyFromAttribute(e,"personId",r,"personId",p.r),t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"parentId",r,"parentId",p.r),t.copyFromAttribute(e,"dT",r),e.hasAttribute("done")&&(r.done=p.b(e.getAttribute("done"))),s.push(r),r}}class Tt{visit(t,e,s){const r=[],o=e.childNodes;for(let i=0;i<o.length;i++){const n=o.item(i);if(n.nodeType===1&&n.localName==="person"){const l={};t.copyFromAttribute(n,"id",l,"id",p.r),t.copyFromAttribute(n,"displayName",l),t.copyFromAttribute(n,"userId",l,"userId",p.r),t.copyFromAttribute(n,"providerId",l),r.push(l)}}return r.length>0&&(s.persons=r),r}}const St={};class Vt{constructor(t,e){this.path=t,this.visitor=e}}class Y{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new H),this.registerVisitor("spPr",new L),this.registerVisitor("txBody",new F),this.registerVisitor("txPr",new F),this.registerVisitor("c:chartSpace",new q),this.registerVisitor("c:chartSpace",new J,"chart"),this.registerVisitor("c:plotArea",new Q),this.registerVisitor("c:barChart",new Z),this.registerVisitor("c:doughnutChart",new N),this.registerVisitor("c:lineChart",new N),this.registerVisitor("c:ofPieType",new N),this.registerVisitor("c:pieChart",new N),this.registerVisitor("c:scatterChart",new N),this.registerVisitor("c:barChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new w("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new tt),this.registerVisitor("c:dPt",new et),this.registerVisitor("c:marker",new rt),this.registerVisitor("c:catAx",new x),this.registerVisitor("c:valAx",new x),this.registerVisitor("c:dateAx",new x),this.registerVisitor("c:majorGridlines",new V("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new V("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new F("labels.text"),"txPr"),this.registerVisitor("c:valAx",new F("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new F("labels.text"),"txPr"),this.registerVisitor("c:legend",new ot),this.registerVisitor("c:legend",new F("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new st),this.registerVisitor("c:ser",new it,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new w("labels"),"dLbls"),this.registerVisitor("c:dLbl",new w("points")),this.registerVisitor("c:title",new j),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new nt),this.registerVisitor("c:dispUnits",new V("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new j("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new F,"tx/rich"),this.registerVisitor("a:theme",new lt),this.registerVisitor("a:theme",new at,"themeElements/clrScheme"),this.registerVisitor("a:theme",new ct,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new ht),this.registerVisitor("sortState",new pt),this.registerVisitor("s:workbook",new dt),this.registerVisitor("styleSheet",new gt),this.registerVisitor("table",new mt),this.registerVisitor("hlinkClick",new ut),this.registerVisitor("wsDr",new bt),this.registerVisitor("twoCellAnchor",new k),this.registerVisitor("oneCellAnchor",new k),this.registerVisitor("absoluteAnchor",new k),this.registerVisitor("graphicFrame",new At),this.registerVisitor("sp",new _),this.registerVisitor("grpSp",new yt),this.registerVisitor("cxnSp",new vt),this.registerVisitor("pic",new ft),this.registerVisitor("rvStructures",new Ft),this.registerVisitor("rvData",new Ct),this.registerVisitor("comments",new wt),this.registerVisitor("commentList",new Pt,"comment"),this.registerVisitor("comment",new F("content"),"text"),this.registerVisitor("ThreadedComments",new Nt),this.registerVisitor("threadedComment",new Ot),this.registerVisitor("threadedComment",new F("content"),"text"),this.registerVisitor("personList",new Tt)}registerVisitor(t,e,s=null){t.indexOf(":")===-1&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new Vt(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=St){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);if(i||(i=this.visitorsByXmlTagName.get(r.localName)),!i)throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);const n="/"+r.localName,l=new S(null,this,n,r,o,e,s),a=[];this._doWalk(i,l,a,r,o,e,s);for(let c=0;c<a.length;c++){const h=a[c];try{h.visitor?.afterVisit?.(h.context,h.elemParent,h.jsonParent)}catch(g){console.warn(`Error in afterVisit: ${h.context.getPath()}`,g)}}return o}_walkScoped(t,e,s,r,o,i,n){const l=this.scopedVisitorsByXmlTagName.get(t);for(let a=0;l&&a<l.length;a++){const c=l[a];let h=null;try{h=e.evaluate(c.path,r)}catch{console.warn(`"Invalid path '${c.path}' for '${t}'.`)}if(!h)continue;const g=m=>{let b=m.localName,v=m.parentNode;for(;v&&v!==r;)b=v.localName+"/"+b,v=v.parentNode;const P=e.getPath()+"/"+b;if(c.visitor){const T=new S(e,this,P,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c.visitor,T,s,m,o,i,n)}};if(h.length>0){const m=h;for(let b=0;b<m.length;b++)g(m.item(b))}else g(h)}}_doWalk(t,e,s,r,o,i,n){let l=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),l=t.visit(e,r,o)),l||(l=o);const a=r.localName;this._walkScoped(a,e,s,r,l,i,n);const c=r.childNodes;for(let h=0;h<c.length;h++){const g=c.item(h);if(g.nodeType===1){const m=g,b=m.localName,v=this.visitorsByXmlTagName.get(b),P=e.getPath()+"/"+b,T=new S(e,this,P,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(v,T,s,m,l??o,i,n)}}return l}}exports.FromOOXMLConverter=Y,exports.default=Y;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.16
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/const h=require("react/jsx-runtime"),a=require("react"),c=require("./B0DBQadzoF7C4vlu.cjs"),Ot=require("react-dom"),H=require("@mui/material"),oe=require("@sheetxl/sdk"),Ke=require("@mui/icons-material"),Dt=a.createContext(null),He={didCatch:!1,error:null};class Wt extends a.Component{constructor(i){super(i),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=He}static getDerivedStateFromError(i){return{didCatch:!0,error:i}}resetErrorBoundary(){const{error:i}=this.state;if(i!==null){for(var r,e,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];(r=(e=this.props).onReset)===null||r===void 0||r.call(e,{args:o,reason:"imperative-api"}),this.setState(He)}}componentDidCatch(i,r){var e,n;(e=(n=this.props).onError)===null||e===void 0||e.call(n,i,r)}componentDidUpdate(i,r){const{didCatch:e}=this.state,{resetKeys:n}=this.props;var o,s;e&&r.error!==null&&function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return d.length!==l.length||d.some((u,p)=>!Object.is(u,l[p]))}(i.resetKeys,n)&&((o=(s=this.props).onReset)===null||o===void 0||o.call(s,{next:n,prev:i.resetKeys,reason:"keys"}),this.setState(He))}render(){const{children:i,fallbackRender:r,FallbackComponent:e,fallback:n}=this.props,{didCatch:o,error:s}=this.state;let d=i;if(o){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")d=r(l);else if(e)d=a.createElement(e,l);else{if(n===void 0)throw s;d=n}}return a.createElement(Dt.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},d)}}function pt(t){var i,r,e="";if(typeof t=="string"||typeof t=="number")e+=t;else if(typeof t=="object")if(Array.isArray(t))for(i=0;i<t.length;i++)t[i]&&(r=pt(t[i]))&&(e&&(e+=" "),e+=r);else for(i in t)t[i]&&(e&&(e+=" "),e+=i);return e}function te(){for(var t,i,r=0,e="";r<arguments.length;)(t=arguments[r++])&&(i=pt(t))&&(e&&(e+=" "),e+=i);return e}let Rt={data:""},Pt=t=>typeof window=="object"?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||Rt,Ft=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,It=/\/\*[^]*?\*\/| +/g,Je=/\n+/g,ie=(t,i)=>{let r="",e="",n="";for(let o in t){let s=t[o];o[0]=="@"?o[1]=="i"?r=o+" "+s+";":e+=o[1]=="f"?ie(s,o):o+"{"+ie(s,o[1]=="k"?"":i)+"}":typeof s=="object"?e+=ie(s,i?i.replace(/([^,])+/g,d=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,d):d?d+" "+l:l)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),n+=ie.p?ie.p(o,s):o+":"+s+";")}return r+(i&&n?i+"{"+n+"}":n)+e},Y={},mt=t=>{if(typeof t=="object"){let i="";for(let r in t)i+=r+mt(t[r]);return i}return t},qt=(t,i,r,e,n)=>{let o=mt(t),s=Y[o]||(Y[o]=(l=>{let u=0,p=11;for(;u<l.length;)p=101*p+l.charCodeAt(u++)>>>0;return"go"+p})(o));if(!Y[s]){let l=o!==t?t:(u=>{let p,m,g=[{}];for(;p=Ft.exec(u.replace(It,""));)p[4]?g.shift():p[3]?(m=p[3].replace(Je," ").trim(),g.unshift(g[0][m]=g[0][m]||{})):g[0][p[1]]=p[2].replace(Je," ").trim();return g[0]})(t);Y[s]=ie(n?{["@keyframes "+s]:l}:l,r?"":"."+s)}let d=r&&Y.g?Y.g:null;return r&&(Y.g=Y[s]),((l,u,p,m)=>{m?u.data=u.data.replace(m,l):u.data.indexOf(l)===-1&&(u.data=p?l+u.data:u.data+l)})(Y[s],i,e,d),s};function $e(t){let i=this||{},r=t.call?t(i.p):t;return qt(r.unshift?r.raw?((e,n,o)=>e.reduce((s,d,l)=>{let u=n[l];if(u&&u.call){let p=u(o),m=p&&p.props&&p.props.className||/^go/.test(p)&&p;u=m?"."+m:p&&typeof p=="object"?p.props?"":ie(p,""):p===!1?"":p}return s+d+(u??"")},""))(r,[].slice.call(arguments,1),i.p):r.reduce((e,n)=>Object.assign(e,n&&n.call?n(i.p):n),{}):r,Pt(i.target),i.g,i.o,i.k)}function ft(t,i,r){return i&&function(e,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}(t.prototype,i),t}function L(){return L=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},L.apply(this,arguments)}function ht(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i}function ve(t,i){if(t==null)return{};var r,e,n={},o=Object.keys(t);for(e=0;e<o.length;e++)r=o[e],i.indexOf(r)>=0||(n[r]=t[r]);return n}function et(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}$e.bind({g:1}),$e.bind({k:1});var tt=function(){return""},gt=a.createContext({enqueueSnackbar:tt,closeSnackbar:tt}),Be="@media (max-width:599.95px)",Re="@media (min-width:600px)",nt=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},Qe=function(t){return""+nt(t.vertical)+nt(t.horizontal)},Te=function(t){return!!t||t===0},Le="unmounted",ue="exited",de="entering",ke="entered",ot="exiting",Ze=function(t){function i(e){var n;n=t.call(this,e)||this;var o,s=e.appear;return n.appearStatus=null,e.in?s?(o=ue,n.appearStatus=de):o=ke:o=e.unmountOnExit||e.mountOnEnter?Le:ue,n.state={status:o},n.nextCallback=null,n}ht(i,t),i.getDerivedStateFromProps=function(e,n){return e.in&&n.status===Le?{status:ue}:null};var r=i.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var n=null;if(e!==this.props){var o=this.state.status;this.props.in?o!==de&&o!==ke&&(n=de):o!==de&&o!==ke||(n=ot)}this.updateStatus(!1,n)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e=this.props.timeout,n=e,o=e;return e!=null&&typeof e!="number"&&typeof e!="string"&&(o=e.exit,n=e.enter),{exit:o,enter:n}},r.updateStatus=function(e,n){e===void 0&&(e=!1),n!==null?(this.cancelNextCallback(),n===de?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===ue&&this.setState({status:Le})},r.performEnter=function(e){var n=this,o=this.props.enter,s=e,d=this.getTimeouts();e||o?(this.props.onEnter&&this.props.onEnter(this.node,s),this.safeSetState({status:de},function(){n.props.onEntering&&n.props.onEntering(n.node,s),n.onTransitionEnd(d.enter,function(){n.safeSetState({status:ke},function(){n.props.onEntered&&n.props.onEntered(n.node,s)})})})):this.safeSetState({status:ke},function(){n.props.onEntered&&n.props.onEntered(n.node,s)})},r.performExit=function(){var e=this,n=this.props.exit,o=this.getTimeouts();n?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:ot},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(o.exit,function(){e.safeSetState({status:ue},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:ue},function(){e.props.onExited&&e.props.onExited(e.node)})},r.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,n){n=this.setNextCallback(n),this.setState(e,n)},r.setNextCallback=function(e){var n=this,o=!0;return this.nextCallback=function(){o&&(o=!1,n.nextCallback=null,e())},this.nextCallback.cancel=function(){o=!1},this.nextCallback},r.onTransitionEnd=function(e,n){this.setNextCallback(n);var o=e==null&&!this.props.addEndListener;this.node&&!o?(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),e!=null&&setTimeout(this.nextCallback,e)):setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===Le)return null;var n=this.props;return(0,n.children)(e,ve(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},ft(i,[{key:"node",get:function(){var e,n=(e=this.props.nodeRef)===null||e===void 0?void 0:e.current;if(!n)throw new Error("notistack - Custom snackbar is not refForwarding");return n}}]),i}(a.Component);function pe(){}function rt(t,i){typeof t=="function"?t(i):t&&(t.current=i)}function Ge(t,i){return a.useMemo(function(){return t==null&&i==null?null:function(r){rt(t,r),rt(i,r)}},[t,i])}function Pe(t){var i=t.timeout,r=t.style,e=r===void 0?{}:r,n=t.mode;return{duration:typeof i=="object"?i[n]||0:i,easing:e.transitionTimingFunction,delay:e.transitionDelay}}Ze.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:pe,onEntering:pe,onEntered:pe,onExit:pe,onExiting:pe,onExited:pe};var Nt="cubic-bezier(0.4, 0, 0.2, 1)",At="cubic-bezier(0.0, 0, 0.2, 1)",Ht="cubic-bezier(0.4, 0, 0.6, 1)",kt=function(t){t.scrollTop=t.scrollTop},it=function(t){return Math.round(t)+"ms"};function me(t,i){t===void 0&&(t=["all"]);var r=i||{},e=r.duration,n=e===void 0?300:e,o=r.easing,s=o===void 0?Nt:o,d=r.delay,l=d===void 0?0:d;return(Array.isArray(t)?t:[t]).map(function(u){var p=typeof n=="string"?n:it(n),m=typeof l=="string"?l:it(l);return u+" "+p+" "+s+" "+m}).join(",")}function bt(t){var i=function(r){return r&&r.ownerDocument||document}(t);return i.defaultView||window}function Me(t,i){if(i){var r=function(e,n){var o,s=n.getBoundingClientRect(),d=bt(n);if(n.fakeTransform)o=n.fakeTransform;else{var l=d.getComputedStyle(n);o=l.getPropertyValue("-webkit-transform")||l.getPropertyValue("transform")}var u=0,p=0;if(o&&o!=="none"&&typeof o=="string"){var m=o.split("(")[1].split(")")[0].split(",");u=parseInt(m[4],10),p=parseInt(m[5],10)}switch(e){case"left":return"translateX("+(d.innerWidth+u-s.left)+"px)";case"right":return"translateX(-"+(s.left+s.width-u)+"px)";case"up":return"translateY("+(d.innerHeight+p-s.top)+"px)";default:return"translateY(-"+(s.top+s.height-p)+"px)"}}(t,i);r&&(i.style.webkitTransform=r,i.style.transform=r)}}var xt=a.forwardRef(function(t,i){var r=t.children,e=t.direction,n=e===void 0?"down":e,o=t.in,s=t.style,d=t.timeout,l=d===void 0?0:d,u=t.onEnter,p=t.onEntered,m=t.onExit,g=t.onExited,w=ve(t,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),v=a.useRef(null),y=Ge(r.ref,v),E=Ge(y,i),b=a.useCallback(function(){v.current&&Me(n,v.current)},[n]);return a.useEffect(function(){if(!o&&n!=="down"&&n!=="right"){var k=function(T,Z){var A;function B(){for(var _=this,U=arguments.length,V=new Array(U),G=0;G<U;G++)V[G]=arguments[G];clearTimeout(A),A=setTimeout(function(){T.apply(_,V)},Z)}return Z===void 0&&(Z=166),B.clear=function(){clearTimeout(A)},B}(function(){v.current&&Me(n,v.current)}),D=bt(v.current);return D.addEventListener("resize",k),function(){k.clear(),D.removeEventListener("resize",k)}}},[n,o]),a.useEffect(function(){o||b()},[o,b]),a.createElement(Ze,Object.assign({appear:!0,nodeRef:v,onEnter:function(k,D){Me(n,k),kt(k),u&&u(k,D)},onEntered:p,onEntering:function(k){var D=s?.transitionTimingFunction||At,T=Pe({timeout:l,mode:"enter",style:L({},s,{transitionTimingFunction:D})});k.style.webkitTransition=me("-webkit-transform",T),k.style.transition=me("transform",T),k.style.webkitTransform="none",k.style.transform="none"},onExit:function(k){var D=s?.transitionTimingFunction||Ht,T=Pe({timeout:l,mode:"exit",style:L({},s,{transitionTimingFunction:D})});k.style.webkitTransition=me("-webkit-transform",T),k.style.transition=me("transform",T),Me(n,k),m&&m(k)},onExited:function(k){k.style.webkitTransition="",k.style.transition="",g&&g(k)},in:o,timeout:l},w),function(k,D){return a.cloneElement(r,L({ref:E,style:L({visibility:k!=="exited"||o?void 0:"hidden"},s,{},r.props.style)},D))})});xt.displayName="Slide";var Fe=function(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},t))},Bt=function(){return a.createElement(Fe,null,a.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
6
|
+
*/const h=require("react/jsx-runtime"),a=require("react"),c=require("./COuWkDpDO5rzQ1GV.cjs"),Ot=require("react-dom"),H=require("@mui/material"),oe=require("@sheetxl/sdk"),Ke=require("@mui/icons-material"),Dt=a.createContext(null),He={didCatch:!1,error:null};class Wt extends a.Component{constructor(i){super(i),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=He}static getDerivedStateFromError(i){return{didCatch:!0,error:i}}resetErrorBoundary(){const{error:i}=this.state;if(i!==null){for(var r,e,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];(r=(e=this.props).onReset)===null||r===void 0||r.call(e,{args:o,reason:"imperative-api"}),this.setState(He)}}componentDidCatch(i,r){var e,n;(e=(n=this.props).onError)===null||e===void 0||e.call(n,i,r)}componentDidUpdate(i,r){const{didCatch:e}=this.state,{resetKeys:n}=this.props;var o,s;e&&r.error!==null&&function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return d.length!==l.length||d.some((u,p)=>!Object.is(u,l[p]))}(i.resetKeys,n)&&((o=(s=this.props).onReset)===null||o===void 0||o.call(s,{next:n,prev:i.resetKeys,reason:"keys"}),this.setState(He))}render(){const{children:i,fallbackRender:r,FallbackComponent:e,fallback:n}=this.props,{didCatch:o,error:s}=this.state;let d=i;if(o){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")d=r(l);else if(e)d=a.createElement(e,l);else{if(n===void 0)throw s;d=n}}return a.createElement(Dt.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},d)}}function pt(t){var i,r,e="";if(typeof t=="string"||typeof t=="number")e+=t;else if(typeof t=="object")if(Array.isArray(t))for(i=0;i<t.length;i++)t[i]&&(r=pt(t[i]))&&(e&&(e+=" "),e+=r);else for(i in t)t[i]&&(e&&(e+=" "),e+=i);return e}function te(){for(var t,i,r=0,e="";r<arguments.length;)(t=arguments[r++])&&(i=pt(t))&&(e&&(e+=" "),e+=i);return e}let Rt={data:""},Pt=t=>typeof window=="object"?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||Rt,Ft=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,It=/\/\*[^]*?\*\/| +/g,Je=/\n+/g,ie=(t,i)=>{let r="",e="",n="";for(let o in t){let s=t[o];o[0]=="@"?o[1]=="i"?r=o+" "+s+";":e+=o[1]=="f"?ie(s,o):o+"{"+ie(s,o[1]=="k"?"":i)+"}":typeof s=="object"?e+=ie(s,i?i.replace(/([^,])+/g,d=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,d):d?d+" "+l:l)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),n+=ie.p?ie.p(o,s):o+":"+s+";")}return r+(i&&n?i+"{"+n+"}":n)+e},Y={},mt=t=>{if(typeof t=="object"){let i="";for(let r in t)i+=r+mt(t[r]);return i}return t},qt=(t,i,r,e,n)=>{let o=mt(t),s=Y[o]||(Y[o]=(l=>{let u=0,p=11;for(;u<l.length;)p=101*p+l.charCodeAt(u++)>>>0;return"go"+p})(o));if(!Y[s]){let l=o!==t?t:(u=>{let p,m,g=[{}];for(;p=Ft.exec(u.replace(It,""));)p[4]?g.shift():p[3]?(m=p[3].replace(Je," ").trim(),g.unshift(g[0][m]=g[0][m]||{})):g[0][p[1]]=p[2].replace(Je," ").trim();return g[0]})(t);Y[s]=ie(n?{["@keyframes "+s]:l}:l,r?"":"."+s)}let d=r&&Y.g?Y.g:null;return r&&(Y.g=Y[s]),((l,u,p,m)=>{m?u.data=u.data.replace(m,l):u.data.indexOf(l)===-1&&(u.data=p?l+u.data:u.data+l)})(Y[s],i,e,d),s};function $e(t){let i=this||{},r=t.call?t(i.p):t;return qt(r.unshift?r.raw?((e,n,o)=>e.reduce((s,d,l)=>{let u=n[l];if(u&&u.call){let p=u(o),m=p&&p.props&&p.props.className||/^go/.test(p)&&p;u=m?"."+m:p&&typeof p=="object"?p.props?"":ie(p,""):p===!1?"":p}return s+d+(u??"")},""))(r,[].slice.call(arguments,1),i.p):r.reduce((e,n)=>Object.assign(e,n&&n.call?n(i.p):n),{}):r,Pt(i.target),i.g,i.o,i.k)}function ft(t,i,r){return i&&function(e,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}(t.prototype,i),t}function L(){return L=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},L.apply(this,arguments)}function ht(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i}function ve(t,i){if(t==null)return{};var r,e,n={},o=Object.keys(t);for(e=0;e<o.length;e++)r=o[e],i.indexOf(r)>=0||(n[r]=t[r]);return n}function et(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}$e.bind({g:1}),$e.bind({k:1});var tt=function(){return""},gt=a.createContext({enqueueSnackbar:tt,closeSnackbar:tt}),Be="@media (max-width:599.95px)",Re="@media (min-width:600px)",nt=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},Qe=function(t){return""+nt(t.vertical)+nt(t.horizontal)},Te=function(t){return!!t||t===0},Le="unmounted",ue="exited",de="entering",ke="entered",ot="exiting",Ze=function(t){function i(e){var n;n=t.call(this,e)||this;var o,s=e.appear;return n.appearStatus=null,e.in?s?(o=ue,n.appearStatus=de):o=ke:o=e.unmountOnExit||e.mountOnEnter?Le:ue,n.state={status:o},n.nextCallback=null,n}ht(i,t),i.getDerivedStateFromProps=function(e,n){return e.in&&n.status===Le?{status:ue}:null};var r=i.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var n=null;if(e!==this.props){var o=this.state.status;this.props.in?o!==de&&o!==ke&&(n=de):o!==de&&o!==ke||(n=ot)}this.updateStatus(!1,n)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e=this.props.timeout,n=e,o=e;return e!=null&&typeof e!="number"&&typeof e!="string"&&(o=e.exit,n=e.enter),{exit:o,enter:n}},r.updateStatus=function(e,n){e===void 0&&(e=!1),n!==null?(this.cancelNextCallback(),n===de?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===ue&&this.setState({status:Le})},r.performEnter=function(e){var n=this,o=this.props.enter,s=e,d=this.getTimeouts();e||o?(this.props.onEnter&&this.props.onEnter(this.node,s),this.safeSetState({status:de},function(){n.props.onEntering&&n.props.onEntering(n.node,s),n.onTransitionEnd(d.enter,function(){n.safeSetState({status:ke},function(){n.props.onEntered&&n.props.onEntered(n.node,s)})})})):this.safeSetState({status:ke},function(){n.props.onEntered&&n.props.onEntered(n.node,s)})},r.performExit=function(){var e=this,n=this.props.exit,o=this.getTimeouts();n?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:ot},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(o.exit,function(){e.safeSetState({status:ue},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:ue},function(){e.props.onExited&&e.props.onExited(e.node)})},r.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,n){n=this.setNextCallback(n),this.setState(e,n)},r.setNextCallback=function(e){var n=this,o=!0;return this.nextCallback=function(){o&&(o=!1,n.nextCallback=null,e())},this.nextCallback.cancel=function(){o=!1},this.nextCallback},r.onTransitionEnd=function(e,n){this.setNextCallback(n);var o=e==null&&!this.props.addEndListener;this.node&&!o?(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),e!=null&&setTimeout(this.nextCallback,e)):setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===Le)return null;var n=this.props;return(0,n.children)(e,ve(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},ft(i,[{key:"node",get:function(){var e,n=(e=this.props.nodeRef)===null||e===void 0?void 0:e.current;if(!n)throw new Error("notistack - Custom snackbar is not refForwarding");return n}}]),i}(a.Component);function pe(){}function rt(t,i){typeof t=="function"?t(i):t&&(t.current=i)}function Ge(t,i){return a.useMemo(function(){return t==null&&i==null?null:function(r){rt(t,r),rt(i,r)}},[t,i])}function Pe(t){var i=t.timeout,r=t.style,e=r===void 0?{}:r,n=t.mode;return{duration:typeof i=="object"?i[n]||0:i,easing:e.transitionTimingFunction,delay:e.transitionDelay}}Ze.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:pe,onEntering:pe,onEntered:pe,onExit:pe,onExiting:pe,onExited:pe};var Nt="cubic-bezier(0.4, 0, 0.2, 1)",At="cubic-bezier(0.0, 0, 0.2, 1)",Ht="cubic-bezier(0.4, 0, 0.6, 1)",kt=function(t){t.scrollTop=t.scrollTop},it=function(t){return Math.round(t)+"ms"};function me(t,i){t===void 0&&(t=["all"]);var r=i||{},e=r.duration,n=e===void 0?300:e,o=r.easing,s=o===void 0?Nt:o,d=r.delay,l=d===void 0?0:d;return(Array.isArray(t)?t:[t]).map(function(u){var p=typeof n=="string"?n:it(n),m=typeof l=="string"?l:it(l);return u+" "+p+" "+s+" "+m}).join(",")}function bt(t){var i=function(r){return r&&r.ownerDocument||document}(t);return i.defaultView||window}function Me(t,i){if(i){var r=function(e,n){var o,s=n.getBoundingClientRect(),d=bt(n);if(n.fakeTransform)o=n.fakeTransform;else{var l=d.getComputedStyle(n);o=l.getPropertyValue("-webkit-transform")||l.getPropertyValue("transform")}var u=0,p=0;if(o&&o!=="none"&&typeof o=="string"){var m=o.split("(")[1].split(")")[0].split(",");u=parseInt(m[4],10),p=parseInt(m[5],10)}switch(e){case"left":return"translateX("+(d.innerWidth+u-s.left)+"px)";case"right":return"translateX(-"+(s.left+s.width-u)+"px)";case"up":return"translateY("+(d.innerHeight+p-s.top)+"px)";default:return"translateY(-"+(s.top+s.height-p)+"px)"}}(t,i);r&&(i.style.webkitTransform=r,i.style.transform=r)}}var xt=a.forwardRef(function(t,i){var r=t.children,e=t.direction,n=e===void 0?"down":e,o=t.in,s=t.style,d=t.timeout,l=d===void 0?0:d,u=t.onEnter,p=t.onEntered,m=t.onExit,g=t.onExited,w=ve(t,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),v=a.useRef(null),y=Ge(r.ref,v),E=Ge(y,i),b=a.useCallback(function(){v.current&&Me(n,v.current)},[n]);return a.useEffect(function(){if(!o&&n!=="down"&&n!=="right"){var k=function(T,Z){var A;function B(){for(var _=this,U=arguments.length,V=new Array(U),G=0;G<U;G++)V[G]=arguments[G];clearTimeout(A),A=setTimeout(function(){T.apply(_,V)},Z)}return Z===void 0&&(Z=166),B.clear=function(){clearTimeout(A)},B}(function(){v.current&&Me(n,v.current)}),D=bt(v.current);return D.addEventListener("resize",k),function(){k.clear(),D.removeEventListener("resize",k)}}},[n,o]),a.useEffect(function(){o||b()},[o,b]),a.createElement(Ze,Object.assign({appear:!0,nodeRef:v,onEnter:function(k,D){Me(n,k),kt(k),u&&u(k,D)},onEntered:p,onEntering:function(k){var D=s?.transitionTimingFunction||At,T=Pe({timeout:l,mode:"enter",style:L({},s,{transitionTimingFunction:D})});k.style.webkitTransition=me("-webkit-transform",T),k.style.transition=me("transform",T),k.style.webkitTransform="none",k.style.transform="none"},onExit:function(k){var D=s?.transitionTimingFunction||Ht,T=Pe({timeout:l,mode:"exit",style:L({},s,{transitionTimingFunction:D})});k.style.webkitTransition=me("-webkit-transform",T),k.style.transition=me("transform",T),Me(n,k),m&&m(k)},onExited:function(k){k.style.webkitTransition="",k.style.transition="",g&&g(k)},in:o,timeout:l},w),function(k,D){return a.cloneElement(r,L({ref:E,style:L({visibility:k!=="exited"||o?void 0:"hidden"},s,{},r.props.style)},D))})});xt.displayName="Slide";var Fe=function(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},t))},Bt=function(){return a.createElement(Fe,null,a.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
7
7
|
10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},_t=function(){return a.createElement(Fe,null,a.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},Vt=function(){return a.createElement(Fe,null,a.createElement("path",{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
|
|
8
8
|
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
|
|
9
9
|
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},zt=function(){return a.createElement(Fe,null,a.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|
|
10
|
-
0 22,12A10,10 0 0,0 12,2Z`}))},re={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:a.createElement(Bt,null),warning:a.createElement(_t,null),error:a.createElement(Vt,null),info:a.createElement(zt,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:xt,transitionDuration:{enter:225,exit:195}},Ut=function(t,i){return function(r,e){return e===void 0&&(e=!1),e?L({},re[r],{},i[r],{},t[r]):r==="autoHideDuration"?(n=t.autoHideDuration,o=i.autoHideDuration,(s=function(d){return typeof d=="number"||d===null})(n)?n:s(o)?o:re.autoHideDuration):r==="transitionDuration"?function(d,l){var u=function(p,m){return m.some(function(g){return typeof p===g})};return u(d,["string","number"])?d:u(d,["object"])?L({},re.transitionDuration,{},u(l,["object"])&&l,{},d):u(l,["string","number"])?l:u(l,["object"])?L({},re.transitionDuration,{},l):re.transitionDuration}(t.transitionDuration,i.transitionDuration):t[r]||i[r]||re[r];var n,o,s}};function Ee(t){return Object.entries(t).reduce(function(i,r){var e,n=r[0],o=r[1];return L({},i,((e={})[n]=$e(o),e))},{})}var Kt="notistack-SnackbarContainer",$t="notistack-Snackbar",wt="notistack-CollapseWrapper",Gt="notistack-MuiContent",Qt=function(t){return"notistack-MuiContent-"+t},at=Ee({root:{height:0},entered:{height:"auto"}}),_e="0px",yt=a.forwardRef(function(t,i){var r=t.children,e=t.in,n=t.onExited,o=a.useRef(null),s=a.useRef(null),d=Ge(i,s),l=function(){return o.current?o.current.clientHeight:0};return a.createElement(Ze,{in:e,unmountOnExit:!0,onEnter:function(u){u.style.height=_e},onEntered:function(u){u.style.height="auto"},onEntering:function(u){var p=l(),m=Pe({timeout:175,mode:"enter"}),g=m.duration,w=m.easing;u.style.transitionDuration=typeof g=="string"?g:g+"ms",u.style.height=p+"px",u.style.transitionTimingFunction=w||""},onExit:function(u){u.style.height=l()+"px"},onExited:n,onExiting:function(u){kt(u);var p=Pe({timeout:175,mode:"exit"}),m=p.duration,g=p.easing;u.style.transitionDuration=typeof m=="string"?m:m+"ms",u.style.height=_e,u.style.transitionTimingFunction=g||""},nodeRef:s,timeout:175},function(u,p){return a.createElement("div",Object.assign({ref:d,className:te(at.root,u==="entered"&&at.entered),style:L({pointerEvents:"all",overflow:"hidden",minHeight:_e,transition:me("height")},u==="entered"&&{overflow:"visible"},{},u==="exited"&&!e&&{visibility:"hidden"})},p),a.createElement("div",{ref:o,className:wt,style:{display:"flex",width:"100%"}},r))})});yt.displayName="Collapse";var st={right:"left",left:"right",bottom:"up",top:"down"},Zt=function(t){return"anchorOrigin"+Qe(t)},Xt=function(){};function ye(t,i){return t.reduce(function(r,e){return e==null?r:function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];var d=[].concat(o);i&&d.indexOf(i)===-1&&d.push(i),r.apply(this,d),e.apply(this,d)}},Xt)}var Yt=typeof window<"u"?a.useLayoutEffect:a.useEffect;function lt(t){var i=a.useRef(t);return Yt(function(){i.current=t}),a.useCallback(function(){return i.current.apply(void 0,arguments)},[])}var Ve,vt=a.forwardRef(function(t,i){var r=t.children,e=t.className,n=t.autoHideDuration,o=t.disableWindowBlurListener,s=o!==void 0&&o,d=t.onClose,l=t.id,u=t.open,p=t.SnackbarProps,m=p===void 0?{}:p,g=a.useRef(),w=lt(function(){d&&d.apply(void 0,arguments)}),v=lt(function(b){d&&b!=null&&(g.current&&clearTimeout(g.current),g.current=setTimeout(function(){w(null,"timeout",l)},b))});a.useEffect(function(){return u&&v(n),function(){g.current&&clearTimeout(g.current)}},[u,n,v]);var y=function(){g.current&&clearTimeout(g.current)},E=a.useCallback(function(){n!=null&&v(.5*n)},[n,v]);return a.useEffect(function(){if(!s&&u)return window.addEventListener("focus",E),window.addEventListener("blur",y),function(){window.removeEventListener("focus",E),window.removeEventListener("blur",y)}},[s,E,u]),a.createElement("div",Object.assign({ref:i},m,{className:te($t,e),onMouseEnter:function(b){m.onMouseEnter&&m.onMouseEnter(b),y()},onMouseLeave:function(b){m.onMouseLeave&&m.onMouseLeave(b),E()}}),r)});vt.displayName="Snackbar";var Jt=Ee({root:(Ve={display:"flex",flexWrap:"wrap",flexGrow:1},Ve[Re]={flexGrow:"initial",minWidth:"288px"},Ve)}),Xe=a.forwardRef(function(t,i){var r=t.className,e=ve(t,["className"]);return a.createElement("div",Object.assign({ref:i,className:te(Jt.root,r)},e))});Xe.displayName="SnackbarContent";var be=Ee({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),ct="notistack-snackbar",Et=a.forwardRef(function(t,i){var r=t.id,e=t.message,n=t.action,o=t.iconVariant,s=t.variant,d=t.hideIconVariant,l=t.style,u=t.className,p=o[s],m=n;return typeof m=="function"&&(m=m(r)),a.createElement(Xe,{ref:i,role:"alert","aria-describedby":ct,style:l,className:te(Gt,Qt(s),be.root,be[s],u,!d&&p&&be.lessPadding)},a.createElement("div",{id:ct,className:be.message},d?null:p,e),m&&a.createElement("div",{className:be.action},m))});Et.displayName="MaterialDesignContent";var xe,ze,je,Oe,Ue,en=a.memo(Et),tn=Ee({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),nn=function(t){var i=a.useRef(),r=a.useState(!0),e=r[0],n=r[1],o=ye([t.snack.onClose,t.onClose]),s=a.useCallback(function(){i.current=setTimeout(function(){n(function(_){return!_})},125)},[]);a.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var d,l=t.snack,u=t.classes,p=t.Component,m=p===void 0?en:p,g=a.useMemo(function(){return function(_){_===void 0&&(_={});var U={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(_).filter(function(V){return!U[V]}).reduce(function(V,G){var ae;return L({},V,((ae={})[G]=_[G],ae))},{})}(u)},[u]),w=l.open,v=l.SnackbarProps,y=l.TransitionComponent,E=l.TransitionProps,b=l.transitionDuration,k=l.disableWindowBlurListener,D=l.content,T=ve(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),Z=L({direction:(d=T.anchorOrigin,d.horizontal!=="center"?st[d.horizontal]:st[d.vertical]),timeout:b},E),A=D;typeof A=="function"&&(A=A(T.id,T.message));var B=["onEnter","onEntered","onExit","onExited"].reduce(function(_,U){var V;return L({},_,((V={})[U]=ye([t.snack[U],t[U]],T.id),V))},{});return a.createElement(yt,{in:e,onExited:B.onExited},a.createElement(vt,{open:w,id:T.id,disableWindowBlurListener:k,autoHideDuration:T.autoHideDuration,className:te(tn.wrappedRoot,g.root,g[Zt(T.anchorOrigin)]),SnackbarProps:v,onClose:o},a.createElement(y,Object.assign({},Z,{appear:!0,in:w,onExit:B.onExit,onExited:s,onEnter:B.onEnter,onEntered:ye([B.onEntered,function(){t.snack.requestClose&&o(null,"instructed",t.snack.id)}],T.id)}),A||a.createElement(m,Object.assign({},T)))))},we={default:20},De={default:6,dense:2},ut="."+wt,We=Ee({root:(xe={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:me(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},xe[ut]={padding:De.default+"px 0px",transition:"padding 300ms ease 0ms"},xe.maxWidth="calc(100% - "+2*we.default+"px)",xe[Be]={width:"100%",maxWidth:"calc(100% - 32px)"},xe),rootDense:(ze={},ze[ut]={padding:De.dense+"px 0px"},ze),top:{top:we.default-De.default+"px",flexDirection:"column"},bottom:{bottom:we.default-De.default+"px",flexDirection:"column-reverse"},left:(je={left:we.default+"px"},je[Re]={alignItems:"flex-start"},je[Be]={left:"16px"},je),right:(Oe={right:we.default+"px"},Oe[Re]={alignItems:"flex-end"},Oe[Be]={right:"16px"},Oe),center:(Ue={left:"50%",transform:"translateX(-50%)"},Ue[Re]={alignItems:"center"},Ue)}),on=function(t){var i=t.classes,r=i===void 0?{}:i,e=t.anchorOrigin,n=t.dense,o=t.children,s=te(Kt,We[e.vertical],We[e.horizontal],We.root,r.containerRoot,r["containerAnchorOrigin"+Qe(e)],n&&We.rootDense);return a.createElement("div",{className:s},o)},rn=a.memo(on),dt=function(t){return!(typeof t=="string"||a.isValidElement(t))},an=function(t){function i(r){var e;return(e=t.call(this,r)||this).enqueueSnackbar=function(n,o){if(o===void 0&&(o={}),n==null)throw new Error("enqueueSnackbar called with invalid argument");var s=dt(n)?n:o,d=dt(n)?n.message:n,l=s.key,u=s.preventDuplicate,p=ve(s,["key","preventDuplicate"]),m=Te(l),g=m?l:new Date().getTime()+Math.random(),w=Ut(p,e.props),v=L({id:g},p,{message:d,open:!0,entered:!1,requestClose:!1,persist:w("persist"),action:w("action"),content:w("content"),variant:w("variant"),anchorOrigin:w("anchorOrigin"),disableWindowBlurListener:w("disableWindowBlurListener"),autoHideDuration:w("autoHideDuration"),hideIconVariant:w("hideIconVariant"),TransitionComponent:w("TransitionComponent"),transitionDuration:w("transitionDuration"),TransitionProps:w("TransitionProps",!0),iconVariant:w("iconVariant",!0),style:w("style",!0),SnackbarProps:w("SnackbarProps",!0),className:te(e.props.className,p.className)});return v.persist&&(v.autoHideDuration=void 0),e.setState(function(y){if(u===void 0&&e.props.preventDuplicate||u){var E=function(D){return m?D.id===g:D.message===d},b=y.queue.findIndex(E)>-1,k=y.snacks.findIndex(E)>-1;if(b||k)return y}return e.handleDisplaySnack(L({},y,{queue:[].concat(y.queue,[v])}))}),g},e.handleDisplaySnack=function(n){return n.snacks.length>=e.maxSnack?e.handleDismissOldest(n):e.processQueue(n)},e.processQueue=function(n){var o=n.queue,s=n.snacks;return o.length>0?L({},n,{snacks:[].concat(s,[o[0]]),queue:o.slice(1,o.length)}):n},e.handleDismissOldest=function(n){if(n.snacks.some(function(l){return!l.open||l.requestClose}))return n;var o=!1,s=!1;n.snacks.reduce(function(l,u){return l+(u.open&&u.persist?1:0)},0)===e.maxSnack&&(s=!0);var d=n.snacks.map(function(l){return o||l.persist&&!s?L({},l):(o=!0,l.entered?(l.onClose&&l.onClose(null,"maxsnack",l.id),e.props.onClose&&e.props.onClose(null,"maxsnack",l.id),L({},l,{open:!1})):L({},l,{requestClose:!0}))});return L({},n,{snacks:d})},e.handleEnteredSnack=function(n,o,s){if(!Te(s))throw new Error("handleEnteredSnack Cannot be called with undefined key");e.setState(function(d){return{snacks:d.snacks.map(function(l){return l.id===s?L({},l,{entered:!0}):L({},l)})}})},e.handleCloseSnack=function(n,o,s){e.props.onClose&&e.props.onClose(n,o,s);var d=s===void 0;e.setState(function(l){var u=l.snacks,p=l.queue;return{snacks:u.map(function(m){return d||m.id===s?m.entered?L({},m,{open:!1}):L({},m,{requestClose:!0}):L({},m)}),queue:p.filter(function(m){return m.id!==s})}})},e.closeSnackbar=function(n){var o=e.state.snacks.find(function(s){return s.id===n});Te(n)&&o&&o.onClose&&o.onClose(null,"instructed",n),e.handleCloseSnack(null,"instructed",n)},e.handleExitedSnack=function(n,o){if(!Te(o))throw new Error("handleExitedSnack Cannot be called with undefined key");e.setState(function(s){var d=e.processQueue(L({},s,{snacks:s.snacks.filter(function(l){return l.id!==o})}));return d.queue.length===0?d:e.handleDismissOldest(d)})},e.enqueueSnackbar,e.closeSnackbar,e.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:e.enqueueSnackbar.bind(et(e)),closeSnackbar:e.closeSnackbar.bind(et(e))}},e}return ht(i,t),i.prototype.render=function(){var r=this,e=this.state.contextValue,n=this.props,o=n.domRoot,s=n.children,d=n.dense,l=d!==void 0&&d,u=n.Components,p=u===void 0?{}:u,m=n.classes,g=this.state.snacks.reduce(function(v,y){var E,b=Qe(y.anchorOrigin),k=v[b]||[];return L({},v,((E={})[b]=[].concat(k,[y]),E))},{}),w=Object.keys(g).map(function(v){var y=g[v],E=y[0];return a.createElement(rn,{key:v,dense:l,anchorOrigin:E.anchorOrigin,classes:m},y.map(function(b){return a.createElement(nn,{key:b.id,snack:b,classes:m,Component:p[b.variant],onClose:r.handleCloseSnack,onEnter:r.props.onEnter,onExit:r.props.onExit,onExited:ye([r.handleExitedSnack,r.props.onExited],b.id),onEntered:ye([r.handleEnteredSnack,r.props.onEntered],b.id)})}))});return a.createElement(gt.Provider,{value:e},s,o?Ot.createPortal(w,o):w)},ft(i,[{key:"maxSnack",get:function(){return this.props.maxSnack||re.maxSnack}}]),i}(a.Component),Ct=function(){return a.useContext(gt)};const J={card:"_card_1a398_7",actionRoot:"_actionRoot_1a398_11",icons:"_icons_1a398_16",expand:"_expand_1a398_22",expandOpen:"_expandOpen_1a398_29",stackTraceContainer:"_stackTraceContainer_1a398_33"},St=a.forwardRef((t,i)=>{const{id:r,message:e,iconVariant:n,error:o,hideIconVariant:s,...d}=t,{closeSnackbar:l}=Ct(),u=c.useTheme(),[p,m]=a.useState(!1),g=a.useCallback(()=>{m(y=>!y)},[]),w=a.useCallback(()=>{l(r)},[r,l]),v=o?.message||String(e);return h.jsx(Xe,{ref:i,className:c.clsx(J.root,"error-snackbar"),children:h.jsxs(H.Card,{className:J.card,style:{backgroundColor:u.palette.error.dark,border:`1px solid ${u.palette.error.dark}`},children:[h.jsxs(H.CardActions,{className:J.actionRoot,children:[s?null:n?.error,h.jsx(H.Typography,{variant:"body2",component:"div",className:J.typography,style:{color:u.palette.text.primary},children:v}),h.jsx("div",{style:{flex:"1 1 auto"}}),h.jsxs("div",{className:J.icons,children:[o?h.jsx(H.IconButton,{"aria-label":"Show more",size:"small",className:c.clsx(J.expand,{[J.expandOpen]:p}),style:{color:u.palette.action.active},onClick:g,children:h.jsx(Ke.ExpandMore,{})}):null,h.jsx(H.IconButton,{size:"small",className:J.expand,style:{color:u.palette.action.active},onClick:w,children:h.jsx(Ke.Close,{fontSize:"small"})})]})]}),o?h.jsx(H.Collapse,{in:p,timeout:"auto",unmountOnExit:!0,children:h.jsx("div",{className:J.stackTraceContainer,style:{backgroundColor:u.palette.error.light,borderTop:`1px solid ${u.palette.error.main}`},children:h.jsx(c.k7,{error:o,hideLineNumbers:!0})})}):null]})})});St.displayName="ToastError";const Tt=a.memo(a.forwardRef((t,i)=>{const{commands:r,commandHook:e,scope:n="workbook",disabled:o=!1,...s}=t,d=c.T(u=>{const p={variant:c.vo.Menuitem,parentFloat:u.floatReference,commandHook:e,scope:n,disabled:o},m=h.jsxs(h.Fragment,{children:[h.jsx(c.gr,{...p,command:r.getCommand("newWorkbook"),icon:c.x5(h.jsx(c.zi,{}))}),h.jsx(c.Zt,{orientation:"horizontal"}),h.jsx(c.gr,{...p,command:r.getCommand("openWorkbook"),icon:c.x5(h.jsx(c.Vi,{}))}),h.jsx(c.g4,{...p,commands:r,quickCommand:"saveWorkbook",icon:c.x5(h.jsx(c.Hi,{})),createPopupPanel:g=>{const w={...p,parentFloat:g.floatReference,scope:"saveWorkbook"},v=[];return c.WorkbookIO.getWriteFormats().forEach(y=>{if(y.isDefault)return;let E=null;y.key==="CSV"?E=c.x5(h.jsx(c.ki,{})):y.key==="Excel"&&(E=c.x5(h.jsx(c.Li,{})));const b=r.getCommand(`saveWorkbookAs${y.key}`);b?v.push(a.createElement(c.gr,{...w,key:y.key,command:b,icon:E})):console.warn(`Unable to resolve command: 'saveWorkbookAs${y.key}'`)}),c.L5({...g,children:v,onClick:()=>{g.closeFloatAll()}})}})]});return c.L5({...u,children:m,onClick:g=>{g.isDefaultPrevented||u.closeFloatAll()}})},[o,r,e,n]),l="File";return h.jsx(c.g4,{commands:r,disabled:o,commandHook:e,scope:n,label:l,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:u=>`calc(1.25rem + ${u.spacing(2)}px)`}},...s,createPopupPanel:d,icon:h.jsx(c.ul,{className:"label",icon:null,label:l})})}));Tt.displayName="StandaloneFileCommandButton";const sn=h.jsx(c.n2,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:h.jsx(H.Box,{sx:{width:"24px",height:"24px",marginBottom:"4px",marginLeft:"6px"},children:h.jsx(c.ed,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),Lt=a.memo(a.forwardRef((t,i)=>{const{commands:r,workbook:e,logo:n=sn,mainElement:o,showFileMenu:s=!0,showAppearanceMenu:d=!0,...l}=t,{reference:u}=c.y3(),[p,{width:m}]=c.useMeasure(),g=m<530,w=s?h.jsx(Tt,{commands:r,commandHook:{beforeExecute(){u?.closeAll()},onError(b,k,D){}}}):null,v=d?h.jsx(c.AppearanceCommandButton,{commands:r,commandHook:{beforeExecute(){u?.closeAll()},onError(b,k,D){}}}):null,y=a.useMemo(()=>({paddingLeft:b=>b.spacing(1),paddingRight:b=>b.spacing(1)}),[]),E=a.useRef(null);return h.jsx(H.Box,{ref:c.mergeRefs([E,p,i]),...l,children:c.renderWorkbookToolbars({commands:r,renderCompact:g,workbook:e,selectWrapper:b=>h.jsxs(H.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:k=>k.spacing(1),paddingLeft:k=>k.spacing(1),paddingRight:k=>k.spacing(1)},children:[h.jsxs(H.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:k=>k.spacing(.5)},children:[n,h.jsxs(H.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:k=>k.spacing(.25)},children:[w,b]})]}),h.jsx(H.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:o}),h.jsx(H.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:g&&!v?"0 0 auto":"1 1 100%"},children:v})]}),selectProps:y,toolbarsProps:{Home:{sx:{}}}})})}));Lt.displayName="StandaloneWorkbookToolbar";const Mt=a.memo(a.forwardRef((t,i)=>{const{workbook:r,setWorkbook:e,refWorkbookTitle:n,titleWorkbook:o,setWorkbookTitle:s,titlePlaceHolder:d,children:l,undoManager:u,commands:p,importExportDisabled:m,themeModeOptions:g}=t,w=Ct(),v=w?w.enqueueSnackbar:()=>{},y=w?w.closeSnackbar:()=>{},[E,b]=a.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),k=a.useCallback(()=>{b(O=>({...O,isMounted:!0}))},[]),D=a.useCallback(()=>{b(O=>({...O,isMounted:!1}))},[]),T=c.ll(),Z=c.sl(),A=c.cl(),B=a.useRef(new Set),_=a.useMemo(()=>{const O=(C,S)=>{if(S?.onceKey){if(B.current.has(S.onceKey))return;const M=new Set(B.current);M.add(S.onceKey),B.current=M}const W={variant:S?.type??c.ye.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:S?.preventDuplicate,persist:S?.persist??S?.type===c.ye.Error,action:M=>h.jsx(H.IconButton,{onClick:()=>y(M),children:h.jsx(Ke.CancelOutlined,{})})};S?.enqueueProps&&Object.assign(W,S.enqueueProps),C||console.log("message is 'null'",S),v(C??"Alert",W)};return{showMessage:O,showBusy:(C,S)=>{let W=null;const M=new Promise(N=>{W=N});return b(N=>{const I=new Map(N.starting);return I.set(M,W),{...N,label:C,starting:I}}),M},showWindow:(C,S,W)=>{const M={...S,onKeyDown:N=>{p?.dispatchToFocusedCommand(N),N.isDefaultPrevented()||N.isPropagationStopped()||S?.onKeyDown?.(N)}};return T(C,{sort:()=>Promise.resolve().then(()=>require("./ivbAx6mvfpGeOeWC.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./DcFfMY3RZgcsj0C5.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./lhF4xnajIhTMhNl3.cjs")),comments:()=>Promise.resolve().then(()=>require("./BIKJ2_bHsaXftgBA.cjs")),find:()=>Promise.resolve().then(()=>require("./BIiFKMaRy0Seo_xY.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./BeU89ZkkvdnHOF1P.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./Cq88W0KN7eeKf96-.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./duIJEG2QfFHcyCNS.cjs"))}[C],M,W)},showOptions:Z,showInputOptions:A,showError:C=>{let S,W=c.ye.Error,M="Unknown Error";typeof C=="string"?M=C:C instanceof Error&&(S=C,C.message&&(M=C.message)),C instanceof oe.PartialError&&(W=c.ye.Info),O(M,{type:W,enqueueProps:{error:S}})}}},[]),U=a.useCallback(()=>{},[]),V=(O=>{const{workbook:C,setWorkbook:S,importExportDisabled:W,workbookTitle:M="export",setWorkbookTitle:N,notifier:I,requestWorkbookTitle:X,themeModeOptions:R,undoManager:Ce,commands:Q,onExecute:le}=O,Se=c.T(R?.onForceModeChange,[R?.onForceModeChange]),Ie=c.T(R?.onForceLightGridChange,[R?.onForceLightGridChange]),ce=c.T(R?.onForceLightImagesChange,[R?.onForceLightImagesChange]),qe=c.T(async(j=null,K=null)=>{const f=[];let x,P=null,$=null;if(typeof j=="string"?$=j:P=j,x=P?j:await c.Yt.openFileDialog($??c.WorkbookIO.getAllReadFormatTypeAsString().join(",")),!x)return null;const ee={source:x,constructorOptions:K,onWarning:Ae=>{f.push(Ae)}},ge=await c.WorkbookIO.read(ee,I);return f.length>0&&(I?.showMessage?.("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
|
|
10
|
+
0 22,12A10,10 0 0,0 12,2Z`}))},re={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:a.createElement(Bt,null),warning:a.createElement(_t,null),error:a.createElement(Vt,null),info:a.createElement(zt,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:xt,transitionDuration:{enter:225,exit:195}},Ut=function(t,i){return function(r,e){return e===void 0&&(e=!1),e?L({},re[r],{},i[r],{},t[r]):r==="autoHideDuration"?(n=t.autoHideDuration,o=i.autoHideDuration,(s=function(d){return typeof d=="number"||d===null})(n)?n:s(o)?o:re.autoHideDuration):r==="transitionDuration"?function(d,l){var u=function(p,m){return m.some(function(g){return typeof p===g})};return u(d,["string","number"])?d:u(d,["object"])?L({},re.transitionDuration,{},u(l,["object"])&&l,{},d):u(l,["string","number"])?l:u(l,["object"])?L({},re.transitionDuration,{},l):re.transitionDuration}(t.transitionDuration,i.transitionDuration):t[r]||i[r]||re[r];var n,o,s}};function Ee(t){return Object.entries(t).reduce(function(i,r){var e,n=r[0],o=r[1];return L({},i,((e={})[n]=$e(o),e))},{})}var Kt="notistack-SnackbarContainer",$t="notistack-Snackbar",wt="notistack-CollapseWrapper",Gt="notistack-MuiContent",Qt=function(t){return"notistack-MuiContent-"+t},at=Ee({root:{height:0},entered:{height:"auto"}}),_e="0px",yt=a.forwardRef(function(t,i){var r=t.children,e=t.in,n=t.onExited,o=a.useRef(null),s=a.useRef(null),d=Ge(i,s),l=function(){return o.current?o.current.clientHeight:0};return a.createElement(Ze,{in:e,unmountOnExit:!0,onEnter:function(u){u.style.height=_e},onEntered:function(u){u.style.height="auto"},onEntering:function(u){var p=l(),m=Pe({timeout:175,mode:"enter"}),g=m.duration,w=m.easing;u.style.transitionDuration=typeof g=="string"?g:g+"ms",u.style.height=p+"px",u.style.transitionTimingFunction=w||""},onExit:function(u){u.style.height=l()+"px"},onExited:n,onExiting:function(u){kt(u);var p=Pe({timeout:175,mode:"exit"}),m=p.duration,g=p.easing;u.style.transitionDuration=typeof m=="string"?m:m+"ms",u.style.height=_e,u.style.transitionTimingFunction=g||""},nodeRef:s,timeout:175},function(u,p){return a.createElement("div",Object.assign({ref:d,className:te(at.root,u==="entered"&&at.entered),style:L({pointerEvents:"all",overflow:"hidden",minHeight:_e,transition:me("height")},u==="entered"&&{overflow:"visible"},{},u==="exited"&&!e&&{visibility:"hidden"})},p),a.createElement("div",{ref:o,className:wt,style:{display:"flex",width:"100%"}},r))})});yt.displayName="Collapse";var st={right:"left",left:"right",bottom:"up",top:"down"},Zt=function(t){return"anchorOrigin"+Qe(t)},Xt=function(){};function ye(t,i){return t.reduce(function(r,e){return e==null?r:function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];var d=[].concat(o);i&&d.indexOf(i)===-1&&d.push(i),r.apply(this,d),e.apply(this,d)}},Xt)}var Yt=typeof window<"u"?a.useLayoutEffect:a.useEffect;function lt(t){var i=a.useRef(t);return Yt(function(){i.current=t}),a.useCallback(function(){return i.current.apply(void 0,arguments)},[])}var Ve,vt=a.forwardRef(function(t,i){var r=t.children,e=t.className,n=t.autoHideDuration,o=t.disableWindowBlurListener,s=o!==void 0&&o,d=t.onClose,l=t.id,u=t.open,p=t.SnackbarProps,m=p===void 0?{}:p,g=a.useRef(),w=lt(function(){d&&d.apply(void 0,arguments)}),v=lt(function(b){d&&b!=null&&(g.current&&clearTimeout(g.current),g.current=setTimeout(function(){w(null,"timeout",l)},b))});a.useEffect(function(){return u&&v(n),function(){g.current&&clearTimeout(g.current)}},[u,n,v]);var y=function(){g.current&&clearTimeout(g.current)},E=a.useCallback(function(){n!=null&&v(.5*n)},[n,v]);return a.useEffect(function(){if(!s&&u)return window.addEventListener("focus",E),window.addEventListener("blur",y),function(){window.removeEventListener("focus",E),window.removeEventListener("blur",y)}},[s,E,u]),a.createElement("div",Object.assign({ref:i},m,{className:te($t,e),onMouseEnter:function(b){m.onMouseEnter&&m.onMouseEnter(b),y()},onMouseLeave:function(b){m.onMouseLeave&&m.onMouseLeave(b),E()}}),r)});vt.displayName="Snackbar";var Jt=Ee({root:(Ve={display:"flex",flexWrap:"wrap",flexGrow:1},Ve[Re]={flexGrow:"initial",minWidth:"288px"},Ve)}),Xe=a.forwardRef(function(t,i){var r=t.className,e=ve(t,["className"]);return a.createElement("div",Object.assign({ref:i,className:te(Jt.root,r)},e))});Xe.displayName="SnackbarContent";var be=Ee({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),ct="notistack-snackbar",Et=a.forwardRef(function(t,i){var r=t.id,e=t.message,n=t.action,o=t.iconVariant,s=t.variant,d=t.hideIconVariant,l=t.style,u=t.className,p=o[s],m=n;return typeof m=="function"&&(m=m(r)),a.createElement(Xe,{ref:i,role:"alert","aria-describedby":ct,style:l,className:te(Gt,Qt(s),be.root,be[s],u,!d&&p&&be.lessPadding)},a.createElement("div",{id:ct,className:be.message},d?null:p,e),m&&a.createElement("div",{className:be.action},m))});Et.displayName="MaterialDesignContent";var xe,ze,je,Oe,Ue,en=a.memo(Et),tn=Ee({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),nn=function(t){var i=a.useRef(),r=a.useState(!0),e=r[0],n=r[1],o=ye([t.snack.onClose,t.onClose]),s=a.useCallback(function(){i.current=setTimeout(function(){n(function(_){return!_})},125)},[]);a.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var d,l=t.snack,u=t.classes,p=t.Component,m=p===void 0?en:p,g=a.useMemo(function(){return function(_){_===void 0&&(_={});var U={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(_).filter(function(V){return!U[V]}).reduce(function(V,G){var ae;return L({},V,((ae={})[G]=_[G],ae))},{})}(u)},[u]),w=l.open,v=l.SnackbarProps,y=l.TransitionComponent,E=l.TransitionProps,b=l.transitionDuration,k=l.disableWindowBlurListener,D=l.content,T=ve(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),Z=L({direction:(d=T.anchorOrigin,d.horizontal!=="center"?st[d.horizontal]:st[d.vertical]),timeout:b},E),A=D;typeof A=="function"&&(A=A(T.id,T.message));var B=["onEnter","onEntered","onExit","onExited"].reduce(function(_,U){var V;return L({},_,((V={})[U]=ye([t.snack[U],t[U]],T.id),V))},{});return a.createElement(yt,{in:e,onExited:B.onExited},a.createElement(vt,{open:w,id:T.id,disableWindowBlurListener:k,autoHideDuration:T.autoHideDuration,className:te(tn.wrappedRoot,g.root,g[Zt(T.anchorOrigin)]),SnackbarProps:v,onClose:o},a.createElement(y,Object.assign({},Z,{appear:!0,in:w,onExit:B.onExit,onExited:s,onEnter:B.onEnter,onEntered:ye([B.onEntered,function(){t.snack.requestClose&&o(null,"instructed",t.snack.id)}],T.id)}),A||a.createElement(m,Object.assign({},T)))))},we={default:20},De={default:6,dense:2},ut="."+wt,We=Ee({root:(xe={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:me(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},xe[ut]={padding:De.default+"px 0px",transition:"padding 300ms ease 0ms"},xe.maxWidth="calc(100% - "+2*we.default+"px)",xe[Be]={width:"100%",maxWidth:"calc(100% - 32px)"},xe),rootDense:(ze={},ze[ut]={padding:De.dense+"px 0px"},ze),top:{top:we.default-De.default+"px",flexDirection:"column"},bottom:{bottom:we.default-De.default+"px",flexDirection:"column-reverse"},left:(je={left:we.default+"px"},je[Re]={alignItems:"flex-start"},je[Be]={left:"16px"},je),right:(Oe={right:we.default+"px"},Oe[Re]={alignItems:"flex-end"},Oe[Be]={right:"16px"},Oe),center:(Ue={left:"50%",transform:"translateX(-50%)"},Ue[Re]={alignItems:"center"},Ue)}),on=function(t){var i=t.classes,r=i===void 0?{}:i,e=t.anchorOrigin,n=t.dense,o=t.children,s=te(Kt,We[e.vertical],We[e.horizontal],We.root,r.containerRoot,r["containerAnchorOrigin"+Qe(e)],n&&We.rootDense);return a.createElement("div",{className:s},o)},rn=a.memo(on),dt=function(t){return!(typeof t=="string"||a.isValidElement(t))},an=function(t){function i(r){var e;return(e=t.call(this,r)||this).enqueueSnackbar=function(n,o){if(o===void 0&&(o={}),n==null)throw new Error("enqueueSnackbar called with invalid argument");var s=dt(n)?n:o,d=dt(n)?n.message:n,l=s.key,u=s.preventDuplicate,p=ve(s,["key","preventDuplicate"]),m=Te(l),g=m?l:new Date().getTime()+Math.random(),w=Ut(p,e.props),v=L({id:g},p,{message:d,open:!0,entered:!1,requestClose:!1,persist:w("persist"),action:w("action"),content:w("content"),variant:w("variant"),anchorOrigin:w("anchorOrigin"),disableWindowBlurListener:w("disableWindowBlurListener"),autoHideDuration:w("autoHideDuration"),hideIconVariant:w("hideIconVariant"),TransitionComponent:w("TransitionComponent"),transitionDuration:w("transitionDuration"),TransitionProps:w("TransitionProps",!0),iconVariant:w("iconVariant",!0),style:w("style",!0),SnackbarProps:w("SnackbarProps",!0),className:te(e.props.className,p.className)});return v.persist&&(v.autoHideDuration=void 0),e.setState(function(y){if(u===void 0&&e.props.preventDuplicate||u){var E=function(D){return m?D.id===g:D.message===d},b=y.queue.findIndex(E)>-1,k=y.snacks.findIndex(E)>-1;if(b||k)return y}return e.handleDisplaySnack(L({},y,{queue:[].concat(y.queue,[v])}))}),g},e.handleDisplaySnack=function(n){return n.snacks.length>=e.maxSnack?e.handleDismissOldest(n):e.processQueue(n)},e.processQueue=function(n){var o=n.queue,s=n.snacks;return o.length>0?L({},n,{snacks:[].concat(s,[o[0]]),queue:o.slice(1,o.length)}):n},e.handleDismissOldest=function(n){if(n.snacks.some(function(l){return!l.open||l.requestClose}))return n;var o=!1,s=!1;n.snacks.reduce(function(l,u){return l+(u.open&&u.persist?1:0)},0)===e.maxSnack&&(s=!0);var d=n.snacks.map(function(l){return o||l.persist&&!s?L({},l):(o=!0,l.entered?(l.onClose&&l.onClose(null,"maxsnack",l.id),e.props.onClose&&e.props.onClose(null,"maxsnack",l.id),L({},l,{open:!1})):L({},l,{requestClose:!0}))});return L({},n,{snacks:d})},e.handleEnteredSnack=function(n,o,s){if(!Te(s))throw new Error("handleEnteredSnack Cannot be called with undefined key");e.setState(function(d){return{snacks:d.snacks.map(function(l){return l.id===s?L({},l,{entered:!0}):L({},l)})}})},e.handleCloseSnack=function(n,o,s){e.props.onClose&&e.props.onClose(n,o,s);var d=s===void 0;e.setState(function(l){var u=l.snacks,p=l.queue;return{snacks:u.map(function(m){return d||m.id===s?m.entered?L({},m,{open:!1}):L({},m,{requestClose:!0}):L({},m)}),queue:p.filter(function(m){return m.id!==s})}})},e.closeSnackbar=function(n){var o=e.state.snacks.find(function(s){return s.id===n});Te(n)&&o&&o.onClose&&o.onClose(null,"instructed",n),e.handleCloseSnack(null,"instructed",n)},e.handleExitedSnack=function(n,o){if(!Te(o))throw new Error("handleExitedSnack Cannot be called with undefined key");e.setState(function(s){var d=e.processQueue(L({},s,{snacks:s.snacks.filter(function(l){return l.id!==o})}));return d.queue.length===0?d:e.handleDismissOldest(d)})},e.enqueueSnackbar,e.closeSnackbar,e.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:e.enqueueSnackbar.bind(et(e)),closeSnackbar:e.closeSnackbar.bind(et(e))}},e}return ht(i,t),i.prototype.render=function(){var r=this,e=this.state.contextValue,n=this.props,o=n.domRoot,s=n.children,d=n.dense,l=d!==void 0&&d,u=n.Components,p=u===void 0?{}:u,m=n.classes,g=this.state.snacks.reduce(function(v,y){var E,b=Qe(y.anchorOrigin),k=v[b]||[];return L({},v,((E={})[b]=[].concat(k,[y]),E))},{}),w=Object.keys(g).map(function(v){var y=g[v],E=y[0];return a.createElement(rn,{key:v,dense:l,anchorOrigin:E.anchorOrigin,classes:m},y.map(function(b){return a.createElement(nn,{key:b.id,snack:b,classes:m,Component:p[b.variant],onClose:r.handleCloseSnack,onEnter:r.props.onEnter,onExit:r.props.onExit,onExited:ye([r.handleExitedSnack,r.props.onExited],b.id),onEntered:ye([r.handleEnteredSnack,r.props.onEntered],b.id)})}))});return a.createElement(gt.Provider,{value:e},s,o?Ot.createPortal(w,o):w)},ft(i,[{key:"maxSnack",get:function(){return this.props.maxSnack||re.maxSnack}}]),i}(a.Component),Ct=function(){return a.useContext(gt)};const J={card:"_card_1a398_7",actionRoot:"_actionRoot_1a398_11",icons:"_icons_1a398_16",expand:"_expand_1a398_22",expandOpen:"_expandOpen_1a398_29",stackTraceContainer:"_stackTraceContainer_1a398_33"},St=a.forwardRef((t,i)=>{const{id:r,message:e,iconVariant:n,error:o,hideIconVariant:s,...d}=t,{closeSnackbar:l}=Ct(),u=c.useTheme(),[p,m]=a.useState(!1),g=a.useCallback(()=>{m(y=>!y)},[]),w=a.useCallback(()=>{l(r)},[r,l]),v=o?.message||String(e);return h.jsx(Xe,{ref:i,className:c.clsx(J.root,"error-snackbar"),children:h.jsxs(H.Card,{className:J.card,style:{backgroundColor:u.palette.error.dark,border:`1px solid ${u.palette.error.dark}`},children:[h.jsxs(H.CardActions,{className:J.actionRoot,children:[s?null:n?.error,h.jsx(H.Typography,{variant:"body2",component:"div",className:J.typography,style:{color:u.palette.text.primary},children:v}),h.jsx("div",{style:{flex:"1 1 auto"}}),h.jsxs("div",{className:J.icons,children:[o?h.jsx(H.IconButton,{"aria-label":"Show more",size:"small",className:c.clsx(J.expand,{[J.expandOpen]:p}),style:{color:u.palette.action.active},onClick:g,children:h.jsx(Ke.ExpandMore,{})}):null,h.jsx(H.IconButton,{size:"small",className:J.expand,style:{color:u.palette.action.active},onClick:w,children:h.jsx(Ke.Close,{fontSize:"small"})})]})]}),o?h.jsx(H.Collapse,{in:p,timeout:"auto",unmountOnExit:!0,children:h.jsx("div",{className:J.stackTraceContainer,style:{backgroundColor:u.palette.error.light,borderTop:`1px solid ${u.palette.error.main}`},children:h.jsx(c.k7,{error:o,hideLineNumbers:!0})})}):null]})})});St.displayName="ToastError";const Tt=a.memo(a.forwardRef((t,i)=>{const{commands:r,commandHook:e,scope:n="workbook",disabled:o=!1,...s}=t,d=c.T(u=>{const p={variant:c.vo.Menuitem,parentFloat:u.floatReference,commandHook:e,scope:n,disabled:o},m=h.jsxs(h.Fragment,{children:[h.jsx(c.gr,{...p,command:r.getCommand("newWorkbook"),icon:c.x5(h.jsx(c.zi,{}))}),h.jsx(c.Zt,{orientation:"horizontal"}),h.jsx(c.gr,{...p,command:r.getCommand("openWorkbook"),icon:c.x5(h.jsx(c.Vi,{}))}),h.jsx(c.g4,{...p,commands:r,quickCommand:"saveWorkbook",icon:c.x5(h.jsx(c.Hi,{})),createPopupPanel:g=>{const w={...p,parentFloat:g.floatReference,scope:"saveWorkbook"},v=[];return c.WorkbookIO.getWriteFormats().forEach(y=>{if(y.isDefault)return;let E=null;y.key==="CSV"?E=c.x5(h.jsx(c.ki,{})):y.key==="Excel"&&(E=c.x5(h.jsx(c.Li,{})));const b=r.getCommand(`saveWorkbookAs${y.key}`);b?v.push(a.createElement(c.gr,{...w,key:y.key,command:b,icon:E})):console.warn(`Unable to resolve command: 'saveWorkbookAs${y.key}'`)}),c.L5({...g,children:v,onClick:()=>{g.closeFloatAll()}})}})]});return c.L5({...u,children:m,onClick:g=>{g.isDefaultPrevented||u.closeFloatAll()}})},[o,r,e,n]),l="File";return h.jsx(c.g4,{commands:r,disabled:o,commandHook:e,scope:n,label:l,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:u=>`calc(1.25rem + ${u.spacing(2)}px)`}},...s,createPopupPanel:d,icon:h.jsx(c.ul,{className:"label",icon:null,label:l})})}));Tt.displayName="StandaloneFileCommandButton";const sn=h.jsx(c.n2,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:h.jsx(H.Box,{sx:{width:"24px",height:"24px",marginBottom:"4px",marginLeft:"6px"},children:h.jsx(c.ed,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),Lt=a.memo(a.forwardRef((t,i)=>{const{commands:r,workbook:e,logo:n=sn,mainElement:o,showFileMenu:s=!0,showAppearanceMenu:d=!0,...l}=t,{reference:u}=c.y3(),[p,{width:m}]=c.useMeasure(),g=m<530,w=s?h.jsx(Tt,{commands:r,commandHook:{beforeExecute(){u?.closeAll()},onError(b,k,D){}}}):null,v=d?h.jsx(c.AppearanceCommandButton,{commands:r,commandHook:{beforeExecute(){u?.closeAll()},onError(b,k,D){}}}):null,y=a.useMemo(()=>({paddingLeft:b=>b.spacing(1),paddingRight:b=>b.spacing(1)}),[]),E=a.useRef(null);return h.jsx(H.Box,{ref:c.mergeRefs([E,p,i]),...l,children:c.renderWorkbookToolbars({commands:r,renderCompact:g,workbook:e,selectWrapper:b=>h.jsxs(H.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:k=>k.spacing(1),paddingLeft:k=>k.spacing(1),paddingRight:k=>k.spacing(1)},children:[h.jsxs(H.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:k=>k.spacing(.5)},children:[n,h.jsxs(H.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:k=>k.spacing(.25)},children:[w,b]})]}),h.jsx(H.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:o}),h.jsx(H.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:g&&!v?"0 0 auto":"1 1 100%"},children:v})]}),selectProps:y,toolbarsProps:{Home:{sx:{}}}})})}));Lt.displayName="StandaloneWorkbookToolbar";const Mt=a.memo(a.forwardRef((t,i)=>{const{workbook:r,setWorkbook:e,refWorkbookTitle:n,titleWorkbook:o,setWorkbookTitle:s,titlePlaceHolder:d,children:l,undoManager:u,commands:p,importExportDisabled:m,themeModeOptions:g}=t,w=Ct(),v=w?w.enqueueSnackbar:()=>{},y=w?w.closeSnackbar:()=>{},[E,b]=a.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),k=a.useCallback(()=>{b(O=>({...O,isMounted:!0}))},[]),D=a.useCallback(()=>{b(O=>({...O,isMounted:!1}))},[]),T=c.ll(),Z=c.sl(),A=c.cl(),B=a.useRef(new Set),_=a.useMemo(()=>{const O=(C,S)=>{if(S?.onceKey){if(B.current.has(S.onceKey))return;const M=new Set(B.current);M.add(S.onceKey),B.current=M}const W={variant:S?.type??c.ye.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:S?.preventDuplicate,persist:S?.persist??S?.type===c.ye.Error,action:M=>h.jsx(H.IconButton,{onClick:()=>y(M),children:h.jsx(Ke.CancelOutlined,{})})};S?.enqueueProps&&Object.assign(W,S.enqueueProps),C||console.log("message is 'null'",S),v(C??"Alert",W)};return{showMessage:O,showBusy:(C,S)=>{let W=null;const M=new Promise(N=>{W=N});return b(N=>{const I=new Map(N.starting);return I.set(M,W),{...N,label:C,starting:I}}),M},showWindow:(C,S,W)=>{const M={...S,onKeyDown:N=>{p?.dispatchToFocusedCommand(N),N.isDefaultPrevented()||N.isPropagationStopped()||S?.onKeyDown?.(N)}};return T(C,{sort:()=>Promise.resolve().then(()=>require("./BG2dbyP43Euv7Me7.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./DGk854a2WKUuZJoA.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./C9PIQukfrQAmzgsA.cjs")),comments:()=>Promise.resolve().then(()=>require("./DT1Xp2dyeGwQTMls.cjs")),find:()=>Promise.resolve().then(()=>require("./CWDXq752xpp4KB69.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./vDzzMbYhm99c73sS.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./Cu0BuB_lqZjaHi8K.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./CJwc1R9z4nK1qEt1.cjs"))}[C],M,W)},showOptions:Z,showInputOptions:A,showError:C=>{let S,W=c.ye.Error,M="Unknown Error";typeof C=="string"?M=C:C instanceof Error&&(S=C,C.message&&(M=C.message)),C instanceof oe.PartialError&&(W=c.ye.Info),O(M,{type:W,enqueueProps:{error:S}})}}},[]),U=a.useCallback(()=>{},[]),V=(O=>{const{workbook:C,setWorkbook:S,importExportDisabled:W,workbookTitle:M="export",setWorkbookTitle:N,notifier:I,requestWorkbookTitle:X,themeModeOptions:R,undoManager:Ce,commands:Q,onExecute:le}=O,Se=c.T(R?.onForceModeChange,[R?.onForceModeChange]),Ie=c.T(R?.onForceLightGridChange,[R?.onForceLightGridChange]),ce=c.T(R?.onForceLightImagesChange,[R?.onForceLightImagesChange]),qe=c.T(async(j=null,K=null)=>{const f=[];let x,P=null,$=null;if(typeof j=="string"?$=j:P=j,x=P?j:await c.Yt.openFileDialog($??c.WorkbookIO.getAllReadFormatTypeAsString().join(",")),!x)return null;const ee={source:x,constructorOptions:K,onWarning:Ae=>{f.push(Ae)}},ge=await c.WorkbookIO.read(ee,I);return f.length>0&&(I?.showMessage?.("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
|
|
11
11
|
`+f.join(`
|
|
12
|
-
`))),ge},[le,I,C]),fe=c.T(async(j,K,f)=>{if(!K&&X){const x=await X("Enter Workbook name to "+(f.isDefault?"Save.":`Export as ${f.description}.`));return x!==null&&c.WorkbookIO.writeFile(x,j,{formatType:f.key})}return c.WorkbookIO.writeFile(K,j,{formatType:f.key})},[I,C,X]),q=a.useCallback(()=>({contains:j=>!0,focus(){}}),[]),ne=a.useMemo(()=>{const j=[];W||(c.WorkbookIO.getWriteFormats().forEach(f=>{const x=f.isDefault,P={label:x?"Save Workbook":`Save Workbook as ${f.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${f.description}`},tags:f.tags,description:`Save the workbook to the desktop${x?"":` as ${f.description}`}.`};x&&(P.shortcut={key:"S",modifiers:[c.Z.Ctrl]},j.push(new c.Qt("saveWorkbookAs",q,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[c.Z.Shift,c.Z.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{fe(C,null,f).catch(ee=>{I?.showError?.(ee)})})));const $=x?"saveWorkbook":`saveWorkbookAs${f.key}`;j.push(new c.Qt($,q,P,ee=>{fe(C,ee??M,f).catch(ge=>{I?.showError?.(ge)})}))}),j.push(new c.Qt("openWorkbook",q,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[c.Z.Ctrl]}},async(f=null)=>{const x={date1904:C.isDate1904(),...C.options};try{const P=await qe(f,x);if(!P)return;const $=P.title,ee=P.workbook,ge=ee.getSelectedSheet();if(P.formatType.mimeType==="text/csv"){const Ae=C.findValidSheetName($);await C.doBatch(async()=>{const Ye=ge.getUsedRange();if(!Ye)return void I?.showMessage("The file appears to be blank.");await C.getSheets().add({name:Ae,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(Ye)},`Import CSV '${$}'`)}else C?.close(),N?.($),S(ee)}catch(P){I?.showError?.(P)}})),j.push(new c.Qt("openWorkbookFromUrl",q,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(f){if(!f){const x=await I?.showInputOptions?.({title:"Open Workbook from the Web",description:"Enter the web address for the workbook to open.",inputLabel:"Address",initialValue:"https://www.sheetxl.com/examples/features-checklist.xlsx",inputProps:{style:{minWidth:"440px"}},options:["Open"]});if(x.option!=="Open")return;f=x.input}f&&console.log("openWorkbookFromUrl",f)})));let K=[];return R&&(K=[new c.Qt("themeMode",q,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new c.Qt("defaultThemeMode",q,{label:"Use System Light/Dark Mode",scopedLabels:{appearance:"Use System Default"},description:"Use the system settings to determine styling for light and dark mode."}),new c.Qt("forceLightGrid",q,{label:"Force Light Grid",description:"Force the grid to always render in light mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)."}),new c.Qt("forceLightImages",q,{label:"Force Light Images",description:"Force the images to always render in light mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode."})]),[...j,...K,new c.jt("help",q,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new c.jt("showKeyboardShortcuts",q,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[c.Z.Ctrl]}},()=>{}),new c.Qt("gotoUrlGithub",q,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new c.Qt("gotoUrlDiscord",q,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new c.Qt("gotoUrlDocumentation",q,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new c.Qt("gotoUrlIssue",q,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[C,M,I,W,R,Q,Ce]),z=a.useMemo(()=>{let j=null;return j=Q?Q.createChildGroup(q,"standaloneWorkbook",!1):new c.He(q,"standaloneWorkbook"),j.addCommands(ne,!0),j},[Q,ne]);c.So({manager:Ce,commands:z,notifier:I});const{themeMode:he}=c.useResolvedThemeMode();a.useEffect(()=>{if(!R||!z)return;const j=R.forceMode==="dark"||!R.forceMode&&he==="dark";z.getCommand("themeMode").update({state:R.forceMode??null,label:j?"Dark Mode":"Light Mode",scopedLabels:{appearance:j?"Dark Mode":"Light Mode"}}).updateCallback(()=>{Se(j?c.ThemeMode.Light:c.ThemeMode.Dark)}),z.getCommand("defaultThemeMode").update({state:!R.forceMode}).updateCallback(()=>{Se(null)}),z.getCommand("forceLightGrid").update({state:R.forceLightGrid}).updateCallback(()=>{Ie(!R.forceLightGrid)}),z.getCommand("forceLightImages").update({state:R.forceLightImages}).updateCallback(()=>{ce(!R.forceLightImages)})},[he,R,ne]);const{showModal:Ne}=c.E5();return a.useEffect(()=>{const j=()=>new Promise((K,f)=>{const x=a.lazy(()=>Promise.resolve().then(()=>require("./CFMdCpzsOvXxkNao.cjs"))),P=Ne(x,{title:"Shortcut Keys Reference",commands:z,onDone:()=>{P.hide()},TransitionProps:{onExited:()=>{K(!0)}}})});z.getCommand("showKeyboardShortcuts").updateCallback(()=>j()),z.getCommand("help").updateCallback(()=>j())},[ne,z]),z})({workbook:r,setWorkbook:e,importExportDisabled:m,workbookTitle:o,setWorkbookTitle:s,commands:p,requestWorkbookTitle:O=>new Promise(C=>{n.current?n.current.requestWorkbookTitle((S,W)=>{C(S)},{selectAll:!0,requestReason:O}):C(d)}),themeModeOptions:g,undoManager:u,notifier:_,onExecute:U});a.useEffect(()=>{E.starting.size<=0||!E.isMounted||b(O=>{const C=new Map(O.running);return O.starting.forEach((S,W)=>{const M=()=>{b(N=>{const I=new Map(N.running);return I.delete(W),{...N,running:I}})};C.set(W,M),S(M)}),{...O,starting:new Map,running:C}})},[E]);const[G,ae]=a.useState(null);a.useEffect(()=>{E.starting.size!==0||E.running.size!==0?ae(h.jsx(c.jt$1,{icon:h.jsx(c.Ka,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:E.label,onMount:k,onUnmount:D,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):ae(null)},[E.starting,E.running]);const F=a.useMemo(()=>h.jsx(c.HelpCommandButton,{commands:V,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[V]),se={notifier:_,commands:V};return r&&(se.statusBarProps={childrenEnd:F}),h.jsxs(h.Fragment,{children:[G,l?a.cloneElement(l,se):null]})}));Mt.displayName="SnackbarAndCommandsWrapper";const jt=a.memo(a.forwardRef((t,i)=>{const{className:r,sx:e,style:n,onElementLoad:o,onError:s,undoManager:d,errorPanel:l=c.Yt$1,onKeyDown:u,workbook:p,createWorkbookOptions:m,onWorkbookChange:g,logo:w,importExportDisabled:v=!1,themeModeOptions:y,autoFocus:E=!1,commands:b,title:k,onTitleChange:D,titleProps:T,...Z}=t,A=a.useRef(null),B=c.T(g,[g]),_=c.T(D??T?.onTitleChange,[D??T?.onTitleChange]),U=T?.placeHolder??"Untitled",V=y?.forceMode,{themeMode:G,source:ae}=c.useResolvedThemeMode({mode:V}),F=a.useMemo(()=>({...y,light:c.tl(!1,oe.CommonUtils.deepMerge(y?.theme??{},y?.light??{})),dark:c.tl(!0,oe.CommonUtils.deepMerge(y?.theme??{},y?.dark??{}))}),[y]),se=G===c.ThemeMode.Dark,[O,C]=a.useState(null);a.useEffect(()=>{C(d??new oe.UndoManager)},[d]);const[S,W]=a.useState(null),[M,N]=a.useState(null),I=c.Rd();a.useLayoutEffect(()=>{if(!p||Object.keys(p).length===0&&!oe.CommonUtils.isPromiseLike(p)){const f={theme:I.getDefaultTheme(),...m};N(new oe.Workbook(f))}else N(p)},[p]),a.useLayoutEffect(()=>{if(M){if(M instanceof oe.Workbook)return W({workbook:M}),void(p!==M&&B?.(M));(async()=>{try{let f,x=await Promise.resolve(M);x&&x.source&&(x=await c.WorkbookIO.read(x)),x.workbook?(le(x.title),f=x.workbook):f=x,B?.(f),W({workbook:f})}catch(f){B?.(null),W({error:f})}})()}},[M]);const[X,R]=a.useState(null);a.useEffect(()=>{if(!O||!S)return;O.clear();const f=S?.workbook?.getTransactions();if(f)return f.addListener({onCommitEnd:x=>{x.getDescription()?O.addUndoOperation({description:x.getDescription(),undo:()=>(f.revert(x.getId()),X.source?.focus(),()=>{f.restore(x.getId()),X.source?.focus()})}):console.warn("commit has no description",x)}})},[O,S,X]);const Ce=c.T(f=>{f?O.setRepeatableOperation({description:f.label(),repeat:async()=>f.execute()}):O.setRepeatableOperation(null)},[O]),[Q,le]=a.useState(k??T?.title??"");a.useEffect(()=>{le(k??T?.title??"")},[k??T?.title]),a.useEffect(()=>{_?.(Q)},[Q]);const[Se,Ie]=a.useState(null),ce=a.useMemo(()=>{const f=()=>({contains:x=>!0,focus(){}});return b?b.createChildGroup(f,"application",!1):new c.He(f,"application")},[b]),qe=c.T(f=>{Ie(f.source.getViewportElement()),R(f),ce.activate("sheet"),o?.(f)},[ce]);a.useEffect(()=>{X&&E&&X.source?.focus(typeof E=="object"?E:void 0)},[X]);const fe=a.useRef(null),q=a.useCallback(f=>{let x=null;return T?.hidden||(x=h.jsx(c.WorkbookTitle,{...T,style:{maxWidth:"100%",...T?.style},workbook:A.current,ref:fe,title:Q,placeHolder:U,onTitleChange:P=>{le(P)}})),h.jsx(Lt,{...f,logo:w,mainElement:x,showFileMenu:!v,showAppearanceMenu:!!(F?.onForceLightGridChange||F?.onForceLightImagesChange||F?.onForceModeChange)})},[w,Q,T,F,v,ce]);a.useEffect(()=>{const f=x=>x.preventDefault();return A.current?.addEventListener("wheel",f,{passive:!1}),()=>{A.current?.removeEventListener("wheel",f)}},[]);const ne=a.useMemo(()=>h.jsx(c.jt$1,{transparentBackground:!0,sx:e,style:n}),[e,n]),z=a.useCallback(({error:f})=>(s?.(f),h.jsx(l,{sx:e,style:n,error:f??"Unable to display empty workbook."})),[e,n,s]),he=a.useMemo(()=>({...e,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-MuiContent *":{fontFamily:f=>f.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[e]),Ne=c.mergeRefs([A,i]),j=a.useMemo(()=>{if(!S)return ne;if(S.error||!S.workbook)return z({error:S.error});let f=null,x=null,P=!1;return F&&(f=se?F.dark:F.light,x=se&&!F.forceLightGrid?F.dark:F.light,P=F.forceLightImages),h.jsx(c.WorkbookElement,{sx:he,style:n,tabIndex:0,autoFocus:!0,workbook:S.workbook,ref:Ne,renderToolbar:q,onElementLoad:qe,onRepeatCommandChange:Ce,onKeyDown:$=>{u?.($)},gridTheme:x,headersTheme:f,forceLightImages:P,className:c.clsx(r,"sheetxl-workbook"),onContextMenu:$=>$.preventDefault(),...Z},"WorkbookElement")},[S,Q,O,ne,F,Z,q,he]);let K=h.jsx(Wt,{fallbackRender:z,children:h.jsx(an,{maxSnack:3,domRoot:Se,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(f,x,P)=>{A.current?.focus()},Components:{error:St},iconVariant:{success:h.jsx(H.SvgIcon,{style:{marginRight:"8px"},children:h.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})}),error:h.jsx(c.la,{style:{marginRight:"8px"}})},children:h.jsx(c.il,{children:h.jsx(Mt,{workbook:S?.workbook,setWorkbook:N,importExportDisabled:v,titlePlaceHolder:U,titleWorkbook:Q,setWorkbookTitle:le,refWorkbookTitle:fe,commands:ce,undoManager:O,themeModeOptions:F,children:j})})})});return F&&(K=h.jsxs(c.ThemeProvider,{theme:se?F.dark:F.light,children:[F.cssBaseline?h.jsx(H.CssBaseline,{}):null,K]})),K}));jt.displayName="EagerStandaloneWorkbook";const ln=Object.freeze(Object.defineProperty({__proto__:null,default:jt},Symbol.toStringTag,{value:"Module"}));exports.EagerStandaloneWorkbook=ln,exports.clsx=te;
|
|
12
|
+
`))),ge},[le,I,C]),fe=c.T(async(j,K,f)=>{if(!K&&X){const x=await X("Enter Workbook name to "+(f.isDefault?"Save.":`Export as ${f.description}.`));return x!==null&&c.WorkbookIO.writeFile(x,j,{formatType:f.key})}return c.WorkbookIO.writeFile(K,j,{formatType:f.key})},[I,C,X]),q=a.useCallback(()=>({contains:j=>!0,focus(){}}),[]),ne=a.useMemo(()=>{const j=[];W||(c.WorkbookIO.getWriteFormats().forEach(f=>{const x=f.isDefault,P={label:x?"Save Workbook":`Save Workbook as ${f.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${f.description}`},tags:f.tags,description:`Save the workbook to the desktop${x?"":` as ${f.description}`}.`};x&&(P.shortcut={key:"S",modifiers:[c.Z.Ctrl]},j.push(new c.Qt("saveWorkbookAs",q,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[c.Z.Shift,c.Z.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{fe(C,null,f).catch(ee=>{I?.showError?.(ee)})})));const $=x?"saveWorkbook":`saveWorkbookAs${f.key}`;j.push(new c.Qt($,q,P,ee=>{fe(C,ee??M,f).catch(ge=>{I?.showError?.(ge)})}))}),j.push(new c.Qt("openWorkbook",q,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[c.Z.Ctrl]}},async(f=null)=>{const x={date1904:C.isDate1904(),...C.options};try{const P=await qe(f,x);if(!P)return;const $=P.title,ee=P.workbook,ge=ee.getSelectedSheet();if(P.formatType.mimeType==="text/csv"){const Ae=C.findValidSheetName($);await C.doBatch(async()=>{const Ye=ge.getUsedRange();if(!Ye)return void I?.showMessage("The file appears to be blank.");await C.getSheets().add({name:Ae,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(Ye)},`Import CSV '${$}'`)}else C?.close(),N?.($),S(ee)}catch(P){I?.showError?.(P)}})),j.push(new c.Qt("openWorkbookFromUrl",q,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(f){if(!f){const x=await I?.showInputOptions?.({title:"Open Workbook from the Web",description:"Enter the web address for the workbook to open.",inputLabel:"Address",initialValue:"https://www.sheetxl.com/examples/features-checklist.xlsx",inputProps:{style:{minWidth:"440px"}},options:["Open"]});if(x.option!=="Open")return;f=x.input}f&&console.log("openWorkbookFromUrl",f)})));let K=[];return R&&(K=[new c.Qt("themeMode",q,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new c.Qt("defaultThemeMode",q,{label:"Use System Light/Dark Mode",scopedLabels:{appearance:"Use System Default"},description:"Use the system settings to determine styling for light and dark mode."}),new c.Qt("forceLightGrid",q,{label:"Force Light Grid",description:"Force the grid to always render in light mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)."}),new c.Qt("forceLightImages",q,{label:"Force Light Images",description:"Force the images to always render in light mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode."})]),[...j,...K,new c.jt("help",q,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new c.jt("showKeyboardShortcuts",q,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[c.Z.Ctrl]}},()=>{}),new c.Qt("gotoUrlGithub",q,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new c.Qt("gotoUrlDiscord",q,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new c.Qt("gotoUrlDocumentation",q,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new c.Qt("gotoUrlIssue",q,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[C,M,I,W,R,Q,Ce]),z=a.useMemo(()=>{let j=null;return j=Q?Q.createChildGroup(q,"standaloneWorkbook",!1):new c.He(q,"standaloneWorkbook"),j.addCommands(ne,!0),j},[Q,ne]);c.So({manager:Ce,commands:z,notifier:I});const{themeMode:he}=c.useResolvedThemeMode();a.useEffect(()=>{if(!R||!z)return;const j=R.forceMode==="dark"||!R.forceMode&&he==="dark";z.getCommand("themeMode").update({state:R.forceMode??null,label:j?"Dark Mode":"Light Mode",scopedLabels:{appearance:j?"Dark Mode":"Light Mode"}}).updateCallback(()=>{Se(j?c.ThemeMode.Light:c.ThemeMode.Dark)}),z.getCommand("defaultThemeMode").update({state:!R.forceMode}).updateCallback(()=>{Se(null)}),z.getCommand("forceLightGrid").update({state:R.forceLightGrid}).updateCallback(()=>{Ie(!R.forceLightGrid)}),z.getCommand("forceLightImages").update({state:R.forceLightImages}).updateCallback(()=>{ce(!R.forceLightImages)})},[he,R,ne]);const{showModal:Ne}=c.E5();return a.useEffect(()=>{const j=()=>new Promise((K,f)=>{const x=a.lazy(()=>Promise.resolve().then(()=>require("./D2yTwMR0RspEdMM2.cjs"))),P=Ne(x,{title:"Shortcut Keys Reference",commands:z,onDone:()=>{P.hide()},TransitionProps:{onExited:()=>{K(!0)}}})});z.getCommand("showKeyboardShortcuts").updateCallback(()=>j()),z.getCommand("help").updateCallback(()=>j())},[ne,z]),z})({workbook:r,setWorkbook:e,importExportDisabled:m,workbookTitle:o,setWorkbookTitle:s,commands:p,requestWorkbookTitle:O=>new Promise(C=>{n.current?n.current.requestWorkbookTitle((S,W)=>{C(S)},{selectAll:!0,requestReason:O}):C(d)}),themeModeOptions:g,undoManager:u,notifier:_,onExecute:U});a.useEffect(()=>{E.starting.size<=0||!E.isMounted||b(O=>{const C=new Map(O.running);return O.starting.forEach((S,W)=>{const M=()=>{b(N=>{const I=new Map(N.running);return I.delete(W),{...N,running:I}})};C.set(W,M),S(M)}),{...O,starting:new Map,running:C}})},[E]);const[G,ae]=a.useState(null);a.useEffect(()=>{E.starting.size!==0||E.running.size!==0?ae(h.jsx(c.jt$1,{icon:h.jsx(c.Ka,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:E.label,onMount:k,onUnmount:D,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):ae(null)},[E.starting,E.running]);const F=a.useMemo(()=>h.jsx(c.HelpCommandButton,{commands:V,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[V]),se={notifier:_,commands:V};return r&&(se.statusBarProps={childrenEnd:F}),h.jsxs(h.Fragment,{children:[G,l?a.cloneElement(l,se):null]})}));Mt.displayName="SnackbarAndCommandsWrapper";const jt=a.memo(a.forwardRef((t,i)=>{const{className:r,sx:e,style:n,onElementLoad:o,onError:s,undoManager:d,errorPanel:l=c.Yt$1,onKeyDown:u,workbook:p,createWorkbookOptions:m,onWorkbookChange:g,logo:w,importExportDisabled:v=!1,themeModeOptions:y,autoFocus:E=!1,commands:b,title:k,onTitleChange:D,titleProps:T,...Z}=t,A=a.useRef(null),B=c.T(g,[g]),_=c.T(D??T?.onTitleChange,[D??T?.onTitleChange]),U=T?.placeHolder??"Untitled",V=y?.forceMode,{themeMode:G,source:ae}=c.useResolvedThemeMode({mode:V}),F=a.useMemo(()=>({...y,light:c.tl(!1,oe.CommonUtils.deepMerge(y?.theme??{},y?.light??{})),dark:c.tl(!0,oe.CommonUtils.deepMerge(y?.theme??{},y?.dark??{}))}),[y]),se=G===c.ThemeMode.Dark,[O,C]=a.useState(null);a.useEffect(()=>{C(d??new oe.UndoManager)},[d]);const[S,W]=a.useState(null),[M,N]=a.useState(null),I=c.Rd();a.useLayoutEffect(()=>{if(!p||Object.keys(p).length===0&&!oe.CommonUtils.isPromiseLike(p)){const f={theme:I.getDefaultTheme(),...m};N(new oe.Workbook(f))}else N(p)},[p]),a.useLayoutEffect(()=>{if(M){if(M instanceof oe.Workbook)return W({workbook:M}),void(p!==M&&B?.(M));(async()=>{try{let f,x=await Promise.resolve(M);x&&x.source&&(x=await c.WorkbookIO.read(x)),x.workbook?(le(x.title),f=x.workbook):f=x,B?.(f),W({workbook:f})}catch(f){B?.(null),W({error:f})}})()}},[M]);const[X,R]=a.useState(null);a.useEffect(()=>{if(!O||!S)return;O.clear();const f=S?.workbook?.getTransactions();if(f)return f.addListener({onCommitEnd:x=>{x.getDescription()?O.addUndoOperation({description:x.getDescription(),undo:()=>(f.revert(x.getId()),X.source?.focus(),()=>{f.restore(x.getId()),X.source?.focus()})}):console.warn("commit has no description",x)}})},[O,S,X]);const Ce=c.T(f=>{f?O.setRepeatableOperation({description:f.label(),repeat:async()=>f.execute()}):O.setRepeatableOperation(null)},[O]),[Q,le]=a.useState(k??T?.title??"");a.useEffect(()=>{le(k??T?.title??"")},[k??T?.title]),a.useEffect(()=>{_?.(Q)},[Q]);const[Se,Ie]=a.useState(null),ce=a.useMemo(()=>{const f=()=>({contains:x=>!0,focus(){}});return b?b.createChildGroup(f,"application",!1):new c.He(f,"application")},[b]),qe=c.T(f=>{Ie(f.source.getViewportElement()),R(f),ce.activate("sheet"),o?.(f)},[ce]);a.useEffect(()=>{X&&E&&X.source?.focus(typeof E=="object"?E:void 0)},[X]);const fe=a.useRef(null),q=a.useCallback(f=>{let x=null;return T?.hidden||(x=h.jsx(c.WorkbookTitle,{...T,style:{maxWidth:"100%",...T?.style},workbook:A.current,ref:fe,title:Q,placeHolder:U,onTitleChange:P=>{le(P)}})),h.jsx(Lt,{...f,logo:w,mainElement:x,showFileMenu:!v,showAppearanceMenu:!!(F?.onForceLightGridChange||F?.onForceLightImagesChange||F?.onForceModeChange)})},[w,Q,T,F,v,ce]);a.useEffect(()=>{const f=x=>x.preventDefault();return A.current?.addEventListener("wheel",f,{passive:!1}),()=>{A.current?.removeEventListener("wheel",f)}},[]);const ne=a.useMemo(()=>h.jsx(c.jt$1,{transparentBackground:!0,sx:e,style:n}),[e,n]),z=a.useCallback(({error:f})=>(s?.(f),h.jsx(l,{sx:e,style:n,error:f??"Unable to display empty workbook."})),[e,n,s]),he=a.useMemo(()=>({...e,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-MuiContent *":{fontFamily:f=>f.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[e]),Ne=c.mergeRefs([A,i]),j=a.useMemo(()=>{if(!S)return ne;if(S.error||!S.workbook)return z({error:S.error});let f=null,x=null,P=!1;return F&&(f=se?F.dark:F.light,x=se&&!F.forceLightGrid?F.dark:F.light,P=F.forceLightImages),h.jsx(c.WorkbookElement,{sx:he,style:n,tabIndex:0,autoFocus:!0,workbook:S.workbook,ref:Ne,renderToolbar:q,onElementLoad:qe,onRepeatCommandChange:Ce,onKeyDown:$=>{u?.($)},gridTheme:x,headersTheme:f,forceLightImages:P,className:c.clsx(r,"sheetxl-workbook"),onContextMenu:$=>$.preventDefault(),...Z},"WorkbookElement")},[S,Q,O,ne,F,Z,q,he]);let K=h.jsx(Wt,{fallbackRender:z,children:h.jsx(an,{maxSnack:3,domRoot:Se,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(f,x,P)=>{A.current?.focus()},Components:{error:St},iconVariant:{success:h.jsx(H.SvgIcon,{style:{marginRight:"8px"},children:h.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})}),error:h.jsx(c.la,{style:{marginRight:"8px"}})},children:h.jsx(c.il,{children:h.jsx(Mt,{workbook:S?.workbook,setWorkbook:N,importExportDisabled:v,titlePlaceHolder:U,titleWorkbook:Q,setWorkbookTitle:le,refWorkbookTitle:fe,commands:ce,undoManager:O,themeModeOptions:F,children:j})})})});return F&&(K=h.jsxs(c.ThemeProvider,{theme:se?F.dark:F.light,children:[F.cssBaseline?h.jsx(H.CssBaseline,{}):null,K]})),K}));jt.displayName="EagerStandaloneWorkbook";const ln=Object.freeze(Object.defineProperty({__proto__:null,default:jt},Symbol.toStringTag,{value:"Module"}));exports.EagerStandaloneWorkbook=ln,exports.clsx=te;
|