@sheetxl/studio-mui 0.7.15 → 0.7.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.
Files changed (38) hide show
  1. package/browser/cjs/{BrHqwHQYxx_QoXOn.cjs → B4g0GjoE6uIK7JP6.cjs} +2 -2
  2. package/browser/cjs/{BIVHB4D4Gd1WeeLi.cjs → Bc4L7-Qr9mrX7hf-.cjs} +3 -3
  3. package/browser/cjs/{ivFORJI1ljTPQpJ2.cjs → Bp_Q6Q1JP7PLdn-j.cjs} +1 -1
  4. package/browser/cjs/{BaYmI4hURso6vppd.cjs → CLxLccZWksQgSIfb.cjs} +2 -2
  5. package/browser/cjs/{Caqz5dZzQdiFjnRX.cjs → Cc0PDDVn8CB6mX-c.cjs} +2 -2
  6. package/browser/cjs/{BbIg9meUh8UPbj5t.cjs → D86M0fc5XpkQp4gk.cjs} +3 -3
  7. package/browser/cjs/{tvv7jDqgAa8czbFA.cjs → DDySzbOrTePwHwyS.cjs} +1 -1
  8. package/browser/cjs/{DzrSXv2CLKkFc2iG.cjs → DU-OFxkWz_AT01_1.cjs} +2 -2
  9. package/browser/cjs/{byyZab6_Rq6ZwIYg.cjs → Dwamt-p0XVNIeEAM.cjs} +1 -1
  10. package/browser/cjs/{NsGloilMLNL8CAF_.cjs → EG3LGz7SrtC5w5XW.cjs} +1 -1
  11. package/browser/cjs/{awYqXNcQZFnOqrrv.cjs → UzMSUQjwLPa1rDpq.cjs} +1 -1
  12. package/browser/cjs/index.cjs +2 -2
  13. package/browser/cjs/{DGqqkGBv1nc0eMrE.cjs → vnUEXASpUv_-qQiU.cjs} +1 -1
  14. package/browser/esm/{CM0ti_Ro-ofiPiXw.mjs → BAdJwAU8SuPZ7FrN.mjs} +1 -1
  15. package/browser/esm/{DduI_lE9r-_xxx2i.mjs → BLeld8z05x61T2qL.mjs} +2 -2
  16. package/browser/esm/{DDCEwJwqSNFJukUi.mjs → Bd2P_uVYuMxp-1j_.mjs} +1 -1
  17. package/browser/esm/{DA9w10YtGRm1py3s.mjs → BwxqzKtkNiYyZcdy.mjs} +1 -1
  18. package/browser/esm/{BZduiiKwWAowYSJN.mjs → CLCBBZG_5S3teJrH.mjs} +2 -2
  19. package/browser/esm/{ZdlfLFFcDkayt99n.mjs → CpGMNx_0kS1OzP9s.mjs} +1 -1
  20. package/browser/esm/{C5hFZQeTMy4agdCE.mjs → CqtLawUW8V21gwzu.mjs} +2 -2
  21. package/browser/esm/{BPgEvjsqtBt1B2oO.mjs → DBalbXg6qCmkXeEF.mjs} +3 -3
  22. package/browser/esm/{CDCURsqip4PNsKB-.mjs → DIl_WDqHQZFMMmhw.mjs} +2 -2
  23. package/browser/esm/{B9PEZFokQCC6zWwX.mjs → DXGXrNlkgS_o6inh.mjs} +4 -4
  24. package/browser/esm/{5qhzMLdi7OBuLx6W.mjs → Dwcmic9nRpO5U0hB.mjs} +1 -1
  25. package/browser/esm/{DC4JZaW8S6fOywMr.mjs → JBRpZwaRLPhvgrsJ.mjs} +1 -1
  26. package/browser/esm/index.mjs +2 -2
  27. package/node/esm/{C0dHRankOSZU4PNG.mjs → 3exh7GXawSx9oKrL.mjs} +1 -1
  28. package/node/esm/{N3PqbkXORQ3Qfzls.mjs → 8CrVP1lyWUA4_AMS.mjs} +1 -1
  29. package/node/esm/{DL58IAMOmJKHu2ka.mjs → B39xbyK17-A3Vu9v.mjs} +1 -1
  30. package/node/esm/{D9ZBRNgjCgvdTHiX.mjs → C5GvIpYv4OTcYYon.mjs} +1 -1
  31. package/node/esm/{ByMXScn3ChpsqcAb.mjs → DVjcSv3wizGrc9od.mjs} +1 -1
  32. package/node/esm/{DhGAUFPxQRjIn4QH.mjs → DcqscFmt18Bfovt3.mjs} +1 -1
  33. package/node/esm/{By_L4EWHTADEr1Le.mjs → DggVyg0G8aWEPSES.mjs} +1 -1
  34. package/node/esm/{DCsofbikio_bDbqi.mjs → Dnpj8yRHCvG70LhS.mjs} +1 -1
  35. package/node/esm/{BXf4P001RgMA5mab.mjs → fzJrH1RlAEOrcfaW.mjs} +1 -1
  36. package/node/esm/index.mjs +4 -4
  37. package/node/esm/{BqynBoGwxZpdEh30.mjs → j4Mywki8bVROW07t.mjs} +1 -1
  38. package/package.json +8 -8
@@ -1,9 +1,9 @@
1
1
  "use strict";var Di=Object.create;var Bn=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var Ii=Object.getOwnPropertyNames;var Ni=Object.getPrototypeOf,Oi=Object.prototype.hasOwnProperty;var Ai=(a,i,o,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ii(i))!Oi.call(a,r)&&r!==o&&Bn(a,r,{get:()=>i[r],enumerable:!(t=Fi(i,r))||t.enumerable});return a};var Rn=(a,i,o)=>(o=a!=null?Di(Ni(a)):{},Ai(i||!a||!a.__esModule?Bn(o,"default",{value:a,enumerable:!0}):o,a));/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.15
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.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 A=require("@sheetxl/sdk"),oe=require("@sheetxl/react"),e=require("react/jsx-runtime"),n=require("react"),B=require("@mui/material"),y=require("@sheetxl/utils-mui"),w=require("@sheetxl/utils-react"),q=require("@mui/material/styles"),Re=require("@mui/system"),et=require("react-dom"),je=require("@sheetxl/utils"),dt=require("@sheetxl/io");function ka(a){var i,o,t="";if(typeof a=="string"||typeof a=="number")t+=a;else if(typeof a=="object")if(Array.isArray(a)){var r=a.length;for(i=0;i<r;i++)a[i]&&(o=ka(a[i]))&&(t&&(t+=" "),t+=o)}else for(o in a)a[o]&&(t&&(t+=" "),t+=o);return t}function ie(){for(var a,i,o=0,t="",r=arguments.length;o<r;o++)(a=arguments[o])&&(i=ka(a))&&(t&&(t+=" "),t+=i);return t}const va=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...p}=a,l=w.useCommands(o,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),c=n.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f];return l[0]},[l]),g=n.useMemo(()=>{if(!t)return null;const f={...t};return delete f.beforeExecute,f},[t]),C=n.useCallback((f,u)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},b=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignLeftToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignCenterToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignRightToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignJustifyToggle")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignCenterContinuousToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignFillToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignDistributedHorizontalToggle")})]}),S=e.jsxs(B.Box,{sx:{className:ie("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:h=>h.stopPropagation(),children:[e.jsx(y.CommandButton,{command:u.getCommand("formatIndentDecrease"),commandHook:g,scope:r,disabled:s}),e.jsx(y.CommandButton,{command:u.getCommand("formatIndentIncrease"),commandHook:g,scope:r,disabled:s})]}),x=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[S,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})]});return y.defaultCreatePopupPanel({...f,children:x})},[s,t]);return e.jsx(y.CommandPopupButton,{ref:i,parentFloat:d,commands:o,commandHook:t,scope:r,createPopupPanel:C,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:c?.key(),icon:c?.icon()??"FormatAlignLeft",...p})})),ja=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),{activeCommand:l,allDisabled:c}=n.useMemo(()=>{const C=p.length;let f,u=0;for(let m=0;m<C;m++){const b=p[m];b&&!b.disabled()&&(!f&&b?.state()&&(f=b),u++)}return f=f??p[0],{activeCommand:f,allDisabled:u===0}},[p]),g=n.useCallback((C,f)=>{const u={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},m=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignTopToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignMiddleToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignBottomToggle")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignJustifyVerticalToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignDistributedVerticalToggle")})]});return y.defaultCreatePopupPanel({...C,children:m})},[s,t]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,createPopupPanel:g,disabled:s||c,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:l?.icon()??"TextVerticalBottom",...d})})),Ta=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),{activeCommand:l,allDisabled:c}=n.useMemo(()=>{const C=p.length;let f,u=0;for(let m=0;m<C;m++){const b=p[m];b&&!b.disabled()&&(!f&&b?.state()&&(f=b),u++)}return f=f??p[0],{activeCommand:f,allDisabled:u===0}},[p]),g=w.useCallbackRef((C,f)=>{const u={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},m=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextOverflowVisibleToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextOverflowWrapToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextOverflowClipToggle")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextOverflowShrinkToggle")})]});return y.defaultCreatePopupPanel({...C,children:m})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,disabled:s||c,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:g,icon:l?.icon()??"TextHorizontalOverflow",...d})})),Ea=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),l=n.useMemo(()=>{const C=p.length;for(let f=0;f<C;f++){const u=p[f];if(u?.state())return u}return p[1]},[p]),c=n.useCallback((C,f)=>{const u={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},m=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate0")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate315")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate45")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate90")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate270")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.InputCommandButton,{...u,command:f.getCommand("formatTextRotateCustom"),label:"Custom"})]});return y.defaultCreatePopupPanel({...C,children:m})},[s,t,r,o]),g=n.useMemo(()=>(o.getCommand("formatTextRotateCustom")?.state()??0)!==0,[p]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,selected:g,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:c,quickCommand:g?"formatTextRotate0":"formatTextRotate315",icon:l?.icon()??"TextRotation315",...d})})),Ba={Preset:"preset",Custom:"custom"},pt={Start:"start",End:"end"},xo={},Li=(a,i,o,t)=>{const r=a+"-"+i+"-"+o+(t?"-server":"");if(xo[r])return xo[r];const s=((d,p,l,c)=>{if(typeof document>"u"&&!c)return null;const g=c?new c:document.createElement("canvas");g.width=2*l,g.height=2*l;const C=g.getContext("2d");return C?(C.fillStyle=d,C.fillRect(0,0,g.width,g.height),C.fillStyle=p,C.fillRect(0,0,l,l),C.translate(l,l),C.fillRect(0,0,l,l),g.toDataURL()):null})(a,i,o,t);return xo[r]=s,s},zi={},Ra=n.memo(a=>{const{className:i,style:o=w.ReactUtils.EmptyCssProperties,white:t="transparent",grey:r="grey",size:s=8,borderRadius:d,boxShadow:p,renderers:l=zi,children:c,...g}=a,C=c,f=n.useMemo(()=>Object.assign({borderRadius:d,boxShadow:p,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${Li(t,r,s,l?.canvas)}) center left`},o),[t,r,s,l]);return n.isValidElement(c)?n.cloneElement(c,{...C.props}):e.jsx("div",{style:f,...g})}),Hi=n.memo(a=>{const{selectedColor:i,onSelectColor:o,onPreviewColor:t,onClick:r,onKeyDown:s,onMouseOver:d,onMouseLeave:p,onFocus:l,style:c=w.ReactUtils.EmptyCssProperties,children:g,alphaWhite:C,alphaGrey:f,darkMode:u,alphaCheckSize:m=7,...b}=a;if(!i)throw new Error("a selectedColor is required");const S=n.useCallback(T=>{r?.(T),T.isDefaultPrevented()||(T.ctrlKey?t?.(i.toRGBA()):o?.(i.toRGBA()))},[o,t,r,i]),x=n.useCallback(T=>{d?.(T),T.isDefaultPrevented()||t?.(i.toRGBA())},[t,d,i]),h=n.useCallback(T=>{p?.(T),T.isDefaultPrevented()},[t,p]),k=n.useCallback(T=>{l?.(T),T.isDefaultPrevented()||t?.(i.toRGBA())},[t,l,i]),j=n.useCallback(T=>{s?.(T),T.isDefaultPrevented()||T.keyCode===w.KeyCodes.Enter&&o?.(i.toRGBA())},[o,s,i]),v=n.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Ra,{size:m,white:C,grey:f,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[C,f,i]);return e.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...c},tabIndex:0,...b,onClick:S,onKeyDown:j,onMouseOver:x,onMouseLeave:h,onFocus:k,children:[v,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(u)},children:g})]})}),io=n.memo(a=>{const{schemeColorLookup:i,selectedColor:o,previewColor:t,colorDef:r,onSelectColorDef:s,onPreviewColorDef:d,swatchProps:p,defaultButtonSize:l=24,isLarge:c=!1,compareRGB:g=!1,darkMode:C=!1,...f}=a,u=new A.Color({val:r.definition.val,adjs:r.definition.adjs},v=>i(v)),m=g?u.toRGBA().toString():u.toString(),b=o&&(g?o.toRGBA().toString():o.toString())===m,S=t&&(g?t.toRGBA().toString():t.toString())===m,x=[];x.push({[A.IColor.AdjustmentType.Inv]:!0}),x.push({[A.IColor.AdjustmentType.Alpha]:100});const h=u.adjust(x),k=n.useCallback(()=>{s?.(r)},[s,r]),j=n.useCallback(v=>{d?.(v?r:null)},[d,r]);return e.jsx(y.SimpleTooltip,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:r.description,placement:"bottom-start",children:e.jsx("div",{style:{width:l*(c?1.2:1)+"px",height:l*(c?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...f,children:e.jsxs(Hi,{selectedColor:u,title:null,onSelectColor:k,onPreviewColor:j,alphaCheckSize:c?9:void 0,darkMode:C,...p,children:[e.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:h.toRGBA(C).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:b?"1":"0"}}),e.jsx("div",{style:{position:"absolute",width:.33*l*(c?1.2:1)+"px",height:.33*l*(c?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:h.toRGBA(C).toString(),borderRadius:"50%",opacity:S?"1":"0"}})]})})})}),Dt=n.memo(a=>{const{title:i,schemeColorLookup:o,colorDefs:t,selectedColor:r,previewColor:s,onSelectColorDef:d,onPreviewColorDef:p,style:l=w.ReactUtils.EmptyCssProperties,compareRGB:c=!1,darkMode:g,swatchProps:C,...f}=a;let u;if(Array.isArray(t[0]))u=t;else{u=[];for(let h=0;h<t.length;h++)u.push([t[h]])}const m=n.useCallback(h=>{d?.(h)},[d]),b=n.useCallback(h=>{p?.(h)},[p]),S=n.useMemo(()=>{let h=[];for(let k=0;k<u.length;k++){let j=[],v=u[k];for(let M=0;M<v.length;M++){let P=v[M];j.push(e.jsx(io,{schemeColorLookup:o,colorDef:P,selectedColor:r,previewColor:s,onSelectColorDef:m,onPreviewColorDef:b,swatchProps:C,compareRGB:c,darkMode:g},k+" "+M))}let T=e.jsx(B.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:M=>M.shadows[2],borderRadius:"2px",overflow:"hidden"},children:j},""+k);h.push(T)}return h},[u,r,s,m,b]),x=n.useMemo(()=>i?e.jsx(B.Typography,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:h=>h.palette.text.secondary},children:i}):null,[i]);return e.jsxs(B.Box,{style:{...l},children:[x,e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...f,children:S})]})}),De=(a,i)=>({description:a,definition:{val:i,adjs:[]}}),ge=(a,i,o,t,r,s)=>{const d=De(a,i);t?.push(d);const p=new A.Color({val:d.definition.val,adjs:d.definition.adjs},o),l=p.toString();r?.set(l,p);const c=p.toRGBA().toString();s?.set(c,p)},Wi=n.lazy(()=>Promise.resolve().then(()=>require("./BrHqwHQYxx_QoXOn.cjs"))),Pa=n.memo(n.forwardRef((a,i)=>{const{selectedColor:o=null,previewColor:t=a.selectedColor??null,recentColors:r,schemeLookup:s,disableAlpha:d=!1,previewDebounceTime:p=100,initialPanelType:l,defaultButtonSize:c=24,width:g,onElementLoad:C,onDone:f,onEyeDropStart:u,onEyeDropStop:m,onPreviewColor:b,onPreviewColorImmediate:S,onSelectColor:x,autoColor:h,autoColorLabel:k="Automatic",autoColorPosition:j=pt.Start,compareRGB:v=!1,darkMode:T=!1,...M}=a,P=t||o,D=w.useCallbackRef(b,[b]),F=w.useCallbackRef(S,[S]),E=w.useCallbackRef(x,[x]),R=w.useCallbackRef(u,[u]),N=w.useCallbackRef(m,[m]),[z,O]=n.useState(!1),H=q.useTheme(),I=n.useMemo(()=>s||A.Color.getDefaultSchemeLookup(),[s]),W=n.useMemo(()=>{const K=new Map,te=new Map,de=[];ge("Primary Background","bg1",I,de,K,te),ge("Primary Text","tx1",I,de,K,te),ge("Secondary Background","bg2",I,de,K,te),ge("Secondary Text","tx2",I,de,K,te),ge("Accent 1","accent1",I,de,K,te),ge("Accent 2","accent2",I,de,K,te),ge("Accent 3","accent3",I,de,K,te),ge("Accent 4","accent4",I,de,K,te),ge("Accent 5","accent5",I,de,K,te),ge("Accent 6","accent6",I,de,K,te);const ve=A.ITheme.buildPalette(de,I,K,te),se=[];if(ge("Dark Red","C00000",I,se,K,te),ge("Red","FF0000",I,se,K,te),ge("Orange","FFC000",I,se,K,te),ge("Yellow","FFFF00",I,se,K,te),ge("Light Green","92D050",I,se,K,te),ge("Green","00B050",I,se,K,te),ge("Light Blue","00B0F0",I,se,K,te),ge("Blue","0070C0",I,se,K,te),ge("Dark Blue","002060",I,se,K,te),d?ge("Purple Is A Fruit","7030A0",I,se,K,te):ge("Transparent","00000000",I,se,K,te),h){const ue=h.toString();K.set(ue,h)}const Fe=new Map,Te=typeof r=="function"?r():r,Oe=[];for(let ue=0;Te&&ue<Te.length;ue++){const Z=Te[ue].toString();Fe.set(Z,Te[ue]),Oe.push({description:"Recent "+(ue+1),definition:{val:Te[ue].toString()}})}return{primaryColors:de,modifiedPresets:ve,standardColors:se,recentColorsLimited:Oe,mapAllPresets:K,mapAllPresetsRGB:te,mapRecent:Fe}},[I,r,d,h]);n.useEffect(()=>{C?.()},[]);const[ee,X]=n.useState(!1),ne=n.useCallback(()=>{X(K=>!K)},[]);n.useEffect(()=>{if(l)X(l===Ba.Custom);else if(o){let K=o.toString(),te=W.mapAllPresets.get(K);te||(K=o.toRGBA().toString(),te=W.mapAllPresetsRGB.get(K));const de=W.mapRecent.get(K);X(!te&&!de)}},[o,l]);const $=n.useCallback(A.CommonUtils.debounce(K=>{D?.(K)},p),[D,p]),[U,Y]=n.useState();n.useEffect(()=>{Y(t||o)},[t,o]);const _=w.useCallbackRef(K=>{F&&(F(K),$(K))},[F]),L=w.useCallbackRef(K=>{_(K?new A.Color({val:K.definition.val,adjs:K.definition.adjs},I):null)},[I]),G=n.useCallback(K=>{K.ctrlKey&&X(!0)},[]),Q=w.useCallbackRef(K=>{let te=!1;if(K){const de=K.toString();te=!W.mapAllPresets.has(de)}E?.(K,te)},[E,W]),fe=w.useCallbackRef(K=>{const te=K?new A.Color({val:K.definition.val,adjs:K.definition.adjs},I):null;Promise.resolve(f?.()).then(()=>{Q(te)})},[I,f]),re=w.useCallbackRef(K=>{_(K?new A.Color(K,I):null)},[I]),me=n.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(B.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:K=>K.palette.text.icon??K.palette.action.active},onClick:async()=>{O(!0),R?.(),await new EyeDropper().open().then(K=>{O(!1),N?.();let te=new A.Color(K.sRGBHex),de=te.toString(),ve=W.mapAllPresets.get(de);if(ve||(de=te.toRGBA().toString(),ve=W.mapAllPresetsRGB.get(de)),!ve){const se=te.toRGBA(),Fe=3;let Te=255;W.mapAllPresetsRGB.forEach((Oe,ue)=>{const Z=Oe.toRGBA(),le=Math.abs(Z.red-se.red)+Math.abs(Z.blue-se.blue)+Math.abs(Z.green-se.green);le<Fe&&le<Te&&(ve=Oe)})}X(!ve),_(ve||te)}).catch(K=>{O(!1),K?.name!=="AbortError"&&console.error(K)})},children:e.jsx(w.DynamicIcon,{iconKey:"Colorize"})}),[W,T]),Se=n.useMemo(()=>{if(!ee)return;const K={opacity:ee?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return e.jsx(n.Suspense,{fallback:e.jsx("div",{style:K,children:e.jsx(y.LoadingPanel,{})}),children:e.jsx(Wi,{style:K,selectedColor:P?P.toRGBA().toString():"transparent",onColorChange:re,disableAlpha:d})})},[ee,P]),Ce=n.useMemo(()=>({onClick:G,alphaGrey:H.palette.text.icon??H.palette.action.active}),[G,H]),J=n.useMemo(()=>{if(!h)return null;const K={description:k,definition:{val:h.getVal(),adjs:h.getAdjustments()}};return e.jsx(e.Fragment,{children:e.jsxs(B.MenuItem,{sx:{display:"flex",color:te=>te.palette.text.secondary},onMouseOver:()=>{L(null)},onClick:()=>{fe(null)},children:[e.jsx(B.Box,{sx:{flex:"none",boxShadow:te=>te.shadows[2],borderRadius:te=>te.spacing(.5),overflow:"hidden"},children:e.jsx(io,{schemeColorLookup:I,colorDef:K,selectedColor:o===null?h:o,previewColor:t===null?h:t,defaultButtonSize:c,isLarge:!0,darkMode:T,compareRGB:v,swatchProps:Ce})}),e.jsx(B.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:k})]})})},[h,k,I,o,t]);return e.jsxs(B.Box,{ref:i,sx:{width:g,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...M,children:[e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("div",{style:{opacity:ee?"0":1},children:[J&&j===pt.Start?e.jsxs(e.Fragment,{children:[J,e.jsx(B.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Dt,{title:"Theme Colors",schemeColorLookup:I,colorDefs:W.primaryColors,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsx(Dt,{schemeColorLookup:I,colorDefs:W.modifiedPresets,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Dt,{title:"Standard Colors",schemeColorLookup:I,colorDefs:W.standardColors,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsxs("div",{style:{opacity:W.recentColorsLimited.length===0?"0":void 0,display:W.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Dt,{title:"Recent Colors",schemeColorLookup:I,colorDefs:W.recentColorsLimited,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T})]}),J&&j===pt.End?e.jsxs(e.Fragment,{children:[e.jsx(B.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),J,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Se]}),e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[me,e.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),e.jsx(B.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{ne()},children:ee?e.jsx("div",{children:"Preset"}):e.jsx("div",{children:"Custom"})}),e.jsx(B.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(f?.()).then(()=>{Q(U)})},children:"Done"})]})]})})),$i=e.jsx(w.DynamicIcon,{iconKey:"circle.colored"}),Ao=n.memo(n.forwardRef((a,i)=>{const{selectedColor:o,quickColor:t,icon:r=$i,tooltip:s,label:d,onPreviewColor:p,onPreviewColorImmediate:l,onSelectColor:c,variant:g=y.PopupButtonType.Toolbar,panelProps:C,shouldCloseFloatAll:f=!0,compareRGB:u=!1,darkMode:m=!1,...b}=a,S=w.useCallbackRef(p,[p]),x=w.useCallbackRef(l,[l]),h=w.useCallbackRef(c,[c]),[k,j]=n.useState(()=>{}),v=t||k||o||C?.autoColor,T=n.useRef(!1),M=n.useCallback(()=>{},[]),P=w.useCallbackRef(()=>{j(o)},[o]),D=w.useCallbackRef(W=>{T.current||(j(W),S?.(W))},[S]),F=w.useCallbackRef(W=>{T.current||(j(W),x?.(W))},[x]),E=w.useCallbackRef((W,ee)=>{T.current||(j(void 0),h?.(W,ee))},[h]),R=n.useMemo(()=>e.jsx(B.Box,{className:"color-wrapper",sx:{lineHeight:"0",color:"inherit","--sxl-color-active":`${v?.toCSS(m)??"transparent"}`,"& .activeColor":{fill:`${v?.toCSS(m)??"transparent"}`},"& .style_grey":{fill:W=>W.palette.text.icon??W.palette.action.active}},children:typeof r=="function"?r():r}),[v,r,m]),N=w.useCallbackRef(W=>{h?.(t,!1)},[h,t]),[z,O]=n.useState(!1),H=n.useCallback(W=>{const{closeFloat:ee,closeFloatAll:X}=W;return e.jsx(Pa,{...C,selectedColor:o,previewColor:k,onDone:f?X:ee,onKeyDown:ne=>{ne.which===w.KeyCodes.Enter&&(f?X():ee())},onPreviewColorImmediate:F,onPreviewColor:D,onSelectColor:E,onEyeDropStart:()=>O(!0),onEyeDropStop:()=>O(!1),compareRGB:u,darkMode:m})},[o,k,f,v,C?.autoColor,m]),I={onQuickClick:t?N:void 0,createPopupPanel:H,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:P,onPopupClose:M,tooltip:s||d||"Color",label:d,icon:R,...b};return g===y.PopupButtonType.Toolbar?e.jsx(y.ExhibitPopupIconButton,{ref:i,...I}):e.jsx(y.ExhibitPopupMenuItem,{ref:i,...I})})),eo=82,Mo=a=>{const{styleColor:i,length:o=eo,width:t=1,dashArray:r=null,sx:s,isDouble:d=!1,isAngled:p=!1,darkMode:l=!1,...c}=a;return e.jsx(B.SvgIcon,{sx:{width:`${o}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:g=>`${i?i.toRGBA(l).toString():g.palette.text.icon??g.palette.action.active}`},"& .style_grey":{stroke:g=>g.palette.text.icon??g.palette.action.active},...s},height:t,width:o,viewBox:`0 0 ${o} ${t}`,...c,children:e.jsx(oe.StyledStrokePath,{length:o,width:t,dashArray:r,isDouble:d,isAngled:p,className:"activeColor"})})},Ma=n.memo(n.forwardRef((a,i)=>{const{variant:o,showLabels:t=!1,disabled:r=!1,createPopupPanel:s,styleColor:d,selectedStyle:p,onSelectStyle:l,showNone:c=!0,darkMode:g,sx:C,...f}=a,u=w.useCallbackRef(l,[]),m=n.useCallback(h=>{const{popupContainer:k,floatReference:j,closeFloat:v,...T}=h,M=[],P=A.IBorder.BuiltInDefinitionsArray;for(let D=0;D<P.length;D++){const F=P[D];if(F.description==="None"&&!c)continue;const E=e.jsx(Mo,{styleColor:d,length:eo,width:F.width,darkMode:g,dashArray:F.pattern,isDouble:F.description.toLowerCase().includes("double"),isAngled:F.description.toLowerCase().includes("slant")});let R=null;R=t?e.jsxs(e.Fragment,{children:[e.jsx(B.Box,{sx:{marginRight:"6px"},children:F.description}),e.jsxs(B.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[e.jsx("div",{style:{flex:"1 1 100%"}}),E]})]}):F.description==="None"?"None":E,M.push(e.jsx(y.ExhibitMenuItem,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:y.createStrokeShadowFilter(4)},paddingLeft:"16px",background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`},tooltipProps:{description:t?"":F.description},icon:null,disabled:r,onMouseDown:N=>N.preventDefault(),onMouseUp:()=>{v(),u(F.style)},onKeyDown:N=>{N.which===w.KeyCodes.Enter&&v()},selected:F.style===p,parentFloat:j,children:R},D))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:M})},[r,c,d,p,g]),b=n.useMemo(()=>{const h=A.IBorder.BuiltInDefinitions.get(p);let k;return k=h.description==="None"?e.jsx(B.Box,{sx:{minWidth:`${eo}px`},children:"None"}):e.jsx(Mo,{styleColor:d,length:eo,width:h.width,dashArray:h.pattern,darkMode:g,isDouble:h.description.toLowerCase().includes("double"),isAngled:h.description.toLowerCase().includes("slant")}),e.jsx(B.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:y.createStrokeShadowFilter()}},children:k})},[p,d]),S=n.useMemo(()=>A.IBorder.BuiltInDefinitions.get(p),[p]),x={disabled:r,icon:b,tooltip:"Border Style: "+S.description,sx:{background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,...C},createPopupPanel:m,...f};return o===y.PopupButtonType.Toolbar?e.jsx(y.ExhibitPopupIconButton,{...x}):e.jsx(y.ExhibitPopupMenuItem,{...x})})),Da=n.memo(n.forwardRef((a,i)=>{const{autoColor:o=null,schemeLookup:t,autoStrokeStyle:r=A.IBorder.StrokeStyle.Thin,disabled:s=!1,darkMode:d=!1,showStylingBefore:p=!0,onSelectBorder:l,onPreviewBorder:c,selectedBorder:g,createTemporaryBorder:C,...f}=a,u=w.useCallbackRef(l,[l]),m=w.useCallbackRef(c,[c]),[b,S]=n.useState(),[x,h]=n.useState(),k=b??r,j=x??o,v=g||{bottom:{style:r,color:o?.toString()}},T=w.useCallbackRef(R=>{const N={},z=R?Object.keys(R):[];let O=!1;const H=z.length;for(let Y=0;Y<H;Y++){const _=z[Y];R[_]?.style&&(N[_]={style:R[_].style,color:R[_].color},O||N[_].style===A.IBorder.StrokeStyle.None||(O=!0))}z.length<6&&(O=!0);const I=O?N.left:null,W=O?N.top:null,ee=O?N.right:null,X=O?N.bottom:null,ne=O?N.vertical:null,$=O?N.horizontal:null;let U="";return W||I||(U+="M 3,5 H 5 V 3 H 3 "),W||(U+="M 7,5 H 9 V 3 H 7 "),W||ne||(U+="M 11,5 h 2 V 3 h -2 "),W||(U+="M 15,5 h 2 V 3 h -2 "),W||ee||(U+="M 19,5 h 2 V 3 h -2 "),I||(U+="M 3,9 H 5 V 7 H 3 "),ne||(U+="M 11,9 h 2 V 7 h -2 "),ee||(U+="M 19,9 h 2 V 7 h -2 "),$||I||(U+="M 3,13 H 5 V 11 H 3 "),$||(U+="M 7,13 H 9 V 11 H 7 "),$||ne||(U+="M 11,13 h 2 v -2 h -2 "),$||ee||(U+="M 19,13 h 2 v -2 h -2 "),$||(U+="M 15,13 h 2 v -2 h -2 "),I||(U+="M 3,17 H 5 V 15 H 3 "),ne||(U+="M 11,17 h 2 v -2 h -2 "),ee||(U+="M 19,17 h 2 v -2 h -2 "),X||I||(U+="M 3,21 H 5 V 19 H 3 "),X||(U+="M 7,21 H 9 V 19 H 7 "),X||ne||(U+="M 11,21 h 2 v -2 h -2 "),X||(U+="M 15,21 h 2 v -2 h -2 "),X||ee||(U+="M 19,21 h 2 v -2 h -2 "),e.jsxs(w.DynamicIcon,{children:[" ",e.jsxs(B.Box,{className:"border-icon",sx:{width:"var(--icon-size, var(--icon-size-md))",height:"var(--icon-size, var(--icon-size-md))",position:"relative","& .grid > path":{opacity:"0.8"}},children:[e.jsx("svg",{viewBox:"0 0 24 24",className:"grid",style:{top:"0px",left:"0px",width:"calc(var(--icon-size, var(--icon-size-md)) + 1px)",height:"calc(var(--icon-size, var(--icon-size-md)) + 1px)",position:"absolute"},children:e.jsx("path",{className:"fill",d:U})}),e.jsx(B.Box,{className:"border-container",sx:{position:"absolute",display:"flex",justifyContent:"stretch",alignItems:"stretch",top:"0px",left:"0px",width:"var(--icon-size, var(--icon-size-md))",height:"var(--icon-size, var(--icon-size-md))",padding:"1px 1px","& svg path":{filter:y.strokeShadowFilter}},children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:(Y,_)=>{if(!C||z.length===0)return null;const L=Y.rowIndex,G=Y.colIndex,Q={};return L===0?(Q.top=N.top,Q.bottom=N.horizontal):(Q.top=N.horizontal,Q.bottom=N.bottom),G===0?(Q.left=N.left,Q.right=N.vertical):(Q.left=N.vertical,Q.right=N.right),C?.(Q)},darkMode:d,style:{top:"2px",left:"2px",width:"calc(100% - 5px)",height:"calc(100% - 5px)",position:"absolute"}})})]})]})},[j,k,d]),M=n.useCallback((R,N,z)=>{let O=null;if(R&&R.length>0){let H=null;(N||z)&&(H={style:z,color:N?.toString()??null}),O={};const I=R.length;for(let W=0;W<I;W++)O[R[W]]=H}return O},[]),P=n.useCallback(R=>{u?.(R)},[]),D=n.useCallback(R=>{m?.(R)},[]),F=n.useCallback(R=>{const{closeFloatAll:N,floatReference:z}=R,O=(W,ee,X="bottom",ne=!1)=>{const $=M(W,j??null,ne?A.IBorder.StrokeStyle.None:k??null),U=ne?M([],j??null,k??null):$;return e.jsx(y.ExhibitIconButton,{icon:T(U),sx:{background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`},tooltipProps:{label:ee,simple:!0,placement:X},onClick:()=>{N(),D($),P($)}})},H=e.jsxs(e.Fragment,{children:[e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom,A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical],"All Borders","top"),O([A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical],"Inner Borders","top"),O([A.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),O([A.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom],"Outside Borders","top")]}),e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[O([A.IBorder.Edge.Left],"Left Borders"),O([A.IBorder.Edge.Top],"Top Borders"),O([A.IBorder.Edge.Right],"Right Borders"),O([A.IBorder.Edge.Bottom],"Bottom Borders"),O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom,A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical,A.IBorder.Edge.DiagonalUp,A.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),I=e.jsx(e.Fragment,{children:e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[e.jsx(Ao,{variant:y.PopupButtonType.Toolbar,icon:e.jsx(w.DynamicIcon,{iconKey:"stroke.colored"}),selectedColor:k===A.IBorder.StrokeStyle.None?new A.Color("transparent"):j,onPreviewColor:W=>{h(W)},onSelectColor:(W,ee)=>{h(W)},darkMode:d,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:o,schemeLookup:t},disabled:s||k===A.IBorder.StrokeStyle.None,parentFloat:z,shouldCloseFloatAll:!1}),e.jsx(Ma,{selectedStyle:k,onSelectStyle:S,styleColor:j,darkMode:d,variant:y.PopupButtonType.Toolbar,parentFloat:z})]})});return e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:W=>W.stopPropagation(),children:[p?I:H,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),p?H:I]})},[k,j,o,t,d]),E=n.useMemo(()=>T(v),[v,d]);return e.jsx(y.ExhibitPopupIconButton,{ref:i,createPopupPanel:F,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:R},N)=>e.jsx(y.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:N,children:R}),onQuickClick:()=>{u?.(v)},quickButtonProps:{sx:{}},disabled:s,icon:E,...f})})),Fa=n.memo(n.forwardRef((a,i)=>{const{commands:o,command:t,commandHook:r,variant:s=w.CommandButtonType.Toolbar,disabled:d=!1,autoColor:p,autoStrokeStyle:l,schemeLookup:c,createTemporaryBorder:g,selectedBorder:C,onSelectBorder:f,darkMode:u,icon:m,label:b,...S}=a,x=w.useCommands(o,["formatBorder"]),h=t??x[0],k=h?.context()??null,j=k?.autoColor??p,v=k?.autoStyle??l,T=C??k?.quickBorder,M=u??k?.darkMode,P=g??k?.createTemporaryBorder,D=c??k?.schemeLookup,F=w.useCallbackRef(R=>{k?.onBorderSelect&&k.onBorderSelect(R),f?.(R),h?.execute(R,r)},[h,f,r]),E=n.useCallback((R,N)=>{const{children:z,title:O,...H}=R;let I=R.children;return(h?.disabled()||d)&&(I=e.jsx("div",{children:I})),e.jsx(y.CommandTooltip,{command:h,placement:s===w.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:N,...H,children:I})},[h,d]);return e.jsx(Da,{ref:i,autoColor:j,darkMode:M,autoStrokeStyle:v,createTemporaryBorder:P,schemeLookup:D,selectedBorder:T,onSelectBorder:F,createTooltip:E,disabled:d||!h||h.disabled(),...S})})),Ia=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=n.useCallback((l,c)=>{const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,command:c.getCommand("mergeToggle")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("mergeHorizontal")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("mergeVertical")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...g,command:c.getCommand("unmerge")})]});return y.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,quickCommand:"mergeToggle",commandHook:t,scope:r,tooltip:"Combine or split cells.",createPopupPanel:p,icon:"MergeAll",...d})})),Na=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=n.useCallback((l,c)=>{const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,command:c.getCommand("freezeToggle")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("freezeToggleHorizontal")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("freezeToggleVertical")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...g,command:c.getCommand("unfreeze")})]});return y.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,createPopupPanel:p,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:"Freeze",...d})})),Oa=n.memo(n.forwardRef((a,i)=>e.jsx(y.SimpleCommandPopupButton,{ref:i,...a,popupCommandKeys:["find","findReplace","goto"],scope:"find",label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:"Find"}))),Aa=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,showQuickButtons:r=!!a.commands,commands:s,fontSizes:d=A.FontUtils.DefaultFontSizes,disabled:p=!1,parentFloat:l,icon:c,label:g,sx:C,...f}=a;w.useCommand(o);const u=()=>o?.state()?.toString()||"11",[m,b]=n.useState(u),S=w.useCallbackRef(()=>{const P=parseFloat(m);isNaN(P)?b(u()):parseFloat(u())!==P&&o.execute(P,t)},[u,o,m,t]);n.useEffect(()=>{b(u())},[o?.state()]);const x=n.useMemo(()=>{if(!t)return null;const P={...t};return delete P.beforeExecute,P},[t]),h=w.useCommands(s,["formatFontSizeIncrease","formatFontSizeDecrease"]),k=n.useMemo(()=>h?e.jsxs(B.Box,{className:ie("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:P=>P.stopPropagation(),children:[e.jsx(y.CommandButton,{command:h[0],commandHook:x}),e.jsx(y.CommandButton,{command:h[1],commandHook:x})]}):null,[h]),j=q.useTheme(),v=n.useMemo(()=>`${A.IFont.getSharedMeasurer()("12.3",Math.round(j.typography.fontSize),j.typography.fontFamily).width}px`,[j]),T=n.useCallback(P=>{const{onMouseDown:D,onMouseUp:F,...E}=P;return e.jsx(B.IconButton,{component:"div",...E,disableRipple:!0,children:e.jsx(B.Input,{inputMode:"numeric",disabled:p||!o||o.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:R=>`1px solid ${R.palette.text.icon??R.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:R=>`1px solid ${R.palette.error.main}`},"::after":{borderBottom:R=>`1px solid ${R.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:R=>`${Math.round(R.typography.fontSize)}px`,width:v,color:R=>R.palette.text.secondary,input:{padding:"0 0",textAlign:"center",height:"1rem",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:R=>R.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:R=>R.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"}},value:m,onFocus:R=>{R.target?.select()},onKeyDown:R=>{if(R.which===w.KeyCodes.Enter)u()!==m&&(R.stopPropagation(),R.preventDefault(),S());else if(R.which===w.KeyCodes.Escape)u()!==m&&(b(u()),setTimeout(()=>{R.target?.select()},0),R.stopPropagation(),R.preventDefault());else{if(R.key.match("[-]")||R.key.match("[0-9.]")&&(m+R.key).length>4)return R.stopPropagation(),void R.preventDefault();if(R.which===w.KeyCodes.Space)return void R.preventDefault()}},onBlur:()=>{S()},onChange:R=>{if(R.target.value.length>4)return R.stopPropagation(),void R.preventDefault();b(R.target.value)}})})},[m,p,o]),M=n.useCallback(P=>{const D=N=>{o?.execute(N,t)},F=o?.state(),E=[];for(let N=0;N<d.length;N++){const z=d[N]===F;E.push(e.jsx(y.ExhibitMenuItem,{selected:z,icon:z?e.jsx(y.SelectedIcon,{}):void 0,disabled:p||!o||o.disabled(),onMouseDown:O=>{O.button===0&&O.preventDefault()},onMouseUp:O=>{O.button===0&&D(d[N])},onKeyDown:O=>{O.keyCode!==w.KeyCodes.Enter&&O.keyCode!==w.KeyCodes.Space||D(d[N])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:d[N]})},"fontSize-"+N))}const R=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...f,children:[k,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:E})]});return y.defaultCreatePopupPanel({...P,children:R})},[p,o?.state(),t]);return e.jsx(y.ExhibitPopupIconButton,{ref:i,sx:{...C},tabIndex:-1,outlined:!0,disabled:p,parentFloat:l,createPopupPanel:M,createTooltip:({children:P},D)=>e.jsx(y.ExhibitTooltip,{label:o?.label(),description:o?.description(),disabled:D||o?.disabled(),children:P}),createQuickButton:T,...f})})),Pn=n.memo(a=>{const{selected:i,disabled:o,formattedValue:t,handleSetFormat:r,format:s,sx:d,...p}=a;return e.jsx(y.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...d},disabled:o,selected:i,icon:i?e.jsx(y.SelectedIcon,{}):void 0,onMouseDown:l=>{l.button===0&&l.preventDefault()},onMouseUp:l=>{l.button===0&&r(s.numberFormat)},onKeyDown:l=>{l.keyCode!==w.KeyCodes.Enter&&l.keyCode!==w.KeyCodes.Space||r(s.numberFormat)},...p,children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(B.Typography,{component:"div",children:[s.formatType,s.formatType===A.NumberFormat.Type.Custom?"…":""]}),e.jsx(B.Typography,{variant:"caption",component:"div",sx:{color:l=>Re.alpha(l.palette.text.primary,.6),paddingTop:t&&t.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:t&&t.length>0?t:" "})]})})}),La=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,sx:s,disabled:d=!1,parentFloat:p,...l}=a,c=w.useCommands(o,["formatNumberFormat"])[0],g=c?.state()?A.NumberFormat.Styles.lookupStyle(c?.state()).formatType:A.NumberFormat.Type.General,C=n.useMemo(()=>{if(!t)return null;const b={...t};return delete b.beforeExecute,b},[t]),f=n.useCallback((b,S)=>{const x=F=>{t?.beforeExecute?.(c,c?.state()),c.execute(F,t),t?.onExecute?.(c,c?.state())},h=c?.context()(),k=A.NumberFormat.Styles.lookupPrimary(),j=[];for(let F=0;F<k.length;F++){let E="";if(h&&!h.isEmpty())try{E=h.getNumberFormat(k[F].numberFormat).displayText}catch(N){console.warn(N)}E===""&&k[F].formatType===A.NumberFormat.Type.General&&(E="No specific format");const R=k[F].formatType===g;j.push(e.jsx(Pn,{selected:R,disabled:d||!c||c.disabled(),formattedValue:E,handleSetFormat:x,format:k[F]},k[F].formatType))}const v={numberFormat:"",formatType:A.NumberFormat.Type.Custom},T=g===A.NumberFormat.Type.Custom,M=e.jsx(Pn,{selected:T,disabled:d||!c||c.disabled(),formattedValue:T?h.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(c,c?.state()),S.getCommand("formatNumberDialog")?.execute(c?.state()),t?.onExecute?.(c,c?.state())},format:v,sx:{flex:"0",width:"100%"}},A.NumberFormat.Type.Custom),P=e.jsxs(B.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:F=>F.stopPropagation(),children:[e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatAccountingStyle"),commandHook:C,scope:r}),e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatPercentStyle"),commandHook:C,scope:r}),e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatCommaStyle"),commandHook:C,scope:r}),e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:C,scope:r}),e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:C,scope:r})]}),D=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...l,children:[P,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),M]});return y.defaultCreatePopupPanel({...b,children:D})},[c?.context(),c?.state(),t,r]),u=q.useTheme(),m=n.useMemo(()=>{const b=A.NumberFormat.Type.MediumTime;return`${A.IFont.getSharedMeasurer()(b,Math.round(u.typography.fontSize),u.typography.fontFamily).width}px`},[u]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,sx:s,outlined:!0,disabled:d,parentFloat:p,createPopupPanel:f,createTooltip:({children:b},S)=>e.jsx(y.ExhibitTooltip,{label:c?.label(),description:c?.description(),disabled:S,children:b}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:b=>`${Math.round(b.typography.fontSize)}px`,color:b=>b.palette.text.secondary,fontFamily:b=>b.typography.fontFamily,width:m},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:g})}),...l})})),Lo=n.memo(n.forwardRef((a,i)=>e.jsx(y.SimpleCommandPopupButton,{ref:i,...a,popupCommandKeys:["clearAll","clearFormats","clearContents","clearComments","clearHyperlinks"],scope:"clear",label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",icon:"ClearAll"}))),za=n.memo(n.forwardRef((a,i)=>e.jsx(y.SimpleCommandPopupButton,{ref:i,...a,popupCommandKeys:["fillDown","fillRight","fillUp","fillLeft"],scope:"fill",label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",icon:"FillDown"}))),zo=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,disableSheet:d=!1,preferSingleMenu:p=!0,showQuickButton:l=!0,variant:c=w.CommandButtonType.Toolbar,...g}=a,C=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns","addSheet"];d||C.push("addSheet");const f=w.useCommands(o,C),{singleCommand:u,allDisabled:m}=n.useMemo(()=>{let S=null,x=0;const h=f.length;for(let k=0;k<h;k++){const j=f[k];j&&!j.disabled()&&(p&&c===w.CommandButtonType.Menuitem&&(S=x===0?j:null),x++)}return{singleCommand:S,allDisabled:x===0}},[f]),b=n.useCallback((S,x)=>{let h=null;const k={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"insertCells",disabled:s};d||(h=e.jsxs(e.Fragment,{children:[e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...k,command:x.getCommand("addSheet")})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...k,command:f[0]}),e.jsx(y.CommandButton,{...k,command:f[1]}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...k,command:f[2]}),e.jsx(y.CommandButton,{...k,command:f[3]}),h]});return y.defaultCreatePopupPanel({...S,children:j})},[s,f,t,r]);return u?e.jsx(y.CommandButton,{ref:i,variant:c,commandHook:t,disabled:s,command:u,...g}):e.jsx(y.CommandPopupButton,{ref:i,variant:c,quickCommand:"insertCells",commands:o,commandHook:t,scope:r,disabled:s||m,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),e.jsx("br",{}),e.jsx("span",{children:"To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert."})]}),createPopupPanel:b,...g})})),Ho=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,disableSheet:d=!1,preferSingleMenu:p=!0,showQuickButton:l=!0,variant:c=w.CommandButtonType.Toolbar,...g}=a,C=["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"];d||C.push("deleteSheet");const f=w.useCommands(o,C),{singleCommand:u,allDisabled:m}=n.useMemo(()=>{let S=null,x=0;const h=f.length;for(let k=0;k<h;k++){const j=f[k];j&&!j.disabled()&&(p&&c===w.CommandButtonType.Menuitem&&(S=x===0?j:null),x++)}return{singleCommand:S,allDisabled:x===0}},[f]),b=n.useCallback((S,x)=>{const h={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"deleteCells",disabled:s};let k=null;d||(k=e.jsxs(e.Fragment,{children:[e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteSheet")})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteCellsShiftUp")}),e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteCellsShiftLeft")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteRows")}),e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteColumns")}),k]});return y.defaultCreatePopupPanel({...S,children:j})},[s,t,r]);return u?e.jsx(y.CommandButton,{ref:i,variant:c,commandHook:t,disabled:s,command:u,...g}):e.jsx(y.CommandPopupButton,{ref:i,variant:c,quickCommand:"deleteCells",commands:o,commandHook:t,scope:r,disabled:s||m,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),e.jsx("br",{}),e.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:b,...g})})),Wo=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,...s}=a,d=n.useCallback((p,l)=>{const c={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"formatCells"},g={commands:l,parentFloat:p.floatReference,...c},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...c,command:l.getCommand("resizeRows")}),e.jsx(y.CommandButton,{...c,command:l.getCommand("autoFitRows")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...c,command:l.getCommand("resizeColumns")}),e.jsx(y.CommandButton,{...c,command:l.getCommand("autoFitColumns")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.SimpleCommandPopupButton,{ref:i,...g,popupCommandKeys:["hideColumns","hideRows",null,"unhideColumns","unhideRows"],popupScope:"hideUnhide",label:"Hide & Unhide"})]});return y.defaultCreatePopupPanel({...p,children:C})},[t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,createPopupPanel:d,icon:"CellsFormat",label:"Format Cells",tooltip:"Change row and column sizes or visibility.",...s})}));Wo.displayName="CellsFormatCommandButton";const ht=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,onSelectColor:r,disabled:s=!1,variant:d=w.CommandButtonType.Toolbar,quickColor:p,panelProps:l,isSplit:c=!1,darkMode:g,icon:C,...f}=a,{autoColor:u,schemeLookup:m,recentColors:b,...S}=l;if(f.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");w.useCommand(o);const x=o?.context();let h=p??x?.quickColor;c&&!h&&(h=new A.Color("transparent"));const k=u??x?.autoColor,j=m??x?.schemeLookup,v=b??x?.recentColors,T=g??x?.darkMode,M=n.useMemo(()=>({autoColor:k,schemeLookup:j,recentColors:v,darkMode:T,...S}),[k,j,v,T]),P=w.useCallbackRef((F,E)=>{F&&E&&x?.addRecentColor&&x.addRecentColor(F),x?.onColorSelect&&x.onColorSelect(F),r?.(F,E),o?.execute(F,t)},[o,r,t,x]),D=n.useCallback((F,E)=>{const{children:R,title:N,...z}=F;let O=F.children;return(o?.disabled()||s)&&(O=e.jsx("div",{children:O})),e.jsx(y.CommandTooltip,{command:o,placement:d===w.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:E,...z,children:O})},[o,s]);return e.jsx(Ao,{ref:i,panelProps:M,icon:C??o?.icon(x),quickColor:h,selectedColor:o?.state(),onSelectColor:P,variant:d===w.CommandButtonType.Menuitem?y.PopupButtonType.Menuitem:y.PopupButtonType.Toolbar,createTooltip:D,label:o?.label(),disabled:s||!o||o.disabled(),compareRGB:!0,darkMode:T,...f})}));ht.displayName="ColorCommandButton";const Ha=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...p}=a,l=w.useCommands(o,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),c=n.useCallback((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,parentFloat:g.floatReference,commandHook:t,scope:r,disabled:s},u=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...f,command:C.getCommand("gridlinesToggle")}),e.jsx(ht,{...f,command:C.getCommand("sheetViewFormatGridlinesColor"),icon:e.jsx(w.DynamicIcon,{iconKey:"stroke.colored"}),panelProps:{disableAlpha:!0}}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleGridlinesColumns")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleGridlinesRows")})]});return y.defaultCreatePopupPanel({...g,children:u})},[s,t]);return e.jsx(y.CommandPopupButton,{ref:i,parentFloat:d,quickCommand:l[0]?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:e.jsx(y.LabelIcon,{command:l[0],scope:"view"}),...p})})),$o=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=n.useCallback((l,c)=>{const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:s},C=c.getCommand("sortCustom"),f=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,command:c.getCommand("sortAscending")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("sortDescending")}),C?e.jsx(y.CommandButton,{...g,command:C}):null,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterToggle")}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterClear")}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterReapply")})]});return y.defaultCreatePopupPanel({...l,children:f})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,disabled:s,label:"Sort",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:p,icon:"SortFilter",...d})})),Vi=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=n.useCallback((l,c)=>{const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterToggle")}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterClear")}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterReapply")})]});return y.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,disabled:s,label:"Filter",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:p,icon:"FilterToggle",...d})})),Vo=n.memo(n.forwardRef((a,i)=>{const{quickCommand:o,icon:t,isRedo:r=!1,nestRedo:s=!0,undoManager:d,scope:p,sx:l,disabled:c,commands:g,...C}=a,f=[o];!r&&s&&f.push("redo");const u=w.useCommands(g,f),m=u[0],b=u[1],S=d??m?.context?.()?.undoManager;let x=c;c||(x=!m||m.disabled(),b&&!b.disabled()&&(x=!1));const[h,k]=n.useState(0),j=n.useCallback((v,T)=>{let M=h===0?"Cancel":`${m.label()} ${h} Action${h===1?"":"s"}`,P=!1;S||(P=!0),P||(P=s?!S.hasRedo()&&!S.hasUndo():!S.hasRedo());const D=O=>{m.execute(O)},F=e.jsx(y.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:P?void 0:"0 0",minWidth:"180px"},icon:e.jsx(w.DynamicIcon,{}),onMouseEnter:()=>{k(0)},onMouseDown:O=>{O.button===0&&O.preventDefault()},onMouseUp:O=>{O.button===0&&D(h)},onKeyDown:O=>{O.isDefaultPrevented()||O.keyCode!==w.KeyCodes.Enter&&O.keyCode!==w.KeyCodes.Space||D(h)},children:e.jsx(B.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:M})});if(P)return F;const E=r?S?.getRedoDescriptions():S?.getUndoDescriptions(),R=[];for(let O=0;O<E.length;O++){const H=E[O];R.push(e.jsx(y.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex"},disabled:x,selected:O<h,icon:e.jsx(w.DynamicIcon,{}),onMouseEnter:()=>{k(O+1)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&D(O+1)},onKeyDown:I=>{I.isDefaultPrevented()||I.keyCode!==w.KeyCodes.Enter&&I.keyCode!==w.KeyCodes.Space||D(O+1)},children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[e.jsx(B.Typography,{component:"div",children:H}),e.jsx(w.DynamicIcon,{})]})},`action:${O}`))}let N=null;if(!r&&s){const O={scope:"undo",commands:T,variant:w.CommandButtonType.Menuitem,parentFloat:v.floatReference};N=[],N.push(e.jsx(Vo,{...O,quickCommand:"redo",isRedo:!0},"nested:redo")),S.hasRedo()&&S.hasUndo()&&N.push(e.jsx(y.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const z=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{v.closeFloatAll()},onMouseLeave:()=>{k(0)},children:[N,e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:R}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),F]});return y.defaultCreatePopupPanel({...v,children:z})},[m?.context(),m?.state(),p,S,h,x]);return e.jsx(y.CommandPopupButton,{ref:i,commands:g,quickCommand:o,scope:p,disabled:x,label:m?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${m?.label()??"No"} last actions.`})}),createPopupPanel:j,icon:t??(r?"Redo":"Undo"),selected:!1,...C})})),ft=A.IFontCollection.getFontList(),Wa=new Map;for(let a=0;a<ft.length;a++)Wa.set(ft[a].fontRef.getFamily(),ft[a]);const $a=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,sx:r,disabled:s=!1,parentFloat:d,icon:p,label:l,...c}=a;w.useCommand(o);const g=o?.state(),C=q.useTheme(),f=n.useMemo(()=>`${A.IFont.getSharedMeasurer()("Times New Roman",Math.round(C.typography.fontSize),C.typography.fontFamily).width}px`,[C]),u=n.useCallback(m=>{const b=k=>{o?.execute(k,t)},S=[];for(let k=0;k<ft.length;k++)S.push({key:ft[k].fontRef.getFamily(),description:ft[k].fontRef.getFamily()});Wa.get(g)||S.unshift({key:g,description:g});const x=[];for(let k=0;k<S.length;k++){const j=S[k].key===g;x.push(e.jsx(y.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:j,disabled:s||!o||o.disabled(),icon:j?e.jsx(y.SelectedIcon,{}):void 0,onMouseUp:v=>{v.button===0&&b(S[k].key)},onMouseDown:v=>{v.button===0&&v.preventDefault()},onKeyDown:v=>{v.keyCode!==w.KeyCodes.Enter&&v.keyCode!==w.KeyCodes.Space||b(S[k].key)},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(B.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>S[k]?.key},children:S[k].description})})},k+""+S[k].key))}const h=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...c,children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:x})});return y.defaultCreatePopupPanel({...m,children:h})},[s,o?.state()]);return e.jsx(y.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:s,parentFloat:d,createPopupPanel:u,createTooltip:({children:m},b)=>e.jsx(y.ExhibitTooltip,{label:o?.label(),description:o?.description(),disabled:b,children:m}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:m=>`${Math.round(m.typography.fontSize)}px`,fontFamily:m=>m.typography.fontFamily,color:m=>m.palette.text.secondary,width:f},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:g})}),...c})})),Va=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),l=n.useMemo(()=>{const g=p.length;for(let C=0;C<g;C++){const f=p[C];if(f?.state())return f}return p[0]},[p]),c=n.useCallback((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:s},u=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...f,command:C.getCommand("formatStrikeThroughToggle")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatSuperscriptToggle")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatSubscriptToggle")})]});return y.defaultCreatePopupPanel({...g,children:u})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,quickCommand:l?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:l?.icon()??"TextStrike",...d})})),_a=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),l=n.useMemo(()=>{const g=p.length;for(let C=0;C<g;C++)if(p[C]?.state())return p[C];return p[0]},[p]),c=n.useCallback((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:s},u=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...f,command:C.getCommand("formatUnderlinedToggle")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatUnderlinedDoubleToggle")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatUnderlinedAccountingToggle"),commandHook:t}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatUnderlinedAccountingDoubleToggle")})]});return y.defaultCreatePopupPanel({...g,children:u})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,quickCommand:l?.key(),commands:o,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:c,icon:l?.icon()??"TextUnderline",...d})})),_o=n.memo(n.forwardRef((a,i)=>{const{command:o,commands:t,commandHook:r,scope:s,includePasteAllInPopup:d=!0,disabled:p=!1,...l}=a,c=w.useCallbackRef((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,commandHook:r,scope:"paste",disabled:p},u=[];return d&&(u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("paste"),key:"paste"})),u.push(e.jsx(y.ExhibitDivider,{orientation:"horizontal"},"paste-div"))),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteValues"),key:"pasteValues"})),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteFormats"),key:"pasteFormats"})),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteFormulas"),key:"pasteFormulas"})),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteTranspose"),key:"pasteTranspose"})),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteLinks"),key:"pasteLinks"})),y.defaultCreatePopupPanel({...g,children:u})},[p,r,s,d]);return e.jsx(y.CommandPopupButton,{ref:i,commands:t,commandHook:r,scope:s,createPopupPanel:c,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",...l})})),Ka=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...p}=a,l=w.useCommands(o,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),c=n.useCallback((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,parentFloat:g.floatReference,commandHook:t,scope:r,disabled:s},u=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleShowHeadings")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleShowHeadingsNumeric")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleShowHeadingColumns")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleShowHeadingRows")})]});return y.defaultCreatePopupPanel({...g,children:u})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,parentFloat:d,quickCommand:l[0]?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:e.jsx(y.LabelIcon,{command:l[0],scope:"view"}),...p})})),Ua=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r="view",disabled:s=!1,...d}=a,p=n.useCallback(l=>{const c={variant:w.CommandButtonType.Menuitem,parentFloat:l.floatReference,commandHook:t,scope:r,disabled:s},g=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowFormulaBar")}),e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowTabs")}),e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowStatusBar")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowHorizontalScrollBar")}),e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return y.defaultCreatePopupPanel({...l,children:g})},[s,o,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,disabled:s,commandHook:t,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:p,icon:e.jsx(y.LabelIcon,{icon:null,label:"Workbook View"}),...d})})),qa=n.memo(n.forwardRef((a,i)=>{const{value:o,cellStyle:t,styles:r,createTemporaryCell:s,bodyStyle:d,sx:p,borderProps:l,disabled:c,...g}=a,C=n.useMemo(()=>s({value:o,style:t}),[o,t,s]),f=n.useMemo(()=>C.getStyle(),[C,d]),u=n.useMemo(()=>f.getFill().toCSS(d?.darkMode??!1),[f]),m=f.getInsets(),b=f.getFont(),S=n.useCallback(()=>f.getBorder(),[f]);return e.jsx(B.Box,{ref:i,sx:{width:"100px",height:"100%",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:d?.fill,filter:c?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...u},"& .text":{flex:"1 1 100%",...b.toCSS(d?.darkMode??!1,1),boxSizing:"border-box",padding:`${m.top}px ${m.right}px ${m.bottom}px ${m.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:b.toCSS().textDecoration,textAlign:A.ITextFrame.toCSSHorizontalTextAlign(C.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...p},...g,children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:S,darkMode:d?.darkMode??!1,rowCount:1,columnCount:1,style:{height:"100%",width:"100%",...l?.style},...l,children:e.jsx(B.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-2px",marginBottom:"-2px",display:"flex",alignItems:"center"},children:e.jsx(B.Box,{className:"text",children:o})})})})})),_i=n.memo(a=>{const{styles:i,namedStyle:o,selectedNamed:t,hasContextMenu:r=!0,bodyStyle:s,onSelectNamed:d,createTemporaryCell:p,parentFloat:l,commands:c,disabled:g,commandHook:C,...f}=a,u=n.useCallback(S=>{const x={variant:w.CommandButtonType.Menuitem,commandHook:C,context:"cellStyle"},h=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...x,style:{fontWeight:550},command:c.getCommand("formatCellStyle"),commandState:o,disabled:g}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...x,command:c.getCommand("modifyCellStyle"),commandState:{named:o}}),e.jsx(y.CommandButton,{...x,command:c.getCommand("deleteCellStyle"),commandState:o,disabled:g||o?.getName()===A.IStyle.BuiltInName.Normal})]}),k=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:h})});return y.defaultCreatePopupPanel({...S,children:k})},[]),m=o?.getName()===t?.getName();let b=e.jsx(y.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:S=>`solid ${m?S.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:o.getName(),placement:"bottom-start"},disabled:g,icon:null,onClick:()=>{d?.(o)},...f,children:e.jsx(qa,{value:o.getName(),cellStyle:{named:o.getName()},styles:i,createTemporaryCell:p,bodyStyle:s})},o.getName());return r&&(b=e.jsx(y.ContextMenu,{label:o.getName(),parentFloat:l,createPopupPanel:u,children:b})),b}),Ga=n.memo(n.forwardRef((a,i)=>{const{commands:o,command:t,commandHook:r,selectedNamed:s,onSelectNamed:d,disabled:p=!1,bodyStyle:l,usePreviewIcon:c=!0,...g}=a;w.useCommand(t);const C=t?.context(),f=C?.styles,u=s??C?.named(),m=l??C?.bodyStyle(),b=w.useCallbackRef(j=>{d?.(j),t?.execute(j,r)},[t,d,r]),S=n.useCallback((j,v)=>{const T={onSelectNamed:b,styles:f(),parentFloat:j.floatReference},M=f().getCustomNamed(),P=new Map,D=[];for(let I=0;I<M.length;I++)P.set(M[I].getName(),M[I]),f().getNamed(M[I].getName()).getBuiltInID()===null&&D.push(M[I].getName());const F=I=>{let W=P.get(I);return W||(W=f().getNamed(I)),!W||W.isHidden()?null:e.jsx(_i,{namedStyle:W,selectedNamed:u,bodyStyle:C.bodyStyle(),createTemporaryCell:C.createTemporaryCell,commands:o,commandHook:r,...T},I)},E=(I,W,ee=!0)=>{const X=[];for(let ne=0;ne<W.length;ne++){const $=F(W[ne]);$&&X.push($)}return X.length===0?null:e.jsxs(B.Box,{children:[ee?e.jsx(y.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(y.ExhibitMenuHeader,{children:I},I+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:X},I+"-presets")]},I)},R=(I,W)=>{const ee=[];for(let X=0;X<W.length;X++){const ne=F(W[X]);ne&&ee.push(ne)}return ee.length===0?null:e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:ee},I+"-presets")},N=[];N.push(E("Custom",D,!1)),N.push(E("Good, Bad and Neutral",[A.IStyle.BuiltInName.Normal,A.IStyle.BuiltInName.Bad,A.IStyle.BuiltInName.Good,A.IStyle.BuiltInName.Neutral],D.length>0)),N.push(E("Data and Model",[A.IStyle.BuiltInName.Calculation,A.IStyle.BuiltInName.CheckCell,A.IStyle.BuiltInName.ExplanatoryText,A.IStyle.BuiltInName.FollowedHyperlink,A.IStyle.BuiltInName.Hyperlink,A.IStyle.BuiltInName.Input,A.IStyle.BuiltInName.LinkedCell,A.IStyle.BuiltInName.Note,A.IStyle.BuiltInName.Output,A.IStyle.BuiltInName.WarningText])),N.push(E("Titles and Headings",[A.IStyle.BuiltInName.Heading1,A.IStyle.BuiltInName.Heading2,A.IStyle.BuiltInName.Heading3,A.IStyle.BuiltInName.Heading4,A.IStyle.BuiltInName.Title,A.IStyle.BuiltInName.Total]));let z=[];var O,H;return z.push(R("Accent 1",[A.IStyle.BuiltInName.Accent1_20,A.IStyle.BuiltInName.Accent1_40,A.IStyle.BuiltInName.Accent1_60,A.IStyle.BuiltInName.Accent1])),z.push(R("Accent 2",[A.IStyle.BuiltInName.Accent2_20,A.IStyle.BuiltInName.Accent2_40,A.IStyle.BuiltInName.Accent2_60,A.IStyle.BuiltInName.Accent2])),z.push(R("Accent 3",[A.IStyle.BuiltInName.Accent3_20,A.IStyle.BuiltInName.Accent3_40,A.IStyle.BuiltInName.Accent3_60,A.IStyle.BuiltInName.Accent3])),z.push(R("Accent 4",[A.IStyle.BuiltInName.Accent4_20,A.IStyle.BuiltInName.Accent4_40,A.IStyle.BuiltInName.Accent4_60,A.IStyle.BuiltInName.Accent4])),z.push(R("Accent 5",[A.IStyle.BuiltInName.Accent5_20,A.IStyle.BuiltInName.Accent5_40,A.IStyle.BuiltInName.Accent5_60,A.IStyle.BuiltInName.Accent5])),z.push(R("Accent 6",[A.IStyle.BuiltInName.Accent6_20,A.IStyle.BuiltInName.Accent6_40,A.IStyle.BuiltInName.Accent6_60,A.IStyle.BuiltInName.Accent6])),N.push((O="Themed Cell Styles",H=z,e.jsxs(B.Box,{children:[e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.ExhibitMenuHeader,{children:O},O+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:H},O+"-presets")]},O))),N.push(E("Number Format",[A.IStyle.BuiltInName.Comma,A.IStyle.BuiltInName.Comma0,A.IStyle.BuiltInName.Currency,A.IStyle.BuiltInName.Currency0,A.IStyle.BuiltInName.Percent])),e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:I=>`${I.shape.borderRadius}px`,paddingBottom:I=>`${I.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:N}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{variant:w.CommandButtonType.Menuitem,commandState:u,command:v.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:p})]})},[u,f?.().getTheme(),m]),x=w.useCallbackRef(j=>{const v=18/A.IFont.getDeviceScale(),T=C?.createTemporaryCell(j);return T.getStyle().getFont().getSize()<=v?T:T.createTemporaryCell({style:{font:{size:v}}})},[C?.createTemporaryCell]),h=p||!t||t.disabled(),k=n.useMemo(()=>C&&c?e.jsx(qa,{value:u?.getName()??"Custom",cellStyle:u?{named:u.getName()}:void 0,styles:C.styles(),createTemporaryCell:x,bodyStyle:C.bodyStyle(),className:"outline-hover",disabled:h,sx:{marginRight:"4px",borderRadius:"2px",minHeight:"calc(100% - 2px)",overflow:"hidden",outline:j=>`1px solid ${j.palette.action.hover}`},borderProps:{style:{height:"calc(100% - 2px)",width:"calc(100% - 1px)"}}}):t?.icon(),[u,m,h,t]);return e.jsx(y.CommandPopupButton,{ref:i,createPopupPanel:S,outlined:c,commands:o,createTooltip:({children:j},v)=>e.jsx(y.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:v,children:j}),selected:!1,disabled:h,label:t?.label(),icon:k,...g})})),Xa="_sheetxl-reset_11z3j_1",Ki=10,Ko=n.memo(n.forwardRef((a,i)=>{const{styles:o,table:t,tableStyle:r=t?.getStyle()??o.getDefaultTableStyle(),bodyStyle:s,sx:d,disabled:p,className:l,forceThinBorder:c,cellHeight:g=Ki,isLive:C=!1,...f}=a,u=Math.ceil(1.3*g),[m,b]=n.useReducer(j=>j+1,0);n.useEffect(()=>{if(C&&t)return t.addListeners({onAnyChange:()=>{b()}})},[t,C]);const S=n.useMemo(()=>{let j=t?.toJSON()??{};const v={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return j&&(j.styleOptions={...j.styleOptions,name:r.getName()}),j.ref=v,new A.Table({initialAnchor:v,json:j,styles:o})},[m,t,r,o]),x=n.useMemo(()=>{const j=[];for(let v=0;v<5;v++)for(let T=0;T<5;T++){const M=S.getStyleAt({colIndex:T,rowIndex:v});j.push(M)}return j},[S]),h=n.useMemo(()=>{const j=(T,M,P)=>{let D=P.getFill().toCSS(s?.darkMode??!1);const F=u-(M<4?1:0),E=g-(T<4?1:0),R=P.getFont().getFill().toCSS(s?.darkMode??!1);return D={...D,position:"absolute",boxSizing:"border-box",left:M*(u-1),top:T*(g-1),width:F,height:E},e.jsx("td",{className:`table-style-fill ${T}-${M}`,style:D,children:e.jsx("div",{className:`table-style-text ${T}-${M}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(F-6)/2,top:(E-1)/2,borderTop:`1px solid ${R}`}})},`${T}-${M}`)},v=[];for(let T=0;T<5;T++){const M=[];for(let P=0;P<5;P++){const D=x[5*T+P];M.push(j(T,P,D))}v.push(e.jsx("tr",{children:M},T))}return v},[S,r,s]),k=n.useCallback((j,v)=>x[v].getBorder()??null,[x]);return e.jsx(B.Box,{ref:i,className:"table-format-preview",sx:{background:s?.fill,filter:p?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...d},...f,children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:k,rowCount:5,columnCount:5,forceThinBorder:c,width:5*(u-1)+1,height:5*(g-1)+1,darkMode:s?.darkMode??!1,style:{pointerEvents:"none"},children:e.jsx("table",{className:ie(l,"sheetxl-table-preview",Xa),style:{borderCollapse:"collapse",width:5*(u-1)+1,height:5*(g-1)+1},children:e.jsx("tbody",{children:h})})})})})),St=(a,i,o,t,r)=>{a.beginPath(),a.moveTo(i+.5,o+.5),a.lineTo(t+.5,r+.5),a.stroke()},Ya=n.memo(n.forwardRef((a,i)=>{const{table:o,tableStyle:t,styles:r,bodyStyle:s,disabled:d,style:p,className:l,canvas:c,...g}=a,C=n.useMemo(()=>{const m=o.toJSON(),b={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return m.styleOptions={...m.styleOptions,name:t.getName()},m.ref=b,new A.Table({initialAnchor:b,json:m,styles:r})},[o,t,r]),f=n.useMemo(()=>{const m=[];for(let b=0;b<5;b++)for(let S=0;S<5;S++){const x=C.getStyleAt({colIndex:S,rowIndex:b});m.push(x)}return m},[C]),u=n.useMemo(()=>{let m=c;if(c||(m=document.createElement("canvas")),!m)return null;m.width!==61&&(m.width=61),m.height!==46&&(m.height=46);const b=m.getContext("2d",{alpha:!1});if(!b)return null;const S=12,x=s?.darkMode??!1;for(let h=0;h<5;h++)for(let k=0;k<5;k++){const j=f[5*h+k].getFill();let v=s?.fill;j.getType()===A.IFill.Type.Solid?v=j.getColor().toCSS(x,!1):j.getType()===A.IFill.Type.Gradient?v=j.getStops[0]?.color.toCSS(x,!1):j.getType()===A.IFill.Type.Pattern&&(v=j.getForeground().toCSS(x,!1)),b.fillStyle=v;const T=k*S,M=9*h;b.fillRect(T,M,13,10)}b.lineWidth=1;for(let h=0;h<5;h++)for(let k=0;k<5;k++){const j=f[5*h+k],v=k*S,T=9*h,M=j.getBorder();if(!M.isEmpty()){const F=M.getLeft();F.isNone()||(b.strokeStyle=F.getColor().toCSS(x,!1),St(b,v,T,v,T+9));const E=M.getTop();E.isNone()||(b.strokeStyle=E.getColor().toCSS(x,!1),St(b,v,T,v+S,9*h));const R=M.getRight();R.isNone()||(b.strokeStyle=R.getColor().toCSS(x,!1),St(b,v+S,T,v+S,T+9));const N=M.getBottom();N.isNone()||(b.strokeStyle=N.getColor().toCSS(x,!1),St(b,v,T+9,v+S,T+9))}b.strokeStyle=j.getFont().getFill().toCSS(x,!1);const P=4,D=2.5;St(b,k*S+D,9*h+P,k*S+D+7,9*h+P)}return`url(${m.toDataURL()})`},[c,C,t,s]);return e.jsx("div",{ref:i,className:ie("table-style-preview",l),style:{backgroundImage:u,width:61,height:46,...p},...g})})),Ui="_table-style-options-container_1kfn2_1",qi="_table-style-options_1kfn2_1",Za=n.memo(n.forwardRef((a,i)=>{const{styleOptions:o,onStyleOptionsChange:t,showHeaderRow:r,onShowHeaderRowChange:s,showTotalRow:d,onShowTotalRowChange:p,showFilterButton:l,onShowFilterButtonChange:c,sx:g,className:C,disabled:f,...u}=a;return e.jsx("div",{className:Ui,children:e.jsxs(B.Box,{sx:{pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:m=>`${m.spacing(2)}`,marginRight:m=>`${m.spacing(2)}`},"& .MuiCheckbox-root":{padding:m=>`${m.spacing(.5)}`},...g},...u,ref:i,className:ie(C,qi),children:[s&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>s(!r),disabled:f||r==null}),label:"Header Row",labelPlacement:"end"}),p&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:d??!1,indeterminate:d==null,onChange:()=>p(!d),disabled:f||d==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:o?.showRowStripes??!1,indeterminate:!o,disabled:f||!o,onChange:()=>{t?.({...o,showRowStripes:!o?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:o?.showFirstColumn??!1,indeterminate:!o,disabled:f||!o,onChange:()=>{t?.({...o,showFirstColumn:!o?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:o?.showLastColumn??!1,indeterminate:!o,disabled:f||!o,onChange:()=>{t?.({...o,showLastColumn:!o?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:o?.showColumnStripes??!1,indeterminate:!o,disabled:f||!o,onChange:()=>{t?.({...o,showColumnStripes:!o?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),c&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:l??!1,indeterminate:l==null,disabled:f||!o||l==null,onChange:()=>c(!l)}),label:"Filter Button",labelPlacement:"end"})]})})}));function bo(a,i){if(typeof a=="function")return a(i);a&&(a.current=i)}var tt=parseInt(n.version.split(".")[0],10)>=19?function(a){return i=>{const o=[];for(const t of a){const r=bo(t,i),s=typeof r=="function";o.push(s?r:()=>bo(t,null))}return()=>{for(const t of o)t()}}}:function(a){return i=>{for(const o of a)bo(o,i)}},Gi=function(){},Qa=typeof window<"u",ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xi=Qa?n.useLayoutEffect:n.useEffect,Mn={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const _e=Qa&&window.ResizeObserver!==void 0?function(){var a=n.useState(null),i=a[0],o=a[1],t=n.useState(Mn),r=t[0],s=t[1],d=n.useMemo(function(){return new window.ResizeObserver(function(p){if(p[0]){var l=p[0].contentRect,c=l.x,g=l.y,C=l.width,f=l.height,u=l.top,m=l.left,b=l.bottom,S=l.right;s({x:c,y:g,width:C,height:f,top:u,left:m,bottom:b,right:S})}})},[]);return Xi(function(){if(i)return d.observe(i),function(){d.disconnect()}},[i]),[o,r]}:function(){return[Gi,Mn]},Yi="_range-row_akhf4_1",Zi="_action-row_akhf4_15",Ja=n.createContext(null);Ja.displayName="HookFormContext";const er=()=>n.useContext(Ja);typeof window<"u"?n.useLayoutEffect:n.useEffect;const Uo=n.memo(n.forwardRef((a,i)=>{const{disabled:o,style:t,className:r,sx:s,defaultInput:d,value:p,formName:l,formOptions:c,onChangeInput:g,onValidate:C,onKeyDown:f,...u}=a,m=er(),b=l&&m?m.register(l,c):null,[S,x]=n.useState(""),[h,k]=n.useState(""),[j,v]=n.useState(p);n.useEffect(()=>{v(p),k("")},[p]);const T=w.useCallbackRef(E=>{let R="";try{v(E),C?.(E),g?.(E)}catch(N){R=N.message??"Invalid Name"}l&&m&&(R?m.setError(l,{message:R}):m.clearErrors(l)),k(R)},[p,C,g]),M=w.useCallbackRef(async E=>{E.keyCode===w.KeyCodes.Escape&&S!==p&&(T(S),m?.setValue(l,S),m?.clearErrors(l),E.stopPropagation()),f?.(E)},[f,S,p,m]),P=w.useCallbackRef(E=>{x(E.target.value??"")},[]),D=w.useCallbackRef(E=>{x(""),b?.onBlur(E)},[]),F=n.useCallback(E=>{T(E.target.value),b?.onChange(E)},[b]);return e.jsx(B.FormControl,{sx:{paddingTop:E=>E.spacing(1.5),minWidth:135,width:"100%",...s},size:"small",ref:i,className:ie("named-input",r),...u,children:e.jsx(B.TextField,{label:"Name",placeholder:d,onFocus:P,onBlur:D,inputRef:b?.ref,disabled:o,error:!!h,helperText:h||" ",sx:{"& .MuiFormHelperText-root":{marginTop:E=>E.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:"autoFocus",name:l,spellCheck:!1,autoComplete:"off",readOnly:o,sx:{paddingTop:E=>E.spacing(1.25),paddingBottom:E=>E.spacing(.75),backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`}}},value:j??"",onChange:F,onKeyDownCapture:M,onContextMenu:E=>{E.stopPropagation()}})})}));Uo.displayName="NamedInput";const Wt=a=>a===null?"":a.toString(),qo=n.memo(n.forwardRef((a,i)=>{const{formName:o,formOptions:t,disabled:r,style:s,className:d,sx:p,onKeyDown:l,value:c,onChangeInput:g,resolvedAddress:C,...f}=a,u=er(),m=o&&u?u.register(o,t):null,[b,S]=n.useState(""),[x,h]=n.useState(!1),[k,j]=n.useState(()=>Wt(c));n.useEffect(()=>{j(Wt(c)),S(""),o&&u&&u.clearErrors(o),h(!1)},[c]);const v=w.useCallbackRef(R=>{let N="";try{j(R);const z=Wt(c),O=C(R);O.toString()!==z&&g?.(O)}catch{N="Invalid Range"}o&&u&&(N?u.setError(o,{message:N}):u.clearErrors(o)),S(N),h(!0)},[k,g,o,u]),T=w.useCallbackRef(async R=>{if(x&&R.keyCode===w.KeyCodes.Escape){const N=Wt(c);j(N),S(""),h(!1),R.stopPropagation()}l?.(R)},[c,g,l,x]),M=w.useCallbackRef(R=>{m?.onBlur(R)},[m]),P=n.useCallback(R=>{v(R.target.value),m?.onChange(R)},[m]),[D,F]=n.useState(!1),E=n.useMemo(()=>e.jsx(B.InputAdornment,{tabIndex:-1,sx:{display:"flex",position:"relative",flex:"0"},position:"end",children:e.jsx(y.ExhibitOptionButton,{disabled:!0,selected:D,onSelectToggle:R=>{F(R)},label:"Select Range",icon:e.jsx(w.DynamicIcon,{iconKey:"SelectRangeMode"})})}),[D]);return e.jsx(B.FormControl,{sx:{paddingTop:R=>R.spacing(1.5),minWidth:135,width:"100%",...p},size:"small",ref:i,className:ie("range-input",d),...f,children:e.jsx(B.TextField,{label:"Range",placeholder:"Enter Range",onBlur:M,disabled:r,error:!!b,inputRef:m?.ref,helperText:b||" ",sx:{"& .MuiFormHelperText-root":{marginTop:R=>R.spacing(.5)}},slotProps:{input:{endAdornment:E},inputLabel:{shrink:!0},htmlInput:{spellCheck:!1,autoComplete:"off",readOnly:r,name:o,sx:{paddingTop:R=>R.spacing(1.25),paddingBottom:R=>R.spacing(.75)}}},value:k??"",onChange:P,onKeyDownCapture:T,onContextMenu:R=>{R.stopPropagation()}})})}));qo.displayName="RangeInput";const Be=[];Be.push(De("Primary Background","bg1")),Be.push(De("Primary Text","tx1")),Be.push(De("Secondary Background","bg2")),Be.push(De("Secondary Text","tx2")),Be.push(De("Accent 1","accent1")),Be.push(De("Accent 2","accent2")),Be.push(De("Accent 3","accent3")),Be.push(De("Accent 4","accent4")),Be.push(De("Accent 5","accent5")),Be.push(De("Accent 6","accent6"));const tr=a=>{const{docTheme:i,onSelectTheme:o,darkMode:t,isSelected:r,outlined:s,sx:d,...p}=a,l=q.useTheme(),c=n.useMemo(()=>{let g=[];for(let C=0;C<Be.length;C++){const f=Be[C];g.push(e.jsx(io,{schemeColorLookup:i.schemeLookup(),colorDef:f,darkMode:t,selectedColor:null},C+"-colorDef"))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(B.Box,{sx:{display:"flex",boxShadow:C=>C.shadows[2]},children:g})})},[i,l]);return e.jsx(y.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:g=>`solid ${r?g.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:g=>`solid ${g.palette.text.primary} 1px !important`}},icon:null,...p,children:e.jsxs(B.Box,{sx:{border:g=>`solid ${g.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:g=>r?g.palette.text.primary:void 0,"&:hover:not([disabled])":{color:g=>g.palette.text.primary}},children:[e.jsx(B.Box,{sx:{},children:i.getName()}),e.jsxs(B.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[c,e.jsx(B.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>i.getFontScheme().getMajorFont()},children:e.jsx(y.SimpleTooltip,{disableInteractive:!0,slotProps:{popper:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}}},title:e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
6
+ */const A=require("@sheetxl/sdk"),oe=require("@sheetxl/react"),e=require("react/jsx-runtime"),n=require("react"),B=require("@mui/material"),y=require("@sheetxl/utils-mui"),w=require("@sheetxl/utils-react"),q=require("@mui/material/styles"),Re=require("@mui/system"),et=require("react-dom"),je=require("@sheetxl/utils"),dt=require("@sheetxl/io");function ka(a){var i,o,t="";if(typeof a=="string"||typeof a=="number")t+=a;else if(typeof a=="object")if(Array.isArray(a)){var r=a.length;for(i=0;i<r;i++)a[i]&&(o=ka(a[i]))&&(t&&(t+=" "),t+=o)}else for(o in a)a[o]&&(t&&(t+=" "),t+=o);return t}function ie(){for(var a,i,o=0,t="",r=arguments.length;o<r;o++)(a=arguments[o])&&(i=ka(a))&&(t&&(t+=" "),t+=i);return t}const va=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...p}=a,l=w.useCommands(o,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),c=n.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f];return l[0]},[l]),g=n.useMemo(()=>{if(!t)return null;const f={...t};return delete f.beforeExecute,f},[t]),C=n.useCallback((f,u)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},b=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignLeftToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignCenterToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignRightToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignJustifyToggle")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignCenterContinuousToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignFillToggle")}),e.jsx(y.CommandButton,{...m,command:u.getCommand("formatAlignDistributedHorizontalToggle")})]}),S=e.jsxs(B.Box,{sx:{className:ie("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:h=>h.stopPropagation(),children:[e.jsx(y.CommandButton,{command:u.getCommand("formatIndentDecrease"),commandHook:g,scope:r,disabled:s}),e.jsx(y.CommandButton,{command:u.getCommand("formatIndentIncrease"),commandHook:g,scope:r,disabled:s})]}),x=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[S,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})]});return y.defaultCreatePopupPanel({...f,children:x})},[s,t]);return e.jsx(y.CommandPopupButton,{ref:i,parentFloat:d,commands:o,commandHook:t,scope:r,createPopupPanel:C,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:c?.key(),icon:c?.icon()??"FormatAlignLeft",...p})})),ja=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),{activeCommand:l,allDisabled:c}=n.useMemo(()=>{const C=p.length;let f,u=0;for(let m=0;m<C;m++){const b=p[m];b&&!b.disabled()&&(!f&&b?.state()&&(f=b),u++)}return f=f??p[0],{activeCommand:f,allDisabled:u===0}},[p]),g=n.useCallback((C,f)=>{const u={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},m=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignTopToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignMiddleToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignBottomToggle")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignJustifyVerticalToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatAlignDistributedVerticalToggle")})]});return y.defaultCreatePopupPanel({...C,children:m})},[s,t]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,createPopupPanel:g,disabled:s||c,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:l?.icon()??"TextVerticalBottom",...d})})),Ta=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),{activeCommand:l,allDisabled:c}=n.useMemo(()=>{const C=p.length;let f,u=0;for(let m=0;m<C;m++){const b=p[m];b&&!b.disabled()&&(!f&&b?.state()&&(f=b),u++)}return f=f??p[0],{activeCommand:f,allDisabled:u===0}},[p]),g=w.useCallbackRef((C,f)=>{const u={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},m=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextOverflowVisibleToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextOverflowWrapToggle")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextOverflowClipToggle")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextOverflowShrinkToggle")})]});return y.defaultCreatePopupPanel({...C,children:m})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,disabled:s||c,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:g,icon:l?.icon()??"TextHorizontalOverflow",...d})})),Ea=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),l=n.useMemo(()=>{const C=p.length;for(let f=0;f<C;f++){const u=p[f];if(u?.state())return u}return p[1]},[p]),c=n.useCallback((C,f)=>{const u={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},m=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate0")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate315")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate45")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate90")}),e.jsx(y.CommandButton,{...u,command:f.getCommand("formatTextRotate270")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.InputCommandButton,{...u,command:f.getCommand("formatTextRotateCustom"),label:"Custom"})]});return y.defaultCreatePopupPanel({...C,children:m})},[s,t,r,o]),g=n.useMemo(()=>(o.getCommand("formatTextRotateCustom")?.state()??0)!==0,[p]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,selected:g,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:c,quickCommand:g?"formatTextRotate0":"formatTextRotate315",icon:l?.icon()??"TextRotation315",...d})})),Ba={Preset:"preset",Custom:"custom"},pt={Start:"start",End:"end"},xo={},Li=(a,i,o,t)=>{const r=a+"-"+i+"-"+o+(t?"-server":"");if(xo[r])return xo[r];const s=((d,p,l,c)=>{if(typeof document>"u"&&!c)return null;const g=c?new c:document.createElement("canvas");g.width=2*l,g.height=2*l;const C=g.getContext("2d");return C?(C.fillStyle=d,C.fillRect(0,0,g.width,g.height),C.fillStyle=p,C.fillRect(0,0,l,l),C.translate(l,l),C.fillRect(0,0,l,l),g.toDataURL()):null})(a,i,o,t);return xo[r]=s,s},zi={},Ra=n.memo(a=>{const{className:i,style:o=w.ReactUtils.EmptyCssProperties,white:t="transparent",grey:r="grey",size:s=8,borderRadius:d,boxShadow:p,renderers:l=zi,children:c,...g}=a,C=c,f=n.useMemo(()=>Object.assign({borderRadius:d,boxShadow:p,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${Li(t,r,s,l?.canvas)}) center left`},o),[t,r,s,l]);return n.isValidElement(c)?n.cloneElement(c,{...C.props}):e.jsx("div",{style:f,...g})}),Hi=n.memo(a=>{const{selectedColor:i,onSelectColor:o,onPreviewColor:t,onClick:r,onKeyDown:s,onMouseOver:d,onMouseLeave:p,onFocus:l,style:c=w.ReactUtils.EmptyCssProperties,children:g,alphaWhite:C,alphaGrey:f,darkMode:u,alphaCheckSize:m=7,...b}=a;if(!i)throw new Error("a selectedColor is required");const S=n.useCallback(T=>{r?.(T),T.isDefaultPrevented()||(T.ctrlKey?t?.(i.toRGBA()):o?.(i.toRGBA()))},[o,t,r,i]),x=n.useCallback(T=>{d?.(T),T.isDefaultPrevented()||t?.(i.toRGBA())},[t,d,i]),h=n.useCallback(T=>{p?.(T),T.isDefaultPrevented()},[t,p]),k=n.useCallback(T=>{l?.(T),T.isDefaultPrevented()||t?.(i.toRGBA())},[t,l,i]),j=n.useCallback(T=>{s?.(T),T.isDefaultPrevented()||T.keyCode===w.KeyCodes.Enter&&o?.(i.toRGBA())},[o,s,i]),v=n.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Ra,{size:m,white:C,grey:f,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[C,f,i]);return e.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...c},tabIndex:0,...b,onClick:S,onKeyDown:j,onMouseOver:x,onMouseLeave:h,onFocus:k,children:[v,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(u)},children:g})]})}),io=n.memo(a=>{const{schemeColorLookup:i,selectedColor:o,previewColor:t,colorDef:r,onSelectColorDef:s,onPreviewColorDef:d,swatchProps:p,defaultButtonSize:l=24,isLarge:c=!1,compareRGB:g=!1,darkMode:C=!1,...f}=a,u=new A.Color({val:r.definition.val,adjs:r.definition.adjs},v=>i(v)),m=g?u.toRGBA().toString():u.toString(),b=o&&(g?o.toRGBA().toString():o.toString())===m,S=t&&(g?t.toRGBA().toString():t.toString())===m,x=[];x.push({[A.IColor.AdjustmentType.Inv]:!0}),x.push({[A.IColor.AdjustmentType.Alpha]:100});const h=u.adjust(x),k=n.useCallback(()=>{s?.(r)},[s,r]),j=n.useCallback(v=>{d?.(v?r:null)},[d,r]);return e.jsx(y.SimpleTooltip,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:r.description,placement:"bottom-start",children:e.jsx("div",{style:{width:l*(c?1.2:1)+"px",height:l*(c?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...f,children:e.jsxs(Hi,{selectedColor:u,title:null,onSelectColor:k,onPreviewColor:j,alphaCheckSize:c?9:void 0,darkMode:C,...p,children:[e.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:h.toRGBA(C).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:b?"1":"0"}}),e.jsx("div",{style:{position:"absolute",width:.33*l*(c?1.2:1)+"px",height:.33*l*(c?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:h.toRGBA(C).toString(),borderRadius:"50%",opacity:S?"1":"0"}})]})})})}),Dt=n.memo(a=>{const{title:i,schemeColorLookup:o,colorDefs:t,selectedColor:r,previewColor:s,onSelectColorDef:d,onPreviewColorDef:p,style:l=w.ReactUtils.EmptyCssProperties,compareRGB:c=!1,darkMode:g,swatchProps:C,...f}=a;let u;if(Array.isArray(t[0]))u=t;else{u=[];for(let h=0;h<t.length;h++)u.push([t[h]])}const m=n.useCallback(h=>{d?.(h)},[d]),b=n.useCallback(h=>{p?.(h)},[p]),S=n.useMemo(()=>{let h=[];for(let k=0;k<u.length;k++){let j=[],v=u[k];for(let M=0;M<v.length;M++){let P=v[M];j.push(e.jsx(io,{schemeColorLookup:o,colorDef:P,selectedColor:r,previewColor:s,onSelectColorDef:m,onPreviewColorDef:b,swatchProps:C,compareRGB:c,darkMode:g},k+" "+M))}let T=e.jsx(B.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:M=>M.shadows[2],borderRadius:"2px",overflow:"hidden"},children:j},""+k);h.push(T)}return h},[u,r,s,m,b]),x=n.useMemo(()=>i?e.jsx(B.Typography,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:h=>h.palette.text.secondary},children:i}):null,[i]);return e.jsxs(B.Box,{style:{...l},children:[x,e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...f,children:S})]})}),De=(a,i)=>({description:a,definition:{val:i,adjs:[]}}),ge=(a,i,o,t,r,s)=>{const d=De(a,i);t?.push(d);const p=new A.Color({val:d.definition.val,adjs:d.definition.adjs},o),l=p.toString();r?.set(l,p);const c=p.toRGBA().toString();s?.set(c,p)},Wi=n.lazy(()=>Promise.resolve().then(()=>require("./B4g0GjoE6uIK7JP6.cjs"))),Pa=n.memo(n.forwardRef((a,i)=>{const{selectedColor:o=null,previewColor:t=a.selectedColor??null,recentColors:r,schemeLookup:s,disableAlpha:d=!1,previewDebounceTime:p=100,initialPanelType:l,defaultButtonSize:c=24,width:g,onElementLoad:C,onDone:f,onEyeDropStart:u,onEyeDropStop:m,onPreviewColor:b,onPreviewColorImmediate:S,onSelectColor:x,autoColor:h,autoColorLabel:k="Automatic",autoColorPosition:j=pt.Start,compareRGB:v=!1,darkMode:T=!1,...M}=a,P=t||o,D=w.useCallbackRef(b,[b]),F=w.useCallbackRef(S,[S]),E=w.useCallbackRef(x,[x]),R=w.useCallbackRef(u,[u]),N=w.useCallbackRef(m,[m]),[z,O]=n.useState(!1),H=q.useTheme(),I=n.useMemo(()=>s||A.Color.getDefaultSchemeLookup(),[s]),W=n.useMemo(()=>{const K=new Map,te=new Map,de=[];ge("Primary Background","bg1",I,de,K,te),ge("Primary Text","tx1",I,de,K,te),ge("Secondary Background","bg2",I,de,K,te),ge("Secondary Text","tx2",I,de,K,te),ge("Accent 1","accent1",I,de,K,te),ge("Accent 2","accent2",I,de,K,te),ge("Accent 3","accent3",I,de,K,te),ge("Accent 4","accent4",I,de,K,te),ge("Accent 5","accent5",I,de,K,te),ge("Accent 6","accent6",I,de,K,te);const ve=A.ITheme.buildPalette(de,I,K,te),se=[];if(ge("Dark Red","C00000",I,se,K,te),ge("Red","FF0000",I,se,K,te),ge("Orange","FFC000",I,se,K,te),ge("Yellow","FFFF00",I,se,K,te),ge("Light Green","92D050",I,se,K,te),ge("Green","00B050",I,se,K,te),ge("Light Blue","00B0F0",I,se,K,te),ge("Blue","0070C0",I,se,K,te),ge("Dark Blue","002060",I,se,K,te),d?ge("Purple Is A Fruit","7030A0",I,se,K,te):ge("Transparent","00000000",I,se,K,te),h){const ue=h.toString();K.set(ue,h)}const Fe=new Map,Te=typeof r=="function"?r():r,Oe=[];for(let ue=0;Te&&ue<Te.length;ue++){const Z=Te[ue].toString();Fe.set(Z,Te[ue]),Oe.push({description:"Recent "+(ue+1),definition:{val:Te[ue].toString()}})}return{primaryColors:de,modifiedPresets:ve,standardColors:se,recentColorsLimited:Oe,mapAllPresets:K,mapAllPresetsRGB:te,mapRecent:Fe}},[I,r,d,h]);n.useEffect(()=>{C?.()},[]);const[ee,X]=n.useState(!1),ne=n.useCallback(()=>{X(K=>!K)},[]);n.useEffect(()=>{if(l)X(l===Ba.Custom);else if(o){let K=o.toString(),te=W.mapAllPresets.get(K);te||(K=o.toRGBA().toString(),te=W.mapAllPresetsRGB.get(K));const de=W.mapRecent.get(K);X(!te&&!de)}},[o,l]);const $=n.useCallback(A.CommonUtils.debounce(K=>{D?.(K)},p),[D,p]),[U,Y]=n.useState();n.useEffect(()=>{Y(t||o)},[t,o]);const _=w.useCallbackRef(K=>{F&&(F(K),$(K))},[F]),L=w.useCallbackRef(K=>{_(K?new A.Color({val:K.definition.val,adjs:K.definition.adjs},I):null)},[I]),G=n.useCallback(K=>{K.ctrlKey&&X(!0)},[]),Q=w.useCallbackRef(K=>{let te=!1;if(K){const de=K.toString();te=!W.mapAllPresets.has(de)}E?.(K,te)},[E,W]),fe=w.useCallbackRef(K=>{const te=K?new A.Color({val:K.definition.val,adjs:K.definition.adjs},I):null;Promise.resolve(f?.()).then(()=>{Q(te)})},[I,f]),re=w.useCallbackRef(K=>{_(K?new A.Color(K,I):null)},[I]),me=n.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(B.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:K=>K.palette.text.icon??K.palette.action.active},onClick:async()=>{O(!0),R?.(),await new EyeDropper().open().then(K=>{O(!1),N?.();let te=new A.Color(K.sRGBHex),de=te.toString(),ve=W.mapAllPresets.get(de);if(ve||(de=te.toRGBA().toString(),ve=W.mapAllPresetsRGB.get(de)),!ve){const se=te.toRGBA(),Fe=3;let Te=255;W.mapAllPresetsRGB.forEach((Oe,ue)=>{const Z=Oe.toRGBA(),le=Math.abs(Z.red-se.red)+Math.abs(Z.blue-se.blue)+Math.abs(Z.green-se.green);le<Fe&&le<Te&&(ve=Oe)})}X(!ve),_(ve||te)}).catch(K=>{O(!1),K?.name!=="AbortError"&&console.error(K)})},children:e.jsx(w.DynamicIcon,{iconKey:"Colorize"})}),[W,T]),Se=n.useMemo(()=>{if(!ee)return;const K={opacity:ee?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return e.jsx(n.Suspense,{fallback:e.jsx("div",{style:K,children:e.jsx(y.LoadingPanel,{})}),children:e.jsx(Wi,{style:K,selectedColor:P?P.toRGBA().toString():"transparent",onColorChange:re,disableAlpha:d})})},[ee,P]),Ce=n.useMemo(()=>({onClick:G,alphaGrey:H.palette.text.icon??H.palette.action.active}),[G,H]),J=n.useMemo(()=>{if(!h)return null;const K={description:k,definition:{val:h.getVal(),adjs:h.getAdjustments()}};return e.jsx(e.Fragment,{children:e.jsxs(B.MenuItem,{sx:{display:"flex",color:te=>te.palette.text.secondary},onMouseOver:()=>{L(null)},onClick:()=>{fe(null)},children:[e.jsx(B.Box,{sx:{flex:"none",boxShadow:te=>te.shadows[2],borderRadius:te=>te.spacing(.5),overflow:"hidden"},children:e.jsx(io,{schemeColorLookup:I,colorDef:K,selectedColor:o===null?h:o,previewColor:t===null?h:t,defaultButtonSize:c,isLarge:!0,darkMode:T,compareRGB:v,swatchProps:Ce})}),e.jsx(B.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:k})]})})},[h,k,I,o,t]);return e.jsxs(B.Box,{ref:i,sx:{width:g,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...M,children:[e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("div",{style:{opacity:ee?"0":1},children:[J&&j===pt.Start?e.jsxs(e.Fragment,{children:[J,e.jsx(B.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Dt,{title:"Theme Colors",schemeColorLookup:I,colorDefs:W.primaryColors,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsx(Dt,{schemeColorLookup:I,colorDefs:W.modifiedPresets,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Dt,{title:"Standard Colors",schemeColorLookup:I,colorDefs:W.standardColors,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsxs("div",{style:{opacity:W.recentColorsLimited.length===0?"0":void 0,display:W.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Dt,{title:"Recent Colors",schemeColorLookup:I,colorDefs:W.recentColorsLimited,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T})]}),J&&j===pt.End?e.jsxs(e.Fragment,{children:[e.jsx(B.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),J,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Se]}),e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[me,e.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),e.jsx(B.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{ne()},children:ee?e.jsx("div",{children:"Preset"}):e.jsx("div",{children:"Custom"})}),e.jsx(B.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(f?.()).then(()=>{Q(U)})},children:"Done"})]})]})})),$i=e.jsx(w.DynamicIcon,{iconKey:"circle.colored"}),Ao=n.memo(n.forwardRef((a,i)=>{const{selectedColor:o,quickColor:t,icon:r=$i,tooltip:s,label:d,onPreviewColor:p,onPreviewColorImmediate:l,onSelectColor:c,variant:g=y.PopupButtonType.Toolbar,panelProps:C,shouldCloseFloatAll:f=!0,compareRGB:u=!1,darkMode:m=!1,...b}=a,S=w.useCallbackRef(p,[p]),x=w.useCallbackRef(l,[l]),h=w.useCallbackRef(c,[c]),[k,j]=n.useState(()=>{}),v=t||k||o||C?.autoColor,T=n.useRef(!1),M=n.useCallback(()=>{},[]),P=w.useCallbackRef(()=>{j(o)},[o]),D=w.useCallbackRef(W=>{T.current||(j(W),S?.(W))},[S]),F=w.useCallbackRef(W=>{T.current||(j(W),x?.(W))},[x]),E=w.useCallbackRef((W,ee)=>{T.current||(j(void 0),h?.(W,ee))},[h]),R=n.useMemo(()=>e.jsx(B.Box,{className:"color-wrapper",sx:{lineHeight:"0",color:"inherit","--sxl-color-active":`${v?.toCSS(m)??"transparent"}`,"& .activeColor":{fill:`${v?.toCSS(m)??"transparent"}`},"& .style_grey":{fill:W=>W.palette.text.icon??W.palette.action.active}},children:typeof r=="function"?r():r}),[v,r,m]),N=w.useCallbackRef(W=>{h?.(t,!1)},[h,t]),[z,O]=n.useState(!1),H=n.useCallback(W=>{const{closeFloat:ee,closeFloatAll:X}=W;return e.jsx(Pa,{...C,selectedColor:o,previewColor:k,onDone:f?X:ee,onKeyDown:ne=>{ne.which===w.KeyCodes.Enter&&(f?X():ee())},onPreviewColorImmediate:F,onPreviewColor:D,onSelectColor:E,onEyeDropStart:()=>O(!0),onEyeDropStop:()=>O(!1),compareRGB:u,darkMode:m})},[o,k,f,v,C?.autoColor,m]),I={onQuickClick:t?N:void 0,createPopupPanel:H,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:P,onPopupClose:M,tooltip:s||d||"Color",label:d,icon:R,...b};return g===y.PopupButtonType.Toolbar?e.jsx(y.ExhibitPopupIconButton,{ref:i,...I}):e.jsx(y.ExhibitPopupMenuItem,{ref:i,...I})})),eo=82,Mo=a=>{const{styleColor:i,length:o=eo,width:t=1,dashArray:r=null,sx:s,isDouble:d=!1,isAngled:p=!1,darkMode:l=!1,...c}=a;return e.jsx(B.SvgIcon,{sx:{width:`${o}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:g=>`${i?i.toRGBA(l).toString():g.palette.text.icon??g.palette.action.active}`},"& .style_grey":{stroke:g=>g.palette.text.icon??g.palette.action.active},...s},height:t,width:o,viewBox:`0 0 ${o} ${t}`,...c,children:e.jsx(oe.StyledStrokePath,{length:o,width:t,dashArray:r,isDouble:d,isAngled:p,className:"activeColor"})})},Ma=n.memo(n.forwardRef((a,i)=>{const{variant:o,showLabels:t=!1,disabled:r=!1,createPopupPanel:s,styleColor:d,selectedStyle:p,onSelectStyle:l,showNone:c=!0,darkMode:g,sx:C,...f}=a,u=w.useCallbackRef(l,[]),m=n.useCallback(h=>{const{popupContainer:k,floatReference:j,closeFloat:v,...T}=h,M=[],P=A.IBorder.BuiltInDefinitionsArray;for(let D=0;D<P.length;D++){const F=P[D];if(F.description==="None"&&!c)continue;const E=e.jsx(Mo,{styleColor:d,length:eo,width:F.width,darkMode:g,dashArray:F.pattern,isDouble:F.description.toLowerCase().includes("double"),isAngled:F.description.toLowerCase().includes("slant")});let R=null;R=t?e.jsxs(e.Fragment,{children:[e.jsx(B.Box,{sx:{marginRight:"6px"},children:F.description}),e.jsxs(B.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[e.jsx("div",{style:{flex:"1 1 100%"}}),E]})]}):F.description==="None"?"None":E,M.push(e.jsx(y.ExhibitMenuItem,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:y.createStrokeShadowFilter(4)},paddingLeft:"16px",background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`},tooltipProps:{description:t?"":F.description},icon:null,disabled:r,onMouseDown:N=>N.preventDefault(),onMouseUp:()=>{v(),u(F.style)},onKeyDown:N=>{N.which===w.KeyCodes.Enter&&v()},selected:F.style===p,parentFloat:j,children:R},D))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:M})},[r,c,d,p,g]),b=n.useMemo(()=>{const h=A.IBorder.BuiltInDefinitions.get(p);let k;return k=h.description==="None"?e.jsx(B.Box,{sx:{minWidth:`${eo}px`},children:"None"}):e.jsx(Mo,{styleColor:d,length:eo,width:h.width,dashArray:h.pattern,darkMode:g,isDouble:h.description.toLowerCase().includes("double"),isAngled:h.description.toLowerCase().includes("slant")}),e.jsx(B.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:y.createStrokeShadowFilter()}},children:k})},[p,d]),S=n.useMemo(()=>A.IBorder.BuiltInDefinitions.get(p),[p]),x={disabled:r,icon:b,tooltip:"Border Style: "+S.description,sx:{background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,...C},createPopupPanel:m,...f};return o===y.PopupButtonType.Toolbar?e.jsx(y.ExhibitPopupIconButton,{...x}):e.jsx(y.ExhibitPopupMenuItem,{...x})})),Da=n.memo(n.forwardRef((a,i)=>{const{autoColor:o=null,schemeLookup:t,autoStrokeStyle:r=A.IBorder.StrokeStyle.Thin,disabled:s=!1,darkMode:d=!1,showStylingBefore:p=!0,onSelectBorder:l,onPreviewBorder:c,selectedBorder:g,createTemporaryBorder:C,...f}=a,u=w.useCallbackRef(l,[l]),m=w.useCallbackRef(c,[c]),[b,S]=n.useState(),[x,h]=n.useState(),k=b??r,j=x??o,v=g||{bottom:{style:r,color:o?.toString()}},T=w.useCallbackRef(R=>{const N={},z=R?Object.keys(R):[];let O=!1;const H=z.length;for(let Y=0;Y<H;Y++){const _=z[Y];R[_]?.style&&(N[_]={style:R[_].style,color:R[_].color},O||N[_].style===A.IBorder.StrokeStyle.None||(O=!0))}z.length<6&&(O=!0);const I=O?N.left:null,W=O?N.top:null,ee=O?N.right:null,X=O?N.bottom:null,ne=O?N.vertical:null,$=O?N.horizontal:null;let U="";return W||I||(U+="M 3,5 H 5 V 3 H 3 "),W||(U+="M 7,5 H 9 V 3 H 7 "),W||ne||(U+="M 11,5 h 2 V 3 h -2 "),W||(U+="M 15,5 h 2 V 3 h -2 "),W||ee||(U+="M 19,5 h 2 V 3 h -2 "),I||(U+="M 3,9 H 5 V 7 H 3 "),ne||(U+="M 11,9 h 2 V 7 h -2 "),ee||(U+="M 19,9 h 2 V 7 h -2 "),$||I||(U+="M 3,13 H 5 V 11 H 3 "),$||(U+="M 7,13 H 9 V 11 H 7 "),$||ne||(U+="M 11,13 h 2 v -2 h -2 "),$||ee||(U+="M 19,13 h 2 v -2 h -2 "),$||(U+="M 15,13 h 2 v -2 h -2 "),I||(U+="M 3,17 H 5 V 15 H 3 "),ne||(U+="M 11,17 h 2 v -2 h -2 "),ee||(U+="M 19,17 h 2 v -2 h -2 "),X||I||(U+="M 3,21 H 5 V 19 H 3 "),X||(U+="M 7,21 H 9 V 19 H 7 "),X||ne||(U+="M 11,21 h 2 v -2 h -2 "),X||(U+="M 15,21 h 2 v -2 h -2 "),X||ee||(U+="M 19,21 h 2 v -2 h -2 "),e.jsxs(w.DynamicIcon,{children:[" ",e.jsxs(B.Box,{className:"border-icon",sx:{width:"var(--icon-size, var(--icon-size-md))",height:"var(--icon-size, var(--icon-size-md))",position:"relative","& .grid > path":{opacity:"0.8"}},children:[e.jsx("svg",{viewBox:"0 0 24 24",className:"grid",style:{top:"0px",left:"0px",width:"calc(var(--icon-size, var(--icon-size-md)) + 1px)",height:"calc(var(--icon-size, var(--icon-size-md)) + 1px)",position:"absolute"},children:e.jsx("path",{className:"fill",d:U})}),e.jsx(B.Box,{className:"border-container",sx:{position:"absolute",display:"flex",justifyContent:"stretch",alignItems:"stretch",top:"0px",left:"0px",width:"var(--icon-size, var(--icon-size-md))",height:"var(--icon-size, var(--icon-size-md))",padding:"1px 1px","& svg path":{filter:y.strokeShadowFilter}},children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:(Y,_)=>{if(!C||z.length===0)return null;const L=Y.rowIndex,G=Y.colIndex,Q={};return L===0?(Q.top=N.top,Q.bottom=N.horizontal):(Q.top=N.horizontal,Q.bottom=N.bottom),G===0?(Q.left=N.left,Q.right=N.vertical):(Q.left=N.vertical,Q.right=N.right),C?.(Q)},darkMode:d,style:{top:"2px",left:"2px",width:"calc(100% - 5px)",height:"calc(100% - 5px)",position:"absolute"}})})]})]})},[j,k,d]),M=n.useCallback((R,N,z)=>{let O=null;if(R&&R.length>0){let H=null;(N||z)&&(H={style:z,color:N?.toString()??null}),O={};const I=R.length;for(let W=0;W<I;W++)O[R[W]]=H}return O},[]),P=n.useCallback(R=>{u?.(R)},[]),D=n.useCallback(R=>{m?.(R)},[]),F=n.useCallback(R=>{const{closeFloatAll:N,floatReference:z}=R,O=(W,ee,X="bottom",ne=!1)=>{const $=M(W,j??null,ne?A.IBorder.StrokeStyle.None:k??null),U=ne?M([],j??null,k??null):$;return e.jsx(y.ExhibitIconButton,{icon:T(U),sx:{background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`},tooltipProps:{label:ee,simple:!0,placement:X},onClick:()=>{N(),D($),P($)}})},H=e.jsxs(e.Fragment,{children:[e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom,A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical],"All Borders","top"),O([A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical],"Inner Borders","top"),O([A.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),O([A.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom],"Outside Borders","top")]}),e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[O([A.IBorder.Edge.Left],"Left Borders"),O([A.IBorder.Edge.Top],"Top Borders"),O([A.IBorder.Edge.Right],"Right Borders"),O([A.IBorder.Edge.Bottom],"Bottom Borders"),O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom,A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical,A.IBorder.Edge.DiagonalUp,A.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),I=e.jsx(e.Fragment,{children:e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[e.jsx(Ao,{variant:y.PopupButtonType.Toolbar,icon:e.jsx(w.DynamicIcon,{iconKey:"stroke.colored"}),selectedColor:k===A.IBorder.StrokeStyle.None?new A.Color("transparent"):j,onPreviewColor:W=>{h(W)},onSelectColor:(W,ee)=>{h(W)},darkMode:d,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:o,schemeLookup:t},disabled:s||k===A.IBorder.StrokeStyle.None,parentFloat:z,shouldCloseFloatAll:!1}),e.jsx(Ma,{selectedStyle:k,onSelectStyle:S,styleColor:j,darkMode:d,variant:y.PopupButtonType.Toolbar,parentFloat:z})]})});return e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:W=>W.stopPropagation(),children:[p?I:H,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),p?H:I]})},[k,j,o,t,d]),E=n.useMemo(()=>T(v),[v,d]);return e.jsx(y.ExhibitPopupIconButton,{ref:i,createPopupPanel:F,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:R},N)=>e.jsx(y.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:N,children:R}),onQuickClick:()=>{u?.(v)},quickButtonProps:{sx:{}},disabled:s,icon:E,...f})})),Fa=n.memo(n.forwardRef((a,i)=>{const{commands:o,command:t,commandHook:r,variant:s=w.CommandButtonType.Toolbar,disabled:d=!1,autoColor:p,autoStrokeStyle:l,schemeLookup:c,createTemporaryBorder:g,selectedBorder:C,onSelectBorder:f,darkMode:u,icon:m,label:b,...S}=a,x=w.useCommands(o,["formatBorder"]),h=t??x[0],k=h?.context()??null,j=k?.autoColor??p,v=k?.autoStyle??l,T=C??k?.quickBorder,M=u??k?.darkMode,P=g??k?.createTemporaryBorder,D=c??k?.schemeLookup,F=w.useCallbackRef(R=>{k?.onBorderSelect&&k.onBorderSelect(R),f?.(R),h?.execute(R,r)},[h,f,r]),E=n.useCallback((R,N)=>{const{children:z,title:O,...H}=R;let I=R.children;return(h?.disabled()||d)&&(I=e.jsx("div",{children:I})),e.jsx(y.CommandTooltip,{command:h,placement:s===w.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:N,...H,children:I})},[h,d]);return e.jsx(Da,{ref:i,autoColor:j,darkMode:M,autoStrokeStyle:v,createTemporaryBorder:P,schemeLookup:D,selectedBorder:T,onSelectBorder:F,createTooltip:E,disabled:d||!h||h.disabled(),...S})})),Ia=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=n.useCallback((l,c)=>{const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,command:c.getCommand("mergeToggle")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("mergeHorizontal")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("mergeVertical")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...g,command:c.getCommand("unmerge")})]});return y.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,quickCommand:"mergeToggle",commandHook:t,scope:r,tooltip:"Combine or split cells.",createPopupPanel:p,icon:"MergeAll",...d})})),Na=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=n.useCallback((l,c)=>{const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,command:c.getCommand("freezeToggle")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("freezeToggleHorizontal")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("freezeToggleVertical")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...g,command:c.getCommand("unfreeze")})]});return y.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,createPopupPanel:p,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:"Freeze",...d})})),Oa=n.memo(n.forwardRef((a,i)=>e.jsx(y.SimpleCommandPopupButton,{ref:i,...a,popupCommandKeys:["find","findReplace","goto"],scope:"find",label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:"Find"}))),Aa=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,showQuickButtons:r=!!a.commands,commands:s,fontSizes:d=A.FontUtils.DefaultFontSizes,disabled:p=!1,parentFloat:l,icon:c,label:g,sx:C,...f}=a;w.useCommand(o);const u=()=>o?.state()?.toString()||"11",[m,b]=n.useState(u),S=w.useCallbackRef(()=>{const P=parseFloat(m);isNaN(P)?b(u()):parseFloat(u())!==P&&o.execute(P,t)},[u,o,m,t]);n.useEffect(()=>{b(u())},[o?.state()]);const x=n.useMemo(()=>{if(!t)return null;const P={...t};return delete P.beforeExecute,P},[t]),h=w.useCommands(s,["formatFontSizeIncrease","formatFontSizeDecrease"]),k=n.useMemo(()=>h?e.jsxs(B.Box,{className:ie("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:P=>P.stopPropagation(),children:[e.jsx(y.CommandButton,{command:h[0],commandHook:x}),e.jsx(y.CommandButton,{command:h[1],commandHook:x})]}):null,[h]),j=q.useTheme(),v=n.useMemo(()=>`${A.IFont.getSharedMeasurer()("12.3",Math.round(j.typography.fontSize),j.typography.fontFamily).width}px`,[j]),T=n.useCallback(P=>{const{onMouseDown:D,onMouseUp:F,...E}=P;return e.jsx(B.IconButton,{component:"div",...E,disableRipple:!0,children:e.jsx(B.Input,{inputMode:"numeric",disabled:p||!o||o.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:R=>`1px solid ${R.palette.text.icon??R.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:R=>`1px solid ${R.palette.error.main}`},"::after":{borderBottom:R=>`1px solid ${R.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:R=>`${Math.round(R.typography.fontSize)}px`,width:v,color:R=>R.palette.text.secondary,input:{padding:"0 0",textAlign:"center",height:"1rem",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:R=>R.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:R=>R.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"}},value:m,onFocus:R=>{R.target?.select()},onKeyDown:R=>{if(R.which===w.KeyCodes.Enter)u()!==m&&(R.stopPropagation(),R.preventDefault(),S());else if(R.which===w.KeyCodes.Escape)u()!==m&&(b(u()),setTimeout(()=>{R.target?.select()},0),R.stopPropagation(),R.preventDefault());else{if(R.key.match("[-]")||R.key.match("[0-9.]")&&(m+R.key).length>4)return R.stopPropagation(),void R.preventDefault();if(R.which===w.KeyCodes.Space)return void R.preventDefault()}},onBlur:()=>{S()},onChange:R=>{if(R.target.value.length>4)return R.stopPropagation(),void R.preventDefault();b(R.target.value)}})})},[m,p,o]),M=n.useCallback(P=>{const D=N=>{o?.execute(N,t)},F=o?.state(),E=[];for(let N=0;N<d.length;N++){const z=d[N]===F;E.push(e.jsx(y.ExhibitMenuItem,{selected:z,icon:z?e.jsx(y.SelectedIcon,{}):void 0,disabled:p||!o||o.disabled(),onMouseDown:O=>{O.button===0&&O.preventDefault()},onMouseUp:O=>{O.button===0&&D(d[N])},onKeyDown:O=>{O.keyCode!==w.KeyCodes.Enter&&O.keyCode!==w.KeyCodes.Space||D(d[N])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:d[N]})},"fontSize-"+N))}const R=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...f,children:[k,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:E})]});return y.defaultCreatePopupPanel({...P,children:R})},[p,o?.state(),t]);return e.jsx(y.ExhibitPopupIconButton,{ref:i,sx:{...C},tabIndex:-1,outlined:!0,disabled:p,parentFloat:l,createPopupPanel:M,createTooltip:({children:P},D)=>e.jsx(y.ExhibitTooltip,{label:o?.label(),description:o?.description(),disabled:D||o?.disabled(),children:P}),createQuickButton:T,...f})})),Pn=n.memo(a=>{const{selected:i,disabled:o,formattedValue:t,handleSetFormat:r,format:s,sx:d,...p}=a;return e.jsx(y.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...d},disabled:o,selected:i,icon:i?e.jsx(y.SelectedIcon,{}):void 0,onMouseDown:l=>{l.button===0&&l.preventDefault()},onMouseUp:l=>{l.button===0&&r(s.numberFormat)},onKeyDown:l=>{l.keyCode!==w.KeyCodes.Enter&&l.keyCode!==w.KeyCodes.Space||r(s.numberFormat)},...p,children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(B.Typography,{component:"div",children:[s.formatType,s.formatType===A.NumberFormat.Type.Custom?"…":""]}),e.jsx(B.Typography,{variant:"caption",component:"div",sx:{color:l=>Re.alpha(l.palette.text.primary,.6),paddingTop:t&&t.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:t&&t.length>0?t:" "})]})})}),La=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,sx:s,disabled:d=!1,parentFloat:p,...l}=a,c=w.useCommands(o,["formatNumberFormat"])[0],g=c?.state()?A.NumberFormat.Styles.lookupStyle(c?.state()).formatType:A.NumberFormat.Type.General,C=n.useMemo(()=>{if(!t)return null;const b={...t};return delete b.beforeExecute,b},[t]),f=n.useCallback((b,S)=>{const x=F=>{t?.beforeExecute?.(c,c?.state()),c.execute(F,t),t?.onExecute?.(c,c?.state())},h=c?.context()(),k=A.NumberFormat.Styles.lookupPrimary(),j=[];for(let F=0;F<k.length;F++){let E="";if(h&&!h.isEmpty())try{E=h.getNumberFormat(k[F].numberFormat).displayText}catch(N){console.warn(N)}E===""&&k[F].formatType===A.NumberFormat.Type.General&&(E="No specific format");const R=k[F].formatType===g;j.push(e.jsx(Pn,{selected:R,disabled:d||!c||c.disabled(),formattedValue:E,handleSetFormat:x,format:k[F]},k[F].formatType))}const v={numberFormat:"",formatType:A.NumberFormat.Type.Custom},T=g===A.NumberFormat.Type.Custom,M=e.jsx(Pn,{selected:T,disabled:d||!c||c.disabled(),formattedValue:T?h.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(c,c?.state()),S.getCommand("formatNumberDialog")?.execute(c?.state()),t?.onExecute?.(c,c?.state())},format:v,sx:{flex:"0",width:"100%"}},A.NumberFormat.Type.Custom),P=e.jsxs(B.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:F=>F.stopPropagation(),children:[e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatAccountingStyle"),commandHook:C,scope:r}),e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatPercentStyle"),commandHook:C,scope:r}),e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatCommaStyle"),commandHook:C,scope:r}),e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:C,scope:r}),e.jsx(y.CommandButton,{command:S.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:C,scope:r})]}),D=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...l,children:[P,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),M]});return y.defaultCreatePopupPanel({...b,children:D})},[c?.context(),c?.state(),t,r]),u=q.useTheme(),m=n.useMemo(()=>{const b=A.NumberFormat.Type.MediumTime;return`${A.IFont.getSharedMeasurer()(b,Math.round(u.typography.fontSize),u.typography.fontFamily).width}px`},[u]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,sx:s,outlined:!0,disabled:d,parentFloat:p,createPopupPanel:f,createTooltip:({children:b},S)=>e.jsx(y.ExhibitTooltip,{label:c?.label(),description:c?.description(),disabled:S,children:b}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:b=>`${Math.round(b.typography.fontSize)}px`,color:b=>b.palette.text.secondary,fontFamily:b=>b.typography.fontFamily,width:m},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:g})}),...l})})),Lo=n.memo(n.forwardRef((a,i)=>e.jsx(y.SimpleCommandPopupButton,{ref:i,...a,popupCommandKeys:["clearAll","clearFormats","clearContents","clearComments","clearHyperlinks"],scope:"clear",label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",icon:"ClearAll"}))),za=n.memo(n.forwardRef((a,i)=>e.jsx(y.SimpleCommandPopupButton,{ref:i,...a,popupCommandKeys:["fillDown","fillRight","fillUp","fillLeft"],scope:"fill",label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",icon:"FillDown"}))),zo=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,disableSheet:d=!1,preferSingleMenu:p=!0,showQuickButton:l=!0,variant:c=w.CommandButtonType.Toolbar,...g}=a,C=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns","addSheet"];d||C.push("addSheet");const f=w.useCommands(o,C),{singleCommand:u,allDisabled:m}=n.useMemo(()=>{let S=null,x=0;const h=f.length;for(let k=0;k<h;k++){const j=f[k];j&&!j.disabled()&&(p&&c===w.CommandButtonType.Menuitem&&(S=x===0?j:null),x++)}return{singleCommand:S,allDisabled:x===0}},[f]),b=n.useCallback((S,x)=>{let h=null;const k={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"insertCells",disabled:s};d||(h=e.jsxs(e.Fragment,{children:[e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...k,command:x.getCommand("addSheet")})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...k,command:f[0]}),e.jsx(y.CommandButton,{...k,command:f[1]}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...k,command:f[2]}),e.jsx(y.CommandButton,{...k,command:f[3]}),h]});return y.defaultCreatePopupPanel({...S,children:j})},[s,f,t,r]);return u?e.jsx(y.CommandButton,{ref:i,variant:c,commandHook:t,disabled:s,command:u,...g}):e.jsx(y.CommandPopupButton,{ref:i,variant:c,quickCommand:"insertCells",commands:o,commandHook:t,scope:r,disabled:s||m,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),e.jsx("br",{}),e.jsx("span",{children:"To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert."})]}),createPopupPanel:b,...g})})),Ho=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,disableSheet:d=!1,preferSingleMenu:p=!0,showQuickButton:l=!0,variant:c=w.CommandButtonType.Toolbar,...g}=a,C=["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"];d||C.push("deleteSheet");const f=w.useCommands(o,C),{singleCommand:u,allDisabled:m}=n.useMemo(()=>{let S=null,x=0;const h=f.length;for(let k=0;k<h;k++){const j=f[k];j&&!j.disabled()&&(p&&c===w.CommandButtonType.Menuitem&&(S=x===0?j:null),x++)}return{singleCommand:S,allDisabled:x===0}},[f]),b=n.useCallback((S,x)=>{const h={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"deleteCells",disabled:s};let k=null;d||(k=e.jsxs(e.Fragment,{children:[e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteSheet")})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteCellsShiftUp")}),e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteCellsShiftLeft")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteRows")}),e.jsx(y.CommandButton,{...h,command:x.getCommand("deleteColumns")}),k]});return y.defaultCreatePopupPanel({...S,children:j})},[s,t,r]);return u?e.jsx(y.CommandButton,{ref:i,variant:c,commandHook:t,disabled:s,command:u,...g}):e.jsx(y.CommandPopupButton,{ref:i,variant:c,quickCommand:"deleteCells",commands:o,commandHook:t,scope:r,disabled:s||m,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),e.jsx("br",{}),e.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:b,...g})})),Wo=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,...s}=a,d=n.useCallback((p,l)=>{const c={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"formatCells"},g={commands:l,parentFloat:p.floatReference,...c},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...c,command:l.getCommand("resizeRows")}),e.jsx(y.CommandButton,{...c,command:l.getCommand("autoFitRows")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...c,command:l.getCommand("resizeColumns")}),e.jsx(y.CommandButton,{...c,command:l.getCommand("autoFitColumns")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.SimpleCommandPopupButton,{ref:i,...g,popupCommandKeys:["hideColumns","hideRows",null,"unhideColumns","unhideRows"],popupScope:"hideUnhide",label:"Hide & Unhide"})]});return y.defaultCreatePopupPanel({...p,children:C})},[t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,createPopupPanel:d,icon:"CellsFormat",label:"Format Cells",tooltip:"Change row and column sizes or visibility.",...s})}));Wo.displayName="CellsFormatCommandButton";const ht=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,onSelectColor:r,disabled:s=!1,variant:d=w.CommandButtonType.Toolbar,quickColor:p,panelProps:l,isSplit:c=!1,darkMode:g,icon:C,...f}=a,{autoColor:u,schemeLookup:m,recentColors:b,...S}=l;if(f.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");w.useCommand(o);const x=o?.context();let h=p??x?.quickColor;c&&!h&&(h=new A.Color("transparent"));const k=u??x?.autoColor,j=m??x?.schemeLookup,v=b??x?.recentColors,T=g??x?.darkMode,M=n.useMemo(()=>({autoColor:k,schemeLookup:j,recentColors:v,darkMode:T,...S}),[k,j,v,T]),P=w.useCallbackRef((F,E)=>{F&&E&&x?.addRecentColor&&x.addRecentColor(F),x?.onColorSelect&&x.onColorSelect(F),r?.(F,E),o?.execute(F,t)},[o,r,t,x]),D=n.useCallback((F,E)=>{const{children:R,title:N,...z}=F;let O=F.children;return(o?.disabled()||s)&&(O=e.jsx("div",{children:O})),e.jsx(y.CommandTooltip,{command:o,placement:d===w.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:E,...z,children:O})},[o,s]);return e.jsx(Ao,{ref:i,panelProps:M,icon:C??o?.icon(x),quickColor:h,selectedColor:o?.state(),onSelectColor:P,variant:d===w.CommandButtonType.Menuitem?y.PopupButtonType.Menuitem:y.PopupButtonType.Toolbar,createTooltip:D,label:o?.label(),disabled:s||!o||o.disabled(),compareRGB:!0,darkMode:T,...f})}));ht.displayName="ColorCommandButton";const Ha=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...p}=a,l=w.useCommands(o,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),c=n.useCallback((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,parentFloat:g.floatReference,commandHook:t,scope:r,disabled:s},u=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...f,command:C.getCommand("gridlinesToggle")}),e.jsx(ht,{...f,command:C.getCommand("sheetViewFormatGridlinesColor"),icon:e.jsx(w.DynamicIcon,{iconKey:"stroke.colored"}),panelProps:{disableAlpha:!0}}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleGridlinesColumns")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleGridlinesRows")})]});return y.defaultCreatePopupPanel({...g,children:u})},[s,t]);return e.jsx(y.CommandPopupButton,{ref:i,parentFloat:d,quickCommand:l[0]?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:e.jsx(y.LabelIcon,{command:l[0],scope:"view"}),...p})})),$o=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=n.useCallback((l,c)=>{const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:s},C=c.getCommand("sortCustom"),f=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,command:c.getCommand("sortAscending")}),e.jsx(y.CommandButton,{...g,command:c.getCommand("sortDescending")}),C?e.jsx(y.CommandButton,{...g,command:C}):null,e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterToggle")}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterClear")}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterReapply")})]});return y.defaultCreatePopupPanel({...l,children:f})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,disabled:s,label:"Sort",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:p,icon:"SortFilter",...d})})),Vi=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=n.useCallback((l,c)=>{const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterToggle")}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterClear")}),e.jsx(y.CommandButton,{...g,scope:"filter",command:c.getCommand("autoFilterReapply")})]});return y.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,disabled:s,label:"Filter",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:p,icon:"FilterToggle",...d})})),Vo=n.memo(n.forwardRef((a,i)=>{const{quickCommand:o,icon:t,isRedo:r=!1,nestRedo:s=!0,undoManager:d,scope:p,sx:l,disabled:c,commands:g,...C}=a,f=[o];!r&&s&&f.push("redo");const u=w.useCommands(g,f),m=u[0],b=u[1],S=d??m?.context?.()?.undoManager;let x=c;c||(x=!m||m.disabled(),b&&!b.disabled()&&(x=!1));const[h,k]=n.useState(0),j=n.useCallback((v,T)=>{let M=h===0?"Cancel":`${m.label()} ${h} Action${h===1?"":"s"}`,P=!1;S||(P=!0),P||(P=s?!S.hasRedo()&&!S.hasUndo():!S.hasRedo());const D=O=>{m.execute(O)},F=e.jsx(y.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:P?void 0:"0 0",minWidth:"180px"},icon:e.jsx(w.DynamicIcon,{}),onMouseEnter:()=>{k(0)},onMouseDown:O=>{O.button===0&&O.preventDefault()},onMouseUp:O=>{O.button===0&&D(h)},onKeyDown:O=>{O.isDefaultPrevented()||O.keyCode!==w.KeyCodes.Enter&&O.keyCode!==w.KeyCodes.Space||D(h)},children:e.jsx(B.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:M})});if(P)return F;const E=r?S?.getRedoDescriptions():S?.getUndoDescriptions(),R=[];for(let O=0;O<E.length;O++){const H=E[O];R.push(e.jsx(y.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex"},disabled:x,selected:O<h,icon:e.jsx(w.DynamicIcon,{}),onMouseEnter:()=>{k(O+1)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&D(O+1)},onKeyDown:I=>{I.isDefaultPrevented()||I.keyCode!==w.KeyCodes.Enter&&I.keyCode!==w.KeyCodes.Space||D(O+1)},children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[e.jsx(B.Typography,{component:"div",children:H}),e.jsx(w.DynamicIcon,{})]})},`action:${O}`))}let N=null;if(!r&&s){const O={scope:"undo",commands:T,variant:w.CommandButtonType.Menuitem,parentFloat:v.floatReference};N=[],N.push(e.jsx(Vo,{...O,quickCommand:"redo",isRedo:!0},"nested:redo")),S.hasRedo()&&S.hasUndo()&&N.push(e.jsx(y.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const z=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{v.closeFloatAll()},onMouseLeave:()=>{k(0)},children:[N,e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:R}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),F]});return y.defaultCreatePopupPanel({...v,children:z})},[m?.context(),m?.state(),p,S,h,x]);return e.jsx(y.CommandPopupButton,{ref:i,commands:g,quickCommand:o,scope:p,disabled:x,label:m?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${m?.label()??"No"} last actions.`})}),createPopupPanel:j,icon:t??(r?"Redo":"Undo"),selected:!1,...C})})),ft=A.IFontCollection.getFontList(),Wa=new Map;for(let a=0;a<ft.length;a++)Wa.set(ft[a].fontRef.getFamily(),ft[a]);const $a=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,sx:r,disabled:s=!1,parentFloat:d,icon:p,label:l,...c}=a;w.useCommand(o);const g=o?.state(),C=q.useTheme(),f=n.useMemo(()=>`${A.IFont.getSharedMeasurer()("Times New Roman",Math.round(C.typography.fontSize),C.typography.fontFamily).width}px`,[C]),u=n.useCallback(m=>{const b=k=>{o?.execute(k,t)},S=[];for(let k=0;k<ft.length;k++)S.push({key:ft[k].fontRef.getFamily(),description:ft[k].fontRef.getFamily()});Wa.get(g)||S.unshift({key:g,description:g});const x=[];for(let k=0;k<S.length;k++){const j=S[k].key===g;x.push(e.jsx(y.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:j,disabled:s||!o||o.disabled(),icon:j?e.jsx(y.SelectedIcon,{}):void 0,onMouseUp:v=>{v.button===0&&b(S[k].key)},onMouseDown:v=>{v.button===0&&v.preventDefault()},onKeyDown:v=>{v.keyCode!==w.KeyCodes.Enter&&v.keyCode!==w.KeyCodes.Space||b(S[k].key)},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(B.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>S[k]?.key},children:S[k].description})})},k+""+S[k].key))}const h=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...c,children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:x})});return y.defaultCreatePopupPanel({...m,children:h})},[s,o?.state()]);return e.jsx(y.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:s,parentFloat:d,createPopupPanel:u,createTooltip:({children:m},b)=>e.jsx(y.ExhibitTooltip,{label:o?.label(),description:o?.description(),disabled:b,children:m}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:m=>`${Math.round(m.typography.fontSize)}px`,fontFamily:m=>m.typography.fontFamily,color:m=>m.palette.text.secondary,width:f},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:g})}),...c})})),Va=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),l=n.useMemo(()=>{const g=p.length;for(let C=0;C<g;C++){const f=p[C];if(f?.state())return f}return p[0]},[p]),c=n.useCallback((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:s},u=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...f,command:C.getCommand("formatStrikeThroughToggle")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatSuperscriptToggle")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatSubscriptToggle")})]});return y.defaultCreatePopupPanel({...g,children:u})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,quickCommand:l?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:l?.icon()??"TextStrike",...d})})),_a=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,p=w.useCommands(o,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),l=n.useMemo(()=>{const g=p.length;for(let C=0;C<g;C++)if(p[C]?.state())return p[C];return p[0]},[p]),c=n.useCallback((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:s},u=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...f,command:C.getCommand("formatUnderlinedToggle")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatUnderlinedDoubleToggle")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatUnderlinedAccountingToggle"),commandHook:t}),e.jsx(y.CommandButton,{...f,command:C.getCommand("formatUnderlinedAccountingDoubleToggle")})]});return y.defaultCreatePopupPanel({...g,children:u})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,quickCommand:l?.key(),commands:o,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:c,icon:l?.icon()??"TextUnderline",...d})})),_o=n.memo(n.forwardRef((a,i)=>{const{command:o,commands:t,commandHook:r,scope:s,includePasteAllInPopup:d=!0,disabled:p=!1,...l}=a,c=w.useCallbackRef((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,commandHook:r,scope:"paste",disabled:p},u=[];return d&&(u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("paste"),key:"paste"})),u.push(e.jsx(y.ExhibitDivider,{orientation:"horizontal"},"paste-div"))),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteValues"),key:"pasteValues"})),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteFormats"),key:"pasteFormats"})),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteFormulas"),key:"pasteFormulas"})),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteTranspose"),key:"pasteTranspose"})),u.push(n.createElement(y.CommandButton,{...f,command:C.getCommand("pasteLinks"),key:"pasteLinks"})),y.defaultCreatePopupPanel({...g,children:u})},[p,r,s,d]);return e.jsx(y.CommandPopupButton,{ref:i,commands:t,commandHook:r,scope:s,createPopupPanel:c,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",...l})})),Ka=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...p}=a,l=w.useCommands(o,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),c=n.useCallback((g,C)=>{const f={variant:w.CommandButtonType.Menuitem,parentFloat:g.floatReference,commandHook:t,scope:r,disabled:s},u=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleShowHeadings")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleShowHeadingsNumeric")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleShowHeadingColumns")}),e.jsx(y.CommandButton,{...f,command:C.getCommand("sheetViewToggleShowHeadingRows")})]});return y.defaultCreatePopupPanel({...g,children:u})},[s,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,parentFloat:d,quickCommand:l[0]?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:e.jsx(y.LabelIcon,{command:l[0],scope:"view"}),...p})})),Ua=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r="view",disabled:s=!1,...d}=a,p=n.useCallback(l=>{const c={variant:w.CommandButtonType.Menuitem,parentFloat:l.floatReference,commandHook:t,scope:r,disabled:s},g=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowFormulaBar")}),e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowTabs")}),e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowStatusBar")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowHorizontalScrollBar")}),e.jsx(y.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return y.defaultCreatePopupPanel({...l,children:g})},[s,o,t,r]);return e.jsx(y.CommandPopupButton,{ref:i,commands:o,disabled:s,commandHook:t,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:p,icon:e.jsx(y.LabelIcon,{icon:null,label:"Workbook View"}),...d})})),qa=n.memo(n.forwardRef((a,i)=>{const{value:o,cellStyle:t,styles:r,createTemporaryCell:s,bodyStyle:d,sx:p,borderProps:l,disabled:c,...g}=a,C=n.useMemo(()=>s({value:o,style:t}),[o,t,s]),f=n.useMemo(()=>C.getStyle(),[C,d]),u=n.useMemo(()=>f.getFill().toCSS(d?.darkMode??!1),[f]),m=f.getInsets(),b=f.getFont(),S=n.useCallback(()=>f.getBorder(),[f]);return e.jsx(B.Box,{ref:i,sx:{width:"100px",height:"100%",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:d?.fill,filter:c?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...u},"& .text":{flex:"1 1 100%",...b.toCSS(d?.darkMode??!1,1),boxSizing:"border-box",padding:`${m.top}px ${m.right}px ${m.bottom}px ${m.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:b.toCSS().textDecoration,textAlign:A.ITextFrame.toCSSHorizontalTextAlign(C.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...p},...g,children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:S,darkMode:d?.darkMode??!1,rowCount:1,columnCount:1,style:{height:"100%",width:"100%",...l?.style},...l,children:e.jsx(B.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-2px",marginBottom:"-2px",display:"flex",alignItems:"center"},children:e.jsx(B.Box,{className:"text",children:o})})})})})),_i=n.memo(a=>{const{styles:i,namedStyle:o,selectedNamed:t,hasContextMenu:r=!0,bodyStyle:s,onSelectNamed:d,createTemporaryCell:p,parentFloat:l,commands:c,disabled:g,commandHook:C,...f}=a,u=n.useCallback(S=>{const x={variant:w.CommandButtonType.Menuitem,commandHook:C,context:"cellStyle"},h=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...x,style:{fontWeight:550},command:c.getCommand("formatCellStyle"),commandState:o,disabled:g}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...x,command:c.getCommand("modifyCellStyle"),commandState:{named:o}}),e.jsx(y.CommandButton,{...x,command:c.getCommand("deleteCellStyle"),commandState:o,disabled:g||o?.getName()===A.IStyle.BuiltInName.Normal})]}),k=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:h})});return y.defaultCreatePopupPanel({...S,children:k})},[]),m=o?.getName()===t?.getName();let b=e.jsx(y.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:S=>`solid ${m?S.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:o.getName(),placement:"bottom-start"},disabled:g,icon:null,onClick:()=>{d?.(o)},...f,children:e.jsx(qa,{value:o.getName(),cellStyle:{named:o.getName()},styles:i,createTemporaryCell:p,bodyStyle:s})},o.getName());return r&&(b=e.jsx(y.ContextMenu,{label:o.getName(),parentFloat:l,createPopupPanel:u,children:b})),b}),Ga=n.memo(n.forwardRef((a,i)=>{const{commands:o,command:t,commandHook:r,selectedNamed:s,onSelectNamed:d,disabled:p=!1,bodyStyle:l,usePreviewIcon:c=!0,...g}=a;w.useCommand(t);const C=t?.context(),f=C?.styles,u=s??C?.named(),m=l??C?.bodyStyle(),b=w.useCallbackRef(j=>{d?.(j),t?.execute(j,r)},[t,d,r]),S=n.useCallback((j,v)=>{const T={onSelectNamed:b,styles:f(),parentFloat:j.floatReference},M=f().getCustomNamed(),P=new Map,D=[];for(let I=0;I<M.length;I++)P.set(M[I].getName(),M[I]),f().getNamed(M[I].getName()).getBuiltInID()===null&&D.push(M[I].getName());const F=I=>{let W=P.get(I);return W||(W=f().getNamed(I)),!W||W.isHidden()?null:e.jsx(_i,{namedStyle:W,selectedNamed:u,bodyStyle:C.bodyStyle(),createTemporaryCell:C.createTemporaryCell,commands:o,commandHook:r,...T},I)},E=(I,W,ee=!0)=>{const X=[];for(let ne=0;ne<W.length;ne++){const $=F(W[ne]);$&&X.push($)}return X.length===0?null:e.jsxs(B.Box,{children:[ee?e.jsx(y.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(y.ExhibitMenuHeader,{children:I},I+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:X},I+"-presets")]},I)},R=(I,W)=>{const ee=[];for(let X=0;X<W.length;X++){const ne=F(W[X]);ne&&ee.push(ne)}return ee.length===0?null:e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:ee},I+"-presets")},N=[];N.push(E("Custom",D,!1)),N.push(E("Good, Bad and Neutral",[A.IStyle.BuiltInName.Normal,A.IStyle.BuiltInName.Bad,A.IStyle.BuiltInName.Good,A.IStyle.BuiltInName.Neutral],D.length>0)),N.push(E("Data and Model",[A.IStyle.BuiltInName.Calculation,A.IStyle.BuiltInName.CheckCell,A.IStyle.BuiltInName.ExplanatoryText,A.IStyle.BuiltInName.FollowedHyperlink,A.IStyle.BuiltInName.Hyperlink,A.IStyle.BuiltInName.Input,A.IStyle.BuiltInName.LinkedCell,A.IStyle.BuiltInName.Note,A.IStyle.BuiltInName.Output,A.IStyle.BuiltInName.WarningText])),N.push(E("Titles and Headings",[A.IStyle.BuiltInName.Heading1,A.IStyle.BuiltInName.Heading2,A.IStyle.BuiltInName.Heading3,A.IStyle.BuiltInName.Heading4,A.IStyle.BuiltInName.Title,A.IStyle.BuiltInName.Total]));let z=[];var O,H;return z.push(R("Accent 1",[A.IStyle.BuiltInName.Accent1_20,A.IStyle.BuiltInName.Accent1_40,A.IStyle.BuiltInName.Accent1_60,A.IStyle.BuiltInName.Accent1])),z.push(R("Accent 2",[A.IStyle.BuiltInName.Accent2_20,A.IStyle.BuiltInName.Accent2_40,A.IStyle.BuiltInName.Accent2_60,A.IStyle.BuiltInName.Accent2])),z.push(R("Accent 3",[A.IStyle.BuiltInName.Accent3_20,A.IStyle.BuiltInName.Accent3_40,A.IStyle.BuiltInName.Accent3_60,A.IStyle.BuiltInName.Accent3])),z.push(R("Accent 4",[A.IStyle.BuiltInName.Accent4_20,A.IStyle.BuiltInName.Accent4_40,A.IStyle.BuiltInName.Accent4_60,A.IStyle.BuiltInName.Accent4])),z.push(R("Accent 5",[A.IStyle.BuiltInName.Accent5_20,A.IStyle.BuiltInName.Accent5_40,A.IStyle.BuiltInName.Accent5_60,A.IStyle.BuiltInName.Accent5])),z.push(R("Accent 6",[A.IStyle.BuiltInName.Accent6_20,A.IStyle.BuiltInName.Accent6_40,A.IStyle.BuiltInName.Accent6_60,A.IStyle.BuiltInName.Accent6])),N.push((O="Themed Cell Styles",H=z,e.jsxs(B.Box,{children:[e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.ExhibitMenuHeader,{children:O},O+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:H},O+"-presets")]},O))),N.push(E("Number Format",[A.IStyle.BuiltInName.Comma,A.IStyle.BuiltInName.Comma0,A.IStyle.BuiltInName.Currency,A.IStyle.BuiltInName.Currency0,A.IStyle.BuiltInName.Percent])),e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:I=>`${I.shape.borderRadius}px`,paddingBottom:I=>`${I.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:N}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{variant:w.CommandButtonType.Menuitem,commandState:u,command:v.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:p})]})},[u,f?.().getTheme(),m]),x=w.useCallbackRef(j=>{const v=18/A.IFont.getDeviceScale(),T=C?.createTemporaryCell(j);return T.getStyle().getFont().getSize()<=v?T:T.createTemporaryCell({style:{font:{size:v}}})},[C?.createTemporaryCell]),h=p||!t||t.disabled(),k=n.useMemo(()=>C&&c?e.jsx(qa,{value:u?.getName()??"Custom",cellStyle:u?{named:u.getName()}:void 0,styles:C.styles(),createTemporaryCell:x,bodyStyle:C.bodyStyle(),className:"outline-hover",disabled:h,sx:{marginRight:"4px",borderRadius:"2px",minHeight:"calc(100% - 2px)",overflow:"hidden",outline:j=>`1px solid ${j.palette.action.hover}`},borderProps:{style:{height:"calc(100% - 2px)",width:"calc(100% - 1px)"}}}):t?.icon(),[u,m,h,t]);return e.jsx(y.CommandPopupButton,{ref:i,createPopupPanel:S,outlined:c,commands:o,createTooltip:({children:j},v)=>e.jsx(y.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:v,children:j}),selected:!1,disabled:h,label:t?.label(),icon:k,...g})})),Xa="_sheetxl-reset_11z3j_1",Ki=10,Ko=n.memo(n.forwardRef((a,i)=>{const{styles:o,table:t,tableStyle:r=t?.getStyle()??o.getDefaultTableStyle(),bodyStyle:s,sx:d,disabled:p,className:l,forceThinBorder:c,cellHeight:g=Ki,isLive:C=!1,...f}=a,u=Math.ceil(1.3*g),[m,b]=n.useReducer(j=>j+1,0);n.useEffect(()=>{if(C&&t)return t.addListeners({onAnyChange:()=>{b()}})},[t,C]);const S=n.useMemo(()=>{let j=t?.toJSON()??{};const v={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return j&&(j.styleOptions={...j.styleOptions,name:r.getName()}),j.ref=v,new A.Table({initialAnchor:v,json:j,styles:o})},[m,t,r,o]),x=n.useMemo(()=>{const j=[];for(let v=0;v<5;v++)for(let T=0;T<5;T++){const M=S.getStyleAt({colIndex:T,rowIndex:v});j.push(M)}return j},[S]),h=n.useMemo(()=>{const j=(T,M,P)=>{let D=P.getFill().toCSS(s?.darkMode??!1);const F=u-(M<4?1:0),E=g-(T<4?1:0),R=P.getFont().getFill().toCSS(s?.darkMode??!1);return D={...D,position:"absolute",boxSizing:"border-box",left:M*(u-1),top:T*(g-1),width:F,height:E},e.jsx("td",{className:`table-style-fill ${T}-${M}`,style:D,children:e.jsx("div",{className:`table-style-text ${T}-${M}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(F-6)/2,top:(E-1)/2,borderTop:`1px solid ${R}`}})},`${T}-${M}`)},v=[];for(let T=0;T<5;T++){const M=[];for(let P=0;P<5;P++){const D=x[5*T+P];M.push(j(T,P,D))}v.push(e.jsx("tr",{children:M},T))}return v},[S,r,s]),k=n.useCallback((j,v)=>x[v].getBorder()??null,[x]);return e.jsx(B.Box,{ref:i,className:"table-format-preview",sx:{background:s?.fill,filter:p?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...d},...f,children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:k,rowCount:5,columnCount:5,forceThinBorder:c,width:5*(u-1)+1,height:5*(g-1)+1,darkMode:s?.darkMode??!1,style:{pointerEvents:"none"},children:e.jsx("table",{className:ie(l,"sheetxl-table-preview",Xa),style:{borderCollapse:"collapse",width:5*(u-1)+1,height:5*(g-1)+1},children:e.jsx("tbody",{children:h})})})})})),St=(a,i,o,t,r)=>{a.beginPath(),a.moveTo(i+.5,o+.5),a.lineTo(t+.5,r+.5),a.stroke()},Ya=n.memo(n.forwardRef((a,i)=>{const{table:o,tableStyle:t,styles:r,bodyStyle:s,disabled:d,style:p,className:l,canvas:c,...g}=a,C=n.useMemo(()=>{const m=o.toJSON(),b={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return m.styleOptions={...m.styleOptions,name:t.getName()},m.ref=b,new A.Table({initialAnchor:b,json:m,styles:r})},[o,t,r]),f=n.useMemo(()=>{const m=[];for(let b=0;b<5;b++)for(let S=0;S<5;S++){const x=C.getStyleAt({colIndex:S,rowIndex:b});m.push(x)}return m},[C]),u=n.useMemo(()=>{let m=c;if(c||(m=document.createElement("canvas")),!m)return null;m.width!==61&&(m.width=61),m.height!==46&&(m.height=46);const b=m.getContext("2d",{alpha:!1});if(!b)return null;const S=12,x=s?.darkMode??!1;for(let h=0;h<5;h++)for(let k=0;k<5;k++){const j=f[5*h+k].getFill();let v=s?.fill;j.getType()===A.IFill.Type.Solid?v=j.getColor().toCSS(x,!1):j.getType()===A.IFill.Type.Gradient?v=j.getStops[0]?.color.toCSS(x,!1):j.getType()===A.IFill.Type.Pattern&&(v=j.getForeground().toCSS(x,!1)),b.fillStyle=v;const T=k*S,M=9*h;b.fillRect(T,M,13,10)}b.lineWidth=1;for(let h=0;h<5;h++)for(let k=0;k<5;k++){const j=f[5*h+k],v=k*S,T=9*h,M=j.getBorder();if(!M.isEmpty()){const F=M.getLeft();F.isNone()||(b.strokeStyle=F.getColor().toCSS(x,!1),St(b,v,T,v,T+9));const E=M.getTop();E.isNone()||(b.strokeStyle=E.getColor().toCSS(x,!1),St(b,v,T,v+S,9*h));const R=M.getRight();R.isNone()||(b.strokeStyle=R.getColor().toCSS(x,!1),St(b,v+S,T,v+S,T+9));const N=M.getBottom();N.isNone()||(b.strokeStyle=N.getColor().toCSS(x,!1),St(b,v,T+9,v+S,T+9))}b.strokeStyle=j.getFont().getFill().toCSS(x,!1);const P=4,D=2.5;St(b,k*S+D,9*h+P,k*S+D+7,9*h+P)}return`url(${m.toDataURL()})`},[c,C,t,s]);return e.jsx("div",{ref:i,className:ie("table-style-preview",l),style:{backgroundImage:u,width:61,height:46,...p},...g})})),Ui="_table-style-options-container_1kfn2_1",qi="_table-style-options_1kfn2_1",Za=n.memo(n.forwardRef((a,i)=>{const{styleOptions:o,onStyleOptionsChange:t,showHeaderRow:r,onShowHeaderRowChange:s,showTotalRow:d,onShowTotalRowChange:p,showFilterButton:l,onShowFilterButtonChange:c,sx:g,className:C,disabled:f,...u}=a;return e.jsx("div",{className:Ui,children:e.jsxs(B.Box,{sx:{pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:m=>`${m.spacing(2)}`,marginRight:m=>`${m.spacing(2)}`},"& .MuiCheckbox-root":{padding:m=>`${m.spacing(.5)}`},...g},...u,ref:i,className:ie(C,qi),children:[s&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>s(!r),disabled:f||r==null}),label:"Header Row",labelPlacement:"end"}),p&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:d??!1,indeterminate:d==null,onChange:()=>p(!d),disabled:f||d==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:o?.showRowStripes??!1,indeterminate:!o,disabled:f||!o,onChange:()=>{t?.({...o,showRowStripes:!o?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:o?.showFirstColumn??!1,indeterminate:!o,disabled:f||!o,onChange:()=>{t?.({...o,showFirstColumn:!o?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:o?.showLastColumn??!1,indeterminate:!o,disabled:f||!o,onChange:()=>{t?.({...o,showLastColumn:!o?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:o?.showColumnStripes??!1,indeterminate:!o,disabled:f||!o,onChange:()=>{t?.({...o,showColumnStripes:!o?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),c&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:l??!1,indeterminate:l==null,disabled:f||!o||l==null,onChange:()=>c(!l)}),label:"Filter Button",labelPlacement:"end"})]})})}));function bo(a,i){if(typeof a=="function")return a(i);a&&(a.current=i)}var tt=parseInt(n.version.split(".")[0],10)>=19?function(a){return i=>{const o=[];for(const t of a){const r=bo(t,i),s=typeof r=="function";o.push(s?r:()=>bo(t,null))}return()=>{for(const t of o)t()}}}:function(a){return i=>{for(const o of a)bo(o,i)}},Gi=function(){},Qa=typeof window<"u",ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xi=Qa?n.useLayoutEffect:n.useEffect,Mn={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const _e=Qa&&window.ResizeObserver!==void 0?function(){var a=n.useState(null),i=a[0],o=a[1],t=n.useState(Mn),r=t[0],s=t[1],d=n.useMemo(function(){return new window.ResizeObserver(function(p){if(p[0]){var l=p[0].contentRect,c=l.x,g=l.y,C=l.width,f=l.height,u=l.top,m=l.left,b=l.bottom,S=l.right;s({x:c,y:g,width:C,height:f,top:u,left:m,bottom:b,right:S})}})},[]);return Xi(function(){if(i)return d.observe(i),function(){d.disconnect()}},[i]),[o,r]}:function(){return[Gi,Mn]},Yi="_range-row_akhf4_1",Zi="_action-row_akhf4_15",Ja=n.createContext(null);Ja.displayName="HookFormContext";const er=()=>n.useContext(Ja);typeof window<"u"?n.useLayoutEffect:n.useEffect;const Uo=n.memo(n.forwardRef((a,i)=>{const{disabled:o,style:t,className:r,sx:s,defaultInput:d,value:p,formName:l,formOptions:c,onChangeInput:g,onValidate:C,onKeyDown:f,...u}=a,m=er(),b=l&&m?m.register(l,c):null,[S,x]=n.useState(""),[h,k]=n.useState(""),[j,v]=n.useState(p);n.useEffect(()=>{v(p),k("")},[p]);const T=w.useCallbackRef(E=>{let R="";try{v(E),C?.(E),g?.(E)}catch(N){R=N.message??"Invalid Name"}l&&m&&(R?m.setError(l,{message:R}):m.clearErrors(l)),k(R)},[p,C,g]),M=w.useCallbackRef(async E=>{E.keyCode===w.KeyCodes.Escape&&S!==p&&(T(S),m?.setValue(l,S),m?.clearErrors(l),E.stopPropagation()),f?.(E)},[f,S,p,m]),P=w.useCallbackRef(E=>{x(E.target.value??"")},[]),D=w.useCallbackRef(E=>{x(""),b?.onBlur(E)},[]),F=n.useCallback(E=>{T(E.target.value),b?.onChange(E)},[b]);return e.jsx(B.FormControl,{sx:{paddingTop:E=>E.spacing(1.5),minWidth:135,width:"100%",...s},size:"small",ref:i,className:ie("named-input",r),...u,children:e.jsx(B.TextField,{label:"Name",placeholder:d,onFocus:P,onBlur:D,inputRef:b?.ref,disabled:o,error:!!h,helperText:h||" ",sx:{"& .MuiFormHelperText-root":{marginTop:E=>E.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:"autoFocus",name:l,spellCheck:!1,autoComplete:"off",readOnly:o,sx:{paddingTop:E=>E.spacing(1.25),paddingBottom:E=>E.spacing(.75),backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`}}},value:j??"",onChange:F,onKeyDownCapture:M,onContextMenu:E=>{E.stopPropagation()}})})}));Uo.displayName="NamedInput";const Wt=a=>a===null?"":a.toString(),qo=n.memo(n.forwardRef((a,i)=>{const{formName:o,formOptions:t,disabled:r,style:s,className:d,sx:p,onKeyDown:l,value:c,onChangeInput:g,resolvedAddress:C,...f}=a,u=er(),m=o&&u?u.register(o,t):null,[b,S]=n.useState(""),[x,h]=n.useState(!1),[k,j]=n.useState(()=>Wt(c));n.useEffect(()=>{j(Wt(c)),S(""),o&&u&&u.clearErrors(o),h(!1)},[c]);const v=w.useCallbackRef(R=>{let N="";try{j(R);const z=Wt(c),O=C(R);O.toString()!==z&&g?.(O)}catch{N="Invalid Range"}o&&u&&(N?u.setError(o,{message:N}):u.clearErrors(o)),S(N),h(!0)},[k,g,o,u]),T=w.useCallbackRef(async R=>{if(x&&R.keyCode===w.KeyCodes.Escape){const N=Wt(c);j(N),S(""),h(!1),R.stopPropagation()}l?.(R)},[c,g,l,x]),M=w.useCallbackRef(R=>{m?.onBlur(R)},[m]),P=n.useCallback(R=>{v(R.target.value),m?.onChange(R)},[m]),[D,F]=n.useState(!1),E=n.useMemo(()=>e.jsx(B.InputAdornment,{tabIndex:-1,sx:{display:"flex",position:"relative",flex:"0"},position:"end",children:e.jsx(y.ExhibitOptionButton,{disabled:!0,selected:D,onSelectToggle:R=>{F(R)},label:"Select Range",icon:e.jsx(w.DynamicIcon,{iconKey:"SelectRangeMode"})})}),[D]);return e.jsx(B.FormControl,{sx:{paddingTop:R=>R.spacing(1.5),minWidth:135,width:"100%",...p},size:"small",ref:i,className:ie("range-input",d),...f,children:e.jsx(B.TextField,{label:"Range",placeholder:"Enter Range",onBlur:M,disabled:r,error:!!b,inputRef:m?.ref,helperText:b||" ",sx:{"& .MuiFormHelperText-root":{marginTop:R=>R.spacing(.5)}},slotProps:{input:{endAdornment:E},inputLabel:{shrink:!0},htmlInput:{spellCheck:!1,autoComplete:"off",readOnly:r,name:o,sx:{paddingTop:R=>R.spacing(1.25),paddingBottom:R=>R.spacing(.75)}}},value:k??"",onChange:P,onKeyDownCapture:T,onContextMenu:R=>{R.stopPropagation()}})})}));qo.displayName="RangeInput";const Be=[];Be.push(De("Primary Background","bg1")),Be.push(De("Primary Text","tx1")),Be.push(De("Secondary Background","bg2")),Be.push(De("Secondary Text","tx2")),Be.push(De("Accent 1","accent1")),Be.push(De("Accent 2","accent2")),Be.push(De("Accent 3","accent3")),Be.push(De("Accent 4","accent4")),Be.push(De("Accent 5","accent5")),Be.push(De("Accent 6","accent6"));const tr=a=>{const{docTheme:i,onSelectTheme:o,darkMode:t,isSelected:r,outlined:s,sx:d,...p}=a,l=q.useTheme(),c=n.useMemo(()=>{let g=[];for(let C=0;C<Be.length;C++){const f=Be[C];g.push(e.jsx(io,{schemeColorLookup:i.schemeLookup(),colorDef:f,darkMode:t,selectedColor:null},C+"-colorDef"))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(B.Box,{sx:{display:"flex",boxShadow:C=>C.shadows[2]},children:g})})},[i,l]);return e.jsx(y.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:g=>`solid ${r?g.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:g=>`solid ${g.palette.text.primary} 1px !important`}},icon:null,...p,children:e.jsxs(B.Box,{sx:{border:g=>`solid ${g.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:g=>r?g.palette.text.primary:void 0,"&:hover:not([disabled])":{color:g=>g.palette.text.primary}},children:[e.jsx(B.Box,{sx:{},children:i.getName()}),e.jsxs(B.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[c,e.jsx(B.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>i.getFontScheme().getMajorFont()},children:e.jsx(y.SimpleTooltip,{disableInteractive:!0,slotProps:{popper:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}}},title:e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
7
7
  The heading font is '${i.getFontScheme().getMajorFont()}'.`}),placement:"bottom-start",children:e.jsx("div",{children:i.getFontScheme().getMinorFont()})})})]})]})})},or=n.memo(n.forwardRef((a,i)=>{const{themes:o,selectedTheme:t,onSelectTheme:r,sx:s,disabled:d=!1,darkMode:p,...l}=a,c=n.useMemo(()=>{const g=o?.getItems({selected:t})??[],C=[];if(g.length===0)return e.jsx(y.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"6px",paddingBottom:"6px"},children:"No themes"});const f=g.length;for(let u=0;u<f;u++){const m=g[u],b=t&&m?.getName()===t.getName(),S=g[u+1];S&&S.isCustom()!==m.isCustom()&&C.push(e.jsx(y.ExhibitDivider,{orientation:"horizontal",sx:{marginBottom:"4px"}},`divider-${u}`)),C.push(e.jsx(tr,{docTheme:m,onSelectTheme:()=>r(m),isSelected:b,disabled:d,darkMode:p,onMouseDown:x=>{x.button===0&&x.preventDefault()},onMouseUp:x=>{x.button===0&&r(m)},onKeyDown:x=>{x.keyCode!==w.KeyCodes.Enter&&x.keyCode!==w.KeyCodes.Space||r(m)}},m.getName()))}return C},[t,r,p]);return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:i,...l,children:e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsx(y.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"2px"},children:"Themes"}),e.jsx(y.ExhibitDivider,{}),e.jsx(B.Box,{sx:{flex:"1 1 100%",overflow:"auto",padding:"6px 16px"},children:c})]})})})),nr=n.memo(n.forwardRef((a,i)=>{const{themes:o,selectedTheme:t,onSelectTheme:r,icon:s,tooltip:d,label:p,variant:l=y.PopupButtonType.Toolbar,darkMode:c,panelProps:g,...C}=a,f=s||e.jsx(w.DynamicIcon,{iconKey:"Theme2"}),u=n.useCallback(b=>{const{closeFloatAll:S}=b;return e.jsx(or,{...g,themes:o,selectedTheme:t,onSelectTheme:r,darkMode:c,onKeyDown:x=>{x.which===w.KeyCodes.Enter&&S()}})},[o,t,r,g,c]),m={createPopupPanel:u,tooltip:d||p||"Theme",label:p,icon:f,...C};return l===y.PopupButtonType.Toolbar?e.jsx(y.ExhibitPopupIconButton,{ref:i,...m}):e.jsx(y.ExhibitPopupMenuItem,{ref:i,...m})})),Go=n.memo(n.forwardRef((a,i)=>{const{sheet:o,className:t,debounceDelay:r=220,sx:s,...d}=a,[p,l]=n.useState(()=>o.getView().getZoomScale()),[c,g]=n.useState(null),C=n.useRef(0);oe.useModelListener(o,{onViewChange:()=>{g(!0),C.current===0&&l(o.getView().getZoomScale())}}),n.useEffect(()=>{C.current=0,g(!1),l(o.getView().getZoomScale())},[o]),n.useEffect(()=>{C.current!==0&&A.CommonUtils.debounce(()=>{p===C.current&&(C.current=0,o.getView().update({zoomScale:p}))},r)()},[p,r]);const f=w.useCallbackRef(M=>{let P=M;M<100?P=Math.round(M/(10/9)+10):M>100&&(P=Math.round(3*M-200)),C.current=P,g(!0),l(P)},[o]),u=M=>{let P=M;return M<100?P=10/9*(M-10):M>100&&(P=(M+200)/3),P},m=u(p),[b,S]=n.useState(null),x=n.useRef(null),h=n.useCallback(()=>{const M=b;M&&requestAnimationFrame(()=>{x.current?.contains(document.activeElement)&&M.focus()})},[]),k=w.useMouseDownAndHoldListener(()=>{f(u(A.CommonUtils.findNextStep(o.getView().getZoomScale(),!1,10)))}),j=w.useMouseDownAndHoldListener(()=>f(u(A.CommonUtils.findNextStep(o.getView().getZoomScale(),!0,10)))),v=q.useTheme(),T=n.useMemo(()=>`${A.IFont.getSharedMeasurer()("100%",Math.round(v.typography.fontSize),v.typography.fontFamily).width}px`,[v]);return e.jsxs(B.Box,{ref:i,className:ie(t),sx:{padding:"0px 0px",display:"flex",alignItems:"center",color:M=>M.palette.text.secondary,...s},onFocus:M=>{M.relatedTarget&&!b&&S(M.relatedTarget)},onBlur:M=>{b&&!x?.current?.contains(M.relatedTarget)&&S(null)},onMouseDown:M=>{M.button===0&&M.preventDefault()},onMouseUp:M=>{M.button===0&&h()},...d,children:[e.jsx(y.SimpleTooltip,{disableInteractive:!0,title:"Zoom Out",children:e.jsx(B.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:M=>M.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:M=>{M.button!==0?M.preventDefault():k(M)},children:e.jsx(w.DynamicIcon,{iconKey:"Remove"})})}),e.jsx(B.Slider,{ref:x,sx:{flex:"1 1 100%",padding:"6px 0px !important",marginRight:"2px",marginLeft:"2px","& .MuiSlider-thumb":{height:14,width:6,borderRadius:.75,"&.Mui-focusVisible":{boxShadow:M=>`0px 0px 0px 3px ${y.hexToRGB(M.palette.primary.main,.16)}`},"&:focus, &:hover, &.Mui-active":{boxShadow:M=>`0px 0px 0px 2px ${y.hexToRGB(M.palette.primary.main,.16)}`}},"& .MuiSlider-mark":{width:"1px",height:"8px"},"& .MuiSlider-markActive":{backgroundColor:"currentColor"},"& .MuiSlider-thumb:not(.MuiSlider-active)":{transition:c?"left 260ms ease-in":"none"}},valueLabelDisplay:"auto",size:"small",track:!1,min:0,step:1,value:m,max:200,marks:[{value:100}],onAnimationEnd:()=>g(!1),onWheel:M=>{f(u(A.CommonUtils.findNextStep(o.getView().getZoomScale(),M.deltaY<0,10)))},onKeyDown:M=>{M.which===w.KeyCodes.Down||M.which===w.KeyCodes.Right?(f(u(A.CommonUtils.findNextStep(o.getView().getZoomScale(),!0,10))),M.preventDefault()):M.which===w.KeyCodes.Up||M.which===w.KeyCodes.Left?(f(u(A.CommonUtils.findNextStep(o.getView().getZoomScale(),!1,10))),M.preventDefault()):M.which!==w.KeyCodes.Enter&&M.which!==w.KeyCodes.Escape||h()},onChange:(M,P)=>{Math.abs(P-100)<3?f(100):f(P)},valueLabelFormat:(M,P)=>`Zoom: ${Math.round(p)}%`}),e.jsx(y.SimpleTooltip,{disableInteractive:!0,title:"Zoom In",children:e.jsx(B.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:M=>M.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:M=>{M.button!==0?M.preventDefault():j(M)},children:e.jsx(w.DynamicIcon,{iconKey:"Add"})})}),e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row"},children:[e.jsx(B.Box,{sx:{minWidth:"8px"}}),e.jsx(B.Typography,{noWrap:!0,component:"div",onClick:()=>{f(100)},sx:{cursor:"pointer",display:"flex",flex:"1 1 100%",fontSize:"0.70rem",marginLeft:"2px",marginRight:"2px",userSelect:"none",justifyContent:"center",width:T},children:e.jsx("div",{children:Math.round(p)+"%"})})]})]})}));Go.displayName="SheetZoomScale";const Xo=n.memo(n.forwardRef((a,i)=>{const{sx:o,sheet:t,gridStyle:r,children:s,childrenEnd:d,...p}=a;n.useImperativeHandle(i,()=>({}));const l=n.useRef(null);n.useEffect(()=>{const u=m=>m.preventDefault();return l.current?.addEventListener("wheel",u,{passive:!1}),()=>{l.current?.removeEventListener("wheel",u)}},[]);const c=w.useEditMode(),g=n.useMemo(()=>{const u=c.getMode();return u?.description?u.description:"Ready"},[c]),[C,f]=n.useState(!1);return e.jsxs(B.Box,{ref:l,sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",overflow:C?"visible":"hidden",boxShadow:`0px -1px 0px ${r.header.edgeStrokeFill}`,...o},onMouseOver:()=>f(!0),onMouseLeave:()=>f(!1),...p,children:[s,e.jsx("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"end",overflow:"hidden"},children:e.jsx(B.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",color:u=>u.palette.text.secondary},variant:"caption",children:g})}),d?e.jsx(B.Box,{sx:{display:"flex",alignItems:"center"},children:d}):null,e.jsx(y.ExhibitDivider,{style:{marginTop:"6px",marginBottom:"6px"}}),e.jsx(Go,{sx:{paddingLeft:"4px",minWidth:"175px"},sheet:t})]})}));Xo.displayName="StatusBar";var Dn,Fn,yo,In,Nn,$t={exports:{}},wt={},kt={exports:{}},On={},An={exports:{}};function Qi(){return Fn?Dn:(Fn=1,Dn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function Ji(){if(In)return yo;In=1;var a=Qi();function i(){}function o(){}return o.resetWarningCache=i,yo=function(){function t(d,p,l,c,g,C){if(C!==a){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}function r(){return t}t.isRequired=t;var s={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:r,element:t,elementType:t,instanceOf:r,node:t,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:o,resetWarningCache:i};return s.PropTypes=s,s},yo}function Ot(){return Nn||(Nn=1,An.exports=Ji()()),An.exports}var Ln,Vt={exports:{}},zn,xe={},He={};function lo(){return zn||(zn=1,Object.defineProperty(He,"__esModule",{value:!0}),He.dontSetMe=function(a,i,o){if(a[i])return new Error(`Invalid prop ${i} passed to ${o} - do not set this, set it on the child.`)},He.findInArray=function(a,i){for(let o=0,t=a.length;o<t;o++)if(i.apply(i,[a[o],o,a]))return a[o]},He.int=function(a){return parseInt(a,10)},He.isFunction=function(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Function]"},He.isNum=function(a){return typeof a=="number"&&!isNaN(a)}),He}var Hn,Wn,We={};function Yo(){if(Wn)return xe;Wn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.addClassName=d,xe.addEvent=function(l,c,g,C){if(!l)return;const f={capture:!0,...C};l.addEventListener?l.addEventListener(c,g,f):l.attachEvent?l.attachEvent("on"+c,g):l["on"+c]=g},xe.addUserSelectStyles=function(l){if(!l)return;let c=l.getElementById("react-draggable-style-el");c||(c=l.createElement("style"),c.type="text/css",c.id="react-draggable-style-el",c.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
8
8
  `,c.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
9
  `,l.getElementsByTagName("head")[0].appendChild(c)),l.body&&d(l.body,"react-draggable-transparent-selection")},xe.createCSSTransform=function(l,c){const g=r(l,c,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:g}},xe.createSVGTransform=function(l,c){return r(l,c,"")},xe.getTouch=function(l,c){return l.targetTouches&&(0,a.findInArray)(l.targetTouches,g=>c===g.identifier)||l.changedTouches&&(0,a.findInArray)(l.changedTouches,g=>c===g.identifier)},xe.getTouchIdentifier=function(l){if(l.targetTouches&&l.targetTouches[0])return l.targetTouches[0].identifier;if(l.changedTouches&&l.changedTouches[0])return l.changedTouches[0].identifier},xe.getTranslation=r,xe.innerHeight=function(l){let c=l.clientHeight;const g=l.ownerDocument.defaultView.getComputedStyle(l);return c-=(0,a.int)(g.paddingTop),c-=(0,a.int)(g.paddingBottom),c},xe.innerWidth=function(l){let c=l.clientWidth;const g=l.ownerDocument.defaultView.getComputedStyle(l);return c-=(0,a.int)(g.paddingLeft),c-=(0,a.int)(g.paddingRight),c},xe.matchesSelector=t,xe.matchesSelectorAndParentsTo=function(l,c,g){let C=l;do{if(t(C,c))return!0;if(C===g)return!1;C=C.parentNode}while(C);return!1},xe.offsetXYFromParent=function(l,c,g){const C=c===c.ownerDocument.body?{left:0,top:0}:c.getBoundingClientRect(),f=(l.clientX+c.scrollLeft-C.left)/g,u=(l.clientY+c.scrollTop-C.top)/g;return{x:f,y:u}},xe.outerHeight=function(l){let c=l.clientHeight;const g=l.ownerDocument.defaultView.getComputedStyle(l);return c+=(0,a.int)(g.borderTopWidth),c+=(0,a.int)(g.borderBottomWidth),c},xe.outerWidth=function(l){let c=l.clientWidth;const g=l.ownerDocument.defaultView.getComputedStyle(l);return c+=(0,a.int)(g.borderLeftWidth),c+=(0,a.int)(g.borderRightWidth),c},xe.removeClassName=p,xe.removeEvent=function(l,c,g,C){if(!l)return;const f={capture:!0,...C};l.removeEventListener?l.removeEventListener(c,g,f):l.detachEvent?l.detachEvent("on"+c,g):l["on"+c]=null},xe.scheduleRemoveUserSelectStyles=function(l){window.requestAnimationFrame?window.requestAnimationFrame(()=>{s(l)}):s(l)};var a=lo(),i=(function(l,c){if(typeof WeakMap=="function")var g=new WeakMap,C=new WeakMap;return(function(f,u){if(!u&&f&&f.__esModule)return f;var m,b,S={__proto__:null,default:f};if(f===null||typeof f!="object"&&typeof f!="function")return S;if(m=u?C:g){if(m.has(f))return m.get(f);m.set(f,S)}for(const x in f)x!=="default"&&{}.hasOwnProperty.call(f,x)&&((b=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(f,x))&&(b.get||b.set)?m(S,x,b):S[x]=f[x]);return S})(l,c)})((function(){if(Hn)return We;Hn=1,Object.defineProperty(We,"__esModule",{value:!0}),We.browserPrefixToKey=g,We.browserPrefixToStyle=function(C,f){return f?`-${f.toLowerCase()}-${C}`:C},We.default=void 0,We.getPrefix=c;const l=["Moz","Webkit","O","ms"];function c(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const f=window.document?.documentElement?.style;if(!f||C in f)return"";for(let u=0;u<l.length;u++)if(g(C,l[u])in f)return l[u];return""}function g(C,f){return f?`${f}${(function(u){let m="",b=!0;for(let S=0;S<u.length;S++)b?(m+=u[S].toUpperCase(),b=!1):u[S]==="-"?b=!0:m+=u[S];return m})(C)}`:C}return We.default=c(),We})());let o="";function t(l,c){return o||(o=(0,a.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(g){return(0,a.isFunction)(l[g])})),!!(0,a.isFunction)(l[o])&&l[o](c)}function r(l,c,g){let{x:C,y:f}=l,u=`translate(${C}${g},${f}${g})`;return c&&(u=`translate(${`${typeof c.x=="string"?c.x:c.x+g}`}, ${`${typeof c.y=="string"?c.y:c.y+g}`})`+u),u}function s(l){if(l)try{if(l.body&&p(l.body,"react-draggable-transparent-selection"),l.selection)l.selection.empty();else{const c=(l.defaultView||window).getSelection();c&&c.type!=="Caret"&&c.removeAllRanges()}}catch{}}function d(l,c){l.classList?l.classList.add(c):l.className.match(new RegExp(`(?:^|\\s)${c}(?!\\S)`))||(l.className+=` ${c}`)}function p(l,c){l.classList?l.classList.remove(c):l.className=l.className.replace(new RegExp(`(?:^|\\s)${c}(?!\\S)`,"g"),"")}return xe}var $n,Ie={};function ar(){if($n)return Ie;$n=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.canDragX=function(t){return t.props.axis==="both"||t.props.axis==="x"},Ie.canDragY=function(t){return t.props.axis==="both"||t.props.axis==="y"},Ie.createCoreData=function(t,r,s){const d=!(0,a.isNum)(t.lastX),p=o(t);return d?{node:p,deltaX:0,deltaY:0,lastX:r,lastY:s,x:r,y:s}:{node:p,deltaX:r-t.lastX,deltaY:s-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:s}},Ie.createDraggableData=function(t,r){const s=t.props.scale;return{node:r.node,x:t.state.x+r.deltaX/s,y:t.state.y+r.deltaY/s,deltaX:r.deltaX/s,deltaY:r.deltaY/s,lastX:t.state.x,lastY:t.state.y}},Ie.getBoundPosition=function(t,r,s){if(!t.props.bounds)return[r,s];let{bounds:d}=t.props;d=typeof d=="string"?d:(function(l){return{left:l.left,top:l.top,right:l.right,bottom:l.bottom}})(d);const p=o(t);if(typeof d=="string"){const{ownerDocument:l}=p,c=l.defaultView;let g;if(d==="parent"?g=p.parentNode:g=p.getRootNode().querySelector(d),!(g instanceof c.HTMLElement))throw new Error('Bounds selector "'+d+'" could not find an element.');const C=g,f=c.getComputedStyle(p),u=c.getComputedStyle(C);d={left:-p.offsetLeft+(0,a.int)(u.paddingLeft)+(0,a.int)(f.marginLeft),top:-p.offsetTop+(0,a.int)(u.paddingTop)+(0,a.int)(f.marginTop),right:(0,i.innerWidth)(C)-(0,i.outerWidth)(p)-p.offsetLeft+(0,a.int)(u.paddingRight)-(0,a.int)(f.marginRight),bottom:(0,i.innerHeight)(C)-(0,i.outerHeight)(p)-p.offsetTop+(0,a.int)(u.paddingBottom)-(0,a.int)(f.marginBottom)}}return(0,a.isNum)(d.right)&&(r=Math.min(r,d.right)),(0,a.isNum)(d.bottom)&&(s=Math.min(s,d.bottom)),(0,a.isNum)(d.left)&&(r=Math.max(r,d.left)),(0,a.isNum)(d.top)&&(s=Math.max(s,d.top)),[r,s]},Ie.getControlPosition=function(t,r,s){const d=typeof r=="number"?(0,i.getTouch)(t,r):null;if(typeof r=="number"&&!d)return null;const p=o(s),l=s.props.offsetParent||p.offsetParent||p.ownerDocument.body;return(0,i.offsetXYFromParent)(d||t,l,s.props.scale)},Ie.snapToGrid=function(t,r,s){const d=Math.round(r/t[0])*t[0],p=Math.round(s/t[1])*t[1];return[d,p]};var a=lo(),i=Yo();function o(t){const r=t.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Ie}var Vn,_n,Kn,Un,vt={},_t={};function rr(){return Vn||(Vn=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.default=function(){}),_t}function el(){if(_n)return vt;_n=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.default=void 0;var a=(function(u,m){if(typeof WeakMap=="function")var b=new WeakMap,S=new WeakMap;return(function(x,h){if(!h&&x&&x.__esModule)return x;var k,j,v={__proto__:null,default:x};if(x===null||typeof x!="object"&&typeof x!="function")return v;if(k=h?S:b){if(k.has(x))return k.get(x);k.set(x,v)}for(const T in x)T!=="default"&&{}.hasOwnProperty.call(x,T)&&((j=(k=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,T))&&(j.get||j.set)?k(v,T,j):v[T]=x[T]);return v})(u,m)})(n),i=p(Ot()),o=p(et),t=Yo(),r=ar(),s=lo(),d=p(rr());function p(u){return u&&u.__esModule?u:{default:u}}function l(u,m,b){return(m=(function(S){var x=(function(h,k){if(typeof h!="object"||!h)return h;var j=h[Symbol.toPrimitive];if(j!==void 0){var v=j.call(h,k);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(h)})(S,"string");return typeof x=="symbol"?x:x+""})(m))in u?Object.defineProperty(u,m,{value:b,enumerable:!0,configurable:!0,writable:!0}):u[m]=b,u}const c={start:"touchstart",move:"touchmove",stop:"touchend"},g={start:"mousedown",move:"mousemove",stop:"mouseup"};let C=g,f=class extends a.Component{constructor(){super(...arguments),l(this,"dragging",!1),l(this,"lastX",NaN),l(this,"lastY",NaN),l(this,"touchIdentifier",null),l(this,"mounted",!1),l(this,"handleDragStart",u=>{if(this.props.onMouseDown(u),!this.props.allowAnyClick&&typeof u.button=="number"&&u.button!==0)return!1;const m=this.findDOMNode();if(!m||!m.ownerDocument||!m.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:b}=m;if(this.props.disabled||!(u.target instanceof b.defaultView.Node)||this.props.handle&&!(0,t.matchesSelectorAndParentsTo)(u.target,this.props.handle,m)||this.props.cancel&&(0,t.matchesSelectorAndParentsTo)(u.target,this.props.cancel,m))return;u.type!=="touchstart"||this.props.allowMobileScroll||u.preventDefault();const S=(0,t.getTouchIdentifier)(u);this.touchIdentifier=S;const x=(0,r.getControlPosition)(u,S,this);if(x==null)return;const{x:h,y:k}=x,j=(0,r.createCoreData)(this,h,k);(0,d.default)("DraggableCore: handleDragStart: %j",j),(0,d.default)("calling",this.props.onStart),this.props.onStart(u,j)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,t.addUserSelectStyles)(b),this.dragging=!0,this.lastX=h,this.lastY=k,(0,t.addEvent)(b,C.move,this.handleDrag),(0,t.addEvent)(b,C.stop,this.handleDragStop))}),l(this,"handleDrag",u=>{const m=(0,r.getControlPosition)(u,this.touchIdentifier,this);if(m==null)return;let{x:b,y:S}=m;if(Array.isArray(this.props.grid)){let h=b-this.lastX,k=S-this.lastY;if([h,k]=(0,r.snapToGrid)(this.props.grid,h,k),!h&&!k)return;b=this.lastX+h,S=this.lastY+k}const x=(0,r.createCoreData)(this,b,S);if((0,d.default)("DraggableCore: handleDrag: %j",x),this.props.onDrag(u,x)!==!1&&this.mounted!==!1)this.lastX=b,this.lastY=S;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const k=document.createEvent("MouseEvents");k.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(k)}}),l(this,"handleDragStop",u=>{if(!this.dragging)return;const m=(0,r.getControlPosition)(u,this.touchIdentifier,this);if(m==null)return;let{x:b,y:S}=m;if(Array.isArray(this.props.grid)){let k=b-this.lastX||0,j=S-this.lastY||0;[k,j]=(0,r.snapToGrid)(this.props.grid,k,j),b=this.lastX+k,S=this.lastY+j}const x=(0,r.createCoreData)(this,b,S);if(this.props.onStop(u,x)===!1||this.mounted===!1)return!1;const h=this.findDOMNode();h&&this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(h.ownerDocument),(0,d.default)("DraggableCore: handleDragStop: %j",x),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,h&&((0,d.default)("DraggableCore: Removing handlers"),(0,t.removeEvent)(h.ownerDocument,C.move,this.handleDrag),(0,t.removeEvent)(h.ownerDocument,C.stop,this.handleDragStop))}),l(this,"onMouseDown",u=>(C=g,this.handleDragStart(u))),l(this,"onMouseUp",u=>(C=g,this.handleDragStop(u))),l(this,"onTouchStart",u=>(C=c,this.handleDragStart(u))),l(this,"onTouchEnd",u=>(C=c,this.handleDragStop(u)))}componentDidMount(){this.mounted=!0;const u=this.findDOMNode();u&&(0,t.addEvent)(u,c.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const u=this.findDOMNode();if(u){const{ownerDocument:m}=u;(0,t.removeEvent)(m,g.move,this.handleDrag),(0,t.removeEvent)(m,c.move,this.handleDrag),(0,t.removeEvent)(m,g.stop,this.handleDragStop),(0,t.removeEvent)(m,c.stop,this.handleDragStop),(0,t.removeEvent)(u,c.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(m)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:o.default.findDOMNode(this)}render(){return a.cloneElement(a.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return vt.default=f,l(f,"displayName","DraggableCore"),l(f,"propTypes",{allowAnyClick:i.default.bool,allowMobileScroll:i.default.bool,children:i.default.node.isRequired,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(u,m){if(u[m]&&u[m].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),l(f,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),vt}function tl(){return Kn||(Kn=1,(function(a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),a.default=void 0;var i=(function(m,b){if(typeof WeakMap=="function")var S=new WeakMap,x=new WeakMap;return(function(h,k){if(!k&&h&&h.__esModule)return h;var j,v,T={__proto__:null,default:h};if(h===null||typeof h!="object"&&typeof h!="function")return T;if(j=k?x:S){if(j.has(h))return j.get(h);j.set(h,T)}for(const M in h)M!=="default"&&{}.hasOwnProperty.call(h,M)&&((v=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(h,M))&&(v.get||v.set)?j(T,M,v):T[M]=h[M]);return T})(m,b)})(n),o=g(Ot()),t=g(et),r=(function(){if(Ln)return Vt.exports;function m(S){var x,h,k="";if(typeof S=="string"||typeof S=="number")k+=S;else if(typeof S=="object")if(Array.isArray(S)){var j=S.length;for(x=0;x<j;x++)S[x]&&(h=m(S[x]))&&(k&&(k+=" "),k+=h)}else for(h in S)S[h]&&(k&&(k+=" "),k+=h);return k}function b(){for(var S,x,h=0,k="",j=arguments.length;h<j;h++)(S=arguments[h])&&(x=m(S))&&(k&&(k+=" "),k+=x);return k}return Ln=1,Vt.exports=b,Vt.exports.clsx=b,Vt.exports})(),s=Yo(),d=ar(),p=lo(),l=g(el()),c=g(rr());function g(m){return m&&m.__esModule?m:{default:m}}function C(){return C=Object.assign?Object.assign.bind():function(m){for(var b=1;b<arguments.length;b++){var S=arguments[b];for(var x in S)({}).hasOwnProperty.call(S,x)&&(m[x]=S[x])}return m},C.apply(null,arguments)}function f(m,b,S){return(b=(function(x){var h=(function(k,j){if(typeof k!="object"||!k)return k;var v=k[Symbol.toPrimitive];if(v!==void 0){var T=v.call(k,j);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(j==="string"?String:Number)(k)})(x,"string");return typeof h=="symbol"?h:h+""})(b))in m?Object.defineProperty(m,b,{value:S,enumerable:!0,configurable:!0,writable:!0}):m[b]=S,m}class u extends i.Component{static getDerivedStateFromProps(b,S){let{position:x}=b,{prevPropsPosition:h}=S;return!x||h&&x.x===h.x&&x.y===h.y?null:((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:x,prevPropsPosition:h}),{x:x.x,y:x.y,prevPropsPosition:{...x}})}constructor(b){super(b),f(this,"onDragStart",(S,x)=>{if((0,c.default)("Draggable: onDragStart: %j",x),this.props.onStart(S,(0,d.createDraggableData)(this,x))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),f(this,"onDrag",(S,x)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",x);const h=(0,d.createDraggableData)(this,x),k={x:h.x,y:h.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:v}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[T,M]=(0,d.getBoundPosition)(this,k.x,k.y);k.x=T,k.y=M,k.slackX=this.state.slackX+(j-k.x),k.slackY=this.state.slackY+(v-k.y),h.x=k.x,h.y=k.y,h.deltaX=k.x-this.state.x,h.deltaY=k.y-this.state.y}if(this.props.onDrag(S,h)===!1)return!1;this.setState(k)}),f(this,"onDragStop",(S,x)=>{if(!this.state.dragging||this.props.onStop(S,(0,d.createDraggableData)(this,x))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",x);const h={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:k,y:j}=this.props.position;h.x=k,h.y=j}this.setState(h)}),this.state={dragging:!1,dragged:!1,x:b.position?b.position.x:b.defaultPosition.x,y:b.position?b.position.y:b.defaultPosition.y,prevPropsPosition:{...b.position},slackX:0,slackY:0,isElementSVG:!1},!b.position||b.onDrag||b.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??t.default.findDOMNode(this)}render(){const{axis:b,bounds:S,children:x,defaultPosition:h,defaultClassName:k,defaultClassNameDragging:j,defaultClassNameDragged:v,position:T,positionOffset:M,scale:P,...D}=this.props;let F={},E=null;const R=!T||this.state.dragging,N=T||h,z={x:(0,d.canDragX)(this)&&R?this.state.x:N.x,y:(0,d.canDragY)(this)&&R?this.state.y:N.y};this.state.isElementSVG?E=(0,s.createSVGTransform)(z,M):F=(0,s.createCSSTransform)(z,M);const O=(0,r.clsx)(x.props.className||"",k,{[j]:this.state.dragging,[v]:this.state.dragged});return i.createElement(l.default,C({},D,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),i.cloneElement(i.Children.only(x),{className:O,style:{...x.props.style,...F},transform:E}))}}a.default=u,f(u,"displayName","Draggable"),f(u,"propTypes",{...l.default.propTypes,axis:o.default.oneOf(["both","x","y","none"]),bounds:o.default.oneOfType([o.default.shape({left:o.default.number,right:o.default.number,top:o.default.number,bottom:o.default.number}),o.default.string,o.default.oneOf([!1])]),defaultClassName:o.default.string,defaultClassNameDragging:o.default.string,defaultClassNameDragged:o.default.string,defaultPosition:o.default.shape({x:o.default.number,y:o.default.number}),positionOffset:o.default.shape({x:o.default.oneOfType([o.default.number,o.default.string]),y:o.default.oneOfType([o.default.number,o.default.string])}),position:o.default.shape({x:o.default.number,y:o.default.number}),className:p.dontSetMe,style:p.dontSetMe,transform:p.dontSetMe}),f(u,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(On)),On}function ir(){if(Un)return kt.exports;Un=1;const{default:a,DraggableCore:i}=tl();return kt.exports=a,kt.exports.default=a,kt.exports.DraggableCore=i,kt.exports}var qn,Kt={};function ol(){if(qn)return Kt;qn=1,Kt.__esModule=!0,Kt.cloneElement=function(s,d){return d.style&&s.props.style&&(d.style=t(t({},s.props.style),d.style)),d.className&&s.props.className&&(d.className=s.props.className+" "+d.className),i.default.cloneElement(s,d)};var a,i=(a=n)&&a.__esModule?a:{default:a};function o(s,d){var p=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(s,c).enumerable})),p.push.apply(p,l)}return p}function t(s){for(var d=1;d<arguments.length;d++){var p=arguments[d]!=null?arguments[d]:{};d%2?o(Object(p),!0).forEach(function(l){r(s,l,p[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(p)):o(Object(p)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(p,l))})}return s}function r(s,d,p){return(d=(function(l){var c=(function(g,C){if(typeof g!="object"||g===null)return g;var f=g[Symbol.toPrimitive];if(f!==void 0){var u=f.call(g,C);if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(g)})(l,"string");return typeof c=="symbol"?c:String(c)})(d))in s?Object.defineProperty(s,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[d]=p,s}return Kt}var Gn,Xn,jt={};function lr(){if(Gn)return jt;Gn=1,jt.__esModule=!0,jt.resizableProps=void 0;var a,i=(a=Ot())&&a.__esModule?a:{default:a};ir();var o={axis:i.default.oneOf(["both","x","y","none"]),className:i.default.string,children:i.default.element.isRequired,draggableOpts:i.default.shape({allowAnyClick:i.default.bool,cancel:i.default.string,children:i.default.node,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:i.default.node,grid:i.default.arrayOf(i.default.number),handle:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number}),height:function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];var d,p=r[0];return p.axis==="both"||p.axis==="y"?(d=i.default.number).isRequired.apply(d,r):i.default.number.apply(i.default,r)},handle:i.default.oneOfType([i.default.node,i.default.func]),handleSize:i.default.arrayOf(i.default.number),lockAspectRatio:i.default.bool,maxConstraints:i.default.arrayOf(i.default.number),minConstraints:i.default.arrayOf(i.default.number),onResizeStop:i.default.func,onResizeStart:i.default.func,onResize:i.default.func,resizeHandles:i.default.arrayOf(i.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:i.default.number,width:function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];var d,p=r[0];return p.axis==="both"||p.axis==="x"?(d=i.default.number).isRequired.apply(d,r):i.default.number.apply(i.default,r)}};return jt.resizableProps=o,jt}function sr(){if(Xn)return wt;Xn=1,wt.__esModule=!0,wt.default=void 0;var a=(function(f,u){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var m=s(u);if(m&&m.has(f))return m.get(f);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in f)if(x!=="default"&&Object.prototype.hasOwnProperty.call(f,x)){var h=S?Object.getOwnPropertyDescriptor(f,x):null;h&&(h.get||h.set)?Object.defineProperty(b,x,h):b[x]=f[x]}return b.default=f,m&&m.set(f,b),b})(n),i=ir(),o=ol(),t=lr(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(f){if(typeof WeakMap!="function")return null;var u=new WeakMap,m=new WeakMap;return(s=function(b){return b?m:u})(f)}function d(){return d=Object.assign?Object.assign.bind():function(f){for(var u=1;u<arguments.length;u++){var m=arguments[u];for(var b in m)Object.prototype.hasOwnProperty.call(m,b)&&(f[b]=m[b])}return f},d.apply(this,arguments)}function p(f,u){var m=Object.keys(f);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(f);u&&(b=b.filter(function(S){return Object.getOwnPropertyDescriptor(f,S).enumerable})),m.push.apply(m,b)}return m}function l(f){for(var u=1;u<arguments.length;u++){var m=arguments[u]!=null?arguments[u]:{};u%2?p(Object(m),!0).forEach(function(b){c(f,b,m[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(m)):p(Object(m)).forEach(function(b){Object.defineProperty(f,b,Object.getOwnPropertyDescriptor(m,b))})}return f}function c(f,u,m){return(u=(function(b){var S=(function(x,h){if(typeof x!="object"||x===null)return x;var k=x[Symbol.toPrimitive];if(k!==void 0){var j=k.call(x,h);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(x)})(b,"string");return typeof S=="symbol"?S:String(S)})(u))in f?Object.defineProperty(f,u,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[u]=m,f}function g(f,u){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,b){return m.__proto__=b,m},g(f,u)}var C=(function(f){var u,m;function b(){for(var x,h=arguments.length,k=new Array(h),j=0;j<h;j++)k[j]=arguments[j];return(x=f.call.apply(f,[this].concat(k))||this).handleRefs={},x.lastHandleRect=null,x.slack=null,x}m=f,(u=b).prototype=Object.create(m.prototype),u.prototype.constructor=u,g(u,m);var S=b.prototype;return S.componentWillUnmount=function(){this.resetData()},S.resetData=function(){this.lastHandleRect=this.slack=null},S.runConstraints=function(x,h){var k=this.props,j=k.minConstraints,v=k.maxConstraints,T=k.lockAspectRatio;if(!j&&!v&&!T)return[x,h];if(T){var M=this.props.width/this.props.height,P=x-this.props.width,D=h-this.props.height;Math.abs(P)>Math.abs(D*M)?h=x/M:x=h*M}var F=x,E=h,R=this.slack||[0,0],N=R[0],z=R[1];return x+=N,h+=z,j&&(x=Math.max(j[0],x),h=Math.max(j[1],h)),v&&(x=Math.min(v[0],x),h=Math.min(v[1],h)),this.slack=[N+(F-x),z+(E-h)],[x,h]},S.resizeHandler=function(x,h){var k=this;return function(j,v){var T=v.node,M=v.deltaX,P=v.deltaY;x==="onResizeStart"&&k.resetData();var D=(k.props.axis==="both"||k.props.axis==="x")&&h!=="n"&&h!=="s",F=(k.props.axis==="both"||k.props.axis==="y")&&h!=="e"&&h!=="w";if(D||F){var E=h[0],R=h[h.length-1],N=T.getBoundingClientRect();k.lastHandleRect!=null&&(R==="w"&&(M+=N.left-k.lastHandleRect.left),E==="n"&&(P+=N.top-k.lastHandleRect.top)),k.lastHandleRect=N,R==="w"&&(M=-M),E==="n"&&(P=-P);var z=k.props.width+(D?M/k.props.transformScale:0),O=k.props.height+(F?P/k.props.transformScale:0),H=k.runConstraints(z,O);z=H[0],O=H[1];var I=z!==k.props.width||O!==k.props.height,W=typeof k.props[x]=="function"?k.props[x]:null;W&&!(x==="onResize"&&!I)&&(j.persist==null||j.persist(),W(j,{node:T,size:{width:z,height:O},handle:h})),x==="onResizeStop"&&k.resetData()}}},S.renderResizeHandle=function(x,h){var k=this.props.handle;if(!k)return a.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+x,ref:h});if(typeof k=="function")return k(x,h);var j=l({ref:h},typeof k.type=="string"?{}:{handleAxis:x});return a.cloneElement(k,j)},S.render=function(){var x=this,h=this.props,k=h.children,j=h.className,v=h.draggableOpts;h.width,h.height,h.handle,h.handleSize,h.lockAspectRatio,h.axis,h.minConstraints,h.maxConstraints,h.onResize,h.onResizeStop,h.onResizeStart;var T=h.resizeHandles;h.transformScale;var M=(function(P,D){if(P==null)return{};var F,E,R={},N=Object.keys(P);for(E=0;E<N.length;E++)F=N[E],D.indexOf(F)>=0||(R[F]=P[F]);return R})(h,r);return(0,o.cloneElement)(k,l(l({},M),{},{className:(j?j+" ":"")+"react-resizable",children:[].concat(k.props.children,T.map(function(P){var D,F=(D=x.handleRefs[P])!=null?D:x.handleRefs[P]=a.createRef();return a.createElement(i.DraggableCore,d({},v,{nodeRef:F,key:"resizableHandle-"+P,onStop:x.resizeHandler("onResizeStop",P),onStart:x.resizeHandler("onResizeStart",P),onDrag:x.resizeHandler("onResize",P)}),x.renderResizeHandle(P,F))}))}))},b})(a.Component);return wt.default=C,C.propTypes=t.resizableProps,C.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},wt}var Yn,Zn,Tt={};function nl(){if(Yn)return Tt;Yn=1,Tt.__esModule=!0,Tt.default=void 0;var a=(function(u,m){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var b=d(m);if(b&&b.has(u))return b.get(u);var S={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in u)if(h!=="default"&&Object.prototype.hasOwnProperty.call(u,h)){var k=x?Object.getOwnPropertyDescriptor(u,h):null;k&&(k.get||k.set)?Object.defineProperty(S,h,k):S[h]=u[h]}return S.default=u,b&&b.set(u,S),S})(n),i=s(Ot()),o=s(sr()),t=lr(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(u){return u&&u.__esModule?u:{default:u}}function d(u){if(typeof WeakMap!="function")return null;var m=new WeakMap,b=new WeakMap;return(d=function(S){return S?b:m})(u)}function p(){return p=Object.assign?Object.assign.bind():function(u){for(var m=1;m<arguments.length;m++){var b=arguments[m];for(var S in b)Object.prototype.hasOwnProperty.call(b,S)&&(u[S]=b[S])}return u},p.apply(this,arguments)}function l(u,m){var b=Object.keys(u);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(u);m&&(S=S.filter(function(x){return Object.getOwnPropertyDescriptor(u,x).enumerable})),b.push.apply(b,S)}return b}function c(u){for(var m=1;m<arguments.length;m++){var b=arguments[m]!=null?arguments[m]:{};m%2?l(Object(b),!0).forEach(function(S){g(u,S,b[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(b)):l(Object(b)).forEach(function(S){Object.defineProperty(u,S,Object.getOwnPropertyDescriptor(b,S))})}return u}function g(u,m,b){return(m=(function(S){var x=(function(h,k){if(typeof h!="object"||h===null)return h;var j=h[Symbol.toPrimitive];if(j!==void 0){var v=j.call(h,k);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(h)})(S,"string");return typeof x=="symbol"?x:String(x)})(m))in u?Object.defineProperty(u,m,{value:b,enumerable:!0,configurable:!0,writable:!0}):u[m]=b,u}function C(u,m){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,S){return b.__proto__=S,b},C(u,m)}var f=(function(u){var m,b;function S(){for(var x,h=arguments.length,k=new Array(h),j=0;j<h;j++)k[j]=arguments[j];return(x=u.call.apply(u,[this].concat(k))||this).state={width:x.props.width,height:x.props.height,propsWidth:x.props.width,propsHeight:x.props.height},x.onResize=function(v,T){var M=T.size;x.props.onResize?(v.persist==null||v.persist(),x.setState(M,function(){return x.props.onResize&&x.props.onResize(v,T)})):x.setState(M)},x}return b=u,(m=S).prototype=Object.create(b.prototype),m.prototype.constructor=m,C(m,b),S.getDerivedStateFromProps=function(x,h){return h.propsWidth!==x.width||h.propsHeight!==x.height?{width:x.width,height:x.height,propsWidth:x.width,propsHeight:x.height}:null},S.prototype.render=function(){var x=this.props,h=x.handle,k=x.handleSize;x.onResize;var j=x.onResizeStart,v=x.onResizeStop,T=x.draggableOpts,M=x.minConstraints,P=x.maxConstraints,D=x.lockAspectRatio,F=x.axis;x.width,x.height;var E=x.resizeHandles,R=x.style,N=x.transformScale,z=(function(O,H){if(O==null)return{};var I,W,ee={},X=Object.keys(O);for(W=0;W<X.length;W++)I=X[W],H.indexOf(I)>=0||(ee[I]=O[I]);return ee})(x,r);return a.createElement(o.default,{axis:F,draggableOpts:T,handle:h,handleSize:k,height:this.state.height,lockAspectRatio:D,maxConstraints:P,minConstraints:M,onResizeStart:j,onResize:this.onResize,onResizeStop:v,resizeHandles:E,transformScale:N,width:this.state.width},a.createElement("div",p({},z,{style:c(c({},R),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},S})(a.Component);return Tt.default=f,f.propTypes=c(c({},t.resizableProps),{},{children:i.default.element}),Tt}var al=(Zn||(Zn=1,$t.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},$t.exports.Resizable=sr().default,$t.exports.ResizableBox=nl().default),$t.exports);const Zo=n.memo(n.forwardRef((a,i)=>{const{disabled:o,names:t,workbook:r,restoreFocus:s,readonly:d=!1,disabled:p=!1,commandPopupButtonProps:l,sx:c,...g}=a,C=w.useNotifier(),[f,u]=n.useState(null),[m,b]=n.useState(()=>r.getSelectedRanges().getCoords()),[S,x]=n.useState(!1),{reference:h}=y.useFloatStack({parentFloat:l?.parentFloat}),[k,j]=n.useState(()=>d||!r.getProtection().isStructureAllowed()),v=()=>f?.text??"",[T,M]=n.useState(v),P=w.useCallbackRef(()=>{if(h?.closeAll(),!T){const _=v();return M(v()),_}if(v()===T)return T;const $=T.trim().toLowerCase();if($==="r"||$==="c")return T;try{const _=r.getRanges(T);if(_)return _.toString()}catch{}const U=t.getByName(T);if(U&&U.getRanges())return T;let Y=null;try{const _=r.getRanges(T),L=_.getCoords().map(G=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G}));Y=r.getRanges(L)}catch{}if(!Y){const _=r.getSelectedRanges().getCoords().map(L=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...L}));Y=r.getRanges(_)}try{let _=t.getByName(T);k||_||(_=t.addReference(T,Y)),_&&u({text:_.getName()})}catch(_){M(v()),C.showMessage?.(_.message,{type:w.NotifierType.Error})}return null},[T,t,h,k,C]),D=w.useCallbackRef(()=>{if(r.isClosed())return;const $=[];for(let _=0;_<m.length;_++){const L=m[_];$.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...L})}let U=null;try{U=t.lookupByRanges($)}catch{}let Y=null;Y=U?.length>0?U[0].getName():r.getSelectedSheet().getSelectedRange().toString(),u({text:Y})},[r,m]),[F,E]=n.useState(()=>t?.getItems()??null);oe.useModelListener(t,{onCollectionChange($){E(t.getItems()),D()},onClose($){E([])}}),n.useEffect(()=>{M(v())},[f,m]);const[R,N]=n.useState(r?.getSelectedSheet());oe.useModelListener(r,{onProtectionChange:$=>{j(d||!$.getProtection().isStructureAllowed())},onSheetsChange:$=>{N($?.getSelectedSheet())},onViewChange($){N($?.getSelectedSheet())}});const[z,O]=n.useState(null),H=w.useCallbackRef(A.CommonUtils.debounce(D,z?320:0),[]);oe.useModelListener(R.getSelection(),{onChange:()=>{b($=>{const U=r.getSelectedRanges().getCoords();return A.CoordUtils.isEqualRangesArrays(U,$)?$:U})},onAdjustingChange:$=>{O($.getAdjusting())}}),n.useEffect(()=>{if(z){const $=r.getSelectedRange(),U=$.getRowCount(),Y=$.getColumnCount();let _=`${U}R x ${Y}C`;if(_.length>17&&(_=`${U}x${Y}`),U>1||Y>1)return void u({text:_,fontStyle:"italic",justifyContent:"center"})}u({text:r.getSelectedSheet().getSelectedRange().toString()}),H()},[m,r,z]);const I=n.useRef(null),W=n.useCallback($=>{const{onMouseDown:U,onMouseUp:Y,..._}=$;return e.jsx(B.IconButton,{..._,sx:{..._?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:e.jsx(B.Input,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:I},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:L=>`1px solid ${L.palette.text.icon??L.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:L=>`1px solid ${L.palette.primary.main}`},"::after":{borderBottom:L=>`1px solid ${L.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",height:"1rem",fontSize:11*A.IFont.getDeviceScale(),fontStyle:f?.fontStyle,paddingLeft:L=>L.spacing(.75),paddingRight:L=>L.spacing(.75),boxShadow:"none",flex:"1",color:L=>L.palette.text.secondary,input:{padding:"0",height:"1rem",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:L=>L.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:L=>L.palette.text.primary}}},value:T,onFocus:L=>{L.target?.select()},onKeyDown:L=>{if(L.which===w.KeyCodes.Enter||L.which===w.KeyCodes.Tab){let G=T;v()!==T&&(L.stopPropagation(),L.preventDefault(),G=P()),G?ee(G):s?.()}else if(L.which===w.KeyCodes.Escape)v()!==T?(M(v()),setTimeout(()=>{L.target?.select()},0),L.stopPropagation(),L.preventDefault()):s?.();else if(L.which===w.KeyCodes.Space)return void L.stopPropagation()},onBlur:()=>{M(v())},onChange:L=>{M(L.target.value)}})})},[T,f]),ee=w.useCallbackRef(async $=>{try{h?.closeAll();const U=t.lookupByRanges($)?.[0];U&&await U?.select(),await r.getRanges($)?.select()}catch(U){C.showMessage?.(U.message,{type:w.NotifierType.Error})}},[t,C,r]),X=n.useCallback($=>{setTimeout(()=>{x(!0)},0);const U={variant:w.CommandButtonType.Menuitem,parentFloat:$.floatReference,commandHook:{...l?.commandHook,beforeExecute:(re,me)=>(h?.closeAll(),l?.commandHook?.beforeExecute?.(re,me))},scope:l?.scope,commands:l?.commands};let Y=t.getItems({scope:r?.getSelectedSheet().getName()});Y=Y.sort((re,me)=>re.getType()===me.getType()?re.getName().localeCompare(me.getName()):re.getType()==="range"?-1:1);const _=k?null:["editNamedReference","deleteNamedReference"],L=k?null:["editTable",null,"convertTableToRange","deleteTable"],G=[],Q=Y.length;for(let re=0;re<Q;re++){const me=Y[re],Se=me.getRanges();if(!Se||me.isHidden())continue;const Ce=me.getType();Ce!==Y[re-1]?.getType()&&(re>0&&G.push(e.jsx(y.ExhibitDivider,{orientation:"horizontal"},`type-divider-${G.length}`)),G.push(e.jsx(y.ExhibitMenuHeader,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:me.getType()==="reference"?"Ranges":"Tables"},`type-header-${G.length}`))),Ce==="reference"?G.push(n.createElement(y.SimpleCommandPopupButton,{...U,key:"named-"+G.length,popupCommandKeys:_,popupScope:"namedItem",scope:"namedItem",commandState:me,commands:l?.commands,label:me.getName(),quickCommand:"selectNamed",disabled:!me.getRanges()||p,icon:"NamedRange"})):Ce==="table"&&G.push(n.createElement(y.SimpleCommandPopupButton,{...U,key:"namedItem-"+G.length,popupCommandKeys:L,popupScope:"namedItem",scope:"namedItem",commands:l?.commands,commandState:me,label:me.getName(),quickCommand:"selectNamed",disabled:!Se||p,icon:"InsertTable"}))}const fe=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...g,children:[k?null:e.jsx(y.CommandButton,{...U,scope:"namedItem",command:l?.commands.getCommand("addNamedReference")}),G&&G.length>0?e.jsxs(e.Fragment,{children:[k?null:e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:G})]}):null]});return y.defaultCreatePopupPanel({...$,children:fe})},[r,F,t,f,k]),ne=w.useImperativeElement(i,()=>({focus($){I.current?.focus($)}}),[]);return e.jsx(B.Box,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...c},ref:tt([ne,i]),...g,children:e.jsx(y.ExhibitPopupIconButton,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%"},...c},buttonProps:{sx:{backgroundColor:$=>$.palette.background.paper,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`}},tabIndex:-1,outlined:{color:$=>o?$.palette.action.disabled:q.alpha($.palette.divider,.2)},parentFloat:h,createPopupPanel:X,onPopupOpen:()=>x(!0),onPopupClose:()=>x(!1),createTooltip:({children:$},U)=>e.jsx(y.ExhibitTooltip,{title:U||S?"":"Name Box",disabled:U,leaveDelay:0,sx:{opacity:U||S?0:1},children:$}),createQuickButton:W})})}));Zo.displayName="NamedCollectionEditor";const rl=(a,i)=>e.jsx(Zo,{ref:i,...a}),Qo=n.memo(n.forwardRef((a,i)=>{const{sx:o,workbook:t,sheetElement:r,gridStyle:s,showNamedCollectionEditor:d=!0,NamedCollectionEditorProps:p,renderNamedCollectionEditor:l=rl,disabled:c,commands:g,...C}=a,[f,u]=n.useState(t?.getSelectedSheet());oe.useModelListener(t,{onSheetsChange:L=>{u(L?.getSelectedSheet())},onViewChange(L){u(L?.getSelectedSheet())}});const[m,b]=n.useState(f.getSelection().getCoords().cell),S=f.getRange(m).getCell(),x=c||!S.isEditAllowed(),h=n.useRef(null),k=n.useMemo(()=>({fontSize:11}),[]);oe.useModelListener(f.getSelection(),{onChange:()=>{b(f.getSelection().getCoords().cell)}}),oe.useModelListener(f,{onProtectionChange(){b(f.getSelection().getCoords().cell)}});const j=h.current?.getLineHeight()??20,[v,T]=n.useState(j),[M,P]=n.useState(5),[D,F]=n.useState(1),E=w.useCallbackRef((L,{size:G})=>{L.preventDefault(),L.stopPropagation();const Q=Math.floor(G.height/j);T(Q*j+1),Q>1&&P(Q)},[j]),R=w.useCallbackRef((L,{size:G})=>{const Q=Math.floor(G.height/j);F(Q)},[j]),N=w.useEditMode(),z=N.getMode();let O=null;z?.key==="edit"&&(O=z.args?.stateAndCoords);const H=n.useMemo(()=>{let L=O?.editState;return L||(L=oe.createCellEditStateFromCell(()=>f.getRange(m).getCell())),e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:e.jsx(oe.SheetCellEditor,{ref:h,activeCoords:m,sheet:f,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:m})},defaultTextStyle:k,useRichStyling:!1,disabled:x,onChangeEdit:G=>{if(G.dirty!==void 0){const Q={sheet:f,coords:m,editState:G};N.setMode(fe=>({...fe,args:{...fe?.args,stateAndCoords:Q}}))}},editState:L,commands:g,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:D})})},[f,O,m,D,r]),I=n.useRef(null),W=n.useMemo(()=>d?l({names:t.getNames(),workbook:t,...p},I):null,[l,p,d,f,t,x]),ee=n.useMemo(()=>e.jsxs(B.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,border:L=>`solid ${x?L.palette.action.disabled:q.alpha(L.palette.divider,.2)} 1px`},children:[e.jsx(y.ExhibitIconButton,{sx:{border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"warning","aria-label":"cancel-formula-edit",icon:e.jsx(w.DynamicIcon,{iconKey:"CloseError"}),tooltipProps:{label:"Cancel",simple:!0},disabled:x||O===null,onMouseDown:L=>{L.button===0&&L.preventDefault()},onClick:()=>{r.cancelEdit()}}),e.jsx(y.ExhibitIconButton,{sx:{border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"primary","aria-label":"commit-formula-edit",icon:e.jsx(w.DynamicIcon,{iconKey:"CheckSuccess"}),tooltipProps:{label:"Enter",simple:!0},disabled:x||O===null,onMouseDown:L=>{L.button===0&&L.preventDefault()},onClick:()=>{r.submitEdit()}}),e.jsx(y.ExhibitIconButton,{sx:{border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,disabled:!0,"aria-label":"commit-formula-function",icon:e.jsx(w.DynamicIcon,{iconKey:"Function",style:{transform:"scale(0.85)"}}),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:L=>{L.button===0&&L.preventDefault()}})]}),[x,O]),X=q.useTheme(),[ne,$]=n.useState(!1),U=n.useMemo(()=>e.jsxs(B.Box,{className:"formula-bar",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:L=>L.spacing(.5),alignItems:"start"},children:[ee,e.jsxs(B.Paper,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:L=>L.typography.fontFamily,fontSize:11*A.IFont.getDeviceScale(),alignItems:"stretch",paddingTop:"2px",paddingBottom:"2px",boxShadow:"none",borderRadius:L=>`${L.shape.borderRadius}px`,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,border:L=>`solid ${x?L.palette.action.disabled:q.alpha(L.palette.divider,.2)} 1px`,"& textarea":{color:L=>x?`${L.palette.text.disabled} !important`:L.palette.text.primary},"& .react-resizable-handle":{width:"100%",height:"8px",backgroundColor:"transparent",boxSizing:"content-box",zIndex:1e3},"& .react-resizable-handle-s":{position:"absolute",bottom:"-10px",cursor:"s-resize"}},onFocus:()=>$(!0),onBlur:()=>$(!1),onMouseDown:L=>{L.target?.classList.contains("react-resizable-handle")&&L.preventDefault()},children:[e.jsx(B.Box,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignItems:"center",marginTop:"0px",paddingLeft:L=>L.spacing(1),paddingRight:L=>L.spacing(1)},children:e.jsx(al.ResizableBox,{height:v,draggableOpts:{grid:[j,j]},minConstraints:[j,j],maxConstraints:[15*j,15*j],onResize:R,onResizeStop:E,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:H})}),e.jsx(y.ExhibitIconButton,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,"aria-label":"toggle-expand-formula-edit",icon:e.jsx(w.DynamicIcon,{iconKey:D>1?"ExpandLess":"ExpandMore"}),tooltipProps:{label:(D>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:L=>{L.button===0&&L.preventDefault()},onClick:()=>{const L=D>1?1:M;T(L*j+1),F(L)}}),e.jsx(B.Box,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:ne?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:L=>L.palette.primary.main,borderRadius:L=>`${L.shape.borderRadius}px`}})]})]}),[ee,H,ne,D,j]),Y=n.useMemo(()=>W||U?!W&&U?U:W&&!U?W:e.jsx(e.Fragment,{children:e.jsx(w.SplitPane,{fixedPane:"before",minBefore:"165px",minAfter:"200px",paneBeforeProps:{style:{alignItems:"flex-start"}},paneAfterProps:{style:{overflow:"visible"}},resizerProps:{style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${X.palette.text.icon??X.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center calc(((var(--icon-size, 24) - 13px + 5px) / 2))",minWidth:"18px",marginRight:"1px"}},elementBefore:W,elementAfter:U})}):null,[W,U]),_=w.useImperativeElement(i,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>I.current}),[]);return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:L=>L.spacing(.5),...o},ref:_,...C,children:Y})}));Qo.displayName="FormulaBar";const Jo=n.memo(n.forwardRef((a,i)=>{const{filter:o,commands:t,disabled:r,sx:s,floatReference:d,...p}=a,l=n.useMemo(()=>({}),[]),c=n.useMemo(()=>({commandHook:{beforeExecute:(f,u)=>d.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:d}),[r,d]),g=n.useMemo(()=>({...l,...c,variant:w.CommandButtonType.Menuitem}),[l,c]),C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,command:t.getCommand("sortAscending")}),e.jsx(y.CommandButton,{...g,command:t.getCommand("sortDescending")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...g,command:t.getCommand("autoFilterClear")}),[]]});return e.jsx(B.Box,{ref:i,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...s},...p,children:C})}));Jo.displayName="FilterColumnMenu";const cr=n.memo(n.forwardRef((a,i)=>{const{children:o,className:t,disabled:r,style:s,filter:d,...p}=a,l=w.useImperativeElement(i,()=>({isFilters:()=>!0}),[]);return e.jsx("div",{ref:l,className:ie("filters",t),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...s},...p,children:e.jsxs("div",{style:{flex:"1 1 100%",display:"flex",minHeight:"100px",minWidth:"220px",alignItems:"center",border:"grey solid 1px",padding:"4px 4px",overflow:"hidden",flexDirection:"column",justifyContent:"space-evenly",marginTop:"4px",marginBottom:"4px",marginLeft:"16px",marginRight:"16px"},children:[e.jsx("div",{children:d.getName()}),e.jsx("div",{children:"Filter Widget"})]})})}));cr.displayName="Filters";const en=n.memo(n.forwardRef((a,i)=>{const{children:o,sheet:t,style:r,className:s,value:d,index:p,editing:l,editable:c,disabled:g,selectedIndex:C,dragging:f,borderColor:u,borderWidth:m,activeColor:b,background:S="white",tabRadius:x=4,gridTheme:h,...k}=a,[j,v]=n.useState(()=>!!t&&t.getProtection().isLocked()),[T,M]=n.useState(()=>t?t.getTabColor():null);oe.useModelListener(t,{onProtectionChange:()=>{v(t.getProtection().isLocked())},onTabColorChange:()=>{M(t.getTabColor())},onStyleChange:()=>{M(t.getTabColor())}});const P=q.useTheme(),D=C===p;let F=null,E=null;if(T||f){let z=S;T?(E=T.toBlackOrWhite().toCSS(),z=T?.toCSS()):D||(z=P.palette.background.paper),F=e.jsx(B.Box,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:D?"50%":"100%",borderRadius:"4px",border:O=>D?`${S} solid 1px`:`${O.palette.divider} solid 1px`,background:D&&T?`linear-gradient(0deg, ${z} 0%, transparent)`:z}})}let R=null;typeof u=="string"?R=u:u?.toCSS&&(R=u.toCSS());const N=D?e.jsx(B.Box,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:z=>z.palette.primary.main}}):null;return e.jsx(q.ThemeProvider,{theme:D?h??P:P,children:e.jsx(B.Box,{ref:i,className:ie(s),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:D?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:f?"grabbing":void 0},...k,children:e.jsx(w.RoundedTab,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:x,strokeColor:D?R:"transparent",children:e.jsx(B.Button,{sx:{textTransform:"none",borderRadius:"0px",minHeight:"0px",paddingLeft:"11px",paddingRight:"12px",paddingTop:"3px",flex:"1 1 100%",paddingBottom:"3px",fontWeight:D?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:f?"grabbing":void 0,color:D?"primary":E||"text.secondary",backgroundColor:D?S:"transparent","&:hover:not([disabled])":{backgroundColor:D?S:"transparent"},"& input":{color:z=>`${z.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:g,disableRipple:l,component:"div",children:e.jsxs(e.Fragment,{children:[F,e.jsxs(B.Box,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:D?void 0:"1px"},children:[o,N]}),j?e.jsx(w.DynamicIcon,{iconKey:"Lock",style:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):e.jsx(B.Box,{sx:{minHeight:"22px"}})]})]})},d+":"+p)})})})}));en.displayName="SheetTab";const tn=n.memo(n.forwardRef((a,i)=>{const{workbook:o,index:t,commands:r,scope:s="sheet",disabled:d,floatReference:p,sx:l,className:c,tabStripRef:g,...C}=a,[f,u]=n.useState(o?.getProtection());oe.useModelListener(o,{onProtectionChange:h=>{u(h?.getProtection())}});const m=n.useMemo(()=>({}),[]),b=n.useMemo(()=>({commandHook:{beforeExecute:(h,k)=>p.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:s,commandState:t,disabled:d||t===void 0,parentFloat:p}),[d,p]),S=n.useMemo(()=>({...m,...b}),[m,b]),x=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{command:r.getCommand("addSheet"),commandState:t,...S,variant:w.CommandButtonType.Menuitem}),e.jsx(y.CommandButton,{command:r.getCommand("deleteSheet"),...S,variant:w.CommandButtonType.Menuitem}),e.jsxs(y.ExhibitMenuItem,{onMouseDown:h=>{h.button===0&&h.preventDefault()},onMouseUp:()=>{Promise.resolve(p.closeAll()).then(()=>{g?.startEdit(t)})},disabled:d||!f.isStructureAllowed(),parentFloat:p,children:["Rename",s!=="sheet"?" Sheet":""]}),e.jsx(y.CommandButton,{command:r.getCommand("duplicateSheet"),...S,variant:w.CommandButtonType.Menuitem}),e.jsx(y.CommandButton,{command:r?.getCommand("protectionSheetToggle"),...S,variant:w.CommandButtonType.Menuitem}),e.jsx(ht,{variant:w.CommandButtonType.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:e.jsx(w.DynamicIcon,{iconKey:"stroke.colored"}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:pt.End},parentFloat:p}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{command:r.getCommand("hideSheet"),...S,variant:w.CommandButtonType.Menuitem})]});return e.jsx(B.Box,{ref:i,className:ie("menu",c),sx:{...l},...C,children:x})}));tn.displayName="SheetTabMenu";const on=n.memo(n.forwardRef((a,i)=>{const{workbook:o,gridStyle:t,floatReference:r,closeFloatAll:s,className:d,...p}=a,[l,c]=n.useState(o?.getSheets().getItems()),[g,C]=n.useState(o?.getProtection());oe.useModelListener(o,{onSheetsChange:u=>{c(u.getSheets().getItems())},onProtectionChange:u=>{C(u?.getProtection())}});const f=n.useMemo(()=>{const u=[],m=o.getSheets().getItems({visibility:A.ISheet.Visibility.Hidden}),b=o.getSelectedSheet();for(let S=0;S<m.length;S++){const x=m[S],h=x.getVisibility();if(h===A.ISheet.Visibility.VeryHidden)continue;const k=b===x,j=x.getProtection().isLocked(),v=x.getTabColor(),T=t?.body.fill??"transparent";let M=null,P=null,D=T;v&&(D=v.toCSS(),k||(P=v.toBlackOrWhite().toCSS()),M=e.jsx(B.Box,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:k?D:"transparent",borderRadius:"4px",border:`solid 1px ${t.header.edgeStrokeFill}`},children:e.jsx(B.Box,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:k||h===A.ISheet.Visibility.Hidden?"50%":"100%",border:E=>k?`${T} solid 1.5px`:`${E.palette.divider} solid 1px`,background:k&&v?`linear-gradient(0deg, ${D} 0%, ${T})`:D,borderRadius:"4px"}})}));let F=null;j&&(F=e.jsx(w.DynamicIcon,{iconKey:"Lock"})),h!==A.ISheet.Visibility.Visible&&(F=e.jsx(w.DynamicIcon,{iconKey:"VisibilityOff",style:{opacity:g.isStructureAllowed()?1:.7},color:"secondary"})),F&&(F=e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:F})),u.push(e.jsx(y.ExhibitMenuItem,{disabled:!g.isStructureAllowed()&&h===A.ISheet.Visibility.Hidden,sx:{color:E=>{let R=k?E.palette.primary.main:E.palette.text.secondary;return P&&(R=P),h===A.ISheet.Visibility.Hidden&&(R=Re.alpha(R,E.palette.action.disabledOpacity)),R},borderLeft:E=>`${k?E.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",paddingTop:"4px",paddingBottom:"4px",fontWeight:k?"700":"400","&:hover":{fontWeight:"700"}},icon:k?e.jsx(y.SelectedIcon,{}):void 0,onMouseDown:E=>E.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{x.select()}catch(E){console.error(E)}})},children:e.jsxs(e.Fragment,{children:[M,e.jsxs(B.Box,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[e.jsxs(B.Box,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[x.getName(),e.jsx(B.Box,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:x.getName()})]}),F]})]})},""+S))}return u},[o,g,l,r,t]);return e.jsx(B.Box,{ref:i,className:ie("menu",d),...p,children:f})}));on.displayName="SheetsAllMenu";let Ut=!1,dr=!1,$e=null;const Qn=async a=>{const i=await A.LicenseManager.getDetails();if(dr||i.isEval()){try{const o=top??window;o.SheetXL||(o.SheetXL=Object.freeze({getSelectedWorkbook:()=>$e?.getWorkbook(),getSelectedSheet:()=>$e?.getWorkbook().getSelectedSheet(),getSelectedRange:()=>$e?.getWorkbook().getSelectedRange(),getSelectedRanges:()=>$e?.getWorkbook().getSelectedRanges(),getRange:t=>$e?.getWorkbook().getRange(t),getSelectedWorkbookElement:()=>$e,getLicenseManager:()=>A.LicenseManager,moreExamples:()=>{console.table({"SheetXL.getRange('Sheet1!e5:f6').setValues([[110, 220], [210, 220]])":{Summary:"Set an array of values."},"SheetXL.getRange('a1:e5').setValue(100)":{Summary:"Set a single repeating value to a range."},"SheetXL.getRange('Sheet1!e5:f6').getValues()":{Summary:"Get the values as a 2d array (see forEach)."},"SheetXL.getSelectedRange().setValue(new Date())":{Summary:"Set current date/time using Javascript Date."},"SheetXL.getSelectedRange().setValue('10/23/95')":{Summary:"Set current date/time using string."},"SheetXL.getSelectedSheet().getUsedRange().getValues()":{Summary:"Get all of the values in a sheet."},"SheetXL.getSelectedRange().getStyle().update({ fill: 'accent4' })":{Summary:"Set fill to theme color 4."},"SheetXL.getRange('E:L').getStyle().update({ fill: 'accent1 lumMod 90 lumOff 40' })":{Summary:"Set some columns to a modified theme color."},"SheetXL.getRange('e5:f10').getStyle().update({ style: { border: 'double blue' }})":{Summary:"Set border."},"SheetXL.getCell().getStyle().fill.toCSS()":{Summary:"Get the fill style as css for the selected cell."},"SheetXL.getRange('a1:a3').autoFill('a1:a7')":{Summary:"Autofill down."},"SheetXL.getRange('e7:i9').merge({ orientation: 'rows' })":{Summary:"Merge cells horizontally."},"SheetXL.getSelectedRange().sort({ ascending: false, hasHeader: false })":{Summary:"Sort selected cells ascending with a header."},"SheetXL.getSelectedRange().clear('all')":{Summary:"Clear the current range a different way."},"SheetXL.getSelectedSheet().getTables().add('b2:e9')":{Summary:"Create a 4x8 table at b2 for current sheet."},"SheetXL.getRange('a1:c3').copyFrom('e1:g3')":{Summary:"Copy cells."},"SheetXL.getRange('c:t').getColumnHeaders().setSize(30)":{Summary:"Set the size of columns to 30 pixels."},"SheetXL.getRange('2:3').delete()":{Summary:"Remove rows 2 and 3 and shift up."},"SheetXL.getSelectedSheet().getMovables().addImage('https://www.sheetxl.com/logo-text.svg')":{Summary:"Add an image."},"SheetXL.getSelectedSheet().getMovables().addImage('https://www.sheetxl.com/logo-text.svg', { bounds: { height: 100 } })":{Summary:"Add an image of height 100."},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue(1.50).getStyle().update({ numberFormat: '0%' }).autoFit(); }, 'Enter 150%')":{Summary:"Set value to 100 and numberformat to 0% as a single."},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue('Remind Me Later').getStyle().update({ namedStyle: 'Note'}).autoFit(); }, 'Set Reminder')":{Summary:"Set a value and style to Note style and autofit text."},"SheetXL.getSelectedWorkbook().getNames().addReference('Small_Range', 'A2:E5');":{Summary:"Add a named range."},"SheetXL.getSelectedWorkbook().getRange('a1:e5').addListener((e) => { console.log('got an update for:', e.getSource().toString()) })":{Summary:"Listen for updates at a range."}})}}))}catch(o){o instanceof DOMException||console.error(o),Ut=!0}if($e!==a&&($e=a,!Ut))try{Ut=!0,(top??window).SheetXL&&(await A.LicenseManager._validate(!0),A.LicenseManager.wasPrinted()&&(()=>{je.CommonUtils.consoleWithNoSource(`%cTip: You can access the API directly in the console.
@@ -17,4 +17,4 @@ Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modif
17
17
  13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},_l=function(){return n.createElement(co,null,n.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
18
18
  0 22,12A10,10 0 0,0 12,2Z`}))},Qe={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:n.createElement(Wl,null),warning:n.createElement($l,null),error:n.createElement(Vl,null),info:n.createElement(_l,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:_r,transitionDuration:{enter:225,exit:195}},Kl=function(a,i){return function(o,t){return t===void 0&&(t=!1),t?ce({},Qe[o],{},i[o],{},a[o]):o==="autoHideDuration"?(r=a.autoHideDuration,s=i.autoHideDuration,(d=function(p){return typeof p=="number"||p===null})(r)?r:d(s)?s:Qe.autoHideDuration):o==="transitionDuration"?(function(p,l){var c=function(g,C){return C.some(function(f){return typeof g===f})};return c(p,["string","number"])?p:c(p,["object"])?ce({},Qe.transitionDuration,{},c(l,["object"])&&l,{},p):c(l,["string","number"])?l:c(l,["object"])?ce({},Qe.transitionDuration,{},l):Qe.transitionDuration})(a.transitionDuration,i.transitionDuration):a[o]||i[o]||Qe[o];var r,s,d}};function Lt(a){return Object.entries(a).reduce(function(i,o){var t,r=o[0],s=o[1];return ce({},i,((t={})[r]=No(s),t))},{})}var Ul="notistack-SnackbarContainer",ql="notistack-Snackbar",Kr="notistack-CollapseWrapper",Gl="notistack-MuiContent",Xl=function(a){return"notistack-MuiContent-"+a},ga=Lt({root:{height:0},entered:{height:"auto"}}),Eo="0px",Ur=n.forwardRef(function(a,i){var o=a.children,t=a.in,r=a.onExited,s=n.useRef(null),d=n.useRef(null),p=Oo(i,d),l=function(){return s.current?s.current.clientHeight:0};return n.createElement(pn,{in:t,unmountOnExit:!0,onEnter:function(c){c.style.height=Eo},onEntered:function(c){c.style.height="auto"},onEntering:function(c){var g=l(),C=ao({timeout:175,mode:"enter"}),f=C.duration,u=C.easing;c.style.transitionDuration=typeof f=="string"?f:f+"ms",c.style.height=g+"px",c.style.transitionTimingFunction=u||""},onExit:function(c){c.style.height=l()+"px"},onExited:r,onExiting:function(c){$r(c);var g=ao({timeout:175,mode:"exit"}),C=g.duration,f=g.easing;c.style.transitionDuration=typeof C=="string"?C:C+"ms",c.style.height=Eo,c.style.transitionTimingFunction=f||""},nodeRef:d,timeout:175},function(c,g){return n.createElement("div",Object.assign({ref:p,className:Ke(ga.root,c==="entered"&&ga.entered),style:ce({pointerEvents:"all",overflow:"hidden",minHeight:Eo,transition:mt("height")},c==="entered"&&{overflow:"visible"},{},c==="exited"&&!t&&{visibility:"hidden"})},g),n.createElement("div",{ref:s,className:Kr,style:{display:"flex",width:"100%"}},o))})});Ur.displayName="Collapse";var xa={right:"left",left:"right",bottom:"up",top:"down"},Yl=function(a){return"anchorOrigin"+mn(a)},Zl=function(){};function It(a,i){return a.reduce(function(o,t){return t==null?o:function(){for(var r=arguments.length,s=new Array(r),d=0;d<r;d++)s[d]=arguments[d];var p=[].concat(s);i&&p.indexOf(i)===-1&&p.push(i),o.apply(this,p),t.apply(this,p)}},Zl)}var Ql=typeof window<"u"?n.useLayoutEffect:n.useEffect;function ba(a){var i=n.useRef(a);return Ql(function(){i.current=a}),n.useCallback(function(){return i.current.apply(void 0,arguments)},[])}var Bo,qr=n.forwardRef(function(a,i){var o=a.children,t=a.className,r=a.autoHideDuration,s=a.disableWindowBlurListener,d=s!==void 0&&s,p=a.onClose,l=a.id,c=a.open,g=a.SnackbarProps,C=g===void 0?{}:g,f=n.useRef(),u=ba(function(){p&&p.apply(void 0,arguments)}),m=ba(function(x){p&&x!=null&&(f.current&&clearTimeout(f.current),f.current=setTimeout(function(){u(null,"timeout",l)},x))});n.useEffect(function(){return c&&m(r),function(){f.current&&clearTimeout(f.current)}},[c,r,m]);var b=function(){f.current&&clearTimeout(f.current)},S=n.useCallback(function(){r!=null&&m(.5*r)},[r,m]);return n.useEffect(function(){if(!d&&c)return window.addEventListener("focus",S),window.addEventListener("blur",b),function(){window.removeEventListener("focus",S),window.removeEventListener("blur",b)}},[d,S,c]),n.createElement("div",Object.assign({ref:i},C,{className:Ke(ql,t),onMouseEnter:function(x){C.onMouseEnter&&C.onMouseEnter(x),b()},onMouseLeave:function(x){C.onMouseLeave&&C.onMouseLeave(x),S()}}),o)});qr.displayName="Snackbar";var Jl=Lt({root:(Bo={display:"flex",flexWrap:"wrap",flexGrow:1},Bo[to]={flexGrow:"initial",minWidth:"288px"},Bo)}),fn=n.forwardRef(function(a,i){var o=a.className,t=At(a,["className"]);return n.createElement("div",Object.assign({ref:i,className:Ke(Jl.root,o)},t))});fn.displayName="SnackbarContent";var Rt=Lt({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"}}),ya="notistack-snackbar",Gr=n.forwardRef(function(a,i){var o=a.id,t=a.message,r=a.action,s=a.iconVariant,d=a.variant,p=a.hideIconVariant,l=a.style,c=a.className,g=s[d],C=r;return typeof C=="function"&&(C=C(o)),n.createElement(fn,{ref:i,role:"alert","aria-describedby":ya,style:l,className:Ke(Gl,Xl(d),Rt.root,Rt[d],c,!p&&g&&Rt.lessPadding)},n.createElement("div",{id:ya,className:Rt.message},p?null:g,t),C&&n.createElement("div",{className:Rt.action},C))});Gr.displayName="MaterialDesignContent";var Pt,Ro,Yt,Zt,Po,es=n.memo(Gr),ts=Lt({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),os=function(a){var i=n.useRef(),o=n.useState(!0),t=o[0],r=o[1],s=It([a.snack.onClose,a.onClose]),d=n.useCallback(function(){i.current=setTimeout(function(){r(function(P){return!P})},125)},[]);n.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var p,l=a.snack,c=a.classes,g=a.Component,C=g===void 0?es:g,f=n.useMemo(function(){return(function(P){P===void 0&&(P={});var D={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(P).filter(function(F){return!D[F]}).reduce(function(F,E){var R;return ce({},F,((R={})[E]=P[E],R))},{})})(c)},[c]),u=l.open,m=l.SnackbarProps,b=l.TransitionComponent,S=l.TransitionProps,x=l.transitionDuration,h=l.disableWindowBlurListener,k=l.content,j=At(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),v=ce({direction:(p=j.anchorOrigin,p.horizontal!=="center"?xa[p.horizontal]:xa[p.vertical]),timeout:x},S),T=k;typeof T=="function"&&(T=T(j.id,j.message));var M=["onEnter","onEntered","onExit","onExited"].reduce(function(P,D){var F;return ce({},P,((F={})[D]=It([a.snack[D],a[D]],j.id),F))},{});return n.createElement(Ur,{in:t,onExited:M.onExited},n.createElement(qr,{open:u,id:j.id,disableWindowBlurListener:h,autoHideDuration:j.autoHideDuration,className:Ke(ts.wrappedRoot,f.root,f[Yl(j.anchorOrigin)]),SnackbarProps:m,onClose:s},n.createElement(b,Object.assign({},v,{appear:!0,in:u,onExit:M.onExit,onExited:d,onEnter:M.onEnter,onEntered:It([M.onEntered,function(){a.snack.requestClose&&s(null,"instructed",a.snack.id)}],j.id)}),T||n.createElement(C,Object.assign({},j)))))},Mt={default:20},Qt={default:6,dense:2},Ca="."+Kr,Jt=Lt({root:(Pt={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:mt(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},Pt[Ca]={padding:Qt.default+"px 0px",transition:"padding 300ms ease 0ms"},Pt.maxWidth="calc(100% - "+2*Mt.default+"px)",Pt[To]={width:"100%",maxWidth:"calc(100% - 32px)"},Pt),rootDense:(Ro={},Ro[Ca]={padding:Qt.dense+"px 0px"},Ro),top:{top:Mt.default-Qt.default+"px",flexDirection:"column"},bottom:{bottom:Mt.default-Qt.default+"px",flexDirection:"column-reverse"},left:(Yt={left:Mt.default+"px"},Yt[to]={alignItems:"flex-start"},Yt[To]={left:"16px"},Yt),right:(Zt={right:Mt.default+"px"},Zt[to]={alignItems:"flex-end"},Zt[To]={right:"16px"},Zt),center:(Po={left:"50%",transform:"translateX(-50%)"},Po[to]={alignItems:"center"},Po)}),ns=function(a){var i=a.classes,o=i===void 0?{}:i,t=a.anchorOrigin,r=a.dense,s=a.children,d=Ke(Ul,Jt[t.vertical],Jt[t.horizontal],Jt.root,o.containerRoot,o["containerAnchorOrigin"+mn(t)],r&&Jt.rootDense);return n.createElement("div",{className:d},s)},as=n.memo(ns),Sa=function(a){return!(typeof a=="string"||n.isValidElement(a))},rs=(function(a){function i(o){var t;return(t=a.call(this,o)||this).enqueueSnackbar=function(r,s){if(s===void 0&&(s={}),r==null)throw new Error("enqueueSnackbar called with invalid argument");var d=Sa(r)?r:s,p=Sa(r)?r.message:r,l=d.key,c=d.preventDuplicate,g=At(d,["key","preventDuplicate"]),C=qt(l),f=C?l:new Date().getTime()+Math.random(),u=Kl(g,t.props),m=ce({id:f},g,{message:p,open:!0,entered:!1,requestClose:!1,persist:u("persist"),action:u("action"),content:u("content"),variant:u("variant"),anchorOrigin:u("anchorOrigin"),disableWindowBlurListener:u("disableWindowBlurListener"),autoHideDuration:u("autoHideDuration"),hideIconVariant:u("hideIconVariant"),TransitionComponent:u("TransitionComponent"),transitionDuration:u("transitionDuration"),TransitionProps:u("TransitionProps",!0),iconVariant:u("iconVariant",!0),style:u("style",!0),SnackbarProps:u("SnackbarProps",!0),className:Ke(t.props.className,g.className)});return m.persist&&(m.autoHideDuration=void 0),t.setState(function(b){if(c===void 0&&t.props.preventDuplicate||c){var S=function(k){return C?k.id===f:k.message===p},x=b.queue.findIndex(S)>-1,h=b.snacks.findIndex(S)>-1;if(x||h)return b}return t.handleDisplaySnack(ce({},b,{queue:[].concat(b.queue,[m])}))}),f},t.handleDisplaySnack=function(r){return r.snacks.length>=t.maxSnack?t.handleDismissOldest(r):t.processQueue(r)},t.processQueue=function(r){var s=r.queue,d=r.snacks;return s.length>0?ce({},r,{snacks:[].concat(d,[s[0]]),queue:s.slice(1,s.length)}):r},t.handleDismissOldest=function(r){if(r.snacks.some(function(l){return!l.open||l.requestClose}))return r;var s=!1,d=!1;r.snacks.reduce(function(l,c){return l+(c.open&&c.persist?1:0)},0)===t.maxSnack&&(d=!0);var p=r.snacks.map(function(l){return s||l.persist&&!d?ce({},l):(s=!0,l.entered?(l.onClose&&l.onClose(null,"maxsnack",l.id),t.props.onClose&&t.props.onClose(null,"maxsnack",l.id),ce({},l,{open:!1})):ce({},l,{requestClose:!0}))});return ce({},r,{snacks:p})},t.handleEnteredSnack=function(r,s,d){if(!qt(d))throw new Error("handleEnteredSnack Cannot be called with undefined key");t.setState(function(p){return{snacks:p.snacks.map(function(l){return l.id===d?ce({},l,{entered:!0}):ce({},l)})}})},t.handleCloseSnack=function(r,s,d){t.props.onClose&&t.props.onClose(r,s,d);var p=d===void 0;t.setState(function(l){var c=l.snacks,g=l.queue;return{snacks:c.map(function(C){return p||C.id===d?C.entered?ce({},C,{open:!1}):ce({},C,{requestClose:!0}):ce({},C)}),queue:g.filter(function(C){return C.id!==d})}})},t.closeSnackbar=function(r){var s=t.state.snacks.find(function(d){return d.id===r});qt(r)&&s&&s.onClose&&s.onClose(null,"instructed",r),t.handleCloseSnack(null,"instructed",r)},t.handleExitedSnack=function(r,s){if(!qt(s))throw new Error("handleExitedSnack Cannot be called with undefined key");t.setState(function(d){var p=t.processQueue(ce({},d,{snacks:d.snacks.filter(function(l){return l.id!==s})}));return p.queue.length===0?p:t.handleDismissOldest(p)})},t.enqueueSnackbar,t.closeSnackbar,t.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:t.enqueueSnackbar.bind(da(t)),closeSnackbar:t.closeSnackbar.bind(da(t))}},t}return Hr(i,a),i.prototype.render=function(){var o=this,t=this.state.contextValue,r=this.props,s=r.domRoot,d=r.children,p=r.dense,l=p!==void 0&&p,c=r.Components,g=c===void 0?{}:c,C=r.classes,f=this.state.snacks.reduce(function(m,b){var S,x=mn(b.anchorOrigin),h=m[x]||[];return ce({},m,((S={})[x]=[].concat(h,[b]),S))},{}),u=Object.keys(f).map(function(m){var b=f[m],S=b[0];return n.createElement(as,{key:m,dense:l,anchorOrigin:S.anchorOrigin,classes:C},b.map(function(x){return n.createElement(os,{key:x.id,snack:x,classes:C,Component:g[x.variant],onClose:o.handleCloseSnack,onEnter:o.props.onEnter,onExit:o.props.onExit,onExited:It([o.handleExitedSnack,o.props.onExited],x.id),onEntered:It([o.handleEnteredSnack,o.props.onEntered],x.id)})}))});return n.createElement(Wr.Provider,{value:t},d,s?et.createPortal(u,s):u)},zr(i,[{key:"maxSnack",get:function(){return this.props.maxSnack||Qe.maxSnack}}]),i})(n.Component),Xr=function(){return n.useContext(Wr)};const is=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],handler:null,isDefault:!0},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:null},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:null}],ls=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",handler:null,isDefault:!0},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:null},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:null}];class Yr{constructor(i=is,o=ls){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...i]),this._writeFormatType=Object.freeze([...o])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const i=[],o=this._readFormatType;for(let t=0;t<o.length;t++)for(let r=0;r<o[t].exts.length;r++)i.push("."+o[t].exts[r]);return i}async writeFile(i,o,t){if(!o||!i)throw new Error("Workbook model or file name must be provided.");try{return(await import("@sheetxl/io")).WorkbookIO.writeFile(i,o,t)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(i,o){let t,r;const s=await o?.showBusy?.(`Opening${i.name?` ${i.name}`:""}...`);try{r=await import("@sheetxl/io")}catch(d){throw d}try{return await r.WorkbookIO.read({...i,progress:{async onStart(d){await i?.progress?.onStart?.(d),t=await o?.showBusy?.(`Opening '${d}'...`)}}})}catch(d){throw s?.(),t?.(),d}finally{s?.(),t?.()}}}const Ve=new Yr,Le={card:"_card_1a398_7",actionRoot:"_actionRoot_1a398_11",icons:"_icons_1a398_16",expand:"_expand_1a398_22",expandOpen:"_expandOpen_1a398_29",stackTraceContainer:"_stackTraceContainer_1a398_33"},Zr=n.memo(n.forwardRef((a,i)=>{const{id:o,message:t,iconVariant:r,error:s,hideIconVariant:d,...p}=a,{closeSnackbar:l}=Xr(),c=q.useTheme(),[g,C]=n.useState(!1),f=je.ErrorUtils.collectErrorChain(s,!0)?.[0]?.error,u=f&&!(f instanceof je.ExpectedError),m=n.useCallback(()=>{C(x=>!x)},[]),b=n.useCallback(()=>{l(o)},[o,l]);let S=f?.message;return!S&&n.isValidElement(t)&&(S=t),S||typeof t!="string"||(S=t),S||(S=`Unknown Error: ${t}`),e.jsx(fn,{ref:i,className:ie(Le.root,"error-snackbar"),children:e.jsxs(B.Card,{className:Le.card,style:{backgroundColor:c.palette.error.dark,border:`1px solid ${c.palette.error.dark}`},children:[e.jsxs(B.CardActions,{className:Le.actionRoot,children:[d?null:r?.error,e.jsx(B.Typography,{variant:"body2",component:"div",className:Le.typography,children:S}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsxs("div",{className:Le.icons,children:[u?e.jsx(B.IconButton,{"aria-label":"Show more",size:"small",className:ie(Le.expand,{[Le.expandOpen]:g}),onClick:m,children:e.jsx(w.DynamicIcon,{iconKey:"ExpandMore"})}):null,e.jsx(B.IconButton,{size:"small",className:Le.expand,onClick:b,children:e.jsx(w.DynamicIcon,{iconKey:"Close",style:{transform:"scale(0.8)"}})})]})]}),u?e.jsx(B.Collapse,{in:g,timeout:"auto",children:e.jsx("div",{className:Le.stackTraceContainer,style:{backgroundColor:c.palette.error.light,borderTop:`1px solid ${c.palette.error.main}`},children:e.jsx(y.StackTrace,{error:s,hideLineNumbers:!0})})}):null]})})}));Zr.displayName="ToastError";const Qr=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r="workbook",disabled:s=!1,...d}=a,p=w.useCallbackRef(c=>{const g={variant:w.CommandButtonType.Menuitem,parentFloat:c.floatReference,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(y.CommandButton,{...g,command:o.getCommand("newWorkbook")}),e.jsx(y.ExhibitDivider,{orientation:"horizontal"}),e.jsx(y.CommandButton,{...g,command:o.getCommand("openWorkbook")}),e.jsx(y.CommandPopupButton,{...g,commands:o,quickCommand:"saveWorkbook",createPopupPanel:f=>{const u={...g,parentFloat:f.floatReference,scope:"saveWorkbook"},m=[];return Ve.getWriteFormats().forEach(b=>{if(b.isDefault)return;const S=b.key,x=o.getCommand(`saveWorkbookAs${S}`);x?m.push(n.createElement(y.CommandButton,{...u,key:S,command:x})):console.warn(`Unable to resolve command: 'saveWorkbookAs${S}'`)}),y.defaultCreatePopupPanel({...f,children:m,onClick:()=>{f.closeFloatAll()}})}})]});return y.defaultCreatePopupPanel({...c,children:C,onClick:f=>{f.isDefaultPrevented||c.closeFloatAll()}})},[s,o,t,r]),l="File";return e.jsx(y.CommandPopupButton,{commands:o,disabled:s,commandHook:t,scope:r,label:l,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:c=>`calc(1.25rem + ${c.spacing(2)}px)`}},...d,createPopupPanel:p,icon:e.jsx(y.LabelIcon,{className:"label",icon:null,label:l})})}));Qr.displayName="StandaloneFileCommandButton";const ss=e.jsx(y.ExhibitTooltip,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:e.jsx(B.Box,{sx:{width:"24px",height:"24px",marginBottom:"4px",marginLeft:"6px"},children:e.jsx(oe.LogoNoPaddingIcon,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),Jr=n.memo(n.forwardRef((a,i)=>{const{commands:o,workbook:t,logo:r=ss,mainElement:s,showFileMenu:d=!0,showAppearanceMenu:p=!0,...l}=a,{reference:c}=y.useFloatStack(),[g,{width:C}]=_e(),f=C<530,u=d?e.jsx(Qr,{commands:o,commandHook:{beforeExecute(){c?.closeAll()},onError(x,h,k){}}}):null,m=p?e.jsx(Fr,{commands:o,commandHook:{beforeExecute(){c?.closeAll()},onError(x,h,k){}}}):null,b=n.useMemo(()=>({paddingLeft:x=>x.spacing(1),paddingRight:x=>x.spacing(1)}),[]),S=n.useRef(null);return e.jsx(B.Box,{ref:tt([S,g,i]),...l,children:vr({commands:o,renderCompact:f,workbook:t,selectWrapper:x=>e.jsxs(B.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:h=>h.spacing(1),paddingLeft:h=>h.spacing(1),paddingRight:h=>h.spacing(1)},children:[e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:h=>h.spacing(.5)},children:[r,e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:h=>h.spacing(.25)},children:[u,x]})]}),e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:s}),e.jsx(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:f&&!m?"0 0 auto":"1 1 100%"},children:m})]}),selectProps:b,toolbarsProps:{Home:{sx:{}}}})})}));Jr.displayName="StudioToolbar";const ei=n.memo(a=>{const{workbook:i,setWorkbook:o,refWorkbookTitle:t,titleWorkbook:r,setWorkbookTitle:s,titlePlaceHolder:d,children:p,undoManager:l,commands:c,importExportDisabled:g,themeOptions:C}=a,f=(b=>{const{workbook:S,setWorkbook:x,importExportDisabled:h,workbookTitle:k="export",setWorkbookTitle:j,requestWorkbookTitle:v,themeOptions:T,undoManager:M,commands:P,onExecute:D}=b,F=w.useNotifier(),E=w.useCallbackRef(T?.onModeChange,[T?.onModeChange]),R=w.useCallbackRef(T?.onEnabledDarkGridChange,[T?.onEnabledDarkGridChange]),N=w.useCallbackRef(T?.onEnabledDarkImagesChange,[T?.onEnabledDarkImagesChange]),z=w.useCallbackRef(async($=null,U=null)=>{const Y=[];let _,L=null,G=null;if(typeof $=="string"?G=$:L=$,_=L?$:await je.CommonUtils.openFileDialog(G??Ve.getAllReadFormatTypeAsString().join(",")),!_)return null;const Q={source:_,createWorkbookOptions:U,onWarning:re=>{Y.push(re)}},fe=await Ve.read(Q,F);return Y.length>0&&(F.showMessage("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
19
19
  `+Y.join(`
20
- `))),fe},[D,F,S]),O=w.useCallbackRef(async($,U,Y)=>{if(!U&&v){const _=await v("Enter Workbook name to "+(Y.isDefault?"Save.":`Export as ${Y.description}.`));return _!==null&&Ve.writeFile(_,$,{formatType:Y.key})}return Ve.writeFile(U,$,{formatType:Y.key})},[F,S,v]),H=n.useCallback(()=>({contains:$=>!0,focus(){}}),[]),I=n.useMemo(()=>{const $=[];h||(Ve.getWriteFormats().forEach(Y=>{const _=Y.isDefault,L={label:_?"Save Workbook":`Save Workbook as ${Y.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${Y.description}`},tags:Y.tags,description:`Save the workbook to the desktop${_?"":` as ${Y.description}`}.`,icon:"FileDownloadAsSheet"};_&&(L.shortcut={key:"S",modifiers:[w.KeyModifiers.Ctrl]},$.push(new w.Command("saveWorkbookAs",H,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[w.KeyModifiers.Shift,w.KeyModifiers.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{O(S,null,Y).catch(fe=>{F.showError(fe)})})));const G=Y.key,Q=_?"saveWorkbook":`saveWorkbookAs${G}`;G==="CSV"?L.icon="FileDownloadAsCSV":G==="Excel"&&(L.icon="FileDownloadAsExcel"),$.push(new w.Command(Q,H,L,fe=>{O(S,fe??k,Y).catch(re=>{F.showError(re)})}))}),$.push(new w.Command("openWorkbook",H,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",icon:"FileOpen",shortcut:{key:"O",modifiers:[w.KeyModifiers.Ctrl]}},async(Y=null)=>{const _={date1904:S.isDate1904(),...S.options};try{const L=await z(Y,_);if(!L)return;const G=L.title,Q=L.workbook,fe=Q.getSelectedSheet();if(L.formatType.mimeType==="text/csv"){const re=S.findValidSheetName(G);await S.doBatch(async()=>{const me={colStart:0,rowStart:0,colEnd:0,rowEnd:0};let Se=fe.getUsedRange();if(!Se)return void F.showMessage("The file appears to be blank.");Se=Se.getUnion(me),await S.getSheets().add({name:re,autoSelect:!0}).getRange(me).copyFrom(Se)},`Import CSV '${G}'`)}else S?.close(),j?.(G),x(Q)}catch(L){F.showError(L)}})),$.push(new w.Command("openWorkbookFromUrl",H,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(Y){if(!Y){const _=await F.showInput({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(_.option!=="Open")return;Y=_.input}Y&&console.log("openWorkbookFromUrl",Y)})));let U=[];return T&&(U=[new w.Command("themeMode",H,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new w.Command("defaultThemeMode",H,{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 w.Command("enableDarkGrid",H,{label:"Enable Dark Grid",description:"Allow the grid to render in dark 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 w.Command("enableDarkImages",H,{label:"Enable Dark Images",description:"Allow the images to render in dark 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."})]),[...$,...U,new w.SimpleCommand("help",H,{label:"Show Help",description:"Provide Help.",icon:"Documentation",shortcut:{key:"F1"}},()=>{}),new w.SimpleCommand("showKeyboardShortcuts",H,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",icon:"Keyboard",shortcut:{key:"/",modifiers:[w.KeyModifiers.Ctrl]}},()=>{}),new w.Command("gotoUrlGithub",H,{label:"Github",description:"Download examples, explore source code, and leave a star.",icon:"Github"},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new w.Command("gotoUrlDiscord",H,{label:"Discord",description:"Join our community on discord.",icon:"Discord"},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new w.Command("gotoUrlDocumentation",H,{label:"Documentation",description:"Read the documentation.",icon:"Documentation"},()=>{window?.open("https://www.sheetxl.com/docs")}),new w.Command("gotoUrlIssue",H,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request.",icon:"Ticket"},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[S,k,F,h,T,P,M]),W=n.useMemo(()=>{let $=null;return $=P?P.createChildGroup(H,"standaloneWorkbook",!1):new w.CommandGroup(H,"standaloneWorkbook"),$.addCommands(I,!0),$},[P,I]);w.useUndoManager({manager:M,commands:W});const ee=B.useMediaQuery("(prefers-color-scheme: dark)"),{themeMode:X}=y.useResolvedThemeMode();n.useEffect(()=>{if(!T||!W)return;const $=T.mode==="dark"||!T.mode&&X==="dark";W.getCommand("themeMode").update({state:T.mode??null,label:$?"Dark Mode":"Light Mode",scopedLabels:{appearance:$?"Dark Mode":"Light Mode"},icon:$?"DarkMode":"LightMode"}).updateCallback(()=>{E($?y.ThemeMode.Light:y.ThemeMode.Dark)}),W.getCommand("defaultThemeMode").update({state:!T.mode,icon:ee?"SystemDefaultDarkMode":"SystemDefaultLightMode"}).updateCallback(()=>{E(null)}),W.getCommand("enableDarkGrid").update({state:T.enableDarkGrid}).updateCallback(()=>{R(!T.enableDarkGrid)}),W.getCommand("enableDarkImages").update({state:T.enableDarkImages}).updateCallback(()=>{N(!T.enableDarkImages)})},[X,T,I]);const{showModal:ne}=y.useModal();return n.useEffect(()=>{const $=()=>new Promise((U,Y)=>{const _=n.lazy(()=>Promise.resolve().then(()=>require("./BbIg9meUh8UPbj5t.cjs"))),L=ne(_,{title:"Shortcut Keys Reference",commands:W,onDone:()=>{L.hide()},slotProps:{transition:{onExited:()=>{U(!0)}}}})});W.getCommand("showKeyboardShortcuts").updateCallback(()=>$()),W.getCommand("help").updateCallback(()=>$())},[I,W]),W})({workbook:i,setWorkbook:o,importExportDisabled:g,workbookTitle:r,setWorkbookTitle:s,commands:c,requestWorkbookTitle:b=>new Promise(S=>{t.current?t.current.requestWorkbookTitle((x,h)=>{S(x)},{selectAll:!0,requestReason:b}):S(d)}),themeOptions:C,undoManager:l,onExecute:n.useCallback(()=>{},[])}),u=n.useMemo(()=>e.jsx(Ir,{commands:f,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[f]),m={commands:f};return i&&(m.statusBarProps={childrenEnd:u}),p?n.cloneElement(p,m):null});ei.displayName="CommandsWrapper";const ti=n.memo(a=>{const{children:i}=a,o=Xr(),t=o?o.enqueueSnackbar:()=>{},r=o?o.closeSnackbar:()=>{},[s,d]=n.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),p=n.useCallback(()=>{d(x=>({...x,isMounted:!0}))},[]),l=n.useCallback(()=>{d(x=>({...x,isMounted:!1}))},[]),c={},g=y.useLazyWindow(c),C=y.useOptionsDialog(c),f=y.useInputDialog(c),u=n.useRef(new Set),m=n.useMemo(()=>{const x=(j,v)=>{if(v?.onceKey){if(u.current.has(v.onceKey))return;const M=new Set(u.current);M.add(v.onceKey),u.current=M}const T={variant:v?.type??w.NotifierType.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:v?.preventDuplicate,persist:v?.persist??v?.type===w.NotifierType.Error,action:M=>e.jsx(B.IconButton,{onClick:()=>r(M),children:e.jsx(w.DynamicIcon,{iconKey:"Cancel"})})};v?.enqueueProps&&Object.assign(T,v.enqueueProps),j||console.log("message is 'null'",v),t(j??"Alert",T)},h={showMessage:x,showBusy:(j,v)=>{let T=null;const M=new Promise(P=>{T=P});return d(P=>{const D=new Map(P.starting);return D.set(M,T),{...P,label:j,starting:D}}),M},showWindow:(j,v)=>{const T=v;return v={...v,onKeyDown:M=>{M.isDefaultPrevented()||M.isPropagationStopped()||T?.onKeyDown?.(M)}},g(j,{sort:()=>Promise.resolve().then(()=>require("./NsGloilMLNL8CAF_.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./DGqqkGBv1nc0eMrE.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./awYqXNcQZFnOqrrv.cjs")),comments:()=>Promise.resolve().then(()=>require("./ivFORJI1ljTPQpJ2.cjs")),find:()=>Promise.resolve().then(()=>require("./Caqz5dZzQdiFjnRX.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./DzrSXv2CLKkFc2iG.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./BaYmI4hURso6vppd.cjs")),resizeHeader:()=>Promise.resolve().then(()=>require("./byyZab6_Rq6ZwIYg.cjs"))}[j],v)},showOptions:C,showInput:f,showError:j=>{let v,T=w.NotifierType.Error,M="Unknown Error";typeof j=="string"?M=j:j instanceof Error&&(v=j,j.message&&(M=j.message)),j instanceof je.PartialError&&(T=w.NotifierType.Info),x(M,{type:T,enqueueProps:{error:v}})}},k=new w.DefaultReactNotifier;return k.setOverrides(h),k},[]);n.useEffect(()=>{s.starting.size<=0||!s.isMounted||d(x=>{const h=new Map(x.running);return x.starting.forEach((k,j)=>{const v=()=>{d(T=>{const M=new Map(T.running);return M.delete(j),{...T,running:M}})};h.set(j,v),k(v)}),{...x,starting:new Map,running:h}})},[s]);const[b,S]=n.useState(null);return n.useEffect(()=>{s.starting.size!==0||s.running.size!==0?S(e.jsx(y.LoadingPanel,{icon:e.jsx(y.AnimatedTraversingEllipsisIcon,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:s.label,onMount:p,onUnmount:l,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):S(null)},[s.starting,s.running]),e.jsxs(w.NotifierProvider,{notifier:m,children:[b,i]})});ti.displayName="SnackbarWrapper";const cs=n.memo(n.forwardRef((a,i)=>{const{children:o,title:t,taskPanes:r,onSelect:s,selected:d,registry:p=oe.DefaultTaskPaneRegistry,style:l,iconsOnly:c,className:g,...C}=a,f=n.useMemo(()=>r.map(b=>{const S=p.getRegisteredTaskPane(b);if(!S)return null;let x=S.getIcon?.();x&&(typeof x=="string"&&(x=e.jsx(w.DynamicIcon,{iconKey:x})),x=e.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:x}));const h=b===d;return e.jsx(B.Tab,{value:b,label:e.jsx(y.SimpleTooltip,{disableInteractive:!0,title:S.getTitle()??"",placement:"left-start",children:e.jsxs(B.Box,{sx:{padding:"0px 0px",writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:"0px",color:k=>k.palette.text.secondary},children:[x&&e.jsx(B.Box,{sx:{display:"inline-block",transformOrigin:"center",color:k=>k.palette.text.secondary},children:x}),c&&x?null:e.jsx(B.Typography,{component:"div",textTransform:"none",sx:{padding:"4px 0px",color:k=>h?k.palette.primary.main:k.palette.text.secondary},children:S.getTitle()})]})}),sx:{padding:"4px 4px",minWidth:"0px",minHeight:"0px",borderRadius:"4px"},className:ie("taskpane-strip-item",{"Mui-selected":h}),onClick:()=>a.onSelect(b)},b)}),[r,d,s,p]),u=w.useImperativeElement(i,()=>({isTaskPaneStrip:()=>!0}),[]),m=n.useMemo(()=>ie("taskpane-strip",g),[g]);return e.jsx(B.Box,{ref:u,className:m,sx:{paddingLeft:"2px",paddingTop:"4px",...l},...C,children:e.jsx(B.Tabs,{orientation:"vertical",variant:"scrollable",value:d,onChange:(b,S)=>{s(S)},slotProps:{list:{sx:{gap:"2px"}},indicator:{sx:{left:"0px",right:"unset"}}},children:f})})})),ds=(a,i)=>e.jsx(cs,{ref:i,...a}),us=n.forwardRef((a,i)=>{const{commands:o,model:t,...r}=a,s=q.useTheme(),d=`solid ${q.alpha(s.palette.divider,.2)} 1px`,p=`${s.shape.borderRadius??4}px`,l=`${s.spacing?.(.5)??4}px`,c=n.useRef(null);return e.jsx(oe.TaskPaneArea,{model:t,ref:i,frameProps:{style:{border:d,borderRadius:p,marginBottom:l}},alwaysShowStrip:!0,renderTaskPanelTitle:(g,C)=>{const{title:f,icon:u,onClose:m,readOnly:b,focused:S,...x}=g;return e.jsx(B.DialogTitle,{className:ie({"Mui-selected":S}),sx:{display:"flex",flex:"1 1 %0",color:h=>h.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:h=>`${h.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:h=>h.transitions.duration.shortest/2+"ms"},backgroundColor:h=>q.alpha(h.palette.action.hover,.03),borderBottom:h=>`solid ${q.alpha(h.palette.divider,.2)} 1px`},...x,children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:h=>h.spacing(.25),marginBottom:h=>h.spacing(.25),marginLeft:h=>h.spacing(1),marginRight:h=>h.spacing(1)},children:[e.jsx(B.Box,{sx:{flex:"1 1 100%",paddingLeft:h=>h.spacing(1)},children:f}),e.jsx(y.ExhibitTooltip,{label:"Close",children:e.jsx(B.IconButton,{"aria-label":"close",sx:{color:h=>h.palette.text.icon??h.palette.action.active},touchRippleRef:c,onPointerDown:h=>{c.current?.start(h,{center:!1}),h.stopPropagation(),h.preventDefault()},onPointerUp:()=>{m()},children:e.jsx(w.DynamicIcon,{iconKey:"Close"})})})]})})},renderTaskPaneStrip:ds,...a,onOpen:()=>{a?.onOpen?.()},onClose:()=>{a?.onClose?.()},commands:o,...r})}),wa={flex:"1 1 100%",display:"flex",boxSizing:"border-box"},oi=n.memo(n.forwardRef((a,i)=>{const{mainElement:o,sidebarElement:t,className:r,style:s,...d}=a,p=q.useTheme(),[l,{width:c}]=_e(),g=c>530||c===0,C=n.useRef(null);let f=null,u=4,m=13;return g?f="m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991":(f="M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991",u=13,m=4),e.jsx(w.SplitPane,{ref:tt([C,l,i]),className:r,style:s?{...wa,...s}:wa,...d,fixedPane:"after",position:"40%",minAfter:g?"280px":"120px",splitDirection:g?"row":"column",resizerProps:{className:"styled-resizer",style:{minWidth:g?"6px":void 0,minHeight:g?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${u}' height='${m}' viewBox='0 0 ${u} ${m}' version='1.1' fill='${p.palette.text.icon??p.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${f}' /%3E%3C/svg%3E%0A")`,maskRepeat:"no-repeat",maskPosition:g?"left center":"top center"}},elementBefore:o,paneBeforeProps:{style:{flexDirection:"column",marginRight:t?void 0:"6px"}},elementAfter:t,paneAfterProps:{style:{marginLeft:g?"0px":"4px",marginRight:g?"8px":"4px"}}})}));oi.displayName="StudioSplitPane",Mr(),w.DefaultDynamicIconService.register("plugin-scripts",{icons:{}}),oe.DefaultTaskPaneRegistry.registerTaskPane({key:"scriptEditor",getTitle:()=>"Script (Typescript)",getIcon:()=>"ScriptRun",renderTaskPane:cl},!0);const ro=n.memo(n.forwardRef((a,i)=>{const{className:o,sx:t,style:r,onElementLoad:s,onError:d,undoManager:p,errorPanel:l=y.ErrorPanel,onKeyDown:c,workbook:g,createWorkbookOptions:C,onWorkbookChange:f,logo:u,importExportDisabled:m=!1,themeOptions:b,autoFocus:S=!1,commands:x,title:h,onTitleChange:k,titleProps:j,renderLoadingPanel:v,...T}=a,M=n.useRef(null),P=w.useCallbackRef(f,[f]),D=w.useCallbackRef(k??j?.onTitleChange,[k??j?.onTitleChange]),F=j?.placeHolder??"Untitled",E=b?.mode,{themeMode:R,source:N}=y.useResolvedThemeMode({mode:E}),z=n.useMemo(()=>({...b,light:y.createExhibitTheme(!1,je.CommonUtils.deepMerge(b?.theme??{},b?.light??{})),dark:y.createExhibitTheme(!0,je.CommonUtils.deepMerge(b?.theme??{},b?.dark??{}))}),[b]),O=R===y.ThemeMode.Dark,[H,I]=n.useState(null);n.useEffect(()=>{I(p??new je.UndoManager)},[p]);const[W,ee]=n.useState(null),[X,ne]=n.useState(null),$=oe.useDocThemes();n.useLayoutEffect(()=>{if(!g||Object.keys(g).length===0&&!je.CommonUtils.isPromiseLike(g)){const Z={theme:$.getDefaultTheme(),...C};ne(new A.Workbook(Z))}else ne(g)},[g]),n.useLayoutEffect(()=>{if(X){if(X instanceof A.Workbook)return ee({workbook:X}),void(g!==X&&P?.(X));(async()=>{try{let Z,le=await Promise.resolve(X);le&&le.source&&(le=await Ve.read(le)),le.workbook?(G(le.title),Z=le.workbook):Z=le,P?.(Z),ee({workbook:Z})}catch(Z){P?.(null),ee({error:Z})}})()}},[X]);const[U,Y]=n.useState(null);n.useEffect(()=>{if(!H||!W)return;H.clear();const Z=W?.workbook?.getTransactions();if(Z)return Z.addListener({onCommitEnd:le=>{le.getDescription()?H.addUndoOperation({description:le.getDescription(),undo:()=>(Z.revert(le.getId()),U.source?.focus(),()=>{Z.restore(le.getId()),U.source?.focus()})}):console.warn("commit has no description",le)}})},[H,W,U]);const _=w.useCallbackRef(Z=>{Z?H.setRepeatableOperation({description:Z.label(),repeat:async()=>Z.execute()}):H.setRepeatableOperation(null)},[H]),[L,G]=n.useState(h??j?.title??"");n.useEffect(()=>{G(h??j?.title??"")},[h??j?.title]),n.useEffect(()=>{D?.(L)},[L]);const[Q,fe]=n.useState(null),re=n.useMemo(()=>{const Z=()=>({contains:le=>!0,focus(){}});return x?x.createChildGroup(Z,"application",!1):new w.CommandGroup(Z,"application")},[x]),me=w.useCallbackRef(async Z=>{fe(Z.source.getViewportElement()),Y(Z),re.activate("sheet"),await w.DefaultDynamicIconService.prefetch(),s?.(Z)},[re]);n.useEffect(()=>{U&&S&&U.source?.focus(typeof S=="object"?S:void 0)},[U]);const Se=n.useRef(null),Ce=n.useCallback(Z=>{let le=null;return j?.hidden||(le=e.jsx(sn,{...j,style:{maxWidth:"100%",...j?.style},workbook:M.current,ref:Se,title:L,placeHolder:F,onTitleChange:Ue=>{G(Ue)}})),e.jsx(Jr,{...Z,logo:u,mainElement:le,showFileMenu:!m,showAppearanceMenu:!!(z?.onEnabledDarkGridChange||z?.onEnabledDarkImagesChange||z?.onModeChange)})},[u,L,j,z,m,re]);n.useEffect(()=>{const Z=le=>le.preventDefault();return M.current?.addEventListener("wheel",Z,{passive:!1}),()=>{M.current?.removeEventListener("wheel",Z)}},[]);const J=n.useMemo(()=>{const Z={transparentBackground:!0};return e.jsx(B.Box,{sx:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:v?.(Z)??e.jsx(y.LoadingPanel,{...Z})})},[t,r,v]),K=n.useCallback(({error:Z})=>(d?.(Z),e.jsx(l,{sx:t,style:r,error:Z??"Unable to display empty workbook."})),[t,r,d]),te=n.useMemo(()=>({...t,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-SnackbarContainer > div":{maxWidth:"100%"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-Snackbar > .error-snackbar .MuiTypography-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiCardActions-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-MuiContent *":{fontFamily:Z=>Z.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[t]),[de,ve]=n.useState(null),se=n.useCallback((Z,le)=>e.jsx(us,{ref:le,model:X,commands:re,...Z}),[re,X]),Fe=n.useCallback(Z=>e.jsx(oi,{mainElement:Z,sidebarElement:de}),[de]),Te=tt([M,i]),Oe=n.useMemo(()=>{if(!W)return J;if(W.error||!W.workbook)return K({error:W.error});let Z=null,le=null,Ue=!1;return z&&(Z=O?z.dark:z.light,le=O&&z.enableDarkGrid?z.dark:z.light,Ue=z.enableDarkImages),e.jsx(ln,{sx:te,style:r,tabIndex:0,autoFocus:!0,workbook:W.workbook,ref:Te,renderToolbar:Ce,onElementLoad:me,onRepeatCommandChange:_,onKeyDown:gt=>{c?.(gt)},renderLoadingPanel:v,gridTheme:le,headersTheme:Z,enableDarkImages:Ue,mainWrapper:Fe,className:ie(o),onContextMenu:gt=>gt.preventDefault(),...T},"WorkbookElement")},[W,L,H,J,v,z,T,Ce,te,Fe]);let ue=e.jsx(rs,{maxSnack:3,domRoot:Q,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(Z,le,Ue)=>{M.current?.focus()},Components:{error:Zr},iconVariant:{success:e.jsx(B.SvgIcon,{style:{marginRight:"8px"},children:e.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:e.jsx(w.DynamicIcon,{iconKey:"ErrorAlert",style:{marginRight:"8px"}})},children:e.jsx(oe.TaskPaneProvider,{createArea:se,onUpdateArea:Z=>{ve(Z)},children:e.jsx(y.ModalProvider,{children:e.jsx(ti,{children:e.jsx(w.UncaughtErrorBoundary,{children:e.jsx(w.ReactErrorBoundary,{children:e.jsx(ei,{workbook:W?.workbook,setWorkbook:ne,importExportDisabled:m,titlePlaceHolder:F,titleWorkbook:L,setWorkbookTitle:G,refWorkbookTitle:Se,commands:re,undoManager:H,themeOptions:z,children:Oe})})})})})})});return z&&(ue=e.jsxs(q.ThemeProvider,{theme:O?z.dark:z.light,children:[z.cssBaseline?e.jsx(B.CssBaseline,{}):null,ue]})),ue}));ro.displayName="EagerStudio";const ms=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:ro,default:ro},Symbol.toStringTag,{value:"Module"}));exports.AppearanceCommandButton=Fr,exports.AutoColorPosition=pt,exports.BorderCommandButton=Fa,exports.BorderPopupButton=Da,exports.BorderStylePopupButton=Ma,exports.CellsDeleteCommandButton=Ho,exports.CellsFormatCommandButton=Wo,exports.CellsInsertCommandButton=zo,exports.Checkboard=Ra,exports.ClearCommandButton=Lo,exports.ColorButton=io,exports.ColorButtonList=Dt,exports.ColorCommandButton=ht,exports.ColorPanel=Pa,exports.ColorPanelType=Ba,exports.ColorPopupButton=Ao,exports.DocThemeCommandButton=Dr,exports.EagerStudio=ro,exports.FillCommandButton=za,exports.FilterColumnMenu=Jo,exports.FilterCommandButton=Vi,exports.Filters=cr,exports.FindCommandButton=Oa,exports.FontFamilyCommandButton=$a,exports.FontSizeCommandButton=Aa,exports.FormulaBar=Qo,exports.FreezeCommandButton=Na,exports.HelpCommandButton=Ir,exports.HorizontalAlignCommandButton=va,exports.InsertFunctionCommandPopupButton=Nr,exports.InsertFunctionSumCommandPopupButton=un,exports.InsertImageCommandButton=dn,exports.MergeCommandButton=Ia,exports.NamedCollectionEditor=Zo,exports.NamedInput=Uo,exports.NumberFormatCommandButton=La,exports.PasteCommandButton=_o,exports.PresetCellStylesCommandButton=Ga,exports.PresetTableStylesCommandButton=cn,exports.RangeInput=qo,exports.SheetTab=en,exports.SheetTabMenu=tn,exports.SheetZoomScale=Go,exports.SheetsAllMenu=on,exports.SortFilterCommandButton=$o,exports.StatusBar=Xo,exports.Studio=Or,exports.StyledStrokeIcon=Mo,exports.TableDetailsPanel=Rr,exports.TableDetailsTaskPane=Pr,exports.TablePlugin=Mr,exports.TableStyleCanvasPreview=Ya,exports.TableStyleOptionsPanel=Za,exports.TableStylePreview=Ko,exports.TextEffectsCommandButton=Va,exports.TextOverflowCommandButton=Ta,exports.TextRotateCommandButton=Ea,exports.ThemeSelectButton=tr,exports.ThemeSelectPanel=or,exports.ThemeSelectPopupButton=nr,exports.UnderlineCommandButton=_a,exports.UndoRedoCommandButton=Vo,exports.VerticalAlignCommandButton=ja,exports.ViewGridLinesCommandButton=Ha,exports.ViewHeadingsCommandButton=Ka,exports.WalkingCopyCommandButton=so,exports.WorkbookContextMenu=rn,exports.WorkbookElement=ln,exports.WorkbookIO=Ve,exports.WorkbookStrip=an,exports.WorkbookTitle=sn,exports.WorkbookViewCommandButton=Ua,exports._WorkbookIO=Yr,exports._extends=oo,exports._objectWithoutPropertiesLoose=nn,exports._setPrototypeOf=no,exports.clsx=Ke,exports.clsx$1=ie,exports.commonjsGlobal=ut,exports.createGridStyleFromMUITheme=Io,exports.defaultNewWorkbook=Er,exports.getDefaultExportFromCjs=function(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a},exports.requirePropTypes=Ot,exports.setPrintExamplesOnLoad=a=>{dr=a},exports.useMeasure=_e,exports.useWorkbookCommands=Tr;
20
+ `))),fe},[D,F,S]),O=w.useCallbackRef(async($,U,Y)=>{if(!U&&v){const _=await v("Enter Workbook name to "+(Y.isDefault?"Save.":`Export as ${Y.description}.`));return _!==null&&Ve.writeFile(_,$,{formatType:Y.key})}return Ve.writeFile(U,$,{formatType:Y.key})},[F,S,v]),H=n.useCallback(()=>({contains:$=>!0,focus(){}}),[]),I=n.useMemo(()=>{const $=[];h||(Ve.getWriteFormats().forEach(Y=>{const _=Y.isDefault,L={label:_?"Save Workbook":`Save Workbook as ${Y.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${Y.description}`},tags:Y.tags,description:`Save the workbook to the desktop${_?"":` as ${Y.description}`}.`,icon:"FileDownloadAsSheet"};_&&(L.shortcut={key:"S",modifiers:[w.KeyModifiers.Ctrl]},$.push(new w.Command("saveWorkbookAs",H,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[w.KeyModifiers.Shift,w.KeyModifiers.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{O(S,null,Y).catch(fe=>{F.showError(fe)})})));const G=Y.key,Q=_?"saveWorkbook":`saveWorkbookAs${G}`;G==="CSV"?L.icon="FileDownloadAsCSV":G==="Excel"&&(L.icon="FileDownloadAsExcel"),$.push(new w.Command(Q,H,L,fe=>{O(S,fe??k,Y).catch(re=>{F.showError(re)})}))}),$.push(new w.Command("openWorkbook",H,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",icon:"FileOpen",shortcut:{key:"O",modifiers:[w.KeyModifiers.Ctrl]}},async(Y=null)=>{const _={date1904:S.isDate1904(),...S.options};try{const L=await z(Y,_);if(!L)return;const G=L.title,Q=L.workbook,fe=Q.getSelectedSheet();if(L.formatType.mimeType==="text/csv"){const re=S.findValidSheetName(G);await S.doBatch(async()=>{const me={colStart:0,rowStart:0,colEnd:0,rowEnd:0};let Se=fe.getUsedRange();if(!Se)return void F.showMessage("The file appears to be blank.");Se=Se.getUnion(me),await S.getSheets().add({name:re,autoSelect:!0}).getRange(me).copyFrom(Se)},`Import CSV '${G}'`)}else S?.close(),j?.(G),x(Q)}catch(L){F.showError(L)}})),$.push(new w.Command("openWorkbookFromUrl",H,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(Y){if(!Y){const _=await F.showInput({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(_.option!=="Open")return;Y=_.input}Y&&console.log("openWorkbookFromUrl",Y)})));let U=[];return T&&(U=[new w.Command("themeMode",H,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new w.Command("defaultThemeMode",H,{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 w.Command("enableDarkGrid",H,{label:"Enable Dark Grid",description:"Allow the grid to render in dark 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 w.Command("enableDarkImages",H,{label:"Enable Dark Images",description:"Allow the images to render in dark 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."})]),[...$,...U,new w.SimpleCommand("help",H,{label:"Show Help",description:"Provide Help.",icon:"Documentation",shortcut:{key:"F1"}},()=>{}),new w.SimpleCommand("showKeyboardShortcuts",H,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",icon:"Keyboard",shortcut:{key:"/",modifiers:[w.KeyModifiers.Ctrl]}},()=>{}),new w.Command("gotoUrlGithub",H,{label:"Github",description:"Download examples, explore source code, and leave a star.",icon:"Github"},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new w.Command("gotoUrlDiscord",H,{label:"Discord",description:"Join our community on discord.",icon:"Discord"},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new w.Command("gotoUrlDocumentation",H,{label:"Documentation",description:"Read the documentation.",icon:"Documentation"},()=>{window?.open("https://www.sheetxl.com/docs")}),new w.Command("gotoUrlIssue",H,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request.",icon:"Ticket"},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[S,k,F,h,T,P,M]),W=n.useMemo(()=>{let $=null;return $=P?P.createChildGroup(H,"standaloneWorkbook",!1):new w.CommandGroup(H,"standaloneWorkbook"),$.addCommands(I,!0),$},[P,I]);w.useUndoManager({manager:M,commands:W});const ee=B.useMediaQuery("(prefers-color-scheme: dark)"),{themeMode:X}=y.useResolvedThemeMode();n.useEffect(()=>{if(!T||!W)return;const $=T.mode==="dark"||!T.mode&&X==="dark";W.getCommand("themeMode").update({state:T.mode??null,label:$?"Dark Mode":"Light Mode",scopedLabels:{appearance:$?"Dark Mode":"Light Mode"},icon:$?"DarkMode":"LightMode"}).updateCallback(()=>{E($?y.ThemeMode.Light:y.ThemeMode.Dark)}),W.getCommand("defaultThemeMode").update({state:!T.mode,icon:ee?"SystemDefaultDarkMode":"SystemDefaultLightMode"}).updateCallback(()=>{E(null)}),W.getCommand("enableDarkGrid").update({state:T.enableDarkGrid}).updateCallback(()=>{R(!T.enableDarkGrid)}),W.getCommand("enableDarkImages").update({state:T.enableDarkImages}).updateCallback(()=>{N(!T.enableDarkImages)})},[X,T,I]);const{showModal:ne}=y.useModal();return n.useEffect(()=>{const $=()=>new Promise((U,Y)=>{const _=n.lazy(()=>Promise.resolve().then(()=>require("./D86M0fc5XpkQp4gk.cjs"))),L=ne(_,{title:"Shortcut Keys Reference",commands:W,onDone:()=>{L.hide()},slotProps:{transition:{onExited:()=>{U(!0)}}}})});W.getCommand("showKeyboardShortcuts").updateCallback(()=>$()),W.getCommand("help").updateCallback(()=>$())},[I,W]),W})({workbook:i,setWorkbook:o,importExportDisabled:g,workbookTitle:r,setWorkbookTitle:s,commands:c,requestWorkbookTitle:b=>new Promise(S=>{t.current?t.current.requestWorkbookTitle((x,h)=>{S(x)},{selectAll:!0,requestReason:b}):S(d)}),themeOptions:C,undoManager:l,onExecute:n.useCallback(()=>{},[])}),u=n.useMemo(()=>e.jsx(Ir,{commands:f,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[f]),m={commands:f};return i&&(m.statusBarProps={childrenEnd:u}),p?n.cloneElement(p,m):null});ei.displayName="CommandsWrapper";const ti=n.memo(a=>{const{children:i}=a,o=Xr(),t=o?o.enqueueSnackbar:()=>{},r=o?o.closeSnackbar:()=>{},[s,d]=n.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),p=n.useCallback(()=>{d(x=>({...x,isMounted:!0}))},[]),l=n.useCallback(()=>{d(x=>({...x,isMounted:!1}))},[]),c={},g=y.useLazyWindow(c),C=y.useOptionsDialog(c),f=y.useInputDialog(c),u=n.useRef(new Set),m=n.useMemo(()=>{const x=(j,v)=>{if(v?.onceKey){if(u.current.has(v.onceKey))return;const M=new Set(u.current);M.add(v.onceKey),u.current=M}const T={variant:v?.type??w.NotifierType.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:v?.preventDuplicate,persist:v?.persist??v?.type===w.NotifierType.Error,action:M=>e.jsx(B.IconButton,{onClick:()=>r(M),children:e.jsx(w.DynamicIcon,{iconKey:"Cancel"})})};v?.enqueueProps&&Object.assign(T,v.enqueueProps),j||console.log("message is 'null'",v),t(j??"Alert",T)},h={showMessage:x,showBusy:(j,v)=>{let T=null;const M=new Promise(P=>{T=P});return d(P=>{const D=new Map(P.starting);return D.set(M,T),{...P,label:j,starting:D}}),M},showWindow:(j,v)=>{const T=v;return v={...v,onKeyDown:M=>{M.isDefaultPrevented()||M.isPropagationStopped()||T?.onKeyDown?.(M)}},g(j,{sort:()=>Promise.resolve().then(()=>require("./EG3LGz7SrtC5w5XW.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./vnUEXASpUv_-qQiU.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./UzMSUQjwLPa1rDpq.cjs")),comments:()=>Promise.resolve().then(()=>require("./Bp_Q6Q1JP7PLdn-j.cjs")),find:()=>Promise.resolve().then(()=>require("./Cc0PDDVn8CB6mX-c.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./DU-OFxkWz_AT01_1.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./CLxLccZWksQgSIfb.cjs")),resizeHeader:()=>Promise.resolve().then(()=>require("./Dwamt-p0XVNIeEAM.cjs"))}[j],v)},showOptions:C,showInput:f,showError:j=>{let v,T=w.NotifierType.Error,M="Unknown Error";typeof j=="string"?M=j:j instanceof Error&&(v=j,j.message&&(M=j.message)),j instanceof je.PartialError&&(T=w.NotifierType.Info),x(M,{type:T,enqueueProps:{error:v}})}},k=new w.DefaultReactNotifier;return k.setOverrides(h),k},[]);n.useEffect(()=>{s.starting.size<=0||!s.isMounted||d(x=>{const h=new Map(x.running);return x.starting.forEach((k,j)=>{const v=()=>{d(T=>{const M=new Map(T.running);return M.delete(j),{...T,running:M}})};h.set(j,v),k(v)}),{...x,starting:new Map,running:h}})},[s]);const[b,S]=n.useState(null);return n.useEffect(()=>{s.starting.size!==0||s.running.size!==0?S(e.jsx(y.LoadingPanel,{icon:e.jsx(y.AnimatedTraversingEllipsisIcon,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:s.label,onMount:p,onUnmount:l,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):S(null)},[s.starting,s.running]),e.jsxs(w.NotifierProvider,{notifier:m,children:[b,i]})});ti.displayName="SnackbarWrapper";const cs=n.memo(n.forwardRef((a,i)=>{const{children:o,title:t,taskPanes:r,onSelect:s,selected:d,registry:p=oe.DefaultTaskPaneRegistry,style:l,iconsOnly:c,className:g,...C}=a,f=n.useMemo(()=>r.map(b=>{const S=p.getRegisteredTaskPane(b);if(!S)return null;let x=S.getIcon?.();x&&(typeof x=="string"&&(x=e.jsx(w.DynamicIcon,{iconKey:x})),x=e.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:x}));const h=b===d;return e.jsx(B.Tab,{value:b,label:e.jsx(y.SimpleTooltip,{disableInteractive:!0,title:S.getTitle()??"",placement:"left-start",children:e.jsxs(B.Box,{sx:{padding:"0px 0px",writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:"0px",color:k=>k.palette.text.secondary},children:[x&&e.jsx(B.Box,{sx:{display:"inline-block",transformOrigin:"center",color:k=>k.palette.text.secondary},children:x}),c&&x?null:e.jsx(B.Typography,{component:"div",textTransform:"none",sx:{padding:"4px 0px",color:k=>h?k.palette.primary.main:k.palette.text.secondary},children:S.getTitle()})]})}),sx:{padding:"4px 4px",minWidth:"0px",minHeight:"0px",borderRadius:"4px"},className:ie("taskpane-strip-item",{"Mui-selected":h}),onClick:()=>a.onSelect(b)},b)}),[r,d,s,p]),u=w.useImperativeElement(i,()=>({isTaskPaneStrip:()=>!0}),[]),m=n.useMemo(()=>ie("taskpane-strip",g),[g]);return e.jsx(B.Box,{ref:u,className:m,sx:{paddingLeft:"2px",paddingTop:"4px",...l},...C,children:e.jsx(B.Tabs,{orientation:"vertical",variant:"scrollable",value:d,onChange:(b,S)=>{s(S)},slotProps:{list:{sx:{gap:"2px"}},indicator:{sx:{left:"0px",right:"unset"}}},children:f})})})),ds=(a,i)=>e.jsx(cs,{ref:i,...a}),us=n.forwardRef((a,i)=>{const{commands:o,model:t,...r}=a,s=q.useTheme(),d=`solid ${q.alpha(s.palette.divider,.2)} 1px`,p=`${s.shape.borderRadius??4}px`,l=`${s.spacing?.(.5)??4}px`,c=n.useRef(null);return e.jsx(oe.TaskPaneArea,{model:t,ref:i,frameProps:{style:{border:d,borderRadius:p,marginBottom:l}},alwaysShowStrip:!0,renderTaskPanelTitle:(g,C)=>{const{title:f,icon:u,onClose:m,readOnly:b,focused:S,...x}=g;return e.jsx(B.DialogTitle,{className:ie({"Mui-selected":S}),sx:{display:"flex",flex:"1 1 %0",color:h=>h.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:h=>`${h.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:h=>h.transitions.duration.shortest/2+"ms"},backgroundColor:h=>q.alpha(h.palette.action.hover,.03),borderBottom:h=>`solid ${q.alpha(h.palette.divider,.2)} 1px`},...x,children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:h=>h.spacing(.25),marginBottom:h=>h.spacing(.25),marginLeft:h=>h.spacing(1),marginRight:h=>h.spacing(1)},children:[e.jsx(B.Box,{sx:{flex:"1 1 100%",paddingLeft:h=>h.spacing(1)},children:f}),e.jsx(y.ExhibitTooltip,{label:"Close",children:e.jsx(B.IconButton,{"aria-label":"close",sx:{color:h=>h.palette.text.icon??h.palette.action.active},touchRippleRef:c,onPointerDown:h=>{c.current?.start(h,{center:!1}),h.stopPropagation(),h.preventDefault()},onPointerUp:()=>{m()},children:e.jsx(w.DynamicIcon,{iconKey:"Close"})})})]})})},renderTaskPaneStrip:ds,...a,onOpen:()=>{a?.onOpen?.()},onClose:()=>{a?.onClose?.()},commands:o,...r})}),wa={flex:"1 1 100%",display:"flex",boxSizing:"border-box"},oi=n.memo(n.forwardRef((a,i)=>{const{mainElement:o,sidebarElement:t,className:r,style:s,...d}=a,p=q.useTheme(),[l,{width:c}]=_e(),g=c>530||c===0,C=n.useRef(null);let f=null,u=4,m=13;return g?f="m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991":(f="M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991",u=13,m=4),e.jsx(w.SplitPane,{ref:tt([C,l,i]),className:r,style:s?{...wa,...s}:wa,...d,fixedPane:"after",position:"40%",minAfter:g?"280px":"120px",splitDirection:g?"row":"column",resizerProps:{className:"styled-resizer",style:{minWidth:g?"6px":void 0,minHeight:g?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${u}' height='${m}' viewBox='0 0 ${u} ${m}' version='1.1' fill='${p.palette.text.icon??p.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${f}' /%3E%3C/svg%3E%0A")`,maskRepeat:"no-repeat",maskPosition:g?"left center":"top center"}},elementBefore:o,paneBeforeProps:{style:{flexDirection:"column",marginRight:t?void 0:"6px"}},elementAfter:t,paneAfterProps:{style:{marginLeft:g?"0px":"4px",marginRight:g?"8px":"4px"}}})}));oi.displayName="StudioSplitPane",Mr(),w.DefaultDynamicIconService.register("plugin-scripts",{icons:{}}),oe.DefaultTaskPaneRegistry.registerTaskPane({key:"scriptEditor",getTitle:()=>"Script (Typescript)",getIcon:()=>"ScriptRun",renderTaskPane:cl},!0);const ro=n.memo(n.forwardRef((a,i)=>{const{className:o,sx:t,style:r,onElementLoad:s,onError:d,undoManager:p,errorPanel:l=y.ErrorPanel,onKeyDown:c,workbook:g,createWorkbookOptions:C,onWorkbookChange:f,logo:u,importExportDisabled:m=!1,themeOptions:b,autoFocus:S=!1,commands:x,title:h,onTitleChange:k,titleProps:j,renderLoadingPanel:v,...T}=a,M=n.useRef(null),P=w.useCallbackRef(f,[f]),D=w.useCallbackRef(k??j?.onTitleChange,[k??j?.onTitleChange]),F=j?.placeHolder??"Untitled",E=b?.mode,{themeMode:R,source:N}=y.useResolvedThemeMode({mode:E}),z=n.useMemo(()=>({...b,light:y.createExhibitTheme(!1,je.CommonUtils.deepMerge(b?.theme??{},b?.light??{})),dark:y.createExhibitTheme(!0,je.CommonUtils.deepMerge(b?.theme??{},b?.dark??{}))}),[b]),O=R===y.ThemeMode.Dark,[H,I]=n.useState(null);n.useEffect(()=>{I(p??new je.UndoManager)},[p]);const[W,ee]=n.useState(null),[X,ne]=n.useState(null),$=oe.useDocThemes();n.useLayoutEffect(()=>{if(!g||Object.keys(g).length===0&&!je.CommonUtils.isPromiseLike(g)){const Z={theme:$.getDefaultTheme(),...C};ne(new A.Workbook(Z))}else ne(g)},[g]),n.useLayoutEffect(()=>{if(X){if(X instanceof A.Workbook)return ee({workbook:X}),void(g!==X&&P?.(X));(async()=>{try{let Z,le=await Promise.resolve(X);le&&le.source&&(le=await Ve.read(le)),le.workbook?(G(le.title),Z=le.workbook):Z=le,P?.(Z),ee({workbook:Z})}catch(Z){P?.(null),ee({error:Z})}})()}},[X]);const[U,Y]=n.useState(null);n.useEffect(()=>{if(!H||!W)return;H.clear();const Z=W?.workbook?.getTransactions();if(Z)return Z.addListener({onCommitEnd:le=>{le.getDescription()?H.addUndoOperation({description:le.getDescription(),undo:()=>(Z.revert(le.getId()),U.source?.focus(),()=>{Z.restore(le.getId()),U.source?.focus()})}):console.warn("commit has no description",le)}})},[H,W,U]);const _=w.useCallbackRef(Z=>{Z?H.setRepeatableOperation({description:Z.label(),repeat:async()=>Z.execute()}):H.setRepeatableOperation(null)},[H]),[L,G]=n.useState(h??j?.title??"");n.useEffect(()=>{G(h??j?.title??"")},[h??j?.title]),n.useEffect(()=>{D?.(L)},[L]);const[Q,fe]=n.useState(null),re=n.useMemo(()=>{const Z=()=>({contains:le=>!0,focus(){}});return x?x.createChildGroup(Z,"application",!1):new w.CommandGroup(Z,"application")},[x]),me=w.useCallbackRef(async Z=>{fe(Z.source.getViewportElement()),Y(Z),re.activate("sheet"),await w.DefaultDynamicIconService.prefetch(),s?.(Z)},[re]);n.useEffect(()=>{U&&S&&U.source?.focus(typeof S=="object"?S:void 0)},[U]);const Se=n.useRef(null),Ce=n.useCallback(Z=>{let le=null;return j?.hidden||(le=e.jsx(sn,{...j,style:{maxWidth:"100%",...j?.style},workbook:M.current,ref:Se,title:L,placeHolder:F,onTitleChange:Ue=>{G(Ue)}})),e.jsx(Jr,{...Z,logo:u,mainElement:le,showFileMenu:!m,showAppearanceMenu:!!(z?.onEnabledDarkGridChange||z?.onEnabledDarkImagesChange||z?.onModeChange)})},[u,L,j,z,m,re]);n.useEffect(()=>{const Z=le=>le.preventDefault();return M.current?.addEventListener("wheel",Z,{passive:!1}),()=>{M.current?.removeEventListener("wheel",Z)}},[]);const J=n.useMemo(()=>{const Z={transparentBackground:!0};return e.jsx(B.Box,{sx:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:v?.(Z)??e.jsx(y.LoadingPanel,{...Z})})},[t,r,v]),K=n.useCallback(({error:Z})=>(d?.(Z),e.jsx(l,{sx:t,style:r,error:Z??"Unable to display empty workbook."})),[t,r,d]),te=n.useMemo(()=>({...t,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-SnackbarContainer > div":{maxWidth:"100%"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-Snackbar > .error-snackbar .MuiTypography-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiCardActions-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-MuiContent *":{fontFamily:Z=>Z.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[t]),[de,ve]=n.useState(null),se=n.useCallback((Z,le)=>e.jsx(us,{ref:le,model:X,commands:re,...Z}),[re,X]),Fe=n.useCallback(Z=>e.jsx(oi,{mainElement:Z,sidebarElement:de}),[de]),Te=tt([M,i]),Oe=n.useMemo(()=>{if(!W)return J;if(W.error||!W.workbook)return K({error:W.error});let Z=null,le=null,Ue=!1;return z&&(Z=O?z.dark:z.light,le=O&&z.enableDarkGrid?z.dark:z.light,Ue=z.enableDarkImages),e.jsx(ln,{sx:te,style:r,tabIndex:0,autoFocus:!0,workbook:W.workbook,ref:Te,renderToolbar:Ce,onElementLoad:me,onRepeatCommandChange:_,onKeyDown:gt=>{c?.(gt)},renderLoadingPanel:v,gridTheme:le,headersTheme:Z,enableDarkImages:Ue,mainWrapper:Fe,className:ie(o),onContextMenu:gt=>gt.preventDefault(),...T},"WorkbookElement")},[W,L,H,J,v,z,T,Ce,te,Fe]);let ue=e.jsx(rs,{maxSnack:3,domRoot:Q,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(Z,le,Ue)=>{M.current?.focus()},Components:{error:Zr},iconVariant:{success:e.jsx(B.SvgIcon,{style:{marginRight:"8px"},children:e.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:e.jsx(w.DynamicIcon,{iconKey:"ErrorAlert",style:{marginRight:"8px"}})},children:e.jsx(oe.TaskPaneProvider,{createArea:se,onUpdateArea:Z=>{ve(Z)},children:e.jsx(y.ModalProvider,{children:e.jsx(ti,{children:e.jsx(w.UncaughtErrorBoundary,{children:e.jsx(w.ReactErrorBoundary,{children:e.jsx(ei,{workbook:W?.workbook,setWorkbook:ne,importExportDisabled:m,titlePlaceHolder:F,titleWorkbook:L,setWorkbookTitle:G,refWorkbookTitle:Se,commands:re,undoManager:H,themeOptions:z,children:Oe})})})})})})});return z&&(ue=e.jsxs(q.ThemeProvider,{theme:O?z.dark:z.light,children:[z.cssBaseline?e.jsx(B.CssBaseline,{}):null,ue]})),ue}));ro.displayName="EagerStudio";const ms=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:ro,default:ro},Symbol.toStringTag,{value:"Module"}));exports.AppearanceCommandButton=Fr,exports.AutoColorPosition=pt,exports.BorderCommandButton=Fa,exports.BorderPopupButton=Da,exports.BorderStylePopupButton=Ma,exports.CellsDeleteCommandButton=Ho,exports.CellsFormatCommandButton=Wo,exports.CellsInsertCommandButton=zo,exports.Checkboard=Ra,exports.ClearCommandButton=Lo,exports.ColorButton=io,exports.ColorButtonList=Dt,exports.ColorCommandButton=ht,exports.ColorPanel=Pa,exports.ColorPanelType=Ba,exports.ColorPopupButton=Ao,exports.DocThemeCommandButton=Dr,exports.EagerStudio=ro,exports.FillCommandButton=za,exports.FilterColumnMenu=Jo,exports.FilterCommandButton=Vi,exports.Filters=cr,exports.FindCommandButton=Oa,exports.FontFamilyCommandButton=$a,exports.FontSizeCommandButton=Aa,exports.FormulaBar=Qo,exports.FreezeCommandButton=Na,exports.HelpCommandButton=Ir,exports.HorizontalAlignCommandButton=va,exports.InsertFunctionCommandPopupButton=Nr,exports.InsertFunctionSumCommandPopupButton=un,exports.InsertImageCommandButton=dn,exports.MergeCommandButton=Ia,exports.NamedCollectionEditor=Zo,exports.NamedInput=Uo,exports.NumberFormatCommandButton=La,exports.PasteCommandButton=_o,exports.PresetCellStylesCommandButton=Ga,exports.PresetTableStylesCommandButton=cn,exports.RangeInput=qo,exports.SheetTab=en,exports.SheetTabMenu=tn,exports.SheetZoomScale=Go,exports.SheetsAllMenu=on,exports.SortFilterCommandButton=$o,exports.StatusBar=Xo,exports.Studio=Or,exports.StyledStrokeIcon=Mo,exports.TableDetailsPanel=Rr,exports.TableDetailsTaskPane=Pr,exports.TablePlugin=Mr,exports.TableStyleCanvasPreview=Ya,exports.TableStyleOptionsPanel=Za,exports.TableStylePreview=Ko,exports.TextEffectsCommandButton=Va,exports.TextOverflowCommandButton=Ta,exports.TextRotateCommandButton=Ea,exports.ThemeSelectButton=tr,exports.ThemeSelectPanel=or,exports.ThemeSelectPopupButton=nr,exports.UnderlineCommandButton=_a,exports.UndoRedoCommandButton=Vo,exports.VerticalAlignCommandButton=ja,exports.ViewGridLinesCommandButton=Ha,exports.ViewHeadingsCommandButton=Ka,exports.WalkingCopyCommandButton=so,exports.WorkbookContextMenu=rn,exports.WorkbookElement=ln,exports.WorkbookIO=Ve,exports.WorkbookStrip=an,exports.WorkbookTitle=sn,exports.WorkbookViewCommandButton=Ua,exports._WorkbookIO=Yr,exports._extends=oo,exports._objectWithoutPropertiesLoose=nn,exports._setPrototypeOf=no,exports.clsx=Ke,exports.clsx$1=ie,exports.commonjsGlobal=ut,exports.createGridStyleFromMUITheme=Io,exports.defaultNewWorkbook=Er,exports.getDefaultExportFromCjs=function(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a},exports.requirePropTypes=Ot,exports.setPrintExamplesOnLoad=a=>{dr=a},exports.useMeasure=_e,exports.useWorkbookCommands=Tr;