@a-multilayout-splitter/core 6.0.0-alpha.4 → 6.0.0-alpha.6
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/README.md +18 -5
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +796 -835
- package/dist/index.js.map +1 -1
- package/dist/src/contexts/SplitProvider.d.ts +4 -4
- package/dist/src/hooks/usePaneManager.d.ts +6 -2
- package/dist/src/index.d.ts +7 -8
- package/dist/src/types/index.d.ts +14 -6
- package/dist/src/utils/layoutCalculations.d.ts +0 -17
- package/dist/style.css +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
**High-performance resizable split layouts for React.** Built for the modern web with a focus on speed, accessibility, and developer experience.
|
|
4
4
|
|
|
5
|
-
[](https://github.com/AmanKrr/A-MultiLayout-Splitter/actions/workflows/test.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/@a-multilayout-splitter/core?activeTab=versions)
|
|
7
|
+

|
|
8
|
+
[](https://github.com/AmanKrr/A-MultiLayout-Splitter/blob/v6/LICENSE)
|
|
7
9
|
[](https://amankrr.github.io/A-MultiLayout-Splitter/)
|
|
8
10
|
|
|
9
11
|
## 🚀 Why A-MultiLayout-Splitter?
|
|
@@ -11,6 +13,7 @@
|
|
|
11
13
|
Most React splitters suffer from "jitter" because they trigger a full React render loop 60 times per second during a drag operation. A-MultiLayout-Splitter uses a **hybrid architecture** that bypasses React for resizing interaction while maintaining a perfect React-first state model.
|
|
12
14
|
|
|
13
15
|
### Key Features
|
|
16
|
+
|
|
14
17
|
- ⚡️ **60fps Performance**: Direct DOM manipulation during interaction ensures zero-lag dragging.
|
|
15
18
|
- 🌲 **Deep Nesting**: Effortlessly create complex IDE-grade layouts (Sidebars within Topbars within Views).
|
|
16
19
|
- 🧩 **Plugin System**: Modular architecture for features like Keyboard Navigation, Persistence, and Custom UI.
|
|
@@ -25,6 +28,7 @@ Most React splitters suffer from "jitter" because they trigger a full React rend
|
|
|
25
28
|
**[View Full Documentation Site](https://amankrr.github.io/A-MultiLayout-Splitter/)**
|
|
26
29
|
|
|
27
30
|
Our documentation site contains:
|
|
31
|
+
|
|
28
32
|
- **Interactive Demos**: Live examples of every feature.
|
|
29
33
|
- **Guide**: Detailed explanation of the React-First architecture.
|
|
30
34
|
- **Deep-Dives**: Learn how to build custom plugins and handle nested layouts.
|
|
@@ -35,13 +39,21 @@ Our documentation site contains:
|
|
|
35
39
|
## 📦 Installation
|
|
36
40
|
|
|
37
41
|
```bash
|
|
42
|
+
# npm
|
|
38
43
|
npm install @a-multilayout-splitter/core
|
|
44
|
+
|
|
45
|
+
# pnpm
|
|
46
|
+
pnpm add @a-multilayout-splitter/core
|
|
47
|
+
|
|
48
|
+
# yarn
|
|
49
|
+
yarn add @a-multilayout-splitter/core
|
|
39
50
|
```
|
|
40
51
|
|
|
41
52
|
## 🛠️ Basic Quick Start
|
|
42
53
|
|
|
43
54
|
```tsx
|
|
44
55
|
import { Split } from '@a-multilayout-splitter/core';
|
|
56
|
+
import '@a-multilayout-splitter/core/style.css';
|
|
45
57
|
|
|
46
58
|
function App() {
|
|
47
59
|
return (
|
|
@@ -63,15 +75,16 @@ Extend the splitter with powerful built-in plugins:
|
|
|
63
75
|
|
|
64
76
|
```tsx
|
|
65
77
|
import { Split, keyboardPlugin, persistencePlugin } from '@a-multilayout-splitter/core';
|
|
78
|
+
import '@a-multilayout-splitter/core/style.css';
|
|
66
79
|
|
|
67
|
-
<Split
|
|
80
|
+
<Split
|
|
68
81
|
plugins={[
|
|
69
82
|
keyboardPlugin(), // Arrows and numbers to resize/focus
|
|
70
|
-
persistencePlugin({ key: 'user-layout' }) // Auto-save state
|
|
83
|
+
persistencePlugin({ key: 'user-layout' }), // Auto-save state
|
|
71
84
|
]}
|
|
72
85
|
>
|
|
73
86
|
{/* Panes */}
|
|
74
|
-
</Split
|
|
87
|
+
</Split>;
|
|
75
88
|
```
|
|
76
89
|
|
|
77
90
|
---
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Je=Object.defineProperty;var Ze=(t,e,n)=>e in t?Je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var te=(t,e,n)=>Ze(t,typeof e!="symbol"?e+"":e,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("react/jsx-runtime"),c=require("react");function Qe(t,e){e?(t.classList.add("a-split-hidden"),t.style.flexGrow="0",t.style.flexShrink="0",t.style.flexBasis="0"):(t.classList.remove("a-split-hidden"),t.style.flexGrow="",t.style.flexShrink="")}function ve(t,e,n={}){return new Promise(s=>{const l=n.duration||300;if(!n.animate){t.style.flexBasis=e,s();return}t.style.transition=`flex-basis ${l}ms ease`,t.offsetHeight,t.style.flexBasis=e,setTimeout(()=>{t.style.transition="",s()},l)})}function Ke(t){return{...t,collapsed:!t.collapsed}}function et(t,e){return t.findIndex(n=>n.id===e)}function Ce(t){return!t.collapsed}function tt(t){return t.filter(Ce)}function nt(t){return document.querySelector(`[data-pane-id="${t}"]`)}function rt(t,e,n){return Math.max(e,Math.min(n,t))}function st(t,e,n,s={}){return{id:t,size:e,content:n,collapsed:s.collapsed??!1,minSize:s.minSize??0,maxSize:s.maxSize??100}}function it(t,e){return{...t,size:e}}function at(t,e){return t.map(n=>{const s=e.get(n.id);return s?{...n,...s}:n})}function ot(t,e){return{...t,size:e.size,collapsed:e.collapsed}}function lt(t){return{id:t.id,size:t.size,collapsed:t.collapsed}}function Ee(t,e){return!0}function ne(t,e){return typeof e=="boolean"?e:Array.isArray(e)?e.length>0&&typeof e[0]=="boolean"?e[t-1]===!0:e.includes(t):!1}function re(t,e){return typeof e=="boolean"?e:Array.isArray(e)?e.length>0&&typeof e[0]=="boolean"?e[t-1]!==!1:e.includes(t):!0}function se(t,e){return typeof e=="boolean"?e:Array.isArray(e)?e.length>0&&typeof e[0]=="boolean"?e[t-1]===!0:e.includes(t):!1}function $e(t,e=[],n=[],s=[],l=[],w="split"){const[h,z]=c.useState(()=>c.Children.toArray(t).map((g,p)=>({id:`${w}-pane-${p}`,size:e[p]||"100%",collapsed:n[p]||!1,minSize:s[p]||0,maxSize:l[p]||100,content:g}))),C=c.useRef(t);c.useEffect(()=>{const o=c.Children.toArray(t),g=c.Children.toArray(C.current);o.length===h.length&&z(p=>{let r=!1;const i=p.map((a,u)=>{const S=o[u],A=g[u];return S!==A?(r=!0,{...a,content:S}):a});return r?i:p}),C.current=t},[t,h.length]);const P=c.useCallback(o=>{z(g=>{const p=o.position??g.length,r={id:`${w}-pane-${Date.now()}`,size:o.size,collapsed:o.collapsed||!1,minSize:o.minSize||0,maxSize:o.maxSize||100,content:o.content},i=[...g];return i.splice(p,0,r),ct(i,p,o.size)})},[w]),v=c.useCallback(o=>{z(g=>{if(o<0||o>=g.length)return g;const p=[...g],r=p.splice(o,1)[0];return r?ut(p,r.size):p})},[]),d=c.useCallback(o=>{z(g=>{if(o<0||o>=g.length)return g;const p=g[o];if(!p)return g;const r=[...g];r[o]={...p,collapsed:!p.collapsed};const i=document.querySelector(`[data-pane-id="${p.id}"]`);if(i){const a=r[o];(a==null?void 0:a.collapsed)??!1?(i.classList.add("a-split-hidden"),i.style.flexGrow="0"):(i.classList.remove("a-split-hidden"),i.style.flexGrow="")}return r})},[]),b=c.useCallback((o,g,p)=>{z(r=>{if(o<0||o>=r.length)return r;const i=r[o];if(!i)return r;const a=[...r];a[o]={...i,size:g,flexGrow:void 0};const u=document.querySelector(`[data-pane-id="${i.id}"]`);return u&&ve(u,g,p||{animate:!1}),a})},[]),m=c.useCallback(()=>h,[h]),E=c.useCallback(o=>{z(g=>{const p=[...o].sort((a,u)=>u-a);let r=[...g],i=0;if(p.forEach(a=>{if(a>=0&&a<r.length){const u=r.splice(a,1)[0];u&&(i+=parseFloat(u.size)||0)}}),r.length>0&&i>0){const a=i/r.length;r=r.map(u=>({...u,size:`${(parseFloat(u.size)||0)+a}%`}))}return r})},[]),D=c.useCallback((o,g)=>{z(p=>{if(o<0||o>=p.length||g<0||g>=p.length||o===g)return p;const r=[...p],i=r[o];return r[o]=r[g],r[g]=i,r})},[]),I=c.useCallback((o,g)=>{z(p=>{if(o<0||o>=p.length)return p;const r=p[o];if(!r||r.collapsed)return p;const i=g==null?void 0:g.direction;let a;i==="left"?a=o+1:i==="right"?a=o-1:a=o<p.length-1?o+1:o-1;const u=p.map((S,A)=>A===o?{...S,collapsed:!0,flexGrow:0}:A===a&&!S.collapsed?{...S,flexGrow:1}:S.collapsed?S:{...S,flexGrow:0});if(g!=null&&g.animate){const S=document.querySelector(`[data-pane-id="${r.id}"]`);S&&(S.style.transition=`flex-basis ${g.duration||300}ms ease`,setTimeout(()=>{S.style.transition=""},g.duration||300))}return u})},[]),M=c.useCallback((o,g)=>{z(p=>{if(o<0||o>=p.length)return p;const r=p[o];if(!r||!r.collapsed)return p;const i=p.filter(S=>!S.collapsed).length+1,a=p.length;let u=[...p];if(u[o]={...r,collapsed:!1,flexGrow:void 0},i===a)u=u.map(S=>({...S,flexGrow:void 0}));else{const S=g==null?void 0:g.direction;let A;if(S==="left"?A=o+1:S==="right"?A=o-1:A=o<p.length-1?o+1:o-1,A>=0&&A<u.length){const L=u[A];L&&L.flexGrow===1&&(u[A]={...L,flexGrow:void 0})}}if(g!=null&&g.animate){const S=document.querySelector(`[data-pane-id="${r.id}"]`);S&&(S.style.transition=`flex-basis ${g.duration||300}ms ease`,setTimeout(()=>{S.style.transition=""},g.duration||300))}return u})},[]),N=c.useCallback((o,g)=>{z(p=>{if(o<0||o>=p.length)return p;const r=p[o];if(!r)return p;const i=parseFloat(r.size)||0,a=Math.max(r.minSize||0,Math.min(r.maxSize||100,i+g)),u=[...p];u[o]={...r,size:`${a}%`};const S=document.querySelector(`[data-pane-id="${r.id}"]`);return S&&(S.style.flexBasis=`${a}%`),u})},[]);return{panes:h,addPane:P,removePane:v,togglePane:d,setPaneSize:b,getPaneState:m,removePanes:E,swapPanes:D,collapsePane:I,expandPane:M,resizePane:N}}function ct(t,e,n){const s=parseFloat(n);if(!n.includes("%"))return t;const h=t.filter((C,P)=>P!==e).reduce((C,P)=>C+parseFloat(P.size),0),z=(100-s)/h;return t.map((C,P)=>{if(P===e)return C;const d=parseFloat(C.size)*z;return{...C,size:C.size.includes("%")?`${d}%`:C.size}})}function ut(t,e){if(t.length===0)return t;const n=parseFloat(e);if(!e.includes("%"))return t;const l=n/t.length;return t.map(w=>{if(!w.size.includes("%"))return w;const z=parseFloat(w.size)+l;return{...w,size:`${z}%`}})}function ke(t,e){let n=null,s=0;return function(...w){const h=Date.now();h-s>=e?(t(...w),s=h):(n&&clearTimeout(n),n=setTimeout(()=>{t(...w),s=Date.now()},e-(h-s)))}}function Ie(t,e){let n=null;return function(...l){n&&clearTimeout(n),n=setTimeout(()=>{t(...l)},e)}}function Ae(t,e,n={}){const{onDragStart:s,onDragMove:l,onDragEnd:w}=n,h=c.useRef(null),z=c.useRef(null),C=c.useCallback((b,m)=>{var u,S;m.preventDefault(),m.stopPropagation();const E=m.target;if(E.closest("button")||E.tagName==="BUTTON")return;const D=t.current;if(!D)return;const I=Array.from(D.children),M=(b-1)*2,N=b*2,o=I[M],g=I[N];if(!o||!g||o.classList.contains("a-split-hidden")||g.classList.contains("a-split-hidden"))return;const p="touches"in m?((u=m.touches[0])==null?void 0:u.clientX)??0:m.clientX,r="touches"in m?((S=m.touches[0])==null?void 0:S.clientY)??0:m.clientY,i=Array.from(D.querySelectorAll(".a-split-handlebar")).filter(A=>A.parentElement===D);let a=0;i.forEach(A=>{const L=A,k=window.getComputedStyle(L);if(e==="horizontal"){const j=parseFloat(k.marginLeft)||0,_=parseFloat(k.marginRight)||0;a+=L.offsetWidth+j+_}else{const j=parseFloat(k.marginTop)||0,_=parseFloat(k.marginBottom)||0;a+=L.offsetHeight+j+_}}),h.current={active:!0,paneIndex:b,startX:p,startY:r,prevElement:o,nextElement:g,prevInitialWidth:o.offsetWidth,nextInitialWidth:g.offsetWidth,prevInitialHeight:o.offsetHeight,nextInitialHeight:g.offsetHeight,containerWidth:D.offsetWidth-(e==="horizontal"?a:0),containerHeight:D.offsetHeight-(e==="vertical"?a:0),minPrevSize:parseFloat(o.getAttribute("data-min-size")||"0"),maxPrevSize:parseFloat(o.getAttribute("data-max-size")||"100"),minNextSize:parseFloat(g.getAttribute("data-min-size")||"0"),maxNextSize:parseFloat(g.getAttribute("data-max-size")||"100")},z.current=null,s==null||s({paneIndex:b})},[t,s,e]),P=c.useCallback(b=>{var k,j;const m=h.current;if(!(m!=null&&m.active))return null;const E=e==="horizontal",D="touches"in b?((k=b.touches[0])==null?void 0:k.clientX)??0:b.clientX,I="touches"in b?((j=b.touches[0])==null?void 0:j.clientY)??0:b.clientY,M=E?D-m.startX:I-m.startY,N=E?m.containerWidth:m.containerHeight,o=E?m.prevInitialWidth:m.prevInitialHeight,g=E?m.nextInitialWidth:m.nextInitialHeight;let p=o+M,r=g-M;p<0&&(p=0),r<0&&(r=0);const i=p/N*100,a=r/N*100,u=i<=m.minPrevSize,S=i>=m.maxPrevSize,A=a<=m.minNextSize,L=a>=m.maxNextSize;return u||S||A||L?null:{prevSize:i,nextSize:a,prevSizePx:p,nextSizePx:r,state:m}},[e]),v=c.useCallback(ke(b=>{const m=P(b);if(!m)return;const{prevSize:E,nextSize:D,prevSizePx:I,nextSizePx:M,state:N}=m,{prevInitialWidth:o,prevInitialHeight:g}=N,p=e==="horizontal"?o:g;Math.abs(m.prevSizePx-p)<=1||(z.current={prevSize:E,nextSize:D},requestAnimationFrame(()=>{if(!N.prevElement||!N.nextElement)return;const r=N.prevElement.style.flexBasis.includes("%"),i=N.nextElement.style.flexBasis.includes("%");r?N.prevElement.style.flexBasis=`${E}%`:N.prevElement.style.flexBasis=`${I}px`,i?N.nextElement.style.flexBasis=`${D}%`:N.nextElement.style.flexBasis=`${M}px`}),l==null||l({paneIndex:N.paneIndex,prevSize:E,nextSize:D}))},16),[P,e,l]),d=c.useCallback(b=>{const m=h.current;if(!(m!=null&&m.active))return;const E=P(b);E&&(z.current={prevSize:E.prevSize,nextSize:E.nextSize});const D=z.current;D&&(w==null||w({paneIndex:m.paneIndex,prevSize:D.prevSize,nextSize:D.nextSize})),h.current=null,z.current=null},[P,w]);return c.useEffect(()=>{const b=v,m=d;return window.addEventListener("mousemove",b),window.addEventListener("mouseup",m),window.addEventListener("touchmove",b,{passive:!1}),window.addEventListener("touchend",m),()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",m),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",m)}},[v,d]),{handleMouseDown:C}}function De(t,e,n){const s=c.useCallback(Ie(h=>{if(t)try{const z=`${e}-${n}`,C=h.map(P=>({id:P.id,size:P.size,collapsed:P.collapsed}));localStorage.setItem(z,JSON.stringify(C))}catch(z){console.warn("Failed to save split state to localStorage:",z)}},300),[t,e,n]),l=c.useCallback(()=>{if(!t)return null;try{const h=`${e}-${n}`,z=localStorage.getItem(h);return z?JSON.parse(z):null}catch(h){return console.warn("Failed to load split state from localStorage:",h),null}},[t,e,n]),w=c.useCallback(()=>{if(t)try{const h=`${e}-${n}`;localStorage.removeItem(h)}catch(h){console.warn("Failed to clear split state from localStorage:",h)}},[t,e,n]);return{save:s,load:l,clear:w}}function Fe(t,e,n,s){const l=c.useRef(e),w=c.useRef(n);return l.current=e,w.current=n,c.useMemo(()=>({splitId:t,getState:()=>l.current(),dispatch:z=>w.current(z),getElement:()=>s.current,getPanes:()=>l.current().panes}),[t,s])}const He=c.createContext(0);function ie(){return c.useContext(He)}const Z=({level:t=0,children:e})=>H.jsx(He.Provider,{value:t,children:e});Z.displayName="NestingProvider";function dt(t){const e=n=>{const s=ie();return H.jsx(Z,{level:s+1,children:H.jsx(t,{...n})})};return e.displayName=`withNesting(${t.displayName||t.name||"Component"})`,e}const ae=({index:t,mode:e,disabled:n,lineBar:s,onMouseDown:l,onTouchStart:w,onCollapse:h,onExpand:z,renderCustom:C,leftPaneCollapsed:P=!1,rightPaneCollapsed:v=!1,explicitlyDisabled:d=!1})=>{if(C){const a={index:t,mode:e,disabled:n,lineBar:s,onMouseDown:l,onTouchStart:w||l,onCollapse:h,onExpand:z};return H.jsx("div",{className:"a-split-handlebar",onMouseDown:u=>!n&&l(u),onTouchStart:u=>!n&&(w?w(u):l(u)),children:C(a,t)})}const b=["a-split-handlebar",e==="horizontal"?"a-split-handlebar-horizontal":"a-split-handlebar-vertical",n?"a-split-handlebar-disabled":"",s?"a-split-handlebar-line":""].filter(Boolean).join(" "),m=a=>{a.stopPropagation(),v?z==null||z("right"):h==null||h("left")},E=a=>{a.stopPropagation(),P?z==null||z("left"):h==null||h("right")},D=!s&&!d,I=e==="horizontal",M=P&&!v,N=v&&!P,o=I?"M8 3L4 6L8 9":"M3 8L6 4L9 8",g=I?"M4 3L8 6L4 9":"M3 4L6 8L9 4",p=o,r=g,i=P||v;return H.jsx("div",{className:b,onMouseDown:a=>!n&&l(a),onTouchStart:a=>!n&&l(a),style:{cursor:n?"default":I?"col-resize":"row-resize"},children:D&&H.jsxs(H.Fragment,{children:[H.jsx("button",{className:`a-split-collapse-btn a-split-collapse-btn-${I?"left":"top"}${M?" hidden":""}`,onClick:m,"aria-label":v?`Expand ${I?"right":"bottom"} pane`:`Collapse ${I?"left":"top"} pane`,title:v?`Expand ${I?"right":"bottom"} pane`:`Collapse ${I?"left":"top"} pane`,children:H.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:p,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),H.jsx("div",{className:`a-split-grip-icon${i?" hidden":""}`,"aria-hidden":"true",children:I?H.jsxs("svg",{width:"8",height:"24",viewBox:"0 0 8 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[H.jsx("circle",{cx:"4",cy:"4",r:"2.5",fill:"currentColor"}),H.jsx("circle",{cx:"4",cy:"12",r:"2.5",fill:"currentColor"}),H.jsx("circle",{cx:"4",cy:"20",r:"2.5",fill:"currentColor"})]}):H.jsxs("svg",{width:"24",height:"8",viewBox:"0 0 24 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[H.jsx("circle",{cx:"4",cy:"4",r:"2.5",fill:"currentColor"}),H.jsx("circle",{cx:"12",cy:"4",r:"2.5",fill:"currentColor"}),H.jsx("circle",{cx:"20",cy:"4",r:"2.5",fill:"currentColor"})]})}),H.jsx("button",{className:`a-split-collapse-btn a-split-collapse-btn-${I?"right":"bottom"}${N?" hidden":""}`,onClick:E,"aria-label":P?`Expand ${I?"left":"top"} pane`:`Collapse ${I?"right":"bottom"} pane`,title:P?`Expand ${I?"left":"top"} pane`:`Collapse ${I?"right":"bottom"} pane`,children:H.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:H.jsx("path",{d:r,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})};ae.displayName="DragHandle";function ft(t,e){if(e.includes("vw")){const n=parseFloat(e);return t/100*window.innerWidth*(n/100)}if(e.includes("vh")){const n=parseFloat(e);return t/100*window.innerHeight*(n/100)}if(e.includes("px")){const n=parseFloat(e);return t/100*n}return e.includes("%")?(console.warn("Percentage reference not fully supported, assuming viewport"),t/100*window.innerWidth*(parseFloat(e)/100)):t/100*parseFloat(e)}function ht(t,e){if(e.includes("vw")){const n=parseFloat(e),s=window.innerWidth*(n/100);return t/s*100}if(e.includes("vh")){const n=parseFloat(e),s=window.innerHeight*(n/100);return t/s*100}if(e.includes("px")){const n=parseFloat(e);return t/n*100}if(e.includes("%")){console.warn("Percentage reference not fully supported, assuming viewport");const n=window.innerWidth*(parseFloat(e)/100);return t/n*100}return t/parseFloat(e)*100}function pt(t,e,n){const s=parseFloat(t);return t.includes("%")?n==="px"?`${s/100*e}px`:t:t.includes("px")?n==="%"?`${s/e*100}%`:t:n==="px"?`${s}px`:`${s/e*100}%`}function B(t){const e=parseFloat(t);return t.includes("%")?{value:e,unit:"%"}:t.includes("px")?{value:e,unit:"px"}:t.includes("vw")?{value:e,unit:"vw"}:t.includes("vh")?{value:e,unit:"vh"}:t.includes("fr")?{value:e,unit:"fr"}:{value:e,unit:"px"}}function gt(t,e){const n=B(t),s=B(e);return n.unit===s.unit}function mt(t,e,n,s){return`${Math.max(e,Math.min(n,t))}${s}`}function St(t){if(t.length===0)return{total:0,unit:"px"};const e=t[0];if(!e)return{total:0,unit:"px"};const n=B(e.size);let s=0;for(const l of t){const w=B(l.size);w.unit===n.unit||console.warn(`Mixed units detected: ${n.unit} and ${w.unit}. Results may be inaccurate.`),s+=w.value}return{total:s,unit:n.unit}}function zt(t,e){const n=[];if(t.length===0)return n.push("No panes defined"),{valid:!1,errors:n};const s=t.filter(l=>l.size.includes("%"));if(s.length>0){const l=s.reduce((w,h)=>w+parseFloat(h.size),0);l>100.1&&n.push(`Total percentage (${l}%) exceeds 100%`)}return t.forEach((l,w)=>{l.minSize<0&&n.push(`Pane ${w}: minSize cannot be negative`),l.maxSize<l.minSize&&n.push(`Pane ${w}: maxSize (${l.maxSize}) less than minSize (${l.minSize})`),l.maxSize>100&&n.push(`Pane ${w}: maxSize (${l.maxSize}%) exceeds 100%`)}),{valid:n.length===0,errors:n}}function Re(t,e){const n=B(t);switch(n.unit){case"%":return t;case"px":return t;case"vw":return`${n.value/100*window.innerWidth}px`;case"vh":return`${n.value/100*window.innerHeight}px`;case"fr":return"0";default:return`${n.value}px`}}function Ne(t,e=!1){if(e)return{flexGrow:0,flexShrink:0};const n=B(t.size);return n.unit==="%"?{flexGrow:1,flexShrink:1}:n.unit==="fr"?{flexGrow:n.value,flexShrink:1}:{flexGrow:0,flexShrink:0}}function wt(t,e,n){const s=B(t);return s.unit==="%"?s.value/100*e:s.unit==="px"?s.value:s.unit==="vw"?s.value/100*window.innerWidth:s.unit==="vh"?s.value/100*window.innerHeight:s.value}const xt=11;function bt(t,e,n=0){const s=t.offsetWidth,l=t.offsetHeight,w=e==="horizontal"?s:l,h=n*xt,z=w-h;return{width:s,height:l,primary:w,availableForPanes:z}}function yt(t){const e=t.filter(l=>l.size.includes("%"));if(e.length===0)return t;const n=e.reduce((l,w)=>l+parseFloat(w.size),0);if(Math.abs(n-100)<.01)return t;const s=100/n;return t.map(l=>{if(!l.size.includes("%"))return l;const h=parseFloat(l.size)*s;return{...l,size:`${h}%`}})}function Pt(t,e,n){const s=e+n;return!(s<t.minSize||s>t.maxSize)}function vt(t){return t==="horizontal"?"width":"height"}function Ct(t){return t==="horizontal"?"clientX":"clientY"}const oe=({id:t,size:e,collapsed:n,minSize:s,maxSize:l,mode:w,content:h,flexGrow:z})=>{const C=e||"100%",P={size:C},{flexGrow:v,flexShrink:d}=Ne(P,n),b=z!==void 0?z:v,m=n?"0":Re(C);return H.jsx("div",{"data-pane-id":t,"data-min-size":s,"data-max-size":l,className:`a-split-pane${n?" a-split-hidden":""}`,style:{flexBasis:m,flexGrow:b,flexShrink:d,overflow:n?"hidden":"auto"},children:h})};oe.displayName="Pane";class Le{constructor(e){te(this,"plugins",[]);te(this,"context");this.context=e}registerPlugins(e){this.plugins=e,this.plugins.forEach(n=>{n.onInit&&n.onInit(this.context)})}destroy(){this.plugins.forEach(e=>{e.onDestroy&&e.onDestroy(this.context)}),this.plugins=[]}onPaneAdd(e){this.plugins.forEach(n=>{n.onPaneAdd&&n.onPaneAdd(e,this.context)})}onPaneRemove(e){this.plugins.forEach(n=>{n.onPaneRemove&&n.onPaneRemove(e,this.context)})}onPaneCollapse(e){this.plugins.forEach(n=>{n.onPaneCollapse&&n.onPaneCollapse(e,this.context)})}onPaneExpand(e){this.plugins.forEach(n=>{n.onPaneExpand&&n.onPaneExpand(e,this.context)})}onDragStart(e){this.plugins.forEach(n=>{n.onDragStart&&n.onDragStart(e,this.context)})}onDragMove(e){let n=!0;for(const s of this.plugins)s.onDragMove&&s.onDragMove(e,this.context)===!1&&(n=!1);return n}onDragEnd(e){this.plugins.forEach(n=>{n.onDragEnd&&n.onDragEnd(e,this.context)})}onResize(e){this.plugins.forEach(n=>{n.onResize&&n.onResize(e,this.context)})}renderHandle(e){for(const n of this.plugins)if(n.renderHandle){const s=n.renderHandle(e,this.context);if(s)return s}return null}renderPane(e){for(const n of this.plugins)if(n.renderPane){const s=n.renderPane(e,this.context);if(s)return s}return null}getPlugins(){return this.plugins}getPlugin(e){return this.plugins.find(n=>n.name===e)}hasPlugin(e){return this.plugins.some(n=>n.name===e)}}const le=c.forwardRef((t,e)=>{const{id:n,mode:s="horizontal",initialSizes:l=[],minSizes:w=[],maxSizes:h=[],collapsed:z=[],disable:C=!1,visible:P=!0,lineBar:v=!1,renderBar:d,plugins:b=[],enableSessionStorage:m=!1,width:E=null,height:D=null,className:I="",style:M={},fixClass:N=!1,children:o,onDragging:g,onDragEnd:p,onLayoutChange:r}=t,i=c.useRef(`split-${Math.random().toString(36).slice(2,11)}`),a=n||i.current,u=c.useRef(null),S=c.useRef(null),A=ie(),L=!N&&A>2;c.useEffect(()=>{var y,x;if(typeof globalThis<"u"&&((x=(y=globalThis.process)==null?void 0:y.env)==null?void 0:x.NODE_ENV)!=="production"){if(l.length>0){const $=c.Children.toArray(o);l.length!==$.length&&console.warn(`[Split] initialSizes length (${l.length}) doesn't match children count (${$.length})`),l.forEach((R,G)=>{if(typeof R=="string"){const W=parseFloat(R);if(isNaN(W)&&console.warn(`[Split] Invalid size at index ${G}: "${R}". Expected format: "50%", "100px", etc.`),R.includes("%")){const J=parseFloat(R);(J<0||J>100)&&console.warn(`[Split] Size at index ${G} is out of range: "${R}". Percentage should be 0-100.`)}}});const F=l.reduce((R,G)=>typeof G=="string"&&G.includes("%")?R+parseFloat(G):R,0);F>100&&console.warn(`[Split] Total percentage (${F}%) exceeds 100%. Sizes will be normalized.`)}if((w.length>0||h.length>0)&&(w.forEach(($,F)=>{const R=h[F];R!==void 0&&$>R&&console.warn(`[Split] minSize (${$}) is greater than maxSize (${R}) at index ${F}`),($<0||$>100)&&console.warn(`[Split] minSize at index ${F} is out of range: ${$}. Should be 0-100.`)}),h.forEach(($,F)=>{($<0||$>100)&&console.warn(`[Split] maxSize at index ${F} is out of range: ${$}. Should be 0-100.`)})),z.length>0){const $=c.Children.toArray(o);z.length!==$.length&&console.warn(`[Split] collapsed length (${z.length}) doesn't match children count (${$.length})`)}}},[l,w,h,z,o]);const{panes:k,addPane:j,removePane:_,togglePane:q,setPaneSize:V,getPaneState:ce,removePanes:ue,swapPanes:de,collapsePane:X,expandPane:Y,resizePane:fe}=$e(o,l,z,w,h,a),[T,he]=c.useState(null);c.useEffect(()=>(T&&T.active?(document.body.classList.add("a-split-body-dragging"),document.body.classList.add(s==="horizontal"?"a-split-body-dragging-horizontal":"a-split-body-dragging-vertical")):(document.body.classList.remove("a-split-body-dragging"),document.body.classList.remove("a-split-body-dragging-horizontal"),document.body.classList.remove("a-split-body-dragging-vertical")),()=>{document.body.classList.remove("a-split-body-dragging"),document.body.classList.remove("a-split-body-dragging-horizontal"),document.body.classList.remove("a-split-body-dragging-vertical")}),[T,s]);const Be=c.useCallback(()=>({panes:k,mode:s,dragState:T}),[k,s,T]),qe=c.useCallback(f=>{switch(f.type){case"ADD_PANE":j(f.payload);break;case"REMOVE_PANE":_(f.payload);break;case"TOGGLE_PANE":q(f.payload);break;case"SET_PANE_SIZE":V(f.payload.index,f.payload.size);break;case"RESTORE_STATE":f.payload.panes.forEach((y,x)=>{V(x,y.size),y.collapsed&&q(x)});break;case"ADJUST_PANE_SIZE":if(f.payload&&(T==null?void 0:T.paneIndex)!=null){const y=T.paneIndex,x=k[y];if(x){const $=parseFloat(x.size),F=f.payload.direction==="grow"?f.payload.amount:-f.payload.amount,R=Math.max(x.minSize||0,Math.min(x.maxSize||100,$+F));V(y,`${R}%`)}}break}},[j,_,q,V,k,T]),pe=Fe(a,Be,qe,u);c.useEffect(()=>{if(b.length>0)return S.current=new Le(pe),S.current.registerPlugins(b),()=>{var f;(f=S.current)==null||f.destroy(),S.current=null}},[b,pe]);const Q=De(m,`split-state-${a}`,s);c.useEffect(()=>{const f=Q.load();f&&f.length===k.length&&f.forEach((y,x)=>{k[x]&&y.id===k[x].id&&(V(x,y.size),y.collapsed!==k[x].collapsed&&q(x))})},[]),c.useEffect(()=>{Q.save(k)},[k,Q]);const ge=c.useRef(!0),me=c.useRef(c.Children.count(o)),K=c.useRef(l);c.useEffect(()=>{if(!u.current||l.length===0)return;const f=c.Children.count(o),y=f!==me.current,x=l.length!==K.current.length||l.some(($,F)=>$!==K.current[F]);(ge.current||y||x)&&(l.forEach(($,F)=>{V(F,$)}),ge.current=!1,me.current=f,K.current=l)},[o,l]);const ee=c.useRef(z);c.useEffect(()=>{!u.current||!z.some((y,x)=>y!==ee.current[x])&&ee.current.length===z.length||(ee.current=z,z.forEach((y,x)=>{const $=k[x];$&&$.collapsed!==y&&(y?X(x):Y(x))}))},[z,k,X,Y]),c.useEffect(()=>{u.current&&k.forEach((f,y)=>{var $;const x=($=u.current)==null?void 0:$.querySelector(`[data-pane-id="${f.id}"]`);if(x){const F=w[y],R=h[y];F!==void 0&&x.setAttribute("data-min-size",String(w[y])),R!==void 0&&x.setAttribute("data-max-size",String(h[y]))}})},[w,h,k]),c.useEffect(()=>{if(!u.current)return;u.current.querySelectorAll(".a-split-handlebar").forEach((y,x)=>{const $=y,F=x+1;ne(F,C)?($.classList.add("a-split-handlebar-disabled"),$.style.cursor="default"):($.classList.remove("a-split-handlebar-disabled"),$.style.cursor=s==="horizontal"?"col-resize":"row-resize");const G=re(F,P);$.style.display=G?"":"none",se(F,v)?$.classList.add("a-split-handlebar-line"):$.classList.remove("a-split-handlebar-line")})},[C,P,v,s]);const{handleMouseDown:Se}=Ae(u,s,{onDragStart:f=>{var x;he({active:!0,paneIndex:f.paneIndex}),(x=S.current)==null||x.onDragStart(f);const y=k[f.paneIndex];y&&(r==null||r(f.paneIndex,y.id,"dragging",null))},onDragMove:f=>{var x;(((x=S.current)==null?void 0:x.onDragMove(f))??!0)&&(g==null||g(f.prevSize,f.nextSize,f.paneIndex))},onDragEnd:f=>{var x;V(f.paneIndex-1,`${f.prevSize}%`),V(f.paneIndex,`${f.nextSize}%`),he(null),(x=S.current)==null||x.onDragEnd(f),p==null||p(f.prevSize,f.nextSize,f.paneIndex);const y=k[f.paneIndex];y&&(r==null||r(f.paneIndex,y.id,"dragged",null))}}),Oe=c.useCallback((f,y)=>{var $;const x=y==="left"?f-1:f;if(x>=0&&x<k.length){X(x,{direction:y});const F=k[x];F&&(($=S.current)==null||$.onPaneCollapse({pane:F,index:x,direction:y}),r==null||r(x,F.id,"close",y))}},[k,X,r]),Xe=c.useCallback((f,y)=>{var $;const x=y==="left"?f-1:f;if(x>=0&&x<k.length){Y(x,{direction:y});const F=k[x];F&&(($=S.current)==null||$.onPaneExpand({pane:F,index:x,direction:y}),r==null||r(x,F.id,"open",y))}},[k,Y,r]);c.useImperativeHandle(e,()=>({addPane:j,removePane:_,togglePane:q,setPaneSize:V,getPaneState:ce,removePanes:ue,swapPanes:de,collapsePane:X,expandPane:Y,resizePane:fe,getSnapshot:()=>{const f=u.current,y=f?s==="horizontal"?f.offsetWidth:f.offsetHeight:0;return{panes:k.map(x=>({...x})),totalSize:y,mode:s,timestamp:Date.now()}},restore:f=>{if(f.mode!==s){console.warn(`Cannot restore snapshot with different mode. Current: ${s}, Snapshot: ${f.mode}`);return}f.panes.forEach((y,x)=>{k[x]&&(V(x,y.size),y.collapsed!==k[x].collapsed&&q(x))})}}),[j,_,q,V,ce,ue,de,X,Y,fe,k,s]);const Ye=c.useMemo(()=>({display:"flex",flexDirection:s==="horizontal"?"row":"column",width:E||"100%",height:D||"100%",overflow:"hidden",...M}),[s,E,D,M]),Ue=c.useMemo(()=>{const f=["a-split-container"];return s==="vertical"&&f.push("a-split-vertical"),(N||L)&&f.push("a-split-fix"),T!=null&&T.active&&f.push("a-split-dragging"),I&&f.push(I),f.join(" ")},[s,N,L,I,T==null?void 0:T.active]),We=()=>{const f=[];return k.forEach((y,x)=>{var F;const $=H.jsx(Z,{level:A+1,children:y.content});if(f.push(H.jsx(oe,{id:y.id,size:y.size,collapsed:y.collapsed,minSize:y.minSize,maxSize:y.maxSize,mode:s,content:$,flexGrow:y.flexGrow},y.id)),x<k.length-1){const R=x+1,G=k[x+1];if(!G)return;const W=Ee(),J=re(R,P),ze=se(R,v),we=y.collapsed||!1,xe=G.collapsed||!1,be=ne(R,C),ye=be||we||xe;if(J&&W){const Pe=(F=S.current)==null?void 0:F.renderHandle({index:R,mode:s,disabled:ye,lineBar:ze,onMouseDown:O=>Se(R,O)});Pe?f.push(H.jsx(c.Fragment,{children:Pe},`handlebar-${R}`)):f.push(H.jsx(ae,{index:R,mode:s,disabled:ye,lineBar:ze,explicitlyDisabled:be,onMouseDown:O=>Se(R,O),onCollapse:O=>Oe(R,O),onExpand:O=>Xe(R,O),renderCustom:d,leftPaneCollapsed:we,rightPaneCollapsed:xe},`handlebar-${R}`))}}}),f};return H.jsx("div",{ref:u,id:a,className:Ue,style:Ye,children:We()})});le.displayName="Split";function Et(t={}){const{mode:e="horizontal",initialPanes:n=[],initialSizes:s=[],minSizes:l=[],maxSizes:w=[],onPaneChange:h}=t,[z,C]=c.useState(()=>n.length>0?n:s.map((r,i)=>({id:`pane-${i}`,size:r,collapsed:!1,minSize:l[i]||0,maxSize:w[i]||100,content:null}))),[P]=c.useState(!1),v=c.useRef(!1),d=c.useCallback(r=>{C(i=>{const a=typeof r=="function"?r(i):r;return!v.current&&h&&h(a),a})},[h]),b=c.useCallback(r=>{d(i=>{const a=r.position??i.length,u={id:`pane-${Date.now()}`,size:r.size,collapsed:r.collapsed||!1,minSize:r.minSize||0,maxSize:r.maxSize||100,content:r.content},S=[...i];return S.splice(a,0,u),S})},[d]),m=c.useCallback(r=>{d(i=>{if(r<0||r>=i.length)return i;const a=[...i],u=a.splice(r,1)[0];if(u&&a.length>0){const A=(parseFloat(u.size)||0)/a.length;return a.map(L=>({...L,size:`${(parseFloat(L.size)||0)+A}%`}))}return a})},[d]),E=c.useCallback(r=>{d(i=>{const a=[...r].sort((A,L)=>L-A);let u=[...i],S=0;if(a.forEach(A=>{if(A>=0&&A<u.length){const L=u.splice(A,1)[0];L&&(S+=parseFloat(L.size)||0)}}),u.length>0&&S>0){const A=S/u.length;u=u.map(L=>({...L,size:`${(parseFloat(L.size)||0)+A}%`}))}return u})},[d]),D=c.useCallback(r=>{d(i=>{if(r<0||r>=i.length)return i;const a=i[r];if(!a)return i;const u=[...i];return u[r]={...a,collapsed:!a.collapsed},u})},[d]),I=c.useCallback(r=>{d(i=>{if(r<0||r>=i.length)return i;const a=i[r];if(!a||a.collapsed)return i;const u=[...i];return u[r]={...a,collapsed:!0},u})},[d]),M=c.useCallback(r=>{d(i=>{if(r<0||r>=i.length)return i;const a=i[r];if(!a||!a.collapsed)return i;const u=[...i];return u[r]={...a,collapsed:!1},u})},[d]),N=c.useCallback((r,i,a)=>{d(u=>{if(r<0||r>=u.length)return u;const S=u[r];if(!S)return u;const A=[...u];return A[r]={...S,size:i},A})},[d]),o=c.useCallback((r,i)=>{d(a=>{if(r<0||r>=a.length||i<0||i>=a.length||r===i)return a;const u=[...a],S=u[r];return u[r]=u[i],u[i]=S,u})},[d]),g=c.useCallback(()=>({panes:z.map(r=>({...r})),totalSize:0,mode:e,timestamp:Date.now()}),[z,e]),p=c.useCallback(r=>{if(r.mode!==e){console.warn(`Cannot restore snapshot with different mode. Current: ${e}, Snapshot: ${r.mode}`);return}v.current=!0,d(i=>r.panes.map((a,u)=>{const S=i.find(A=>A.id===a.id)||i[u];return{id:a.id,size:a.size,collapsed:a.collapsed,minSize:(S==null?void 0:S.minSize)??0,maxSize:(S==null?void 0:S.maxSize)??100,content:(S==null?void 0:S.content)??null}})),v.current=!1,h&&C(i=>(h(i),i))},[e,d,h]);return c.useMemo(()=>({panes:z,mode:e,isDragging:P,addPane:b,removePane:m,removePanes:E,togglePane:D,collapsePane:I,expandPane:M,setPaneSize:N,swapPanes:o,setPanes:d,getSnapshot:g,restore:p}),[z,e,P,b,m,E,D,I,M,N,o,d,g,p])}function $t(t){return t}function kt(t={}){const{storage:e="localStorage",key:n,debounceDelay:s=300}=t;let l=null;const w=v=>n||`a-multilayout-splitter:${v}`,h=()=>typeof window>"u"?null:e==="localStorage"?window.localStorage:window.sessionStorage,z=(v,d)=>{const b=h();if(b)try{const m=w(v),E=JSON.stringify({panes:d.panes.map(D=>({id:D.id,size:D.size,collapsed:D.collapsed})),mode:d.mode,timestamp:Date.now()});b.setItem(m,E)}catch(m){console.error("Failed to save split state:",m)}},C=v=>{const d=h();if(!d)return null;try{const b=w(v),m=d.getItem(b);return m?JSON.parse(m):null}catch(b){return console.error("Failed to load split state:",b),null}},P=(v,d)=>{l&&clearTimeout(l),l=setTimeout(()=>{z(v,d),l=null},s)};return{name:"persistence",version:"1.0.0",onInit(v){const d=C(v.splitId),b=d==null?void 0:d.panes;b&&b.length>0?setTimeout(()=>{v.getState().panes.length===b.length&&v.dispatch({type:"RESTORE_STATE",payload:{panes:b}})},0):setTimeout(()=>{const m=v.getState();z(v.splitId,m)},0)},onDragEnd(v,d){setTimeout(()=>{const b=d.getState();P(d.splitId,b)},0)},onPaneAdd(v,d){setTimeout(()=>{const b=d.getState();P(d.splitId,b)},0)},onPaneRemove(v,d){setTimeout(()=>{const b=d.getState();P(d.splitId,b)},0)},onPaneCollapse(v,d){setTimeout(()=>{const b=d.getState();P(d.splitId,b)},0)},onPaneExpand(v,d){setTimeout(()=>{const b=d.getState();P(d.splitId,b)},0)},onDestroy(){l&&(clearTimeout(l),l=null)}}}function It(t,e="localStorage"){const n=e==="localStorage"?window.localStorage:window.sessionStorage;try{const s=`a-multilayout-splitter:${t}`;n.removeItem(s)}catch(s){console.error("Failed to clear persisted state:",s)}}function At(t={}){const{enableArrowKeys:e=!0,enableNumberKeys:n=!0,stepSize:s=5,enableTabNavigation:l=!0}=t;let w=0,h=null;const z=(C,P)=>{if(!C)return;const d=C.querySelectorAll(".a-split-pane")[P];d&&(d.focus(),d.setAttribute("tabindex","0"),w=P)};return{name:"keyboard",version:"1.0.0",onInit(C){const P=C.getElement();if(!P)return;P.setAttribute("tabindex","0"),P.querySelectorAll(".a-split-pane").forEach((d,b)=>{d.setAttribute("tabindex",b===0?"0":"-1")}),h=d=>{const b=C.getState(),m=b.panes;if(e&&(d.key==="ArrowLeft"||d.key==="ArrowRight"||d.key==="ArrowUp"||d.key==="ArrowDown")){d.preventDefault();const E=b.mode==="horizontal",D=E&&d.key==="ArrowRight"||!E&&d.key==="ArrowDown",I=w,M=m[I],N=I<m.length-1?I+1:I-1,o=m[N];if(!M||!o)return;const g=parseFloat(M.size),p=parseFloat(o.size),r=D?s:-s;let i=g+r,a=p-r;const u=M.minSize||0,S=M.maxSize||100,A=o.minSize||0,L=o.maxSize||100;i=Math.max(u,Math.min(S,i)),a=Math.max(A,Math.min(L,a));const k=g+p;i+a!==k&&(i===u||i===S?a=k-i:i=k-a),C.dispatch({type:"SET_PANE_SIZE",payload:{index:I,size:`${i}%`}}),C.dispatch({type:"SET_PANE_SIZE",payload:{index:N,size:`${a}%`}})}if(n){const E=parseInt(d.key,10);if(!isNaN(E)&&E>=1&&E<=9){const D=E-1;D<m.length&&z(P,D)}}if(l&&d.key==="Tab"){d.preventDefault();let E=d.shiftKey?w-1:w+1;E<0?E=m.length-1:E>=m.length&&(E=0),z(P,E)}},P.addEventListener("keydown",h)},onDestroy(C){const P=C.getElement();P&&h&&(P.removeEventListener("keydown",h),h=null)}}}function Dt(t,e){return{name:"custom-handle",version:"1.0.0",renderHandle(n){return c.createElement(t,{...n,...e})}}}function Ft(t){return{name:"custom-handle-render",version:"1.0.0",renderHandle(e){return t(e)}}}const Me=c.createContext(null),Te=c.createContext(null),je=c.createContext(null);function Ht({id:t,mode:e="horizontal",enableSessionStorage:n=!1,storageKey:s=`split-state-${t}`,children:l,_panes:w=[],_addPane:h,_removePane:z,_togglePane:C,_setPaneSize:P,_getPaneState:v}){const d=c.useRef({isDragging:!1,activeHandlebar:null}),b=c.useMemo(()=>({id:t,mode:e,enableSessionStorage:n,storageKey:s}),[t,e,n,s]),m=c.useMemo(()=>({panes:w,isDragging:d.current.isDragging,activeHandlebar:d.current.activeHandlebar}),[w,d.current.isDragging,d.current.activeHandlebar]),E=c.useMemo(()=>({addPane:h||(()=>console.warn("addPane not available")),removePane:z||(()=>console.warn("removePane not available")),togglePane:C||(()=>console.warn("togglePane not available")),setPaneSize:P||(()=>console.warn("setPaneSize not available")),getPaneState:v||(()=>[]),setDragging:(D,I)=>{d.current.isDragging=D,d.current.activeHandlebar=I??null}}),[h,z,C,P,v]);return H.jsx(Me.Provider,{value:b,children:H.jsx(Te.Provider,{value:m,children:H.jsx(je.Provider,{value:E,children:l})})})}function Ve(){const t=c.useContext(Me);if(!t)throw new Error("useSplitConfig must be used within SplitProvider");return t}function U(){const t=c.useContext(Te);if(!t)throw new Error("useSplitState must be used within SplitProvider");return t}function Ge(){return c.useContext(je)}function Rt(){const t=Ge();if(!t)throw new Error("useSplit must be used within SplitProvider");return{config:Ve(),state:U(),actions:t}}function _e(t){const{panes:e}=U();return e[t]}function Nt(){const{panes:t}=U();return t.length}function Lt(){const{isDragging:t}=U();return t}function Mt(t){const e=_e(t);return(e==null?void 0:e.collapsed)??!1}function Tt(){const{panes:t}=U();return c.useMemo(()=>t.filter(e=>!e.collapsed),[t])}exports.DragHandle=ae;exports.NestingProvider=Z;exports.PaneComponent=oe;exports.PluginManager=Le;exports.Split=le;exports.SplitProvider=Ht;exports.animatePaneSize=ve;exports.applyCollapseState=Qe;exports.batchUpdatePanes=at;exports.calculateFlexBasis=Re;exports.calculateFlexValues=Ne;exports.calculateHandlebarPosition=wt;exports.calculateTotalSize=St;exports.canResize=Pt;exports.clampSize=mt;exports.clearPersistedState=It;exports.constrainSize=rt;exports.createPane=st;exports.createPlugin=$t;exports.customHandlePlugin=Dt;exports.customHandleRenderPlugin=Ft;exports.debounce=Ie;exports.default=le;exports.findPaneIndex=et;exports.getAxisProperty=vt;exports.getContainerDimensions=bt;exports.getCoordinateProperty=Ct;exports.getPaneElement=nt;exports.getVisiblePanes=tt;exports.haveSameUnit=gt;exports.isHandlebarDisabled=ne;exports.isHandlebarVisible=re;exports.isLineBarStyle=se;exports.isPaneVisible=Ce;exports.keyboardPlugin=At;exports.normalizePaneSizes=yt;exports.normalizeSize=pt;exports.parseSize=B;exports.percentageToPixel=ft;exports.persistencePlugin=kt;exports.pixelToPercentage=ht;exports.restorePaneState=ot;exports.serializePaneState=lt;exports.shouldShowHandlebar=Ee;exports.throttle=ke;exports.togglePaneCollapse=Ke;exports.updatePaneSize=it;exports.useDragHandler=Ae;exports.useIsCollapsed=Mt;exports.useIsDragging=Lt;exports.useNestingLevel=ie;exports.usePane=_e;exports.usePaneCount=Nt;exports.usePaneManager=$e;exports.usePersistence=De;exports.usePluginContext=Fe;exports.useSplit=Rt;exports.useSplitActions=Ge;exports.useSplitConfig=Ve;exports.useSplitController=Et;exports.useSplitState=U;exports.useVisiblePanes=Tt;exports.validatePaneSizes=zt;exports.withNesting=dt;
|
|
1
|
+
"use strict";var We=Object.defineProperty;var Ze=(t,e,n)=>e in t?We(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var te=(t,e,n)=>Ze(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react/jsx-runtime"),u=require("react");function Qe(t,e){e?(t.classList.add("a-split-hidden"),t.style.flexGrow="0",t.style.flexShrink="0",t.style.flexBasis="0"):(t.classList.remove("a-split-hidden"),t.style.flexGrow="",t.style.flexShrink="")}function ye(t,e,n={}){return new Promise(r=>{const a=n.duration||300;if(!n.animate){t.style.flexBasis=e,r();return}t.style.transition=`flex-basis ${a}ms ease`,t.offsetHeight,t.style.flexBasis=e,setTimeout(()=>{t.style.transition="",r()},a)})}function Ke(t){return{...t,collapsed:!t.collapsed}}function et(t,e){return t.findIndex(n=>n.id===e)}function ve(t){return!t.collapsed}function tt(t){return t.filter(ve)}function nt(t){return document.querySelector(`[data-pane-id="${t}"]`)}function st(t,e,n){return Math.max(e,Math.min(n,t))}function rt(t,e,n,r={}){return{id:t,size:e,content:n,collapsed:r.collapsed??!1,minSize:r.minSize??0,maxSize:r.maxSize??100}}function it(t,e){return{...t,size:e}}function ot(t,e){return t.map(n=>{const r=e.get(n.id);return r?{...n,...r}:n})}function at(t,e){return{...t,size:e.size,collapsed:e.collapsed}}function lt(t){return{id:t.id,size:t.size,collapsed:t.collapsed}}function $e(t,e){return!0}function ne(t,e){return typeof e=="boolean"?e:Array.isArray(e)?e.length>0&&typeof e[0]=="boolean"?e[t-1]===!0:e.includes(t):!1}function se(t,e){return typeof e=="boolean"?e:Array.isArray(e)?e.length>0&&typeof e[0]=="boolean"?e[t-1]!==!1:e.includes(t):!0}function re(t,e){return typeof e=="boolean"?e:Array.isArray(e)?e.length>0&&typeof e[0]=="boolean"?e[t-1]===!0:e.includes(t):!1}function Ce(t,e=[],n=[],r=[],a=[],w="split"){const[p,m]=u.useState(()=>u.Children.toArray(t).map((d,s)=>({id:`${w}-pane-${s}`,size:e[s]||"100%",collapsed:n[s]||!1,minSize:r[s]||0,maxSize:a[s]||100}))),v=u.Children.toArray(t);if(v.length!==p.length){if(v.length>p.length){const l=[...p];for(let d=p.length;d<v.length;d++)l.push({id:`${w}-pane-${Date.now()}-${d}`,size:e[d]||"100%",collapsed:n[d]||!1,minSize:r[d]||0,maxSize:a[d]||100});setTimeout(()=>m(l),0)}else if(v.length<p.length){const l=p.slice(0,v.length);setTimeout(()=>m(l),0)}}const b=p.map((l,d)=>({...l,content:v[d]})),$=u.useCallback(l=>{m(d=>{const s=l.position??d.length,i={id:`${w}-pane-${Date.now()}`,size:l.size,collapsed:l.collapsed||!1,minSize:l.minSize||0,maxSize:l.maxSize||100},o=[...d];return o.splice(s,0,i),ct(o,s,l.size)})},[w]),c=u.useCallback(l=>{m(d=>{if(l<0||l>=d.length)return d;const s=[...d],i=s.splice(l,1)[0];return i?ut(s,i.size):s})},[]),x=u.useCallback(l=>{m(d=>{if(l<0||l>=d.length)return d;const s=d[l];if(!s)return d;const i=[...d];i[l]={...s,collapsed:!s.collapsed};const o=document.querySelector(`[data-pane-id="${s.id}"]`);if(o){const f=i[l];(f==null?void 0:f.collapsed)??!1?(o.classList.add("a-split-hidden"),o.style.flexGrow="0"):(o.classList.remove("a-split-hidden"),o.style.flexGrow="")}return i})},[]),g=u.useCallback((l,d,s)=>{m(i=>{if(l<0||l>=i.length)return i;const o=i[l];if(!o)return i;const f=[...i];f[l]={...o,size:d,flexGrow:void 0};const S=document.querySelector(`[data-pane-id="${o.id}"]`);return S&&ye(S,d,s||{animate:!1}),f})},[]),E=u.useCallback(()=>b,[b]),F=u.useCallback(l=>{m(d=>{const s=[...l].sort((f,S)=>S-f);let i=[...d],o=0;if(s.forEach(f=>{if(f>=0&&f<i.length){const S=i.splice(f,1)[0];S&&(o+=parseFloat(S.size)||0)}}),i.length>0&&o>0){const f=o/i.length;i=i.map(S=>({...S,size:`${(parseFloat(S.size)||0)+f}%`}))}return i})},[]),I=u.useCallback((l,d)=>{m(s=>{if(l<0||l>=s.length||d<0||d>=s.length||l===d)return s;const i=[...s],o=i[l];return i[l]=i[d],i[d]=o,i})},[]),L=u.useCallback((l,d)=>{m(s=>{if(l<0||l>=s.length)return s;const i=s[l];if(!i||i.collapsed)return s;const o=d==null?void 0:d.direction;let f;o==="left"?f=l+1:o==="right"?f=l-1:f=l<s.length-1?l+1:l-1;const S=s.map((y,D)=>D===l?{...y,collapsed:!0,flexGrow:0}:D===f&&!y.collapsed?{...y,flexGrow:1}:y.collapsed?y:{...y,flexGrow:0});if(d!=null&&d.animate){const y=document.querySelector(`[data-pane-id="${i.id}"]`);y&&(y.style.transition=`flex-basis ${d.duration||300}ms ease`,setTimeout(()=>{y.style.transition=""},d.duration||300))}return S})},[]),T=u.useCallback((l,d)=>{m(s=>{if(l<0||l>=s.length)return s;const i=s[l];if(!i||!i.collapsed)return s;const o=s.filter(y=>!y.collapsed).length+1,f=s.length;let S=[...s];if(S[l]={...i,collapsed:!1,flexGrow:void 0},o===f)S=S.map(y=>({...y,flexGrow:void 0}));else{const y=d==null?void 0:d.direction;let D;if(y==="left"?D=l+1:y==="right"?D=l-1:D=l<s.length-1?l+1:l-1,D>=0&&D<S.length){const C=S[D];C&&C.flexGrow===1&&(S[D]={...C,flexGrow:void 0})}}if(d!=null&&d.animate){const y=document.querySelector(`[data-pane-id="${i.id}"]`);y&&(y.style.transition=`flex-basis ${d.duration||300}ms ease`,setTimeout(()=>{y.style.transition=""},d.duration||300))}return S})},[]),A=u.useCallback((l,d)=>{m(s=>{if(l<0||l>=s.length)return s;const i=s[l];if(!i)return s;const o=parseFloat(i.size)||0,f=Math.max(i.minSize||0,Math.min(i.maxSize||100,o+d)),S=[...s];S[l]={...i,size:`${f}%`};const y=document.querySelector(`[data-pane-id="${i.id}"]`);return y&&(y.style.flexBasis=`${f}%`),S})},[]);return{panes:b,addPane:$,removePane:c,togglePane:x,setPaneSize:g,getPaneState:E,removePanes:F,swapPanes:I,collapsePane:L,expandPane:T,resizePane:A}}function ct(t,e,n){const r=parseFloat(n);if(!n.includes("%"))return t;const p=t.filter((v,b)=>b!==e).reduce((v,b)=>v+parseFloat(b.size),0),m=(100-r)/p;return t.map((v,b)=>{if(b===e)return v;const c=parseFloat(v.size)*m;return{...v,size:v.size.includes("%")?`${c}%`:v.size}})}function ut(t,e){if(t.length===0)return t;const n=parseFloat(e);if(!e.includes("%"))return t;const a=n/t.length;return t.map(w=>{if(!w.size.includes("%"))return w;const m=parseFloat(w.size)+a;return{...w,size:`${m}%`}})}function Ee(t,e){let n=null,r=0;return function(...w){const p=Date.now();p-r>=e?(t(...w),r=p):(n&&clearTimeout(n),n=setTimeout(()=>{t(...w),r=Date.now()},e-(p-r)))}}function ke(t,e){let n=null;return function(...a){n&&clearTimeout(n),n=setTimeout(()=>{t(...a)},e)}}function Ie(t,e,n={}){const{onDragStart:r,onDragMove:a,onDragEnd:w}=n,p=u.useRef(null),m=u.useRef(null),v=u.useCallback((x,g)=>{var f,S;g.preventDefault(),g.stopPropagation();const E=g.target;if(E.closest("button")||E.tagName==="BUTTON")return;const F=t.current;if(!F)return;const I=Array.from(F.children),L=(x-1)*2,T=x*2,A=I[L],l=I[T];if(!A||!l||A.classList.contains("a-split-hidden")||l.classList.contains("a-split-hidden"))return;const d="touches"in g?((f=g.touches[0])==null?void 0:f.clientX)??0:g.clientX,s="touches"in g?((S=g.touches[0])==null?void 0:S.clientY)??0:g.clientY,i=Array.from(F.querySelectorAll(".a-split-handlebar")).filter(y=>y.parentElement===F);let o=0;i.forEach(y=>{const D=y,C=window.getComputedStyle(D);if(e==="horizontal"){const V=parseFloat(C.marginLeft)||0,_=parseFloat(C.marginRight)||0;o+=D.offsetWidth+V+_}else{const V=parseFloat(C.marginTop)||0,_=parseFloat(C.marginBottom)||0;o+=D.offsetHeight+V+_}}),p.current={active:!0,paneIndex:x,startX:d,startY:s,prevElement:A,nextElement:l,prevInitialWidth:A.offsetWidth,nextInitialWidth:l.offsetWidth,prevInitialHeight:A.offsetHeight,nextInitialHeight:l.offsetHeight,containerWidth:F.offsetWidth-(e==="horizontal"?o:0),containerHeight:F.offsetHeight-(e==="vertical"?o:0),minPrevSize:parseFloat(A.getAttribute("data-min-size")||"0"),maxPrevSize:parseFloat(A.getAttribute("data-max-size")||"100"),minNextSize:parseFloat(l.getAttribute("data-min-size")||"0"),maxNextSize:parseFloat(l.getAttribute("data-max-size")||"100")},m.current=null,r==null||r({paneIndex:x})},[t,r,e]),b=u.useCallback(x=>{var C,V;const g=p.current;if(!(g!=null&&g.active))return null;const E=e==="horizontal",F="touches"in x?((C=x.touches[0])==null?void 0:C.clientX)??0:x.clientX,I="touches"in x?((V=x.touches[0])==null?void 0:V.clientY)??0:x.clientY,L=E?F-g.startX:I-g.startY,T=E?g.containerWidth:g.containerHeight,A=E?g.prevInitialWidth:g.prevInitialHeight,l=E?g.nextInitialWidth:g.nextInitialHeight;let d=A+L,s=l-L;d<0&&(d=0),s<0&&(s=0);const i=d/T*100,o=s/T*100,f=i<=g.minPrevSize,S=i>=g.maxPrevSize,y=o<=g.minNextSize,D=o>=g.maxNextSize;return f||S||y||D?null:{prevSize:i,nextSize:o,prevSizePx:d,nextSizePx:s,state:g}},[e]),$=u.useCallback(Ee(x=>{const g=b(x);if(!g)return;const{prevSize:E,nextSize:F,prevSizePx:I,nextSizePx:L,state:T}=g,{prevInitialWidth:A,prevInitialHeight:l}=T,d=e==="horizontal"?A:l;Math.abs(g.prevSizePx-d)<=1||(m.current={prevSize:E,nextSize:F},requestAnimationFrame(()=>{if(!T.prevElement||!T.nextElement)return;const s=T.prevElement.style.flexBasis.includes("%"),i=T.nextElement.style.flexBasis.includes("%");s?T.prevElement.style.flexBasis=`${E}%`:T.prevElement.style.flexBasis=`${I}px`,i?T.nextElement.style.flexBasis=`${F}%`:T.nextElement.style.flexBasis=`${L}px`}),a==null||a({paneIndex:T.paneIndex,prevSize:E,nextSize:F}))},16),[b,e,a]),c=u.useCallback(x=>{const g=p.current;if(!(g!=null&&g.active))return;const E=b(x);E&&(m.current={prevSize:E.prevSize,nextSize:E.nextSize});const F=m.current;F&&(w==null||w({paneIndex:g.paneIndex,prevSize:F.prevSize,nextSize:F.nextSize})),p.current=null,m.current=null},[b,w]);return u.useEffect(()=>{const x=$,g=c;return window.addEventListener("mousemove",x),window.addEventListener("mouseup",g),window.addEventListener("touchmove",x,{passive:!1}),window.addEventListener("touchend",g),()=>{window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",g),window.removeEventListener("touchmove",x),window.removeEventListener("touchend",g)}},[$,c]),{handleMouseDown:v}}function Fe(t,e,n){const r=u.useCallback(ke(p=>{if(t)try{const m=`${e}-${n}`,v=p.map(b=>({id:b.id,size:b.size,collapsed:b.collapsed}));localStorage.setItem(m,JSON.stringify(v))}catch(m){console.warn("Failed to save split state to localStorage:",m)}},300),[t,e,n]),a=u.useCallback(()=>{if(!t)return null;try{const p=`${e}-${n}`,m=localStorage.getItem(p);return m?JSON.parse(m):null}catch(p){return console.warn("Failed to load split state from localStorage:",p),null}},[t,e,n]),w=u.useCallback(()=>{if(t)try{const p=`${e}-${n}`;localStorage.removeItem(p)}catch(p){console.warn("Failed to clear split state from localStorage:",p)}},[t,e,n]);return{save:r,load:a,clear:w}}function De(t,e,n,r){const a=u.useRef(e),w=u.useRef(n);return a.current=e,w.current=n,u.useMemo(()=>({splitId:t,getState:()=>a.current(),dispatch:m=>w.current(m),getElement:()=>r.current,getPanes:()=>a.current().panes}),[t,r])}const Ae=u.createContext(0);function ie(){return u.useContext(Ae)}const Z=({level:t=0,children:e})=>N.jsx(Ae.Provider,{value:t,children:e});Z.displayName="NestingProvider";function ft(t){const e=n=>{const r=ie();return N.jsx(Z,{level:r+1,children:N.jsx(t,{...n})})};return e.displayName=`withNesting(${t.displayName||t.name||"Component"})`,e}const oe=({index:t,mode:e,disabled:n,lineBar:r,onMouseDown:a,onTouchStart:w,onCollapse:p,onExpand:m,renderCustom:v,leftPaneCollapsed:b=!1,rightPaneCollapsed:$=!1,explicitlyDisabled:c=!1})=>{if(v){const o={index:t,mode:e,disabled:n,lineBar:r,onMouseDown:a,onTouchStart:w||a,onCollapse:p,onExpand:m};return N.jsx("div",{className:"a-split-handlebar",onMouseDown:f=>!n&&a(f),onTouchStart:f=>!n&&(w?w(f):a(f)),children:v(o,t)})}const x=["a-split-handlebar",e==="horizontal"?"a-split-handlebar-horizontal":"a-split-handlebar-vertical",n?"a-split-handlebar-disabled":"",r?"a-split-handlebar-line":""].filter(Boolean).join(" "),g=o=>{o.stopPropagation(),$?m==null||m("right"):p==null||p("left")},E=o=>{o.stopPropagation(),b?m==null||m("left"):p==null||p("right")},F=!r&&!c,I=e==="horizontal",L=b&&!$,T=$&&!b,A=I?"M8 3L4 6L8 9":"M3 8L6 4L9 8",l=I?"M4 3L8 6L4 9":"M3 4L6 8L9 4",d=A,s=l,i=b||$;return N.jsx("div",{className:x,onMouseDown:o=>!n&&a(o),onTouchStart:o=>!n&&a(o),style:{cursor:n?"default":I?"col-resize":"row-resize"},children:F&&N.jsxs(N.Fragment,{children:[N.jsx("button",{className:`a-split-collapse-btn a-split-collapse-btn-${I?"left":"top"}${L?" hidden":""}`,onClick:g,"aria-label":$?`Expand ${I?"right":"bottom"} pane`:`Collapse ${I?"left":"top"} pane`,title:$?`Expand ${I?"right":"bottom"} pane`:`Collapse ${I?"left":"top"} pane`,children:N.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:N.jsx("path",{d,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),N.jsx("div",{className:`a-split-grip-icon${i?" hidden":""}`,"aria-hidden":"true",children:I?N.jsxs("svg",{width:"8",height:"24",viewBox:"0 0 8 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[N.jsx("circle",{cx:"4",cy:"4",r:"2.5",fill:"currentColor"}),N.jsx("circle",{cx:"4",cy:"12",r:"2.5",fill:"currentColor"}),N.jsx("circle",{cx:"4",cy:"20",r:"2.5",fill:"currentColor"})]}):N.jsxs("svg",{width:"24",height:"8",viewBox:"0 0 24 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[N.jsx("circle",{cx:"4",cy:"4",r:"2.5",fill:"currentColor"}),N.jsx("circle",{cx:"12",cy:"4",r:"2.5",fill:"currentColor"}),N.jsx("circle",{cx:"20",cy:"4",r:"2.5",fill:"currentColor"})]})}),N.jsx("button",{className:`a-split-collapse-btn a-split-collapse-btn-${I?"right":"bottom"}${T?" hidden":""}`,onClick:E,"aria-label":b?`Expand ${I?"left":"top"} pane`:`Collapse ${I?"right":"bottom"} pane`,title:b?`Expand ${I?"left":"top"} pane`:`Collapse ${I?"right":"bottom"} pane`,children:N.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:N.jsx("path",{d:s,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})};oe.displayName="DragHandle";function dt(t,e){if(e.includes("vw")){const n=parseFloat(e);return t/100*window.innerWidth*(n/100)}if(e.includes("vh")){const n=parseFloat(e);return t/100*window.innerHeight*(n/100)}if(e.includes("px")){const n=parseFloat(e);return t/100*n}return e.includes("%")?(console.warn("Percentage reference not fully supported, assuming viewport"),t/100*window.innerWidth*(parseFloat(e)/100)):t/100*parseFloat(e)}function ht(t,e){if(e.includes("vw")){const n=parseFloat(e),r=window.innerWidth*(n/100);return t/r*100}if(e.includes("vh")){const n=parseFloat(e),r=window.innerHeight*(n/100);return t/r*100}if(e.includes("px")){const n=parseFloat(e);return t/n*100}if(e.includes("%")){console.warn("Percentage reference not fully supported, assuming viewport");const n=window.innerWidth*(parseFloat(e)/100);return t/n*100}return t/parseFloat(e)*100}function pt(t,e,n){const r=parseFloat(t);return t.includes("%")?n==="px"?`${r/100*e}px`:t:t.includes("px")?n==="%"?`${r/e*100}%`:t:n==="px"?`${r}px`:`${r/e*100}%`}function B(t){const e=parseFloat(t);return t.includes("%")?{value:e,unit:"%"}:t.includes("px")?{value:e,unit:"px"}:t.includes("vw")?{value:e,unit:"vw"}:t.includes("vh")?{value:e,unit:"vh"}:t.includes("fr")?{value:e,unit:"fr"}:{value:e,unit:"px"}}function gt(t,e){const n=B(t),r=B(e);return n.unit===r.unit}function mt(t,e,n,r){return`${Math.max(e,Math.min(n,t))}${r}`}function St(t){if(t.length===0)return{total:0,unit:"px"};const e=t[0];if(!e)return{total:0,unit:"px"};const n=B(e.size);let r=0;for(const a of t){const w=B(a.size);w.unit===n.unit||console.warn(`Mixed units detected: ${n.unit} and ${w.unit}. Results may be inaccurate.`),r+=w.value}return{total:r,unit:n.unit}}function zt(t,e){const n=[];if(t.length===0)return n.push("No panes defined"),{valid:!1,errors:n};const r=t.filter(a=>a.size.includes("%"));if(r.length>0){const a=r.reduce((w,p)=>w+parseFloat(p.size),0);a>100.1&&n.push(`Total percentage (${a}%) exceeds 100%`)}return t.forEach((a,w)=>{a.minSize<0&&n.push(`Pane ${w}: minSize cannot be negative`),a.maxSize<a.minSize&&n.push(`Pane ${w}: maxSize (${a.maxSize}) less than minSize (${a.minSize})`),a.maxSize>100&&n.push(`Pane ${w}: maxSize (${a.maxSize}%) exceeds 100%`)}),{valid:n.length===0,errors:n}}function He(t,e){const n=B(t);switch(n.unit){case"%":return t;case"px":return t;case"vw":return`${n.value/100*window.innerWidth}px`;case"vh":return`${n.value/100*window.innerHeight}px`;case"fr":return"0";default:return`${n.value}px`}}function Ne(t,e=!1){if(e)return{flexGrow:0,flexShrink:0};const n=B(t.size);return n.unit==="%"?{flexGrow:1,flexShrink:1}:n.unit==="fr"?{flexGrow:n.value,flexShrink:1}:{flexGrow:0,flexShrink:0}}function wt(t,e,n){const r=B(t);return r.unit==="%"?r.value/100*e:r.unit==="px"?r.value:r.unit==="vw"?r.value/100*window.innerWidth:r.unit==="vh"?r.value/100*window.innerHeight:r.value}function xt(t){const e=t.filter(a=>a.size.includes("%"));if(e.length===0)return t;const n=e.reduce((a,w)=>a+parseFloat(w.size),0);if(Math.abs(n-100)<.01)return t;const r=100/n;return t.map(a=>{if(!a.size.includes("%"))return a;const p=parseFloat(a.size)*r;return{...a,size:`${p}%`}})}function Pt(t,e,n){const r=e+n;return!(r<t.minSize||r>t.maxSize)}function bt(t){return t==="horizontal"?"width":"height"}function yt(t){return t==="horizontal"?"clientX":"clientY"}const ae=({id:t,size:e,collapsed:n,minSize:r,maxSize:a,mode:w,content:p,flexGrow:m})=>{const v=e||"100%",b={size:v},{flexGrow:$,flexShrink:c}=Ne(b,n),x=m!==void 0?m:$,g=n?"0":He(v);return N.jsx("div",{"data-pane-id":t,"data-min-size":r,"data-max-size":a,className:`a-split-pane${n?" a-split-hidden":""}`,style:{flexBasis:g,flexGrow:x,flexShrink:c,overflow:n?"hidden":"auto"},children:p})};ae.displayName="Pane";class Re{constructor(e){te(this,"plugins",[]);te(this,"context");this.context=e}registerPlugins(e){this.plugins=e,this.plugins.forEach(n=>{n.onInit&&n.onInit(this.context)})}destroy(){this.plugins.forEach(e=>{e.onDestroy&&e.onDestroy(this.context)}),this.plugins=[]}onPaneAdd(e){this.plugins.forEach(n=>{n.onPaneAdd&&n.onPaneAdd(e,this.context)})}onPaneRemove(e){this.plugins.forEach(n=>{n.onPaneRemove&&n.onPaneRemove(e,this.context)})}onPaneCollapse(e){this.plugins.forEach(n=>{n.onPaneCollapse&&n.onPaneCollapse(e,this.context)})}onPaneExpand(e){this.plugins.forEach(n=>{n.onPaneExpand&&n.onPaneExpand(e,this.context)})}onDragStart(e){this.plugins.forEach(n=>{n.onDragStart&&n.onDragStart(e,this.context)})}onDragMove(e){let n=!0;for(const r of this.plugins)r.onDragMove&&r.onDragMove(e,this.context)===!1&&(n=!1);return n}onDragEnd(e){this.plugins.forEach(n=>{n.onDragEnd&&n.onDragEnd(e,this.context)})}onResize(e){this.plugins.forEach(n=>{n.onResize&&n.onResize(e,this.context)})}renderHandle(e){for(const n of this.plugins)if(n.renderHandle){const r=n.renderHandle(e,this.context);if(r)return r}return null}renderPane(e){for(const n of this.plugins)if(n.renderPane){const r=n.renderPane(e,this.context);if(r)return r}return null}getPlugins(){return this.plugins}getPlugin(e){return this.plugins.find(n=>n.name===e)}hasPlugin(e){return this.plugins.some(n=>n.name===e)}}const Te=u.forwardRef((t,e)=>{const{id:n,mode:r="horizontal",initialSizes:a=[],minSizes:w=[],maxSizes:p=[],collapsed:m=[],disable:v=!1,visible:b=!0,lineBar:$=!1,renderBar:c,plugins:x=[],enablePersistence:g=!1,width:E=null,height:F=null,className:I="",style:L={},fixClass:T=!1,children:A,onDragging:l,onDragEnd:d,onLayoutChange:s}=t,i=u.useRef(`split-${Math.random().toString(36).slice(2,11)}`),o=n||i.current,f=u.useRef(null),S=u.useRef(null),y=ie(),D=!T&&y>2;u.useEffect(()=>{var P,z;if(typeof globalThis<"u"&&((z=(P=globalThis.process)==null?void 0:P.env)==null?void 0:z.NODE_ENV)!=="production"){if(a.length>0){const k=u.Children.toArray(A);a.length!==k.length&&console.warn(`[Split] initialSizes length (${a.length}) doesn't match children count (${k.length})`),a.forEach((R,M)=>{if(typeof R=="string"){const J=parseFloat(R);if(isNaN(J)&&console.warn(`[Split] Invalid size at index ${M}: "${R}". Expected format: "50%", "100px", etc.`),R.includes("%")){const W=parseFloat(R);(W<0||W>100)&&console.warn(`[Split] Size at index ${M} is out of range: "${R}". Percentage should be 0-100.`)}}});const H=a.reduce((R,M)=>typeof M=="string"&&M.includes("%")?R+parseFloat(M):R,0);H>100&&console.warn(`[Split] Total percentage (${H}%) exceeds 100%. Sizes will be normalized.`)}if((w.length>0||p.length>0)&&(w.forEach((k,H)=>{const R=p[H];R!==void 0&&k>R&&console.warn(`[Split] minSize (${k}) is greater than maxSize (${R}) at index ${H}`),(k<0||k>100)&&console.warn(`[Split] minSize at index ${H} is out of range: ${k}. Should be 0-100.`)}),p.forEach((k,H)=>{(k<0||k>100)&&console.warn(`[Split] maxSize at index ${H} is out of range: ${k}. Should be 0-100.`)})),m.length>0){const k=u.Children.toArray(A);m.length!==k.length&&console.warn(`[Split] collapsed length (${m.length}) doesn't match children count (${k.length})`)}}},[a,w,p,m,A]);const{panes:C,addPane:V,removePane:_,togglePane:q,setPaneSize:G,getPaneState:le,removePanes:ce,swapPanes:ue,collapsePane:X,expandPane:Y,resizePane:fe}=Ce(A,a,m,w,p,o),[j,de]=u.useState(null);u.useEffect(()=>(j&&j.active?(document.body.classList.add("a-split-body-dragging"),document.body.classList.add(r==="horizontal"?"a-split-body-dragging-horizontal":"a-split-body-dragging-vertical")):(document.body.classList.remove("a-split-body-dragging"),document.body.classList.remove("a-split-body-dragging-horizontal"),document.body.classList.remove("a-split-body-dragging-vertical")),()=>{document.body.classList.remove("a-split-body-dragging"),document.body.classList.remove("a-split-body-dragging-horizontal"),document.body.classList.remove("a-split-body-dragging-vertical")}),[j,r]);const Be=u.useCallback(()=>({panes:C,mode:r,dragState:j}),[C,r,j]),qe=u.useCallback(h=>{switch(h.type){case"ADD_PANE":V(h.payload);break;case"REMOVE_PANE":_(h.payload);break;case"TOGGLE_PANE":q(h.payload);break;case"SET_PANE_SIZE":G(h.payload.index,h.payload.size);break;case"RESTORE_STATE":h.payload.panes.forEach((P,z)=>{G(z,P.size),P.collapsed&&q(z)});break;case"ADJUST_PANE_SIZE":if(h.payload&&(j==null?void 0:j.paneIndex)!=null){const P=j.paneIndex,z=C[P];if(z){const k=parseFloat(z.size),H=h.payload.direction==="grow"?h.payload.amount:-h.payload.amount,R=Math.max(z.minSize||0,Math.min(z.maxSize||100,k+H));G(P,`${R}%`)}}break}},[V,_,q,G,C,j]),he=De(o,Be,qe,f);u.useEffect(()=>{if(x.length>0)return S.current=new Re(he),S.current.registerPlugins(x),()=>{var h;(h=S.current)==null||h.destroy(),S.current=null}},[x,he]);const Q=Fe(g,`split-state-${o}`,r);u.useEffect(()=>{const h=Q.load();h&&h.length===C.length&&h.forEach((P,z)=>{C[z]&&P.id===C[z].id&&(G(z,P.size),P.collapsed!==C[z].collapsed&&q(z))})},[]),u.useEffect(()=>{Q.save(C)},[C,Q]);const pe=u.useRef(!0),ge=u.useRef(u.Children.count(A)),K=u.useRef(a);u.useEffect(()=>{if(!f.current||a.length===0)return;const h=u.Children.count(A),P=h!==ge.current,z=a.length!==K.current.length||a.some((k,H)=>k!==K.current[H]);(pe.current||P||z)&&(a.forEach((k,H)=>{G(H,k)}),pe.current=!1,ge.current=h,K.current=a)},[A,a]);const ee=u.useRef(m);u.useEffect(()=>{!f.current||!m.some((P,z)=>P!==ee.current[z])&&ee.current.length===m.length||(ee.current=m,m.forEach((P,z)=>{const k=C[z];k&&k.collapsed!==P&&(P?X(z):Y(z))}))},[m,C,X,Y]),u.useEffect(()=>{f.current&&C.forEach((h,P)=>{var k;const z=(k=f.current)==null?void 0:k.querySelector(`[data-pane-id="${h.id}"]`);if(z){const H=w[P],R=p[P];H!==void 0&&z.setAttribute("data-min-size",String(w[P])),R!==void 0&&z.setAttribute("data-max-size",String(p[P]))}})},[w,p,C]),u.useEffect(()=>{if(!f.current)return;f.current.querySelectorAll(".a-split-handlebar").forEach((P,z)=>{const k=P,H=z+1;ne(H,v)?(k.classList.add("a-split-handlebar-disabled"),k.style.cursor="default"):(k.classList.remove("a-split-handlebar-disabled"),k.style.cursor=r==="horizontal"?"col-resize":"row-resize");const M=se(H,b);k.style.display=M?"":"none",re(H,$)?k.classList.add("a-split-handlebar-line"):k.classList.remove("a-split-handlebar-line")})},[v,b,$,r]);const{handleMouseDown:me}=Ie(f,r,{onDragStart:h=>{var z;de({active:!0,paneIndex:h.paneIndex}),(z=S.current)==null||z.onDragStart(h);const P=C[h.paneIndex];P&&(s==null||s(h.paneIndex,P.id,"dragging",null))},onDragMove:h=>{var z;(((z=S.current)==null?void 0:z.onDragMove(h))??!0)&&(l==null||l(h.prevSize,h.nextSize,h.paneIndex))},onDragEnd:h=>{var z;G(h.paneIndex-1,`${h.prevSize}%`),G(h.paneIndex,`${h.nextSize}%`),de(null),(z=S.current)==null||z.onDragEnd(h),d==null||d(h.prevSize,h.nextSize,h.paneIndex);const P=C[h.paneIndex];P&&(s==null||s(h.paneIndex,P.id,"dragged",null))}}),Oe=u.useCallback((h,P)=>{var k;const z=P==="left"?h-1:h;if(z>=0&&z<C.length){X(z,{direction:P});const H=C[z];H&&((k=S.current)==null||k.onPaneCollapse({pane:H,index:z,direction:P}),s==null||s(z,H.id,"close",P))}},[C,X,s]),Xe=u.useCallback((h,P)=>{var k;const z=P==="left"?h-1:h;if(z>=0&&z<C.length){Y(z,{direction:P});const H=C[z];H&&((k=S.current)==null||k.onPaneExpand({pane:H,index:z,direction:P}),s==null||s(z,H.id,"open",P))}},[C,Y,s]);u.useImperativeHandle(e,()=>({addPane:V,removePane:_,togglePane:q,setPaneSize:G,getPaneState:le,removePanes:ce,swapPanes:ue,collapsePane:X,expandPane:Y,resizePane:fe,getSnapshot:()=>{const h=f.current,P=h?r==="horizontal"?h.offsetWidth:h.offsetHeight:0;return{panes:C.map(z=>({...z})),totalSize:P,mode:r,timestamp:Date.now()}},restore:h=>{if(h.mode!==r){console.warn(`Cannot restore snapshot with different mode. Current: ${r}, Snapshot: ${h.mode}`);return}h.panes.forEach((P,z)=>{C[z]&&(G(z,P.size),P.collapsed!==C[z].collapsed&&q(z))})}}),[V,_,q,G,le,ce,ue,X,Y,fe,C,r]);const Ye=u.useMemo(()=>({display:"flex",flexDirection:r==="horizontal"?"row":"column",width:E||"100%",height:F||"100%",overflow:"hidden",...L}),[r,E,F,L]),Ue=u.useMemo(()=>{const h=["a-split-container"];return r==="vertical"&&h.push("a-split-vertical"),(T||D)&&h.push("a-split-fix"),j!=null&&j.active&&h.push("a-split-dragging"),I&&h.push(I),h.join(" ")},[r,T,D,I,j==null?void 0:j.active]),Je=()=>{const h=[];return C.forEach((P,z)=>{var H;const k=N.jsx(Z,{level:y+1,children:P.content});if(h.push(N.jsx(ae,{id:P.id,size:P.size,collapsed:P.collapsed,minSize:P.minSize,maxSize:P.maxSize,mode:r,content:k,flexGrow:P.flexGrow},P.id)),z<C.length-1){const R=z+1,M=C[z+1];if(!M)return;const J=$e(),W=se(R,b),Se=re(R,$),ze=P.collapsed||!1,we=M.collapsed||!1,xe=ne(R,v),Pe=xe||ze||we;if(W&&J){const be=(H=S.current)==null?void 0:H.renderHandle({index:R,mode:r,disabled:Pe,lineBar:Se,onMouseDown:O=>me(R,O)});be?h.push(N.jsx(u.Fragment,{children:be},`handlebar-${R}`)):h.push(N.jsx(oe,{index:R,mode:r,disabled:Pe,lineBar:Se,explicitlyDisabled:xe,onMouseDown:O=>me(R,O),onCollapse:O=>Oe(R,O),onExpand:O=>Xe(R,O),renderCustom:c,leftPaneCollapsed:ze,rightPaneCollapsed:we},`handlebar-${R}`))}}}),h};return N.jsx("div",{ref:f,id:o,className:Ue,style:Ye,children:Je()})});Te.displayName="Split";function vt(t={}){const{mode:e="horizontal",initialPanes:n=[],initialSizes:r=[],minSizes:a=[],maxSizes:w=[],onPaneChange:p}=t,[m,v]=u.useState(()=>n.length>0?n:r.map((s,i)=>({id:`pane-${i}`,size:s,collapsed:!1,minSize:a[i]||0,maxSize:w[i]||100,content:null}))),[b]=u.useState(!1),$=u.useRef(!1),c=u.useCallback(s=>{v(i=>{const o=typeof s=="function"?s(i):s;return!$.current&&p&&p(o),o})},[p]),x=u.useCallback(s=>{c(i=>{const o=s.position??i.length,f={id:`pane-${Date.now()}`,size:s.size,collapsed:s.collapsed||!1,minSize:s.minSize||0,maxSize:s.maxSize||100,content:s.content},S=[...i];return S.splice(o,0,f),S})},[c]),g=u.useCallback(s=>{c(i=>{if(s<0||s>=i.length)return i;const o=[...i],f=o.splice(s,1)[0];if(f&&o.length>0){const y=(parseFloat(f.size)||0)/o.length;return o.map(D=>({...D,size:`${(parseFloat(D.size)||0)+y}%`}))}return o})},[c]),E=u.useCallback(s=>{c(i=>{const o=[...s].sort((y,D)=>D-y);let f=[...i],S=0;if(o.forEach(y=>{if(y>=0&&y<f.length){const D=f.splice(y,1)[0];D&&(S+=parseFloat(D.size)||0)}}),f.length>0&&S>0){const y=S/f.length;f=f.map(D=>({...D,size:`${(parseFloat(D.size)||0)+y}%`}))}return f})},[c]),F=u.useCallback(s=>{c(i=>{if(s<0||s>=i.length)return i;const o=i[s];if(!o)return i;const f=[...i];return f[s]={...o,collapsed:!o.collapsed},f})},[c]),I=u.useCallback(s=>{c(i=>{if(s<0||s>=i.length)return i;const o=i[s];if(!o||o.collapsed)return i;const f=[...i];return f[s]={...o,collapsed:!0},f})},[c]),L=u.useCallback(s=>{c(i=>{if(s<0||s>=i.length)return i;const o=i[s];if(!o||!o.collapsed)return i;const f=[...i];return f[s]={...o,collapsed:!1},f})},[c]),T=u.useCallback((s,i,o)=>{c(f=>{if(s<0||s>=f.length)return f;const S=f[s];if(!S)return f;const y=[...f];return y[s]={...S,size:i},y})},[c]),A=u.useCallback((s,i)=>{c(o=>{if(s<0||s>=o.length||i<0||i>=o.length||s===i)return o;const f=[...o],S=f[s];return f[s]=f[i],f[i]=S,f})},[c]),l=u.useCallback(()=>({panes:m.map(s=>({...s})),totalSize:0,mode:e,timestamp:Date.now()}),[m,e]),d=u.useCallback(s=>{if(s.mode!==e){console.warn(`Cannot restore snapshot with different mode. Current: ${e}, Snapshot: ${s.mode}`);return}$.current=!0,c(i=>s.panes.map((o,f)=>{const S=i.find(y=>y.id===o.id)||i[f];return{id:o.id,size:o.size,collapsed:o.collapsed,minSize:(S==null?void 0:S.minSize)??0,maxSize:(S==null?void 0:S.maxSize)??100,content:(S==null?void 0:S.content)??null}})),$.current=!1,p&&v(i=>(p(i),i))},[e,c,p]);return u.useMemo(()=>({panes:m,mode:e,isDragging:b,addPane:x,removePane:g,removePanes:E,togglePane:F,collapsePane:I,expandPane:L,setPaneSize:T,swapPanes:A,setPanes:c,getSnapshot:l,restore:d}),[m,e,b,x,g,E,F,I,L,T,A,c,l,d])}function $t(t){return t}function Ct(t={}){const{storage:e="localStorage",key:n,debounceDelay:r=300}=t;let a=null;const w=$=>n||`a-multilayout-splitter:${$}`,p=()=>typeof window>"u"?null:e==="localStorage"?window.localStorage:window.sessionStorage,m=($,c)=>{const x=p();if(x)try{const g=w($),E=JSON.stringify({panes:c.panes.map(F=>({id:F.id,size:F.size,collapsed:F.collapsed})),mode:c.mode,timestamp:Date.now()});x.setItem(g,E)}catch(g){console.error("Failed to save split state:",g)}},v=$=>{const c=p();if(!c)return null;try{const x=w($),g=c.getItem(x);return g?JSON.parse(g):null}catch(x){return console.error("Failed to load split state:",x),null}},b=($,c)=>{a&&clearTimeout(a),a=setTimeout(()=>{m($,c),a=null},r)};return{name:"persistence",version:"1.0.0",onInit($){const c=v($.splitId),x=c==null?void 0:c.panes;x&&x.length>0?setTimeout(()=>{$.getState().panes.length===x.length&&$.dispatch({type:"RESTORE_STATE",payload:{panes:x}})},0):setTimeout(()=>{const g=$.getState();m($.splitId,g)},0)},onDragEnd($,c){setTimeout(()=>{const x=c.getState();b(c.splitId,x)},0)},onPaneAdd($,c){setTimeout(()=>{const x=c.getState();b(c.splitId,x)},0)},onPaneRemove($,c){setTimeout(()=>{const x=c.getState();b(c.splitId,x)},0)},onPaneCollapse($,c){setTimeout(()=>{const x=c.getState();b(c.splitId,x)},0)},onPaneExpand($,c){setTimeout(()=>{const x=c.getState();b(c.splitId,x)},0)},onDestroy(){a&&(clearTimeout(a),a=null)}}}function Et(t,e="localStorage"){const n=e==="localStorage"?window.localStorage:window.sessionStorage;try{const r=`a-multilayout-splitter:${t}`;n.removeItem(r)}catch(r){console.error("Failed to clear persisted state:",r)}}function kt(t={}){const{enableArrowKeys:e=!0,enableNumberKeys:n=!0,stepSize:r=5,enableTabNavigation:a=!0}=t;let w=0,p=null;const m=(v,b)=>{if(!v)return;const c=v.querySelectorAll(".a-split-pane")[b];c&&(c.focus(),c.setAttribute("tabindex","0"),w=b)};return{name:"keyboard",version:"1.0.0",onInit(v){const b=v.getElement();if(!b)return;b.setAttribute("tabindex","0"),b.querySelectorAll(".a-split-pane").forEach((c,x)=>{c.setAttribute("tabindex",x===0?"0":"-1")}),p=c=>{const x=v.getState(),g=x.panes;if(e&&(c.key==="ArrowLeft"||c.key==="ArrowRight"||c.key==="ArrowUp"||c.key==="ArrowDown")){c.preventDefault();const E=x.mode==="horizontal",F=E&&c.key==="ArrowRight"||!E&&c.key==="ArrowDown",I=w,L=g[I],T=I<g.length-1?I+1:I-1,A=g[T];if(!L||!A)return;const l=parseFloat(L.size),d=parseFloat(A.size),s=F?r:-r;let i=l+s,o=d-s;const f=L.minSize||0,S=L.maxSize||100,y=A.minSize||0,D=A.maxSize||100;i=Math.max(f,Math.min(S,i)),o=Math.max(y,Math.min(D,o));const C=l+d;i+o!==C&&(i===f||i===S?o=C-i:i=C-o),v.dispatch({type:"SET_PANE_SIZE",payload:{index:I,size:`${i}%`}}),v.dispatch({type:"SET_PANE_SIZE",payload:{index:T,size:`${o}%`}})}if(n){const E=parseInt(c.key,10);if(!isNaN(E)&&E>=1&&E<=9){const F=E-1;F<g.length&&m(b,F)}}if(a&&c.key==="Tab"){c.preventDefault();let E=c.shiftKey?w-1:w+1;E<0?E=g.length-1:E>=g.length&&(E=0),m(b,E)}},b.addEventListener("keydown",p)},onDestroy(v){const b=v.getElement();b&&p&&(b.removeEventListener("keydown",p),p=null)}}}function It(t,e){return{name:"custom-handle",version:"1.0.0",renderHandle(n){return u.createElement(t,{...n,...e})}}}function Ft(t){return{name:"custom-handle-render",version:"1.0.0",renderHandle(e){return t(e)}}}const Le=u.createContext(null),je=u.createContext(null),Ve=u.createContext(null);function Dt({id:t,mode:e="horizontal",enablePersistence:n=!1,storageKey:r=`split-state-${t}`,children:a,_panes:w=[],_addPane:p,_removePane:m,_togglePane:v,_setPaneSize:b,_getPaneState:$}){const c=u.useRef({isDragging:!1,activeHandlebar:null}),x=u.useMemo(()=>({id:t,mode:e,enablePersistence:n,storageKey:r}),[t,e,n,r]),g=u.useMemo(()=>({panes:w,isDragging:c.current.isDragging,activeHandlebar:c.current.activeHandlebar}),[w,c.current.isDragging,c.current.activeHandlebar]),E=u.useMemo(()=>({addPane:p||(()=>console.warn("addPane not available")),removePane:m||(()=>console.warn("removePane not available")),togglePane:v||(()=>console.warn("togglePane not available")),setPaneSize:b||(()=>console.warn("setPaneSize not available")),getPaneState:$||(()=>[]),setDragging:(F,I)=>{c.current.isDragging=F,c.current.activeHandlebar=I??null}}),[p,m,v,b,$]);return N.jsx(Le.Provider,{value:x,children:N.jsx(je.Provider,{value:g,children:N.jsx(Ve.Provider,{value:E,children:a})})})}function Ge(){const t=u.useContext(Le);if(!t)throw new Error("useSplitConfig must be used within SplitProvider");return t}function U(){const t=u.useContext(je);if(!t)throw new Error("useSplitState must be used within SplitProvider");return t}function Me(){return u.useContext(Ve)}function At(){const t=Me();if(!t)throw new Error("useSplit must be used within SplitProvider");return{config:Ge(),state:U(),actions:t}}function _e(t){const{panes:e}=U();return e[t]}function Ht(){const{panes:t}=U();return t.length}function Nt(){const{isDragging:t}=U();return t}function Rt(t){const e=_e(t);return(e==null?void 0:e.collapsed)??!1}function Tt(){const{panes:t}=U();return u.useMemo(()=>t.filter(e=>!e.collapsed),[t])}exports.DragHandle=oe;exports.NestingProvider=Z;exports.PaneComponent=ae;exports.PluginManager=Re;exports.Split=Te;exports.SplitProvider=Dt;exports.animatePaneSize=ye;exports.applyCollapseState=Qe;exports.batchUpdatePanes=ot;exports.calculateFlexBasis=He;exports.calculateFlexValues=Ne;exports.calculateHandlebarPosition=wt;exports.calculateTotalSize=St;exports.canResize=Pt;exports.clampSize=mt;exports.clearPersistedState=Et;exports.constrainSize=st;exports.createPane=rt;exports.createPlugin=$t;exports.customHandlePlugin=It;exports.customHandleRenderPlugin=Ft;exports.debounce=ke;exports.findPaneIndex=et;exports.getAxisProperty=bt;exports.getCoordinateProperty=yt;exports.getPaneElement=nt;exports.getVisiblePanes=tt;exports.haveSameUnit=gt;exports.isHandlebarDisabled=ne;exports.isHandlebarVisible=se;exports.isLineBarStyle=re;exports.isPaneVisible=ve;exports.keyboardPlugin=kt;exports.normalizePaneSizes=xt;exports.normalizeSize=pt;exports.parseSize=B;exports.percentageToPixel=dt;exports.persistencePlugin=Ct;exports.pixelToPercentage=ht;exports.restorePaneState=at;exports.serializePaneState=lt;exports.shouldShowHandlebar=$e;exports.throttle=Ee;exports.togglePaneCollapse=Ke;exports.updatePaneSize=it;exports.useDragHandler=Ie;exports.useIsCollapsed=Rt;exports.useIsDragging=Nt;exports.useNestingLevel=ie;exports.usePane=_e;exports.usePaneCount=Ht;exports.usePaneManager=Ce;exports.usePersistence=Fe;exports.usePluginContext=De;exports.useSplit=At;exports.useSplitActions=Me;exports.useSplitConfig=Ge;exports.useSplitController=vt;exports.useSplitState=U;exports.useVisiblePanes=Tt;exports.validatePaneSizes=zt;exports.withNesting=ft;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|