// Ported verbatim from `@base-ui/react`'s
// `tabs/indicator/prehydrationScript.min.ts`. Inlined inert JS string that runs
// BEFORE Solid hydration to position the tab indicator from the SSR'd active
// tab's measured geometry — it sets the `--active-tab-{left,right,top,bottom,
// width,height}` CSS vars on the indicator and removes the `hidden` attribute
// once a non-zero box is measured. This minimizes the window where the
// indicator is invisible after SSR, before the client measurement effects run.
//
// Emitted only server-side, gated on `isHydrating && renderBeforeHydration`
// (see `tabs-indicator.tsx`). The script reads
// `document.currentScript.previousElementSibling` (the indicator) so it must
// be rendered as the indicator element's immediately-following sibling.
//
// Keep this byte-for-byte in sync with the React source; regenerate there via
// `pnpm inline-scripts` and re-copy if the React template changes.
// The `${...}` sequences are real backtick-template interpolations INSIDE the
// inlined script body (kept verbatim from React's minified output), not stray
// placeholders in this outer single-quoted string — suppress the false positive.
export const tabsIndicatorPrehydrationScript =
// biome-ignore lint/suspicious/noTemplateCurlyInString: verbatim minified script body
'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();';
//# sourceMappingURL=prehydration-script.jsx.map
