@sheetxl/react 0.6.5 → 0.6.7

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.
@@ -1,33 +1,33 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6{pointer-events:none}._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6 *{pointer-events:initial}._sheetxl-sheet_1qeq6_5 .cell-container>*{overflow:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .text-box{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1qeq6_5 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1qeq6_5 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1qeq6_5 .cell-container .fill{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .pending{width:6px;height:6px;top:5px;left:4px;position:absolute;border:var(--sxl-app-color-primary-dark, grey) .5px;border-style:double;border-radius:50%;background-color:var(--sxl-app-color-button-surface, grey);opacity:1;animation:_pulse_1qeq6_1 1.5s infinite alternate}@keyframes _pulse_1qeq6_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1qeq6_5 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1qeq6_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .line{position:absolute;opacity:.3;background:var(--sxl-app-color-primary-light, rgb(173, 173, 173)) .5px;width:100%;height:2px}._sheetxl-sheet_1qeq6_5 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1qeq6_5 .cell-container .inc{animation-delay:0s;animation:_increase_1qeq6_1 3s infinite}@keyframes _fadeIn_1qeq6_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1qeq6_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._sheet-selection_12wyx_5 .fill-handle .dragging,._movable-area_314c6_5 .moveable-control-box .dragging{opacity:0}._movable-area_314c6_5 .moveable-control-box .moveable-control{width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px;background-color:var(--sxl-app-color-background, white);background-image:var(--sxl-app-image-background);border:2px solid var(--sxl-app-color-primary-dark, grey)}._movable-area_314c6_5 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_314c6_5 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_1bqx6_6{position:absolute;left:0;top:0;width:100%;min-height:calc(100% + 1px);border:none;padding:0;outline:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.2;letter-spacing:inherit;text-transform:inherit;background:transparent}@keyframes _pop_1wyun_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_1wyun_33{0%{opacity:0}to{opacity:1}}._Wrapper_1wyun_25{display:flex;box-sizing:border-box;transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));transform-origin:0 0;touch-action:manipulation}._Wrapper_1wyun_25._dragOverlay_1wyun_37{z-index:999}._Item_1wyun_47{position:relative;display:flex;align-items:center;outline:none;box-sizing:border-box;transform-origin:50% 50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale, 1))}._Item_1wyun_47:not(._withHandle_1wyun_61){touch-action:manipulation}._Item_1wyun_47._dragging_1wyun_66:not(._dragOverlay_1wyun_37){z-index:999}._Item_1wyun_47._dragOverlay_1wyun_37{cursor:inherit;animation:_pop_1wyun_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_1kr10_1{display:flex;box-sizing:border-box}._TabStrip_3x0dp_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_3x0dp_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_iy654_5 .monaco-editor{position:absolute}._script-editor_iy654_5 .monaco-editor .margin-icon{display:block;width:16px;height:16px;background-size:16px;background-repeat:no-repeat;background-position:center;background-size:contain}._script-editor_iy654_5 .monaco-editor .formula{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="m 12.106007,8.1692949 c 0.124174,-0.1578352 0.181773,-0.3565642 0.283755,-0.5271169 0.10273,-0.1715492 0.04413,-0.2027176 -0.129161,-0.2014713 -0.685452,0.00576 -1.371152,-0.00277 -2.056604,0.00501 C 10.021228,7.4479573 9.9586414,7.407817 9.9935503,7.2080883 10.145401,6.3413623 10.291269,5.4736396 10.51219,4.6213758 10.642847,4.1167002 10.782479,3.6117747 11.061498,3.1622046 11.339518,2.7138809 11.726751,2.5974365 12.2035,2.829328 c 0.398455,0.1934923 0.722604,0.4827333 0.990152,0.8340617 0.116944,0.1535968 0.27079,0.2740306 0.449073,0.1715499 0.343348,-0.1974819 0.644807,-0.4383502 0.819599,-0.826332 0.100985,-0.2244112 0.157836,-0.476001 0.04039,-0.7058977 C 14.339646,1.9840253 14.038187,1.7618584 13.707056,1.6394296 13.156999,1.4362128 12.562559,1.4840872 12.017239,1.6758341 11.38789,1.8970037 10.783727,2.2625445 10.259602,2.6724688 10.066109,2.8238217 9.8783519,2.9839017 9.7013165,3.1547035 9.0502751,3.7823067 8.5657962,4.529097 8.2246919,5.3651534 7.9823276,5.9595939 7.7888351,6.5660026 7.6913412,7.2015842 7.673637,7.318528 7.6357391,7.423253 7.5065759,7.4432009 7.3472438,7.4678879 7.1592376,7.4436995 6.9974121,7.4441728 6.6351128,7.4451447 6.2598478,7.3676233 5.9915515,7.6815496 5.8721151,7.8211835 5.7461952,7.9840062 5.6439635,8.1371045 c -0.1009847,0.1518511 -0.093255,0.3002122 0.085027,0.367535 0.1957362,0.073561 0.4528118,0.026182 0.6530361,0.0197 0.2645558,-0.00847 0.5291116,0.00501 0.7936674,-7.476e-4 0.1820229,-0.00374 0.2413669,0.030421 0.2064588,0.2358807 C 7.3487406,8.9587006 7.3095941,9.1492003 7.2804197,9.3464333 7.1804317,10.024404 7.0667304,10.700629 6.9525298,11.376606 6.7936963,12.314146 6.6371075,13.252434 6.4655575,14.188478 6.3017374,15.082631 6.1855427,15.985013 5.983074,16.873433 5.8249883,17.568607 5.7240037,18.277248 5.5556954,18.969682 5.4145655,19.550158 5.293882,20.143601 4.9722259,20.665731 4.7380909,21.045734 4.3959882,21.206312 3.9663652,21.104829 3.5778849,21.012322 3.2115961,20.866205 2.8951763,20.608631 2.6862246,20.438328 2.4473513,20.31141 2.1920214,20.458026 1.9519014,20.595915 1.7791048,20.851743 1.646453,21.088123 1.2205704,21.847879 1.915497,22.569984 2.6655289,22.684434 3.1692071,22.760986 3.666153,22.580208 4.1087416,22.356046 4.6996913,22.056582 5.2103511,21.635437 5.6387269,21.13874 5.9898058,20.731558 6.3575906,20.343327 6.6500737,19.890016 6.8450616,19.58756 7.0238427,19.274881 7.1866655,18.954471 7.7639005,17.817206 8.1227091,16.589926 8.4189318,15.354418 8.5613081,14.760227 8.716401,14.169777 8.8478064,13.572843 9.0268365,12.760724 9.1741996,11.934891 9.3083481,11.114294 9.3749255,10.707112 9.4310263,10.300679 9.5160532,9.8967389 9.5861222,9.5636133 9.6442168,9.2185186 9.6890985,8.8814035 9.7414633,8.4891827 9.990308,8.5136187 10.329668,8.4762164 c 0.286249,-0.03167 0.574492,-0.046376 0.861739,-0.067571 0.230395,-0.016703 0.494951,0.00396 0.711881,-0.088019 0.07754,-0.032911 0.147613,-0.080788 0.202719,-0.1513533 z"/><path d="M 22.473802,7.8481382 C 22.426924,7.6912996 22.341898,7.5501696 22.231437,7.4294861 22.130452,7.3192756 21.987827,7.1749046 21.851933,7.1098255 21.411589,6.8988785 20.817398,7.0838898 20.436149,7.3422154 20.23343,7.479854 20.052405,7.6519026 19.871131,7.8167201 19.691352,7.9802913 19.517061,8.1488492 19.35723,8.3321177 19.025101,8.7128687 18.724639,9.1210479 18.436396,9.5354601 18.296263,9.7374301 17.901549,10.472252 17.781115,10.399942 17.654198,10.323892 17.495365,9.5905657 17.435023,9.3843566 17.351243,9.0978583 17.29539,8.8016361 17.161741,8.5323425 16.97922,8.1643081 16.865268,7.7623629 16.608941,7.4307332 16.325934,7.0639457 16.001036,6.9584722 15.558946,7.092371 c -0.43436,0.1314054 -0.78469,0.4049374 -1.128539,0.6819608 -0.503927,0.4056851 -0.879442,0.926319 -1.256951,1.4439609 -0.28226,0.387483 -0.284753,0.3857373 0.04488,0.7380631 0.206458,0.2211702 0.202718,0.2184272 0.389229,-0.00847 0.2663,-0.3251469 0.524872,-0.6595196 0.882433,-0.8934057 0.261315,-0.1713009 0.417904,-0.1368908 0.57948,0.1326518 0.07929,0.1326517 0.146866,0.2752777 0.200225,0.4208957 0.335619,0.9141014 0.590201,1.8541344 0.89191,2.7784594 0.03815,0.117691 -0.01122,0.193991 -0.06707,0.278519 -0.356565,0.538837 -0.719363,1.074182 -1.123054,1.578607 -0.320409,0.401198 -0.643312,0.803891 -1.073932,1.097621 -0.187757,0.128912 -0.40768,0.217679 -0.635831,0.156839 -0.233887,-0.06283 -0.37377,-0.27478 -0.587459,-0.373521 -0.006,-0.003 -0.01272,-0.0052 -0.01895,-0.0079 -0.09974,-0.04064 -0.249845,-0.0389 -0.353074,-0.01571 -0.454059,0.102482 -0.697669,0.614139 -0.790177,1.023813 -0.08379,0.371776 -0.0013,0.778209 0.261315,1.062463 0.228899,0.24785 0.572248,0.351327 0.901634,0.356315 0.189003,0.0028 0.39995,-0.04663 0.57549,-0.11445 0.670241,-0.262062 1.181649,-0.887172 1.605038,-1.441717 0.285501,-0.374517 0.550555,-0.763994 0.829573,-1.143499 0.230645,-0.313677 0.68595,-1.247726 0.81586,-1.250718 0.07854,-0.0017 0.09924,0.185762 0.114199,0.241117 0.03341,0.123675 0.06658,0.247351 0.102232,0.370279 0.167561,0.578481 0.343848,1.156464 0.525122,1.730458 0.120934,0.384242 0.315921,0.782697 0.560779,1.103356 0.07431,0.09749 0.167311,0.190749 0.26306,0.266799 0.371276,0.296972 0.838799,0.27453 1.266177,0.123177 0.191498,-0.06757 0.370029,-0.163071 0.539335,-0.275527 0.781948,-0.519886 1.340732,-1.244235 1.868598,-2.002495 0.124423,-0.178781 0.107467,-0.278769 -0.03441,-0.428127 -0.367286,-0.386237 -0.357062,-0.389727 -0.705149,0.01995 -0.261066,0.306446 -0.527117,0.612643 -0.879442,0.818851 -0.245855,0.144621 -0.413416,0.103229 -0.592696,-0.118439 -0.14861,-0.183518 -0.246353,-0.396709 -0.33138,-0.614886 -0.349831,-0.901136 -0.588954,-1.838675 -0.885177,-2.757515 -0.21743,-0.674231 -0.223414,-0.680464 0.20945,-1.248723 0.447575,-0.587708 0.875703,-1.1968602 1.462163,-1.6613914 0.431119,-0.3416031 0.73183,-0.3226534 1.129037,0.059094 0.0788,0.075801 0.207456,0.1388856 0.316919,0.1476127 0.369781,0.029674 0.691187,-0.3024566 0.880939,-0.5792304 0.188006,-0.2727835 0.259319,-0.6183768 0.163072,-0.9392845 z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .macro{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M 5.1933594,1.4433594 6.3417969,2.5234375 6.2109375,2.6621094 c -3.466072,3.6769426 -3.467641,9.6565186 0,13.3339846 l 0.1308594,0.136718 -1.1484375,1.082032 -0.1328125,-0.140625 c -4.0371886,-4.28224 -4.0373752,-11.2077961 0,-15.4902346 z m 14.4726566,0 0.132812,0.140625 c 4.03717,4.2822197 4.037356,11.2058636 0,15.4882816 l -0.132812,0.140625 -1.148438,-1.080079 0.130859,-0.138671 c 3.465532,-3.675243 3.466902,-9.6542123 0,-13.3320316 L 18.517578,2.5234375 Z M 7.7597656,4.4335937 8.8769531,5.5488281 8.7421875,5.6816406 c -2.0366665,2.0366662 -2.037411,5.3404354 0,7.3769534 L 8.8769531,13.191406 7.7597656,14.310547 7.625,14.173828 C 4.9718615,11.520692 4.9723209,7.222936 7.6269531,4.5683594 Z m 9.3398434,0 0.132813,0.1347657 c 2.653779,2.6537788 2.65545,6.9500666 0,9.6054686 l -0.132813,0.136719 -1.117187,-1.119141 0.134765,-0.132812 c 2.036637,-2.035554 2.037534,-5.3391996 0,-7.3769534 L 15.982422,5.5488281 Z m -4.669921,1.7011719 c 0.811773,0 1.627703,0.304374 2.25,0.90625 1.260638,1.2198223 1.260413,3.1986104 0,4.4179684 -0.355144,0.343115 -0.779063,0.585007 -1.226563,0.732422 l -0.234375,0.07617 v 3.386719 h 0.002 v 6.048828 c 0,0.436615 -0.351565,0.791016 -0.789062,0.791016 -0.43763,0 -0.791016,-0.354618 -0.791016,-0.791016 v -3.308594 -6.126953 l -0.234375,-0.07617 c -0.448339,-0.147699 -0.871819,-0.38969 -1.226562,-0.732422 -1.2608671,-1.22004 -1.2605877,-3.1984433 0,-4.4179684 0.62227,-0.6019293 1.438264,-0.90625 2.25,-0.90625 z m 0,1.5820313 c -0.417461,0 -0.829931,0.1510762 -1.146485,0.4570312 -0.615751,0.5967629 -0.616877,1.5583713 0,2.1562499 0.314469,0.303373 0.726552,0.455078 1.146485,0.455078 0.421182,0 0.833304,-0.153008 1.148437,-0.457031 0.61548,-0.5965047 0.616739,-1.5585025 0,-2.15625 C 13.261859,7.8661993 12.846121,7.7167969 12.429688,7.7167969 Z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .autorun{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M10 15h5.88c.27-.31.67-.5 1.12-.5.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5c-.44 0-.84-.19-1.12-.5H11.9c-.46 2.28-2.48 4-4.9 4-2.76 0-5-2.24-5-5 0-2.42 1.72-4.44 4-4.9v2.07c-1.16.41-2 1.53-2 2.83 0 1.65 1.35 3 3 3s3-1.35 3-3zm2.5-11c1.65 0 3 1.35 3 3h2c0-2.76-2.24-5-5-5s-5 2.24-5 5c0 1.43.6 2.71 1.55 3.62l-2.35 3.9c-.68.14-1.2.75-1.2 1.48 0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5c0-.16-.02-.31-.07-.45l3.38-5.63C10.49 9.61 9.5 8.42 9.5 7c0-1.65 1.35-3 3-3m4.5 9c-.64 0-1.23.2-1.72.54l-3.05-5.07C11.53 8.35 11 7.74 11 7c0-.83.67-1.5 1.5-1.5S14 6.17 14 7c0 .15-.02.29-.06.43l2.19 3.65c.28-.05.57-.08.87-.08 2.76 0 5 2.24 5 5s-2.24 5-5 5c-1.85 0-3.47-1.01-4.33-2.5h2.67c.48.32 1.05.5 1.66.5 1.65 0 3-1.35 3-3s-1.35-3-3-3"/></svg>');cursor:pointer}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  "use strict";/**
3
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.5
3
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.6.7
4
4
  *
5
5
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
6
  * License: The license can be found at https://www.sheetxl.com/license.
7
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),c=require("react/jsx-runtime"),ue=require("@sheetxl/utils"),o=require("react"),dt=require("@sheetxl/grid-react"),Nt=require("react-dom"),fn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),Cl=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:fn},Symbol.toStringTag,{value:"Module"})),pr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),uo=(e,t=!0,n=pr)=>{if(!n||n.length===0)return e;if(e===void 0)return n[0];if(t&&e>=n[n.length-1]||!t&&e<=n[0])return e;let i=ue.CommonUtils.findEqualOrGreater(n,e);return t?(n[i]===e&&(i+=1),n[i]||(i-=1),n[i]):(i-=1,n[i])},bl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:pr,findNextFontSize:uo},Symbol.toStringTag,{value:"Module"})),go=o.memo(e=>{const{anchorLocation:t=ue.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:d,fill:m,pathProps:p,style:g,...x}=e,h=a,f=l;let T="red",q=[],A=[];return t===ue.AnchorLocation.TopLeft?(T=d?"rgb(255, 198, 246)":"green",q.push(f),A.push(f),q.push(f+h),A.push(f),q.push(f),A.push(f+h)):t===ue.AnchorLocation.TopRight?(T=d?"rgb(0, 255, 255)":"red",q.push(n-f),A.push(f),q.push(n-(f+h)),A.push(f),q.push(n-f),A.push(f+h)):t===ue.AnchorLocation.BottomRight?(T=d?"rgb(236, 252, 211)":"purple",q.push(n-f),A.push(i-f),q.push(n-(f+h)),A.push(i-f),q.push(n-f),A.push(i-(f+h))):t===ue.AnchorLocation.BottomLeft&&(T=d?"rgb(255, 236, 183)":"blue",q.push(f),A.push(i-f),q.push(f+h),A.push(i-f),q.push(f),A.push(i-(f+h))),c.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...g},...x,children:c.jsx("path",{d:`M ${q[0]} ${A[0]} L ${q[1]} ${A[1]} L ${q[2]} ${A[2]} L ${q[0]} ${A[0]} Z`,fill:m??T,...p})})}),vr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:d,style:m,...p}=e,g=o.useMemo(()=>{let T=null;const q=l.getSortField();q&&(T=q.reverse);const A=l.getField(),D=A&&A.criteria&&A.criteria.length>0;return T===!0?D?"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":T===!1?D?"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":D?"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 7.4533523,10.606423 2.2001838,4.9460198 2.966932,4.1188401 7.4533523,8.9589099 11.933438,4.1188401 12.700184,4.9460198"},[l]),[x,h]=o.useState(!1),f=Math.min(Math.min(18,t.height-8),t.width);return c.jsx("div",{style:{width:`${f}px`,height:`${f}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${x&&!a?"--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:(f>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...m},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onMouseDown:T=>{d?.(T,l),T.preventDefault()},...p,children:c.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${x&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:c.jsx("path",{d:g})})})},Cr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:d,zoom:m=1,view:p,bodyStyle:g,normalStyle:x,showFormulas:h,showZeros:f,docTheme:T,onLinkMouseDown:q,onFilterButtonMouseDown:A,filterButtonProps:D,createFilterButton:G=vr,...U}=e,y=i.height/m,B=i.width/m,S=t,w=S.getValue(),k=t.getStyle(),O=g?.darkMode??!1;let E,F;const Z=w&&w.isFormulaError,_=Z&&w instanceof s.FormulaError.Parse;let P,V=h||_;if(V)if(S.isSpillOverflow())F="";else{const Ae=S.getFormulaText();Ae?F=Ae:E=S.getNumberFormat(s.NumberFormat.Type.General)}else E=S.getNumberFormat();V||(P=S.getTextOverflow());const $=P?P.colBounds.width+P.leftOffset+P.rightOffset:B,oe=P?P.anchorBounds.x-P.leftOffset:0,L=P?P.anchorBounds.width:B,z=P?P.anchorBounds.x:0;let K,W=S.getRenderHorizontalAlignment();E&&(K=E?.formattedRuns,F=K?.runs[0]?.text??E.displayText);const ge=S.getCalcStatus()===s.ICell.CalcStatus.Pending;let ae=null,Q=k.getFill().toCSS(O,i),X=0,be=0;if(!k.getBorder().isEmpty()){const Ae=k.getBorder().getRight();!Ae.isNone()&&s.IBorder.BuiltInDefinitions.get(Ae.getStyle()).width>1&&(X=1);const R=k.getBorder().getBottom();!R.isNone()&&s.IBorder.BuiltInDefinitions.get(R.getStyle()).width>1&&(be=1)}let ke=null;if(B!==L||X||be||typeof Q?.backgroundPosition=="number"){const{backgroundPosition:Ae,...R}=Q,re=Ae??0,j=p?.getScrollTopLeft(),J=re?-(i.x+(j.left??0))%re:0,u=re?-(i.y+(j.top??0))%re:0;(Ae!==void 0||X||be||B!==L)&&(Object.keys(R).length===1&&R.background==="none"||(Q=null,ke=c.jsx("div",{className:"fill",style:{marginLeft:`${J}px`,marginTop:`${u}px`,left:z*m,width:r.ReactUtils.boundPixel(L*m-J+1+X),height:r.ReactUtils.boundPixel(i.height-u+1+be),...R}},"background")))}let ve=null;const Pe=S.getComments(),he=S.getWarnings(),He=S.getErrors();if(Pe||Z||He.length>0||he.length>0){const Ae={size:7*m,darkMode:O,cellWidth:L*m+2,cellHeight:y*m+2,style:{top:-1,left:z*m-1}};ve=ve??[],(he.length>0||He.length>0||Z)&&ve.push(c.jsx(go,{anchorLocation:ue.AnchorLocation.TopLeft,...Ae},`indicator-${ve.length}`)),Pe&&ve.push(c.jsx(go,{anchorLocation:ue.AnchorLocation.TopRight,...Ae},`indicator-${ve.length}`))}const Se=k.getFont();let ce=E?.conditionalColor;const de=k.getAlignment(),me=de.getHorizontal()===s.ITextFrame.HorizontalAlignment.Fill,Ce=de.getHorizontal()===s.ITextFrame.HorizontalAlignment.CenterContinuous||me,xe=Ce||V?0:de.getRotation(),Me=S.getInsets(),we=Me.top+Me.bottom;let Ee=Me.left,Le=Me.right;const Ve={...l,left:l.left-1,top:l.top-1,width:l.width+1+X,height:l.height+1+be},C=S.getColumnFilter(),Ue=C&&!C?.hasHiddenButton();let Qe=null;ge&&(Qe=c.jsxs("div",{className:"slider",children:[c.jsx("div",{className:"line"}),c.jsx("div",{className:"subline inc"})]},"pending"));const $e=!(ge||Ue||ke||a||ve||K?.runs.length>1||P||xe%360!=0);Q?.background==="none"&&(Q=null);let ee=Ce||!(!P||!(P.rightIndex>0||P.leftIndex>0||P.colSpan>1));if(!ee){const Ae=S.getSpans();(Ae.width>1||Ae.height>1)&&(ee=!0)}const Fe={...Q,...Ve,pointerEvents:q?"auto":void 0};if(!ue.CommonUtils.isEmpty(F)||!ue.CommonUtils.isEmpty(E?.repeatPlaceholder)){const Ae=E?.canWrap??!1;let R=null,re=null,j=null,J=[],u=!0;f||V||w!==0||(u=!1);const M=S.getTextFrame(V);if(u&&M){let I=$-1-(Ee+Le);if(xe){R=M.layout().bounds;const ye={x:0,y:0,width:$-1,height:y};if(K){let fe=K.width;if(E.repeatPlaceholder||E.repeatChars.length>0){const pe=s.GeomUtils.boundsToPoints(ye),qe=s.GeomUtils.rotatePoints(pe,-xe);fe=s.GeomUtils.minBoundingRect(qe).width}R={...R,width:fe}}j=s.GeomUtils.clipToOuterRect({...R,width:R.width+1+Ee+Le},ye,xe),I=j.width-1-(Ee+Le)+.01}let b=null;Ae&&(b={width:I});let N=null,v=E?.repeatPlaceholder;const H=M.layout(b);if(R=H.bounds,V?R={...R,width:0}:K&&(R={...R,width:E.repeatPlaceholder||E.repeatChars.length>0?I:K.width}),xe&&Ae){let se=null;H.visitLines({visitTextLine:(ye,fe)=>{let pe=ye.bounds;const qe=s.GeomUtils.boundsToPoints(pe),Oe=s.GeomUtils.rotatePoints(qe,xe),De=s.GeomUtils.minBoundingRect(Oe);pe={...pe,x:(De.width-pe.width)/2,y:(De.height-pe.height)/2},se=se?s.GeomUtils.unionBounds(se,pe):pe}}),R={...se,width:se.width+Ee+Le}}if(!v&&S.getType()!==s.ScalarType.String&&Math.floor(R.width)>I){if(k.getNumberFormat()==="General"&&S.getType()===s.ScalarType.Number){const se=k.measureText("0"),ye=Math.floor(I/se.width),fe=w,pe=ue.CommonUtils.splitNumber(fe),qe=Math.min(10,ye-(Math.max(1,pe.ipLength)+1)-(fe<0?1:0));if(qe>=-1){const Oe=`0${qe>0?".":""}${"#".repeat(Math.max(0,qe))}`;N=S.getNumberFormat(Oe).displayText,N==="0"&&fe<0&&(N="-0")}else if(Math.abs(fe)>=Math.pow(10,5)||Math.abs(fe)<=Math.pow(10,-5)){const Oe=ye-5-(fe<0?1:0);if(Oe>=0){const De=`0.${"0".repeat(Math.max(0,Oe-1))}E+00`;N=S.getNumberFormat(De).displayText}}}N||(v="#")}if(!v&&K?.lastRepeatIndex>=0&&K?.width>I&&(v="#"),v&&I>0){const se=k.measureText(v),ye=Math.floor((I||1)/(se?.width||1));N=ye>0?v.repeat(ye):""}if(V&&(W=s.ITextFrame.HorizontalAlignment.Left),N){const se=k.measureText(N).width;se&&(R={...R,width:se})}if(re={...R,width:R.width+Ee+Le,height:R.height},xe&&!Ae){const se=s.GeomUtils.boundsToPoints(re),ye=s.GeomUtils.rotatePoints(se,xe),fe=s.GeomUtils.minBoundingRect(ye);re.width=fe.width,re.height=fe.height}W===s.ITextFrame.HorizontalAlignment.Center||W===s.ITextFrame.HorizontalAlignment.CenterContinuous?re.x=($-re.width)/2:W===s.ITextFrame.HorizontalAlignment.Right?re.x=$-re.width-.5:re.x=.5,de.getVertical()===s.ITextFrame.VerticalAlignment.Center?re.y=(y-re.height)/2:de.getVertical()===s.ITextFrame.VerticalAlignment.Bottom?re.y=y-re.height-we:re.y=we;const Y=$e?{...U}:void 0,ne={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:xe?`rotate(${xe}deg)`:void 0,cursor:q?"pointer":void 0,pointerEvents:q?"auto":void 0,zIndex:ee?1:void 0,...Q},onMouseDown:q,onDoubleClick:q?se=>{se.stopPropagation(),se.preventDefault()}:null,...Y};_&&(ne.style.textDecorationStyle="wavy",ne.style.textDecorationColor=O?"rgb(0, 255, 255)":"red",ne.style.textDecorationLine="underline");const le=Se.getSize(),ie=(se,ye,fe,pe,qe,Oe,De,We=null)=>{let je=le*m,Ge=fe,Ne=De?.runs?De.runs:[{type:s.NumberFormat.ParseRunType.Text,text:se,width:k.measureText(se,je).width}];De&&De?.width!==R.width&&(R={...R,width:De?.width});let Xe=Ee;if(De?.lastRepeatIndex>=0&&I>De?.width){const _e=De.runs[De.lastRepeatIndex];if(_e){const rt=[...Ne],vt=Math.max(0,I-1-De.width);let yt=0,Ct="";if(vt>0){const gt=Math.floor(vt/_e.width);Ct=gt>0?_e.text.repeat(gt):"",yt=vt}rt[De.lastRepeatIndex]={type:s.NumberFormat.ParseRunType.Repeat,text:Ct,width:yt},Ne=rt,R={...R,width:De.width+yt}}}const it=(_e,rt,vt,yt,Ct,gt,lt,It,jt,Jt=null)=>{let Dt,Qt=Ge.width;qe===s.ITextFrame.HorizontalAlignment.Justify?(Qt=Ct,Oe||(Dt="justify")):qe===s.ITextFrame.HorizontalAlignment.Distributed&&(Qt=Ct,Dt=Oe||_e.text.split(" ").length-1==0?"center":"justify");const{style:Tt,className:xn,...bt}=Jt;let Bt=_e.text;if(qe===s.ITextFrame.HorizontalAlignment.Fill&&E?.repeatChars.length===0){const at=Math.max(1,Math.floor((Ge?.width??0)/(lt?.width??1)));Bt=Bt.repeat(at)}let en=Ge.height;const Mt=Se.getVerticalAlignment(),zt=Mt===s.IFont.VerticalAlignment.Sub,qn=Mt===s.IFont.VerticalAlignment.Super;if(zt||qn){const at=Se.getSuperSubScale();je*=at,en*=at}const nt={textAlign:Dt,textAlignLast:Dt,...Tt,...Se.toCSS(O,m,!0),fontSize:je*s.IFont.getDeviceScale()};$e||(nt.background=void 0),ce&&(nt.color=ce.toCSS(O));const Sn=Xe+rt;let Vt=Me.top+Ge.y+0;if(zt&&(Vt+=jt-je),gt){const at=(lt.x+Sn)*m+1,mt=(lt.y+Vt)*m+1;mt<0?nt.marginTop=mt:nt.paddingTop=mt,at<0?(nt.width=(Tt?.width??0)-at,nt.left=(Tt?.left??0)+at):nt.paddingLeft=at,nt.paddingRight=Math.max(0,(Tt?.width??0)-Qt*m-at),nt.paddingBottom=Math.max(0,(Tt?.height??0)-Ge.height*m-mt),nt.height=(Tt?.height??0)+(mt<0?-mt:0),(mt<0||at<0)&&(nt.clipPath=`inset(${mt<0?-mt:0}px 0px 0px ${at<0?1-at:0}px)`)}else if(nt.left=(lt.x+Sn)*m+1,nt.top=(lt.y+Vt)*m+1,nt.width=lt.width*m,nt.height=lt.height*m,xe&&!Ae){nt.left=(lt.x+rt)*m+1,nt.top=(lt.y+(Ge.y+0))*m+1;const at=s.GeomUtils.centerPoint({x:Xe+rt,y:0,width:_e.width,height:Ge.height}),mt=s.GeomUtils.centerPoint({x:Xe,y:0,width:Ct,height:Ge.height}),nn=s.GeomUtils.rotatePoints([at],xe,mt),on={x:nn[0].x-at.x,y:nn[0].y-at.y};nt.left=nt.left+on.x*m,nt.top=nt.top+on.y*m;const Pt={...Ge,x:Xe,y:Me.top,width:Ge.width+(Ee+Le)},Wn=s.GeomUtils.boundsToPoints(Pt),Gn=s.GeomUtils.rotatePoints(Wn,xe),Ht=s.GeomUtils.minBoundingRect(Gn);Pt.width=Ht.width,Pt.height=Ht.height;const Rn=s.GeomUtils.centerPoint(Pt),Ut={x:Rn.x-mt.x,y:Rn.y-mt.y};nt.left=nt.left+Ut.x*m,nt.top=nt.top+Ut.y*m}nt.lineHeight=en*m+"px";const tn=$e?void 0:"text-line";J.push(c.jsx("div",{className:xn?`${xn} ${tn}`:tn,style:nt,...bt,children:Bt},`text-${Ge.y}-${yt}-${vt}`))};if(de.getOverflow()===s.ITextFrame.Overflow.Shrink&&I>0){let _e=R?.width??0,rt=0;for(;_e>1&&_e>I&&je>2&&rt<100;)je*=I/_e,_e=k.measureText(se,je).width,rt++;R={...R,width:_e}}let pt=Ge.x;qe===s.ITextFrame.HorizontalAlignment.Right?pt+=R.width-Ge.width:qe!==s.ITextFrame.HorizontalAlignment.Center&&qe!==s.ITextFrame.HorizontalAlignment.CenterContinuous||(pt+=(R.width-Ge.width)/2),De?.lastRepeatIndex>=0&&(pt=Ge.x);const xt=Ne.length;for(let _e=0;_e<xt;_e++){const rt=Ne[_e];(rt.type===s.NumberFormat.ParseRunType.Text||rt.type===s.NumberFormat.ParseRunType.Repeat)&&(rt.type,s.NumberFormat.ParseRunType.Repeat,it(rt,pt,_e,ye,qe===s.ITextFrame.HorizontalAlignment.Justify||qe===s.ITextFrame.HorizontalAlignment.Distributed||De?.lastRepeatIndex>=0?I:Ge.width,$e,{x:re.x+oe,y:re.y,width:rt.width,height:R.height},0,pe,We)),pt+=rt.width}};N?ie(N,0,{x:0,y:0,...R},H.lines[0].baseline,W,!0,null,ne):H.visitLines({visitTextLine:(se,ye,fe)=>{const pe=se.runs[0].text.replace(/\s+$/,""),qe=ye===fe-1;let Oe=W===s.ITextFrame.HorizontalAlignment.Justify&&(qe||se.runs[0].text.endsWith(`
8
- `))?s.ITextFrame.HorizontalAlignment.Left:W,De=0;ye>0&&(de.getVertical()===s.ITextFrame.VerticalAlignment.Distributed||de.getVertical()===s.ITextFrame.VerticalAlignment.Justify)&&(De=Math.max(0,(y-(we+3)-se.bounds.height*fe)/(fe-1)*ye)),de.getVertical()===s.ITextFrame.VerticalAlignment.Distributed&&xe&&xe%90==0&&xe%180!=0&&(Oe=s.ITextFrame.HorizontalAlignment.Distributed),Oe!==s.ITextFrame.HorizontalAlignment.Justify&&Oe!==s.ITextFrame.HorizontalAlignment.Distributed&&Oe!==s.ITextFrame.HorizontalAlignment.Fill||(R={...R,width:I});let We=me||E&&(E.repeatChars.length>0||E.spacingChars.length>0)?R.width:se.bounds.width;const je={...se.bounds,y:se.bounds.y+De+0,width:We};ie(pe,ye,je,M.lines[0].baseline,Oe,qe,fe===1?K:null,$e&&ye>0?{...ne,style:{...ne.style,background:void 0}}:ne)}})}J.length>0&&(ae=J)}if($e)return ae&&ae.length>0?ae:c.jsx("div",{style:Fe,...U});let Be=q?"auto":Ve.pointerEvents,Ie=null;if(Ue){const Ae={x:z*m-1,y:-1,width:L*m+1,height:y*m+1};Be="auto",Ie=G({renderBounds:Ae,darkMode:O,className:"filter-button",disabled:!S.isEditAllowed(),zoom:m,filter:S.getColumnFilter(),onFilterButtonMouseDown:A,...D}),Ie&&(Ie=c.jsx("div",{style:{...Ae,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:R=>{R.stopPropagation(),R.preventDefault()},children:Ie},"filterButton"))}ge&&!ae&&(ae=c.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 ze=[ke,ae,a,ve,Qe,Ie];return c.jsx("div",{style:{...Q,...Ve,pointerEvents:Be},...U,children:ze})},Fo={text:"",placeholder:""},Ao=(e,t)=>{if(!e.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},wl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),br=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:d,onDoneEdit:m,defaultTextStyle:p,useRichStyling:g=!0,bodyStyle:x,activeCoords:h,sheet:f,commands:T,containerBounds:q,setNaturalDimensions:A,onFocus:D,disabled:G,style:U,zoom:y=1,linesVisible:B,autoFocus:S=!1,...w}=e,{height:k=0,width:O=0}=q??{},E=x?.darkMode??!1,F=o.useRef(null),[Z,_]=o.useState(!1),[P,V]=o.useState(null),[$,oe]=o.useState(()=>n);o.useEffect(()=>{be.current=!1,oe(n)},[n]);const L=o.useMemo(()=>{const R=$.clean();let re=R.getStyle();g||(re=re.createTemporaryStyle({font:{size:p?.fontSize}}));const j=R.getFormula(),J=re.getAlignment(),u=j?s.ITextFrame.HorizontalAlignment.Left:J.getHorizontal(),M=J.getVertical(),I=J.getOverflow()===s.ITextFrame.Overflow.Wrap||R.getType()===s.ScalarType.String&&(u===s.ITextFrame.HorizontalAlignment.Justify||u===s.ITextFrame.HorizontalAlignment.Distributed||M===s.ITextFrame.VerticalAlignment.Justify||M===s.ITextFrame.VerticalAlignment.Distributed),b=(H=>{if(!H)return Fo;const Y=H.clean();if(!Y)return Fo;let ne=Y.getStyle()?.getQuotePrefix();if(H.dirty===void 0||H.dirty===null){let le="",ie=Y.getFormulaText();ie&&(le=ie,ne=!1),le||(le=Y.toTextUnformatted(!0)??"");let se="";if(!H.editMode&&Y.isSpillOverflow()){const ye=Y.getSpill();if(ye){const fe=ye.getCell(),pe=fe.getFormulaText();fe.isEqual(Y)||(se=pe)}}return ne&&(le="'"+le),{text:le,placeholder:se}}return{text:H.dirty??"",placeholder:""}})($),N=b.text,v=s.ITextFrame.toCSSHorizontalTextAlign(g&&!j?$.clean()?.getRenderHorizontalAlignment():s.ITextFrame.HorizontalAlignment.Left);return{style:re,isWrapped:I,textValue:N,formula:j,frameVertAlign:M,placeholder:b.placeholder,insets:g?R.getInsets():ue.TypesUtils.EmptyRect,textAlign:v}},[$,p,E,y,g]),z=o.useRef(null),K=r.useImperativeElement(t,()=>({startEdit:R=>{F.current=R?.initialSelection;const re={...n,editMode:R?.editMode??!1};R?.text!==void 0&&(re.dirty=R.text),re.editMode===n.editMode&&re.dirty===n.dirty||(oe(re),ae?.(re))},submitEdit:()=>ke(),cancelEdit(){ve()},autoFocus(){z.current.focus()},dispatchEvent:R=>z.current.dispatchEvent(R),focus(){z.current.focus()},getLineHeight:ge}),[i,n]);o.useLayoutEffect(()=>{if(!P||!Z)return;const R=z.current;L.textValue,R&&R.setSelectionRange(P.start,P.end,P.direction)},[z.current,P,L.textValue]);const W=o.useMemo(()=>{const R=$?.clean(),re=L.style.createTemporaryTextFrame(L.textValue,R?.getType()===s.ScalarType.String),j=g?R.getInsets().right+R.getInsets().left:0;let J=null;return L.isWrapped&&(J={width:O-j}),re.layout(J)},[L,O,$,g]),ge=r.useCallbackRef(()=>Math.ceil(W?.lines[0]?.bounds.height),[W]);o.useLayoutEffect(()=>{if(!W)return;const R=L.style,re=R.getInsets()??ue.TypesUtils.EmptyRect,j=g?re.left+re.right:0,J=g?.04*R.getFont().getSize():1,u=Math.round(L.isWrapped?void 0:W.bounds.width+j+J),M=Math.round(W.bounds.height);A?.({width:u,height:M})},[W,A,L,g,$]);const ae=r.useCallbackRef(a,[a]),Q=r.useCallbackRef(R=>{if($.dirty===R)return;const re={...$};re.dirty=R,z.current,oe(re),ae?.(re)},[$]),X=r.useCallbackRef(R=>{if($.editMode===R)return;const re={...$};re.editMode=R,oe(re),ae?.(re)},[$]),be=o.useRef(!1),ke=r.useCallbackRef(()=>{if(be.current)return!1;try{l?.($),m?.(),be.current=!0}catch{return!1}return!0},[l,$]),ve=r.useCallbackRef(()=>{be.current=!0,oe(n),d?.(),m?.()},[d,n]),Pe=r.useCallbackRef(R=>{if(!z.current)return;if(R.key,R.isDefaultPrevented(),!(R.isTrusted||R.nativeEvent.ctrlKey||R.nativeEvent.metaKey||R.nativeEvent.altKey||R.nativeEvent.isComposing||dt.STANDARD_KEY_CHARS.indexOf(R.nativeEvent.key)===-1&&R.nativeEvent.key!=="Backspace")){const b={...$};let N=0;return Ao(b,b.dirty)&&!isNaN(parseFloat(R.key))?(b.dirty?.endsWith("%")?b.dirty=(b.dirty.substring(0,b.dirty.length-1)??"")+R.key+"%":b.dirty=(b.dirty??"")+R.key+"%",N=b.dirty.length-1):R.nativeEvent.key==="Backspace"?(b.dirty="",N=b.dirty.length):(b.dirty=(b.dirty??"")+R.key,N=b.dirty.length),z.current.value=b?.dirty,F.current={start:N,end:N,direction:"forward"},z.current?.setSelectionRange(N,N,"forward"),oe(b),ae?.(b),void R.preventDefault()}const re=R.nativeEvent.ctrlKey,j=R.nativeEvent.shiftKey,J=R.nativeEvent.altKey,u=R.nativeEvent.metaKey;if(re&&R.key==="z"&&R.stopPropagation(),R.which===r.KeyCodes.Escape)return R.preventDefault(),void ve();if(R.which===r.KeyCodes.F2)return X(!0),void R.preventDefault();const M=R.target;if(R.key==="%"&&M.selectionStart===M.selectionEnd&&M.value[M.selectionStart]==="%"&&$?.clean().getStyle().numberFormat.includes("%"))return V({start:M.selectionStart+1,end:M.selectionEnd+1,direction:M.selectionDirection}),void R.preventDefault();if(R.which===r.KeyCodes.Enter){if(R.preventDefault(),u||J){const b=L.textValue.substring(0,M.selectionStart)+`
9
- `+L.textValue.substring(M.selectionEnd);return Q(b),void V({start:M.selectionStart+1,end:M.selectionStart+1,direction:M.selectionDirection})}return void(ke()&&f.getSelection().traverse(s.IRange.Orientation.Column,j))}if(R.which===r.KeyCodes.Tab)return R.preventDefault(),void(ke()&&f.getSelection().traverse(s.IRange.Orientation.Row,j));let I=null;switch(R.which){case r.KeyCodes.Left:I=s.IRange.Direction.Left;break;case r.KeyCodes.Right:I=s.IRange.Direction.Right;break;case r.KeyCodes.Up:I=s.IRange.Direction.Up;break;case r.KeyCodes.Down:I=s.IRange.Direction.Down}if(I&&!(re||j||J||u)&&!$.editMode)return void ke();$.editMode&&(I||wl.includes(R.which))&&R.stopPropagation()},[$,f,L]),he=o.useCallback(()=>{z.current?.focus(),setTimeout(()=>{z.current?.select()},0)},[]),He=o.useCallback(()=>{z.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Se=r.useCallbackRef(()=>{const R=z.current?.value;let re="";if(h.rowIndex>0){const j=f.getRange({rowIndex:h.rowIndex-1,colIndex:h.colIndex}).getCell();j&&(re=j.toTextUnformatted(!0))}Q(R+re)},[h,f]);o.useEffect(()=>f.getRange(h).addListener(()=>{const R={...$,clean:()=>f.getRange(h).getCell()};oe(R),ae?.(R)}),[h,f,$]);const ce=o.useCallback(()=>{const R=$.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Medium Time"}}).toText();Q((z.current?.value??"")+R)},[f]),de=o.useCallback(()=>{const R=$.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Short Date"}}).toText();Q((z.current?.value??"")+R)},[f]),me=o.useMemo(()=>({element:()=>z.current,doCopy:R=>{const re=z.current.value.substring(z.current.selectionStart,z.current.selectionEnd);if(R?.isCut){const j=z.current.value.substring(0,z.current.selectionStart)+z.current.value.substring(z.current.selectionEnd,z.current.value.length);Q(j)}return re}}),[z.current]),Ce=o.useMemo(()=>({element:()=>z.current,doPaste:async(R,re)=>{const j=await R.toText?.();if(!j)return!0;const J=z.current.value.substring(0,z.current.selectionStart)+j+z.current.value.substring(z.current.selectionEnd,z.current.value.length);return Q(J),V({start:z.current.selectionStart+j.length,end:z.current.selectionStart+j.length,direction:"forward"}),!0}}),[z.current]),xe=o.useMemo(()=>({contains:R=>z.current?.contains(R)||!1,focus(){z.current.focus()}}),[]),Me=o.useMemo(()=>[new r.SimpleCommand("selectAll",xe,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},he),new r.SimpleCommand("startEditValueAbove",xe,{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:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},Se),new r.SimpleCommand("startEditCurrentTime",xe,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},ce),new r.SimpleCommand("startEditCurrentDate",xe,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},de),new r.Command("relativeReferencesToggle",xe,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},He),new r.Command("toggleEditorFocus",xe,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),we=o.useMemo(()=>{let R=null;const re=()=>({contains:j=>z.current?.contains(j)||!1,focus(){z.current.focus()}});return R=T?T.createChildGroup(re,"editor",!1):new r.CommandGroup(re,"editor"),R.addCommands(Me,!0),R},[T,Me]),Ee=o.useMemo(()=>({notifier:null,source:me,target:Ce,commands:we}),[me,Ce,we]);r.useCopyPaste(Ee);const[Le,Ve]=o.useState(!S);o.useEffect(()=>{Ve(!1)},[]);const C=r.useCallbackRef(R=>{_(!0),we?.activate();const re=F.current;if(re!==!1){let j,J;const u=z.current.value;Ao($,u)&&(j=u.length-1,J=u.length-1),j=re?.start??j??u.length,J=re?.end??J??u.length,F.current=!1,V({start:j,end:J,direction:"forward"})}D?.(R)},[D,$]),Ue=L.insets;let Qe=Ue.left+1;const $e=Ue.left+Ue.right+2-1,ee=W?.bounds.height??0;let Fe,Be=Ue.top;L.frameVertAlign===s.ITextFrame.VerticalAlignment.Center?Be=Math.max(0,(k-(Ue.top+Ue.bottom)-ee)/2):L.frameVertAlign===s.ITextFrame.VerticalAlignment.Bottom&&(Be=Math.max(0,k-(Ue.top+Ue.bottom)-ee)),B!==void 0&&W?.lines[0]?.bounds&&(Fe=W?.lines[0]?.bounds.height*B);const Ie=L.style.getFont();let ze=Ie.getSize();Ie.isSuperSub()&&(ze*=Ie.getSuperSubScale()),ze*=s.IFont.getDeviceScale()*y;const Ae=g?Ie.toCSS(E,y):null;return c.jsx("div",{className:"sheet-cell-editor",onMouseDown:R=>{z.current&&document.activeElement!==z.current&&requestAnimationFrame(()=>{z.current.focus()})},ref:K,...w,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...U},children:c.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:Be*y+1,left:Qe*y,width:`calc(100% - ${$e*y}px)`,maxWidth:`calc(100% - ${$e*y}px)`,height:(Fe??ee)*y,maxHeight:(Fe??ee)*y},children:c.jsx("textarea",{spellCheck:"false",placeholder:L.placeholder,ref:z,value:L.textValue,disabled:Le,readOnly:G||f.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...Ae,fontSize:ze?`${ze}px`:"inherit",textAlign:L.textAlign,lineHeight:(W?.lines[0]?.bounds.height??0)*y+"px",height:(W?.bounds.height??0)*y,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:L.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:C,onBlur:()=>{_(!1)},onSelect:R=>{},onChange:R=>{z.current&&!be.current&&(F.current=!1,Q(R.target.value),L.textValue,R.target.value,R.target.selectionStart,R.target.selectionEnd,R.target.selectionDirection,V({start:R.target.selectionStart,end:R.target.selectionEnd,direction:R.target.selectionDirection}))},onMouseDown:R=>{Z&&X(!0)},onKeyDown:Pe})})})})),wr=(e,t)=>({clean:e,dirty:t,editMode:!1}),yr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:d=!1,offsetX:m=0,offsetY:p=0,isVertical:g=!1,...x}=e,h=U=>{let y=null;if(U&&n>0){y="";for(let B=0;B<U.length;B++)y+=U[B],B<U.length-1&&(y+=",")}return y},f=h(i);let T=f;a&&(T=h(a));let q=n,A=t,D=null;if(l){q=Math.floor(n/2);const U=q+q/2+1;let y=null;y=g?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(p+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+U)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(p+U)}`,D=c.jsx("path",{strokeWidth:q,strokeDasharray:T,d:y,...x})}if(d){q=n/2;const U=q+q/2;let y=T,B=null;B=g?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(p+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+U)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(p+U)}`,D=c.jsx("path",{strokeWidth:q,strokeDasharray:y,strokeDashoffset:"1",shapeRendering:"crispEdges",d:B,...x})}let G=null;return G=g?`M ${r.ReactUtils.boundPixel(m+q/2)} ${r.ReactUtils.boundPixel(p)} L ${r.ReactUtils.boundPixel(m+q/2)} ${r.ReactUtils.boundPixel(p+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(p+q/2)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(p+q/2)}`,c.jsxs(c.Fragment,{children:[c.jsx("path",{strokeWidth:q,strokeDasharray:f,d:G,...x}),D]})};function oo(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Zt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=oo(i,t),l=typeof a=="function";n.push(l?a:()=>oo(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)oo(n,t)}},yl=function(){},xr=typeof window<"u",cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xl=xr?o.useLayoutEffect:o.useEffect,Do={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Lt=xr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(Do),a=i[0],l=i[1],d=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var p=m[0].contentRect,g=p.x,x=p.y,h=p.width,f=p.height,T=p.top,q=p.left,A=p.bottom,D=p.right;l({x:g,y:x,width:h,height:f,top:T,left:q,bottom:A,right:D})}})},[]);return xl(function(){if(t)return d.observe(t),function(){d.disconnect()}},[t]),[n,a]}:function(){return[yl,Do]},ql=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Sl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Rl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:d=!1,shiftIfWide:m=!1,isVertical:p=!1,intersections:g,layout:x}=e,h=s.IBorder.BuiltInDefinitions.get(d?s.IBorder.StrokeStyle.Thin:a.getStyle());if(!h)return null;const f=n[0],T=n[1],q=n[2],A=n[3];let D=1+(p?A-T:q-f),G=0;const U=a.getColor().toRGBA(l).toString(),y=h.description.toLowerCase().includes("double");let B,S;const w=p?"rowStart":"colStart",k=p?"rowEnd":"colEnd",O=p?T:f;if(g?.length>0){const _=g[0];if(_?.range[w]===i[w]){const V=s.IBorder.BuiltInDefinitions.get(_.stroke.getStyle());G=Math.floor(V.width/2)}if(g[g.length-1]?.range[k]===i[k]){const V=s.IBorder.BuiltInDefinitions.get(g[g.length-1].stroke.getStyle());D=Math.floor(D+(V.width===2?0:V.width/2))}if(y){const V=p?"colStart":"rowStart",$=p?"colEnd":"rowEnd",oe=p?x?.getRowOffset:x?.getColOffset;let L=0,z=0;B=[],S=[];for(let K=0;K<g.length;K++){const W=g[K];if(W.stroke.getStyle()===s.IBorder.StrokeStyle.Double&&oe){const ge=oe(W.range[w])-(O-G);W.range[V]<i[V]&&(B.push(ge-L),L=ge,B.push(1),L++),W.range[$]>i[$]&&(S.push(ge-z),z=ge,S.push(1),z++)}}B.length>0&&L<D&&B.push(D-L),S.length>0&&z<D&&S.push(D-z)}}let E=p?-Math.floor(h.width/2):-G,F=p?-G:-Math.floor(h.width/2);const Z=m&&h.width>2?-1:0;return c.jsx(yr,{offsetX:f+E+Z,offsetY:T+F+Z,length:D+G,isVertical:p,stroke:U,width:h.width,dashArray:B??h.pattern,dashArrayAdditional:S,isDouble:y,isAngled:h.description.toLowerCase().includes("slant")},t)},bo=({getBorderAt:e,borderRenderer:t=Rl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:d=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>g=>{const x=g.toClipBounds(g.getRangeCoordsBounds(),-3);if(!x)return;const h=m(g);if(h.length===0)return;const f=g.getVisibleColumnOffsets(),T=g.getVisibleRowOffsets();let q=[],A=[];const D=g.getVisibleColumns(),G=g.getVisibleRows(),U=[],y=[],B=[],S=(E,F,Z,_,P,V,$)=>{const oe={index:_,stroke:P,visibleIndex:Z,edge:V,length:$};E[F]||(E[F]=[]),E[F].length>0&&E[F][E[F].length-1]?.index===_?E[F][E[F].length-1]=oe:E[F].push(oe)};for(let E=0;E<h.length;E++){const F=h[E],Z=F.coords;if(!Z)continue;const _=F?.range??{rowStart:Z.rowIndex,colStart:Z.colIndex,rowEnd:Z.rowIndex,colEnd:Z.colIndex},P=g.getVisibleRangeCoords();if(!ue.CoordUtils.isRangesIntersect(_,P)&&!ue.CoordUtils.isRangeWithinRange(_,P))continue;const V=Z.colIndex,$=Z.rowIndex,oe=f[V],L=T[$];if(_.rowEnd!==_.rowStart){const Pe=T[_.rowStart]?.spanIndex??-1,he=T[_.rowEnd]?.spanIndex??T[G[G.length-1]].spanIndex+1;q.push({..._,rowStart:Pe,rowEnd:he})}if(_.colEnd!==_.colStart){const Pe=f[_.colStart]?.spanIndex??-1,he=f[_.colEnd]?.spanIndex??f[D[D.length-1]].spanIndex+1;A.push({..._,colStart:Pe,colEnd:he})}const z=F.value,K=e(z,E);if(!K||K.isEmpty())continue;const W=K.getLeft(),ge=K.getTop(),ae=K.getRight(),Q=K.getBottom();let X=1,be=1;if(!oe||!L)continue;const ke=oe.spanIndex,ve=L.spanIndex;W.isNone()||S(U,ke,ve,$,W,s.IBorder.Edge.Left,X),ge.isNone()||S(y,ve,ke,V,ge,s.IBorder.Edge.Top,be),ae.isNone()||S(U,ke+be,ve,$,ae,s.IBorder.Edge.Right,X),Q.isNone()||S(y,ve+X,ke,V,Q,s.IBorder.Edge.Bottom,be)}const w=(E,F,Z)=>{const _=[];return E.forEach((P,V)=>{let $=null;P.sort((oe,L)=>oe.visibleIndex-L.visibleIndex);for(let oe=0;oe<P.length;oe++){const L=P[oe];if(!L?.stroke||F[V]===void 0&&F[V-1]===void 0)continue;let z=!1;if(Z)for(let ae=0;!z&&ae<q.length;ae++){let Q=q[ae];Q.colStart<=L.index&&Q.colEnd>=L.index&&Q.rowStart<V&&Q.rowEnd>=V&&(z=!0)}else for(let ae=0;!z&&ae<A.length;ae++){let Q=A[ae];Q.rowStart<=L.index&&Q.rowEnd>=L.index&&Q.colStart<V&&Q.colEnd>=V&&(z=!0)}if(z)continue;const K=L.stroke?.getColor(),W=K?K.toRGBA().toString():l,ge=L.stroke.getStyle()+":"+W;(ge!==$?.key||$&&$.visibleIndex+1<L.visibleIndex)&&($&&_.push($),$={key:ge,index:F[V]??F[V-1]+1,visibleIndex:L.visibleIndex,edge:L.edge,stroke:L.stroke,from:L.index,to:L.index+L.length-1,intersections:[],length:1}),$.to=L.index+L.length-1,$.visibleIndex=L.visibleIndex}$&&_.push($)}),_};q=q.sort(Sl),A=A.sort(ql);const k=w(U,D,!1),O=w(y,G,!0);if(k.length===0&&O.length===0)return null;for(let E=0;E<O.length;E++){const F=O[E];let Z=ue.CommonUtils.findEqualOrGreater(k,F.from,P=>P.index),_=!1;for(;!_;){const P=k[Z++];P&&P.index>=F.from&&P.index<=F.to+1&&P.from<=F.index&&P.to+1>=F.index&&(F.intersections.push({stroke:P.stroke,range:{rowStart:P.from,rowEnd:P.to+1,colStart:P.index,colEnd:P.index}}),P.intersections.push({stroke:F.stroke,range:{rowStart:F.index,rowEnd:F.index,colStart:F.from,colEnd:F.to+1}})),_=!P||P.index>F.to+1}}for(let E=0;E<O.length;E++){const F=O[E];let Z=F.stroke;const _=`rBorder:${F.index}:${F.from}:${F.to}:${F.edge}`,P={rowStart:F.index,rowEnd:F.index,colStart:F.from,colEnd:F.to+1},V=g.getLayout(),$=!1,oe=V.getColOffset(P.colStart),L=V.getRowOffset(P.rowStart),z=[oe,L,V.getColOffset(P.colEnd),L];B.push(t({key:_,points:z,stroke:Z,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:F.intersections,layout:V,isVertical:$}))}for(let E=0;E<k.length;E++){const F=k[E];let Z=F.stroke;const _=`cBorder:${F.index}:${F.from}:${F.to}:${F.edge}`,P={rowStart:F.from,rowEnd:F.to+1,colStart:F.index,colEnd:F.index},V=g.getLayout(),$=!0,oe=V.getColOffset(P.colStart),L=[oe,V.getRowOffset(P.rowStart),oe,V.getRowOffset(P.rowEnd)];B.push(t({key:_,stroke:Z,points:L,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:F.intersections,layout:V,isVertical:$}))}return c.jsx("svg",{width:`${x.width}`,height:`${x.height}`,viewBox:`0 0 ${x.width} ${x.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${x.width}px`,height:`${x.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:B},"borders")},[e,i])}},zo=ue.AnchorLocation.Center,kl=Object.freeze({horizontal:!1,vertical:!1}),No=ue.TypesUtils.EmptyTopLeft,Ml=(e,t)=>ue.CoordUtils.EmptyCell,Tl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Il=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:d=2,darkMode:m,forceThinBorder:p,children:g,...x}=e,h=o.useRef(null),[f,{width:T,height:q}]=Lt(),A=n??T,D=i??q,G=o.useMemo(()=>{const $=[];for(let oe=0;oe<l;oe++)for(let L=0;L<d;L++){const z={colIndex:L,rowIndex:oe};$.push({coords:z,value:z})}return $},[]),U=o.useCallback($=>G,[G]),{overlay:y}=bo({getVisibleCells:U,getBorderAt:t,darkMode:m,forceThinBorder:p}),B=Math.floor(A/d),S=Math.floor(D/l),w={getColOffset:$=>Math.ceil($*B)+0,getRowOffset:$=>Math.ceil($*S)+0,getColIndex:$=>Math.floor(($-0)/B)-1,getRowIndex:$=>Math.floor(($-0)/S)-1},k={rowStart:0,colStart:0,rowEnd:l,colEnd:d},O={x:0,y:0,width:Math.max(0,A)+0,height:Math.max(0,D)+0},E=o.useMemo(()=>{const $={},oe=Math.floor(A/d);for(let L=0;L<d;L++)$[L]={offset:L*oe,size:oe,spanIndex:L};return $},[A,D]),F=o.useMemo(()=>{const $={},oe=Math.floor(D/l);for(let L=0;L<l;L++)$[L]={offset:L*oe,size:oe,spanIndex:L};return $},[A,D]);if(!y)return null;const Z={width:A,height:D},_={width:A,height:D},P={getStage:()=>h.current,getTotalSize:()=>Z,getViewportSize:()=>_,getLayout:()=>w,getCellCoordsAsRangeCoords:ue.CoordUtils.cellToRange,getVisibleRangeCoords:()=>k,getVisibleRows:()=>{const $=[];for(let oe=0;oe<l;oe++)$.push(oe);return $},getTotalRangeCoords:()=>k,getRelativePointFromClient:($,oe)=>({x:$,y:oe}),getVisibleColumns:()=>{const $=[];for(let oe=0;oe<d;oe++)$.push(oe);return $},toClipBounds:($,oe)=>O,toViewBounds:$=>$,toAbsoluteBounds:$=>$,getBounds:()=>O,getInsets:()=>null,getRangeCoordsBounds:($,oe)=>null,getVisibleColumnOffsets:()=>E,getVisibleRowOffsets:()=>F,allViews:()=>({[zo]:P}),getAnchor:()=>zo,getZoom:()=>1,scrollCellCoordsIntoView:Tl,getCellCoordsFromClient:Ml,getScrollOrientation:()=>kl,getScrollTopLeft:()=>No,getFreezeTopLeft:()=>No},V=y(P);return c.jsxs("div",{style:{...a,position:"relative",display:"flex"},...x,children:[c.jsx("div",{ref:Zt([h,f]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:g}),V]})});function qr(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=qr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function wt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=qr(e))&&(i&&(i+=" "),i+=t);return i}const El="_sheetxl-sheet_1qeq6_5",Fl="_viewport-overlay_1qeq6_6",Sr=e=>{const{style:t,...n}=e??{};return c.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[c.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"}),c.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"}),c.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"}),c.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"}),c.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"})]})},Al=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:d,...m}=e??{},[p,g]=o.useState(null);o.useEffect(()=>{(async()=>{const S=await s.LicenseManager.getDetails();g(S)})()},[]);const[x,h]=o.useState(!1),f={opacity:.65},T=o.useMemo(()=>{const S=p?.exceptions(),w=S?.length??0;if(w===0)return null;const k=[];for(let O=0;O<w;O++){const E=S[O];k.push(c.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:E},O))}return k},[p,n]);if(p===null||p.isValidFor(l))return null;const q=p.type(),A=!T&&q.endsWith("ity"),D=p.licensee(),G=A?1.6:1,U=135/G,y=37/G;let B=null;return!q&&D?.length>0&&(B=c.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),c.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...d},...m,children:c.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[x?c.jsx(Sr,{style:f}):c.jsx("svg",{width:U,height:y,style:f,children:c.jsx("image",{style:{width:U,height:y},href:"https://www.sheetxl.com/watermark.svg",onError:()=>h(!0)})}),c.jsxs("div",{children:[B,T,c.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),tt=(e,t,n)=>{const i=o.useRef(t);i.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!i.current)return;const l=Object.keys(i.current),d={},m=l.length;for(let g=0;g<m;g++){const x=l[g];d[x]=(h,f)=>{i.current[x]?.(h,f)}}const p=e.addListeners(d,n);if(a)for(let g=0;g<m;g++)d[l[g]](e);return()=>{p?.()}},[e])},Tn=new s.Color("transparent");function Rr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,notifier:d,onStartEdit:m,getViewport:p}=e,[g,x]=o.useState(null),[h,f]=o.useState(null),T=o.useRef(null),q=r.useCallbackRef(m,[m]),A=r.useCallbackRef(p,[p]),[D,G]=o.useState(),[U,y]=o.useState(()=>t?.getStyles().parseColor(s.IColor.Scheme.Bg2)),[B,S]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const k=r.useGlobalClipboard(),[O,E]=o.useState(ue.CommonUtils.EmptyArray),F=o.useCallback(()=>{if(T.current!==t)return;const u=t.getSelectedRanges();let M=null;O.length>0&&ue.CoordUtils.isCellWithinRange(g,O[0].getRange().getCoords())&&(M=O[0]);const I=t?.getSelectedCell(),b=I?.getCoords()??null;Nt.unstable_batchedUpdates(()=>{W(M),x(b),f(u)})},[t,O,h,g]),Z=o.useCallback(ue.CommonUtils.debounce(F,210),[F]);o.useEffect(()=>{T.current=t,F()},[t]);const _=r.useCallbackRef(()=>t.getRange(g).getCell(),[t,g]),P=r.useCallbackRef(async(u,M,I=null,b=!1,N=!0)=>{const v=u?.label?.(),H=async()=>{const ie=await Promise.resolve(N&&d?.showBusy?.(v??"Busy..."));try{await t.doBatch(async()=>M(t),v),b&&w.setMode(null),ie&&ie()}catch(se){if(ie&&ie(),!se)return;d?.showError?.(se)}},Y=[];let ne=!1;const le=async()=>(Y.push(H),(async()=>{if(!ne){for(ne=!0;Y.length>0;){const ie=Y.shift();ie&&await ie()}ne=!1}})());if(n){let ie=null;if(I!==!1&&u){const se=I??v;ie=new r.SimpleCommand(u.key(),l,{label:se,description:se},le)}n(ie)}return le()},[t,n,d]),V=r.useCallbackRef((u,M,I=!1,b)=>P(u,N=>{const v=N.getSelectedRanges();I&&v.updateStyle(null,b),v.updateStyle(M,b),v.autoFit({expandOnly:s.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),$=r.useCallbackRef((u,M,I)=>{P(u,b=>{let N=M;(I||M?.address)&&(N=N??{},!I&&M?.address?.startsWith("#")?I=M?.address.substring(1):I&&(N.displayText=I)),b.getSelectedRange().setHyperlink(N)})},[t]),oe=r.useCallbackRef((u,M)=>{P(u,I=>{I.getSelectedRange().setComments(M)})},[t]),L=r.useCallbackRef((u,M)=>{P(u,I=>{I.getSelectedRanges().clear(M)})},[t]),z=r.useCallbackRef(async(u,M,I=!1,b=!1)=>P(u,async N=>{let v=N.getSelectedRanges();I&&(M===s.IRange.Orientation.Row?v=v.getEntireRows(b):M===s.IRange.Orientation.Column&&(v=v.getEntireColumns(b)));let H=null;const Y=w.getMode()?.key;if(Y==="copy"||Y==="cut"){const ne=await k.getClipboard().readReference();ne&&ne.getItemType()==="range"&&(H=ne.getItem(),H.getCoords()||(H=null))}if(H){const ne=await v.insertFrom(H,{...H.getMarkOptions(),orientation:M,autoSelect:!0});!ne||ne.isEntireRows()||ne.isEntireColumns()||ne.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else v.insert(M,{autoSelect:!0})},"Insert Cells",!1),[w]),[K,W]=o.useState(null),ge=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),ae=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),Q=r.useCallbackRef((u,M)=>{P(u,async I=>{const b=I.getSelectedRange(),N=I.getSelectedCell().getCoords();let v=null,H=0;const Y=N.rowIndex>0?I.getRange({rowIndex:N.rowIndex,colIndex:N.colIndex}).getExtended(s.IRange.Direction.Up):null;Y&&I.getRange({colStart:N.colIndex,rowStart:Y.getCoords().rowStart,colEnd:N.colIndex,rowEnd:Y.getCoords().rowStart}).isContentful()&&(v=s.IRange.Direction.Up,H=N.rowIndex-Y.getCoords().rowEnd);const ne=N.colIndex>0?I.getRange({rowIndex:N.rowIndex,colIndex:N.colIndex-1}).getExtended(s.IRange.Direction.Left):null;if(ne&&I.getRange({colStart:ne.getCoords().colStart,rowStart:N.rowIndex,colEnd:ne.getCoords().colStart,rowEnd:N.rowIndex}).isContentful()){const ie=N.colIndex-ne.getCoords().colEnd;(ie<H||!v)&&(v=s.IRange.Direction.Left,H=ie)}let le=null;if(v===s.IRange.Direction.Up){if(le={...Y.getCoords()},(le.rowEnd===N.rowIndex||!I.getRange({colIndex:N.colIndex,rowIndex:N.rowIndex-1}).isContentful())&&le.rowStart>0&&I.getRange({colIndex:N.colIndex,rowIndex:le.rowStart-1}).isContentful()){const ie=Y.getExtended(s.IRange.Direction.Up);le={colStart:N.colIndex,rowStart:ie.getCoords().rowStart,colEnd:N.colIndex,rowEnd:Y.getCoords().rowEnd}}le.rowEnd=N.rowIndex-1}else if(v===s.IRange.Direction.Left){if(le={...ne.getCoords()},(le.colEnd===N.colIndex||!I.getRange({colIndex:N.colIndex-1,rowIndex:N.rowIndex}).isContentful())&&le.colStart>0&&I.getRange({colIndex:le.colStart-1,rowIndex:N.rowIndex}).isContentful()){const ie=ne.getExtended(s.IRange.Direction.Left);le={colStart:ie.getCoords().colStart,rowStart:N.rowIndex,colEnd:ie.getCoords().colEnd,rowEnd:N.rowIndex}}le.colEnd=N.colIndex-1}if(b.size!==1&&v){const ie=b.getCoords(),se=b.startIncrementalUpdates({orientation:s.IRange.Orientation.Column}),ye={...le},fe=ie.rowStart,pe=ie.rowEnd,qe=ie.colStart,Oe=ie.colEnd,De=v===s.IRange.Direction.Up;for(let We=qe;We<=Oe;We++){ye.colStart=De?We:le.colStart+(We-qe),ye.colEnd=De?We:le.colEnd+(We-qe);for(let je=fe;je<=pe;je++){ye.rowStart=De?le.rowStart+(je-fe):je,ye.rowEnd=De?le.rowEnd+(je-fe):je;const Ge=I.getRange(ye).toString();se.pushAt(je,We,`=${M}(${Ge})`)}}se.apply()}else{const ie=le?I.getRange(le).toString():"",se=`=${M}(`;q?.({text:`${se}${ie})`,editMode:!0,initialSelection:{start:se.length,end:se.length+ie.length}})}},!1)},[t]),X=r.useCallbackRef((u,M,I=!1,b=!0)=>{P(u,async N=>{let v=null;if(K)return void K.updateStyleOptions(M);{const ne=N.getSelectedRanges().getFixed(!0),le=N.getSelectedRange().getDefaultSortCriteria();let ie={ranges:ne,hasHeader:le?.options?.hasHeader??!1};v=b?new Promise((se,ye)=>{const fe={tableOptions:ie,onCancel:()=>{ye()},onDone:pe=>{se(pe)},context:{getNames:()=>N.getNames()}};d.showWindow?.("tableNew",fe)}):{option:"Ok",tableOptions:ie}}const H=await Promise.resolve(v);if(H?.option!=="Ok")throw null;const Y=await Promise.resolve(d?.showBusy?.(u.label()));try{await N.getTables().add(H.tableOptions.ranges.at(0),{styleName:M?.name,clearFormatting:I,hasHeader:H.tableOptions.hasHeader}).getRange().select()}catch(ne){Y(),d?.showError?.(ne)}Y()},!1,!0,!1)},[K]),be=r.useCallbackRef(()=>i,[i]),ke=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:be,getNames:()=>t.getNames()}),[t]),ve=r.useCallbackRef(async(u,M,I,b=!0)=>{let N=null;if(!M){let v=t.getSelectedRange();v.size===1&&(v=v.getSurrounding());let H=t.getTables().getItems({address:t.getSelectedRange()});H.length>0&&(M=H[0]),await v.select()}if(M){if(b){try{I&&await M.select()}catch{}N=new Promise(async(v,H)=>{u.update({context:ke(M)});const Y={command:u,commands:C,notifier:d,onDone:le=>{v(le)}},ne=await d.showWindow?.("tableDetails",Y,{disableAutoDestroy:!0});setTimeout(()=>{ne.focus()},180)})}Promise.resolve(N).then(v=>{},v=>{d?.showError?.(v)})}},[d]),Pe=r.useCallbackRef(async(u,M,I=!1)=>{let b=null;if(M)M.isITable?b=M:M.getValue()&&(b=M.getValue());else{const N=t.getTables().getItems({address:t.getSelectedRange()});N.length>0&&(b=N[0])}if(b){if(!I){const N=b.getRange().getCoords(),v=(N.colEnd-N.colStart+1)*(N.rowEnd-N.rowStart+1);if(v>1e4&&await d?.showOptions({title:"Confirm",description:`Converting a table to range with '${v}' cells will set a large number of cell styles and may affect performance.
10
- Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}P(u,async()=>{I?b.delete():b.convertToRange()},!1,!0)}},[d]),he=r.useCallbackRef((u,M,I)=>{P(u,async b=>{let N=b.getSelectedRanges();if(N.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let v=N.at(0);v.size===1&&(v=v.getSurrounding());const H=b.getSelection().getCoords().cell;let Y=v.getDefaultSortCriteria(s.IRange.Orientation.Row,H);if(!Y){if(I)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let ne=Y.options;if(I&&(ne=new Promise((ie,se)=>{const ye={range:v,options:Y.options,cell:H,onCancel:()=>{se()},onDone:fe=>{fe?ie(fe.options):se()}};d.showWindow?.("sort",ye)})),ne=await Promise.resolve(ne),!ne)return;const le=await Promise.resolve(d?.showBusy?.(u.label()));try{v.doBatch(()=>{const ie={...ne,...M};v.sort(ie),v.autoFit({orientations:ie?.orientation===s.IRange.Orientation.Column?s.IRange.Orientations.Column:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},u?.label?.())}catch(ie){le(),d?.showError?.(ie)}le()},!1,!1,!1)},[d]),He=r.useCallbackRef(()=>{console.log("compactedSelection");const u=t.getSelection().getCoords(),M=t.getSelectedRanges().getFlattened().getCoords(),I=(v=>{const H=new Blob([v],{type:"application/javascript"}),Y=URL.createObjectURL(H),ne=new Worker(Y);return URL.revokeObjectURL(Y),ne})("console.log('hello from worker');");setTimeout(()=>{I.terminate(),console.log("Worker terminated")},5e3);let b=-1;for(let v=0;b===-1&&v<M.length;v++)ue.CoordUtils.isCellWithinRange(u.cell,M[v])&&(b=v);if(ue.CoordUtils.isEqualRangesArrays(u.ranges,M))return;const N={cell:u.cell,ranges:M,rangeIndex:b};t.getSelection().updateCoords(N)},[t]),Se=r.useCallbackRef(()=>{console.log("selectComments")},[t]),ce=r.useCallbackRef(async(u=!1,M=!1)=>{let I=null;if(M)I=t.getEntireRange();else{const b=t.getSelectedRange();if(b.isEntireRange()){const N=t.getSelection().getCoords().cell,v=t.getRange(N);I=v.getSurrounding(),I.isEntireRange()&&(I=v)}else I=b.getSurrounding({contentOnly:u})}I&&await I.select()},[t]),de=r.useCallbackRef((u,M,I)=>{P(u,async b=>{let N=b.getSelectedRanges();I&&(M===s.IRange.Orientation.Row?N=N.getEntireRows():M===s.IRange.Orientation.Column&&(N=N.getEntireColumns())),N.delete(M)},"Delete Cells")},[t]);r.useCallbackRef(async u=>{let M=null;const I=A(),b=Math.min(I.width-8,480),N=Math.min(I.height-8,288);try{t.getSelectedRanges(),M=await t.getMovables().add({bounds:{x:I.left+(I.width-b)/2,y:I.top+(I.height-N)/2,width:b,height:N},type:"chart",json:u.template}),M.select(),w.setMode(null)}catch(v){d?.showError?.(v)}return M},[t,d]);const me=r.useCallbackRef(async(u,M,I)=>{const b=await d?.showBusy?.(u.label());try{const N=await t.getMovables().addImage(M,{autoSelect:!0,...I});return b(),w.setMode(null),N}catch(N){b();let v=N;typeof v!="string"&&(console.warn(N),v="Unable to resolve image."),d?.showMessage?.(v,{type:r.NotificationType.Error})}},[t,d]),Ce=r.useCallbackRef((u,M)=>{P(u,async I=>{const b=I.getSelectedRanges();b.doBatch(()=>{const N=M===s.IRange.Direction.Up||M===s.IRange.Direction.Down,v=b.getCoords().slice().sort(ue.CoordUtils.createRangeComparator(N?s.IRange.Orientation.Row:s.IRange.Orientation.Column));for(let H=0;H<v.length;H++){const Y=v[H];let ne=Y;const le=I.getRange(ne).getMerges();let ie=0,se=0;if(le.length>0){const ye=le[0];ie=ye.rowEnd-ye.rowStart,se=ye.colEnd-ye.colStart}M===s.IRange.Direction.Left?ne={...Y,colStart:Y.colEnd+se}:M===s.IRange.Direction.Right?ne={...Y,colEnd:Y.colStart+se}:M===s.IRange.Direction.Up?ne={...Y,rowStart:Y.rowEnd+ie}:M===s.IRange.Direction.Down&&(ne={...Y,rowEnd:Y.rowStart+ie}),I.getRange(ne).autoFill(Y,{filler:s.AutoFill.Types.Copy}),I.getRange(Y).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:u.label()})})},[d]),xe=r.useCallbackRef(()=>{let u=null;const M=t.getSelectedCell().getCoords();if(M?.rowIndex>0){const I=t.getRange({rowIndex:M.rowIndex-1,colIndex:M.colIndex}).getCell();I&&(u=I.toTextUnformatted(!0))}q?.({text:u})},[t]),[Me,we]=o.useReducer(u=>u+1,0),[Ee,Le]=o.useReducer(u=>u+1,0),Ve=o.useMemo(()=>[new r.Command("gridlinesToggle",l,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",l,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesColumns",l,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new r.Command("sheetViewFormatGridlinesColor",l,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",l,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",l,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",l,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",l,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("sheetViewToggleFormulaView",l,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[r.KeyModifiers.Ctrl]},{key:"`",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]}),new r.Command("sheetViewToggleShowZeros",l,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Se()),new r.Command("selectAll",l,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[r.KeyModifiers.Ctrl]},{key:"Space",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},(u=!1)=>ce(!1,u)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>ce(!0,!1)),new r.SimpleCommand("breakSelection",l,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},()=>He()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation."}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically."}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){he(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){he(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){he(this,{},!0)}),new r.Command("protectionSheetToggle",l,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
11
- For example, you can prevent people from editing locked cells or making formatting changes.`}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new r.Command("formatCellStyle",l,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(u){V(this,{named:u.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(u){X(this,u)}),new r.Command("formatTableStyleClearCellStyles",l,{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(u){X(this,u,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{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 r.Command("setDefaultTableStyle",l,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},ge),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},ae),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(u){V(this,{border:u})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(u){V(this,{fill:u})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(u){V(this,{font:{fill:u}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",l,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",l,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",l,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",l,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top."}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells."}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new r.Command("formatTextOverflowEllipsisToggle",l,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",l,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom."}),new r.Command("formatAlignJustifyVerticalToggle",l,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically."}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left."}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content."}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right."}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content."}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells."}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new r.Command("formatAlignDistributedHorizontalToggle",l,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,u=>({font:{size:uo(u.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,u=>({font:{size:uo(u.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(u){V(this,{font:{family:u}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(u){V(this,{font:{size:u}})}),new r.Command("formatNumberDialog",l,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(u,M){const I=this,b={initialValue:u??M.state(),context:M.context(),onInputOption:(N,v)=>{V(I,{numberFormat:N})}};d.showWindow?.("numberFormat",b)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(u){V(this,{numberFormat:u})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:s.NumberFormat.Type.General})}),new r.Command("formatNumberFormatNumberStyle",l,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"#,##0.00"})}),new r.Command("formatNumberFormatTimeStyle",l,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"h:mm AM/PM"})}),new r.Command("formatNumberFormatDateStyle",l,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(u){V(this,{numberFormat:u??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"0%"})}),new r.Command("formatNumberFormatScientificStyle",l,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){V(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){V(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){V(this,u=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places."},function(){V(this,u=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",l,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("quickFormulaSum",l,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){Q(this,"SUM")}),new r.Command("quickFormulaAverage",l,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){Q(this,"AVERAGE")}),new r.Command("quickFormulaCount",l,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){Q(this,"COUNT")}),new r.Command("quickFormulaMax",l,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){Q(this,"MAX")}),new r.Command("quickFormulaMin",l,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){Q(this,"MIN")}),new r.Command("startEditCurrentTime",l,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){q?.({text:t.createTemporaryCell({value:fn(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",l,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){q?.({text:t.createTemporaryCell({value:fn(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",l,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoomIn",l,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoom100",l,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(u,M){console.log("insertFunction")}),new r.Command("updateHyperlink",l,{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:()=>_,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(u,M){const I=this,b={context:M.context(),onUpdateHyperlink:(N,v)=>{$(I,N,v)}};d.showWindow?.("hyperlink",b)}),new r.Command("openHyperlink",l,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>_},async(u,M)=>{const I=M.context()();if(!I)return;const b=I.getHyperlink();if(b)try{await b.open()}catch(N){d?.showError?.(N)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>_},function(u,M){$(this,null,null)}),new r.SimpleCommand("insertNote",l,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(u,M)=>{((I,b)=>{I?.showMessage?.(c.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[b," is not yet implemented.",c.jsx("br",{}),c.jsx("br",{}),"Please see the ",c.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(d,M.label())}),new r.Command("updateComments",l,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",context:()=>_},async function(u,M){const I=this,b={context:M.context(),onUpdateComments:N=>{oe(I,N)}};d.showWindow?.("comments",b)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",context:()=>_},function(u,M){oe(this,null)}),new r.Command("insertImageFromFile",l,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(u=null){let M=null,I=null;typeof u=="string"?I=u:M=u?.file?u.file:u,(M||(M=await ue.CommonUtils.openFileDialog(I??"image/*"),M))&&await me(this,{file:M},u?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(u){if(!u){const M=await d?.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(M.option!=="Insert")return;u=M.input}u&&me(this,{fetch:u})}),new r.SimpleCommand("insertTable",l,{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:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){X(this)}),new r.Command("editTable",l,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(u){let M=null,I=!1;u.isITable?M=u:u.getValue()&&(M=u.getValue(),I=!0),ve(this,M,I)}),new r.Command("deleteTable",l,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
7
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@sheetxl/sdk"),r=require("@sheetxl/utils-react"),u=require("react/jsx-runtime"),ge=require("@sheetxl/utils"),o=require("react"),dt=require("@sheetxl/grid-react"),Nt=require("react-dom"),fn=(e=6e4)=>new Date(Math.floor(Date.now()/e)*e),Cl=Object.freeze(Object.defineProperty({__proto__:null,nowWithPrecision:fn},Symbol.toStringTag,{value:"Module"})),pr=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]),uo=(e,t=!0,n=pr)=>{if(!n||n.length===0)return e;if(e===void 0)return n[0];if(t&&e>=n[n.length-1]||!t&&e<=n[0])return e;let i=ge.CommonUtils.findEqualOrGreater(n,e);return t?(n[i]===e&&(i+=1),n[i]||(i-=1),n[i]):(i-=1,n[i])},bl=Object.freeze(Object.defineProperty({__proto__:null,DefaultFontSizes:pr,findNextFontSize:uo},Symbol.toStringTag,{value:"Module"})),go=o.memo(e=>{const{anchorLocation:t=ge.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:d,fill:m,pathProps:v,style:g,...k}=e,h=a,p=l;let M="red",x=[],A=[];return t===ge.AnchorLocation.TopLeft?(M=d?"rgb(255, 198, 246)":"green",x.push(p),A.push(p),x.push(p+h),A.push(p),x.push(p),A.push(p+h)):t===ge.AnchorLocation.TopRight?(M=d?"rgb(0, 255, 255)":"red",x.push(n-p),A.push(p),x.push(n-(p+h)),A.push(p),x.push(n-p),A.push(p+h)):t===ge.AnchorLocation.BottomRight?(M=d?"rgb(236, 252, 211)":"purple",x.push(n-p),A.push(i-p),x.push(n-(p+h)),A.push(i-p),x.push(n-p),A.push(i-(p+h))):t===ge.AnchorLocation.BottomLeft&&(M=d?"rgb(255, 236, 183)":"blue",x.push(p),A.push(i-p),x.push(p+h),A.push(i-p),x.push(p),A.push(i-(p+h))),u.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...g},...k,children:u.jsx("path",{d:`M ${x[0]} ${A[0]} L ${x[1]} ${A[1]} L ${x[2]} ${A[2]} L ${x[0]} ${A[0]} Z`,fill:m??M,...v})})}),vr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:d,style:m,...v}=e,g=o.useMemo(()=>{let M=null;const x=l.getSortField();x&&(M=x.reverse);const A=l.getField(),D=A&&A.criteria&&A.criteria.length>0;return M===!0?D?"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":M===!1?D?"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":D?"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 7.4533523,10.606423 2.2001838,4.9460198 2.966932,4.1188401 7.4533523,8.9589099 11.933438,4.1188401 12.700184,4.9460198"},[l]),[k,h]=o.useState(!1),p=Math.min(Math.min(18,t.height-8),t.width);return u.jsx("div",{style:{width:`${p}px`,height:`${p}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${k&&!a?"--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:(p>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...m},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onMouseDown:M=>{d?.(M,l),M.preventDefault()},...v,children:u.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${k&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:u.jsx("path",{d:g})})})},Cr=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:d,zoom:m=1,view:v,bodyStyle:g,normalStyle:k,showFormulas:h,showZeros:p,docTheme:M,onLinkMouseDown:x,onFilterButtonMouseDown:A,filterButtonProps:D,createFilterButton:G=vr,...U}=e,F=i.height/m,V=i.width/m,y=t,w=y.getValue(),R=t.getStyle(),j=g?.darkMode??!1;let I,E;const W=w&&w.isFormulaError,_=W&&w instanceof s.FormulaError.Parse;let P,B=h||_;if(B)if(y.isSpillOverflow())E="";else{const ze=y.getFormulaText();ze?E=ze:I=y.getNumberFormat(s.NumberFormat.Type.General)}else I=y.getNumberFormat();B||(P=y.getTextOverflow());const K=P?P.colBounds.width+P.leftOffset+P.rightOffset:V,ne=P?P.anchorBounds.x-P.leftOffset:0,L=P?P.anchorBounds.width:V,z=P?P.anchorBounds.x:0;let ae,ve=y.getRenderHorizontalAlignment();I&&(ae=I?.formattedRuns,E=ae?.runs[0]?.text??I.displayText);const Pe=y.getCalcStatus()===s.ICell.CalcStatus.Pending;let Se=null,ue=R.getFill().toCSS(j,i),Re=0,Ke=0;if(!R.getBorder().isEmpty()){const ze=R.getBorder().getRight();!ze.isNone()&&s.IBorder.BuiltInDefinitions.get(ze.getStyle()).width>1&&(Re=1);const S=R.getBorder().getBottom();!S.isNone()&&s.IBorder.BuiltInDefinitions.get(S.getStyle()).width>1&&(Ke=1)}let $e=null;if(V!==L||Re||Ke||typeof ue?.backgroundPosition=="number"){const{backgroundPosition:ze,...S}=ue,le=ze??0,O=v?.getScrollTopLeft(),Y=le?-(i.x+(O.left??0))%le:0,c=le?-(i.y+(O.top??0))%le:0;(ze!==void 0||Re||Ke||V!==L)&&(Object.keys(S).length===1&&S.background==="none"||(ue=null,$e=u.jsx("div",{className:"fill",style:{marginLeft:`${Y}px`,marginTop:`${c}px`,left:z*m,width:r.ReactUtils.boundPixel(L*m-Y+1+Re),height:r.ReactUtils.boundPixel(i.height-c+1+Ke),...S}},"background")))}let Ie=null;const me=y.getComments(),$=y.getWarnings(),Ae=y.getErrors();if(me||W||Ae.length>0||$.length>0){const ze={size:7*m,darkMode:j,cellWidth:L*m+2,cellHeight:F*m+2,style:{top:-1,left:z*m-1}};Ie=Ie??[],($.length>0||Ae.length>0||W)&&Ie.push(u.jsx(go,{anchorLocation:ge.AnchorLocation.TopLeft,...ze},`indicator-${Ie.length}`)),me&&Ie.push(u.jsx(go,{anchorLocation:ge.AnchorLocation.TopRight,...ze},`indicator-${Ie.length}`))}const Ce=R.getFont();let J=I?.conditionalColor;const Z=R.getAlignment(),re=Z.getHorizontal()===s.ITextFrame.HorizontalAlignment.Fill,oe=Z.getHorizontal()===s.ITextFrame.HorizontalAlignment.CenterContinuous||re,he=oe||B?0:Z.getRotation(),Me=y.getInsets(),de=Me.top+Me.bottom;let be=Me.left,xe=Me.right;const Fe={...l,left:l.left-1,top:l.top-1,width:l.width+1+Re,height:l.height+1+Ke},f=y.getColumnFilter(),Le=f&&!f?.hasHiddenButton();let Xe=null;Pe&&(Xe=u.jsxs("div",{className:"slider",children:[u.jsx("div",{className:"line"}),u.jsx("div",{className:"subline inc"})]},"pending"));const Ue=!(Pe||Le||$e||a||Ie||ae?.runs.length>1||P||he%360!=0);ue?.background==="none"&&(ue=null);let Q=oe||!(!P||!(P.rightIndex>0||P.leftIndex>0||P.colSpan>1));if(!Q){const ze=y.getSpans();(ze.width>1||ze.height>1)&&(Q=!0)}const qe={...ue,...Fe,pointerEvents:x?"auto":void 0};if(!ge.CommonUtils.isEmpty(E)||!ge.CommonUtils.isEmpty(I?.repeatPlaceholder)){const ze=I?.canWrap??!1;let S=null,le=null,O=null,Y=[],c=!0;p||B||w!==0||(c=!1);const q=y.getTextFrame(B);if(c&&q){let T=K-1-(be+xe);if(he){S=q.layout().bounds;const ye={x:0,y:0,width:K-1,height:F};if(ae){let fe=ae.width;if(I.repeatPlaceholder||I.repeatChars.length>0){const pe=s.GeomUtils.boundsToPoints(ye),we=s.GeomUtils.rotatePoints(pe,-he);fe=s.GeomUtils.minBoundingRect(we).width}S={...S,width:fe}}O=s.GeomUtils.clipToOuterRect({...S,width:S.width+1+be+xe},ye,he),T=O.width-1-(be+xe)+.01}let b=null;ze&&(b={width:T});let N=null,C=I?.repeatPlaceholder;const H=q.layout(b);if(S=H.bounds,B?S={...S,width:0}:ae&&(S={...S,width:I.repeatPlaceholder||I.repeatChars.length>0?T:ae.width}),he&&ze){let ce=null;H.visitLines({visitTextLine:(ye,fe)=>{let pe=ye.bounds;const we=s.GeomUtils.boundsToPoints(pe),Be=s.GeomUtils.rotatePoints(we,he),Ne=s.GeomUtils.minBoundingRect(Be);pe={...pe,x:(Ne.width-pe.width)/2,y:(Ne.height-pe.height)/2},ce=ce?s.GeomUtils.unionBounds(ce,pe):pe}}),S={...ce,width:ce.width+be+xe}}if(!C&&y.getType()!==s.ScalarType.String&&Math.floor(S.width)>T){if(R.getNumberFormat()==="General"&&y.getType()===s.ScalarType.Number){const ce=R.measureText("0"),ye=Math.floor(T/ce.width),fe=w,pe=ge.CommonUtils.splitNumber(fe),we=Math.min(10,ye-(Math.max(1,pe.ipLength)+1)-(fe<0?1:0));if(we>=-1){const Be=`0${we>0?".":""}${"#".repeat(Math.max(0,we))}`;N=y.getNumberFormat(Be).displayText,N==="0"&&fe<0&&(N="-0")}else if(Math.abs(fe)>=Math.pow(10,5)||Math.abs(fe)<=Math.pow(10,-5)){const Be=ye-5-(fe<0?1:0);if(Be>=0){const Ne=`0.${"0".repeat(Math.max(0,Be-1))}E+00`;N=y.getNumberFormat(Ne).displayText}}}N||(C="#")}if(!C&&ae?.lastRepeatIndex>=0&&ae?.width>T&&(C="#"),C&&T>0){const ce=R.measureText(C),ye=Math.floor((T||1)/(ce?.width||1));N=ye>0?C.repeat(ye):""}if(B&&(ve=s.ITextFrame.HorizontalAlignment.Left),N){const ce=R.measureText(N).width;ce&&(S={...S,width:ce})}if(le={...S,width:S.width+be+xe,height:S.height},he&&!ze){const ce=s.GeomUtils.boundsToPoints(le),ye=s.GeomUtils.rotatePoints(ce,he),fe=s.GeomUtils.minBoundingRect(ye);le.width=fe.width,le.height=fe.height}ve===s.ITextFrame.HorizontalAlignment.Center||ve===s.ITextFrame.HorizontalAlignment.CenterContinuous?le.x=(K-le.width)/2:ve===s.ITextFrame.HorizontalAlignment.Right?le.x=K-le.width-.5:le.x=.5,Z.getVertical()===s.ITextFrame.VerticalAlignment.Center?le.y=(F-le.height)/2:Z.getVertical()===s.ITextFrame.VerticalAlignment.Bottom?le.y=F-le.height-de:le.y=de;const X=Ue?{...U}:void 0,te={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:he?`rotate(${he}deg)`:void 0,cursor:x?"pointer":void 0,pointerEvents:x?"auto":void 0,zIndex:Q?1:void 0,...ue},onMouseDown:x,onDoubleClick:x?ce=>{ce.stopPropagation(),ce.preventDefault()}:null,...X};_&&(te.style.textDecorationStyle="wavy",te.style.textDecorationColor=j?"rgb(0, 255, 255)":"red",te.style.textDecorationLine="underline");const ie=Ce.getSize(),se=(ce,ye,fe,pe,we,Be,Ne,We=null)=>{let Ve=ie*m,Ge=fe,Oe=Ne?.runs?Ne.runs:[{type:s.NumberFormat.ParseRunType.Text,text:ce,width:R.measureText(ce,Ve).width}];Ne&&Ne?.width!==S.width&&(S={...S,width:Ne?.width});let Ye=be;if(Ne?.lastRepeatIndex>=0&&T>Ne?.width){const _e=Ne.runs[Ne.lastRepeatIndex];if(_e){const rt=[...Oe],vt=Math.max(0,T-1-Ne.width);let wt=0,Ct="";if(vt>0){const gt=Math.floor(vt/_e.width);Ct=gt>0?_e.text.repeat(gt):"",wt=vt}rt[Ne.lastRepeatIndex]={type:s.NumberFormat.ParseRunType.Repeat,text:Ct,width:wt},Oe=rt,S={...S,width:Ne.width+wt}}}const it=(_e,rt,vt,wt,Ct,gt,lt,It,jt,Jt=null)=>{let Dt,Qt=Ge.width;we===s.ITextFrame.HorizontalAlignment.Justify?(Qt=Ct,Be||(Dt="justify")):we===s.ITextFrame.HorizontalAlignment.Distributed&&(Qt=Ct,Dt=Be||_e.text.split(" ").length-1==0?"center":"justify");const{style:Tt,className:xn,...bt}=Jt;let Bt=_e.text;if(we===s.ITextFrame.HorizontalAlignment.Fill&&I?.repeatChars.length===0){const at=Math.max(1,Math.floor((Ge?.width??0)/(lt?.width??1)));Bt=Bt.repeat(at)}let en=Ge.height;const Mt=Ce.getVerticalAlignment(),zt=Mt===s.IFont.VerticalAlignment.Sub,qn=Mt===s.IFont.VerticalAlignment.Super;if(zt||qn){const at=Ce.getSuperSubScale();Ve*=at,en*=at}const nt={textAlign:Dt,textAlignLast:Dt,...Tt,...Ce.toCSS(j,m,!0),fontSize:Ve*s.IFont.getDeviceScale()};Ue||(nt.background=void 0),J&&(nt.color=J.toCSS(j));const Sn=Ye+rt;let Vt=Me.top+Ge.y+0;if(zt&&(Vt+=jt-Ve),gt){const at=(lt.x+Sn)*m+1,mt=(lt.y+Vt)*m+1;mt<0?nt.marginTop=mt:nt.paddingTop=mt,at<0?(nt.width=(Tt?.width??0)-at,nt.left=(Tt?.left??0)+at):nt.paddingLeft=at,nt.paddingRight=Math.max(0,(Tt?.width??0)-Qt*m-at),nt.paddingBottom=Math.max(0,(Tt?.height??0)-Ge.height*m-mt),nt.height=(Tt?.height??0)+(mt<0?-mt:0),(mt<0||at<0)&&(nt.clipPath=`inset(${mt<0?-mt:0}px 0px 0px ${at<0?1-at:0}px)`)}else if(nt.left=(lt.x+Sn)*m+1,nt.top=(lt.y+Vt)*m+1,nt.width=lt.width*m,nt.height=lt.height*m,he&&!ze){nt.left=(lt.x+rt)*m+1,nt.top=(lt.y+(Ge.y+0))*m+1;const at=s.GeomUtils.centerPoint({x:Ye+rt,y:0,width:_e.width,height:Ge.height}),mt=s.GeomUtils.centerPoint({x:Ye,y:0,width:Ct,height:Ge.height}),nn=s.GeomUtils.rotatePoints([at],he,mt),on={x:nn[0].x-at.x,y:nn[0].y-at.y};nt.left=nt.left+on.x*m,nt.top=nt.top+on.y*m;const Pt={...Ge,x:Ye,y:Me.top,width:Ge.width+(be+xe)},Wn=s.GeomUtils.boundsToPoints(Pt),Gn=s.GeomUtils.rotatePoints(Wn,he),Ht=s.GeomUtils.minBoundingRect(Gn);Pt.width=Ht.width,Pt.height=Ht.height;const Rn=s.GeomUtils.centerPoint(Pt),Ut={x:Rn.x-mt.x,y:Rn.y-mt.y};nt.left=nt.left+Ut.x*m,nt.top=nt.top+Ut.y*m}nt.lineHeight=en*m+"px";const tn=Ue?void 0:"text-line";Y.push(u.jsx("div",{className:xn?`${xn} ${tn}`:tn,style:nt,...bt,children:Bt},`text-${Ge.y}-${wt}-${vt}`))};if(Z.getOverflow()===s.ITextFrame.Overflow.Shrink&&T>0){let _e=S?.width??0,rt=0;for(;_e>1&&_e>T&&Ve>2&&rt<100;)Ve*=T/_e,_e=R.measureText(ce,Ve).width,rt++;S={...S,width:_e}}let pt=Ge.x;we===s.ITextFrame.HorizontalAlignment.Right?pt+=S.width-Ge.width:we!==s.ITextFrame.HorizontalAlignment.Center&&we!==s.ITextFrame.HorizontalAlignment.CenterContinuous||(pt+=(S.width-Ge.width)/2),Ne?.lastRepeatIndex>=0&&(pt=Ge.x);const xt=Oe.length;for(let _e=0;_e<xt;_e++){const rt=Oe[_e];(rt.type===s.NumberFormat.ParseRunType.Text||rt.type===s.NumberFormat.ParseRunType.Repeat)&&(rt.type,s.NumberFormat.ParseRunType.Repeat,it(rt,pt,_e,ye,we===s.ITextFrame.HorizontalAlignment.Justify||we===s.ITextFrame.HorizontalAlignment.Distributed||Ne?.lastRepeatIndex>=0?T:Ge.width,Ue,{x:le.x+ne,y:le.y,width:rt.width,height:S.height},0,pe,We)),pt+=rt.width}};N?se(N,0,{x:0,y:0,...S},H.lines[0].baseline,ve,!0,null,te):H.visitLines({visitTextLine:(ce,ye,fe)=>{const pe=ce.runs[0].text.replace(/\s+$/,""),we=ye===fe-1;let Be=ve===s.ITextFrame.HorizontalAlignment.Justify&&(we||ce.runs[0].text.endsWith(`
8
+ `))?s.ITextFrame.HorizontalAlignment.Left:ve,Ne=0;ye>0&&(Z.getVertical()===s.ITextFrame.VerticalAlignment.Distributed||Z.getVertical()===s.ITextFrame.VerticalAlignment.Justify)&&(Ne=Math.max(0,(F-(de+3)-ce.bounds.height*fe)/(fe-1)*ye)),Z.getVertical()===s.ITextFrame.VerticalAlignment.Distributed&&he&&he%90==0&&he%180!=0&&(Be=s.ITextFrame.HorizontalAlignment.Distributed),Be!==s.ITextFrame.HorizontalAlignment.Justify&&Be!==s.ITextFrame.HorizontalAlignment.Distributed&&Be!==s.ITextFrame.HorizontalAlignment.Fill||(S={...S,width:T});let We=re||I&&(I.repeatChars.length>0||I.spacingChars.length>0)?S.width:ce.bounds.width;const Ve={...ce.bounds,y:ce.bounds.y+Ne+0,width:We};se(pe,ye,Ve,q.lines[0].baseline,Be,we,fe===1?ae:null,Ue&&ye>0?{...te,style:{...te.style,background:void 0}}:te)}})}Y.length>0&&(Se=Y)}if(Ue)return Se&&Se.length>0?Se:u.jsx("div",{style:qe,...U});let je=x?"auto":Fe.pointerEvents,Te=null;if(Le){const ze={x:z*m-1,y:-1,width:L*m+1,height:F*m+1};je="auto",Te=G({renderBounds:ze,darkMode:j,className:"filter-button",disabled:!y.isEditAllowed(),zoom:m,filter:y.getColumnFilter(),onFilterButtonMouseDown:A,...D}),Te&&(Te=u.jsx("div",{style:{...ze,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:S=>{S.stopPropagation(),S.preventDefault()},children:Te},"filterButton"))}Pe&&!Se&&(Se=u.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 De=[$e,Se,a,Ie,Xe,Te];return u.jsx("div",{style:{...ue,...Fe,pointerEvents:je},...U,children:De})},Fo={text:"",placeholder:""},Ao=(e,t)=>{if(!e.clean().getStyle().getNumberFormat().endsWith("%"))return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},yl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),br=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:d,onDoneEdit:m,defaultTextStyle:v,useRichStyling:g=!0,bodyStyle:k,activeCoords:h,sheet:p,commands:M,containerBounds:x,setNaturalDimensions:A,onFocus:D,disabled:G,style:U,zoom:F=1,linesVisible:V,autoFocus:y=!1,...w}=e,{height:R=0,width:j=0}=x??{},I=k?.darkMode??!1,E=o.useRef(null),[W,_]=o.useState(!1),[P,B]=o.useState(null),[K,ne]=o.useState(()=>n);o.useEffect(()=>{Ke.current=!1,ne(n)},[n]);const L=o.useMemo(()=>{const S=K.clean();let le=S.getStyle();g||(le=le.createTemporaryStyle({font:{size:v?.fontSize}}));const O=S.getFormula(),Y=le.getAlignment(),c=O?s.ITextFrame.HorizontalAlignment.Left:Y.getHorizontal(),q=Y.getVertical(),T=Y.getOverflow()===s.ITextFrame.Overflow.Wrap||S.getType()===s.ScalarType.String&&(c===s.ITextFrame.HorizontalAlignment.Justify||c===s.ITextFrame.HorizontalAlignment.Distributed||q===s.ITextFrame.VerticalAlignment.Justify||q===s.ITextFrame.VerticalAlignment.Distributed),b=(H=>{if(!H)return Fo;const X=H.clean();if(!X)return Fo;let te=X.getStyle()?.getQuotePrefix();if(H.dirty===void 0||H.dirty===null){let ie="",se=X.getFormulaText();se&&(ie=se,te=!1),ie||(ie=X.toTextUnformatted(!0)??"");let ce="";if(!H.editMode&&X.isSpillOverflow()){const ye=X.getSpill();if(ye){const fe=ye.getCell(),pe=fe.getFormulaText();fe.isEqual(X)||(ce=pe)}}return te&&(ie="'"+ie),{text:ie,placeholder:ce}}return{text:H.dirty??"",placeholder:""}})(K),N=b.text,C=s.ITextFrame.toCSSHorizontalTextAlign(g&&!O?K.clean()?.getRenderHorizontalAlignment():s.ITextFrame.HorizontalAlignment.Left);return{style:le,isWrapped:T,textValue:N,formula:O,frameVertAlign:q,placeholder:b.placeholder,insets:g?S.getInsets():ge.TypesUtils.EmptyRect,textAlign:C}},[K,v,I,F,g]),z=o.useRef(null),ae=r.useImperativeElement(t,()=>({startEdit:S=>{E.current=S?.initialSelection;const le={...n,editMode:S?.editMode??!1};S?.text!==void 0&&(le.dirty=S.text),le.editMode===n.editMode&&le.dirty===n.dirty||(ne(le),Se?.(le))},submitEdit:()=>$e(),cancelEdit(){Ie()},autoFocus(){z.current.focus()},dispatchEvent:S=>z.current.dispatchEvent(S),focus(){z.current.focus()},getLineHeight:Pe}),[i,n]);o.useLayoutEffect(()=>{if(!P||!W)return;const S=z.current;L.textValue,S&&S.setSelectionRange(P.start,P.end,P.direction)},[z.current,P,L.textValue]);const ve=o.useMemo(()=>{const S=K?.clean(),le=L.style.createTemporaryTextFrame(L.textValue,S?.getType()===s.ScalarType.String),O=g?S.getInsets().right+S.getInsets().left:0;let Y=null;return L.isWrapped&&(Y={width:j-O}),le.layout(Y)},[L,j,K,g]),Pe=r.useCallbackRef(()=>Math.ceil(ve?.lines[0]?.bounds.height),[ve]);o.useLayoutEffect(()=>{if(!ve)return;const S=L.style,le=S.getInsets()??ge.TypesUtils.EmptyRect,O=g?le.left+le.right:0,Y=g?.04*S.getFont().getSize():1,c=Math.round(L.isWrapped?void 0:ve.bounds.width+O+Y),q=Math.round(ve.bounds.height);A?.({width:c,height:q})},[ve,A,L,g,K]);const Se=r.useCallbackRef(a,[a]),ue=r.useCallbackRef(S=>{if(K.dirty===S)return;const le={...K};le.dirty=S,z.current,ne(le),Se?.(le)},[K]),Re=r.useCallbackRef(S=>{if(K.editMode===S)return;const le={...K};le.editMode=S,ne(le),Se?.(le)},[K]),Ke=o.useRef(!1),$e=r.useCallbackRef(()=>{if(Ke.current)return!1;try{l?.(K),m?.(),Ke.current=!0}catch{return!1}return!0},[l,K]),Ie=r.useCallbackRef(()=>{Ke.current=!0,ne(n),d?.(),m?.()},[d,n]),me=r.useCallbackRef(S=>{if(!z.current)return;if(S.key,S.isDefaultPrevented(),!(S.isTrusted||S.nativeEvent.ctrlKey||S.nativeEvent.metaKey||S.nativeEvent.altKey||S.nativeEvent.isComposing||dt.STANDARD_KEY_CHARS.indexOf(S.nativeEvent.key)===-1&&S.nativeEvent.key!=="Backspace")){const b={...K};let N=0;return Ao(b,b.dirty)&&!isNaN(parseFloat(S.key))?(b.dirty?.endsWith("%")?b.dirty=(b.dirty.substring(0,b.dirty.length-1)??"")+S.key+"%":b.dirty=(b.dirty??"")+S.key+"%",N=b.dirty.length-1):S.nativeEvent.key==="Backspace"?(b.dirty="",N=b.dirty.length):(b.dirty=(b.dirty??"")+S.key,N=b.dirty.length),z.current.value=b?.dirty,E.current={start:N,end:N,direction:"forward"},z.current?.setSelectionRange(N,N,"forward"),ne(b),Se?.(b),void S.preventDefault()}const le=S.nativeEvent.ctrlKey,O=S.nativeEvent.shiftKey,Y=S.nativeEvent.altKey,c=S.nativeEvent.metaKey;if(le&&S.key==="z"&&S.stopPropagation(),S.which===r.KeyCodes.Escape)return S.preventDefault(),void Ie();if(S.which===r.KeyCodes.F2)return Re(!0),void S.preventDefault();const q=S.target;if(S.key==="%"&&q.selectionStart===q.selectionEnd&&q.value[q.selectionStart]==="%"&&K?.clean().getStyle().numberFormat.includes("%"))return B({start:q.selectionStart+1,end:q.selectionEnd+1,direction:q.selectionDirection}),void S.preventDefault();if(S.which===r.KeyCodes.Enter){if(S.preventDefault(),c||Y){const b=L.textValue.substring(0,q.selectionStart)+`
9
+ `+L.textValue.substring(q.selectionEnd);return ue(b),void B({start:q.selectionStart+1,end:q.selectionStart+1,direction:q.selectionDirection})}return void($e()&&p.getSelection().traverse(s.IRange.Orientation.Column,O))}if(S.which===r.KeyCodes.Tab)return S.preventDefault(),void($e()&&p.getSelection().traverse(s.IRange.Orientation.Row,O));let T=null;switch(S.which){case r.KeyCodes.Left:T=s.IRange.Direction.Left;break;case r.KeyCodes.Right:T=s.IRange.Direction.Right;break;case r.KeyCodes.Up:T=s.IRange.Direction.Up;break;case r.KeyCodes.Down:T=s.IRange.Direction.Down}if(T&&!(le||O||Y||c)&&!K.editMode)return void $e();K.editMode&&(T||yl.includes(S.which))&&S.stopPropagation()},[K,p,L]),$=o.useCallback(()=>{z.current?.focus(),setTimeout(()=>{z.current?.select()},0)},[]),Ae=o.useCallback(()=>{z.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Ce=r.useCallbackRef(()=>{const S=z.current?.value;let le="";if(h.rowIndex>0){const O=p.getRange({rowIndex:h.rowIndex-1,colIndex:h.colIndex}).getCell();O&&(le=O.toTextUnformatted(!0))}ue(S+le)},[h,p]);o.useEffect(()=>p.getRange(h).addListener(()=>{const S={...K,clean:()=>p.getRange(h).getCell()};ne(S),Se?.(S)}),[h,p,K]);const J=o.useCallback(()=>{const S=K.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Medium Time"}}).toText();ue((z.current?.value??"")+S)},[p]),Z=o.useCallback(()=>{const S=K.clean().createTemporaryCell({value:fn(),style:{numberFormat:"Short Date"}}).toText();ue((z.current?.value??"")+S)},[p]),re=o.useMemo(()=>({element:()=>z.current,doCopy:S=>{const le=z.current.value.substring(z.current.selectionStart,z.current.selectionEnd);if(S?.isCut){const O=z.current.value.substring(0,z.current.selectionStart)+z.current.value.substring(z.current.selectionEnd,z.current.value.length);ue(O)}return le}}),[z.current]),oe=o.useMemo(()=>({element:()=>z.current,doPaste:async(S,le)=>{const O=await S.toText?.();if(!O)return!0;const Y=z.current.value.substring(0,z.current.selectionStart)+O+z.current.value.substring(z.current.selectionEnd,z.current.value.length);return ue(Y),B({start:z.current.selectionStart+O.length,end:z.current.selectionStart+O.length,direction:"forward"}),!0}}),[z.current]),he=o.useMemo(()=>({contains:S=>z.current?.contains(S)||!1,focus(){z.current.focus()}}),[]),Me=o.useMemo(()=>[new r.SimpleCommand("selectAll",he,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},$),new r.SimpleCommand("startEditValueAbove",he,{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:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},Ce),new r.SimpleCommand("startEditCurrentTime",he,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},J),new r.SimpleCommand("startEditCurrentDate",he,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},Z),new r.Command("relativeReferencesToggle",he,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},Ae),new r.Command("toggleEditorFocus",he,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),de=o.useMemo(()=>{let S=null;const le=()=>({contains:O=>z.current?.contains(O)||!1,focus(){z.current.focus()}});return S=M?M.createChildGroup(le,"editor",!1):new r.CommandGroup(le,"editor"),S.addCommands(Me,!0),S},[M,Me]),be=o.useMemo(()=>({notifier:null,source:re,target:oe,commands:de}),[re,oe,de]);r.useCopyPaste(be);const[xe,Fe]=o.useState(!y);o.useEffect(()=>{Fe(!1)},[]);const f=r.useCallbackRef(S=>{_(!0),de?.activate();const le=E.current;if(le!==!1){let O,Y;const c=z.current.value;Ao(K,c)&&(O=c.length-1,Y=c.length-1),O=le?.start??O??c.length,Y=le?.end??Y??c.length,E.current=!1,B({start:O,end:Y,direction:"forward"})}D?.(S)},[D,K]),Le=L.insets;let Xe=Le.left+1;const Ue=Le.left+Le.right+2-1,Q=ve?.bounds.height??0;let qe,je=Le.top;L.frameVertAlign===s.ITextFrame.VerticalAlignment.Center?je=Math.max(0,(R-(Le.top+Le.bottom)-Q)/2):L.frameVertAlign===s.ITextFrame.VerticalAlignment.Bottom&&(je=Math.max(0,R-(Le.top+Le.bottom)-Q)),V!==void 0&&ve?.lines[0]?.bounds&&(qe=ve?.lines[0]?.bounds.height*V);const Te=L.style.getFont();let De=Te.getSize();Te.isSuperSub()&&(De*=Te.getSuperSubScale()),De*=s.IFont.getDeviceScale()*F;const ze=g?Te.toCSS(I,F):null;return u.jsx("div",{className:"sheet-cell-editor",onMouseDown:S=>{z.current&&document.activeElement!==z.current&&requestAnimationFrame(()=>{z.current.focus()})},ref:ae,...w,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...U},children:u.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:je*F+1,left:Xe*F,width:`calc(100% - ${Ue*F}px)`,maxWidth:`calc(100% - ${Ue*F}px)`,height:(qe??Q)*F,maxHeight:(qe??Q)*F},children:u.jsx("textarea",{spellCheck:"false",placeholder:L.placeholder,ref:z,value:L.textValue,disabled:xe,readOnly:G||p.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...ze,fontSize:De?`${De}px`:"inherit",textAlign:L.textAlign,lineHeight:(ve?.lines[0]?.bounds.height??0)*F+"px",height:(ve?.bounds.height??0)*F,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:L.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:f,onBlur:()=>{_(!1)},onSelect:S=>{},onChange:S=>{z.current&&!Ke.current&&(E.current=!1,ue(S.target.value),L.textValue,S.target.value,S.target.selectionStart,S.target.selectionEnd,S.target.selectionDirection,B({start:S.target.selectionStart,end:S.target.selectionEnd,direction:S.target.selectionDirection}))},onMouseDown:S=>{W&&Re(!0)},onKeyDown:me})})})})),yr=(e,t)=>({clean:e,dirty:t,editMode:!1}),wr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:d=!1,offsetX:m=0,offsetY:v=0,isVertical:g=!1,...k}=e,h=U=>{let F=null;if(U&&n>0){F="";for(let V=0;V<U.length;V++)F+=U[V],V<U.length-1&&(F+=",")}return F},p=h(i);let M=p;a&&(M=h(a));let x=n,A=t,D=null;if(l){x=Math.floor(n/2);const U=x+x/2+1;let F=null;F=g?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(v)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(v+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(v+U)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(v+U)}`,D=u.jsx("path",{strokeWidth:x,strokeDasharray:M,d:F,...k})}if(d){x=n/2;const U=x+x/2;let F=M,V=null;V=g?`M ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(v)} L ${r.ReactUtils.boundPixel(m+U)} ${r.ReactUtils.boundPixel(v+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(v+U)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(v+U)}`,D=u.jsx("path",{strokeWidth:x,strokeDasharray:F,strokeDashoffset:"1",shapeRendering:"crispEdges",d:V,...k})}let G=null;return G=g?`M ${r.ReactUtils.boundPixel(m+x/2)} ${r.ReactUtils.boundPixel(v)} L ${r.ReactUtils.boundPixel(m+x/2)} ${r.ReactUtils.boundPixel(v+A)}`:`M ${r.ReactUtils.boundPixel(m)} ${r.ReactUtils.boundPixel(v+x/2)} L ${r.ReactUtils.boundPixel(m+A)} ${r.ReactUtils.boundPixel(v+x/2)}`,u.jsxs(u.Fragment,{children:[u.jsx("path",{strokeWidth:x,strokeDasharray:p,d:G,...k}),D]})};function oo(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Zt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=oo(i,t),l=typeof a=="function";n.push(l?a:()=>oo(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)oo(n,t)}},wl=function(){},xr=typeof window<"u",cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xl=xr?o.useLayoutEffect:o.useEffect,Do={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Lt=xr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(Do),a=i[0],l=i[1],d=o.useMemo(function(){return new window.ResizeObserver(function(m){if(m[0]){var v=m[0].contentRect,g=v.x,k=v.y,h=v.width,p=v.height,M=v.top,x=v.left,A=v.bottom,D=v.right;l({x:g,y:k,width:h,height:p,top:M,left:x,bottom:A,right:D})}})},[]);return xl(function(){if(t)return d.observe(t),function(){d.disconnect()}},[t]),[n,a]}:function(){return[wl,Do]},ql=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,Sl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Rl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:d=!1,shiftIfWide:m=!1,isVertical:v=!1,intersections:g,layout:k}=e,h=s.IBorder.BuiltInDefinitions.get(d?s.IBorder.StrokeStyle.Thin:a.getStyle());if(!h)return null;const p=n[0],M=n[1],x=n[2],A=n[3];let D=1+(v?A-M:x-p),G=0;const U=a.getColor().toRGBA(l).toString(),F=h.description.toLowerCase().includes("double");let V,y;const w=v?"rowStart":"colStart",R=v?"rowEnd":"colEnd",j=v?M:p;if(g?.length>0){const _=g[0];if(_?.range[w]===i[w]){const B=s.IBorder.BuiltInDefinitions.get(_.stroke.getStyle());G=Math.floor(B.width/2)}if(g[g.length-1]?.range[R]===i[R]){const B=s.IBorder.BuiltInDefinitions.get(g[g.length-1].stroke.getStyle());D=Math.floor(D+(B.width===2?0:B.width/2))}if(F){const B=v?"colStart":"rowStart",K=v?"colEnd":"rowEnd",ne=v?k?.getRowOffset:k?.getColOffset;let L=0,z=0;V=[],y=[];for(let ae=0;ae<g.length;ae++){const ve=g[ae];if(ve.stroke.getStyle()===s.IBorder.StrokeStyle.Double&&ne){const Pe=ne(ve.range[w])-(j-G);ve.range[B]<i[B]&&(V.push(Pe-L),L=Pe,V.push(1),L++),ve.range[K]>i[K]&&(y.push(Pe-z),z=Pe,y.push(1),z++)}}V.length>0&&L<D&&V.push(D-L),y.length>0&&z<D&&y.push(D-z)}}let I=v?-Math.floor(h.width/2):-G,E=v?-G:-Math.floor(h.width/2);const W=m&&h.width>2?-1:0;return u.jsx(wr,{offsetX:p+I+W,offsetY:M+E+W,length:D+G,isVertical:v,stroke:U,width:h.width,dashArray:V??h.pattern,dashArrayAdditional:y,isDouble:F,isAngled:h.description.toLowerCase().includes("slant")},t)},bo=({getBorderAt:e,borderRenderer:t=Rl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:d=!1})=>{const m=r.useCallbackRef(n,[n]);return{overlay:o.useMemo(()=>g=>{const k=g.toClipBounds(g.getRangeCoordsBounds(),-3);if(!k)return;const h=m(g);if(h.length===0)return;const p=g.getVisibleColumnOffsets(),M=g.getVisibleRowOffsets();let x=[],A=[];const D=g.getVisibleColumns(),G=g.getVisibleRows(),U=[],F=[],V=[],y=(I,E,W,_,P,B,K)=>{const ne={index:_,stroke:P,visibleIndex:W,edge:B,length:K};I[E]||(I[E]=[]),I[E].length>0&&I[E][I[E].length-1]?.index===_?I[E][I[E].length-1]=ne:I[E].push(ne)};for(let I=0;I<h.length;I++){const E=h[I],W=E.coords;if(!W)continue;const _=E?.range??{rowStart:W.rowIndex,colStart:W.colIndex,rowEnd:W.rowIndex,colEnd:W.colIndex},P=g.getVisibleRangeCoords();if(!ge.CoordUtils.isRangesIntersect(_,P)&&!ge.CoordUtils.isRangeWithinRange(_,P))continue;const B=W.colIndex,K=W.rowIndex,ne=p[B],L=M[K];if(_.rowEnd!==_.rowStart){const me=M[_.rowStart]?.spanIndex??-1,$=M[_.rowEnd]?.spanIndex??M[G[G.length-1]].spanIndex+1;x.push({..._,rowStart:me,rowEnd:$})}if(_.colEnd!==_.colStart){const me=p[_.colStart]?.spanIndex??-1,$=p[_.colEnd]?.spanIndex??p[D[D.length-1]].spanIndex+1;A.push({..._,colStart:me,colEnd:$})}const z=E.value,ae=e(z,I);if(!ae||ae.isEmpty())continue;const ve=ae.getLeft(),Pe=ae.getTop(),Se=ae.getRight(),ue=ae.getBottom();let Re=1,Ke=1;if(!ne||!L)continue;const $e=ne.spanIndex,Ie=L.spanIndex;ve.isNone()||y(U,$e,Ie,K,ve,s.IBorder.Edge.Left,Re),Pe.isNone()||y(F,Ie,$e,B,Pe,s.IBorder.Edge.Top,Ke),Se.isNone()||y(U,$e+Ke,Ie,K,Se,s.IBorder.Edge.Right,Re),ue.isNone()||y(F,Ie+Re,$e,B,ue,s.IBorder.Edge.Bottom,Ke)}const w=(I,E,W)=>{const _=[];return I.forEach((P,B)=>{let K=null;P.sort((ne,L)=>ne.visibleIndex-L.visibleIndex);for(let ne=0;ne<P.length;ne++){const L=P[ne];if(!L?.stroke||E[B]===void 0&&E[B-1]===void 0)continue;let z=!1;if(W)for(let Se=0;!z&&Se<x.length;Se++){let ue=x[Se];ue.colStart<=L.index&&ue.colEnd>=L.index&&ue.rowStart<B&&ue.rowEnd>=B&&(z=!0)}else for(let Se=0;!z&&Se<A.length;Se++){let ue=A[Se];ue.rowStart<=L.index&&ue.rowEnd>=L.index&&ue.colStart<B&&ue.colEnd>=B&&(z=!0)}if(z)continue;const ae=L.stroke?.getColor(),ve=ae?ae.toRGBA().toString():l,Pe=L.stroke.getStyle()+":"+ve;(Pe!==K?.key||K&&K.visibleIndex+1<L.visibleIndex)&&(K&&_.push(K),K={key:Pe,index:E[B]??E[B-1]+1,visibleIndex:L.visibleIndex,edge:L.edge,stroke:L.stroke,from:L.index,to:L.index+L.length-1,intersections:[],length:1}),K.to=L.index+L.length-1,K.visibleIndex=L.visibleIndex}K&&_.push(K)}),_};x=x.sort(Sl),A=A.sort(ql);const R=w(U,D,!1),j=w(F,G,!0);if(R.length===0&&j.length===0)return null;for(let I=0;I<j.length;I++){const E=j[I];let W=ge.CommonUtils.findEqualOrGreater(R,E.from,P=>P.index),_=!1;for(;!_;){const P=R[W++];P&&P.index>=E.from&&P.index<=E.to+1&&P.from<=E.index&&P.to+1>=E.index&&(E.intersections.push({stroke:P.stroke,range:{rowStart:P.from,rowEnd:P.to+1,colStart:P.index,colEnd:P.index}}),P.intersections.push({stroke:E.stroke,range:{rowStart:E.index,rowEnd:E.index,colStart:E.from,colEnd:E.to+1}})),_=!P||P.index>E.to+1}}for(let I=0;I<j.length;I++){const E=j[I];let W=E.stroke;const _=`rBorder:${E.index}:${E.from}:${E.to}:${E.edge}`,P={rowStart:E.index,rowEnd:E.index,colStart:E.from,colEnd:E.to+1},B=g.getLayout(),K=!1,ne=B.getColOffset(P.colStart),L=B.getRowOffset(P.rowStart),z=[ne,L,B.getColOffset(P.colEnd),L];V.push(t({key:_,points:z,stroke:W,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:E.intersections,layout:B,isVertical:K}))}for(let I=0;I<R.length;I++){const E=R[I];let W=E.stroke;const _=`cBorder:${E.index}:${E.from}:${E.to}:${E.edge}`,P={rowStart:E.from,rowEnd:E.to+1,colStart:E.index,colEnd:E.index},B=g.getLayout(),K=!0,ne=B.getColOffset(P.colStart),L=[ne,B.getRowOffset(P.rowStart),ne,B.getRowOffset(P.rowEnd)];V.push(t({key:_,stroke:W,points:L,darkMode:i,forceThinBorder:a,shiftIfWide:d,range:P,intersections:E.intersections,layout:B,isVertical:K}))}return u.jsx("svg",{width:`${k.width}`,height:`${k.height}`,viewBox:`0 0 ${k.width} ${k.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${k.width}px`,height:`${k.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:V},"borders")},[e,i])}},zo=ge.AnchorLocation.Center,kl=Object.freeze({horizontal:!1,vertical:!1}),No=ge.TypesUtils.EmptyTopLeft,Ml=(e,t)=>ge.CoordUtils.EmptyCell,Tl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),Il=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:d=2,darkMode:m,forceThinBorder:v,children:g,...k}=e,h=o.useRef(null),[p,{width:M,height:x}]=Lt(),A=n??M,D=i??x,G=o.useMemo(()=>{const K=[];for(let ne=0;ne<l;ne++)for(let L=0;L<d;L++){const z={colIndex:L,rowIndex:ne};K.push({coords:z,value:z})}return K},[]),U=o.useCallback(K=>G,[G]),{overlay:F}=bo({getVisibleCells:U,getBorderAt:t,darkMode:m,forceThinBorder:v}),V=Math.floor(A/d),y=Math.floor(D/l),w={getColOffset:K=>Math.ceil(K*V)+0,getRowOffset:K=>Math.ceil(K*y)+0,getColIndex:K=>Math.floor((K-0)/V)-1,getRowIndex:K=>Math.floor((K-0)/y)-1},R={rowStart:0,colStart:0,rowEnd:l,colEnd:d},j={x:0,y:0,width:Math.max(0,A)+0,height:Math.max(0,D)+0},I=o.useMemo(()=>{const K={},ne=Math.floor(A/d);for(let L=0;L<d;L++)K[L]={offset:L*ne,size:ne,spanIndex:L};return K},[A,D]),E=o.useMemo(()=>{const K={},ne=Math.floor(D/l);for(let L=0;L<l;L++)K[L]={offset:L*ne,size:ne,spanIndex:L};return K},[A,D]);if(!F)return null;const W={width:A,height:D},_={width:A,height:D},P={getStage:()=>h.current,getTotalSize:()=>W,getViewportSize:()=>_,getLayout:()=>w,getCellCoordsAsRangeCoords:ge.CoordUtils.cellToRange,getVisibleRangeCoords:()=>R,getVisibleRows:()=>{const K=[];for(let ne=0;ne<l;ne++)K.push(ne);return K},getTotalRangeCoords:()=>R,getRelativePointFromClient:(K,ne)=>({x:K,y:ne}),getVisibleColumns:()=>{const K=[];for(let ne=0;ne<d;ne++)K.push(ne);return K},toClipBounds:(K,ne)=>j,toViewBounds:K=>K,toAbsoluteBounds:K=>K,getBounds:()=>j,getInsets:()=>null,getRangeCoordsBounds:(K,ne)=>null,getVisibleColumnOffsets:()=>I,getVisibleRowOffsets:()=>E,allViews:()=>({[zo]:P}),getAnchor:()=>zo,getZoom:()=>1,scrollCellCoordsIntoView:Tl,getCellCoordsFromClient:Ml,getScrollOrientation:()=>kl,getScrollTopLeft:()=>No,getFreezeTopLeft:()=>No},B=F(P);return u.jsxs("div",{style:{...a,position:"relative",display:"flex"},...k,children:[u.jsx("div",{ref:Zt([h,p]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:g}),B]})});function qr(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=qr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function yt(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=qr(e))&&(i&&(i+=" "),i+=t);return i}const El="_sheetxl-sheet_1qeq6_5",Fl="_viewport-overlay_1qeq6_6",Sr=e=>{const{style:t,...n}=e??{};return u.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[u.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"}),u.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"}),u.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"}),u.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"}),u.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"})]})},Al=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:d,...m}=e??{},[v,g]=o.useState(null);o.useEffect(()=>{(async()=>{const y=await s.LicenseManager.getDetails();g(y)})()},[]);const[k,h]=o.useState(!1),p={opacity:.65},M=o.useMemo(()=>{const y=v?.exceptions(),w=y?.length??0;if(w===0)return null;const R=[];for(let j=0;j<w;j++){const I=y[j];R.push(u.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:I},j))}return R},[v,n]);if(v===null||v.isValidFor(l))return null;const x=v.type(),A=!M&&x.endsWith("ity"),D=v.licensee(),G=A?1.6:1,U=135/G,F=37/G;let V=null;return!x&&D?.length>0&&(V=u.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),u.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...d},...m,children:u.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[k?u.jsx(Sr,{style:p}):u.jsx("svg",{width:U,height:F,style:p,children:u.jsx("image",{style:{width:U,height:F},href:"https://www.sheetxl.com/watermark.svg",onError:()=>h(!0)})}),u.jsxs("div",{children:[V,M,u.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),tt=(e,t,n)=>{const i=o.useRef(t);i.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!i.current)return;const l=Object.keys(i.current),d={},m=l.length;for(let g=0;g<m;g++){const k=l[g];d[k]=(h,p)=>{i.current[k]?.(h,p)}}const v=e.addListeners(d,n);if(a)for(let g=0;g<m;g++)d[l[g]](e);return()=>{v?.()}},[e])},Tn=new s.Color("transparent");function Rr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,notifier:d,onStartEdit:m,getViewport:v}=e,[g,k]=o.useState(null),[h,p]=o.useState(null),M=o.useRef(null),x=r.useCallbackRef(m,[m]),A=r.useCallbackRef(v,[v]),[D,G]=o.useState(),[U,F]=o.useState(()=>t?.getStyles().parseColor(s.IColor.Scheme.Bg2)),[V,y]=o.useState(()=>t?.getStyles().getNormal().getFont().getFill()),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const R=r.useGlobalClipboard(),[j,I]=o.useState(ge.CommonUtils.EmptyArray),E=o.useCallback(()=>{if(M.current!==t)return;const c=t.getSelectedRanges();let q=null;j.length>0&&ge.CoordUtils.isCellWithinRange(g,j[0].getRange().getCoords())&&(q=j[0]);const T=t?.getSelectedCell(),b=T?.getCoords()??null;Nt.unstable_batchedUpdates(()=>{ve(q),k(b),p(c)})},[t,j,h,g]),W=o.useCallback(ge.CommonUtils.debounce(E,210),[E]);o.useEffect(()=>{M.current=t,E()},[t]);const _=r.useCallbackRef(()=>t.getRange(g).getCell(),[t,g]),P=r.useCallbackRef(async(c,q,T=null,b=!1,N=!0)=>{const C=c?.label?.(),H=async()=>{const se=await Promise.resolve(N&&d?.showBusy?.(C??"Busy..."));try{await t.doBatch(async()=>q(t),C),b&&w.setMode(null),se&&se()}catch(ce){if(se&&se(),!ce)return;d?.showError?.(ce)}},X=[];let te=!1;const ie=async()=>(X.push(H),(async()=>{if(!te){for(te=!0;X.length>0;){const se=X.shift();se&&await se()}te=!1}})());if(n){let se=null;if(T!==!1&&c){const ce=T??C;se=new r.SimpleCommand(c.key(),l,{label:ce,description:ce},ie)}n(se)}return ie()},[t,n,d]),B=r.useCallbackRef((c,q,T=!1,b)=>P(c,N=>{const C=N.getSelectedRanges();T&&C.updateStyle(null,b),C.updateStyle(q,b),C.autoFit({expandOnly:s.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[t]),K=r.useCallbackRef((c,q,T)=>{P(c,b=>{let N=q;(T||q?.address)&&(N=N??{},!T&&q?.address?.startsWith("#")?T=q?.address.substring(1):T&&(N.displayText=T)),b.getSelectedRange().setHyperlink(N)})},[t]),ne=r.useCallbackRef((c,q)=>{P(c,T=>{T.getSelectedRange().setComments(q)})},[t]),L=r.useCallbackRef((c,q)=>{P(c,T=>{T.getSelectedRanges().clear(q)})},[t]),z=r.useCallbackRef(async(c,q,T=!1,b=!1)=>P(c,async N=>{let C=N.getSelectedRanges();T&&(q===s.IRange.Orientation.Row?C=C.getEntireRows(b):q===s.IRange.Orientation.Column&&(C=C.getEntireColumns(b)));let H=null;const X=w.getMode()?.key;if(X==="copy"||X==="cut"){const te=await R.getClipboard().readReference();te&&te.getItemType()==="range"&&(H=te.getItem(),H.getCoords()||(H=null))}if(H){const te=await C.insertFrom(H,{...H.getMarkOptions(),orientation:q,autoSelect:!0});!te||te.isEntireRows()||te.isEntireColumns()||te.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else C.insert(q,{autoSelect:!0})},"Insert Cells",!1),[w]),[ae,ve]=o.useState(null),Pe=r.useCallbackRef(c=>t.getStyles().setDefaultTableStyle(c),[t]),Se=r.useCallbackRef(c=>{t.getStyles().getTableStyle(c)?.delete()},[t]),ue=r.useCallbackRef((c,q)=>{P(c,async T=>{const b=T.getSelectedRange(),N=T.getSelectedCell().getCoords();let C=null,H=0;const X=N.rowIndex>0?T.getRange({rowIndex:N.rowIndex,colIndex:N.colIndex}).getExtended(s.IRange.Direction.Up):null;X&&T.getRange({colStart:N.colIndex,rowStart:X.getCoords().rowStart,colEnd:N.colIndex,rowEnd:X.getCoords().rowStart}).isContentful()&&(C=s.IRange.Direction.Up,H=N.rowIndex-X.getCoords().rowEnd);const te=N.colIndex>0?T.getRange({rowIndex:N.rowIndex,colIndex:N.colIndex-1}).getExtended(s.IRange.Direction.Left):null;if(te&&T.getRange({colStart:te.getCoords().colStart,rowStart:N.rowIndex,colEnd:te.getCoords().colStart,rowEnd:N.rowIndex}).isContentful()){const se=N.colIndex-te.getCoords().colEnd;(se<H||!C)&&(C=s.IRange.Direction.Left,H=se)}let ie=null;if(C===s.IRange.Direction.Up){if(ie={...X.getCoords()},(ie.rowEnd===N.rowIndex||!T.getRange({colIndex:N.colIndex,rowIndex:N.rowIndex-1}).isContentful())&&ie.rowStart>0&&T.getRange({colIndex:N.colIndex,rowIndex:ie.rowStart-1}).isContentful()){const se=X.getExtended(s.IRange.Direction.Up);ie={colStart:N.colIndex,rowStart:se.getCoords().rowStart,colEnd:N.colIndex,rowEnd:X.getCoords().rowEnd}}ie.rowEnd=N.rowIndex-1}else if(C===s.IRange.Direction.Left){if(ie={...te.getCoords()},(ie.colEnd===N.colIndex||!T.getRange({colIndex:N.colIndex-1,rowIndex:N.rowIndex}).isContentful())&&ie.colStart>0&&T.getRange({colIndex:ie.colStart-1,rowIndex:N.rowIndex}).isContentful()){const se=te.getExtended(s.IRange.Direction.Left);ie={colStart:se.getCoords().colStart,rowStart:N.rowIndex,colEnd:se.getCoords().colEnd,rowEnd:N.rowIndex}}ie.colEnd=N.colIndex-1}if(b.size!==1&&C){const se=b.getCoords(),ce=b.startIncrementalUpdates({orientation:s.IRange.Orientation.Column}),ye={...ie},fe=se.rowStart,pe=se.rowEnd,we=se.colStart,Be=se.colEnd,Ne=C===s.IRange.Direction.Up;for(let We=we;We<=Be;We++){ye.colStart=Ne?We:ie.colStart+(We-we),ye.colEnd=Ne?We:ie.colEnd+(We-we);for(let Ve=fe;Ve<=pe;Ve++){ye.rowStart=Ne?ie.rowStart+(Ve-fe):Ve,ye.rowEnd=Ne?ie.rowEnd+(Ve-fe):Ve;const Ge=T.getRange(ye).toString();ce.pushAt(Ve,We,`=${q}(${Ge})`)}}ce.apply()}else{const se=ie?T.getRange(ie).toString():"",ce=`=${q}(`;x?.({text:`${ce}${se})`,editMode:!0,initialSelection:{start:ce.length,end:ce.length+se.length}})}},!1)},[t]),Re=r.useCallbackRef((c,q,T=!1,b=!0)=>{P(c,async N=>{let C=null;if(ae)return void ae.updateStyleOptions(q);{const te=N.getSelectedRanges().getFixed(!0),ie=N.getSelectedRange().getDefaultSortCriteria();let se={ranges:te,hasHeader:ie?.options?.hasHeader??!1};C=b?new Promise((ce,ye)=>{const fe={tableOptions:se,onCancel:()=>{ye()},onDone:pe=>{ce(pe)},context:{getNames:()=>N.getNames()}};d.showWindow?.("tableNew",fe)}):{option:"Ok",tableOptions:se}}const H=await Promise.resolve(C);if(H?.option!=="Ok")throw null;const X=await Promise.resolve(d?.showBusy?.(c.label()));try{await N.getTables().add(H.tableOptions.ranges.at(0),{styleName:q?.name,clearFormatting:T,hasHeader:H.tableOptions.hasHeader}).getRange().select()}catch(te){X(),d?.showError?.(te)}X()},!1,!0,!1)},[ae]),Ke=r.useCallbackRef(()=>i,[i]),$e=r.useCallbackRef(c=>({styles:()=>t.getStyles(),table:()=>c,bodyStyle:Ke,getNames:()=>t.getNames()}),[t]),Ie=r.useCallbackRef(async(c,q,T,b=!0)=>{let N=null;if(!q){let C=t.getSelectedRange();C.size===1&&(C=C.getSurrounding());let H=t.getTables().getItems({address:t.getSelectedRange()});H.length>0&&(q=H[0]),await C.select()}if(q){if(b){try{T&&await q.select()}catch{}N=new Promise(async(C,H)=>{c.update({context:$e(q)});const X={command:c,commands:f,notifier:d,onDone:ie=>{C(ie)}},te=await d.showWindow?.("tableDetails",X,{disableAutoDestroy:!0});setTimeout(()=>{te.focus()},180)})}Promise.resolve(N).then(C=>{},C=>{d?.showError?.(C)})}},[d]),me=r.useCallbackRef(async(c,q,T=!1)=>{let b=null;if(q)q.isITable?b=q:q.getValue()&&(b=q.getValue());else{const N=t.getTables().getItems({address:t.getSelectedRange()});N.length>0&&(b=N[0])}if(b){if(!T){const N=b.getRange().getCoords(),C=(N.colEnd-N.colStart+1)*(N.rowEnd-N.rowStart+1);if(C>1e4&&await d?.showOptions({title:"Confirm",description:`Converting a table to range with '${C}' cells will set a large number of cell styles and may affect performance.
10
+ Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}P(c,async()=>{T?b.delete():b.convertToRange()},!1,!0)}},[d]),$=r.useCallbackRef((c,q,T)=>{P(c,async b=>{let N=b.getSelectedRanges();if(N.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let C=N.at(0);C.size===1&&(C=C.getSurrounding());const H=b.getSelection().getCoords().cell;let X=C.getDefaultSortCriteria(s.IRange.Orientation.Row,H);if(!X){if(T)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let te=X.options;if(T&&(te=new Promise((se,ce)=>{const ye={range:C,options:X.options,cell:H,onCancel:()=>{ce()},onDone:fe=>{fe?se(fe.options):ce()}};d.showWindow?.("sort",ye)})),te=await Promise.resolve(te),!te)return;const ie=await Promise.resolve(d?.showBusy?.(c.label()));try{C.doBatch(()=>{const se={...te,...q};C.sort(se),C.autoFit({orientations:se?.orientation===s.IRange.Orientation.Column?s.IRange.Orientations.Column:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},c?.label?.())}catch(se){ie(),d?.showError?.(se)}ie()},!1,!1,!1)},[d]),Ae=r.useCallbackRef(()=>{console.log("compactedSelection");const c=t.getSelection().getCoords(),q=t.getSelectedRanges().getFlattened().getCoords(),T=(C=>{const H=new Blob([C],{type:"application/javascript"}),X=URL.createObjectURL(H),te=new Worker(X);return URL.revokeObjectURL(X),te})("console.log('hello from worker');");setTimeout(()=>{T.terminate(),console.log("Worker terminated")},5e3);let b=-1;for(let C=0;b===-1&&C<q.length;C++)ge.CoordUtils.isCellWithinRange(c.cell,q[C])&&(b=C);if(ge.CoordUtils.isEqualRangesArrays(c.ranges,q))return;const N={cell:c.cell,ranges:q,rangeIndex:b};t.getSelection().updateCoords(N)},[t]),Ce=r.useCallbackRef(()=>{console.log("selectComments")},[t]),J=r.useCallbackRef(async(c=!1,q=!1)=>{let T=null;if(q)T=t.getEntireRange();else{const b=t.getSelectedRange();if(b.isEntireRange()){const N=t.getSelection().getCoords().cell,C=t.getRange(N);T=C.getSurrounding(),T.isEntireRange()&&(T=C)}else T=b.getSurrounding({contentOnly:c})}T&&await T.select()},[t]),Z=r.useCallbackRef((c,q,T)=>{P(c,async b=>{let N=b.getSelectedRanges();T&&(q===s.IRange.Orientation.Row?N=N.getEntireRows():q===s.IRange.Orientation.Column&&(N=N.getEntireColumns())),N.delete(q)},"Delete Cells")},[t]);r.useCallbackRef(async c=>{let q=null;const T=A(),b=Math.min(T.width-8,480),N=Math.min(T.height-8,288);try{t.getSelectedRanges(),q=await t.getMovables().add({bounds:{x:T.left+(T.width-b)/2,y:T.top+(T.height-N)/2,width:b,height:N},type:"chart",json:c.template}),q.select(),w.setMode(null)}catch(C){d?.showError?.(C)}return q},[t,d]);const re=r.useCallbackRef(async(c,q,T)=>{const b=await d?.showBusy?.(c.label());try{const N=await t.getMovables().addImage(q,{autoSelect:!0,...T});return b(),w.setMode(null),N}catch(N){b();let C=N;typeof C!="string"&&(console.warn(N),C="Unable to resolve image."),d?.showMessage?.(C,{type:r.NotificationType.Error})}},[t,d]),oe=r.useCallbackRef((c,q)=>{P(c,async T=>{const b=T.getSelectedRanges();b.doBatch(()=>{const N=q===s.IRange.Direction.Up||q===s.IRange.Direction.Down,C=b.getCoords().slice().sort(ge.CoordUtils.createRangeComparator(N?s.IRange.Orientation.Row:s.IRange.Orientation.Column));for(let H=0;H<C.length;H++){const X=C[H];let te=X;const ie=T.getRange(te).getMerges();let se=0,ce=0;if(ie.length>0){const ye=ie[0];se=ye.rowEnd-ye.rowStart,ce=ye.colEnd-ye.colStart}q===s.IRange.Direction.Left?te={...X,colStart:X.colEnd+ce}:q===s.IRange.Direction.Right?te={...X,colEnd:X.colStart+ce}:q===s.IRange.Direction.Up?te={...X,rowStart:X.rowEnd+se}:q===s.IRange.Direction.Down&&(te={...X,rowEnd:X.rowStart+se}),T.getRange(te).autoFill(X,{filler:s.AutoFill.Types.Copy}),T.getRange(X).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:c.label()})})},[d]),he=r.useCallbackRef(()=>{let c=null;const q=t.getSelectedCell().getCoords();if(q?.rowIndex>0){const T=t.getRange({rowIndex:q.rowIndex-1,colIndex:q.colIndex}).getCell();T&&(c=T.toTextUnformatted(!0))}x?.({text:c})},[t]),[Me,de]=o.useReducer(c=>c+1,0),[be,xe]=o.useReducer(c=>c+1,0),Fe=o.useMemo(()=>[new r.Command("gridlinesToggle",l,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",l,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesColumns",l,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new r.Command("sheetViewFormatGridlinesColor",l,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",l,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",l,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",l,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",l,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("sheetViewToggleFormulaView",l,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[r.KeyModifiers.Ctrl]},{key:"`",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]}),new r.Command("sheetViewToggleShowZeros",l,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>Ce()),new r.Command("selectAll",l,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[r.KeyModifiers.Ctrl]},{key:"Space",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},(c=!1)=>J(!1,c)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>J(!0,!1)),new r.SimpleCommand("breakSelection",l,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},()=>Ae()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation."}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically."}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){$(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){$(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){$(this,{},!0)}),new r.Command("protectionSheetToggle",l,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
11
+ For example, you can prevent people from editing locked cells or making formatting changes.`}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new r.Command("formatCellStyle",l,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(c){B(this,{named:c.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(c){Re(this,c)}),new r.Command("formatTableStyleClearCellStyles",l,{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(c){Re(this,c,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){Re(this,{name:null},!0)}),new r.Command("setDefaultTableStyle",l,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},Pe),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Se),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(c){B(this,{border:c})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(c){B(this,{fill:c})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(c){B(this,{font:{fill:c}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",l,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",l,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",l,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",l,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top."}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells."}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new r.Command("formatTextOverflowEllipsisToggle",l,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",l,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom."}),new r.Command("formatAlignJustifyVerticalToggle",l,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically."}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left."}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content."}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right."}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content."}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells."}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new r.Command("formatAlignDistributedHorizontalToggle",l,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(this,c=>({font:{size:uo(c.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(this,c=>({font:{size:uo(c.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(c){B(this,{font:{family:c}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(c){B(this,{font:{size:c}})}),new r.Command("formatNumberDialog",l,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(c,q){const T=this,b={initialValue:c??q.state(),context:q.context(),onInputOption:(N,C)=>{B(T,{numberFormat:N})}};d.showWindow?.("numberFormat",b)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(c){B(this,{numberFormat:c})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(this,{numberFormat:s.NumberFormat.Type.General})}),new r.Command("formatNumberFormatNumberStyle",l,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(this,{numberFormat:"#,##0.00"})}),new r.Command("formatNumberFormatTimeStyle",l,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(this,{numberFormat:"h:mm AM/PM"})}),new r.Command("formatNumberFormatDateStyle",l,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(c){B(this,{numberFormat:c??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(this,{numberFormat:"0%"})}),new r.Command("formatNumberFormatScientificStyle",l,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){B(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){B(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){B(this,c=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(c.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places."},function(){B(this,c=>({numberFormat:s.NumberFormat.Parser.adjustDecimalPlaces(c.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",l,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.SimpleCommand("calculate",l,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(c,q){console.log("insertFunction")}),new r.Command("insertFunctionSum",l,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){ue(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){ue(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){ue(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){ue(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){ue(this,"MIN")}),new r.Command("startEditCurrentTime",l,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){x?.({text:t.createTemporaryCell({value:fn(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",l,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){x?.({text:t.createTemporaryCell({value:fn(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",l,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoomIn",l,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoom100",l,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("updateHyperlink",l,{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:()=>_,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(c,q){const T=this,b={context:q.context(),onUpdateHyperlink:(N,C)=>{K(T,N,C)}};d.showWindow?.("hyperlink",b)}),new r.Command("openHyperlink",l,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>_},async(c,q)=>{const T=q.context()();if(!T)return;const b=T.getHyperlink();if(b)try{await b.open()}catch(N){d?.showError?.(N)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>_},function(c,q){K(this,null,null)}),new r.SimpleCommand("insertNote",l,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(c,q)=>{((T,b)=>{T?.showMessage?.(u.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[b," is not yet implemented.",u.jsx("br",{}),u.jsx("br",{}),"Please see the ",u.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(d,q.label())}),new r.Command("updateComments",l,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",context:()=>_},async function(c,q){const T=this,b={context:q.context(),onUpdateComments:N=>{ne(T,N)}};d.showWindow?.("comments",b)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",context:()=>_},function(c,q){ne(this,null)}),new r.Command("insertImageFromFile",l,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(c=null){let q=null,T=null;typeof c=="string"?T=c:q=c?.file?c.file:c,(q||(q=await ge.CommonUtils.openFileDialog(T??"image/*"),q))&&await re(this,{file:q},c?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(c){if(!c){const q=await d?.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(q.option!=="Insert")return;c=q.input}c&&re(this,{fetch:c})}),new r.SimpleCommand("insertTable",l,{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:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Re(this)}),new r.Command("editTable",l,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(c){let q=null,T=!1;c.isITable?q=c:c.getValue()&&(q=c.getValue(),T=!0),Ie(this,q,T)}),new r.Command("deleteTable",l,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
12
12
 
13
- The table and table specific styling will be removed but the values will be preserved.`},function(u){Pe(this,u,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
13
+ The table and table specific styling will be removed but the values will be preserved.`},function(c){me(this,c,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
14
14
 
15
- The values and the formatting are preserved.`},function(u){Pe(this,u,!1)}),new r.Command("tableTotalRowToggle",l,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},function(){const u=this.context().table();u&&u.setShowTotals(!u.getShowTotals())}),new r.Command("tableHeaderRowToggle",l,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const u=this.context().table();u&&u.setShowHeaders(!u.getShowHeaders())}),new r.Command("autoFilterToggle",l,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const u=this.context().table();u&&u.setShowFilterButton(!u.getShowFilterButton())}),new r.Command("autoFilterReapply",l,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("autoFilterClear",l,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new r.SimpleCommand("startEditValueAbove",l,{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:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},xe),new r.Command("formatPainterToggle",l,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new r.SimpleCommand("insertCells",l,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){z(this)}),new r.SimpleCommand("insertCellsShiftRight",l,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){z(this,s.IRange.Orientation.Column)}),new r.SimpleCommand("insertCellsShiftDown",l,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward."},function(){return z(this,s.IRange.Orientation.Row)}),new r.SimpleCommand("insertRows",l,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position."},function(){return z(this,s.IRange.Orientation.Row,!0)}),new r.SimpleCommand("insertColumns",l,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position."},function(){return z(this,s.IRange.Orientation.Column,!0)}),new r.SimpleCommand("insertRowsAfter",l,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return z(this,s.IRange.Orientation.Row,!0,!0)}),new r.SimpleCommand("insertColumnsAfter",l,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return z(this,s.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",l,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return de(this)}),new r.SimpleCommand("deleteCellsShiftUp",l,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return de(this,s.IRange.Orientation.Row)}),new r.SimpleCommand("deleteCellsShiftLeft",l,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right."},function(){return de(this,s.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",l,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return de(this,s.IRange.Orientation.Row,!0)}),new r.SimpleCommand("deleteColumns",l,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection."},function(){return de(this,s.IRange.Orientation.Column,!0)}),new r.SimpleCommand("flashFill",l,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[r.KeyModifiers.Ctrl]},{key:"e",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("fillDown",l,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",shortcut:{key:"d",modifiers:[r.KeyModifiers.Ctrl]}},function(){return Ce(this,s.IRange.Direction.Down)}),new r.SimpleCommand("fillRight",l,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",shortcut:[{key:"r",modifiers:[r.KeyModifiers.Ctrl]}]},function(){return Ce(this,s.IRange.Direction.Right)}),new r.SimpleCommand("fillUp",l,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection."},function(){return Ce(this,s.IRange.Direction.Up)}),new r.SimpleCommand("fillLeft",l,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection."},function(){return Ce(this,s.IRange.Direction.Left)}),new r.SimpleCommand("formatBorderAddOutline",l,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return V(this,{border:{left:{style:s.IBorder.StrokeStyle.Thin,color:null},top:{style:s.IBorder.StrokeStyle.Thin,color:null},right:{style:s.IBorder.StrokeStyle.Thin,color:null},bottom:{style:s.IBorder.StrokeStyle.Thin,color:null}}})}),new r.SimpleCommand("formatBorderClearOutline",l,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return V(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return V(this,u=>{const M=u.getAlignment().getIndent()-1;return{alignment:{indent:M>0?M:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border."},function(){return V(this,u=>{const M={alignment:{indent:u.getAlignment().getIndent()+1}};return u.getAlignment().getHorizontal()===s.ITextFrame.HorizontalAlignment.General&&(M.alignment.horizontal=s.ITextFrame.HorizontalAlignment.Left),M})}),new r.Command("mergeToggle",l,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("mergeHorizontal",l,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new r.SimpleCommand("mergeVertical",l,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new r.SimpleCommand("unmerge",l,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new r.SimpleCommand("clearContents",l,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:`Clear only the contents in the cells.
15
+ The values and the formatting are preserved.`},function(c){me(this,c,!1)}),new r.Command("tableTotalRowToggle",l,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},function(){const c=this.context().table();c&&c.setShowTotals(!c.getShowTotals())}),new r.Command("tableHeaderRowToggle",l,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const c=this.context().table();c&&c.setShowHeaders(!c.getShowHeaders())}),new r.Command("autoFilterToggle",l,{label:"Toggle Filter",scopedLabels:{filter:"Filter"},description:"Toggle Auto Filter on/off.",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const c=this.context().table();c&&c.setShowFilterButton(!c.getShowFilterButton())}),new r.Command("autoFilterReapply",l,{label:"Reapply Filter",scopedLabels:{filter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("autoFilterClear",l,{label:"Clear Filter",scopedLabels:{filter:"Clear"},description:"Clear the filters criteria from the current filter.."}),new r.SimpleCommand("startEditValueAbove",l,{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:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},he),new r.Command("formatPainterToggle",l,{label:"Format Painter",description:"Apply style to another part of your workbook."}),new r.SimpleCommand("insertCells",l,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){z(this)}),new r.SimpleCommand("insertCellsShiftRight",l,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right."},function(){z(this,s.IRange.Orientation.Column)}),new r.SimpleCommand("insertCellsShiftDown",l,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward."},function(){return z(this,s.IRange.Orientation.Row)}),new r.SimpleCommand("insertRows",l,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position."},function(){return z(this,s.IRange.Orientation.Row,!0)}),new r.SimpleCommand("insertColumns",l,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position."},function(){return z(this,s.IRange.Orientation.Column,!0)}),new r.SimpleCommand("insertRowsAfter",l,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return z(this,s.IRange.Orientation.Row,!0,!0)}),new r.SimpleCommand("insertColumnsAfter",l,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return z(this,s.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",l,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return Z(this)}),new r.SimpleCommand("deleteCellsShiftUp",l,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward."},function(){return Z(this,s.IRange.Orientation.Row)}),new r.SimpleCommand("deleteCellsShiftLeft",l,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right."},function(){return Z(this,s.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",l,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection."},function(){return Z(this,s.IRange.Orientation.Row,!0)}),new r.SimpleCommand("deleteColumns",l,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection."},function(){return Z(this,s.IRange.Orientation.Column,!0)}),new r.SimpleCommand("flashFill",l,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[r.KeyModifiers.Ctrl]},{key:"e",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("fillDown",l,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",shortcut:{key:"d",modifiers:[r.KeyModifiers.Ctrl]}},function(){return oe(this,s.IRange.Direction.Down)}),new r.SimpleCommand("fillRight",l,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",shortcut:[{key:"r",modifiers:[r.KeyModifiers.Ctrl]}]},function(){return oe(this,s.IRange.Direction.Right)}),new r.SimpleCommand("fillUp",l,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection."},function(){return oe(this,s.IRange.Direction.Up)}),new r.SimpleCommand("fillLeft",l,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection."},function(){return oe(this,s.IRange.Direction.Left)}),new r.SimpleCommand("formatBorderAddOutline",l,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return B(this,{border:{left:{style:s.IBorder.StrokeStyle.Thin,color:null},top:{style:s.IBorder.StrokeStyle.Thin,color:null},right:{style:s.IBorder.StrokeStyle.Thin,color:null},bottom:{style:s.IBorder.StrokeStyle.Thin,color:null}}})}),new r.SimpleCommand("formatBorderClearOutline",l,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return B(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border."},function(){return B(this,c=>{const q=c.getAlignment().getIndent()-1;return{alignment:{indent:q>0?q:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border."},function(){return B(this,c=>{const q={alignment:{indent:c.getAlignment().getIndent()+1}};return c.getAlignment().getHorizontal()===s.ITextFrame.HorizontalAlignment.General&&(q.alignment.horizontal=s.ITextFrame.HorizontalAlignment.Left),q})}),new r.Command("mergeToggle",l,{label:"Merge",description:"Combine and center the contents into a single cell.",shortcut:{key:"m",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("mergeHorizontal",l,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows."}),new r.SimpleCommand("mergeVertical",l,{label:"Merge Vertically",description:"Combine the contents into vertical columns."}),new r.SimpleCommand("unmerge",l,{label:"Unmerge",description:"Split merged cells into multiple cells."}),new r.SimpleCommand("clearContents",l,{label:"Clear Contents",scopedLabels:{clear:"Contents"},description:`Clear only the contents in the cells.
16
16
 
17
17
  The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){L(this,s.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",l,{label:"Clear Formats",scopedLabels:{clear:"Formats"},description:"Clear only the formatting that is applied to the cells."},function(){L(this,s.ICell.Content.Formats)}),new r.SimpleCommand("clearHyperlinks",l,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){L(this,s.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){L(this,s.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",l,{label:"Clear All",scopedLabels:{clear:"All"},description:`Clears everything from the cells.
18
18
 
19
- All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){L(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),C=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(Ve,!0),u},[a,Ve]),[Ue,Qe]=o.useState(!1),[$e,ee]=o.useState(!1);o.useEffect(()=>{if(T.current!==t||!h)return;const u=h.getCoords(),M=t.getTables().getItems({address:u[0]});E(H=>ue.CommonUtils.isEqualArrays(H,M)?H:M),g&&M[0]&&ue.CoordUtils.isCellWithinRange(g,M[0].getRange().getCoords())?W(M[0]??null):W(null);const I=t.getSelectedRanges(),b=I.getMerges().length>0,N=I.isOverlapping();let v=!0;for(let H=0;v&&H<u.length;H++)v=ue.CoordUtils.isSingleCell(u[H]);ee(N),Qe(M.length===0&&!N&&(b||!v))},[Ee,h,t]),r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),M=w.getMode()?.key==="formatPainter";C.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>M}).updateCallback(()=>M?void w.setMode(null):C.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`}}))}},[w,Me,a]),tt(t.getView(),{onFreezeSplitChange:()=>{Le()}}),tt(t.getSelection(),{onChange:()=>{Z()}});const Fe=()=>{C.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),C.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??Tn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:Tn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Be=()=>{C.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{G(u)},darkMode:i.darkMode,quickBorder:D,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:s.IBorder.StrokeStyle.Thin,createTemporaryBorder:u=>t.getStyles().getNormal().createTemporaryStyle({border:u}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Be()},[D]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed();C.getCommand("openHyperlink").update({disabled:!_().getHyperlink()}),C.getCommand("deleteHyperlink").update({disabled:u||!_().getHyperlink()});const M=_().getHyperlink()?"Edit":"Insert",I="Link";C.getCommand("updateHyperlink").update({label:()=>(_().getHyperlink(),`${M} ${I}`),scopedLabels:{contextMenu:`${M} ${I}…`,insert:`${I}…`,hyperlink:`${M}…`},disabled:u})},[_()?.getHyperlink(),Me]),o.useEffect(()=>{const u=_().getComments(),M=()=>u?"Edit":"Insert",I=()=>u?"Comments":"Comment";C.getCommand("updateComments").update({label:()=>`${M()} ${I()}`,scopedLabels:{contextMenu:`${M()} ${I()}…`,insert:`${I()}…`}})},[_()?.getComments(),Me]),tt(t,{onViewChange:()=>{const u=t.getView();C.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),C.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),C.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),C.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),C.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),C.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),C.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),C.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero}),Fe()},onTabColorChange:()=>{Fe()},onMergesChange:()=>{Le()},onMovablesChange:()=>{Le()},onTablesChange:()=>{Le()},onProtectionChange:()=>{Le(),we()},onStyleChange:()=>{Fe(),Be(),Le()}}),o.useEffect(()=>{Fe(),Be()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),M=O.length>0&&!K||u,I=ke(K),b={context:I};C.getCommand("editTable").update(b),C.getCommand("deleteTable").update(b),C.getCommand("convertTableToRange").update(b);const N={context:I,disabled:M};C.getCommand("formatTableStyle").update({label:K?"Apply Table Style":"Format As Table",...N}),C.getCommand("formatTableStyleClearCellStyles").update(N),C.getCommand("deleteTableStyle").update(N),C.getCommand("convertTableToRange").update(N),C.getCommand("insertTable").update({disabled:M||O.length>0});const v={context:I,disabled:M||O.length===0};C.getCommand("tableHeaderRowToggle").update(v),C.getCommand("tableTotalRowToggle").update(v),C.getCommand("autoFilterToggle").update(v),C.getCommand("formatTableStyleClearTableStyle").update({...v,disabled:v.disabled||!K||K.getStyleOptions().name===null})},[K,O,Me]),o.useEffect(()=>{C.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ue.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),C.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ue.CommonUtils.findNextStep(t.getView().getZoomScale())})}),C.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),C.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),C.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),C.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),C.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),C.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),C.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),C.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),C.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const u=t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:u?s.ISheetView.HeaderTextStyle.A1:s.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:u?s.ISheetView.HeaderTextStyle.One:s.ISheetView.HeaderTextStyle.Zero})}),C.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),C.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})})},[t]),o.useEffect(()=>{const u=t.getView().getFreezePanes(),M=()=>u.coords.rowIndex!==0,I=()=>u.coords.colIndex!==0,b=()=>u.coords.rowIndex!==0||u.coords.colIndex!==0;C.getCommand("freezeToggle").updateCallback(()=>{b()?t.getView().setFreezePanes(null):b()?I()?t.getView().setFreezePanes({coords:{rowIndex:g.rowIndex}}):M()&&t.getView().setFreezePanes({coords:{colIndex:g.colIndex}}):t.getView().setFreezePanes({coords:g})}).update({state:b,disabled:()=>!g||!b()&&g.rowIndex===0&&g.colIndex===0}),C.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:M()?0:g.rowIndex}})}).update({state:M,disabled:()=>!g||!M()&&g.rowIndex===0}),C.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:I()?0:g.colIndex}})}).update({state:I,disabled:()=>!g||!I()&&g.colIndex===0}),C.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!b()})},[Ee,g,t,i]);const Ie=_().getStyle(),ze=Ie.getFont(),Ae=Ie.getAlignment(),R=Ae.getHorizontal(),re=Ae.getVertical(),j=Ae.getOverflow(),J=Ae.getRotation();return o.useEffect(()=>{C.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>_().getStyle(!0).getNamed(),bodyStyle:be,createTemporaryCell:Ne=>t.createTemporaryCell(Ne)})}),C.getCommand("formatFillColor").update({state:()=>{let Ne=null;const Xe=Ie.getFill();return Xe?.getType()===s.IFill.Type.Solid?Ne=Xe.getColor():Xe?.getType()===s.IFill.Type.Gradient?Ne=Xe.getStops()?.[0]?.getColor():Xe?.getType()===s.IFill.Type.Pattern&&(Ne=Xe.getBackground()),Ne},context:()=>{const Ne=t.getStyles();return{onColorSelect:Xe=>{y(Xe??Tn)},darkMode:i.darkMode,quickColor:U,autoColor:Tn,schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Xe=>Ne.addRecentColor(Xe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatFontColor").update({state:()=>ze.toJSON()?.fill?ze.getFill():null,context:()=>{const Ne=t.getStyles();return{onColorSelect:Xe=>{S(Xe)},darkMode:i.darkMode,quickColor:B,autoColor:Ne.getNormal().getFont().getFill(),schemeLookup:Ne.schemeLookup(),recentColors:Ne.recentColors(),addRecentColor:Xe=>Ne.addRecentColor(Xe),clearRecentColors:()=>Ne.clearRecentColors()}}}),C.getCommand("formatNumberFormat").update({state:()=>Ie.getNumberFormat(),context:()=>_}),C.getCommand("formatNumberDialog").update({state:()=>Ie.getNumberFormat(),context:()=>_}),C.getCommand("formatFontFamily").update({state:()=>ze.getFamily()}),C.getCommand("formatFontSize").update({state:()=>ze.getSize()});const u=function(){const Ne=ze.getWeight()||0;return!isNaN(Ne)&&Ne>500};C.getCommand("formatBoldToggle").updateCallback(function(){V(this,{font:{weight:u()?400:700}})}).update({state:u});const M=function(){return ze.getStyle()===s.IFont.Style.Italic};C.getCommand("formatItalicToggle").updateCallback(function(){V(this,{font:{style:M()?s.IFont.Style.Normal:s.IFont.Style.Italic}})}).update({state:M}),C.getCommand("formatStrikeThroughToggle").updateCallback(function(){V(this,{font:{strike:!ze.getStrike()}})}).update({state:ze.getStrike()}),C.getCommand("formatUnderlinedToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.Single?s.IFont.UnderlineStyle.Single:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.Single}),C.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.Double?s.IFont.UnderlineStyle.Double:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.Double}),C.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.SingleAccounting?s.IFont.UnderlineStyle.SingleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.SingleAccounting}),C.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){V(this,{font:{underline:ze.getUnderline()!==s.IFont.UnderlineStyle.DoubleAccounting?s.IFont.UnderlineStyle.DoubleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:ze.getUnderline()===s.IFont.UnderlineStyle.DoubleAccounting}),C.getCommand("formatSuperscriptToggle").updateCallback(function(){V(this,{font:{verticalAlign:ze.getVerticalAlignment()!==s.IFont.VerticalAlignment.Super?s.IFont.VerticalAlignment.Super:s.IFont.VerticalAlignment.Baseline}})}).update({state:ze.getVerticalAlignment()===s.IFont.VerticalAlignment.Super}),C.getCommand("formatSubscriptToggle").updateCallback(function(){V(this,{font:{verticalAlign:ze.getVerticalAlignment()!==s.IFont.VerticalAlignment.Sub?s.IFont.VerticalAlignment.Sub:s.IFont.VerticalAlignment.Baseline}})}).update({state:ze.getVerticalAlignment()===s.IFont.VerticalAlignment.Sub});const I=()=>j===s.ITextFrame.Overflow.Visible;C.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){V(this,{alignment:{overflow:(I(),s.ITextFrame.Overflow.Visible)}})}).update({state:I});const b=()=>j===s.ITextFrame.Overflow.Wrap;C.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){V(this,{alignment:{overflow:b()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Wrap}})}).update({state:b});const N=function(){return j===s.ITextFrame.Overflow.Clip};C.getCommand("formatTextOverflowClipToggle").updateCallback(function(){V(this,{alignment:{overflow:N()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Clip}})}).update({state:N});const v=function(){return j===s.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){V(this,{alignment:{overflow:v()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Shrink}})}).update({state:v});const H=function(){return j===s.ITextFrame.Overflow.Shrink};C.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){V(this,{alignment:{overflow:H()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Ellipsis}})}).update({state:H,disabled:!0});const Y=function(){return re===s.ITextFrame.VerticalAlignment.Top};C.getCommand("formatAlignTopToggle").updateCallback(function(){V(this,{alignment:{vertical:Y()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Top}})}).update({state:Y});const ne=function(){return re===s.ITextFrame.VerticalAlignment.Center};C.getCommand("formatAlignMiddleToggle").updateCallback(function(){V(this,{alignment:{vertical:ne()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Center}})}).update({state:ne});const le=function(){return re===s.ITextFrame.VerticalAlignment.Bottom};C.getCommand("formatAlignBottomToggle").updateCallback(function(){V(this,{alignment:{vertical:(le(),s.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:le});const ie=function(){return re===s.ITextFrame.VerticalAlignment.Justify};C.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){V(this,{alignment:{vertical:ie()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Justify}})}).update({state:ie});const se=function(){return re===s.ITextFrame.VerticalAlignment.Distributed};C.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){V(this,{alignment:{vertical:se()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Distributed}})}).update({state:se});const ye=function(){return R===s.ITextFrame.HorizontalAlignment.Left};C.getCommand("formatAlignLeftToggle").updateCallback(function(){V(this,{alignment:{horizontal:ye()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Left}})}).update({state:ye});const fe=function(){return R===s.ITextFrame.HorizontalAlignment.Center};C.getCommand("formatAlignCenterToggle").updateCallback(function(){V(this,{alignment:{horizontal:fe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Center}})}).update({state:fe});const pe=function(){return R===s.ITextFrame.HorizontalAlignment.CenterContinuous};C.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Ne={alignment:{horizontal:pe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};V(this,Ne)}).update({state:pe});const qe=function(){return R===s.ITextFrame.HorizontalAlignment.Fill};C.getCommand("formatAlignFillToggle").updateCallback(function(){const Ne={alignment:{horizontal:qe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Fill,rotation:null}};V(this,Ne)}).update({state:qe});const Oe=function(){return R===s.ITextFrame.HorizontalAlignment.Distributed};C.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){V(this,{alignment:{horizontal:Oe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Oe});const De=function(){return R===s.ITextFrame.HorizontalAlignment.Right};C.getCommand("formatAlignRightToggle").updateCallback(function(){V(this,{alignment:{horizontal:De()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Right}})}).update({state:De});const We=function(){return R===s.ITextFrame.HorizontalAlignment.Justify};C.getCommand("formatAlignJustifyToggle").updateCallback(function(){V(this,{alignment:{horizontal:We()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Justify}})}).update({state:We});const je=!t.getProtection().isFormatCellsAllowed(),Ge=R===s.ITextFrame.HorizontalAlignment.CenterContinuous||R===s.ITextFrame.HorizontalAlignment.Fill;C.getCommand("formatTextRotate0").updateCallback(function(Ne){V(this,{alignment:{rotation:0}})}).update({disabled:je||Ge,state:J===0}),C.getCommand("formatTextRotate45").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?45:0}})}).update({disabled:je||Ge,state:J===45}),C.getCommand("formatTextRotate90").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?90:0}})}).update({disabled:je||Ge,state:J===90}),C.getCommand("formatTextRotate270").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?270:0}})}).update({disabled:je||Ge,state:J===270}),C.getCommand("formatTextRotate315").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne??1?315:0}})}).update({disabled:je||Ge,state:J===315}),C.getCommand("formatTextRotateCustom").updateCallback(function(Ne){V(this,{alignment:{rotation:Ne}})}).update({disabled:je||Ge,state:J??0})},[Ie,t,i,U,B]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),M=t.getSelectedRanges().getMerges().length>0,I=async(_e,rt)=>{P(rt,async vt=>{const yt=async(gt=!1)=>{const lt=await Promise.resolve(d?.showBusy?.(rt.label()));try{const It=vt.getSelectedRanges();if(It.merge({orientations:_e,discardMultipleValues:gt}),_e===s.IRange.Orientations.Both){const jt={alignment:{horizontal:s.ITextFrame.HorizontalAlignment.Center}};It.updateStyle(jt)}}catch(It){throw It}finally{lt?.()}};let Ct;try{await yt()}catch(gt){if(gt.type!=="discardMultipleValues")throw gt;Ct=!0}if(Ct&&d?.showOptions){if(await d?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await yt(!0)}},void 0,void 0,!1)},b=_e=>{P(_e,async rt=>{try{const vt=rt.getSelectedRanges();vt.unmerge();const yt={alignment:{horizontal:null}};vt.updateStyle(yt)}catch(vt){throw vt}})};C.getCommand("mergeToggle").updateCallback(function(){ue.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(M?b(this):I(s.IRange.Orientations.Both,this))}).update({state:M,disabled:!Ue||u}),C.getCommand("mergeHorizontal").updateCallback(function(){I(s.IRange.Orientations.Column,this)}).update({disabled:!Ue||u}),C.getCommand("mergeVertical").updateCallback(function(){I(s.IRange.Orientations.Row,this)}).update({disabled:!Ue}),C.getCommand("unmerge").updateCallback(function(){b(this)}).update({disabled:!M||!Ue||u});const N={disabled:u};C.getCommand("hideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(N),C.getCommand("hideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(N),C.getCommand("unhideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(N),C.getCommand("unhideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(N),C.getCommand("autoFitRows").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Row})})}).update(N),C.getCommand("autoFitColumns").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Column})})}).update(N);let v=!1,H=0,Y=!1,ne=!1,le=0,ie=!1;!h||u||$e||(v=h.isEntireColumnsAny(),v&&!h.isEntireColumns()?Y=!0:H=h.getColumnCount(),ne=h.isEntireRowsAny(),ne&&!h.isEntireRows()?ie=!0:le=h.getRowCount());const se={disabled:u||h&&h.getCount()!==1};C.getCommand("sortAscending").update(se),C.getCommand("sortDescending").update(se);const ye={disabled:v||ne||u||$e},fe=v||u||$e||ie;fe&&(H=1);const pe=ne||u||$e||Y;pe&&(le=1);let qe="",Oe="",De="",We="",je="",Ge="",Ne="",Xe="",it="";H>1&&(Ge=Oe=H+" ",Ne=De="s"),le>1&&(Xe=We=le+" ",it=je="s"),w.getMode()?.key==="copy"?(qe=We=Oe="Copied ",De=je="s"):w.getMode()?.key==="cut"&&(qe=We=Oe="Cut ",De=je="s");let pt="",xt="";if(h){const _e=h.getDefaultShiftOrientation()===s.IRange.Orientation.Column;pt=` (${_e?"Shift Right":"Shift Down"})`,xt=` (${_e?"Shift Left":"Shift up"})`,C.getCommand("deleteCells").update({label:`Delete Cells${xt}`})}C.getCommand("insertCells").update({label:`Insert ${qe}Cells${pt}`,scopedLabels:{insertCells:`${qe}At Selection`}}),C.getCommand("insertCellsShiftRight").update(ye),C.getCommand("insertCellsShiftDown").update(ye),C.getCommand("deleteCellsShiftUp").update(ye),C.getCommand("deleteCellsShiftLeft").update(ye),C.getCommand("insertRows").update({label:`Insert ${We}Row${je}`,scopedLabels:{insertCells:`${We}Row${je}`},disabled:pe}),C.getCommand("insertRowsAfter").update({label:`Insert ${We}Row${je} Below`,disabled:pe}),C.getCommand("insertColumns").update({label:`Insert ${Oe}Column${De}`,scopedLabels:{insertCells:`${Oe}Column${De}`},disabled:fe}),C.getCommand("insertColumnsAfter").update({label:`Insert ${Oe}Column${De} After`,disabled:fe}),C.getCommand("deleteRows").update({label:`Delete ${Xe}Row${it}`,scopedLabels:{deleteCells:`${Xe}Row${it}`},disabled:pe}),C.getCommand("deleteColumns").update({label:`Delete ${Ge}Column${Ne}`,scopedLabels:{deleteCells:`${Ge}Column${Ne}`},disabled:fe})},[Ee,Ue,$e,h,w,d,Me]),o.useEffect(()=>{const u=t.getProtection(),M=t.getProtection().isLocked(),I=!u.isFormatCellsAllowed(),b={disabled:I};C.getCommand("protectionSheetToggle").updateCallback(async(H,Y)=>{let ne=null;try{if(M){let le=null;if(u.hasPassword()){const ie=await d?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(ie.option!=="Unprotect")return;le=ie.input}ne=await Promise.resolve(d?.showBusy?.(Y.label())),await u.unlock(le)}else ne=await Promise.resolve(d?.showBusy?.(Y.label())),await u.lock();ne?.()}catch(le){ne?.(),d?.showError?.(le)}}).update({state:M,label:()=>M?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:M?"Unprotect":"Protect"}}),C.getCommand("deleteTable").update(b),C.getCommand("sortAscending").update(b),C.getCommand("sortDescending").update(b),C.getCommand("sortCustom")?.update(b),C.getCommand("updateComments").update(b),C.getCommand("deleteComments").update(b),C.getCommand("insertChart")?.update(b),C.getCommand("insertImageFromFile").update(b),C.getCommand("insertImageFromURL").update(b),C.getCommand("formatBorder").update(b),C.getCommand("formatFillColor").update(b),C.getCommand("formatFontColor").update(b),C.getCommand("formatBoldToggle").update(b),C.getCommand("formatItalicToggle").update(b),C.getCommand("formatUnderlinedToggle").update(b),C.getCommand("formatStrikeThroughToggle").update(b),C.getCommand("formatSuperscriptToggle").update(b),C.getCommand("formatSubscriptToggle").update(b),C.getCommand("formatAlignTopToggle").update(b),C.getCommand("formatTextOverflowVisibleToggle").update(b),C.getCommand("formatTextOverflowWrapToggle").update(b),C.getCommand("formatTextOverflowClipToggle").update(b),C.getCommand("formatTextOverflowShrinkToggle").update(b),C.getCommand("formatAlignMiddleToggle").update(b),C.getCommand("formatAlignBottomToggle").update(b),C.getCommand("formatAlignDistributedVerticalToggle").update(b),C.getCommand("formatAlignJustifyVerticalToggle").update(b),C.getCommand("formatAlignLeftToggle").update(b),C.getCommand("formatAlignCenterToggle").update(b),C.getCommand("formatAlignRightToggle").update(b),C.getCommand("formatAlignJustifyToggle").update(b),C.getCommand("formatAlignCenterContinuousToggle").update(b),C.getCommand("formatAlignDistributedHorizontalToggle").update(b),C.getCommand("formatAlignFillToggle").update(b),C.getCommand("formatFontSizeIncrease").update(b),C.getCommand("formatFontSizeDecrease").update(b),C.getCommand("formatFontFamily").update(b),C.getCommand("formatFontSize").update(b),C.getCommand("formatNumberFormat").update(b),C.getCommand("formatNumberFormatGeneralStyle").update(b),C.getCommand("formatNumberFormatNumberStyle").update(b),C.getCommand("formatNumberFormatTimeStyle").update(b),C.getCommand("formatNumberFormatDateStyle").update(b),C.getCommand("formatNumberFormatAccountingStyle").update(b),C.getCommand("formatNumberFormatPercentStyle").update(b),C.getCommand("formatNumberFormatScientificStyle").update(b),C.getCommand("formatNumberFormatCommaStyle").update(b),C.getCommand("formatNumberFormatIncreaseDecimal").update(b),C.getCommand("formatNumberFormatDecreaseDecimal").update(b),C.getCommand("hideColumns").update(b),C.getCommand("unhideColumns").update(b),C.getCommand("hideRows").update(b),C.getCommand("unhideRows").update(b),C.getCommand("quickFormulaSum").update(b),C.getCommand("quickFormulaAverage").update(b),C.getCommand("quickFormulaCount").update(b),C.getCommand("quickFormulaMax").update(b),C.getCommand("quickFormulaMin").update(b),C.getCommand("startEditCurrentTime").update(b),C.getCommand("startEditCurrentDate").update(b),C.getCommand("startEditValueAbove").update(b),C.getCommand("fillDown").update(b),C.getCommand("fillRight").update(b),C.getCommand("fillUp").update(b),C.getCommand("fillLeft").update(b),C.getCommand("formatCellStyle").update(b),C.getCommand("formatTableStyle").update(b),C.getCommand("formatPainterToggle").update(b),C.getCommand("formatBorderAddOutline").update(b),C.getCommand("formatBorderClearOutline").update(b),C.getCommand("formatIndentDecrease").update(b),C.getCommand("formatIndentIncrease").update(b),C.getCommand("clearContents").update(b),C.getCommand("clearFormats").update(b),C.getCommand("clearAll").update(b),C.getCommand("clearComments").update(b),C.getCommand("clearHyperlinks").update(b),C.getCommand("autoFilterClear").update(b),C.getCommand("autoFilterReapply").update(b);const N=R===s.ITextFrame.HorizontalAlignment.CenterContinuous||R===s.ITextFrame.HorizontalAlignment.Fill,v={disabled:I||N};C.getCommand("formatTextRotate0").update(v),C.getCommand("formatTextRotate45").update(v),C.getCommand("formatTextRotate90").update(v),C.getCommand("formatTextRotate270").update(v),C.getCommand("formatTextRotate315").update(v),C.getCommand("formatTextRotateCustom").update(v),C.getCommand("formatTextRotateVertical").update(v)},[Ee]),C}var Lo,Oo;(function(){if(Oo)return Lo;Oo=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,l=typeof cn=="object"&&cn&&cn.Object===Object&&cn,d=typeof self=="object"&&self&&self.Object===Object&&self,m=l||d||Function("return this")(),p=Object.prototype.toString,g=Math.max,x=Math.min,h=function(){return m.Date.now()};function f(q){var A=typeof q;return!!q&&(A=="object"||A=="function")}function T(q){if(typeof q=="number")return q;if(function(G){return typeof G=="symbol"||function(U){return!!U&&typeof U=="object"}(G)&&p.call(G)=="[object Symbol]"}(q))return NaN;if(f(q)){var A=typeof q.valueOf=="function"?q.valueOf():q;q=f(A)?A+"":A}if(typeof q!="string")return q===0?q:+q;q=q.replace(e,"");var D=n.test(q);return D||i.test(q)?a(q.slice(2),D?2:8):t.test(q)?NaN:+q}Lo=function(q,A,D){var G,U,y,B,S,w,k=0,O=!1,E=!1,F=!0;if(typeof q!="function")throw new TypeError("Expected a function");function Z(oe){var L=G,z=U;return G=U=void 0,k=oe,B=q.apply(z,L)}function _(oe){var L=oe-w;return w===void 0||L>=A||L<0||E&&oe-k>=y}function P(){var oe=h();if(_(oe))return V(oe);S=setTimeout(P,function(L){var z=A-(L-w);return E?x(z,y-(L-k)):z}(oe))}function V(oe){return S=void 0,F&&G?Z(oe):(G=U=void 0,B)}function $(){var oe=h(),L=_(oe);if(G=arguments,U=this,w=oe,L){if(S===void 0)return function(z){return k=z,S=setTimeout(P,A),O?Z(z):B}(w);if(E)return S=setTimeout(P,A),Z(w)}return S===void 0&&(S=setTimeout(P,A)),B}return A=T(A)||0,f(D)&&(O=!!D.leading,y=(E="maxWait"in D)?g(T(D.maxWait)||0,A):y,F="trailing"in D?!!D.trailing:F),$.cancel=function(){S!==void 0&&clearTimeout(S),k=0,G=w=U=S=void 0},$.flush=function(){return S===void 0?B:V(h())},$}})();var jo,Bo,Vo={exports:{}},ro={};Bo||(Bo=1,Vo.exports=function(){if(jo)return ro;jo=1;var e=o,t=typeof Object.is=="function"?Object.is:function(p,g){return p===g&&(p!==0||1/p==1/g)||p!=p&&g!=g},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function d(p){var g=p.getSnapshot;p=p.value;try{var x=g();return!t(p,x)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(p,g){return g()}:function(p,g){var x=g(),h=n({inst:{value:x,getSnapshot:g}}),f=h[0].inst,T=h[1];return a(function(){f.value=x,f.getSnapshot=g,d(f)&&T({inst:f})},[p,x,g]),i(function(){return d(f)&&T({inst:f}),p(function(){d(f)&&T({inst:f})})},[p]),l(x),x};return ro.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,ro}()),Vo.exports;var Po,Ho,an={exports:{}},Wt={exports:{}},Dl=Wt.exports;function Uo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Ho)return an.exports;Ho=1;for(var e=(Po||(Po=1,function(){var h,f,T,q,A,D;typeof performance<"u"&&performance!==null&&performance.now?Wt.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Wt.exports=function(){return(h()-A)/1e6},f=process.hrtime,q=(h=function(){var G;return 1e9*(G=f())[0]+G[1]})(),D=1e9*process.uptime(),A=q-D):Date.now?(Wt.exports=function(){return Date.now()-T},T=Date.now()):(Wt.exports=function(){return new Date().getTime()-T},T=new Date().getTime())}.call(Dl)),Wt.exports),t=typeof window>"u"?cn:window,n=["moz","webkit"],i="AnimationFrame",a=t["request"+i],l=t["cancel"+i]||t["cancelRequest"+i],d=0;!a&&d<n.length;d++)a=t[n[d]+"Request"+i],l=t[n[d]+"Cancel"+i]||t[n[d]+"CancelRequest"+i];if(!a||!l){var m=0,p=0,g=[],x=1e3/60;a=function(h){if(g.length===0){var f=e(),T=Math.max(0,x-(f-m));m=T+f,setTimeout(function(){var q=g.slice(0);g.length=0;for(var A=0;A<q.length;A++)if(!q[A].cancelled)try{q[A].callback(m)}catch(D){setTimeout(function(){throw D},0)}},Math.round(T))}return g.push({handle:++p,callback:h,cancelled:!1}),p},l=function(h){for(var f=0;f<g.length;f++)g[f].handle===h&&(g[f].cancelled=!0)}}an.exports=function(h){return a.call(t,h)},an.exports.cancel=function(){l.apply(t,arguments)},an.exports.polyfill=function(h){h||(h=t),h.requestAnimationFrame=a,h.cancelAnimationFrame=l},an.exports})();const wo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:d,onScrollOffset:m,showCustomScrollButtons:p=!1,offset:g=0,totalSize:x=0,viewportSize:h=0,...f}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[T]=Lt(),q=r.useCallbackRef(l,[l]),A=r.useCallbackRef(d,[d]),D=(G=T,U=t,o.useMemo(()=>G===null&&U===null?null:Q=>{Uo(G,Q),Uo(U,Q)},[G,U]));var G,U;const[y,B]=o.useState(()=>{const Q=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?Q.top:Q.left}),S=()=>{const Q=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?Q.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(Q.coords.rowIndex)-Q.topLeft.top,scroll:Q.topLeft.top}:Q.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(Q.coords.colIndex)-Q.topLeft.left,scroll:Q.topLeft.left}},[w,k]=o.useState(S),[O,E]=o.useState(null),[F,Z]=o.useState(!1),_=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),P=()=>{const Q=a.getUsedRange()?.getCoords()??ue.CoordUtils.EmptyRange,X=a.getSelection().getCoords().cell;return{colIndex:Math.max(Q.colEnd,X.colIndex),rowIndex:Math.max(Q.rowEnd,X.rowIndex)}},[V,$]=o.useState(P),oe=V?(i===r.ScrollbarOrientation.Vertical?V.rowIndex:V.colIndex)+1:0,L=()=>{const Q=P();ue.CoordUtils.isEqualCells(V,Q)||$(Q)};tt(a.getView(),{onFreezeSplitChange:()=>{k(S)}}),tt(a.getSelection(),{onChange:L}),tt(a,{onUsedRangeChange:L}),o.useEffect(()=>{$(P())},[a]),o.useEffect(()=>{if(!O)return F&&A?.(),void Z(!1);const Q=_.getTextAt(_.findIndex(y/(a.getView().getZoomScale()/100)+w.scroll+w.shift));Z(!0),q?.({...O,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+Q})},[g,y,w,i,O,_,F,a]);const z=r.useCallbackRef((Q,X,be)=>{B(Q);const ke=Q+w.scroll,ve=X+w.shift,Pe=be+w.shift+w.scroll;m?.(ke,ve,Pe)},[m,w]),K=g-w.scroll,W=h-w.shift,ge=x-(w.shift+w.scroll),ae=_.findOffset(oe)*(a.getView().getZoomScale()/100)-(w.scroll+w.shift);return c.jsx(r.VirtualScrollbar,{ref:D,style:n,offset:K,viewportSize:W,totalSize:ge,orientation:i,showCustomScrollButtons:p,onMouseDown:Q=>{E({anchor:{x:Q.clientX,y:Q.clientY}}),Q.preventDefault()},onScrollOffset:z,onMouseOut:()=>{E(null)},onMouseUp:()=>{E(null)},minSize:ae,...f})}));wo.displayName="SheetScrollbar";const Ko=(e,t,n=null)=>{const i=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;i.push({address:{min:e[a].min,max:e[a].max},update:t})}return i},$o=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:d=30,containerWidth:m,containerHeight:p,headerText:g,freezeStart:x,gridStyle:h,verticalPadding:f,horizontalPadding:T,onSheetContextMenu:q,onResizeHeadersStart:A,onResizeHeaders:D,onResizeHeadersEnd:G,onResizeHeadersDown:U,onResizeHeadersUp:y,scrollPoint:B,onSelectionStart:S,onSelectionEnd:w}=e,k=o.useMemo(()=>n.getOrientation(),[n]),O=o.useRef(null),[E,F]=o.useReducer(j=>j+1,0),[Z,_]=o.useReducer(j=>j+1,0),P=n?.getSheet(),V=o.useRef(!1);o.useLayoutEffect(()=>{V.current=!0},[n]);const $=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),oe=o.useMemo(()=>{const j=k===s.IRange.Orientation.Column;return{left:j?B.left:0,top:j?0:B.top}},[B]),[L,z]=o.useState(P?.getView().getZoomScale()/100),[K,W]=o.useState(null);tt(n,{onSizesChange:j=>{z(P?.getView().getZoomScale()/100),Me(Ce())}});const ge=o.useCallback(()=>{O.current?.invalidate(),_()},[]),ae=o.useCallback(ue.CommonUtils.debounce(()=>{ge()},10),[]),[Q,X]=o.useState(null);tt(n.getSheet(),{onSelectionChange(){X(P?.getSelection().getCoords()),ae()},onProtectionChange(){ge()},onViewChange(){ae()}}),o.useLayoutEffect(()=>{Me(Ce())},[k,L,d]),o.useLayoutEffect(()=>{W(null),z(n?.getSheet().getView().getZoomScale()/100),Me(Ce())},[n]);const be=o.useCallback(j=>n.at(j)?.isHidden()||n.at(j)?.getSize()===0,[n]),ke=o.useCallback((j,J)=>n.hiddenHeadersAt(j,J),[be]),ve=r.useCallbackRef(j=>n.isSelected(j),[n]),Pe=r.useCallbackRef(j=>n.isSelectedAll(j),[n]),he=o.useCallback(()=>n.getMinSize(),[n]),He=o.useCallback(()=>n.getMaxSize(),[n]),Se=r.useCallbackRef((j,J,u)=>{J/=L;const M={size:J=Math.max(he(),Math.min(ue.CommonUtils.roundAccurately(J,he()),He())),hidden:!1},I=[];if(J<=0&&(M.hidden=!0,M.size=u),I.push({address:{min:j,max:j},update:M}),J<0){const b=k===s.IRange.Orientation.Column,N=b?xe.getColOffset:xe.getRowOffset,v=b?xe.getColIndex:xe.getRowIndex,H=N(j);let Y=v(H+J);const ne=N(Y);ne===H+J?Y--:I.push({address:{min:Y,max:Y},update:{size:H-ne+J}}),j-Y>1&&I.push({address:{min:Y+1,max:j-1},update:{hidden:!0}})}n.updateHeaderPairs(I),D?.(j,J,u)},[E,n,L,D]),ce=r.useCallbackRef((j,J,u)=>{const M=k===s.IRange.Orientation.Column;let I=null,b={min:j,max:j};if(n.isSelectedAll(j)){const N=n.getSelectedRuns();N.length>1?I="Resize "+(M?"Columns":"Rows"):b=N[0];const v={hidden:J<=0,size:(J<=0?u:J)/L};n.updateHeaderPairs(Ko(N,v,j))}if(b){const N=b.max-b.min+1;let v;v=N===1?n.getRange(b).at(0).getDisplayText():n.getRange(b).toString(),I=`Resize ${M?"Column":"Row"}${N>1?"s":""} '${v}'`}G?.(j,J,I)},[E,n,G]),de=r.useCallbackRef((j,J)=>{const u=k===s.IRange.Orientation.Column;A(j,J,`Resize ${u?"Column":"Row"}(s)`)},[A]),me=r.useCallbackRef(j=>{let J=!1;const u=k===s.IRange.Orientation.Column,M=n.getSheet().getEntireRange().getCoords(),I=[],b=n.getSelectedRuns(),N=v=>{let H;H=u?{colStart:v.min,rowStart:M.rowStart,colEnd:v.max,rowEnd:M.rowEnd}:{colStart:M.colStart,rowStart:v.min,colEnd:M.colEnd,rowEnd:v.max},I.push(H)};for(let v=0;v<b.length;v++){const H=b[v];H.value.isSelectedAll&&(H.min<=j&&H.max>=j&&(J=!0),N(H))}if(J||N({min:j,max:j}),n.getSheet().getRanges(I).autoFit({orientations:u?s.IRange.Orientations.Column:s.IRange.Orientations.Row}),be(j)){const v={hidden:null},H=Ko(b,v);J||H.push({address:j,update:v}),n.updateHeaderPairs(H)}G?.(j,null,"Resize Column(s)")},[E,n,G,be]),Ce=()=>{const j=k===s.IRange.Orientation.Column;return{getColOffset:J=>j?n.findOffset(J):J===0?0:d/L,getColIndex:J=>j?n.findIndex(J):0,getRowOffset:J=>j?J===0?0:d/L:n.findOffset(J),getRowIndex:J=>j?0:n.findIndex(J)}},[xe,Me]=o.useState(()=>Ce()),we=o.useCallback((j,J)=>j.nativeEvent.which!==r.MouseButtonCodes.Right||!Pe(k===s.IRange.Orientation.Column?J.colIndex:J.rowIndex),[k,Pe]),Ee=r.useCallbackRef(j=>{a.focusSheet()},[a]),Le=r.useCallbackRef(j=>{P?.getSelection().updateCoords(j)},[P]),{...Ve}=dt.useSelection({gridRef:i,commands:null,layout:xe,selection:Q,fillHandleBorderColor:h.body.fill,selectionBackgroundColor:h.selection.fill,selectionBorderColor:h.selection.strokeFill,selectionRemoveBackgroundColor:h.selectionRemove.fill,selectionRemoveBorderColor:h.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:Le,canSelectionSpanMergedCells:j=>{const J=P.getRange(j);return J.isEntireColumns()||J.isEntireRows()}}),C=r.useCallbackRef(()=>{S?.();const j=P?.getSelection();j&&j.setAdjusting(j.getCoords())},[P,S]),Ue=r.useCallbackRef(async()=>{P?.getSelection().setAdjusting(null),w?.()},[P,w]),{...Qe}=dt.useHeaderSelection({orientation:k,headerCount:$,gridRef:O,gridMainRef:i,newSelection:Ve?.newSelection,modifySelection:Ve?.modifySelection,appendSelection:Ve?.appendSelection,clearSelections:Ve?.clearSelections,pointerDownInterceptor:we,onPointerUp:Ee,onDragStart:C,onDragEnd:Ue}),$e=h.selection?.strokeFill;o.useEffect(()=>{if(!O.current)return void W(null);const j=k===s.IRange.Orientation.Column,J=n.getSelectedRuns(),u=n.isProtected()?null:Se,M=(b,N,v)=>{if(v)return j?c.jsx("div",{style:{position:"absolute",borderBottom:`${h.headerSelection.strokeWidth}px solid ${$e}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(v.x-h.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(v.width+h.headerSelection.strokeWidth+1,!0)}px`,height:d+h.headerSelection.strokeWidth-.5+"px"}},b):c.jsx("div",{style:{position:"absolute",borderRight:`${h.headerSelection.strokeWidth}px solid ${$e}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(v.y-h.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,width:d+h.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(v.height+h.headerSelection.strokeWidth+1,!0)}px`}},b)},I=(b,N,v)=>{const H={x:0,y:0,width:0,height:0};if(j){const Y=v.toClipBounds(v.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:b,colEnd:Math.min($,N)}),dt.SELECTION_CLIP_INSETS);if(!Y)return;H.x=Y.x,H.width=Y.width}else{const Y=v.toClipBounds(v.getRangeCoordsBounds({rowStart:b,rowEnd:Math.min($,N),colStart:0,colEnd:0}),dt.SELECTION_CLIP_INSETS);if(!Y)return;H.y=Y.y,H.height=Y.height}return{x:H.x,y:H.y,width:H.width,height:H.height}};W([b=>{const N=[];let v=null,H=j?b.getVisibleColumns():b.getVisibleRows();const Y=j?b.getTotalRangeCoords().colStart:b.getTotalRangeCoords().rowStart;H.length>0&&H[0]>Y&&(H=[H[0]-1,...H]);let ne=[];const le=[];for(let pe=0;pe<H.length;pe++){const qe=H[pe],Oe=pe<H.length-1?H[pe+1]:qe+ke(qe+1,!1)+1,De=qe+1!==Oe;if(!v||v.max<qe)if(J.length>0&&J[J.length-1].max>=qe){const Ge=ue.CommonUtils.findEqualOrGreater(J,qe,Ne=>Ne.max);v=J[Ge]}else v=null;let We=!1,je=!1;if(v?.value&&(v.min<=qe||v.min<=Oe&&!De)&&(We=!0,je=v.value.isSelectedAll),qe===Y){let Ge=!1,Ne=!1;v?.value&&v.min<=qe&&(Ge=!0,Ne=v.value.isSelectedAll),qe>0&&le.push({index:qe-1,isNextHidden:De,isSelected:Ge,isSelectedAll:Ne,disabledResize:!0})}if(je&&ne.push(le.length),le.push({index:qe,isHidden:pe===0&&ke(qe,!1)>0,isNextHidden:De,isSelected:We,isSelectedAll:je,onDividerMouseDown:U,onDividerResizeStart:de,onDividerResize:u,onDividerMouseUp:y,onDividerResizeEnd:ce,onDividerAutoFit:me}),De){let Ge=!1,Ne=!1;if(v&&v.min>=qe&&v.max<=Oe-1&&v.value.isSelectedAll&&ne.push(le.length),!(v?.value&&v.max>=Oe))if(J.length>0&&J[J.length-1].max>=Oe){const Xe=ue.CommonUtils.findEqualOrGreater(J,Oe,it=>it.max);v=J[Xe]}else v=null;v?.value&&v.min<=Oe&&(Ge=v.value.isSelected,Ne=v.value.isSelectedAll),Oe>0&&le.push({index:Oe-1,isHidden:!0,isSelected:Ge,isSelectedAll:Ne,onDividerMouseDown:U,onDividerResizeStart:de,onDividerResize:u,onDividerMouseUp:y,onDividerResizeEnd:ce,onDividerAutoFit:me})}}if(ne.length>0){let pe=ne.length-1;if(ne.length>0){const De=le[ne[pe]].index;let We=null;j?(We=b.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:De,colEnd:De}),We.x+We.width>b.getBounds().width&&(pe-=1,pe===0&&(pe=-1))):(We=b.getRangeCoordsBounds({rowStart:De,rowEnd:De,colStart:0,colEnd:0}),We.y+We.height>b.getBounds().height&&(pe-=1,pe===0&&(pe=-1)))}const qe=J?.[J.length-1],Oe=b.getAnchor();if(Oe==="t"||Oe==="l"){const De=le[ne[Math.max(0,ne.length-1)]];De.showTouchDivider=qe&&qe.max<=De.index}else pe>=0&&(le[ne[pe]].showTouchDivider=!0)}const{header:ie,headerSelect:se,headerSelectAll:ye,headerHover:fe}=h??{};for(let pe=0;pe<le.length;pe++)N.push(c.jsx(dt.HeaderDivider,{orientation:k,view:b,headerStyle:ie,headerStyleSelect:se,headerStyleSelectAll:ye,headerStyleHover:fe,disabled:n.isProtected(),...le[pe]},`divider${pe}`));return N},b=>{const N=[];for(let v=0;J&&v<J.length;v++)N.push(M(`selection:${b.getAnchor()}:${v}`,0,I(J[v].min,J[v].max,b)));return N}])},[Z,!0,$e,h,xe,$,x,E,L]),o.useEffect(()=>{O.current?.invalidate()},[E]);const ee=r.useCallbackRef(j=>g?g(j):n.getTextAt(j),[g,n]),Fe=r.useCallbackRef(j=>{const{header:J,headerSelect:u,headerSelectAll:M,headerHover:I}=h??{},{range:b,key:N,...v}=j;return c.jsx(dt.HeaderRenderer,{orientation:k,index:k===s.IRange.Orientation.Column?b.colStart:b.rowStart,isSelected:ve,isSelectedAll:Pe,zoomScale:100*L,headerText:ee,headerStyle:J,headerStyleSelect:u,headerStyleSelectAll:M,headerStyleHover:I,verticalPadding:f,horizontalPadding:T,...v},N)},[E,$,h,L,n]),Be=r.useEditMode(),Ie=o.useMemo(()=>{const j="white",J="black",u={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let M=k===s.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='${J}' fill='${j}'/%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='${J}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;Be.getMode()?.key==="formatPainter"&&(M=`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='${J}' fill='${j}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),u.cursor=M}return u.backgroundColor=h?.header?.fill||"transparent",u},[k,E,Be,h]),ze=r.useImperativeElement(t,()=>({scrollTo:j=>{O.current?.scrollTo(j)},forceRender:()=>{F()},getGridElement:()=>O.current}),[]),Ae=o.useCallback(j=>{Qe.onPointerDown(j)},[Qe]),R=o.useCallback(j=>{const J=Qe.getCellCoordsFromClient(j.clientX,j.clientY);if(!J||!q)return;const u=k===s.IRange.Orientation.Column;q({originalEvent:j,clientX:j.clientX,clientY:j.clientY,rowIndex:u?-1:J.rowIndex,colIndex:u?J.colIndex:-1}),j.stopPropagation(),j.preventDefault()},[Qe,q]),re=o.useMemo(()=>{const j=k===s.IRange.Orientation.Column;return c.jsx("div",{ref:ze,children:c.jsx(dt.Grid,{className:"sheet-header",style:Ie,ref:O,scrollPoint:oe,columnCount:j?$:1,rowCount:j?1:$,width:j?m:d,height:j?d:p,freezeLeft:j?x:void 0,freezeTop:j?void 0:x,hiddenColumnsAt:j?ke:void 0,hiddenRowsAt:j?void 0:ke,showGridLines:!1,layout:xe,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:R,onPointerDown:Ae,zoom:L,cellRenderer:Fe,overlays:K})})},[K,xe,m,p,oe,Ie,Z]);return o.useEffect(()=>{V.current=!1,O.current?.invalidate(),_()},[n,h]),re})),zl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,d=r.useCallbackRef((g,x)=>g.getStyle().getBorder(),[]),{overlay:m}=bo({getVisibleCells:a,getBorderAt:d,darkMode:l.body.darkMode,shiftIfWide:!0}),p=m(n);return p&&n?p:null})),Nl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Ll={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Ol={type:s.ICell.Content.Values},jl={fitDestination:!0,type:s.ICell.Content.Formats},Bl={fitDestination:!0,type:s.ICell.Content.Formulas},Vl={transpose:!0},Pl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},kr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:d=dt.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:p="rgb(33, 115, 70)",copyBackgroundColor:g="white",cutBackgroundColor:x="white",notifier:h,...f})=>{const T=r.useCallbackRef(d,[d]),q=o.useRef(null),A=r.useEditMode(),D=A.getMode(),G=o.useMemo(()=>({element:e,doCopy:w=>{const k=t.getSelectedRanges().getSnapshot(w);return new s.RangeClipboardItem(k)}}),[t,n,e]),U=o.useMemo(()=>({element:e,importFromExternal:async(w,k)=>{const O=new s.ExternalRangeClipboardItem(w,k,t.getStyles(),t.isDate1904());return await O.parse()?O:null},doPaste:async(w,k)=>{if(w?.getItemType()!=="range")return;k?.contentsOnly&&delete(k={...k,type:s.ICell.Content.Values}).contentsOnly;const O=t.getSelectedRange(),E=w.getItem(),F=E.getName();return await O.doBatch(async()=>{const Z=await O.copyFrom(E,k);!Z||Z.isEntireRows()||Z.isEntireColumns()||Z.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(F?` ${F}`:""),autoSelect:!0}),!0}}),[t,n,h,e]),{clipboard:y,...B}=r.useCopyPaste({...f,source:G,commands:i,target:U,notifier:h,onClipboardUpdate:w=>{const k=w?.getItemType()==="range"?w:null;if(k){const O=w.editMode?.(),E={...w?.isCut?.()?Ll:Nl,...O,args:{isClipboard:!0,...O?.args},onModeChange:F=>{F?.args?.isClipboard||y.clear(!0),O?.onModeChange?.(F)}};A.setMode(E)}q.current=k,a?.(k)},onPaste:(w,k)=>{if(w?.getItemType()!=="range")return;let O=A.getMode()?.key==="cut"||w.isCut?.();if(!O&&A.getMode()?.key==="copy"){const E=w.getItem().getCoords(),F=t.getSelectedRanges().getCoords();let Z=!1;if(!Z&&E&&F&&w.getItem().getSource?.()===t)for(let _=0;!Z&&_<F.length;_++)Z=ue.CoordUtils.isRangesIntersect(E,F[_]);O=Z}O&&A.setMode(null),e?.()?.focus(),l?.(w,k)}});o.useMemo(()=>{const w=e;if(!i)return;const k=[new r.Command("pasteValues",w,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
19
+ All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){L(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection)."}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet."}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet."}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns."}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height."}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width."})],[]),f=o.useMemo(()=>{let c=null;return c=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),c.addCommands(Fe,!0),c},[a,Fe]),[Le,Xe]=o.useState(!1),[Ue,Q]=o.useState(!1);o.useEffect(()=>{if(M.current!==t||!h)return;const c=h.getCoords(),q=t.getTables().getItems({address:c[0]});I(H=>ge.CommonUtils.isEqualArrays(H,q)?H:q),g&&q[0]&&ge.CoordUtils.isCellWithinRange(g,q[0].getRange().getCoords())?ve(q[0]??null):ve(null);const T=t.getSelectedRanges(),b=T.getMerges().length>0,N=T.isOverlapping();let C=!0;for(let H=0;C&&H<c.length;H++)C=ge.CoordUtils.isSingleCell(c[H]);Q(N),Xe(q.length===0&&!N&&(b||!C))},[be,h,t]),r.useCommands(a,null,{onChange:()=>{const c=!t.getProtection().isFormatCellsAllowed(),q=w.getMode()?.key==="formatPainter";f.getCommand("formatPainterToggle").update({disabled:c||!a?.getCommand("copy"),state:()=>q}).updateCallback(()=>q?void w.setMode(null):f.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`}}))}},[w,Me,a]),tt(t.getView(),{onFreezeSplitChange:()=>{xe()}}),tt(t.getSelection(),{onChange:()=>{W()}});const qe=()=>{f.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:c=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:c=>t.getStyles().addRecentColor(c),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),f.getCommand("formatSheetTabColor").updateCallback(c=>{t.setTabColor(c)}).update({state:()=>t?.getTabColor()??Tn,context:()=>({onColorSelect:c=>{},darkMode:i.darkMode,autoColor:Tn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:c=>t.getStyles().addRecentColor(c),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},je=()=>{f.getCommand("formatBorder").update({context:()=>({onBorderSelect:c=>{G(c)},darkMode:i.darkMode,quickBorder:D,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:s.IBorder.StrokeStyle.Thin,createTemporaryBorder:c=>t.getStyles().getNormal().createTemporaryStyle({border:c}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{je()},[D]),o.useEffect(()=>{const c=!t.getProtection().isInsertHyperlinksAllowed();f.getCommand("openHyperlink").update({disabled:!_().getHyperlink()}),f.getCommand("deleteHyperlink").update({disabled:c||!_().getHyperlink()});const q=_().getHyperlink()?"Edit":"Insert",T="Link";f.getCommand("updateHyperlink").update({label:()=>(_().getHyperlink(),`${q} ${T}`),scopedLabels:{contextMenu:`${q} ${T}…`,insert:`${T}…`,hyperlink:`${q}…`},disabled:c})},[_()?.getHyperlink(),Me]),o.useEffect(()=>{const c=_().getComments(),q=()=>c?"Edit":"Insert",T=()=>c?"Comments":"Comment";f.getCommand("updateComments").update({label:()=>`${q()} ${T()}`,scopedLabels:{contextMenu:`${q()} ${T()}…`,insert:`${T()}…`}})},[_()?.getComments(),Me]),tt(t,{onViewChange:()=>{const c=t.getView();f.getCommand("sheetViewToggleFormulaView").update({state:c.isShowFormulas()}),f.getCommand("sheetViewToggleShowZeros").update({state:c.isShowZeros()}),f.getCommand("gridlinesToggle").update({state:c.isShowColumnGridlines()||c.isShowRowGridlines()}),f.getCommand("sheetViewToggleGridlinesColumns").update({state:c.isShowColumnGridlines()}),f.getCommand("sheetViewToggleGridlinesRows").update({state:c.isShowRowGridlines()}),f.getCommand("sheetViewToggleShowHeadings").update({state:c.isShowColumnHeaders()||c.isShowRowHeaders()}),f.getCommand("sheetViewToggleShowHeadingColumns").update({state:c.isShowColumnHeaders()}),f.getCommand("sheetViewToggleShowHeadingRows").update({state:c.isShowRowHeaders()}),f.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero}),qe()},onTabColorChange:()=>{qe()},onMergesChange:()=>{xe()},onMovablesChange:()=>{xe()},onTablesChange:()=>{xe()},onProtectionChange:()=>{xe(),de()},onStyleChange:()=>{qe(),je(),xe()}}),o.useEffect(()=>{qe(),je()},[i]),o.useEffect(()=>{const c=!t.getProtection().isFormatCellsAllowed(),q=j.length>0&&!ae||c,T=$e(ae),b={context:T};f.getCommand("editTable").update(b),f.getCommand("deleteTable").update(b),f.getCommand("convertTableToRange").update(b);const N={context:T,disabled:q};f.getCommand("formatTableStyle").update({label:ae?"Apply Table Style":"Format As Table",...N}),f.getCommand("formatTableStyleClearCellStyles").update(N),f.getCommand("deleteTableStyle").update(N),f.getCommand("convertTableToRange").update(N),f.getCommand("insertTable").update({disabled:q||j.length>0});const C={context:T,disabled:q||j.length===0};f.getCommand("tableHeaderRowToggle").update(C),f.getCommand("tableTotalRowToggle").update(C),f.getCommand("autoFilterToggle").update(C),f.getCommand("formatTableStyleClearTableStyle").update({...C,disabled:C.disabled||!ae||ae.getStyleOptions().name===null})},[ae,j,Me]),o.useEffect(()=>{f.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),f.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale())})}),f.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),f.getCommand("gridlinesToggle").updateCallback(()=>{const c=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!c,showRowGridlines:!c})}),f.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),f.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),f.getCommand("sheetViewFormatGridlinesColor").updateCallback(c=>{t.getView().update({gridLineColor:c})}),f.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const c=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!c,showRowHeaders:!c})}),f.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),f.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),f.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const c=t.getView().getColumnHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===s.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:c?s.ISheetView.HeaderTextStyle.A1:s.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:c?s.ISheetView.HeaderTextStyle.One:s.ISheetView.HeaderTextStyle.Zero})}),f.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),f.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),f.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),f.getCommand("insertFunction").update({context:()=>({searchByCategory:async c=>{const q=t.getWorkbook();if(!q)return ge.CommonUtils.EmptyArray;const T=await q.getScripts().searchFunctions({category:c});return console.log("category",c,T),T}})})},[t]),o.useEffect(()=>{const c=t.getView().getFreezePanes(),q=()=>c.coords.rowIndex!==0,T=()=>c.coords.colIndex!==0,b=()=>c.coords.rowIndex!==0||c.coords.colIndex!==0;f.getCommand("freezeToggle").updateCallback(()=>{b()?t.getView().setFreezePanes(null):b()?T()?t.getView().setFreezePanes({coords:{rowIndex:g.rowIndex}}):q()&&t.getView().setFreezePanes({coords:{colIndex:g.colIndex}}):t.getView().setFreezePanes({coords:g})}).update({state:b,disabled:()=>!g||!b()&&g.rowIndex===0&&g.colIndex===0}),f.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:q()?0:g.rowIndex}})}).update({state:q,disabled:()=>!g||!q()&&g.rowIndex===0}),f.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:T()?0:g.colIndex}})}).update({state:T,disabled:()=>!g||!T()&&g.colIndex===0}),f.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!b()})},[be,g,t,i]);const Te=_().getStyle(),De=Te.getFont(),ze=Te.getAlignment(),S=ze.getHorizontal(),le=ze.getVertical(),O=ze.getOverflow(),Y=ze.getRotation();return o.useEffect(()=>{f.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>_().getStyle(!0).getNamed(),bodyStyle:Ke,createTemporaryCell:Oe=>t.createTemporaryCell(Oe)})}),f.getCommand("formatFillColor").update({state:()=>{let Oe=null;const Ye=Te.getFill();return Ye?.getType()===s.IFill.Type.Solid?Oe=Ye.getColor():Ye?.getType()===s.IFill.Type.Gradient?Oe=Ye.getStops()?.[0]?.getColor():Ye?.getType()===s.IFill.Type.Pattern&&(Oe=Ye.getBackground()),Oe},context:()=>{const Oe=t.getStyles();return{onColorSelect:Ye=>{F(Ye??Tn)},darkMode:i.darkMode,quickColor:U,autoColor:Tn,schemeLookup:Oe.schemeLookup(),recentColors:Oe.recentColors(),addRecentColor:Ye=>Oe.addRecentColor(Ye),clearRecentColors:()=>Oe.clearRecentColors()}}}),f.getCommand("formatFontColor").update({state:()=>De.toJSON()?.fill?De.getFill():null,context:()=>{const Oe=t.getStyles();return{onColorSelect:Ye=>{y(Ye)},darkMode:i.darkMode,quickColor:V,autoColor:Oe.getNormal().getFont().getFill(),schemeLookup:Oe.schemeLookup(),recentColors:Oe.recentColors(),addRecentColor:Ye=>Oe.addRecentColor(Ye),clearRecentColors:()=>Oe.clearRecentColors()}}}),f.getCommand("formatNumberFormat").update({state:()=>Te.getNumberFormat(),context:()=>_}),f.getCommand("formatNumberDialog").update({state:()=>Te.getNumberFormat(),context:()=>_}),f.getCommand("formatFontFamily").update({state:()=>De.getFamily()}),f.getCommand("formatFontSize").update({state:()=>De.getSize()});const c=function(){const Oe=De.getWeight()||0;return!isNaN(Oe)&&Oe>500};f.getCommand("formatBoldToggle").updateCallback(function(){B(this,{font:{weight:c()?400:700}})}).update({state:c});const q=function(){return De.getStyle()===s.IFont.Style.Italic};f.getCommand("formatItalicToggle").updateCallback(function(){B(this,{font:{style:q()?s.IFont.Style.Normal:s.IFont.Style.Italic}})}).update({state:q}),f.getCommand("formatStrikeThroughToggle").updateCallback(function(){B(this,{font:{strike:!De.getStrike()}})}).update({state:De.getStrike()}),f.getCommand("formatUnderlinedToggle").updateCallback(function(){B(this,{font:{underline:De.getUnderline()!==s.IFont.UnderlineStyle.Single?s.IFont.UnderlineStyle.Single:s.IFont.UnderlineStyle.None}})}).update({state:De.getUnderline()===s.IFont.UnderlineStyle.Single}),f.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){B(this,{font:{underline:De.getUnderline()!==s.IFont.UnderlineStyle.Double?s.IFont.UnderlineStyle.Double:s.IFont.UnderlineStyle.None}})}).update({state:De.getUnderline()===s.IFont.UnderlineStyle.Double}),f.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){B(this,{font:{underline:De.getUnderline()!==s.IFont.UnderlineStyle.SingleAccounting?s.IFont.UnderlineStyle.SingleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:De.getUnderline()===s.IFont.UnderlineStyle.SingleAccounting}),f.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){B(this,{font:{underline:De.getUnderline()!==s.IFont.UnderlineStyle.DoubleAccounting?s.IFont.UnderlineStyle.DoubleAccounting:s.IFont.UnderlineStyle.None}})}).update({state:De.getUnderline()===s.IFont.UnderlineStyle.DoubleAccounting}),f.getCommand("formatSuperscriptToggle").updateCallback(function(){B(this,{font:{verticalAlign:De.getVerticalAlignment()!==s.IFont.VerticalAlignment.Super?s.IFont.VerticalAlignment.Super:s.IFont.VerticalAlignment.Baseline}})}).update({state:De.getVerticalAlignment()===s.IFont.VerticalAlignment.Super}),f.getCommand("formatSubscriptToggle").updateCallback(function(){B(this,{font:{verticalAlign:De.getVerticalAlignment()!==s.IFont.VerticalAlignment.Sub?s.IFont.VerticalAlignment.Sub:s.IFont.VerticalAlignment.Baseline}})}).update({state:De.getVerticalAlignment()===s.IFont.VerticalAlignment.Sub});const T=()=>O===s.ITextFrame.Overflow.Visible;f.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){B(this,{alignment:{overflow:(T(),s.ITextFrame.Overflow.Visible)}})}).update({state:T});const b=()=>O===s.ITextFrame.Overflow.Wrap;f.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){B(this,{alignment:{overflow:b()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Wrap}})}).update({state:b});const N=function(){return O===s.ITextFrame.Overflow.Clip};f.getCommand("formatTextOverflowClipToggle").updateCallback(function(){B(this,{alignment:{overflow:N()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Clip}})}).update({state:N});const C=function(){return O===s.ITextFrame.Overflow.Shrink};f.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){B(this,{alignment:{overflow:C()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Shrink}})}).update({state:C});const H=function(){return O===s.ITextFrame.Overflow.Shrink};f.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){B(this,{alignment:{overflow:H()?s.ITextFrame.Overflow.Visible:s.ITextFrame.Overflow.Ellipsis}})}).update({state:H,disabled:!0});const X=function(){return le===s.ITextFrame.VerticalAlignment.Top};f.getCommand("formatAlignTopToggle").updateCallback(function(){B(this,{alignment:{vertical:X()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Top}})}).update({state:X});const te=function(){return le===s.ITextFrame.VerticalAlignment.Center};f.getCommand("formatAlignMiddleToggle").updateCallback(function(){B(this,{alignment:{vertical:te()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Center}})}).update({state:te});const ie=function(){return le===s.ITextFrame.VerticalAlignment.Bottom};f.getCommand("formatAlignBottomToggle").updateCallback(function(){B(this,{alignment:{vertical:(ie(),s.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:ie});const se=function(){return le===s.ITextFrame.VerticalAlignment.Justify};f.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){B(this,{alignment:{vertical:se()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Justify}})}).update({state:se});const ce=function(){return le===s.ITextFrame.VerticalAlignment.Distributed};f.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){B(this,{alignment:{vertical:ce()?s.ITextFrame.VerticalAlignment.Bottom:s.ITextFrame.VerticalAlignment.Distributed}})}).update({state:ce});const ye=function(){return S===s.ITextFrame.HorizontalAlignment.Left};f.getCommand("formatAlignLeftToggle").updateCallback(function(){B(this,{alignment:{horizontal:ye()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Left}})}).update({state:ye});const fe=function(){return S===s.ITextFrame.HorizontalAlignment.Center};f.getCommand("formatAlignCenterToggle").updateCallback(function(){B(this,{alignment:{horizontal:fe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Center}})}).update({state:fe});const pe=function(){return S===s.ITextFrame.HorizontalAlignment.CenterContinuous};f.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const Oe={alignment:{horizontal:pe()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};B(this,Oe)}).update({state:pe});const we=function(){return S===s.ITextFrame.HorizontalAlignment.Fill};f.getCommand("formatAlignFillToggle").updateCallback(function(){const Oe={alignment:{horizontal:we()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Fill,rotation:null}};B(this,Oe)}).update({state:we});const Be=function(){return S===s.ITextFrame.HorizontalAlignment.Distributed};f.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){B(this,{alignment:{horizontal:Be()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Be});const Ne=function(){return S===s.ITextFrame.HorizontalAlignment.Right};f.getCommand("formatAlignRightToggle").updateCallback(function(){B(this,{alignment:{horizontal:Ne()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Right}})}).update({state:Ne});const We=function(){return S===s.ITextFrame.HorizontalAlignment.Justify};f.getCommand("formatAlignJustifyToggle").updateCallback(function(){B(this,{alignment:{horizontal:We()?s.ITextFrame.HorizontalAlignment.General:s.ITextFrame.HorizontalAlignment.Justify}})}).update({state:We});const Ve=!t.getProtection().isFormatCellsAllowed(),Ge=S===s.ITextFrame.HorizontalAlignment.CenterContinuous||S===s.ITextFrame.HorizontalAlignment.Fill;f.getCommand("formatTextRotate0").updateCallback(function(Oe){B(this,{alignment:{rotation:0}})}).update({disabled:Ve||Ge,state:Y===0}),f.getCommand("formatTextRotate45").updateCallback(function(Oe){B(this,{alignment:{rotation:Oe??1?45:0}})}).update({disabled:Ve||Ge,state:Y===45}),f.getCommand("formatTextRotate90").updateCallback(function(Oe){B(this,{alignment:{rotation:Oe??1?90:0}})}).update({disabled:Ve||Ge,state:Y===90}),f.getCommand("formatTextRotate270").updateCallback(function(Oe){B(this,{alignment:{rotation:Oe??1?270:0}})}).update({disabled:Ve||Ge,state:Y===270}),f.getCommand("formatTextRotate315").updateCallback(function(Oe){B(this,{alignment:{rotation:Oe??1?315:0}})}).update({disabled:Ve||Ge,state:Y===315}),f.getCommand("formatTextRotateCustom").updateCallback(function(Oe){B(this,{alignment:{rotation:Oe}})}).update({disabled:Ve||Ge,state:Y??0})},[Te,t,i,U,V]),o.useEffect(()=>{const c=!t.getProtection().isFormatCellsAllowed(),q=t.getSelectedRanges().getMerges().length>0,T=async(_e,rt)=>{P(rt,async vt=>{const wt=async(gt=!1)=>{const lt=await Promise.resolve(d?.showBusy?.(rt.label()));try{const It=vt.getSelectedRanges();if(It.merge({orientations:_e,discardMultipleValues:gt}),_e===s.IRange.Orientations.Both){const jt={alignment:{horizontal:s.ITextFrame.HorizontalAlignment.Center}};It.updateStyle(jt)}}catch(It){throw It}finally{lt?.()}};let Ct;try{await wt()}catch(gt){if(gt.type!=="discardMultipleValues")throw gt;Ct=!0}if(Ct&&d?.showOptions){if(await d?.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await wt(!0)}},void 0,void 0,!1)},b=_e=>{P(_e,async rt=>{try{const vt=rt.getSelectedRanges();vt.unmerge();const wt={alignment:{horizontal:null}};vt.updateStyle(wt)}catch(vt){throw vt}})};f.getCommand("mergeToggle").updateCallback(function(){ge.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(q?b(this):T(s.IRange.Orientations.Both,this))}).update({state:q,disabled:!Le||c}),f.getCommand("mergeHorizontal").updateCallback(function(){T(s.IRange.Orientations.Column,this)}).update({disabled:!Le||c}),f.getCommand("mergeVertical").updateCallback(function(){T(s.IRange.Orientations.Row,this)}).update({disabled:!Le}),f.getCommand("unmerge").updateCallback(function(){b(this)}).update({disabled:!q||!Le||c});const N={disabled:c};f.getCommand("hideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(N),f.getCommand("hideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!0)})}).update(N),f.getCommand("unhideRows").updateCallback(function(){P(this,_e=>{_e.getRowHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(N),f.getCommand("unhideColumns").updateCallback(function(){P(this,_e=>{_e.getColumnHeaders().setHidden(_e.getSelectedRanges().getCoords(),!1)})}).update(N),f.getCommand("autoFitRows").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Row})})}).update(N),f.getCommand("autoFitColumns").updateCallback(function(){P(this,_e=>{_e.getSelectedRanges().autoFit({orientations:s.IRange.Orientations.Column})})}).update(N);let C=!1,H=0,X=!1,te=!1,ie=0,se=!1;!h||c||Ue||(C=h.isEntireColumnsAny(),C&&!h.isEntireColumns()?X=!0:H=h.getColumnCount(),te=h.isEntireRowsAny(),te&&!h.isEntireRows()?se=!0:ie=h.getRowCount());const ce={disabled:c||h&&h.getCount()!==1};f.getCommand("sortAscending").update(ce),f.getCommand("sortDescending").update(ce);const ye={disabled:C||te||c||Ue},fe=C||c||Ue||se;fe&&(H=1);const pe=te||c||Ue||X;pe&&(ie=1);let we="",Be="",Ne="",We="",Ve="",Ge="",Oe="",Ye="",it="";H>1&&(Ge=Be=H+" ",Oe=Ne="s"),ie>1&&(Ye=We=ie+" ",it=Ve="s"),w.getMode()?.key==="copy"?(we=We=Be="Copied ",Ne=Ve="s"):w.getMode()?.key==="cut"&&(we=We=Be="Cut ",Ne=Ve="s");let pt="",xt="";if(h){const _e=h.getDefaultShiftOrientation()===s.IRange.Orientation.Column;pt=` (${_e?"Shift Right":"Shift Down"})`,xt=` (${_e?"Shift Left":"Shift up"})`,f.getCommand("deleteCells").update({label:`Delete Cells${xt}`})}f.getCommand("insertCells").update({label:`Insert ${we}Cells${pt}`,scopedLabels:{insertCells:`${we}At Selection`}}),f.getCommand("insertCellsShiftRight").update(ye),f.getCommand("insertCellsShiftDown").update(ye),f.getCommand("deleteCellsShiftUp").update(ye),f.getCommand("deleteCellsShiftLeft").update(ye),f.getCommand("insertRows").update({label:`Insert ${We}Row${Ve}`,scopedLabels:{insertCells:`${We}Row${Ve}`},disabled:pe}),f.getCommand("insertRowsAfter").update({label:`Insert ${We}Row${Ve} Below`,disabled:pe}),f.getCommand("insertColumns").update({label:`Insert ${Be}Column${Ne}`,scopedLabels:{insertCells:`${Be}Column${Ne}`},disabled:fe}),f.getCommand("insertColumnsAfter").update({label:`Insert ${Be}Column${Ne} After`,disabled:fe}),f.getCommand("deleteRows").update({label:`Delete ${Ye}Row${it}`,scopedLabels:{deleteCells:`${Ye}Row${it}`},disabled:pe}),f.getCommand("deleteColumns").update({label:`Delete ${Ge}Column${Oe}`,scopedLabels:{deleteCells:`${Ge}Column${Oe}`},disabled:fe})},[be,Le,Ue,h,w,d,Me]),o.useEffect(()=>{const c=t.getProtection(),q=t.getProtection().isLocked(),T=!c.isFormatCellsAllowed(),b={disabled:T};f.getCommand("protectionSheetToggle").updateCallback(async(H,X)=>{let te=null;try{if(q){let ie=null;if(c.hasPassword()){const se=await d?.showInputOptions({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(se.option!=="Unprotect")return;ie=se.input}te=await Promise.resolve(d?.showBusy?.(X.label())),await c.unlock(ie)}else te=await Promise.resolve(d?.showBusy?.(X.label())),await c.lock();te?.()}catch(ie){te?.(),d?.showError?.(ie)}}).update({state:q,label:()=>q?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:q?"Unprotect":"Protect"}}),f.getCommand("deleteTable").update(b),f.getCommand("sortAscending").update(b),f.getCommand("sortDescending").update(b),f.getCommand("sortCustom")?.update(b),f.getCommand("updateComments").update(b),f.getCommand("deleteComments").update(b),f.getCommand("insertChart")?.update(b),f.getCommand("insertImageFromFile").update(b),f.getCommand("insertImageFromURL").update(b),f.getCommand("formatBorder").update(b),f.getCommand("formatFillColor").update(b),f.getCommand("formatFontColor").update(b),f.getCommand("formatBoldToggle").update(b),f.getCommand("formatItalicToggle").update(b),f.getCommand("formatUnderlinedToggle").update(b),f.getCommand("formatStrikeThroughToggle").update(b),f.getCommand("formatSuperscriptToggle").update(b),f.getCommand("formatSubscriptToggle").update(b),f.getCommand("formatAlignTopToggle").update(b),f.getCommand("formatTextOverflowVisibleToggle").update(b),f.getCommand("formatTextOverflowWrapToggle").update(b),f.getCommand("formatTextOverflowClipToggle").update(b),f.getCommand("formatTextOverflowShrinkToggle").update(b),f.getCommand("formatAlignMiddleToggle").update(b),f.getCommand("formatAlignBottomToggle").update(b),f.getCommand("formatAlignDistributedVerticalToggle").update(b),f.getCommand("formatAlignJustifyVerticalToggle").update(b),f.getCommand("formatAlignLeftToggle").update(b),f.getCommand("formatAlignCenterToggle").update(b),f.getCommand("formatAlignRightToggle").update(b),f.getCommand("formatAlignJustifyToggle").update(b),f.getCommand("formatAlignCenterContinuousToggle").update(b),f.getCommand("formatAlignDistributedHorizontalToggle").update(b),f.getCommand("formatAlignFillToggle").update(b),f.getCommand("formatFontSizeIncrease").update(b),f.getCommand("formatFontSizeDecrease").update(b),f.getCommand("formatFontFamily").update(b),f.getCommand("formatFontSize").update(b),f.getCommand("formatNumberFormat").update(b),f.getCommand("formatNumberFormatGeneralStyle").update(b),f.getCommand("formatNumberFormatNumberStyle").update(b),f.getCommand("formatNumberFormatTimeStyle").update(b),f.getCommand("formatNumberFormatDateStyle").update(b),f.getCommand("formatNumberFormatAccountingStyle").update(b),f.getCommand("formatNumberFormatPercentStyle").update(b),f.getCommand("formatNumberFormatScientificStyle").update(b),f.getCommand("formatNumberFormatCommaStyle").update(b),f.getCommand("formatNumberFormatIncreaseDecimal").update(b),f.getCommand("formatNumberFormatDecreaseDecimal").update(b),f.getCommand("hideColumns").update(b),f.getCommand("unhideColumns").update(b),f.getCommand("hideRows").update(b),f.getCommand("unhideRows").update(b),f.getCommand("insertFunctionSum").update(b),f.getCommand("insertFunctionAverage").update(b),f.getCommand("insertFunctionCount").update(b),f.getCommand("insertFunctionMax").update(b),f.getCommand("insertFunctionMin").update(b),f.getCommand("insertFunction").update(b),f.getCommand("startEditCurrentTime").update(b),f.getCommand("startEditCurrentDate").update(b),f.getCommand("startEditValueAbove").update(b),f.getCommand("fillDown").update(b),f.getCommand("fillRight").update(b),f.getCommand("fillUp").update(b),f.getCommand("fillLeft").update(b),f.getCommand("formatCellStyle").update(b),f.getCommand("formatTableStyle").update(b),f.getCommand("formatPainterToggle").update(b),f.getCommand("formatBorderAddOutline").update(b),f.getCommand("formatBorderClearOutline").update(b),f.getCommand("formatIndentDecrease").update(b),f.getCommand("formatIndentIncrease").update(b),f.getCommand("clearContents").update(b),f.getCommand("clearFormats").update(b),f.getCommand("clearAll").update(b),f.getCommand("clearComments").update(b),f.getCommand("clearHyperlinks").update(b),f.getCommand("autoFilterClear").update(b),f.getCommand("autoFilterReapply").update(b);const N=S===s.ITextFrame.HorizontalAlignment.CenterContinuous||S===s.ITextFrame.HorizontalAlignment.Fill,C={disabled:T||N};f.getCommand("formatTextRotate0").update(C),f.getCommand("formatTextRotate45").update(C),f.getCommand("formatTextRotate90").update(C),f.getCommand("formatTextRotate270").update(C),f.getCommand("formatTextRotate315").update(C),f.getCommand("formatTextRotateCustom").update(C),f.getCommand("formatTextRotateVertical").update(C)},[be]),f}var Lo,Oo;(function(){if(Oo)return Lo;Oo=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,l=typeof cn=="object"&&cn&&cn.Object===Object&&cn,d=typeof self=="object"&&self&&self.Object===Object&&self,m=l||d||Function("return this")(),v=Object.prototype.toString,g=Math.max,k=Math.min,h=function(){return m.Date.now()};function p(x){var A=typeof x;return!!x&&(A=="object"||A=="function")}function M(x){if(typeof x=="number")return x;if((function(G){return typeof G=="symbol"||(function(U){return!!U&&typeof U=="object"})(G)&&v.call(G)=="[object Symbol]"})(x))return NaN;if(p(x)){var A=typeof x.valueOf=="function"?x.valueOf():x;x=p(A)?A+"":A}if(typeof x!="string")return x===0?x:+x;x=x.replace(e,"");var D=n.test(x);return D||i.test(x)?a(x.slice(2),D?2:8):t.test(x)?NaN:+x}Lo=function(x,A,D){var G,U,F,V,y,w,R=0,j=!1,I=!1,E=!0;if(typeof x!="function")throw new TypeError("Expected a function");function W(ne){var L=G,z=U;return G=U=void 0,R=ne,V=x.apply(z,L)}function _(ne){var L=ne-w;return w===void 0||L>=A||L<0||I&&ne-R>=F}function P(){var ne=h();if(_(ne))return B(ne);y=setTimeout(P,(function(L){var z=A-(L-w);return I?k(z,F-(L-R)):z})(ne))}function B(ne){return y=void 0,E&&G?W(ne):(G=U=void 0,V)}function K(){var ne=h(),L=_(ne);if(G=arguments,U=this,w=ne,L){if(y===void 0)return(function(z){return R=z,y=setTimeout(P,A),j?W(z):V})(w);if(I)return y=setTimeout(P,A),W(w)}return y===void 0&&(y=setTimeout(P,A)),V}return A=M(A)||0,p(D)&&(j=!!D.leading,F=(I="maxWait"in D)?g(M(D.maxWait)||0,A):F,E="trailing"in D?!!D.trailing:E),K.cancel=function(){y!==void 0&&clearTimeout(y),R=0,G=w=U=y=void 0},K.flush=function(){return y===void 0?V:B(h())},K}})();var jo,Bo,Vo={exports:{}},ro={};Bo||(Bo=1,Vo.exports=(function(){if(jo)return ro;jo=1;var e=o,t=typeof Object.is=="function"?Object.is:function(v,g){return v===g&&(v!==0||1/v==1/g)||v!=v&&g!=g},n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function d(v){var g=v.getSnapshot;v=v.value;try{var k=g();return!t(v,k)}catch{return!0}}var m=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(v,g){return g()}:function(v,g){var k=g(),h=n({inst:{value:k,getSnapshot:g}}),p=h[0].inst,M=h[1];return a(function(){p.value=k,p.getSnapshot=g,d(p)&&M({inst:p})},[v,k,g]),i(function(){return d(p)&&M({inst:p}),v(function(){d(p)&&M({inst:p})})},[v]),l(k),k};return ro.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,ro})()),Vo.exports;var Po,Ho,an={exports:{}},Wt={exports:{}},Dl=Wt.exports;function Uo(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}(function(){if(Ho)return an.exports;Ho=1;for(var e=(Po||(Po=1,function(){var h,p,M,x,A,D;typeof performance<"u"&&performance!==null&&performance.now?Wt.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Wt.exports=function(){return(h()-A)/1e6},p=process.hrtime,x=(h=function(){var G;return 1e9*(G=p())[0]+G[1]})(),D=1e9*process.uptime(),A=x-D):Date.now?(Wt.exports=function(){return Date.now()-M},M=Date.now()):(Wt.exports=function(){return new Date().getTime()-M},M=new Date().getTime())}.call(Dl)),Wt.exports),t=typeof window>"u"?cn:window,n=["moz","webkit"],i="AnimationFrame",a=t["request"+i],l=t["cancel"+i]||t["cancelRequest"+i],d=0;!a&&d<n.length;d++)a=t[n[d]+"Request"+i],l=t[n[d]+"Cancel"+i]||t[n[d]+"CancelRequest"+i];if(!a||!l){var m=0,v=0,g=[],k=1e3/60;a=function(h){if(g.length===0){var p=e(),M=Math.max(0,k-(p-m));m=M+p,setTimeout(function(){var x=g.slice(0);g.length=0;for(var A=0;A<x.length;A++)if(!x[A].cancelled)try{x[A].callback(m)}catch(D){setTimeout(function(){throw D},0)}},Math.round(M))}return g.push({handle:++v,callback:h,cancelled:!1}),v},l=function(h){for(var p=0;p<g.length;p++)g[p].handle===h&&(g[p].cancelled=!0)}}an.exports=function(h){return a.call(t,h)},an.exports.cancel=function(){l.apply(t,arguments)},an.exports.polyfill=function(h){h||(h=t),h.requestAnimationFrame=a,h.cancelAnimationFrame=l},an.exports})();const yo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:d,onScrollOffset:m,showCustomScrollButtons:v=!1,offset:g=0,totalSize:k=0,viewportSize:h=0,...p}=e;if(!a)throw new Error("SheetScrollBar needs a sheet model");const[M]=Lt(),x=r.useCallbackRef(l,[l]),A=r.useCallbackRef(d,[d]),D=(G=M,U=t,o.useMemo(()=>G===null&&U===null?null:ue=>{Uo(G,ue),Uo(U,ue)},[G,U]));var G,U;const[F,V]=o.useState(()=>{const ue=a.getView().getTopLeft();return i===r.ScrollbarOrientation.Vertical?ue.top:ue.left}),y=()=>{const ue=a.getView().getFreezePanes();return i===r.ScrollbarOrientation.Vertical?ue.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(ue.coords.rowIndex)-ue.topLeft.top,scroll:ue.topLeft.top}:ue.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(ue.coords.colIndex)-ue.topLeft.left,scroll:ue.topLeft.left}},[w,R]=o.useState(y),[j,I]=o.useState(null),[E,W]=o.useState(!1),_=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),P=()=>{const ue=a.getUsedRange()?.getCoords()??ge.CoordUtils.EmptyRange,Re=a.getSelection().getCoords().cell;return{colIndex:Math.max(ue.colEnd,Re.colIndex),rowIndex:Math.max(ue.rowEnd,Re.rowIndex)}},[B,K]=o.useState(P),ne=B?(i===r.ScrollbarOrientation.Vertical?B.rowIndex:B.colIndex)+1:0,L=()=>{const ue=P();ge.CoordUtils.isEqualCells(B,ue)||K(ue)};tt(a.getView(),{onFreezeSplitChange:()=>{R(y)}}),tt(a.getSelection(),{onChange:L}),tt(a,{onUsedRangeChange:L}),o.useEffect(()=>{K(P())},[a]),o.useEffect(()=>{if(!j)return E&&A?.(),void W(!1);const ue=_.getTextAt(_.findIndex(F/(a.getView().getZoomScale()/100)+w.scroll+w.shift));W(!0),x?.({...j,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+ue})},[g,F,w,i,j,_,E,a]);const z=r.useCallbackRef((ue,Re,Ke)=>{V(ue);const $e=ue+w.scroll,Ie=Re+w.shift,me=Ke+w.shift+w.scroll;m?.($e,Ie,me)},[m,w]),ae=g-w.scroll,ve=h-w.shift,Pe=k-(w.shift+w.scroll),Se=_.findOffset(ne)*(a.getView().getZoomScale()/100)-(w.scroll+w.shift);return u.jsx(r.VirtualScrollbar,{ref:D,style:n,offset:ae,viewportSize:ve,totalSize:Pe,orientation:i,showCustomScrollButtons:v,onMouseDown:ue=>{I({anchor:{x:ue.clientX,y:ue.clientY}}),ue.preventDefault()},onScrollOffset:z,onMouseOut:()=>{I(null)},onMouseUp:()=>{I(null)},minSize:Se,...p})}));yo.displayName="SheetScrollbar";const Ko=(e,t,n=null)=>{const i=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;i.push({address:{min:e[a].min,max:e[a].max},update:t})}return i},$o=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:d=30,containerWidth:m,containerHeight:v,headerText:g,freezeStart:k,gridStyle:h,verticalPadding:p,horizontalPadding:M,onSheetContextMenu:x,onResizeHeadersStart:A,onResizeHeaders:D,onResizeHeadersEnd:G,onResizeHeadersDown:U,onResizeHeadersUp:F,scrollPoint:V,onSelectionStart:y,onSelectionEnd:w}=e,R=o.useMemo(()=>n.getOrientation(),[n]),j=o.useRef(null),[I,E]=o.useReducer(O=>O+1,0),[W,_]=o.useReducer(O=>O+1,0),P=n?.getSheet(),B=o.useRef(!1);o.useLayoutEffect(()=>{B.current=!0},[n]);const K=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),ne=o.useMemo(()=>{const O=R===s.IRange.Orientation.Column;return{left:O?V.left:0,top:O?0:V.top}},[V]),[L,z]=o.useState(P?.getView().getZoomScale()/100),[ae,ve]=o.useState(null);tt(n,{onSizesChange:O=>{z(P?.getView().getZoomScale()/100),Me(oe())}});const Pe=o.useCallback(()=>{j.current?.invalidate(),_()},[]),Se=o.useCallback(ge.CommonUtils.debounce(()=>{Pe()},10),[]),[ue,Re]=o.useState(null);tt(n.getSheet(),{onSelectionChange(){Re(P?.getSelection().getCoords()),Se()},onProtectionChange(){Pe()},onViewChange(){Se()}}),o.useLayoutEffect(()=>{Me(oe())},[R,L,d]),o.useLayoutEffect(()=>{ve(null),z(n?.getSheet().getView().getZoomScale()/100),Me(oe())},[n]);const Ke=o.useCallback(O=>n.at(O)?.isHidden()||n.at(O)?.getSize()===0,[n]),$e=o.useCallback((O,Y)=>n.hiddenHeadersAt(O,Y),[Ke]),Ie=r.useCallbackRef(O=>n.isSelected(O),[n]),me=r.useCallbackRef(O=>n.isSelectedAll(O),[n]),$=o.useCallback(()=>n.getMinSize(),[n]),Ae=o.useCallback(()=>n.getMaxSize(),[n]),Ce=r.useCallbackRef((O,Y,c)=>{Y/=L;const q={size:Y=Math.max($(),Math.min(ge.CommonUtils.roundAccurately(Y,$()),Ae())),hidden:!1},T=[];if(Y<=0&&(q.hidden=!0,q.size=c),T.push({address:{min:O,max:O},update:q}),Y<0){const b=R===s.IRange.Orientation.Column,N=b?he.getColOffset:he.getRowOffset,C=b?he.getColIndex:he.getRowIndex,H=N(O);let X=C(H+Y);const te=N(X);te===H+Y?X--:T.push({address:{min:X,max:X},update:{size:H-te+Y}}),O-X>1&&T.push({address:{min:X+1,max:O-1},update:{hidden:!0}})}n.updateHeaderPairs(T),D?.(O,Y,c)},[I,n,L,D]),J=r.useCallbackRef((O,Y,c)=>{const q=R===s.IRange.Orientation.Column;let T=null,b={min:O,max:O};if(n.isSelectedAll(O)){const N=n.getSelectedRuns();N.length>1?T="Resize "+(q?"Columns":"Rows"):b=N[0];const C={hidden:Y<=0,size:(Y<=0?c:Y)/L};n.updateHeaderPairs(Ko(N,C,O))}if(b){const N=b.max-b.min+1;let C;C=N===1?n.getRange(b).at(0).getDisplayText():n.getRange(b).toString(),T=`Resize ${q?"Column":"Row"}${N>1?"s":""} '${C}'`}G?.(O,Y,T)},[I,n,G]),Z=r.useCallbackRef((O,Y)=>{const c=R===s.IRange.Orientation.Column;A(O,Y,`Resize ${c?"Column":"Row"}(s)`)},[A]),re=r.useCallbackRef(O=>{let Y=!1;const c=R===s.IRange.Orientation.Column,q=n.getSheet().getEntireRange().getCoords(),T=[],b=n.getSelectedRuns(),N=C=>{let H;H=c?{colStart:C.min,rowStart:q.rowStart,colEnd:C.max,rowEnd:q.rowEnd}:{colStart:q.colStart,rowStart:C.min,colEnd:q.colEnd,rowEnd:C.max},T.push(H)};for(let C=0;C<b.length;C++){const H=b[C];H.value.isSelectedAll&&(H.min<=O&&H.max>=O&&(Y=!0),N(H))}if(Y||N({min:O,max:O}),n.getSheet().getRanges(T).autoFit({orientations:c?s.IRange.Orientations.Column:s.IRange.Orientations.Row}),Ke(O)){const C={hidden:null},H=Ko(b,C);Y||H.push({address:O,update:C}),n.updateHeaderPairs(H)}G?.(O,null,"Resize Column(s)")},[I,n,G,Ke]),oe=()=>{const O=R===s.IRange.Orientation.Column;return{getColOffset:Y=>O?n.findOffset(Y):Y===0?0:d/L,getColIndex:Y=>O?n.findIndex(Y):0,getRowOffset:Y=>O?Y===0?0:d/L:n.findOffset(Y),getRowIndex:Y=>O?0:n.findIndex(Y)}},[he,Me]=o.useState(()=>oe()),de=o.useCallback((O,Y)=>O.nativeEvent.which!==r.MouseButtonCodes.Right||!me(R===s.IRange.Orientation.Column?Y.colIndex:Y.rowIndex),[R,me]),be=r.useCallbackRef(O=>{a.focusSheet()},[a]),xe=r.useCallbackRef(O=>{P?.getSelection().updateCoords(O)},[P]),{...Fe}=dt.useSelection({gridRef:i,commands:null,layout:he,selection:ue,fillHandleBorderColor:h.body.fill,selectionBackgroundColor:h.selection.fill,selectionBorderColor:h.selection.strokeFill,selectionRemoveBackgroundColor:h.selectionRemove.fill,selectionRemoveBorderColor:h.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:xe,canSelectionSpanMergedCells:O=>{const Y=P.getRange(O);return Y.isEntireColumns()||Y.isEntireRows()}}),f=r.useCallbackRef(()=>{y?.();const O=P?.getSelection();O&&O.setAdjusting(O.getCoords())},[P,y]),Le=r.useCallbackRef(async()=>{P?.getSelection().setAdjusting(null),w?.()},[P,w]),{...Xe}=dt.useHeaderSelection({orientation:R,headerCount:K,gridRef:j,gridMainRef:i,newSelection:Fe?.newSelection,modifySelection:Fe?.modifySelection,appendSelection:Fe?.appendSelection,clearSelections:Fe?.clearSelections,pointerDownInterceptor:de,onPointerUp:be,onDragStart:f,onDragEnd:Le}),Ue=h.selection?.strokeFill;o.useEffect(()=>{if(!j.current)return void ve(null);const O=R===s.IRange.Orientation.Column,Y=n.getSelectedRuns(),c=n.isProtected()?null:Ce,q=(b,N,C)=>{if(C)return O?u.jsx("div",{style:{position:"absolute",borderBottom:`${h.headerSelection.strokeWidth}px solid ${Ue}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(C.x-h.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(C.width+h.headerSelection.strokeWidth+1,!0)}px`,height:d+h.headerSelection.strokeWidth-.5+"px"}},b):u.jsx("div",{style:{position:"absolute",borderRight:`${h.headerSelection.strokeWidth}px solid ${Ue}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(C.y-h.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-h.headerSelection.strokeWidth/2)}px`,width:d+h.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(C.height+h.headerSelection.strokeWidth+1,!0)}px`}},b)},T=(b,N,C)=>{const H={x:0,y:0,width:0,height:0};if(O){const X=C.toClipBounds(C.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:b,colEnd:Math.min(K,N)}),dt.SELECTION_CLIP_INSETS);if(!X)return;H.x=X.x,H.width=X.width}else{const X=C.toClipBounds(C.getRangeCoordsBounds({rowStart:b,rowEnd:Math.min(K,N),colStart:0,colEnd:0}),dt.SELECTION_CLIP_INSETS);if(!X)return;H.y=X.y,H.height=X.height}return{x:H.x,y:H.y,width:H.width,height:H.height}};ve([b=>{const N=[];let C=null,H=O?b.getVisibleColumns():b.getVisibleRows();const X=O?b.getTotalRangeCoords().colStart:b.getTotalRangeCoords().rowStart;H.length>0&&H[0]>X&&(H=[H[0]-1,...H]);let te=[];const ie=[];for(let pe=0;pe<H.length;pe++){const we=H[pe],Be=pe<H.length-1?H[pe+1]:we+$e(we+1,!1)+1,Ne=we+1!==Be;if(!C||C.max<we)if(Y.length>0&&Y[Y.length-1].max>=we){const Ge=ge.CommonUtils.findEqualOrGreater(Y,we,Oe=>Oe.max);C=Y[Ge]}else C=null;let We=!1,Ve=!1;if(C?.value&&(C.min<=we||C.min<=Be&&!Ne)&&(We=!0,Ve=C.value.isSelectedAll),we===X){let Ge=!1,Oe=!1;C?.value&&C.min<=we&&(Ge=!0,Oe=C.value.isSelectedAll),we>0&&ie.push({index:we-1,isNextHidden:Ne,isSelected:Ge,isSelectedAll:Oe,disabledResize:!0})}if(Ve&&te.push(ie.length),ie.push({index:we,isHidden:pe===0&&$e(we,!1)>0,isNextHidden:Ne,isSelected:We,isSelectedAll:Ve,onDividerMouseDown:U,onDividerResizeStart:Z,onDividerResize:c,onDividerMouseUp:F,onDividerResizeEnd:J,onDividerAutoFit:re}),Ne){let Ge=!1,Oe=!1;if(C&&C.min>=we&&C.max<=Be-1&&C.value.isSelectedAll&&te.push(ie.length),!(C?.value&&C.max>=Be))if(Y.length>0&&Y[Y.length-1].max>=Be){const Ye=ge.CommonUtils.findEqualOrGreater(Y,Be,it=>it.max);C=Y[Ye]}else C=null;C?.value&&C.min<=Be&&(Ge=C.value.isSelected,Oe=C.value.isSelectedAll),Be>0&&ie.push({index:Be-1,isHidden:!0,isSelected:Ge,isSelectedAll:Oe,onDividerMouseDown:U,onDividerResizeStart:Z,onDividerResize:c,onDividerMouseUp:F,onDividerResizeEnd:J,onDividerAutoFit:re})}}if(te.length>0){let pe=te.length-1;if(te.length>0){const Ne=ie[te[pe]].index;let We=null;O?(We=b.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:Ne,colEnd:Ne}),We.x+We.width>b.getBounds().width&&(pe-=1,pe===0&&(pe=-1))):(We=b.getRangeCoordsBounds({rowStart:Ne,rowEnd:Ne,colStart:0,colEnd:0}),We.y+We.height>b.getBounds().height&&(pe-=1,pe===0&&(pe=-1)))}const we=Y?.[Y.length-1],Be=b.getAnchor();if(Be==="t"||Be==="l"){const Ne=ie[te[Math.max(0,te.length-1)]];Ne.showTouchDivider=we&&we.max<=Ne.index}else pe>=0&&(ie[te[pe]].showTouchDivider=!0)}const{header:se,headerSelect:ce,headerSelectAll:ye,headerHover:fe}=h??{};for(let pe=0;pe<ie.length;pe++)N.push(u.jsx(dt.HeaderDivider,{orientation:R,view:b,headerStyle:se,headerStyleSelect:ce,headerStyleSelectAll:ye,headerStyleHover:fe,disabled:n.isProtected(),...ie[pe]},`divider${pe}`));return N},b=>{const N=[];for(let C=0;Y&&C<Y.length;C++)N.push(q(`selection:${b.getAnchor()}:${C}`,0,T(Y[C].min,Y[C].max,b)));return N}])},[W,!0,Ue,h,he,K,k,I,L]),o.useEffect(()=>{j.current?.invalidate()},[I]);const Q=r.useCallbackRef(O=>g?g(O):n.getTextAt(O),[g,n]),qe=r.useCallbackRef(O=>{const{header:Y,headerSelect:c,headerSelectAll:q,headerHover:T}=h??{},{range:b,key:N,...C}=O;return u.jsx(dt.HeaderRenderer,{orientation:R,index:R===s.IRange.Orientation.Column?b.colStart:b.rowStart,isSelected:Ie,isSelectedAll:me,zoomScale:100*L,headerText:Q,headerStyle:Y,headerStyleSelect:c,headerStyleSelectAll:q,headerStyleHover:T,verticalPadding:p,horizontalPadding:M,...C},N)},[I,K,h,L,n]),je=r.useEditMode(),Te=o.useMemo(()=>{const O="white",Y="black",c={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let q=R===s.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='${Y}' fill='${O}'/%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='${Y}' fill='${O}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;je.getMode()?.key==="formatPainter"&&(q=`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='${Y}' fill='${O}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),c.cursor=q}return c.backgroundColor=h?.header?.fill||"transparent",c},[R,I,je,h]),De=r.useImperativeElement(t,()=>({scrollTo:O=>{j.current?.scrollTo(O)},forceRender:()=>{E()},getGridElement:()=>j.current}),[]),ze=o.useCallback(O=>{Xe.onPointerDown(O)},[Xe]),S=o.useCallback(O=>{const Y=Xe.getCellCoordsFromClient(O.clientX,O.clientY);if(!Y||!x)return;const c=R===s.IRange.Orientation.Column;x({originalEvent:O,clientX:O.clientX,clientY:O.clientY,rowIndex:c?-1:Y.rowIndex,colIndex:c?Y.colIndex:-1}),O.stopPropagation(),O.preventDefault()},[Xe,x]),le=o.useMemo(()=>{const O=R===s.IRange.Orientation.Column;return u.jsx("div",{ref:De,children:u.jsx(dt.Grid,{className:"sheet-header",style:Te,ref:j,scrollPoint:ne,columnCount:O?K:1,rowCount:O?1:K,width:O?m:d,height:O?d:v,freezeLeft:O?k:void 0,freezeTop:O?void 0:k,hiddenColumnsAt:O?$e:void 0,hiddenRowsAt:O?void 0:$e,showGridLines:!1,layout:he,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:S,onPointerDown:ze,zoom:L,cellRenderer:qe,overlays:ae})})},[ae,he,m,v,ne,Te,W]);return o.useEffect(()=>{B.current=!1,j.current?.invalidate(),_()},[n,h]),le})),zl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,d=r.useCallbackRef((g,k)=>g.getStyle().getBorder(),[]),{overlay:m}=bo({getVisibleCells:a,getBorderAt:d,darkMode:l.body.darkMode,shiftIfWide:!0}),v=m(n);return v&&n?v:null})),Nl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},Ll={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Ol={type:s.ICell.Content.Values},jl={fitDestination:!0,type:s.ICell.Content.Formats},Bl={fitDestination:!0,type:s.ICell.Content.Formulas},Vl={transpose:!0},Pl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},kr=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,selectionRenderer:d=dt.defaultSelectionRenderer,copyForegroundColor:m="rgb(33, 115, 70)",cutForegroundColor:v="rgb(33, 115, 70)",copyBackgroundColor:g="white",cutBackgroundColor:k="white",notifier:h,...p})=>{const M=r.useCallbackRef(d,[d]),x=o.useRef(null),A=r.useEditMode(),D=A.getMode(),G=o.useMemo(()=>({element:e,doCopy:w=>{const R=t.getSelectedRanges().getSnapshot(w);return new s.RangeClipboardItem(R)}}),[t,n,e]),U=o.useMemo(()=>({element:e,importFromExternal:async(w,R)=>{const j=new s.ExternalRangeClipboardItem(w,R,t.getStyles(),t.isDate1904());return await j.parse()?j:null},doPaste:async(w,R)=>{if(w?.getItemType()!=="range")return;R?.contentsOnly&&delete(R={...R,type:s.ICell.Content.Values}).contentsOnly;const j=t.getSelectedRange(),I=w.getItem(),E=I.getName();return await j.doBatch(async()=>{const W=await j.copyFrom(I,R);!W||W.isEntireRows()||W.isEntireColumns()||W.autoFit({orientations:s.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(E?` ${E}`:""),autoSelect:!0}),!0}}),[t,n,h,e]),{clipboard:F,...V}=r.useCopyPaste({...p,source:G,commands:i,target:U,notifier:h,onClipboardUpdate:w=>{const R=w?.getItemType()==="range"?w:null;if(R){const j=w.editMode?.(),I={...w?.isCut?.()?Ll:Nl,...j,args:{isClipboard:!0,...j?.args},onModeChange:E=>{E?.args?.isClipboard||F.clear(!0),j?.onModeChange?.(E)}};A.setMode(I)}x.current=R,a?.(R)},onPaste:(w,R)=>{if(w?.getItemType()!=="range")return;let j=A.getMode()?.key==="cut"||w.isCut?.();if(!j&&A.getMode()?.key==="copy"){const I=w.getItem().getCoords(),E=t.getSelectedRanges().getCoords();let W=!1;if(!W&&I&&E&&w.getItem().getSource?.()===t)for(let _=0;!W&&_<E.length;_++)W=ge.CoordUtils.isRangesIntersect(I,E[_]);j=W}j&&A.setMode(null),e?.()?.focus(),l?.(w,R)}});o.useMemo(()=>{const w=e;if(!i)return;const R=[new r.Command("pasteValues",w,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
20
20
 
21
21
  The formatting is not applied.`,shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",w,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
22
22
 
23
- The content is not applied.`}),new r.Command("pasteFormulas",w,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new r.Command("pasteTranspose",w,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new r.Command("pasteLinks",w,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];i.addCommands(k,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const w={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(k=>B.paste({...Ol,...k})).update(w),i.getCommand("pasteFormats").updateCallback((k,O)=>B.paste({...jl,description:O.label(),...k})).update(w),i.getCommand("pasteFormulas").updateCallback((k,O)=>B.paste({...Bl,description:O.label(),...k})).update(w),i.getCommand("pasteTranspose").updateCallback((k,O)=>B.paste({...Vl,description:O.label(),...k})).update(w),i.getCommand("pasteLinks").updateCallback((k,O)=>B.paste({...Pl,description:O.label(),...k})).update(w),i.getCommand("cut").update(w),i.getCommand("paste").update(w)},[t,i]);const S=o.useMemo(()=>{if(!D||!q.current)return;const w=D.key;if(w!=="copy"&&w!=="cut"&&w!=="formatPainter")return;const k=q.current.getItem();if(k.getSource()!==t)return;const O=q.current.isCut?.(),E=O?x:g,F=O?p:m,Z=k.getCoords(),_=Z?[Z]:null;return _&&_.length!==0?P=>{const V=[];for(let $=0;$<_.length;$++){const oe=_[$],L=P.toClipBounds(P.getRangeCoordsBounds(oe,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);L&&(V.push(T({range:oe,key:`copy-selection-background-${$}`,x:L.x,y:L.y,width:Math.max(L.width,0),height:Math.max(L.height,0),stroke:E,strokeWidth:2})),V.push(T({range:oe,key:`copy-selection-foreground-${$}`,x:L.x+(L.width<=2?-1:0),y:L.y,width:Math.max(L.width,3),height:Math.max(L.height,3),stroke:F,strokeWidth:2,isAnimatedStroke:!0})))}return V}:null},[D,t,n,m,g,p,x]);return{...B,clipboard:y,overlays:S}},Hl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,p=l.body??{},g=a.getView(),{overlays:x}=kr({element:i,sheet:a,sheetView:g,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:p.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:p.fill,notifier:m});return tt(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),x&&n?x(n):null})),Ul="_sheet-selection_12wyx_5",Kl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},$l={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Wl={key:"dragCopy",description:"Drag selection to copy cell contents."},Gl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Wo=(e,t)=>t.ctrlKey&&t.shiftKey?Gl:t.ctrlKey?Wl:t.shiftKey?$l:Kl,_l={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Zl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:p,sheet:g,gridRef:x,gridStyle:h,isActive:f,editingCoords:T,...q}=e,A=n?.getBounds(),D=r.useCallbackRef(m,[m]),G=r.useCallbackRef(p,[p]),[U,y]=o.useState(()=>g?.getSelection().getCoords()),B=r.useCallbackRef(ce=>{ue.CoordUtils.isEqualSelectionCoords(ce,U)||g&&g.getSelection().updateCoords(ce)},[g,U]),S=r.useEditMode(),w=o.useRef(null),[k,O]=o.useState(g?.getProtection().isLocked()),[E,F]=o.useState(g?.getView().getMovableSelection().length>0),Z=r.ReactUtils.detectIt().primaryInput==="touch",_=!Z&&f,P=T!==null||E,V=r.useCallbackRef(ce=>{const de=ue.CoordUtils.cellToRange(ce);if(g.isClosed())return de;const me=g.getRange(de,{excludeHidden:!0}).getMerges();return me.length===0?de:me[0]},[g]),$=r.useCallbackRef((ce,de,me,Ce,xe,Me)=>{const we=g.getSelectedRange().getExtended(Ce,ce).getCoords();switch(Ce){case s.IRange.Direction.Up:return we.rowStart;case s.IRange.Direction.Down:return we.rowEnd;case s.IRange.Direction.Left:return we.colStart;case s.IRange.Direction.Right:return we.colEnd}},[g]),oe=r.useCallbackRef(()=>{const ce=g.getUsedRange()?.getCoords(),de=g.getRowHeaders().getUsedRange()?.getCoords(),me=g.getColumnHeaders().getUsedRange()?.getCoords();return{...ce,colEnd:Math.max(ce?.colEnd??0,me?.max??0),rowEnd:Math.max(ce?.rowEnd??0,de?.max??0)}},[g]),L=r.useCallbackRef((ce,de)=>g.getRowHeaders().hiddenHeadersAt(ce,de),[g]),z=r.useCallbackRef((ce,de)=>g.getColumnHeaders().hiddenHeadersAt(ce,de),[g]),K=r.useCallbackRef(ce=>g.getRange(ce,{excludeHidden:!0}).getMerges(),[g]),W=r.useCallbackRef(ce=>{g?.getSelection().setAdjusting(ce)},[g]),ge=r.useCallbackRef(async()=>{g?.getSelection().setAdjusting(null),S.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),S.setMode(null))},[S,U,g,i]),ae=o.useMemo(()=>{const ce=S.getMode();return ce?.key==="cut"||ce?.key==="copy"},[S]);tt(g?.getView(),{onMovableSelectionChange:()=>{F(g.getView().getMovableSelection().length>0)}}),tt(g?.getSelection(),{onChange(ce){const de=g.getSelection().getCoords();y(de)}}),tt(g,{onProtectionChange:()=>{O(g.getProtection().isLocked())}});const{body:Q={}}=h||{},X=n.getLayout(),be=!(_&&U.ranges.length<=1&&T===null&&!k&&(!S.getMode()||ae)),{cursor:ke,overlay:ve,onPointerDown:Pe}=dt.useSelection({gridRef:x,commands:i,layout:X,getCellCoordsAsRangeCoords:V,selection:U,fillHandleBorderColor:Q.fill,selectionBackgroundColor:f?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:f?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:f?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:f?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:be,disableMoveDrag:Z||!(f&&U.ranges.length<=1&&T===null&&!k),disableTouchSelection:P,onSelectionChange:B,onSelectionDragStart:W,onSelectionDragEnd:ge,onMoveDragStart:(ce,de,me)=>{S.setMode(Wo(0,me))},onMoveDragUpdate:(ce,de,me)=>{S.setMode(Wo(0,me))},onMoveDragEnd:(ce,de)=>{S.setMode(null)},onMoveDragDone:async(ce,de,me)=>{if(ue.CoordUtils.isEqualRanges(ce,de))return;const Ce=g.getRange(de);if(d?.showOptions){const Le=Ce.getDifferences(ce);let Ve=!1;for(let C=0;!Ve&&C<Le.getCount();C++)Ve=Le.at(C).isContentful();if(Ve&&await d?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const xe=!me.ctrlKey,Me=me.shiftKey,we=Me?xe?"Insert Moved Cells":"Insert Copied Cells":xe?"Move Cells":"Copy Cells",Ee=await d?.showBusy?.(we);try{const Le=g.getRange(ce);await Ce.doBatch(async()=>{Me?await Ce.insertFrom(ce,{isCut:xe,undoRange:Le}):await Ce.copyFrom(ce,{isCut:xe,undoRange:Le}),Le.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),Ce.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:we,autoSelect:!0})}catch(Le){d?.showError?.(Le)}finally{Ee?.()}},contentfulCellFinder:$,hiddenRowsAt:L,hiddenColumnsAt:z,mergedRanges:K,getDataCoords:oe,canSelectionSpanMergedCells:ce=>{const de=g.getRange(ce);return de.isEntireColumns()||de.isEntireRows()},onFill:async(ce,de)=>{const me="Auto Fill",Ce=await d?.showBusy?.(me);try{await g.doBatch(()=>{g.getRange(ce).autoFill(de),g.getRange(de).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:me,autoSelect:!0})}catch(xe){d?.showError?.(xe)}finally{w.current=null,Ce?.()}},onFillPreview:(ce,de,me)=>{if(x.current&&D){S.setMode(_l);try{w.current?.direction!==me&&(w.current=null,g.getRange(ce).autoFill(de,{previewOnly:C=>{w.current={callback:C,direction:me}}}));const Ce=w.current?.callback?.(de);if(!Ce||Ce.isEmpty())return;const xe=Ce.toText();if(!xe)return;const Me=ue.CoordUtils.cellToRange(Ce.getCoords()),we=n.getRelativePointFromClient(0,0);let Ee=0,Le=0,Ve=r.ToolTipPlacement.Bottom;if(me===s.IRange.Direction.Down){Ee=X.getColOffset(Me.colEnd+1)-we.x;const C=X.getRowOffset(Me.rowEnd),Ue=X.getRowOffset(Me.rowEnd+1);Le=Ue-(Ue-C)/2-we.y,Ve=r.ToolTipPlacement.Right}else if(me===s.IRange.Direction.Right){Le=X.getRowOffset(Me.rowEnd+1)-we.y;const C=X.getColOffset(Me.colEnd),Ue=X.getColOffset(Me.colEnd+1);Ee=Ue-(Ue-C)/2-we.x,Ve=r.ToolTipPlacement.Bottom}else if(me===s.IRange.Direction.Up){Ee=X.getColOffset(Me.colEnd+1)-we.x;const C=X.getRowOffset(Me.rowStart),Ue=X.getRowOffset(Me.rowStart+1);Le=Ue-(Ue-C)/2-we.y,Ve=r.ToolTipPlacement.Right}else if(me===s.IRange.Direction.Left){Le=X.getRowOffset(Me.rowEnd+1)-we.y;const C=X.getColOffset(Me.colStart),Ue=X.getColOffset(Me.colStart+1);Ee=Ue-(Ue-C)/2-we.x,Ve=r.ToolTipPlacement.Bottom}D({anchor:{x:Ee,y:Le},display:xe,placement:Ve})}catch(Ce){d?.showError?.(Ce)}}},onFillDone:()=>{w.current=null,S.setMode(null),G?.()}}),he=r.useCallbackRef(ce=>{Pe(r.ReactUtils.createSyntheticEvent(ce))},[Pe,T]);o.useEffect(()=>{const ce=n?.getStage();if(ce)return ce.addEventListener("pointerdown",he),()=>{ce.removeEventListener("pointerdown",he)}},[n?.getStage()]);const He=r.useImperativeElement(t,()=>({}),[]),Se=o.useRef(null);return c.jsx("div",{className:wt(a,"sheet-selection",Ul),style:{position:"absolute",width:A?.width,height:A?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Zt([He,Se]),...q,children:ve(n)})})),In=Object.freeze({x:0,y:0,width:0,height:0}),Xl={fireOnModelChange:!1},Yl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:p,onUnFocus:g,isDragging:x,updateFrameBounds:h,dragStart:f,style:T,disabled:q,renderMovable:A,...D}=e,[G,U]=o.useState(In),[y,B]=o.useState(null),[S,w]=o.useState(!1),k=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const E=a.getBounds();if(!E)return;const F=i.toViewBounds(E);U(F??In),h(F??In)},[i?.getBounds()]),tt(a,{onBoundsChange:E=>{const F=E.getBounds();if(!F)return;const Z=i.toViewBounds(F);U(Z??In),h(Z)},onSelectionChange:()=>{const E=ue.CommonUtils.hasFocus(k.current,!0);!S&&!E||a.isSelected()||g()}}),tt(a,{onRequestFocus:()=>ue.CommonUtils.whenFocus(k.current,!0)},Xl),o.useEffect(()=>{const E=k.current;return l(E),()=>{d(E)}},[]);const O=o.useMemo(()=>{if(!G)return null;let{width:E,height:F}=G;return A({view:i,movable:a,disabled:q,isDragging:x,style:{position:"relative",left:0,top:0,width:E,height:F},onHide:m,onShow:p})},[i,a,G.width,G.height,q,x]);return c.jsx("div",{className:"movable",tabIndex:0,ref:Zt([k,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:G.x,top:G.y,width:G.width,height:G.height,...T},onMouseDown:async E=>{const F=E.shiftKey||E.ctrlKey,Z=a.isSelected(),_=E.currentTarget;F&&Z?a.unselect():(Z&&!F||await a.select({addToSelection:F}),f(E.nativeEvent,_),_.focus())},onFocus:E=>{E.relatedTarget&&!y&&B(E.relatedTarget),w(!0)},onBlur:E=>{y&&!k?.current?.contains(E.relatedTarget)&&B(null),E.relatedTarget&&w(!1)},...D,children:O})})),Jl="_movable-area_314c6_5",Mr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:p,disabled:g=!1,disableDrag:x=!1,disableResize:h=!1,className:f,style:T,renderDirections:q=["nw","n","ne","w","e","sw","s","se"],onFirstRender:A,...D}=e,G=n.getBounds(),U=r.useCallbackRef(A,[A]),y=r.useCallbackRef(m,[m]),B=r.useCallbackRef(p,[p]),[S,w]=o.useState([]),[k,O]=o.useState(!1),[E,F]=o.useState(!1),Z=o.useRef(!0),_=o.useRef(new Map),P=o.useRef(new Map),V=o.useRef(new Map),$=o.useRef(new Map),oe=o.useRef(new Map),L=o.useRef({onRequestFocus:ee=>(de(ee),null)}),z=o.useRef(null),K=o.useRef(null),W=o.useRef(null),[ge,ae]=o.useReducer(ee=>ee+1,0);o.useLayoutEffect(()=>{ae()},[n,i]),tt(i,{onCollectionChange:()=>{const ee=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Fe=oe.current;Fe.forEach(Ie=>{Ie()}),Fe.clear();const Be=L.current;for(let Ie=0;Ie<ee.length;Ie++){const ze=ee[Ie];if(ze.isClosed())continue;const Ae=ze.addListeners(Be);Fe.set(ze,Ae)}ae()},onInvalidated:()=>{ae()}}),tt(a,{onMovableSelectionChange(ee){X(),ae()}});const Q=o.useCallback((ee,Fe)=>{const Be=V.current.get(ee);W.current&&(W.current.getTargets().forEach(Ie=>{if(Ie===Be)return Ie.style.left=Fe.x+"px",Ie.style.top=Fe.y+"px",Ie.style.width=Fe.width+"px",void(Ie.style.height=Fe.height+"px")}),W.current.updateRect())},[]),X=()=>{const ee=[],Fe=a.getMovableSelection();Fe.forEach(Be=>{const Ie=V.current.get(Be);Ie&&Fe.indexOf(Be)!==-1&&ee.push(Ie)}),w(Be=>ue.CommonUtils.isEqualArrays(Be,ee)?Be:ee)},be=o.useRef(null),ke=o.useMemo(()=>new Promise(ee=>{be.current=ee}),[]),ve=o.useRef(null),Pe=r.useCallbackRef(async(ee,Fe)=>{ve.current=Fe,await(async()=>!(!await ke.then()||!W.current))()&&ve.current===Fe&&W.current.dragStart(ee,Fe)},[S]),[he,He]=o.useState(!1),Se=o.useRef(null),ce=o.useRef(null),de=r.useCallbackRef(async(ee=null)=>{if(ee||(ee=a.getMovableSelection()[0]),!ee)return y?.(),!1;const Fe=V.current.get(ee);Fe?(await ue.CommonUtils.whenFocus(Fe),Fe.focus(),ce.current=Fe,Se.current=null):Se.current=ee},[a]);o.useEffect(()=>{he&&S.length>0&&ce.current!==S[0]&&de(),Z.current&&(U?.(),Z.current=!1)},[S]);const me=o.useMemo(()=>{const ee=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(ee.length===0&&_.current.size===0)return null;const Fe=(R,re,j,J=!0)=>{const u=R.isSelected(),M={tabIndex:j,view:n,movable:R,onRefLoad:I=>{Se.current===R&&(I.focus(),ce.current=I,Se.current=null),V.current.set(R,I),P.current.set(I,R),re.rendered=!0,X()},onRefUnload:I=>{V.current.delete(R),P.current.delete(I),re.rendered=!1,X()},onUnFocus:y,onHide:I=>{re.onHide=I},onShow:I=>{re.onShow=I},isDragging:u&&(E||k),disabled:g,renderMovable:l,updateFrameBounds:I=>{Q(R,I)},dragStart:Pe,onMouseUp:()=>{if(ve.current=null,K.current){O(!1),F(!1);let I=!1;$.current?.forEach(b=>{ue.CommonUtils.isEqualBounds(b.movable.getBounds(),b.startBounds)||(I=!0)}),I?xe():Me()}},style:{opacity:J?k&&u?.7:void 0:0,zIndex:k&&u?R.getZIndex()+ee.length:void 0,pointerEvents:J?void 0:"none",cursor:E&&u?"grabbing":g||x?"initial":"move",boxShadow:!u||E&&!k?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return c.jsx(Yl,{...M},`movable-${R.getUUID()}`)},Be=_.current,Ie=new Map,ze=[];for(let R=0;R<ee.length;R++){const re=ee[R];if(re.isClosed())continue;let j=Be.get(re);j||(j={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(J,u)=>{if(!u||u.shown===!0)return;u.shown=!0;const M=++u.visibilityRequestId;requestAnimationFrame(()=>{const I=_.current.get(J);I&&M===u.visibilityRequestId&&(u.onShow?.(J),I.shown=!0)})},doHide:async(J,u)=>{if(!u||u?.shown===!1)return;u.shown=!1;const M=++u.visibilityRequestId,I=await Promise.resolve(u.onHide?.(J));M===u.visibilityRequestId&&I!==!1&&(u.shown=!1,_.current.delete(J),ae())},visibilityRequestId:0}),j.frame=Fe(re,j,R,!0),ze.push(j.frame),j.doShow(re,j),Be.delete(re),Ie.set(re,j)}const Ae=[];return a.getMovableSelection().forEach(R=>{const re=Be.get(R);re&&(re.frame=Fe(R,re,-1,!1),Ae.push(re.frame),Be.delete(R),Ie.set(R,re))}),Be.forEach((R,re)=>{R.frame=Fe(re,R,-1,!1),Ae.push(R.frame),R.doHide(re,R),Be.delete(re),Ie.set(re,R)}),_.current=Ie,X(),[...Ae,...ze]},[ge,n,l,g,x,h,k,E]),Ce=r.useCallbackRef((ee,Fe)=>{const Be=`${Fe} ${S.length===1?s.TextUtils.capitalize(P.current?.get(S[0]).getContent().getType()):"Drawings"}`;K.current&&(console.warn(`Transaction ${K.current.getDescription()} is being replaced by ${Be}`),K.current.rollback(),K.current=null),K.current=d.beginCommit({description:Be}),$.current.clear();for(let Ie=0;Ie<S.length;Ie++){const ze=S[Ie],Ae=P.current?.get(ze);Ae?$.current.set(ze,{movable:Ae,startBounds:n.toViewBounds(Ae.getBounds())}):console.warn("invalid element",Ae)}},[d,n,S]),xe=o.useCallback(()=>{if(!K.current)return;const ee=[];$.current?.forEach(Fe=>{ee.push(Fe.movable)}),K.current.commit({viewAfter:{view:a,movableSelection:ee}}),$.current.clear(),K.current=null},[]),Me=o.useCallback(()=>{K.current&&(K.current.rollback(),K.current=null)},[]),we=o.useRef(null);o.useEffect(()=>{we.current&&(we.current.onscroll=ee=>{ee.preventDefault(),ee.srcElement.scrollTop=0,ee.srcElement.scrollLeft=0})},[we.current]);const Ee=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:de,focus:()=>{de()}}),[a]),[Le,Ve]=o.useState(null),C=o.useRef(!1),Ue=o.useRef(!1),Qe=o.useRef(!1);o.useEffect(()=>{if(g||S.length===0||Qe.current||C.current)return;if(Ue.current)return void requestAnimationFrame(()=>{W.current&&z.current&&W.current.refTargets.length>0&&(Qe.current=!0,be.current?.(!0)),w([...S])});C.current=!0;const ee=o.lazy(async()=>{try{const Fe=await Promise.resolve().then(()=>require("./DaoAGX07szjW7Na_.cjs"));return C.current=!1,Ue.current=!0,w([...S]),Fe}catch(Fe){return console.warn(Fe),be.current?.(!1),null}});Ve(ee)},[S,g,x,h]);const $e=o.useMemo(()=>!Le||g?null:c.jsx(o.Suspense,{children:c.jsx(Le,{className:wt({dragging:k||E,resizing:k,moving:E}),container:null,ref:W,target:W.current?S:[],draggable:!g&&!x,resizable:!g&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:q,onResizeStart:ee=>{Ce(ee.target,"Resize")},onResize:ee=>{if(!K.current)return ee.stopDrag(),void ae();O(!0);const Fe=ee.direction[0]!==0&&ee.direction[1]!==0;let Be=0,Ie=0;for(let ze=0;ze<S.length;ze++){const Ae=S[ze],R=$.current.get(Ae),re=P.current.get(Ae);if(!R||!re){console.warn("invalid element");continue}let j=ee.dist[0],J=ee.dist[1],u=ee.drag.dist[0],M=ee.drag.dist[1],I=R.startBounds.width,b=R.startBounds.height;ze===0?(Be=I,Ie=b):(j*=I/Be,u*=I/Be,J*=b/Ie,M*=b/Ie);const N={...R.startBounds};if(N.width=Math.max(0,I+j),N.height=Math.max(0,b+J),ee.direction[0]===-1&&(N.width=Math.max(0,Math.min(R.startBounds.x+I,I-u))),ee.direction[1]===-1&&(N.height=Math.max(0,Math.min(R.startBounds.y+b,b-M))),Fe&&(re.isLockAspectRatio()||ee.inputEvent?.shiftKey)){const v=I/b,H=N.width/N.height;H>v?N.height=N.width/v:H<v&&(N.width=N.height*v)}ee.direction[0]===-1&&(N.x=Math.max(0,Math.min(R.startBounds.x+I,R.startBounds.x+I-N.width))),ee.direction[1]===-1&&(N.y=Math.min(R.startBounds.y+b,R.startBounds.y+b-N.height)),R.movable.setBounds(n.toAbsoluteBounds(N))}},onResizeEnd:ee=>{O(!1),xe()},onDragStart:ee=>{Ce(ee.target,"Move")},onDrag:ee=>{if(!K.current)return ee.stopDrag(),void ae();F(!0);for(let Fe=0;Fe<S.length;Fe++){const Be=S[Fe],Ie=$.current.get(Be);Ie?Ie.movable.setBounds(n.toAbsoluteBounds({...Ie.startBounds,x:Ie.startBounds.x+ee.translate[0],y:Ie.startBounds.y+ee.translate[1]})):console.warn("invalid element")}},onDragEnd:ee=>{},onMouseUp:ee=>{}})}),[ge,Le,S,n,g,x,h,k,E]);return c.jsx("div",{className:wt(f,"movable-area",Jl),style:{width:G.width,height:G.height,...T,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Zt([Ee,we]),...D,children:c.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:G.width,height:G.height},...D,children:c.jsxs("div",{ref:z,style:{position:"absolute",pointerEvents:"auto"},onFocus:ee=>{B?.(),He(!0)},onBlur:ee=>{He(!1)},onKeyDownCapture:ee=>{if(ee.isDefaultPrevented())return;const Fe=ee.nativeEvent.ctrlKey,Be=ee.nativeEvent.altKey,Ie=ee.nativeEvent.shiftKey;if(ee.which===r.KeyCodes.Escape){const j=a.getMovableSelection();let J=[...j];return S.forEach(u=>{if(J.length===0)return;const M=P.current.get(u);let I=J.indexOf(M);J.splice(I,1)}),J.length!==j.length&&a.selectMovables(J),J.length===0&&y?.(),void ee.preventDefault()}const ze=.1,Ae=j=>{i.updateSelected(J=>{J.setRotation(J.getRotation()+j)},"Rotate")},R=(j,J=!0)=>{i.updateSelected(u=>{const M=u.getBounds();let I=1+j;J||(I=1/I);const b=Math.sqrt(Math.pow(M.width,2)+Math.pow(M.height,2)),N=Math.atan2(M.height,M.width),v=I*b;if(v<10)return;const H=v*Math.cos(N),Y=v*Math.sin(N),ne={x:M.x+(M.width-H)/2,y:M.y+(M.height-Y)/2,width:H,height:Y};u.setBounds(ne)},"Resize")},re=j=>{i.updateSelected(J=>{const u=J.getBounds(),M={x:u.x+(j.x??0),y:u.y+(j.y??0),width:u.width+(j.width??0),height:u.height+(j.height??0)};J.setBounds(M)},"Nudge")};if(ee.which===r.KeyCodes.Delete)i.updateSelected(j=>{j.delete()},"Delete"),ee.preventDefault();else if(ee.key==="a"&&Fe){const j=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(j,!0),ee.preventDefault()}else ee.key==="ArrowLeft"?(Ie?R(ze,!1):Be?Ae(-10):re({x:Fe?-10:-1}),ee.preventDefault()):ee.key==="ArrowRight"?(Ie?R(ze,!0):Be?Ae(10):re({x:Fe?10:1}),ee.preventDefault()):ee.key==="ArrowUp"?(Ie?R(ze,!0):re({y:Fe?-10:-1}),ee.preventDefault()):ee.key==="ArrowDown"&&(Ie?R(ze,!1):re({y:Fe?10:1}),ee.preventDefault())},children:[me,$e]})})})})),$t=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const d=e[l].getBounds();t=Math.min(d.x,t),n=Math.min(d.y,n),i=Math.max(d.x+d.width,i),a=Math.max(d.y+d.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Go=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let d=0,m=Number.MAX_SAFE_INTEGER,p=0;for(let h=0;h<e.length;h++){const f=e[h],T=f.getBounds();d+=T[l],m=Math.min(T[i],m),p=Math.max(T[i]+T[l],p),n.push({bounds:T,movable:f})}const g=(p-m-d)/(e.length-1);n.sort((h,f)=>{const T=h.bounds[i],q=f.bounds[i];return T!==q?T-q:h.bounds[a]-f.bounds[a]});const x=new Map;x.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const f=n[h-1].bounds,T={...n[h].bounds};T[i]=f[i]+f[l]+g,n[h].bounds=T,x.set(n[h].movable,T)}return x.set(n[n.length-1].movable,n[n.length-1].bounds),x};function Tr(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,p=r.useEditMode();o.useRef(p.getMode()).current=p.getMode();const g=r.useCallbackRef(async(y,B,S=null,w=!0)=>{const k=async()=>{const O=await Promise.resolve(m?.showBusy?.(y.label()));try{await B();const E=S??y?.label?.();if(d){let F=null;y&&E!==!1&&(F=new r.SimpleCommand(y.key(),l,{label:E,description:E},k)),d(F)}O?.(),w&&p.setMode(null)}catch(E){O?.(),m?.showError?.(E)}};await k()},[d,m]),[x,h]=o.useReducer(y=>y+1,0),f=r.useCallbackRef((y,B,S)=>{if(!n)return;const w=n.getMovableSelection();if(w.length===0)return;let k="Drawings";if(w.length===1){const E=w[0];k=s.TextUtils.capitalize(E.getContent().getType())??"Drawing"}const O=`${y.label()} ${k}`;g(y,()=>{let E=null;i&&(E=i.beginCommit(O));const F=n.getMovableSelection();if(F.length===0)return;const Z=S?.(F);for(let _=0;_<F.length;_++){const P=F[_];B(P,Z)}E?.commit()})},[n,i]),[T,q]=o.useState(n.getMovableSelection()[0]??null),[A,D]=o.useState(!T||T?.isProtected()),G=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){f(this,y=>{y.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){f(this,y=>{y.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){f(this,y=>{y.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){f(this,y=>{y.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){f(this,y=>{y.setLockAspectRatio(!y.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){f(this,y=>{y.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){f(this,(y,B)=>{y.setBounds({x:B.x})},$t)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){f(this,(y,B)=>{y.setBounds({x:(B.width-y.getBounds().width)/2+B.x})},$t)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){f(this,(y,B)=>{y.setBounds({x:B.width-y.getBounds().width+B.x})},$t)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){f(this,(y,B)=>{y.setBounds({y:B.y})},$t)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){f(this,(y,B)=>{y.setBounds({y:(B.height-y.getBounds().height)/2+B.y})},$t)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){f(this,(y,B)=>{y.setBounds({y:B.height-y.getBounds().height+B.y})},$t)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){f(this,(y,B)=>{y.setBounds(B.get(y))},y=>Go(y))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){f(this,(y,B)=>{y.setBounds(B.get(y))},y=>Go(y,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing."}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,T]);o.useEffect(()=>{},[p]);const U=o.useMemo(()=>{let y=null;return y=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),y.addCommands(G,!0),y},[a,G]);return tt(T,{onAnyChange:()=>{U.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===s.IAnchored.Type.TwoCell}),U.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===s.IAnchored.Type.OneCell}),U.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:y=>{D(y.isProtected())},onDelete:()=>{}}),tt(n,{onMovableSelectionChange:()=>{const y=n.getMovableSelection()[0]??null;q(y),D(!y||y.isProtected()),h()}}),tt(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const y={disabled:A};U.getCommand("formatAnchorTypeTwoCell").update(y),U.getCommand("formatAnchorTypeOneCell").update(y),U.getCommand("formatAnchorTypeAbsolute").update(y),U.getCommand("toggleLockAspectRatio").update(y);const B=t.getCount(),S=n.getMovableSelection(),w=A||B<=1||S.length===0;let k={disabled:w},O=k;if(!w&&S.length===1){const Z=S[0];Z.getZIndex()===0&&(k={disabled:!0}),Z.getZIndex()===B-1&&(O={disabled:!0})}U.getCommand("moveToFront").update(O),U.getCommand("moveForward").update(O),U.getCommand("moveToBack").update(k),U.getCommand("moveBackward").update(k);const E={disabled:A||S.length<=1};U.getCommand("formatDrawAlignLeft").update(E),U.getCommand("formatDrawAlignCenter").update(E),U.getCommand("formatDrawAlignRight").update(E),U.getCommand("formatDrawAlignTop").update(E),U.getCommand("formatDrawAlignMiddle").update(E),U.getCommand("formatDrawAlignBottom").update(E),U.getCommand("formatDrawFlipHorz").update(E),U.getCommand("formatDrawFlipVert").update(E),U.getCommand("formatDrawGroup").update(E),U.getCommand("formatDrawUngroup").update(E),U.getCommand("formatDrawSwapShapes").update(E),U.getCommand("formatDrawSwapShapesHorz").update(E),U.getCommand("formatDrawSwapShapesVert").update(E);const F={disabled:A||S.length<=2};U.getCommand("formatDrawDistributeHorz").update(F),U.getCommand("formatDrawDistributeVert").update(F)},[x,A,x]),U}const Ql=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:p,...g}=e;o.useEffect(()=>{},[a]);const x=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:f,width:T}]=Lt();return c.jsx("div",{...g,ref:Zt([x,h]),children:c.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:l.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:c.jsx("div",{style:{textAlign:"center"},children:a})})})})),ei=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:p,onRepeatCommandChange:g}=e,x=Tr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:g,commands:d,target:m,notifier:p});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>c.jsx(Mr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{x.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,x]);return h&&n?h:null})),ti=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:p,notifier:g=r.DefaultNotifier}=e,x=r.useEditMode(),[h,f]=o.useState(null),[T,q]=o.useState(null),[A,D]=o.useState(null),[G,U]=o.useState(null),[y,B]=o.useState(null);o.useLayoutEffect(()=>{if(A===null)return U(null),void B(null);const z=()=>{const K=i.getRange(A).getCell(),W=K.getStyle();let ge,ae=W.getFill()?.toCSS(a.body.darkMode);ae.background!=="none"&&ae.background!=="transparent"||(ae=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),ae.background!=="none"&&ae.background!=="transparent"||(ae={background:a.body.fill}),U({style:ae}),K&&!K.getFormula()&&(ge=K?.getRenderHorizontalAlignment()),B(ge??r.HorizontalAlignment.Left)};return z(),i.getRange(A).addListener(()=>{z()})},[i,A,a?.body]);const S=r.useCallbackRef(()=>{let z=T.editState.dirty??"";if(T.editState.dirty!==void 0){const K=s.TextUtils.clampString(z);try{const W=T.sheet.getRange(T.coords),ge=`Typing '${K}' into ${W.toString()}`;return W.setValue(z,{description:ge,autoFit:!0}),D(null),q(null),x.setMode(null),m(null),!0}catch(W){throw g.showError(new Error(`Unable to enter '${K}'.`,{cause:W})),W}}},[i,T,g]),w=r.useCallbackRef(z=>i.getRange(z).getCell().getExtrusions()??ue.CoordUtils.cellToRange(z),[i]),k=r.useCallbackRef(z=>{let K=s.IRange.Orientation.Row,W=!1;z!==s.IRange.Direction.Up&&z!==s.IRange.Direction.Down||(K=s.IRange.Orientation.Column),z!==s.IRange.Direction.Left&&z!==s.IRange.Direction.Up||(W=!0),i.getSelection().traverse(K,W)},[i]),O=o.useCallback((z,K)=>{if(l)return l(z,K);if(!i)return null;const{ref:W,...ge}=z;return c.jsx(br,{ref:W,...ge,sheet:i,bodyStyle:a?.body,activeCoords:K,commands:p,onChangeEdit:ae=>{const Q={sheet:i,coords:K,editState:ae};x.setMode(X=>({...X,description:Q.editState.editMode?"Edit":"Enter",args:{...X?.args,stateAndCoords:Q}}))},editState:T.editState})},[i,G,l,T,A]),{overlay:E,startEdit:F,submitEdit:Z,cancelEdit:_,onKeyboardEventNative:P,onPointerEventNative:V}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:O,canEdit:()=>{const z=i.getProtection();if(z.isReadOnly())return!1;const K=z.isLocked();return K&&d(),!K},onBeforeStartEdit:z=>{const K=wr(()=>i.getRange(z).getCell()),W={sheet:i,coords:z,editState:Object.freeze(K)};x.setMode({key:"edit",args:{stateAndCoords:W}}),q(W)},onStartEdit:z=>{D(z),m(z)},onSubmitEdit:S,onCancelEdit:z=>{D(null),q(null),x.setMode(null),m(null)},onDoneEdit:z=>{x.setMode(null)},onNavigate:k,containerProps:G,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:y,getRangeCoords:w});tt(i.getSelection(),{onChange(z){f(i.getSelection().getCoords().cell)}});const $=r.useCallbackRef(z=>{V(z),A&&Z()},[V,_,A]),oe=o.useCallback(z=>{V(z)},[V]),L=o.useCallback(z=>{P(z)},[P]);return o.useEffect(()=>{const z=n?.getStage();if(z)return z.addEventListener("pointerdown",$),z.addEventListener("dblclick",oe),z.addEventListener("keydown",L),()=>{z.removeEventListener("pointerdown",$),z.removeEventListener("dblclick",oe),z.removeEventListener("keydown",L)}},[n?.getStage()]),o.useEffect(()=>{const z=x.getMode(),K=z?.key;K==="edit"||K==="enter"?T?z.args?.cancel?_():z.args?.submit?Z():q(z.args?.stateAndCoords):F(z.args?.start):A&&_()},[x]),E(n,t)})),Ir="white",Er="black",ni=`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='${Er}' fill='${Ir}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,oi=`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='${Er}' fill='${Ir}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ri=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[d,m]=o.useState(null),[p,g]=o.useState(null),[x,h]=o.useState(null),[f,T]=o.useState(null),q=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const S=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(S.length>0?S:null)}else l(!1),m(null)},[i,n]),A=r.useCallbackRef(S=>{S.preventDefault(),S.stopPropagation();const w=n.getCellCoordsFromClient(S.clientX,S.clientY),k=i.getTables().getItems({address:w});k.length===1&&k[0].select()},[n,i]),D=r.useCallbackRef(S=>{S.preventDefault(),S.stopPropagation();const w=n.getCellCoordsFromClient(S.clientX,S.clientY),k=i.getTables().getItems({address:w});if(k.length===1){const O=k[0].getRange().getCoords(),E={colStart:O.colStart,rowStart:w.rowIndex,colEnd:O.colEnd,rowEnd:w.rowIndex};i.getRange(E).select()}},[n,i]),G=r.useCallbackRef(()=>{if(!a)return;const S=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(S.length>0?S:null)},[i,a,n]);tt(i?.getSelection(),{onChange(S){g(i.getSelection().getCoords().cell)}}),tt(x,{onAnyChange(S){q(),G()}}),tt(f,{onAnyChange(S){G()}}),tt(i,{onTablesChange(S){q(),G()},onInvalidated(S){q(),G()}});const U=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(G,300),300),[]);o.useEffect(()=>{U()},[n]),o.useEffect(()=>{let S=null;if(d)for(let w=0;w<d.length&&!S;w++){const k=d[w],O=k.getRange().getCoords();s.CoordUtils.isCellWithinRange(p,O)&&(S=k)}h(S)},[p,d]);const y=r.useCallbackRef(S=>{let w=null;if(d)for(let k=0;k<d.length;k++){const O=d[k],E=O.getRange().getCoords();let F=n.getRangeCoordsBounds(E);const Z=n.getRelativePointFromClient(S.clientX,S.clientY),_=Z.x,P=Z.y;if(_>=F.x&&_<=F.x+F.width&&P>=F.y&&P<=F.y+F.height){const V=n.getViewportSize();_<=0||P<=0||_>=V.width||P>=V.height||(w=O)}}T(w)},[n,d]);if(o.useEffect(()=>{const S=n?.getStage();if(S&&d)return S.addEventListener("mousemove",y),S.addEventListener("mouseleave",y),()=>{S.removeEventListener("mousemove",y),S.removeEventListener("mouseleave",y)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const B=[];for(let S=0;S<d.length;S++){const w=d[S];if(w.isClosed())continue;const k=w===f,O=w===x,E=w.getRange().getCoords(),F=n.getRangeCoordsBounds(E);let Z;if(k||O){const _=w.getStyle().getProperties(),P=_.headerRow?.fill?.background??_.wholeTable?.border?.top?.color?.toString();if(P&&i){const V=i.getStyles().parseColor(P);V&&(Z=V.toCSS())}Z||(Z="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}B.push(c.jsx("div",{style:{position:"absolute",left:F.x,top:F.y,width:Math.min(16,F.width),height:F.height,pointerEvents:"all",cursor:ni},onMouseDown:D},`table-select-row-${w.getName()}`)),B.push(c.jsx("div",{style:{position:"absolute",left:F.x,top:F.y,width:Math.min(16,F.width),height:Math.min(16,F.height),pointerEvents:"all",cursor:oi},onMouseDown:A},`table-select-${w.getName()}`)),B.push(c.jsx(dt.Selection,{x:F.x,y:F.y,width:F.width,height:F.height,range:E,strokeWidth:O?.5:0,stroke:Z??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:k?`${Z} 0px 0px 1px 1px`:void 0}},`table-outline-${w.getName()}`))}return B})),li=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,p]=o.useState(null),g=o.useRef(null),x=r.useCallbackRef(()=>{const D=i.getSelectedCell(),G=D.getSpill()?.getCoords()??null;ue.CoordUtils.isEqualRanges(G,l)||(p(G?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(G),coords:G}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(G))},[i,n,l]);o.useEffect(()=>(g.current&&(clearTimeout(g.current),g.current=null),m&&(g.current=setTimeout(()=>{p(null),g.current=null},a)),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[m,a]);const h=o.useMemo(()=>ue.CommonUtils.debounce(ue.CommonUtils.throttle(x,80),80),[]);if(tt(i?.getSelection(),{onChange(D){h()}}),tt(i,{onSpillsChange(D){x()},onInvalidated(D){x()}}),!n||!l&&!m)return null;const f=i.getRange(l).getValue()instanceof s.FormulaError.Spill,T=[];let q=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ue.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&p(null),q=n.toClipBounds(q,-10),!q)return;const A="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return T.push(c.jsx(dt.Selection,{x:q.x,y:q.y,width:q.width,height:q.height,range:l,strokeWidth:1,stroke:A,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:f?"6 3":void 0,opacity:m?.transition==="out"?0:1,transition:m?.transition?m.transition==="in"||m.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${A} 0px 0px 4px 0px`}},"spill-outline}")),T})),ii={position:"absolute",top:0,left:0,bottom:0,right:0},_o=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ue.CommonUtils.mergeContentful(e.body,l);return n.body=ue.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ue.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=ue.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ue.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ue.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ue.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ue.CommonUtils.mergeContentful(n.headerSelectAll,l),n},ai={fireOnModelChange:!1},Zo={},Fr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Zo,headersStyle:a=Zo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:p,rowHeaderProps:g,showScrollbars:x=!0,scrollPaneProps:h,onViewportChange:f,commands:T,onRepeatCommandChange:q,onMoveCell:A,overlays:D,renderMovable:G,viewportComponent:U,onElementLoad:y,getCellEditor:B,onFocus:S,onBlur:w,style:k=r.ReactUtils.EmptyCssProperties,notifier:O,onShowTooltip:E,onShowColumnTooltip:F,onShowRowTooltip:Z,onCloseTooltip:_,gridProps:P,cellRenderProps:V,...$}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[oe,L]=o.useReducer(te=>te+1,0),[z,{width:K,height:W}]=Lt(),ge=r.useCallbackRef(E,[E]),ae=r.useCallbackRef(F,[F]),Q=r.useCallbackRef(Z,[Z]),X=r.useCallbackRef(_,[_]),be=o.useRef(!1);o.useLayoutEffect(()=>{be.current=!0},[n]);const ke=n?.getStyles(),ve=o.useMemo(()=>_o(i,ke),[i,ke]),Pe=o.useMemo(()=>_o(a,ke),[a,ke]),{body:he={},buttonSurface:He={}}=ve,{header:Se={},headerSelect:ce={},headerSelectAll:de={}}=Pe,me=o.useRef(null),[Ce,xe]=o.useState(()=>n?.getView()),Me=(Ce?.getZoomScale()??100)/100,we=o.useMemo(()=>({vertical:Ce.isShowColumnGridlines()&&Me>=.4,horizontal:Ce.isShowRowGridlines()&&Me>=.4}),[Ce?.isShowColumnGridlines(),Ce?.isShowRowGridlines(),Me]),Ee=o.useMemo(()=>{if(Ce?.getGridLineColor())return{strokeDasharray:"1,1"}},[Ce?.getGridLineColor(),ve]),Le=d??Ce?.isShowColumnHeaders(),Ve=p??Ce?.isShowRowHeaders(),[C,Ue]=o.useState({width:0,height:0}),Qe=o.useMemo(()=>{let te=40,Re=20;const Te=n?.getStyles().getNormal().getFont();if(C.width>0&&C.height>0){const Ke=Te?.toCSS()?.fontFamily??ve.header.text.fontFamily,Ze=Te?.getSize()??ve.header.text.fontSize,et=s.IFont.getSharedMeasurer()(""+C.height,Math.ceil(Ze*s.IFont.getDeviceScale()),Ke);te=et.width,Re=et.lineHeight}return{width:Math.round(te+5),height:Math.round(Re+3)}},[C,ve?.header.text,n]),$e=Ve?Me*Qe.width:Se.edgeStrokeWidth,ee=Le?Me*Qe.height:Se.edgeStrokeWidth,Fe=Math.max(K,(n?.getColumnHeaders().getDefaultSize()??Qe.width)+$e+1),Be=Math.max(W,(n?.getRowHeaders().getDefaultSize()??Qe.height)+ee+1),Ie=o.useRef(new Map),ze=o.useRef(null),Ae=()=>({getColOffset:te=>n.getColumnHeaders().findOffset(te),getColIndex:te=>n.getColumnHeaders().findIndex(te),getRowOffset:te=>n.getRowHeaders().findOffset(te),getRowIndex:te=>n.getRowHeaders().findIndex(te)}),[R,re]=o.useState(()=>Ae()),[j,J]=o.useState(!1),[u,M]=o.useState(null),I=!0,b=ve.selection?.strokeFill,N=o.useCallback(()=>Mt.current,[]),[v,H]=o.useState(),Y=r.useCallbackRef(te=>{H(te),n&&n.getView()&&n.getView().setTopLeft(te?{left:te.left,top:te.top}:null),f?.(te)},[n,f]),ne=o.useRef(null);o.useEffect(()=>{if(!v||!n)return;const te=n.getRangeAtBounds({x:v.left,y:v.top,width:v.width,height:v.height});ne.current?.(),ne.current=te.addListener(()=>{const Re=te.getCoords();me?.current?.invalidate(Re)})},[v,n]);const[le,ie]=o.useState(()=>n?.getView().getTopLeft()),se=r.useCallbackRef(te=>{const Re=ue.CoordUtils.cellToRange(te);if(n.isClosed())return Re;const Te=n.getRange(Re,{excludeHidden:!0}).getMerges();return Te.length===0?Re:Te[0]},[n]),ye=te=>{if(!te||te.coords.colIndex===0&&te.coords.rowIndex===0)return null;const Re={};return te.coords.colIndex>0&&(Re[ue.AnchorLocation.Left]={index:te.coords.colIndex,scrollOffset:te.topLeft.left}),te.coords.rowIndex>0&&(Re[ue.AnchorLocation.Top]={index:te.coords.rowIndex,scrollOffset:te.topLeft.top}),Re},[fe,pe]=o.useState(()=>ye(n.getView().getFreezePanes())),qe=r.useEditMode(),Oe=o.useCallback(()=>me.current,[]),De=r.useCallbackRef(te=>{qe.setMode(Re=>Re?.key==="edit"?{...Re,args:{...Re.args}}:{key:"edit",args:{stateAndCoords:null,start:te}})},[]),We=r.useCallbackRef(()=>v,[v]),je=Rr({sheet:n,commands:T,target:Oe,onRepeatCommandChange:q,bodyStyle:he,notifier:O,onStartEdit:De,getViewport:We}),[Ge,Ne]=o.useState(n.getSelection().isEntire()),[Xe,it]=o.useState(Ce?.getMovableSelection().length>0),pt=u!==null||Xe,xt=null,[_e,rt]=o.useState(!1);o.useEffect(()=>{rt(!1)},[n.getProtection()]);const vt=r.useCallbackRef(()=>{_e||(rt(!0),O.showMessage?.(c.jsxs("span",{children:["This sheet is protected.",c.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotificationType.Error}))},[O,_e]),yt=o.useMemo(()=>{const te=qe.getMode();return te?.cursor?te.cursor:null},[xt,qe]),[Ct,gt]=o.useState(null),lt=o.useRef(!1),[It,jt]=o.useState([]),Jt=o.useRef(null),[Dt,Qt]=o.useState(ue.TypesUtils.EmptyTopLeft),[Tt,xn]=o.useState(ue.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Qt({left:le?.left,top:0})},[le?.left]),o.useEffect(()=>{xn({left:0,top:le?.top})},[le?.top]),tt(n?.getView(),{onFreezeSplitChange:()=>{pe(ye(n.getView().getFreezePanes()))},onTopLeftChange:()=>{ie(n.getView().getTopLeft())},onMovableSelectionChange:()=>{it(n.getView().getMovableSelection().length>0)}}),tt(n?.getSelection(),{onChange:()=>{Ne(n.getSelection().isEntire())}}),tt(n,{onViewChange(){xe(n.getView()),re(Ae())},onLayoutChange:()=>{const te=n.getEntireRange();Ue({height:te.getRowCount(),width:te.getColumnCount()}),re(Ae())},onStyleChange:()=>{zt()},onMovablesChange:()=>{},onInvalidated:()=>{zt()}}),tt(n,{onRequestScrollIntoView:async(te,Re)=>{if(!Re)return;const Te={colIndex:Re?.coords.colStart,rowIndex:Re?.coords.rowStart};return await me.current?.scrollCellCoordsIntoView(Te,Re?.scroll),!0},onRequestFocus:()=>ue.CommonUtils.whenFocus(Mt.current)},ai);const bt=o.useRef(!1),Bt=o.useMemo(()=>{const te=(Te,Ke)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:0,rowEnd:C.height,colStart:Te,colEnd:Te})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getColOffset(Te)),Je=Ze.getBounds(),st=Math.min(Je.x+Je.width,et.getColOffset(Te+1)),ht=Ze.getAnchor();if(Ke!==null&&(ht===ue.AnchorLocation.Left||ht===ue.AnchorLocation.Center||ht===ue.AnchorLocation.Right)){const eo=ue.CommonUtils.roundAccurately(Ke*ue.CommonUtils.getDPI(),0),kn=ue.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ke/Me),2).toFixed(2),to="Width: "+(Ke?kn+" ("+eo+" pixels)":"Hidden"),ln=Ut.current.getGridElement().getRelativePointFromClient(0,0),Kt=0-ln.y,Mn=0-ln.y+ee,no={x:ot-(ln.x-Je.x),y:Kt,width:st-ot,height:Mn-Kt};requestAnimationFrame(()=>{lt.current&&ae?.({anchor:no,display:to})})}const Et=[0,0,0,Je.height],rn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Yn={x:ot-1,y:0,width:1,height:Je.height},Jn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Qn={x:st-1,y:0,width:1,height:Je.height};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Et,bounds:Yn,...rn}),c.jsx(dt.SVGLine,{linePoints:Et,bounds:Qn,...Jn})]},"resize-dividers")}])};let Re=null;return{onResizeHeadersStart:(Te,Ke,Ze)=>{Re=n.beginCommit(Ze),bt.current=!1,te(Te,Ke)},onResizeHeaders:(Te,Ke,Ze)=>{bt.current=!1,te(Te,Ke)},onResizeHeadersDown:(Te,Ke)=>{bt.current=!0,setTimeout(()=>{bt.current&&te(Te,Ke)},280)},onResizeHeadersEnd:(Te,Ke,Ze)=>{Re?.commit({description:Ze}),Re=null,bt.current=!1,requestAnimationFrame(()=>X?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Te=>{bt.current=!1,requestAnimationFrame(()=>X?.()),lt.current=!1,gt(null)},...m}},[n,m,ee,Ct]),en=o.useMemo(()=>{const te=(Te,Ke)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:Te,rowEnd:Te,colStart:0,colEnd:C.width})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getRowOffset(Te)),Je=Ze.getBounds(),st=Math.min(Je.y+Je.height,et.getRowOffset(Te+1)),ht=Ze.getAnchor();if(Ke!==null&&(ht===ue.AnchorLocation.Top||ht===ue.AnchorLocation.Center||ht===ue.AnchorLocation.Bottom)){const eo=Math.floor(10*ue.CommonUtils.getDPI())/10,kn=ue.CommonUtils.roundAccurately(Ke*eo,0),to=ue.CommonUtils.roundAccurately(kn/Me/(n?.getRowHeaders().getScaleFactor()*ue.CommonUtils.getDPI()),2).toFixed(2),ln="Height: "+(Ke?to+" ("+kn+" pixels)":"Hidden"),Kt=Ht.current.getGridElement().getRelativePointFromClient(0,0),Mn=0-Kt.x,no=0-Kt.x+$e,vl={x:Mn,y:ot-(Kt.y-Je.y),width:no-Mn,height:st-ot};requestAnimationFrame(()=>{lt.current&&Q?.({anchor:vl,display:ln})})}const Et=[0,0,Je.width,0],rn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Yn={x:0,y:ot-1,width:Je.width,height:1},Jn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Qn={x:0,y:st-1,width:Je.width,height:1};return c.jsxs(o.Fragment,{children:[c.jsx(dt.SVGLine,{linePoints:Et,bounds:Yn,...rn}),c.jsx(dt.SVGLine,{linePoints:Et,bounds:Qn,...Jn})]},"resize-dividers")}])};let Re=null;return{onResizeHeadersStart:(Te,Ke,Ze)=>{Re=n.beginCommit(Ze),bt.current=!1,te(Te,Ke)},onResizeHeaders:(Te,Ke,Ze)=>{bt.current=!1,te(Te,Ke)},onResizeHeadersDown:(Te,Ke)=>{bt.current=!0,setTimeout(()=>{bt.current&&te(Te,Ke)},280)},onResizeHeadersEnd:(Te,Ke,Ze)=>{Re?.commit({description:Ze}),Re=null,bt.current=!1,requestAnimationFrame(()=>X?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Te=>{bt.current=!1,requestAnimationFrame(()=>X?.()),lt.current=!1,gt(null)},...g}},[n,g,$e]),Mt=r.useImperativeElement(t,()=>{const te=Te=>{n?.getView()&&n.getView().selectMovables([]),ze.current=null,me?.current?.focus(Te)},Re=async(Te=null)=>{if(Te||(Te=n?.getView().getMovableSelection()[0]),!Te)return!1;const Ke=Te.getAnchorCoords();if(!Ke)return!1;const Ze=me.current?.getViewFromCellCoords({colIndex:Ke.colStart,rowIndex:Ke.rowStart});if(!Ze)return!1;const et=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(Te)===-1&&n?.getView().selectMovables([Te]);let ot=Ie.current?.get(et);return ot?.current?(await ot.current.focusMovable(Te),!0):(ze.current={movable:Te,anchor:et},!0)};return{getGridElement:()=>me.current,getRowHeaderElement:()=>Ht.current,getColumnHeaderElement:()=>Ut.current,rowHeaderHeight:()=>ee,colHeaderWidth:()=>$e,startEdit:De,submitEdit:()=>{qe.setMode(Te=>Te?.key!=="edit"?Te:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{qe.setMode(Te=>Te?.key!=="edit"?Te:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:u!==null,focus:Te=>{n?.getView().getMovableSelection().length>0&&Re()||te(Te)},focusSheet:te,focusMovable:Re,contains:Te=>me?.current?.contains?.(Te),invalidate:zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),zt=o.useCallback(te=>{be.current||(me?.current?.invalidate(te),L?.())},[]);o.useEffect(()=>{zt()},[ve]);const qn=Ge?de.edgeStrokeFill:Se.fill,nt=Ge?ce.fill:typeof ve.headerHover=="function"?ve.headerHover(Se)?.fill:Se.fill,Sn=o.useMemo(()=>U?c.jsx("div",{className:wt("sheetxl-viewport-overlay",Fl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:U}):c.jsx(c.Fragment,{}),[U]);let Vt=null;Le&&Ve&&(Vt=c.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${ee}px`,width:`${$e}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:te=>{let Re=!te.ctrlKey;je?.getCommand("selectAll")?.execute(!Re||te.button!==0),te.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:te,clientX:te.clientX,clientY:te.clientY,rowIndex:-1,colIndex:-1}):me.current?.focus()},children:[c.jsx("div",{style:{height:ee-5+"px",width:ee-5+"px",clipPath:`path('M${ee-5} 0 L0 ${ee-5} L${ee-5} ${ee-5} L${ee-5} 0 Z')`,borderRight:`2px solid ${qn}`,borderBottom:`2px solid ${qn}`,background:`${nt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),c.jsx("div",{style:{position:"absolute",height:`${ee}px`,width:`${$e}px`,boxSizing:"border-box",borderRight:`solid 1px ${Se.strokeFill}`,borderBottom:`solid 1px ${Se.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const tn=r.useCallbackRef(({_left:te,_top:Re})=>{},[]),at=r.useCallbackRef(te=>{if(!l)return;const Re=me.current.getViewFromClient(te.clientX,te.clientY)?.getCellCoordsFromClient(te.clientX,te.clientY);Re&&(l({originalEvent:te,clientX:te.clientX,clientY:te.clientY,rowIndex:Re.rowIndex,colIndex:Re.colIndex}),te.stopPropagation(),te.preventDefault())},[l]),mt=r.useCallbackRef(te=>{if(!(!te.shiftKey&&(te.ctrlKey||te.metaKey)))return;const{deltaY:Re}=te;return Re>0?je.getCommand("sheetZoomOut")?.execute():Re<0&&je.getCommand("sheetZoomIn")?.execute(),Re===0},[je]);o.useEffect(()=>{jt(null),Jt.current=null,lt.current=!1,gt(null);const te=n?.getView().getTopLeft();tn(te),me.current?.scrollTo(te),ie(te),xe(n.getView()),pe(ye(n.getView().getFreezePanes())),re(Ae()),L()},[n?.getView()]);const nn=r.useCallbackRef(te=>{const Re=te.getVisibleRangeCoords();if(!Re)return null;const Te=[];return n.getRange(Re).forEach((Ke,Ze)=>{const et=Ze.getCoords(),ot=Ze.getCell();(Je=>{if(Je.isEmpty())return!1;const st=Je.getSpans();if(st.width>1||st.height>1||Je.getStyle().hasVisibleStyling()||Ce.isShowFormulas()&&Je.getFormula()!==null)return!0;const ht=Je.getValue();return ht!==null&&!(!Ce.isShowZeros()&&ht===0&&Je.getType()===s.ScalarType.Number)})(ot)&&Te.push({coords:et,value:ot,range:Ce.isShowFormulas()?null:ot.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),Te},[n,Ce.isShowZeros(),Ce.isShowFormulas(),u]);o.useEffect(()=>{const te=[];D&&te.push(...D),Ct&&te.push(...Ct),ue.CommonUtils.isEqualArrays(te,Jt.current)||(Jt.current=te,jt(te))},[D,Ct,ve]);const on=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[ve?.header?.edgeStrokeFill]),Pt=r.useCallbackRef(te=>{te.isDefaultPrevented()||te.isPropagationStopped()||(ze.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const te=qe.getMode();return te?.key==="cut"||te?.key==="copy"},[qe]),Gn=r.useCallbackRef(async te=>{const Re=qe.getMode();return te.keyCode===r.KeyCodes.Escape&&Re?(te.preventDefault(),void qe.setMode(null)):te.keyCode===r.KeyCodes.Enter&&Wn?(te.preventDefault(),await je?.getCommand("paste")?.execute(),void qe.setMode(null)):void je?.dispatchToFocusedCommand(te)},[je,qe]),Ht=o.useRef(null),Rn=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${ee+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${ee}px)`,boxSizing:"border-box",zIndex:"2"},children:c.jsx($o,{ref:Ht,sheetElement:Mt.current,gridRef:me,freezeStart:fe?.[ue.AnchorLocation.Top],oppositeSize:$e,containerWidth:$e,containerHeight:Be,sheetHeader:n.getRowHeaders(),gridStyle:Pe,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Tt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${ee+1}px`,width:`${$e+Se.edgeStrokeWidth}px`,minWidth:`${$e+Se.edgeStrokeWidth}px`,borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,height:`calc(100% - ${ee}px)`,boxSizing:"border-box",zIndex:"2",...en?.style},...en})}),[$e,ee,Be,n,Tt,fe?.[ue.AnchorLocation.Top],ve,I,l,Se.fill,g]),Ut=o.useRef(null),cl=o.useMemo(()=>c.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${ee+Se.edgeStrokeWidth}px`,minHeight:`${ee+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:c.jsx($o,{ref:Ut,sheetElement:Mt.current,gridRef:me,freezeStart:fe?.[ue.AnchorLocation.Left],oppositeSize:ee,containerWidth:Fe,containerHeight:ee,sheetHeader:n.getColumnHeaders(),gridStyle:Pe,scrollPoint:Dt,onSheetContextMenu:l,...Bt,style:{...Bt?.style,position:"relative",left:"0px",width:"100%",height:`${ee+Se.edgeStrokeWidth}px`,minHeight:`${ee+Se.edgeStrokeWidth}px`,borderBottom:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[ee,Fe,n,Dt,fe?.[ue.AnchorLocation.Left],ve,Se.fill,I,l,m]),ul=r.useCallbackRef(te=>{const{value:Re,key:Te,...Ke}=te;let Ze=Re,et=u;if(!et||et.colIndex===te.coords.colIndex&&et.rowIndex===te.coords.rowIndex||(et=null),!Ze){const st=te.range;if(Ze=n.getRange({rowIndex:st.rowStart,colIndex:st.colStart}).getCell(),Ze.isEmpty())return null}let ot=null;Ze.getHyperlink()&&(ot=async st=>{if(V?.onLinkMouseDown?.(st),st.button===0&&!st.isDefaultPrevented()){st.stopPropagation(),st.preventDefault();try{await Ze.getHyperlink()?.open()}catch(ht){O?.showError?.(ht)}}}),et&&et.colIndex===te.range.colStart&&et.rowIndex===te.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const Je=n.getStyles();return o.createElement(Cr,{...Ke,key:Te,bodyStyle:he,docTheme:Je.getTheme(),normalStyle:Je.getNormal(),showFormulas:Ce.isShowFormulas(),showZeros:Ce.isShowZeros(),onLinkMouseDown:ot,...V,value:Ze})},[n,R,he,u,Ce?.isShowFormulas(),Ce.isShowZeros()]),gl=o.useCallback((te,Re)=>{const{key:Te,...Ke}=te;return[c.jsx(zl,{ref:Re,getVisibleCells:nn,sheet:n,gridStyle:ve,...Ke},`border-${Te}`),c.jsx(ri,{ref:Re,sheet:n,commands:je,...Ke},`table-${Te}`),c.jsx(li,{ref:Re,sheet:n,...Ke},`spill-${Te}`),c.jsx(Zl,{ref:Re,sheet:n,commands:je,notifier:O,onShowTooltip:ge,onCloseTooltip:X,gridStyle:ve,gridRef:me,editingCoords:u,isActive:I,...Ke},`selection-${Te}`),c.jsx(Hl,{ref:Re,sheet:n,commands:je,gridStyle:ve,element:N,notifier:O,...Ke},`copy-paste-${Te}`),c.jsx(ei,{ref:Re,sheet:n,commands:je,target:Oe,notifier:O,renderMovable:G,movableProps:{onUnFocus:()=>{Mt.current.focus()}},...Ke},`movable-${Te}`),c.jsx(ti,{ref:Re,sheet:n,commands:je,notifier:O,gridStyle:ve,getCellEditor:B,showProtectedError:vt,setEditingCoords:M,...Ke},`editor-${Te}`)]},[n,me.current,ve,B,je,O]),[Io,hl]=o.useState(!1),ml=o.useMemo(()=>{if(Fe===0||Be===0)return null;const te=n.getStyles().getNormal(),Re=te.getFont(),Te=te.getFill(),Ke=te.getBorder(),Ze=te.getFill().getType()===s.IFill.Type.None;let et=Ee,ot=Ee;const Je=(ht,Et,rn)=>rn?{stroke:Ke.getBottom().isNone()?"none":ht.getColor().toRGBA(he.darkMode).toString(),...Et}:Et;ot=Je(Ke.getBottom(),ot,!Ke.getBottom().isNone()),ot=Je(Ke.getTop(),ot,!Ke.getTop().isNone()),et=Je(Ke.getRight(),et,!Ke.getRight().isNone()),et=Je(Ke.getLeft(),et,!Ke.getLeft().isNone());let st=Ce?.getGridLineColor()?.toRGBA(he.darkMode).toString()??he.strokeFill;return Ze||(ot=Je(Ke.getBottom(),ot,!0),ot=Je(Ke.getTop(),ot,!0),et=Je(Ke.getRight(),et,!0),et=Je(Ke.getLeft(),et,!0)),c.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...ii,...Te.toCSS(he.darkMode),...Re.toCSS(he.darkMode,Me),"--sxl-app-color-background":he.fill,"--sxl-app-color-shadow":ve.colorShadow,"--sxl-app-color-grey":ve.colorGrey,"--sxl-app-color-button-fill":He.fill,"--sxl-app-color-button-text":He.text?.fill,"--sxl-app-color-button-border":He.edgeStrokeFill,"--sxl-app-color-primary-dark":ve.selection.strokeFill},ref:me,zoom:Me,...P,onFirstRender:ht=>{hl(!0),P?.onFirstRender?.(ht),je?.activate()},showGridLines:we,gridLineColor:st,gridLineColumnsProps:et,gridLineRowsProps:ot,freezeLeft:fe?.[ue.AnchorLocation.Left],freezeLeftProps:on,freezeTop:fe?.[ue.AnchorLocation.Top],freezeTopProps:on,width:Fe,height:Be,columnCount:C.width,rowCount:C.height,cursor:yt??xt??"cell",clipCells:!0,layout:R,cellRenderer:ul,overlayRenderer:gl,getCellCoordsAsRangeCoords:se,getVisibleCells:nn,onWheelScroll:mt,onPointerDown:Pt,onKeyDown:Gn,onViewportChange:Y,onImmediateScroll:tn,scrollPoint:le,stageProps:{onFocus:()=>{je?.activate()}},overlays:It})},[oe]);o.useEffect(()=>{be.current||L()},[R,fe,Me,je,le?.left,le?.top,he,P,Fe,Be,yt,It,I,xt]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};x||(_n={..._n,...k});const fl=o.useMemo(()=>{const te=n.getStyles().getTheme(),Re=te.getColorScheme(),Te=te.getFontScheme();return{"--sxl-doc-color-dk1":Re.getDk1().toCSS(he.darkMode),"--sxl-doc-color-dk2":Re.getDk2().toCSS(he.darkMode),"--sxl-doc-color-lt1":Re.getLt1().toCSS(he.darkMode),"--sxl-doc-color-lt2":Re.getLt2().toCSS(he.darkMode),"--sxl-doc-color-accent1":Re.getAccent1().toCSS(he.darkMode),"--sxl-doc-color-accent2":Re.getAccent2().toCSS(he.darkMode),"--sxl-doc-color-accent3":Re.getAccent3().toCSS(he.darkMode),"--sxl-doc-color-accent4":Re.getAccent4().toCSS(he.darkMode),"--sxl-doc-color-accent5":Re.getAccent5().toCSS(he.darkMode),"--sxl-doc-color-accent6":Re.getAccent6().toCSS(he.darkMode),"--sxl-doc-color-hlink":Re.getHlink().toCSS(he.darkMode),"--sxl-doc-color-fol-hlink":Re.getFolHlink().toCSS(he.darkMode),"--sxl-doc-font-major":Te.getMajorFont(),"--sxl-doc-font-minor":Te.getMinorFont()}},[n.getStyles().getTheme()]);let Zn=c.jsx("div",{style:_n,onTouchStart:()=>{Eo()},onFocus:te=>{J(!0),S?.(te)},onBlur:te=>{J(!1),w?.(te)},ref:Mt,...$,children:c.jsx("div",{className:wt("sheetxl-sheet",El),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...fl},children:c.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Vt,Rn,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[cl,c.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Se.edgeStrokeWidth}px ${Se.edgeStrokeFill}`,backgroundColor:he.fill},ref:z,onContextMenu:at,children:[ml,Sn,c.jsx(Al,{style:{position:"absolute",right:24,bottom:4},colorLicensee:ve?.selection?.strokeFill,colorCredits:ve?.body?.text?.fill})]})]})]})})});if(x){const te=Re=>c.jsx(wo,{...Re,sheet:n});Zn=c.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Se.fill}`,minHeight:2*Qe.height,minWidth:2*Qe.width,...k},viewport:v,touchElement:me.current?.stage,disableTouch:pt,onScrollViewport:Re=>{me.current?.scrollTo(Re)},createHorizontalScrollbar:te,createVerticalScrollbar:te,...h,children:Zn})}o.useEffect(()=>{be.current=!1,L?.(),j&&Mt.current?.focus()},[n]);const[Xn,pl]=o.useState(!1),Eo=r.useCallbackRef(()=>{Xn||pl(!0)},[Xn]);return o.useEffect(()=>{if(Io)return typeof y=="function"&&y(),r.ReactUtils.detectIt().primaryInput==="touch"&&Eo(),()=>{}},[y,Io,Xn]),Zn}));Fr.displayName="SheetElement";const si=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Xo="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=",Ar=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:p,onHide:g,onShow:x,onKeyDownCapture:h,onFocus:f,onBlur:T,loadingPanel:q,...A}=e,[D,G]=o.useState(!1),[U,y]=o.useState(null),[B,S]=o.useState(null),[w,k]=o.useState(null);o.useEffect(()=>{S(null),l.getDetails().then(F=>{G(!1),S(F.asUrl()),F.asSVGText?.()&&k(F.asSVGText())}).catch(F=>{console.warn(F),G(!0),S(Xo),k(null)})},[l]);const O=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),E=o.useMemo(()=>{if(B||w)return c.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:U?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:B,onLoad:()=>{y(!0)},onError:({currentTarget:F})=>{console.log("error"),F.onerror=null,S(Xo),G(!0)},alt:d??`${l.getType()}`})},[U,l,B,w,m]);if(!l.isClosed())return c.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:m?"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,...A,onKeyDownCapture:F=>{h?.(F)},ref:O,children:[U||D?void 0:q,E]})}));Ar.displayName="PictureEditor";const di=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:p,...g}=e;o.useEffect(()=>{},[a]);const x=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:f,width:T}]=Lt();if(!a.isClosed())return c.jsx("div",{...g,ref:Zt([x,h]),children:c.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:l.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:c.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ci="_editable-input_1bqx6_6",ui=e=>c.jsx("input",{...e}),Dr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:p=ui,notifier:g,styleHover:x={},dragging:h,maxLength:f,disabled:T=!1,readOnly:q=!1,...A}=e,[D,G]=o.useState(!1),[U,y]=o.useState(!1),[B,S]=o.useState(a);o.useEffect(()=>{S(a)},[a]);const w=o.useRef(null),[k,O]=o.useState(null),E=o.useCallback(function(oe){const L=oe.message;k!==L&&(g?.showMessage?.(L,{type:r.NotificationType.Error}),O(L))},[g,k]),F=o.useCallback(oe=>{let L=!1;try{L=l?.(oe)??!0}catch(z){E(z)}return L?(w.current=null,y(!1),S(oe),L):(setTimeout(()=>{w.current?.focus()},0),L)},[l]),Z=r.useCallbackRef(()=>{S(a),w.current=null,y(!1),m?.()},[m,a]),_=o.useMemo(()=>{if(!U)return null;const oe={className:wt(ci),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:f,type:"text",value:B,onFocus:L=>{w.current||(w.current=L.target,setTimeout(()=>{L.target?.select()},0))},onBlur:L=>{w.current&&F(B)},onChange:L=>{U&&S(L.target.value)},onMouseDown:L=>L.stopPropagation(),onKeyDown:L=>L.code==="Escape"?(L.preventDefault(),void Z()):L.code==="Enter"?(L.preventDefault(),void F(L.target.value)):void(L.code!=="Tab"?L.stopPropagation():F(L.target.value))};return c.jsx(c.Fragment,{children:p(oe)})},[U,B,F,Z,p,T]),[P,V]=o.useState();o.useLayoutEffect(()=>{let oe=Object.assign({},n);(h||D)&&(oe=Object.assign(oe,x)),V(oe)},[h,D,x,n]),o.useEffect(()=>{_&&d?.(B)},[_,d,B]);const $=r.useImperativeElement(t,()=>({startEdit(){T||q||y(!0)},cancel(){Z()}}),[]);return c.jsxs("div",{...A,ref:$,style:{flexDirection:"column",display:"flex",...P},className:wt(i),children:[c.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{T||q||y(!0)},onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[c.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:U?0:1},children:B}),_]}),c.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...x},children:B})]})})),Pn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Xt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function yo(e){return"nodeType"in e}function ft(e){var t,n;return e?Xt(e)?e:yo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function xo(e){const{Document:t}=ft(e);return e instanceof t}function bn(e){return!Xt(e)&&e instanceof ft(e).HTMLElement}function zr(e){return e instanceof ft(e).SVGElement}function _t(e){return e?Xt(e)?e.document:yo(e)?xo(e)?e:bn(e)||zr(e)?e.ownerDocument:document:document:document}const Rt=Pn?o.useLayoutEffect:o.useEffect;function Hn(e){const t=o.useRef(e);return Rt(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function pn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function un(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function zn(e){const t=Hn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Nn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let lo={};function wn(e,t){return o.useMemo(()=>{if(t)return t;const n=lo[e]==null?0:lo[e]+1;return lo[e]=n,e+"-"+n},[e,t])}function Nr(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>{const m=Object.entries(d);for(const[p,g]of m){const x=l[p];x!=null&&(l[p]=x+e*g)}return l},{...t})}}const Gt=Nr(1),vn=Nr(-1);function Un(e){if(!e)return!1;const{KeyboardEvent:t}=ft(e.target);return t&&e instanceof t}function Ln(e){if(function(t){if(!t)return!1;const{TouchEvent:n}=ft(t.target);return n&&t instanceof n}(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(t){return"clientX"in t&&"clientY"in t}(e)?{x:e.clientX,y:e.clientY}:null}const Ot=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[Ot.Translate.toString(e),Ot.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Yo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function gi(e){return e.matches(Yo)?e:e.querySelector(Yo)}const hi={display:"none"};function mi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:hi},n)}function fi(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.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":i,"aria-atomic":!0},n)}const Lr=o.createContext(null),pi={draggable:`
23
+ The content is not applied.`}),new r.Command("pasteFormulas",w,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new r.Command("pasteTranspose",w,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new r.Command("pasteLinks",w,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];i.addCommands(R,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const w={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(R=>V.paste({...Ol,...R})).update(w),i.getCommand("pasteFormats").updateCallback((R,j)=>V.paste({...jl,description:j.label(),...R})).update(w),i.getCommand("pasteFormulas").updateCallback((R,j)=>V.paste({...Bl,description:j.label(),...R})).update(w),i.getCommand("pasteTranspose").updateCallback((R,j)=>V.paste({...Vl,description:j.label(),...R})).update(w),i.getCommand("pasteLinks").updateCallback((R,j)=>V.paste({...Pl,description:j.label(),...R})).update(w),i.getCommand("cut").update(w),i.getCommand("paste").update(w)},[t,i]);const y=o.useMemo(()=>{if(!D||!x.current)return;const w=D.key;if(w!=="copy"&&w!=="cut"&&w!=="formatPainter")return;const R=x.current.getItem();if(R.getSource()!==t)return;const j=x.current.isCut?.(),I=j?k:g,E=j?v:m,W=R.getCoords(),_=W?[W]:null;return _&&_.length!==0?P=>{const B=[];for(let K=0;K<_.length;K++){const ne=_[K],L=P.toClipBounds(P.getRangeCoordsBounds(ne,{top:0,left:0,right:1,bottom:1}),dt.SELECTION_CLIP_INSETS);L&&(B.push(M({range:ne,key:`copy-selection-background-${K}`,x:L.x,y:L.y,width:Math.max(L.width,0),height:Math.max(L.height,0),stroke:I,strokeWidth:2})),B.push(M({range:ne,key:`copy-selection-foreground-${K}`,x:L.x+(L.width<=2?-1:0),y:L.y,width:Math.max(L.width,3),height:Math.max(L.height,3),stroke:E,strokeWidth:2,isAnimatedStroke:!0})))}return B}:null},[D,t,n,m,g,v,k]);return{...V,clipboard:F,overlays:y}},Hl=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:d,notifier:m}=e,v=l.body??{},g=a.getView(),{overlays:k}=kr({element:i,sheet:a,sheetView:g,commands:d,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:v.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:v.fill,notifier:m});return tt(a?.getSelection(),{onChange(h){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),k&&n?k(n):null})),Ul="_sheet-selection_12wyx_5",Kl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},$l={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Wl={key:"dragCopy",description:"Drag selection to copy cell contents."},Gl={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Wo=(e,t)=>t.ctrlKey&&t.shiftKey?Gl:t.ctrlKey?Wl:t.shiftKey?$l:Kl,_l={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Zl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,notifier:d,onShowTooltip:m,onCloseTooltip:v,sheet:g,gridRef:k,gridStyle:h,isActive:p,editingCoords:M,...x}=e,A=n?.getBounds(),D=r.useCallbackRef(m,[m]),G=r.useCallbackRef(v,[v]),[U,F]=o.useState(()=>g?.getSelection().getCoords()),V=r.useCallbackRef(J=>{ge.CoordUtils.isEqualSelectionCoords(J,U)||g&&g.getSelection().updateCoords(J)},[g,U]),y=r.useEditMode(),w=o.useRef(null),[R,j]=o.useState(g?.getProtection().isLocked()),[I,E]=o.useState(g?.getView().getMovableSelection().length>0),W=r.ReactUtils.detectIt().primaryInput==="touch",_=!W&&p,P=M!==null||I,B=r.useCallbackRef(J=>{const Z=ge.CoordUtils.cellToRange(J);if(g.isClosed())return Z;const re=g.getRange(Z,{excludeHidden:!0}).getMerges();return re.length===0?Z:re[0]},[g]),K=r.useCallbackRef((J,Z,re,oe,he,Me)=>{const de=g.getSelectedRange().getExtended(oe,J).getCoords();switch(oe){case s.IRange.Direction.Up:return de.rowStart;case s.IRange.Direction.Down:return de.rowEnd;case s.IRange.Direction.Left:return de.colStart;case s.IRange.Direction.Right:return de.colEnd}},[g]),ne=r.useCallbackRef(()=>{const J=g.getUsedRange()?.getCoords(),Z=g.getRowHeaders().getUsedRange()?.getCoords(),re=g.getColumnHeaders().getUsedRange()?.getCoords();return{...J,colEnd:Math.max(J?.colEnd??0,re?.max??0),rowEnd:Math.max(J?.rowEnd??0,Z?.max??0)}},[g]),L=r.useCallbackRef((J,Z)=>g.getRowHeaders().hiddenHeadersAt(J,Z),[g]),z=r.useCallbackRef((J,Z)=>g.getColumnHeaders().hiddenHeadersAt(J,Z),[g]),ae=r.useCallbackRef(J=>g.getRange(J,{excludeHidden:!0}).getMerges(),[g]),ve=r.useCallbackRef(J=>{g?.getSelection().setAdjusting(J)},[g]),Pe=r.useCallbackRef(async()=>{g?.getSelection().setAdjusting(null),y.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),y.setMode(null))},[y,U,g,i]),Se=o.useMemo(()=>{const J=y.getMode();return J?.key==="cut"||J?.key==="copy"},[y]);tt(g?.getView(),{onMovableSelectionChange:()=>{E(g.getView().getMovableSelection().length>0)}}),tt(g?.getSelection(),{onChange(J){const Z=g.getSelection().getCoords();F(Z)}}),tt(g,{onProtectionChange:()=>{j(g.getProtection().isLocked())}});const{body:ue={}}=h||{},Re=n.getLayout(),Ke=!(_&&U.ranges.length<=1&&M===null&&!R&&(!y.getMode()||Se)),{cursor:$e,overlay:Ie,onPointerDown:me}=dt.useSelection({gridRef:k,commands:i,layout:Re,getCellCoordsAsRangeCoords:B,selection:U,fillHandleBorderColor:ue.fill,selectionBackgroundColor:p?h.selection.fill:h.selectionInactive.fill,selectionBorderColor:p?h.selection.strokeFill:h.selectionInactive.strokeFill,selectionRemoveBackgroundColor:p?h.selectionRemove.fill:h.selectionInactive.fill,selectionRemoveBorderColor:p?h.selectionRemove.strokeFill:h.selectionInactive.strokeFill,disableFillDrag:Ke,disableMoveDrag:W||!(p&&U.ranges.length<=1&&M===null&&!R),disableTouchSelection:P,onSelectionChange:V,onSelectionDragStart:ve,onSelectionDragEnd:Pe,onMoveDragStart:(J,Z,re)=>{y.setMode(Wo(0,re))},onMoveDragUpdate:(J,Z,re)=>{y.setMode(Wo(0,re))},onMoveDragEnd:(J,Z)=>{y.setMode(null)},onMoveDragDone:async(J,Z,re)=>{if(ge.CoordUtils.isEqualRanges(J,Z))return;const oe=g.getRange(Z);if(d?.showOptions){const xe=oe.getDifferences(J);let Fe=!1;const f=xe.getCount();for(let Le=0;!Fe&&Le<f;Le++)Fe=xe.at(Le).isContentful();if(Fe&&await d?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const he=!re.ctrlKey,Me=re.shiftKey,de=Me?he?"Insert Moved Cells":"Insert Copied Cells":he?"Move Cells":"Copy Cells",be=await d?.showBusy?.(de);try{const xe=g.getRange(J);await oe.doBatch(async()=>{Me?await oe.insertFrom(J,{isCut:he,undoRange:xe}):await oe.copyFrom(J,{isCut:he,undoRange:xe}),xe.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0}),oe.autoFit({skipCustomSize:!0,orientations:s.IRange.Orientations.Row,minContent:!0})},{description:de,autoSelect:!0})}catch(xe){d?.showError?.(xe)}finally{be?.()}},contentfulCellFinder:K,hiddenRowsAt:L,hiddenColumnsAt:z,mergedRanges:ae,getDataCoords:ne,canSelectionSpanMergedCells:J=>{const Z=g.getRange(J);return Z.isEntireColumns()||Z.isEntireRows()},onFill:async(J,Z)=>{const re="Auto Fill",oe=await d?.showBusy?.(re);try{await g.doBatch(()=>{g.getRange(J).autoFill(Z),g.getRange(Z).autoFit({orientations:s.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:re,autoSelect:!0})}catch(he){d?.showError?.(he)}finally{w.current=null,oe?.()}},onFillPreview:(J,Z,re)=>{if(k.current&&D){y.setMode(_l);try{w.current?.direction!==re&&(w.current=null,g.getRange(J).autoFill(Z,{previewOnly:f=>{w.current={callback:f,direction:re}}}));const oe=w.current?.callback?.(Z);if(!oe||oe.isEmpty())return;const he=oe.toText();if(!he)return;const Me=ge.CoordUtils.cellToRange(oe.getCoords()),de=n.getRelativePointFromClient(0,0);let be=0,xe=0,Fe=r.ToolTipPlacement.Bottom;if(re===s.IRange.Direction.Down){be=Re.getColOffset(Me.colEnd+1)-de.x;const f=Re.getRowOffset(Me.rowEnd),Le=Re.getRowOffset(Me.rowEnd+1);xe=Le-(Le-f)/2-de.y,Fe=r.ToolTipPlacement.Right}else if(re===s.IRange.Direction.Right){xe=Re.getRowOffset(Me.rowEnd+1)-de.y;const f=Re.getColOffset(Me.colEnd),Le=Re.getColOffset(Me.colEnd+1);be=Le-(Le-f)/2-de.x,Fe=r.ToolTipPlacement.Bottom}else if(re===s.IRange.Direction.Up){be=Re.getColOffset(Me.colEnd+1)-de.x;const f=Re.getRowOffset(Me.rowStart),Le=Re.getRowOffset(Me.rowStart+1);xe=Le-(Le-f)/2-de.y,Fe=r.ToolTipPlacement.Right}else if(re===s.IRange.Direction.Left){xe=Re.getRowOffset(Me.rowEnd+1)-de.y;const f=Re.getColOffset(Me.colStart),Le=Re.getColOffset(Me.colStart+1);be=Le-(Le-f)/2-de.x,Fe=r.ToolTipPlacement.Bottom}D({anchor:{x:be,y:xe},display:he,placement:Fe})}catch(oe){d?.showError?.(oe)}}},onFillDone:()=>{w.current=null,y.setMode(null),G?.()}}),$=r.useCallbackRef(J=>{me(r.ReactUtils.createSyntheticEvent(J))},[me,M]);o.useEffect(()=>{const J=n?.getStage();if(J)return J.addEventListener("pointerdown",$),()=>{J.removeEventListener("pointerdown",$)}},[n?.getStage()]);const Ae=r.useImperativeElement(t,()=>({}),[]),Ce=o.useRef(null);return u.jsx("div",{className:yt(a,"sheet-selection",Ul),style:{position:"absolute",width:A?.width,height:A?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Zt([Ae,Ce]),...x,children:Ie(n)})})),In=Object.freeze({x:0,y:0,width:0,height:0}),Xl={fireOnModelChange:!1},Yl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:d,onHide:m,onShow:v,onUnFocus:g,isDragging:k,updateFrameBounds:h,dragStart:p,style:M,disabled:x,renderMovable:A,...D}=e,[G,U]=o.useState(In),[F,V]=o.useState(null),[y,w]=o.useState(!1),R=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const I=a.getBounds();if(!I)return;const E=i.toViewBounds(I);U(E??In),h(E??In)},[i?.getBounds()]),tt(a,{onBoundsChange:I=>{const E=I.getBounds();if(!E)return;const W=i.toViewBounds(E);U(W??In),h(W)},onSelectionChange:()=>{const I=ge.CommonUtils.hasFocus(R.current,!0);!y&&!I||a.isSelected()||g()}}),tt(a,{onRequestFocus:()=>ge.CommonUtils.whenFocus(R.current,!0)},Xl),o.useEffect(()=>{const I=R.current;return l(I),()=>{d(I)}},[]);const j=o.useMemo(()=>{if(!G)return null;let{width:I,height:E}=G;return A({view:i,movable:a,disabled:x,isDragging:k,style:{position:"relative",left:0,top:0,width:I,height:E},onHide:m,onShow:v})},[i,a,G.width,G.height,x,k]);return u.jsx("div",{className:"movable",tabIndex:0,ref:Zt([R,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:G.x,top:G.y,width:G.width,height:G.height,...M},onMouseDown:async I=>{const E=I.shiftKey||I.ctrlKey,W=a.isSelected(),_=I.currentTarget;E&&W?a.unselect():(W&&!E||await a.select({addToSelection:E}),p(I.nativeEvent,_),_.focus())},onFocus:I=>{I.relatedTarget&&!F&&V(I.relatedTarget),w(!0)},onBlur:I=>{F&&!R?.current?.contains(I.relatedTarget)&&V(null),I.relatedTarget&&w(!1)},...D,children:j})})),Jl="_movable-area_314c6_5",Mr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:d,onUnFocus:m,onFocus:v,disabled:g=!1,disableDrag:k=!1,disableResize:h=!1,className:p,style:M,renderDirections:x=["nw","n","ne","w","e","sw","s","se"],onFirstRender:A,...D}=e,G=n.getBounds(),U=r.useCallbackRef(A,[A]),F=r.useCallbackRef(m,[m]),V=r.useCallbackRef(v,[v]),[y,w]=o.useState([]),[R,j]=o.useState(!1),[I,E]=o.useState(!1),W=o.useRef(!0),_=o.useRef(new Map),P=o.useRef(new Map),B=o.useRef(new Map),K=o.useRef(new Map),ne=o.useRef(new Map),L=o.useRef({onRequestFocus:Q=>(Z(Q),null)}),z=o.useRef(null),ae=o.useRef(null),ve=o.useRef(null),[Pe,Se]=o.useReducer(Q=>Q+1,0);o.useLayoutEffect(()=>{Se()},[n,i]),tt(i,{onCollectionChange:()=>{const Q=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0}),qe=ne.current;qe.forEach(Te=>{Te()}),qe.clear();const je=L.current;for(let Te=0;Te<Q.length;Te++){const De=Q[Te];if(De.isClosed())continue;const ze=De.addListeners(je);qe.set(De,ze)}Se()},onInvalidated:()=>{Se()}}),tt(a,{onMovableSelectionChange(Q){Re(),Se()}});const ue=o.useCallback((Q,qe)=>{const je=B.current.get(Q);ve.current&&(ve.current.getTargets().forEach(Te=>{if(Te===je)return Te.style.left=qe.x+"px",Te.style.top=qe.y+"px",Te.style.width=qe.width+"px",void(Te.style.height=qe.height+"px")}),ve.current.updateRect())},[]),Re=()=>{const Q=[],qe=a.getMovableSelection();qe.forEach(je=>{const Te=B.current.get(je);Te&&qe.indexOf(je)!==-1&&Q.push(Te)}),w(je=>ge.CommonUtils.isEqualArrays(je,Q)?je:Q)},Ke=o.useRef(null),$e=o.useMemo(()=>new Promise(Q=>{Ke.current=Q}),[]),Ie=o.useRef(null),me=r.useCallbackRef(async(Q,qe)=>{Ie.current=qe,await(async()=>!(!await $e.then()||!ve.current))()&&Ie.current===qe&&ve.current.dragStart(Q,qe)},[y]),[$,Ae]=o.useState(!1),Ce=o.useRef(null),J=o.useRef(null),Z=r.useCallbackRef(async(Q=null)=>{if(Q||(Q=a.getMovableSelection()[0]),!Q)return F?.(),!1;const qe=B.current.get(Q);qe?(await ge.CommonUtils.whenFocus(qe),qe.focus(),J.current=qe,Ce.current=null):Ce.current=Q},[a]);o.useEffect(()=>{$&&y.length>0&&J.current!==y[0]&&Z(),W.current&&(U?.(),W.current=!1)},[y]);const re=o.useMemo(()=>{const Q=i.getItems({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(Q.length===0&&_.current.size===0)return null;const qe=(S,le,O,Y=!0)=>{const c=S.isSelected(),q={tabIndex:O,view:n,movable:S,onRefLoad:T=>{Ce.current===S&&(T.focus(),J.current=T,Ce.current=null),B.current.set(S,T),P.current.set(T,S),le.rendered=!0,Re()},onRefUnload:T=>{B.current.delete(S),P.current.delete(T),le.rendered=!1,Re()},onUnFocus:F,onHide:T=>{le.onHide=T},onShow:T=>{le.onShow=T},isDragging:c&&(I||R),disabled:g,renderMovable:l,updateFrameBounds:T=>{ue(S,T)},dragStart:me,onMouseUp:()=>{if(Ie.current=null,ae.current){j(!1),E(!1);let T=!1;K.current?.forEach(b=>{ge.CommonUtils.isEqualBounds(b.movable.getBounds(),b.startBounds)||(T=!0)}),T?he():Me()}},style:{opacity:Y?R&&c?.7:void 0:0,zIndex:R&&c?S.getZIndex()+Q.length:void 0,pointerEvents:Y?void 0:"none",cursor:I&&c?"grabbing":g||k?"initial":"move",boxShadow:!c||I&&!R?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return u.jsx(Yl,{...q},`movable-${S.getUUID()}`)},je=_.current,Te=new Map,De=[];for(let S=0;S<Q.length;S++){const le=Q[S];if(le.isClosed())continue;let O=je.get(le);O||(O={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Y,c)=>{if(!c||c.shown===!0)return;c.shown=!0;const q=++c.visibilityRequestId;requestAnimationFrame(()=>{const T=_.current.get(Y);T&&q===c.visibilityRequestId&&(c.onShow?.(Y),T.shown=!0)})},doHide:async(Y,c)=>{if(!c||c?.shown===!1)return;c.shown=!1;const q=++c.visibilityRequestId,T=await Promise.resolve(c.onHide?.(Y));q===c.visibilityRequestId&&T!==!1&&(c.shown=!1,_.current.delete(Y),Se())},visibilityRequestId:0}),O.frame=qe(le,O,S,!0),De.push(O.frame),O.doShow(le,O),je.delete(le),Te.set(le,O)}const ze=[];return a.getMovableSelection().forEach(S=>{const le=je.get(S);le&&(le.frame=qe(S,le,-1,!1),ze.push(le.frame),je.delete(S),Te.set(S,le))}),je.forEach((S,le)=>{S.frame=qe(le,S,-1,!1),ze.push(S.frame),S.doHide(le,S),je.delete(le),Te.set(le,S)}),_.current=Te,Re(),[...ze,...De]},[Pe,n,l,g,k,h,R,I]),oe=r.useCallbackRef((Q,qe)=>{const je=`${qe} ${y.length===1?s.TextUtils.capitalize(P.current?.get(y[0]).getContent().getType()):"Drawings"}`;ae.current&&(console.warn(`Transaction ${ae.current.getDescription()} is being replaced by ${je}`),ae.current.rollback(),ae.current=null),ae.current=d.beginCommit({description:je}),K.current.clear();for(let Te=0;Te<y.length;Te++){const De=y[Te],ze=P.current?.get(De);ze?K.current.set(De,{movable:ze,startBounds:n.toViewBounds(ze.getBounds())}):console.warn("invalid element",ze)}},[d,n,y]),he=o.useCallback(()=>{if(!ae.current)return;const Q=[];K.current?.forEach(qe=>{Q.push(qe.movable)}),ae.current.commit({viewAfter:{view:a,movableSelection:Q}}),K.current.clear(),ae.current=null},[]),Me=o.useCallback(()=>{ae.current&&(ae.current.rollback(),ae.current=null)},[]),de=o.useRef(null);o.useEffect(()=>{de.current&&(de.current.onscroll=Q=>{Q.preventDefault(),Q.srcElement.scrollTop=0,Q.srcElement.scrollLeft=0})},[de.current]);const be=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:Z,focus:()=>{Z()}}),[a]),[xe,Fe]=o.useState(null),f=o.useRef(!1),Le=o.useRef(!1),Xe=o.useRef(!1);o.useEffect(()=>{if(g||y.length===0||Xe.current||f.current)return;if(Le.current)return void requestAnimationFrame(()=>{ve.current&&z.current&&ve.current.refTargets.length>0&&(Xe.current=!0,Ke.current?.(!0)),w([...y])});f.current=!0;const Q=o.lazy(async()=>{try{const qe=await Promise.resolve().then(()=>require("./CV5MkcNzsTDY0vAl.cjs"));return f.current=!1,Le.current=!0,w([...y]),qe}catch(qe){return console.warn(qe),Ke.current?.(!1),null}});Fe(Q)},[y,g,k,h]);const Ue=o.useMemo(()=>!xe||g?null:u.jsx(o.Suspense,{children:u.jsx(xe,{className:yt({dragging:R||I,resizing:R,moving:I}),container:null,ref:ve,target:ve.current?y:[],draggable:!g&&!k,resizable:!g&&!h,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:x,onResizeStart:Q=>{oe(Q.target,"Resize")},onResize:Q=>{if(!ae.current)return Q.stopDrag(),void Se();j(!0);const qe=Q.direction[0]!==0&&Q.direction[1]!==0;let je=0,Te=0;for(let De=0;De<y.length;De++){const ze=y[De],S=K.current.get(ze),le=P.current.get(ze);if(!S||!le){console.warn("invalid element");continue}let O=Q.dist[0],Y=Q.dist[1],c=Q.drag.dist[0],q=Q.drag.dist[1],T=S.startBounds.width,b=S.startBounds.height;De===0?(je=T,Te=b):(O*=T/je,c*=T/je,Y*=b/Te,q*=b/Te);const N={...S.startBounds};if(N.width=Math.max(0,T+O),N.height=Math.max(0,b+Y),Q.direction[0]===-1&&(N.width=Math.max(0,Math.min(S.startBounds.x+T,T-c))),Q.direction[1]===-1&&(N.height=Math.max(0,Math.min(S.startBounds.y+b,b-q))),qe&&(le.isLockAspectRatio()||Q.inputEvent?.shiftKey)){const C=T/b,H=N.width/N.height;H>C?N.height=N.width/C:H<C&&(N.width=N.height*C)}Q.direction[0]===-1&&(N.x=Math.max(0,Math.min(S.startBounds.x+T,S.startBounds.x+T-N.width))),Q.direction[1]===-1&&(N.y=Math.min(S.startBounds.y+b,S.startBounds.y+b-N.height)),S.movable.setBounds(n.toAbsoluteBounds(N))}},onResizeEnd:Q=>{j(!1),he()},onDragStart:Q=>{oe(Q.target,"Move")},onDrag:Q=>{if(!ae.current)return Q.stopDrag(),void Se();E(!0);for(let qe=0;qe<y.length;qe++){const je=y[qe],Te=K.current.get(je);Te?Te.movable.setBounds(n.toAbsoluteBounds({...Te.startBounds,x:Te.startBounds.x+Q.translate[0],y:Te.startBounds.y+Q.translate[1]})):console.warn("invalid element")}},onDragEnd:Q=>{},onMouseUp:Q=>{}})}),[Pe,xe,y,n,g,k,h,R,I]);return u.jsx("div",{className:yt(p,"movable-area",Jl),style:{width:G.width,height:G.height,...M,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Zt([be,de]),...D,children:u.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:G.width,height:G.height},...D,children:u.jsxs("div",{ref:z,style:{position:"absolute",pointerEvents:"auto"},onFocus:Q=>{V?.(),Ae(!0)},onBlur:Q=>{Ae(!1)},onKeyDownCapture:Q=>{if(Q.isDefaultPrevented())return;const qe=Q.nativeEvent.ctrlKey,je=Q.nativeEvent.altKey,Te=Q.nativeEvent.shiftKey;if(Q.which===r.KeyCodes.Escape){const O=a.getMovableSelection();let Y=[...O];return y.forEach(c=>{if(Y.length===0)return;const q=P.current.get(c);let T=Y.indexOf(q);Y.splice(T,1)}),Y.length!==O.length&&a.selectMovables(Y),Y.length===0&&F?.(),void Q.preventDefault()}const De=.1,ze=O=>{i.updateSelected(Y=>{Y.setRotation(Y.getRotation()+O)},"Rotate")},S=(O,Y=!0)=>{i.updateSelected(c=>{const q=c.getBounds();let T=1+O;Y||(T=1/T);const b=Math.sqrt(Math.pow(q.width,2)+Math.pow(q.height,2)),N=Math.atan2(q.height,q.width),C=T*b;if(C<10)return;const H=C*Math.cos(N),X=C*Math.sin(N),te={x:q.x+(q.width-H)/2,y:q.y+(q.height-X)/2,width:H,height:X};c.setBounds(te)},"Resize")},le=O=>{i.updateSelected(Y=>{const c=Y.getBounds(),q={x:c.x+(O.x??0),y:c.y+(O.y??0),width:c.width+(O.width??0),height:c.height+(O.height??0)};Y.setBounds(q)},"Nudge")};if(Q.which===r.KeyCodes.Delete)i.updateSelected(O=>{O.delete()},"Delete"),Q.preventDefault();else if(Q.key==="a"&&qe){const O=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(O,!0),Q.preventDefault()}else Q.key==="ArrowLeft"?(Te?S(De,!1):je?ze(-10):le({x:qe?-10:-1}),Q.preventDefault()):Q.key==="ArrowRight"?(Te?S(De,!0):je?ze(10):le({x:qe?10:1}),Q.preventDefault()):Q.key==="ArrowUp"?(Te?S(De,!0):le({y:qe?-10:-1}),Q.preventDefault()):Q.key==="ArrowDown"&&(Te?S(De,!1):le({y:qe?10:1}),Q.preventDefault())},children:[re,Ue]})})})})),$t=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const d=e[l].getBounds();t=Math.min(d.x,t),n=Math.min(d.y,n),i=Math.max(d.x+d.width,i),a=Math.max(d.y+d.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Go=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let d=0,m=Number.MAX_SAFE_INTEGER,v=0;for(let h=0;h<e.length;h++){const p=e[h],M=p.getBounds();d+=M[l],m=Math.min(M[i],m),v=Math.max(M[i]+M[l],v),n.push({bounds:M,movable:p})}const g=(v-m-d)/(e.length-1);n.sort((h,p)=>{const M=h.bounds[i],x=p.bounds[i];return M!==x?M-x:h.bounds[a]-p.bounds[a]});const k=new Map;k.set(n[0].movable,n[0].bounds);for(let h=1;h<n.length-1;h++){const p=n[h-1].bounds,M={...n[h].bounds};M[i]=p[i]+p[l]+g,n[h].bounds=M,k.set(n[h].movable,M)}return k.set(n[n.length-1].movable,n[n.length-1].bounds),k};function Tr(e){const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:d,notifier:m}=e,v=r.useEditMode();o.useRef(v.getMode()).current=v.getMode();const g=r.useCallbackRef(async(F,V,y=null,w=!0)=>{const R=async()=>{const j=await Promise.resolve(m?.showBusy?.(F.label()));try{await V();const I=y??F?.label?.();if(d){let E=null;F&&I!==!1&&(E=new r.SimpleCommand(F.key(),l,{label:I,description:I},R)),d(E)}j?.(),w&&v.setMode(null)}catch(I){j?.(),m?.showError?.(I)}};await R()},[d,m]),[k,h]=o.useReducer(F=>F+1,0),p=r.useCallbackRef((F,V,y)=>{if(!n)return;const w=n.getMovableSelection();if(w.length===0)return;let R="Drawings";if(w.length===1){const I=w[0];R=s.TextUtils.capitalize(I.getContent().getType())??"Drawing"}const j=`${F.label()} ${R}`;g(F,()=>{let I=null;i&&(I=i.beginCommit(j));const E=n.getMovableSelection();if(E.length===0)return;const W=y?.(E);for(let _=0;_<E.length;_++){const P=E[_];V(P,W)}I?.commit()})},[n,i]),[M,x]=o.useState(n.getMovableSelection()[0]??null),[A,D]=o.useState(!M||M?.isProtected()),G=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){p(this,F=>{F.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){p(this,F=>{F.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){p(this,F=>{F.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){p(this,F=>{F.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){p(this,F=>{F.setLockAspectRatio(!F.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){p(this,F=>{F.setAnchorType(s.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){p(this,F=>{F.setAnchorType(s.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){p(this,F=>{F.setAnchorType(s.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left."},function(){p(this,(F,V)=>{F.setBounds({x:V.x})},$t)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){p(this,(F,V)=>{F.setBounds({x:(V.width-F.getBounds().width)/2+V.x})},$t)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right."},function(){p(this,(F,V)=>{F.setBounds({x:V.width-F.getBounds().width+V.x})},$t)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top."},function(){p(this,(F,V)=>{F.setBounds({y:V.y})},$t)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){p(this,(F,V)=>{F.setBounds({y:(V.height-F.getBounds().height)/2+V.y})},$t)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){p(this,(F,V)=>{F.setBounds({y:V.height-F.getBounds().height+V.y})},$t)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){p(this,(F,V)=>{F.setBounds(V.get(F))},F=>Go(F))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){p(this,(F,V)=>{F.setBounds(V.get(F))},F=>Go(F,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing."}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,M]);o.useEffect(()=>{},[v]);const U=o.useMemo(()=>{let F=null;return F=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),F.addCommands(G,!0),F},[a,G]);return tt(M,{onAnyChange:()=>{U.getCommand("formatAnchorTypeTwoCell").update({state:M?.getAnchorType()===s.IAnchored.Type.TwoCell}),U.getCommand("formatAnchorTypeOneCell").update({state:M?.getAnchorType()===s.IAnchored.Type.OneCell}),U.getCommand("formatAnchorTypeAbsolute").update({state:M?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("formatAnchorTypeAbsolute").update({state:M?.getAnchorType()===s.IAnchored.Type.Absolute}),U.getCommand("toggleLockAspectRatio").update({state:M?.isLockAspectRatio()})},onProtectedChange:F=>{D(F.isProtected())},onDelete:()=>{}}),tt(n,{onMovableSelectionChange:()=>{const F=n.getMovableSelection()[0]??null;x(F),D(!F||F.isProtected()),h()}}),tt(t,{onCollectionChange:()=>{h()}}),o.useEffect(()=>{const F={disabled:A};U.getCommand("formatAnchorTypeTwoCell").update(F),U.getCommand("formatAnchorTypeOneCell").update(F),U.getCommand("formatAnchorTypeAbsolute").update(F),U.getCommand("toggleLockAspectRatio").update(F);const V=t.getCount(),y=n.getMovableSelection(),w=A||V<=1||y.length===0;let R={disabled:w},j=R;if(!w&&y.length===1){const W=y[0];W.getZIndex()===0&&(R={disabled:!0}),W.getZIndex()===V-1&&(j={disabled:!0})}U.getCommand("moveToFront").update(j),U.getCommand("moveForward").update(j),U.getCommand("moveToBack").update(R),U.getCommand("moveBackward").update(R);const I={disabled:A||y.length<=1};U.getCommand("formatDrawAlignLeft").update(I),U.getCommand("formatDrawAlignCenter").update(I),U.getCommand("formatDrawAlignRight").update(I),U.getCommand("formatDrawAlignTop").update(I),U.getCommand("formatDrawAlignMiddle").update(I),U.getCommand("formatDrawAlignBottom").update(I),U.getCommand("formatDrawFlipHorz").update(I),U.getCommand("formatDrawFlipVert").update(I),U.getCommand("formatDrawGroup").update(I),U.getCommand("formatDrawUngroup").update(I),U.getCommand("formatDrawSwapShapes").update(I),U.getCommand("formatDrawSwapShapesHorz").update(I),U.getCommand("formatDrawSwapShapesVert").update(I);const E={disabled:A||y.length<=2};U.getCommand("formatDrawDistributeHorz").update(E),U.getCommand("formatDrawDistributeVert").update(E)},[k,A,k]),U}const Ql=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:d,onHide:m,onShow:v,...g}=e;o.useEffect(()=>{},[a]);const k=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:p,width:M}]=Lt();return u.jsx("div",{...g,ref:Zt([k,h]),children:u.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:l.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:u.jsx("div",{style:{textAlign:"center"},children:a})})})})),ei=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,movableProps:a,renderMovable:l,commands:d,target:m,notifier:v,onRepeatCommandChange:g}=e,k=Tr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:g,commands:d,target:m,notifier:v});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const h=o.useMemo(()=>u.jsx(Mr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{k.activate(),a?.onFocus?.()}},"movable-area"),[i,a,d,k]);return h&&n?h:null})),ti=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:d,setEditingCoords:m,commands:v,notifier:g=r.DefaultNotifier}=e,k=r.useEditMode(),[h,p]=o.useState(null),[M,x]=o.useState(null),[A,D]=o.useState(null),[G,U]=o.useState(null),[F,V]=o.useState(null);o.useLayoutEffect(()=>{if(A===null)return U(null),void V(null);const z=()=>{const ae=i.getRange(A).getCell(),ve=ae.getStyle();let Pe,Se=ve.getFill()?.toCSS(a.body.darkMode);Se.background!=="none"&&Se.background!=="transparent"||(Se=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),Se.background!=="none"&&Se.background!=="transparent"||(Se={background:a.body.fill}),U({style:Se}),ae&&!ae.getFormula()&&(Pe=ae?.getRenderHorizontalAlignment()),V(Pe??r.HorizontalAlignment.Left)};return z(),i.getRange(A).addListener(()=>{z()})},[i,A,a?.body]);const y=r.useCallbackRef(()=>{let z=M.editState.dirty??"";if(M.editState.dirty!==void 0){const ae=s.TextUtils.clampString(z);try{const ve=M.sheet.getRange(M.coords),Pe=`Typing '${ae}' into ${ve.toString()}`;return ve.setValue(z,{description:Pe,autoFit:!0}),D(null),x(null),k.setMode(null),m(null),!0}catch(ve){throw g.showError(new Error(`Unable to enter '${ae}'.`,{cause:ve})),ve}}},[i,M,g]),w=r.useCallbackRef(z=>i.getRange(z).getCell().getExtrusions()??ge.CoordUtils.cellToRange(z),[i]),R=r.useCallbackRef(z=>{let ae=s.IRange.Orientation.Row,ve=!1;z!==s.IRange.Direction.Up&&z!==s.IRange.Direction.Down||(ae=s.IRange.Orientation.Column),z!==s.IRange.Direction.Left&&z!==s.IRange.Direction.Up||(ve=!0),i.getSelection().traverse(ae,ve)},[i]),j=o.useCallback((z,ae)=>{if(l)return l(z,ae);if(!i)return null;const{ref:ve,...Pe}=z;return u.jsx(br,{ref:ve,...Pe,sheet:i,bodyStyle:a?.body,activeCoords:ae,commands:v,onChangeEdit:Se=>{const ue={sheet:i,coords:ae,editState:Se};k.setMode(Re=>({...Re,description:ue.editState.editMode?"Edit":"Enter",args:{...Re?.args,stateAndCoords:ue}}))},editState:M.editState})},[i,G,l,M,A]),{overlay:I,startEdit:E,submitEdit:W,cancelEdit:_,onKeyboardEventNative:P,onPointerEventNative:B}=dt.useKeyboardEditorOverlay({view:n,activeCoords:h,getCellEditor:j,canEdit:()=>{const z=i.getProtection();if(z.isReadOnly())return!1;const ae=z.isLocked();return ae&&d(),!ae},onBeforeStartEdit:z=>{const ae=yr(()=>i.getRange(z).getCell()),ve={sheet:i,coords:z,editState:Object.freeze(ae)};k.setMode({key:"edit",args:{stateAndCoords:ve}}),x(ve)},onStartEdit:z=>{D(z),m(z)},onSubmitEdit:y,onCancelEdit:z=>{D(null),x(null),k.setMode(null),m(null)},onDoneEdit:z=>{k.setMode(null)},onNavigate:R,containerProps:G,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:F,getRangeCoords:w});tt(i.getSelection(),{onChange(z){p(i.getSelection().getCoords().cell)}});const K=r.useCallbackRef(z=>{B(z),A&&W()},[B,_,A]),ne=o.useCallback(z=>{B(z)},[B]),L=o.useCallback(z=>{P(z)},[P]);return o.useEffect(()=>{const z=n?.getStage();if(z)return z.addEventListener("pointerdown",K),z.addEventListener("dblclick",ne),z.addEventListener("keydown",L),()=>{z.removeEventListener("pointerdown",K),z.removeEventListener("dblclick",ne),z.removeEventListener("keydown",L)}},[n?.getStage()]),o.useEffect(()=>{const z=k.getMode(),ae=z?.key;ae==="edit"||ae==="enter"?M?z.args?.cancel?_():z.args?.submit?W():x(z.args?.stateAndCoords):E(z.args?.start):A&&_()},[k]),I(n,t)})),Ir="white",Er="black",ni=`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='${Er}' fill='${Ir}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,oi=`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='${Er}' fill='${Ir}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ri=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[d,m]=o.useState(null),[v,g]=o.useState(null),[k,h]=o.useState(null),[p,M]=o.useState(null),x=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const y=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(y.length>0?y:null)}else l(!1),m(null)},[i,n]),A=r.useCallbackRef(y=>{y.preventDefault(),y.stopPropagation();const w=n.getCellCoordsFromClient(y.clientX,y.clientY),R=i.getTables().getItems({address:w});R.length===1&&R[0].select()},[n,i]),D=r.useCallbackRef(y=>{y.preventDefault(),y.stopPropagation();const w=n.getCellCoordsFromClient(y.clientX,y.clientY),R=i.getTables().getItems({address:w});if(R.length===1){const j=R[0].getRange().getCoords(),I={colStart:j.colStart,rowStart:w.rowIndex,colEnd:j.colEnd,rowEnd:w.rowIndex};i.getRange(I).select()}},[n,i]),G=r.useCallbackRef(()=>{if(!a)return;const y=i.getTables().getItems({address:n.getVisibleRangeCoords()});m(y.length>0?y:null)},[i,a,n]);tt(i?.getSelection(),{onChange(y){g(i.getSelection().getCoords().cell)}}),tt(k,{onAnyChange(y){x(),G()}}),tt(p,{onAnyChange(y){G()}}),tt(i,{onTablesChange(y){x(),G()},onInvalidated(y){x(),G()}});const U=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(G,300),300),[]);o.useEffect(()=>{U()},[n]),o.useEffect(()=>{let y=null;if(d)for(let w=0;w<d.length&&!y;w++){const R=d[w],j=R.getRange().getCoords();s.CoordUtils.isCellWithinRange(v,j)&&(y=R)}h(y)},[v,d]);const F=r.useCallbackRef(y=>{let w=null;if(d)for(let R=0;R<d.length;R++){const j=d[R],I=j.getRange().getCoords();let E=n.getRangeCoordsBounds(I);const W=n.getRelativePointFromClient(y.clientX,y.clientY),_=W.x,P=W.y;if(_>=E.x&&_<=E.x+E.width&&P>=E.y&&P<=E.y+E.height){const B=n.getViewportSize();_<=0||P<=0||_>=B.width||P>=B.height||(w=j)}}M(w)},[n,d]);if(o.useEffect(()=>{const y=n?.getStage();if(y&&d)return y.addEventListener("mousemove",F),y.addEventListener("mouseleave",F),()=>{y.removeEventListener("mousemove",F),y.removeEventListener("mouseleave",F)}},[d,n?.getStage()]),!n||!d||d.length===0)return null;const V=[];for(let y=0;y<d.length;y++){const w=d[y];if(w.isClosed())continue;const R=w===p,j=w===k,I=w.getRange().getCoords(),E=n.getRangeCoordsBounds(I);let W;if(R||j){const _=w.getStyle().getProperties(),P=_.headerRow?.fill?.background??_.wholeTable?.border?.top?.color?.toString();if(P&&i){const B=i.getStyles().parseColor(P);B&&(W=B.toCSS())}W||(W="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}V.push(u.jsx("div",{style:{position:"absolute",left:E.x,top:E.y,width:Math.min(16,E.width),height:E.height,pointerEvents:"all",cursor:ni},onMouseDown:D},`table-select-row-${w.getName()}`)),V.push(u.jsx("div",{style:{position:"absolute",left:E.x,top:E.y,width:Math.min(16,E.width),height:Math.min(16,E.height),pointerEvents:"all",cursor:oi},onMouseDown:A},`table-select-${w.getName()}`)),V.push(u.jsx(dt.Selection,{x:E.x,y:E.y,width:E.width,height:E.height,range:I,strokeWidth:j?.5:0,stroke:W??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:R?`${W} 0px 0px 1px 1px`:void 0}},`table-outline-${w.getName()}`))}return V})),li=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,d]=o.useState(null),[m,v]=o.useState(null),g=o.useRef(null),k=r.useCallbackRef(()=>{const D=i.getSelectedCell(),G=D.getSpill()?.getCoords()??null;ge.CoordUtils.isEqualRanges(G,l)||(v(G?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(G),coords:G}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),d(G))},[i,n,l]);o.useEffect(()=>(g.current&&(clearTimeout(g.current),g.current=null),m&&(g.current=setTimeout(()=>{v(null),g.current=null},a)),()=>{g.current&&(clearTimeout(g.current),g.current=null)}),[m,a]);const h=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(k,80),80),[]);if(tt(i?.getSelection(),{onChange(D){h()}}),tt(i,{onSpillsChange(D){k()},onInvalidated(D){k()}}),!n||!l&&!m)return null;const p=i.getRange(l).getValue()instanceof s.FormulaError.Spill,M=[];let x=m?.bounds??n.getRangeCoordsBounds(l);if(m&&!ge.CommonUtils.isEqualBounds(m.bounds,n.getRangeCoordsBounds(m.coords))&&v(null),x=n.toClipBounds(x,-10),!x)return;const A="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return M.push(u.jsx(dt.Selection,{x:x.x,y:x.y,width:x.width,height:x.height,range:l,strokeWidth:1,stroke:A,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:p?"6 3":void 0,opacity:m?.transition==="out"?0:1,transition:m?.transition?m.transition==="in"||m.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${A} 0px 0px 4px 0px`}},"spill-outline}")),M})),ii={position:"absolute",top:0,left:0,bottom:0,right:0},_o=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},d=n.body=ge.CommonUtils.mergeContentful(e.body,l);return n.body=ge.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},d),n.buttonSurface=ge.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=ge.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ge.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ge.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ge.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelectAll,l),n},ai={fireOnModelChange:!1},Zo={},Fr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Zo,headersStyle:a=Zo,onSheetContextMenu:l,showColumnHeaders:d,columnHeaderProps:m,showRowHeaders:v,rowHeaderProps:g,showScrollbars:k=!0,scrollPaneProps:h,onViewportChange:p,commands:M,onRepeatCommandChange:x,onMoveCell:A,overlays:D,renderMovable:G,viewportComponent:U,onElementLoad:F,getCellEditor:V,onFocus:y,onBlur:w,style:R=r.ReactUtils.EmptyCssProperties,notifier:j,onShowTooltip:I,onShowColumnTooltip:E,onShowRowTooltip:W,onCloseTooltip:_,gridProps:P,cellRenderProps:B,...K}=e;if(o.useEffect(()=>{s.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[ne,L]=o.useReducer(ee=>ee+1,0),[z,{width:ae,height:ve}]=Lt(),Pe=r.useCallbackRef(I,[I]),Se=r.useCallbackRef(E,[E]),ue=r.useCallbackRef(W,[W]),Re=r.useCallbackRef(_,[_]),Ke=o.useRef(!1);o.useLayoutEffect(()=>{Ke.current=!0},[n]);const $e=n?.getStyles(),Ie=o.useMemo(()=>_o(i,$e),[i,$e]),me=o.useMemo(()=>_o(a,$e),[a,$e]),{body:$={},buttonSurface:Ae={}}=Ie,{header:Ce={},headerSelect:J={},headerSelectAll:Z={}}=me,re=o.useRef(null),[oe,he]=o.useState(()=>n?.getView()),Me=(oe?.getZoomScale()??100)/100,de=o.useMemo(()=>({vertical:oe.isShowColumnGridlines()&&Me>=.4,horizontal:oe.isShowRowGridlines()&&Me>=.4}),[oe?.isShowColumnGridlines(),oe?.isShowRowGridlines(),Me]),be=o.useMemo(()=>{if(oe?.getGridLineColor())return{strokeDasharray:"1,1"}},[oe?.getGridLineColor(),Ie]),xe=d??oe?.isShowColumnHeaders(),Fe=v??oe?.isShowRowHeaders(),[f,Le]=o.useState({width:0,height:0}),Xe=o.useMemo(()=>{let ee=40,ke=20;const Ee=n?.getStyles().getNormal().getFont();if(f.width>0&&f.height>0){const He=Ee?.toCSS()?.fontFamily??Ie.header.text.fontFamily,Ze=Ee?.getSize()??Ie.header.text.fontSize,et=s.IFont.getSharedMeasurer()(""+f.height,Math.ceil(Ze*s.IFont.getDeviceScale()),He);ee=et.width,ke=et.lineHeight}return{width:Math.round(ee+5),height:Math.round(ke+3)}},[f,Ie?.header.text,n]),Ue=Fe?Me*Xe.width:Ce.edgeStrokeWidth,Q=xe?Me*Xe.height:Ce.edgeStrokeWidth,qe=Math.max(ae,(n?.getColumnHeaders().getDefaultSize()??Xe.width)+Ue+1),je=Math.max(ve,(n?.getRowHeaders().getDefaultSize()??Xe.height)+Q+1),Te=o.useRef(new Map),De=o.useRef(null),ze=()=>({getColOffset:ee=>n.getColumnHeaders().findOffset(ee),getColIndex:ee=>n.getColumnHeaders().findIndex(ee),getRowOffset:ee=>n.getRowHeaders().findOffset(ee),getRowIndex:ee=>n.getRowHeaders().findIndex(ee)}),[S,le]=o.useState(()=>ze()),[O,Y]=o.useState(!1),[c,q]=o.useState(null),T=!0,b=Ie.selection?.strokeFill,N=o.useCallback(()=>Mt.current,[]),[C,H]=o.useState(),X=r.useCallbackRef(ee=>{H(ee),n&&n.getView()&&n.getView().setTopLeft(ee?{left:ee.left,top:ee.top}:null),p?.(ee)},[n,p]),te=o.useRef(null);o.useEffect(()=>{if(!C||!n)return;const ee=n.getRangeAtBounds({x:C.left,y:C.top,width:C.width,height:C.height});te.current?.(),te.current=ee.addListener(()=>{const ke=ee.getCoords();re?.current?.invalidate(ke)})},[C,n]);const[ie,se]=o.useState(()=>n?.getView().getTopLeft()),ce=r.useCallbackRef(ee=>{const ke=ge.CoordUtils.cellToRange(ee);if(n.isClosed())return ke;const Ee=n.getRange(ke,{excludeHidden:!0}).getMerges();return Ee.length===0?ke:Ee[0]},[n]),ye=ee=>{if(!ee||ee.coords.colIndex===0&&ee.coords.rowIndex===0)return null;const ke={};return ee.coords.colIndex>0&&(ke[ge.AnchorLocation.Left]={index:ee.coords.colIndex,scrollOffset:ee.topLeft.left}),ee.coords.rowIndex>0&&(ke[ge.AnchorLocation.Top]={index:ee.coords.rowIndex,scrollOffset:ee.topLeft.top}),ke},[fe,pe]=o.useState(()=>ye(n.getView().getFreezePanes())),we=r.useEditMode(),Be=o.useCallback(()=>re.current,[]),Ne=r.useCallbackRef(ee=>{we.setMode(ke=>ke?.key==="edit"?{...ke,args:{...ke.args}}:{key:"edit",args:{stateAndCoords:null,start:ee}})},[]),We=r.useCallbackRef(()=>C,[C]),Ve=Rr({sheet:n,commands:M,target:Be,onRepeatCommandChange:x,bodyStyle:$,notifier:j,onStartEdit:Ne,getViewport:We}),[Ge,Oe]=o.useState(n.getSelection().isEntire()),[Ye,it]=o.useState(oe?.getMovableSelection().length>0),pt=c!==null||Ye,xt=null,[_e,rt]=o.useState(!1);o.useEffect(()=>{rt(!1)},[n.getProtection()]);const vt=r.useCallbackRef(()=>{_e||(rt(!0),j.showMessage?.(u.jsxs("span",{children:["This sheet is protected.",u.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotificationType.Error}))},[j,_e]),wt=o.useMemo(()=>{const ee=we.getMode();return ee?.cursor?ee.cursor:null},[xt,we]),[Ct,gt]=o.useState(null),lt=o.useRef(!1),[It,jt]=o.useState([]),Jt=o.useRef(null),[Dt,Qt]=o.useState(ge.TypesUtils.EmptyTopLeft),[Tt,xn]=o.useState(ge.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Qt({left:ie?.left,top:0})},[ie?.left]),o.useEffect(()=>{xn({left:0,top:ie?.top})},[ie?.top]),tt(n?.getView(),{onFreezeSplitChange:()=>{pe(ye(n.getView().getFreezePanes()))},onTopLeftChange:()=>{se(n.getView().getTopLeft())},onMovableSelectionChange:()=>{it(n.getView().getMovableSelection().length>0)}}),tt(n?.getSelection(),{onChange:()=>{Oe(n.getSelection().isEntire())}}),tt(n,{onViewChange(){he(n.getView()),le(ze())},onLayoutChange:()=>{const ee=n.getEntireRange();Le({height:ee.getRowCount(),width:ee.getColumnCount()}),le(ze())},onStyleChange:()=>{zt()},onMovablesChange:()=>{},onInvalidated:()=>{zt()}}),tt(n,{onRequestScrollIntoView:async(ee,ke)=>{if(!ke)return;const Ee={colIndex:ke?.coords.colStart,rowIndex:ke?.coords.rowStart};return await re.current?.scrollCellCoordsIntoView(Ee,ke?.scroll),!0},onRequestFocus:()=>ge.CommonUtils.whenFocus(Mt.current)},ai);const bt=o.useRef(!1),Bt=o.useMemo(()=>{const ee=(Ee,He)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:0,rowEnd:f.height,colStart:Ee,colEnd:Ee})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getColOffset(Ee)),Qe=Ze.getBounds(),st=Math.min(Qe.x+Qe.width,et.getColOffset(Ee+1)),ht=Ze.getAnchor();if(He!==null&&(ht===ge.AnchorLocation.Left||ht===ge.AnchorLocation.Center||ht===ge.AnchorLocation.Right)){const eo=ge.CommonUtils.roundAccurately(He*ge.CommonUtils.getDPI(),0),kn=ge.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(He/Me),2).toFixed(2),to="Width: "+(He?kn+" ("+eo+" pixels)":"Hidden"),ln=Ut.current.getGridElement().getRelativePointFromClient(0,0),Kt=0-ln.y,Mn=0-ln.y+Q,no={x:ot-(ln.x-Qe.x),y:Kt,width:st-ot,height:Mn-Kt};requestAnimationFrame(()=>{lt.current&&Se?.({anchor:no,display:to})})}const Et=[0,0,0,Qe.height],rn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Yn={x:ot-1,y:0,width:1,height:Qe.height},Jn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Qn={x:st-1,y:0,width:1,height:Qe.height};return u.jsxs(o.Fragment,{children:[u.jsx(dt.SVGLine,{linePoints:Et,bounds:Yn,...rn}),u.jsx(dt.SVGLine,{linePoints:Et,bounds:Qn,...Jn})]},"resize-dividers")}])};let ke=null;return{onResizeHeadersStart:(Ee,He,Ze)=>{ke=n.beginCommit(Ze),bt.current=!1,ee(Ee,He)},onResizeHeaders:(Ee,He,Ze)=>{bt.current=!1,ee(Ee,He)},onResizeHeadersDown:(Ee,He)=>{bt.current=!0,setTimeout(()=>{bt.current&&ee(Ee,He)},360)},onResizeHeadersEnd:(Ee,He,Ze)=>{ke?.commit({description:Ze}),ke=null,bt.current=!1,requestAnimationFrame(()=>Re?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Ee=>{bt.current=!1,requestAnimationFrame(()=>Re?.()),lt.current=!1,gt(null)},...m}},[n,m,Q,Ct]),en=o.useMemo(()=>{const ee=(Ee,He)=>{lt.current=!0,gt([Ze=>{if(!Ze.toClipBounds(Ze.getRangeCoordsBounds({rowStart:Ee,rowEnd:Ee,colStart:0,colEnd:f.width})))return;const et=Ze.getLayout(),ot=Math.max(0,et.getRowOffset(Ee)),Qe=Ze.getBounds(),st=Math.min(Qe.y+Qe.height,et.getRowOffset(Ee+1)),ht=Ze.getAnchor();if(He!==null&&(ht===ge.AnchorLocation.Top||ht===ge.AnchorLocation.Center||ht===ge.AnchorLocation.Bottom)){const eo=Math.floor(10*ge.CommonUtils.getDPI())/10,kn=ge.CommonUtils.roundAccurately(He*eo,0),to=ge.CommonUtils.roundAccurately(kn/Me/(n?.getRowHeaders().getScaleFactor()*ge.CommonUtils.getDPI()),2).toFixed(2),ln="Height: "+(He?to+" ("+kn+" pixels)":"Hidden"),Kt=Ht.current.getGridElement().getRelativePointFromClient(0,0),Mn=0-Kt.x,no=0-Kt.x+Ue,vl={x:Mn,y:ot-(Kt.y-Qe.y),width:no-Mn,height:st-ot};requestAnimationFrame(()=>{lt.current&&ue?.({anchor:vl,display:ln})})}const Et=[0,0,Qe.width,0],rn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Yn={x:0,y:ot-1,width:Qe.width,height:1},Jn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:b}},Qn={x:0,y:st-1,width:Qe.width,height:1};return u.jsxs(o.Fragment,{children:[u.jsx(dt.SVGLine,{linePoints:Et,bounds:Yn,...rn}),u.jsx(dt.SVGLine,{linePoints:Et,bounds:Qn,...Jn})]},"resize-dividers")}])};let ke=null;return{onResizeHeadersStart:(Ee,He,Ze)=>{ke=n.beginCommit(Ze),bt.current=!1,ee(Ee,He)},onResizeHeaders:(Ee,He,Ze)=>{bt.current=!1,ee(Ee,He)},onResizeHeadersDown:(Ee,He)=>{bt.current=!0,setTimeout(()=>{bt.current&&ee(Ee,He)},360)},onResizeHeadersEnd:(Ee,He,Ze)=>{ke?.commit({description:Ze}),ke=null,bt.current=!1,requestAnimationFrame(()=>Re?.()),lt.current=!1,gt(null)},onResizeHeadersUp:Ee=>{bt.current=!1,requestAnimationFrame(()=>Re?.()),lt.current=!1,gt(null)},...g}},[n,g,Ue]),Mt=r.useImperativeElement(t,()=>{const ee=Ee=>{n?.getView()&&n.getView().selectMovables([]),De.current=null,re?.current?.focus(Ee)},ke=async(Ee=null)=>{if(Ee||(Ee=n?.getView().getMovableSelection()[0]),!Ee)return!1;const He=Ee.getAnchorCoords();if(!He)return!1;const Ze=re.current?.getViewFromCellCoords({colIndex:He.colStart,rowIndex:He.rowStart});if(!Ze)return!1;const et=Ze.getAnchor();n?.getView().getMovableSelection().indexOf(Ee)===-1&&n?.getView().selectMovables([Ee]);let ot=Te.current?.get(et);return ot?.current?(await ot.current.focusMovable(Ee),!0):(De.current={movable:Ee,anchor:et},!0)};return{getGridElement:()=>re.current,getRowHeaderElement:()=>Ht.current,getColumnHeaderElement:()=>Ut.current,rowHeaderHeight:()=>Q,colHeaderWidth:()=>Ue,startEdit:Ne,submitEdit:()=>{we.setMode(Ee=>Ee?.key!=="edit"?Ee:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{we.setMode(Ee=>Ee?.key!=="edit"?Ee:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:c!==null,focus:Ee=>{n?.getView().getMovableSelection().length>0&&ke()||ee(Ee)},focusSheet:ee,focusMovable:ke,contains:Ee=>re?.current?.contains?.(Ee),invalidate:zt,isSheetElement:()=>!0,getSheet:()=>n}},[n]),zt=o.useCallback(ee=>{Ke.current||(re?.current?.invalidate(ee),L?.())},[]);o.useEffect(()=>{zt()},[Ie]);const qn=Ge?Z.edgeStrokeFill:Ce.fill,nt=Ge?J.fill:typeof Ie.headerHover=="function"?Ie.headerHover(Ce)?.fill:Ce.fill,Sn=o.useMemo(()=>U?u.jsx("div",{className:yt("sheetxl-viewport-overlay",Fl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:U}):u.jsx(u.Fragment,{}),[U]);let Vt=null;xe&&Fe&&(Vt=u.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${Q}px`,width:`${Ue}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:ee=>{let ke=!ee.ctrlKey;Ve?.getCommand("selectAll")?.execute(!ke||ee.button!==0),ee.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:ee,clientX:ee.clientX,clientY:ee.clientY,rowIndex:-1,colIndex:-1}):re.current?.focus()},children:[u.jsx("div",{style:{height:Q-5+"px",width:Q-5+"px",clipPath:`path('M${Q-5} 0 L0 ${Q-5} L${Q-5} ${Q-5} L${Q-5} 0 Z')`,borderRight:`2px solid ${qn}`,borderBottom:`2px solid ${qn}`,background:`${nt}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),u.jsx("div",{style:{position:"absolute",height:`${Q}px`,width:`${Ue}px`,boxSizing:"border-box",borderRight:`solid 1px ${Ce.strokeFill}`,borderBottom:`solid 1px ${Ce.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const tn=r.useCallbackRef(({_left:ee,_top:ke})=>{},[]),at=r.useCallbackRef(ee=>{if(!l)return;const ke=re.current.getViewFromClient(ee.clientX,ee.clientY)?.getCellCoordsFromClient(ee.clientX,ee.clientY);ke&&(l({originalEvent:ee,clientX:ee.clientX,clientY:ee.clientY,rowIndex:ke.rowIndex,colIndex:ke.colIndex}),ee.stopPropagation(),ee.preventDefault())},[l]),mt=r.useCallbackRef(ee=>{if(!(!ee.shiftKey&&(ee.ctrlKey||ee.metaKey)))return;const{deltaY:ke}=ee;return ke>0?Ve.getCommand("sheetZoomOut")?.execute():ke<0&&Ve.getCommand("sheetZoomIn")?.execute(),ke===0},[Ve]);o.useEffect(()=>{jt(null),Jt.current=null,lt.current=!1,gt(null);const ee=n?.getView().getTopLeft();tn(ee),re.current?.scrollTo(ee),se(ee),he(n.getView()),pe(ye(n.getView().getFreezePanes())),le(ze()),L()},[n?.getView()]);const nn=r.useCallbackRef(ee=>{const ke=ee.getVisibleRangeCoords();if(!ke)return null;const Ee=[];return n.getRange(ke).forEach((He,Ze)=>{const et=Ze.getCoords(),ot=Ze.getCell();(Qe=>{if(Qe.isEmpty())return!1;const st=Qe.getSpans();if(st.width>1||st.height>1||Qe.getStyle().hasVisibleStyling()||oe.isShowFormulas()&&Qe.getFormula()!==null)return!0;const ht=Qe.getValue();return ht!==null&&!(!oe.isShowZeros()&&ht===0&&Qe.getType()===s.ScalarType.Number)})(ot)&&Ee.push({coords:et,value:ot,range:oe.isShowFormulas()?null:ot.getExtrusions()})},{excludeHidden:!0,includeMergeOverflow:!0}),Ee},[n,oe.isShowZeros(),oe.isShowFormulas(),c]);o.useEffect(()=>{const ee=[];D&&ee.push(...D),Ct&&ee.push(...Ct),ge.CommonUtils.isEqualArrays(ee,Jt.current)||(Jt.current=ee,jt(ee))},[D,Ct,Ie]);const on=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},pathProps:{stroke:i?.body?.text?.fill??"black"}}),[Ie?.header?.edgeStrokeFill]),Pt=r.useCallbackRef(ee=>{ee.isDefaultPrevented()||ee.isPropagationStopped()||(De.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const ee=we.getMode();return ee?.key==="cut"||ee?.key==="copy"},[we]),Gn=r.useCallbackRef(async ee=>{const ke=we.getMode();return ee.keyCode===r.KeyCodes.Escape&&ke?(ee.preventDefault(),void we.setMode(null)):ee.keyCode===r.KeyCodes.Enter&&Wn?(ee.preventDefault(),await Ve?.getCommand("paste")?.execute(),void we.setMode(null)):void Ve?.dispatchToFocusedCommand(ee)},[Ve,we]),Ht=o.useRef(null),Rn=o.useMemo(()=>u.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${Q+1}px`,width:`${Ue+Ce.edgeStrokeWidth}px`,minWidth:`${Ue+Ce.edgeStrokeWidth}px`,borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,height:`calc(100% - ${Q}px)`,boxSizing:"border-box",zIndex:"2"},children:u.jsx($o,{ref:Ht,sheetElement:Mt.current,gridRef:re,freezeStart:fe?.[ge.AnchorLocation.Top],oppositeSize:Ue,containerWidth:Ue,containerHeight:je,sheetHeader:n.getRowHeaders(),gridStyle:me,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:Tt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${Q+1}px`,width:`${Ue+Ce.edgeStrokeWidth}px`,minWidth:`${Ue+Ce.edgeStrokeWidth}px`,borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,height:`calc(100% - ${Q}px)`,boxSizing:"border-box",zIndex:"2",...en?.style},...en})}),[Ue,Q,je,n,Tt,fe?.[ge.AnchorLocation.Top],Ie,T,l,Ce.fill,g]),Ut=o.useRef(null),cl=o.useMemo(()=>u.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${Q+Ce.edgeStrokeWidth}px`,minHeight:`${Q+Ce.edgeStrokeWidth}px`,borderBottom:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:u.jsx($o,{ref:Ut,sheetElement:Mt.current,gridRef:re,freezeStart:fe?.[ge.AnchorLocation.Left],oppositeSize:Q,containerWidth:qe,containerHeight:Q,sheetHeader:n.getColumnHeaders(),gridStyle:me,scrollPoint:Dt,onSheetContextMenu:l,...Bt,style:{...Bt?.style,position:"relative",left:"0px",width:"100%",height:`${Q+Ce.edgeStrokeWidth}px`,minHeight:`${Q+Ce.edgeStrokeWidth}px`,borderBottom:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[Q,qe,n,Dt,fe?.[ge.AnchorLocation.Left],Ie,Ce.fill,T,l,m]),ul=r.useCallbackRef(ee=>{const{value:ke,key:Ee,...He}=ee;let Ze=ke,et=c;if(!et||et.colIndex===ee.coords.colIndex&&et.rowIndex===ee.coords.rowIndex||(et=null),!Ze){const st=ee.range;if(Ze=n.getRange({rowIndex:st.rowStart,colIndex:st.colStart}).getCell(),Ze.isEmpty())return null}let ot=null;Ze.getHyperlink()&&(ot=async st=>{if(B?.onLinkMouseDown?.(st),st.button===0&&!st.isDefaultPrevented()){st.stopPropagation(),st.preventDefault();try{await Ze.getHyperlink()?.open()}catch(ht){j?.showError?.(ht)}}}),et&&et.colIndex===ee.range.colStart&&et.rowIndex===ee.range.rowStart&&(Ze=Ze.createTemporaryCell({value:null}));const Qe=n.getStyles();return o.createElement(Cr,{...He,key:Ee,bodyStyle:$,docTheme:Qe.getTheme(),normalStyle:Qe.getNormal(),showFormulas:oe.isShowFormulas(),showZeros:oe.isShowZeros(),onLinkMouseDown:ot,...B,value:Ze})},[n,S,$,c,oe?.isShowFormulas(),oe.isShowZeros()]),gl=o.useCallback((ee,ke)=>{const{key:Ee,...He}=ee;return[u.jsx(zl,{ref:ke,getVisibleCells:nn,sheet:n,gridStyle:Ie,...He},`border-${Ee}`),u.jsx(ri,{ref:ke,sheet:n,commands:Ve,...He},`table-${Ee}`),u.jsx(li,{ref:ke,sheet:n,...He},`spill-${Ee}`),u.jsx(Zl,{ref:ke,sheet:n,commands:Ve,notifier:j,onShowTooltip:Pe,onCloseTooltip:Re,gridStyle:Ie,gridRef:re,editingCoords:c,isActive:T,...He},`selection-${Ee}`),u.jsx(Hl,{ref:ke,sheet:n,commands:Ve,gridStyle:Ie,element:N,notifier:j,...He},`copy-paste-${Ee}`),u.jsx(ei,{ref:ke,sheet:n,commands:Ve,target:Be,notifier:j,renderMovable:G,movableProps:{onUnFocus:()=>{Mt.current.focus()}},...He},`movable-${Ee}`),u.jsx(ti,{ref:ke,sheet:n,commands:Ve,notifier:j,gridStyle:Ie,getCellEditor:V,showProtectedError:vt,setEditingCoords:q,...He},`editor-${Ee}`)]},[n,re.current,Ie,V,Ve,j]),[Io,hl]=o.useState(!1),ml=o.useMemo(()=>{if(qe===0||je===0)return null;const ee=n.getStyles().getNormal(),ke=ee.getFont(),Ee=ee.getFill(),He=ee.getBorder(),Ze=ee.getFill().getType()===s.IFill.Type.None;let et=be,ot=be;const Qe=(ht,Et,rn)=>rn?{stroke:He.getBottom().isNone()?"none":ht.getColor().toRGBA($.darkMode).toString(),...Et}:Et;ot=Qe(He.getBottom(),ot,!He.getBottom().isNone()),ot=Qe(He.getTop(),ot,!He.getTop().isNone()),et=Qe(He.getRight(),et,!He.getRight().isNone()),et=Qe(He.getLeft(),et,!He.getLeft().isNone());let st=oe?.getGridLineColor()?.toRGBA($.darkMode).toString()??$.strokeFill;return Ze||(ot=Qe(He.getBottom(),ot,!0),ot=Qe(He.getTop(),ot,!0),et=Qe(He.getRight(),et,!0),et=Qe(He.getLeft(),et,!0)),u.jsx(dt.Grid,{className:"sheetxl-sheet-primary",style:{...ii,...Ee.toCSS($.darkMode),...ke.toCSS($.darkMode,Me),"--sxl-app-color-background":$.fill,"--sxl-app-color-shadow":Ie.colorShadow,"--sxl-app-color-grey":Ie.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":Ie.selection.strokeFill},ref:re,zoom:Me,...P,onFirstRender:ht=>{hl(!0),P?.onFirstRender?.(ht),Ve?.activate()},showGridLines:de,gridLineColor:st,gridLineColumnsProps:et,gridLineRowsProps:ot,freezeLeft:fe?.[ge.AnchorLocation.Left],freezeLeftProps:on,freezeTop:fe?.[ge.AnchorLocation.Top],freezeTopProps:on,width:qe,height:je,columnCount:f.width,rowCount:f.height,cursor:wt??xt??"cell",clipCells:!0,layout:S,cellRenderer:ul,overlayRenderer:gl,getCellCoordsAsRangeCoords:ce,getVisibleCells:nn,onWheelScroll:mt,onPointerDown:Pt,onKeyDown:Gn,onViewportChange:X,onImmediateScroll:tn,scrollPoint:ie,stageProps:{onFocus:()=>{Ve?.activate()}},overlays:It})},[ne]);o.useEffect(()=>{Ke.current||L()},[S,fe,Me,Ve,ie?.left,ie?.top,$,P,qe,je,wt,It,T,xt]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};k||(_n={..._n,...R});const fl=o.useMemo(()=>{const ee=n.getStyles().getTheme(),ke=ee.getColorScheme(),Ee=ee.getFontScheme();return{"--sxl-doc-color-dk1":ke.getDk1().toCSS($.darkMode),"--sxl-doc-color-dk2":ke.getDk2().toCSS($.darkMode),"--sxl-doc-color-lt1":ke.getLt1().toCSS($.darkMode),"--sxl-doc-color-lt2":ke.getLt2().toCSS($.darkMode),"--sxl-doc-color-accent1":ke.getAccent1().toCSS($.darkMode),"--sxl-doc-color-accent2":ke.getAccent2().toCSS($.darkMode),"--sxl-doc-color-accent3":ke.getAccent3().toCSS($.darkMode),"--sxl-doc-color-accent4":ke.getAccent4().toCSS($.darkMode),"--sxl-doc-color-accent5":ke.getAccent5().toCSS($.darkMode),"--sxl-doc-color-accent6":ke.getAccent6().toCSS($.darkMode),"--sxl-doc-color-hlink":ke.getHlink().toCSS($.darkMode),"--sxl-doc-color-fol-hlink":ke.getFolHlink().toCSS($.darkMode),"--sxl-doc-font-major":Ee.getMajorFont(),"--sxl-doc-font-minor":Ee.getMinorFont()}},[n.getStyles().getTheme()]);let Zn=u.jsx("div",{style:_n,onTouchStart:()=>{Eo()},onFocus:ee=>{Y(!0),y?.(ee)},onBlur:ee=>{Y(!1),w?.(ee)},ref:Mt,...K,children:u.jsx("div",{className:yt("sheetxl-sheet",El),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...fl},children:u.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Vt,Rn,u.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[cl,u.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${Ce.edgeStrokeWidth}px ${Ce.edgeStrokeFill}`,backgroundColor:$.fill},ref:z,onContextMenu:at,children:[ml,Sn,u.jsx(Al,{style:{position:"absolute",right:24,bottom:4},colorLicensee:Ie?.selection?.strokeFill,colorCredits:Ie?.body?.text?.fill})]})]})]})})});if(k){const ee=ke=>u.jsx(yo,{...ke,sheet:n});Zn=u.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${Ce.fill}`,minHeight:2*Xe.height,minWidth:2*Xe.width,...R},viewport:C,touchElement:re.current?.stage,disableTouch:pt,onScrollViewport:ke=>{re.current?.scrollTo(ke)},createHorizontalScrollbar:ee,createVerticalScrollbar:ee,...h,children:Zn})}o.useEffect(()=>{Ke.current=!1,L?.(),O&&Mt.current?.focus()},[n]);const[Xn,pl]=o.useState(!1),Eo=r.useCallbackRef(()=>{Xn||pl(!0)},[Xn]);return o.useEffect(()=>{if(Io)return typeof F=="function"&&F(),r.ReactUtils.detectIt().primaryInput==="touch"&&Eo(),()=>{}},[F,Io,Xn]),Zn}));Fr.displayName="SheetElement";const si=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Xo="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=",Ar=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:d,isDragging:m,view:v,onHide:g,onShow:k,onKeyDownCapture:h,onFocus:p,onBlur:M,loadingPanel:x,...A}=e,[D,G]=o.useState(!1),[U,F]=o.useState(null),[V,y]=o.useState(null),[w,R]=o.useState(null);o.useEffect(()=>{y(null),l.getDetails().then(E=>{G(!1),y(E.asUrl()),E.asSVGText?.()&&R(E.asSVGText())}).catch(E=>{console.warn(E),G(!0),y(Xo),R(null)})},[l]);const j=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),I=o.useMemo(()=>{if(V||w)return u.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:U?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:V,onLoad:()=>{F(!0)},onError:({currentTarget:E})=>{console.log("error"),E.onerror=null,y(Xo),G(!0)},alt:d??`${l.getType()}`})},[U,l,V,w,m]);if(!l.isClosed())return u.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:m?"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,...A,onKeyDownCapture:E=>{h?.(E)},ref:j,children:[U||D?void 0:x,I]})}));Ar.displayName="PictureEditor";const di=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:d,onHide:m,onShow:v,...g}=e;o.useEffect(()=>{},[a]);const k=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:p,width:M}]=Lt();if(!a.isClosed())return u.jsx("div",{...g,ref:Zt([k,h]),children:u.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:l.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:u.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ci="_editable-input_1bqx6_6",ui=e=>u.jsx("input",{...e}),Dr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:d,onCancel:m,createInput:v=ui,notifier:g,styleHover:k={},dragging:h,maxLength:p,disabled:M=!1,readOnly:x=!1,...A}=e,[D,G]=o.useState(!1),[U,F]=o.useState(!1),[V,y]=o.useState(a);o.useEffect(()=>{y(a)},[a]);const w=o.useRef(null),[R,j]=o.useState(null),I=o.useCallback(function(ne){const L=ne.message;R!==L&&(g?.showMessage?.(L,{type:r.NotificationType.Error}),j(L))},[g,R]),E=o.useCallback(ne=>{let L=!1;try{L=l?.(ne)??!0}catch(z){I(z)}return L?(w.current=null,F(!1),y(ne),L):(setTimeout(()=>{w.current?.focus()},0),L)},[l]),W=r.useCallbackRef(()=>{y(a),w.current=null,F(!1),m?.()},[m,a]),_=o.useMemo(()=>{if(!U)return null;const ne={className:yt(ci),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:p,type:"text",value:V,onFocus:L=>{w.current||(w.current=L.target,setTimeout(()=>{L.target?.select()},0))},onBlur:L=>{w.current&&E(V)},onChange:L=>{U&&y(L.target.value)},onMouseDown:L=>L.stopPropagation(),onKeyDown:L=>L.code==="Escape"?(L.preventDefault(),void W()):L.code==="Enter"?(L.preventDefault(),void E(L.target.value)):void(L.code!=="Tab"?L.stopPropagation():E(L.target.value))};return u.jsx(u.Fragment,{children:v(ne)})},[U,V,E,W,v,M]),[P,B]=o.useState();o.useLayoutEffect(()=>{let ne=Object.assign({},n);(h||D)&&(ne=Object.assign(ne,k)),B(ne)},[h,D,k,n]),o.useEffect(()=>{_&&d?.(V)},[_,d,V]);const K=r.useImperativeElement(t,()=>({startEdit(){M||x||F(!0)},cancel(){W()}}),[]);return u.jsxs("div",{...A,ref:K,style:{flexDirection:"column",display:"flex",...P},className:yt(i),children:[u.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{M||x||F(!0)},onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[u.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",marginTop:"2px",opacity:U?0:1},children:V}),_]}),u.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...k},children:V})]})})),Pn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Xt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function wo(e){return"nodeType"in e}function ft(e){var t,n;return e?Xt(e)?e:wo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function xo(e){const{Document:t}=ft(e);return e instanceof t}function bn(e){return!Xt(e)&&e instanceof ft(e).HTMLElement}function zr(e){return e instanceof ft(e).SVGElement}function _t(e){return e?Xt(e)?e.document:wo(e)?xo(e)?e:bn(e)||zr(e)?e.ownerDocument:document:document:document}const Rt=Pn?o.useLayoutEffect:o.useEffect;function Hn(e){const t=o.useRef(e);return Rt(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function pn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function un(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function zn(e){const t=Hn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function Nn(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let lo={};function yn(e,t){return o.useMemo(()=>{if(t)return t;const n=lo[e]==null?0:lo[e]+1;return lo[e]=n,e+"-"+n},[e,t])}function Nr(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>{const m=Object.entries(d);for(const[v,g]of m){const k=l[v];k!=null&&(l[v]=k+e*g)}return l},{...t})}}const Gt=Nr(1),vn=Nr(-1);function Un(e){if(!e)return!1;const{KeyboardEvent:t}=ft(e.target);return t&&e instanceof t}function Ln(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=ft(t.target);return n&&t instanceof n})(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(t){return"clientX"in t&&"clientY"in t})(e)?{x:e.clientX,y:e.clientY}:null}const Ot=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[Ot.Translate.toString(e),Ot.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Yo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function gi(e){return e.matches(Yo)?e:e.querySelector(Yo)}const hi={display:"none"};function mi(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:hi},n)}function fi(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.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":i,"aria-atomic":!0},n)}const Lr=o.createContext(null),pi={draggable:`
24
24
  To pick up a draggable item, press the space bar.
25
25
  While dragging, use the arrow keys to move the item.
26
26
  Press space again to drop the item in its new position, or press escape to cancel.
27
- `},vi={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 Ci(e){let{announcements:t=vi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=pi}=e;const{announce:l,announcement:d}=function(){const[h,f]=o.useState("");return{announce:o.useCallback(T=>{T!=null&&f(T)},[]),announcement:h}}(),m=wn("DndLiveRegion"),[p,g]=o.useState(!1);if(o.useEffect(()=>{g(!0)},[]),function(h){const f=o.useContext(Lr);o.useEffect(()=>{if(!f)throw new Error("useDndMonitor must be used within a children of <DndContext>");return f(h)},[h,f])}(o.useMemo(()=>({onDragStart(h){let{active:f}=h;l(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:T}=h;t.onDragMove&&l(t.onDragMove({active:f,over:T}))},onDragOver(h){let{active:f,over:T}=h;l(t.onDragOver({active:f,over:T}))},onDragEnd(h){let{active:f,over:T}=h;l(t.onDragEnd({active:f,over:T}))},onDragCancel(h){let{active:f,over:T}=h;l(t.onDragCancel({active:f,over:T}))}}),[l,t])),!p)return null;const x=o.createElement(o.Fragment,null,o.createElement(mi,{id:i,value:a.draggable}),o.createElement(fi,{id:m,announcement:d}));return n?Nt.createPortal(x,n):x}var ct;function On(){}function io(e,t){return o.useMemo(()=>({sensor:e,options: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"})(ct||(ct={}));const kt=Object.freeze({x:0,y:0});function Or(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bi(e,t){const n=Ln(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function jr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function wi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Jo(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function Br(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Qo(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const yi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Qo(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,p=n.get(m);if(p){const g=Or(Qo(p),a);l.push({id:m,data:{droppableContainer:d,value:g}})}}return l.sort(jr)};function xi(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),d=a-i,m=l-n;if(i<a&&n<l){const p=t.width*t.height,g=e.width*e.height,x=d*m;return Number((x/(p+g-x)).toFixed(4))}return 0}const qi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:d}=l,m=n.get(d);if(m){const p=xi(m,t);p>0&&a.push({id:d,data:{droppableContainer:l,value:p}})}}return a.sort(wi)};function er(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function Si(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>({...l,top:l.top+e*d.y,bottom:l.bottom+e*d.y,left:l.left+e*d.x,right:l.right+e*d.x}),{...t})}}const Ri=Si(1);function Vr(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 ki={ignoreTransform:!1};function Yt(e,t){t===void 0&&(t=ki);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:x}=ft(e).getComputedStyle(e);g&&(n=function(h,f,T){const q=Vr(f);if(!q)return h;const{scaleX:A,scaleY:D,x:G,y:U}=q,y=h.left-G-(1-A)*parseFloat(T),B=h.top-U-(1-D)*parseFloat(T.slice(T.indexOf(" ")+1)),S=A?h.width/A:h.width,w=D?h.height/D:h.height;return{width:S,height:w,top:B,right:y+S,bottom:B+w,left:y}}(n,g,x))}const{top:i,left:a,width:l,height:d,bottom:m,right:p}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:p}}function tr(e){return Yt(e,{ignoreTransform:!0})}function Kn(e,t){const n=[];return e?function i(a){if(t!=null&&n.length>=t||!a)return n;if(xo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!bn(a)||zr(a)||n.includes(a))return n;const l=ft(e).getComputedStyle(a);return a!==e&&function(d,m){m===void 0&&(m=ft(d).getComputedStyle(d));const p=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(g=>{const x=m[g];return typeof x=="string"&&p.test(x)})}(a,l)&&n.push(a),function(d,m){return m===void 0&&(m=ft(d).getComputedStyle(d)),m.position==="fixed"}(a,l)?n:i(a.parentNode)}(e):n}function Pr(e){const[t]=Kn(e,1);return t??null}function ao(e){return Pn&&e?Xt(e)?e:yo(e)?xo(e)||e===_t(e).scrollingElement?window:bn(e)?e:null:null:null}function Hr(e){return Xt(e)?e.scrollX:e.scrollLeft}function Ur(e){return Xt(e)?e.scrollY:e.scrollTop}function ho(e){return{x:Hr(e),y:Ur(e)}}var ut;function Kr(e){return!(!Pn||!e)&&e===document.scrollingElement}function $r(e){const t={x:0,y:0},n=Kr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));const Mi={x:.2,y:.2};function Ti(e,t,n,i,a){let{top:l,left:d,right:m,bottom:p}=n;i===void 0&&(i=10),a===void 0&&(a=Mi);const{isTop:g,isBottom:x,isLeft:h,isRight:f}=$r(e),T={x:0,y:0},q={x:0,y:0},A=t.height*a.y,D=t.width*a.x;return!g&&l<=t.top+A?(T.y=ut.Backward,q.y=i*Math.abs((t.top+A-l)/A)):!x&&p>=t.bottom-A&&(T.y=ut.Forward,q.y=i*Math.abs((t.bottom-A-p)/A)),!f&&m>=t.right-D?(T.x=ut.Forward,q.x=i*Math.abs((t.right-D-m)/D)):!h&&d<=t.left+D&&(T.x=ut.Backward,q.x=i*Math.abs((t.left+D-d)/D)),{direction:T,speed:q}}function Ii(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:d}=window;return{top:0,left:0,right:l,bottom:d,width:l,height:d}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Wr(e){return e.reduce((t,n)=>Gt(t,ho(n)),kt)}function Gr(e,t){if(t===void 0&&(t=Yt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Pr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ei=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Hr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Ur(n),0)}]];class mo{constructor(t,n){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 i=Kn(n),a=Wr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of Ei)for(const p of d)Object.defineProperty(this,p,{get:()=>{const g=m(i),x=a[l]-g;return this.rect[p]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gn{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function so(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var qt,Ye;function nr(e){e.preventDefault()}function Fi(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"})(qt||(qt={})),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"}(Ye||(Ye={}));const _r={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},Ai=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class qo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new gn(_t(n)),this.windowListeners=new gn(ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Gr(i),n(kt)}handleKeyDown(t){if(Un(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=_r,coordinateGetter:d=Ai,scrollBehavior:m="smooth"}=a,{code:p}=t;if(l.end.includes(p))return void this.handleEnd(t);if(l.cancel.includes(p))return void this.handleCancel(t);const{collisionRect:g}=i.current,x=g?{x:g.left,y:g.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=x);const h=d(t,{active:n,context:i.current,currentCoordinates:x});if(h){const f=vn(h,x),T={x:0,y:0},{scrollableAncestors:q}=i.current;for(const A of q){const D=t.code,{isTop:G,isRight:U,isLeft:y,isBottom:B,maxScroll:S,minScroll:w}=$r(A),k=Ii(A),O={x:Math.min(D===Ye.Right?k.right-k.width/2:k.right,Math.max(D===Ye.Right?k.left:k.left+k.width/2,h.x)),y:Math.min(D===Ye.Down?k.bottom-k.height/2:k.bottom,Math.max(D===Ye.Down?k.top:k.top+k.height/2,h.y))},E=D===Ye.Right&&!U||D===Ye.Left&&!y,F=D===Ye.Down&&!B||D===Ye.Up&&!G;if(E&&O.x!==h.x){const Z=A.scrollLeft+f.x,_=D===Ye.Right&&Z<=S.x||D===Ye.Left&&Z>=w.x;if(_&&!f.y)return void A.scrollTo({left:Z,behavior:m});T.x=_?A.scrollLeft-Z:D===Ye.Right?A.scrollLeft-S.x:A.scrollLeft-w.x,T.x&&A.scrollBy({left:-T.x,behavior:m});break}if(F&&O.y!==h.y){const Z=A.scrollTop+f.y,_=D===Ye.Down&&Z<=S.y||D===Ye.Up&&Z>=w.y;if(_&&!f.x)return void A.scrollTo({top:Z,behavior:m});T.y=_?A.scrollTop-Z:D===Ye.Down?A.scrollTop-S.y:A.scrollTop-w.y,T.y&&A.scrollBy({top:-T.y,behavior:m});break}}this.handleMove(t,Gt(vn(h,this.referenceCoordinates),T))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function or(e){return!!(e&&"distance"in e)}function rr(e){return!!(e&&"delay"in e)}qo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=_r,onActivation:a}=t,{active:l}=n;const{code:d}=e.nativeEvent;if(i.start.includes(d)){const m=l.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class So{constructor(t,n,i){var a;i===void 0&&(i=function(m){const{EventTarget:p}=ft(m);return m instanceof p?m:_t(m)}(t.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=t,this.events=n;const{event:l}=t,{target:d}=l;this.props=t,this.events=n,this.document=_t(d),this.documentListeners=new gn(this.document),this.listeners=new gn(i),this.windowListeners=new gn(ft(d)),this.initialCoordinates=(a=Ln(l))!=null?a:kt,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:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.DragStart,nr),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),this.windowListeners.add(qt.ContextMenu,nr),this.documentListeners.add(qt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(rr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(or(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(qt.Click,Fi,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:d,options:{activationConstraint:m}}=l;if(!a)return;const p=(n=Ln(t))!=null?n:kt,g=vn(a,p);if(!i&&m){if(or(m)){if(m.tolerance!=null&&so(g,m.tolerance))return this.handleCancel();if(so(g,m.distance))return this.handleStart()}return rr(m)&&so(g,m.tolerance)?this.handleCancel():void this.handlePending(m,g)}t.cancelable&&t.preventDefault(),d(p)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Di={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Zr extends So{constructor(t){const{event:n}=t,i=_t(n.target);super(t,Di,i)}}Zr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const zi={move:{name:"mousemove"},end:{name:"mouseup"}};var fo;(function(e){e[e.RightClick=2]="RightClick"})(fo||(fo={}));class Xr extends So{constructor(t){super(t,zi,_t(t.event.target))}}Xr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==fo.RightClick&&(i?.({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Yr extends So{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}var hn,jn;function Ni(e){let{acceleration:t,activator:n=hn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=jn.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:h,threshold:f}=e;const T=function(w){let{delta:k,disabled:O}=w;const E=Nn(k);return un(F=>{if(O||!E||!F)return Li;const Z={x:Math.sign(k.x-E.x),y:Math.sign(k.y-E.y)};return{x:{[ut.Backward]:F.x[ut.Backward]||Z.x===-1,[ut.Forward]:F.x[ut.Forward]||Z.x===1},y:{[ut.Backward]:F.y[ut.Backward]||Z.y===-1,[ut.Forward]:F.y[ut.Forward]||Z.y===1}}},[O,k,E])}({delta:h,disabled:!l}),[q,A]=function(){const w=o.useRef(null);return[o.useCallback((k,O)=>{w.current=setInterval(k,O)},[]),o.useCallback(()=>{w.current!==null&&(clearInterval(w.current),w.current=null)},[])]}(),D=o.useRef({x:0,y:0}),G=o.useRef({x:0,y:0}),U=o.useMemo(()=>{switch(n){case hn.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case hn.DraggableRect:return a}},[n,a,p]),y=o.useRef(null),B=o.useCallback(()=>{const w=y.current;if(!w)return;const k=D.current.x*G.current.x,O=D.current.y*G.current.y;w.scrollBy(k,O)},[]),S=o.useMemo(()=>m===jn.TreeOrder?[...g].reverse():g,[m,g]);o.useEffect(()=>{if(l&&g.length&&U){for(const w of S){if(i?.(w)===!1)continue;const k=g.indexOf(w),O=x[k];if(!O)continue;const{direction:E,speed:F}=Ti(w,O,U,t,f);for(const Z of["x","y"])T[Z][E[Z]]||(F[Z]=0,E[Z]=0);if(F.x>0||F.y>0)return A(),y.current=w,q(B,d),D.current=F,void(G.current=E)}D.current={x:0,y:0},G.current={x:0,y:0},A()}else A()},[t,B,i,A,l,d,JSON.stringify(U),JSON.stringify(T),q,g,S,x,JSON.stringify(f)])}Yr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(hn||(hn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(jn||(jn={}));const Li={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var Cn,po;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Cn||(Cn={})),function(e){e.Optimized="optimized"}(po||(po={}));const lr=new Map;function vo(e,t){return un(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Bn(e){let{callback:t,disabled:n}=e;const i=Hn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:l}=window;return new l(i)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function Oi(e){return new mo(Yt(e),e)}function ir(e,t,n){t===void 0&&(t=Oi);const[i,a]=o.useState(null);function l(){a(p=>{if(!e)return null;var g;if(e.isConnected===!1)return(g=p??n)!=null?g:null;const x=t(e);return JSON.stringify(p)===JSON.stringify(x)?p:x})}const d=function(p){let{callback:g,disabled:x}=p;const h=Hn(g),f=o.useMemo(()=>{if(x||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:T}=window;return new T(h)},[h,x]);return o.useEffect(()=>()=>f?.disconnect(),[f]),f}({callback(p){if(e)for(const g of p){const{type:x,target:h}=g;if(x==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Bn({callback:l});return Rt(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const ar=[];function sr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==kt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?vn(e,n.current):kt}function dr(e){return o.useMemo(()=>e?function(t){const n=t.innerWidth,i=t.innerHeight;return{top:0,left:0,right:n,bottom:i,width:n,height:i}}(e):null,[e])}const cr=[];function Jr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return bn(t)?t:e}const ji=[{sensor:Zr,options:{}},{sensor:qo,options:{}}],Bi={current:{}},An={draggable:{measure:tr},droppable:{measure:tr,strategy:Cn.WhileDragging,frequency:po.Optimized},dragOverlay:{measure:Yt}};class mn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const Vi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:On},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:An,measureDroppableContainers:On,windowRect:null,measuringScheduled:!1},Qr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:On,draggableNodes:new Map,over:null,measureDroppableContainers:On},yn=o.createContext(Qr),el=o.createContext(Vi);function Pi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mn}}}function Hi(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new mn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ct.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const d=new mn(e.droppable.containers);return d.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:d}}}case ct.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new mn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Ui(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(yn),l=Nn(i),d=Nn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Un(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:p,node:g}=m;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[p.current,g.current]){if(!x)continue;const h=gi(x);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function tl(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const $n=o.createContext({...kt,scaleX:1,scaleY:1});var At;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(At||(At={}));const Ki=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:p,sensors:g=ji,collisionDetection:x=qi,measuring:h,modifiers:f,...T}=e;const q=o.useReducer(Hi,void 0,Pi),[A,D]=q,[G,U]=function(){const[v]=o.useState(()=>new Set),H=o.useCallback(Y=>(v.add(Y),()=>v.delete(Y)),[v]);return[o.useCallback(Y=>{let{type:ne,event:le}=Y;v.forEach(ie=>{var se;return(se=ie[ne])==null?void 0:se.call(ie,le)})},[v]),H]}(),[y,B]=o.useState(At.Uninitialized),S=y===At.Initialized,{draggable:{active:w,nodes:k,translate:O},droppable:{containers:E}}=A,F=w!=null?k.get(w):null,Z=o.useRef({initial:null,translated:null}),_=o.useMemo(()=>{var v;return w!=null?{id:w,data:(v=F?.data)!=null?v:Bi,rect:Z}:null},[w,F]),P=o.useRef(null),[V,$]=o.useState(null),[oe,L]=o.useState(null),z=pn(T,Object.values(T)),K=wn("DndDescribedBy",l),W=o.useMemo(()=>E.getEnabled(),[E]),ge=(ae=h,o.useMemo(()=>({draggable:{...An.draggable,...ae?.draggable},droppable:{...An.droppable,...ae?.droppable},dragOverlay:{...An.dragOverlay,...ae?.dragOverlay}}),[ae?.draggable,ae?.droppable,ae?.dragOverlay]));var ae;const{droppableRects:Q,measureDroppableContainers:X,measuringScheduled:be}=function(v,H){let{dragging:Y,dependencies:ne,config:le}=H;const[ie,se]=o.useState(null),{frequency:ye,measure:fe,strategy:pe}=le,qe=o.useRef(v),Oe=function(){switch(pe){case Cn.Always:return!1;case Cn.BeforeDragging:return Y;default:return!Y}}(),De=pn(Oe),We=o.useCallback(function(Ne){Ne===void 0&&(Ne=[]),De.current||se(Xe=>Xe===null?Ne:Xe.concat(Ne.filter(it=>!Xe.includes(it))))},[De]),je=o.useRef(null),Ge=un(Ne=>{if(Oe&&!Y)return lr;if(!Ne||Ne===lr||qe.current!==v||ie!=null){const Xe=new Map;for(let it of v){if(!it)continue;if(ie&&ie.length>0&&!ie.includes(it.id)&&it.rect.current){Xe.set(it.id,it.rect.current);continue}const pt=it.node.current,xt=pt?new mo(fe(pt),pt):null;it.rect.current=xt,xt&&Xe.set(it.id,xt)}return Xe}return Ne},[v,ie,Y,Oe,fe]);return o.useEffect(()=>{qe.current=v},[v]),o.useEffect(()=>{Oe||We()},[Y,Oe]),o.useEffect(()=>{ie&&ie.length>0&&se(null)},[JSON.stringify(ie)]),o.useEffect(()=>{Oe||typeof ye!="number"||je.current!==null||(je.current=setTimeout(()=>{We(),je.current=null},ye))},[ye,Oe,We,...ne]),{droppableRects:Ge,measureDroppableContainers:We,measuringScheduled:ie!=null}}(W,{dragging:S,dependencies:[O.x,O.y],config:ge.droppable}),ke=function(v,H){const Y=H!=null?v.get(H):void 0,ne=Y?Y.node.current:null;return un(le=>{var ie;return H==null?null:(ie=ne??le)!=null?ie:null},[ne,H])}(k,w),ve=o.useMemo(()=>oe?Ln(oe):null,[oe]),Pe=function(){const v=V?.autoScrollEnabled===!1,H=typeof m=="object"?m.enabled===!1:m===!1,Y=S&&!v&&!H;return typeof m=="object"?{...m,enabled:Y}:{enabled:Y}}(),he=function(v,H){return vo(v,H)}(ke,ge.draggable.measure);(function(v){let{activeNode:H,measure:Y,initialRect:ne,config:le=!0}=v;const ie=o.useRef(!1),{x:se,y:ye}=typeof le=="boolean"?{x:le,y:le}:le;Rt(()=>{if(!se&&!ye||!H)return void(ie.current=!1);if(ie.current||!ne)return;const fe=H?.node.current;if(!fe||fe.isConnected===!1)return;const pe=er(Y(fe),ne);if(se||(pe.x=0),ye||(pe.y=0),ie.current=!0,Math.abs(pe.x)>0||Math.abs(pe.y)>0){const qe=Pr(fe);qe&&qe.scrollBy({top:pe.y,left:pe.x})}},[H,se,ye,ne,Y])})({activeNode:w!=null?k.get(w):null,config:Pe.layoutShiftCompensation,initialRect:he,measure:ge.draggable.measure});const He=ir(ke,ge.draggable.measure,he),Se=ir(ke?ke.parentElement:null),ce=o.useRef({activatorEvent:null,active:null,activeNode:ke,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=E.getNodeFor((t=ce.current.over)==null?void 0:t.id),me=function(v){let{measure:H}=v;const[Y,ne]=o.useState(null),le=Bn({callback:o.useCallback(fe=>{for(const{target:pe}of fe)if(bn(pe)){ne(qe=>{const Oe=H(pe);return qe?{...qe,width:Oe.width,height:Oe.height}:Oe});break}},[H])}),ie=o.useCallback(fe=>{const pe=Jr(fe);le?.disconnect(),pe&&le?.observe(pe),ne(pe?H(pe):null)},[H,le]),[se,ye]=zn(ie);return o.useMemo(()=>({nodeRef:se,rect:Y,setRef:ye}),[Y,se,ye])}({measure:ge.dragOverlay.measure}),Ce=(n=me.nodeRef.current)!=null?n:ke,xe=S?(i=me.rect)!=null?i:He:null,Me=!!(me.nodeRef.current&&me.rect),we=er(Ee=Me?null:He,vo(Ee));var Ee;const Le=dr(Ce?ft(Ce):null),Ve=function(v){const H=o.useRef(v),Y=un(ne=>v?ne&&ne!==ar&&v&&H.current&&v.parentNode===H.current.parentNode?ne:Kn(v):ar,[v]);return o.useEffect(()=>{H.current=v},[v]),Y}(S?de??ke:null),C=function(v,H){H===void 0&&(H=Yt);const[Y]=v,ne=dr(Y?ft(Y):null),[le,ie]=o.useState(cr);function se(){ie(()=>v.length?v.map(fe=>Kr(fe)?ne:new mo(H(fe),fe)):cr)}const ye=Bn({callback:se});return Rt(()=>{ye?.disconnect(),se(),v.forEach(fe=>ye?.observe(fe))},[v]),le}(Ve),Ue=tl(f,{transform:{x:O.x-we.x,y:O.y-we.y,scaleX:1,scaleY:1},activatorEvent:oe,active:_,activeNodeRect:He,containerNodeRect:Se,draggingNodeRect:xe,over:ce.current.over,overlayNodeRect:me.rect,scrollableAncestors:Ve,scrollableAncestorRects:C,windowRect:Le}),Qe=ve?Gt(ve,O):null,$e=function(v){const[H,Y]=o.useState(null),ne=o.useRef(v),le=o.useCallback(ie=>{const se=ao(ie.target);se&&Y(ye=>ye?(ye.set(se,ho(se)),new Map(ye)):null)},[]);return o.useEffect(()=>{const ie=ne.current;if(v!==ie){se(ie);const ye=v.map(fe=>{const pe=ao(fe);return pe?(pe.addEventListener("scroll",le,{passive:!0}),[pe,ho(pe)]):null}).filter(fe=>fe!=null);Y(ye.length?new Map(ye):null),ne.current=v}return()=>{se(v),se(ie)};function se(ye){ye.forEach(fe=>{const pe=ao(fe);pe?.removeEventListener("scroll",le)})}},[le,v]),o.useMemo(()=>v.length?H?Array.from(H.values()).reduce((ie,se)=>Gt(ie,se),kt):Wr(v):kt,[v,H])}(Ve),ee=sr($e),Fe=sr($e,[He]),Be=Gt(Ue,ee),Ie=xe?Ri(xe,Ue):null,ze=_&&Ie?x({active:_,collisionRect:Ie,droppableRects:Q,droppableContainers:W,pointerCoordinates:Qe}):null,Ae=Br(ze,"id"),[R,re]=o.useState(null),j=function(v,H,Y){return{...v,scaleX:H&&Y?H.width/Y.width:1,scaleY:H&&Y?H.height/Y.height:1}}(Me?Ue:Gt(Ue,Fe),(a=R?.rect)!=null?a:null,He),J=o.useRef(null),u=o.useCallback((v,H)=>{let{sensor:Y,options:ne}=H;if(P.current==null)return;const le=k.get(P.current);if(!le)return;const ie=v.nativeEvent,se=new Y({active:P.current,activeNode:le,event:ie,options:ne,context:ce,onAbort(fe){if(!k.get(fe))return;const{onDragAbort:pe}=z.current,qe={id:fe};pe?.(qe),G({type:"onDragAbort",event:qe})},onPending(fe,pe,qe,Oe){if(!k.get(fe))return;const{onDragPending:De}=z.current,We={id:fe,constraint:pe,initialCoordinates:qe,offset:Oe};De?.(We),G({type:"onDragPending",event:We})},onStart(fe){const pe=P.current;if(pe==null)return;const qe=k.get(pe);if(!qe)return;const{onDragStart:Oe}=z.current,De={activatorEvent:ie,active:{id:pe,data:qe.data,rect:Z}};Nt.unstable_batchedUpdates(()=>{Oe?.(De),B(At.Initializing),D({type:ct.DragStart,initialCoordinates:fe,active:pe}),G({type:"onDragStart",event:De}),$(J.current),L(ie)})},onMove(fe){D({type:ct.DragMove,coordinates:fe})},onEnd:ye(ct.DragEnd),onCancel:ye(ct.DragCancel)});function ye(fe){return async function(){const{active:pe,collisions:qe,over:Oe,scrollAdjustedTranslate:De}=ce.current;let We=null;if(pe&&De){const{cancelDrop:je}=z.current;We={activatorEvent:ie,active:pe,collisions:qe,delta:De,over:Oe},fe===ct.DragEnd&&typeof je=="function"&&await Promise.resolve(je(We))&&(fe=ct.DragCancel)}P.current=null,Nt.unstable_batchedUpdates(()=>{D({type:fe}),B(At.Uninitialized),re(null),$(null),L(null),J.current=null;const je=fe===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const Ge=z.current[je];Ge?.(We),G({type:je,event:We})}})}}J.current=se},[k]),M=o.useCallback((v,H)=>(Y,ne)=>{const le=Y.nativeEvent,ie=k.get(ne);if(P.current!==null||!ie||le.dndKit||le.defaultPrevented)return;const se={active:ie};v(Y,H.options,se)===!0&&(le.dndKit={capturedBy:H.sensor},P.current=ne,u(Y,H))},[k,u]),I=function(v,H){return o.useMemo(()=>v.reduce((Y,ne)=>{const{sensor:le}=ne;return[...Y,...le.activators.map(ie=>({eventName:ie.eventName,handler:H(ie.handler,ne)}))]},[]),[v,H])}(g,M);(function(v){o.useEffect(()=>{if(!Pn)return;const H=v.map(Y=>{let{sensor:ne}=Y;return ne.setup==null?void 0:ne.setup()});return()=>{for(const Y of H)Y?.()}},v.map(H=>{let{sensor:Y}=H;return Y}))})(g),Rt(()=>{He&&y===At.Initializing&&B(At.Initialized)},[He,y]),o.useEffect(()=>{const{onDragMove:v}=z.current,{active:H,activatorEvent:Y,collisions:ne,over:le}=ce.current;if(!H||!Y)return;const ie={active:H,activatorEvent:Y,collisions:ne,delta:{x:Be.x,y:Be.y},over:le};Nt.unstable_batchedUpdates(()=>{v?.(ie),G({type:"onDragMove",event:ie})})},[Be.x,Be.y]),o.useEffect(()=>{const{active:v,activatorEvent:H,collisions:Y,droppableContainers:ne,scrollAdjustedTranslate:le}=ce.current;if(!v||P.current==null||!H||!le)return;const{onDragOver:ie}=z.current,se=ne.get(Ae),ye=se&&se.rect.current?{id:se.id,rect:se.rect.current,data:se.data,disabled:se.disabled}:null,fe={active:v,activatorEvent:H,collisions:Y,delta:{x:le.x,y:le.y},over:ye};Nt.unstable_batchedUpdates(()=>{re(ye),ie?.(fe),G({type:"onDragOver",event:fe})})},[Ae]),Rt(()=>{ce.current={activatorEvent:oe,active:_,activeNode:ke,collisionRect:Ie,collisions:ze,droppableRects:Q,draggableNodes:k,draggingNode:Ce,draggingNodeRect:xe,droppableContainers:E,over:R,scrollableAncestors:Ve,scrollAdjustedTranslate:Be},Z.current={initial:xe,translated:Ie}},[_,ke,ze,Ie,k,Ce,xe,Q,E,R,Ve,Be]),Ni({...Pe,delta:O,draggingRect:Ie,pointerCoordinates:Qe,scrollableAncestors:Ve,scrollableAncestorRects:C});const b=o.useMemo(()=>({active:_,activeNode:ke,activeNodeRect:He,activatorEvent:oe,collisions:ze,containerNodeRect:Se,dragOverlay:me,draggableNodes:k,droppableContainers:E,droppableRects:Q,over:R,measureDroppableContainers:X,scrollableAncestors:Ve,scrollableAncestorRects:C,measuringConfiguration:ge,measuringScheduled:be,windowRect:Le}),[_,ke,He,oe,ze,Se,me,k,E,Q,R,X,Ve,C,ge,be,Le]),N=o.useMemo(()=>({activatorEvent:oe,activators:I,active:_,activeNodeRect:He,ariaDescribedById:{draggable:K},dispatch:D,draggableNodes:k,over:R,measureDroppableContainers:X}),[oe,I,_,He,D,K,k,R,X]);return o.createElement(Lr.Provider,{value:U},o.createElement(yn.Provider,{value:N},o.createElement(el.Provider,{value:b},o.createElement($n.Provider,{value:j},p)),o.createElement(Ui,{disabled:d?.restoreFocus===!1})),o.createElement(Ci,{...d,hiddenTextDescribedById:K}))}),$i=o.createContext(null),ur="button";function Wi(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=wn("Draggable"),{activators:d,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:h,over:f}=o.useContext(yn),{role:T=ur,roleDescription:q="draggable",tabIndex:A=0}=a??{},D=p?.id===t,G=o.useContext(D?$n:$i),[U,y]=zn(),[B,S]=zn(),w=function(O,E){return o.useMemo(()=>O.reduce((F,Z)=>{let{eventName:_,handler:P}=Z;return F[_]=V=>{P(V,E)},F},{}),[O,E])}(d,t),k=pn(n);return Rt(()=>(h.set(t,{id:t,key:l,node:U,activatorNode:B,data:k}),()=>{const O=h.get(t);O&&O.key===l&&h.delete(t)}),[h,t]),{active:p,activatorEvent:m,activeNodeRect:g,attributes:o.useMemo(()=>({role:T,tabIndex:A,"aria-disabled":i,"aria-pressed":!(!D||T!==ur)||void 0,"aria-roledescription":q,"aria-describedby":x.draggable}),[i,T,A,D,q,x.draggable]),isDragging:D,listeners:i?void 0:w,node:U,over:f,setNodeRef:y,setActivatorNodeRef:S,transform:G}}function nl(){return o.useContext(el)}const Gi={timeout:25};function _i(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Nn(n);return n||i||!m||a(m),Rt(()=>{if(!l)return;const p=i?.key,g=i?.props.id;p!=null&&g!=null?Promise.resolve(t(g,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const Zi={x:0,y:0,scaleX:1,scaleY:1};function Xi(e){let{children:t}=e;return o.createElement(yn.Provider,{value:Qr},o.createElement($n.Provider,{value:Zi},t))}const Yi={position:"fixed",touchAction:"none"},Ji=e=>Un(e)?"transform 250ms ease":void 0,Qi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:p,transform:g,transition:x=Ji}=e;if(!m)return null;const h=a?g:{...g,scaleX:1,scaleY:1},f={...Yi,width:m.width,height:m.height,top:m.top,left:m.left,transform:Ot.Transform.toString(h),transformOrigin:a&&i?bi(i,m):void 0,transition:typeof x=="function"?x(i):x,...p};return o.createElement(n,{className:d,style:f,ref:t},l)}),ea=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,p]of Object.entries(l.active))p!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,p));if(l!=null&&l.dragOverlay)for(const[m,p]of Object.entries(l.dragOverlay))p!==void 0&&i.node.style.setProperty(m,p);return d!=null&&d.active&&n.node.classList.add(d.active),d!=null&&d.dragOverlay&&i.node.classList.add(d.dragOverlay),function(){for(const[m,p]of Object.entries(a))n.node.style.setProperty(m,p);d!=null&&d.active&&n.node.classList.remove(d.active)}},ol={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Ot.Transform.toString(t)},{transform:Ot.Transform.toString(n)}]},sideEffects:ea({styles:{active:{opacity:"0"}}})};function ta(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Hn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const p=m.node.current;if(!p)return;const g=Jr(d);if(!g)return;const{transform:x}=ft(d).getComputedStyle(d),h=Vr(x);if(!h)return;const f=typeof t=="function"?t:function(T){const{duration:q,easing:A,sideEffects:D,keyframes:G}={...ol,...T};return U=>{let{active:y,dragOverlay:B,transform:S,...w}=U;if(!q)return;const k={x:B.rect.left-y.rect.left,y:B.rect.top-y.rect.top},O={scaleX:S.scaleX!==1?y.rect.width*S.scaleX/B.rect.width:1,scaleY:S.scaleY!==1?y.rect.height*S.scaleY/B.rect.height:1},E={x:S.x-k.x,y:S.y-k.y,...O},F=G({...w,active:y,dragOverlay:B,transform:{initial:S,final:E}}),[Z]=F,_=F[F.length-1];if(JSON.stringify(Z)===JSON.stringify(_))return;const P=D?.({active:y,dragOverlay:B,...w}),V=B.node.animate(F,{duration:q,easing:A,fill:"forwards"});return new Promise($=>{V.onfinish=()=>{P?.(),$()}})}}(t);return Gr(p,a.draggable.measure),f({active:{id:l,data:m.data,node:p,rect:a.draggable.measure(p)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let gr=0;function na(e){return o.useMemo(()=>{if(e!=null)return gr++,gr},[e])}const oa=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:p,zIndex:g=999}=e;const{activatorEvent:x,active:h,activeNodeRect:f,containerNodeRect:T,draggableNodes:q,droppableContainers:A,dragOverlay:D,over:G,measuringConfiguration:U,scrollableAncestors:y,scrollableAncestorRects:B,windowRect:S}=nl(),w=o.useContext($n),k=na(h?.id),O=tl(d,{activatorEvent:x,active:h,activeNodeRect:f,containerNodeRect:T,draggingNodeRect:D.rect,over:G,overlayNodeRect:D.rect,scrollableAncestors:y,scrollableAncestorRects:B,transform:w,windowRect:S}),E=vo(f),F=ta({config:i,draggableNodes:q,droppableContainers:A,measuringConfiguration:U}),Z=E?D.setRef:void 0;return o.createElement(Xi,null,o.createElement(_i,{animation:F},h&&k?o.createElement(Qi,{key:k,id:h.id,ref:Z,as:m,activatorEvent:x,adjustScale:t,className:p,transition:l,rect:E,style:{zIndex:g,...a},transform:O},n):null))});function Ro(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ra(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function En(e){return e!==null&&e>=0}const Fn={scaleX:1,scaleY:1},la=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:d}=e;const m=(t=n[a])!=null?t:i;if(!m)return null;const p=function(g,x,h){const f=g[x],T=g[x-1],q=g[x+1];return!f||!T&&!q?0:h<x?T?f.left-(T.left+T.width):q.left-(f.left+f.width):q?q.left-(f.left+f.width):f.left-(T.left+T.width)}(n,d,a);if(d===a){const g=n[l];return g?{x:a<l?g.left+g.width-(m.left+m.width):g.left-m.left,y:0,...Fn}:null}return d>a&&d<=l?{x:-m.width-p,y:0,...Fn}:d<a&&d>=l?{x:m.width+p,y:0,...Fn}:{x:0,y:0,...Fn}},ko=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=Ro(t,i,n),d=t[a],m=l[a];return m&&d?{x:m.left-d.left,y:m.top-d.top,scaleX:m.width/d.width,scaleY:m.height/d.height}:null},rl="Sortable",ll=o.createContext({activeIndex:-1,containerId:rl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ko,disabled:{draggable:!1,droppable:!1}});function ia(e){let{children:t,id:n,items:i,strategy:a=ko,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=nl(),h=wn(rl,n),f=m.rect!==null,T=o.useMemo(()=>i.map(w=>typeof w=="object"&&"id"in w?w.id:w),[i]),q=d!=null,A=d?T.indexOf(d.id):-1,D=g?T.indexOf(g.id):-1,G=o.useRef(T),U=!function(w,k){if(w===k)return!0;if(w.length!==k.length)return!1;for(let O=0;O<w.length;O++)if(w[O]!==k[O])return!1;return!0}(T,G.current),y=D!==-1&&A===-1||U,B=function(w){return typeof w=="boolean"?{draggable:w,droppable:w}:w}(l);Rt(()=>{U&&q&&x(T)},[U,T,q,x]),o.useEffect(()=>{G.current=T},[T]);const S=o.useMemo(()=>({activeIndex:A,containerId:h,disabled:B,disableTransforms:y,items:T,overIndex:D,useDragOverlay:f,sortedRects:ra(T,p),strategy:a}),[A,h,B.draggable,B.droppable,y,T,D,p,f,a]);return o.createElement(ll.Provider,{value:S},t)}const aa=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return Ro(n,i,a).indexOf(t)},sa=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:p,transition:g}=e;return!(!g||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===p)},da={duration:200,easing:"ease"},il="transform",ca=Ot.Transition.toString({property:il,duration:0,easing:"linear"}),ua={roleDescription:"sortable"};function ga(e){let{animateLayoutChanges:t=sa,attributes:n,disabled:i,data:a,getNewIndex:l=aa,id:d,strategy:m,resizeObserverConfig:p,transition:g=da}=e;const{items:x,containerId:h,activeIndex:f,disabled:T,disableTransforms:q,sortedRects:A,overIndex:D,useDragOverlay:G,strategy:U}=o.useContext(ll),y=function(de,me){var Ce,xe;return typeof de=="boolean"?{draggable:de,droppable:!1}:{draggable:(Ce=de?.draggable)!=null?Ce:me.draggable,droppable:(xe=de?.droppable)!=null?xe:me.droppable}}(i,T),B=x.indexOf(d),S=o.useMemo(()=>({sortable:{containerId:h,index:B,items:x},...a}),[h,a,B,x]),w=o.useMemo(()=>x.slice(x.indexOf(d)),[x,d]),{rect:k,node:O,isOver:E,setNodeRef:F}=function(de){let{data:me,disabled:Ce=!1,id:xe,resizeObserverConfig:Me}=de;const we=wn("Droppable"),{active:Ee,dispatch:Le,over:Ve,measureDroppableContainers:C}=o.useContext(yn),Ue=o.useRef({disabled:Ce}),Qe=o.useRef(!1),$e=o.useRef(null),ee=o.useRef(null),{disabled:Fe,updateMeasurementsFor:Be,timeout:Ie}={...Gi,...Me},ze=pn(Be??xe),Ae=Bn({callback:o.useCallback(()=>{Qe.current?(ee.current!=null&&clearTimeout(ee.current),ee.current=setTimeout(()=>{C(Array.isArray(ze.current)?ze.current:[ze.current]),ee.current=null},Ie)):Qe.current=!0},[Ie]),disabled:Fe||!Ee}),R=o.useCallback((u,M)=>{Ae&&(M&&(Ae.unobserve(M),Qe.current=!1),u&&Ae.observe(u))},[Ae]),[re,j]=zn(R),J=pn(me);return o.useEffect(()=>{Ae&&re.current&&(Ae.disconnect(),Qe.current=!1,Ae.observe(re.current))},[re,Ae]),o.useEffect(()=>(Le({type:ct.RegisterDroppable,element:{id:xe,key:we,disabled:Ce,node:re,rect:$e,data:J}}),()=>Le({type:ct.UnregisterDroppable,key:we,id:xe})),[xe]),o.useEffect(()=>{Ce!==Ue.current.disabled&&(Le({type:ct.SetDroppableDisabled,id:xe,key:we,disabled:Ce}),Ue.current.disabled=Ce)},[xe,we,Ce,Le]),{active:Ee,rect:$e,isOver:Ve?.id===xe,node:re,over:Ve,setNodeRef:j}}({id:d,data:S,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...p}}),{active:Z,activatorEvent:_,activeNodeRect:P,attributes:V,setNodeRef:$,listeners:oe,isDragging:L,over:z,setActivatorNodeRef:K,transform:W}=Wi({id:d,data:S,attributes:{...ua,...n},disabled:y.draggable}),ge=function(){for(var de=arguments.length,me=new Array(de),Ce=0;Ce<de;Ce++)me[Ce]=arguments[Ce];return o.useMemo(()=>xe=>{me.forEach(Me=>Me(xe))},me)}(F,$),ae=!!Z,Q=ae&&!q&&En(f)&&En(D),X=!G&&L,be=X&&Q?W:null,ke=Q?be??(m??U)({rects:A,activeNodeRect:P,activeIndex:f,overIndex:D,index:B}):null,ve=En(f)&&En(D)?l({id:d,items:x,activeIndex:f,overIndex:D}):B,Pe=Z?.id,he=o.useRef({activeId:Pe,items:x,newIndex:ve,containerId:h}),He=x!==he.current.items,Se=t({active:Z,containerId:h,isDragging:L,isSorting:ae,id:d,index:B,items:x,newIndex:he.current.newIndex,previousItems:he.current.items,previousContainerId:he.current.containerId,transition:g,wasDragging:he.current.activeId!=null}),ce=function(de){let{disabled:me,index:Ce,node:xe,rect:Me}=de;const[we,Ee]=o.useState(null),Le=o.useRef(Ce);return Rt(()=>{if(!me&&Ce!==Le.current&&xe.current){const Ve=Me.current;if(Ve){const C=Yt(xe.current,{ignoreTransform:!0}),Ue={x:Ve.left-C.left,y:Ve.top-C.top,scaleX:Ve.width/C.width,scaleY:Ve.height/C.height};(Ue.x||Ue.y)&&Ee(Ue)}}Ce!==Le.current&&(Le.current=Ce)},[me,Ce,xe,Me]),o.useEffect(()=>{we&&Ee(null)},[we]),we}({disabled:!Se,index:B,node:O,rect:k});return o.useEffect(()=>{ae&&he.current.newIndex!==ve&&(he.current.newIndex=ve),h!==he.current.containerId&&(he.current.containerId=h),x!==he.current.items&&(he.current.items=x)},[ae,ve,h,x]),o.useEffect(()=>{if(Pe===he.current.activeId)return;if(Pe!=null&&he.current.activeId==null)return void(he.current.activeId=Pe);const de=setTimeout(()=>{he.current.activeId=Pe},50);return()=>clearTimeout(de)},[Pe]),{active:Z,activeIndex:f,attributes:V,data:S,rect:k,index:B,newIndex:ve,items:x,isOver:E,isSorting:ae,isDragging:L,listeners:oe,node:O,overIndex:D,over:z,setNodeRef:ge,setActivatorNodeRef:K,setDroppableNodeRef:F,setDraggableNodeRef:$,transform:ce??ke,transition:function(){if(ce||He&&he.current.newIndex===B)return ca;if(!(X&&!Un(_)||!g)&&(ae||Se))return Ot.Transition.toString({...g,property:il})}()}}function Vn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ha=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],ma=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(ha.includes(e.code)){if(e.preventDefault(),!n||!i)return;const p=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=a.get(h.id);if(f)switch(e.code){case Ye.Down:i.top<f.top&&p.push(h);break;case Ye.Up:i.top>f.top&&p.push(h);break;case Ye.Left:i.left>f.left&&p.push(h);break;case Ye.Right:i.left<f.left&&p.push(h)}});const g=(h=>{let{collisionRect:f,droppableRects:T,droppableContainers:q}=h;const A=Jo(f),D=[];for(const G of q){const{id:U}=G,y=T.get(U);if(y){const B=Jo(y),S=A.reduce((k,O,E)=>k+Or(B[E],O),0),w=Number((S/4).toFixed(4));D.push({id:U,data:{droppableContainer:G,value:w}})}}return D.sort(jr)})({collisionRect:i,droppableRects:a,droppableContainers:p});let x=Br(g,"id");if(x===d?.id&&g.length>1&&(x=g[1].id),x!=null){const h=l.get(n.id),f=l.get(x),T=f?a.get(f.id):null,q=f?.node.current;if(q&&T&&h&&f){const A=Kn(q).some((B,S)=>m[S]!==B),D=hr(h,f),G=function(B,S){return!Vn(B)||!Vn(S)||!hr(B,S)?!1:B.data.current.sortable.index<S.data.current.sortable.index}(h,f),U=A||!D?{x:0,y:0}:{x:G?i.width-T.width:0,y:G?i.height-T.height:0},y={x:T.left,y:T.top};return U.x&&U.y?y:vn(y,U)}}}};function hr(e,t){return!(!Vn(e)||!Vn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const fa=e=>{let{transform:t}=e;return{...t,y:0}},al=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:p,background:g,activeColor:x,borderColor:h,borderWidth:f,dragging:T,...q}=e;return c.jsxs("div",{ref:t,className:wt(a),style:{...i,display:"flex",flexDirection:"column",background:p===l?"white":g,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:p===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...q,children:[c.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[c.jsx("div",{style:{marginLeft:p===l?"0px":"-1px",marginTop:p===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,p===l?c.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):c.jsx(c.Fragment,{})]}),c.jsx("div",{style:{flex:"1 1 100%",background:p===l&&x?x?.toCSS():"none",minHeight:"2px"}})]})})),St={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"},Mo=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:p,onRemove:g,renderItem:x,sorting:h,style:f,transition:T,transform:q,value:A,wrapperStyle:D,...G},U)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const y=x?x({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:p,ref:U,style:f,transform:q,transition:T,value:A}):c.jsx(c.Fragment,{children:A});return c.jsx("div",{className:wt("tab-item",St.Wrapper,a&&St.fadeIn,h&&St.sorting,t&&St.dragOverlay),style:{...D,transition:[T,D?.transition].filter(Boolean).join(", "),"--translate-x":q?`${Math.round(q.x)}px`:void 0,"--translate-y":q?`${Math.round(q.y)}px`:void 0,"--scale-x":q?.scaleX?`${q.scaleX}`:void 0,"--scale-y":q?.scaleY?`${q.scaleY}`:void 0,"--index":m},ref:U,children:c.jsx("div",{className:wt(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:f,"data-cypress":"draggable-item",...l?void 0:p,...G,tabIndex:l?void 0:-1,children:y})})})),mr={Row:"_Row_1kr10_1"},sl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>c.jsx("div",{ref:i,style:{...n},className:wt(mr.Row,t&&mr.horizontal),children:e}))),pa={...ol},va=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=yi,coordinateGetter:m=ma,dropAnimation:p=pa,getItemStyles:g=()=>({}),getNewIndex:x,handle:h=!1,items:f,onMove:T,isDisabled:q=()=>!1,measuring:A,modifiers:D,renderItem:G,renderDivider:U,reorderItems:y=Ro,strategy:B=ko,style:S,useDragOverlay:w=!0,onDragStart:k,wrapperStyle:O=()=>({})}=e,[E,F]=o.useState(()=>f);o.useEffect(()=>{F(f)},[f]);const[Z,_]=o.useState(null),P=function(){for(var z=arguments.length,K=new Array(z),W=0;W<z;W++)K[W]=arguments[W];return o.useMemo(()=>[...K].filter(ge=>ge!=null),[...K])}(io(Xr,{activationConstraint:i}),io(Yr,{activationConstraint:i}),io(qo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),V=E.indexOf.bind(E),$=Z?V(Z):-1,oe=[];E.map((z,K)=>{oe.push(c.jsx(Ca,{id:z,handle:h,index:K,style:g,wrapperStyle:O,disabled:q(z),renderItem:G,animateLayoutChanges:a,useDragOverlay:w,getNewIndex:x},z+"-"+K));const W=U?.({key:"divider-"+K});W&&oe.push(W)});const{getPortalContainer:L}=r.useFullscreenPortal();return c.jsxs(Ki,{sensors:P,collisionDetection:d,onDragStart:z=>{const{active:K}=z;K&&(k?.(z),_(K.id))},autoScroll:{canScroll:z=>!0},onDragEnd:z=>{if(_(null),z.over){const K=V(z.over.id);$!==K&&(F(W=>y(W,$,K)),T?.($,K))}},onDragCancel:()=>{_(null)},measuring:A,modifiers:D,children:[c.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...S},className:wt(n,St.Wrapper),children:c.jsx(ia,{items:E,strategy:B,children:c.jsx(sl,{ref:t,children:oe})})}),w?Nt.createPortal(c.jsx(oa,{adjustScale:l,dropAnimation:p,children:Z?c.jsx(Mo,{value:E[$],handle:h,renderItem:G,wrapperStyle:O({index:$,isDragging:!0,id:E[$]}),index:$,dragging:!0,style:g({id:E[$],index:$,isSorting:Z!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),L()):null]})}));function Ca({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:p,useDragOverlay:g,wrapperStyle:x}){const{attributes:h,isDragging:f,isSorting:T,listeners:q,overIndex:A,setNodeRef:D,transform:G,transition:U}=ga({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return c.jsx(Mo,{ref:D,value:a,disabled:e,dragging:f,sorting:T,handle:i,renderItem:p,index:l,style:m({index:l,id:a,isDragging:f,isSorting:T,overIndex:A}),onRemove:d?()=>d(a):void 0,transform:G,transition:U,wrapperStyle:x({index:l,isDragging:f,id:a}),listeners:q,"data-index":l,"data-id":a,dragOverlay:!g&&f,...h})}const ba="_TabStrip_3x0dp_1",wa=new s.Color("rgb(33, 115, 70)"),ya="#eee",xa=e=>c.jsx(al,{...e}),dl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:p,onTabMove:g,createScrollStartButton:x=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:f=r.defaultCreateScrollEdgeButton,createTabButton:T=xa,createTabDivider:q,editLabelProps:A,disabled:D=!1,disableDrag:G=!1,background:U="white",activeColor:y=wa,borderColor:B=ya,borderWidth:S=1}=e,[w,k]=o.useState(l),[O,E]=o.useState(d),F=o.useCallback(we=>{const Ee=L.current?.[we]?.closest(".tab-item")??L.current?.[we];Ee&&X.current?.scrollTo({top:Ee.offsetTop,left:Ee.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{F(l)},[l]);const Z=o.useCallback((we,Ee)=>{Ee!==w&&(k(Ee),m?.(Ee)),F(Ee)},[m,w]),_=o.useCallback((we,Ee)=>{g?.(we,Ee)},[g]),P=o.useRef(null),[V,$]=o.useState(-1),oe=o.useCallback((we,Ee)=>{p?.(we,Ee)},[p]);o.useLayoutEffect(()=>{k(l)},[l]),o.useLayoutEffect(()=>{E(d)},[d]);const L=o.useRef([]),z=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(we){L.current?.[we]?.startEdit()},cancel(we){L.current?.[we]?.cancel()}},z.current),[w,V]);const K=o.useCallback(({value:we,index:Ee,dragging:Le})=>{const{style:Ve,maxLength:C,...Ue}=A||{},Qe=c.jsx(Dr,{ref:$e=>{L.current[Ee]=$e},value:we,disabled:D,maxLength:C,style:{color:w===Ee&&y?y?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Ve},styleHover:{},onSubmit:$e=>(P.current=!1,$(-1),oe(Ee,$e)),onCancel:()=>{P.current=!1,$(-1)},onChange:$e=>{P.current=!0,$(Ee)},...Ue});return T({onClick:$e=>Z($e,Ee),value:we,index:Ee,editing:V===Ee&&P.current,editable:!0,disabled:D,selectedIndex:w,background:U,activeColor:y,borderColor:B,borderWidth:S,dragging:Le,children:Qe})},[w,oe,Z,A,D,V,T]),[W,{width:ge}]=Lt(),[ae,{width:Q}]=Lt(),X=o.useRef(null),[be,ke]=o.useState({left:0,top:0,width:0,height:0}),[ve,Pe]=o.useState(null);o.useEffect(()=>{ve!==null&&X.current&&X.current.scrollTo({left:ve,behavior:"smooth"})},[ve]);const he=o.useCallback((we,Ee=!1)=>{if(!X.current)return 0;let Le=X.current.firstChild.getBoundingClientRect(),Ve=X.current.firstChild.firstChild.children,C=0;return C=Ee?0:r.ScrollUtils.getScrollTo(we,Le.left,Ve,!0,Math.max(0,we-200)),Pe(C),Math.max(0,C)},[]),He=o.useCallback((we,Ee=!1)=>{if(!X.current)return 0;let Le=X.current.firstChild.getBoundingClientRect(),Ve=X.current.firstChild.firstChild.children,C=0;const Ue=Math.ceil(Q-ge);return C=Ee?Ue:r.ScrollUtils.getScrollTo(we,Le.left,Ve,!1,Math.max(0,we+200)),Pe(C),Math.min(Ue,C)},[Q,ge]),Se=o.useRef(null),ce=o.useRef(null),de=o.useCallback(()=>{ce.current&&(clearTimeout(ce.current),ce.current=null,Se.current=null)},[]),me=o.useCallback((we,Ee,Le=260)=>{Se.current=we,ce.current=setTimeout(()=>{const Ve=Ee?he(Se.current||we):He(Se.current||we);Ve!==Se.current?me(Ve,Ee,120):de()},Le)},[he,He,de]);o.useEffect(()=>()=>de(),[de]);const Ce=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(be.left)<=0||Math.floor(Q-ge)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:de,onMouseLeave:de,onMouseDown:()=>me(X.current.scrollLeft,!0),onClick:we=>he(Math.min(X.current.scrollLeft,ve??Number.MAX_SAFE_INTEGER),we.ctrlKey)}),[be,ve,Q,ge]),xe=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(Q-ge)<=Math.ceil(be.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:de,onMouseLeave:de,onMouseDown:()=>me(X.current.scrollLeft,!1),onClick:we=>He(Math.max(X.current.scrollLeft,ve??0),we.ctrlKey)}),[be,ve,Q,ge]),Me=o.useMemo(()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{minWidth:"16px"}}),n,f?.(Ce)]}),[Ce,xe,x,h,n,f]);return c.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:wt(ba,a),ref:z,children:[c.jsx("div",{style:{borderTop:`solid ${B} ${S}px`,position:"absolute",width:"100%"}}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Me}),c.jsx("div",{className:"Tabs",ref:W,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:c.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:X,onScroll:we=>{ke({left:we.target.scrollLeft,top:we.target.scrollTop,width:we.target.scrollWidth,height:we.target.scrollHeight})},children:c.jsx(va,{isDisabled:we=>D||G,items:O,strategy:la,modifiers:[fa],ref:ae,renderItem:K,renderDivider:q,onMove:_,activationConstraint:{distance:15}})})}),c.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:f(xe)})]})}));dl.displayName="TabStrip";const Dn=o.createContext(null);Dn.displayName="DocThemesContext";const qa="_script-editor_iy654_5",Sa=o.lazy(()=>Promise.resolve().then(()=>require("./VKHWR3AWoMzuFI7k.cjs"))),Ra={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:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"};let sn,dn,Ft=["define","require"];const fr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),d=await l.getNavigationTree(i.uri.toString()),m=e.getPosition();let p={...m};p.lineNumber=1,p.column=1;let g=!1;for(let A=m.lineNumber;A>=1;A--)if(i.getLineContent(A).trim()===""){const D=To(d,i.getOffsetAt({lineNumber:A,column:1}),"function");if(!D||Ma(D)){g=!0,p.lineNumber=A+1;break}{const G=D.spans[0].start;A=i.getPositionAt(G).lineNumber,p.lineNumber=A}}let x=n,h=!1;!g&&!x.startsWith(`
28
- `)&&p.lineNumber>1&&(x=`
29
- `+x,h=!0);let f=!1;i.getLineCount()>1&&(x.endsWith(`
27
+ `},vi={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 Ci(e){let{announcements:t=vi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=pi}=e;const{announce:l,announcement:d}=(function(){const[h,p]=o.useState("");return{announce:o.useCallback(M=>{M!=null&&p(M)},[]),announcement:h}})(),m=yn("DndLiveRegion"),[v,g]=o.useState(!1);if(o.useEffect(()=>{g(!0)},[]),(function(h){const p=o.useContext(Lr);o.useEffect(()=>{if(!p)throw new Error("useDndMonitor must be used within a children of <DndContext>");return p(h)},[h,p])})(o.useMemo(()=>({onDragStart(h){let{active:p}=h;l(t.onDragStart({active:p}))},onDragMove(h){let{active:p,over:M}=h;t.onDragMove&&l(t.onDragMove({active:p,over:M}))},onDragOver(h){let{active:p,over:M}=h;l(t.onDragOver({active:p,over:M}))},onDragEnd(h){let{active:p,over:M}=h;l(t.onDragEnd({active:p,over:M}))},onDragCancel(h){let{active:p,over:M}=h;l(t.onDragCancel({active:p,over:M}))}}),[l,t])),!v)return null;const k=o.createElement(o.Fragment,null,o.createElement(mi,{id:i,value:a.draggable}),o.createElement(fi,{id:m,announcement:d}));return n?Nt.createPortal(k,n):k}var ct;function On(){}function io(e,t){return o.useMemo(()=>({sensor:e,options: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"})(ct||(ct={}));const kt=Object.freeze({x:0,y:0});function Or(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bi(e,t){const n=Ln(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function jr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function yi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function Jo(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function Br(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Qo(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const wi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Qo(t,t.left,t.top),l=[];for(const d of i){const{id:m}=d,v=n.get(m);if(v){const g=Or(Qo(v),a);l.push({id:m,data:{droppableContainer:d,value:g}})}}return l.sort(jr)};function xi(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),d=a-i,m=l-n;if(i<a&&n<l){const v=t.width*t.height,g=e.width*e.height,k=d*m;return Number((k/(v+g-k)).toFixed(4))}return 0}const qi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:d}=l,m=n.get(d);if(m){const v=xi(m,t);v>0&&a.push({id:d,data:{droppableContainer:l,value:v}})}}return a.sort(yi)};function er(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function Si(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,d)=>({...l,top:l.top+e*d.y,bottom:l.bottom+e*d.y,left:l.left+e*d.x,right:l.right+e*d.x}),{...t})}}const Ri=Si(1);function Vr(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 ki={ignoreTransform:!1};function Yt(e,t){t===void 0&&(t=ki);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:k}=ft(e).getComputedStyle(e);g&&(n=(function(h,p,M){const x=Vr(p);if(!x)return h;const{scaleX:A,scaleY:D,x:G,y:U}=x,F=h.left-G-(1-A)*parseFloat(M),V=h.top-U-(1-D)*parseFloat(M.slice(M.indexOf(" ")+1)),y=A?h.width/A:h.width,w=D?h.height/D:h.height;return{width:y,height:w,top:V,right:F+y,bottom:V+w,left:F}})(n,g,k))}const{top:i,left:a,width:l,height:d,bottom:m,right:v}=n;return{top:i,left:a,width:l,height:d,bottom:m,right:v}}function tr(e){return Yt(e,{ignoreTransform:!0})}function Kn(e,t){const n=[];return e?(function i(a){if(t!=null&&n.length>=t||!a)return n;if(xo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!bn(a)||zr(a)||n.includes(a))return n;const l=ft(e).getComputedStyle(a);return a!==e&&(function(d,m){m===void 0&&(m=ft(d).getComputedStyle(d));const v=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(g=>{const k=m[g];return typeof k=="string"&&v.test(k)})})(a,l)&&n.push(a),(function(d,m){return m===void 0&&(m=ft(d).getComputedStyle(d)),m.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Pr(e){const[t]=Kn(e,1);return t??null}function ao(e){return Pn&&e?Xt(e)?e:wo(e)?xo(e)||e===_t(e).scrollingElement?window:bn(e)?e:null:null:null}function Hr(e){return Xt(e)?e.scrollX:e.scrollLeft}function Ur(e){return Xt(e)?e.scrollY:e.scrollTop}function ho(e){return{x:Hr(e),y:Ur(e)}}var ut;function Kr(e){return!(!Pn||!e)&&e===document.scrollingElement}function $r(e){const t={x:0,y:0},n=Kr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));const Mi={x:.2,y:.2};function Ti(e,t,n,i,a){let{top:l,left:d,right:m,bottom:v}=n;i===void 0&&(i=10),a===void 0&&(a=Mi);const{isTop:g,isBottom:k,isLeft:h,isRight:p}=$r(e),M={x:0,y:0},x={x:0,y:0},A=t.height*a.y,D=t.width*a.x;return!g&&l<=t.top+A?(M.y=ut.Backward,x.y=i*Math.abs((t.top+A-l)/A)):!k&&v>=t.bottom-A&&(M.y=ut.Forward,x.y=i*Math.abs((t.bottom-A-v)/A)),!p&&m>=t.right-D?(M.x=ut.Forward,x.x=i*Math.abs((t.right-D-m)/D)):!h&&d<=t.left+D&&(M.x=ut.Backward,x.x=i*Math.abs((t.left+D-d)/D)),{direction:M,speed:x}}function Ii(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:d}=window;return{top:0,left:0,right:l,bottom:d,width:l,height:d}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Wr(e){return e.reduce((t,n)=>Gt(t,ho(n)),kt)}function Gr(e,t){if(t===void 0&&(t=Yt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Pr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ei=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Hr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+Ur(n),0)}]];class mo{constructor(t,n){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 i=Kn(n),a=Wr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,d,m]of Ei)for(const v of d)Object.defineProperty(this,v,{get:()=>{const g=m(i),k=a[l]-g;return this.rect[v]+k},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gn{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function so(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var qt,Je;function nr(e){e.preventDefault()}function Fi(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"})(qt||(qt={})),(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"})(Je||(Je={}));const _r={start:[Je.Space,Je.Enter],cancel:[Je.Esc],end:[Je.Space,Je.Enter,Je.Tab]},Ai=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Je.Right:return{...n,x:n.x+25};case Je.Left:return{...n,x:n.x-25};case Je.Down:return{...n,y:n.y+25};case Je.Up:return{...n,y:n.y-25}}};class qo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new gn(_t(n)),this.windowListeners=new gn(ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Gr(i),n(kt)}handleKeyDown(t){if(Un(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=_r,coordinateGetter:d=Ai,scrollBehavior:m="smooth"}=a,{code:v}=t;if(l.end.includes(v))return void this.handleEnd(t);if(l.cancel.includes(v))return void this.handleCancel(t);const{collisionRect:g}=i.current,k=g?{x:g.left,y:g.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=k);const h=d(t,{active:n,context:i.current,currentCoordinates:k});if(h){const p=vn(h,k),M={x:0,y:0},{scrollableAncestors:x}=i.current;for(const A of x){const D=t.code,{isTop:G,isRight:U,isLeft:F,isBottom:V,maxScroll:y,minScroll:w}=$r(A),R=Ii(A),j={x:Math.min(D===Je.Right?R.right-R.width/2:R.right,Math.max(D===Je.Right?R.left:R.left+R.width/2,h.x)),y:Math.min(D===Je.Down?R.bottom-R.height/2:R.bottom,Math.max(D===Je.Down?R.top:R.top+R.height/2,h.y))},I=D===Je.Right&&!U||D===Je.Left&&!F,E=D===Je.Down&&!V||D===Je.Up&&!G;if(I&&j.x!==h.x){const W=A.scrollLeft+p.x,_=D===Je.Right&&W<=y.x||D===Je.Left&&W>=w.x;if(_&&!p.y)return void A.scrollTo({left:W,behavior:m});M.x=_?A.scrollLeft-W:D===Je.Right?A.scrollLeft-y.x:A.scrollLeft-w.x,M.x&&A.scrollBy({left:-M.x,behavior:m});break}if(E&&j.y!==h.y){const W=A.scrollTop+p.y,_=D===Je.Down&&W<=y.y||D===Je.Up&&W>=w.y;if(_&&!p.x)return void A.scrollTo({top:W,behavior:m});M.y=_?A.scrollTop-W:D===Je.Down?A.scrollTop-y.y:A.scrollTop-w.y,M.y&&A.scrollBy({top:-M.y,behavior:m});break}}this.handleMove(t,Gt(vn(h,this.referenceCoordinates),M))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function or(e){return!!(e&&"distance"in e)}function rr(e){return!!(e&&"delay"in e)}qo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=_r,onActivation:a}=t,{active:l}=n;const{code:d}=e.nativeEvent;if(i.start.includes(d)){const m=l.activatorNode.current;return(!m||e.target===m)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class So{constructor(t,n,i){var a;i===void 0&&(i=(function(m){const{EventTarget:v}=ft(m);return m instanceof v?m:_t(m)})(t.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=t,this.events=n;const{event:l}=t,{target:d}=l;this.props=t,this.events=n,this.document=_t(d),this.documentListeners=new gn(this.document),this.listeners=new gn(i),this.windowListeners=new gn(ft(d)),this.initialCoordinates=(a=Ln(l))!=null?a:kt,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:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.DragStart,nr),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),this.windowListeners.add(qt.ContextMenu,nr),this.documentListeners.add(qt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(rr(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(or(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(qt.Click,Fi,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:d,options:{activationConstraint:m}}=l;if(!a)return;const v=(n=Ln(t))!=null?n:kt,g=vn(a,v);if(!i&&m){if(or(m)){if(m.tolerance!=null&&so(g,m.tolerance))return this.handleCancel();if(so(g,m.distance))return this.handleStart()}return rr(m)&&so(g,m.tolerance)?this.handleCancel():void this.handlePending(m,g)}t.cancelable&&t.preventDefault(),d(v)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Di={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Zr extends So{constructor(t){const{event:n}=t,i=_t(n.target);super(t,Di,i)}}Zr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const zi={move:{name:"mousemove"},end:{name:"mouseup"}};var fo;(function(e){e[e.RightClick=2]="RightClick"})(fo||(fo={}));class Xr extends So{constructor(t){super(t,zi,_t(t.event.target))}}Xr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==fo.RightClick&&(i?.({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Yr extends So{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}var hn,jn;function Ni(e){let{acceleration:t,activator:n=hn.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:d=5,order:m=jn.TreeOrder,pointerCoordinates:v,scrollableAncestors:g,scrollableAncestorRects:k,delta:h,threshold:p}=e;const M=(function(w){let{delta:R,disabled:j}=w;const I=Nn(R);return un(E=>{if(j||!I||!E)return Li;const W={x:Math.sign(R.x-I.x),y:Math.sign(R.y-I.y)};return{x:{[ut.Backward]:E.x[ut.Backward]||W.x===-1,[ut.Forward]:E.x[ut.Forward]||W.x===1},y:{[ut.Backward]:E.y[ut.Backward]||W.y===-1,[ut.Forward]:E.y[ut.Forward]||W.y===1}}},[j,R,I])})({delta:h,disabled:!l}),[x,A]=(function(){const w=o.useRef(null);return[o.useCallback((R,j)=>{w.current=setInterval(R,j)},[]),o.useCallback(()=>{w.current!==null&&(clearInterval(w.current),w.current=null)},[])]})(),D=o.useRef({x:0,y:0}),G=o.useRef({x:0,y:0}),U=o.useMemo(()=>{switch(n){case hn.Pointer:return v?{top:v.y,bottom:v.y,left:v.x,right:v.x}:null;case hn.DraggableRect:return a}},[n,a,v]),F=o.useRef(null),V=o.useCallback(()=>{const w=F.current;if(!w)return;const R=D.current.x*G.current.x,j=D.current.y*G.current.y;w.scrollBy(R,j)},[]),y=o.useMemo(()=>m===jn.TreeOrder?[...g].reverse():g,[m,g]);o.useEffect(()=>{if(l&&g.length&&U){for(const w of y){if(i?.(w)===!1)continue;const R=g.indexOf(w),j=k[R];if(!j)continue;const{direction:I,speed:E}=Ti(w,j,U,t,p);for(const W of["x","y"])M[W][I[W]]||(E[W]=0,I[W]=0);if(E.x>0||E.y>0)return A(),F.current=w,x(V,d),D.current=E,void(G.current=I)}D.current={x:0,y:0},G.current={x:0,y:0},A()}else A()},[t,V,i,A,l,d,JSON.stringify(U),JSON.stringify(M),x,g,y,k,JSON.stringify(p)])}Yr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(hn||(hn={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jn||(jn={}));const Li={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};var Cn,po;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Cn||(Cn={})),(function(e){e.Optimized="optimized"})(po||(po={}));const lr=new Map;function vo(e,t){return un(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Bn(e){let{callback:t,disabled:n}=e;const i=Hn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:l}=window;return new l(i)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function Oi(e){return new mo(Yt(e),e)}function ir(e,t,n){t===void 0&&(t=Oi);const[i,a]=o.useState(null);function l(){a(v=>{if(!e)return null;var g;if(e.isConnected===!1)return(g=v??n)!=null?g:null;const k=t(e);return JSON.stringify(v)===JSON.stringify(k)?v:k})}const d=(function(v){let{callback:g,disabled:k}=v;const h=Hn(g),p=o.useMemo(()=>{if(k||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:M}=window;return new M(h)},[h,k]);return o.useEffect(()=>()=>p?.disconnect(),[p]),p})({callback(v){if(e)for(const g of v){const{type:k,target:h}=g;if(k==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),m=Bn({callback:l});return Rt(()=>{l(),e?(m?.observe(e),d?.observe(document.body,{childList:!0,subtree:!0})):(m?.disconnect(),d?.disconnect())},[e]),i}const ar=[];function sr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==kt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?vn(e,n.current):kt}function dr(e){return o.useMemo(()=>e?(function(t){const n=t.innerWidth,i=t.innerHeight;return{top:0,left:0,right:n,bottom:i,width:n,height:i}})(e):null,[e])}const cr=[];function Jr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return bn(t)?t:e}const ji=[{sensor:Zr,options:{}},{sensor:qo,options:{}}],Bi={current:{}},An={draggable:{measure:tr},droppable:{measure:tr,strategy:Cn.WhileDragging,frequency:po.Optimized},dragOverlay:{measure:Yt}};class mn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const Vi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:On},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:An,measureDroppableContainers:On,windowRect:null,measuringScheduled:!1},Qr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:On,draggableNodes:new Map,over:null,measureDroppableContainers:On},wn=o.createContext(Qr),el=o.createContext(Vi);function Pi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mn}}}function Hi(e,t){switch(t.type){case ct.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ct.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ct.DragEnd:case ct.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ct.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new mn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ct.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const d=new mn(e.droppable.containers);return d.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:d}}}case ct.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new mn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Ui(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(wn),l=Nn(i),d=Nn(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&d!=null){if(!Un(l)||document.activeElement===l.target)return;const m=a.get(d);if(!m)return;const{activatorNode:v,node:g}=m;if(!v.current&&!g.current)return;requestAnimationFrame(()=>{for(const k of[v.current,g.current]){if(!k)continue;const h=gi(k);if(h){h.focus();break}}})}},[i,t,a,d,l]),null}function tl(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const $n=o.createContext({...kt,scaleX:1,scaleY:1});var At;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(At||(At={}));const Ki=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:d,autoScroll:m=!0,children:v,sensors:g=ji,collisionDetection:k=qi,measuring:h,modifiers:p,...M}=e;const x=o.useReducer(Hi,void 0,Pi),[A,D]=x,[G,U]=(function(){const[C]=o.useState(()=>new Set),H=o.useCallback(X=>(C.add(X),()=>C.delete(X)),[C]);return[o.useCallback(X=>{let{type:te,event:ie}=X;C.forEach(se=>{var ce;return(ce=se[te])==null?void 0:ce.call(se,ie)})},[C]),H]})(),[F,V]=o.useState(At.Uninitialized),y=F===At.Initialized,{draggable:{active:w,nodes:R,translate:j},droppable:{containers:I}}=A,E=w!=null?R.get(w):null,W=o.useRef({initial:null,translated:null}),_=o.useMemo(()=>{var C;return w!=null?{id:w,data:(C=E?.data)!=null?C:Bi,rect:W}:null},[w,E]),P=o.useRef(null),[B,K]=o.useState(null),[ne,L]=o.useState(null),z=pn(M,Object.values(M)),ae=yn("DndDescribedBy",l),ve=o.useMemo(()=>I.getEnabled(),[I]),Pe=(Se=h,o.useMemo(()=>({draggable:{...An.draggable,...Se?.draggable},droppable:{...An.droppable,...Se?.droppable},dragOverlay:{...An.dragOverlay,...Se?.dragOverlay}}),[Se?.draggable,Se?.droppable,Se?.dragOverlay]));var Se;const{droppableRects:ue,measureDroppableContainers:Re,measuringScheduled:Ke}=(function(C,H){let{dragging:X,dependencies:te,config:ie}=H;const[se,ce]=o.useState(null),{frequency:ye,measure:fe,strategy:pe}=ie,we=o.useRef(C),Be=(function(){switch(pe){case Cn.Always:return!1;case Cn.BeforeDragging:return X;default:return!X}})(),Ne=pn(Be),We=o.useCallback(function(Oe){Oe===void 0&&(Oe=[]),Ne.current||ce(Ye=>Ye===null?Oe:Ye.concat(Oe.filter(it=>!Ye.includes(it))))},[Ne]),Ve=o.useRef(null),Ge=un(Oe=>{if(Be&&!X)return lr;if(!Oe||Oe===lr||we.current!==C||se!=null){const Ye=new Map;for(let it of C){if(!it)continue;if(se&&se.length>0&&!se.includes(it.id)&&it.rect.current){Ye.set(it.id,it.rect.current);continue}const pt=it.node.current,xt=pt?new mo(fe(pt),pt):null;it.rect.current=xt,xt&&Ye.set(it.id,xt)}return Ye}return Oe},[C,se,X,Be,fe]);return o.useEffect(()=>{we.current=C},[C]),o.useEffect(()=>{Be||We()},[X,Be]),o.useEffect(()=>{se&&se.length>0&&ce(null)},[JSON.stringify(se)]),o.useEffect(()=>{Be||typeof ye!="number"||Ve.current!==null||(Ve.current=setTimeout(()=>{We(),Ve.current=null},ye))},[ye,Be,We,...te]),{droppableRects:Ge,measureDroppableContainers:We,measuringScheduled:se!=null}})(ve,{dragging:y,dependencies:[j.x,j.y],config:Pe.droppable}),$e=(function(C,H){const X=H!=null?C.get(H):void 0,te=X?X.node.current:null;return un(ie=>{var se;return H==null?null:(se=te??ie)!=null?se:null},[te,H])})(R,w),Ie=o.useMemo(()=>ne?Ln(ne):null,[ne]),me=(function(){const C=B?.autoScrollEnabled===!1,H=typeof m=="object"?m.enabled===!1:m===!1,X=y&&!C&&!H;return typeof m=="object"?{...m,enabled:X}:{enabled:X}})(),$=(function(C,H){return vo(C,H)})($e,Pe.draggable.measure);(function(C){let{activeNode:H,measure:X,initialRect:te,config:ie=!0}=C;const se=o.useRef(!1),{x:ce,y:ye}=typeof ie=="boolean"?{x:ie,y:ie}:ie;Rt(()=>{if(!ce&&!ye||!H)return void(se.current=!1);if(se.current||!te)return;const fe=H?.node.current;if(!fe||fe.isConnected===!1)return;const pe=er(X(fe),te);if(ce||(pe.x=0),ye||(pe.y=0),se.current=!0,Math.abs(pe.x)>0||Math.abs(pe.y)>0){const we=Pr(fe);we&&we.scrollBy({top:pe.y,left:pe.x})}},[H,ce,ye,te,X])})({activeNode:w!=null?R.get(w):null,config:me.layoutShiftCompensation,initialRect:$,measure:Pe.draggable.measure});const Ae=ir($e,Pe.draggable.measure,$),Ce=ir($e?$e.parentElement:null),J=o.useRef({activatorEvent:null,active:null,activeNode:$e,collisionRect:null,collisions:null,droppableRects:ue,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Z=I.getNodeFor((t=J.current.over)==null?void 0:t.id),re=(function(C){let{measure:H}=C;const[X,te]=o.useState(null),ie=Bn({callback:o.useCallback(fe=>{for(const{target:pe}of fe)if(bn(pe)){te(we=>{const Be=H(pe);return we?{...we,width:Be.width,height:Be.height}:Be});break}},[H])}),se=o.useCallback(fe=>{const pe=Jr(fe);ie?.disconnect(),pe&&ie?.observe(pe),te(pe?H(pe):null)},[H,ie]),[ce,ye]=zn(se);return o.useMemo(()=>({nodeRef:ce,rect:X,setRef:ye}),[X,ce,ye])})({measure:Pe.dragOverlay.measure}),oe=(n=re.nodeRef.current)!=null?n:$e,he=y?(i=re.rect)!=null?i:Ae:null,Me=!!(re.nodeRef.current&&re.rect),de=er(be=Me?null:Ae,vo(be));var be;const xe=dr(oe?ft(oe):null),Fe=(function(C){const H=o.useRef(C),X=un(te=>C?te&&te!==ar&&C&&H.current&&C.parentNode===H.current.parentNode?te:Kn(C):ar,[C]);return o.useEffect(()=>{H.current=C},[C]),X})(y?Z??$e:null),f=(function(C,H){H===void 0&&(H=Yt);const[X]=C,te=dr(X?ft(X):null),[ie,se]=o.useState(cr);function ce(){se(()=>C.length?C.map(fe=>Kr(fe)?te:new mo(H(fe),fe)):cr)}const ye=Bn({callback:ce});return Rt(()=>{ye?.disconnect(),ce(),C.forEach(fe=>ye?.observe(fe))},[C]),ie})(Fe),Le=tl(p,{transform:{x:j.x-de.x,y:j.y-de.y,scaleX:1,scaleY:1},activatorEvent:ne,active:_,activeNodeRect:Ae,containerNodeRect:Ce,draggingNodeRect:he,over:J.current.over,overlayNodeRect:re.rect,scrollableAncestors:Fe,scrollableAncestorRects:f,windowRect:xe}),Xe=Ie?Gt(Ie,j):null,Ue=(function(C){const[H,X]=o.useState(null),te=o.useRef(C),ie=o.useCallback(se=>{const ce=ao(se.target);ce&&X(ye=>ye?(ye.set(ce,ho(ce)),new Map(ye)):null)},[]);return o.useEffect(()=>{const se=te.current;if(C!==se){ce(se);const ye=C.map(fe=>{const pe=ao(fe);return pe?(pe.addEventListener("scroll",ie,{passive:!0}),[pe,ho(pe)]):null}).filter(fe=>fe!=null);X(ye.length?new Map(ye):null),te.current=C}return()=>{ce(C),ce(se)};function ce(ye){ye.forEach(fe=>{const pe=ao(fe);pe?.removeEventListener("scroll",ie)})}},[ie,C]),o.useMemo(()=>C.length?H?Array.from(H.values()).reduce((se,ce)=>Gt(se,ce),kt):Wr(C):kt,[C,H])})(Fe),Q=sr(Ue),qe=sr(Ue,[Ae]),je=Gt(Le,Q),Te=he?Ri(he,Le):null,De=_&&Te?k({active:_,collisionRect:Te,droppableRects:ue,droppableContainers:ve,pointerCoordinates:Xe}):null,ze=Br(De,"id"),[S,le]=o.useState(null),O=(function(C,H,X){return{...C,scaleX:H&&X?H.width/X.width:1,scaleY:H&&X?H.height/X.height:1}})(Me?Le:Gt(Le,qe),(a=S?.rect)!=null?a:null,Ae),Y=o.useRef(null),c=o.useCallback((C,H)=>{let{sensor:X,options:te}=H;if(P.current==null)return;const ie=R.get(P.current);if(!ie)return;const se=C.nativeEvent,ce=new X({active:P.current,activeNode:ie,event:se,options:te,context:J,onAbort(fe){if(!R.get(fe))return;const{onDragAbort:pe}=z.current,we={id:fe};pe?.(we),G({type:"onDragAbort",event:we})},onPending(fe,pe,we,Be){if(!R.get(fe))return;const{onDragPending:Ne}=z.current,We={id:fe,constraint:pe,initialCoordinates:we,offset:Be};Ne?.(We),G({type:"onDragPending",event:We})},onStart(fe){const pe=P.current;if(pe==null)return;const we=R.get(pe);if(!we)return;const{onDragStart:Be}=z.current,Ne={activatorEvent:se,active:{id:pe,data:we.data,rect:W}};Nt.unstable_batchedUpdates(()=>{Be?.(Ne),V(At.Initializing),D({type:ct.DragStart,initialCoordinates:fe,active:pe}),G({type:"onDragStart",event:Ne}),K(Y.current),L(se)})},onMove(fe){D({type:ct.DragMove,coordinates:fe})},onEnd:ye(ct.DragEnd),onCancel:ye(ct.DragCancel)});function ye(fe){return async function(){const{active:pe,collisions:we,over:Be,scrollAdjustedTranslate:Ne}=J.current;let We=null;if(pe&&Ne){const{cancelDrop:Ve}=z.current;We={activatorEvent:se,active:pe,collisions:we,delta:Ne,over:Be},fe===ct.DragEnd&&typeof Ve=="function"&&await Promise.resolve(Ve(We))&&(fe=ct.DragCancel)}P.current=null,Nt.unstable_batchedUpdates(()=>{D({type:fe}),V(At.Uninitialized),le(null),K(null),L(null),Y.current=null;const Ve=fe===ct.DragEnd?"onDragEnd":"onDragCancel";if(We){const Ge=z.current[Ve];Ge?.(We),G({type:Ve,event:We})}})}}Y.current=ce},[R]),q=o.useCallback((C,H)=>(X,te)=>{const ie=X.nativeEvent,se=R.get(te);if(P.current!==null||!se||ie.dndKit||ie.defaultPrevented)return;const ce={active:se};C(X,H.options,ce)===!0&&(ie.dndKit={capturedBy:H.sensor},P.current=te,c(X,H))},[R,c]),T=(function(C,H){return o.useMemo(()=>C.reduce((X,te)=>{const{sensor:ie}=te;return[...X,...ie.activators.map(se=>({eventName:se.eventName,handler:H(se.handler,te)}))]},[]),[C,H])})(g,q);(function(C){o.useEffect(()=>{if(!Pn)return;const H=C.map(X=>{let{sensor:te}=X;return te.setup==null?void 0:te.setup()});return()=>{for(const X of H)X?.()}},C.map(H=>{let{sensor:X}=H;return X}))})(g),Rt(()=>{Ae&&F===At.Initializing&&V(At.Initialized)},[Ae,F]),o.useEffect(()=>{const{onDragMove:C}=z.current,{active:H,activatorEvent:X,collisions:te,over:ie}=J.current;if(!H||!X)return;const se={active:H,activatorEvent:X,collisions:te,delta:{x:je.x,y:je.y},over:ie};Nt.unstable_batchedUpdates(()=>{C?.(se),G({type:"onDragMove",event:se})})},[je.x,je.y]),o.useEffect(()=>{const{active:C,activatorEvent:H,collisions:X,droppableContainers:te,scrollAdjustedTranslate:ie}=J.current;if(!C||P.current==null||!H||!ie)return;const{onDragOver:se}=z.current,ce=te.get(ze),ye=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,fe={active:C,activatorEvent:H,collisions:X,delta:{x:ie.x,y:ie.y},over:ye};Nt.unstable_batchedUpdates(()=>{le(ye),se?.(fe),G({type:"onDragOver",event:fe})})},[ze]),Rt(()=>{J.current={activatorEvent:ne,active:_,activeNode:$e,collisionRect:Te,collisions:De,droppableRects:ue,draggableNodes:R,draggingNode:oe,draggingNodeRect:he,droppableContainers:I,over:S,scrollableAncestors:Fe,scrollAdjustedTranslate:je},W.current={initial:he,translated:Te}},[_,$e,De,Te,R,oe,he,ue,I,S,Fe,je]),Ni({...me,delta:j,draggingRect:Te,pointerCoordinates:Xe,scrollableAncestors:Fe,scrollableAncestorRects:f});const b=o.useMemo(()=>({active:_,activeNode:$e,activeNodeRect:Ae,activatorEvent:ne,collisions:De,containerNodeRect:Ce,dragOverlay:re,draggableNodes:R,droppableContainers:I,droppableRects:ue,over:S,measureDroppableContainers:Re,scrollableAncestors:Fe,scrollableAncestorRects:f,measuringConfiguration:Pe,measuringScheduled:Ke,windowRect:xe}),[_,$e,Ae,ne,De,Ce,re,R,I,ue,S,Re,Fe,f,Pe,Ke,xe]),N=o.useMemo(()=>({activatorEvent:ne,activators:T,active:_,activeNodeRect:Ae,ariaDescribedById:{draggable:ae},dispatch:D,draggableNodes:R,over:S,measureDroppableContainers:Re}),[ne,T,_,Ae,D,ae,R,S,Re]);return o.createElement(Lr.Provider,{value:U},o.createElement(wn.Provider,{value:N},o.createElement(el.Provider,{value:b},o.createElement($n.Provider,{value:O},v)),o.createElement(Ui,{disabled:d?.restoreFocus===!1})),o.createElement(Ci,{...d,hiddenTextDescribedById:ae}))}),$i=o.createContext(null),ur="button";function Wi(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=yn("Draggable"),{activators:d,activatorEvent:m,active:v,activeNodeRect:g,ariaDescribedById:k,draggableNodes:h,over:p}=o.useContext(wn),{role:M=ur,roleDescription:x="draggable",tabIndex:A=0}=a??{},D=v?.id===t,G=o.useContext(D?$n:$i),[U,F]=zn(),[V,y]=zn(),w=(function(j,I){return o.useMemo(()=>j.reduce((E,W)=>{let{eventName:_,handler:P}=W;return E[_]=B=>{P(B,I)},E},{}),[j,I])})(d,t),R=pn(n);return Rt(()=>(h.set(t,{id:t,key:l,node:U,activatorNode:V,data:R}),()=>{const j=h.get(t);j&&j.key===l&&h.delete(t)}),[h,t]),{active:v,activatorEvent:m,activeNodeRect:g,attributes:o.useMemo(()=>({role:M,tabIndex:A,"aria-disabled":i,"aria-pressed":!(!D||M!==ur)||void 0,"aria-roledescription":x,"aria-describedby":k.draggable}),[i,M,A,D,x,k.draggable]),isDragging:D,listeners:i?void 0:w,node:U,over:p,setNodeRef:F,setActivatorNodeRef:y,transform:G}}function nl(){return o.useContext(el)}const Gi={timeout:25};function _i(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,d]=o.useState(null),m=Nn(n);return n||i||!m||a(m),Rt(()=>{if(!l)return;const v=i?.key,g=i?.props.id;v!=null&&g!=null?Promise.resolve(t(g,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:d}):null)}const Zi={x:0,y:0,scaleX:1,scaleY:1};function Xi(e){let{children:t}=e;return o.createElement(wn.Provider,{value:Qr},o.createElement($n.Provider,{value:Zi},t))}const Yi={position:"fixed",touchAction:"none"},Ji=e=>Un(e)?"transform 250ms ease":void 0,Qi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:d,rect:m,style:v,transform:g,transition:k=Ji}=e;if(!m)return null;const h=a?g:{...g,scaleX:1,scaleY:1},p={...Yi,width:m.width,height:m.height,top:m.top,left:m.left,transform:Ot.Transform.toString(h),transformOrigin:a&&i?bi(i,m):void 0,transition:typeof k=="function"?k(i):k,...v};return o.createElement(n,{className:d,style:p,ref:t},l)}),ea=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:d}=e;if(l!=null&&l.active)for(const[m,v]of Object.entries(l.active))v!==void 0&&(a[m]=n.node.style.getPropertyValue(m),n.node.style.setProperty(m,v));if(l!=null&&l.dragOverlay)for(const[m,v]of Object.entries(l.dragOverlay))v!==void 0&&i.node.style.setProperty(m,v);return d!=null&&d.active&&n.node.classList.add(d.active),d!=null&&d.dragOverlay&&i.node.classList.add(d.dragOverlay),function(){for(const[m,v]of Object.entries(a))n.node.style.setProperty(m,v);d!=null&&d.active&&n.node.classList.remove(d.active)}},ol={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Ot.Transform.toString(t)},{transform:Ot.Transform.toString(n)}]},sideEffects:ea({styles:{active:{opacity:"0"}}})};function ta(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Hn((l,d)=>{if(t===null)return;const m=n.get(l);if(!m)return;const v=m.node.current;if(!v)return;const g=Jr(d);if(!g)return;const{transform:k}=ft(d).getComputedStyle(d),h=Vr(k);if(!h)return;const p=typeof t=="function"?t:(function(M){const{duration:x,easing:A,sideEffects:D,keyframes:G}={...ol,...M};return U=>{let{active:F,dragOverlay:V,transform:y,...w}=U;if(!x)return;const R={x:V.rect.left-F.rect.left,y:V.rect.top-F.rect.top},j={scaleX:y.scaleX!==1?F.rect.width*y.scaleX/V.rect.width:1,scaleY:y.scaleY!==1?F.rect.height*y.scaleY/V.rect.height:1},I={x:y.x-R.x,y:y.y-R.y,...j},E=G({...w,active:F,dragOverlay:V,transform:{initial:y,final:I}}),[W]=E,_=E[E.length-1];if(JSON.stringify(W)===JSON.stringify(_))return;const P=D?.({active:F,dragOverlay:V,...w}),B=V.node.animate(E,{duration:x,easing:A,fill:"forwards"});return new Promise(K=>{B.onfinish=()=>{P?.(),K()}})}})(t);return Gr(v,a.draggable.measure),p({active:{id:l,data:m.data,node:v,rect:a.draggable.measure(v)},draggableNodes:n,dragOverlay:{node:d,rect:a.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:a,transform:h})})}let gr=0;function na(e){return o.useMemo(()=>{if(e!=null)return gr++,gr},[e])}const oa=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:d,wrapperElement:m="div",className:v,zIndex:g=999}=e;const{activatorEvent:k,active:h,activeNodeRect:p,containerNodeRect:M,draggableNodes:x,droppableContainers:A,dragOverlay:D,over:G,measuringConfiguration:U,scrollableAncestors:F,scrollableAncestorRects:V,windowRect:y}=nl(),w=o.useContext($n),R=na(h?.id),j=tl(d,{activatorEvent:k,active:h,activeNodeRect:p,containerNodeRect:M,draggingNodeRect:D.rect,over:G,overlayNodeRect:D.rect,scrollableAncestors:F,scrollableAncestorRects:V,transform:w,windowRect:y}),I=vo(p),E=ta({config:i,draggableNodes:x,droppableContainers:A,measuringConfiguration:U}),W=I?D.setRef:void 0;return o.createElement(Xi,null,o.createElement(_i,{animation:E},h&&R?o.createElement(Qi,{key:R,id:h.id,ref:W,as:m,activatorEvent:k,adjustScale:t,className:v,transition:l,rect:I,style:{zIndex:g,...a},transform:j},n):null))});function Ro(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ra(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function En(e){return e!==null&&e>=0}const Fn={scaleX:1,scaleY:1},la=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:d}=e;const m=(t=n[a])!=null?t:i;if(!m)return null;const v=(function(g,k,h){const p=g[k],M=g[k-1],x=g[k+1];return!p||!M&&!x?0:h<k?M?p.left-(M.left+M.width):x.left-(p.left+p.width):x?x.left-(p.left+p.width):p.left-(M.left+M.width)})(n,d,a);if(d===a){const g=n[l];return g?{x:a<l?g.left+g.width-(m.left+m.width):g.left-m.left,y:0,...Fn}:null}return d>a&&d<=l?{x:-m.width-v,y:0,...Fn}:d<a&&d>=l?{x:m.width+v,y:0,...Fn}:{x:0,y:0,...Fn}},ko=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=Ro(t,i,n),d=t[a],m=l[a];return m&&d?{x:m.left-d.left,y:m.top-d.top,scaleX:m.width/d.width,scaleY:m.height/d.height}:null},rl="Sortable",ll=o.createContext({activeIndex:-1,containerId:rl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ko,disabled:{draggable:!1,droppable:!1}});function ia(e){let{children:t,id:n,items:i,strategy:a=ko,disabled:l=!1}=e;const{active:d,dragOverlay:m,droppableRects:v,over:g,measureDroppableContainers:k}=nl(),h=yn(rl,n),p=m.rect!==null,M=o.useMemo(()=>i.map(w=>typeof w=="object"&&"id"in w?w.id:w),[i]),x=d!=null,A=d?M.indexOf(d.id):-1,D=g?M.indexOf(g.id):-1,G=o.useRef(M),U=!(function(w,R){if(w===R)return!0;if(w.length!==R.length)return!1;for(let j=0;j<w.length;j++)if(w[j]!==R[j])return!1;return!0})(M,G.current),F=D!==-1&&A===-1||U,V=(function(w){return typeof w=="boolean"?{draggable:w,droppable:w}:w})(l);Rt(()=>{U&&x&&k(M)},[U,M,x,k]),o.useEffect(()=>{G.current=M},[M]);const y=o.useMemo(()=>({activeIndex:A,containerId:h,disabled:V,disableTransforms:F,items:M,overIndex:D,useDragOverlay:p,sortedRects:ra(M,v),strategy:a}),[A,h,V.draggable,V.droppable,F,M,D,v,p,a]);return o.createElement(ll.Provider,{value:y},t)}const aa=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return Ro(n,i,a).indexOf(t)},sa=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:d,previousItems:m,previousContainerId:v,transition:g}=e;return!(!g||!i)&&(m===l||a!==d)&&(!!n||d!==a&&t===v)},da={duration:200,easing:"ease"},il="transform",ca=Ot.Transition.toString({property:il,duration:0,easing:"linear"}),ua={roleDescription:"sortable"};function ga(e){let{animateLayoutChanges:t=sa,attributes:n,disabled:i,data:a,getNewIndex:l=aa,id:d,strategy:m,resizeObserverConfig:v,transition:g=da}=e;const{items:k,containerId:h,activeIndex:p,disabled:M,disableTransforms:x,sortedRects:A,overIndex:D,useDragOverlay:G,strategy:U}=o.useContext(ll),F=(function(Z,re){var oe,he;return typeof Z=="boolean"?{draggable:Z,droppable:!1}:{draggable:(oe=Z?.draggable)!=null?oe:re.draggable,droppable:(he=Z?.droppable)!=null?he:re.droppable}})(i,M),V=k.indexOf(d),y=o.useMemo(()=>({sortable:{containerId:h,index:V,items:k},...a}),[h,a,V,k]),w=o.useMemo(()=>k.slice(k.indexOf(d)),[k,d]),{rect:R,node:j,isOver:I,setNodeRef:E}=(function(Z){let{data:re,disabled:oe=!1,id:he,resizeObserverConfig:Me}=Z;const de=yn("Droppable"),{active:be,dispatch:xe,over:Fe,measureDroppableContainers:f}=o.useContext(wn),Le=o.useRef({disabled:oe}),Xe=o.useRef(!1),Ue=o.useRef(null),Q=o.useRef(null),{disabled:qe,updateMeasurementsFor:je,timeout:Te}={...Gi,...Me},De=pn(je??he),ze=Bn({callback:o.useCallback(()=>{Xe.current?(Q.current!=null&&clearTimeout(Q.current),Q.current=setTimeout(()=>{f(Array.isArray(De.current)?De.current:[De.current]),Q.current=null},Te)):Xe.current=!0},[Te]),disabled:qe||!be}),S=o.useCallback((c,q)=>{ze&&(q&&(ze.unobserve(q),Xe.current=!1),c&&ze.observe(c))},[ze]),[le,O]=zn(S),Y=pn(re);return o.useEffect(()=>{ze&&le.current&&(ze.disconnect(),Xe.current=!1,ze.observe(le.current))},[le,ze]),o.useEffect(()=>(xe({type:ct.RegisterDroppable,element:{id:he,key:de,disabled:oe,node:le,rect:Ue,data:Y}}),()=>xe({type:ct.UnregisterDroppable,key:de,id:he})),[he]),o.useEffect(()=>{oe!==Le.current.disabled&&(xe({type:ct.SetDroppableDisabled,id:he,key:de,disabled:oe}),Le.current.disabled=oe)},[he,de,oe,xe]),{active:be,rect:Ue,isOver:Fe?.id===he,node:le,over:Fe,setNodeRef:O}})({id:d,data:y,disabled:F.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...v}}),{active:W,activatorEvent:_,activeNodeRect:P,attributes:B,setNodeRef:K,listeners:ne,isDragging:L,over:z,setActivatorNodeRef:ae,transform:ve}=Wi({id:d,data:y,attributes:{...ua,...n},disabled:F.draggable}),Pe=(function(){for(var Z=arguments.length,re=new Array(Z),oe=0;oe<Z;oe++)re[oe]=arguments[oe];return o.useMemo(()=>he=>{re.forEach(Me=>Me(he))},re)})(E,K),Se=!!W,ue=Se&&!x&&En(p)&&En(D),Re=!G&&L,Ke=Re&&ue?ve:null,$e=ue?Ke??(m??U)({rects:A,activeNodeRect:P,activeIndex:p,overIndex:D,index:V}):null,Ie=En(p)&&En(D)?l({id:d,items:k,activeIndex:p,overIndex:D}):V,me=W?.id,$=o.useRef({activeId:me,items:k,newIndex:Ie,containerId:h}),Ae=k!==$.current.items,Ce=t({active:W,containerId:h,isDragging:L,isSorting:Se,id:d,index:V,items:k,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:g,wasDragging:$.current.activeId!=null}),J=(function(Z){let{disabled:re,index:oe,node:he,rect:Me}=Z;const[de,be]=o.useState(null),xe=o.useRef(oe);return Rt(()=>{if(!re&&oe!==xe.current&&he.current){const Fe=Me.current;if(Fe){const f=Yt(he.current,{ignoreTransform:!0}),Le={x:Fe.left-f.left,y:Fe.top-f.top,scaleX:Fe.width/f.width,scaleY:Fe.height/f.height};(Le.x||Le.y)&&be(Le)}}oe!==xe.current&&(xe.current=oe)},[re,oe,he,Me]),o.useEffect(()=>{de&&be(null)},[de]),de})({disabled:!Ce,index:V,node:j,rect:R});return o.useEffect(()=>{Se&&$.current.newIndex!==Ie&&($.current.newIndex=Ie),h!==$.current.containerId&&($.current.containerId=h),k!==$.current.items&&($.current.items=k)},[Se,Ie,h,k]),o.useEffect(()=>{if(me===$.current.activeId)return;if(me!=null&&$.current.activeId==null)return void($.current.activeId=me);const Z=setTimeout(()=>{$.current.activeId=me},50);return()=>clearTimeout(Z)},[me]),{active:W,activeIndex:p,attributes:B,data:y,rect:R,index:V,newIndex:Ie,items:k,isOver:I,isSorting:Se,isDragging:L,listeners:ne,node:j,overIndex:D,over:z,setNodeRef:Pe,setActivatorNodeRef:ae,setDroppableNodeRef:E,setDraggableNodeRef:K,transform:J??$e,transition:(function(){if(J||Ae&&$.current.newIndex===V)return ca;if(!(Re&&!Un(_)||!g)&&(Se||Ce))return Ot.Transition.toString({...g,property:il})})()}}function Vn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ha=[Je.Down,Je.Right,Je.Up,Je.Left],ma=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:d,scrollableAncestors:m}}=t;if(ha.includes(e.code)){if(e.preventDefault(),!n||!i)return;const v=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const p=a.get(h.id);if(p)switch(e.code){case Je.Down:i.top<p.top&&v.push(h);break;case Je.Up:i.top>p.top&&v.push(h);break;case Je.Left:i.left>p.left&&v.push(h);break;case Je.Right:i.left<p.left&&v.push(h)}});const g=(h=>{let{collisionRect:p,droppableRects:M,droppableContainers:x}=h;const A=Jo(p),D=[];for(const G of x){const{id:U}=G,F=M.get(U);if(F){const V=Jo(F),y=A.reduce((R,j,I)=>R+Or(V[I],j),0),w=Number((y/4).toFixed(4));D.push({id:U,data:{droppableContainer:G,value:w}})}}return D.sort(jr)})({collisionRect:i,droppableRects:a,droppableContainers:v});let k=Br(g,"id");if(k===d?.id&&g.length>1&&(k=g[1].id),k!=null){const h=l.get(n.id),p=l.get(k),M=p?a.get(p.id):null,x=p?.node.current;if(x&&M&&h&&p){const A=Kn(x).some((V,y)=>m[y]!==V),D=hr(h,p),G=(function(V,y){return!Vn(V)||!Vn(y)||!hr(V,y)?!1:V.data.current.sortable.index<y.data.current.sortable.index})(h,p),U=A||!D?{x:0,y:0}:{x:G?i.width-M.width:0,y:G?i.height-M.height:0},F={x:M.left,y:M.top};return U.x&&U.y?F:vn(F,U)}}}};function hr(e,t){return!(!Vn(e)||!Vn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const fa=e=>{let{transform:t}=e;return{...t,y:0}},al=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:d,editable:m,selectedIndex:v,background:g,activeColor:k,borderColor:h,borderWidth:p,dragging:M,...x}=e;return u.jsxs("div",{ref:t,className:yt(a),style:{...i,display:"flex",flexDirection:"column",background:v===l?"white":g,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:v===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...x,children:[u.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[u.jsx("div",{style:{marginLeft:v===l?"0px":"-1px",marginTop:v===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,v===l?u.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):u.jsx(u.Fragment,{})]}),u.jsx("div",{style:{flex:"1 1 100%",background:v===l&&k?k?.toCSS():"none",minHeight:"2px"}})]})})),St={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"},Mo=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:d,index:m,listeners:v,onRemove:g,renderItem:k,sorting:h,style:p,transition:M,transform:x,value:A,wrapperStyle:D,...G},U)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const F=k?k({dragOverlay:!!t,dragging:!!n,sorting:!!h,index:m,fadeIn:!!a,listeners:v,ref:U,style:p,transform:x,transition:M,value:A}):u.jsx(u.Fragment,{children:A});return u.jsx("div",{className:yt("tab-item",St.Wrapper,a&&St.fadeIn,h&&St.sorting,t&&St.dragOverlay),style:{...D,transition:[M,D?.transition].filter(Boolean).join(", "),"--translate-x":x?`${Math.round(x.x)}px`:void 0,"--translate-y":x?`${Math.round(x.y)}px`:void 0,"--scale-x":x?.scaleX?`${x.scaleX}`:void 0,"--scale-y":x?.scaleY?`${x.scaleY}`:void 0,"--index":m},ref:U,children:u.jsx("div",{className:yt(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:p,"data-cypress":"draggable-item",...l?void 0:v,...G,tabIndex:l?void 0:-1,children:F})})})),mr={Row:"_Row_1kr10_1"},sl=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>u.jsx("div",{ref:i,style:{...n},className:yt(mr.Row,t&&mr.horizontal),children:e}))),pa={...ol},va=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:d=wi,coordinateGetter:m=ma,dropAnimation:v=pa,getItemStyles:g=()=>({}),getNewIndex:k,handle:h=!1,items:p,onMove:M,isDisabled:x=()=>!1,measuring:A,modifiers:D,renderItem:G,renderDivider:U,reorderItems:F=Ro,strategy:V=ko,style:y,useDragOverlay:w=!0,onDragStart:R,wrapperStyle:j=()=>({})}=e,[I,E]=o.useState(()=>p);o.useEffect(()=>{E(p)},[p]);const[W,_]=o.useState(null),P=(function(){for(var z=arguments.length,ae=new Array(z),ve=0;ve<z;ve++)ae[ve]=arguments[ve];return o.useMemo(()=>[...ae].filter(Pe=>Pe!=null),[...ae])})(io(Xr,{activationConstraint:i}),io(Yr,{activationConstraint:i}),io(qo,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:m})),B=I.indexOf.bind(I),K=W?B(W):-1,ne=[];I.map((z,ae)=>{ne.push(u.jsx(Ca,{id:z,handle:h,index:ae,style:g,wrapperStyle:j,disabled:x(z),renderItem:G,animateLayoutChanges:a,useDragOverlay:w,getNewIndex:k},z+"-"+ae));const ve=U?.({key:"divider-"+ae});ve&&ne.push(ve)});const{getPortalContainer:L}=r.useFullscreenPortal();return u.jsxs(Ki,{sensors:P,collisionDetection:d,onDragStart:z=>{const{active:ae}=z;ae&&(R?.(z),_(ae.id))},autoScroll:{canScroll:z=>!0},onDragEnd:z=>{if(_(null),z.over){const ae=B(z.over.id);K!==ae&&(E(ve=>F(ve,K,ae)),M?.(K,ae))}},onDragCancel:()=>{_(null)},measuring:A,modifiers:D,children:[u.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...y},className:yt(n,St.Wrapper),children:u.jsx(ia,{items:I,strategy:V,children:u.jsx(sl,{ref:t,children:ne})})}),w?Nt.createPortal(u.jsx(oa,{adjustScale:l,dropAnimation:v,children:W?u.jsx(Mo,{value:I[K],handle:h,renderItem:G,wrapperStyle:j({index:K,isDragging:!0,id:I[K]}),index:K,dragging:!0,style:g({id:I[K],index:K,isSorting:W!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),L()):null]})}));function Ca({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:d,style:m,renderItem:v,useDragOverlay:g,wrapperStyle:k}){const{attributes:h,isDragging:p,isSorting:M,listeners:x,overIndex:A,setNodeRef:D,transform:G,transition:U}=ga({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return u.jsx(Mo,{ref:D,value:a,disabled:e,dragging:p,sorting:M,handle:i,renderItem:v,index:l,style:m({index:l,id:a,isDragging:p,isSorting:M,overIndex:A}),onRemove:d?()=>d(a):void 0,transform:G,transition:U,wrapperStyle:k({index:l,isDragging:p,id:a}),listeners:x,"data-index":l,"data-id":a,dragOverlay:!g&&p,...h})}const ba="_TabStrip_3x0dp_1",ya=new s.Color("rgb(33, 115, 70)"),wa="#eee",xa=e=>u.jsx(al,{...e}),dl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:d=[],onSelectedTabIndexChange:m,onTabNameChange:v,onTabMove:g,createScrollStartButton:k=r.defaultCreateScrollStartButton,createScrollEndButton:h=r.defaultCreateScrollEndButton,createScrollEdgeButton:p=r.defaultCreateScrollEdgeButton,createTabButton:M=xa,createTabDivider:x,editLabelProps:A,disabled:D=!1,disableDrag:G=!1,background:U="white",activeColor:F=ya,borderColor:V=wa,borderWidth:y=1}=e,[w,R]=o.useState(l),[j,I]=o.useState(d),E=o.useCallback(de=>{const be=L.current?.[de]?.closest(".tab-item")??L.current?.[de];be&&Re.current?.scrollTo({top:be.offsetTop,left:be.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{E(l)},[l]);const W=o.useCallback((de,be)=>{be!==w&&(R(be),m?.(be)),E(be)},[m,w]),_=o.useCallback((de,be)=>{g?.(de,be)},[g]),P=o.useRef(null),[B,K]=o.useState(-1),ne=o.useCallback((de,be)=>{v?.(de,be)},[v]);o.useLayoutEffect(()=>{R(l)},[l]),o.useLayoutEffect(()=>{I(d)},[d]);const L=o.useRef([]),z=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(de){L.current?.[de]?.startEdit()},cancel(de){L.current?.[de]?.cancel()}},z.current),[w,B]);const ae=o.useCallback(({value:de,index:be,dragging:xe})=>{const{style:Fe,maxLength:f,...Le}=A||{},Xe=u.jsx(Dr,{ref:Ue=>{L.current[be]=Ue},value:de,disabled:D,maxLength:f,style:{color:w===be&&F?F?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...Fe},styleHover:{},onSubmit:Ue=>(P.current=!1,K(-1),ne(be,Ue)),onCancel:()=>{P.current=!1,K(-1)},onChange:Ue=>{P.current=!0,K(be)},...Le});return M({onClick:Ue=>W(Ue,be),value:de,index:be,editing:B===be&&P.current,editable:!0,disabled:D,selectedIndex:w,background:U,activeColor:F,borderColor:V,borderWidth:y,dragging:xe,children:Xe})},[w,ne,W,A,D,B,M]),[ve,{width:Pe}]=Lt(),[Se,{width:ue}]=Lt(),Re=o.useRef(null),[Ke,$e]=o.useState({left:0,top:0,width:0,height:0}),[Ie,me]=o.useState(null);o.useEffect(()=>{Ie!==null&&Re.current&&Re.current.scrollTo({left:Ie,behavior:"smooth"})},[Ie]);const $=o.useCallback((de,be=!1)=>{if(!Re.current)return 0;let xe=Re.current.firstChild.getBoundingClientRect(),Fe=Re.current.firstChild.firstChild.children,f=0;return f=be?0:r.ScrollUtils.getScrollTo(de,xe.left,Fe,!0,Math.max(0,de-200)),me(f),Math.max(0,f)},[]),Ae=o.useCallback((de,be=!1)=>{if(!Re.current)return 0;let xe=Re.current.firstChild.getBoundingClientRect(),Fe=Re.current.firstChild.firstChild.children,f=0;const Le=Math.ceil(ue-Pe);return f=be?Le:r.ScrollUtils.getScrollTo(de,xe.left,Fe,!1,Math.max(0,de+200)),me(f),Math.min(Le,f)},[ue,Pe]),Ce=o.useRef(null),J=o.useRef(null),Z=o.useCallback(()=>{J.current&&(clearTimeout(J.current),J.current=null,Ce.current=null)},[]),re=o.useCallback((de,be,xe=260)=>{Ce.current=de,J.current=setTimeout(()=>{const Fe=be?$(Ce.current||de):Ae(Ce.current||de);Fe!==Ce.current?re(Fe,be,120):Z()},xe)},[$,Ae,Z]);o.useEffect(()=>()=>Z(),[Z]);const oe=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Ke.left)<=0||Math.floor(ue-Pe)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:Z,onMouseLeave:Z,onMouseDown:()=>re(Re.current.scrollLeft,!0),onClick:de=>$(Math.min(Re.current.scrollLeft,Ie??Number.MAX_SAFE_INTEGER),de.ctrlKey)}),[Ke,Ie,ue,Pe]),he=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(ue-Pe)<=Math.ceil(Ke.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:Z,onMouseLeave:Z,onMouseDown:()=>re(Re.current.scrollLeft,!1),onClick:de=>Ae(Math.max(Re.current.scrollLeft,Ie??0),de.ctrlKey)}),[Ke,Ie,ue,Pe]),Me=o.useMemo(()=>u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{minWidth:"16px"}}),n,p?.(oe)]}),[oe,he,k,h,n,p]);return u.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:yt(ba,a),ref:z,children:[u.jsx("div",{style:{borderTop:`solid ${V} ${y}px`,position:"absolute",width:"100%"}}),u.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Me}),u.jsx("div",{className:"Tabs",ref:ve,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:u.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:Re,onScroll:de=>{$e({left:de.target.scrollLeft,top:de.target.scrollTop,width:de.target.scrollWidth,height:de.target.scrollHeight})},children:u.jsx(va,{isDisabled:de=>D||G,items:j,strategy:la,modifiers:[fa],ref:Se,renderItem:ae,renderDivider:x,onMove:_,activationConstraint:{distance:15}})})}),u.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:p(he)})]})}));dl.displayName="TabStrip";const Dn=o.createContext(null);Dn.displayName="DocThemesContext";const qa="_script-editor_iy654_5",Sa=o.lazy(()=>Promise.resolve().then(()=>require("./B1UnDlBR51kzjMX0.cjs"))),Ra={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:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"};let sn,dn,Ft=["define","require"];const fr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),d=await l.getNavigationTree(i.uri.toString()),m=e.getPosition();let v={...m};v.lineNumber=1,v.column=1;let g=!1;for(let A=m.lineNumber;A>=1;A--)if(i.getLineContent(A).trim()===""){const D=To(d,i.getOffsetAt({lineNumber:A,column:1}),"function");if(!D||Ma(D)){g=!0,v.lineNumber=A+1;break}{const G=D.spans[0].start;A=i.getPositionAt(G).lineNumber,v.lineNumber=A}}let k=n,h=!1;!g&&!k.startsWith(`
28
+ `)&&v.lineNumber>1&&(k=`
29
+ `+k,h=!0);let p=!1;i.getLineCount()>1&&(k.endsWith(`
30
30
 
31
- `)||(x+=`
31
+ `)||(k+=`
32
32
 
33
- `,f=!0));const T=[{range:new t.Range(p.lineNumber,p.column,p.lineNumber,p.column),text:`${x}`}];let q=null;i.pushEditOperations([],T,A=>(q=A[0].range,h&&q.startLineNumber++,f&&q.endLineNumber--,[new t.Selection(q.startLineNumber,q.startColumn,q.endLineNumber,q.endColumn)])),e.setSelection({startLineNumber:q.endLineNumber,startColumn:q.endColumn,endLineNumber:q.startLineNumber,endColumn:q.startColumn})};function ka(e,t){let n=null;for(let i=0;!n&&i<e.length;i++){const a=e[i];a.getName()===t.text&&(n=a)}return n?n.getContext():"formula"}function Co(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,d=e.getPositionAt(l);a.push({name:i.text,type:ka(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)Co(e,t,n,l,a);return a}function To(e,t,n="function",i){const a=e.spans;for(let l=0;l<a.length;l++){const d=a[l];if(d.start<=t&&t<d.start+d.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const m of e.childItems||[]){const p=To(m,t,n,i);if(p)return p}}return null}}function Ma(e){return e.kind==="comment"}const Ta=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:p,autoFocus:g=!0,onStatusChange:x,...h}=e,f=o.useRef(null),T=r.useCallbackRef(d,[d]),q=o.useRef(!1),A=o.useMemo(()=>({contains(K){if(!f.current)return;const W=f.current.editor;return W&&W.getDomNode()?.contains(K)},focus(){if(!f.current)return;const K=f.current.editor;return K&&K.getDomNode()?.focus()}}),[]),D=o.useMemo(()=>[new r.Command("help",A,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),G=o.useMemo(()=>{let K=null;const W=()=>A;return K=a?a.createChildGroup(W,"scriptEditor",!1):new r.CommandGroup(W,"scriptEditor"),K.addCommands(D,!0),K},[a,D]),U=r.useCommands(G,["executeSelectedScript"])[0],y=U?.context(),B=r.useCallbackRef(K=>{U?.execute(K)},[U]),S=o.useRef(""),[w,k]=o.useState(!1),O=r.useCallbackRef(async()=>{if(!f.current)return null;const K=f.current,W=K.editor;if(!W)return null;const ge=K.monaco,ae=await(async(Q,X,be="export")=>{const ke=Q.getModel();if(!ke)return null;const ve=await X.languages.typescript.getTypeScriptWorker(),Pe=await ve(ke.uri),he=await Pe.getNavigationTree(ke.uri.toString());let He=null,Se=Q.getSelection();const ce=Se.startLineNumber===Se.endLineNumber&&Se.startColumn===Se.endColumn?ke.getLineCount():Math.min(Se.endLineNumber,ke.getLineCount());for(let de=Se.startLineNumber;!He&&de<=ce;de++){const me=To(he,ke.getOffsetAt({lineNumber:de,column:1}),"function",be);me&&(He=me.text)}return He})(W,ge);return x?.({message:(ae??"").toUpperCase()}),ae?{source:W.getValue(),name:ae}:null},[x]),E=r.useCallbackRef(async(K,W,ge)=>{const ae=await y.getScripts().createModule({source:ge?.getValue(),declarationsOnly:!0}),Q=ae?ae.getFunctions().getItems():ue.CommonUtils.EmptyArray;ae&&(async function(X,be){const ke=[];for(let ve=1;ve<X.getLineCount()+1;ve++){const Pe={startLineNumber:ve,startColumn:1,endLineNumber:ve,endColumn:X.getLineLength(ve)+1},he=X.getValueInRange(Pe).indexOf("modelt");he!==-1&&ke.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:be.MarkerSeverity.Hint,startLineNumber:Pe.startLineNumber,startColumn:he+1,endLineNumber:Pe.startLineNumber,endColumn:he+5})}be.editor.setModelMarkers(X,"owner",ke)}(K,W),async function(X,be,ke,ve){const Pe=await be.languages.typescript.getTypeScriptWorker(),he=await Pe(X.uri),He=await he.getNavigationTree(X.uri.toString()),Se=Co(X,be,ve,He).map(ce=>{let de=null,me=null;return ce.type==="formula"?(de="formula.margin-icon",me="Formula"):ce.type==="macro"?(de="macro.margin-icon",me="Macro"):ce.type==="autoRun"&&(de="autorun.margin-icon",me="Auto Run"),{range:new be.Range(ce.lineNumber,1,ce.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:de,glyphMarginHoverMessage:{value:me},stickiness:be.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});V.current&&V.current.clear(),V.current=ke.createDecorationsCollection(Se)}(K,W,ge,Q))},[y]),F=r.useCallbackRef(ue.CommonUtils.debounce(E,580),[]),Z=r.useCallbackRef(async(K=void 0)=>{if(!f.current||!y)return;const W=f.current.editor.getPosition(),ge={cursor:W?W.toString():""};K!==void 0&&(ge.message=K),x?.(ge);const ae=O();y.setSelectedFunction(ae)},[y,x]),_=o.useRef(null);o.useEffect(()=>{if(!y)return;const K={insertSnippet:ge=>{f.current?.editor&&(w?fr(f.current.editor,f.current.monaco,ge):S.current=ge)}};y.setEditor(K),y.setSelectedFunction(O());const W=y.addContainerListener({onBeforeSave:async()=>{if(!f.current?.editor||!y)return;const ge=f.current.editor,ae=y?.getScripts().getModules().getByName("scripting"),Q=ae?.getSource(),X=ge.getValue();if(!((Q?.length??0)!==X.length||Q!==X))return;await y.saveSource(ge.getValue());const be=(Q?.length??0)!==X.length||Q!==X;x?.({dirty:be})},onReadonlyChange(){},onScriptChange:async()=>{if(!f.current?.editor||!y)return;const ge=f.current.editor,ae=y.getScripts().getModules().getItems()[0]?.getSource()??"";ge.setValue(ae)}});return()=>{W(),y.setSelectedFunction(null),y.setEditor(null);const ge=_.current;if(ge){ge.dispose();const ae=ge.debounceTimer;ae!==void 0&&clearTimeout(ae),_.current=null}}},[y,w]),o.useEffect(()=>()=>{if(!f.current?.editor)return;const K=f.current.editor;y?.saveSource(K.getValue())},[]);const P=r.useCallbackRef(K=>{const W=f.current;if(!W)return!1;const ge=W.editor;return!!ge&&(ge.focus(),!0)},[]),V=o.useRef(null),$=r.useCallbackRef((K,W)=>{f.current={monaco:W,editor:K},k(!0),Z("Loading Types");const ge=y.getScripts().getModules().getItems()[0]?.getSource()??"";K.setValue(ge),Promise.resolve().then(()=>require("./COCkgm8-fe2c7LYP.cjs")).then(Q=>Q.customEditor).then(async Q=>{Z(""),Q.AutoTypings.create(K,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:W,onUpdate:(X,be)=>{if(X.type==="LookedUpPackage"&&X.success!==void 0){const ke=W.languages.typescript.typescriptDefaults.getDiagnosticsOptions();W.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ke,diagnosticCodesToIgnore:[]})}},onError:X=>{X==="Not implemented yet"&&(X="Compile Errors"),console.warn("Error compiling types",X)}}).then(X=>{_.current=X;const be=K.getModel();F(be,W,K)})}),K.addCommand("executeScript",function(Q,...X){X?.[0]&&B({functionName:X?.[0]})},""),K.addAction({id:"executeScript",label:"Execute",keybindings:[W.KeyCode.F8],run:async Q=>{const X=O();y.setSelectedFunction(X);const be=await X;B(be)}}),K.addAction({id:"saveScript",label:"Save Script",keybindings:[W.KeyMod.CtrlCmd|W.KeyCode.KeyS],run:Q=>{y?.saveSource(K.getValue()).then(()=>{const X=y?.getScripts().getModules().getByName("scripting"),be=X?.getSource(),ke=K.getValue(),ve=(be?.length??0)!==ke.length||be!==ke;x?.({dirty:ve})})}}),K.onMouseDown(async Q=>{if(Q.target.type===W.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const X=Q.target.position.lineNumber,be=await W.languages.typescript.getTypeScriptWorker(),ke=await be(ae.uri),ve=await ke.getNavigationTree(ae.uri.toString()),Pe=K?.getValue(),he=(await y?.saveSource(Pe)).getFunctions().getItems(),He=Co(ae,W,he,ve).find(Se=>Se.lineNumber===X);if(He){const Se=Q.event.browserEvent.button;Se===0?He.type==="macro"||He.type==="autoRun"?B({functionName:He.name}):He.type==="formula"&&y.quickInsertFunction?.(He.name):Se===2&&(console.log("Context menu for function:",He.name),Q.event.browserEvent.preventDefault())}}}),K.onDidChangeModelContent(()=>{F(ae,W,K)}),W.editor.onDidChangeMarkers(Q=>{Q.some(X=>X.toString()===ae.uri.toString())});const ae=K.getModel();(function(Q,X){X.languages.registerInlayHintsProvider("typescript",{provideInlayHints(be,ke,ve){const Pe=[];for(let he=1;he<be.getLineCount()+1;he++){const He={startLineNumber:he,startColumn:1,endLineNumber:he,endColumn:be.getLineLength(he)+1},Se="hint",ce=be.getValueInRange(He).indexOf("hint");ce!==-1&&Pe.push({kind:X.languages.InlayHintKind.Type,position:{lineNumber:He.startLineNumber,column:ce+Se.length+1},label:"[hint]"})}return{hints:Pe,dispose:()=>{}}}})})(0,W),ae.onDidChangeContent(Q=>{const X=y?.getScripts().getModules().getByName("scripting"),be=X?.getSource(),ke=K.getValue(),ve=(be?.length??0)!==ke.length||be!==ke;x?.({dirty:ve})}),K.onDidChangeCursorPosition(Q=>{Z()})},[y,x]),oe=o.useMemo(()=>w?null:p||c.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[w,p]),L=o.useMemo(()=>{if(!w){if(!sn){sn={};for(let W=0;W<Ft.length;W++){const ge=Ft[W];sn[ge]=globalThis[ge]}}if(dn)for(let W=0;W<Ft.length;W++){const ge=Ft[W];globalThis[ge]=dn[ge]}}const K=y?.getScripts().getModules().getByName("scripting")?.getSource()??"";return c.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[c.jsx(o.Suspense,{children:c.jsx(Sa,{theme:m?"extended-dark":"extended",options:{...Ra,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:K,onValidate:W=>{let ge=!1;for(let ae=0;!ge&&ae<W?.length;ae++)W[ae].severity===8&&(ge=!0)},beforeMount:W=>{W.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),W.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),W.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),W.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let ge=!1,ae=!1;try{const Q=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),X=W.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let be=W.editor.getModel(X);be?ae=!0:be=W.editor.createModel(Q,"typescript",X),W.editor.setModelMarkers(be,"default",[]),ge=!0}catch(Q){console.warn("cant load types",Q)}if(!ae){W.languages.registerLinkProvider("*",{provideLinks:(X,be)=>{const ke=[],ve={links:ke},Pe=X.getLinesContent();for(let he=1;he<=Pe.length;he++){const He=Pe[he-1],Se=W.editor.tokenize(He,"typescript");for(let ce=0;ce<Se[0].length;ce++){const de=Se[0]?.[ce];if(de&&de.type.startsWith("string")){let me=de.offset,Ce=Se[0]?.[ce+1]?.offset??He.length,xe=new W.Range(he,me+1,he,Ce+1),Me=X.getValueInRange(xe);const we=Me[0];we!=="`"&&we!=="'"&&we!=='"'||(me++,Me=Me.substring(1));const Ee=Me[Me.length-1];Ee!=="`"&&Ee!=="'"&&Ee!=='"'||(me++,Me=Me.substring(0,Me.length-1));try{y.getRanges(Me)&&ke.push({range:{endColumn:Ce,endLineNumber:he,startColumn:me,startLineNumber:he},tooltip:`Goto range '${Me}'`,url:`/range/${Me}`})}catch(Le){console.warn(Le)}}}}return ve}}),W.editor.registerLinkOpener({open(X){if(X?.path?.startsWith("/range/")){try{y.getRanges(X.path.substring(7))?.select()}catch(be){console.warn("invalid range",be)}return!0}return!1}});const Q=W.languages.typescript.typescriptDefaults.getCompilerOptions();W.languages.typescript.typescriptDefaults.setCompilerOptions({...Q,target:W.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:W.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(S.current&&(await fr(f.current.editor,f.current.monaco,S.current),S.current=null),q.current&&requestAnimationFrame(async()=>{q.current&&W.editor.focus()}),!dn){dn={};for(let Q=0;Q<Ft.length;Q++){const X=Ft[Q];dn[X]=globalThis[X]}}(()=>{const Q=(X,be)=>{try{if(be===void 0)try{delete globalThis[X]}catch{try{globalThis[X]=void 0}catch{}}else globalThis[X]=be}catch{}};for(let X=0;X<Ft.length;X++){const be=Ft[X];Q(be,sn[be])}sn=void 0})(),k(!0)})()},onMount:$})}),oe]})},[y,G,l,oe,m]),z=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:K=>{P(K)},close:()=>{T?.()},getEditor:()=>y?.getEditor()}),[y]);return o.useEffect(()=>(g&&requestAnimationFrame(()=>{P()}),()=>{f.current?.editor&&requestAnimationFrame(()=>{z.current?.contains(document.activeElement)&&P()})}),[]),c.jsx("div",{className:wt("script-editor",qa,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:z,...h,children:L})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>s.LicenseManager}),exports.ChartAreaIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),c.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"}),c.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"}),c.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),c.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"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),c.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"}),c.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),c.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"}),c.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.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"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.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"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),c.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"}),c.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),c.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),c.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"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),c.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"}),c.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),c.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=di,exports.ChartLineIcon=e=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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=>c.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[c.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"}),c.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"}),c.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"}),c.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=si,exports.CornerTriangle=go,exports.DateUtils=Cl,exports.DocThemesContext=Dn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return c.jsx(Dn.Provider,{value:t,children:n})},exports.EditableLabel=Dr,exports.EmptyFrame=Ql,exports.FilterButton=vr,exports.FontUtils=bl,exports.Item=Mo,exports.LogoNoPaddingIcon=e=>c.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[c.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"}),c.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"}),c.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"}),c.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=Sr,exports.MovableArea=Mr,exports.PictureEditor=Ar,exports.Row=sl,exports.ScriptEditor=Ta,exports.SheetCellEditor=br,exports.SheetCellRenderer=Cr,exports.SheetElement=Fr,exports.SheetScrollbar=wo,exports.StaticBorderRenderer=Il,exports.StyledStrokePath=yr,exports.Tab=al,exports.TabStrip=dl,exports.createCellEditStateFromCell=wr,exports.useBordersOverlay=bo,exports.useDocThemes=()=>{const e=o.useContext(Dn),[t]=o.useState(()=>new s.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=tt,exports.useMovableCommands=Tr,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const p={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(p)}const d=p=>{a.current?.(p)},m=e.getRange(t).addListener(d,i);if(l){const p=e.getRange(t);d({getSource:()=>p,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=Rr,exports.useSheetCopyPaste=kr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
33
+ `,p=!0));const M=[{range:new t.Range(v.lineNumber,v.column,v.lineNumber,v.column),text:`${k}`}];let x=null;i.pushEditOperations([],M,A=>(x=A[0].range,h&&x.startLineNumber++,p&&x.endLineNumber--,[new t.Selection(x.startLineNumber,x.startColumn,x.endLineNumber,x.endColumn)])),e.setSelection({startLineNumber:x.endLineNumber,startColumn:x.endColumn,endLineNumber:x.startLineNumber,endColumn:x.startColumn})};function ka(e,t){let n=null;for(let i=0;!n&&i<e.length;i++){const a=e[i];a.getName()===t.text&&(n=a)}return n?n.getContext():"formula"}function Co(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,d=e.getPositionAt(l);a.push({name:i.text,type:ka(n,i),lineNumber:d.lineNumber})}if(i.childItems)for(const l of i.childItems)Co(e,t,n,l,a);return a}function To(e,t,n="function",i){const a=e.spans;for(let l=0;l<a.length;l++){const d=a[l];if(d.start<=t&&t<d.start+d.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const m of e.childItems||[]){const v=To(m,t,n,i);if(v)return v}}return null}}function Ma(e){return e.kind==="comment"}const Ta=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,onClose:d,darkMode:m,loadingPanel:v,autoFocus:g=!0,onStatusChange:k,...h}=e,p=o.useRef(null),M=r.useCallbackRef(d,[d]),x=o.useRef(!1),A=o.useMemo(()=>({contains(me){if(!p.current)return;const $=p.current.editor;return $&&$.getDomNode()?.contains(me)},focus(){if(!p.current)return;const me=p.current.editor;return me&&me.getDomNode()?.focus()}}),[]),D=o.useMemo(()=>[new r.Command("help",A,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),G=o.useMemo(()=>{let me=null;const $=()=>A;return me=a?a.createChildGroup($,"scriptEditor",!1):new r.CommandGroup($,"scriptEditor"),me.addCommands(D,!0),me},[a,D]),U=r.useCommands(G,["executeSelectedScript","saveScripts"]),F=U[0],V=U[1],y=F?.context(),[w,R]=o.useState({message:"Loading",cursor:"",dirty:!1}),[j,I]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),E=r.useCallbackRef(me=>{R($=>{const Ae={...$,...me};return ge.CommonUtils.deepEqual(Ae,$)?$:(V.update({disabled:!Ae.dirty}).updateCallback(async()=>{await W()}),Ae)})},[k,V]);o.useEffect(()=>{k?.(w)},[k,w]);const W=r.useCallbackRef(async()=>{if(!p.current)return;const me=p.current.editor;let $;if(w.dirty){const Ae=me.getValue();await y?.saveSource(Ae),$=y?.getScripts().getModules().getByName("scripts");const Ce=$?.getSource(),J=me.getValue(),Z=(Ce?.length??0)!==Ae.length||Ce!==J;E({dirty:Z})}else $=y?.getScripts().getModules().getByName("scripts");return $},[w]);o.useEffect(()=>{const me=y?.getScripts();if(me)return me.addListeners({onBeforeSearch:()=>W()})},[y]);const _=r.useCallbackRef(me=>{F?.execute(me)},[F]),P=o.useRef(""),[B,K]=o.useState(!1),ne=r.useCallbackRef(async()=>{if(!p.current)return null;const me=p.current,$=me.editor;if(!$)return null;const Ae=me.monaco,Ce=await(async(J,Z,re="export")=>{const oe=J.getModel();if(!oe)return null;const he=await Z.languages.typescript.getTypeScriptWorker(),Me=await he(oe.uri),de=await Me.getNavigationTree(oe.uri.toString());let be=null,xe=J.getSelection();const Fe=xe.startLineNumber===xe.endLineNumber&&xe.startColumn===xe.endColumn?oe.getLineCount():Math.min(xe.endLineNumber,oe.getLineCount());for(let f=xe.startLineNumber;!be&&f<=Fe;f++){const Le=To(de,oe.getOffsetAt({lineNumber:f,column:1}),"function",re);Le&&(be=Le.text)}return be})($,Ae);return E({message:(Ce??"").toUpperCase()}),Ce?{source:$.getValue(),name:Ce}:null},[]);r.useCallbackRef(ge.CommonUtils.debounce(W,200),[]);const L=r.useCallbackRef(async(me,$,Ae)=>{I(J=>({...J,compiling:!0}));const Ce=await y?.getScripts().createModule({source:Ae?.getValue(),declarationsOnly:!0});Ce&&((async function(J,Z){const re=[];for(let oe=1;oe<J.getLineCount()+1;oe++){const he={startLineNumber:oe,startColumn:1,endLineNumber:oe,endColumn:J.getLineLength(oe)+1},Me=J.getValueInRange(he).indexOf("modelt");Me!==-1&&re.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:Z.MarkerSeverity.Hint,startLineNumber:he.startLineNumber,startColumn:Me+1,endLineNumber:he.startLineNumber,endColumn:Me+5})}Z.editor.setModelMarkers(J,"owner",re)})(me,$),(async function(J,Z,re,oe){const he=await Z.languages.typescript.getTypeScriptWorker(),Me=await he(J.uri),de=await Me.getNavigationTree(J.uri.toString()),be=Co(J,Z,oe,de).map(xe=>{let Fe=null,f=null;return xe.type==="formula"?(Fe="formula.margin-icon",f="Formula"):xe.type==="macro"?(Fe="macro.margin-icon",f="Macro"):xe.type==="autoRun"&&(Fe="autorun.margin-icon",f="Auto Run"),{range:new Z.Range(xe.lineNumber,1,xe.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:Fe,glyphMarginHoverMessage:{value:f},stickiness:Z.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});ue.current&&ue.current.clear(),ue.current=re.createDecorationsCollection(be)})(me,$,Ae,Ce?Ce.getFunctions().getItems():ge.CommonUtils.EmptyArray),I(J=>({...J,compiling:!1})))},[y]),z=r.useCallbackRef(ge.CommonUtils.debounce(L,580),[]),ae=r.useCallbackRef(async(me=void 0)=>{if(!p.current||!y)return;const $=p.current.editor.getPosition(),Ae={cursor:$?$.toString():""};me!==void 0&&(Ae.message=me),E(Ae);const Ce=ne();y.setSelectedFunction(Ce)},[y]);o.useEffect(()=>{},[j]);const ve=o.useRef(null),Pe=r.useCallbackRef(async()=>{await W(),M?.()},[M]);o.useEffect(()=>{if(!y)return;const me={insertSnippet:Ae=>{p.current?.editor&&fr(p.current.editor,p.current.monaco,Ae)},close:()=>Pe()};y.setEditor(me),y.setSelectedFunction(ne());const $=y.addContainerListener({onBeforeSave:async()=>{W()},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!y)return;const Ae=p.current.editor,Ce=y.getScripts().getModules().getItems()[0]?.getSource()??"";Ae.setValue(Ce)}});return()=>{y.setEditor(null),$()}},[y]),o.useEffect(()=>()=>{const me=ve.current;if(me){me.dispose();const $=me.debounceTimer;$!==void 0&&clearTimeout($),ve.current=null}},[B]);const Se=r.useCallbackRef(me=>{const $=p.current?.editor;return!!$&&($.focus(me),!0)},[w]),ue=o.useRef(null),Re=r.useCallbackRef((me,$)=>{p.current={monaco:$,editor:me},K(!0),ae("Loading Types");const Ae=y.getScripts().getModules().getItems()[0]?.getSource()??"";me.setValue(Ae),Promise.resolve().then(()=>require("./DSQd3RszGTGayrdK.cjs")).then(J=>J.customEditor).then(async J=>{ae(""),J.AutoTypings.create(me,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:$,onUpdate:(Z,re)=>{if(Z.type==="LookedUpPackage"&&Z.success!==void 0){const oe=$.languages.typescript.typescriptDefaults.getDiagnosticsOptions();$.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...oe,diagnosticCodesToIgnore:[]})}},onError:Z=>{Z==="Not implemented yet"&&(Z="Compile Errors"),console.warn("Error compiling types",Z)}}).then(Z=>{ve.current=Z;const re=me.getModel();z(re,$,me)})}),me.addCommand("executeScript",function(J,...Z){Z?.[0]&&_({functionName:Z?.[0]})},""),me.addAction({id:"executeScript",label:"Execute",keybindings:[$.KeyCode.F8],run:async J=>{const Z=ne();y.setSelectedFunction(Z);const re=await Z;_(re)}}),me.addAction({id:"saveScript",label:"Save Script",keybindings:[$.KeyMod.CtrlCmd|$.KeyCode.KeyS],run:J=>{W()}}),me.onMouseDown(async J=>{if(J.target.type===$.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const Z=J.target.position.lineNumber,re=await $.languages.typescript.getTypeScriptWorker(),oe=await re(Ce.uri),he=await oe.getNavigationTree(Ce.uri.toString()),Me=(await W()).getFunctions().getItems(),de=Co(Ce,$,Me,he).find(be=>be.lineNumber===Z);if(de){const be=J.event.browserEvent.button;be===0?de.type==="macro"||de.type==="autoRun"?_({functionName:de.name}):de.type==="formula"&&y.quickInsertFunction?.(de.name):be===2&&(console.log("Context menu for function:",de.name),J.event.browserEvent.preventDefault())}}}),me.onDidChangeModelContent(()=>{E({dirty:!0}),z(Ce,$,me)}),$.editor.onDidChangeMarkers(J=>{J.some(Z=>Z.toString()===Ce.uri.toString())});const Ce=me.getModel();(function(J,Z){Z.languages.registerInlayHintsProvider("typescript",{provideInlayHints(re,oe,he){const Me=[];for(let de=1;de<re.getLineCount()+1;de++){const be={startLineNumber:de,startColumn:1,endLineNumber:de,endColumn:re.getLineLength(de)+1},xe="hint",Fe=re.getValueInRange(be).indexOf("hint");Fe!==-1&&Me.push({kind:Z.languages.InlayHintKind.Type,position:{lineNumber:be.startLineNumber,column:Fe+xe.length+1},label:"[hint]"})}return{hints:Me,dispose:()=>{}}}})})(0,$),Ce.onDidChangeContent(J=>{const Z=y?.getScripts().getModules().getByName("scripts"),re=Z?.getSource(),oe=me.getValue(),he=(re?.length??0)!==oe.length||re!==oe;E({dirty:he})}),me.onDidChangeCursorPosition(J=>{ae()})},[y]),Ke=o.useMemo(()=>B?null:v||u.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[B,v]),$e=o.useMemo(()=>{if(!B){if(!sn){sn={};for(let $=0;$<Ft.length;$++){const Ae=Ft[$];sn[Ae]=globalThis[Ae]}}if(dn)for(let $=0;$<Ft.length;$++){const Ae=Ft[$];globalThis[Ae]=dn[Ae]}}const me=y?.getScripts().getModules().getByName("scripts")?.getSource()??"";return u.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[u.jsx(o.Suspense,{children:u.jsx(Sa,{theme:m?"extended-dark":"extended",options:{...Ra,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:me,onValidate:$=>{let Ae=!1;for(let Ce=0;!Ae&&Ce<$?.length;Ce++)$[Ce].severity===8&&(Ae=!0)},beforeMount:$=>{$.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),$.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),$.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),$.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let Ae=!1,Ce=!1;try{const J=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),Z=$.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let re=$.editor.getModel(Z);re?Ce=!0:re=$.editor.createModel(J,"typescript",Z),$.editor.setModelMarkers(re,"default",[]),Ae=!0}catch(J){console.warn("cant load types",J)}if($.languages.registerLinkProvider("*",{provideLinks:(J,Z)=>{const re=[],oe={links:re},he=J.getLinesContent(),Me=he.length;for(let de=1;de<=Me;de++){const be=he[de-1],xe=$.editor.tokenize(be,"typescript"),Fe=xe[0].length;for(let f=0;f<Fe;f++){const Le=xe[0]?.[f];if(Le&&Le.type.startsWith("string")){let Xe=Le.offset,Ue=xe[0]?.[f+1]?.offset??be.length,Q=new $.Range(de,Xe+1,de,Ue+1),qe=J.getValueInRange(Q);const je=qe[0];je!=="`"&&je!=="'"&&je!=='"'||(Xe++,qe=qe.substring(1));const Te=qe[qe.length-1];Te!=="`"&&Te!=="'"&&Te!=='"'||(Xe++,qe=qe.substring(0,qe.length-1));try{y.getRanges(qe)&&re.push({range:{endColumn:Ue,endLineNumber:de,startColumn:Xe,startLineNumber:de},tooltip:`Goto range '${qe}'`,url:`/range/${qe}`})}catch(De){console.warn(De)}}}}return oe}}),$.editor.registerLinkOpener({open(J){if(J?.path?.startsWith("/range/")){try{y.getRanges(J.path.substring(7))?.select()}catch(Z){console.warn("invalid range",Z)}return!0}return!1}}),!Ce){const J=$.languages.typescript.typescriptDefaults.getCompilerOptions();$.languages.typescript.typescriptDefaults.setCompilerOptions({...J,target:$.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:$.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(P.current&&(await fr(p.current.editor,p.current.monaco,P.current),P.current=null),x.current&&requestAnimationFrame(async()=>{x.current&&$.editor.focus()}),!dn){dn={};for(let J=0;J<Ft.length;J++){const Z=Ft[J];dn[Z]=globalThis[Z]}}(()=>{const J=(Z,re)=>{try{if(re===void 0)try{delete globalThis[Z]}catch{try{globalThis[Z]=void 0}catch{}}else globalThis[Z]=re}catch{}};for(let Z=0;Z<Ft.length;Z++){const re=Ft[Z];J(re,sn[re])}sn=void 0})(),K(!0)})()},onMount:Re})}),Ke]})},[y,G,l,Ke,m]),Ie=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:me=>{Se(me)},close:()=>Pe(),getEditor:()=>y?.getEditor()}),[y]);return o.useEffect(()=>(g&&requestAnimationFrame(()=>{Ie.current?.focus()}),()=>{p.current?.editor&&requestAnimationFrame(()=>{Ie.current?.contains(document.activeElement)&&Ie.current?.focus()})}),[]),u.jsx("div",{className:yt("script-editor",qa,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:Ie,...h,children:$e})}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>s.LicenseManager}),exports.ChartAreaIcon=e=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),u.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"}),u.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"}),u.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),u.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"}),u.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),u.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),u.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"}),u.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),u.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"}),u.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),u.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"}),u.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),u.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),u.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"}),u.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),u.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),u.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"}),u.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),u.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),u.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"}),u.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),u.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"}),u.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),u.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=di,exports.ChartLineIcon=e=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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=>u.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[u.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"}),u.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"}),u.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"}),u.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=si,exports.CornerTriangle=go,exports.DateUtils=Cl,exports.DocThemesContext=Dn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return u.jsx(Dn.Provider,{value:t,children:n})},exports.EditableLabel=Dr,exports.EmptyFrame=Ql,exports.FilterButton=vr,exports.FontUtils=bl,exports.Item=Mo,exports.LogoNoPaddingIcon=e=>u.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[u.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"}),u.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"}),u.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"}),u.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=Sr,exports.MovableArea=Mr,exports.PictureEditor=Ar,exports.Row=sl,exports.ScriptEditor=Ta,exports.SheetCellEditor=br,exports.SheetCellRenderer=Cr,exports.SheetElement=Fr,exports.SheetScrollbar=yo,exports.StaticBorderRenderer=Il,exports.StyledStrokePath=wr,exports.Tab=al,exports.TabStrip=dl,exports.createCellEditStateFromCell=yr,exports.useBordersOverlay=bo,exports.useDocThemes=()=>{const e=o.useContext(Dn),[t]=o.useState(()=>new s.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=tt,exports.useMovableCommands=Tr,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const v={getSource:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(v)}const d=v=>{a.current?.(v)},m=e.getRange(t).addListener(d,i);if(l){const v=e.getRange(t);d({getSource:()=>v,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{m?.()}},[e,t])},exports.useSheetCommands=Rr,exports.useSheetCopyPaste=kr,Object.keys(r).forEach(e=>{e==="default"||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});