PageSourceSearch

https://aibr.org/build/assets/index-Cg9dHLmZ.js

js aibr.org collected 2026-09-24 09:33:29 UTC 4,361 bytes, 9 lines download raw bytes

1import{r as t}from"./app-belrbPXN.js";import{u as O,P as F,L as K,a as L,b as T,c as U}from"./use-force-update-VB-OXXUy.js";import{$ as B,c as k,b as D}from"./import-0kiaZdOS.js";import{u as S}from"./index-2kllFQyz.js";class A extends t.Component{getSnapshotBeforeUpdate(o){const e=this.props.childRef.current;if(e&&o.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=e.offsetHeight||0,n.width=e.offsetWidth||0,n.top=e.offsetTop,n.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function W({children:r,isPresent:o}){const e=t.useId(),n=t.useRef(null),p=t.useRef({width:0,height:0,top:0,left:0});return t.useInsertionEffect(()=>{const{width:f,height:d,top:c,left:h}=p.current;if(o||!n.current||!f||!d)return;n.current.dataset.motionPopId=e;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
2          [data-motion-pop-id="${e}"] {
3            position: absolute !important;
4            width: ${f}px !important;
5            height: ${d}px !important;
6            top: ${c}px !important;
7            left: ${h}px !important;
8          }
9        `),()=>{document.head.removeChild(l)}},[o]),t.createElement(A,{isPresent:o,childRef:n,sizeRef:p},t.cloneElement(r,{ref:n}))}const w=({children:r,initial:o,isPresent:e,onExitComplete:n,custom:p,presenceAffectsLayout:f,mode:d})=>{const c=O(G),h=t.useId(),l=t.useMemo(()=>({id:h,initial:o,isPresent:e,custom:p,onExitComplete:s=>{c.set(s,!0);for(const a of c.values())if(!a)return;n&&n()},register:s=>(c.set(s,!1),()=>c.delete(s))}),f?void 0:[e]);return t.useMemo(()=>{c.forEach((s,a)=>c.set(a,!1))},[e]),t.useEffect(()=>{!e&&!c.size&&n&&n()},[e]),d==="popLayout"&&(r=t.createElement(W,{isPresent:e},r)),t.createElement(F.Provider,{value:l},r)};function G(){return new Map}function H(r){return t.useEffect(()=>()=>r(),[])}const x=r=>r.key||"";function V(r,o){r.forEach(e=>{const n=x(e);o.set(n,e)})}function _(r){const o=[];return t.Children.forEach(r,e=>{t.isValidElement(e)&&o.push(e)}),o}const Q=({children:r,custom:o,initial:e=!0,onExitComplete:n,exitBeforeEnter:p,presenceAffectsLayout:f=!0,mode:d="sync"})=>{const c=t.useContext(K).forceRender||L()[0],h=T(),l=_(r);let s=l;const a=t.useRef(new Map).current,C=t.useRef(s),m=t.useRef(new Map).current,E=t.useRef(!0);if(U(()=>{E.current=!1,V(l,m),C.current=s}),H(()=>{E.current=!0,m.clear(),a.clear()}),E.current)return t.createElement(t.Fragment,null,s.map(i=>t.createElement(w,{key:x(i),isPresent:!0,initial:e?void 0:!1,presenceAffectsLayout:f,mode:d},i)));s=[...s];const P=C.current.map(x),b=l.map(x),R=P.length;for(let i=0;i<R;i++){const u=P[i];b.indexOf(u)===-1&&!a.has(u)&&a.set(u,void 0)}return d==="wait"&&a.size&&(s=[]),a.forEach((i,u)=>{if(b.indexOf(u)!==-1)return;const g=m.get(u);if(!g)return;const $=P.indexOf(u);let v=i;if(!v){const z=()=>{a.delete(u);const I=Array.from(m.keys()).filter(y=>!b.includes(y));if(I.forEach(y=>m.delete(y)),C.current=l.filter(y=>{const M=x(y);return M===u||I.includes(M)}),!a.size){if(h.current===!1)return;c(),n&&n()}};v=t.createElement(w,{key:x(g),isPresent:!1,onExitComplete:z,custom:o,presenceAffectsLayout:f,mode:d},g),a.set(u,v)}s.splice($,0,v)}),s=s.map(i=>{const u=i.key;return a.has(u)?i:t.createElement(w,{key:x(i),isPresent:!0,presenceAffectsLayout:f,mode:d},i)}),t.createElement(t.Fragment,null,a.size?s:s.map(i=>t.cloneElement(i)))};function X(r,o){let{elementType:e="button",isDisabled:n,onPress:p,onPressStart:f,onPressEnd:d,onPressChange:c,preventFocusOnPress:h,allowFocusWhenDisabled:l,onClick:s,href:a,target:C,rel:m,type:E="button",allowTextSelectionOnPress:P}=r,b;e==="button"?b={type:E,disabled:n}:b={role:"button",tabIndex:n?void 0:0,href:e==="a"&&n?void 0:a,target:e==="a"?C:void 0,type:e==="input"?E:void 0,disabled:e==="input"?n:void 0,"aria-disabled":!n||e==="input"?void 0:n,rel:e==="a"?m:void 0};let{pressProps:R,isPressed:i}=S({onPressStart:f,onPressEnd:d,onPressChange:c,onPress:p,isDisabled:n,preventFocusOnPress:h,allowTextSelectionOnPress:P,ref:o}),{focusableProps:u}=B(r,o);l&&(u.tabIndex=n?-1:u.tabIndex);let g=k(u,R,D(r,{labelable:!0}));return{isPressed:i,buttonProps:k(b,g,{"aria-haspopup":r["aria-haspopup"],"aria-expanded":r["aria-expanded"],"aria-controls":r["aria-controls"],"aria-pressed":r["aria-pressed"],onClick:$=>{s==null||s($)}})}}export{Q as A,X as u};

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.