whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> /home/qbizpnmr/arif.umairtax.com/public/react-resizable-panels.browser.esm-DGjypp5c.js
import{fJ as Ye}from"./bundle.OlIVtvc7.js";const{createElement:de,createContext:Sn,forwardRef:Ze,useCallback:G,useContext:Qe,useEffect:te,useImperativeHandle:en,useLayoutEffect:Pn,useMemo:bn,useRef:B,useState:ue}=Ye,Ke=Ye[`useId${Math.random()}`.slice(0,5)],wn=Pn,Ee=Sn(null);Ee.displayName="PanelGroupContext";const oe=wn,En=typeof Ke=="function"?Ke:()=>null;let Cn=0;function _e(e=null){const n=En(),t=B(e||n||null);return t.current===null&&(t.current=""+Cn++),e??t.current}function nn({children:e,className:n="",collapsedSize:t,collapsible:o,defaultSize:i,forwardedRef:r,id:l,maxSize:s,minSize:a,onCollapse:g,onExpand:b,onResize:f,order:c,style:m,tagName:p="div",...E}){const w=Qe(Ee);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:$,getPanelSize:R,getPanelStyle:D,groupId:W,isPanelCollapsed:C,reevaluatePanelConstraints:h,registerPanel:T,resizePanel:K,unregisterPanel:Z}=w,V=_e(l),A=B({callbacks:{onCollapse:g,onExpand:b,onResize:f},constraints:{collapsedSize:t,collapsible:o,defaultSize:i,maxSize:s,minSize:a},id:V,idIsFromProps:l!==void 0,order:c});B({didLogMissingDefaultSizeWarning:!1}),oe(()=>{const{callbacks:N,constraints:k}=A.current,_={...k};A.current.id=V,A.current.idIsFromProps=l!==void 0,A.current.order=c,N.onCollapse=g,N.onExpand=b,N.onResize=f,k.collapsedSize=t,k.collapsible=o,k.defaultSize=i,k.maxSize=s,k.minSize=a,(_.collapsedSize!==k.collapsedSize||_.collapsible!==k.collapsible||_.maxSize!==k.maxSize||_.minSize!==k.minSize)&&h(A.current,_)}),oe(()=>{const N=A.current;return T(N),()=>{Z(N)}},[c,V,T,Z]),en(r,()=>({collapse:()=>{v(A.current)},expand:N=>{$(A.current,N)},getId(){return V},getSize(){return R(A.current)},isCollapsed(){return C(A.current)},isExpanded(){return!C(A.current)},resize:N=>{K(A.current,N)}}),[v,$,R,C,V,K]);const j=D(A.current,i);return de(p,{...E,children:e,className:n,id:l,style:{...j,...m},"data-panel":"","data-panel-collapsible":o||void 0,"data-panel-group-id":W,"data-panel-id":V,"data-panel-size":parseFloat(""+j.flexGrow).toFixed(1)})}const Ln=Ze((e,n)=>de(nn,{...e,forwardedRef:n}));nn.displayName="Panel";Ln.displayName="forwardRef(Panel)";let ke=null,ne=null;function In(e,n){if(n){const t=(n&sn)!==0,o=(n&an)!==0,i=(n&cn)!==0,r=(n&un)!==0;if(t)return i?"se-resize":r?"ne-resize":"e-resize";if(o)return i?"sw-resize":r?"nw-resize":"w-resize";if(i)return"s-resize";if(r)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Rn(){ne!==null&&(document.head.removeChild(ne),ke=null,ne=null)}function De(e,n){const t=In(e,n);ke!==t&&(ke=t,ne===null&&(ne=document.createElement("style"),document.head.appendChild(ne)),ne.innerHTML=`*{cursor: ${t}!important;}`)}function tn(e){return e.type==="keydown"}function on(e){return e.type.startsWith("pointer")}function rn(e){return e.type.startsWith("mouse")}function Ce(e){if(on(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(rn(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function An(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Mn(e,n,t){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function $n(e,n){if(e===n)throw new Error("Cannot compare node with itself");const t={a:Ue(e),b:Ue(n)};let o;for(;t.a.at(-1)===t.b.at(-1);)e=t.a.pop(),n=t.b.pop(),o=e;z(o,"Stacking order can only be calculated for elements with a common ancestor");const i={a:We(Ve(t.a)),b:We(Ve(t.b))};if(i.a===i.b){const r=o.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let s=r.length;for(;s--;){const a=r[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(i.a-i.b)}const Dn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Nn(e){var n;const t=getComputedStyle((n=ln(e))!==null&&n!==void 0?n:e).display;return t==="flex"||t==="inline-flex"}function kn(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||Nn(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||Dn.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function Ve(e){let n=e.length;for(;n--;){const t=e[n];if(z(t,"Missing node"),kn(t))return t}return null}function We(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ue(e){const n=[];for(;e;)n.push(e),e=ln(e);return n}function ln(e){const{parentNode:n}=e;return n&&n instanceof ShadowRoot?n.host:n}const sn=1,an=2,cn=4,un=8,_n=An()==="coarse";let O=[],fe=!1,Y=new Map,Le=new Map;const ze=new Set;function Hn(e,n,t,o,i){var r;const{ownerDocument:l}=n,s={direction:t,element:n,hitAreaMargins:o,setResizeHandlerState:i},a=(r=Y.get(l))!==null&&r!==void 0?r:0;return Y.set(l,a+1),ze.add(s),be(),function(){var b;Le.delete(e),ze.delete(s);const f=(b=Y.get(l))!==null&&b!==void 0?b:1;if(Y.set(l,f-1),be(),f===1&&Y.delete(l),O.includes(s)){const c=O.indexOf(s);c>=0&&O.splice(c,1),Ge(),i("up",!0,null)}}}function Oe(e){const{target:n}=e,{x:t,y:o}=Ce(e);fe=!0,He({target:n,x:t,y:o}),be(),O.length>0&&(we("down",e),e.preventDefault(),e.stopPropagation())}function me(e){const{x:n,y:t}=Ce(e);if(fe&&e.buttons===0&&(fe=!1,we("up",e)),!fe){const{target:o}=e;He({target:o,x:n,y:t})}we("move",e),Ge(),O.length>0&&e.preventDefault()}function le(e){const{target:n}=e,{x:t,y:o}=Ce(e);Le.clear(),fe=!1,O.length>0&&e.preventDefault(),we("up",e),He({target:n,x:t,y:o}),Ge(),be()}function He({target:e,x:n,y:t}){O.splice(0);let o=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(o=e),ze.forEach(i=>{const{element:r,hitAreaMargins:l}=i,s=r.getBoundingClientRect(),{bottom:a,left:g,right:b,top:f}=s,c=_n?l.coarse:l.fine;if(n>=g-c&&n<=b+c&&t>=f-c&&t<=a+c){if(o!==null&&document.contains(o)&&r!==o&&!r.contains(o)&&!o.contains(r)&&$n(o,r)>0){let p=o,E=!1;for(;p&&!p.contains(r);){if(Mn(p.getBoundingClientRect(),s)){E=!0;break}p=p.parentElement}if(E)return}O.push(i)}})}function Ne(e,n){Le.set(e,n)}function Ge(){let e=!1,n=!1;O.forEach(o=>{const{direction:i}=o;i==="horizontal"?e=!0:n=!0});let t=0;Le.forEach(o=>{t|=o}),e&&n?De("intersection",t):e?De("horizontal",t):n?De("vertical",t):Rn()}function be(){Y.forEach((e,n)=>{const{body:t}=n;t.removeEventListener("contextmenu",le),t.removeEventListener("pointerdown",Oe),t.removeEventListener("pointerleave",me),t.removeEventListener("pointermove",me)}),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),ze.size>0&&(fe?(O.length>0&&Y.forEach((e,n)=>{const{body:t}=n;e>0&&(t.addEventListener("contextmenu",le),t.addEventListener("pointerleave",me),t.addEventListener("pointermove",me))}),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le)):Y.forEach((e,n)=>{const{body:t}=n;e>0&&(t.addEventListener("pointerdown",Oe,{capture:!0}),t.addEventListener("pointermove",me))}))}function we(e,n){ze.forEach(t=>{const{setResizeHandlerState:o}=t,i=O.includes(t);o(e,i,n)})}function Gn(){const[e,n]=ue(0);return G(()=>n(t=>t+1),[])}function z(e,n){if(!e)throw console.error(n),Error(n)}const Be=10;function re(e,n,t=Be){return e.toFixed(t)===n.toFixed(t)?0:e>n?1:-1}function J(e,n,t=Be){return re(e,n,t)===0}function F(e,n,t){return re(e,n,t)===0}function Bn(e,n,t){if(e.length!==n.length)return!1;for(let o=0;o<e.length;o++){const i=e[o],r=n[o];if(!F(i,r,t))return!1}return!0}function ce({panelConstraints:e,panelIndex:n,size:t}){const o=e[n];z(o!=null,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:r,maxSize:l=100,minSize:s=0}=o;if(re(t,s)<0)if(r){const a=(i+s)/2;re(t,a)<0?t=i:t=s}else t=s;return t=Math.min(l,t),t=parseFloat(t.toFixed(Be)),t}function he({delta:e,initialLayout:n,panelConstraints:t,pivotIndices:o,prevLayout:i,trigger:r}){if(F(e,0))return n;const l=[...n],[s,a]=o;z(s!=null,"Invalid first pivot index"),z(a!=null,"Invalid second pivot index");let g=0;if(r==="keyboard"){{const f=e<0?a:s,c=t[f];z(c,`Panel constraints not found for index ${f}`);const{collapsedSize:m=0,collapsible:p,minSize:E=0}=c;if(p){const w=n[f];if(z(w!=null,`Previous layout not found for panel index ${f}`),F(w,m)){const v=E-w;re(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const f=e<0?s:a,c=t[f];z(c,`No panel constraints found for index ${f}`);const{collapsedSize:m=0,collapsible:p,minSize:E=0}=c;if(p){const w=n[f];if(z(w!=null,`Previous layout not found for panel index ${f}`),F(w,E)){const v=w-m;re(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}}{const f=e<0?1:-1;let c=e<0?a:s,m=0;for(;;){const E=n[c];z(E!=null,`Previous layout not found for panel index ${c}`);const v=ce({panelConstraints:t,panelIndex:c,size:100})-E;if(m+=v,c+=f,c<0||c>=t.length)break}const p=Math.min(Math.abs(e),Math.abs(m));e=e<0?0-p:p}{let c=e<0?s:a;for(;c>=0&&c<t.length;){const m=Math.abs(e)-Math.abs(g),p=n[c];z(p!=null,`Previous layout not found for panel index ${c}`);const E=p-m,w=ce({panelConstraints:t,panelIndex:c,size:E});if(!F(p,w)&&(g+=p-w,l[c]=w,g.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?c--:c++}}if(Bn(i,l))return i;{const f=e<0?a:s,c=n[f];z(c!=null,`Previous layout not found for panel index ${f}`);const m=c+g,p=ce({panelConstraints:t,panelIndex:f,size:m});if(l[f]=p,!F(p,m)){let E=m-p,v=e<0?a:s;for(;v>=0&&v<t.length;){const $=l[v];z($!=null,`Previous layout not found for panel index ${v}`);const R=$+E,D=ce({panelConstraints:t,panelIndex:v,size:R});if(F($,D)||(E-=D-$,l[v]=D),F(E,0))break;e>0?v--:v++}}}const b=l.reduce((f,c)=>c+f,0);return F(b,100)?l:i}function Tn({layout:e,panelsArray:n,pivotIndices:t}){let o=0,i=100,r=0,l=0;const s=t[0];z(s!=null,"No pivot index found"),n.forEach((f,c)=>{const{constraints:m}=f,{maxSize:p=100,minSize:E=0}=m;c===s?(o=E,i=p):(r+=E,l+=p)});const a=Math.min(i,100-r),g=Math.max(o,100-l),b=e[s];return{valueMax:a,valueMin:g,valueNow:b}}function xe(e,n=document){return Array.from(n.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function fn(e,n,t=document){const i=xe(e,t).findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===n);return i??null}function dn(e,n,t){const o=fn(e,n,t);return o!=null?[o,o+1]:[-1,-1]}function pn(e,n=document){var t;if(n instanceof HTMLElement&&(n==null||(t=n.dataset)===null||t===void 0?void 0:t.panelGroupId)==e)return n;const o=n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return o||null}function Ie(e,n=document){const t=n.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Fn(e,n,t,o=document){var i,r,l,s;const a=Ie(n,o),g=xe(e,o),b=a?g.indexOf(a):-1,f=(i=(r=t[b])===null||r===void 0?void 0:r.id)!==null&&i!==void 0?i:null,c=(l=(s=t[b+1])===null||s===void 0?void 0:s.id)!==null&&l!==void 0?l:null;return[f,c]}function Kn({committedValuesRef:e,eagerValuesRef:n,groupId:t,layout:o,panelDataArray:i,panelGroupElement:r,setLayout:l}){B({didWarnAboutMissingResizeHandle:!1}),oe(()=>{if(!r)return;const s=xe(t,r);for(let a=0;a<i.length-1;a++){const{valueMax:g,valueMin:b,valueNow:f}=Tn({layout:o,panelsArray:i,pivotIndices:[a,a+1]}),c=s[a];if(c!=null){const m=i[a];z(m,`No panel data found for index "${a}"`),c.setAttribute("aria-controls",m.id),c.setAttribute("aria-valuemax",""+Math.round(g)),c.setAttribute("aria-valuemin",""+Math.round(b)),c.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{s.forEach((a,g)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[t,o,i,r]),te(()=>{if(!r)return;const s=n.current;z(s,"Eager values not found");const{panelDataArray:a}=s,g=pn(t,r);z(g!=null,`No group found for id "${t}"`);const b=xe(t,r);z(b,`No resize handles found for group id "${t}"`);const f=b.map(c=>{const m=c.getAttribute("data-panel-resize-handle-id");z(m,"Resize handle element has no handle id attribute");const[p,E]=Fn(t,m,a,r);if(p==null||E==null)return()=>{};const w=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const $=a.findIndex(R=>R.id===p);if($>=0){const R=a[$];z(R,`No panel data found for index ${$}`);const D=o[$],{collapsedSize:W=0,collapsible:C,minSize:h=0}=R.constraints;if(D!=null&&C){const T=he({delta:F(D,W)?h-W:W-D,initialLayout:o,panelConstraints:a.map(K=>K.constraints),pivotIndices:dn(t,m,r),prevLayout:o,trigger:"keyboard"});o!==T&&l(T)}}break}}};return c.addEventListener("keydown",w),()=>{c.removeEventListener("keydown",w)}});return()=>{f.forEach(c=>c())}},[r,e,n,t,o,i,l])}function qe(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function gn(e,n){const t=e==="horizontal",{x:o,y:i}=Ce(n);return t?o:i}function Vn(e,n,t,o,i){const r=t==="horizontal",l=Ie(n,i);z(l,`No resize handle element found for id "${n}"`);const s=l.getAttribute("data-panel-group-id");z(s,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=o;const g=gn(t,e),b=pn(s,i);z(b,`No group element found for id "${s}"`);const f=b.getBoundingClientRect(),c=r?f.width:f.height;return(g-a)/c*100}function Wn(e,n,t,o,i,r){if(tn(e)){const l=t==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=l?0:s;break;case"ArrowLeft":a=l?-s:0;break;case"ArrowRight":a=l?s:0;break;case"ArrowUp":a=l?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return o==null?0:Vn(e,n,t,o,r)}function Un({panelDataArray:e}){const n=Array(e.length),t=e.map(r=>r.constraints);let o=0,i=100;for(let r=0;r<e.length;r++){const l=t[r];z(l,`Panel constraints not found for index ${r}`);const{defaultSize:s}=l;s!=null&&(o++,n[r]=s,i-=s)}for(let r=0;r<e.length;r++){const l=t[r];z(l,`Panel constraints not found for index ${r}`);const{defaultSize:s}=l;if(s!=null)continue;const a=e.length-o,g=i/a;o++,n[r]=g,i-=g}return n}function se(e,n,t){n.forEach((o,i)=>{const r=e[i];z(r,`Panel data not found for index ${i}`);const{callbacks:l,constraints:s,id:a}=r,{collapsedSize:g=0,collapsible:b}=s,f=t[a];if(f==null||o!==f){t[a]=o;const{onCollapse:c,onExpand:m,onResize:p}=l;p&&p(o,f),b&&(c||m)&&(m&&(f==null||J(f,g))&&!J(o,g)&&m(),c&&(f==null||!J(f,g))&&J(o,g)&&c())}})}function Pe(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!=n[t])return!1;return!0}function On({defaultSize:e,dragState:n,layout:t,panelData:o,panelIndex:i,precision:r=3}){const l=t[i];let s;return l==null?s=e!=null?e.toPrecision(r):"1":o.length===1?s="1":s=l.toPrecision(r),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:n!==null?"none":void 0}}function qn(e,n=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{e(...i)},n)}}function Xe(e){try{if(typeof localStorage<"u")e.getItem=n=>localStorage.getItem(n),e.setItem=(n,t)=>{localStorage.setItem(n,t)};else throw new Error("localStorage not supported in this environment")}catch(n){console.error(n),e.getItem=()=>null,e.setItem=()=>{}}}function mn(e){return`react-resizable-panels:${e}`}function hn(e){return e.map(n=>{const{constraints:t,id:o,idIsFromProps:i,order:r}=n;return i?o:r?`${r}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((n,t)=>n.localeCompare(t)).join(",")}function yn(e,n){try{const t=mn(e),o=n.getItem(t);if(o){const i=JSON.parse(o);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Xn(e,n,t){var o,i;const r=(o=yn(e,t))!==null&&o!==void 0?o:{},l=hn(n);return(i=r[l])!==null&&i!==void 0?i:null}function Jn(e,n,t,o,i){var r;const l=mn(e),s=hn(n),a=(r=yn(e,i))!==null&&r!==void 0?r:{};a[s]={expandToSizes:Object.fromEntries(t.entries()),layout:o};try{i.setItem(l,JSON.stringify(a))}catch(g){console.error(g)}}function Je({layout:e,panelConstraints:n}){const t=[...e],o=t.reduce((r,l)=>r+l,0);if(t.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${t.map(r=>`${r}%`).join(", ")}`);if(!F(o,100)&&t.length>0)for(let r=0;r<n.length;r++){const l=t[r];z(l!=null,`No layout data found for index ${r}`);const s=100/o*l;t[r]=s}let i=0;for(let r=0;r<n.length;r++){const l=t[r];z(l!=null,`No layout data found for index ${r}`);const s=ce({panelConstraints:n,panelIndex:r,size:l});l!=s&&(i+=l-s,t[r]=s)}if(!F(i,0))for(let r=0;r<n.length;r++){const l=t[r];z(l!=null,`No layout data found for index ${r}`);const s=l+i,a=ce({panelConstraints:n,panelIndex:r,size:s});if(l!==a&&(i-=a-l,t[r]=a,F(i,0)))break}return t}const jn=100,ye={getItem:e=>(Xe(ye),ye.getItem(e)),setItem:(e,n)=>{Xe(ye),ye.setItem(e,n)}},je={};function zn({autoSaveId:e=null,children:n,className:t="",direction:o,forwardedRef:i,id:r=null,onLayout:l=null,keyboardResizeBy:s=null,storage:a=ye,style:g,tagName:b="div",...f}){const c=_e(r),m=B(null),[p,E]=ue(null),[w,v]=ue([]),$=Gn(),R=B({}),D=B(new Map),W=B(0),C=B({autoSaveId:e,direction:o,dragState:p,id:c,keyboardResizeBy:s,onLayout:l,storage:a}),h=B({layout:w,panelDataArray:[],panelDataArrayChanged:!1});B({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),en(i,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:u}=h.current;return u},setLayout:u=>{const{onLayout:y}=C.current,{layout:S,panelDataArray:x}=h.current,d=Je({layout:u,panelConstraints:x.map(P=>P.constraints)});qe(S,d)||(v(d),h.current.layout=d,y&&y(d),se(x,d,R.current))}}),[]),oe(()=>{C.current.autoSaveId=e,C.current.direction=o,C.current.dragState=p,C.current.id=c,C.current.onLayout=l,C.current.storage=a}),Kn({committedValuesRef:C,eagerValuesRef:h,groupId:c,layout:w,panelDataArray:h.current.panelDataArray,setLayout:v,panelGroupElement:m.current}),te(()=>{const{panelDataArray:u}=h.current;if(e){if(w.length===0||w.length!==u.length)return;let y=je[e];y==null&&(y=qn(Jn,jn),je[e]=y);const S=[...u],x=new Map(D.current);y(e,S,x,w,a)}},[e,w,a]),te(()=>{});const T=G(u=>{const{onLayout:y}=C.current,{layout:S,panelDataArray:x}=h.current;if(u.constraints.collapsible){const d=x.map(q=>q.constraints),{collapsedSize:P=0,panelSize:L,pivotIndices:M}=ee(x,u,S);if(z(L!=null,`Panel size not found for panel "${u.id}"`),!J(L,P)){D.current.set(u.id,L);const X=ae(x,u)===x.length-1?L-P:P-L,I=he({delta:X,initialLayout:S,panelConstraints:d,pivotIndices:M,prevLayout:S,trigger:"imperative-api"});Pe(S,I)||(v(I),h.current.layout=I,y&&y(I),se(x,I,R.current))}}},[]),K=G((u,y)=>{const{onLayout:S}=C.current,{layout:x,panelDataArray:d}=h.current;if(u.constraints.collapsible){const P=d.map(U=>U.constraints),{collapsedSize:L=0,panelSize:M=0,minSize:q=0,pivotIndices:X}=ee(d,u,x),I=y??q;if(J(M,L)){const U=D.current.get(u.id),pe=U!=null&&U>=I?U:I,$e=ae(d,u)===d.length-1?M-pe:pe-M,H=he({delta:$e,initialLayout:x,panelConstraints:P,pivotIndices:X,prevLayout:x,trigger:"imperative-api"});Pe(x,H)||(v(H),h.current.layout=H,S&&S(H),se(d,H,R.current))}}},[]),Z=G(u=>{const{layout:y,panelDataArray:S}=h.current,{panelSize:x}=ee(S,u,y);return z(x!=null,`Panel size not found for panel "${u.id}"`),x},[]),V=G((u,y)=>{const{panelDataArray:S}=h.current,x=ae(S,u);return On({defaultSize:y,dragState:p,layout:w,panelData:S,panelIndex:x})},[p,w]),A=G(u=>{const{layout:y,panelDataArray:S}=h.current,{collapsedSize:x=0,collapsible:d,panelSize:P}=ee(S,u,y);return z(P!=null,`Panel size not found for panel "${u.id}"`),d===!0&&J(P,x)},[]),j=G(u=>{const{layout:y,panelDataArray:S}=h.current,{collapsedSize:x=0,collapsible:d,panelSize:P}=ee(S,u,y);return z(P!=null,`Panel size not found for panel "${u.id}"`),!d||re(P,x)>0},[]),N=G(u=>{const{panelDataArray:y}=h.current;y.push(u),y.sort((S,x)=>{const d=S.order,P=x.order;return d==null&&P==null?0:d==null?-1:P==null?1:d-P}),h.current.panelDataArrayChanged=!0,$()},[$]);oe(()=>{if(h.current.panelDataArrayChanged){h.current.panelDataArrayChanged=!1;const{autoSaveId:u,onLayout:y,storage:S}=C.current,{layout:x,panelDataArray:d}=h.current;let P=null;if(u){const M=Xn(u,d,S);M&&(D.current=new Map(Object.entries(M.expandToSizes)),P=M.layout)}P==null&&(P=Un({panelDataArray:d}));const L=Je({layout:P,panelConstraints:d.map(M=>M.constraints)});qe(x,L)||(v(L),h.current.layout=L,y&&y(L),se(d,L,R.current))}}),oe(()=>{const u=h.current;return()=>{u.layout=[]}},[]);const k=G(u=>{let y=!1;const S=m.current;return S&&window.getComputedStyle(S,null).getPropertyValue("direction")==="rtl"&&(y=!0),function(d){d.preventDefault();const P=m.current;if(!P)return()=>null;const{direction:L,dragState:M,id:q,keyboardResizeBy:X,onLayout:I}=C.current,{layout:U,panelDataArray:pe}=h.current,{initialLayout:Se}=M??{},$e=dn(q,u,P);let H=Wn(d,u,L,M,X,P);const Te=L==="horizontal";Te&&y&&(H=-H);const xn=pe.map(vn=>vn.constraints),ge=he({delta:H,initialLayout:Se??U,panelConstraints:xn,pivotIndices:$e,prevLayout:U,trigger:tn(d)?"keyboard":"mouse-or-touch"}),Fe=!Pe(U,ge);(on(d)||rn(d))&&W.current!=H&&(W.current=H,!Fe&&H!==0?Te?Ne(u,H<0?sn:an):Ne(u,H<0?cn:un):Ne(u,0)),Fe&&(v(ge),h.current.layout=ge,I&&I(ge),se(pe,ge,R.current))}},[]),_=G((u,y)=>{const{onLayout:S}=C.current,{layout:x,panelDataArray:d}=h.current,P=d.map(U=>U.constraints),{panelSize:L,pivotIndices:M}=ee(d,u,x);z(L!=null,`Panel size not found for panel "${u.id}"`);const X=ae(d,u)===d.length-1?L-y:y-L,I=he({delta:X,initialLayout:x,panelConstraints:P,pivotIndices:M,prevLayout:x,trigger:"imperative-api"});Pe(x,I)||(v(I),h.current.layout=I,S&&S(I),se(d,I,R.current))},[]),Re=G((u,y)=>{const{layout:S,panelDataArray:x}=h.current,{collapsedSize:d=0,collapsible:P}=y,{collapsedSize:L=0,collapsible:M,maxSize:q=100,minSize:X=0}=u.constraints,{panelSize:I}=ee(x,u,S);I!=null&&(P&&M&&J(I,d)?J(d,L)||_(u,L):I<X?_(u,X):I>q&&_(u,q))},[_]),Q=G((u,y)=>{const{direction:S}=C.current,{layout:x}=h.current;if(!m.current)return;const d=Ie(u,m.current);z(d,`Drag handle element not found for id "${u}"`);const P=gn(S,y);E({dragHandleId:u,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:P,initialLayout:x})},[]),Ae=G(()=>{E(null)},[]),ve=G(u=>{const{panelDataArray:y}=h.current,S=ae(y,u);S>=0&&(y.splice(S,1),delete R.current[u.id],h.current.panelDataArrayChanged=!0,$())},[$]),Me=bn(()=>({collapsePanel:T,direction:o,dragState:p,expandPanel:K,getPanelSize:Z,getPanelStyle:V,groupId:c,isPanelCollapsed:A,isPanelExpanded:j,reevaluatePanelConstraints:Re,registerPanel:N,registerResizeHandle:k,resizePanel:_,startDragging:Q,stopDragging:Ae,unregisterPanel:ve,panelGroupElement:m.current}),[T,p,o,K,Z,V,c,A,j,Re,N,k,_,Q,Ae,ve]),ie={display:"flex",flexDirection:o==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return de(Ee.Provider,{value:Me},de(b,{...f,children:n,className:t,id:r,ref:m,style:{...ie,...g},"data-panel-group":"","data-panel-group-direction":o,"data-panel-group-id":c}))}const Yn=Ze((e,n)=>de(zn,{...e,forwardedRef:n}));zn.displayName="PanelGroup";Yn.displayName="forwardRef(PanelGroup)";function ae(e,n){return e.findIndex(t=>t===n||t.id===n.id)}function ee(e,n,t){const o=ae(e,n),r=o===e.length-1?[o-1,o]:[o,o+1],l=t[o];return{...n.constraints,panelSize:l,pivotIndices:r}}function Zn({disabled:e,handleId:n,resizeHandler:t,panelGroupElement:o}){te(()=>{if(e||t==null||o==null)return;const i=Ie(n,o);if(i==null)return;const r=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const s=i.getAttribute("data-panel-group-id");z(s,`No group element found for id "${s}"`);const a=xe(s,o),g=fn(s,n,o);z(g!==null,`No resize element found for id "${n}"`);const b=l.shiftKey?g>0?g-1:a.length-1:g+1<a.length?g+1:0;a[b].focus();break}}};return i.addEventListener("keydown",r),()=>{i.removeEventListener("keydown",r)}},[o,e,n,t])}function Qn({children:e=null,className:n="",disabled:t=!1,hitAreaMargins:o,id:i,onBlur:r,onDragging:l,onFocus:s,style:a={},tabIndex:g=0,tagName:b="div",...f}){var c,m;const p=B(null),E=B({onDragging:l});te(()=>{E.current.onDragging=l});const w=Qe(Ee);if(w===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:v,groupId:$,registerResizeHandle:R,startDragging:D,stopDragging:W,panelGroupElement:C}=w,h=_e(i),[T,K]=ue("inactive"),[Z,V]=ue(!1),[A,j]=ue(null),N=B({state:T});oe(()=>{N.current.state=T}),te(()=>{if(t)j(null);else{const Q=R(h);j(()=>Q)}},[t,h,R]);const k=(c=o==null?void 0:o.coarse)!==null&&c!==void 0?c:15,_=(m=o==null?void 0:o.fine)!==null&&m!==void 0?m:5;return te(()=>{if(t||A==null)return;const Q=p.current;return z(Q,"Element ref not attached"),Hn(h,Q,v,{coarse:k,fine:_},(ve,Me,ie)=>{if(Me)switch(ve){case"down":{K("drag"),z(ie,'Expected event to be defined for "down" action'),D(h,ie);const{onDragging:u}=E.current;u&&u(!0);break}case"move":{const{state:u}=N.current;u!=="drag"&&K("hover"),z(ie,'Expected event to be defined for "move" action'),A(ie);break}case"up":{K("hover"),W();const{onDragging:u}=E.current;u&&u(!1);break}}else K("inactive")})},[k,v,t,_,R,h,A,D,W]),Zn({disabled:t,handleId:h,resizeHandler:A,panelGroupElement:C}),de(b,{...f,children:e,className:n,id:i,onBlur:()=>{V(!1),r==null||r()},onFocus:()=>{V(!0),s==null||s()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...a},tabIndex:g,"data-panel-group-direction":v,"data-panel-group-id":$,"data-resize-handle":"","data-resize-handle-active":T==="drag"?"pointer":Z?"keyboard":void 0,"data-resize-handle-state":T,"data-panel-resize-handle-enabled":!t,"data-panel-resize-handle-id":h})}Qn.displayName="PanelResizeHandle";export{Ln as P,Yn as a,Qn as b};
Copyright ©2021 || Defacer Indonesia