@sheetxl/react 0.4.11 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{Cy9Ib1lJhSZ_F6tM.cjs → CKVg7_r0lkW-LlWI.cjs} +1 -1
- package/browser/cjs/{BzWYAy7dpLOCOqnE.cjs → CMot57AffbcQ1rTc.cjs} +1 -1
- package/browser/cjs/{CFVxx0I-M-vqu3xC.cjs → DNsl3Zc49ltOZBkT.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{DpKcTdC5MSNsa5UP.mjs → CdBScEuZfN3pS3Dq.mjs} +1 -1
- package/browser/esm/{DGWjkC_oxdK41IpV.mjs → CpijeXYVzR61ZTbz.mjs} +1 -1
- package/browser/esm/{aD5wMdElQe_6jVAV.mjs → M3Z8aYIyYselD29H.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/node/esm/{CSUpQa03txMWLjz5.mjs → DNCT42SObUn4px_J.mjs} +1 -1
- package/node/esm/index.mjs +2 -2
- package/package.json +5 -5
package/browser/cjs/index.cjs
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
})();
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.
|
|
8
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.12
|
|
9
9
|
*
|
|
10
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
12
|
*/
|
|
13
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@sheetxl/sdk"),t=require("@sheetxl/utils-react"),n=require("react/jsx-runtime"),o=require("@sheetxl/utils"),r=require("react"),l=require("@sheetxl/grid-react"),i=require("react-dom"),a=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),s=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:a},Symbol.toStringTag,{value:"Module"})),d=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),c=(e,t=!0,n=d)=>{if(!n||0===n.length)return e;if(void 0===e)return n[0];if(t&&e>=n[n.length-1])return e;if(!t&&e<=n[0])return e;let r=o.CommonUtils.findEqualOrGreater(n,e);return t?(n[r]===e&&(r+=1),n[r]||(r-=1),n[r]):(r-=1,n[r])},u=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:d,findNextFontSize:c},Symbol.toStringTag,{value:"Module"})),g=r.memo(e=>{const{anchorLocation:t=o.AnchorLocation.TopLeft,cellWidth:r,cellHeight:l,size:i=7,inset:a=1,darkMode:s,fill:d,pathProps:c,style:u,...g}=e,h=i,m=a;let f="red",p=[],v=[];return t===o.AnchorLocation.TopLeft?(f=s?"rgb(255, 198, 246)":"green",p.push(m),v.push(m),p.push(m+h),v.push(m),p.push(m),v.push(m+h)):t===o.AnchorLocation.TopRight?(f=s?"rgb(0, 255, 255)":"red",p.push(r-m),v.push(m),p.push(r-(m+h)),v.push(m),p.push(r-m),v.push(m+h)):t===o.AnchorLocation.BottomRight?(f=s?"rgb(236, 252, 211)":"purple",p.push(r-m),v.push(l-m),p.push(r-(m+h)),v.push(l-m),p.push(r-m),v.push(l-(m+h))):t===o.AnchorLocation.BottomLeft&&(f=s?"rgb(255, 236, 183)":"blue",p.push(m),v.push(l-m),p.push(m+h),v.push(l-m),p.push(m),v.push(l-(m+h))),n.jsx("svg",{width:`${r}`,height:`${l}`,viewBox:`0 0 ${r} ${l}`,style:{position:"absolute",width:`${r}px`,height:`${l}px`,pointerEvents:"none",...u},...g,children:n.jsx("path",{d:`M ${p[0]} ${v[0]} L ${p[1]} ${v[1]} L ${p[2]} ${v[2]} L ${p[0]} ${v[0]} Z`,fill:d??f,...c})})}),h=e=>{const{renderBounds:t,darkMode:o,zoom:l,disabled:i,filter:a,onFilterButtonMouseDown:s,style:d,...c}=e,u=r.useMemo(()=>{let e=null;const t=a.getSortField();t&&(e=t.reverse);const n=a.getField(),o=n&&n.criteria&&n.criteria.length>0;return!0===e?o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":!1===e?o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"m 3,5.025 4.5,5 4.5,-5 z"},[a]),[g,h]=r.useState(!1);const m=Math.min(Math.min(18,t.height-8),t.width);return n.jsx("div",{style:{width:`${m}px`,height:`${m}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${g&&!i?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(m>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:i?void 0:"pointer",...d},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onMouseDown:e=>{s?.(e,a)},...c,children:n.jsx("svg",{width:""+15*l,height:""+15*l,viewBox:"0 0 15 15",style:{fill:`var(${g&&!i?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:i?.6:1},children:n.jsx("path",{d:u})})})},m=r=>{const{value:l,coords:i,bounds:a,children:s,style:d,range:c,zoom:u=1,view:m,bodyStyle:f,normalStyle:p,showFormulas:v,showZeros:C,docTheme:b,onLinkMouseDown:w,onFilterButtonMouseDown:y,filterButtonProps:x,createFilterButton:q=h,...S}=r,R=a.height/u,k=a.width/u,M=l,T=M.getValue(),I=l.getStyle(),E=f?.darkMode??!1;let F,A;const D=T&&T.isFormulaError,z=D&&T instanceof e.FormulaError.Parse;let N,L=v||z;if(L)if(M.isSpillOverflow())A="";else{const t=M.getFormulaText();t?A=t:F=M.getNumberFormat(e.NumberFormat.Type.General)}else F=M.getNumberFormat();L||(N=M.getTextOverflow());const O=N?N.colBounds.width+N.leftOffset+N.rightOffset:k,j=N?N.anchorBounds.x-N.leftOffset:0,B=N?N.anchorBounds.width:k,V=N?N.anchorBounds.x:0;let P,H=M.getRenderHorizontalAlignment();F&&(P=F?.formattedRuns,A=P?.runs[0]?.text??F.displayText);const U=M.getCalcStatus()===e.ICell.CalcStatus.Pending;let K=null,W=I.getFill().toCSS(E,a),$=0,G=0;if(!I.getBorder().isEmpty()){const t=I.getBorder().getRight();!t.isNone()&&e.IBorder.BuiltInDefinitions.get(t.getStyle()).width>1&&($=1);const n=I.getBorder().getBottom();!n.isNone()&&e.IBorder.BuiltInDefinitions.get(n.getStyle()).width>1&&(G=1)}let _=null;if(k!==B||$||G||"number"==typeof W?.backgroundPosition){const{backgroundPosition:e,...o}=W,r=e??0,l=m?.getScrollTopLeft(),i=r?-(a.x+(l.left??0))%r:0,s=r?-(a.y+(l.top??0))%r:0;(void 0!==e||$||G||k!==B)&&(1===Object.keys(o).length&&"none"===o.background||(W=null,_=n.jsx("div",{className:"fill",style:{marginLeft:`${i}px`,marginTop:`${s}px`,left:V*u,width:t.ReactUtils.boundPixel(B*u-i+1+$),height:t.ReactUtils.boundPixel(a.height-s+1+G),...o}},"background")))}let Z=null;const X=M.getComments(),Y=M.getWarnings(),J=M.getErrors();if(X||D||J.length>0||Y.length>0){const e={size:7*u,darkMode:E,cellWidth:B*u+2,cellHeight:R*u+2,style:{top:-1,left:V*u-1}};Z=Z??[],(Y.length>0||J.length>0||D)&&Z.push(n.jsx(g,{anchorLocation:o.AnchorLocation.TopLeft,...e},`indicator-${Z.length}`)),X&&Z.push(n.jsx(g,{anchorLocation:o.AnchorLocation.TopRight,...e},`indicator-${Z.length}`))}const Q=I.getFont();let ee=F?.conditionalColor;const te=I.getAlignment(),ne=te.getHorizontal()===e.ITextFrame.HorizontalAlignment.Fill,oe=te.getHorizontal()===e.ITextFrame.HorizontalAlignment.CenterContinuous||ne,re=oe||L?0:te.getRotation(),le=M.getInsets(),ie=le.top+le.bottom;let ae=le.left,se=le.right;const de={...d,left:d.left-1,top:d.top-1,width:d.width+1+$,height:d.height+1+G},ce=M.getColumnFilter(),ue=ce&&!ce?.hasHiddenButton();let ge=null;U&&(ge=n.jsxs("div",{className:"slider",children:[n.jsx("div",{className:"line"}),n.jsx("div",{className:"subline inc"})]},"pending"));const he=!(U||ue||_||s||Z||P?.runs.length>1||N||re%360!=0);"none"===W?.background&&(W=null);let me=oe||!(!N||!(N.rightIndex>0||N.leftIndex>0||N.colSpan>1));if(!me){const e=M.getSpans();(e.width>1||e.height>1)&&(me=!0)}const fe={...W,...de,pointerEvents:w?"auto":void 0};if(!o.CommonUtils.isEmpty(A)||!o.CommonUtils.isEmpty(F?.repeatPlaceholder)){const t=F?.canWrap??!1;let r=null,l=null,i=null,a=[],s=!0;C||L||0!==T||(s=!1);const c=M.getTextFrame(L);if(s&&c){let s=O-1-(ae+se);if(re){const t=c.layout();r=t.bounds;const n={x:0,y:0,width:O-1,height:R};if(P){let t=P.width;if(F.repeatPlaceholder||F.repeatChars.length>0){const o=e.GeomUtils.boundsToPoints(n),r=e.GeomUtils.rotatePoints(o,-re);t=e.GeomUtils.minBoundingRect(r).width}r={...r,width:t}}i=e.GeomUtils.clipToOuterRect({...r,width:r.width+1+ae+se},n,re),s=i.width-1-(ae+se)+.01}let g=null;t&&(g={width:s});let h=null,m=F?.repeatPlaceholder;const f=c.layout(g);if(r=f.bounds,L?r={...r,width:0}:P&&(r={...r,width:F.repeatPlaceholder||F.repeatChars.length>0?s:P.width}),re&&t){let t=null;f.visitLines({visitTextLine:(n,o)=>{let r=n.bounds;const l=e.GeomUtils.boundsToPoints(r),i=e.GeomUtils.rotatePoints(l,re),a=e.GeomUtils.minBoundingRect(i);r={...r,x:(a.width-r.width)/2,y:(a.height-r.height)/2},t=t?e.GeomUtils.unionBounds(t,r):r}}),r={...t,width:t.width+ae+se}}if(!m&&M.getType()!==e.ScalarType.String&&Math.floor(r.width)>s){if("General"===I.getNumberFormat()&&M.getType()===e.ScalarType.Number){const e=I.measureText("0"),t=Math.floor(s/e.width),n=T,r=o.CommonUtils.splitNumber(n),l=Math.min(10,t-(Math.max(1,r.ipLength)+1)-(n<0?1:0));if(l>=-1){const e=`0${l>0?".":""}${"#".repeat(Math.max(0,l))}`;h=M.getNumberFormat(e).displayText,"0"===h&&n<0&&(h="-0")}else if(Math.abs(n)>=Math.pow(10,5)||Math.abs(n)<=Math.pow(10,-5)){const e=t-5-(n<0?1:0);if(e>=0){const t=`0.${"0".repeat(Math.max(0,e-1))}E+00`;h=M.getNumberFormat(t).displayText}}}h||(m="#")}if(!m&&P?.lastRepeatIndex>=0&&P?.width>s&&(m="#"),m&&s>0){const e=I.measureText(m),t=Math.floor((s||1)/(e?.width||1));h=t>0?m.repeat(t):""}if(L&&(H=e.ITextFrame.HorizontalAlignment.Left),h){const e=I.measureText(h).width;e&&(r={...r,width:e})}if(l={...r,width:r.width+ae+se,height:r.height},re&&!t){const t=e.GeomUtils.boundsToPoints(l),n=e.GeomUtils.rotatePoints(t,re),o=e.GeomUtils.minBoundingRect(n);l.width=o.width,l.height=o.height}H===e.ITextFrame.HorizontalAlignment.Center||H===e.ITextFrame.HorizontalAlignment.CenterContinuous?l.x=(O-l.width)/2:H===e.ITextFrame.HorizontalAlignment.Right?l.x=O-l.width-.5:l.x=.5,te.getVertical()===e.ITextFrame.VerticalAlignment.Center?l.y=(R-l.height)/2:te.getVertical()===e.ITextFrame.VerticalAlignment.Bottom?l.y=R-l.height-ie:l.y=ie;const p=he?{...S}:void 0,v={style:{left:d.left-1,top:d.top-1,width:d.width+1,height:d.height+1,transform:re?`rotate(${re}deg)`:void 0,cursor:w?"pointer":void 0,pointerEvents:w?"auto":void 0,zIndex:me?1:void 0,...W},onMouseDown:w,onDoubleClick:w?e=>{e.stopPropagation(),e.preventDefault()}:null,...p};z&&(v.style.textDecorationStyle="wavy",v.style.textDecorationColor=E?"rgb(0, 255, 255)":"red",v.style.textDecorationLine="underline");const C=Q.getSize(),b=(o,i,d,c,g,h,m,f=null)=>{let p=C*u,v=d,b=m?.runs?m.runs:[{type:e.NumberFormat.ParseRunType.Text,text:o,width:I.measureText(o,p).width}];m&&m?.width!==r.width&&(r={...r,width:m?.width});let w=ae;if(m?.lastRepeatIndex>=0&&s>m?.width){const t=m.runs[m.lastRepeatIndex];if(t){const n=[...b],o=Math.max(0,s-1-m.width);let l=0,i="";if(o>0){const e=Math.floor(o/t.width);i=e>0?t.text.repeat(e):"",l=o}n[m.lastRepeatIndex]={type:e.NumberFormat.ParseRunType.Repeat,text:i,width:l},b=n,r={...r,width:m.width+l}}}const y=(o,r,l,i,s,d,c,m,f,C=null)=>{let b,y=v.width;g===e.ITextFrame.HorizontalAlignment.Justify?(y=s,h||(b="justify")):g===e.ITextFrame.HorizontalAlignment.Distributed&&(y=s,b=h||o.text.split(" ").length-1==0?"center":"justify");const{style:x,className:q,...S}=C;let R=o.text;if(g===e.ITextFrame.HorizontalAlignment.Fill&&0===F?.repeatChars.length){const e=Math.max(1,Math.floor((v?.width??0)/(c?.width??1)));R=R.repeat(e)}let k=v.height;const M=Q.getVerticalAlignment(),T=M===e.IFont.VerticalAlignment.Sub,I=M===e.IFont.VerticalAlignment.Super;if(T||I){const e=Q.getSuperSubScale();p*=e,k*=e}const A={textAlign:b,textAlignLast:b,background:void 0,...x,...Q.toCSS(E,u,!0),fontSize:p*e.IFont.getDeviceScale()};ee&&(A.color=ee.toCSS(E));const D=w+r;let z=le.top+v.y+0;if(T&&(z+=f-p),d){const e=(c.x+D)*u+1,t=(c.y+z)*u+1;t<0?A.marginTop=t:A.paddingTop=t,e<0?(A.width=(x?.width??0)-e,A.left=(x?.left??0)+e):A.paddingLeft=e,A.paddingRight=Math.max(0,(x?.width??0)-y*u-e),A.paddingBottom=Math.max(0,(x?.height??0)-v.height*u-t),A.height=(x?.height??0)+(t<0?-t:0),(t<0||e<0)&&(A.clipPath=`inset(${t<0?-t:0}px 0px 0px ${e<0?1-e:0}px)`)}else if(A.left=(c.x+D)*u+1,A.top=(c.y+z)*u+1,A.width=c.width*u,A.height=c.height*u,re&&!t){A.left=(c.x+r)*u+1,A.top=(c.y+(v.y+0))*u+1;const t=e.GeomUtils.centerPoint({x:w+r,y:0,width:o.width,height:v.height}),n=e.GeomUtils.centerPoint({x:w,y:0,width:s,height:v.height}),l=e.GeomUtils.rotatePoints([t],re,n),i={x:l[0].x-t.x,y:l[0].y-t.y};A.left=A.left+i.x*u,A.top=A.top+i.y*u;const a={...v,x:w,y:le.top,width:v.width+(ae+se)},d=e.GeomUtils.boundsToPoints(a),g=e.GeomUtils.rotatePoints(d,re),h=e.GeomUtils.minBoundingRect(g);a.width=h.width,a.height=h.height;const m=e.GeomUtils.centerPoint(a),f={x:m.x-n.x,y:m.y-n.y};A.left=A.left+f.x*u,A.top=A.top+f.y*u}A.lineHeight=k*u+"px";const N=he?void 0:"text-line";a.push(n.jsx("div",{className:q?`${q} ${N}`:N,style:A,...S,children:R},`text-${v.y}-${i}-${l}`))};if(te.getOverflow()===e.ITextFrame.Overflow.Shrink&&s>0){let e=r?.width??0,t=0;for(;e>1&&e>s&&p>2&&t<100;){p*=s/e;e=I.measureText(o,p).width,t++}r={...r,width:e}}let x=v.x;g===e.ITextFrame.HorizontalAlignment.Right?x+=r.width-v.width:g!==e.ITextFrame.HorizontalAlignment.Center&&g!==e.ITextFrame.HorizontalAlignment.CenterContinuous||(x+=(r.width-v.width)/2),m?.lastRepeatIndex>=0&&(x=v.x);const q=b.length;for(let t=0;t<q;t++){const n=b[t];if(n.type===e.NumberFormat.ParseRunType.Text||n.type===e.NumberFormat.ParseRunType.Repeat){n.type,e.NumberFormat.ParseRunType.Repeat;y(n,x,t,i,g===e.ITextFrame.HorizontalAlignment.Justify||g===e.ITextFrame.HorizontalAlignment.Distributed||m?.lastRepeatIndex>=0?s:v.width,he,{x:l.x+j,y:l.y,width:n.width,height:r.height},0,c,f)}x+=n.width}};h?b(h,0,{x:0,y:0,...r},f.lines[0].baseline,H,!0,null,v):f.visitLines({visitTextLine:(t,n,o)=>{const l=t.runs[0].text.replace(/\s+$/,""),i=n===o-1;let a=H===e.ITextFrame.HorizontalAlignment.Justify&&(i||t.runs[0].text.endsWith("\n"))?e.ITextFrame.HorizontalAlignment.Left:H,d=0;n>0&&(te.getVertical()===e.ITextFrame.VerticalAlignment.Distributed||te.getVertical()===e.ITextFrame.VerticalAlignment.Justify)&&(d=Math.max(0,(R-(ie+3)-t.bounds.height*o)/(o-1)*n)),te.getVertical()===e.ITextFrame.VerticalAlignment.Distributed&&re&&re%90==0&&re%180!=0&&(a=e.ITextFrame.HorizontalAlignment.Distributed),a!==e.ITextFrame.HorizontalAlignment.Justify&&a!==e.ITextFrame.HorizontalAlignment.Distributed&&a!==e.ITextFrame.HorizontalAlignment.Fill||(r={...r,width:s});const u={...t.bounds,y:t.bounds.y+d+0,width:ne||F&&(F.repeatChars.length>0||F.spacingChars.length>0)?r.width:t.bounds.width};b(l,n,u,c.lines[0].baseline,a,i,1===o?P:null,he&&n>0?{...v,style:{...v.style,background:void 0}}:v)}})}a.length>0&&(K=a)}if(he)return K&&K.length>0?K:n.jsx("div",{style:fe,...S});let pe=w?"auto":de.pointerEvents,ve=null;if(ue){const e={x:V*u-1,y:-1,width:B*u+1,height:R*u+1};pe="auto",ve=q({renderBounds:e,darkMode:E,className:"filter-button",disabled:!M.isEditAllowed(),zoom:u,filter:M.getColumnFilter(),onFilterButtonMouseDown:y,...x}),ve&&(ve=n.jsx("div",{style:{...e,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:ve},"filterButton"))}U&&!K&&(K=n.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const Ce=[_,K,s,Z,ge,ve];return n.jsx("div",{style:{...W,...de,pointerEvents:pe},...S,children:Ce})},f={text:"",placeholder:""},p=(e,t)=>{if(!e.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=t??e.dirty??"";return 0===n.length||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},v=Object.freeze([t.KeyCodes.Delete,t.KeyCodes.Home,t.KeyCodes.End]),C=r.memo(r.forwardRef((i,s)=>{const{editState:d,onStartEdit:c,onChangeEdit:u,onSubmitEdit:g,onCancelEdit:h,onDoneEdit:m,defaultTextStyle:C,useRichStyling:b=!0,bodyStyle:w,activeCoords:y,sheet:x,commands:q,containerBounds:S,setNaturalDimensions:R,onFocus:k,disabled:M,style:T,zoom:I=1,linesVisible:E,autoFocus:F=!1,...A}=i,{height:D=0,width:z=0}=S??{},N=w?.darkMode??!1,L=r.useRef(null),[O,j]=r.useState(!1),[B,V]=r.useState(null),[P,H]=r.useState(()=>d);r.useEffect(()=>{Y.current=!1,H(d)},[d]);const U=r.useMemo(()=>{const t=P.clean();let n=t.getStyle();b||(n=n.createTemporaryStyle({font:{size:C?.fontSize}}));const r=t.getFormula(),l=n.getAlignment(),i=r?e.ITextFrame.HorizontalAlignment.Left:l.getHorizontal(),a=l.getVertical(),s=l.getOverflow()===e.ITextFrame.Overflow.Wrap||t.getType()===e.ScalarType.String&&(i===e.ITextFrame.HorizontalAlignment.Justify||i===e.ITextFrame.HorizontalAlignment.Distributed||a===e.ITextFrame.VerticalAlignment.Justify||a===e.ITextFrame.VerticalAlignment.Distributed),d=(e=>{if(!e)return f;const t=e.clean();if(!t)return f;let n=t.getStyle()?.getQuotePrefix();if(void 0===e.dirty||null===e.dirty){let o="",r=t.getFormulaText();r&&(o=r,n=!1),o||(o=t.toTextUnformatted(!0)??"");let l="";if(!e.editMode&&t.isSpillOverflow()){const e=t.getSpill();if(e){const n=e.getCell(),o=n.getFormulaText();n.isEqual(t)||(l=o)}}return n&&(o="'"+o),{text:o,placeholder:l}}return{text:e.dirty??"",placeholder:""}})(P),c=d.text,u=e.ITextFrame.toCSSHorizontalTextAlign(b&&!r?P.clean()?.getRenderHorizontalAlignment():e.ITextFrame.HorizontalAlignment.Left);return{style:n,isWrapped:s,textValue:c,formula:r,frameVertAlign:a,placeholder:d.placeholder,insets:b?t.getInsets():o.TypesUtils.EmptyRect,textAlign:u}},[P,C,N,I,b]),K=r.useRef(null),W=t.useImperativeElement(s,()=>({startEdit:e=>{L.current=e?.initialSelection;const t={...d,editMode:e?.editMode??!1};void 0!==e?.text&&(t.dirty=e.text),t.editMode===d.editMode&&t.dirty===d.dirty||(H(t),_?.(t))},submitEdit:()=>J(),cancelEdit(){Q()},autoFocus(){K.current.focus()},dispatchEvent:e=>K.current.dispatchEvent(e),focus(){K.current.focus()},getLineHeight:G}),[c,d]);r.useLayoutEffect(()=>{if(!B||!O)return;const e=K.current;U.textValue,e&&e.setSelectionRange(B.start,B.end,B.direction)},[K.current,B,U.textValue]);const $=r.useMemo(()=>{const t=P?.clean(),n=U.style.createTemporaryTextFrame(U.textValue,t?.getType()===e.ScalarType.String),o=b?t.getInsets().right+t.getInsets().left:0;let r=null;U.isWrapped&&(r={width:z-o});return n.layout(r)},[U,z,P,b]),G=t.useCallbackRef(()=>Math.ceil($?.lines[0]?.bounds.height),[$]);r.useLayoutEffect(()=>{if(!$)return;const e=U.style,t=e.getInsets()??o.TypesUtils.EmptyRect,n=b?t.left+t.right:0,r=b?.04*e.getFont().getSize():1,l=Math.round(U.isWrapped?void 0:$.bounds.width+n+r),i=Math.round($.bounds.height);R?.({width:l,height:i})},[$,R,U,b,P]);const _=t.useCallbackRef(u,[u]),Z=t.useCallbackRef(e=>{if(P.dirty===e)return;const t={...P};t.dirty=e,K.current,H(t),_?.(t)},[P]),X=t.useCallbackRef(e=>{if(P.editMode===e)return;const t={...P};t.editMode=e,H(t),_?.(t)},[P]),Y=r.useRef(!1),J=t.useCallbackRef(()=>{if(Y.current)return!1;try{g?.(P),m?.(),Y.current=!0}catch(e){return!1}return!0},[g,P]),Q=t.useCallbackRef(()=>{Y.current=!0,H(d),h?.(),m?.()},[h,d]),ee=t.useCallbackRef(n=>{if(!K.current)return;if(n.key,n.isDefaultPrevented(),!(n.isTrusted||n.nativeEvent.ctrlKey||n.nativeEvent.metaKey||n.nativeEvent.altKey||n.nativeEvent.isComposing||-1===l.STANDARD_KEY_CHARS.indexOf(n.nativeEvent.key)&&"Backspace"!==n.nativeEvent.key)){const e={...P};let t=0;return p(e,e.dirty)&&!isNaN(parseFloat(n.key))?(e.dirty?.endsWith("%")?e.dirty=(e.dirty.substring(0,e.dirty.length-1)??"")+n.key+"%":e.dirty=(e.dirty??"")+n.key+"%",t=e.dirty.length-1):"Backspace"===n.nativeEvent.key?(e.dirty="",t=e.dirty.length):(e.dirty=(e.dirty??"")+n.key,t=e.dirty.length),K.current.value=e?.dirty,L.current={start:t,end:t,direction:"forward"},K.current?.setSelectionRange(t,t,"forward"),H(e),_?.(e),void n.preventDefault()}const o=n.nativeEvent.ctrlKey,r=n.nativeEvent.shiftKey,i=n.nativeEvent.altKey,a=n.nativeEvent.metaKey;if(o&&"z"===n.key&&n.stopPropagation(),n.which===t.KeyCodes.Escape)return n.preventDefault(),void Q();if(n.which===t.KeyCodes.F2)return X(!0),void n.preventDefault();const s=n.target;if("%"===n.key&&s.selectionStart===s.selectionEnd&&"%"===s.value[s.selectionStart]&&P?.clean().getStyle().numberFormat.includes("%"))return V({start:s.selectionStart+1,end:s.selectionEnd+1,direction:s.selectionDirection}),void n.preventDefault();if(n.which===t.KeyCodes.Enter){if(n.preventDefault(),a||i){const e=U.textValue.substring(0,s.selectionStart)+"\n"+U.textValue.substring(s.selectionEnd);return Z(e),void V({start:s.selectionStart+1,end:s.selectionStart+1,direction:s.selectionDirection})}return void(J()&&x.getSelection().traverse(e.IRange.Orientation.Column,r))}if(n.which===t.KeyCodes.Tab)return n.preventDefault(),void(J()&&x.getSelection().traverse(e.IRange.Orientation.Row,r));let d=null;switch(n.which){case t.KeyCodes.Left:d=e.IRange.Direction.Left;break;case t.KeyCodes.Right:d=e.IRange.Direction.Right;break;case t.KeyCodes.Up:d=e.IRange.Direction.Up;break;case t.KeyCodes.Down:d=e.IRange.Direction.Down}if(d){if(!(o||r||i||a)&&!P.editMode)return void J()}P.editMode&&(d||v.includes(n.which))&&n.stopPropagation()},[P,x,U]),te=r.useCallback(()=>{K.current?.focus(),setTimeout(()=>{K.current?.select()},0)},[]),ne=r.useCallback(()=>{K.current?.focus(),console.log("implement toggleRelativeReferences")},[]),oe=t.useCallbackRef(()=>{const e=K.current?.value;let t="";if(y.rowIndex>0){const e=x.getRange({rowIndex:y.rowIndex-1,colIndex:y.colIndex}).getCell();e&&(t=e.toTextUnformatted(!0))}Z(e+t)},[y,x]);r.useEffect(()=>x.getRange(y).addListener(()=>{const e={...P,clean:()=>x.getRange(y).getCell()};H(e),_?.(e)}),[y,x]);const re=r.useCallback(()=>{const e=P.clean().createTemporaryCell({value:a(),style:{numberFormat:"Medium Time"}}).toText();Z((K.current?.value??"")+e)},[x]),le=r.useCallback(()=>{const e=P.clean().createTemporaryCell({value:a(),style:{numberFormat:"Short Date"}}).toText();Z((K.current?.value??"")+e)},[x]),ie=r.useMemo(()=>({element:()=>K.current,doCopy:e=>{const t=K.current.value.substring(K.current.selectionStart,K.current.selectionEnd);if(e?.isCut){const e=K.current.value.substring(0,K.current.selectionStart)+K.current.value.substring(K.current.selectionEnd,K.current.value.length);Z(e)}return t}}),[K.current]),ae=r.useMemo(()=>({element:()=>K.current,doPaste:async(e,t)=>{const n=await(e.toText?.());if(!n)return!0;const o=K.current.value.substring(0,K.current.selectionStart)+n+K.current.value.substring(K.current.selectionEnd,K.current.value.length);return Z(o),V({start:K.current.selectionStart+n.length,end:K.current.selectionStart+n.length,direction:"forward"}),!0}}),[K.current]),se=r.useMemo(()=>({contains:e=>K.current?.contains(e)||!1,focus(){K.current.focus()}}),[]),de=r.useMemo(()=>[new t.SimpleCommand("selectAll",se,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[t.KeyModifiers.Ctrl]}},te),new t.SimpleCommand("startEditValueAbove",se,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[t.KeyModifiers.Ctrl]},{key:'"',modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}]},oe),new t.SimpleCommand("startEditCurrentTime",se,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},re),new t.SimpleCommand("startEditCurrentDate",se,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl]}},le),new t.Command("relativeReferencesToggle",se,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},ne),new t.Command("toggleEditorFocus",se,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[t.KeyModifiers.Ctrl]}})],[]),ce=r.useMemo(()=>{let e=null;const n=()=>({contains:e=>K.current?.contains(e)||!1,focus(){K.current.focus()}});return e=q?q.createChildGroup(n,"editor",!1):new t.CommandGroup(n,"editor"),e.addCommands(de,!0),e},[q,de]),ue=r.useMemo(()=>({notifier:null,source:ie,target:ae,commands:ce}),[ie,ae,ce]);t.useCopyPaste(ue);const[ge,he]=r.useState(!F);r.useEffect(()=>{he(!1)},[]);const me=t.useCallbackRef(e=>{j(!0),ce?.activate();const t=L.current;if(!1!==t){let e,n;const o=K.current.value;p(P,o)&&(e=o.length-1,n=o.length-1),e=t?.start??e??o.length,n=t?.end??n??o.length,L.current=!1,V({start:e,end:n,direction:"forward"})}k?.(e)},[k,P]),fe=U.insets;let pe=fe.left+1;const ve=fe.left+fe.right+2-1,Ce=$?.bounds.height??0;let be,we=fe.top;U.frameVertAlign===e.ITextFrame.VerticalAlignment.Center?we=Math.max(0,(D-(fe.top+fe.bottom)-Ce)/2):U.frameVertAlign===e.ITextFrame.VerticalAlignment.Bottom&&(we=Math.max(0,D-(fe.top+fe.bottom)-Ce)),void 0!==E&&$?.lines[0]?.bounds&&(be=$?.lines[0]?.bounds.height*E);const ye=U.style.getFont();let xe=ye.getSize();ye.isSuperSub()&&(xe*=ye.getSuperSubScale()),xe*=e.IFont.getDeviceScale()*I;const qe=b?ye.toCSS(N,I):null;return n.jsx("div",{className:"sheet-cell-editor",onMouseDown:e=>{K.current&&document.activeElement!==K.current&&requestAnimationFrame(()=>{K.current.focus()})},ref:W,...A,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...T},children:n.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:we*I+1,left:pe*I,width:`calc(100% - ${ve*I}px)`,maxWidth:`calc(100% - ${ve*I}px)`,height:(be??Ce)*I,maxHeight:(be??Ce)*I},children:n.jsx("textarea",{spellCheck:"false",placeholder:U.placeholder,ref:K,value:U.textValue,disabled:ge,readOnly:M||x.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...qe,fontSize:xe?`${xe}px`:"inherit",textAlign:U.textAlign,lineHeight:($?.lines[0]?.bounds.height??0)*I+"px",height:($?.bounds.height??0)*I,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:U.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:me,onBlur:()=>{j(!1)},onSelect:e=>{},onChange:e=>{K.current&&!Y.current&&(L.current=!1,Z(e.target.value),U.textValue,e.target.value,e.target.selectionStart,e.target.selectionEnd,e.target.selectionDirection,V({start:e.target.selectionStart,end:e.target.selectionEnd,direction:e.target.selectionDirection}))},onMouseDown:e=>{O&&X(!0)},onKeyDown:ee})})})})),b=(e,t)=>({clean:e,dirty:t,editMode:!1}),w=e=>{const{length:o=0,width:r=1,dashArray:l=null,dashArrayAdditional:i=null,isDouble:a=!1,isAngled:s=!1,offsetX:d=0,offsetY:c=0,isVertical:u=!1,...g}=e,h=e=>{let t=null;if(e&&r>0){t="";for(let n=0;n<e.length;n++)t+=e[n],n<e.length-1&&(t+=",")}return t},m=h(l);let f=m;i&&(f=h(i));let p=r,v=o,C=null;if(a){p=Math.floor(r/2);const e=p+p/2+1;let o=null;o=u?`M ${t.ReactUtils.boundPixel(d+e)} ${t.ReactUtils.boundPixel(c)} L ${t.ReactUtils.boundPixel(d+e)} ${t.ReactUtils.boundPixel(c+v)}`:`M ${t.ReactUtils.boundPixel(d)} ${t.ReactUtils.boundPixel(c+e)} L ${t.ReactUtils.boundPixel(d+v)} ${t.ReactUtils.boundPixel(c+e)}`,C=n.jsx("path",{strokeWidth:p,strokeDasharray:f,d:o,...g})}if(s){p=r/2;const e=p+p/2;let o=f,l=null;l=u?`M ${t.ReactUtils.boundPixel(d+e)} ${t.ReactUtils.boundPixel(c)} L ${t.ReactUtils.boundPixel(d+e)} ${t.ReactUtils.boundPixel(c+v)}`:`M ${t.ReactUtils.boundPixel(d)} ${t.ReactUtils.boundPixel(c+e)} L ${t.ReactUtils.boundPixel(d+v)} ${t.ReactUtils.boundPixel(c+e)}`,C=n.jsx("path",{strokeWidth:p,strokeDasharray:o,strokeDashoffset:"1",shapeRendering:"crispEdges",d:l,...g})}let b=null;return b=u?`M ${t.ReactUtils.boundPixel(d+p/2)} ${t.ReactUtils.boundPixel(c)} L ${t.ReactUtils.boundPixel(d+p/2)} ${t.ReactUtils.boundPixel(c+v)}`:`M ${t.ReactUtils.boundPixel(d)} ${t.ReactUtils.boundPixel(c+p/2)} L ${t.ReactUtils.boundPixel(d+v)} ${t.ReactUtils.boundPixel(c+p/2)}`,n.jsxs(n.Fragment,{children:[n.jsx("path",{strokeWidth:p,strokeDasharray:m,d:b,...g}),C]})};function y(e,t){if("function"==typeof e)return e(t);e&&(e.current=t)}var x=parseInt(r.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const e=y(o,t),r="function"==typeof e;n.push(r?e:()=>y(o,null))}return()=>{for(const e of n)e()}}}:function(e){return t=>{for(const n of e)y(n,t)}},q=function(){},S="undefined"!=typeof window,R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},k=S?r.useLayoutEffect:r.useEffect,M={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const T=S&&void 0!==window.ResizeObserver?function(){var e=r.useState(null),t=e[0],n=e[1],o=r.useState(M),l=o[0],i=o[1],a=r.useMemo(function(){return new window.ResizeObserver(function(e){if(e[0]){var t=e[0].contentRect,n=t.x,o=t.y,r=t.width,l=t.height,a=t.top,s=t.left,d=t.bottom,c=t.right;i({x:n,y:o,width:r,height:l,top:a,left:s,bottom:d,right:c})}})},[]);return k(function(){if(t)return a.observe(t),function(){a.disconnect()}},[t]),[n,l]}:function(){return[q,M]},I=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,E=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,F=t=>{const{key:o,points:r,range:l,stroke:i,darkMode:a,forceThinBorder:s=!1,shiftIfWide:d=!1,isVertical:c=!1,intersections:u,layout:g}=t,h=e.IBorder.BuiltInDefinitions.get(s?e.IBorder.StrokeStyle.Thin:i.getStyle());if(!h)return null;const m=r[0],f=r[1],p=r[2],v=r[3];let C=1+(c?v-f:p-m),b=0;const y=i.getColor().toRGBA(a).toString(),x=h.description.toLowerCase().includes("double");let q,S;const R=c?"rowStart":"colStart",k=c?"rowEnd":"colEnd",M=c?f:m;if(u?.length>0){const t=u[0];if(t?.range[R]===l[R]){const n=e.IBorder.BuiltInDefinitions.get(t.stroke.getStyle());b=Math.floor(n.width/2)}const n=u[u.length-1];if(n?.range[k]===l[k]){const t=e.IBorder.BuiltInDefinitions.get(u[u.length-1].stroke.getStyle());C=Math.floor(C+(2===t.width?0:t.width/2))}if(x){const t=c?"colStart":"rowStart",n=c?"colEnd":"rowEnd",o=c?g?.getRowOffset:g?.getColOffset;let r=0,i=0;q=[],S=[];for(let a=0;a<u.length;a++){const s=u[a];if(s.stroke.getStyle()===e.IBorder.StrokeStyle.Double&&o){const e=o(s.range[R])-(M-b);s.range[t]<l[t]&&(q.push(e-r),r=e,q.push(1),r++),s.range[n]>l[n]&&(S.push(e-i),i=e,S.push(1),i++)}}q.length>0&&r<C&&q.push(C-r),S.length>0&&i<C&&S.push(C-i)}}let T=c?-Math.floor(h.width/2):-b,I=c?-b:-Math.floor(h.width/2);const E=d&&h.width>2?-1:0;return n.jsx(w,{offsetX:m+T+E,offsetY:f+I+E,length:C+b,isVertical:c,stroke:y,width:h.width,dashArray:q??h.pattern,dashArrayAdditional:S,isDouble:x,isAngled:h.description.toLowerCase().includes("slant")},o)},A=({getBorderAt:l,borderRenderer:i=F,getVisibleCells:a,darkMode:s,forceThinBorder:d=!1,defaultColor:c="black",shiftIfWide:u=!1})=>{const g=t.useCallbackRef(a,[a]),h=r.useMemo(()=>t=>{const r=t.toClipBounds(t.getRangeCoordsBounds(),-3);if(!r)return;const a=g(t);if(0===a.length)return;const h=t.getVisibleColumnOffsets(),m=t.getVisibleRowOffsets();let f=[],p=[];const v=t.getVisibleColumns(),C=t.getVisibleRows(),b=[],w=[],y=[],x=(e,t,n,o,r,l,i)=>{const a={index:o,stroke:r,visibleIndex:n,edge:l,length:i};e[t]||(e[t]=[]),e[t].length>0&&e[t][e[t].length-1]?.index===o?e[t][e[t].length-1]=a:e[t].push(a)};for(let n=0;n<a.length;n++){const r=a[n],i=r.coords;if(!i)continue;const s=r?.range??{rowStart:i.rowIndex,colStart:i.colIndex,rowEnd:i.rowIndex,colEnd:i.colIndex},d=t.getVisibleRangeCoords();if(!o.CoordUtils.isRangesIntersect(s,d)&&!o.CoordUtils.isRangeWithinRange(s,d))continue;const c=i.colIndex,u=i.rowIndex,g=h[c],y=m[u];if(s.rowEnd!==s.rowStart){const e=m[s.rowStart]?.spanIndex??-1,t=m[s.rowEnd]?.spanIndex??m[C[C.length-1]].spanIndex+1;f.push({...s,rowStart:e,rowEnd:t})}if(s.colEnd!==s.colStart){const e=h[s.colStart]?.spanIndex??-1,t=h[s.colEnd]?.spanIndex??h[v[v.length-1]].spanIndex+1;p.push({...s,colStart:e,colEnd:t})}const q=r.value,S=l(q,n);if(!S||S.isEmpty())continue;const R=S.getLeft(),k=S.getTop(),M=S.getRight(),T=S.getBottom();let I=1,E=1;if(!g||!y)continue;const F=g.spanIndex,A=y.spanIndex;R.isNone()||x(b,F,A,u,R,e.IBorder.Edge.Left,I),k.isNone()||x(w,A,F,c,k,e.IBorder.Edge.Top,E),M.isNone()||x(b,F+E,A,u,M,e.IBorder.Edge.Right,I),T.isNone()||x(w,A+I,F,c,T,e.IBorder.Edge.Bottom,E)}const q=(e,t,n)=>{const o=[];return e.forEach((e,r)=>{let l=null;e.sort((e,t)=>e.visibleIndex-t.visibleIndex);for(let i=0;i<e.length;i++){const a=e[i];if(!a?.stroke)continue;if(void 0===t[r]&&void 0===t[r-1])continue;let s=!1;if(n)for(let e=0;!s&&e<f.length;e++){let t=f[e];t.colStart<=a.index&&t.colEnd>=a.index&&t.rowStart<r&&t.rowEnd>=r&&(s=!0)}else for(let e=0;!s&&e<p.length;e++){let t=p[e];t.rowStart<=a.index&&t.rowEnd>=a.index&&t.colStart<r&&t.colEnd>=r&&(s=!0)}if(s)continue;const d=a.stroke?.getColor(),u=d?d.toRGBA().toString():c,g=a.stroke.getStyle()+":"+u;(g!==l?.key||l&&l.visibleIndex+1<a.visibleIndex)&&(l&&o.push(l),l={key:g,index:t[r]??t[r-1]+1,visibleIndex:a.visibleIndex,edge:a.edge,stroke:a.stroke,from:a.index,to:a.index+a.length-1,intersections:[],length:1}),l.to=a.index+a.length-1,l.visibleIndex=a.visibleIndex}l&&o.push(l)}),o};f=f.sort(E),p=p.sort(I);const S=q(b,v,!1),R=q(w,C,!0);if(0===S.length&&0===R.length)return null;for(let e=0;e<R.length;e++){const t=R[e];let n=o.CommonUtils.findEqualOrGreater(S,t.from,e=>e.index),r=!1;for(;!r;){const e=S[n++];e&&e.index>=t.from&&e.index<=t.to+1&&e.from<=t.index&&e.to+1>=t.index&&(t.intersections.push({stroke:e.stroke,range:{rowStart:e.from,rowEnd:e.to+1,colStart:e.index,colEnd:e.index}}),e.intersections.push({stroke:t.stroke,range:{rowStart:t.index,rowEnd:t.index,colStart:t.from,colEnd:t.to+1}})),r=!e||e.index>t.to+1}}for(let e=0;e<R.length;e++){const n=R[e];let o=n.stroke;const r=`rBorder:${n.index}:${n.from}:${n.to}:${n.edge}`,l={rowStart:n.index,rowEnd:n.index,colStart:n.from,colEnd:n.to+1},a=t.getLayout(),c=!1,g=a.getColOffset(l.colStart),h=a.getRowOffset(l.rowStart),m=[g,h,a.getColOffset(l.colEnd),h];y.push(i({key:r,points:m,stroke:o,darkMode:s,forceThinBorder:d,shiftIfWide:u,range:l,intersections:n.intersections,layout:a,isVertical:c}))}for(let e=0;e<S.length;e++){const n=S[e];let o=n.stroke;const r=`cBorder:${n.index}:${n.from}:${n.to}:${n.edge}`,l={rowStart:n.from,rowEnd:n.to+1,colStart:n.index,colEnd:n.index},a=t.getLayout(),c=!0,g=a.getColOffset(l.colStart),h=[g,a.getRowOffset(l.rowStart),g,a.getRowOffset(l.rowEnd)];y.push(i({key:r,stroke:o,points:h,darkMode:s,forceThinBorder:d,shiftIfWide:u,range:l,intersections:n.intersections,layout:a,isVertical:c}))}return n.jsx("svg",{width:`${r.width}`,height:`${r.height}`,viewBox:`0 0 ${r.width} ${r.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${r.width}px`,height:`${r.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:y},"borders")},[l,s]);return{overlay:h}},D=o.AnchorLocation.Center,z=Object.freeze({horizontal:!1,vertical:!1}),N=o.TypesUtils.EmptyTopLeft,L=(e,t)=>o.CoordUtils.EmptyCell,O=(e,t)=>new Promise((e,t)=>{t("StaticBorderRenderer does not support scrolling")}),j=r.memo(e=>{const{getBorderAt:t,width:l,height:i,style:a,rowCount:s=2,columnCount:d=2,darkMode:c,forceThinBorder:u,children:g,...h}=e,m=r.useRef(null),[f,{width:p,height:v}]=T(),C=l??p,b=i??v,w=r.useMemo(()=>{const e=[];for(let t=0;t<s;t++)for(let n=0;n<d;n++){const o={colIndex:n,rowIndex:t};e.push({coords:o,value:o})}return e},[]),y=r.useCallback(e=>w,[w]),{overlay:q}=A({getVisibleCells:y,getBorderAt:t,darkMode:c,forceThinBorder:u}),S=Math.floor(C/d),R=Math.floor(b/s),k={getColOffset:e=>Math.ceil(e*S)+0,getRowOffset:e=>Math.ceil(e*R)+0,getColIndex:e=>Math.floor((e-0)/S)-1,getRowIndex:e=>Math.floor((e-0)/R)-1},M={rowStart:0,colStart:0,rowEnd:s,colEnd:d},I={x:0,y:0,width:Math.max(0,C)+0,height:Math.max(0,b)+0},E=r.useMemo(()=>{const e={},t=Math.floor(C/d);for(let n=0;n<d;n++)e[n]={offset:n*t,size:t,spanIndex:n};return e},[C,b]),F=r.useMemo(()=>{const e={},t=Math.floor(b/s);for(let n=0;n<s;n++)e[n]={offset:n*t,size:t,spanIndex:n};return e},[C,b]);if(!q)return null;const j={width:C,height:b},B={width:C,height:b},V={getStage:()=>m.current,getTotalSize:()=>j,getViewportSize:()=>B,getLayout:()=>k,getCellCoordsAsRangeCoords:o.CoordUtils.cellToRange,getVisibleRangeCoords:()=>M,getVisibleRows:()=>{const e=[];for(let t=0;t<s;t++)e.push(t);return e},getTotalRangeCoords:()=>M,getRelativePointFromClient:(e,t)=>({x:e,y:t}),getVisibleColumns:()=>{const e=[];for(let t=0;t<d;t++)e.push(t);return e},toClipBounds:(e,t)=>I,toViewBounds:e=>e,toAbsoluteBounds:e=>e,getBounds:()=>I,getInsets:()=>null,getRangeCoordsBounds:(e,t)=>null,getVisibleColumnOffsets:()=>E,getVisibleRowOffsets:()=>F,allViews:()=>({[D]:V}),getAnchor:()=>D,getZoom:()=>1,scrollCellCoordsIntoView:O,getCellCoordsFromClient:L,getScrollOrientation:()=>z,getScrollTopLeft:()=>N,getFreezeTopLeft:()=>N},P=q(V);return n.jsxs("div",{style:{...a,position:"relative",display:"flex"},...h,children:[n.jsx("div",{ref:x([m,f]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:g}),P]})});function B(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=B(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function V(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=B(e))&&(o&&(o+=" "),o+=t);return o}const P="_sheetxl-sheet_1qeq6_5",H="_viewport-overlay_1qeq6_6",U=e=>{const{style:t,...o}=e??{};return n.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...o,children:[n.jsx("path",{d:"M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z",fill:"#547dbe",fillRule:"evenodd"}),n.jsx("path",{d:"M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z",fill:"#ffffff",fillRule:"evenodd"}),n.jsx("path",{d:"m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z",fill:"#547dbe",fillRule:"evenodd",strokeWidth:"0.4"}),n.jsx("path",{d:"M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z",fill:"#eb594d"}),n.jsx("path",{d:"m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z",stroke:"#eb594d",strokeWidth:"2",fill:"#f9cecb"})]})},K=r.memo(t=>{const{colorLicensee:o="blue",colorError:l="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:s,style:d,...c}=t??{},[u,g]=r.useState(null);r.useEffect(()=>{(async()=>{const t=await e.LicenseManager.getDetails();g(t)})()},[]);const[h,m]=r.useState(!1),f={opacity:.65},p=r.useMemo(()=>{const e=u?.exceptions(),t=e?.length??0;if(0===t)return null;const o=[];for(let r=0;r<t;r++){const t=e[r];o.push(n.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:l},children:t},r))}return o},[u,l]);if(null===u)return null;if(u.isValidFor(s))return null;const v=u.type(),C=!p&&v.endsWith("ity"),b=u.licensee(),w=C?1.6:1,y=135/w,x=37/w;let q=null;return!v&&b?.length>0&&(q=n.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:o},children:b})),n.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...d},...c,children:n.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[h?n.jsx(U,{style:f}):n.jsx("svg",{width:y,height:x,style:f,children:n.jsx("image",{style:{width:y,height:x},href:"https://www.sheetxl.com/watermark.svg",onError:()=>m(!0)})}),n.jsxs("div",{children:[q,p,n.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),W=(e,t,n)=>{const o=r.useRef(t);o.current=t;const l=n?.fireOnModelChange??!0;r.useEffect(()=>{if(!e||!o.current)return;const t=Object.keys(o.current),r={},i=t.length;for(let e=0;e<i;e++){const n=t[e];r[n]=(e,t)=>{o.current[n]?.(e,t)}}const a=e.addListeners(r,n);if(l)for(let n=0;n<i;n++){r[t[n]](e)}return()=>{a?.()}},[e])},$=new e.Color("transparent");function G(l){const{sheet:s,onRepeatCommandChange:d,bodyStyle:u,commands:g,target:h,notifier:m,onStartEdit:f,getViewport:p}=l,[v,C]=r.useState(null),[b,w]=r.useState(null),y=r.useRef(null),x=t.useCallbackRef(f,[f]),q=t.useCallbackRef(p,[p]),[S,R]=r.useState(),[k,M]=r.useState(()=>s?.getStyles().parseColor(e.IColor.Scheme.Bg2)),[T,I]=r.useState(()=>s?.getStyles().getNormal().getFont().getFill()),E=t.useEditMode();r.useRef(E.getMode()).current=E.getMode();const F=t.useGlobalClipboard(),[A,D]=r.useState(o.CommonUtils.EmptyArray),z=r.useCallback(()=>{if(y.current!==s)return;const e=s.getSelectedRanges();let t=null;A.length>0&&o.CoordUtils.isCellWithinRange(v,A[0].getRange().getCoords())&&(t=A[0]);const n=s?.getSelectedCell(),r=n?.getCoords()??null;i.unstable_batchedUpdates(()=>{K(t),C(r),w(e)})},[s,A,b,v]),N=r.useCallback(o.CommonUtils.debounce(z,210),[z]);r.useEffect(()=>{y.current=s,z()},[s]);const L=t.useCallbackRef(()=>s.getRange(v).getCell(),[s,v]),O=t.useCallbackRef(async(e,n,o=null,r=!1,l=!0)=>{const i=e?.label?.(),a=async()=>{const e=await Promise.resolve(l&&m?.showBusy?.(i??"Busy..."));try{await s.doBatch(async()=>n(s),i),r&&E.setMode(null),e&&e()}catch(t){if(e&&e(),!t)return;m?.showError?.(t)}},c=[];let u=!1;const g=async()=>(c.push(a),(async()=>{if(!u){for(u=!0;c.length>0;){const e=c.shift();e&&await e()}u=!1}})());if(d){let n=null;if(!1!==o&&e){const r=o??i;n=new t.SimpleCommand(e.key(),h,{label:r,description:r},g)}d(n)}return g()},[s,d,m]),j=t.useCallbackRef((t,n,o=!1,r)=>O(t,t=>{const l=t.getSelectedRanges();o&&l.updateStyle(null,r),l.updateStyle(n,r),l.autoFit({expandOnly:e.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[s]),B=t.useCallbackRef((e,t,n)=>{O(e,e=>{let o=t;(n||t?.address)&&(o=o??{},!n&&t?.address?.startsWith("#")?n=t?.address.substring(1):n&&(o.displayText=n)),e.getSelectedRange().setHyperlink(o)})},[s]),V=t.useCallbackRef((e,t)=>{O(e,e=>{e.getSelectedRange().setComments(t)})},[s]),P=t.useCallbackRef((e,t)=>{O(e,e=>{e.getSelectedRanges().clear(t)})},[s]),H=t.useCallbackRef(async(t,n,o=!1,r=!1)=>O(t,async t=>{let l=t.getSelectedRanges();o&&(n===e.IRange.Orientation.Row?l=l.getEntireRows(r):n===e.IRange.Orientation.Column&&(l=l.getEntireColumns(r)));let i=null;const a=E.getMode()?.key;if("copy"===a||"cut"===a){const e=await F.getClipboard().readReference();e&&"range"===e.getItemType()&&(i=e.getItem(),i.getCoords()||(i=null))}if(i){const t=await l.insertFrom(i,{...i.getMarkOptions(),orientation:n,autoSelect:!0});!t||t.isEntireRows()||t.isEntireColumns()||t.autoFit({orientations:e.IRange.Orientations.Row,minContent:!0}),E.setMode(null)}else l.insert(n,{autoSelect:!0})},"Insert Cells",!1),[E]),[U,K]=r.useState(null),G=t.useCallbackRef(e=>s.getStyles().setDefaultTableStyle(e),[s]),_=t.useCallbackRef(e=>{s.getStyles().getTableStyle(e)?.delete()},[s]),Z=t.useCallbackRef((t,n)=>{O(t,async t=>{const o=t.getSelectedRange(),r=t.getSelectedCell().getCoords();let l=null,i=0;const a=r.rowIndex>0?t.getRange({rowIndex:r.rowIndex,colIndex:r.colIndex}).getExtended(e.IRange.Direction.Up):null;a&&t.getRange({colStart:r.colIndex,rowStart:a.getCoords().rowStart,colEnd:r.colIndex,rowEnd:a.getCoords().rowStart}).isContentful()&&(l=e.IRange.Direction.Up,i=r.rowIndex-a.getCoords().rowEnd);const s=r.colIndex>0?t.getRange({rowIndex:r.rowIndex,colIndex:r.colIndex-1}).getExtended(e.IRange.Direction.Left):null;if(s&&t.getRange({colStart:s.getCoords().colStart,rowStart:r.rowIndex,colEnd:s.getCoords().colStart,rowEnd:r.rowIndex}).isContentful()){const t=r.colIndex-s.getCoords().colEnd;(t<i||!l)&&(l=e.IRange.Direction.Left,i=t)}let d=null;if(l===e.IRange.Direction.Up){if(d={...a.getCoords()},(d.rowEnd===r.rowIndex||!t.getRange({colIndex:r.colIndex,rowIndex:r.rowIndex-1}).isContentful())&&d.rowStart>0&&t.getRange({colIndex:r.colIndex,rowIndex:d.rowStart-1}).isContentful()){const t=a.getExtended(e.IRange.Direction.Up);d={colStart:r.colIndex,rowStart:t.getCoords().rowStart,colEnd:r.colIndex,rowEnd:a.getCoords().rowEnd}}d.rowEnd=r.rowIndex-1}else if(l===e.IRange.Direction.Left){if(d={...s.getCoords()},(d.colEnd===r.colIndex||!t.getRange({colIndex:r.colIndex-1,rowIndex:r.rowIndex}).isContentful())&&d.colStart>0&&t.getRange({colIndex:d.colStart-1,rowIndex:r.rowIndex}).isContentful()){const t=s.getExtended(e.IRange.Direction.Left);d={colStart:t.getCoords().colStart,rowStart:r.rowIndex,colEnd:t.getCoords().colEnd,rowEnd:r.rowIndex}}d.colEnd=r.colIndex-1}if(1!==o.size&&l){const r=o.getCoords(),i=o.startIncrementalUpdates({orientation:e.IRange.Orientation.Column}),a={...d},s=r.rowStart,c=r.rowEnd,u=r.colStart,g=r.colEnd,h=l===e.IRange.Direction.Up;for(let e=u;e<=g;e++){a.colStart=h?e:d.colStart+(e-u),a.colEnd=h?e:d.colEnd+(e-u);for(let o=s;o<=c;o++){a.rowStart=h?d.rowStart+(o-s):o,a.rowEnd=h?d.rowEnd+(o-s):o;const r=t.getRange(a).toString();i.pushAt(o,e,`=${n}(${r})`)}}i.apply()}else{const e=d?t.getRange(d).toString():"",o=`=${n}(`;x?.({text:`${o}${e})`,editMode:!0,initialSelection:{start:o.length,end:o.length+e.length}})}},!1)},[s]),X=t.useCallbackRef((e,t,n=!1,o=!0)=>{O(e,async r=>{let l=null;if(U)return void U.updateStyleOptions(t);{const e=r.getSelectedRanges().getFixed(!0),t=r.getSelectedRange().getDefaultSortCriteria();let n={ranges:e,hasHeader:t?.options?.hasHeader??!1};l=o?new Promise((e,t)=>{const o={tableOptions:n,onCancel:()=>{t()},onDone:t=>{e(t)},context:{getNames:()=>r.getNames()}};m.showWindow?.("tableNew",o)}):{option:"Ok",tableOptions:n}}const i=await Promise.resolve(l);if("Ok"!==i?.option)throw null;const a=await Promise.resolve(m?.showBusy?.(e.label()));try{const e=r.getTables().add(i.tableOptions.ranges.at(0),{styleName:t?.name,clearFormatting:n,hasHeader:i.tableOptions.hasHeader});await e.getRange().select()}catch(e){a(),m?.showError?.(e)}a()},!1,!0,!1)},[U]),Y=t.useCallbackRef(()=>u,[u]),J=t.useCallbackRef(e=>({styles:()=>s.getStyles(),table:()=>e,bodyStyle:Y,getNames:()=>s.getNames()}),[s]),Q=t.useCallbackRef(async(e,t,n,o=!0)=>{let r=null;if(!t){let e=s.getSelectedRange();1===e.size&&(e=e.getSurrounding());let n=s.getTables().search({address:s.getSelectedRange()});n.length>0&&(t=n[0]),await e.select()}if(t){if(o){try{n&&await t.select()}catch(e){}r=new Promise(async(n,o)=>{e.update({context:J(t)});const r={command:e,commands:me,notifier:m,onDone:e=>{n(e)}},l=await(m.showWindow?.("tableDetails",r,{disableAutoDestroy:!0}));setTimeout(()=>{l.focus()},180)})}Promise.resolve(r).then(e=>{},e=>{m?.showError?.(e)})}},[m]),ee=t.useCallbackRef(async(e,t,n=!1)=>{let o=null;if(t)t.isITable?o=t:t.getValue()&&(o=t.getValue());else{const e=s.getTables().search({address:s.getSelectedRange()});e.length>0&&(o=e[0])}if(o){if(!n){const e=o.getRange().getCoords(),t=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);if(t>1e4){if("Convert"!==await(m?.showOptions({title:"Confirm",description:`Converting a table to range with '${t}' cells will set a large number of cell styles and may affect performance.\nContinue?`,options:["Convert","Cancel"],defaultOption:"Convert"})))return}}O(e,async()=>{n?o.delete():o.convertToRange()},!1,!0)}},[m]),te=t.useCallbackRef((t,n,o)=>{O(t,async r=>{let l=r.getSelectedRanges();if(l.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let i=l.at(0);1===i.size&&(i=i.getSurrounding());const a=r.getSelection().getCoords().cell;let s=i.getDefaultSortCriteria(e.IRange.Orientation.Row,a);if(!s){if(o)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let d=s.options;if(o&&(d=new Promise((e,t)=>{const n={range:i,options:s.options,cell:a,onCancel:()=>{t()},onDone:n=>{n?e(n.options):t()}};m.showWindow?.("sort",n)})),d=await Promise.resolve(d),!d)return;const c=await Promise.resolve(m?.showBusy?.(t.label()));try{i.doBatch(()=>{const t={...d,...n};i.sort(t),i.autoFit({orientations:t?.orientation===e.IRange.Orientation.Column?e.IRange.Orientations.Column:e.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},t?.label?.())}catch(e){c(),m?.showError?.(e)}c()},!1,!1,!1)},[m]),ne=t.useCallbackRef(()=>{console.log("compactedSelection");const e=s.getSelection().getCoords(),t=s.getSelectedRanges().getFlattened().getCoords(),n=(e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t),o=new Worker(n);return URL.revokeObjectURL(n),o})("console.log('hello from worker');");setTimeout(()=>{n.terminate(),console.log("Worker terminated")},5e3);let r=-1;for(let n=0;-1===r&&n<t.length;n++)o.CoordUtils.isCellWithinRange(e.cell,t[n])&&(r=n);if(o.CoordUtils.isEqualRangesArrays(e.ranges,t))return;const l={cell:e.cell,ranges:t,rangeIndex:r};s.getSelection().updateCoords(l)},[s]),oe=t.useCallbackRef(()=>{console.log("selectComments")},[s]),re=t.useCallbackRef(async(e=!1,t=!1)=>{let n=null;if(t)n=s.getEntireRange();else{const t=s.getSelectedRange();if(t.isEntireRange()){const e=s.getSelection().getCoords().cell,t=s.getRange(e);n=t.getSurrounding(),n.isEntireRange()&&(n=t)}else n=t.getSurrounding({contentOnly:e})}n&&await n.select()},[s]),le=t.useCallbackRef((t,n,o)=>{O(t,async t=>{let r=t.getSelectedRanges();o&&(n===e.IRange.Orientation.Row?r=r.getEntireRows():n===e.IRange.Orientation.Column&&(r=r.getEntireColumns())),r.delete(n)},"Delete Cells")},[s]);t.useCallbackRef(async e=>{let t=null;const n=q(),o=Math.min(n.width-8,480),r=Math.min(n.height-8,288);try{s.getSelectedRanges();t=await s.getMovables().add({bounds:{x:n.left+(n.width-o)/2,y:n.top+(n.height-r)/2,width:o,height:r},type:"chart",json:e.template}),t.select(),E.setMode(null)}catch(e){m?.showError?.(e)}return t},[s,m]);const ie=t.useCallbackRef(async(e,n,o)=>{const r=await(m?.showBusy?.(e.label()));try{const e=await s.getMovables().addImage(n,{autoSelect:!0,...o});return r(),E.setMode(null),e}catch(e){r();let n=e;"string"!=typeof n&&(console.warn(e),n="Unable to resolve image."),m?.showMessage?.(n,{type:t.NotificationType.Error})}},[s,m]),ae=t.useCallbackRef((t,n)=>{O(t,async r=>{const l=r.getSelectedRanges();l.doBatch(()=>{const t=n===e.IRange.Direction.Up||n===e.IRange.Direction.Down,i=l.getCoords().slice().sort(o.CoordUtils.createRangeComparator(t?e.IRange.Orientation.Row:e.IRange.Orientation.Column));for(let t=0;t<i.length;t++){const o=i[t];let l=o;const a=r.getRange(l).getMerges();let s=0,d=0;if(a.length>0){const e=a[0];s=e.rowEnd-e.rowStart,d=e.colEnd-e.colStart}n===e.IRange.Direction.Left?l={...o,colStart:o.colEnd+d}:n===e.IRange.Direction.Right?l={...o,colEnd:o.colStart+d}:n===e.IRange.Direction.Up?l={...o,rowStart:o.rowEnd+s}:n===e.IRange.Direction.Down&&(l={...o,rowEnd:o.rowStart+s}),r.getRange(l).autoFill(o,{filler:e.AutoFill.Types.Copy}),r.getRange(o).autoFit({orientations:e.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:t.label()})})},[m]),se=t.useCallbackRef(()=>{let e=null;const t=s.getSelectedCell().getCoords();if(t?.rowIndex>0){const n=s.getRange({rowIndex:t.rowIndex-1,colIndex:t.colIndex}).getCell();n&&(e=n.toTextUnformatted(!0))}x?.({text:e})},[s]),[de,ce]=r.useReducer(e=>e+1,0),[ue,ge]=r.useReducer(e=>e+1,0),he=r.useMemo(()=>[new t.Command("gridlinesToggle",h,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new t.Command("sheetViewToggleGridlinesRows",h,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new t.Command("sheetViewToggleGridlinesColumns",h,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new t.Command("sheetViewFormatGridlinesColor",h,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new t.Command("sheetViewToggleShowHeadings",h,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new t.Command("sheetViewToggleShowHeadingRows",h,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new t.Command("sheetViewToggleShowHeadingColumns",h,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new t.Command("sheetViewToggleShowHeadingsNumeric",h,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}}),new t.Command("sheetViewToggleFormulaView",h,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[t.KeyModifiers.Ctrl]},{key:"`",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}]}),new t.Command("sheetViewToggleShowZeros",h,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new t.SimpleCommand("selectComments",h,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},()=>oe()),new t.Command("selectAll",h,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[t.KeyModifiers.Ctrl]},{key:"Space",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}]},(e=!1)=>re(!1,e)),new t.SimpleCommand("selectRegion",h,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},()=>re(!0,!1)),new t.SimpleCommand("breakSelection",h,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}},()=>ne()),new t.SimpleCommand("formatTextRotate0",h,{label:"No Text Rotation",description:"Remove all text rotation."}),new t.SimpleCommand("formatTextRotate45",h,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new t.SimpleCommand("formatTextRotate90",h,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new t.SimpleCommand("formatTextRotate270",h,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new t.SimpleCommand("formatTextRotate315",h,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new t.Command("formatTextRotateCustom",h,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new t.SimpleCommand("formatTextRotateVertical",h,{label:"Vertical Text",description:"Stack text vertically."}),new t.SimpleCommand("sortAscending",h,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){te(this,{reverse:!1},!1)}),new t.SimpleCommand("sortDescending",h,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){te(this,{reverse:!0},!1)}),new t.SimpleCommand("sortCustom",h,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){te(this,{},!0)}),new t.Command("protectionSheetToggle",h,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:"Prevent unwanted changes from others by limiting their ability to edit.\nFor example, you can prevent people from editing locked cells or making formatting changes."}),new t.Command("formatSheetTabColor",h,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new t.Command("formatCellStyle",h,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(e){j(this,{named:e.getName()},!0)}),new t.Command("formatTableStyle",h,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(e){X(this,e)}),new t.Command("formatTableStyleClearCellStyles",h,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(e){X(this,e,!0)}),new t.Command("formatTableStyleClearTableStyle",h,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){X(this,{name:null},!0)}),new t.Command("setDefaultTableStyle",h,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},G),new t.Command("deleteTableStyle",h,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},_),new t.Command("formatBorder",h,{label:"Border",description:"Create an outline border."},function(e){j(this,{border:e})}),new t.Command("formatFillColor",h,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(e){j(this,{fill:e})}),new t.Command("formatFontColor",h,{label:"Font Color",description:"Change the color of your text."},function(e){j(this,{font:{fill:e}})}),new t.Command("formatBoldToggle",h,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[t.KeyModifiers.Ctrl]},{key:"2",modifiers:[t.KeyModifiers.Ctrl]}]}),new t.Command("formatItalicToggle",h,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[t.KeyModifiers.Ctrl]},{key:"3",modifiers:[t.KeyModifiers.Ctrl]}]}),new t.Command("formatUnderlinedToggle",h,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[t.KeyModifiers.Ctrl]},{key:"4",modifiers:[t.KeyModifiers.Ctrl]}]}),new t.Command("formatUnderlinedDoubleToggle",h,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new t.Command("formatUnderlinedAccountingToggle",h,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new t.Command("formatUnderlinedAccountingDoubleToggle",h,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new t.Command("formatStrikeThroughToggle",h,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[t.KeyModifiers.Ctrl]}}),new t.Command("formatSuperscriptToggle",h,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new t.Command("formatSubscriptToggle",h,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new t.Command("formatAlignTopToggle",h,{label:"Align Top",description:"Align text to the top."}),new t.Command("formatTextOverflowVisibleToggle",h,{label:"Overflow Text",description:"Overflow text to the next cells."}),new t.Command("formatTextOverflowWrapToggle",h,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new t.Command("formatTextOverflowClipToggle",h,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new t.Command("formatTextOverflowShrinkToggle",h,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new t.Command("formatTextOverflowEllipsisToggle",h,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new t.Command("formatAlignMiddleToggle",h,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new t.Command("formatAlignBottomToggle",h,{label:"Align Bottom",description:"Align text to the bottom."}),new t.Command("formatAlignJustifyVerticalToggle",h,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new t.Command("formatAlignDistributedVerticalToggle",h,{label:"Distribute Vertically",description:"Justify your content vertically."}),new t.Command("formatAlignLeftToggle",h,{label:"Align Left",description:"Align your content to the left."}),new t.Command("formatAlignCenterToggle",h,{label:"Align Center",description:"Center your content."}),new t.Command("formatAlignRightToggle",h,{label:"Align Right",description:"Align your content to the right."}),new t.Command("formatAlignJustifyToggle",h,{label:"Align Justify",description:"Justify your content."}),new t.Command("formatAlignCenterContinuousToggle",h,{label:"Center Across",description:"Center your content across multiple cells."}),new t.Command("formatAlignFillToggle",h,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new t.Command("formatAlignDistributedHorizontalToggle",h,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new t.SimpleCommand("formatFontSizeIncrease",h,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,e=>({font:{size:c(e.getFont().getSize(),!0)}}))}),new t.SimpleCommand("formatFontSizeDecrease",h,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,e=>({font:{size:c(e.getFont().getSize(),!1)}}))}),new t.Command("formatFontFamily",h,{label:"Font",description:"Select the font your text."},function(e){j(this,{font:{family:e}})}),new t.Command("formatFontSize",h,{label:"Font Size",description:"Change the size of your text."},function(e){j(this,{font:{size:e}})}),new t.Command("formatNumberDialog",h,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[t.KeyModifiers.Ctrl]},{key:"1",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]},function(e,t){const n=this,o={initialValue:e??t.state(),context:t.context(),onInputOption:(e,t)=>{j(n,{numberFormat:e})}};m.showWindow?.("numberFormat",o)}),new t.Command("formatNumberFormat",h,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(e){j(this,{numberFormat:e})}),new t.Command("formatNumberFormatGeneralStyle",h,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:e.NumberFormat.Type.General})}),new t.Command("formatNumberFormatNumberStyle",h,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"#,##0.00"})}),new t.Command("formatNumberFormatTimeStyle",h,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"h:mm AM/PM"})}),new t.Command("formatNumberFormatDateStyle",h,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"d-mmm-yy"})}),new t.Command("formatNumberFormatAccountingStyle",h,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(e){j(this,{numberFormat:e??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new t.Command("formatNumberFormatPercentStyle",h,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"0%"})}),new t.Command("formatNumberFormatScientificStyle",h,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"0.00E+00"})}),new t.Command("formatNumberFormatCommaStyle",h,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[t.KeyModifiers.Ctrl]}},function(){j(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new t.Command("formatNumberFormatIncreaseDecimal",h,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){j(this,t=>({numberFormat:e.NumberFormat.Parser.adjustDecimalPlaces(t.getNumberFormat(),1)}))}),new t.Command("formatNumberFormatDecreaseDecimal",h,{label:"Decrease Decimal",description:"Show few decimal places."},function(){j(this,t=>({numberFormat:e.NumberFormat.Parser.adjustDecimalPlaces(t.getNumberFormat(),-1)}))}),new t.Command("displayPlaceholdersToggle",h,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[t.KeyModifiers.Ctrl]}}),new t.SimpleCommand("noOp",h,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[t.KeyModifiers.Ctrl]}},function(){}),new t.Command("displayOutlineSymbolsToggle",h,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[t.KeyModifiers.Ctrl]}}),new t.Command("hideRows",h,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[t.KeyModifiers.Ctrl]}}),new t.Command("unhideRows",h,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}}),new t.Command("hideColumns",h,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[t.KeyModifiers.Ctrl]},{key:"0",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]}),new t.Command("unhideColumns",h,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}}),new t.Command("quickFormulaSum",h,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[t.KeyModifiers.Alt]}},function(){Z(this,"SUM")}),new t.Command("quickFormulaAverage",h,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){Z(this,"AVERAGE")}),new t.Command("quickFormulaCount",h,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){Z(this,"COUNT")}),new t.Command("quickFormulaMax",h,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){Z(this,"MAX")}),new t.Command("quickFormulaMin",h,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){Z(this,"MIN")}),new t.Command("startEditCurrentTime",h,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){x?.({text:s.createTemporaryCell({value:a(),style:{numberFormat:"Medium Time"}}).toText()})}),new t.Command("startEditCurrentDate",h,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl]}},function(){x?.({text:s.createTemporaryCell({value:a(),style:{numberFormat:"Short Date"}}).toText()})}),new t.SimpleCommand("sheetZoomOut",h,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]}),new t.SimpleCommand("sheetZoomIn",h,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]}),new t.SimpleCommand("sheetZoom100",h,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}}),new t.Command("insertFunction",h,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[t.KeyModifiers.Shift]}},function(e,t){console.log("insertFunction")}),new t.Command("updateHyperlink",h,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",context:()=>L,shortcut:[{key:"K",modifiers:[t.KeyModifiers.Ctrl]},{key:"K",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]},async function(e,t){const n=this,o={context:t.context(),onUpdateHyperlink:(e,t)=>{B(n,e,t)}};m.showWindow?.("hyperlink",o)}),new t.Command("openHyperlink",h,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[t.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>L},async(e,t)=>{const n=t.context()();if(!n)return;const o=n.getHyperlink();if(o)try{await o.open()}catch(e){m?.showError?.(e)}}),new t.Command("deleteHyperlink",h,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>L},function(e,t){B(this,null,null)}),new t.SimpleCommand("insertNote",h,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[t.KeyModifiers.Shift]},description:"Add a note to the cell."},(e,t)=>{((e,t)=>{e?.showMessage?.(n.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[t," is not yet implemented.",n.jsx("br",{}),n.jsx("br",{}),"Please see the ",n.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(m,t.label())}),new t.Command("updateComments",h,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]},description:"Add a comment to the current cell.",context:()=>L},async function(e,t){const n=this,o={context:t.context(),onUpdateComments:e=>{V(n,e)}};m.showWindow?.("comments",o)}),new t.Command("deleteComments",h,{label:"Delete Comments",description:"Remove any comments.",context:()=>L},function(e,t){V(this,null)}),new t.Command("insertImageFromFile",h,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(e=null){let t=null,n=null;"string"==typeof e?n=e:t=e?.file?e.file:e,(t||(t=await o.CommonUtils.openFileDialog(n??"image/*"),t))&&await ie(this,{file:t},e?.options)}),new t.Command("insertImageFromURL",h,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(e){if(!e){const t=await(m?.showInputOptions?.({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]}));if("Insert"!==t.option)return;e=t.input}e&&ie(this,{fetch:e})}),new t.SimpleCommand("insertTable",h,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[t.KeyModifiers.Ctrl]},{key:"T",modifiers:[t.KeyModifiers.Alt,t.KeyModifiers.Ctrl]}]},function(){X(this)}),new t.Command("editTable",h,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(e){let t=null,n=!1;e.isITable?t=e:e.getValue()&&(t=e.getValue(),n=!0),Q(this,t,n)}),new t.Command("deleteTable",h,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:"Remove the table.\n\nThe table and table specific styling will be removed but the values will be preserved."},function(e){ee(this,e,!0)}),new t.Command("convertTableToRange",h,{label:"Convert To Range",description:"Convert the table into a normal range of cells.\n\nThe values and the formatting are preserved."},function(e){ee(this,e,!1)}),new t.Command("tableTotalRowToggle",h,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}},function(){const e=this.context().table();e&&e.setShowTotals(!e.getShowTotals())}),new t.Command("tableHeaderRowToggle",h,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const e=this.context().table();e&&e.setShowHeaders(!e.getShowHeaders())}),new t.Command("autoFilterToggle",h,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){const e=this.context().table();e&&e.setShowFilterButton(!e.getShowFilterButton())}),new t.Command("autoFilterReapply",h,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}}),new t.Command("autoFilterClear",h,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new t.SimpleCommand("startEditValueAbove",h,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[t.KeyModifiers.Ctrl]},{key:'"',modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}]},se),new t.Command("formatPainterToggle",h,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new t.SimpleCommand("insertCells",h,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){H(this)}),new t.SimpleCommand("insertCellsShiftRight",h,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){H(this,e.IRange.Orientation.Column)}),new t.SimpleCommand("insertCellsShiftDown",h,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward."},function(){return H(this,e.IRange.Orientation.Row)}),new t.SimpleCommand("insertRows",h,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position."},function(){return H(this,e.IRange.Orientation.Row,!0)}),new t.SimpleCommand("insertColumns",h,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position."},function(){return H(this,e.IRange.Orientation.Column,!0)}),new t.SimpleCommand("insertRowsAfter",h,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return H(this,e.IRange.Orientation.Row,!0,!0)}),new t.SimpleCommand("insertColumnsAfter",h,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return H(this,e.IRange.Orientation.Column,!0,!0)}),new t.SimpleCommand("deleteCells",h,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[t.KeyModifiers.Ctrl]}},function(){return le(this)}),new t.SimpleCommand("deleteCellsShiftUp",h,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return le(this,e.IRange.Orientation.Row)}),new t.SimpleCommand("deleteCellsShiftLeft",h,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right."},function(){return le(this,e.IRange.Orientation.Column)}),new t.SimpleCommand("deleteRows",h,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return le(this,e.IRange.Orientation.Row,!0)}),new t.SimpleCommand("deleteColumns",h,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection."},function(){return le(this,e.IRange.Orientation.Column,!0)}),new t.SimpleCommand("flashFill",h,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[t.KeyModifiers.Ctrl]},{key:"e",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]}),new t.SimpleCommand("fillDown",h,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",shortcut:{key:"d",modifiers:[t.KeyModifiers.Ctrl]}},function(){return ae(this,e.IRange.Direction.Down)}),new t.SimpleCommand("fillRight",h,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",shortcut:[{key:"r",modifiers:[t.KeyModifiers.Ctrl]}]},function(){return ae(this,e.IRange.Direction.Right)}),new t.SimpleCommand("fillUp",h,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection."},function(){return ae(this,e.IRange.Direction.Up)}),new t.SimpleCommand("fillLeft",h,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection."},function(){return ae(this,e.IRange.Direction.Left)}),new t.SimpleCommand("formatBorderAddOutline",h,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){return j(this,{border:{left:{style:e.IBorder.StrokeStyle.Thin,color:null},top:{style:e.IBorder.StrokeStyle.Thin,color:null},right:{style:e.IBorder.StrokeStyle.Thin,color:null},bottom:{style:e.IBorder.StrokeStyle.Thin,color:null}}})}),new t.SimpleCommand("formatBorderClearOutline",h,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){return j(this,{border:null})}),new t.SimpleCommand("formatIndentDecrease",h,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return j(this,e=>{const t=e.getAlignment().getIndent()-1;return{alignment:{indent:t>0?t:0}}})}),new t.SimpleCommand("formatIndentIncrease",h,{label:"Increase Indent",description:"Move your content further from the border."},function(){return j(this,t=>{const n={alignment:{indent:t.getAlignment().getIndent()+1}};return t.getAlignment().getHorizontal()===e.ITextFrame.HorizontalAlignment.General&&(n.alignment.horizontal=e.ITextFrame.HorizontalAlignment.Left),n})}),new t.Command("mergeToggle",h,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[t.KeyModifiers.Ctrl]}}),new t.SimpleCommand("mergeHorizontal",h,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new t.SimpleCommand("mergeVertical",h,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new t.SimpleCommand("unmerge",h,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new t.SimpleCommand("clearContents",h,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:"Clear only the contents in the cells.\n\nThe formatting is not cleared.",shortcut:{key:"Delete"}},function(){P(this,e.ICell.Content.Values)}),new t.SimpleCommand("clearFormats",h,{label:"Clear Formats",scopedLabels:{clear:"Formats"},description:"Clear only the formatting that is applied to the cells."},function(){P(this,e.ICell.Content.Formats)}),new t.SimpleCommand("clearHyperlinks",h,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){P(this,e.ICell.Content.Hyperlinks)}),new t.SimpleCommand("clearComments",h,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){P(this,e.ICell.Content.Comments)}),new t.SimpleCommand("clearAll",h,{label:"Clear All",scopedLabels:{clear:"All"},description:"Clears everything from the cells.\n\nAll contents and formatting are removed.",shortcut:{key:"Delete",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){P(this)}),new t.Command("freezeToggle",h,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new t.Command("freezeToggleHorizontal",h,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new t.Command("freezeToggleVertical",h,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new t.SimpleCommand("unfreeze",h,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new t.SimpleCommand("autoFitRows",h,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new t.SimpleCommand("autoFitColumns",h,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),me=r.useMemo(()=>{let e=null;return e=g?g.createChildGroup(h,"sheet",!1):new t.CommandGroup(h,"sheet"),e.addCommands(he,!0),e},[g,he]),[fe,pe]=r.useState(!1),[ve,Ce]=r.useState(!1);r.useEffect(()=>{if(y.current!==s||!b)return;const e=b.getCoords(),t=s.getTables().search({address:e[0]});D(e=>o.CommonUtils.isEqualArrays(e,t)?e:t),v&&t[0]&&o.CoordUtils.isCellWithinRange(v,t[0].getRange().getCoords())?K(t[0]??null):K(null);const n=s.getSelectedRanges(),r=n.getMerges().length>0,l=n.isOverlapping();let i=!0;for(let t=0;i&&t<e.length;t++)i=o.CoordUtils.isSingleCell(e[t]);Ce(l),pe(0===t.length&&!l&&(r||!i))},[ue,b,s]),t.useCommands(g,null,{onChange:()=>{const e=!s.getProtection().isFormatCellsAllowed(),t="formatPainter"===E.getMode()?.key;me.getCommand("formatPainterToggle").update({disabled:e||!g?.getCommand("copy"),state:()=>t}).updateCallback(()=>{if(t)return void E.setMode(null);return me.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:"url(\"data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A\") 7 12, pointer"}})})}},[E,de,g]),W(s.getView(),{onFreezeSplitChange:()=>{ge()}}),W(s.getSelection(),{onChange:()=>{N()}});const be=()=>{me.getCommand("sheetViewFormatGridlinesColor").update({state:()=>s.getView().getGridLineColor(),context:()=>({onColorSelect:e=>{},darkMode:u.darkMode,autoColor:s.getStyles().parseColor(u.strokeFill),schemeLookup:s.getStyles().schemeLookup(),recentColors:()=>s.getStyles().recentColors(),addRecentColor:e=>s.getStyles().addRecentColor(e),clearRecentColors:()=>s.getStyles().clearRecentColors()})}),me.getCommand("formatSheetTabColor").updateCallback(e=>{s.setTabColor(e)}).update({state:()=>s?.getTabColor()??$,context:()=>({onColorSelect:e=>{},darkMode:u.darkMode,autoColor:$,schemeLookup:s.getStyles().schemeLookup(),recentColors:()=>s.getStyles().recentColors(),addRecentColor:e=>s.getStyles().addRecentColor(e),clearRecentColors:()=>s.getStyles().clearRecentColors()})})},we=()=>{me.getCommand("formatBorder").update({context:()=>({onBorderSelect:e=>{R(e)},darkMode:u.darkMode,quickBorder:S,autoColor:s.getStyles().getNormal().getFont().getFill(),autoStyle:e.IBorder.StrokeStyle.Thin,createTemporaryBorder:e=>s.getStyles().getNormal().createTemporaryStyle({border:e}).getBorder(),schemeLookup:s.getStyles().schemeLookup()})})};r.useEffect(()=>{we()},[S]),r.useEffect(()=>{const e=!s.getProtection().isInsertHyperlinksAllowed();me.getCommand("openHyperlink").update({disabled:!L().getHyperlink()}),me.getCommand("deleteHyperlink").update({disabled:e||!L().getHyperlink()});const t=L().getHyperlink()?"Edit":"Insert",n="Link";me.getCommand("updateHyperlink").update({label:()=>(L().getHyperlink(),`${t} ${n}`),scopedLabels:{contextMenu:`${t} ${n}…`,insert:`${n}…`,hyperlink:`${t}…`},disabled:e})},[L()?.getHyperlink(),de]),r.useEffect(()=>{const e=L().getComments(),t=()=>e?"Edit":"Insert",n=()=>e?"Comments":"Comment";me.getCommand("updateComments").update({label:()=>`${t()} ${n()}`,scopedLabels:{contextMenu:`${t()} ${n()}…`,insert:`${n()}…`}})},[L()?.getComments(),de]),W(s,{onViewChange:()=>{const t=s.getView();me.getCommand("sheetViewToggleFormulaView").update({state:t.isShowFormulas()}),me.getCommand("sheetViewToggleShowZeros").update({state:t.isShowZeros()}),me.getCommand("gridlinesToggle").update({state:t.isShowColumnGridlines()||t.isShowRowGridlines()}),me.getCommand("sheetViewToggleGridlinesColumns").update({state:t.isShowColumnGridlines()}),me.getCommand("sheetViewToggleGridlinesRows").update({state:t.isShowRowGridlines()}),me.getCommand("sheetViewToggleShowHeadings").update({state:t.isShowColumnHeaders()||t.isShowRowHeaders()}),me.getCommand("sheetViewToggleShowHeadingColumns").update({state:t.isShowColumnHeaders()}),me.getCommand("sheetViewToggleShowHeadingRows").update({state:t.isShowRowHeaders()}),me.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>s.getView().getColumnHeaderStyle()===e.ISheetView.HeaderTextStyle.Zero&&s.getView().getRowHeaderStyle()===e.ISheetView.HeaderTextStyle.Zero}),be()},onTabColorChange:()=>{be()},onMergesChange:()=>{ge()},onMovablesChange:()=>{ge()},onTablesChange:()=>{ge()},onProtectionChange:()=>{ge(),ce()},onStyleChange:()=>{be(),we(),ge()}}),r.useEffect(()=>{be(),we()},[u]),r.useEffect(()=>{const e=!s.getProtection().isFormatCellsAllowed(),t=A.length>0&&!U||e,n=J(U),o={context:n};me.getCommand("editTable").update(o),me.getCommand("deleteTable").update(o),me.getCommand("convertTableToRange").update(o);const r={context:n,disabled:t};me.getCommand("formatTableStyle").update({label:U?"Apply Table Style":"Format As Table",...r}),me.getCommand("formatTableStyleClearCellStyles").update(r),me.getCommand("deleteTableStyle").update(r),me.getCommand("convertTableToRange").update(r),me.getCommand("insertTable").update({disabled:t||A.length>0});const l={context:n,disabled:t||0===A.length};me.getCommand("tableHeaderRowToggle").update(l),me.getCommand("tableTotalRowToggle").update(l),me.getCommand("autoFilterToggle").update(l),me.getCommand("formatTableStyleClearTableStyle").update({...l,disabled:l.disabled||!U||null===U.getStyleOptions().name})},[U,A,de]),r.useEffect(()=>{me.getCommand("sheetZoomOut").updateCallback(()=>{s.getView().update({zoomScale:o.CommonUtils.findNextStep(s.getView().getZoomScale(),!1)})}),me.getCommand("sheetZoomIn").updateCallback(()=>{s.getView().update({zoomScale:o.CommonUtils.findNextStep(s.getView().getZoomScale())})}),me.getCommand("sheetZoom100").updateCallback(()=>{s.getView().update({zoomScale:100})}),me.getCommand("gridlinesToggle").updateCallback(()=>{const e=s.getView().isShowColumnGridlines()&&s.getView().isShowRowGridlines();s.getView().update({showColumnGridlines:!e,showRowGridlines:!e})}),me.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{s.getView().update({showRowGridlines:!s.getView().isShowRowGridlines()})}),me.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{s.getView().update({showColumnGridlines:!s.getView().isShowColumnGridlines()})}),me.getCommand("sheetViewFormatGridlinesColor").updateCallback(e=>{s.getView().update({gridLineColor:e})}),me.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const e=s.getView().isShowColumnHeaders()&&s.getView().isShowRowHeaders();s.getView().update({showColumnHeaders:!e,showRowHeaders:!e})}),me.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{s.getView().update({showColumnHeaders:!s.getView().isShowColumnHeaders()})}),me.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{s.getView().update({showRowHeaders:!s.getView().isShowRowHeaders()})}),me.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const t=s.getView().getColumnHeaderStyle()===e.ISheetView.HeaderTextStyle.Zero&&s.getView().getRowHeaderStyle()===e.ISheetView.HeaderTextStyle.Zero;s.getView().update({columnHeaderStyle:t?e.ISheetView.HeaderTextStyle.A1:e.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:t?e.ISheetView.HeaderTextStyle.One:e.ISheetView.HeaderTextStyle.Zero})}),me.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{s.getView().update({showFormulas:!s.getView().isShowFormulas()})}),me.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{s.getView().update({showZeros:!s.getView().isShowZeros()})})},[s]),r.useEffect(()=>{const e=s.getView().getFreezePanes(),t=()=>0!==e.coords.rowIndex,n=()=>0!==e.coords.colIndex,o=()=>0!==e.coords.rowIndex||0!==e.coords.colIndex;me.getCommand("freezeToggle").updateCallback(()=>{o()?s.getView().setFreezePanes(null):o()?n()?s.getView().setFreezePanes({coords:{rowIndex:v.rowIndex}}):t()&&s.getView().setFreezePanes({coords:{colIndex:v.colIndex}}):s.getView().setFreezePanes({coords:v})}).update({state:o,disabled:()=>!v||!o()&&0===v.rowIndex&&0===v.colIndex}),me.getCommand("freezeToggleHorizontal").updateCallback(()=>{s.getView().setFreezePanes({coords:{rowIndex:t()?0:v.rowIndex}})}).update({state:t,disabled:()=>!v||!t()&&0===v.rowIndex}),me.getCommand("freezeToggleVertical").updateCallback(()=>{s.getView().setFreezePanes({coords:{colIndex:n()?0:v.colIndex}})}).update({state:n,disabled:()=>!v||!n()&&0===v.colIndex}),me.getCommand("unfreeze").updateCallback(()=>{s.getView().setFreezePanes(null)}).update({disabled:()=>!o()})},[ue,v,s,u]);const ye=L().getStyle(),xe=ye.getFont(),qe=ye.getAlignment(),Se=qe.getHorizontal(),Re=qe.getVertical(),ke=qe.getOverflow(),Me=qe.getRotation();return r.useEffect(()=>{me.getCommand("formatCellStyle").update({context:()=>({styles:()=>s.getStyles(),named:()=>L().getStyle(!0).getNamed(),bodyStyle:Y,createTemporaryCell:e=>s.createTemporaryCell(e)})}),me.getCommand("formatFillColor").update({state:()=>{let t=null;const n=ye.getFill();return n?.getType()===e.IFill.Type.Solid?t=n.getColor():n?.getType()===e.IFill.Type.Gradient?t=n.getStops()?.[0]?.getColor():n?.getType()===e.IFill.Type.Pattern&&(t=n.getBackground()),t},context:()=>{const e=s.getStyles();return{onColorSelect:e=>{M(e??$)},darkMode:u.darkMode,quickColor:k,autoColor:$,schemeLookup:e.schemeLookup(),recentColors:e.recentColors(),addRecentColor:t=>e.addRecentColor(t),clearRecentColors:()=>e.clearRecentColors()}}}),me.getCommand("formatFontColor").update({state:()=>xe.toJSON()?.fill?xe.getFill():null,context:()=>{const e=s.getStyles();return{onColorSelect:e=>{I(e)},darkMode:u.darkMode,quickColor:T,autoColor:e.getNormal().getFont().getFill(),schemeLookup:e.schemeLookup(),recentColors:e.recentColors(),addRecentColor:t=>e.addRecentColor(t),clearRecentColors:()=>e.clearRecentColors()}}}),me.getCommand("formatNumberFormat").update({state:()=>ye.getNumberFormat(),context:()=>L}),me.getCommand("formatNumberDialog").update({state:()=>ye.getNumberFormat(),context:()=>L}),me.getCommand("formatFontFamily").update({state:()=>xe.getFamily()}),me.getCommand("formatFontSize").update({state:()=>xe.getSize()});const t=function(){const e=xe.getWeight()||0;return!isNaN(e)&&e>500};me.getCommand("formatBoldToggle").updateCallback(function(){j(this,{font:{weight:t()?400:700}})}).update({state:t});const n=function(){return xe.getStyle()===e.IFont.Style.Italic};me.getCommand("formatItalicToggle").updateCallback(function(){j(this,{font:{style:n()?e.IFont.Style.Normal:e.IFont.Style.Italic}})}).update({state:n}),me.getCommand("formatStrikeThroughToggle").updateCallback(function(){j(this,{font:{strike:!xe.getStrike()}})}).update({state:xe.getStrike()}),me.getCommand("formatUnderlinedToggle").updateCallback(function(){j(this,{font:{underline:xe.getUnderline()!==e.IFont.UnderlineStyle.Single?e.IFont.UnderlineStyle.Single:e.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===e.IFont.UnderlineStyle.Single}),me.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){j(this,{font:{underline:xe.getUnderline()!==e.IFont.UnderlineStyle.Double?e.IFont.UnderlineStyle.Double:e.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===e.IFont.UnderlineStyle.Double}),me.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){j(this,{font:{underline:xe.getUnderline()!==e.IFont.UnderlineStyle.SingleAccounting?e.IFont.UnderlineStyle.SingleAccounting:e.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===e.IFont.UnderlineStyle.SingleAccounting}),me.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){j(this,{font:{underline:xe.getUnderline()!==e.IFont.UnderlineStyle.DoubleAccounting?e.IFont.UnderlineStyle.DoubleAccounting:e.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===e.IFont.UnderlineStyle.DoubleAccounting}),me.getCommand("formatSuperscriptToggle").updateCallback(function(){j(this,{font:{verticalAlign:xe.getVerticalAlignment()!==e.IFont.VerticalAlignment.Super?e.IFont.VerticalAlignment.Super:e.IFont.VerticalAlignment.Baseline}})}).update({state:xe.getVerticalAlignment()===e.IFont.VerticalAlignment.Super}),me.getCommand("formatSubscriptToggle").updateCallback(function(){j(this,{font:{verticalAlign:xe.getVerticalAlignment()!==e.IFont.VerticalAlignment.Sub?e.IFont.VerticalAlignment.Sub:e.IFont.VerticalAlignment.Baseline}})}).update({state:xe.getVerticalAlignment()===e.IFont.VerticalAlignment.Sub});const o=()=>ke===e.ITextFrame.Overflow.Visible;me.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){j(this,{alignment:{overflow:(o(),e.ITextFrame.Overflow.Visible)}})}).update({state:o});const r=()=>ke===e.ITextFrame.Overflow.Wrap;me.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){j(this,{alignment:{overflow:r()?e.ITextFrame.Overflow.Visible:e.ITextFrame.Overflow.Wrap}})}).update({state:r});const l=function(){return ke===e.ITextFrame.Overflow.Clip};me.getCommand("formatTextOverflowClipToggle").updateCallback(function(){j(this,{alignment:{overflow:l()?e.ITextFrame.Overflow.Visible:e.ITextFrame.Overflow.Clip}})}).update({state:l});const i=function(){return ke===e.ITextFrame.Overflow.Shrink};me.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){j(this,{alignment:{overflow:i()?e.ITextFrame.Overflow.Visible:e.ITextFrame.Overflow.Shrink}})}).update({state:i});const a=function(){return ke===e.ITextFrame.Overflow.Shrink};me.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){j(this,{alignment:{overflow:a()?e.ITextFrame.Overflow.Visible:e.ITextFrame.Overflow.Ellipsis}})}).update({state:a,disabled:!0});const d=function(){return Re===e.ITextFrame.VerticalAlignment.Top};me.getCommand("formatAlignTopToggle").updateCallback(function(){j(this,{alignment:{vertical:d()?e.ITextFrame.VerticalAlignment.Bottom:e.ITextFrame.VerticalAlignment.Top}})}).update({state:d});const c=function(){return Re===e.ITextFrame.VerticalAlignment.Center};me.getCommand("formatAlignMiddleToggle").updateCallback(function(){j(this,{alignment:{vertical:c()?e.ITextFrame.VerticalAlignment.Bottom:e.ITextFrame.VerticalAlignment.Center}})}).update({state:c});const g=function(){return Re===e.ITextFrame.VerticalAlignment.Bottom};me.getCommand("formatAlignBottomToggle").updateCallback(function(){j(this,{alignment:{vertical:(g(),e.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:g});const h=function(){return Re===e.ITextFrame.VerticalAlignment.Justify};me.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){j(this,{alignment:{vertical:h()?e.ITextFrame.VerticalAlignment.Bottom:e.ITextFrame.VerticalAlignment.Justify}})}).update({state:h});const m=function(){return Re===e.ITextFrame.VerticalAlignment.Distributed};me.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){j(this,{alignment:{vertical:m()?e.ITextFrame.VerticalAlignment.Bottom:e.ITextFrame.VerticalAlignment.Distributed}})}).update({state:m});const f=function(){return Se===e.ITextFrame.HorizontalAlignment.Left};me.getCommand("formatAlignLeftToggle").updateCallback(function(){j(this,{alignment:{horizontal:f()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Left}})}).update({state:f});const p=function(){return Se===e.ITextFrame.HorizontalAlignment.Center};me.getCommand("formatAlignCenterToggle").updateCallback(function(){j(this,{alignment:{horizontal:p()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Center}})}).update({state:p});const v=function(){return Se===e.ITextFrame.HorizontalAlignment.CenterContinuous};me.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const t={alignment:{horizontal:v()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};j(this,t)}).update({state:v});const C=function(){return Se===e.ITextFrame.HorizontalAlignment.Fill};me.getCommand("formatAlignFillToggle").updateCallback(function(){const t={alignment:{horizontal:C()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Fill,rotation:null}};j(this,t)}).update({state:C});const b=function(){return Se===e.ITextFrame.HorizontalAlignment.Distributed};me.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){j(this,{alignment:{horizontal:b()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:b});const w=function(){return Se===e.ITextFrame.HorizontalAlignment.Right};me.getCommand("formatAlignRightToggle").updateCallback(function(){j(this,{alignment:{horizontal:w()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Right}})}).update({state:w});const y=function(){return Se===e.ITextFrame.HorizontalAlignment.Justify};me.getCommand("formatAlignJustifyToggle").updateCallback(function(){j(this,{alignment:{horizontal:y()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Justify}})}).update({state:y});const x=!s.getProtection().isFormatCellsAllowed(),q=Se===e.ITextFrame.HorizontalAlignment.CenterContinuous||Se===e.ITextFrame.HorizontalAlignment.Fill;me.getCommand("formatTextRotate0").updateCallback(function(e){j(this,{alignment:{rotation:0}})}).update({disabled:x||q,state:0===Me}),me.getCommand("formatTextRotate45").updateCallback(function(e){j(this,{alignment:{rotation:e??1?45:0}})}).update({disabled:x||q,state:45===Me}),me.getCommand("formatTextRotate90").updateCallback(function(e){j(this,{alignment:{rotation:e??1?90:0}})}).update({disabled:x||q,state:90===Me}),me.getCommand("formatTextRotate270").updateCallback(function(e){j(this,{alignment:{rotation:e??1?270:0}})}).update({disabled:x||q,state:270===Me}),me.getCommand("formatTextRotate315").updateCallback(function(e){j(this,{alignment:{rotation:e??1?315:0}})}).update({disabled:x||q,state:315===Me}),me.getCommand("formatTextRotateCustom").updateCallback(function(e){j(this,{alignment:{rotation:e}})}).update({disabled:x||q,state:Me??0})},[ye,s,u,k,T]),r.useEffect(()=>{const t=!s.getProtection().isFormatCellsAllowed(),n=s.getSelectedRanges().getMerges().length>0,r=async(t,n)=>{O(n,async o=>{const r=async(r=!1)=>{const l=await Promise.resolve(m?.showBusy?.(n.label()));try{const n=o.getSelectedRanges();if(n.merge({orientations:t,discardMultipleValues:r}),t===e.IRange.Orientations.Both){const t={alignment:{horizontal:e.ITextFrame.HorizontalAlignment.Center}};n.updateStyle(t)}}catch(e){throw e}finally{l?.()}};let l;try{await r()}catch(e){if("discardMultipleValues"!==e.type)throw e;l=!0}if(l&&m?.showOptions){if("Merge"!==await(m?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})))return;await r(!0)}},void 0,void 0,!1)},l=e=>{O(e,async e=>{try{const t=e.getSelectedRanges();t.unmerge();const n={alignment:{horizontal:null}};t.updateStyle(n)}catch(e){throw e}})};me.getCommand("mergeToggle").updateCallback(function(){o.CoordUtils.isSingleCell(s.getSelectedRange().getCoords())||(n?l(this):r(e.IRange.Orientations.Both,this))}).update({state:n,disabled:!fe||t}),me.getCommand("mergeHorizontal").updateCallback(function(){r(e.IRange.Orientations.Column,this)}).update({disabled:!fe||t}),me.getCommand("mergeVertical").updateCallback(function(){r(e.IRange.Orientations.Row,this)}).update({disabled:!fe}),me.getCommand("unmerge").updateCallback(function(){l(this)}).update({disabled:!n||!fe||t});const i={disabled:t};me.getCommand("hideRows").updateCallback(function(){O(this,e=>{e.getRowHeaders().setHidden(e.getSelectedRanges().getCoords(),!0)})}).update(i),me.getCommand("hideColumns").updateCallback(function(){O(this,e=>{e.getColumnHeaders().setHidden(e.getSelectedRanges().getCoords(),!0)})}).update(i),me.getCommand("unhideRows").updateCallback(function(){O(this,e=>{e.getRowHeaders().setHidden(e.getSelectedRanges().getCoords(),!1)})}).update(i),me.getCommand("unhideColumns").updateCallback(function(){O(this,e=>{e.getColumnHeaders().setHidden(e.getSelectedRanges().getCoords(),!1)})}).update(i),me.getCommand("autoFitRows").updateCallback(function(){O(this,t=>{t.getSelectedRanges().autoFit({orientations:e.IRange.Orientations.Row})})}).update(i),me.getCommand("autoFitColumns").updateCallback(function(){O(this,t=>{t.getSelectedRanges().autoFit({orientations:e.IRange.Orientations.Column})})}).update(i);let a=!1,d=0,c=!1,u=!1,g=0,h=!1;!b||t||ve||(a=b.isEntireColumnsAny(),a&&!b.isEntireColumns()?c=!0:d=b.getColumnCount(),u=b.isEntireRowsAny(),u&&!b.isEntireRows()?h=!0:g=b.getRowCount());const f={disabled:t||b&&1!==b.getCount()};me.getCommand("sortAscending").update(f),me.getCommand("sortDescending").update(f);const p={disabled:a||u||t||ve},v=a||t||ve||h;v&&(d=1);const C=u||t||ve||c;C&&(g=1);let w="",y="",x="",q="",S="",R="",k="",M="",T="";d>1&&(R=y=d+" ",k=x="s"),g>1&&(M=q=g+" ",T=S="s"),"copy"===E.getMode()?.key?(w=q=y="Copied ",x=S="s"):"cut"===E.getMode()?.key&&(w=q=y="Cut ",x=S="s");let I="",F="";if(b){const t=b.getDefaultShiftOrientation()===e.IRange.Orientation.Column;I=` (${t?"Shift Right":"Shift Down"})`,F=` (${t?"Shift Left":"Shift up"})`,me.getCommand("deleteCells").update({label:`Delete Cells${F}`})}me.getCommand("insertCells").update({label:`Insert ${w}Cells${I}`,scopedLabels:{insertCells:`${w}At Selection`}}),me.getCommand("insertCellsShiftRight").update(p),me.getCommand("insertCellsShiftDown").update(p),me.getCommand("deleteCellsShiftUp").update(p),me.getCommand("deleteCellsShiftLeft").update(p),me.getCommand("insertRows").update({label:`Insert ${q}Row${S}`,scopedLabels:{insertCells:`${q}Row${S}`},disabled:C}),me.getCommand("insertRowsAfter").update({label:`Insert ${q}Row${S} Below`,disabled:C}),me.getCommand("insertColumns").update({label:`Insert ${y}Column${x}`,scopedLabels:{insertCells:`${y}Column${x}`},disabled:v}),me.getCommand("insertColumnsAfter").update({label:`Insert ${y}Column${x} After`,disabled:v}),me.getCommand("deleteRows").update({label:`Delete ${M}Row${T}`,scopedLabels:{deleteCells:`${M}Row${T}`},disabled:C}),me.getCommand("deleteColumns").update({label:`Delete ${R}Column${k}`,scopedLabels:{deleteCells:`${R}Column${k}`},disabled:v})},[ue,fe,ve,b,E,m,de]),r.useEffect(()=>{const t=s.getProtection(),n=s.getProtection().isLocked(),o=!t.isFormatCellsAllowed(),r={disabled:o};me.getCommand("protectionSheetToggle").updateCallback(async(e,o)=>{let r=null;try{if(n){let e=null;if(t.hasPassword()){const t=await(m?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"}));if("Unprotect"!==t.option)return;e=t.input}r=await Promise.resolve(m?.showBusy?.(o.label())),await t.unlock(e)}else r=await Promise.resolve(m?.showBusy?.(o.label())),await t.lock();r?.()}catch(e){r?.(),m?.showError?.(e)}}).update({state:n,label:()=>n?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:n?"Unprotect":"Protect"}}),me.getCommand("deleteTable").update(r),me.getCommand("sortAscending").update(r),me.getCommand("sortDescending").update(r),me.getCommand("sortCustom")?.update(r),me.getCommand("updateComments").update(r),me.getCommand("deleteComments").update(r),me.getCommand("insertChart")?.update(r),me.getCommand("insertImageFromFile").update(r),me.getCommand("insertImageFromURL").update(r),me.getCommand("formatBorder").update(r),me.getCommand("formatFillColor").update(r),me.getCommand("formatFontColor").update(r),me.getCommand("formatBoldToggle").update(r),me.getCommand("formatItalicToggle").update(r),me.getCommand("formatUnderlinedToggle").update(r),me.getCommand("formatStrikeThroughToggle").update(r),me.getCommand("formatSuperscriptToggle").update(r),me.getCommand("formatSubscriptToggle").update(r),me.getCommand("formatAlignTopToggle").update(r),me.getCommand("formatTextOverflowVisibleToggle").update(r),me.getCommand("formatTextOverflowWrapToggle").update(r),me.getCommand("formatTextOverflowClipToggle").update(r),me.getCommand("formatTextOverflowShrinkToggle").update(r),me.getCommand("formatAlignMiddleToggle").update(r),me.getCommand("formatAlignBottomToggle").update(r),me.getCommand("formatAlignDistributedVerticalToggle").update(r),me.getCommand("formatAlignJustifyVerticalToggle").update(r),me.getCommand("formatAlignLeftToggle").update(r),me.getCommand("formatAlignCenterToggle").update(r),me.getCommand("formatAlignRightToggle").update(r),me.getCommand("formatAlignJustifyToggle").update(r),me.getCommand("formatAlignCenterContinuousToggle").update(r),me.getCommand("formatAlignDistributedHorizontalToggle").update(r),me.getCommand("formatAlignFillToggle").update(r),me.getCommand("formatFontSizeIncrease").update(r),me.getCommand("formatFontSizeDecrease").update(r),me.getCommand("formatFontFamily").update(r),me.getCommand("formatFontSize").update(r),me.getCommand("formatNumberFormat").update(r),me.getCommand("formatNumberFormatGeneralStyle").update(r),me.getCommand("formatNumberFormatNumberStyle").update(r),me.getCommand("formatNumberFormatTimeStyle").update(r),me.getCommand("formatNumberFormatDateStyle").update(r),me.getCommand("formatNumberFormatAccountingStyle").update(r),me.getCommand("formatNumberFormatPercentStyle").update(r),me.getCommand("formatNumberFormatScientificStyle").update(r),me.getCommand("formatNumberFormatCommaStyle").update(r),me.getCommand("formatNumberFormatIncreaseDecimal").update(r),me.getCommand("formatNumberFormatDecreaseDecimal").update(r),me.getCommand("hideColumns").update(r),me.getCommand("unhideColumns").update(r),me.getCommand("hideRows").update(r),me.getCommand("unhideRows").update(r),me.getCommand("quickFormulaSum").update(r),me.getCommand("quickFormulaAverage").update(r),me.getCommand("quickFormulaCount").update(r),me.getCommand("quickFormulaMax").update(r),me.getCommand("quickFormulaMin").update(r),me.getCommand("startEditCurrentTime").update(r),me.getCommand("startEditCurrentDate").update(r),me.getCommand("startEditValueAbove").update(r),me.getCommand("fillDown").update(r),me.getCommand("fillRight").update(r),me.getCommand("fillUp").update(r),me.getCommand("fillLeft").update(r),me.getCommand("formatCellStyle").update(r),me.getCommand("formatTableStyle").update(r),me.getCommand("formatPainterToggle").update(r),me.getCommand("formatBorderAddOutline").update(r),me.getCommand("formatBorderClearOutline").update(r),me.getCommand("formatIndentDecrease").update(r),me.getCommand("formatIndentIncrease").update(r),me.getCommand("clearContents").update(r),me.getCommand("clearFormats").update(r),me.getCommand("clearAll").update(r),me.getCommand("clearComments").update(r),me.getCommand("clearHyperlinks").update(r),me.getCommand("autoFilterClear").update(r),me.getCommand("autoFilterReapply").update(r);const l=Se===e.ITextFrame.HorizontalAlignment.CenterContinuous||Se===e.ITextFrame.HorizontalAlignment.Fill,i={disabled:o||l};me.getCommand("formatTextRotate0").update(i),me.getCommand("formatTextRotate45").update(i),me.getCommand("formatTextRotate90").update(i),me.getCommand("formatTextRotate270").update(i),me.getCommand("formatTextRotate315").update(i),me.getCommand("formatTextRotateCustom").update(i),me.getCommand("formatTextRotateVertical").update(i)},[ue]),me}var _,Z;!function(){if(Z)return _;Z=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,l="object"==typeof R&&R&&R.Object===Object&&R,i="object"==typeof self&&self&&self.Object===Object&&self,a=l||i||Function("return this")(),s=Object.prototype.toString,d=Math.max,c=Math.min,u=function(){return a.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function h(l){if("number"==typeof l)return l;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(l))return NaN;if(g(l)){var i="function"==typeof l.valueOf?l.valueOf():l;l=g(i)?i+"":i}if("string"!=typeof l)return 0===l?l:+l;l=l.replace(e,"");var a=n.test(l);return a||o.test(l)?r(l.slice(2),a?2:8):t.test(l)?NaN:+l}_=function(e,t,n){var o,r,l,i,a,s,m=0,f=!1,p=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function C(t){var n=o,l=r;return o=r=void 0,m=t,i=e.apply(l,n)}function b(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-m>=l}function w(){var e=u();if(b(e))return y(e);a=setTimeout(w,function(e){var n=t-(e-s);return p?c(n,l-(e-m)):n}(e))}function y(e){return a=void 0,v&&o?C(e):(o=r=void 0,i)}function x(){var e=u(),n=b(e);if(o=arguments,r=this,s=e,n){if(void 0===a)return function(e){return m=e,a=setTimeout(w,t),f?C(e):i}(s);if(p)return a=setTimeout(w,t),C(s)}return void 0===a&&(a=setTimeout(w,t)),i}return t=h(t)||0,g(n)&&(f=!!n.leading,l=(p="maxWait"in n)?d(h(n.maxWait)||0,t):l,v="trailing"in n?!!n.trailing:v),x.cancel=function(){void 0!==a&&clearTimeout(a),m=0,o=s=r=a=void 0},x.flush=function(){return void 0===a?i:y(u())},x}}();var X,Y,J={exports:{}},Q={};Y||(Y=1,J.exports=function(){if(X)return Q;X=1;var e=r,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,o=e.useEffect,l=e.useLayoutEffect,i=e.useDebugValue;function a(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!t(e,o)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),s=n({inst:{value:r,getSnapshot:t}}),d=s[0].inst,c=s[1];return l(function(){d.value=r,d.getSnapshot=t,a(d)&&c({inst:d})},[e,r,t]),o(function(){return a(d)&&c({inst:d}),e(function(){a(d)&&c({inst:d})})},[e]),i(r),r};return Q.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,Q}()),J.exports;var ee,te,ne={exports:{}},oe={exports:{}},re=oe.exports;function le(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}!function(){if(te)return ne.exports;te=1;for(var e=(ee||(ee=1,function(){var e,t,n,o,r,l;"undefined"!=typeof performance&&null!==performance&&performance.now?oe.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(oe.exports=function(){return(e()-r)/1e6},t=process.hrtime,o=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),l=1e9*process.uptime(),r=o-l):Date.now?(oe.exports=function(){return Date.now()-n},n=Date.now()):(oe.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}.call(re)),oe.exports),t="undefined"==typeof window?R:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],l=t["cancel"+o]||t["cancelRequest"+o],i=0;!r&&i<n.length;i++)r=t[n[i]+"Request"+o],l=t[n[i]+"Cancel"+o]||t[n[i]+"CancelRequest"+o];if(!r||!l){var a=0,s=0,d=[],c=1e3/60;r=function(t){if(0===d.length){var n=e(),o=Math.max(0,c-(n-a));a=o+n,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(a)}catch(e){setTimeout(function(){throw e},0)}},Math.round(o))}return d.push({handle:++s,callback:t,cancelled:!1}),s},l=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}ne.exports=function(e){return r.call(t,e)},ne.exports.cancel=function(){l.apply(t,arguments)},ne.exports.polyfill=function(e){e||(e=t),e.requestAnimationFrame=r,e.cancelAnimationFrame=l},ne.exports}();const ie=r.memo(r.forwardRef((e,l)=>{const{style:i=t.ReactUtils.EmptyCssProperties,orientation:a,sheet:s,onShowTooltip:d,onCloseTooltip:c,onScrollOffset:u,showCustomScrollButtons:g=!1,offset:h=0,totalSize:m=0,viewportSize:f=0,...p}=e;if(!s)throw new Error("SheetScrollBar needs a sheet model");const[v]=T(),C=t.useCallbackRef(d,[d]),b=t.useCallbackRef(c,[c]),w=(y=v,x=l,r.useMemo(()=>null===y&&null===x?null:e=>{le(y,e),le(x,e)},[y,x]));var y,x;const[q,S]=r.useState(()=>{const e=s.getView().getTopLeft();return a===t.ScrollbarOrientation.Vertical?e.top:e.left}),R=()=>{const e=s.getView().getFreezePanes();if(a===t.ScrollbarOrientation.Vertical){if(0===e.coords.rowIndex)return{shift:0,scroll:0};return{shift:s.getRowHeaders().findOffset(e.coords.rowIndex)-e.topLeft.top,scroll:e.topLeft.top}}if(0===e.coords.colIndex)return{shift:0,scroll:0};return{shift:s.getColumnHeaders().findOffset(e.coords.colIndex)-e.topLeft.left,scroll:e.topLeft.left}},[k,M]=r.useState(R),[I,E]=r.useState(null),[F,A]=r.useState(!1),D=a===t.ScrollbarOrientation.Vertical?s.getRowHeaders():s.getColumnHeaders(),z=()=>{const e=s.getUsedRange()?.getCoords()??o.CoordUtils.EmptyRange,t=s.getSelection().getCoords().cell;return{colIndex:Math.max(e.colEnd,t.colIndex),rowIndex:Math.max(e.rowEnd,t.rowIndex)}},[N,L]=r.useState(z),O=N?(a===t.ScrollbarOrientation.Vertical?N.rowIndex:N.colIndex)+1:0,j=()=>{const e=z();o.CoordUtils.isEqualCells(N,e)||L(e)};W(s.getView(),{onFreezeSplitChange:()=>{M(R)}}),W(s.getSelection(),{onChange:j}),W(s,{onUsedRangeChange:j}),r.useEffect(()=>{L(z())},[s]),r.useEffect(()=>{if(!I)return F&&b?.(),void A(!1);const e=D.getTextAt(D.findIndex(q/(s.getView().getZoomScale()/100)+k.scroll+k.shift));A(!0),C?.({...I,display:(a===t.ScrollbarOrientation.Vertical?"Row":"Column")+": "+e})},[h,q,k,a,I,D,F,s]);const B=t.useCallbackRef((e,t,n)=>{S(e);const o=e+k.scroll,r=t+k.shift,l=n+k.shift+k.scroll;u?.(o,r,l)},[u,k]),V=h-k.scroll,P=f-k.shift,H=m-(k.shift+k.scroll),U=D.findOffset(O)*(s.getView().getZoomScale()/100)-(k.scroll+k.shift);return n.jsx(t.VirtualScrollbar,{ref:w,style:i,offset:V,viewportSize:P,totalSize:H,orientation:a,showCustomScrollButtons:g,onMouseDown:e=>{E({anchor:{x:e.clientX,y:e.clientY}}),e.preventDefault()},onScrollOffset:B,onMouseOut:()=>{E(null)},onMouseUp:()=>{E(null)},minSize:U,...p})}));ie.displayName="SheetScrollbar";const ae=(e,t,n=null)=>{const o=[];for(let r=0;r<e.length;r++)if(e[r].value.isSelectedAll){if(e[r].min===e[r].max&&e[r].min===n)continue;o.push({address:{min:e[r].min,max:e[r].max},update:t})}return o},se=r.memo(r.forwardRef((i,a)=>{const{sheetHeader:s,gridRef:d,sheetElement:c,commands:u,oppositeSize:g=30,containerWidth:h,containerHeight:m,headerText:f,freezeStart:p,gridStyle:v,verticalPadding:C,horizontalPadding:b,onSheetContextMenu:w,onResizeHeadersStart:y,onResizeHeaders:x,onResizeHeadersEnd:q,onResizeHeadersDown:S,onResizeHeadersUp:R,scrollPoint:k,onSelectionStart:M,onSelectionEnd:T}=i,I=r.useMemo(()=>s.getOrientation(),[s]),E=r.useRef(null),[F,A]=r.useReducer(e=>e+1,0),[D,z]=r.useReducer(e=>e+1,0),N=s?.getSheet(),L=r.useRef(!1);r.useLayoutEffect(()=>{L.current=!0},[s]);const O=r.useMemo(()=>s.getEntireRange().getCoords().max+1,[s]),j=r.useMemo(()=>{const t=I===e.IRange.Orientation.Column;return{left:t?k.left:0,top:t?0:k.top}},[k]),[B,V]=r.useState(N?.getView().getZoomScale()/100),[P,H]=r.useState(null);W(s,{onSizesChange:e=>{V(N?.getView().getZoomScale()/100),ie(re())}});const U=r.useCallback(()=>{E.current?.invalidate(),z()},[]),K=r.useCallback(o.CommonUtils.debounce(()=>{U()},10),[]),[$,G]=r.useState(null);W(s.getSheet(),{onSelectionChange(){G(N?.getSelection().getCoords()),K()},onProtectionChange(){U()},onViewChange(){K()}}),r.useLayoutEffect(()=>{ie(re())},[I,B,g]),r.useLayoutEffect(()=>{H(null),V(s?.getSheet().getView().getZoomScale()/100),ie(re())},[s]);const _=r.useCallback(e=>s.at(e)?.isHidden()||0===s.at(e)?.getSize(),[s]),Z=r.useCallback((e,t)=>s.hiddenHeadersAt(e,t),[_]),X=t.useCallbackRef(e=>s.isSelected(e),[s]),Y=t.useCallbackRef(e=>s.isSelectedAll(e),[s]),J=r.useCallback(()=>s.getMinSize(),[s]),Q=r.useCallback(()=>s.getMaxSize(),[s]),ee=t.useCallbackRef((t,n,r)=>{n/=B;const l={size:n=Math.max(J(),Math.min(o.CommonUtils.roundAccurately(n,J()),Q())),hidden:!1},i=[];if(n<=0&&(l.hidden=!0,l.size=r),i.push({address:{min:t,max:t},update:l}),n<0){const o=I===e.IRange.Orientation.Column,r=o?le.getColOffset:le.getRowOffset,l=o?le.getColIndex:le.getRowIndex,a=r(t);let s=l(a+n);const d=r(s);d===a+n?s--:i.push({address:{min:s,max:s},update:{size:a-d+n}}),t-s>1&&i.push({address:{min:s+1,max:t-1},update:{hidden:!0}})}s.updateHeaderPairs(i),x?.(t,n,r)},[F,s,B,x]),te=t.useCallbackRef((t,n,o)=>{const r=I===e.IRange.Orientation.Column;let l=null,i={min:t,max:t};if(s.isSelectedAll(t)){const e=s.getSelectedRuns();e.length>1?l="Resize "+(r?"Columns":"Rows"):i=e[0];const a={hidden:n<=0,size:(n<=0?o:n)/B};s.updateHeaderPairs(ae(e,a,t))}if(i){const e=i.max-i.min+1;let t;t=1===e?s.getRange(i).at(0).getDisplayText():s.getRange(i).toString(),l=`Resize ${r?"Column":"Row"}${e>1?"s":""} '${t}'`}q?.(t,n,l)},[F,s,q]),ne=t.useCallbackRef((t,n)=>{const o=I===e.IRange.Orientation.Column;y(t,n,`Resize ${o?"Column":"Row"}(s)`)},[y]),oe=t.useCallbackRef(t=>{let n=!1;const o=I===e.IRange.Orientation.Column,r=s.getSheet().getEntireRange().getCoords(),l=[],i=s.getSelectedRuns(),a=e=>{let t;t=o?{colStart:e.min,rowStart:r.rowStart,colEnd:e.max,rowEnd:r.rowEnd}:{colStart:r.colStart,rowStart:e.min,colEnd:r.colEnd,rowEnd:e.max},l.push(t)};for(let e=0;e<i.length;e++){const o=i[e];o.value.isSelectedAll&&(o.min<=t&&o.max>=t&&(n=!0),a(o))}n||a({min:t,max:t}),s.getSheet().getRanges(l).autoFit({orientations:o?e.IRange.Orientations.Column:e.IRange.Orientations.Row});if(_(t)){const e={hidden:null},o=ae(i,e);n||o.push({address:t,update:e}),s.updateHeaderPairs(o)}q?.(t,null,"Resize Column(s)")},[F,s,q,_]),re=()=>{const t=I===e.IRange.Orientation.Column;return{getColOffset:e=>t?s.findOffset(e):0===e?0:g/B,getColIndex:e=>t?s.findIndex(e):0,getRowOffset:e=>t?0===e?0:g/B:s.findOffset(e),getRowIndex:e=>t?0:s.findIndex(e)}},[le,ie]=r.useState(()=>re()),se=r.useCallback((n,o)=>!(n.nativeEvent.which===t.MouseButtonCodes.Right)||!Y(I===e.IRange.Orientation.Column?o.colIndex:o.rowIndex),[I,Y]),de=t.useCallbackRef(e=>{c.focusSheet()},[c]),ce=t.useCallbackRef(e=>{N?.getSelection().updateCoords(e)},[N]),{...ue}=l.useSelection({gridRef:d,commands:null,layout:le,selection:$,fillHandleBorderColor:v.body.fill,selectionBackgroundColor:v.selection.fill,selectionBorderColor:v.selection.strokeFill,selectionRemoveBackgroundColor:v.selectionRemove.fill,selectionRemoveBorderColor:v.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:ce,canSelectionSpanMergedCells:e=>{const t=N.getRange(e);return t.isEntireColumns()||t.isEntireRows()}}),ge=t.useCallbackRef(()=>{M?.();const e=N?.getSelection();e&&e.setAdjusting(e.getCoords())},[N,M]),he=t.useCallbackRef(async()=>{N?.getSelection().setAdjusting(null),T?.()},[N,T]),{...me}=l.useHeaderSelection({orientation:I,headerCount:O,gridRef:E,gridMainRef:d,newSelection:ue?.newSelection,modifySelection:ue?.modifySelection,appendSelection:ue?.appendSelection,clearSelections:ue?.clearSelections,pointerDownInterceptor:se,onPointerUp:de,onDragStart:ge,onDragEnd:he}),fe=v.selection?.strokeFill;r.useEffect(()=>{if(!E.current)return void H(null);const r=I===e.IRange.Orientation.Column,i=s.getSelectedRuns(),a=s.isProtected()?null:ee,d=(e,o,l)=>{if(l)return r?n.jsx("div",{style:{position:"absolute",borderBottom:`${v.headerSelection.strokeWidth}px solid ${fe}`,pointerEvents:"none",top:`${t.ReactUtils.boundPixel(-v.headerSelection.strokeWidth/2)}px`,left:`${t.ReactUtils.boundPixel(l.x-v.headerSelection.strokeWidth)}px`,width:`${t.ReactUtils.boundPixel(l.width+v.headerSelection.strokeWidth+1,!0)}px`,height:g+v.headerSelection.strokeWidth-.5+"px"}},e):n.jsx("div",{style:{position:"absolute",borderRight:`${v.headerSelection.strokeWidth}px solid ${fe}`,pointerEvents:"none",top:`${t.ReactUtils.boundPixel(l.y-v.headerSelection.strokeWidth)}px`,left:`${t.ReactUtils.boundPixel(-v.headerSelection.strokeWidth/2)}px`,width:g+v.headerSelection.strokeWidth-.5+"px",height:`${t.ReactUtils.boundPixel(l.height+v.headerSelection.strokeWidth+1,!0)}px`}},e)},c=(e,t,n)=>{const o={x:0,y:0,width:0,height:0};if(r){const r=n.toClipBounds(n.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:e,colEnd:Math.min(O,t)}),l.SELECTION_CLIP_INSETS);if(!r)return;o.x=r.x,o.width=r.width}else{const r=n.toClipBounds(n.getRangeCoordsBounds({rowStart:e,rowEnd:Math.min(O,t),colStart:0,colEnd:0}),l.SELECTION_CLIP_INSETS);if(!r)return;o.y=r.y,o.height=r.height}return{x:o.x,y:o.y,width:o.width,height:o.height}};H([e=>{const t=[];let d=null,c=r?e.getVisibleColumns():e.getVisibleRows();const u=r?e.getTotalRangeCoords().colStart:e.getTotalRangeCoords().rowStart;c.length>0&&c[0]>u&&(c=[c[0]-1,...c]);let g=[];const h=[];for(let e=0;e<c.length;e++){const t=c[e],n=e<c.length-1?c[e+1]:t+Z(t+1,!1)+1,r=t+1!==n;if(!d||d.max<t)if(i.length>0&&i[i.length-1].max>=t){const e=o.CommonUtils.findEqualOrGreater(i,t,e=>e.max);d=i[e]}else d=null;let l=!1,s=!1;if(d?.value&&(d.min<=t||d.min<=n&&!r)&&(l=!0,s=d.value.isSelectedAll),t===u){let e=!1,n=!1;d?.value&&d.min<=t&&(e=!0,n=d.value.isSelectedAll),t>0&&h.push({index:t-1,isNextHidden:r,isSelected:e,isSelectedAll:n,disabledResize:!0})}if(s&&g.push(h.length),h.push({index:t,isHidden:0===e&&Z(t,!1)>0,isNextHidden:r,isSelected:l,isSelectedAll:s,onDividerMouseDown:S,onDividerResizeStart:ne,onDividerResize:a,onDividerMouseUp:R,onDividerResizeEnd:te,onDividerAutoFit:oe}),r){let e=!1,r=!1;if(d&&d.min>=t&&d.max<=n-1&&d.value.isSelectedAll&&g.push(h.length),d?.value&&d.max>=n);else if(i.length>0&&i[i.length-1].max>=n){const e=o.CommonUtils.findEqualOrGreater(i,n,e=>e.max);d=i[e]}else d=null;d?.value&&d.min<=n&&(e=d.value.isSelected,r=d.value.isSelectedAll),n>0&&h.push({index:n-1,isHidden:!0,isSelected:e,isSelectedAll:r,onDividerMouseDown:S,onDividerResizeStart:ne,onDividerResize:a,onDividerMouseUp:R,onDividerResizeEnd:te,onDividerAutoFit:oe})}}if(g.length>0){let t=g.length-1;if(g.length>0){const n=h[g[t]].index;let o=null;r?(o=e.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:n,colEnd:n}),o.x+o.width>e.getBounds().width&&(t-=1,0===t&&(t=-1))):(o=e.getRangeCoordsBounds({rowStart:n,rowEnd:n,colStart:0,colEnd:0}),o.y+o.height>e.getBounds().height&&(t-=1,0===t&&(t=-1)))}const n=i?.[i.length-1],o=e.getAnchor();if("t"===o||"l"===o){const e=h[g[Math.max(0,g.length-1)]];e.showTouchDivider=n&&n.max<=e.index}else t>=0&&(h[g[t]].showTouchDivider=!0)}const{header:m,headerSelect:f,headerSelectAll:p,headerHover:C}=v??{};for(let o=0;o<h.length;o++)t.push(n.jsx(l.HeaderDivider,{orientation:I,view:e,headerStyle:m,headerStyleSelect:f,headerStyleSelectAll:p,headerStyleHover:C,disabled:s.isProtected(),...h[o]},`divider${o}`));return t},e=>{const t=[];for(let n=0;i&&n<i.length;n++)t.push(d(`selection:${e.getAnchor()}:${n}`,0,c(i[n].min,i[n].max,e)));return t}])},[D,!0,fe,v,le,O,p,F,B]),r.useEffect(()=>{E.current?.invalidate()},[F]);const pe=t.useCallbackRef(e=>f?f(e):s.getTextAt(e),[f,s]),ve=t.useCallbackRef(t=>{const{header:o,headerSelect:r,headerSelectAll:i,headerHover:a}=v??{},{range:s,key:d,...c}=t;return n.jsx(l.HeaderRenderer,{orientation:I,index:I===e.IRange.Orientation.Column?s.colStart:s.rowStart,isSelected:X,isSelectedAll:Y,zoomScale:100*B,headerText:pe,headerStyle:o,headerStyleSelect:r,headerStyleSelectAll:i,headerStyleHover:a,verticalPadding:C,horizontalPadding:b,...c},d)},[F,O,v,B,s]),Ce=t.useEditMode(),be=r.useMemo(()=>{const n="white",o="black",r={};if("touch"!==t.ReactUtils.detectIt().primaryInput){let t=I===e.IRange.Orientation.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${o}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${o}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;const l=Ce.getMode();if("formatPainter"===l?.key){const e=30,r=22;t=`url("data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 ${e} ${r}' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='${"M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z"}' stroke='${o}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}r.cursor=t}return r.backgroundColor=v?.header?.fill||"transparent",r},[I,F,Ce,v]),we=t.useImperativeElement(a,()=>({scrollTo:e=>{E.current?.scrollTo(e)},forceRender:()=>{A()},getGridElement:()=>E.current}),[]),ye=r.useCallback(e=>{me.onPointerDown(e)},[me]),xe=r.useCallback(t=>{const n=me.getCellCoordsFromClient(t.clientX,t.clientY);if(!n)return;if(!w)return;const o=I===e.IRange.Orientation.Column;w({originalEvent:t,clientX:t.clientX,clientY:t.clientY,rowIndex:o?-1:n.rowIndex,colIndex:o?n.colIndex:-1}),t.stopPropagation(),t.preventDefault()},[me,w]),qe=r.useMemo(()=>{const t=I===e.IRange.Orientation.Column;return n.jsx("div",{ref:we,children:n.jsx(l.Grid,{className:"sheet-header",style:be,ref:E,scrollPoint:j,columnCount:t?O:1,rowCount:t?1:O,width:t?h:g,height:t?g:m,freezeLeft:t?p:void 0,freezeTop:t?void 0:p,hiddenColumnsAt:t?Z:void 0,hiddenRowsAt:t?void 0:Z,showGridLines:!1,layout:le,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:xe,onPointerDown:ye,zoom:B,cellRenderer:ve,overlays:P})})},[P,le,h,m,j,be,D]);return r.useEffect(()=>{L.current=!1,E.current?.invalidate(),z()},[s,v]),qe})),de=r.memo(r.forwardRef((e,n)=>{const{view:o,sheet:r,getVisibleCells:l,gridStyle:i}=e,a=t.useCallbackRef((e,t)=>e.getStyle().getBorder(),[]),{overlay:s}=A({getVisibleCells:l,getBorderAt:a,darkMode:i.body.darkMode,shiftIfWide:!0}),d=s(o);return d&&o?d:null})),ce={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},ue={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},ge={type:e.ICell.Content.Values},he={fitDestination:!0,type:e.ICell.Content.Formats},me={fitDestination:!0,type:e.ICell.Content.Formulas},fe={transpose:!0},pe={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},ve=({element:n,sheet:i,sheetView:a,commands:s,onClipboardUpdate:d,onPaste:c,selectionRenderer:u=l.defaultSelectionRenderer,copyForegroundColor:g="rgb(33, 115, 70)",cutForegroundColor:h="rgb(33, 115, 70)",copyBackgroundColor:m="white",cutBackgroundColor:f="white",notifier:p,...v})=>{const C=t.useCallbackRef(u,[u]),b=r.useRef(null),w=t.useEditMode(),y=w.getMode(),x=r.useMemo(()=>({element:n,doCopy:t=>{const n=i.getSelectedRanges().getSnapshot(t);return new e.RangeClipboardItem(n)}}),[i,a,n]),q=r.useMemo(()=>({element:n,importFromExternal:async(t,n)=>{const o=new e.ExternalRangeClipboardItem(t,n,i.getStyles(),i.isDate1904());return await o.parse()?o:null},doPaste:async(t,n)=>{if("range"!==t?.getItemType())return;n?.contentsOnly&&delete(n={...n,type:e.ICell.Content.Values}).contentsOnly;const o=i.getSelectedRange(),r=t.getItem(),l=r.getName();return await o.doBatch(async()=>{const t=await o.copyFrom(r,n);!t||t.isEntireRows()||t.isEntireColumns()||t.autoFit({orientations:e.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(l?` ${l}`:""),autoSelect:!0}),!0}}),[i,a,p,n]),{clipboard:S,...R}=t.useCopyPaste({...v,source:x,commands:s,target:q,notifier:p,onClipboardUpdate:e=>{const t="range"===e?.getItemType()?e:null;if(t){const t=e.editMode?.(),n={...e?.isCut?.()?ue:ce,...t,args:{isClipboard:!0,...t?.args},onModeChange:e=>{e?.args?.isClipboard||S.clear(!0),t?.onModeChange?.(e)}};w.setMode(n)}b.current=t,d?.(t)},onPaste:(e,t)=>{if("range"!==e?.getItemType())return;let r="cut"===w.getMode()?.key||e.isCut?.();if(!r&&"copy"===w.getMode()?.key){const t=e.getItem().getCoords(),n=i.getSelectedRanges().getCoords();let l=!1;if(!l&&t&&n&&e.getItem().getSource?.()===i)for(let e=0;!l&&e<n.length;e++)l=o.CoordUtils.isRangesIntersect(t,n[e]);r=l}r&&w.setMode(null),n?.()?.focus(),c?.(e,t)}});r.useMemo(()=>{const e=n;if(!s)return;const o=[new t.Command("pasteValues",e,{label:"Paste Values",scopedLabels:{paste:"Values"},description:"Paste only the values of the selected cells.\n\nThe formatting is not applied.",shortcut:{key:"V",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}}),new t.Command("pasteFormats",e,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:"Paste only the formats of the selected cells.\n\nThe content is not applied."}),new t.Command("pasteFormulas",e,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new t.Command("pasteTranspose",e,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new t.Command("pasteLinks",e,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];s.addCommands(o,!0)},[s,n]),r.useEffect(()=>{if(!s)return;const e={disabled:!i.getProtection().isFormatCellsAllowed()};s.getCommand("pasteValues").updateCallback(e=>R.paste({...ge,...e})).update(e),s.getCommand("pasteFormats").updateCallback((e,t)=>R.paste({...he,description:t.label(),...e})).update(e),s.getCommand("pasteFormulas").updateCallback((e,t)=>R.paste({...me,description:t.label(),...e})).update(e),s.getCommand("pasteTranspose").updateCallback((e,t)=>R.paste({...fe,description:t.label(),...e})).update(e),s.getCommand("pasteLinks").updateCallback((e,t)=>R.paste({...pe,description:t.label(),...e})).update(e),s.getCommand("cut").update(e),s.getCommand("paste").update(e)},[i,s]);const k=r.useMemo(()=>{if(!y||!b.current)return;const e=y.key;if("copy"!==e&&"cut"!==e&&"formatPainter"!==e)return;const t=b.current.getItem();if(t.getSource()!==i)return;const n=b.current.isCut?.(),o=n?f:m,r=n?h:g,a=t.getCoords(),s=a?[a]:null;return s&&0!==s.length?e=>{const t=[];for(let n=0;n<s.length;n++){const i=s[n],a=e.toClipBounds(e.getRangeCoordsBounds(i,{top:0,left:0,right:1,bottom:1}),l.SELECTION_CLIP_INSETS);a&&(t.push(C({range:i,key:`copy-selection-background-${n}`,x:a.x,y:a.y,width:Math.max(a.width,0),height:Math.max(a.height,0),stroke:o,strokeWidth:2})),t.push(C({range:i,key:`copy-selection-foreground-${n}`,x:a.x+(a.width<=2?-1:0),y:a.y,width:Math.max(a.width,3),height:Math.max(a.height,3),stroke:r,strokeWidth:2,isAnimatedStroke:!0})))}return t}:null},[y,i,a,g,m,h,f]);return{...R,clipboard:S,overlays:k}},Ce=r.memo(r.forwardRef((e,t)=>{const{view:n,element:o,sheet:l,gridStyle:i,commands:a,notifier:s}=e,d=i.body??{},c=l.getView(),{overlays:u}=ve({element:o,sheet:l,sheetView:c,commands:a,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:d.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:d.fill,notifier:s});return W(l?.getSelection(),{onChange(e){}}),r.useEffect(()=>{n?.getStage()},[n?.getStage()]),u&&n?u(n):null})),be="_sheet-selection_12wyx_5",we={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},ye={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},xe={key:"dragCopy",description:"Drag selection to copy cell contents."},qe={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Se=(e,t)=>t.ctrlKey&&t.shiftKey?qe:t.ctrlKey?xe:t.shiftKey?ye:we,Re={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},ke=r.memo(r.forwardRef((i,a)=>{const{view:s,commands:d,className:c,onFirstRender:u,notifier:g,onShowTooltip:h,onCloseTooltip:m,sheet:f,gridRef:p,gridStyle:v,isActive:C,editingCoords:b,...w}=i,y=s?.getBounds(),q=t.useCallbackRef(h,[h]),S=t.useCallbackRef(m,[m]),[R,k]=r.useState(()=>f?.getSelection().getCoords()),M=t.useCallbackRef(e=>{o.CoordUtils.isEqualSelectionCoords(e,R)||f&&f.getSelection().updateCoords(e)},[f,R]),T=t.useEditMode(),I=r.useRef(null),[E,F]=r.useState(f?.getProtection().isLocked()),[A,D]=r.useState(f?.getView().getMovableSelection().length>0),z="touch"===t.ReactUtils.detectIt().primaryInput,N=!z&&C,L=null!==b||A,O=t.useCallbackRef(e=>{const t=o.CoordUtils.cellToRange(e);if(f.isClosed())return t;const n=f.getRange(t,{excludeHidden:!0}).getMerges();return 0===n.length?t:n[0]},[f]),j=t.useCallbackRef((t,n,o,r,l,i)=>{const a=f.getSelectedRange().getExtended(r,t).getCoords();switch(r){case e.IRange.Direction.Up:return a.rowStart;case e.IRange.Direction.Down:return a.rowEnd;case e.IRange.Direction.Left:return a.colStart;case e.IRange.Direction.Right:return a.colEnd}},[f]),B=t.useCallbackRef(()=>{const e=f.getUsedRange()?.getCoords(),t=f.getRowHeaders().getUsedRange()?.getCoords(),n=f.getColumnHeaders().getUsedRange()?.getCoords();return{...e,colEnd:Math.max(e?.colEnd??0,n?.max??0),rowEnd:Math.max(e?.rowEnd??0,t?.max??0)}},[f]),P=t.useCallbackRef((e,t)=>f.getRowHeaders().hiddenHeadersAt(e,t),[f]),H=t.useCallbackRef((e,t)=>f.getColumnHeaders().hiddenHeadersAt(e,t),[f]),U=t.useCallbackRef(e=>f.getRange(e,{excludeHidden:!0}).getMerges(),[f]),K=t.useCallbackRef(e=>{f?.getSelection().setAdjusting(e)},[f]),$=t.useCallbackRef(async()=>{f?.getSelection().setAdjusting(null);const e=T.getMode();"formatPainter"===e?.key&&(await(d?.getCommand("pasteFormats")?.execute({})),T.setMode(null))},[T,R,f,d]),G=r.useMemo(()=>{const e=T.getMode();return"cut"===e?.key||"copy"===e?.key},[T]);W(f?.getView(),{onMovableSelectionChange:()=>{D(f.getView().getMovableSelection().length>0)}}),W(f?.getSelection(),{onChange(e){const t=f.getSelection().getCoords();k(t)}}),W(f,{onProtectionChange:()=>{F(f.getProtection().isLocked())}});const{body:_={}}=v||{},Z=s.getLayout(),X=!(N&&R.ranges.length<=1&&null===b&&!E&&(!T.getMode()||G)),{cursor:Y,overlay:J,onPointerDown:Q}=l.useSelection({gridRef:p,commands:d,layout:Z,getCellCoordsAsRangeCoords:O,selection:R,fillHandleBorderColor:_.fill,selectionBackgroundColor:C?v.selection.fill:v.selectionInactive.fill,selectionBorderColor:C?v.selection.strokeFill:v.selectionInactive.strokeFill,selectionRemoveBackgroundColor:C?v.selectionRemove.fill:v.selectionInactive.fill,selectionRemoveBorderColor:C?v.selectionRemove.strokeFill:v.selectionInactive.strokeFill,disableFillDrag:X,disableMoveDrag:z||!(C&&R.ranges.length<=1&&null===b&&!E),disableTouchSelection:L,onSelectionChange:M,onSelectionDragStart:K,onSelectionDragEnd:$,onMoveDragStart:(e,t,n)=>{T.setMode(Se(0,n))},onMoveDragUpdate:(e,t,n)=>{T.setMode(Se(0,n))},onMoveDragEnd:(e,t)=>{T.setMode(null)},onMoveDragDone:async(t,n,r)=>{if(o.CoordUtils.isEqualRanges(t,n))return;const l=f.getRange(n);if(g?.showOptions){const e=l.getDifferences(t);let n=!1;for(let t=0;!n&&t<e.getCount();t++)n=e.at(t).isContentful();if(n){if("Replace"!==await(g?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})))return}}const i=!r.ctrlKey,a=r.shiftKey,s=a?i?"Insert Moved Cells":"Insert Copied Cells":i?"Move Cells":"Copy Cells",d=await(g?.showBusy?.(s));try{const n=f.getRange(t);await l.doBatch(async()=>{a?await l.insertFrom(t,{isCut:i,undoRange:n}):await l.copyFrom(t,{isCut:i,undoRange:n}),n.autoFit({skipCustomSize:!0,orientations:e.IRange.Orientations.Row,minContent:!0}),l.autoFit({skipCustomSize:!0,orientations:e.IRange.Orientations.Row,minContent:!0})},{description:s,autoSelect:!0})}catch(e){g?.showError?.(e)}finally{d?.()}},contentfulCellFinder:j,hiddenRowsAt:P,hiddenColumnsAt:H,mergedRanges:U,getDataCoords:B,canSelectionSpanMergedCells:e=>{const t=f.getRange(e);return t.isEntireColumns()||t.isEntireRows()},onFill:async(t,n)=>{const o="Auto Fill",r=await(g?.showBusy?.(o));try{await f.doBatch(()=>{f.getRange(t).autoFill(n),f.getRange(n).autoFit({orientations:e.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:o,autoSelect:!0})}catch(e){g?.showError?.(e)}finally{I.current=null,r?.()}},onFillPreview:(n,r,l)=>{if(p.current&&q){T.setMode(Re);try{I.current?.direction!==l&&(I.current=null,f.getRange(n).autoFill(r,{previewOnly:e=>{I.current={callback:e,direction:l}}}));const i=I.current?.callback?.(r);if(!i||i.isEmpty())return;const a=i.toText();if(!a)return;const d=o.CoordUtils.cellToRange(i.getCoords()),c=s.getRelativePointFromClient(0,0);let u=0,g=0,h=t.ToolTipPlacement.Bottom;if(l===e.IRange.Direction.Down){u=Z.getColOffset(d.colEnd+1)-c.x;const e=Z.getRowOffset(d.rowEnd),n=Z.getRowOffset(d.rowEnd+1);g=n-(n-e)/2-c.y,h=t.ToolTipPlacement.Right}else if(l===e.IRange.Direction.Right){g=Z.getRowOffset(d.rowEnd+1)-c.y;const e=Z.getColOffset(d.colEnd),n=Z.getColOffset(d.colEnd+1);u=n-(n-e)/2-c.x,h=t.ToolTipPlacement.Bottom}else if(l===e.IRange.Direction.Up){u=Z.getColOffset(d.colEnd+1)-c.x;const e=Z.getRowOffset(d.rowStart),n=Z.getRowOffset(d.rowStart+1);g=n-(n-e)/2-c.y,h=t.ToolTipPlacement.Right}else if(l===e.IRange.Direction.Left){g=Z.getRowOffset(d.rowEnd+1)-c.y;const e=Z.getColOffset(d.colStart),n=Z.getColOffset(d.colStart+1);u=n-(n-e)/2-c.x,h=t.ToolTipPlacement.Bottom}q({anchor:{x:u,y:g},display:a,placement:h})}catch(e){g?.showError?.(e)}}},onFillDone:()=>{I.current=null,T.setMode(null),S?.()}}),ee=t.useCallbackRef(e=>{Q(t.ReactUtils.createSyntheticEvent(e))},[Q,b]);r.useEffect(()=>{const e=s?.getStage();if(e)return e.addEventListener("pointerdown",ee),()=>{e.removeEventListener("pointerdown",ee)}},[s?.getStage()]);const te=t.useImperativeElement(a,()=>({}),[]),ne=r.useRef(null);return n.jsx("div",{className:V(c,"sheet-selection",be),style:{position:"absolute",width:y?.width,height:y?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:x([te,ne]),...w,children:J(s)})})),Me=Object.freeze({x:0,y:0,width:0,height:0}),Te={fireOnModelChange:!1},Ie=r.memo(r.forwardRef((e,t)=>{const{children:l,view:i,movable:a,onRefLoad:s,onRefUnload:d,onHide:c,onShow:u,onUnFocus:g,isDragging:h,updateFrameBounds:m,dragStart:f,style:p,disabled:v,renderMovable:C,...b}=e,[w,y]=r.useState(Me),[q,S]=r.useState(null),[R,k]=r.useState(!1),M=r.useRef(null);r.useLayoutEffect(()=>{if(a.isClosed())return;const e=a.getBounds();if(!e)return;const t=i.toViewBounds(e);y(t??Me),m(t??Me)},[i?.getBounds()]),W(a,{onBoundsChange:e=>{const t=e.getBounds();if(!t)return;const n=i.toViewBounds(t);y(n??Me),m(n)},onSelectionChange:()=>{const e=o.CommonUtils.hasFocus(M.current,!0);!R&&!e||a.isSelected()||g()}}),W(a,{onRequestFocus:()=>o.CommonUtils.whenFocus(M.current,!0)},Te),r.useEffect(()=>{const e=M.current;return s(e),()=>{d(e)}},[]);const T=r.useMemo(()=>{if(!w)return null;let{width:e,height:t}=w;return C({view:i,movable:a,disabled:v,isDragging:h,style:{position:"relative",left:0,top:0,width:e,height:t},onHide:c,onShow:u})},[i,a,w.width,w.height,v,h]);return n.jsx("div",{className:"movable",tabIndex:0,ref:x([M,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:w.x,top:w.y,width:w.width,height:w.height,...p},onMouseDown:async e=>{const t=e.shiftKey||e.ctrlKey,n=a.isSelected(),o=e.currentTarget;t&&n?a.unselect():(n&&!t||await a.select({addToSelection:t}),f(e.nativeEvent,o),o.focus())},onFocus:e=>{e.relatedTarget&&!q&&S(e.relatedTarget),k(!0)},onBlur:e=>{q&&!M?.current?.contains(e.relatedTarget)&&S(null),e.relatedTarget&&k(!1)},...b,children:T})})),Ee="_movable-area_314c6_5",Fe=r.memo(r.forwardRef((l,i)=>{const{view:a,movables:s,movablesView:d,renderMovable:c,transactional:u,onUnFocus:g,onFocus:h,disabled:m=!1,disableDrag:f=!1,disableResize:p=!1,className:v,style:C,renderDirections:b=["nw","n","ne","w","e","sw","s","se"],onFirstRender:w,...y}=l,q=a.getBounds(),S=t.useCallbackRef(w,[w]),R=t.useCallbackRef(g,[g]),k=t.useCallbackRef(h,[h]),[M,T]=r.useState([]),[I,E]=r.useState(!1),[F,A]=r.useState(!1),D=r.useRef(!0),z=r.useRef(new Map),N=r.useRef(new Map),L=r.useRef(new Map),O=r.useRef(new Map),j=r.useRef(new Map),B=r.useRef({onRequestFocus:e=>(oe(e),null)}),P=r.useRef(null),H=r.useRef(null),U=r.useRef(null),[K,$]=r.useReducer(e=>e+1,0);r.useLayoutEffect(()=>{$()},[a,s]),W(s,{onCollectionChange:()=>{const e=s.search({address:a.getVisibleRangeCoords(),excludeHidden:!0}),t=j.current;t.forEach(e=>{e()}),t.clear();const n=B.current;for(let o=0;o<e.length;o++){const r=e[o];if(r.isClosed())continue;const l=r.addListeners(n);t.set(r,l)}$()},onInvalidated:()=>{$()}}),W(d,{onMovableSelectionChange(e){_(),$()}});const G=r.useCallback((e,t)=>{const n=L.current.get(e);U.current&&(U.current.getTargets().forEach(e=>{if(e===n)return e.style.left=t.x+"px",e.style.top=t.y+"px",e.style.width=t.width+"px",void(e.style.height=t.height+"px")}),U.current.updateRect())},[]),_=()=>{const e=[],t=d.getMovableSelection();t.forEach(n=>{const o=L.current.get(n);if(!o)return;-1!==t.indexOf(n)&&e.push(o)}),T(t=>o.CommonUtils.isEqualArrays(t,e)?t:e)},Z=r.useRef(null),X=r.useMemo(()=>new Promise(e=>{Z.current=e}),[]),Y=r.useRef(null),J=t.useCallbackRef(async(e,t)=>{Y.current=t;await(async()=>!(!await X.then()||!U.current))()&&Y.current===t&&U.current.dragStart(e,t)},[M]),[Q,ee]=r.useState(!1),te=r.useRef(null),ne=r.useRef(null),oe=t.useCallbackRef(async(e=null)=>{if(e||(e=d.getMovableSelection()[0]),!e)return R?.(),!1;const t=L.current.get(e);t?(await o.CommonUtils.whenFocus(t),t.focus(),ne.current=t,te.current=null):te.current=e},[d]);r.useEffect(()=>{Q&&M.length>0&&ne.current!==M[0]&&oe(),D.current&&(S?.(),D.current=!1)},[M]);const re=r.useMemo(()=>{const e=s.search({address:a.getVisibleRangeCoords(),excludeHidden:!0});if(0===e.length&&0===z.current.size)return null;const t=(t,r,l,i=!0)=>{const s=t.isSelected(),d={tabIndex:l,view:a,movable:t,onRefLoad:e=>{te.current===t&&(e.focus(),ne.current=e,te.current=null),L.current.set(t,e),N.current.set(e,t),r.rendered=!0,_()},onRefUnload:e=>{L.current.delete(t),N.current.delete(e),r.rendered=!1,_()},onUnFocus:R,onHide:e=>{r.onHide=e},onShow:e=>{r.onShow=e},isDragging:s&&(F||I),disabled:m,renderMovable:c,updateFrameBounds:e=>{G(t,e)},dragStart:J,onMouseUp:()=>{if(Y.current=null,H.current){E(!1),A(!1);let e=!1;O.current?.forEach(t=>{o.CommonUtils.isEqualBounds(t.movable.getBounds(),t.startBounds)||(e=!0)}),e?ie():ae()}},style:{opacity:i?I&&s?.7:void 0:0,zIndex:I&&s?t.getZIndex()+e.length:void 0,pointerEvents:i?void 0:"none",cursor:F&&s?"grabbing":m||f?"initial":"move",boxShadow:!s||F&&!I?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return n.jsx(Ie,{...d},`movable-${t.getUUID()}`)},r=z.current,l=new Map,i=[];for(let n=0;n<e.length;n++){const o=e[n];if(o.isClosed())continue;let a=r.get(o);a||(a={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(e,t)=>{if(!t||!0===t.shown)return;t.shown=!0;const n=++t.visibilityRequestId;requestAnimationFrame(()=>{const o=z.current.get(e);o&&n===t.visibilityRequestId&&(t.onShow?.(e),o.shown=!0)})},doHide:async(e,t)=>{if(!t||!1===t?.shown)return;t.shown=!1;const n=++t.visibilityRequestId,o=await Promise.resolve(t.onHide?.(e));n===t.visibilityRequestId&&!1!==o&&(t.shown=!1,z.current.delete(e),$())},visibilityRequestId:0}),a.frame=t(o,a,n,!0),i.push(a.frame),a.doShow(o,a),r.delete(o),l.set(o,a)}const u=[];return d.getMovableSelection().forEach(e=>{const n=r.get(e);n&&(n.frame=t(e,n,-1,!1),u.push(n.frame),r.delete(e),l.set(e,n))}),r.forEach((e,n)=>{e.frame=t(n,e,-1,!1),u.push(e.frame),e.doHide(n,e),r.delete(n),l.set(n,e)}),z.current=l,_(),[...u,...i]},[K,a,c,m,f,p,I,F]),le=t.useCallbackRef((t,n)=>{const o=`${n} ${1===M.length?e.TextUtils.capitalize(N.current?.get(M[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${o}`),H.current.rollback(),H.current=null),H.current=u.beginCommit({description:o}),O.current.clear();for(let e=0;e<M.length;e++){const t=M[e],n=N.current?.get(t);n?O.current.set(t,{movable:n,startBounds:a.toViewBounds(n.getBounds())}):console.warn("invalid element",n)}},[u,a,M]),ie=r.useCallback(()=>{if(!H.current)return;const e=[];O.current?.forEach(t=>{e.push(t.movable)}),H.current.commit({viewAfter:{view:d,movableSelection:e}}),O.current.clear(),H.current=null},[]),ae=r.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),se=r.useRef(null);r.useEffect(()=>{se.current&&(se.current.onscroll=e=>{e.preventDefault(),e.srcElement.scrollTop=0,e.srcElement.scrollLeft=0})},[se.current]);const de=t.useImperativeElement(i,()=>({isMovableArea:()=>!0,focusMovable:oe,focus:()=>{oe()}}),[d]),[ce,ue]=r.useState(null),ge=r.useRef(!1),he=r.useRef(!1),me=r.useRef(!1);r.useEffect(()=>{if(m||0===M.length)return;if(me.current)return;if(ge.current)return;if(he.current)return void requestAnimationFrame(()=>{U.current&&P.current&&U.current.refTargets.length>0&&(me.current=!0,Z.current?.(!0)),T([...M])});ge.current=!0;const e=r.lazy(async()=>{try{const e=await Promise.resolve().then(()=>require("./Cy9Ib1lJhSZ_F6tM.cjs"));return ge.current=!1,he.current=!0,T([...M]),e}catch(e){return console.warn(e),Z.current?.(!1),null}});ue(e)},[M,m,f,p]);const fe=r.useMemo(()=>!ce||m?null:n.jsx(r.Suspense,{children:n.jsx(ce,{className:V({dragging:I||F,resizing:I,moving:F}),container:null,ref:U,target:U.current?M:[],draggable:!m&&!f,resizable:!m&&!p,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:b,onResizeStart:e=>{le(e.target,"Resize")},onResize:e=>{if(!H.current)return e.stopDrag(),void $();E(!0);const t=0!==e.direction[0]&&0!==e.direction[1];let n=0,o=0;for(let r=0;r<M.length;r++){const l=M[r],i=O.current.get(l),s=N.current.get(l);if(!i||!s){console.warn("invalid element");continue}let d=e.dist[0],c=e.dist[1],u=e.drag.dist[0],g=e.drag.dist[1],h=i.startBounds.width,m=i.startBounds.height;0===r?(n=h,o=m):(d*=h/n,u*=h/n,c*=m/o,g*=m/o);const f={...i.startBounds};if(f.width=Math.max(0,h+d),f.height=Math.max(0,m+c),-1===e.direction[0]&&(f.width=Math.max(0,Math.min(i.startBounds.x+h,h-u))),-1===e.direction[1]&&(f.height=Math.max(0,Math.min(i.startBounds.y+m,m-g))),t&&(s.isLockAspectRatio()||e.inputEvent?.shiftKey)){const e=h/m,t=f.width/f.height;t>e?f.height=f.width/e:t<e&&(f.width=f.height*e)}-1===e.direction[0]&&(f.x=Math.max(0,Math.min(i.startBounds.x+h,i.startBounds.x+h-f.width))),-1===e.direction[1]&&(f.y=Math.min(i.startBounds.y+m,i.startBounds.y+m-f.height)),i.movable.setBounds(a.toAbsoluteBounds(f))}},onResizeEnd:e=>{E(!1),ie()},onDragStart:e=>{le(e.target,"Move")},onDrag:e=>{if(!H.current)return e.stopDrag(),void $();A(!0);for(let t=0;t<M.length;t++){const n=M[t],o=O.current.get(n);o?o.movable.setBounds(a.toAbsoluteBounds({...o.startBounds,x:o.startBounds.x+e.translate[0],y:o.startBounds.y+e.translate[1]})):console.warn("invalid element")}},onDragEnd:e=>{},onMouseUp:e=>{}})}),[K,ce,M,a,m,f,p,I,F]);return n.jsx("div",{className:V(v,"movable-area",Ee),style:{width:q.width,height:q.height,...C,position:"absolute",overflow:"hidden",willChange:"transform"},ref:x([de,se]),...y,children:n.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:q.width,height:q.height},...y,children:n.jsxs("div",{ref:P,style:{position:"absolute",pointerEvents:"auto"},onFocus:e=>{k?.(),ee(!0)},onBlur:e=>{ee(!1)},onKeyDownCapture:e=>{if(e.isDefaultPrevented())return;const n=e.nativeEvent.ctrlKey,o=e.nativeEvent.altKey,r=e.nativeEvent.shiftKey;if(e.which===t.KeyCodes.Escape){const t=d.getMovableSelection();let n=[...t];return M.forEach(e=>{if(0===n.length)return;const t=N.current.get(e);let o=n.indexOf(t);n.splice(o,1)}),n.length!==t.length&&d.selectMovables(n),0===n.length&&R?.(),void e.preventDefault()}const l=.1,i=e=>{s.updateSelected(t=>{t.setRotation(t.getRotation()+e)},"Rotate")},a=(e,t=!0)=>{s.updateSelected(n=>{const o=n.getBounds();let r=1+e;t||(r=1/r);const l=Math.sqrt(Math.pow(o.width,2)+Math.pow(o.height,2)),i=Math.atan2(o.height,o.width),a=r*l;if(a<10)return;const s=a*Math.cos(i),d=a*Math.sin(i),c={x:o.x+(o.width-s)/2,y:o.y+(o.height-d)/2,width:s,height:d};n.setBounds(c)},"Resize")},c=e=>{s.updateSelected(t=>{const n=t.getBounds(),o={x:n.x+(e.x??0),y:n.y+(e.y??0),width:n.width+(e.width??0),height:n.height+(e.height??0)};t.setBounds(o)},"Nudge")};if(e.which===t.KeyCodes.Delete)s.updateSelected(e=>{e.delete()},"Delete"),e.preventDefault();else if("a"===e.key&&n){const t=d.getMovableSelection();d.selectMovables(s.search(),!0),d.selectMovables(t,!0),e.preventDefault()}else"ArrowLeft"===e.key?(r?a(l,!1):o?i(-10):c({x:n?-10:-1}),e.preventDefault()):"ArrowRight"===e.key?(r?a(l,!0):o?i(10):c({x:n?10:1}),e.preventDefault()):"ArrowUp"===e.key?(r?a(l,!0):c({y:n?-10:-1}),e.preventDefault()):"ArrowDown"===e.key&&(r?a(l,!1):c({y:n?10:1}),e.preventDefault())},children:[re,fe]})})})})),Ae=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let l=0;l<e.length;l++){const i=e[l].getBounds();t=Math.min(i.x,t),n=Math.min(i.y,n),o=Math.max(i.x+i.width,o),r=Math.max(i.y+i.height,r)}return{x:t,y:n,width:o-t,height:r-n}},De=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",l=t?"width":"height";let i=0,a=Number.MAX_SAFE_INTEGER,s=0;for(let t=0;t<e.length;t++){const r=e[t],d=r.getBounds();i+=d[l],a=Math.min(d[o],a),s=Math.max(d[o]+d[l],s),n.push({bounds:d,movable:r})}const d=(s-a-i)/(e.length-1);n.sort((e,t)=>{const n=e.bounds[o],l=t.bounds[o];return n!==l?n-l:e.bounds[r]-t.bounds[r]});const c=new Map;c.set(n[0].movable,n[0].bounds);for(let e=1;e<n.length-1;e++){const t=n[e-1].bounds,r={...n[e].bounds};r[o]=t[o]+t[l]+d,n[e].bounds=r,c.set(n[e].movable,r)}return c.set(n[n.length-1].movable,n[n.length-1].bounds),c};function ze(n){const{movables:o,movablesView:l,transactional:i,commands:a,target:s,onRepeatCommandChange:d,notifier:c}=n,u=t.useEditMode();r.useRef(u.getMode()).current=u.getMode();const g=t.useCallbackRef(async(e,n,o=null,r=!0)=>{const l=async()=>{const i=await Promise.resolve(c?.showBusy?.(e.label()));try{await n();const a=o??e?.label?.();if(d){let n=null;e&&!1!==a&&(n=new t.SimpleCommand(e.key(),s,{label:a,description:a},l)),d(n)}i?.(),r&&u.setMode(null)}catch(e){i?.(),c?.showError?.(e)}};await l()},[d,c]),[h,m]=r.useReducer(e=>e+1,0),f=t.useCallbackRef((t,n,o)=>{if(!l)return;const r=l.getMovableSelection();if(0===r.length)return;let a="Drawings";if(1===r.length){const t=r[0];a=e.TextUtils.capitalize(t.getContent().getType())??"Drawing"}const s=`${t.label()} ${a}`;g(t,()=>{let e=null;i&&(e=i.beginCommit(s));const t=l.getMovableSelection();if(0===t.length)return;const r=o?.(t);for(let e=0;e<t.length;e++){const o=t[e];n(o,r)}e?.commit()})},[l,i]),[p,v]=r.useState(l.getMovableSelection()[0]??null),[C,b]=r.useState(!p||p?.isProtected()),w=r.useMemo(()=>[new t.Command("moveToFront",s,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){f(this,e=>{e.moveToFront()})}),new t.Command("moveForward",s,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[t.KeyModifiers.Ctrl]}},function(){f(this,e=>{e.moveForward()})}),new t.Command("moveToBack",s,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){f(this,e=>{e.moveToBack()})}),new t.Command("moveBackward",s,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[t.KeyModifiers.Ctrl]}},function(){f(this,e=>{e.moveBackward()})}),new t.Command("toggleLockAspectRatio",s,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){f(this,e=>{e.setLockAspectRatio(!e.isLockAspectRatio())})}),new t.Command("formatAnchorTypeTwoCell",s,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){f(this,t=>{t.setAnchorType(e.IAnchored.Type.TwoCell)})}),new t.Command("formatAnchorTypeOneCell",s,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){f(this,t=>{t.setAnchorType(e.IAnchored.Type.OneCell)})}),new t.Command("formatAnchorTypeAbsolute",s,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){f(this,t=>{t.setAnchorType(e.IAnchored.Type.Absolute)})}),new t.Command("formatDrawAlignLeft",s,{label:"Align Left",description:"Align the selected drawings to the left."},function(){f(this,(e,t)=>{e.setBounds({x:t.x})},Ae)}),new t.Command("formatDrawAlignCenter",s,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){f(this,(e,t)=>{e.setBounds({x:(t.width-e.getBounds().width)/2+t.x})},Ae)}),new t.Command("formatDrawAlignRight",s,{label:"Align Right",description:"Align the selected drawings to the right."},function(){f(this,(e,t)=>{e.setBounds({x:t.width-e.getBounds().width+t.x})},Ae)}),new t.Command("formatDrawAlignTop",s,{label:"Align Top",description:"Align the selected drawings to the top."},function(){f(this,(e,t)=>{e.setBounds({y:t.y})},Ae)}),new t.Command("formatDrawAlignMiddle",s,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){f(this,(e,t)=>{e.setBounds({y:(t.height-e.getBounds().height)/2+t.y})},Ae)}),new t.Command("formatDrawAlignBottom",s,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){f(this,(e,t)=>{e.setBounds({y:t.height-e.getBounds().height+t.y})},Ae)}),new t.Command("formatDrawDistributeHorz",s,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){f(this,(e,t)=>{e.setBounds(t.get(e))},e=>De(e))}),new t.Command("formatDrawDistributeVert",s,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){f(this,(e,t)=>{e.setBounds(t.get(e))},e=>De(e,!1))}),new t.Command("formatDrawFlipHorz",s,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new t.Command("formatDrawFlipVert",s,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new t.Command("formatDrawGroup",s,{label:"Group",description:"Group the selected drawings into a single drawing."}),new t.Command("formatDrawUngroup",s,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new t.Command("formatDrawSwapShapes",s,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new t.Command("formatDrawSwapShapesHorz",s,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new t.Command("formatDrawSwapShapesVert",s,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[l,p]);r.useEffect(()=>{},[u]);const y=r.useMemo(()=>{let e=null;return e=a?a.createChildGroup(s,"movable",!1):new t.CommandGroup(s,"movable"),e.addCommands(w,!0),e},[a,w]);return W(p,{onAnyChange:()=>{y.getCommand("formatAnchorTypeTwoCell").update({state:p?.getAnchorType()===e.IAnchored.Type.TwoCell}),y.getCommand("formatAnchorTypeOneCell").update({state:p?.getAnchorType()===e.IAnchored.Type.OneCell}),y.getCommand("formatAnchorTypeAbsolute").update({state:p?.getAnchorType()===e.IAnchored.Type.Absolute}),y.getCommand("formatAnchorTypeAbsolute").update({state:p?.getAnchorType()===e.IAnchored.Type.Absolute}),y.getCommand("toggleLockAspectRatio").update({state:p?.isLockAspectRatio()})},onProtectedChange:e=>{b(e.isProtected())},onDelete:()=>{}}),W(l,{onMovableSelectionChange:()=>{const e=l.getMovableSelection()[0]??null;v(e),b(!e||e.isProtected()),m()}}),W(o,{onCollectionChange:()=>{m()}}),r.useEffect(()=>{const e={disabled:C};y.getCommand("formatAnchorTypeTwoCell").update(e),y.getCommand("formatAnchorTypeOneCell").update(e),y.getCommand("formatAnchorTypeAbsolute").update(e),y.getCommand("toggleLockAspectRatio").update(e);const t=o.getCount(),n=l.getMovableSelection(),r=C||t<=1||0===n.length;let i={disabled:r},a=i;if(!r&&1===n.length){const e=n[0];0===e.getZIndex()&&(i={disabled:!0}),e.getZIndex()===t-1&&(a={disabled:!0})}y.getCommand("moveToFront").update(a),y.getCommand("moveForward").update(a),y.getCommand("moveToBack").update(i),y.getCommand("moveBackward").update(i);const s={disabled:C||n.length<=1};y.getCommand("formatDrawAlignLeft").update(s),y.getCommand("formatDrawAlignCenter").update(s),y.getCommand("formatDrawAlignRight").update(s),y.getCommand("formatDrawAlignTop").update(s),y.getCommand("formatDrawAlignMiddle").update(s),y.getCommand("formatDrawAlignBottom").update(s),y.getCommand("formatDrawFlipHorz").update(s),y.getCommand("formatDrawFlipVert").update(s),y.getCommand("formatDrawGroup").update(s),y.getCommand("formatDrawUngroup").update(s),y.getCommand("formatDrawSwapShapes").update(s),y.getCommand("formatDrawSwapShapesHorz").update(s),y.getCommand("formatDrawSwapShapesVert").update(s);const d={disabled:C||n.length<=2};y.getCommand("formatDrawDistributeHorz").update(d),y.getCommand("formatDrawDistributeVert").update(d)},[h,C,h]),y}const Ne=r.memo(r.forwardRef((e,o)=>{const{children:l,disabled:i,description:a,view:s,isDragging:d,onHide:c,onShow:u,...g}=e;r.useEffect(()=>{},[a]);const h=t.useImperativeElement(o,()=>({isEmptyFrame:()=>!0}),[]),[m,{height:f,width:p}]=T();return n.jsx("div",{...g,ref:x([h,m]),children:n.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:s.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:n.jsx("div",{style:{textAlign:"center"},children:a})})})})),Le=r.memo(r.forwardRef((e,t)=>{const{view:o,sheet:l,movableProps:i,renderMovable:a,commands:s,target:d,notifier:c,onRepeatCommandChange:u}=e,g=ze({movables:l.getMovables(),movablesView:l?.getView(),transactional:l,onRepeatCommandChange:u,commands:s,target:d,notifier:c});r.useEffect(()=>{o?.getStage()},[o?.getStage()]);const h=r.useMemo(()=>n.jsx(Fe,{ref:t,view:o,movables:l.getMovables(),disableResize:!l.getProtection().isObjectsAllowed(),disableDrag:!l.getProtection().isObjectsAllowed(),movablesView:l.getView(),transactional:l,renderMovable:a,...i,onFocus:()=>{g.activate(),i?.onFocus?.()}},"movable-area"),[l,i,s,g]);return h&&o?h:null})),Oe=r.memo(r.forwardRef((i,a)=>{const{view:s,sheet:d,gridStyle:c,getCellEditor:u,showProtectedError:g,setEditingCoords:h,commands:m,notifier:f=t.DefaultNotifier}=i,p=t.useEditMode(),[v,w]=r.useState(null),[y,x]=r.useState(null),[q,S]=r.useState(null),[R,k]=r.useState(null),[M,T]=r.useState(null);r.useLayoutEffect(()=>{if(null===q)return k(null),void T(null);const e=()=>{const e=d.getRange(q).getCell(),n=e.getStyle();let o,r=n.getFill()?.toCSS(c.body.darkMode);"none"!==r.background&&"transparent"!==r.background||(r=d.getStyles().getNormal().getFill().toCSS(c.body.darkMode)),"none"!==r.background&&"transparent"!==r.background||(r={background:c.body.fill}),k({style:r}),e&&!e.getFormula()&&(o=e?.getRenderHorizontalAlignment()),T(o??t.HorizontalAlignment.Left)};return e(),d.getRange(q).addListener(()=>{e()})},[d,q,c?.body]);const I=t.useCallbackRef(()=>{let t=y.editState.dirty??"";if(void 0!==y.editState.dirty){const n=e.TextUtils.clampString(t);try{const e=y.sheet.getRange(y.coords),o=`Typing '${n}' into ${e.toString()}`;return e.setValue(t,{description:o,autoFit:!0}),S(null),x(null),p.setMode(null),h(null),!0}catch(e){throw f.showError(new Error(`Unable to enter '${n}'.`,{cause:e})),e}}},[d,y,f]),E=t.useCallbackRef(e=>d.getRange(e).getCell().getExtrusions()??o.CoordUtils.cellToRange(e),[d]),F=t.useCallbackRef(t=>{let n=e.IRange.Orientation.Row,o=!1;t!==e.IRange.Direction.Up&&t!==e.IRange.Direction.Down||(n=e.IRange.Orientation.Column),t!==e.IRange.Direction.Left&&t!==e.IRange.Direction.Up||(o=!0),d.getSelection().traverse(n,o)},[d]),A=r.useCallback((e,t)=>{if(u)return u(e,t);if(!d)return null;const{ref:o,...r}=e;return n.jsx(C,{ref:o,...r,sheet:d,bodyStyle:c?.body,activeCoords:t,commands:m,onChangeEdit:e=>{const n={sheet:d,coords:t,editState:e};p.setMode(e=>({...e,description:n.editState.editMode?"Edit":"Enter",args:{...e?.args,stateAndCoords:n}}))},editState:y.editState})},[d,R,u,y,q]),{overlay:D,startEdit:z,submitEdit:N,cancelEdit:L,onKeyboardEventNative:O,onPointerEventNative:j}=l.useKeyboardEditorOverlay({view:s,activeCoords:v,getCellEditor:A,canEdit:()=>{const e=d.getProtection();if(e.isReadOnly())return!1;const t=e.isLocked();return t&&g(),!t},onBeforeStartEdit:e=>{const t=b(()=>d.getRange(e).getCell()),n={sheet:d,coords:e,editState:Object.freeze(t)};p.setMode({key:"edit",args:{stateAndCoords:n}}),x(n)},onStartEdit:e=>{S(e),h(e)},onSubmitEdit:I,onCancelEdit:e=>{S(null),x(null),p.setMode(null),h(null)},onDoneEdit:e=>{p.setMode(null)},onNavigate:F,containerProps:R,borderStrokeFill:c.selection?.strokeFill,borderStrokeWidth:d?.getSelection().getCoords().ranges?.length>1?1:2,alignment:M,getRangeCoords:E});W(d.getSelection(),{onChange(e){w(d.getSelection().getCoords().cell)}});const B=t.useCallbackRef(e=>{j(e),q&&N()},[j,L,q]),V=r.useCallback(e=>{j(e)},[j]),P=r.useCallback(e=>{O(e)},[O]);return r.useEffect(()=>{const e=s?.getStage();if(e)return e.addEventListener("pointerdown",B),e.addEventListener("dblclick",V),e.addEventListener("keydown",P),()=>{e.removeEventListener("pointerdown",B),e.removeEventListener("dblclick",V),e.removeEventListener("keydown",P)}},[s?.getStage()]),r.useEffect(()=>{const e=p.getMode(),t=e?.key;"edit"===t||"enter"===t?y?e.args?.cancel?L():e.args?.submit?N():x(e.args?.stateAndCoords):z(e.args?.start):q&&L()},[p]),D(s,a)})),je="white",Be="black",Ve=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Be}' fill='${je}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,Pe=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Be}' fill='${je}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,He=r.memo(r.forwardRef((i,a)=>{const{view:s,sheet:d}=i,[c,u]=r.useState(d.getTables().getCount()>0),[g,h]=r.useState(null),[m,f]=r.useState(null),[p,v]=r.useState(null),[C,b]=r.useState(null),w=t.useCallbackRef(()=>{if(d.getTables().getCount()>0){u(!0);const e=d.getTables().search({address:s.getVisibleRangeCoords()});h(e.length>0?e:null)}else u(!1),h(null)},[d,s]),y=t.useCallbackRef(e=>{e.preventDefault(),e.stopPropagation();const t=s.getCellCoordsFromClient(e.clientX,e.clientY),n=d.getTables().search({address:t});if(1===n.length){n[0].select()}},[s,d]),x=t.useCallbackRef(e=>{e.preventDefault(),e.stopPropagation();const t=s.getCellCoordsFromClient(e.clientX,e.clientY),n=d.getTables().search({address:t});if(1===n.length){const e=n[0].getRange().getCoords(),o={colStart:e.colStart,rowStart:t.rowIndex,colEnd:e.colEnd,rowEnd:t.rowIndex};d.getRange(o).select()}},[s,d]),q=t.useCallbackRef(()=>{if(!c)return;const e=d.getTables().search({address:s.getVisibleRangeCoords()});h(e.length>0?e:null)},[d,c,s]);W(d?.getSelection(),{onChange(e){f(d.getSelection().getCoords().cell)}}),W(p,{onAnyChange(e){w(),q()}}),W(C,{onAnyChange(e){q()}}),W(d,{onTablesChange(e){w(),q()},onInvalidated(e){w(),q()}});const S=r.useMemo(()=>o.CommonUtils.debounce(o.CommonUtils.throttle(q,300),300),[]);r.useEffect(()=>{S()},[s]),r.useEffect(()=>{let t=null;if(g)for(let n=0;n<g.length&&!t;n++){const o=g[n],r=o.getRange().getCoords();e.CoordUtils.isCellWithinRange(m,r)&&(t=o)}v(t)},[m,g]);const R=t.useCallbackRef(e=>{let t=null;if(g)for(let n=0;n<g.length;n++){const o=g[n],r=o.getRange().getCoords();let l=s.getRangeCoordsBounds(r);const i=s.getRelativePointFromClient(e.clientX,e.clientY),a=i.x,d=i.y;if(a>=l.x&&a<=l.x+l.width&&d>=l.y&&d<=l.y+l.height){const e=s.getViewportSize();a<=0||d<=0||a>=e.width||d>=e.height||(t=o)}}b(t)},[s,g]);if(r.useEffect(()=>{const e=s?.getStage();if(e&&g)return e.addEventListener("mousemove",R),e.addEventListener("mouseleave",R),()=>{e.removeEventListener("mousemove",R),e.removeEventListener("mouseleave",R)}},[g,s?.getStage()]),!s)return null;if(!g||0===g.length)return null;const k=[];for(let e=0;e<g.length;e++){const t=g[e];if(t.isClosed())continue;const o=t===C,r=t===p,i=t.getRange().getCoords(),a=s.getRangeCoordsBounds(i);let c;if(o||r){const e=t.getStyle().getProperties(),n=e.headerRow?.fill?.background??e.wholeTable?.border?.top?.color?.toString();if(n&&d){const e=d.getStyles().parseColor(n);e&&(c=e.toCSS())}c||(c="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}k.push(n.jsx("div",{style:{position:"absolute",left:a.x,top:a.y,width:Math.min(16,a.width),height:a.height,pointerEvents:"all",cursor:Ve},onMouseDown:x},`table-select-row-${t.getName()}`)),k.push(n.jsx("div",{style:{position:"absolute",left:a.x,top:a.y,width:Math.min(16,a.width),height:Math.min(16,a.height),pointerEvents:"all",cursor:Pe},onMouseDown:y},`table-select-${t.getName()}`)),k.push(n.jsx(l.Selection,{x:a.x,y:a.y,width:a.width,height:a.height,range:i,strokeWidth:r?.5:0,stroke:c??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:o?`${c} 0px 0px 1px 1px`:void 0}},`table-outline-${t.getName()}`))}return k})),Ue=r.memo(r.forwardRef((i,a)=>{const{view:s,sheet:d,animationTime:c=60}=i,[u,g]=r.useState(null),[h,m]=r.useState(null),f=r.useRef(null),p=t.useCallbackRef(()=>{const e=d.getSelectedCell(),t=e.getSpill()?.getCoords()??null;o.CoordUtils.isEqualRanges(t,u)||(m(t?{transition:u?"move":"in",bounds:s.getRangeCoordsBounds(t),coords:t}:{transition:"out",bounds:s.getRangeCoordsBounds(u),coords:u}),g(t))},[d,s,u]);r.useEffect(()=>(f.current&&(clearTimeout(f.current),f.current=null),h&&(f.current=setTimeout(()=>{m(null),f.current=null},c)),()=>{f.current&&(clearTimeout(f.current),f.current=null)}),[h,c]);const v=r.useMemo(()=>o.CommonUtils.debounce(o.CommonUtils.throttle(p,80),80),[]);if(W(d?.getSelection(),{onChange(e){v()}}),W(d,{onSpillsChange(e){p()},onInvalidated(e){p()}}),!s)return null;if(!u&&!h)return null;const C=d.getRange(u).getValue()instanceof e.FormulaError.Spill,b=[];let w=h?.bounds??s.getRangeCoordsBounds(u);if(h&&!o.CommonUtils.isEqualBounds(h.bounds,s.getRangeCoordsBounds(h.coords))&&m(null),w=s.toClipBounds(w,-10),!w)return;const y="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return b.push(n.jsx(l.Selection,{x:w.x,y:w.y,width:w.width,height:w.height,range:u,strokeWidth:1,stroke:y,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:C?"6 3":void 0,opacity:"out"===h?.transition?0:1,transition:h?.transition?"in"===h.transition||"out"===h.transition?`opacity ${1.5*c}ms ease-in-out`:`left ${c}ms ease-out, top ${c}ms ease-out, width ${c}ms ease-out, height ${c}ms ease-out`:"none",boxShadow:`${y} 0px 0px 4px 0px`}},"spill-outline}")),b})),Ke={position:"absolute",top:0,left:0,bottom:0,right:0},We=(e,t)=>{const n={...e},r=t?.getNormal().getFont(),l=r?.toCSS(),i={text:{fontFamily:l?.fontFamily,fontSize:r?.getSize()}},a=n.body=o.CommonUtils.mergeContentful(e.body,i);return n.body=o.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},a),n.buttonSurface=o.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=o.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=o.CommonUtils.mergeContentful(n.header,i),n.headerSelect=o.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=o.CommonUtils.mergeContentful(n.headerSelect,i),n.headerSelectAll=o.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=o.CommonUtils.mergeContentful(n.headerSelectAll,i),n},$e={fireOnModelChange:!1},Ge={},_e=r.memo(r.forwardRef((i,a)=>{const{sheet:s,gridStyle:d=Ge,headersStyle:c=Ge,onSheetContextMenu:u,showColumnHeaders:g,columnHeaderProps:h,showRowHeaders:f,rowHeaderProps:p,showScrollbars:v=!0,scrollPaneProps:C,onViewportChange:b,commands:w,onRepeatCommandChange:y,onMoveCell:x,overlays:q,renderMovable:S,viewportComponent:R,onElementLoad:k,getCellEditor:M,onFocus:I,onBlur:E,style:F=t.ReactUtils.EmptyCssProperties,notifier:A,onShowTooltip:D,onShowColumnTooltip:z,onShowRowTooltip:N,onCloseTooltip:L,gridProps:O,cellRenderProps:j,...B}=i;if(r.useEffect(()=>{e.LicenseManager._validate(!0)},[]),!s)throw new Error("ISheet must be provided.");const[U,$]=r.useReducer(e=>e+1,0),[_,{width:Z,height:X}]=T(),Y=t.useCallbackRef(D,[D]),J=t.useCallbackRef(z,[z]),Q=t.useCallbackRef(N,[N]),ee=t.useCallbackRef(L,[L]),te=r.useRef(!1);r.useLayoutEffect(()=>{te.current=!0},[s]);const ne=s?.getStyles(),oe=r.useMemo(()=>We(d,ne),[d,ne]),re=r.useMemo(()=>We(c,ne),[c,ne]),{body:le={},buttonSurface:ae={}}=oe,{header:ce={},headerSelect:ue={},headerSelectAll:ge={}}=re,he=r.useRef(null),[me,fe]=r.useState(()=>s?.getView()),pe=(me?.getZoomScale()??100)/100,ve=r.useMemo(()=>({vertical:me.isShowColumnGridlines()&&pe>=.4,horizontal:me.isShowRowGridlines()&&pe>=.4}),[me?.isShowColumnGridlines(),me?.isShowRowGridlines(),pe]),be=r.useMemo(()=>{if(me?.getGridLineColor())return{strokeDasharray:"1,1"}},[me?.getGridLineColor(),oe]),we=g??me?.isShowColumnHeaders(),ye=f??me?.isShowRowHeaders(),[xe,qe]=r.useState({width:0,height:0}),Se=r.useMemo(()=>{let t=40,n=20;const o=s?.getStyles().getNormal().getFont();if(xe.width>0&&xe.height>0){const r=o?.toCSS()?.fontFamily??oe.header.text.fontFamily,l=o?.getSize()??oe.header.text.fontSize,i=e.IFont.getSharedMeasurer()(""+xe.height,Math.ceil(l*e.IFont.getDeviceScale()),r);t=i.width,n=i.lineHeight}return{width:Math.round(t+5),height:Math.round(n+3)}},[xe,oe?.header.text,s]),Re=ye?pe*Se.width:ce.edgeStrokeWidth,Me=we?pe*Se.height:ce.edgeStrokeWidth,Te=Math.max(Z,(s?.getColumnHeaders().getDefaultSize()??Se.width)+Re+1),Ie=Math.max(X,(s?.getRowHeaders().getDefaultSize()??Se.height)+Me+1),Ee=r.useRef(new Map),Fe=r.useRef(null),Ae=()=>({getColOffset:e=>s.getColumnHeaders().findOffset(e),getColIndex:e=>s.getColumnHeaders().findIndex(e),getRowOffset:e=>s.getRowHeaders().findOffset(e),getRowIndex:e=>s.getRowHeaders().findIndex(e)}),[De,ze]=r.useState(()=>Ae()),[Ne,je]=r.useState(!1),[Be,Ve]=r.useState(null),Pe=!0,_e=oe.selection?.strokeFill,Ze=r.useCallback(()=>Dt.current,[]),[Xe,Ye]=r.useState(),Je=t.useCallbackRef(e=>{Ye(e),s&&s.getView()&&s.getView().setTopLeft(e?{left:e.left,top:e.top}:null),b?.(e)},[s,b]),Qe=r.useRef(null);r.useEffect(()=>{if(!Xe||!s)return;const e=s.getRangeAtBounds({x:Xe.left,y:Xe.top,width:Xe.width,height:Xe.height});Qe.current?.(),Qe.current=e.addListener(()=>{const t=e.getCoords();he?.current?.invalidate(t)})},[Xe,s]);const[et,tt]=r.useState(()=>s?.getView().getTopLeft()),nt=t.useCallbackRef(e=>{const t=o.CoordUtils.cellToRange(e);if(s.isClosed())return t;const n=s.getRange(t,{excludeHidden:!0}).getMerges();return 0===n.length?t:n[0]},[s]),ot=e=>{if(!e||0===e.coords.colIndex&&0===e.coords.rowIndex)return null;const t={};return e.coords.colIndex>0&&(t[o.AnchorLocation.Left]={index:e.coords.colIndex,scrollOffset:e.topLeft.left}),e.coords.rowIndex>0&&(t[o.AnchorLocation.Top]={index:e.coords.rowIndex,scrollOffset:e.topLeft.top}),t},[rt,lt]=r.useState(()=>ot(s.getView().getFreezePanes())),it=t.useEditMode(),at=r.useCallback(()=>he.current,[]),st=t.useCallbackRef(e=>{it.setMode(t=>"edit"===t?.key?{...t,args:{...t.args}}:{key:"edit",args:{stateAndCoords:null,start:e}})},[]),dt=t.useCallbackRef(()=>Xe,[Xe]),ct=G({sheet:s,commands:w,target:at,onRepeatCommandChange:y,bodyStyle:le,notifier:A,onStartEdit:st,getViewport:dt}),[ut,gt]=r.useState(s.getSelection().isEntire()),[ht,mt]=r.useState(me?.getMovableSelection().length>0),ft=null!==Be||ht,pt=null,[vt,Ct]=r.useState(!1);r.useEffect(()=>{Ct(!1)},[s.getProtection()]);const bt=t.useCallbackRef(()=>{vt||(Ct(!0),A.showMessage?.(n.jsxs("span",{children:["This sheet is protected.",n.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:t.NotificationType.Error}))},[A,vt]),wt=r.useMemo(()=>{const e=it.getMode();return e?.cursor?e.cursor:null},[pt,it]),[yt,xt]=r.useState(null),qt=r.useRef(!1),[St,Rt]=r.useState([]),kt=r.useRef(null),[Mt,Tt]=r.useState(o.TypesUtils.EmptyTopLeft),[It,Et]=r.useState(o.TypesUtils.EmptyTopLeft);r.useEffect(()=>{Tt({left:et?.left,top:0})},[et?.left]),r.useEffect(()=>{Et({left:0,top:et?.top})},[et?.top]),W(s?.getView(),{onFreezeSplitChange:()=>{lt(ot(s.getView().getFreezePanes()))},onTopLeftChange:()=>{tt(s.getView().getTopLeft())},onMovableSelectionChange:()=>{mt(s.getView().getMovableSelection().length>0)}}),W(s?.getSelection(),{onChange:()=>{gt(s.getSelection().isEntire())}}),W(s,{onViewChange(){fe(s.getView()),ze(Ae())},onLayoutChange:()=>{const e=s.getEntireRange();qe({height:e.getRowCount(),width:e.getColumnCount()}),ze(Ae())},onStyleChange:()=>{zt()},onMovablesChange:()=>{},onInvalidated:()=>{zt()}}),W(s,{onRequestScrollIntoView:async(e,t)=>{if(!t)return;const n={colIndex:t?.coords.colStart,rowIndex:t?.coords.rowStart};return await(he.current?.scrollCellCoordsIntoView(n,t?.scroll)),!0},onRequestFocus:()=>o.CommonUtils.whenFocus(Dt.current)},$e);const Ft=r.useMemo(()=>{const e=(e,t)=>{qt.current=!0,xt([i=>{if(!i.toClipBounds(i.getRangeCoordsBounds({rowStart:0,rowEnd:xe.height,colStart:e,colEnd:e})))return;const a=i.getLayout(),c=Math.max(0,a.getColOffset(e)),u=i.getBounds(),g=Math.min(u.x+u.width,a.getColOffset(e+1)),h=i.getAnchor();if(null!==t&&(h===o.AnchorLocation.Left||h===o.AnchorLocation.Center||h===o.AnchorLocation.Right)){const e=o.CommonUtils.roundAccurately(t*o.CommonUtils.getDPI(),0),n=o.CommonUtils.roundAccurately(s?.getColumnWidthAsFontUnit(t/pe),2).toFixed(2),r="Width: "+(t?n+" ("+e+" pixels)":"Hidden"),l=Zt.current.getGridElement().getRelativePointFromClient(0,0),i=0-l.y,a=0-l.y+Me,d={x:c-(l.x-u.x),y:i,width:g-c,height:a-i};requestAnimationFrame(()=>{qt.current&&J?.({anchor:d,display:r})})}const m=[0,0,0,u.height],f={style:{boxShadow:`0.5px 0px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:_e}},p={x:c-1,y:0,width:1,height:u.height},v={style:{boxShadow:`-0.5px 0px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:_e}},C={x:g-1,y:0,width:1,height:u.height};return n.jsxs(r.Fragment,{children:[n.jsx(l.SVGLine,{linePoints:m,bounds:p,...f}),n.jsx(l.SVGLine,{linePoints:m,bounds:C,...v})]},"resize-dividers")}])};let t=null;return{onResizeHeadersStart:(n,o,r)=>{t=s.beginCommit(r),e(n,o)},onResizeHeaders:(t,n,o)=>{e(t,n)},onResizeHeadersDown:(t,n)=>{e(t,n)},onResizeHeadersEnd:(e,n,o)=>{t?.commit({description:o}),t=null,requestAnimationFrame(()=>ee?.()),qt.current=!1,xt(null)},onResizeHeadersUp:e=>{requestAnimationFrame(()=>ee?.()),qt.current=!1,xt(null)},...h}},[s,h,Me,yt]),At=r.useMemo(()=>{const e=(e,t)=>{qt.current=!0,xt([i=>{if(!i.toClipBounds(i.getRangeCoordsBounds({rowStart:e,rowEnd:e,colStart:0,colEnd:xe.width})))return;const a=i.getLayout(),c=Math.max(0,a.getRowOffset(e)),u=i.getBounds(),g=Math.min(u.y+u.height,a.getRowOffset(e+1)),h=i.getAnchor();if(null!==t&&(h===o.AnchorLocation.Top||h===o.AnchorLocation.Center||h===o.AnchorLocation.Bottom)){const e=Math.floor(10*o.CommonUtils.getDPI())/10,n=o.CommonUtils.roundAccurately(t*e,0),r=o.CommonUtils.roundAccurately(n/pe/(s?.getRowHeaders().getScaleFactor()*o.CommonUtils.getDPI()),2).toFixed(2),l="Height: "+(t?r+" ("+n+" pixels)":"Hidden"),i=Gt.current.getGridElement().getRelativePointFromClient(0,0),a=0-i.x,d=0-i.x+Re,h={x:a,y:c-(i.y-u.y),width:d-a,height:g-c};requestAnimationFrame(()=>{qt.current&&Q?.({anchor:h,display:l})})}const m=[0,0,u.width,0],f={style:{boxShadow:`0px 0.5px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:_e}},p={x:0,y:c-1,width:u.width,height:1},v={style:{boxShadow:`0px -0.5px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:_e}},C={x:0,y:g-1,width:u.width,height:1};return n.jsxs(r.Fragment,{children:[n.jsx(l.SVGLine,{linePoints:m,bounds:p,...f}),n.jsx(l.SVGLine,{linePoints:m,bounds:C,...v})]},"resize-dividers")}])};let t=null;return{onResizeHeadersStart:(n,o,r)=>{t=s.beginCommit(r),e(n,o)},onResizeHeaders:(t,n,o)=>{e(t,n)},onResizeHeadersDown:(t,n)=>{e(t,n)},onResizeHeadersEnd:(e,n,o)=>{t?.commit({description:o}),t=null,requestAnimationFrame(()=>ee?.()),qt.current=!1,xt(null)},onResizeHeadersUp:e=>{requestAnimationFrame(()=>ee?.()),qt.current=!1,xt(null)},...p}},[s,p,Re]),Dt=t.useImperativeElement(a,()=>{const e=e=>{s?.getView()&&s.getView().selectMovables([]),Fe.current=null,he?.current?.focus(e)},t=async(e=null)=>{if(e||(e=s?.getView().getMovableSelection()[0]),!e)return!1;const t=e.getAnchorCoords();if(!t)return!1;const n=he.current?.getViewFromCellCoords({colIndex:t.colStart,rowIndex:t.rowStart});if(!n)return!1;const o=n.getAnchor();-1===s?.getView().getMovableSelection().indexOf(e)&&s?.getView().selectMovables([e]);let r=Ee.current?.get(o);return r?.current?(await r.current.focusMovable(e),!0):(Fe.current={movable:e,anchor:o},!0)};return{getGridElement:()=>he.current,getRowHeaderElement:()=>Gt.current,getColumnHeaderElement:()=>Zt.current,rowHeaderHeight:()=>Me,colHeaderWidth:()=>Re,startEdit:st,submitEdit:()=>{it.setMode(e=>"edit"!==e?.key?e:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{it.setMode(e=>"edit"!==e?.key?e:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:null!==Be,focus:n=>{s?.getView().getMovableSelection().length>0&&t()||e(n)},focusSheet:e,focusMovable:t,contains:e=>he?.current?.contains?.(e),invalidate:zt,isSheetElement:()=>!0,getSheet:()=>s}},[s]),zt=r.useCallback(e=>{te.current||(he?.current?.invalidate(e),$?.())},[]);r.useEffect(()=>{zt()},[oe]);const Nt=ut?ge.edgeStrokeFill:ce.fill,Lt=ut?ue.fill:"function"==typeof oe.headerHover?oe.headerHover(ce)?.fill:ce.fill,Ot=r.useMemo(()=>R?n.jsx("div",{className:V("sheetxl-viewport-overlay",H),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:R}):n.jsx(n.Fragment,{}),[R]);let jt=null;we&&ye&&(jt=n.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${Me}px`,width:`${Re}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:e=>{let n=!e.ctrlKey;ct?.getCommand("selectAll")?.execute(!n||0!==e.button),e.nativeEvent.which===t.MouseButtonCodes.Right?u?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):he.current?.focus()},children:[n.jsx("div",{style:{height:Me-5+"px",width:Me-5+"px",clipPath:`path('M${Me-5} 0 L0 ${Me-5} L${Me-5} ${Me-5} L${Me-5} 0 Z')`,borderRight:`2px solid ${Nt}`,borderBottom:`2px solid ${Nt}`,background:`${Lt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),n.jsx("div",{style:{position:"absolute",height:`${Me}px`,width:`${Re}px`,boxSizing:"border-box",borderRight:`solid 1px ${ce.strokeFill}`,borderBottom:`solid 1px ${ce.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const Bt=t.useCallbackRef(({_left:e,_top:t})=>{},[]),Vt=t.useCallbackRef(e=>{if(!u)return;const t=he.current.getViewFromClient(e.clientX,e.clientY)?.getCellCoordsFromClient(e.clientX,e.clientY);t&&(u({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:t.rowIndex,colIndex:t.colIndex}),e.stopPropagation(),e.preventDefault())},[u]),Pt=t.useCallbackRef(e=>{if(!(!e.shiftKey&&(e.ctrlKey||e.metaKey)))return;const{deltaY:t}=e;return t>0?ct.getCommand("sheetZoomOut")?.execute():t<0&&ct.getCommand("sheetZoomIn")?.execute(),0===t},[ct]);r.useEffect(()=>{Rt(null),kt.current=null,qt.current=!1,xt(null);const e=s?.getView().getTopLeft();Bt(e),he.current?.scrollTo(e),tt(e),fe(s.getView()),lt(ot(s.getView().getFreezePanes())),ze(Ae()),$()},[s?.getView()]);const Ht=t.useCallbackRef(t=>{const n=t.getVisibleRangeCoords();if(!n)return null;const o=[];return s.getRange(n).forEach((t,n)=>{const r=n.getCoords(),l=n.getCell();(t=>{if(t.isEmpty())return!1;const n=t.getSpans();if(n.width>1||n.height>1)return!0;if(t.getStyle().hasVisibleStyling())return!0;if(me.isShowFormulas()&&null!==t.getFormula())return!0;const o=t.getValue();return null!==o&&!(!me.isShowZeros()&&0===o&&t.getType()===e.ScalarType.Number)})(l)&&o.push({coords:r,value:l,range:me.isShowFormulas()?null:l.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),o},[s,me.isShowZeros(),me.isShowFormulas(),Be]);r.useEffect(()=>{const e=[];q&&e.push(...q),yt&&e.push(...yt),o.CommonUtils.isEqualArrays(e,kt.current)||(kt.current=e,Rt(e))},[q,yt,oe]);const Ut=r.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:d?.body?.text?.fill??"black"}}),[oe?.header?.edgeStrokeFill]),Kt=t.useCallbackRef(e=>{e.isDefaultPrevented()||e.isPropagationStopped()||(Fe.current=null,s?.getView().getMovableSelection().length>0&&s.getView().selectMovables([]))},[s]),Wt=r.useMemo(()=>{const e=it.getMode();return"cut"===e?.key||"copy"===e?.key},[it]),$t=t.useCallbackRef(async e=>{const n=it.getMode();return e.keyCode===t.KeyCodes.Escape&&n?(e.preventDefault(),void it.setMode(null)):e.keyCode===t.KeyCodes.Enter&&Wt?(e.preventDefault(),await(ct?.getCommand("paste")?.execute()),void it.setMode(null)):void ct?.dispatchToFocusedCommand(e)},[ct,it]),Gt=r.useRef(null),_t=r.useMemo(()=>n.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${Me+1}px`,width:`${Re+ce.edgeStrokeWidth}px`,minWidth:`${Re+ce.edgeStrokeWidth}px`,borderRight:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,height:`calc(100% - ${Me}px)`,boxSizing:"border-box",zIndex:"2"},children:n.jsx(se,{ref:Gt,sheetElement:Dt.current,gridRef:he,freezeStart:rt?.[o.AnchorLocation.Top],oppositeSize:Re,containerWidth:Re,containerHeight:Ie,sheetHeader:s.getRowHeaders(),gridStyle:re,verticalPadding:Math.max(0,Math.floor(s.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:It,onSheetContextMenu:u,tabIndex:-1,style:{position:"relative",flex:"0",top:`${Me+1}px`,width:`${Re+ce.edgeStrokeWidth}px`,minWidth:`${Re+ce.edgeStrokeWidth}px`,borderRight:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,height:`calc(100% - ${Me}px)`,boxSizing:"border-box",zIndex:"2",...At?.style},...At})}),[Re,Me,Ie,s,It,rt?.[o.AnchorLocation.Top],oe,Pe,u,ce.fill,p]),Zt=r.useRef(null),Xt=r.useMemo(()=>n.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${Me+ce.edgeStrokeWidth}px`,minHeight:`${Me+ce.edgeStrokeWidth}px`,borderBottom:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:n.jsx(se,{ref:Zt,sheetElement:Dt.current,gridRef:he,freezeStart:rt?.[o.AnchorLocation.Left],oppositeSize:Me,containerWidth:Te,containerHeight:Me,sheetHeader:s.getColumnHeaders(),gridStyle:re,scrollPoint:Mt,onSheetContextMenu:u,...Ft,style:{...Ft?.style,position:"relative",left:"0px",width:"100%",height:`${Me+ce.edgeStrokeWidth}px`,minHeight:`${Me+ce.edgeStrokeWidth}px`,borderBottom:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[Me,Te,s,Mt,rt?.[o.AnchorLocation.Left],oe,ce.fill,Pe,u,h]),Yt=t.useCallbackRef(e=>{const{value:t,key:n,...o}=e;let l=t,i=Be;if(!i||i.colIndex===e.coords.colIndex&&i.rowIndex===e.coords.rowIndex||(i=null),!l){const t=e.range;if(l=s.getRange({rowIndex:t.rowStart,colIndex:t.colStart}).getCell(),l.isEmpty())return null}let a=null;l.getHyperlink()&&(a=async e=>{if(j?.onLinkMouseDown?.(e),0===e.button&&!e.isDefaultPrevented()){e.stopPropagation(),e.preventDefault();try{await(l.getHyperlink()?.open())}catch(e){A?.showError?.(e)}}}),i&&i.colIndex===e.range.colStart&&i.rowIndex===e.range.rowStart&&(l=l.createTemporaryCell({value:null}));const d=s.getStyles();return r.createElement(m,{...o,key:n,bodyStyle:le,docTheme:d.getTheme(),normalStyle:d.getNormal(),showFormulas:me.isShowFormulas(),showZeros:me.isShowZeros(),onLinkMouseDown:a,...j,value:l})},[s,De,le,Be,me?.isShowFormulas(),me.isShowZeros()]),Jt=r.useCallback((e,t)=>{const{key:o,...r}=e;return[n.jsx(de,{ref:t,getVisibleCells:Ht,sheet:s,gridStyle:oe,...r},`border-${o}`),n.jsx(He,{ref:t,sheet:s,commands:ct,...r},`table-${o}`),n.jsx(Ue,{ref:t,sheet:s,...r},`spill-${o}`),n.jsx(ke,{ref:t,sheet:s,commands:ct,notifier:A,onShowTooltip:Y,onCloseTooltip:ee,gridStyle:oe,gridRef:he,editingCoords:Be,isActive:Pe,...r},`selection-${o}`),n.jsx(Ce,{ref:t,sheet:s,commands:ct,gridStyle:oe,element:Ze,notifier:A,...r},`copy-paste-${o}`),n.jsx(Le,{ref:t,sheet:s,commands:ct,target:at,notifier:A,renderMovable:S,movableProps:{onUnFocus:()=>{Dt.current.focus()}},...r},`movable-${o}`),n.jsx(Oe,{ref:t,sheet:s,commands:ct,notifier:A,gridStyle:oe,getCellEditor:M,showProtectedError:bt,setEditingCoords:Ve,...r},`editor-${o}`)]},[s,he.current,oe,M,ct,A]),[Qt,en]=r.useState(!1),tn=r.useMemo(()=>{if(0===Te||0===Ie)return null;const t=s.getStyles().getNormal(),r=t.getFont(),i=t.getFill(),a=t.getBorder(),d=t.getFill().getType()===e.IFill.Type.None;let c=be,u=be;const g=(e,t,n)=>n?{stroke:a.getBottom().isNone()?"none":e.getColor().toRGBA(le.darkMode).toString(),...t}:t;u=g(a.getBottom(),u,!a.getBottom().isNone()),u=g(a.getTop(),u,!a.getTop().isNone()),c=g(a.getRight(),c,!a.getRight().isNone()),c=g(a.getLeft(),c,!a.getLeft().isNone());let h=me?.getGridLineColor()?.toRGBA(le.darkMode).toString()??le.strokeFill;return d||(u=g(a.getBottom(),u,!0),u=g(a.getTop(),u,!0),c=g(a.getRight(),c,!0),c=g(a.getLeft(),c,!0)),n.jsx(l.Grid,{className:"sheetxl-sheet-primary",style:{...Ke,...i.toCSS(le.darkMode),...r.toCSS(le.darkMode,pe),"--sxl-app-color-background":le.fill,"--sxl-app-color-shadow":oe.colorShadow,"--sxl-app-color-grey":oe.colorGrey,"--sxl-app-color-button-fill":ae.fill,"--sxl-app-color-button-text":ae.text?.fill,"--sxl-app-color-button-border":ae.edgeStrokeFill,"--sxl-app-color-primary-dark":oe.selection.strokeFill},ref:he,zoom:pe,...O,onFirstRender:e=>{en(!0),O?.onFirstRender?.(e),ct?.activate()},showGridLines:ve,gridLineColor:h,gridLineColumnsProps:c,gridLineRowsProps:u,freezeLeft:rt?.[o.AnchorLocation.Left],freezeLeftProps:Ut,freezeTop:rt?.[o.AnchorLocation.Top],freezeTopProps:Ut,width:Te,height:Ie,columnCount:xe.width,rowCount:xe.height,cursor:wt??pt??"cell",clipCells:!0,layout:De,cellRenderer:Yt,overlayRenderer:Jt,getCellCoordsAsRangeCoords:nt,getVisibleCells:Ht,onWheelScroll:Pt,onPointerDown:Kt,onKeyDown:$t,onViewportChange:Je,onImmediateScroll:Bt,scrollPoint:et,stageProps:{onFocus:()=>{ct?.activate()}},overlays:St})},[U]);r.useEffect(()=>{te.current||$()},[De,rt,pe,ct,et?.left,et?.top,le,O,Te,Ie,wt,St,Pe,pt]);let nn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};v||(nn={...nn,...F});const on=r.useMemo(()=>{const e=s.getStyles().getTheme(),t=e.getColorScheme(),n=e.getFontScheme();return{"--sxl-doc-color-dk1":t.getDk1().toCSS(le.darkMode),"--sxl-doc-color-dk2":t.getDk2().toCSS(le.darkMode),"--sxl-doc-color-lt1":t.getLt1().toCSS(le.darkMode),"--sxl-doc-color-lt2":t.getLt2().toCSS(le.darkMode),"--sxl-doc-color-accent1":t.getAccent1().toCSS(le.darkMode),"--sxl-doc-color-accent2":t.getAccent2().toCSS(le.darkMode),"--sxl-doc-color-accent3":t.getAccent3().toCSS(le.darkMode),"--sxl-doc-color-accent4":t.getAccent4().toCSS(le.darkMode),"--sxl-doc-color-accent5":t.getAccent5().toCSS(le.darkMode),"--sxl-doc-color-accent6":t.getAccent6().toCSS(le.darkMode),"--sxl-doc-color-hlink":t.getHlink().toCSS(le.darkMode),"--sxl-doc-color-fol-hlink":t.getFolHlink().toCSS(le.darkMode),"--sxl-doc-font-major":n.getMajorFont(),"--sxl-doc-font-minor":n.getMinorFont()}},[s.getStyles().getTheme()]);let rn=n.jsx("div",{style:nn,onTouchStart:()=>{sn()},onFocus:e=>{je(!0),I?.(e)},onBlur:e=>{je(!1),E?.(e)},ref:Dt,...B,children:n.jsx("div",{className:V("sheetxl-sheet",P),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...on},children:n.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[jt,_t,n.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[Xt,n.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,backgroundColor:le.fill},ref:_,onContextMenu:Vt,children:[tn,Ot,n.jsx(K,{style:{position:"absolute",right:24,bottom:4},colorLicensee:oe?.selection?.strokeFill,colorCredits:oe?.body?.text?.fill})]})]})]})})});if(v){const e=e=>n.jsx(ie,{...e,sheet:s});rn=n.jsx(t.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${ce.fill}`,minHeight:2*Se.height,minWidth:2*Se.width,...F},viewport:Xe,touchElement:he.current?.stage,disableTouch:ft,onScrollViewport:e=>{he.current?.scrollTo(e)},createHorizontalScrollbar:e,createVerticalScrollbar:e,...C,children:rn})}r.useEffect(()=>{te.current=!1,$?.(),Ne&&Dt.current?.focus()},[s]);const[ln,an]=r.useState(!1),sn=t.useCallbackRef(()=>{ln||an(!0)},[ln]);return r.useEffect(()=>{if(Qt)return"function"==typeof k&&k(),"touch"===t.ReactUtils.detectIt().primaryInput&&sn(),()=>{}},[k,Qt,ln]),rn}));_e.displayName="SheetElement";const Ze=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Xe="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Ye=r.memo(r.forwardRef((e,o)=>{const{children:l,disabled:i,style:a,picture:s,description:d,isDragging:c,view:u,onHide:g,onShow:h,onKeyDownCapture:m,onFocus:f,onBlur:p,loadingPanel:v,...C}=e,[b,w]=r.useState(!1),[y,x]=r.useState(null),[q,S]=r.useState(null),[R,k]=r.useState(null);r.useEffect(()=>{S(null),s.getDetails().then(e=>{w(!1),S(e.asUrl()),e.asSVGText?.()&&k(e.asSVGText())}).catch(e=>{console.warn(e),w(!0),S(Xe),k(null)})},[s]);const M=t.useImperativeElement(o,()=>({isPictureEditor:()=>!0}),[]),T=r.useMemo(()=>{if(q||R)return n.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:b?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:b?"var(--sxl-app-color-background, white)":void 0,boxShadow:b?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:b?"contain":void 0,opacity:y?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:q,onLoad:()=>{x(!0)},onError:({currentTarget:e})=>{console.log("error"),e.onerror=null,S(Xe),w(!0)},alt:d??`${s.getType()}`})},[y,s,q,R,c]);if(!s.isClosed())return n.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:c?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...C,onKeyDownCapture:e=>{m?.(e)},ref:M,children:[y||b?void 0:v,T]})}));Ye.displayName="PictureEditor";const Je=r.memo(r.forwardRef((e,o)=>{const{children:l,disabled:i,chart:a,view:s,isDragging:d,onHide:c,onShow:u,...g}=e;r.useEffect(()=>{},[a]);const h=t.useImperativeElement(o,()=>({isChartEditor:()=>!0}),[]),[m,{height:f,width:p}]=T();if(!a.isClosed())return n.jsx("div",{...g,ref:x([h,m]),children:n.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:s.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:n.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),Qe="_editable-input_1bqx6_6",et=e=>n.jsx("input",{...e}),tt=r.memo(r.forwardRef((e,o)=>{const{style:l={},className:i,value:a="",onSubmit:s,onChange:d,onCancel:c,createInput:u=et,notifier:g,styleHover:h={},dragging:m,maxLength:f,disabled:p=!1,readOnly:v=!1,...C}=e,[b,w]=r.useState(!1),[y,x]=r.useState(!1),[q,S]=r.useState(a);r.useEffect(()=>{S(a)},[a]);const R=r.useRef(null),[k,M]=r.useState(null),T=r.useCallback(function(e){const n=e.message;k!==n&&(g?.showMessage?.(n,{type:t.NotificationType.Error}),M(n))},[g,k]),I=r.useCallback(e=>{let t=!1;try{t=s?.(e)??!0}catch(e){T(e)}return t?(R.current=null,x(!1),S(e),t):(setTimeout(()=>{R.current?.focus()},0),t)},[s]),E=t.useCallbackRef(()=>{S(a),R.current=null,x(!1),c?.()},[c,a]),F=r.useMemo(()=>{if(!y)return null;const e={className:V(Qe),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:f,type:"text",value:q,onFocus:e=>{R.current||(R.current=e.target,setTimeout(()=>{e.target?.select()},0))},onBlur:e=>{R.current&&I(q)},onChange:e=>{y&&S(e.target.value)},onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>"Escape"===e.code?(e.preventDefault(),void E()):"Enter"===e.code?(e.preventDefault(),void I(e.target.value)):void("Tab"!==e.code?e.stopPropagation():I(e.target.value))};return n.jsx(n.Fragment,{children:u(e)})},[y,q,I,E,u,p]),[A,D]=r.useState();r.useLayoutEffect(()=>{let e=Object.assign({},l);(m||b)&&(e=Object.assign(e,h)),D(e)},[m,b,h,l]),r.useEffect(()=>{F&&d?.(q)},[F,d,q]);const z=t.useImperativeElement(o,()=>({startEdit(){p||v||x(!0)},cancel(){E()}}),[]);return n.jsxs("div",{...C,ref:z,style:{flexDirection:"column",display:"flex",...A},className:V(i),children:[n.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{p||v||x(!0)},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[n.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:y?0:1},children:q}),F]}),n.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...h},children:q})]})}));const nt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ot(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function rt(e){return"nodeType"in e}function lt(e){var t,n;return e?ot(e)?e:rt(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function it(e){const{Document:t}=lt(e);return e instanceof t}function at(e){return!ot(e)&&e instanceof lt(e).HTMLElement}function st(e){return e instanceof lt(e).SVGElement}function dt(e){return e?ot(e)?e.document:rt(e)?it(e)?e:at(e)||st(e)?e.ownerDocument:document:document:document}const ct=nt?r.useLayoutEffect:r.useEffect;function ut(e){const t=r.useRef(e);return ct(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)},[])}function gt(e,t){void 0===t&&(t=[e]);const n=r.useRef(e);return ct(()=>{n.current!==e&&(n.current=e)},t),n}function ht(e,t){const n=r.useRef();return r.useMemo(()=>{const t=e(n.current);return n.current=t,t},[...t])}function mt(e){const t=ut(e),n=r.useRef(null),o=r.useCallback(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,o]}function ft(e){const t=r.useRef();return r.useEffect(()=>{t.current=e},[e]),t.current}let pt={};function vt(e,t){return r.useMemo(()=>{if(t)return t;const n=null==pt[e]?0:pt[e]+1;return pt[e]=n,e+"-"+n},[e,t])}function Ct(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t},{...t})}}const bt=Ct(1),wt=Ct(-1);function yt(e){if(!e)return!1;const{KeyboardEvent:t}=lt(e.target);return t&&e instanceof t}function xt(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=lt(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const qt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[qt.Translate.toString(e),qt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),St="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Rt(e){return e.matches(St)?e:e.querySelector(St)}const kt={display:"none"};function Mt(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:kt},n)}function Tt(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},n)}const It=r.createContext(null);const Et={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Ft={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function At(e){let{announcements:t=Ft,container:n,hiddenTextDescribedById:o,screenReaderInstructions:l=Et}=e;const{announce:a,announcement:s}=function(){const[e,t]=r.useState("");return{announce:r.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),d=vt("DndLiveRegion"),[c,u]=r.useState(!1);if(r.useEffect(()=>{u(!0)},[]),function(e){const t=r.useContext(It);r.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(r.useMemo(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&a(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;a(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;a(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;a(t.onDragCancel({active:n,over:o}))}}),[a,t])),!c)return null;const g=r.createElement(r.Fragment,null,r.createElement(Mt,{id:o,value:l.draggable}),r.createElement(Tt,{id:d,announcement:s}));return n?i.createPortal(g,n):g}var Dt;function zt(){}function Nt(e,t){return r.useMemo(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Dt||(Dt={}));const Lt=Object.freeze({x:0,y:0});function Ot(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jt(e,t){const n=xt(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function Bt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function Vt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Pt(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function Ht(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}function Ut(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Kt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Ut(t,t.left,t.top),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=Ot(Ut(o),r);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(Bt)};function Wt(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),i=r-o,a=l-n;if(o<r&&n<l){const n=t.width*t.height,o=e.width*e.height,r=i*a;return Number((r/(n+o-r)).toFixed(4))}return 0}const $t=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,l=n.get(o);if(l){const n=Wt(l,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(Vt)};function Gt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Lt}function _t(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const Zt=_t(1);function Xt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Yt={ignoreTransform:!1};function Jt(e,t){void 0===t&&(t=Yt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=lt(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=Xt(t);if(!o)return e;const{scaleX:r,scaleY:l,x:i,y:a}=o,s=e.left-i-(1-r)*parseFloat(n),d=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width/r:e.width,u=l?e.height/l:e.height;return{width:c,height:u,top:d,right:s+c,bottom:d+u,left:s}}(n,t,o))}const{top:o,left:r,width:l,height:i,bottom:a,right:s}=n;return{top:o,left:r,width:l,height:i,bottom:a,right:s}}function Qt(e){return Jt(e,{ignoreTransform:!0})}function en(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(it(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!at(r)||st(r))return n;if(n.includes(r))return n;const l=lt(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=lt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const o=t[e];return"string"==typeof o&&n.test(o)})}(r,l)&&n.push(r),function(e,t){return void 0===t&&(t=lt(e).getComputedStyle(e)),"fixed"===t.position}(r,l)?n:o(r.parentNode)}(e):n}function tn(e){const[t]=en(e,1);return null!=t?t:null}function nn(e){return nt&&e?ot(e)?e:rt(e)?it(e)||e===dt(e).scrollingElement?window:at(e)?e:null:null:null}function on(e){return ot(e)?e.scrollX:e.scrollLeft}function rn(e){return ot(e)?e.scrollY:e.scrollTop}function ln(e){return{x:on(e),y:rn(e)}}var an;function sn(e){return!(!nt||!e)&&e===document.scrollingElement}function dn(e){const t={x:0,y:0},n=sn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(an||(an={}));const cn={x:.2,y:.2};function un(e,t,n,o,r){let{top:l,left:i,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===r&&(r=cn);const{isTop:d,isBottom:c,isLeft:u,isRight:g}=dn(e),h={x:0,y:0},m={x:0,y:0},f=t.height*r.y,p=t.width*r.x;return!d&&l<=t.top+f?(h.y=an.Backward,m.y=o*Math.abs((t.top+f-l)/f)):!c&&s>=t.bottom-f&&(h.y=an.Forward,m.y=o*Math.abs((t.bottom-f-s)/f)),!g&&a>=t.right-p?(h.x=an.Forward,m.x=o*Math.abs((t.right-p-a)/p)):!u&&i<=t.left+p&&(h.x=an.Backward,m.x=o*Math.abs((t.left+p-i)/p)),{direction:h,speed:m}}function gn(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function hn(e){return e.reduce((e,t)=>bt(e,ln(t)),Lt)}function mn(e,t){if(void 0===t&&(t=Jt),!e)return;const{top:n,left:o,bottom:r,right:l}=t(e);tn(e)&&(r<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const fn=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+on(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+rn(t),0)}]];class pn{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=en(t),o=hn(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of fn)for(const l of t)Object.defineProperty(this,l,{get:()=>{const t=r(n),i=o[e]-t;return this.rect[l]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vn{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Cn(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var bn,wn;function yn(e){e.preventDefault()}function xn(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(bn||(bn={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(wn||(wn={}));const qn={start:[wn.Space,wn.Enter],cancel:[wn.Esc],end:[wn.Space,wn.Enter,wn.Tab]},Sn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case wn.Right:return{...n,x:n.x+25};case wn.Left:return{...n,x:n.x-25};case wn.Down:return{...n,y:n.y+25};case wn.Up:return{...n,y:n.y-25}}};class Rn{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new vn(dt(t)),this.windowListeners=new vn(lt(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bn.Resize,this.handleCancel),this.windowListeners.add(bn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&mn(n),t(Lt)}handleKeyDown(e){if(yt(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=qn,coordinateGetter:l=Sn,scrollBehavior:i="smooth"}=o,{code:a}=e;if(r.end.includes(a))return void this.handleEnd(e);if(r.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,d=s?{x:s.left,y:s.top}:Lt;this.referenceCoordinates||(this.referenceCoordinates=d);const c=l(e,{active:t,context:n.current,currentCoordinates:d});if(c){const t=wt(c,d),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:l,isRight:a,isLeft:s,isBottom:d,maxScroll:u,minScroll:g}=dn(n),h=gn(n),m={x:Math.min(r===wn.Right?h.right-h.width/2:h.right,Math.max(r===wn.Right?h.left:h.left+h.width/2,c.x)),y:Math.min(r===wn.Down?h.bottom-h.height/2:h.bottom,Math.max(r===wn.Down?h.top:h.top+h.height/2,c.y))},f=r===wn.Right&&!a||r===wn.Left&&!s,p=r===wn.Down&&!d||r===wn.Up&&!l;if(f&&m.x!==c.x){const e=n.scrollLeft+t.x,l=r===wn.Right&&e<=u.x||r===wn.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});o.x=l?n.scrollLeft-e:r===wn.Right?n.scrollLeft-u.x:n.scrollLeft-g.x,o.x&&n.scrollBy({left:-o.x,behavior:i});break}if(p&&m.y!==c.y){const e=n.scrollTop+t.y,l=r===wn.Down&&e<=u.y||r===wn.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});o.y=l?n.scrollTop-e:r===wn.Down?n.scrollTop-u.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:i});break}}this.handleMove(e,bt(wt(c,this.referenceCoordinates),o))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function kn(e){return Boolean(e&&"distance"in e)}function Mn(e){return Boolean(e&&"delay"in e)}Rn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=qn,onActivation:r}=t,{active:l}=n;const{code:i}=e.nativeEvent;if(o.start.includes(i)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class Tn{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=lt(e);return e instanceof t?e:dt(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:l}=r;this.props=e,this.events=t,this.document=dt(l),this.documentListeners=new vn(this.document),this.listeners=new vn(n),this.windowListeners=new vn(lt(l)),this.initialCoordinates=null!=(o=xt(r))?o:Lt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(bn.Resize,this.handleCancel),this.windowListeners.add(bn.DragStart,yn),this.windowListeners.add(bn.VisibilityChange,this.handleCancel),this.windowListeners.add(bn.ContextMenu,yn),this.documentListeners.add(bn.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mn(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(kn(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:o}=this.props;o(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(bn.Click,xn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bn.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:l,options:{activationConstraint:i}}=r;if(!o)return;const a=null!=(t=xt(e))?t:Lt,s=wt(o,a);if(!n&&i){if(kn(i)){if(null!=i.tolerance&&Cn(s,i.tolerance))return this.handleCancel();if(Cn(s,i.distance))return this.handleStart()}return Mn(i)&&Cn(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),l(a)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===wn.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const In={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class En extends Tn{constructor(e){const{event:t}=e,n=dt(t.target);super(e,In,n)}}En.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const Fn={move:{name:"mousemove"},end:{name:"mouseup"}};var An;!function(e){e[e.RightClick=2]="RightClick"}(An||(An={}));class Dn extends Tn{constructor(e){super(e,Fn,dt(e.event.target))}}Dn.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==An.RightClick&&(null==o||o({event:n}),!0)}}];const zn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Nn extends Tn{constructor(e){super(e,zn)}static setup(){return window.addEventListener(zn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(zn.move.name,e)};function e(){}}}var Ln,On;function jn(e){let{acceleration:t,activator:n=Ln.Pointer,canScroll:o,draggingRect:l,enabled:i,interval:a=5,order:s=On.TreeOrder,pointerCoordinates:d,scrollableAncestors:c,scrollableAncestorRects:u,delta:g,threshold:h}=e;const m=function(e){let{delta:t,disabled:n}=e;const o=ft(t);return ht(e=>{if(n||!o||!e)return Bn;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[an.Backward]:e.x[an.Backward]||-1===r.x,[an.Forward]:e.x[an.Forward]||1===r.x},y:{[an.Backward]:e.y[an.Backward]||-1===r.y,[an.Forward]:e.y[an.Forward]||1===r.y}}},[n,t,o])}({delta:g,disabled:!i}),[f,p]=function(){const e=r.useRef(null);return[r.useCallback((t,n)=>{e.current=setInterval(t,n)},[]),r.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),v=r.useRef({x:0,y:0}),C=r.useRef({x:0,y:0}),b=r.useMemo(()=>{switch(n){case Ln.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Ln.DraggableRect:return l}},[n,l,d]),w=r.useRef(null),y=r.useCallback(()=>{const e=w.current;if(!e)return;const t=v.current.x*C.current.x,n=v.current.y*C.current.y;e.scrollBy(t,n)},[]),x=r.useMemo(()=>s===On.TreeOrder?[...c].reverse():c,[s,c]);r.useEffect(()=>{if(i&&c.length&&b){for(const e of x){if(!1===(null==o?void 0:o(e)))continue;const n=c.indexOf(e),r=u[n];if(!r)continue;const{direction:l,speed:i}=un(e,r,b,t,h);for(const e of["x","y"])m[e][l[e]]||(i[e]=0,l[e]=0);if(i.x>0||i.y>0)return p(),w.current=e,f(y,a),v.current=i,void(C.current=l)}v.current={x:0,y:0},C.current={x:0,y:0},p()}else p()},[t,y,o,p,i,a,JSON.stringify(b),JSON.stringify(m),f,c,x,u,JSON.stringify(h)])}Nn.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Ln||(Ln={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(On||(On={}));const Bn={x:{[an.Backward]:!1,[an.Forward]:!1},y:{[an.Backward]:!1,[an.Forward]:!1}};var Vn,Pn;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Vn||(Vn={})),function(e){e.Optimized="optimized"}(Pn||(Pn={}));const Hn=new Map;function Un(e,t){return ht(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Kn(e){let{callback:t,disabled:n}=e;const o=ut(t),l=r.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[n]);return r.useEffect(()=>()=>null==l?void 0:l.disconnect(),[l]),l}function Wn(e){return new pn(Jt(e),e)}function $n(e,t,n){void 0===t&&(t=Wn);const[o,l]=r.useState(null);function i(){l(o=>{if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=o?o:n)?r:null;const l=t(e);return JSON.stringify(o)===JSON.stringify(l)?o:l})}const a=function(e){let{callback:t,disabled:n}=e;const o=ut(t),l=r.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,n]);return r.useEffect(()=>()=>null==l?void 0:l.disconnect(),[l]),l}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){i();break}}}}),s=Kn({callback:i});return ct(()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())},[e]),o}const Gn=[];function _n(e,t){void 0===t&&(t=[]);const n=r.useRef(null);return r.useEffect(()=>{n.current=null},t),r.useEffect(()=>{const t=e!==Lt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?wt(e,n.current):Lt}function Zn(e){return r.useMemo(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const Xn=[];function Yn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return at(t)?t:e}const Jn=[{sensor:En,options:{}},{sensor:Rn,options:{}}],Qn={current:{}},eo={draggable:{measure:Qt},droppable:{measure:Qt,strategy:Vn.WhileDragging,frequency:Pn.Optimized},dragOverlay:{measure:Jt}};class to extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const no={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new to,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:zt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eo,measureDroppableContainers:zt,windowRect:null,measuringScheduled:!1},oo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:zt,draggableNodes:new Map,over:null,measureDroppableContainers:zt},ro=r.createContext(oo),lo=r.createContext(no);function io(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new to}}}function ao(e,t){switch(t.type){case Dt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Dt.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Dt.DragEnd:case Dt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Dt.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new to(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case Dt.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,l=e.droppable.containers.get(n);if(!l||o!==l.key)return e;const i=new to(e.droppable.containers);return i.set(n,{...l,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case Dt.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new to(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function so(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:l}=r.useContext(ro),i=ft(o),a=ft(null==n?void 0:n.id);return r.useEffect(()=>{if(!t&&!o&&i&&null!=a){if(!yt(i))return;if(document.activeElement===i.target)return;const e=l.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Rt(e);if(t){t.focus();break}}})}},[o,t,l,a,i]),null}function co(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...o}),n):n}const uo=r.createContext({...Lt,scaleX:1,scaleY:1});var go;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(go||(go={}));const ho=r.memo(function(e){var t,n,o,l;let{id:a,accessibility:s,autoScroll:d=!0,children:c,sensors:u=Jn,collisionDetection:g=$t,measuring:h,modifiers:m,...f}=e;const p=r.useReducer(ao,void 0,io),[v,C]=p,[b,w]=function(){const[e]=r.useState(()=>new Set),t=r.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]);return[r.useCallback(t=>{let{type:n,event:o}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)})},[e]),t]}(),[y,x]=r.useState(go.Uninitialized),q=y===go.Initialized,{draggable:{active:S,nodes:R,translate:k},droppable:{containers:M}}=v,T=null!=S?R.get(S):null,I=r.useRef({initial:null,translated:null}),E=r.useMemo(()=>{var e;return null!=S?{id:S,data:null!=(e=null==T?void 0:T.data)?e:Qn,rect:I}:null},[S,T]),F=r.useRef(null),[A,D]=r.useState(null),[z,N]=r.useState(null),L=gt(f,Object.values(f)),O=vt("DndDescribedBy",a),j=r.useMemo(()=>M.getEnabled(),[M]),B=(V=h,r.useMemo(()=>({draggable:{...eo.draggable,...null==V?void 0:V.draggable},droppable:{...eo.droppable,...null==V?void 0:V.droppable},dragOverlay:{...eo.dragOverlay,...null==V?void 0:V.dragOverlay}}),[null==V?void 0:V.draggable,null==V?void 0:V.droppable,null==V?void 0:V.dragOverlay]));var V;const{droppableRects:P,measureDroppableContainers:H,measuringScheduled:U}=function(e,t){let{dragging:n,dependencies:o,config:l}=t;const[i,a]=r.useState(null),{frequency:s,measure:d,strategy:c}=l,u=r.useRef(e),g=function(){switch(c){case Vn.Always:return!1;case Vn.BeforeDragging:return n;default:return!n}}(),h=gt(g),m=r.useCallback(function(e){void 0===e&&(e=[]),h.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[h]),f=r.useRef(null),p=ht(t=>{if(g&&!n)return Hn;if(!t||t===Hn||u.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new pn(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,i,n,g,d]);return r.useEffect(()=>{u.current=e},[e]),r.useEffect(()=>{g||m()},[n,g]),r.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),r.useEffect(()=>{g||"number"!=typeof s||null!==f.current||(f.current=setTimeout(()=>{m(),f.current=null},s))},[s,g,m,...o]),{droppableRects:p,measureDroppableContainers:m,measuringScheduled:null!=i}}(j,{dragging:q,dependencies:[k.x,k.y],config:B.droppable}),K=function(e,t){const n=null!=t?e.get(t):void 0,o=n?n.node.current:null;return ht(e=>{var n;return null==t?null:null!=(n=null!=o?o:e)?n:null},[o,t])}(R,S),W=r.useMemo(()=>z?xt(z):null,[z]),$=function(){const e=!1===(null==A?void 0:A.autoScrollEnabled),t="object"==typeof d?!1===d.enabled:!1===d,n=q&&!e&&!t;if("object"==typeof d)return{...d,enabled:n};return{enabled:n}}(),G=function(e,t){return Un(e,t)}(K,B.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:l=!0}=e;const i=r.useRef(!1),{x:a,y:s}="boolean"==typeof l?{x:l,y:l}:l;ct(()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=Gt(n(e),o);if(a||(r.x=0),s||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=tn(e);t&&t.scrollBy({top:r.y,left:r.x})}},[t,a,s,o,n])}({activeNode:null!=S?R.get(S):null,config:$.layoutShiftCompensation,initialRect:G,measure:B.draggable.measure});const _=$n(K,B.draggable.measure,G),Z=$n(K?K.parentElement:null),X=r.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Y=M.getNodeFor(null==(t=X.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,o]=r.useState(null),l=Kn({callback:r.useCallback(e=>{for(const{target:n}of e)if(at(n)){o(e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o});break}},[t])}),i=r.useCallback(e=>{const n=Yn(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),o(n?t(n):null)},[t,l]),[a,s]=mt(i);return r.useMemo(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:B.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:K,ee=q?null!=(o=J.rect)?o:_:null,te=Boolean(J.nodeRef.current&&J.rect),ne=Gt(oe=te?null:_,Un(oe));var oe;const re=Zn(Q?lt(Q):null),le=function(e){const t=r.useRef(e),n=ht(n=>e?n&&n!==Gn&&e&&t.current&&e.parentNode===t.current.parentNode?n:en(e):Gn,[e]);return r.useEffect(()=>{t.current=e},[e]),n}(q?null!=Y?Y:K:null),ie=function(e,t){void 0===t&&(t=Jt);const[n]=e,o=Zn(n?lt(n):null),[l,i]=r.useState(Xn);function a(){i(()=>e.length?e.map(e=>sn(e)?o:new pn(t(e),e)):Xn)}const s=Kn({callback:a});return ct(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),l}(le),ae=co(m,{transform:{x:k.x-ne.x,y:k.y-ne.y,scaleX:1,scaleY:1},activatorEvent:z,active:E,activeNodeRect:_,containerNodeRect:Z,draggingNodeRect:ee,over:X.current.over,overlayNodeRect:J.rect,scrollableAncestors:le,scrollableAncestorRects:ie,windowRect:re}),se=W?bt(W,k):null,de=function(e){const[t,n]=r.useState(null),o=r.useRef(e),l=r.useCallback(e=>{const t=nn(e.target);t&&n(e=>e?(e.set(t,ln(t)),new Map(e)):null)},[]);return r.useEffect(()=>{const t=o.current;if(e!==t){r(t);const i=e.map(e=>{const t=nn(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,ln(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),o.current=e}return()=>{r(e),r(t)};function r(e){e.forEach(e=>{const t=nn(e);null==t||t.removeEventListener("scroll",l)})}},[l,e]),r.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>bt(e,t),Lt):hn(e):Lt,[e,t])}(le),ce=_n(de),ue=_n(de,[_]),ge=bt(ae,ce),he=ee?Zt(ee,ae):null,me=E&&he?g({active:E,collisionRect:he,droppableRects:P,droppableContainers:j,pointerCoordinates:se}):null,fe=Ht(me,"id"),[pe,ve]=r.useState(null),Ce=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(te?ae:bt(ae,ue),null!=(l=null==pe?void 0:pe.rect)?l:null,_),be=r.useRef(null),we=r.useCallback((e,t)=>{let{sensor:n,options:o}=t;if(null==F.current)return;const r=R.get(F.current);if(!r)return;const l=e.nativeEvent,a=new n({active:F.current,activeNode:r,event:l,options:o,context:X,onAbort(e){if(!R.get(e))return;const{onDragAbort:t}=L.current,n={id:e};null==t||t(n),b({type:"onDragAbort",event:n})},onPending(e,t,n,o){if(!R.get(e))return;const{onDragPending:r}=L.current,l={id:e,constraint:t,initialCoordinates:n,offset:o};null==r||r(l),b({type:"onDragPending",event:l})},onStart(e){const t=F.current;if(null==t)return;const n=R.get(t);if(!n)return;const{onDragStart:o}=L.current,r={activatorEvent:l,active:{id:t,data:n.data,rect:I}};i.unstable_batchedUpdates(()=>{null==o||o(r),x(go.Initializing),C({type:Dt.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:r}),D(be.current),N(l)})},onMove(e){C({type:Dt.DragMove,coordinates:e})},onEnd:s(Dt.DragEnd),onCancel:s(Dt.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=X.current;let a=null;if(t&&r){const{cancelDrop:i}=L.current;if(a={activatorEvent:l,active:t,collisions:n,delta:r,over:o},e===Dt.DragEnd&&"function"==typeof i){await Promise.resolve(i(a))&&(e=Dt.DragCancel)}}F.current=null,i.unstable_batchedUpdates(()=>{C({type:e}),x(go.Uninitialized),ve(null),D(null),N(null),be.current=null;const t=e===Dt.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=L.current[t];null==e||e(a),b({type:t,event:a})}})}}be.current=a},[R]),ye=r.useCallback((e,t)=>(n,o)=>{const r=n.nativeEvent,l=R.get(o);if(null!==F.current||!l||r.dndKit||r.defaultPrevented)return;const i={active:l};!0===e(n,t.options,i)&&(r.dndKit={capturedBy:t.sensor},F.current=o,we(n,t))},[R,we]),xe=function(e,t){return r.useMemo(()=>e.reduce((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(u,ye);!function(e){r.useEffect(()=>{if(!nt)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(u),ct(()=>{_&&y===go.Initializing&&x(go.Initialized)},[_,y]),r.useEffect(()=>{const{onDragMove:e}=L.current,{active:t,activatorEvent:n,collisions:o,over:r}=X.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:o,delta:{x:ge.x,y:ge.y},over:r};i.unstable_batchedUpdates(()=>{null==e||e(l),b({type:"onDragMove",event:l})})},[ge.x,ge.y]),r.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=X.current;if(!e||null==F.current||!t||!r)return;const{onDragOver:l}=L.current,a=o.get(fe),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,d={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:s};i.unstable_batchedUpdates(()=>{ve(s),null==l||l(d),b({type:"onDragOver",event:d})})},[fe]),ct(()=>{X.current={activatorEvent:z,active:E,activeNode:K,collisionRect:he,collisions:me,droppableRects:P,draggableNodes:R,draggingNode:Q,draggingNodeRect:ee,droppableContainers:M,over:pe,scrollableAncestors:le,scrollAdjustedTranslate:ge},I.current={initial:ee,translated:he}},[E,K,me,he,R,Q,ee,P,M,pe,le,ge]),jn({...$,delta:k,draggingRect:he,pointerCoordinates:se,scrollableAncestors:le,scrollableAncestorRects:ie});const qe=r.useMemo(()=>({active:E,activeNode:K,activeNodeRect:_,activatorEvent:z,collisions:me,containerNodeRect:Z,dragOverlay:J,draggableNodes:R,droppableContainers:M,droppableRects:P,over:pe,measureDroppableContainers:H,scrollableAncestors:le,scrollableAncestorRects:ie,measuringConfiguration:B,measuringScheduled:U,windowRect:re}),[E,K,_,z,me,Z,J,R,M,P,pe,H,le,ie,B,U,re]),Se=r.useMemo(()=>({activatorEvent:z,activators:xe,active:E,activeNodeRect:_,ariaDescribedById:{draggable:O},dispatch:C,draggableNodes:R,over:pe,measureDroppableContainers:H}),[z,xe,E,_,C,O,R,pe,H]);return r.createElement(It.Provider,{value:w},r.createElement(ro.Provider,{value:Se},r.createElement(lo.Provider,{value:qe},r.createElement(uo.Provider,{value:Ce},c)),r.createElement(so,{disabled:!1===(null==s?void 0:s.restoreFocus)})),r.createElement(At,{...s,hiddenTextDescribedById:O}))}),mo=r.createContext(null),fo="button";function po(e){let{id:t,data:n,disabled:o=!1,attributes:l}=e;const i=vt("Draggable"),{activators:a,activatorEvent:s,active:d,activeNodeRect:c,ariaDescribedById:u,draggableNodes:g,over:h}=r.useContext(ro),{role:m=fo,roleDescription:f="draggable",tabIndex:p=0}=null!=l?l:{},v=(null==d?void 0:d.id)===t,C=r.useContext(v?uo:mo),[b,w]=mt(),[y,x]=mt(),q=function(e,t){return r.useMemo(()=>e.reduce((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e},{}),[e,t])}(a,t),S=gt(n);ct(()=>(g.set(t,{id:t,key:i,node:b,activatorNode:y,data:S}),()=>{const e=g.get(t);e&&e.key===i&&g.delete(t)}),[g,t]);return{active:d,activatorEvent:s,activeNodeRect:c,attributes:r.useMemo(()=>({role:m,tabIndex:p,"aria-disabled":o,"aria-pressed":!(!v||m!==fo)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[o,m,p,v,f,u.draggable]),isDragging:v,listeners:o?void 0:q,node:b,over:h,setNodeRef:w,setActivatorNodeRef:x,transform:C}}function vo(){return r.useContext(lo)}const Co={timeout:25};function bo(e){let{animation:t,children:n}=e;const[o,l]=r.useState(null),[i,a]=r.useState(null),s=ft(n);return n||o||!s||l(s),ct(()=>{if(!i)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{l(null)}):l(null)},[t,o,i]),r.createElement(r.Fragment,null,n,o?r.cloneElement(o,{ref:a}):null)}const wo={x:0,y:0,scaleX:1,scaleY:1};function yo(e){let{children:t}=e;return r.createElement(ro.Provider,{value:oo},r.createElement(uo.Provider,{value:wo},t))}const xo={position:"fixed",touchAction:"none"},qo=e=>yt(e)?"transform 250ms ease":void 0,So=r.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:l,children:i,className:a,rect:s,style:d,transform:c,transition:u=qo}=e;if(!s)return null;const g=l?c:{...c,scaleX:1,scaleY:1},h={...xo,width:s.width,height:s.height,top:s.top,left:s.left,transform:qt.Transform.toString(g),transformOrigin:l&&o?jt(o,s):void 0,transition:"function"==typeof u?u(o):u,...d};return r.createElement(n,{className:a,style:h,ref:t},i)}),Ro=e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:l,className:i}=e;if(null!=l&&l.active)for(const[e,t]of Object.entries(l.active))void 0!==t&&(r[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=l&&l.dragOverlay)for(const[e,t]of Object.entries(l.dragOverlay))void 0!==t&&o.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&o.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(r))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},ko={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:qt.Transform.toString(t)},{transform:qt.Transform.toString(n)}]},sideEffects:Ro({styles:{active:{opacity:"0"}}})};function Mo(e){let{config:t,draggableNodes:n,droppableContainers:o,measuringConfiguration:r}=e;return ut((e,l)=>{if(null===t)return;const i=n.get(e);if(!i)return;const a=i.node.current;if(!a)return;const s=Yn(l);if(!s)return;const{transform:d}=lt(l).getComputedStyle(l),c=Xt(d);if(!c)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:o,keyframes:r}={...ko,...e};return e=>{let{active:l,dragOverlay:i,transform:a,...s}=e;if(!t)return;const d={x:i.rect.left-l.rect.left,y:i.rect.top-l.rect.top},c={scaleX:1!==a.scaleX?l.rect.width*a.scaleX/i.rect.width:1,scaleY:1!==a.scaleY?l.rect.height*a.scaleY/i.rect.height:1},u={x:a.x-d.x,y:a.y-d.y,...c},g=r({...s,active:l,dragOverlay:i,transform:{initial:a,final:u}}),[h]=g,m=g[g.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const f=null==o?void 0:o({active:l,dragOverlay:i,...s}),p=i.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{p.onfinish=()=>{null==f||f(),e()}})}}(t);return mn(a,r.draggable.measure),u({active:{id:e,data:i.data,node:a,rect:r.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:l,rect:r.dragOverlay.measure(s)},droppableContainers:o,measuringConfiguration:r,transform:c})})}let To=0;function Io(e){return r.useMemo(()=>{if(null!=e)return To++,To},[e])}const Eo=r.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:l,transition:i,modifiers:a,wrapperElement:s="div",className:d,zIndex:c=999}=e;const{activatorEvent:u,active:g,activeNodeRect:h,containerNodeRect:m,draggableNodes:f,droppableContainers:p,dragOverlay:v,over:C,measuringConfiguration:b,scrollableAncestors:w,scrollableAncestorRects:y,windowRect:x}=vo(),q=r.useContext(uo),S=Io(null==g?void 0:g.id),R=co(a,{activatorEvent:u,active:g,activeNodeRect:h,containerNodeRect:m,draggingNodeRect:v.rect,over:C,overlayNodeRect:v.rect,scrollableAncestors:w,scrollableAncestorRects:y,transform:q,windowRect:x}),k=Un(h),M=Mo({config:o,draggableNodes:f,droppableContainers:p,measuringConfiguration:b}),T=k?v.setRef:void 0;return r.createElement(yo,null,r.createElement(bo,{animation:M},g&&S?r.createElement(So,{key:S,id:g.id,ref:T,as:s,activatorEvent:u,adjustScale:t,className:d,transition:i,rect:k,style:{zIndex:c,...l},transform:R},n):null))});function Fo(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Ao(e,t){return e.reduce((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e},Array(e.length))}function Do(e){return null!==e&&e>=0}const zo={scaleX:1,scaleY:1},No=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:l,index:i}=e;const a=null!=(t=n[r])?t:o;if(!a)return null;const s=function(e,t,n){const o=e[t],r=e[t-1],l=e[t+1];if(!o||!r&&!l)return 0;if(n<t)return r?o.left-(r.left+r.width):l.left-(o.left+o.width);return l?l.left-(o.left+o.width):o.left-(r.left+r.width)}(n,i,r);if(i===r){const e=n[l];return e?{x:r<l?e.left+e.width-(a.left+a.width):e.left-a.left,y:0,...zo}:null}return i>r&&i<=l?{x:-a.width-s,y:0,...zo}:i<r&&i>=l?{x:a.width+s,y:0,...zo}:{x:0,y:0,...zo}};const Lo=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const l=Fo(t,o,n),i=t[r],a=l[r];return a&&i?{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}:null},Oo="Sortable",jo=r.createContext({activeIndex:-1,containerId:Oo,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Lo,disabled:{draggable:!1,droppable:!1}});function Bo(e){let{children:t,id:n,items:o,strategy:l=Lo,disabled:i=!1}=e;const{active:a,dragOverlay:s,droppableRects:d,over:c,measureDroppableContainers:u}=vo(),g=vt(Oo,n),h=Boolean(null!==s.rect),m=r.useMemo(()=>o.map(e=>"object"==typeof e&&"id"in e?e.id:e),[o]),f=null!=a,p=a?m.indexOf(a.id):-1,v=c?m.indexOf(c.id):-1,C=r.useRef(m),b=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,C.current),w=-1!==v&&-1===p||b,y=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);ct(()=>{b&&f&&u(m)},[b,m,f,u]),r.useEffect(()=>{C.current=m},[m]);const x=r.useMemo(()=>({activeIndex:p,containerId:g,disabled:y,disableTransforms:w,items:m,overIndex:v,useDragOverlay:h,sortedRects:Ao(m,d),strategy:l}),[p,g,y.draggable,y.droppable,w,m,v,d,h,l]);return r.createElement(jo.Provider,{value:x},t)}const Vo=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return Fo(n,o,r).indexOf(t)},Po=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:l,newIndex:i,previousItems:a,previousContainerId:s,transition:d}=e;return!(!d||!o)&&((a===l||r!==i)&&(!!n||i!==r&&t===s))},Ho={duration:200,easing:"ease"},Uo="transform",Ko=qt.Transition.toString({property:Uo,duration:0,easing:"linear"}),Wo={roleDescription:"sortable"};function $o(e){let{animateLayoutChanges:t=Po,attributes:n,disabled:o,data:l,getNewIndex:i=Vo,id:a,strategy:s,resizeObserverConfig:d,transition:c=Ho}=e;const{items:u,containerId:g,activeIndex:h,disabled:m,disableTransforms:f,sortedRects:p,overIndex:v,useDragOverlay:C,strategy:b}=r.useContext(jo),w=function(e,t){var n,o;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(o,m),y=u.indexOf(a),x=r.useMemo(()=>({sortable:{containerId:g,index:y,items:u},...l}),[g,l,y,u]),q=r.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:S,node:R,isOver:k,setNodeRef:M}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:l}=e;const i=vt("Droppable"),{active:a,dispatch:s,over:d,measureDroppableContainers:c}=r.useContext(ro),u=r.useRef({disabled:n}),g=r.useRef(!1),h=r.useRef(null),m=r.useRef(null),{disabled:f,updateMeasurementsFor:p,timeout:v}={...Co,...l},C=gt(null!=p?p:o),b=Kn({callback:r.useCallback(()=>{g.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{c(Array.isArray(C.current)?C.current:[C.current]),m.current=null},v)):g.current=!0},[v]),disabled:f||!a}),w=r.useCallback((e,t)=>{b&&(t&&(b.unobserve(t),g.current=!1),e&&b.observe(e))},[b]),[y,x]=mt(w),q=gt(t);return r.useEffect(()=>{b&&y.current&&(b.disconnect(),g.current=!1,b.observe(y.current))},[y,b]),r.useEffect(()=>(s({type:Dt.RegisterDroppable,element:{id:o,key:i,disabled:n,node:y,rect:h,data:q}}),()=>s({type:Dt.UnregisterDroppable,key:i,id:o})),[o]),r.useEffect(()=>{n!==u.current.disabled&&(s({type:Dt.SetDroppableDisabled,id:o,key:i,disabled:n}),u.current.disabled=n)},[o,i,n,s]),{active:a,rect:h,isOver:(null==d?void 0:d.id)===o,node:y,over:d,setNodeRef:x}}({id:a,data:x,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...d}}),{active:T,activatorEvent:I,activeNodeRect:E,attributes:F,setNodeRef:A,listeners:D,isDragging:z,over:N,setActivatorNodeRef:L,transform:O}=po({id:a,data:x,attributes:{...Wo,...n},disabled:w.draggable}),j=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.useMemo(()=>e=>{t.forEach(t=>t(e))},t)}(M,A),B=Boolean(T),V=B&&!f&&Do(h)&&Do(v),P=!C&&z,H=P&&V?O:null,U=V?null!=H?H:(null!=s?s:b)({rects:p,activeNodeRect:E,activeIndex:h,overIndex:v,index:y}):null,K=Do(h)&&Do(v)?i({id:a,items:u,activeIndex:h,overIndex:v}):y,W=null==T?void 0:T.id,$=r.useRef({activeId:W,items:u,newIndex:K,containerId:g}),G=u!==$.current.items,_=t({active:T,containerId:g,isDragging:z,isSorting:B,id:a,index:y,items:u,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:c,wasDragging:null!=$.current.activeId}),Z=function(e){let{disabled:t,index:n,node:o,rect:l}=e;const[i,a]=r.useState(null),s=r.useRef(n);return ct(()=>{if(!t&&n!==s.current&&o.current){const e=l.current;if(e){const t=Jt(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==s.current&&(s.current=n)},[t,n,o,l]),r.useEffect(()=>{i&&a(null)},[i]),i}({disabled:!_,index:y,node:R,rect:S});return r.useEffect(()=>{B&&$.current.newIndex!==K&&($.current.newIndex=K),g!==$.current.containerId&&($.current.containerId=g),u!==$.current.items&&($.current.items=u)},[B,K,g,u]),r.useEffect(()=>{if(W===$.current.activeId)return;if(null!=W&&null==$.current.activeId)return void($.current.activeId=W);const e=setTimeout(()=>{$.current.activeId=W},50);return()=>clearTimeout(e)},[W]),{active:T,activeIndex:h,attributes:F,data:x,rect:S,index:y,newIndex:K,items:u,isOver:k,isSorting:B,isDragging:z,listeners:D,node:R,overIndex:v,over:N,setNodeRef:j,setActivatorNodeRef:L,setDroppableNodeRef:M,setDraggableNodeRef:A,transform:null!=Z?Z:U,transition:function(){if(Z||G&&$.current.newIndex===y)return Ko;if(P&&!yt(I)||!c)return;if(B||_)return qt.Transition.toString({...c,property:Uo});return}()}}function Go(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const _o=[wn.Down,wn.Right,wn.Up,wn.Left],Zo=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:l,over:i,scrollableAncestors:a}}=t;if(_o.includes(e.code)){if(e.preventDefault(),!n||!o)return;const t=[];l.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const l=r.get(n.id);if(l)switch(e.code){case wn.Down:o.top<l.top&&t.push(n);break;case wn.Up:o.top>l.top&&t.push(n);break;case wn.Left:o.left>l.left&&t.push(n);break;case wn.Right:o.left<l.left&&t.push(n)}});const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Pt(t),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=Pt(o),i=r.reduce((e,t,o)=>e+Ot(n[o],t),0),a=Number((i/4).toFixed(4));l.push({id:t,data:{droppableContainer:e,value:a}})}}return l.sort(Bt)})({collisionRect:o,droppableRects:r,droppableContainers:t});let d=Ht(s,"id");if(d===(null==i?void 0:i.id)&&s.length>1&&(d=s[1].id),null!=d){const e=l.get(n.id),t=l.get(d),i=t?r.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&i&&e&&t){const n=en(s).some((e,t)=>a[t]!==e),r=Xo(e,t),l=function(e,t){if(!Go(e)||!Go(t))return!1;if(!Xo(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),d=n||!r?{x:0,y:0}:{x:l?o.width-i.width:0,y:l?o.height-i.height:0},c={x:i.left,y:i.top};return d.x&&d.y?c:wt(c,d)}}}};function Xo(e,t){return!(!Go(e)||!Go(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const Yo=e=>{let{transform:t}=e;return{...t,y:0}},Jo=r.memo(r.forwardRef((e,t)=>{const{children:o,style:r,className:l,index:i,editing:a,editable:s,selectedIndex:d,background:c,activeColor:u,borderColor:g,borderWidth:h,dragging:m,...f}=e;return n.jsxs("div",{ref:t,className:V(l),style:{...r,display:"flex",flexDirection:"column",background:d===i?"white":c,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:d===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...f,children:[n.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[n.jsx("div",{style:{marginLeft:d===i?"0px":"-1px",marginTop:d===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),o,d===i?n.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):n.jsx(n.Fragment,{})]}),n.jsx("div",{style:{flex:"1 1 100%",background:d===i&&u?u?.toCSS():"none",minHeight:"2px"}})]})})),Qo={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},er=r.memo(r.forwardRef(({color:e,dragOverlay:t,dragging:o,disabled:l,fadeIn:i,handle:a,height:s,index:d,listeners:c,onRemove:u,renderItem:g,sorting:h,style:m,transition:f,transform:p,value:v,wrapperStyle:C,...b},w)=>{r.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const y=g?g({dragOverlay:Boolean(t),dragging:Boolean(o),sorting:Boolean(h),index:d,fadeIn:Boolean(i),listeners:c,ref:w,style:m,transform:p,transition:f,value:v}):n.jsx(n.Fragment,{children:v});return n.jsx("div",{className:V("tab-item",Qo.Wrapper,i&&Qo.fadeIn,h&&Qo.sorting,t&&Qo.dragOverlay),style:{...C,transition:[f,C?.transition].filter(Boolean).join(", "),"--translate-x":p?`${Math.round(p.x)}px`:void 0,"--translate-y":p?`${Math.round(p.y)}px`:void 0,"--scale-x":p?.scaleX?`${p.scaleX}`:void 0,"--scale-y":p?.scaleY?`${p.scaleY}`:void 0,"--index":d},ref:w,children:n.jsx("div",{className:V(Qo.Item,o&&Qo.dragging,a&&Qo.withHandle,t&&Qo.dragOverlay,l&&Qo.disabled,e&&Qo.color,"dragging"),style:m,"data-cypress":"draggable-item",...a?void 0:c,...b,tabIndex:a?void 0:-1,children:y})})})),tr={Row:"_Row_1kr10_1"},nr=r.memo(r.forwardRef(({children:e,horizontal:t,style:o},r)=>n.jsx("div",{ref:r,style:{...o},className:V(tr.Row,t&&tr.horizontal),children:e}))),or={...ko},rr=r.memo(r.forwardRef((e,o)=>{const{className:l,activationConstraint:a,animateLayoutChanges:s,adjustScale:d=!1,collisionDetection:c=Kt,coordinateGetter:u=Zo,dropAnimation:g=or,getItemStyles:h=()=>({}),getNewIndex:m,handle:f=!1,items:p,onMove:v,isDisabled:C=()=>!1,measuring:b,modifiers:w,renderItem:y,renderDivider:x,reorderItems:q=Fo,strategy:S=Lo,style:R,useDragOverlay:k=!0,onDragStart:M,wrapperStyle:T=()=>({})}=e,[I,E]=r.useState(()=>p);r.useEffect(()=>{E(p)},[p]);const[F,A]=r.useState(null),D=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.useMemo(()=>[...t].filter(e=>null!=e),[...t])}(Nt(Dn,{activationConstraint:a}),Nt(Nn,{activationConstraint:a}),Nt(Rn,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:u})),z=I.indexOf.bind(I),N=F?z(F):-1,L=[];I.map((e,t)=>{L.push(n.jsx(lr,{id:e,handle:f,index:t,style:h,wrapperStyle:T,disabled:C(e),renderItem:y,animateLayoutChanges:s,useDragOverlay:k,getNewIndex:m},e+"-"+t));const o=x?.({key:"divider-"+t});o&&L.push(o)});const{getPortalContainer:O}=t.useFullscreenPortal();return n.jsxs(ho,{sensors:D,collisionDetection:c,onDragStart:e=>{const{active:t}=e;t&&(M?.(e),A(t.id))},autoScroll:{canScroll:e=>!0},onDragEnd:e=>{if(A(null),e.over){const t=z(e.over.id);N!==t&&(E(e=>q(e,N,t)),v?.(N,t))}},onDragCancel:()=>{A(null)},measuring:b,modifiers:w,children:[n.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...R},className:V(l,Qo.Wrapper),children:n.jsx(Bo,{items:I,strategy:S,children:n.jsx(nr,{ref:o,children:L})})}),k?i.createPortal(n.jsx(Eo,{adjustScale:d,dropAnimation:g,children:F?n.jsx(er,{value:I[N],handle:f,renderItem:y,wrapperStyle:T({index:N,isDragging:!0,id:I[N]}),index:N,dragging:!0,style:h({id:I[N],index:N,isSorting:null!==F,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),O()):null]})}));function lr({disabled:e,animateLayoutChanges:t,getNewIndex:o,handle:r,id:l,index:i,onRemove:a,style:s,renderItem:d,useDragOverlay:c,wrapperStyle:u}){const{attributes:g,isDragging:h,isSorting:m,listeners:f,overIndex:p,setNodeRef:v,transform:C,transition:b}=$o({id:l,animateLayoutChanges:t,disabled:e,getNewIndex:o});return n.jsx(er,{ref:v,value:l,disabled:e,dragging:h,sorting:m,handle:r,renderItem:d,index:i,style:s({index:i,id:l,isDragging:h,isSorting:m,overIndex:p}),onRemove:a?()=>a(l):void 0,transform:C,transition:b,wrapperStyle:u({index:i,isDragging:h,id:l}),listeners:f,"data-index":i,"data-id":l,dragOverlay:!c&&h,...g})}const ir="_TabStrip_3x0dp_1",ar=new e.Color("rgb(33, 115, 70)"),sr="#eee",dr=e=>n.jsx(Jo,{...e}),cr=r.memo(r.forwardRef((e,o)=>{const{children:l,style:i,className:a,selectedTabIndex:s=0,tabNames:d=[],onSelectedTabIndexChange:c,onTabNameChange:u,onTabMove:g,createScrollStartButton:h=t.defaultCreateScrollStartButton,createScrollEndButton:m=t.defaultCreateScrollEndButton,createScrollEdgeButton:f=t.defaultCreateScrollEdgeButton,createTabButton:p=dr,createTabDivider:v,editLabelProps:C,disabled:b=!1,disableDrag:w=!1,background:y="white",activeColor:x=ar,borderColor:q=sr,borderWidth:S=1}=e,[R,k]=r.useState(s),[M,I]=r.useState(d),E=r.useCallback(e=>{const t=O.current?.[e]?.closest(".tab-item")??O.current?.[e];t&&W.current?.scrollTo({top:t.offsetTop,left:t.offsetLeft,behavior:"smooth"})},[]);r.useEffect(()=>{E(s)},[s]);const F=r.useCallback((e,t)=>{t!==R&&(k(t),c?.(t)),E(t)},[c,R]),A=r.useCallback((e,t)=>{g?.(e,t)},[g]),D=r.useRef(null),[z,N]=r.useState(-1),L=r.useCallback((e,t)=>{u?.(e,t)},[u]);r.useLayoutEffect(()=>{k(s)},[s]),r.useLayoutEffect(()=>{I(d)},[d]);const O=r.useRef([]),j=r.useRef(null);r.useImperativeHandle(o,()=>Object.assign({startEdit(e){O.current?.[e]?.startEdit()},cancel(e){O.current?.[e]?.cancel()}},j.current),[R,z]);const B=r.useCallback(({value:e,index:t,dragging:o})=>{const{style:r,maxLength:l,...i}=C||{},a=n.jsx(tt,{ref:e=>{O.current[t]=e},value:e,disabled:b,maxLength:l,style:{color:R===t&&x?x?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...r},styleHover:{},onSubmit:e=>(D.current=!1,N(-1),L(t,e)),onCancel:()=>{D.current=!1,N(-1)},onChange:e=>{D.current=!0,N(t)},...i});return p({onClick:e=>F(e,t),value:e,index:t,editing:z===t&&D.current,editable:!0,disabled:b,selectedIndex:R,background:y,activeColor:x,borderColor:q,borderWidth:S,dragging:o,children:a})},[R,L,F,C,b,z,p]),[P,{width:H}]=T(),[U,{width:K}]=T(),W=r.useRef(null),[$,G]=r.useState({left:0,top:0,width:0,height:0}),[_,Z]=r.useState(null);r.useEffect(()=>{null!==_&&W.current&&W.current.scrollTo({left:_,behavior:"smooth"})},[_]);const X=r.useCallback((e,n=!1)=>{if(!W.current)return 0;let o=W.current.firstChild.getBoundingClientRect(),r=W.current.firstChild.firstChild.children,l=0;return l=n?0:t.ScrollUtils.getScrollTo(e,o.left,r,!0,Math.max(0,e-200)),Z(l),Math.max(0,l)},[]),Y=r.useCallback((e,n=!1)=>{if(!W.current)return 0;let o=W.current.firstChild.getBoundingClientRect(),r=W.current.firstChild.firstChild.children,l=0;const i=Math.ceil(K-H);return l=n?i:t.ScrollUtils.getScrollTo(e,o.left,r,!1,Math.max(0,e+200)),Z(l),Math.min(i,l)},[K,H]),J=r.useRef(null),Q=r.useRef(null),ee=r.useCallback(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null,J.current=null)},[]),te=r.useCallback((e,t,n=260)=>{J.current=e,Q.current=setTimeout(()=>{const n=t?X(J.current||e):Y(J.current||e);n!==J.current?te(n,t,120):ee()},n)},[X,Y,ee]);r.useEffect(()=>()=>ee(),[ee]);const ne=r.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor($.left)<=0||0===Math.floor(K-H),orientation:t.ScrollbarOrientation.Horizontal,onMouseUp:ee,onMouseLeave:ee,onMouseDown:()=>te(W.current.scrollLeft,!0),onClick:e=>X(Math.min(W.current.scrollLeft,_??Number.MAX_SAFE_INTEGER),e.ctrlKey)}),[$,_,K,H]),oe=r.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(K-H)<=Math.ceil($.left),orientation:t.ScrollbarOrientation.Horizontal,onMouseUp:ee,onMouseLeave:ee,onMouseDown:()=>te(W.current.scrollLeft,!1),onClick:e=>Y(Math.max(W.current.scrollLeft,_??0),e.ctrlKey)}),[$,_,K,H]),re=r.useMemo(()=>n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{minWidth:"16px"}}),l,f?.(ne)]}),[ne,oe,h,m,l,f]);return n.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:V(ir,a),ref:j,children:[n.jsx("div",{style:{borderTop:`solid ${q} ${S}px`,position:"absolute",width:"100%"}}),n.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:re}),n.jsx("div",{className:"Tabs",ref:P,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:n.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:W,onScroll:e=>{G({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:n.jsx(rr,{isDisabled:e=>b||w,items:M,strategy:No,modifiers:[Yo],ref:U,renderItem:B,renderDivider:v,onMove:A,activationConstraint:{distance:15}})})}),n.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:f(oe)})]})}));cr.displayName="TabStrip";const ur=r.createContext(null),gr="_script-editor_iy654_5",hr=r.lazy(()=>Promise.resolve().then(()=>require("./BzWYAy7dpLOCOqnE.cjs"))),mr={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:"~!@#$%^&*()-=+[{]}|;:'\",.<>/?",wordWrap:"off",wordWrapBreakAfterCharacters:"\t})]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},fr=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(o.uri),i=await l.getNavigationTree(o.uri.toString()),a=e.getPosition();let s={...a};s.lineNumber=1,s.column=1;let d=!1;for(let e=a.lineNumber;e>=1;e--){if(""===o.getLineContent(e).trim()){const t=Cr(i,o.getOffsetAt({lineNumber:e,column:1}),"function");if(!t||br(t)){d=!0,s.lineNumber=e+1;break}{const n=t.spans[0].start;e=o.getPositionAt(n).lineNumber,s.lineNumber=e}}}let c=n,u=!1;!d&&!c.startsWith("\n")&&s.lineNumber>1&&(c="\n"+c,u=!0);let g=!1;o.getLineCount()>1&&(c.endsWith("\n\n")||(c+="\n\n",g=!0));const h=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${c}`}];let m=null;o.pushEditOperations([],h,e=>(m=e[0].range,u&&m.startLineNumber++,g&&m.endLineNumber--,[new t.Selection(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)])),e.setSelection({startLineNumber:m.endLineNumber,startColumn:m.endColumn,endLineNumber:m.startLineNumber,endColumn:m.startColumn})};function pr(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function vr(e,t,n,o,r=[]){if("function"===o.kind&&"export"===o.kindModifiers){const t=o.spans[0].start,l=e.getPositionAt(t);r.push({name:o.text,type:pr(n,o),lineNumber:l.lineNumber})}if(o.childItems)for(const l of o.childItems)vr(e,t,n,l,r);return r}function Cr(e,t,n="function",o){const r=e.spans;for(let l=0;l<r.length;l++){const i=r[l];if(i.start<=t&&t<i.start+i.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const r of e.childItems||[]){const e=Cr(r,t,n,o);if(e)return e}}return null}}function br(e){return"comment"===e.kind}const wr=r.memo(r.forwardRef((e,l)=>{const{className:i,style:a,commands:s,readOnly:d=!1,onClose:c,darkMode:u,loadingPanel:g,autoFocus:h=!0,onStatusChange:m,...f}=e,p=r.useRef(null),v=t.useCallbackRef(c,[c]),C=r.useRef(!1),b=r.useMemo(()=>({contains(e){if(!p.current)return;const t=p.current.editor;return t&&t.getDomNode()?.contains(e)},focus(){if(!p.current)return;const e=p.current.editor;return e&&e.getDomNode()?.focus()}}),[]),w=r.useMemo(()=>[new t.Command("help",b,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),y=r.useMemo(()=>{let e=null;const n=()=>b;return e=s?s.createChildGroup(n,"scriptEditor",!1):new t.CommandGroup(n,"scriptEditor"),e.addCommands(w,!0),e},[s,w]),x=t.useCommands(y,["executeSelectedScript"])[0],q=x?.context(),S=t.useCallbackRef(e=>{x?.execute(e)},[x]),R=r.useRef(""),[k,M]=r.useState(!1),T=t.useCallbackRef(async()=>{if(!p.current)return null;const e=p.current,t=e.editor;if(!t)return null;const n=e.monaco,o=await(async(e,t,n="export")=>{const o=e.getModel();if(!o)return null;const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(o.uri),i=await l.getNavigationTree(o.uri.toString());let a=null,s=e.getSelection();const d=s.startLineNumber===s.endLineNumber&&s.startColumn===s.endColumn?o.getLineCount():Math.min(s.endLineNumber,o.getLineCount());for(let e=s.startLineNumber;!a&&e<=d;e++){const t=Cr(i,o.getOffsetAt({lineNumber:e,column:1}),"function",n);t&&(a=t.text)}return a})(t,n);return m?.({message:(o??"").toUpperCase()}),o?{source:t.getValue(),name:o}:null},[m]);const I=t.useCallbackRef(async(e,t,n)=>{const r=await q.getScripts().createModule({source:n?.getValue(),declarationsOnly:!0}),l=r?r.getFunctions().search():o.CommonUtils.EmptyArray;r&&(async function(e,t){const n=[];for(let o=1;o<e.getLineCount()+1;o++){const r={startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:e.getLineLength(o)+1},l=e.getValueInRange(r).indexOf("modelt");-1!==l&&n.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:t.MarkerSeverity.Hint,startLineNumber:r.startLineNumber,startColumn:l+1,endLineNumber:r.startLineNumber,endColumn:l+5})}t.editor.setModelMarkers(e,"owner",n)}(e,t),async function(e,t,n,o){const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(e.uri),i=await l.getNavigationTree(e.uri.toString()),a=vr(e,t,o,i).map(e=>{let n=null,o=null;return"formula"===e.type?(n="formula.margin-icon",o="Formula"):"macro"===e.type?(n="macro.margin-icon",o="Macro"):"autoRun"===e.type&&(n="autorun.margin-icon",o="Auto Run"),{range:new t.Range(e.lineNumber,1,e.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:n,glyphMarginHoverMessage:o,stickiness:t.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});D.current&&D.current.clear(),D.current=n.createDecorationsCollection(a)}(e,t,n,l))},[q]),E=t.useCallbackRef(o.CommonUtils.debounce(I,580),[]),F=t.useCallbackRef(async(e=void 0)=>{if(!p.current||!q)return;const t=p.current.editor.getPosition(),n={cursor:t?t.toString():""};void 0!==e&&(n.message=e),m?.(n);const o=T();q.setSelectedFunction(o)},[q,m]);r.useEffect(()=>{if(!q)return;const e={insertSnippet:e=>{p.current?.editor&&(k?fr(p.current.editor,p.current.monaco,e):R.current=e)}};q.setEditor(e),q.setSelectedFunction(T());const t=q.addContainerListener({onBeforeSave:async()=>{if(!p.current?.editor||!q)return;const e=p.current.editor,t=q?.getScripts().getModules().getByName("scripting"),n=t?.getSource(),o=e.getValue();if(!((n?.length??0)!==o.length||n!==o))return;await q.saveSource(e.getValue());const r=(n?.length??0)!==o.length||n!==o;m?.({dirty:r})},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!q)return;const e=p.current.editor,t=q.getScripts().getModules().search()[0]?.getSource()??"";e.setValue(t)}});return()=>{t(),q.setSelectedFunction(null),q.setEditor(null)}},[q,k]),r.useEffect(()=>()=>{if(!p.current?.editor)return;const e=p.current.editor;q?.saveSource(e.getValue())},[]);const A=t.useCallbackRef(e=>{const t=p.current;if(!t)return!1;const n=t.editor;return!!n&&(n.focus(),!0)},[]),D=r.useRef(null),z=t.useCallbackRef((e,t)=>{p.current={monaco:t,editor:e},M(!0),F("Loading Types");const n=q.getScripts().getModules().search()[0]?.getSource()??"";e.setValue(n),Promise.resolve().then(()=>require("./CFVxx0I-M-vqu3xC.cjs")).then(e=>e.customEditor).then(n=>{F("");n.AutoTypings.create(e,{shareCache:!0,monaco:t,onError:e=>{"Not implemented yet"===e&&(e="Compile Errors"),console.warn("Error compiling types",e)}}).then(async n=>{const o=e.getModel();E(o,t,e)})}),e.addCommand("executeScript",function(e,...t){t?.[0]&&S({functionName:t?.[0]})},""),e.addAction({id:"executeScript",label:"Execute",keybindings:[t.KeyCode.F8],run:async e=>{const t=T();q.setSelectedFunction(t);const n=await t;S(n)}}),e.addAction({id:"saveScript",label:"Save Script",keybindings:[t.KeyMod.CtrlCmd|t.KeyCode.KeyS],run:t=>{q?.saveSource(e.getValue()).then(()=>{const t=q?.getScripts().getModules().getByName("scripting"),n=t?.getSource(),o=e.getValue(),r=(n?.length??0)!==o.length||n!==o;m?.({dirty:r})})}}),e.onMouseDown(async n=>{if(n.target.type===t.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const r=n.target.position.lineNumber,l=await t.languages.typescript.getTypeScriptWorker(),i=await l(o.uri),a=await i.getNavigationTree(o.uri.toString()),s=e?.getValue(),d=(await(q?.saveSource(s))).getFunctions().search(),c=vr(o,t,d,a).find(e=>e.lineNumber===r);if(c){const e=n.event.browserEvent.button;0===e?"macro"===c.type||"autoRun"===c.type?S({functionName:c.name}):"formula"===c.type&&q.quickInsertFunction?.(c.name):2===e&&(console.log("Context menu for function:",c.name),n.event.browserEvent.preventDefault())}}}),e.onDidChangeModelContent(()=>{const n=e.getModel();E(n,t,e)});const o=e.getModel();!function(e,t){t.languages.registerInlayHintsProvider("typescript",{provideInlayHints(e,n,o){const r=[];for(let n=1;n<e.getLineCount()+1;n++){const o={startLineNumber:n,startColumn:1,endLineNumber:n,endColumn:e.getLineLength(n)+1},l="hint",i=e.getValueInRange(o).indexOf("hint");-1!==i&&r.push({kind:t.languages.InlayHintKind.Type,position:{lineNumber:o.startLineNumber,column:i+l.length+1},label:"[hint]"})}return{hints:r,dispose:()=>{}}}})}(0,t),o.onDidChangeContent(t=>{const n=q?.getScripts().getModules().getByName("scripting"),o=n?.getSource(),r=e.getValue(),l=(o?.length??0)!==r.length||o!==r;m?.({dirty:l})}),e.onDidChangeCursorPosition(e=>{F()})},[q,m]),N=r.useMemo(()=>k?null:g||n.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[k,g]),L=r.useMemo(()=>{const e=q?.getScripts().getModules().getByName("scripting")?.getSource()??"";return n.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[n.jsx(r.Suspense,{children:n.jsx(hr,{theme:u?"extended-dark":"extended",options:{...mr,fixedOverflowWidgets:!0,readOnly:d},language:"typescript",value:e,onValidate:e=>{let t=!1;for(let n=0;!t&&n<e?.length;n++)8===e[n].severity&&(t=!0)},beforeMount:e=>{e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),e.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),e.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}});(async()=>{let t=!1;try{const n=await(async()=>{const e=await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts");return await e.text()})(),o=e.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),r=e.editor.createModel(n,"typescript",o);e.editor.setModelMarkers(r,"default",[]),t=!0}catch(e){console.warn("cant load types",e)}e.languages.registerLinkProvider("*",{provideLinks:(t,n)=>{const o=[],r={links:o},l=t.getLinesContent();for(let n=1;n<=l.length;n++){const r=l[n-1],i=e.editor.tokenize(r,"typescript");for(let l=0;l<i[0].length;l++){const a=i[0]?.[l];if(a&&a.type.startsWith("string")){let s=a.offset,d=i[0]?.[l+1]?.offset??r.length,c=new e.Range(n,s+1,n,d+1),u=t.getValueInRange(c);const g=u[0];"`"!==g&&"'"!==g&&'"'!==g||(s++,u=u.substring(1));const h=u[u.length-1];"`"!==h&&"'"!==h&&'"'!==h||(s++,u=u.substring(0,u.length-1));try{q.getRanges(u)&&o.push({range:{endColumn:d,endLineNumber:n,startColumn:s,startLineNumber:n},tooltip:`Goto range '${u}'`,url:`/range/${u}`})}catch(e){console.warn(e)}}}}return r}}),e.editor.registerLinkOpener({open(e){if(e?.path?.startsWith("/range/")){try{q.getRanges(e.path.substring(7))?.select()}catch(e){console.warn("invalid range",e)}return!0}return!1}});const n=e.languages.typescript.typescriptDefaults.getCompilerOptions();e.languages.typescript.typescriptDefaults.setCompilerOptions({...n,target:e.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),R.current&&(await fr(p.current.editor,p.current.monaco,R.current),R.current=null),C.current&&requestAnimationFrame(async()=>{C.current&&e.editor.focus()}),e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),M(!0)})()},onMount:z})}),N]})},[q,y,d,N,u]),O=t.useImperativeElement(l,()=>({isScriptEditorElement:()=>!0,focus:e=>{A(e)},close:()=>{v?.()},getEditor:()=>q?.getEditor()}),[q]);return r.useEffect(()=>(h&&requestAnimationFrame(()=>{A()}),()=>{p.current?.editor&&requestAnimationFrame(()=>{O.current?.contains(document.activeElement)&&A()})}),[]),n.jsx("div",{className:V("script-editor",gr,i),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...a},ref:O,...f,children:L})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>e.LicenseManager}),exports.ChartAreaIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),n.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),n.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),n.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),n.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),n.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),n.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),n.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),n.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),n.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),n.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),n.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),n.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),n.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),n.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),n.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),n.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),n.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),n.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),n.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),n.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),n.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),n.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),n.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),n.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),n.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),n.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),n.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),n.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),n.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=Je,exports.ChartLineIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z"}),n.jsx("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z"})]}),exports.ChartLineMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z"}),n.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z"}),n.jsx("path",{className:"styled info",d:"M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z"})]}),exports.ChartLineStackedIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),n.jsx("path",{className:"styled info",d:"M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),n.jsx("path",{className:"styled info",d:"M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z"})]}),exports.ChartLineStackedPercentIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),n.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),n.jsx("path",{className:"styled info",d:"M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z"})]}),exports.ChartPieDoughnutIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z"}),n.jsx("path",{className:"styled background",d:"M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z"}),n.jsx("path",{className:"styled current_color",d:"M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z"}),n.jsx("path",{className:"styled info_light",d:"M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z"})]}),exports.ChartPieIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z"}),n.jsx("path",{className:"styled background",d:"M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z"}),n.jsx("path",{className:"styled current_color",d:"M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z"}),n.jsx("path",{className:"styled info_light",d:"M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z"})]}),exports.ChartScatterLinesIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z"}),n.jsx("path",{className:"styled info",d:"M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z"}),n.jsx("path",{className:"styled current_color",d:"M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartScatterLinesMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z"}),n.jsx("path",{className:"styled background",d:"M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z"}),n.jsx("path",{className:"styled info",d:"M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z"}),n.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z"}),n.jsx("path",{className:"styled background",d:"M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z"}),n.jsx("path",{className:"styled info",d:"M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z"}),n.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z"})]}),exports.ChartScatterLinesSmoothIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z"}),n.jsx("path",{className:"styled info",d:"M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z"})]}),exports.ChartScatterMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"}),n.jsx("path",{className:"styled background",d:"M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z"}),n.jsx("path",{className:"styled info",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"})]}),exports.CommandContext=Ze,exports.CornerTriangle=g,exports.DateUtils=s,exports.DocThemesContext=ur,exports.DocThemesProvider=e=>{const{themes:t,children:o}=e;return n.jsx(ur.Provider,{value:t,children:o})},exports.EditableLabel=tt,exports.EmptyFrame=Ne,exports.FilterButton=h,exports.FontUtils=u,exports.Item=er,exports.LogoNoPaddingIcon=e=>n.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[n.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),n.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),n.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),n.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=U,exports.MovableArea=Fe,exports.PictureEditor=Ye,exports.Row=nr,exports.ScriptEditor=wr,exports.SheetCellEditor=C,exports.SheetCellRenderer=m,exports.SheetElement=_e,exports.SheetScrollbar=ie,exports.StaticBorderRenderer=j,exports.StyledStrokePath=w,exports.Tab=Jo,exports.TabStrip=cr,exports.createCellEditStateFromCell=b,exports.useBordersOverlay=A,exports.useDocThemes=()=>{const t=r.useContext(ur),[n]=r.useState(()=>new e.ThemeCollection);return r.useMemo(()=>t||n,[t])},exports.useModelListener=W,exports.useMovableCommands=ze,exports.useRangeListener=(e,t,n,o)=>{const l=r.useRef(n);l.current=n;const i=o?.fireOnAddressChange??!0;r.useEffect(()=>{if(!e||!t||!l.current){const e={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void l.current?.(e)}const n=e=>{l.current?.(e)},r=e.getRange(t).addListener(n,o);if(i){const o=e.getRange(t);n({getSource:()=>o,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{r?.()}},[e,t])},exports.useSheetCommands=G,exports.useSheetCopyPaste=ve,Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
13
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@sheetxl/sdk"),t=require("@sheetxl/utils-react"),n=require("react/jsx-runtime"),o=require("@sheetxl/utils"),r=require("react"),l=require("@sheetxl/grid-react"),i=require("react-dom"),a=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),s=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:a},Symbol.toStringTag,{value:"Module"})),d=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),c=(e,t=!0,n=d)=>{if(!n||0===n.length)return e;if(void 0===e)return n[0];if(t&&e>=n[n.length-1])return e;if(!t&&e<=n[0])return e;let r=o.CommonUtils.findEqualOrGreater(n,e);return t?(n[r]===e&&(r+=1),n[r]||(r-=1),n[r]):(r-=1,n[r])},u=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:d,findNextFontSize:c},Symbol.toStringTag,{value:"Module"})),g=r.memo(e=>{const{anchorLocation:t=o.AnchorLocation.TopLeft,cellWidth:r,cellHeight:l,size:i=7,inset:a=1,darkMode:s,fill:d,pathProps:c,style:u,...g}=e,h=i,m=a;let f="red",p=[],v=[];return t===o.AnchorLocation.TopLeft?(f=s?"rgb(255, 198, 246)":"green",p.push(m),v.push(m),p.push(m+h),v.push(m),p.push(m),v.push(m+h)):t===o.AnchorLocation.TopRight?(f=s?"rgb(0, 255, 255)":"red",p.push(r-m),v.push(m),p.push(r-(m+h)),v.push(m),p.push(r-m),v.push(m+h)):t===o.AnchorLocation.BottomRight?(f=s?"rgb(236, 252, 211)":"purple",p.push(r-m),v.push(l-m),p.push(r-(m+h)),v.push(l-m),p.push(r-m),v.push(l-(m+h))):t===o.AnchorLocation.BottomLeft&&(f=s?"rgb(255, 236, 183)":"blue",p.push(m),v.push(l-m),p.push(m+h),v.push(l-m),p.push(m),v.push(l-(m+h))),n.jsx("svg",{width:`${r}`,height:`${l}`,viewBox:`0 0 ${r} ${l}`,style:{position:"absolute",width:`${r}px`,height:`${l}px`,pointerEvents:"none",...u},...g,children:n.jsx("path",{d:`M ${p[0]} ${v[0]} L ${p[1]} ${v[1]} L ${p[2]} ${v[2]} L ${p[0]} ${v[0]} Z`,fill:d??f,...c})})}),h=e=>{const{renderBounds:t,darkMode:o,zoom:l,disabled:i,filter:a,onFilterButtonMouseDown:s,style:d,...c}=e,u=r.useMemo(()=>{let e=null;const t=a.getSortField();t&&(e=t.reverse);const n=a.getField(),o=n&&n.criteria&&n.criteria.length>0;return!0===e?o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":!1===e?o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":o?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"m 3,5.025 4.5,5 4.5,-5 z"},[a]),[g,h]=r.useState(!1);const m=Math.min(Math.min(18,t.height-8),t.width);return n.jsx("div",{style:{width:`${m}px`,height:`${m}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${g&&!i?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(m>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:i?void 0:"pointer",...d},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onMouseDown:e=>{s?.(e,a)},...c,children:n.jsx("svg",{width:""+15*l,height:""+15*l,viewBox:"0 0 15 15",style:{fill:`var(${g&&!i?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:i?.6:1},children:n.jsx("path",{d:u})})})},m=r=>{const{value:l,coords:i,bounds:a,children:s,style:d,range:c,zoom:u=1,view:m,bodyStyle:f,normalStyle:p,showFormulas:v,showZeros:C,docTheme:b,onLinkMouseDown:w,onFilterButtonMouseDown:y,filterButtonProps:x,createFilterButton:q=h,...S}=r,R=a.height/u,k=a.width/u,M=l,T=M.getValue(),I=l.getStyle(),E=f?.darkMode??!1;let F,A;const D=T&&T.isFormulaError,z=D&&T instanceof e.FormulaError.Parse;let N,L=v||z;if(L)if(M.isSpillOverflow())A="";else{const t=M.getFormulaText();t?A=t:F=M.getNumberFormat(e.NumberFormat.Type.General)}else F=M.getNumberFormat();L||(N=M.getTextOverflow());const O=N?N.colBounds.width+N.leftOffset+N.rightOffset:k,j=N?N.anchorBounds.x-N.leftOffset:0,B=N?N.anchorBounds.width:k,V=N?N.anchorBounds.x:0;let P,H=M.getRenderHorizontalAlignment();F&&(P=F?.formattedRuns,A=P?.runs[0]?.text??F.displayText);const U=M.getCalcStatus()===e.ICell.CalcStatus.Pending;let K=null,W=I.getFill().toCSS(E,a),$=0,G=0;if(!I.getBorder().isEmpty()){const t=I.getBorder().getRight();!t.isNone()&&e.IBorder.BuiltInDefinitions.get(t.getStyle()).width>1&&($=1);const n=I.getBorder().getBottom();!n.isNone()&&e.IBorder.BuiltInDefinitions.get(n.getStyle()).width>1&&(G=1)}let _=null;if(k!==B||$||G||"number"==typeof W?.backgroundPosition){const{backgroundPosition:e,...o}=W,r=e??0,l=m?.getScrollTopLeft(),i=r?-(a.x+(l.left??0))%r:0,s=r?-(a.y+(l.top??0))%r:0;(void 0!==e||$||G||k!==B)&&(1===Object.keys(o).length&&"none"===o.background||(W=null,_=n.jsx("div",{className:"fill",style:{marginLeft:`${i}px`,marginTop:`${s}px`,left:V*u,width:t.ReactUtils.boundPixel(B*u-i+1+$),height:t.ReactUtils.boundPixel(a.height-s+1+G),...o}},"background")))}let Z=null;const X=M.getComments(),Y=M.getWarnings(),J=M.getErrors();if(X||D||J.length>0||Y.length>0){const e={size:7*u,darkMode:E,cellWidth:B*u+2,cellHeight:R*u+2,style:{top:-1,left:V*u-1}};Z=Z??[],(Y.length>0||J.length>0||D)&&Z.push(n.jsx(g,{anchorLocation:o.AnchorLocation.TopLeft,...e},`indicator-${Z.length}`)),X&&Z.push(n.jsx(g,{anchorLocation:o.AnchorLocation.TopRight,...e},`indicator-${Z.length}`))}const Q=I.getFont();let ee=F?.conditionalColor;const te=I.getAlignment(),ne=te.getHorizontal()===e.ITextFrame.HorizontalAlignment.Fill,oe=te.getHorizontal()===e.ITextFrame.HorizontalAlignment.CenterContinuous||ne,re=oe||L?0:te.getRotation(),le=M.getInsets(),ie=le.top+le.bottom;let ae=le.left,se=le.right;const de={...d,left:d.left-1,top:d.top-1,width:d.width+1+$,height:d.height+1+G},ce=M.getColumnFilter(),ue=ce&&!ce?.hasHiddenButton();let ge=null;U&&(ge=n.jsxs("div",{className:"slider",children:[n.jsx("div",{className:"line"}),n.jsx("div",{className:"subline inc"})]},"pending"));const he=!(U||ue||_||s||Z||P?.runs.length>1||N||re%360!=0);"none"===W?.background&&(W=null);let me=oe||!(!N||!(N.rightIndex>0||N.leftIndex>0||N.colSpan>1));if(!me){const e=M.getSpans();(e.width>1||e.height>1)&&(me=!0)}const fe={...W,...de,pointerEvents:w?"auto":void 0};if(!o.CommonUtils.isEmpty(A)||!o.CommonUtils.isEmpty(F?.repeatPlaceholder)){const t=F?.canWrap??!1;let r=null,l=null,i=null,a=[],s=!0;C||L||0!==T||(s=!1);const c=M.getTextFrame(L);if(s&&c){let s=O-1-(ae+se);if(re){const t=c.layout();r=t.bounds;const n={x:0,y:0,width:O-1,height:R};if(P){let t=P.width;if(F.repeatPlaceholder||F.repeatChars.length>0){const o=e.GeomUtils.boundsToPoints(n),r=e.GeomUtils.rotatePoints(o,-re);t=e.GeomUtils.minBoundingRect(r).width}r={...r,width:t}}i=e.GeomUtils.clipToOuterRect({...r,width:r.width+1+ae+se},n,re),s=i.width-1-(ae+se)+.01}let g=null;t&&(g={width:s});let h=null,m=F?.repeatPlaceholder;const f=c.layout(g);if(r=f.bounds,L?r={...r,width:0}:P&&(r={...r,width:F.repeatPlaceholder||F.repeatChars.length>0?s:P.width}),re&&t){let t=null;f.visitLines({visitTextLine:(n,o)=>{let r=n.bounds;const l=e.GeomUtils.boundsToPoints(r),i=e.GeomUtils.rotatePoints(l,re),a=e.GeomUtils.minBoundingRect(i);r={...r,x:(a.width-r.width)/2,y:(a.height-r.height)/2},t=t?e.GeomUtils.unionBounds(t,r):r}}),r={...t,width:t.width+ae+se}}if(!m&&M.getType()!==e.ScalarType.String&&Math.floor(r.width)>s){if("General"===I.getNumberFormat()&&M.getType()===e.ScalarType.Number){const e=I.measureText("0"),t=Math.floor(s/e.width),n=T,r=o.CommonUtils.splitNumber(n),l=Math.min(10,t-(Math.max(1,r.ipLength)+1)-(n<0?1:0));if(l>=-1){const e=`0${l>0?".":""}${"#".repeat(Math.max(0,l))}`;h=M.getNumberFormat(e).displayText,"0"===h&&n<0&&(h="-0")}else if(Math.abs(n)>=Math.pow(10,5)||Math.abs(n)<=Math.pow(10,-5)){const e=t-5-(n<0?1:0);if(e>=0){const t=`0.${"0".repeat(Math.max(0,e-1))}E+00`;h=M.getNumberFormat(t).displayText}}}h||(m="#")}if(!m&&P?.lastRepeatIndex>=0&&P?.width>s&&(m="#"),m&&s>0){const e=I.measureText(m),t=Math.floor((s||1)/(e?.width||1));h=t>0?m.repeat(t):""}if(L&&(H=e.ITextFrame.HorizontalAlignment.Left),h){const e=I.measureText(h).width;e&&(r={...r,width:e})}if(l={...r,width:r.width+ae+se,height:r.height},re&&!t){const t=e.GeomUtils.boundsToPoints(l),n=e.GeomUtils.rotatePoints(t,re),o=e.GeomUtils.minBoundingRect(n);l.width=o.width,l.height=o.height}H===e.ITextFrame.HorizontalAlignment.Center||H===e.ITextFrame.HorizontalAlignment.CenterContinuous?l.x=(O-l.width)/2:H===e.ITextFrame.HorizontalAlignment.Right?l.x=O-l.width-.5:l.x=.5,te.getVertical()===e.ITextFrame.VerticalAlignment.Center?l.y=(R-l.height)/2:te.getVertical()===e.ITextFrame.VerticalAlignment.Bottom?l.y=R-l.height-ie:l.y=ie;const p=he?{...S}:void 0,v={style:{left:d.left-1,top:d.top-1,width:d.width+1,height:d.height+1,transform:re?`rotate(${re}deg)`:void 0,cursor:w?"pointer":void 0,pointerEvents:w?"auto":void 0,zIndex:me?1:void 0,...W},onMouseDown:w,onDoubleClick:w?e=>{e.stopPropagation(),e.preventDefault()}:null,...p};z&&(v.style.textDecorationStyle="wavy",v.style.textDecorationColor=E?"rgb(0, 255, 255)":"red",v.style.textDecorationLine="underline");const C=Q.getSize(),b=(o,i,d,c,g,h,m,f=null)=>{let p=C*u,v=d,b=m?.runs?m.runs:[{type:e.NumberFormat.ParseRunType.Text,text:o,width:I.measureText(o,p).width}];m&&m?.width!==r.width&&(r={...r,width:m?.width});let w=ae;if(m?.lastRepeatIndex>=0&&s>m?.width){const t=m.runs[m.lastRepeatIndex];if(t){const n=[...b],o=Math.max(0,s-1-m.width);let l=0,i="";if(o>0){const e=Math.floor(o/t.width);i=e>0?t.text.repeat(e):"",l=o}n[m.lastRepeatIndex]={type:e.NumberFormat.ParseRunType.Repeat,text:i,width:l},b=n,r={...r,width:m.width+l}}}const y=(o,r,l,i,s,d,c,m,f,C=null)=>{let b,y=v.width;g===e.ITextFrame.HorizontalAlignment.Justify?(y=s,h||(b="justify")):g===e.ITextFrame.HorizontalAlignment.Distributed&&(y=s,b=h||o.text.split(" ").length-1==0?"center":"justify");const{style:x,className:q,...S}=C;let R=o.text;if(g===e.ITextFrame.HorizontalAlignment.Fill&&0===F?.repeatChars.length){const e=Math.max(1,Math.floor((v?.width??0)/(c?.width??1)));R=R.repeat(e)}let k=v.height;const M=Q.getVerticalAlignment(),T=M===e.IFont.VerticalAlignment.Sub,I=M===e.IFont.VerticalAlignment.Super;if(T||I){const e=Q.getSuperSubScale();p*=e,k*=e}const A={textAlign:b,textAlignLast:b,background:void 0,...x,...Q.toCSS(E,u,!0),fontSize:p*e.IFont.getDeviceScale()};ee&&(A.color=ee.toCSS(E));const D=w+r;let z=le.top+v.y+0;if(T&&(z+=f-p),d){const e=(c.x+D)*u+1,t=(c.y+z)*u+1;t<0?A.marginTop=t:A.paddingTop=t,e<0?(A.width=(x?.width??0)-e,A.left=(x?.left??0)+e):A.paddingLeft=e,A.paddingRight=Math.max(0,(x?.width??0)-y*u-e),A.paddingBottom=Math.max(0,(x?.height??0)-v.height*u-t),A.height=(x?.height??0)+(t<0?-t:0),(t<0||e<0)&&(A.clipPath=`inset(${t<0?-t:0}px 0px 0px ${e<0?1-e:0}px)`)}else if(A.left=(c.x+D)*u+1,A.top=(c.y+z)*u+1,A.width=c.width*u,A.height=c.height*u,re&&!t){A.left=(c.x+r)*u+1,A.top=(c.y+(v.y+0))*u+1;const t=e.GeomUtils.centerPoint({x:w+r,y:0,width:o.width,height:v.height}),n=e.GeomUtils.centerPoint({x:w,y:0,width:s,height:v.height}),l=e.GeomUtils.rotatePoints([t],re,n),i={x:l[0].x-t.x,y:l[0].y-t.y};A.left=A.left+i.x*u,A.top=A.top+i.y*u;const a={...v,x:w,y:le.top,width:v.width+(ae+se)},d=e.GeomUtils.boundsToPoints(a),g=e.GeomUtils.rotatePoints(d,re),h=e.GeomUtils.minBoundingRect(g);a.width=h.width,a.height=h.height;const m=e.GeomUtils.centerPoint(a),f={x:m.x-n.x,y:m.y-n.y};A.left=A.left+f.x*u,A.top=A.top+f.y*u}A.lineHeight=k*u+"px";const N=he?void 0:"text-line";a.push(n.jsx("div",{className:q?`${q} ${N}`:N,style:A,...S,children:R},`text-${v.y}-${i}-${l}`))};if(te.getOverflow()===e.ITextFrame.Overflow.Shrink&&s>0){let e=r?.width??0,t=0;for(;e>1&&e>s&&p>2&&t<100;){p*=s/e;e=I.measureText(o,p).width,t++}r={...r,width:e}}let x=v.x;g===e.ITextFrame.HorizontalAlignment.Right?x+=r.width-v.width:g!==e.ITextFrame.HorizontalAlignment.Center&&g!==e.ITextFrame.HorizontalAlignment.CenterContinuous||(x+=(r.width-v.width)/2),m?.lastRepeatIndex>=0&&(x=v.x);const q=b.length;for(let t=0;t<q;t++){const n=b[t];if(n.type===e.NumberFormat.ParseRunType.Text||n.type===e.NumberFormat.ParseRunType.Repeat){n.type,e.NumberFormat.ParseRunType.Repeat;y(n,x,t,i,g===e.ITextFrame.HorizontalAlignment.Justify||g===e.ITextFrame.HorizontalAlignment.Distributed||m?.lastRepeatIndex>=0?s:v.width,he,{x:l.x+j,y:l.y,width:n.width,height:r.height},0,c,f)}x+=n.width}};h?b(h,0,{x:0,y:0,...r},f.lines[0].baseline,H,!0,null,v):f.visitLines({visitTextLine:(t,n,o)=>{const l=t.runs[0].text.replace(/\s+$/,""),i=n===o-1;let a=H===e.ITextFrame.HorizontalAlignment.Justify&&(i||t.runs[0].text.endsWith("\n"))?e.ITextFrame.HorizontalAlignment.Left:H,d=0;n>0&&(te.getVertical()===e.ITextFrame.VerticalAlignment.Distributed||te.getVertical()===e.ITextFrame.VerticalAlignment.Justify)&&(d=Math.max(0,(R-(ie+3)-t.bounds.height*o)/(o-1)*n)),te.getVertical()===e.ITextFrame.VerticalAlignment.Distributed&&re&&re%90==0&&re%180!=0&&(a=e.ITextFrame.HorizontalAlignment.Distributed),a!==e.ITextFrame.HorizontalAlignment.Justify&&a!==e.ITextFrame.HorizontalAlignment.Distributed&&a!==e.ITextFrame.HorizontalAlignment.Fill||(r={...r,width:s});const u={...t.bounds,y:t.bounds.y+d+0,width:ne||F&&(F.repeatChars.length>0||F.spacingChars.length>0)?r.width:t.bounds.width};b(l,n,u,c.lines[0].baseline,a,i,1===o?P:null,he&&n>0?{...v,style:{...v.style,background:void 0}}:v)}})}a.length>0&&(K=a)}if(he)return K&&K.length>0?K:n.jsx("div",{style:fe,...S});let pe=w?"auto":de.pointerEvents,ve=null;if(ue){const e={x:V*u-1,y:-1,width:B*u+1,height:R*u+1};pe="auto",ve=q({renderBounds:e,darkMode:E,className:"filter-button",disabled:!M.isEditAllowed(),zoom:u,filter:M.getColumnFilter(),onFilterButtonMouseDown:y,...x}),ve&&(ve=n.jsx("div",{style:{...e,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:ve},"filterButton"))}U&&!K&&(K=n.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const Ce=[_,K,s,Z,ge,ve];return n.jsx("div",{style:{...W,...de,pointerEvents:pe},...S,children:Ce})},f={text:"",placeholder:""},p=(e,t)=>{if(!e.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=t??e.dirty??"";return 0===n.length||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},v=Object.freeze([t.KeyCodes.Delete,t.KeyCodes.Home,t.KeyCodes.End]),C=r.memo(r.forwardRef((i,s)=>{const{editState:d,onStartEdit:c,onChangeEdit:u,onSubmitEdit:g,onCancelEdit:h,onDoneEdit:m,defaultTextStyle:C,useRichStyling:b=!0,bodyStyle:w,activeCoords:y,sheet:x,commands:q,containerBounds:S,setNaturalDimensions:R,onFocus:k,disabled:M,style:T,zoom:I=1,linesVisible:E,autoFocus:F=!1,...A}=i,{height:D=0,width:z=0}=S??{},N=w?.darkMode??!1,L=r.useRef(null),[O,j]=r.useState(!1),[B,V]=r.useState(null),[P,H]=r.useState(()=>d);r.useEffect(()=>{Y.current=!1,H(d)},[d]);const U=r.useMemo(()=>{const t=P.clean();let n=t.getStyle();b||(n=n.createTemporaryStyle({font:{size:C?.fontSize}}));const r=t.getFormula(),l=n.getAlignment(),i=r?e.ITextFrame.HorizontalAlignment.Left:l.getHorizontal(),a=l.getVertical(),s=l.getOverflow()===e.ITextFrame.Overflow.Wrap||t.getType()===e.ScalarType.String&&(i===e.ITextFrame.HorizontalAlignment.Justify||i===e.ITextFrame.HorizontalAlignment.Distributed||a===e.ITextFrame.VerticalAlignment.Justify||a===e.ITextFrame.VerticalAlignment.Distributed),d=(e=>{if(!e)return f;const t=e.clean();if(!t)return f;let n=t.getStyle()?.getQuotePrefix();if(void 0===e.dirty||null===e.dirty){let o="",r=t.getFormulaText();r&&(o=r,n=!1),o||(o=t.toTextUnformatted(!0)??"");let l="";if(!e.editMode&&t.isSpillOverflow()){const e=t.getSpill();if(e){const n=e.getCell(),o=n.getFormulaText();n.isEqual(t)||(l=o)}}return n&&(o="'"+o),{text:o,placeholder:l}}return{text:e.dirty??"",placeholder:""}})(P),c=d.text,u=e.ITextFrame.toCSSHorizontalTextAlign(b&&!r?P.clean()?.getRenderHorizontalAlignment():e.ITextFrame.HorizontalAlignment.Left);return{style:n,isWrapped:s,textValue:c,formula:r,frameVertAlign:a,placeholder:d.placeholder,insets:b?t.getInsets():o.TypesUtils.EmptyRect,textAlign:u}},[P,C,N,I,b]),K=r.useRef(null),W=t.useImperativeElement(s,()=>({startEdit:e=>{L.current=e?.initialSelection;const t={...d,editMode:e?.editMode??!1};void 0!==e?.text&&(t.dirty=e.text),t.editMode===d.editMode&&t.dirty===d.dirty||(H(t),_?.(t))},submitEdit:()=>J(),cancelEdit(){Q()},autoFocus(){K.current.focus()},dispatchEvent:e=>K.current.dispatchEvent(e),focus(){K.current.focus()},getLineHeight:G}),[c,d]);r.useLayoutEffect(()=>{if(!B||!O)return;const e=K.current;U.textValue,e&&e.setSelectionRange(B.start,B.end,B.direction)},[K.current,B,U.textValue]);const $=r.useMemo(()=>{const t=P?.clean(),n=U.style.createTemporaryTextFrame(U.textValue,t?.getType()===e.ScalarType.String),o=b?t.getInsets().right+t.getInsets().left:0;let r=null;U.isWrapped&&(r={width:z-o});return n.layout(r)},[U,z,P,b]),G=t.useCallbackRef(()=>Math.ceil($?.lines[0]?.bounds.height),[$]);r.useLayoutEffect(()=>{if(!$)return;const e=U.style,t=e.getInsets()??o.TypesUtils.EmptyRect,n=b?t.left+t.right:0,r=b?.04*e.getFont().getSize():1,l=Math.round(U.isWrapped?void 0:$.bounds.width+n+r),i=Math.round($.bounds.height);R?.({width:l,height:i})},[$,R,U,b,P]);const _=t.useCallbackRef(u,[u]),Z=t.useCallbackRef(e=>{if(P.dirty===e)return;const t={...P};t.dirty=e,K.current,H(t),_?.(t)},[P]),X=t.useCallbackRef(e=>{if(P.editMode===e)return;const t={...P};t.editMode=e,H(t),_?.(t)},[P]),Y=r.useRef(!1),J=t.useCallbackRef(()=>{if(Y.current)return!1;try{g?.(P),m?.(),Y.current=!0}catch(e){return!1}return!0},[g,P]),Q=t.useCallbackRef(()=>{Y.current=!0,H(d),h?.(),m?.()},[h,d]),ee=t.useCallbackRef(n=>{if(!K.current)return;if(n.key,n.isDefaultPrevented(),!(n.isTrusted||n.nativeEvent.ctrlKey||n.nativeEvent.metaKey||n.nativeEvent.altKey||n.nativeEvent.isComposing||-1===l.STANDARD_KEY_CHARS.indexOf(n.nativeEvent.key)&&"Backspace"!==n.nativeEvent.key)){const e={...P};let t=0;return p(e,e.dirty)&&!isNaN(parseFloat(n.key))?(e.dirty?.endsWith("%")?e.dirty=(e.dirty.substring(0,e.dirty.length-1)??"")+n.key+"%":e.dirty=(e.dirty??"")+n.key+"%",t=e.dirty.length-1):"Backspace"===n.nativeEvent.key?(e.dirty="",t=e.dirty.length):(e.dirty=(e.dirty??"")+n.key,t=e.dirty.length),K.current.value=e?.dirty,L.current={start:t,end:t,direction:"forward"},K.current?.setSelectionRange(t,t,"forward"),H(e),_?.(e),void n.preventDefault()}const o=n.nativeEvent.ctrlKey,r=n.nativeEvent.shiftKey,i=n.nativeEvent.altKey,a=n.nativeEvent.metaKey;if(o&&"z"===n.key&&n.stopPropagation(),n.which===t.KeyCodes.Escape)return n.preventDefault(),void Q();if(n.which===t.KeyCodes.F2)return X(!0),void n.preventDefault();const s=n.target;if("%"===n.key&&s.selectionStart===s.selectionEnd&&"%"===s.value[s.selectionStart]&&P?.clean().getStyle().numberFormat.includes("%"))return V({start:s.selectionStart+1,end:s.selectionEnd+1,direction:s.selectionDirection}),void n.preventDefault();if(n.which===t.KeyCodes.Enter){if(n.preventDefault(),a||i){const e=U.textValue.substring(0,s.selectionStart)+"\n"+U.textValue.substring(s.selectionEnd);return Z(e),void V({start:s.selectionStart+1,end:s.selectionStart+1,direction:s.selectionDirection})}return void(J()&&x.getSelection().traverse(e.IRange.Orientation.Column,r))}if(n.which===t.KeyCodes.Tab)return n.preventDefault(),void(J()&&x.getSelection().traverse(e.IRange.Orientation.Row,r));let d=null;switch(n.which){case t.KeyCodes.Left:d=e.IRange.Direction.Left;break;case t.KeyCodes.Right:d=e.IRange.Direction.Right;break;case t.KeyCodes.Up:d=e.IRange.Direction.Up;break;case t.KeyCodes.Down:d=e.IRange.Direction.Down}if(d){if(!(o||r||i||a)&&!P.editMode)return void J()}P.editMode&&(d||v.includes(n.which))&&n.stopPropagation()},[P,x,U]),te=r.useCallback(()=>{K.current?.focus(),setTimeout(()=>{K.current?.select()},0)},[]),ne=r.useCallback(()=>{K.current?.focus(),console.log("implement toggleRelativeReferences")},[]),oe=t.useCallbackRef(()=>{const e=K.current?.value;let t="";if(y.rowIndex>0){const e=x.getRange({rowIndex:y.rowIndex-1,colIndex:y.colIndex}).getCell();e&&(t=e.toTextUnformatted(!0))}Z(e+t)},[y,x]);r.useEffect(()=>x.getRange(y).addListener(()=>{const e={...P,clean:()=>x.getRange(y).getCell()};H(e),_?.(e)}),[y,x]);const re=r.useCallback(()=>{const e=P.clean().createTemporaryCell({value:a(),style:{numberFormat:"Medium Time"}}).toText();Z((K.current?.value??"")+e)},[x]),le=r.useCallback(()=>{const e=P.clean().createTemporaryCell({value:a(),style:{numberFormat:"Short Date"}}).toText();Z((K.current?.value??"")+e)},[x]),ie=r.useMemo(()=>({element:()=>K.current,doCopy:e=>{const t=K.current.value.substring(K.current.selectionStart,K.current.selectionEnd);if(e?.isCut){const e=K.current.value.substring(0,K.current.selectionStart)+K.current.value.substring(K.current.selectionEnd,K.current.value.length);Z(e)}return t}}),[K.current]),ae=r.useMemo(()=>({element:()=>K.current,doPaste:async(e,t)=>{const n=await(e.toText?.());if(!n)return!0;const o=K.current.value.substring(0,K.current.selectionStart)+n+K.current.value.substring(K.current.selectionEnd,K.current.value.length);return Z(o),V({start:K.current.selectionStart+n.length,end:K.current.selectionStart+n.length,direction:"forward"}),!0}}),[K.current]),se=r.useMemo(()=>({contains:e=>K.current?.contains(e)||!1,focus(){K.current.focus()}}),[]),de=r.useMemo(()=>[new t.SimpleCommand("selectAll",se,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[t.KeyModifiers.Ctrl]}},te),new t.SimpleCommand("startEditValueAbove",se,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[t.KeyModifiers.Ctrl]},{key:'"',modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}]},oe),new t.SimpleCommand("startEditCurrentTime",se,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},re),new t.SimpleCommand("startEditCurrentDate",se,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl]}},le),new t.Command("relativeReferencesToggle",se,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},ne),new t.Command("toggleEditorFocus",se,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[t.KeyModifiers.Ctrl]}})],[]),ce=r.useMemo(()=>{let e=null;const n=()=>({contains:e=>K.current?.contains(e)||!1,focus(){K.current.focus()}});return e=q?q.createChildGroup(n,"editor",!1):new t.CommandGroup(n,"editor"),e.addCommands(de,!0),e},[q,de]),ue=r.useMemo(()=>({notifier:null,source:ie,target:ae,commands:ce}),[ie,ae,ce]);t.useCopyPaste(ue);const[ge,he]=r.useState(!F);r.useEffect(()=>{he(!1)},[]);const me=t.useCallbackRef(e=>{j(!0),ce?.activate();const t=L.current;if(!1!==t){let e,n;const o=K.current.value;p(P,o)&&(e=o.length-1,n=o.length-1),e=t?.start??e??o.length,n=t?.end??n??o.length,L.current=!1,V({start:e,end:n,direction:"forward"})}k?.(e)},[k,P]),fe=U.insets;let pe=fe.left+1;const ve=fe.left+fe.right+2-1,Ce=$?.bounds.height??0;let be,we=fe.top;U.frameVertAlign===e.ITextFrame.VerticalAlignment.Center?we=Math.max(0,(D-(fe.top+fe.bottom)-Ce)/2):U.frameVertAlign===e.ITextFrame.VerticalAlignment.Bottom&&(we=Math.max(0,D-(fe.top+fe.bottom)-Ce)),void 0!==E&&$?.lines[0]?.bounds&&(be=$?.lines[0]?.bounds.height*E);const ye=U.style.getFont();let xe=ye.getSize();ye.isSuperSub()&&(xe*=ye.getSuperSubScale()),xe*=e.IFont.getDeviceScale()*I;const qe=b?ye.toCSS(N,I):null;return n.jsx("div",{className:"sheet-cell-editor",onMouseDown:e=>{K.current&&document.activeElement!==K.current&&requestAnimationFrame(()=>{K.current.focus()})},ref:W,...A,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...T},children:n.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:we*I+1,left:pe*I,width:`calc(100% - ${ve*I}px)`,maxWidth:`calc(100% - ${ve*I}px)`,height:(be??Ce)*I,maxHeight:(be??Ce)*I},children:n.jsx("textarea",{spellCheck:"false",placeholder:U.placeholder,ref:K,value:U.textValue,disabled:ge,readOnly:M||x.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...qe,fontSize:xe?`${xe}px`:"inherit",textAlign:U.textAlign,lineHeight:($?.lines[0]?.bounds.height??0)*I+"px",height:($?.bounds.height??0)*I,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:U.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:me,onBlur:()=>{j(!1)},onSelect:e=>{},onChange:e=>{K.current&&!Y.current&&(L.current=!1,Z(e.target.value),U.textValue,e.target.value,e.target.selectionStart,e.target.selectionEnd,e.target.selectionDirection,V({start:e.target.selectionStart,end:e.target.selectionEnd,direction:e.target.selectionDirection}))},onMouseDown:e=>{O&&X(!0)},onKeyDown:ee})})})})),b=(e,t)=>({clean:e,dirty:t,editMode:!1}),w=e=>{const{length:o=0,width:r=1,dashArray:l=null,dashArrayAdditional:i=null,isDouble:a=!1,isAngled:s=!1,offsetX:d=0,offsetY:c=0,isVertical:u=!1,...g}=e,h=e=>{let t=null;if(e&&r>0){t="";for(let n=0;n<e.length;n++)t+=e[n],n<e.length-1&&(t+=",")}return t},m=h(l);let f=m;i&&(f=h(i));let p=r,v=o,C=null;if(a){p=Math.floor(r/2);const e=p+p/2+1;let o=null;o=u?`M ${t.ReactUtils.boundPixel(d+e)} ${t.ReactUtils.boundPixel(c)} L ${t.ReactUtils.boundPixel(d+e)} ${t.ReactUtils.boundPixel(c+v)}`:`M ${t.ReactUtils.boundPixel(d)} ${t.ReactUtils.boundPixel(c+e)} L ${t.ReactUtils.boundPixel(d+v)} ${t.ReactUtils.boundPixel(c+e)}`,C=n.jsx("path",{strokeWidth:p,strokeDasharray:f,d:o,...g})}if(s){p=r/2;const e=p+p/2;let o=f,l=null;l=u?`M ${t.ReactUtils.boundPixel(d+e)} ${t.ReactUtils.boundPixel(c)} L ${t.ReactUtils.boundPixel(d+e)} ${t.ReactUtils.boundPixel(c+v)}`:`M ${t.ReactUtils.boundPixel(d)} ${t.ReactUtils.boundPixel(c+e)} L ${t.ReactUtils.boundPixel(d+v)} ${t.ReactUtils.boundPixel(c+e)}`,C=n.jsx("path",{strokeWidth:p,strokeDasharray:o,strokeDashoffset:"1",shapeRendering:"crispEdges",d:l,...g})}let b=null;return b=u?`M ${t.ReactUtils.boundPixel(d+p/2)} ${t.ReactUtils.boundPixel(c)} L ${t.ReactUtils.boundPixel(d+p/2)} ${t.ReactUtils.boundPixel(c+v)}`:`M ${t.ReactUtils.boundPixel(d)} ${t.ReactUtils.boundPixel(c+p/2)} L ${t.ReactUtils.boundPixel(d+v)} ${t.ReactUtils.boundPixel(c+p/2)}`,n.jsxs(n.Fragment,{children:[n.jsx("path",{strokeWidth:p,strokeDasharray:m,d:b,...g}),C]})};function y(e,t){if("function"==typeof e)return e(t);e&&(e.current=t)}var x=parseInt(r.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const e=y(o,t),r="function"==typeof e;n.push(r?e:()=>y(o,null))}return()=>{for(const e of n)e()}}}:function(e){return t=>{for(const n of e)y(n,t)}},q=function(){},S="undefined"!=typeof window,R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},k=S?r.useLayoutEffect:r.useEffect,M={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const T=S&&void 0!==window.ResizeObserver?function(){var e=r.useState(null),t=e[0],n=e[1],o=r.useState(M),l=o[0],i=o[1],a=r.useMemo(function(){return new window.ResizeObserver(function(e){if(e[0]){var t=e[0].contentRect,n=t.x,o=t.y,r=t.width,l=t.height,a=t.top,s=t.left,d=t.bottom,c=t.right;i({x:n,y:o,width:r,height:l,top:a,left:s,bottom:d,right:c})}})},[]);return k(function(){if(t)return a.observe(t),function(){a.disconnect()}},[t]),[n,l]}:function(){return[q,M]},I=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,E=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,F=t=>{const{key:o,points:r,range:l,stroke:i,darkMode:a,forceThinBorder:s=!1,shiftIfWide:d=!1,isVertical:c=!1,intersections:u,layout:g}=t,h=e.IBorder.BuiltInDefinitions.get(s?e.IBorder.StrokeStyle.Thin:i.getStyle());if(!h)return null;const m=r[0],f=r[1],p=r[2],v=r[3];let C=1+(c?v-f:p-m),b=0;const y=i.getColor().toRGBA(a).toString(),x=h.description.toLowerCase().includes("double");let q,S;const R=c?"rowStart":"colStart",k=c?"rowEnd":"colEnd",M=c?f:m;if(u?.length>0){const t=u[0];if(t?.range[R]===l[R]){const n=e.IBorder.BuiltInDefinitions.get(t.stroke.getStyle());b=Math.floor(n.width/2)}const n=u[u.length-1];if(n?.range[k]===l[k]){const t=e.IBorder.BuiltInDefinitions.get(u[u.length-1].stroke.getStyle());C=Math.floor(C+(2===t.width?0:t.width/2))}if(x){const t=c?"colStart":"rowStart",n=c?"colEnd":"rowEnd",o=c?g?.getRowOffset:g?.getColOffset;let r=0,i=0;q=[],S=[];for(let a=0;a<u.length;a++){const s=u[a];if(s.stroke.getStyle()===e.IBorder.StrokeStyle.Double&&o){const e=o(s.range[R])-(M-b);s.range[t]<l[t]&&(q.push(e-r),r=e,q.push(1),r++),s.range[n]>l[n]&&(S.push(e-i),i=e,S.push(1),i++)}}q.length>0&&r<C&&q.push(C-r),S.length>0&&i<C&&S.push(C-i)}}let T=c?-Math.floor(h.width/2):-b,I=c?-b:-Math.floor(h.width/2);const E=d&&h.width>2?-1:0;return n.jsx(w,{offsetX:m+T+E,offsetY:f+I+E,length:C+b,isVertical:c,stroke:y,width:h.width,dashArray:q??h.pattern,dashArrayAdditional:S,isDouble:x,isAngled:h.description.toLowerCase().includes("slant")},o)},A=({getBorderAt:l,borderRenderer:i=F,getVisibleCells:a,darkMode:s,forceThinBorder:d=!1,defaultColor:c="black",shiftIfWide:u=!1})=>{const g=t.useCallbackRef(a,[a]),h=r.useMemo(()=>t=>{const r=t.toClipBounds(t.getRangeCoordsBounds(),-3);if(!r)return;const a=g(t);if(0===a.length)return;const h=t.getVisibleColumnOffsets(),m=t.getVisibleRowOffsets();let f=[],p=[];const v=t.getVisibleColumns(),C=t.getVisibleRows(),b=[],w=[],y=[],x=(e,t,n,o,r,l,i)=>{const a={index:o,stroke:r,visibleIndex:n,edge:l,length:i};e[t]||(e[t]=[]),e[t].length>0&&e[t][e[t].length-1]?.index===o?e[t][e[t].length-1]=a:e[t].push(a)};for(let n=0;n<a.length;n++){const r=a[n],i=r.coords;if(!i)continue;const s=r?.range??{rowStart:i.rowIndex,colStart:i.colIndex,rowEnd:i.rowIndex,colEnd:i.colIndex},d=t.getVisibleRangeCoords();if(!o.CoordUtils.isRangesIntersect(s,d)&&!o.CoordUtils.isRangeWithinRange(s,d))continue;const c=i.colIndex,u=i.rowIndex,g=h[c],y=m[u];if(s.rowEnd!==s.rowStart){const e=m[s.rowStart]?.spanIndex??-1,t=m[s.rowEnd]?.spanIndex??m[C[C.length-1]].spanIndex+1;f.push({...s,rowStart:e,rowEnd:t})}if(s.colEnd!==s.colStart){const e=h[s.colStart]?.spanIndex??-1,t=h[s.colEnd]?.spanIndex??h[v[v.length-1]].spanIndex+1;p.push({...s,colStart:e,colEnd:t})}const q=r.value,S=l(q,n);if(!S||S.isEmpty())continue;const R=S.getLeft(),k=S.getTop(),M=S.getRight(),T=S.getBottom();let I=1,E=1;if(!g||!y)continue;const F=g.spanIndex,A=y.spanIndex;R.isNone()||x(b,F,A,u,R,e.IBorder.Edge.Left,I),k.isNone()||x(w,A,F,c,k,e.IBorder.Edge.Top,E),M.isNone()||x(b,F+E,A,u,M,e.IBorder.Edge.Right,I),T.isNone()||x(w,A+I,F,c,T,e.IBorder.Edge.Bottom,E)}const q=(e,t,n)=>{const o=[];return e.forEach((e,r)=>{let l=null;e.sort((e,t)=>e.visibleIndex-t.visibleIndex);for(let i=0;i<e.length;i++){const a=e[i];if(!a?.stroke)continue;if(void 0===t[r]&&void 0===t[r-1])continue;let s=!1;if(n)for(let e=0;!s&&e<f.length;e++){let t=f[e];t.colStart<=a.index&&t.colEnd>=a.index&&t.rowStart<r&&t.rowEnd>=r&&(s=!0)}else for(let e=0;!s&&e<p.length;e++){let t=p[e];t.rowStart<=a.index&&t.rowEnd>=a.index&&t.colStart<r&&t.colEnd>=r&&(s=!0)}if(s)continue;const d=a.stroke?.getColor(),u=d?d.toRGBA().toString():c,g=a.stroke.getStyle()+":"+u;(g!==l?.key||l&&l.visibleIndex+1<a.visibleIndex)&&(l&&o.push(l),l={key:g,index:t[r]??t[r-1]+1,visibleIndex:a.visibleIndex,edge:a.edge,stroke:a.stroke,from:a.index,to:a.index+a.length-1,intersections:[],length:1}),l.to=a.index+a.length-1,l.visibleIndex=a.visibleIndex}l&&o.push(l)}),o};f=f.sort(E),p=p.sort(I);const S=q(b,v,!1),R=q(w,C,!0);if(0===S.length&&0===R.length)return null;for(let e=0;e<R.length;e++){const t=R[e];let n=o.CommonUtils.findEqualOrGreater(S,t.from,e=>e.index),r=!1;for(;!r;){const e=S[n++];e&&e.index>=t.from&&e.index<=t.to+1&&e.from<=t.index&&e.to+1>=t.index&&(t.intersections.push({stroke:e.stroke,range:{rowStart:e.from,rowEnd:e.to+1,colStart:e.index,colEnd:e.index}}),e.intersections.push({stroke:t.stroke,range:{rowStart:t.index,rowEnd:t.index,colStart:t.from,colEnd:t.to+1}})),r=!e||e.index>t.to+1}}for(let e=0;e<R.length;e++){const n=R[e];let o=n.stroke;const r=`rBorder:${n.index}:${n.from}:${n.to}:${n.edge}`,l={rowStart:n.index,rowEnd:n.index,colStart:n.from,colEnd:n.to+1},a=t.getLayout(),c=!1,g=a.getColOffset(l.colStart),h=a.getRowOffset(l.rowStart),m=[g,h,a.getColOffset(l.colEnd),h];y.push(i({key:r,points:m,stroke:o,darkMode:s,forceThinBorder:d,shiftIfWide:u,range:l,intersections:n.intersections,layout:a,isVertical:c}))}for(let e=0;e<S.length;e++){const n=S[e];let o=n.stroke;const r=`cBorder:${n.index}:${n.from}:${n.to}:${n.edge}`,l={rowStart:n.from,rowEnd:n.to+1,colStart:n.index,colEnd:n.index},a=t.getLayout(),c=!0,g=a.getColOffset(l.colStart),h=[g,a.getRowOffset(l.rowStart),g,a.getRowOffset(l.rowEnd)];y.push(i({key:r,stroke:o,points:h,darkMode:s,forceThinBorder:d,shiftIfWide:u,range:l,intersections:n.intersections,layout:a,isVertical:c}))}return n.jsx("svg",{width:`${r.width}`,height:`${r.height}`,viewBox:`0 0 ${r.width} ${r.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${r.width}px`,height:`${r.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:y},"borders")},[l,s]);return{overlay:h}},D=o.AnchorLocation.Center,z=Object.freeze({horizontal:!1,vertical:!1}),N=o.TypesUtils.EmptyTopLeft,L=(e,t)=>o.CoordUtils.EmptyCell,O=(e,t)=>new Promise((e,t)=>{t("StaticBorderRenderer does not support scrolling")}),j=r.memo(e=>{const{getBorderAt:t,width:l,height:i,style:a,rowCount:s=2,columnCount:d=2,darkMode:c,forceThinBorder:u,children:g,...h}=e,m=r.useRef(null),[f,{width:p,height:v}]=T(),C=l??p,b=i??v,w=r.useMemo(()=>{const e=[];for(let t=0;t<s;t++)for(let n=0;n<d;n++){const o={colIndex:n,rowIndex:t};e.push({coords:o,value:o})}return e},[]),y=r.useCallback(e=>w,[w]),{overlay:q}=A({getVisibleCells:y,getBorderAt:t,darkMode:c,forceThinBorder:u}),S=Math.floor(C/d),R=Math.floor(b/s),k={getColOffset:e=>Math.ceil(e*S)+0,getRowOffset:e=>Math.ceil(e*R)+0,getColIndex:e=>Math.floor((e-0)/S)-1,getRowIndex:e=>Math.floor((e-0)/R)-1},M={rowStart:0,colStart:0,rowEnd:s,colEnd:d},I={x:0,y:0,width:Math.max(0,C)+0,height:Math.max(0,b)+0},E=r.useMemo(()=>{const e={},t=Math.floor(C/d);for(let n=0;n<d;n++)e[n]={offset:n*t,size:t,spanIndex:n};return e},[C,b]),F=r.useMemo(()=>{const e={},t=Math.floor(b/s);for(let n=0;n<s;n++)e[n]={offset:n*t,size:t,spanIndex:n};return e},[C,b]);if(!q)return null;const j={width:C,height:b},B={width:C,height:b},V={getStage:()=>m.current,getTotalSize:()=>j,getViewportSize:()=>B,getLayout:()=>k,getCellCoordsAsRangeCoords:o.CoordUtils.cellToRange,getVisibleRangeCoords:()=>M,getVisibleRows:()=>{const e=[];for(let t=0;t<s;t++)e.push(t);return e},getTotalRangeCoords:()=>M,getRelativePointFromClient:(e,t)=>({x:e,y:t}),getVisibleColumns:()=>{const e=[];for(let t=0;t<d;t++)e.push(t);return e},toClipBounds:(e,t)=>I,toViewBounds:e=>e,toAbsoluteBounds:e=>e,getBounds:()=>I,getInsets:()=>null,getRangeCoordsBounds:(e,t)=>null,getVisibleColumnOffsets:()=>E,getVisibleRowOffsets:()=>F,allViews:()=>({[D]:V}),getAnchor:()=>D,getZoom:()=>1,scrollCellCoordsIntoView:O,getCellCoordsFromClient:L,getScrollOrientation:()=>z,getScrollTopLeft:()=>N,getFreezeTopLeft:()=>N},P=q(V);return n.jsxs("div",{style:{...a,position:"relative",display:"flex"},...h,children:[n.jsx("div",{ref:x([m,f]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:g}),P]})});function B(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=B(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function V(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=B(e))&&(o&&(o+=" "),o+=t);return o}const P="_sheetxl-sheet_1qeq6_5",H="_viewport-overlay_1qeq6_6",U=e=>{const{style:t,...o}=e??{};return n.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...o,children:[n.jsx("path",{d:"M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z",fill:"#547dbe",fillRule:"evenodd"}),n.jsx("path",{d:"M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z",fill:"#ffffff",fillRule:"evenodd"}),n.jsx("path",{d:"m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z",fill:"#547dbe",fillRule:"evenodd",strokeWidth:"0.4"}),n.jsx("path",{d:"M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z",fill:"#eb594d"}),n.jsx("path",{d:"m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z",stroke:"#eb594d",strokeWidth:"2",fill:"#f9cecb"})]})},K=r.memo(t=>{const{colorLicensee:o="blue",colorError:l="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:s,style:d,...c}=t??{},[u,g]=r.useState(null);r.useEffect(()=>{(async()=>{const t=await e.LicenseManager.getDetails();g(t)})()},[]);const[h,m]=r.useState(!1),f={opacity:.65},p=r.useMemo(()=>{const e=u?.exceptions(),t=e?.length??0;if(0===t)return null;const o=[];for(let r=0;r<t;r++){const t=e[r];o.push(n.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:l},children:t},r))}return o},[u,l]);if(null===u)return null;if(u.isValidFor(s))return null;const v=u.type(),C=!p&&v.endsWith("ity"),b=u.licensee(),w=C?1.6:1,y=135/w,x=37/w;let q=null;return!v&&b?.length>0&&(q=n.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:o},children:b})),n.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...d},...c,children:n.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[h?n.jsx(U,{style:f}):n.jsx("svg",{width:y,height:x,style:f,children:n.jsx("image",{style:{width:y,height:x},href:"https://www.sheetxl.com/watermark.svg",onError:()=>m(!0)})}),n.jsxs("div",{children:[q,p,n.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),W=(e,t,n)=>{const o=r.useRef(t);o.current=t;const l=n?.fireOnModelChange??!0;r.useEffect(()=>{if(!e||!o.current)return;const t=Object.keys(o.current),r={},i=t.length;for(let e=0;e<i;e++){const n=t[e];r[n]=(e,t)=>{o.current[n]?.(e,t)}}const a=e.addListeners(r,n);if(l)for(let n=0;n<i;n++){r[t[n]](e)}return()=>{a?.()}},[e])},$=new e.Color("transparent");function G(l){const{sheet:s,onRepeatCommandChange:d,bodyStyle:u,commands:g,target:h,notifier:m,onStartEdit:f,getViewport:p}=l,[v,C]=r.useState(null),[b,w]=r.useState(null),y=r.useRef(null),x=t.useCallbackRef(f,[f]),q=t.useCallbackRef(p,[p]),[S,R]=r.useState(),[k,M]=r.useState(()=>s?.getStyles().parseColor(e.IColor.Scheme.Bg2)),[T,I]=r.useState(()=>s?.getStyles().getNormal().getFont().getFill()),E=t.useEditMode();r.useRef(E.getMode()).current=E.getMode();const F=t.useGlobalClipboard(),[A,D]=r.useState(o.CommonUtils.EmptyArray),z=r.useCallback(()=>{if(y.current!==s)return;const e=s.getSelectedRanges();let t=null;A.length>0&&o.CoordUtils.isCellWithinRange(v,A[0].getRange().getCoords())&&(t=A[0]);const n=s?.getSelectedCell(),r=n?.getCoords()??null;i.unstable_batchedUpdates(()=>{K(t),C(r),w(e)})},[s,A,b,v]),N=r.useCallback(o.CommonUtils.debounce(z,210),[z]);r.useEffect(()=>{y.current=s,z()},[s]);const L=t.useCallbackRef(()=>s.getRange(v).getCell(),[s,v]),O=t.useCallbackRef(async(e,n,o=null,r=!1,l=!0)=>{const i=e?.label?.(),a=async()=>{const e=await Promise.resolve(l&&m?.showBusy?.(i??"Busy..."));try{await s.doBatch(async()=>n(s),i),r&&E.setMode(null),e&&e()}catch(t){if(e&&e(),!t)return;m?.showError?.(t)}},c=[];let u=!1;const g=async()=>(c.push(a),(async()=>{if(!u){for(u=!0;c.length>0;){const e=c.shift();e&&await e()}u=!1}})());if(d){let n=null;if(!1!==o&&e){const r=o??i;n=new t.SimpleCommand(e.key(),h,{label:r,description:r},g)}d(n)}return g()},[s,d,m]),j=t.useCallbackRef((t,n,o=!1,r)=>O(t,t=>{const l=t.getSelectedRanges();o&&l.updateStyle(null,r),l.updateStyle(n,r),l.autoFit({expandOnly:e.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[s]),B=t.useCallbackRef((e,t,n)=>{O(e,e=>{let o=t;(n||t?.address)&&(o=o??{},!n&&t?.address?.startsWith("#")?n=t?.address.substring(1):n&&(o.displayText=n)),e.getSelectedRange().setHyperlink(o)})},[s]),V=t.useCallbackRef((e,t)=>{O(e,e=>{e.getSelectedRange().setComments(t)})},[s]),P=t.useCallbackRef((e,t)=>{O(e,e=>{e.getSelectedRanges().clear(t)})},[s]),H=t.useCallbackRef(async(t,n,o=!1,r=!1)=>O(t,async t=>{let l=t.getSelectedRanges();o&&(n===e.IRange.Orientation.Row?l=l.getEntireRows(r):n===e.IRange.Orientation.Column&&(l=l.getEntireColumns(r)));let i=null;const a=E.getMode()?.key;if("copy"===a||"cut"===a){const e=await F.getClipboard().readReference();e&&"range"===e.getItemType()&&(i=e.getItem(),i.getCoords()||(i=null))}if(i){const t=await l.insertFrom(i,{...i.getMarkOptions(),orientation:n,autoSelect:!0});!t||t.isEntireRows()||t.isEntireColumns()||t.autoFit({orientations:e.IRange.Orientations.Row,minContent:!0}),E.setMode(null)}else l.insert(n,{autoSelect:!0})},"Insert Cells",!1),[E]),[U,K]=r.useState(null),G=t.useCallbackRef(e=>s.getStyles().setDefaultTableStyle(e),[s]),_=t.useCallbackRef(e=>{s.getStyles().getTableStyle(e)?.delete()},[s]),Z=t.useCallbackRef((t,n)=>{O(t,async t=>{const o=t.getSelectedRange(),r=t.getSelectedCell().getCoords();let l=null,i=0;const a=r.rowIndex>0?t.getRange({rowIndex:r.rowIndex,colIndex:r.colIndex}).getExtended(e.IRange.Direction.Up):null;a&&t.getRange({colStart:r.colIndex,rowStart:a.getCoords().rowStart,colEnd:r.colIndex,rowEnd:a.getCoords().rowStart}).isContentful()&&(l=e.IRange.Direction.Up,i=r.rowIndex-a.getCoords().rowEnd);const s=r.colIndex>0?t.getRange({rowIndex:r.rowIndex,colIndex:r.colIndex-1}).getExtended(e.IRange.Direction.Left):null;if(s&&t.getRange({colStart:s.getCoords().colStart,rowStart:r.rowIndex,colEnd:s.getCoords().colStart,rowEnd:r.rowIndex}).isContentful()){const t=r.colIndex-s.getCoords().colEnd;(t<i||!l)&&(l=e.IRange.Direction.Left,i=t)}let d=null;if(l===e.IRange.Direction.Up){if(d={...a.getCoords()},(d.rowEnd===r.rowIndex||!t.getRange({colIndex:r.colIndex,rowIndex:r.rowIndex-1}).isContentful())&&d.rowStart>0&&t.getRange({colIndex:r.colIndex,rowIndex:d.rowStart-1}).isContentful()){const t=a.getExtended(e.IRange.Direction.Up);d={colStart:r.colIndex,rowStart:t.getCoords().rowStart,colEnd:r.colIndex,rowEnd:a.getCoords().rowEnd}}d.rowEnd=r.rowIndex-1}else if(l===e.IRange.Direction.Left){if(d={...s.getCoords()},(d.colEnd===r.colIndex||!t.getRange({colIndex:r.colIndex-1,rowIndex:r.rowIndex}).isContentful())&&d.colStart>0&&t.getRange({colIndex:d.colStart-1,rowIndex:r.rowIndex}).isContentful()){const t=s.getExtended(e.IRange.Direction.Left);d={colStart:t.getCoords().colStart,rowStart:r.rowIndex,colEnd:t.getCoords().colEnd,rowEnd:r.rowIndex}}d.colEnd=r.colIndex-1}if(1!==o.size&&l){const r=o.getCoords(),i=o.startIncrementalUpdates({orientation:e.IRange.Orientation.Column}),a={...d},s=r.rowStart,c=r.rowEnd,u=r.colStart,g=r.colEnd,h=l===e.IRange.Direction.Up;for(let e=u;e<=g;e++){a.colStart=h?e:d.colStart+(e-u),a.colEnd=h?e:d.colEnd+(e-u);for(let o=s;o<=c;o++){a.rowStart=h?d.rowStart+(o-s):o,a.rowEnd=h?d.rowEnd+(o-s):o;const r=t.getRange(a).toString();i.pushAt(o,e,`=${n}(${r})`)}}i.apply()}else{const e=d?t.getRange(d).toString():"",o=`=${n}(`;x?.({text:`${o}${e})`,editMode:!0,initialSelection:{start:o.length,end:o.length+e.length}})}},!1)},[s]),X=t.useCallbackRef((e,t,n=!1,o=!0)=>{O(e,async r=>{let l=null;if(U)return void U.updateStyleOptions(t);{const e=r.getSelectedRanges().getFixed(!0),t=r.getSelectedRange().getDefaultSortCriteria();let n={ranges:e,hasHeader:t?.options?.hasHeader??!1};l=o?new Promise((e,t)=>{const o={tableOptions:n,onCancel:()=>{t()},onDone:t=>{e(t)},context:{getNames:()=>r.getNames()}};m.showWindow?.("tableNew",o)}):{option:"Ok",tableOptions:n}}const i=await Promise.resolve(l);if("Ok"!==i?.option)throw null;const a=await Promise.resolve(m?.showBusy?.(e.label()));try{const e=r.getTables().add(i.tableOptions.ranges.at(0),{styleName:t?.name,clearFormatting:n,hasHeader:i.tableOptions.hasHeader});await e.getRange().select()}catch(e){a(),m?.showError?.(e)}a()},!1,!0,!1)},[U]),Y=t.useCallbackRef(()=>u,[u]),J=t.useCallbackRef(e=>({styles:()=>s.getStyles(),table:()=>e,bodyStyle:Y,getNames:()=>s.getNames()}),[s]),Q=t.useCallbackRef(async(e,t,n,o=!0)=>{let r=null;if(!t){let e=s.getSelectedRange();1===e.size&&(e=e.getSurrounding());let n=s.getTables().search({address:s.getSelectedRange()});n.length>0&&(t=n[0]),await e.select()}if(t){if(o){try{n&&await t.select()}catch(e){}r=new Promise(async(n,o)=>{e.update({context:J(t)});const r={command:e,commands:me,notifier:m,onDone:e=>{n(e)}},l=await(m.showWindow?.("tableDetails",r,{disableAutoDestroy:!0}));setTimeout(()=>{l.focus()},180)})}Promise.resolve(r).then(e=>{},e=>{m?.showError?.(e)})}},[m]),ee=t.useCallbackRef(async(e,t,n=!1)=>{let o=null;if(t)t.isITable?o=t:t.getValue()&&(o=t.getValue());else{const e=s.getTables().search({address:s.getSelectedRange()});e.length>0&&(o=e[0])}if(o){if(!n){const e=o.getRange().getCoords(),t=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);if(t>1e4){if("Convert"!==await(m?.showOptions({title:"Confirm",description:`Converting a table to range with '${t}' cells will set a large number of cell styles and may affect performance.\nContinue?`,options:["Convert","Cancel"],defaultOption:"Convert"})))return}}O(e,async()=>{n?o.delete():o.convertToRange()},!1,!0)}},[m]),te=t.useCallbackRef((t,n,o)=>{O(t,async r=>{let l=r.getSelectedRanges();if(l.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let i=l.at(0);1===i.size&&(i=i.getSurrounding());const a=r.getSelection().getCoords().cell;let s=i.getDefaultSortCriteria(e.IRange.Orientation.Row,a);if(!s){if(o)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let d=s.options;if(o&&(d=new Promise((e,t)=>{const n={range:i,options:s.options,cell:a,onCancel:()=>{t()},onDone:n=>{n?e(n.options):t()}};m.showWindow?.("sort",n)})),d=await Promise.resolve(d),!d)return;const c=await Promise.resolve(m?.showBusy?.(t.label()));try{i.doBatch(()=>{const t={...d,...n};i.sort(t),i.autoFit({orientations:t?.orientation===e.IRange.Orientation.Column?e.IRange.Orientations.Column:e.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},t?.label?.())}catch(e){c(),m?.showError?.(e)}c()},!1,!1,!1)},[m]),ne=t.useCallbackRef(()=>{console.log("compactedSelection");const e=s.getSelection().getCoords(),t=s.getSelectedRanges().getFlattened().getCoords(),n=(e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t),o=new Worker(n);return URL.revokeObjectURL(n),o})("console.log('hello from worker');");setTimeout(()=>{n.terminate(),console.log("Worker terminated")},5e3);let r=-1;for(let n=0;-1===r&&n<t.length;n++)o.CoordUtils.isCellWithinRange(e.cell,t[n])&&(r=n);if(o.CoordUtils.isEqualRangesArrays(e.ranges,t))return;const l={cell:e.cell,ranges:t,rangeIndex:r};s.getSelection().updateCoords(l)},[s]),oe=t.useCallbackRef(()=>{console.log("selectComments")},[s]),re=t.useCallbackRef(async(e=!1,t=!1)=>{let n=null;if(t)n=s.getEntireRange();else{const t=s.getSelectedRange();if(t.isEntireRange()){const e=s.getSelection().getCoords().cell,t=s.getRange(e);n=t.getSurrounding(),n.isEntireRange()&&(n=t)}else n=t.getSurrounding({contentOnly:e})}n&&await n.select()},[s]),le=t.useCallbackRef((t,n,o)=>{O(t,async t=>{let r=t.getSelectedRanges();o&&(n===e.IRange.Orientation.Row?r=r.getEntireRows():n===e.IRange.Orientation.Column&&(r=r.getEntireColumns())),r.delete(n)},"Delete Cells")},[s]);t.useCallbackRef(async e=>{let t=null;const n=q(),o=Math.min(n.width-8,480),r=Math.min(n.height-8,288);try{s.getSelectedRanges();t=await s.getMovables().add({bounds:{x:n.left+(n.width-o)/2,y:n.top+(n.height-r)/2,width:o,height:r},type:"chart",json:e.template}),t.select(),E.setMode(null)}catch(e){m?.showError?.(e)}return t},[s,m]);const ie=t.useCallbackRef(async(e,n,o)=>{const r=await(m?.showBusy?.(e.label()));try{const e=await s.getMovables().addImage(n,{autoSelect:!0,...o});return r(),E.setMode(null),e}catch(e){r();let n=e;"string"!=typeof n&&(console.warn(e),n="Unable to resolve image."),m?.showMessage?.(n,{type:t.NotificationType.Error})}},[s,m]),ae=t.useCallbackRef((t,n)=>{O(t,async r=>{const l=r.getSelectedRanges();l.doBatch(()=>{const t=n===e.IRange.Direction.Up||n===e.IRange.Direction.Down,i=l.getCoords().slice().sort(o.CoordUtils.createRangeComparator(t?e.IRange.Orientation.Row:e.IRange.Orientation.Column));for(let t=0;t<i.length;t++){const o=i[t];let l=o;const a=r.getRange(l).getMerges();let s=0,d=0;if(a.length>0){const e=a[0];s=e.rowEnd-e.rowStart,d=e.colEnd-e.colStart}n===e.IRange.Direction.Left?l={...o,colStart:o.colEnd+d}:n===e.IRange.Direction.Right?l={...o,colEnd:o.colStart+d}:n===e.IRange.Direction.Up?l={...o,rowStart:o.rowEnd+s}:n===e.IRange.Direction.Down&&(l={...o,rowEnd:o.rowStart+s}),r.getRange(l).autoFill(o,{filler:e.AutoFill.Types.Copy}),r.getRange(o).autoFit({orientations:e.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:t.label()})})},[m]),se=t.useCallbackRef(()=>{let e=null;const t=s.getSelectedCell().getCoords();if(t?.rowIndex>0){const n=s.getRange({rowIndex:t.rowIndex-1,colIndex:t.colIndex}).getCell();n&&(e=n.toTextUnformatted(!0))}x?.({text:e})},[s]),[de,ce]=r.useReducer(e=>e+1,0),[ue,ge]=r.useReducer(e=>e+1,0),he=r.useMemo(()=>[new t.Command("gridlinesToggle",h,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new t.Command("sheetViewToggleGridlinesRows",h,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new t.Command("sheetViewToggleGridlinesColumns",h,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new t.Command("sheetViewFormatGridlinesColor",h,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new t.Command("sheetViewToggleShowHeadings",h,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new t.Command("sheetViewToggleShowHeadingRows",h,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new t.Command("sheetViewToggleShowHeadingColumns",h,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new t.Command("sheetViewToggleShowHeadingsNumeric",h,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}}),new t.Command("sheetViewToggleFormulaView",h,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[t.KeyModifiers.Ctrl]},{key:"`",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}]}),new t.Command("sheetViewToggleShowZeros",h,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new t.SimpleCommand("selectComments",h,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},()=>oe()),new t.Command("selectAll",h,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[t.KeyModifiers.Ctrl]},{key:"Space",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}]},(e=!1)=>re(!1,e)),new t.SimpleCommand("selectRegion",h,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},()=>re(!0,!1)),new t.SimpleCommand("breakSelection",h,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}},()=>ne()),new t.SimpleCommand("formatTextRotate0",h,{label:"No Text Rotation",description:"Remove all text rotation."}),new t.SimpleCommand("formatTextRotate45",h,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new t.SimpleCommand("formatTextRotate90",h,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new t.SimpleCommand("formatTextRotate270",h,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new t.SimpleCommand("formatTextRotate315",h,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new t.Command("formatTextRotateCustom",h,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new t.SimpleCommand("formatTextRotateVertical",h,{label:"Vertical Text",description:"Stack text vertically."}),new t.SimpleCommand("sortAscending",h,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){te(this,{reverse:!1},!1)}),new t.SimpleCommand("sortDescending",h,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){te(this,{reverse:!0},!1)}),new t.SimpleCommand("sortCustom",h,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){te(this,{},!0)}),new t.Command("protectionSheetToggle",h,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:"Prevent unwanted changes from others by limiting their ability to edit.\nFor example, you can prevent people from editing locked cells or making formatting changes."}),new t.Command("formatSheetTabColor",h,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new t.Command("formatCellStyle",h,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(e){j(this,{named:e.getName()},!0)}),new t.Command("formatTableStyle",h,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(e){X(this,e)}),new t.Command("formatTableStyleClearCellStyles",h,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(e){X(this,e,!0)}),new t.Command("formatTableStyleClearTableStyle",h,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){X(this,{name:null},!0)}),new t.Command("setDefaultTableStyle",h,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},G),new t.Command("deleteTableStyle",h,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},_),new t.Command("formatBorder",h,{label:"Border",description:"Create an outline border."},function(e){j(this,{border:e})}),new t.Command("formatFillColor",h,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(e){j(this,{fill:e})}),new t.Command("formatFontColor",h,{label:"Font Color",description:"Change the color of your text."},function(e){j(this,{font:{fill:e}})}),new t.Command("formatBoldToggle",h,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[t.KeyModifiers.Ctrl]},{key:"2",modifiers:[t.KeyModifiers.Ctrl]}]}),new t.Command("formatItalicToggle",h,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[t.KeyModifiers.Ctrl]},{key:"3",modifiers:[t.KeyModifiers.Ctrl]}]}),new t.Command("formatUnderlinedToggle",h,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[t.KeyModifiers.Ctrl]},{key:"4",modifiers:[t.KeyModifiers.Ctrl]}]}),new t.Command("formatUnderlinedDoubleToggle",h,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new t.Command("formatUnderlinedAccountingToggle",h,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new t.Command("formatUnderlinedAccountingDoubleToggle",h,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new t.Command("formatStrikeThroughToggle",h,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[t.KeyModifiers.Ctrl]}}),new t.Command("formatSuperscriptToggle",h,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new t.Command("formatSubscriptToggle",h,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new t.Command("formatAlignTopToggle",h,{label:"Align Top",description:"Align text to the top."}),new t.Command("formatTextOverflowVisibleToggle",h,{label:"Overflow Text",description:"Overflow text to the next cells."}),new t.Command("formatTextOverflowWrapToggle",h,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new t.Command("formatTextOverflowClipToggle",h,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new t.Command("formatTextOverflowShrinkToggle",h,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new t.Command("formatTextOverflowEllipsisToggle",h,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new t.Command("formatAlignMiddleToggle",h,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new t.Command("formatAlignBottomToggle",h,{label:"Align Bottom",description:"Align text to the bottom."}),new t.Command("formatAlignJustifyVerticalToggle",h,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new t.Command("formatAlignDistributedVerticalToggle",h,{label:"Distribute Vertically",description:"Justify your content vertically."}),new t.Command("formatAlignLeftToggle",h,{label:"Align Left",description:"Align your content to the left."}),new t.Command("formatAlignCenterToggle",h,{label:"Align Center",description:"Center your content."}),new t.Command("formatAlignRightToggle",h,{label:"Align Right",description:"Align your content to the right."}),new t.Command("formatAlignJustifyToggle",h,{label:"Align Justify",description:"Justify your content."}),new t.Command("formatAlignCenterContinuousToggle",h,{label:"Center Across",description:"Center your content across multiple cells."}),new t.Command("formatAlignFillToggle",h,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new t.Command("formatAlignDistributedHorizontalToggle",h,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new t.SimpleCommand("formatFontSizeIncrease",h,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,e=>({font:{size:c(e.getFont().getSize(),!0)}}))}),new t.SimpleCommand("formatFontSizeDecrease",h,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,e=>({font:{size:c(e.getFont().getSize(),!1)}}))}),new t.Command("formatFontFamily",h,{label:"Font",description:"Select the font your text."},function(e){j(this,{font:{family:e}})}),new t.Command("formatFontSize",h,{label:"Font Size",description:"Change the size of your text."},function(e){j(this,{font:{size:e}})}),new t.Command("formatNumberDialog",h,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[t.KeyModifiers.Ctrl]},{key:"1",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]},function(e,t){const n=this,o={initialValue:e??t.state(),context:t.context(),onInputOption:(e,t)=>{j(n,{numberFormat:e})}};m.showWindow?.("numberFormat",o)}),new t.Command("formatNumberFormat",h,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(e){j(this,{numberFormat:e})}),new t.Command("formatNumberFormatGeneralStyle",h,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:e.NumberFormat.Type.General})}),new t.Command("formatNumberFormatNumberStyle",h,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"#,##0.00"})}),new t.Command("formatNumberFormatTimeStyle",h,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"h:mm AM/PM"})}),new t.Command("formatNumberFormatDateStyle",h,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"d-mmm-yy"})}),new t.Command("formatNumberFormatAccountingStyle",h,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(e){j(this,{numberFormat:e??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new t.Command("formatNumberFormatPercentStyle",h,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"0%"})}),new t.Command("formatNumberFormatScientificStyle",h,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){j(this,{numberFormat:"0.00E+00"})}),new t.Command("formatNumberFormatCommaStyle",h,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[t.KeyModifiers.Ctrl]}},function(){j(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new t.Command("formatNumberFormatIncreaseDecimal",h,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){j(this,t=>({numberFormat:e.NumberFormat.Parser.adjustDecimalPlaces(t.getNumberFormat(),1)}))}),new t.Command("formatNumberFormatDecreaseDecimal",h,{label:"Decrease Decimal",description:"Show few decimal places."},function(){j(this,t=>({numberFormat:e.NumberFormat.Parser.adjustDecimalPlaces(t.getNumberFormat(),-1)}))}),new t.Command("displayPlaceholdersToggle",h,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[t.KeyModifiers.Ctrl]}}),new t.SimpleCommand("noOp",h,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[t.KeyModifiers.Ctrl]}},function(){}),new t.Command("displayOutlineSymbolsToggle",h,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[t.KeyModifiers.Ctrl]}}),new t.Command("hideRows",h,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[t.KeyModifiers.Ctrl]}}),new t.Command("unhideRows",h,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}}),new t.Command("hideColumns",h,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[t.KeyModifiers.Ctrl]},{key:"0",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]}),new t.Command("unhideColumns",h,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}}),new t.Command("quickFormulaSum",h,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[t.KeyModifiers.Alt]}},function(){Z(this,"SUM")}),new t.Command("quickFormulaAverage",h,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){Z(this,"AVERAGE")}),new t.Command("quickFormulaCount",h,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){Z(this,"COUNT")}),new t.Command("quickFormulaMax",h,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){Z(this,"MAX")}),new t.Command("quickFormulaMin",h,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){Z(this,"MIN")}),new t.Command("startEditCurrentTime",h,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){x?.({text:s.createTemporaryCell({value:a(),style:{numberFormat:"Medium Time"}}).toText()})}),new t.Command("startEditCurrentDate",h,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[t.KeyModifiers.Ctrl]}},function(){x?.({text:s.createTemporaryCell({value:a(),style:{numberFormat:"Short Date"}}).toText()})}),new t.SimpleCommand("sheetZoomOut",h,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]}),new t.SimpleCommand("sheetZoomIn",h,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]}),new t.SimpleCommand("sheetZoom100",h,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}}),new t.Command("insertFunction",h,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[t.KeyModifiers.Shift]}},function(e,t){console.log("insertFunction")}),new t.Command("updateHyperlink",h,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",context:()=>L,shortcut:[{key:"K",modifiers:[t.KeyModifiers.Ctrl]},{key:"K",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]},async function(e,t){const n=this,o={context:t.context(),onUpdateHyperlink:(e,t)=>{B(n,e,t)}};m.showWindow?.("hyperlink",o)}),new t.Command("openHyperlink",h,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[t.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>L},async(e,t)=>{const n=t.context()();if(!n)return;const o=n.getHyperlink();if(o)try{await o.open()}catch(e){m?.showError?.(e)}}),new t.Command("deleteHyperlink",h,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>L},function(e,t){B(this,null,null)}),new t.SimpleCommand("insertNote",h,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[t.KeyModifiers.Shift]},description:"Add a note to the cell."},(e,t)=>{((e,t)=>{e?.showMessage?.(n.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[t," is not yet implemented.",n.jsx("br",{}),n.jsx("br",{}),"Please see the ",n.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(m,t.label())}),new t.Command("updateComments",h,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]},description:"Add a comment to the current cell.",context:()=>L},async function(e,t){const n=this,o={context:t.context(),onUpdateComments:e=>{V(n,e)}};m.showWindow?.("comments",o)}),new t.Command("deleteComments",h,{label:"Delete Comments",description:"Remove any comments.",context:()=>L},function(e,t){V(this,null)}),new t.Command("insertImageFromFile",h,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(e=null){let t=null,n=null;"string"==typeof e?n=e:t=e?.file?e.file:e,(t||(t=await o.CommonUtils.openFileDialog(n??"image/*"),t))&&await ie(this,{file:t},e?.options)}),new t.Command("insertImageFromURL",h,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(e){if(!e){const t=await(m?.showInputOptions?.({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]}));if("Insert"!==t.option)return;e=t.input}e&&ie(this,{fetch:e})}),new t.SimpleCommand("insertTable",h,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[t.KeyModifiers.Ctrl]},{key:"T",modifiers:[t.KeyModifiers.Alt,t.KeyModifiers.Ctrl]}]},function(){X(this)}),new t.Command("editTable",h,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(e){let t=null,n=!1;e.isITable?t=e:e.getValue()&&(t=e.getValue(),n=!0),Q(this,t,n)}),new t.Command("deleteTable",h,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:"Remove the table.\n\nThe table and table specific styling will be removed but the values will be preserved."},function(e){ee(this,e,!0)}),new t.Command("convertTableToRange",h,{label:"Convert To Range",description:"Convert the table into a normal range of cells.\n\nThe values and the formatting are preserved."},function(e){ee(this,e,!1)}),new t.Command("tableTotalRowToggle",h,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}},function(){const e=this.context().table();e&&e.setShowTotals(!e.getShowTotals())}),new t.Command("tableHeaderRowToggle",h,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const e=this.context().table();e&&e.setShowHeaders(!e.getShowHeaders())}),new t.Command("autoFilterToggle",h,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){const e=this.context().table();e&&e.setShowFilterButton(!e.getShowFilterButton())}),new t.Command("autoFilterReapply",h,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}}),new t.Command("autoFilterClear",h,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new t.SimpleCommand("startEditValueAbove",h,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[t.KeyModifiers.Ctrl]},{key:'"',modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}]},se),new t.Command("formatPainterToggle",h,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new t.SimpleCommand("insertCells",h,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){H(this)}),new t.SimpleCommand("insertCellsShiftRight",h,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){H(this,e.IRange.Orientation.Column)}),new t.SimpleCommand("insertCellsShiftDown",h,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward."},function(){return H(this,e.IRange.Orientation.Row)}),new t.SimpleCommand("insertRows",h,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position."},function(){return H(this,e.IRange.Orientation.Row,!0)}),new t.SimpleCommand("insertColumns",h,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position."},function(){return H(this,e.IRange.Orientation.Column,!0)}),new t.SimpleCommand("insertRowsAfter",h,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return H(this,e.IRange.Orientation.Row,!0,!0)}),new t.SimpleCommand("insertColumnsAfter",h,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return H(this,e.IRange.Orientation.Column,!0,!0)}),new t.SimpleCommand("deleteCells",h,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[t.KeyModifiers.Ctrl]}},function(){return le(this)}),new t.SimpleCommand("deleteCellsShiftUp",h,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return le(this,e.IRange.Orientation.Row)}),new t.SimpleCommand("deleteCellsShiftLeft",h,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right."},function(){return le(this,e.IRange.Orientation.Column)}),new t.SimpleCommand("deleteRows",h,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return le(this,e.IRange.Orientation.Row,!0)}),new t.SimpleCommand("deleteColumns",h,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection."},function(){return le(this,e.IRange.Orientation.Column,!0)}),new t.SimpleCommand("flashFill",h,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[t.KeyModifiers.Ctrl]},{key:"e",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt]}]}),new t.SimpleCommand("fillDown",h,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",shortcut:{key:"d",modifiers:[t.KeyModifiers.Ctrl]}},function(){return ae(this,e.IRange.Direction.Down)}),new t.SimpleCommand("fillRight",h,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",shortcut:[{key:"r",modifiers:[t.KeyModifiers.Ctrl]}]},function(){return ae(this,e.IRange.Direction.Right)}),new t.SimpleCommand("fillUp",h,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection."},function(){return ae(this,e.IRange.Direction.Up)}),new t.SimpleCommand("fillLeft",h,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection."},function(){return ae(this,e.IRange.Direction.Left)}),new t.SimpleCommand("formatBorderAddOutline",h,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){return j(this,{border:{left:{style:e.IBorder.StrokeStyle.Thin,color:null},top:{style:e.IBorder.StrokeStyle.Thin,color:null},right:{style:e.IBorder.StrokeStyle.Thin,color:null},bottom:{style:e.IBorder.StrokeStyle.Thin,color:null}}})}),new t.SimpleCommand("formatBorderClearOutline",h,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){return j(this,{border:null})}),new t.SimpleCommand("formatIndentDecrease",h,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return j(this,e=>{const t=e.getAlignment().getIndent()-1;return{alignment:{indent:t>0?t:0}}})}),new t.SimpleCommand("formatIndentIncrease",h,{label:"Increase Indent",description:"Move your content further from the border."},function(){return j(this,t=>{const n={alignment:{indent:t.getAlignment().getIndent()+1}};return t.getAlignment().getHorizontal()===e.ITextFrame.HorizontalAlignment.General&&(n.alignment.horizontal=e.ITextFrame.HorizontalAlignment.Left),n})}),new t.Command("mergeToggle",h,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[t.KeyModifiers.Ctrl]}}),new t.SimpleCommand("mergeHorizontal",h,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new t.SimpleCommand("mergeVertical",h,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new t.SimpleCommand("unmerge",h,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new t.SimpleCommand("clearContents",h,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:"Clear only the contents in the cells.\n\nThe formatting is not cleared.",shortcut:{key:"Delete"}},function(){P(this,e.ICell.Content.Values)}),new t.SimpleCommand("clearFormats",h,{label:"Clear Formats",scopedLabels:{clear:"Formats"},description:"Clear only the formatting that is applied to the cells."},function(){P(this,e.ICell.Content.Formats)}),new t.SimpleCommand("clearHyperlinks",h,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){P(this,e.ICell.Content.Hyperlinks)}),new t.SimpleCommand("clearComments",h,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){P(this,e.ICell.Content.Comments)}),new t.SimpleCommand("clearAll",h,{label:"Clear All",scopedLabels:{clear:"All"},description:"Clears everything from the cells.\n\nAll contents and formatting are removed.",shortcut:{key:"Delete",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){P(this)}),new t.Command("freezeToggle",h,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new t.Command("freezeToggleHorizontal",h,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new t.Command("freezeToggleVertical",h,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new t.SimpleCommand("unfreeze",h,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new t.SimpleCommand("autoFitRows",h,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new t.SimpleCommand("autoFitColumns",h,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),me=r.useMemo(()=>{let e=null;return e=g?g.createChildGroup(h,"sheet",!1):new t.CommandGroup(h,"sheet"),e.addCommands(he,!0),e},[g,he]),[fe,pe]=r.useState(!1),[ve,Ce]=r.useState(!1);r.useEffect(()=>{if(y.current!==s||!b)return;const e=b.getCoords(),t=s.getTables().search({address:e[0]});D(e=>o.CommonUtils.isEqualArrays(e,t)?e:t),v&&t[0]&&o.CoordUtils.isCellWithinRange(v,t[0].getRange().getCoords())?K(t[0]??null):K(null);const n=s.getSelectedRanges(),r=n.getMerges().length>0,l=n.isOverlapping();let i=!0;for(let t=0;i&&t<e.length;t++)i=o.CoordUtils.isSingleCell(e[t]);Ce(l),pe(0===t.length&&!l&&(r||!i))},[ue,b,s]),t.useCommands(g,null,{onChange:()=>{const e=!s.getProtection().isFormatCellsAllowed(),t="formatPainter"===E.getMode()?.key;me.getCommand("formatPainterToggle").update({disabled:e||!g?.getCommand("copy"),state:()=>t}).updateCallback(()=>{if(t)return void E.setMode(null);return me.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:"url(\"data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A\") 7 12, pointer"}})})}},[E,de,g]),W(s.getView(),{onFreezeSplitChange:()=>{ge()}}),W(s.getSelection(),{onChange:()=>{N()}});const be=()=>{me.getCommand("sheetViewFormatGridlinesColor").update({state:()=>s.getView().getGridLineColor(),context:()=>({onColorSelect:e=>{},darkMode:u.darkMode,autoColor:s.getStyles().parseColor(u.strokeFill),schemeLookup:s.getStyles().schemeLookup(),recentColors:()=>s.getStyles().recentColors(),addRecentColor:e=>s.getStyles().addRecentColor(e),clearRecentColors:()=>s.getStyles().clearRecentColors()})}),me.getCommand("formatSheetTabColor").updateCallback(e=>{s.setTabColor(e)}).update({state:()=>s?.getTabColor()??$,context:()=>({onColorSelect:e=>{},darkMode:u.darkMode,autoColor:$,schemeLookup:s.getStyles().schemeLookup(),recentColors:()=>s.getStyles().recentColors(),addRecentColor:e=>s.getStyles().addRecentColor(e),clearRecentColors:()=>s.getStyles().clearRecentColors()})})},we=()=>{me.getCommand("formatBorder").update({context:()=>({onBorderSelect:e=>{R(e)},darkMode:u.darkMode,quickBorder:S,autoColor:s.getStyles().getNormal().getFont().getFill(),autoStyle:e.IBorder.StrokeStyle.Thin,createTemporaryBorder:e=>s.getStyles().getNormal().createTemporaryStyle({border:e}).getBorder(),schemeLookup:s.getStyles().schemeLookup()})})};r.useEffect(()=>{we()},[S]),r.useEffect(()=>{const e=!s.getProtection().isInsertHyperlinksAllowed();me.getCommand("openHyperlink").update({disabled:!L().getHyperlink()}),me.getCommand("deleteHyperlink").update({disabled:e||!L().getHyperlink()});const t=L().getHyperlink()?"Edit":"Insert",n="Link";me.getCommand("updateHyperlink").update({label:()=>(L().getHyperlink(),`${t} ${n}`),scopedLabels:{contextMenu:`${t} ${n}…`,insert:`${n}…`,hyperlink:`${t}…`},disabled:e})},[L()?.getHyperlink(),de]),r.useEffect(()=>{const e=L().getComments(),t=()=>e?"Edit":"Insert",n=()=>e?"Comments":"Comment";me.getCommand("updateComments").update({label:()=>`${t()} ${n()}`,scopedLabels:{contextMenu:`${t()} ${n()}…`,insert:`${n()}…`}})},[L()?.getComments(),de]),W(s,{onViewChange:()=>{const t=s.getView();me.getCommand("sheetViewToggleFormulaView").update({state:t.isShowFormulas()}),me.getCommand("sheetViewToggleShowZeros").update({state:t.isShowZeros()}),me.getCommand("gridlinesToggle").update({state:t.isShowColumnGridlines()||t.isShowRowGridlines()}),me.getCommand("sheetViewToggleGridlinesColumns").update({state:t.isShowColumnGridlines()}),me.getCommand("sheetViewToggleGridlinesRows").update({state:t.isShowRowGridlines()}),me.getCommand("sheetViewToggleShowHeadings").update({state:t.isShowColumnHeaders()||t.isShowRowHeaders()}),me.getCommand("sheetViewToggleShowHeadingColumns").update({state:t.isShowColumnHeaders()}),me.getCommand("sheetViewToggleShowHeadingRows").update({state:t.isShowRowHeaders()}),me.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>s.getView().getColumnHeaderStyle()===e.ISheetView.HeaderTextStyle.Zero&&s.getView().getRowHeaderStyle()===e.ISheetView.HeaderTextStyle.Zero}),be()},onTabColorChange:()=>{be()},onMergesChange:()=>{ge()},onMovablesChange:()=>{ge()},onTablesChange:()=>{ge()},onProtectionChange:()=>{ge(),ce()},onStyleChange:()=>{be(),we(),ge()}}),r.useEffect(()=>{be(),we()},[u]),r.useEffect(()=>{const e=!s.getProtection().isFormatCellsAllowed(),t=A.length>0&&!U||e,n=J(U),o={context:n};me.getCommand("editTable").update(o),me.getCommand("deleteTable").update(o),me.getCommand("convertTableToRange").update(o);const r={context:n,disabled:t};me.getCommand("formatTableStyle").update({label:U?"Apply Table Style":"Format As Table",...r}),me.getCommand("formatTableStyleClearCellStyles").update(r),me.getCommand("deleteTableStyle").update(r),me.getCommand("convertTableToRange").update(r),me.getCommand("insertTable").update({disabled:t||A.length>0});const l={context:n,disabled:t||0===A.length};me.getCommand("tableHeaderRowToggle").update(l),me.getCommand("tableTotalRowToggle").update(l),me.getCommand("autoFilterToggle").update(l),me.getCommand("formatTableStyleClearTableStyle").update({...l,disabled:l.disabled||!U||null===U.getStyleOptions().name})},[U,A,de]),r.useEffect(()=>{me.getCommand("sheetZoomOut").updateCallback(()=>{s.getView().update({zoomScale:o.CommonUtils.findNextStep(s.getView().getZoomScale(),!1)})}),me.getCommand("sheetZoomIn").updateCallback(()=>{s.getView().update({zoomScale:o.CommonUtils.findNextStep(s.getView().getZoomScale())})}),me.getCommand("sheetZoom100").updateCallback(()=>{s.getView().update({zoomScale:100})}),me.getCommand("gridlinesToggle").updateCallback(()=>{const e=s.getView().isShowColumnGridlines()&&s.getView().isShowRowGridlines();s.getView().update({showColumnGridlines:!e,showRowGridlines:!e})}),me.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{s.getView().update({showRowGridlines:!s.getView().isShowRowGridlines()})}),me.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{s.getView().update({showColumnGridlines:!s.getView().isShowColumnGridlines()})}),me.getCommand("sheetViewFormatGridlinesColor").updateCallback(e=>{s.getView().update({gridLineColor:e})}),me.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const e=s.getView().isShowColumnHeaders()&&s.getView().isShowRowHeaders();s.getView().update({showColumnHeaders:!e,showRowHeaders:!e})}),me.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{s.getView().update({showColumnHeaders:!s.getView().isShowColumnHeaders()})}),me.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{s.getView().update({showRowHeaders:!s.getView().isShowRowHeaders()})}),me.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const t=s.getView().getColumnHeaderStyle()===e.ISheetView.HeaderTextStyle.Zero&&s.getView().getRowHeaderStyle()===e.ISheetView.HeaderTextStyle.Zero;s.getView().update({columnHeaderStyle:t?e.ISheetView.HeaderTextStyle.A1:e.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:t?e.ISheetView.HeaderTextStyle.One:e.ISheetView.HeaderTextStyle.Zero})}),me.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{s.getView().update({showFormulas:!s.getView().isShowFormulas()})}),me.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{s.getView().update({showZeros:!s.getView().isShowZeros()})})},[s]),r.useEffect(()=>{const e=s.getView().getFreezePanes(),t=()=>0!==e.coords.rowIndex,n=()=>0!==e.coords.colIndex,o=()=>0!==e.coords.rowIndex||0!==e.coords.colIndex;me.getCommand("freezeToggle").updateCallback(()=>{o()?s.getView().setFreezePanes(null):o()?n()?s.getView().setFreezePanes({coords:{rowIndex:v.rowIndex}}):t()&&s.getView().setFreezePanes({coords:{colIndex:v.colIndex}}):s.getView().setFreezePanes({coords:v})}).update({state:o,disabled:()=>!v||!o()&&0===v.rowIndex&&0===v.colIndex}),me.getCommand("freezeToggleHorizontal").updateCallback(()=>{s.getView().setFreezePanes({coords:{rowIndex:t()?0:v.rowIndex}})}).update({state:t,disabled:()=>!v||!t()&&0===v.rowIndex}),me.getCommand("freezeToggleVertical").updateCallback(()=>{s.getView().setFreezePanes({coords:{colIndex:n()?0:v.colIndex}})}).update({state:n,disabled:()=>!v||!n()&&0===v.colIndex}),me.getCommand("unfreeze").updateCallback(()=>{s.getView().setFreezePanes(null)}).update({disabled:()=>!o()})},[ue,v,s,u]);const ye=L().getStyle(),xe=ye.getFont(),qe=ye.getAlignment(),Se=qe.getHorizontal(),Re=qe.getVertical(),ke=qe.getOverflow(),Me=qe.getRotation();return r.useEffect(()=>{me.getCommand("formatCellStyle").update({context:()=>({styles:()=>s.getStyles(),named:()=>L().getStyle(!0).getNamed(),bodyStyle:Y,createTemporaryCell:e=>s.createTemporaryCell(e)})}),me.getCommand("formatFillColor").update({state:()=>{let t=null;const n=ye.getFill();return n?.getType()===e.IFill.Type.Solid?t=n.getColor():n?.getType()===e.IFill.Type.Gradient?t=n.getStops()?.[0]?.getColor():n?.getType()===e.IFill.Type.Pattern&&(t=n.getBackground()),t},context:()=>{const e=s.getStyles();return{onColorSelect:e=>{M(e??$)},darkMode:u.darkMode,quickColor:k,autoColor:$,schemeLookup:e.schemeLookup(),recentColors:e.recentColors(),addRecentColor:t=>e.addRecentColor(t),clearRecentColors:()=>e.clearRecentColors()}}}),me.getCommand("formatFontColor").update({state:()=>xe.toJSON()?.fill?xe.getFill():null,context:()=>{const e=s.getStyles();return{onColorSelect:e=>{I(e)},darkMode:u.darkMode,quickColor:T,autoColor:e.getNormal().getFont().getFill(),schemeLookup:e.schemeLookup(),recentColors:e.recentColors(),addRecentColor:t=>e.addRecentColor(t),clearRecentColors:()=>e.clearRecentColors()}}}),me.getCommand("formatNumberFormat").update({state:()=>ye.getNumberFormat(),context:()=>L}),me.getCommand("formatNumberDialog").update({state:()=>ye.getNumberFormat(),context:()=>L}),me.getCommand("formatFontFamily").update({state:()=>xe.getFamily()}),me.getCommand("formatFontSize").update({state:()=>xe.getSize()});const t=function(){const e=xe.getWeight()||0;return!isNaN(e)&&e>500};me.getCommand("formatBoldToggle").updateCallback(function(){j(this,{font:{weight:t()?400:700}})}).update({state:t});const n=function(){return xe.getStyle()===e.IFont.Style.Italic};me.getCommand("formatItalicToggle").updateCallback(function(){j(this,{font:{style:n()?e.IFont.Style.Normal:e.IFont.Style.Italic}})}).update({state:n}),me.getCommand("formatStrikeThroughToggle").updateCallback(function(){j(this,{font:{strike:!xe.getStrike()}})}).update({state:xe.getStrike()}),me.getCommand("formatUnderlinedToggle").updateCallback(function(){j(this,{font:{underline:xe.getUnderline()!==e.IFont.UnderlineStyle.Single?e.IFont.UnderlineStyle.Single:e.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===e.IFont.UnderlineStyle.Single}),me.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){j(this,{font:{underline:xe.getUnderline()!==e.IFont.UnderlineStyle.Double?e.IFont.UnderlineStyle.Double:e.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===e.IFont.UnderlineStyle.Double}),me.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){j(this,{font:{underline:xe.getUnderline()!==e.IFont.UnderlineStyle.SingleAccounting?e.IFont.UnderlineStyle.SingleAccounting:e.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===e.IFont.UnderlineStyle.SingleAccounting}),me.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){j(this,{font:{underline:xe.getUnderline()!==e.IFont.UnderlineStyle.DoubleAccounting?e.IFont.UnderlineStyle.DoubleAccounting:e.IFont.UnderlineStyle.None}})}).update({state:xe.getUnderline()===e.IFont.UnderlineStyle.DoubleAccounting}),me.getCommand("formatSuperscriptToggle").updateCallback(function(){j(this,{font:{verticalAlign:xe.getVerticalAlignment()!==e.IFont.VerticalAlignment.Super?e.IFont.VerticalAlignment.Super:e.IFont.VerticalAlignment.Baseline}})}).update({state:xe.getVerticalAlignment()===e.IFont.VerticalAlignment.Super}),me.getCommand("formatSubscriptToggle").updateCallback(function(){j(this,{font:{verticalAlign:xe.getVerticalAlignment()!==e.IFont.VerticalAlignment.Sub?e.IFont.VerticalAlignment.Sub:e.IFont.VerticalAlignment.Baseline}})}).update({state:xe.getVerticalAlignment()===e.IFont.VerticalAlignment.Sub});const o=()=>ke===e.ITextFrame.Overflow.Visible;me.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){j(this,{alignment:{overflow:(o(),e.ITextFrame.Overflow.Visible)}})}).update({state:o});const r=()=>ke===e.ITextFrame.Overflow.Wrap;me.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){j(this,{alignment:{overflow:r()?e.ITextFrame.Overflow.Visible:e.ITextFrame.Overflow.Wrap}})}).update({state:r});const l=function(){return ke===e.ITextFrame.Overflow.Clip};me.getCommand("formatTextOverflowClipToggle").updateCallback(function(){j(this,{alignment:{overflow:l()?e.ITextFrame.Overflow.Visible:e.ITextFrame.Overflow.Clip}})}).update({state:l});const i=function(){return ke===e.ITextFrame.Overflow.Shrink};me.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){j(this,{alignment:{overflow:i()?e.ITextFrame.Overflow.Visible:e.ITextFrame.Overflow.Shrink}})}).update({state:i});const a=function(){return ke===e.ITextFrame.Overflow.Shrink};me.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){j(this,{alignment:{overflow:a()?e.ITextFrame.Overflow.Visible:e.ITextFrame.Overflow.Ellipsis}})}).update({state:a,disabled:!0});const d=function(){return Re===e.ITextFrame.VerticalAlignment.Top};me.getCommand("formatAlignTopToggle").updateCallback(function(){j(this,{alignment:{vertical:d()?e.ITextFrame.VerticalAlignment.Bottom:e.ITextFrame.VerticalAlignment.Top}})}).update({state:d});const c=function(){return Re===e.ITextFrame.VerticalAlignment.Center};me.getCommand("formatAlignMiddleToggle").updateCallback(function(){j(this,{alignment:{vertical:c()?e.ITextFrame.VerticalAlignment.Bottom:e.ITextFrame.VerticalAlignment.Center}})}).update({state:c});const g=function(){return Re===e.ITextFrame.VerticalAlignment.Bottom};me.getCommand("formatAlignBottomToggle").updateCallback(function(){j(this,{alignment:{vertical:(g(),e.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:g});const h=function(){return Re===e.ITextFrame.VerticalAlignment.Justify};me.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){j(this,{alignment:{vertical:h()?e.ITextFrame.VerticalAlignment.Bottom:e.ITextFrame.VerticalAlignment.Justify}})}).update({state:h});const m=function(){return Re===e.ITextFrame.VerticalAlignment.Distributed};me.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){j(this,{alignment:{vertical:m()?e.ITextFrame.VerticalAlignment.Bottom:e.ITextFrame.VerticalAlignment.Distributed}})}).update({state:m});const f=function(){return Se===e.ITextFrame.HorizontalAlignment.Left};me.getCommand("formatAlignLeftToggle").updateCallback(function(){j(this,{alignment:{horizontal:f()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Left}})}).update({state:f});const p=function(){return Se===e.ITextFrame.HorizontalAlignment.Center};me.getCommand("formatAlignCenterToggle").updateCallback(function(){j(this,{alignment:{horizontal:p()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Center}})}).update({state:p});const v=function(){return Se===e.ITextFrame.HorizontalAlignment.CenterContinuous};me.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const t={alignment:{horizontal:v()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};j(this,t)}).update({state:v});const C=function(){return Se===e.ITextFrame.HorizontalAlignment.Fill};me.getCommand("formatAlignFillToggle").updateCallback(function(){const t={alignment:{horizontal:C()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Fill,rotation:null}};j(this,t)}).update({state:C});const b=function(){return Se===e.ITextFrame.HorizontalAlignment.Distributed};me.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){j(this,{alignment:{horizontal:b()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:b});const w=function(){return Se===e.ITextFrame.HorizontalAlignment.Right};me.getCommand("formatAlignRightToggle").updateCallback(function(){j(this,{alignment:{horizontal:w()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Right}})}).update({state:w});const y=function(){return Se===e.ITextFrame.HorizontalAlignment.Justify};me.getCommand("formatAlignJustifyToggle").updateCallback(function(){j(this,{alignment:{horizontal:y()?e.ITextFrame.HorizontalAlignment.General:e.ITextFrame.HorizontalAlignment.Justify}})}).update({state:y});const x=!s.getProtection().isFormatCellsAllowed(),q=Se===e.ITextFrame.HorizontalAlignment.CenterContinuous||Se===e.ITextFrame.HorizontalAlignment.Fill;me.getCommand("formatTextRotate0").updateCallback(function(e){j(this,{alignment:{rotation:0}})}).update({disabled:x||q,state:0===Me}),me.getCommand("formatTextRotate45").updateCallback(function(e){j(this,{alignment:{rotation:e??1?45:0}})}).update({disabled:x||q,state:45===Me}),me.getCommand("formatTextRotate90").updateCallback(function(e){j(this,{alignment:{rotation:e??1?90:0}})}).update({disabled:x||q,state:90===Me}),me.getCommand("formatTextRotate270").updateCallback(function(e){j(this,{alignment:{rotation:e??1?270:0}})}).update({disabled:x||q,state:270===Me}),me.getCommand("formatTextRotate315").updateCallback(function(e){j(this,{alignment:{rotation:e??1?315:0}})}).update({disabled:x||q,state:315===Me}),me.getCommand("formatTextRotateCustom").updateCallback(function(e){j(this,{alignment:{rotation:e}})}).update({disabled:x||q,state:Me??0})},[ye,s,u,k,T]),r.useEffect(()=>{const t=!s.getProtection().isFormatCellsAllowed(),n=s.getSelectedRanges().getMerges().length>0,r=async(t,n)=>{O(n,async o=>{const r=async(r=!1)=>{const l=await Promise.resolve(m?.showBusy?.(n.label()));try{const n=o.getSelectedRanges();if(n.merge({orientations:t,discardMultipleValues:r}),t===e.IRange.Orientations.Both){const t={alignment:{horizontal:e.ITextFrame.HorizontalAlignment.Center}};n.updateStyle(t)}}catch(e){throw e}finally{l?.()}};let l;try{await r()}catch(e){if("discardMultipleValues"!==e.type)throw e;l=!0}if(l&&m?.showOptions){if("Merge"!==await(m?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})))return;await r(!0)}},void 0,void 0,!1)},l=e=>{O(e,async e=>{try{const t=e.getSelectedRanges();t.unmerge();const n={alignment:{horizontal:null}};t.updateStyle(n)}catch(e){throw e}})};me.getCommand("mergeToggle").updateCallback(function(){o.CoordUtils.isSingleCell(s.getSelectedRange().getCoords())||(n?l(this):r(e.IRange.Orientations.Both,this))}).update({state:n,disabled:!fe||t}),me.getCommand("mergeHorizontal").updateCallback(function(){r(e.IRange.Orientations.Column,this)}).update({disabled:!fe||t}),me.getCommand("mergeVertical").updateCallback(function(){r(e.IRange.Orientations.Row,this)}).update({disabled:!fe}),me.getCommand("unmerge").updateCallback(function(){l(this)}).update({disabled:!n||!fe||t});const i={disabled:t};me.getCommand("hideRows").updateCallback(function(){O(this,e=>{e.getRowHeaders().setHidden(e.getSelectedRanges().getCoords(),!0)})}).update(i),me.getCommand("hideColumns").updateCallback(function(){O(this,e=>{e.getColumnHeaders().setHidden(e.getSelectedRanges().getCoords(),!0)})}).update(i),me.getCommand("unhideRows").updateCallback(function(){O(this,e=>{e.getRowHeaders().setHidden(e.getSelectedRanges().getCoords(),!1)})}).update(i),me.getCommand("unhideColumns").updateCallback(function(){O(this,e=>{e.getColumnHeaders().setHidden(e.getSelectedRanges().getCoords(),!1)})}).update(i),me.getCommand("autoFitRows").updateCallback(function(){O(this,t=>{t.getSelectedRanges().autoFit({orientations:e.IRange.Orientations.Row})})}).update(i),me.getCommand("autoFitColumns").updateCallback(function(){O(this,t=>{t.getSelectedRanges().autoFit({orientations:e.IRange.Orientations.Column})})}).update(i);let a=!1,d=0,c=!1,u=!1,g=0,h=!1;!b||t||ve||(a=b.isEntireColumnsAny(),a&&!b.isEntireColumns()?c=!0:d=b.getColumnCount(),u=b.isEntireRowsAny(),u&&!b.isEntireRows()?h=!0:g=b.getRowCount());const f={disabled:t||b&&1!==b.getCount()};me.getCommand("sortAscending").update(f),me.getCommand("sortDescending").update(f);const p={disabled:a||u||t||ve},v=a||t||ve||h;v&&(d=1);const C=u||t||ve||c;C&&(g=1);let w="",y="",x="",q="",S="",R="",k="",M="",T="";d>1&&(R=y=d+" ",k=x="s"),g>1&&(M=q=g+" ",T=S="s"),"copy"===E.getMode()?.key?(w=q=y="Copied ",x=S="s"):"cut"===E.getMode()?.key&&(w=q=y="Cut ",x=S="s");let I="",F="";if(b){const t=b.getDefaultShiftOrientation()===e.IRange.Orientation.Column;I=` (${t?"Shift Right":"Shift Down"})`,F=` (${t?"Shift Left":"Shift up"})`,me.getCommand("deleteCells").update({label:`Delete Cells${F}`})}me.getCommand("insertCells").update({label:`Insert ${w}Cells${I}`,scopedLabels:{insertCells:`${w}At Selection`}}),me.getCommand("insertCellsShiftRight").update(p),me.getCommand("insertCellsShiftDown").update(p),me.getCommand("deleteCellsShiftUp").update(p),me.getCommand("deleteCellsShiftLeft").update(p),me.getCommand("insertRows").update({label:`Insert ${q}Row${S}`,scopedLabels:{insertCells:`${q}Row${S}`},disabled:C}),me.getCommand("insertRowsAfter").update({label:`Insert ${q}Row${S} Below`,disabled:C}),me.getCommand("insertColumns").update({label:`Insert ${y}Column${x}`,scopedLabels:{insertCells:`${y}Column${x}`},disabled:v}),me.getCommand("insertColumnsAfter").update({label:`Insert ${y}Column${x} After`,disabled:v}),me.getCommand("deleteRows").update({label:`Delete ${M}Row${T}`,scopedLabels:{deleteCells:`${M}Row${T}`},disabled:C}),me.getCommand("deleteColumns").update({label:`Delete ${R}Column${k}`,scopedLabels:{deleteCells:`${R}Column${k}`},disabled:v})},[ue,fe,ve,b,E,m,de]),r.useEffect(()=>{const t=s.getProtection(),n=s.getProtection().isLocked(),o=!t.isFormatCellsAllowed(),r={disabled:o};me.getCommand("protectionSheetToggle").updateCallback(async(e,o)=>{let r=null;try{if(n){let e=null;if(t.hasPassword()){const t=await(m?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"}));if("Unprotect"!==t.option)return;e=t.input}r=await Promise.resolve(m?.showBusy?.(o.label())),await t.unlock(e)}else r=await Promise.resolve(m?.showBusy?.(o.label())),await t.lock();r?.()}catch(e){r?.(),m?.showError?.(e)}}).update({state:n,label:()=>n?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:n?"Unprotect":"Protect"}}),me.getCommand("deleteTable").update(r),me.getCommand("sortAscending").update(r),me.getCommand("sortDescending").update(r),me.getCommand("sortCustom")?.update(r),me.getCommand("updateComments").update(r),me.getCommand("deleteComments").update(r),me.getCommand("insertChart")?.update(r),me.getCommand("insertImageFromFile").update(r),me.getCommand("insertImageFromURL").update(r),me.getCommand("formatBorder").update(r),me.getCommand("formatFillColor").update(r),me.getCommand("formatFontColor").update(r),me.getCommand("formatBoldToggle").update(r),me.getCommand("formatItalicToggle").update(r),me.getCommand("formatUnderlinedToggle").update(r),me.getCommand("formatStrikeThroughToggle").update(r),me.getCommand("formatSuperscriptToggle").update(r),me.getCommand("formatSubscriptToggle").update(r),me.getCommand("formatAlignTopToggle").update(r),me.getCommand("formatTextOverflowVisibleToggle").update(r),me.getCommand("formatTextOverflowWrapToggle").update(r),me.getCommand("formatTextOverflowClipToggle").update(r),me.getCommand("formatTextOverflowShrinkToggle").update(r),me.getCommand("formatAlignMiddleToggle").update(r),me.getCommand("formatAlignBottomToggle").update(r),me.getCommand("formatAlignDistributedVerticalToggle").update(r),me.getCommand("formatAlignJustifyVerticalToggle").update(r),me.getCommand("formatAlignLeftToggle").update(r),me.getCommand("formatAlignCenterToggle").update(r),me.getCommand("formatAlignRightToggle").update(r),me.getCommand("formatAlignJustifyToggle").update(r),me.getCommand("formatAlignCenterContinuousToggle").update(r),me.getCommand("formatAlignDistributedHorizontalToggle").update(r),me.getCommand("formatAlignFillToggle").update(r),me.getCommand("formatFontSizeIncrease").update(r),me.getCommand("formatFontSizeDecrease").update(r),me.getCommand("formatFontFamily").update(r),me.getCommand("formatFontSize").update(r),me.getCommand("formatNumberFormat").update(r),me.getCommand("formatNumberFormatGeneralStyle").update(r),me.getCommand("formatNumberFormatNumberStyle").update(r),me.getCommand("formatNumberFormatTimeStyle").update(r),me.getCommand("formatNumberFormatDateStyle").update(r),me.getCommand("formatNumberFormatAccountingStyle").update(r),me.getCommand("formatNumberFormatPercentStyle").update(r),me.getCommand("formatNumberFormatScientificStyle").update(r),me.getCommand("formatNumberFormatCommaStyle").update(r),me.getCommand("formatNumberFormatIncreaseDecimal").update(r),me.getCommand("formatNumberFormatDecreaseDecimal").update(r),me.getCommand("hideColumns").update(r),me.getCommand("unhideColumns").update(r),me.getCommand("hideRows").update(r),me.getCommand("unhideRows").update(r),me.getCommand("quickFormulaSum").update(r),me.getCommand("quickFormulaAverage").update(r),me.getCommand("quickFormulaCount").update(r),me.getCommand("quickFormulaMax").update(r),me.getCommand("quickFormulaMin").update(r),me.getCommand("startEditCurrentTime").update(r),me.getCommand("startEditCurrentDate").update(r),me.getCommand("startEditValueAbove").update(r),me.getCommand("fillDown").update(r),me.getCommand("fillRight").update(r),me.getCommand("fillUp").update(r),me.getCommand("fillLeft").update(r),me.getCommand("formatCellStyle").update(r),me.getCommand("formatTableStyle").update(r),me.getCommand("formatPainterToggle").update(r),me.getCommand("formatBorderAddOutline").update(r),me.getCommand("formatBorderClearOutline").update(r),me.getCommand("formatIndentDecrease").update(r),me.getCommand("formatIndentIncrease").update(r),me.getCommand("clearContents").update(r),me.getCommand("clearFormats").update(r),me.getCommand("clearAll").update(r),me.getCommand("clearComments").update(r),me.getCommand("clearHyperlinks").update(r),me.getCommand("autoFilterClear").update(r),me.getCommand("autoFilterReapply").update(r);const l=Se===e.ITextFrame.HorizontalAlignment.CenterContinuous||Se===e.ITextFrame.HorizontalAlignment.Fill,i={disabled:o||l};me.getCommand("formatTextRotate0").update(i),me.getCommand("formatTextRotate45").update(i),me.getCommand("formatTextRotate90").update(i),me.getCommand("formatTextRotate270").update(i),me.getCommand("formatTextRotate315").update(i),me.getCommand("formatTextRotateCustom").update(i),me.getCommand("formatTextRotateVertical").update(i)},[ue]),me}var _,Z;!function(){if(Z)return _;Z=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,l="object"==typeof R&&R&&R.Object===Object&&R,i="object"==typeof self&&self&&self.Object===Object&&self,a=l||i||Function("return this")(),s=Object.prototype.toString,d=Math.max,c=Math.min,u=function(){return a.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function h(l){if("number"==typeof l)return l;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(l))return NaN;if(g(l)){var i="function"==typeof l.valueOf?l.valueOf():l;l=g(i)?i+"":i}if("string"!=typeof l)return 0===l?l:+l;l=l.replace(e,"");var a=n.test(l);return a||o.test(l)?r(l.slice(2),a?2:8):t.test(l)?NaN:+l}_=function(e,t,n){var o,r,l,i,a,s,m=0,f=!1,p=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function C(t){var n=o,l=r;return o=r=void 0,m=t,i=e.apply(l,n)}function b(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-m>=l}function w(){var e=u();if(b(e))return y(e);a=setTimeout(w,function(e){var n=t-(e-s);return p?c(n,l-(e-m)):n}(e))}function y(e){return a=void 0,v&&o?C(e):(o=r=void 0,i)}function x(){var e=u(),n=b(e);if(o=arguments,r=this,s=e,n){if(void 0===a)return function(e){return m=e,a=setTimeout(w,t),f?C(e):i}(s);if(p)return a=setTimeout(w,t),C(s)}return void 0===a&&(a=setTimeout(w,t)),i}return t=h(t)||0,g(n)&&(f=!!n.leading,l=(p="maxWait"in n)?d(h(n.maxWait)||0,t):l,v="trailing"in n?!!n.trailing:v),x.cancel=function(){void 0!==a&&clearTimeout(a),m=0,o=s=r=a=void 0},x.flush=function(){return void 0===a?i:y(u())},x}}();var X,Y,J={exports:{}},Q={};Y||(Y=1,J.exports=function(){if(X)return Q;X=1;var e=r,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,o=e.useEffect,l=e.useLayoutEffect,i=e.useDebugValue;function a(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!t(e,o)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),s=n({inst:{value:r,getSnapshot:t}}),d=s[0].inst,c=s[1];return l(function(){d.value=r,d.getSnapshot=t,a(d)&&c({inst:d})},[e,r,t]),o(function(){return a(d)&&c({inst:d}),e(function(){a(d)&&c({inst:d})})},[e]),i(r),r};return Q.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,Q}()),J.exports;var ee,te,ne={exports:{}},oe={exports:{}},re=oe.exports;function le(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}!function(){if(te)return ne.exports;te=1;for(var e=(ee||(ee=1,function(){var e,t,n,o,r,l;"undefined"!=typeof performance&&null!==performance&&performance.now?oe.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(oe.exports=function(){return(e()-r)/1e6},t=process.hrtime,o=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),l=1e9*process.uptime(),r=o-l):Date.now?(oe.exports=function(){return Date.now()-n},n=Date.now()):(oe.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}.call(re)),oe.exports),t="undefined"==typeof window?R:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],l=t["cancel"+o]||t["cancelRequest"+o],i=0;!r&&i<n.length;i++)r=t[n[i]+"Request"+o],l=t[n[i]+"Cancel"+o]||t[n[i]+"CancelRequest"+o];if(!r||!l){var a=0,s=0,d=[],c=1e3/60;r=function(t){if(0===d.length){var n=e(),o=Math.max(0,c-(n-a));a=o+n,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(a)}catch(e){setTimeout(function(){throw e},0)}},Math.round(o))}return d.push({handle:++s,callback:t,cancelled:!1}),s},l=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}ne.exports=function(e){return r.call(t,e)},ne.exports.cancel=function(){l.apply(t,arguments)},ne.exports.polyfill=function(e){e||(e=t),e.requestAnimationFrame=r,e.cancelAnimationFrame=l},ne.exports}();const ie=r.memo(r.forwardRef((e,l)=>{const{style:i=t.ReactUtils.EmptyCssProperties,orientation:a,sheet:s,onShowTooltip:d,onCloseTooltip:c,onScrollOffset:u,showCustomScrollButtons:g=!1,offset:h=0,totalSize:m=0,viewportSize:f=0,...p}=e;if(!s)throw new Error("SheetScrollBar needs a sheet model");const[v]=T(),C=t.useCallbackRef(d,[d]),b=t.useCallbackRef(c,[c]),w=(y=v,x=l,r.useMemo(()=>null===y&&null===x?null:e=>{le(y,e),le(x,e)},[y,x]));var y,x;const[q,S]=r.useState(()=>{const e=s.getView().getTopLeft();return a===t.ScrollbarOrientation.Vertical?e.top:e.left}),R=()=>{const e=s.getView().getFreezePanes();if(a===t.ScrollbarOrientation.Vertical){if(0===e.coords.rowIndex)return{shift:0,scroll:0};return{shift:s.getRowHeaders().findOffset(e.coords.rowIndex)-e.topLeft.top,scroll:e.topLeft.top}}if(0===e.coords.colIndex)return{shift:0,scroll:0};return{shift:s.getColumnHeaders().findOffset(e.coords.colIndex)-e.topLeft.left,scroll:e.topLeft.left}},[k,M]=r.useState(R),[I,E]=r.useState(null),[F,A]=r.useState(!1),D=a===t.ScrollbarOrientation.Vertical?s.getRowHeaders():s.getColumnHeaders(),z=()=>{const e=s.getUsedRange()?.getCoords()??o.CoordUtils.EmptyRange,t=s.getSelection().getCoords().cell;return{colIndex:Math.max(e.colEnd,t.colIndex),rowIndex:Math.max(e.rowEnd,t.rowIndex)}},[N,L]=r.useState(z),O=N?(a===t.ScrollbarOrientation.Vertical?N.rowIndex:N.colIndex)+1:0,j=()=>{const e=z();o.CoordUtils.isEqualCells(N,e)||L(e)};W(s.getView(),{onFreezeSplitChange:()=>{M(R)}}),W(s.getSelection(),{onChange:j}),W(s,{onUsedRangeChange:j}),r.useEffect(()=>{L(z())},[s]),r.useEffect(()=>{if(!I)return F&&b?.(),void A(!1);const e=D.getTextAt(D.findIndex(q/(s.getView().getZoomScale()/100)+k.scroll+k.shift));A(!0),C?.({...I,display:(a===t.ScrollbarOrientation.Vertical?"Row":"Column")+": "+e})},[h,q,k,a,I,D,F,s]);const B=t.useCallbackRef((e,t,n)=>{S(e);const o=e+k.scroll,r=t+k.shift,l=n+k.shift+k.scroll;u?.(o,r,l)},[u,k]),V=h-k.scroll,P=f-k.shift,H=m-(k.shift+k.scroll),U=D.findOffset(O)*(s.getView().getZoomScale()/100)-(k.scroll+k.shift);return n.jsx(t.VirtualScrollbar,{ref:w,style:i,offset:V,viewportSize:P,totalSize:H,orientation:a,showCustomScrollButtons:g,onMouseDown:e=>{E({anchor:{x:e.clientX,y:e.clientY}}),e.preventDefault()},onScrollOffset:B,onMouseOut:()=>{E(null)},onMouseUp:()=>{E(null)},minSize:U,...p})}));ie.displayName="SheetScrollbar";const ae=(e,t,n=null)=>{const o=[];for(let r=0;r<e.length;r++)if(e[r].value.isSelectedAll){if(e[r].min===e[r].max&&e[r].min===n)continue;o.push({address:{min:e[r].min,max:e[r].max},update:t})}return o},se=r.memo(r.forwardRef((i,a)=>{const{sheetHeader:s,gridRef:d,sheetElement:c,commands:u,oppositeSize:g=30,containerWidth:h,containerHeight:m,headerText:f,freezeStart:p,gridStyle:v,verticalPadding:C,horizontalPadding:b,onSheetContextMenu:w,onResizeHeadersStart:y,onResizeHeaders:x,onResizeHeadersEnd:q,onResizeHeadersDown:S,onResizeHeadersUp:R,scrollPoint:k,onSelectionStart:M,onSelectionEnd:T}=i,I=r.useMemo(()=>s.getOrientation(),[s]),E=r.useRef(null),[F,A]=r.useReducer(e=>e+1,0),[D,z]=r.useReducer(e=>e+1,0),N=s?.getSheet(),L=r.useRef(!1);r.useLayoutEffect(()=>{L.current=!0},[s]);const O=r.useMemo(()=>s.getEntireRange().getCoords().max+1,[s]),j=r.useMemo(()=>{const t=I===e.IRange.Orientation.Column;return{left:t?k.left:0,top:t?0:k.top}},[k]),[B,V]=r.useState(N?.getView().getZoomScale()/100),[P,H]=r.useState(null);W(s,{onSizesChange:e=>{V(N?.getView().getZoomScale()/100),ie(re())}});const U=r.useCallback(()=>{E.current?.invalidate(),z()},[]),K=r.useCallback(o.CommonUtils.debounce(()=>{U()},10),[]),[$,G]=r.useState(null);W(s.getSheet(),{onSelectionChange(){G(N?.getSelection().getCoords()),K()},onProtectionChange(){U()},onViewChange(){K()}}),r.useLayoutEffect(()=>{ie(re())},[I,B,g]),r.useLayoutEffect(()=>{H(null),V(s?.getSheet().getView().getZoomScale()/100),ie(re())},[s]);const _=r.useCallback(e=>s.at(e)?.isHidden()||0===s.at(e)?.getSize(),[s]),Z=r.useCallback((e,t)=>s.hiddenHeadersAt(e,t),[_]),X=t.useCallbackRef(e=>s.isSelected(e),[s]),Y=t.useCallbackRef(e=>s.isSelectedAll(e),[s]),J=r.useCallback(()=>s.getMinSize(),[s]),Q=r.useCallback(()=>s.getMaxSize(),[s]),ee=t.useCallbackRef((t,n,r)=>{n/=B;const l={size:n=Math.max(J(),Math.min(o.CommonUtils.roundAccurately(n,J()),Q())),hidden:!1},i=[];if(n<=0&&(l.hidden=!0,l.size=r),i.push({address:{min:t,max:t},update:l}),n<0){const o=I===e.IRange.Orientation.Column,r=o?le.getColOffset:le.getRowOffset,l=o?le.getColIndex:le.getRowIndex,a=r(t);let s=l(a+n);const d=r(s);d===a+n?s--:i.push({address:{min:s,max:s},update:{size:a-d+n}}),t-s>1&&i.push({address:{min:s+1,max:t-1},update:{hidden:!0}})}s.updateHeaderPairs(i),x?.(t,n,r)},[F,s,B,x]),te=t.useCallbackRef((t,n,o)=>{const r=I===e.IRange.Orientation.Column;let l=null,i={min:t,max:t};if(s.isSelectedAll(t)){const e=s.getSelectedRuns();e.length>1?l="Resize "+(r?"Columns":"Rows"):i=e[0];const a={hidden:n<=0,size:(n<=0?o:n)/B};s.updateHeaderPairs(ae(e,a,t))}if(i){const e=i.max-i.min+1;let t;t=1===e?s.getRange(i).at(0).getDisplayText():s.getRange(i).toString(),l=`Resize ${r?"Column":"Row"}${e>1?"s":""} '${t}'`}q?.(t,n,l)},[F,s,q]),ne=t.useCallbackRef((t,n)=>{const o=I===e.IRange.Orientation.Column;y(t,n,`Resize ${o?"Column":"Row"}(s)`)},[y]),oe=t.useCallbackRef(t=>{let n=!1;const o=I===e.IRange.Orientation.Column,r=s.getSheet().getEntireRange().getCoords(),l=[],i=s.getSelectedRuns(),a=e=>{let t;t=o?{colStart:e.min,rowStart:r.rowStart,colEnd:e.max,rowEnd:r.rowEnd}:{colStart:r.colStart,rowStart:e.min,colEnd:r.colEnd,rowEnd:e.max},l.push(t)};for(let e=0;e<i.length;e++){const o=i[e];o.value.isSelectedAll&&(o.min<=t&&o.max>=t&&(n=!0),a(o))}n||a({min:t,max:t}),s.getSheet().getRanges(l).autoFit({orientations:o?e.IRange.Orientations.Column:e.IRange.Orientations.Row});if(_(t)){const e={hidden:null},o=ae(i,e);n||o.push({address:t,update:e}),s.updateHeaderPairs(o)}q?.(t,null,"Resize Column(s)")},[F,s,q,_]),re=()=>{const t=I===e.IRange.Orientation.Column;return{getColOffset:e=>t?s.findOffset(e):0===e?0:g/B,getColIndex:e=>t?s.findIndex(e):0,getRowOffset:e=>t?0===e?0:g/B:s.findOffset(e),getRowIndex:e=>t?0:s.findIndex(e)}},[le,ie]=r.useState(()=>re()),se=r.useCallback((n,o)=>!(n.nativeEvent.which===t.MouseButtonCodes.Right)||!Y(I===e.IRange.Orientation.Column?o.colIndex:o.rowIndex),[I,Y]),de=t.useCallbackRef(e=>{c.focusSheet()},[c]),ce=t.useCallbackRef(e=>{N?.getSelection().updateCoords(e)},[N]),{...ue}=l.useSelection({gridRef:d,commands:null,layout:le,selection:$,fillHandleBorderColor:v.body.fill,selectionBackgroundColor:v.selection.fill,selectionBorderColor:v.selection.strokeFill,selectionRemoveBackgroundColor:v.selectionRemove.fill,selectionRemoveBorderColor:v.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:ce,canSelectionSpanMergedCells:e=>{const t=N.getRange(e);return t.isEntireColumns()||t.isEntireRows()}}),ge=t.useCallbackRef(()=>{M?.();const e=N?.getSelection();e&&e.setAdjusting(e.getCoords())},[N,M]),he=t.useCallbackRef(async()=>{N?.getSelection().setAdjusting(null),T?.()},[N,T]),{...me}=l.useHeaderSelection({orientation:I,headerCount:O,gridRef:E,gridMainRef:d,newSelection:ue?.newSelection,modifySelection:ue?.modifySelection,appendSelection:ue?.appendSelection,clearSelections:ue?.clearSelections,pointerDownInterceptor:se,onPointerUp:de,onDragStart:ge,onDragEnd:he}),fe=v.selection?.strokeFill;r.useEffect(()=>{if(!E.current)return void H(null);const r=I===e.IRange.Orientation.Column,i=s.getSelectedRuns(),a=s.isProtected()?null:ee,d=(e,o,l)=>{if(l)return r?n.jsx("div",{style:{position:"absolute",borderBottom:`${v.headerSelection.strokeWidth}px solid ${fe}`,pointerEvents:"none",top:`${t.ReactUtils.boundPixel(-v.headerSelection.strokeWidth/2)}px`,left:`${t.ReactUtils.boundPixel(l.x-v.headerSelection.strokeWidth)}px`,width:`${t.ReactUtils.boundPixel(l.width+v.headerSelection.strokeWidth+1,!0)}px`,height:g+v.headerSelection.strokeWidth-.5+"px"}},e):n.jsx("div",{style:{position:"absolute",borderRight:`${v.headerSelection.strokeWidth}px solid ${fe}`,pointerEvents:"none",top:`${t.ReactUtils.boundPixel(l.y-v.headerSelection.strokeWidth)}px`,left:`${t.ReactUtils.boundPixel(-v.headerSelection.strokeWidth/2)}px`,width:g+v.headerSelection.strokeWidth-.5+"px",height:`${t.ReactUtils.boundPixel(l.height+v.headerSelection.strokeWidth+1,!0)}px`}},e)},c=(e,t,n)=>{const o={x:0,y:0,width:0,height:0};if(r){const r=n.toClipBounds(n.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:e,colEnd:Math.min(O,t)}),l.SELECTION_CLIP_INSETS);if(!r)return;o.x=r.x,o.width=r.width}else{const r=n.toClipBounds(n.getRangeCoordsBounds({rowStart:e,rowEnd:Math.min(O,t),colStart:0,colEnd:0}),l.SELECTION_CLIP_INSETS);if(!r)return;o.y=r.y,o.height=r.height}return{x:o.x,y:o.y,width:o.width,height:o.height}};H([e=>{const t=[];let d=null,c=r?e.getVisibleColumns():e.getVisibleRows();const u=r?e.getTotalRangeCoords().colStart:e.getTotalRangeCoords().rowStart;c.length>0&&c[0]>u&&(c=[c[0]-1,...c]);let g=[];const h=[];for(let e=0;e<c.length;e++){const t=c[e],n=e<c.length-1?c[e+1]:t+Z(t+1,!1)+1,r=t+1!==n;if(!d||d.max<t)if(i.length>0&&i[i.length-1].max>=t){const e=o.CommonUtils.findEqualOrGreater(i,t,e=>e.max);d=i[e]}else d=null;let l=!1,s=!1;if(d?.value&&(d.min<=t||d.min<=n&&!r)&&(l=!0,s=d.value.isSelectedAll),t===u){let e=!1,n=!1;d?.value&&d.min<=t&&(e=!0,n=d.value.isSelectedAll),t>0&&h.push({index:t-1,isNextHidden:r,isSelected:e,isSelectedAll:n,disabledResize:!0})}if(s&&g.push(h.length),h.push({index:t,isHidden:0===e&&Z(t,!1)>0,isNextHidden:r,isSelected:l,isSelectedAll:s,onDividerMouseDown:S,onDividerResizeStart:ne,onDividerResize:a,onDividerMouseUp:R,onDividerResizeEnd:te,onDividerAutoFit:oe}),r){let e=!1,r=!1;if(d&&d.min>=t&&d.max<=n-1&&d.value.isSelectedAll&&g.push(h.length),d?.value&&d.max>=n);else if(i.length>0&&i[i.length-1].max>=n){const e=o.CommonUtils.findEqualOrGreater(i,n,e=>e.max);d=i[e]}else d=null;d?.value&&d.min<=n&&(e=d.value.isSelected,r=d.value.isSelectedAll),n>0&&h.push({index:n-1,isHidden:!0,isSelected:e,isSelectedAll:r,onDividerMouseDown:S,onDividerResizeStart:ne,onDividerResize:a,onDividerMouseUp:R,onDividerResizeEnd:te,onDividerAutoFit:oe})}}if(g.length>0){let t=g.length-1;if(g.length>0){const n=h[g[t]].index;let o=null;r?(o=e.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:n,colEnd:n}),o.x+o.width>e.getBounds().width&&(t-=1,0===t&&(t=-1))):(o=e.getRangeCoordsBounds({rowStart:n,rowEnd:n,colStart:0,colEnd:0}),o.y+o.height>e.getBounds().height&&(t-=1,0===t&&(t=-1)))}const n=i?.[i.length-1],o=e.getAnchor();if("t"===o||"l"===o){const e=h[g[Math.max(0,g.length-1)]];e.showTouchDivider=n&&n.max<=e.index}else t>=0&&(h[g[t]].showTouchDivider=!0)}const{header:m,headerSelect:f,headerSelectAll:p,headerHover:C}=v??{};for(let o=0;o<h.length;o++)t.push(n.jsx(l.HeaderDivider,{orientation:I,view:e,headerStyle:m,headerStyleSelect:f,headerStyleSelectAll:p,headerStyleHover:C,disabled:s.isProtected(),...h[o]},`divider${o}`));return t},e=>{const t=[];for(let n=0;i&&n<i.length;n++)t.push(d(`selection:${e.getAnchor()}:${n}`,0,c(i[n].min,i[n].max,e)));return t}])},[D,!0,fe,v,le,O,p,F,B]),r.useEffect(()=>{E.current?.invalidate()},[F]);const pe=t.useCallbackRef(e=>f?f(e):s.getTextAt(e),[f,s]),ve=t.useCallbackRef(t=>{const{header:o,headerSelect:r,headerSelectAll:i,headerHover:a}=v??{},{range:s,key:d,...c}=t;return n.jsx(l.HeaderRenderer,{orientation:I,index:I===e.IRange.Orientation.Column?s.colStart:s.rowStart,isSelected:X,isSelectedAll:Y,zoomScale:100*B,headerText:pe,headerStyle:o,headerStyleSelect:r,headerStyleSelectAll:i,headerStyleHover:a,verticalPadding:C,horizontalPadding:b,...c},d)},[F,O,v,B,s]),Ce=t.useEditMode(),be=r.useMemo(()=>{const n="white",o="black",r={};if("touch"!==t.ReactUtils.detectIt().primaryInput){let t=I===e.IRange.Orientation.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${o}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${o}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;const l=Ce.getMode();if("formatPainter"===l?.key){const e=30,r=22;t=`url("data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 ${e} ${r}' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='${"M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z"}' stroke='${o}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}r.cursor=t}return r.backgroundColor=v?.header?.fill||"transparent",r},[I,F,Ce,v]),we=t.useImperativeElement(a,()=>({scrollTo:e=>{E.current?.scrollTo(e)},forceRender:()=>{A()},getGridElement:()=>E.current}),[]),ye=r.useCallback(e=>{me.onPointerDown(e)},[me]),xe=r.useCallback(t=>{const n=me.getCellCoordsFromClient(t.clientX,t.clientY);if(!n)return;if(!w)return;const o=I===e.IRange.Orientation.Column;w({originalEvent:t,clientX:t.clientX,clientY:t.clientY,rowIndex:o?-1:n.rowIndex,colIndex:o?n.colIndex:-1}),t.stopPropagation(),t.preventDefault()},[me,w]),qe=r.useMemo(()=>{const t=I===e.IRange.Orientation.Column;return n.jsx("div",{ref:we,children:n.jsx(l.Grid,{className:"sheet-header",style:be,ref:E,scrollPoint:j,columnCount:t?O:1,rowCount:t?1:O,width:t?h:g,height:t?g:m,freezeLeft:t?p:void 0,freezeTop:t?void 0:p,hiddenColumnsAt:t?Z:void 0,hiddenRowsAt:t?void 0:Z,showGridLines:!1,layout:le,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:xe,onPointerDown:ye,zoom:B,cellRenderer:ve,overlays:P})})},[P,le,h,m,j,be,D]);return r.useEffect(()=>{L.current=!1,E.current?.invalidate(),z()},[s,v]),qe})),de=r.memo(r.forwardRef((e,n)=>{const{view:o,sheet:r,getVisibleCells:l,gridStyle:i}=e,a=t.useCallbackRef((e,t)=>e.getStyle().getBorder(),[]),{overlay:s}=A({getVisibleCells:l,getBorderAt:a,darkMode:i.body.darkMode,shiftIfWide:!0}),d=s(o);return d&&o?d:null})),ce={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},ue={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},ge={type:e.ICell.Content.Values},he={fitDestination:!0,type:e.ICell.Content.Formats},me={fitDestination:!0,type:e.ICell.Content.Formulas},fe={transpose:!0},pe={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},ve=({element:n,sheet:i,sheetView:a,commands:s,onClipboardUpdate:d,onPaste:c,selectionRenderer:u=l.defaultSelectionRenderer,copyForegroundColor:g="rgb(33, 115, 70)",cutForegroundColor:h="rgb(33, 115, 70)",copyBackgroundColor:m="white",cutBackgroundColor:f="white",notifier:p,...v})=>{const C=t.useCallbackRef(u,[u]),b=r.useRef(null),w=t.useEditMode(),y=w.getMode(),x=r.useMemo(()=>({element:n,doCopy:t=>{const n=i.getSelectedRanges().getSnapshot(t);return new e.RangeClipboardItem(n)}}),[i,a,n]),q=r.useMemo(()=>({element:n,importFromExternal:async(t,n)=>{const o=new e.ExternalRangeClipboardItem(t,n,i.getStyles(),i.isDate1904());return await o.parse()?o:null},doPaste:async(t,n)=>{if("range"!==t?.getItemType())return;n?.contentsOnly&&delete(n={...n,type:e.ICell.Content.Values}).contentsOnly;const o=i.getSelectedRange(),r=t.getItem(),l=r.getName();return await o.doBatch(async()=>{const t=await o.copyFrom(r,n);!t||t.isEntireRows()||t.isEntireColumns()||t.autoFit({orientations:e.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(l?` ${l}`:""),autoSelect:!0}),!0}}),[i,a,p,n]),{clipboard:S,...R}=t.useCopyPaste({...v,source:x,commands:s,target:q,notifier:p,onClipboardUpdate:e=>{const t="range"===e?.getItemType()?e:null;if(t){const t=e.editMode?.(),n={...e?.isCut?.()?ue:ce,...t,args:{isClipboard:!0,...t?.args},onModeChange:e=>{e?.args?.isClipboard||S.clear(!0),t?.onModeChange?.(e)}};w.setMode(n)}b.current=t,d?.(t)},onPaste:(e,t)=>{if("range"!==e?.getItemType())return;let r="cut"===w.getMode()?.key||e.isCut?.();if(!r&&"copy"===w.getMode()?.key){const t=e.getItem().getCoords(),n=i.getSelectedRanges().getCoords();let l=!1;if(!l&&t&&n&&e.getItem().getSource?.()===i)for(let e=0;!l&&e<n.length;e++)l=o.CoordUtils.isRangesIntersect(t,n[e]);r=l}r&&w.setMode(null),n?.()?.focus(),c?.(e,t)}});r.useMemo(()=>{const e=n;if(!s)return;const o=[new t.Command("pasteValues",e,{label:"Paste Values",scopedLabels:{paste:"Values"},description:"Paste only the values of the selected cells.\n\nThe formatting is not applied.",shortcut:{key:"V",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}}),new t.Command("pasteFormats",e,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:"Paste only the formats of the selected cells.\n\nThe content is not applied."}),new t.Command("pasteFormulas",e,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new t.Command("pasteTranspose",e,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new t.Command("pasteLinks",e,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];s.addCommands(o,!0)},[s,n]),r.useEffect(()=>{if(!s)return;const e={disabled:!i.getProtection().isFormatCellsAllowed()};s.getCommand("pasteValues").updateCallback(e=>R.paste({...ge,...e})).update(e),s.getCommand("pasteFormats").updateCallback((e,t)=>R.paste({...he,description:t.label(),...e})).update(e),s.getCommand("pasteFormulas").updateCallback((e,t)=>R.paste({...me,description:t.label(),...e})).update(e),s.getCommand("pasteTranspose").updateCallback((e,t)=>R.paste({...fe,description:t.label(),...e})).update(e),s.getCommand("pasteLinks").updateCallback((e,t)=>R.paste({...pe,description:t.label(),...e})).update(e),s.getCommand("cut").update(e),s.getCommand("paste").update(e)},[i,s]);const k=r.useMemo(()=>{if(!y||!b.current)return;const e=y.key;if("copy"!==e&&"cut"!==e&&"formatPainter"!==e)return;const t=b.current.getItem();if(t.getSource()!==i)return;const n=b.current.isCut?.(),o=n?f:m,r=n?h:g,a=t.getCoords(),s=a?[a]:null;return s&&0!==s.length?e=>{const t=[];for(let n=0;n<s.length;n++){const i=s[n],a=e.toClipBounds(e.getRangeCoordsBounds(i,{top:0,left:0,right:1,bottom:1}),l.SELECTION_CLIP_INSETS);a&&(t.push(C({range:i,key:`copy-selection-background-${n}`,x:a.x,y:a.y,width:Math.max(a.width,0),height:Math.max(a.height,0),stroke:o,strokeWidth:2})),t.push(C({range:i,key:`copy-selection-foreground-${n}`,x:a.x+(a.width<=2?-1:0),y:a.y,width:Math.max(a.width,3),height:Math.max(a.height,3),stroke:r,strokeWidth:2,isAnimatedStroke:!0})))}return t}:null},[y,i,a,g,m,h,f]);return{...R,clipboard:S,overlays:k}},Ce=r.memo(r.forwardRef((e,t)=>{const{view:n,element:o,sheet:l,gridStyle:i,commands:a,notifier:s}=e,d=i.body??{},c=l.getView(),{overlays:u}=ve({element:o,sheet:l,sheetView:c,commands:a,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:d.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:d.fill,notifier:s});return W(l?.getSelection(),{onChange(e){}}),r.useEffect(()=>{n?.getStage()},[n?.getStage()]),u&&n?u(n):null})),be="_sheet-selection_12wyx_5",we={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},ye={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},xe={key:"dragCopy",description:"Drag selection to copy cell contents."},qe={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Se=(e,t)=>t.ctrlKey&&t.shiftKey?qe:t.ctrlKey?xe:t.shiftKey?ye:we,Re={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},ke=r.memo(r.forwardRef((i,a)=>{const{view:s,commands:d,className:c,onFirstRender:u,notifier:g,onShowTooltip:h,onCloseTooltip:m,sheet:f,gridRef:p,gridStyle:v,isActive:C,editingCoords:b,...w}=i,y=s?.getBounds(),q=t.useCallbackRef(h,[h]),S=t.useCallbackRef(m,[m]),[R,k]=r.useState(()=>f?.getSelection().getCoords()),M=t.useCallbackRef(e=>{o.CoordUtils.isEqualSelectionCoords(e,R)||f&&f.getSelection().updateCoords(e)},[f,R]),T=t.useEditMode(),I=r.useRef(null),[E,F]=r.useState(f?.getProtection().isLocked()),[A,D]=r.useState(f?.getView().getMovableSelection().length>0),z="touch"===t.ReactUtils.detectIt().primaryInput,N=!z&&C,L=null!==b||A,O=t.useCallbackRef(e=>{const t=o.CoordUtils.cellToRange(e);if(f.isClosed())return t;const n=f.getRange(t,{excludeHidden:!0}).getMerges();return 0===n.length?t:n[0]},[f]),j=t.useCallbackRef((t,n,o,r,l,i)=>{const a=f.getSelectedRange().getExtended(r,t).getCoords();switch(r){case e.IRange.Direction.Up:return a.rowStart;case e.IRange.Direction.Down:return a.rowEnd;case e.IRange.Direction.Left:return a.colStart;case e.IRange.Direction.Right:return a.colEnd}},[f]),B=t.useCallbackRef(()=>{const e=f.getUsedRange()?.getCoords(),t=f.getRowHeaders().getUsedRange()?.getCoords(),n=f.getColumnHeaders().getUsedRange()?.getCoords();return{...e,colEnd:Math.max(e?.colEnd??0,n?.max??0),rowEnd:Math.max(e?.rowEnd??0,t?.max??0)}},[f]),P=t.useCallbackRef((e,t)=>f.getRowHeaders().hiddenHeadersAt(e,t),[f]),H=t.useCallbackRef((e,t)=>f.getColumnHeaders().hiddenHeadersAt(e,t),[f]),U=t.useCallbackRef(e=>f.getRange(e,{excludeHidden:!0}).getMerges(),[f]),K=t.useCallbackRef(e=>{f?.getSelection().setAdjusting(e)},[f]),$=t.useCallbackRef(async()=>{f?.getSelection().setAdjusting(null);const e=T.getMode();"formatPainter"===e?.key&&(await(d?.getCommand("pasteFormats")?.execute({})),T.setMode(null))},[T,R,f,d]),G=r.useMemo(()=>{const e=T.getMode();return"cut"===e?.key||"copy"===e?.key},[T]);W(f?.getView(),{onMovableSelectionChange:()=>{D(f.getView().getMovableSelection().length>0)}}),W(f?.getSelection(),{onChange(e){const t=f.getSelection().getCoords();k(t)}}),W(f,{onProtectionChange:()=>{F(f.getProtection().isLocked())}});const{body:_={}}=v||{},Z=s.getLayout(),X=!(N&&R.ranges.length<=1&&null===b&&!E&&(!T.getMode()||G)),{cursor:Y,overlay:J,onPointerDown:Q}=l.useSelection({gridRef:p,commands:d,layout:Z,getCellCoordsAsRangeCoords:O,selection:R,fillHandleBorderColor:_.fill,selectionBackgroundColor:C?v.selection.fill:v.selectionInactive.fill,selectionBorderColor:C?v.selection.strokeFill:v.selectionInactive.strokeFill,selectionRemoveBackgroundColor:C?v.selectionRemove.fill:v.selectionInactive.fill,selectionRemoveBorderColor:C?v.selectionRemove.strokeFill:v.selectionInactive.strokeFill,disableFillDrag:X,disableMoveDrag:z||!(C&&R.ranges.length<=1&&null===b&&!E),disableTouchSelection:L,onSelectionChange:M,onSelectionDragStart:K,onSelectionDragEnd:$,onMoveDragStart:(e,t,n)=>{T.setMode(Se(0,n))},onMoveDragUpdate:(e,t,n)=>{T.setMode(Se(0,n))},onMoveDragEnd:(e,t)=>{T.setMode(null)},onMoveDragDone:async(t,n,r)=>{if(o.CoordUtils.isEqualRanges(t,n))return;const l=f.getRange(n);if(g?.showOptions){const e=l.getDifferences(t);let n=!1;for(let t=0;!n&&t<e.getCount();t++)n=e.at(t).isContentful();if(n){if("Replace"!==await(g?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})))return}}const i=!r.ctrlKey,a=r.shiftKey,s=a?i?"Insert Moved Cells":"Insert Copied Cells":i?"Move Cells":"Copy Cells",d=await(g?.showBusy?.(s));try{const n=f.getRange(t);await l.doBatch(async()=>{a?await l.insertFrom(t,{isCut:i,undoRange:n}):await l.copyFrom(t,{isCut:i,undoRange:n}),n.autoFit({skipCustomSize:!0,orientations:e.IRange.Orientations.Row,minContent:!0}),l.autoFit({skipCustomSize:!0,orientations:e.IRange.Orientations.Row,minContent:!0})},{description:s,autoSelect:!0})}catch(e){g?.showError?.(e)}finally{d?.()}},contentfulCellFinder:j,hiddenRowsAt:P,hiddenColumnsAt:H,mergedRanges:U,getDataCoords:B,canSelectionSpanMergedCells:e=>{const t=f.getRange(e);return t.isEntireColumns()||t.isEntireRows()},onFill:async(t,n)=>{const o="Auto Fill",r=await(g?.showBusy?.(o));try{await f.doBatch(()=>{f.getRange(t).autoFill(n),f.getRange(n).autoFit({orientations:e.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:o,autoSelect:!0})}catch(e){g?.showError?.(e)}finally{I.current=null,r?.()}},onFillPreview:(n,r,l)=>{if(p.current&&q){T.setMode(Re);try{I.current?.direction!==l&&(I.current=null,f.getRange(n).autoFill(r,{previewOnly:e=>{I.current={callback:e,direction:l}}}));const i=I.current?.callback?.(r);if(!i||i.isEmpty())return;const a=i.toText();if(!a)return;const d=o.CoordUtils.cellToRange(i.getCoords()),c=s.getRelativePointFromClient(0,0);let u=0,g=0,h=t.ToolTipPlacement.Bottom;if(l===e.IRange.Direction.Down){u=Z.getColOffset(d.colEnd+1)-c.x;const e=Z.getRowOffset(d.rowEnd),n=Z.getRowOffset(d.rowEnd+1);g=n-(n-e)/2-c.y,h=t.ToolTipPlacement.Right}else if(l===e.IRange.Direction.Right){g=Z.getRowOffset(d.rowEnd+1)-c.y;const e=Z.getColOffset(d.colEnd),n=Z.getColOffset(d.colEnd+1);u=n-(n-e)/2-c.x,h=t.ToolTipPlacement.Bottom}else if(l===e.IRange.Direction.Up){u=Z.getColOffset(d.colEnd+1)-c.x;const e=Z.getRowOffset(d.rowStart),n=Z.getRowOffset(d.rowStart+1);g=n-(n-e)/2-c.y,h=t.ToolTipPlacement.Right}else if(l===e.IRange.Direction.Left){g=Z.getRowOffset(d.rowEnd+1)-c.y;const e=Z.getColOffset(d.colStart),n=Z.getColOffset(d.colStart+1);u=n-(n-e)/2-c.x,h=t.ToolTipPlacement.Bottom}q({anchor:{x:u,y:g},display:a,placement:h})}catch(e){g?.showError?.(e)}}},onFillDone:()=>{I.current=null,T.setMode(null),S?.()}}),ee=t.useCallbackRef(e=>{Q(t.ReactUtils.createSyntheticEvent(e))},[Q,b]);r.useEffect(()=>{const e=s?.getStage();if(e)return e.addEventListener("pointerdown",ee),()=>{e.removeEventListener("pointerdown",ee)}},[s?.getStage()]);const te=t.useImperativeElement(a,()=>({}),[]),ne=r.useRef(null);return n.jsx("div",{className:V(c,"sheet-selection",be),style:{position:"absolute",width:y?.width,height:y?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:x([te,ne]),...w,children:J(s)})})),Me=Object.freeze({x:0,y:0,width:0,height:0}),Te={fireOnModelChange:!1},Ie=r.memo(r.forwardRef((e,t)=>{const{children:l,view:i,movable:a,onRefLoad:s,onRefUnload:d,onHide:c,onShow:u,onUnFocus:g,isDragging:h,updateFrameBounds:m,dragStart:f,style:p,disabled:v,renderMovable:C,...b}=e,[w,y]=r.useState(Me),[q,S]=r.useState(null),[R,k]=r.useState(!1),M=r.useRef(null);r.useLayoutEffect(()=>{if(a.isClosed())return;const e=a.getBounds();if(!e)return;const t=i.toViewBounds(e);y(t??Me),m(t??Me)},[i?.getBounds()]),W(a,{onBoundsChange:e=>{const t=e.getBounds();if(!t)return;const n=i.toViewBounds(t);y(n??Me),m(n)},onSelectionChange:()=>{const e=o.CommonUtils.hasFocus(M.current,!0);!R&&!e||a.isSelected()||g()}}),W(a,{onRequestFocus:()=>o.CommonUtils.whenFocus(M.current,!0)},Te),r.useEffect(()=>{const e=M.current;return s(e),()=>{d(e)}},[]);const T=r.useMemo(()=>{if(!w)return null;let{width:e,height:t}=w;return C({view:i,movable:a,disabled:v,isDragging:h,style:{position:"relative",left:0,top:0,width:e,height:t},onHide:c,onShow:u})},[i,a,w.width,w.height,v,h]);return n.jsx("div",{className:"movable",tabIndex:0,ref:x([M,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:w.x,top:w.y,width:w.width,height:w.height,...p},onMouseDown:async e=>{const t=e.shiftKey||e.ctrlKey,n=a.isSelected(),o=e.currentTarget;t&&n?a.unselect():(n&&!t||await a.select({addToSelection:t}),f(e.nativeEvent,o),o.focus())},onFocus:e=>{e.relatedTarget&&!q&&S(e.relatedTarget),k(!0)},onBlur:e=>{q&&!M?.current?.contains(e.relatedTarget)&&S(null),e.relatedTarget&&k(!1)},...b,children:T})})),Ee="_movable-area_314c6_5",Fe=r.memo(r.forwardRef((l,i)=>{const{view:a,movables:s,movablesView:d,renderMovable:c,transactional:u,onUnFocus:g,onFocus:h,disabled:m=!1,disableDrag:f=!1,disableResize:p=!1,className:v,style:C,renderDirections:b=["nw","n","ne","w","e","sw","s","se"],onFirstRender:w,...y}=l,q=a.getBounds(),S=t.useCallbackRef(w,[w]),R=t.useCallbackRef(g,[g]),k=t.useCallbackRef(h,[h]),[M,T]=r.useState([]),[I,E]=r.useState(!1),[F,A]=r.useState(!1),D=r.useRef(!0),z=r.useRef(new Map),N=r.useRef(new Map),L=r.useRef(new Map),O=r.useRef(new Map),j=r.useRef(new Map),B=r.useRef({onRequestFocus:e=>(oe(e),null)}),P=r.useRef(null),H=r.useRef(null),U=r.useRef(null),[K,$]=r.useReducer(e=>e+1,0);r.useLayoutEffect(()=>{$()},[a,s]),W(s,{onCollectionChange:()=>{const e=s.search({address:a.getVisibleRangeCoords(),excludeHidden:!0}),t=j.current;t.forEach(e=>{e()}),t.clear();const n=B.current;for(let o=0;o<e.length;o++){const r=e[o];if(r.isClosed())continue;const l=r.addListeners(n);t.set(r,l)}$()},onInvalidated:()=>{$()}}),W(d,{onMovableSelectionChange(e){_(),$()}});const G=r.useCallback((e,t)=>{const n=L.current.get(e);U.current&&(U.current.getTargets().forEach(e=>{if(e===n)return e.style.left=t.x+"px",e.style.top=t.y+"px",e.style.width=t.width+"px",void(e.style.height=t.height+"px")}),U.current.updateRect())},[]),_=()=>{const e=[],t=d.getMovableSelection();t.forEach(n=>{const o=L.current.get(n);if(!o)return;-1!==t.indexOf(n)&&e.push(o)}),T(t=>o.CommonUtils.isEqualArrays(t,e)?t:e)},Z=r.useRef(null),X=r.useMemo(()=>new Promise(e=>{Z.current=e}),[]),Y=r.useRef(null),J=t.useCallbackRef(async(e,t)=>{Y.current=t;await(async()=>!(!await X.then()||!U.current))()&&Y.current===t&&U.current.dragStart(e,t)},[M]),[Q,ee]=r.useState(!1),te=r.useRef(null),ne=r.useRef(null),oe=t.useCallbackRef(async(e=null)=>{if(e||(e=d.getMovableSelection()[0]),!e)return R?.(),!1;const t=L.current.get(e);t?(await o.CommonUtils.whenFocus(t),t.focus(),ne.current=t,te.current=null):te.current=e},[d]);r.useEffect(()=>{Q&&M.length>0&&ne.current!==M[0]&&oe(),D.current&&(S?.(),D.current=!1)},[M]);const re=r.useMemo(()=>{const e=s.search({address:a.getVisibleRangeCoords(),excludeHidden:!0});if(0===e.length&&0===z.current.size)return null;const t=(t,r,l,i=!0)=>{const s=t.isSelected(),d={tabIndex:l,view:a,movable:t,onRefLoad:e=>{te.current===t&&(e.focus(),ne.current=e,te.current=null),L.current.set(t,e),N.current.set(e,t),r.rendered=!0,_()},onRefUnload:e=>{L.current.delete(t),N.current.delete(e),r.rendered=!1,_()},onUnFocus:R,onHide:e=>{r.onHide=e},onShow:e=>{r.onShow=e},isDragging:s&&(F||I),disabled:m,renderMovable:c,updateFrameBounds:e=>{G(t,e)},dragStart:J,onMouseUp:()=>{if(Y.current=null,H.current){E(!1),A(!1);let e=!1;O.current?.forEach(t=>{o.CommonUtils.isEqualBounds(t.movable.getBounds(),t.startBounds)||(e=!0)}),e?ie():ae()}},style:{opacity:i?I&&s?.7:void 0:0,zIndex:I&&s?t.getZIndex()+e.length:void 0,pointerEvents:i?void 0:"none",cursor:F&&s?"grabbing":m||f?"initial":"move",boxShadow:!s||F&&!I?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return n.jsx(Ie,{...d},`movable-${t.getUUID()}`)},r=z.current,l=new Map,i=[];for(let n=0;n<e.length;n++){const o=e[n];if(o.isClosed())continue;let a=r.get(o);a||(a={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(e,t)=>{if(!t||!0===t.shown)return;t.shown=!0;const n=++t.visibilityRequestId;requestAnimationFrame(()=>{const o=z.current.get(e);o&&n===t.visibilityRequestId&&(t.onShow?.(e),o.shown=!0)})},doHide:async(e,t)=>{if(!t||!1===t?.shown)return;t.shown=!1;const n=++t.visibilityRequestId,o=await Promise.resolve(t.onHide?.(e));n===t.visibilityRequestId&&!1!==o&&(t.shown=!1,z.current.delete(e),$())},visibilityRequestId:0}),a.frame=t(o,a,n,!0),i.push(a.frame),a.doShow(o,a),r.delete(o),l.set(o,a)}const u=[];return d.getMovableSelection().forEach(e=>{const n=r.get(e);n&&(n.frame=t(e,n,-1,!1),u.push(n.frame),r.delete(e),l.set(e,n))}),r.forEach((e,n)=>{e.frame=t(n,e,-1,!1),u.push(e.frame),e.doHide(n,e),r.delete(n),l.set(n,e)}),z.current=l,_(),[...u,...i]},[K,a,c,m,f,p,I,F]),le=t.useCallbackRef((t,n)=>{const o=`${n} ${1===M.length?e.TextUtils.capitalize(N.current?.get(M[0]).getContent().getType()):"Drawings"}`;H.current&&(console.warn(`Transaction ${H.current.getDescription()} is being replaced by ${o}`),H.current.rollback(),H.current=null),H.current=u.beginCommit({description:o}),O.current.clear();for(let e=0;e<M.length;e++){const t=M[e],n=N.current?.get(t);n?O.current.set(t,{movable:n,startBounds:a.toViewBounds(n.getBounds())}):console.warn("invalid element",n)}},[u,a,M]),ie=r.useCallback(()=>{if(!H.current)return;const e=[];O.current?.forEach(t=>{e.push(t.movable)}),H.current.commit({viewAfter:{view:d,movableSelection:e}}),O.current.clear(),H.current=null},[]),ae=r.useCallback(()=>{H.current&&(H.current.rollback(),H.current=null)},[]),se=r.useRef(null);r.useEffect(()=>{se.current&&(se.current.onscroll=e=>{e.preventDefault(),e.srcElement.scrollTop=0,e.srcElement.scrollLeft=0})},[se.current]);const de=t.useImperativeElement(i,()=>({isMovableArea:()=>!0,focusMovable:oe,focus:()=>{oe()}}),[d]),[ce,ue]=r.useState(null),ge=r.useRef(!1),he=r.useRef(!1),me=r.useRef(!1);r.useEffect(()=>{if(m||0===M.length)return;if(me.current)return;if(ge.current)return;if(he.current)return void requestAnimationFrame(()=>{U.current&&P.current&&U.current.refTargets.length>0&&(me.current=!0,Z.current?.(!0)),T([...M])});ge.current=!0;const e=r.lazy(async()=>{try{const e=await Promise.resolve().then(()=>require("./CKVg7_r0lkW-LlWI.cjs"));return ge.current=!1,he.current=!0,T([...M]),e}catch(e){return console.warn(e),Z.current?.(!1),null}});ue(e)},[M,m,f,p]);const fe=r.useMemo(()=>!ce||m?null:n.jsx(r.Suspense,{children:n.jsx(ce,{className:V({dragging:I||F,resizing:I,moving:F}),container:null,ref:U,target:U.current?M:[],draggable:!m&&!f,resizable:!m&&!p,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:b,onResizeStart:e=>{le(e.target,"Resize")},onResize:e=>{if(!H.current)return e.stopDrag(),void $();E(!0);const t=0!==e.direction[0]&&0!==e.direction[1];let n=0,o=0;for(let r=0;r<M.length;r++){const l=M[r],i=O.current.get(l),s=N.current.get(l);if(!i||!s){console.warn("invalid element");continue}let d=e.dist[0],c=e.dist[1],u=e.drag.dist[0],g=e.drag.dist[1],h=i.startBounds.width,m=i.startBounds.height;0===r?(n=h,o=m):(d*=h/n,u*=h/n,c*=m/o,g*=m/o);const f={...i.startBounds};if(f.width=Math.max(0,h+d),f.height=Math.max(0,m+c),-1===e.direction[0]&&(f.width=Math.max(0,Math.min(i.startBounds.x+h,h-u))),-1===e.direction[1]&&(f.height=Math.max(0,Math.min(i.startBounds.y+m,m-g))),t&&(s.isLockAspectRatio()||e.inputEvent?.shiftKey)){const e=h/m,t=f.width/f.height;t>e?f.height=f.width/e:t<e&&(f.width=f.height*e)}-1===e.direction[0]&&(f.x=Math.max(0,Math.min(i.startBounds.x+h,i.startBounds.x+h-f.width))),-1===e.direction[1]&&(f.y=Math.min(i.startBounds.y+m,i.startBounds.y+m-f.height)),i.movable.setBounds(a.toAbsoluteBounds(f))}},onResizeEnd:e=>{E(!1),ie()},onDragStart:e=>{le(e.target,"Move")},onDrag:e=>{if(!H.current)return e.stopDrag(),void $();A(!0);for(let t=0;t<M.length;t++){const n=M[t],o=O.current.get(n);o?o.movable.setBounds(a.toAbsoluteBounds({...o.startBounds,x:o.startBounds.x+e.translate[0],y:o.startBounds.y+e.translate[1]})):console.warn("invalid element")}},onDragEnd:e=>{},onMouseUp:e=>{}})}),[K,ce,M,a,m,f,p,I,F]);return n.jsx("div",{className:V(v,"movable-area",Ee),style:{width:q.width,height:q.height,...C,position:"absolute",overflow:"hidden",willChange:"transform"},ref:x([de,se]),...y,children:n.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:q.width,height:q.height},...y,children:n.jsxs("div",{ref:P,style:{position:"absolute",pointerEvents:"auto"},onFocus:e=>{k?.(),ee(!0)},onBlur:e=>{ee(!1)},onKeyDownCapture:e=>{if(e.isDefaultPrevented())return;const n=e.nativeEvent.ctrlKey,o=e.nativeEvent.altKey,r=e.nativeEvent.shiftKey;if(e.which===t.KeyCodes.Escape){const t=d.getMovableSelection();let n=[...t];return M.forEach(e=>{if(0===n.length)return;const t=N.current.get(e);let o=n.indexOf(t);n.splice(o,1)}),n.length!==t.length&&d.selectMovables(n),0===n.length&&R?.(),void e.preventDefault()}const l=.1,i=e=>{s.updateSelected(t=>{t.setRotation(t.getRotation()+e)},"Rotate")},a=(e,t=!0)=>{s.updateSelected(n=>{const o=n.getBounds();let r=1+e;t||(r=1/r);const l=Math.sqrt(Math.pow(o.width,2)+Math.pow(o.height,2)),i=Math.atan2(o.height,o.width),a=r*l;if(a<10)return;const s=a*Math.cos(i),d=a*Math.sin(i),c={x:o.x+(o.width-s)/2,y:o.y+(o.height-d)/2,width:s,height:d};n.setBounds(c)},"Resize")},c=e=>{s.updateSelected(t=>{const n=t.getBounds(),o={x:n.x+(e.x??0),y:n.y+(e.y??0),width:n.width+(e.width??0),height:n.height+(e.height??0)};t.setBounds(o)},"Nudge")};if(e.which===t.KeyCodes.Delete)s.updateSelected(e=>{e.delete()},"Delete"),e.preventDefault();else if("a"===e.key&&n){const t=d.getMovableSelection();d.selectMovables(s.search(),!0),d.selectMovables(t,!0),e.preventDefault()}else"ArrowLeft"===e.key?(r?a(l,!1):o?i(-10):c({x:n?-10:-1}),e.preventDefault()):"ArrowRight"===e.key?(r?a(l,!0):o?i(10):c({x:n?10:1}),e.preventDefault()):"ArrowUp"===e.key?(r?a(l,!0):c({y:n?-10:-1}),e.preventDefault()):"ArrowDown"===e.key&&(r?a(l,!1):c({y:n?10:1}),e.preventDefault())},children:[re,fe]})})})})),Ae=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let l=0;l<e.length;l++){const i=e[l].getBounds();t=Math.min(i.x,t),n=Math.min(i.y,n),o=Math.max(i.x+i.width,o),r=Math.max(i.y+i.height,r)}return{x:t,y:n,width:o-t,height:r-n}},De=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",l=t?"width":"height";let i=0,a=Number.MAX_SAFE_INTEGER,s=0;for(let t=0;t<e.length;t++){const r=e[t],d=r.getBounds();i+=d[l],a=Math.min(d[o],a),s=Math.max(d[o]+d[l],s),n.push({bounds:d,movable:r})}const d=(s-a-i)/(e.length-1);n.sort((e,t)=>{const n=e.bounds[o],l=t.bounds[o];return n!==l?n-l:e.bounds[r]-t.bounds[r]});const c=new Map;c.set(n[0].movable,n[0].bounds);for(let e=1;e<n.length-1;e++){const t=n[e-1].bounds,r={...n[e].bounds};r[o]=t[o]+t[l]+d,n[e].bounds=r,c.set(n[e].movable,r)}return c.set(n[n.length-1].movable,n[n.length-1].bounds),c};function ze(n){const{movables:o,movablesView:l,transactional:i,commands:a,target:s,onRepeatCommandChange:d,notifier:c}=n,u=t.useEditMode();r.useRef(u.getMode()).current=u.getMode();const g=t.useCallbackRef(async(e,n,o=null,r=!0)=>{const l=async()=>{const i=await Promise.resolve(c?.showBusy?.(e.label()));try{await n();const a=o??e?.label?.();if(d){let n=null;e&&!1!==a&&(n=new t.SimpleCommand(e.key(),s,{label:a,description:a},l)),d(n)}i?.(),r&&u.setMode(null)}catch(e){i?.(),c?.showError?.(e)}};await l()},[d,c]),[h,m]=r.useReducer(e=>e+1,0),f=t.useCallbackRef((t,n,o)=>{if(!l)return;const r=l.getMovableSelection();if(0===r.length)return;let a="Drawings";if(1===r.length){const t=r[0];a=e.TextUtils.capitalize(t.getContent().getType())??"Drawing"}const s=`${t.label()} ${a}`;g(t,()=>{let e=null;i&&(e=i.beginCommit(s));const t=l.getMovableSelection();if(0===t.length)return;const r=o?.(t);for(let e=0;e<t.length;e++){const o=t[e];n(o,r)}e?.commit()})},[l,i]),[p,v]=r.useState(l.getMovableSelection()[0]??null),[C,b]=r.useState(!p||p?.isProtected()),w=r.useMemo(()=>[new t.Command("moveToFront",s,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){f(this,e=>{e.moveToFront()})}),new t.Command("moveForward",s,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[t.KeyModifiers.Ctrl]}},function(){f(this,e=>{e.moveForward()})}),new t.Command("moveToBack",s,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[t.KeyModifiers.Ctrl,t.KeyModifiers.Shift]}},function(){f(this,e=>{e.moveToBack()})}),new t.Command("moveBackward",s,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[t.KeyModifiers.Ctrl]}},function(){f(this,e=>{e.moveBackward()})}),new t.Command("toggleLockAspectRatio",s,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){f(this,e=>{e.setLockAspectRatio(!e.isLockAspectRatio())})}),new t.Command("formatAnchorTypeTwoCell",s,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){f(this,t=>{t.setAnchorType(e.IAnchored.Type.TwoCell)})}),new t.Command("formatAnchorTypeOneCell",s,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){f(this,t=>{t.setAnchorType(e.IAnchored.Type.OneCell)})}),new t.Command("formatAnchorTypeAbsolute",s,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){f(this,t=>{t.setAnchorType(e.IAnchored.Type.Absolute)})}),new t.Command("formatDrawAlignLeft",s,{label:"Align Left",description:"Align the selected drawings to the left."},function(){f(this,(e,t)=>{e.setBounds({x:t.x})},Ae)}),new t.Command("formatDrawAlignCenter",s,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){f(this,(e,t)=>{e.setBounds({x:(t.width-e.getBounds().width)/2+t.x})},Ae)}),new t.Command("formatDrawAlignRight",s,{label:"Align Right",description:"Align the selected drawings to the right."},function(){f(this,(e,t)=>{e.setBounds({x:t.width-e.getBounds().width+t.x})},Ae)}),new t.Command("formatDrawAlignTop",s,{label:"Align Top",description:"Align the selected drawings to the top."},function(){f(this,(e,t)=>{e.setBounds({y:t.y})},Ae)}),new t.Command("formatDrawAlignMiddle",s,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){f(this,(e,t)=>{e.setBounds({y:(t.height-e.getBounds().height)/2+t.y})},Ae)}),new t.Command("formatDrawAlignBottom",s,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){f(this,(e,t)=>{e.setBounds({y:t.height-e.getBounds().height+t.y})},Ae)}),new t.Command("formatDrawDistributeHorz",s,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){f(this,(e,t)=>{e.setBounds(t.get(e))},e=>De(e))}),new t.Command("formatDrawDistributeVert",s,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){f(this,(e,t)=>{e.setBounds(t.get(e))},e=>De(e,!1))}),new t.Command("formatDrawFlipHorz",s,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new t.Command("formatDrawFlipVert",s,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new t.Command("formatDrawGroup",s,{label:"Group",description:"Group the selected drawings into a single drawing."}),new t.Command("formatDrawUngroup",s,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new t.Command("formatDrawSwapShapes",s,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new t.Command("formatDrawSwapShapesHorz",s,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new t.Command("formatDrawSwapShapesVert",s,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[l,p]);r.useEffect(()=>{},[u]);const y=r.useMemo(()=>{let e=null;return e=a?a.createChildGroup(s,"movable",!1):new t.CommandGroup(s,"movable"),e.addCommands(w,!0),e},[a,w]);return W(p,{onAnyChange:()=>{y.getCommand("formatAnchorTypeTwoCell").update({state:p?.getAnchorType()===e.IAnchored.Type.TwoCell}),y.getCommand("formatAnchorTypeOneCell").update({state:p?.getAnchorType()===e.IAnchored.Type.OneCell}),y.getCommand("formatAnchorTypeAbsolute").update({state:p?.getAnchorType()===e.IAnchored.Type.Absolute}),y.getCommand("formatAnchorTypeAbsolute").update({state:p?.getAnchorType()===e.IAnchored.Type.Absolute}),y.getCommand("toggleLockAspectRatio").update({state:p?.isLockAspectRatio()})},onProtectedChange:e=>{b(e.isProtected())},onDelete:()=>{}}),W(l,{onMovableSelectionChange:()=>{const e=l.getMovableSelection()[0]??null;v(e),b(!e||e.isProtected()),m()}}),W(o,{onCollectionChange:()=>{m()}}),r.useEffect(()=>{const e={disabled:C};y.getCommand("formatAnchorTypeTwoCell").update(e),y.getCommand("formatAnchorTypeOneCell").update(e),y.getCommand("formatAnchorTypeAbsolute").update(e),y.getCommand("toggleLockAspectRatio").update(e);const t=o.getCount(),n=l.getMovableSelection(),r=C||t<=1||0===n.length;let i={disabled:r},a=i;if(!r&&1===n.length){const e=n[0];0===e.getZIndex()&&(i={disabled:!0}),e.getZIndex()===t-1&&(a={disabled:!0})}y.getCommand("moveToFront").update(a),y.getCommand("moveForward").update(a),y.getCommand("moveToBack").update(i),y.getCommand("moveBackward").update(i);const s={disabled:C||n.length<=1};y.getCommand("formatDrawAlignLeft").update(s),y.getCommand("formatDrawAlignCenter").update(s),y.getCommand("formatDrawAlignRight").update(s),y.getCommand("formatDrawAlignTop").update(s),y.getCommand("formatDrawAlignMiddle").update(s),y.getCommand("formatDrawAlignBottom").update(s),y.getCommand("formatDrawFlipHorz").update(s),y.getCommand("formatDrawFlipVert").update(s),y.getCommand("formatDrawGroup").update(s),y.getCommand("formatDrawUngroup").update(s),y.getCommand("formatDrawSwapShapes").update(s),y.getCommand("formatDrawSwapShapesHorz").update(s),y.getCommand("formatDrawSwapShapesVert").update(s);const d={disabled:C||n.length<=2};y.getCommand("formatDrawDistributeHorz").update(d),y.getCommand("formatDrawDistributeVert").update(d)},[h,C,h]),y}const Ne=r.memo(r.forwardRef((e,o)=>{const{children:l,disabled:i,description:a,view:s,isDragging:d,onHide:c,onShow:u,...g}=e;r.useEffect(()=>{},[a]);const h=t.useImperativeElement(o,()=>({isEmptyFrame:()=>!0}),[]),[m,{height:f,width:p}]=T();return n.jsx("div",{...g,ref:x([h,m]),children:n.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:s.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:n.jsx("div",{style:{textAlign:"center"},children:a})})})})),Le=r.memo(r.forwardRef((e,t)=>{const{view:o,sheet:l,movableProps:i,renderMovable:a,commands:s,target:d,notifier:c,onRepeatCommandChange:u}=e,g=ze({movables:l.getMovables(),movablesView:l?.getView(),transactional:l,onRepeatCommandChange:u,commands:s,target:d,notifier:c});r.useEffect(()=>{o?.getStage()},[o?.getStage()]);const h=r.useMemo(()=>n.jsx(Fe,{ref:t,view:o,movables:l.getMovables(),disableResize:!l.getProtection().isObjectsAllowed(),disableDrag:!l.getProtection().isObjectsAllowed(),movablesView:l.getView(),transactional:l,renderMovable:a,...i,onFocus:()=>{g.activate(),i?.onFocus?.()}},"movable-area"),[l,i,s,g]);return h&&o?h:null})),Oe=r.memo(r.forwardRef((i,a)=>{const{view:s,sheet:d,gridStyle:c,getCellEditor:u,showProtectedError:g,setEditingCoords:h,commands:m,notifier:f=t.DefaultNotifier}=i,p=t.useEditMode(),[v,w]=r.useState(null),[y,x]=r.useState(null),[q,S]=r.useState(null),[R,k]=r.useState(null),[M,T]=r.useState(null);r.useLayoutEffect(()=>{if(null===q)return k(null),void T(null);const e=()=>{const e=d.getRange(q).getCell(),n=e.getStyle();let o,r=n.getFill()?.toCSS(c.body.darkMode);"none"!==r.background&&"transparent"!==r.background||(r=d.getStyles().getNormal().getFill().toCSS(c.body.darkMode)),"none"!==r.background&&"transparent"!==r.background||(r={background:c.body.fill}),k({style:r}),e&&!e.getFormula()&&(o=e?.getRenderHorizontalAlignment()),T(o??t.HorizontalAlignment.Left)};return e(),d.getRange(q).addListener(()=>{e()})},[d,q,c?.body]);const I=t.useCallbackRef(()=>{let t=y.editState.dirty??"";if(void 0!==y.editState.dirty){const n=e.TextUtils.clampString(t);try{const e=y.sheet.getRange(y.coords),o=`Typing '${n}' into ${e.toString()}`;return e.setValue(t,{description:o,autoFit:!0}),S(null),x(null),p.setMode(null),h(null),!0}catch(e){throw f.showError(new Error(`Unable to enter '${n}'.`,{cause:e})),e}}},[d,y,f]),E=t.useCallbackRef(e=>d.getRange(e).getCell().getExtrusions()??o.CoordUtils.cellToRange(e),[d]),F=t.useCallbackRef(t=>{let n=e.IRange.Orientation.Row,o=!1;t!==e.IRange.Direction.Up&&t!==e.IRange.Direction.Down||(n=e.IRange.Orientation.Column),t!==e.IRange.Direction.Left&&t!==e.IRange.Direction.Up||(o=!0),d.getSelection().traverse(n,o)},[d]),A=r.useCallback((e,t)=>{if(u)return u(e,t);if(!d)return null;const{ref:o,...r}=e;return n.jsx(C,{ref:o,...r,sheet:d,bodyStyle:c?.body,activeCoords:t,commands:m,onChangeEdit:e=>{const n={sheet:d,coords:t,editState:e};p.setMode(e=>({...e,description:n.editState.editMode?"Edit":"Enter",args:{...e?.args,stateAndCoords:n}}))},editState:y.editState})},[d,R,u,y,q]),{overlay:D,startEdit:z,submitEdit:N,cancelEdit:L,onKeyboardEventNative:O,onPointerEventNative:j}=l.useKeyboardEditorOverlay({view:s,activeCoords:v,getCellEditor:A,canEdit:()=>{const e=d.getProtection();if(e.isReadOnly())return!1;const t=e.isLocked();return t&&g(),!t},onBeforeStartEdit:e=>{const t=b(()=>d.getRange(e).getCell()),n={sheet:d,coords:e,editState:Object.freeze(t)};p.setMode({key:"edit",args:{stateAndCoords:n}}),x(n)},onStartEdit:e=>{S(e),h(e)},onSubmitEdit:I,onCancelEdit:e=>{S(null),x(null),p.setMode(null),h(null)},onDoneEdit:e=>{p.setMode(null)},onNavigate:F,containerProps:R,borderStrokeFill:c.selection?.strokeFill,borderStrokeWidth:d?.getSelection().getCoords().ranges?.length>1?1:2,alignment:M,getRangeCoords:E});W(d.getSelection(),{onChange(e){w(d.getSelection().getCoords().cell)}});const B=t.useCallbackRef(e=>{j(e),q&&N()},[j,L,q]),V=r.useCallback(e=>{j(e)},[j]),P=r.useCallback(e=>{O(e)},[O]);return r.useEffect(()=>{const e=s?.getStage();if(e)return e.addEventListener("pointerdown",B),e.addEventListener("dblclick",V),e.addEventListener("keydown",P),()=>{e.removeEventListener("pointerdown",B),e.removeEventListener("dblclick",V),e.removeEventListener("keydown",P)}},[s?.getStage()]),r.useEffect(()=>{const e=p.getMode(),t=e?.key;"edit"===t||"enter"===t?y?e.args?.cancel?L():e.args?.submit?N():x(e.args?.stateAndCoords):z(e.args?.start):q&&L()},[p]),D(s,a)})),je="white",Be="black",Ve=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Be}' fill='${je}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,Pe=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Be}' fill='${je}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,He=r.memo(r.forwardRef((i,a)=>{const{view:s,sheet:d}=i,[c,u]=r.useState(d.getTables().getCount()>0),[g,h]=r.useState(null),[m,f]=r.useState(null),[p,v]=r.useState(null),[C,b]=r.useState(null),w=t.useCallbackRef(()=>{if(d.getTables().getCount()>0){u(!0);const e=d.getTables().search({address:s.getVisibleRangeCoords()});h(e.length>0?e:null)}else u(!1),h(null)},[d,s]),y=t.useCallbackRef(e=>{e.preventDefault(),e.stopPropagation();const t=s.getCellCoordsFromClient(e.clientX,e.clientY),n=d.getTables().search({address:t});if(1===n.length){n[0].select()}},[s,d]),x=t.useCallbackRef(e=>{e.preventDefault(),e.stopPropagation();const t=s.getCellCoordsFromClient(e.clientX,e.clientY),n=d.getTables().search({address:t});if(1===n.length){const e=n[0].getRange().getCoords(),o={colStart:e.colStart,rowStart:t.rowIndex,colEnd:e.colEnd,rowEnd:t.rowIndex};d.getRange(o).select()}},[s,d]),q=t.useCallbackRef(()=>{if(!c)return;const e=d.getTables().search({address:s.getVisibleRangeCoords()});h(e.length>0?e:null)},[d,c,s]);W(d?.getSelection(),{onChange(e){f(d.getSelection().getCoords().cell)}}),W(p,{onAnyChange(e){w(),q()}}),W(C,{onAnyChange(e){q()}}),W(d,{onTablesChange(e){w(),q()},onInvalidated(e){w(),q()}});const S=r.useMemo(()=>o.CommonUtils.debounce(o.CommonUtils.throttle(q,300),300),[]);r.useEffect(()=>{S()},[s]),r.useEffect(()=>{let t=null;if(g)for(let n=0;n<g.length&&!t;n++){const o=g[n],r=o.getRange().getCoords();e.CoordUtils.isCellWithinRange(m,r)&&(t=o)}v(t)},[m,g]);const R=t.useCallbackRef(e=>{let t=null;if(g)for(let n=0;n<g.length;n++){const o=g[n],r=o.getRange().getCoords();let l=s.getRangeCoordsBounds(r);const i=s.getRelativePointFromClient(e.clientX,e.clientY),a=i.x,d=i.y;if(a>=l.x&&a<=l.x+l.width&&d>=l.y&&d<=l.y+l.height){const e=s.getViewportSize();a<=0||d<=0||a>=e.width||d>=e.height||(t=o)}}b(t)},[s,g]);if(r.useEffect(()=>{const e=s?.getStage();if(e&&g)return e.addEventListener("mousemove",R),e.addEventListener("mouseleave",R),()=>{e.removeEventListener("mousemove",R),e.removeEventListener("mouseleave",R)}},[g,s?.getStage()]),!s)return null;if(!g||0===g.length)return null;const k=[];for(let e=0;e<g.length;e++){const t=g[e];if(t.isClosed())continue;const o=t===C,r=t===p,i=t.getRange().getCoords(),a=s.getRangeCoordsBounds(i);let c;if(o||r){const e=t.getStyle().getProperties(),n=e.headerRow?.fill?.background??e.wholeTable?.border?.top?.color?.toString();if(n&&d){const e=d.getStyles().parseColor(n);e&&(c=e.toCSS())}c||(c="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}k.push(n.jsx("div",{style:{position:"absolute",left:a.x,top:a.y,width:Math.min(16,a.width),height:a.height,pointerEvents:"all",cursor:Ve},onMouseDown:x},`table-select-row-${t.getName()}`)),k.push(n.jsx("div",{style:{position:"absolute",left:a.x,top:a.y,width:Math.min(16,a.width),height:Math.min(16,a.height),pointerEvents:"all",cursor:Pe},onMouseDown:y},`table-select-${t.getName()}`)),k.push(n.jsx(l.Selection,{x:a.x,y:a.y,width:a.width,height:a.height,range:i,strokeWidth:r?.5:0,stroke:c??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:o?`${c} 0px 0px 1px 1px`:void 0}},`table-outline-${t.getName()}`))}return k})),Ue=r.memo(r.forwardRef((i,a)=>{const{view:s,sheet:d,animationTime:c=60}=i,[u,g]=r.useState(null),[h,m]=r.useState(null),f=r.useRef(null),p=t.useCallbackRef(()=>{const e=d.getSelectedCell(),t=e.getSpill()?.getCoords()??null;o.CoordUtils.isEqualRanges(t,u)||(m(t?{transition:u?"move":"in",bounds:s.getRangeCoordsBounds(t),coords:t}:{transition:"out",bounds:s.getRangeCoordsBounds(u),coords:u}),g(t))},[d,s,u]);r.useEffect(()=>(f.current&&(clearTimeout(f.current),f.current=null),h&&(f.current=setTimeout(()=>{m(null),f.current=null},c)),()=>{f.current&&(clearTimeout(f.current),f.current=null)}),[h,c]);const v=r.useMemo(()=>o.CommonUtils.debounce(o.CommonUtils.throttle(p,80),80),[]);if(W(d?.getSelection(),{onChange(e){v()}}),W(d,{onSpillsChange(e){p()},onInvalidated(e){p()}}),!s)return null;if(!u&&!h)return null;const C=d.getRange(u).getValue()instanceof e.FormulaError.Spill,b=[];let w=h?.bounds??s.getRangeCoordsBounds(u);if(h&&!o.CommonUtils.isEqualBounds(h.bounds,s.getRangeCoordsBounds(h.coords))&&m(null),w=s.toClipBounds(w,-10),!w)return;const y="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return b.push(n.jsx(l.Selection,{x:w.x,y:w.y,width:w.width,height:w.height,range:u,strokeWidth:1,stroke:y,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:C?"6 3":void 0,opacity:"out"===h?.transition?0:1,transition:h?.transition?"in"===h.transition||"out"===h.transition?`opacity ${1.5*c}ms ease-in-out`:`left ${c}ms ease-out, top ${c}ms ease-out, width ${c}ms ease-out, height ${c}ms ease-out`:"none",boxShadow:`${y} 0px 0px 4px 0px`}},"spill-outline}")),b})),Ke={position:"absolute",top:0,left:0,bottom:0,right:0},We=(e,t)=>{const n={...e},r=t?.getNormal().getFont(),l=r?.toCSS(),i={text:{fontFamily:l?.fontFamily,fontSize:r?.getSize()}},a=n.body=o.CommonUtils.mergeContentful(e.body,i);return n.body=o.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},a),n.buttonSurface=o.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=o.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=o.CommonUtils.mergeContentful(n.header,i),n.headerSelect=o.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=o.CommonUtils.mergeContentful(n.headerSelect,i),n.headerSelectAll=o.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=o.CommonUtils.mergeContentful(n.headerSelectAll,i),n},$e={fireOnModelChange:!1},Ge={},_e=r.memo(r.forwardRef((i,a)=>{const{sheet:s,gridStyle:d=Ge,headersStyle:c=Ge,onSheetContextMenu:u,showColumnHeaders:g,columnHeaderProps:h,showRowHeaders:f,rowHeaderProps:p,showScrollbars:v=!0,scrollPaneProps:C,onViewportChange:b,commands:w,onRepeatCommandChange:y,onMoveCell:x,overlays:q,renderMovable:S,viewportComponent:R,onElementLoad:k,getCellEditor:M,onFocus:I,onBlur:E,style:F=t.ReactUtils.EmptyCssProperties,notifier:A,onShowTooltip:D,onShowColumnTooltip:z,onShowRowTooltip:N,onCloseTooltip:L,gridProps:O,cellRenderProps:j,...B}=i;if(r.useEffect(()=>{e.LicenseManager._validate(!0)},[]),!s)throw new Error("ISheet must be provided.");const[U,$]=r.useReducer(e=>e+1,0),[_,{width:Z,height:X}]=T(),Y=t.useCallbackRef(D,[D]),J=t.useCallbackRef(z,[z]),Q=t.useCallbackRef(N,[N]),ee=t.useCallbackRef(L,[L]),te=r.useRef(!1);r.useLayoutEffect(()=>{te.current=!0},[s]);const ne=s?.getStyles(),oe=r.useMemo(()=>We(d,ne),[d,ne]),re=r.useMemo(()=>We(c,ne),[c,ne]),{body:le={},buttonSurface:ae={}}=oe,{header:ce={},headerSelect:ue={},headerSelectAll:ge={}}=re,he=r.useRef(null),[me,fe]=r.useState(()=>s?.getView()),pe=(me?.getZoomScale()??100)/100,ve=r.useMemo(()=>({vertical:me.isShowColumnGridlines()&&pe>=.4,horizontal:me.isShowRowGridlines()&&pe>=.4}),[me?.isShowColumnGridlines(),me?.isShowRowGridlines(),pe]),be=r.useMemo(()=>{if(me?.getGridLineColor())return{strokeDasharray:"1,1"}},[me?.getGridLineColor(),oe]),we=g??me?.isShowColumnHeaders(),ye=f??me?.isShowRowHeaders(),[xe,qe]=r.useState({width:0,height:0}),Se=r.useMemo(()=>{let t=40,n=20;const o=s?.getStyles().getNormal().getFont();if(xe.width>0&&xe.height>0){const r=o?.toCSS()?.fontFamily??oe.header.text.fontFamily,l=o?.getSize()??oe.header.text.fontSize,i=e.IFont.getSharedMeasurer()(""+xe.height,Math.ceil(l*e.IFont.getDeviceScale()),r);t=i.width,n=i.lineHeight}return{width:Math.round(t+5),height:Math.round(n+3)}},[xe,oe?.header.text,s]),Re=ye?pe*Se.width:ce.edgeStrokeWidth,Me=we?pe*Se.height:ce.edgeStrokeWidth,Te=Math.max(Z,(s?.getColumnHeaders().getDefaultSize()??Se.width)+Re+1),Ie=Math.max(X,(s?.getRowHeaders().getDefaultSize()??Se.height)+Me+1),Ee=r.useRef(new Map),Fe=r.useRef(null),Ae=()=>({getColOffset:e=>s.getColumnHeaders().findOffset(e),getColIndex:e=>s.getColumnHeaders().findIndex(e),getRowOffset:e=>s.getRowHeaders().findOffset(e),getRowIndex:e=>s.getRowHeaders().findIndex(e)}),[De,ze]=r.useState(()=>Ae()),[Ne,je]=r.useState(!1),[Be,Ve]=r.useState(null),Pe=!0,_e=oe.selection?.strokeFill,Ze=r.useCallback(()=>Dt.current,[]),[Xe,Ye]=r.useState(),Je=t.useCallbackRef(e=>{Ye(e),s&&s.getView()&&s.getView().setTopLeft(e?{left:e.left,top:e.top}:null),b?.(e)},[s,b]),Qe=r.useRef(null);r.useEffect(()=>{if(!Xe||!s)return;const e=s.getRangeAtBounds({x:Xe.left,y:Xe.top,width:Xe.width,height:Xe.height});Qe.current?.(),Qe.current=e.addListener(()=>{const t=e.getCoords();he?.current?.invalidate(t)})},[Xe,s]);const[et,tt]=r.useState(()=>s?.getView().getTopLeft()),nt=t.useCallbackRef(e=>{const t=o.CoordUtils.cellToRange(e);if(s.isClosed())return t;const n=s.getRange(t,{excludeHidden:!0}).getMerges();return 0===n.length?t:n[0]},[s]),ot=e=>{if(!e||0===e.coords.colIndex&&0===e.coords.rowIndex)return null;const t={};return e.coords.colIndex>0&&(t[o.AnchorLocation.Left]={index:e.coords.colIndex,scrollOffset:e.topLeft.left}),e.coords.rowIndex>0&&(t[o.AnchorLocation.Top]={index:e.coords.rowIndex,scrollOffset:e.topLeft.top}),t},[rt,lt]=r.useState(()=>ot(s.getView().getFreezePanes())),it=t.useEditMode(),at=r.useCallback(()=>he.current,[]),st=t.useCallbackRef(e=>{it.setMode(t=>"edit"===t?.key?{...t,args:{...t.args}}:{key:"edit",args:{stateAndCoords:null,start:e}})},[]),dt=t.useCallbackRef(()=>Xe,[Xe]),ct=G({sheet:s,commands:w,target:at,onRepeatCommandChange:y,bodyStyle:le,notifier:A,onStartEdit:st,getViewport:dt}),[ut,gt]=r.useState(s.getSelection().isEntire()),[ht,mt]=r.useState(me?.getMovableSelection().length>0),ft=null!==Be||ht,pt=null,[vt,Ct]=r.useState(!1);r.useEffect(()=>{Ct(!1)},[s.getProtection()]);const bt=t.useCallbackRef(()=>{vt||(Ct(!0),A.showMessage?.(n.jsxs("span",{children:["This sheet is protected.",n.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:t.NotificationType.Error}))},[A,vt]),wt=r.useMemo(()=>{const e=it.getMode();return e?.cursor?e.cursor:null},[pt,it]),[yt,xt]=r.useState(null),qt=r.useRef(!1),[St,Rt]=r.useState([]),kt=r.useRef(null),[Mt,Tt]=r.useState(o.TypesUtils.EmptyTopLeft),[It,Et]=r.useState(o.TypesUtils.EmptyTopLeft);r.useEffect(()=>{Tt({left:et?.left,top:0})},[et?.left]),r.useEffect(()=>{Et({left:0,top:et?.top})},[et?.top]),W(s?.getView(),{onFreezeSplitChange:()=>{lt(ot(s.getView().getFreezePanes()))},onTopLeftChange:()=>{tt(s.getView().getTopLeft())},onMovableSelectionChange:()=>{mt(s.getView().getMovableSelection().length>0)}}),W(s?.getSelection(),{onChange:()=>{gt(s.getSelection().isEntire())}}),W(s,{onViewChange(){fe(s.getView()),ze(Ae())},onLayoutChange:()=>{const e=s.getEntireRange();qe({height:e.getRowCount(),width:e.getColumnCount()}),ze(Ae())},onStyleChange:()=>{zt()},onMovablesChange:()=>{},onInvalidated:()=>{zt()}}),W(s,{onRequestScrollIntoView:async(e,t)=>{if(!t)return;const n={colIndex:t?.coords.colStart,rowIndex:t?.coords.rowStart};return await(he.current?.scrollCellCoordsIntoView(n,t?.scroll)),!0},onRequestFocus:()=>o.CommonUtils.whenFocus(Dt.current)},$e);const Ft=r.useMemo(()=>{const e=(e,t)=>{qt.current=!0,xt([i=>{if(!i.toClipBounds(i.getRangeCoordsBounds({rowStart:0,rowEnd:xe.height,colStart:e,colEnd:e})))return;const a=i.getLayout(),c=Math.max(0,a.getColOffset(e)),u=i.getBounds(),g=Math.min(u.x+u.width,a.getColOffset(e+1)),h=i.getAnchor();if(null!==t&&(h===o.AnchorLocation.Left||h===o.AnchorLocation.Center||h===o.AnchorLocation.Right)){const e=o.CommonUtils.roundAccurately(t*o.CommonUtils.getDPI(),0),n=o.CommonUtils.roundAccurately(s?.getColumnWidthAsFontUnit(t/pe),2).toFixed(2),r="Width: "+(t?n+" ("+e+" pixels)":"Hidden"),l=Zt.current.getGridElement().getRelativePointFromClient(0,0),i=0-l.y,a=0-l.y+Me,d={x:c-(l.x-u.x),y:i,width:g-c,height:a-i};requestAnimationFrame(()=>{qt.current&&J?.({anchor:d,display:r})})}const m=[0,0,0,u.height],f={style:{boxShadow:`0.5px 0px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:_e}},p={x:c-1,y:0,width:1,height:u.height},v={style:{boxShadow:`-0.5px 0px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:_e}},C={x:g-1,y:0,width:1,height:u.height};return n.jsxs(r.Fragment,{children:[n.jsx(l.SVGLine,{linePoints:m,bounds:p,...f}),n.jsx(l.SVGLine,{linePoints:m,bounds:C,...v})]},"resize-dividers")}])};let t=null;return{onResizeHeadersStart:(n,o,r)=>{t=s.beginCommit(r),e(n,o)},onResizeHeaders:(t,n,o)=>{e(t,n)},onResizeHeadersDown:(t,n)=>{e(t,n)},onResizeHeadersEnd:(e,n,o)=>{t?.commit({description:o}),t=null,requestAnimationFrame(()=>ee?.()),qt.current=!1,xt(null)},onResizeHeadersUp:e=>{requestAnimationFrame(()=>ee?.()),qt.current=!1,xt(null)},...h}},[s,h,Me,yt]),At=r.useMemo(()=>{const e=(e,t)=>{qt.current=!0,xt([i=>{if(!i.toClipBounds(i.getRangeCoordsBounds({rowStart:e,rowEnd:e,colStart:0,colEnd:xe.width})))return;const a=i.getLayout(),c=Math.max(0,a.getRowOffset(e)),u=i.getBounds(),g=Math.min(u.y+u.height,a.getRowOffset(e+1)),h=i.getAnchor();if(null!==t&&(h===o.AnchorLocation.Top||h===o.AnchorLocation.Center||h===o.AnchorLocation.Bottom)){const e=Math.floor(10*o.CommonUtils.getDPI())/10,n=o.CommonUtils.roundAccurately(t*e,0),r=o.CommonUtils.roundAccurately(n/pe/(s?.getRowHeaders().getScaleFactor()*o.CommonUtils.getDPI()),2).toFixed(2),l="Height: "+(t?r+" ("+n+" pixels)":"Hidden"),i=Gt.current.getGridElement().getRelativePointFromClient(0,0),a=0-i.x,d=0-i.x+Re,h={x:a,y:c-(i.y-u.y),width:d-a,height:g-c};requestAnimationFrame(()=>{qt.current&&Q?.({anchor:h,display:l})})}const m=[0,0,u.width,0],f={style:{boxShadow:`0px 0.5px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:_e}},p={x:0,y:c-1,width:u.width,height:1},v={style:{boxShadow:`0px -0.5px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:_e}},C={x:0,y:g-1,width:u.width,height:1};return n.jsxs(r.Fragment,{children:[n.jsx(l.SVGLine,{linePoints:m,bounds:p,...f}),n.jsx(l.SVGLine,{linePoints:m,bounds:C,...v})]},"resize-dividers")}])};let t=null;return{onResizeHeadersStart:(n,o,r)=>{t=s.beginCommit(r),e(n,o)},onResizeHeaders:(t,n,o)=>{e(t,n)},onResizeHeadersDown:(t,n)=>{e(t,n)},onResizeHeadersEnd:(e,n,o)=>{t?.commit({description:o}),t=null,requestAnimationFrame(()=>ee?.()),qt.current=!1,xt(null)},onResizeHeadersUp:e=>{requestAnimationFrame(()=>ee?.()),qt.current=!1,xt(null)},...p}},[s,p,Re]),Dt=t.useImperativeElement(a,()=>{const e=e=>{s?.getView()&&s.getView().selectMovables([]),Fe.current=null,he?.current?.focus(e)},t=async(e=null)=>{if(e||(e=s?.getView().getMovableSelection()[0]),!e)return!1;const t=e.getAnchorCoords();if(!t)return!1;const n=he.current?.getViewFromCellCoords({colIndex:t.colStart,rowIndex:t.rowStart});if(!n)return!1;const o=n.getAnchor();-1===s?.getView().getMovableSelection().indexOf(e)&&s?.getView().selectMovables([e]);let r=Ee.current?.get(o);return r?.current?(await r.current.focusMovable(e),!0):(Fe.current={movable:e,anchor:o},!0)};return{getGridElement:()=>he.current,getRowHeaderElement:()=>Gt.current,getColumnHeaderElement:()=>Zt.current,rowHeaderHeight:()=>Me,colHeaderWidth:()=>Re,startEdit:st,submitEdit:()=>{it.setMode(e=>"edit"!==e?.key?e:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{it.setMode(e=>"edit"!==e?.key?e:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:null!==Be,focus:n=>{s?.getView().getMovableSelection().length>0&&t()||e(n)},focusSheet:e,focusMovable:t,contains:e=>he?.current?.contains?.(e),invalidate:zt,isSheetElement:()=>!0,getSheet:()=>s}},[s]),zt=r.useCallback(e=>{te.current||(he?.current?.invalidate(e),$?.())},[]);r.useEffect(()=>{zt()},[oe]);const Nt=ut?ge.edgeStrokeFill:ce.fill,Lt=ut?ue.fill:"function"==typeof oe.headerHover?oe.headerHover(ce)?.fill:ce.fill,Ot=r.useMemo(()=>R?n.jsx("div",{className:V("sheetxl-viewport-overlay",H),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:R}):n.jsx(n.Fragment,{}),[R]);let jt=null;we&&ye&&(jt=n.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${Me}px`,width:`${Re}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:e=>{let n=!e.ctrlKey;ct?.getCommand("selectAll")?.execute(!n||0!==e.button),e.nativeEvent.which===t.MouseButtonCodes.Right?u?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):he.current?.focus()},children:[n.jsx("div",{style:{height:Me-5+"px",width:Me-5+"px",clipPath:`path('M${Me-5} 0 L0 ${Me-5} L${Me-5} ${Me-5} L${Me-5} 0 Z')`,borderRight:`2px solid ${Nt}`,borderBottom:`2px solid ${Nt}`,background:`${Lt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),n.jsx("div",{style:{position:"absolute",height:`${Me}px`,width:`${Re}px`,boxSizing:"border-box",borderRight:`solid 1px ${ce.strokeFill}`,borderBottom:`solid 1px ${ce.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const Bt=t.useCallbackRef(({_left:e,_top:t})=>{},[]),Vt=t.useCallbackRef(e=>{if(!u)return;const t=he.current.getViewFromClient(e.clientX,e.clientY)?.getCellCoordsFromClient(e.clientX,e.clientY);t&&(u({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:t.rowIndex,colIndex:t.colIndex}),e.stopPropagation(),e.preventDefault())},[u]),Pt=t.useCallbackRef(e=>{if(!(!e.shiftKey&&(e.ctrlKey||e.metaKey)))return;const{deltaY:t}=e;return t>0?ct.getCommand("sheetZoomOut")?.execute():t<0&&ct.getCommand("sheetZoomIn")?.execute(),0===t},[ct]);r.useEffect(()=>{Rt(null),kt.current=null,qt.current=!1,xt(null);const e=s?.getView().getTopLeft();Bt(e),he.current?.scrollTo(e),tt(e),fe(s.getView()),lt(ot(s.getView().getFreezePanes())),ze(Ae()),$()},[s?.getView()]);const Ht=t.useCallbackRef(t=>{const n=t.getVisibleRangeCoords();if(!n)return null;const o=[];return s.getRange(n).forEach((t,n)=>{const r=n.getCoords(),l=n.getCell();(t=>{if(t.isEmpty())return!1;const n=t.getSpans();if(n.width>1||n.height>1)return!0;if(t.getStyle().hasVisibleStyling())return!0;if(me.isShowFormulas()&&null!==t.getFormula())return!0;const o=t.getValue();return null!==o&&!(!me.isShowZeros()&&0===o&&t.getType()===e.ScalarType.Number)})(l)&&o.push({coords:r,value:l,range:me.isShowFormulas()?null:l.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),o},[s,me.isShowZeros(),me.isShowFormulas(),Be]);r.useEffect(()=>{const e=[];q&&e.push(...q),yt&&e.push(...yt),o.CommonUtils.isEqualArrays(e,kt.current)||(kt.current=e,Rt(e))},[q,yt,oe]);const Ut=r.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${d?.body?.fill}`},pathProps:{stroke:d?.body?.text?.fill??"black"}}),[oe?.header?.edgeStrokeFill]),Kt=t.useCallbackRef(e=>{e.isDefaultPrevented()||e.isPropagationStopped()||(Fe.current=null,s?.getView().getMovableSelection().length>0&&s.getView().selectMovables([]))},[s]),Wt=r.useMemo(()=>{const e=it.getMode();return"cut"===e?.key||"copy"===e?.key},[it]),$t=t.useCallbackRef(async e=>{const n=it.getMode();return e.keyCode===t.KeyCodes.Escape&&n?(e.preventDefault(),void it.setMode(null)):e.keyCode===t.KeyCodes.Enter&&Wt?(e.preventDefault(),await(ct?.getCommand("paste")?.execute()),void it.setMode(null)):void ct?.dispatchToFocusedCommand(e)},[ct,it]),Gt=r.useRef(null),_t=r.useMemo(()=>n.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${Me+1}px`,width:`${Re+ce.edgeStrokeWidth}px`,minWidth:`${Re+ce.edgeStrokeWidth}px`,borderRight:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,height:`calc(100% - ${Me}px)`,boxSizing:"border-box",zIndex:"2"},children:n.jsx(se,{ref:Gt,sheetElement:Dt.current,gridRef:he,freezeStart:rt?.[o.AnchorLocation.Top],oppositeSize:Re,containerWidth:Re,containerHeight:Ie,sheetHeader:s.getRowHeaders(),gridStyle:re,verticalPadding:Math.max(0,Math.floor(s.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:It,onSheetContextMenu:u,tabIndex:-1,style:{position:"relative",flex:"0",top:`${Me+1}px`,width:`${Re+ce.edgeStrokeWidth}px`,minWidth:`${Re+ce.edgeStrokeWidth}px`,borderRight:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,height:`calc(100% - ${Me}px)`,boxSizing:"border-box",zIndex:"2",...At?.style},...At})}),[Re,Me,Ie,s,It,rt?.[o.AnchorLocation.Top],oe,Pe,u,ce.fill,p]),Zt=r.useRef(null),Xt=r.useMemo(()=>n.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${Me+ce.edgeStrokeWidth}px`,minHeight:`${Me+ce.edgeStrokeWidth}px`,borderBottom:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:n.jsx(se,{ref:Zt,sheetElement:Dt.current,gridRef:he,freezeStart:rt?.[o.AnchorLocation.Left],oppositeSize:Me,containerWidth:Te,containerHeight:Me,sheetHeader:s.getColumnHeaders(),gridStyle:re,scrollPoint:Mt,onSheetContextMenu:u,...Ft,style:{...Ft?.style,position:"relative",left:"0px",width:"100%",height:`${Me+ce.edgeStrokeWidth}px`,minHeight:`${Me+ce.edgeStrokeWidth}px`,borderBottom:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[Me,Te,s,Mt,rt?.[o.AnchorLocation.Left],oe,ce.fill,Pe,u,h]),Yt=t.useCallbackRef(e=>{const{value:t,key:n,...o}=e;let l=t,i=Be;if(!i||i.colIndex===e.coords.colIndex&&i.rowIndex===e.coords.rowIndex||(i=null),!l){const t=e.range;if(l=s.getRange({rowIndex:t.rowStart,colIndex:t.colStart}).getCell(),l.isEmpty())return null}let a=null;l.getHyperlink()&&(a=async e=>{if(j?.onLinkMouseDown?.(e),0===e.button&&!e.isDefaultPrevented()){e.stopPropagation(),e.preventDefault();try{await(l.getHyperlink()?.open())}catch(e){A?.showError?.(e)}}}),i&&i.colIndex===e.range.colStart&&i.rowIndex===e.range.rowStart&&(l=l.createTemporaryCell({value:null}));const d=s.getStyles();return r.createElement(m,{...o,key:n,bodyStyle:le,docTheme:d.getTheme(),normalStyle:d.getNormal(),showFormulas:me.isShowFormulas(),showZeros:me.isShowZeros(),onLinkMouseDown:a,...j,value:l})},[s,De,le,Be,me?.isShowFormulas(),me.isShowZeros()]),Jt=r.useCallback((e,t)=>{const{key:o,...r}=e;return[n.jsx(de,{ref:t,getVisibleCells:Ht,sheet:s,gridStyle:oe,...r},`border-${o}`),n.jsx(He,{ref:t,sheet:s,commands:ct,...r},`table-${o}`),n.jsx(Ue,{ref:t,sheet:s,...r},`spill-${o}`),n.jsx(ke,{ref:t,sheet:s,commands:ct,notifier:A,onShowTooltip:Y,onCloseTooltip:ee,gridStyle:oe,gridRef:he,editingCoords:Be,isActive:Pe,...r},`selection-${o}`),n.jsx(Ce,{ref:t,sheet:s,commands:ct,gridStyle:oe,element:Ze,notifier:A,...r},`copy-paste-${o}`),n.jsx(Le,{ref:t,sheet:s,commands:ct,target:at,notifier:A,renderMovable:S,movableProps:{onUnFocus:()=>{Dt.current.focus()}},...r},`movable-${o}`),n.jsx(Oe,{ref:t,sheet:s,commands:ct,notifier:A,gridStyle:oe,getCellEditor:M,showProtectedError:bt,setEditingCoords:Ve,...r},`editor-${o}`)]},[s,he.current,oe,M,ct,A]),[Qt,en]=r.useState(!1),tn=r.useMemo(()=>{if(0===Te||0===Ie)return null;const t=s.getStyles().getNormal(),r=t.getFont(),i=t.getFill(),a=t.getBorder(),d=t.getFill().getType()===e.IFill.Type.None;let c=be,u=be;const g=(e,t,n)=>n?{stroke:a.getBottom().isNone()?"none":e.getColor().toRGBA(le.darkMode).toString(),...t}:t;u=g(a.getBottom(),u,!a.getBottom().isNone()),u=g(a.getTop(),u,!a.getTop().isNone()),c=g(a.getRight(),c,!a.getRight().isNone()),c=g(a.getLeft(),c,!a.getLeft().isNone());let h=me?.getGridLineColor()?.toRGBA(le.darkMode).toString()??le.strokeFill;return d||(u=g(a.getBottom(),u,!0),u=g(a.getTop(),u,!0),c=g(a.getRight(),c,!0),c=g(a.getLeft(),c,!0)),n.jsx(l.Grid,{className:"sheetxl-sheet-primary",style:{...Ke,...i.toCSS(le.darkMode),...r.toCSS(le.darkMode,pe),"--sxl-app-color-background":le.fill,"--sxl-app-color-shadow":oe.colorShadow,"--sxl-app-color-grey":oe.colorGrey,"--sxl-app-color-button-fill":ae.fill,"--sxl-app-color-button-text":ae.text?.fill,"--sxl-app-color-button-border":ae.edgeStrokeFill,"--sxl-app-color-primary-dark":oe.selection.strokeFill},ref:he,zoom:pe,...O,onFirstRender:e=>{en(!0),O?.onFirstRender?.(e),ct?.activate()},showGridLines:ve,gridLineColor:h,gridLineColumnsProps:c,gridLineRowsProps:u,freezeLeft:rt?.[o.AnchorLocation.Left],freezeLeftProps:Ut,freezeTop:rt?.[o.AnchorLocation.Top],freezeTopProps:Ut,width:Te,height:Ie,columnCount:xe.width,rowCount:xe.height,cursor:wt??pt??"cell",clipCells:!0,layout:De,cellRenderer:Yt,overlayRenderer:Jt,getCellCoordsAsRangeCoords:nt,getVisibleCells:Ht,onWheelScroll:Pt,onPointerDown:Kt,onKeyDown:$t,onViewportChange:Je,onImmediateScroll:Bt,scrollPoint:et,stageProps:{onFocus:()=>{ct?.activate()}},overlays:St})},[U]);r.useEffect(()=>{te.current||$()},[De,rt,pe,ct,et?.left,et?.top,le,O,Te,Ie,wt,St,Pe,pt]);let nn={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};v||(nn={...nn,...F});const on=r.useMemo(()=>{const e=s.getStyles().getTheme(),t=e.getColorScheme(),n=e.getFontScheme();return{"--sxl-doc-color-dk1":t.getDk1().toCSS(le.darkMode),"--sxl-doc-color-dk2":t.getDk2().toCSS(le.darkMode),"--sxl-doc-color-lt1":t.getLt1().toCSS(le.darkMode),"--sxl-doc-color-lt2":t.getLt2().toCSS(le.darkMode),"--sxl-doc-color-accent1":t.getAccent1().toCSS(le.darkMode),"--sxl-doc-color-accent2":t.getAccent2().toCSS(le.darkMode),"--sxl-doc-color-accent3":t.getAccent3().toCSS(le.darkMode),"--sxl-doc-color-accent4":t.getAccent4().toCSS(le.darkMode),"--sxl-doc-color-accent5":t.getAccent5().toCSS(le.darkMode),"--sxl-doc-color-accent6":t.getAccent6().toCSS(le.darkMode),"--sxl-doc-color-hlink":t.getHlink().toCSS(le.darkMode),"--sxl-doc-color-fol-hlink":t.getFolHlink().toCSS(le.darkMode),"--sxl-doc-font-major":n.getMajorFont(),"--sxl-doc-font-minor":n.getMinorFont()}},[s.getStyles().getTheme()]);let rn=n.jsx("div",{style:nn,onTouchStart:()=>{sn()},onFocus:e=>{je(!0),I?.(e)},onBlur:e=>{je(!1),E?.(e)},ref:Dt,...B,children:n.jsx("div",{className:V("sheetxl-sheet",P),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...on},children:n.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[jt,_t,n.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[Xt,n.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${ce.edgeStrokeWidth}px ${ce.edgeStrokeFill}`,backgroundColor:le.fill},ref:_,onContextMenu:Vt,children:[tn,Ot,n.jsx(K,{style:{position:"absolute",right:24,bottom:4},colorLicensee:oe?.selection?.strokeFill,colorCredits:oe?.body?.text?.fill})]})]})]})})});if(v){const e=e=>n.jsx(ie,{...e,sheet:s});rn=n.jsx(t.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${ce.fill}`,minHeight:2*Se.height,minWidth:2*Se.width,...F},viewport:Xe,touchElement:he.current?.stage,disableTouch:ft,onScrollViewport:e=>{he.current?.scrollTo(e)},createHorizontalScrollbar:e,createVerticalScrollbar:e,...C,children:rn})}r.useEffect(()=>{te.current=!1,$?.(),Ne&&Dt.current?.focus()},[s]);const[ln,an]=r.useState(!1),sn=t.useCallbackRef(()=>{ln||an(!0)},[ln]);return r.useEffect(()=>{if(Qt)return"function"==typeof k&&k(),"touch"===t.ReactUtils.detectIt().primaryInput&&sn(),()=>{}},[k,Qt,ln]),rn}));_e.displayName="SheetElement";const Ze=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Xe="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Ye=r.memo(r.forwardRef((e,o)=>{const{children:l,disabled:i,style:a,picture:s,description:d,isDragging:c,view:u,onHide:g,onShow:h,onKeyDownCapture:m,onFocus:f,onBlur:p,loadingPanel:v,...C}=e,[b,w]=r.useState(!1),[y,x]=r.useState(null),[q,S]=r.useState(null),[R,k]=r.useState(null);r.useEffect(()=>{S(null),s.getDetails().then(e=>{w(!1),S(e.asUrl()),e.asSVGText?.()&&k(e.asSVGText())}).catch(e=>{console.warn(e),w(!0),S(Xe),k(null)})},[s]);const M=t.useImperativeElement(o,()=>({isPictureEditor:()=>!0}),[]),T=r.useMemo(()=>{if(q||R)return n.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:b?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:b?"var(--sxl-app-color-background, white)":void 0,boxShadow:b?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:b?"contain":void 0,opacity:y?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:q,onLoad:()=>{x(!0)},onError:({currentTarget:e})=>{console.log("error"),e.onerror=null,S(Xe),w(!0)},alt:d??`${s.getType()}`})},[y,s,q,R,c]);if(!s.isClosed())return n.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:c?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...C,onKeyDownCapture:e=>{m?.(e)},ref:M,children:[y||b?void 0:v,T]})}));Ye.displayName="PictureEditor";const Je=r.memo(r.forwardRef((e,o)=>{const{children:l,disabled:i,chart:a,view:s,isDragging:d,onHide:c,onShow:u,...g}=e;r.useEffect(()=>{},[a]);const h=t.useImperativeElement(o,()=>({isChartEditor:()=>!0}),[]),[m,{height:f,width:p}]=T();if(!a.isClosed())return n.jsx("div",{...g,ref:x([h,m]),children:n.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:s.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:d?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:n.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),Qe="_editable-input_1bqx6_6",et=e=>n.jsx("input",{...e}),tt=r.memo(r.forwardRef((e,o)=>{const{style:l={},className:i,value:a="",onSubmit:s,onChange:d,onCancel:c,createInput:u=et,notifier:g,styleHover:h={},dragging:m,maxLength:f,disabled:p=!1,readOnly:v=!1,...C}=e,[b,w]=r.useState(!1),[y,x]=r.useState(!1),[q,S]=r.useState(a);r.useEffect(()=>{S(a)},[a]);const R=r.useRef(null),[k,M]=r.useState(null),T=r.useCallback(function(e){const n=e.message;k!==n&&(g?.showMessage?.(n,{type:t.NotificationType.Error}),M(n))},[g,k]),I=r.useCallback(e=>{let t=!1;try{t=s?.(e)??!0}catch(e){T(e)}return t?(R.current=null,x(!1),S(e),t):(setTimeout(()=>{R.current?.focus()},0),t)},[s]),E=t.useCallbackRef(()=>{S(a),R.current=null,x(!1),c?.()},[c,a]),F=r.useMemo(()=>{if(!y)return null;const e={className:V(Qe),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:f,type:"text",value:q,onFocus:e=>{R.current||(R.current=e.target,setTimeout(()=>{e.target?.select()},0))},onBlur:e=>{R.current&&I(q)},onChange:e=>{y&&S(e.target.value)},onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>"Escape"===e.code?(e.preventDefault(),void E()):"Enter"===e.code?(e.preventDefault(),void I(e.target.value)):void("Tab"!==e.code?e.stopPropagation():I(e.target.value))};return n.jsx(n.Fragment,{children:u(e)})},[y,q,I,E,u,p]),[A,D]=r.useState();r.useLayoutEffect(()=>{let e=Object.assign({},l);(m||b)&&(e=Object.assign(e,h)),D(e)},[m,b,h,l]),r.useEffect(()=>{F&&d?.(q)},[F,d,q]);const z=t.useImperativeElement(o,()=>({startEdit(){p||v||x(!0)},cancel(){E()}}),[]);return n.jsxs("div",{...C,ref:z,style:{flexDirection:"column",display:"flex",...A},className:V(i),children:[n.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{p||v||x(!0)},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[n.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:y?0:1},children:q}),F]}),n.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...h},children:q})]})}));const nt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ot(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function rt(e){return"nodeType"in e}function lt(e){var t,n;return e?ot(e)?e:rt(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function it(e){const{Document:t}=lt(e);return e instanceof t}function at(e){return!ot(e)&&e instanceof lt(e).HTMLElement}function st(e){return e instanceof lt(e).SVGElement}function dt(e){return e?ot(e)?e.document:rt(e)?it(e)?e:at(e)||st(e)?e.ownerDocument:document:document:document}const ct=nt?r.useLayoutEffect:r.useEffect;function ut(e){const t=r.useRef(e);return ct(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)},[])}function gt(e,t){void 0===t&&(t=[e]);const n=r.useRef(e);return ct(()=>{n.current!==e&&(n.current=e)},t),n}function ht(e,t){const n=r.useRef();return r.useMemo(()=>{const t=e(n.current);return n.current=t,t},[...t])}function mt(e){const t=ut(e),n=r.useRef(null),o=r.useCallback(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,o]}function ft(e){const t=r.useRef();return r.useEffect(()=>{t.current=e},[e]),t.current}let pt={};function vt(e,t){return r.useMemo(()=>{if(t)return t;const n=null==pt[e]?0:pt[e]+1;return pt[e]=n,e+"-"+n},[e,t])}function Ct(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t},{...t})}}const bt=Ct(1),wt=Ct(-1);function yt(e){if(!e)return!1;const{KeyboardEvent:t}=lt(e.target);return t&&e instanceof t}function xt(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=lt(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const qt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[qt.Translate.toString(e),qt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),St="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Rt(e){return e.matches(St)?e:e.querySelector(St)}const kt={display:"none"};function Mt(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:kt},n)}function Tt(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},n)}const It=r.createContext(null);const Et={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Ft={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function At(e){let{announcements:t=Ft,container:n,hiddenTextDescribedById:o,screenReaderInstructions:l=Et}=e;const{announce:a,announcement:s}=function(){const[e,t]=r.useState("");return{announce:r.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),d=vt("DndLiveRegion"),[c,u]=r.useState(!1);if(r.useEffect(()=>{u(!0)},[]),function(e){const t=r.useContext(It);r.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(r.useMemo(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&a(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;a(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;a(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;a(t.onDragCancel({active:n,over:o}))}}),[a,t])),!c)return null;const g=r.createElement(r.Fragment,null,r.createElement(Mt,{id:o,value:l.draggable}),r.createElement(Tt,{id:d,announcement:s}));return n?i.createPortal(g,n):g}var Dt;function zt(){}function Nt(e,t){return r.useMemo(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Dt||(Dt={}));const Lt=Object.freeze({x:0,y:0});function Ot(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jt(e,t){const n=xt(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function Bt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function Vt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Pt(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function Ht(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}function Ut(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Kt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Ut(t,t.left,t.top),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=Ot(Ut(o),r);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(Bt)};function Wt(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),i=r-o,a=l-n;if(o<r&&n<l){const n=t.width*t.height,o=e.width*e.height,r=i*a;return Number((r/(n+o-r)).toFixed(4))}return 0}const $t=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,l=n.get(o);if(l){const n=Wt(l,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(Vt)};function Gt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Lt}function _t(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const Zt=_t(1);function Xt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Yt={ignoreTransform:!1};function Jt(e,t){void 0===t&&(t=Yt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=lt(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=Xt(t);if(!o)return e;const{scaleX:r,scaleY:l,x:i,y:a}=o,s=e.left-i-(1-r)*parseFloat(n),d=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width/r:e.width,u=l?e.height/l:e.height;return{width:c,height:u,top:d,right:s+c,bottom:d+u,left:s}}(n,t,o))}const{top:o,left:r,width:l,height:i,bottom:a,right:s}=n;return{top:o,left:r,width:l,height:i,bottom:a,right:s}}function Qt(e){return Jt(e,{ignoreTransform:!0})}function en(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(it(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!at(r)||st(r))return n;if(n.includes(r))return n;const l=lt(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=lt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const o=t[e];return"string"==typeof o&&n.test(o)})}(r,l)&&n.push(r),function(e,t){return void 0===t&&(t=lt(e).getComputedStyle(e)),"fixed"===t.position}(r,l)?n:o(r.parentNode)}(e):n}function tn(e){const[t]=en(e,1);return null!=t?t:null}function nn(e){return nt&&e?ot(e)?e:rt(e)?it(e)||e===dt(e).scrollingElement?window:at(e)?e:null:null:null}function on(e){return ot(e)?e.scrollX:e.scrollLeft}function rn(e){return ot(e)?e.scrollY:e.scrollTop}function ln(e){return{x:on(e),y:rn(e)}}var an;function sn(e){return!(!nt||!e)&&e===document.scrollingElement}function dn(e){const t={x:0,y:0},n=sn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(an||(an={}));const cn={x:.2,y:.2};function un(e,t,n,o,r){let{top:l,left:i,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===r&&(r=cn);const{isTop:d,isBottom:c,isLeft:u,isRight:g}=dn(e),h={x:0,y:0},m={x:0,y:0},f=t.height*r.y,p=t.width*r.x;return!d&&l<=t.top+f?(h.y=an.Backward,m.y=o*Math.abs((t.top+f-l)/f)):!c&&s>=t.bottom-f&&(h.y=an.Forward,m.y=o*Math.abs((t.bottom-f-s)/f)),!g&&a>=t.right-p?(h.x=an.Forward,m.x=o*Math.abs((t.right-p-a)/p)):!u&&i<=t.left+p&&(h.x=an.Backward,m.x=o*Math.abs((t.left+p-i)/p)),{direction:h,speed:m}}function gn(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function hn(e){return e.reduce((e,t)=>bt(e,ln(t)),Lt)}function mn(e,t){if(void 0===t&&(t=Jt),!e)return;const{top:n,left:o,bottom:r,right:l}=t(e);tn(e)&&(r<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const fn=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+on(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+rn(t),0)}]];class pn{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=en(t),o=hn(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of fn)for(const l of t)Object.defineProperty(this,l,{get:()=>{const t=r(n),i=o[e]-t;return this.rect[l]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vn{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Cn(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var bn,wn;function yn(e){e.preventDefault()}function xn(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(bn||(bn={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(wn||(wn={}));const qn={start:[wn.Space,wn.Enter],cancel:[wn.Esc],end:[wn.Space,wn.Enter,wn.Tab]},Sn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case wn.Right:return{...n,x:n.x+25};case wn.Left:return{...n,x:n.x-25};case wn.Down:return{...n,y:n.y+25};case wn.Up:return{...n,y:n.y-25}}};class Rn{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new vn(dt(t)),this.windowListeners=new vn(lt(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bn.Resize,this.handleCancel),this.windowListeners.add(bn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&mn(n),t(Lt)}handleKeyDown(e){if(yt(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=qn,coordinateGetter:l=Sn,scrollBehavior:i="smooth"}=o,{code:a}=e;if(r.end.includes(a))return void this.handleEnd(e);if(r.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,d=s?{x:s.left,y:s.top}:Lt;this.referenceCoordinates||(this.referenceCoordinates=d);const c=l(e,{active:t,context:n.current,currentCoordinates:d});if(c){const t=wt(c,d),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:l,isRight:a,isLeft:s,isBottom:d,maxScroll:u,minScroll:g}=dn(n),h=gn(n),m={x:Math.min(r===wn.Right?h.right-h.width/2:h.right,Math.max(r===wn.Right?h.left:h.left+h.width/2,c.x)),y:Math.min(r===wn.Down?h.bottom-h.height/2:h.bottom,Math.max(r===wn.Down?h.top:h.top+h.height/2,c.y))},f=r===wn.Right&&!a||r===wn.Left&&!s,p=r===wn.Down&&!d||r===wn.Up&&!l;if(f&&m.x!==c.x){const e=n.scrollLeft+t.x,l=r===wn.Right&&e<=u.x||r===wn.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});o.x=l?n.scrollLeft-e:r===wn.Right?n.scrollLeft-u.x:n.scrollLeft-g.x,o.x&&n.scrollBy({left:-o.x,behavior:i});break}if(p&&m.y!==c.y){const e=n.scrollTop+t.y,l=r===wn.Down&&e<=u.y||r===wn.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});o.y=l?n.scrollTop-e:r===wn.Down?n.scrollTop-u.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:i});break}}this.handleMove(e,bt(wt(c,this.referenceCoordinates),o))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function kn(e){return Boolean(e&&"distance"in e)}function Mn(e){return Boolean(e&&"delay"in e)}Rn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=qn,onActivation:r}=t,{active:l}=n;const{code:i}=e.nativeEvent;if(o.start.includes(i)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class Tn{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=lt(e);return e instanceof t?e:dt(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:l}=r;this.props=e,this.events=t,this.document=dt(l),this.documentListeners=new vn(this.document),this.listeners=new vn(n),this.windowListeners=new vn(lt(l)),this.initialCoordinates=null!=(o=xt(r))?o:Lt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(bn.Resize,this.handleCancel),this.windowListeners.add(bn.DragStart,yn),this.windowListeners.add(bn.VisibilityChange,this.handleCancel),this.windowListeners.add(bn.ContextMenu,yn),this.documentListeners.add(bn.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mn(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(kn(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:o}=this.props;o(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(bn.Click,xn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bn.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:l,options:{activationConstraint:i}}=r;if(!o)return;const a=null!=(t=xt(e))?t:Lt,s=wt(o,a);if(!n&&i){if(kn(i)){if(null!=i.tolerance&&Cn(s,i.tolerance))return this.handleCancel();if(Cn(s,i.distance))return this.handleStart()}return Mn(i)&&Cn(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),l(a)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===wn.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const In={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class En extends Tn{constructor(e){const{event:t}=e,n=dt(t.target);super(e,In,n)}}En.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const Fn={move:{name:"mousemove"},end:{name:"mouseup"}};var An;!function(e){e[e.RightClick=2]="RightClick"}(An||(An={}));class Dn extends Tn{constructor(e){super(e,Fn,dt(e.event.target))}}Dn.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==An.RightClick&&(null==o||o({event:n}),!0)}}];const zn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Nn extends Tn{constructor(e){super(e,zn)}static setup(){return window.addEventListener(zn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(zn.move.name,e)};function e(){}}}var Ln,On;function jn(e){let{acceleration:t,activator:n=Ln.Pointer,canScroll:o,draggingRect:l,enabled:i,interval:a=5,order:s=On.TreeOrder,pointerCoordinates:d,scrollableAncestors:c,scrollableAncestorRects:u,delta:g,threshold:h}=e;const m=function(e){let{delta:t,disabled:n}=e;const o=ft(t);return ht(e=>{if(n||!o||!e)return Bn;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[an.Backward]:e.x[an.Backward]||-1===r.x,[an.Forward]:e.x[an.Forward]||1===r.x},y:{[an.Backward]:e.y[an.Backward]||-1===r.y,[an.Forward]:e.y[an.Forward]||1===r.y}}},[n,t,o])}({delta:g,disabled:!i}),[f,p]=function(){const e=r.useRef(null);return[r.useCallback((t,n)=>{e.current=setInterval(t,n)},[]),r.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),v=r.useRef({x:0,y:0}),C=r.useRef({x:0,y:0}),b=r.useMemo(()=>{switch(n){case Ln.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Ln.DraggableRect:return l}},[n,l,d]),w=r.useRef(null),y=r.useCallback(()=>{const e=w.current;if(!e)return;const t=v.current.x*C.current.x,n=v.current.y*C.current.y;e.scrollBy(t,n)},[]),x=r.useMemo(()=>s===On.TreeOrder?[...c].reverse():c,[s,c]);r.useEffect(()=>{if(i&&c.length&&b){for(const e of x){if(!1===(null==o?void 0:o(e)))continue;const n=c.indexOf(e),r=u[n];if(!r)continue;const{direction:l,speed:i}=un(e,r,b,t,h);for(const e of["x","y"])m[e][l[e]]||(i[e]=0,l[e]=0);if(i.x>0||i.y>0)return p(),w.current=e,f(y,a),v.current=i,void(C.current=l)}v.current={x:0,y:0},C.current={x:0,y:0},p()}else p()},[t,y,o,p,i,a,JSON.stringify(b),JSON.stringify(m),f,c,x,u,JSON.stringify(h)])}Nn.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Ln||(Ln={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(On||(On={}));const Bn={x:{[an.Backward]:!1,[an.Forward]:!1},y:{[an.Backward]:!1,[an.Forward]:!1}};var Vn,Pn;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Vn||(Vn={})),function(e){e.Optimized="optimized"}(Pn||(Pn={}));const Hn=new Map;function Un(e,t){return ht(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Kn(e){let{callback:t,disabled:n}=e;const o=ut(t),l=r.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[n]);return r.useEffect(()=>()=>null==l?void 0:l.disconnect(),[l]),l}function Wn(e){return new pn(Jt(e),e)}function $n(e,t,n){void 0===t&&(t=Wn);const[o,l]=r.useState(null);function i(){l(o=>{if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=o?o:n)?r:null;const l=t(e);return JSON.stringify(o)===JSON.stringify(l)?o:l})}const a=function(e){let{callback:t,disabled:n}=e;const o=ut(t),l=r.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,n]);return r.useEffect(()=>()=>null==l?void 0:l.disconnect(),[l]),l}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){i();break}}}}),s=Kn({callback:i});return ct(()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())},[e]),o}const Gn=[];function _n(e,t){void 0===t&&(t=[]);const n=r.useRef(null);return r.useEffect(()=>{n.current=null},t),r.useEffect(()=>{const t=e!==Lt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?wt(e,n.current):Lt}function Zn(e){return r.useMemo(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const Xn=[];function Yn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return at(t)?t:e}const Jn=[{sensor:En,options:{}},{sensor:Rn,options:{}}],Qn={current:{}},eo={draggable:{measure:Qt},droppable:{measure:Qt,strategy:Vn.WhileDragging,frequency:Pn.Optimized},dragOverlay:{measure:Jt}};class to extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const no={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new to,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:zt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eo,measureDroppableContainers:zt,windowRect:null,measuringScheduled:!1},oo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:zt,draggableNodes:new Map,over:null,measureDroppableContainers:zt},ro=r.createContext(oo),lo=r.createContext(no);function io(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new to}}}function ao(e,t){switch(t.type){case Dt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Dt.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Dt.DragEnd:case Dt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Dt.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new to(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case Dt.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,l=e.droppable.containers.get(n);if(!l||o!==l.key)return e;const i=new to(e.droppable.containers);return i.set(n,{...l,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case Dt.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new to(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function so(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:l}=r.useContext(ro),i=ft(o),a=ft(null==n?void 0:n.id);return r.useEffect(()=>{if(!t&&!o&&i&&null!=a){if(!yt(i))return;if(document.activeElement===i.target)return;const e=l.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Rt(e);if(t){t.focus();break}}})}},[o,t,l,a,i]),null}function co(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...o}),n):n}const uo=r.createContext({...Lt,scaleX:1,scaleY:1});var go;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(go||(go={}));const ho=r.memo(function(e){var t,n,o,l;let{id:a,accessibility:s,autoScroll:d=!0,children:c,sensors:u=Jn,collisionDetection:g=$t,measuring:h,modifiers:m,...f}=e;const p=r.useReducer(ao,void 0,io),[v,C]=p,[b,w]=function(){const[e]=r.useState(()=>new Set),t=r.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]);return[r.useCallback(t=>{let{type:n,event:o}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)})},[e]),t]}(),[y,x]=r.useState(go.Uninitialized),q=y===go.Initialized,{draggable:{active:S,nodes:R,translate:k},droppable:{containers:M}}=v,T=null!=S?R.get(S):null,I=r.useRef({initial:null,translated:null}),E=r.useMemo(()=>{var e;return null!=S?{id:S,data:null!=(e=null==T?void 0:T.data)?e:Qn,rect:I}:null},[S,T]),F=r.useRef(null),[A,D]=r.useState(null),[z,N]=r.useState(null),L=gt(f,Object.values(f)),O=vt("DndDescribedBy",a),j=r.useMemo(()=>M.getEnabled(),[M]),B=(V=h,r.useMemo(()=>({draggable:{...eo.draggable,...null==V?void 0:V.draggable},droppable:{...eo.droppable,...null==V?void 0:V.droppable},dragOverlay:{...eo.dragOverlay,...null==V?void 0:V.dragOverlay}}),[null==V?void 0:V.draggable,null==V?void 0:V.droppable,null==V?void 0:V.dragOverlay]));var V;const{droppableRects:P,measureDroppableContainers:H,measuringScheduled:U}=function(e,t){let{dragging:n,dependencies:o,config:l}=t;const[i,a]=r.useState(null),{frequency:s,measure:d,strategy:c}=l,u=r.useRef(e),g=function(){switch(c){case Vn.Always:return!1;case Vn.BeforeDragging:return n;default:return!n}}(),h=gt(g),m=r.useCallback(function(e){void 0===e&&(e=[]),h.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[h]),f=r.useRef(null),p=ht(t=>{if(g&&!n)return Hn;if(!t||t===Hn||u.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new pn(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,i,n,g,d]);return r.useEffect(()=>{u.current=e},[e]),r.useEffect(()=>{g||m()},[n,g]),r.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),r.useEffect(()=>{g||"number"!=typeof s||null!==f.current||(f.current=setTimeout(()=>{m(),f.current=null},s))},[s,g,m,...o]),{droppableRects:p,measureDroppableContainers:m,measuringScheduled:null!=i}}(j,{dragging:q,dependencies:[k.x,k.y],config:B.droppable}),K=function(e,t){const n=null!=t?e.get(t):void 0,o=n?n.node.current:null;return ht(e=>{var n;return null==t?null:null!=(n=null!=o?o:e)?n:null},[o,t])}(R,S),W=r.useMemo(()=>z?xt(z):null,[z]),$=function(){const e=!1===(null==A?void 0:A.autoScrollEnabled),t="object"==typeof d?!1===d.enabled:!1===d,n=q&&!e&&!t;if("object"==typeof d)return{...d,enabled:n};return{enabled:n}}(),G=function(e,t){return Un(e,t)}(K,B.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:l=!0}=e;const i=r.useRef(!1),{x:a,y:s}="boolean"==typeof l?{x:l,y:l}:l;ct(()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=Gt(n(e),o);if(a||(r.x=0),s||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=tn(e);t&&t.scrollBy({top:r.y,left:r.x})}},[t,a,s,o,n])}({activeNode:null!=S?R.get(S):null,config:$.layoutShiftCompensation,initialRect:G,measure:B.draggable.measure});const _=$n(K,B.draggable.measure,G),Z=$n(K?K.parentElement:null),X=r.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Y=M.getNodeFor(null==(t=X.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,o]=r.useState(null),l=Kn({callback:r.useCallback(e=>{for(const{target:n}of e)if(at(n)){o(e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o});break}},[t])}),i=r.useCallback(e=>{const n=Yn(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),o(n?t(n):null)},[t,l]),[a,s]=mt(i);return r.useMemo(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:B.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:K,ee=q?null!=(o=J.rect)?o:_:null,te=Boolean(J.nodeRef.current&&J.rect),ne=Gt(oe=te?null:_,Un(oe));var oe;const re=Zn(Q?lt(Q):null),le=function(e){const t=r.useRef(e),n=ht(n=>e?n&&n!==Gn&&e&&t.current&&e.parentNode===t.current.parentNode?n:en(e):Gn,[e]);return r.useEffect(()=>{t.current=e},[e]),n}(q?null!=Y?Y:K:null),ie=function(e,t){void 0===t&&(t=Jt);const[n]=e,o=Zn(n?lt(n):null),[l,i]=r.useState(Xn);function a(){i(()=>e.length?e.map(e=>sn(e)?o:new pn(t(e),e)):Xn)}const s=Kn({callback:a});return ct(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),l}(le),ae=co(m,{transform:{x:k.x-ne.x,y:k.y-ne.y,scaleX:1,scaleY:1},activatorEvent:z,active:E,activeNodeRect:_,containerNodeRect:Z,draggingNodeRect:ee,over:X.current.over,overlayNodeRect:J.rect,scrollableAncestors:le,scrollableAncestorRects:ie,windowRect:re}),se=W?bt(W,k):null,de=function(e){const[t,n]=r.useState(null),o=r.useRef(e),l=r.useCallback(e=>{const t=nn(e.target);t&&n(e=>e?(e.set(t,ln(t)),new Map(e)):null)},[]);return r.useEffect(()=>{const t=o.current;if(e!==t){r(t);const i=e.map(e=>{const t=nn(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,ln(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),o.current=e}return()=>{r(e),r(t)};function r(e){e.forEach(e=>{const t=nn(e);null==t||t.removeEventListener("scroll",l)})}},[l,e]),r.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>bt(e,t),Lt):hn(e):Lt,[e,t])}(le),ce=_n(de),ue=_n(de,[_]),ge=bt(ae,ce),he=ee?Zt(ee,ae):null,me=E&&he?g({active:E,collisionRect:he,droppableRects:P,droppableContainers:j,pointerCoordinates:se}):null,fe=Ht(me,"id"),[pe,ve]=r.useState(null),Ce=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(te?ae:bt(ae,ue),null!=(l=null==pe?void 0:pe.rect)?l:null,_),be=r.useRef(null),we=r.useCallback((e,t)=>{let{sensor:n,options:o}=t;if(null==F.current)return;const r=R.get(F.current);if(!r)return;const l=e.nativeEvent,a=new n({active:F.current,activeNode:r,event:l,options:o,context:X,onAbort(e){if(!R.get(e))return;const{onDragAbort:t}=L.current,n={id:e};null==t||t(n),b({type:"onDragAbort",event:n})},onPending(e,t,n,o){if(!R.get(e))return;const{onDragPending:r}=L.current,l={id:e,constraint:t,initialCoordinates:n,offset:o};null==r||r(l),b({type:"onDragPending",event:l})},onStart(e){const t=F.current;if(null==t)return;const n=R.get(t);if(!n)return;const{onDragStart:o}=L.current,r={activatorEvent:l,active:{id:t,data:n.data,rect:I}};i.unstable_batchedUpdates(()=>{null==o||o(r),x(go.Initializing),C({type:Dt.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:r}),D(be.current),N(l)})},onMove(e){C({type:Dt.DragMove,coordinates:e})},onEnd:s(Dt.DragEnd),onCancel:s(Dt.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=X.current;let a=null;if(t&&r){const{cancelDrop:i}=L.current;if(a={activatorEvent:l,active:t,collisions:n,delta:r,over:o},e===Dt.DragEnd&&"function"==typeof i){await Promise.resolve(i(a))&&(e=Dt.DragCancel)}}F.current=null,i.unstable_batchedUpdates(()=>{C({type:e}),x(go.Uninitialized),ve(null),D(null),N(null),be.current=null;const t=e===Dt.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=L.current[t];null==e||e(a),b({type:t,event:a})}})}}be.current=a},[R]),ye=r.useCallback((e,t)=>(n,o)=>{const r=n.nativeEvent,l=R.get(o);if(null!==F.current||!l||r.dndKit||r.defaultPrevented)return;const i={active:l};!0===e(n,t.options,i)&&(r.dndKit={capturedBy:t.sensor},F.current=o,we(n,t))},[R,we]),xe=function(e,t){return r.useMemo(()=>e.reduce((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(u,ye);!function(e){r.useEffect(()=>{if(!nt)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(u),ct(()=>{_&&y===go.Initializing&&x(go.Initialized)},[_,y]),r.useEffect(()=>{const{onDragMove:e}=L.current,{active:t,activatorEvent:n,collisions:o,over:r}=X.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:o,delta:{x:ge.x,y:ge.y},over:r};i.unstable_batchedUpdates(()=>{null==e||e(l),b({type:"onDragMove",event:l})})},[ge.x,ge.y]),r.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=X.current;if(!e||null==F.current||!t||!r)return;const{onDragOver:l}=L.current,a=o.get(fe),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,d={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:s};i.unstable_batchedUpdates(()=>{ve(s),null==l||l(d),b({type:"onDragOver",event:d})})},[fe]),ct(()=>{X.current={activatorEvent:z,active:E,activeNode:K,collisionRect:he,collisions:me,droppableRects:P,draggableNodes:R,draggingNode:Q,draggingNodeRect:ee,droppableContainers:M,over:pe,scrollableAncestors:le,scrollAdjustedTranslate:ge},I.current={initial:ee,translated:he}},[E,K,me,he,R,Q,ee,P,M,pe,le,ge]),jn({...$,delta:k,draggingRect:he,pointerCoordinates:se,scrollableAncestors:le,scrollableAncestorRects:ie});const qe=r.useMemo(()=>({active:E,activeNode:K,activeNodeRect:_,activatorEvent:z,collisions:me,containerNodeRect:Z,dragOverlay:J,draggableNodes:R,droppableContainers:M,droppableRects:P,over:pe,measureDroppableContainers:H,scrollableAncestors:le,scrollableAncestorRects:ie,measuringConfiguration:B,measuringScheduled:U,windowRect:re}),[E,K,_,z,me,Z,J,R,M,P,pe,H,le,ie,B,U,re]),Se=r.useMemo(()=>({activatorEvent:z,activators:xe,active:E,activeNodeRect:_,ariaDescribedById:{draggable:O},dispatch:C,draggableNodes:R,over:pe,measureDroppableContainers:H}),[z,xe,E,_,C,O,R,pe,H]);return r.createElement(It.Provider,{value:w},r.createElement(ro.Provider,{value:Se},r.createElement(lo.Provider,{value:qe},r.createElement(uo.Provider,{value:Ce},c)),r.createElement(so,{disabled:!1===(null==s?void 0:s.restoreFocus)})),r.createElement(At,{...s,hiddenTextDescribedById:O}))}),mo=r.createContext(null),fo="button";function po(e){let{id:t,data:n,disabled:o=!1,attributes:l}=e;const i=vt("Draggable"),{activators:a,activatorEvent:s,active:d,activeNodeRect:c,ariaDescribedById:u,draggableNodes:g,over:h}=r.useContext(ro),{role:m=fo,roleDescription:f="draggable",tabIndex:p=0}=null!=l?l:{},v=(null==d?void 0:d.id)===t,C=r.useContext(v?uo:mo),[b,w]=mt(),[y,x]=mt(),q=function(e,t){return r.useMemo(()=>e.reduce((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e},{}),[e,t])}(a,t),S=gt(n);ct(()=>(g.set(t,{id:t,key:i,node:b,activatorNode:y,data:S}),()=>{const e=g.get(t);e&&e.key===i&&g.delete(t)}),[g,t]);return{active:d,activatorEvent:s,activeNodeRect:c,attributes:r.useMemo(()=>({role:m,tabIndex:p,"aria-disabled":o,"aria-pressed":!(!v||m!==fo)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[o,m,p,v,f,u.draggable]),isDragging:v,listeners:o?void 0:q,node:b,over:h,setNodeRef:w,setActivatorNodeRef:x,transform:C}}function vo(){return r.useContext(lo)}const Co={timeout:25};function bo(e){let{animation:t,children:n}=e;const[o,l]=r.useState(null),[i,a]=r.useState(null),s=ft(n);return n||o||!s||l(s),ct(()=>{if(!i)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{l(null)}):l(null)},[t,o,i]),r.createElement(r.Fragment,null,n,o?r.cloneElement(o,{ref:a}):null)}const wo={x:0,y:0,scaleX:1,scaleY:1};function yo(e){let{children:t}=e;return r.createElement(ro.Provider,{value:oo},r.createElement(uo.Provider,{value:wo},t))}const xo={position:"fixed",touchAction:"none"},qo=e=>yt(e)?"transform 250ms ease":void 0,So=r.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:l,children:i,className:a,rect:s,style:d,transform:c,transition:u=qo}=e;if(!s)return null;const g=l?c:{...c,scaleX:1,scaleY:1},h={...xo,width:s.width,height:s.height,top:s.top,left:s.left,transform:qt.Transform.toString(g),transformOrigin:l&&o?jt(o,s):void 0,transition:"function"==typeof u?u(o):u,...d};return r.createElement(n,{className:a,style:h,ref:t},i)}),Ro=e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:l,className:i}=e;if(null!=l&&l.active)for(const[e,t]of Object.entries(l.active))void 0!==t&&(r[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=l&&l.dragOverlay)for(const[e,t]of Object.entries(l.dragOverlay))void 0!==t&&o.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&o.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(r))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},ko={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:qt.Transform.toString(t)},{transform:qt.Transform.toString(n)}]},sideEffects:Ro({styles:{active:{opacity:"0"}}})};function Mo(e){let{config:t,draggableNodes:n,droppableContainers:o,measuringConfiguration:r}=e;return ut((e,l)=>{if(null===t)return;const i=n.get(e);if(!i)return;const a=i.node.current;if(!a)return;const s=Yn(l);if(!s)return;const{transform:d}=lt(l).getComputedStyle(l),c=Xt(d);if(!c)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:o,keyframes:r}={...ko,...e};return e=>{let{active:l,dragOverlay:i,transform:a,...s}=e;if(!t)return;const d={x:i.rect.left-l.rect.left,y:i.rect.top-l.rect.top},c={scaleX:1!==a.scaleX?l.rect.width*a.scaleX/i.rect.width:1,scaleY:1!==a.scaleY?l.rect.height*a.scaleY/i.rect.height:1},u={x:a.x-d.x,y:a.y-d.y,...c},g=r({...s,active:l,dragOverlay:i,transform:{initial:a,final:u}}),[h]=g,m=g[g.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const f=null==o?void 0:o({active:l,dragOverlay:i,...s}),p=i.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{p.onfinish=()=>{null==f||f(),e()}})}}(t);return mn(a,r.draggable.measure),u({active:{id:e,data:i.data,node:a,rect:r.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:l,rect:r.dragOverlay.measure(s)},droppableContainers:o,measuringConfiguration:r,transform:c})})}let To=0;function Io(e){return r.useMemo(()=>{if(null!=e)return To++,To},[e])}const Eo=r.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:l,transition:i,modifiers:a,wrapperElement:s="div",className:d,zIndex:c=999}=e;const{activatorEvent:u,active:g,activeNodeRect:h,containerNodeRect:m,draggableNodes:f,droppableContainers:p,dragOverlay:v,over:C,measuringConfiguration:b,scrollableAncestors:w,scrollableAncestorRects:y,windowRect:x}=vo(),q=r.useContext(uo),S=Io(null==g?void 0:g.id),R=co(a,{activatorEvent:u,active:g,activeNodeRect:h,containerNodeRect:m,draggingNodeRect:v.rect,over:C,overlayNodeRect:v.rect,scrollableAncestors:w,scrollableAncestorRects:y,transform:q,windowRect:x}),k=Un(h),M=Mo({config:o,draggableNodes:f,droppableContainers:p,measuringConfiguration:b}),T=k?v.setRef:void 0;return r.createElement(yo,null,r.createElement(bo,{animation:M},g&&S?r.createElement(So,{key:S,id:g.id,ref:T,as:s,activatorEvent:u,adjustScale:t,className:d,transition:i,rect:k,style:{zIndex:c,...l},transform:R},n):null))});function Fo(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Ao(e,t){return e.reduce((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e},Array(e.length))}function Do(e){return null!==e&&e>=0}const zo={scaleX:1,scaleY:1},No=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:l,index:i}=e;const a=null!=(t=n[r])?t:o;if(!a)return null;const s=function(e,t,n){const o=e[t],r=e[t-1],l=e[t+1];if(!o||!r&&!l)return 0;if(n<t)return r?o.left-(r.left+r.width):l.left-(o.left+o.width);return l?l.left-(o.left+o.width):o.left-(r.left+r.width)}(n,i,r);if(i===r){const e=n[l];return e?{x:r<l?e.left+e.width-(a.left+a.width):e.left-a.left,y:0,...zo}:null}return i>r&&i<=l?{x:-a.width-s,y:0,...zo}:i<r&&i>=l?{x:a.width+s,y:0,...zo}:{x:0,y:0,...zo}};const Lo=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const l=Fo(t,o,n),i=t[r],a=l[r];return a&&i?{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}:null},Oo="Sortable",jo=r.createContext({activeIndex:-1,containerId:Oo,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Lo,disabled:{draggable:!1,droppable:!1}});function Bo(e){let{children:t,id:n,items:o,strategy:l=Lo,disabled:i=!1}=e;const{active:a,dragOverlay:s,droppableRects:d,over:c,measureDroppableContainers:u}=vo(),g=vt(Oo,n),h=Boolean(null!==s.rect),m=r.useMemo(()=>o.map(e=>"object"==typeof e&&"id"in e?e.id:e),[o]),f=null!=a,p=a?m.indexOf(a.id):-1,v=c?m.indexOf(c.id):-1,C=r.useRef(m),b=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,C.current),w=-1!==v&&-1===p||b,y=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);ct(()=>{b&&f&&u(m)},[b,m,f,u]),r.useEffect(()=>{C.current=m},[m]);const x=r.useMemo(()=>({activeIndex:p,containerId:g,disabled:y,disableTransforms:w,items:m,overIndex:v,useDragOverlay:h,sortedRects:Ao(m,d),strategy:l}),[p,g,y.draggable,y.droppable,w,m,v,d,h,l]);return r.createElement(jo.Provider,{value:x},t)}const Vo=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return Fo(n,o,r).indexOf(t)},Po=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:l,newIndex:i,previousItems:a,previousContainerId:s,transition:d}=e;return!(!d||!o)&&((a===l||r!==i)&&(!!n||i!==r&&t===s))},Ho={duration:200,easing:"ease"},Uo="transform",Ko=qt.Transition.toString({property:Uo,duration:0,easing:"linear"}),Wo={roleDescription:"sortable"};function $o(e){let{animateLayoutChanges:t=Po,attributes:n,disabled:o,data:l,getNewIndex:i=Vo,id:a,strategy:s,resizeObserverConfig:d,transition:c=Ho}=e;const{items:u,containerId:g,activeIndex:h,disabled:m,disableTransforms:f,sortedRects:p,overIndex:v,useDragOverlay:C,strategy:b}=r.useContext(jo),w=function(e,t){var n,o;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(o,m),y=u.indexOf(a),x=r.useMemo(()=>({sortable:{containerId:g,index:y,items:u},...l}),[g,l,y,u]),q=r.useMemo(()=>u.slice(u.indexOf(a)),[u,a]),{rect:S,node:R,isOver:k,setNodeRef:M}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:l}=e;const i=vt("Droppable"),{active:a,dispatch:s,over:d,measureDroppableContainers:c}=r.useContext(ro),u=r.useRef({disabled:n}),g=r.useRef(!1),h=r.useRef(null),m=r.useRef(null),{disabled:f,updateMeasurementsFor:p,timeout:v}={...Co,...l},C=gt(null!=p?p:o),b=Kn({callback:r.useCallback(()=>{g.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{c(Array.isArray(C.current)?C.current:[C.current]),m.current=null},v)):g.current=!0},[v]),disabled:f||!a}),w=r.useCallback((e,t)=>{b&&(t&&(b.unobserve(t),g.current=!1),e&&b.observe(e))},[b]),[y,x]=mt(w),q=gt(t);return r.useEffect(()=>{b&&y.current&&(b.disconnect(),g.current=!1,b.observe(y.current))},[y,b]),r.useEffect(()=>(s({type:Dt.RegisterDroppable,element:{id:o,key:i,disabled:n,node:y,rect:h,data:q}}),()=>s({type:Dt.UnregisterDroppable,key:i,id:o})),[o]),r.useEffect(()=>{n!==u.current.disabled&&(s({type:Dt.SetDroppableDisabled,id:o,key:i,disabled:n}),u.current.disabled=n)},[o,i,n,s]),{active:a,rect:h,isOver:(null==d?void 0:d.id)===o,node:y,over:d,setNodeRef:x}}({id:a,data:x,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...d}}),{active:T,activatorEvent:I,activeNodeRect:E,attributes:F,setNodeRef:A,listeners:D,isDragging:z,over:N,setActivatorNodeRef:L,transform:O}=po({id:a,data:x,attributes:{...Wo,...n},disabled:w.draggable}),j=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.useMemo(()=>e=>{t.forEach(t=>t(e))},t)}(M,A),B=Boolean(T),V=B&&!f&&Do(h)&&Do(v),P=!C&&z,H=P&&V?O:null,U=V?null!=H?H:(null!=s?s:b)({rects:p,activeNodeRect:E,activeIndex:h,overIndex:v,index:y}):null,K=Do(h)&&Do(v)?i({id:a,items:u,activeIndex:h,overIndex:v}):y,W=null==T?void 0:T.id,$=r.useRef({activeId:W,items:u,newIndex:K,containerId:g}),G=u!==$.current.items,_=t({active:T,containerId:g,isDragging:z,isSorting:B,id:a,index:y,items:u,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:c,wasDragging:null!=$.current.activeId}),Z=function(e){let{disabled:t,index:n,node:o,rect:l}=e;const[i,a]=r.useState(null),s=r.useRef(n);return ct(()=>{if(!t&&n!==s.current&&o.current){const e=l.current;if(e){const t=Jt(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==s.current&&(s.current=n)},[t,n,o,l]),r.useEffect(()=>{i&&a(null)},[i]),i}({disabled:!_,index:y,node:R,rect:S});return r.useEffect(()=>{B&&$.current.newIndex!==K&&($.current.newIndex=K),g!==$.current.containerId&&($.current.containerId=g),u!==$.current.items&&($.current.items=u)},[B,K,g,u]),r.useEffect(()=>{if(W===$.current.activeId)return;if(null!=W&&null==$.current.activeId)return void($.current.activeId=W);const e=setTimeout(()=>{$.current.activeId=W},50);return()=>clearTimeout(e)},[W]),{active:T,activeIndex:h,attributes:F,data:x,rect:S,index:y,newIndex:K,items:u,isOver:k,isSorting:B,isDragging:z,listeners:D,node:R,overIndex:v,over:N,setNodeRef:j,setActivatorNodeRef:L,setDroppableNodeRef:M,setDraggableNodeRef:A,transform:null!=Z?Z:U,transition:function(){if(Z||G&&$.current.newIndex===y)return Ko;if(P&&!yt(I)||!c)return;if(B||_)return qt.Transition.toString({...c,property:Uo});return}()}}function Go(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const _o=[wn.Down,wn.Right,wn.Up,wn.Left],Zo=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:l,over:i,scrollableAncestors:a}}=t;if(_o.includes(e.code)){if(e.preventDefault(),!n||!o)return;const t=[];l.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const l=r.get(n.id);if(l)switch(e.code){case wn.Down:o.top<l.top&&t.push(n);break;case wn.Up:o.top>l.top&&t.push(n);break;case wn.Left:o.left>l.left&&t.push(n);break;case wn.Right:o.left<l.left&&t.push(n)}});const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Pt(t),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=Pt(o),i=r.reduce((e,t,o)=>e+Ot(n[o],t),0),a=Number((i/4).toFixed(4));l.push({id:t,data:{droppableContainer:e,value:a}})}}return l.sort(Bt)})({collisionRect:o,droppableRects:r,droppableContainers:t});let d=Ht(s,"id");if(d===(null==i?void 0:i.id)&&s.length>1&&(d=s[1].id),null!=d){const e=l.get(n.id),t=l.get(d),i=t?r.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&i&&e&&t){const n=en(s).some((e,t)=>a[t]!==e),r=Xo(e,t),l=function(e,t){if(!Go(e)||!Go(t))return!1;if(!Xo(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),d=n||!r?{x:0,y:0}:{x:l?o.width-i.width:0,y:l?o.height-i.height:0},c={x:i.left,y:i.top};return d.x&&d.y?c:wt(c,d)}}}};function Xo(e,t){return!(!Go(e)||!Go(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const Yo=e=>{let{transform:t}=e;return{...t,y:0}},Jo=r.memo(r.forwardRef((e,t)=>{const{children:o,style:r,className:l,index:i,editing:a,editable:s,selectedIndex:d,background:c,activeColor:u,borderColor:g,borderWidth:h,dragging:m,...f}=e;return n.jsxs("div",{ref:t,className:V(l),style:{...r,display:"flex",flexDirection:"column",background:d===i?"white":c,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:d===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...f,children:[n.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[n.jsx("div",{style:{marginLeft:d===i?"0px":"-1px",marginTop:d===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),o,d===i?n.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):n.jsx(n.Fragment,{})]}),n.jsx("div",{style:{flex:"1 1 100%",background:d===i&&u?u?.toCSS():"none",minHeight:"2px"}})]})})),Qo={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},er=r.memo(r.forwardRef(({color:e,dragOverlay:t,dragging:o,disabled:l,fadeIn:i,handle:a,height:s,index:d,listeners:c,onRemove:u,renderItem:g,sorting:h,style:m,transition:f,transform:p,value:v,wrapperStyle:C,...b},w)=>{r.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const y=g?g({dragOverlay:Boolean(t),dragging:Boolean(o),sorting:Boolean(h),index:d,fadeIn:Boolean(i),listeners:c,ref:w,style:m,transform:p,transition:f,value:v}):n.jsx(n.Fragment,{children:v});return n.jsx("div",{className:V("tab-item",Qo.Wrapper,i&&Qo.fadeIn,h&&Qo.sorting,t&&Qo.dragOverlay),style:{...C,transition:[f,C?.transition].filter(Boolean).join(", "),"--translate-x":p?`${Math.round(p.x)}px`:void 0,"--translate-y":p?`${Math.round(p.y)}px`:void 0,"--scale-x":p?.scaleX?`${p.scaleX}`:void 0,"--scale-y":p?.scaleY?`${p.scaleY}`:void 0,"--index":d},ref:w,children:n.jsx("div",{className:V(Qo.Item,o&&Qo.dragging,a&&Qo.withHandle,t&&Qo.dragOverlay,l&&Qo.disabled,e&&Qo.color,"dragging"),style:m,"data-cypress":"draggable-item",...a?void 0:c,...b,tabIndex:a?void 0:-1,children:y})})})),tr={Row:"_Row_1kr10_1"},nr=r.memo(r.forwardRef(({children:e,horizontal:t,style:o},r)=>n.jsx("div",{ref:r,style:{...o},className:V(tr.Row,t&&tr.horizontal),children:e}))),or={...ko},rr=r.memo(r.forwardRef((e,o)=>{const{className:l,activationConstraint:a,animateLayoutChanges:s,adjustScale:d=!1,collisionDetection:c=Kt,coordinateGetter:u=Zo,dropAnimation:g=or,getItemStyles:h=()=>({}),getNewIndex:m,handle:f=!1,items:p,onMove:v,isDisabled:C=()=>!1,measuring:b,modifiers:w,renderItem:y,renderDivider:x,reorderItems:q=Fo,strategy:S=Lo,style:R,useDragOverlay:k=!0,onDragStart:M,wrapperStyle:T=()=>({})}=e,[I,E]=r.useState(()=>p);r.useEffect(()=>{E(p)},[p]);const[F,A]=r.useState(null),D=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.useMemo(()=>[...t].filter(e=>null!=e),[...t])}(Nt(Dn,{activationConstraint:a}),Nt(Nn,{activationConstraint:a}),Nt(Rn,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:u})),z=I.indexOf.bind(I),N=F?z(F):-1,L=[];I.map((e,t)=>{L.push(n.jsx(lr,{id:e,handle:f,index:t,style:h,wrapperStyle:T,disabled:C(e),renderItem:y,animateLayoutChanges:s,useDragOverlay:k,getNewIndex:m},e+"-"+t));const o=x?.({key:"divider-"+t});o&&L.push(o)});const{getPortalContainer:O}=t.useFullscreenPortal();return n.jsxs(ho,{sensors:D,collisionDetection:c,onDragStart:e=>{const{active:t}=e;t&&(M?.(e),A(t.id))},autoScroll:{canScroll:e=>!0},onDragEnd:e=>{if(A(null),e.over){const t=z(e.over.id);N!==t&&(E(e=>q(e,N,t)),v?.(N,t))}},onDragCancel:()=>{A(null)},measuring:b,modifiers:w,children:[n.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...R},className:V(l,Qo.Wrapper),children:n.jsx(Bo,{items:I,strategy:S,children:n.jsx(nr,{ref:o,children:L})})}),k?i.createPortal(n.jsx(Eo,{adjustScale:d,dropAnimation:g,children:F?n.jsx(er,{value:I[N],handle:f,renderItem:y,wrapperStyle:T({index:N,isDragging:!0,id:I[N]}),index:N,dragging:!0,style:h({id:I[N],index:N,isSorting:null!==F,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),O()):null]})}));function lr({disabled:e,animateLayoutChanges:t,getNewIndex:o,handle:r,id:l,index:i,onRemove:a,style:s,renderItem:d,useDragOverlay:c,wrapperStyle:u}){const{attributes:g,isDragging:h,isSorting:m,listeners:f,overIndex:p,setNodeRef:v,transform:C,transition:b}=$o({id:l,animateLayoutChanges:t,disabled:e,getNewIndex:o});return n.jsx(er,{ref:v,value:l,disabled:e,dragging:h,sorting:m,handle:r,renderItem:d,index:i,style:s({index:i,id:l,isDragging:h,isSorting:m,overIndex:p}),onRemove:a?()=>a(l):void 0,transform:C,transition:b,wrapperStyle:u({index:i,isDragging:h,id:l}),listeners:f,"data-index":i,"data-id":l,dragOverlay:!c&&h,...g})}const ir="_TabStrip_3x0dp_1",ar=new e.Color("rgb(33, 115, 70)"),sr="#eee",dr=e=>n.jsx(Jo,{...e}),cr=r.memo(r.forwardRef((e,o)=>{const{children:l,style:i,className:a,selectedTabIndex:s=0,tabNames:d=[],onSelectedTabIndexChange:c,onTabNameChange:u,onTabMove:g,createScrollStartButton:h=t.defaultCreateScrollStartButton,createScrollEndButton:m=t.defaultCreateScrollEndButton,createScrollEdgeButton:f=t.defaultCreateScrollEdgeButton,createTabButton:p=dr,createTabDivider:v,editLabelProps:C,disabled:b=!1,disableDrag:w=!1,background:y="white",activeColor:x=ar,borderColor:q=sr,borderWidth:S=1}=e,[R,k]=r.useState(s),[M,I]=r.useState(d),E=r.useCallback(e=>{const t=O.current?.[e]?.closest(".tab-item")??O.current?.[e];t&&W.current?.scrollTo({top:t.offsetTop,left:t.offsetLeft,behavior:"smooth"})},[]);r.useEffect(()=>{E(s)},[s]);const F=r.useCallback((e,t)=>{t!==R&&(k(t),c?.(t)),E(t)},[c,R]),A=r.useCallback((e,t)=>{g?.(e,t)},[g]),D=r.useRef(null),[z,N]=r.useState(-1),L=r.useCallback((e,t)=>{u?.(e,t)},[u]);r.useLayoutEffect(()=>{k(s)},[s]),r.useLayoutEffect(()=>{I(d)},[d]);const O=r.useRef([]),j=r.useRef(null);r.useImperativeHandle(o,()=>Object.assign({startEdit(e){O.current?.[e]?.startEdit()},cancel(e){O.current?.[e]?.cancel()}},j.current),[R,z]);const B=r.useCallback(({value:e,index:t,dragging:o})=>{const{style:r,maxLength:l,...i}=C||{},a=n.jsx(tt,{ref:e=>{O.current[t]=e},value:e,disabled:b,maxLength:l,style:{color:R===t&&x?x?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...r},styleHover:{},onSubmit:e=>(D.current=!1,N(-1),L(t,e)),onCancel:()=>{D.current=!1,N(-1)},onChange:e=>{D.current=!0,N(t)},...i});return p({onClick:e=>F(e,t),value:e,index:t,editing:z===t&&D.current,editable:!0,disabled:b,selectedIndex:R,background:y,activeColor:x,borderColor:q,borderWidth:S,dragging:o,children:a})},[R,L,F,C,b,z,p]),[P,{width:H}]=T(),[U,{width:K}]=T(),W=r.useRef(null),[$,G]=r.useState({left:0,top:0,width:0,height:0}),[_,Z]=r.useState(null);r.useEffect(()=>{null!==_&&W.current&&W.current.scrollTo({left:_,behavior:"smooth"})},[_]);const X=r.useCallback((e,n=!1)=>{if(!W.current)return 0;let o=W.current.firstChild.getBoundingClientRect(),r=W.current.firstChild.firstChild.children,l=0;return l=n?0:t.ScrollUtils.getScrollTo(e,o.left,r,!0,Math.max(0,e-200)),Z(l),Math.max(0,l)},[]),Y=r.useCallback((e,n=!1)=>{if(!W.current)return 0;let o=W.current.firstChild.getBoundingClientRect(),r=W.current.firstChild.firstChild.children,l=0;const i=Math.ceil(K-H);return l=n?i:t.ScrollUtils.getScrollTo(e,o.left,r,!1,Math.max(0,e+200)),Z(l),Math.min(i,l)},[K,H]),J=r.useRef(null),Q=r.useRef(null),ee=r.useCallback(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null,J.current=null)},[]),te=r.useCallback((e,t,n=260)=>{J.current=e,Q.current=setTimeout(()=>{const n=t?X(J.current||e):Y(J.current||e);n!==J.current?te(n,t,120):ee()},n)},[X,Y,ee]);r.useEffect(()=>()=>ee(),[ee]);const ne=r.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor($.left)<=0||0===Math.floor(K-H),orientation:t.ScrollbarOrientation.Horizontal,onMouseUp:ee,onMouseLeave:ee,onMouseDown:()=>te(W.current.scrollLeft,!0),onClick:e=>X(Math.min(W.current.scrollLeft,_??Number.MAX_SAFE_INTEGER),e.ctrlKey)}),[$,_,K,H]),oe=r.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(K-H)<=Math.ceil($.left),orientation:t.ScrollbarOrientation.Horizontal,onMouseUp:ee,onMouseLeave:ee,onMouseDown:()=>te(W.current.scrollLeft,!1),onClick:e=>Y(Math.max(W.current.scrollLeft,_??0),e.ctrlKey)}),[$,_,K,H]),re=r.useMemo(()=>n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{minWidth:"16px"}}),l,f?.(ne)]}),[ne,oe,h,m,l,f]);return n.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:V(ir,a),ref:j,children:[n.jsx("div",{style:{borderTop:`solid ${q} ${S}px`,position:"absolute",width:"100%"}}),n.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:re}),n.jsx("div",{className:"Tabs",ref:P,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:n.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:W,onScroll:e=>{G({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:n.jsx(rr,{isDisabled:e=>b||w,items:M,strategy:No,modifiers:[Yo],ref:U,renderItem:B,renderDivider:v,onMove:A,activationConstraint:{distance:15}})})}),n.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:f(oe)})]})}));cr.displayName="TabStrip";const ur=r.createContext(null),gr="_script-editor_iy654_5",hr=r.lazy(()=>Promise.resolve().then(()=>require("./CMot57AffbcQ1rTc.cjs"))),mr={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:"~!@#$%^&*()-=+[{]}|;:'\",.<>/?",wordWrap:"off",wordWrapBreakAfterCharacters:"\t})]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},fr=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(o.uri),i=await l.getNavigationTree(o.uri.toString()),a=e.getPosition();let s={...a};s.lineNumber=1,s.column=1;let d=!1;for(let e=a.lineNumber;e>=1;e--){if(""===o.getLineContent(e).trim()){const t=Cr(i,o.getOffsetAt({lineNumber:e,column:1}),"function");if(!t||br(t)){d=!0,s.lineNumber=e+1;break}{const n=t.spans[0].start;e=o.getPositionAt(n).lineNumber,s.lineNumber=e}}}let c=n,u=!1;!d&&!c.startsWith("\n")&&s.lineNumber>1&&(c="\n"+c,u=!0);let g=!1;o.getLineCount()>1&&(c.endsWith("\n\n")||(c+="\n\n",g=!0));const h=[{range:new t.Range(s.lineNumber,s.column,s.lineNumber,s.column),text:`${c}`}];let m=null;o.pushEditOperations([],h,e=>(m=e[0].range,u&&m.startLineNumber++,g&&m.endLineNumber--,[new t.Selection(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)])),e.setSelection({startLineNumber:m.endLineNumber,startColumn:m.endColumn,endLineNumber:m.startLineNumber,endColumn:m.startColumn})};function pr(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function vr(e,t,n,o,r=[]){if("function"===o.kind&&"export"===o.kindModifiers){const t=o.spans[0].start,l=e.getPositionAt(t);r.push({name:o.text,type:pr(n,o),lineNumber:l.lineNumber})}if(o.childItems)for(const l of o.childItems)vr(e,t,n,l,r);return r}function Cr(e,t,n="function",o){const r=e.spans;for(let l=0;l<r.length;l++){const i=r[l];if(i.start<=t&&t<i.start+i.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const r of e.childItems||[]){const e=Cr(r,t,n,o);if(e)return e}}return null}}function br(e){return"comment"===e.kind}const wr=r.memo(r.forwardRef((e,l)=>{const{className:i,style:a,commands:s,readOnly:d=!1,onClose:c,darkMode:u,loadingPanel:g,autoFocus:h=!0,onStatusChange:m,...f}=e,p=r.useRef(null),v=t.useCallbackRef(c,[c]),C=r.useRef(!1),b=r.useMemo(()=>({contains(e){if(!p.current)return;const t=p.current.editor;return t&&t.getDomNode()?.contains(e)},focus(){if(!p.current)return;const e=p.current.editor;return e&&e.getDomNode()?.focus()}}),[]),w=r.useMemo(()=>[new t.Command("help",b,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),y=r.useMemo(()=>{let e=null;const n=()=>b;return e=s?s.createChildGroup(n,"scriptEditor",!1):new t.CommandGroup(n,"scriptEditor"),e.addCommands(w,!0),e},[s,w]),x=t.useCommands(y,["executeSelectedScript"])[0],q=x?.context(),S=t.useCallbackRef(e=>{x?.execute(e)},[x]),R=r.useRef(""),[k,M]=r.useState(!1),T=t.useCallbackRef(async()=>{if(!p.current)return null;const e=p.current,t=e.editor;if(!t)return null;const n=e.monaco,o=await(async(e,t,n="export")=>{const o=e.getModel();if(!o)return null;const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(o.uri),i=await l.getNavigationTree(o.uri.toString());let a=null,s=e.getSelection();const d=s.startLineNumber===s.endLineNumber&&s.startColumn===s.endColumn?o.getLineCount():Math.min(s.endLineNumber,o.getLineCount());for(let e=s.startLineNumber;!a&&e<=d;e++){const t=Cr(i,o.getOffsetAt({lineNumber:e,column:1}),"function",n);t&&(a=t.text)}return a})(t,n);return m?.({message:(o??"").toUpperCase()}),o?{source:t.getValue(),name:o}:null},[m]);const I=t.useCallbackRef(async(e,t,n)=>{const r=await q.getScripts().createModule({source:n?.getValue(),declarationsOnly:!0}),l=r?r.getFunctions().search():o.CommonUtils.EmptyArray;r&&(async function(e,t){const n=[];for(let o=1;o<e.getLineCount()+1;o++){const r={startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:e.getLineLength(o)+1},l=e.getValueInRange(r).indexOf("modelt");-1!==l&&n.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:t.MarkerSeverity.Hint,startLineNumber:r.startLineNumber,startColumn:l+1,endLineNumber:r.startLineNumber,endColumn:l+5})}t.editor.setModelMarkers(e,"owner",n)}(e,t),async function(e,t,n,o){const r=await t.languages.typescript.getTypeScriptWorker(),l=await r(e.uri),i=await l.getNavigationTree(e.uri.toString()),a=vr(e,t,o,i).map(e=>{let n=null,o=null;return"formula"===e.type?(n="formula.margin-icon",o="Formula"):"macro"===e.type?(n="macro.margin-icon",o="Macro"):"autoRun"===e.type&&(n="autorun.margin-icon",o="Auto Run"),{range:new t.Range(e.lineNumber,1,e.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:n,glyphMarginHoverMessage:o,stickiness:t.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});D.current&&D.current.clear(),D.current=n.createDecorationsCollection(a)}(e,t,n,l))},[q]),E=t.useCallbackRef(o.CommonUtils.debounce(I,580),[]),F=t.useCallbackRef(async(e=void 0)=>{if(!p.current||!q)return;const t=p.current.editor.getPosition(),n={cursor:t?t.toString():""};void 0!==e&&(n.message=e),m?.(n);const o=T();q.setSelectedFunction(o)},[q,m]);r.useEffect(()=>{if(!q)return;const e={insertSnippet:e=>{p.current?.editor&&(k?fr(p.current.editor,p.current.monaco,e):R.current=e)}};q.setEditor(e),q.setSelectedFunction(T());const t=q.addContainerListener({onBeforeSave:async()=>{if(!p.current?.editor||!q)return;const e=p.current.editor,t=q?.getScripts().getModules().getByName("scripting"),n=t?.getSource(),o=e.getValue();if(!((n?.length??0)!==o.length||n!==o))return;await q.saveSource(e.getValue());const r=(n?.length??0)!==o.length||n!==o;m?.({dirty:r})},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!q)return;const e=p.current.editor,t=q.getScripts().getModules().search()[0]?.getSource()??"";e.setValue(t)}});return()=>{t(),q.setSelectedFunction(null),q.setEditor(null)}},[q,k]),r.useEffect(()=>()=>{if(!p.current?.editor)return;const e=p.current.editor;q?.saveSource(e.getValue())},[]);const A=t.useCallbackRef(e=>{const t=p.current;if(!t)return!1;const n=t.editor;return!!n&&(n.focus(),!0)},[]),D=r.useRef(null),z=t.useCallbackRef((e,t)=>{p.current={monaco:t,editor:e},M(!0),F("Loading Types");const n=q.getScripts().getModules().search()[0]?.getSource()??"";e.setValue(n),Promise.resolve().then(()=>require("./DNsl3Zc49ltOZBkT.cjs")).then(e=>e.customEditor).then(n=>{F("");n.AutoTypings.create(e,{shareCache:!0,monaco:t,onError:e=>{"Not implemented yet"===e&&(e="Compile Errors"),console.warn("Error compiling types",e)}}).then(async n=>{const o=e.getModel();E(o,t,e)})}),e.addCommand("executeScript",function(e,...t){t?.[0]&&S({functionName:t?.[0]})},""),e.addAction({id:"executeScript",label:"Execute",keybindings:[t.KeyCode.F8],run:async e=>{const t=T();q.setSelectedFunction(t);const n=await t;S(n)}}),e.addAction({id:"saveScript",label:"Save Script",keybindings:[t.KeyMod.CtrlCmd|t.KeyCode.KeyS],run:t=>{q?.saveSource(e.getValue()).then(()=>{const t=q?.getScripts().getModules().getByName("scripting"),n=t?.getSource(),o=e.getValue(),r=(n?.length??0)!==o.length||n!==o;m?.({dirty:r})})}}),e.onMouseDown(async n=>{if(n.target.type===t.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const r=n.target.position.lineNumber,l=await t.languages.typescript.getTypeScriptWorker(),i=await l(o.uri),a=await i.getNavigationTree(o.uri.toString()),s=e?.getValue(),d=(await(q?.saveSource(s))).getFunctions().search(),c=vr(o,t,d,a).find(e=>e.lineNumber===r);if(c){const e=n.event.browserEvent.button;0===e?"macro"===c.type||"autoRun"===c.type?S({functionName:c.name}):"formula"===c.type&&q.quickInsertFunction?.(c.name):2===e&&(console.log("Context menu for function:",c.name),n.event.browserEvent.preventDefault())}}}),e.onDidChangeModelContent(()=>{const n=e.getModel();E(n,t,e)});const o=e.getModel();!function(e,t){t.languages.registerInlayHintsProvider("typescript",{provideInlayHints(e,n,o){const r=[];for(let n=1;n<e.getLineCount()+1;n++){const o={startLineNumber:n,startColumn:1,endLineNumber:n,endColumn:e.getLineLength(n)+1},l="hint",i=e.getValueInRange(o).indexOf("hint");-1!==i&&r.push({kind:t.languages.InlayHintKind.Type,position:{lineNumber:o.startLineNumber,column:i+l.length+1},label:"[hint]"})}return{hints:r,dispose:()=>{}}}})}(0,t),o.onDidChangeContent(t=>{const n=q?.getScripts().getModules().getByName("scripting"),o=n?.getSource(),r=e.getValue(),l=(o?.length??0)!==r.length||o!==r;m?.({dirty:l})}),e.onDidChangeCursorPosition(e=>{F()})},[q,m]),N=r.useMemo(()=>k?null:g||n.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[k,g]),L=r.useMemo(()=>{const e=q?.getScripts().getModules().getByName("scripting")?.getSource()??"";return n.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[n.jsx(r.Suspense,{children:n.jsx(hr,{theme:u?"extended-dark":"extended",options:{...mr,fixedOverflowWidgets:!0,readOnly:d},language:"typescript",value:e,onValidate:e=>{let t=!1;for(let n=0;!t&&n<e?.length;n++)8===e[n].severity&&(t=!0)},beforeMount:e=>{e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),e.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),e.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}});(async()=>{let t=!1;try{const n=await(async()=>{const e=await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts");return await e.text()})(),o=e.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),r=e.editor.createModel(n,"typescript",o);e.editor.setModelMarkers(r,"default",[]),t=!0}catch(e){console.warn("cant load types",e)}e.languages.registerLinkProvider("*",{provideLinks:(t,n)=>{const o=[],r={links:o},l=t.getLinesContent();for(let n=1;n<=l.length;n++){const r=l[n-1],i=e.editor.tokenize(r,"typescript");for(let l=0;l<i[0].length;l++){const a=i[0]?.[l];if(a&&a.type.startsWith("string")){let s=a.offset,d=i[0]?.[l+1]?.offset??r.length,c=new e.Range(n,s+1,n,d+1),u=t.getValueInRange(c);const g=u[0];"`"!==g&&"'"!==g&&'"'!==g||(s++,u=u.substring(1));const h=u[u.length-1];"`"!==h&&"'"!==h&&'"'!==h||(s++,u=u.substring(0,u.length-1));try{q.getRanges(u)&&o.push({range:{endColumn:d,endLineNumber:n,startColumn:s,startLineNumber:n},tooltip:`Goto range '${u}'`,url:`/range/${u}`})}catch(e){console.warn(e)}}}}return r}}),e.editor.registerLinkOpener({open(e){if(e?.path?.startsWith("/range/")){try{q.getRanges(e.path.substring(7))?.select()}catch(e){console.warn("invalid range",e)}return!0}return!1}});const n=e.languages.typescript.typescriptDefaults.getCompilerOptions();e.languages.typescript.typescriptDefaults.setCompilerOptions({...n,target:e.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),R.current&&(await fr(p.current.editor,p.current.monaco,R.current),R.current=null),C.current&&requestAnimationFrame(async()=>{C.current&&e.editor.focus()}),e.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),M(!0)})()},onMount:z})}),N]})},[q,y,d,N,u]),O=t.useImperativeElement(l,()=>({isScriptEditorElement:()=>!0,focus:e=>{A(e)},close:()=>{v?.()},getEditor:()=>q?.getEditor()}),[q]);return r.useEffect(()=>(h&&requestAnimationFrame(()=>{A()}),()=>{p.current?.editor&&requestAnimationFrame(()=>{O.current?.contains(document.activeElement)&&A()})}),[]),n.jsx("div",{className:V("script-editor",gr,i),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...a},ref:O,...f,children:L})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>e.LicenseManager}),exports.ChartAreaIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),n.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),n.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),n.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),n.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),n.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),n.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),n.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),n.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),n.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),n.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),n.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),n.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),n.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),n.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),n.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),n.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),n.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),n.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),n.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),n.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),n.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),n.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),n.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),n.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),n.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),n.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),n.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),n.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),n.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),n.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),n.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=Je,exports.ChartLineIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z"}),n.jsx("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z"})]}),exports.ChartLineMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z"}),n.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z"}),n.jsx("path",{className:"styled info",d:"M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z"})]}),exports.ChartLineStackedIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),n.jsx("path",{className:"styled info",d:"M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),n.jsx("path",{className:"styled info",d:"M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z"})]}),exports.ChartLineStackedPercentIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),n.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),n.jsx("path",{className:"styled info",d:"M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z"})]}),exports.ChartPieDoughnutIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z"}),n.jsx("path",{className:"styled background",d:"M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z"}),n.jsx("path",{className:"styled current_color",d:"M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z"}),n.jsx("path",{className:"styled info_light",d:"M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z"})]}),exports.ChartPieIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z"}),n.jsx("path",{className:"styled background",d:"M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z"}),n.jsx("path",{className:"styled current_color",d:"M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z"}),n.jsx("path",{className:"styled info_light",d:"M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z"}),n.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z"})]}),exports.ChartScatterLinesIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z"}),n.jsx("path",{className:"styled info",d:"M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z"}),n.jsx("path",{className:"styled current_color",d:"M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartScatterLinesMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z"}),n.jsx("path",{className:"styled background",d:"M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z"}),n.jsx("path",{className:"styled info",d:"M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z"}),n.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z"}),n.jsx("path",{className:"styled background",d:"M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z"}),n.jsx("path",{className:"styled info",d:"M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z"}),n.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z"})]}),exports.ChartScatterLinesSmoothIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z"}),n.jsx("path",{className:"styled info",d:"M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z"})]}),exports.ChartScatterMarkersIcon=e=>n.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[n.jsx("path",{className:"styled high_contrast",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"}),n.jsx("path",{className:"styled background",d:"M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z"}),n.jsx("path",{className:"styled info",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z"}),n.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"})]}),exports.CommandContext=Ze,exports.CornerTriangle=g,exports.DateUtils=s,exports.DocThemesContext=ur,exports.DocThemesProvider=e=>{const{themes:t,children:o}=e;return n.jsx(ur.Provider,{value:t,children:o})},exports.EditableLabel=tt,exports.EmptyFrame=Ne,exports.FilterButton=h,exports.FontUtils=u,exports.Item=er,exports.LogoNoPaddingIcon=e=>n.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[n.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),n.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),n.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),n.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=U,exports.MovableArea=Fe,exports.PictureEditor=Ye,exports.Row=nr,exports.ScriptEditor=wr,exports.SheetCellEditor=C,exports.SheetCellRenderer=m,exports.SheetElement=_e,exports.SheetScrollbar=ie,exports.StaticBorderRenderer=j,exports.StyledStrokePath=w,exports.Tab=Jo,exports.TabStrip=cr,exports.createCellEditStateFromCell=b,exports.useBordersOverlay=A,exports.useDocThemes=()=>{const t=r.useContext(ur),[n]=r.useState(()=>new e.ThemeCollection);return r.useMemo(()=>t||n,[t])},exports.useModelListener=W,exports.useMovableCommands=ze,exports.useRangeListener=(e,t,n,o)=>{const l=r.useRef(n);l.current=n;const i=o?.fireOnAddressChange??!0;r.useEffect(()=>{if(!e||!t||!l.current){const e={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void l.current?.(e)}const n=e=>{l.current?.(e)},r=e.getRange(t).addListener(n,o);if(i){const o=e.getRange(t);n({getSource:()=>o,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{r?.()}},[e,t])},exports.useSheetCommands=G,exports.useSheetCopyPaste=ve,Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|