@sheetxl/studio-mui 0.6.3 → 0.6.5

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 (39) hide show
  1. package/browser/cjs/{BD0aizaQxrJcTTuh.cjs → BMxf7QrY-RKnhIl4.cjs} +1 -1
  2. package/browser/cjs/{BEXxfPyIG6uwQ5Gp.cjs → BS2wS_sZa-gKkoFx.cjs} +4 -4
  3. package/browser/cjs/{BHjZUNkGebWGKH-W.cjs → BTFMHzaEfycvibMu.cjs} +2 -2
  4. package/browser/cjs/{Tr5gf0umJmqDSX76.cjs → BdFSVVjjrhlXHPpK.cjs} +2 -2
  5. package/browser/cjs/{CqJQRL5PzY9CTI4-.cjs → BiXR_PE14hrnbjxg.cjs} +1 -1
  6. package/browser/cjs/{D3f55Nd_Sg45hUpb.cjs → Bkxhpequ7eXKflN2.cjs} +2 -2
  7. package/browser/cjs/{BKddoLqJCGvXmAq8.cjs → CHMLnYdMrxKoXUT-.cjs} +1 -1
  8. package/browser/cjs/{D0f-XIJu6KlJxgZe.cjs → CUnh1LhecJpjlHt_.cjs} +3 -3
  9. package/browser/cjs/{C8v3yyzRLldglsXV.cjs → CZibZcMftaStnfGU.cjs} +1 -1
  10. package/browser/cjs/{CF_rsS-lCC6D_2Zp.cjs → Cgcw3wtvrTN9St3u.cjs} +1 -1
  11. package/browser/cjs/{BSqdiLlC_z3lDcvH.cjs → D3da_TJhCMaA-Jvd.cjs} +2 -2
  12. package/browser/cjs/index.cjs +2 -2
  13. package/browser/cjs/{CUKXTePYz-VIH3Tf.cjs → mocbOdB4d2s-EcmO.cjs} +2 -2
  14. package/browser/esm/{Dm_JdaXNhItW6rsK.mjs → 1-hjYTXne52O8OX_.mjs} +1 -1
  15. package/browser/esm/{B6TM_jdtmeYWN3Rk.mjs → BM3rF0tr-rYuco_b.mjs} +2 -2
  16. package/browser/esm/{uprPhvcBKmKjT_Wf.mjs → BMSwIfNeNw_icSmZ.mjs} +1 -1
  17. package/browser/esm/{QMu_ECB1nYPoH3RZ.mjs → BZW3vg34hfduKfB_.mjs} +4 -4
  18. package/browser/esm/{CE33GSEQnVtxeYOn.mjs → BezPorS4-_Cf52pp.mjs} +1 -1
  19. package/browser/esm/{DhoUEajCz9FR0glL.mjs → C79_LGbHVJJOQeTJ.mjs} +3 -3
  20. package/browser/esm/{CMAox6geaBz-xQax.mjs → ClhYgmXRwTR4BGDR.mjs} +2 -2
  21. package/browser/esm/{Cd06LkBPCFnxFchn.mjs → CmyX3-QWO3ckLyv3.mjs} +1 -1
  22. package/browser/esm/{Ha5m7PYcIJN_JS3F.mjs → DNCGkZj-AkmOiPjY.mjs} +1 -1
  23. package/browser/esm/{NRx-ORwyy9EcHyIC.mjs → DhXNvjm-1jhrLfp9.mjs} +2 -2
  24. package/browser/esm/{COky5epcDwlHvQCh.mjs → DnGxqCVe_CBDfW9k.mjs} +2 -2
  25. package/browser/esm/{DSXoSdUsD1zsUh8P.mjs → DrthDGd5PMQYMoAg.mjs} +2 -2
  26. package/browser/esm/index.mjs +2 -2
  27. package/licenses/dependencies.txt +139 -139
  28. package/node/esm/{C4AE9oT7FQWMVhaq.mjs → 6F8OSHeXM9CEkZqx.mjs} +1 -1
  29. package/node/esm/{DLC4I017RIMulvZt.mjs → B6FKzcfPmEc-2C3u.mjs} +1 -1
  30. package/node/esm/{CIfPqworFWnMCfZC.mjs → B8vjMUZKgFrmm-ow.mjs} +1 -1
  31. package/node/esm/{DpKDLYEimh6tl7l4.mjs → Bzl7JElFM6-FCHSt.mjs} +1 -1
  32. package/node/esm/{BtrHHxvw3lzTgguV.mjs → CIovZ9X_7yBfY6gS.mjs} +1 -1
  33. package/node/esm/{CtOVkO1KPKd24twl.mjs → Cnq5yNOuwBbKS_5h.mjs} +1 -1
  34. package/node/esm/{BwHgBOgyIa5p-NAt.mjs → CztOzeLDzog1fyuN.mjs} +1 -1
  35. package/node/esm/{CvigAgyq2Lzjnm_h.mjs → DGRe7O8zr5SC-f6x.mjs} +1 -1
  36. package/node/esm/{eoFKHVlL8o63hMwn.mjs → Diz6_VGLA3UKNUY9.mjs} +1 -1
  37. package/node/esm/{BXLrOQCisY3s8NAn.mjs → Ky0P7yYYcyx15RUV.mjs} +1 -1
  38. package/node/esm/index.mjs +4 -4
  39. package/package.json +8 -8
@@ -1,9 +1,9 @@
1
1
  "use strict";var yl=Object.create;var Rn=Object.defineProperty;var Cl=Object.getOwnPropertyDescriptor;var Sl=Object.getOwnPropertyNames;var wl=Object.getPrototypeOf,kl=Object.prototype.hasOwnProperty;var vl=(l,i,n,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Sl(i))!kl.call(l,r)&&r!==n&&Rn(l,r,{get:()=>i[r],enumerable:!(t=Cl(i,r))||t.enumerable});return l};var Mn=(l,i,n)=>(n=l!=null?yl(wl(l)):{},vl(i||!l||!l.__esModule?Rn(n,"default",{value:l,enumerable:!0}):n,l));/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.6.3
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.6.5
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 O=require("@sheetxl/sdk"),e=require("react/jsx-runtime"),a=require("react"),B=require("@mui/material"),o=require("@sheetxl/utils-mui"),me=require("@mui/icons-material"),k=require("@sheetxl/utils-react"),G=require("@mui/material/styles"),le=require("@sheetxl/react"),Re=require("@mui/system"),Je=require("react-dom"),Fe=require("@sheetxl/utils"),it=require("@sheetxl/io");function kr(l){var i,n,t="";if(typeof l=="string"||typeof l=="number")t+=l;else if(typeof l=="object")if(Array.isArray(l)){var r=l.length;for(i=0;i<r;i++)l[i]&&(n=kr(l[i]))&&(t&&(t+=" "),t+=n)}else for(n in l)l[n]&&(t&&(t+=" "),t+=n);return t}function fe(){for(var l,i,n=0,t="",r=arguments.length;n<r;n++)(l=arguments[n])&&(i=kr(l))&&(t&&(t+=" "),t+=i);return t}const vr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...f}=l,s=k.useCommands(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),d=a.useMemo(()=>{for(let p=0;p<s.length;p++)if(s[p]?.state())return s[p].key();return s[0]?.key()},[s]),h=a.useMemo(()=>{const p=new Map;return p.set("formatAlignLeftToggle",o.themeIcon(e.jsx(me.FormatAlignLeft,{}))),p.set("formatAlignCenterToggle",o.themeIcon(e.jsx(me.FormatAlignCenter,{}))),p.set("formatAlignRightToggle",o.themeIcon(e.jsx(me.FormatAlignRight,{}))),p.set("formatAlignJustifyToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p.set("formatAlignCenterContinuousToggle",o.themeIcon(e.jsx(me.FormatAlignCenter,{}))),p.set("formatAlignFillToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p.set("formatAlignDistributedHorizontalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p},[]),u=a.useMemo(()=>{if(!t)return null;const p={...t};return delete p.beforeExecute,p},[t]),b=a.useCallback((p,g)=>{const S={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},C=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignLeftToggle"),icon:h.get("formatAlignLeftToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignCenterToggle"),icon:h.get("formatAlignCenterToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignRightToggle"),icon:h.get("formatAlignRightToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignJustifyToggle"),icon:h.get("formatAlignJustifyToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignCenterContinuousToggle"),icon:h.get("formatAlignCenterContinuousToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignFillToggle"),icon:h.get("formatAlignFillToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignDistributedHorizontalToggle"),icon:h.get("formatAlignDistributedHorizontalToggle")})]}),y=e.jsxs(B.Box,{sx:{className:fe("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[e.jsx(o.CommandButton,{command:g.getCommand("formatIndentDecrease"),commandHook:u,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentDecreaseIcon,{}))}),e.jsx(o.CommandButton,{command:g.getCommand("formatIndentIncrease"),commandHook:u,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentIncreaseIcon,{}))})]}),x=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...f,children:[y,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})]});return o.defaultCreatePopupPanel({...p,children:x})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,commands:n,commandHook:t,scope:r,createPopupPanel:b,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:d,icon:h.get(d)??e.jsx(me.FormatAlignLeft,{}),...f})})),jr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),s=a.useMemo(()=>{for(let u=0;u<f.length;u++)if(f[u]?.state())return f[u].key();return f[0]?.key()},[f]),d=a.useMemo(()=>{const u=new Map;return u.set("formatAlignTopToggle",o.themeIcon(e.jsx(o.TextVerticalTopIcon,{}))),u.set("formatAlignMiddleToggle",o.themeIcon(e.jsx(o.TextVerticalCenterIcon,{}))),u.set("formatAlignBottomToggle",o.themeIcon(e.jsx(o.TextVerticalBottomIcon,{}))),u.set("formatAlignJustifyVerticalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u.set("formatAlignDistributedVerticalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u},[]),h=a.useCallback((u,b)=>{const p={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},g=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignTopToggle"),icon:d.get("formatAlignTopToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignMiddleToggle"),icon:d.get("formatAlignMiddleToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignBottomToggle"),icon:d.get("formatAlignBottomToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignJustifyVerticalToggle"),icon:d.get("formatAlignJustifyVerticalToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignDistributedVerticalToggle"),icon:d.get("formatAlignDistributedVerticalToggle")})]});return o.defaultCreatePopupPanel({...u,children:g})},[c,t,d]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:h,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:d.get(s)??o.themeIcon(e.jsx(o.TextVerticalBottomIcon,{})),...m})})),Tr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),s=a.useMemo(()=>{for(let u=0;u<f.length;u++)if(f[u]?.state())return f[u].key();return f[0]?.key()},[f]),d=a.useMemo(()=>{const u=new Map;return u.set("formatTextOverflowVisibleToggle",o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{}))),u.set("formatTextOverflowWrapToggle",o.themeIcon(e.jsx(o.TextHorizontalWrapIcon,{}))),u.set("formatTextOverflowClipToggle",o.themeIcon(e.jsx(o.TextHorizontalClipIcon,{}))),u.set("formatTextOverflowShrinkToggle",o.themeIcon(e.jsx(o.TextHorizontalShrinkIcon,{}))),u},[]),h=k.useCallbackRef((u,b)=>{const p={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},g=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:b.getCommand("formatTextOverflowVisibleToggle"),icon:d.get("formatTextOverflowVisibleToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatTextOverflowWrapToggle"),icon:d.get("formatTextOverflowWrapToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatTextOverflowClipToggle"),icon:d.get("formatTextOverflowClipToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatTextOverflowShrinkToggle"),icon:d.get("formatTextOverflowShrinkToggle")})]});return o.defaultCreatePopupPanel({...u,children:g})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:h,icon:d.get(s)??o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{})),...m})})),Br=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),s=a.useMemo(()=>{const b=f.length;for(let p=0;p<b;p++){const g=f[p];if(g?.state())return g.key()}return f[1]?.key()},[f]),d=a.useMemo(()=>{const b=new Map;return b.set("formatTextRotate0",o.themeIcon(e.jsx(o.TextRotation315Icon,{}))),b.set("formatTextRotate315",o.themeIcon(e.jsx(o.TextRotation315Icon,{}))),b.set("formatTextRotate45",o.themeIcon(e.jsx(o.TextRotation45Icon,{}))),b.set("formatTextRotate90",o.themeIcon(e.jsx(o.TextRotation90Icon,{}))),b.set("formatTextRotate270",o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))),b.set("formatTextRotateCustom",o.themeIcon(e.jsx(o.TextRotationCustomIcon,{}))),b},[]),h=a.useCallback((b,p)=>{const g={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},S=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate0"),icon:o.themeIcon(e.jsx(o.TextRotation0Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate315"),icon:o.themeIcon(e.jsx(o.TextRotation315Icon,{}))}),e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate45"),icon:o.themeIcon(e.jsx(o.TextRotation45Icon,{}))}),e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate90"),icon:o.themeIcon(e.jsx(o.TextRotation90Icon,{}))}),e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate270"),icon:o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.InputCommandButton,{...g,command:p.getCommand("formatTextRotateCustom"),icon:o.themeIcon(e.jsx(o.TextRotationCustomIcon,{})),label:"Custom"})]});return o.defaultCreatePopupPanel({...b,children:S})},[c,t,r,n]),u=a.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[f]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,selected:u,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:h,quickCommand:u?"formatTextRotate0":"formatTextRotate315",icon:o.themeIcon(d.get(s)??e.jsx(o.TextRotation315Icon,{})),...m})})),Er={Preset:"preset",Custom:"custom"},dt={Start:"start",End:"end"},bo={},jl=(l,i,n,t)=>{const r=l+"-"+i+"-"+n+(t?"-server":"");if(bo[r])return bo[r];const c=((m,f,s,d)=>{if(typeof document>"u"&&!d)return null;const h=d?new d:document.createElement("canvas");h.width=2*s,h.height=2*s;const u=h.getContext("2d");return u?(u.fillStyle=m,u.fillRect(0,0,h.width,h.height),u.fillStyle=f,u.fillRect(0,0,s,s),u.translate(s,s),u.fillRect(0,0,s,s),h.toDataURL()):null})(l,i,n,t);return bo[r]=c,c},Tl={},Ir=a.memo(l=>{const{className:i,style:n=k.ReactUtils.EmptyCssProperties,white:t="transparent",grey:r="grey",size:c=8,borderRadius:m,boxShadow:f,renderers:s=Tl,children:d,...h}=l,u=d,b=a.useMemo(()=>Object.assign({borderRadius:m,boxShadow:f,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${jl(t,r,c,s?.canvas)}) center left`},n),[t,r,c,s]);return a.isValidElement(d)?a.cloneElement(d,{...u.props}):e.jsx("div",{style:b,...h})}),Bl=a.memo(l=>{const{selectedColor:i,onSelectColor:n,onPreviewColor:t,onClick:r,onKeyDown:c,onMouseOver:m,onMouseLeave:f,onFocus:s,style:d=k.ReactUtils.EmptyCssProperties,children:h,alphaWhite:u,alphaGrey:b,darkMode:p,alphaCheckSize:g=7,...S}=l;if(!i)throw new Error("a selectedColor is required");const C=a.useCallback(E=>{r?.(E),E.isDefaultPrevented()||(E.ctrlKey?t?.(i.toRGBA()):n?.(i.toRGBA()))},[n,t,r,i]),y=a.useCallback(E=>{m?.(E),E.isDefaultPrevented()||t?.(i.toRGBA())},[t,m,i]),x=a.useCallback(E=>{f?.(E),E.isDefaultPrevented()},[t,f]),w=a.useCallback(E=>{s?.(E),E.isDefaultPrevented()||t?.(i.toRGBA())},[t,s,i]),j=a.useCallback(E=>{c?.(E),E.isDefaultPrevented()||E.keyCode===k.KeyCodes.Enter&&n?.(i.toRGBA())},[n,c,i]),T=a.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Ir,{size:g,white:u,grey:b,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[u,b,i]);return e.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...d},tabIndex:0,...S,onClick:C,onKeyDown:j,onMouseOver:y,onMouseLeave:x,onFocus:w,children:[T,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(p)},children:h})]})}),ao=a.memo(l=>{const{schemeColorLookup:i,selectedColor:n,previewColor:t,colorDef:r,onSelectColorDef:c,onPreviewColorDef:m,swatchProps:f,defaultButtonSize:s=24,isLarge:d=!1,compareRGB:h=!1,darkMode:u=!1,...b}=l,p=new O.Color({val:r.definition.val,adjs:r.definition.adjs},T=>i(T)),g=h?p.toRGBA().toString():p.toString(),S=n&&(h?n.toRGBA().toString():n.toString())===g,C=t&&(h?t.toRGBA().toString():t.toString())===g,y=[];y.push({[O.IColor.AdjustmentType.Inv]:!0}),y.push({[O.IColor.AdjustmentType.Alpha]:100});const x=p.adjust(y),w=a.useCallback(()=>{c?.(r)},[c,r]),j=a.useCallback(T=>{m?.(T?r:null)},[m,r]);return e.jsx(o.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:s*(d?1.2:1)+"px",height:s*(d?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...b,children:e.jsxs(Bl,{selectedColor:p,title:null,onSelectColor:w,onPreviewColor:j,alphaCheckSize:d?9:void 0,darkMode:u,...f,children:[e.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:x.toRGBA(u).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:S?"1":"0"}}),e.jsx("div",{style:{position:"absolute",width:.33*s*(d?1.2:1)+"px",height:.33*s*(d?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:x.toRGBA(u).toString(),borderRadius:"50%",opacity:C?"1":"0"}})]})})})}),Ht=a.memo(l=>{const{title:i,schemeColorLookup:n,colorDefs:t,selectedColor:r,previewColor:c,onSelectColorDef:m,onPreviewColorDef:f,style:s=k.ReactUtils.EmptyCssProperties,compareRGB:d=!1,darkMode:h,swatchProps:u,...b}=l;let p;if(Array.isArray(t[0]))p=t;else{p=[];for(let x=0;x<t.length;x++)p.push([t[x]])}const g=a.useCallback(x=>{m?.(x)},[m]),S=a.useCallback(x=>{f?.(x)},[f]),C=a.useMemo(()=>{let x=[];for(let w=0;w<p.length;w++){let j=[],T=p[w];for(let I=0;I<T.length;I++){let D=T[I];j.push(e.jsx(ao,{schemeColorLookup:n,colorDef:D,selectedColor:r,previewColor:c,onSelectColorDef:g,onPreviewColorDef:S,swatchProps:u,compareRGB:d,darkMode:h},w+" "+I))}let E=e.jsx(B.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:I=>I.shadows[2],borderRadius:"2px",overflow:"hidden"},children:j},""+w);x.push(E)}return x},[p,r,c,g,S]),y=a.useMemo(()=>i?e.jsx(B.Typography,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:x=>x.palette.text.secondary},children:i}):null,[i]);return e.jsxs(B.Box,{style:{...s},children:[y,e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...b,children:C})]})}),De=(l,i)=>({description:l,definition:{val:i,adjs:[]}}),ye=(l,i,n,t,r,c)=>{const m=De(l,i);t?.push(m);const f=new O.Color({val:m.definition.val,adjs:m.definition.adjs},n),s=f.toString();r?.set(s,f);const d=f.toRGBA().toString();c?.set(d,f)},El=a.lazy(()=>Promise.resolve().then(()=>require("./BHjZUNkGebWGKH-W.cjs"))),Rr=a.memo(a.forwardRef((l,i)=>{const{selectedColor:n=null,previewColor:t=l.selectedColor??null,recentColors:r,schemeLookup:c,disableAlpha:m=!1,previewDebounceTime:f=100,initialPanelType:s,defaultButtonSize:d=24,width:h,onElementLoad:u,onDone:b,onEyeDropStart:p,onEyeDropStop:g,onPreviewColor:S,onPreviewColorImmediate:C,onSelectColor:y,autoColor:x,autoColorLabel:w="Automatic",autoColorPosition:j=dt.Start,compareRGB:T=!1,darkMode:E=!1,...I}=l,D=t||n,N=k.useCallbackRef(S,[S]),L=k.useCallbackRef(C,[C]),P=k.useCallbackRef(y,[y]),v=k.useCallbackRef(p,[p]),F=k.useCallbackRef(g,[g]),[H,A]=a.useState(!1),$=G.useTheme(),M=a.useMemo(()=>c||O.Color.getDefaultSchemeLookup(),[c]),R=a.useMemo(()=>{const z=new Map,J=new Map,ce=[];ye("Primary Background","bg1",M,ce,z,J),ye("Primary Text","tx1",M,ce,z,J),ye("Secondary Background","bg2",M,ce,z,J),ye("Secondary Text","tx2",M,ce,z,J),ye("Accent 1","accent1",M,ce,z,J),ye("Accent 2","accent2",M,ce,z,J),ye("Accent 3","accent3",M,ce,z,J),ye("Accent 4","accent4",M,ce,z,J),ye("Accent 5","accent5",M,ce,z,J),ye("Accent 6","accent6",M,ce,z,J);const re=O.ITheme.buildPalette(ce,M,z,J),ae=[];if(ye("Dark Red","C00000",M,ae,z,J),ye("Red","FF0000",M,ae,z,J),ye("Orange","FFC000",M,ae,z,J),ye("Yellow","FFFF00",M,ae,z,J),ye("Light Green","92D050",M,ae,z,J),ye("Green","00B050",M,ae,z,J),ye("Light Blue","00B0F0",M,ae,z,J),ye("Blue","0070C0",M,ae,z,J),ye("Dark Blue","002060",M,ae,z,J),m?ye("Purple Is A Fruit","7030A0",M,ae,z,J):ye("Transparent","00000000",M,ae,z,J),x){const ie=x.toString();z.set(ie,x)}const Z=new Map,te=typeof r=="function"?r():r,ue=[];for(let ie=0;te&&ie<te.length;ie++){const je=te[ie].toString();Z.set(je,te[ie]),ue.push({description:"Recent "+(ie+1),definition:{val:te[ie].toString()}})}return{primaryColors:ce,modifiedPresets:re,standardColors:ae,recentColorsLimited:ue,mapAllPresets:z,mapAllPresetsRGB:J,mapRecent:Z}},[M,r,m,x]);a.useEffect(()=>{u?.()},[]);const[K,X]=a.useState(!1),q=a.useCallback(()=>{X(z=>!z)},[]);a.useEffect(()=>{if(s)X(s===Er.Custom);else if(n){let z=n.toString(),J=R.mapAllPresets.get(z);J||(z=n.toRGBA().toString(),J=R.mapAllPresetsRGB.get(z));const ce=R.mapRecent.get(z);X(!J&&!ce)}},[n,s]);const U=a.useCallback(O.CommonUtils.debounce(z=>{N?.(z)},f),[N,f]),[Q,ee]=a.useState();a.useEffect(()=>{ee(t||n)},[t,n]);const _=k.useCallbackRef(z=>{L&&(L(z),U(z))},[L]),W=k.useCallbackRef(z=>{_(z?new O.Color({val:z.definition.val,adjs:z.definition.adjs},M):null)},[M]),Y=a.useCallback(z=>{z.ctrlKey&&X(!0)},[]),ne=k.useCallbackRef(z=>{let J=!1;if(z){const ce=z.toString();J=!R.mapAllPresets.has(ce)}P?.(z,J)},[P,R]),be=k.useCallbackRef(z=>{const J=z?new O.Color({val:z.definition.val,adjs:z.definition.adjs},M):null;Promise.resolve(b?.()).then(()=>{ne(J)})},[M,b]),ge=k.useCallbackRef(z=>{_(z?new O.Color(z,M):null)},[M]),xe=a.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(B.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:z=>z.palette.text.icon??z.palette.action.active},onClick:async()=>{A(!0),v?.(),await new EyeDropper().open().then(z=>{A(!1),F?.();let J=new O.Color(z.sRGBHex),ce=J.toString(),re=R.mapAllPresets.get(ce);if(re||(ce=J.toRGBA().toString(),re=R.mapAllPresetsRGB.get(ce)),!re){const ae=J.toRGBA(),Z=3;let te=255;R.mapAllPresetsRGB.forEach((ue,ie)=>{const je=ue.toRGBA(),Me=Math.abs(je.red-ae.red)+Math.abs(je.blue-ae.blue)+Math.abs(je.green-ae.green);Me<Z&&Me<te&&(re=ue)})}X(!re),_(re||J)}).catch(z=>{A(!1),z?.name!=="AbortError"&&console.error(z)})},children:e.jsx(me.Colorize,{})}),[R,E]),Ee=a.useMemo(()=>{if(!K)return;const z={opacity:K?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return e.jsx(a.Suspense,{fallback:e.jsx("div",{style:z,children:e.jsx(o.LoadingPanel,{})}),children:e.jsx(El,{style:z,selectedColor:D?D.toRGBA().toString():"transparent",onColorChange:ge,disableAlpha:m})})},[K,D]),se=a.useMemo(()=>({onClick:Y,alphaGrey:$.palette.text.icon??$.palette.action.active}),[Y,$]),Se=a.useMemo(()=>{if(!x)return null;const z={description:w,definition:{val:x.getVal(),adjs:x.getAdjustments()}};return e.jsx(e.Fragment,{children:e.jsxs(B.MenuItem,{sx:{display:"flex",color:J=>J.palette.text.secondary},onMouseOver:()=>{W(null)},onClick:()=>{be(null)},children:[e.jsx(B.Box,{sx:{flex:"none",boxShadow:J=>J.shadows[2],borderRadius:J=>J.spacing(.5),overflow:"hidden"},children:e.jsx(ao,{schemeColorLookup:M,colorDef:z,selectedColor:n===null?x:n,previewColor:t===null?x:t,defaultButtonSize:d,isLarge:!0,darkMode:E,compareRGB:T,swatchProps:se})}),e.jsx(B.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:w})]})})},[x,w,M,n,t]);return e.jsxs(B.Box,{ref:i,sx:{width:h,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...I,children:[e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("div",{style:{opacity:K?"0":1},children:[Se&&j===dt.Start?e.jsxs(e.Fragment,{children:[Se,e.jsx(B.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Ht,{title:"Theme Colors",schemeColorLookup:M,colorDefs:R.primaryColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:E}),e.jsx(Ht,{schemeColorLookup:M,colorDefs:R.modifiedPresets,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:E}),e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Standard Colors",schemeColorLookup:M,colorDefs:R.standardColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:E}),e.jsxs("div",{style:{opacity:R.recentColorsLimited.length===0?"0":void 0,display:R.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Recent Colors",schemeColorLookup:M,colorDefs:R.recentColorsLimited,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:E})]}),Se&&j===dt.End?e.jsxs(e.Fragment,{children:[e.jsx(B.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),Se,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Ee]}),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:[xe,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:()=>{q()},children:K?e.jsx("div",{children:"Preset"}):e.jsx("div",{children:"Custom"})}),e.jsx(B.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(b?.()).then(()=>{ne(Q)})},children:"Done"})]})]})})),Il=e.jsx(o.ColorizedCircleIcon,{}),Ho=a.memo(a.forwardRef((l,i)=>{const{selectedColor:n,quickColor:t,icon:r=Il,tooltip:c,label:m,onPreviewColor:f,onPreviewColorImmediate:s,onSelectColor:d,variant:h=o.PopupButtonType.Toolbar,panelProps:u,shouldCloseFloatAll:b=!0,compareRGB:p=!1,darkMode:g=!1,...S}=l,C=k.useCallbackRef(f,[f]),y=k.useCallbackRef(s,[s]),x=k.useCallbackRef(d,[d]),[w,j]=a.useState(()=>{}),T=t||w||n||u?.autoColor,E=a.useRef(!1),I=a.useCallback(()=>{},[]),D=k.useCallbackRef(()=>{j(n)},[n]),N=k.useCallbackRef(R=>{E.current||(j(R),C?.(R))},[C]),L=k.useCallbackRef(R=>{E.current||(j(R),y?.(R))},[y]),P=k.useCallbackRef((R,K)=>{E.current||(j(void 0),x?.(R,K))},[x]),v=a.useMemo(()=>e.jsx(B.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${T?.toCSS(g)??"transparent"}`,"& .activeColor":{fill:`${T?.toCSS(g)??"transparent"}`},"& .style_grey":{fill:R=>R.palette.text.icon??R.palette.action.active}},children:typeof r=="function"?r():r}),[T,r,g]),F=k.useCallbackRef(R=>{x?.(t,!1)},[x,t]),[H,A]=a.useState(!1),$=a.useCallback(R=>{const{closeFloat:K,closeFloatAll:X}=R;return e.jsx(Rr,{...u,selectedColor:n,previewColor:w,onDone:b?X:K,onKeyDown:q=>{q.which===k.KeyCodes.Enter&&(b?X():K())},onPreviewColorImmediate:L,onPreviewColor:N,onSelectColor:P,onEyeDropStart:()=>A(!0),onEyeDropStop:()=>A(!1),compareRGB:p,darkMode:g})},[n,w,b,T,u?.autoColor,g]),M={onQuickClick:t?F:void 0,createPopupPanel:$,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:D,onPopupClose:I,tooltip:c||m||"Color",label:m,icon:v,...S};return h===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...M}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...M})})),Qt=82,Do=l=>{const{styleColor:i,length:n=Qt,width:t=1,dashArray:r=null,sx:c,isDouble:m=!1,isAngled:f=!1,darkMode:s=!1,...d}=l;return e.jsx(B.SvgIcon,{sx:{width:`${n}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:h=>`${i?i.toRGBA(s).toString():h.palette.text.icon??h.palette.action.active}`},"& .style_grey":{stroke:h=>h.palette.text.icon??h.palette.action.active},...c},height:t,width:n,viewBox:`0 0 ${n} ${t}`,...d,children:e.jsx(le.StyledStrokePath,{length:n,width:t,dashArray:r,isDouble:m,isAngled:f,className:"activeColor"})})},Mr=a.memo(a.forwardRef((l,i)=>{const{variant:n,showLabels:t=!1,disabled:r=!1,createPopupPanel:c,styleColor:m,selectedStyle:f,onSelectStyle:s,showNone:d=!0,darkMode:h,sx:u,...b}=l,p=k.useCallbackRef(s,[]),g=a.useCallback(x=>{const{popupContainer:w,floatReference:j,closeFloat:T,...E}=x,I=[],D=O.IBorder.BuiltInDefinitionsArray;for(let N=0;N<D.length;N++){const L=D[N];if(L.description==="None"&&!d)continue;const P=e.jsx(Do,{styleColor:m,length:Qt,width:L.width,darkMode:h,dashArray:L.pattern,isDouble:L.description.toLowerCase().includes("double"),isAngled:L.description.toLowerCase().includes("slant")});let v=null;v=t?e.jsxs(e.Fragment,{children:[e.jsx(B.Box,{sx:{marginRight:"6px"},children:L.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%"}}),P]})]}):L.description==="None"?"None":P,I.push(e.jsx(o.ExhibitMenuItem,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:o.createStrokeShadowFilter(4)},paddingLeft:"16px",background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},tooltipProps:{description:t?"":L.description},icon:null,disabled:r,onMouseDown:F=>F.preventDefault(),onMouseUp:()=>{T(),p(L.style)},onKeyDown:F=>{F.which===k.KeyCodes.Enter&&T()},selected:L.style===f,parentFloat:j,children:v},N))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:I})},[r,d,m,f,h]),S=a.useMemo(()=>{const x=O.IBorder.BuiltInDefinitions.get(f);let w;return w=x.description==="None"?e.jsx(B.Box,{sx:{minWidth:`${Qt}px`},children:"None"}):e.jsx(Do,{styleColor:m,length:Qt,width:x.width,dashArray:x.pattern,darkMode:h,isDouble:x.description.toLowerCase().includes("double"),isAngled:x.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:o.createStrokeShadowFilter()}},children:w})},[f,m]),C=a.useMemo(()=>O.IBorder.BuiltInDefinitions.get(f),[f]),y={disabled:r,icon:S,tooltip:"Border Style: "+C.description,sx:{background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`,...u},createPopupPanel:g,...b};return n===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{...y}):e.jsx(o.ExhibitPopupMenuItem,{...y})})),Pr=a.memo(a.forwardRef((l,i)=>{const{autoColor:n=null,schemeLookup:t,autoStrokeStyle:r=O.IBorder.StrokeStyle.Thin,disabled:c=!1,darkMode:m=!1,showStylingBefore:f=!0,onSelectBorder:s,onPreviewBorder:d,selectedBorder:h,createTemporaryBorder:u,...b}=l,p=k.useCallbackRef(s,[s]),g=k.useCallbackRef(d,[d]),[S,C]=a.useState(),[y,x]=a.useState(),w=S??r,j=y??n,T=h||{bottom:{style:r,color:n?.toString()}},E=k.useCallbackRef(v=>{const F={},H=v?Object.keys(v):[];let A=!1;for(let Q=0;Q<H.length;Q++)v[H[Q]]?.style&&(F[H[Q]]={style:v[H[Q]].style,color:v[H[Q]].color},A||F[H[Q]].style===O.IBorder.StrokeStyle.None||(A=!0));H.length<6&&(A=!0);const $=A?F.left:null,M=A?F.top:null,R=A?F.right:null,K=A?F.bottom:null,X=A?F.vertical:null,q=A?F.horizontal:null;let U="";return M||$||(U+="M 3,5 H 5 V 3 H 3 "),M||(U+="M 7,5 H 9 V 3 H 7 "),M||X||(U+="M 11,5 h 2 V 3 h -2 "),M||(U+="M 15,5 h 2 V 3 h -2 "),M||R||(U+="M 19,5 h 2 V 3 h -2 "),$||(U+="M 3,9 H 5 V 7 H 3 "),X||(U+="M 11,9 h 2 V 7 h -2 "),R||(U+="M 19,9 h 2 V 7 h -2 "),q||$||(U+="M 3,13 H 5 V 11 H 3 "),q||(U+="M 7,13 H 9 V 11 H 7 "),q||X||(U+="M 11,13 h 2 v -2 h -2 "),q||R||(U+="M 19,13 h 2 v -2 h -2 "),q||(U+="M 15,13 h 2 v -2 h -2 "),$||(U+="M 3,17 H 5 V 15 H 3 "),X||(U+="M 11,17 h 2 v -2 h -2 "),R||(U+="M 19,17 h 2 v -2 h -2 "),K||$||(U+="M 3,21 H 5 V 19 H 3 "),K||(U+="M 7,21 H 9 V 19 H 7 "),K||X||(U+="M 11,21 h 2 v -2 h -2 "),K||(U+="M 15,21 h 2 v -2 h -2 "),K||R||(U+="M 19,21 h 2 v -2 h -2 "),e.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[e.jsx(B.SvgIcon,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:e.jsx("path",{d:U})}),e.jsx(B.Box,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:o.strokeShadowFilter}},children:e.jsx(le.StaticBorderRenderer,{getBorderAt:(Q,ee)=>{if(!u||H.length===0)return null;const _=Q.rowIndex,W=Q.colIndex,Y={};return _===0?(Y.top=F.top,Y.bottom=F.horizontal):(Y.top=F.horizontal,Y.bottom=F.bottom),W===0?(Y.left=F.left,Y.right=F.vertical):(Y.left=F.vertical,Y.right=F.right),u?.(Y)},width:18,height:18,darkMode:m,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[j,w,m]),I=a.useCallback((v,F,H)=>{let A=null;if(v&&v.length>0){let $=null;(F||H)&&($={style:H,color:F?.toString()??null}),A={};for(let M=0;M<v.length;M++)A[v[M]]=$}return A},[]),D=a.useCallback(v=>{p?.(v)},[]),N=a.useCallback(v=>{g?.(v)},[]),L=a.useCallback(v=>{const{closeFloatAll:F,floatReference:H}=v,A=(R,K,X="bottom",q=!1)=>{const U=I(R,j??null,q?O.IBorder.StrokeStyle.None:w??null),Q=q?I([],j??null,w??null):U;return e.jsx(o.ExhibitIconButton,{icon:E(Q),sx:{background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},tooltipProps:{label:K,simple:!0,placement:X},onClick:()=>{F(),N(U),D(U)}})},$=e.jsxs(e.Fragment,{children:[e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom,O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical],"All Borders","top"),A([O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical],"Inner Borders","top"),A([O.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),A([O.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom],"Outside Borders","top")]}),e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[A([O.IBorder.Edge.Left],"Left Borders"),A([O.IBorder.Edge.Top],"Top Borders"),A([O.IBorder.Edge.Right],"Right Borders"),A([O.IBorder.Edge.Bottom],"Bottom Borders"),A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom,O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical,O.IBorder.Edge.DiagonalUp,O.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),M=e.jsx(e.Fragment,{children:e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[e.jsx(Ho,{variant:o.PopupButtonType.Toolbar,icon:e.jsx(o.ColorizedStrokeIcon,{}),selectedColor:w===O.IBorder.StrokeStyle.None?new O.Color("transparent"):j,onPreviewColor:R=>{x(R)},onSelectColor:(R,K)=>{x(R)},darkMode:m,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:t},disabled:c||w===O.IBorder.StrokeStyle.None,parentFloat:H,shouldCloseFloatAll:!1}),e.jsx(Mr,{selectedStyle:w,onSelectStyle:C,styleColor:j,darkMode:m,variant:o.PopupButtonType.Toolbar,parentFloat:H})]})});return e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:R=>R.stopPropagation(),children:[f?M:$,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),f?$:M]})},[w,j,n,t,m]),P=a.useMemo(()=>E(T),[T,m]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,createPopupPanel:L,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:v},F)=>e.jsx(o.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:F,children:v}),onQuickClick:()=>{p?.(T)},quickButtonProps:{sx:{}},disabled:c,icon:P,...b})})),Dr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,variant:c=k.CommandButtonType.Toolbar,disabled:m=!1,autoColor:f,autoStrokeStyle:s,schemeLookup:d,createTemporaryBorder:h,selectedBorder:u,onSelectBorder:b,darkMode:p,icon:g,label:S,...C}=l,y=k.useCommands(n,["formatBorder"]),x=t??y[0],w=x?.context()??null,j=w?.autoColor??f,T=w?.autoStyle??s,E=u??w?.quickBorder,I=p??w?.darkMode,D=h??w?.createTemporaryBorder,N=d??w?.schemeLookup,L=k.useCallbackRef(v=>{w?.onBorderSelect&&w.onBorderSelect(v),b?.(v),x?.execute(v,r)},[x,b,r]),P=a.useCallback((v,F)=>{const{children:H,title:A,...$}=v;let M=v.children;return(x?.disabled()||m)&&(M=e.jsx("div",{children:M})),e.jsx(o.CommandTooltip,{command:x,placement:c===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:F,...$,children:M})},[x,m]);return e.jsx(Pr,{ref:i,autoColor:j,darkMode:I,autoStrokeStyle:T,createTemporaryBorder:D,schemeLookup:N,selectedBorder:E,onSelectBorder:L,createTooltip:P,disabled:m||!x||x.disabled(),...C})})),Fr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeToggle"),icon:o.themeIcon(e.jsx(o.MergeAllIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeHorizontal"),icon:o.themeIcon(e.jsx(o.MergeHorizontalIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeVertical"),icon:o.themeIcon(e.jsx(o.MergeVerticalIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:d.getCommand("unmerge"),icon:o.themeIcon(e.jsx(o.MergeUnMergeIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,quickCommand:"mergeToggle",commandHook:t,scope:r,tooltip:"Combine or split cells.",createPopupPanel:f,icon:o.themeIcon(e.jsx(o.MergeAllIcon,{})),...m})})),Nr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggle"),icon:o.themeIcon(e.jsx(o.FreezeBothIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggleHorizontal"),icon:o.themeIcon(e.jsx(o.FreezeRowsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggleVertical"),icon:o.themeIcon(e.jsx(o.FreezeColumnsIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:d.getCommand("unfreeze"),icon:e.jsx(o.MergeUnMergeIcon,{})})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:f,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:e.jsx(o.FreezeIcon,{}),...m})})),Ar=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("find"),icon:o.themeIcon(e.jsx(o.FindIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("findReplace"),icon:o.themeIcon(e.jsx(o.FindReplaceIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("goto"),icon:o.themeIcon(e.jsx(o.GotoIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:f,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:o.themeIcon(e.jsx(o.FindIcon,{})),...m})})),Or=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,showQuickButtons:r=!!l.commands,commands:c,fontSizes:m=le.FontUtils.DefaultFontSizes,disabled:f=!1,parentFloat:s,icon:d,label:h,sx:u,...b}=l;k.useCommand(n);const p=()=>n?.state()?.toString()||"11",[g,S]=a.useState(p),C=k.useCallbackRef(()=>{const D=parseFloat(g);isNaN(D)?S(p()):parseFloat(p())!==D&&n.execute(D,t)},[p,n,g,t]);a.useEffect(()=>{S(p())},[n?.state()]);const y=a.useMemo(()=>{if(!t)return null;const D={...t};return delete D.beforeExecute,D},[t]),x=k.useCommands(c,["formatFontSizeIncrease","formatFontSizeDecrease"]),w=a.useMemo(()=>x?e.jsxs(B.Box,{className:fe("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:D=>D.stopPropagation(),children:[e.jsx(o.CommandButton,{command:x[0],commandHook:y,icon:o.themeIcon(e.jsx(o.TextSizeIncreaseIcon,{}))}),e.jsx(o.CommandButton,{command:x[1],icon:o.themeIcon(e.jsx(o.TextSizeDecreaseIcon,{}))})]}):null,[x]),j=G.useTheme(),T=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("12.3",Math.round(j.typography.fontSize),j.typography.fontFamily).width}px`,[j]),E=a.useCallback(D=>{const{onMouseDown:N,onMouseUp:L,...P}=D;return e.jsx(B.IconButton,{component:"div",...P,disableRipple:!0,children:e.jsx(B.Input,{inputMode:"numeric",disabled:f||!n||n.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:v=>`1px solid ${v.palette.text.icon??v.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:v=>`1px solid ${v.palette.error.main}`},"::after":{borderBottom:v=>`1px solid ${v.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:v=>`${Math.round(v.typography.fontSize)}px`,width:T,color:v=>v.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:g,onFocus:v=>{v.target?.select()},onKeyDown:v=>{if(v.which===k.KeyCodes.Enter)p()!==g&&(v.stopPropagation(),v.preventDefault(),C());else if(v.which===k.KeyCodes.Escape)p()!==g&&(S(p()),setTimeout(()=>{v.target?.select()},0),v.stopPropagation(),v.preventDefault());else{if(v.key.match("[-]")||v.key.match("[0-9.]")&&(g+v.key).length>4)return v.stopPropagation(),void v.preventDefault();if(v.which===k.KeyCodes.Space)return void v.preventDefault()}},onBlur:()=>{C()},onChange:v=>{if(v.target.value.length>4)return v.stopPropagation(),void v.preventDefault();S(v.target.value)}})})},[g,f,n]),I=a.useCallback(D=>{const N=F=>{n?.execute(F,t)},L=n?.state(),P=[];for(let F=0;F<m.length;F++){const H=m[F]===L;P.push(e.jsx(o.ExhibitMenuItem,{selected:H,icon:H?e.jsx(o.SelectedIcon,{}):void 0,disabled:f||!n||n.disabled(),onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&N(m[F])},onKeyDown:A=>{A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(m[F])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:m[F]})},"fontSize-"+F))}const v=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...b,children:[w,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:P})]});return o.defaultCreatePopupPanel({...D,children:v})},[f,n?.state(),t]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...u},tabIndex:-1,outlined:!0,disabled:f,parentFloat:s,createPopupPanel:I,createTooltip:({children:D},N)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:N||n?.disabled(),children:D}),createQuickButton:E,...b})})),Pn=a.memo(l=>{const{selected:i,disabled:n,formattedValue:t,handleSetFormat:r,format:c,sx:m,...f}=l;return e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...m},disabled:n,selected:i,icon:i?e.jsx(o.SelectedIcon,{}):void 0,onMouseDown:s=>{s.button===0&&s.preventDefault()},onMouseUp:s=>{s.button===0&&r(c.numberFormat)},onKeyDown:s=>{s.keyCode!==k.KeyCodes.Enter&&s.keyCode!==k.KeyCodes.Space||r(c.numberFormat)},...f,children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(B.Typography,{component:"div",children:[c.formatType,c.formatType===O.NumberFormat.Type.Custom?"…":""]}),e.jsx(B.Typography,{variant:"caption",component:"div",sx:{color:s=>Re.alpha(s.palette.text.primary,.6),paddingTop:t&&t.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:t&&t.length>0?t:" "})]})})}),Lr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,sx:c,disabled:m=!1,parentFloat:f,...s}=l,d=k.useCommands(n,["formatNumberFormat"])[0],h=d?.state()?O.NumberFormat.Styles.lookupStyle(d?.state()).formatType:O.NumberFormat.Type.General,u=a.useMemo(()=>{if(!t)return null;const S={...t};return delete S.beforeExecute,S},[t]),b=a.useCallback((S,C)=>{const y=L=>{t?.beforeExecute?.(d,d?.state()),d.execute(L,t),t?.onExecute?.(d,d?.state())},x=d?.context()(),w=O.NumberFormat.Styles.lookupPrimary(),j=[];for(let L=0;L<w.length;L++){let P="";if(x&&!x.isEmpty())try{P=x.getNumberFormat(w[L].numberFormat).displayText}catch(F){console.warn(F)}P===""&&w[L].formatType===O.NumberFormat.Type.General&&(P="No specific format");const v=w[L].formatType===h;j.push(e.jsx(Pn,{selected:v,disabled:m||!d||d.disabled(),formattedValue:P,handleSetFormat:y,format:w[L]},w[L].formatType))}const T={numberFormat:"",formatType:O.NumberFormat.Type.Custom},E=h===O.NumberFormat.Type.Custom,I=e.jsx(Pn,{selected:E,disabled:m||!d||d.disabled(),formattedValue:E?x.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(d,d?.state()),C.getCommand("formatNumberDialog")?.execute(d?.state()),t?.onExecute?.(d,d?.state())},format:T,sx:{flex:"0",width:"100%"}},O.NumberFormat.Type.Custom),D=e.jsxs(B.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:L=>L.stopPropagation(),children:[e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatAccountingStyle"),commandHook:u,scope:r,icon:e.jsx(o.CurrencyDollarIcon,{})}),e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatPercentStyle"),commandHook:u,scope:r,icon:e.jsx(o.PercentIcon,{})}),e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatCommaStyle"),commandHook:u,scope:r,icon:e.jsx(o.CommaIcon,{})}),e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:u,scope:r,icon:o.themeIcon(e.jsx(o.IncreaseDecimalIcon2,{}))}),e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:u,scope:r,icon:o.themeIcon(e.jsx(o.DecreaseDecimalIcon2,{}))})]}),N=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...s,children:[D,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),I]});return o.defaultCreatePopupPanel({...S,children:N})},[d?.context(),d?.state(),t,r]),p=G.useTheme(),g=a.useMemo(()=>{const S=O.NumberFormat.Type.MediumTime;return`${O.IFont.getSharedMeasurer()(S,Math.round(p.typography.fontSize),p.typography.fontFamily).width}px`},[p]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,sx:c,outlined:!0,disabled:m,parentFloat:f,createPopupPanel:b,createTooltip:({children:S},C)=>e.jsx(o.ExhibitTooltip,{label:d?.label(),description:d?.description(),disabled:C,children:S}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:S=>`${Math.round(S.typography.fontSize)}px`,color:S=>S.palette.text.secondary,fontFamily:S=>S.typography.fontFamily,width:g},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:h})}),...s})})),zo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"clear",disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("clearAll"),icon:e.jsx(o.ClearAllIcon,{})}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearFormats"),icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearContents"),icon:o.themeIcon(e.jsx(o.ClearContentsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearComments")}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearHyperlinks")})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:f,icon:e.jsx(o.ClearAllIcon,{}),...m})})),Hr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"fill",disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("fillDown"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillRight"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(270deg)"}}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillUp"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(180deg)"}}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillLeft"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(90deg)"}}))})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:f,icon:o.themeIcon(e.jsx(o.FillDownIcon,{})),...m})})),Wo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,disableSheet:m=!1,preferSingleMenu:f=!0,showQuickButton:s=!0,variant:d=k.CommandButtonType.Toolbar,...h}=l,u=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],b=k.useCommands(n,u),{singleCommand:p,allDisabled:g}=a.useMemo(()=>{let y=null,x=0;for(let w=0;w<b.length;w++)b[w]&&!b[w]?.disabled()&&(f&&d===k.CommandButtonType.Menuitem&&(y=x===0?b[w]:null),x++);return{singleCommand:y,allDisabled:x===0}},[b]),S=a.useMemo(()=>{const y=new Map;return y.set("insertCellsShiftDown",o.themeIcon(e.jsx(o.InsertCells,{}))),y.set("insertCellsShiftRight",o.themeIcon(e.jsx(o.InsertCells,{sx:{transform:"rotate(270deg)"}}))),y.set("insertRows",o.themeIcon(e.jsx(o.InsertRowIcon,{}))),y.set("insertColumns",o.themeIcon(e.jsx(o.InsertColumn2Icon,{}))),y},[]),C=a.useCallback((y,x)=>{let w=null;const j={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"insertCells",disabled:c};m||(w=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:x.getCommand("addSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...j,command:b[0],icon:S.get(u[0])}),e.jsx(o.CommandButton,{...j,command:b[1],icon:S.get(u[1])}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:b[2],icon:S.get(u[2])}),e.jsx(o.CommandButton,{...j,command:b[3],icon:S.get(u[3])}),w]});return o.defaultCreatePopupPanel({...y,children:T})},[c,b,t,r,S]);return p?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:p,icon:S.get(p.key()),...h}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"insertCells",commands:n,commandHook:t,scope:r,disabled:c||g,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:C,icon:o.themeIcon(e.jsx(o.InsertColumn2Icon,{})),...h})})),Vo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,disableSheet:m=!1,preferSingleMenu:f=!0,showQuickButton:s=!0,variant:d=k.CommandButtonType.Toolbar,...h}=l,u=k.useCommands(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:b,allDisabled:p}=a.useMemo(()=>{let C=null,y=0;for(let x=0;x<u.length;x++)u[x]&&!u[x]?.disabled()&&(f&&d===k.CommandButtonType.Menuitem&&(C=y===0?u[x]:null),y++);return{singleCommand:C,allDisabled:y===0}},[u]),g=a.useMemo(()=>{const C=new Map;return C.set("deleteCellsShiftUp",o.themeIcon(e.jsx(o.RemoveCellsIcon,{sx:{transform:"rotate(0deg)"}}))),C.set("deleteCellsShiftLeft",o.themeIcon(e.jsx(o.RemoveCellsIcon,{sx:{transform:"rotate(270deg)"}}))),C.set("deleteRows",o.themeIcon(e.jsx(o.RemoveRowIcon,{}))),C.set("deleteColumns",o.themeIcon(e.jsx(o.RemoveColumn2Icon,{}))),C},[]),S=a.useCallback((C,y)=>{const x={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"deleteCells",disabled:c};let w=null;m||(w=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteCellsShiftUp"),icon:g.get("deleteCellsShiftUp")}),e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteCellsShiftLeft"),icon:g.get("deleteCellsShiftLeft")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteRows"),icon:g.get("deleteRows")}),e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteColumns"),icon:g.get("deleteColumns")}),w]});return o.defaultCreatePopupPanel({...C,children:j})},[c,t,r,g]);return b?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:b,icon:g.get(b.key()),...h}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"deleteCells",commands:n,commandHook:t,scope:r,disabled:c||p,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:S,icon:o.themeIcon(e.jsx(o.RemoveColumn2Icon,{})),...h})})),ut=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,onSelectColor:r,disabled:c=!1,variant:m=k.CommandButtonType.Toolbar,quickColor:f,panelProps:s,isSplit:d=!1,darkMode:h,icon:u,...b}=l,{autoColor:p,schemeLookup:g,recentColors:S,...C}=s;if(b.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");k.useCommand(n);const y=n?.context();let x=f??y?.quickColor;d&&!x&&(x=new O.Color("transparent"));const w=p??y?.autoColor,j=g??y?.schemeLookup,T=S??y?.recentColors,E=h??y?.darkMode,I=a.useMemo(()=>({autoColor:w,schemeLookup:j,recentColors:T,darkMode:E,...C}),[w,j,T,E]),D=k.useCallbackRef((L,P)=>{L&&P&&y?.addRecentColor&&y.addRecentColor(L),y?.onColorSelect&&y.onColorSelect(L),r?.(L,P),n?.execute(L,t)},[n,r,t,y]),N=a.useCallback((L,P)=>{const{children:v,title:F,...H}=L;let A=L.children;return(n?.disabled()||c)&&(A=e.jsx("div",{children:A})),e.jsx(o.CommandTooltip,{command:n,placement:m===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:P,...H,children:A})},[n,c]);return e.jsx(Ho,{ref:i,panelProps:I,icon:u,quickColor:x,selectedColor:n?.state(),onSelectColor:D,variant:m===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:N,label:n?.label(),disabled:c||!n||n.disabled(),compareRGB:!0,darkMode:E,...b})}));ut.displayName="ColorCommandButton";const zr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...f}=l,s=k.useCommands(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),d=a.useCallback((h,u)=>{const b={variant:k.CommandButtonType.Menuitem,parentFloat:h.floatReference,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...b,command:u.getCommand("gridlinesToggle")}),e.jsx(ut,{...b,command:u.getCommand("sheetViewFormatGridlinesColor"),icon:e.jsx(o.ColorizedStrokeIcon,{}),panelProps:{disableAlpha:!0}}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleGridlinesColumns")}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleGridlinesRows")})]});return o.defaultCreatePopupPanel({...h,children:p})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,quickCommand:s[0]?.key(),commands:n,commandHook:t,createPopupPanel:d,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:e.jsx(o.LabelIcon,{command:s[0],scope:"view"}),...f})})),$o=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},u=d.getCommand("sortCustom"),b=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),u?e.jsx(o.CommandButton,{...h,command:u,icon:o.themeIcon(e.jsx(o.SortCustomIcon,{}))}):null,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:o.themeIcon(e.jsx(o.FilterReapplyIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:b})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,disabled:c,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:f,icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{})),...m})})),Rl=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:o.themeIcon(e.jsx(o.FilterReapplyIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,disabled:c,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:f,icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{})),...m})})),Uo=a.memo(a.forwardRef((l,i)=>{const{quickCommand:n,icon:t,isRedo:r=!1,nestRedo:c=!0,undoManager:m,scope:f,sx:s,disabled:d,commands:h,...u}=l,b=[n];!r&&c&&b.push("redo");const p=k.useCommands(h,b),g=p[0],S=p[1],C=m??g?.context?.()?.undoManager;let y=d;d||(y=!g||g.disabled(),S&&!S.disabled()&&(y=!1));const[x,w]=a.useState(0),j=a.useCallback((T,E)=>{let I=x===0?"Cancel":`${g.label()} ${x} Action${x===1?"":"s"}`,D=!1;C||(D=!0),D||(D=c?!C.hasRedo()&&!C.hasUndo():!C.hasRedo());const N=A=>{g.execute(A)},L=e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:D?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{w(0)},onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&N(x)},onKeyDown:A=>{A.isDefaultPrevented()||A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(x)},children:e.jsx(B.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:I})});if(D)return L;const P=r?C?.getRedoDescriptions():C?.getUndoDescriptions(),v=[];for(let A=0;A<P.length;A++){const $=P[A];v.push(e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex"},icon:e.jsx(o.BlankIcon,{}),disabled:y,selected:A<x,onMouseEnter:()=>{w(A+1)},onMouseDown:M=>{M.button===0&&M.preventDefault()},onMouseUp:M=>{M.button===0&&N(A+1)},onKeyDown:M=>{M.isDefaultPrevented()||M.keyCode!==k.KeyCodes.Enter&&M.keyCode!==k.KeyCodes.Space||N(A+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:$}),e.jsx(o.BlankIcon,{})]})},`action:${A}`))}let F=null;if(!r&&c){const A={scope:"undo",commands:E,variant:k.CommandButtonType.Menuitem,parentFloat:T.floatReference};F=[],F.push(e.jsx(Uo,{...A,quickCommand:"redo",isRedo:!0},"nested:redo")),C.hasRedo()&&C.hasUndo()&&F.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const H=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{T.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[F,e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),L]});return o.defaultCreatePopupPanel({...T,children:H})},[g?.context(),g?.state(),f,C,x,y]);return e.jsx(o.CommandPopupButton,{ref:i,commands:h,quickCommand:n,scope:f,disabled:y,label:g?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${g?.label()??"No"} last actions.`})}),createPopupPanel:j,icon:t??o.themeIcon(r?e.jsx(o.RedoIcon,{}):e.jsx(o.UndoIcon,{})),selected:!1,...u})})),mt=O.IFontCollection.getFontList(),Wr=new Map;for(let l=0;l<mt.length;l++)Wr.set(mt[l].fontRef.getFamily(),mt[l]);const Vr=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,sx:r,disabled:c=!1,parentFloat:m,icon:f,label:s,...d}=l;k.useCommand(n);const h=n?.state(),u=G.useTheme(),b=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("Times New Roman",Math.round(u.typography.fontSize),u.typography.fontFamily).width}px`,[u]),p=a.useCallback(g=>{const S=w=>{n?.execute(w,t)},C=[];for(let w=0;w<mt.length;w++)C.push({key:mt[w].fontRef.getFamily(),description:mt[w].fontRef.getFamily()});Wr.get(h)||C.unshift({key:h,description:h});const y=[];for(let w=0;w<C.length;w++){const j=C[w].key===h;y.push(e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:j,disabled:c||!n||n.disabled(),icon:j?e.jsx(o.SelectedIcon,{}):void 0,onMouseUp:T=>{T.button===0&&S(C[w].key)},onMouseDown:T=>{T.button===0&&T.preventDefault()},onKeyDown:T=>{T.keyCode!==k.KeyCodes.Enter&&T.keyCode!==k.KeyCodes.Space||S(C[w].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:()=>C[w]?.key},children:C[w].description})})},w+""+C[w].key))}const x=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})});return o.defaultCreatePopupPanel({...g,children:x})},[c,n?.state()]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:c,parentFloat:m,createPopupPanel:p,createTooltip:({children:g},S)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:S,children:g}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:g=>`${Math.round(g.typography.fontSize)}px`,fontFamily:g=>g.typography.fontFamily,color:g=>g.palette.text.secondary,width:b},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:h})}),...d})})),$r=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),s=a.useMemo(()=>{for(let u=0;u<f.length;u++)if(f[u]?.state())return f[u].key();return f[0]?.key()},[f]),d=a.useMemo(()=>{const u=new Map;return u.set("formatStrikeThroughToggle",o.themeIcon(e.jsx(o.TextStrikeIcon,{}))),u.set("formatSuperscriptToggle",o.themeIcon(e.jsx(o.TextSuperscriptIcon,{}))),u.set("formatSubscriptToggle",o.themeIcon(e.jsx(o.TextSubscriptIcon,{}))),u},[]),h=a.useCallback((u,b)=>{const p={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:c},g=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:b.getCommand("formatStrikeThroughToggle"),icon:d.get("formatStrikeThroughToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatSuperscriptToggle"),icon:d.get("formatSuperscriptToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatSubscriptToggle"),icon:d.get("formatSubscriptToggle")})]});return o.defaultCreatePopupPanel({...u,children:g})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,createPopupPanel:h,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:d.get(s)??o.themeIcon(e.jsx(o.TextStrikeIcon,{})),...m})})),Ur=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),s=a.useMemo(()=>{for(let u=0;u<f.length;u++)if(f[u]?.state())return f[u].key();return f[0]?.key()},[f]),d=a.useMemo(()=>{const u=new Map;return u.set("formatUnderlinedToggle",o.themeIcon(e.jsx(o.TextUnderlineIcon,{}))),u.set("formatUnderlinedDoubleToggle",o.themeIcon(e.jsx(o.TextUnderlineDoubleIcon,{}))),u.set("formatUnderlinedAccountingToggle",o.themeIcon(e.jsx(o.TextUnderlineAccountingIcon,{}))),u.set("formatUnderlinedAccountingDoubleToggle",o.themeIcon(e.jsx(o.TextUnderlineAccountingDoubleIcon,{}))),u},[]),h=a.useCallback((u,b)=>{const p={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:c},g=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:b.getCommand("formatUnderlinedToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineIcon,{}))}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatUnderlinedDoubleToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineDoubleIcon,{}))}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatUnderlinedAccountingToggle"),commandHook:t,icon:o.themeIcon(e.jsx(o.TextUnderlineAccountingIcon,{}))}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineAccountingDoubleIcon,{}))})]});return o.defaultCreatePopupPanel({...u,children:g})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:h,icon:d.get(s)??o.themeIcon(e.jsx(o.TextUnderlineIcon,{})),...m})})),_o=a.memo(a.forwardRef((l,i)=>{const{command:n,commands:t,commandHook:r,scope:c,includePasteAllInPopup:m=!0,disabled:f=!1,...s}=l,d=k.useCallbackRef((h,u)=>{const b={variant:k.CommandButtonType.Menuitem,commandHook:r,scope:"paste",disabled:f},p=[];return m&&(p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("paste"),key:"paste",icon:e.jsx(o.PasteIcon,{})})),p.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"paste-div"))),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteValues"),key:"pasteValues",icon:o.themeIcon(e.jsx(o.PasteValuesIcon,{}))})),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteFormats"),key:"pasteFormats",icon:o.themeIcon(e.jsx(o.PasteFormatsIcon,{}))})),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteFormulas"),key:"pasteFormulas",icon:o.themeIcon(e.jsx(o.PasteFormulasIcon,{}))})),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteTranspose"),key:"pasteTranspose",icon:o.themeIcon(e.jsx(o.PasteTransposeIcon,{}))})),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteLinks"),key:"pasteLinks",icon:o.themeIcon(e.jsx(o.PasteLinksIcon,{}))})),o.defaultCreatePopupPanel({...h,children:p})},[f,r,c,m]);return e.jsx(o.CommandPopupButton,{ref:i,commands:t,commandHook:r,scope:c,createPopupPanel:d,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:e.jsx(o.PasteIcon,{}),...s})})),_r=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...f}=l,s=k.useCommands(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),d=a.useCallback((h,u)=>{const b={variant:k.CommandButtonType.Menuitem,parentFloat:h.floatReference,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleShowHeadings")}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleShowHeadingsNumeric")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleShowHeadingColumns")}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleShowHeadingRows")})]});return o.defaultCreatePopupPanel({...h,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,quickCommand:s[0]?.key(),commands:n,commandHook:t,createPopupPanel:d,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:e.jsx(o.LabelIcon,{command:s[0],scope:"view"}),...f})})),qr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r="view",disabled:c=!1,...m}=l,f=a.useCallback(s=>{const d={variant:k.CommandButtonType.Menuitem,parentFloat:s.floatReference,commandHook:t,scope:r,disabled:c},h=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowFormulaBar")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowTabs")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowStatusBar")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return o.defaultCreatePopupPanel({...s,children:h})},[c,n,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:f,icon:e.jsx(o.LabelIcon,{icon:null,label:"Workbook View"}),...m})})),Kr=a.memo(a.forwardRef((l,i)=>{const{value:n,cellStyle:t,styles:r,createTemporaryCell:c,bodyStyle:m,sx:f,borderProps:s,disabled:d,...h}=l,u=a.useMemo(()=>c({value:n,style:t}),[n,t,c]),b=a.useMemo(()=>u.getStyle(),[u,m]),p=a.useMemo(()=>b.getFill().toCSS(m?.darkMode??!1),[b]),g=b.getInsets(),S=b.getFont(),C=a.useCallback(()=>b.getBorder(),[b]);return e.jsx(B.Box,{ref:i,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:m?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...p},"& .text":{flex:"1 1 100%",...S.toCSS(m?.darkMode??!1,1),boxSizing:"border-box",padding:`${g.top}px ${g.right}px ${g.bottom}px ${g.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:S.toCSS().textDecoration,textAlign:O.ITextFrame.toCSSHorizontalTextAlign(u.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...f},...h,children:e.jsx(le.StaticBorderRenderer,{getBorderAt:C,darkMode:m?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...s?.style},...s,children:e.jsx(B.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:e.jsx(B.Box,{className:"text",children:n})})})})})),Ml=a.memo(l=>{const{styles:i,namedStyle:n,selectedNamed:t,hasContextMenu:r=!0,bodyStyle:c,onSelectNamed:m,createTemporaryCell:f,parentFloat:s,commands:d,disabled:h,commandHook:u,...b}=l,p=a.useCallback(C=>{const y={variant:k.CommandButtonType.Menuitem,commandHook:u,context:"cellStyle"},x=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...y,sx:{fontWeight:550},command:d.getCommand("formatCellStyle"),commandState:n,disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...y,command:d.getCommand("modifyCellStyle"),commandState:{named:n}}),e.jsx(o.CommandButton,{...y,command:d.getCommand("deleteCellStyle"),commandState:n,disabled:h||n?.getName()===O.IStyle.BuiltInName.Normal})]}),w=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:x})});return o.defaultCreatePopupPanel({...C,children:w})},[]),g=n?.getName()===t?.getName();let S=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:C=>`solid ${g?C.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:h,icon:null,onClick:()=>{m?.(n)},...b,children:e.jsx(Kr,{value:n.getName(),cellStyle:{named:n.getName()},styles:i,createTemporaryCell:f,bodyStyle:c})},n.getName());return r&&(S=e.jsx(o.ContextMenu,{label:n.getName(),parentFloat:s,createPopupPanel:p,children:S})),S}),Gr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,selectedNamed:c,onSelectNamed:m,disabled:f=!1,bodyStyle:s,usePreviewIcon:d=!0,...h}=l;k.useCommand(t);const u=t?.context(),b=u?.styles,p=c??u?.named(),g=s??u?.bodyStyle(),S=k.useCallbackRef(j=>{m?.(j),t?.execute(j,r)},[t,m,r]),C=a.useCallback((j,T)=>{const E={onSelectNamed:S,styles:b(),parentFloat:j.floatReference},I=b().getCustomNamed(),D=new Map,N=[];for(let M=0;M<I.length;M++)D.set(I[M].getName(),I[M]),b().getNamed(I[M].getName()).getBuiltInID()===null&&N.push(I[M].getName());const L=M=>{let R=D.get(M);return R||(R=b().getNamed(M)),!R||R.isHidden()?null:e.jsx(Ml,{namedStyle:R,selectedNamed:p,bodyStyle:u.bodyStyle(),createTemporaryCell:u.createTemporaryCell,commands:n,commandHook:r,...E},M)},P=(M,R,K=!0)=>{const X=[];for(let q=0;q<R.length;q++){const U=L(R[q]);U&&X.push(U)}return X.length===0?null:e.jsxs(B.Box,{children:[K?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:M},M+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:X},M+"-presets")]},M)},v=(M,R)=>{const K=[];for(let X=0;X<R.length;X++){const q=L(R[X]);q&&K.push(q)}return K.length===0?null:e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:K},M+"-presets")},F=[];F.push(P("Custom",N,!1)),F.push(P("Good, Bad and Neutral",[O.IStyle.BuiltInName.Normal,O.IStyle.BuiltInName.Bad,O.IStyle.BuiltInName.Good,O.IStyle.BuiltInName.Neutral],N.length>0)),F.push(P("Data and Model",[O.IStyle.BuiltInName.Calculation,O.IStyle.BuiltInName.CheckCell,O.IStyle.BuiltInName.ExplanatoryText,O.IStyle.BuiltInName.FollowedHyperlink,O.IStyle.BuiltInName.Hyperlink,O.IStyle.BuiltInName.Input,O.IStyle.BuiltInName.LinkedCell,O.IStyle.BuiltInName.Note,O.IStyle.BuiltInName.Output,O.IStyle.BuiltInName.WarningText])),F.push(P("Titles and Headings",[O.IStyle.BuiltInName.Heading1,O.IStyle.BuiltInName.Heading2,O.IStyle.BuiltInName.Heading3,O.IStyle.BuiltInName.Heading4,O.IStyle.BuiltInName.Title,O.IStyle.BuiltInName.Total]));let H=[];var A,$;return H.push(v("Accent 1",[O.IStyle.BuiltInName.Accent1_20,O.IStyle.BuiltInName.Accent1_40,O.IStyle.BuiltInName.Accent1_60,O.IStyle.BuiltInName.Accent1])),H.push(v("Accent 2",[O.IStyle.BuiltInName.Accent2_20,O.IStyle.BuiltInName.Accent2_40,O.IStyle.BuiltInName.Accent2_60,O.IStyle.BuiltInName.Accent2])),H.push(v("Accent 3",[O.IStyle.BuiltInName.Accent3_20,O.IStyle.BuiltInName.Accent3_40,O.IStyle.BuiltInName.Accent3_60,O.IStyle.BuiltInName.Accent3])),H.push(v("Accent 4",[O.IStyle.BuiltInName.Accent4_20,O.IStyle.BuiltInName.Accent4_40,O.IStyle.BuiltInName.Accent4_60,O.IStyle.BuiltInName.Accent4])),H.push(v("Accent 5",[O.IStyle.BuiltInName.Accent5_20,O.IStyle.BuiltInName.Accent5_40,O.IStyle.BuiltInName.Accent5_60,O.IStyle.BuiltInName.Accent5])),H.push(v("Accent 6",[O.IStyle.BuiltInName.Accent6_20,O.IStyle.BuiltInName.Accent6_40,O.IStyle.BuiltInName.Accent6_60,O.IStyle.BuiltInName.Accent6])),F.push((A="Themed Cell Styles",$=H,e.jsxs(B.Box,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.ExhibitMenuHeader,{children:A},A+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:$},A+"-presets")]},A))),F.push(P("Number Format",[O.IStyle.BuiltInName.Comma,O.IStyle.BuiltInName.Comma0,O.IStyle.BuiltInName.Currency,O.IStyle.BuiltInName.Currency0,O.IStyle.BuiltInName.Percent])),e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:M=>`${M.shape.borderRadius}px`,paddingBottom:M=>`${M.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:F}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,commandState:p,command:T.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:f,icon:o.themeIcon(e.jsx(o.NewPresetStylesIcon,{}))})]})},[p,b?.().getTheme(),g]),y=k.useCallbackRef(j=>{const T=18/O.IFont.getDeviceScale(),E=u?.createTemporaryCell(j);return E.getStyle().getFont().getSize()<=T?E:E.createTemporaryCell({style:{font:{size:T}}})},[u?.createTemporaryCell]),x=f||!t||t.disabled(),w=a.useMemo(()=>u&&d?e.jsx(Kr,{value:p?.getName()??"Custom",cellStyle:p?{named:p.getName()}:void 0,styles:u.styles(),createTemporaryCell:y,bodyStyle:u.bodyStyle(),className:"outline-hover",disabled:x,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:j=>`1px solid ${j.palette.action.hover}`},borderProps:{}}):o.themeIcon(e.jsx(o.PresetStylesIcon,{})),[p,g,x]);return e.jsx(o.CommandPopupButton,{ref:i,createPopupPanel:C,outlined:d,commands:n,createTooltip:({children:j},T)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:T,children:j}),selected:!1,disabled:x,label:t?.label(),icon:w,...h})})),Xr="_sheetxl-reset_ods65_1",Pl=10,Yr=a.memo(a.forwardRef((l,i)=>{const{styles:n,table:t,tableStyle:r=t?.getStyle()??n.getDefaultTableStyle(),bodyStyle:c,sx:m,disabled:f,className:s,forceThinBorder:d,cellHeight:h=Pl,isLive:u=!1,...b}=l,p=Math.ceil(1.3*h),[g,S]=a.useReducer(j=>j+1,0);a.useEffect(()=>{if(u&&t)return t.addListeners({onAnyChange:()=>{S()}})},[t,u]);const C=a.useMemo(()=>{let j=t?.toJSON()??{};const T={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return j&&(j.styleOptions={...j.styleOptions,name:r.getName()}),j.ref=T,new O.Table({initialAnchor:T,json:j,styles:n})},[g,t,r,n]),y=a.useMemo(()=>{const j=[];for(let T=0;T<5;T++)for(let E=0;E<5;E++){const I=C.getStyleAt({colIndex:E,rowIndex:T});j.push(I)}return j},[C]),x=a.useMemo(()=>{const j=(E,I,D)=>{let N=D.getFill().toCSS(c?.darkMode??!1);const L=p-(I<4?1:0),P=h-(E<4?1:0),v=D.getFont().getFill().toCSS(c?.darkMode??!1);return N={...N,position:"absolute",boxSizing:"border-box",left:I*(p-1),top:E*(h-1),width:L,height:P},e.jsx("td",{className:`table-style-fill ${E}-${I}`,style:N,children:e.jsx("div",{className:`table-style-text ${E}-${I}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(L-6)/2,top:(P-1)/2,borderTop:`1px solid ${v}`}})},`${E}-${I}`)},T=[];for(let E=0;E<5;E++){const I=[];for(let D=0;D<5;D++){const N=y[5*E+D];I.push(j(E,D,N))}T.push(e.jsx("tr",{children:I},E))}return T},[C,r,c]),w=a.useCallback((j,T)=>y[T].getBorder()??null,[y]);return e.jsx(B.Box,{ref:i,className:"table-format-preview",sx:{background:c?.fill,filter:f?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...m},...b,children:e.jsx(le.StaticBorderRenderer,{getBorderAt:w,rowCount:5,columnCount:5,forceThinBorder:d,width:5*(p-1)+1,height:5*(h-1)+1,darkMode:c?.darkMode??!1,style:{pointerEvents:"none"},children:e.jsx("table",{className:fe(s,"sheetxl-table-preview",Xr),style:{borderCollapse:"collapse",width:5*(p-1)+1,height:5*(h-1)+1},children:e.jsx("tbody",{children:x})})})})})),bt=(l,i,n,t,r)=>{l.beginPath(),l.moveTo(i+.5,n+.5),l.lineTo(t+.5,r+.5),l.stroke()},Zr=a.memo(a.forwardRef((l,i)=>{const{table:n,tableStyle:t,styles:r,bodyStyle:c,disabled:m,style:f,className:s,canvas:d,...h}=l,u=a.useMemo(()=>{const g=n.toJSON(),S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return g.styleOptions={...g.styleOptions,name:t.getName()},g.ref=S,new O.Table({initialAnchor:S,json:g,styles:r})},[n,t,r]),b=a.useMemo(()=>{const g=[];for(let S=0;S<5;S++)for(let C=0;C<5;C++){const y=u.getStyleAt({colIndex:C,rowIndex:S});g.push(y)}return g},[u]),p=a.useMemo(()=>{let g=d;if(d||(g=document.createElement("canvas")),!g)return null;g.width!==61&&(g.width=61),g.height!==46&&(g.height=46);const S=g.getContext("2d",{alpha:!1});if(!S)return null;const C=12,y=c?.darkMode??!1;for(let x=0;x<5;x++)for(let w=0;w<5;w++){const j=b[5*x+w].getFill();let T=c?.fill;j.getType()===O.IFill.Type.Solid?T=j.getColor().toCSS(y,!1):j.getType()===O.IFill.Type.Gradient?T=j.getStops[0]?.color.toCSS(y,!1):j.getType()===O.IFill.Type.Pattern&&(T=j.getForeground().toCSS(y,!1)),S.fillStyle=T;const E=w*C,I=9*x;S.fillRect(E,I,13,10)}S.lineWidth=1;for(let x=0;x<5;x++)for(let w=0;w<5;w++){const j=b[5*x+w],T=w*C,E=9*x,I=j.getBorder();if(!I.isEmpty()){const L=I.getLeft();L.isNone()||(S.strokeStyle=L.getColor().toCSS(y,!1),bt(S,T,E,T,E+9));const P=I.getTop();P.isNone()||(S.strokeStyle=P.getColor().toCSS(y,!1),bt(S,T,E,T+C,9*x));const v=I.getRight();v.isNone()||(S.strokeStyle=v.getColor().toCSS(y,!1),bt(S,T+C,E,T+C,E+9));const F=I.getBottom();F.isNone()||(S.strokeStyle=F.getColor().toCSS(y,!1),bt(S,T,E+9,T+C,E+9))}S.strokeStyle=j.getFont().getFill().toCSS(y,!1);const D=4,N=2.5;bt(S,w*C+N,9*x+D,w*C+N+7,9*x+D)}return`url(${g.toDataURL()})`},[d,u,t,c]);return e.jsx("div",{ref:i,className:fe("table-style-preview",s),style:{backgroundImage:p,width:61,height:46,...f},...h})})),Dl=a.memo(a.forwardRef((l,i)=>{const{styleOptions:n,onStyleOptionsChange:t,showHeaderRow:r,onShowHeaderRowChange:c,showTotalRow:m,onShowTotalRowChange:f,showFilterButton:s,onShowFilterButtonChange:d,sx:h,disabled:u,...b}=l;return e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:p=>`${p.spacing(2)}`,marginRight:p=>`${p.spacing(2)}`},"& .MuiCheckbox-root":{padding:p=>`${p.spacing(.5)}`},...h},...b,ref:i,children:[c&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>c(!r),disabled:u||r==null}),label:"Header Row",labelPlacement:"end"}),f&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:m??!1,indeterminate:m==null,onChange:()=>f(!m),disabled:u||m==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:u||!n,onChange:()=>{t?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:u||!n,onChange:()=>{t?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:u||!n,onChange:()=>{t?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:u||!n,onChange:()=>{t?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:s??!1,indeterminate:s==null,disabled:u||!n||s==null,onChange:()=>d(!s)}),label:"Filter Button",labelPlacement:"end"})]})})),Fl=a.memo(l=>{const{table:i,tableStyle:n,selectedTableStyleName:t,onSelectTableStyleName:r,styles:c,hasContextMenu:m=!0,bodyStyle:f,parentFloat:s,commands:d,disabled:h,commandHook:u,useCanvasPreview:b=!0,canvas:p,...g}=l,S=a.useCallback(w=>{const j={variant:k.CommandButtonType.Menuitem,commandHook:u,context:"table"},T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...j,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.CommandButton,{...j,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:h}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:h||!n||n.isBuiltIn()})]}),E=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:T})});return o.defaultCreatePopupPanel({...w,children:E})},[d]),C=n?.getName()===t,y=a.useMemo(()=>{const w={table:i,tableStyle:n,styles:c,bodyStyle:f};return b?e.jsx(Zr,{canvas:p,...w}):e.jsx(Yr,{...w})},[i,n,c,f]);let x=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:w=>`solid ${C?w.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:h,icon:null,onClick:()=>{r?.(n?.getName())},...g,children:y},n.getName());return m&&(x=e.jsx(o.ContextMenu,{label:i.getStyleOptions().name,parentFloat:s,createPopupPanel:S,children:x})),x}),Jr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,selectedTable:c,onSelectTableStyleName:m,disabled:f=!1,bodyStyle:s,usePreviewIcon:d=!1,...h}=l;k.useCommand(t);const u=t?.context(),b=u?.styles,p=c??u?.table?.();let g="insertTable";p&&(g="editTable");const S=a.useMemo(()=>((N,L)=>{const P={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new O.Table({initialAnchor:P,styles:L,json:{name:"PreviewTable",ref:P,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:N}})})(p?.getStyleOptions(),b?.()),[b?.().getDefaultTableStyle(),p?.getStyleOptions()]),C=p??S,[y,x]=a.useState(C);a.useEffect(()=>{x(C)},[C]);const w=s??u?.bodyStyle(),j=k.useCallbackRef(N=>{m?.(N),t?.execute({name:N},r)},[t,m,r]),T=a.useRef(null),E=a.useCallback((N,L)=>{const P={onSelectTableStyleName:j,styles:b(),parentFloat:N.floatReference};T.current||(T.current=document.createElement("canvas"));const v=q=>{const U=b().getTableStyle(q);return U?e.jsx(Fl,{table:y,tableStyle:U,selectedTableStyleName:y.getStyleOptions().name,bodyStyle:u.bodyStyle(),commands:L,commandHook:r,canvas:T.current,...P},q):null},F=(q,U,Q=!0)=>{const ee=[];for(let _=0;_<U.length;_++){const W=v(U[_]);W&&ee.push(W)}return ee.length===0?null:e.jsxs(B.Box,{children:[Q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:q},q+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:ee},q+"-presets")]},q)},H=[],A=b().getCustomTableStyles(),$=[];if(A.length>0){for(let q=0;q<A.length;q++)A[q].isShownInTableStyles()&&$.push(A[q].getName());H.push(F("Custom",$,!1))}const M=[];p&&!p.getStyleOptions().name&&M.push(null);for(let q=0;q<21;q++)M.push("TableStyleLight"+(q+1));H.push(F("Light",M,$.length>0));const R=[];for(let q=0;q<28;q++)R.push("TableStyleMedium"+(q+1));H.push(F("Medium",R));const K=[];for(let q=0;q<11;q++)K.push("TableStyleDark"+(q+1));H.push(F("Dark",K));let X=null;return p&&(X=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,command:L.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:f,icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))})]})),e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:q=>`${q.shape.borderRadius}px`,paddingBottom:q=>`${q.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:H}),X]})},[b,b?.().getTheme(),w,y]),I=f||!t||t.disabled(),D=a.useMemo(()=>{if(!u||!d)return o.themeIcon(e.jsx(o.PresetStylesIcon,{}))},[y,w,I]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:g,createPopupPanel:E,commands:n,label:t?.label(),commandState:p,commandHook:r,selected:p!==null,createTooltip:({children:N},L)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:L,children:N}),disabled:I,icon:D,...h})})),Ie=[];Ie.push(De("Primary Background","bg1")),Ie.push(De("Primary Text","tx1")),Ie.push(De("Secondary Background","bg2")),Ie.push(De("Secondary Text","tx2")),Ie.push(De("Accent 1","accent1")),Ie.push(De("Accent 2","accent2")),Ie.push(De("Accent 3","accent3")),Ie.push(De("Accent 4","accent4")),Ie.push(De("Accent 5","accent5")),Ie.push(De("Accent 6","accent6"));const Qr=l=>{const{docTheme:i,onSelectTheme:n,darkMode:t,isSelected:r,outlined:c,sx:m,...f}=l,s=G.useTheme(),d=a.useMemo(()=>{let h=[];for(let u=0;u<Ie.length;u++){const b=Ie[u];h.push(e.jsx(ao,{schemeColorLookup:i.schemeLookup(),colorDef:b,darkMode:t,selectedColor:null},u+"-colorDef"))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(B.Box,{sx:{display:"flex",boxShadow:u=>u.shadows[2]},children:h})})},[i,s]);return e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:h=>`solid ${r?h.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:h=>`solid ${h.palette.text.primary} 1px !important`}},icon:null,...f,children:e.jsxs(B.Box,{sx:{border:h=>`solid ${h.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:h=>r?h.palette.text.primary:void 0,"&:hover:not([disabled])":{color:h=>h.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:[d,e.jsx(B.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>i.getFontScheme().getMajorFont()},children:e.jsx(o.SimpleTooltip,{disableInteractive:!0,PopperProps:{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 O=require("@sheetxl/sdk"),e=require("react/jsx-runtime"),a=require("react"),B=require("@mui/material"),o=require("@sheetxl/utils-mui"),me=require("@mui/icons-material"),k=require("@sheetxl/utils-react"),G=require("@mui/material/styles"),le=require("@sheetxl/react"),Re=require("@mui/system"),Je=require("react-dom"),Fe=require("@sheetxl/utils"),it=require("@sheetxl/io");function kr(l){var i,n,t="";if(typeof l=="string"||typeof l=="number")t+=l;else if(typeof l=="object")if(Array.isArray(l)){var r=l.length;for(i=0;i<r;i++)l[i]&&(n=kr(l[i]))&&(t&&(t+=" "),t+=n)}else for(n in l)l[n]&&(t&&(t+=" "),t+=n);return t}function fe(){for(var l,i,n=0,t="",r=arguments.length;n<r;n++)(l=arguments[n])&&(i=kr(l))&&(t&&(t+=" "),t+=i);return t}const vr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...f}=l,s=k.useCommands(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),d=a.useMemo(()=>{for(let p=0;p<s.length;p++)if(s[p]?.state())return s[p].key();return s[0]?.key()},[s]),h=a.useMemo(()=>{const p=new Map;return p.set("formatAlignLeftToggle",o.themeIcon(e.jsx(me.FormatAlignLeft,{}))),p.set("formatAlignCenterToggle",o.themeIcon(e.jsx(me.FormatAlignCenter,{}))),p.set("formatAlignRightToggle",o.themeIcon(e.jsx(me.FormatAlignRight,{}))),p.set("formatAlignJustifyToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p.set("formatAlignCenterContinuousToggle",o.themeIcon(e.jsx(me.FormatAlignCenter,{}))),p.set("formatAlignFillToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p.set("formatAlignDistributedHorizontalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),p},[]),u=a.useMemo(()=>{if(!t)return null;const p={...t};return delete p.beforeExecute,p},[t]),b=a.useCallback((p,g)=>{const S={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},C=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignLeftToggle"),icon:h.get("formatAlignLeftToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignCenterToggle"),icon:h.get("formatAlignCenterToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignRightToggle"),icon:h.get("formatAlignRightToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignJustifyToggle"),icon:h.get("formatAlignJustifyToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignCenterContinuousToggle"),icon:h.get("formatAlignCenterContinuousToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignFillToggle"),icon:h.get("formatAlignFillToggle")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("formatAlignDistributedHorizontalToggle"),icon:h.get("formatAlignDistributedHorizontalToggle")})]}),y=e.jsxs(B.Box,{sx:{className:fe("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[e.jsx(o.CommandButton,{command:g.getCommand("formatIndentDecrease"),commandHook:u,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentDecreaseIcon,{}))}),e.jsx(o.CommandButton,{command:g.getCommand("formatIndentIncrease"),commandHook:u,scope:r,disabled:c,icon:o.themeIcon(e.jsx(o.FormatIndentIncreaseIcon,{}))})]}),x=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...f,children:[y,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})]});return o.defaultCreatePopupPanel({...p,children:x})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,commands:n,commandHook:t,scope:r,createPopupPanel:b,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:d,icon:h.get(d)??e.jsx(me.FormatAlignLeft,{}),...f})})),jr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),s=a.useMemo(()=>{for(let u=0;u<f.length;u++)if(f[u]?.state())return f[u].key();return f[0]?.key()},[f]),d=a.useMemo(()=>{const u=new Map;return u.set("formatAlignTopToggle",o.themeIcon(e.jsx(o.TextVerticalTopIcon,{}))),u.set("formatAlignMiddleToggle",o.themeIcon(e.jsx(o.TextVerticalCenterIcon,{}))),u.set("formatAlignBottomToggle",o.themeIcon(e.jsx(o.TextVerticalBottomIcon,{}))),u.set("formatAlignJustifyVerticalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u.set("formatAlignDistributedVerticalToggle",o.themeIcon(e.jsx(me.FormatAlignJustify,{}))),u},[]),h=a.useCallback((u,b)=>{const p={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},g=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignTopToggle"),icon:d.get("formatAlignTopToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignMiddleToggle"),icon:d.get("formatAlignMiddleToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignBottomToggle"),icon:d.get("formatAlignBottomToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignJustifyVerticalToggle"),icon:d.get("formatAlignJustifyVerticalToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatAlignDistributedVerticalToggle"),icon:d.get("formatAlignDistributedVerticalToggle")})]});return o.defaultCreatePopupPanel({...u,children:g})},[c,t,d]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:h,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:d.get(s)??o.themeIcon(e.jsx(o.TextVerticalBottomIcon,{})),...m})})),Tr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),s=a.useMemo(()=>{for(let u=0;u<f.length;u++)if(f[u]?.state())return f[u].key();return f[0]?.key()},[f]),d=a.useMemo(()=>{const u=new Map;return u.set("formatTextOverflowVisibleToggle",o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{}))),u.set("formatTextOverflowWrapToggle",o.themeIcon(e.jsx(o.TextHorizontalWrapIcon,{}))),u.set("formatTextOverflowClipToggle",o.themeIcon(e.jsx(o.TextHorizontalClipIcon,{}))),u.set("formatTextOverflowShrinkToggle",o.themeIcon(e.jsx(o.TextHorizontalShrinkIcon,{}))),u},[]),h=k.useCallbackRef((u,b)=>{const p={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},g=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:b.getCommand("formatTextOverflowVisibleToggle"),icon:d.get("formatTextOverflowVisibleToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatTextOverflowWrapToggle"),icon:d.get("formatTextOverflowWrapToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatTextOverflowClipToggle"),icon:d.get("formatTextOverflowClipToggle")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatTextOverflowShrinkToggle"),icon:d.get("formatTextOverflowShrinkToggle")})]});return o.defaultCreatePopupPanel({...u,children:g})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:h,icon:d.get(s)??o.themeIcon(e.jsx(o.TextHorizontalOverflowIcon,{})),...m})})),Br=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),s=a.useMemo(()=>{const b=f.length;for(let p=0;p<b;p++){const g=f[p];if(g?.state())return g.key()}return f[1]?.key()},[f]),d=a.useMemo(()=>{const b=new Map;return b.set("formatTextRotate0",o.themeIcon(e.jsx(o.TextRotation315Icon,{}))),b.set("formatTextRotate315",o.themeIcon(e.jsx(o.TextRotation315Icon,{}))),b.set("formatTextRotate45",o.themeIcon(e.jsx(o.TextRotation45Icon,{}))),b.set("formatTextRotate90",o.themeIcon(e.jsx(o.TextRotation90Icon,{}))),b.set("formatTextRotate270",o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))),b.set("formatTextRotateCustom",o.themeIcon(e.jsx(o.TextRotationCustomIcon,{}))),b},[]),h=a.useCallback((b,p)=>{const g={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},S=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate0"),icon:o.themeIcon(e.jsx(o.TextRotation0Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate315"),icon:o.themeIcon(e.jsx(o.TextRotation315Icon,{}))}),e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate45"),icon:o.themeIcon(e.jsx(o.TextRotation45Icon,{}))}),e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate90"),icon:o.themeIcon(e.jsx(o.TextRotation90Icon,{}))}),e.jsx(o.CommandButton,{...g,command:p.getCommand("formatTextRotate270"),icon:o.themeIcon(e.jsx(o.TextRotation2702Icon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.InputCommandButton,{...g,command:p.getCommand("formatTextRotateCustom"),icon:o.themeIcon(e.jsx(o.TextRotationCustomIcon,{})),label:"Custom"})]});return o.defaultCreatePopupPanel({...b,children:S})},[c,t,r,n]),u=a.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[f]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,selected:u,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:h,quickCommand:u?"formatTextRotate0":"formatTextRotate315",icon:o.themeIcon(d.get(s)??e.jsx(o.TextRotation315Icon,{})),...m})})),Er={Preset:"preset",Custom:"custom"},dt={Start:"start",End:"end"},bo={},jl=(l,i,n,t)=>{const r=l+"-"+i+"-"+n+(t?"-server":"");if(bo[r])return bo[r];const c=((m,f,s,d)=>{if(typeof document>"u"&&!d)return null;const h=d?new d:document.createElement("canvas");h.width=2*s,h.height=2*s;const u=h.getContext("2d");return u?(u.fillStyle=m,u.fillRect(0,0,h.width,h.height),u.fillStyle=f,u.fillRect(0,0,s,s),u.translate(s,s),u.fillRect(0,0,s,s),h.toDataURL()):null})(l,i,n,t);return bo[r]=c,c},Tl={},Ir=a.memo(l=>{const{className:i,style:n=k.ReactUtils.EmptyCssProperties,white:t="transparent",grey:r="grey",size:c=8,borderRadius:m,boxShadow:f,renderers:s=Tl,children:d,...h}=l,u=d,b=a.useMemo(()=>Object.assign({borderRadius:m,boxShadow:f,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${jl(t,r,c,s?.canvas)}) center left`},n),[t,r,c,s]);return a.isValidElement(d)?a.cloneElement(d,{...u.props}):e.jsx("div",{style:b,...h})}),Bl=a.memo(l=>{const{selectedColor:i,onSelectColor:n,onPreviewColor:t,onClick:r,onKeyDown:c,onMouseOver:m,onMouseLeave:f,onFocus:s,style:d=k.ReactUtils.EmptyCssProperties,children:h,alphaWhite:u,alphaGrey:b,darkMode:p,alphaCheckSize:g=7,...S}=l;if(!i)throw new Error("a selectedColor is required");const C=a.useCallback(E=>{r?.(E),E.isDefaultPrevented()||(E.ctrlKey?t?.(i.toRGBA()):n?.(i.toRGBA()))},[n,t,r,i]),y=a.useCallback(E=>{m?.(E),E.isDefaultPrevented()||t?.(i.toRGBA())},[t,m,i]),x=a.useCallback(E=>{f?.(E),E.isDefaultPrevented()},[t,f]),w=a.useCallback(E=>{s?.(E),E.isDefaultPrevented()||t?.(i.toRGBA())},[t,s,i]),j=a.useCallback(E=>{c?.(E),E.isDefaultPrevented()||E.keyCode===k.KeyCodes.Enter&&n?.(i.toRGBA())},[n,c,i]),T=a.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Ir,{size:g,white:u,grey:b,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[u,b,i]);return e.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...d},tabIndex:0,...S,onClick:C,onKeyDown:j,onMouseOver:y,onMouseLeave:x,onFocus:w,children:[T,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(p)},children:h})]})}),ao=a.memo(l=>{const{schemeColorLookup:i,selectedColor:n,previewColor:t,colorDef:r,onSelectColorDef:c,onPreviewColorDef:m,swatchProps:f,defaultButtonSize:s=24,isLarge:d=!1,compareRGB:h=!1,darkMode:u=!1,...b}=l,p=new O.Color({val:r.definition.val,adjs:r.definition.adjs},T=>i(T)),g=h?p.toRGBA().toString():p.toString(),S=n&&(h?n.toRGBA().toString():n.toString())===g,C=t&&(h?t.toRGBA().toString():t.toString())===g,y=[];y.push({[O.IColor.AdjustmentType.Inv]:!0}),y.push({[O.IColor.AdjustmentType.Alpha]:100});const x=p.adjust(y),w=a.useCallback(()=>{c?.(r)},[c,r]),j=a.useCallback(T=>{m?.(T?r:null)},[m,r]);return e.jsx(o.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:s*(d?1.2:1)+"px",height:s*(d?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...b,children:e.jsxs(Bl,{selectedColor:p,title:null,onSelectColor:w,onPreviewColor:j,alphaCheckSize:d?9:void 0,darkMode:u,...f,children:[e.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:x.toRGBA(u).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:S?"1":"0"}}),e.jsx("div",{style:{position:"absolute",width:.33*s*(d?1.2:1)+"px",height:.33*s*(d?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:x.toRGBA(u).toString(),borderRadius:"50%",opacity:C?"1":"0"}})]})})})}),Ht=a.memo(l=>{const{title:i,schemeColorLookup:n,colorDefs:t,selectedColor:r,previewColor:c,onSelectColorDef:m,onPreviewColorDef:f,style:s=k.ReactUtils.EmptyCssProperties,compareRGB:d=!1,darkMode:h,swatchProps:u,...b}=l;let p;if(Array.isArray(t[0]))p=t;else{p=[];for(let x=0;x<t.length;x++)p.push([t[x]])}const g=a.useCallback(x=>{m?.(x)},[m]),S=a.useCallback(x=>{f?.(x)},[f]),C=a.useMemo(()=>{let x=[];for(let w=0;w<p.length;w++){let j=[],T=p[w];for(let I=0;I<T.length;I++){let D=T[I];j.push(e.jsx(ao,{schemeColorLookup:n,colorDef:D,selectedColor:r,previewColor:c,onSelectColorDef:g,onPreviewColorDef:S,swatchProps:u,compareRGB:d,darkMode:h},w+" "+I))}let E=e.jsx(B.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:I=>I.shadows[2],borderRadius:"2px",overflow:"hidden"},children:j},""+w);x.push(E)}return x},[p,r,c,g,S]),y=a.useMemo(()=>i?e.jsx(B.Typography,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:x=>x.palette.text.secondary},children:i}):null,[i]);return e.jsxs(B.Box,{style:{...s},children:[y,e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...b,children:C})]})}),De=(l,i)=>({description:l,definition:{val:i,adjs:[]}}),ye=(l,i,n,t,r,c)=>{const m=De(l,i);t?.push(m);const f=new O.Color({val:m.definition.val,adjs:m.definition.adjs},n),s=f.toString();r?.set(s,f);const d=f.toRGBA().toString();c?.set(d,f)},El=a.lazy(()=>Promise.resolve().then(()=>require("./BTFMHzaEfycvibMu.cjs"))),Rr=a.memo(a.forwardRef((l,i)=>{const{selectedColor:n=null,previewColor:t=l.selectedColor??null,recentColors:r,schemeLookup:c,disableAlpha:m=!1,previewDebounceTime:f=100,initialPanelType:s,defaultButtonSize:d=24,width:h,onElementLoad:u,onDone:b,onEyeDropStart:p,onEyeDropStop:g,onPreviewColor:S,onPreviewColorImmediate:C,onSelectColor:y,autoColor:x,autoColorLabel:w="Automatic",autoColorPosition:j=dt.Start,compareRGB:T=!1,darkMode:E=!1,...I}=l,D=t||n,N=k.useCallbackRef(S,[S]),L=k.useCallbackRef(C,[C]),P=k.useCallbackRef(y,[y]),v=k.useCallbackRef(p,[p]),F=k.useCallbackRef(g,[g]),[H,A]=a.useState(!1),$=G.useTheme(),M=a.useMemo(()=>c||O.Color.getDefaultSchemeLookup(),[c]),R=a.useMemo(()=>{const z=new Map,J=new Map,ce=[];ye("Primary Background","bg1",M,ce,z,J),ye("Primary Text","tx1",M,ce,z,J),ye("Secondary Background","bg2",M,ce,z,J),ye("Secondary Text","tx2",M,ce,z,J),ye("Accent 1","accent1",M,ce,z,J),ye("Accent 2","accent2",M,ce,z,J),ye("Accent 3","accent3",M,ce,z,J),ye("Accent 4","accent4",M,ce,z,J),ye("Accent 5","accent5",M,ce,z,J),ye("Accent 6","accent6",M,ce,z,J);const re=O.ITheme.buildPalette(ce,M,z,J),ae=[];if(ye("Dark Red","C00000",M,ae,z,J),ye("Red","FF0000",M,ae,z,J),ye("Orange","FFC000",M,ae,z,J),ye("Yellow","FFFF00",M,ae,z,J),ye("Light Green","92D050",M,ae,z,J),ye("Green","00B050",M,ae,z,J),ye("Light Blue","00B0F0",M,ae,z,J),ye("Blue","0070C0",M,ae,z,J),ye("Dark Blue","002060",M,ae,z,J),m?ye("Purple Is A Fruit","7030A0",M,ae,z,J):ye("Transparent","00000000",M,ae,z,J),x){const ie=x.toString();z.set(ie,x)}const Z=new Map,te=typeof r=="function"?r():r,ue=[];for(let ie=0;te&&ie<te.length;ie++){const je=te[ie].toString();Z.set(je,te[ie]),ue.push({description:"Recent "+(ie+1),definition:{val:te[ie].toString()}})}return{primaryColors:ce,modifiedPresets:re,standardColors:ae,recentColorsLimited:ue,mapAllPresets:z,mapAllPresetsRGB:J,mapRecent:Z}},[M,r,m,x]);a.useEffect(()=>{u?.()},[]);const[K,X]=a.useState(!1),q=a.useCallback(()=>{X(z=>!z)},[]);a.useEffect(()=>{if(s)X(s===Er.Custom);else if(n){let z=n.toString(),J=R.mapAllPresets.get(z);J||(z=n.toRGBA().toString(),J=R.mapAllPresetsRGB.get(z));const ce=R.mapRecent.get(z);X(!J&&!ce)}},[n,s]);const U=a.useCallback(O.CommonUtils.debounce(z=>{N?.(z)},f),[N,f]),[Q,ee]=a.useState();a.useEffect(()=>{ee(t||n)},[t,n]);const _=k.useCallbackRef(z=>{L&&(L(z),U(z))},[L]),W=k.useCallbackRef(z=>{_(z?new O.Color({val:z.definition.val,adjs:z.definition.adjs},M):null)},[M]),Y=a.useCallback(z=>{z.ctrlKey&&X(!0)},[]),ne=k.useCallbackRef(z=>{let J=!1;if(z){const ce=z.toString();J=!R.mapAllPresets.has(ce)}P?.(z,J)},[P,R]),be=k.useCallbackRef(z=>{const J=z?new O.Color({val:z.definition.val,adjs:z.definition.adjs},M):null;Promise.resolve(b?.()).then(()=>{ne(J)})},[M,b]),ge=k.useCallbackRef(z=>{_(z?new O.Color(z,M):null)},[M]),xe=a.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(B.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:z=>z.palette.text.icon??z.palette.action.active},onClick:async()=>{A(!0),v?.(),await new EyeDropper().open().then(z=>{A(!1),F?.();let J=new O.Color(z.sRGBHex),ce=J.toString(),re=R.mapAllPresets.get(ce);if(re||(ce=J.toRGBA().toString(),re=R.mapAllPresetsRGB.get(ce)),!re){const ae=J.toRGBA(),Z=3;let te=255;R.mapAllPresetsRGB.forEach((ue,ie)=>{const je=ue.toRGBA(),Me=Math.abs(je.red-ae.red)+Math.abs(je.blue-ae.blue)+Math.abs(je.green-ae.green);Me<Z&&Me<te&&(re=ue)})}X(!re),_(re||J)}).catch(z=>{A(!1),z?.name!=="AbortError"&&console.error(z)})},children:e.jsx(me.Colorize,{})}),[R,E]),Ee=a.useMemo(()=>{if(!K)return;const z={opacity:K?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return e.jsx(a.Suspense,{fallback:e.jsx("div",{style:z,children:e.jsx(o.LoadingPanel,{})}),children:e.jsx(El,{style:z,selectedColor:D?D.toRGBA().toString():"transparent",onColorChange:ge,disableAlpha:m})})},[K,D]),se=a.useMemo(()=>({onClick:Y,alphaGrey:$.palette.text.icon??$.palette.action.active}),[Y,$]),Se=a.useMemo(()=>{if(!x)return null;const z={description:w,definition:{val:x.getVal(),adjs:x.getAdjustments()}};return e.jsx(e.Fragment,{children:e.jsxs(B.MenuItem,{sx:{display:"flex",color:J=>J.palette.text.secondary},onMouseOver:()=>{W(null)},onClick:()=>{be(null)},children:[e.jsx(B.Box,{sx:{flex:"none",boxShadow:J=>J.shadows[2],borderRadius:J=>J.spacing(.5),overflow:"hidden"},children:e.jsx(ao,{schemeColorLookup:M,colorDef:z,selectedColor:n===null?x:n,previewColor:t===null?x:t,defaultButtonSize:d,isLarge:!0,darkMode:E,compareRGB:T,swatchProps:se})}),e.jsx(B.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:w})]})})},[x,w,M,n,t]);return e.jsxs(B.Box,{ref:i,sx:{width:h,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...I,children:[e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("div",{style:{opacity:K?"0":1},children:[Se&&j===dt.Start?e.jsxs(e.Fragment,{children:[Se,e.jsx(B.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Ht,{title:"Theme Colors",schemeColorLookup:M,colorDefs:R.primaryColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:E}),e.jsx(Ht,{schemeColorLookup:M,colorDefs:R.modifiedPresets,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:E}),e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Standard Colors",schemeColorLookup:M,colorDefs:R.standardColors,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:E}),e.jsxs("div",{style:{opacity:R.recentColorsLimited.length===0?"0":void 0,display:R.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(B.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Ht,{title:"Recent Colors",schemeColorLookup:M,colorDefs:R.recentColorsLimited,selectedColor:n,previewColor:t===void 0?n:t,swatchProps:se,onPreviewColorDef:W,onSelectColorDef:be,compareRGB:T,darkMode:E})]}),Se&&j===dt.End?e.jsxs(e.Fragment,{children:[e.jsx(B.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),Se,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Ee]}),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:[xe,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:()=>{q()},children:K?e.jsx("div",{children:"Preset"}):e.jsx("div",{children:"Custom"})}),e.jsx(B.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(b?.()).then(()=>{ne(Q)})},children:"Done"})]})]})})),Il=e.jsx(o.ColorizedCircleIcon,{}),Ho=a.memo(a.forwardRef((l,i)=>{const{selectedColor:n,quickColor:t,icon:r=Il,tooltip:c,label:m,onPreviewColor:f,onPreviewColorImmediate:s,onSelectColor:d,variant:h=o.PopupButtonType.Toolbar,panelProps:u,shouldCloseFloatAll:b=!0,compareRGB:p=!1,darkMode:g=!1,...S}=l,C=k.useCallbackRef(f,[f]),y=k.useCallbackRef(s,[s]),x=k.useCallbackRef(d,[d]),[w,j]=a.useState(()=>{}),T=t||w||n||u?.autoColor,E=a.useRef(!1),I=a.useCallback(()=>{},[]),D=k.useCallbackRef(()=>{j(n)},[n]),N=k.useCallbackRef(R=>{E.current||(j(R),C?.(R))},[C]),L=k.useCallbackRef(R=>{E.current||(j(R),y?.(R))},[y]),P=k.useCallbackRef((R,K)=>{E.current||(j(void 0),x?.(R,K))},[x]),v=a.useMemo(()=>e.jsx(B.Box,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${T?.toCSS(g)??"transparent"}`,"& .activeColor":{fill:`${T?.toCSS(g)??"transparent"}`},"& .style_grey":{fill:R=>R.palette.text.icon??R.palette.action.active}},children:typeof r=="function"?r():r}),[T,r,g]),F=k.useCallbackRef(R=>{x?.(t,!1)},[x,t]),[H,A]=a.useState(!1),$=a.useCallback(R=>{const{closeFloat:K,closeFloatAll:X}=R;return e.jsx(Rr,{...u,selectedColor:n,previewColor:w,onDone:b?X:K,onKeyDown:q=>{q.which===k.KeyCodes.Enter&&(b?X():K())},onPreviewColorImmediate:L,onPreviewColor:N,onSelectColor:P,onEyeDropStart:()=>A(!0),onEyeDropStop:()=>A(!1),compareRGB:p,darkMode:g})},[n,w,b,T,u?.autoColor,g]),M={onQuickClick:t?F:void 0,createPopupPanel:$,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:D,onPopupClose:I,tooltip:c||m||"Color",label:m,icon:v,...S};return h===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...M}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...M})})),Qt=82,Do=l=>{const{styleColor:i,length:n=Qt,width:t=1,dashArray:r=null,sx:c,isDouble:m=!1,isAngled:f=!1,darkMode:s=!1,...d}=l;return e.jsx(B.SvgIcon,{sx:{width:`${n}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:h=>`${i?i.toRGBA(s).toString():h.palette.text.icon??h.palette.action.active}`},"& .style_grey":{stroke:h=>h.palette.text.icon??h.palette.action.active},...c},height:t,width:n,viewBox:`0 0 ${n} ${t}`,...d,children:e.jsx(le.StyledStrokePath,{length:n,width:t,dashArray:r,isDouble:m,isAngled:f,className:"activeColor"})})},Mr=a.memo(a.forwardRef((l,i)=>{const{variant:n,showLabels:t=!1,disabled:r=!1,createPopupPanel:c,styleColor:m,selectedStyle:f,onSelectStyle:s,showNone:d=!0,darkMode:h,sx:u,...b}=l,p=k.useCallbackRef(s,[]),g=a.useCallback(x=>{const{popupContainer:w,floatReference:j,closeFloat:T,...E}=x,I=[],D=O.IBorder.BuiltInDefinitionsArray;for(let N=0;N<D.length;N++){const L=D[N];if(L.description==="None"&&!d)continue;const P=e.jsx(Do,{styleColor:m,length:Qt,width:L.width,darkMode:h,dashArray:L.pattern,isDouble:L.description.toLowerCase().includes("double"),isAngled:L.description.toLowerCase().includes("slant")});let v=null;v=t?e.jsxs(e.Fragment,{children:[e.jsx(B.Box,{sx:{marginRight:"6px"},children:L.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%"}}),P]})]}):L.description==="None"?"None":P,I.push(e.jsx(o.ExhibitMenuItem,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:o.createStrokeShadowFilter(4)},paddingLeft:"16px",background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},tooltipProps:{description:t?"":L.description},icon:null,disabled:r,onMouseDown:F=>F.preventDefault(),onMouseUp:()=>{T(),p(L.style)},onKeyDown:F=>{F.which===k.KeyCodes.Enter&&T()},selected:L.style===f,parentFloat:j,children:v},N))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:I})},[r,d,m,f,h]),S=a.useMemo(()=>{const x=O.IBorder.BuiltInDefinitions.get(f);let w;return w=x.description==="None"?e.jsx(B.Box,{sx:{minWidth:`${Qt}px`},children:"None"}):e.jsx(Do,{styleColor:m,length:Qt,width:x.width,dashArray:x.pattern,darkMode:h,isDouble:x.description.toLowerCase().includes("double"),isAngled:x.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:o.createStrokeShadowFilter()}},children:w})},[f,m]),C=a.useMemo(()=>O.IBorder.BuiltInDefinitions.get(f),[f]),y={disabled:r,icon:S,tooltip:"Border Style: "+C.description,sx:{background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`,...u},createPopupPanel:g,...b};return n===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{...y}):e.jsx(o.ExhibitPopupMenuItem,{...y})})),Pr=a.memo(a.forwardRef((l,i)=>{const{autoColor:n=null,schemeLookup:t,autoStrokeStyle:r=O.IBorder.StrokeStyle.Thin,disabled:c=!1,darkMode:m=!1,showStylingBefore:f=!0,onSelectBorder:s,onPreviewBorder:d,selectedBorder:h,createTemporaryBorder:u,...b}=l,p=k.useCallbackRef(s,[s]),g=k.useCallbackRef(d,[d]),[S,C]=a.useState(),[y,x]=a.useState(),w=S??r,j=y??n,T=h||{bottom:{style:r,color:n?.toString()}},E=k.useCallbackRef(v=>{const F={},H=v?Object.keys(v):[];let A=!1;for(let Q=0;Q<H.length;Q++)v[H[Q]]?.style&&(F[H[Q]]={style:v[H[Q]].style,color:v[H[Q]].color},A||F[H[Q]].style===O.IBorder.StrokeStyle.None||(A=!0));H.length<6&&(A=!0);const $=A?F.left:null,M=A?F.top:null,R=A?F.right:null,K=A?F.bottom:null,X=A?F.vertical:null,q=A?F.horizontal:null;let U="";return M||$||(U+="M 3,5 H 5 V 3 H 3 "),M||(U+="M 7,5 H 9 V 3 H 7 "),M||X||(U+="M 11,5 h 2 V 3 h -2 "),M||(U+="M 15,5 h 2 V 3 h -2 "),M||R||(U+="M 19,5 h 2 V 3 h -2 "),$||(U+="M 3,9 H 5 V 7 H 3 "),X||(U+="M 11,9 h 2 V 7 h -2 "),R||(U+="M 19,9 h 2 V 7 h -2 "),q||$||(U+="M 3,13 H 5 V 11 H 3 "),q||(U+="M 7,13 H 9 V 11 H 7 "),q||X||(U+="M 11,13 h 2 v -2 h -2 "),q||R||(U+="M 19,13 h 2 v -2 h -2 "),q||(U+="M 15,13 h 2 v -2 h -2 "),$||(U+="M 3,17 H 5 V 15 H 3 "),X||(U+="M 11,17 h 2 v -2 h -2 "),R||(U+="M 19,17 h 2 v -2 h -2 "),K||$||(U+="M 3,21 H 5 V 19 H 3 "),K||(U+="M 7,21 H 9 V 19 H 7 "),K||X||(U+="M 11,21 h 2 v -2 h -2 "),K||(U+="M 15,21 h 2 v -2 h -2 "),K||R||(U+="M 19,21 h 2 v -2 h -2 "),e.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[e.jsx(B.SvgIcon,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:e.jsx("path",{d:U})}),e.jsx(B.Box,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:o.strokeShadowFilter}},children:e.jsx(le.StaticBorderRenderer,{getBorderAt:(Q,ee)=>{if(!u||H.length===0)return null;const _=Q.rowIndex,W=Q.colIndex,Y={};return _===0?(Y.top=F.top,Y.bottom=F.horizontal):(Y.top=F.horizontal,Y.bottom=F.bottom),W===0?(Y.left=F.left,Y.right=F.vertical):(Y.left=F.vertical,Y.right=F.right),u?.(Y)},width:18,height:18,darkMode:m,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[j,w,m]),I=a.useCallback((v,F,H)=>{let A=null;if(v&&v.length>0){let $=null;(F||H)&&($={style:H,color:F?.toString()??null}),A={};for(let M=0;M<v.length;M++)A[v[M]]=$}return A},[]),D=a.useCallback(v=>{p?.(v)},[]),N=a.useCallback(v=>{g?.(v)},[]),L=a.useCallback(v=>{const{closeFloatAll:F,floatReference:H}=v,A=(R,K,X="bottom",q=!1)=>{const U=I(R,j??null,q?O.IBorder.StrokeStyle.None:w??null),Q=q?I([],j??null,w??null):U;return e.jsx(o.ExhibitIconButton,{icon:E(Q),sx:{background:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},tooltipProps:{label:K,simple:!0,placement:X},onClick:()=>{F(),N(U),D(U)}})},$=e.jsxs(e.Fragment,{children:[e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom,O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical],"All Borders","top"),A([O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical],"Inner Borders","top"),A([O.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),A([O.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom],"Outside Borders","top")]}),e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[A([O.IBorder.Edge.Left],"Left Borders"),A([O.IBorder.Edge.Top],"Top Borders"),A([O.IBorder.Edge.Right],"Right Borders"),A([O.IBorder.Edge.Bottom],"Bottom Borders"),A([O.IBorder.Edge.Left,O.IBorder.Edge.Top,O.IBorder.Edge.Right,O.IBorder.Edge.Bottom,O.IBorder.Edge.Horizontal,O.IBorder.Edge.Vertical,O.IBorder.Edge.DiagonalUp,O.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),M=e.jsx(e.Fragment,{children:e.jsxs(B.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[e.jsx(Ho,{variant:o.PopupButtonType.Toolbar,icon:e.jsx(o.ColorizedStrokeIcon,{}),selectedColor:w===O.IBorder.StrokeStyle.None?new O.Color("transparent"):j,onPreviewColor:R=>{x(R)},onSelectColor:(R,K)=>{x(R)},darkMode:m,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:t},disabled:c||w===O.IBorder.StrokeStyle.None,parentFloat:H,shouldCloseFloatAll:!1}),e.jsx(Mr,{selectedStyle:w,onSelectStyle:C,styleColor:j,darkMode:m,variant:o.PopupButtonType.Toolbar,parentFloat:H})]})});return e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:R=>R.stopPropagation(),children:[f?M:$,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),f?$:M]})},[w,j,n,t,m]),P=a.useMemo(()=>E(T),[T,m]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,createPopupPanel:L,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:v},F)=>e.jsx(o.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:F,children:v}),onQuickClick:()=>{p?.(T)},quickButtonProps:{sx:{}},disabled:c,icon:P,...b})})),Dr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,variant:c=k.CommandButtonType.Toolbar,disabled:m=!1,autoColor:f,autoStrokeStyle:s,schemeLookup:d,createTemporaryBorder:h,selectedBorder:u,onSelectBorder:b,darkMode:p,icon:g,label:S,...C}=l,y=k.useCommands(n,["formatBorder"]),x=t??y[0],w=x?.context()??null,j=w?.autoColor??f,T=w?.autoStyle??s,E=u??w?.quickBorder,I=p??w?.darkMode,D=h??w?.createTemporaryBorder,N=d??w?.schemeLookup,L=k.useCallbackRef(v=>{w?.onBorderSelect&&w.onBorderSelect(v),b?.(v),x?.execute(v,r)},[x,b,r]),P=a.useCallback((v,F)=>{const{children:H,title:A,...$}=v;let M=v.children;return(x?.disabled()||m)&&(M=e.jsx("div",{children:M})),e.jsx(o.CommandTooltip,{command:x,placement:c===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:F,...$,children:M})},[x,m]);return e.jsx(Pr,{ref:i,autoColor:j,darkMode:I,autoStrokeStyle:T,createTemporaryBorder:D,schemeLookup:N,selectedBorder:E,onSelectBorder:L,createTooltip:P,disabled:m||!x||x.disabled(),...C})})),Fr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeToggle"),icon:o.themeIcon(e.jsx(o.MergeAllIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeHorizontal"),icon:o.themeIcon(e.jsx(o.MergeHorizontalIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("mergeVertical"),icon:o.themeIcon(e.jsx(o.MergeVerticalIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:d.getCommand("unmerge"),icon:o.themeIcon(e.jsx(o.MergeUnMergeIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,quickCommand:"mergeToggle",commandHook:t,scope:r,tooltip:"Combine or split cells.",createPopupPanel:f,icon:o.themeIcon(e.jsx(o.MergeAllIcon,{})),...m})})),Nr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggle"),icon:o.themeIcon(e.jsx(o.FreezeBothIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggleHorizontal"),icon:o.themeIcon(e.jsx(o.FreezeRowsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("freezeToggleVertical"),icon:o.themeIcon(e.jsx(o.FreezeColumnsIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:d.getCommand("unfreeze"),icon:e.jsx(o.MergeUnMergeIcon,{})})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:f,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:e.jsx(o.FreezeIcon,{}),...m})})),Ar=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("find"),icon:o.themeIcon(e.jsx(o.FindIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("findReplace"),icon:o.themeIcon(e.jsx(o.FindReplaceIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("goto"),icon:o.themeIcon(e.jsx(o.GotoIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,createPopupPanel:f,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:o.themeIcon(e.jsx(o.FindIcon,{})),...m})})),Or=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,showQuickButtons:r=!!l.commands,commands:c,fontSizes:m=le.FontUtils.DefaultFontSizes,disabled:f=!1,parentFloat:s,icon:d,label:h,sx:u,...b}=l;k.useCommand(n);const p=()=>n?.state()?.toString()||"11",[g,S]=a.useState(p),C=k.useCallbackRef(()=>{const D=parseFloat(g);isNaN(D)?S(p()):parseFloat(p())!==D&&n.execute(D,t)},[p,n,g,t]);a.useEffect(()=>{S(p())},[n?.state()]);const y=a.useMemo(()=>{if(!t)return null;const D={...t};return delete D.beforeExecute,D},[t]),x=k.useCommands(c,["formatFontSizeIncrease","formatFontSizeDecrease"]),w=a.useMemo(()=>x?e.jsxs(B.Box,{className:fe("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:D=>D.stopPropagation(),children:[e.jsx(o.CommandButton,{command:x[0],commandHook:y,icon:o.themeIcon(e.jsx(o.TextSizeIncreaseIcon,{}))}),e.jsx(o.CommandButton,{command:x[1],icon:o.themeIcon(e.jsx(o.TextSizeDecreaseIcon,{}))})]}):null,[x]),j=G.useTheme(),T=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("12.3",Math.round(j.typography.fontSize),j.typography.fontFamily).width}px`,[j]),E=a.useCallback(D=>{const{onMouseDown:N,onMouseUp:L,...P}=D;return e.jsx(B.IconButton,{component:"div",...P,disableRipple:!0,children:e.jsx(B.Input,{inputMode:"numeric",disabled:f||!n||n.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:v=>`1px solid ${v.palette.text.icon??v.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:v=>`1px solid ${v.palette.error.main}`},"::after":{borderBottom:v=>`1px solid ${v.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:v=>`${Math.round(v.typography.fontSize)}px`,width:T,color:v=>v.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:v=>v.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:g,onFocus:v=>{v.target?.select()},onKeyDown:v=>{if(v.which===k.KeyCodes.Enter)p()!==g&&(v.stopPropagation(),v.preventDefault(),C());else if(v.which===k.KeyCodes.Escape)p()!==g&&(S(p()),setTimeout(()=>{v.target?.select()},0),v.stopPropagation(),v.preventDefault());else{if(v.key.match("[-]")||v.key.match("[0-9.]")&&(g+v.key).length>4)return v.stopPropagation(),void v.preventDefault();if(v.which===k.KeyCodes.Space)return void v.preventDefault()}},onBlur:()=>{C()},onChange:v=>{if(v.target.value.length>4)return v.stopPropagation(),void v.preventDefault();S(v.target.value)}})})},[g,f,n]),I=a.useCallback(D=>{const N=F=>{n?.execute(F,t)},L=n?.state(),P=[];for(let F=0;F<m.length;F++){const H=m[F]===L;P.push(e.jsx(o.ExhibitMenuItem,{selected:H,icon:H?e.jsx(o.SelectedIcon,{}):void 0,disabled:f||!n||n.disabled(),onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&N(m[F])},onKeyDown:A=>{A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(m[F])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:m[F]})},"fontSize-"+F))}const v=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...b,children:[w,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:P})]});return o.defaultCreatePopupPanel({...D,children:v})},[f,n?.state(),t]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...u},tabIndex:-1,outlined:!0,disabled:f,parentFloat:s,createPopupPanel:I,createTooltip:({children:D},N)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:N||n?.disabled(),children:D}),createQuickButton:E,...b})})),Pn=a.memo(l=>{const{selected:i,disabled:n,formattedValue:t,handleSetFormat:r,format:c,sx:m,...f}=l;return e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...m},disabled:n,selected:i,icon:i?e.jsx(o.SelectedIcon,{}):void 0,onMouseDown:s=>{s.button===0&&s.preventDefault()},onMouseUp:s=>{s.button===0&&r(c.numberFormat)},onKeyDown:s=>{s.keyCode!==k.KeyCodes.Enter&&s.keyCode!==k.KeyCodes.Space||r(c.numberFormat)},...f,children:e.jsxs(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(B.Typography,{component:"div",children:[c.formatType,c.formatType===O.NumberFormat.Type.Custom?"…":""]}),e.jsx(B.Typography,{variant:"caption",component:"div",sx:{color:s=>Re.alpha(s.palette.text.primary,.6),paddingTop:t&&t.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:t&&t.length>0?t:" "})]})})}),Lr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,sx:c,disabled:m=!1,parentFloat:f,...s}=l,d=k.useCommands(n,["formatNumberFormat"])[0],h=d?.state()?O.NumberFormat.Styles.lookupStyle(d?.state()).formatType:O.NumberFormat.Type.General,u=a.useMemo(()=>{if(!t)return null;const S={...t};return delete S.beforeExecute,S},[t]),b=a.useCallback((S,C)=>{const y=L=>{t?.beforeExecute?.(d,d?.state()),d.execute(L,t),t?.onExecute?.(d,d?.state())},x=d?.context()(),w=O.NumberFormat.Styles.lookupPrimary(),j=[];for(let L=0;L<w.length;L++){let P="";if(x&&!x.isEmpty())try{P=x.getNumberFormat(w[L].numberFormat).displayText}catch(F){console.warn(F)}P===""&&w[L].formatType===O.NumberFormat.Type.General&&(P="No specific format");const v=w[L].formatType===h;j.push(e.jsx(Pn,{selected:v,disabled:m||!d||d.disabled(),formattedValue:P,handleSetFormat:y,format:w[L]},w[L].formatType))}const T={numberFormat:"",formatType:O.NumberFormat.Type.Custom},E=h===O.NumberFormat.Type.Custom,I=e.jsx(Pn,{selected:E,disabled:m||!d||d.disabled(),formattedValue:E?x.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(d,d?.state()),C.getCommand("formatNumberDialog")?.execute(d?.state()),t?.onExecute?.(d,d?.state())},format:T,sx:{flex:"0",width:"100%"}},O.NumberFormat.Type.Custom),D=e.jsxs(B.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:L=>L.stopPropagation(),children:[e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatAccountingStyle"),commandHook:u,scope:r,icon:e.jsx(o.CurrencyDollarIcon,{})}),e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatPercentStyle"),commandHook:u,scope:r,icon:e.jsx(o.PercentIcon,{})}),e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatCommaStyle"),commandHook:u,scope:r,icon:e.jsx(o.CommaIcon,{})}),e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:u,scope:r,icon:o.themeIcon(e.jsx(o.IncreaseDecimalIcon2,{}))}),e.jsx(o.CommandButton,{command:C.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:u,scope:r,icon:o.themeIcon(e.jsx(o.DecreaseDecimalIcon2,{}))})]}),N=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...s,children:[D,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),I]});return o.defaultCreatePopupPanel({...S,children:N})},[d?.context(),d?.state(),t,r]),p=G.useTheme(),g=a.useMemo(()=>{const S=O.NumberFormat.Type.MediumTime;return`${O.IFont.getSharedMeasurer()(S,Math.round(p.typography.fontSize),p.typography.fontFamily).width}px`},[p]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,sx:c,outlined:!0,disabled:m,parentFloat:f,createPopupPanel:b,createTooltip:({children:S},C)=>e.jsx(o.ExhibitTooltip,{label:d?.label(),description:d?.description(),disabled:C,children:S}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:S=>`${Math.round(S.typography.fontSize)}px`,color:S=>S.palette.text.secondary,fontFamily:S=>S.typography.fontFamily,width:g},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:h})}),...s})})),zo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"clear",disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("clearAll"),icon:e.jsx(o.ClearAllIcon,{})}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearFormats"),icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearContents"),icon:o.themeIcon(e.jsx(o.ClearContentsIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearComments")}),e.jsx(o.CommandButton,{...h,command:d.getCommand("clearHyperlinks")})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:f,icon:e.jsx(o.ClearAllIcon,{}),...m})})),Hr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"fill",disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("fillDown"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillRight"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(270deg)"}}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillUp"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(180deg)"}}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("fillLeft"),icon:o.themeIcon(e.jsx(o.FillDownIcon,{sx:{transform:"rotate(90deg)"}}))})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:f,icon:o.themeIcon(e.jsx(o.FillDownIcon,{})),...m})})),Wo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,disableSheet:m=!1,preferSingleMenu:f=!0,showQuickButton:s=!0,variant:d=k.CommandButtonType.Toolbar,...h}=l,u=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],b=k.useCommands(n,u),{singleCommand:p,allDisabled:g}=a.useMemo(()=>{let y=null,x=0;for(let w=0;w<b.length;w++)b[w]&&!b[w]?.disabled()&&(f&&d===k.CommandButtonType.Menuitem&&(y=x===0?b[w]:null),x++);return{singleCommand:y,allDisabled:x===0}},[b]),S=a.useMemo(()=>{const y=new Map;return y.set("insertCellsShiftDown",o.themeIcon(e.jsx(o.InsertCells,{}))),y.set("insertCellsShiftRight",o.themeIcon(e.jsx(o.InsertCells,{sx:{transform:"rotate(270deg)"}}))),y.set("insertRows",o.themeIcon(e.jsx(o.InsertRowIcon,{}))),y.set("insertColumns",o.themeIcon(e.jsx(o.InsertColumn2Icon,{}))),y},[]),C=a.useCallback((y,x)=>{let w=null;const j={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"insertCells",disabled:c};m||(w=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:x.getCommand("addSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...j,command:b[0],icon:S.get(u[0])}),e.jsx(o.CommandButton,{...j,command:b[1],icon:S.get(u[1])}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:b[2],icon:S.get(u[2])}),e.jsx(o.CommandButton,{...j,command:b[3],icon:S.get(u[3])}),w]});return o.defaultCreatePopupPanel({...y,children:T})},[c,b,t,r,S]);return p?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:p,icon:S.get(p.key()),...h}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"insertCells",commands:n,commandHook:t,scope:r,disabled:c||g,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:C,icon:o.themeIcon(e.jsx(o.InsertColumn2Icon,{})),...h})})),Vo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,disableSheet:m=!1,preferSingleMenu:f=!0,showQuickButton:s=!0,variant:d=k.CommandButtonType.Toolbar,...h}=l,u=k.useCommands(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:b,allDisabled:p}=a.useMemo(()=>{let C=null,y=0;for(let x=0;x<u.length;x++)u[x]&&!u[x]?.disabled()&&(f&&d===k.CommandButtonType.Menuitem&&(C=y===0?u[x]:null),y++);return{singleCommand:C,allDisabled:y===0}},[u]),g=a.useMemo(()=>{const C=new Map;return C.set("deleteCellsShiftUp",o.themeIcon(e.jsx(o.RemoveCellsIcon,{sx:{transform:"rotate(0deg)"}}))),C.set("deleteCellsShiftLeft",o.themeIcon(e.jsx(o.RemoveCellsIcon,{sx:{transform:"rotate(270deg)"}}))),C.set("deleteRows",o.themeIcon(e.jsx(o.RemoveRowIcon,{}))),C.set("deleteColumns",o.themeIcon(e.jsx(o.RemoveColumn2Icon,{}))),C},[]),S=a.useCallback((C,y)=>{const x={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"deleteCells",disabled:c};let w=null;m||(w=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteSheet"),icon:o.themeIcon(e.jsx(o.BlankIcon,{}))})]}));const j=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteCellsShiftUp"),icon:g.get("deleteCellsShiftUp")}),e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteCellsShiftLeft"),icon:g.get("deleteCellsShiftLeft")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteRows"),icon:g.get("deleteRows")}),e.jsx(o.CommandButton,{...x,command:y.getCommand("deleteColumns"),icon:g.get("deleteColumns")}),w]});return o.defaultCreatePopupPanel({...C,children:j})},[c,t,r,g]);return b?e.jsx(o.CommandButton,{ref:i,variant:d,commandHook:t,disabled:c,command:b,icon:g.get(b.key()),...h}):e.jsx(o.CommandPopupButton,{ref:i,variant:d,quickCommand:"deleteCells",commands:n,commandHook:t,scope:r,disabled:c||p,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:S,icon:o.themeIcon(e.jsx(o.RemoveColumn2Icon,{})),...h})})),ut=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,onSelectColor:r,disabled:c=!1,variant:m=k.CommandButtonType.Toolbar,quickColor:f,panelProps:s,isSplit:d=!1,darkMode:h,icon:u,...b}=l,{autoColor:p,schemeLookup:g,recentColors:S,...C}=s;if(b.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");k.useCommand(n);const y=n?.context();let x=f??y?.quickColor;d&&!x&&(x=new O.Color("transparent"));const w=p??y?.autoColor,j=g??y?.schemeLookup,T=S??y?.recentColors,E=h??y?.darkMode,I=a.useMemo(()=>({autoColor:w,schemeLookup:j,recentColors:T,darkMode:E,...C}),[w,j,T,E]),D=k.useCallbackRef((L,P)=>{L&&P&&y?.addRecentColor&&y.addRecentColor(L),y?.onColorSelect&&y.onColorSelect(L),r?.(L,P),n?.execute(L,t)},[n,r,t,y]),N=a.useCallback((L,P)=>{const{children:v,title:F,...H}=L;let A=L.children;return(n?.disabled()||c)&&(A=e.jsx("div",{children:A})),e.jsx(o.CommandTooltip,{command:n,placement:m===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:P,...H,children:A})},[n,c]);return e.jsx(Ho,{ref:i,panelProps:I,icon:u,quickColor:x,selectedColor:n?.state(),onSelectColor:D,variant:m===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:N,label:n?.label(),disabled:c||!n||n.disabled(),compareRGB:!0,darkMode:E,...b})}));ut.displayName="ColorCommandButton";const zr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...f}=l,s=k.useCommands(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),d=a.useCallback((h,u)=>{const b={variant:k.CommandButtonType.Menuitem,parentFloat:h.floatReference,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...b,command:u.getCommand("gridlinesToggle")}),e.jsx(ut,{...b,command:u.getCommand("sheetViewFormatGridlinesColor"),icon:e.jsx(o.ColorizedStrokeIcon,{}),panelProps:{disableAlpha:!0}}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleGridlinesColumns")}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleGridlinesRows")})]});return o.defaultCreatePopupPanel({...h,children:p})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,quickCommand:s[0]?.key(),commands:n,commandHook:t,createPopupPanel:d,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:e.jsx(o.LabelIcon,{command:s[0],scope:"view"}),...f})})),$o=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},u=d.getCommand("sortCustom"),b=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:d.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...h,command:d.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),u?e.jsx(o.CommandButton,{...h,command:u,icon:o.themeIcon(e.jsx(o.SortCustomIcon,{}))}):null,e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:o.themeIcon(e.jsx(o.FilterReapplyIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:b})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,disabled:c,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:f,icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{})),...m})})),Rl=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=a.useCallback((s,d)=>{const h={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),e.jsx(o.CommandButton,{...h,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:o.themeIcon(e.jsx(o.FilterReapplyIcon,{}))})]});return o.defaultCreatePopupPanel({...s,children:u})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,commandHook:t,scope:r,disabled:c,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:f,icon:o.themeIcon(e.jsx(o.FilterToggleIcon,{})),...m})})),Uo=a.memo(a.forwardRef((l,i)=>{const{quickCommand:n,icon:t,isRedo:r=!1,nestRedo:c=!0,undoManager:m,scope:f,sx:s,disabled:d,commands:h,...u}=l,b=[n];!r&&c&&b.push("redo");const p=k.useCommands(h,b),g=p[0],S=p[1],C=m??g?.context?.()?.undoManager;let y=d;d||(y=!g||g.disabled(),S&&!S.disabled()&&(y=!1));const[x,w]=a.useState(0),j=a.useCallback((T,E)=>{let I=x===0?"Cancel":`${g.label()} ${x} Action${x===1?"":"s"}`,D=!1;C||(D=!0),D||(D=c?!C.hasRedo()&&!C.hasUndo():!C.hasRedo());const N=A=>{g.execute(A)},L=e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:D?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{w(0)},onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&N(x)},onKeyDown:A=>{A.isDefaultPrevented()||A.keyCode!==k.KeyCodes.Enter&&A.keyCode!==k.KeyCodes.Space||N(x)},children:e.jsx(B.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:I})});if(D)return L;const P=r?C?.getRedoDescriptions():C?.getUndoDescriptions(),v=[];for(let A=0;A<P.length;A++){const $=P[A];v.push(e.jsx(o.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex"},icon:e.jsx(o.BlankIcon,{}),disabled:y,selected:A<x,onMouseEnter:()=>{w(A+1)},onMouseDown:M=>{M.button===0&&M.preventDefault()},onMouseUp:M=>{M.button===0&&N(A+1)},onKeyDown:M=>{M.isDefaultPrevented()||M.keyCode!==k.KeyCodes.Enter&&M.keyCode!==k.KeyCodes.Space||N(A+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:$}),e.jsx(o.BlankIcon,{})]})},`action:${A}`))}let F=null;if(!r&&c){const A={scope:"undo",commands:E,variant:k.CommandButtonType.Menuitem,parentFloat:T.floatReference};F=[],F.push(e.jsx(Uo,{...A,quickCommand:"redo",isRedo:!0},"nested:redo")),C.hasRedo()&&C.hasUndo()&&F.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const H=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{T.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[F,e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),L]});return o.defaultCreatePopupPanel({...T,children:H})},[g?.context(),g?.state(),f,C,x,y]);return e.jsx(o.CommandPopupButton,{ref:i,commands:h,quickCommand:n,scope:f,disabled:y,label:g?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${g?.label()??"No"} last actions.`})}),createPopupPanel:j,icon:t??o.themeIcon(r?e.jsx(o.RedoIcon,{}):e.jsx(o.UndoIcon,{})),selected:!1,...u})})),mt=O.IFontCollection.getFontList(),Wr=new Map;for(let l=0;l<mt.length;l++)Wr.set(mt[l].fontRef.getFamily(),mt[l]);const Vr=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,sx:r,disabled:c=!1,parentFloat:m,icon:f,label:s,...d}=l;k.useCommand(n);const h=n?.state(),u=G.useTheme(),b=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("Times New Roman",Math.round(u.typography.fontSize),u.typography.fontFamily).width}px`,[u]),p=a.useCallback(g=>{const S=w=>{n?.execute(w,t)},C=[];for(let w=0;w<mt.length;w++)C.push({key:mt[w].fontRef.getFamily(),description:mt[w].fontRef.getFamily()});Wr.get(h)||C.unshift({key:h,description:h});const y=[];for(let w=0;w<C.length;w++){const j=C[w].key===h;y.push(e.jsx(o.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:j,disabled:c||!n||n.disabled(),icon:j?e.jsx(o.SelectedIcon,{}):void 0,onMouseUp:T=>{T.button===0&&S(C[w].key)},onMouseDown:T=>{T.button===0&&T.preventDefault()},onKeyDown:T=>{T.keyCode!==k.KeyCodes.Enter&&T.keyCode!==k.KeyCodes.Space||S(C[w].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:()=>C[w]?.key},children:C[w].description})})},w+""+C[w].key))}const x=e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})});return o.defaultCreatePopupPanel({...g,children:x})},[c,n?.state()]);return e.jsx(o.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:c,parentFloat:m,createPopupPanel:p,createTooltip:({children:g},S)=>e.jsx(o.ExhibitTooltip,{label:n?.label(),description:n?.description(),disabled:S,children:g}),icon:e.jsx(B.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:g=>`${Math.round(g.typography.fontSize)}px`,fontFamily:g=>g.typography.fontFamily,color:g=>g.palette.text.secondary,width:b},children:e.jsx(B.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:h})}),...d})})),$r=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),s=a.useMemo(()=>{for(let u=0;u<f.length;u++)if(f[u]?.state())return f[u].key();return f[0]?.key()},[f]),d=a.useMemo(()=>{const u=new Map;return u.set("formatStrikeThroughToggle",o.themeIcon(e.jsx(o.TextStrikeIcon,{}))),u.set("formatSuperscriptToggle",o.themeIcon(e.jsx(o.TextSuperscriptIcon,{}))),u.set("formatSubscriptToggle",o.themeIcon(e.jsx(o.TextSubscriptIcon,{}))),u},[]),h=a.useCallback((u,b)=>{const p={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:c},g=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:b.getCommand("formatStrikeThroughToggle"),icon:d.get("formatStrikeThroughToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatSuperscriptToggle"),icon:d.get("formatSuperscriptToggle")}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatSubscriptToggle"),icon:d.get("formatSubscriptToggle")})]});return o.defaultCreatePopupPanel({...u,children:g})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,createPopupPanel:h,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:d.get(s)??o.themeIcon(e.jsx(o.TextStrikeIcon,{})),...m})})),Ur=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),s=a.useMemo(()=>{for(let u=0;u<f.length;u++)if(f[u]?.state())return f[u].key();return f[0]?.key()},[f]),d=a.useMemo(()=>{const u=new Map;return u.set("formatUnderlinedToggle",o.themeIcon(e.jsx(o.TextUnderlineIcon,{}))),u.set("formatUnderlinedDoubleToggle",o.themeIcon(e.jsx(o.TextUnderlineDoubleIcon,{}))),u.set("formatUnderlinedAccountingToggle",o.themeIcon(e.jsx(o.TextUnderlineAccountingIcon,{}))),u.set("formatUnderlinedAccountingDoubleToggle",o.themeIcon(e.jsx(o.TextUnderlineAccountingDoubleIcon,{}))),u},[]),h=a.useCallback((u,b)=>{const p={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:c},g=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...p,command:b.getCommand("formatUnderlinedToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineIcon,{}))}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatUnderlinedDoubleToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineDoubleIcon,{}))}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatUnderlinedAccountingToggle"),commandHook:t,icon:o.themeIcon(e.jsx(o.TextUnderlineAccountingIcon,{}))}),e.jsx(o.CommandButton,{...p,command:b.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:o.themeIcon(e.jsx(o.TextUnderlineAccountingDoubleIcon,{}))})]});return o.defaultCreatePopupPanel({...u,children:g})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:s,commands:n,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:h,icon:d.get(s)??o.themeIcon(e.jsx(o.TextUnderlineIcon,{})),...m})})),_o=a.memo(a.forwardRef((l,i)=>{const{command:n,commands:t,commandHook:r,scope:c,includePasteAllInPopup:m=!0,disabled:f=!1,...s}=l,d=k.useCallbackRef((h,u)=>{const b={variant:k.CommandButtonType.Menuitem,commandHook:r,scope:"paste",disabled:f},p=[];return m&&(p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("paste"),key:"paste",icon:e.jsx(o.PasteIcon,{})})),p.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},"paste-div"))),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteValues"),key:"pasteValues",icon:o.themeIcon(e.jsx(o.PasteValuesIcon,{}))})),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteFormats"),key:"pasteFormats",icon:o.themeIcon(e.jsx(o.PasteFormatsIcon,{}))})),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteFormulas"),key:"pasteFormulas",icon:o.themeIcon(e.jsx(o.PasteFormulasIcon,{}))})),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteTranspose"),key:"pasteTranspose",icon:o.themeIcon(e.jsx(o.PasteTransposeIcon,{}))})),p.push(a.createElement(o.CommandButton,{...b,command:u.getCommand("pasteLinks"),key:"pasteLinks",icon:o.themeIcon(e.jsx(o.PasteLinksIcon,{}))})),o.defaultCreatePopupPanel({...h,children:p})},[f,r,c,m]);return e.jsx(o.CommandPopupButton,{ref:i,commands:t,commandHook:r,scope:c,createPopupPanel:d,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:e.jsx(o.PasteIcon,{}),...s})})),_r=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,parentFloat:m,...f}=l,s=k.useCommands(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),d=a.useCallback((h,u)=>{const b={variant:k.CommandButtonType.Menuitem,parentFloat:h.floatReference,commandHook:t,scope:r,disabled:c},p=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleShowHeadings")}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleShowHeadingsNumeric")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleShowHeadingColumns")}),e.jsx(o.CommandButton,{...b,command:u.getCommand("sheetViewToggleShowHeadingRows")})]});return o.defaultCreatePopupPanel({...h,children:p})},[c,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,parentFloat:m,quickCommand:s[0]?.key(),commands:n,commandHook:t,createPopupPanel:d,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:e.jsx(o.LabelIcon,{command:s[0],scope:"view"}),...f})})),qr=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r="view",disabled:c=!1,...m}=l,f=a.useCallback(s=>{const d={variant:k.CommandButtonType.Menuitem,parentFloat:s.floatReference,commandHook:t,scope:r,disabled:c},h=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowFormulaBar")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowTabs")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowStatusBar")}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),e.jsx(o.CommandButton,{...d,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return o.defaultCreatePopupPanel({...s,children:h})},[c,n,t,r]);return e.jsx(o.CommandPopupButton,{ref:i,commands:n,disabled:c,commandHook:t,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:f,icon:e.jsx(o.LabelIcon,{icon:null,label:"Workbook View"}),...m})})),Kr=a.memo(a.forwardRef((l,i)=>{const{value:n,cellStyle:t,styles:r,createTemporaryCell:c,bodyStyle:m,sx:f,borderProps:s,disabled:d,...h}=l,u=a.useMemo(()=>c({value:n,style:t}),[n,t,c]),b=a.useMemo(()=>u.getStyle(),[u,m]),p=a.useMemo(()=>b.getFill().toCSS(m?.darkMode??!1),[b]),g=b.getInsets(),S=b.getFont(),C=a.useCallback(()=>b.getBorder(),[b]);return e.jsx(B.Box,{ref:i,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:m?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...p},"& .text":{flex:"1 1 100%",...S.toCSS(m?.darkMode??!1,1),boxSizing:"border-box",padding:`${g.top}px ${g.right}px ${g.bottom}px ${g.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:S.toCSS().textDecoration,textAlign:O.ITextFrame.toCSSHorizontalTextAlign(u.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...f},...h,children:e.jsx(le.StaticBorderRenderer,{getBorderAt:C,darkMode:m?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...s?.style},...s,children:e.jsx(B.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:e.jsx(B.Box,{className:"text",children:n})})})})})),Ml=a.memo(l=>{const{styles:i,namedStyle:n,selectedNamed:t,hasContextMenu:r=!0,bodyStyle:c,onSelectNamed:m,createTemporaryCell:f,parentFloat:s,commands:d,disabled:h,commandHook:u,...b}=l,p=a.useCallback(C=>{const y={variant:k.CommandButtonType.Menuitem,commandHook:u,context:"cellStyle"},x=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...y,sx:{fontWeight:550},command:d.getCommand("formatCellStyle"),commandState:n,disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...y,command:d.getCommand("modifyCellStyle"),commandState:{named:n}}),e.jsx(o.CommandButton,{...y,command:d.getCommand("deleteCellStyle"),commandState:n,disabled:h||n?.getName()===O.IStyle.BuiltInName.Normal})]}),w=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:x})});return o.defaultCreatePopupPanel({...C,children:w})},[]),g=n?.getName()===t?.getName();let S=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:C=>`solid ${g?C.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:h,icon:null,onClick:()=>{m?.(n)},...b,children:e.jsx(Kr,{value:n.getName(),cellStyle:{named:n.getName()},styles:i,createTemporaryCell:f,bodyStyle:c})},n.getName());return r&&(S=e.jsx(o.ContextMenu,{label:n.getName(),parentFloat:s,createPopupPanel:p,children:S})),S}),Gr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,selectedNamed:c,onSelectNamed:m,disabled:f=!1,bodyStyle:s,usePreviewIcon:d=!0,...h}=l;k.useCommand(t);const u=t?.context(),b=u?.styles,p=c??u?.named(),g=s??u?.bodyStyle(),S=k.useCallbackRef(j=>{m?.(j),t?.execute(j,r)},[t,m,r]),C=a.useCallback((j,T)=>{const E={onSelectNamed:S,styles:b(),parentFloat:j.floatReference},I=b().getCustomNamed(),D=new Map,N=[];for(let M=0;M<I.length;M++)D.set(I[M].getName(),I[M]),b().getNamed(I[M].getName()).getBuiltInID()===null&&N.push(I[M].getName());const L=M=>{let R=D.get(M);return R||(R=b().getNamed(M)),!R||R.isHidden()?null:e.jsx(Ml,{namedStyle:R,selectedNamed:p,bodyStyle:u.bodyStyle(),createTemporaryCell:u.createTemporaryCell,commands:n,commandHook:r,...E},M)},P=(M,R,K=!0)=>{const X=[];for(let q=0;q<R.length;q++){const U=L(R[q]);U&&X.push(U)}return X.length===0?null:e.jsxs(B.Box,{children:[K?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:M},M+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:X},M+"-presets")]},M)},v=(M,R)=>{const K=[];for(let X=0;X<R.length;X++){const q=L(R[X]);q&&K.push(q)}return K.length===0?null:e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:K},M+"-presets")},F=[];F.push(P("Custom",N,!1)),F.push(P("Good, Bad and Neutral",[O.IStyle.BuiltInName.Normal,O.IStyle.BuiltInName.Bad,O.IStyle.BuiltInName.Good,O.IStyle.BuiltInName.Neutral],N.length>0)),F.push(P("Data and Model",[O.IStyle.BuiltInName.Calculation,O.IStyle.BuiltInName.CheckCell,O.IStyle.BuiltInName.ExplanatoryText,O.IStyle.BuiltInName.FollowedHyperlink,O.IStyle.BuiltInName.Hyperlink,O.IStyle.BuiltInName.Input,O.IStyle.BuiltInName.LinkedCell,O.IStyle.BuiltInName.Note,O.IStyle.BuiltInName.Output,O.IStyle.BuiltInName.WarningText])),F.push(P("Titles and Headings",[O.IStyle.BuiltInName.Heading1,O.IStyle.BuiltInName.Heading2,O.IStyle.BuiltInName.Heading3,O.IStyle.BuiltInName.Heading4,O.IStyle.BuiltInName.Title,O.IStyle.BuiltInName.Total]));let H=[];var A,$;return H.push(v("Accent 1",[O.IStyle.BuiltInName.Accent1_20,O.IStyle.BuiltInName.Accent1_40,O.IStyle.BuiltInName.Accent1_60,O.IStyle.BuiltInName.Accent1])),H.push(v("Accent 2",[O.IStyle.BuiltInName.Accent2_20,O.IStyle.BuiltInName.Accent2_40,O.IStyle.BuiltInName.Accent2_60,O.IStyle.BuiltInName.Accent2])),H.push(v("Accent 3",[O.IStyle.BuiltInName.Accent3_20,O.IStyle.BuiltInName.Accent3_40,O.IStyle.BuiltInName.Accent3_60,O.IStyle.BuiltInName.Accent3])),H.push(v("Accent 4",[O.IStyle.BuiltInName.Accent4_20,O.IStyle.BuiltInName.Accent4_40,O.IStyle.BuiltInName.Accent4_60,O.IStyle.BuiltInName.Accent4])),H.push(v("Accent 5",[O.IStyle.BuiltInName.Accent5_20,O.IStyle.BuiltInName.Accent5_40,O.IStyle.BuiltInName.Accent5_60,O.IStyle.BuiltInName.Accent5])),H.push(v("Accent 6",[O.IStyle.BuiltInName.Accent6_20,O.IStyle.BuiltInName.Accent6_40,O.IStyle.BuiltInName.Accent6_60,O.IStyle.BuiltInName.Accent6])),F.push((A="Themed Cell Styles",$=H,e.jsxs(B.Box,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.ExhibitMenuHeader,{children:A},A+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:$},A+"-presets")]},A))),F.push(P("Number Format",[O.IStyle.BuiltInName.Comma,O.IStyle.BuiltInName.Comma0,O.IStyle.BuiltInName.Currency,O.IStyle.BuiltInName.Currency0,O.IStyle.BuiltInName.Percent])),e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:M=>`${M.shape.borderRadius}px`,paddingBottom:M=>`${M.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:F}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,commandState:p,command:T.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:f,icon:o.themeIcon(e.jsx(o.NewPresetStylesIcon,{}))})]})},[p,b?.().getTheme(),g]),y=k.useCallbackRef(j=>{const T=18/O.IFont.getDeviceScale(),E=u?.createTemporaryCell(j);return E.getStyle().getFont().getSize()<=T?E:E.createTemporaryCell({style:{font:{size:T}}})},[u?.createTemporaryCell]),x=f||!t||t.disabled(),w=a.useMemo(()=>u&&d?e.jsx(Kr,{value:p?.getName()??"Custom",cellStyle:p?{named:p.getName()}:void 0,styles:u.styles(),createTemporaryCell:y,bodyStyle:u.bodyStyle(),className:"outline-hover",disabled:x,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:j=>`1px solid ${j.palette.action.hover}`},borderProps:{}}):o.themeIcon(e.jsx(o.PresetStylesIcon,{})),[p,g,x]);return e.jsx(o.CommandPopupButton,{ref:i,createPopupPanel:C,outlined:d,commands:n,createTooltip:({children:j},T)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:T,children:j}),selected:!1,disabled:x,label:t?.label(),icon:w,...h})})),Xr="_sheetxl-reset_ods65_1",Pl=10,Yr=a.memo(a.forwardRef((l,i)=>{const{styles:n,table:t,tableStyle:r=t?.getStyle()??n.getDefaultTableStyle(),bodyStyle:c,sx:m,disabled:f,className:s,forceThinBorder:d,cellHeight:h=Pl,isLive:u=!1,...b}=l,p=Math.ceil(1.3*h),[g,S]=a.useReducer(j=>j+1,0);a.useEffect(()=>{if(u&&t)return t.addListeners({onAnyChange:()=>{S()}})},[t,u]);const C=a.useMemo(()=>{let j=t?.toJSON()??{};const T={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return j&&(j.styleOptions={...j.styleOptions,name:r.getName()}),j.ref=T,new O.Table({initialAnchor:T,json:j,styles:n})},[g,t,r,n]),y=a.useMemo(()=>{const j=[];for(let T=0;T<5;T++)for(let E=0;E<5;E++){const I=C.getStyleAt({colIndex:E,rowIndex:T});j.push(I)}return j},[C]),x=a.useMemo(()=>{const j=(E,I,D)=>{let N=D.getFill().toCSS(c?.darkMode??!1);const L=p-(I<4?1:0),P=h-(E<4?1:0),v=D.getFont().getFill().toCSS(c?.darkMode??!1);return N={...N,position:"absolute",boxSizing:"border-box",left:I*(p-1),top:E*(h-1),width:L,height:P},e.jsx("td",{className:`table-style-fill ${E}-${I}`,style:N,children:e.jsx("div",{className:`table-style-text ${E}-${I}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(L-6)/2,top:(P-1)/2,borderTop:`1px solid ${v}`}})},`${E}-${I}`)},T=[];for(let E=0;E<5;E++){const I=[];for(let D=0;D<5;D++){const N=y[5*E+D];I.push(j(E,D,N))}T.push(e.jsx("tr",{children:I},E))}return T},[C,r,c]),w=a.useCallback((j,T)=>y[T].getBorder()??null,[y]);return e.jsx(B.Box,{ref:i,className:"table-format-preview",sx:{background:c?.fill,filter:f?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...m},...b,children:e.jsx(le.StaticBorderRenderer,{getBorderAt:w,rowCount:5,columnCount:5,forceThinBorder:d,width:5*(p-1)+1,height:5*(h-1)+1,darkMode:c?.darkMode??!1,style:{pointerEvents:"none"},children:e.jsx("table",{className:fe(s,"sheetxl-table-preview",Xr),style:{borderCollapse:"collapse",width:5*(p-1)+1,height:5*(h-1)+1},children:e.jsx("tbody",{children:x})})})})})),bt=(l,i,n,t,r)=>{l.beginPath(),l.moveTo(i+.5,n+.5),l.lineTo(t+.5,r+.5),l.stroke()},Zr=a.memo(a.forwardRef((l,i)=>{const{table:n,tableStyle:t,styles:r,bodyStyle:c,disabled:m,style:f,className:s,canvas:d,...h}=l,u=a.useMemo(()=>{const g=n.toJSON(),S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return g.styleOptions={...g.styleOptions,name:t.getName()},g.ref=S,new O.Table({initialAnchor:S,json:g,styles:r})},[n,t,r]),b=a.useMemo(()=>{const g=[];for(let S=0;S<5;S++)for(let C=0;C<5;C++){const y=u.getStyleAt({colIndex:C,rowIndex:S});g.push(y)}return g},[u]),p=a.useMemo(()=>{let g=d;if(d||(g=document.createElement("canvas")),!g)return null;g.width!==61&&(g.width=61),g.height!==46&&(g.height=46);const S=g.getContext("2d",{alpha:!1});if(!S)return null;const C=12,y=c?.darkMode??!1;for(let x=0;x<5;x++)for(let w=0;w<5;w++){const j=b[5*x+w].getFill();let T=c?.fill;j.getType()===O.IFill.Type.Solid?T=j.getColor().toCSS(y,!1):j.getType()===O.IFill.Type.Gradient?T=j.getStops[0]?.color.toCSS(y,!1):j.getType()===O.IFill.Type.Pattern&&(T=j.getForeground().toCSS(y,!1)),S.fillStyle=T;const E=w*C,I=9*x;S.fillRect(E,I,13,10)}S.lineWidth=1;for(let x=0;x<5;x++)for(let w=0;w<5;w++){const j=b[5*x+w],T=w*C,E=9*x,I=j.getBorder();if(!I.isEmpty()){const L=I.getLeft();L.isNone()||(S.strokeStyle=L.getColor().toCSS(y,!1),bt(S,T,E,T,E+9));const P=I.getTop();P.isNone()||(S.strokeStyle=P.getColor().toCSS(y,!1),bt(S,T,E,T+C,9*x));const v=I.getRight();v.isNone()||(S.strokeStyle=v.getColor().toCSS(y,!1),bt(S,T+C,E,T+C,E+9));const F=I.getBottom();F.isNone()||(S.strokeStyle=F.getColor().toCSS(y,!1),bt(S,T,E+9,T+C,E+9))}S.strokeStyle=j.getFont().getFill().toCSS(y,!1);const D=4,N=2.5;bt(S,w*C+N,9*x+D,w*C+N+7,9*x+D)}return`url(${g.toDataURL()})`},[d,u,t,c]);return e.jsx("div",{ref:i,className:fe("table-style-preview",s),style:{backgroundImage:p,width:61,height:46,...f},...h})})),Dl=a.memo(a.forwardRef((l,i)=>{const{styleOptions:n,onStyleOptionsChange:t,showHeaderRow:r,onShowHeaderRowChange:c,showTotalRow:m,onShowTotalRowChange:f,showFilterButton:s,onShowFilterButtonChange:d,sx:h,disabled:u,...b}=l;return e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:p=>`${p.spacing(2)}`,marginRight:p=>`${p.spacing(2)}`},"& .MuiCheckbox-root":{padding:p=>`${p.spacing(.5)}`},...h},...b,ref:i,children:[c&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>c(!r),disabled:u||r==null}),label:"Header Row",labelPlacement:"end"}),f&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:m??!1,indeterminate:m==null,onChange:()=>f(!m),disabled:u||m==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:u||!n,onChange:()=>{t?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:u||!n,onChange:()=>{t?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:u||!n,onChange:()=>{t?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:u||!n,onChange:()=>{t?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&e.jsx(B.FormControlLabel,{control:e.jsx(B.Checkbox,{checked:s??!1,indeterminate:s==null,disabled:u||!n||s==null,onChange:()=>d(!s)}),label:"Filter Button",labelPlacement:"end"})]})})),Fl=a.memo(l=>{const{table:i,tableStyle:n,selectedTableStyleName:t,onSelectTableStyleName:r,styles:c,hasContextMenu:m=!0,bodyStyle:f,parentFloat:s,commands:d,disabled:h,commandHook:u,useCanvasPreview:b=!0,canvas:p,...g}=l,S=a.useCallback(w=>{const j={variant:k.CommandButtonType.Menuitem,commandHook:u,context:"table"},T=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...j,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.CommandButton,{...j,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:h,icon:o.themeIcon(e.jsx(o.PresetStylesIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:h}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...j,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:h||!n||n.isBuiltIn()})]}),E=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:T})});return o.defaultCreatePopupPanel({...w,children:E})},[d]),C=n?.getName()===t,y=a.useMemo(()=>{const w={table:i,tableStyle:n,styles:c,bodyStyle:f};return b?e.jsx(Zr,{canvas:p,...w}):e.jsx(Yr,{...w})},[i,n,c,f]);let x=e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:w=>`solid ${C?w.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:h,icon:null,onClick:()=>{r?.(n?.getName())},...g,children:y},n.getName());return m&&(x=e.jsx(o.ContextMenu,{label:i.getStyleOptions().name,parentFloat:s,createPopupPanel:S,children:x})),x}),Jr=a.memo(a.forwardRef((l,i)=>{const{commands:n,command:t,commandHook:r,selectedTable:c,onSelectTableStyleName:m,disabled:f=!1,bodyStyle:s,usePreviewIcon:d=!1,...h}=l;k.useCommand(t);const u=t?.context(),b=u?.styles,p=c??u?.table?.();let g="insertTable";p&&(g="editTable");const S=a.useMemo(()=>((N,L)=>{const P={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new O.Table({initialAnchor:P,styles:L,json:{name:"PreviewTable",ref:P,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:N}})})(p?.getStyleOptions(),b?.()),[b?.().getDefaultTableStyle(),p?.getStyleOptions()]),C=p??S,[y,x]=a.useState(C);a.useEffect(()=>{x(C)},[C]);const w=s??u?.bodyStyle(),j=k.useCallbackRef(N=>{m?.(N),t?.execute({name:N},r)},[t,m,r]),T=a.useRef(null),E=a.useCallback((N,L)=>{const P={onSelectTableStyleName:j,styles:b(),parentFloat:N.floatReference};T.current||(T.current=document.createElement("canvas"));const v=q=>{const U=b().getTableStyle(q);return U?e.jsx(Fl,{table:y,tableStyle:U,selectedTableStyleName:y.getStyleOptions().name,bodyStyle:u.bodyStyle(),commands:L,commandHook:r,canvas:T.current,...P},q):null},F=(q,U,Q=!0)=>{const ee=[];for(let _=0;_<U.length;_++){const W=v(U[_]);W&&ee.push(W)}return ee.length===0?null:e.jsxs(B.Box,{children:[Q?e.jsx(o.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(o.ExhibitMenuHeader,{children:q},q+"-header"),e.jsx(B.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:ee},q+"-presets")]},q)},H=[],A=b().getCustomTableStyles(),$=[];if(A.length>0){for(let q=0;q<A.length;q++)A[q].isShownInTableStyles()&&$.push(A[q].getName());H.push(F("Custom",$,!1))}const M=[];p&&!p.getStyleOptions().name&&M.push(null);for(let q=0;q<21;q++)M.push("TableStyleLight"+(q+1));H.push(F("Light",M,$.length>0));const R=[];for(let q=0;q<28;q++)R.push("TableStyleMedium"+(q+1));H.push(F("Medium",R));const K=[];for(let q=0;q<11;q++)K.push("TableStyleDark"+(q+1));H.push(F("Dark",K));let X=null;return p&&(X=e.jsxs(e.Fragment,{children:[e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{variant:k.CommandButtonType.Menuitem,command:L.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:f,icon:o.themeIcon(e.jsx(o.ClearFormatsIcon,{}))})]})),e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:q=>`${q.shape.borderRadius}px`,paddingBottom:q=>`${q.shape.borderRadius}px`},children:[e.jsx(B.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:H}),X]})},[b,b?.().getTheme(),w,y]),I=f||!t||t.disabled(),D=a.useMemo(()=>{if(!u||!d)return o.themeIcon(e.jsx(o.PresetStylesIcon,{}))},[y,w,I]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:g,createPopupPanel:E,commands:n,label:t?.label(),commandState:p,commandHook:r,selected:p!==null,createTooltip:({children:N},L)=>e.jsx(o.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:L,children:N}),disabled:I,icon:D,...h})})),Ie=[];Ie.push(De("Primary Background","bg1")),Ie.push(De("Primary Text","tx1")),Ie.push(De("Secondary Background","bg2")),Ie.push(De("Secondary Text","tx2")),Ie.push(De("Accent 1","accent1")),Ie.push(De("Accent 2","accent2")),Ie.push(De("Accent 3","accent3")),Ie.push(De("Accent 4","accent4")),Ie.push(De("Accent 5","accent5")),Ie.push(De("Accent 6","accent6"));const Qr=l=>{const{docTheme:i,onSelectTheme:n,darkMode:t,isSelected:r,outlined:c,sx:m,...f}=l,s=G.useTheme(),d=a.useMemo(()=>{let h=[];for(let u=0;u<Ie.length;u++){const b=Ie[u];h.push(e.jsx(ao,{schemeColorLookup:i.schemeLookup(),colorDef:b,darkMode:t,selectedColor:null},u+"-colorDef"))}return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(B.Box,{sx:{display:"flex",boxShadow:u=>u.shadows[2]},children:h})})},[i,s]);return e.jsx(o.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:h=>`solid ${r?h.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:h=>`solid ${h.palette.text.primary} 1px !important`}},icon:null,...f,children:e.jsxs(B.Box,{sx:{border:h=>`solid ${h.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:h=>r?h.palette.text.primary:void 0,"&:hover:not([disabled])":{color:h=>h.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:[d,e.jsx(B.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>i.getFontScheme().getMajorFont()},children:e.jsx(o.SimpleTooltip,{disableInteractive:!0,PopperProps:{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()})})})]})]})})},ea=a.memo(a.forwardRef((l,i)=>{const{themes:n,selectedTheme:t,onSelectTheme:r,sx:c,disabled:m=!1,darkMode:f,...s}=l,d=a.useMemo(()=>{const h=n?.getItems({selected:t})??[],u=[];if(h.length===0)return e.jsx(o.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"6px",paddingBottom:"6px"},children:"No themes"});const b=h.length;for(let p=0;p<b;p++){const g=h[p],S=t&&g?.getName()===t.getName(),C=h[p+1];C&&C.isCustom()!==g.isCustom()&&u.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal",sx:{marginBottom:"4px"}},`divider-${p}`)),u.push(e.jsx(Qr,{docTheme:g,onSelectTheme:()=>r(g),isSelected:S,disabled:m,darkMode:f,onMouseDown:y=>{y.button===0&&y.preventDefault()},onMouseUp:y=>{y.button===0&&r(g)},onKeyDown:y=>{y.keyCode!==k.KeyCodes.Enter&&y.keyCode!==k.KeyCodes.Space||r(g)}},g.getName()))}return u},[t,r,f]);return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:i,...s,children:e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsx(o.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"2px"},children:"Themes"}),e.jsx(o.ExhibitDivider,{}),e.jsx(B.Box,{sx:{flex:"1 1 100%",overflow:"auto",padding:"6px 16px"},children:d})]})})})),ta=a.memo(a.forwardRef((l,i)=>{const{themes:n,selectedTheme:t,onSelectTheme:r,icon:c,tooltip:m,label:f,variant:s=o.PopupButtonType.Toolbar,darkMode:d,panelProps:h,...u}=l,b=c||o.themeIcon(e.jsx(o.Theme2Icon,{})),p=a.useCallback(S=>{const{closeFloatAll:C}=S;return e.jsx(ea,{...h,themes:n,selectedTheme:t,onSelectTheme:r,darkMode:d,onKeyDown:y=>{y.which===k.KeyCodes.Enter&&C()}})},[n,t,r,h,d]),g={createPopupPanel:p,tooltip:m||f||"Theme",label:f,icon:b,...u};return s===o.PopupButtonType.Toolbar?e.jsx(o.ExhibitPopupIconButton,{ref:i,...g}):e.jsx(o.ExhibitPopupMenuItem,{ref:i,...g})})),oa=a.memo(a.forwardRef((l,i)=>{const{command:n,commandHook:t,selectedTheme:r,onSelectTheme:c,disabled:m=!1,darkMode:f,label:s,icon:d,variant:h,...u}=l;k.useCommand(n);const b=n?.context()?.themes,p=r||n?.context()?.theme,g=f??n?.context()?.darkMode,S=m||n?.disabled(),C=k.useCallbackRef(x=>{c?.(x),n?.execute(x,t)},[c,t]),y=a.useCallback((x,w)=>{const{children:j,title:T,...E}=x;let I=x.children;return(S||w)&&(I=e.jsx("div",{children:I})),e.jsx(o.CommandTooltip,{command:n,placement:h===k.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:S||w,...E,children:I})},[n,S]);return e.jsx(ta,{ref:i,themes:b,selectedTheme:p,onSelectTheme:C,variant:h===k.CommandButtonType.Menuitem?o.PopupButtonType.Menuitem:o.PopupButtonType.Toolbar,createTooltip:y,disabled:S,darkMode:g,icon:o.themeIcon(e.jsx(o.Theme2Icon,{})),...u})})),na=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,...m}=l,f=k.useCommands(n,["themeMode"])[0],s=f?.state(),d=f?.state()!==null,h=B.useMediaQuery("(prefers-color-scheme: dark)"),u=s==="dark"||s===null&&h,b=k.useCallbackRef((p,g)=>{const S={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"appearance",disabled:c},C=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...S,command:f,icon:o.themeIcon(u?e.jsx(me.DarkMode,{}):e.jsx(me.LightMode,{}))}),e.jsx(o.CommandButton,{...S,command:g.getCommand("defaultThemeMode"),icon:o.themeIcon(h?e.jsx(o.SystemDefaultDarkMode,{}):e.jsx(o.SystemDefaultLightMode,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...S,command:g.getCommand("enableDarkGrid")}),e.jsx(o.CommandButton,{...S,command:g.getCommand("enableDarkImages")})]});return o.defaultCreatePopupPanel({...p,children:C})},[c,f,t,r,h,s,d]);return e.jsx(o.CommandPopupButton,{ref:i,quickCommand:"themeMode",commands:n,commandHook:t,createPopupPanel:b,label:"Appearance",tooltip:"Change the light/dark mode to match your viewing preference. This does not affect the view for others.",onQuickClick:()=>{f?.execute(u?"light":"dark",t)},selected:d,icon:o.themeIcon(u?e.jsx(me.DarkMode,{}):e.jsx(me.LightMode,{})),...m})})),ra=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,sx:m,...f}=l,s=a.useCallback((d,h)=>{const u={variant:k.CommandButtonType.Menuitem,scope:"help",commandHook:{...t,beforeExecute:(p,g)=>t?.beforeExecute?.(p,g)!==!1&&d.floatReference.closeAll()},disabled:c},b=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...u,command:h.getCommand("showKeyboardShortcuts"),icon:o.themeIcon(e.jsx(me.Keyboard,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...u,command:h.getCommand("gotoUrlGithub"),icon:o.themeIcon(e.jsx(o.GithubIcon,{}))}),e.jsx(o.CommandButton,{...u,command:h.getCommand("gotoUrlDiscord"),icon:o.themeIcon(e.jsx(o.DiscordIcon,{}))}),e.jsx(o.CommandButton,{...u,command:h.getCommand("gotoUrlDocumentation"),icon:o.themeIcon(e.jsx(o.DocumentationIcon,{}))}),e.jsx(o.CommandButton,{...u,command:h.getCommand("gotoUrlIssue"),icon:o.themeIcon(e.jsx(o.TicketIcon,{}))})]});return o.defaultCreatePopupPanel({...d,children:b})},[c,t]);return e.jsx(o.CommandPopupButton,{ref:i,sx:m,commands:n,disabled:c,commandHook:t,scope:r,label:"Help",tooltip:"Help, feedback, and keyboard shortcuts.",createPopupPanel:s,icon:o.themeIcon(e.jsx(o.HelpIcon,{sx:{transform:"scale(0.75)"}})),...f})})),qo=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r,disabled:c=!1,preferSingleMenu:m=!0,showQuickButton:f=!0,variant:s=k.CommandButtonType.Toolbar,...d}=l,h=k.useCommands(n,["insertImageFromFile","insertImageFromURL"]),{singleMenuCommand:u,allDisabled:b}=a.useMemo(()=>{let g=null,S=0;for(let C=0;C<h.length;C++)h[C]&&!h[C]?.disabled()&&(m&&s===k.CommandButtonType.Menuitem&&(g=S===0?h[C]:null),S++);return{singleMenuCommand:g,allDisabled:S===0}},[h]),p=a.useCallback((g,S)=>{const C={variant:k.CommandButtonType.Menuitem,commandHook:t,scope:"insertImage",disabled:c},y=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...C,command:S.getCommand("insertImageFromFile"),icon:o.themeIcon(e.jsx(o.InsertImageIcon,{}))}),e.jsx(o.CommandButton,{...C,command:S.getCommand("insertImageFromURL"),icon:o.themeIcon(e.jsx(o.InsertImageIcon,{}))})]});return o.defaultCreatePopupPanel({...g,children:y})},[c,t,r]);return u?e.jsx(o.CommandButton,{ref:i,variant:s,commandHook:t,disabled:c,command:u,icon:o.themeIcon(e.jsx(o.InsertImageIcon,{})),...d}):e.jsx(o.CommandPopupButton,{ref:i,variant:s,quickCommand:"insertImageFromFile",commands:n,commandHook:t,scope:r,disabled:c||b,tooltip:"Insert a picture from the web to complement your data.",createPopupPanel:p,icon:o.themeIcon(e.jsx(o.InsertImageIcon,{})),...d})})),lo=a.memo(a.forwardRef((l,i)=>{const{command:n,...t}=l,r=k.useEditMode(),[c,m]=a.useState(!1),[f,s]=a.useState("info");return a.useEffect(()=>{const d=r.getMode();m(d?.key==="copy"||d?.key==="cut"),s(d?.key==="cut"?"warning":"info")},[r]),e.jsx(o.CommandButton,{ref:i,command:n,icon:o.themeIcon(e.jsx(o.WalkingCopyIcon,{isWalking:c,themedType:f})),...t})})),Nl=a.memo(a.forwardRef((l,i)=>{const{...n}=l;return e.jsx(o.SimpleCommandPopupButton,{ref:i,...n,popupCommandKeys:["quickFormulaSum","quickFormulaAverage","quickFormulaCount","quickFormulaMax","quickFormulaMin",null,"insertFunction"],quickCommand:"quickFormulaSum",popupScope:"quickFormula",label:"Quick Formulas",tooltip:"More quick functions.",icon:t=>{switch(t?.key()){case"quickFormulaSum":return o.themeIcon(e.jsx(o.FunctionSumIcon,{}));case"insertFunction":return o.themeIcon(e.jsx(o.FunctionThinIcon,{}));default:return null}}})})),aa=a.createContext(null);aa.displayName="HookFormContext";const la=()=>a.useContext(aa),ia=a.memo(a.forwardRef((l,i)=>{const{disabled:n,style:t,className:r,sx:c,defaultInput:m,value:f,formName:s,formOptions:d,onChangeInput:h,onValidate:u,onKeyDown:b,...p}=l,g=la(),S=s&&g?g.register(s,d):null,[C,y]=a.useState(""),[x,w]=a.useState(""),[j,T]=a.useState(f);a.useEffect(()=>{T(f),w("")},[f]);const E=k.useCallbackRef(P=>{let v="";try{T(P),u?.(P),h?.(P)}catch(F){v=F.message??"Invalid Name"}s&&g&&(v?g.setError(s,{message:v}):g.clearErrors(s)),w(v)},[f,u,h]),I=k.useCallbackRef(async P=>{P.keyCode===k.KeyCodes.Escape&&C!==f&&(E(C),g?.setValue(s,C),g?.clearErrors(s),P.stopPropagation()),b?.(P)},[b,C,f,g]),D=k.useCallbackRef(P=>{y(P.target.value??"")},[]),N=k.useCallbackRef(P=>{y(""),S?.onBlur(P)},[]),L=a.useCallback(P=>{E(P.target.value),S?.onChange(P)},[S]);return e.jsx(B.FormControl,{sx:{paddingTop:P=>P.spacing(1.5),minWidth:135,width:"100%",...c},size:"small",ref:i,className:fe("named-input",r),...p,children:e.jsx(B.TextField,{label:"Name",placeholder:m,onFocus:D,onBlur:N,inputRef:S?.ref,disabled:n,error:!!x,helperText:x||" ",sx:{"& .MuiFormHelperText-root":{marginTop:P=>P.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",name:s,spellCheck:!1,autoComplete:"off",readOnly:n,sx:{paddingTop:P=>P.spacing(1.25),paddingBottom:P=>P.spacing(.75),backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`}}},value:j??"",onChange:L,onKeyDownCapture:I,onContextMenu:P=>{P.stopPropagation()}})})}));ia.displayName="NamedInput";const zt=l=>l===null?"":l.toString(),sa=a.memo(a.forwardRef((l,i)=>{const{formName:n,formOptions:t,disabled:r,style:c,className:m,sx:f,onKeyDown:s,value:d,onChangeInput:h,resolvedAddress:u,...b}=l,p=la(),g=n&&p?p.register(n,t):null,[S,C]=a.useState(""),[y,x]=a.useState(!1),[w,j]=a.useState(()=>zt(d));a.useEffect(()=>{j(zt(d)),C(""),n&&p&&p.clearErrors(n),x(!1)},[d]);const T=k.useCallbackRef(v=>{let F="";try{j(v);const H=zt(d),A=u(v);A.toString()!==H&&h?.(A)}catch{F="Invalid Range"}n&&p&&(F?p.setError(n,{message:F}):p.clearErrors(n)),C(F),x(!0)},[w,h,n,p]),E=k.useCallbackRef(async v=>{if(y&&v.keyCode===k.KeyCodes.Escape){const F=zt(d);j(F),C(""),x(!1),v.stopPropagation()}s?.(v)},[d,h,s,y]),I=k.useCallbackRef(v=>{g?.onBlur(v)},[g]),D=a.useCallback(v=>{T(v.target.value),g?.onChange(v)},[g]),[N,L]=a.useState(!1),P=a.useMemo(()=>e.jsx(B.InputAdornment,{tabIndex:-1,sx:{display:"flex",position:"relative",flex:"0"},position:"end",children:e.jsx(o.ExhibitOptionButton,{disabled:!0,selected:N,onSelectToggle:v=>{L(v)},label:"Select Range",icon:o.themeIcon(e.jsx(o.SelectRangeModeIcon,{}))})}),[N]);return e.jsx(B.FormControl,{sx:{paddingTop:v=>v.spacing(1.5),minWidth:135,width:"100%",...f},size:"small",ref:i,className:fe("range-input",m),...b,children:e.jsx(B.TextField,{label:"Range",placeholder:"Enter Range",onBlur:I,disabled:r,error:!!S,inputRef:g?.ref,helperText:S||" ",sx:{"& .MuiFormHelperText-root":{marginTop:v=>v.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{spellCheck:!1,autoComplete:"off",readOnly:r,name:n,sx:{paddingTop:v=>v.spacing(1.25),paddingBottom:v=>v.spacing(.75)}},sx:{backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`},endAdornment:P},value:w??"",onChange:D,onKeyDownCapture:E,onContextMenu:v=>{v.stopPropagation()}})})}));sa.displayName="RangeInput";const Ko=a.memo(a.forwardRef((l,i)=>{const{sheet:n,className:t,debounceDelay:r=220,sx:c,...m}=l,[f,s]=a.useState(()=>n.getView().getZoomScale()),[d,h]=a.useState(null),u=a.useRef(0);le.useModelListener(n,{onViewChange:()=>{h(!0),u.current===0&&s(n.getView().getZoomScale())}}),a.useEffect(()=>{u.current=0,h(!1),s(n.getView().getZoomScale())},[n]),a.useEffect(()=>{u.current!==0&&O.CommonUtils.debounce(()=>{f===u.current&&(u.current=0,n.getView().update({zoomScale:f}))},r)()},[f,r]);const b=k.useCallbackRef(I=>{let D=I;I<100?D=Math.round(I/(10/9)+10):I>100&&(D=Math.round(3*I-200)),u.current=D,h(!0),s(D)},[n]),p=I=>{let D=I;return I<100?D=10/9*(I-10):I>100&&(D=(I+200)/3),D},g=p(f),[S,C]=a.useState(null),y=a.useRef(null),x=a.useCallback(()=>{const I=S;I&&requestAnimationFrame(()=>{y.current?.contains(document.activeElement)&&I.focus()})},[]),w=k.useMouseDownAndHoldListener(()=>{b(p(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10)))}),j=k.useMouseDownAndHoldListener(()=>b(p(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10)))),T=G.useTheme(),E=a.useMemo(()=>`${O.IFont.getSharedMeasurer()("100%",Math.round(T.typography.fontSize),T.typography.fontFamily).width}px`,[T]);return e.jsxs(B.Box,{ref:i,className:fe(t),sx:{padding:"0px 0px",display:"flex",alignItems:"center",color:I=>I.palette.text.secondary,...c},onFocus:I=>{I.relatedTarget&&!S&&C(I.relatedTarget)},onBlur:I=>{S&&!y?.current?.contains(I.relatedTarget)&&C(null)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&x()},...m,children:[e.jsx(o.SimpleTooltip,{disableInteractive:!0,title:"Zoom Out",children:e.jsx(B.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:I=>I.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:I=>{I.button!==0?I.preventDefault():w(I)},children:e.jsx(me.Remove,{})})}),e.jsx(B.Slider,{ref:y,sx:{flex:"1 1 100%",padding:"6px 0px !important",marginRight:"2px",marginLeft:"2px","& .MuiSlider-thumb":{height:14,width:6,borderRadius:.75,"&.Mui-focusVisible":{boxShadow:I=>`0px 0px 0px 3px ${o.hexToRGB(I.palette.primary.main,.16)}`},"&:focus, &:hover, &.Mui-active":{boxShadow:I=>`0px 0px 0px 2px ${o.hexToRGB(I.palette.primary.main,.16)}`}},"& .MuiSlider-mark":{width:"1px",height:"8px"},"& .MuiSlider-markActive":{backgroundColor:"currentColor"},"& .MuiSlider-thumb:not(.MuiSlider-active)":{transition:d?"left 260ms ease-in":"none"}},valueLabelDisplay:"auto",size:"small",track:!1,min:0,step:1,value:g,max:200,marks:[{value:100}],onAnimationEnd:()=>h(!1),onWheel:I=>{b(p(O.CommonUtils.findNextStep(n.getView().getZoomScale(),I.deltaY<0,10)))},onKeyDown:I=>{I.which===k.KeyCodes.Down||I.which===k.KeyCodes.Right?(b(p(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10))),I.preventDefault()):I.which===k.KeyCodes.Up||I.which===k.KeyCodes.Left?(b(p(O.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10))),I.preventDefault()):I.which!==k.KeyCodes.Enter&&I.which!==k.KeyCodes.Escape||x()},onChange:(I,D)=>{Math.abs(D-100)<3?b(100):b(D)},valueLabelFormat:(I,D)=>`Zoom: ${Math.round(f)}%`}),e.jsx(o.SimpleTooltip,{disableInteractive:!0,title:"Zoom In",children:e.jsx(B.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:I=>I.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:I=>{I.button!==0?I.preventDefault():j(I)},children:e.jsx(me.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:()=>{b(100)},sx:{cursor:"pointer",display:"flex",flex:"1 1 100%",fontSize:"0.70rem",marginLeft:"2px",marginRight:"2px",userSelect:"none",justifyContent:"center",width:E},children:e.jsx("div",{children:Math.round(f)+"%"})})]})]})}));Ko.displayName="SheetZoomScale";const Go=a.memo(a.forwardRef((l,i)=>{const{sx:n,sheet:t,gridStyle:r,children:c,childrenEnd:m,...f}=l;a.useImperativeHandle(i,()=>({}));const s=a.useRef(null);a.useEffect(()=>{const p=g=>g.preventDefault();return s.current?.addEventListener("wheel",p,{passive:!1}),()=>{s.current?.removeEventListener("wheel",p)}},[]);const d=k.useEditMode(),h=a.useMemo(()=>{const p=d.getMode();return p?.description?p.description:"Ready"},[d]),[u,b]=a.useState(!1);return e.jsxs(B.Box,{ref:s,sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",overflow:u?"visible":"hidden",boxShadow:`0px -1px 0px ${r.header.edgeStrokeFill}`,...n},onMouseOver:()=>b(!0),onMouseLeave:()=>b(!1),...f,children:[c,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:p=>p.palette.text.secondary},variant:"caption",children:h})}),m?e.jsx(B.Box,{sx:{display:"flex",alignItems:"center"},children:m}):null,e.jsx(o.ExhibitDivider,{style:{marginTop:"6px",marginBottom:"6px"}}),e.jsx(Ko,{sx:{paddingLeft:"4px",minWidth:"175px"},sheet:t})]})}));Go.displayName="StatusBar";var st=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Dn,Fn,yo,Nn,An,Wt={exports:{}},yt={},Ct={exports:{}},On={},Ln={exports:{}};function Al(){return Fn?Dn:(Fn=1,Dn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function Ol(){if(Nn)return yo;Nn=1;var l=Al();function i(){}function n(){}return n.resetWarningCache=i,yo=function(){function t(m,f,s,d,h,u){if(u!==l){var b=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 b.name="Invariant Violation",b}}function r(){return t}t.isRequired=t;var c={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:n,resetWarningCache:i};return c.PropTypes=c,c},yo}function Pt(){return An||(An=1,Ln.exports=Ol()()),Ln.exports}var Hn,Vt={exports:{}},zn,Ce={},ze={};function io(){return zn||(zn=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.dontSetMe=function(l,i,n){if(l[i])return new Error(`Invalid prop ${i} passed to ${n} - do not set this, set it on the child.`)},ze.findInArray=function(l,i){for(let n=0,t=l.length;n<t;n++)if(i.apply(i,[l[n],n,l]))return l[n]},ze.int=function(l){return parseInt(l,10)},ze.isFunction=function(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Function]"},ze.isNum=function(l){return typeof l=="number"&&!isNaN(l)}),ze}var Wn,Vn,We={};function Xo(){if(Vn)return Ce;Vn=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.addClassName=m,Ce.addEvent=function(s,d,h,u){if(!s)return;const b={capture:!0,...u};s.addEventListener?s.addEventListener(d,h,b):s.attachEvent?s.attachEvent("on"+d,h):s["on"+d]=h},Ce.addUserSelectStyles=function(s){if(!s)return;let d=s.getElementById("react-draggable-style-el");d||(d=s.createElement("style"),d.type="text/css",d.id="react-draggable-style-el",d.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
8
8
  `,d.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
9
  `,s.getElementsByTagName("head")[0].appendChild(d)),s.body&&m(s.body,"react-draggable-transparent-selection")},Ce.createCSSTransform=function(s,d){const h=r(s,d,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:h}},Ce.createSVGTransform=function(s,d){return r(s,d,"")},Ce.getTouch=function(s,d){return s.targetTouches&&(0,l.findInArray)(s.targetTouches,h=>d===h.identifier)||s.changedTouches&&(0,l.findInArray)(s.changedTouches,h=>d===h.identifier)},Ce.getTouchIdentifier=function(s){if(s.targetTouches&&s.targetTouches[0])return s.targetTouches[0].identifier;if(s.changedTouches&&s.changedTouches[0])return s.changedTouches[0].identifier},Ce.getTranslation=r,Ce.innerHeight=function(s){let d=s.clientHeight;const h=s.ownerDocument.defaultView.getComputedStyle(s);return d-=(0,l.int)(h.paddingTop),d-=(0,l.int)(h.paddingBottom),d},Ce.innerWidth=function(s){let d=s.clientWidth;const h=s.ownerDocument.defaultView.getComputedStyle(s);return d-=(0,l.int)(h.paddingLeft),d-=(0,l.int)(h.paddingRight),d},Ce.matchesSelector=t,Ce.matchesSelectorAndParentsTo=function(s,d,h){let u=s;do{if(t(u,d))return!0;if(u===h)return!1;u=u.parentNode}while(u);return!1},Ce.offsetXYFromParent=function(s,d,h){const u=d===d.ownerDocument.body?{left:0,top:0}:d.getBoundingClientRect(),b=(s.clientX+d.scrollLeft-u.left)/h,p=(s.clientY+d.scrollTop-u.top)/h;return{x:b,y:p}},Ce.outerHeight=function(s){let d=s.clientHeight;const h=s.ownerDocument.defaultView.getComputedStyle(s);return d+=(0,l.int)(h.borderTopWidth),d+=(0,l.int)(h.borderBottomWidth),d},Ce.outerWidth=function(s){let d=s.clientWidth;const h=s.ownerDocument.defaultView.getComputedStyle(s);return d+=(0,l.int)(h.borderLeftWidth),d+=(0,l.int)(h.borderRightWidth),d},Ce.removeClassName=f,Ce.removeEvent=function(s,d,h,u){if(!s)return;const b={capture:!0,...u};s.removeEventListener?s.removeEventListener(d,h,b):s.detachEvent?s.detachEvent("on"+d,h):s["on"+d]=null},Ce.scheduleRemoveUserSelectStyles=function(s){window.requestAnimationFrame?window.requestAnimationFrame(()=>{c(s)}):c(s)};var l=io(),i=function(s,d){if(typeof WeakMap=="function")var h=new WeakMap,u=new WeakMap;return function(b,p){if(!p&&b&&b.__esModule)return b;var g,S,C={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return C;if(g=p?u:h){if(g.has(b))return g.get(b);g.set(b,C)}for(const y in b)y!=="default"&&{}.hasOwnProperty.call(b,y)&&((S=(g=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,y))&&(S.get||S.set)?g(C,y,S):C[y]=b[y]);return C}(s,d)}(function(){if(Wn)return We;Wn=1,Object.defineProperty(We,"__esModule",{value:!0}),We.browserPrefixToKey=h,We.browserPrefixToStyle=function(u,b){return b?`-${b.toLowerCase()}-${u}`:u},We.default=void 0,We.getPrefix=d;const s=["Moz","Webkit","O","ms"];function d(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const b=window.document?.documentElement?.style;if(!b||u in b)return"";for(let p=0;p<s.length;p++)if(h(u,s[p])in b)return s[p];return""}function h(u,b){return b?`${b}${function(p){let g="",S=!0;for(let C=0;C<p.length;C++)S?(g+=p[C].toUpperCase(),S=!1):p[C]==="-"?S=!0:g+=p[C];return g}(u)}`:u}return We.default=d(),We}());let n="";function t(s,d){return n||(n=(0,l.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(h){return(0,l.isFunction)(s[h])})),!!(0,l.isFunction)(s[n])&&s[n](d)}function r(s,d,h){let{x:u,y:b}=s,p=`translate(${u}${h},${b}${h})`;return d&&(p=`translate(${`${typeof d.x=="string"?d.x:d.x+h}`}, ${`${typeof d.y=="string"?d.y:d.y+h}`})`+p),p}function c(s){if(s)try{if(s.body&&f(s.body,"react-draggable-transparent-selection"),s.selection)s.selection.empty();else{const d=(s.defaultView||window).getSelection();d&&d.type!=="Caret"&&d.removeAllRanges()}}catch{}}function m(s,d){s.classList?s.classList.add(d):s.className.match(new RegExp(`(?:^|\\s)${d}(?!\\S)`))||(s.className+=` ${d}`)}function f(s,d){s.classList?s.classList.remove(d):s.className=s.className.replace(new RegExp(`(?:^|\\s)${d}(?!\\S)`,"g"),"")}return Ce}var $n,Ne={};function ca(){if($n)return Ne;$n=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.canDragX=function(t){return t.props.axis==="both"||t.props.axis==="x"},Ne.canDragY=function(t){return t.props.axis==="both"||t.props.axis==="y"},Ne.createCoreData=function(t,r,c){const m=!(0,l.isNum)(t.lastX),f=n(t);return m?{node:f,deltaX:0,deltaY:0,lastX:r,lastY:c,x:r,y:c}:{node:f,deltaX:r-t.lastX,deltaY:c-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:c}},Ne.createDraggableData=function(t,r){const c=t.props.scale;return{node:r.node,x:t.state.x+r.deltaX/c,y:t.state.y+r.deltaY/c,deltaX:r.deltaX/c,deltaY:r.deltaY/c,lastX:t.state.x,lastY:t.state.y}},Ne.getBoundPosition=function(t,r,c){if(!t.props.bounds)return[r,c];let{bounds:m}=t.props;m=typeof m=="string"?m:function(s){return{left:s.left,top:s.top,right:s.right,bottom:s.bottom}}(m);const f=n(t);if(typeof m=="string"){const{ownerDocument:s}=f,d=s.defaultView;let h;if(m==="parent"?h=f.parentNode:h=f.getRootNode().querySelector(m),!(h instanceof d.HTMLElement))throw new Error('Bounds selector "'+m+'" could not find an element.');const u=h,b=d.getComputedStyle(f),p=d.getComputedStyle(u);m={left:-f.offsetLeft+(0,l.int)(p.paddingLeft)+(0,l.int)(b.marginLeft),top:-f.offsetTop+(0,l.int)(p.paddingTop)+(0,l.int)(b.marginTop),right:(0,i.innerWidth)(u)-(0,i.outerWidth)(f)-f.offsetLeft+(0,l.int)(p.paddingRight)-(0,l.int)(b.marginRight),bottom:(0,i.innerHeight)(u)-(0,i.outerHeight)(f)-f.offsetTop+(0,l.int)(p.paddingBottom)-(0,l.int)(b.marginBottom)}}return(0,l.isNum)(m.right)&&(r=Math.min(r,m.right)),(0,l.isNum)(m.bottom)&&(c=Math.min(c,m.bottom)),(0,l.isNum)(m.left)&&(r=Math.max(r,m.left)),(0,l.isNum)(m.top)&&(c=Math.max(c,m.top)),[r,c]},Ne.getControlPosition=function(t,r,c){const m=typeof r=="number"?(0,i.getTouch)(t,r):null;if(typeof r=="number"&&!m)return null;const f=n(c),s=c.props.offsetParent||f.offsetParent||f.ownerDocument.body;return(0,i.offsetXYFromParent)(m||t,s,c.props.scale)},Ne.snapToGrid=function(t,r,c){const m=Math.round(r/t[0])*t[0],f=Math.round(c/t[1])*t[1];return[m,f]};var l=io(),i=Xo();function n(t){const r=t.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Ne}var Un,_n,qn,Kn,St={},$t={};function da(){return Un||(Un=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.default=function(){}),$t}function Ll(){if(_n)return St;_n=1,Object.defineProperty(St,"__esModule",{value:!0}),St.default=void 0;var l=function(p,g){if(typeof WeakMap=="function")var S=new WeakMap,C=new WeakMap;return function(y,x){if(!x&&y&&y.__esModule)return y;var w,j,T={__proto__:null,default:y};if(y===null||typeof y!="object"&&typeof y!="function")return T;if(w=x?C:S){if(w.has(y))return w.get(y);w.set(y,T)}for(const E in y)E!=="default"&&{}.hasOwnProperty.call(y,E)&&((j=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(y,E))&&(j.get||j.set)?w(T,E,j):T[E]=y[E]);return T}(p,g)}(a),i=f(Pt()),n=f(Je),t=Xo(),r=ca(),c=io(),m=f(da());function f(p){return p&&p.__esModule?p:{default:p}}function s(p,g,S){return(g=function(C){var y=function(x,w){if(typeof x!="object"||!x)return x;var j=x[Symbol.toPrimitive];if(j!==void 0){var T=j.call(x,w);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(x)}(C,"string");return typeof y=="symbol"?y:y+""}(g))in p?Object.defineProperty(p,g,{value:S,enumerable:!0,configurable:!0,writable:!0}):p[g]=S,p}const d={start:"touchstart",move:"touchmove",stop:"touchend"},h={start:"mousedown",move:"mousemove",stop:"mouseup"};let u=h,b=class extends l.Component{constructor(){super(...arguments),s(this,"dragging",!1),s(this,"lastX",NaN),s(this,"lastY",NaN),s(this,"touchIdentifier",null),s(this,"mounted",!1),s(this,"handleDragStart",p=>{if(this.props.onMouseDown(p),!this.props.allowAnyClick&&typeof p.button=="number"&&p.button!==0)return!1;const g=this.findDOMNode();if(!g||!g.ownerDocument||!g.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:S}=g;if(this.props.disabled||!(p.target instanceof S.defaultView.Node)||this.props.handle&&!(0,t.matchesSelectorAndParentsTo)(p.target,this.props.handle,g)||this.props.cancel&&(0,t.matchesSelectorAndParentsTo)(p.target,this.props.cancel,g))return;p.type!=="touchstart"||this.props.allowMobileScroll||p.preventDefault();const C=(0,t.getTouchIdentifier)(p);this.touchIdentifier=C;const y=(0,r.getControlPosition)(p,C,this);if(y==null)return;const{x,y:w}=y,j=(0,r.createCoreData)(this,x,w);(0,m.default)("DraggableCore: handleDragStart: %j",j),(0,m.default)("calling",this.props.onStart),this.props.onStart(p,j)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,t.addUserSelectStyles)(S),this.dragging=!0,this.lastX=x,this.lastY=w,(0,t.addEvent)(S,u.move,this.handleDrag),(0,t.addEvent)(S,u.stop,this.handleDragStop))}),s(this,"handleDrag",p=>{const g=(0,r.getControlPosition)(p,this.touchIdentifier,this);if(g==null)return;let{x:S,y:C}=g;if(Array.isArray(this.props.grid)){let x=S-this.lastX,w=C-this.lastY;if([x,w]=(0,r.snapToGrid)(this.props.grid,x,w),!x&&!w)return;S=this.lastX+x,C=this.lastY+w}const y=(0,r.createCoreData)(this,S,C);if((0,m.default)("DraggableCore: handleDrag: %j",y),this.props.onDrag(p,y)!==!1&&this.mounted!==!1)this.lastX=S,this.lastY=C;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const w=document.createEvent("MouseEvents");w.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(w)}}),s(this,"handleDragStop",p=>{if(!this.dragging)return;const g=(0,r.getControlPosition)(p,this.touchIdentifier,this);if(g==null)return;let{x:S,y:C}=g;if(Array.isArray(this.props.grid)){let w=S-this.lastX||0,j=C-this.lastY||0;[w,j]=(0,r.snapToGrid)(this.props.grid,w,j),S=this.lastX+w,C=this.lastY+j}const y=(0,r.createCoreData)(this,S,C);if(this.props.onStop(p,y)===!1||this.mounted===!1)return!1;const x=this.findDOMNode();x&&this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(x.ownerDocument),(0,m.default)("DraggableCore: handleDragStop: %j",y),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,x&&((0,m.default)("DraggableCore: Removing handlers"),(0,t.removeEvent)(x.ownerDocument,u.move,this.handleDrag),(0,t.removeEvent)(x.ownerDocument,u.stop,this.handleDragStop))}),s(this,"onMouseDown",p=>(u=h,this.handleDragStart(p))),s(this,"onMouseUp",p=>(u=h,this.handleDragStop(p))),s(this,"onTouchStart",p=>(u=d,this.handleDragStart(p))),s(this,"onTouchEnd",p=>(u=d,this.handleDragStop(p)))}componentDidMount(){this.mounted=!0;const p=this.findDOMNode();p&&(0,t.addEvent)(p,d.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const p=this.findDOMNode();if(p){const{ownerDocument:g}=p;(0,t.removeEvent)(g,h.move,this.handleDrag),(0,t.removeEvent)(g,d.move,this.handleDrag),(0,t.removeEvent)(g,h.stop,this.handleDragStop),(0,t.removeEvent)(g,d.stop,this.handleDragStop),(0,t.removeEvent)(p,d.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(g)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return l.cloneElement(l.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return St.default=b,s(b,"displayName","DraggableCore"),s(b,"propTypes",{allowAnyClick:i.default.bool,allowMobileScroll:i.default.bool,children:i.default.node.isRequired,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(p,g){if(p[g]&&p[g].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:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),s(b,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),St}function Hl(){return qn||(qn=1,function(l){Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(l,"DraggableCore",{enumerable:!0,get:function(){return s.default}}),l.default=void 0;var i=function(g,S){if(typeof WeakMap=="function")var C=new WeakMap,y=new WeakMap;return function(x,w){if(!w&&x&&x.__esModule)return x;var j,T,E={__proto__:null,default:x};if(x===null||typeof x!="object"&&typeof x!="function")return E;if(j=w?y:C){if(j.has(x))return j.get(x);j.set(x,E)}for(const I in x)I!=="default"&&{}.hasOwnProperty.call(x,I)&&((T=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,I))&&(T.get||T.set)?j(E,I,T):E[I]=x[I]);return E}(g,S)}(a),n=h(Pt()),t=h(Je),r=function(){if(Hn)return Vt.exports;function g(C){var y,x,w="";if(typeof C=="string"||typeof C=="number")w+=C;else if(typeof C=="object")if(Array.isArray(C)){var j=C.length;for(y=0;y<j;y++)C[y]&&(x=g(C[y]))&&(w&&(w+=" "),w+=x)}else for(x in C)C[x]&&(w&&(w+=" "),w+=x);return w}function S(){for(var C,y,x=0,w="",j=arguments.length;x<j;x++)(C=arguments[x])&&(y=g(C))&&(w&&(w+=" "),w+=y);return w}return Hn=1,Vt.exports=S,Vt.exports.clsx=S,Vt.exports}(),c=Xo(),m=ca(),f=io(),s=h(Ll()),d=h(da());function h(g){return g&&g.__esModule?g:{default:g}}function u(){return u=Object.assign?Object.assign.bind():function(g){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var y in C)({}).hasOwnProperty.call(C,y)&&(g[y]=C[y])}return g},u.apply(null,arguments)}function b(g,S,C){return(S=function(y){var x=function(w,j){if(typeof w!="object"||!w)return w;var T=w[Symbol.toPrimitive];if(T!==void 0){var E=T.call(w,j);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(j==="string"?String:Number)(w)}(y,"string");return typeof x=="symbol"?x:x+""}(S))in g?Object.defineProperty(g,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[S]=C,g}class p extends i.Component{static getDerivedStateFromProps(S,C){let{position:y}=S,{prevPropsPosition:x}=C;return!y||x&&y.x===x.x&&y.y===x.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:y,prevPropsPosition:x}),{x:y.x,y:y.y,prevPropsPosition:{...y}})}constructor(S){super(S),b(this,"onDragStart",(C,y)=>{if((0,d.default)("Draggable: onDragStart: %j",y),this.props.onStart(C,(0,m.createDraggableData)(this,y))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(C,y)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",y);const x=(0,m.createDraggableData)(this,y),w={x:x.x,y:x.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:T}=w;w.x+=this.state.slackX,w.y+=this.state.slackY;const[E,I]=(0,m.getBoundPosition)(this,w.x,w.y);w.x=E,w.y=I,w.slackX=this.state.slackX+(j-w.x),w.slackY=this.state.slackY+(T-w.y),x.x=w.x,x.y=w.y,x.deltaX=w.x-this.state.x,x.deltaY=w.y-this.state.y}if(this.props.onDrag(C,x)===!1)return!1;this.setState(w)}),b(this,"onDragStop",(C,y)=>{if(!this.state.dragging||this.props.onStop(C,(0,m.createDraggableData)(this,y))===!1)return!1;(0,d.default)("Draggable: onDragStop: %j",y);const x={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:w,y:j}=this.props.position;x.x=w,x.y=j}this.setState(x)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},!S.position||S.onDrag||S.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:S,bounds:C,children:y,defaultPosition:x,defaultClassName:w,defaultClassNameDragging:j,defaultClassNameDragged:T,position:E,positionOffset:I,scale:D,...N}=this.props;let L={},P=null;const v=!E||this.state.dragging,F=E||x,H={x:(0,m.canDragX)(this)&&v?this.state.x:F.x,y:(0,m.canDragY)(this)&&v?this.state.y:F.y};this.state.isElementSVG?P=(0,c.createSVGTransform)(H,I):L=(0,c.createCSSTransform)(H,I);const A=(0,r.clsx)(y.props.className||"",w,{[j]:this.state.dragging,[T]:this.state.dragged});return i.createElement(s.default,u({},N,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),i.cloneElement(i.Children.only(y),{className:A,style:{...y.props.style,...L},transform:P}))}}l.default=p,b(p,"displayName","Draggable"),b(p,"propTypes",{...s.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:f.dontSetMe,style:f.dontSetMe,transform:f.dontSetMe}),b(p,"defaultProps",{...s.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 ma(){if(Kn)return Ct.exports;Kn=1;const{default:l,DraggableCore:i}=Hl();return Ct.exports=l,Ct.exports.default=l,Ct.exports.DraggableCore=i,Ct.exports}var Gn,Ut={};function zl(){if(Gn)return Ut;Gn=1,Ut.__esModule=!0,Ut.cloneElement=function(c,m){return m.style&&c.props.style&&(m.style=t(t({},c.props.style),m.style)),m.className&&c.props.className&&(m.className=c.props.className+" "+m.className),i.default.cloneElement(c,m)};var l,i=(l=a)&&l.__esModule?l:{default:l};function n(c,m){var f=Object.keys(c);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(c);m&&(s=s.filter(function(d){return Object.getOwnPropertyDescriptor(c,d).enumerable})),f.push.apply(f,s)}return f}function t(c){for(var m=1;m<arguments.length;m++){var f=arguments[m]!=null?arguments[m]:{};m%2?n(Object(f),!0).forEach(function(s){r(c,s,f[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(f)):n(Object(f)).forEach(function(s){Object.defineProperty(c,s,Object.getOwnPropertyDescriptor(f,s))})}return c}function r(c,m,f){return(m=function(s){var d=function(h,u){if(typeof h!="object"||h===null)return h;var b=h[Symbol.toPrimitive];if(b!==void 0){var p=b.call(h,u);if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(h)}(s,"string");return typeof d=="symbol"?d:String(d)}(m))in c?Object.defineProperty(c,m,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[m]=f,c}return Ut}var Xn,Yn,wt={};function ua(){if(Xn)return wt;Xn=1,wt.__esModule=!0,wt.resizableProps=void 0;var l,i=(l=Pt())&&l.__esModule?l:{default:l};ma();var n={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),c=0;c<t;c++)r[c]=arguments[c];var m,f=r[0];return f.axis==="both"||f.axis==="y"?(m=i.default.number).isRequired.apply(m,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),c=0;c<t;c++)r[c]=arguments[c];var m,f=r[0];return f.axis==="both"||f.axis==="x"?(m=i.default.number).isRequired.apply(m,r):i.default.number.apply(i.default,r)}};return wt.resizableProps=n,wt}function pa(){if(Yn)return yt;Yn=1,yt.__esModule=!0,yt.default=void 0;var l=function(b,p){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var g=c(p);if(g&&g.has(b))return g.get(b);var S={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in b)if(y!=="default"&&Object.prototype.hasOwnProperty.call(b,y)){var x=C?Object.getOwnPropertyDescriptor(b,y):null;x&&(x.get||x.set)?Object.defineProperty(S,y,x):S[y]=b[y]}return S.default=b,g&&g.set(b,S),S}(a),i=ma(),n=zl(),t=ua(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function c(b){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(c=function(S){return S?g:p})(b)}function m(){return m=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var g=arguments[p];for(var S in g)Object.prototype.hasOwnProperty.call(g,S)&&(b[S]=g[S])}return b},m.apply(this,arguments)}function f(b,p){var g=Object.keys(b);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(b);p&&(S=S.filter(function(C){return Object.getOwnPropertyDescriptor(b,C).enumerable})),g.push.apply(g,S)}return g}function s(b){for(var p=1;p<arguments.length;p++){var g=arguments[p]!=null?arguments[p]:{};p%2?f(Object(g),!0).forEach(function(S){d(b,S,g[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(g)):f(Object(g)).forEach(function(S){Object.defineProperty(b,S,Object.getOwnPropertyDescriptor(g,S))})}return b}function d(b,p,g){return(p=function(S){var C=function(y,x){if(typeof y!="object"||y===null)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var j=w.call(y,x);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(y)}(S,"string");return typeof C=="symbol"?C:String(C)}(p))in b?Object.defineProperty(b,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):b[p]=g,b}function h(b,p){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,S){return g.__proto__=S,g},h(b,p)}var u=function(b){var p,g;function S(){for(var y,x=arguments.length,w=new Array(x),j=0;j<x;j++)w[j]=arguments[j];return(y=b.call.apply(b,[this].concat(w))||this).handleRefs={},y.lastHandleRect=null,y.slack=null,y}g=b,(p=S).prototype=Object.create(g.prototype),p.prototype.constructor=p,h(p,g);var C=S.prototype;return C.componentWillUnmount=function(){this.resetData()},C.resetData=function(){this.lastHandleRect=this.slack=null},C.runConstraints=function(y,x){var w=this.props,j=w.minConstraints,T=w.maxConstraints,E=w.lockAspectRatio;if(!j&&!T&&!E)return[y,x];if(E){var I=this.props.width/this.props.height,D=y-this.props.width,N=x-this.props.height;Math.abs(D)>Math.abs(N*I)?x=y/I:y=x*I}var L=y,P=x,v=this.slack||[0,0],F=v[0],H=v[1];return y+=F,x+=H,j&&(y=Math.max(j[0],y),x=Math.max(j[1],x)),T&&(y=Math.min(T[0],y),x=Math.min(T[1],x)),this.slack=[F+(L-y),H+(P-x)],[y,x]},C.resizeHandler=function(y,x){var w=this;return function(j,T){var E=T.node,I=T.deltaX,D=T.deltaY;y==="onResizeStart"&&w.resetData();var N=(w.props.axis==="both"||w.props.axis==="x")&&x!=="n"&&x!=="s",L=(w.props.axis==="both"||w.props.axis==="y")&&x!=="e"&&x!=="w";if(N||L){var P=x[0],v=x[x.length-1],F=E.getBoundingClientRect();w.lastHandleRect!=null&&(v==="w"&&(I+=F.left-w.lastHandleRect.left),P==="n"&&(D+=F.top-w.lastHandleRect.top)),w.lastHandleRect=F,v==="w"&&(I=-I),P==="n"&&(D=-D);var H=w.props.width+(N?I/w.props.transformScale:0),A=w.props.height+(L?D/w.props.transformScale:0),$=w.runConstraints(H,A);H=$[0],A=$[1];var M=H!==w.props.width||A!==w.props.height,R=typeof w.props[y]=="function"?w.props[y]:null;R&&!(y==="onResize"&&!M)&&(j.persist==null||j.persist(),R(j,{node:E,size:{width:H,height:A},handle:x})),y==="onResizeStop"&&w.resetData()}}},C.renderResizeHandle=function(y,x){var w=this.props.handle;if(!w)return l.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+y,ref:x});if(typeof w=="function")return w(y,x);var j=s({ref:x},typeof w.type=="string"?{}:{handleAxis:y});return l.cloneElement(w,j)},C.render=function(){var y=this,x=this.props,w=x.children,j=x.className,T=x.draggableOpts;x.width,x.height,x.handle,x.handleSize,x.lockAspectRatio,x.axis,x.minConstraints,x.maxConstraints,x.onResize,x.onResizeStop,x.onResizeStart;var E=x.resizeHandles;x.transformScale;var I=function(D,N){if(D==null)return{};var L,P,v={},F=Object.keys(D);for(P=0;P<F.length;P++)L=F[P],N.indexOf(L)>=0||(v[L]=D[L]);return v}(x,r);return(0,n.cloneElement)(w,s(s({},I),{},{className:(j?j+" ":"")+"react-resizable",children:[].concat(w.props.children,E.map(function(D){var N,L=(N=y.handleRefs[D])!=null?N:y.handleRefs[D]=l.createRef();return l.createElement(i.DraggableCore,m({},T,{nodeRef:L,key:"resizableHandle-"+D,onStop:y.resizeHandler("onResizeStop",D),onStart:y.resizeHandler("onResizeStart",D),onDrag:y.resizeHandler("onResize",D)}),y.renderResizeHandle(D,L))}))}))},S}(l.Component);return yt.default=u,u.propTypes=t.resizableProps,u.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},yt}var Zn,Jn,kt={};function Wl(){if(Zn)return kt;Zn=1,kt.__esModule=!0,kt.default=void 0;var l=function(p,g){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var S=m(g);if(S&&S.has(p))return S.get(p);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in p)if(x!=="default"&&Object.prototype.hasOwnProperty.call(p,x)){var w=y?Object.getOwnPropertyDescriptor(p,x):null;w&&(w.get||w.set)?Object.defineProperty(C,x,w):C[x]=p[x]}return C.default=p,S&&S.set(p,C),C}(a),i=c(Pt()),n=c(pa()),t=ua(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function c(p){return p&&p.__esModule?p:{default:p}}function m(p){if(typeof WeakMap!="function")return null;var g=new WeakMap,S=new WeakMap;return(m=function(C){return C?S:g})(p)}function f(){return f=Object.assign?Object.assign.bind():function(p){for(var g=1;g<arguments.length;g++){var S=arguments[g];for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(p[C]=S[C])}return p},f.apply(this,arguments)}function s(p,g){var S=Object.keys(p);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(p);g&&(C=C.filter(function(y){return Object.getOwnPropertyDescriptor(p,y).enumerable})),S.push.apply(S,C)}return S}function d(p){for(var g=1;g<arguments.length;g++){var S=arguments[g]!=null?arguments[g]:{};g%2?s(Object(S),!0).forEach(function(C){h(p,C,S[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(S)):s(Object(S)).forEach(function(C){Object.defineProperty(p,C,Object.getOwnPropertyDescriptor(S,C))})}return p}function h(p,g,S){return(g=function(C){var y=function(x,w){if(typeof x!="object"||x===null)return x;var j=x[Symbol.toPrimitive];if(j!==void 0){var T=j.call(x,w);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(x)}(C,"string");return typeof y=="symbol"?y:String(y)}(g))in p?Object.defineProperty(p,g,{value:S,enumerable:!0,configurable:!0,writable:!0}):p[g]=S,p}function u(p,g){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,C){return S.__proto__=C,S},u(p,g)}var b=function(p){var g,S;function C(){for(var y,x=arguments.length,w=new Array(x),j=0;j<x;j++)w[j]=arguments[j];return(y=p.call.apply(p,[this].concat(w))||this).state={width:y.props.width,height:y.props.height,propsWidth:y.props.width,propsHeight:y.props.height},y.onResize=function(T,E){var I=E.size;y.props.onResize?(T.persist==null||T.persist(),y.setState(I,function(){return y.props.onResize&&y.props.onResize(T,E)})):y.setState(I)},y}return S=p,(g=C).prototype=Object.create(S.prototype),g.prototype.constructor=g,u(g,S),C.getDerivedStateFromProps=function(y,x){return x.propsWidth!==y.width||x.propsHeight!==y.height?{width:y.width,height:y.height,propsWidth:y.width,propsHeight:y.height}:null},C.prototype.render=function(){var y=this.props,x=y.handle,w=y.handleSize;y.onResize;var j=y.onResizeStart,T=y.onResizeStop,E=y.draggableOpts,I=y.minConstraints,D=y.maxConstraints,N=y.lockAspectRatio,L=y.axis;y.width,y.height;var P=y.resizeHandles,v=y.style,F=y.transformScale,H=function(A,$){if(A==null)return{};var M,R,K={},X=Object.keys(A);for(R=0;R<X.length;R++)M=X[R],$.indexOf(M)>=0||(K[M]=A[M]);return K}(y,r);return l.createElement(n.default,{axis:L,draggableOpts:E,handle:x,handleSize:w,height:this.state.height,lockAspectRatio:N,maxConstraints:D,minConstraints:I,onResizeStart:j,onResize:this.onResize,onResizeStop:T,resizeHandles:P,transformScale:F,width:this.state.width},l.createElement("div",f({},H,{style:d(d({},v),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},C}(l.Component);return kt.default=b,b.propTypes=d(d({},t.resizableProps),{},{children:i.default.element}),kt}var Vl=(Jn||(Jn=1,Wt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Wt.exports.Resizable=pa().default,Wt.exports.ResizableBox=Wl().default),Wt.exports);function Co(l,i){if(typeof l=="function")return l(i);l&&(l.current=i)}var Dt=parseInt(a.version.split(".")[0],10)>=19?function(l){return i=>{const n=[];for(const t of l){const r=Co(t,i),c=typeof r=="function";n.push(c?r:()=>Co(t,null))}return()=>{for(const t of n)t()}}}:function(l){return i=>{for(const n of l)Co(n,i)}};const Yo=a.memo(a.forwardRef((l,i)=>{const{disabled:n,names:t,workbook:r,restoreFocus:c,readonly:m=!1,disabled:f=!1,commandPopupButtonProps:s,sx:d,notifier:h,...u}=l,[b,p]=a.useState(null),[g,S]=a.useState(()=>r.getSelectedRanges().getCoords()),[C,y]=a.useState(!1),{reference:x}=o.useFloatStack({parentFloat:s?.parentFloat}),[w,j]=a.useState(()=>m||!r.getProtection().isStructureAllowed()),T=()=>b?.text??"",[E,I]=a.useState(T),D=k.useCallbackRef(()=>{if(x?.closeAll(),!E){const _=T();return I(T()),_}if(T()===E)return E;const U=E.trim().toLowerCase();if(U==="r"||U==="c")return E;try{const _=r.getRanges(E);if(_)return _.toString()}catch{}const Q=t.getByName(E);if(Q&&Q.getRanges())return E;let ee=null;try{const _=r.getRanges(E),W=_.getCoords().map(Y=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...Y}));ee=r.getRanges(W)}catch{}if(!ee){const _=r.getSelectedRanges().getCoords().map(W=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...W}));ee=r.getRanges(_)}try{let _=t.getByName(E);w||_||(_=t.addReference(E,ee)),_&&p({text:_.getName()})}catch(_){I(T()),h.showMessage?.(_.message,{type:k.NotificationType.Error})}return null},[E,t,x,w]),N=k.useCallbackRef(()=>{if(r.isClosed())return;const U=[];for(let _=0;_<g.length;_++){const W=g[_];U.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...W})}let Q=null;try{Q=t.lookupByRanges(U)}catch{}let ee=null;ee=Q?.length>0?Q[0].getName():r.getSelectedSheet().getSelectedRange().toString(),p({text:ee})},[r,g]),[L,P]=a.useState(()=>t?.getItems()??null);le.useModelListener(t,{onCollectionChange(U){P(t.getItems()),N()},onClose(U){P([])}}),a.useEffect(()=>{I(T())},[b,g]);const[v,F]=a.useState(r?.getSelectedSheet());le.useModelListener(r,{onProtectionChange:U=>{j(m||!U.getProtection().isStructureAllowed())},onSheetsChange:U=>{F(U?.getSelectedSheet())},onViewChange(U){F(U?.getSelectedSheet())}});const[H,A]=a.useState(null),$=k.useCallbackRef(O.CommonUtils.debounce(N,H?320:0),[]);le.useModelListener(v.getSelection(),{onChange:()=>{S(U=>{const Q=r.getSelectedRanges().getCoords();return O.CoordUtils.isEqualRangesArrays(Q,U)?U:Q})},onAdjustingChange:U=>{A(U.getAdjusting())}}),a.useEffect(()=>{if(H){const U=r.getSelectedRange(),Q=U.getRowCount(),ee=U.getColumnCount();let _=`${Q}R x ${ee}C`;if(_.length>17&&(_=`${Q}x${ee}`),Q>1||ee>1)return void p({text:_,fontStyle:"italic",justifyContent:"center"})}p({text:r.getSelectedSheet().getSelectedRange().toString()}),$()},[g,r,H]);const M=a.useRef(null),R=a.useCallback(U=>{const{onMouseDown:Q,onMouseUp:ee,..._}=U;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:M},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:W=>`1px solid ${W.palette.text.icon??W.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:W=>`1px solid ${W.palette.primary.main}`},"::after":{borderBottom:W=>`1px solid ${W.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*O.IFont.getDeviceScale(),fontStyle:b?.fontStyle,paddingLeft:W=>W.spacing(.75),paddingRight:W=>W.spacing(.75),boxShadow:"none",flex:"1",color:W=>W.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:W=>W.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:W=>W.palette.text.primary}}},value:E,onFocus:W=>{W.target?.select()},onKeyDown:W=>{if(W.which===k.KeyCodes.Enter||W.which===k.KeyCodes.Tab){let Y=E;T()!==E&&(W.stopPropagation(),W.preventDefault(),Y=D()),Y?K(Y):c?.()}else if(W.which===k.KeyCodes.Escape)T()!==E?(I(T()),setTimeout(()=>{W.target?.select()},0),W.stopPropagation(),W.preventDefault()):c?.();else if(W.which===k.KeyCodes.Space)return void W.stopPropagation()},onBlur:()=>{I(T())},onChange:W=>{I(W.target.value)}})})},[E,b]),K=k.useCallbackRef(async U=>{try{x?.closeAll();const Q=t.lookupByRanges(U)?.[0];Q&&await Q?.select(),await r.getRanges(U)?.select()}catch(Q){h.showMessage?.(Q.message,{type:k.NotificationType.Error})}},[t,h,r]),X=a.useCallback(U=>{setTimeout(()=>{y(!0)},0);const Q={variant:k.CommandButtonType.Menuitem,parentFloat:U.floatReference,commandHook:{...s?.commandHook,beforeExecute:(ge,xe)=>(x?.closeAll(),s?.commandHook?.beforeExecute?.(ge,xe))},scope:s?.scope,commands:s?.commands};let ee=t.getItems({scope:r?.getSelectedSheet().getName()});ee=ee.sort((ge,xe)=>ge.getType()===xe.getType()?ge.getName().localeCompare(xe.getName()):ge.getType()==="range"?-1:1);const _=w?null:["editNamedReference","deleteNamedReference"],W=w?null:["editTable",null,"convertTableToRange","deleteTable"],Y=[],ne=ee.length;for(let ge=0;ge<ne;ge++){const xe=ee[ge],Ee=xe.getRanges();if(!Ee||xe.isHidden())continue;const se=xe.getType();se!==ee[ge-1]?.getType()&&(ge>0&&Y.push(e.jsx(o.ExhibitDivider,{orientation:"horizontal"},`type-divider-${Y.length}`)),Y.push(e.jsx(o.ExhibitMenuHeader,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:xe.getType()==="reference"?"Ranges":"Tables"},`type-header-${Y.length}`))),se==="reference"?Y.push(a.createElement(o.SimpleCommandPopupButton,{...Q,key:"named-"+Y.length,popupCommandKeys:_,popupScope:"namedItem",scope:"namedItem",commandState:xe,commands:s?.commands,label:xe.getName(),quickCommand:"selectNamed",disabled:!xe.getRanges()||f,icon:Se=>{switch(Se.key()){case"editNamedReference":return o.themeIcon(e.jsx(o.CellSelectionEditIcon,{}));case"deleteNamedReference":return o.themeIcon(e.jsx(o.CellSelectionRemoveIcon,{}));default:return o.themeIcon(e.jsx(o.CellSelectionIcon,{}))}}})):se==="table"&&Y.push(a.createElement(o.SimpleCommandPopupButton,{...Q,key:"namedItem-"+Y.length,popupCommandKeys:W,popupScope:"namedItem",scope:"namedItem",commands:s?.commands,commandState:xe,label:xe.getName(),quickCommand:"selectNamed",disabled:!Ee||f,icon:Se=>(Se.key(),o.themeIcon(e.jsx(o.InsertTableIcon,{})))}))}const be=e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...u,children:[w?null:e.jsx(o.CommandButton,{...Q,scope:"namedItem",command:s?.commands.getCommand("addNamedReference"),icon:o.themeIcon(e.jsx(o.CellSelectionInsertIcon,{}))}),Y&&Y.length>0?e.jsxs(e.Fragment,{children:[w?null:e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(B.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:Y})]}):null]});return o.defaultCreatePopupPanel({...U,children:be})},[r,L,t,b,w]),q=k.useImperativeElement(i,()=>({focus(U){M.current?.focus(U)}}),[]);return e.jsx(B.Box,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...d},ref:Dt([q,i]),...u,children:e.jsx(o.ExhibitPopupIconButton,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...d},buttonProps:{sx:{backgroundColor:U=>U.palette.background.paper,backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`}},tabIndex:-1,outlined:{color:U=>n?U.palette.action.disabled:G.alpha(U.palette.divider,.2)},parentFloat:x,createPopupPanel:X,onPopupOpen:()=>y(!0),onPopupClose:()=>y(!1),createTooltip:({children:U},Q)=>e.jsx(o.ExhibitTooltip,{title:Q||C?"":"Name Box",disabled:Q,leaveDelay:0,sx:{opacity:Q||C?0:1},children:U}),createQuickButton:R})})}));Yo.displayName="NamedCollectionEditor";const $l=(l,i)=>e.jsx(Yo,{ref:i,...l}),Zo=a.memo(a.forwardRef((l,i)=>{const{sx:n,workbook:t,sheetElement:r,gridStyle:c,showNamedCollectionEditor:m=!0,NamedCollectionEditorProps:f,renderNamedCollectionEditor:s=$l,disabled:d,commands:h,...u}=l,[b,p]=a.useState(t?.getSelectedSheet());le.useModelListener(t,{onSheetsChange:W=>{p(W?.getSelectedSheet())},onViewChange(W){p(W?.getSelectedSheet())}});const[g,S]=a.useState(b.getSelection().getCoords().cell),C=b.getRange(g).getCell(),y=d||!C.isEditAllowed(),x=a.useRef(null),w=a.useMemo(()=>({fontSize:11}),[]);le.useModelListener(b.getSelection(),{onChange:()=>{S(b.getSelection().getCoords().cell)}}),le.useModelListener(b,{onProtectionChange(){S(b.getSelection().getCoords().cell)}});const j=x.current?.getLineHeight()??20,[T,E]=a.useState(j),[I,D]=a.useState(5),[N,L]=a.useState(1),P=k.useCallbackRef((W,{size:Y})=>{W.preventDefault(),W.stopPropagation();const ne=Math.floor(Y.height/j);E(ne*j+1),ne>1&&D(ne)},[j]),v=k.useCallbackRef((W,{size:Y})=>{const ne=Math.floor(Y.height/j);L(ne)},[j]),F=k.useEditMode(),H=F.getMode();let A=null;H?.key==="edit"&&(A=H.args?.stateAndCoords);const $=a.useMemo(()=>{let W=A?.editState;return W||(W=le.createCellEditStateFromCell(()=>b.getRange(g).getCell())),e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:e.jsx(le.SheetCellEditor,{ref:x,activeCoords:g,sheet:b,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:g})},defaultTextStyle:w,useRichStyling:!1,disabled:y,onChangeEdit:Y=>{if(Y.dirty!==void 0){const ne={sheet:b,coords:g,editState:Y};F.setMode(be=>({...be,args:{...be?.args,stateAndCoords:ne}}))}},editState:W,commands:h,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:N})})},[b,A,g,N,r]),M=a.useRef(null),R=a.useMemo(()=>m?s({names:t.getNames(),workbook:t,...f},M):null,[s,f,m,b,t,y]),K=a.useMemo(()=>e.jsxs(B.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`,border:W=>`solid ${y?W.palette.action.disabled:G.alpha(W.palette.divider,.2)} 1px`},children:[e.jsx(o.ExhibitIconButton,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"warning","aria-label":"cancel-formula-edit",icon:o.themeIcon(e.jsx(o.CloseErrorIcon,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:y||A===null,onMouseDown:W=>{W.button===0&&W.preventDefault()},onClick:()=>{r.cancelEdit()}}),e.jsx(o.ExhibitIconButton,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"primary","aria-label":"commit-formula-edit",icon:o.themeIcon(e.jsx(o.CheckSuccessIcon,{})),tooltipProps:{label:"Enter",simple:!0},disabled:y||A===null,onMouseDown:W=>{W.button===0&&W.preventDefault()},onClick:()=>{r.submitEdit()}}),e.jsx(o.ExhibitIconButton,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,disabled:!0,"aria-label":"commit-formula-function",icon:o.themeIcon(e.jsx(o.FunctionIcon,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:W=>{W.button===0&&W.preventDefault()}})]}),[y,A]),X=G.useTheme(),[q,U]=a.useState(!1),Q=a.useMemo(()=>e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:W=>W.spacing(.5),alignItems:"start"},children:[K,e.jsxs(B.Paper,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:W=>W.typography.fontFamily,fontSize:11*O.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:W=>`${W.shape.borderRadius}px`,backgroundImage:`linear-gradient(${G.alpha("#fff",G.getOverlayAlpha(5))}, ${G.alpha("#fff",G.getOverlayAlpha(5))})`,border:W=>`solid ${y?W.palette.action.disabled:G.alpha(W.palette.divider,.2)} 1px`,"& textarea":{color:W=>y?`${W.palette.text.disabled} !important`:W.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:()=>U(!0),onBlur:()=>U(!1),onMouseDown:W=>{W.target?.classList.contains("react-resizable-handle")&&W.preventDefault()},children:[e.jsx(B.Box,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:W=>W.spacing(1),paddingRight:W=>W.spacing(1)},children:e.jsx(Vl.ResizableBox,{height:T,draggableOpts:{grid:[j,j]},minConstraints:[j,j],maxConstraints:[15*j,15*j],onResize:v,onResizeStop:P,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:$})}),e.jsx(o.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:o.themeIcon(N>1?e.jsx(me.ExpandLess,{}):e.jsx(me.ExpandMore,{})),tooltipProps:{label:(N>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:W=>{W.button===0&&W.preventDefault()},onClick:()=>{const W=N>1?1:I;E(W*j+1),L(W)}}),e.jsx(B.Box,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:q?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:W=>W.palette.primary.main,borderRadius:W=>`${W.shape.borderRadius}px`}})]})]}),[K,$,q,N,j]),ee=a.useMemo(()=>R||Q?!R&&Q?Q:R&&!Q?R:e.jsx(e.Fragment,{children:e.jsx(k.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 6.5px",minWidth:"18px"}},elementBefore:R,elementAfter:Q})}):null,[R,Q]),_=k.useImperativeElement(i,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>M.current}),[]);return e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",gap:W=>W.spacing(.5),...n},ref:_,...u,children:ee})}));Zo.displayName="FormulaBar";const Jo=a.memo(a.forwardRef((l,i)=>{const{filter:n,commands:t,disabled:r,sx:c,floatReference:m,...f}=l,s=a.useMemo(()=>({}),[]),d=a.useMemo(()=>({commandHook:{beforeExecute:(b,p)=>m.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:m}),[r,m]),h=a.useMemo(()=>({...s,...d,variant:k.CommandButtonType.Menuitem}),[s,d]),u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:t.getCommand("sortAscending"),icon:o.themeIcon(e.jsx(o.SortIncreaseIcon,{}))}),e.jsx(o.CommandButton,{...h,command:t.getCommand("sortDescending"),icon:o.themeIcon(e.jsx(o.SortDecreaseIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:t.getCommand("autoFilterClear"),icon:o.themeIcon(e.jsx(o.FilterClearIcon,{}))}),[]]});return e.jsx(B.Box,{ref:i,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...c},...f,children:u})}));Jo.displayName="FilterColumnMenu";const ha=a.memo(a.forwardRef((l,i)=>{const{children:n,className:t,disabled:r,style:c,filter:m,...f}=l,s=k.useImperativeElement(i,()=>({isFilters:()=>!0}),[]);return e.jsx("div",{ref:s,className:fe("filters",t),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...c},...f,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:m.getName()}),e.jsx("div",{children:"Filter Widget"})]})})}));ha.displayName="Filters";const Qo=a.memo(a.forwardRef((l,i)=>{const{children:n,sheet:t,style:r,className:c,value:m,index:f,editing:s,editable:d,disabled:h,selectedIndex:u,dragging:b,borderColor:p,borderWidth:g,activeColor:S,background:C="white",tabRadius:y=4,gridTheme:x,...w}=l,[j,T]=a.useState(()=>!!t&&t.getProtection().isLocked()),[E,I]=a.useState(()=>t?t.getTabColor():null);le.useModelListener(t,{onProtectionChange:()=>{T(t.getProtection().isLocked())},onTabColorChange:()=>{I(t.getTabColor())},onStyleChange:()=>{I(t.getTabColor())}});const D=G.useTheme(),N=u===f;let L=null,P=null;if(E||b){let H=C;E?(P=E.toBlackOrWhite().toCSS(),H=E?.toCSS()):N||(H=D.palette.background.paper),L=e.jsx(B.Box,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:N?"50%":"100%",borderRadius:"4px",border:A=>N?`${C} solid 1px`:`${A.palette.divider} solid 1px`,background:N&&E?`linear-gradient(0deg, ${H} 0%, transparent)`:H}})}let v=null;typeof p=="string"?v=p:p?.toCSS&&(v=p.toCSS());const F=N?e.jsx(B.Box,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:H=>H.palette.primary.main}}):null;return e.jsx(G.ThemeProvider,{theme:N?x??D:D,children:e.jsx(B.Box,{ref:i,className:fe(c),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:N?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:b?"grabbing":void 0},...w,children:e.jsx(k.RoundedTab,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:y,strokeColor:N?v:"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:N?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:b?"grabbing":void 0,color:N?"primary":P||"text.secondary",backgroundColor:N?C:"transparent","&:hover:not([disabled])":{backgroundColor:N?C:"transparent"},"& input":{color:H=>`${H.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:h,disableRipple:s,component:"div",children:e.jsxs(e.Fragment,{children:[L,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:N?void 0:"1px"},children:[n,F]}),j?e.jsx(me.Lock,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):e.jsx(B.Box,{sx:{minHeight:"22px"}})]})]})},m+":"+f)})})})}));Qo.displayName="SheetTab";const en=a.memo(a.forwardRef((l,i)=>{const{workbook:n,index:t,commands:r,scope:c="sheet",disabled:m,floatReference:f,sx:s,className:d,tabStripRef:h,...u}=l,[b,p]=a.useState(n?.getProtection());le.useModelListener(n,{onProtectionChange:x=>{p(x?.getProtection())}});const g=a.useMemo(()=>({}),[]),S=a.useMemo(()=>({commandHook:{beforeExecute:(x,w)=>f.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:c,commandState:t,disabled:m||t===void 0,parentFloat:f}),[m,f]),C=a.useMemo(()=>({...g,...S}),[g,S]),y=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{command:r.getCommand("addSheet"),commandState:t,...C,variant:k.CommandButtonType.Menuitem}),e.jsx(o.CommandButton,{command:r.getCommand("deleteSheet"),...C,variant:k.CommandButtonType.Menuitem}),e.jsxs(o.ExhibitMenuItem,{onMouseDown:x=>{x.button===0&&x.preventDefault()},onMouseUp:()=>{Promise.resolve(f.closeAll()).then(()=>{h?.startEdit(t)})},disabled:m||!b.isStructureAllowed(),parentFloat:f,children:["Rename",c!=="sheet"?" Sheet":""]}),e.jsx(o.CommandButton,{command:r.getCommand("duplicateSheet"),...C,variant:k.CommandButtonType.Menuitem}),e.jsx(o.CommandButton,{command:r?.getCommand("protectionSheetToggle"),...C,variant:k.CommandButtonType.Menuitem,icon:e.jsx(me.Lock,{})}),e.jsx(ut,{variant:k.CommandButtonType.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:e.jsx(o.ColorizedStrokeIcon,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:dt.End},parentFloat:f}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{command:r.getCommand("hideSheet"),...C,variant:k.CommandButtonType.Menuitem,icon:o.themeIcon(e.jsx(o.VisibilityOffIcon,{}))})]});return e.jsx(B.Box,{ref:i,className:fe("menu",d),sx:{...s},...u,children:y})}));en.displayName="SheetTabMenu";const tn=a.memo(a.forwardRef((l,i)=>{const{workbook:n,gridStyle:t,floatReference:r,closeFloatAll:c,className:m,...f}=l,[s,d]=a.useState(n?.getSheets().getItems()),[h,u]=a.useState(n?.getProtection());le.useModelListener(n,{onSheetsChange:p=>{d(p.getSheets().getItems())},onProtectionChange:p=>{u(p?.getProtection())}});const b=a.useMemo(()=>{const p=[],g=n.getSheets().getItems({visibility:O.ISheet.Visibility.Hidden}),S=n.getSelectedSheet();for(let C=0;C<g.length;C++){const y=g[C],x=y.getVisibility();if(x===O.ISheet.Visibility.VeryHidden)continue;const w=S===y,j=y.getProtection().isLocked(),T=y.getTabColor(),E=t?.body.fill??"transparent";let I=null,D=null,N=E;T&&(N=T.toCSS(),w||(D=T.toBlackOrWhite().toCSS()),I=e.jsx(B.Box,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:w?N:"transparent",borderRadius:"4px",border:`solid 1px ${t.header.edgeStrokeFill}`},children:e.jsx(B.Box,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:w||x===O.ISheet.Visibility.Hidden?"50%":"100%",border:P=>w?`${E} solid 1.5px`:`${P.palette.divider} solid 1px`,background:w&&T?`linear-gradient(0deg, ${N} 0%, ${E})`:N,borderRadius:"4px"}})}));let L=null;j&&(L=e.jsx(me.Lock,{color:"secondary"})),x!==O.ISheet.Visibility.Visible&&(L=o.themeIcon(e.jsx(o.VisibilityOffIcon,{style:{opacity:h.isStructureAllowed()?1:.7},color:"secondary"}))),L&&(L=e.jsx(B.Box,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:L})),p.push(e.jsx(o.ExhibitMenuItem,{disabled:!h.isStructureAllowed()&&x===O.ISheet.Visibility.Hidden,sx:{color:P=>{let v=w?P.palette.primary.main:P.palette.text.secondary;return D&&(v=D),x===O.ISheet.Visibility.Hidden&&(v=Re.alpha(v,P.palette.action.disabledOpacity)),v},borderLeft:P=>`${w?P.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:w?"700":"400","&:hover":{fontWeight:"700"}},icon:w?e.jsx(o.SelectedIcon,{}):void 0,onMouseDown:P=>P.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{y.select()}catch(P){console.error(P)}})},children:e.jsxs(e.Fragment,{children:[I,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:[y.getName(),e.jsx(B.Box,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:y.getName()})]}),L]})]})},""+C))}return p},[n,h,s,r,t]);return e.jsx(B.Box,{ref:i,className:fe("menu",m),...f,children:b})}));tn.displayName="SheetsAllMenu";let _t=!1,fa=!1,Ke=null;const Qn=async l=>{const i=await O.LicenseManager.getDetails();if(fa||i.isEval()){try{const n=top??window;n.SheetXL||(n.SheetXL=Object.freeze({getSelectedWorkbook:()=>Ke?.getWorkbook(),getSelectedSheet:()=>Ke?.getWorkbook().getSelectedSheet(),getSelectedRange:()=>Ke?.getWorkbook().getSelectedRange(),getRange:t=>Ke?.getWorkbook().getRange(t),getSelectedWorkbookElement:()=>Ke,getLicenseManager:()=>O.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().updateStyle({ fill: 'accent4' })":{Summary:"Set fill to theme color 4."},"SheetXL.getRange('E:L').updateStyle({ fill: 'accent1 lumMod 90 lumOff 40' })":{Summary:"Set some columns to a modified theme color."},"SheetXL.getRange('e5:f10').updateStyle({ 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).updateStyle({ 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').updateStyle({ 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(n){n instanceof DOMException||console.error(n),_t=!0}if(Ke!==l&&(Ke=l,!_t))try{_t=!0,(top??window).SheetXL&&(await O.LicenseManager._validate(!0),O.LicenseManager.wasPrinted()&&(()=>{Fe.CommonUtils.consoleWithNoSource(`%cTip: You can access the API directly in the console.
@@ -15,6 +15,6 @@ Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modif
15
15
  10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},Ei=function(){return a.createElement(so,null,a.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},Ii=function(){return a.createElement(so,null,a.createElement("path",{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
16
16
  6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
17
17
  13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},Ri=function(){return a.createElement(so,null,a.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
18
- 0 22,12A10,10 0 0,0 12,2Z`}))},Ye={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:a.createElement(Bi,null),warning:a.createElement(Ei,null),error:a.createElement(Ii,null),info:a.createElement(Ri,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:Aa,transitionDuration:{enter:225,exit:195}},Mi=function(l,i){return function(n,t){return t===void 0&&(t=!1),t?he({},Ye[n],{},i[n],{},l[n]):n==="autoHideDuration"?(r=l.autoHideDuration,c=i.autoHideDuration,(m=function(f){return typeof f=="number"||f===null})(r)?r:m(c)?c:Ye.autoHideDuration):n==="transitionDuration"?function(f,s){var d=function(h,u){return u.some(function(b){return typeof h===b})};return d(f,["string","number"])?f:d(f,["object"])?he({},Ye.transitionDuration,{},d(s,["object"])&&s,{},f):d(s,["string","number"])?s:d(s,["object"])?he({},Ye.transitionDuration,{},s):Ye.transitionDuration}(l.transitionDuration,i.transitionDuration):l[n]||i[n]||Ye[n];var r,c,m}};function Nt(l){return Object.entries(l).reduce(function(i,n){var t,r=n[0],c=n[1];return he({},i,((t={})[r]=Oo(c),t))},{})}var Pi="notistack-SnackbarContainer",Di="notistack-Snackbar",Oa="notistack-CollapseWrapper",Fi="notistack-MuiContent",Ni=function(l){return"notistack-MuiContent-"+l},xr=Nt({root:{height:0},entered:{height:"auto"}}),Io="0px",La=a.forwardRef(function(l,i){var n=l.children,t=l.in,r=l.onExited,c=a.useRef(null),m=a.useRef(null),f=Lo(i,m),s=function(){return c.current?c.current.clientHeight:0};return a.createElement(un,{in:t,unmountOnExit:!0,onEnter:function(d){d.style.height=Io},onEntered:function(d){d.style.height="auto"},onEntering:function(d){var h=s(),u=no({timeout:175,mode:"enter"}),b=u.duration,p=u.easing;d.style.transitionDuration=typeof b=="string"?b:b+"ms",d.style.height=h+"px",d.style.transitionTimingFunction=p||""},onExit:function(d){d.style.height=s()+"px"},onExited:r,onExiting:function(d){Fa(d);var h=no({timeout:175,mode:"exit"}),u=h.duration,b=h.easing;d.style.transitionDuration=typeof u=="string"?u:u+"ms",d.style.height=Io,d.style.transitionTimingFunction=b||""},nodeRef:m,timeout:175},function(d,h){return a.createElement("div",Object.assign({ref:f,className:$e(xr.root,d==="entered"&&xr.entered),style:he({pointerEvents:"all",overflow:"hidden",minHeight:Io,transition:ct("height")},d==="entered"&&{overflow:"visible"},{},d==="exited"&&!t&&{visibility:"hidden"})},h),a.createElement("div",{ref:c,className:Oa,style:{display:"flex",width:"100%"}},n))})});La.displayName="Collapse";var br={right:"left",left:"right",bottom:"up",top:"down"},Ai=function(l){return"anchorOrigin"+mn(l)},Oi=function(){};function Rt(l,i){return l.reduce(function(n,t){return t==null?n:function(){for(var r=arguments.length,c=new Array(r),m=0;m<r;m++)c[m]=arguments[m];var f=[].concat(c);i&&f.indexOf(i)===-1&&f.push(i),n.apply(this,f),t.apply(this,f)}},Oi)}var Li=typeof window<"u"?a.useLayoutEffect:a.useEffect;function yr(l){var i=a.useRef(l);return Li(function(){i.current=l}),a.useCallback(function(){return i.current.apply(void 0,arguments)},[])}var Ro,Ha=a.forwardRef(function(l,i){var n=l.children,t=l.className,r=l.autoHideDuration,c=l.disableWindowBlurListener,m=c!==void 0&&c,f=l.onClose,s=l.id,d=l.open,h=l.SnackbarProps,u=h===void 0?{}:h,b=a.useRef(),p=yr(function(){f&&f.apply(void 0,arguments)}),g=yr(function(y){f&&y!=null&&(b.current&&clearTimeout(b.current),b.current=setTimeout(function(){p(null,"timeout",s)},y))});a.useEffect(function(){return d&&g(r),function(){b.current&&clearTimeout(b.current)}},[d,r,g]);var S=function(){b.current&&clearTimeout(b.current)},C=a.useCallback(function(){r!=null&&g(.5*r)},[r,g]);return a.useEffect(function(){if(!m&&d)return window.addEventListener("focus",C),window.addEventListener("blur",S),function(){window.removeEventListener("focus",C),window.removeEventListener("blur",S)}},[m,C,d]),a.createElement("div",Object.assign({ref:i},u,{className:$e(Di,t),onMouseEnter:function(y){u.onMouseEnter&&u.onMouseEnter(y),S()},onMouseLeave:function(y){u.onMouseLeave&&u.onMouseLeave(y),C()}}),n)});Ha.displayName="Snackbar";var Hi=Nt({root:(Ro={display:"flex",flexWrap:"wrap",flexGrow:1},Ro[eo]={flexGrow:"initial",minWidth:"288px"},Ro)}),pn=a.forwardRef(function(l,i){var n=l.className,t=Ft(l,["className"]);return a.createElement("div",Object.assign({ref:i,className:$e(Hi.root,n)},t))});pn.displayName="SnackbarContent";var Tt=Nt({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"}}),Cr="notistack-snackbar",za=a.forwardRef(function(l,i){var n=l.id,t=l.message,r=l.action,c=l.iconVariant,m=l.variant,f=l.hideIconVariant,s=l.style,d=l.className,h=c[m],u=r;return typeof u=="function"&&(u=u(n)),a.createElement(pn,{ref:i,role:"alert","aria-describedby":Cr,style:s,className:$e(Fi,Ni(m),Tt.root,Tt[m],d,!f&&h&&Tt.lessPadding)},a.createElement("div",{id:Cr,className:Tt.message},f?null:h,t),u&&a.createElement("div",{className:Tt.action},u))});za.displayName="MaterialDesignContent";var Bt,Mo,Xt,Yt,Po,zi=a.memo(za),Wi=Nt({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),Vi=function(l){var i=a.useRef(),n=a.useState(!0),t=n[0],r=n[1],c=Rt([l.snack.onClose,l.onClose]),m=a.useCallback(function(){i.current=setTimeout(function(){r(function(D){return!D})},125)},[]);a.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var f,s=l.snack,d=l.classes,h=l.Component,u=h===void 0?zi:h,b=a.useMemo(function(){return function(D){D===void 0&&(D={});var N={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(D).filter(function(L){return!N[L]}).reduce(function(L,P){var v;return he({},L,((v={})[P]=D[P],v))},{})}(d)},[d]),p=s.open,g=s.SnackbarProps,S=s.TransitionComponent,C=s.TransitionProps,y=s.transitionDuration,x=s.disableWindowBlurListener,w=s.content,j=Ft(s,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),T=he({direction:(f=j.anchorOrigin,f.horizontal!=="center"?br[f.horizontal]:br[f.vertical]),timeout:y},C),E=w;typeof E=="function"&&(E=E(j.id,j.message));var I=["onEnter","onEntered","onExit","onExited"].reduce(function(D,N){var L;return he({},D,((L={})[N]=Rt([l.snack[N],l[N]],j.id),L))},{});return a.createElement(La,{in:t,onExited:I.onExited},a.createElement(Ha,{open:p,id:j.id,disableWindowBlurListener:x,autoHideDuration:j.autoHideDuration,className:$e(Wi.wrappedRoot,b.root,b[Ai(j.anchorOrigin)]),SnackbarProps:g,onClose:c},a.createElement(S,Object.assign({},T,{appear:!0,in:p,onExit:I.onExit,onExited:m,onEnter:I.onEnter,onEntered:Rt([I.onEntered,function(){l.snack.requestClose&&c(null,"instructed",l.snack.id)}],j.id)}),E||a.createElement(u,Object.assign({},j)))))},Et={default:20},Zt={default:6,dense:2},Sr="."+Oa,Jt=Nt({root:(Bt={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:ct(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},Bt[Sr]={padding:Zt.default+"px 0px",transition:"padding 300ms ease 0ms"},Bt.maxWidth="calc(100% - "+2*Et.default+"px)",Bt[Eo]={width:"100%",maxWidth:"calc(100% - 32px)"},Bt),rootDense:(Mo={},Mo[Sr]={padding:Zt.dense+"px 0px"},Mo),top:{top:Et.default-Zt.default+"px",flexDirection:"column"},bottom:{bottom:Et.default-Zt.default+"px",flexDirection:"column-reverse"},left:(Xt={left:Et.default+"px"},Xt[eo]={alignItems:"flex-start"},Xt[Eo]={left:"16px"},Xt),right:(Yt={right:Et.default+"px"},Yt[eo]={alignItems:"flex-end"},Yt[Eo]={right:"16px"},Yt),center:(Po={left:"50%",transform:"translateX(-50%)"},Po[eo]={alignItems:"center"},Po)}),$i=function(l){var i=l.classes,n=i===void 0?{}:i,t=l.anchorOrigin,r=l.dense,c=l.children,m=$e(Pi,Jt[t.vertical],Jt[t.horizontal],Jt.root,n.containerRoot,n["containerAnchorOrigin"+mn(t)],r&&Jt.rootDense);return a.createElement("div",{className:m},c)},Ui=a.memo($i),wr=function(l){return!(typeof l=="string"||a.isValidElement(l))},_i=function(l){function i(n){var t;return(t=l.call(this,n)||this).enqueueSnackbar=function(r,c){if(c===void 0&&(c={}),r==null)throw new Error("enqueueSnackbar called with invalid argument");var m=wr(r)?r:c,f=wr(r)?r.message:r,s=m.key,d=m.preventDuplicate,h=Ft(m,["key","preventDuplicate"]),u=qt(s),b=u?s:new Date().getTime()+Math.random(),p=Mi(h,t.props),g=he({id:b},h,{message:f,open:!0,entered:!1,requestClose:!1,persist:p("persist"),action:p("action"),content:p("content"),variant:p("variant"),anchorOrigin:p("anchorOrigin"),disableWindowBlurListener:p("disableWindowBlurListener"),autoHideDuration:p("autoHideDuration"),hideIconVariant:p("hideIconVariant"),TransitionComponent:p("TransitionComponent"),transitionDuration:p("transitionDuration"),TransitionProps:p("TransitionProps",!0),iconVariant:p("iconVariant",!0),style:p("style",!0),SnackbarProps:p("SnackbarProps",!0),className:$e(t.props.className,h.className)});return g.persist&&(g.autoHideDuration=void 0),t.setState(function(S){if(d===void 0&&t.props.preventDuplicate||d){var C=function(w){return u?w.id===b:w.message===f},y=S.queue.findIndex(C)>-1,x=S.snacks.findIndex(C)>-1;if(y||x)return S}return t.handleDisplaySnack(he({},S,{queue:[].concat(S.queue,[g])}))}),b},t.handleDisplaySnack=function(r){return r.snacks.length>=t.maxSnack?t.handleDismissOldest(r):t.processQueue(r)},t.processQueue=function(r){var c=r.queue,m=r.snacks;return c.length>0?he({},r,{snacks:[].concat(m,[c[0]]),queue:c.slice(1,c.length)}):r},t.handleDismissOldest=function(r){if(r.snacks.some(function(s){return!s.open||s.requestClose}))return r;var c=!1,m=!1;r.snacks.reduce(function(s,d){return s+(d.open&&d.persist?1:0)},0)===t.maxSnack&&(m=!0);var f=r.snacks.map(function(s){return c||s.persist&&!m?he({},s):(c=!0,s.entered?(s.onClose&&s.onClose(null,"maxsnack",s.id),t.props.onClose&&t.props.onClose(null,"maxsnack",s.id),he({},s,{open:!1})):he({},s,{requestClose:!0}))});return he({},r,{snacks:f})},t.handleEnteredSnack=function(r,c,m){if(!qt(m))throw new Error("handleEnteredSnack Cannot be called with undefined key");t.setState(function(f){return{snacks:f.snacks.map(function(s){return s.id===m?he({},s,{entered:!0}):he({},s)})}})},t.handleCloseSnack=function(r,c,m){t.props.onClose&&t.props.onClose(r,c,m);var f=m===void 0;t.setState(function(s){var d=s.snacks,h=s.queue;return{snacks:d.map(function(u){return f||u.id===m?u.entered?he({},u,{open:!1}):he({},u,{requestClose:!0}):he({},u)}),queue:h.filter(function(u){return u.id!==m})}})},t.closeSnackbar=function(r){var c=t.state.snacks.find(function(m){return m.id===r});qt(r)&&c&&c.onClose&&c.onClose(null,"instructed",r),t.handleCloseSnack(null,"instructed",r)},t.handleExitedSnack=function(r,c){if(!qt(c))throw new Error("handleExitedSnack Cannot be called with undefined key");t.setState(function(m){var f=t.processQueue(he({},m,{snacks:m.snacks.filter(function(s){return s.id!==c})}));return f.queue.length===0?f:t.handleDismissOldest(f)})},t.enqueueSnackbar,t.closeSnackbar,t.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:t.enqueueSnackbar.bind(mr(t)),closeSnackbar:t.closeSnackbar.bind(mr(t))}},t}return Pa(i,l),i.prototype.render=function(){var n=this,t=this.state.contextValue,r=this.props,c=r.domRoot,m=r.children,f=r.dense,s=f!==void 0&&f,d=r.Components,h=d===void 0?{}:d,u=r.classes,b=this.state.snacks.reduce(function(g,S){var C,y=mn(S.anchorOrigin),x=g[y]||[];return he({},g,((C={})[y]=[].concat(x,[S]),C))},{}),p=Object.keys(b).map(function(g){var S=b[g],C=S[0];return a.createElement(Ui,{key:g,dense:s,anchorOrigin:C.anchorOrigin,classes:u},S.map(function(y){return a.createElement(Vi,{key:y.id,snack:y,classes:u,Component:h[y.variant],onClose:n.handleCloseSnack,onEnter:n.props.onEnter,onExit:n.props.onExit,onExited:Rt([n.handleExitedSnack,n.props.onExited],y.id),onEntered:Rt([n.handleEnteredSnack,n.props.onEntered],y.id)})}))});return a.createElement(Da.Provider,{value:t},m,c?Je.createPortal(p,c):p)},Ma(i,[{key:"maxSnack",get:function(){return this.props.maxSnack||Ye.maxSnack}}]),i}(a.Component),Wa=function(){return a.useContext(Da)};const qi=[{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}],Ki=[{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 Va{constructor(i=qi,n=Ki){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...i]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const i=[],n=this._readFormatType;for(let t=0;t<n.length;t++)for(let r=0;r<n[t].exts.length;r++)i.push("."+n[t].exts[r]);return i}async writeFile(i,n,t){if(!n||!i)throw new Error("Workbook model or file name must be provided.");try{return(await import("@sheetxl/io")).WorkbookIO.writeFile(i,n,t)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(i,n){let t,r;const c=await n?.showBusy?.(`Opening${i.name?` ${i.name}`:""}...`);try{r=await import("@sheetxl/io")}catch(m){throw m}try{return await r.WorkbookIO.read({...i,async onStart(m){await i?.onStart?.(m),t=await n?.showBusy?.(`Opening '${m}'...`)}})}catch(m){throw c?.(),t?.(),m}finally{c?.(),t?.()}}}const Ve=new Va,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"},$a=a.forwardRef((l,i)=>{const{id:n,message:t,iconVariant:r,error:c,hideIconVariant:m,...f}=l,{closeSnackbar:s}=Wa(),d=G.useTheme(),[h,u]=a.useState(!1),b=a.useCallback(()=>{u(S=>!S)},[]),p=a.useCallback(()=>{s(n)},[n,s]);let g=c?.message;return!g&&a.isValidElement(t)&&(g=t),g||typeof t!="string"||(g=t),g||(g=`Unknown Error: ${t}`),e.jsx(pn,{ref:i,className:fe(Le.root,"error-snackbar"),children:e.jsxs(B.Card,{className:Le.card,style:{backgroundColor:d.palette.error.dark,border:`1px solid ${d.palette.error.dark}`},children:[e.jsxs(B.CardActions,{className:Le.actionRoot,children:[m?null:r?.error,e.jsx(B.Typography,{variant:"body2",component:"div",className:Le.typography,style:{color:d.palette.text.primary},children:g}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsxs("div",{className:Le.icons,children:[c?e.jsx(B.IconButton,{"aria-label":"Show more",size:"small",className:fe(Le.expand,{[Le.expandOpen]:h}),style:{color:d.palette.action.active},onClick:b,children:e.jsx(me.ExpandMore,{})}):null,e.jsx(B.IconButton,{size:"small",className:Le.expand,style:{color:d.palette.action.active},onClick:p,children:e.jsx(me.Close,{fontSize:"small"})})]})]}),c?e.jsx(B.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx("div",{className:Le.stackTraceContainer,style:{backgroundColor:d.palette.error.light,borderTop:`1px solid ${d.palette.error.main}`},children:e.jsx(o.StackTrace,{error:c,hideLineNumbers:!0})})}):null]})})});$a.displayName="ToastError";const Ua=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r="workbook",disabled:c=!1,...m}=l,f=k.useCallbackRef(d=>{const h={variant:k.CommandButtonType.Menuitem,parentFloat:d.floatReference,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:n.getCommand("newWorkbook"),icon:o.themeIcon(e.jsx(o.FileNewIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:n.getCommand("openWorkbook"),icon:o.themeIcon(e.jsx(o.FileOpenIcon,{}))}),e.jsx(o.CommandPopupButton,{...h,commands:n,quickCommand:"saveWorkbook",icon:o.themeIcon(e.jsx(o.FileDownloadAsSheetIcon,{})),createPopupPanel:b=>{const p={...h,parentFloat:b.floatReference,scope:"saveWorkbook"},g=[];return Ve.getWriteFormats().forEach(S=>{if(S.isDefault)return;let C=null;S.key==="CSV"?C=o.themeIcon(e.jsx(o.FileDownloadAsCSVIcon,{})):S.key==="Excel"&&(C=o.themeIcon(e.jsx(o.FileDownloadAsExcelIcon,{})));const y=n.getCommand(`saveWorkbookAs${S.key}`);y?g.push(a.createElement(o.CommandButton,{...p,key:S.key,command:y,icon:C})):console.warn(`Unable to resolve command: 'saveWorkbookAs${S.key}'`)}),o.defaultCreatePopupPanel({...b,children:g,onClick:()=>{b.closeFloatAll()}})}})]});return o.defaultCreatePopupPanel({...d,children:u,onClick:b=>{b.isDefaultPrevented||d.closeFloatAll()}})},[c,n,t,r]),s="File";return e.jsx(o.CommandPopupButton,{commands:n,disabled:c,commandHook:t,scope:r,label:s,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:d=>`calc(1.25rem + ${d.spacing(2)}px)`}},...m,createPopupPanel:f,icon:e.jsx(o.LabelIcon,{className:"label",icon:null,label:s})})}));Ua.displayName="StandaloneFileCommandButton";const Gi=e.jsx(o.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(le.LogoNoPaddingIcon,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),_a=a.memo(a.forwardRef((l,i)=>{const{commands:n,workbook:t,logo:r=Gi,mainElement:c,showFileMenu:m=!0,showAppearanceMenu:f=!0,...s}=l,{reference:d}=o.useFloatStack(),[h,{width:u}]=pt(),b=u<530,p=m?e.jsx(Ua,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(y,x,w){}}}):null,g=f?e.jsx(na,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(y,x,w){}}}):null,S=a.useMemo(()=>({paddingLeft:y=>y.spacing(1),paddingRight:y=>y.spacing(1)}),[]),C=a.useRef(null);return e.jsx(B.Box,{ref:Dt([C,h,i]),...s,children:va({commands:n,renderCompact:b,workbook:t,selectWrapper:y=>e.jsxs(B.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:x=>x.spacing(1),paddingLeft:x=>x.spacing(1),paddingRight:x=>x.spacing(1)},children:[e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:x=>x.spacing(.5)},children:[r,e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:x=>x.spacing(.25)},children:[p,y]})]}),e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:c}),e.jsx(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:b&&!g?"0 0 auto":"1 1 100%"},children:g})]}),selectProps:S,toolbarsProps:{Home:{sx:{}}}})})}));_a.displayName="StudioToolbar";const qa=a.memo(a.forwardRef((l,i)=>{const{workbook:n,setWorkbook:t,refWorkbookTitle:r,titleWorkbook:c,setWorkbookTitle:m,titlePlaceHolder:f,children:s,undoManager:d,commands:h,importExportDisabled:u,themeOptions:b}=l,p=Wa(),g=p?p.enqueueSnackbar:()=>{},S=p?p.closeSnackbar:()=>{},[C,y]=a.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),x=a.useCallback(()=>{y($=>({...$,isMounted:!0}))},[]),w=a.useCallback(()=>{y($=>({...$,isMounted:!1}))},[]),j={},T=o.useLazyWindow(j),E=o.useOptionsDialog(j),I=o.useInputDialog(j),D=a.useRef(new Set),N=a.useMemo(()=>{const $=(M,R)=>{if(R?.onceKey){if(D.current.has(R.onceKey))return;const X=new Set(D.current);X.add(R.onceKey),D.current=X}const K={variant:R?.type??k.NotificationType.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:R?.preventDuplicate,persist:R?.persist??R?.type===k.NotificationType.Error,action:X=>e.jsx(B.IconButton,{onClick:()=>S(X),children:e.jsx(me.CancelOutlined,{})})};R?.enqueueProps&&Object.assign(K,R.enqueueProps),M||console.log("message is 'null'",R),g(M??"Alert",K)};return{showMessage:$,showBusy:(M,R)=>{let K=null;const X=new Promise(q=>{K=q});return y(q=>{const U=new Map(q.starting);return U.set(X,K),{...q,label:M,starting:U}}),X},showWindow:(M,R,K)=>{const X={...R,onKeyDown:q=>{h?.dispatchToFocusedCommand(q),q.isDefaultPrevented()||q.isPropagationStopped()||R?.onKeyDown?.(q)}};return T(M,{sort:()=>Promise.resolve().then(()=>require("./CqJQRL5PzY9CTI4-.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./C8v3yyzRLldglsXV.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./CF_rsS-lCC6D_2Zp.cjs")),comments:()=>Promise.resolve().then(()=>require("./BKddoLqJCGvXmAq8.cjs")),find:()=>Promise.resolve().then(()=>require("./D3f55Nd_Sg45hUpb.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./Tr5gf0umJmqDSX76.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./CUKXTePYz-VIH3Tf.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./BSqdiLlC_z3lDcvH.cjs"))}[M],X,K)},showOptions:E,showInputOptions:I,showError:M=>{let R,K=k.NotificationType.Error,X="Unknown Error";typeof M=="string"?X=M:M instanceof Error&&(R=M,M.message&&(X=M.message)),M instanceof Fe.PartialError&&(K=k.NotificationType.Info),$(X,{type:K,enqueueProps:{error:R}})}}},[]),L=a.useCallback(()=>{},[]),P=($=>{const{workbook:M,setWorkbook:R,importExportDisabled:K,workbookTitle:X="export",setWorkbookTitle:q,notifier:U,requestWorkbookTitle:Q,themeOptions:ee,undoManager:_,commands:W,onExecute:Y}=$,ne=k.useCallbackRef(ee?.onModeChange,[ee?.onModeChange]),be=k.useCallbackRef(ee?.onEnabledDarkGridChange,[ee?.onEnabledDarkGridChange]),ge=k.useCallbackRef(ee?.onEnabledDarkImagesChange,[ee?.onEnabledDarkImagesChange]),xe=k.useCallbackRef(async(re=null,ae=null)=>{const Z=[];let te,ue=null,ie=null;if(typeof re=="string"?ie=re:ue=re,te=ue?re:await Fe.CommonUtils.openFileDialog(ie??Ve.getAllReadFormatTypeAsString().join(",")),!te)return null;const je={source:te,createWorkbookOptions:ae,onWarning:ht=>{Z.push(ht)}},Me=await Ve.read(je,U);return Z.length>0&&(U?.showMessage?.("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
18
+ 0 22,12A10,10 0 0,0 12,2Z`}))},Ye={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:a.createElement(Bi,null),warning:a.createElement(Ei,null),error:a.createElement(Ii,null),info:a.createElement(Ri,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:Aa,transitionDuration:{enter:225,exit:195}},Mi=function(l,i){return function(n,t){return t===void 0&&(t=!1),t?he({},Ye[n],{},i[n],{},l[n]):n==="autoHideDuration"?(r=l.autoHideDuration,c=i.autoHideDuration,(m=function(f){return typeof f=="number"||f===null})(r)?r:m(c)?c:Ye.autoHideDuration):n==="transitionDuration"?function(f,s){var d=function(h,u){return u.some(function(b){return typeof h===b})};return d(f,["string","number"])?f:d(f,["object"])?he({},Ye.transitionDuration,{},d(s,["object"])&&s,{},f):d(s,["string","number"])?s:d(s,["object"])?he({},Ye.transitionDuration,{},s):Ye.transitionDuration}(l.transitionDuration,i.transitionDuration):l[n]||i[n]||Ye[n];var r,c,m}};function Nt(l){return Object.entries(l).reduce(function(i,n){var t,r=n[0],c=n[1];return he({},i,((t={})[r]=Oo(c),t))},{})}var Pi="notistack-SnackbarContainer",Di="notistack-Snackbar",Oa="notistack-CollapseWrapper",Fi="notistack-MuiContent",Ni=function(l){return"notistack-MuiContent-"+l},xr=Nt({root:{height:0},entered:{height:"auto"}}),Io="0px",La=a.forwardRef(function(l,i){var n=l.children,t=l.in,r=l.onExited,c=a.useRef(null),m=a.useRef(null),f=Lo(i,m),s=function(){return c.current?c.current.clientHeight:0};return a.createElement(un,{in:t,unmountOnExit:!0,onEnter:function(d){d.style.height=Io},onEntered:function(d){d.style.height="auto"},onEntering:function(d){var h=s(),u=no({timeout:175,mode:"enter"}),b=u.duration,p=u.easing;d.style.transitionDuration=typeof b=="string"?b:b+"ms",d.style.height=h+"px",d.style.transitionTimingFunction=p||""},onExit:function(d){d.style.height=s()+"px"},onExited:r,onExiting:function(d){Fa(d);var h=no({timeout:175,mode:"exit"}),u=h.duration,b=h.easing;d.style.transitionDuration=typeof u=="string"?u:u+"ms",d.style.height=Io,d.style.transitionTimingFunction=b||""},nodeRef:m,timeout:175},function(d,h){return a.createElement("div",Object.assign({ref:f,className:$e(xr.root,d==="entered"&&xr.entered),style:he({pointerEvents:"all",overflow:"hidden",minHeight:Io,transition:ct("height")},d==="entered"&&{overflow:"visible"},{},d==="exited"&&!t&&{visibility:"hidden"})},h),a.createElement("div",{ref:c,className:Oa,style:{display:"flex",width:"100%"}},n))})});La.displayName="Collapse";var br={right:"left",left:"right",bottom:"up",top:"down"},Ai=function(l){return"anchorOrigin"+mn(l)},Oi=function(){};function Rt(l,i){return l.reduce(function(n,t){return t==null?n:function(){for(var r=arguments.length,c=new Array(r),m=0;m<r;m++)c[m]=arguments[m];var f=[].concat(c);i&&f.indexOf(i)===-1&&f.push(i),n.apply(this,f),t.apply(this,f)}},Oi)}var Li=typeof window<"u"?a.useLayoutEffect:a.useEffect;function yr(l){var i=a.useRef(l);return Li(function(){i.current=l}),a.useCallback(function(){return i.current.apply(void 0,arguments)},[])}var Ro,Ha=a.forwardRef(function(l,i){var n=l.children,t=l.className,r=l.autoHideDuration,c=l.disableWindowBlurListener,m=c!==void 0&&c,f=l.onClose,s=l.id,d=l.open,h=l.SnackbarProps,u=h===void 0?{}:h,b=a.useRef(),p=yr(function(){f&&f.apply(void 0,arguments)}),g=yr(function(y){f&&y!=null&&(b.current&&clearTimeout(b.current),b.current=setTimeout(function(){p(null,"timeout",s)},y))});a.useEffect(function(){return d&&g(r),function(){b.current&&clearTimeout(b.current)}},[d,r,g]);var S=function(){b.current&&clearTimeout(b.current)},C=a.useCallback(function(){r!=null&&g(.5*r)},[r,g]);return a.useEffect(function(){if(!m&&d)return window.addEventListener("focus",C),window.addEventListener("blur",S),function(){window.removeEventListener("focus",C),window.removeEventListener("blur",S)}},[m,C,d]),a.createElement("div",Object.assign({ref:i},u,{className:$e(Di,t),onMouseEnter:function(y){u.onMouseEnter&&u.onMouseEnter(y),S()},onMouseLeave:function(y){u.onMouseLeave&&u.onMouseLeave(y),C()}}),n)});Ha.displayName="Snackbar";var Hi=Nt({root:(Ro={display:"flex",flexWrap:"wrap",flexGrow:1},Ro[eo]={flexGrow:"initial",minWidth:"288px"},Ro)}),pn=a.forwardRef(function(l,i){var n=l.className,t=Ft(l,["className"]);return a.createElement("div",Object.assign({ref:i,className:$e(Hi.root,n)},t))});pn.displayName="SnackbarContent";var Tt=Nt({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"}}),Cr="notistack-snackbar",za=a.forwardRef(function(l,i){var n=l.id,t=l.message,r=l.action,c=l.iconVariant,m=l.variant,f=l.hideIconVariant,s=l.style,d=l.className,h=c[m],u=r;return typeof u=="function"&&(u=u(n)),a.createElement(pn,{ref:i,role:"alert","aria-describedby":Cr,style:s,className:$e(Fi,Ni(m),Tt.root,Tt[m],d,!f&&h&&Tt.lessPadding)},a.createElement("div",{id:Cr,className:Tt.message},f?null:h,t),u&&a.createElement("div",{className:Tt.action},u))});za.displayName="MaterialDesignContent";var Bt,Mo,Xt,Yt,Po,zi=a.memo(za),Wi=Nt({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),Vi=function(l){var i=a.useRef(),n=a.useState(!0),t=n[0],r=n[1],c=Rt([l.snack.onClose,l.onClose]),m=a.useCallback(function(){i.current=setTimeout(function(){r(function(D){return!D})},125)},[]);a.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var f,s=l.snack,d=l.classes,h=l.Component,u=h===void 0?zi:h,b=a.useMemo(function(){return function(D){D===void 0&&(D={});var N={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(D).filter(function(L){return!N[L]}).reduce(function(L,P){var v;return he({},L,((v={})[P]=D[P],v))},{})}(d)},[d]),p=s.open,g=s.SnackbarProps,S=s.TransitionComponent,C=s.TransitionProps,y=s.transitionDuration,x=s.disableWindowBlurListener,w=s.content,j=Ft(s,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),T=he({direction:(f=j.anchorOrigin,f.horizontal!=="center"?br[f.horizontal]:br[f.vertical]),timeout:y},C),E=w;typeof E=="function"&&(E=E(j.id,j.message));var I=["onEnter","onEntered","onExit","onExited"].reduce(function(D,N){var L;return he({},D,((L={})[N]=Rt([l.snack[N],l[N]],j.id),L))},{});return a.createElement(La,{in:t,onExited:I.onExited},a.createElement(Ha,{open:p,id:j.id,disableWindowBlurListener:x,autoHideDuration:j.autoHideDuration,className:$e(Wi.wrappedRoot,b.root,b[Ai(j.anchorOrigin)]),SnackbarProps:g,onClose:c},a.createElement(S,Object.assign({},T,{appear:!0,in:p,onExit:I.onExit,onExited:m,onEnter:I.onEnter,onEntered:Rt([I.onEntered,function(){l.snack.requestClose&&c(null,"instructed",l.snack.id)}],j.id)}),E||a.createElement(u,Object.assign({},j)))))},Et={default:20},Zt={default:6,dense:2},Sr="."+Oa,Jt=Nt({root:(Bt={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:ct(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},Bt[Sr]={padding:Zt.default+"px 0px",transition:"padding 300ms ease 0ms"},Bt.maxWidth="calc(100% - "+2*Et.default+"px)",Bt[Eo]={width:"100%",maxWidth:"calc(100% - 32px)"},Bt),rootDense:(Mo={},Mo[Sr]={padding:Zt.dense+"px 0px"},Mo),top:{top:Et.default-Zt.default+"px",flexDirection:"column"},bottom:{bottom:Et.default-Zt.default+"px",flexDirection:"column-reverse"},left:(Xt={left:Et.default+"px"},Xt[eo]={alignItems:"flex-start"},Xt[Eo]={left:"16px"},Xt),right:(Yt={right:Et.default+"px"},Yt[eo]={alignItems:"flex-end"},Yt[Eo]={right:"16px"},Yt),center:(Po={left:"50%",transform:"translateX(-50%)"},Po[eo]={alignItems:"center"},Po)}),$i=function(l){var i=l.classes,n=i===void 0?{}:i,t=l.anchorOrigin,r=l.dense,c=l.children,m=$e(Pi,Jt[t.vertical],Jt[t.horizontal],Jt.root,n.containerRoot,n["containerAnchorOrigin"+mn(t)],r&&Jt.rootDense);return a.createElement("div",{className:m},c)},Ui=a.memo($i),wr=function(l){return!(typeof l=="string"||a.isValidElement(l))},_i=function(l){function i(n){var t;return(t=l.call(this,n)||this).enqueueSnackbar=function(r,c){if(c===void 0&&(c={}),r==null)throw new Error("enqueueSnackbar called with invalid argument");var m=wr(r)?r:c,f=wr(r)?r.message:r,s=m.key,d=m.preventDuplicate,h=Ft(m,["key","preventDuplicate"]),u=qt(s),b=u?s:new Date().getTime()+Math.random(),p=Mi(h,t.props),g=he({id:b},h,{message:f,open:!0,entered:!1,requestClose:!1,persist:p("persist"),action:p("action"),content:p("content"),variant:p("variant"),anchorOrigin:p("anchorOrigin"),disableWindowBlurListener:p("disableWindowBlurListener"),autoHideDuration:p("autoHideDuration"),hideIconVariant:p("hideIconVariant"),TransitionComponent:p("TransitionComponent"),transitionDuration:p("transitionDuration"),TransitionProps:p("TransitionProps",!0),iconVariant:p("iconVariant",!0),style:p("style",!0),SnackbarProps:p("SnackbarProps",!0),className:$e(t.props.className,h.className)});return g.persist&&(g.autoHideDuration=void 0),t.setState(function(S){if(d===void 0&&t.props.preventDuplicate||d){var C=function(w){return u?w.id===b:w.message===f},y=S.queue.findIndex(C)>-1,x=S.snacks.findIndex(C)>-1;if(y||x)return S}return t.handleDisplaySnack(he({},S,{queue:[].concat(S.queue,[g])}))}),b},t.handleDisplaySnack=function(r){return r.snacks.length>=t.maxSnack?t.handleDismissOldest(r):t.processQueue(r)},t.processQueue=function(r){var c=r.queue,m=r.snacks;return c.length>0?he({},r,{snacks:[].concat(m,[c[0]]),queue:c.slice(1,c.length)}):r},t.handleDismissOldest=function(r){if(r.snacks.some(function(s){return!s.open||s.requestClose}))return r;var c=!1,m=!1;r.snacks.reduce(function(s,d){return s+(d.open&&d.persist?1:0)},0)===t.maxSnack&&(m=!0);var f=r.snacks.map(function(s){return c||s.persist&&!m?he({},s):(c=!0,s.entered?(s.onClose&&s.onClose(null,"maxsnack",s.id),t.props.onClose&&t.props.onClose(null,"maxsnack",s.id),he({},s,{open:!1})):he({},s,{requestClose:!0}))});return he({},r,{snacks:f})},t.handleEnteredSnack=function(r,c,m){if(!qt(m))throw new Error("handleEnteredSnack Cannot be called with undefined key");t.setState(function(f){return{snacks:f.snacks.map(function(s){return s.id===m?he({},s,{entered:!0}):he({},s)})}})},t.handleCloseSnack=function(r,c,m){t.props.onClose&&t.props.onClose(r,c,m);var f=m===void 0;t.setState(function(s){var d=s.snacks,h=s.queue;return{snacks:d.map(function(u){return f||u.id===m?u.entered?he({},u,{open:!1}):he({},u,{requestClose:!0}):he({},u)}),queue:h.filter(function(u){return u.id!==m})}})},t.closeSnackbar=function(r){var c=t.state.snacks.find(function(m){return m.id===r});qt(r)&&c&&c.onClose&&c.onClose(null,"instructed",r),t.handleCloseSnack(null,"instructed",r)},t.handleExitedSnack=function(r,c){if(!qt(c))throw new Error("handleExitedSnack Cannot be called with undefined key");t.setState(function(m){var f=t.processQueue(he({},m,{snacks:m.snacks.filter(function(s){return s.id!==c})}));return f.queue.length===0?f:t.handleDismissOldest(f)})},t.enqueueSnackbar,t.closeSnackbar,t.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:t.enqueueSnackbar.bind(mr(t)),closeSnackbar:t.closeSnackbar.bind(mr(t))}},t}return Pa(i,l),i.prototype.render=function(){var n=this,t=this.state.contextValue,r=this.props,c=r.domRoot,m=r.children,f=r.dense,s=f!==void 0&&f,d=r.Components,h=d===void 0?{}:d,u=r.classes,b=this.state.snacks.reduce(function(g,S){var C,y=mn(S.anchorOrigin),x=g[y]||[];return he({},g,((C={})[y]=[].concat(x,[S]),C))},{}),p=Object.keys(b).map(function(g){var S=b[g],C=S[0];return a.createElement(Ui,{key:g,dense:s,anchorOrigin:C.anchorOrigin,classes:u},S.map(function(y){return a.createElement(Vi,{key:y.id,snack:y,classes:u,Component:h[y.variant],onClose:n.handleCloseSnack,onEnter:n.props.onEnter,onExit:n.props.onExit,onExited:Rt([n.handleExitedSnack,n.props.onExited],y.id),onEntered:Rt([n.handleEnteredSnack,n.props.onEntered],y.id)})}))});return a.createElement(Da.Provider,{value:t},m,c?Je.createPortal(p,c):p)},Ma(i,[{key:"maxSnack",get:function(){return this.props.maxSnack||Ye.maxSnack}}]),i}(a.Component),Wa=function(){return a.useContext(Da)};const qi=[{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}],Ki=[{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 Va{constructor(i=qi,n=Ki){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...i]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const i=[],n=this._readFormatType;for(let t=0;t<n.length;t++)for(let r=0;r<n[t].exts.length;r++)i.push("."+n[t].exts[r]);return i}async writeFile(i,n,t){if(!n||!i)throw new Error("Workbook model or file name must be provided.");try{return(await import("@sheetxl/io")).WorkbookIO.writeFile(i,n,t)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(i,n){let t,r;const c=await n?.showBusy?.(`Opening${i.name?` ${i.name}`:""}...`);try{r=await import("@sheetxl/io")}catch(m){throw m}try{return await r.WorkbookIO.read({...i,async onStart(m){await i?.onStart?.(m),t=await n?.showBusy?.(`Opening '${m}'...`)}})}catch(m){throw c?.(),t?.(),m}finally{c?.(),t?.()}}}const Ve=new Va,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"},$a=a.forwardRef((l,i)=>{const{id:n,message:t,iconVariant:r,error:c,hideIconVariant:m,...f}=l,{closeSnackbar:s}=Wa(),d=G.useTheme(),[h,u]=a.useState(!1),b=a.useCallback(()=>{u(S=>!S)},[]),p=a.useCallback(()=>{s(n)},[n,s]);let g=c?.message;return!g&&a.isValidElement(t)&&(g=t),g||typeof t!="string"||(g=t),g||(g=`Unknown Error: ${t}`),e.jsx(pn,{ref:i,className:fe(Le.root,"error-snackbar"),children:e.jsxs(B.Card,{className:Le.card,style:{backgroundColor:d.palette.error.dark,border:`1px solid ${d.palette.error.dark}`},children:[e.jsxs(B.CardActions,{className:Le.actionRoot,children:[m?null:r?.error,e.jsx(B.Typography,{variant:"body2",component:"div",className:Le.typography,style:{color:d.palette.text.primary},children:g}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsxs("div",{className:Le.icons,children:[c?e.jsx(B.IconButton,{"aria-label":"Show more",size:"small",className:fe(Le.expand,{[Le.expandOpen]:h}),style:{color:d.palette.action.active},onClick:b,children:e.jsx(me.ExpandMore,{})}):null,e.jsx(B.IconButton,{size:"small",className:Le.expand,style:{color:d.palette.action.active},onClick:p,children:e.jsx(me.Close,{fontSize:"small"})})]})]}),c?e.jsx(B.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx("div",{className:Le.stackTraceContainer,style:{backgroundColor:d.palette.error.light,borderTop:`1px solid ${d.palette.error.main}`},children:e.jsx(o.StackTrace,{error:c,hideLineNumbers:!0})})}):null]})})});$a.displayName="ToastError";const Ua=a.memo(a.forwardRef((l,i)=>{const{commands:n,commandHook:t,scope:r="workbook",disabled:c=!1,...m}=l,f=k.useCallbackRef(d=>{const h={variant:k.CommandButtonType.Menuitem,parentFloat:d.floatReference,commandHook:t,scope:r,disabled:c},u=e.jsxs(e.Fragment,{children:[e.jsx(o.CommandButton,{...h,command:n.getCommand("newWorkbook"),icon:o.themeIcon(e.jsx(o.FileNewIcon,{}))}),e.jsx(o.ExhibitDivider,{orientation:"horizontal"}),e.jsx(o.CommandButton,{...h,command:n.getCommand("openWorkbook"),icon:o.themeIcon(e.jsx(o.FileOpenIcon,{}))}),e.jsx(o.CommandPopupButton,{...h,commands:n,quickCommand:"saveWorkbook",icon:o.themeIcon(e.jsx(o.FileDownloadAsSheetIcon,{})),createPopupPanel:b=>{const p={...h,parentFloat:b.floatReference,scope:"saveWorkbook"},g=[];return Ve.getWriteFormats().forEach(S=>{if(S.isDefault)return;let C=null;S.key==="CSV"?C=o.themeIcon(e.jsx(o.FileDownloadAsCSVIcon,{})):S.key==="Excel"&&(C=o.themeIcon(e.jsx(o.FileDownloadAsExcelIcon,{})));const y=n.getCommand(`saveWorkbookAs${S.key}`);y?g.push(a.createElement(o.CommandButton,{...p,key:S.key,command:y,icon:C})):console.warn(`Unable to resolve command: 'saveWorkbookAs${S.key}'`)}),o.defaultCreatePopupPanel({...b,children:g,onClick:()=>{b.closeFloatAll()}})}})]});return o.defaultCreatePopupPanel({...d,children:u,onClick:b=>{b.isDefaultPrevented||d.closeFloatAll()}})},[c,n,t,r]),s="File";return e.jsx(o.CommandPopupButton,{commands:n,disabled:c,commandHook:t,scope:r,label:s,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:d=>`calc(1.25rem + ${d.spacing(2)}px)`}},...m,createPopupPanel:f,icon:e.jsx(o.LabelIcon,{className:"label",icon:null,label:s})})}));Ua.displayName="StandaloneFileCommandButton";const Gi=e.jsx(o.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(le.LogoNoPaddingIcon,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),_a=a.memo(a.forwardRef((l,i)=>{const{commands:n,workbook:t,logo:r=Gi,mainElement:c,showFileMenu:m=!0,showAppearanceMenu:f=!0,...s}=l,{reference:d}=o.useFloatStack(),[h,{width:u}]=pt(),b=u<530,p=m?e.jsx(Ua,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(y,x,w){}}}):null,g=f?e.jsx(na,{commands:n,commandHook:{beforeExecute(){d?.closeAll()},onError(y,x,w){}}}):null,S=a.useMemo(()=>({paddingLeft:y=>y.spacing(1),paddingRight:y=>y.spacing(1)}),[]),C=a.useRef(null);return e.jsx(B.Box,{ref:Dt([C,h,i]),...s,children:va({commands:n,renderCompact:b,workbook:t,selectWrapper:y=>e.jsxs(B.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:x=>x.spacing(1),paddingLeft:x=>x.spacing(1),paddingRight:x=>x.spacing(1)},children:[e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:x=>x.spacing(.5)},children:[r,e.jsxs(B.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:x=>x.spacing(.25)},children:[p,y]})]}),e.jsx(B.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:c}),e.jsx(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:b&&!g?"0 0 auto":"1 1 100%"},children:g})]}),selectProps:S,toolbarsProps:{Home:{sx:{}}}})})}));_a.displayName="StudioToolbar";const qa=a.memo(a.forwardRef((l,i)=>{const{workbook:n,setWorkbook:t,refWorkbookTitle:r,titleWorkbook:c,setWorkbookTitle:m,titlePlaceHolder:f,children:s,undoManager:d,commands:h,importExportDisabled:u,themeOptions:b}=l,p=Wa(),g=p?p.enqueueSnackbar:()=>{},S=p?p.closeSnackbar:()=>{},[C,y]=a.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),x=a.useCallback(()=>{y($=>({...$,isMounted:!0}))},[]),w=a.useCallback(()=>{y($=>({...$,isMounted:!1}))},[]),j={},T=o.useLazyWindow(j),E=o.useOptionsDialog(j),I=o.useInputDialog(j),D=a.useRef(new Set),N=a.useMemo(()=>{const $=(M,R)=>{if(R?.onceKey){if(D.current.has(R.onceKey))return;const X=new Set(D.current);X.add(R.onceKey),D.current=X}const K={variant:R?.type??k.NotificationType.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:R?.preventDuplicate,persist:R?.persist??R?.type===k.NotificationType.Error,action:X=>e.jsx(B.IconButton,{onClick:()=>S(X),children:e.jsx(me.CancelOutlined,{})})};R?.enqueueProps&&Object.assign(K,R.enqueueProps),M||console.log("message is 'null'",R),g(M??"Alert",K)};return{showMessage:$,showBusy:(M,R)=>{let K=null;const X=new Promise(q=>{K=q});return y(q=>{const U=new Map(q.starting);return U.set(X,K),{...q,label:M,starting:U}}),X},showWindow:(M,R,K)=>{const X={...R,onKeyDown:q=>{h?.dispatchToFocusedCommand(q),q.isDefaultPrevented()||q.isPropagationStopped()||R?.onKeyDown?.(q)}};return T(M,{sort:()=>Promise.resolve().then(()=>require("./BiXR_PE14hrnbjxg.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./CZibZcMftaStnfGU.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./Cgcw3wtvrTN9St3u.cjs")),comments:()=>Promise.resolve().then(()=>require("./CHMLnYdMrxKoXUT-.cjs")),find:()=>Promise.resolve().then(()=>require("./Bkxhpequ7eXKflN2.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./BdFSVVjjrhlXHPpK.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./mocbOdB4d2s-EcmO.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./D3da_TJhCMaA-Jvd.cjs"))}[M],X,K)},showOptions:E,showInputOptions:I,showError:M=>{let R,K=k.NotificationType.Error,X="Unknown Error";typeof M=="string"?X=M:M instanceof Error&&(R=M,M.message&&(X=M.message)),M instanceof Fe.PartialError&&(K=k.NotificationType.Info),$(X,{type:K,enqueueProps:{error:R}})}}},[]),L=a.useCallback(()=>{},[]),P=($=>{const{workbook:M,setWorkbook:R,importExportDisabled:K,workbookTitle:X="export",setWorkbookTitle:q,notifier:U,requestWorkbookTitle:Q,themeOptions:ee,undoManager:_,commands:W,onExecute:Y}=$,ne=k.useCallbackRef(ee?.onModeChange,[ee?.onModeChange]),be=k.useCallbackRef(ee?.onEnabledDarkGridChange,[ee?.onEnabledDarkGridChange]),ge=k.useCallbackRef(ee?.onEnabledDarkImagesChange,[ee?.onEnabledDarkImagesChange]),xe=k.useCallbackRef(async(re=null,ae=null)=>{const Z=[];let te,ue=null,ie=null;if(typeof re=="string"?ie=re:ue=re,te=ue?re:await Fe.CommonUtils.openFileDialog(ie??Ve.getAllReadFormatTypeAsString().join(",")),!te)return null;const je={source:te,createWorkbookOptions:ae,onWarning:ht=>{Z.push(ht)}},Me=await Ve.read(je,U);return Z.length>0&&(U?.showMessage?.("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
19
19
  `+Z.join(`
20
- `))),Me},[Y,U,M]),Ee=k.useCallbackRef(async(re,ae,Z)=>{if(!ae&&Q){const te=await Q("Enter Workbook name to "+(Z.isDefault?"Save.":`Export as ${Z.description}.`));return te!==null&&Ve.writeFile(te,re,{formatType:Z.key})}return Ve.writeFile(ae,re,{formatType:Z.key})},[U,M,Q]),se=a.useCallback(()=>({contains:re=>!0,focus(){}}),[]),Se=a.useMemo(()=>{const re=[];K||(Ve.getWriteFormats().forEach(Z=>{const te=Z.isDefault,ue={label:te?"Save Workbook":`Save Workbook as ${Z.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${Z.description}`},tags:Z.tags,description:`Save the workbook to the desktop${te?"":` as ${Z.description}`}.`};te&&(ue.shortcut={key:"S",modifiers:[k.KeyModifiers.Ctrl]},re.push(new k.Command("saveWorkbookAs",se,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[k.KeyModifiers.Shift,k.KeyModifiers.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{Ee(M,null,Z).catch(je=>{U?.showError?.(je)})})));const ie=te?"saveWorkbook":`saveWorkbookAs${Z.key}`;re.push(new k.Command(ie,se,ue,je=>{Ee(M,je??X,Z).catch(Me=>{U?.showError?.(Me)})}))}),re.push(new k.Command("openWorkbook",se,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[k.KeyModifiers.Ctrl]}},async(Z=null)=>{const te={date1904:M.isDate1904(),...M.options};try{const ue=await xe(Z,te);if(!ue)return;const ie=ue.title,je=ue.workbook,Me=je.getSelectedSheet();if(ue.formatType.mimeType==="text/csv"){const ht=M.findValidSheetName(ie);await M.doBatch(async()=>{const co=Me.getUsedRange();if(!co)return void U?.showMessage("The file appears to be blank.");await M.getSheets().add({name:ht,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(co)},`Import CSV '${ie}'`)}else M?.close(),q?.(ie),R(je)}catch(ue){U?.showError?.(ue)}})),re.push(new k.Command("openWorkbookFromUrl",se,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(Z){if(!Z){const te=await U?.showInputOptions?.({title:"Open Workbook from the Web",description:"Enter the web address for the workbook to open.",inputLabel:"Address",initialValue:"https://www.sheetxl.com/examples/features-checklist.xlsx",inputProps:{style:{minWidth:"440px"}},options:["Open"]});if(te.option!=="Open")return;Z=te.input}Z&&console.log("openWorkbookFromUrl",Z)})));let ae=[];return ee&&(ae=[new k.Command("themeMode",se,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new k.Command("defaultThemeMode",se,{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 k.Command("enableDarkGrid",se,{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 k.Command("enableDarkImages",se,{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."})]),[...re,...ae,new k.SimpleCommand("help",se,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new k.SimpleCommand("showKeyboardShortcuts",se,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[k.KeyModifiers.Ctrl]}},()=>{}),new k.Command("gotoUrlGithub",se,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new k.Command("gotoUrlDiscord",se,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new k.Command("gotoUrlDocumentation",se,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new k.Command("gotoUrlIssue",se,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[M,X,U,K,ee,W,_]),z=a.useMemo(()=>{let re=null;return re=W?W.createChildGroup(se,"standaloneWorkbook",!1):new k.CommandGroup(se,"standaloneWorkbook"),re.addCommands(Se,!0),re},[W,Se]);k.useUndoManager({manager:_,commands:z,notifier:U});const{themeMode:J}=o.useResolvedThemeMode();a.useEffect(()=>{if(!ee||!z)return;const re=ee.mode==="dark"||!ee.mode&&J==="dark";z.getCommand("themeMode").update({state:ee.mode??null,label:re?"Dark Mode":"Light Mode",scopedLabels:{appearance:re?"Dark Mode":"Light Mode"}}).updateCallback(()=>{ne(re?o.ThemeMode.Light:o.ThemeMode.Dark)}),z.getCommand("defaultThemeMode").update({state:!ee.mode}).updateCallback(()=>{ne(null)}),z.getCommand("enableDarkGrid").update({state:ee.enableDarkGrid}).updateCallback(()=>{be(!ee.enableDarkGrid)}),z.getCommand("enableDarkImages").update({state:ee.enableDarkImages}).updateCallback(()=>{ge(!ee.enableDarkImages)})},[J,ee,Se]);const{showModal:ce}=o.useModal();return a.useEffect(()=>{const re=()=>new Promise((ae,Z)=>{const te=a.lazy(()=>Promise.resolve().then(()=>require("./D0f-XIJu6KlJxgZe.cjs"))),ue=ce(te,{title:"Shortcut Keys Reference",commands:z,onDone:()=>{ue.hide()},TransitionProps:{onExited:()=>{ae(!0)}}})});z.getCommand("showKeyboardShortcuts").updateCallback(()=>re()),z.getCommand("help").updateCallback(()=>re())},[Se,z]),z})({workbook:n,setWorkbook:t,importExportDisabled:u,workbookTitle:c,setWorkbookTitle:m,commands:h,requestWorkbookTitle:$=>new Promise(M=>{r.current?r.current.requestWorkbookTitle((R,K)=>{M(R)},{selectAll:!0,requestReason:$}):M(f)}),themeOptions:b,undoManager:d,notifier:N,onExecute:L});a.useEffect(()=>{C.starting.size<=0||!C.isMounted||y($=>{const M=new Map($.running);return $.starting.forEach((R,K)=>{const X=()=>{y(q=>{const U=new Map(q.running);return U.delete(K),{...q,running:U}})};M.set(K,X),R(X)}),{...$,starting:new Map,running:M}})},[C]);const[v,F]=a.useState(null);a.useEffect(()=>{C.starting.size!==0||C.running.size!==0?F(e.jsx(o.LoadingPanel,{icon:e.jsx(o.AnimatedTraversingEllipsisIcon,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:C.label,onMount:x,onUnmount:w,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):F(null)},[C.starting,C.running]);const H=a.useMemo(()=>e.jsx(ra,{commands:P,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[P]),A={notifier:N,commands:P};return n&&(A.statusBarProps={childrenEnd:H}),e.jsxs(e.Fragment,{children:[v,s?a.cloneElement(s,A):null]})}));qa.displayName="SnackbarAndCommandsWrapper";const ro=a.memo(a.forwardRef((l,i)=>{const{className:n,sx:t,style:r,onElementLoad:c,onError:m,undoManager:f,errorPanel:s=o.ErrorPanel,onKeyDown:d,workbook:h,createWorkbookOptions:u,onWorkbookChange:b,logo:p,importExportDisabled:g=!1,themeOptions:S,autoFocus:C=!1,commands:y,title:x,onTitleChange:w,titleProps:j,renderLoadingPanel:T,...E}=l,I=a.useRef(null),D=k.useCallbackRef(b,[b]),N=k.useCallbackRef(w??j?.onTitleChange,[w??j?.onTitleChange]),L=j?.placeHolder??"Untitled",P=S?.mode,{themeMode:v,source:F}=o.useResolvedThemeMode({mode:P}),H=a.useMemo(()=>({...S,light:o.createExhibitTheme(!1,Fe.CommonUtils.deepMerge(S?.theme??{},S?.light??{})),dark:o.createExhibitTheme(!0,Fe.CommonUtils.deepMerge(S?.theme??{},S?.dark??{}))}),[S]),A=v===o.ThemeMode.Dark,[$,M]=a.useState(null);a.useEffect(()=>{M(f??new Fe.UndoManager)},[f]);const[R,K]=a.useState(null),[X,q]=a.useState(null),U=le.useDocThemes();a.useLayoutEffect(()=>{if(!h||Object.keys(h).length===0&&!Fe.CommonUtils.isPromiseLike(h)){const Z={theme:U.getDefaultTheme(),...u};q(new O.Workbook(Z))}else q(h)},[h]),a.useLayoutEffect(()=>{if(X){if(X instanceof O.Workbook)return K({workbook:X}),void(h!==X&&D?.(X));(async()=>{try{let Z,te=await Promise.resolve(X);te&&te.source&&(te=await Ve.read(te)),te.workbook?(Y(te.title),Z=te.workbook):Z=te,D?.(Z),K({workbook:Z})}catch(Z){D?.(null),K({error:Z})}})()}},[X]);const[Q,ee]=a.useState(null);a.useEffect(()=>{if(!$||!R)return;$.clear();const Z=R?.workbook?.getTransactions();if(Z)return Z.addListener({onCommitEnd:te=>{te.getDescription()?$.addUndoOperation({description:te.getDescription(),undo:()=>(Z.revert(te.getId()),Q.source?.focus(),()=>{Z.restore(te.getId()),Q.source?.focus()})}):console.warn("commit has no description",te)}})},[$,R,Q]);const _=k.useCallbackRef(Z=>{Z?$.setRepeatableOperation({description:Z.label(),repeat:async()=>Z.execute()}):$.setRepeatableOperation(null)},[$]),[W,Y]=a.useState(x??j?.title??"");a.useEffect(()=>{Y(x??j?.title??"")},[x??j?.title]),a.useEffect(()=>{N?.(W)},[W]);const[ne,be]=a.useState(null),ge=a.useMemo(()=>{const Z=()=>({contains:te=>!0,focus(){}});return y?y.createChildGroup(Z,"application",!1):new k.CommandGroup(Z,"application")},[y]),xe=k.useCallbackRef(Z=>{be(Z.source.getViewportElement()),ee(Z),ge.activate("sheet"),c?.(Z)},[ge]);a.useEffect(()=>{Q&&C&&Q.source?.focus(typeof C=="object"?C:void 0)},[Q]);const Ee=a.useRef(null),se=a.useCallback(Z=>{let te=null;return j?.hidden||(te=e.jsx(dn,{...j,style:{maxWidth:"100%",...j?.style},workbook:I.current,ref:Ee,title:W,placeHolder:L,onTitleChange:ue=>{Y(ue)}})),e.jsx(_a,{...Z,logo:p,mainElement:te,showFileMenu:!g,showAppearanceMenu:!!(H?.onEnabledDarkGridChange||H?.onEnabledDarkImagesChange||H?.onModeChange)})},[p,W,j,H,g,ge]);a.useEffect(()=>{const Z=te=>te.preventDefault();return I.current?.addEventListener("wheel",Z,{passive:!1}),()=>{I.current?.removeEventListener("wheel",Z)}},[]);const Se=a.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:T?.(Z)??e.jsx(o.LoadingPanel,{...Z})})},[t,r,T]),z=a.useCallback(({error:Z})=>(m?.(Z),e.jsx(s,{sx:t,style:r,error:Z??"Unable to display empty workbook."})),[t,r,m]),J=a.useMemo(()=>({...t,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-MuiContent *":{fontFamily:Z=>Z.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[t]),ce=Dt([I,i]),re=a.useMemo(()=>{if(!R)return Se;if(R.error||!R.workbook)return z({error:R.error});let Z=null,te=null,ue=!1;return H&&(Z=A?H.dark:H.light,te=A&&H.enableDarkGrid?H.dark:H.light,ue=H.enableDarkImages),e.jsx(cn,{sx:J,style:r,tabIndex:0,autoFocus:!0,workbook:R.workbook,ref:ce,renderToolbar:se,onElementLoad:xe,onRepeatCommandChange:_,onKeyDown:ie=>{d?.(ie)},renderLoadingPanel:T,gridTheme:te,headersTheme:Z,enableDarkImages:ue,className:fe(n,"sheetxl-workbook"),onContextMenu:ie=>ie.preventDefault(),...E},"WorkbookElement")},[R,W,$,Se,T,H,E,se,J]);let ae=e.jsx(bi,{fallbackRender:z,children:e.jsx(_i,{maxSnack:3,domRoot:ne,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(Z,te,ue)=>{I.current?.focus()},Components:{error:$a},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(o.ErrorAlertIcon,{style:{marginRight:"8px"}})},children:e.jsx(o.ModalProvider,{children:e.jsx(qa,{workbook:R?.workbook,setWorkbook:q,importExportDisabled:g,titlePlaceHolder:L,titleWorkbook:W,setWorkbookTitle:Y,refWorkbookTitle:Ee,commands:ge,undoManager:$,themeOptions:H,children:re})})})});return H&&(ae=e.jsxs(G.ThemeProvider,{theme:A?H.dark:H.light,children:[H.cssBaseline?e.jsx(B.CssBaseline,{}):null,ae]})),ae}));ro.displayName="EagerStudio";const Xi=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:ro,default:ro},Symbol.toStringTag,{value:"Module"}));exports.AppearanceCommandButton=na,exports.AutoColorPosition=dt,exports.BorderCommandButton=Dr,exports.BorderPopupButton=Pr,exports.BorderStyleButton=Mr,exports.Checkboard=Ir,exports.ClearCommandButton=zo,exports.ColorButton=ao,exports.ColorCommandButton=ut,exports.ColorPanel=Rr,exports.ColorPanelType=Er,exports.ColorPopupButton=Ho,exports.DeleteCellsCommandButton=Vo,exports.DocThemeCommandButton=oa,exports.EagerStudio=ro,exports.FillCommandButton=Hr,exports.FilterColumnMenu=Jo,exports.FilterCommandButton=Rl,exports.Filters=ha,exports.FindCommandButton=Ar,exports.FontFamilyCommandButton=Vr,exports.FontSizeCommandButton=Or,exports.FormulaBar=Zo,exports.FreezeCommandButton=Nr,exports.HelpCommandButton=ra,exports.HorizontalAlignCommandButton=vr,exports.InsertCellsCommandButton=Wo,exports.InsertImageCommandButton=qo,exports.InsertScriptCommandButton=wa,exports.MergeCommandButton=Fr,exports.NamedCollectionEditor=Yo,exports.NamedInput=ia,exports.NumberFormatCommandButton=Lr,exports.PasteCommandButton=_o,exports.PresetCellStylesCommandButton=Gr,exports.PresetTableStylesCommandButton=Jr,exports.QuickFormulaSumCommandPopupButton=Nl,exports.RangeInput=sa,exports.RunScriptCommandButton=an,exports.ScriptEditorToolbar=nn,exports.ScriptWorkspace=rn,exports.SheetTab=Qo,exports.SheetTabMenu=en,exports.SheetZoomScale=Ko,exports.SheetsAllMenu=tn,exports.SortFilterCommandButton=$o,exports.StatusBar=Go,exports.Studio=Ea,exports.StyledStrokeIcon=Do,exports.TableStyleCanvasPreview=Zr,exports.TableStyleOptionsPanel=Dl,exports.TableStylePreview=Yr,exports.TextEffectsCommandButton=$r,exports.TextOverflowCommandButton=Tr,exports.TextRotateCommandButton=Br,exports.ThemeSelectButton=Qr,exports.ThemeSelectPanel=ea,exports.ThemeSelectPopupButton=ta,exports.UnderlineCommandButton=Ur,exports.UndoRedoCommandButton=Uo,exports.VerticalAlignCommandButton=jr,exports.ViewGridLinesCommandButton=zr,exports.ViewHeadingsCommandButton=_r,exports.WalkingCopyCommandButton=lo,exports.WorkbookContextMenu=sn,exports.WorkbookElement=cn,exports.WorkbookIO=Ve,exports.WorkbookStrip=ln,exports.WorkbookTitle=dn,exports.WorkbookViewCommandButton=qr,exports._WorkbookIO=Va,exports._extends=to,exports._objectWithoutPropertiesLoose=on,exports._setPrototypeOf=oo,exports.clsx=$e,exports.clsx$1=fe,exports.commonjsGlobal=st,exports.createGridStyleFromMUITheme=Ao,exports.defaultNewWorkbook=Ta,exports.getDefaultExportFromCjs=function(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l},exports.requirePropTypes=Pt,exports.setPrintExamplesOnLoad=l=>{fa=l},exports.useMeasure=pt,exports.useWorkbookCommands=ja;
20
+ `))),Me},[Y,U,M]),Ee=k.useCallbackRef(async(re,ae,Z)=>{if(!ae&&Q){const te=await Q("Enter Workbook name to "+(Z.isDefault?"Save.":`Export as ${Z.description}.`));return te!==null&&Ve.writeFile(te,re,{formatType:Z.key})}return Ve.writeFile(ae,re,{formatType:Z.key})},[U,M,Q]),se=a.useCallback(()=>({contains:re=>!0,focus(){}}),[]),Se=a.useMemo(()=>{const re=[];K||(Ve.getWriteFormats().forEach(Z=>{const te=Z.isDefault,ue={label:te?"Save Workbook":`Save Workbook as ${Z.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${Z.description}`},tags:Z.tags,description:`Save the workbook to the desktop${te?"":` as ${Z.description}`}.`};te&&(ue.shortcut={key:"S",modifiers:[k.KeyModifiers.Ctrl]},re.push(new k.Command("saveWorkbookAs",se,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[k.KeyModifiers.Shift,k.KeyModifiers.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{Ee(M,null,Z).catch(je=>{U?.showError?.(je)})})));const ie=te?"saveWorkbook":`saveWorkbookAs${Z.key}`;re.push(new k.Command(ie,se,ue,je=>{Ee(M,je??X,Z).catch(Me=>{U?.showError?.(Me)})}))}),re.push(new k.Command("openWorkbook",se,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[k.KeyModifiers.Ctrl]}},async(Z=null)=>{const te={date1904:M.isDate1904(),...M.options};try{const ue=await xe(Z,te);if(!ue)return;const ie=ue.title,je=ue.workbook,Me=je.getSelectedSheet();if(ue.formatType.mimeType==="text/csv"){const ht=M.findValidSheetName(ie);await M.doBatch(async()=>{const co=Me.getUsedRange();if(!co)return void U?.showMessage("The file appears to be blank.");await M.getSheets().add({name:ht,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(co)},`Import CSV '${ie}'`)}else M?.close(),q?.(ie),R(je)}catch(ue){U?.showError?.(ue)}})),re.push(new k.Command("openWorkbookFromUrl",se,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(Z){if(!Z){const te=await U?.showInputOptions?.({title:"Open Workbook from the Web",description:"Enter the web address for the workbook to open.",inputLabel:"Address",initialValue:"https://www.sheetxl.com/examples/features-checklist.xlsx",inputProps:{style:{minWidth:"440px"}},options:["Open"]});if(te.option!=="Open")return;Z=te.input}Z&&console.log("openWorkbookFromUrl",Z)})));let ae=[];return ee&&(ae=[new k.Command("themeMode",se,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new k.Command("defaultThemeMode",se,{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 k.Command("enableDarkGrid",se,{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 k.Command("enableDarkImages",se,{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."})]),[...re,...ae,new k.SimpleCommand("help",se,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new k.SimpleCommand("showKeyboardShortcuts",se,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[k.KeyModifiers.Ctrl]}},()=>{}),new k.Command("gotoUrlGithub",se,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new k.Command("gotoUrlDiscord",se,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new k.Command("gotoUrlDocumentation",se,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new k.Command("gotoUrlIssue",se,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[M,X,U,K,ee,W,_]),z=a.useMemo(()=>{let re=null;return re=W?W.createChildGroup(se,"standaloneWorkbook",!1):new k.CommandGroup(se,"standaloneWorkbook"),re.addCommands(Se,!0),re},[W,Se]);k.useUndoManager({manager:_,commands:z,notifier:U});const{themeMode:J}=o.useResolvedThemeMode();a.useEffect(()=>{if(!ee||!z)return;const re=ee.mode==="dark"||!ee.mode&&J==="dark";z.getCommand("themeMode").update({state:ee.mode??null,label:re?"Dark Mode":"Light Mode",scopedLabels:{appearance:re?"Dark Mode":"Light Mode"}}).updateCallback(()=>{ne(re?o.ThemeMode.Light:o.ThemeMode.Dark)}),z.getCommand("defaultThemeMode").update({state:!ee.mode}).updateCallback(()=>{ne(null)}),z.getCommand("enableDarkGrid").update({state:ee.enableDarkGrid}).updateCallback(()=>{be(!ee.enableDarkGrid)}),z.getCommand("enableDarkImages").update({state:ee.enableDarkImages}).updateCallback(()=>{ge(!ee.enableDarkImages)})},[J,ee,Se]);const{showModal:ce}=o.useModal();return a.useEffect(()=>{const re=()=>new Promise((ae,Z)=>{const te=a.lazy(()=>Promise.resolve().then(()=>require("./CUnh1LhecJpjlHt_.cjs"))),ue=ce(te,{title:"Shortcut Keys Reference",commands:z,onDone:()=>{ue.hide()},TransitionProps:{onExited:()=>{ae(!0)}}})});z.getCommand("showKeyboardShortcuts").updateCallback(()=>re()),z.getCommand("help").updateCallback(()=>re())},[Se,z]),z})({workbook:n,setWorkbook:t,importExportDisabled:u,workbookTitle:c,setWorkbookTitle:m,commands:h,requestWorkbookTitle:$=>new Promise(M=>{r.current?r.current.requestWorkbookTitle((R,K)=>{M(R)},{selectAll:!0,requestReason:$}):M(f)}),themeOptions:b,undoManager:d,notifier:N,onExecute:L});a.useEffect(()=>{C.starting.size<=0||!C.isMounted||y($=>{const M=new Map($.running);return $.starting.forEach((R,K)=>{const X=()=>{y(q=>{const U=new Map(q.running);return U.delete(K),{...q,running:U}})};M.set(K,X),R(X)}),{...$,starting:new Map,running:M}})},[C]);const[v,F]=a.useState(null);a.useEffect(()=>{C.starting.size!==0||C.running.size!==0?F(e.jsx(o.LoadingPanel,{icon:e.jsx(o.AnimatedTraversingEllipsisIcon,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:C.label,onMount:x,onUnmount:w,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):F(null)},[C.starting,C.running]);const H=a.useMemo(()=>e.jsx(ra,{commands:P,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[P]),A={notifier:N,commands:P};return n&&(A.statusBarProps={childrenEnd:H}),e.jsxs(e.Fragment,{children:[v,s?a.cloneElement(s,A):null]})}));qa.displayName="SnackbarAndCommandsWrapper";const ro=a.memo(a.forwardRef((l,i)=>{const{className:n,sx:t,style:r,onElementLoad:c,onError:m,undoManager:f,errorPanel:s=o.ErrorPanel,onKeyDown:d,workbook:h,createWorkbookOptions:u,onWorkbookChange:b,logo:p,importExportDisabled:g=!1,themeOptions:S,autoFocus:C=!1,commands:y,title:x,onTitleChange:w,titleProps:j,renderLoadingPanel:T,...E}=l,I=a.useRef(null),D=k.useCallbackRef(b,[b]),N=k.useCallbackRef(w??j?.onTitleChange,[w??j?.onTitleChange]),L=j?.placeHolder??"Untitled",P=S?.mode,{themeMode:v,source:F}=o.useResolvedThemeMode({mode:P}),H=a.useMemo(()=>({...S,light:o.createExhibitTheme(!1,Fe.CommonUtils.deepMerge(S?.theme??{},S?.light??{})),dark:o.createExhibitTheme(!0,Fe.CommonUtils.deepMerge(S?.theme??{},S?.dark??{}))}),[S]),A=v===o.ThemeMode.Dark,[$,M]=a.useState(null);a.useEffect(()=>{M(f??new Fe.UndoManager)},[f]);const[R,K]=a.useState(null),[X,q]=a.useState(null),U=le.useDocThemes();a.useLayoutEffect(()=>{if(!h||Object.keys(h).length===0&&!Fe.CommonUtils.isPromiseLike(h)){const Z={theme:U.getDefaultTheme(),...u};q(new O.Workbook(Z))}else q(h)},[h]),a.useLayoutEffect(()=>{if(X){if(X instanceof O.Workbook)return K({workbook:X}),void(h!==X&&D?.(X));(async()=>{try{let Z,te=await Promise.resolve(X);te&&te.source&&(te=await Ve.read(te)),te.workbook?(Y(te.title),Z=te.workbook):Z=te,D?.(Z),K({workbook:Z})}catch(Z){D?.(null),K({error:Z})}})()}},[X]);const[Q,ee]=a.useState(null);a.useEffect(()=>{if(!$||!R)return;$.clear();const Z=R?.workbook?.getTransactions();if(Z)return Z.addListener({onCommitEnd:te=>{te.getDescription()?$.addUndoOperation({description:te.getDescription(),undo:()=>(Z.revert(te.getId()),Q.source?.focus(),()=>{Z.restore(te.getId()),Q.source?.focus()})}):console.warn("commit has no description",te)}})},[$,R,Q]);const _=k.useCallbackRef(Z=>{Z?$.setRepeatableOperation({description:Z.label(),repeat:async()=>Z.execute()}):$.setRepeatableOperation(null)},[$]),[W,Y]=a.useState(x??j?.title??"");a.useEffect(()=>{Y(x??j?.title??"")},[x??j?.title]),a.useEffect(()=>{N?.(W)},[W]);const[ne,be]=a.useState(null),ge=a.useMemo(()=>{const Z=()=>({contains:te=>!0,focus(){}});return y?y.createChildGroup(Z,"application",!1):new k.CommandGroup(Z,"application")},[y]),xe=k.useCallbackRef(Z=>{be(Z.source.getViewportElement()),ee(Z),ge.activate("sheet"),c?.(Z)},[ge]);a.useEffect(()=>{Q&&C&&Q.source?.focus(typeof C=="object"?C:void 0)},[Q]);const Ee=a.useRef(null),se=a.useCallback(Z=>{let te=null;return j?.hidden||(te=e.jsx(dn,{...j,style:{maxWidth:"100%",...j?.style},workbook:I.current,ref:Ee,title:W,placeHolder:L,onTitleChange:ue=>{Y(ue)}})),e.jsx(_a,{...Z,logo:p,mainElement:te,showFileMenu:!g,showAppearanceMenu:!!(H?.onEnabledDarkGridChange||H?.onEnabledDarkImagesChange||H?.onModeChange)})},[p,W,j,H,g,ge]);a.useEffect(()=>{const Z=te=>te.preventDefault();return I.current?.addEventListener("wheel",Z,{passive:!1}),()=>{I.current?.removeEventListener("wheel",Z)}},[]);const Se=a.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:T?.(Z)??e.jsx(o.LoadingPanel,{...Z})})},[t,r,T]),z=a.useCallback(({error:Z})=>(m?.(Z),e.jsx(s,{sx:t,style:r,error:Z??"Unable to display empty workbook."})),[t,r,m]),J=a.useMemo(()=>({...t,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-MuiContent *":{fontFamily:Z=>Z.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[t]),ce=Dt([I,i]),re=a.useMemo(()=>{if(!R)return Se;if(R.error||!R.workbook)return z({error:R.error});let Z=null,te=null,ue=!1;return H&&(Z=A?H.dark:H.light,te=A&&H.enableDarkGrid?H.dark:H.light,ue=H.enableDarkImages),e.jsx(cn,{sx:J,style:r,tabIndex:0,autoFocus:!0,workbook:R.workbook,ref:ce,renderToolbar:se,onElementLoad:xe,onRepeatCommandChange:_,onKeyDown:ie=>{d?.(ie)},renderLoadingPanel:T,gridTheme:te,headersTheme:Z,enableDarkImages:ue,className:fe(n,"sheetxl-workbook"),onContextMenu:ie=>ie.preventDefault(),...E},"WorkbookElement")},[R,W,$,Se,T,H,E,se,J]);let ae=e.jsx(bi,{fallbackRender:z,children:e.jsx(_i,{maxSnack:3,domRoot:ne,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(Z,te,ue)=>{I.current?.focus()},Components:{error:$a},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(o.ErrorAlertIcon,{style:{marginRight:"8px"}})},children:e.jsx(o.ModalProvider,{children:e.jsx(qa,{workbook:R?.workbook,setWorkbook:q,importExportDisabled:g,titlePlaceHolder:L,titleWorkbook:W,setWorkbookTitle:Y,refWorkbookTitle:Ee,commands:ge,undoManager:$,themeOptions:H,children:re})})})});return H&&(ae=e.jsxs(G.ThemeProvider,{theme:A?H.dark:H.light,children:[H.cssBaseline?e.jsx(B.CssBaseline,{}):null,ae]})),ae}));ro.displayName="EagerStudio";const Xi=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:ro,default:ro},Symbol.toStringTag,{value:"Module"}));exports.AppearanceCommandButton=na,exports.AutoColorPosition=dt,exports.BorderCommandButton=Dr,exports.BorderPopupButton=Pr,exports.BorderStyleButton=Mr,exports.Checkboard=Ir,exports.ClearCommandButton=zo,exports.ColorButton=ao,exports.ColorCommandButton=ut,exports.ColorPanel=Rr,exports.ColorPanelType=Er,exports.ColorPopupButton=Ho,exports.DeleteCellsCommandButton=Vo,exports.DocThemeCommandButton=oa,exports.EagerStudio=ro,exports.FillCommandButton=Hr,exports.FilterColumnMenu=Jo,exports.FilterCommandButton=Rl,exports.Filters=ha,exports.FindCommandButton=Ar,exports.FontFamilyCommandButton=Vr,exports.FontSizeCommandButton=Or,exports.FormulaBar=Zo,exports.FreezeCommandButton=Nr,exports.HelpCommandButton=ra,exports.HorizontalAlignCommandButton=vr,exports.InsertCellsCommandButton=Wo,exports.InsertImageCommandButton=qo,exports.InsertScriptCommandButton=wa,exports.MergeCommandButton=Fr,exports.NamedCollectionEditor=Yo,exports.NamedInput=ia,exports.NumberFormatCommandButton=Lr,exports.PasteCommandButton=_o,exports.PresetCellStylesCommandButton=Gr,exports.PresetTableStylesCommandButton=Jr,exports.QuickFormulaSumCommandPopupButton=Nl,exports.RangeInput=sa,exports.RunScriptCommandButton=an,exports.ScriptEditorToolbar=nn,exports.ScriptWorkspace=rn,exports.SheetTab=Qo,exports.SheetTabMenu=en,exports.SheetZoomScale=Ko,exports.SheetsAllMenu=tn,exports.SortFilterCommandButton=$o,exports.StatusBar=Go,exports.Studio=Ea,exports.StyledStrokeIcon=Do,exports.TableStyleCanvasPreview=Zr,exports.TableStyleOptionsPanel=Dl,exports.TableStylePreview=Yr,exports.TextEffectsCommandButton=$r,exports.TextOverflowCommandButton=Tr,exports.TextRotateCommandButton=Br,exports.ThemeSelectButton=Qr,exports.ThemeSelectPanel=ea,exports.ThemeSelectPopupButton=ta,exports.UnderlineCommandButton=Ur,exports.UndoRedoCommandButton=Uo,exports.VerticalAlignCommandButton=jr,exports.ViewGridLinesCommandButton=zr,exports.ViewHeadingsCommandButton=_r,exports.WalkingCopyCommandButton=lo,exports.WorkbookContextMenu=sn,exports.WorkbookElement=cn,exports.WorkbookIO=Ve,exports.WorkbookStrip=ln,exports.WorkbookTitle=dn,exports.WorkbookViewCommandButton=qr,exports._WorkbookIO=Va,exports._extends=to,exports._objectWithoutPropertiesLoose=on,exports._setPrototypeOf=oo,exports.clsx=$e,exports.clsx$1=fe,exports.commonjsGlobal=st,exports.createGridStyleFromMUITheme=Ao,exports.defaultNewWorkbook=Ta,exports.getDefaultExportFromCjs=function(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l},exports.requirePropTypes=Pt,exports.setPrintExamplesOnLoad=l=>{fa=l},exports.useMeasure=pt,exports.useWorkbookCommands=ja;