@sheetxl/utils-react 0.7.15 → 0.7.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{DR4nVOJkx8rs4k4Z.cjs → BfVchbirCkmA3HCq.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{Bjn3Ya_2XTU4VReT.mjs → DQXf4a-Nh3ZMvJdj.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/node/esm/{B3XB5fOsmcQHIMOW.mjs → Cy9MGJ5ivkJxyauG.mjs} +1 -1
- package/node/esm/index.mjs +2 -2
- package/package.json +2 -2
- package/types/index.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.17
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._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: calc(var(--icon-size, 1rem), * .875);--icon-size-md: var(--icon-size, 1rem);--icon-size-lg: calc(var(--icon-size, 1rem) * 1.25);--icon-size-xl: calc(var(--icon-size, 1rem) * 1.5)}._Icon_17dpm_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_17dpm_10 .sm{--font-size: var(--icon-size-sm)}._Icon_17dpm_10 .md{--font-size: var(--icon-size-md)}._Icon_17dpm_10 .lg{--font-size: var(--icon-size-lg)}._Icon_17dpm_10 .xl{--font-size: var(--icon-size-xl)}._Icon_17dpm_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_17dpm_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_17dpm_10 .fill,._Icon_17dpm_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_17dpm_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_17dpm_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_17dpm_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_17dpm_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_17dpm_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_17dpm_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_17dpm_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_17dpm_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_17dpm_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_17dpm_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_17dpm_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_17dpm_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_17dpm_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_17dpm_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_17dpm_10 .line:not(.fixed):not([stroke]){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_17dpm_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_17dpm_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_17dpm_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_17dpm_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}:root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent}:root .has-touch-thumb,:root .has-touch-thumb *{--scrollbar-size: 4px;--scrollbar-border-width: 0px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size)}:root{--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_15caq_24 ::-webkit-scrollbar-button{background:transparent}._scrollbar_15caq_24{display:flex;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_15caq_24 ._track_15caq_34{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_15caq_24 ._thumb_15caq_46{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_15caq_24 ._thumb_15caq_46:hover{background:var(--scrollbar-active-color)}._scrollbar_15caq_24.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px)}._scrollbar_15caq_24.vertical ._thumb_15caq_46{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_15caq_24.vertical ._track_15caq_34{width:100%}._scrollbar_15caq_24.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px)}._scrollbar_15caq_24.horizontal ._thumb_15caq_46{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_15caq_24.horizontal ._track_15caq_34{height:100%}._scrollbar_15caq_24.dragging ._thumb_15caq_46{background:var(--scrollbar-active-color)}._scrollbar_15caq_24 ._scrollbar-button_15caq_86{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar_15caq_24 ._scrollbar-button_15caq_86>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar_15caq_24 ._scrollbar-button_15caq_86:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar_15caq_24 ._scrollbar-button_15caq_86[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar_15caq_24 ._scrollbar-button_15caq_86.vertical{width:var(--scrollbar-width)}._scrollbar_15caq_24 ._scrollbar-button_15caq_86.horizontal{height:var(--scrollbar-height)}._touch-thumb_15caq_121{position:absolute;cursor:grab;pointer-events:all;transition-property:opacity;border-radius:9999px;will-change:opacity;opacity:.7}._touch-thumb_15caq_121:hover,._touch-thumb_15caq_121.dragging{opacity:1}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
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.17
|
|
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 I=require("@sheetxl/utils"),u=require("react"),w=require("react/jsx-runtime"),_n=require("react-dom/client"),It=require("react-dom"),X={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"};class Xe{constructor(e,t,n,r){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=r,r===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 r=null;if(typeof n=="function"){const i=t??this._context;r=n(typeof i=="function"?i():i)}else r=n;return r}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 r=this._callback.bind(this)(e,this);if(await Promise.resolve(r)===!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(r=>{r.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(r=>{let i=e[r];n["_"+r]!==i&&(n["_"+r]=t[r]=i)}),t}}class He extends Xe{}var Q=typeof window<"u"?window:{screen:{},navigator:{}},xe=(Q.matchMedia||function(){return{matches:!1}}).bind(Q),$t=!1,gn={get passive(){return $t=!0}},vt=function(){};Q.addEventListener&&Q.addEventListener("p",vt,gn),Q.removeEventListener&&Q.removeEventListener("p",vt,!1);var yn=$t,vn="PointerEvent"in Q,pt="ontouchstart"in Q,Kt=pt||"TouchEvent"in Q&&xe("(any-pointer: coarse)").matches,bt=(Q.navigator.maxTouchPoints||0)>0||Kt,Nt=Q.navigator.userAgent||"",bn=xe("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Nt)&&Math.min(Q.screen.width||0,Q.screen.height||0)>=768,Ht=(xe("(pointer: coarse)").matches||!xe("(pointer: fine)").matches&&pt)&&!/Windows.*Firefox/.test(Nt),wn=xe("(any-pointer: fine)").matches||xe("(any-hover: hover)").matches||bn||!pt,at=!bt||!wn&&Ht?bt?"touchOnly":"mouseOnly":"hybrid",xn=at==="mouseOnly"?"mouse":at==="touchOnly"||Ht?"touch":"mouse";const Sn=Object.freeze(Object.defineProperty({__proto__:null,deviceType:at,primaryInput:xn,supportsPassiveEvents:yn,supportsPointerEvents:vn,supportsTouchEvents:Kt},Symbol.toStringTag,{value:"Module"})),En=new Set(["INPUT","TEXTAREA","SELECT"]),Wt={};function ke(){return Sn}const Ft=o=>o==="BracketLeft"?"[":o==="BracketRight"?"]":I.CommonUtils.camelToPrettyCase(o),Ye=(o,e)=>{let t=!1,n=!1;const r={nativeEvent:o,currentTarget:e||o.currentTarget,target:o.target,bubbles:o.bubbles,cancelable:o.cancelable,defaultPrevented:o.defaultPrevented,eventPhase:o.eventPhase,isTrusted:o.isTrusted,preventDefault:()=>{t=!0,o.preventDefault()},isDefaultPrevented:()=>t,stopPropagation:()=>{n=!0,o.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:o.timeStamp,type:o.type};for(const i in o)i in r||typeof o[i]=="function"||(r[i]=o[i]);return r},Cn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Wt,boundPixel:function(o,e=!1,t=0){return o},createSyntheticEvent:Ye,detectIt:ke,focusableNodeNames:En,toPrettyKeyCode:Ft},Symbol.toStringTag,{value:"Module"}));class mt{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=I.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=(r,i)=>{const a=n._root._listenersByKey,h=i.key(),l=a.get(h);l&&n._notifyCommands(l,"onCommandChange",i)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let r=n,i=n===this;for(;!i&&r;)r===this&&(i=!0),r=r._parent;return(i?n:this)._getCommand(e)}createChildGroup(e,t,n){let r;if(!n){let h=this;for(;h&&!r;){let l=h._nodes.get(t);l&&(r=l),h=h._parent}}r||(r=new mt(e,t),r._parent=this,r._root=this._root,r._unListenersByCommand=null,r._listenersByKey=null,r._commandsPropertyListener=null);const i=(h,l)=>{!h.has(t)||n?h.set(t,l):n===void 0&&console.warn("commandGroup already registered",t)};i(this._root._nodes,r);let a=this._parent;for(;a;)i(this._nodes,r),a=a._parent;return this._children.set(t,r),this._notify("onGroupChange"),r}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,r=this._commandsByShortcut,i=this._root._commandsPropertyListener,a=this._root._unListenersByCommand;for(let h=0;h<e.length;h++){const l=e[h],s=l.key();if(n.has(s)&&!t){t===void 0&&console.warn("command already registered",s);continue}n.set(s,l);let c=a.get(l);c&&(c(),a.delete(l));const d=l.addPropertyListener(i);a.set(l,d);const f=l.shortcut();if(!f)continue;const m=Array.isArray(f)?f:[f];for(let _=0;_<m.length;_++){const p=be(m[_]),E=r.get(p);E&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${p}, ${s}, ${E}.`),r.set(p,s)}}}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 r=i=>{i._children.forEach(a=>{for(let h=0;h<t.length;h++)a._nodes.delete(t[h]);r(a)})};r(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(X.Alt),e.shiftKey&&t.push(X.Shift),e.ctrlKey&&t.push(X.Ctrl),e.metaKey&&t.push(X.Meta);let n=be({key:e.code,modifiers:t});const r=this._commandsByShortcut;let i=r.get(n);i||(n=be({key:e.key,modifiers:t}),i=r.get(n)),!i&&e.code.startsWith("Digit")&&(n=be({key:e.code.substring(5,e.code.length),modifiers:t}),i=this._commandsByShortcut.get(n)),!i&&e.code.startsWith("Key")&&(i=be({key:e.code.substring(3,e.code.length),modifiers:t}),i=r.get(n));let a=null;return i&&(a=this._commandsByKey.get(i),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,r=t?.keys,i=this._root._listenersByKey;if(r&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let a=null;if(r)for(let h=0;h<r.length;h++){const l=r[h];if(!l)continue;let s=i.get(l);s||(s=new Set,i.set(l,s)),a||(a=[]),a.push(s),s.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 r=this;setTimeout(()=>{e.forEach(i=>{i[t]?.(r,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(r=>{r[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 Mn=I.CommonUtils.getOS()===I.CommonUtils.OSType.MacOS||I.CommonUtils.getOS()===I.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Ln=I.CommonUtils.getOS()===I.CommonUtils.OSType.MacOS||I.CommonUtils.getOS()===I.CommonUtils.OSType.IOS?"⌘":"^",be=(o,e=!1)=>{const t={};for(let r=0;o.modifiers&&r<o.modifiers.length;r++)t[o.modifiers[r]]=!0;let n="";return(t?.[X.Ctrl]||t?.[X.Meta])&&(n+=(n.length>0?"+":"")+(e?Ln:Mn)),t?.[X.Alt]&&(n+=e?"⌥":"Alt"),t?.[X.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+Ft(o.key),n},We=(o,e)=>{if(!e||!o||e.length===0)return I.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let r=0;r<t;r++){const i=e[r],a=i?o.getCommand(i):null;n[r]=a}return n};function rt(o,e){if(typeof o=="function")return o(e);o&&(o.current=e)}var Se=parseInt(u.version.split(".")[0],10)>=19?function(o){return e=>{const t=[];for(const n of o){const r=rt(n,e),i=typeof r=="function";t.push(i?r:()=>rt(n,null))}return()=>{for(const n of t)n()}}}:function(o){return e=>{for(const t of o)rt(t,e)}};const Tn=u.memo(u.forwardRef((o,e)=>{const{refFocusStart:t,...n}=o,r=u.useRef(null),i=u.useCallback(()=>{if(t)return void t?.current?.focus();const a=r.current.parentElement.children;let h=[];const l=a.length;for(let s=0;s<l&&a[s]!==r.current;s++){const c=a[s],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(s,c){return s.tabindex-c.tabindex}),h[0].child.focus())},[t]);return w.jsx("div",{tabIndex:0,ref:Se([r,e]),onFocus:i,...n})}));var kn=function(){},Ut=typeof window<"u",Pn=Ut?u.useLayoutEffect:u.useEffect,wt={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const pe=Ut&&window.ResizeObserver!==void 0?function(){var o=u.useState(null),e=o[0],t=o[1],n=u.useState(wt),r=n[0],i=n[1],a=u.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var l=h[0].contentRect,s=l.x,c=l.y,d=l.width,f=l.height,m=l.top,_=l.left,p=l.bottom,E=l.right;i({x:s,y:c,width:d,height:f,top:m,left:_,bottom:p,right:E})}})},[]);return Pn(function(){if(e)return a.observe(e),function(){a.disconnect()}},[e]),[t,r]}:function(){return[kn,wt]},Dn=u.memo(u.forwardRef((o,e)=>{const{className:t,style:n,children:r,radius:i=4,strokeWidth:a=1,strokeColor:h="grey",...l}=o,[s,{width:c,height:d}]=pe(),f=u.useRef(null),m=(P,g=0)=>{const x=P/2,v=d-x+g;return(function(R,M,j=!1){if(M===0)return R;function O(y,T,$){let K=T.x-y.x,V=T.y-y.y,A=Math.sqrt(K*K+V*V);return C(y,T,Math.min(1,$/A))}function C(y,T,$){return{x:y.x+(T.x-y.x)*$,y:y.y+(T.y-y.y)*$}}function S(y,T){y.length>2&&(y[y.length-2]=T.x,y[y.length-1]=T.y)}function k(y){return{x:parseFloat(y[y.length-2]),y:parseFloat(y[y.length-1])}}let L=R.split(/[,\s]/).reduce(function(y,T){let $=T.match("([a-zA-Z])(.+)");return $?(y.push($[1]),y.push($[2])):y.push(T),y},[]).reduce(function(y,T){return parseFloat(T)==T&&y.length?y[y.length-1].push(T):y.push([T]),y},[]),B=[];if(L.length>1){let y=k(L[0]),T=null;L[L.length-1][0]==="Z"&&L[0].length>2&&(T=["L",y.x,y.y],L[L.length-1]=T),B.push(L[0]);for(let $=1;$<L.length;$++){let K=B[B.length-1],V=L[$],A=V===T?L[1]:L[$+1];if(A&&K&&K.length>2&&V[0]==="L"&&A.length>2&&A[0]==="L"){let W,N,U=k(K),G=k(V),me=k(A);j?(W=C(G,K.origPoint||U,M),N=C(G,A.origPoint||me,M)):(W=O(G,U,M),N=O(G,me,M)),S(V,W),V.origPoint=G,B.push(V);let ae=C(W,G,.5),_e=C(G,N,.5),ce=["C",ae.x,ae.y,_e.x,_e.y,N.x,N.y];ce.origPoint=G,B.push(ce)}else B.push(V)}if(T){let $=k(B[B.length-1]);B.push(["Z"]),S(B[0],$)}}else B=L;return B.reduce(function(y,T){return y+T.join(" ")+" "},"")})(`${`M 0 ${x} L ${i-.5} ${x} L ${i-.5} ${v} L ${2*i} ${v}`} ${`L ${c-2*i} ${v}`} ${`M ${c-2*i} ${v} L ${c-i} ${v} L ${c-i} ${x} L ${c} ${x}`}`,i)},_=u.useMemo(()=>m(a),[c,d,i,a]),p=u.useMemo(()=>{if(i===0)return;const P=i/2;return m(i)+`L ${c} 0 L 0 0 L 0 ${P}`},[_,i,a]),E=u.useMemo(()=>({style:{clipPath:`path('${p}')`}}),[p]);return w.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...l,ref:Se([f,s,e]),children:[u.isValidElement(r)?u.cloneElement(r,E):w.jsx(w.Fragment,{}),w.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:c,height:d,viewBox:`0 0 ${c} ${d}`,children:w.jsx("path",{d:_,stroke:h,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:a})})]})})),ct={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Vt extends I.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!==ct.Warning?t?.type!==ct.Error?I.Notifier.log(e):I.Notifier.error(e):I.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(r=>{r(()=>{})})}showWindow(e,t){const n=this.getDelegate();if(n?.showWindow)return n.showWindow(e,t)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):I.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInput(e){const t=this.getDelegate();return t?.showInput?t.showInput(e):Promise.resolve({input:"",option:""})}}const An=new Vt,Xt=u.createContext(An),Me=()=>u.useContext(Xt),zn=3,Rn=.5,jn=50,it=o=>({x:o.x,y:o.y,width:o.width,height:o.height,top:o.top,left:o.left,right:o.right,bottom:o.bottom});function Yt(o={}){const{threshold:e=Rn,stillnessThreshold:t=zn,maxHierarchyDepth:n=jn}=o,[r,i]=pe(),a=u.useRef(null),[h,l]=u.useReducer(_=>_+1,0),s=u.useRef(void 0),c=u.useRef({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0}),d=u.useCallback(_=>{a.current=_,typeof r=="function"&&r(_)},[r]),[f,m]=u.useState(i);return u.useEffect(()=>{i&&!f&&m(i)},[i,f]),u.useEffect(()=>{const _=a.current;if(!_)return;let p=!1,E=0;const P=()=>{if(!_)return;const M=_.getBoundingClientRect(),j=c.current;Math.abs(M.x-j.x)>e||Math.abs(M.y-j.y)>e||Math.abs(M.width-j.width)>e||Math.abs(M.height-j.height)>e?(p||(p=!0,m(it(M)),l()),E=0):E++,p&&E>=t&&(p=!1,m(it(M)),l()),c.current=it(M),s.current=requestAnimationFrame(P)};s.current=requestAnimationFrame(P);const g=M=>{p=!0,l()},x=M=>{p=!1,E=t,l()};let v=_;const R=[];for(;v&&v!==document.documentElement&&(v.addEventListener("animationstart",g,!0),v.addEventListener("animationend",x,!0),v.addEventListener("transitionstart",g,!0),v.addEventListener("transitionend",x,!0),R.push(v),v=v.parentElement,!(R.length>n)););return()=>{s.current&&cancelAnimationFrame(s.current),R.forEach(M=>{M.removeEventListener("animationstart",g,!0),M.removeEventListener("animationend",x,!0),M.removeEventListener("transitionstart",g,!0),M.removeEventListener("transitionend",x,!0)})}},[h,i,e,t,n]),[d,f]}const D=(o,e)=>{const t=u.useCallback((...i)=>o?.(...i),e),n=u.useRef(null);n.current=t;const r=u.useCallback((...i)=>n.current?.(...i),[]);if(n.current)return r};let Fe=0;function qt(){const[o,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 r=document.fullscreenElement;if(e(!!r),!r)return;let i=r.querySelector(".fullscreen-portal-root");i||(i=document.createElement("div"),i.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",r.appendChild(i))}return Fe++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Fe--,Fe<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)}),Fe=0)}},[]),{getPortalContainer:t,isFullscreen:o}}function ut(o){if(!o)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:r=!1,consumeTouch:i=!0}=o,a=D(e,[e]),h=D(t,[t]),l=D(n,[n]),s=u.useRef(!1),c=o?.timerInitial??230,d=o?.timerContinuous??c/2,f=u.useRef(null),m=u.useRef(null),_=u.useRef(null),p=u.useRef(null),E=u.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]),P=u.useCallback(S=>{p.current=setTimeout(()=>{window.requestAnimationFrame(()=>{if(s.current===!1)return;const k=m.current,L=f.current,B=Ye(k,L.currentTarget);l?.(B,_.current,L)}),P(d)},S??c)},[]);u.useEffect(()=>()=>E(),[]);const g=r?"pointer":"mouse",x=u.useCallback(S=>{S.stopPropagation(),S.stopImmediatePropagation(),S.preventDefault()},[]),v=D(S=>{document.removeEventListener(`${g}move`,j),document.removeEventListener(`${g}up`,v),document.removeEventListener("keydown",O),document.removeEventListener("keyup",C),document.removeEventListener("touchstart",x,{capture:!0}),document.removeEventListener("touchmove",x,{capture:!0}),window.removeEventListener("blur",R),E(),window.requestAnimationFrame(()=>{if(s.current===!1)return;s.current=!1;const k=S,L=f.current,B=Ye(k,L.currentTarget);h?.(B,_.current,L),_.current=null})},[]),R=u.useCallback(()=>{s.current!==!1&&(s.current=!1,v(m.current))},[]),M=D(()=>{E(),P(d),window.requestAnimationFrame(()=>{if(s.current===!1)return;const S=m.current,k=f.current,L=Ye(S,k.currentTarget);l?.(L,_.current,k)})},[d]),j=D(S=>{m.current=S,M()},[]),O=D(S=>{_.current={ctrlKey:S.ctrlKey,shiftKey:S.shiftKey,altKey:S.altKey,metaKey:S.metaKey},M()},[]),C=D(S=>{_.current={ctrlKey:S.ctrlKey,shiftKey:S.shiftKey,altKey:S.altKey,metaKey:S.metaKey},M()},[d]);return D(S=>{S.isDefaultPrevented()||(_.current={ctrlKey:S.ctrlKey,shiftKey:S.shiftKey,altKey:S.altKey,metaKey:S.metaKey},a(S,_.current)!==!1&&(f.current=S,m.current=S.nativeEvent,document.addEventListener(`${g}up`,v,{passive:!1}),document.addEventListener(`${g}move`,j,{passive:!1}),document.addEventListener("keydown",O,{passive:!1}),document.addEventListener("keyup",C,{passive:!1}),window.addEventListener("blur",R,{passive:!0}),r&&i&&(document.addEventListener("touchstart",x,{passive:!1,capture:!0}),document.addEventListener("touchmove",x,{passive:!1,capture:!0})),s.current=!0,P(c)))},[c,r])}const Bn=({initValue:o,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(o);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const r=e();return u.useLayoutEffect(()=>{n.current!==r&&(n.current=r,t(r))},[t,r]),null},ht=o=>{console&&console.warn&&console.warn(o)},st=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let On=1,dt=!1,Gt=!1;const qe=[],we=[],Ze=()=>{we.forEach(o=>o())},In=({automaticContainerInternalUseOnly:o})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,o||dt!==!1||(Gt=!0),u.useEffect(()=>{let r=!0;function i(){if(r)return we[0]!==i?(o||dt!==!0||ht("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([...qe])}return we.push(i),Ze(),()=>{r=!1,n.current?.length>0&&ht("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),we.splice(we.indexOf(i),1),Ze()}},[o]),w.jsx(w.Fragment,{children:e.map(({hook:r,key:i})=>u.createElement(Bn,{...r,key:i}))})},$n=o=>{const e=On++;return qe.push({hook:o,key:e}),we.length===0&&Gt===!1&&(dt=!0,(t=>{if(st.document&&st.document.createElement){const n=st.document.createElement("div");_n.createRoot(n).render(w.jsx(t,{automaticContainerInternalUseOnly:!0}))}else ht("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(In)),Ze(),()=>{qe.splice(qe.findIndex(t=>t.key===e),1),Ze()}};let ft=null;ft||(ft=(o,e,t={})=>{let n,r,i=!1,a=!1,h=[],{unmountIfNoConsumers:l=!1}=t;const s=d=>{var f;r=d,f=()=>h.forEach(m=>m(d)),It.unstable_batchedUpdates(f)},c=()=>(a||(r=typeof o=="function"?o():o,a=!0),r);return()=>{const[d,f]=u.useState(c);return u.useEffect(()=>(i||(i=!0,n=$n({initValue:o,useHookBody:e,applyStateChange:s})),h.push(f),r!==d&&f(r),()=>{h.splice(h.indexOf(f),1),h.length===0&&l&&(n(),i=!1)}),[]),d}});const Zt=ft;let Jt=()=>{console.warn("You must call useEditMode before setting its state.")};const Kn=Zt(null,()=>{const[o,e]=u.useState(null);return Jt=e,o}),xt=Zt({setClipboard:o=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>I.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[o,e]=u.useState(I.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>o,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let lt=!1,Nn=0;var Hn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const St=()=>"sheetxl-ui-"+Nn++,Et=u.useId,Wn=Et??function(){const[o,e]=u.useState(()=>lt?St():void 0);return Hn(()=>{o==null&&e(St())},[]),u.useEffect(()=>{lt||(lt=!0)},[]),o},Fn=[];function Je(o,e,t=Fn){const n=u.useRef(null);return u.useImperativeHandle(o,()=>{if(!n.current)return;const r=n.current,i=e?.();if(!i||typeof i!="object")throw new Error("attributes must return a plain object of values");const a=Object.keys(i),h=a.length;for(let l=0;l<h;l++){const s=a[l],c=i[s];Object.defineProperty(r,s,{value:c,writable:!0,configurable:!0,enumerable:!0})}return r},t),n}const Ct="Undo the last action.",Mt="Repeat the last action or undo the redo.",Un=o=>`Redo ${o}`;class Vn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class Xn{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)}}function Qt(o){var e,t,n="";if(typeof o=="string"||typeof o=="number")n+=o;else if(typeof o=="object")if(Array.isArray(o)){var r=o.length;for(e=0;e<r;e++)o[e]&&(t=Qt(o[e]))&&(n&&(n+=" "),n+=t)}else for(t in o)o[t]&&(n&&(n+=" "),n+=t);return n}function oe(){for(var o,e,t=0,n="",r=arguments.length;t<r;t++)(o=arguments[t])&&(e=Qt(o))&&(n&&(n+=" "),n+=e);return n}const Yn={},en=o=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:r=0,paddingAfter:i=0,disabled:a,key:h,hitAreaProps:l=Yn,...s}=o,c=n==="row",{style:d,className:f,...m}=l;return w.jsx("div",{style:{...t,position:"relative"},...s,children:w.jsx("div",{className:oe("hit-box",f),style:{left:(c?-r:0)+"px",width:`calc(100% + ${c?r+i:0}px)`,top:(c?0:-r)+"px",height:`calc(100% + ${c?0:r+i}px)`,position:"absolute",...d},onPointerDown:a?void 0:e,...m})},h)},Ue={},de=(o,e,t=!0)=>o===null?null:o.pixels!==null?t?o.pixels:e-o.pixels:(t?o.percent:100-o.percent)/100*e,Ve=(o,e=!0)=>o?.percent?`${e?o.percent:100-o.percent}%`:o?.pixels?`${o.pixels}px`:void 0,se=(o,e)=>{if(o==null)return null;const t={percent:null,pixels:null};let n=e;return typeof o=="string"&&((o=o.trim().toLowerCase()).endsWith("px")?(o=o.substring(0,o.length-2),n=!1):o.endsWith("%")&&(o=o.substring(0,o.length-1),n=!0),o=parseFloat(o)),n?t.percent=o:t.pixels=o,Object.freeze(t)},tn=u.memo(u.forwardRef((o,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:r="row",fixedPane:i=null,position:a,onPositionChange:h,minBefore:l,maxBefore:s,minAfter:c,maxAfter:d,children:f,className:m,style:_,disabled:p=!1,onDragStart:E,onDragResize:P,onDragFinish:g,resizerProps:x=Ue,paneProps:v=Ue,paneBeforeProps:R=Ue,paneAfterProps:M=Ue,createResizer:j=en}=o;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const O=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),C=u.useMemo(()=>{let z=null;i&&(i==="before"?z=0:i==="after"&&(z=1));const F=z===null;return{fixedPaneOffset:z,isPercent:F,minBefore:se(l,F),maxBefore:se(s,F),minAfter:se(c,F),maxAfter:se(d,F)}},[l,s,c,d]),S=D(h,[h]),[k,L]=u.useState(()=>se(a,i===null));u.useEffect(()=>{L(se(a,i===null))},[a,i]);const[B,{width:y,height:T}]=pe(),[$,{width:K,height:V}]=pe(),A=r==="row"?K:V,W=r==="row"?y:T,N=u.useMemo(()=>((z,F,J,Y)=>{const re=[null,null],ne=[null,null];if(z||(z={percent:Y.fixedPaneOffset===null?50:null,pixels:Y.fixedPaneOffset===null?null:0}),F===0)return z?.pixels!=null?Y.fixedPaneOffset!==1?(re[0]=z?.pixels,ne[1]=100):(re[1]=z?.pixels-J,ne[0]=100):z?.percent!=null&&(Y.fixedPaneOffset!==1?(ne[0]=z?.percent,ne[1]=100-z?.percent):(ne[1]=z?.percent,ne[0]=100-z?.percent)),{percents:ne,pixels:re,minBefore:Ve(Y.minBefore,!0),maxBefore:Ve(Y.maxBefore,!0),minAfter:Ve(Y.minAfter),maxAfter:Ve(Y.maxAfter)};let ie=de(z,F,Y.fixedPaneOffset!==1),ee=F-J,_t=de(Y.minBefore,ee,!0)??0,pn=de(Y.maxBefore,ee,!0)??ee,Ne=0,ot=0,gt=0,yt=ee;Ne=(de(Y.maxAfter,F,!1)??J)-J,ot=de(Y.minAfter,F,!1)??F,gt=Math.max(_t,Ne),yt=Math.min(pn,ot),ie=Math.max(gt,Math.min(ie,yt)),ot=Math.min(ee-ie,de(Y.maxAfter,ee-ie,!0)??ee),Ne=Math.min(ee-ie,de(Y.minAfter,ee-ie,!0)??ee),re[0]=ie,re[1]=ee-re[0];const mn=Math.max(0,Math.min(100,ie/ee*100));return ne[0]=mn,ne[1]=100-ne[0],{percents:ne,pixels:re,minBefore:`${_t}px`,minAfter:`${Ne}px`,maxBefore:`${re[0]}px`,maxAfter:`${re[1]}px`}})(k,W,A,C),[C,k,W,A,r]),[U,G]=u.useState(!1),me=D(E,[E]),ae=D(P,[P]),_e=D(g,[g]),ce=u.useRef(null),Qe=u.useRef(null),De=u.useRef(null),{style:et,className:Ae,...ze}=v,Re={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...et},{className:tt,style:je,...Be}=R,{className:Oe,style:Ie,...ge}=M,Ee={flex:"1 1 100%",width:"100%",..._,flexDirection:r,display:"flex"},{className:te,style:ye,onPointerDown:$e,...Ke}=x,Ce=D(z=>{const F=se(z,i===null);L(F)},[i]),b=D(z=>{if(p||!U)return;const F=ue.current?.getBoundingClientRect();let J=0;J=r==="row"?(z.clientX??z.touches?.[0]?.clientX)-F.x:(z.clientY??z.touches?.[0]?.clientY)-F.y,J=Math.max(0,Math.min(W,J)),C.fixedPaneOffset===1&&(J=W-J),a&&k.pixels===J||L({pixels:J,percent:null}),ae?.(J),z.stopPropagation(),z.preventDefault()},[C,r,p,U,k,W]),H=D(z=>{if(document.removeEventListener("pointermove",b),document.removeEventListener("touchmove",b),document.removeEventListener("pointerup",H),!!U&&(G(!1),!!k)){if(_e(k.pixels),!se(a,i===null)||k.pixels!==a){const F={...k};F.percent===null&&(F.percent=F.pixels/W*100),S(F)}z.stopPropagation(),z.preventDefault()}},[k,U,a,i,W]),Z=D(z=>{$e?.(z),z.defaultPrevented||p||U||(G(!0),me(),document.addEventListener("pointermove",b,{passive:!1}),document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("pointerup",H,{passive:!1}))},[$e]),ue=Je(e,()=>({setPosition:Ce,isSplitPane:()=>!0}),[]),ve=u.useMemo(()=>O?j?.({key:"resizer",ref:Se([$,Qe]),className:oe("resizer",te),onPointerDownCapture:Z,style:{cursor:p?void 0:r==="row"?"ew-resize":"ns-resize",minWidth:r==="row"?"2px":void 0,minHeight:r!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...ye},splitDirection:r,disabled:p,...Ke}):null,[O,te,Ke,r,ye,p]),he=r==="row"?"Width":"Height",nt=u.useMemo(()=>{if(!t)return null;const z={...Re,...je,flex:C.fixedPaneOffset===0&&N?.pixels[0]!==null?`0 0 ${Math.round(N?.pixels[0])}px`:`1 1 ${Math.round(N?.percents[0]??100)}%`,[`min${he}`]:N?.minBefore,[`max${he}`]:n?N?.maxBefore:"100%"};return w.jsx("div",{ref:ce,className:oe("before",Ae,tt),style:z,...ze,...Be,children:t},"before")},[t,v,R,C,N]),fn=u.useMemo(()=>{if(!n)return null;const z={...Re,...Ie,flex:C.fixedPaneOffset===1&&N?.pixels[1]!==null?`0 0 ${Math.round(N?.pixels[1])}px`:`1 1 ${Math.round(N?.percents[1]??100)}%`,[`min${he}`]:N?.minAfter,[`max${he}`]:t?N?.maxAfter:"100%"};return w.jsx("div",{ref:De,className:oe("after",Ae,Oe),style:z,...ze,...ge,children:n},"after")},[n,v,M,C,N]);return w.jsxs("div",{ref:Se([B,ue]),className:oe("splitPane",r==="row"?"vertical":"horizontal",{dragging:U},m),style:Ee,children:[nt,ve,fn]})}));function qn(o){if(typeof o=="function")return o;if(typeof o=="string"){const e=o.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const r=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!r)return null;const i=r[1]||"",a=r[2]||"";try{if(/;base64/i.test(i)){if(typeof atob<"u"){const h=atob(a),l=h.length;if(typeof TextDecoder<"u"){const c=new Uint8Array(l);for(let d=0;d<l;d++)c[d]=h.charCodeAt(d);return new TextDecoder("utf-8").decode(c)}let s="";for(let c=0;c<l;c++)s+=`%${h.charCodeAt(c).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 kt(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return kt(e);if(/^<\s*path\b/i.test(e)){const t=Lt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(o)){const e=[];for(const t of o)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const r=Lt(n);r&&e.push({d:r})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return o}function Lt(o){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);return e?e[1]??e[2]??null:null}function Tt(o){if("svg"in o)return{...o,svg:qn(o.svg)};if("url"in o){const e=typeof o.url=="string"?{src:o.url}:o.url;return{...o,url:e}}if("emoji"in o){const e=typeof o.emoji=="string"?o.emoji:o.emoji.text;return{...o,emoji:e}}return o}function kt(o){try{if(typeof DOMParser<"u"){const a=new DOMParser().parseFromString(o,"image/svg+xml"),h=a.querySelector("svg"),l=h?.getAttribute("viewBox")??void 0,s=[];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 _=c.getAttribute("fill");_&&_!=="none"&&(f.fill=_);const p=c.getAttribute("stroke");p&&(f.stroke=p);const E=c.getAttribute("opacity");E&&(f.opacity=Number(E));const P=c.getAttribute("fill-rule");P&&(f.fillRule=P);const g=c.getAttribute("clip-rule");g&&(f.clipRule=g),s.push(f)}),{viewBox:l,paths:s}}}catch{}const e=o.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],r=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let i;for(;i=r.exec(o);)n.push({d:i[1]});return{viewBox:t,paths:n}}function Pt(o){const e={};for(const[i,a]of Object.entries(o.icons))e[i]=Tt(a);const t={label:o.meta?.label??"Unnamed",version:o.meta?.version??"1.0.0",license:o.meta?.license??"MIT",defaultViewBox:"0 0 24 24",extends:o.meta?.extends??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},r=o.overrides;if(r){const i={};for(const[a,h]of Object.entries(r)){const l={};for(const[s,c]of Object.entries(h))l[s]=Tt(c);i[a]=l}n.__overrides=i}return n}function nn(){const o=new Map,e=new Map;let t="base",n=new Map;async function r(l){const s=o.get(l??t);if(!s)throw new Error(`Icon pack not registered: ${l}`);if(!s.pack){if(!s.loading){if(!s.loader)throw new Error(`No loader for icon pack: ${l}`);s.loading=s.loader().then(c=>{const d=c&&typeof c=="object"&&"default"in c?c.default:c;s.pack=Pt(d)}).catch(c=>{throw s.loading=void 0,c})}await s.loading}}function i(l){const s=l.indexOf(":");return s>0?{ns:l.slice(0,s),key:l.slice(s+1)}:{key:l}}function a(l,s){const c=[l,...o.get(l)?.pack?.meta.extends??[]];for(const d of c){const f=o.get(d);if(!f?.pack)continue;const{icons:m}=f.pack,_=m[e.get(d)?.get(s)??s]??m[s];if(_)return{glyph:_,pack:f.pack,packKey:d}}return null}function h(l,s){const c=s?.packKey??t;if(s?.packKey)return a(s.packKey,l);if(!l)return null;const{ns:d,key:f}=i(l);if(d){const m=o.get(d)?.pack;if(m){if(o.get(t)?.pack){const p=m.__overrides,E=p?.[t]?.[f];if(E)return{glyph:E,pack:m,packKey:d}}const _=a(d,f);if(_)return _}return null}return a(c,l)}return{register:function(l,s){const c=o.get(l)??{};typeof s=="function"?c.loader=s:c.pack=Pt(s),o.set(l,c),t||(t=l)},prefetch:async function(l=t){const s=Array.isArray(l)?l:[l];await Promise.all(s.map(r))},setActive:function(l){t=l;for(const s of n.keys())try{s(l)}catch{}},getActive:function(){return t},resolve:async function(l,s){let c=h(l,s);if(c)return c;const d=s?.packKey??t,{ns:f}=i(l);if(s?.packKey){if(await r(d),c=h(l,s),c)return c;const m=o.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}else if(f){if(await r(f),c=h(l,s),c)return c;const m=o.get(f)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}else{if(await r(d),c=h(l,s),c)return c;const m=o.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}return null},registerAlias:function(l,s,c){e.has(l)||e.set(l,new Map),e.get(l).set(s,c)},has:function(l,s){return!!h(l,s)},getPack:function(l){return o.get(l??t)?.pack},hasPack:function(l){return!!o.get(l)?.pack},listPacks:function(){return Array.from(o.keys())},listIcons:function(l){const s=o.get(l)?.pack;return s?Object.keys(s.icons):[]},addActiveListener:function(l){const s=n.get(l);if(s)return s;const c=()=>{n.delete(l)};return n.set(l,c),c}}}tn.displayName="SplitPane";const Te=nn();Te.register("base",()=>Promise.resolve().then(()=>require("./DR4nVOJkx8rs4k4Z.cjs")));const Dt=o=>w.jsx("svg",{...o,children:w.jsx("path",{})}),Gn={Icon:"_Icon_17dpm_10"},At=u.memo(o=>{const{iconKey:e,packKey:t,className:n,style:r,role:i,title:a,size:h,ariaHidden:l,sourceProps:s,children:c,...d}=o,[f,m]=u.useState(null);u.useEffect(()=>{let L=!0,B=t,y=e;if(!y){const T=Te.getPack(B);return void m({glyph:T?{svg:I.CommonUtils.EmptyArray}:void 0,pack:T??void 0,packKey:B??Te.getActive()})}if(y.includes(":")){const[T,$]=y.split(":");B=T,y=$}return Te.resolve(y,{packKey:B}).then(T=>{L&&m(T)}),()=>{L=!1}},[e,t]);const _=f?.pack,p=f?.glyph,E=f?.packKey;let P=p?p.svg:void 0;const g=p&&!P?p.url:void 0,x=!p||P||g?void 0:p.emoji,v=h!=null?typeof h=="number"?`${h}px`:h:void 0,R=u.useMemo(()=>[Gn.Icon,"icon",n].filter(Boolean).join(" "),[n]),M=u.useMemo(()=>{const L={...r};return L["--icon-size"]=v,L},[r,v]),j=i??(a?"img":"presentation"),O=l??(!a||void 0),C=L=>w.jsx("span",{className:R,style:M,role:j,"aria-hidden":O,title:a,"data-icon-glyph":e,"data-icon-pack":E,...d,children:L});if(c)return C(c);if(x)return C(w.jsx("span",{children:typeof x=="string"?x:x.text}));if(g)return C(w.jsx("img",{src:g.src,alt:a??""}));if(p&&"react"in p){const L=p.react,B={className:R,style:M,role:j,"aria-hidden":O,title:a,...d,...s};return C(w.jsx(L,{...B}))}const S={viewBox:P?.viewBox??_?.meta.defaultViewBox??"0 0 24 24"};if(typeof P=="function")return C(P(S)??w.jsx(Dt,{...S}));if(!P)return C(w.jsx(Dt,{...S}));const k=P.paths;return C(w.jsx("svg",{...S,children:k?k.map((L,B)=>w.jsx("path",{d:L.d,className:L.className,fill:L.fill,stroke:L.stroke,opacity:L.opacity,fillRule:L.fillRule,clipRule:L.clipRule},B)):null}))});class Ge{constructor(){this.store=new Map}async getItem(e){return this.store.get(e)??null}async setItem(e,t){this.store.set(e,t)}async removeItem(e){this.store.delete(e)}}const zt=u.createContext(null),on={parse:o=>o?JSON.parse(o):null,stringify:JSON.stringify},Zn={store:new Ge,namespace:"",serializer:on,debounceMs:0,crossTabSync:!1,notify:()=>{},subscribeKey:()=>()=>{}},Jn={},Qn={parse:o=>o==null?null:JSON.parse(o),stringify:JSON.stringify},q={Horizontal:"horizontal",Vertical:"vertical"},fe={scrollbar:"_scrollbar_15caq_24",track:"_track_15caq_34",thumb:"_thumb_15caq_46","scrollbar-button":"_scrollbar-button_15caq_86","touch-thumb":"_touch-thumb_15caq_121"},rn="M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z",sn="M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z",eo={transform:"rotate(180deg)"},ln=o=>{const{style:e,orientation:t=q.Vertical,disabled:n,...r}=o,i=t===q.Vertical?rn:sn;return w.jsx("button",{style:e,className:oe(fe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:w.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:w.jsx("path",{d:i})})})},an=o=>{const{style:e,orientation:t=q.Vertical,disabled:n,...r}=o,i=t===q.Vertical?rn:sn;return w.jsx("button",{style:e,className:oe(fe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:w.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:eo,children:w.jsx("path",{d:i})})})},to=ke().supportsTouchEvents,cn=u.memo(u.forwardRef((o,e)=>{const{borderColor:t="var(--sxl-app-color-primary, rgb(33, 115, 70))",backgroundColor:n="var(--sxl-app-color-background, white)",fillColor:r="var(--sxl-app-color-grey, grey)",borderWidth:i=3,size:a=22,style:h,className:l,onPointerDown:s,onPointerMove:c,onPointerUp:d,orientation:f=q.Vertical,offset:m=0,currentTouchAnchor:_,elementParent:p,elementRoot:E,key:P,...g}=o;if(!to)return null;const x=D(s,[s]),v=D(c,[c]),R=D(d,[d]),M=f===q.Vertical,[j,O]=u.useState(!1),C=ut(u.useMemo(()=>({processTouch:!0,consumeTouch:!0,onPointerDown:(A,W)=>{O(!0),x?.(A),A.preventDefault(),A.stopPropagation()},onPointerMoveOrWait:(A,W,N)=>{v?.(A)},onPointerUp:(A,W,N)=>{O(!1),R?.(N),A.preventDefault(),A.stopPropagation()}}),[])),S=u.useMemo(()=>{const A=a/2+i/2+6;return{x:M?-A:m+a,y:M?m+a:-A,width:0,height:0}},[M,m,a]),[k,{y:L,x:B}]=Yt(),y=u.useRef(null),{getPortalContainer:T,isFullscreen:$}=qt(),[K,V]=u.useState(null);return u.useEffect(()=>{const A=y.current?.getBoundingClientRect();if(!A)return void V(null);let W=0,N=0,U=p;for(;U;)W+=U.scrollLeft,N+=U.scrollTop,U=E&&U===E.parentElement?null:U.parentElement;V(It.createPortal(w.jsx("div",{className:oe("touch-thumb",fe["touch-thumb"],l,fe,{dragging:j}),ref:e,style:{left:W+(A?.x??0)-(a+i)/2,top:N+(A?.y??0)-(a+i)/2,width:M?a:1.8*a,height:M?1.8*a:a,borderWidth:`${i}px`,boxShadow:j?`${n} 0px 0px 0px 1.5px`:void 0,borderStyle:"solid",borderColor:t,backgroundColor:n,opacity:_?0:void 0,transitionDuration:"160ms",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center center",...h},tabIndex:-1,onPointerDown:C,...g}),E??T(),P))},[L,j,t,n,r,B,S?.x,S?.y,S?.width,S?.height,l,_,n,a,i,t,p,$,P]),S?w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:Se([k,y]),style:{position:"absolute",left:S.x,top:S.y,opacity:0}}),K]}):null}));cn.displayName="TouchThumbHandle";const no=24,un=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:r=0,style:i,className:a,orientation:h=q.Vertical,onScrollOffset:l,onScroll:s,showCustomScrollButtons:c,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:m=120,minThumbSize:_=no,maxThumbSize:p,createScrollStartButton:E=ln,createScrollEndButton:P=an,touchThumbProps:g,thumbProps:x,onMouseDown:v,...R}=o,M=ke().primaryInput==="touch",j=c??!M;D(s,[s]);const[O,C]=u.useState({offset:0,length:0}),S=u.useRef(-1),k=h===q.Vertical,[L,{width:B,height:y}]=pe(),T=k?y:B,$=D((b,H,Z)=>{if(H===0||Z===0)return void C({offset:0,length:_});const ue=Z/T,ve=H/ue,he=Math.min(Math.max(_,ve),Math.min(T,p??Number.MAX_SAFE_INTEGER)),nt=b/ue;return{offset:Math.min(Math.max(0,nt),T-he),length:he}},[T,_,p]),K=D(b=>{const H=n/T,Z=Math.round(b*H);C($(Z,r,n)),l?.(Z,r,n),S.current=b},[l,r,n,T,O]),V=D(b=>{C($(b,r,n)),l?.(b,r,n),S.current=b},[l,r,n]);u.useEffect(()=>{S.current!==t&&T!==0&&(S.current=-1,C($(t,r,n)))},[t]),u.useEffect(()=>{T!==0&&C($(t,r,n))},[r,n,k,T]);const A=Math.max(0,n-r),[W,N]=u.useState(!1),U=u.useRef(0),G=u.useRef(0),me=Je(e,()=>({isScrollbar:()=>!0}),[]),ae=D(b=>{N(!0),U.current=k?b.clientY:b.clientX,G.current=O.offset},[k,O]),_e=D(b=>{b.currentTarget.setPointerCapture(b.pointerId),ae(b),b.stopPropagation()},[v]),ce=D(b=>{if(!W)return;const H=(k?b.clientY:b.clientX)-U.current,Z=G.current+H;K(Z)},[W,k]),Qe=D(b=>{ce(b)},[]),De=D(b=>{N(!1)},[]),et=D(b=>{try{b.currentTarget.releasePointerCapture(b.pointerId)}catch{}De(b)},[]),Ae=D(b=>{if(!b.currentTarget)return;const H=b.currentTarget.getBoundingClientRect(),Z=k?b.clientY-H.top:b.clientX-H.left;K(Z)},[k,O,r,n]),ze=D(b=>{const H=Math.max(1,Math.floor(.9*r));k?(b.key==="ArrowDown"&&K(Math.min(A,t+1)),b.key==="ArrowUp"&&K(Math.max(0,t-1)),b.key==="PageDown"&&K(Math.min(A,t+H)),b.key==="PageUp"&&K(Math.max(0,t-H)),b.key==="Home"&&K(0),b.key==="End"&&K(A)):(b.key==="ArrowRight"&&K(Math.min(A,t+1)),b.key==="ArrowLeft"&&K(Math.max(0,t-1)),b.key==="PageDown"&&K(Math.min(A,t+H)),b.key==="PageUp"&&K(Math.max(0,t-H)),b.key==="Home"&&K(0),b.key==="End"&&K(A))},[k,r,n,t,A]),Re=u.useRef(null),tt=u.useMemo(()=>{const b=w.jsx("div",{...x,className:oe(fe.thumb),ref:Re,role:"slider","aria-label":k?"Rows":"Columns","aria-orientation":k?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":A,"aria-valuenow":t,tabIndex:0,style:{...x?.style,position:"relative",[k?"height":"width"]:`${O.length}px`,[k?"width":"height"]:"100%",transform:k?`translateY(${O.offset}px)`:`translateX(${O.offset}px)`,[k?"minHeight":"minWidth"]:`${_}px`},onMouseDown:v,onPointerDown:_e,onPointerMove:Qe,onPointerUp:et});return M?w.jsxs(w.Fragment,{children:[b,w.jsx(cn,{...g,offset:O.offset,orientation:k?q.Vertical:q.Horizontal,onPointerDown:ae,onPointerMove:ce,onPointerUp:De})]}):b},[O,_,A,t,k,M,v,g,x]),[je,Be]=u.useState(null),Oe=D(()=>{let b;b=typeof d=="function"?d(t,r,n):t-d;const H=Math.max(0,b);return V(H),Be(H),H},[d,t,r,n]),Ie=D(()=>{let b;b=typeof d=="function"?d(t,r,n):t+d;const H=Math.min(A,b);return V(H),Be(H),H},[d,t,A,r,n]),ge=u.useRef(null),Ee=u.useRef(null),te=u.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null,Ee.current=null)},[]),ye=u.useCallback((b,H,Z,ue=f)=>{Ee.current=b,ge.current=setTimeout(()=>{const ve=Z?Oe():Ie();ve!==Ee.current?ye(ve,!1,Z,m):te()},H?0:ue)},[Oe,Ie,te]);u.useEffect(()=>()=>te(),[te]);const $e=u.useMemo(()=>{if(!j)return null;const b={orientation:h,disabled:t<=0,onMouseUp:te,onMouseLeave:te,onMouseDown:()=>ye(t,!0,!0)};return E?.(b)},[j,h,t,je]),Ke=u.useMemo(()=>{if(!j)return null;const b={orientation:h,disabled:t>=A,onMouseUp:te,onMouseLeave:te,onMouseDown:()=>ye(t,!0,!1)};return P?.(b)},[j,h,t,A,je]),Ce=k?"vertical":"horizontal";return w.jsxs("div",{ref:Se([me,e]),className:oe(a,fe.scrollbar,Ce,{dragging:W,"has-touch-thumb":M}),style:i,...R,children:[$e,w.jsx("div",{ref:L,role:"scrollbar","aria-orientation":Ce,"aria-valuemin":0,"aria-valuemax":A,"aria-valuenow":t,tabIndex:0,className:oe(fe.track,"track",Ce),onMouseDown:v,onPointerDown:Ae,onKeyDown:ze,children:tt}),Ke]})}));let Rt=Date.now,jt=1e3,le={},oo=1;const Le=o=>{let e=le[o]!==null;return e&&(le[o]=null),e},Bt=(o,e,t,n=0,r)=>{let i=Rt(),a=i,h=0,l=0,s=0,c=oo++;if(c%20==0){const f={};for(let m in le)f[m]=!0;le=f}const d=function(f){let m=f!==!0,_=Rt(),p=!0;try{p=(!e||e(c))??!0}catch{p=!1}if(!le[c]||!p)return le[c]=null,void t?.(60-l/((_-i)/jt),c,!1);if(m){s=Math.round((_-a)/16.666666666666668)-1;for(let g=0;g<Math.min(s,4);g++)d(!0),l++}n&&(h=(_-i)/n,h>1&&(h=1));let E=r?r(h):h,P=!1;try{P=o(E,_,m)}catch{P=!1}P!==!1&&h!==1||!m?m&&(a=_,requestAnimationFrame(d)):(le[c]=null,t?.(60-l/((_-i)/jt),c,h===1||n==null))};return le[c]=!0,requestAnimationFrame(d),c},ro=function(o){return Math.pow(o-1,3)+1},io=function(o){return(o/=.5)<1?.5*Math.pow(o,3):.5*(Math.pow(o-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,n,r){e!==null&&(this.__clientWidth=e),t!==null&&(this.__clientHeight=t),n!==null&&(this.__contentWidth=n),r!==null&&(this.__contentHeight=r),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,r,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0);const a=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),r===void 0&&(r=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const h=e/a;let l=h*(this.__scrollLeft+n)-n,s=h*(this.__scrollTop+r)-r;l>this.__maxScrollLeft?l=this.__maxScrollLeft:l<0&&(l=0),s>this.__maxScrollTop?s=this.__maxScrollTop:s<0&&(s=0),this.__publish(l,s,e,t)}zoomBy(e,t=!1,n=0,r=0,i){this.zoomTo(this.__zoomLevel*e,t,n,r,i)}scrollTo(e,t,n=!1,r=1){if(this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0),r!==void 0&&r!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=r,t*=r,this.__computeScrollMax(r)}else r=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,r,n)}scrollBy(e=0,t=0,n=!1){const r=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(r+(e||0),i+(t||0),n)}doMouseZoom(e,t,n,r){const i=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,n-this.__clientLeft,r-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,r;this.__interruptedAnimation=!0,this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(Le(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let i=e.length===1;i?(n=e[0].pageX,r=e[0].pageY):(n=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=r,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=r,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!i&&this.options.scrollingX,this.__enableScrollY=!i&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!i,this.__isSingleTouch=i,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 r,i;e.length===2?(r=Math.abs(e[0].pageX+e[1].pageX)/2,i=Math.abs(e[0].pageY+e[1].pageY)/2):(r=e[0].pageX,i=e[0].pageY);let a=this.__positions;if(this.__isDragging){let h=r-this.__lastTouchLeft,l=i-this.__lastTouchTop,s=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=r-this.__clientLeft,_=i-this.__clientTop;s=(m+s)*d/f-m,c=(_+c)*d/f-_,this.__computeScrollMax(d)}}if(this.__enableScrollX){s-=h*this.options.speedMultiplier;let f=this.__maxScrollLeft;(s>f||s<0)&&(this.options.bouncing?s+=h/2*this.options.speedMultiplier:s=s>f?f:0)}if(this.__enableScrollY){c-=l*this.options.speedMultiplier;const f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?c+=l/2*this.options.speedMultiplier:c=c>f?f:0)}a.length>60&&a.splice(0,30),a.push(s,c,t),this.__publish(s,c,d)}else{let h=this.options.locking?3:0,l=5,s=Math.abs(r-this.__initialTouchLeft),c=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&s>=h,this.__enableScrollY=this.options.scrollingY&&c>=h,a.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(s>=l||c>=l),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=r,this.__lastTouchTop=i,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,r=n;for(let i=n;i>0&&t[i]>this.__lastTouchMove-100;i-=3)r=i;if(r!==n){const i=t[n]-t[r],a=this.__scrollLeft-t[r-2],h=this.__scrollTop-t[r-1];this.__decelerationVelocityX=a/i*(1e3/60),this.__decelerationVelocityY=h/i*(1e3/60);const l=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>l||Math.abs(this.__decelerationVelocityY)>l)&&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,r=!1){const i=this.__isAnimating;if(i&&(Le(i),this.__isAnimating=0),r&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const a=this.__scrollLeft,h=this.__scrollTop,l=this.__zoomLevel,s=e-a,c=t-h,d=n-l,f=function(p,E,P){P&&(this.__scrollLeft=a+s*p,this.__scrollTop=h+c*p,this.__zoomLevel=l+d*p,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),m=function(p){return this.__isAnimating===p}.bind(this),_=function(p,E,P){E===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||P)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=Bt(f,m,_,this.options.animationDuration,i?ro:io)}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),l=this.__clientWidth,s=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(a/l)*l,this.__minDecelerationScrollTop=Math.floor(h/s)*s,this.__maxDecelerationScrollLeft=Math.ceil(a/l)*l,this.__maxDecelerationScrollTop=Math.ceil(h/s)*s}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(a,h,l){this.__stepThroughDeceleration(l)}.bind(this),n=this.options.snapping?4:.1,r=function(){const a=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return a||(this.__didDecelerationComplete=!0),a}.bind(this),i=function(a,h,l){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=Bt(t,r,i)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const r=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);r!==t&&(t=r,this.__decelerationVelocityX=0);const i=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);i!==n&&(n=i,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 r=0,i=0,a=this.options.penetrationDeceleration,h=this.options.penetrationAcceleration;t<this.__minDecelerationScrollLeft?r=this.__minDecelerationScrollLeft-t:t>this.__maxDecelerationScrollLeft&&(r=this.__maxDecelerationScrollLeft-t),n<this.__minDecelerationScrollTop?i=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(i=this.__maxDecelerationScrollTop-n),r!==0&&(r*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=r*a:this.__decelerationVelocityX=r*h),i!==0&&(i*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=i*a:this.__decelerationVelocityY=i*h)}}}const Pe=(o,e)=>w.jsx(un,{...o,ref:e}),lo=Object.freeze(Object.defineProperty({__proto__:null,defaultCreateScrollbar:Pe,getScrollTo:(o,e,t,n,r=0)=>{for(let i=0;i<t.length;i++){const a=t[i].getBoundingClientRect();let h=a.left-e,l=h+a.width;if(n){if(h<o&&l>=o)return h}else if(Math.ceil(l)>Math.ceil(o)+2)return l}return r}},Symbol.toStringTag,{value:"Module"})),hn=({width:o,height:e})=>w.jsx("div",{className:"corner",style:{minWidth:`${o}px`,width:`${o}px`,minHeight:`${e}px`,height:`${e}px`}}),dn=u.memo(u.forwardRef((o,e)=>{const{children:t,viewport:n,onScrollViewport:r,showHorizontalScrollbar:i=!0,showVerticalScrollbar:a=!0,createScrollCorner:h=hn,createHorizontalScrollbar:l=Pe,createVerticalScrollbar:s=Pe,style:c,touchElement:d,disableTouch:f,...m}=o,_=i&&l,p=a&&s,E=D(r,[r]),P=Je(e,()=>({isScrollPane:()=>!0}),[]),g=u.useRef(null);u.useEffect(()=>{g.current&&(g.current.__scrollTop===n?.top&&g.current.__scrollLeft===n?.left||g.current.__isDecelerating||g.current?.scrollTo(n?.left,n?.top,!1))},[n?.left,n?.top,d]);const x=u.useCallback((y,T)=>{E?.({left:y,top:T})},[]),v=u.useCallback(y=>{g.current?.doTouchStart(y.touches,y.timeStamp)},[]),R=u.useCallback(y=>{y.preventDefault(),g.current?.doTouchMove(y.touches,y.timeStamp)},[]),M=u.useCallback(y=>{g.current?.doTouchEnd(y.timeStamp)},[]),j=u.useCallback(({containerWidth:y,containerHeight:T,totalWidth:$,totalHeight:K})=>{g.current.setDimensions(y,T,$,K)},[]);u.useEffect(()=>{const y=d??P.current;if(!f&&ke().supportsTouchEvents&&y&&n){if(!g.current){const T={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};g.current=new so(x,T)}ke().supportsTouchEvents&&(y.addEventListener("touchstart",v),y.addEventListener("touchend",M),y.addEventListener("touchmove",R)),j({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{y?.removeEventListener("touchstart",v),y?.removeEventListener("touchend",M),y?.removeEventListener("touchmove",R)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,f,d]);const[O,{width:C}]=pe(),[S,{height:k}]=pe(),L=u.useMemo(()=>{if(!p)return null;const y=s({orientation:q.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:T=>{E?.({top:T})}});return w.jsx("div",{style:{display:"flex",flex:"0"},ref:O,children:y})},[s,n?.top,n?.height,n?.totalHeight]),B=u.useMemo(()=>{if(!_)return null;const y=l({orientation:q.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:T=>{E?.({left:T})}});return w.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[w.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${C}px)`},children:w.jsx("div",{ref:S,className:"sizer",children:y})}),p?h({width:C,height:k}):w.jsx(w.Fragment,{})]})},[l,n?.left,n?.width,n?.totalWidth,p,h,C,k]);return w.jsx("div",{style:{position:"relative",display:"flex",minWidth:p?`${C}px`:void 0,minHeight:_?`${k}px`:void 0,...c},...m,ref:P,children:w.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[w.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[w.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:t}),p?L:w.jsx(w.Fragment,{})]}),_?B:w.jsx(w.Fragment,{})]})})}));dn.displayName="ScrollPane";const ao=300,co=100,uo=1e6,ho=100,fo=50,Ot=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:r=0,minSize:i=0,endGap:a=ao,endScrollIncrement:h=co,style:l=Wt,onMouseDown:s,onScrollOffset:c,onScroll:d,scaleLimit:f=uo,scaleFactor:m=ho,precisionFactor:_=fo,createScrollbar:p=Pe,...E}=o;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const P=D(s,[s]),[g,x]=u.useState(!1),v=u.useMemo(()=>{const C=f===0?r:Math.min(r??0,Math.max(i??0,(t??0)+(n??0))+(a??0)),S=f!==0&&C>f?m:1,k=S/_,L=Math.ceil(C/S);return{offset:Math.ceil(t/S),totalSize:L,viewportSize:Math.ceil(n/S),scaledOffset:t,scaledTotalSize:r,scaledViewportSize:n,factor:S,precision:k}},[t,r,n,g,i,a,h]),R=D((C,S,k)=>{const L=v.offset;Math.abs(C-L)<v.precision&&(C=L),c?.(C*v.factor,L,v.viewportSize)},[c,v]),M=u.useCallback(C=>{},[]),j=u.useCallback(C=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",j),x(!1)},[]),O=u.useCallback(C=>{x(!0),P?.(C),document.addEventListener("mousemove",M,{passive:!0}),document.addEventListener("mouseup",j,{passive:!0})},[M,j]);return Pe({style:l,...E,offset:v.offset,totalSize:v.totalSize,viewportSize:v.viewportSize,onMouseDown:O,onScrollOffset:R},e)}));Ot.displayName="VirtualScrollbar",exports.Command=Xe,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=mt,exports.DefaultDynamicIconService=Te,exports.DefaultReactNotifier=Vt,exports.DynamicIcon=At,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=Tn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.InMemoryStore=Ge,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=X,exports.LocalStorageStore=class{constructor(o=window.localStorage){this.storage=o}async getItem(o){try{return this.storage.getItem(o)}catch{return null}}async setItem(o,e){try{this.storage.setItem(o,e)}catch{}}async removeItem(o){try{this.storage.removeItem(o)}catch{}}subscribe(o){const e=t=>{t.storageArea===this.storage&&t.key&&o(t.key)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}},exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:o,notifier:e})=>(u.useEffect(()=>{const t=I.Notifier.getOverrides();return I.Notifier.setOverrides(e),()=>{I.Notifier.setOverrides(t)}},[e]),u.createElement(Xt.Provider,{value:e},o)),exports.NotifierType=ct,exports.PersistenceStateProvider=function(o){const{store:e,namespace:t="",serializer:n=Qn,debounceMs:r=0,crossTabSync:i=!0,children:a}=o,h=u.useMemo(()=>typeof window>"u"?new Ge:e??new Ge,[e]),l=u.useRef(new Map),s=u.useMemo(()=>({store:h,namespace:t,serializer:n,debounceMs:r,crossTabSync:i,notify(c){const d=l.current.get(c);d&&d.forEach(f=>f())},subscribeKey(c,d){const f=l.current,m=f.get(c)??new Set;return m.add(d),f.set(c,m),()=>{const _=f.get(c);_&&(_.delete(d),_.size===0&&f.delete(c))}}}),[h,t,n,r,i]);return u.useEffect(()=>{if(s.crossTabSync&&s.store.subscribe)return s.store.subscribe(c=>{if(!c.startsWith(s.namespace+":"))return;const d=c.slice(s.namespace.length+1);s.notify(d)})},[s]),w.jsx(zt.Provider,{value:s,children:a})},exports.ReactErrorBoundary=({children:o})=>{const e=Me(),t=u.useCallback(n=>{e.showError(n)},[e]);return w.jsx(Vn,{onError:t,children:o})},exports.ReactUtils=Cn,exports.RoundedTab=Dn,exports.ScrollPane=dn,exports.ScrollUtils=lo,exports.Scrollbar=un,exports.ScrollbarOrientation=q,exports.SimpleCommand=He,exports.SplitPane=tn,exports.SplitPaneResizer=en,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:o})=>{const e=Me();return u.useEffect(()=>{const t=new Xn(e);return()=>{t.cleanup()}},[e]),w.jsx(w.Fragment,{children:o})},exports.VirtualScrollbar=Ot,exports.WalkingIcon=function(o){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:r=3,dashLength:i=5,iconKey:a,packKey:h,style:l,className:s,...c}=o,d=u.useMemo(()=>{if(!e)return;const m={"--walk-duration":`${n*(r+i)}ms`,"--walk-dash-length":`${i}px`,"--walk-dash-gap":`${r}px`};return t&&t!=="accent"&&(m["--icon-accent"]=`var(--icon-${t})`),m},[e,n,r,i,t]),f=u.useMemo(()=>e?s+" walking":s,[e,s]);return w.jsx(At,{iconKey:a,packKey:h,className:f,style:{...l,...d},...c})},exports.createDynamicIconService=nn,exports.defaultCreateScrollCorner=hn,exports.defaultCreateScrollEdgeButton=o=>{const{style:e,orientation:t=q.Vertical,...n}=o,r=t===q.Vertical,i=r?"rotate(90) ":"";return w.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${r?"vertical":"horizontal"} edge`,...n,children:w.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:i,children:w.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:o.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=an,exports.defaultCreateScrollStartButton=ln,exports.getDevicePixelRatio=function(o){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=o||{},r=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(r):r),t)},exports.toShortcutString=be,exports.useAnimatedMeasure=Yt,exports.useCallbackRef=D,exports.useCommand=function(o,e=null){const t=u.useRef(e);t.current=e;const[n,r]=u.useReducer(a=>a+1,0),i=u.useMemo(()=>Array.isArray(o)?o:[o],[o]);return u.useEffect(()=>{if(!i||i.length===0)return;const a=(s,c)=>{t.current?.onChange?.(c),r()};let h=null;e&&(h={onExecute(s,c){t.current?.onExecute?.(s,c)},onError(s,c,d){t.current?.onError?.(s,c,d)}});const l=new Set;for(let s=0;s<i.length;s++)l.add(i[s]?.addPropertyListener(I.CommonUtils.debounce(a,0),!0)),e&&l.add(i[s]?.addExecuteListener(h));return()=>{l.forEach(s=>{s?.()})}},[o]),n},exports.useCommands=function(o,e=null,t=null,n){const r=u.useRef(t);r.current=t,e&&!Array.isArray(e)&&(e=[e]);const[i,a]=u.useState(We(o,e)),h=n?[...n,o]:[o];return u.useEffect(()=>{const l={onGroupChange:()=>{const f=We(o,e);a(f),r.current?.onChange?.(this)}};let s;e&&e.length>0&&(s={keys:e},l.onCommandChange=(f,m)=>{r.current?.onChange?.(o),a(We(o,e))});const c=o?.addListener(l,s),d=We(o,e);return a(d),r.current?.onChange&&r.current?.onChange(o),()=>{c?.()}},h),i},exports.useCopyPaste=o=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:r,commands:i}=o,a=Me(),h=D(r,[r]),l=D(n,[n]),{getClipboard:s,refNativeCopy:c}=xt(),d=s();u.useMemo(()=>{const g=e?.element,x=t?.element??e?.element;if(!i)return;const v=[new He("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:[X.Ctrl]}}),new He("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:[X.Ctrl]}}),new He("paste",x,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste.yellow",shortcut:[{key:"V",modifiers:[X.Ctrl]},{key:"F8",modifiers:[X.Ctrl]}]})];i?.addCommands(v,!0)},[i]);const f=D(async g=>{if(!e?.element)return;let x=null;try{x=e.doCopy?.(g),typeof x=="string"?await d.writeText(x):await d.writeReference(x)}catch(v){throw v}},[e,a]),m=D(async g=>{const x=e?.element?.();if(x){c.current={sourceElement:x,args:g};try{await f(g)}catch(v){a.showError?.(v)}}},[e?.element,a]),_=u.useCallback(()=>{m({isCut:!0})},[]),p=D(async(g,x,v)=>{try{if(await g.doPaste(x,v)===!1)return;l?.(x,v)}catch(R){a.showError?.(R)}},[l]),E=D(async(g,x,v)=>{const R=t?.element?.();if(R&&await I.CommonUtils.whenFocus(R),!g&&!x)return;const M=await a.showBusy?.("Pasting...");if(x)try{return await p(t,x,v),void M?.()}catch(C){M?.(),a.showError?.(C)}let j,O=t.importFromExternal;O||(O=(C,S)=>({getItemType:()=>"text",toText:()=>g.text,isClipboardItem:!0}));try{j=await O(g,{isCut:!1})}catch(C){M?.(),a.showError?.(C)}if(j)try{const C=await Promise.resolve(j);await p(t,C,v),M?.()}catch(C){M?.(),a.showError?.(C)}else M?.()},[p,t,a]),P=D(async g=>{if(t?.element)try{const x=await d.readReference();if(x)return void await E(null,x,g);const v=[];v[0]=await I.ClipboardUtils.readStringFromClipboard(d,I.MimeType.plain),v[1]=await I.ClipboardUtils.readHTMLFromClipboard(d,I.MimeType.html),v[2]=await I.ClipboardUtils.readBlobFromClipboard(d,I.MimeType.png);const R={text:v[0]??null,html:v[1]??null,image:v[2]??null};await E(R,null,g)}catch(x){if(x?.message==="Document is not focused.")return;a.showError?.(x)}},[E,t?.element,a]);return D(async g=>{},[e?.element]),D(async g=>{},[t?.element,E,a]),u.useEffect(()=>{if(!d)return;const g=async R=>{const M=await d.readReference();h?.(M)},x=R=>{a.showMessage?.(I.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},v=R=>{a.showMessage?.(I.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",g),d.addEventListener("clipboarderrorread",x),d.addEventListener("clipboarderrorwrite",v),()=>{d.removeEventListener("clipboardchange",g),d.removeEventListener("clipboarderrorread",x),d.removeEventListener("clipboarderrorwrite",v)}},[d,a]),u.useEffect(()=>{},[f,E,e,t]),u.useEffect(()=>{i?.getCommand("cut")?.updateCallback(_).update({disabled:!e||!t}),i?.getCommand("copy")?.updateCallback(m).update({disabled:!e}),i?.getCommand("paste")?.updateCallback(P).update({disabled:!t})},[e,t,i]),{paste:P,copy:m,clipboard:d}},exports.useDevicePixelRatio=function(o){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 r=()=>{const i=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);i.addEventListener("change",r,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:i,listener:r}};return r(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[o]),e},exports.useEditMode=()=>{const o=Kn();return u.useMemo(()=>({setMode:e=>{Jt(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>o}),[o])},exports.useFullscreenPortal=qt,exports.useGlobalClipboard=xt,exports.useId=Wn,exports.useImperativeElement=Je,exports.useMouseDownAndHoldListener=function(o,e){return ut({onPointerDown:o,onPointerMoveOrWait:(t,n,r)=>{o?.(r)},...e})},exports.useNotifier=Me,exports.useOnClickOrFocusAway=function(o,e,t){const n=D(e,[e]);u.useEffect(()=>{const r=i=>{o.current&&!o.current.contains(i.target)&&n(i)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",r),document.addEventListener("touchstart",r)),t&&t.focusEvents===!1||document.addEventListener("focus",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r),document.removeEventListener("focus",r)}},[o])},exports.usePersistenceState=function(o,e,t=Jn){const{store:n,namespace:r,serializer:i,debounceMs:a,subscribeKey:h}=u.useContext(zt)||Zn,l=t.serializer??i??on,s=u.useMemo(()=>`${r}:${o}`,[r,o]),c=u.useRef(null),d=`${s}::v`,[f,m]=u.useState(()=>{let p;try{if(typeof window<"u"&&"localStorage"in window&&s.startsWith(r)){const E=window.localStorage?.getItem(s)??null;E!=null&&(p=l.parse(E))}}catch{}if(p===void 0){const E=e;return typeof E=="function"?E():E}return p});u.useEffect(()=>{let p=!0;return(async()=>{const[E,P]=await Promise.all([n.getItem(s),n.getItem(d)]);let g;try{g=E==null?void 0:l.parse(E)}catch{}const x=P==null?void 0:Number.parseInt(P,10);g===void 0?!t.lazy&&e!==void 0&&(g=typeof e=="function"?e():e,await n.setItem(s,l.stringify(g)),t.version!=null&&await n.setItem(d,String(t.version))):t.version!=null&&x!==void 0&&x!==t.version&&t.migrate&&(g=t.migrate(g,x),await n.setItem(s,l.stringify(g)),await n.setItem(d,String(t.version))),p&&g!==void 0&&m(g)})(),()=>{p=!1}},[n,s,d,t.version,t.migrate,t.lazy]),u.useEffect(()=>h(o,async()=>{const p=await n.getItem(s);if(p!=null)try{m(l.parse(p))}catch{}}),[n,s,h,o]);const _=async p=>{await n.setItem(s,l.stringify(p)),t.version!=null&&await n.setItem(d,String(t.version))};return[f,p=>{m(E=>{const P=typeof p=="function"?p(E):p;return c.current&&clearTimeout(c.current),a>0?c.current=setTimeout(()=>{_(P)},a):_(P),P})},()=>{if(c.current&&clearTimeout(c.current),n.removeItem(s),n.removeItem(d),e!==void 0){const p=typeof e=="function"?e():e;m(p)}else m(void 0)}]},exports.useSynchronizedPointerHandler=ut,exports.useTraceUpdate=function(o,e=!0){const t=u.useRef(o);u.useEffect(()=>{if(e){const n=Object.entries(o).reduce((r,[i,a])=>(t.current[i]!==a&&(r[i]=[t.current[i],a]),r),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=o})},exports.useUndoManager=({manager:o,commands:e,disabled:t})=>{const n=Me(),r=D(a=>{try{o?.undo(a)}catch(h){n.error(h)}},[o]),i=D(a=>{try{o?.redo(a)}catch(h){n.error(h)}},[o]);return u.useMemo(()=>{if(!e)return;const a={contains:l=>!0,focus(){}},h=[new Xe("undo",a,{label:"Undo",description:Ct,shortcut:{key:"z",modifiers:[X.Ctrl]},disabled:!0},r),new Xe("redo",a,{label:"Redo",description:Mt,shortcut:[{key:"y",modifiers:[X.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[X.Alt]}],disabled:!0},i)];e?.addCommands(h,!0)},[e]),u.useEffect(()=>{if(!e)return;const a=()=>{const l=o?.getTopUndoDescription(),s={};var c;e.getCommand("undo").update({disabled:t||!o||!o.hasUndo(),description:l?(c=l,`Undo ${c}`):Ct,state:s,context:{undoManager:o}});const d=o?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!o||!o.hasRedo(),description:d?Un(d):Mt,state:s,context:{undoManager:o}})};if(a(),!o)return;const h=o.addListener({onStackChange(){a()}});return()=>h?.()},[o,e,t]),{undo:r,redo:i}};
|
|
7
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("@sheetxl/utils"),u=require("react"),w=require("react/jsx-runtime"),_n=require("react-dom/client"),It=require("react-dom"),X={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"};class Xe{constructor(e,t,n,r){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=r,r===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 r=null;if(typeof n=="function"){const i=t??this._context;r=n(typeof i=="function"?i():i)}else r=n;return r}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 r=this._callback.bind(this)(e,this);if(await Promise.resolve(r)===!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(r=>{r.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(r=>{let i=e[r];n["_"+r]!==i&&(n["_"+r]=t[r]=i)}),t}}class He extends Xe{}var Q=typeof window<"u"?window:{screen:{},navigator:{}},xe=(Q.matchMedia||function(){return{matches:!1}}).bind(Q),$t=!1,gn={get passive(){return $t=!0}},vt=function(){};Q.addEventListener&&Q.addEventListener("p",vt,gn),Q.removeEventListener&&Q.removeEventListener("p",vt,!1);var yn=$t,vn="PointerEvent"in Q,pt="ontouchstart"in Q,Kt=pt||"TouchEvent"in Q&&xe("(any-pointer: coarse)").matches,bt=(Q.navigator.maxTouchPoints||0)>0||Kt,Nt=Q.navigator.userAgent||"",bn=xe("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Nt)&&Math.min(Q.screen.width||0,Q.screen.height||0)>=768,Ht=(xe("(pointer: coarse)").matches||!xe("(pointer: fine)").matches&&pt)&&!/Windows.*Firefox/.test(Nt),wn=xe("(any-pointer: fine)").matches||xe("(any-hover: hover)").matches||bn||!pt,at=!bt||!wn&&Ht?bt?"touchOnly":"mouseOnly":"hybrid",xn=at==="mouseOnly"?"mouse":at==="touchOnly"||Ht?"touch":"mouse";const Sn=Object.freeze(Object.defineProperty({__proto__:null,deviceType:at,primaryInput:xn,supportsPassiveEvents:yn,supportsPointerEvents:vn,supportsTouchEvents:Kt},Symbol.toStringTag,{value:"Module"})),En=new Set(["INPUT","TEXTAREA","SELECT"]),Wt={};function ke(){return Sn}const Ft=o=>o==="BracketLeft"?"[":o==="BracketRight"?"]":I.CommonUtils.camelToPrettyCase(o),Ye=(o,e)=>{let t=!1,n=!1;const r={nativeEvent:o,currentTarget:e||o.currentTarget,target:o.target,bubbles:o.bubbles,cancelable:o.cancelable,defaultPrevented:o.defaultPrevented,eventPhase:o.eventPhase,isTrusted:o.isTrusted,preventDefault:()=>{t=!0,o.preventDefault()},isDefaultPrevented:()=>t,stopPropagation:()=>{n=!0,o.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:o.timeStamp,type:o.type};for(const i in o)i in r||typeof o[i]=="function"||(r[i]=o[i]);return r},Cn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Wt,boundPixel:function(o,e=!1,t=0){return o},createSyntheticEvent:Ye,detectIt:ke,focusableNodeNames:En,toPrettyKeyCode:Ft},Symbol.toStringTag,{value:"Module"}));class mt{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=I.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=(r,i)=>{const a=n._root._listenersByKey,h=i.key(),l=a.get(h);l&&n._notifyCommands(l,"onCommandChange",i)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let r=n,i=n===this;for(;!i&&r;)r===this&&(i=!0),r=r._parent;return(i?n:this)._getCommand(e)}createChildGroup(e,t,n){let r;if(!n){let h=this;for(;h&&!r;){let l=h._nodes.get(t);l&&(r=l),h=h._parent}}r||(r=new mt(e,t),r._parent=this,r._root=this._root,r._unListenersByCommand=null,r._listenersByKey=null,r._commandsPropertyListener=null);const i=(h,l)=>{!h.has(t)||n?h.set(t,l):n===void 0&&console.warn("commandGroup already registered",t)};i(this._root._nodes,r);let a=this._parent;for(;a;)i(this._nodes,r),a=a._parent;return this._children.set(t,r),this._notify("onGroupChange"),r}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,r=this._commandsByShortcut,i=this._root._commandsPropertyListener,a=this._root._unListenersByCommand;for(let h=0;h<e.length;h++){const l=e[h],s=l.key();if(n.has(s)&&!t){t===void 0&&console.warn("command already registered",s);continue}n.set(s,l);let c=a.get(l);c&&(c(),a.delete(l));const d=l.addPropertyListener(i);a.set(l,d);const f=l.shortcut();if(!f)continue;const m=Array.isArray(f)?f:[f];for(let _=0;_<m.length;_++){const p=be(m[_]),E=r.get(p);E&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${p}, ${s}, ${E}.`),r.set(p,s)}}}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 r=i=>{i._children.forEach(a=>{for(let h=0;h<t.length;h++)a._nodes.delete(t[h]);r(a)})};r(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(X.Alt),e.shiftKey&&t.push(X.Shift),e.ctrlKey&&t.push(X.Ctrl),e.metaKey&&t.push(X.Meta);let n=be({key:e.code,modifiers:t});const r=this._commandsByShortcut;let i=r.get(n);i||(n=be({key:e.key,modifiers:t}),i=r.get(n)),!i&&e.code.startsWith("Digit")&&(n=be({key:e.code.substring(5,e.code.length),modifiers:t}),i=this._commandsByShortcut.get(n)),!i&&e.code.startsWith("Key")&&(i=be({key:e.code.substring(3,e.code.length),modifiers:t}),i=r.get(n));let a=null;return i&&(a=this._commandsByKey.get(i),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,r=t?.keys,i=this._root._listenersByKey;if(r&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let a=null;if(r)for(let h=0;h<r.length;h++){const l=r[h];if(!l)continue;let s=i.get(l);s||(s=new Set,i.set(l,s)),a||(a=[]),a.push(s),s.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 r=this;setTimeout(()=>{e.forEach(i=>{i[t]?.(r,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(r=>{r[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 Mn=I.CommonUtils.getOS()===I.CommonUtils.OSType.MacOS||I.CommonUtils.getOS()===I.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Ln=I.CommonUtils.getOS()===I.CommonUtils.OSType.MacOS||I.CommonUtils.getOS()===I.CommonUtils.OSType.IOS?"⌘":"^",be=(o,e=!1)=>{const t={};for(let r=0;o.modifiers&&r<o.modifiers.length;r++)t[o.modifiers[r]]=!0;let n="";return(t?.[X.Ctrl]||t?.[X.Meta])&&(n+=(n.length>0?"+":"")+(e?Ln:Mn)),t?.[X.Alt]&&(n+=e?"⌥":"Alt"),t?.[X.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+Ft(o.key),n},We=(o,e)=>{if(!e||!o||e.length===0)return I.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let r=0;r<t;r++){const i=e[r],a=i?o.getCommand(i):null;n[r]=a}return n};function rt(o,e){if(typeof o=="function")return o(e);o&&(o.current=e)}var Se=parseInt(u.version.split(".")[0],10)>=19?function(o){return e=>{const t=[];for(const n of o){const r=rt(n,e),i=typeof r=="function";t.push(i?r:()=>rt(n,null))}return()=>{for(const n of t)n()}}}:function(o){return e=>{for(const t of o)rt(t,e)}};const Tn=u.memo(u.forwardRef((o,e)=>{const{refFocusStart:t,...n}=o,r=u.useRef(null),i=u.useCallback(()=>{if(t)return void t?.current?.focus();const a=r.current.parentElement.children;let h=[];const l=a.length;for(let s=0;s<l&&a[s]!==r.current;s++){const c=a[s],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(s,c){return s.tabindex-c.tabindex}),h[0].child.focus())},[t]);return w.jsx("div",{tabIndex:0,ref:Se([r,e]),onFocus:i,...n})}));var kn=function(){},Ut=typeof window<"u",Pn=Ut?u.useLayoutEffect:u.useEffect,wt={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const pe=Ut&&window.ResizeObserver!==void 0?function(){var o=u.useState(null),e=o[0],t=o[1],n=u.useState(wt),r=n[0],i=n[1],a=u.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var l=h[0].contentRect,s=l.x,c=l.y,d=l.width,f=l.height,m=l.top,_=l.left,p=l.bottom,E=l.right;i({x:s,y:c,width:d,height:f,top:m,left:_,bottom:p,right:E})}})},[]);return Pn(function(){if(e)return a.observe(e),function(){a.disconnect()}},[e]),[t,r]}:function(){return[kn,wt]},Dn=u.memo(u.forwardRef((o,e)=>{const{className:t,style:n,children:r,radius:i=4,strokeWidth:a=1,strokeColor:h="grey",...l}=o,[s,{width:c,height:d}]=pe(),f=u.useRef(null),m=(P,g=0)=>{const x=P/2,v=d-x+g;return(function(R,M,j=!1){if(M===0)return R;function O(y,T,$){let K=T.x-y.x,V=T.y-y.y,A=Math.sqrt(K*K+V*V);return C(y,T,Math.min(1,$/A))}function C(y,T,$){return{x:y.x+(T.x-y.x)*$,y:y.y+(T.y-y.y)*$}}function S(y,T){y.length>2&&(y[y.length-2]=T.x,y[y.length-1]=T.y)}function k(y){return{x:parseFloat(y[y.length-2]),y:parseFloat(y[y.length-1])}}let L=R.split(/[,\s]/).reduce(function(y,T){let $=T.match("([a-zA-Z])(.+)");return $?(y.push($[1]),y.push($[2])):y.push(T),y},[]).reduce(function(y,T){return parseFloat(T)==T&&y.length?y[y.length-1].push(T):y.push([T]),y},[]),B=[];if(L.length>1){let y=k(L[0]),T=null;L[L.length-1][0]==="Z"&&L[0].length>2&&(T=["L",y.x,y.y],L[L.length-1]=T),B.push(L[0]);for(let $=1;$<L.length;$++){let K=B[B.length-1],V=L[$],A=V===T?L[1]:L[$+1];if(A&&K&&K.length>2&&V[0]==="L"&&A.length>2&&A[0]==="L"){let W,N,U=k(K),G=k(V),me=k(A);j?(W=C(G,K.origPoint||U,M),N=C(G,A.origPoint||me,M)):(W=O(G,U,M),N=O(G,me,M)),S(V,W),V.origPoint=G,B.push(V);let ae=C(W,G,.5),_e=C(G,N,.5),ce=["C",ae.x,ae.y,_e.x,_e.y,N.x,N.y];ce.origPoint=G,B.push(ce)}else B.push(V)}if(T){let $=k(B[B.length-1]);B.push(["Z"]),S(B[0],$)}}else B=L;return B.reduce(function(y,T){return y+T.join(" ")+" "},"")})(`${`M 0 ${x} L ${i-.5} ${x} L ${i-.5} ${v} L ${2*i} ${v}`} ${`L ${c-2*i} ${v}`} ${`M ${c-2*i} ${v} L ${c-i} ${v} L ${c-i} ${x} L ${c} ${x}`}`,i)},_=u.useMemo(()=>m(a),[c,d,i,a]),p=u.useMemo(()=>{if(i===0)return;const P=i/2;return m(i)+`L ${c} 0 L 0 0 L 0 ${P}`},[_,i,a]),E=u.useMemo(()=>({style:{clipPath:`path('${p}')`}}),[p]);return w.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...l,ref:Se([f,s,e]),children:[u.isValidElement(r)?u.cloneElement(r,E):w.jsx(w.Fragment,{}),w.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:c,height:d,viewBox:`0 0 ${c} ${d}`,children:w.jsx("path",{d:_,stroke:h,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:a})})]})})),ct={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Vt extends I.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!==ct.Warning?t?.type!==ct.Error?I.Notifier.log(e):I.Notifier.error(e):I.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(r=>{r(()=>{})})}showWindow(e,t){const n=this.getDelegate();if(n?.showWindow)return n.showWindow(e,t)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):I.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInput(e){const t=this.getDelegate();return t?.showInput?t.showInput(e):Promise.resolve({input:"",option:""})}}const An=new Vt,Xt=u.createContext(An),Me=()=>u.useContext(Xt),zn=3,Rn=.5,jn=50,it=o=>({x:o.x,y:o.y,width:o.width,height:o.height,top:o.top,left:o.left,right:o.right,bottom:o.bottom});function Yt(o={}){const{threshold:e=Rn,stillnessThreshold:t=zn,maxHierarchyDepth:n=jn}=o,[r,i]=pe(),a=u.useRef(null),[h,l]=u.useReducer(_=>_+1,0),s=u.useRef(void 0),c=u.useRef({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0}),d=u.useCallback(_=>{a.current=_,typeof r=="function"&&r(_)},[r]),[f,m]=u.useState(i);return u.useEffect(()=>{i&&!f&&m(i)},[i,f]),u.useEffect(()=>{const _=a.current;if(!_)return;let p=!1,E=0;const P=()=>{if(!_)return;const M=_.getBoundingClientRect(),j=c.current;Math.abs(M.x-j.x)>e||Math.abs(M.y-j.y)>e||Math.abs(M.width-j.width)>e||Math.abs(M.height-j.height)>e?(p||(p=!0,m(it(M)),l()),E=0):E++,p&&E>=t&&(p=!1,m(it(M)),l()),c.current=it(M),s.current=requestAnimationFrame(P)};s.current=requestAnimationFrame(P);const g=M=>{p=!0,l()},x=M=>{p=!1,E=t,l()};let v=_;const R=[];for(;v&&v!==document.documentElement&&(v.addEventListener("animationstart",g,!0),v.addEventListener("animationend",x,!0),v.addEventListener("transitionstart",g,!0),v.addEventListener("transitionend",x,!0),R.push(v),v=v.parentElement,!(R.length>n)););return()=>{s.current&&cancelAnimationFrame(s.current),R.forEach(M=>{M.removeEventListener("animationstart",g,!0),M.removeEventListener("animationend",x,!0),M.removeEventListener("transitionstart",g,!0),M.removeEventListener("transitionend",x,!0)})}},[h,i,e,t,n]),[d,f]}const D=(o,e)=>{const t=u.useCallback((...i)=>o?.(...i),e),n=u.useRef(null);n.current=t;const r=u.useCallback((...i)=>n.current?.(...i),[]);if(n.current)return r};let Fe=0;function qt(){const[o,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 r=document.fullscreenElement;if(e(!!r),!r)return;let i=r.querySelector(".fullscreen-portal-root");i||(i=document.createElement("div"),i.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",r.appendChild(i))}return Fe++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Fe--,Fe<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)}),Fe=0)}},[]),{getPortalContainer:t,isFullscreen:o}}function ut(o){if(!o)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:r=!1,consumeTouch:i=!0}=o,a=D(e,[e]),h=D(t,[t]),l=D(n,[n]),s=u.useRef(!1),c=o?.timerInitial??230,d=o?.timerContinuous??c/2,f=u.useRef(null),m=u.useRef(null),_=u.useRef(null),p=u.useRef(null),E=u.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]),P=u.useCallback(S=>{p.current=setTimeout(()=>{window.requestAnimationFrame(()=>{if(s.current===!1)return;const k=m.current,L=f.current,B=Ye(k,L.currentTarget);l?.(B,_.current,L)}),P(d)},S??c)},[]);u.useEffect(()=>()=>E(),[]);const g=r?"pointer":"mouse",x=u.useCallback(S=>{S.stopPropagation(),S.stopImmediatePropagation(),S.preventDefault()},[]),v=D(S=>{document.removeEventListener(`${g}move`,j),document.removeEventListener(`${g}up`,v),document.removeEventListener("keydown",O),document.removeEventListener("keyup",C),document.removeEventListener("touchstart",x,{capture:!0}),document.removeEventListener("touchmove",x,{capture:!0}),window.removeEventListener("blur",R),E(),window.requestAnimationFrame(()=>{if(s.current===!1)return;s.current=!1;const k=S,L=f.current,B=Ye(k,L.currentTarget);h?.(B,_.current,L),_.current=null})},[]),R=u.useCallback(()=>{s.current!==!1&&(s.current=!1,v(m.current))},[]),M=D(()=>{E(),P(d),window.requestAnimationFrame(()=>{if(s.current===!1)return;const S=m.current,k=f.current,L=Ye(S,k.currentTarget);l?.(L,_.current,k)})},[d]),j=D(S=>{m.current=S,M()},[]),O=D(S=>{_.current={ctrlKey:S.ctrlKey,shiftKey:S.shiftKey,altKey:S.altKey,metaKey:S.metaKey},M()},[]),C=D(S=>{_.current={ctrlKey:S.ctrlKey,shiftKey:S.shiftKey,altKey:S.altKey,metaKey:S.metaKey},M()},[d]);return D(S=>{S.isDefaultPrevented()||(_.current={ctrlKey:S.ctrlKey,shiftKey:S.shiftKey,altKey:S.altKey,metaKey:S.metaKey},a(S,_.current)!==!1&&(f.current=S,m.current=S.nativeEvent,document.addEventListener(`${g}up`,v,{passive:!1}),document.addEventListener(`${g}move`,j,{passive:!1}),document.addEventListener("keydown",O,{passive:!1}),document.addEventListener("keyup",C,{passive:!1}),window.addEventListener("blur",R,{passive:!0}),r&&i&&(document.addEventListener("touchstart",x,{passive:!1,capture:!0}),document.addEventListener("touchmove",x,{passive:!1,capture:!0})),s.current=!0,P(c)))},[c,r])}const Bn=({initValue:o,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(o);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const r=e();return u.useLayoutEffect(()=>{n.current!==r&&(n.current=r,t(r))},[t,r]),null},ht=o=>{console&&console.warn&&console.warn(o)},st=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let On=1,dt=!1,Gt=!1;const qe=[],we=[],Ze=()=>{we.forEach(o=>o())},In=({automaticContainerInternalUseOnly:o})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,o||dt!==!1||(Gt=!0),u.useEffect(()=>{let r=!0;function i(){if(r)return we[0]!==i?(o||dt!==!0||ht("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([...qe])}return we.push(i),Ze(),()=>{r=!1,n.current?.length>0&&ht("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),we.splice(we.indexOf(i),1),Ze()}},[o]),w.jsx(w.Fragment,{children:e.map(({hook:r,key:i})=>u.createElement(Bn,{...r,key:i}))})},$n=o=>{const e=On++;return qe.push({hook:o,key:e}),we.length===0&&Gt===!1&&(dt=!0,(t=>{if(st.document&&st.document.createElement){const n=st.document.createElement("div");_n.createRoot(n).render(w.jsx(t,{automaticContainerInternalUseOnly:!0}))}else ht("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(In)),Ze(),()=>{qe.splice(qe.findIndex(t=>t.key===e),1),Ze()}};let ft=null;ft||(ft=(o,e,t={})=>{let n,r,i=!1,a=!1,h=[],{unmountIfNoConsumers:l=!1}=t;const s=d=>{var f;r=d,f=()=>h.forEach(m=>m(d)),It.unstable_batchedUpdates(f)},c=()=>(a||(r=typeof o=="function"?o():o,a=!0),r);return()=>{const[d,f]=u.useState(c);return u.useEffect(()=>(i||(i=!0,n=$n({initValue:o,useHookBody:e,applyStateChange:s})),h.push(f),r!==d&&f(r),()=>{h.splice(h.indexOf(f),1),h.length===0&&l&&(n(),i=!1)}),[]),d}});const Zt=ft;let Jt=()=>{console.warn("You must call useEditMode before setting its state.")};const Kn=Zt(null,()=>{const[o,e]=u.useState(null);return Jt=e,o}),xt=Zt({setClipboard:o=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>I.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[o,e]=u.useState(I.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>o,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let lt=!1,Nn=0;var Hn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const St=()=>"sheetxl-ui-"+Nn++,Et=u.useId,Wn=Et??function(){const[o,e]=u.useState(()=>lt?St():void 0);return Hn(()=>{o==null&&e(St())},[]),u.useEffect(()=>{lt||(lt=!0)},[]),o},Fn=[];function Je(o,e,t=Fn){const n=u.useRef(null);return u.useImperativeHandle(o,()=>{if(!n.current)return;const r=n.current,i=e?.();if(!i||typeof i!="object")throw new Error("attributes must return a plain object of values");const a=Object.keys(i),h=a.length;for(let l=0;l<h;l++){const s=a[l],c=i[s];Object.defineProperty(r,s,{value:c,writable:!0,configurable:!0,enumerable:!0})}return r},t),n}const Ct="Undo the last action.",Mt="Repeat the last action or undo the redo.",Un=o=>`Redo ${o}`;class Vn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class Xn{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)}}function Qt(o){var e,t,n="";if(typeof o=="string"||typeof o=="number")n+=o;else if(typeof o=="object")if(Array.isArray(o)){var r=o.length;for(e=0;e<r;e++)o[e]&&(t=Qt(o[e]))&&(n&&(n+=" "),n+=t)}else for(t in o)o[t]&&(n&&(n+=" "),n+=t);return n}function oe(){for(var o,e,t=0,n="",r=arguments.length;t<r;t++)(o=arguments[t])&&(e=Qt(o))&&(n&&(n+=" "),n+=e);return n}const Yn={},en=o=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:r=0,paddingAfter:i=0,disabled:a,key:h,hitAreaProps:l=Yn,...s}=o,c=n==="row",{style:d,className:f,...m}=l;return w.jsx("div",{style:{...t,position:"relative"},...s,children:w.jsx("div",{className:oe("hit-box",f),style:{left:(c?-r:0)+"px",width:`calc(100% + ${c?r+i:0}px)`,top:(c?0:-r)+"px",height:`calc(100% + ${c?0:r+i}px)`,position:"absolute",...d},onPointerDown:a?void 0:e,...m})},h)},Ue={},de=(o,e,t=!0)=>o===null?null:o.pixels!==null?t?o.pixels:e-o.pixels:(t?o.percent:100-o.percent)/100*e,Ve=(o,e=!0)=>o?.percent?`${e?o.percent:100-o.percent}%`:o?.pixels?`${o.pixels}px`:void 0,se=(o,e)=>{if(o==null)return null;const t={percent:null,pixels:null};let n=e;return typeof o=="string"&&((o=o.trim().toLowerCase()).endsWith("px")?(o=o.substring(0,o.length-2),n=!1):o.endsWith("%")&&(o=o.substring(0,o.length-1),n=!0),o=parseFloat(o)),n?t.percent=o:t.pixels=o,Object.freeze(t)},tn=u.memo(u.forwardRef((o,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:r="row",fixedPane:i=null,position:a,onPositionChange:h,minBefore:l,maxBefore:s,minAfter:c,maxAfter:d,children:f,className:m,style:_,disabled:p=!1,onDragStart:E,onDragResize:P,onDragFinish:g,resizerProps:x=Ue,paneProps:v=Ue,paneBeforeProps:R=Ue,paneAfterProps:M=Ue,createResizer:j=en}=o;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const O=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),C=u.useMemo(()=>{let z=null;i&&(i==="before"?z=0:i==="after"&&(z=1));const F=z===null;return{fixedPaneOffset:z,isPercent:F,minBefore:se(l,F),maxBefore:se(s,F),minAfter:se(c,F),maxAfter:se(d,F)}},[l,s,c,d]),S=D(h,[h]),[k,L]=u.useState(()=>se(a,i===null));u.useEffect(()=>{L(se(a,i===null))},[a,i]);const[B,{width:y,height:T}]=pe(),[$,{width:K,height:V}]=pe(),A=r==="row"?K:V,W=r==="row"?y:T,N=u.useMemo(()=>((z,F,J,Y)=>{const re=[null,null],ne=[null,null];if(z||(z={percent:Y.fixedPaneOffset===null?50:null,pixels:Y.fixedPaneOffset===null?null:0}),F===0)return z?.pixels!=null?Y.fixedPaneOffset!==1?(re[0]=z?.pixels,ne[1]=100):(re[1]=z?.pixels-J,ne[0]=100):z?.percent!=null&&(Y.fixedPaneOffset!==1?(ne[0]=z?.percent,ne[1]=100-z?.percent):(ne[1]=z?.percent,ne[0]=100-z?.percent)),{percents:ne,pixels:re,minBefore:Ve(Y.minBefore,!0),maxBefore:Ve(Y.maxBefore,!0),minAfter:Ve(Y.minAfter),maxAfter:Ve(Y.maxAfter)};let ie=de(z,F,Y.fixedPaneOffset!==1),ee=F-J,_t=de(Y.minBefore,ee,!0)??0,pn=de(Y.maxBefore,ee,!0)??ee,Ne=0,ot=0,gt=0,yt=ee;Ne=(de(Y.maxAfter,F,!1)??J)-J,ot=de(Y.minAfter,F,!1)??F,gt=Math.max(_t,Ne),yt=Math.min(pn,ot),ie=Math.max(gt,Math.min(ie,yt)),ot=Math.min(ee-ie,de(Y.maxAfter,ee-ie,!0)??ee),Ne=Math.min(ee-ie,de(Y.minAfter,ee-ie,!0)??ee),re[0]=ie,re[1]=ee-re[0];const mn=Math.max(0,Math.min(100,ie/ee*100));return ne[0]=mn,ne[1]=100-ne[0],{percents:ne,pixels:re,minBefore:`${_t}px`,minAfter:`${Ne}px`,maxBefore:`${re[0]}px`,maxAfter:`${re[1]}px`}})(k,W,A,C),[C,k,W,A,r]),[U,G]=u.useState(!1),me=D(E,[E]),ae=D(P,[P]),_e=D(g,[g]),ce=u.useRef(null),Qe=u.useRef(null),De=u.useRef(null),{style:et,className:Ae,...ze}=v,Re={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...et},{className:tt,style:je,...Be}=R,{className:Oe,style:Ie,...ge}=M,Ee={flex:"1 1 100%",width:"100%",..._,flexDirection:r,display:"flex"},{className:te,style:ye,onPointerDown:$e,...Ke}=x,Ce=D(z=>{const F=se(z,i===null);L(F)},[i]),b=D(z=>{if(p||!U)return;const F=ue.current?.getBoundingClientRect();let J=0;J=r==="row"?(z.clientX??z.touches?.[0]?.clientX)-F.x:(z.clientY??z.touches?.[0]?.clientY)-F.y,J=Math.max(0,Math.min(W,J)),C.fixedPaneOffset===1&&(J=W-J),a&&k.pixels===J||L({pixels:J,percent:null}),ae?.(J),z.stopPropagation(),z.preventDefault()},[C,r,p,U,k,W]),H=D(z=>{if(document.removeEventListener("pointermove",b),document.removeEventListener("touchmove",b),document.removeEventListener("pointerup",H),!!U&&(G(!1),!!k)){if(_e(k.pixels),!se(a,i===null)||k.pixels!==a){const F={...k};F.percent===null&&(F.percent=F.pixels/W*100),S(F)}z.stopPropagation(),z.preventDefault()}},[k,U,a,i,W]),Z=D(z=>{$e?.(z),z.defaultPrevented||p||U||(G(!0),me(),document.addEventListener("pointermove",b,{passive:!1}),document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("pointerup",H,{passive:!1}))},[$e]),ue=Je(e,()=>({setPosition:Ce,isSplitPane:()=>!0}),[]),ve=u.useMemo(()=>O?j?.({key:"resizer",ref:Se([$,Qe]),className:oe("resizer",te),onPointerDownCapture:Z,style:{cursor:p?void 0:r==="row"?"ew-resize":"ns-resize",minWidth:r==="row"?"2px":void 0,minHeight:r!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...ye},splitDirection:r,disabled:p,...Ke}):null,[O,te,Ke,r,ye,p]),he=r==="row"?"Width":"Height",nt=u.useMemo(()=>{if(!t)return null;const z={...Re,...je,flex:C.fixedPaneOffset===0&&N?.pixels[0]!==null?`0 0 ${Math.round(N?.pixels[0])}px`:`1 1 ${Math.round(N?.percents[0]??100)}%`,[`min${he}`]:N?.minBefore,[`max${he}`]:n?N?.maxBefore:"100%"};return w.jsx("div",{ref:ce,className:oe("before",Ae,tt),style:z,...ze,...Be,children:t},"before")},[t,v,R,C,N]),fn=u.useMemo(()=>{if(!n)return null;const z={...Re,...Ie,flex:C.fixedPaneOffset===1&&N?.pixels[1]!==null?`0 0 ${Math.round(N?.pixels[1])}px`:`1 1 ${Math.round(N?.percents[1]??100)}%`,[`min${he}`]:N?.minAfter,[`max${he}`]:t?N?.maxAfter:"100%"};return w.jsx("div",{ref:De,className:oe("after",Ae,Oe),style:z,...ze,...ge,children:n},"after")},[n,v,M,C,N]);return w.jsxs("div",{ref:Se([B,ue]),className:oe("splitPane",r==="row"?"vertical":"horizontal",{dragging:U},m),style:Ee,children:[nt,ve,fn]})}));function qn(o){if(typeof o=="function")return o;if(typeof o=="string"){const e=o.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const r=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!r)return null;const i=r[1]||"",a=r[2]||"";try{if(/;base64/i.test(i)){if(typeof atob<"u"){const h=atob(a),l=h.length;if(typeof TextDecoder<"u"){const c=new Uint8Array(l);for(let d=0;d<l;d++)c[d]=h.charCodeAt(d);return new TextDecoder("utf-8").decode(c)}let s="";for(let c=0;c<l;c++)s+=`%${h.charCodeAt(c).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 kt(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return kt(e);if(/^<\s*path\b/i.test(e)){const t=Lt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(o)){const e=[];for(const t of o)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const r=Lt(n);r&&e.push({d:r})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return o}function Lt(o){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);return e?e[1]??e[2]??null:null}function Tt(o){if("svg"in o)return{...o,svg:qn(o.svg)};if("url"in o){const e=typeof o.url=="string"?{src:o.url}:o.url;return{...o,url:e}}if("emoji"in o){const e=typeof o.emoji=="string"?o.emoji:o.emoji.text;return{...o,emoji:e}}return o}function kt(o){try{if(typeof DOMParser<"u"){const a=new DOMParser().parseFromString(o,"image/svg+xml"),h=a.querySelector("svg"),l=h?.getAttribute("viewBox")??void 0,s=[];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 _=c.getAttribute("fill");_&&_!=="none"&&(f.fill=_);const p=c.getAttribute("stroke");p&&(f.stroke=p);const E=c.getAttribute("opacity");E&&(f.opacity=Number(E));const P=c.getAttribute("fill-rule");P&&(f.fillRule=P);const g=c.getAttribute("clip-rule");g&&(f.clipRule=g),s.push(f)}),{viewBox:l,paths:s}}}catch{}const e=o.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],r=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let i;for(;i=r.exec(o);)n.push({d:i[1]});return{viewBox:t,paths:n}}function Pt(o){const e={};for(const[i,a]of Object.entries(o.icons))e[i]=Tt(a);const t={label:o.meta?.label??"Unnamed",version:o.meta?.version??"1.0.0",license:o.meta?.license??"MIT",defaultViewBox:"0 0 24 24",extends:o.meta?.extends??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},r=o.overrides;if(r){const i={};for(const[a,h]of Object.entries(r)){const l={};for(const[s,c]of Object.entries(h))l[s]=Tt(c);i[a]=l}n.__overrides=i}return n}function nn(){const o=new Map,e=new Map;let t="base",n=new Map;async function r(l){const s=o.get(l??t);if(!s)throw new Error(`Icon pack not registered: ${l}`);if(!s.pack){if(!s.loading){if(!s.loader)throw new Error(`No loader for icon pack: ${l}`);s.loading=s.loader().then(c=>{const d=c&&typeof c=="object"&&"default"in c?c.default:c;s.pack=Pt(d)}).catch(c=>{throw s.loading=void 0,c})}await s.loading}}function i(l){const s=l.indexOf(":");return s>0?{ns:l.slice(0,s),key:l.slice(s+1)}:{key:l}}function a(l,s){const c=[l,...o.get(l)?.pack?.meta.extends??[]];for(const d of c){const f=o.get(d);if(!f?.pack)continue;const{icons:m}=f.pack,_=m[e.get(d)?.get(s)??s]??m[s];if(_)return{glyph:_,pack:f.pack,packKey:d}}return null}function h(l,s){const c=s?.packKey??t;if(s?.packKey)return a(s.packKey,l);if(!l)return null;const{ns:d,key:f}=i(l);if(d){const m=o.get(d)?.pack;if(m){if(o.get(t)?.pack){const p=m.__overrides,E=p?.[t]?.[f];if(E)return{glyph:E,pack:m,packKey:d}}const _=a(d,f);if(_)return _}return null}return a(c,l)}return{register:function(l,s){const c=o.get(l)??{};typeof s=="function"?c.loader=s:c.pack=Pt(s),o.set(l,c),t||(t=l)},prefetch:async function(l=t){const s=Array.isArray(l)?l:[l];await Promise.all(s.map(r))},setActive:function(l){t=l;for(const s of n.keys())try{s(l)}catch{}},getActive:function(){return t},resolve:async function(l,s){let c=h(l,s);if(c)return c;const d=s?.packKey??t,{ns:f}=i(l);if(s?.packKey){if(await r(d),c=h(l,s),c)return c;const m=o.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}else if(f){if(await r(f),c=h(l,s),c)return c;const m=o.get(f)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}else{if(await r(d),c=h(l,s),c)return c;const m=o.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}return null},registerAlias:function(l,s,c){e.has(l)||e.set(l,new Map),e.get(l).set(s,c)},has:function(l,s){return!!h(l,s)},getPack:function(l){return o.get(l??t)?.pack},hasPack:function(l){return!!o.get(l)?.pack},listPacks:function(){return Array.from(o.keys())},listIcons:function(l){const s=o.get(l)?.pack;return s?Object.keys(s.icons):[]},addActiveListener:function(l){const s=n.get(l);if(s)return s;const c=()=>{n.delete(l)};return n.set(l,c),c}}}tn.displayName="SplitPane";const Te=nn();Te.register("base",()=>Promise.resolve().then(()=>require("./BfVchbirCkmA3HCq.cjs")));const Dt=o=>w.jsx("svg",{...o,children:w.jsx("path",{})}),Gn={Icon:"_Icon_17dpm_10"},At=u.memo(o=>{const{iconKey:e,packKey:t,className:n,style:r,role:i,title:a,size:h,ariaHidden:l,sourceProps:s,children:c,...d}=o,[f,m]=u.useState(null);u.useEffect(()=>{let L=!0,B=t,y=e;if(!y){const T=Te.getPack(B);return void m({glyph:T?{svg:I.CommonUtils.EmptyArray}:void 0,pack:T??void 0,packKey:B??Te.getActive()})}if(y.includes(":")){const[T,$]=y.split(":");B=T,y=$}return Te.resolve(y,{packKey:B}).then(T=>{L&&m(T)}),()=>{L=!1}},[e,t]);const _=f?.pack,p=f?.glyph,E=f?.packKey;let P=p?p.svg:void 0;const g=p&&!P?p.url:void 0,x=!p||P||g?void 0:p.emoji,v=h!=null?typeof h=="number"?`${h}px`:h:void 0,R=u.useMemo(()=>[Gn.Icon,"icon",n].filter(Boolean).join(" "),[n]),M=u.useMemo(()=>{const L={...r};return L["--icon-size"]=v,L},[r,v]),j=i??(a?"img":"presentation"),O=l??(!a||void 0),C=L=>w.jsx("span",{className:R,style:M,role:j,"aria-hidden":O,title:a,"data-icon-glyph":e,"data-icon-pack":E,...d,children:L});if(c)return C(c);if(x)return C(w.jsx("span",{children:typeof x=="string"?x:x.text}));if(g)return C(w.jsx("img",{src:g.src,alt:a??""}));if(p&&"react"in p){const L=p.react,B={className:R,style:M,role:j,"aria-hidden":O,title:a,...d,...s};return C(w.jsx(L,{...B}))}const S={viewBox:P?.viewBox??_?.meta.defaultViewBox??"0 0 24 24"};if(typeof P=="function")return C(P(S)??w.jsx(Dt,{...S}));if(!P)return C(w.jsx(Dt,{...S}));const k=P.paths;return C(w.jsx("svg",{...S,children:k?k.map((L,B)=>w.jsx("path",{d:L.d,className:L.className,fill:L.fill,stroke:L.stroke,opacity:L.opacity,fillRule:L.fillRule,clipRule:L.clipRule},B)):null}))});class Ge{constructor(){this.store=new Map}async getItem(e){return this.store.get(e)??null}async setItem(e,t){this.store.set(e,t)}async removeItem(e){this.store.delete(e)}}const zt=u.createContext(null),on={parse:o=>o?JSON.parse(o):null,stringify:JSON.stringify},Zn={store:new Ge,namespace:"",serializer:on,debounceMs:0,crossTabSync:!1,notify:()=>{},subscribeKey:()=>()=>{}},Jn={},Qn={parse:o=>o==null?null:JSON.parse(o),stringify:JSON.stringify},q={Horizontal:"horizontal",Vertical:"vertical"},fe={scrollbar:"_scrollbar_15caq_24",track:"_track_15caq_34",thumb:"_thumb_15caq_46","scrollbar-button":"_scrollbar-button_15caq_86","touch-thumb":"_touch-thumb_15caq_121"},rn="M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z",sn="M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z",eo={transform:"rotate(180deg)"},ln=o=>{const{style:e,orientation:t=q.Vertical,disabled:n,...r}=o,i=t===q.Vertical?rn:sn;return w.jsx("button",{style:e,className:oe(fe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:w.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:w.jsx("path",{d:i})})})},an=o=>{const{style:e,orientation:t=q.Vertical,disabled:n,...r}=o,i=t===q.Vertical?rn:sn;return w.jsx("button",{style:e,className:oe(fe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:w.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:eo,children:w.jsx("path",{d:i})})})},to=ke().supportsTouchEvents,cn=u.memo(u.forwardRef((o,e)=>{const{borderColor:t="var(--sxl-app-color-primary, rgb(33, 115, 70))",backgroundColor:n="var(--sxl-app-color-background, white)",fillColor:r="var(--sxl-app-color-grey, grey)",borderWidth:i=3,size:a=22,style:h,className:l,onPointerDown:s,onPointerMove:c,onPointerUp:d,orientation:f=q.Vertical,offset:m=0,currentTouchAnchor:_,elementParent:p,elementRoot:E,key:P,...g}=o;if(!to)return null;const x=D(s,[s]),v=D(c,[c]),R=D(d,[d]),M=f===q.Vertical,[j,O]=u.useState(!1),C=ut(u.useMemo(()=>({processTouch:!0,consumeTouch:!0,onPointerDown:(A,W)=>{O(!0),x?.(A),A.preventDefault(),A.stopPropagation()},onPointerMoveOrWait:(A,W,N)=>{v?.(A)},onPointerUp:(A,W,N)=>{O(!1),R?.(N),A.preventDefault(),A.stopPropagation()}}),[])),S=u.useMemo(()=>{const A=a/2+i/2+6;return{x:M?-A:m+a,y:M?m+a:-A,width:0,height:0}},[M,m,a]),[k,{y:L,x:B}]=Yt(),y=u.useRef(null),{getPortalContainer:T,isFullscreen:$}=qt(),[K,V]=u.useState(null);return u.useEffect(()=>{const A=y.current?.getBoundingClientRect();if(!A)return void V(null);let W=0,N=0,U=p;for(;U;)W+=U.scrollLeft,N+=U.scrollTop,U=E&&U===E.parentElement?null:U.parentElement;V(It.createPortal(w.jsx("div",{className:oe("touch-thumb",fe["touch-thumb"],l,fe,{dragging:j}),ref:e,style:{left:W+(A?.x??0)-(a+i)/2,top:N+(A?.y??0)-(a+i)/2,width:M?a:1.8*a,height:M?1.8*a:a,borderWidth:`${i}px`,boxShadow:j?`${n} 0px 0px 0px 1.5px`:void 0,borderStyle:"solid",borderColor:t,backgroundColor:n,opacity:_?0:void 0,transitionDuration:"160ms",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center center",...h},tabIndex:-1,onPointerDown:C,...g}),E??T(),P))},[L,j,t,n,r,B,S?.x,S?.y,S?.width,S?.height,l,_,n,a,i,t,p,$,P]),S?w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:Se([k,y]),style:{position:"absolute",left:S.x,top:S.y,opacity:0}}),K]}):null}));cn.displayName="TouchThumbHandle";const no=24,un=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:r=0,style:i,className:a,orientation:h=q.Vertical,onScrollOffset:l,onScroll:s,showCustomScrollButtons:c,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:m=120,minThumbSize:_=no,maxThumbSize:p,createScrollStartButton:E=ln,createScrollEndButton:P=an,touchThumbProps:g,thumbProps:x,onMouseDown:v,...R}=o,M=ke().primaryInput==="touch",j=c??!M;D(s,[s]);const[O,C]=u.useState({offset:0,length:0}),S=u.useRef(-1),k=h===q.Vertical,[L,{width:B,height:y}]=pe(),T=k?y:B,$=D((b,H,Z)=>{if(H===0||Z===0)return void C({offset:0,length:_});const ue=Z/T,ve=H/ue,he=Math.min(Math.max(_,ve),Math.min(T,p??Number.MAX_SAFE_INTEGER)),nt=b/ue;return{offset:Math.min(Math.max(0,nt),T-he),length:he}},[T,_,p]),K=D(b=>{const H=n/T,Z=Math.round(b*H);C($(Z,r,n)),l?.(Z,r,n),S.current=b},[l,r,n,T,O]),V=D(b=>{C($(b,r,n)),l?.(b,r,n),S.current=b},[l,r,n]);u.useEffect(()=>{S.current!==t&&T!==0&&(S.current=-1,C($(t,r,n)))},[t]),u.useEffect(()=>{T!==0&&C($(t,r,n))},[r,n,k,T]);const A=Math.max(0,n-r),[W,N]=u.useState(!1),U=u.useRef(0),G=u.useRef(0),me=Je(e,()=>({isScrollbar:()=>!0}),[]),ae=D(b=>{N(!0),U.current=k?b.clientY:b.clientX,G.current=O.offset},[k,O]),_e=D(b=>{b.currentTarget.setPointerCapture(b.pointerId),ae(b),b.stopPropagation()},[v]),ce=D(b=>{if(!W)return;const H=(k?b.clientY:b.clientX)-U.current,Z=G.current+H;K(Z)},[W,k]),Qe=D(b=>{ce(b)},[]),De=D(b=>{N(!1)},[]),et=D(b=>{try{b.currentTarget.releasePointerCapture(b.pointerId)}catch{}De(b)},[]),Ae=D(b=>{if(!b.currentTarget)return;const H=b.currentTarget.getBoundingClientRect(),Z=k?b.clientY-H.top:b.clientX-H.left;K(Z)},[k,O,r,n]),ze=D(b=>{const H=Math.max(1,Math.floor(.9*r));k?(b.key==="ArrowDown"&&K(Math.min(A,t+1)),b.key==="ArrowUp"&&K(Math.max(0,t-1)),b.key==="PageDown"&&K(Math.min(A,t+H)),b.key==="PageUp"&&K(Math.max(0,t-H)),b.key==="Home"&&K(0),b.key==="End"&&K(A)):(b.key==="ArrowRight"&&K(Math.min(A,t+1)),b.key==="ArrowLeft"&&K(Math.max(0,t-1)),b.key==="PageDown"&&K(Math.min(A,t+H)),b.key==="PageUp"&&K(Math.max(0,t-H)),b.key==="Home"&&K(0),b.key==="End"&&K(A))},[k,r,n,t,A]),Re=u.useRef(null),tt=u.useMemo(()=>{const b=w.jsx("div",{...x,className:oe(fe.thumb),ref:Re,role:"slider","aria-label":k?"Rows":"Columns","aria-orientation":k?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":A,"aria-valuenow":t,tabIndex:0,style:{...x?.style,position:"relative",[k?"height":"width"]:`${O.length}px`,[k?"width":"height"]:"100%",transform:k?`translateY(${O.offset}px)`:`translateX(${O.offset}px)`,[k?"minHeight":"minWidth"]:`${_}px`},onMouseDown:v,onPointerDown:_e,onPointerMove:Qe,onPointerUp:et});return M?w.jsxs(w.Fragment,{children:[b,w.jsx(cn,{...g,offset:O.offset,orientation:k?q.Vertical:q.Horizontal,onPointerDown:ae,onPointerMove:ce,onPointerUp:De})]}):b},[O,_,A,t,k,M,v,g,x]),[je,Be]=u.useState(null),Oe=D(()=>{let b;b=typeof d=="function"?d(t,r,n):t-d;const H=Math.max(0,b);return V(H),Be(H),H},[d,t,r,n]),Ie=D(()=>{let b;b=typeof d=="function"?d(t,r,n):t+d;const H=Math.min(A,b);return V(H),Be(H),H},[d,t,A,r,n]),ge=u.useRef(null),Ee=u.useRef(null),te=u.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null,Ee.current=null)},[]),ye=u.useCallback((b,H,Z,ue=f)=>{Ee.current=b,ge.current=setTimeout(()=>{const ve=Z?Oe():Ie();ve!==Ee.current?ye(ve,!1,Z,m):te()},H?0:ue)},[Oe,Ie,te]);u.useEffect(()=>()=>te(),[te]);const $e=u.useMemo(()=>{if(!j)return null;const b={orientation:h,disabled:t<=0,onMouseUp:te,onMouseLeave:te,onMouseDown:()=>ye(t,!0,!0)};return E?.(b)},[j,h,t,je]),Ke=u.useMemo(()=>{if(!j)return null;const b={orientation:h,disabled:t>=A,onMouseUp:te,onMouseLeave:te,onMouseDown:()=>ye(t,!0,!1)};return P?.(b)},[j,h,t,A,je]),Ce=k?"vertical":"horizontal";return w.jsxs("div",{ref:Se([me,e]),className:oe(a,fe.scrollbar,Ce,{dragging:W,"has-touch-thumb":M}),style:i,...R,children:[$e,w.jsx("div",{ref:L,role:"scrollbar","aria-orientation":Ce,"aria-valuemin":0,"aria-valuemax":A,"aria-valuenow":t,tabIndex:0,className:oe(fe.track,"track",Ce),onMouseDown:v,onPointerDown:Ae,onKeyDown:ze,children:tt}),Ke]})}));let Rt=Date.now,jt=1e3,le={},oo=1;const Le=o=>{let e=le[o]!==null;return e&&(le[o]=null),e},Bt=(o,e,t,n=0,r)=>{let i=Rt(),a=i,h=0,l=0,s=0,c=oo++;if(c%20==0){const f={};for(let m in le)f[m]=!0;le=f}const d=function(f){let m=f!==!0,_=Rt(),p=!0;try{p=(!e||e(c))??!0}catch{p=!1}if(!le[c]||!p)return le[c]=null,void t?.(60-l/((_-i)/jt),c,!1);if(m){s=Math.round((_-a)/16.666666666666668)-1;for(let g=0;g<Math.min(s,4);g++)d(!0),l++}n&&(h=(_-i)/n,h>1&&(h=1));let E=r?r(h):h,P=!1;try{P=o(E,_,m)}catch{P=!1}P!==!1&&h!==1||!m?m&&(a=_,requestAnimationFrame(d)):(le[c]=null,t?.(60-l/((_-i)/jt),c,h===1||n==null))};return le[c]=!0,requestAnimationFrame(d),c},ro=function(o){return Math.pow(o-1,3)+1},io=function(o){return(o/=.5)<1?.5*Math.pow(o,3):.5*(Math.pow(o-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,n,r){e!==null&&(this.__clientWidth=e),t!==null&&(this.__clientHeight=t),n!==null&&(this.__contentWidth=n),r!==null&&(this.__contentHeight=r),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,r,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0);const a=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),r===void 0&&(r=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const h=e/a;let l=h*(this.__scrollLeft+n)-n,s=h*(this.__scrollTop+r)-r;l>this.__maxScrollLeft?l=this.__maxScrollLeft:l<0&&(l=0),s>this.__maxScrollTop?s=this.__maxScrollTop:s<0&&(s=0),this.__publish(l,s,e,t)}zoomBy(e,t=!1,n=0,r=0,i){this.zoomTo(this.__zoomLevel*e,t,n,r,i)}scrollTo(e,t,n=!1,r=1){if(this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0),r!==void 0&&r!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=r,t*=r,this.__computeScrollMax(r)}else r=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,r,n)}scrollBy(e=0,t=0,n=!1){const r=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(r+(e||0),i+(t||0),n)}doMouseZoom(e,t,n,r){const i=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,n-this.__clientLeft,r-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,r;this.__interruptedAnimation=!0,this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(Le(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let i=e.length===1;i?(n=e[0].pageX,r=e[0].pageY):(n=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=r,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=r,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!i&&this.options.scrollingX,this.__enableScrollY=!i&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!i,this.__isSingleTouch=i,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 r,i;e.length===2?(r=Math.abs(e[0].pageX+e[1].pageX)/2,i=Math.abs(e[0].pageY+e[1].pageY)/2):(r=e[0].pageX,i=e[0].pageY);let a=this.__positions;if(this.__isDragging){let h=r-this.__lastTouchLeft,l=i-this.__lastTouchTop,s=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=r-this.__clientLeft,_=i-this.__clientTop;s=(m+s)*d/f-m,c=(_+c)*d/f-_,this.__computeScrollMax(d)}}if(this.__enableScrollX){s-=h*this.options.speedMultiplier;let f=this.__maxScrollLeft;(s>f||s<0)&&(this.options.bouncing?s+=h/2*this.options.speedMultiplier:s=s>f?f:0)}if(this.__enableScrollY){c-=l*this.options.speedMultiplier;const f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?c+=l/2*this.options.speedMultiplier:c=c>f?f:0)}a.length>60&&a.splice(0,30),a.push(s,c,t),this.__publish(s,c,d)}else{let h=this.options.locking?3:0,l=5,s=Math.abs(r-this.__initialTouchLeft),c=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&s>=h,this.__enableScrollY=this.options.scrollingY&&c>=h,a.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(s>=l||c>=l),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=r,this.__lastTouchTop=i,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,r=n;for(let i=n;i>0&&t[i]>this.__lastTouchMove-100;i-=3)r=i;if(r!==n){const i=t[n]-t[r],a=this.__scrollLeft-t[r-2],h=this.__scrollTop-t[r-1];this.__decelerationVelocityX=a/i*(1e3/60),this.__decelerationVelocityY=h/i*(1e3/60);const l=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>l||Math.abs(this.__decelerationVelocityY)>l)&&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,r=!1){const i=this.__isAnimating;if(i&&(Le(i),this.__isAnimating=0),r&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const a=this.__scrollLeft,h=this.__scrollTop,l=this.__zoomLevel,s=e-a,c=t-h,d=n-l,f=function(p,E,P){P&&(this.__scrollLeft=a+s*p,this.__scrollTop=h+c*p,this.__zoomLevel=l+d*p,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),m=function(p){return this.__isAnimating===p}.bind(this),_=function(p,E,P){E===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||P)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=Bt(f,m,_,this.options.animationDuration,i?ro:io)}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),l=this.__clientWidth,s=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(a/l)*l,this.__minDecelerationScrollTop=Math.floor(h/s)*s,this.__maxDecelerationScrollLeft=Math.ceil(a/l)*l,this.__maxDecelerationScrollTop=Math.ceil(h/s)*s}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(a,h,l){this.__stepThroughDeceleration(l)}.bind(this),n=this.options.snapping?4:.1,r=function(){const a=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return a||(this.__didDecelerationComplete=!0),a}.bind(this),i=function(a,h,l){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=Bt(t,r,i)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const r=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);r!==t&&(t=r,this.__decelerationVelocityX=0);const i=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);i!==n&&(n=i,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 r=0,i=0,a=this.options.penetrationDeceleration,h=this.options.penetrationAcceleration;t<this.__minDecelerationScrollLeft?r=this.__minDecelerationScrollLeft-t:t>this.__maxDecelerationScrollLeft&&(r=this.__maxDecelerationScrollLeft-t),n<this.__minDecelerationScrollTop?i=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(i=this.__maxDecelerationScrollTop-n),r!==0&&(r*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=r*a:this.__decelerationVelocityX=r*h),i!==0&&(i*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=i*a:this.__decelerationVelocityY=i*h)}}}const Pe=(o,e)=>w.jsx(un,{...o,ref:e}),lo=Object.freeze(Object.defineProperty({__proto__:null,defaultCreateScrollbar:Pe,getScrollTo:(o,e,t,n,r=0)=>{for(let i=0;i<t.length;i++){const a=t[i].getBoundingClientRect();let h=a.left-e,l=h+a.width;if(n){if(h<o&&l>=o)return h}else if(Math.ceil(l)>Math.ceil(o)+2)return l}return r}},Symbol.toStringTag,{value:"Module"})),hn=({width:o,height:e})=>w.jsx("div",{className:"corner",style:{minWidth:`${o}px`,width:`${o}px`,minHeight:`${e}px`,height:`${e}px`}}),dn=u.memo(u.forwardRef((o,e)=>{const{children:t,viewport:n,onScrollViewport:r,showHorizontalScrollbar:i=!0,showVerticalScrollbar:a=!0,createScrollCorner:h=hn,createHorizontalScrollbar:l=Pe,createVerticalScrollbar:s=Pe,style:c,touchElement:d,disableTouch:f,...m}=o,_=i&&l,p=a&&s,E=D(r,[r]),P=Je(e,()=>({isScrollPane:()=>!0}),[]),g=u.useRef(null);u.useEffect(()=>{g.current&&(g.current.__scrollTop===n?.top&&g.current.__scrollLeft===n?.left||g.current.__isDecelerating||g.current?.scrollTo(n?.left,n?.top,!1))},[n?.left,n?.top,d]);const x=u.useCallback((y,T)=>{E?.({left:y,top:T})},[]),v=u.useCallback(y=>{g.current?.doTouchStart(y.touches,y.timeStamp)},[]),R=u.useCallback(y=>{y.preventDefault(),g.current?.doTouchMove(y.touches,y.timeStamp)},[]),M=u.useCallback(y=>{g.current?.doTouchEnd(y.timeStamp)},[]),j=u.useCallback(({containerWidth:y,containerHeight:T,totalWidth:$,totalHeight:K})=>{g.current.setDimensions(y,T,$,K)},[]);u.useEffect(()=>{const y=d??P.current;if(!f&&ke().supportsTouchEvents&&y&&n){if(!g.current){const T={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};g.current=new so(x,T)}ke().supportsTouchEvents&&(y.addEventListener("touchstart",v),y.addEventListener("touchend",M),y.addEventListener("touchmove",R)),j({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{y?.removeEventListener("touchstart",v),y?.removeEventListener("touchend",M),y?.removeEventListener("touchmove",R)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,f,d]);const[O,{width:C}]=pe(),[S,{height:k}]=pe(),L=u.useMemo(()=>{if(!p)return null;const y=s({orientation:q.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:T=>{E?.({top:T})}});return w.jsx("div",{style:{display:"flex",flex:"0"},ref:O,children:y})},[s,n?.top,n?.height,n?.totalHeight]),B=u.useMemo(()=>{if(!_)return null;const y=l({orientation:q.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:T=>{E?.({left:T})}});return w.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[w.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${C}px)`},children:w.jsx("div",{ref:S,className:"sizer",children:y})}),p?h({width:C,height:k}):w.jsx(w.Fragment,{})]})},[l,n?.left,n?.width,n?.totalWidth,p,h,C,k]);return w.jsx("div",{style:{position:"relative",display:"flex",minWidth:p?`${C}px`:void 0,minHeight:_?`${k}px`:void 0,...c},...m,ref:P,children:w.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[w.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[w.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:t}),p?L:w.jsx(w.Fragment,{})]}),_?B:w.jsx(w.Fragment,{})]})})}));dn.displayName="ScrollPane";const ao=300,co=100,uo=1e6,ho=100,fo=50,Ot=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:r=0,minSize:i=0,endGap:a=ao,endScrollIncrement:h=co,style:l=Wt,onMouseDown:s,onScrollOffset:c,onScroll:d,scaleLimit:f=uo,scaleFactor:m=ho,precisionFactor:_=fo,createScrollbar:p=Pe,...E}=o;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const P=D(s,[s]),[g,x]=u.useState(!1),v=u.useMemo(()=>{const C=f===0?r:Math.min(r??0,Math.max(i??0,(t??0)+(n??0))+(a??0)),S=f!==0&&C>f?m:1,k=S/_,L=Math.ceil(C/S);return{offset:Math.ceil(t/S),totalSize:L,viewportSize:Math.ceil(n/S),scaledOffset:t,scaledTotalSize:r,scaledViewportSize:n,factor:S,precision:k}},[t,r,n,g,i,a,h]),R=D((C,S,k)=>{const L=v.offset;Math.abs(C-L)<v.precision&&(C=L),c?.(C*v.factor,L,v.viewportSize)},[c,v]),M=u.useCallback(C=>{},[]),j=u.useCallback(C=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",j),x(!1)},[]),O=u.useCallback(C=>{x(!0),P?.(C),document.addEventListener("mousemove",M,{passive:!0}),document.addEventListener("mouseup",j,{passive:!0})},[M,j]);return Pe({style:l,...E,offset:v.offset,totalSize:v.totalSize,viewportSize:v.viewportSize,onMouseDown:O,onScrollOffset:R},e)}));Ot.displayName="VirtualScrollbar",exports.Command=Xe,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=mt,exports.DefaultDynamicIconService=Te,exports.DefaultReactNotifier=Vt,exports.DynamicIcon=At,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=Tn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.InMemoryStore=Ge,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=X,exports.LocalStorageStore=class{constructor(o=window.localStorage){this.storage=o}async getItem(o){try{return this.storage.getItem(o)}catch{return null}}async setItem(o,e){try{this.storage.setItem(o,e)}catch{}}async removeItem(o){try{this.storage.removeItem(o)}catch{}}subscribe(o){const e=t=>{t.storageArea===this.storage&&t.key&&o(t.key)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}},exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:o,notifier:e})=>(u.useEffect(()=>{const t=I.Notifier.getOverrides();return I.Notifier.setOverrides(e),()=>{I.Notifier.setOverrides(t)}},[e]),u.createElement(Xt.Provider,{value:e},o)),exports.NotifierType=ct,exports.PersistenceStateProvider=function(o){const{store:e,namespace:t="",serializer:n=Qn,debounceMs:r=0,crossTabSync:i=!0,children:a}=o,h=u.useMemo(()=>typeof window>"u"?new Ge:e??new Ge,[e]),l=u.useRef(new Map),s=u.useMemo(()=>({store:h,namespace:t,serializer:n,debounceMs:r,crossTabSync:i,notify(c){const d=l.current.get(c);d&&d.forEach(f=>f())},subscribeKey(c,d){const f=l.current,m=f.get(c)??new Set;return m.add(d),f.set(c,m),()=>{const _=f.get(c);_&&(_.delete(d),_.size===0&&f.delete(c))}}}),[h,t,n,r,i]);return u.useEffect(()=>{if(s.crossTabSync&&s.store.subscribe)return s.store.subscribe(c=>{if(!c.startsWith(s.namespace+":"))return;const d=c.slice(s.namespace.length+1);s.notify(d)})},[s]),w.jsx(zt.Provider,{value:s,children:a})},exports.ReactErrorBoundary=({children:o})=>{const e=Me(),t=u.useCallback(n=>{e.showError(n)},[e]);return w.jsx(Vn,{onError:t,children:o})},exports.ReactUtils=Cn,exports.RoundedTab=Dn,exports.ScrollPane=dn,exports.ScrollUtils=lo,exports.Scrollbar=un,exports.ScrollbarOrientation=q,exports.SimpleCommand=He,exports.SplitPane=tn,exports.SplitPaneResizer=en,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:o})=>{const e=Me();return u.useEffect(()=>{const t=new Xn(e);return()=>{t.cleanup()}},[e]),w.jsx(w.Fragment,{children:o})},exports.VirtualScrollbar=Ot,exports.WalkingIcon=function(o){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:r=3,dashLength:i=5,iconKey:a,packKey:h,style:l,className:s,...c}=o,d=u.useMemo(()=>{if(!e)return;const m={"--walk-duration":`${n*(r+i)}ms`,"--walk-dash-length":`${i}px`,"--walk-dash-gap":`${r}px`};return t&&t!=="accent"&&(m["--icon-accent"]=`var(--icon-${t})`),m},[e,n,r,i,t]),f=u.useMemo(()=>e?s+" walking":s,[e,s]);return w.jsx(At,{iconKey:a,packKey:h,className:f,style:{...l,...d},...c})},exports.createDynamicIconService=nn,exports.defaultCreateScrollCorner=hn,exports.defaultCreateScrollEdgeButton=o=>{const{style:e,orientation:t=q.Vertical,...n}=o,r=t===q.Vertical,i=r?"rotate(90) ":"";return w.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${r?"vertical":"horizontal"} edge`,...n,children:w.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:i,children:w.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:o.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=an,exports.defaultCreateScrollStartButton=ln,exports.getDevicePixelRatio=function(o){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=o||{},r=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(r):r),t)},exports.toShortcutString=be,exports.useAnimatedMeasure=Yt,exports.useCallbackRef=D,exports.useCommand=function(o,e=null){const t=u.useRef(e);t.current=e;const[n,r]=u.useReducer(a=>a+1,0),i=u.useMemo(()=>Array.isArray(o)?o:[o],[o]);return u.useEffect(()=>{if(!i||i.length===0)return;const a=(s,c)=>{t.current?.onChange?.(c),r()};let h=null;e&&(h={onExecute(s,c){t.current?.onExecute?.(s,c)},onError(s,c,d){t.current?.onError?.(s,c,d)}});const l=new Set;for(let s=0;s<i.length;s++)l.add(i[s]?.addPropertyListener(I.CommonUtils.debounce(a,0),!0)),e&&l.add(i[s]?.addExecuteListener(h));return()=>{l.forEach(s=>{s?.()})}},[o]),n},exports.useCommands=function(o,e=null,t=null,n){const r=u.useRef(t);r.current=t,e&&!Array.isArray(e)&&(e=[e]);const[i,a]=u.useState(We(o,e)),h=n?[...n,o]:[o];return u.useEffect(()=>{const l={onGroupChange:()=>{const f=We(o,e);a(f),r.current?.onChange?.(this)}};let s;e&&e.length>0&&(s={keys:e},l.onCommandChange=(f,m)=>{r.current?.onChange?.(o),a(We(o,e))});const c=o?.addListener(l,s),d=We(o,e);return a(d),r.current?.onChange&&r.current?.onChange(o),()=>{c?.()}},h),i},exports.useCopyPaste=o=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:r,commands:i}=o,a=Me(),h=D(r,[r]),l=D(n,[n]),{getClipboard:s,refNativeCopy:c}=xt(),d=s();u.useMemo(()=>{const g=e?.element,x=t?.element??e?.element;if(!i)return;const v=[new He("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:[X.Ctrl]}}),new He("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:[X.Ctrl]}}),new He("paste",x,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste.yellow",shortcut:[{key:"V",modifiers:[X.Ctrl]},{key:"F8",modifiers:[X.Ctrl]}]})];i?.addCommands(v,!0)},[i]);const f=D(async g=>{if(!e?.element)return;let x=null;try{x=e.doCopy?.(g),typeof x=="string"?await d.writeText(x):await d.writeReference(x)}catch(v){throw v}},[e,a]),m=D(async g=>{const x=e?.element?.();if(x){c.current={sourceElement:x,args:g};try{await f(g)}catch(v){a.showError?.(v)}}},[e?.element,a]),_=u.useCallback(()=>{m({isCut:!0})},[]),p=D(async(g,x,v)=>{try{if(await g.doPaste(x,v)===!1)return;l?.(x,v)}catch(R){a.showError?.(R)}},[l]),E=D(async(g,x,v)=>{const R=t?.element?.();if(R&&await I.CommonUtils.whenFocus(R),!g&&!x)return;const M=await a.showBusy?.("Pasting...");if(x)try{return await p(t,x,v),void M?.()}catch(C){M?.(),a.showError?.(C)}let j,O=t.importFromExternal;O||(O=(C,S)=>({getItemType:()=>"text",toText:()=>g.text,isClipboardItem:!0}));try{j=await O(g,{isCut:!1})}catch(C){M?.(),a.showError?.(C)}if(j)try{const C=await Promise.resolve(j);await p(t,C,v),M?.()}catch(C){M?.(),a.showError?.(C)}else M?.()},[p,t,a]),P=D(async g=>{if(t?.element)try{const x=await d.readReference();if(x)return void await E(null,x,g);const v=[];v[0]=await I.ClipboardUtils.readStringFromClipboard(d,I.MimeType.plain),v[1]=await I.ClipboardUtils.readHTMLFromClipboard(d,I.MimeType.html),v[2]=await I.ClipboardUtils.readBlobFromClipboard(d,I.MimeType.png);const R={text:v[0]??null,html:v[1]??null,image:v[2]??null};await E(R,null,g)}catch(x){if(x?.message==="Document is not focused.")return;a.showError?.(x)}},[E,t?.element,a]);return D(async g=>{},[e?.element]),D(async g=>{},[t?.element,E,a]),u.useEffect(()=>{if(!d)return;const g=async R=>{const M=await d.readReference();h?.(M)},x=R=>{a.showMessage?.(I.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},v=R=>{a.showMessage?.(I.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",g),d.addEventListener("clipboarderrorread",x),d.addEventListener("clipboarderrorwrite",v),()=>{d.removeEventListener("clipboardchange",g),d.removeEventListener("clipboarderrorread",x),d.removeEventListener("clipboarderrorwrite",v)}},[d,a]),u.useEffect(()=>{},[f,E,e,t]),u.useEffect(()=>{i?.getCommand("cut")?.updateCallback(_).update({disabled:!e||!t}),i?.getCommand("copy")?.updateCallback(m).update({disabled:!e}),i?.getCommand("paste")?.updateCallback(P).update({disabled:!t})},[e,t,i]),{paste:P,copy:m,clipboard:d}},exports.useDevicePixelRatio=function(o){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 r=()=>{const i=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);i.addEventListener("change",r,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:i,listener:r}};return r(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[o]),e},exports.useEditMode=()=>{const o=Kn();return u.useMemo(()=>({setMode:e=>{Jt(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>o}),[o])},exports.useFullscreenPortal=qt,exports.useGlobalClipboard=xt,exports.useId=Wn,exports.useImperativeElement=Je,exports.useMouseDownAndHoldListener=function(o,e){return ut({onPointerDown:o,onPointerMoveOrWait:(t,n,r)=>{o?.(r)},...e})},exports.useNotifier=Me,exports.useOnClickOrFocusAway=function(o,e,t){const n=D(e,[e]);u.useEffect(()=>{const r=i=>{o.current&&!o.current.contains(i.target)&&n(i)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",r),document.addEventListener("touchstart",r)),t&&t.focusEvents===!1||document.addEventListener("focus",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r),document.removeEventListener("focus",r)}},[o])},exports.usePersistenceState=function(o,e,t=Jn){const{store:n,namespace:r,serializer:i,debounceMs:a,subscribeKey:h}=u.useContext(zt)||Zn,l=t.serializer??i??on,s=u.useMemo(()=>`${r}:${o}`,[r,o]),c=u.useRef(null),d=`${s}::v`,[f,m]=u.useState(()=>{let p;try{if(typeof window<"u"&&"localStorage"in window&&s.startsWith(r)){const E=window.localStorage?.getItem(s)??null;E!=null&&(p=l.parse(E))}}catch{}if(p===void 0){const E=e;return typeof E=="function"?E():E}return p});u.useEffect(()=>{let p=!0;return(async()=>{const[E,P]=await Promise.all([n.getItem(s),n.getItem(d)]);let g;try{g=E==null?void 0:l.parse(E)}catch{}const x=P==null?void 0:Number.parseInt(P,10);g===void 0?!t.lazy&&e!==void 0&&(g=typeof e=="function"?e():e,await n.setItem(s,l.stringify(g)),t.version!=null&&await n.setItem(d,String(t.version))):t.version!=null&&x!==void 0&&x!==t.version&&t.migrate&&(g=t.migrate(g,x),await n.setItem(s,l.stringify(g)),await n.setItem(d,String(t.version))),p&&g!==void 0&&m(g)})(),()=>{p=!1}},[n,s,d,t.version,t.migrate,t.lazy]),u.useEffect(()=>h(o,async()=>{const p=await n.getItem(s);if(p!=null)try{m(l.parse(p))}catch{}}),[n,s,h,o]);const _=async p=>{await n.setItem(s,l.stringify(p)),t.version!=null&&await n.setItem(d,String(t.version))};return[f,p=>{m(E=>{const P=typeof p=="function"?p(E):p;return c.current&&clearTimeout(c.current),a>0?c.current=setTimeout(()=>{_(P)},a):_(P),P})},()=>{if(c.current&&clearTimeout(c.current),n.removeItem(s),n.removeItem(d),e!==void 0){const p=typeof e=="function"?e():e;m(p)}else m(void 0)}]},exports.useSynchronizedPointerHandler=ut,exports.useTraceUpdate=function(o,e=!0){const t=u.useRef(o);u.useEffect(()=>{if(e){const n=Object.entries(o).reduce((r,[i,a])=>(t.current[i]!==a&&(r[i]=[t.current[i],a]),r),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=o})},exports.useUndoManager=({manager:o,commands:e,disabled:t})=>{const n=Me(),r=D(a=>{try{o?.undo(a)}catch(h){n.error(h)}},[o]),i=D(a=>{try{o?.redo(a)}catch(h){n.error(h)}},[o]);return u.useMemo(()=>{if(!e)return;const a={contains:l=>!0,focus(){}},h=[new Xe("undo",a,{label:"Undo",description:Ct,shortcut:{key:"z",modifiers:[X.Ctrl]},disabled:!0},r),new Xe("redo",a,{label:"Redo",description:Mt,shortcut:[{key:"y",modifiers:[X.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[X.Alt]}],disabled:!0},i)];e?.addCommands(h,!0)},[e]),u.useEffect(()=>{if(!e)return;const a=()=>{const l=o?.getTopUndoDescription(),s={};var c;e.getCommand("undo").update({disabled:t||!o||!o.hasUndo(),description:l?(c=l,`Undo ${c}`):Ct,state:s,context:{undoManager:o}});const d=o?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!o||!o.hasRedo(),description:d?Un(d):Mt,state:s,context:{undoManager:o}})};if(a(),!o)return;const h=o.addListener({onStackChange(){a()}});return()=>h?.()},[o,e,t]),{undo:r,redo:i}};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { WalkingIcon as a } from "./index.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
4
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.17
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/esm/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx as P, jsxs as pe, Fragment as fe } from "react/jsx-runtime";
|
|
|
5
5
|
import { createRoot as Sn } from "react-dom/client";
|
|
6
6
|
import { unstable_batchedUpdates as En, createPortal as Mn } from "react-dom";
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
8
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.17
|
|
9
9
|
*
|
|
10
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1207,7 +1207,7 @@ function so() {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
ro.displayName = "SplitPane";
|
|
1209
1209
|
const nt = so();
|
|
1210
|
-
nt.register("base", () => import("./
|
|
1210
|
+
nt.register("base", () => import("./DQXf4a-Nh3ZMvJdj.mjs"));
|
|
1211
1211
|
const Wt = (o) => P("svg", { ...o, children: P("path", {}) }), lo = { Icon: "_Icon_17dpm_10" }, ao = me((o) => {
|
|
1212
1212
|
const { iconKey: e, packKey: t, className: n, style: r, role: i, title: a, size: u, ariaHidden: l, sourceProps: s, children: c, ...h } = o, [d, f] = ae.useState(null);
|
|
1213
1213
|
ae.useEffect(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.17
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.17
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1159,7 +1159,7 @@ function de() {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
se.displayName = "SplitPane";
|
|
1161
1161
|
const pe = de();
|
|
1162
|
-
pe.register("base", () => import("./
|
|
1162
|
+
pe.register("base", () => import("./Cy9MGJ5ivkJxyauG.mjs"));
|
|
1163
1163
|
const fe = (t2) => x("svg", { ...t2, children: x("path", {}) }), me = { Icon: "_Icon_17dpm_10" }, _e = p((e2) => {
|
|
1164
1164
|
const { iconKey: n2, packKey: o2, className: i2, style: r2, role: s2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...f2 } = e2, [m2, _2] = l.useState(null);
|
|
1165
1165
|
l.useEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-react",
|
|
3
3
|
"description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.17",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@sheetxl/utils": "^0.7.
|
|
43
|
+
"@sheetxl/utils": "^0.7.17",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"detect-it": "^4.0.1",
|
|
46
46
|
"react-merge-refs": "^3.0.2",
|
package/types/index.d.ts
CHANGED