PageSourceSearch

https://brytelyfe.com/assets/useCollapsiblePanel-DfP_llgs.js

js brytelyfe.com collected 2026-10-02 00:16:57 UTC 4,929 bytes, 4 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="40041f94-2969-5d10-b896-a1116b45ee93")}catch(e){}}();
3import{B as e,G as t}from"./jsx-runtime-BBg2aEpo.js";import{f as n,m as r}from"./createLucideIcon-Dli3z6LK.js";import{At as i,B as a,Jn as o,Mn as s,Mt as c,Pt as l,R as u,Rn as d,Tn as f,cn as p,cr as m,on as h,z as g,zn as _}from"./useOpenInteractionType-_eX71wy0.js";import{t as v}from"./useControlled-EoyzcBf6.js";var y=t(e(),1);function b(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[o,c]=v({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:l,setMounted:u,transitionStatus:d}=a(o,!0,!0),f=h(),[m,g]=y.useState(),b=m===null?void 0:m??f,x=_(e=>{let t=!o,n=p(s,e.nativeEvent);r(t,n),!n.isCanceled&&c(t)});return y.useMemo(()=>({defaultPanelId:f,disabled:i,handleTrigger:x,mounted:l,open:o,panelId:b,setMounted:u,setOpen:c,setPanelIdState:g,transitionStatus:d}),[f,i,x,l,o,b,u,c,g,d])}var x=y.createContext(void 0);function S(){let e=y.useContext(x);if(e===void 0)throw Error(r(15));return e}var C=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=m.startingStyle]=`startingStyle`,e[e.endingStyle=m.endingStyle]=`endingStyle`,e}({}),w=function(e){return e.panelOpen=`data-panel-open`,e}({}),T={[C.open]:``},E={[C.closed]:``},D={open(e){return e?{[w.panelOpen]:``}:null}},O={open(e){return e?T:E}},k={height:void 0,width:void 0};function A(e){let{externalRef:t,hiddenUntilFound:r,id:a,keepMounted:o,mounted:s,onOpenChange:m,open:h,setMounted:v,setOpen:b,transitionStatus:x}=e,S=y.useRef(null),w=y.useRef(null),[T,E]=y.useState(k),D=y.useRef(k),O=y.useRef(!1),A=y.useRef(h),N=y.useRef(!1),[I,L]=y.useState(!1),R=y.useRef(null),z=n(t,S),B=c(h),V=g(S),H=!h&&!s,U=I?`idle`:x,W=h&&(A.current||N.current),G=!h&&s&&w.current===`css-animation`&&T.height===void 0&&T.width===void 0?D.current:T,K=r&&H&&w.current!==`css-animation`,q=_((e,t=!0)=>{t&&(D.current=e),E(e)}),J=_(()=>{R.current?.(),R.current=null}),Y=_(e=>{J(),R.current=()=>{R.current=null,e()}}),X=_(()=>{h&&s&&w.current===`css-animation`&&(N.current=!0)});d(()=>{!I||x===`starting`||L(!1)},[I,x]),y.useEffect(()=>()=>{X(),J()},[X,J]),d(()=>{let e=S.current;if(!e)return;!h&&R.current&&J();let t=M(e,W);if(w.current=t,h&&x===`idle`&&A.current&&t===`css-animation`){D.current=j(e);return}if(h&&x===`starting`){let n=O.current;if(O.current=!1,t===`none`){q(j(e)),L(!0);return}if(t===`css-transition`){let t=F(e);if(q(j(e)),!n)return t;let r=P(e,`transition-duration`,`0s`);return Y(r),L(!0),t}q(j(e));let r=P(e,`animation-name`,`none`);if(!n){r();return}let i=P(e,`animation-duration`,`0s`);r(),Y(i),L(!0);return}if(!h&&s&&(x===`idle`||x===`starting`)){if(A.current=!1,N.current=!1,t===`none`){q(k,!1),v(!1);return}q(j(e));return}if(x!==`ending`)return;if(t===`none`){v(!1);return}let n=j(e);if(!(n.height>0||n.width>0)){v(!1);return}q(n),t===`css-animation`&&P(e,`animation-name`,`none`)()},[s,h,J,q,v,Y,W,x]),u({enabled:h&&s&&U===`idle`,open:!0,ref:S,onComplete(){h&&q(k,!1)}}),y.useEffect(()=>{if(h||!s||U!==`ending`||!S.current)return;let e=new AbortController,t=-1;function n(){B.current||(v(!1),q(k,!1))}return t=i.request(()=>{V(n,e.signal)}),()=>{i.cancel(t),e.abort()}},[B,s,h,U,V,q,v]),d(()=>{let e=S.current;!e||!r||!H||e.setAttribute(`hidden`,`until-found`)},[H,r]),y.useEffect(function(){let e=S.current;if(!e)return;function t(e){let t=p(f,e);m(!0,t),!t.isCanceled&&(O.current=!0,b(!0))}return l(e,`beforematch`,t)},[m,b]);let Z=o||r||s||h;return{height:G.height,props:{...K?{[C.startingStyle]:``}:void 0,hidden:H,id:a},ref:z,shouldPreventOpenAnimation:W,shouldRender:Z,transitionStatus:U,width:G.width}}function j(e){return{height:e.scrollHeight,width:e.scrollWidth}}function M(e,t){let n=o(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&N(n.animationDuration),i=N(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function N(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function P(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function F(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=i.request(n);return()=>{i.cancel(r),n()}}export{S as a,x as i,O as n,b as o,D as r,A as t};
4//# debugId=40041f94-2969-5d10-b896-a1116b45ee93

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.