react-resizable-panels 4.14.3 → 4.14.5

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 CHANGED
@@ -71,7 +71,7 @@ None
71
71
  <td>id</td>
72
72
  <td><p>Uniquely identifies this group within an application.
73
73
  Falls back to <code>useId</code> when not provided.</p>
74
- <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes.</p>
74
+ <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes; (an explicit <code>data-testid</code> prop will take precedence).</p>
75
75
  </td>
76
76
  </tr>
77
77
  <tr>
@@ -114,7 +114,7 @@ Use this prop to disable that behavior for Panels and Separators in this group.<
114
114
  <td><p>Exposes the following imperative API:</p>
115
115
  <ul>
116
116
  <li><code>getLayout(): Layout</code></li>
117
- <li><code>setLayout(layout: Layout): void</code></li>
117
+ <li><code>setLayout(layout: Layout): Layout</code></li>
118
118
  </ul>
119
119
  <p>ℹ️ The <code>useGroupRef</code> and <code>useGroupCallbackRef</code> hooks are exported for convenience use in TypeScript projects.</p>
120
120
  </td>
@@ -128,7 +128,7 @@ For most cases, it is recommended to use the <code>onLayoutChanged</code> callba
128
128
  </tr>
129
129
  <tr>
130
130
  <td>onLayoutChanged</td>
131
- <td><p>Called after the Group&#39;s layout has been changed.</p>
131
+ <td><p>Called after the Group&#39;s layout has been changed.</p>
132
132
  <p>ℹ️ For layout changes caused by pointer events, this method is not called until the pointer has been released.
133
133
  This method is recommended when saving layouts to some storage api.</p>
134
134
  <p>ℹ️ The second argument contains meta information about the layout change.
@@ -141,7 +141,7 @@ prefer it when persisting layouts.</p>
141
141
  </tr>
142
142
  <tr>
143
143
  <td>resizePreviewMode</td>
144
- <td><p>Controls whether pointer dragging updates <code>Panel</code>s sizes immediately,
144
+ <td><p>Controls whether pointer dragging updates <code>Panel</code> sizes immediately,
145
145
  or renders overlay separator previews until the pointer is released.</p>
146
146
  <p>Defaults to <code>&quot;panel&quot;</code> (immediate resizing); <code>&quot;separator&quot;</code> defers resizing until release.</p>
147
147
  <p>Customize previews using the <code>SeparatorOverlay</code> component.</p>
@@ -149,14 +149,14 @@ or renders overlay separator previews until the pointer is released.</p>
149
149
  </tr>
150
150
  <tr>
151
151
  <td>resizeTargetMinimumSize</td>
152
- <td><p>Minimum size of the resizable hit target area (either <code>Separator</code> or <code>Panel</code> edge)
153
- This threshold ensures are large enough to avoid mis-clicks.</p>
152
+ <td><p>Minimum size of the resizable hit target area (either <code>Separator</code> or <code>Panel</code> edge).
153
+ This threshold ensures targets are large enough to avoid mis-clicks.</p>
154
154
  <ul>
155
155
  <li>Coarse inputs (typically a finger on a touchscreen) have reduced accuracy;
156
156
  to ensure accessibility and ease of use, hit targets should be larger to prevent mis-clicks.</li>
157
157
  <li>Fine inputs (typically a mouse) can be smaller</li>
158
158
  </ul>
159
- <p>ℹ️ <a href="https://developer.apple.com/design/human-interface-guidelines/accessibility">Apple interface guidelines</a> suggest <code>20pt</code> (<code>27px</code>) on desktops and <code>28pt</code> (<code>37px</code>) for touch devices
159
+ <p>ℹ️ <a href="https://developer.apple.com/design/human-interface-guidelines/accessibility">Apple interface guidelines</a> suggest <code>20pt</code> (<code>27px</code>) on desktops and <code>28pt</code> (<code>37px</code>) for touch devices.
160
160
  In practice this seems to be much larger than many of their own applications use though.</p>
161
161
  </td>
162
162
  </tr>
@@ -227,7 +227,7 @@ None
227
227
  <td><p>Uniquely identifies this panel within the parent group.
228
228
  Falls back to <code>useId</code> when not provided.</p>
229
229
  <p>ℹ️ This prop is used to associate persisted group layouts with the original panel.</p>
230
- <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes.</p>
230
+ <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes; (an explicit <code>data-testid</code> prop will take precedence).</p>
231
231
  </td>
232
232
  </tr>
233
233
  <tr>
@@ -247,7 +247,7 @@ Falls back to <code>useId</code> when not provided.</p>
247
247
  or past its <code>collapsedSize</code> to expand.
248
248
  Defaults to half the distance between <code>collapsedSize</code> and <code>minSize</code>.</p>
249
249
  <p>For example if a panel declares <code>collapsedSize=&quot;5%&quot;</code>, <code>collapsedThreshold=&quot;5%&quot;</code>, and <code>minSize=&quot;25%&quot;</code>,
250
- it will collapse when resized below 20% and expands when resized above 10%.</p>
250
+ it will collapse when resized below 20% and expand when resized above 10%.</p>
251
251
  <p>ℹ️ Interpretation rules:</p>
252
252
  <ul>
253
253
  <li>Numbers are interpreted as pixels (e.g. <code>minSize={200}</code> is 200 pixels)</li>
@@ -259,7 +259,7 @@ it will collapse when resized below 20% and expands when resized above 10%.</p>
259
259
  <tr>
260
260
  <td>collapsible</td>
261
261
  <td><p>This panel can be collapsed.</p>
262
- <p>ℹ️ A collapsible panel will collapse when it&#39;s size is less than of the specified <code>minSize</code></p>
262
+ <p>ℹ️ A collapsible panel will collapse when its size is less than the specified <code>minSize</code></p>
263
263
  </td>
264
264
  </tr>
265
265
  <tr>
@@ -333,9 +333,9 @@ Defaults to <code>preserve-relative-size</code>.</p>
333
333
  <ul>
334
334
  <li><code>collapse(): void</code></li>
335
335
  <li><code>expand(): void</code></li>
336
- <li><code>getSize(): number</code></li>
336
+ <li><code>getSize(): PanelSize</code></li>
337
337
  <li><code>isCollapsed(): boolean</code></li>
338
- <li><code>resize(size: number): void</code></li>
338
+ <li><code>resize(size: number | string): void</code></li>
339
339
  </ul>
340
340
  <p>ℹ️ The <code>usePanelRef</code> and <code>usePanelCallbackRef</code> hooks are exported for convenience use in TypeScript projects.</p>
341
341
  </td>
@@ -392,7 +392,7 @@ None
392
392
  <td>id</td>
393
393
  <td><p>Uniquely identifies the separator within the parent group.
394
394
  Falls back to <code>useId</code> when not provided.</p>
395
- <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes.</p>
395
+ <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes; (an explicit <code>data-testid</code> prop will take precedence).</p>
396
396
  </td>
397
397
  </tr>
398
398
  <tr>
@@ -499,7 +499,7 @@ Grid elements always include the following attributes:
499
499
  <td>id</td>
500
500
  <td><p>Uniquely identifies this grid within an application.
501
501
  Falls back to <code>useId</code> when not provided.</p>
502
- <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes.</p>
502
+ <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes; (an explicit <code>data-testid</code> prop will take precedence).</p>
503
503
  </td>
504
504
  </tr>
505
505
  <tr>
@@ -564,7 +564,7 @@ This method is recommended when saving layouts to some storage api.</p>
564
564
  </tr>
565
565
  <tr>
566
566
  <td>resizeTargetMinimumSize</td>
567
- <td><p>Minimum size of the resizable hit target area (either a <code>Gridline</code> or a <code>Cell</code> edge)
567
+ <td><p>Minimum size of the resizable hit target area (either a <code>Gridline</code> or a <code>Cell</code> edge).
568
568
  This threshold ensures targets are large enough to avoid mis-clicks.</p>
569
569
  <p>ℹ️ Refer to the <code>Group</code> prop of the same name for more information.</p>
570
570
  </td>
@@ -639,7 +639,7 @@ Cell elements always include the following attributes:
639
639
  <td>id</td>
640
640
  <td><p>Uniquely identifies this cell within the parent grid.
641
641
  Falls back to <code>useId</code> when not provided.</p>
642
- <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes.</p>
642
+ <p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes; (an explicit <code>data-testid</code> prop will take precedence).</p>
643
643
  </td>
644
644
  </tr>
645
645
  <tr>
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react/jsx-runtime"),x=require("react");function Me(e){const t=x.useId();return`${e??t}`}const ne=typeof window<"u"?x.useLayoutEffect:x.useEffect;function pe(e){const t=x.useRef(e);return ne(()=>{t.current=e},[e]),x.useCallback((...n)=>t.current?.(...n),[t])}function Ne(...e){return pe(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function Je(e,t){return t?e*2+1:e+1}function dn(e,t){return t?e*2-1:e}function dt(e,t,n){const o=Je(e,n);return t===void 0?`${o} / -1`:`${o} / span ${dn(t,n)}`}function fn(e){return`${e*2} / span 1`}function mn({crossCount:e,crossSpan:t,crossStart:n,hasGutters:o}){const r=t===void 0?e:n+t;if(n===0&&r===e)return"1 / -1";let i=Je(n,o),s=Je(r-1,o)+1;return o&&(n>0&&i--,r<e&&s++),`${i} / ${s}`}function tt(e,t){return Number.isInteger(e)&&e>=1&&e<t}function O(e,t="Assertion error"){if(!e)throw Error(t)}const Gt=x.createContext(null);function Nt(){const e=x.useContext(Gt);return O(e,"Grid Context not found; did you render a Cell or Gridline outside of a Grid?"),e}function jt({children:e,className:t,column:n,columnSpan:o=1,elementRef:r,id:i,row:s,rowSpan:l=1,style:a,...c}){const u=Me(i),{gutters:d,registerCell:p}=Nt(),y=x.useRef(null),m=Ne(y,r);return ne(()=>{const f=y.current;if(f!==null)return p({column:n,columnSpan:o,element:f,id:u,row:s,rowSpan:l})},[n,o,u,p,s,l]),W.jsx("div",{...c,className:t,"data-cell":!0,"data-testid":u,id:u,ref:m,style:{overflow:"auto",...a,minHeight:0,minWidth:0,gridColumn:dt(n,o,d.column),gridRow:dt(s,l,d.row)},children:e})}jt.displayName="Cell";let Be;function _t(){return Be===void 0&&(typeof matchMedia=="function"?Be=!!matchMedia("(pointer:coarse)").matches:Be=!1),Be}function Ze({expandHitTargets:e,axis:t,rect:n}){const o=e?_t()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine:0;if(n.width<o){const r=o-n.width;n=new DOMRect(n.x-r/2,n.y,n.width+r,n.height)}if(n.height<o){const r=o-n.height;n=new DOMRect(n.x,n.y-r/2,n.width,n.height+r)}return n}function ft({axis:e,cells:t,index:n,rect:o}){let r=[o];for(const i of t){const s=e==="column"?i.column:i.row,l=e==="column"?i.columnSpan:i.rowSpan;if(s>=n||s+l<=n)continue;const a=i.element.getBoundingClientRect(),c=e==="column"?a.top:a.left,u=e==="column"?a.bottom:a.right;u<=c||(r=r.flatMap(d=>{const p=e==="column"?d.top:d.left,y=e==="column"?d.bottom:d.right;if(c>=y||u<=p)return[d];const m=[],f=(S,h)=>{m.push(e==="column"?new DOMRect(d.x,S,d.width,h-S):new DOMRect(S,d.y,h-S,d.height))};return p<c&&f(p,c),y>u&&f(u,y),m}))}return r}function pn({axis:e,cells:t,crossTrackCount:n,expandHitTargets:o,resizeAxis:r,axisSize:i,includeDisabled:s,separatorPlacements:l}){const{items:a,separators:c}=r,u=a.length;let d=-1,p=-1,y=0;if(a.forEach((b,z)=>{b.constraintProps.disabled||(y++,d===-1&&(d=z),p=z)}),!s&&y<2)return[];const m=b=>s||b>d&&b<=p,f=[],S=(b,z,v)=>({axis:r,axisSize:i,items:[a[b-1],a[b]],rect:z,separator:v}),h=(b,z)=>{let v;for(const $ of t){const G=e==="column"?$.row:$.column,E=e==="column"?$.rowSpan:$.columnSpan;if(z==="start"?G===b:G+E-1===b){const P=$.element.getBoundingClientRect();if(z==="start"){const k=e==="column"?P.top:P.left;v=v===void 0?k:Math.min(v,k)}else{const k=e==="column"?P.bottom:P.right;v=v===void 0?k:Math.max(v,k)}}}return v},g=new Set;for(const b of c){const z=l.get(b);if(!z||z.index<1||z.index>=u||(g.add(z.index),!s&&(b.disabled||b.element.hasAttribute("aria-disabled")))||!m(z.index))continue;let v=b.element.getBoundingClientRect();const{crossSpan:$,crossStart:G}=z,E=$===void 0?n:G+$;let P=e==="column"?v.top:v.left,k=e==="column"?v.bottom:v.right;if(G>0){const L=h(G-1,"end");L!==void 0&&L<P&&(P=L)}if(E<n){const L=h(E,"start");L!==void 0&&L>k&&(k=L)}v=e==="column"?new DOMRect(v.x,P,v.width,k-P):new DOMRect(P,v.y,k-P,v.height),v=Ze({expandHitTargets:o,axis:r,rect:v}),s?f.push(S(z.index,v,b)):ft({axis:e,cells:t,index:z.index,rect:v}).forEach(L=>{f.push(S(z.index,L,b))})}const I=(b,z)=>{ft({axis:e,cells:t,index:b,rect:Ze({expandHitTargets:o,axis:r,rect:z})}).forEach(v=>{f.push(S(b,v))})},w=Array.from({length:n},()=>new Array(u));for(const b of t){const[z,v,$,G]=e==="column"?[b.column,b.columnSpan,b.row,b.rowSpan]:[b.row,b.rowSpan,b.column,b.columnSpan];for(let E=Math.max(0,$);E<Math.min(n,$+G);E++)for(let P=Math.max(0,z);P<Math.min(u,z+v);P++)w[E][P]??=b}const R=new Map,D=b=>{let z=R.get(b);if(!z){const v=b.element.getBoundingClientRect();z=e==="column"?{crossEnd:v.bottom,crossStart:v.top,end:v.right,start:v.left}:{crossEnd:v.right,crossStart:v.left,end:v.bottom,start:v.top},R.set(b,z)}return z},N=({crossEnd:b,crossStart:z,end:v,start:$})=>e==="column"?new DOMRect($,z,v-$,b-z):new DOMRect(z,$,b-z,v-$);for(let b=1;b<u;b++){if(g.has(b)||!m(b))continue;let z;for(let v=0;v<n;v++){const $=w[v][b-1],G=w[v][b];let E;if(($||G)&&$!==G){const P=$?D($):void 0,k=G?D(G):void 0,L=P?.end??k.start,M=k?.start??P.end,q=Math.max(P?.crossStart??-1/0,k?.crossStart??-1/0),J=Math.min(P?.crossEnd??1/0,k?.crossEnd??1/0);E={crossEnd:Math.max(q,J),crossStart:q,end:Math.max(L,M),start:Math.min(L,M)}}E?z=z?{crossEnd:Math.max(z.crossEnd,E.crossEnd),crossStart:Math.min(z.crossStart,E.crossStart),end:Math.max(z.end,E.end),start:Math.min(z.start,E.start)}:E:z&&(I(b,N(z)),z=void 0)}z&&I(b,N(z))}return f}function ae(e){const t=parseFloat(e??"");return Number.isFinite(t)?t:0}function hn({axis:e,element:t,gutterSizes:n,hasGutters:o,layout:r,trackIds:i}){const s=i.length,l=o?s*2-1:s,a=t.ownerDocument.defaultView?.getComputedStyle(t),c=e==="column"?a?.gridTemplateColumns:a?.gridTemplateRows;if(c){const f=c.trim().split(/\s+/);if(f.length===l&&f.every(S=>/^-?[\d.]+px$/.test(S))){const S=i.map((h,g)=>ae(f[o?g*2:g]));return{availableSize:S.reduce((h,g)=>h+g,0),trackSizes:S}}}const u=e==="column"?t.offsetWidth:t.offsetHeight,d=e==="column"?ae(a?.paddingLeft)+ae(a?.paddingRight)+ae(a?.borderLeftWidth)+ae(a?.borderRightWidth):ae(a?.paddingTop)+ae(a?.paddingBottom)+ae(a?.borderTopWidth)+ae(a?.borderBottomWidth),p=ae(e==="column"?a?.columnGap:a?.rowGap),y=n.reduce((f,S)=>f+S,0),m=Math.max(0,u-d-p*Math.max(0,l-1)-y);return{availableSize:m,trackSizes:i.map(f=>r&&r[f]!==void 0?r[f]/100*m:m/s)}}function Ft(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}class qt{#e={};addListener(t,n){const o=this.#e[t];return o===void 0?this.#e[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=this.#e[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let r=!1,i=null;const s=Array.from(o);for(let l=0;l<s.length;l++){const a=s[l];try{a.call(null,n)}catch(c){i===null&&(r=!0,i=c)}}if(r)throw i}}removeAllListeners(){this.#e={}}removeListener(t,n){const o=this.#e[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}let B={cursorFlags:0,state:"inactive"};const nt=new qt;function ie(){return B}function Bt(e){return nt.addListener("change",e)}function gn(e,t=[],n,o=!1){const r=B,i={...B};i.cursorFlags=e,i.state==="active"&&(i.didPointerMove||=o,i.previews=t,n&&(i.previewLayoutMap=n)),B=i,nt.emit("change",{prev:r,next:i})}function ue(e){const t=B;B=e,t.state==="active"&&e.state!=="active"&&t.didPointerMove&&t.hitRegions.forEach(({separator:n})=>{n&&n.element.ownerDocument.activeElement===n.element&&n.element.blur()}),nt.emit("change",{prev:t,next:e})}function yn(e){B.state!=="active"||!B.previews.some(t=>t.separator===e)||ue({...B,previews:B.previews.map(t=>t.separator===e?{...t}:t)})}function Sn(e){if(B.state==="inactive")return!1;const t=B.hitRegions.filter(o=>o.axis!==e),n=B.state==="active"&&B.previews.some(o=>o.axis===e);if(t.length===B.hitRegions.length&&!n)return!1;if(t.length===0)ue({cursorFlags:0,state:"inactive"});else if(B.state==="active"){const o=new Map(B.initialLayoutMap),r=new Map(B.previewLayoutMap);o.delete(e),r.delete(e),ue({...B,cursorFlags:0,hitRegions:t,initialLayoutMap:o,previewLayoutMap:r,previews:B.previews.filter(i=>i.axis!==e)})}else ue({...B,hitRegions:t});return!0}const vn=e=>e,Xe=()=>{},Vt=1,Ht=2,Ut=4,Wt=8,mt=3,pt=12;let Ve;function ht(){return Ve===void 0&&(Ve=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Ve=!0)),Ve}function bn({cursorFlags:e,axes:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(i=>{if(!i.mutableState.disableCursor)switch(i.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&ht()){const i=(e&Vt)!==0,s=(e&Ht)!==0,l=(e&Ut)!==0,a=(e&Wt)!==0;if(i)return l?"se-resize":a?"ne-resize":"e-resize";if(s)return l?"sw-resize":a?"nw-resize":"w-resize";if(l)return"s-resize";if(a)return"n-resize"}break}}return ht()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const gt=new WeakMap;function je(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=gt.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const o=ie();switch(o.state){case"active":case"hover":{const r=bn({cursorFlags:o.cursorFlags,axes:o.hitRegions.map(s=>s.axis),state:o.state}),i=`*, *:hover {cursor: ${r} !important; }`;if(t===i)return;t=i,r?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}gt.set(e,{prevStyle:t,styleSheet:n})}function Ee({axis:e}){const{layoutStrategy:t,orientation:n,items:o}=e;return t?t.calculateAvailableSize():o.reduce((r,i)=>(r+=n==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function ot(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_DISCONNECTED?0:n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}function Ae(e,t){return Array.from(t).sort((n,o)=>{const r=e==="horizontal"?xn(n,o):wn(n,o);return r!==0?r:ot(n.element,o.element)})}function xn(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function wn(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function Qe(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Yt(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function zn({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,i=Number.MAX_VALUE;for(const s of t){const{x:l,y:a}=Yt(o,s),c=e==="horizontal"?l:a;c<i&&(i=c,r=s)}return O(r,"No rect found"),r}function rt({expandHitTargets:e=!0,axis:t,includeDisabled:n=!1}){if(t.layoutStrategy)return t.layoutStrategy.calculateHitRegions({expandHitTargets:e,axis:t,includeDisabled:n});const{element:o,orientation:r,items:i,separators:s}=t,l=Ae(r,Array.from(o.children).filter(Qe).filter(h=>!h.hasAttribute("data-resize-preview")).map(h=>({element:h}))).map(({element:h})=>h),a=[];let c=!1,u=!1,d=-1,p,y=-1,m=0,f,S=[];{let h=-1;for(const g of l)g.hasAttribute("data-panel")&&(h++,g.hasAttribute("data-disabled")||(m++,d===-1&&(d=h),y=h))}if(n||m>1){let h=-1;for(const g of l)if(g.hasAttribute("data-panel")){h++;const I=i.find(w=>w.element===g);if(I){if(f){const w=f.element.getBoundingClientRect(),R=g.getBoundingClientRect();let D;if(u){const N=r==="horizontal"?new DOMRect(w.right,w.top,0,w.height):new DOMRect(w.left,w.bottom,w.width,0),b=r==="horizontal"?new DOMRect(R.left,R.top,0,R.height):new DOMRect(R.left,R.top,R.width,0);switch(S.length){case 0:{D=[N,b];break}case 1:{const z=S[0],v=zn({orientation:r,rects:[w,R],targetRect:z.element.getBoundingClientRect()});D=[z,v===w?b:N];break}default:{D=S;break}}}else S.length?D=S:D=[r==="horizontal"?new DOMRect(w.right,R.top,R.left-w.right,R.height):new DOMRect(R.left,w.bottom,R.width,R.top-w.bottom)];for(const N of D){const b=Ze({expandHitTargets:e,axis:t,rect:"width"in N?N:N.element.getBoundingClientRect()}),z=h<=d||h>y;(n||!c&&!z)&&(p??=Ee({axis:t}),a.push({axis:t,axisSize:p,items:[f,I],separator:"width"in N?void 0:N,rect:b})),c=!1}}u=!1,f=I,S=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(c=!0);const I=s.find(w=>w.element===g);I?S.push(I):(f=void 0,S=[])}else u=!0}return a}function Ln(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function In(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function Cn(e){return e/100*window.innerHeight}function Rn(e){return e/100*window.innerWidth}function Le({axisSize:e,itemElement:t,styleProp:n}){let o;const[r,i]=Ft(n);switch(i){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=In(t,r);break}case"em":{o=Ln(t,r);break}case"vh":{o=Cn(r);break}case"vw":{o=Rn(r);break}}return o}function X(e){return parseFloat(e.toFixed(3))}function et(e){const{items:t}=e,n=Ee({axis:e});return n===0?t.map(o=>({groupResizeBehavior:o.constraintProps.groupResizeBehavior,collapsedSize:0,collapsible:o.constraintProps.collapsible===!0,defaultSize:void 0,disabled:o.constraintProps.disabled,minSize:0,maxSize:100,itemId:o.id})):t.map(o=>{const{element:r,constraintProps:i}=o;let s=0;if(i.collapsedSize!==void 0){const d=Le({axisSize:n,itemElement:r,styleProp:i.collapsedSize});s=X(d/n*100)}let l;if(i.collapsedThreshold!==void 0){const d=Le({axisSize:n,itemElement:r,styleProp:i.collapsedThreshold});l=X(d/n*100)}let a;if(i.defaultSize!==void 0){const d=Le({axisSize:n,itemElement:r,styleProp:i.defaultSize});a=X(d/n*100)}let c=0;if(i.minSize!==void 0){const d=Le({axisSize:n,itemElement:r,styleProp:i.minSize});c=X(d/n*100)}let u=100;if(i.maxSize!==void 0){const d=Le({axisSize:n,itemElement:r,styleProp:i.maxSize});u=X(d/n*100)}return{groupResizeBehavior:i.groupResizeBehavior,collapsedSize:s,collapsedThreshold:l,collapsible:i.collapsible===!0,defaultSize:a,disabled:i.disabled,minSize:c,maxSize:u,itemId:o.id}})}let ce=new Map;const Kt=new qt;function En(e){ce=new Map(ce),ce.delete(e)}function Ce(e,t){for(const[n]of ce)if(n.id===e)return n}function se(e,t){for(const[n,o]of ce)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function me(){return ce}function Oe(e,t){return Kt.addListener("axisChange",n=>{n.axis.id===e&&t(n)})}function de(e,t,n){const o=ce.get(e);ce=new Map(ce),ce.set(e,t),Kt.emit("axisChange",{axis:e,isUserInteraction:n?.isUserInteraction===!0,prev:o,next:t})}function Mn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function K(e,t,n=0){return Math.abs(X(e)-X(t))<=n}function le(e,t){return K(e,t)?0:e>t?1:-1}function Re({overrideDisabledItems:e,itemConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsedThreshold:i,collapsible:s,disabled:l,maxSize:a=100,minSize:c=0}=t;if(l&&!e)return n;if(le(o,c)<0)if(s){const u=i??(c-r)/2,d=le(n,r)<=0,p=d?r+u:c-u,y=le(o,p);le(o,r)<=0||y<0||i!==void 0&&d&&y===0?o=r:o=c}else o=c;return o=Math.min(a,o),o=X(o),o}function Ge({delta:e,initialLayout:t,itemConstraints:n,pivotIndices:o,prevLayout:r,trigger:i}){if(K(e,0))return t;const s=i==="imperative-api",l=n.map(({itemId:m})=>t[m]),a=n.map(({itemId:m})=>r[m]),c=[...l],[u,d]=o;O(u!=null,"Invalid first pivot index"),O(d!=null,"Invalid second pivot index");let p=0;switch(i){case"keyboard":{{const m=e<0?d:u,f=n[m];O(f,`Panel constraints not found for index ${m}`);const{collapsedSize:S=0,collapsible:h,minSize:g=0}=f;if(h){const I=l[m];if(O(I!=null,`Previous layout not found for panel index ${m}`),K(I,S)){const w=g-I;le(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const m=e<0?u:d,f=n[m];O(f,`No panel constraints found for index ${m}`);const{collapsedSize:S=0,collapsible:h,minSize:g=0}=f;if(h){const I=l[m];if(O(I!=null,`Previous layout not found for panel index ${m}`),K(I,g)){const w=I-S;le(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}break}default:{const m=e<0?d:u,f=n[m];O(f,`Panel constraints not found for index ${m}`);const S=l[m],{collapsedSize:h,collapsedThreshold:g,collapsible:I,minSize:w}=f;if(I&&le(S,w)<0){const R=w-h,D=g??R/2,N=S+Math.abs(e);if(le(N,w)<0){const b=le(Math.abs(e),D),z=g===void 0&&e<0;b>0||b===0&&z?e=e<0?-R:R:e=0}}break}}{const m=e<0?1:-1;let f=e<0?d:u,S=0;for(;;){const g=l[f];O(g!=null,`Previous layout not found for panel index ${f}`);const w=Re({overrideDisabledItems:s,itemConstraints:n[f],prevSize:g,size:100})-g;if(S+=w,f+=m,f<0||f>=n.length)break}const h=Math.min(Math.abs(e),Math.abs(S));e=e<0?0-h:h}{let f=e<0?u:d;for(;f>=0&&f<n.length;){const S=Math.abs(e)-Math.abs(p),h=l[f];O(h!=null,`Previous layout not found for panel index ${f}`);const g=h-S,I=Re({overrideDisabledItems:s,itemConstraints:n[f],prevSize:h,size:g});if(!K(h,I)&&(p+=h-I,c[f]=I,p.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Mn(a,c))return r;{const m=e<0?d:u,f=l[m];O(f!=null,`Previous layout not found for panel index ${m}`);const S=f+p,h=Re({overrideDisabledItems:s,itemConstraints:n[m],prevSize:f,size:S});if(c[m]=h,!K(h,S)){let g=S-h,w=e<0?d:u;for(;w>=0&&w<n.length;){const R=c[w];O(R!=null,`Previous layout not found for panel index ${w}`);const D=R+g,N=Re({overrideDisabledItems:s,itemConstraints:n[w],prevSize:R,size:D});if(K(R,N)||(g-=N-R,c[w]=N),K(g,0))break;e>0?w--:w++}}}const y=Object.values(c).reduce((m,f)=>f+m,0);return K(y,100,.1)?c.reduce((m,f,S)=>(m[n[S].itemId]=f,m),{}):r}function re(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||le(e[n],t[n])!==0)return!1;return!0}function it({commit:e,document:t,event:n,hitRegions:o,initialLayoutMap:r,mountedAxes:i,pointerDownAtPoint:s,prevCursorFlags:l}){let a=0;const c=ie();let u=c.state==="active"?c.previews:[];const d=new Map(c.state==="active"?c.previewLayoutMap:void 0);o.forEach(m=>{const{axis:f,axisSize:S}=m,{orientation:h,items:g}=f;if(e&&f.resizePreviewMode!=="separator")return;const{disableCursor:I}=f.mutableState;let w=0;s?h==="horizontal"?w=(n.clientX-s.x)/S*100:w=(n.clientY-s.y)/S*100:h==="horizontal"?w=n.clientX<0?-100:100:w=n.clientY<0?-100:100;const R=r.get(f),D=i.get(f);if(!R||!D)return;const{defaultLayoutDeferred:N,derivedItemConstraints:b,axisSize:z,layout:v,separatorToItems:$}=D;if(b&&v&&$){const G=f.resizePreviewMode==="separator"?d.get(f)??v:v,E=Ge({delta:w,initialLayout:R,itemConstraints:b,pivotIndices:m.items.map(P=>g.indexOf(P)),prevLayout:G,trigger:"mouse-or-touch"});if(f.resizePreviewMode==="separator"&&!e&&!re(E,G)){d.set(f,E);let P=0;const k=g.map(L=>(P+=E[L.id]-R[L.id],P*(S/100)));u=u.map(L=>{if(L.axis!==f)return L;const M=k[L.itemIndex];return M===L.offset?L:{...L,offset:M}})}if(re(E,G)&&w!==0&&!I)switch(h){case"horizontal":{a|=w<0?Vt:Ht;break}case"vertical":{a|=w<0?Ut:Wt;break}}(f.resizePreviewMode!=="separator"||e)&&!re(E,v)&&de(m.axis,{defaultLayoutDeferred:N,derivedItemConstraints:b,axisSize:z,layout:E,requestedAxisSize:z,requestedLayout:E,separatorToItems:$})}});let p=0;n.movementX===0?p|=l&mt:p|=a&mt,n.movementY===0?p|=l&pt:p|=a&pt;const y=c.state==="active"&&(n.clientX!==c.pointerDownAtPoint.x||n.clientY!==c.pointerDownAtPoint.y);gn(p,u,d,y),je(t)}function Xt(e,t){const n=ie(),o=me();let r=!1;switch(n.state){case"active":it({commit:!0,document:e,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:o,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags}),ue({cursorFlags:0,state:"inactive"}),n.hitRegions.length>0&&(je(e),r=!0,n.hitRegions.forEach(i=>{if(!o.has(i.axis))return;const s=se(i.axis.id,!0);de(i.axis,s,{isUserInteraction:!0})}))}return r}function yt(e){e.defaultPrevented||Xt(e.currentTarget,e)}function Pn(e,t,n){let o,r={x:1/0,y:1/0};for(const i of t){const s=Yt(n,i.rect);switch(e){case"horizontal":{(s.x<r.x||s.x===r.x&&s.y<=r.y)&&(o=i,r=s);break}case"vertical":{(s.y<r.y||s.y===r.y&&s.x<=r.x)&&(o=i,r=s);break}}}return o?{distance:r,hitRegion:o}:void 0}function kn(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Tn(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:bt(e),b:bt(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();O(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:vt(St(n.a)),b:vt(St(n.b))};if(r.a===r.b){const i=o.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let l=i.length;for(;l--;){const a=i[l];if(a===s.a)return 1;if(a===s.b)return-1}}return Math.sign(r.a-r.b)}const $n=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function An(e){const t=getComputedStyle(Jt(e)??e).display;return t==="flex"||t==="inline-flex"}function Dn(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||An(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||$n.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function St(e){let t=e.length;for(;t--;){const n=e[t];if(O(n,"Missing node"),Dn(n))return n}return null}function vt(e){return e&&Number(getComputedStyle(e).zIndex)||0}function bt(e){const t=[];for(;e;)t.push(e),e=Jt(e);return t}function Jt(e){const{parentNode:t}=e;return kn(t)?t.host:t}function On(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Gn(e){try{return e.matches(":modal")}catch{return!1}}function Nn({axisElement:e,hitRegion:t,pointerEventTarget:n}){if(Qe(n)){const o=n.closest("dialog");if(o&&!o.contains(e)&&Gn(o))return!1}if(!Qe(n)||n.contains(e)||e.contains(n))return!0;if(Tn(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(On(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function st(e,t){const n=[];return t.forEach((o,r)=>{if(r.disabled)return;const i=rt({axis:r}),s=Pn(r.orientation,i,{x:e.clientX,y:e.clientY});s&&s.distance.x<=0&&s.distance.y<=0&&Nn({axisElement:r.element,hitRegion:s.hitRegion.rect,pointerEventTarget:e.target})&&n.push(s.hitRegion)}),n}function he({layout:e,itemConstraints:t}){const n=t.map(({itemId:s})=>e[s]),o=[...n],r=o.reduce((s,l)=>s+l,0);if(Object.keys(e).length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${Object.values(e).map(s=>`${s}%`).join(", ")}`);if(!K(r,100)&&o.length>0)for(let s=0;s<t.length;s++){const l=o[s];O(l!=null,`No layout data found for index ${s}`);const a=100/r*l;o[s]=a}let i=0;for(let s=0;s<t.length;s++){const l=n[s];O(l!=null,`No layout data found for index ${s}`);const a=o[s];O(a!=null,`No layout data found for index ${s}`);const c=Re({overrideDisabledItems:!0,itemConstraints:t[s],prevSize:l,size:a});a!=c&&(i+=a-c,o[s]=c)}if(!K(i,0))for(let s=0;s<t.length;s++){const l=o[s];O(l!=null,`No layout data found for index ${s}`);const a=l+i,c=Re({overrideDisabledItems:!0,itemConstraints:t[s],prevSize:l,size:a});if(l!==c&&(i-=c-l,o[s]=c,K(i,0)))break}return o.reduce((s,l,a)=>(s[t[a].itemId]=l,s),{})}function at({axisId:e,itemId:t}){const n=()=>{const a=me();for(const[c,{defaultLayoutDeferred:u,derivedItemConstraints:d,layout:p,axisSize:y,separatorToItems:m}]of a)if(c.id===e)return{defaultLayoutDeferred:u,derivedItemConstraints:d,axis:c,axisSize:y,layout:p,separatorToItems:m};throw Error(`Group ${e} not found`)},o=()=>{const a=n().derivedItemConstraints.find(c=>c.itemId===t);if(a!==void 0)return a;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const a=n().axis.items.find(c=>c.id===t);if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},i=()=>{const a=n().layout[t];if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},s=({nextSize:a,items:c,prevLayout:u,derivedItemConstraints:d})=>{const p=i(),y=c.findIndex(h=>h.id===t),m=y===0,f=y===c.length-1;if(f&&a<p&&(m||c.slice(0,y).every((h,g)=>{const I=d[g];return I?.collapsible&&K(I.collapsedSize,u[I.itemId])}))){const h=c.slice(0,y).reduce((g,I)=>g+u[I.id],0);return{...u,[t]:X(100-h)}}return Ge({delta:f?p-a:a-p,initialLayout:u,itemConstraints:d,pivotIndices:f?[y-1,y]:[y,y+1],prevLayout:u,trigger:"imperative-api"})},l=a=>{const c=i();if(a===c)return;const{defaultLayoutDeferred:u,derivedItemConstraints:d,axis:p,axisSize:y,layout:m,separatorToItems:f}=n(),S=s({nextSize:a,items:p.items,prevLayout:m,derivedItemConstraints:d}),h=he({layout:S,itemConstraints:d});re(m,h)||de(p,{defaultLayoutDeferred:u,derivedItemConstraints:d,axisSize:y,layout:h,requestedAxisSize:y,requestedLayout:h,separatorToItems:f})};return{collapse:()=>{const{collapsible:a,collapsedSize:c}=o(),{mutableValues:u}=r(),d=i();a&&d!==c&&(u.expandToSize=d,l(c))},expand:()=>{const{collapsible:a,collapsedSize:c,minSize:u}=o(),{mutableValues:d}=r(),p=i();if(a&&p===c){let y=d.expandToSize??u;y===0&&(y=1),l(y)}},getSize:()=>{const{axis:a}=n(),c=i(),{element:u}=r(),d=a.layoutStrategy?a.layoutStrategy.getItemSizeInPixels(t):a.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:a,collapsedSize:c}=o(),u=i();return a&&K(c,u)},resize:a=>{const{axis:c}=n(),{element:u}=r(),d=Ee({axis:c}),p=Le({axisSize:d,itemElement:u,styleProp:a}),y=X(p/d*100);l(y)}}}function xt(e){if(e.defaultPrevented)return;const t=me();st(e,t).forEach(o=>{if(o.separator&&!o.separator.disableDoubleClick){const r=o.items.find(i=>i.constraintProps.defaultSize!==void 0);if(r){const i=r.constraintProps.defaultSize,s=at({axisId:o.axis.id,itemId:r.id});s&&i!==void 0&&(s.resize(i),e.preventDefault())}}})}function Zt(e){const t=me();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function De({axisId:e}){const t=()=>{const n=me();for(const[o,r]of n)if(o.id===e)return{axis:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedItemConstraints:r,axis:i,axisSize:s,layout:l,separatorToItems:a}=t(),c=he({layout:n,itemConstraints:r});return o?l:(re(l,c)||de(i,{defaultLayoutDeferred:o,derivedItemConstraints:r,axisSize:s,layout:c,requestedAxisSize:s,requestedLayout:c,separatorToItems:a}),c)}}}function be(e,t){const n=Zt(e),o=se(n.id,!0),r=n.separators.find(d=>d.element===e);O(r,"Matching separator not found");const i=o.separatorToItems.get(r);O(i,"Matching panels not found");const s=i.map(d=>n.items.indexOf(d)),a=De({axisId:n.id}).getLayout(),c=Ge({delta:t,initialLayout:a,itemConstraints:o.derivedItemConstraints,pivotIndices:s,prevLayout:a,trigger:"keyboard"}),u=he({layout:c,itemConstraints:o.derivedItemConstraints});re(a,u)||de(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedItemConstraints:o.derivedItemConstraints,axisSize:o.axisSize,layout:u,requestedAxisSize:o.axisSize,requestedLayout:u,separatorToItems:o.separatorToItems},{isUserInteraction:!0})}function wt(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Zt(t);if(!(n.disabled||n.separators.find(r=>r.element===t)?.disabled))switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&be(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&be(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&be(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&be(t,-5);break}case"End":{e.preventDefault(),be(t,100);break}case"Enter":{e.preventDefault();const r=se(n.id,!0),{derivedItemConstraints:i,layout:s,separatorToItems:l}=r,a=n.separators.find(p=>p.element===t);O(a,"Matching separator not found");const c=l.get(a);O(c,"Matching panels not found");const u=c[0],d=i.find(p=>p.itemId===u.id);if(O(d,"Panel metadata not found"),d.collapsible){const p=s[u.id],y=d.collapsedSize===p?n.mutableState.expandedItemSizes[u.id]??d.minSize:d.collapsedSize;be(t,y-p)}break}case"F6":{e.preventDefault();const r=n.separators.map(a=>a.element),i=Array.from(r).findIndex(a=>a===e.currentTarget);O(i!==null,"Index not found");const s=e.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[s].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),be(t,-100);break}}}function Ue(e){const t=ie();if(t.state!=="active")return!1;const n=me();return t.previewLayoutMap.forEach((o,r)=>{const i=n.get(r);r.resizePreviewMode==="separator"&&i&&!re(o,i.layout)&&de(r,{...i,layout:o,requestedAxisSize:i.axisSize,requestedLayout:o})}),ue({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{if(!n.has(o.axis))return;const r=se(o.axis.id,!0);de(o.axis,r,{isUserInteraction:!0})}),je(e),!0}function zt(e){const t=ie();if(t.state!=="active")return;const n=t.hitRegions.flatMap(({separator:o})=>o?[o.element]:[]);!n.some(o=>o===e.target)||n.some(o=>o.hasPointerCapture?.(e.pointerId))||Ue(e.currentTarget)}function Lt(e){Ue(e.currentTarget)}function jn(e,t){const{element:n,orientation:o,items:r}=e,i=n.getBoundingClientRect(),s=o==="horizontal";return rt({expandHitTargets:!1,axis:e,includeDisabled:!0}).map(({items:a,rect:c,separator:u},d)=>{const p=r.indexOf(a[0]),y=s?c.left+c.width/2:c.top+c.height/2;return{active:t.some(f=>{if(f.axis!==e||f.items[0]!==a[0])return!1;if(u||f.separator)return f.separator===u;const S=s?f.rect.left+f.rect.width/2:f.rect.top+f.rect.height/2;return K(y,S)}),axis:e,key:u?`separator-${u.id}`:`panel-${a[0].id}-${d}`,offset:0,itemIndex:p,rect:new DOMRect((s&&!u?y:c.left)-i.left-n.clientLeft+n.scrollLeft,(!s&&!u?y:c.top)-i.top-n.clientTop+n.scrollTop,s&&!u?0:c.width,!s&&!u?0:c.height),separator:u}})}function It(e){if(e.defaultPrevented)return;if(e.pointerType==="mouse"&&e.button>0)return;const t=me(),n=st(e,t);if(n.length===0)return;const o=new Map;let r=!1;n.forEach(s=>{s.separator&&(r||(r=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const l=t.get(s.axis);l&&o.set(s.axis,l.layout)});const i=Array.from(o.keys()).flatMap(s=>s.resizePreviewMode==="separator"?jn(s,n):[]);ue({cursorFlags:0,didPointerMove:!1,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},previewLayoutMap:new Map(o),previews:i,state:"active"}),e.preventDefault()}function Ct(e){const t=me(),n=ie();switch(n.state){case"active":it({commit:!1,document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:t,prevCursorFlags:n.cursorFlags})}}function Rt(e){if(e.defaultPrevented)return;const t=ie(),n=me();switch(t.state){case"active":{if(e.buttons===0){Ue(e.currentTarget);return}for(const o of t.hitRegions)if(o.separator){const{element:r}=o.separator;r.isConnected&&!r.hasPointerCapture?.(e.pointerId)&&r.setPointerCapture?.(e.pointerId)}it({commit:!1,document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedAxes:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=st(e,n);o.length===0?t.state!=="inactive"&&ue({cursorFlags:0,state:"inactive"}):ue({cursorFlags:0,hitRegions:o,state:"hover"}),je(e.currentTarget);break}}}function Et(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(ie().state){case"hover":ue({cursorFlags:0,state:"inactive"})}}function Mt(e){if(e.defaultPrevented)return;if(e.pointerType==="mouse"&&e.button>0)return;Xt(e.currentTarget,e)&&e.preventDefault()}function Pt(e){e.target===e.currentTarget&&Ue(e.currentTarget.document)}function _n(e){let t=0,n=0;const o={};for(const i of e)if(i.defaultSize!==void 0){t++;const s=X(i.defaultSize);n+=s,o[i.itemId]=s}else o[i.itemId]=void 0;const r=e.length-t;if(r!==0){const i=X((100-n)/r);for(const s of e)s.defaultSize===void 0&&(o[s.itemId]=i)}return o}function Fn(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}function kt({axis:e,itemConstraints:t}){const n=e.items.map(({id:r})=>r).join(","),o=e.mutableState.defaultLayout;return e.mutableState.layouts[n]??(o&&Fn(e.items,o)?o:_n(t))}function Tt({itemIds:e,layout:t}){return he({layout:t,itemConstraints:e.map(n=>({collapsedSize:0,collapsible:!1,defaultSize:void 0,disabled:void 0,itemId:n,maxSize:100,minSize:0}))})}function qn(e,t,n){if(!n[0])return;const r=e.items.find(c=>c.element===t);if(!r||!r.onResize)return;const i=Ee({axis:e}),s=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,a={asPercentage:X(s/i*100),inPixels:s};r.mutableValues.prevSize=a,r.onResize(a,r.id,l)}function Qt(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const o in e)if(e[o]!==t[o])return!1;return!0}function Bn(e,t){return e.length!==t.length?!1:e.every((n,o)=>Qt(n,t[o]))}function Vn({axis:e,nextAxisSize:t,prevAxisSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,i=0,s=!1;const l=new Map,a=[];for(const d of e.items){const p=o[d.id]??0;switch(d.constraintProps.groupResizeBehavior){case"preserve-pixel-size":{s=!0;const y=p/100*n,m=X(y/t*100);l.set(d.id,m),r+=m;break}case"preserve-relative-size":default:{a.push(d.id),i+=p;break}}}if(!s||a.length===0)return o;const c=100-r,u={...o};if(l.forEach((d,p)=>{u[p]=d}),i>0)for(const d of a){const p=o[d]??0;u[d]=X(p/i*c)}else{const d=X(c/a.length);for(const p of a)u[p]=d}return u}const ze=new Map;function en(e){let t=!0;O(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,i=new n(m=>{for(const f of m){const{borderBoxSize:S,target:h}=f;if(h===e.element){if(t){const g=Ee({axis:e});if(g===0)return;const I=se(e.id);if(!I)return;const w=et(e);let R=I.requestedAxisSize,D=I.requestedLayout;I.defaultLayoutDeferred&&(R=g,D=Tt({itemIds:e.items.map(({id:z})=>z),layout:kt({axis:e,itemConstraints:w})}));const N=Vn({axis:e,nextAxisSize:g,prevAxisSize:R,prevLayout:D}),b=he({layout:N,itemConstraints:w});if(!I.defaultLayoutDeferred&&re(I.layout,b)&&Bn(I.derivedItemConstraints,w)&&I.axisSize===g)continue;de(e,{defaultLayoutDeferred:!1,derivedItemConstraints:w,axisSize:g,layout:b,requestedAxisSize:R,requestedLayout:D,separatorToItems:I.separatorToItems})}}else qn(e,h,S)}});i.observe(e.element),e.items.forEach(m=>{O(!o.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.onResize&&i.observe(m.element)});const s=Ee({axis:e}),l=et(e),a=kt({axis:e,itemConstraints:l}),c=he({layout:a,itemConstraints:l}),u=e.element.ownerDocument,d=u.defaultView;ze.set(u,(ze.get(u)??0)+1);const p=new Map;return rt({axis:e,includeDisabled:!0}).forEach(m=>{m.separator&&p.set(m.separator,m.items)}),de(e,{defaultLayoutDeferred:s===0,derivedItemConstraints:l,axisSize:s,layout:c,requestedAxisSize:s,requestedLayout:Tt({itemIds:e.items.map(({id:m})=>m),layout:a}),separatorToItems:p}),e.separators.forEach(m=>{O(!r.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.element.addEventListener("keydown",wt)}),ze.get(u)===1&&(u.addEventListener("contextmenu",yt,!0),u.addEventListener("dblclick",xt,!0),u.addEventListener("lostpointercapture",zt,!0),u.addEventListener("pointercancel",Lt,!0),u.addEventListener("pointerdown",It,!0),u.addEventListener("pointerleave",Ct),u.addEventListener("pointermove",Rt),u.addEventListener("pointerout",Et),u.addEventListener("pointerup",Mt,!0),d?.addEventListener("blur",Pt)),function(){t=!1,ze.set(u,Math.max(0,(ze.get(u)??0)-1)),En(e),Sn(e)&&je(u),e.separators.forEach(f=>{f.element.removeEventListener("keydown",wt)}),ze.get(u)||(u.removeEventListener("contextmenu",yt,!0),u.removeEventListener("dblclick",xt,!0),u.removeEventListener("lostpointercapture",zt,!0),u.removeEventListener("pointercancel",Lt,!0),u.removeEventListener("pointerdown",It,!0),u.removeEventListener("pointerleave",Ct),u.removeEventListener("pointermove",Rt),u.removeEventListener("pointerout",Et),u.removeEventListener("pointerup",Mt,!0),d?.removeEventListener("blur",Pt)),i.disconnect()}}function tn({derivedItemConstraints:e,axis:t,layout:n,prevLayout:o,requestedLayout:r}){const i=t.items.map(({id:s})=>s).join(",");t.mutableState.layouts[i]=r,o&&e.forEach(s=>{if(s.collapsible){const l=K(s.collapsedSize,n[s.itemId]),a=K(s.collapsedSize,o[s.itemId]);l&&!a&&(t.mutableState.expandedItemSizes[s.itemId]=o[s.itemId])}})}function nn(){const[e,t]=x.useState({}),n=x.useCallback(()=>t({}),[]);return[e,n]}function We(e){const t=x.useRef({...e});return ne(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const lt=x.createContext(null);function Hn({layout:e,itemConstraints:t,itemId:n,itemIndex:o}){let r,i;const s=e[n],l=t.find(a=>a.itemId===n);if(l){const a=l.maxSize,c=l.collapsible?l.collapsedSize:l.minSize,u=[o,o+1];i=he({layout:Ge({delta:c-s,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n],r=he({layout:Ge({delta:a-s,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:i,valueNow:s}}function on({attributes:e,axisId:t,axisOrientation:n,children:o,className:r,disableCursor:i,disabled:s,disableDoubleClick:l,elementRef:a,id:c,isSharedHitRegion:u,preview:d,registerSeparator:p,requiredStyle:y,style:m,styleDefaults:f,tabIndex:S=0,updateSeparatorProps:h}){const g=We({disabled:s,disableDoubleClick:l,children:o,className:r,preview:d,style:m}),[I,w]=x.useState({}),[R,D]=x.useState("inactive"),[N,b]=x.useState(!1),z=x.useRef(null),v=x.useRef(null),$=Ne(z,a),G=n==="horizontal"?"vertical":"horizontal";ne(()=>{const k=z.current;if(k!==null){const L={disabled:g.disabled,disableDoubleClick:g.disableDoubleClick,element:k,id:c,get children(){return g.children},get className(){return g.className},get preview(){return g.preview},get style(){return g.style}};v.current=L;const M=p(L),q=Bt(V=>{D(V.next.state!=="inactive"&&V.next.hitRegions.some(Z=>Z.separator===L||(u?.(Z)??!1))?V.next.state:"inactive")}),J=Oe(t,V=>{const{derivedItemConstraints:Z,layout:ge,separatorToItems:xe}=V.next,we=xe.get(L);if(we){const ye=we[0],C=Z.findIndex(_=>_.itemId===ye.id),{layoutStrategy:T}=V.axis;w({...Hn({layout:ge,itemConstraints:Z,itemId:ye.id,itemIndex:C}),...T?.getItemAriaControls&&{valueControls:T.getItemAriaControls(ye.id)}})}});return()=>{v.current=null,q(),J(),M()}}},[t,c,u,p,g]),ne(()=>{const k=v.current;k&&yn(k)},[d]),x.useEffect(()=>{h(c,{disabled:s,disableDoubleClick:l})},[s,l,c,h]);let E;s&&!i&&(E="not-allowed");let P;if(s)P="disabled";else switch(R){case"active":{P="active";break}default:N?P="focus":P=R}return W.jsx("div",{...e,"aria-controls":I.valueControls,"aria-disabled":s||void 0,"aria-orientation":G,"aria-valuemax":I.valueMax,"aria-valuemin":I.valueMin,"aria-valuenow":I.valueNow,children:o,className:r,"data-separator":P,"data-testid":c,id:c,onBlur:()=>b(!1),onFocus:()=>b(!0),ref:$,role:"separator",style:{...f,cursor:E,...m,...y,touchAction:"none"},tabIndex:s?void 0:S})}function $t({axis:e,children:t,className:n,crossSpan:o,crossStart:r,disabled:i,elementRef:s,index:l,style:a}){const c=Me(void 0),{getDisableCursor:u,getResizeAxisId:d,gutters:p,registerSeparator:y,separatorPlacements:m,trackCounts:f,updateSeparatorProps:S}=Nt(),h=d(e),g=e==="column"?"row":"column",I=f[g],w=!!i||!tt(l,f[e]);let R=!0;for(const v of m.values())if(v.axis===e&&v.index===l&&!v.disabled&&v.crossStart<r){R=!1;break}const D=x.useCallback(v=>v.axis.id===h&&v.axis.items.indexOf(v.items[1])===l,[h,l]),N=x.useCallback(v=>y({axis:e,crossSpan:o,crossStart:r,disabled:!!i,index:l},v),[e,o,r,i,l,y]),b=fn(l),z=mn({crossCount:I,crossSpan:o,crossStart:r,hasGutters:p[g]});return W.jsx(on,{axisId:h,axisOrientation:e==="column"?"horizontal":"vertical",className:n,disableCursor:u(),disabled:w,disableDoubleClick:void 0,elementRef:s,id:c,isSharedHitRegion:D,registerSeparator:N,requiredStyle:{gridColumn:e==="column"?b:z,gridRow:e==="row"?b:z},style:a,tabIndex:R?0:-1,updateSeparatorProps:S,children:t})}function ct(e){const{children:t,className:n,disabled:o,elementRef:r,style:i}=e;return e.type==="column"?W.jsx($t,{axis:"column",className:n,crossSpan:e.rowSpan,crossStart:e.row??0,disabled:o,elementRef:r,index:e.column,style:i,children:t}):W.jsx($t,{axis:"row",className:n,crossSpan:e.columnSpan,crossStart:e.column??0,disabled:o,elementRef:r,index:e.row,style:i,children:t})}ct.displayName="Gridline";const Ie=["column","row"],At={columns:{},rows:{}};function rn({children:e,className:t,columns:n,defaultLayout:o,disableCursor:r,disabled:i,elementRef:s,gridRef:l,id:a,onLayoutChange:c,onLayoutChanged:u,resizeTargetMinimumSize:d={coarse:20,fine:10},rows:p,style:y,...m}){const f=Me(a),S=x.useCallback(C=>C==="column"?`${f}:columns`:`${f}:rows`,[f]),h=Dt(n,"columns"),g=Dt(p,"rows"),I=C=>C==="column"?h:g,w=x.useRef({onLayoutChange:At,onLayoutChanged:At}),R=pe(C=>{Ot(w.current.onLayoutChange,C)||(w.current.onLayoutChange=C,c?.(C))}),D=pe((C,T,_)=>{Ot(w.current.onLayoutChanged,C)||(w.current.onLayoutChanged=C,u?.(C,{isUserInteraction:T,requestedLayout:_}))}),N=x.useRef(null),b=Ne(N,s),[z,v]=nn(),$=x.useRef({cells:[],column:{expandedItemSizes:{},layouts:{}},loggedErrors:new Set,row:{expandedItemSizes:{},layouts:{}},separators:new Map}),G={column:!1,row:!1};for(const C of $.current.separators.values())G[C.axis]=!0;sn(e,G);const E=We({defaultLayout:o,disableCursor:r,resizeTargetMinimumSize:d}),P=pe(()=>!!E.disableCursor),k=x.useCallback(C=>{const T=$.current;return T.cells=[...T.cells,C],v(),()=>{T.cells=T.cells.filter(_=>_!==C),v()}},[v]),L=x.useCallback((C,T)=>{const _=$.current;return _.separators=new Map(_.separators),_.separators.set(T,C),v(),()=>{_.separators=new Map(_.separators),_.separators.delete(T),v()}},[v]),M=x.useCallback((C,{disabled:T,disableDoubleClick:_})=>{for(const j of $.current.separators.keys())j.id===C&&(j.disabled=T,j.disableDoubleClick=_)},[]),q=$.current.separators,J=x.useMemo(()=>({getDisableCursor:P,getResizeAxisId:S,gutters:{column:G.column,row:G.row},id:f,registerCell:k,registerSeparator:L,separatorPlacements:q,trackCounts:{column:h.length,row:g.length},updateSeparatorProps:M}),[h.length,P,S,G.column,G.row,f,k,L,g.length,q,M]),V=x.useRef([]);ne(()=>{const C=N.current;if(C===null)return;const T=$.current,_=Wn({cells:T.cells,separatorPlacements:T.separators,trackCounts:{column:h.length,row:g.length}});_.forEach(A=>{T.loggedErrors.has(A)||console.error(A)}),T.loggedErrors=new Set(_);const j=A=>Array.from(T.separators.entries()).filter(([,Y])=>Y.axis===A).sort(([,Y],[,Se])=>Y.index-Se.index).map(([Y])=>Y),F=A=>{const Y=A==="column"?h:g,Se=A==="column"?g:h,fe=Y.map(Q=>Q.id),_e=S(A),Fe=j(A),ve=Fe.length>0,qe=Y.map(({id:Q,...oe},ee)=>({element:C,id:fe[ee],idIsStable:!0,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:void 0,constraintProps:oe})),ke=()=>{const Q=[];if(ve){for(const[oe,ee]of T.separators)if(ee.axis===A&&tt(ee.index,Y.length)){const $e=oe.element.getBoundingClientRect();Q[ee.index]=Math.max(Q[ee.index]??0,A==="column"?$e.width:$e.height)}}return hn({axis:A,element:C,gutterSizes:Q.filter(oe=>oe!==void 0),hasGutters:ve,layout:se(_e)?.layout,trackIds:fe})};let Te;const Ke=E.defaultLayout?.[A==="column"?"columns":"rows"];if(Ke!==void 0&&Object.keys(Ke).length===fe.length){Te={};for(const Q of fe){const oe=Ke[Q];oe!==void 0&&(Te[Q]=oe)}}return{disabled:!!i,element:C,id:_e,layoutStrategy:{getItemAriaControls:Q=>{const oe=fe.indexOf(Q);return T.cells.filter(ee=>{const $e=A==="column"?ee.column:ee.row,un=A==="column"?ee.columnSpan:ee.rowSpan;return $e<=oe&&oe<$e+un}).map(ee=>ee.element.id).filter(Boolean).join(" ")||void 0},calculateAvailableSize:()=>ke().availableSize,calculateHitRegions:({expandHitTargets:Q,axis:oe,includeDisabled:ee})=>pn({axis:A,cells:T.cells,crossTrackCount:Se.length,expandHitTargets:Q,resizeAxis:oe,axisSize:ke().availableSize,includeDisabled:ee,separatorPlacements:T.separators}),getItemSizeInPixels:Q=>ke().trackSizes[fe.indexOf(Q)]??0},mutableState:{defaultLayout:Te,disableCursor:!!E.disableCursor,expandedItemSizes:T[A].expandedItemSizes,layouts:T[A].layouts},orientation:A==="column"?"horizontal":"vertical",items:qe,resizePreviewMode:"panel",get resizeTargetMinimumSize(){return E.resizeTargetMinimumSize},separators:Fe}},H=Ie.map(F);V.current=H;const U=H.map(A=>en(A)),te=()=>{const[A,Y]=H.map(Se=>se(Se.id));if(!(!A||!Y||A.defaultLayoutDeferred||Y.defaultLayoutDeferred))return{layout:{columns:A.layout,rows:Y.layout},requestedLayout:{columns:A.requestedLayout,rows:Y.requestedLayout}}};{const A=te();A&&(R(A.layout),D(A.layout,!1,A.requestedLayout))}const Pe=H.map(A=>Oe(A.id,Y=>{const{defaultLayoutDeferred:Se,derivedItemConstraints:fe,layout:_e,requestedLayout:Fe}=Y.next;if(Se||fe.length===0)return;tn({derivedItemConstraints:fe,axis:A,layout:_e,prevLayout:Y.prev?.layout,requestedLayout:Fe});const ve=te();if(ve){const qe=ie(),ke=qe.state!=="active"||!qe.hitRegions.some(Te=>H.includes(Te.axis));R(ve.layout),ke&&D(ve.layout,Y.isUserInteraction,ve.requestedLayout)}}));return()=>{V.current=[],U.forEach(A=>A()),Pe.forEach(A=>A())}},[h,i,S,f,D,R,g,z,E]),x.useEffect(()=>{V.current.forEach(C=>{C.mutableState.defaultLayout=o?.[C.orientation==="horizontal"?"columns":"rows"],C.mutableState.disableCursor=!!r})}),x.useImperativeHandle(l,()=>{const C=()=>{const[j,F]=Ie.map(S);return!Ce(j)||!Ce(F)?{columns:{},rows:{}}:{columns:De({axisId:j}).getLayout(),rows:De({axisId:F}).getLayout()}},T=j=>j.map(F=>`"${F}"`).join(", "),_=(j,F)=>{const H=S(j),U=()=>{const te=Ce(H);return O(te,`Grid "${f}" has not been mounted`),O(te.items.some(Pe=>Pe.id===F),`Grid "${f}" no longer contains a ${j} with id "${F}"; ${j} ids are ${T(te.items.map(Pe=>Pe.id))}`),at({axisId:H,itemId:F})};return{collapse:()=>U().collapse(),expand:()=>U().expand(),getSize:()=>U().getSize(),isCollapsed:()=>U().isCollapsed(),resize:te=>U().resize(te)}};return{getLayout:C,getTrackById:(j,F)=>{const H=j==="column"?h:g,U=`${F}`;return O(H.some(te=>te.id===U),`Grid "${f}" does not contain a ${j} with id "${U}"; ${j} ids are ${T(H.map(te=>te.id))}`),_(j,U)},getTrackByIndex:(j,F)=>{const H=j==="column"?h:g,U=Number.isInteger(F)?H[F]:void 0;return O(U,`Grid "${f}" does not contain a ${j} at index ${F}; it has ${H.length} ${j}s`),_(j,U.id)},setLayout:j=>(Ie.forEach(F=>{const H=j[F==="column"?"columns":"rows"],U=S(F);H&&Ce(U)&&De({axisId:U}).setLayout(H)}),C())}},[h,S,f,g]);const Z=()=>Ie.map(C=>{const T=se(S(C)),_=I(C);return(T&&!T.defaultLayoutDeferred?_.map(F=>`minmax(0, ${T.layout[F.id]??1}fr)`):Un(_,o?.[C==="column"?"columns":"rows"])).join(G[C]?" auto ":" ")}).join("|"),ge=x.useCallback(C=>{const T=Ie.map(_=>Oe(S(_),C));return()=>T.forEach(_=>_())},[S]),xe=x.useSyncExternalStore(ge,Z,Z),[we,ye]=xe.split("|");return W.jsx(Gt.Provider,{value:J,children:W.jsx("div",{...m,className:t,"data-grid":!0,"data-testid":f,id:f,ref:b,style:{height:"100%",width:"100%",overflow:"hidden",...y,display:"grid",gridTemplateColumns:we,gridTemplateRows:ye,touchAction:"none"},children:W.jsx(lt.Provider,{value:null,children:e})})})}rn.displayName="Grid";function Dt(e,t){const n=JSON.stringify(e);return x.useMemo(()=>{const o=typeof e=="number"?Array.from({length:e},(r,i)=>({id:`${i}`})):e.map((r,i)=>({...r,id:`${r.id??i}`}));return O(o.length>0,`Grid must have at least one track; "${t}" is ${n}`),o},[n])}function sn(e,t){x.Children.forEach(e,n=>{if(x.isValidElement(n))if(n.type===ct){const{type:o}=n.props;o==="column"?t.column=!0:o==="row"&&(t.row=!0)}else typeof n.type=="symbol"&&n.props!==null&&typeof n.props=="object"&&"children"in n.props&&sn(n.props.children,t)})}function Un(e,t){if(t)return e.map(i=>`minmax(0, ${t[i.id]??1}fr)`);const n=e.map(i=>i.defaultSize===void 0?void 0:Ft(i.defaultSize));let o=100,r=0;return n.forEach(i=>{i===void 0?r++:i[1]==="%"&&(o-=i[0])}),n.map(i=>{if(i===void 0)return`minmax(0, ${Math.max(0,o)/Math.max(1,r)}fr)`;const[s,l]=i;return l==="%"?`minmax(0, ${s}fr)`:`${s}${l}`})}function Wn({cells:e,separatorPlacements:t,trackCounts:n}){const o=[];for(const l of e)Ie.forEach(a=>{const[c,u]=a==="column"?[l.column,l.columnSpan]:[l.row,l.rowSpan],d=n[a];(!Number.isInteger(c)||!Number.isInteger(u)||c<0||u<1||c+u>d)&&o.push(`Invalid Cell ${a} placement (${a}: ${c}, ${a}Span: ${u}); Grid has ${d} ${a}s`)});const r=({axis:l,crossSpan:a,crossStart:c,disabled:u,index:d})=>{const p=l==="column"?"row":"column";let y=`type="${l}" ${l}={${d}}`;return(c!==0||a!==void 0)&&(y+=` ${p}={${c}}`),a!==void 0&&(y+=` ${p}Span={${a}}`),u&&(y+=" disabled"),`<Gridline ${y} />`},i=Array.from(t.values()).filter(l=>{const{axis:a,crossSpan:c,crossStart:u,index:d}=l,p=a==="column"?"row":"column",y=n[a],m=n[p];let f=!0;return tt(d,y)||(o.push(`Invalid ${a} Gridline ${a} (${d}); must be between 1 and ${y-1}`),f=!1),!Number.isInteger(u)||u<0||u>=m?(o.push(`Invalid ${a} Gridline ${p} (${u}); must be between 0 and ${m-1}`),f=!1):c!==void 0&&(!Number.isInteger(c)||c<1||u+c>m)&&(o.push(`Invalid ${a} Gridline ${p}Span (${c}); Grid has ${m} ${p}s`),f=!1),f}),s=l=>{const a=n[l.axis==="column"?"row":"column"];return[l.crossStart,l.crossSpan===void 0?a:l.crossStart+l.crossSpan]};return i.forEach((l,a)=>{const{axis:c,index:u}=l,[d,p]=s(l);for(const y of e){const[m,f,S,h]=c==="column"?[y.column,y.columnSpan,y.row,y.rowSpan]:[y.row,y.rowSpan,y.column,y.columnSpan];if(m<u&&u<m+f&&S<p&&d<S+h){const g=c==="column"?"row":"column";o.push(`${r(l)} overlaps a Cell that spans across it (${c}: ${m}, ${c}Span: ${f}, ${g}: ${S}, ${g}Span: ${h}); use the ${g} and ${g}Span props to render gridlines beside the Cell instead`)}}for(const y of i.slice(a+1))if(y.axis===c&&y.index===u){const[m,f]=s(y);m<p&&d<f&&o.push(`${r(l)} overlaps ${r(y)}`)}}),o}function Ot(e,t){return re(e.columns,t.columns)&&re(e.rows,t.rows)}function Yn({id:e,onlySaveAfterUserInteractions:t,storage:n=localStorage}){const o=`react-resizable-panels:grid:${e}`,r=x.useSyncExternalStore(Kn,()=>n.getItem(o),()=>n.getItem(o)),i=x.useMemo(()=>{if(r)try{const l=JSON.parse(r);if(l!==null&&typeof l=="object")return l}catch{}},[r]),s=x.useCallback((l,a)=>{if(!(t&&!a.isUserInteraction))try{n.setItem(o,JSON.stringify(a.requestedLayout??l))}catch(c){console.error(c)}},[t,n,o]);return{defaultLayout:i,onLayoutChanged:s}}function Kn(){return function(){}}function Xn(){return x.useState(null)}function Jn(){return x.useRef(null)}function Zn(e){for(let t=1;t<e.length;t++)if(ot(e[t-1],e[t])>0)return!1;return!0}function Qn({separator:e}){const{element:t}=e,n=x.useRef(null);return ne(()=>{const o=t.cloneNode(!0),r=[t,...t.querySelectorAll("*")],i=[o,...o.querySelectorAll("*")],s=t.ownerDocument.defaultView;return r.forEach((l,a)=>{const c=i[a];if(c instanceof s.HTMLElement||c instanceof s.SVGElement){const u=s.getComputedStyle(l);for(let d=0;d<u.length;d++){const p=u.item(d);c.style.setProperty(p,u.getPropertyValue(p))}}c.removeAttribute("data-testid"),c.removeAttribute("id")}),Object.assign(o.style,{boxSizing:"border-box",height:"100%",margin:"0",position:"static",transform:"none",width:"100%"}),n.current.appendChild(o),()=>o.remove()},[t]),W.jsx("div",{ref:n,style:{height:"100%",opacity:.65,pointerEvents:"none",width:"100%"}})}function Ye(){const e=x.useContext(lt);return O(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function ut(e){const{registerOverlay:t}=Ye(),n=x.useRef(e);Qt(n.current,e)||(n.current=e);const o=n.current;return ne(()=>t(o),[t,o]),null}ut.displayName="SeparatorOverlay";function eo({active:e,orientation:t,style:n,...o}){let r;switch(t){case"horizontal":{r={height:"100%",minWidth:"1px"};break}case"vertical":{r={minHeight:"1px",width:"100%"};break}}return W.jsx("div",{...o,"data-separator-overlay":e?"active":"inactive",style:{...r,...n,flexShrink:0,pointerEvents:"none"}})}function to({overlay:e,preview:t}){const{axis:n,offset:o,rect:r,separator:i}=t,s=n.orientation==="horizontal";let l=i?.preview,a=e;return x.isValidElement(l)&&l.type===ut&&(a=l.props,l=void 0),l==null&&(a?l=W.jsx(eo,{...a,active:t.active,orientation:n.orientation}):i&&(l=W.jsx(Qn,{separator:i}))),W.jsx("div",{"aria-hidden":"true","data-resize-preview":!0,inert:!0,style:{height:r.height,left:r.left,pointerEvents:"none",position:"absolute",top:r.top,transform:s?`translateX(${o}px)`:`translateY(${o}px)`,width:r.width},children:l})}function no(e){return Array.from(e).sort(ot)}function oo(e,t){const n=x.useRef({getLayout:()=>({}),setLayout:vn});x.useImperativeHandle(t,()=>n.current,[]),ne(()=>{Object.assign(n.current,De({axisId:e}))})}function ro({groupId:e,resizePreviewMode:t}){const[n,o]=x.useState([]),r=x.useRef(n);return ne(()=>{const i=l=>{const a=Ce(e),c=t==="separator"&&l.state==="active"?l.previews.filter(d=>d.axis===a&&(d.active||!K(d.offset,0))):[],u=r.current;u.length===c.length&&c.every((d,p)=>d===u[p])||(r.current=c,o(c))};if(t!=="separator"){i(ie());return}const s=Bt(({next:l})=>i(l));return i(ie()),s},[e,t]),n}function an({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:i,groupRef:s,id:l,onLayoutChange:a,onLayoutChanged:c,orientation:u="horizontal",resizePreviewMode:d="panel",resizeTargetMinimumSize:p={coarse:20,fine:10},style:y,...m}){const f=x.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=pe(L=>{re(f.current.onLayoutChange,L)||(f.current.onLayoutChange=L,a?.(L))}),h=pe((L,M,q)=>{re(f.current.onLayoutChanged,L)||(f.current.onLayoutChanged=L,c?.(L,{isUserInteraction:M,requestedLayout:q}))}),g=Me(l),[I,w]=x.useState(),R=ro({groupId:g,resizePreviewMode:d}),D=x.useRef(null),[N,b]=nn(),z=x.useRef([]),v=x.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),$=Ne(D,i);oo(g,s);const G=pe((L,M)=>{const q=se(L);if(q)return{flexGrow:q.layout[M]??1};if(n?.[M])return{flexGrow:n?.[M]}}),E=We({defaultLayout:n,disableCursor:o,resizeTargetMinimumSize:p}),P=x.useMemo(()=>({get disableCursor(){return!!E.disableCursor},getPanelStyles:G,id:g,orientation:u,registerPanel:L=>{const M=v.current;return M.panels=Ae(u,[...M.panels,L]),b(),()=>{M.panels=M.panels.filter(q=>q!==L),b()}},registerOverlay:L=>(w(L),()=>{w(void 0)}),registerSeparator:L=>{const M=v.current;return M.separators=Ae(u,[...M.separators,L]),b(),()=>{M.separators=M.separators.filter(q=>q!==L),b()}},updatePanelProps:(L,{disabled:M})=>{const J=v.current.panels.find(ge=>ge.id===L);J&&(J.constraintProps.disabled=M);const V=Ce(g),Z=se(g);V&&Z&&de(V,{...Z,derivedItemConstraints:et(V)})},updateSeparatorProps:(L,{disabled:M,disableDoubleClick:q})=>{const V=v.current.separators.find(Z=>Z.id===L);V&&(V.disabled=M,V.disableDoubleClick=q)}}),[G,g,b,u,E]),k=x.useRef(null);return ne(()=>{const L=D.current;if(L===null)return;const M=v.current;M.panels=Ae(u,M.panels),M.separators=Ae(u,M.separators),z.current=no([...M.panels.map(({element:C})=>C),...M.separators.map(({element:C})=>C)]);let q;if(E.defaultLayout!==void 0&&Object.keys(E.defaultLayout).length===M.panels.length){q={};for(const C of M.panels){const T=E.defaultLayout[C.id];T!==void 0&&(q[C.id]=T)}}const J={disabled:!!r,element:L,id:g,mutableState:{defaultLayout:q,disableCursor:!!E.disableCursor,expandedItemSizes:v.current.lastExpandedPanelSizes,layouts:v.current.layouts},orientation:u,items:M.panels,resizePreviewMode:d,get resizeTargetMinimumSize(){return E.resizeTargetMinimumSize},separators:M.separators};k.current=J;const V=en(J),{defaultLayoutDeferred:Z,derivedItemConstraints:ge,layout:xe,requestedLayout:we}=se(J.id,!0);!Z&&ge.length>0&&(S(xe),h(xe,!1,we));const ye=Oe(g,C=>{const{defaultLayoutDeferred:T,derivedItemConstraints:_,layout:j,requestedLayout:F}=C.next;if(T||_.length===0)return;tn({derivedItemConstraints:_,axis:J,layout:j,prevLayout:C.prev?.layout,requestedLayout:F});const H=ie(),U=H.state!=="active"||!H.hitRegions.some(te=>te.axis===J);S(j),U&&h(j,C.isUserInteraction,F)});return()=>{k.current=null,V(),ye()}},[r,g,h,S,u,N,d,E]),ne(()=>{Zn(z.current)||b()}),x.useEffect(()=>{const L=k.current;L&&(L.mutableState.defaultLayout=n,L.mutableState.disableCursor=!!o)}),W.jsx(lt.Provider,{value:P,children:W.jsxs("div",{...m,className:t,"data-group":!0,"data-testid":g,id:g,ref:$,style:{height:"100%",width:"100%",overflow:"hidden",position:d==="separator"?"relative":void 0,...y,display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:u==="horizontal"?"pan-y":"pan-x"},children:[e,R.map(L=>W.jsx(to,{overlay:I,preview:L},L.key))]})})}an.displayName="Group";function He(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function io({id:e,panelIds:t,storage:n}){const o=He(e,[]),r=n.getItem(o);if(r)try{const i=JSON.parse(r);if(t){const s=t.join(","),l=i[s];if(l&&Array.isArray(l.layout)&&t.length===l.layout.length){const a={};for(let c=0;c<t.length;c++)a[t[c]]=l.layout[c];return a}}else{const s=Object.keys(i);if(s.length===1){const l=i[s[0]];if(l&&Array.isArray(l.layout)){const a=s[0].split(",");if(a.length===l.layout.length){const c={};for(let u=0;u<a.length;u++)c[a[u]]=l.layout[u];return c}}}}}catch{}}function so({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:o=localStorage,...r}){const i=n!==void 0,s="id"in r?r.id:r.groupId,l=He(s,n??[]),a=x.useSyncExternalStore(ao,()=>o.getItem(l),()=>o.getItem(l)),c=x.useMemo(()=>{if(a){const S=JSON.parse(a),h=Object.values(S);if(Array.from(h).every(g=>typeof g=="number"))return S}},[a]),u=x.useMemo(()=>{if(!c)return io({id:s,panelIds:n,storage:o})},[c,s,n,o]),d=c??u,p=x.useRef(null),y=x.useCallback(()=>{const S=p.current;S&&(p.current=null,clearTimeout(S))},[]);x.useLayoutEffect(()=>()=>{y()},[y]);const m=x.useCallback((S,h)=>{if(t&&!h.isUserInteraction)return;y();const g=h.requestedLayout??S;let I;i?I=He(s,Object.keys(g)):I=He(s,[]);try{o.setItem(I,JSON.stringify(g))}catch(w){console.error(w)}},[y,i,s,t,o]),f=x.useCallback(S=>{y(),e===0?m(S,{isUserInteraction:!1}):p.current=setTimeout(()=>{m(S,{isUserInteraction:!1})},e)},[y,e,m]);return{defaultLayout:d,onLayoutChange:f,onLayoutChanged:m}}function ao(){return function(){}}function lo(){return x.useState(null)}function co(){return x.useRef(null)}function uo(e,t){const{id:n}=Ye(),o=x.useRef({collapse:Xe,expand:Xe,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Xe});x.useImperativeHandle(t,()=>o.current,[]),ne(()=>{Object.assign(o.current,at({axisId:n,itemId:e}))})}function ln({children:e,className:t,collapsedSize:n="0%",collapsedThreshold:o,collapsible:r=!1,defaultSize:i,disabled:s,elementRef:l,groupResizeBehavior:a="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:p,panelRef:y,style:m,...f}){const S=!!c,h=Me(c),g=We({disabled:s}),I=x.useRef(null),w=Ne(I,l),{getPanelStyles:R,id:D,orientation:N,registerPanel:b,updatePanelProps:z}=Ye(),v=p!==null,$=pe((k,L,M)=>{p?.(k,c,M)});ne(()=>{const k=I.current;if(k!==null){const L={element:k,id:h,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:v?$:void 0,constraintProps:{groupResizeBehavior:a,collapsedSize:n,collapsedThreshold:o,collapsible:r,defaultSize:i,disabled:g.disabled,maxSize:u,minSize:d}};return b(L)}},[a,n,o,r,i,v,h,S,u,d,$,b,g]),x.useEffect(()=>{z(h,{disabled:s})},[s,h,z]),uo(h,y);const G=()=>{const k=R(D,h);if(k)return JSON.stringify(k)},E=x.useSyncExternalStore(k=>Oe(D,k),G,G);let P;return E?P=JSON.parse(E):i!==void 0?P={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:P={flexGrow:1},W.jsx("div",{...f,"data-disabled":s||void 0,"data-panel":!0,"data-testid":h,id:h,ref:w,style:{...fo,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...P},children:W.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...m,touchAction:N==="horizontal"?"pan-y":"pan-x"},children:e})})}ln.displayName="Panel";const fo={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function mo(){return x.useState(null)}function po(){return x.useRef(null)}const ho={flexBasis:"auto"},go={flexGrow:0,flexShrink:0};function cn({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:i,preview:s,style:l,...a}){const c=Me(i),{disableCursor:u,id:d,orientation:p,registerSeparator:y,updateSeparatorProps:m}=Ye();return W.jsx(on,{attributes:a,axisId:d,axisOrientation:p,className:t,disableCursor:u,disabled:n,disableDoubleClick:o,elementRef:r,id:c,preview:s,registerSeparator:y,requiredStyle:go,style:l,styleDefaults:ho,updateSeparatorProps:m,children:e})}cn.displayName="Separator";exports.Cell=jt;exports.Grid=rn;exports.Gridline=ct;exports.Group=an;exports.Panel=ln;exports.Separator=cn;exports.SeparatorOverlay=ut;exports.isCoarsePointer=_t;exports.useDefaultGridLayout=Yn;exports.useDefaultLayout=so;exports.useGridCallbackRef=Xn;exports.useGridRef=Jn;exports.useGroupCallbackRef=lo;exports.useGroupRef=co;exports.usePanelCallbackRef=mo;exports.usePanelRef=po;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react/jsx-runtime"),w=require("react");function Ke(e){return(typeof e=="number"||typeof e=="string")&&e!==""}function Ee(e){const t=w.useId();return Ke(e)?`${e}`:t}const ne=typeof window<"u"?w.useLayoutEffect:w.useEffect;function ge(e){const t=w.useRef(e);return ne(()=>{t.current=e},[e]),w.useCallback((...n)=>t.current?.(...n),[t])}function Fe(...e){return ge(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function _e(e,t){const n=e?.["data-testid"];return Ke(n)?`${n}`:Ke(t)?`${t}`:void 0}function rt(e,t){return t?e*2+1:e+1}function In(e,t){return t?e*2-1:e}function xt(e,t,n){const o=rt(e,n);return t===void 0?`${o} / -1`:`${o} / span ${In(t,n)}`}function Cn(e){return`${e*2} / span 1`}function Ln({crossCount:e,crossSpan:t,crossStart:n,hasGutters:o}){const r=t===void 0?e:n+t;if(n===0&&r===e)return"1 / -1";let i=rt(n,o),a=rt(r-1,o)+1;return o&&(n>0&&i--,r<e&&a++),`${i} / ${a}`}function ct(e,t){return Number.isInteger(e)&&e>=1&&e<t}function N(e,t="Assertion error"){if(!e)throw Error(t)}const Jt=w.createContext(null);function Zt(){const e=w.useContext(Jt);return N(e,"Grid Context not found; did you render a Cell or Gridline outside of a Grid?"),e}function Qt({children:e,className:t,column:n,columnSpan:o=1,elementRef:r,id:i,row:a,rowSpan:c=1,style:s,...u}){const l=Ee(i),{gutters:d,registerCell:h}=Zt(),p=w.useRef(null),m=Fe(p,r);return ne(()=>{const f=p.current;if(f!==null)return h({column:n,columnSpan:o,element:f,id:l,row:a,rowSpan:c})},[n,o,l,h,a,c]),W.jsx("div",{...u,className:t,"data-cell":!0,"data-testid":_e(u,i),id:l,ref:m,style:{overflow:"auto",...s,minHeight:0,minWidth:0,gridColumn:xt(n,o,d.column),gridRow:xt(a,c,d.row)},children:e})}Qt.displayName="Cell";let Ve;function en(){return Ve===void 0&&(typeof matchMedia=="function"?Ve=!!matchMedia("(pointer:coarse)").matches:Ve=!1),Ve}function it({expandHitTargets:e,axis:t,rect:n}){const o=e?en()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine:0;if(n.width<o){const r=o-n.width;n=new DOMRect(n.x-r/2,n.y,n.width+r,n.height)}if(n.height<o){const r=o-n.height;n=new DOMRect(n.x,n.y-r/2,n.width,n.height+r)}return n}function wt({axis:e,cells:t,index:n,rect:o}){let r=[o];for(const i of t){const a=e==="column"?i.column:i.row,c=e==="column"?i.columnSpan:i.rowSpan;if(a>=n||a+c<=n)continue;const s=i.element.getBoundingClientRect(),u=e==="column"?s.top:s.left,l=e==="column"?s.bottom:s.right;l<=u||(r=r.flatMap(d=>{const h=e==="column"?d.top:d.left,p=e==="column"?d.bottom:d.right;if(u>=p||l<=h)return[d];const m=[],f=(y,g)=>{m.push(e==="column"?new DOMRect(d.x,y,d.width,g-y):new DOMRect(y,d.y,g-y,d.height))};return h<u&&f(h,u),p>l&&f(l,p),m}))}return r}function Rn({axis:e,cells:t,crossTrackCount:n,expandHitTargets:o,resizeAxis:r,axisSize:i,includeDisabled:a,separatorPlacements:c}){const{items:s,separators:u}=r,l=s.length;let d=-1,h=-1,p=0;if(s.forEach((x,z)=>{x.constraintProps.disabled||(p++,d===-1&&(d=z),h=z)}),!a&&p<2)return[];const m=x=>a||x>d&&x<=h,f=[],y=(x,z,v)=>({axis:r,axisSize:i,items:[s[x-1],s[x]],rect:z,separator:v}),g=(x,z)=>{let v;for(const P of t){const A=e==="column"?P.row:P.column,k=e==="column"?P.rowSpan:P.columnSpan;if(z==="start"?A===x:A+k-1===x){const O=P.element.getBoundingClientRect();if(z==="start"){const R=e==="column"?O.top:O.left;v=v===void 0?R:Math.min(v,R)}else{const R=e==="column"?O.bottom:O.right;v=v===void 0?R:Math.max(v,R)}}}return v},S=new Set;for(const x of u){const z=c.get(x);if(!z||z.index<1||z.index>=l||(S.add(z.index),!a&&(x.disabled||x.element.hasAttribute("aria-disabled")))||!m(z.index))continue;let v=x.element.getBoundingClientRect();const{crossSpan:P,crossStart:A}=z,k=P===void 0?n:A+P;let O=e==="column"?v.top:v.left,R=e==="column"?v.bottom:v.right;if(A>0){const C=g(A-1,"end");C!==void 0&&C<O&&(O=C)}if(k<n){const C=g(k,"start");C!==void 0&&C>R&&(R=C)}v=e==="column"?new DOMRect(v.x,O,v.width,R-O):new DOMRect(O,v.y,R-O,v.height),v=it({expandHitTargets:o,axis:r,rect:v}),a?f.push(y(z.index,v,x)):wt({axis:e,cells:t,index:z.index,rect:v}).forEach(C=>{f.push(y(z.index,C,x))})}const I=(x,z)=>{wt({axis:e,cells:t,index:x,rect:it({expandHitTargets:o,axis:r,rect:z})}).forEach(v=>{f.push(y(x,v))})},b=Array.from({length:n},()=>new Array(l));for(const x of t){const[z,v,P,A]=e==="column"?[x.column,x.columnSpan,x.row,x.rowSpan]:[x.row,x.rowSpan,x.column,x.columnSpan];for(let k=Math.max(0,P);k<Math.min(n,P+A);k++)for(let O=Math.max(0,z);O<Math.min(l,z+v);O++)b[k][O]??=x}const E=new Map,G=x=>{let z=E.get(x);if(!z){const v=x.element.getBoundingClientRect();z=e==="column"?{crossEnd:v.bottom,crossStart:v.top,end:v.right,start:v.left}:{crossEnd:v.right,crossStart:v.left,end:v.bottom,start:v.top},E.set(x,z)}return z},$=({crossEnd:x,crossStart:z,end:v,start:P})=>e==="column"?new DOMRect(P,z,v-P,x-z):new DOMRect(z,P,x-z,v-P);for(let x=1;x<l;x++){if(S.has(x)||!m(x))continue;let z;for(let v=0;v<n;v++){const P=b[v][x-1],A=b[v][x];let k;if((P||A)&&P!==A){const O=P?G(P):void 0,R=A?G(A):void 0,C=O?.end??R.start,M=R?.start??O.end,B=Math.max(O?.crossStart??-1/0,R?.crossStart??-1/0),Z=Math.min(O?.crossEnd??1/0,R?.crossEnd??1/0);k={crossEnd:Math.max(B,Z),crossStart:B,end:Math.max(C,M),start:Math.min(C,M)}}k?z=z?{crossEnd:Math.max(z.crossEnd,k.crossEnd),crossStart:Math.min(z.crossStart,k.crossStart),end:Math.max(z.end,k.end),start:Math.min(z.start,k.start)}:k:z&&(I(x,$(z)),z=void 0)}z&&I(x,$(z))}return f}function ce(e){const t=parseFloat(e??"");return Number.isFinite(t)?t:0}function En({axis:e,element:t,gutterSizes:n,hasGutters:o,layout:r,trackIds:i}){const a=i.length,c=o?a*2-1:a,s=t.ownerDocument.defaultView?.getComputedStyle(t),u=e==="column"?s?.gridTemplateColumns:s?.gridTemplateRows;if(u){const f=u.trim().split(/\s+/);if(f.length===c&&f.every(y=>/^-?[\d.]+px$/.test(y))){const y=i.map((g,S)=>ce(f[o?S*2:S]));return{availableSize:y.reduce((g,S)=>g+S,0),trackSizes:y}}}const l=e==="column"?t.offsetWidth:t.offsetHeight,d=e==="column"?ce(s?.paddingLeft)+ce(s?.paddingRight)+ce(s?.borderLeftWidth)+ce(s?.borderRightWidth):ce(s?.paddingTop)+ce(s?.paddingBottom)+ce(s?.borderTopWidth)+ce(s?.borderBottomWidth),h=ce(e==="column"?s?.columnGap:s?.rowGap),p=n.reduce((f,y)=>f+y,0),m=Math.max(0,l-d-h*Math.max(0,c-1)-p);return{availableSize:m,trackSizes:i.map(f=>r&&r[f]!==void 0?r[f]/100*m:m/a)}}function tn(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}class nn{#e={};addListener(t,n){const o=this.#e[t];return o===void 0?this.#e[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=this.#e[t];if(o!==void 0){if(o.length===1){o[0].call(null,n);return}let r;const i=Array.from(o);for(let a=0;a<i.length;a++){const c=i[a];try{c.call(null,n)}catch(s){r??={error:s}}}if(r)throw r.error}}removeAllListeners(){this.#e={}}removeListener(t,n){const o=this.#e[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}let q={cursorFlags:0,state:"inactive"};const lt=new nn;function re(){return q}function ut(e){return lt.addListener("change",e)}function Mn(e,t=[],n,o=!1){const r=q,i={...q};i.cursorFlags=e,i.state==="active"&&(i.didPointerMove||=o,i.previews=t,n&&(i.previewLayoutMap=n)),q=i,lt.emit("change",{prev:r,next:i})}function de(e){const t=q;q=e,t.state==="active"&&e.state!=="active"&&t.didPointerMove&&t.hitRegions.forEach(({separator:n})=>{n&&n.element.ownerDocument.activeElement===n.element&&n.element.blur()}),lt.emit("change",{prev:t,next:e})}function Pn(e){q.state!=="active"||!q.previews.some(t=>t.separator===e)||de({...q,previews:q.previews.map(t=>t.separator===e?{...t}:t)})}function kn(e){if(q.state==="inactive")return;const t=q.hitRegions.filter(o=>o.axis!==e),n=q.state==="active"&&q.previews.some(o=>o.axis===e);if(!(t.length===q.hitRegions.length&&!n))if(t.length===0)de({cursorFlags:0,state:"inactive"});else if(q.state==="active"){const o=new Map(q.initialLayoutMap),r=new Map(q.previewLayoutMap);o.delete(e),r.delete(e),de({...q,cursorFlags:0,hitRegions:t,initialLayoutMap:o,previewLayoutMap:r,previews:q.previews.filter(i=>i.axis!==e)})}else de({...q,hitRegions:t})}const Tn=e=>e,ot=()=>{},on=1,rn=2,sn=4,an=8,zt=3,It=12;let Ue;function Ct(){return Ue===void 0&&(Ue=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Ue=!0)),Ue}function Dn({cursorFlags:e,axes:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(i=>{if(!i.mutableState.disableCursor)switch(i.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&Ct()){const i=(e&on)!==0,a=(e&rn)!==0,c=(e&sn)!==0,s=(e&an)!==0;if(i)return c?"se-resize":s?"ne-resize":"e-resize";if(a)return c?"sw-resize":s?"nw-resize":"w-resize";if(c)return"s-resize";if(s)return"n-resize"}break}}return Ct()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const Lt=new WeakMap;function Rt(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=Lt.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let o=re();switch(o.state!=="inactive"&&o.ownerDocument!==e&&(o={cursorFlags:0,state:"inactive"}),o.state){case"active":case"hover":{const r=Dn({cursorFlags:o.cursorFlags,axes:o.hitRegions.map(a=>a.axis),state:o.state}),i=`*, *:hover {cursor: ${r} !important; }`;if(t===i)return;t=i,r?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}Lt.set(e,{prevStyle:t,styleSheet:n})}function Et(e){return e.state==="inactive"?void 0:e.ownerDocument}function An({next:e,prev:t}){const n=Et(t),o=Et(e);n&&n!==o&&Rt(n),o&&Rt(o)}function Re({axis:e}){const{layoutStrategy:t,orientation:n,items:o}=e;return t?t.calculateAvailableSize():o.reduce((r,i)=>(r+=n==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function dt(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_DISCONNECTED?0:n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}function $e(e,t){return Array.from(t).sort((n,o)=>{const r=e==="horizontal"?$n(n,o):On(n,o);return r!==0?r:dt(n.element,o.element)})}function $n(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function On(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function st(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function cn(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Gn({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,i=Number.MAX_VALUE;for(const a of t){const{x:c,y:s}=cn(o,a),u=e==="horizontal"?c:s;u<i&&(i=u,r=a)}return N(r,"No rect found"),r}function ft({expandHitTargets:e=!0,axis:t,includeDisabled:n=!1}){if(t.layoutStrategy)return t.layoutStrategy.calculateHitRegions({expandHitTargets:e,axis:t,includeDisabled:n});const{element:o,orientation:r,items:i,separators:a}=t,c=$e(r,Array.from(o.children).filter(st).filter(g=>!g.hasAttribute("data-resize-preview")).map(g=>({element:g}))).map(({element:g})=>g),s=[];let u=!1,l=!1,d=-1,h,p=-1,m=0,f,y=[];{let g=-1;for(const S of c)S.hasAttribute("data-panel")&&(g++,S.hasAttribute("data-disabled")||(m++,d===-1&&(d=g),p=g))}if(n||m>1){let g=-1;for(const S of c)if(S.hasAttribute("data-panel")){g++;const I=i.find(b=>b.element===S);if(I){if(f){const b=f.element.getBoundingClientRect(),E=S.getBoundingClientRect();let G;if(l){const $=r==="horizontal"?new DOMRect(b.right,b.top,0,b.height):new DOMRect(b.left,b.bottom,b.width,0),x=r==="horizontal"?new DOMRect(E.left,E.top,0,E.height):new DOMRect(E.left,E.top,E.width,0);switch(y.length){case 0:{G=[$,x];break}case 1:{const z=y[0],v=Gn({orientation:r,rects:[b,E],targetRect:z.element.getBoundingClientRect()});G=[z,v===b?x:$];break}default:{G=y;break}}}else y.length?G=y:G=[r==="horizontal"?new DOMRect(b.right,E.top,E.left-b.right,E.height):new DOMRect(E.left,b.bottom,E.width,E.top-b.bottom)];for(const $ of G){const x=it({expandHitTargets:e,axis:t,rect:"width"in $?$:$.element.getBoundingClientRect()}),z=g<=d||g>p;(n||!u&&!z)&&(h??=Re({axis:t}),s.push({axis:t,axisSize:h,items:[f,I],separator:"width"in $?void 0:$,rect:x})),u=!1}}l=!1,f=I,y=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(u=!0);const I=a.find(b=>b.element===S);I?y.push(I):(f=void 0,y=[])}else l=!0}return s}function Nn(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function jn(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function Fn(e){return e/100*window.innerHeight}function _n(e){return e/100*window.innerWidth}function ze({axisSize:e,itemElement:t,styleProp:n}){let o;const[r,i]=tn(n);switch(i){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=jn(t,r);break}case"em":{o=Nn(t,r);break}case"vh":{o=Fn(r);break}case"vw":{o=_n(r);break}}return o}function J(e){return parseFloat(e.toFixed(3))}function at(e){const{items:t}=e,n=Re({axis:e});return n===0?t.map(o=>({groupResizeBehavior:o.constraintProps.groupResizeBehavior,collapsedSize:0,collapsible:o.constraintProps.collapsible===!0,defaultSize:void 0,disabled:o.constraintProps.disabled,minSize:0,maxSize:100,itemId:o.id})):t.map(o=>{const{element:r,constraintProps:i}=o;let a=0;if(i.collapsedSize!==void 0){const d=ze({axisSize:n,itemElement:r,styleProp:i.collapsedSize});a=J(d/n*100)}let c;if(i.collapsedThreshold!==void 0){const d=ze({axisSize:n,itemElement:r,styleProp:i.collapsedThreshold});c=J(d/n*100)}let s;if(i.defaultSize!==void 0){const d=ze({axisSize:n,itemElement:r,styleProp:i.defaultSize});s=J(d/n*100)}let u=0;if(i.minSize!==void 0){const d=ze({axisSize:n,itemElement:r,styleProp:i.minSize});u=J(d/n*100)}let l=100;if(i.maxSize!==void 0){const d=ze({axisSize:n,itemElement:r,styleProp:i.maxSize});l=J(d/n*100)}return{groupResizeBehavior:i.groupResizeBehavior,collapsedSize:a,collapsedThreshold:c,collapsible:i.collapsible===!0,defaultSize:s,disabled:i.disabled,minSize:u,maxSize:l,itemId:o.id}})}let ue=new Map;const mt=new nn;let Oe=0;const We=[];let Ye;function Je(){Oe++}function pt(){for(let e=0;e<We.length;e++)try{mt.emit("axisChange",We[e])}catch(t){Ye??={error:t}}We.length=0}function Ze(){if(Oe===1&&pt(),Oe--,Oe===0&&Ye){const{error:e}=Ye;throw Ye=void 0,e}}function Bn(e){ue=new Map(ue),ue.delete(e)}function Ce(e,t){for(const[n]of ue)if(n.id===e)return n}function ae(e,t){for(const[n,o]of ue)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function he(){return ue}function Ne(e,t){return mt.addListener("axisChange",n=>{n.axis.id===e&&t(n)})}function fe(e,t,n){const o=ue.get(e);ue=new Map(ue),ue.set(e,t);const r={axis:e,isUserInteraction:n?.isUserInteraction===!0,prev:o,next:t};Oe>0?We.push(r):mt.emit("axisChange",r)}function ln(e,{pointerId:t,pointerType:n}){return t===e.pointerId||n==="pen"&&e.pointerType==="pen"}function Qe(e,t,n={}){return e.ownerDocument===t&&(n.pointerId===void 0||ln(e,n))}function qn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Y(e,t,n=0){return Math.abs(J(e)-J(t))<=n}function le(e,t){return Y(e,t)?0:e>t?1:-1}function Le({overrideDisabledItems:e,itemConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsedThreshold:i,collapsible:a,disabled:c,maxSize:s=100,minSize:u=0}=t;if(c&&!e)return n;if(le(o,u)<0)if(a){const l=i??(u-r)/2,d=le(n,r)<=0,h=d?r+l:u-l,p=le(o,h);le(o,r)<=0||p<0||i!==void 0&&d&&p===0?o=r:o=u}else o=u;return o=Math.min(s,o),o=J(o),o}function je({delta:e,initialLayout:t,itemConstraints:n,pivotIndices:o,prevLayout:r,trigger:i}){if(Y(e,0))return t;const a=i==="imperative-api",c=n.map(({itemId:m})=>t[m]),s=n.map(({itemId:m})=>r[m]),u=[...c],[l,d]=o;N(l!=null,"Invalid first pivot index"),N(d!=null,"Invalid second pivot index");let h=0;switch(i){case"keyboard":{{const m=e<0?d:l,f=n[m];N(f,`Panel constraints not found for index ${m}`);const{collapsedSize:y=0,collapsible:g,minSize:S=0}=f;if(g){const I=c[m];if(N(I!=null,`Previous layout not found for panel index ${m}`),Y(I,y)){const b=S-I;le(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}{const m=e<0?l:d,f=n[m];N(f,`No panel constraints found for index ${m}`);const{collapsedSize:y=0,collapsible:g,minSize:S=0}=f;if(g){const I=c[m];if(N(I!=null,`Previous layout not found for panel index ${m}`),Y(I,S)){const b=I-y;le(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}break}default:{const m=e<0?d:l,f=n[m];N(f,`Panel constraints not found for index ${m}`);const y=c[m],{collapsedSize:g,collapsedThreshold:S,collapsible:I,minSize:b}=f;if(I&&le(y,b)<0){const E=b-g,G=S??E/2,$=y+Math.abs(e);if(le($,b)<0){const x=le(Math.abs(e),G),z=S===void 0&&e<0;x>0||x===0&&z?e=e<0?-E:E:e=0}}break}}{const m=e<0?1:-1;let f=e<0?d:l,y=0;for(;;){const S=c[f];N(S!=null,`Previous layout not found for panel index ${f}`);const b=Le({overrideDisabledItems:a,itemConstraints:n[f],prevSize:S,size:100})-S;if(y+=b,f+=m,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(y));e=e<0?0-g:g}{let f=e<0?l:d;for(;f>=0&&f<n.length;){const y=Math.abs(e)-Math.abs(h),g=c[f];N(g!=null,`Previous layout not found for panel index ${f}`);const S=g-y,I=Le({overrideDisabledItems:a,itemConstraints:n[f],prevSize:g,size:S});if(!Y(g,I)&&(h+=g-I,u[f]=I,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(qn(s,u))return r;{const m=e<0?d:l,f=c[m];N(f!=null,`Previous layout not found for panel index ${m}`);const y=f+h,g=Le({overrideDisabledItems:a,itemConstraints:n[m],prevSize:f,size:y});if(u[m]=g,!Y(g,y)){let S=y-g,b=e<0?d:l;for(;b>=0&&b<n.length;){const E=u[b];N(E!=null,`Previous layout not found for panel index ${b}`);const G=E+S,$=Le({overrideDisabledItems:a,itemConstraints:n[b],prevSize:E,size:G});if(Y(E,$)||(S-=$-E,u[b]=$),Y(S,0))break;e>0?b--:b++}}}const p=Object.values(u).reduce((m,f)=>f+m,0);return Y(p,100,.1)?u.reduce((m,f,y)=>(m[n[y].itemId]=f,m),{}):r}function ie(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||le(e[n],t[n])!==0)return!1;return!0}function ht(e){Je();try{Hn(e)}finally{Ze()}}function Hn({commit:e,event:t,hitRegions:n,initialLayoutMap:o,mountedAxes:r,pointerDownAtPoint:i,prevCursorFlags:a}){let c=0;const s=re();let u=s.state==="active"?s.previews:[];const l=new Map(s.state==="active"?s.previewLayoutMap:void 0);n.forEach(p=>{const{axis:m,axisSize:f}=p,{orientation:y,items:g}=m;if(e&&m.resizePreviewMode!=="separator")return;const{disableCursor:S}=m.mutableState;let I=0;i?y==="horizontal"?I=(t.clientX-i.x)/f*100:I=(t.clientY-i.y)/f*100:y==="horizontal"?I=t.clientX<0?-100:100:I=t.clientY<0?-100:100;const b=o.get(m),E=r.get(m);if(!b||!E)return;const{defaultLayoutDeferred:G,derivedItemConstraints:$,axisSize:x,layout:z,separatorToItems:v}=E;if($&&z&&v){const P=m.resizePreviewMode==="separator"?l.get(m)??z:z,A=je({delta:I,initialLayout:b,itemConstraints:$,pivotIndices:p.items.map(k=>g.indexOf(k)),prevLayout:P,trigger:"mouse-or-touch"});if(m.resizePreviewMode==="separator"&&!e&&!ie(A,P)){l.set(m,A);let k=0;const O=g.map(R=>(k+=A[R.id]-b[R.id],k*(f/100)));u=u.map(R=>{if(R.axis!==m)return R;const C=O[R.itemIndex];return C===R.offset?R:{...R,offset:C}})}if(ie(A,P)&&I!==0&&!S)switch(y){case"horizontal":{c|=I<0?on:rn;break}case"vertical":{c|=I<0?sn:an;break}}(m.resizePreviewMode!=="separator"||e)&&!ie(A,z)&&fe(p.axis,{defaultLayoutDeferred:G,derivedItemConstraints:$,axisSize:x,layout:A,requestedAxisSize:x,requestedLayout:A,separatorToItems:v})}});let d=0;t.movementX===0?d|=a&zt:d|=c&zt,t.movementY===0?d|=a&It:d|=c&It;const h=s.state==="active"&&(t.clientX!==s.pointerDownAtPoint.x||t.clientY!==s.pointerDownAtPoint.y);Mn(d,u,l,h)}function un(e,t){const n=re();if(n.state!=="active"||!Qe(n,e,t))return;const o=he();Je();try{ht({commit:!0,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:o,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags}),pt(),de({cursorFlags:0,state:"inactive"}),n.hitRegions.length>0&&(t.preventDefault?.(),n.hitRegions.forEach(r=>{if(!o.has(r.axis))return;const i=ae(r.axis.id,!0);fe(r.axis,i,{isUserInteraction:!0})}))}finally{Ze()}}function Mt(e){if(e.defaultPrevented)return;const{clientX:t,clientY:n,movementX:o,movementY:r}=e;un(e.currentTarget,{clientX:t,clientY:n,movementX:o,movementY:r})}function Vn(e,t,n){let o,r={x:1/0,y:1/0};for(const i of t){const a=cn(n,i.rect);switch(e){case"horizontal":{(a.x<r.x||a.x===r.x&&a.y<=r.y)&&(o=i,r=a);break}case"vertical":{(a.y<r.y||a.y===r.y&&a.x<=r.x)&&(o=i,r=a);break}}}return o?{distance:r,hitRegion:o}:void 0}function Un(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Wn(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Tt(e),b:Tt(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();N(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:kt(Pt(n.a)),b:kt(Pt(n.b))};if(r.a===r.b){const i=o.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let c=i.length;for(;c--;){const s=i[c];if(s===a.a)return 1;if(s===a.b)return-1}}return Math.sign(r.a-r.b)}const Yn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Xn(e){const t=getComputedStyle(dn(e)??e).display;return t==="flex"||t==="inline-flex"}function Kn(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Xn(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Yn.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Pt(e){let t=e.length;for(;t--;){const n=e[t];if(N(n,"Missing node"),Kn(n))return n}return null}function kt(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Tt(e){const t=[];for(;e;)t.push(e),e=dn(e);return t}function dn(e){const{parentNode:t}=e;return Un(t)?t.host:t}function Jn(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Zn(e){try{return e.matches(":modal")}catch{return!1}}function Qn({axisElement:e,hitRegion:t,pointerEventTarget:n}){if(st(n)){const o=n.closest("dialog");if(o&&!o.contains(e)&&Zn(o))return!1}if(!st(n)||n.contains(e)||e.contains(n))return!0;if(Wn(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(Jn(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function gt(e,t,n){const o=[];return t.forEach((r,i)=>{if(i.disabled||i.element.ownerDocument!==n)return;const a=ft({axis:i}),c=Vn(i.orientation,a,{x:e.clientX,y:e.clientY});c&&c.distance.x<=0&&c.distance.y<=0&&Qn({axisElement:i.element,hitRegion:c.hitRegion.rect,pointerEventTarget:e.target})&&o.push(c.hitRegion)}),o}function ye({layout:e,itemConstraints:t}){const n=t.map(({itemId:a})=>e[a]),o=[...n],r=o.reduce((a,c)=>a+c,0);if(Object.keys(e).length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${Object.values(e).map(a=>`${a}%`).join(", ")}`);if(!Y(r,100)&&o.length>0)for(let a=0;a<t.length;a++){const c=o[a];N(c!=null,`No layout data found for index ${a}`);const s=100/r*c;o[a]=s}let i=0;for(let a=0;a<t.length;a++){const c=n[a];N(c!=null,`No layout data found for index ${a}`);const s=o[a];N(s!=null,`No layout data found for index ${a}`);const u=Le({overrideDisabledItems:!0,itemConstraints:t[a],prevSize:c,size:s});s!=u&&(i+=s-u,o[a]=u)}if(!Y(i,0))for(let a=0;a<t.length;a++){const c=o[a];N(c!=null,`No layout data found for index ${a}`);const s=c+i,u=Le({overrideDisabledItems:!0,itemConstraints:t[a],prevSize:c,size:s});if(c!==u&&(i-=u-c,o[a]=u,Y(i,0)))break}return o.reduce((a,c,s)=>(a[t[s].itemId]=c,a),{})}function yt({axisId:e,itemId:t}){const n=()=>{const s=he();for(const[u,{defaultLayoutDeferred:l,derivedItemConstraints:d,layout:h,axisSize:p,separatorToItems:m}]of s)if(u.id===e)return{defaultLayoutDeferred:l,derivedItemConstraints:d,axis:u,axisSize:p,layout:h,separatorToItems:m};throw Error(`Group ${e} not found`)},o=()=>{const s=n().derivedItemConstraints.find(u=>u.itemId===t);if(s!==void 0)return s;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const s=n().axis.items.find(u=>u.id===t);if(s!==void 0)return s;throw Error(`Layout not found for Panel ${t}`)},i=()=>{const s=n().layout[t];if(s!==void 0)return s;throw Error(`Layout not found for Panel ${t}`)},a=({nextSize:s,items:u,prevLayout:l,derivedItemConstraints:d})=>{const h=i(),p=u.findIndex(g=>g.id===t),m=p===0,f=p===u.length-1;if(f&&s<h&&(m||u.slice(0,p).every((g,S)=>{const I=d[S];return I?.collapsible&&Y(I.collapsedSize,l[I.itemId])}))){const g=u.slice(0,p).reduce((S,I)=>S+l[I.id],0);return{...l,[t]:J(100-g)}}return je({delta:f?h-s:s-h,initialLayout:l,itemConstraints:d,pivotIndices:f?[p-1,p]:[p,p+1],prevLayout:l,trigger:"imperative-api"})},c=s=>{const u=i();if(s===u)return;const{defaultLayoutDeferred:l,derivedItemConstraints:d,axis:h,axisSize:p,layout:m,separatorToItems:f}=n(),y=a({nextSize:s,items:h.items,prevLayout:m,derivedItemConstraints:d}),g=ye({layout:y,itemConstraints:d});ie(m,g)||fe(h,{defaultLayoutDeferred:l,derivedItemConstraints:d,axisSize:p,layout:g,requestedAxisSize:p,requestedLayout:g,separatorToItems:f})};return{collapse:()=>{const{collapsible:s,collapsedSize:u}=o(),{mutableValues:l}=r(),d=i();s&&d!==u&&(l.expandToSize=d,c(u))},expand:()=>{const{collapsible:s,collapsedSize:u,minSize:l}=o(),{mutableValues:d}=r(),h=i();if(s&&h===u){let p=d.expandToSize??l;p===0&&(p=1),c(p)}},getSize:()=>{const{axis:s}=n(),u=i(),{element:l}=r(),d=s.layoutStrategy?s.layoutStrategy.getItemSizeInPixels(t):s.orientation==="horizontal"?l.offsetWidth:l.offsetHeight;return{asPercentage:u,inPixels:d}},isCollapsed:()=>{const{collapsible:s,collapsedSize:u}=o(),l=i();return s&&Y(u,l)},resize:s=>{const{axis:u}=n(),{element:l}=r(),d=Re({axis:u}),h=ze({axisSize:d,itemElement:l,styleProp:s}),p=J(h/d*100);c(p)}}}function Dt(e){if(e.defaultPrevented)return;const t=he();gt(e,t,e.currentTarget).forEach(o=>{if(o.separator&&!o.separator.disableDoubleClick){const r=o.items.find(i=>i.constraintProps.defaultSize!==void 0);if(r){const i=r.constraintProps.defaultSize,a=yt({axisId:o.axis.id,itemId:r.id});a&&i!==void 0&&(a.resize(i),e.preventDefault())}}})}function fn(e){const t=he();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function Ge({axisId:e}){const t=()=>{const n=he();for(const[o,r]of n)if(o.id===e)return{axis:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedItemConstraints:r,axis:i,axisSize:a,layout:c,separatorToItems:s}=t(),u=ye({layout:n,itemConstraints:r});return o?c:(ie(c,u)||fe(i,{defaultLayoutDeferred:o,derivedItemConstraints:r,axisSize:a,layout:u,requestedAxisSize:a,requestedLayout:u,separatorToItems:s}),u)}}}function ve(e,t){const n=fn(e),o=ae(n.id,!0),r=n.separators.find(d=>d.element===e);N(r,"Matching separator not found");const i=o.separatorToItems.get(r);N(i,"Matching panels not found");const a=i.map(d=>n.items.indexOf(d)),s=Ge({axisId:n.id}).getLayout(),u=je({delta:t,initialLayout:s,itemConstraints:o.derivedItemConstraints,pivotIndices:a,prevLayout:s,trigger:"keyboard"}),l=ye({layout:u,itemConstraints:o.derivedItemConstraints});ie(s,l)||fe(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedItemConstraints:o.derivedItemConstraints,axisSize:o.axisSize,layout:l,requestedAxisSize:o.axisSize,requestedLayout:l,separatorToItems:o.separatorToItems},{isUserInteraction:!0})}function At(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=fn(t);if(!(n.disabled||n.separators.find(r=>r.element===t)?.disabled))switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&ve(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&ve(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&ve(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&ve(t,-5);break}case"End":{e.preventDefault(),ve(t,100);break}case"Enter":{e.preventDefault();const r=ae(n.id,!0),{derivedItemConstraints:i,layout:a,separatorToItems:c}=r,s=n.separators.find(h=>h.element===t);N(s,"Matching separator not found");const u=c.get(s);N(u,"Matching panels not found");const l=u[0],d=i.find(h=>h.itemId===l.id);if(N(d,"Panel metadata not found"),d.collapsible){const h=a[l.id],p=d.collapsedSize===h?n.mutableState.expandedItemSizes[l.id]??d.minSize:d.collapsedSize;ve(t,p-h)}break}case"F6":{e.preventDefault();const r=n.separators.map(s=>s.element),i=Array.from(r).findIndex(s=>s===e.currentTarget);N(i!==null,"Index not found");const a=e.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),ve(t,-100);break}}}function Me(e,t){const n=re();if(n.state!=="active"||!Qe(n,e,t))return!1;const o=he();Je();try{n.previewLayoutMap.forEach((r,i)=>{const a=o.get(i);i.resizePreviewMode==="separator"&&a&&!ie(r,a.layout)&&fe(i,{...a,layout:r,requestedAxisSize:a.axisSize,requestedLayout:r})}),pt(),de({cursorFlags:0,state:"inactive"}),n.hitRegions.forEach(r=>{if(!o.has(r.axis))return;const i=ae(r.axis.id,!0);fe(r.axis,i,{isUserInteraction:!0})})}finally{Ze()}return!0}function $t(e){const t=re();if(t.state!=="active")return;const n=t.hitRegions.flatMap(({separator:o})=>o?[o.element]:[]);!n.some(o=>o===e.target)||n.some(o=>o.hasPointerCapture?.(e.pointerId))||Me(e.currentTarget,e)}function Ot(e){Me(e.currentTarget,e)}function eo(e,t){const{element:n,orientation:o,items:r}=e,i=n.getBoundingClientRect(),a=o==="horizontal";return ft({expandHitTargets:!1,axis:e,includeDisabled:!0}).map(({items:s,rect:u,separator:l},d)=>{const h=r.indexOf(s[0]),p=a?u.left+u.width/2:u.top+u.height/2;return{active:t.some(f=>{if(f.axis!==e||f.items[0]!==s[0])return!1;if(l||f.separator)return f.separator===l;const y=a?f.rect.left+f.rect.width/2:f.rect.top+f.rect.height/2;return Y(p,y)}),axis:e,key:l?`separator-${l.id}`:`panel-${s[0].id}-${d}`,offset:0,itemIndex:h,rect:new DOMRect((a&&!l?p:u.left)-i.left-n.clientLeft+n.scrollLeft,(!a&&!l?p:u.top)-i.top-n.clientTop+n.scrollTop,a&&!l?0:u.width,!a&&!l?0:u.height),separator:l}})}function Gt(e){if(e.defaultPrevented)return;if(e.pointerType==="mouse"&&e.button>0)return;const t=re();if(t.state==="active"){ln(t,e)&&Me(t.ownerDocument,t);return}const n=he(),o=gt(e,n,e.currentTarget);if(o.length===0)return;const r=new Map;let i=!1;o.forEach(c=>{c.separator&&(i||(i=!0,c.separator.element.focus({focusVisible:!1,preventScroll:!0})));const s=n.get(c.axis);s&&r.set(c.axis,s.layout)});const a=Array.from(r.keys()).flatMap(c=>c.resizePreviewMode==="separator"?eo(c,o):[]);de({cursorFlags:0,didPointerMove:!1,hitRegions:o,initialLayoutMap:r,ownerDocument:e.currentTarget,pointerDownAtPoint:{x:e.clientX,y:e.clientY},pointerId:e.pointerId,pointerType:e.pointerType,previewLayoutMap:new Map(r),previews:a,state:"active"}),e.preventDefault()}function Nt(e){const t=e.currentTarget,n=he(),o=re();switch(o.state){case"active":{if(!Qe(o,t,e))return;ht({commit:!1,event:e,hitRegions:o.hitRegions,initialLayoutMap:o.initialLayoutMap,mountedAxes:n,prevCursorFlags:o.cursorFlags})}}}function jt(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=re(),o=he();switch(n.state){case"active":{if(!Qe(n,t,e))return;if(e.buttons===0){Me(t,e);return}for(const r of n.hitRegions)if(r.separator){const{element:i}=r.separator;i.isConnected&&!i.hasPointerCapture?.(e.pointerId)&&i.setPointerCapture?.(e.pointerId)}ht({commit:!1,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:o,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags});break}default:{const r=gt(e,o,t);r.length===0?n.state!=="inactive"&&de({cursorFlags:0,state:"inactive"}):de({cursorFlags:0,hitRegions:r,ownerDocument:t,state:"hover"});break}}}function Ft(e){if(e.relatedTarget instanceof HTMLIFrameElement){const t=re();switch(t.state){case"hover":t.ownerDocument===e.currentTarget&&de({cursorFlags:0,state:"inactive"})}}}function _t(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||un(e.currentTarget,e)}function Bt(e){e.target===e.currentTarget&&Me(e.currentTarget.document)}function qt(e){Me(e.currentTarget.document)}function to(e){let t=0,n=0;const o={};for(const i of e)if(i.defaultSize!==void 0){t++;const a=J(i.defaultSize);n+=a,o[i.itemId]=a}else o[i.itemId]=void 0;const r=e.length-t;if(r!==0){const i=J((100-n)/r);for(const a of e)a.defaultSize===void 0&&(o[a.itemId]=i)}return o}function no(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}function Ht({axis:e,itemConstraints:t}){const n=e.items.map(({id:r})=>r).join(","),o=e.mutableState.defaultLayout;return e.mutableState.layouts[n]??(o&&no(e.items,o)?o:to(t))}function Vt({itemIds:e,layout:t}){return ye({layout:t,itemConstraints:e.map(n=>({collapsedSize:0,collapsible:!1,defaultSize:void 0,disabled:void 0,itemId:n,maxSize:100,minSize:0}))})}function oo(e,t,n){if(!n[0])return;const r=e.items.find(u=>u.element===t);if(!r||!r.onResize)return;const i=Re({axis:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,c=r.mutableValues.prevSize,s={asPercentage:J(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,c)}function mn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const o in e)if(e[o]!==t[o])return!1;return!0}function ro(e,t){return e.length!==t.length?!1:e.every((n,o)=>mn(n,t[o]))}function io({axis:e,nextAxisSize:t,prevAxisSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,i=0,a=!1;const c=new Map,s=[];for(const d of e.items){const h=o[d.id]??0;switch(d.constraintProps.groupResizeBehavior){case"preserve-pixel-size":{a=!0;const p=h/100*n,m=J(p/t*100);c.set(d.id,m),r+=m;break}case"preserve-relative-size":default:{s.push(d.id),i+=h;break}}}if(!a||s.length===0)return o;const u=100-r,l={...o};if(c.forEach((d,h)=>{l[h]=d}),i>0)for(const d of s){const h=o[d]??0;l[d]=J(h/i*u)}else{const d=J(u/s.length);for(const h of s)l[h]=d}return l}const we=new Map;let Ut=!1;function pn(e){let t=!0;N(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,i=new n(m=>{let f;Je();try{for(const y of m){const{borderBoxSize:g,target:S}=y;if(S===e.element){if(t){const I=Re({axis:e});if(I===0)break;const b=ae(e.id);if(!b)break;const E=at(e);let G=b.requestedAxisSize,$=b.requestedLayout;b.defaultLayoutDeferred&&(G=I,$=Vt({itemIds:e.items.map(({id:v})=>v),layout:Ht({axis:e,itemConstraints:E})}));const x=io({axis:e,nextAxisSize:I,prevAxisSize:G,prevLayout:$}),z=ye({layout:x,itemConstraints:E});if(!b.defaultLayoutDeferred&&ie(b.layout,z)&&ro(b.derivedItemConstraints,E)&&b.axisSize===I)continue;fe(e,{defaultLayoutDeferred:!1,derivedItemConstraints:E,axisSize:I,layout:z,requestedAxisSize:G,requestedLayout:$,separatorToItems:b.separatorToItems})}}else try{oo(e,S,g)}catch(I){f??={error:I}}}}finally{Ze()}if(f)throw f.error});i.observe(e.element),e.items.forEach(m=>{N(!o.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.onResize&&i.observe(m.element)});const a=Re({axis:e}),c=at(e),s=Ht({axis:e,itemConstraints:c}),u=ye({layout:s,itemConstraints:c}),l=e.element.ownerDocument,d=l.defaultView;we.set(l,(we.get(l)??0)+1);const h=new Map;return ft({axis:e,includeDisabled:!0}).forEach(m=>{m.separator&&h.set(m.separator,m.items)}),fe(e,{defaultLayoutDeferred:a===0,derivedItemConstraints:c,axisSize:a,layout:u,requestedAxisSize:a,requestedLayout:Vt({itemIds:e.items.map(({id:m})=>m),layout:s}),separatorToItems:h}),e.separators.forEach(m=>{N(!r.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.element.addEventListener("keydown",At)}),Ut||(Ut=!0,ut(An)),we.get(l)===1&&(l.addEventListener("contextmenu",Mt,!0),l.addEventListener("dblclick",Dt,!0),l.addEventListener("lostpointercapture",$t,!0),l.addEventListener("pointercancel",Ot,!0),l.addEventListener("pointerdown",Gt,!0),l.addEventListener("pointerleave",Nt),l.addEventListener("pointermove",jt),l.addEventListener("pointerout",Ft),l.addEventListener("pointerup",_t,!0),d?.addEventListener("blur",Bt),d?.addEventListener("pagehide",qt)),function(){t=!1,we.set(l,Math.max(0,(we.get(l)??0)-1)),Bn(e),kn(e),e.separators.forEach(f=>{f.element.removeEventListener("keydown",At)}),we.get(l)||(l.removeEventListener("contextmenu",Mt,!0),l.removeEventListener("dblclick",Dt,!0),l.removeEventListener("lostpointercapture",$t,!0),l.removeEventListener("pointercancel",Ot,!0),l.removeEventListener("pointerdown",Gt,!0),l.removeEventListener("pointerleave",Nt),l.removeEventListener("pointermove",jt),l.removeEventListener("pointerout",Ft),l.removeEventListener("pointerup",_t,!0),d?.removeEventListener("blur",Bt),d?.removeEventListener("pagehide",qt)),i.disconnect()}}function hn({derivedItemConstraints:e,axis:t,layout:n,prevLayout:o,requestedLayout:r}){const i=t.items.map(({id:a})=>a).join(",");t.mutableState.layouts[i]=r,o&&e.forEach(a=>{if(a.collapsible){const c=Y(a.collapsedSize,n[a.itemId]),s=Y(a.collapsedSize,o[a.itemId]);c&&!s&&(t.mutableState.expandedItemSizes[a.itemId]=o[a.itemId])}})}function gn(){const[e,t]=w.useState({}),n=w.useCallback(()=>t({}),[]);return[e,n]}function et(e){const t=w.useRef({...e});return ne(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const St=w.createContext(null);function so({layout:e,itemConstraints:t,itemId:n,itemIndex:o}){let r,i;const a=e[n],c=t.find(s=>s.itemId===n);if(c){const s=c.maxSize,u=c.collapsible?c.collapsedSize:c.minSize,l=[o,o+1];i=ye({layout:je({delta:u-a,initialLayout:e,itemConstraints:t,pivotIndices:l,prevLayout:e}),itemConstraints:t})[n],r=ye({layout:je({delta:s-a,initialLayout:e,itemConstraints:t,pivotIndices:l,prevLayout:e}),itemConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:i,valueNow:a}}function yn({attributes:e,axisId:t,axisOrientation:n,children:o,className:r,"data-testid":i,disableCursor:a,disabled:c,disableDoubleClick:s,elementRef:u,id:l,isSharedHitRegion:d,preview:h,registerSeparator:p,requiredStyle:m,style:f,styleDefaults:y,tabIndex:g=0,updateSeparatorProps:S}){const I=et({disabled:c,disableDoubleClick:s,children:o,className:r,preview:h,style:f}),[b,E]=w.useState({}),[G,$]=w.useState("inactive"),[x,z]=w.useState(!1),v=w.useRef(null),P=w.useRef(null),A=Fe(v,u),k=n==="horizontal"?"vertical":"horizontal";ne(()=>{const C=v.current;if(C!==null){const M={disabled:I.disabled,disableDoubleClick:I.disableDoubleClick,element:C,id:l,get children(){return I.children},get className(){return I.className},get preview(){return I.preview},get style(){return I.style}};P.current=M;const B=p(M),Z=ut(K=>{$(K.next.state!=="inactive"&&K.next.hitRegions.some(se=>se.separator===M||(d?.(se)??!1))?K.next.state:"inactive")}),X=Ne(t,K=>{const{derivedItemConstraints:se,layout:be,separatorToItems:Pe}=K.next,xe=Pe.get(M);if(xe){const L=xe[0],T=se.findIndex(j=>j.itemId===L.id),{layoutStrategy:F}=K.axis;E({...so({layout:be,itemConstraints:se,itemId:L.id,itemIndex:T}),...F?.getItemAriaControls&&{valueControls:F.getItemAriaControls(L.id)}})}});return()=>{P.current=null,Z(),X(),B()}}},[t,l,d,p,I]),ne(()=>{const C=P.current;C&&Pn(C)},[h]),w.useEffect(()=>{S(l,{disabled:c,disableDoubleClick:s})},[c,s,l,S]);let O;c&&!a&&(O="not-allowed");let R;if(c)R="disabled";else switch(G){case"active":{R="active";break}default:x?R="focus":R=G}return W.jsx("div",{...e,"aria-controls":b.valueControls,"aria-disabled":c||void 0,"aria-orientation":k,"aria-valuemax":b.valueMax,"aria-valuemin":b.valueMin,"aria-valuenow":b.valueNow,children:o,className:r,"data-separator":R,"data-testid":i,id:l,onBlur:()=>z(!1),onFocus:()=>z(!0),ref:A,role:"separator",style:{...y,cursor:O,...f,...m,touchAction:"none"},tabIndex:c?void 0:g})}function Wt({axis:e,children:t,className:n,crossSpan:o,crossStart:r,disabled:i,elementRef:a,index:c,style:s}){const u=Ee(void 0),{getDisableCursor:l,getResizeAxisId:d,gutters:h,registerSeparator:p,separatorPlacements:m,trackCounts:f,updateSeparatorProps:y}=Zt(),g=d(e),S=e==="column"?"row":"column",I=f[S],b=!!i||!ct(c,f[e]);let E=!0;for(const v of m.values())if(v.axis===e&&v.index===c&&!v.disabled&&v.crossStart<r){E=!1;break}const G=w.useCallback(v=>v.axis.id===g&&v.axis.items.indexOf(v.items[1])===c,[g,c]),$=w.useCallback(v=>p({axis:e,crossSpan:o,crossStart:r,disabled:!!i,index:c},v),[e,o,r,i,c,p]),x=Cn(c),z=Ln({crossCount:I,crossSpan:o,crossStart:r,hasGutters:h[S]});return W.jsx(yn,{axisId:g,axisOrientation:e==="column"?"horizontal":"vertical",className:n,disableCursor:l(),disabled:b,disableDoubleClick:void 0,elementRef:a,id:u,isSharedHitRegion:G,registerSeparator:$,requiredStyle:{gridColumn:e==="column"?x:z,gridRow:e==="row"?x:z},style:s,tabIndex:E?0:-1,updateSeparatorProps:y,children:t})}function vt(e){const{children:t,className:n,disabled:o,elementRef:r,style:i}=e;return e.type==="column"?W.jsx(Wt,{axis:"column",className:n,crossSpan:e.rowSpan,crossStart:e.row??0,disabled:o,elementRef:r,index:e.column,style:i,children:t}):W.jsx(Wt,{axis:"row",className:n,crossSpan:e.columnSpan,crossStart:e.column??0,disabled:o,elementRef:r,index:e.row,style:i,children:t})}vt.displayName="Gridline";const Ie=["column","row"],Yt={columns:{},rows:{}};function Sn({children:e,className:t,columns:n,defaultLayout:o,disableCursor:r,disabled:i,elementRef:a,gridRef:c,id:s,onLayoutChange:u,onLayoutChanged:l,resizeTargetMinimumSize:d={coarse:20,fine:10},rows:h,style:p,...m}){const f=Ee(s),y=w.useCallback(L=>L==="column"?`${f}:columns`:`${f}:rows`,[f]),g=Xt(n,"columns"),S=Xt(h,"rows"),I=L=>L==="column"?g:S,b=w.useRef({onLayoutChange:Yt,onLayoutChanged:Yt}),E=ge(L=>{Kt(b.current.onLayoutChange,L)||(b.current.onLayoutChange=L,u?.(L))}),G=ge((L,T,F)=>{Kt(b.current.onLayoutChanged,L)||(b.current.onLayoutChanged=L,l?.(L,{isUserInteraction:T,requestedLayout:F}))}),$=w.useRef(null),x=Fe($,a),[z,v]=gn(),P=w.useRef({cells:[],column:{expandedItemSizes:{},layouts:{}},loggedErrors:new Set,row:{expandedItemSizes:{},layouts:{}},separators:new Map}),A={column:!1,row:!1};for(const L of P.current.separators.values())A[L.axis]=!0;vn(e,A);const k=et({defaultLayout:o,disableCursor:r,resizeTargetMinimumSize:d}),O=ge(()=>!!k.disableCursor),R=w.useCallback(L=>{const T=P.current;return T.cells=[...T.cells,L],v(),()=>{T.cells=T.cells.filter(F=>F!==L),v()}},[v]),C=w.useCallback((L,T)=>{const F=P.current;return F.separators=new Map(F.separators),F.separators.set(T,L),v(),()=>{F.separators=new Map(F.separators),F.separators.delete(T),v()}},[v]),M=w.useCallback((L,{disabled:T,disableDoubleClick:F})=>{for(const j of P.current.separators.keys())j.id===L&&(j.disabled=T,j.disableDoubleClick=F)},[]),B=P.current.separators,Z=w.useMemo(()=>({getDisableCursor:O,getResizeAxisId:y,gutters:{column:A.column,row:A.row},id:f,registerCell:R,registerSeparator:C,separatorPlacements:B,trackCounts:{column:g.length,row:S.length},updateSeparatorProps:M}),[g.length,O,y,A.column,A.row,f,R,C,S.length,B,M]),X=w.useRef([]);ne(()=>{const L=$.current;if(L===null)return;const T=P.current,F=co({cells:T.cells,separatorPlacements:T.separators,trackCounts:{column:g.length,row:S.length}});F.forEach(D=>{T.loggedErrors.has(D)||console.error(D)}),T.loggedErrors=new Set(F);const j=D=>Array.from(T.separators.entries()).filter(([,U])=>U.axis===D).sort(([,U],[,me])=>U.index-me.index).map(([U])=>U),_=D=>{const U=D==="column"?g:S,me=D==="column"?S:g,pe=U.map(Q=>Q.id),Be=y(D),qe=j(D),Se=qe.length>0,He=U.map(({id:Q,...oe},ee)=>({element:L,id:pe[ee],idIsStable:!0,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:void 0,constraintProps:oe})),Te=()=>{const Q=[];if(Se){for(const[oe,ee]of T.separators)if(ee.axis===D&&ct(ee.index,U.length)){const Ae=oe.element.getBoundingClientRect();Q[ee.index]=Math.max(Q[ee.index]??0,D==="column"?Ae.width:Ae.height)}}return En({axis:D,element:L,gutterSizes:Q.filter(oe=>oe!==void 0),hasGutters:Se,layout:ae(Be)?.layout,trackIds:pe})};let De;const nt=k.defaultLayout?.[D==="column"?"columns":"rows"];if(nt!==void 0&&Object.keys(nt).length===pe.length){De={};for(const Q of pe){const oe=nt[Q];oe!==void 0&&(De[Q]=oe)}}return{disabled:!!i,element:L,id:Be,layoutStrategy:{getItemAriaControls:Q=>{const oe=pe.indexOf(Q);return T.cells.filter(ee=>{const Ae=D==="column"?ee.column:ee.row,zn=D==="column"?ee.columnSpan:ee.rowSpan;return Ae<=oe&&oe<Ae+zn}).map(ee=>ee.element.id).filter(Boolean).join(" ")||void 0},calculateAvailableSize:()=>Te().availableSize,calculateHitRegions:({expandHitTargets:Q,axis:oe,includeDisabled:ee})=>Rn({axis:D,cells:T.cells,crossTrackCount:me.length,expandHitTargets:Q,resizeAxis:oe,axisSize:Te().availableSize,includeDisabled:ee,separatorPlacements:T.separators}),getItemSizeInPixels:Q=>Te().trackSizes[pe.indexOf(Q)]??0},mutableState:{defaultLayout:De,disableCursor:!!k.disableCursor,expandedItemSizes:T[D].expandedItemSizes,layouts:T[D].layouts},orientation:D==="column"?"horizontal":"vertical",items:He,resizePreviewMode:"panel",get resizeTargetMinimumSize(){return k.resizeTargetMinimumSize},separators:qe}},H=Ie.map(_);X.current=H;const V=H.map(D=>pn(D)),te=()=>{const[D,U]=H.map(me=>ae(me.id));if(!(!D||!U||D.defaultLayoutDeferred||U.defaultLayoutDeferred))return{layout:{columns:D.layout,rows:U.layout},requestedLayout:{columns:D.requestedLayout,rows:U.requestedLayout}}};{const D=te();if(D)try{try{E(D.layout)}finally{G(D.layout,!1,D.requestedLayout)}}catch(U){throw X.current=[],V.forEach(me=>me()),U}}const ke=H.map(D=>Ne(D.id,U=>{const{defaultLayoutDeferred:me,derivedItemConstraints:pe,layout:Be,requestedLayout:qe}=U.next;if(me||pe.length===0)return;hn({derivedItemConstraints:pe,axis:D,layout:Be,prevLayout:U.prev?.layout,requestedLayout:qe});const Se=te();if(Se){const He=re(),Te=He.state!=="active"||!He.hitRegions.some(De=>H.includes(De.axis));try{E(Se.layout)}finally{Te&&G(Se.layout,U.isUserInteraction,Se.requestedLayout)}}}));return()=>{X.current=[],V.forEach(D=>D()),ke.forEach(D=>D())}},[g,i,y,f,G,E,S,z,k]),w.useEffect(()=>{X.current.forEach(L=>{L.mutableState.defaultLayout=o?.[L.orientation==="horizontal"?"columns":"rows"],L.mutableState.disableCursor=!!r})}),w.useImperativeHandle(c,()=>{const L=()=>{const[j,_]=Ie.map(y);return!Ce(j)||!Ce(_)?{columns:{},rows:{}}:{columns:Ge({axisId:j}).getLayout(),rows:Ge({axisId:_}).getLayout()}},T=j=>j.map(_=>`"${_}"`).join(", "),F=(j,_)=>{const H=y(j),V=()=>{const te=Ce(H);return N(te,`Grid "${f}" has not been mounted`),N(te.items.some(ke=>ke.id===_),`Grid "${f}" no longer contains a ${j} with id "${_}"; ${j} ids are ${T(te.items.map(ke=>ke.id))}`),yt({axisId:H,itemId:_})};return{collapse:()=>V().collapse(),expand:()=>V().expand(),getSize:()=>V().getSize(),isCollapsed:()=>V().isCollapsed(),resize:te=>V().resize(te)}};return{getLayout:L,getTrackById:(j,_)=>{const H=j==="column"?g:S,V=`${_}`;return N(H.some(te=>te.id===V),`Grid "${f}" does not contain a ${j} with id "${V}"; ${j} ids are ${T(H.map(te=>te.id))}`),F(j,V)},getTrackByIndex:(j,_)=>{const H=j==="column"?g:S,V=Number.isInteger(_)?H[_]:void 0;return N(V,`Grid "${f}" does not contain a ${j} at index ${_}; it has ${H.length} ${j}s`),F(j,V.id)},setLayout:j=>(Ie.forEach(_=>{const H=j[_==="column"?"columns":"rows"],V=y(_);H&&Ce(V)&&Ge({axisId:V}).setLayout(H)}),L())}},[g,y,f,S]);const K=()=>Ie.map(L=>{const T=ae(y(L)),F=I(L);return(T&&!T.defaultLayoutDeferred?F.map(_=>`minmax(0, ${T.layout[_.id]??1}fr)`):ao(F,o?.[L==="column"?"columns":"rows"])).join(A[L]?" auto ":" ")}).join("|"),se=w.useCallback(L=>{const T=Ie.map(F=>Ne(y(F),L));return()=>T.forEach(F=>F())},[y]),be=w.useSyncExternalStore(se,K,K),[Pe,xe]=be.split("|");return W.jsx(Jt.Provider,{value:Z,children:W.jsx("div",{...m,className:t,"data-grid":!0,"data-testid":_e(m,s),id:f,ref:x,style:{height:"100%",width:"100%",overflow:"hidden",...p,display:"grid",gridTemplateColumns:Pe,gridTemplateRows:xe,touchAction:"none"},children:W.jsx(St.Provider,{value:null,children:e})})})}Sn.displayName="Grid";function Xt(e,t){const n=JSON.stringify(e);return w.useMemo(()=>{const o=typeof e=="number"?Array.from({length:e},(r,i)=>({id:`${i}`})):e.map((r,i)=>({...r,id:`${r.id??i}`}));return N(o.length>0,`Grid must have at least one track; "${t}" is ${n}`),o},[n])}function vn(e,t){w.Children.forEach(e,n=>{if(w.isValidElement(n))if(n.type===vt){const{type:o}=n.props;o==="column"?t.column=!0:o==="row"&&(t.row=!0)}else typeof n.type=="symbol"&&n.props!==null&&typeof n.props=="object"&&"children"in n.props&&vn(n.props.children,t)})}function ao(e,t){if(t)return e.map(i=>`minmax(0, ${t[i.id]??1}fr)`);const n=e.map(i=>i.defaultSize===void 0?void 0:tn(i.defaultSize));let o=100,r=0;return n.forEach(i=>{i===void 0?r++:i[1]==="%"&&(o-=i[0])}),n.map(i=>{if(i===void 0)return`minmax(0, ${Math.max(0,o)/Math.max(1,r)}fr)`;const[a,c]=i;return c==="%"?`minmax(0, ${a}fr)`:`${a}${c}`})}function co({cells:e,separatorPlacements:t,trackCounts:n}){const o=[];for(const c of e)Ie.forEach(s=>{const[u,l]=s==="column"?[c.column,c.columnSpan]:[c.row,c.rowSpan],d=n[s];(!Number.isInteger(u)||!Number.isInteger(l)||u<0||l<1||u+l>d)&&o.push(`Invalid Cell ${s} placement (${s}: ${u}, ${s}Span: ${l}); Grid has ${d} ${s}s`)});const r=({axis:c,crossSpan:s,crossStart:u,disabled:l,index:d})=>{const h=c==="column"?"row":"column";let p=`type="${c}" ${c}={${d}}`;return(u!==0||s!==void 0)&&(p+=` ${h}={${u}}`),s!==void 0&&(p+=` ${h}Span={${s}}`),l&&(p+=" disabled"),`<Gridline ${p} />`},i=Array.from(t.values()).filter(c=>{const{axis:s,crossSpan:u,crossStart:l,index:d}=c,h=s==="column"?"row":"column",p=n[s],m=n[h];let f=!0;return ct(d,p)||(o.push(`Invalid ${s} Gridline ${s} (${d}); must be between 1 and ${p-1}`),f=!1),!Number.isInteger(l)||l<0||l>=m?(o.push(`Invalid ${s} Gridline ${h} (${l}); must be between 0 and ${m-1}`),f=!1):u!==void 0&&(!Number.isInteger(u)||u<1||l+u>m)&&(o.push(`Invalid ${s} Gridline ${h}Span (${u}); Grid has ${m} ${h}s`),f=!1),f}),a=c=>{const s=n[c.axis==="column"?"row":"column"];return[c.crossStart,c.crossSpan===void 0?s:c.crossStart+c.crossSpan]};return i.forEach((c,s)=>{const{axis:u,index:l}=c,[d,h]=a(c);for(const p of e){const[m,f,y,g]=u==="column"?[p.column,p.columnSpan,p.row,p.rowSpan]:[p.row,p.rowSpan,p.column,p.columnSpan];if(m<l&&l<m+f&&y<h&&d<y+g){const S=u==="column"?"row":"column";o.push(`${r(c)} overlaps a Cell that spans across it (${u}: ${m}, ${u}Span: ${f}, ${S}: ${y}, ${S}Span: ${g}); use the ${S} and ${S}Span props to render gridlines beside the Cell instead`)}}for(const p of i.slice(s+1))if(p.axis===u&&p.index===l){const[m,f]=a(p);m<h&&d<f&&o.push(`${r(c)} overlaps ${r(p)}`)}}),o}function Kt(e,t){return ie(e.columns,t.columns)&&ie(e.rows,t.rows)}function lo({id:e,onlySaveAfterUserInteractions:t,storage:n=localStorage}){const o=`react-resizable-panels:grid:${e}`,r=w.useSyncExternalStore(uo,()=>n.getItem(o),()=>n.getItem(o)),i=w.useMemo(()=>{if(r)try{const c=JSON.parse(r);if(c!==null&&typeof c=="object")return c}catch{}},[r]),a=w.useCallback((c,s)=>{if(!(t&&!s.isUserInteraction))try{n.setItem(o,JSON.stringify(s.requestedLayout??c))}catch(u){console.error(u)}},[t,n,o]);return{defaultLayout:i,onLayoutChanged:a}}function uo(){return function(){}}function fo(){return w.useState(null)}function mo(){return w.useRef(null)}function po(e){for(let t=1;t<e.length;t++)if(dt(e[t-1],e[t])>0)return!1;return!0}function ho({separator:e}){const{element:t}=e,n=w.useRef(null);return ne(()=>{const o=t.cloneNode(!0),r=[t,...t.querySelectorAll("*")],i=[o,...o.querySelectorAll("*")],a=t.ownerDocument.defaultView;return r.forEach((c,s)=>{const u=i[s];if(u instanceof a.HTMLElement||u instanceof a.SVGElement){const l=a.getComputedStyle(c);for(let d=0;d<l.length;d++){const h=l.item(d);u.style.setProperty(h,l.getPropertyValue(h))}}u.removeAttribute("data-testid"),u.removeAttribute("id")}),Object.assign(o.style,{boxSizing:"border-box",height:"100%",margin:"0",position:"static",transform:"none",width:"100%"}),n.current.appendChild(o),()=>o.remove()},[t]),W.jsx("div",{ref:n,style:{height:"100%",opacity:.65,pointerEvents:"none",width:"100%"}})}function tt(){const e=w.useContext(St);return N(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function bt(e){const{registerOverlay:t}=tt(),n=w.useRef(e);mn(n.current,e)||(n.current=e);const o=n.current;return ne(()=>t(o),[t,o]),null}bt.displayName="SeparatorOverlay";function go({active:e,orientation:t,style:n,...o}){let r;switch(t){case"horizontal":{r={height:"100%",minWidth:"1px"};break}case"vertical":{r={minHeight:"1px",width:"100%"};break}}return W.jsx("div",{...o,"data-separator-overlay":e?"active":"inactive",style:{...r,...n,flexShrink:0,pointerEvents:"none"}})}function yo({overlay:e,preview:t}){const{axis:n,offset:o,rect:r,separator:i}=t,a=n.orientation==="horizontal";let c=i?.preview,s=e;return w.isValidElement(c)&&c.type===bt&&(s=c.props,c=void 0),c==null&&(s?c=W.jsx(go,{...s,active:t.active,orientation:n.orientation}):i&&(c=W.jsx(ho,{separator:i}))),W.jsx("div",{"aria-hidden":"true","data-resize-preview":!0,inert:!0,style:{height:r.height,left:r.left,pointerEvents:"none",position:"absolute",top:r.top,transform:a?`translateX(${o}px)`:`translateY(${o}px)`,width:r.width},children:c})}function So(e){return Array.from(e).sort(dt)}function vo(e,t){const n=w.useRef({getLayout:()=>({}),setLayout:Tn});w.useImperativeHandle(t,()=>n.current,[]),ne(()=>{Object.assign(n.current,Ge({axisId:e}))})}function bo({groupId:e,resizePreviewMode:t}){const[n,o]=w.useState([]),r=w.useRef(n);return ne(()=>{const i=c=>{const s=Ce(e),u=t==="separator"&&c.state==="active"?c.previews.filter(d=>d.axis===s&&(d.active||!Y(d.offset,0))):[],l=r.current;l.length===u.length&&u.every((d,h)=>d===l[h])||(r.current=u,o(u))};if(t!=="separator"){i(re());return}const a=ut(({next:c})=>i(c));return i(re()),a},[e,t]),n}function bn({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:i,groupRef:a,id:c,onLayoutChange:s,onLayoutChanged:u,orientation:l="horizontal",resizePreviewMode:d="panel",resizeTargetMinimumSize:h={coarse:20,fine:10},style:p,...m}){const f=w.useRef({onLayoutChange:{},onLayoutChanged:{}}),y=ge(C=>{ie(f.current.onLayoutChange,C)||(f.current.onLayoutChange=C,s?.(C))}),g=ge((C,M,B)=>{ie(f.current.onLayoutChanged,C)||(f.current.onLayoutChanged=C,u?.(C,{isUserInteraction:M,requestedLayout:B}))}),S=Ee(c),[I,b]=w.useState(),E=bo({groupId:S,resizePreviewMode:d}),G=w.useRef(null),[$,x]=gn(),z=w.useRef([]),v=w.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),P=Fe(G,i);vo(S,a);const A=ge((C,M)=>{const B=ae(C);if(B)return{flexGrow:B.layout[M]??1};if(n?.[M])return{flexGrow:n?.[M]}}),k=et({defaultLayout:n,disableCursor:o,resizeTargetMinimumSize:h}),O=w.useMemo(()=>({get disableCursor(){return!!k.disableCursor},getPanelStyles:A,id:S,orientation:l,registerPanel:C=>{const M=v.current;return M.panels=$e(l,[...M.panels,C]),x(),()=>{M.panels=M.panels.filter(B=>B!==C),x()}},registerOverlay:C=>(b(C),()=>{b(void 0)}),registerSeparator:C=>{const M=v.current;return M.separators=$e(l,[...M.separators,C]),x(),()=>{M.separators=M.separators.filter(B=>B!==C),x()}},updatePanelProps:(C,{disabled:M})=>{const Z=v.current.panels.find(se=>se.id===C);Z&&(Z.constraintProps.disabled=M);const X=Ce(S),K=ae(S);X&&K&&fe(X,{...K,derivedItemConstraints:at(X)})},updateSeparatorProps:(C,{disabled:M,disableDoubleClick:B})=>{const X=v.current.separators.find(K=>K.id===C);X&&(X.disabled=M,X.disableDoubleClick=B)}}),[A,S,x,l,k]),R=w.useRef(null);return ne(()=>{const C=G.current;if(C===null)return;const M=v.current;M.panels=$e(l,M.panels),M.separators=$e(l,M.separators),z.current=So([...M.panels.map(({element:L})=>L),...M.separators.map(({element:L})=>L)]);let B;if(k.defaultLayout!==void 0&&Object.keys(k.defaultLayout).length===M.panels.length){B={};for(const L of M.panels){const T=k.defaultLayout[L.id];T!==void 0&&(B[L.id]=T)}}const Z={disabled:!!r,element:C,id:S,mutableState:{defaultLayout:B,disableCursor:!!k.disableCursor,expandedItemSizes:v.current.lastExpandedPanelSizes,layouts:v.current.layouts},orientation:l,items:M.panels,resizePreviewMode:d,get resizeTargetMinimumSize(){return k.resizeTargetMinimumSize},separators:M.separators};R.current=Z;const X=pn(Z),{defaultLayoutDeferred:K,derivedItemConstraints:se,layout:be,requestedLayout:Pe}=ae(Z.id,!0);if(!K&&se.length>0)try{try{y(be)}finally{g(be,!1,Pe)}}catch(L){throw R.current=null,X(),L}const xe=Ne(S,L=>{const{defaultLayoutDeferred:T,derivedItemConstraints:F,layout:j,requestedLayout:_}=L.next;if(T||F.length===0)return;hn({derivedItemConstraints:F,axis:Z,layout:j,prevLayout:L.prev?.layout,requestedLayout:_});const H=re(),V=H.state!=="active"||!H.hitRegions.some(te=>te.axis===Z);try{y(j)}finally{V&&g(j,L.isUserInteraction,_)}});return()=>{R.current=null,X(),xe()}},[r,S,g,y,l,$,d,k]),ne(()=>{po(z.current)||x()}),w.useEffect(()=>{const C=R.current;C&&(C.mutableState.defaultLayout=n,C.mutableState.disableCursor=!!o)}),W.jsx(St.Provider,{value:O,children:W.jsxs("div",{...m,className:t,"data-group":!0,"data-testid":_e(m,c),id:S,ref:P,style:{height:"100%",width:"100%",overflow:"hidden",position:d==="separator"?"relative":void 0,...p,display:"flex",flexDirection:l==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:l==="horizontal"?"pan-y":"pan-x"},children:[e,E.map(C=>W.jsx(yo,{overlay:I,preview:C},C.key))]})})}bn.displayName="Group";function Xe(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function xo({id:e,panelIds:t,storage:n}){const o=Xe(e,[]),r=n.getItem(o);if(r)try{const i=JSON.parse(r);if(t){const a=t.join(","),c=i[a];if(c&&Array.isArray(c.layout)&&t.length===c.layout.length){const s={};for(let u=0;u<t.length;u++)s[t[u]]=c.layout[u];return s}}else{const a=Object.keys(i);if(a.length===1){const c=i[a[0]];if(c&&Array.isArray(c.layout)){const s=a[0].split(",");if(s.length===c.layout.length){const u={};for(let l=0;l<s.length;l++)u[s[l]]=c.layout[l];return u}}}}}catch{}}function wo({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:o=localStorage,...r}){const i=n!==void 0,a="id"in r?r.id:r.groupId,c=Xe(a,n??[]),s=w.useSyncExternalStore(zo,()=>o.getItem(c),()=>o.getItem(c)),u=w.useMemo(()=>{if(s){const y=JSON.parse(s),g=Object.values(y);if(Array.from(g).every(S=>typeof S=="number"))return y}},[s]),l=w.useMemo(()=>{if(!u)return xo({id:a,panelIds:n,storage:o})},[u,a,n,o]),d=u??l,h=w.useRef(null),p=w.useCallback(()=>{const y=h.current;y&&(h.current=null,clearTimeout(y))},[]);w.useLayoutEffect(()=>()=>{p()},[p]);const m=w.useCallback((y,g)=>{if(t&&!g.isUserInteraction)return;p();const S=g.requestedLayout??y;let I;i?I=Xe(a,Object.keys(S)):I=Xe(a,[]);try{o.setItem(I,JSON.stringify(S))}catch(b){console.error(b)}},[p,i,a,t,o]),f=w.useCallback(y=>{p(),e===0?m(y,{isUserInteraction:!1}):h.current=setTimeout(()=>{m(y,{isUserInteraction:!1})},e)},[p,e,m]);return{defaultLayout:d,onLayoutChange:f,onLayoutChanged:m}}function zo(){return function(){}}function Io(){return w.useState(null)}function Co(){return w.useRef(null)}function Lo(e,t){const{id:n}=tt(),o=w.useRef({collapse:ot,expand:ot,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:ot});w.useImperativeHandle(t,()=>o.current,[]),ne(()=>{Object.assign(o.current,yt({axisId:n,itemId:e}))})}function xn({children:e,className:t,collapsedSize:n="0%",collapsedThreshold:o,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:c,groupResizeBehavior:s="preserve-relative-size",id:u,maxSize:l="100%",minSize:d="0%",onResize:h,panelRef:p,style:m,...f}){const y=Ke(u),g=Ee(u),S=et({disabled:a}),I=w.useRef(null),b=Fe(I,c),{getPanelStyles:E,id:G,orientation:$,registerPanel:x,updatePanelProps:z}=tt(),v=h!==null,P=ge((R,C,M)=>{h?.(R,u,M)});ne(()=>{const R=I.current;if(R!==null){const C={element:R,id:g,idIsStable:y,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:v?P:void 0,constraintProps:{groupResizeBehavior:s,collapsedSize:n,collapsedThreshold:o,collapsible:r,defaultSize:i,disabled:S.disabled,maxSize:l,minSize:d}};return x(C)}},[s,n,o,r,i,v,g,y,l,d,P,x,S]),w.useEffect(()=>{z(g,{disabled:a})},[a,g,z]),Lo(g,p);const A=()=>{const R=E(G,g);if(R)return JSON.stringify(R)},k=w.useSyncExternalStore(R=>Ne(G,R),A,A);let O;return k?O=JSON.parse(k):i!==void 0?O={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:O={flexGrow:1},W.jsx("div",{...f,"data-disabled":a||void 0,"data-panel":!0,"data-testid":_e(f,u),id:g,ref:b,style:{...Ro,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...O},children:W.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...m,touchAction:$==="horizontal"?"pan-y":"pan-x"},children:e})})}xn.displayName="Panel";const Ro={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Eo(){return w.useState(null)}function Mo(){return w.useRef(null)}const Po={flexBasis:"auto"},ko={flexGrow:0,flexShrink:0};function wn({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:i,preview:a,style:c,...s}){const u=Ee(i),{disableCursor:l,id:d,orientation:h,registerSeparator:p,updateSeparatorProps:m}=tt();return W.jsx(yn,{attributes:s,axisId:d,axisOrientation:h,className:t,"data-testid":_e(s,i),disableCursor:l,disabled:n,disableDoubleClick:o,elementRef:r,id:u,preview:a,registerSeparator:p,requiredStyle:ko,style:c,styleDefaults:Po,updateSeparatorProps:m,children:e})}wn.displayName="Separator";exports.Cell=Qt;exports.Grid=Sn;exports.Gridline=vt;exports.Group=bn;exports.Panel=xn;exports.Separator=wn;exports.SeparatorOverlay=bt;exports.isCoarsePointer=en;exports.useDefaultGridLayout=lo;exports.useDefaultLayout=wo;exports.useGridCallbackRef=fo;exports.useGridRef=mo;exports.useGroupCallbackRef=Io;exports.useGroupRef=Co;exports.usePanelCallbackRef=Eo;exports.usePanelRef=Mo;
2
2
  //# sourceMappingURL=react-resizable-panels.cjs.map