@sheetxl/utils-react 0.7.5 → 0.7.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.
- package/LICENSE.md +1 -1
- package/browser/cjs/Bb5sSoT2rOCEdJUD.cjs +6 -0
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/DG6oB4sgLAgJaOve.mjs +12 -0
- package/browser/esm/index.mjs +1176 -846
- package/node/assets/style.css +1 -1
- package/node/esm/Cq6QyR2iVPDVSg3n.mjs +12 -0
- package/node/esm/index.mjs +704 -371
- package/package.json +2 -2
- package/types/index.d.ts +244 -10
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode("._sheetxl-scrollbar_eblx4_6 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}:root{--icon-size-sm: .875rem;--icon-size-md: 1rem;--icon-size-lg: 1.25rem;--icon-size-xl: 1.5rem}._Icon_1ipwo_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_1ipwo_10 .sm{--font-size: var(--icon-size-sm)}._Icon_1ipwo_10 .md{--font-size: var(--icon-size-md)}._Icon_1ipwo_10 .lg{--font-size: var(--icon-size-lg)}._Icon_1ipwo_10 .xl{--font-size: var(--icon-size-xl)}._Icon_1ipwo_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_1ipwo_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_1ipwo_10 .fill,._Icon_1ipwo_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_1ipwo_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_1ipwo_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_1ipwo_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_1ipwo_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_1ipwo_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_1ipwo_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_1ipwo_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_1ipwo_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_1ipwo_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_1ipwo_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_1ipwo_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_1ipwo_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_1ipwo_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_1ipwo_10 .fill:not(.fixed){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_1ipwo_10 .line:not(.fixed){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_1ipwo_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_1ipwo_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_1ipwo_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_1ipwo_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}")),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
2
|
"use strict";/**
|
|
3
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
3
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.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 v=require("react/jsx-runtime"),l=require("react"),k=require("@sheetxl/utils"),Gt=require("react-dom/client"),Jt=require("react-dom"),W={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"},ee={Horizontal:"horizontal",Vertical:"vertical"};function mt(i){var e,t,o="";if(typeof i=="string"||typeof i=="number")o+=i;else if(typeof i=="object")if(Array.isArray(i)){var n=i.length;for(e=0;e<n;e++)i[e]&&(t=mt(i[e]))&&(o&&(o+=" "),o+=t)}else for(t in i)i[t]&&(o&&(o+=" "),o+=t);return o}function _e(){for(var i,e,t=0,o="",n=arguments.length;t<n;t++)(i=arguments[t])&&(e=mt(i))&&(o&&(o+=" "),o+=e);return o}var Qt=function(){},gt=typeof window<"u",eo=gt?l.useLayoutEffect:l.useEffect,it={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const he=gt&&window.ResizeObserver!==void 0?function(){var i=l.useState(null),e=i[0],t=i[1],o=l.useState(it),n=o[0],r=o[1],s=l.useMemo(function(){return new window.ResizeObserver(function(a){if(a[0]){var c=a[0].contentRect,u=c.x,h=c.y,d=c.width,p=c.height,w=c.top,C=c.left,S=c.bottom,E=c.right;r({x:u,y:h,width:d,height:p,top:w,left:C,bottom:S,right:E})}})},[]);return eo(function(){if(e)return s.observe(e),function(){s.disconnect()}},[e]),[t,n]}:function(){return[Qt,it]},L=(i,e)=>{const t=l.useCallback((...r)=>i?.(...r),e),o=l.useRef(null);o.current=t;const n=l.useCallback((...r)=>o.current?.(...r),[]);if(o.current)return n},yt=i=>{const{style:e,orientation:t=ee.Vertical,...o}=i,n=t===ee.Vertical,r=n?"m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z":"m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z";return v.jsx("div",{style:{paddingBottom:"0px",paddingRight:"0px",paddingLeft:n?"0px":"3px",paddingTop:n?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...o,children:v.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${n?"vertical":"horizontal"} single-button start`,children:v.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:v.jsx("path",{d:r})})})})},vt=i=>{const{style:e,orientation:t=ee.Vertical,...o}=i,n=t===ee.Vertical,r=n?"M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z":"m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z";return v.jsx("div",{style:{paddingLeft:"0px",paddingTop:"0px",paddingRight:n?"0px":"3px",paddingBottom:n?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...o,children:v.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${n?"vertical":"horizontal"} single-button end`,children:v.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:v.jsx("path",{d:r})})})})},$e=(i,e,t,o,n=0)=>{for(let r=0;r<t.length;r++){const s=t[r].getBoundingClientRect();let a=s.left-e,c=a+s.width;if(o){if(a<i&&c>=i)return a}else if(Math.ceil(c)>Math.ceil(i)+2)return c}return n},to=Object.freeze(Object.defineProperty({__proto__:null,getScrollTo:$e},Symbol.toStringTag,{value:"Module"})),oo="_sheetxl-scrollbar_eblx4_6",ze=l.memo(l.forwardRef((i,e)=>{const{offset:t=0,totalSize:o=0,viewportSize:n=0,style:r,className:s,orientation:a=ee.Vertical,onScrollOffset:c,onScroll:u,showCustomScrollButtons:h=!1,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:p=260,scrollButtonAdditionalRepeatDelay:w=120,createScrollStartButton:C=yt,createScrollEndButton:S=vt,...E}=i,z=L(u,[u]),_=l.useRef(null),[x,{width:g,height:A}]=he(),[R,{width:j,height:N}]=he(),y=a===ee.Vertical,b=y?"top":"left",B=y?"scrollTop":"scrollLeft",f=y?A:g,M=y?N:j,[m,T]=l.useState(null);l.useEffect(()=>{m!==null&&_.current&&_.current.scrollTo({behavior:"smooth",[b]:m})},[m,y]);const P=l.useCallback(($,oe=!1)=>{if(!_.current)return 0;const te=_.current.querySelector(".scrollbar-viewport"),ce=te.getBoundingClientRect(),ne=te.children,re=oe?0:$e($,ce[b],ne,!0,Math.max(0,$-d));return T(re),Math.max(0,re)},[]),X=l.useCallback(($,oe=!1)=>{if(!_.current)return 0;const te=_.current.querySelector(".scrollbar-viewport"),ce=te.getBoundingClientRect(),ne=te.children,re=Math.ceil(M-f),ye=oe?re:$e($,ce[b],ne,!1,Math.max(0,$+d));return T(ye),Math.min(re,ye)},[M,f]),V=l.useRef(null),I=l.useCallback($=>{V.current=t;const oe=$.target[B];c(oe,n,o),z?.($)},[c,n,o,t]);l.useEffect(()=>{const $=V.current;V.current=null,t!==$&&(_.current[B]=t)},[t,B]);const F=l.useRef(null),O=l.useRef(null),H=l.useCallback(()=>{F.current&&(clearTimeout(F.current),F.current=null,O.current=null)},[]),U=l.useCallback(($,oe,te,ce=p)=>{O.current=$,F.current=setTimeout(()=>{const ne=te?P(O.current||$):X(O.current||$);ne!==O.current?U(ne,!1,te,w):H()},oe?0:ce)},[P,X,H]);l.useEffect(()=>()=>H(),[H]);const J=t,de=l.useMemo(()=>{if(!h)return null;const $={orientation:a,disabled:Math.floor(J)<=0||Math.floor(M-f)===0,onMouseUp:H,onMouseLeave:H,onMouseDown:()=>U(J,!0,!0)};return C?.($)},[h,a,J,m,M,f]),pe=l.useMemo(()=>{if(!h)return null;const $={orientation:a,disabled:Math.floor(M-f)<=Math.ceil(J),onMouseUp:H,onMouseLeave:H,onMouseDown:()=>U(J,!0,!1)};return S?.($)},[h,a,J,m,M,f]);return v.jsxs("div",{ref:e,style:{display:"flex",flex:"1",flexDirection:y?"column":"row",padding:"0",...r},className:_e(oo,s),...E,children:[de,v.jsx("div",{className:"pseudo-scrollbar",style:{flex:"1 1 100%",display:"flex",boxSizing:"content-box",flexDirection:y?"column":"row",justifyContent:"center",alignItems:"center"},ref:x,children:v.jsx("div",{tabIndex:-1,style:{flex:"1 1 100%",overflowY:y?"scroll":"hidden",overflowX:y?"hidden":"scroll",position:"relative",willChange:"transform"},onScroll:I,ref:_,children:v.jsx("div",{ref:R,style:{position:"absolute",height:y?o-n+(A??0):1,width:y?1:o-n+(g??0)},className:"scrollbar-viewport"})})}),pe]})}));ze.displayName="Scrollbar";let rt=Date.now,st=1e3,ae={},no=1;const ve=i=>{let e=ae[i]!==null;return e&&(ae[i]=null),e},lt=(i,e,t,o=0,n)=>{let r=rt(),s=r,a=0,c=0,u=0,h=no++;if(h%20==0){const p={};for(let w in ae)p[w]=!0;ae=p}const d=function(p){let w=p!==!0,C=rt(),S=!0;try{S=(!e||e(h))??!0}catch{S=!1}if(!ae[h]||!S)return ae[h]=null,void t?.(60-c/((C-r)/st),h,!1);if(w){u=Math.round((C-s)/16.666666666666668)-1;for(let _=0;_<Math.min(u,4);_++)d(!0),c++}o&&(a=(C-r)/o,a>1&&(a=1));let E=n?n(a):a,z=!1;try{z=i(E,C,w)}catch{z=!1}z!==!1&&a!==1||!w?w&&(s=C,requestAnimationFrame(d)):(ae[h]=null,t?.(60-c/((C-r)/st),h,a===1||o==null))};return ae[h]=!0,requestAnimationFrame(d),h},io=function(i){return Math.pow(i-1,3)+1},ro=function(i){return(i/=.5)<1?.5*Math.pow(i,3):.5*(Math.pow(i-2,3)+2)};class so{constructor(e,t){this.__isSingleTouch=!1,this.__isTracking=!1,this.__didDecelerationComplete=!1,this.__isGesturing=!1,this.__isDragging=!1,this.__isDecelerating=0,this.__isAnimating=0,this.__interruptedAnimation=!1,this.__lastScale=1,this.__enableScrollX=!0,this.__enableScrollY=!0,this.__clientLeft=0,this.__clientTop=0,this.__clientWidth=0,this.__clientHeight=0,this.__contentWidth=0,this.__contentHeight=0,this.__snapWidth=100,this.__snapHeight=100,this.__zoomLevel=1,this.__scrollLeft=0,this.__scrollTop=0,this.__maxScrollLeft=0,this.__maxScrollTop=0,this.__scheduledLeft=0,this.__scheduledTop=0,this.__scheduledZoom=0,this.__lastTouchLeft=0,this.__lastTouchTop=0,this.__lastTouchMove=0,this.__positions=[],this.__initialTouchLeft=0,this.__initialTouchTop=0,this.__zoomLevelStart=1,this.__minDecelerationScrollLeft=null,this.__minDecelerationScrollTop=null,this.__maxDecelerationScrollLeft=null,this.__maxDecelerationScrollTop=null,this.__decelerationVelocityX=null,this.__decelerationVelocityY=0,this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:void 0,penetrationDeceleration:.03,penetrationAcceleration:.08,...t}}setDimensions(e,t,o,n){e!==null&&(this.__clientWidth=e),t!==null&&(this.__clientHeight=t),o!==null&&(this.__contentWidth=o),n!==null&&(this.__contentHeight=n),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)}setPosition(e,t){this.__clientLeft=e||0,this.__clientTop=t||0}setSnapSize(e,t){this.__snapWidth=e,this.__snapHeight=t}getValues(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}}getPoint(e,t){const o=this.getValues();return{left:e/o.zoom,top:t/o.zoom}}getScrollMax(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}}zoomTo(e,t=!1,o,n,r){if(!this.options.zooming)throw new Error("Zooming is not enabled!");r&&(this.__zoomComplete=r),this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=0);const s=this.__zoomLevel;o===void 0&&(o=this.__clientWidth/2),n===void 0&&(n=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const a=e/s;let c=a*(this.__scrollLeft+o)-o,u=a*(this.__scrollTop+n)-n;c>this.__maxScrollLeft?c=this.__maxScrollLeft:c<0&&(c=0),u>this.__maxScrollTop?u=this.__maxScrollTop:u<0&&(u=0),this.__publish(c,u,e,t)}zoomBy(e,t=!1,o=0,n=0,r){this.zoomTo(this.__zoomLevel*e,t,o,n,r)}scrollTo(e,t,o=!1,n=1){if(this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=0),n!==void 0&&n!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=n,t*=n,this.__computeScrollMax(n)}else n=this.__zoomLevel;this.options.scrollingX?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(o=!1),this.__publish(e,t,n,o)}scrollBy(e=0,t=0,o=!1){const n=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,r=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(n+(e||0),r+(t||0),o)}doMouseZoom(e,t,o,n){const r=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*r,!1,o-this.__clientLeft,n-this.__clientTop)}doTouchStart(e,t){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);let o,n;this.__interruptedAnimation=!0,this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(ve(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let r=e.length===1;r?(o=e[0].pageX,n=e[0].pageY):(o=Math.abs(e[0].pageX+e[1].pageX)/2,n=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=o,this.__initialTouchTop=n,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=o,this.__lastTouchTop=n,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!r&&this.options.scrollingX,this.__enableScrollY=!r&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!r,this.__isSingleTouch=r,this.__positions=[]}doTouchMove(e,t,o=1){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);if(!this.__isTracking)return;let n,r;e.length===2?(n=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2):(n=e[0].pageX,r=e[0].pageY);let s=this.__positions;if(this.__isDragging){let a=n-this.__lastTouchLeft,c=r-this.__lastTouchTop,u=this.__scrollLeft,h=this.__scrollTop,d=this.__zoomLevel;if(o!==void 0&&this.options.zooming){let p=d;if(d=d/this.__lastScale*o,d=Math.max(Math.min(d,this.options.maxZoom),this.options.minZoom),p!==d){let w=n-this.__clientLeft,C=r-this.__clientTop;u=(w+u)*d/p-w,h=(C+h)*d/p-C,this.__computeScrollMax(d)}}if(this.__enableScrollX){u-=a*this.options.speedMultiplier;let p=this.__maxScrollLeft;(u>p||u<0)&&(this.options.bouncing?u+=a/2*this.options.speedMultiplier:u=u>p?p:0)}if(this.__enableScrollY){h-=c*this.options.speedMultiplier;const p=this.__maxScrollTop;(h>p||h<0)&&(this.options.bouncing?h+=c/2*this.options.speedMultiplier:h=h>p?p:0)}s.length>60&&s.splice(0,30),s.push(u,h,t),this.__publish(u,h,d)}else{let a=this.options.locking?3:0,c=5,u=Math.abs(n-this.__initialTouchLeft),h=Math.abs(r-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&u>=a,this.__enableScrollY=this.options.scrollingY&&h>=a,s.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(u>=c||h>=c),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=n,this.__lastTouchTop=r,this.__lastTouchMove=t,this.__lastScale=o}doTouchEnd(e){if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){let t=this.__positions,o=t.length-1,n=o;for(let r=o;r>0&&t[r]>this.__lastTouchMove-100;r-=3)n=r;if(n!==o){const r=t[o]-t[n],s=this.__scrollLeft-t[n-2],a=this.__scrollTop-t[n-1];this.__decelerationVelocityX=s/r*(1e3/60),this.__decelerationVelocityY=a/r*(1e3/60);const c=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>c||Math.abs(this.__decelerationVelocityY)>c)&&this.__startDeceleration(e)}else this.options.scrollingComplete?.()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete?.();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}}__publish(e,t,o,n=!1){const r=this.__isAnimating;if(r&&(ve(r),this.__isAnimating=0),n&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=o;const s=this.__scrollLeft,a=this.__scrollTop,c=this.__zoomLevel,u=e-s,h=t-a,d=o-c,p=function(S,E,z){z&&(this.__scrollLeft=s+u*S,this.__scrollTop=a+h*S,this.__zoomLevel=c+d*S,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),w=function(S){return this.__isAnimating===S}.bind(this),C=function(S,E,z){E===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||z)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=lt(p,w,C,this.options.animationDuration,r?io:ro)}else this.__scheduledLeft=this.__scrollLeft=e,this.__scheduledTop=this.__scrollTop=t,this.__scheduledZoom=this.__zoomLevel=o,this.__callback&&this.__callback(e,t,o),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}__computeScrollMax(e=this.__zoomLevel){this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)}__startDeceleration(e){if(this.options.paging){const s=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),a=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),c=this.__clientWidth,u=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(s/c)*c,this.__minDecelerationScrollTop=Math.floor(a/u)*u,this.__maxDecelerationScrollLeft=Math.ceil(s/c)*c,this.__maxDecelerationScrollTop=Math.ceil(a/u)*u}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(s,a,c){this.__stepThroughDeceleration(c)}.bind(this),o=this.options.snapping?4:.1,n=function(){const s=Math.abs(this.__decelerationVelocityX)>=o||Math.abs(this.__decelerationVelocityY)>=o;return s||(this.__didDecelerationComplete=!0),s}.bind(this),r=function(s,a,c){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=lt(t,n,r)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,o=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const n=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);n!==t&&(t=n,this.__decelerationVelocityX=0);const r=Math.max(Math.min(this.__maxDecelerationScrollTop,o),this.__minDecelerationScrollTop);r!==o&&(o=r,this.__decelerationVelocityY=0)}if(e?this.__publish(t,o,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=o),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){let n=0,r=0,s=this.options.penetrationDeceleration,a=this.options.penetrationAcceleration;t<this.__minDecelerationScrollLeft?n=this.__minDecelerationScrollLeft-t:t>this.__maxDecelerationScrollLeft&&(n=this.__maxDecelerationScrollLeft-t),o<this.__minDecelerationScrollTop?r=this.__minDecelerationScrollTop-o:o>this.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-o),n!==0&&(n*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=n*s:this.__decelerationVelocityX=n*a),r!==0&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*s:this.__decelerationVelocityY=r*a)}}}var Z=typeof window<"u"?window:{screen:{},navigator:{}},ge=(Z.matchMedia||function(){return{matches:!1}}).bind(Z),xt=!1,lo={get passive(){return xt=!0}},at=function(){};Z.addEventListener&&Z.addEventListener("p",at,lo),Z.removeEventListener&&Z.removeEventListener("p",at,!1);var ao=xt,co="PointerEvent"in Z,Ue="ontouchstart"in Z,bt=Ue||"TouchEvent"in Z&&ge("(any-pointer: coarse)").matches,ct=(Z.navigator.maxTouchPoints||0)>0||bt,wt=Z.navigator.userAgent||"",uo=ge("(pointer: coarse)").matches&&/iPad|Macintosh/.test(wt)&&Math.min(Z.screen.width||0,Z.screen.height||0)>=768,St=(ge("(pointer: coarse)").matches||!ge("(pointer: fine)").matches&&Ue)&&!/Windows.*Firefox/.test(wt),ho=ge("(any-pointer: fine)").matches||ge("(any-hover: hover)").matches||uo||!Ue,Ke=!ct||!ho&&St?ct?"touchOnly":"mouseOnly":"hybrid",po=Ke==="mouseOnly"?"mouse":Ke==="touchOnly"||St?"touch":"mouse";const fo=Object.freeze(Object.defineProperty({__proto__:null,deviceType:Ke,primaryInput:po,supportsPassiveEvents:ao,supportsPointerEvents:co,supportsTouchEvents:bt},Symbol.toStringTag,{value:"Module"})),_o=new Set(["INPUT","TEXTAREA","SELECT"]),Ct={};function Ne(){return fo}const Et=i=>i==="BracketLeft"?"[":i==="BracketRight"?"]":k.CommonUtils.camelToPrettyCase(i),mo=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Ct,boundPixel:function(i,e=!1,t=0){return i},createSyntheticEvent:i=>{let e=!1,t=!1;return{nativeEvent:i,currentTarget:i.currentTarget,target:i.target,bubbles:i.bubbles,cancelable:i.cancelable,defaultPrevented:i.defaultPrevented,eventPhase:i.eventPhase,isTrusted:i.isTrusted,preventDefault:()=>{e=!0,i.preventDefault()},isDefaultPrevented:()=>e,stopPropagation:()=>{t=!0,i.stopPropagation()},isPropagationStopped:()=>t,persist:()=>{},timeStamp:i.timeStamp,type:i.type}},detectIt:Ne,focusableNodeNames:_o,toPrettyKeyCode:Et},Symbol.toStringTag,{value:"Module"})),go=[];function Ye(i,e,t=go){const o=l.useRef(null);return l.useImperativeHandle(i,()=>{if(!o.current)return;const n=o.current,r=e?.();if(!r||typeof r!="object")throw new Error("attributes must return a plain object of values");const s=Object.keys(r),a=s.length;for(let c=0;c<a;c++){const u=s[c],h=r[u];Object.defineProperty(n,u,{value:h,writable:!0,configurable:!0,enumerable:!0})}return n},t),o}const He=i=>v.jsx(ze,{...i}),Lt=({width:i,height:e})=>v.jsx("div",{className:"corner",style:{minWidth:`${i}px`,width:`${i}px`,minHeight:`${e}px`,height:`${e}px`}}),Mt=l.memo(l.forwardRef((i,e)=>{const{children:t,viewport:o,onScrollViewport:n,showHorizontalScrollbar:r=!0,showVerticalScrollbar:s=!0,createScrollCorner:a=Lt,createHorizontalScrollbar:c=He,createVerticalScrollbar:u=He,style:h,touchElement:d,disableTouch:p,...w}=i,C=L(n,[n]),S=Ye(e,()=>({isScrollPane:()=>!0}),[]),E=l.useRef(null);l.useEffect(()=>{E.current&&(E.current.__scrollTop===o?.top&&E.current.__scrollLeft===o?.left||E.current.__isDecelerating||E.current?.scrollTo(o?.left,o?.top,!1))},[o?.left,o?.top,d]);const z=l.useCallback((f,M)=>{C?.({left:f,top:M})},[]),_=l.useCallback(f=>{E.current?.doTouchStart(f.touches,f.timeStamp)},[]),x=l.useCallback(f=>{f.preventDefault(),E.current?.doTouchMove(f.touches,f.timeStamp)},[]),g=l.useCallback(f=>{E.current?.doTouchEnd(f.timeStamp)},[]),A=l.useCallback(({containerWidth:f,containerHeight:M,totalWidth:m,totalHeight:T})=>{E.current.setDimensions(f,M,m,T)},[]);l.useEffect(()=>{const f=d??S.current;if(!p&&Ne().supportsTouchEvents&&f&&o){if(!E.current){const M={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};E.current=new so(z,M)}Ne().supportsTouchEvents&&(f.addEventListener("touchstart",_),f.addEventListener("touchend",g),f.addEventListener("touchmove",x)),A({containerWidth:o?.width,containerHeight:o?.height,totalWidth:o?.totalWidth,totalHeight:o?.totalHeight})}return()=>{f?.removeEventListener("touchstart",_),f?.removeEventListener("touchend",g),f?.removeEventListener("touchmove",x)}},[o?.width,o?.height,o?.totalWidth,o?.totalHeight,p,d]);const[R,{width:j}]=he(),[N,{height:y}]=he(),b=l.useMemo(()=>{const f=u({orientation:ee.Vertical,offset:o?.top,viewportSize:o?.height,totalSize:o?.totalHeight,onScrollOffset:M=>{C?.({top:M})}});return v.jsx("div",{style:{display:"flex",flex:"0"},ref:R,children:f})},[u,o?.top,o?.height,o?.totalHeight]),B=l.useMemo(()=>{const f=c({orientation:ee.Horizontal,offset:o?.left,viewportSize:o?.width,totalSize:o?.totalWidth,onScrollOffset:M=>C?.({left:M})});return v.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[v.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${j}px)`},children:v.jsx("div",{ref:N,className:"sizer",children:f})}),s?a({width:j,height:y}):v.jsx(v.Fragment,{})]})},[c,o?.left,o?.width,o?.totalWidth,s,a,j,y]);return v.jsx("div",{style:{position:"relative",display:"flex",minWidth:s?`${j}px`:void 0,minHeight:r?`${y}px`:void 0,...h},...w,ref:S,children:v.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[v.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[v.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:t}),s?b:v.jsx(v.Fragment,{})]}),r?B:v.jsx(v.Fragment,{})]})})}));Mt.displayName="ScrollPane";let Se=0;const yo=100,vo=100,xo=1e6,bo=100,wo=50,Tt=l.memo(l.forwardRef((i,e)=>{const{offset:t=0,viewportSize:o=0,totalSize:n=0,minSize:r=0,endGap:s=yo,endScrollIncrement:a=vo,style:c=Ct,onMouseDown:u,onScrollOffset:h,onScroll:d,scaleLimit:p=xo,scaleFactor:w=bo,precisionFactor:C=wo,...S}=i;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const E=L(u,[u]),z=()=>({offset:t,totalSize:p===0?n:Math.min(n??0,Math.max(r??0,(t??0)+(o??0))+(s??0))}),[_,x]=l.useState(z),g=p!==0&&_.totalSize>p?w:1,A=g/C,R=Math.ceil(_.totalSize/g),j=Math.ceil(_.offset/g),N=Math.ceil(o/g),y=l.useCallback(P=>{},[]),[b,B]=l.useState(!1),f=l.useRef(null);l.useLayoutEffect(()=>{if(!b){f.current={propTotalSize:n,propViewportSize:o,propOffset:t};const P=z();x(P)}},[n,o,t,b,r,s,a]);const M=L((P,X,V)=>{const I=f.current;f.current=null,I&&I.propTotalSize===n&&I.propViewportSize===o&&I.propOffset===t||(Math.abs(P-j)<A&&(P=j),h?.(P*g,j,N))},[h,g,A,j,N]),m=l.useCallback(P=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",m),B(!1)},[]),T=l.useCallback(P=>{E?.(P),B(!0),document.addEventListener("mousemove",y,{passive:!0}),document.addEventListener("mouseup",m,{passive:!0})},[y,m]);return v.jsx(ze,{ref:e,style:{...c},...S,offset:j,totalSize:R,viewportSize:N,onMouseDown:T,onScrollOffset:M})}));Tt.displayName="VirtualScrollbar";function Ae(i,e){if(typeof i=="function")return i(e);i&&(i.current=e)}var Pe=parseInt(l.version.split(".")[0],10)>=19?function(i){return e=>{const t=[];for(const o of i){const n=Ae(o,e),r=typeof n=="function";t.push(r?n:()=>Ae(o,null))}return()=>{for(const o of t)o()}}}:function(i){return e=>{for(const t of i)Ae(t,e)}};const So=l.memo(l.forwardRef((i,e)=>{const{refFocusStart:t,...o}=i,n=l.useRef(null),r=l.useCallback(()=>{if(t)return void t?.current?.focus();const s=n.current.parentElement.children;let a=[];for(let c=0;c<s.length&&s[c]!==n.current;c++){const u=s[c].getAttribute("tabindex");if(u==null||u==="-1"||s[c].getAttribute("disabled")==="true")continue;const h=s[c];h.focus&&a.push({tabindex:parseInt(u),child:h})}a.length!==0&&(a.sort(function(c,u){return c.tabindex-u.tabindex}),a[0].child.focus())},[t]);return v.jsx("div",{tabIndex:0,ref:Pe([n,e]),onFocus:r,...o})})),Co=l.memo(l.forwardRef((i,e)=>{const{className:t,style:o,children:n,radius:r=4,strokeWidth:s=1,strokeColor:a="grey",...c}=i,[u,{width:h,height:d}]=he(),p=l.useRef(null),w=(z,_=0)=>{const x=z/2,g=d-x+_;return(function(A,R,j=!1){if(R===0)return A;function N(m,T,P){let X=T.x-m.x,V=T.y-m.y,I=Math.sqrt(X*X+V*V);return y(m,T,Math.min(1,P/I))}function y(m,T,P){return{x:m.x+(T.x-m.x)*P,y:m.y+(T.y-m.y)*P}}function b(m,T){m.length>2&&(m[m.length-2]=T.x,m[m.length-1]=T.y)}function B(m){return{x:parseFloat(m[m.length-2]),y:parseFloat(m[m.length-1])}}let f=A.split(/[,\s]/).reduce(function(m,T){let P=T.match("([a-zA-Z])(.+)");return P?(m.push(P[1]),m.push(P[2])):m.push(T),m},[]).reduce(function(m,T){return parseFloat(T)==T&&m.length?m[m.length-1].push(T):m.push([T]),m},[]),M=[];if(f.length>1){let m=B(f[0]),T=null;f[f.length-1][0]==="Z"&&f[0].length>2&&(T=["L",m.x,m.y],f[f.length-1]=T),M.push(f[0]);for(let P=1;P<f.length;P++){let X=M[M.length-1],V=f[P],I=V===T?f[1]:f[P+1];if(I&&X&&X.length>2&&V[0]==="L"&&I.length>2&&I[0]==="L"){let F,O,H=B(X),U=B(V),J=B(I);j?(F=y(U,X.origPoint||H,R),O=y(U,I.origPoint||J,R)):(F=N(U,H,R),O=N(U,J,R)),b(V,F),V.origPoint=U,M.push(V);let de=y(F,U,.5),pe=y(U,O,.5),$=["C",de.x,de.y,pe.x,pe.y,O.x,O.y];$.origPoint=U,M.push($)}else M.push(V)}if(T){let P=B(M[M.length-1]);M.push(["Z"]),b(M[0],P)}}else M=f;return M.reduce(function(m,T){return m+T.join(" ")+" "},"")})(`${`M 0 ${x} L ${r-.5} ${x} L ${r-.5} ${g} L ${2*r} ${g}`} ${`L ${h-2*r} ${g}`} ${`M ${h-2*r} ${g} L ${h-r} ${g} L ${h-r} ${x} L ${h} ${x}`}`,r)},C=l.useMemo(()=>w(s),[h,d,r,s]),S=l.useMemo(()=>{if(r===0)return;const z=r/2;return w(r)+`L ${h} 0 L 0 0 L 0 ${z}`},[C,r,s]),E=l.useMemo(()=>({style:{clipPath:`path('${S}')`}}),[S]);return v.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...o},...c,ref:Pe([p,u,e]),children:[l.isValidElement(n)?l.cloneElement(n,E):v.jsx(v.Fragment,{}),v.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:h,height:d,viewBox:`0 0 ${h} ${d}`,children:v.jsx("path",{d:C,stroke:a,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:s})})]})})),Eo={},Dt=i=>{const{onPointerDown:e,style:t,splitDirection:o,paddingBefore:n=0,paddingAfter:r=0,disabled:s,key:a,hitAreaProps:c=Eo,...u}=i,h=o==="row",{style:d,className:p,...w}=c;return v.jsx("div",{style:{...t,position:"relative"},...u,children:v.jsx("div",{className:_e("hit-box",p),style:{left:(h?-n:0)+"px",width:`calc(100% + ${h?n+r:0}px)`,top:(h?0:-n)+"px",height:`calc(100% + ${h?0:n+r}px)`,position:"absolute",...d},onPointerDown:s?void 0:e,...w})},a)},Ce={},ue=(i,e,t=!0)=>i===null?null:i.pixels!==null?t?i.pixels:e-i.pixels:(t?i.percent:100-i.percent)/100*e,Ee=(i,e=!0)=>i?.percent?`${e?i.percent:100-i.percent}%`:i?.pixels?`${i.pixels}px`:void 0,le=(i,e)=>{if(i==null)return null;const t={percent:null,pixels:null};let o=e;return typeof i=="string"&&((i=i.trim().toLowerCase()).endsWith("px")?(i=i.substring(0,i.length-2),o=!1):i.endsWith("%")&&(i=i.substring(0,i.length-1),o=!0),i=parseFloat(i)),o?t.percent=i:t.pixels=i,Object.freeze(t)},Lo=l.memo(l.forwardRef((i,e)=>{const{elementBefore:t,elementAfter:o,splitDirection:n="row",fixedPane:r=null,position:s,onPositionChange:a,minBefore:c,maxBefore:u,minAfter:h,maxAfter:d,children:p,className:w,style:C,disabled:S=!1,onDragStart:E,onDragResize:z,onDragFinish:_,resizerProps:x=Ce,paneProps:g=Ce,paneBeforeProps:A=Ce,paneAfterProps:R=Ce,createResizer:j=Dt}=i;if(p)throw new Error("Use elementBefore and elementAfter instead of children.");const N=l.useMemo(()=>l.isValidElement(o)&&l.isValidElement(t),[o,t]),y=l.useMemo(()=>{let D=null;r&&(r==="before"?D=0:r==="after"&&(D=1));const K=D===null;return{fixedPaneOffset:D,isPercent:K,minBefore:le(c,K),maxBefore:le(u,K),minAfter:le(h,K),maxAfter:le(d,K)}},[c,u,h,d]),b=L(a,[a]),[B,f]=l.useState(()=>le(s,r===null));l.useEffect(()=>{f(le(s,r===null))},[s,r]);const[M,{width:m,height:T}]=he(),[P,{width:X,height:V}]=he(),I=n==="row"?X:V,F=n==="row"?m:T,O=l.useMemo(()=>((D,K,q,Y)=>{const ie=[null,null],Q=[null,null];if(D||(D={percent:Y.fixedPaneOffset===null?50:null,pixels:Y.fixedPaneOffset===null?null:0}),K===0)return D?.pixels!=null?Y.fixedPaneOffset!==1?(ie[0]=D?.pixels,Q[1]=100):(ie[1]=D?.pixels-q,Q[0]=100):D?.percent!=null&&(Y.fixedPaneOffset!==1?(Q[0]=D?.percent,Q[1]=100-D?.percent):(Q[1]=D?.percent,Q[0]=100-D?.percent)),{percents:Q,pixels:ie,minBefore:Ee(Y.minBefore,!0),maxBefore:Ee(Y.maxBefore,!0),minAfter:Ee(Y.minAfter),maxAfter:Ee(Y.maxAfter)};let se=ue(D,K,Y.fixedPaneOffset!==1),G=K-q,tt=ue(Y.minBefore,G,!0)??0,qt=ue(Y.maxBefore,G,!0)??G,we=0,Re=0,ot=0,nt=G;we=(ue(Y.maxAfter,K,!1)??q)-q,Re=ue(Y.minAfter,K,!1)??K,ot=Math.max(tt,we),nt=Math.min(qt,Re),se=Math.max(ot,Math.min(se,nt)),Re=Math.min(G-se,ue(Y.maxAfter,G-se,!0)??G),we=Math.min(G-se,ue(Y.minAfter,G-se,!0)??G),ie[0]=se,ie[1]=G-ie[0];const Zt=Math.max(0,Math.min(100,se/G*100));return Q[0]=Zt,Q[1]=100-Q[0],{percents:Q,pixels:ie,minBefore:`${tt}px`,minAfter:`${we}px`,maxBefore:`${ie[0]}px`,maxAfter:`${ie[1]}px`}})(B,F,I,y),[y,B,F,I,n]),[H,U]=l.useState(!1),J=L(E,[E]),de=L(z,[z]),pe=L(_,[_]),$=l.useRef(null),oe=l.useRef(null),te=l.useRef(null),{style:ce,className:ne,...re}=g,ye={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",display:"flex",overflow:"hidden",...ce},{className:Bt,style:Ot,...jt}=A,{className:$t,style:Kt,...Nt}=R,Ht={flex:"1 1 100%",width:"100%",...C,flexDirection:n,display:"flex"},{className:qe,style:Ze,onPointerDown:Ge,...Je}=x,Vt=L(D=>{const K=le(D,r===null);f(K)},[r]),xe=L(D=>{if(S||!H)return;const K=et.current?.getBoundingClientRect();let q=0;q=n==="row"?(D.clientX??D.touches?.[0]?.clientX)-K.x:(D.clientY??D.touches?.[0]?.clientY)-K.y,q=Math.max(0,Math.min(F,q)),y.fixedPaneOffset===1&&(q=F-q),s&&B.pixels===q||f({pixels:q,percent:null}),de?.(q),D.stopPropagation(),D.preventDefault()},[y,n,S,H,B,F]),Qe=L(D=>{if(document.removeEventListener("pointermove",xe),document.removeEventListener("touchmove",xe),document.removeEventListener("pointerup",Qe),!!H&&(U(!1),!!B)){if(pe(B.pixels),!le(s,r===null)||B.pixels!==s){const K={...B};K.percent===null&&(K.percent=K.pixels/F*100),b(K)}D.stopPropagation(),D.preventDefault()}},[B,H,s,r,F]),It=L(D=>{Ge?.(D),D.defaultPrevented||S||H||(U(!0),J(),document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("pointerup",Qe,{passive:!1}))},[Ge]),et=Ye(e,()=>({setPosition:Vt,isSplitPane:()=>!0}),[]),Ft=l.useMemo(()=>N?j?.({key:"resizer",ref:Pe([P,oe]),className:_e("resizer",qe),onPointerDownCapture:It,style:{cursor:S?void 0:n==="row"?"ew-resize":"ns-resize",minWidth:n==="row"?"2px":void 0,minHeight:n!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...Ze},splitDirection:n,disabled:S,...Je}):null,[N,qe,Je,n,Ze,S]),be=n==="row"?"Width":"Height",Wt={...ye,...Ot,flex:y.fixedPaneOffset===0&&O?.pixels[0]!==null?`0 0 ${Math.round(O?.pixels[0])}px`:`1 1 ${Math.round(O?.percents[0]??100)}%`,[`min${be}`]:O?.minBefore,[`max${be}`]:o?O?.maxBefore:"100%"},Ut={...ye,...Kt,flex:y.fixedPaneOffset===1&&O?.pixels[1]!==null?`0 0 ${Math.round(O?.pixels[1])}px`:`1 1 ${Math.round(O?.percents[1]??100)}%`,[`min${be}`]:O?.minAfter,[`max${be}`]:t?O?.maxAfter:"100%"},Yt=l.useMemo(()=>t?v.jsx("div",{ref:$,className:_e("before",ne,Bt),style:Wt,...re,...jt,children:t},"before"):null,[t,g,A,y,O]),Xt=l.useMemo(()=>o?v.jsx("div",{ref:te,className:_e("after",ne,$t),style:Ut,...re,...Nt,children:o},"after"):null,[o,g,R,y,O]);return v.jsxs("div",{ref:Pe([M,et]),className:_e("splitPane",n==="row"?"vertical":"horizontal",{dragging:H},w),style:Ht,children:[Yt,Ft,Xt]})})),Ve={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Pt extends k.DefaultNotifier{setOverrides(e){super.setOverrides(e)}getDelegate(){return this._overrides}showMessage(e,t){const o=this.getDelegate();if(o?.showMessage)return o.showMessage(e,t);t?.type!==Ve.Warning?t?.type!==Ve.Error?k.Notifier.log(e):k.Notifier.error(e):k.Notifier.warn(e)}showBusy(e,t){const o=this.getDelegate();return o?.showBusy?o.showBusy(e,t):new Promise(n=>{n(()=>{})})}showWindow(e,t,o){const n=this.getDelegate();if(n?.showWindow)return n.showWindow(e,t,o)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):k.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInputOptions(e){const t=this.getDelegate();return t?.showInputOptions?t.showInputOptions(e):Promise.resolve({input:"",option:""})}}const Mo=new Pt,kt=l.createContext(Mo),Be=()=>l.useContext(kt);function ut(i){if(!i)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:o,processTouch:n=!1,consumeTouch:r=!0}=i,s=L(e,[e]),a=L(t,[t]),c=L(o,[o]),u=l.useRef(!1),h=i?.timerInitial??230,d=i?.timerContinuous??h/2,p=l.useRef(null),w=l.useRef(null),C=l.useRef(null),S=l.useRef(null),E=l.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=null)},[]),z=l.useCallback(b=>{S.current=setTimeout(()=>{window.requestAnimationFrame(()=>{u.current!==!1&&c?.(w.current,C.current,p.current)}),z(d)},b??h)},[]);l.useEffect(()=>()=>E(),[]);const _=n?"pointer":"mouse",x=l.useCallback(b=>{b.stopPropagation(),b.stopImmediatePropagation(),b.preventDefault()},[]),g=L(b=>{document.removeEventListener(`${_}move`,j),document.removeEventListener(`${_}up`,g),document.removeEventListener("keydown",N),document.removeEventListener("keyup",y),document.removeEventListener("touchstart",x,{capture:!0}),document.removeEventListener("touchmove",x,{capture:!0}),window.removeEventListener("blur",A),E(),window.requestAnimationFrame(()=>{u.current!==!1&&(u.current=!1,a?.(b,C.current,p.current),C.current=null)})},[]),A=l.useCallback(()=>{u.current!==!1&&(u.current=!1,g(w.current))},[]),R=L(()=>{E(),z(d),window.requestAnimationFrame(()=>{u.current!==!1&&c?.(w.current,C.current,p.current)})},[d]),j=L(b=>{w.current=b,R()},[]),N=L(b=>{C.current={ctrlKey:b.ctrlKey,shiftKey:b.shiftKey,altKey:b.altKey,metaKey:b.metaKey},R()},[]),y=L(b=>{C.current={ctrlKey:b.ctrlKey,shiftKey:b.shiftKey,altKey:b.altKey,metaKey:b.metaKey},R()},[d]);return L(b=>{b.isDefaultPrevented()||(C.current={ctrlKey:b.ctrlKey,shiftKey:b.shiftKey,altKey:b.altKey,metaKey:b.metaKey},s(b,C.current)!==!1&&(p.current=b,w.current=b.nativeEvent,document.addEventListener(`${_}up`,g,{passive:!1}),document.addEventListener(`${_}move`,j,{passive:!1}),document.addEventListener("keydown",N,{passive:!1}),document.addEventListener("keyup",y,{passive:!1}),window.addEventListener("blur",A,{passive:!0}),n&&r&&(document.addEventListener("touchstart",x,{passive:!1,capture:!0}),document.addEventListener("touchmove",x,{passive:!1,capture:!0})),u.current=!0,z(h)))},[h,n])}const To=({initValue:i,useHookBody:e,applyStateChange:t})=>{const o=l.useRef(i);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const n=e();return l.useLayoutEffect(()=>{o.current!==n&&(o.current=n,t(n))},[t,n]),null},Ie=i=>{console&&console.warn&&console.warn(i)},Oe=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let Do=1,Fe=!1,zt=!1;const Te=[],me=[],ke=()=>{me.forEach(i=>i())},Po=({automaticContainerInternalUseOnly:i})=>{const[e,t]=l.useState([]),o=l.useRef([]);return o.current=e,i||Fe!==!1||(zt=!0),l.useEffect(()=>{let n=!0;function r(){if(n)return me[0]!==r?(i||Fe!==!0||Ie("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void t(s=>[])):void t([...Te])}return me.push(r),ke(),()=>{n=!1,o.current?.length>0&&Ie("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),me.splice(me.indexOf(r),1),ke()}},[i]),v.jsx(v.Fragment,{children:e.map(({hook:n,key:r})=>l.createElement(To,{...n,key:r}))})},ko=i=>{const e=Do++;return Te.push({hook:i,key:e}),me.length===0&&zt===!1&&(Fe=!0,(t=>{if(Oe.document&&Oe.document.createElement){const o=Oe.document.createElement("div");Gt.createRoot(o).render(v.jsx(t,{automaticContainerInternalUseOnly:!0}))}else Ie("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(Po)),ke(),()=>{Te.splice(Te.findIndex(t=>t.key===e),1),ke()}};let We=null;We||(We=(i,e,t={})=>{let o,n,r=!1,s=!1,a=[],{unmountIfNoConsumers:c=!1}=t;const u=d=>{var p;n=d,p=()=>a.forEach(w=>w(d)),Jt.unstable_batchedUpdates(p)},h=()=>(s||(n=typeof i=="function"?i():i,s=!0),n);return()=>{const[d,p]=l.useState(h);return l.useEffect(()=>(r||(r=!0,o=ko({initValue:i,useHookBody:e,applyStateChange:u})),a.push(p),n!==d&&p(n),()=>{a.splice(a.indexOf(p),1),a.length===0&&c&&(o(),r=!1)}),[]),d}});const Rt=We;let At=()=>{console.warn("You must call useEditMode before setting its state.")};const zo=Rt(null,()=>{const[i,e]=l.useState(null);return At=e,i});class De{constructor(e,t,o,n){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(o||{}),this._callback=n,n===void 0&&(this._callback=()=>{console.log(`implement: ${this.label()} : ${this.description()}`)})}key(){return this._key}_resolve(e,t){if(typeof e=="function"){const o=t??this._context;return e(typeof o=="function"?o():o)}return e}target(){return typeof this._target=="function"?this._target():this._target}label(e,t){const o=this._scopedLabels?.[e]||this._label;let n=null;if(typeof o=="function"){const r=t??this._context;n=o(typeof r=="function"?r():r)}else n=o;return n}description(e){return this._resolve(this._description,e)}tags(e){return this._resolve(this._tags,e)}icon(e){return this._resolve(this._icon,e)}shortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}state(){return this._resolve(this._state)}context(){return typeof this._context=="function"?this._context():this._context}async execute(e,t){if(!this.disabled()&&this._callback){try{let o=!0;if(t?.beforeExecute&&(o=t?.beforeExecute(this,e)),await Promise.resolve(o)===!1)return!1;const n=this._callback.bind(this)(e,this);if(await Promise.resolve(n)===!1)return!1;t?.onExecute?.(this,e),this._notifyExecute(e)}catch(o){return console.warn(o),t?.onError(this,o,e),this._notifyError(e,o),!1}return!0}}addPropertyListener(e,t=!1){if(!e)throw new Error("listener must be specified");const o=this._listenersProperties;return o.add(e),t&&e({},this),()=>{o.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const t=this._listenersExecute;return t.add(e),function(){t.delete(e)}}_notifyExecute(e){const t=this;this._listenersExecute.forEach(o=>{o.onExecute(t,e)})}_notifyError(e,t){const o=this;this._listenersExecute.forEach(n=>{n.onError?.(o,e,t)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const t=this._applyProps(e);return Object.keys(t).length>0&&this._notifyPropertyChange(t),this}_notifyPropertyChange(e){const t=this;this._listenersProperties.forEach(o=>{o(e,t)})}_applyProps(e){let t={},o=this;return Object.keys(e).forEach(n=>{let r=e[n];o["_"+n]!==r&&(o["_"+n]=t[n]=r)}),t}}class Le extends De{}class Xe{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=k.CommonUtils.uuidV4(),this._target=e,this._groupKey=t??null,this._root=this,this._nodes=new Map,this._nodes.set(t,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const o=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(n,r)=>{const s=o._root._listenersByKey,a=r.key(),c=s.get(a);c&&o._notifyCommands(c,"onCommandChange",r)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const o=this._root._focused;let n=o,r=o===this;for(;!r&&n;)n===this&&(r=!0),n=n._parent;return(r?o:this)._getCommand(e)}createChildGroup(e,t,o){let n;if(!o){let a=this;for(;a&&!n;){let c=a._nodes.get(t);c&&(n=c),a=a._parent}}n||(n=new Xe(e,t),n._parent=this,n._root=this._root,n._unListenersByCommand=null,n._listenersByKey=null,n._commandsPropertyListener=null);const r=(a,c)=>{!a.has(t)||o?a.set(t,c):o===void 0&&console.warn("commandGroup already registered",t)};r(this._root._nodes,n);let s=this._parent;for(;s;)r(this._nodes,n),s=s._parent;return this._children.set(t,n),this._notify("onGroupChange"),n}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const o=this._commandsByKey,n=this._commandsByShortcut,r=this._root._commandsPropertyListener,s=this._root._unListenersByCommand;for(let a=0;a<e.length;a++){const c=e[a],u=c.key();if(o.has(u)&&!t){t===void 0&&console.warn("command already registered",u);continue}o.set(u,c);let h=s.get(c);h&&(h(),s.delete(c));const d=c.addPropertyListener(r);s.set(c,d);const p=c.shortcut();if(!p)continue;const w=Array.isArray(p)?p:[p];for(let C=0;C<w.length;C++){const S=fe(w[C]),E=n.get(S);E&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${S}, ${u}, ${E}.`),n.set(S,u)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,t=[];const o=this._groupKey;for(;e;)t.push(e._nodes),e._nodes.delete(o),e=e._parent;e=this._parent;const n=r=>{r._children.forEach(s=>{for(let a=0;a<t.length;a++)s._nodes.delete(t[a]);n(s)})};n(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,t){this._addCommands(e,t),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let t=this;if(e&&(t=this._nodes.get(e),!t))return void console.warn("group not found",e);let o=this._root._focused??this._root;for(;o;)o=o._parent;this._root._focused!==t&&(this._root._focused=t,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const t=[];e.altKey&&t.push(W.Alt),e.shiftKey&&t.push(W.Shift),e.ctrlKey&&t.push(W.Ctrl),e.metaKey&&t.push(W.Meta);let o=fe({key:e.code,modifiers:t});const n=this._commandsByShortcut;let r=n.get(o);r||(o=fe({key:e.key,modifiers:t}),r=n.get(o)),!r&&e.code.startsWith("Digit")&&(o=fe({key:e.code.substring(5,e.code.length),modifiers:t}),r=this._commandsByShortcut.get(o)),!r&&e.code.startsWith("Key")&&(r=fe({key:e.code.substring(3,e.code.length),modifiers:t}),r=n.get(o));let s=null;return r&&(s=this._commandsByKey.get(r),s&&s.disabled()&&(s=null),!s||s.target()&&s.target().contains(e.target)||(s=null)),s||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const t=this.getActive();if(!t||e.isDefaultPrevented())return!1;const o=t.findCommandByEvent?.(e);return!!o&&(o.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,t){const o=this._listeners,n=t?.keys,r=this._root._listenersByKey;if(n&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let s=null;if(n)for(let a=0;a<n.length;a++){const c=n[a];if(!c)continue;let u=r.get(c);u||(u=new Set,r.set(c,u)),s||(s=[]),s.push(u),u.add(e)}return o.add(e),()=>{if(s)for(let a=0;a<s.length;a++)s[a].delete(e);o.delete(e)}}_notifyCommands(e,t,o){const n=this;setTimeout(()=>{e.forEach(r=>{r[t]?.(n,o)})},0)}_notify(e,t){const o=this;setTimeout(()=>{o._listeners.forEach(n=>{n[e]?.(o,t)}),o._parent&&o._parent._notify(e,t)},0)}getAllCommands(){const e=[],t=this._groupKey;return this._commandsByKey.forEach(o=>{e.push({command:o,groupKey:t})}),this._children.forEach(o=>{e.push(...o.getAllCommands())}),e}}const Ro=k.CommonUtils.getOS()===k.CommonUtils.OSType.MacOS||k.CommonUtils.getOS()===k.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Ao=k.CommonUtils.getOS()===k.CommonUtils.OSType.MacOS||k.CommonUtils.getOS()===k.CommonUtils.OSType.IOS?"⌘":"^",fe=(i,e=!1)=>{const t={};for(let n=0;i.modifiers&&n<i.modifiers.length;n++)t[i.modifiers[n]]=!0;let o="";return(t?.[W.Ctrl]||t?.[W.Meta])&&(o+=(o.length>0?"+":"")+(e?Ao:Ro)),t?.[W.Alt]&&(o+=e?"⌥":"Alt"),t?.[W.Shift]&&(o+=(o.length>0?"+":"")+(e?"⇧":"Shift")),o+=(o.length>0?"+":"")+Et(i.key),o},Me=(i,e)=>{const t=[];if(e)for(let o=0;o<e.length;o++){const n=e[o],r=n?i?.getCommand(n):null;t.push(r)}return t},ht=Rt({setClipboard:i=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>k.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[i,e]=l.useState(k.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>i,refNativeCopy:l.useRef(null),refNativeLastKey:l.useRef(null)}});let je=!1,Bo=0;var Oo=typeof document<"u"?l.useLayoutEffect:l.useEffect;const dt=()=>"sheetxl-ui-"+Bo++,pt=l.useId,jo=pt??function(){const[i,e]=l.useState(()=>je?dt():void 0);return Oo(()=>{i==null&&e(dt())},[]),l.useEffect(()=>{je||(je=!0)},[]),i},ft="Undo the last action.",_t="Repeat the last action or undo the redo.",$o=i=>`Redo ${i}`;exports.Command=De,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=Xe,exports.DefaultReactNotifier=Pt,exports.FocusKeyNavigation=So,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.KeyCodes={BackSpace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Delete:46,Digit_8:56,Y:89,Z:90,Meta:91,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,BackSlash:220,Slash:191,BracketRight:221,BracketLeft:219},exports.KeyModifiers=W,exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:i,notifier:e})=>(l.useEffect(()=>{const t=k.Notifier.getOverrides();return k.Notifier.setOverrides(e),()=>{k.Notifier.setOverrides(t)}},[e]),l.createElement(kt.Provider,{value:e},i)),exports.NotifierType=Ve,exports.ReactUtils=mo,exports.RoundedTab=Co,exports.ScrollPane=Mt,exports.ScrollUtils=to,exports.Scrollbar=ze,exports.ScrollbarOrientation=ee,exports.SimpleCommand=Le,exports.SplitPane=Lo,exports.SplitPaneResizer=Dt,exports.ToolTipPlacement={BottomEnd:"bottom-end",BottomStart:"bottom-start",Bottom:"bottom",LeftEnd:"left-end",LeftStart:"left-start",Left:"left",RightEnd:"right-end",RightStart:"right-start",Right:"right",TopEnd:"top-end",TopStart:"top-start",Top:"top"},exports.VirtualScrollbar=Tt,exports.defaultCreateScrollCorner=Lt,exports.defaultCreateScrollEdgeButton=i=>{const{style:e,orientation:t=ee.Vertical,...o}=i,n=t===ee.Vertical,r=n?"rotate(90) ":"";return v.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${n?"vertical":"horizontal"} edge`,...o,children:v.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:r,children:v.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:i.disabled?0:1},d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})})})},exports.defaultCreateScrollEndButton=vt,exports.defaultCreateScrollStartButton=yt,exports.defaultCreateScrollbar=He,exports.getDevicePixelRatio=function(i){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:o=!0}=i||{},n=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,o?Math.floor(n):n),t)},exports.toShortcutString=fe,exports.useCallbackRef=L,exports.useCommand=function(i,e=null){const t=l.useRef(e);t.current=e;const[o,n]=l.useReducer(s=>s+1,0),r=l.useMemo(()=>Array.isArray(i)?i:[i],[i]);return l.useEffect(()=>{if(!r||r.length===0)return;const s=(u,h)=>{t.current?.onChange?.(h),n()};let a=null;e&&(a={onExecute(u,h){t.current?.onExecute?.(u,h)},onError(u,h,d){t.current?.onError?.(u,h,d)}});const c=new Set;for(let u=0;u<r.length;u++)c.add(r[u]?.addPropertyListener(k.CommonUtils.debounce(s,0),!0)),e&&c.add(r[u]?.addExecuteListener(a));return()=>{c.forEach(u=>{u?.()})}},[i]),o},exports.useCommands=function(i,e=null,t=null,o){const n=l.useRef(t);n.current=t,e&&!Array.isArray(e)&&(e=[e]);const[r,s]=l.useState(Me(i,e)),a=o?[...o,i]:[i];return l.useEffect(()=>{const c={onGroupChange:()=>{const p=Me(i,e);s(p),n.current?.onChange?.(this)}};let u;e&&e.length>0&&(u={keys:e},c.onCommandChange=(p,w)=>{n.current?.onChange?.(i),s(Me(i,e))});const h=i?.addListener(c,u),d=Me(i,e);return s(d),n.current?.onChange&&n.current?.onChange(i),()=>{h?.()}},a),r},exports.useCopyPaste=i=>{const{source:e,target:t,onPaste:o,onClipboardUpdate:n,commands:r}=i,s=Be(),a=L(n,[n]),c=L(o,[o]),{getClipboard:u,refNativeCopy:h}=ht(),d=u();l.useMemo(()=>{const _=e?.element,x=t?.element??e?.element;if(!r)return;const g=[new Le("cut",_,{label:"Cut",description:"Remove the selection and put it on the clipboard so you can paste it somewhere else.",shortcut:{key:"X",modifiers:[W.Ctrl]}}),new Le("copy",_,{label:"Copy",description:"Put a copy of the selection on the clipboard so you can paste it somewhere else.",shortcut:{key:"C",modifiers:[W.Ctrl]}}),new Le("paste",x,{label:"Paste",description:"Add content on the clipboard to your document.",shortcut:[{key:"V",modifiers:[W.Ctrl]},{key:"F8",modifiers:[W.Ctrl]}]})];r?.addCommands(g,!0)},[r]);const p=L(async _=>{if(!e?.element)return;let x=null;try{x=e.doCopy?.(_),typeof x=="string"?await d.writeText(x):await d.writeReference(x)}catch(g){throw g}},[e,s]),w=L(async _=>{const x=e?.element?.();if(x){h.current={sourceElement:x,args:_};try{await p(_)}catch(g){s.showError?.(g)}}},[e?.element,s]),C=l.useCallback(()=>{w({isCut:!0})},[]),S=L(async(_,x,g)=>{try{if(await _.doPaste(x,g)===!1)return;c?.(x,g)}catch(A){s.showError?.(A)}},[c]),E=L(async(_,x,g)=>{const A=t?.element?.();if(A&&await k.CommonUtils.whenFocus(A),!_&&!x)return;const R=await s.showBusy?.("Pasting...");if(x)try{return await S(t,x,g),void R?.()}catch(y){R?.(),s.showError?.(y)}let j,N=t.importFromExternal;N||(N=(y,b)=>({getItemType:()=>"text",toText:()=>_.text,isClipboardItem:!0}));try{j=await N(_,{isCut:!1})}catch(y){R?.(),s.showError?.(y)}if(j)try{const y=await Promise.resolve(j);await S(t,y,g),R?.()}catch(y){R?.(),s.showError?.(y)}else R?.()},[S,t,s]),z=L(async _=>{if(t?.element)try{const x=await d.readReference();if(x)return void await E(null,x,_);const g=[];g[0]=await k.ClipboardUtils.readStringFromClipboard(d,k.MimeType.plain),g[1]=await k.ClipboardUtils.readHTMLFromClipboard(d,k.MimeType.html),g[2]=await k.ClipboardUtils.readBlobFromClipboard(d,k.MimeType.png);const A={text:g[0]??null,html:g[1]??null,image:g[2]??null};await E(A,null,_)}catch(x){if(x?.message==="Document is not focused.")return;s.showError?.(x)}},[E,t?.element,s]);return L(async _=>{},[e?.element]),L(async _=>{},[t?.element,E,s]),l.useEffect(()=>{if(!d)return;const _=async A=>{const R=await d.readReference();a?.(R)},x=A=>{s.showMessage?.(k.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},g=A=>{s.showMessage?.(k.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",_),d.addEventListener("clipboarderrorread",x),d.addEventListener("clipboarderrorwrite",g),()=>{d.removeEventListener("clipboardchange",_),d.removeEventListener("clipboarderrorread",x),d.removeEventListener("clipboarderrorwrite",g)}},[d,s]),l.useEffect(()=>{},[p,E,e,t]),l.useEffect(()=>{r?.getCommand("cut")?.updateCallback(C).update({disabled:!e||!t}),r?.getCommand("copy")?.updateCallback(w).update({disabled:!e}),r?.getCommand("paste")?.updateCallback(z).update({disabled:!t})},[e,t,r]),{paste:z,copy:w,clipboard:d}},exports.useDevicePixelRatio=function(i){const[e,t]=l.useState(typeof window<"u"?window.devicePixelRatio:1),o=l.useRef(null);return l.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const n=()=>{const r=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);r.addEventListener("change",n,{once:!0,passive:!0}),t(window.devicePixelRatio),o.current={mediaMatcher:r,listener:n}};return n(),()=>{o.current&&o.current.mediaMatcher.removeEventListener("change",o.current.listener)}},[i]),e},exports.useEditMode=()=>{const i=zo();return l.useMemo(()=>({setMode:e=>{At(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>i}),[i])},exports.useFullscreenPortal=function(){const[i,e]=l.useState(!!document.fullscreenElement),t=l.useCallback(()=>{const o=document.fullscreenElement;return o?o.querySelector(".fullscreen-portal-root")||o:document.body},[]);return l.useEffect(()=>{function o(){const n=document.fullscreenElement;if(e(!!n),!n)return;let r=n.querySelector(".fullscreen-portal-root");r||(r=document.createElement("div"),r.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",n.appendChild(r))}return Se++,o(),document.addEventListener("fullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),Se--,Se<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(n=>{n.parentNode&&n.parentNode.removeChild(n)}),Se=0)}},[]),{getPortalContainer:t,isFullscreen:i}},exports.useGlobalClipboard=ht,exports.useId=jo,exports.useImperativeElement=Ye,exports.useMouseDownAndHoldListener=function(i,e){return ut({onPointerDown:i,onPointerMoveOrWait:(t,o,n)=>{i?.(n)},...e})},exports.useNotifier=Be,exports.useOnClickOrFocusAway=function(i,e,t){const o=L(e,[e]);l.useEffect(()=>{const n=r=>{i.current&&!i.current.contains(r.target)&&o(r)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",n),document.addEventListener("touchstart",n)),t&&t.focusEvents===!1||document.addEventListener("focus",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n),document.removeEventListener("focus",n)}},[i])},exports.useSynchronizedPointerHandler=ut,exports.useTraceUpdate=function(i,e=!0){const t=l.useRef(i);l.useEffect(()=>{if(e){const o=Object.entries(i).reduce((n,[r,s])=>(t.current[r]!==s&&(n[r]=[t.current[r],s]),n),{});Object.keys(o).length>0&&console.log("Changed props:",o)}t.current=i})},exports.useUndoManager=({manager:i,commands:e,disabled:t})=>{const o=Be(),n=L(s=>{try{i?.undo(s)}catch(a){o.error(a)}},[i]),r=L(s=>{try{i?.redo(s)}catch(a){o.error(a)}},[i]);return l.useMemo(()=>{if(!e)return;const s={contains:c=>!0,focus(){}},a=[new De("undo",s,{label:"Undo",description:ft,shortcut:{key:"z",modifiers:[W.Ctrl]},disabled:!0},n),new De("redo",s,{label:"Redo",description:_t,shortcut:[{key:"y",modifiers:[W.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[W.Alt]}],disabled:!0},r)];e?.addCommands(a,!0)},[e]),l.useEffect(()=>{if(!e)return;const s=()=>{const c=i?.getTopUndoDescription(),u={};var h;e.getCommand("undo").update({disabled:t||!i||!i.hasUndo(),description:c?(h=c,`Undo ${h}`):ft,state:u,context:{undoManager:i}});const d=i?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!i||!i.hasRedo(),description:d?$o(d):_t,state:u,context:{undoManager:i}})};if(s(),!i)return;const a=i.addListener({onStackChange(){s()}});return()=>a?.()},[i,e,t]),{undo:n,redo:r}};
|
|
7
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),u=require("react"),A=require("@sheetxl/utils"),on=require("react-dom/client"),rn=require("react-dom"),F={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"},ee={Horizontal:"horizontal",Vertical:"vertical"};function St(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var o=i.length;for(e=0;e<o;e++)i[e]&&(t=St(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function pe(){for(var i,e,t=0,n="",o=arguments.length;t<o;t++)(i=arguments[t])&&(e=St(i))&&(n&&(n+=" "),n+=e);return n}var sn=function(){},Ct=typeof window<"u",ln=Ct?u.useLayoutEffect:u.useEffect,rt={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const ue=Ct&&window.ResizeObserver!==void 0?function(){var i=u.useState(null),e=i[0],t=i[1],n=u.useState(rt),o=n[0],r=n[1],a=u.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var s=h[0].contentRect,l=s.x,c=s.y,d=s.width,f=s.height,m=s.top,b=s.left,v=s.bottom,C=s.right;r({x:l,y:c,width:d,height:f,top:m,left:b,bottom:v,right:C})}})},[]);return ln(function(){if(e)return a.observe(e),function(){a.disconnect()}},[e]),[t,o]}:function(){return[sn,rt]},P=(i,e)=>{const t=u.useCallback((...r)=>i?.(...r),e),n=u.useRef(null);n.current=t;const o=u.useCallback((...r)=>n.current?.(...r),[]);if(n.current)return o},Et=i=>{const{style:e,orientation:t=ee.Vertical,...n}=i,o=t===ee.Vertical,r=o?"m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z":"m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z";return _.jsx("div",{style:{paddingBottom:"0px",paddingRight:"0px",paddingLeft:o?"0px":"3px",paddingTop:o?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...n,children:_.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${o?"vertical":"horizontal"} single-button start`,children:_.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:_.jsx("path",{d:r})})})})},Mt=i=>{const{style:e,orientation:t=ee.Vertical,...n}=i,o=t===ee.Vertical,r=o?"M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z":"m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z";return _.jsx("div",{style:{paddingLeft:"0px",paddingTop:"0px",paddingRight:o?"0px":"3px",paddingBottom:o?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...n,children:_.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${o?"vertical":"horizontal"} single-button end`,children:_.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:_.jsx("path",{d:r})})})})},$e=(i,e,t,n,o=0)=>{for(let r=0;r<t.length;r++){const a=t[r].getBoundingClientRect();let h=a.left-e,s=h+a.width;if(n){if(h<i&&s>=i)return h}else if(Math.ceil(s)>Math.ceil(i)+2)return s}return o},an=Object.freeze(Object.defineProperty({__proto__:null,getScrollTo:$e},Symbol.toStringTag,{value:"Module"})),cn="_sheetxl-scrollbar_eblx4_6",je=u.memo(u.forwardRef((i,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:o=0,style:r,className:a,orientation:h=ee.Vertical,onScrollOffset:s,onScroll:l,showCustomScrollButtons:c=!1,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:m=120,createScrollStartButton:b=Et,createScrollEndButton:v=Mt,...C}=i,T=P(l,[l]),g=u.useRef(null),[w,{width:S,height:z}]=ue(),[j,{width:$,height:B}]=ue(),x=h===ee.Vertical,E=x?"top":"left",k=x?"scrollTop":"scrollLeft",p=x?z:S,M=x?B:$,[y,L]=u.useState(null);u.useEffect(()=>{y!==null&&g.current&&g.current.scrollTo({behavior:"smooth",[E]:y})},[y,x]);const K=u.useCallback((O,Z=!1)=>{if(!g.current)return 0;const te=g.current.querySelector(".scrollbar-viewport"),ae=te.getBoundingClientRect(),oe=te.children,ie=Z?0:$e(O,ae[E],oe,!0,Math.max(0,O-d));return L(ie),Math.max(0,ie)},[]),G=u.useCallback((O,Z=!1)=>{if(!g.current)return 0;const te=g.current.querySelector(".scrollbar-viewport"),ae=te.getBoundingClientRect(),oe=te.children,ie=Math.ceil(M-p),ge=Z?ie:$e(O,ae[E],oe,!1,Math.max(0,O+d));return L(ge),Math.min(ie,ge)},[M,p]),H=u.useRef(null),q=u.useCallback(O=>{if(H.current!==null)return void(H.current=null);const Z=O.target[k];s(Z,o,n),T?.(O)},[s,o,n,t]);u.useEffect(()=>{const O=H.current;t!==O&&g.current[k]!==t&&(H.current=t,g.current[k]=t)},[t,k]);const V=u.useRef(null),R=u.useRef(null),I=u.useCallback(()=>{V.current&&(clearTimeout(V.current),V.current=null,R.current=null)},[]),W=u.useCallback((O,Z,te,ae=f)=>{R.current=O,V.current=setTimeout(()=>{const oe=te?K(R.current||O):G(R.current||O);oe!==R.current?W(oe,!1,te,m):I()},Z?0:ae)},[K,G,I]);u.useEffect(()=>()=>I(),[I]);const he=u.useMemo(()=>{if(!c)return null;const O={orientation:h,disabled:Math.floor(t)<=0||Math.floor(M-p)===0,onMouseUp:I,onMouseLeave:I,onMouseDown:()=>W(t,!0,!0)};return b?.(O)},[c,h,t,y,M,p]),de=u.useMemo(()=>{if(!c)return null;const O={orientation:h,disabled:Math.floor(M-p)<=Math.ceil(t),onMouseUp:I,onMouseLeave:I,onMouseDown:()=>W(t,!0,!1)};return v?.(O)},[c,h,t,y,M,p]);return _.jsxs("div",{ref:e,style:{display:"flex",flex:"1",flexDirection:x?"column":"row",padding:"0",...r},className:pe(cn,a),...C,children:[he,_.jsx("div",{className:"pseudo-scrollbar",style:{flex:"1 1 100%",display:"flex",boxSizing:"content-box",flexDirection:x?"column":"row",justifyContent:"center",alignItems:"center"},ref:w,children:_.jsx("div",{tabIndex:-1,style:{flex:"1 1 100%",overflowY:x?"scroll":"hidden",overflowX:x?"hidden":"scroll",position:"relative",willChange:"transform"},onScroll:q,ref:g,children:_.jsx("div",{ref:j,style:{position:"absolute",height:x?n-o+(z??0):1,width:x?1:n-o+(S??0)},className:"scrollbar-viewport"})})}),de]})}));je.displayName="Scrollbar";let st=Date.now,lt=1e3,le={},un=1;const ye=i=>{let e=le[i]!==null;return e&&(le[i]=null),e},at=(i,e,t,n=0,o)=>{let r=st(),a=r,h=0,s=0,l=0,c=un++;if(c%20==0){const f={};for(let m in le)f[m]=!0;le=f}const d=function(f){let m=f!==!0,b=st(),v=!0;try{v=(!e||e(c))??!0}catch{v=!1}if(!le[c]||!v)return le[c]=null,void t?.(60-s/((b-r)/lt),c,!1);if(m){l=Math.round((b-a)/16.666666666666668)-1;for(let g=0;g<Math.min(l,4);g++)d(!0),s++}n&&(h=(b-r)/n,h>1&&(h=1));let C=o?o(h):h,T=!1;try{T=i(C,b,m)}catch{T=!1}T!==!1&&h!==1||!m?m&&(a=b,requestAnimationFrame(d)):(le[c]=null,t?.(60-s/((b-r)/lt),c,h===1||n==null))};return le[c]=!0,requestAnimationFrame(d),c},hn=function(i){return Math.pow(i-1,3)+1},dn=function(i){return(i/=.5)<1?.5*Math.pow(i,3):.5*(Math.pow(i-2,3)+2)};class fn{constructor(e,t){this.__isSingleTouch=!1,this.__isTracking=!1,this.__didDecelerationComplete=!1,this.__isGesturing=!1,this.__isDragging=!1,this.__isDecelerating=0,this.__isAnimating=0,this.__interruptedAnimation=!1,this.__lastScale=1,this.__enableScrollX=!0,this.__enableScrollY=!0,this.__clientLeft=0,this.__clientTop=0,this.__clientWidth=0,this.__clientHeight=0,this.__contentWidth=0,this.__contentHeight=0,this.__snapWidth=100,this.__snapHeight=100,this.__zoomLevel=1,this.__scrollLeft=0,this.__scrollTop=0,this.__maxScrollLeft=0,this.__maxScrollTop=0,this.__scheduledLeft=0,this.__scheduledTop=0,this.__scheduledZoom=0,this.__lastTouchLeft=0,this.__lastTouchTop=0,this.__lastTouchMove=0,this.__positions=[],this.__initialTouchLeft=0,this.__initialTouchTop=0,this.__zoomLevelStart=1,this.__minDecelerationScrollLeft=null,this.__minDecelerationScrollTop=null,this.__maxDecelerationScrollLeft=null,this.__maxDecelerationScrollTop=null,this.__decelerationVelocityX=null,this.__decelerationVelocityY=0,this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:void 0,penetrationDeceleration:.03,penetrationAcceleration:.08,...t}}setDimensions(e,t,n,o){e!==null&&(this.__clientWidth=e),t!==null&&(this.__clientHeight=t),n!==null&&(this.__contentWidth=n),o!==null&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)}setPosition(e,t){this.__clientLeft=e||0,this.__clientTop=t||0}setSnapSize(e,t){this.__snapWidth=e,this.__snapHeight=t}getValues(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}}getPoint(e,t){const n=this.getValues();return{left:e/n.zoom,top:t/n.zoom}}getScrollMax(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}}zoomTo(e,t=!1,n,o,r){if(!this.options.zooming)throw new Error("Zooming is not enabled!");r&&(this.__zoomComplete=r),this.__isDecelerating&&(ye(this.__isDecelerating),this.__isDecelerating=0);const a=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),o===void 0&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const h=e/a;let s=h*(this.__scrollLeft+n)-n,l=h*(this.__scrollTop+o)-o;s>this.__maxScrollLeft?s=this.__maxScrollLeft:s<0&&(s=0),l>this.__maxScrollTop?l=this.__maxScrollTop:l<0&&(l=0),this.__publish(s,l,e,t)}zoomBy(e,t=!1,n=0,o=0,r){this.zoomTo(this.__zoomLevel*e,t,n,o,r)}scrollTo(e,t,n=!1,o=1){if(this.__isDecelerating&&(ye(this.__isDecelerating),this.__isDecelerating=0),o!==void 0&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(n=!1),this.__publish(e,t,o,n)}scrollBy(e=0,t=0,n=!1){const o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,r=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),r+(t||0),n)}doMouseZoom(e,t,n,o){const r=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*r,!1,n-this.__clientLeft,o-this.__clientTop)}doTouchStart(e,t){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);let n,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(ye(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(ye(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let r=e.length===1;r?(n=e[0].pageX,o=e[0].pageY):(n=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!r&&this.options.scrollingX,this.__enableScrollY=!r&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!r,this.__isSingleTouch=r,this.__positions=[]}doTouchMove(e,t,n=1){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);if(!this.__isTracking)return;let o,r;e.length===2?(o=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,r=e[0].pageY);let a=this.__positions;if(this.__isDragging){let h=o-this.__lastTouchLeft,s=r-this.__lastTouchTop,l=this.__scrollLeft,c=this.__scrollTop,d=this.__zoomLevel;if(n!==void 0&&this.options.zooming){let f=d;if(d=d/this.__lastScale*n,d=Math.max(Math.min(d,this.options.maxZoom),this.options.minZoom),f!==d){let m=o-this.__clientLeft,b=r-this.__clientTop;l=(m+l)*d/f-m,c=(b+c)*d/f-b,this.__computeScrollMax(d)}}if(this.__enableScrollX){l-=h*this.options.speedMultiplier;let f=this.__maxScrollLeft;(l>f||l<0)&&(this.options.bouncing?l+=h/2*this.options.speedMultiplier:l=l>f?f:0)}if(this.__enableScrollY){c-=s*this.options.speedMultiplier;const f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?c+=s/2*this.options.speedMultiplier:c=c>f?f:0)}a.length>60&&a.splice(0,30),a.push(l,c,t),this.__publish(l,c,d)}else{let h=this.options.locking?3:0,s=5,l=Math.abs(o-this.__initialTouchLeft),c=Math.abs(r-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&l>=h,this.__enableScrollY=this.options.scrollingY&&c>=h,a.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(l>=s||c>=s),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=r,this.__lastTouchMove=t,this.__lastScale=n}doTouchEnd(e){if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){let t=this.__positions,n=t.length-1,o=n;for(let r=n;r>0&&t[r]>this.__lastTouchMove-100;r-=3)o=r;if(o!==n){const r=t[n]-t[o],a=this.__scrollLeft-t[o-2],h=this.__scrollTop-t[o-1];this.__decelerationVelocityX=a/r*(1e3/60),this.__decelerationVelocityY=h/r*(1e3/60);const s=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>s||Math.abs(this.__decelerationVelocityY)>s)&&this.__startDeceleration(e)}else this.options.scrollingComplete?.()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete?.();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}}__publish(e,t,n,o=!1){const r=this.__isAnimating;if(r&&(ye(r),this.__isAnimating=0),o&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const a=this.__scrollLeft,h=this.__scrollTop,s=this.__zoomLevel,l=e-a,c=t-h,d=n-s,f=function(v,C,T){T&&(this.__scrollLeft=a+l*v,this.__scrollTop=h+c*v,this.__zoomLevel=s+d*v,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),m=function(v){return this.__isAnimating===v}.bind(this),b=function(v,C,T){C===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||T)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=at(f,m,b,this.options.animationDuration,r?hn:dn)}else this.__scheduledLeft=this.__scrollLeft=e,this.__scheduledTop=this.__scrollTop=t,this.__scheduledZoom=this.__zoomLevel=n,this.__callback&&this.__callback(e,t,n),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}__computeScrollMax(e=this.__zoomLevel){this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)}__startDeceleration(e){if(this.options.paging){const a=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),h=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),s=this.__clientWidth,l=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(a/s)*s,this.__minDecelerationScrollTop=Math.floor(h/l)*l,this.__maxDecelerationScrollLeft=Math.ceil(a/s)*s,this.__maxDecelerationScrollTop=Math.ceil(h/l)*l}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(a,h,s){this.__stepThroughDeceleration(s)}.bind(this),n=this.options.snapping?4:.1,o=function(){const a=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return a||(this.__didDecelerationComplete=!0),a}.bind(this),r=function(a,h,s){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=at(t,o,r)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);const r=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);r!==n&&(n=r,this.__decelerationVelocityY=0)}if(e?this.__publish(t,n,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=n),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){let o=0,r=0,a=this.options.penetrationDeceleration,h=this.options.penetrationAcceleration;t<this.__minDecelerationScrollLeft?o=this.__minDecelerationScrollLeft-t:t>this.__maxDecelerationScrollLeft&&(o=this.__maxDecelerationScrollLeft-t),n<this.__minDecelerationScrollTop?r=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-n),o!==0&&(o*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=o*a:this.__decelerationVelocityX=o*h),r!==0&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*a:this.__decelerationVelocityY=r*h)}}}var X=typeof window<"u"?window:{screen:{},navigator:{}},_e=(X.matchMedia||function(){return{matches:!1}}).bind(X),Lt=!1,pn={get passive(){return Lt=!0}},ct=function(){};X.addEventListener&&X.addEventListener("p",ct,pn),X.removeEventListener&&X.removeEventListener("p",ct,!1);var mn=Lt,_n="PointerEvent"in X,Ue="ontouchstart"in X,Tt=Ue||"TouchEvent"in X&&_e("(any-pointer: coarse)").matches,ut=(X.navigator.maxTouchPoints||0)>0||Tt,kt=X.navigator.userAgent||"",gn=_e("(pointer: coarse)").matches&&/iPad|Macintosh/.test(kt)&&Math.min(X.screen.width||0,X.screen.height||0)>=768,Dt=(_e("(pointer: coarse)").matches||!_e("(pointer: fine)").matches&&Ue)&&!/Windows.*Firefox/.test(kt),yn=_e("(any-pointer: fine)").matches||_e("(any-hover: hover)").matches||gn||!Ue,Ke=!ut||!yn&&Dt?ut?"touchOnly":"mouseOnly":"hybrid",vn=Ke==="mouseOnly"?"mouse":Ke==="touchOnly"||Dt?"touch":"mouse";const xn=Object.freeze(Object.defineProperty({__proto__:null,deviceType:Ke,primaryInput:vn,supportsPassiveEvents:mn,supportsPointerEvents:_n,supportsTouchEvents:Tt},Symbol.toStringTag,{value:"Module"})),bn=new Set(["INPUT","TEXTAREA","SELECT"]),Pt={};function Ne(){return xn}const At=i=>i==="BracketLeft"?"[":i==="BracketRight"?"]":A.CommonUtils.camelToPrettyCase(i),wn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Pt,boundPixel:function(i,e=!1,t=0){return i},createSyntheticEvent:i=>{let e=!1,t=!1;return{nativeEvent:i,currentTarget:i.currentTarget,target:i.target,bubbles:i.bubbles,cancelable:i.cancelable,defaultPrevented:i.defaultPrevented,eventPhase:i.eventPhase,isTrusted:i.isTrusted,preventDefault:()=>{e=!0,i.preventDefault()},isDefaultPrevented:()=>e,stopPropagation:()=>{t=!0,i.stopPropagation()},isPropagationStopped:()=>t,persist:()=>{},timeStamp:i.timeStamp,type:i.type}},detectIt:Ne,focusableNodeNames:bn,toPrettyKeyCode:At},Symbol.toStringTag,{value:"Module"})),Sn=[];function Ye(i,e,t=Sn){const n=u.useRef(null);return u.useImperativeHandle(i,()=>{if(!n.current)return;const o=n.current,r=e?.();if(!r||typeof r!="object")throw new Error("attributes must return a plain object of values");const a=Object.keys(r),h=a.length;for(let s=0;s<h;s++){const l=a[s],c=r[l];Object.defineProperty(o,l,{value:c,writable:!0,configurable:!0,enumerable:!0})}return o},t),n}const Ie=i=>_.jsx(je,{...i}),jt=({width:i,height:e})=>_.jsx("div",{className:"corner",style:{minWidth:`${i}px`,width:`${i}px`,minHeight:`${e}px`,height:`${e}px`}}),zt=u.memo(u.forwardRef((i,e)=>{const{children:t,viewport:n,onScrollViewport:o,showHorizontalScrollbar:r=!0,showVerticalScrollbar:a=!0,createScrollCorner:h=jt,createHorizontalScrollbar:s=Ie,createVerticalScrollbar:l=Ie,style:c,touchElement:d,disableTouch:f,...m}=i,b=P(o,[o]),v=Ye(e,()=>({isScrollPane:()=>!0}),[]),C=u.useRef(null);u.useEffect(()=>{C.current&&(C.current.__scrollTop===n?.top&&C.current.__scrollLeft===n?.left||C.current.__isDecelerating||C.current?.scrollTo(n?.left,n?.top,!1))},[n?.left,n?.top,d]);const T=u.useCallback((p,M)=>{b?.({left:p,top:M})},[]),g=u.useCallback(p=>{C.current?.doTouchStart(p.touches,p.timeStamp)},[]),w=u.useCallback(p=>{p.preventDefault(),C.current?.doTouchMove(p.touches,p.timeStamp)},[]),S=u.useCallback(p=>{C.current?.doTouchEnd(p.timeStamp)},[]),z=u.useCallback(({containerWidth:p,containerHeight:M,totalWidth:y,totalHeight:L})=>{C.current.setDimensions(p,M,y,L)},[]);u.useEffect(()=>{const p=d??v.current;if(!f&&Ne().supportsTouchEvents&&p&&n){if(!C.current){const M={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};C.current=new fn(T,M)}Ne().supportsTouchEvents&&(p.addEventListener("touchstart",g),p.addEventListener("touchend",S),p.addEventListener("touchmove",w)),z({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{p?.removeEventListener("touchstart",g),p?.removeEventListener("touchend",S),p?.removeEventListener("touchmove",w)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,f,d]);const[j,{width:$}]=ue(),[B,{height:x}]=ue(),E=u.useMemo(()=>{const p=l({orientation:ee.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:M=>{b?.({top:M})}});return _.jsx("div",{style:{display:"flex",flex:"0"},ref:j,children:p})},[l,n?.top,n?.height,n?.totalHeight]),k=u.useMemo(()=>{const p=s({orientation:ee.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:M=>{b?.({left:M})}});return _.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[_.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${$}px)`},children:_.jsx("div",{ref:B,className:"sizer",children:p})}),a?h({width:$,height:x}):_.jsx(_.Fragment,{})]})},[s,n?.left,n?.width,n?.totalWidth,a,h,$,x]);return _.jsx("div",{style:{position:"relative",display:"flex",minWidth:a?`${$}px`:void 0,minHeight:r?`${x}px`:void 0,...c},...m,ref:v,children:_.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[_.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[_.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:t}),a?E:_.jsx(_.Fragment,{})]}),r?k:_.jsx(_.Fragment,{})]})})}));zt.displayName="ScrollPane";let Ce=0;const Cn=100,En=100,Mn=1e6,Ln=100,Tn=50,Rt=u.memo(u.forwardRef((i,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:o=0,minSize:r=0,endGap:a=Cn,endScrollIncrement:h=En,style:s=Pt,onMouseDown:l,onScrollOffset:c,onScroll:d,scaleLimit:f=Mn,scaleFactor:m=Ln,precisionFactor:b=Tn,...v}=i;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const C=P(l,[l]),[T,g]=u.useState(!1),w=u.useRef(null),S=u.useMemo(()=>{const k=f===0?o:Math.min(o??0,Math.max(r??0,(t??0)+(n??0))+(a??0)),p=f!==0&&k>f?m:1,M=Math.ceil(k/p),y={offset:Math.ceil(t/p),totalSize:M,viewportSize:Math.ceil(n/p),scaledOffset:t,scaledTotalSize:o,scaledViewportSize:n};return w.current=T?null:y,y},[t,o,n,T,r,a,h]),z=f!==0&&S.totalSize>f?m:1,j=z/b,$=P((k,p,M)=>{const y=w.current;if(w.current=null,y&&y.scaledTotalSize===o&&y.scaledViewportSize===n&&y.scaledOffset===t)return;const L=S.offset;Math.abs(k-L)<j&&(k=L),c?.(k*z,L,S.viewportSize)},[c,z,j,S]),B=u.useCallback(k=>{},[]),x=u.useCallback(k=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",x),g(!1)},[]),E=u.useCallback(k=>{g(!0),C?.(k),document.addEventListener("mousemove",B,{passive:!0}),document.addEventListener("mouseup",x,{passive:!0})},[B,x]);return _.jsx(je,{ref:e,style:s,...v,offset:S.offset,totalSize:S.totalSize,viewportSize:S.viewportSize,onMouseDown:E,onScrollOffset:$})}));Rt.displayName="VirtualScrollbar";function Re(i,e){if(typeof i=="function")return i(e);i&&(i.current=e)}var Pe=parseInt(u.version.split(".")[0],10)>=19?function(i){return e=>{const t=[];for(const n of i){const o=Re(n,e),r=typeof o=="function";t.push(r?o:()=>Re(n,null))}return()=>{for(const n of t)n()}}}:function(i){return e=>{for(const t of i)Re(t,e)}};const kn=u.memo(u.forwardRef((i,e)=>{const{refFocusStart:t,...n}=i,o=u.useRef(null),r=u.useCallback(()=>{if(t)return void t?.current?.focus();const a=o.current.parentElement.children;let h=[];const s=a.length;for(let l=0;l<s&&a[l]!==o.current;l++){const c=a[l],d=c.getAttribute("tabindex");d==null||d==="-1"||c.getAttribute("disabled")!=="true"&&c.focus&&h.push({tabindex:parseInt(d),child:c})}h.length!==0&&(h.sort(function(l,c){return l.tabindex-c.tabindex}),h[0].child.focus())},[t]);return _.jsx("div",{tabIndex:0,ref:Pe([o,e]),onFocus:r,...n})})),Dn=u.memo(u.forwardRef((i,e)=>{const{className:t,style:n,children:o,radius:r=4,strokeWidth:a=1,strokeColor:h="grey",...s}=i,[l,{width:c,height:d}]=ue(),f=u.useRef(null),m=(T,g=0)=>{const w=T/2,S=d-w+g;return(function(z,j,$=!1){if(j===0)return z;function B(y,L,K){let G=L.x-y.x,H=L.y-y.y,q=Math.sqrt(G*G+H*H);return x(y,L,Math.min(1,K/q))}function x(y,L,K){return{x:y.x+(L.x-y.x)*K,y:y.y+(L.y-y.y)*K}}function E(y,L){y.length>2&&(y[y.length-2]=L.x,y[y.length-1]=L.y)}function k(y){return{x:parseFloat(y[y.length-2]),y:parseFloat(y[y.length-1])}}let p=z.split(/[,\s]/).reduce(function(y,L){let K=L.match("([a-zA-Z])(.+)");return K?(y.push(K[1]),y.push(K[2])):y.push(L),y},[]).reduce(function(y,L){return parseFloat(L)==L&&y.length?y[y.length-1].push(L):y.push([L]),y},[]),M=[];if(p.length>1){let y=k(p[0]),L=null;p[p.length-1][0]==="Z"&&p[0].length>2&&(L=["L",y.x,y.y],p[p.length-1]=L),M.push(p[0]);for(let K=1;K<p.length;K++){let G=M[M.length-1],H=p[K],q=H===L?p[1]:p[K+1];if(q&&G&&G.length>2&&H[0]==="L"&&q.length>2&&q[0]==="L"){let V,R,I=k(G),W=k(H),he=k(q);$?(V=x(W,G.origPoint||I,j),R=x(W,q.origPoint||he,j)):(V=B(W,I,j),R=B(W,he,j)),E(H,V),H.origPoint=W,M.push(H);let de=x(V,W,.5),O=x(W,R,.5),Z=["C",de.x,de.y,O.x,O.y,R.x,R.y];Z.origPoint=W,M.push(Z)}else M.push(H)}if(L){let K=k(M[M.length-1]);M.push(["Z"]),E(M[0],K)}}else M=p;return M.reduce(function(y,L){return y+L.join(" ")+" "},"")})(`${`M 0 ${w} L ${r-.5} ${w} L ${r-.5} ${S} L ${2*r} ${S}`} ${`L ${c-2*r} ${S}`} ${`M ${c-2*r} ${S} L ${c-r} ${S} L ${c-r} ${w} L ${c} ${w}`}`,r)},b=u.useMemo(()=>m(a),[c,d,r,a]),v=u.useMemo(()=>{if(r===0)return;const T=r/2;return m(r)+`L ${c} 0 L 0 0 L 0 ${T}`},[b,r,a]),C=u.useMemo(()=>({style:{clipPath:`path('${v}')`}}),[v]);return _.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...s,ref:Pe([f,l,e]),children:[u.isValidElement(o)?u.cloneElement(o,C):_.jsx(_.Fragment,{}),_.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:c,height:d,viewBox:`0 0 ${c} ${d}`,children:_.jsx("path",{d:b,stroke:h,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:a})})]})})),He={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Bt extends A.DefaultNotifier{setOverrides(e){super.setOverrides(e)}getDelegate(){return this._overrides}showMessage(e,t){const n=this.getDelegate();if(n?.showMessage)return n.showMessage(e,t);t?.type!==He.Warning?t?.type!==He.Error?A.Notifier.log(e):A.Notifier.error(e):A.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(o=>{o(()=>{})})}showWindow(e,t,n){const o=this.getDelegate();if(o?.showWindow)return o.showWindow(e,t,n)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):A.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInputOptions(e){const t=this.getDelegate();return t?.showInputOptions?t.showInputOptions(e):Promise.resolve({input:"",option:""})}}const Pn=new Bt,Ot=u.createContext(Pn),ve=()=>u.useContext(Ot);function ht(i){if(!i)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:o=!1,consumeTouch:r=!0}=i,a=P(e,[e]),h=P(t,[t]),s=P(n,[n]),l=u.useRef(!1),c=i?.timerInitial??230,d=i?.timerContinuous??c/2,f=u.useRef(null),m=u.useRef(null),b=u.useRef(null),v=u.useRef(null),C=u.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),T=u.useCallback(E=>{v.current=setTimeout(()=>{window.requestAnimationFrame(()=>{l.current!==!1&&s?.(m.current,b.current,f.current)}),T(d)},E??c)},[]);u.useEffect(()=>()=>C(),[]);const g=o?"pointer":"mouse",w=u.useCallback(E=>{E.stopPropagation(),E.stopImmediatePropagation(),E.preventDefault()},[]),S=P(E=>{document.removeEventListener(`${g}move`,$),document.removeEventListener(`${g}up`,S),document.removeEventListener("keydown",B),document.removeEventListener("keyup",x),document.removeEventListener("touchstart",w,{capture:!0}),document.removeEventListener("touchmove",w,{capture:!0}),window.removeEventListener("blur",z),C(),window.requestAnimationFrame(()=>{l.current!==!1&&(l.current=!1,h?.(E,b.current,f.current),b.current=null)})},[]),z=u.useCallback(()=>{l.current!==!1&&(l.current=!1,S(m.current))},[]),j=P(()=>{C(),T(d),window.requestAnimationFrame(()=>{l.current!==!1&&s?.(m.current,b.current,f.current)})},[d]),$=P(E=>{m.current=E,j()},[]),B=P(E=>{b.current={ctrlKey:E.ctrlKey,shiftKey:E.shiftKey,altKey:E.altKey,metaKey:E.metaKey},j()},[]),x=P(E=>{b.current={ctrlKey:E.ctrlKey,shiftKey:E.shiftKey,altKey:E.altKey,metaKey:E.metaKey},j()},[d]);return P(E=>{E.isDefaultPrevented()||(b.current={ctrlKey:E.ctrlKey,shiftKey:E.shiftKey,altKey:E.altKey,metaKey:E.metaKey},a(E,b.current)!==!1&&(f.current=E,m.current=E.nativeEvent,document.addEventListener(`${g}up`,S,{passive:!1}),document.addEventListener(`${g}move`,$,{passive:!1}),document.addEventListener("keydown",B,{passive:!1}),document.addEventListener("keyup",x,{passive:!1}),window.addEventListener("blur",z,{passive:!0}),o&&r&&(document.addEventListener("touchstart",w,{passive:!1,capture:!0}),document.addEventListener("touchmove",w,{passive:!1,capture:!0})),l.current=!0,T(c)))},[c,o])}const An=({initValue:i,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(i);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const o=e();return u.useLayoutEffect(()=>{n.current!==o&&(n.current=o,t(o))},[t,o]),null},Ve=i=>{console&&console.warn&&console.warn(i)},Be=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let jn=1,Fe=!1,$t=!1;const ke=[],me=[],Ae=()=>{me.forEach(i=>i())},zn=({automaticContainerInternalUseOnly:i})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,i||Fe!==!1||($t=!0),u.useEffect(()=>{let o=!0;function r(){if(o)return me[0]!==r?(i||Fe!==!0||Ve("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void t(a=>[])):void t([...ke])}return me.push(r),Ae(),()=>{o=!1,n.current?.length>0&&Ve("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),me.splice(me.indexOf(r),1),Ae()}},[i]),_.jsx(_.Fragment,{children:e.map(({hook:o,key:r})=>u.createElement(An,{...o,key:r}))})},Rn=i=>{const e=jn++;return ke.push({hook:i,key:e}),me.length===0&&$t===!1&&(Fe=!0,(t=>{if(Be.document&&Be.document.createElement){const n=Be.document.createElement("div");on.createRoot(n).render(_.jsx(t,{automaticContainerInternalUseOnly:!0}))}else Ve("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(zn)),Ae(),()=>{ke.splice(ke.findIndex(t=>t.key===e),1),Ae()}};let We=null;We||(We=(i,e,t={})=>{let n,o,r=!1,a=!1,h=[],{unmountIfNoConsumers:s=!1}=t;const l=d=>{var f;o=d,f=()=>h.forEach(m=>m(d)),rn.unstable_batchedUpdates(f)},c=()=>(a||(o=typeof i=="function"?i():i,a=!0),o);return()=>{const[d,f]=u.useState(c);return u.useEffect(()=>(r||(r=!0,n=Rn({initValue:i,useHookBody:e,applyStateChange:l})),h.push(f),o!==d&&f(o),()=>{h.splice(h.indexOf(f),1),h.length===0&&s&&(n(),r=!1)}),[]),d}});const Kt=We;let Nt=()=>{console.warn("You must call useEditMode before setting its state.")};const Bn=Kt(null,()=>{const[i,e]=u.useState(null);return Nt=e,i});class De{constructor(e,t,n,o){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=o,o===void 0&&(this._callback=()=>{console.log(`implement: ${this.label()} : ${this.description()}`)})}key(){return this._key}_resolve(e,t){if(typeof e=="function"){const n=t??this._context;return e(typeof n=="function"?n():n)}return e}target(){return typeof this._target=="function"?this._target():this._target}label(e,t){const n=this._scopedLabels?.[e]||this._label;let o=null;if(typeof n=="function"){const r=t??this._context;o=n(typeof r=="function"?r():r)}else o=n;return o}description(e){return this._resolve(this._description,e)}tags(e){return this._resolve(this._tags,e)}icon(e){return this._resolve(this._icon,e)}shortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}state(){return this._resolve(this._state)}context(){return typeof this._context=="function"?this._context():this._context}async execute(e,t){if(!this.disabled()&&this._callback){try{let n=!0;if(t?.beforeExecute&&(n=t?.beforeExecute(this,e)),await Promise.resolve(n)===!1)return!1;const o=this._callback.bind(this)(e,this);if(await Promise.resolve(o)===!1)return!1;t?.onExecute?.(this,e),this._notifyExecute(e)}catch(n){return console.warn(n),t?.onError(this,n,e),this._notifyError(e,n),!1}return!0}}addPropertyListener(e,t=!1){if(!e)throw new Error("listener must be specified");const n=this._listenersProperties;return n.add(e),t&&e({},this),()=>{n.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const t=this._listenersExecute;return t.add(e),function(){t.delete(e)}}_notifyExecute(e){const t=this;this._listenersExecute.forEach(n=>{n.onExecute(t,e)})}_notifyError(e,t){const n=this;this._listenersExecute.forEach(o=>{o.onError?.(n,e,t)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const t=this._applyProps(e);return Object.keys(t).length>0&&this._notifyPropertyChange(t),this}_notifyPropertyChange(e){const t=this;this._listenersProperties.forEach(n=>{n(e,t)})}_applyProps(e){let t={},n=this;return Object.keys(e).forEach(o=>{let r=e[o];n["_"+o]!==r&&(n["_"+o]=t[o]=r)}),t}}class Ee extends De{}class Xe{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=A.CommonUtils.uuidV4(),this._target=e,this._groupKey=t??null,this._root=this,this._nodes=new Map,this._nodes.set(t,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const n=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(o,r)=>{const a=n._root._listenersByKey,h=r.key(),s=a.get(h);s&&n._notifyCommands(s,"onCommandChange",r)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let o=n,r=n===this;for(;!r&&o;)o===this&&(r=!0),o=o._parent;return(r?n:this)._getCommand(e)}createChildGroup(e,t,n){let o;if(!n){let h=this;for(;h&&!o;){let s=h._nodes.get(t);s&&(o=s),h=h._parent}}o||(o=new Xe(e,t),o._parent=this,o._root=this._root,o._unListenersByCommand=null,o._listenersByKey=null,o._commandsPropertyListener=null);const r=(h,s)=>{!h.has(t)||n?h.set(t,s):n===void 0&&console.warn("commandGroup already registered",t)};r(this._root._nodes,o);let a=this._parent;for(;a;)r(this._nodes,o),a=a._parent;return this._children.set(t,o),this._notify("onGroupChange"),o}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,o=this._commandsByShortcut,r=this._root._commandsPropertyListener,a=this._root._unListenersByCommand;for(let h=0;h<e.length;h++){const s=e[h],l=s.key();if(n.has(l)&&!t){t===void 0&&console.warn("command already registered",l);continue}n.set(l,s);let c=a.get(s);c&&(c(),a.delete(s));const d=s.addPropertyListener(r);a.set(s,d);const f=s.shortcut();if(!f)continue;const m=Array.isArray(f)?f:[f];for(let b=0;b<m.length;b++){const v=fe(m[b]),C=o.get(v);C&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${v}, ${l}, ${C}.`),o.set(v,l)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,t=[];const n=this._groupKey;for(;e;)t.push(e._nodes),e._nodes.delete(n),e=e._parent;e=this._parent;const o=r=>{r._children.forEach(a=>{for(let h=0;h<t.length;h++)a._nodes.delete(t[h]);o(a)})};o(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,t){this._addCommands(e,t),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let t=this;if(e&&(t=this._nodes.get(e),!t))return void console.warn("group not found",e);let n=this._root._focused??this._root;for(;n;)n=n._parent;this._root._focused!==t&&(this._root._focused=t,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const t=[];e.altKey&&t.push(F.Alt),e.shiftKey&&t.push(F.Shift),e.ctrlKey&&t.push(F.Ctrl),e.metaKey&&t.push(F.Meta);let n=fe({key:e.code,modifiers:t});const o=this._commandsByShortcut;let r=o.get(n);r||(n=fe({key:e.key,modifiers:t}),r=o.get(n)),!r&&e.code.startsWith("Digit")&&(n=fe({key:e.code.substring(5,e.code.length),modifiers:t}),r=this._commandsByShortcut.get(n)),!r&&e.code.startsWith("Key")&&(r=fe({key:e.code.substring(3,e.code.length),modifiers:t}),r=o.get(n));let a=null;return r&&(a=this._commandsByKey.get(r),a&&a.disabled()&&(a=null),!a||a.target()&&a.target().contains(e.target)||(a=null)),a||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const t=this.getActive();if(!t||e.isDefaultPrevented())return!1;const n=t.findCommandByEvent?.(e);return!!n&&(n.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,t){const n=this._listeners,o=t?.keys,r=this._root._listenersByKey;if(o&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let a=null;if(o)for(let h=0;h<o.length;h++){const s=o[h];if(!s)continue;let l=r.get(s);l||(l=new Set,r.set(s,l)),a||(a=[]),a.push(l),l.add(e)}return n.add(e),()=>{if(a)for(let h=0;h<a.length;h++)a[h].delete(e);n.delete(e)}}_notifyCommands(e,t,n){const o=this;setTimeout(()=>{e.forEach(r=>{r[t]?.(o,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(o=>{o[e]?.(n,t)}),n._parent&&n._parent._notify(e,t)},0)}getAllCommands(){const e=[],t=this._groupKey;return this._commandsByKey.forEach(n=>{e.push({command:n,groupKey:t})}),this._children.forEach(n=>{e.push(...n.getAllCommands())}),e}}const On=A.CommonUtils.getOS()===A.CommonUtils.OSType.MacOS||A.CommonUtils.getOS()===A.CommonUtils.OSType.IOS?"Cmd":"Ctrl",$n=A.CommonUtils.getOS()===A.CommonUtils.OSType.MacOS||A.CommonUtils.getOS()===A.CommonUtils.OSType.IOS?"⌘":"^",fe=(i,e=!1)=>{const t={};for(let o=0;i.modifiers&&o<i.modifiers.length;o++)t[i.modifiers[o]]=!0;let n="";return(t?.[F.Ctrl]||t?.[F.Meta])&&(n+=(n.length>0?"+":"")+(e?$n:On)),t?.[F.Alt]&&(n+=e?"⌥":"Alt"),t?.[F.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+At(i.key),n},Me=(i,e)=>{if(!e||!i||e.length===0)return A.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let o=0;o<t;o++){const r=e[o],a=r?i.getCommand(r):null;n[o]=a}return n},dt=Kt({setClipboard:i=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>A.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[i,e]=u.useState(A.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>i,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let Oe=!1,Kn=0;var Nn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const ft=()=>"sheetxl-ui-"+Kn++,pt=u.useId,In=pt??function(){const[i,e]=u.useState(()=>Oe?ft():void 0);return Nn(()=>{i==null&&e(ft())},[]),u.useEffect(()=>{Oe||(Oe=!0)},[]),i},mt="Undo the last action.",_t="Repeat the last action or undo the redo.",Hn=i=>`Redo ${i}`;class Vn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class Fn{constructor(e){this.notifier=e,this.handleUnhandledRejection=t=>{const n=t.reason;n instanceof DOMException&&n.name==="AbortError"||this.notifier.showError(n)},this.handleGlobalError=t=>{this.notifier.showError(t.error)},this.setupGlobalHandlers()}setupGlobalHandlers(){window.addEventListener("unhandledrejection",this.handleUnhandledRejection),window.addEventListener("error",this.handleGlobalError)}cleanup(){window.removeEventListener("unhandledrejection",this.handleUnhandledRejection),window.removeEventListener("error",this.handleGlobalError)}}const Wn={},It=i=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:o=0,paddingAfter:r=0,disabled:a,key:h,hitAreaProps:s=Wn,...l}=i,c=n==="row",{style:d,className:f,...m}=s;return _.jsx("div",{style:{...t,position:"relative"},...l,children:_.jsx("div",{className:pe("hit-box",f),style:{left:(c?-o:0)+"px",width:`calc(100% + ${c?o+r:0}px)`,top:(c?0:-o)+"px",height:`calc(100% + ${c?0:o+r}px)`,position:"absolute",...d},onPointerDown:a?void 0:e,...m})},h)},Le={},ce=(i,e,t=!0)=>i===null?null:i.pixels!==null?t?i.pixels:e-i.pixels:(t?i.percent:100-i.percent)/100*e,Te=(i,e=!0)=>i?.percent?`${e?i.percent:100-i.percent}%`:i?.pixels?`${i.pixels}px`:void 0,se=(i,e)=>{if(i==null)return null;const t={percent:null,pixels:null};let n=e;return typeof i=="string"&&((i=i.trim().toLowerCase()).endsWith("px")?(i=i.substring(0,i.length-2),n=!1):i.endsWith("%")&&(i=i.substring(0,i.length-1),n=!0),i=parseFloat(i)),n?t.percent=i:t.pixels=i,Object.freeze(t)},Un=u.memo(u.forwardRef((i,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:o="row",fixedPane:r=null,position:a,onPositionChange:h,minBefore:s,maxBefore:l,minAfter:c,maxAfter:d,children:f,className:m,style:b,disabled:v=!1,onDragStart:C,onDragResize:T,onDragFinish:g,resizerProps:w=Le,paneProps:S=Le,paneBeforeProps:z=Le,paneAfterProps:j=Le,createResizer:$=It}=i;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const B=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),x=u.useMemo(()=>{let D=null;r&&(r==="before"?D=0:r==="after"&&(D=1));const N=D===null;return{fixedPaneOffset:D,isPercent:N,minBefore:se(s,N),maxBefore:se(l,N),minAfter:se(c,N),maxAfter:se(d,N)}},[s,l,c,d]),E=P(h,[h]),[k,p]=u.useState(()=>se(a,r===null));u.useEffect(()=>{p(se(a,r===null))},[a,r]);const[M,{width:y,height:L}]=ue(),[K,{width:G,height:H}]=ue(),q=o==="row"?G:H,V=o==="row"?y:L,R=u.useMemo(()=>((D,N,Y,U)=>{const ne=[null,null],Q=[null,null];if(D||(D={percent:U.fixedPaneOffset===null?50:null,pixels:U.fixedPaneOffset===null?null:0}),N===0)return D?.pixels!=null?U.fixedPaneOffset!==1?(ne[0]=D?.pixels,Q[1]=100):(ne[1]=D?.pixels-Y,Q[0]=100):D?.percent!=null&&(U.fixedPaneOffset!==1?(Q[0]=D?.percent,Q[1]=100-D?.percent):(Q[1]=D?.percent,Q[0]=100-D?.percent)),{percents:Q,pixels:ne,minBefore:Te(U.minBefore,!0),maxBefore:Te(U.maxBefore,!0),minAfter:Te(U.minAfter),maxAfter:Te(U.maxAfter)};let re=ce(D,N,U.fixedPaneOffset!==1),J=N-Y,nt=ce(U.minBefore,J,!0)??0,tn=ce(U.maxBefore,J,!0)??J,Se=0,ze=0,ot=0,it=J;Se=(ce(U.maxAfter,N,!1)??Y)-Y,ze=ce(U.minAfter,N,!1)??N,ot=Math.max(nt,Se),it=Math.min(tn,ze),re=Math.max(ot,Math.min(re,it)),ze=Math.min(J-re,ce(U.maxAfter,J-re,!0)??J),Se=Math.min(J-re,ce(U.minAfter,J-re,!0)??J),ne[0]=re,ne[1]=J-ne[0];const nn=Math.max(0,Math.min(100,re/J*100));return Q[0]=nn,Q[1]=100-Q[0],{percents:Q,pixels:ne,minBefore:`${nt}px`,minAfter:`${Se}px`,maxBefore:`${ne[0]}px`,maxAfter:`${ne[1]}px`}})(k,V,q,x),[x,k,V,q,o]),[I,W]=u.useState(!1),he=P(C,[C]),de=P(T,[T]),O=P(g,[g]),Z=u.useRef(null),te=u.useRef(null),ae=u.useRef(null),{style:oe,className:ie,...ge}=S,Ge={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...oe},{className:Vt,style:Ft,...Wt}=z,{className:Ut,style:Yt,...Xt}=j,Gt={flex:"1 1 100%",width:"100%",...b,flexDirection:o,display:"flex"},{className:qe,style:Ze,onPointerDown:Je,...Qe}=w,qt=P(D=>{const N=se(D,r===null);p(N)},[r]),be=P(D=>{if(v||!I)return;const N=tt.current?.getBoundingClientRect();let Y=0;Y=o==="row"?(D.clientX??D.touches?.[0]?.clientX)-N.x:(D.clientY??D.touches?.[0]?.clientY)-N.y,Y=Math.max(0,Math.min(V,Y)),x.fixedPaneOffset===1&&(Y=V-Y),a&&k.pixels===Y||p({pixels:Y,percent:null}),de?.(Y),D.stopPropagation(),D.preventDefault()},[x,o,v,I,k,V]),et=P(D=>{if(document.removeEventListener("pointermove",be),document.removeEventListener("touchmove",be),document.removeEventListener("pointerup",et),!!I&&(W(!1),!!k)){if(O(k.pixels),!se(a,r===null)||k.pixels!==a){const N={...k};N.percent===null&&(N.percent=N.pixels/V*100),E(N)}D.stopPropagation(),D.preventDefault()}},[k,I,a,r,V]),Zt=P(D=>{Je?.(D),D.defaultPrevented||v||I||(W(!0),he(),document.addEventListener("pointermove",be,{passive:!1}),document.addEventListener("touchmove",be,{passive:!1}),document.addEventListener("pointerup",et,{passive:!1}))},[Je]),tt=Ye(e,()=>({setPosition:qt,isSplitPane:()=>!0}),[]),Jt=u.useMemo(()=>B?$?.({key:"resizer",ref:Pe([K,te]),className:pe("resizer",qe),onPointerDownCapture:Zt,style:{cursor:v?void 0:o==="row"?"ew-resize":"ns-resize",minWidth:o==="row"?"2px":void 0,minHeight:o!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...Ze},splitDirection:o,disabled:v,...Qe}):null,[B,qe,Qe,o,Ze,v]),we=o==="row"?"Width":"Height",Qt=u.useMemo(()=>{if(!t)return null;const D={...Ge,...Ft,flex:x.fixedPaneOffset===0&&R?.pixels[0]!==null?`0 0 ${Math.round(R?.pixels[0])}px`:`1 1 ${Math.round(R?.percents[0]??100)}%`,[`min${we}`]:R?.minBefore,[`max${we}`]:n?R?.maxBefore:"100%"};return _.jsx("div",{ref:Z,className:pe("before",ie,Vt),style:D,...ge,...Wt,children:t},"before")},[t,S,z,x,R]),en=u.useMemo(()=>{if(!n)return null;const D={...Ge,...Yt,flex:x.fixedPaneOffset===1&&R?.pixels[1]!==null?`0 0 ${Math.round(R?.pixels[1])}px`:`1 1 ${Math.round(R?.percents[1]??100)}%`,[`min${we}`]:R?.minAfter,[`max${we}`]:t?R?.maxAfter:"100%"};return _.jsx("div",{ref:ae,className:pe("after",ie,Ut),style:D,...ge,...Xt,children:n},"after")},[n,S,j,x,R]);return _.jsxs("div",{ref:Pe([M,tt]),className:pe("splitPane",o==="row"?"vertical":"horizontal",{dragging:I},m),style:Gt,children:[Qt,Jt,en]})}));function Yn(i){if(typeof i=="function")return i;if(typeof i=="string"){const e=i.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const o=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!o)return null;const r=o[1]||"",a=o[2]||"";try{if(/;base64/i.test(r)){if(typeof atob<"u"){const h=atob(a);if(typeof TextDecoder<"u"){const l=new Uint8Array(h.length);for(let c=0;c<h.length;c++)l[c]=h.charCodeAt(c);return new TextDecoder("utf-8").decode(l)}let s="";for(let l=0;l<h.length;l++)s+=`%${h.charCodeAt(l).toString(16).padStart(2,"0")}`;return decodeURIComponent(s)}return(globalThis.Buffer?globalThis.Buffer.from(a,"base64"):require("buffer").Buffer.from(a,"base64")).toString("utf-8")}try{return decodeURIComponent(a)}catch{return a}}catch{return null}})(e);if(t)return vt(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return vt(e);if(/^<\s*path\b/i.test(e)){const t=gt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(i)){const e=[];for(const t of i)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const o=gt(n);o&&e.push({d:o})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return i}function gt(i){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(i);return e?e[1]??e[2]??null:null}function yt(i){if("svg"in i)return{...i,svg:Yn(i.svg)};if("url"in i){const e=typeof i.url=="string"?{src:i.url}:i.url;return{...i,url:e}}if("emoji"in i){const e=typeof i.emoji=="string"?i.emoji:i.emoji.text;return{...i,emoji:e}}return i}function vt(i){try{if(typeof DOMParser<"u"){const a=new DOMParser().parseFromString(i,"image/svg+xml"),h=a.querySelector("svg"),s=h?.getAttribute("viewBox")??void 0,l=[];return a.querySelectorAll("path").forEach(c=>{const d=c.getAttribute("d");if(!d)return;const f={d},m=c.getAttribute("class");m&&(f.className=m);const b=c.getAttribute("fill");b&&b!=="none"&&(f.fill=b);const v=c.getAttribute("stroke");v&&(f.stroke=v);const C=c.getAttribute("opacity");C&&(f.opacity=Number(C));const T=c.getAttribute("fill-rule");T&&(f.fillRule=T);const g=c.getAttribute("clip-rule");g&&(f.clipRule=g),l.push(f)}),{viewBox:s,paths:l}}}catch{}const e=i.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],o=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let r;for(;r=o.exec(i);)n.push({d:r[1]});return{viewBox:t,paths:n}}function xt(i){const e={};for(const[r,a]of Object.entries(i.icons))e[r]=yt(a);const t={label:i.meta?.label??"Unnamed",version:i.meta?.version??"1.0.0",license:i.meta?.license??"MIT",defaultViewBox:"0 0 24 24",extends:i.meta?.extends??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},o=i.overrides;if(o){const r={};for(const[a,h]of Object.entries(o)){const s={};for(const[l,c]of Object.entries(h))s[l]=yt(c);r[a]=s}n.__overrides=r}return n}function Ht(){const i=new Map,e=new Map;let t="base",n=new Map;async function o(s){const l=i.get(s??t);if(!l)throw new Error(`Icon pack not registered: ${s}`);if(!l.pack){if(!l.loading){if(!l.loader)throw new Error(`No loader for icon pack: ${s}`);l.loading=l.loader().then(c=>{const d=c&&typeof c=="object"&&"default"in c?c.default:c;l.pack=xt(d)}).catch(c=>{throw l.loading=void 0,c})}await l.loading}}function r(s){const l=s.indexOf(":");return l>0?{ns:s.slice(0,l),key:s.slice(l+1)}:{key:s}}function a(s,l){const c=[s,...i.get(s)?.pack?.meta.extends??[]];for(const d of c){const f=i.get(d);if(!f?.pack)continue;const{icons:m}=f.pack,b=m[e.get(d)?.get(l)??l]??m[l];if(b)return{glyph:b,pack:f.pack,packKey:d}}return null}function h(s,l){const c=l?.packKey??t;if(l?.packKey)return a(l.packKey,s);if(!s)return null;const{ns:d,key:f}=r(s);if(d){const m=i.get(d)?.pack;if(m){if(i.get(t)?.pack){const v=m.__overrides,C=v?.[t]?.[f];if(C)return{glyph:C,pack:m,packKey:d}}const b=a(d,f);if(b)return b}return null}return a(c,s)}return{register:function(s,l){const c=i.get(s)??{};typeof l=="function"?c.loader=l:c.pack=xt(l),i.set(s,c),t||(t=s)},prefetch:async function(s=t){const l=Array.isArray(s)?s:[s];await Promise.all(l.map(o))},setActive:function(s){t=s;for(const l of n.keys())try{l(s)}catch{}},getActive:function(){return t},resolve:async function(s,l){let c=h(s,l);if(c)return c;const d=l?.packKey??t,{ns:f}=r(s);if(l?.packKey){if(await o(d),c=h(s,l),c)return c;const m=i.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}else if(f){if(await o(f),c=h(s,l),c)return c;const m=i.get(f)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}else{if(await o(d),c=h(s,l),c)return c;const m=i.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}return null},registerAlias:function(s,l,c){e.has(s)||e.set(s,new Map),e.get(s).set(l,c)},has:function(s,l){return!!h(s,l)},getPack:function(s){return i.get(s??t)?.pack},hasPack:function(s){return!!i.get(s)?.pack},listPacks:function(){return Array.from(i.keys())},listIcons:function(s){const l=i.get(s)?.pack;return l?Object.keys(l.icons):[]},addActiveListener:function(s){const l=n.get(s);if(l)return l;const c=()=>{n.delete(s)};return n.set(s,c),c}}}const xe=Ht();xe.register("base",()=>Promise.resolve().then(()=>require("./Bb5sSoT2rOCEdJUD.cjs")));const bt=i=>_.jsx("svg",{...i,children:_.jsx("path",{})}),Xn={Icon:"_Icon_1ipwo_10"},wt=u.memo(i=>{const{iconKey:e,packKey:t,className:n,style:o,role:r,title:a,size:h,ariaHidden:s,sourceProps:l,children:c,...d}=i,[f,m]=u.useState(null);u.useEffect(()=>{let p=!0,M=t,y=e;if(!y){const L=xe.getPack(M);return void m({glyph:L?{svg:A.CommonUtils.EmptyArray}:void 0,pack:L??void 0,packKey:M??xe.getActive()})}if(y.includes(":")){const[L,K]=y.split(":");M=L,y=K}return xe.resolve(y,{packKey:M}).then(L=>{p&&m(L)}),()=>{p=!1}},[e,t]);const b=f?.pack,v=f?.glyph,C=f?.packKey;let T=v?v.svg:void 0;const g=v&&!T?v.url:void 0,w=!v||T||g?void 0:v.emoji,S=h!=null?typeof h=="number"?`${h}px`:h:void 0,z=u.useMemo(()=>[Xn.Icon,"icon",n].filter(Boolean).join(" "),[n]),j=u.useMemo(()=>{const p={...o};return p["--icon-size"]=S,p},[o,S]),$=r??(a?"img":"presentation"),B=s??(!a||void 0),x=p=>_.jsx("span",{className:z,style:j,role:$,"aria-hidden":B,title:a,"data-icon-glyph":e,"data-icon-pack":C,...d,children:p});if(c)return x(c);if(w)return x(_.jsx("span",{children:typeof w=="string"?w:w.text}));if(g)return x(_.jsx("img",{src:g.src,alt:a??""}));if(v&&"react"in v){const p=v.react,M={className:z,style:j,role:$,"aria-hidden":B,title:a,...d,...l};return x(_.jsx(p,{...M}))}const E={viewBox:T?.viewBox??b?.meta.defaultViewBox??"0 0 24 24"};if(typeof T=="function")return x(T(E)??_.jsx(bt,{...E}));if(!T)return x(_.jsx(bt,{...E}));const k=T.paths;return x(_.jsx("svg",{...E,children:k?k.map((p,M)=>_.jsx("path",{d:p.d,className:p.className,fill:p.fill,stroke:p.stroke,opacity:p.opacity,fillRule:p.fillRule,clipRule:p.clipRule},M)):null}))});exports.Command=De,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=Xe,exports.DefaultDynamicIconService=xe,exports.DefaultReactNotifier=Bt,exports.DynamicIcon=wt,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=kn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.KeyCodes={BackSpace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Delete:46,Digit_8:56,Y:89,Z:90,Meta:91,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,BackSlash:220,Slash:191,BracketRight:221,BracketLeft:219},exports.KeyModifiers=F,exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:i,notifier:e})=>(u.useEffect(()=>{const t=A.Notifier.getOverrides();return A.Notifier.setOverrides(e),()=>{A.Notifier.setOverrides(t)}},[e]),u.createElement(Ot.Provider,{value:e},i)),exports.NotifierType=He,exports.ReactErrorBoundary=({children:i})=>{const e=ve(),t=u.useCallback(n=>{e.showError(n)},[e]);return _.jsx(Vn,{onError:t,children:i})},exports.ReactUtils=wn,exports.RoundedTab=Dn,exports.ScrollPane=zt,exports.ScrollUtils=an,exports.Scrollbar=je,exports.ScrollbarOrientation=ee,exports.SimpleCommand=Ee,exports.SplitPane=Un,exports.SplitPaneResizer=It,exports.ToolTipPlacement={BottomEnd:"bottom-end",BottomStart:"bottom-start",Bottom:"bottom",LeftEnd:"left-end",LeftStart:"left-start",Left:"left",RightEnd:"right-end",RightStart:"right-start",Right:"right",TopEnd:"top-end",TopStart:"top-start",Top:"top"},exports.UncaughtErrorBoundary=({children:i})=>{const e=ve();return u.useEffect(()=>{const t=new Fn(e);return()=>{t.cleanup()}},[e]),_.jsx(_.Fragment,{children:i})},exports.VirtualScrollbar=Rt,exports.WalkingIcon=function(i){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:o=3,dashLength:r=5,iconKey:a,packKey:h,style:s,className:l,...c}=i,d=u.useMemo(()=>{if(!e)return;const m={"--walk-duration":`${n*(o+r)}ms`,"--walk-dash-length":`${r}px`,"--walk-dash-gap":`${o}px`};return t&&t!=="accent"&&(m["--icon-accent"]=`var(--icon-${t})`),m},[e,n,o,r,t]),f=u.useMemo(()=>e?l+" walking":l,[e,l]);return _.jsx(wt,{iconKey:a,packKey:h,className:f,style:{...s,...d},...c})},exports.createDynamicIconService=Ht,exports.defaultCreateScrollCorner=jt,exports.defaultCreateScrollEdgeButton=i=>{const{style:e,orientation:t=ee.Vertical,...n}=i,o=t===ee.Vertical,r=o?"rotate(90) ":"";return _.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${o?"vertical":"horizontal"} edge`,...n,children:_.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:r,children:_.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:i.disabled?0:1},d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})})})},exports.defaultCreateScrollEndButton=Mt,exports.defaultCreateScrollStartButton=Et,exports.defaultCreateScrollbar=Ie,exports.getDevicePixelRatio=function(i){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=i||{},o=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(o):o),t)},exports.toShortcutString=fe,exports.useCallbackRef=P,exports.useCommand=function(i,e=null){const t=u.useRef(e);t.current=e;const[n,o]=u.useReducer(a=>a+1,0),r=u.useMemo(()=>Array.isArray(i)?i:[i],[i]);return u.useEffect(()=>{if(!r||r.length===0)return;const a=(l,c)=>{t.current?.onChange?.(c),o()};let h=null;e&&(h={onExecute(l,c){t.current?.onExecute?.(l,c)},onError(l,c,d){t.current?.onError?.(l,c,d)}});const s=new Set;for(let l=0;l<r.length;l++)s.add(r[l]?.addPropertyListener(A.CommonUtils.debounce(a,0),!0)),e&&s.add(r[l]?.addExecuteListener(h));return()=>{s.forEach(l=>{l?.()})}},[i]),n},exports.useCommands=function(i,e=null,t=null,n){const o=u.useRef(t);o.current=t,e&&!Array.isArray(e)&&(e=[e]);const[r,a]=u.useState(Me(i,e)),h=n?[...n,i]:[i];return u.useEffect(()=>{const s={onGroupChange:()=>{const f=Me(i,e);a(f),o.current?.onChange?.(this)}};let l;e&&e.length>0&&(l={keys:e},s.onCommandChange=(f,m)=>{o.current?.onChange?.(i),a(Me(i,e))});const c=i?.addListener(s,l),d=Me(i,e);return a(d),o.current?.onChange&&o.current?.onChange(i),()=>{c?.()}},h),r},exports.useCopyPaste=i=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:o,commands:r}=i,a=ve(),h=P(o,[o]),s=P(n,[n]),{getClipboard:l,refNativeCopy:c}=dt(),d=l();u.useMemo(()=>{const g=e?.element,w=t?.element??e?.element;if(!r)return;const S=[new Ee("cut",g,{label:"Cut",description:"Remove the selection and put it on the clipboard so you can paste it somewhere else.",icon:"cut",shortcut:{key:"X",modifiers:[F.Ctrl]}}),new Ee("copy",g,{label:"Copy",description:"Put a copy of the selection on the clipboard so you can paste it somewhere else.",icon:"copy",shortcut:{key:"C",modifiers:[F.Ctrl]}}),new Ee("paste",w,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste",shortcut:[{key:"V",modifiers:[F.Ctrl]},{key:"F8",modifiers:[F.Ctrl]}]})];r?.addCommands(S,!0)},[r]);const f=P(async g=>{if(!e?.element)return;let w=null;try{w=e.doCopy?.(g),typeof w=="string"?await d.writeText(w):await d.writeReference(w)}catch(S){throw S}},[e,a]),m=P(async g=>{const w=e?.element?.();if(w){c.current={sourceElement:w,args:g};try{await f(g)}catch(S){a.showError?.(S)}}},[e?.element,a]),b=u.useCallback(()=>{m({isCut:!0})},[]),v=P(async(g,w,S)=>{try{if(await g.doPaste(w,S)===!1)return;s?.(w,S)}catch(z){a.showError?.(z)}},[s]),C=P(async(g,w,S)=>{const z=t?.element?.();if(z&&await A.CommonUtils.whenFocus(z),!g&&!w)return;const j=await a.showBusy?.("Pasting...");if(w)try{return await v(t,w,S),void j?.()}catch(x){j?.(),a.showError?.(x)}let $,B=t.importFromExternal;B||(B=(x,E)=>({getItemType:()=>"text",toText:()=>g.text,isClipboardItem:!0}));try{$=await B(g,{isCut:!1})}catch(x){j?.(),a.showError?.(x)}if($)try{const x=await Promise.resolve($);await v(t,x,S),j?.()}catch(x){j?.(),a.showError?.(x)}else j?.()},[v,t,a]),T=P(async g=>{if(t?.element)try{const w=await d.readReference();if(w)return void await C(null,w,g);const S=[];S[0]=await A.ClipboardUtils.readStringFromClipboard(d,A.MimeType.plain),S[1]=await A.ClipboardUtils.readHTMLFromClipboard(d,A.MimeType.html),S[2]=await A.ClipboardUtils.readBlobFromClipboard(d,A.MimeType.png);const z={text:S[0]??null,html:S[1]??null,image:S[2]??null};await C(z,null,g)}catch(w){if(w?.message==="Document is not focused.")return;a.showError?.(w)}},[C,t?.element,a]);return P(async g=>{},[e?.element]),P(async g=>{},[t?.element,C,a]),u.useEffect(()=>{if(!d)return;const g=async z=>{const j=await d.readReference();h?.(j)},w=z=>{a.showMessage?.(A.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},S=z=>{a.showMessage?.(A.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",g),d.addEventListener("clipboarderrorread",w),d.addEventListener("clipboarderrorwrite",S),()=>{d.removeEventListener("clipboardchange",g),d.removeEventListener("clipboarderrorread",w),d.removeEventListener("clipboarderrorwrite",S)}},[d,a]),u.useEffect(()=>{},[f,C,e,t]),u.useEffect(()=>{r?.getCommand("cut")?.updateCallback(b).update({disabled:!e||!t}),r?.getCommand("copy")?.updateCallback(m).update({disabled:!e}),r?.getCommand("paste")?.updateCallback(T).update({disabled:!t})},[e,t,r]),{paste:T,copy:m,clipboard:d}},exports.useDevicePixelRatio=function(i){const[e,t]=u.useState(typeof window<"u"?window.devicePixelRatio:1),n=u.useRef(null);return u.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const o=()=>{const r=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);r.addEventListener("change",o,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:r,listener:o}};return o(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[i]),e},exports.useEditMode=()=>{const i=Bn();return u.useMemo(()=>({setMode:e=>{Nt(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>i}),[i])},exports.useFullscreenPortal=function(){const[i,e]=u.useState(!!document.fullscreenElement),t=u.useCallback(()=>{const n=document.fullscreenElement;return n?n.querySelector(".fullscreen-portal-root")||n:document.body},[]);return u.useEffect(()=>{function n(){const o=document.fullscreenElement;if(e(!!o),!o)return;let r=o.querySelector(".fullscreen-portal-root");r||(r=document.createElement("div"),r.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",o.appendChild(r))}return Ce++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Ce--,Ce<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(o=>{o.parentNode&&o.parentNode.removeChild(o)}),Ce=0)}},[]),{getPortalContainer:t,isFullscreen:i}},exports.useGlobalClipboard=dt,exports.useId=In,exports.useImperativeElement=Ye,exports.useMouseDownAndHoldListener=function(i,e){return ht({onPointerDown:i,onPointerMoveOrWait:(t,n,o)=>{i?.(o)},...e})},exports.useNotifier=ve,exports.useOnClickOrFocusAway=function(i,e,t){const n=P(e,[e]);u.useEffect(()=>{const o=r=>{i.current&&!i.current.contains(r.target)&&n(r)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",o),document.addEventListener("touchstart",o)),t&&t.focusEvents===!1||document.addEventListener("focus",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o),document.removeEventListener("focus",o)}},[i])},exports.useSynchronizedPointerHandler=ht,exports.useTraceUpdate=function(i,e=!0){const t=u.useRef(i);u.useEffect(()=>{if(e){const n=Object.entries(i).reduce((o,[r,a])=>(t.current[r]!==a&&(o[r]=[t.current[r],a]),o),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=i})},exports.useUndoManager=({manager:i,commands:e,disabled:t})=>{const n=ve(),o=P(a=>{try{i?.undo(a)}catch(h){n.error(h)}},[i]),r=P(a=>{try{i?.redo(a)}catch(h){n.error(h)}},[i]);return u.useMemo(()=>{if(!e)return;const a={contains:s=>!0,focus(){}},h=[new De("undo",a,{label:"Undo",description:mt,shortcut:{key:"z",modifiers:[F.Ctrl]},disabled:!0},o),new De("redo",a,{label:"Redo",description:_t,shortcut:[{key:"y",modifiers:[F.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[F.Alt]}],disabled:!0},r)];e?.addCommands(h,!0)},[e]),u.useEffect(()=>{if(!e)return;const a=()=>{const s=i?.getTopUndoDescription(),l={};var c;e.getCommand("undo").update({disabled:t||!i||!i.hasUndo(),description:s?(c=s,`Undo ${c}`):mt,state:l,context:{undoManager:i}});const d=i?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!i||!i.hasRedo(),description:d?Hn(d):_t,state:l,context:{undoManager:i}})};if(a(),!i)return;const h=i.addListener({onStackChange(){a()}});return()=>h?.()},[i,e,t]),{undo:o,redo:r}};
|