"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index.cjs38.js"),s=require("react"),f=require("./index.cjs40.js"),y=require("./index.cjs58.js"),r=require("./index.cjs59.js"),O=require("./index.cjs60.js"),$=require("./index.cjs8.js"),x=24,k=1,G=8,S=400,X=1e6,Y=["var(--palette-border-subtle)","var(--palette-background-accent)","var(--palette-border-default)","var(--palette-secondary-main)","var(--palette-secondary-hover)","var(--palette-primary-main)","var(--palette-primary-hover)","var(--palette-text-secondary)","var(--palette-background-default)","transparent"];function B(t){return Math.min(G,Math.max(k,t))}function H(t,u,n){return t&&t.width>0&&t.height>0?t:u?{width:S,height:n}:{width:n,height:S}}function E({edge:t="right",direction:u="external",boxSize:n=32,stripDensity:D=2,colors:l=Y,seed:b,children:_,className:j,contentClassName:M,contentStyle:N,testId:g,...w}){const{style:P,...T}=w,q=s.useRef(b??Math.floor(Date.now()+Math.random()*X)),v=s.useRef(null),[h,I]=s.useState(null),p=t==="top"||t==="bottom",d=B(D??2),a=x*d;s.useEffect(()=>{const e=v.current;if(!e)return;const i=new ResizeObserver(m=>{const R=m[0];if(R){const{width:F,height:L}=R.contentRect;I({width:F,height:L})}});return i.observe(e),()=>i.disconnect()},[t]);const A=s.useMemo(()=>{if(!h)return[];const{width:e,height:i}=H(h,p,a),m=y.createSeededRandom(q.current);return y.generatePattern(e,i,n,l.length,m,t,d)},[n,d,l.length,t,h,p,a]),C=p?{height:a}:{width:a,minHeight:x},o=c.jsxRuntimeExports.jsx("div",{ref:v,className:f(r.default.strip,r.default[`strip--${t}`],u==="internal"&&r.default.stripMirror),style:C,"aria-hidden":!0,children:A.map(e=>c.jsxRuntimeExports.jsx(O.PatternCell,{cell:e,colors:l},`${e.x}-${e.y}`))});return c.jsxRuntimeExports.jsxs($.Root,{as:"div",className:f(r.default.root,r.default[`root--edge-${t}`],j),style:P,testId:g,...T,children:[t==="top"&&o,t==="left"&&o,c.jsxRuntimeExports.jsx("div",{className:f(r.default.content,M),style:N,children:_}),t==="right"&&o,t==="bottom"&&o]})}E.displayName="DecorativeFrame";exports.DecorativeFrame=E;
//# sourceMappingURL=index.cjs32.js.map
