@inf-monkeys-tech/monkeys-design 2.0.178 → 2.0.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/agent-workbench/index.js +1 -1
- package/dist/components/agent-workbench/index.js.map +1 -1
- package/dist/components/agent-workbench/index.mjs +1 -1
- package/dist/components/agent-workbench/index.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var xo__namespace = /*#__PURE__*/_interopNamespace(xo);
|
|
|
62
62
|
var Tt__namespace = /*#__PURE__*/_interopNamespace(Tt);
|
|
63
63
|
var Vo__namespace = /*#__PURE__*/_interopNamespace(Vo);
|
|
64
64
|
|
|
65
|
-
var zS=Object.defineProperty;var a=(e,t)=>zS(e,"name",{value:t,configurable:true});var Br=a((e,t=0,o=1)=>oi(ri(t,e),o),"default");var Sa=a(e=>{e._clipped=false,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=true),e[t]=Br(e[t],0,255)):t===3&&(e[t]=Br(e[t],0,1));return e},"default");var rg={};for(let e of ["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])rg[`[object ${e}]`]=e.toLowerCase();function Qe(e){return rg[Object.prototype.toString.call(e)]||"object"}a(Qe,"default");var Ue=a((e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Qe(e[0])=="object"&&t?t.split("").filter(o=>e[0][o]!==void 0).map(o=>e[0][o]):e[0],"default");var tn=a(e=>{if(e.length<2)return null;let t=e.length-1;return Qe(e[t])=="string"?e[t].toLowerCase():null},"default");var{PI:Kl,min:oi,max:ri}=Math,er=Kl*2,ql=Kl/3,ng=Kl/180,ag=180/Kl;var Ze={format:{},autodetect:[]};var Mp=class Mp{constructor(...t){let o=this;if(Qe(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=tn(t),n=false;if(!r){n=true,Ze.sorted||(Ze.autodetect=Ze.autodetect.sort((i,s)=>s.p-i.p),Ze.sorted=true);for(let i of Ze.autodetect)if(r=i.test(...t),r)break}if(Ze.format[r]){let i=Ze.format[r].apply(null,n?t:t.slice(0,-1));o._rgb=Sa(i);}else throw new Error("unknown format: "+t);o._rgb.length===3&&o._rgb.push(1);}toString(){return Qe(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};a(Mp,"Color");var Rp=Mp,ye=Rp;var ig="2.6.0";var Yl=a((...e)=>new Yl.Color(...e),"chroma");Yl.Color=ye;Yl.version=ig;var ot=Yl;var OS=a((...e)=>{e=Ue(e,"cmyk");let[t,o,r,n]=e,i=e.length>4?e[4]:1;return n===1?[0,0,0,i]:[t>=1?0:255*(1-t)*(1-n),o>=1?0:255*(1-o)*(1-n),r>=1?0:255*(1-r)*(1-n),i]},"cmyk2rgb"),sg=OS;var{max:lg}=Math,FS=a((...e)=>{let[t,o,r]=Ue(e,"rgb");t=t/255,o=o/255,r=r/255;let n=1-lg(t,lg(o,r)),i=n<1?1/(1-n):0,s=(1-t-n)*i,l=(1-o-n)*i,d=(1-r-n)*i;return [s,l,d,n]},"rgb2cmyk"),dg=FS;ye.prototype.cmyk=function(){return dg(this._rgb)};ot.cmyk=(...e)=>new ye(...e,"cmyk");Ze.format.cmyk=sg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"cmyk"),Qe(e)==="array"&&e.length===4)return "cmyk"},"test")});var Ip=a(e=>Math.round(e*100)/100,"rnd"),HS=a((...e)=>{let t=Ue(e,"hsla"),o=tn(e)||"lsa";return t[0]=Ip(t[0]||0),t[1]=Ip(t[1]*100)+"%",t[2]=Ip(t[2]*100)+"%",o==="hsla"||t.length>3&&t[3]<1?(t[3]=t.length>3?t[3]:1,o="hsla"):t.length=3,`${o}(${t.join(",")})`},"hsl2css"),cg=HS;var VS=a((...e)=>{e=Ue(e,"rgba");let[t,o,r]=e;t/=255,o/=255,r/=255;let n=oi(t,o,r),i=ri(t,o,r),s=(i+n)/2,l,d;return i===n?(l=0,d=Number.NaN):l=s<.5?(i-n)/(i+n):(i-n)/(2-i-n),t==i?d=(o-r)/(i-n):o==i?d=2+(r-t)/(i-n):r==i&&(d=4+(t-o)/(i-n)),d*=60,d<0&&(d+=360),e.length>3&&e[3]!==void 0?[d,l,s,e[3]]:[d,l,s]},"rgb2hsl"),Xl=VS;var{round:Dp}=Math,_S=a((...e)=>{let t=Ue(e,"rgba"),o=tn(e)||"rgb";return o.substr(0,3)=="hsl"?cg(Xl(t),o):(t[0]=Dp(t[0]),t[1]=Dp(t[1]),t[2]=Dp(t[2]),(o==="rgba"||t.length>3&&t[3]<1)&&(t[3]=t.length>3?t[3]:1,o="rgba"),`${o}(${t.slice(0,o==="rgb"?3:4).join(",")})`)},"rgb2css"),ug=_S;var{round:Pp}=Math,GS=a((...e)=>{e=Ue(e,"hsl");let[t,o,r]=e,n,i,s;if(o===0)n=i=s=r*255;else {let l=[0,0,0],d=[0,0,0],c=r<.5?r*(1+o):r+o-r*o,p=2*r-c,u=t/360;l[0]=u+1/3,l[1]=u,l[2]=u-1/3;for(let g=0;g<3;g++)l[g]<0&&(l[g]+=1),l[g]>1&&(l[g]-=1),6*l[g]<1?d[g]=p+(c-p)*6*l[g]:2*l[g]<1?d[g]=c:3*l[g]<2?d[g]=p+(c-p)*(2/3-l[g])*6:d[g]=p;[n,i,s]=[Pp(d[0]*255),Pp(d[1]*255),Pp(d[2]*255)];}return e.length>3?[n,i,s,e[3]]:[n,i,s,1]},"hsl2rgb"),hs=GS;var mg=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,fg=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,bg=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,gg=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,hg=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,yg=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,{round:pg}=Math,xg=a(e=>{e=e.toLowerCase().trim();let t;if(Ze.format.named)try{return Ze.format.named(e)}catch{}if(t=e.match(mg)){let o=t.slice(1,4);for(let r=0;r<3;r++)o[r]=+o[r];return o[3]=1,o}if(t=e.match(fg)){let o=t.slice(1,5);for(let r=0;r<4;r++)o[r]=+o[r];return o}if(t=e.match(bg)){let o=t.slice(1,4);for(let r=0;r<3;r++)o[r]=pg(o[r]*2.55);return o[3]=1,o}if(t=e.match(gg)){let o=t.slice(1,5);for(let r=0;r<3;r++)o[r]=pg(o[r]*2.55);return o[3]=+o[3],o}if(t=e.match(hg)){let o=t.slice(1,4);o[1]*=.01,o[2]*=.01;let r=hs(o);return r[3]=1,r}if(t=e.match(yg)){let o=t.slice(1,4);o[1]*=.01,o[2]*=.01;let r=hs(o);return r[3]=+t[4],r}},"css2rgb");xg.test=e=>mg.test(e)||fg.test(e)||bg.test(e)||gg.test(e)||hg.test(e)||yg.test(e);var Ep=xg;ye.prototype.css=function(e){return ug(this._rgb,e)};ot.css=(...e)=>new ye(...e,"css");Ze.format.css=Ep;Ze.autodetect.push({p:5,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&Ep.test(e))return "css"},"test")});Ze.format.gl=(...e)=>{let t=Ue(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};ot.gl=(...e)=>new ye(...e,"gl");ye.prototype.gl=function(){let e=this._rgb;return [e[0]/255,e[1]/255,e[2]/255,e[3]]};var{floor:$S}=Math,jS=a((...e)=>{e=Ue(e,"hcg");let[t,o,r]=e,n,i,s;r=r*255;let l=o*255;if(o===0)n=i=s=r;else {t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let d=$S(t),c=t-d,p=r*(1-o),u=p+l*(1-c),g=p+l*c,f=p+l;switch(d){case 0:[n,i,s]=[f,g,p];break;case 1:[n,i,s]=[u,f,p];break;case 2:[n,i,s]=[p,f,g];break;case 3:[n,i,s]=[p,u,f];break;case 4:[n,i,s]=[g,p,f];break;case 5:[n,i,s]=[f,p,u];break}}return [n,i,s,e.length>3?e[3]:1]},"hcg2rgb"),vg=jS;var US=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),n=oi(t,o,r),i=ri(t,o,r),s=i-n,l=s*100/255,d=n/(255-s)*100,c;return s===0?c=Number.NaN:(t===i&&(c=(o-r)/s),o===i&&(c=2+(r-t)/s),r===i&&(c=4+(t-o)/s),c*=60,c<0&&(c+=360)),[c,l,d]},"rgb2hcg"),wg=US;ye.prototype.hcg=function(){return wg(this._rgb)};ot.hcg=(...e)=>new ye(...e,"hcg");Ze.format.hcg=vg;Ze.autodetect.push({p:1,test:a((...e)=>{if(e=Ue(e,"hcg"),Qe(e)==="array"&&e.length===3)return "hcg"},"test")});var KS=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,qS=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,YS=a(e=>{if(e.match(KS)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16),o=t>>16,r=t>>8&255,n=t&255;return [o,r,n,1]}if(e.match(qS)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16),o=t>>24&255,r=t>>16&255,n=t>>8&255,i=Math.round((t&255)/255*100)/100;return [o,r,n,i]}throw new Error(`unknown hex color: ${e}`)},"hex2rgb"),Ql=YS;var{round:Zl}=Math,XS=a((...e)=>{let[t,o,r,n]=Ue(e,"rgba"),i=tn(e)||"auto";n===void 0&&(n=1),i==="auto"&&(i=n<1?"rgba":"rgb"),t=Zl(t),o=Zl(o),r=Zl(r);let l="000000"+(t<<16|o<<8|r).toString(16);l=l.substr(l.length-6);let d="0"+Zl(n*255).toString(16);switch(d=d.substr(d.length-2),i.toLowerCase()){case "rgba":return `#${l}${d}`;case "argb":return `#${d}${l}`;default:return `#${l}`}},"rgb2hex"),Jl=XS;ye.prototype.hex=function(e){return Jl(this._rgb,e)};ot.hex=(...e)=>new ye(...e,"hex");Ze.format.hex=Ql;Ze.autodetect.push({p:4,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return "hex"},"test")});var{cos:ni}=Math,QS=a((...e)=>{e=Ue(e,"hsi");let[t,o,r]=e,n,i,s;return isNaN(t)&&(t=0),isNaN(o)&&(o=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(s=(1-o)/3,n=(1+o*ni(er*t)/ni(ql-er*t))/3,i=1-(s+n)):t<2/3?(t-=1/3,n=(1-o)/3,i=(1+o*ni(er*t)/ni(ql-er*t))/3,s=1-(n+i)):(t-=2/3,i=(1-o)/3,s=(1+o*ni(er*t)/ni(ql-er*t))/3,n=1-(i+s)),n=Br(r*n*3),i=Br(r*i*3),s=Br(r*s*3),[n*255,i*255,s*255,e.length>3?e[3]:1]},"hsi2rgb"),kg=QS;var{min:ZS,sqrt:JS,acos:e1}=Math,t1=a((...e)=>{let[t,o,r]=Ue(e,"rgb");t/=255,o/=255,r/=255;let n,i=ZS(t,o,r),s=(t+o+r)/3,l=s>0?1-i/s:0;return l===0?n=NaN:(n=(t-o+(t-r))/2,n/=JS((t-o)*(t-o)+(t-r)*(o-r)),n=e1(n),r>o&&(n=er-n),n/=er),[n*360,l,s]},"rgb2hsi"),Cg=t1;ye.prototype.hsi=function(){return Cg(this._rgb)};ot.hsi=(...e)=>new ye(...e,"hsi");Ze.format.hsi=kg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsi"),Qe(e)==="array"&&e.length===3)return "hsi"},"test")});ye.prototype.hsl=function(){return Xl(this._rgb)};ot.hsl=(...e)=>new ye(...e,"hsl");Ze.format.hsl=hs;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsl"),Qe(e)==="array"&&e.length===3)return "hsl"},"test")});var{floor:o1}=Math,r1=a((...e)=>{e=Ue(e,"hsv");let[t,o,r]=e,n,i,s;if(r*=255,o===0)n=i=s=r;else {t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let l=o1(t),d=t-l,c=r*(1-o),p=r*(1-o*d),u=r*(1-o*(1-d));switch(l){case 0:[n,i,s]=[r,u,c];break;case 1:[n,i,s]=[p,r,c];break;case 2:[n,i,s]=[c,r,u];break;case 3:[n,i,s]=[c,p,r];break;case 4:[n,i,s]=[u,c,r];break;case 5:[n,i,s]=[r,c,p];break}}return [n,i,s,e.length>3?e[3]:1]},"hsv2rgb"),Sg=r1;var{min:n1,max:a1}=Math,i1=a((...e)=>{e=Ue(e,"rgb");let[t,o,r]=e,n=n1(t,o,r),i=a1(t,o,r),s=i-n,l,d,c;return c=i/255,i===0?(l=Number.NaN,d=0):(d=s/i,t===i&&(l=(o-r)/s),o===i&&(l=2+(r-t)/s),r===i&&(l=4+(t-o)/s),l*=60,l<0&&(l+=360)),[l,d,c]},"rgb2hsl"),Tg=i1;ye.prototype.hsv=function(){return Tg(this._rgb)};ot.hsv=(...e)=>new ye(...e,"hsv");Ze.format.hsv=Sg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsv"),Qe(e)==="array"&&e.length===3)return "hsv"},"test")});var ao={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452};var{pow:s1}=Math,l1=a((...e)=>{e=Ue(e,"lab");let[t,o,r]=e,n,i,s,l,d,c;return i=(t+16)/116,n=isNaN(o)?i:i+o/500,s=isNaN(r)?i:i-r/200,i=ao.Yn*Bp(i),n=ao.Xn*Bp(n),s=ao.Zn*Bp(s),l=Ap(3.2404542*n-1.5371385*i-.4985314*s),d=Ap(-0.969266*n+1.8760108*i+.041556*s),c=Ap(.0556434*n-.2040259*i+1.0572252*s),[l,d,c,e.length>3?e[3]:1]},"lab2rgb"),Ap=a(e=>255*(e<=.00304?12.92*e:1.055*s1(e,1/2.4)-.055),"xyz_rgb"),Bp=a(e=>e>ao.t1?e*e*e:ao.t2*(e-ao.t0),"lab_xyz"),ed=l1;var{pow:Ng}=Math,d1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=c1(t,o,r),l=116*i-16;return [l<0?0:l,500*(n-i),200*(i-s)]},"rgb2lab"),Lp=a(e=>(e/=255)<=.04045?e/12.92:Ng((e+.055)/1.055,2.4),"rgb_xyz"),Wp=a(e=>e>ao.t3?Ng(e,1/3):e/ao.t2+ao.t0,"xyz_lab"),c1=a((e,t,o)=>{e=Lp(e),t=Lp(t),o=Lp(o);let r=Wp((.4124564*e+.3575761*t+.1804375*o)/ao.Xn),n=Wp((.2126729*e+.7151522*t+.072175*o)/ao.Yn),i=Wp((.0193339*e+.119192*t+.9503041*o)/ao.Zn);return [r,n,i]},"rgb2xyz"),td=d1;ye.prototype.lab=function(){return td(this._rgb)};ot.lab=(...e)=>new ye(...e,"lab");Ze.format.lab=ed;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"lab"),Qe(e)==="array"&&e.length===3)return "lab"},"test")});var{sin:u1,cos:p1}=Math,m1=a((...e)=>{let[t,o,r]=Ue(e,"lch");return isNaN(r)&&(r=0),r=r*ng,[t,p1(r)*o,u1(r)*o]},"lch2lab"),od=m1;var f1=a((...e)=>{e=Ue(e,"lch");let[t,o,r]=e,[n,i,s]=od(t,o,r),[l,d,c]=ed(n,i,s);return [l,d,c,e.length>3?e[3]:1]},"lch2rgb"),rd=f1;var b1=a((...e)=>{let t=Ue(e,"hcl").reverse();return rd(...t)},"hcl2rgb"),Rg=b1;var{sqrt:g1,atan2:h1,round:y1}=Math,x1=a((...e)=>{let[t,o,r]=Ue(e,"lab"),n=g1(o*o+r*r),i=(h1(r,o)*ag+360)%360;return y1(n*1e4)===0&&(i=Number.NaN),[t,n,i]},"lab2lch"),nd=x1;var v1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=td(t,o,r);return nd(n,i,s)},"rgb2lch"),zp=v1;ye.prototype.lch=function(){return zp(this._rgb)};ye.prototype.hcl=function(){return zp(this._rgb).reverse()};ot.lch=(...e)=>new ye(...e,"lch");ot.hcl=(...e)=>new ye(...e,"hcl");Ze.format.lch=rd;Ze.format.hcl=Rg;["lch","hcl"].forEach(e=>Ze.autodetect.push({p:2,test:a((...t)=>{if(t=Ue(t,e),Qe(t)==="array"&&t.length===3)return e},"test")}));var w1={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},En=w1;ye.prototype.name=function(){let e=Jl(this._rgb,"rgb");for(let t of Object.keys(En))if(En[t]===e)return t.toLowerCase();return e};Ze.format.named=e=>{if(e=e.toLowerCase(),En[e])return Ql(En[e]);throw new Error("unknown color name: "+e)};Ze.autodetect.push({p:5,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&En[e.toLowerCase()])return "named"},"test")});var k1=a(e=>{if(Qe(e)=="number"&&e>=0&&e<=16777215){let t=e>>16,o=e>>8&255,r=e&255;return [t,o,r,1]}throw new Error("unknown num color: "+e)},"num2rgb"),Mg=k1;var C1=a((...e)=>{let[t,o,r]=Ue(e,"rgb");return (t<<16)+(o<<8)+r},"rgb2num"),Ig=C1;ye.prototype.num=function(){return Ig(this._rgb)};ot.num=(...e)=>new ye(...e,"num");Ze.format.num=Mg;Ze.autodetect.push({p:5,test:a((...e)=>{if(e.length===1&&Qe(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return "num"},"test")});var{round:Dg}=Math;ye.prototype.rgb=function(e=true){return e===false?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Dg)};ye.prototype.rgba=function(e=true){return this._rgb.slice(0,4).map((t,o)=>o<3?e===false?t:Dg(t):t)};ot.rgb=(...e)=>new ye(...e,"rgb");Ze.format.rgb=(...e)=>{let t=Ue(e,"rgba");return t[3]===void 0&&(t[3]=1),t};Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"rgba"),Qe(e)==="array"&&(e.length===3||e.length===4&&Qe(e[3])=="number"&&e[3]>=0&&e[3]<=1))return "rgb"},"test")});var{log:ad}=Math,S1=a(e=>{let t=e/100,o,r,n;return t<66?(o=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*ad(r),n=t<20?0:-254.76935184120902+.8274096064007395*(n=t-10)+115.67994401066147*ad(n)):(o=351.97690566805693+.114206453784165*(o=t-55)-40.25366309332127*ad(o),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*ad(r),n=255),[o,r,n,1]},"temperature2rgb"),id=S1;var{round:T1}=Math,N1=a((...e)=>{let t=Ue(e,"rgb"),o=t[0],r=t[2],n=1e3,i=4e4,s=.4,l;for(;i-n>s;){l=(i+n)*.5;let d=id(l);d[2]/d[0]>=r/o?i=l:n=l;}return T1(l)},"rgb2temperature"),Pg=N1;ye.prototype.temp=ye.prototype.kelvin=ye.prototype.temperature=function(){return Pg(this._rgb)};ot.temp=ot.kelvin=ot.temperature=(...e)=>new ye(...e,"temp");Ze.format.temp=Ze.format.kelvin=Ze.format.temperature=id;var{pow:sd,sign:R1}=Math,M1=a((...e)=>{e=Ue(e,"lab");let[t,o,r]=e,n=sd(t+.3963377774*o+.2158037573*r,3),i=sd(t-.1055613458*o-.0638541728*r,3),s=sd(t-.0894841775*o-1.291485548*r,3);return [255*Op(4.0767416621*n-3.3077115913*i+.2309699292*s),255*Op(-1.2684380046*n+2.6097574011*i-.3413193965*s),255*Op(-0.0041960863*n-.7034186147*i+1.707614701*s),e.length>3?e[3]:1]},"oklab2rgb"),ld=M1;function Op(e){let t=Math.abs(e);return t>.0031308?(R1(e)||1)*(1.055*sd(t,1/2.4)-.055):e*12.92}a(Op,"lrgb2rgb");var{cbrt:Fp,pow:I1,sign:D1}=Math,P1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=[Hp(t/255),Hp(o/255),Hp(r/255)],l=Fp(.4122214708*n+.5363325363*i+.0514459929*s),d=Fp(.2119034982*n+.6806995451*i+.1073969566*s),c=Fp(.0883024619*n+.2817188376*i+.6299787005*s);return [.2104542553*l+.793617785*d-.0040720468*c,1.9779984951*l-2.428592205*d+.4505937099*c,.0259040371*l+.7827717662*d-.808675766*c]},"rgb2oklab"),dd=P1;function Hp(e){let t=Math.abs(e);return t<.04045?e/12.92:(D1(e)||1)*I1((t+.055)/1.055,2.4)}a(Hp,"rgb2lrgb");ye.prototype.oklab=function(){return dd(this._rgb)};ot.oklab=(...e)=>new ye(...e,"oklab");Ze.format.oklab=ld;Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"oklab"),Qe(e)==="array"&&e.length===3)return "oklab"},"test")});var E1=a((...e)=>{e=Ue(e,"lch");let[t,o,r]=e,[n,i,s]=od(t,o,r),[l,d,c]=ld(n,i,s);return [l,d,c,e.length>3?e[3]:1]},"oklch2rgb"),Eg=E1;var A1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=dd(t,o,r);return nd(n,i,s)},"rgb2oklch"),Ag=A1;ye.prototype.oklch=function(){return Ag(this._rgb)};ot.oklch=(...e)=>new ye(...e,"oklch");Ze.format.oklch=Eg;Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"oklch"),Qe(e)==="array"&&e.length===3)return "oklch"},"test")});ye.prototype.alpha=function(e,t=false){return e!==void 0&&Qe(e)==="number"?t?(this._rgb[3]=e,this):new ye([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};ye.prototype.clipped=function(){return this._rgb._clipped||false};ye.prototype.darken=function(e=1){let t=this,o=t.lab();return o[0]-=ao.Kn*e,new ye(o,"lab").alpha(t.alpha(),true)};ye.prototype.brighten=function(e=1){return this.darken(-e)};ye.prototype.darker=ye.prototype.darken;ye.prototype.brighter=ye.prototype.brighten;ye.prototype.get=function(e){let[t,o]=e.split("."),r=this[t]();if(o){let n=t.indexOf(o)-(t.substr(0,2)==="ok"?2:0);if(n>-1)return r[n];throw new Error(`unknown channel ${o} in mode ${t}`)}else return r};var{pow:B1}=Math,L1=1e-7,W1=20;ye.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&Qe(e)==="number"){if(e===0)return new ye([0,0,0,this._rgb[3]],"rgb");if(e===1)return new ye([255,255,255,this._rgb[3]],"rgb");let o=this.luminance(),r=W1,n=a((s,l)=>{let d=s.interpolate(l,.5,t),c=d.luminance();return Math.abs(e-c)<L1||!r--?d:c>e?n(s,d):n(d,l)},"test"),i=(o>e?n(new ye([0,0,0]),this):n(this,new ye([255,255,255]))).rgb();return new ye([...i,this._rgb[3]])}return z1(...this._rgb.slice(0,3))};var z1=a((e,t,o)=>(e=Vp(e),t=Vp(t),o=Vp(o),.2126*e+.7152*t+.0722*o),"rgb2luminance"),Vp=a(e=>(e/=255,e<=.03928?e/12.92:B1((e+.055)/1.055,2.4)),"luminance_x");var Pt={};var An=a((e,t,o=.5,...r)=>{let n=r[0]||"lrgb";if(!Pt[n]&&!r.length&&(n=Object.keys(Pt)[0]),!Pt[n])throw new Error(`interpolation mode ${n} is not defined`);return Qe(e)!=="object"&&(e=new ye(e)),Qe(t)!=="object"&&(t=new ye(t)),Pt[n](e,t,o).alpha(e.alpha()+o*(t.alpha()-e.alpha()))},"default");ye.prototype.mix=ye.prototype.interpolate=function(e,t=.5,...o){return An(this,e,t,...o)};ye.prototype.premultiply=function(e=false){let t=this._rgb,o=t[3];return e?(this._rgb=[t[0]*o,t[1]*o,t[2]*o,o],this):new ye([t[0]*o,t[1]*o,t[2]*o,o],"rgb")};ye.prototype.saturate=function(e=1){let t=this,o=t.lch();return o[1]+=ao.Kn*e,o[1]<0&&(o[1]=0),new ye(o,"lch").alpha(t.alpha(),true)};ye.prototype.desaturate=function(e=1){return this.saturate(-e)};ye.prototype.set=function(e,t,o=false){let[r,n]=e.split("."),i=this[r]();if(n){let s=r.indexOf(n)-(r.substr(0,2)==="ok"?2:0);if(s>-1){if(Qe(t)=="string")switch(t.charAt(0)){case "+":i[s]+=+t;break;case "-":i[s]+=+t;break;case "*":i[s]*=+t.substr(1);break;case "/":i[s]/=+t.substr(1);break;default:i[s]=+t;}else if(Qe(t)==="number")i[s]=t;else throw new Error("unsupported value for Color.set");let l=new ye(i,r);return o?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${n} in mode ${r}`)}else return i};ye.prototype.tint=function(e=.5,...t){return An(this,"white",e,...t)};ye.prototype.shade=function(e=.5,...t){return An(this,"black",e,...t)};var O1=a((e,t,o)=>{let r=e._rgb,n=t._rgb;return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"rgb")},"rgb");Pt.rgb=O1;var{sqrt:_p,pow:ai}=Math,F1=a((e,t,o)=>{let[r,n,i]=e._rgb,[s,l,d]=t._rgb;return new ye(_p(ai(r,2)*(1-o)+ai(s,2)*o),_p(ai(n,2)*(1-o)+ai(l,2)*o),_p(ai(i,2)*(1-o)+ai(d,2)*o),"rgb")},"lrgb");Pt.lrgb=F1;var H1=a((e,t,o)=>{let r=e.lab(),n=t.lab();return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"lab")},"lab");Pt.lab=H1;var tr=a((e,t,o,r)=>{let n,i;r==="hsl"?(n=e.hsl(),i=t.hsl()):r==="hsv"?(n=e.hsv(),i=t.hsv()):r==="hcg"?(n=e.hcg(),i=t.hcg()):r==="hsi"?(n=e.hsi(),i=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",n=e.hcl(),i=t.hcl()):r==="oklch"&&(n=e.oklch().reverse(),i=t.oklch().reverse());let s,l,d,c,p,u;(r.substr(0,1)==="h"||r==="oklch")&&([s,d,p]=n,[l,c,u]=i);let g,f,b,x;return !isNaN(s)&&!isNaN(l)?(l>s&&l-s>180?x=l-(s+360):l<s&&s-l>180?x=l+360-s:x=l-s,f=s+o*x):isNaN(s)?isNaN(l)?f=Number.NaN:(f=l,(p==1||p==0)&&r!="hsv"&&(g=c)):(f=s,(u==1||u==0)&&r!="hsv"&&(g=d)),g===void 0&&(g=d+o*(c-d)),b=p+o*(u-p),r==="oklch"?new ye([b,g,f],r):new ye([f,g,b],r)},"default");var Bg=a((e,t,o)=>tr(e,t,o,"lch"),"lch");Pt.lch=Bg;Pt.hcl=Bg;var V1=a((e,t,o)=>{let r=e.num(),n=t.num();return new ye(r+o*(n-r),"num")},"num");Pt.num=V1;var _1=a((e,t,o)=>tr(e,t,o,"hcg"),"hcg");Pt.hcg=_1;var G1=a((e,t,o)=>tr(e,t,o,"hsi"),"hsi");Pt.hsi=G1;var $1=a((e,t,o)=>tr(e,t,o,"hsl"),"hsl");Pt.hsl=$1;var j1=a((e,t,o)=>tr(e,t,o,"hsv"),"hsv");Pt.hsv=j1;var U1=a((e,t,o)=>{let r=e.oklab(),n=t.oklab();return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"oklab")},"oklab");Pt.oklab=U1;var K1=a((e,t,o)=>tr(e,t,o,"oklch"),"oklch");Pt.oklch=K1;var{pow:Gp,sqrt:$p,PI:jp,cos:Lg,sin:Wg,atan2:q1}=Math,zg=a((e,t="lrgb",o=null)=>{let r=e.length;o||(o=Array.from(new Array(r)).map(()=>1));let n=r/o.reduce(function(u,g){return u+g});if(o.forEach((u,g)=>{o[g]*=n;}),e=e.map(u=>new ye(u)),t==="lrgb")return Y1(e,o);let i=e.shift(),s=i.get(t),l=[],d=0,c=0;for(let u=0;u<s.length;u++)if(s[u]=(s[u]||0)*o[0],l.push(isNaN(s[u])?0:o[0]),t.charAt(u)==="h"&&!isNaN(s[u])){let g=s[u]/180*jp;d+=Lg(g)*o[0],c+=Wg(g)*o[0];}let p=i.alpha()*o[0];e.forEach((u,g)=>{let f=u.get(t);p+=u.alpha()*o[g+1];for(let b=0;b<s.length;b++)if(!isNaN(f[b]))if(l[b]+=o[g+1],t.charAt(b)==="h"){let x=f[b]/180*jp;d+=Lg(x)*o[g+1],c+=Wg(x)*o[g+1];}else s[b]+=f[b]*o[g+1];});for(let u=0;u<s.length;u++)if(t.charAt(u)==="h"){let g=q1(c/l[u],d/l[u])/jp*180;for(;g<0;)g+=360;for(;g>=360;)g-=360;s[u]=g;}else s[u]=s[u]/l[u];return p/=r,new ye(s,t).alpha(p>.99999?1:p,true)},"default"),Y1=a((e,t)=>{let o=e.length,r=[0,0,0,0];for(let n=0;n<e.length;n++){let i=e[n],s=t[n]/o,l=i._rgb;r[0]+=Gp(l[0],2)*s,r[1]+=Gp(l[1],2)*s,r[2]+=Gp(l[2],2)*s,r[3]+=l[3]*s;}return r[0]=$p(r[0]),r[1]=$p(r[1]),r[2]=$p(r[2]),r[3]>.9999999&&(r[3]=1),new ye(Sa(r))},"_average_lrgb");var{pow:X1}=Math;function Bn(e){let t="rgb",o=ot("#ccc"),r=0,n=[0,1],i=[],s=[0,0],l=false,d=[],c=false,p=0,u=1,g=false,f={},b=true,x=1,y=a(function(C){if(C=C||["#fff","#000"],C&&Qe(C)==="string"&&ot.brewer&&ot.brewer[C.toLowerCase()]&&(C=ot.brewer[C.toLowerCase()]),Qe(C)==="array"){C.length===1&&(C=[C[0],C[0]]),C=C.slice(0);for(let R=0;R<C.length;R++)C[R]=ot(C[R]);i.length=0;for(let R=0;R<C.length;R++)i.push(R/(C.length-1));}return S(),d=C},"setColors"),k=a(function(C){if(l!=null){let R=l.length-1,M=0;for(;M<R&&C>=l[M];)M++;return M-1}return 0},"getClass"),w=a(C=>C,"tMapLightness"),v=a(C=>C,"tMapDomain"),h=a(function(C,R){let M,I;if(R==null&&(R=false),isNaN(C)||C===null)return o;R?I=C:l&&l.length>2?I=k(C)/(l.length-2):u!==p?I=(C-p)/(u-p):I=1,I=v(I),R||(I=w(I)),x!==1&&(I=X1(I,x)),I=s[0]+I*(1-s[0]-s[1]),I=Br(I,0,1);let B=Math.floor(I*1e4);if(b&&f[B])M=f[B];else {if(Qe(d)==="array")for(let N=0;N<i.length;N++){let D=i[N];if(I<=D){M=d[N];break}if(I>=D&&N===i.length-1){M=d[N];break}if(I>D&&I<i[N+1]){I=(I-D)/(i[N+1]-D),M=ot.interpolate(d[N],d[N+1],I,t);break}}else Qe(d)==="function"&&(M=d(I));b&&(f[B]=M);}return M},"getColor");var S=a(()=>f={},"resetCache");y(e);let T=a(function(C){let R=ot(h(C));return c&&R[c]?R[c]():R},"f");return T.classes=function(C){if(C!=null){if(Qe(C)==="array")l=C,n=[C[0],C[C.length-1]];else {let R=ot.analyze(n);C===0?l=[R.min,R.max]:l=ot.limits(R,"e",C);}return T}return l},T.domain=function(C){if(!arguments.length)return n;p=C[0],u=C[C.length-1],i=[];let R=d.length;if(C.length===R&&p!==u)for(let M of Array.from(C))i.push((M-p)/(u-p));else {for(let M=0;M<R;M++)i.push(M/(R-1));if(C.length>2){let M=C.map((B,N)=>N/(C.length-1)),I=C.map(B=>(B-p)/(u-p));I.every((B,N)=>M[N]===B)||(v=a(B=>{if(B<=0||B>=1)return B;let N=0;for(;B>=I[N+1];)N++;let D=(B-I[N])/(I[N+1]-I[N]);return M[N]+D*(M[N+1]-M[N])},"tMapDomain"));}}return n=[p,u],T},T.mode=function(C){return arguments.length?(t=C,S(),T):t},T.range=function(C,R){return y(C,R),T},T.out=function(C){return c=C,T},T.spread=function(C){return arguments.length?(r=C,T):r},T.correctLightness=function(C){return C==null&&(C=true),g=C,S(),g?w=a(function(R){let M=h(0,true).lab()[0],I=h(1,true).lab()[0],B=M>I,N=h(R,true).lab()[0],D=M+(I-M)*R,E=N-D,P=0,W=1,H=20;for(;Math.abs(E)>.01&&H-- >0;)(function(){return B&&(E*=-1),E<0?(P=R,R+=(W-R)*.5):(W=R,R+=(P-R)*.5),N=h(R,true).lab()[0],E=N-D})();return R},"tMapLightness"):w=a(R=>R,"tMapLightness"),T},T.padding=function(C){return C!=null?(Qe(C)==="number"&&(C=[C,C]),s=C,T):s},T.colors=function(C,R){arguments.length<2&&(R="hex");let M=[];if(arguments.length===0)M=d.slice(0);else if(C===1)M=[T(.5)];else if(C>1){let I=n[0],B=n[1]-I;M=Q1(0,C,false).map(N=>T(I+N/(C-1)*B));}else {e=[];let I=[];if(l&&l.length>2)for(let B=1,N=l.length,D=1<=N;D?B<N:B>N;D?B++:B--)I.push((l[B-1]+l[B])*.5);else I=n;M=I.map(B=>T(B));}return ot[R]&&(M=M.map(I=>I[R]())),M},T.cache=function(C){return C!=null?(b=C,T):b},T.gamma=function(C){return C!=null?(x=C,T):x},T.nodata=function(C){return C!=null?(o=ot(C),T):o},T}a(Bn,"default");function Q1(e,t,o){let r=[],n=e<t,i=o?n?t+1:t-1:t;for(let s=e;n?s<i:s>i;n?s++:s--)r.push(s);return r}a(Q1,"__range__");var Z1=a(function(e){let t=[1,1];for(let o=1;o<e;o++){let r=[1];for(let n=1;n<=t.length;n++)r[n]=(t[n]||0)+t[n-1];t=r;}return t},"binom_row"),J1=a(function(e){let t,o,r,n;if(e=e.map(i=>new ye(i)),e.length===2)[o,r]=e.map(i=>i.lab()),t=a(function(i){let s=[0,1,2].map(l=>o[l]+i*(r[l]-o[l]));return new ye(s,"lab")},"I");else if(e.length===3)[o,r,n]=e.map(i=>i.lab()),t=a(function(i){let s=[0,1,2].map(l=>(1-i)*(1-i)*o[l]+2*(1-i)*i*r[l]+i*i*n[l]);return new ye(s,"lab")},"I");else if(e.length===4){let i;[o,r,n,i]=e.map(s=>s.lab()),t=a(function(s){let l=[0,1,2].map(d=>(1-s)*(1-s)*(1-s)*o[d]+3*(1-s)*(1-s)*s*r[d]+3*(1-s)*s*s*n[d]+s*s*s*i[d]);return new ye(l,"lab")},"I");}else if(e.length>=5){let i,s,l;i=e.map(d=>d.lab()),l=e.length-1,s=Z1(l),t=a(function(d){let c=1-d,p=[0,1,2].map(u=>i.reduce((g,f,b)=>g+s[b]*c**(l-b)*d**b*f[u],0));return new ye(p,"lab")},"I");}else throw new RangeError("No point in running bezier with only one color.");return t},"bezier"),Og=a(e=>{let t=J1(e);return t.scale=()=>Bn(t),t},"default");var hr=a((e,t,o)=>{if(!hr[o])throw new Error("unknown blend mode "+o);return hr[o](e,t)},"blend"),Ln=a(e=>(t,o)=>{let r=ot(o).rgb(),n=ot(t).rgb();return ot.rgb(e(r,n))},"blend_f"),Wn=a(e=>(t,o)=>{let r=[];return r[0]=e(t[0],o[0]),r[1]=e(t[1],o[1]),r[2]=e(t[2],o[2]),r},"each"),eT=a(e=>e,"normal"),tT=a((e,t)=>e*t/255,"multiply"),oT=a((e,t)=>e>t?t:e,"darken"),rT=a((e,t)=>e>t?e:t,"lighten"),nT=a((e,t)=>255*(1-(1-e/255)*(1-t/255)),"screen"),aT=a((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),"overlay"),iT=a((e,t)=>255*(1-(1-t/255)/(e/255)),"burn"),sT=a((e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e),"dodge");hr.normal=Ln(Wn(eT));hr.multiply=Ln(Wn(tT));hr.screen=Ln(Wn(nT));hr.overlay=Ln(Wn(aT));hr.darken=Ln(Wn(oT));hr.lighten=Ln(Wn(rT));hr.dodge=Ln(Wn(sT));hr.burn=Ln(Wn(iT));var Fg=hr;var{pow:lT,sin:dT,cos:cT}=Math;function Up(e=300,t=-1.5,o=1,r=1,n=[0,1]){let i=0,s;Qe(n)==="array"?s=n[1]-n[0]:(s=0,n=[n,n]);let l=a(function(d){let c=er*((e+120)/360+t*d),p=lT(n[0]+s*d,r),g=(i!==0?o[0]+d*i:o)*p*(1-p)/2,f=cT(c),b=dT(c),x=p+g*(-0.14861*f+1.78277*b),y=p+g*(-0.29227*f-.90649*b),k=p+g*(1.97294*f);return ot(Sa([x*255,y*255,k*255,1]))},"f");return l.start=function(d){return d==null?e:(e=d,l)},l.rotations=function(d){return d==null?t:(t=d,l)},l.gamma=function(d){return d==null?r:(r=d,l)},l.hue=function(d){return d==null?o:(o=d,Qe(o)==="array"?(i=o[1]-o[0],i===0&&(o=o[1])):i=0,l)},l.lightness=function(d){return d==null?n:(Qe(d)==="array"?(n=d,s=d[1]-d[0]):(n=[d,d],s=0),l)},l.scale=()=>ot.scale(l),l.hue(o),l}a(Up,"default");var uT="0123456789abcdef",{floor:pT,random:mT}=Math,Hg=a(()=>{let e="#";for(let t=0;t<6;t++)e+=uT.charAt(pT(mT()*16));return new ye(e,"hex")},"default");var{log:Vg,pow:fT,floor:bT,abs:gT}=Math;function Kp(e,t=null){let o={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Qe(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&Qe(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(o.values.push(r),o.sum+=r,r<o.min&&(o.min=r),r>o.max&&(o.max=r),o.count+=1);}),o.domain=[o.min,o.max],o.limits=(r,n)=>qp(o,r,n),o}a(Kp,"analyze");function qp(e,t="equal",o=7){Qe(e)=="array"&&(e=Kp(e));let{min:r,max:n}=e,i=e.values.sort((l,d)=>l-d);if(o===1)return [r,n];let s=[];if(t.substr(0,1)==="c"&&(s.push(r),s.push(n)),t.substr(0,1)==="e"){s.push(r);for(let l=1;l<o;l++)s.push(r+l/o*(n-r));s.push(n);}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");let l=Math.LOG10E*Vg(r),d=Math.LOG10E*Vg(n);s.push(r);for(let c=1;c<o;c++)s.push(fT(10,l+c/o*(d-l)));s.push(n);}else if(t.substr(0,1)==="q"){s.push(r);for(let l=1;l<o;l++){let d=(i.length-1)*l/o,c=bT(d);if(c===d)s.push(i[c]);else {let p=d-c;s.push(i[c]*(1-p)+i[c+1]*p);}}s.push(n);}else if(t.substr(0,1)==="k"){let l,d=i.length,c=new Array(d),p=new Array(o),u=true,g=0,f=null;f=[],f.push(r);for(let y=1;y<o;y++)f.push(r+y/o*(n-r));for(f.push(n);u;){for(let k=0;k<o;k++)p[k]=0;for(let k=0;k<d;k++){let w=i[k],v=Number.MAX_VALUE,h;for(let S=0;S<o;S++){let T=gT(f[S]-w);T<v&&(v=T,h=S),p[h]++,c[k]=h;}}let y=new Array(o);for(let k=0;k<o;k++)y[k]=null;for(let k=0;k<d;k++)l=c[k],y[l]===null?y[l]=i[k]:y[l]+=i[k];for(let k=0;k<o;k++)y[k]*=1/p[k];u=false;for(let k=0;k<o;k++)if(y[k]!==f[k]){u=true;break}f=y,g++,g>200&&(u=false);}let b={};for(let y=0;y<o;y++)b[y]=[];for(let y=0;y<d;y++)l=c[y],b[l].push(i[y]);let x=[];for(let y=0;y<o;y++)x.push(b[y][0]),x.push(b[y][b[y].length-1]);x=x.sort((y,k)=>y-k),s.push(x[0]);for(let y=1;y<x.length;y+=2){let k=x[y];!isNaN(k)&&s.indexOf(k)===-1&&s.push(k);}}return s}a(qp,"limits");var _g=a((e,t)=>{e=new ye(e),t=new ye(t);let o=e.luminance(),r=t.luminance();return o>r?(o+.05)/(r+.05):(r+.05)/(o+.05)},"default");var{sqrt:on,pow:eo,min:hT,max:yT,atan2:Gg,abs:$g,cos:cd,sin:jg,exp:xT,PI:Ug}=Math;function Yp(e,t,o=1,r=1,n=1){var i=a(function(_){return 360*_/(2*Ug)},"rad2deg"),s=a(function(_){return 2*Ug*_/360},"deg2rad");e=new ye(e),t=new ye(t);let[l,d,c]=Array.from(e.lab()),[p,u,g]=Array.from(t.lab()),f=(l+p)/2,b=on(eo(d,2)+eo(c,2)),x=on(eo(u,2)+eo(g,2)),y=(b+x)/2,k=.5*(1-on(eo(y,7)/(eo(y,7)+eo(25,7)))),w=d*(1+k),v=u*(1+k),h=on(eo(w,2)+eo(c,2)),S=on(eo(v,2)+eo(g,2)),T=(h+S)/2,C=i(Gg(c,w)),R=i(Gg(g,v)),M=C>=0?C:C+360,I=R>=0?R:R+360,B=$g(M-I)>180?(M+I+360)/2:(M+I)/2,N=1-.17*cd(s(B-30))+.24*cd(s(2*B))+.32*cd(s(3*B+6))-.2*cd(s(4*B-63)),D=I-M;D=$g(D)<=180?D:I<=M?D+360:D-360,D=2*on(h*S)*jg(s(D)/2);let E=p-l,P=S-h,W=1+.015*eo(f-50,2)/on(20+eo(f-50,2)),H=1+.045*T,A=1+.015*T*N,L=30*xT(-eo((B-275)/25,2)),G=-(2*on(eo(T,7)/(eo(T,7)+eo(25,7))))*jg(2*s(L)),$=on(eo(E/(o*W),2)+eo(P/(r*H),2)+eo(D/(n*A),2)+G*(P/(r*H))*(D/(n*A)));return yT(0,hT(100,$))}a(Yp,"default");function Xp(e,t,o="lab"){e=new ye(e),t=new ye(t);let r=e.get(o),n=t.get(o),i=0;for(let s in r){let l=(r[s]||0)-(n[s]||0);i+=l*l;}return Math.sqrt(i)}a(Xp,"default");var Kg=a((...e)=>{try{return new ye(...e),!0}catch{return false}},"default");var qg={cool(){return Bn([ot.hsl(180,1,.9),ot.hsl(250,.7,.4)])},hot(){return Bn(["#000","#f00","#ff0","#fff"]).mode("rgb")}};var ud={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(let e of Object.keys(ud))ud[e.toLowerCase()]=ud[e];var Yg=ud;Object.assign(ot,{average:zg,bezier:Og,blend:Fg,cubehelix:Up,mix:An,interpolate:An,random:Hg,scale:Bn,analyze:Kp,contrast:_g,deltaE:Yp,distance:Xp,limits:qp,valid:Kg,scales:qg,input:Ze,colors:En,brewer:Yg});var rn=ot;var Qp=500,Lr={xs:.01,sm:.02,md:.03,lg:.08,xl:.14},vT=a((e,t)=>(e%t+t)%t,"normalizeHue"),pd=a(e=>{let t=rn(e).hsv();return rn(t[0],t[1]*.92,Math.min(t[2]+.01,1),"hsv").hex()},"markDarkColor"),md=a((e,t,o)=>{o===void 0&&(o=Qp);let r=t-o,n;return t<=o?e[0]>80&&e[0]<260?n=r*Lr.xs:n=-r*Lr.sm:e[0]>20&&e[0]<48?n=-r*Lr.md:e[0]>=48&&e[0]<260?n=r*Lr.xs:n=-r*Lr.sm,vT(e[0]+n,360)},"calculateHue"),fd=a((e,t,o)=>{o===void 0&&(o=Qp);let r=(t-o)/100,n=0;t<o?(n=r*e[1]/5,t<100&&(n-=Lr.sm)):t>o&&(e[0]<30||e[0]>200?n=r*Lr.md:n=r*Lr.xs,e[1]===0&&(n=0));let i=e[1]+n;return i>1?1:i<0?0:i},"calculateSaturation"),bd=a((e,t,o)=>{o===void 0&&(o=Qp);let r=(t-o)/100,n=0;t<o?e[1]<.1?n=r*(1-e[2])/5*1.06:n=r*(1-e[2])/5:t>o&&((e[0]<30||e[0]>200)&&e[0]>0?(n=r*Lr.lg,e[2]>.8&&(n=r*Lr.xl)):n=r*e[2]/6);let i=e[2]-n;return i>1?1:i<0?0:i},"calculateLightness");var Zp=[50,100,200,300,400,500,600,700,800,900],gd=a((e,t="light")=>{let o=t==="dark",r=o?pd(e):e,n=rn(r).luminance();n<.1?r=rn(r).set("hsl.l",.4).hex():n>.9&&(r=rn(r).set("hsl.l",.6).hex());let i=rn(r).hsv(),s=Zp.map(l=>{let d=md(i,l,500),c=fd(i,l,500),p=bd(i,l,500);return rn(d,c,p,"hsv")});return o?s.reverse():s},"createSolidColorScale"),Jp=a(e=>{let t=gd(e,"light"),o=gd(e,"dark"),r={};return ["monkeys","monkeys-dark"].forEach((n,i)=>{let s={};i?o.map((l,d)=>Object.assign(s,{[Zp[d]]:l.rgb().join(" ")})):t.map((l,d)=>Object.assign(s,{[Zp[d]]:l.rgb().join(" ")})),Object.assign(r,{[n]:s});}),r},"genTailwindTheme"),Xg=wT__default.default(e=>{let t=Jp(e),o="";Object.entries(t).forEach(([n,i])=>{o+=(n==="monkeys-dark"?".dark":":root,::selection")+"{",Object.entries(i).forEach(([s,l])=>{o+=`--monkeys-${s}:${l};`;}),o+="}";});let r=document.getElementById("monkeys-theme");if(r)r.innerHTML=o;else {let n=document.createElement("style");n.id="monkeys-theme",document.head.appendChild(n),n.innerHTML=o;}},64);var CT="com.infmonkeys.css",hd=new WeakMap;function tm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}a(tm,"isRecord");function ST(e){let t=e?.[CT];return tm(t)?t:void 0}a(ST,"readCssExtension");function fo(e){return Number.isInteger(e)?String(e):String(Number(e.toFixed(6)))}a(fo,"formatNumber");function zn(e){return `${fo(e.value)}${e.unit}`}a(zn,"formatDimension");function em(e){return `${fo(e.value)}${e.unit}`}a(em,"formatDuration");function Ta(e){return e==="none"?e:fo(e)}a(Ta,"formatColorComponent");function TT(e){return [Number.parseInt(e.slice(1,3),16)/255,Number.parseInt(e.slice(3,5),16)/255,Number.parseInt(e.slice(5,7),16)/255]}a(TT,"hexToSrgb");function NT(e){if(e.colorSpace==="srgb"&&e.components.every(t=>typeof t=="number"))return e.components;if(e.hex)return TT(e.hex);throw new TypeError(`Web semantic colors in ${e.colorSpace} require a six-digit hex fallback for hsl(var(--token)) consumers.`)}a(NT,"colorSrgbComponents");function RT([e,t,o]){let r=Math.max(e,t,o),n=Math.min(e,t,o),i=(r+n)/2;if(r===n)return [0,0,i*100];let s=r-n,l=i>.5?s/(2-r-n):s/(r+n),d;return r===e?d=(t-o)/s+(t<o?6:0):r===t?d=(o-e)/s+2:d=(e-t)/s+4,[d/6*360,l*100,i*100]}a(RT,"srgbToHsl");function MT(e){if(e.colorSpace==="hsl"&&e.components.every(n=>typeof n=="number")){let[n,i,s]=e.components;return `${fo(n)} ${fo(i)}% ${fo(s)}%`}let[t,o,r]=RT(NT(e));return `${fo(t)} ${fo(o)}% ${fo(r)}%`}a(MT,"formatHslTriplet");function yd(e){let t=e.alpha??1;if(e.hex&&t===1)return e.hex;let o=e.components.map(Ta).join(" "),r=t===1?"":` / ${fo(t)}`;switch(e.colorSpace){case "srgb":return `rgb(${e.components.map(i=>i==="none"?"none":fo(i*255)).join(" ")}${r})`;case "hsl":return `hsl(${Ta(e.components[0])} ${Ta(e.components[1])}% ${Ta(e.components[2])}%${r})`;case "hwb":return `hwb(${Ta(e.components[0])} ${Ta(e.components[1])}% ${Ta(e.components[2])}%${r})`;case "lab":case "lch":case "oklab":case "oklch":return `${e.colorSpace}(${o}${r})`;default:return `color(${e.colorSpace} ${o}${r})`}}a(yd,"formatColor");function Qg(e){let t=Array.isArray(e)?e:[e],o=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);return t.map(r=>o.has(r)||/^[a-zA-Z][\w-]*$/.test(r)?r:`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`).join(", ")}a(Qg,"formatFontFamily");function IT(e){return (Array.isArray(e)?e:[e]).map(o=>{if(!tm(o))throw new TypeError("DTCG shadow values must be objects.");return [zn(o.offsetX),zn(o.offsetY),zn(o.blur),zn(o.spread),yd(o.color),o.inset===true?"inset":""].filter(Boolean).join(" ")}).join(", ")}a(IT,"formatShadow");function DT(e,t){if(!Array.isArray(e))throw new TypeError("DTCG gradient values must be arrays.");let o=e.map(n=>{if(!tm(n))throw new TypeError("DTCG gradient stops must be objects.");return `${yd(n.color)} ${fo(Number(n.position)*100)}%`}).join(", "),r=ST(t)?.gradient;return r?.kind==="radial"?`radial-gradient(${o})`:`linear-gradient(${fo(r?.angle??90)}deg, ${o})`}a(DT,"formatGradient");function Zg(e){switch(e.type){case "color":return yd(e.value);case "dimension":return zn(e.value);case "fontFamily":return Qg(e.value);case "fontWeight":case "number":return String(e.value);case "duration":return em(e.value);case "cubicBezier":return `cubic-bezier(${e.value.map(fo).join(", ")})`;case "strokeStyle":return typeof e.value=="string"?e.value:e.value.dashArray.map(zn).join(" ");case "border":{let t=e.value,o={...e,type:"strokeStyle",value:t.style};return `${zn(t.width)} ${Zg(o)} ${yd(t.color)}`}case "transition":{let t=e.value;return `${em(t.duration)} cubic-bezier(${t.timingFunction.map(fo).join(", ")}) ${em(t.delay)}`}case "shadow":return IT(e.value);case "gradient":return DT(e.value,e.extensions);case "typography":{let t=e.value;return `${t.fontWeight} ${zn(t.fontSize)}/${fo(t.lineHeight)} ${Qg(t.fontFamily)}`}}}a(Zg,"formatTokenValue");function Jg(e,t){let o=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase();return `--${t}-${o}`}a(Jg,"toCssVariableName");function PT(e){if(!/^[a-zA-Z][a-zA-Z0-9-]*$/.test(e))throw new TypeError("Theme token variablePrefix must start with a letter and contain only letters, numbers, or hyphens.")}a(PT,"assertCssVariablePrefix");function eh(e,t,o){let r=`${t}.${o}`;return e.has(r)?r:e.has(t)?t:void 0}a(eh,"selectModePath");var ET={"semantic.color.background":"--background","semantic.color.foreground":"--foreground","semantic.color.card":"--card","semantic.color.card-foreground":"--card-foreground","semantic.color.popover":"--popover","semantic.color.popover-foreground":"--popover-foreground","semantic.color.primary":"--primary","semantic.color.primary-foreground":"--primary-foreground","semantic.color.secondary":"--secondary","semantic.color.secondary-foreground":"--secondary-foreground","semantic.color.muted":"--muted","semantic.color.muted-foreground":"--muted-foreground","semantic.color.accent":"--accent","semantic.color.accent-foreground":"--accent-foreground","semantic.color.destructive":"--destructive","semantic.color.destructive-foreground":"--destructive-foreground","semantic.color.success":"--success","semantic.color.success-foreground":"--success-foreground","semantic.color.warning":"--warning","semantic.color.warning-foreground":"--warning-foreground","semantic.color.border":"--border","semantic.color.input":"--input","semantic.color.ring":"--ring","semantic.color.media-surface":"--media-surface","semantic.color.media-foreground":"--media-foreground","semantic.color.media-overlay":"--media-overlay","semantic.color.radar-canvas":"--radar-canvas","semantic.color.radar-panel":"--radar-panel","semantic.color.radar-border":"--radar-border","semantic.color.radar-shell-border":"--radar-shell-border","semantic.color.radar-grid":"--radar-grid","semantic.color.radar-axis":"--radar-axis","semantic.color.radar-series-one":"--radar-series-one","semantic.color.radar-series-two":"--radar-series-two","semantic.color.radar-series-three":"--radar-series-three","semantic.color.radar-series-four":"--radar-series-four"},th=Object.freeze({...Object.fromEntries(Object.entries(ET).map(([e,t])=>[e,{variableName:t,axis:"colorMode",expectedType:"color",format:"hsl"}])),"semantic.color.neocard":{variableName:"--neocard",axis:"colorMode",expectedType:"color",format:"css"},"semantic.radius.base":{variableName:"--radius",axis:"colorMode",expectedType:"dimension",format:"css"},"semantic.spacing.global":{variableName:"--global-spacing",axis:"density",expectedType:"dimension",format:"css"},"semantic.gradient.brand":{variableName:"--monkeys-gradient",axis:"colorMode",expectedType:"gradient",format:"css"},"semantic.font.body":{variableName:"--font-sans",axis:"colorMode",expectedType:"fontFamily",format:"css"}});function om(e){let t=e.startsWith("$")?e.slice(1).trim():e.trim();if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/i.test(t))throw new TypeError(`Invalid Design Token path ${e}.`);let o=th[t];return o?o.format==="hsl"?`hsl(var(${o.variableName}))`:`var(${o.variableName})`:`var(${Jg(t,"monkeys")})`}a(om,"resolveThemeTokenCssVariable");function oh(e,t){let o=eh(new Set(Object.keys(e.cssValues)),t,e.colorMode);return o?e.cssValues[o]:void 0}a(oh,"getThemeTokenCssValue");function ys(e,t={}){let o=runtime.resolveThemeTokens(e),r=o.document,n=t.colorMode??"light",i=t.density??"default",s=t.variablePrefix??"monkeys";PT(s);let l={},d={},c={},p=new Map;for(let[f,b]of o.tokens){l[f]=b.value;let x=Zg(b);d[f]=x;let y=Jg(f,s),k=p.get(y);if(k)throw new TypeError(`Theme token paths ${k} and ${f} both compile to ${y}. Rename one token.`);p.set(y,f),c[y]=x;}let u=new Set(o.tokens.keys());for(let[f,b]of Object.entries(th)){let x=b.axis==="density"?i:n,y=eh(u,f,x);if(!y)continue;let k=o.tokens.get(y);if(!k||k.type!==b.expectedType)throw new TypeError(`${y} must be a ${b.expectedType} token to drive ${b.variableName}.`);c[b.variableName]=b.format==="hsl"?MT(k.value):d[y];}let g=Object.entries(c).sort(([f],[b])=>f.localeCompare(b)).map(([f,b])=>`${f}:${b};`).join("");return {contract:r,colorMode:n,density:i,values:Object.freeze(l),cssValues:Object.freeze(d),cssVariables:Object.freeze(c),cssText:g}}a(ys,"compileThemeTokens");function rh(e,t={}){let o=ys(e,t),r=t.target??(typeof document>"u"?null:document.documentElement);if(!r)return o;let n=hd.get(r)??new Set,i=new Set(Object.keys(o.cssVariables));for(let s of n)i.has(s)||r.style.removeProperty(s);for(let[s,l]of Object.entries(o.cssVariables))r.style.setProperty(s,l);return hd.set(r,i),t.themeId?r.dataset.monkeysTheme=t.themeId:delete r.dataset.monkeysTheme,r.dataset.monkeysColorMode=o.colorMode,r.dataset.monkeysDensity=o.density,o}a(rh,"applyThemeTokens");function nh(e={}){let t=e.target??(typeof document>"u"?null:document.documentElement);if(!t)return;let o=hd.get(t)??new Set;for(let r of o)t.style.removeProperty(r);hd.delete(t),delete t.dataset.monkeysTheme,delete t.dataset.monkeysColorMode,delete t.dataset.monkeysDensity;}a(nh,"clearThemeTokens");var xd=["background","glowColor","borderColor","borderWidth","borderStyle","radius","shadow","padding","gap"],AT={background:"hsl(var(--card, 0 0% 100%))",glowColor:"var(--monkeys-bento-glow-default)",borderColor:"hsl(var(--border, 214.3 31.8% 91.4%))",borderWidth:"1px",borderStyle:"solid",radius:"var(--radius, 0.75rem)",shadow:"none",padding:"var(--global-spacing, 0.75rem)",gap:"var(--global-spacing, 0.75rem)"},rm=new WeakMap;function ah(e,t){if(!Number.isSafeInteger(t)||t<1)throw new RangeError("Bento level must be a positive safe integer.");let o=e&&rm.get(e)?.get(t);if(o)return o;let r={...AT},n=Object.fromEntries(xd.map(s=>[s,"builtin"]));for(let s of xd){let l=s==="padding"||s==="gap"?e?.density:e?.colorMode,d=s==="glowColor"?"component.bento":"semantic.bento",c=[`${d}.levels.level${t}.${s}`,`${d}.default.${s}`];for(let p of c){let u=l&&e?.cssValues[`${p}.${l}`]!==void 0?`${p}.${l}`:p,g=e?.cssValues[u];if(g!==void 0){r[s]=g,n[s]=u;break}}}let i=Object.freeze({values:Object.freeze(r),sources:Object.freeze(n)});if(e){let s=rm.get(e)??new Map;s.set(t,i),rm.set(e,s);}return i}a(ah,"resolveBentoTokens");var nn={locale:"en-US",messages:{pagination:{navigation:"Pagination",first:"First",previous:"Previous",next:"Next",last:"Last",page:a(({page:e,pageCount:t})=>`Page ${e} of ${t}`,"page"),currentPage:a(({page:e,pageCount:t})=>`Page ${e} of ${t}, current page`,"currentPage"),emptyResults:"0 results",range:a(({start:e,end:t,total:o})=>`${e}-${t} of ${o}`,"range"),selected:a(({count:e})=>`${e} selected`,"selected"),pageSize:"Items per page",loadBatchSize:"Items per load",perLoad:"Items per load",jumpToPage:"Jump to page",pages:"pages",clickToJump:"Click to jump to a page"},dialog:{close:"Close dialog"},dropdownMenu:{actions:"Actions"},loading:{spinner:"Loading"},layout:{resizePanels:"Resize panels",expandPanel:"Expand",collapsePanel:"Collapse",movePanel:"Move",moveBefore:"Move earlier",moveAfter:"Move later"},steps:{label:"Progress",current:"Current",completed:"Completed",error:"Error",disabled:"Disabled"},numberInput:{increment:"Increase value",decrement:"Decrease value"},passwordInput:{showPassword:"Show password",hidePassword:"Hide password"},multiSelect:{placeholder:"Select options",empty:"No options",removeOption:a(({value:e})=>`Remove ${e}`,"removeOption")},table:{dragColumn:a(({columnId:e})=>`Drag column ${e}`,"dragColumn"),resizeColumn:a(({columnId:e})=>`Resize column ${e}`,"resizeColumn"),sortColumn:a(({columnId:e})=>e?`Sort column ${e}`:"Sort column","sortColumn"),loadingRow:"Loading table row"},toolbar:{theme:{label:"Appearance",toggle:"Toggle theme",auto:"Auto",light:"Light",dark:"Dark"},language:{label:"Language",switch:"Switch language"}},toast:{errorTitle:"Error",warningTitle:"Warning",defaultErrorDescription:"Something went wrong.",defaultWarningDescription:"Please check and try again."},dataExplorer:{viewTree:{actions:"More actions",expand:"Expand",collapse:"Collapse",loading:"Loading...",empty:"No views",error:"Unable to load views"}},workbench:{relationshipGraph:{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview"},collection:{label:"Collection",loading:"Loading items",empty:"No items",loadError:"Unable to load items",refreshError:"Unable to refresh items",retry:"Retry",loadingMore:"Loading more items",permission:"You do not have permission to view this content",offline:"You appear to be offline",requestAccess:"Request access"},interactiveTable:{columnActions:"Column actions",freezeColumn:"Freeze to left",freezeEndColumn:"Freeze to right",unfreezeColumn:"Unfreeze from left",unfreezeEndColumn:"Unfreeze from right",unfreezeAllColumns:"Unfreeze all columns",resetColumnWidth:"Reset column width",frozenColumnTitle:"Frozen column"}},agentWorkbench:{label:"Session activity",reasoning:"Reasoning",plan:"Plan",taskNoDetail:"No additional details",modes:{chat:"Chat",work:"Work"},composer:{send:"Send message",stop:"Stop generating",queue:"Queue message",attach:"Add photos or files",voice:"Start voice input",webSearch:"Web search",chatMode:"Chat mode",model:"Model",reasoning:"Reasoning effort",permissions:"Permissions",removeAttachment:"Remove attachment",editQueued:"Edit queued message",deleteQueued:"Delete queued message",moveUp:"Move message up",moveDown:"Move message down",queued:"Queued messages",uploading:"Uploading",uploadFailed:"Upload failed",retryAttachment:"Retry attachment upload",noModels:"No models available",message:"Message",attachmentOnly:"Attachment",reasoningOptions:{low:"Low",medium:"Medium",high:"High",xhigh:"Extra high"},permissionOptions:{"approval-required":"Approval required","auto-approve":"Auto approve","full-access":"Full access"}},quickStart:{label:"Quick start",back:"Back",addFile:"Add file"},tool:{input:"Input",output:"Output",status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Error",denied:"Denied"}},approval:{approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected"},artifact:{pending:"Preparing",ready:"Ready",failed:"Failed",open:a(({name:e})=>`Open ${e}`,"open")},run:{stopping:"Stopping...",stoppedAfter:a(({duration:e})=>`You stopped after ${e}`,"stoppedAfter")},process:{running:"Working",queued:"Queued",waitingApproval:"Waiting for approval",failed:"Failed",stopped:"Stopped",processed:"Processed",processedFor:a(({duration:e})=>`Worked for ${e}`,"processedFor"),completedCount:a(({completed:e,total:t})=>`${e}/${t} completed`,"completedCount")},artifactWorkspace:{outputs:"Outputs",sources:"Sources",viewAll:"View all",toggleSummary:"Toggle files",tabs:"Open files",closeTab:a(({name:e})=>`Close ${e}`,"closeTab"),closeWorkspace:"Close workspace",download:a(({name:e})=>`Download ${e}`,"download"),openExternal:a(({name:e})=>`Open ${e} in a new window`,"openExternal"),loading:"Loading preview...",failed:"Preview unavailable",retry:"Try again"},usage:{label:"Context usage",context:a(({used:e,total:t})=>`${e} / ${t} tokens`,"context")},navigation:{search:"Search agents and sessions",searchSessions:"Search sessions",searchShortcut:"Focus search",clearSearch:"Clear search",tabsLabel:"Agent workbench navigation",agents:"Agents",sessions:"Sessions",newAgent:"New Agent",newSession:"New Session",capabilities:"Capabilities & Extensions",settings:"Agent Settings",allAgents:"All Agents",recentSessions:"Recent Sessions",chat:"Chat",work:"Work",chats:"Chats",builtIn:"Built-in",noDescription:"No description",loading:"Loading...",emptyAgents:"No agents yet",emptySessions:"No sessions yet",noResults:"No matching results",retry:"Retry",pin:"Pin",unpin:"Unpin",rename:"Rename",delete:"Delete",actions:"Actions",save:"Save",cancel:"Cancel",running:"Running",completed:"Completed",failed:"Failed",contextUsage:a(({percent:e})=>`${e}% context used`,"contextUsage")},details:{title:"Task details",description:"Summary and workspace activity",duration:"Duration",updated:"Updated",model:"Model",mode:"Mode",permissions:"Permissions",tokenUsage:"Token usage",summary:"Summary",summaryEmpty:"No summary is available yet.",summaryFailed:"The summary could not be generated.",highlights:"Highlights",pendingItems:"Pending items",tabs:{label:"Task detail views",summary:"Summary",workspace:"Workspace"},status:{queued:"Queued",running:"Running",waiting_approval:"Waiting for approval",stopping:"Stopping",stopped:"Stopped",completed:"Completed",failed:"Failed"},state:{loading:{title:"Loading task details",description:"Restoring the latest session activity."},empty:{title:"No task selected",description:"Select a task to inspect its details."},error:{title:"Unable to load task details",description:"Try again after the session is available."}},actions:{close:"Close task details",copySummary:"Copy summary",retry:"Retry",retrySummary:"Retry summary",resume:"Resume",continueInNewTask:"Continue in new task",editAndRerun:"Edit and rerun",export:"Export"},workspace:{diffs:"Code changes",files:"Files",terminals:"Terminals",tests:"Tests",artifacts:"Artifacts",exitCode:a(({code:e})=>`Exit code ${e}`,"exitCode"),diffStatus:{added:"Added",modified:"Modified",deleted:"Deleted",renamed:"Renamed"},fileOperation:{upsert:"Updated",delete:"Deleted"}}}}}};var vd={locale:"zh-CN",messages:{pagination:{navigation:"\u5206\u9875\u5BFC\u822A",first:"\u9996\u9875",previous:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",last:"\u672B\u9875",page:a(({page:e,pageCount:t})=>`\u7B2C ${e} \u9875\uFF0C\u5171 ${t} \u9875`,"page"),currentPage:a(({page:e,pageCount:t})=>`\u7B2C ${e} \u9875\uFF0C\u5171 ${t} \u9875\uFF0C\u5F53\u524D\u9875`,"currentPage"),emptyResults:"\u5171 0 \u6761",range:a(({start:e,end:t,total:o})=>`\u7B2C ${e}-${t} \u6761\uFF0C\u5171 ${o} \u6761`,"range"),selected:a(({count:e})=>`\u5DF2\u9009\u62E9 ${e} \u9879`,"selected"),pageSize:"\u6BCF\u9875\u663E\u793A\u6570\u91CF",loadBatchSize:"\u6BCF\u6B21\u52A0\u8F7D\u6570\u91CF",perLoad:"\u6BCF\u6B21\u52A0\u8F7D",jumpToPage:"\u8DF3\u8F6C\u5230\u9875\u7801",pages:"\u9875",clickToJump:"\u70B9\u51FB\u8DF3\u8F6C\u9875\u7801"},dialog:{close:"\u5173\u95ED\u5BF9\u8BDD\u6846"},dropdownMenu:{actions:"\u64CD\u4F5C"},loading:{spinner:"\u6B63\u5728\u52A0\u8F7D"},layout:{resizePanels:"\u8C03\u6574\u9762\u677F\u5927\u5C0F",expandPanel:"\u5C55\u5F00",collapsePanel:"\u6536\u8D77",movePanel:"\u79FB\u52A8",moveBefore:"\u5411\u524D\u79FB\u52A8",moveAfter:"\u5411\u540E\u79FB\u52A8"},steps:{label:"\u8FDB\u5EA6",current:"\u5F53\u524D\u6B65\u9AA4",completed:"\u5DF2\u5B8C\u6210",error:"\u9519\u8BEF",disabled:"\u5DF2\u7981\u7528"},numberInput:{increment:"\u589E\u52A0\u6570\u503C",decrement:"\u51CF\u5C11\u6570\u503C"},passwordInput:{showPassword:"\u663E\u793A\u5BC6\u7801",hidePassword:"\u9690\u85CF\u5BC6\u7801"},multiSelect:{placeholder:"\u8BF7\u9009\u62E9",empty:"\u6682\u65E0\u9009\u9879",removeOption:a(({value:e})=>`\u79FB\u9664 ${e}`,"removeOption")},table:{dragColumn:a(({columnId:e})=>`\u62D6\u52A8\u5217 ${e}`,"dragColumn"),resizeColumn:a(({columnId:e})=>`\u8C03\u6574\u5217\u5BBD ${e}`,"resizeColumn"),sortColumn:a(({columnId:e})=>e?`\u6392\u5E8F\u5217 ${e}`:"\u6392\u5E8F\u5217","sortColumn"),loadingRow:"\u6B63\u5728\u52A0\u8F7D\u8868\u683C\u884C"},toolbar:{theme:{label:"\u5916\u89C2",toggle:"\u5207\u6362\u4E3B\u9898",auto:"\u8DDF\u968F\u7CFB\u7EDF",light:"\u6D45\u8272\u6A21\u5F0F",dark:"\u6DF1\u8272\u6A21\u5F0F"},language:{label:"\u8BED\u8A00",switch:"\u5207\u6362\u8BED\u8A00"}},toast:{errorTitle:"\u9519\u8BEF",warningTitle:"\u63D0\u793A",defaultErrorDescription:"\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",defaultWarningDescription:"\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002"},dataExplorer:{viewTree:{actions:"\u66F4\u591A\u64CD\u4F5C",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77",loading:"\u6B63\u5728\u52A0\u8F7D...",empty:"\u6682\u65E0\u89C6\u56FE",error:"\u65E0\u6CD5\u52A0\u8F7D\u89C6\u56FE"}},workbench:{relationshipGraph:{zoomOut:"\u7F29\u5C0F",zoomIn:"\u653E\u5927",zoomToFit:"\u9002\u5E94\u753B\u5E03",minimap:"\u56FE\u8C31\u6982\u89C8"},collection:{label:"\u5185\u5BB9\u96C6\u5408",loading:"\u6B63\u5728\u52A0\u8F7D\u5185\u5BB9",empty:"\u6682\u65E0\u5185\u5BB9",loadError:"\u65E0\u6CD5\u52A0\u8F7D\u5185\u5BB9",refreshError:"\u65E0\u6CD5\u5237\u65B0\u5185\u5BB9",retry:"\u91CD\u8BD5",loadingMore:"\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9",permission:"\u4F60\u6CA1\u6709\u6743\u9650\u67E5\u770B\u6B64\u5185\u5BB9",offline:"\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00",requestAccess:"\u7533\u8BF7\u6743\u9650"},interactiveTable:{columnActions:"\u5217\u64CD\u4F5C",freezeColumn:"\u56FA\u5B9A\u5230\u5DE6\u4FA7",freezeEndColumn:"\u56FA\u5B9A\u5230\u53F3\u4FA7",unfreezeColumn:"\u53D6\u6D88\u5DE6\u4FA7\u56FA\u5B9A",unfreezeEndColumn:"\u53D6\u6D88\u53F3\u4FA7\u56FA\u5B9A",unfreezeAllColumns:"\u53D6\u6D88\u5168\u90E8\u56FA\u5B9A",resetColumnWidth:"\u91CD\u7F6E\u5217\u5BBD",frozenColumnTitle:"\u5DF2\u56FA\u5B9A\u5217"}},agentWorkbench:{label:"\u4F1A\u8BDD\u6D3B\u52A8",reasoning:"\u601D\u8003\u8FC7\u7A0B",plan:"\u6267\u884C\u8BA1\u5212",taskNoDetail:"\u6682\u65E0\u66F4\u591A\u8BE6\u60C5",modes:{chat:"\u5BF9\u8BDD",work:"\u5DE5\u4F5C"},composer:{send:"\u53D1\u9001\u6D88\u606F",stop:"\u505C\u6B62\u751F\u6210",queue:"\u6392\u961F\u53D1\u9001",attach:"\u6DFB\u52A0\u7167\u7247\u6216\u6587\u4EF6",voice:"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",webSearch:"\u8054\u7F51\u641C\u7D22",chatMode:"\u5BF9\u8BDD\u6A21\u5F0F",model:"\u6A21\u578B",reasoning:"\u601D\u8003\u5F3A\u5EA6",permissions:"\u6743\u9650",removeAttachment:"\u79FB\u9664\u9644\u4EF6",editQueued:"\u7F16\u8F91\u6392\u961F\u6D88\u606F",deleteQueued:"\u5220\u9664\u6392\u961F\u6D88\u606F",moveUp:"\u4E0A\u79FB\u6D88\u606F",moveDown:"\u4E0B\u79FB\u6D88\u606F",queued:"\u6392\u961F\u6D88\u606F",uploading:"\u4E0A\u4F20\u4E2D",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",retryAttachment:"\u91CD\u8BD5\u9644\u4EF6\u4E0A\u4F20",noModels:"\u6682\u65E0\u53EF\u7528\u6A21\u578B",message:"\u6D88\u606F",attachmentOnly:"\u9644\u4EF6",reasoningOptions:{low:"\u4F4E",medium:"\u4E2D",high:"\u9AD8",xhigh:"\u6700\u9AD8"},permissionOptions:{"approval-required":"\u9700\u8981\u6279\u51C6","auto-approve":"\u81EA\u52A8\u6279\u51C6","full-access":"\u5B8C\u5168\u8BBF\u95EE"}},quickStart:{label:"\u5FEB\u901F\u5F00\u59CB",back:"\u8FD4\u56DE",addFile:"\u6DFB\u52A0\u6587\u4EF6"},tool:{input:"\u8F93\u5165",output:"\u8F93\u51FA",status:{pending:"\u7B49\u5F85\u4E2D",running:"\u8FD0\u884C\u4E2D",completed:"\u5DF2\u5B8C\u6210",failed:"\u9519\u8BEF",denied:"\u5DF2\u62D2\u7EDD"}},approval:{approve:"\u5141\u8BB8",reject:"\u62D2\u7EDD",approved:"\u5DF2\u5141\u8BB8",rejected:"\u5DF2\u62D2\u7EDD"},artifact:{pending:"\u51C6\u5907\u4E2D",ready:"\u5DF2\u5C31\u7EEA",failed:"\u5931\u8D25",open:a(({name:e})=>`\u6253\u5F00 ${e}`,"open")},run:{stopping:"\u6B63\u5728\u505C\u6B62...",stoppedAfter:a(({duration:e})=>`\u4F60\u5728 ${e} \u540E\u505C\u6B62\u4E86\u4EFB\u52A1`,"stoppedAfter")},process:{running:"\u6267\u884C\u8FC7\u7A0B",queued:"\u6392\u961F\u4E2D",waitingApproval:"\u7B49\u5F85\u5BA1\u6279",failed:"\u5931\u8D25",stopped:"\u5DF2\u505C\u6B62",processed:"\u5DF2\u5904\u7406",processedFor:a(({duration:e})=>`\u8017\u65F6 ${e.replace(/(\d+)h/g,"$1\u5C0F\u65F6").replace(/(\d+)m/g,"$1\u5206\u949F").replace(/(\d+)s/g,"$1\u79D2").replace(/\s+/g,"")}`,"processedFor"),completedCount:a(({completed:e,total:t})=>`${e}/${t} \u5DF2\u5B8C\u6210`,"completedCount")},artifactWorkspace:{outputs:"\u8F93\u51FA",sources:"\u6765\u6E90",viewAll:"\u67E5\u770B\u5168\u90E8",toggleSummary:"\u5207\u6362\u6587\u4EF6\u6458\u8981",tabs:"\u5DF2\u6253\u5F00\u6587\u4EF6",closeTab:a(({name:e})=>`\u5173\u95ED ${e}`,"closeTab"),closeWorkspace:"\u5173\u95ED\u5DE5\u4F5C\u533A",download:a(({name:e})=>`\u4E0B\u8F7D ${e}`,"download"),openExternal:a(({name:e})=>`\u5728\u65B0\u7A97\u53E3\u6253\u5F00 ${e}`,"openExternal"),loading:"\u6B63\u5728\u52A0\u8F7D\u9884\u89C8...",failed:"\u9884\u89C8\u4E0D\u53EF\u7528",retry:"\u91CD\u8BD5"},usage:{label:"\u4E0A\u4E0B\u6587\u7528\u91CF",context:a(({used:e,total:t})=>`${e} / ${t} tokens`,"context")},navigation:{search:"\u641C\u7D22\u667A\u80FD\u4F53\u548C\u4F1A\u8BDD",searchSessions:"\u641C\u7D22\u4F1A\u8BDD",searchShortcut:"\u805A\u7126\u641C\u7D22\u6846",clearSearch:"\u6E05\u9664\u641C\u7D22",tabsLabel:"\u667A\u80FD\u4F53\u5DE5\u4F5C\u53F0\u5BFC\u822A",agents:"\u667A\u80FD\u4F53",sessions:"\u4F1A\u8BDD",newAgent:"\u65B0\u5EFA\u667A\u80FD\u4F53",newSession:"\u65B0\u5EFA\u4F1A\u8BDD",capabilities:"\u80FD\u529B\u4E0E\u6269\u5C55",settings:"\u667A\u80FD\u4F53\u8BBE\u7F6E",allAgents:"\u5168\u90E8\u667A\u80FD\u4F53",recentSessions:"\u6700\u8FD1\u4F1A\u8BDD",chat:"\u5BF9\u8BDD",work:"\u5DE5\u4F5C",chats:"\u804A\u5929",builtIn:"\u5185\u7F6E",noDescription:"\u6682\u65E0\u63CF\u8FF0",loading:"\u52A0\u8F7D\u4E2D...",emptyAgents:"\u6682\u65E0\u667A\u80FD\u4F53",emptySessions:"\u6682\u65E0\u4F1A\u8BDD",noResults:"\u6CA1\u6709\u5339\u914D\u7ED3\u679C",retry:"\u91CD\u8BD5",pin:"\u7F6E\u9876",unpin:"\u53D6\u6D88\u7F6E\u9876",rename:"\u91CD\u547D\u540D",delete:"\u5220\u9664",actions:"\u64CD\u4F5C",save:"\u4FDD\u5B58",cancel:"\u53D6\u6D88",running:"\u8FD0\u884C\u4E2D",completed:"\u5DF2\u5B8C\u6210",failed:"\u5931\u8D25",contextUsage:a(({percent:e})=>`\u5DF2\u4F7F\u7528 ${e}% \u4E0A\u4E0B\u6587`,"contextUsage")},details:{title:"\u4EFB\u52A1\u8BE6\u60C5",description:"\u6458\u8981\u4E0E\u5DE5\u4F5C\u533A\u6D3B\u52A8",duration:"\u8017\u65F6",updated:"\u66F4\u65B0\u65F6\u95F4",model:"\u6A21\u578B",mode:"\u6A21\u5F0F",permissions:"\u6743\u9650",tokenUsage:"Token \u7528\u91CF",summary:"\u6458\u8981",summaryEmpty:"\u6682\u65F6\u6CA1\u6709\u53EF\u7528\u6458\u8981\u3002",summaryFailed:"\u6458\u8981\u751F\u6210\u5931\u8D25\u3002",highlights:"\u91CD\u70B9",pendingItems:"\u5F85\u5904\u7406\u4E8B\u9879",tabs:{label:"\u4EFB\u52A1\u8BE6\u60C5\u89C6\u56FE",summary:"\u6458\u8981",workspace:"\u5DE5\u4F5C\u533A"},status:{queued:"\u6392\u961F\u4E2D",running:"\u8FD0\u884C\u4E2D",waiting_approval:"\u7B49\u5F85\u5BA1\u6279",stopping:"\u6B63\u5728\u505C\u6B62",stopped:"\u5DF2\u505C\u6B62",completed:"\u5DF2\u5B8C\u6210",failed:"\u5931\u8D25"},state:{loading:{title:"\u6B63\u5728\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5",description:"\u6B63\u5728\u6062\u590D\u6700\u65B0\u7684\u4F1A\u8BDD\u6D3B\u52A8\u3002"},empty:{title:"\u672A\u9009\u62E9\u4EFB\u52A1",description:"\u9009\u62E9\u4EFB\u52A1\u540E\u67E5\u770B\u8BE6\u7EC6\u4FE1\u606F\u3002"},error:{title:"\u65E0\u6CD5\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5",description:"\u4F1A\u8BDD\u6062\u590D\u53EF\u7528\u540E\u8BF7\u91CD\u8BD5\u3002"}},actions:{close:"\u5173\u95ED\u4EFB\u52A1\u8BE6\u60C5",copySummary:"\u590D\u5236\u6458\u8981",retry:"\u91CD\u8BD5",retrySummary:"\u91CD\u65B0\u751F\u6210\u6458\u8981",resume:"\u7EE7\u7EED\u8FD0\u884C",continueInNewTask:"\u5728\u65B0\u4EFB\u52A1\u4E2D\u7EE7\u7EED",editAndRerun:"\u7F16\u8F91\u5E76\u91CD\u65B0\u8FD0\u884C",export:"\u5BFC\u51FA"},workspace:{diffs:"\u4EE3\u7801\u53D8\u66F4",files:"\u6587\u4EF6",terminals:"\u7EC8\u7AEF",tests:"\u6D4B\u8BD5",artifacts:"\u4EA7\u7269",exitCode:a(({code:e})=>`\u9000\u51FA\u7801 ${e}`,"exitCode"),diffStatus:{added:"\u65B0\u589E",modified:"\u4FEE\u6539",deleted:"\u5220\u9664",renamed:"\u91CD\u547D\u540D"},fileOperation:{upsert:"\u5DF2\u66F4\u65B0",delete:"\u5DF2\u5220\u9664"}}}}}};var BT={"en-US":nn,"zh-CN":vd};function ih(e){if(typeof e!="string"||!e.trim())throw new TypeError("Monkeys locale must be a non-empty BCP 47 string.");try{return Intl.getCanonicalLocales(e)[0]}catch{throw new RangeError(`Monkeys locale "${e}" is not a valid BCP 47 identifier.`)}}a(ih,"normalizeLocaleId");function sh(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}a(sh,"isRecord");function lh(e,t,o){if(!sh(e)||!sh(t))throw new TypeError(`${o} must be an object.`);for(let[r,n]of Object.entries(e)){if(n===void 0)continue;if(!(r in t))throw new TypeError(`${o}.${r} is not a supported Monkeys message.`);let i=t[r],s=`${o}.${r}`;if(typeof i=="function"){if(typeof n!="function")throw new TypeError(`${s} must be a function.`)}else if(typeof i=="string"){if(typeof n!="string")throw new TypeError(`${s} must be a string.`)}else lh(n,i,s);}}a(lh,"validateMessageOverride");function dh(e,t){lh(e,nn.messages,t);}a(dh,"assertMessagesOverride");function ch(e){return e==="en-US"||e==="zh-CN"}a(ch,"isBuiltInLocale");function LT(e){if(e===void 0)return {locale:void 0,messages:void 0,hasExplicitLocale:false};if(typeof e=="string"){let o=ih(e);if(!ch(o))throw new RangeError(`Unsupported built-in Monkeys locale "${o}". Provide a locale pack object for custom locales.`);return {locale:o,messages:void 0,hasExplicitLocale:true}}if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("Monkeys locale must be a locale id or locale pack object.");let t=ih(e.locale);return dh(e.messages,"Monkeys locale messages"),{locale:t,messages:e.messages,hasExplicitLocale:true}}a(LT,"normalizeLocaleInput");function Na(e,t){return t?{pagination:{...e.pagination,...t.pagination},dialog:{...e.dialog,...t.dialog},dropdownMenu:{...e.dropdownMenu,...t.dropdownMenu},loading:{...e.loading,...t.loading},layout:{...e.layout,...t.layout},steps:{...e.steps,...t.steps},numberInput:{...e.numberInput,...t.numberInput},passwordInput:{...e.passwordInput,...t.passwordInput},multiSelect:{...e.multiSelect,...t.multiSelect},table:{...e.table,...t.table},toolbar:{theme:{...e.toolbar.theme,...t.toolbar?.theme},language:{...e.toolbar.language,...t.toolbar?.language}},toast:{...e.toast,...t.toast},dataExplorer:{viewTree:{...e.dataExplorer.viewTree,...t.dataExplorer?.viewTree}},workbench:{relationshipGraph:{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview",...e.workbench.relationshipGraph,...t.workbench?.relationshipGraph},collection:{...e.workbench.collection,...t.workbench?.collection},interactiveTable:{...e.workbench.interactiveTable,...t.workbench?.interactiveTable}},agentWorkbench:{...e.agentWorkbench,...t.agentWorkbench,modes:{...e.agentWorkbench.modes,...t.agentWorkbench?.modes},composer:{...e.agentWorkbench.composer,...t.agentWorkbench?.composer},quickStart:{...e.agentWorkbench.quickStart,...t.agentWorkbench?.quickStart},tool:{...e.agentWorkbench.tool,...t.agentWorkbench?.tool,status:{...e.agentWorkbench.tool.status,...t.agentWorkbench?.tool?.status}},approval:{...e.agentWorkbench.approval,...t.agentWorkbench?.approval},artifact:{...e.agentWorkbench.artifact,...t.agentWorkbench?.artifact},run:{...e.agentWorkbench.run,...t.agentWorkbench?.run},process:{...e.agentWorkbench.process,...t.agentWorkbench?.process},artifactWorkspace:{...e.agentWorkbench.artifactWorkspace,...t.agentWorkbench?.artifactWorkspace},usage:{...e.agentWorkbench.usage,...t.agentWorkbench?.usage},navigation:{...e.agentWorkbench.navigation,...t.agentWorkbench?.navigation},details:{...e.agentWorkbench.details,...t.agentWorkbench?.details,tabs:{...e.agentWorkbench.details.tabs,...t.agentWorkbench?.details?.tabs},status:{...e.agentWorkbench.details.status,...t.agentWorkbench?.details?.status},state:{loading:{...e.agentWorkbench.details.state.loading,...t.agentWorkbench?.details?.state?.loading},empty:{...e.agentWorkbench.details.state.empty,...t.agentWorkbench?.details?.state?.empty},error:{...e.agentWorkbench.details.state.error,...t.agentWorkbench?.details?.state?.error}},actions:{...e.agentWorkbench.details.actions,...t.agentWorkbench?.details?.actions},workspace:{...e.agentWorkbench.details.workspace,...t.agentWorkbench?.details?.workspace,diffStatus:{...e.agentWorkbench.details.workspace.diffStatus,...t.agentWorkbench?.details?.workspace?.diffStatus},fileOperation:{...e.agentWorkbench.details.workspace.fileOperation,...t.agentWorkbench?.details?.workspace?.fileOperation}}}}}:e}a(Na,"mergeMonkeysLocaleMessages");var ii={locale:nn.locale,messages:Na(nn.messages)};function wd(e,t,o){t!==void 0&&dh(t,"MonkeysProvider messages");let r=LT(e),n=r.locale??o?.locale??nn.locale,i=ch(n)?BT[n].messages:void 0,s=Na(nn.messages,i);return o&&(!r.hasExplicitLocale||o.locale===n)&&(s=Na(s,o.messages)),s=Na(s,r.messages),s=Na(s,t),{locale:n,messages:s}}a(wd,"resolveMonkeysLocale");var WT=Object.freeze({}),zT=Object.freeze({}),uh=Symbol.for("@inf-monkeys-tech/monkeys-design/provider-context@1");function OT(){return Object.freeze({locale:ho.createContext({...ii,provided:false}),theme:ho.createContext({provided:false}),direction:ho.createContext({provided:false}),environment:ho.createContext({provided:false,environment:WT,portal:zT})})}a(OT,"createMonkeysProviderContexts");function FT(){let e=globalThis,t=e[uh];if(t)return t;let o=OT();return Object.defineProperty(e,uh,{value:o,enumerable:false,configurable:false,writable:false}),o}a(FT,"getMonkeysProviderContexts");var Cd=FT(),si=Cd.locale,an=Cd.theme,xs=Cd.direction,Ra=Cd.environment;function ph(e,t){return t===void 0?e:e===void 0?t:{...e,...t,slots:e.slots||t.slots?{...e.slots,...t.slots}:void 0,styles:e.styles||t.styles?{...e.styles,...t.styles}:void 0}}a(ph,"mergeAppearance");function Co(){try{return ho.useContext(si)??{...ii,provided:!1}}catch{return {...ii,provided:false}}}a(Co,"useMonkeysLocale");function Ye(){return ho.useContext(si).messages}a(Ye,"useMonkeysLocaleMessages");function On(){return ho.useContext(an).resolvedTheme}a(On,"useMonkeysResolvedTheme");function Pe(e){let t=ho.useContext(an).baseAppearance;return ho.useMemo(()=>ph(t,e),[e,t])}a(Pe,"useMonkeysBaseAppearance");function mh(e){let t=ho.useContext(an).dataExplorerAppearance;return ho.useMemo(()=>ph(t,e),[e,t])}a(mh,"useMonkeysDataExplorerAppearance");function Wr(){return ho.useContext(an).statusStates??{}}a(Wr,"useMonkeysStatusStates");function Sd(){return ho.useContext(an).listFooter??{}}a(Sd,"useMonkeysListFooter");function li(){return ho.useContext(xs).direction}a(li,"useMonkeysDirection");function di(){return ho.useContext(Ra).environment}a(di,"useMonkeysEnvironment");function ci(){return ho.useContext(Ra).portal}a(ci,"useMonkeysPortalOptions");function ke(){let e=ho.useContext(si),t=ho.useContext(an),o=ho.useContext(xs),r=e.provided||t.provided||o.provided;return ho.useMemo(()=>r?{dir:o.direction,"data-monkeys-direction":o.direction,"data-monkeys-locale":e.locale,"data-monkeys-theme":t.themeId,"data-monkeys-theme-mode":t.resolvedTheme?.colorMode}:{},[o.direction,e.locale,r,t.resolvedTheme?.colorMode,t.themeId])}a(ke,"useMonkeysComponentAttributes");function am(){return ho.useContext(Ra).iconResolver}a(am,"useMonkeysAssetIconResolver");function fh(){return ho.useContext(Ra).imageResolver}a(fh,"useMonkeysAssetImageResolver");function bh(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}a(bh,"isRecord");function HT(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('MonkeysProvider direction must be "ltr" or "rtl".')}a(HT,"validateDirection");function VT(e){if(e!==void 0){if(!bh(e))throw new TypeError("MonkeysProvider environment must be an object.");if(e.getDocument!==void 0&&typeof e.getDocument!="function")throw new TypeError("MonkeysProvider environment.getDocument must be a function.");if(e.getWindow!==void 0&&typeof e.getWindow!="function")throw new TypeError("MonkeysProvider environment.getWindow must be a function.")}}a(VT,"validateEnvironment");function _T(e){if(e!==void 0){if(!bh(e))throw new TypeError("MonkeysProvider portal must be an object.");if(e.disabled!==void 0&&typeof e.disabled!="boolean")throw new TypeError("MonkeysProvider portal.disabled must be a boolean.");if(e.container!=null&&typeof e.container!="function"&&typeof e.container!="object")throw new TypeError("MonkeysProvider portal.container must be an Element, null, or a function.")}}a(_T,"validatePortal");function GT(e,t,o,r){return e?ys(e,{colorMode:t,density:o}):r}a(GT,"resolveProviderTheme");function gh({children:e,locale:t,messages:o,direction:r,theme:n,themeId:i,colorMode:s,density:l,appearance:d,environment:c,iconResolver:p,imageResolver:u,portal:g,statusStates:f,listFooter:b}){let x=ho.useContext(si),y=ho.useContext(an),k=ho.useContext(xs),w=ho.useContext(Ra);if(HT(r),VT(c),p!==void 0&&typeof p!="function")throw new TypeError("MonkeysProvider iconResolver must be a function.");if(u!==void 0&&typeof u!="function")throw new TypeError("MonkeysProvider imageResolver must be a function.");_T(g);let v=ho.useMemo(()=>wd(t,o,x),[t,o,x]),h=ho.useMemo(()=>({...v,provided:true}),[v]),S=ho.useMemo(()=>GT(n,s,l,y.resolvedTheme),[s,l,y.resolvedTheme,n]),T=ho.useMemo(()=>({provided:true,resolvedTheme:S,themeId:i??y.themeId,baseAppearance:{...y.baseAppearance,...d?.base,...l?{density:l}:void 0,slots:{...y.baseAppearance?.slots,...d?.base?.slots},styles:{...y.baseAppearance?.styles,...d?.base?.styles}},dataExplorerAppearance:{...y.dataExplorerAppearance,...d?.dataExplorer,...l?{density:l}:void 0,slots:{...y.dataExplorerAppearance?.slots,...d?.dataExplorer?.slots},styles:{...y.dataExplorerAppearance?.styles,...d?.dataExplorer?.styles}},statusStates:{...y.statusStates,...f,loading:{...y.statusStates?.loading,...f?.loading},empty:{...y.statusStates?.empty,...f?.empty},error:{...y.statusStates?.error,...f?.error},permission:{...y.statusStates?.permission,...f?.permission}},listFooter:{...y.listFooter,...b,...b?.pageSizeOptions?{pageSizeOptions:[...b.pageSizeOptions]}:void 0}}),[d?.base,d?.dataExplorer,l,y.baseAppearance,y.dataExplorerAppearance,y.statusStates,y.themeId,S,f,b,i]),C=ho.useMemo(()=>({provided:true,direction:r??k.direction??"ltr"}),[r,k.direction]),R=ho.useMemo(()=>({provided:true,iconResolver:p??w.iconResolver,imageResolver:u??w.imageResolver,environment:{...w.environment,...c},portal:{...w.portal,...g}}),[c,w.environment,w.iconResolver,p,u,w.imageResolver,w.portal,g]);return jsxRuntime.jsx(si.Provider,{value:h,children:jsxRuntime.jsx(an.Provider,{value:T,children:jsxRuntime.jsx(xs.Provider,{value:C,children:jsxRuntime.jsx(Ra.Provider,{value:R,children:e})})})})}a(gh,"MonkeysProvider");function m(...e){return tailwindMerge.twMerge(e.filter(Boolean).join(" "))}a(m,"cn");function V(e){return e!=null&&typeof e!="boolean"}a(V,"hasRenderableNode");function Rd(e){return typeof e=="string"?e.trim().length>0:V(e)}a(Rd,"hasNonEmptyRenderableNode");var QT={"bottom-start":{side:"bottom",align:"start"},"bottom-end":{side:"bottom",align:"end"},"top-start":{side:"top",align:"start"},"top-end":{side:"top",align:"end"}};function im(e,t=0){return e.flatMap(o=>[{...o,depth:t},...o.children?im(o.children,t+1):[]])}a(im,"flattenOptions");function ZT(e){let t=new Set;im(e).forEach(o=>{if(!o||typeof o!="object")throw new TypeError("UnifiedDropdown options must contain objects.");if(typeof o.value!="string"||!o.value.trim())throw new TypeError("UnifiedDropdown option value must be a non-empty string.");if(t.has(o.value))throw new TypeError(`UnifiedDropdown option value "${o.value}" must be unique.`);t.add(o.value);});}a(ZT,"validateOptions");function JT(e){let t=Array.isArray(e)?e:e===void 0?[]:[e];return [...new Set(t.filter(o=>typeof o=="string"))]}a(JT,"normalizeValues");function vh(e){return e.textValue?e.textValue:typeof e.label=="string"?e.label:e.value}a(vh,"getOptionText");function pi(e){return e==="multi"||e==="checkbox"}a(pi,"isMultiMode");function eN(e,t){return vh(e).toLocaleLowerCase().includes(t.toLocaleLowerCase())}a(eN,"matchesSearch");function xh(e,t,o){if(t!==void 0&&(pi(e)?!Array.isArray(t):typeof t!="string"))throw new TypeError(`UnifiedDropdown ${o} must be ${pi(e)?"a string array":"a string"} in ${e} mode.`)}a(xh,"validateValueShape");var wh=ho.forwardRef(a(function({mode:t,options:o=[],groups:r=[],value:n,defaultValue:i,placeholder:s="Select\u2026",trigger:l,triggerLabel:d,searchPlaceholder:c="Search\u2026",emptyLabel:p="No options",loadingLabel:u="Loading\u2026",clearLabel:g="Clear selection",retryLabel:f="Retry",loading:b=false,error:x,searchable:y=t==="searchable",clearable:k=false,maxSelections:w,disabled:v=false,invalid:h=false,open:S,defaultOpen:T=false,placement:C="bottom-start",closeOnSelect:R=t!=="multi"&&t!=="checkbox",portal:M=true,size:I="default",width:B="trigger",appearance:N,className:D,classNames:E,slots:P,style:W,onOpenChange:H,onValueChange:A,onSelect:L,onAction:F,onClear:G,onRetry:$,..._},z){if(!["single","multi","searchable","radio","checkbox","tree","action"].includes(t))throw new TypeError(`UnifiedDropdown mode "${String(t)}" is not supported.`);let re=ho.useMemo(()=>r.reduce((te,Te)=>{let ze=typeof Te.label=="string"?Te.label:Te.value;return te.push(...Te.options.map(je=>({...je,group:je.group??ze}))),te},[...o]),[r,o]);if(ZT(re),w!==void 0&&(!Number.isFinite(w)||w<0))throw new TypeError("UnifiedDropdown maxSelections must be a non-negative finite number.");if(t==="action"&&(n!==void 0||i!==void 0))throw new TypeError("UnifiedDropdown action mode does not accept a value.");t!=="action"&&(xh(t,n,"value"),xh(t,i,"defaultValue"));let Z=ho.useId(),ae=`${Z}-trigger`,ee=`${Z}-listbox`,q=`${Z}-search`,U=ho.useRef(null),X=ho.useRef([]),[O,K]=ho.useState(T),[ne,fe]=ho.useState(i??(pi(t)?[]:"")),[he,me]=ho.useState(""),[ie,be]=ho.useState(0),He=S!==void 0,We=He?S:O,Ke=JT(n??ne),ce=ho.useMemo(()=>im(re),[re]),Q=ho.useMemo(()=>y?ce.filter(te=>eN(te,he)):ce,[ce,he,y]),ge=ho.useMemo(()=>new Set(Ke),[Ke]),we=ce.filter(te=>ge.has(te.value)),Ie=we.map(vh).join(", "),oe=d??(Ie||s),xe=we.length===0&&!d,{side:Ve,align:_e}=QT[C],Ge=t==="action",le=t==="radio"||t==="checkbox",Me=Ge||le?"menu":"listbox";ho.useEffect(()=>{We&&be(0);},[We,he]);let Ae=a(te=>{v||(He||K(te),H?.(te));},"setOpen"),J=a(te=>{n===void 0&&fe(te),A?.(te);},"commitValue"),$e=a(te=>{if(!(v||te.disabled)){if(L?.(te),t==="action"){R&&Ae(false),F&&queueMicrotask(()=>F(te));return}if(pi(t)){let Te=ge.has(te.value)?Ke.filter(ze=>ze!==te.value):w!==void 0&&Ke.length>=w?Ke:[...Ke,te.value];J(Te);}else J(te.value);R&&!pi(t)&&Ae(false);}},"selectOption"),ue=a(te=>{if(!v&&(te.key==="ArrowDown"||te.key==="ArrowUp")){te.preventDefault(),We||Ae(true);let Te=te.key==="ArrowDown"?1:-1;be(ze=>Math.max(0,Math.min(Q.length-1,ze+Te)));}},"handleTriggerKeyDown"),Re=a(te=>{if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();let Te=te.key==="ArrowDown"?1:-1;be(ze=>{let je=ze+Te;return Math.max(0,Math.min(Q.length-1,je))});}te.key==="Enter"&&Q[ie]&&(te.preventDefault(),$e(Q[ie]));},"handleContentKeyDown");ho.useEffect(()=>{We&&X.current[ie]?.scrollIntoView({block:"nearest"});},[ie,We]);let se=a(()=>{J(pi(t)?[]:""),G?.();},"clearSelection");return jsxRuntime.jsx(Hn__namespace.Root,{open:We,onOpenChange:Ae,children:jsxRuntime.jsxs("div",{..._,ref:z,className:m("relative inline-flex min-w-0",D),style:W,"data-monkeys-component":"unified-dropdown","data-mode":t,"data-state":We?"open":"closed","data-invalid":h||void 0,"data-disabled":v||void 0,"data-appearance-preset":N?.preset,"data-appearance-variant":N?.variant,"data-appearance-density":N?.density,"data-appearance-radius":N?.radius,children:[jsxRuntime.jsx(Hn__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{ref:U,id:ae,type:"button",disabled:v,"aria-expanded":We,"aria-haspopup":Ge||le?"menu":"listbox","aria-controls":We?ee:void 0,"aria-invalid":h||void 0,onKeyDown:ue,className:m("flex min-w-0 items-center justify-between gap-2 rounded-md border border-input bg-control-surface px-3 text-left text-sm text-foreground shadow-sm outline-hidden transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-control-surface","disabled:cursor-not-allowed disabled:opacity-50",I==="sm"?"h-8 py-1 text-xs":"h-10 py-2",h&&"border-destructive focus-visible:ring-destructive",B==="responsive"&&"w-full sm:w-auto",E?.trigger),children:[l?jsxRuntime.jsx("span",{className:"min-w-0 shrink-0",children:l}):null,jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",xe&&"text-muted-foreground"),children:oe}),jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 opacity-60"})]})}),(()=>{let te=jsxRuntime.jsxs(Hn__namespace.Content,{id:ee,side:Ve,align:_e,sideOffset:6,collisionPadding:8,avoidCollisions:true,onKeyDown:Re,onOpenAutoFocus:Te=>{Te.preventDefault(),(y?document.getElementById(q):X.current[0])?.focus();},tabIndex:-1,className:m("z-50 max-h-[min(24rem,calc(100vh-1rem))] max-w-[calc(100vw-1rem)] overflow-y-auto rounded-md border bg-menu-surface p-1 text-popover-foreground shadow-md outline-hidden",B==="trigger"&&"w-[var(--radix-popover-trigger-width)] min-w-[12rem]",B==="content"&&"min-w-[12rem] max-w-[min(32rem,calc(100vw-1rem))]",B==="responsive"&&"w-[min(var(--radix-popover-trigger-width),calc(100vw-1rem))] min-w-[12rem]",E?.content),children:[y?jsxRuntime.jsxs("div",{className:"relative mb-1",children:[jsxRuntime.jsx(lucideReact.Search,{"aria-hidden":"true",className:"pointer-events-none absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),jsxRuntime.jsx("input",{id:q,value:he,onChange:Te=>me(Te.target.value),placeholder:c,"aria-label":c,className:m("h-9 w-full rounded-sm border-0 bg-transparent pl-8 pr-2 text-sm outline-hidden ring-0 placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring",E?.search)})]}):null,k&&we.length>0?jsxRuntime.jsx("button",{type:"button",className:"mb-1 w-full rounded-sm px-2 py-1 text-left text-xs text-muted-foreground hover:bg-accent",onClick:se,children:g}):null,b&&Q.length===0?P?.loading?P.loading():jsxRuntime.jsx("div",{role:"status",className:m("px-2 py-6 text-center text-sm text-muted-foreground",E?.empty),children:u}):x&&Q.length===0?P?.error?P.error():jsxRuntime.jsxs("div",{role:"alert",className:m("px-2 py-6 text-center text-sm text-destructive-text",E?.empty),children:[x,$?jsxRuntime.jsx("button",{type:"button",className:"mt-2 block w-full text-center text-foreground underline",onClick:$,children:f}):null]}):Q.length===0?P?.empty?P.empty():jsxRuntime.jsx("div",{role:"status",className:m("px-2 py-6 text-center text-sm text-muted-foreground",E?.empty),children:p}):jsxRuntime.jsx("div",{role:t==="tree"?"tree":Me,"aria-multiselectable":t==="multi"||void 0,children:Q.map((Te,ze)=>{let je=ge.has(Te.value),it=t==="radio"?jsxRuntime.jsx(lucideReact.Circle,{"aria-hidden":"true",className:m("h-3.5 w-3.5",je&&"fill-current")}):jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"});return jsxRuntime.jsxs("div",{children:[Te.group&&(ze===0||Q[ze-1]?.group!==Te.group)?jsxRuntime.jsx("div",{role:"presentation",className:m("px-2 pb-1 pt-2 text-xs font-medium text-muted-foreground",E?.groupLabel),children:Te.group}):null,jsxRuntime.jsxs("button",{ref:Y=>{X.current[ze]=Y;},type:"button",role:t==="tree"?"treeitem":t==="radio"?"menuitemradio":t==="checkbox"?"menuitemcheckbox":Ge?"menuitem":"option","aria-level":t==="tree"?Te.depth+1:void 0,"aria-selected":!Ge&&!le?je:void 0,"aria-checked":le?je:void 0,disabled:Te.disabled,"data-highlighted":ze===ie||void 0,"data-state":je?"checked":"unchecked",onMouseEnter:()=>be(ze),onClick:()=>$e(Te),className:m("relative flex min-h-9 w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-hidden transition-colors","hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",ze===ie&&"bg-accent text-accent-foreground",je&&"font-medium",Te.danger&&"text-destructive-text",t!=="action"&&"pl-8",E?.item),style:t==="tree"?{paddingInlineStart:`${8+Te.depth*16}px`}:void 0,children:[t!=="action"?jsxRuntime.jsx("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:je?it:null}):null,P?.option?P.option({option:Te,selected:je,highlighted:ze===ie}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Te.icon?jsxRuntime.jsx("span",{className:"shrink-0",children:Te.icon}):null,jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",E?.itemLabel),children:Te.label}),Te.description?jsxRuntime.jsx("span",{className:m("max-w-[45%] truncate text-xs text-muted-foreground",E?.itemDescription),children:Te.description}):null]})]})]},Te.value)})}),x&&Q.length>0?jsxRuntime.jsx("div",{role:"status",className:"px-2 py-1 text-xs text-destructive-text",children:x}):null,b&&Q.length>0?jsxRuntime.jsx("div",{role:"status",className:"px-2 py-1 text-xs text-muted-foreground",children:u}):null,P?.footer?P.footer():null]});return M?jsxRuntime.jsx(Hn__namespace.Portal,{children:te}):te})()]})})},"UnifiedDropdown"));var kh=ho.createContext(void 0);function Ch({appearance:e,children:t}){return jsxRuntime.jsx(kh.Provider,{value:e,children:t})}a(Ch,"DataExplorerAppearanceProvider");function Et(e){let t=ho.useContext(kh);return ho.useMemo(()=>e?t?{...t,...e,slots:{...t.slots,...e.slots},styles:{...t.styles,...e.styles}}:e:t,[e,t])}a(Et,"useDataExplorerAppearance");function j(...e){return e.filter(Boolean).join(" ")}a(j,"cn");function Mt(e,t){return typeof e=="function"?e(t):e}a(Mt,"resolveDataExplorerValue");var iN={},Th={surfaceRoot:"relative flex h-full min-h-0 w-full min-w-0 overflow-hidden rounded-md border border-border bg-background shadow-sm",toolbarRoot:"flex flex-wrap items-center gap-2 border-b border-border bg-background px-4 py-3",toolbarLeading:"flex items-center gap-2",toolbarSearch:"flex h-10 min-w-52 flex-1 items-center gap-2 rounded-md border border-border bg-background px-3 text-sm",toolbarSearchIcon:"inline-flex shrink-0 text-muted-foreground",toolbarSearchInput:"min-w-0 flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground",toolbarViewSwitch:"flex items-center rounded-md border border-border bg-background p-0.5",toolbarViewButton:"inline-flex h-9 min-w-9 items-center justify-center gap-2 rounded-md px-2 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50",toolbarViewButtonActive:"bg-muted text-foreground",toolbarActions:"flex items-center gap-2",actionBarRoot:"flex min-w-0 flex-wrap items-center gap-2",actionBarLeading:"flex shrink-0 items-center gap-2",actionBarActions:"flex min-w-0 flex-1 flex-wrap items-center gap-2",actionBarTrailing:"flex shrink-0 items-center gap-2",actionButtonBase:"inline-flex h-9 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",actionButtonDefault:"border-border bg-background text-foreground hover:bg-accent/60",actionButtonPrimary:"border-primary/20 bg-primary/10 text-primary hover:bg-primary/15",actionButtonDanger:"border-destructive/20 bg-destructive/10 text-destructive-text hover:bg-destructive/15",actionButtonMuted:"border-border/60 bg-muted/45 text-muted-foreground hover:bg-muted/70 hover:text-foreground",actionButtonActive:"ring-1 ring-primary/30",actionButtonDisabled:"cursor-not-allowed opacity-60",actionIconButton:"w-9 px-0",actionToggleActive:"border-primary/30 bg-primary/10 text-primary",controlButton:"inline-flex h-10 min-w-0 items-center justify-center gap-2 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlButtonIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current [&_svg_*]:!stroke-current",controlButtonLabel:"min-w-0 truncate",controlSelectTrigger:"inline-flex h-10 min-w-28 items-center justify-between gap-3 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlSelectValue:"flex min-w-0 items-center gap-1 truncate",controlCheckbox:"inline-flex h-9 items-center gap-2 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlCheckboxIndicator:"flex h-4 w-4 shrink-0 items-center justify-center rounded border border-border bg-background text-primary",controlCheckboxLabel:"min-w-0 truncate",menuTrigger:"inline-flex h-8 w-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",menuContent:"z-50 min-w-36 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-hidden",menuLabel:"px-2 py-1.5 text-xs font-medium text-muted-foreground",menuSeparator:"-mx-1 my-1 h-px bg-border",menuItem:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",menuItemPrimary:"text-primary focus:text-primary",menuItemDanger:"text-destructive-text focus:text-destructive-text",menuItemMuted:"text-muted-foreground",menuItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",menuItemLabel:"truncate",cardRoot:"group relative flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background transition-shadow",cardInteractive:"cursor-pointer hover:shadow-sm",cardSelected:"ring-2 ring-primary",cardDisabled:"opacity-60",cardHeader:"p-4",cardMedia:"shrink-0 overflow-hidden",cardFooter:"shrink-0 border-t border-border/60 px-4 py-3",recordCardRoot:"group relative border-border/70 transition-shadow hover:shadow-sm",recordCardActive:"z-10 ring-2 ring-monkeys-500",footerRoot:"flex items-center border-t border-border bg-background px-4 py-3",footerSummary:"flex items-center gap-1 whitespace-nowrap text-sm text-muted-foreground",footerJumpButton:"inline-flex items-center gap-1 text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",footerPageSizeSelect:"h-8 rounded-md border border-border bg-background px-2 text-sm text-foreground",previewRoot:"relative h-full min-h-0 w-full flex-1 select-none self-stretch overflow-hidden bg-slate-950",previewPlaceholder:"flex h-full w-full items-center justify-center rounded-xl bg-white/5 px-6 text-center text-sm text-white/60",previewActions:"absolute right-4 top-4 z-20 flex flex-col gap-2",previewControls:"absolute bottom-4 right-4 z-20 flex flex-col gap-2",previewZoomLabel:"min-w-[3rem] rounded-full border border-white/15 bg-black/30 px-1 py-1 text-center text-xs font-medium text-white/70 shadow-lg backdrop-blur",previewControlButton:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur transition hover:bg-black/45",previewNavigationButton:"absolute top-1/2 flex h-10 w-10 -translate-y-1/2 items-center justify-center rounded-full border border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur transition-colors hover:bg-black/45 disabled:pointer-events-none disabled:opacity-40",detailRoot:"flex h-full flex-col overflow-hidden bg-background",detailHeader:"flex items-center justify-between gap-3 border-b border-border bg-background px-4 py-4 sm:px-5",detailLeading:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",detailNavigation:"hidden items-center gap-1 rounded-lg border border-border bg-background px-1 py-1 md:flex",detailNavigationButton:"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",detailCloseButton:"flex h-10 w-10 items-center justify-center rounded-full border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",detailPreviewPanel:"min-h-0 overflow-hidden border-b border-border bg-background xl:border-b-0",detailPreviewFrame:"relative h-full min-h-0 w-full overflow-hidden bg-background",detailRightPanel:"min-h-0 min-w-0 border-t border-border bg-background xl:border-l xl:border-t-0",detailRightPanelBody:"h-full overflow-y-auto overscroll-contain bg-background p-5",treeShellRoot:"flex h-full min-h-0 flex-col overflow-hidden",treeShellHeader:"flex shrink-0 items-start justify-between gap-3 px-4 py-3",treeShellTitle:"truncate text-sm font-semibold",treeShellSubtitle:"mt-1 text-sm text-muted-foreground",treeShellToolbar:"flex shrink-0 items-center gap-2",treeShellBody:"min-h-0 flex-1 overflow-hidden",treeShellFooter:"shrink-0",treeRoot:"min-w-0 space-y-1 overflow-hidden text-sm",treeGroup:"min-w-0 space-y-1",treeGroupHeader:"group/tree-group flex min-w-0 items-center gap-1",treeGroupHeaderButton:"flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-left font-medium text-muted-foreground transition-colors hover:bg-accent/55 hover:text-foreground",treeGroupContent:"min-w-0 space-y-0.5",treeGroupActions:"shrink-0 opacity-0 transition-opacity group-hover/tree-group:opacity-100 data-[state=open]:opacity-100",treeNode:"min-w-0",treeNodeButton:"group/tree-node flex min-h-9 w-full min-w-0 items-center gap-1 rounded-md pr-1 text-left text-sm text-foreground transition-colors hover:bg-accent/55 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",treeNodeSelected:"bg-accent text-accent-foreground",treeNodeDisabled:"cursor-not-allowed opacity-55",treeNodeDragging:"opacity-50",treeNodeToggle:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",treeNodeIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground group-hover/tree-node:text-foreground",treeNodeLabel:"min-w-0 truncate",treeNodeDescription:"mt-0.5 truncate text-xs text-muted-foreground",treeNodeMeta:"ml-2 shrink-0 text-xs text-muted-foreground",treeNodeBadge:"ml-2 shrink-0 rounded-full border border-border bg-muted px-1.5 py-0.5 text-[11px] leading-none text-muted-foreground",treeNodeActions:"ml-1 shrink-0 opacity-0 transition-opacity group-hover/tree-node:opacity-100 data-[state=open]:opacity-100",treeNodeChildren:"mt-0.5 min-w-0 space-y-0.5",treeNodeDragHandle:"inline-flex h-5 w-5 shrink-0 cursor-grab items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground active:cursor-grabbing group-hover/tree-node:opacity-100",treeEmpty:"px-3 py-2 text-xs text-muted-foreground",treeError:"px-3 py-2 text-xs text-destructive-text",treeLoading:"px-3 py-2 text-xs text-muted-foreground"},sN={flush:{surfaceRoot:"relative flex h-full min-h-0 w-full min-w-0 overflow-hidden"}},lN={compact:{treeShellHeader:"px-3 py-2",toolbarRoot:"px-3 py-2",toolbarSearch:"h-9 min-w-48",toolbarViewButton:"h-8 min-w-8 text-xs",actionButtonBase:"h-8 px-2.5 text-xs",actionIconButton:"h-8 w-8 px-0",controlButton:"h-9 px-2.5 text-xs",controlSelectTrigger:"h-9 min-w-24 px-2.5 text-xs",controlCheckbox:"h-8 px-2.5 text-xs",menuTrigger:"h-8 w-8",footerRoot:"px-3 py-2",footerPageSizeSelect:"h-8 text-xs",treeGroupHeaderButton:"h-8 text-xs",treeNodeButton:"min-h-8 text-xs",treeEmpty:"py-1.5 text-xs",treeError:"py-1.5 text-xs",treeLoading:"py-1.5 text-xs"},default:{},comfortable:{treeShellHeader:"px-5 py-4",toolbarRoot:"px-5 py-4",toolbarSearch:"h-11",toolbarViewButton:"h-10 min-w-10",actionButtonBase:"h-10 px-3.5",actionIconButton:"h-10 w-10 px-0",controlButton:"h-11 px-3.5",controlSelectTrigger:"h-11 min-w-32 px-3.5",controlCheckbox:"h-10 px-3.5",menuTrigger:"h-9 w-9",footerRoot:"px-5 py-3.5",treeGroupHeaderButton:"h-10",treeNodeButton:"min-h-10"}},dN={none:{surfaceRoot:"rounded-none",toolbarSearch:"rounded-none",toolbarViewSwitch:"rounded-none",toolbarViewButton:"rounded-none",actionButtonBase:"rounded-none",controlButton:"rounded-none",controlSelectTrigger:"rounded-none",controlCheckbox:"rounded-none",controlCheckboxIndicator:"rounded-none",menuTrigger:"rounded-none",menuContent:"rounded-none",menuItem:"rounded-none",cardRoot:"rounded-none",footerPageSizeSelect:"rounded-none",detailLeading:"rounded-none",detailNavigation:"rounded-none",detailNavigationButton:"rounded-none",detailCloseButton:"rounded-none",treeGroupHeaderButton:"rounded-none",treeNodeButton:"rounded-none",treeNodeToggle:"rounded-none",treeNodeBadge:"rounded-none",treeNodeDragHandle:"rounded-none"},sm:{surfaceRoot:"rounded-sm",toolbarSearch:"rounded-sm",toolbarViewSwitch:"rounded-sm",toolbarViewButton:"rounded-sm",actionButtonBase:"rounded-sm",controlButton:"rounded-sm",controlSelectTrigger:"rounded-sm",controlCheckbox:"rounded-sm",controlCheckboxIndicator:"rounded-sm",menuTrigger:"rounded-sm",menuContent:"rounded-sm",menuItem:"rounded-sm",cardRoot:"rounded-sm",treeGroupHeaderButton:"rounded-sm",treeNodeButton:"rounded-sm",treeNodeToggle:"rounded-sm",treeNodeBadge:"rounded-sm",treeNodeDragHandle:"rounded-sm"},md:{},lg:{surfaceRoot:"rounded-xl",toolbarSearch:"rounded-lg",toolbarViewSwitch:"rounded-lg",toolbarViewButton:"rounded-lg",actionButtonBase:"rounded-lg",controlButton:"rounded-lg",controlSelectTrigger:"rounded-lg",controlCheckbox:"rounded-lg",controlCheckboxIndicator:"rounded-md",menuTrigger:"rounded-lg",menuContent:"rounded-lg",cardRoot:"rounded-xl",treeGroupHeaderButton:"rounded-lg",treeNodeButton:"rounded-lg",treeNodeToggle:"rounded-md",treeNodeBadge:"rounded-lg",treeNodeDragHandle:"rounded-md"},xl:{surfaceRoot:"rounded-2xl",toolbarSearch:"rounded-xl",toolbarViewSwitch:"rounded-xl",toolbarViewButton:"rounded-xl",actionButtonBase:"rounded-xl",controlButton:"rounded-xl",controlSelectTrigger:"rounded-xl",controlCheckbox:"rounded-xl",controlCheckboxIndicator:"rounded-lg",menuTrigger:"rounded-xl",menuContent:"rounded-xl",cardRoot:"rounded-2xl",treeGroupHeaderButton:"rounded-xl",treeNodeButton:"rounded-xl",treeNodeToggle:"rounded-lg",treeNodeBadge:"rounded-xl",treeNodeDragHandle:"rounded-lg"},full:{surfaceRoot:"rounded-2xl",toolbarSearch:"rounded-full",toolbarViewSwitch:"rounded-full",toolbarViewButton:"rounded-full",actionButtonBase:"rounded-full",controlButton:"rounded-full",controlSelectTrigger:"rounded-full",controlCheckbox:"rounded-full",controlCheckboxIndicator:"rounded-full",menuTrigger:"rounded-full",cardRoot:"rounded-2xl",treeGroupHeaderButton:"rounded-full",treeNodeButton:"rounded-full",treeNodeToggle:"rounded-full",treeNodeBadge:"rounded-full",treeNodeDragHandle:"rounded-full"}},cN={none:{surfaceRoot:"border-transparent",toolbarRoot:"border-transparent",toolbarSearch:"border-transparent",toolbarViewSwitch:"border-transparent",actionButtonBase:"border-transparent",controlButton:"border-transparent",controlSelectTrigger:"border-transparent",controlCheckbox:"border-transparent",cardRoot:"border-transparent",footerRoot:"border-transparent",detailHeader:"border-transparent",detailPreviewPanel:"border-transparent",detailRightPanel:"border-transparent"},subtle:{surfaceRoot:"border-border/60",toolbarRoot:"border-border/60",toolbarSearch:"border-border/60",toolbarViewSwitch:"border-border/60",actionButtonDefault:"border-border/60",controlButton:"border-border/60",controlSelectTrigger:"border-border/60",controlCheckbox:"border-border/60",cardRoot:"border-border/60",footerRoot:"border-border/60"},solid:{},strong:{surfaceRoot:"border-foreground/20",toolbarRoot:"border-foreground/20",toolbarSearch:"border-foreground/20",toolbarViewSwitch:"border-foreground/20",actionButtonDefault:"border-foreground/20",controlButton:"border-foreground/20",controlSelectTrigger:"border-foreground/20",controlCheckbox:"border-foreground/20",cardRoot:"border-foreground/20",footerRoot:"border-foreground/20"}},uN={plain:{},muted:{surfaceRoot:"bg-card",toolbarRoot:"bg-muted/20",toolbarSearch:"bg-background",toolbarViewSwitch:"bg-background",controlButton:"bg-background",controlSelectTrigger:"bg-background",controlCheckbox:"bg-background",cardRoot:"bg-card",footerRoot:"bg-muted/20",detailHeader:"bg-muted/20"},soft:{surfaceRoot:"bg-background/95 shadow-sm",toolbarRoot:"bg-background/95",actionButtonDefault:"bg-muted/30 hover:bg-muted/55",controlButton:"bg-muted/30 hover:bg-muted/55",controlSelectTrigger:"bg-muted/30 hover:bg-muted/55",controlCheckbox:"bg-muted/30 hover:bg-muted/55",cardRoot:"bg-background/95 shadow-sm",footerRoot:"bg-background/95"},glass:{surfaceRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",toolbarRoot:"border-white/10 bg-white/5 backdrop-blur-md",toolbarSearch:"border-white/10 bg-white/5",toolbarViewSwitch:"border-white/10 bg-white/5",actionButtonDefault:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlButton:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlSelectTrigger:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlCheckbox:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlCheckboxIndicator:"border-white/15 bg-white/10",cardRoot:"border-white/10 bg-white/[0.06] shadow-none",footerRoot:"border-white/10 bg-white/5 backdrop-blur-md"},"dark-stage":{previewRoot:"bg-slate-950",previewPlaceholder:"bg-white/5 text-white/60",actionButtonBase:"inline-flex h-9 items-center justify-center gap-2 rounded-full border px-3 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-white/45 focus-visible:ring-offset-0",actionButtonDefault:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlButton:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlSelectTrigger:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlCheckbox:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",actionButtonPrimary:"border-white/25 bg-white/20 text-white shadow-lg backdrop-blur hover:bg-white/28",actionButtonMuted:"border-white/10 bg-black/20 text-white/70 shadow-lg backdrop-blur hover:bg-black/[0.35] hover:text-white",actionIconButton:"h-9 w-9 px-0"}},Sh={default:{density:"default",radius:"md",border:"solid",background:"plain"},soft:{density:"default",radius:"md",border:"subtle",background:"plain"},compact:{density:"compact",radius:"md",border:"subtle",background:"soft"},"tinted-glass":{density:"default",radius:"lg",border:"subtle",background:"glass"},flat:{density:"compact",radius:"none",border:"solid",background:"plain"},glass:{density:"default",radius:"lg",border:"subtle",background:"glass"},"hard-edge":{density:"compact",radius:"none",border:"solid",background:"plain"}},pN={soft:{actionButtonBase:"font-medium",controlButton:"font-medium",controlSelectTrigger:"font-medium",controlCheckbox:"font-medium",menuTrigger:"rounded-full",cardRoot:"border-border/70"},compact:{toolbarRoot:"gap-2",actionButtonBase:"text-xs",controlButton:"text-xs",controlSelectTrigger:"text-xs",controlCheckbox:"text-xs",footerRoot:"text-xs"},"tinted-glass":{actionButtonDefault:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",actionButtonPrimary:"border-primary/30 bg-primary/15 text-primary-foreground hover:bg-primary/20",actionButtonMuted:"border-border/50 bg-muted/20 text-muted-foreground hover:bg-muted/45 hover:text-foreground",controlButton:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlSelectTrigger:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlCheckbox:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlCheckboxIndicator:"border-border/60 bg-background/10 text-primary",menuContent:"border-border bg-popover text-popover-foreground shadow-2xl",menuSeparator:"bg-border",menuItem:"focus:bg-accent focus:text-accent-foreground",cardSelected:"ring-2 ring-primary",previewRoot:"bg-background",treeGroupHeaderButton:"text-muted-foreground hover:bg-accent/60 hover:text-foreground",treeNodeButton:"text-foreground hover:bg-accent/60 hover:text-accent-foreground focus-visible:ring-ring",treeNodeSelected:"bg-accent text-accent-foreground",treeNodeToggle:"text-muted-foreground hover:bg-accent hover:text-foreground",treeNodeIcon:"text-muted-foreground group-hover/tree-node:text-foreground",treeNodeMeta:"text-muted-foreground",treeNodeBadge:"border-border bg-muted text-muted-foreground",treeNodeActions:"text-muted-foreground",treeNodeDragHandle:"text-muted-foreground hover:bg-accent hover:text-foreground group-hover/tree-node:opacity-100",treeEmpty:"text-muted-foreground",treeError:"text-destructive-text",treeLoading:"text-muted-foreground"},flat:{toolbarRoot:"border-slate-200 bg-white",toolbarSearch:"rounded-none border-slate-200 bg-white shadow-none",toolbarViewSwitch:"rounded-none border-slate-200 bg-white shadow-none",actionButtonBase:"rounded-none shadow-none",controlButton:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",controlSelectTrigger:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",controlCheckbox:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",actionButtonDefault:"border-slate-200 bg-white text-slate-700 hover:bg-slate-50",menuTrigger:"rounded-none border border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",menuContent:"rounded-none border-slate-200 bg-white shadow-none",cardRoot:"rounded-none border-slate-200 bg-white shadow-none",footerRoot:"border-slate-200 bg-white",treeRoot:"space-y-1 text-sm",treeGroupHeader:"group/tree-group flex min-w-0 items-center",treeGroupHeaderButton:"h-9 rounded-none px-3 text-slate-600 shadow-none hover:bg-slate-100 hover:text-slate-950",treeGroupContent:"space-y-1",treeNodeButton:"min-h-9 rounded-none text-slate-700 hover:bg-slate-100 hover:text-slate-950 focus-visible:ring-slate-300",treeNodeSelected:"bg-slate-100 text-slate-950",treeNodeToggle:"rounded-none text-slate-500 hover:bg-transparent hover:text-slate-950",treeNodeIcon:"text-slate-500 group-hover/tree-node:text-slate-950",treeNodeDragHandle:"rounded-none text-slate-400 hover:bg-transparent hover:text-slate-700",treeNodeActions:"text-slate-500"},glass:{menuContent:"border-white/10 bg-slate-950/90 text-white backdrop-blur-xl",menuSeparator:"bg-white/10",menuItem:"focus:bg-white/10 focus:text-white"},"hard-edge":{toolbarRoot:"border-slate-200 bg-white",actionButtonBase:"rounded-none shadow-none",controlButton:"rounded-none shadow-none",controlSelectTrigger:"rounded-none shadow-none",controlCheckbox:"rounded-none shadow-none",cardRoot:"rounded-none border-slate-200 bg-white shadow-none",footerRoot:"border-slate-200 bg-white",footerPageSizeSelect:"rounded-none border-slate-200 shadow-none"}},mN=Object.keys(Th);function fN(...e){return mN.reduce((t,o)=>(t[o]=j(...e.map(r=>r?.[o])),t),{})}a(fN,"mergeSlots");function bN(...e){return e.reduce((t,o)=>({...t,...o}),{})}a(bN,"mergeStyles");function gN(e){let t=Sh[e];if(!t)throw new TypeError(`Unknown Data Explorer theme preset "${String(e)}". Expected one of: ${Object.keys(Sh).join(", ")}.`);return t}a(gN,"getPresetDefaults");function Ct(e){let t=e?.preset??"default",o=e?.surface??"card",r=gN(t),n=e?.density??r.density??"default",i=e?.radius??r.radius??"md",s=e?.border??r.border??"solid",l=e?.background??r.background??"plain",d=fN(Th,pN[t],lN[n],dN[i],cN[s],uN[l],e?.slots);return o==="flush"&&(d.surfaceRoot=j(sN.flush.surfaceRoot,e?.slots?.surfaceRoot)),{surface:o,preset:t,density:n,radius:i,border:s,background:l,styles:bN(iN,e?.styles),slots:d}}a(Ct,"resolveDataExplorerAppearance");function Dd(e,t,o){return j(t==="primary"?e.slots.actionButtonPrimary:t==="danger"?e.slots.actionButtonDanger:t==="muted"?e.slots.actionButtonMuted:e.slots.actionButtonDefault,o&&e.slots.actionButtonActive)}a(Dd,"getDataExplorerActionToneClassName");function Vn(e,t){if(t==="primary")return e.slots.menuItemPrimary;if(t==="danger")return e.slots.menuItemDanger;if(t==="muted")return e.slots.menuItemMuted}a(Vn,"getDataExplorerMenuItemToneClassName");function yN(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4 animate-spin",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(yN,"LoadingIcon");var vs=ho.forwardRef(a(function({children:t,label:o,icon:r,endIcon:n,type:i="button",title:s,ariaLabel:l,tone:d,active:c=false,iconOnly:p=false,disabled:u=false,loading:g=false,stopPropagation:f=false,appearance:b,className:x,classNames:y,style:k,onClick:w,"aria-label":v,...h},S){let T=Ct(Et(b)),C=t??o,R=u||g,M=a(I=>{f&&I.stopPropagation(),!R&&w?.(I);},"handleClick");return jsxRuntime.jsxs("button",{...h,ref:S,type:i,title:s,"aria-label":l??v,"aria-pressed":c||void 0,"aria-busy":g||void 0,disabled:R,className:j(T.slots.controlButton,p&&T.slots.actionIconButton,Dd(T,d,c),R&&T.slots.actionButtonDisabled,y?.root,x),style:{...T.styles.control,...c?T.styles.controlActive:void 0,...R?T.styles.controlDisabled:void 0,...k},onClick:M,children:[g?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:jsxRuntime.jsx(yN,{})}):r?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:r}):null,p?jsxRuntime.jsx("span",{className:"sr-only",children:C}):C?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonLabel,y?.label),children:C}):null,n?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:n}):null]})},"DataExplorerButton"));function xN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",children:jsxRuntime.jsx("path",{d:"m5 12 4 4L19 6"})})}a(xN,"CheckIcon");function Pd({checked:e=false,icon:t,label:o,title:r,disabled:n=false,appearance:i,className:s,classNames:l,style:d,onCheckedChange:c}){let p=Ct(Et(i));return jsxRuntime.jsxs("button",{type:"button",title:r,"aria-pressed":e,disabled:n,className:j(p.slots.controlCheckbox,e&&p.slots.actionToggleActive,n&&p.slots.actionButtonDisabled,l?.root,s),style:{...p.styles.control,...e?p.styles.controlActive:void 0,...n?p.styles.controlDisabled:void 0,...d},onClick:u=>{u.stopPropagation(),!n&&c?.(!e);},children:[jsxRuntime.jsx("span",{className:j(p.slots.controlCheckboxIndicator,l?.indicator,t!=null&&!e&&l?.icon),children:e?jsxRuntime.jsx(xN,{}):t}),o?jsxRuntime.jsx("span",{className:j(p.slots.controlCheckboxLabel,l?.label),children:o}):null]})}a(Pd,"DataExplorerCheckbox");function wN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(wN,"ChevronDownIcon");function kN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m5 12 4 4L19 6"})})}a(kN,"CheckIcon");function Ad({value:e="",options:t=[],label:o,placeholder:r="Select",icon:n,title:i,triggerLabel:s,disabled:l=false,display:d="value",align:c="start",sideOffset:p=6,appearance:u,className:g,classNames:f,style:b,onValueChange:x}){let y=Ct(Et(u)),k=t.find(v=>v.value===e),w=d==="label-value"&&o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:k?.label??r})]}):k?.label??o??r;return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{type:"button",title:i,"aria-label":s,disabled:l||t.length===0,className:j(y.slots.controlSelectTrigger,f?.trigger,f?.root,g),style:{...y.styles.control,...b},onClick:v=>v.stopPropagation(),children:[n?jsxRuntime.jsx("span",{className:j(y.slots.controlButtonIcon,f?.icon),children:n}):null,jsxRuntime.jsx("span",{className:j(y.slots.controlSelectValue,f?.value),children:w}),jsxRuntime.jsx(wN,{})]})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{align:c,sideOffset:p,className:j(y.slots.menuContent,f?.content),style:y.styles.menuContent,onClick:v=>v.stopPropagation(),children:jsxRuntime.jsx(Bt__namespace.RadioGroup,{value:e,onValueChange:v=>{l||x?.(v);},children:t.map(v=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{value:v.value,title:v.title,disabled:v.disabled,className:j(y.slots.menuItem,f?.item),style:y.styles.menuItem,children:[jsxRuntime.jsx("span",{className:j(y.slots.menuItemIcon,f?.itemIcon),children:v.value===e?jsxRuntime.jsx(kN,{}):v.icon}),jsxRuntime.jsx("span",{className:j(y.slots.menuItemLabel,f?.itemLabel),children:v.label})]},v.value))})})})]})}a(Ad,"DataExplorerSelect");function SN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(SN,"ChevronDownIcon");function sm(e,t){return Mt(e.disabled,t)??Mt(e.loading,t)??false}a(sm,"resolveActionDisabled");function TN(e){return e.onAction??e.onClick}a(TN,"getActionCallback");function NN(e,t,o,r){let n=(Mt(e.disabled,t)??false)||(Mt(e.loading,t)??false),i=Mt(e.active,t)??false;return jsxRuntime.jsxs("div",{children:[e.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:e.title,disabled:n,className:j(o.slots.menuItem,Vn(o,e.tone),i&&"bg-accent text-accent-foreground",r),style:o.styles.menuItem,onSelect:()=>{!e.onAction||n||e.onAction(t);},children:[e.icon?jsxRuntime.jsx("span",{className:o.slots.menuItemIcon,children:e.icon}):null,jsxRuntime.jsx("span",{className:o.slots.menuItemLabel,children:e.label})]}),e.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator}):null]},e.id)}a(NN,"renderMenuItem");function RN(e,t,o,r,n){let i=sm(e,t),s=Mt(e.active,t)??false,l=(e.items??[]).filter(d=>Mt(d.visible,t)??true);return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(vs,{title:e.title,ariaLabel:e.triggerLabel,disabled:i||l.length===0,label:e.label,icon:e.icon,endIcon:jsxRuntime.jsx(SN,{}),tone:e.tone,active:s,stopPropagation:true,appearance:n,className:r?.action})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:e.align??"end",sideOffset:e.sideOffset??6,className:j(o.slots.menuContent,r?.menuContent),style:o.styles.menuContent,onClick:d=>d.stopPropagation(),children:[e.menuLabel?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Bt__namespace.Label,{className:o.slots.menuLabel,children:e.menuLabel}),jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator})]}):null,l.map(d=>NN(d,t,o,r?.menuItem))]})})]},e.id)}a(RN,"renderMenuAction");function MN(e,t,o,r){let n=sm(e,t),i=String(Mt(e.value,t)??""),s=e.options??[];return jsxRuntime.jsx(Ad,{value:i,label:e.label,icon:e.icon,title:e.title,triggerLabel:e.triggerLabel,disabled:n,display:e.selectDisplay??"label-value",align:e.align??"end",sideOffset:e.sideOffset??6,options:s.map(l=>({value:l.value,label:l.label,icon:l.icon,title:l.title,disabled:Mt(l.disabled,t)??false})),appearance:r,classNames:{trigger:o?.action,content:o?.menuContent,item:o?.menuItem},onValueChange:l=>{!e.onValueChange||n||e.onValueChange(l,t);}},e.id)}a(MN,"renderSelectAction");function IN(e,t,o,r){let n=e.kind??"button",i=n==="toggle"?Mt(e.checked,t)??Mt(e.active,t)??false:Mt(e.active,t)??false,s=sm(e,t),l=TN(e);return n==="toggle"?jsxRuntime.jsx(Pd,{checked:i,icon:e.icon,label:e.label,title:e.title,disabled:s,appearance:o,className:r,onCheckedChange:d=>{e.onCheckedChange&&e.onCheckedChange(d,t);}},e.id):jsxRuntime.jsx(vs,{label:e.label,icon:e.icon,title:e.title,ariaLabel:n==="icon-button"?e.triggerLabel||e.title:void 0,tone:e.tone,active:i,iconOnly:n==="icon-button",disabled:s,loading:Mt(e.loading,t)??false,stopPropagation:true,appearance:o,className:r,onClick:()=>{l&&l(t);}},e.id)}a(IN,"renderButtonAction");function sn({context:e,actions:t=[],layout:o="action-bar",appearance:r,empty:n,children:i,className:s,classNames:l}){let d=Ct(Et(r)),c=t.filter(u=>Mt(u.visible,e)??true).map(u=>{if(u.render)return jsxRuntime.jsx("div",{children:u.render(e)},u.id);if(u.renderTrigger)return jsxRuntime.jsx("div",{children:u.renderTrigger(e)},u.id);let g=u.kind==="menu"?RN(u,e,d,l,r):u.kind==="select"?MN(u,e,l,r):IN(u,e,r,l?.action);return u.wrapTrigger?jsxRuntime.jsx("div",{children:u.wrapTrigger(g,e)},u.id):g});if(c.length===0&&!i&&!n)return null;let p=o==="action-bar"?d.slots.actionBarActions:o==="toolbar"?d.slots.toolbarActions:"flex items-center gap-2";return jsxRuntime.jsxs("div",{className:j(p,l?.root,s),children:[c,i,c.length===0&&!i?n:null]})}a(sn,"DataExplorerToolbarActions");function Rh({context:e,actions:t=[],leading:o,trailing:r,children:n,empty:i,appearance:s,className:l,classNames:d}){let c=Ct(Et(s)),p=!!o||!!r||!!n||t.length>0;return p||!!i?jsxRuntime.jsxs("div",{className:j(c.slots.actionBarRoot,d?.root,l),children:[o?jsxRuntime.jsx("div",{className:j(c.slots.actionBarLeading,d?.leading),children:o}):null,jsxRuntime.jsx(sn,{context:e,actions:t,layout:"action-bar",appearance:s,empty:p?void 0:i,classNames:{root:d?.actions,action:d?.action},children:n}),r?jsxRuntime.jsx("div",{className:j(c.slots.actionBarTrailing,d?.trailing),children:r}):null]}):null}a(Rh,"DataExplorerActionBar");var EN={},to="motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",yr="motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",Bd="motion-safe:transition-transform motion-safe:duration-300 motion-safe:ease-out",Mh=m("[scrollbar-width:thin]","[scrollbar-color:hsl(var(--muted-foreground)/0.45)_transparent]","[&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2","[&::-webkit-scrollbar-button]:hidden [&::-webkit-scrollbar-button]:h-0 [&::-webkit-scrollbar-button]:w-0 [&::-webkit-scrollbar-button]:bg-transparent","[&::-webkit-scrollbar-button:single-button]:hidden [&::-webkit-scrollbar-button:single-button]:h-0 [&::-webkit-scrollbar-button:single-button]:w-0","[&::-webkit-scrollbar-button:double-button]:hidden [&::-webkit-scrollbar-button:double-button]:h-0 [&::-webkit-scrollbar-button:double-button]:w-0","[&::-webkit-scrollbar-corner]:bg-transparent","[&::-webkit-scrollbar-track]:bg-transparent","[&:has(thead.sticky)::-webkit-scrollbar-track]:mt-[var(--base-table-header-height)]","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/40","hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/55"),AN=m("[&.sticky_th]:sticky [&.sticky_th]:top-0 [&.sticky_th]:z-[2]","[&.sticky_th]:bg-[var(--base-table-sticky-header-bg)]","[&.sticky_th]:shadow-[inset_0_-1px_0_var(--base-table-header-separator)]"),Eh={buttonBase:m("group/button inline-flex min-w-0 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium focus-visible:outline-hidden","cursor-pointer disabled:!cursor-not-allowed",yr),buttonDefault:"border-border bg-background text-foreground hover:bg-accent/60",buttonPrimary:"border-primary/20 bg-primary/10 text-primary hover:bg-primary/15",buttonSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))] hover:bg-[hsl(var(--success,142_72%_29%)_/_0.15)]",buttonWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))] hover:bg-[hsl(var(--warning,45_93%_47%)_/_0.15)]",buttonDanger:"border-destructive/20 bg-destructive/10 text-destructive-text hover:bg-destructive/15",buttonMuted:"border-border/60 bg-muted/45 text-muted-foreground hover:bg-muted/70 hover:text-foreground",buttonActive:"border-primary/35 bg-primary/10 text-primary",buttonDisabled:"!cursor-not-allowed opacity-60",buttonIconOnly:"w-9 px-0",buttonIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current [&_svg_*]:!stroke-current",buttonLabel:"min-w-0 truncate",badgeBase:m("inline-flex max-w-full items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium",to),badgeDefault:"border-border/60 bg-background text-foreground",badgePrimary:"border-primary/30 bg-primary/10 text-primary",badgeSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))]",badgeWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",badgeDanger:"border-destructive/30 bg-destructive/10 text-destructive-text",badgeMuted:"border-border/60 bg-muted text-muted-foreground",badgeIcon:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",badgeLabel:"min-w-0 truncate",textRoot:"min-w-0 break-words leading-6",textSizeXs:"text-xs",textSizeSm:"text-sm",textSizeMd:"text-base",textSizeLg:"text-lg",textSizeXl:"text-xl",typographyToneDefault:"text-foreground",typographyToneMuted:"text-muted-foreground",typographyTonePrimary:"text-primary",typographyToneSuccess:"text-emerald-700 dark:text-emerald-400",typographyToneWarning:"text-amber-700 dark:text-amber-400",typographyToneDanger:"text-destructive-text",typographyToneInherit:"text-inherit",headingRoot:"min-w-0 break-words font-semibold tracking-tight",headingSizeXs:"text-sm leading-5",headingSizeSm:"text-base leading-6",headingSizeMd:"text-lg leading-7",headingSizeLg:"text-xl leading-7",headingSizeXl:"text-2xl leading-8",headingSize2xl:"text-3xl leading-9",linkRoot:"inline break-words underline decoration-current/40 underline-offset-4 hover:decoration-current focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",codeInline:"rounded border border-border/70 bg-muted/60 px-1.5 py-0.5 font-mono text-[0.875em] leading-[1.45] text-foreground",codeBlock:"m-0 max-w-full overflow-x-auto rounded-md border border-border/70 bg-muted/60 p-4 text-foreground",codeContent:"font-mono text-sm leading-6",kbdRoot:"inline-flex min-h-5 items-center rounded border border-border bg-muted/70 px-1.5 font-mono text-[0.75em] font-medium leading-5 text-foreground shadow-[inset_0_-1px_0_hsl(var(--monkeys-color-border))]",listRoot:"m-0 min-w-0 list-outside break-words ps-5 text-foreground",listSpacingCompact:"[&>li+li]:mt-1",listSpacingDefault:"[&>li+li]:mt-2",listSpacingRelaxed:"[&>li+li]:mt-3",listMarkerNone:"list-none ps-0",listMarkerDisc:"list-disc",listMarkerCircle:"list-[circle]",listMarkerSquare:"list-[square]",listMarkerDecimal:"list-decimal",listMarkerLowerAlpha:"list-[lower-alpha]",listMarkerUpperAlpha:"list-[upper-alpha]",listItem:"min-w-0 ps-1 leading-6 marker:text-muted-foreground",stackRoot:"flex min-w-0 flex-col",inlineRoot:"flex min-w-0 flex-row",gridRoot:"grid min-w-0",containerRoot:"mx-auto w-full min-w-0",aspectRatioRoot:"relative min-w-0 overflow-hidden [&>*]:h-full [&>*]:w-full",spinnerRoot:"inline-flex shrink-0 items-center justify-center text-current align-middle",spinnerIndicator:"h-5 w-5 rounded-full border-2 border-current border-r-transparent motion-safe:animate-spin motion-reduce:animate-none",visuallyHiddenRoot:"sr-only",visuallyHiddenFocusable:"focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[1000] focus:rounded-md focus:bg-background focus:px-4 focus:py-2 focus:text-foreground focus:shadow-lg focus:outline-hidden focus:ring-2 focus:ring-ring focus-within:not-sr-only focus-within:fixed focus-within:left-4 focus-within:top-4 focus-within:z-[1000] focus-within:rounded-md focus-within:bg-background focus-within:px-4 focus-within:py-2 focus-within:text-foreground focus-within:shadow-lg focus-within:ring-2 focus-within:ring-ring",fieldsetRoot:"min-w-0 border-0 p-0 text-foreground",fieldsetLegend:"min-w-0 text-sm font-semibold leading-6 text-foreground",fieldsetDescription:"mt-1 text-sm leading-5 text-muted-foreground",fieldsetError:"mt-1 text-sm leading-5 text-destructive-text",fieldsetContent:"mt-3 grid min-w-0 gap-3",stepsRoot:"m-0 min-w-0 list-none p-0 text-foreground",stepsHorizontal:"flex w-full max-w-full items-start overflow-x-auto pb-2",stepsVertical:"grid",stepsItem:"relative min-w-0",stepsItemHorizontal:"flex min-w-52 flex-1 items-start",stepsItemVertical:"pb-6 last:pb-0",stepsTrigger:"flex min-w-0 flex-1 items-start gap-3 rounded-md border-0 bg-transparent p-1 text-start text-inherit",stepsTriggerInteractive:"cursor-pointer hover:bg-accent/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",stepsTriggerDisabled:"!cursor-not-allowed opacity-60",stepsIndicator:"relative z-[1] inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",stepsIndicatorPending:"border-border bg-background text-muted-foreground",stepsIndicatorCurrent:"border-primary/50 bg-primary/10 text-primary",stepsIndicatorCompleted:"border-primary bg-primary text-primary-foreground",stepsIndicatorError:"border-destructive bg-destructive text-destructive-foreground",stepsContent:"grid min-w-0 gap-1 pt-0.5",stepsLabel:"min-w-0 break-words text-sm font-medium leading-5",stepsDescription:"min-w-0 break-words text-sm leading-5 text-muted-foreground",stepsStatus:"sr-only",stepsConnector:"shrink-0 bg-border",stepsConnectorHorizontal:"mt-3.5 h-px w-8",stepsConnectorVertical:"absolute bottom-0 top-8 start-3.5 w-px -translate-x-1/2",stepsConnectorCompleted:"bg-primary/60",stepsConnectorError:"bg-destructive/60",scrollAreaViewport:"min-h-0 min-w-0",numberInputControl:"tabular-nums",numberInputStepControls:"me-1 flex shrink-0 self-stretch overflow-hidden border-s border-border",numberInputStepButton:"flex min-h-6 w-7 cursor-pointer items-center justify-center border-0 bg-transparent px-1 text-xs leading-none text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:z-[1] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-40",passwordInputControl:"pe-2",passwordInputToggle:"me-1 inline-flex min-h-7 shrink-0 cursor-pointer items-center justify-center rounded px-2 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-40",inputGroupRoot:m("relative flex min-w-0 items-stretch overflow-hidden rounded-md border border-border bg-background text-foreground focus-within:border-primary/50 focus-within:ring-2 focus-within:ring-ring/30",to),inputGroupInvalid:"border-destructive/55 focus-within:border-destructive/70 focus-within:ring-destructive/25",inputGroupDisabled:"!cursor-not-allowed bg-muted/35",inputGroupContent:"flex min-w-0 flex-1 items-stretch [&>*]:min-w-0",inputGroupStartElement:"inline-flex shrink-0 items-center justify-center ps-3 pe-1 text-foreground/75",inputGroupEndElement:"inline-flex shrink-0 items-center justify-center ps-1 pe-3 text-foreground/75",inputGroupStartAddon:"inline-flex max-w-[min(40%,16rem)] shrink-0 items-center overflow-hidden border-e border-border bg-muted/60 px-3 text-sm text-foreground/75 text-ellipsis whitespace-nowrap [&>*]:min-w-0",inputGroupEndAddon:"inline-flex max-w-[min(40%,16rem)] shrink-0 items-center overflow-hidden border-s border-border bg-muted/60 px-3 text-sm text-foreground/75 text-ellipsis whitespace-nowrap [&>*]:min-w-0",panelRoot:m("group relative flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background",yr),panelInteractive:"cursor-pointer hover:shadow-md",panelSelected:"border-primary/45 bg-primary/5",panelDisabled:"!cursor-not-allowed opacity-60",panelMedia:"shrink-0 overflow-hidden",panelHeader:"min-w-0 p-token-lg",panelTitle:"min-w-0 truncate text-sm font-semibold leading-none text-foreground",panelDescription:"mt-1 text-sm leading-5 text-foreground/75",panelBody:"min-w-0 px-token-lg pb-token-lg text-sm text-foreground",panelBodyStandalone:"pt-token-lg",panelFooter:"shrink-0 border-t border-border/60 px-token-lg py-token-md",stateRoot:m("flex min-h-48 flex-col items-center justify-center rounded-lg border border-border/70 bg-background px-6 py-10 text-center",to),stateIcon:"mb-token-lg flex h-12 w-12 items-center justify-center rounded-full bg-muted text-muted-foreground motion-safe:animate-in motion-safe:fade-in",stateTitle:"text-sm font-semibold text-foreground",stateDescription:"mt-2 max-w-md text-sm leading-6 text-muted-foreground",stateActions:"mt-token-xl flex flex-wrap items-center justify-center gap-token-sm",loadingSpinner:"h-5 w-5 motion-safe:animate-spin motion-reduce:animate-none",fieldRoot:"grid min-w-0 gap-token-md",fieldLabelRow:"flex min-w-0 items-center justify-between gap-token-md",fieldLabel:"min-w-0 text-sm font-medium leading-none text-foreground",fieldRequired:"text-destructive-text",fieldDescription:"text-sm leading-5 text-muted-foreground",fieldMessage:"text-sm leading-5 text-muted-foreground",fieldControl:"min-w-0",controlWrapper:m("relative flex min-w-0 items-center rounded-md border border-border bg-background text-foreground focus-within:border-primary/35",to),controlBase:"min-w-0 flex-1 bg-transparent px-3 text-sm text-foreground outline-hidden placeholder:text-muted-foreground disabled:!cursor-not-allowed",controlInput:"h-9",controlTextarea:"min-h-24 resize-y py-2 leading-6",controlSelect:"h-9 cursor-pointer appearance-none pr-9 disabled:!cursor-not-allowed",controlIcon:"pointer-events-none ml-3 inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",controlTrailing:"mr-3 inline-flex shrink-0 items-center justify-center text-muted-foreground",controlInvalid:"border-destructive/45 focus-within:border-destructive/60",controlDisabled:"!cursor-not-allowed opacity-60",controlReadOnly:"bg-muted/35",selectChevron:m("pointer-events-none absolute right-3 top-1/2 h-2 w-2 -translate-y-1/2 rotate-45 border-b border-r border-current text-muted-foreground",Bd),selectMenu:"absolute left-0 right-0 top-[calc(100%+0.375rem)] z-50 max-h-60 overflow-auto rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden",selectOption:m("flex min-h-8 w-full min-w-0 cursor-pointer items-center rounded-sm px-2.5 py-1.5 text-left text-sm text-foreground",yr),selectOptionActive:"bg-accent text-accent-foreground",selectOptionSelected:"bg-primary/10 text-primary",selectOptionDisabled:"!cursor-not-allowed opacity-50",selectPlaceholder:"text-muted-foreground",selectNative:"sr-only",switchRoot:"inline-flex min-w-0 cursor-pointer items-start gap-3",switchInput:"sr-only",switchTrack:m("relative mt-0.5 inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-border bg-muted focus-within:border-primary/35",to),switchThumb:m("h-4 w-4 translate-x-1 rounded-full bg-background shadow-sm",Bd),switchChecked:"border-primary/40 bg-primary/80 text-primary-foreground",switchDisabled:"!cursor-not-allowed opacity-60",switchContent:"grid min-w-0 gap-1",switchLabel:"text-sm font-medium leading-none text-foreground",switchDescription:"text-sm leading-5 text-muted-foreground",checkboxRoot:"inline-flex min-w-0 cursor-pointer items-start gap-3",checkboxInput:"sr-only",checkboxBox:m("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border border-border bg-background text-primary focus-within:border-primary/40",to),checkboxBoxChecked:"border-primary/45 bg-primary text-primary-foreground",checkboxBoxInvalid:"border-destructive/50",checkboxIndicator:"text-xs font-bold leading-none",checkboxDisabled:"!cursor-not-allowed opacity-60",checkboxContent:"grid min-w-0 gap-1",checkboxLabel:"text-sm font-medium leading-none text-foreground",checkboxDescription:"text-sm leading-5 text-muted-foreground",radioGroupRoot:"grid min-w-0 gap-2",radioOption:m("inline-flex min-w-0 cursor-pointer items-start gap-3 rounded-md border border-border/60 bg-background px-3 py-2 text-sm",yr,"hover:bg-muted/35"),radioInput:"sr-only",radioMarker:m("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border bg-background text-primary focus-within:border-primary/40",to),radioMarkerChecked:"border-primary/50 bg-primary/10",radioIndicator:"h-2 w-2 rounded-full bg-primary",radioOptionDisabled:"!cursor-not-allowed opacity-60 hover:bg-background",radioContent:"grid min-w-0 gap-1",radioLabel:"text-sm font-medium leading-none text-foreground",radioDescription:"text-sm leading-5 text-muted-foreground",dialogRoot:"relative",dialogTrigger:"",dialogTriggerDisabled:"!cursor-not-allowed opacity-60",dialogOverlay:"fixed inset-0 z-50 bg-background/70 backdrop-blur-sm motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",dialogContent:"pointer-events-none fixed inset-0 z-50 flex min-h-0 items-center justify-center p-4",dialogPanel:m("pointer-events-auto relative flex max-h-[min(85vh,720px)] w-full max-w-lg min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background text-foreground shadow-xl","motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out"),dialogHeader:"grid min-w-0 gap-1 border-b border-border/60 px-5 py-4",dialogTitle:"min-w-0 pr-8 text-base font-semibold leading-6 text-foreground",dialogDescription:"text-sm leading-6 text-muted-foreground",dialogBody:"min-h-0 min-w-0 overflow-auto px-5 py-4 text-sm text-foreground",dialogFooter:"flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border/60 px-5 py-4",dialogClose:m("absolute right-3 top-3 inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",yr),dropdownRoot:"relative inline-flex min-w-0",dropdownTrigger:"",dropdownTriggerDisabled:"!cursor-not-allowed opacity-60",dropdownMenu:"z-50 min-w-48 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",dropdownMenuTop:"bottom-[calc(100%+0.375rem)] top-auto",dropdownMenuEnd:"left-auto right-0",dropdownLabel:"px-2.5 py-1.5 text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",dropdownSeparator:"my-1 h-px bg-border/70",dropdownItem:m("flex min-w-0 cursor-pointer items-center gap-2 rounded-sm px-2.5 py-2 text-left text-sm text-foreground hover:bg-accent/60 focus:bg-accent/60 data-[highlighted]:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",yr),dropdownItemDanger:"text-destructive-text hover:bg-destructive/10 focus:bg-destructive/10 data-[highlighted]:bg-destructive/10",dropdownItemDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent focus:bg-transparent data-[highlighted]:bg-transparent",dropdownItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",dropdownItemContent:"grid min-w-0 flex-1 gap-0.5",dropdownItemLabel:"min-w-0 truncate",dropdownItemDescription:"min-w-0 truncate text-xs leading-4 text-muted-foreground",dropdownItemShortcut:"ml-3 shrink-0 text-xs font-medium text-muted-foreground",tooltipRoot:"relative inline-flex min-w-0",tooltipTrigger:"inline-flex min-w-0",tooltipContent:"pointer-events-none z-50 max-w-xs rounded-md border border-border bg-popover px-2.5 py-1.5 text-xs leading-5 text-popover-foreground shadow-lg motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",noticeBase:m("flex min-w-0 gap-3 rounded-lg border px-4 py-3 text-sm",to,"motion-safe:animate-in motion-safe:fade-in"),noticeDefault:"border-border bg-background text-foreground",noticePrimary:"border-primary/25 bg-primary/10 text-primary",noticeSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-foreground",noticeWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",noticeDanger:"border-destructive/30 bg-destructive/10 text-destructive-text",noticeMuted:"border-border/60 bg-muted/35 text-muted-foreground",noticeIcon:"mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center motion-safe:animate-in motion-safe:fade-in",noticeTitle:"font-semibold leading-5",noticeDescription:"leading-6",noticeActions:"mt-3 flex flex-wrap items-center gap-2",dividerRoot:m("shrink-0 border-border/70",to),dividerLabel:"mx-3 shrink-0 text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground motion-safe:animate-in motion-safe:fade-in",sectionHeaderRoot:"flex min-w-0 flex-wrap items-start justify-between gap-token-md motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",sectionHeaderContent:"grid min-w-0 gap-1",sectionHeaderEyebrow:"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",sectionHeaderTitle:"text-base font-semibold leading-6 text-foreground",sectionHeaderDescription:"max-w-2xl text-sm leading-6 text-muted-foreground",sectionHeaderActions:"flex shrink-0 flex-wrap items-center gap-2",tabsRoot:"grid min-w-0 gap-token-md",tabsList:m("inline-flex min-w-0 flex-wrap items-center gap-token-xs rounded-lg border border-border/70 bg-muted/30 p-token-xs",to),tabsTrigger:m("inline-flex min-w-0 cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-background/70 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-1 motion-reduce:transition-none",yr),tabsTriggerActive:"bg-background text-foreground shadow-sm",tabsTriggerDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent",tabsPanel:"min-w-0 rounded-lg border border-border/70 bg-background p-4 text-sm text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",segmentedRoot:m("inline-flex min-w-0 items-center gap-1 rounded-lg border border-border/70 bg-muted/30 p-1",to),segmentedItem:m("inline-flex min-w-0 cursor-pointer items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-background/70 hover:text-foreground focus-visible:outline-hidden",yr),segmentedItemActive:"bg-background text-foreground shadow-sm",segmentedItemDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent",progressRoot:"grid min-w-0 gap-2",progressTrack:"h-2 w-full overflow-hidden rounded-full bg-muted",progressIndicator:"h-full rounded-full bg-primary motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-out",progressLabelRow:"flex min-w-0 items-center justify-between gap-3",progressLabel:"min-w-0 truncate text-sm font-medium text-foreground",progressValue:"shrink-0 text-xs font-medium text-muted-foreground",skeletonRoot:"relative overflow-hidden rounded-md bg-muted/70",avatarRoot:"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-border bg-muted text-sm font-semibold text-muted-foreground motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",avatarImage:"h-full w-full object-cover",avatarFallback:"flex h-full w-full items-center justify-center bg-muted text-foreground",avatarStatus:"absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-muted-foreground motion-safe:animate-pulse",avatarText:"min-w-0 truncate text-sm font-medium text-foreground",toolbarRoot:m("flex min-w-0 flex-wrap items-center justify-between gap-token-md rounded-lg border border-border/70 bg-background px-token-lg py-token-md",to),toolbarLeading:"flex min-w-0 items-center gap-token-md",toolbarTitle:"min-w-0 truncate text-sm font-semibold text-foreground",toolbarDescription:"mt-0.5 text-sm leading-5 text-muted-foreground",toolbarContent:"min-w-0 flex-1",toolbarActions:"flex shrink-0 flex-wrap items-center gap-token-sm",breadcrumbRoot:"min-w-0 text-sm text-muted-foreground",breadcrumbList:"flex min-w-0 flex-wrap items-center gap-1.5",breadcrumbItem:"inline-flex min-w-0 items-center gap-1.5",breadcrumbLink:"min-w-0 cursor-pointer truncate text-muted-foreground hover:text-foreground disabled:!cursor-not-allowed disabled:opacity-50 aria-disabled:!cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:text-muted-foreground motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",breadcrumbCurrent:"min-w-0 truncate font-medium text-foreground",breadcrumbSeparator:"shrink-0 text-muted-foreground/70",paginationRoot:"flex min-w-0 flex-wrap items-center justify-between gap-3 text-sm",paginationInfo:"min-w-0 text-muted-foreground",paginationControls:"flex min-w-0 flex-wrap items-center justify-end gap-1.5",paginationButton:"inline-flex h-8 min-w-8 cursor-pointer items-center justify-center whitespace-nowrap rounded-md border border-border bg-background px-2.5 text-sm font-medium text-foreground hover:bg-accent/60 disabled:!cursor-not-allowed disabled:opacity-50 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",paginationButtonDisabled:"!cursor-not-allowed opacity-50",paginationPage:"inline-flex h-8 min-w-8 cursor-default items-center justify-center rounded-md bg-muted/50 px-2.5 text-sm font-medium text-foreground hover:bg-muted/50",paginationEllipsis:"inline-flex h-8 min-w-6 items-center justify-center px-1 text-sm text-muted-foreground",descriptionListRoot:"grid min-w-0 gap-3 text-sm",descriptionListItem:"grid min-w-0 gap-1 rounded-md border border-border/60 bg-background px-3 py-2 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out hover:shadow-sm",descriptionListTerm:"min-w-0 truncate text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",descriptionListValue:"min-w-0 text-sm leading-6 text-foreground",accordionRoot:"grid min-w-0 gap-2",accordionItem:"overflow-hidden rounded-lg border border-border/70 bg-background motion-safe:transition motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",accordionTrigger:"flex w-full min-w-0 cursor-pointer items-center justify-between gap-3 px-4 py-3 text-start text-sm font-medium text-foreground hover:bg-muted/40 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-50 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",accordionTriggerIcon:m("h-2 w-2 shrink-0 rotate-45 border-b border-r border-current text-muted-foreground",Bd,"motion-reduce:transition-none"),accordionPanel:"border-t border-border/60 px-4 py-3 text-sm leading-6 text-muted-foreground motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out motion-reduce:animate-none",menuTrigger:"inline-flex min-w-0",menuContent:"z-50 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out",menuLabel:"px-2 py-1.5 text-xs font-medium text-muted-foreground",menuSeparator:"-mx-1 my-1 h-px bg-border",menuItem:m("relative flex min-h-8 min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm text-foreground outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:!cursor-not-allowed data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",yr),menuItemDefault:"text-foreground",menuItemPrimary:"text-primary focus:text-primary data-[highlighted]:text-primary",menuItemSuccess:"text-[hsl(var(--success,142_72%_29%))] focus:text-[hsl(var(--success,142_72%_29%))] data-[highlighted]:text-[hsl(var(--success,142_72%_29%))]",menuItemWarning:"text-[hsl(var(--warning-foreground,28_73%_26%))] focus:text-[hsl(var(--warning-foreground,28_73%_26%))] data-[highlighted]:text-[hsl(var(--warning-foreground,28_73%_26%))]",menuItemDanger:"text-destructive-text focus:text-destructive-text data-[highlighted]:text-destructive-text",menuItemMuted:"text-muted-foreground focus:text-foreground data-[highlighted]:text-foreground",menuItemDisabled:"!cursor-not-allowed opacity-50 data-[disabled]:pointer-events-none",menuItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",menuItemLabel:"min-w-0 flex-1 truncate",menuItemShortcut:"ml-4 shrink-0 text-xs font-medium text-muted-foreground",menuCheckboxIndicator:"absolute left-2 inline-flex h-4 w-4 items-center justify-center text-current",menuRadioIndicator:"absolute left-2 inline-flex h-4 w-4 items-center justify-center text-current",menuSubTrigger:m("relative flex min-h-8 min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm text-foreground outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:!cursor-not-allowed data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",yr),menuSubTriggerIcon:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",menuSubContent:"z-50 min-w-40 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out",tableContainer:m("relative isolate min-w-0 overflow-auto rounded-lg border border-border/70 bg-background/95 bg-clip-padding [scrollbar-gutter:stable]","[--base-table-header-height:2.75rem] [--base-table-split-scrollbar-gutter:0.75rem]","[--base-table-sticky-header-bg:hsl(var(--background))] [--base-table-header-separator:hsl(var(--border)_/_0.7)]",Mh,to),tableContainerFooterAttached:"!rounded-b-none !shadow-none",tableRoot:"w-full caption-bottom border-separate border-spacing-0 text-sm text-foreground",tableCaption:"mt-3 text-sm text-muted-foreground",tableHeader:m("relative z-[2] bg-transparent [&_tr]:bg-transparent",AN),tableBody:"[&_tr:last-child>*]:border-b-0",tableFooter:"bg-muted/30 font-medium [&_tr>*]:border-t [&_tr>*]:border-border/70",tableFooterBar:m("flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-lg border border-border/70 bg-muted/20 px-4 py-3 text-sm text-foreground shadow-none",to),tableFooterBarAttached:"-mt-px rounded-t-none border-t border-border/70 shadow-none",tableFooterBarLeading:"flex min-w-0 items-center gap-2",tableFooterBarContent:"min-w-0 flex-1",tableFooterBarActions:"ms-auto flex shrink-0 flex-wrap items-center gap-2",tableSplitRoot:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)_auto] caption-bottom border-separate border-spacing-0 text-sm text-foreground",tableSplitHeader:"block w-full min-w-0 shrink-0 overflow-x-hidden overflow-y-hidden bg-transparent",tableSplitBody:m("block min-h-0 w-full min-w-0 max-w-full justify-self-stretch overflow-auto [scrollbar-gutter:stable]",Mh),tableSplitFooter:"block w-full min-w-0 shrink-0 overflow-x-hidden overflow-y-hidden",tableSplitRow:"grid w-max min-w-full [grid-template-columns:var(--base-table-column-template)]",tableSplitHead:"flex min-w-0 overflow-hidden",tableSplitCell:"block min-w-0 overflow-hidden [overflow-wrap:anywhere]",tableRow:m("[&>*]:border-b [&>*]:border-border/60 data-[state=selected]:bg-primary/5 data-[state=selected]:[&>*]:bg-primary/5",to),tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.35)] hover:bg-[var(--base-table-row-hover-bg)] hover:[&>*]:bg-[var(--base-table-row-hover-bg)]",tableRowSelected:"bg-primary/5 [&>*]:bg-primary/5",tableRowDisabled:"!cursor-not-allowed opacity-60",tableHead:"relative h-11 whitespace-nowrap px-3 py-2 text-left align-middle text-xs font-semibold text-muted-foreground shadow-[inset_0_-1px_0_var(--base-table-header-separator)]",tableHeadContent:"flex min-w-0 items-center justify-between gap-2",tableHeadMain:"flex min-w-0 items-center gap-2",tableHeadIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",tableHeadText:"grid min-w-0 gap-0.5",tableHeadLabel:"min-w-0 truncate text-xs font-semibold leading-4 text-foreground",tableHeadDescription:"min-w-0 truncate text-xs font-normal leading-4 text-muted-foreground",tableHeadMeta:"shrink-0 text-xs font-medium text-muted-foreground",tableHeadActions:"flex shrink-0 items-center gap-1",tableHeadSortButton:m("inline-flex min-w-0 cursor-pointer items-center gap-1 rounded-sm text-left focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-60",to),tableHeadSortIcon:m("inline-flex h-3 w-3 shrink-0 items-center justify-center text-muted-foreground",Bd),tableHeadDragHandle:m("inline-flex h-5 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-muted-foreground hover:bg-muted active:cursor-grabbing focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-50",to),tableHeadResizeHandle:m("absolute end-0 top-1/2 h-7 w-2 -translate-y-1/2 cursor-col-resize touch-none rounded-sm after:absolute after:start-1/2 after:top-1/2 after:h-5 after:w-px after:-translate-x-1/2 after:-translate-y-1/2 after:bg-border hover:after:bg-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-50",to),tableCell:"min-w-0 px-3 py-2 align-middle text-sm text-foreground [overflow-wrap:anywhere]",tableCellAlignCenter:"text-center",tableCellAlignRight:"text-right",tableEmptyRow:"[&>*]:border-b [&>*]:border-border/60",tableEmptyCell:"px-4 py-10 text-center",tableEmptyContent:"mx-auto flex max-w-md flex-col items-center justify-center text-center",tableEmptyIcon:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-muted text-muted-foreground",tableEmptyTitle:"text-sm font-semibold text-foreground",tableEmptyDescription:"mt-1 text-sm leading-6 text-muted-foreground",tableEmptyActions:"mt-4 flex flex-wrap items-center justify-center gap-2",tableLoadingRow:"[&>*]:border-b [&>*]:border-border/60",tableLoadingCell:"px-3 py-2",tableLoadingSkeleton:"h-4 w-full rounded-md bg-muted/70",layoutRoot:m("grid min-w-0 overflow-hidden grid-rows-[auto_minmax(0,1fr)_auto] gap-3 rounded-lg border border-border/70 bg-background p-3 text-foreground",to),layoutRootFull:"h-full min-h-0",layoutHeader:"min-w-0",layoutBody:"grid min-h-0 min-w-0 overflow-hidden gap-token-md",layoutSidebar:"min-h-0 min-w-0 overflow-hidden",layoutMain:"min-h-0 min-w-0 overflow-hidden",layoutAside:"min-h-0 min-w-0 overflow-hidden",layoutFooter:"min-w-0",layoutPane:m("h-full max-h-full min-h-0 min-w-0 overflow-hidden rounded-lg bg-background text-foreground",to),layoutPaneScrollable:"overflow-auto",layoutPaneBordered:"border border-border/70",layoutPaneMuted:"bg-muted/25",layoutPaneSoft:"bg-background/95 shadow-sm",layoutPaneTransparent:"bg-transparent shadow-none",layoutSplitRoot:"grid min-h-0 min-w-0 overflow-hidden",layoutSplitHorizontal:"grid-flow-col",layoutSplitVertical:"grid-flow-row",layoutSplitPane:"min-h-0 min-w-0 overflow-hidden",layoutSplitPrimary:"",layoutSplitSecondary:"",layoutResizeHandle:m("group/resize relative z-10 flex shrink-0 items-center justify-center bg-transparent text-muted-foreground hover:bg-border/60 active:bg-border/70 focus-visible:bg-border/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",yr),layoutResizeHandleHorizontal:"w-2 cursor-col-resize",layoutResizeHandleVertical:"h-2 cursor-row-resize",layoutResizeHandleDisabled:"cursor-default opacity-60",layoutResizeHandleIndicator:"rounded-full bg-muted-foreground/45 group-hover/resize:bg-primary/70"},BN={compact:{buttonBase:"h-8 px-2.5 text-xs",buttonIconOnly:"h-8 w-8 px-0",badgeBase:"px-1.5 py-0 text-xs",panelHeader:"p-token-md",panelBody:"px-token-md pb-token-md text-xs",panelBodyStandalone:"pt-token-md",panelFooter:"px-token-md py-token-md",stateRoot:"min-h-36 px-4 py-7",stateIcon:"mb-3 h-10 w-10",fieldRoot:"gap-token-sm",fieldLabel:"text-xs",fieldDescription:"text-xs leading-5",fieldMessage:"text-xs leading-5",controlInput:"h-8 text-xs",controlTextarea:"min-h-20 text-xs",controlSelect:"h-8 text-xs",selectMenu:"text-xs",selectOption:"min-h-7 px-2 py-1 text-xs",switchTrack:"h-5 w-9",switchThumb:"h-3.5 w-3.5",checkboxBox:"h-3.5 w-3.5",checkboxLabel:"text-xs",checkboxDescription:"text-xs leading-5",radioOption:"px-2 py-1.5 text-xs",radioMarker:"h-3.5 w-3.5",radioIndicator:"h-1.5 w-1.5",radioLabel:"text-xs",radioDescription:"text-xs leading-5",dialogPanel:"max-w-md",dialogHeader:"px-4 py-3",dialogTitle:"text-sm leading-5",dialogDescription:"text-xs leading-5",dialogBody:"px-4 py-3 text-xs",dialogFooter:"px-4 py-3",dropdownMenu:"min-w-44 text-xs",dropdownItem:"px-2 py-1.5 text-xs",tooltipContent:"text-xs leading-4",noticeBase:"px-3 py-2 text-xs",dividerLabel:"text-xs",sectionHeaderRoot:"gap-token-sm",sectionHeaderTitle:"text-sm leading-5",sectionHeaderDescription:"text-xs leading-5",tabsList:"gap-token-xs p-token-xs",tabsTrigger:"px-2 py-1 text-xs",tabsPanel:"p-3 text-xs",segmentedRoot:"gap-token-xs p-token-xs",segmentedItem:"px-2 py-1 text-xs",progressTrack:"h-1.5",avatarRoot:"text-xs",toolbarRoot:"gap-token-sm px-token-md py-token-md",toolbarTitle:"text-xs",toolbarDescription:"text-xs leading-5",paginationButton:"h-7 min-w-7 px-2 text-xs",paginationPage:"h-7 min-w-7 px-2 text-xs",descriptionListRoot:"gap-2 text-xs",descriptionListItem:"px-2 py-1.5",descriptionListTerm:"text-xs",descriptionListValue:"text-xs leading-5",accordionTrigger:"px-3 py-2 text-xs",accordionPanel:"px-3 py-2 text-xs leading-5",menuContent:"min-w-40 p-0.5 text-xs",menuSubContent:"min-w-36 p-0.5 text-xs",menuLabel:"px-2 py-1 text-xs",menuItem:"min-h-7 px-2 py-1 text-xs",menuSubTrigger:"min-h-7 px-2 py-1 text-xs",menuItemShortcut:"text-xs",tableContainer:"[--base-table-header-height:2.25rem]",tableHead:"h-9 px-2 py-1.5 text-xs",tableCell:"px-2 py-1.5 text-xs",tableHeadLabel:"text-xs",tableHeadDescription:"text-xs leading-3",tableLoadingCell:"px-2 py-1.5",layoutRoot:"gap-token-md p-token-md",layoutBody:"gap-token-md",layoutPane:"rounded-md text-xs",layoutResizeHandleHorizontal:"w-1.5",layoutResizeHandleVertical:"h-1.5"},default:{buttonBase:"h-9"},comfortable:{buttonBase:"h-10 px-3.5",buttonIconOnly:"h-10 w-10 px-0",badgeBase:"px-2.5 py-1",panelHeader:"p-token-xl",panelBody:"px-token-xl pb-token-xl",panelBodyStandalone:"pt-token-xl",panelFooter:"px-token-xl py-token-lg",stateRoot:"min-h-56 px-8 py-12",stateIcon:"mb-5 h-14 w-14",fieldRoot:"gap-token-md",controlInput:"h-10",controlTextarea:"min-h-28",controlSelect:"h-10",selectMenu:"p-1.5",selectOption:"min-h-9 px-3 py-2",switchTrack:"h-7 w-12",switchThumb:"h-5 w-5",checkboxBox:"h-5 w-5",radioOption:"px-4 py-3",radioMarker:"h-5 w-5",radioIndicator:"h-2.5 w-2.5",dialogPanel:"max-w-xl",dialogHeader:"px-6 py-5",dialogBody:"px-6 py-5",dialogFooter:"px-6 py-5",dropdownMenu:"min-w-56",dropdownItem:"px-3 py-2.5",noticeBase:"px-5 py-4",sectionHeaderTitle:"text-lg leading-7",tabsTrigger:"px-3.5 py-2",tabsPanel:"p-5",segmentedItem:"px-3.5 py-2",progressTrack:"h-2.5",toolbarRoot:"px-token-xl py-token-lg",paginationButton:"h-9 min-w-9 px-3",paginationPage:"h-9 min-w-9 px-3",descriptionListItem:"px-4 py-3",accordionTrigger:"px-5 py-4",accordionPanel:"px-5 py-4",menuContent:"min-w-48 p-1.5",menuSubContent:"min-w-44 p-1.5",menuItem:"min-h-9 px-3 py-2",menuSubTrigger:"min-h-9 px-3 py-2",tableContainer:"[--base-table-header-height:3rem]",tableHead:"h-12 px-4 py-3",tableCell:"px-4 py-3",tableLoadingCell:"px-4 py-3",layoutRoot:"gap-token-lg p-token-lg",layoutBody:"gap-token-lg",layoutPane:"rounded-xl",layoutResizeHandleHorizontal:"w-2.5",layoutResizeHandleVertical:"h-2.5"}},LN={none:{buttonBase:"rounded-none",badgeBase:"rounded-none",panelRoot:"rounded-none",stateRoot:"rounded-none",stateIcon:"rounded-none",controlWrapper:"rounded-none",selectMenu:"rounded-none",selectOption:"rounded-none",switchTrack:"rounded-none",switchThumb:"rounded-none",checkboxBox:"rounded-none",radioOption:"rounded-none",dialogPanel:"rounded-none",dialogClose:"rounded-none",dropdownMenu:"rounded-none",dropdownItem:"rounded-none",tooltipContent:"rounded-none",noticeBase:"rounded-none",tabsList:"rounded-none",tabsTrigger:"rounded-none",tabsPanel:"rounded-none",segmentedRoot:"rounded-none",segmentedItem:"rounded-none",progressTrack:"rounded-none",progressIndicator:"rounded-none",skeletonRoot:"rounded-none",avatarRoot:"rounded-none",avatarStatus:"rounded-none",toolbarRoot:"rounded-none",paginationButton:"rounded-none",paginationPage:"rounded-none",descriptionListItem:"rounded-none",accordionItem:"rounded-none",menuContent:"rounded-none",menuItem:"rounded-none",menuSubTrigger:"rounded-none",menuSubContent:"rounded-none",tableContainer:"rounded-none",tableEmptyIcon:"rounded-none",tableLoadingSkeleton:"rounded-none",layoutRoot:"rounded-none",layoutPane:"rounded-none"},sm:{buttonBase:"rounded-sm",badgeBase:"rounded-sm",panelRoot:"rounded-sm",stateRoot:"rounded-sm",stateIcon:"rounded-sm",controlWrapper:"rounded-sm",selectMenu:"rounded-sm",selectOption:"rounded-sm",switchTrack:"rounded-sm",switchThumb:"rounded-sm",checkboxBox:"rounded-sm",radioOption:"rounded-sm",dialogPanel:"rounded-sm",dialogClose:"rounded-sm",dropdownMenu:"rounded-sm",dropdownItem:"rounded-sm",tooltipContent:"rounded-sm",noticeBase:"rounded-sm",tabsList:"rounded-sm",tabsTrigger:"rounded-sm",tabsPanel:"rounded-sm",segmentedRoot:"rounded-sm",segmentedItem:"rounded-sm",progressTrack:"rounded-sm",progressIndicator:"rounded-sm",skeletonRoot:"rounded-sm",avatarRoot:"rounded-sm",avatarStatus:"rounded-sm",toolbarRoot:"rounded-sm",paginationButton:"rounded-sm",paginationPage:"rounded-sm",descriptionListItem:"rounded-sm",accordionItem:"rounded-sm",menuContent:"rounded-sm",menuItem:"rounded-sm",menuSubTrigger:"rounded-sm",menuSubContent:"rounded-sm",tableContainer:"rounded-sm",tableEmptyIcon:"rounded-sm",tableLoadingSkeleton:"rounded-sm",layoutRoot:"rounded-sm",layoutPane:"rounded-sm"},md:{},lg:{buttonBase:"rounded-lg",badgeBase:"rounded-lg",panelRoot:"rounded-xl",stateRoot:"rounded-xl",stateIcon:"rounded-xl",controlWrapper:"rounded-lg",selectMenu:"rounded-lg",selectOption:"rounded-md",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-md",radioOption:"rounded-xl",dialogPanel:"rounded-xl",dialogClose:"rounded-lg",dropdownMenu:"rounded-lg",dropdownItem:"rounded-md",tooltipContent:"rounded-md",noticeBase:"rounded-xl",tabsList:"rounded-xl",tabsTrigger:"rounded-lg",tabsPanel:"rounded-xl",segmentedRoot:"rounded-xl",segmentedItem:"rounded-lg",skeletonRoot:"rounded-lg",toolbarRoot:"rounded-xl",descriptionListItem:"rounded-lg",accordionItem:"rounded-xl",menuContent:"rounded-lg",menuItem:"rounded-md",menuSubTrigger:"rounded-md",menuSubContent:"rounded-lg",tableContainer:"rounded-xl",tableEmptyIcon:"rounded-xl",tableLoadingSkeleton:"rounded-lg",layoutRoot:"rounded-xl",layoutPane:"rounded-xl"},xl:{buttonBase:"rounded-xl",badgeBase:"rounded-xl",panelRoot:"rounded-2xl",stateRoot:"rounded-2xl",stateIcon:"rounded-2xl",controlWrapper:"rounded-xl",selectMenu:"rounded-xl",selectOption:"rounded-lg",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-lg",radioOption:"rounded-2xl",dialogPanel:"rounded-2xl",dialogClose:"rounded-xl",dropdownMenu:"rounded-xl",dropdownItem:"rounded-lg",tooltipContent:"rounded-lg",noticeBase:"rounded-2xl",tabsList:"rounded-2xl",tabsTrigger:"rounded-xl",tabsPanel:"rounded-2xl",segmentedRoot:"rounded-2xl",segmentedItem:"rounded-xl",skeletonRoot:"rounded-xl",toolbarRoot:"rounded-2xl",paginationButton:"rounded-xl",paginationPage:"rounded-xl",descriptionListItem:"rounded-xl",accordionItem:"rounded-2xl",menuContent:"rounded-xl",menuItem:"rounded-lg",menuSubTrigger:"rounded-lg",menuSubContent:"rounded-xl",tableContainer:"rounded-2xl",tableEmptyIcon:"rounded-2xl",tableLoadingSkeleton:"rounded-xl",layoutRoot:"rounded-2xl",layoutPane:"rounded-2xl"},full:{buttonBase:"rounded-full",badgeBase:"rounded-full",panelRoot:"rounded-2xl",stateRoot:"rounded-2xl",stateIcon:"rounded-full",controlWrapper:"rounded-full",selectMenu:"rounded-2xl",selectOption:"rounded-full",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-full",radioOption:"rounded-2xl",dialogPanel:"rounded-2xl",dialogClose:"rounded-full",dropdownMenu:"rounded-2xl",dropdownItem:"rounded-full",tooltipContent:"rounded-full",noticeBase:"rounded-2xl",tabsList:"rounded-full",tabsTrigger:"rounded-full",tabsPanel:"rounded-2xl",segmentedRoot:"rounded-full",segmentedItem:"rounded-full",progressTrack:"rounded-full",progressIndicator:"rounded-full",skeletonRoot:"rounded-full",avatarRoot:"rounded-full",avatarStatus:"rounded-full",toolbarRoot:"rounded-2xl",paginationButton:"rounded-full",paginationPage:"rounded-full",descriptionListItem:"rounded-2xl",accordionItem:"rounded-2xl",menuContent:"rounded-2xl",menuItem:"rounded-full",menuSubTrigger:"rounded-full",menuSubContent:"rounded-2xl",tableContainer:"rounded-2xl",tableEmptyIcon:"rounded-full",tableLoadingSkeleton:"rounded-full",layoutRoot:"rounded-2xl",layoutPane:"rounded-2xl"}},WN={none:{buttonBase:"border-transparent",badgeBase:"border-transparent",panelRoot:"border-transparent",panelFooter:"border-transparent",stateRoot:"border-transparent",controlWrapper:"border-transparent",selectMenu:"border-transparent",switchTrack:"border-transparent",checkboxBox:"border-transparent",radioOption:"border-transparent",radioMarker:"border-transparent",dialogPanel:"border-transparent",dialogHeader:"border-transparent",dialogFooter:"border-transparent",dropdownMenu:"border-transparent",tooltipContent:"border-transparent",noticeBase:"border-transparent",dividerRoot:"border-transparent",tabsList:"border-transparent",tabsPanel:"border-transparent",segmentedRoot:"border-transparent",avatarRoot:"border-transparent",toolbarRoot:"border-transparent",paginationButton:"border-transparent",descriptionListItem:"border-transparent",accordionItem:"border-transparent",accordionPanel:"border-transparent",menuContent:"border-transparent",menuSeparator:"bg-transparent",menuSubContent:"border-transparent",tableContainer:"border-transparent [--base-table-header-separator:transparent]",tableHeader:"border-transparent",tableFooter:"[&_tr>*]:border-transparent",tableFooterBar:"border-transparent",tableFooterBarAttached:"border-t border-transparent",tableRow:"[&>*]:border-transparent",tableEmptyRow:"[&>*]:border-transparent",tableLoadingRow:"[&>*]:border-transparent",layoutRoot:"border-transparent",layoutPaneBordered:"border-transparent",layoutResizeHandle:"bg-transparent hover:bg-transparent active:bg-transparent focus-visible:bg-transparent"},subtle:{buttonDefault:"border-border/60",badgeDefault:"border-border/60",panelRoot:"border-border/60",panelFooter:"border-border/60",stateRoot:"border-border/60",controlWrapper:"border-border/60",selectMenu:"border-border/60",switchTrack:"border-border/60",checkboxBox:"border-border/60",radioOption:"border-border/60",radioMarker:"border-border/60",dialogPanel:"border-border/60",dialogHeader:"border-border/60",dialogFooter:"border-border/60",dropdownMenu:"border-border/60",tooltipContent:"border-border/60",noticeDefault:"border-border/60",dividerRoot:"border-border/60",tabsList:"border-border/60",tabsPanel:"border-border/60",segmentedRoot:"border-border/60",avatarRoot:"border-border/60",toolbarRoot:"border-border/60",paginationButton:"border-border/60",descriptionListItem:"border-border/60",accordionItem:"border-border/60",accordionPanel:"border-border/60",menuContent:"border-border/60",menuSeparator:"bg-border/60",menuSubContent:"border-border/60",tableContainer:"border-border/60 [--base-table-header-separator:hsl(var(--border)_/_0.6)]",tableHeader:"border-border/60",tableFooter:"[&_tr>*]:border-border/60",tableFooterBar:"border-border/60",tableFooterBarAttached:"border-t border-border/60",tableRow:"[&>*]:border-border/50",tableEmptyRow:"[&>*]:border-border/50",tableLoadingRow:"[&>*]:border-border/50",layoutRoot:"border-border/60",layoutPaneBordered:"border-border/60"},solid:{},strong:{buttonDefault:"border-foreground/20",badgeDefault:"border-foreground/20",panelRoot:"border-foreground/20",panelFooter:"border-foreground/20",stateRoot:"border-foreground/20",controlWrapper:"border-foreground/20",selectMenu:"border-foreground/20",switchTrack:"border-foreground/20",checkboxBox:"border-foreground/20",radioOption:"border-foreground/20",radioMarker:"border-foreground/20",dialogPanel:"border-foreground/20",dialogHeader:"border-foreground/15",dialogFooter:"border-foreground/15",dropdownMenu:"border-foreground/20",tooltipContent:"border-foreground/20",noticeDefault:"border-foreground/20",dividerRoot:"border-foreground/20",tabsList:"border-foreground/20",tabsPanel:"border-foreground/20",segmentedRoot:"border-foreground/20",avatarRoot:"border-foreground/20",toolbarRoot:"border-foreground/20",paginationButton:"border-foreground/20",descriptionListItem:"border-foreground/20",accordionItem:"border-foreground/20",accordionPanel:"border-foreground/20",menuContent:"border-foreground/20",menuSeparator:"bg-foreground/15",menuSubContent:"border-foreground/20",tableContainer:"border-foreground/20 [--base-table-header-separator:hsl(var(--foreground)_/_0.15)]",tableHeader:"border-foreground/20",tableFooter:"[&_tr>*]:border-foreground/20",tableFooterBar:"border-foreground/20",tableFooterBarAttached:"border-t border-foreground/20",tableRow:"[&>*]:border-foreground/15",tableEmptyRow:"[&>*]:border-foreground/15",tableLoadingRow:"[&>*]:border-foreground/15",layoutRoot:"border-foreground/20",layoutPaneBordered:"border-foreground/20",layoutResizeHandle:"hover:bg-foreground/15 active:bg-foreground/20 focus-visible:bg-foreground/15"}},zN={plain:{},muted:{buttonDefault:"bg-muted/20 hover:bg-muted/45",panelRoot:"bg-card",panelFooter:"bg-muted/20",stateRoot:"bg-muted/20",controlWrapper:"bg-background",selectMenu:"bg-background",selectOptionActive:"bg-muted/70 text-foreground",checkboxBox:"bg-background",radioOption:"bg-card hover:bg-muted/45",radioMarker:"bg-background",dialogPanel:"bg-card",dropdownMenu:"bg-background",dropdownItem:"hover:bg-muted/60",tooltipContent:"bg-popover",noticeDefault:"bg-muted/20",tabsList:"bg-muted/35",tabsTriggerActive:"bg-background",tabsPanel:"bg-card",segmentedRoot:"bg-muted/35",segmentedItemActive:"bg-background",progressTrack:"bg-muted/60",skeletonRoot:"bg-muted",toolbarRoot:"bg-card",paginationButton:"bg-background hover:bg-muted/60",paginationPage:"bg-muted/60",descriptionListItem:"bg-card",accordionItem:"bg-card",menuContent:"bg-background",menuItem:"focus:bg-muted/70 data-[highlighted]:bg-muted/70",menuSubTrigger:"focus:bg-muted/70 data-[highlighted]:bg-muted/70 data-[state=open]:bg-muted/70",menuSubContent:"bg-background",tableContainer:"bg-background/95 [scrollbar-gutter:stable]",tableFooter:"bg-muted/35",tableFooterBar:"bg-muted/30 shadow-none",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.45)]",tableLoadingSkeleton:"bg-muted",layoutRoot:"bg-card",layoutPane:"bg-card",layoutPaneMuted:"bg-muted/35",layoutResizeHandle:"hover:bg-border/70 active:bg-border/80 focus-visible:bg-border/70"},soft:{buttonDefault:"bg-muted/30 hover:bg-muted/55",panelRoot:"bg-background/95 shadow-sm",stateRoot:"bg-background/95 shadow-sm",controlWrapper:"bg-background/95",selectMenu:"bg-background/95 shadow-xl",selectOptionActive:"bg-muted/60 text-foreground",checkboxBox:"bg-background/95",radioOption:"bg-background/95 shadow-sm hover:bg-muted/35",radioMarker:"bg-background/95",dialogPanel:"bg-background/95 shadow-xl",dropdownMenu:"bg-background/95 shadow-xl",dropdownItem:"hover:bg-muted/55",tooltipContent:"bg-popover shadow-xl",noticeDefault:"bg-background/95 shadow-sm",tabsList:"bg-background/60 shadow-sm",tabsTriggerActive:"bg-background",tabsPanel:"bg-background/95 shadow-sm",segmentedRoot:"bg-background/60 shadow-sm",segmentedItemActive:"bg-background",skeletonRoot:"bg-background/80",toolbarRoot:"bg-background/95 shadow-sm",paginationButton:"bg-background/95 hover:bg-muted/55",descriptionListItem:"bg-background/95 shadow-sm",accordionItem:"bg-background/95 shadow-sm",menuContent:"bg-background/95 shadow-xl",menuItem:"focus:bg-muted/60 data-[highlighted]:bg-muted/60",menuSubTrigger:"focus:bg-muted/60 data-[highlighted]:bg-muted/60 data-[state=open]:bg-muted/60",menuSubContent:"bg-background/95 shadow-xl",tableContainer:"bg-background/95 shadow-sm [scrollbar-gutter:stable]",tableFooter:"bg-muted/25",tableFooterBar:"bg-muted/25 shadow-none",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.35)]",tableLoadingSkeleton:"bg-muted/65",layoutRoot:"bg-background/95 shadow-sm",layoutPane:"bg-background/95 shadow-sm",layoutPaneSoft:"bg-background/95 shadow-md"},glass:{buttonBase:"backdrop-blur-md",buttonDefault:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",badgeDefault:"border-white/10 bg-white/[0.08] text-foreground",panelRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",panelFooter:"border-white/10 bg-white/[0.05]",stateRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",stateIcon:"bg-white/10 text-foreground",controlWrapper:"border-white/10 bg-white/[0.08] text-foreground backdrop-blur-md",selectMenu:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",selectOption:"text-foreground",selectOptionActive:"bg-white/[0.14] text-foreground",selectOptionSelected:"bg-white/[0.18] text-foreground",switchTrack:"border-white/10 bg-white/[0.12] backdrop-blur-md",checkboxBox:"border-white/10 bg-white/[0.08] backdrop-blur-md",checkboxBoxChecked:"border-white/20 bg-white/[0.22] text-foreground",radioOption:"border-white/10 bg-white/[0.06] backdrop-blur-md hover:bg-white/[0.10]",radioMarker:"border-white/10 bg-white/[0.08] backdrop-blur-md",radioMarkerChecked:"border-white/25 bg-white/[0.16]",dialogOverlay:"bg-background/45 backdrop-blur-md",dialogPanel:"border-white/10 bg-white/[0.08] shadow-2xl backdrop-blur-md",dialogHeader:"border-white/10",dialogFooter:"border-white/10",dropdownMenu:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",dropdownItem:"text-foreground hover:bg-white/[0.14]",tooltipContent:"border-foreground/10 bg-background/15 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",noticeDefault:"border-white/10 bg-white/[0.08] text-foreground backdrop-blur-md",dividerRoot:"border-white/15",tabsList:"border-white/10 bg-white/[0.08] backdrop-blur-md",tabsTrigger:"text-muted-foreground hover:bg-white/[0.12] hover:text-foreground",tabsTriggerActive:"bg-white/[0.16] text-foreground shadow-none",tabsPanel:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",segmentedRoot:"border-white/10 bg-white/[0.08] backdrop-blur-md",segmentedItem:"text-muted-foreground hover:bg-white/[0.12] hover:text-foreground",segmentedItemActive:"bg-white/[0.16] text-foreground shadow-none",progressTrack:"bg-white/[0.12]",skeletonRoot:"bg-white/[0.16]",avatarRoot:"border-white/10 bg-white/[0.12] text-foreground",avatarFallback:"bg-white/[0.12] text-foreground",avatarStatus:"border-background",toolbarRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",paginationButton:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",paginationPage:"bg-white/[0.12] text-foreground",descriptionListItem:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",accordionItem:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",accordionPanel:"border-white/10",menuContent:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",menuSeparator:"bg-white/10",menuItem:"text-foreground focus:bg-white/[0.14] focus:text-foreground data-[highlighted]:bg-white/[0.14] data-[highlighted]:text-foreground",menuSubTrigger:"text-foreground focus:bg-white/[0.14] focus:text-foreground data-[highlighted]:bg-white/[0.14] data-[highlighted]:text-foreground data-[state=open]:bg-white/[0.16]",menuSubContent:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",tableContainer:"border-foreground/10 bg-background/[0.06] shadow-none backdrop-blur-md [scrollbar-gutter:stable] [--base-table-sticky-header-bg:hsl(var(--background)/0.94)] [--base-table-header-separator:hsl(var(--foreground)/0.24)]",tableHeader:"border-white/10",tableFooter:"bg-white/[0.05] [&_tr>*]:border-white/10",tableFooterBar:"border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",tableFooterBarAttached:"border-t border-white/10",tableRow:"[&>*]:border-white/10",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--foreground)/0.08)]",tableHeadLabel:"text-foreground",tableLoadingSkeleton:"bg-white/[0.16]",layoutRoot:"border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",layoutPane:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",layoutPaneMuted:"bg-white/[0.08]",layoutPaneSoft:"bg-white/[0.10] shadow-none backdrop-blur-md",layoutResizeHandle:"text-foreground/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",layoutResizeHandleIndicator:"bg-white/45 group-hover/resize:bg-white/75"},dark:{buttonBase:"border-white/15 text-white shadow-lg backdrop-blur",buttonDefault:"bg-black/30 hover:bg-black/[0.45]",buttonPrimary:"border-white/25 bg-white/20 text-white hover:bg-white/25",buttonMuted:"border-white/10 bg-black/20 text-white/70 hover:bg-black/[0.35] hover:text-white",badgeDefault:"border-white/10 bg-white/[0.08] text-white",badgeMuted:"border-white/10 bg-black/20 text-white/70",panelRoot:"border-white/10 bg-slate-950 text-white shadow-none",panelTitle:"text-white",panelDescription:"text-white/65",panelBody:"text-white/85",panelFooter:"border-white/10 bg-white/[0.04]",stateRoot:"border-white/10 bg-slate-950 text-white shadow-none",stateIcon:"bg-white/10 text-white/75",stateTitle:"text-white",stateDescription:"text-white/65",fieldLabel:"text-white",fieldDescription:"text-white/65",fieldMessage:"text-white/65",controlWrapper:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur focus-within:border-white/35",controlBase:"text-white placeholder:text-white/45",selectChevron:"text-white/65",selectMenu:"border-white/15 bg-slate-950 text-white shadow-2xl",selectOption:"text-white",selectOptionActive:"bg-white/[0.12] text-white",selectOptionSelected:"bg-white/[0.16] text-white",selectPlaceholder:"text-white/45",switchTrack:"border-white/15 bg-black/30 shadow-lg backdrop-blur",switchChecked:"border-white/25 bg-white/25 text-white",switchLabel:"text-white",switchDescription:"text-white/65",checkboxBox:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur",checkboxBoxChecked:"border-white/25 bg-white/25 text-white",checkboxLabel:"text-white",checkboxDescription:"text-white/65",radioOption:"border-white/10 bg-white/[0.06] text-white hover:bg-white/[0.08]",radioMarker:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur",radioMarkerChecked:"border-white/25 bg-white/25",radioIndicator:"bg-white",radioLabel:"text-white",radioDescription:"text-white/65",dialogOverlay:"bg-slate-950/75",dialogPanel:"border-white/10 bg-slate-950 text-white shadow-2xl",dialogHeader:"border-white/10",dialogTitle:"text-white",dialogDescription:"text-white/65",dialogBody:"text-white/85",dialogFooter:"border-white/10",dialogClose:"text-white/65 hover:bg-white/[0.08] hover:text-white",dropdownMenu:"border-white/15 bg-slate-950 text-white shadow-2xl",dropdownLabel:"text-white/55",dropdownSeparator:"bg-white/15",dropdownItem:"text-white hover:bg-white/[0.10]",dropdownItemDescription:"text-white/55",dropdownItemShortcut:"text-white/55",tooltipContent:"border-white/15 bg-slate-950 text-white shadow-2xl",noticeDefault:"border-white/10 bg-white/[0.08] text-white",noticeMuted:"border-white/10 bg-black/20 text-white/70",dividerRoot:"border-white/15",dividerLabel:"text-white/55",sectionHeaderEyebrow:"text-white/55",sectionHeaderTitle:"text-white",sectionHeaderDescription:"text-white/65",tabsList:"border-white/10 bg-white/[0.08]",tabsTrigger:"text-white/65 hover:bg-white/[0.12] hover:text-white",tabsTriggerActive:"bg-white/[0.16] text-white shadow-none",tabsPanel:"border-white/10 bg-white/[0.06] text-white",segmentedRoot:"border-white/10 bg-white/[0.08]",segmentedItem:"text-white/65 hover:bg-white/[0.12] hover:text-white",segmentedItemActive:"bg-white/[0.16] text-white shadow-none",progressTrack:"bg-white/[0.12]",progressLabel:"text-white",progressValue:"text-white/65",skeletonRoot:"bg-white/[0.14]",avatarRoot:"border-white/15 bg-white/[0.10] text-white",avatarFallback:"bg-white/[0.10] text-white/75",avatarText:"text-white",avatarStatus:"border-slate-950",toolbarRoot:"border-white/10 bg-white/[0.06] text-white",toolbarTitle:"text-white",toolbarDescription:"text-white/65",breadcrumbLink:"text-white/65 hover:text-white",breadcrumbCurrent:"text-white",breadcrumbSeparator:"text-white/45",paginationInfo:"text-white/65",paginationButton:"border-white/10 bg-white/[0.08] text-white hover:bg-white/[0.14]",paginationPage:"bg-white/[0.14] text-white",descriptionListItem:"border-white/10 bg-white/[0.06]",descriptionListTerm:"text-white/55",descriptionListValue:"text-white",accordionItem:"border-white/10 bg-white/[0.06]",accordionTrigger:"text-white hover:bg-white/[0.08]",accordionPanel:"border-white/10 text-white/70",tableContainer:"border-foreground/10 bg-background text-foreground shadow-none [scrollbar-gutter:stable] [--base-table-sticky-header-bg:hsl(var(--background)/0.98)] [--base-table-header-separator:hsl(var(--foreground)/0.16)]",tableRoot:"text-white",tableHeader:"border-white/10",tableFooter:"bg-white/[0.05] [&_tr>*]:border-white/10",tableFooterBar:"border-white/10 bg-white/[0.05] text-white/65",tableFooterBarAttached:"border-t border-white/10",tableRow:"[&>*]:border-white/10",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--foreground)/0.06)]",tableHead:"text-white/65",tableHeadLabel:"text-white",tableHeadDescription:"text-white/55",tableHeadMeta:"text-white/55",tableHeadIcon:"text-white/55",tableHeadSortIcon:"text-white/55",tableHeadDragHandle:"text-white/55 hover:bg-white/[0.08]",tableHeadResizeHandle:"after:bg-white/20 hover:after:bg-white/60",tableCell:"text-white/85",tableEmptyIcon:"bg-white/10 text-white/65",tableEmptyTitle:"text-white",tableEmptyDescription:"text-white/60",menuContent:"border-white/10 bg-slate-950 text-white shadow-2xl",menuLabel:"text-white/55",menuSeparator:"bg-white/10",menuItem:"text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white",menuItemDefault:"text-white",menuItemPrimary:"text-primary focus:text-primary data-[highlighted]:text-primary",menuItemSuccess:"text-[hsl(var(--success,142_69%_58%))] focus:text-[hsl(var(--success,142_69%_58%))] data-[highlighted]:text-[hsl(var(--success,142_69%_58%))]",menuItemWarning:"text-[hsl(var(--warning-foreground,53_98%_77%))] focus:text-[hsl(var(--warning-foreground,53_98%_77%))] data-[highlighted]:text-[hsl(var(--warning-foreground,53_98%_77%))]",menuItemDanger:"text-destructive-text focus:text-destructive-text data-[highlighted]:text-destructive-text",menuItemMuted:"text-white/65 focus:text-white data-[highlighted]:text-white",menuItemShortcut:"text-white/45",menuSubTrigger:"text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white data-[state=open]:bg-white/[0.12]",menuSubTriggerIcon:"text-white/55",menuSubContent:"border-white/10 bg-slate-950 text-white shadow-2xl",tableLoadingSkeleton:"bg-white/[0.14]",layoutRoot:"border-white/10 bg-slate-950 text-white shadow-none",layoutPane:"border-white/10 bg-slate-950 text-white shadow-none",layoutPaneMuted:"bg-white/[0.06]",layoutPaneSoft:"bg-white/[0.08] shadow-none",layoutResizeHandle:"text-white/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",layoutResizeHandleIndicator:"bg-white/45 group-hover/resize:bg-white/75"}},Ih={default:{density:"default",radius:"md",border:"solid",background:"plain"},soft:{density:"default",radius:"lg",border:"subtle",background:"soft"},compact:{density:"compact",radius:"md",border:"subtle",background:"muted"},"tinted-glass":{density:"default",radius:"lg",border:"subtle",background:"glass"},glass:{density:"default",radius:"xl",border:"subtle",background:"glass"},"hard-edge":{density:"compact",radius:"none",border:"strong",background:"plain"}},ON={soft:{buttonBase:"font-medium",panelRoot:"border-border/70",controlWrapper:"font-medium",tabsTrigger:"font-medium",segmentedItem:"font-medium",toolbarRoot:"border-border/70",tableContainer:"border-border/70",tableFooterBar:"border-border/70",tableHeadLabel:"font-semibold",menuItemLabel:"font-medium"},compact:{buttonBase:"text-xs",badgeBase:"text-xs",fieldLabel:"text-xs",controlBase:"text-xs",selectOption:"text-xs",menuItem:"text-xs",menuSubTrigger:"text-xs",noticeBase:"text-xs",sectionHeaderTitle:"text-sm",tabsTrigger:"text-xs",segmentedItem:"text-xs",toolbarTitle:"text-xs",paginationRoot:"text-xs"},"tinted-glass":{buttonPrimary:"border-primary/25 bg-primary/15 text-primary-foreground hover:bg-primary/20",badgePrimary:"border-primary/25 bg-primary/15 text-primary-foreground",noticePrimary:"border-primary/25 bg-primary/15 text-primary-foreground",progressIndicator:"bg-primary",avatarStatus:"border-background"},glass:{panelRoot:"shadow-[0_24px_80px_hsl(var(--foreground)/0.12)]",stateRoot:"shadow-[0_24px_80px_hsl(var(--foreground)/0.12)]",noticeBase:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",tabsPanel:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",toolbarRoot:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",descriptionListItem:"shadow-[0_12px_40px_hsl(var(--foreground)/0.08)]",accordionItem:"shadow-[0_12px_40px_hsl(var(--foreground)/0.08)]"},"hard-edge":{buttonBase:"shadow-none",panelRoot:"shadow-none",stateRoot:"shadow-none",controlWrapper:"shadow-none",selectMenu:"shadow-none",menuContent:"shadow-none",menuSubContent:"shadow-none",noticeBase:"shadow-none",tabsList:"shadow-none",tabsTriggerActive:"shadow-none",tabsPanel:"shadow-none",segmentedRoot:"shadow-none",segmentedItemActive:"shadow-none",toolbarRoot:"shadow-none",descriptionListItem:"shadow-none",accordionItem:"shadow-none"}};function FN(e){return Ih[e]??Ih.default}a(FN,"getPresetDefaults");var HN=Object.keys(Eh);function VN(...e){return HN.reduce((t,o)=>(t[o]=m(...e.map(r=>r?.[o])),t),{})}a(VN,"mergeSlots");function _N(...e){return Object.assign({},...e.filter(Boolean))}a(_N,"mergeStyles");function Ne(e){let t=e?.preset??"default",o=e?.variant??"default",r=FN(t),n=e?.density??r.density??"default",i=e?.state??"idle",s=e?.radius??r.radius??"md",l=e?.border??r.border??"solid",d=e?.background??r.background??"plain";return {preset:t,variant:o,density:n,state:i,radius:s,border:l,background:d,styles:_N(EN,e?.styles),slots:VN(Eh,ON[t],BN[n],LN[s],WN[l],zN[d],e?.slots)}}a(Ne,"resolveBaseAppearance");function Gn(e,t="default",o=false){return m(t==="default"&&e.slots.buttonDefault,t==="primary"&&e.slots.buttonPrimary,t==="success"&&e.slots.buttonSuccess,t==="warning"&&e.slots.buttonWarning,t==="danger"&&e.slots.buttonDanger,t==="muted"&&e.slots.buttonMuted,o&&e.slots.buttonActive)}a(Gn,"getBaseButtonToneClassName");function Ld(e,t="default"){return m(t==="default"&&e.slots.badgeDefault,t==="primary"&&e.slots.badgePrimary,t==="success"&&e.slots.badgeSuccess,t==="warning"&&e.slots.badgeWarning,t==="danger"&&e.slots.badgeDanger,t==="muted"&&e.slots.badgeMuted)}a(Ld,"getBaseBadgeToneClassName");function Wd(e,t="default"){return m(t==="default"&&e.slots.noticeDefault,t==="primary"&&e.slots.noticePrimary,t==="success"&&e.slots.noticeSuccess,t==="warning"&&e.slots.noticeWarning,t==="danger"&&e.slots.noticeDanger,t==="muted"&&e.slots.noticeMuted)}a(Wd,"getBaseNoticeToneClassName");function Ma(e,t="default"){return m(t==="default"&&e.slots.menuItemDefault,t==="primary"&&e.slots.menuItemPrimary,t==="success"&&e.slots.menuItemSuccess,t==="warning"&&e.slots.menuItemWarning,t==="danger"&&e.slots.menuItemDanger,t==="muted"&&e.slots.menuItemMuted)}a(Ma,"getBaseMenuItemToneClassName");function fi(e,t="default"){return m(t==="default"&&e.slots.typographyToneDefault,t==="muted"&&e.slots.typographyToneMuted,t==="primary"&&e.slots.typographyTonePrimary,t==="success"&&e.slots.typographyToneSuccess,t==="warning"&&e.slots.typographyToneWarning,t==="danger"&&e.slots.typographyToneDanger,t==="inherit"&&e.slots.typographyToneInherit)}a(fi,"getBaseTypographyToneClassName");function zd(e,t="md"){return m(t==="xs"&&e.slots.textSizeXs,t==="sm"&&e.slots.textSizeSm,t==="md"&&e.slots.textSizeMd,t==="lg"&&e.slots.textSizeLg,t==="xl"&&e.slots.textSizeXl)}a(zd,"getBaseTextSizeClassName");function Ah(e,t="lg"){return m(t==="xs"&&e.slots.headingSizeXs,t==="sm"&&e.slots.headingSizeSm,t==="md"&&e.slots.headingSizeMd,t==="lg"&&e.slots.headingSizeLg,t==="xl"&&e.slots.headingSizeXl,t==="2xl"&&e.slots.headingSize2xl)}a(Ah,"getBaseHeadingSizeClassName");function Bh(e,t="default"){return m(t==="compact"&&e.slots.listSpacingCompact,t==="default"&&e.slots.listSpacingDefault,t==="relaxed"&&e.slots.listSpacingRelaxed)}a(Bh,"getBaseListSpacingClassName");function Lh(e,t){return m(t==="none"&&e.slots.listMarkerNone,t==="disc"&&e.slots.listMarkerDisc,t==="circle"&&e.slots.listMarkerCircle,t==="square"&&e.slots.listMarkerSquare,t==="decimal"&&e.slots.listMarkerDecimal,t==="lower-alpha"&&e.slots.listMarkerLowerAlpha,t==="upper-alpha"&&e.slots.listMarkerUpperAlpha)}a(Lh,"getBaseListMarkerClassName");var Wh=/^(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))$/i,GN=new Set(["calc","clamp","max","min","var"]),zh=/[;{}<>"'\\\u0000-\u001f\u007f]/,$N=/(?:\b(?:auto|fit-content|max-content|min-content|subgrid)\b|(?:calc|clamp|max|min|minmax|repeat|var)\s*\(|(?:^|[\s,(])(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|fr|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))(?:$|[\s,)\]]))/i;function Oh(e){let t={")":"(","]":"["},o=[];for(let r of e)if(r==="("||r==="[")o.push(r);else if((r===")"||r==="]")&&o.pop()!==t[r])return false;return o.length===0}a(Oh,"hasBalancedDelimiters");function jN(e){let t=/^([a-z]+)\(([\s\S]+)\)$/i.exec(e);return !t||!GN.has(t[1].toLowerCase())||!t[2].trim()||!Oh(e)?false:t[1].toLowerCase()==="var"?/^\s*--[a-z0-9_-]+(?:\s*,[\s\S]+)?\s*$/i.test(t[2]):Wh.test(t[2].trim())||/\b(?:calc|clamp|max|min|var)\s*\(/i.test(t[2])||/(?:^|[\s,(])(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))(?:$|[\s,)])/i.test(t[2])}a(jN,"isSupportedCssLengthFunction");function rr(e,t,o){if(typeof o=="number"){if(!Number.isFinite(o)||o<0)throw new RangeError(`${e} ${t} must be a finite, non-negative number or a supported CSS length string.`);return `${o}px`}if(typeof o!="string")throw new TypeError(`${e} ${t} must be a finite, non-negative number or a supported CSS length string.`);let r=o.trim();if(!r||zh.test(r)||!Wh.test(r)&&!jN(r))throw new TypeError(`${e} ${t} must be a non-empty, non-negative CSS length (for example 12px, 1rem, 5%, or var(--space)).`);return r}a(rr,"resolveBaseLayoutLength");function Fh(e){if(typeof e=="number"){if(!Number.isInteger(e)||e<=0)throw new RangeError("BaseGrid columns must be a positive integer or a supported CSS grid-template-columns string.");return `repeat(${e}, minmax(0, 1fr))`}if(typeof e!="string")throw new TypeError("BaseGrid columns must be a positive integer or a supported CSS grid-template-columns string.");let t=e.trim();if(!t||zh.test(t)||/\burl\s*\(/i.test(t)||!Oh(t)||!$N.test(t))throw new TypeError('BaseGrid columns must be a non-empty CSS grid-template-columns value such as "12rem minmax(0, 1fr)" or "repeat(3, minmax(0, 1fr))".');return t}a(Fh,"resolveBaseGridColumns");var Dh={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},Ph={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};function bi(e,t){if(!Object.prototype.hasOwnProperty.call(Dh,t))throw new TypeError(`${e} align must be one of: start, center, end, stretch, baseline.`);return Dh[t]}a(bi,"resolveBaseLayoutAlign");function gi(e,t){if(!Object.prototype.hasOwnProperty.call(Ph,t))throw new TypeError(`${e} justify must be one of: start, center, end, between, around, evenly.`);return Ph[t]}a(gi,"resolveBaseLayoutJustify");var qN=new Set(["compact","pages"]);function Hh(e,t){return Math.min(Math.max(e,1),Math.max(t,1))}a(Hh,"clampPage");function Od(e,t){if(!Number.isSafeInteger(e)||e<1)throw new RangeError(`BasePagination ${t} must be a positive safe integer.`)}a(Od,"assertPositiveInteger");function dm(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`BasePagination ${t} must be a non-negative safe integer.`)}a(dm,"assertNonNegativeInteger");function Fd(e,t){if(typeof e=="string"&&!e.trim())throw new TypeError(`BasePagination ${t} must be a non-empty string when provided.`)}a(Fd,"assertOptionalControlLabel");function YN(e,t){if(e!==void 0&&(typeof e!="string"||!e.trim()))throw new TypeError("BasePagination aria-label must be a non-empty string when provided.");if(t!==void 0&&(typeof t!="string"||!t.trim()))throw new TypeError("BasePagination aria-labelledby must contain at least one valid ID token.");if(typeof t=="string"&&t.trim().split(/\s+/).some(r=>/[\u0000-\u001f\u007f]/u.test(r)))throw new TypeError("BasePagination aria-labelledby must contain only valid ID tokens.")}a(YN,"assertAccessibleName");function Ia(e,t){if(typeof e!="string"||!e.trim())throw new TypeError(`BasePagination locale ${t} must resolve to a non-empty string.`);return e}a(Ia,"assertLocaleString");function Hd(e,t){return V(e)?e:t}a(Hd,"getControlContent");function Vd(e,t){return typeof e=="string"&&e.trim()?e:t}a(Vd,"getControlAriaLabel");function XN(e,t,o,r){let n=new Set,i=a(d=>{d>=1&&d<=t&&n.add(d);},"addPage");for(let d=0;d<o;d+=1)i(1+d),i(t-d);for(let d=-r;d<=r;d+=1)i(e+d);let s=[...n].sort((d,c)=>d-c),l=[];return s.forEach((d,c)=>{let p=s[c-1];if(p!==void 0){let u=d-p;u===2&&l.push(p+1),u>2&&l.push("ellipsis");}l.push(d);}),l}a(XN,"getPageItems");var Gd=ho.forwardRef(a(function({page:t,defaultPage:o,pageSize:r=20,total:n=0,pageCount:i,hasNext:s,hasPrevious:l,mode:d="compact",siblingCount:c=1,boundaryCount:p=1,label:u,firstLabel:g,previousLabel:f,nextLabel:b,lastLabel:x,appearance:y,className:k,classNames:w,style:v,onPageChange:h,role:S="navigation","aria-label":T,"aria-labelledby":C,...R},M){let I=Ye().pagination,B=Pe(y),N=ke(),D=Ne(B),[E,P]=ho.useState(()=>o??1);if(t!==void 0&&Od(t,"page"),o!==void 0&&Od(o,"defaultPage"),Od(r,"pageSize"),dm(n,"total"),i!==void 0&&Od(i,"pageCount"),dm(c,"siblingCount"),dm(p,"boundaryCount"),!qN.has(d))throw new TypeError('BasePagination mode must be "compact" or "pages".');if(h!==void 0&&typeof h!="function")throw new TypeError("BasePagination onPageChange must be a function.");Fd(g,"firstLabel"),Fd(f,"previousLabel"),Fd(b,"nextLabel"),Fd(x,"lastLabel"),YN(T,C);let W=Ia(I.navigation,"navigation"),H=Ia(I.first,"first"),A=Ia(I.previous,"previous"),L=Ia(I.next,"next"),F=Ia(I.last,"last"),G=i??Math.max(Math.ceil(n/r),1),$=t!==void 0,_=!$&&o!==void 0,z=Hh($?t:_?E:1,G),re=n>0?(z-1)*r+1:0,Z=Math.min(z*r,n),ae=l??z>1,ee=s??z<G,q=d==="pages"?XN(z,G,p,c):[],U=a(O=>{let K=Hh(O,G);K!==z&&(_&&P(K),h?.(K));},"requestPage"),X=a((O,K,ne,fe,he)=>jsxRuntime.jsx("button",{type:"button",disabled:!ne,"aria-label":he,"data-slot":O,className:m(D.slots.paginationButton,!ne&&D.slots.paginationButtonDisabled,w?.button),onClick:()=>U(K),children:fe}),"renderControl");return jsxRuntime.jsxs("div",{...N,...R,ref:M,role:S,"aria-label":T??(C===void 0?W:void 0),"aria-labelledby":C,"data-monkeys-component":"pagination","data-slot":"root","data-mode":d,"data-controlled":$||void 0,"data-uncontrolled":_||void 0,className:m(D.slots.paginationRoot,w?.root,k),style:{...D.styles.pagination,...v},children:[jsxRuntime.jsx("div",{"aria-live":"polite","data-slot":"info",className:m(D.slots.paginationInfo,w?.info),children:V(u)?u:n>0?I.range({start:re,end:Z,total:n}):I.emptyResults}),jsxRuntime.jsxs("div",{"data-slot":"controls",className:m(D.slots.paginationControls,w?.controls),children:[d==="pages"?X("first",1,ae,Hd(g,H),Vd(g,H)):null,X("previous",z-1,ae,Hd(f,A),Vd(f,A)),d==="compact"?jsxRuntime.jsxs("span",{"aria-current":"page","aria-label":Ia(I.currentPage({page:z,pageCount:G}),"currentPage"),"data-slot":"page","data-page":z,className:m(D.slots.paginationPage,w?.page),children:[z," / ",G]}):q.map((O,K)=>{if(O==="ellipsis")return jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"ellipsis",className:m(D.slots.paginationEllipsis,w?.ellipsis),children:"\u2026"},`ellipsis-${K}`);let ne=O===z;return jsxRuntime.jsx("button",{type:"button","aria-current":ne?"page":void 0,"aria-label":Ia(ne?I.currentPage({page:O,pageCount:G}):I.page({page:O,pageCount:G}),ne?"currentPage":"page"),"data-slot":"page","data-page":O,"data-current":ne||void 0,className:m(D.slots.paginationButton,ne&&D.slots.paginationPage,w?.button,ne&&w?.page),onClick:()=>U(O),children:O},O)}),X("next",z+1,ee,Hd(b,L),Vd(b,L)),d==="pages"?X("last",G,ee,Hd(x,F),Vd(x,F)):null]})]})},"BasePagination"));function QN(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"ml-1 inline-block h-3 w-3 animate-spin",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(QN,"LoadingIcon");function jd({total:e=0,loadedStart:t,loadedEnd:o,selectedCount:r,page:n=1,pageCount:i,pageSize:s=20,pageSizeOptions:l,showTotal:d,showPageSize:c,paginationMode:p,hasNext:u,hasPrevious:g,loading:f=false,totalLabel:b,selectedLabel:x,pageSizeLabel:y,appearance:k,className:w,classNames:v,onPageChange:h,onPageSizeChange:S,onSummaryClick:T,...C}){let R=Sd(),M=Ye().pagination,I=[...new Set(l??R.pageSizeOptions??[10,20,50,100])].filter(L=>Number.isSafeInteger(L)&&L>0),B=d??R.showTotal??true,N=c??R.showPageSize??true,D=p??R.paginationMode??"auto",E=D==="auto"?e>0?"pages":"compact":D,P=t!==void 0&&t>0&&o!==void 0&&o>=t,W=B?b??(P?M.range({start:t,end:o,total:e}):M.range({start:e>0?(n-1)*s+1:0,end:o??0,total:e})):void 0,H=!!h&&(u!==void 0||g!==void 0?!!(u||g||e>s):e>s),A=R.alignment==="end"?"justify-end":R.alignment==="start"?"justify-start":"justify-between";return jsxRuntime.jsx("div",{...C,className:m("flex min-w-0 flex-wrap items-center gap-3 py-2 text-sm",A,v?.root,w),"data-monkeys-component":"list-footer","data-density":R.density,children:jsxRuntime.jsxs("div",{className:"monkeys-list-footer-groups contents",children:[jsxRuntime.jsx("div",{className:m("min-w-0 text-muted-foreground",v?.summary),children:(()=>{let L=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[x??(r!==void 0?M.selected({count:r}):null),r!==void 0&&W?jsxRuntime.jsx("span",{className:"mx-2",children:"\xB7"}):null,W,f?jsxRuntime.jsx(QN,{}):null]});return T?jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center",onClick:T,children:L}):L})()}),H?jsxRuntime.jsx(Gd,{page:n,pageCount:i,pageSize:s,total:e,mode:E,hasNext:u,hasPrevious:g,onPageChange:h,appearance:k,className:v?.pagination,classNames:{info:"sr-only"}}):null,N&&S&&I.length>0?jsxRuntime.jsxs("label",{className:m("inline-flex items-center gap-2 whitespace-nowrap text-muted-foreground",v?.pageSize),children:[jsxRuntime.jsx("span",{className:"sr-only",children:y??M.pageSize}),jsxRuntime.jsx("select",{"aria-label":typeof y=="string"?y:M.pageSize,value:String(s),className:"h-8 rounded-md border border-border bg-background px-2 text-sm text-foreground",onChange:L=>S(Number(L.currentTarget.value)),children:I.map(L=>jsxRuntime.jsx("option",{value:L,children:L},L))})]}):null]})})}a(jd,"BaseListFooter");var Vh=Symbol.for("@inf-monkeys-tech/monkeys-design/bento-depth@1"),_h=globalThis,Gh=_h[Vh]??(_h[Vh]=ho.createContext(0));function Go(){return ho.useContext(Gh)}a(Go,"useBentoDepth");function um({children:e,depth:t}){return jsxRuntime.jsx(Gh.Provider,{value:t,children:e})}a(um,"BentoDepthProvider");function ks({children:e}){return jsxRuntime.jsx(um,{depth:0,children:e})}a(ks,"BentoScope");var jh="rounded-[var(--monkeys-bento-radius)] border-[length:var(--monkeys-bento-border-width)] border-[color:var(--monkeys-bento-border-color)] [border-style:var(--monkeys-bento-border-style)] bg-[var(--monkeys-bento-background)] shadow-[shadow:var(--monkeys-bento-shadow)] p-[var(--monkeys-bento-padding)] gap-[var(--monkeys-bento-gap)]";function Uh(){let e=Go(),t=e+1,o=ah(On(),t),r=Object.fromEntries(xd.map(n=>[`--monkeys-bento-${n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`,o.values[n]]));return {parentDepth:e,level:t,variables:r}}a(Uh,"useBentoSurface");function qh({as:e="article",title:t,description:o,media:r,header:n,footer:i,children:s,interactive:l,selected:d,disabled:c,appearance:p,variant:u,density:g,state:f,className:b,classNames:x,style:y,...k}){let w=Ne({...p,variant:u,density:g,state:f}),v=e,h=n!==void 0?V(n):V(t)||V(o),S=r!=null,T=!h&&!S;return jsxRuntime.jsxs(v,{...k,"aria-disabled":c||void 0,"data-variant":w.variant,"data-density":w.density,"data-state":f??(c?"disabled":d?"selected":"idle"),"data-monkeys-component":"panel","data-slot":"root","data-interactive":l||void 0,"data-selected":d||void 0,"data-disabled":c||void 0,className:m(w.slots.panelRoot,l&&!c&&w.slots.panelInteractive,d&&w.slots.panelSelected,c&&w.slots.panelDisabled,x?.root,b),style:{...w.styles.panel,...y},children:[S?jsxRuntime.jsx("div",{"data-slot":"media",className:m(w.slots.panelMedia,x?.media),children:r}):null,h?jsxRuntime.jsx("div",{"data-slot":"header",className:m(w.slots.panelHeader,x?.header),style:w.styles.panelHeader,children:n!==void 0?n:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(t)?jsxRuntime.jsx("div",{"data-slot":"title",className:m(w.slots.panelTitle,x?.title),children:t}):null,V(o)?jsxRuntime.jsx("div",{"data-slot":"description",className:m(w.slots.panelDescription,x?.description),children:o}):null]})}):null,s!=null?jsxRuntime.jsx("div",{"data-slot":"body",className:m(w.slots.panelBody,T&&w.slots.panelBodyStandalone,x?.body),style:w.styles.panelBody,children:s}):null,i!=null?jsxRuntime.jsx("div",{"data-slot":"footer",className:m(w.slots.panelFooter,x?.footer),style:w.styles.panelFooter,children:i}):null]})}a(qh,"BasePanel");var oR={menu:"monkeys-overlay-surface--menu bg-menu-surface text-popover-foreground",dialog:"monkeys-overlay-surface--dialog bg-dialog-surface text-foreground"};function ln(e,t={}){return ["monkeys-overlay-surface",oR[e],t.rounded===false?void 0:"monkeys-overlay-surface--rounded"].filter(Boolean).join(" ")}a(ln,"getOverlaySurfaceClassName");var sR=ho__namespace.forwardRef(({className:e,style:t,...o},r)=>jsxRuntime.jsx(dn__namespace.Item,{ref:r,className:m("border-b",e),style:{borderColor:"var(--monkeys-component-accordion-item-border-color, hsl(var(--border)))",...t},...o}));sR.displayName="AccordionItem";var lR=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsx(dn__namespace.Header,{className:"flex",children:jsxRuntime.jsxs(dn__namespace.Trigger,{ref:r,className:m("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...o,children:[t,jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));lR.displayName="AccordionTrigger";var dR=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsx(dn__namespace.Content,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:jsxRuntime.jsx("div",{className:m("pb-4 pt-0",e),children:t})}));dR.displayName="AccordionContent";var cR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Ud__namespace.Root,{ref:o,className:m("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:jsxRuntime.jsx(Ud__namespace.Indicator,{className:"flex items-center justify-center text-current",children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}));cR.displayName="Checkbox";var uR=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_[data-slot=icon]]:text-[inherit] [&_[data-slot=icon]_*]:!text-[inherit] [&_[data-slot=icon]_svg]:!stroke-current [&_[data-slot=icon]_svg_*]:!stroke-current [&_[data-slot=end-icon]]:text-[inherit] [&_[data-slot=end-icon]_*]:!text-[inherit] [&_[data-slot=end-icon]_svg]:!stroke-current [&_[data-slot=end-icon]_svg_*]:!stroke-current [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-control-surface shadow-sm ring-offset-control-surface hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-sm px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pt=ho__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...n},i)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{ref:i,className:uR({variant:t,size:o,className:e}),...n}));pt.displayName="Button";var pR=ho__namespace.forwardRef(({className:e,children:t,viewportClassName:o,viewportRef:r,onViewportScroll:n,scrollbar:i=true,scrollbarOrientation:s="vertical",scrollBarDisabled:l=false,type:d,...c},p)=>{let u=Go();return jsxRuntime.jsxs(zr__namespace.Root,{ref:p,type:d??(u>0?"auto":void 0),className:m("group relative overflow-hidden",l&&"no-scrollbar",e),...c,children:[jsxRuntime.jsx(zr__namespace.Viewport,{ref:r,onScroll:n,className:m("h-full w-full rounded-[inherit]",o),children:t}),i?jsxRuntime.jsx(Yh,{orientation:s,className:m(l&&"size-0 p-0")}):null,jsxRuntime.jsx(zr__namespace.Corner,{})]})});pR.displayName="ScrollArea";var Yh=ho__namespace.forwardRef(({className:e,orientation:t="vertical",...o},r)=>jsxRuntime.jsx(zr__namespace.ScrollAreaScrollbar,{ref:r,"data-monkeys-scrollbar":"",orientation:t,className:m("flex touch-none select-none opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...o,children:jsxRuntime.jsx(zr__namespace.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Yh.displayName="ScrollBar";var mR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Kd__namespace.Root,{ref:o,className:m("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:jsxRuntime.jsx(Kd__namespace.Thumb,{className:"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"})}));mR.displayName="Switch";var Da=ho__namespace.forwardRef(({variant:e="default",...t},o)=>jsxRuntime.jsx($n__namespace.Root,{ref:o,"data-variant":e,...t}));Da.displayName="Tabs";var Pa=ho__namespace.forwardRef(({className:e,gap:t,style:o,...r},n)=>jsxRuntime.jsx($n__namespace.List,{ref:n,className:m("inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),style:{gap:t,...o},...r}));Pa.displayName="TabsList";var jn=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx($n__namespace.Trigger,{ref:o,className:m("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));jn.displayName="TabsTrigger";var cn=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=Go();return jsxRuntime.jsx($n__namespace.Content,{ref:o,className:m("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r>0&&"gap-[var(--monkeys-bento-gap)]",e),...t})});cn.displayName="TabsContent";var Xh=mr__namespace.Provider,Qh=mr__namespace.Root,Zh=mr__namespace.Trigger,pm=ho__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>{let n=ke();return jsxRuntime.jsx(mr__namespace.Portal,{children:jsxRuntime.jsx(mr__namespace.Content,{...n,...o,ref:r,sideOffset:t,"data-monkeys-component":"tooltip","data-slot":"content","data-surface":"menu",className:m("z-50 overflow-hidden border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",ln("menu"),e)})})});pm.displayName="TooltipContent";var un=ho__namespace.forwardRef(({className:e,appearance:t="standard",type:o,...r},n)=>jsxRuntime.jsx("input",{ref:n,type:o,className:m("flex w-full border border-input bg-control-surface px-3 text-foreground ring-offset-control-surface transition-[border-color,background-color,color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t==="compact"?"h-9 rounded-md py-1 text-sm shadow-sm":"h-10 rounded-md py-2 text-sm shadow-sm",t==="shadow"&&"rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",e),...r}));un.displayName="Input";var fm=ho__namespace.forwardRef(({className:e,appearance:t="standard",...o},r)=>jsxRuntime.jsx("textarea",{ref:r,className:m("flex w-full border border-input bg-control-surface px-3 py-2 text-foreground ring-offset-control-surface placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t==="compact"?"min-h-[60px] rounded-md text-sm shadow-sm":"min-h-[80px] rounded-md text-sm",t==="shadow"&&"rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",e),...o}));fm.displayName="Textarea";function oy({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"input-group",role:"group",className:m("group/input-group shadow-xs relative flex w-full items-center rounded-md border border-input outline-hidden transition-[color,box-shadow] dark:bg-input/30","h-9 has-[>textarea]:h-auto","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col","has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot=input-group-control]:focus-visible]:ring-ring","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}a(oy,"InputGroup");var fR=classVarianceAuthority.cva("text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]","block-start":"[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5","block-end":"[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function qd({className:e,align:t="inline-start",...o}){return jsxRuntime.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:m(fR({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus();},...o})}a(qd,"InputGroupAddon");var bR=classVarianceAuthority.cva("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function ry({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return jsxRuntime.jsx(pt,{type:t,"data-size":r,variant:o,className:m(bR({size:r}),e),...n})}a(ry,"InputGroupButton");var gm=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(un,{ref:o,"data-slot":"input-group-control",className:m("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",e),...t}));gm.displayName="InputGroupInput";var gR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(fm,{ref:o,"data-slot":"input-group-control",className:m("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",e),...t}));gR.displayName="InputGroupTextarea";var Ss="relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",hm=`z-50 min-w-[8rem] overflow-hidden border p-1 ${ln("menu")} data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,Ts=Bt__namespace.Root,Ns=Bt__namespace.Trigger;var iy=Bt__namespace.RadioGroup,vR=ho__namespace.forwardRef(({className:e,inset:t,children:o,...r},n)=>jsxRuntime.jsxs(Bt__namespace.SubTrigger,{ref:n,className:m(Ss,"data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[o,jsxRuntime.jsx(lucideReact.ChevronRight,{"aria-hidden":"true",className:"ml-auto"})]}));vR.displayName="DropdownMenuSubTrigger";var wR=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=ke();return jsxRuntime.jsx(Bt__namespace.SubContent,{...r,...t,ref:o,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-surface":"menu",className:m(hm,e)})});wR.displayName="DropdownMenuSubContent";var yi=ho__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>{let n=ke();return jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{...n,...o,ref:r,sideOffset:t,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-surface":"menu",className:m(hm,e)})})});yi.displayName="DropdownMenuContent";var Rs=ho__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(Bt__namespace.Item,{ref:r,className:m(Ss,t&&"pl-8",e),...o}));Rs.displayName="DropdownMenuItem";var kR=ho__namespace.forwardRef(({className:e,children:t,checked:o,...r},n)=>jsxRuntime.jsxs(Bt__namespace.CheckboxItem,{ref:n,className:m(Ss,"pl-8",e),checked:o,...r,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Bt__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}),t]}));kR.displayName="DropdownMenuCheckboxItem";var ym=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{ref:r,className:m(Ss,"pl-8",e),...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Bt__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Circle,{"aria-hidden":"true",className:"h-2 w-2 fill-current"})})}),t]}));ym.displayName="DropdownMenuRadioItem";var xm=ho__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(Bt__namespace.Label,{ref:r,className:m("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));xm.displayName="DropdownMenuLabel";var vm=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Bt__namespace.Separator,{ref:o,className:m("-mx-1 my-1 h-px bg-muted",e),...t}));vm.displayName="DropdownMenuSeparator";var CR=a(({className:e,...t})=>jsxRuntime.jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t}),"DropdownMenuShortcut");CR.displayName="DropdownMenuShortcut";var SR=ho__namespace.forwardRef(({className:e,children:t,iconClassName:o,size:r="default",...n},i)=>jsxRuntime.jsxs(At__namespace.Trigger,{ref:i,className:m("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-control-surface px-3 py-2 text-left text-sm text-foreground shadow-sm ring-offset-control-surface data-[placeholder]:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:text-left",r==="sm"&&"h-8 px-2 py-1 text-xs",e),...n,children:[t,jsxRuntime.jsx(At__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:m("h-4 w-4 opacity-50",o)})})]}));SR.displayName="SelectTrigger";var sy=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.ScrollUpButton,{ref:o,className:m("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronUp,{"aria-hidden":"true",className:"h-4 w-4"})}));sy.displayName="SelectScrollUpButton";var ly=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.ScrollDownButton,{ref:o,className:m("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4"})}));ly.displayName="SelectScrollDownButton";var TR=ho__namespace.forwardRef(({className:e,children:t,position:o="popper",viewportClassName:r,disableTriggerViewportSizing:n=false,...i},s)=>{let l=ke();return jsxRuntime.jsx(At__namespace.Portal,{children:jsxRuntime.jsxs(At__namespace.Content,{...l,...i,ref:s,position:o,"data-monkeys-component":"select","data-slot":"content","data-surface":"menu",className:m(hm,"relative max-h-[var(--radix-select-content-available-height)] overflow-y-auto overflow-x-hidden",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),children:[jsxRuntime.jsx(sy,{}),jsxRuntime.jsx(At__namespace.Viewport,{className:m("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]",o==="popper"&&!n&&"h-[var(--radix-select-trigger-height)]",r),children:t}),jsxRuntime.jsx(ly,{})]})})});TR.displayName="SelectContent";var NR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.Label,{ref:o,className:m("px-2 py-1.5 text-sm font-semibold",e),...t}));NR.displayName="SelectLabel";var RR=ho__namespace.forwardRef(({className:e,children:t,indicatorClassName:o,itemText:r,hideIndicator:n=false,...i},s)=>jsxRuntime.jsxs(At__namespace.Item,{ref:s,className:m(Ss,"w-full",n?"px-2":"pl-8 pr-2",e),...i,children:[n?null:jsxRuntime.jsx("span",{className:m("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",o),children:jsxRuntime.jsx(At__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}),r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(At__namespace.ItemText,{asChild:true,children:jsxRuntime.jsx("span",{className:"sr-only",children:r})}),t]}):jsxRuntime.jsx(At__namespace.ItemText,{children:t})]}));RR.displayName="SelectItem";var MR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.Separator,{ref:o,className:m("-mx-1 my-1 h-px bg-muted",e),...t}));MR.displayName="SelectSeparator";function Un(e){if(!e)return;let t=/^data:image\/svg\+xml(?:[;,]|$)/i.test(e.trim());if(!t)try{t=/\.svgz?$/i.test(decodeURIComponent(new URL(e,"https://preview.invalid").pathname));}catch{return}return t?{backgroundColor:"var(--monkeys-media-svg-background)",objectFit:"contain"}:void 0}a(Un,"svgPreviewSurface");var DR=a(({aspectRatio:e="square",maxSquareHeight:t=true,className:o}={})=>m("w-full overflow-hidden bg-muted",(e==="square"||e==="1:1")&&"aspect-square",(e==="square"||e==="1:1")&&t&&"max-h-[300px]",e==="4:3"&&"aspect-[4/3]",e==="3:4"&&"aspect-[3/4]",(e==="video"||e==="16:9")&&"aspect-video",e==="9:16"&&"aspect-[9/16]",o),"mediaPreviewFrameClassName"),Ms=ho__namespace.forwardRef(({aspectRatio:e="square",maxSquareHeight:t=true,className:o,...r},n)=>jsxRuntime.jsx("div",{ref:n,className:DR({aspectRatio:e,maxSquareHeight:t,className:o}),...r}));Ms.displayName="MediaPreviewFrame";var Is=ho__namespace.forwardRef(({fit:e="contain",className:t,style:o,...r},n)=>{let i=Un(r.src);return jsxRuntime.jsx("img",{ref:n,className:m("block size-full",e==="contain"?"object-contain":"object-cover",t),style:{...i,...i?{objectFit:e}:{},...o},...r})});Is.displayName="MediaPreviewImage";var Cm=xo__namespace.Root;var PR=xo__namespace.Portal,cy=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=ke();return jsxRuntime.jsx(xo__namespace.Overlay,{...r,...t,ref:o,"data-monkeys-component":"sheet","data-slot":"overlay","data-monkeys-overlay":true,className:m("theme-overlay-backdrop fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)})});cy.displayName="SheetOverlay";var ER={top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm"},Yd=ho__namespace.forwardRef(({side:e="right",className:t,children:o,...r},n)=>{let i=ke();return jsxRuntime.jsxs(PR,{children:[jsxRuntime.jsx(cy,{}),jsxRuntime.jsxs(xo__namespace.Content,{...i,...r,ref:n,"data-monkeys-component":"sheet","data-slot":"content","data-surface":"dialog","data-monkeys-dialog-content":true,className:m("fixed z-50 gap-4 p-6 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",ln("dialog",{rounded:false}),ER[e],t),children:[jsxRuntime.jsxs(xo__namespace.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-dialog-surface transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]}),jsxRuntime.jsx(ks,{children:o})]})]})});Yd.displayName="SheetContent";var Xd=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(xo__namespace.Title,{ref:o,className:m("text-lg font-semibold text-foreground",e),...t}));Xd.displayName="SheetTitle";var AR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(xo__namespace.Description,{ref:o,className:m("text-sm text-muted-foreground",e),...t}));AR.displayName="SheetDescription";var uy=["pulse","shimmer","shimmer-soft","shimmer-diagonal","shimmer-vertical","drift","outline","none"];function my(e,t=false){if(!(e===void 0||uy.includes(e))&&!(t&&(e==="shimmer-shared"||e==="shimmer-stagger")))throw new TypeError(`Skeleton animation must be ${uy.join(", ")}${t?", shimmer-shared, or shimmer-stagger":""}.`)}a(my,"validateSkeletonAnimation");var Tm=ho.createContext(null),Es=ho.createContext(void 0);function Nm(e){delete e.dataset.skeletonReady;for(let t of ["width","offset","delay"])e.style.removeProperty(`--monkeys-skeleton-${t}`);}a(Nm,"clearGeometry");function LR(e,t,o,r){let n=ho.useMemo(()=>({nodes:new Map,update:a(()=>{},"update")}),[]);return ho.useEffect(()=>{if(!o||t||e!=="shimmer-shared"&&e!=="shimmer-stagger")return;let i=window.matchMedia("(prefers-reduced-motion: reduce)"),s,l,d=false,c=new Set,p=a(()=>{if(l=void 0,!d)return;let b=[...n.nodes.keys()].filter(S=>S.isConnected);if(b.sort((S,T)=>S.compareDocumentPosition(T)&2?1:-1),e==="shimmer-stagger"){b.forEach((S,T)=>{let C=n.nodes.get(S)?.item??T;S.style.setProperty("--monkeys-skeleton-delay",`${Math.min(C*80,400)}ms`);});return}let x=r?.current??b[0]?.parentElement;for(let S of b)for(;x&&!x.contains(S);)x=x.parentElement;let y=new Set(b);for(let S of b)for(let T=S.parentElement;T&&(y.add(T),T!==x);T=T.parentElement);x&&y.add(x);for(let S of c)y.has(S)||(s?.unobserve(S),c.delete(S));for(let S of y)c.has(S)||(s?.observe(S),c.add(S));let k=b.map(S=>S.getBoundingClientRect()),w=b.map((S,T)=>{let C=getComputedStyle(S),R=C.boxSizing==="border-box"?0:parseFloat(C.paddingLeft)+parseFloat(C.paddingRight)+parseFloat(C.borderLeftWidth)+parseFloat(C.borderRightWidth),M=parseFloat(C.width)+R,I=M?k[T].width/M:1;return Math.abs(I-1)<1e-4?1:I}),v=Math.min(...k.map(S=>S.left)),h=Math.max(...k.map(S=>S.right));b.forEach((S,T)=>{let C=k[T];if(!C.width||!C.height){Nm(S);return}let R=w[T];S.style.setProperty("--monkeys-skeleton-width",`${(h-v)/R}px`),S.style.setProperty("--monkeys-skeleton-offset",`${(v-C.left)/R}px`),S.dataset.skeletonReady||(S.style.setProperty("--monkeys-skeleton-delay",`${-(performance.now()%2600)}ms`),S.dataset.skeletonReady="true");});},"measure"),u=a(()=>{d&&l===void 0&&(l=window.requestAnimationFrame(p));},"schedule"),g=a(()=>{d=false,s?.disconnect(),s=void 0,c.clear(),l!==void 0&&window.cancelAnimationFrame(l),l=void 0,window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true),n.nodes.forEach((b,x)=>Nm(x));},"stop"),f=a(()=>{g(),!(i.matches||e==="shimmer-shared"&&typeof ResizeObserver>"u")&&(d=true,e==="shimmer-shared"&&(s=new ResizeObserver(u),window.addEventListener("resize",u),window.addEventListener("scroll",u,{capture:true,passive:true})),u());},"start");return n.update=u,f(),i.addEventListener("change",f),()=>{g(),i.removeEventListener("change",f),n.update=()=>{};}},[e,t,o,n,r]),ho.useEffect(()=>{n.update();}),n}a(LR,"useGroupRegistry");function qn({animation:e,animated:t,children:o,independent:r=false,containerRef:n}){if(my(e,true),t!==void 0&&typeof t!="boolean")throw new TypeError("SkeletonGroup animated must be a boolean.");let i=ho.useContext(Tm),s=ho.useContext(Es),l=r||e!==void 0||!i,d=e??i?.animation??"pulse",c=!!i?.disabled||t===false||d==="none",p=LR(d,c,l,n),u=ho.useMemo(()=>({animation:d,disabled:c,registry:l?p:i.registry}),[d,c,l,p,i]),g=jsxRuntime.jsx(Tm.Provider,{value:u,children:o});return jsxRuntime.jsx(Es.Provider,{value:l?void 0:s,children:g})}a(qn,"SkeletonScope");function Qd({index:e,children:t}){let o=ho.useContext(Es);return jsxRuntime.jsx(Es.Provider,{value:o??e,children:t})}a(Qd,"SkeletonItem");function Im(e,t){return ho.useMemo(()=>{let o;return r=>{if(e(r),typeof t=="function"){if(o)o(),o=void 0;else if(r===null){t(null);return}if(r!==null){let n=t(r);typeof n=="function"&&(o=n);}}else t&&(t.current=r);}},[e,t])}a(Im,"useSkeletonRef");function Zd(e,t=true,o){my(e);let r=ho.useContext(Tm),n=ho.useContext(Es),i=!t||r?.disabled?"none":e??r?.animation??"pulse",[s,l]=ho.useState(null),d=Im(l,o),c=e===void 0&&(i==="shimmer-shared"||i==="shimmer-stagger")?r?.registry:void 0;return ho.useEffect(()=>{if(!(!s||!c))return c.nodes.set(s,{item:n}),c.update(),()=>{c.nodes.delete(s),Nm(s),c.update();}},[s,c,n,i]),{ref:d,mode:i,style:i==="shimmer-stagger"&&n!==void 0?{"--monkeys-skeleton-delay":`${Math.min(n*80,400)}ms`}:void 0}}a(Zd,"useSkeletonMotion");var FR=ho.forwardRef(a(function({animation:t,animated:o,children:r,...n},i){let s=ho.useRef(null),l=ho.useCallback(c=>{s.current=c;},[]),d=Im(l,i);return jsxRuntime.jsx(qn,{animation:t,animated:o,independent:true,containerRef:s,children:jsxRuntime.jsx("div",{...n,ref:d,children:r})})},"SkeletonGroup"));function yy({selectedCount:e,loadedStart:t,loadedEnd:o,total:r,currentPage:n=1,pageSize:i=Math.max(1,o||1),pageSizeOptions:s=[],loading:l,selectedLabel:d,loadedLabel:c,pageSizeLabel:p,pageText:u,tone:g="default",className:f,classNames:b,onJump:x,onJumpToPage:y,onPageSizeChange:k}){let w=Ye().pagination,v=typeof t=="number"&&t>0&&o>=t,h=c??(v?w.range({start:t,end:o,total:r}):w.range({start:0,end:o,total:r})),[S,T]=ho.useState(false),[C,R]=ho.useState(String(n)),M=ho.useRef(null),I=r>0?Math.max(1,Math.ceil(r/Math.max(1,i))):1;if(ho.useEffect(()=>{S||R(String(n));},[n,S]),ho.useEffect(()=>{if(!S)return;let B=window.setTimeout(()=>{M.current?.focus(),M.current?.select();},0);return ()=>window.clearTimeout(B)},[S]),g==="hard-edge"){let B=a(()=>{let N=Math.floor(Number(C));if(!Number.isFinite(N)||Number.isNaN(N)){R(String(n)),T(false);return}let D=Math.min(I,Math.max(1,N));T(false),D!==n&&y?.(D);},"confirmJump");return jsxRuntime.jsxs("div",{className:m("flex items-center border-t bg-background px-4 py-3",b?.root,f),"data-monkeys-component":"collection-footer","data-tone":"hard-edge",children:[jsxRuntime.jsxs("div",{className:m("flex min-w-0 items-center gap-1 whitespace-nowrap text-sm text-muted-foreground",b?.summary),children:[e!==void 0?jsxRuntime.jsxs("span",{children:[d??w.selected({count:e})," \xB7"]}):null,y&&r>0?S?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:w.jumpToPage}),jsxRuntime.jsx(un,{ref:M,type:"number",inputMode:"numeric",min:1,max:I,value:C,onChange:N=>R(N.currentTarget.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.currentTarget.blur()),N.key==="Escape"&&(N.preventDefault(),T(false),R(String(n)));},onBlur:B,className:"h-7 w-20 px-2 text-xs","aria-label":w.jumpToPage}),jsxRuntime.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",I," ",w.pages]})]}):jsxRuntime.jsxs("button",{type:"button",className:m("inline-flex items-center text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",b?.jumpButton),onClick:()=>{R(String(n)),T(true),x?.();},title:w.clickToJump,children:[h,u?` (${u})`:null,l?jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"ml-1 inline-block h-3 w-3 animate-spin"}):null]}):jsxRuntime.jsxs("span",{className:"inline-flex items-center",children:[h,u?` (${u})`:null,l?jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"ml-1 h-3 w-3 animate-spin"}):null]})]}),k&&s.length>0?jsxRuntime.jsx("div",{className:m("ml-auto",b?.pageSizeControl),children:jsxRuntime.jsxs(Ts,{children:[jsxRuntime.jsx(Ns,{asChild:true,children:jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:m("h-8 gap-1 px-2",b?.pageSizeButton),"aria-label":typeof p=="string"?p:w.perLoad,children:[i,jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4"})]})}),jsxRuntime.jsxs(yi,{align:"end",className:"w-32",children:[jsxRuntime.jsx(xm,{children:p??w.perLoad}),jsxRuntime.jsx(vm,{}),jsxRuntime.jsx(iy,{value:String(i),onValueChange:N=>{let D=Number(N);Number.isFinite(D)&&k(D);},children:s.map(N=>jsxRuntime.jsx(ym,{value:String(N),children:N},N))})]})]})}):null]})}return jsxRuntime.jsx(jd,{total:r,loadedStart:t,loadedEnd:o,selectedCount:e,page:n,pageSize:i,pageSizeOptions:s,loading:l,totalLabel:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[h," ",u?`(${u})`:null]}),selectedLabel:d,pageSizeLabel:p,className:f,classNames:{root:b?.root,summary:b?.summary,pageSize:b?.pageSizeControl},onSummaryClick:x,onPageSizeChange:k})}a(yy,"DataExplorerCollectionFooter");function GR(e){return typeof e=="number"?`${e}px`:e}a(GR,"toCssSize");function vy({label:e,leading:t,children:o,actions:r,maxFieldsHeight:n=80,className:i,classNames:s,style:l,...d}){let c={maxHeight:GR(n)};return jsxRuntime.jsx("div",{className:j("border-b border-border/60 bg-background px-8 py-3",s?.root,i),style:l,...d,children:jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-start gap-2 text-sm",s?.layout),children:[e?jsxRuntime.jsx("div",{className:j("flex h-9 shrink-0 items-center font-semibold text-foreground",s?.label),children:e}):null,jsxRuntime.jsx("div",{className:j("min-w-0 flex-1 overflow-y-auto overscroll-contain",s?.fieldsViewport),style:c,children:jsxRuntime.jsxs("div",{className:j("flex flex-wrap items-center gap-2",s?.fields),children:[t,o]})}),r?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",s?.actions),children:r}):null]})})}a(vy,"DataExplorerFilterBar");function wy(e){return e!=null&&e!==false&&e!==""}a(wy,"hasContent");function ec({field:e,label:t=e?.label,icon:o=e?.icon,value:r=e?.value,helperText:n=e?.helperText,error:i=e?.error,required:s=e?.required??false,disabled:l=e?.disabled??false,children:d,context:c,className:p,valueClassName:u=e?.valueClassName,classNames:g,dataAttributes:f=e?.dataAttributes,labelDataAttributes:b=e?.labelDataAttributes,valueDataAttributes:x=e?.valueDataAttributes,helperDataAttributes:y=e?.helperDataAttributes,errorDataAttributes:k=e?.errorDataAttributes}){let w={...e?.classNames,...g},v=d??(e?.render?e.render(c):r),h=wy(i);return jsxRuntime.jsxs("div",{...f,title:e?.title,"aria-disabled":l||void 0,"data-disabled":l||void 0,"data-invalid":h||void 0,"data-required":s||void 0,className:j("min-w-0 space-y-1",l&&"opacity-60",w.root,e?.className,p),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center gap-1.5 text-[13px] font-medium text-muted-foreground",w.label),children:[o?jsxRuntime.jsx("span",{className:j("inline-flex shrink-0 items-center justify-center",w.icon),children:o}):null,jsxRuntime.jsx("span",{...b,className:"min-w-0 truncate",children:t}),s?jsxRuntime.jsx("span",{"aria-hidden":"true",className:j("text-destructive-text",w.required),children:"*"}):null]}),jsxRuntime.jsx("div",{...x,className:j("min-w-0 max-w-full text-[15px] leading-6 text-foreground [overflow-wrap:anywhere]",w.value,u),children:v}),wy(n)?jsxRuntime.jsx("div",{...y,"data-slot":"helper",className:j("min-w-0 max-w-full text-xs leading-5 text-muted-foreground [overflow-wrap:anywhere]",w.helper),children:n}):null,h?jsxRuntime.jsx("div",{...k,role:"alert","data-slot":"error",className:j("min-w-0 max-w-full text-xs leading-5 text-destructive-text [overflow-wrap:anywhere]",w.error),children:i}):null]})}a(ec,"DataExplorerDetailField");function tc({section:e,title:t=e?.title,fields:o=e?.fields,children:r,context:n,className:i,classNames:s,fieldClassNames:l}){let d={...e?.classNames,...s},c=(o||[]).filter(g=>!(Mt(g.hidden,n)??false)),p=r??(typeof e?.children=="function"?e.children(n):e?.children);return !(!!p||c.length>0)||Mt(e?.hidden,n)?null:jsxRuntime.jsxs("section",{className:j("border-b border-border pb-6 last:border-b-0 last:pb-0",d.root,e?.className,i),children:[t?jsxRuntime.jsx("div",{className:j("mb-4 text-[15px] font-semibold text-foreground",d.title),children:t}):null,jsxRuntime.jsxs("div",{className:j("space-y-4",d.body),children:[p,c.map((g,f)=>jsxRuntime.jsx(ec,{field:g,context:n,classNames:l},g.id||String(f)))]})]})}a(tc,"DataExplorerDetailSection");function $R(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-[18px] w-[18px]",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]})}a($R,"DefaultCloseIcon");function Ty(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m15 18-6-6 6-6"})})}a(Ty,"DefaultChevronLeftIcon");function Ny(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})}a(Ny,"DefaultChevronRightIcon");function Ry({title:e,subtitle:t,leading:o,actions:r,preview:n,previewVisible:i=true,previewStyle:s,previewPadded:l=false,previewCentered:d=true,sections:c=[],rightPanel:p,context:u,navigation:g,closeLabel:f="Close",closeIcon:b,closeVisible:x=true,onClose:y,appearance:k,className:w,classNames:v}){let h=Ct(Et(k)),S=(g?.visible??true)&&typeof g?.count=="number"&&g.count>1,T=c.filter(C=>!(Mt(C.hidden,u)??false));return jsxRuntime.jsxs("div",{className:j(h.slots.detailRoot,v?.root,w),style:h.styles.detailRoot,children:[jsxRuntime.jsxs("div",{className:j(h.slots.detailHeader,v?.header),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center gap-3",v?.headerMain),children:[o?jsxRuntime.jsx("div",{className:j(h.slots.detailLeading,v?.leading),children:o}):null,jsxRuntime.jsxs("div",{className:j("min-w-0",v?.titleGroup),children:[jsxRuntime.jsx("div",{className:j("truncate text-[20px] font-semibold leading-tight text-foreground",v?.title),children:e}),t?jsxRuntime.jsx("div",{className:j("mt-1 min-w-0 truncate text-sm text-muted-foreground",v?.subtitle),children:t}):null]})]}),jsxRuntime.jsxs("div",{className:j("flex items-center gap-2",v?.headerActions),children:[r,S?jsxRuntime.jsxs("div",{className:j(h.slots.detailNavigation,v?.navigation),children:[jsxRuntime.jsx("button",{type:"button","aria-label":g?.previousLabel||"Previous",className:j(h.slots.detailNavigationButton,v?.navigationButton),disabled:!g?.onPrevious,onClick:g?.onPrevious,children:jsxRuntime.jsx(Ty,{})}),jsxRuntime.jsxs("div",{className:j("min-w-[74px] text-center text-xs font-medium text-muted-foreground",v?.navigationCount),children:[g.index+1," / ",g.count]}),jsxRuntime.jsx("button",{type:"button","aria-label":g?.nextLabel||"Next",className:j(h.slots.detailNavigationButton,v?.navigationButton),disabled:!g?.onNext,onClick:g?.onNext,children:jsxRuntime.jsx(Ny,{})})]}):null,x?jsxRuntime.jsx("button",{type:"button","aria-label":f,className:j(h.slots.detailCloseButton,v?.closeButton),onClick:y,children:b??jsxRuntime.jsx($R,{})}):null]})]}),jsxRuntime.jsxs("div",{className:j("grid min-h-0 flex-1",i?"xl:grid-cols-[minmax(0,1fr)_380px] 2xl:grid-cols-[minmax(0,1fr)_400px]":"grid-cols-1",v?.body),children:[i?jsxRuntime.jsx("div",{className:j(h.slots.detailPreviewPanel,v?.previewPanel),children:jsxRuntime.jsxs("div",{className:j("flex h-full min-h-0 flex-col",v?.previewStack),children:[S?jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsxs("div",{className:j("text-xs text-muted-foreground xl:hidden",v?.previewMobileCount),children:[g.index+1," / ",g.count]})}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 justify-center",d&&"items-stretch",v?.previewWrapper),children:jsxRuntime.jsxs("div",{className:j(h.slots.detailPreviewFrame,v?.previewFrame),style:s,children:[jsxRuntime.jsx("div",{className:j("relative flex h-full w-full items-center justify-center",l&&"p-4",v?.previewContent),children:n}),S?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button","aria-label":g?.previousLabel||"Previous",className:j(h.slots.previewNavigationButton,"left-4",v?.previewNavigationButton),disabled:!g?.onPrevious,onClick:g?.onPrevious,children:jsxRuntime.jsx(Ty,{})}),jsxRuntime.jsx("button",{type:"button","aria-label":g?.nextLabel||"Next",className:j(h.slots.previewNavigationButton,"right-4",v?.previewNavigationButton),disabled:!g?.onNext,onClick:g?.onNext,children:jsxRuntime.jsx(Ny,{})})]}):null]})})]})}):null,jsxRuntime.jsx("div",{className:j(h.slots.detailRightPanel,v?.rightPanel),children:jsxRuntime.jsx("div",{className:j(h.slots.detailRightPanelBody,v?.rightPanelBody),style:{scrollbarGutter:"stable"},children:p??jsxRuntime.jsx("div",{className:j("space-y-6",v?.sections),children:T.map(C=>jsxRuntime.jsx(tc,{section:C,context:u,className:v?.section,fieldClassNames:{root:v?.field}},C.id))})})})]})]})}a(Ry,"DataExplorerDetailShell");function Iy(e){if(e===null)return null;if(typeof e=="string"&&e.trim().length>0)return e;throw new TypeError("BaseField validate must return a non-empty error string or null.")}a(Iy,"resolveBaseFieldValidationResult");var Dm=ho.createContext(null);function Yn(){let e=ho.useContext(Dm),t=ho.useRef(null);t.current===null&&(t.current=Symbol("BaseFieldControl"));let o=e?.registerControl;ho.useEffect(()=>{if(!(!o||t.current===null))return o(t.current)},[o]);let r=e?.notifyBlur,n=e?.notifyChange;return {invalid:e?.invalid??false,notifyBlur:ho.useCallback(i=>r?.(i),[r]),notifyChange:ho.useCallback(i=>n?.(i),[n])}}a(Yn,"useBaseFieldControl");var eM={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},tM={sm:"text-[10px]",md:"text-[11px]",lg:"text-xs"};function oM(e,...t){for(let o of t)if(o){if(typeof o=="function"){o(e);continue}o.current=e;}}a(oM,"setRefs");var vi=ho.forwardRef(a(function({label:t,description:o,indeterminate:r=false,invalid:n=false,disabled:i=false,controlSize:s,appearance:l,className:d,classNames:c,style:p,checked:u,defaultChecked:g,onBlur:f,onChange:b,"aria-invalid":x,...y},k){for(let[L,F]of [["indeterminate",r],["invalid",n],["disabled",i]])if(typeof F!="boolean")throw new TypeError(`BaseCheckbox ${L} must be a boolean.`);if(s!==void 0&&s!=="sm"&&s!=="md"&&s!=="lg")throw new TypeError('BaseCheckbox controlSize must be "sm", "md", or "lg".');let w=Pe(l),v=ke(),h=Ne(w),S=Yn(),T=n||S.invalid,C=V(t),R=Rd(o),M=ho.useRef(null),I=ho.useRef(r);I.current=r;let[B,N]=ho.useState(g??false),D=u!==void 0,E=!!(D?u:B),P=r||E,W=r?"mixed":E?"checked":"unchecked",H=ho.useCallback(L=>{M.current=L,L&&(L.indeterminate=I.current),oM(L,k);},[k]);ho.useEffect(()=>{M.current&&(M.current.indeterminate=r);},[r]);let A=a(L=>{i||(D||N(L.currentTarget.checked),b?.(L),S.notifyChange(L.currentTarget.checked),M.current&&(M.current.indeterminate=r));},"handleChange");return jsxRuntime.jsxs("label",{...v,"data-monkeys-component":"checkbox","data-slot":"root","data-state":W,"data-size":s,"data-invalid":T||void 0,"data-disabled":i||void 0,className:m(h.slots.checkboxRoot,!R&&"items-center",i&&h.slots.checkboxDisabled,c?.root,d),style:{...h.styles.checkboxRoot,...p},children:[jsxRuntime.jsxs("span",{"data-slot":"box","data-state":W,"data-size":s,className:m(h.slots.checkboxBox,!R&&"mt-0",P&&h.slots.checkboxBoxChecked,T&&h.slots.checkboxBoxInvalid,s&&eM[s],c?.box),style:{...h.styles.checkboxBox},children:[jsxRuntime.jsx("input",{...y,ref:H,type:"checkbox",disabled:i,checked:u,defaultChecked:g,"aria-invalid":x??(T||void 0),"aria-checked":r?"mixed":E,"data-slot":"input","data-state":W,"data-size":s,"data-invalid":T||void 0,"data-disabled":i||void 0,className:m(h.slots.checkboxInput,c?.input),onBlur:L=>{f?.(L),S.notifyBlur(L.currentTarget.checked);},onChange:A}),P?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator","data-state":W,"data-size":s,className:m(h.slots.checkboxIndicator,s&&tM[s],c?.indicator),children:r?"\u2013":"\u2713"}):null]}),C||R?jsxRuntime.jsxs("span",{"data-slot":"content",className:m(h.slots.checkboxContent,c?.content),children:[C?jsxRuntime.jsx("span",{"data-slot":"label",className:m(h.slots.checkboxLabel,c?.label),children:t}):null,R?jsxRuntime.jsx("span",{"data-slot":"description",className:m(h.slots.checkboxDescription,c?.description),children:o}):null]}):null]})},"BaseCheckbox"));function nM(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}a(nM,"MoreIcon");function rc({item:e,itemId:t=e?.id,source:o=e?.source,actions:r=[],label:n="Actions",triggerLabel:i="Open actions",triggerIcon:s,align:l="end",sideOffset:d=6,appearance:c,className:p,classNames:u}){let[g,f]=ho.useState(false),b=Ct(Et(c)),x={itemId:t,item:e,source:o},y=r.filter(k=>Mt(k.visible,x)??true);return y.length===0?null:jsxRuntime.jsx("span",{className:j("inline-flex",u?.root),children:jsxRuntime.jsxs(Bt__namespace.Root,{open:g,onOpenChange:f,children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{type:"button","aria-label":i,className:j(b.slots.menuTrigger,u?.trigger,p),onClick:k=>k.stopPropagation(),children:[s??jsxRuntime.jsx(nM,{}),jsxRuntime.jsx("span",{className:"sr-only",children:i})]})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:l,sideOffset:d,className:j(b.slots.menuContent,u?.content),style:b.styles.menuContent,onClick:k=>k.stopPropagation(),children:[n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Bt__namespace.Label,{className:j(b.slots.menuLabel,u?.label),children:n}),jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)})]}):null,y.map(k=>{let w=(Mt(k.disabled,x)??false)||(Mt(k.loading,x)??false);return k.render?jsxRuntime.jsxs("div",{children:[k.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null,k.render(x),k.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null]},k.id):jsxRuntime.jsxs("div",{children:[k.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:j("-mx-1 my-1 h-px bg-border",u?.separator)}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:k.title,disabled:w,className:j(b.slots.menuItem,Vn(b,k.tone),u?.item,k.className),style:b.styles.menuItem,onSelect:()=>{!k.onAction||w||k.onAction(x);},onContextMenu:v=>{!k.onContextAction||w||(v.preventDefault(),v.stopPropagation(),f(false),k.onContextAction(x));},children:[k.icon?jsxRuntime.jsx("span",{className:j(b.slots.menuItemIcon,u?.itemIcon),children:k.icon}):null,jsxRuntime.jsx("span",{className:j(b.slots.menuItemLabel,u?.itemLabel),children:k.label})]}),k.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null]},k.id)})]})})]})})}a(rc,"DataExplorerDisplayActionMenu");function iM(e){return e?Array.isArray(e)?e.filter(Boolean):[e]:[]}a(iM,"normalizeMedia");function sM(e){return String(e||"unknown").toLowerCase()}a(sM,"resolveMediaKind");function wi({media:e,fallbackTitle:t,empty:o,className:r,classNames:n,onOpen:i}){let l=iM(e)[0];if(!l)return o?jsxRuntime.jsx("div",{className:j("flex min-h-24 items-center justify-center bg-muted/30 text-sm text-muted-foreground",n?.placeholder,r),children:o}):null;if(l.node)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",n?.root,r),children:l.node});let d=sM(l.kind),c=String(l.src||l.thumbnail||"").trim(),p=l.title??t,u=l.alt||(typeof p=="string"?p:"preview"),g=typeof i=="function",f=c?d==="image"||d==="unknown"?jsxRuntime.jsx("img",{src:c,style:Un(c),alt:u,className:j("h-auto w-full object-contain",n?.media),loading:"lazy",decoding:"async",draggable:false}):d==="video"?jsxRuntime.jsx("video",{src:c,className:j("h-auto w-full",n?.media),controls:true,preload:"metadata"}):d==="audio"?jsxRuntime.jsx("audio",{src:c,className:j("w-full",n?.media),controls:true,preload:"metadata"}):jsxRuntime.jsxs("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-1 bg-muted/30 p-4 text-center text-sm text-muted-foreground",n?.placeholder),children:[p?jsxRuntime.jsx("span",{className:j("max-w-full truncate",n?.title),children:p}):null,jsxRuntime.jsx("span",{className:"max-w-full truncate",children:c})]}):jsxRuntime.jsx("div",{className:j("flex min-h-24 items-center justify-center bg-muted/30 text-sm text-muted-foreground",n?.placeholder),children:p||"No preview"});return g?jsxRuntime.jsx("button",{type:"button",className:j("block min-w-0 overflow-hidden text-left",n?.root,r),onClick:()=>i?.(l,0),children:f}):jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",n?.root,r),children:f})}a(wi,"DataExplorerDisplayMedia");function dM(e){return e?Array.isArray(e)?e.every(t=>!!t&&typeof t=="object"&&("src"in t||"thumbnail"in t||"node"in t||"kind"in t)):typeof e=="object"&&("src"in e||"thumbnail"in e||"node"in e||"kind"in e):false}a(dM,"isDisplayMedia");function cM(e){if(e?.length)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((t,o)=>jsxRuntime.jsx("span",{title:t.title,className:j("inline-flex max-w-full items-center rounded-full border border-border/60 px-2 py-0.5 text-xs font-medium",t.tone==="primary"&&"border-primary/30 bg-primary/10 text-primary",t.tone==="success"&&"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))]",t.tone==="warning"&&"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",t.tone==="danger"&&"border-destructive/30 bg-destructive/10 text-destructive-text",t.tone==="muted"&&"bg-muted text-muted-foreground"),children:jsxRuntime.jsx("span",{className:"truncate",children:t.label})},t.id??o))})}a(cM,"renderBadges");function uM(e){if(e?.length)return jsxRuntime.jsx("dl",{className:"grid min-w-0 grid-cols-1 gap-2 text-xs sm:grid-cols-2",children:e.map((t,o)=>jsxRuntime.jsxs("div",{className:"min-w-0",children:[t.label?jsxRuntime.jsx("dt",{className:"truncate text-muted-foreground",title:t.title,children:t.label}):null,jsxRuntime.jsx("dd",{className:"mt-0.5 min-w-0 truncate text-foreground",children:t.value})]},t.id??o))})}a(uM,"renderMetadata");function pM(e){if(e?.length)return jsxRuntime.jsx("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:e.map((t,o)=>jsxRuntime.jsx("span",{className:"max-w-full truncate rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:t},o))})}a(pM,"renderKeywords");function Qn({item:e,title:t=e?.title,description:o=e?.description,badges:r=cM(e?.badges),meta:n=e?.status,actions:i,media:s=e?.media,header:l,headerLeading:d,headerContent:c,overlay:p,footer:u,children:g,selected:f=e?.selected,disabled:b=e?.disabled,interactive:x,role:y,tabIndex:k,appearance:w,className:v,classNames:h,onClick:S,onKeyDown:T}){let C=Ct(Et(w)),R=x??!!(S||T),I=l!==void 0?!!l:!!(d||c||t||o||r||n||i),B=dM(s)?jsxRuntime.jsx(wi,{media:s,fallbackTitle:t}):s,N=uM(e?.metadata),D=pM(e?.keywords),E=g!==void 0?g:N||D?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[N,D]}):void 0,P=!!E;return jsxRuntime.jsxs("article",{className:j(C.slots.cardRoot,R&&!b&&C.slots.cardInteractive,f&&C.slots.cardSelected,b&&C.slots.cardDisabled,h?.root,v),"aria-disabled":b||void 0,role:y,tabIndex:k,style:C.styles.cardRoot,onClick:b?void 0:S,onKeyDown:b?void 0:T,children:[p?jsxRuntime.jsx("div",{className:j(h?.overlay),children:p}):null,I?jsxRuntime.jsx("div",{className:j(C.slots.cardHeader,h?.header),children:l!==void 0?l:jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-start justify-between gap-3",h?.headerMain),children:[d?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",h?.headerLeading),children:d}):null,jsxRuntime.jsx("div",{className:j("min-w-0 flex-1",h?.headerContent),children:c??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t?jsxRuntime.jsx("div",{className:j("truncate text-sm font-semibold leading-none text-foreground",h?.title),children:t}):null,o?jsxRuntime.jsx("div",{className:j("mt-1 min-w-0 text-sm text-muted-foreground [overflow-wrap:anywhere]",h?.description),children:o}):null,r?jsxRuntime.jsx("div",{className:j("mt-2 flex flex-wrap items-center gap-2",h?.badges),children:r}):null]})}),n||i?jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n?jsxRuntime.jsx("div",{className:j("min-w-0 max-w-[12rem] truncate text-sm text-muted-foreground",h?.meta),children:n}):null,i?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",h?.actions),children:i}):null]}):null]})}):null,B?jsxRuntime.jsx("div",{className:j(C.slots.cardMedia,h?.media),children:B}):null,P?jsxRuntime.jsx("div",{className:j("min-w-0 px-4 pb-4",h?.body),children:E}):null,u?jsxRuntime.jsx("div",{className:j(C.slots.cardFooter,h?.footer),children:u}):null]})}a(Qn,"DataExplorerDisplayCard");function nc({media:e,title:t,description:o,meta:r,badges:n,actions:i,footer:s,children:l,className:d,classNames:c}){let p=!!t||!!o||!!r||!!n||!!i;return jsxRuntime.jsxs("article",{className:j("flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-background",c?.root,d),children:[e?jsxRuntime.jsx("div",{className:j("shrink-0 overflow-hidden",c?.media),children:e}):null,p?jsxRuntime.jsxs("div",{className:j("flex flex-col gap-3 p-4",c?.header),children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[t?jsxRuntime.jsx("div",{className:j("truncate text-sm font-semibold text-foreground",c?.title),children:t}):null,o?jsxRuntime.jsx("div",{className:j("mt-1 text-sm text-muted-foreground",c?.description),children:o}):null]}),r||i?jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r?jsxRuntime.jsx("div",{className:j("text-sm text-muted-foreground",c?.meta),children:r}):null,i?jsxRuntime.jsx("div",{className:j("flex items-center gap-2",c?.actions),children:i}):null]}):null]}),n?jsxRuntime.jsx("div",{className:j("flex flex-wrap items-center gap-2",c?.badges),children:n}):null]}):null,l?jsxRuntime.jsx("div",{className:j("min-w-0 px-4 pb-4",c?.body),children:l}):null,s?jsxRuntime.jsx("div",{className:j("shrink-0 border-t border-border/60 px-4 py-3",c?.footer),children:s}):null]})}a(nc,"DataExplorerViewItemShell");function ac(e){let{item:t,index:o,itemId:r,context:n,capabilities:i,itemDefinition:s,className:l,selected:d,actions:c,onOpen:p,onSelectionChange:u}=e;if(s?.render)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:s.render(e)});let g=typeof s?.shellProps=="function"?s.shellProps({item:t,index:o,itemId:r,context:n,capabilities:i,itemDefinition:s,className:l,selected:d,actions:c,onOpen:p,onSelectionChange:u}):s?.shellProps;return jsxRuntime.jsx(nc,{...g,className:l})}a(ac,"DataExplorerViewItem");function hM(e){switch(e){case "list":return "flex min-h-0 flex-col gap-3";case "waterfall":return "columns-1 gap-4 sm:columns-2 lg:columns-3";default:return "grid min-h-0 gap-4"}}a(hM,"getItemsClassName");function yM(e){if(e==="waterfall")return "mb-4 break-inside-avoid"}a(yM,"getDefaultItemClassName");function xM(e,t){return String(t)}a(xM,"defaultResolveItemId");function vM(e){return typeof e=="number"?`${Am(e,220)}px`:e}a(vM,"resolveMeasuredGridMinColumnWidth");function Ay(e,t,o){return Math.max(1,Math.ceil((e+o)/(t+o)))}a(Ay,"resolveMeasuredGridSpan");function Am(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}a(Am,"resolvePositiveNumber");function wM(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:t}a(wM,"resolveNonNegativeNumber");function Ci({items:e,activeViewId:t,context:o,capabilities:r,className:n,classNames:i,empty:s,loading:l,loadingNode:d,footer:c,overlay:p,layout:u="grid",scrollable:g=true,wrapItems:f=true,measuredGrid:b,itemsStyle:x,itemStyle:y,selectedIds:k=[],getItemId:w,itemDefinition:v,renderItem:h,getItemClassName:S,onOpenItem:T,onSelectionChange:C}){let R=Array.isArray(e)?e:[],M=new Set(k),I=w??xM,B=b===true?{}:b&&typeof b=="object"?b:void 0,N=u==="grid"&&!!(B?.enabled??b),D=Am(B?.rowHeight,4),E=wM(B?.gap,8),P=B?.minColumnWidth??"220px",W=ho.useRef(new Map),H=ho.useRef(new Map),A=ho.useRef(new Map),L=ho.useRef(null),[,F]=ho.useState(0),G=typeof y=="function"?ae=>y(ae):()=>y;ho.useEffect(()=>{if(!N||typeof ResizeObserver>"u")return;let ae=new ResizeObserver(ee=>{let q=false;for(let U of ee){let O=U.target.dataset.dataExplorerItemId;if(!O)continue;let K=Math.ceil(U.contentRect.height),ne=Ay(K,D,E);A.current.get(O)!==ne&&(A.current.set(O,ne),q=true);}q&&F(U=>U+1);});L.current=ae;for(let ee of W.current.values())ae.observe(ee);return ()=>{ae.disconnect(),L.current===ae&&(L.current=null);}},[N,E,D]),ho.useEffect(()=>{if(!N){W.current.clear(),H.current.clear(),A.current.clear();return}let ae=new Set(R.map((q,U)=>I(q,U))),ee=false;for(let q of A.current.keys())ae.has(q)||(A.current.delete(q),ee=true);for(let[q,U]of W.current.entries())ae.has(q)||(L.current?.unobserve(U),W.current.delete(q));for(let q of H.current.keys())ae.has(q)||H.current.delete(q);ee&&F(q=>q+1);},[N,R,I]);let $=ho.useCallback(ae=>{let ee=H.current.get(ae);if(ee)return ee;let q=a(U=>{let X=W.current.get(ae);X&&X!==U&&(L.current?.unobserve(X),W.current.delete(ae)),U&&(U.dataset.dataExplorerItemId=ae,W.current.set(ae,U),L.current?.observe(U));},"callback");return H.current.set(ae,q),q},[]),_=a(ae=>{let ee=ae.itemId;if(ee){let O=A.current.get(ee);if(O)return O}let q=B?.estimateItemHeight,U=typeof q=="function"?q(ae):typeof q=="number"?q:240,X=Am(U,240);return Ay(X,D,E)},"getMeasuredGridSpan"),z=a(()=>N?{...x,gap:E,gridAutoFlow:"dense",gridAutoRows:D,gridTemplateColumns:`repeat(auto-fill, minmax(${vM(P)}, 1fr))`}:x,"resolveMeasuredItemsStyle"),re=a(()=>l&&d?jsxRuntime.jsx("div",{className:j("flex items-center justify-center p-6 text-sm text-muted-foreground",i?.loading),children:d}):s?jsxRuntime.jsx("div",{className:j("flex items-center justify-center p-6 text-sm text-muted-foreground",i?.empty),children:s}):null,"renderStatus"),Z=a((ae,ee,q,U)=>{if(!C)return;let X=w?w(ae,ee):q,O=U?Array.from(new Set([...k,X])):k.filter(K=>K!==X);C(O);},"handleSelectionChange");return R.length===0&&!c&&!p?re():jsxRuntime.jsxs("div",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",i?.root,n),"data-view-id":t||void 0,children:[R.length>0?jsxRuntime.jsx("div",{className:j(hM(u),g&&"overflow-auto",i?.items),style:z(),children:R.map((ae,ee)=>{let q=I(ae,ee),U=M.has(q),O={item:ae,index:ee,itemId:q,context:o,capabilities:r,itemDefinition:v,selected:U,onOpen:T,onSelectionChange:a((ie,be)=>{Z(ie,ee,q,be);},"selectionChange")},K=j(yM(u),i?.item,S?.({...O,className:i?.item})),ne={...O,className:K},fe=h?h(ne):jsxRuntime.jsx(ac,{...ne}),he=G(ne),me=N?{...he,gridRowEnd:`span ${_(ne)}`}:he;return f?jsxRuntime.jsx("div",{className:K,style:me,children:N?jsxRuntime.jsx("div",{ref:$(q),children:fe}):fe},q):N?jsxRuntime.jsx("div",{className:K,style:me,children:jsxRuntime.jsx("div",{ref:$(q),children:fe})},q):jsxRuntime.jsx(ho.Fragment,{children:fe},q)})}):re(),l&&d&&R.length>0?jsxRuntime.jsx("div",{className:j("shrink-0 p-3 text-sm text-muted-foreground",i?.loading),children:d}):null,c?jsxRuntime.jsx("div",{className:j("shrink-0",i?.footer),children:c}):null,p?jsxRuntime.jsx("div",{className:j("absolute inset-0 z-10",i?.overlay),children:p}):null]})}a(Ci,"DataExplorerViewCollection");function sc({className:e,classNames:t,...o}){return jsxRuntime.jsx(Qn,{...o,className:j("rounded-md",e),classNames:{...t,root:j("flex-row items-stretch",t?.root),media:j("w-28 shrink-0",t?.media),header:j("flex min-w-0 flex-1 items-center p-3",t?.header),body:j("px-3 pb-3",t?.body)}})}a(sc,"DataExplorerDisplayListItem");function By(e,t){if(e)return typeof e=="function"?e(t):e}a(By,"resolveDisplayItemProps");function SM(e,t,o){let{item:r,layout:n}=e,i=!!t&&!r.disabled,s=o?.renderActions?o.renderActions(e):r.actions?.length?jsxRuntime.jsx(rc,{item:r,actions:r.actions,appearance:o?.appearance}):void 0,l={media:o?.renderMedia?o.renderMedia(e):void 0,actions:s,appearance:o?.appearance,interactive:i,onClick:i?()=>t?.(r):void 0};if(n==="list"){let c=By(o?.listItemProps,e);return jsxRuntime.jsx(sc,{...l,...c,item:r,className:j(l.className,c?.className)})}let d=By(o?.cardProps,e);return jsxRuntime.jsx(Qn,{...l,...d,item:r,className:j(l.className,d?.className)})}a(SM,"renderDefaultItem");function Ly({items:e,activeViewId:t="display",layout:o="grid",appearance:r,selectedIds:n,empty:i,loading:s,loadingNode:l,footer:d,overlay:c,className:p,classNames:u,scrollable:g,wrapItems:f,measuredGrid:b,itemsStyle:x,itemStyle:y,getItemClassName:k,cardProps:w,listItemProps:v,renderMedia:h,renderActions:S,renderItem:T,onOpenItem:C,onSelectionChange:R}){return jsxRuntime.jsx(Ci,{activeViewId:t,items:e,layout:o,selectedIds:n,className:p,classNames:u,empty:i,loading:s,loadingNode:l,footer:d,overlay:c,scrollable:g,wrapItems:f,measuredGrid:b,itemsStyle:x,itemStyle:typeof y=="function"?({item:M,index:I=0,itemId:B="",selected:N=false})=>y({item:M,index:I,itemId:B,selected:N,activeViewId:t,layout:o}):y,getItemId:M=>M.id,getItemClassName:k?({item:M,index:I=0,itemId:B="",selected:N=false})=>k({item:M,index:I,itemId:B,selected:N,activeViewId:t,layout:o}):void 0,renderItem:({item:M,index:I})=>(()=>{let B={item:M,index:I??0,itemId:M.id,selected:n?.includes(M.id)??false,activeViewId:t,layout:o};return T?T(M,B.index,B):SM(B,C,{cardProps:w,listItemProps:v,appearance:r,renderMedia:h,renderActions:S})})(),onOpenItem:C,onSelectionChange:R})}a(Ly,"DataExplorerDisplayCollectionView");function Bm(e,t){let o=typeof e=="function"?e():e;if(o===null)return null;if(!o||typeof o!="object"||o.nodeType!==1)throw new TypeError(`${t} must resolve to an Element or null.`);return o}a(Bm,"resolveContainerValue");function Lm({explicitProvided:e,explicitContainer:t,providerProvided:o,providerContainer:r,getDocument:n}){if(e)return Bm(t,"BasePortal container");if(o)return Bm(r,"MonkeysProvider portal.container");if(!n)return null;let i=n();if(i===null)return null;if(!i||typeof i!="object"||!("body"in i))throw new TypeError("MonkeysProvider environment.getDocument must resolve to a Document or null.");return Bm(i.body,"MonkeysProvider environment.getDocument().body")}a(Lm,"resolveBasePortalContainer");function MM(e){let t=di(),o=ci(),[r,n]=ho.useState(false);if(ho.useEffect(()=>{n(true);},[]),e.disabled!==void 0&&typeof e.disabled!="boolean")throw new TypeError("BasePortal disabled must be a boolean.");if(e.inline!==void 0&&typeof e.inline!="boolean")throw new TypeError("BasePortal inline must be a boolean.");let i=e.disabled??o.disabled??false;if(!r||i||e.inline)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children});let s=Lm({explicitProvided:e.container!==void 0,explicitContainer:e.container,providerProvided:o.container!==void 0,providerContainer:o.container,getDocument:t.getDocument});return s?reactDom.createPortal(e.children,s):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children})}a(MM,"BasePortal");function EM({mounted:e,explicitDisabled:t,explicitContainer:o,providerDisabled:r,providerContainer:n,getDocument:i}){let s=t??r??false;if(!e||s)return {mounted:e,disabled:s,shouldPortal:false,container:null,radixPortalProps:void 0};let l=Lm({explicitProvided:o!==void 0,explicitContainer:o,providerProvided:n!==void 0,providerContainer:n,getDocument:i});return l?{mounted:true,disabled:false,shouldPortal:true,container:l,radixPortalProps:Object.freeze({container:l})}:{mounted:true,disabled:false,shouldPortal:false,container:null,radixPortalProps:void 0}}a(EM,"resolveBaseOverlayPortalState");function AM(){return globalThis.document??null}a(AM,"getDefaultDocument");function wr(e={}){let t=di(),o=ci(),[r,n]=ho.useState(false);return ho.useEffect(()=>{n(true);},[]),EM({mounted:r,explicitDisabled:e.disabled,explicitContainer:e.container,providerDisabled:o.disabled,providerContainer:o.container,getDocument:t.getDocument??AM})}a(wr,"useBaseOverlayPortal");function Oy(e,t){return t.shouldPortal?reactDom.createPortal(e,t.container):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}a(Oy,"renderBaseOverlayPortalContent");function dc(e,t){if(typeof e!="boolean")throw new TypeError(`BaseTooltip ${t} must be a boolean.`)}a(dc,"validateBoolean");function HM(e){if(e!=="top"&&e!=="bottom"&&e!=="left"&&e!=="right")throw new TypeError('BaseTooltip placement must be "top", "bottom", "left", or "right".')}a(HM,"validatePlacement");function VM(e,t){return ho.isValidElement(e)&&e.type!==ho.Fragment?e:jsxRuntime.jsx("span",{tabIndex:!t&&V(e)?0:void 0,children:e})}a(VM,"normalizeTrigger");var To=ho.forwardRef(a(function({content:t,children:o,open:r,defaultOpen:n=false,placement:i="top",disabled:s=false,portal:l=false,appearance:d,className:c,classNames:p,style:u,onOpenChange:g,...f},b){r!==void 0&&dc(r,"open"),dc(n,"defaultOpen"),dc(s,"disabled"),dc(l,"portal"),HM(i);let x=Pe(d),y=ke(),k=Ne(x),w=wr({disabled:!l}),[v,h]=ho.useState(n),S=r!==void 0,T=!s&&V(t),R=T&&(S?r:v),M=l&&w.shouldPortal?"portaled":"inline",I=a(D=>{D&&!T||(S||h(D),g?.(D));},"handleOpenChange"),B=VM(o,s),N=T?jsxRuntime.jsx(mr__namespace.Content,{...y,side:i,sideOffset:8,collisionPadding:8,"data-monkeys-component":"tooltip","data-slot":"content","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipContent,p?.content),style:k.styles.tooltip,children:t}):null;return jsxRuntime.jsx("span",{...y,...f,ref:b,"data-monkeys-component":"tooltip","data-slot":"root","data-state":R?"open":"closed","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipRoot,p?.root,c),style:u,children:jsxRuntime.jsx(mr__namespace.Provider,{delayDuration:0,skipDelayDuration:0,disableHoverableContent:true,children:jsxRuntime.jsxs(mr__namespace.Root,{open:R,onOpenChange:I,delayDuration:0,disableHoverableContent:true,children:[jsxRuntime.jsx("span",{...y,"data-monkeys-component":"tooltip","data-slot":"trigger-wrapper","data-state":R?"open":"closed","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipTrigger,p?.trigger),children:jsxRuntime.jsx(mr__namespace.Trigger,{asChild:true,...y,"data-monkeys-component":"tooltip","data-slot":"trigger","data-placement":i,"data-portal":M,"data-disabled":s||void 0,children:B})}),l&&w.shouldPortal?jsxRuntime.jsx(mr__namespace.Portal,{...w.radixPortalProps,children:N}):N]})})})},"BaseTooltip"));var Hy=1.18,Vy=16,_y=1e6,zm=1e-6,Gy={topLeft:"left-4 top-4",top:"left-1/2 top-4 -translate-x-1/2",topRight:"right-4 top-4",left:"left-4 top-1/2 -translate-y-1/2",right:"right-4 top-1/2 -translate-y-1/2",bottomLeft:"bottom-4 left-4",bottom:"bottom-4 left-1/2 -translate-x-1/2",bottomRight:"bottom-4 right-4"},Bs=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),uc=a(e=>e instanceof Element&&!!e.closest('[data-no-drag="true"],button,a,input,textarea,select,[contenteditable="true"],[role="button"]'),"isNoDragTarget");function UM(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),jsxRuntime.jsx("path",{d:"M3 4v6h6"})]})}a(UM,"ResetIcon");function KM(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 5v14"}),jsxRuntime.jsx("path",{d:"M5 12h14"})]})}a(KM,"PlusIcon");function qM(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M5 12h14"})})}a(qM,"MinusIcon");var $y=ho.forwardRef(a(function({src:t,rotation:o=0,flipX:r=false,flipY:n=false,alt:i="Preview image",empty:s="No image preview",actions:l,actionContext:d,toolbarActions:c,zoomStep:p=Hy,stagePadding:u=Vy,minScale:g=zm,maxScale:f=_y,wheelZoom:b="plain",doubleClickAction:x="reset",panEnabled:y=true,keyboardEnabled:k=true,slots:w,overlay:v,imageOverlay:h,controlsPosition:S="bottomRight",renderControls:T,onScaleChange:C,controlsVisible:R=true,zoomLabelVisible:M=false,resetLabel:I="Reset image view",zoomInLabel:B="Zoom in",zoomOutLabel:N="Zoom out",originalSizeLabel:D="Original size",appearance:E,className:P,classNames:W,onLoad:H,onError:A},L){let F=Ct(E??{background:"dark-stage"}),G=typeof t=="string"?t.trim():"",$=ho.useRef(null),_=ho.useRef(null),z=ho.useRef({scale:1,translateX:u,translateY:u}),re=ho.useRef(void 0),[Z,ae]=ho.useState(null),[ee,q]=ho.useState(false),U=ho.useRef("page"),[{scale:X,translateX:O,translateY:K},ne]=ho.useState(()=>({scale:1,translateX:u,translateY:u}));ho.useLayoutEffect(()=>{z.current={scale:X,translateX:O,translateY:K};},[X,O,K]),ho.useLayoutEffect(()=>{ae(null),U.current="page";let le=re.current?.pointerId;le!==void 0&&$.current?.hasPointerCapture(le)&&$.current.releasePointerCapture(le),re.current=void 0,q(false),ne({scale:1,translateX:0,translateY:0});},[G]);let fe=ho.useRef(C);fe.current=C,ho.useEffect(()=>{Z&&fe.current?.(X);},[X,Z]);let he=Number.isFinite(g)?Math.max(zm,g):zm,me=Number.isFinite(f)?Math.max(he,f):_y,ie=Number.isFinite(p)&&p>1?p:Hy,be=Number.isFinite(u)&&u>=0?u:Vy,He=Number.isFinite(o)?o%360:0,We=ho.useCallback(le=>{let Me=He*Math.PI/180,Ae=Math.abs(Math.cos(Me)),J=Math.abs(Math.sin(Me));return {width:Math.round((le.width*Ae+le.height*J)*1e6)/1e6,height:Math.round((le.width*J+le.height*Ae)*1e6)/1e6}},[He]),Ke=Z?We(Z):null,ce=ho.useCallback((le,Me="page")=>{U.current=Me;let Ae=$.current,J=le??Z;if(!Ae||!J)return;let $e=We(J),ue=Math.max(0,Ae.clientWidth-be*2),Re=Math.max(0,Ae.clientHeight-be*2);if(ue<=0||Re<=0||$e.width<=0||$e.height<=0)return;let se=Me==="width"?ue/$e.width:Math.min(ue/$e.width,Re/$e.height),te=Bs(se,he,me),Te=$e.width*te,ze=$e.height*te;ne({scale:te,translateX:(Ae.clientWidth-Te)/2,translateY:(Ae.clientHeight-ze)/2});},[Z,me,he,be,We]),Q=ho.useCallback((le,Me)=>{if(!Number.isFinite(le)||!Number.isFinite(Me)||le<=0||Me<=0)return;let Ae=_.current;if(_.current={width:le,height:Me},!Ae||!G)return;if(U.current&&Z){ce(Z,U.current);return}let J=(le-Ae.width)/2,$e=(Me-Ae.height)/2;J===0&&$e===0||ne(ue=>({scale:ue.scale,translateX:ue.translateX+J,translateY:ue.translateY+$e}));},[G,Z,ce]);ho.useLayoutEffect(()=>{let le=$.current;if(!le)return;if(Q(le.clientWidth,le.clientHeight),typeof ResizeObserver<"u"){let Ae=new ResizeObserver(J=>{let $e=J[0];$e&&Q($e.contentRect.width,$e.contentRect.height);});return Ae.observe(le),()=>Ae.disconnect()}let Me=a(()=>{Q(le.clientWidth,le.clientHeight);},"handleResize");return window.addEventListener("resize",Me),()=>window.removeEventListener("resize",Me)},[Q]);let ge=ho.useCallback((le,Me,Ae)=>{!Number.isFinite(le)||le===1||!Number.isFinite(Me)||!Number.isFinite(Ae)||(U.current=null,ne(J=>{let $e=Bs(J.scale*le,he,me);if(!Number.isFinite($e)||$e===J.scale)return J;let ue=$e/J.scale;return {scale:$e,translateX:Me-(Me-J.translateX)*ue,translateY:Ae-(Ae-J.translateY)*ue}}));},[me,he]);ho.useEffect(()=>{let le=$.current;if(!le||!G||!Z)return;let Me=a(Ae=>{if(uc(Ae.target)||b==="disabled"||b==="modifier"&&!(Ae.ctrlKey||Ae.metaKey)||b==="plain"&&(Ae.ctrlKey||Ae.metaKey))return;Ae.preventDefault();let J=le.getBoundingClientRect(),$e=Ae.clientX-J.left,ue=Ae.clientY-J.top,Re=Ae.deltaY*(Ae.deltaMode===1?16:Ae.deltaMode===2?le.clientHeight:1),se=Math.pow(ie,-Bs(Re,-1e3,1e3)/100);ge(se,$e,ue);},"handleWheel");return le.addEventListener("wheel",Me,{passive:false}),()=>le.removeEventListener("wheel",Me)},[G,Z,ie,ge,b]),ho.useLayoutEffect(()=>{let le=$.current;if(!le||!Z)return;let Me=z.current.scale,Ae=Bs(Me,he,me);Ae!==Me&&ge(Ae/Me,le.clientWidth/2,le.clientHeight/2);},[Z,he,me,ge]);let we=ho.useCallback(le=>{if(le.button!==0||!y||!G||!Z||uc(le.target))return;let Me=$.current;Me&&(le.preventDefault(),Me.setPointerCapture(le.pointerId),Me.focus({preventScroll:true}),U.current=null,re.current={pointerId:le.pointerId,startClientX:le.clientX,startClientY:le.clientY,startTranslateX:z.current.translateX,startTranslateY:z.current.translateY},q(true));},[G,Z,y]),Ie=ho.useCallback(le=>{let Me=re.current;!Me||Me.pointerId!==le.pointerId||(le.preventDefault(),ne({scale:z.current.scale,translateX:Me.startTranslateX+le.clientX-Me.startClientX,translateY:Me.startTranslateY+le.clientY-Me.startClientY}));},[]),oe=ho.useCallback(le=>{let Me=re.current;if(!Me||Me.pointerId!==le.pointerId)return;re.current=void 0,q(false);let Ae=$.current;Ae?.hasPointerCapture(le.pointerId)&&Ae.releasePointerCapture(le.pointerId);},[]),xe=ho.useCallback(()=>{let le=$.current;if(!le||!Z)return;U.current=null;let Me=We(Z),Ae=Bs(1,he,me);ne({scale:Ae,translateX:(le.clientWidth-Me.width*Ae)/2,translateY:(le.clientHeight-Me.height*Ae)/2});},[Z,he,me,We]),Ve=ho.useCallback(le=>{!G||!Z||uc(le.target)||(x==="reset"&&ce(),x==="original-size"&&xe());},[G,Z,ce,xe,x]),_e=ho.useCallback(le=>{let Me=$.current;!Me||!Z||ge(le,Me.clientWidth/2,Me.clientHeight/2);},[Z,ge]),Ge={scale:X,ready:!!(G&&Z),canZoomIn:!!(Z&&X<me),canZoomOut:!!(Z&&X>he),zoomIn:a(()=>_e(ie),"zoomIn"),zoomOut:a(()=>_e(1/ie),"zoomOut"),reset:a(()=>ce(),"reset"),fitWidth:a(()=>ce(void 0,"width"),"fitWidth"),originalSize:xe};return ho.useImperativeHandle(L,()=>Ge),jsxRuntime.jsxs("div",{ref:$,"data-image-preview":true,tabIndex:k?0:void 0,onKeyDown:le=>{if(!k||!Ge.ready||uc(le.target))return;let Me=le.key==="+"||le.key==="="?Ge.zoomIn:le.key==="-"?Ge.zoomOut:le.key==="0"?Ge.reset:le.key==="1"?Ge.originalSize:void 0;Me&&(le.preventDefault(),le.stopPropagation(),Me());},className:tailwindMerge.twMerge(F.slots.previewRoot,G&&Z&&y?ee?"cursor-grabbing":"cursor-grab":"cursor-default",W?.root,P),onPointerDown:we,onPointerMove:Ie,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:oe,onDoubleClick:Ve,style:{touchAction:y?"none":void 0,...F.styles.previewRoot},children:[G?jsxRuntime.jsx("div",{"data-image-transform":true,className:tailwindMerge.twMerge("absolute left-0 top-0 will-change-transform",W?.imageLayer),style:{visibility:Z?"visible":"hidden",width:Ke?.width,height:Ke?.height,transform:`translate(${O}px, ${K}px) scale(${X})`,transformOrigin:"0 0"},children:jsxRuntime.jsxs("div",{"data-image-orientation":true,className:"absolute left-1/2 top-1/2",style:{width:Z?.width,height:Z?.height,transform:`translate(-50%, -50%) rotate(${He}deg) scaleX(${r?-1:1}) scaleY(${n?-1:1})`},children:[jsxRuntime.jsx("img",{src:G,style:Un(G),alt:i,draggable:false,className:tailwindMerge.twMerge("pointer-events-none max-h-none max-w-none select-none",W?.image),onLoad:le=>{let Me=le.currentTarget.naturalWidth,Ae=le.currentTarget.naturalHeight;if(!Me||!Ae)return;let J={width:Me,height:Ae};ae(J),ce(J),H?.(J);},onError:le=>{ae(null),A?.(le);}},G),h?jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0","data-image-coordinate-overlay":true,children:h}):null]})}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(F.slots.previewPlaceholder,W?.placeholder),children:s}),v?jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0","data-no-drag":"true",children:v}):null,Object.keys(Gy).map(le=>{let Me=le==="topRight"&&(c?.length||l),Ae=le===S&&R;return !w?.[le]&&!Me&&!Ae?null:jsxRuntime.jsxs("div",{"data-image-slot":le,"data-no-drag":"true",className:tailwindMerge.twMerge("absolute z-20 flex max-h-full max-w-full flex-col gap-2",Gy[le]),children:[w?.[le],Me?jsxRuntime.jsxs("div",{"data-no-drag":"true",className:tailwindMerge.twMerge(F.slots.previewActions,"static",W?.actions),children:[c?.length?jsxRuntime.jsx(sn,{context:d,actions:c,layout:"inline",appearance:E??{background:"dark-stage"}}):null,l]}):null,Ae?T?T(Ge):jsxRuntime.jsxs("div",{"data-no-drag":"true",className:tailwindMerge.twMerge(F.slots.previewControls,"static",W?.controls),children:[M?jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge(F.slots.previewZoomLabel,W?.zoomLabel),children:[Math.round(X*100),"%"]}):null,jsxRuntime.jsx(To,{content:N,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":N,disabled:!Ge.canZoomOut,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>_e(1/ie),children:jsxRuntime.jsx(qM,{})})}),jsxRuntime.jsx(To,{content:B,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":B,disabled:!Ge.canZoomIn,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>_e(ie),children:jsxRuntime.jsx(KM,{})})}),jsxRuntime.jsx(To,{content:I,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":I,disabled:!G||!Z,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>ce(),children:jsxRuntime.jsx(UM,{})})}),jsxRuntime.jsx(To,{content:D,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":D,disabled:!Ge.ready,className:tailwindMerge.twMerge(F.slots.previewControlButton,W?.controlButton),onClick:xe,children:jsxRuntime.jsx(lucideReact.Scan,{className:"h-4 w-4","aria-hidden":"true"})})})]}):null]},le)})]})},"DataExplorerImagePreview"));function pn(e,t){if(typeof e!="string")return;let o=e.trim();if(!o||/[\u0000-\u001f\u007f\\]/.test(o)||/^https?:/i.test(o)&&!/^https?:\/\//i.test(o))return;let r;try{r=new URL(o,"https://monkeys.invalid/");}catch{return}if(!(r.username||r.password)){if(r.protocol==="http:"||r.protocol==="https:"||t==="link"&&(r.protocol==="mailto:"||r.protocol==="tel:"))return o;if(r.protocol==="blob:"){if(r.pathname.startsWith("null/"))return o;try{let n=new URL(r.pathname);if(["https:","http:"].includes(n.protocol)&&!n.username&&!n.password)return o}catch{}}}}a(pn,"safeDisplayUrl");function jy(e){if(typeof e!="string"||!e.trim())return;let t=e.split(",");for(let o of t){let r=o.trim().split(/\s+/);if(!pn(r[0],"media")||r.length>2||r.length===2&&!/^(?:[1-9]\d*w|(?:\d+(?:\.\d+)?|\.\d+)x)$/.test(r[1]))return}return e}a(jy,"safeDisplaySrcSet");function Uy({kind:e}){return jsxRuntime.jsx(e==="image"?lucideReact.Image:e==="video"?lucideReact.Video:e==="audio"?lucideReact.Music2:lucideReact.FileText,{className:"h-6 w-6","aria-hidden":"true"})}a(Uy,"PreviewIcon");function qy({src:e,kind:t="image",alt:o="Preview",title:r,aspectRatio:n="auto",fit:i="contain",controls:s=true,loading:l=false,empty:d="No preview available",error:c="Preview is unavailable right now.",className:p,style:u,classNames:g,mediaAttributes:f,onLoad:b,onError:x}){let[y,k]=ho.useState(false),w=pn(e,"media")??"",v=Object.fromEntries(Object.entries(f??{}).flatMap(([C,R])=>{let M=C.toLowerCase();return M==="src"||M==="srcdoc"||M==="dangerouslysetinnerhtml"?[]:M==="srcset"?[["srcSet",jy(R)]]:M==="poster"?[["poster",pn(R,"media")]]:[[C,R]]}));ho.useEffect(()=>{k(false);},[w,t]);let h=a((C,R)=>jsxRuntime.jsx("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-2 bg-muted/30 p-4 text-center text-sm text-muted-foreground",g?.placeholder,R),role:l?"status":"img","aria-label":typeof C=="string"?C:void 0,children:C}),"renderPlaceholder");if(l)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,"aria-busy":"true",children:jsxRuntime.jsxs("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-2 bg-muted/30 p-4 text-sm text-muted-foreground",g?.loading),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-5 w-5 animate-spin","aria-hidden":"true"}),r||"Loading preview..."]})});if(!w||y)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,children:h(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Uy,{kind:t}),jsxRuntime.jsx("span",{className:j("max-w-full truncate",y?g?.error:void 0),children:y?c:d}),r?jsxRuntime.jsx("span",{className:"max-w-full truncate text-xs",children:r}):null]}))});let S=a(()=>{k(true),x?.();},"handleError"),T=t==="image"?jsxRuntime.jsx(Is,{...v,src:w,alt:o,fit:i,className:g?.media,loading:"lazy",decoding:"async",draggable:false,onLoad:b,onError:S}):t==="video"?jsxRuntime.jsx("video",{...v,src:w,className:j("block h-auto w-full",i==="cover"?"object-cover":"object-contain",g?.media),controls:s,preload:"metadata",onLoadedData:b,onError:S}):t==="audio"?jsxRuntime.jsx("audio",{...v,src:w,className:j("w-full",g?.media),controls:s,preload:"metadata",onCanPlay:b,onError:S}):h(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Uy,{kind:"file"}),jsxRuntime.jsx("span",{className:"max-w-full truncate",children:r||w})]}));return t==="image"?jsxRuntime.jsx(Ms,{aspectRatio:n,className:j(g?.root,p),style:u,children:T}):jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,children:T})}a(qy,"DataExplorerMediaPreview");function Xy({sidebar:e,tree:t,toolbar:o,controls:r,notices:n,content:i,view:s,detail:l,appearance:d,className:c,classNames:p}){let u=Et(d),g=u?Ct(u):void 0,f=t??e,b=r??o,x=s??i;return jsxRuntime.jsx(Ch,{appearance:u,children:jsxRuntime.jsxs("div",{className:j("flex h-full min-h-0 overflow-hidden",g?.slots.surfaceRoot,p?.root,c),style:g?.styles.surfaceRoot,children:[f?jsxRuntime.jsx("div",{className:j("min-h-0 shrink-0 overflow-hidden",p?.sidebar,p?.tree),children:f}):null,jsxRuntime.jsxs("div",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",p?.main),children:[b?jsxRuntime.jsx("div",{className:j("shrink-0",p?.toolbar,p?.controls),children:b}):null,n?jsxRuntime.jsx("div",{className:j("shrink-0",p?.notices),children:n}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden",p?.content,p?.view),children:x}),l?jsxRuntime.jsx("div",{className:j(p?.detail),children:l}):null]})]})})}a(Xy,"DataExplorerPage");function o2({item:e,selected:t,label:o,className:r,onToggleSelection:n}){return n?jsxRuntime.jsx("input",{type:"checkbox",checked:t,"aria-label":o,className:j("h-4 w-4 shrink-0 accent-primary",r),onChange:()=>n(e),onClick:i=>i.stopPropagation()}):null}a(o2,"DefaultCheckbox");function r2({item:e,active:t,label:o,className:r,onToggleFavorite:n}){return n?jsxRuntime.jsxs("button",{type:"button","aria-pressed":t,title:o,className:j("inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",t&&"text-[hsl(var(--warning,45_93%_47%))]",r),onClick:i=>{i.stopPropagation(),n(e);},children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:t?"currentColor":"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8-6.2-3.3L5.8 21 7 14.2 2 9.3l6.9-1L12 2Z"})}),jsxRuntime.jsx("span",{className:"sr-only",children:o})]}):null}a(r2,"DefaultFavorite");function n2({item:e,limit:t,classNames:o}){let r=e.keywords??[];if(r.length===0)return null;let n=r.slice(0,t),i=Math.max(0,r.length-n.length);return jsxRuntime.jsxs("div",{className:j("mt-2 flex flex-wrap gap-2",o?.keywords),children:[n.map((s,l)=>jsxRuntime.jsx("span",{className:j("max-w-full truncate rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",o?.keyword),title:typeof s=="string"?s:void 0,children:s},l)),i>0?jsxRuntime.jsxs("span",{className:j("rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground",o?.keywordOverflow),children:["+",i]}):null]})}a(n2,"renderKeywords");function Qy({item:e,selected:t=e.selected??false,active:o,disabled:r=e.disabled,hasMedia:n,showHeaderWithMedia:i=false,selectionVisible:s,favoriteVisible:l,overlayControlsAlwaysVisible:d,favoriteActive:c=false,favoriteLabel:p="Favorite",favoriteActiveLabel:u="Unfavorite",selectLabel:g="Select item",unselectLabel:f="Unselect item",actions:b,media:x,footer:y,checkbox:k,favorite:w,keywordLimit:v=3,appearance:h,className:S,classNames:T,onClick:C,onToggleSelection:R,onToggleFavorite:M}){let I=Ct(Et(h)),B=n??!!(x??e.media),N=!B||i,D=s??!!(t||R),E=l??!!(w||M),P=c?u:p,H=k??(D?jsxRuntime.jsx(o2,{item:e,selected:t,label:t?f:g,className:T?.selectionControl,onToggleSelection:R}):null),A=w??(E?jsxRuntime.jsx(r2,{item:e,active:c,label:P,className:T?.favoriteControl,onToggleFavorite:M}):null),L=x??(e.media?jsxRuntime.jsx(wi,{media:e.media,fallbackTitle:e.title}):void 0),F=N?jsxRuntime.jsxs("div",{className:j("flex flex-col",T?.header),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center justify-between gap-2",T?.headerMain),children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[H,jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:e.title?jsxRuntime.jsx("h3",{className:j("truncate text-sm font-semibold leading-none",T?.title),children:e.title}):null})]}),A||b?jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[A,b]}):null]}),n2({item:e,limit:v,classNames:T})]}):null,G=B&&(H||A||b)?jsxRuntime.jsx("div",{className:j("absolute inset-x-2 top-2 z-10",T?.overlay),children:jsxRuntime.jsxs("div",{className:j("flex items-start justify-between gap-1 transition-opacity",t||d?"opacity-100":"opacity-0 group-hover:opacity-100",T?.overlayControls),children:[H??jsxRuntime.jsx("span",{}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[A,b?jsxRuntime.jsx("div",{className:j(T?.floatingActions),children:b}):null]})]})}):null;return jsxRuntime.jsx(Qn,{item:e,selected:t,disabled:r,appearance:h,className:j(I.slots.recordCardRoot,o&&I.slots.recordCardActive,T?.root,S),classNames:{overlay:T?.overlay,header:j(B?"p-3":"p-3 pb-2",T?.header),media:j("p-0 bg-muted/30",T?.media),footer:T?.footer},header:F,overlay:G,media:L?jsxRuntime.jsx("div",{className:j("relative overflow-hidden",T?.mediaFrame),children:L}):void 0,footer:y,children:null,onClick:C})}a(Qy,"DataExplorerRecordCard");var c2=a((e,t)=>{let o=t?Array.isArray(e)?e:e?[e]:[]:typeof e=="string"?[e]:[];return Array.from(new Set(o.filter(r=>typeof r=="string"&&r.length>0)))},"normalizeValues"),Fm=a(e=>e.textValue??(typeof e.label=="string"?e.label:e.value),"getOptionText");function tx({value:e,activeValue:t,options:o=[],createOption:r,multiple:n=false,placeholder:i="Select a record",triggerLabel:s,triggerIcon:l,searchPlaceholder:d="Search records",emptyState:c="No records found",loadingState:p,loadingMoreState:u,errorState:g,loading:f=false,loadingMore:b=false,disabled:x=false,open:y,defaultOpen:k=false,searchValue:w,defaultSearchValue:v="",appearance:h,className:S,classNames:T,triggerProps:C,dataAttributes:R,onOpenChange:M,onListScroll:I,onSearchValueChange:B,onValueChange:N}){let D=Ct(Et(h)),[E,P]=ho.useState(k),[W,H]=ho.useState(v),A=y!==void 0,L=A?y:E,F=w!==void 0,G=F?w:W,$=ho.useMemo(()=>c2(e,n),[n,e]),_=ho.useMemo(()=>new Set($),[$]),z=$.map(X=>o.find(O=>O.value===X)).filter(X=>!!X),re=r?[r,...o]:o,Z=z.length?n&&z.length>1?`${z.slice(0,2).map(X=>Fm(X)).join(", ")} +${z.length-2}`:Fm(z[0]):i;ho.useEffect(()=>{if(!L)return;let X=a(O=>{O.key==="Escape"&&M?.(false);},"handleKeyDown");return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[L,M]);let ae=a(X=>{x||(A||P(X),M?.(X));},"setOpen"),ee=a(X=>{F||H(X),B?.(X);},"setQuery"),q=a(X=>{if(!(x||X.disabled)){if(n){let O=_.has(X.value)?$.filter(K=>K!==X.value):[...$,X.value];N?.(O);return}N?.(X.value),ae(false);}},"handleOptionClick"),U=a(X=>{x||N?.($.filter(O=>O!==X));},"removeValue");return jsxRuntime.jsxs("div",{...R?.root,className:j("relative min-w-0 w-full",T?.root,S),children:[jsxRuntime.jsxs(Hn__namespace.Root,{open:L,onOpenChange:ae,children:[jsxRuntime.jsx(Hn__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{...C,...R?.trigger,type:"button",disabled:x,"aria-label":s,"aria-expanded":L,className:j(D.slots.controlSelectTrigger,T?.trigger),children:[l,jsxRuntime.jsx("span",{...R?.triggerValue,className:j(D.slots.controlSelectValue,!z.length&&"text-muted-foreground",T?.triggerValue),children:Z}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 shrink-0","aria-hidden":"true"})]})}),jsxRuntime.jsx(Hn__namespace.Portal,{children:jsxRuntime.jsxs(Hn__namespace.Content,{...R?.content,align:"start",sideOffset:6,className:j("z-50 w-[min(30rem,calc(100vw-2rem))] rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-md",T?.content),onOpenAutoFocus:X=>X.preventDefault(),children:[jsxRuntime.jsxs("label",{className:j("flex h-9 items-center gap-2 rounded-md border border-border bg-background px-2 text-sm",T?.search),children:[jsxRuntime.jsx(lucideReact.Search,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("input",{autoFocus:true,value:G,onChange:X=>ee(X.target.value),placeholder:d,"aria-label":d,className:"min-w-0 flex-1 bg-transparent outline-hidden placeholder:text-muted-foreground"})]}),jsxRuntime.jsx("div",{className:j("mt-2 max-h-72 overflow-y-auto",T?.list),...R?.list,role:"listbox","aria-multiselectable":n||void 0,onScroll:I,children:f?jsxRuntime.jsxs("div",{...R?.loading,className:j("flex min-h-16 items-center justify-center gap-2 px-3 py-4 text-sm text-muted-foreground",T?.status),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),p??"Loading records..."]}):g?jsxRuntime.jsx("div",{...R?.error,className:j("px-3 py-4 text-sm text-destructive-text",T?.status),children:g}):re.length===0?jsxRuntime.jsx("div",{...R?.empty,className:j("px-3 py-4 text-sm text-muted-foreground",T?.status),children:c}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[re.map(X=>{let O=_.has(X.value);return jsxRuntime.jsxs("button",{...R?.option,type:"button",role:"option","aria-selected":O,"aria-current":t!==void 0&&X.value===t?"true":void 0,disabled:X.disabled,onClick:()=>q(X),className:j("flex w-full items-start gap-2 rounded-sm px-2.5 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50",O&&"bg-accent/60",T?.option),children:[jsxRuntime.jsx("span",{className:j("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center",T?.optionIndicator),children:O?jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4","aria-hidden":"true"}):null}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:j("block truncate",T?.optionLabel),children:X.label}),X.description?jsxRuntime.jsx("span",{className:j("mt-0.5 block truncate text-xs text-muted-foreground",T?.optionDescription),children:X.description}):null]})]},X.value)}),b?jsxRuntime.jsxs("div",{...R?.loadingMore,className:j("flex items-center justify-center gap-2 px-3 py-2 text-xs text-muted-foreground",T?.status),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),u??"Loading more records..."]}):null]})})]})})]}),n&&z.length>0?jsxRuntime.jsx("div",{className:j("mt-2 flex flex-wrap gap-1.5",T?.selectedList),children:z.map(X=>jsxRuntime.jsxs("span",{className:j("inline-flex max-w-full items-center gap-1 rounded-full border border-border bg-muted px-2 py-1 text-xs",T?.selectedItem),children:[jsxRuntime.jsx("span",{className:j("min-w-0 truncate",T?.selectedItemLabel),children:X.label}),jsxRuntime.jsx("button",{type:"button","aria-label":`Remove ${Fm(X)}`,onClick:()=>U(X.value),className:j("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",T?.selectedItemRemove),children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3","aria-hidden":"true"})})]},X.value))}):null]})}a(tx,"DataExplorerRecordPicker");function b2({items:e,value:t,defaultValue:o,allowCollapse:r,keyboardNavigation:n}){if(!Array.isArray(e))throw new TypeError("BaseAccordion items must be an array.");if(t!==void 0&&(typeof t!="string"||!t.trim()))throw new TypeError("BaseAccordion value must be a non-empty string when provided.");if(o!==void 0&&(typeof o!="string"||!o.trim()))throw new TypeError("BaseAccordion defaultValue must be a non-empty string when provided.");if(typeof r!="boolean")throw new TypeError("BaseAccordion allowCollapse must be a boolean.");if(typeof n!="boolean")throw new TypeError("BaseAccordion keyboardNavigation must be a boolean.");let i=new Set;e.forEach((s,l)=>{if(!s||typeof s!="object")throw new TypeError(`BaseAccordion item at index ${l} must be an object.`);if(typeof s.value!="string"||!s.value.trim())throw new TypeError(`BaseAccordion item value at index ${l} must be a non-empty string.`);if(i.has(s.value))throw new TypeError(`BaseAccordion items must use unique values; duplicate value ${JSON.stringify(s.value)} at index ${l}.`);if(s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseAccordion item disabled at index ${l} must be a boolean.`);i.add(s.value);});}a(b2,"validateBaseAccordionProps");function g2(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(g2,"toDomId");function h2(e){let t=new Set;return e.map((o,r)=>{let n=g2(o.value)||`item-${r}`,i=n;if(t.has(i))for(i=`${n}-${r}`;t.has(i);)i=`${i}-${r}`;return t.add(i),i})}a(h2,"getDomIdFragments");var nx=ho.forwardRef(a(function({items:t=[],value:o,defaultValue:r,allowCollapse:n=true,keyboardNavigation:i=true,appearance:s,className:l,classNames:d,style:c,onValueChange:p,id:u,onFocusCapture:g,onBlurCapture:f,...b},x){b2({items:t,value:o,defaultValue:r,allowCollapse:n,keyboardNavigation:i});let y=Pe(s),k=ke(),w=Ne(y),v=ho.useId(),h=u??v,[S,T]=ho.useState(r),[C,R]=ho.useState(),M=ho.useRef(new Map),I=ho.useRef(false),B=o!==void 0,N=B?o:S,D=h2(t),E=t.filter(_=>!_.disabled),P=t.find(_=>_.value===N),W=typeof b.dir=="string"?b.dir:k.dir;ho.useEffect(()=>{if(!I.current||C===void 0)return;let _=t.find(re=>re.value===C);if(_&&!_.disabled)return;let z=E.find(re=>re.value===N)??E[0];if(!z){I.current=false;return}R(z.value),M.current.get(z.value)?.focus();},[E,C,t,N]);let H=a(_=>{if(_.disabled)return;let z=N===_.value;if(z&&!n){p?.(_.value);return}let re=z?void 0:_.value;B||T(re),p?.(re);},"handleToggle"),A=a((_,z,re)=>{if(!i||E.length===0)return;let Z;if(re==="first")Z=E[0];else if(re==="last")Z=E[E.length-1];else {let ee=(E.findIndex(q=>q.value===z.value)+re+E.length)%E.length;Z=E[ee];}Z&&(_.preventDefault(),R(Z.value),M.current.get(Z.value)?.focus());},"moveFocus"),L=a((_,z)=>{z.disabled||(_.key==="ArrowDown"?A(_,z,1):_.key==="ArrowUp"?A(_,z,-1):_.key==="Home"?A(_,z,"first"):_.key==="End"&&A(_,z,"last"));},"handleKeyDown"),F=a(_=>_ instanceof HTMLElement&&_.dataset.accordionOwner===h,"isOwnedTrigger"),G=a(_=>{F(_.target)&&(I.current=true),g?.(_);},"handleFocusCapture"),$=a(_=>{F(_.target)&&!F(_.relatedTarget)&&(I.current=false),f?.(_);},"handleBlurCapture");return jsxRuntime.jsx("div",{...k,...b,ref:x,id:u,dir:W,"data-monkeys-component":"accordion","data-slot":"root","data-state":P?"open":"closed","data-collapsible":n,"data-keyboard-navigation":i,className:m(w.slots.accordionRoot,d?.root,l),style:{...w.styles.accordion,...c},onFocusCapture:G,onBlurCapture:$,children:t.map((_,z)=>{let re=D[z],Z=`${h}-${re}-trigger`,ae=`${h}-${re}-panel`,ee=_.value===N,q=ee?"open":"closed";return ho.createElement("div",{...k,key:_.value,dir:W,"data-monkeys-component":"accordion","data-slot":"item","data-state":q,"data-disabled":_.disabled||void 0,className:m(w.slots.accordionItem,d?.item)},jsxRuntime.jsxs("button",{...k,ref:U=>{U?M.current.set(_.value,U):M.current.delete(_.value);},id:Z,type:"button","aria-expanded":ee,"aria-controls":ae,"aria-disabled":_.disabled||void 0,disabled:_.disabled,dir:W,"data-accordion-owner":h,"data-monkeys-component":"accordion","data-slot":"trigger","data-state":q,"data-disabled":_.disabled||void 0,className:m(w.slots.accordionTrigger,d?.trigger),onFocus:()=>R(_.value),onKeyDown:U=>L(U,_),onClick:()=>H(_),children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:_.title}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-monkeys-component":"accordion","data-slot":"trigger-icon","data-state":q,className:m(w.slots.accordionTriggerIcon,ee&&"rotate-[225deg]",d?.triggerIcon)})]}),ee?jsxRuntime.jsx("div",{...k,id:ae,role:"region","aria-labelledby":Z,dir:W,"data-monkeys-component":"accordion","data-slot":"panel","data-state":"open",className:m(w.slots.accordionPanel,d?.panel),children:V(_.content)?_.content:null}):null)})})},"BaseAccordion"));var C2={sm:"h-7 w-7 text-xs",md:"h-9 w-9 text-sm",lg:"h-12 w-12 text-base"},ix={online:"bg-[hsl(var(--success,142_72%_29%))]",busy:"bg-[hsl(var(--warning,45_93%_47%))]",offline:"bg-muted-foreground",neutral:"bg-muted-foreground"};function ax(e){return typeof e=="string"&&e in ix}a(ax,"isStatusPreset");function S2(e){if(!e)return;let t=e.trim().split(/\s+/).filter(Boolean);if(t.length)return t.slice(0,2).map(o=>o[0]?.toUpperCase()).join("")}a(S2,"getInitials");var fc=ho.forwardRef(a(function({src:t,alt:o,name:r,initials:n,icon:i,status:s,size:l="md",appearance:d,className:c,classNames:p,style:u,children:g,title:f,...b},x){if(l!=="sm"&&l!=="md"&&l!=="lg")throw new TypeError('BaseAvatar size must be "sm", "md", or "lg".');let y=Pe(d),k=ke(),w=Ne(y),[v,h]=ho.useState(),T=!!t&&!!!(t&&v===t),C=S2(r),R=V(g)?"children":V(n)?"initials":V(C)?"name":V(i)?"icon":"default",M=V(g)?g:V(n)?n:V(C)?C:V(i)?i:"?",I=ax(s)?s:V(s)?"custom":void 0;return ho.useEffect(()=>{h(void 0);},[t]),jsxRuntime.jsxs("div",{...k,...b,ref:x,title:f??r,"data-monkeys-component":"avatar","data-slot":"root","data-state":T?"image":"fallback","data-size":l,"data-status":I,"data-fallback":T?void 0:R,className:m(w.slots.avatarRoot,C2[l],p?.root,c),style:{...w.styles.avatar,...u},children:[T?jsxRuntime.jsx("img",{src:t,alt:o??r??"","data-slot":"image","data-size":l,"data-status":I,className:m(w.slots.avatarImage,p?.image),onError:()=>h(t)}):jsxRuntime.jsx("span",{"data-slot":"fallback","data-size":l,"data-status":I,"data-fallback":R,className:m(w.slots.avatarFallback,p?.fallback,p?.text),children:M}),ax(s)?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"status","data-size":l,"data-status":s,className:m(w.slots.avatarStatus,ix[s],p?.status)}):V(s)?jsxRuntime.jsx("span",{"data-slot":"status","data-size":l,"data-status":"custom",className:m(w.slots.avatarStatus,p?.status),children:s}):null]})},"BaseAvatar"));function R2(e){if(!Number.isFinite(e)||e<=0)throw new RangeError("BaseAspectRatio ratio must be a positive finite number.");return String(e)}a(R2,"resolveAspectRatio");var M2=ho.forwardRef(a(function({children:t,ratio:o=16/9,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);return jsxRuntime.jsx("div",{...p,...l,ref:d,"data-monkeys-component":"aspect-ratio","data-slot":"root","data-ratio":o,className:m(u.slots.aspectRatioRoot,i?.root,n),style:{...u.styles.aspectRatio,aspectRatio:R2(o),...s},children:t})},"BaseAspectRatio"));var bc=ho.forwardRef(a(function({children:t,label:o,icon:r,tone:n,appearance:i,variant:s,density:l,state:d,className:c,classNames:p,style:u,...g},f){if(n!==void 0&&n!=="default"&&n!=="primary"&&n!=="success"&&n!=="warning"&&n!=="danger"&&n!=="muted")throw new TypeError('BaseBadge tone must be "default", "primary", "success", "warning", "danger", or "muted".');let b=Pe(i),x=ke(),y=Ne({...b,variant:s,density:l,state:d}),k=t??o,w=n??"default";return jsxRuntime.jsxs("span",{...x,...g,ref:f,"data-monkeys-component":"badge","data-slot":"root","data-tone":w,"data-variant":y.variant,"data-density":y.density,"data-state":y.state,className:m(y.slots.badgeBase,Ld(y,n),p?.root,c),style:{...y.styles.badge,...u},children:[r?jsxRuntime.jsx("span",{"data-slot":"icon","data-tone":w,className:m(y.slots.badgeIcon,p?.icon),children:r}):null,k!=null?jsxRuntime.jsx("span",{"data-slot":"label","data-tone":w,className:m(y.slots.badgeLabel,p?.label),children:k}):null]})},"BaseBadge"));function E2(e,t,o){return e.current??t===o-1}a(E2,"isCurrentItem");function lx({items:e=[],separator:t="/",appearance:o,className:r,classNames:n,style:i,onSelect:s,...l}){let d=Ne(o),c=a((p,u,g)=>{if(u.disabled){p.preventDefault();return}s?.(u,g);},"handleClick");return jsxRuntime.jsx("nav",{...l,"aria-label":l["aria-label"]??"Breadcrumb",className:m(d.slots.breadcrumbRoot,n?.root,r),style:{...d.styles.breadcrumb,...i},children:jsxRuntime.jsx("ol",{className:m(d.slots.breadcrumbList,n?.list),children:e.map((p,u)=>{let g=E2(p,u,e.length);return jsxRuntime.jsxs("li",{className:m(d.slots.breadcrumbItem,n?.item),children:[g?jsxRuntime.jsx("span",{"aria-current":"page",className:m(d.slots.breadcrumbCurrent,n?.current),children:p.label}):p.href?jsxRuntime.jsx("a",{href:p.href,"aria-disabled":p.disabled||void 0,className:m(d.slots.breadcrumbLink,n?.link),onClick:f=>c(f,p,u),children:p.label}):jsxRuntime.jsx("button",{type:"button",disabled:p.disabled,className:m(d.slots.breadcrumbLink,"bg-transparent p-0",n?.link),onClick:f=>c(f,p,u),children:p.label}),u<e.length-1?jsxRuntime.jsx("span",{"aria-hidden":"true",className:m(d.slots.breadcrumbSeparator,n?.separator),children:t}):null]},`${u}-${p.value??p.href??String(p.label)}`)})})})}a(lx,"BaseBreadcrumb");var L2={sm:"h-8 px-2.5 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-3.5 text-base"},W2={sm:"h-8 w-8 px-0",md:"h-9 w-9 px-0",lg:"h-10 w-10 px-0"},Hm={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"};function gc(e){return typeof e=="string"&&e.trim()?e:void 0}a(gc,"nonEmptyText");function z2(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-full w-full motion-safe:animate-spin motion-reduce:animate-none",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(z2,"LoadingIcon");var mt=ho.forwardRef(a(function({children:t,label:o,icon:r,endIcon:n,type:i="button",title:s,ariaLabel:l,tone:d,size:c,active:p=false,iconOnly:u=false,disabled:g=false,loading:f=false,stopPropagation:b=false,appearance:x,variant:y,density:k,state:w,className:v,classNames:h,style:S,onClick:T,"aria-label":C,"aria-pressed":R,...M},I){for(let[z,re]of [["active",p],["iconOnly",u],["disabled",g],["loading",f],["stopPropagation",b]])if(typeof re!="boolean")throw new TypeError(`BaseButton ${z} must be a boolean.`);if(c!==void 0&&c!=="sm"&&c!=="md"&&c!=="lg")throw new TypeError('BaseButton size must be "sm", "md", or "lg".');if(d!==void 0&&d!=="default"&&d!=="primary"&&d!=="success"&&d!=="warning"&&d!=="danger"&&d!=="muted")throw new TypeError('BaseButton tone must be "default", "primary", "success", "warning", "danger", or "muted".');let B=Pe(x),N=ke(),D=Ne({...B,variant:y,density:k,state:w}),E=t??o,P=V(E)&&(typeof E!="string"||!!E.trim()),W=gc(l)??gc(C),H=typeof E=="string"?gc(E):void 0,A=gc(s);if(u&&!P&&!W&&!A)throw new TypeError("BaseButton iconOnly requires ariaLabel, aria-label, title, or a renderable label.");let L=W??H??A,F=g||f,G=d??"default",$=w??(f?"loading":g?"disabled":p?"active":"idle"),_=a(z=>{b&&z.stopPropagation(),!F&&T?.(z);},"handleClick");return jsxRuntime.jsxs("button",{...N,...M,ref:I,type:i,title:s,"aria-label":L,"aria-pressed":R??(p||void 0),"aria-busy":f||void 0,"data-variant":D.variant,"data-density":D.density,disabled:F,"data-monkeys-component":"button","data-slot":"root","data-state":$,"data-tone":G,"data-size":c,"data-active":p||void 0,"data-loading":f||void 0,"data-disabled":F||void 0,"data-icon-only":u||void 0,className:m(D.slots.buttonBase,u&&D.slots.buttonIconOnly,c&&L2[c],u&&c&&W2[c],Gn(D,d,p),F&&D.slots.buttonDisabled,h?.root,v),style:{...D.styles.button,...p?D.styles.buttonActive:void 0,...F?D.styles.buttonDisabled:void 0,...S},onClick:_,children:[f?jsxRuntime.jsx("span",{"data-slot":"icon","data-state":$,"data-tone":G,"data-size":c,className:m(D.slots.buttonIcon,c&&Hm[c],h?.icon),children:jsxRuntime.jsx(z2,{})}):r?jsxRuntime.jsx("span",{"data-slot":"icon","data-state":$,"data-tone":G,"data-size":c,className:m(D.slots.buttonIcon,c&&Hm[c],h?.icon),children:r}):null,u?V(E)?jsxRuntime.jsx("span",{"data-slot":"label","data-state":$,"data-tone":G,"data-size":c,className:"sr-only",children:E}):null:V(E)?jsxRuntime.jsx("span",{"data-slot":"label","data-state":$,"data-tone":G,"data-size":c,className:m(D.slots.buttonLabel,h?.label),children:E}):null,!f&&n?jsxRuntime.jsx("span",{"data-slot":"end-icon","data-state":$,"data-tone":G,"data-size":c,className:m(D.slots.buttonIcon,c&&Hm[c],h?.icon,h?.endIcon),children:n}):null]})},"BaseButton"));var F2=ho.forwardRef(a(function({children:t,display:o="inline",appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);return o==="block"?jsxRuntime.jsx("pre",{...p,...l,ref:d,"data-monkeys-component":"code","data-slot":"root","data-display":"block",className:m(u.slots.codeBlock,i?.root,n),style:{...u.styles.code,...s},children:jsxRuntime.jsx("code",{"data-slot":"code",className:m(u.slots.codeContent,i?.code),style:u.styles.codeContent,children:t})}):jsxRuntime.jsx("code",{...p,...l,ref:d,"data-monkeys-component":"code","data-slot":"root","data-display":"inline",className:m(u.slots.codeInline,u.slots.codeContent,i?.root,i?.code,n),style:{...u.styles.code,...u.styles.codeContent,...s},children:t})},"BaseCode"));function cx(e,t){let o=Number.isFinite(t?.speed)?Math.max(-1,Math.min(1,t.speed)):0,r=Number.isFinite(t?.maxOffset)?Math.max(0,Math.min(200,t.maxOffset)):16;ho.useEffect(()=>{let n=e.current;if(!n||!o||!r)return;let i=n.ownerDocument.defaultView;if(!i)return;let s=n.parentElement;for(;s&&!/(auto|scroll|overlay)/.test(i.getComputedStyle(s).overflowY);)s=s.parentElement;let l=s,d=l??i,c=i.matchMedia("(prefers-reduced-motion: reduce)"),p=n.style.translate,u,g=false,f=a(()=>{u=void 0;let k=Math.max(-r,Math.min(r,Math.max(0,l?l.scrollTop:i.scrollY)*o));n.style.translate=`0 ${k}px`;},"update"),b=a(()=>{u===void 0&&(u=i.requestAnimationFrame(f));},"schedule"),x=a(()=>{d.removeEventListener("scroll",b),g=false,u!==void 0&&i.cancelAnimationFrame(u),u=void 0,n.style.translate=p;},"stop"),y=a(()=>{c.matches?x():g||(d.addEventListener("scroll",b,{passive:true}),g=true,f());},"syncPreference");return c.addEventListener("change",y),y(),()=>{x(),c.removeEventListener("change",y);}},[e,o,r]);}a(cx,"useScrollMotion");var $2=ho.forwardRef(a(function({children:t,maxWidth:o="80rem",padding:r="1rem",scrollMotion:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=ho.useRef(null),g=ho.useCallback(w=>{u.current=w,typeof p=="function"?p(w):p&&(p.current=w);},[p]);cx(u,n);let f=Pe(i),b=ke(),x=Ne(f),y=rr("BaseContainer","maxWidth",o),k=rr("BaseContainer","padding",r);return jsxRuntime.jsx("div",{...b,...c,ref:g,"data-monkeys-component":"container","data-slot":"root",className:m(x.slots.containerRoot,l?.root,s),style:{...x.styles.container,maxWidth:y,paddingInline:k,...d},children:t})},"BaseContainer"));var U2=["default","primary","success","warning","danger","muted"];function Lo(e,t){if(typeof e!="boolean")throw new TypeError(`BaseContextMenu ${t} must be a boolean.`)}a(Lo,"validateBoolean");function hc(e){if(e!==void 0&&!U2.includes(e))throw new TypeError('BaseContextMenu tone must be "default", "primary", "success", "warning", "danger", or "muted".')}a(hc,"validateTone");function K2(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('BaseContextMenu dir must be "ltr" or "rtl".')}a(K2,"validateDirection");function q2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 4.5"})})}a(q2,"CheckIcon");function Y2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"currentColor",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3"})})}a(Y2,"DotIcon");function X2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 4 4 4-4 4"})})}a(X2,"ChevronRightIcon");function _m({label:e,icon:t,shortcut:o,children:r,classNames:n,inset:i,indicator:s}){let l=r??e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s||null,V(t)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(n?.icon),children:t}):i?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"icon",className:"h-4 w-4 shrink-0"}):null,V(l)?jsxRuntime.jsx("span",{"data-slot":"label",className:m(n?.label),children:l}):null,V(o)?jsxRuntime.jsx("span",{"data-slot":"shortcut",className:m(n?.shortcut),children:o}):null]})}a(_m,"renderItemContent");function yc({children:e,trigger:t,content:o,disabled:r=false,modal:n=true,dir:i,appearance:s,className:l,classNames:d,onOpenChange:c}){Lo(r,"disabled"),Lo(n,"modal"),K2(i);let p=li(),u=Pe(s);return jsxRuntime.jsxs(Tt__namespace.Root,{onOpenChange:c,modal:n,dir:i??p,children:[t?jsxRuntime.jsx(Ls,{disabled:r,appearance:u,className:m(d?.trigger,l),children:t}):null,o?jsxRuntime.jsx(Ws,{appearance:u,className:d?.content,children:o}):null,e]})}a(yc,"BaseContextMenu");var Ls=ho.forwardRef(a(function({children:t,disabled:o=false,asChild:r=false,appearance:n,className:i,style:s,...l},d){Lo(o,"Trigger disabled"),Lo(r,"Trigger asChild");let c=Pe(n),p=ke(),u=Ne(c);return jsxRuntime.jsx(Tt__namespace.Trigger,{...p,...l,ref:d,asChild:r,disabled:o,"data-monkeys-component":"context-menu","data-slot":"trigger","data-disabled":o||void 0,className:m(!r&&u.slots.menuTrigger,o&&!r&&u.slots.menuItemDisabled,i),style:s,children:t})},"BaseContextMenuTrigger")),Ws=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d),u=wr(),g=jsxRuntime.jsx(Tt__namespace.Content,{...c,...s,ref:l,"data-monkeys-component":"context-menu","data-slot":"content",className:m(p.slots.menuContent,n?.root,r),style:{...p.styles.menuContent,...i},children:t});return u.shouldPortal?jsxRuntime.jsx(Tt__namespace.Portal,{...u.radixPortalProps,children:g}):g},"BaseContextMenuContent")),xc=ho.forwardRef(a(function({children:t,appearance:o,className:r,style:n,...i},s){let l=Pe(o),d=ke(),c=Ne(l);return jsxRuntime.jsx(Tt__namespace.Label,{...d,...i,ref:s,"data-monkeys-component":"context-menu","data-slot":"label",className:m(c.slots.menuLabel,r),style:n,children:t})},"BaseContextMenuLabel")),vc=ho.forwardRef(a(function({appearance:t,className:o,style:r,...n},i){let s=Pe(t),l=ke(),d=Ne(s);return jsxRuntime.jsx(Tt__namespace.Separator,{...l,...n,ref:i,"data-monkeys-component":"context-menu","data-slot":"separator",className:m(d.slots.menuSeparator,o),style:r})},"BaseContextMenuSeparator")),oa=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,appearance:d,className:c,classNames:p,style:u,onSelect:g,...f},b){Lo(s,"Item disabled"),Lo(l,"Item inset"),hc(i);let x=i??"default",y=Pe(d),k=ke(),w=Ne(y);return jsxRuntime.jsx(Tt__namespace.Item,{...k,...f,ref:b,disabled:s,"data-monkeys-component":"context-menu","data-slot":"item","data-tone":x,"data-disabled":s||void 0,className:m(w.slots.menuItem,Ma(w,i),s&&w.slots.menuItemDisabled,p?.root,c),style:{...w.styles.menuItem,...u},onSelect:v=>{if(s){v.preventDefault();return}g?.(v);},children:_m({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(w.slots.menuItemIcon,p?.icon),label:m(w.slots.menuItemLabel,p?.label),shortcut:m(w.slots.menuItemShortcut,p?.shortcut)}})})},"BaseContextMenuItem")),ux=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,checked:d,onCheckedChange:c,appearance:p,className:u,classNames:g,style:f,onSelect:b,...x},y){if(Lo(s,"CheckboxItem disabled"),Lo(l,"CheckboxItem inset"),hc(i),d!==void 0&&d!=="indeterminate"&&typeof d!="boolean")throw new TypeError('BaseContextMenu CheckboxItem checked must be a boolean or "indeterminate".');let k=i??"default",w=Pe(p),v=ke(),h=Ne(w);return jsxRuntime.jsx(Tt__namespace.CheckboxItem,{...v,...x,ref:y,checked:d,disabled:s,"data-monkeys-component":"context-menu","data-slot":"checkbox-item","data-tone":k,"data-disabled":s||void 0,"data-checked":d==="indeterminate"?"mixed":d===void 0?void 0:String(d),onCheckedChange:S=>{s||c?.(S);},className:m(h.slots.menuItem,"pl-8",Ma(h,i),s&&h.slots.menuItemDisabled,g?.root,u),style:{...h.styles.menuItem,...f},onSelect:S=>{if(s){S.preventDefault();return}b?.(S);},children:_m({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(h.slots.menuItemIcon,g?.icon),label:m(h.slots.menuItemLabel,g?.label),shortcut:m(h.slots.menuItemShortcut,g?.shortcut)},indicator:jsxRuntime.jsx(Tt__namespace.ItemIndicator,{"data-slot":"indicator",className:m(h.slots.menuCheckboxIndicator,g?.indicator),children:jsxRuntime.jsx(q2,{})})})})},"BaseContextMenuCheckboxItem"));function px({children:e,value:t,onValueChange:o}){return jsxRuntime.jsx(Tt__namespace.RadioGroup,{value:t,onValueChange:o,children:e})}a(px,"BaseContextMenuRadioGroup");var mx=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,value:d,appearance:c,className:p,classNames:u,style:g,onSelect:f,...b},x){Lo(s,"RadioItem disabled"),Lo(l,"RadioItem inset"),hc(i);let y=i??"default",k=Pe(c),w=ke(),v=Ne(k);return jsxRuntime.jsx(Tt__namespace.RadioItem,{...w,...b,ref:x,value:d,disabled:s,"data-monkeys-component":"context-menu","data-slot":"radio-item","data-tone":y,"data-value":d,"data-disabled":s||void 0,className:m(v.slots.menuItem,"pl-8",Ma(v,i),s&&v.slots.menuItemDisabled,u?.root,p),style:{...v.styles.menuItem,...g},onSelect:h=>{if(s){h.preventDefault();return}f?.(h);},children:_m({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(v.slots.menuItemIcon,u?.icon),label:m(v.slots.menuItemLabel,u?.label),shortcut:m(v.slots.menuItemShortcut,u?.shortcut)},indicator:jsxRuntime.jsx(Tt__namespace.ItemIndicator,{"data-slot":"indicator",className:m(v.slots.menuRadioIndicator,u?.indicator),children:jsxRuntime.jsx(Y2,{})})})})},"BaseContextMenuRadioItem"));function fx({children:e,open:t,defaultOpen:o,onOpenChange:r}){return t!==void 0&&Lo(t,"Sub open"),o!==void 0&&Lo(o,"Sub defaultOpen"),jsxRuntime.jsx(Tt__namespace.Sub,{open:t,defaultOpen:o,onOpenChange:r,children:e})}a(fx,"BaseContextMenuSub");var bx=ho.forwardRef(a(function({children:t,label:o,icon:r,tone:n,disabled:i=false,inset:s=false,appearance:l,className:d,classNames:c,style:p,...u},g){Lo(i,"SubTrigger disabled"),Lo(s,"SubTrigger inset"),hc(n);let f=n??"default",b=Pe(l),x=ke(),y=Ne(b),k=t??o;return jsxRuntime.jsxs(Tt__namespace.SubTrigger,{...x,...u,ref:g,disabled:i,"data-monkeys-component":"context-menu","data-slot":"sub-trigger","data-tone":f,"data-disabled":i||void 0,className:m(y.slots.menuSubTrigger,Ma(y,n),i&&y.slots.menuItemDisabled,c?.root,d),style:{...y.styles.menuItem,...p},children:[V(r)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(y.slots.menuItemIcon,c?.icon),children:r}):s?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"icon",className:"h-4 w-4 shrink-0"}):null,V(k)?jsxRuntime.jsx("span",{"data-slot":"label",className:m(y.slots.menuItemLabel,c?.label),children:k}):null,jsxRuntime.jsx("span",{"data-slot":"sub-indicator",className:m(y.slots.menuSubTriggerIcon,c?.shortcut,"rtl:rotate-180"),children:jsxRuntime.jsx(X2,{})})]})},"BaseContextMenuSubTrigger")),gx=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,sideOffset:s=6,...l},d){let c=Pe(o),p=ke(),u=Ne(c),g=wr(),f=jsxRuntime.jsx(Tt__namespace.SubContent,{...p,...l,ref:d,sideOffset:s,"data-monkeys-component":"context-menu","data-slot":"sub-content",className:m(u.slots.menuSubContent,n?.root,r),style:{...u.styles.menuContent,...i},children:t});return g.shouldPortal?jsxRuntime.jsx(Tt__namespace.Portal,{...g.radixPortalProps,children:f}):f},"BaseContextMenuSubContent"));var Z2={1:"grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-2 xl:grid-cols-3"};function wc({items:e,columns:t=1,appearance:o,className:r,classNames:n,style:i,children:s,...l}){let d=Ne(o);return jsxRuntime.jsxs("dl",{...l,className:m(d.slots.descriptionListRoot,Z2[t],n?.root,r),style:{...d.styles.descriptionList,...i},children:[e?.map((c,p)=>jsxRuntime.jsxs("div",{className:m(d.slots.descriptionListItem,n?.item),children:[jsxRuntime.jsx("dt",{className:m(d.slots.descriptionListTerm,n?.term),children:c.term}),jsxRuntime.jsx("dd",{className:m(d.slots.descriptionListValue,n?.value),children:c.value})]},p)),s]})}a(wc,"BaseDescriptionList");var oI=["default","primary","success","warning","danger","muted"];function _r(e,t){if(typeof e!="boolean")throw new TypeError(`BaseDialog ${t} must be a boolean.`)}a(_r,"validateBoolean");function rI(e){if(!oI.includes(e))throw new TypeError('BaseDialog triggerTone must be "default", "primary", "success", "warning", "danger", or "muted".')}a(rI,"validateTriggerTone");function nI({trigger:e,triggerLabel:t,triggerIcon:o,triggerTone:r,triggerDisabled:n,theme:i}){return V(e)?jsxRuntime.jsx("span",{role:"button",tabIndex:n?-1:0,"aria-disabled":n||void 0,onKeyDown:s=>{n||(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),s.currentTarget.click());},children:e}):V(t)?jsxRuntime.jsxs("button",{type:"button",disabled:n,"aria-label":typeof t=="string"&&t.trim()?t:void 0,className:m(i.slots.buttonBase,Gn(i,r),n&&i.slots.buttonDisabled),style:{...i.styles.button,...n?i.styles.buttonDisabled:void 0},children:[V(o)?jsxRuntime.jsx("span",{"data-slot":"icon",className:i.slots.buttonIcon,children:o}):null,jsxRuntime.jsx("span",{"data-slot":"label",className:i.slots.buttonLabel,children:t})]}):null}a(nI,"renderTrigger");var Ri=ho.forwardRef(a(function({open:t,defaultOpen:o=false,size:r="default",title:n,description:i,header:s,footer:l,trigger:d,triggerLabel:c,triggerIcon:p,triggerTone:u="default",triggerDisabled:g=false,closeLabel:f,closeOnEscape:b=true,closeOnOverlayClick:x=true,showCloseButton:y=true,keepMounted:k=false,trapFocus:w=true,restoreFocus:v=true,initialFocus:h="first-interactive",initialFocusRef:S,zIndex:T,portal:C=false,appearance:R,className:M,classNames:I,style:B,children:N,onOpenChange:D,id:E,...P},W){if(t!==void 0&&_r(t,"open"),_r(o,"defaultOpen"),!["default","viewport","page"].includes(r))throw new TypeError("BaseDialog size must be default, viewport or page.");if(_r(g,"triggerDisabled"),_r(b,"closeOnEscape"),_r(x,"closeOnOverlayClick"),_r(y,"showCloseButton"),_r(k,"keepMounted"),_r(w,"trapFocus"),_r(v,"restoreFocus"),_r(C,"portal"),rI(u),h!=="first-interactive"&&h!=="container"&&h!=="explicit")throw new TypeError('BaseDialog initialFocus must be "first-interactive", "container", or "explicit".');if(T!==void 0&&!Number.isFinite(T))throw new TypeError("BaseDialog zIndex must be a finite number.");let H=Ye().dialog,A=Pe(R),L=ke(),F=f===void 0?H.close:f,G=Ne(A),$=wr({disabled:!C}),[_,z]=ho.useState(o),re=ho.useRef(null),Z=ho.useRef(null),ae=t!==void 0,ee=ae?t:_,q=C&&$.shouldPortal?"portaled":"inline",U=V(n),X=V(i),O=V(s);if(y&&(typeof F!="string"||!F.trim()))throw new TypeError("BaseDialog closeLabel must be a non-empty string when showCloseButton is true.");let K=a(me=>{ae||z(me),D?.(me);},"handleOpenChange");ho.useEffect(()=>{if(!ee||!k)return;let me=re.current,ie=me?.ownerDocument,be=ie?.defaultView;if(!me||!ie||!be)return;Z.current=ie.activeElement instanceof be.HTMLElement?ie.activeElement:null;let He=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),We=a(()=>{let Q=me.querySelector(He);(h==="container"?me:h==="explicit"?S?.current??me:Q??me).focus();},"focusInitial"),Ke=be.requestAnimationFrame(We),ce=a(Q=>{if(Q.key==="Escape"&&b){Q.preventDefault(),Q.stopPropagation(),K(false);return}if(Q.key!=="Tab"||!w)return;let ge=Array.from(me.querySelectorAll(He));if(ge.length===0){Q.preventDefault(),me.focus();return}let we=ge[0],Ie=ge[ge.length-1];Q.shiftKey&&ie.activeElement===we?(Q.preventDefault(),Ie.focus()):!Q.shiftKey&&ie.activeElement===Ie&&(Q.preventDefault(),we.focus());},"handleKeyDown");return be.addEventListener("keydown",ce),()=>{be.cancelAnimationFrame(Ke),be.removeEventListener("keydown",ce),v&&Z.current?.isConnected&&Z.current.focus();}},[b,h,S,ee,k,v,w]);let ne=O||U||X?jsxRuntime.jsxs("div",{...L,"data-monkeys-component":"dialog","data-slot":"header","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogHeader,I?.header,r==="page"&&"sr-only"),children:[O?s:null,U?jsxRuntime.jsx(xo__namespace.Title,{...L,"data-monkeys-component":"dialog","data-slot":"title","data-state":ee?"open":"closed","data-portal":q,className:O?"sr-only":m(G.slots.dialogTitle,I?.title),children:n}):null,X?jsxRuntime.jsx(xo__namespace.Description,{...L,"data-monkeys-component":"dialog","data-slot":"description","data-state":ee?"open":"closed","data-portal":q,className:O?"sr-only":m(G.slots.dialogDescription,I?.description),children:i}):null]}):null,fe=nI({trigger:d,triggerLabel:c,triggerIcon:p,triggerTone:u,triggerDisabled:g,theme:G}),he=ee||k?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(xo__namespace.Overlay,{forceMount:k||void 0,hidden:!ee,...L,"aria-hidden":"true","data-monkeys-component":"dialog","data-slot":"overlay","data-portal":q,className:m(G.slots.dialogOverlay,I?.overlay),style:{...G.styles.dialogOverlay,zIndex:T,...r==="page"?{background:"transparent",backdropFilter:"none"}:{}}}),jsxRuntime.jsx("div",{...L,hidden:!ee,"data-monkeys-component":"dialog","data-slot":"content","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogContent,I?.content),style:{zIndex:T,...r==="page"?{padding:0,inset:0}:{}},children:jsxRuntime.jsx(xo__namespace.Content,{forceMount:k||void 0,...L,...U?{}:{"aria-labelledby":void 0},...X?{}:{"aria-describedby":void 0},asChild:true,onOpenAutoFocus:me=>{if(k){me.preventDefault();return}let ie=re.current;Z.current=ie?.ownerDocument.activeElement,(h==="container"||h==="explicit")&&(me.preventDefault(),(h==="explicit"?S?.current??ie:ie)?.focus({preventScroll:true}));},onCloseAutoFocus:me=>{if(k||!v){me.preventDefault();return}let ie=Z.current;ie?.isConnected&&(me.preventDefault(),ie.focus({preventScroll:true}));},onEscapeKeyDown:me=>{(k||!b)&&me.preventDefault();},onPointerDownOutside:me=>{x||me.preventDefault();},children:jsxRuntime.jsxs("div",{...L,ref:re,tabIndex:-1,"aria-modal":"true","data-monkeys-component":"dialog","data-slot":"panel","data-portal":q,className:m(G.slots.dialogPanel,I?.panel),"data-presentation":r,style:{...G.styles.dialogPanel,...r!=="default"?{width:r==="page"?"100vw":"96vw",maxWidth:"none",height:r==="page"?"100dvh":"94dvh",maxHeight:r==="page"?"100dvh":"94dvh",display:"flex",flexDirection:"column"}:{},...r==="page"?{borderRadius:0,border:0,boxShadow:"none",margin:0,animation:"none"}:{}},children:[ne,y?jsxRuntime.jsx(xo__namespace.Close,{asChild:true,children:jsxRuntime.jsx("button",{...L,type:"button","aria-label":F,title:F,"data-monkeys-component":"dialog","data-slot":"close","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogClose,I?.close),children:"\xD7"})}):null,jsxRuntime.jsx("div",{...L,"data-monkeys-component":"dialog","data-slot":"body","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogBody,I?.body),style:r!=="default"?{minHeight:0,flex:"1 1 0%",overflow:"hidden",padding:0}:void 0,children:N}),V(l)?jsxRuntime.jsx("div",{...L,"data-monkeys-component":"dialog","data-slot":"footer","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogFooter,I?.footer),children:l}):null]})})})]}):null;return jsxRuntime.jsx("div",{...L,...P,ref:W,id:E,"data-monkeys-component":"dialog","data-slot":"root","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogRoot,I?.root,M),style:B,children:jsxRuntime.jsxs(xo__namespace.Root,{open:ee,onOpenChange:K,modal:!k&&w,children:[fe?jsxRuntime.jsx(xo__namespace.Trigger,{...L,asChild:true,disabled:g,"data-monkeys-component":"dialog","data-slot":"trigger","data-portal":q,"data-tone":u,"data-disabled":g||void 0,className:m(G.slots.dialogTrigger,g&&G.slots.dialogTriggerDisabled,I?.trigger),children:fe}):null,C&&$.shouldPortal?jsxRuntime.jsx(ks,{children:jsxRuntime.jsx(xo__namespace.Portal,{...$.radixPortalProps,forceMount:k||void 0,children:he})}):jsxRuntime.jsx(ks,{children:he})]})})},"BaseDialog"));var vx=ho.forwardRef(a(function({orientation:t="horizontal",label:o,appearance:r,className:n,classNames:i,style:s,...l},d){if(t!=="horizontal"&&t!=="vertical")throw new TypeError('BaseDivider orientation must be "horizontal" or "vertical".');let c=Pe(r),p=ke(),u=Ne(c),g=t==="vertical",f=V(o)&&!g,b={...u.styles.divider,...s};return f?jsxRuntime.jsxs("div",{...p,...l,ref:d,role:"separator","aria-orientation":t,"data-monkeys-component":"divider","data-slot":"root","data-orientation":t,"data-state":"labeled",className:m("flex min-w-0 items-center",i?.root,n),style:b,children:[jsxRuntime.jsx("div",{"data-slot":"line","data-orientation":t,className:m("min-w-0 flex-1 border-t",u.slots.dividerRoot,i?.line)}),jsxRuntime.jsx("span",{"data-slot":"label","data-orientation":t,className:m(u.slots.dividerLabel,i?.label),children:o}),jsxRuntime.jsx("div",{"data-slot":"line","data-orientation":t,className:m("min-w-0 flex-1 border-t",u.slots.dividerRoot,i?.line)})]}):jsxRuntime.jsx("div",{...p,...l,ref:d,role:"separator","aria-orientation":t,"data-monkeys-component":"divider","data-slot":"root","data-orientation":t,"data-state":"unlabeled",className:m(u.slots.dividerRoot,g?"min-h-full self-stretch border-l":"w-full border-t",i?.root,n),style:b})},"BaseDivider"));function Mi(e,t){if(typeof e!="boolean")throw new TypeError(`BaseDropdownMenu ${t} must be a boolean.`)}a(Mi,"validateBoolean");function cI(e){if(e!=="bottom-start"&&e!=="bottom-end"&&e!=="top-start"&&e!=="top-end")throw new TypeError('BaseDropdownMenu placement must be "bottom-start", "bottom-end", "top-start", or "top-end".')}a(cI,"validatePlacement");function uI(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('BaseDropdownMenu dir must be "ltr" or "rtl".')}a(uI,"validateDirection");function pI(e){if(!Array.isArray(e))throw new TypeError("BaseDropdownMenu items must be an array.");let t=new Set;for(let[o,r]of e.entries()){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`BaseDropdownMenu items[${o}] must be an object.`);if(typeof r.value!="string"||!r.value.trim())throw new TypeError(`BaseDropdownMenu items[${o}].value must be a non-empty string.`);if(t.has(r.value))throw new TypeError(`BaseDropdownMenu item value "${r.value}" must be unique.`);t.add(r.value);for(let n of ["disabled","danger","separatorBefore"]){let i=r[n];i!==void 0&&Mi(i,`items[${o}].${n}`);}if(r.onSelect!==void 0&&typeof r.onSelect!="function")throw new TypeError(`BaseDropdownMenu items[${o}].onSelect must be a function.`)}}a(pI,"validateItems");function mI(e){let[t,o]=e.split("-");return {side:t,align:o}}a(mI,"resolvePlacement");function fI({trigger:e,triggerLabel:t,triggerIcon:o,disabled:r,theme:n}){return V(e)?jsxRuntime.jsx("span",{role:"button",tabIndex:r?-1:0,"aria-disabled":r||void 0,children:e}):jsxRuntime.jsxs("button",{type:"button",disabled:r,"aria-label":typeof t=="string"&&t.trim()?t:void 0,className:m(n.slots.buttonBase,Gn(n),r&&n.slots.buttonDisabled),style:{...n.styles.button,...r?n.styles.buttonDisabled:void 0},children:[V(o)?jsxRuntime.jsx("span",{"data-slot":"icon",className:n.slots.buttonIcon,children:o}):null,V(t)?jsxRuntime.jsx("span",{"data-slot":"label",className:n.slots.buttonLabel,children:t}):null]})}a(fI,"renderTrigger");var wx=ho.forwardRef(a(function({items:t=[],label:o,trigger:r,triggerLabel:n,triggerIcon:i,disabled:s=false,open:l,defaultOpen:d=false,placement:c="bottom-start",closeOnSelect:p=true,portal:u=false,dir:g,appearance:f,className:b,classNames:x,style:y,children:k,onOpenChange:w,onSelect:v,...h},S){l!==void 0&&Mi(l,"open"),Mi(d,"defaultOpen"),Mi(s,"disabled"),Mi(p,"closeOnSelect"),Mi(u,"portal"),cI(c),uI(g),pI(t);let T=li(),C=g??T,R=Pe(f),M=ke(),I=Ye().dropdownMenu,B=Ne(R),N=wr({disabled:!u}),[D,E]=ho.useState(d),P=l!==void 0,W=P?l:D,H=n===void 0?I.actions:n,A=u&&N.shouldPortal?"portaled":"inline",{side:L,align:F}=mI(c);if(n===void 0&&(typeof I.actions!="string"||!I.actions.trim()))throw new TypeError("BaseDropdownMenu locale actions message must be a non-empty string.");let G=a(_=>{s||(P||E(_),w?.(_));},"handleOpenChange"),$=jsxRuntime.jsxs(Bt__namespace.Content,{...M,side:L,align:F,sideOffset:6,collisionPadding:8,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-placement":c,"data-portal":A,"data-tone":"default","data-disabled":s||void 0,className:m(B.slots.dropdownMenu,x?.menu),style:B.styles.dropdownMenu,children:[V(o)?jsxRuntime.jsx(Bt__namespace.Label,{...M,"data-monkeys-component":"dropdown-menu","data-slot":"label","data-state":"static",className:m(B.slots.dropdownLabel,x?.label),children:o}):null,t.map(_=>{let z=_.disabled??false,re=_.danger?"danger":"default";return jsxRuntime.jsxs("div",{"data-monkeys-component":"dropdown-menu","data-slot":"item-wrapper",children:[_.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{...M,"data-monkeys-component":"dropdown-menu","data-slot":"separator","data-state":"static",className:m(B.slots.dropdownSeparator,x?.separator)}):null,jsxRuntime.jsx(Bt__namespace.Item,{asChild:true,disabled:z,onSelect:Z=>{_.onSelect?.(_),v?.(_),p||Z.preventDefault();},children:jsxRuntime.jsxs("button",{...M,type:"button",disabled:z,"data-monkeys-component":"dropdown-menu","data-slot":"item","data-state":z?"disabled":"enabled","data-value":_.value,"data-placement":c,"data-portal":A,"data-tone":re,"data-disabled":z||void 0,className:m(B.slots.dropdownItem,_.danger&&B.slots.dropdownItemDanger,z&&B.slots.dropdownItemDisabled,x?.item),style:B.styles.dropdownItem,children:[V(_.icon)?jsxRuntime.jsx("span",{"data-slot":"item-icon",className:m(B.slots.dropdownItemIcon,x?.itemIcon),children:_.icon}):null,jsxRuntime.jsxs("span",{"data-slot":"item-content",className:m(B.slots.dropdownItemContent,x?.itemContent),children:[jsxRuntime.jsx("span",{"data-slot":"item-label",className:m(B.slots.dropdownItemLabel,x?.itemLabel),children:_.label}),V(_.description)?jsxRuntime.jsx("span",{"data-slot":"item-description",className:m(B.slots.dropdownItemDescription,x?.itemDescription),children:_.description}):null]}),V(_.shortcut)?jsxRuntime.jsx("span",{"data-slot":"item-shortcut",className:m(B.slots.dropdownItemShortcut,x?.itemShortcut),children:_.shortcut}):null]})})]},_.value)}),k]});return jsxRuntime.jsx("div",{...M,...h,ref:S,dir:C,"data-monkeys-component":"dropdown-menu","data-slot":"root","data-state":W?"open":"closed","data-placement":c,"data-portal":A,"data-tone":"default","data-disabled":s||void 0,className:m(B.slots.dropdownRoot,x?.root,b),style:y,children:jsxRuntime.jsxs(Bt__namespace.Root,{open:W,onOpenChange:G,dir:C,modal:false,children:[jsxRuntime.jsx(Bt__namespace.Trigger,{...M,asChild:true,disabled:s,"data-monkeys-component":"dropdown-menu","data-slot":"trigger","data-placement":c,"data-portal":A,"data-tone":"default","data-disabled":s||void 0,className:m(B.slots.dropdownTrigger,s&&B.slots.dropdownTriggerDisabled,x?.trigger),children:fI({trigger:r,triggerLabel:H,triggerIcon:i,disabled:s,theme:B})}),u&&N.shouldPortal?jsxRuntime.jsx(Bt__namespace.Portal,{...N.radixPortalProps,children:$}):$]})})},"BaseDropdownMenu"));function gI(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",children:[jsxRuntime.jsx("rect",{width:"16",height:"12",x:"4",y:"6",rx:"2"}),jsxRuntime.jsx("path",{d:"M8 10h8"}),jsxRuntime.jsx("path",{d:"M8 14h5"})]})}a(gI,"DefaultEmptyIcon");var Di=ho.forwardRef(a(function({icon:t=jsxRuntime.jsx(gI,{}),title:o,description:r,actions:n,variant:i,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Pe(s),f=ke(),b=Wr(),x=i??b.empty?.variant??"default",y=b.density==="compact"?"min-h-0 px-3 py-3":b.density==="comfortable"?"min-h-56 px-8 py-12":void 0,k=Ne(g);return jsxRuntime.jsxs("div",{...f,...p,ref:u,"data-monkeys-component":"empty-state","data-slot":"root","data-state":"empty","data-variant":x,"data-density":b.density,className:m(k.slots.stateRoot,y,x==="compact"&&"min-h-0 gap-1 py-3",d?.root,l),style:{...k.styles.stateRoot,...c},children:[V(t)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":"empty",className:m(k.slots.stateIcon,d?.icon),style:k.styles.stateIcon,children:t}):null,V(o)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":"empty",className:m(k.slots.stateTitle,d?.title),children:o}):null,V(r)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":"empty",className:m(k.slots.stateDescription,d?.description),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":"empty",className:m(k.slots.stateActions,d?.actions),children:n}):null]})},"BaseEmptyState"));var Cx=ho.createContext(false);function Sx({children:e}){let{locale:t}=Co();return e==null||e===""?null:jsxRuntime.jsx(To,{content:e,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":typeof e=="string"?e:t.startsWith("zh")?"\u8BF4\u660E":"Help","data-form-help":true,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:jsxRuntime.jsx(lucideReact.HelpCircle,{className:"h-4 w-4","aria-hidden":"true"})})})}a(Sx,"BaseFormHelp");function SI(...e){let t=e.flatMap(o=>o?.split(/\s+/).filter(Boolean)??[]);return t.length?Array.from(new Set(t)).join(" "):void 0}a(SI,"mergeAriaIds");function jm(e,t,o){if(e===void 0)return t;if(!e.trim()||/\s/.test(e))throw new TypeError(`BaseField ${o} must be a non-empty ID without whitespace.`);return e}a(jm,"resolveOptionalId");var Gr=ho.forwardRef(a(function({label:t,description:o,message:r,error:n,required:i=false,disabled:s=false,htmlFor:l,descriptionId:d,messageId:c,errorId:p,validate:u,validationMode:g="onBlur",children:f,appearance:b,className:x,classNames:y,style:k,...w},v){for(let[K,ne]of [["required",i],["disabled",s]])if(typeof ne!="boolean")throw new TypeError(`BaseField ${K} must be a boolean.`);if(u!==void 0&&typeof u!="function")throw new TypeError("BaseField validate must be a function.");if(g!=="onBlur"&&g!=="onChange")throw new TypeError('BaseField validationMode must be "onBlur" or "onChange".');let h=ho.useContext(Cx)?"tooltip":"inline",S=ho.useId(),T=Pe(b),C=ke(),R=Ne(T),M=V(o),[I,B]=ho.useState(null),N=ho.useRef(new Set),D=ho.useRef(u),E=ho.useRef(g),P=ho.useRef(s);D.current=u,E.current=g,P.current=s;let W=u!==void 0;ho.useEffect(()=>{(!W||s)&&B(null);},[s,W]),ho.useEffect(()=>{if(W&&N.current.size!==1)throw new TypeError("BaseField with validate must contain exactly one compatible Base control.")},[W]);let H=ho.useCallback(K=>{let ne=N.current;if(D.current!==void 0&&!ne.has(K)&&ne.size>0)throw new TypeError("BaseField with validate supports exactly one compatible Base control. Use BaseFieldset for control groups.");return ne.add(K),()=>{ne.delete(K);}},[]),A=ho.useCallback((K,ne)=>{let fe=D.current;if(P.current||fe===void 0||E.current!==K)return;let he=Iy(fe(ne));if(he===null){B(null);return}B(he);},[]),L=ho.useCallback(K=>A("onBlur",K),[A]),F=ho.useCallback(K=>A("onChange",K),[A]),$=V(n)?n:I,_=V($),z=!_&&V(r),re=_?$:r,Z=l??`${S}-control`,ae=M?jm(d,`${S}-description`,"descriptionId"):void 0,ee=z?jm(c,`${S}-message`,"messageId"):void 0,q=_?jm(p,`${S}-error`,"errorId"):void 0,U={id:Z,"aria-describedby":SI(ae,ee),"aria-errormessage":q,"aria-invalid":_?true:void 0,"aria-required":i?true:void 0,required:i||void 0,disabled:s||void 0},X=typeof f=="function"?f(U):f,O=ho.useMemo(()=>({invalid:_,registerControl:H,notifyBlur:L,notifyChange:F}),[_,L,F,H]);return jsxRuntime.jsxs("div",{...C,...w,ref:v,"aria-disabled":s||void 0,"data-monkeys-component":"field","data-slot":"root","data-required":i||void 0,"data-disabled":s||void 0,"data-invalid":_||void 0,className:m(R.slots.fieldRoot,s&&R.slots.controlDisabled,y?.root,x),style:{...R.styles.field,...k},children:[V(t)?jsxRuntime.jsxs("div",{"data-slot":"label-row",className:m(R.slots.fieldLabelRow,y?.labelRow),children:[jsxRuntime.jsxs("label",{htmlFor:typeof f=="function"?Z:l,"data-slot":"label",className:m(R.slots.fieldLabel,y?.label),children:[t,i?jsxRuntime.jsxs("span",{"aria-hidden":"true","data-slot":"required-indicator",className:m(R.slots.fieldRequired,y?.required),children:[" ","*"]}):null]}),h==="tooltip"&&M?jsxRuntime.jsx(Sx,{children:o}):null]}):null,M?jsxRuntime.jsx("div",{id:ae,"data-slot":"description",className:m(R.slots.fieldDescription,y?.description,h==="tooltip"&&"sr-only"),children:o}):null,V(X)?jsxRuntime.jsx("div",{"data-slot":"control",className:m(R.slots.fieldControl,y?.control),style:R.styles.fieldControl,children:jsxRuntime.jsx(Dm.Provider,{value:O,children:X})}):null,V(re)?jsxRuntime.jsx("div",{id:_?q:ee,role:_?"alert":void 0,"data-slot":_?"error":"message",className:m(R.slots.fieldMessage,_&&"text-destructive-text",y?.message),children:re}):null]})},"BaseField"));function Nx(...e){let t=e.flatMap(o=>o?.split(/\s+/).filter(Boolean)??[]);return t.length?Array.from(new Set(t)).join(" "):void 0}a(Nx,"mergeAriaIds");function Rx(e,t,o){if(e===void 0)return t;if(!e.trim()||/\s/.test(e))throw new TypeError(`BaseFieldset ${o} must be a non-empty ID without whitespace.`);return e}a(Rx,"resolveOptionalId");var RI=ho.forwardRef(a(function({children:t,legend:o,description:r,descriptionId:n,error:i,errorId:s,disabled:l,appearance:d,className:c,classNames:p,style:u,"aria-describedby":g,"aria-errormessage":f,...b},x){let y=ho.useId(),k=Pe(d),w=ke(),v=Ne(k);if(!V(o)||typeof o=="string"&&!o.trim())throw new TypeError("BaseFieldset legend must contain an accessible name.");if(l!==void 0&&typeof l!="boolean")throw new TypeError("BaseFieldset disabled must be a boolean.");let h=V(r),S=V(i),T=h?Rx(n,`${y}-description`,"descriptionId"):void 0,C=S?Rx(s,`${y}-error`,"errorId"):void 0;return jsxRuntime.jsxs("fieldset",{...w,...b,ref:x,disabled:l,"aria-describedby":Nx(g,T),"aria-errormessage":Nx(f,C),"data-monkeys-component":"fieldset","data-slot":"root",className:m(v.slots.fieldsetRoot,p?.root,c),style:{...v.styles.fieldset,...u},children:[jsxRuntime.jsx("legend",{"data-slot":"legend",className:m(v.slots.fieldsetLegend,p?.legend),style:v.styles.fieldsetLegend,children:o}),h?jsxRuntime.jsx("div",{id:T,"data-slot":"description",className:m(v.slots.fieldsetDescription,p?.description),style:v.styles.fieldsetDescription,children:r}):null,S?jsxRuntime.jsx("div",{id:C,"data-slot":"error",className:m(v.slots.fieldsetError,p?.error),style:v.styles.fieldsetError,children:i}):null,jsxRuntime.jsx("div",{"data-slot":"content",className:m(v.slots.fieldsetContent,p?.content),style:v.styles.fieldsetContent,children:t})]})},"BaseFieldset"));function PI(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=6}a(PI,"isHeadingLevel");var EI=ho.forwardRef(a(function({level:t=2,children:o,size:r="lg",tone:n="default",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u);if(!PI(t))throw new RangeError("BaseHeading level must be an integer from 1 to 6.");return ho.createElement(`h${t}`,{...g,...c,ref:p,"data-monkeys-component":"heading","data-slot":"root","data-level":t,"data-size":r,"data-tone":n,className:m(f.slots.headingRoot,Ah(f,r),fi(f,n),l?.root,s),style:{...f.styles.heading,...d}},o)},"BaseHeading"));var BI=ho.forwardRef(a(function({children:t,columns:o=1,gap:r,align:n="stretch",justify:i="start",appearance:s,className:l,classNames:d,style:c,...p},u){let g=Go(),f=Pe(s),b=ke(),x=Ne(f),y=r===void 0?void 0:rr("BaseGrid","gap",r);return jsxRuntime.jsx("div",{...b,...p,ref:u,"data-monkeys-component":"grid","data-slot":"root","data-align":n,"data-justify":i,"data-columns":o,className:m(x.slots.gridRoot,g>0&&r===void 0&&"gap-[var(--monkeys-bento-gap)]",f?.slots?.gridRoot,d?.root,l),style:{...x.styles.grid,gridTemplateColumns:Fh(o),gap:y??x.styles.grid?.gap,alignItems:bi("BaseGrid",n),justifyContent:gi("BaseGrid",i),...c},children:t})},"BaseGrid"));var zI={sm:"h-8 px-2.5 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-3.5 text-base"},Rc=ho.forwardRef(a(function({icon:t,trailing:o,invalid:r=false,disabled:n=false,readOnly:i=false,controlSize:s,appearance:l,className:d,classNames:c,style:p,"aria-invalid":u,onBlur:g,onChange:f,...b},x){for(let[S,T]of [["invalid",r],["disabled",n],["readOnly",i]])if(typeof T!="boolean")throw new TypeError(`BaseInput ${S} must be a boolean.`);if(s!==void 0&&s!=="sm"&&s!=="md"&&s!=="lg")throw new TypeError('BaseInput controlSize must be "sm", "md", or "lg".');let y=Pe(l),k=ke(),w=Ne(y),v=Yn(),h=r||v.invalid;return jsxRuntime.jsxs("div",{...k,"data-monkeys-component":"input","data-slot":"root","data-size":s,"data-invalid":h||void 0,"data-disabled":n||void 0,"data-readonly":i||void 0,className:m(w.slots.controlWrapper,h&&w.slots.controlInvalid,n&&w.slots.controlDisabled,i&&w.slots.controlReadOnly,c?.root,d),style:{...w.styles.control,...h?w.styles.controlInvalid:void 0,...n?w.styles.controlDisabled:void 0,...p},children:[V(t)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(w.slots.controlIcon,c?.icon),children:t}):null,jsxRuntime.jsx("input",{...b,ref:x,disabled:n,readOnly:i,"aria-invalid":u??(h||void 0),"data-slot":"control","data-size":s,"data-invalid":h||void 0,"data-disabled":n||void 0,"data-readonly":i||void 0,className:m(w.slots.controlBase,w.slots.controlInput,s&&zI[s],c?.control),onBlur:S=>{g?.(S),v.notifyBlur(S.currentTarget.value);},onChange:S=>{f?.(S),v.notifyChange(S.currentTarget.value);}}),V(o)?jsxRuntime.jsx("span",{"data-slot":"trailing",className:m(w.slots.controlTrailing,c?.trailing),children:o}):null]})},"BaseInput"));var HI=ho.forwardRef(a(function({children:t,startElement:o,endElement:r,startAddon:n,endAddon:i,invalid:s=false,disabled:l=false,appearance:d,className:c,classNames:p,style:u,...g},f){for(let[k,w]of [["invalid",s],["disabled",l]])if(typeof w!="boolean")throw new TypeError(`BaseInputGroup ${k} must be a boolean.`);let b=Pe(d),x=ke(),y=Ne(b);return jsxRuntime.jsxs("div",{...x,...g,ref:f,"data-monkeys-component":"input-group","data-slot":"root","data-invalid":s||void 0,"data-disabled":l||void 0,className:m(y.slots.inputGroupRoot,s&&y.slots.inputGroupInvalid,l&&y.slots.inputGroupDisabled,p?.root,c),style:{...y.styles.inputGroup,...s?y.styles.inputGroupInvalid:void 0,...l?y.styles.inputGroupDisabled:void 0,...u},children:[V(n)?jsxRuntime.jsx("span",{"data-slot":"start-addon","data-placement":"start",className:m(y.slots.inputGroupStartAddon,p?.startAddon),style:y.styles.inputGroupAddon,children:n}):null,V(o)?jsxRuntime.jsx("span",{"data-slot":"start-element","data-placement":"start",className:m(y.slots.inputGroupStartElement,p?.startElement),style:y.styles.inputGroupElement,children:o}):null,jsxRuntime.jsx("div",{"data-slot":"content",className:m(y.slots.inputGroupContent,p?.content),style:y.styles.inputGroupContent,children:t}),V(r)?jsxRuntime.jsx("span",{"data-slot":"end-element","data-placement":"end",className:m(y.slots.inputGroupEndElement,p?.endElement),style:y.styles.inputGroupElement,children:r}):null,V(i)?jsxRuntime.jsx("span",{"data-slot":"end-addon","data-placement":"end",className:m(y.slots.inputGroupEndAddon,p?.endAddon),style:y.styles.inputGroupAddon,children:i}):null]})},"BaseInputGroup"));var GI=ho.forwardRef(a(function({children:t,gap:o,align:r="center",justify:n="start",wrap:i=true,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Go(),f=Pe(s),b=ke(),x=Ne(f);if(typeof i!="boolean")throw new TypeError("BaseInline wrap must be a boolean.");let y=o===void 0?void 0:rr("BaseInline","gap",o);return jsxRuntime.jsx("div",{...b,...p,ref:u,"data-monkeys-component":"inline","data-slot":"root","data-align":r,"data-justify":n,"data-wrap":i?"wrap":"nowrap",className:m(x.slots.inlineRoot,g>0&&o===void 0&&"gap-[var(--monkeys-bento-gap)]",f?.slots?.inlineRoot,d?.root,l),style:{...x.styles.inline,gap:y??x.styles.inline?.gap,alignItems:bi("BaseInline",r),justifyContent:gi("BaseInline",n),flexWrap:i?"wrap":"nowrap",...c},children:t})},"BaseInline"));var UI=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d);return jsxRuntime.jsx("kbd",{...c,...s,ref:l,"data-monkeys-component":"kbd","data-slot":"root",className:m(p.slots.kbdRoot,n?.root,r),style:{...p.styles.kbd,...i},children:t})},"BaseKbd"));var XI=50,QI=20,ZI=80,JI=2.5;function eD(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(eD,"assignRef");function Ba(e,t){if(typeof t!="boolean")throw new TypeError(`BaseLayout ${e} must be a boolean.`)}a(Ba,"assertBoolean");function Px(e){if(e!=="horizontal"&&e!=="vertical")throw new TypeError('BaseLayout orientation must be "horizontal" or "vertical".')}a(Px,"assertOrientation");function Ic(e,t){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error("BaseLayout size and gap props must be finite, non-negative numbers.");return `${e}px`}if(typeof e=="string"){if(e.trim().length===0)throw new TypeError("BaseLayout size and gap string props must not be empty.");return e}return t}a(Ic,"toCssSize");function Pi(e,t){if(!Number.isFinite(t))throw new Error(`BaseLayoutSplit ${e} must be a finite number.`);if(t<0||t>100)throw new Error(`BaseLayoutSplit ${e} must be between 0 and 100.`);return t}a(Pi,"assertPercent");function qm(e,t,o){return Math.min(Math.max(e,t),o)}a(qm,"clamp");function tD({minSize:e=QI,maxSize:t=ZI,keyboardStep:o=JI}){let r=Pi("minSize",e),n=Pi("maxSize",t);if(r>n)throw new Error("BaseLayoutSplit minSize cannot be greater than maxSize.");if(!Number.isFinite(o)||o<=0)throw new Error("BaseLayoutSplit keyboardStep must be a finite positive number.");return {min:r,max:n,keyboardStep:o}}a(tD,"resolveSplitBounds");function Ix(e,t,o,r,n){return qm(Pi(e,t??o),r,n)}a(Ix,"resolveSplitSize");function oD(e){return e==="horizontal"?"vertical":"horizontal"}a(oD,"getSeparatorOrientation");function Dx(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":e.closest('[dir="rtl"]')!==null}a(Dx,"isRtl");function rD(e,t){if(e.setPointerCapture)try{e.setPointerCapture(t);}catch(o){let r=e.ownerDocument.defaultView?.DOMException;if(r&&o instanceof r&&o.name==="NotFoundError")return;throw o}}a(rD,"setPointerCaptureIfAvailable");var Ex=ho.forwardRef(a(function({header:t,sidebar:o,aside:r,sidebarLabel:n,asideLabel:i,footer:s,children:l,sidebarSize:d,asideSize:c,gap:p,fullHeight:u=false,appearance:g,className:f,classNames:b,style:x,...y},k){Ba("fullHeight",u);let w=Pe(g),v=ke(),h=Ne(w),S=V(t),T=V(o),C=V(r),R=V(s),M=[T?"var(--base-layout-sidebar-size)":void 0,"minmax(0, 1fr)",C?"var(--base-layout-aside-size)":void 0].filter(Boolean).join(" "),I=[S?"auto":void 0,"minmax(0, 1fr)",R?"auto":void 0].filter(Boolean).join(" "),B=p!==void 0?Ic(p,"0px"):void 0,N={...h.styles.layout,"--base-layout-sidebar-size":Ic(d,"16rem"),"--base-layout-aside-size":Ic(c,"20rem"),gridTemplateRows:I,...B!==void 0?{gap:B}:{},...x},D={...h.styles.layoutBody,gridTemplateColumns:M,...B!==void 0?{gap:B}:{}};return jsxRuntime.jsxs("div",{...v,...y,ref:k,"data-monkeys-component":"layout","data-slot":"root","data-full-height":u?"true":"false",className:m(h.slots.layoutRoot,u&&h.slots.layoutRootFull,b?.root,f),style:N,children:[S?jsxRuntime.jsx("div",{"data-slot":"header",className:m(h.slots.layoutHeader,b?.header),style:h.styles.layoutHeader,children:t}):null,jsxRuntime.jsxs("div",{"data-slot":"body",className:m(h.slots.layoutBody,b?.body),style:D,children:[T?jsxRuntime.jsx("aside",{"aria-label":n,"data-slot":"sidebar",className:m(h.slots.layoutSidebar,b?.sidebar),style:h.styles.layoutSidebar,children:o}):null,jsxRuntime.jsx("main",{"data-slot":"main",className:m(h.slots.layoutMain,b?.main),style:h.styles.layoutMain,children:l}),C?jsxRuntime.jsx("aside",{"aria-label":i,"data-slot":"aside",className:m(h.slots.layoutAside,b?.aside),style:h.styles.layoutAside,children:r}):null]}),R?jsxRuntime.jsx("div",{"data-slot":"footer",className:m(h.slots.layoutFooter,b?.footer),style:h.styles.layoutFooter,children:s}):null]})},"BaseLayout")),Ax=ho.forwardRef(a(function({as:t="div",scrollable:o=false,bordered:r=true,surface:n="default",children:i,appearance:s,className:l,classNames:d,style:c,...p},u){Ba("scrollable",o),Ba("bordered",r);let g=Pe(s),f=ke(),b=Ne(g);return jsxRuntime.jsx(t,{...f,...p,ref:u,"data-monkeys-component":"layout-pane","data-slot":"root","data-scrollable":o?"true":"false","data-surface":n,className:m(b.slots.layoutPane,o&&b.slots.layoutPaneScrollable,r&&b.slots.layoutPaneBordered,n==="muted"&&b.slots.layoutPaneMuted,n==="soft"&&b.slots.layoutPaneSoft,n==="transparent"&&b.slots.layoutPaneTransparent,d?.root,l),style:{...b.styles.layoutPane,...c},children:i})},"BaseLayoutPane")),Ym=ho.forwardRef(a(function({orientation:t="horizontal",resizable:o=false,disabled:r=false,size:n,minSize:i,maxSize:s,label:l,appearance:d,className:c,classNames:p,style:u,tabIndex:g,...f},b){Px(t),Ba("resizable",o),Ba("disabled",r);let x=i===void 0?void 0:Pi("minSize",i),y=s===void 0?void 0:Pi("maxSize",s);if(x!==void 0&&y!==void 0&&x>y)throw new Error("BaseLayoutSplit minSize cannot be greater than maxSize.");let k=n===void 0?void 0:qm(Pi("size",n),x??0,y??100),w=Pe(d),v=ke(),h=Ye().layout,S=Ne(w),T=l??h.resizePanels;if(o&&(typeof T!="string"||T.trim().length===0))throw new TypeError("BaseLayoutResizeHandle label must be a non-empty string.");let C=o&&!r,R=oD(t);return jsxRuntime.jsx("div",{...v,...f,ref:b,"data-monkeys-component":"layout-resize-handle","data-slot":"handle","data-orientation":t,"data-state":C?"enabled":r?"disabled":"static",role:o?"separator":void 0,"aria-label":o?T:void 0,"aria-orientation":o?R:void 0,"aria-valuemin":o?x:void 0,"aria-valuemax":o?y:void 0,"aria-valuenow":o?k:void 0,"aria-disabled":o&&r?true:void 0,tabIndex:C?g??0:void 0,className:m(S.slots.layoutResizeHandle,t==="horizontal"?S.slots.layoutResizeHandleHorizontal:S.slots.layoutResizeHandleVertical,!C&&S.slots.layoutResizeHandleDisabled,p?.root,c),style:{...S.styles.layoutResizeHandle,...u},children:jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(S.slots.layoutResizeHandleIndicator,t==="horizontal"?"h-8 w-px":"h-px w-8",p?.indicator)})})},"BaseLayoutResizeHandle")),Bx=ho.forwardRef(a(function({orientation:t="horizontal",primary:o,secondary:r,children:n,resizable:i=false,disabled:s=false,size:l,defaultSize:d,minSize:c,maxSize:p,gap:u,keyboardStep:g,resizeLabel:f,appearance:b,className:x,classNames:y,style:k,onSizeChange:w,...v},h){Px(t),Ba("resizable",i),Ba("disabled",s);let S=Pe(b),T=ke(),C=Ne(S),R=tD({minSize:c,maxSize:p,keyboardStep:g}),M=Ix("defaultSize",d,XI,R.min,R.max),[I,B]=ho.useState(M),N=ho.useRef(null),D=ho.useRef(null),E=l!==void 0,P=i&&!s,W=Ix("size",E?l:I,M,R.min,R.max),H=v.dir??T.dir,A=ho.useCallback(ee=>{N.current=ee,eD(h,ee);},[h]),L=ho.useCallback(ee=>{let q=qm(ee,R.min,R.max);E||B(q),w?.(q);},[R.max,R.min,E,w]),F=ho.useCallback(ee=>{let q=N.current;if(!q)return;let U=q.getBoundingClientRect(),X=t==="horizontal"?U.width:U.height;if(!Number.isFinite(X)||X<=0)return;let O=t==="horizontal"?Dx(q)?U.right-ee.clientX:ee.clientX-U.left:ee.clientY-U.top;L(O/X*100);},[L,t]),G=ho.useCallback(()=>{let ee=D.current;D.current=null,ee?.();},[]);ho.useEffect(()=>(P||G(),G),[P,G]);let $=a(ee=>{if(!P||ee.button!==0&&ee.pointerType!=="touch")return;ee.preventDefault(),G(),F(ee);let q=ee.pointerId,U=ee.currentTarget,X=U.ownerDocument,O=a(fe=>{fe.pointerId===q&&F(fe);},"handleMove"),K=a(fe=>{fe.pointerId===q&&G();},"handleStop"),ne=a(fe=>{fe.pointerId===q&&G();},"handleLostCapture");X.addEventListener("pointermove",O),X.addEventListener("pointerup",K),X.addEventListener("pointercancel",K),U.addEventListener("lostpointercapture",ne),D.current=()=>{X.removeEventListener("pointermove",O),X.removeEventListener("pointerup",K),X.removeEventListener("pointercancel",K),U.removeEventListener("lostpointercapture",ne),U.hasPointerCapture?.(q)&&U.releasePointerCapture?.(q);},rD(U,q);},"handlePointerDown"),_=a(ee=>{if(!P)return;let q=ee.shiftKey?R.keyboardStep*4:R.keyboardStep,U=t==="horizontal"&&Dx(ee.currentTarget),X;ee.key==="Home"&&(X=R.min),ee.key==="End"&&(X=R.max),t==="horizontal"&&ee.key==="ArrowLeft"&&(X=W+(U?q:-q)),t==="horizontal"&&ee.key==="ArrowRight"&&(X=W+(U?-q:q)),t==="vertical"&&ee.key==="ArrowUp"&&(X=W-q),t==="vertical"&&ee.key==="ArrowDown"&&(X=W+q),X!==void 0&&(ee.preventDefault(),L(X));},"handleKeyDown"),z=u!==void 0?Ic(u,"0px"):void 0,re=z!==void 0?"var(--base-layout-split-gap)":"auto",Z=z!==void 0?t==="horizontal"?{width:"var(--base-layout-split-gap)"}:{height:"var(--base-layout-split-gap)"}:void 0,ae={...C.styles.layoutSplit,[t==="horizontal"?"gridTemplateColumns":"gridTemplateRows"]:i?`${W}% ${re} minmax(0, 1fr)`:`${W}% minmax(0, 1fr)`,...i?{gap:0}:{},...z!==void 0?{"--base-layout-split-gap":z,...i?{}:{gap:z}}:{},...k};return jsxRuntime.jsxs("div",{...T,...v,ref:A,"data-monkeys-component":"layout-split","data-slot":"root","data-orientation":t,"data-state":P?"enabled":s?"disabled":"static","data-controlled":E?"true":"false",className:m(C.slots.layoutSplitRoot,t==="horizontal"?C.slots.layoutSplitHorizontal:C.slots.layoutSplitVertical,y?.root,x),style:ae,children:[jsxRuntime.jsx("div",{"data-slot":"primary",className:m(C.slots.layoutSplitPane,C.slots.layoutSplitPrimary,y?.primary),style:C.styles.layoutSplitPane,children:V(o)?o:n}),i?jsxRuntime.jsx(Ym,{orientation:t,resizable:true,disabled:s,size:W,minSize:R.min,maxSize:R.max,label:f,appearance:b,dir:H,className:y?.handle,style:Z,onPointerDown:$,onKeyDown:_}):null,jsxRuntime.jsx("div",{"data-slot":"secondary",className:m(C.slots.layoutSplitPane,C.slots.layoutSplitSecondary,y?.secondary),style:C.styles.layoutSplitPane,children:r})]})},"BaseLayoutSplit"));var aD={line:"h-4 w-full",block:"h-24 w-full",circle:"aspect-square h-10 rounded-full"},na=ho.forwardRef(a(function({variant:t="line",animated:o=true,animation:r,appearance:n,className:i,classNames:s,style:l,...d},c){if(t!=="line"&&t!=="block"&&t!=="circle")throw new TypeError('BaseSkeleton variant must be "line", "block", or "circle".');if(typeof o!="boolean")throw new TypeError("BaseSkeleton animated must be a boolean.");let p=Pe(n),u=ke(),g=Ne(p),f=Zd(r,o,c);return jsxRuntime.jsx("div",{...u,...d,ref:f.ref,"aria-hidden":"true","data-monkeys-component":"skeleton","data-slot":"root","data-variant":t,"data-animated":f.mode!=="none","data-state":f.mode!=="none"?"animated":"static","data-skeleton-animation":f.mode,className:m(g.slots.skeletonRoot,aD[t],f.mode==="pulse"&&"motion-safe:animate-pulse motion-reduce:animate-none",s?.root,i),style:{...g.styles.skeleton,...f.style,...l}})},"BaseSkeleton"));function lD({className:e}){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:e,fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(lD,"DefaultLoadingIcon");var $r=ho.forwardRef(a(function({icon:t,title:o,description:r,actions:n,variant:i,animation:s,appearance:l,className:d,classNames:c,style:p,role:u="status","aria-live":g="polite","aria-busy":f=true,"aria-label":b,"aria-labelledby":x,...y},k){let w=Pe(l),v=ke(),{loading:h}=Ye(),S=Wr(),T=i??S.loading?.variant??"spinner",C=S.density==="compact"?"min-h-0 px-3 py-3":S.density==="comfortable"?"min-h-56 px-8 py-12":void 0,R=Ne(w),M=T==="skeleton"&&t===void 0?void 0:t===void 0?jsxRuntime.jsx(lD,{className:R.slots.loadingSpinner}):t,I=b??(x===void 0?typeof o=="string"?o:h.spinner:void 0);return jsxRuntime.jsxs("div",{...v,...y,ref:k,role:u,"aria-live":g,"aria-busy":f,"aria-label":I,"aria-labelledby":x,"data-monkeys-component":"loading-state","data-slot":"root","data-state":"loading","data-variant":T,"data-density":S.density,className:m(R.slots.stateRoot,C,c?.root,d),style:{...R.styles.stateRoot,...p},children:[T==="skeleton"?jsxRuntime.jsx(qn,{animation:s,children:jsxRuntime.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-3","data-slot":"skeleton",children:[jsxRuntime.jsx(na,{variant:"block",className:"h-20"}),jsxRuntime.jsx(na,{variant:"line",className:"w-4/5"}),jsxRuntime.jsx(na,{variant:"line",className:"w-3/5"})]})}):V(M)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":"loading",className:m(R.slots.stateIcon,c?.icon),style:R.styles.stateIcon,children:M}):null,T!=="skeleton"&&V(o)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":"loading",className:m(R.slots.stateTitle,c?.title),children:o}):null,T!=="skeleton"&&V(r)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":"loading",className:m(R.slots.stateDescription,c?.description),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":"loading",className:m(R.slots.stateActions,c?.actions),children:n}):null]})},"BaseLoadingState"));var pD=ho.forwardRef(a(function({children:t,openOnMount:o=false,size:r="md",tone:n="primary",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b=pn(c.href,"link"),x=c.href!==void 0&&b===void 0,y=ho.useRef();return ho.useEffect(()=>{!o||!b||c.target!=="_blank"||c["aria-disabled"]===true||c["aria-disabled"]==="true"||y.current===b||(y.current=b,window.open(b,"_blank","noopener,noreferrer"));},[o,b,c.target,c["aria-disabled"]]),jsxRuntime.jsx("a",{...g,...c,href:b,"aria-disabled":x?true:c["aria-disabled"],onClickCapture:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onClickCapture?.(k);},onClick:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onClick?.(k);},onAuxClickCapture:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onAuxClickCapture?.(k);},ref:p,"data-monkeys-component":"link","data-slot":"root","data-size":r,"data-tone":n,className:m(f.slots.linkRoot,zd(f,r),fi(f,n),l?.root,s),style:{...f.styles.link,...d},children:t})},"BaseLink"));var fD=ho.forwardRef(a(function({ordered:t=false,marker:o="auto",spacing:r="default",children:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b={...g,...c,"data-monkeys-component":"list","data-slot":"root","data-list-type":t?"ordered":"unordered","data-marker":o,"data-spacing":r,className:m(f.slots.listRoot,Bh(f,r),o!=="auto"&&Lh(f,o),l?.root,s),style:{...f.styles.list,...d},children:n};return t?jsxRuntime.jsx("ol",{...b,ref:p}):jsxRuntime.jsx("ul",{...b,ref:p})},"BaseList")),bD=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d);return jsxRuntime.jsx("li",{...c,...s,ref:l,"data-monkeys-component":"list-item","data-slot":"item",className:m(p.slots.listItem,n?.root,r),style:{...p.styles.listItem,...i},children:t})},"BaseListItem"));var yD=500;function xD({options:e,value:t,defaultValue:o,invalid:r,disabled:n,required:i,openForPreview:s,maxTagCount:l}){for(let[d,c]of [["invalid",r],["disabled",n],["required",i],["openForPreview",s]])if(typeof c!="boolean")throw new TypeError(`BaseMultiSelect ${d} must be a boolean.`);if(l!==void 0&&typeof l!="number")throw new TypeError("BaseMultiSelect maxTagCount must be a number.");if(e!==void 0&&!Array.isArray(e))throw new TypeError("BaseMultiSelect options must be an array.");e?.forEach((d,c)=>{if(!d||typeof d!="object")throw new TypeError(`BaseMultiSelect option at index ${c} must be an object.`);if(typeof d.value!="string")throw new TypeError(`BaseMultiSelect option value at index ${c} must be a string.`);if(d.disabled!==void 0&&typeof d.disabled!="boolean")throw new TypeError(`BaseMultiSelect option disabled at index ${c} must be a boolean.`);if(d.textValue!==void 0&&typeof d.textValue!="string")throw new TypeError(`BaseMultiSelect option textValue at index ${c} must be a string.`)});for(let[d,c]of [["value",t],["defaultValue",o]]){if(c!==void 0&&!Array.isArray(c))throw new TypeError(`BaseMultiSelect ${d} must be an array.`);c?.forEach((p,u)=>{if(typeof p!="string")throw new TypeError(`BaseMultiSelect ${d} item at index ${u} must be a string.`)});}}a(xD,"validateMultiSelectProps");function ef(e){let t=[],o=new Set;return e?.forEach(r=>{o.has(r)||(o.add(r),t.push(r));}),t}a(ef,"normalizeValues");function vD(e,t,o){if(!e.length)return -1;let r=t>=0?t:o===1?-1:0;for(let n=1;n<=e.length;n+=1){let i=(r+n*o+e.length)%e.length;if(!e[i]?.disabled)return i}return -1}a(vD,"getNextEnabledIndex");function Ec(e,t){if(t==="first")return e.findIndex(o=>!o.disabled);for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return -1}a(Ec,"getBoundaryEnabledIndex");function wD(e,t){return e===void 0||!Number.isFinite(e)?t:Math.max(0,Math.min(t,Math.floor(e)))}a(wD,"getSafeTagCount");function kD(e){return e.textValue!==void 0?e.textValue:typeof e.label=="string"?e.label:e.value}a(kD,"getOptionText");function CD(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(CD,"toDomId");var zx=ho.forwardRef(a(function({options:t,value:o,defaultValue:r,name:n,placeholder:i,icon:s,invalid:l=false,disabled:d=false,required:c=false,openForPreview:p=false,maxTagCount:u,removeLabel:g,emptyLabel:f,appearance:b,className:x,classNames:y,style:k,id:w,"aria-invalid":v,"aria-label":h,"aria-labelledby":S,"aria-describedby":T,"aria-errormessage":C,onValueChange:R,...M},I){xD({options:t,value:o,defaultValue:r,invalid:l,disabled:d,required:c,openForPreview:p,maxTagCount:u});let B=Ye().multiSelect,N=Pe(b),D=ke(),E=Ne(N),P=ho.useId(),W=w??P,H=`${W}-control`,A=`${W}-listbox`,L=ho.useRef(null),F=ho.useRef(null),G=ho.useRef(false),$=ho.useRef(""),_=ho.useRef(null),z=t??[],re=z.map((J,$e)=>`${W}-option-${$e}-${CD(J.value)}`),Z=p,[ae,ee]=ho.useState(false),q=Z||ae,U=ho.useRef(ef(r)),[X,O]=ho.useState(()=>[...U.current]),[K,ne]=ho.useState(()=>Ec(z,"first")),fe=o!==void 0,he=ho.useMemo(()=>ef(fe?o:X),[fe,X,o]),me=ho.useMemo(()=>new Set(he),[he]),ie=ho.useMemo(()=>{let J=new Map;return z.forEach($e=>{J.has($e.value)||J.set($e.value,$e);}),J},[z]),be=ho.useMemo(()=>he.map(J=>ie.get(J)).filter(J=>J!==void 0),[ie,he]),He=Ec(z,"first"),We=K>=0&&!z[K]?.disabled?K:He,Ke=wD(u,be.length),ce=be.slice(0,Ke),Q=be.length-ce.length,ge=be.length===0,we=M.dir??D.dir,Ie=d?"disabled":l?"invalid":q?"open":"closed",oe=a(J=>{L.current=J,typeof I=="function"?I(J):I&&(I.current=J);},"setRootRef"),xe=a(J=>{d||Z||(ee(J),J&&We<0&&ne(He));},"setOpen"),Ve=a(J=>{let $e=ef(J);fe||O($e),R?.($e);},"commitValues"),_e=a(J=>{if(!J||J.disabled||d)return;let $e=me.has(J.value)?he.filter(ue=>ue!==J.value):[...he,J.value];Ve($e);},"toggleOption"),Ge=a(J=>{d||Ve(he.filter($e=>$e!==J.value));},"removeOption"),le=a(J=>{J<0||z[J]?.disabled||(ne(J),q||xe(true));},"moveActive"),Me=a((J,$e)=>{let ue=J.currentTarget.ownerDocument.defaultView;if(!ue)return;let Re=`${$.current}${$e}`.toLocaleLowerCase();$.current=Re,_.current&&_.current.ownerWindow.clearTimeout(_.current.timerId),_.current={ownerWindow:ue,timerId:ue.setTimeout(()=>{$.current="",_.current=null;},yD)};let te=Array.from(Re).every(Te=>Te===Re[0])?$e.toLocaleLowerCase():Re;for(let Te=1;Te<=z.length;Te+=1){let ze=(We+Te+z.length)%z.length,je=z[ze];if(!je?.disabled&&kD(je).trim().toLocaleLowerCase().startsWith(te)){J.preventDefault(),le(ze);return}}},"handleTypeahead"),Ae=a(J=>{if(!(d||G.current||J.nativeEvent.isComposing)){if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),q?le(vD(z,We,J.key==="ArrowDown"?1:-1)):(ne(He),xe(true));return}if(J.key==="Home"||J.key==="End"){J.preventDefault(),le(Ec(z,J.key==="Home"?"first":"last"));return}if(J.key==="Enter"||J.key===" "){J.preventDefault(),q?_e(z[We]):xe(true);return}if(J.key==="Escape"&&q){J.preventDefault(),xe(false);return}if(J.key==="Tab"&&q){xe(false);return}J.key.length===1&&!J.ctrlKey&&!J.metaKey&&!J.altKey&&!/\s/.test(J.key)&&Me(J,J.key);}},"handleKeyDown");return ho.useEffect(()=>{if(!q||Z)return;let J=L.current?.ownerDocument;if(!J)return;let $e=a(ue=>{L.current?.contains(ue.target)||ee(false);},"handlePointerDown");return J.addEventListener("pointerdown",$e),()=>J.removeEventListener("pointerdown",$e)},[Z,q]),ho.useEffect(()=>{if(fe)return;let J=L.current?.closest("form");if(!J)return;let $e=a(()=>{O([...U.current]),ne(Ec(z,"first")),Z||ee(false);},"handleReset");return J.addEventListener("reset",$e),()=>J.removeEventListener("reset",$e)},[Z,fe,z]),ho.useEffect(()=>()=>{_.current&&_.current.ownerWindow.clearTimeout(_.current.timerId);},[]),jsxRuntime.jsxs("div",{...D,...M,id:w,ref:oe,dir:we,"data-monkeys-component":"multi-select","data-slot":"root","data-state":Ie,"data-disabled":d||void 0,"data-invalid":l||void 0,className:m(E.slots.controlWrapper,"overflow-visible",q&&"z-50",l&&E.slots.controlInvalid,d&&E.slots.controlDisabled,y?.root,x),style:{...E.styles.control,...l?E.styles.controlInvalid:void 0,...d?E.styles.controlDisabled:void 0,...k},children:[V(s)?jsxRuntime.jsx("span",{className:m(E.slots.controlIcon,y?.icon),children:s}):null,jsxRuntime.jsx("div",{...D,ref:F,id:H,role:"combobox",tabIndex:d?-1:0,dir:we,"aria-haspopup":"listbox","aria-expanded":q,"aria-controls":A,"aria-activedescendant":q&&We>=0?re[We]:void 0,"aria-autocomplete":"none","aria-disabled":d||void 0,"aria-required":c||void 0,"aria-invalid":v??(l||void 0),"aria-label":h,"aria-labelledby":S,"aria-describedby":T,"aria-errormessage":C,"data-monkeys-component":"multi-select","data-slot":"control","data-state":Ie,className:m(E.slots.controlBase,"flex min-h-9 cursor-pointer flex-wrap items-center gap-1.5 py-1.5 pr-9 text-left",d&&"!cursor-not-allowed",y?.control),onMouseDown:J=>{d||J.button!==0||(J.preventDefault(),F.current?.focus());},onClick:()=>{F.current?.focus(),xe(!q);},onBlur:J=>{L.current?.contains(J.relatedTarget)||xe(false);},onCompositionStart:()=>{G.current=true;},onCompositionEnd:()=>{G.current=false;},onKeyDown:Ae,children:jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag-list","data-state":ge?"empty":"filled",className:m("flex min-w-0 flex-1 flex-wrap items-center gap-1.5",y?.tagList),children:[ce.map((J,$e)=>jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag","data-state":"selected",className:m("inline-flex max-w-full items-center gap-1 rounded-full border border-border/70 bg-muted/65 px-2 py-0.5 text-xs font-medium text-foreground",y?.tag),children:[jsxRuntime.jsx("span",{"data-slot":"tag-label",className:m("max-w-40 truncate",y?.tagLabel),children:J.label}),jsxRuntime.jsx("button",{...D,type:"button",tabIndex:-1,dir:we,"aria-label":g?.(J)??B.removeOption({value:J.value}),disabled:d,"data-monkeys-component":"multi-select","data-slot":"tag-remove","data-state":"selected",className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/80 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed",y?.tagRemove),onClick:ue=>{ue.preventDefault(),ue.stopPropagation(),Ge(J),F.current?.focus();},onMouseDown:ue=>{ue.preventDefault(),ue.stopPropagation();},onKeyDown:ue=>ue.stopPropagation(),children:jsxRuntime.jsx("span",{"aria-hidden":"true",children:"x"})})]},`${J.value}-${$e}`)),Q>0?jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag-overflow","data-state":"selected",className:m("inline-flex max-w-full items-center rounded-full border border-border/70 bg-muted/45 px-2 py-0.5 text-xs font-medium text-muted-foreground",y?.tag),children:["+",Q]}):null,ge?jsxRuntime.jsx("span",{"data-monkeys-component":"multi-select","data-slot":"placeholder","data-state":"empty",className:m("min-w-0 truncate",E.slots.selectPlaceholder,y?.placeholder),children:i===void 0?B.placeholder:i}):null]})}),jsxRuntime.jsx("span",{"data-monkeys-component":"multi-select","data-slot":"chevron","data-state":q?"open":"closed",className:m(E.slots.selectChevron,q&&"rotate-[225deg]",y?.chevron)}),n?he.map(J=>ho.createElement("input",{...D,key:J,type:"hidden",name:n,value:J,disabled:d,dir:we,"data-monkeys-component":"multi-select","data-slot":"hidden-input","data-state":"selected",className:y?.hiddenInput})):null,q?jsxRuntime.jsx("div",{...D,id:A,role:"listbox",dir:we,"aria-multiselectable":"true","aria-labelledby":H,"data-monkeys-component":"multi-select","data-slot":"menu","data-state":"open",className:m(E.slots.selectMenu,y?.menu),style:E.styles.selectMenu,children:z.length>0?z.map((J,$e)=>{let ue=me.has(J.value),Re=$e===We,se=J.disabled?"disabled":Re?"active":ue?"selected":"idle";return ho.createElement("button",{...D,key:`${J.value}-${$e}`,id:re[$e],type:"button",role:"option",tabIndex:-1,dir:we,"aria-selected":ue,disabled:J.disabled,"data-monkeys-component":"multi-select","data-slot":"option","data-state":se,"data-active":Re||void 0,"data-selected":ue||void 0,"data-disabled":J.disabled||void 0,className:m(E.slots.selectOption,"gap-2",Re&&E.slots.selectOptionActive,ue&&E.slots.selectOptionSelected,J.disabled&&E.slots.selectOptionDisabled,y?.option),style:{...E.styles.selectOption,...Re?E.styles.selectOptionActive:void 0,...ue?E.styles.selectOptionSelected:void 0},onMouseEnter:()=>{J.disabled||ne($e);},onMouseDown:te=>te.preventDefault(),onClick:()=>{_e(J),F.current?.focus();}},jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"option-indicator",className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-border/70 text-[10px]",ue&&"border-primary/40 bg-primary text-primary-foreground",y?.optionIndicator),children:ue?"\u2713":null}),jsxRuntime.jsx("span",{"data-slot":"option-label",className:m("min-w-0 flex-1 truncate",y?.optionLabel),children:J.label}))}):jsxRuntime.jsx("div",{...D,dir:we,role:"option",tabIndex:-1,"aria-disabled":"true","aria-selected":"false","data-monkeys-component":"multi-select","data-slot":"empty","data-state":"empty",className:m("px-2.5 py-2 text-sm text-muted-foreground",y?.empty),children:f===void 0?B.empty:f})}):null]})},"BaseMultiSelect"));var ND=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/;function of(e){if(!ND.test(e))return null;let t=Number(e);return Number.isFinite(t)?t:null}a(of,"parseBaseNumberInputValue");function RD(e){let t=/^(?:\d+)(?:\.(\d*))?(?:e([+-]?\d+))?$/i.exec(Math.abs(e).toString());if(!t)return 0;let o=t[1]?.length??0,r=Number(t[2]??0);return Math.min(12,Math.max(0,o-r))}a(RD,"resolveDecimalPlaces");function Ox(e,t){let r=10**Math.max(...t.map(RD)),n=Math.round((e+Number.EPSILON)*r)/r;return Object.is(n,-0)?0:n}a(Ox,"normalizeSteppedValue");function MD({rawValue:e,direction:t,step:o,min:r,max:n}){let s=of(e)??0,l=[s,o];r!==void 0&&l.push(r),n!==void 0&&l.push(n);let d=Ox(s+t*o,l);return r!==void 0&&(d=Math.max(r,d)),n!==void 0&&(d=Math.min(n,d)),Ox(d,l)}a(MD,"resolveBaseNumberInputStep");function Fx(e,t){if(t!==void 0&&!Number.isFinite(t))throw new TypeError(`BaseNumberInput ${e} must be a finite number.`)}a(Fx,"validateBoundary");function Hx(e,t){if(!t.trim())throw new TypeError(`BaseNumberInput ${e} must be a non-empty string.`)}a(Hx,"validateLabel");function ID(e,t,o){return e!==null&&(t===void 0||e>=t)&&(o===void 0||e<=o)}a(ID,"isInRange");var DD=ho.forwardRef(a(function({value:t,defaultValue:o="",min:r,max:n,step:i=1,showStepControls:s=false,incrementLabel:l,decrementLabel:d,invalid:c=false,disabled:p=false,readOnly:u=false,appearance:g,className:f,classNames:b,style:x,onChange:y,onKeyDown:k,onValueChange:w,"aria-invalid":v,...h},S){if(t!==void 0&&typeof t!="string")throw new TypeError("BaseNumberInput value must be a string.");if(typeof o!="string")throw new TypeError("BaseNumberInput defaultValue must be a string.");if(Fx("min",r),Fx("max",n),r!==void 0&&n!==void 0&&r>n)throw new RangeError("BaseNumberInput min must be less than or equal to max.");if(!Number.isFinite(i)||i<=0)throw new TypeError("BaseNumberInput step must be a positive finite number.");for(let[_,z]of [["showStepControls",s],["invalid",c],["disabled",p],["readOnly",u]])if(typeof z!="boolean")throw new TypeError(`BaseNumberInput ${_} must be a boolean.`);let T=Ye(),C=l??T.numberInput.increment,R=d??T.numberInput.decrement;Hx("incrementLabel",C),Hx("decrementLabel",R);let[M,I]=ho.useState(o),B=t!==void 0,N=B?t:M,D=of(N),E=Pe(g),P=ke(),W=Ne(E),H=a((_,z)=>{B||I(_);let re=of(_);w?.(re,{rawValue:_,reason:z,inRange:ID(re,r,n)});},"emitValueChange"),A=a(_=>{if(p||u||D!==null&&(_===1&&n!==void 0&&D>=n||_===-1&&r!==void 0&&D<=r))return;let z=MD({rawValue:N,direction:_,step:i,min:r,max:n});H(String(z),_===1?"step-up":"step-down");},"stepValue"),L=a(_=>{y?.(_),H(_.currentTarget.value,"input");},"handleChange"),F=a(_=>{k?.(_),!(_.defaultPrevented||p||u)&&(_.key!=="ArrowUp"&&_.key!=="ArrowDown"||(_.preventDefault(),A(_.key==="ArrowUp"?1:-1)));},"handleKeyDown"),G=p||u||D!==null&&r!==void 0&&D<=r,$=p||u||D!==null&&n!==void 0&&D>=n;return jsxRuntime.jsxs("div",{...P,"data-monkeys-component":"number-input","data-slot":"root","data-invalid":c||void 0,"data-disabled":p||void 0,"data-readonly":u||void 0,className:m(W.slots.controlWrapper,c&&W.slots.controlInvalid,p&&W.slots.controlDisabled,u&&W.slots.controlReadOnly,b?.root,f),style:{...W.styles.control,...c?W.styles.controlInvalid:void 0,...p?W.styles.controlDisabled:void 0,...x},children:[jsxRuntime.jsx("input",{...h,ref:S,type:"text",inputMode:"decimal",role:"spinbutton",value:N,disabled:p,readOnly:u,"aria-invalid":v??(c||void 0),"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":D??void 0,"aria-valuetext":N||void 0,"data-slot":"control",className:m(W.slots.controlBase,W.slots.controlInput,W.slots.numberInputControl,b?.control),onChange:L,onKeyDown:F}),s?jsxRuntime.jsxs("span",{"data-slot":"step-controls",className:m(W.slots.numberInputStepControls,b?.stepControls),style:W.styles.numberInputStepControls,children:[jsxRuntime.jsx("button",{type:"button","aria-label":C,disabled:$,"data-slot":"increment",className:m(W.slots.numberInputStepButton,b?.increment),style:W.styles.numberInputStepButton,onClick:()=>A(1),children:"+"}),jsxRuntime.jsx("button",{type:"button","aria-label":R,disabled:G,"data-slot":"decrement",className:m(W.slots.numberInputStepButton,b?.decrement),style:W.styles.numberInputStepButton,onClick:()=>A(-1),children:"\u2212"})]}):null]})},"BaseNumberInput"));function Gx({tone:e,icon:t,title:o,description:r,actions:n,children:i,appearance:s,className:l,classNames:d,style:c,...p}){let u=Ne(s),g=i??r;return jsxRuntime.jsxs("div",{...p,className:m(u.slots.noticeBase,Wd(u,e),d?.root,l),style:{...u.styles.notice,...c},children:[V(t)?jsxRuntime.jsx("div",{className:m(u.slots.noticeIcon,d?.icon),children:t}):null,jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[V(o)?jsxRuntime.jsx("div",{className:m(u.slots.noticeTitle,d?.title),children:o}):null,V(g)?jsxRuntime.jsx("div",{className:m(u.slots.noticeDescription,d?.description),children:g}):null,V(n)?jsxRuntime.jsx("div",{className:m(u.slots.noticeActions,d?.actions),children:n}):null]})]})}a(Gx,"BaseNotice");function BD(e,...t){for(let o of t)o&&(typeof o=="function"?o(e):o.current=e);}a(BD,"setRefs");function $x(e,t){if(!t.trim())throw new TypeError(`BasePasswordInput ${e} must be a non-empty string.`)}a($x,"validateLabel");var LD=ho.forwardRef(a(function({visible:t,defaultVisible:o=false,onVisibleChange:r,showPasswordLabel:n,hidePasswordLabel:i,invalid:s=false,disabled:l=false,readOnly:d=false,appearance:c,className:p,classNames:u,style:g,"aria-invalid":f,...b},x){for(let[E,P]of [["defaultVisible",o],["invalid",s],["disabled",l],["readOnly",d]])if(typeof P!="boolean")throw new TypeError(`BasePasswordInput ${E} must be a boolean.`);if(t!==void 0&&typeof t!="boolean")throw new TypeError("BasePasswordInput visible must be a boolean.");let y=Ye(),k=n??y.passwordInput.showPassword,w=i??y.passwordInput.hidePassword;$x("showPasswordLabel",k),$x("hidePasswordLabel",w);let v=ho.useRef(null),[h,S]=ho.useState(o),T=t!==void 0,C=T?t:h,R=Pe(c),M=ke(),I=Ne(R),B=a(E=>{let P=v.current;P&&P.ownerDocument.activeElement===P&&E.preventDefault();},"handleTogglePointerDown"),N=a(()=>{if(l)return;let E=!C;T||S(E),r?.(E);},"handleToggle"),D=C?w:k;return jsxRuntime.jsxs("div",{...M,"data-monkeys-component":"password-input","data-slot":"root","data-visible":C||void 0,"data-invalid":s||void 0,"data-disabled":l||void 0,"data-readonly":d||void 0,className:m(I.slots.controlWrapper,s&&I.slots.controlInvalid,l&&I.slots.controlDisabled,d&&I.slots.controlReadOnly,u?.root,p),style:{...I.styles.control,...s?I.styles.controlInvalid:void 0,...l?I.styles.controlDisabled:void 0,...g},children:[jsxRuntime.jsx("input",{...b,ref:E=>BD(E,v,x),type:C?"text":"password",disabled:l,readOnly:d,"aria-invalid":f??(s||void 0),"data-slot":"control",className:m(I.slots.controlBase,I.slots.controlInput,I.slots.passwordInputControl,u?.control)}),jsxRuntime.jsx("button",{type:"button","aria-label":D,"aria-pressed":C,disabled:l,"data-slot":"toggle","data-state":C?"visible":"hidden",className:m(I.slots.passwordInputToggle,u?.toggle),style:I.styles.passwordInputToggle,onPointerDown:B,onClick:N,children:D})]})},"BasePasswordInput"));function FD(e,t,o){return Math.min(Math.max(e,t),o)}a(FD,"clamp");var Kx=ho.forwardRef(a(function({value:t=0,max:o=100,label:r,showValue:n=false,valueFormatter:i,appearance:s,className:l,classNames:d,style:c,"aria-label":p,"aria-labelledby":u,...g},f){let b=`${ho.useId()}-label`;if(typeof o!="number"||!Number.isFinite(o)||o<=0)throw new TypeError("BaseProgress max must be a positive finite number.");if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("BaseProgress value must be a finite number.");let x=Pe(s),y=ke(),k=Ne(x),w=FD(t,0,o),v=w/o*100,h=i?.(w,o)??`${Math.round(v)}%`,S=V(r),T=S||n,C=typeof r=="string"?r:void 0,M=S&&C===void 0&&!(p!==void 0||u!==void 0)?b:void 0,I=w===0?"empty":w===o?"complete":"progress";return jsxRuntime.jsxs("div",{...y,...g,ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":w,"aria-label":p??(u===void 0?C:void 0),"aria-labelledby":u??M,"data-monkeys-component":"progress","data-slot":"root","data-state":I,"data-value":w,"data-max":o,className:m(k.slots.progressRoot,d?.root,l),style:{...k.styles.progressRoot,...c},children:[T?jsxRuntime.jsxs("div",{"data-slot":"label-row","data-state":I,className:m(k.slots.progressLabelRow,d?.labelRow),children:[S?jsxRuntime.jsx("span",{id:M,"data-slot":"label",className:m(k.slots.progressLabel,d?.label),children:r}):jsxRuntime.jsx("span",{"data-slot":"label"}),n?jsxRuntime.jsx("span",{"data-slot":"value","data-value":w,className:m(k.slots.progressValue,d?.value),children:h}):null]}):null,jsxRuntime.jsx("div",{"data-slot":"track","data-state":I,className:m(k.slots.progressTrack,d?.track),children:jsxRuntime.jsx("div",{"data-slot":"indicator","data-state":I,"data-value":w,className:m(k.slots.progressIndicator,d?.indicator),style:{...k.styles.progressIndicator,width:`${v}%`}})})]})},"BaseProgress"));function GD(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(GD,"toDomId");var $D={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"},jD={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},UD={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},qx=ho.forwardRef(a(function({options:t=[],value:o,defaultValue:r,name:n,form:i,orientation:s="vertical",required:l=false,invalid:d=false,disabled:c=false,controlSize:p,appearance:u,className:g,classNames:f,style:b,children:x,onChange:y,onValueChange:k,id:w,"aria-invalid":v,...h},S){for(let[A,L]of [["required",l],["invalid",d],["disabled",c]])if(typeof L!="boolean")throw new TypeError(`BaseRadioGroup ${A} must be a boolean.`);if(s!=="horizontal"&&s!=="vertical")throw new TypeError('BaseRadioGroup orientation must be "horizontal" or "vertical".');if(p!==void 0&&p!=="sm"&&p!=="md"&&p!=="lg")throw new TypeError('BaseRadioGroup controlSize must be "sm", "md", or "lg".');if(!Array.isArray(t))throw new TypeError("BaseRadioGroup options must be an array.");let T=new Set;t.forEach((A,L)=>{if(!A||typeof A!="object")throw new TypeError(`BaseRadioGroup option at index ${L} must be an object.`);if(typeof A.value!="string")throw new TypeError(`BaseRadioGroup option value at index ${L} must be a string.`);if(T.has(A.value)){let F=JSON.stringify(A.value);throw new TypeError(`BaseRadioGroup options must use unique values; duplicate value ${F} at index ${L}.`)}if(A.disabled!==void 0&&typeof A.disabled!="boolean")throw new TypeError(`BaseRadioGroup option disabled at index ${L} must be a boolean.`);T.add(A.value);});let C=Pe(u),R=ke(),M=Ne(C),I=ho.useId(),B=w??I,N=n??B,[D,E]=ho.useState(r),P=o!==void 0,W=P?o:D,H=a((A,L)=>{if(c||L)return;let F=A.currentTarget.value;P||E(F),y?.(A),k?.(F,A);},"handleSelect");return jsxRuntime.jsxs("div",{...R,...h,ref:S,id:w,role:"radiogroup","aria-orientation":s,"aria-required":l||void 0,"aria-invalid":v??(d||void 0),"aria-disabled":c||void 0,"data-monkeys-component":"radio-group","data-slot":"root","data-state":c?"disabled":"enabled","data-orientation":s,"data-size":p,"data-required":l||void 0,"data-invalid":d||void 0,"data-disabled":c||void 0,className:m(M.slots.radioGroupRoot,s==="horizontal"&&"flex flex-wrap items-center",f?.root,g),style:{...M.styles.radioGroup,...b},children:[t.map((A,L)=>{let F=c||A.disabled,G=A.value===W,$=G?"checked":"unchecked",_=`${B}-${L}-${GD(A.value)}`;return jsxRuntime.jsxs("label",{htmlFor:_,"data-slot":"option","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioOption,F&&M.slots.radioOptionDisabled,p&&$D[p],f?.option),style:M.styles.radioOption,children:[jsxRuntime.jsxs("span",{"data-slot":"marker","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioMarker,G&&M.slots.radioMarkerChecked,p&&jD[p],f?.marker),children:[jsxRuntime.jsx("input",{id:_,type:"radio",name:N,form:i,value:A.value,checked:G,required:l,disabled:F,"aria-invalid":v??(d||void 0),"data-slot":"input","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioInput,f?.input),onChange:z=>H(z,A.disabled)}),G?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator","data-state":$,"data-size":p,className:m(M.slots.radioIndicator,p&&UD[p],f?.indicator)}):null]}),V(A.icon)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m("mt-0.5 shrink-0",f?.icon),children:A.icon}):null,jsxRuntime.jsxs("span",{"data-slot":"content",className:m(M.slots.radioContent,f?.content),children:[jsxRuntime.jsx("span",{"data-slot":"label",className:m(M.slots.radioLabel,f?.label),children:A.label}),V(A.description)?jsxRuntime.jsx("span",{"data-slot":"description",className:m(M.slots.radioDescription,f?.description),children:A.description}):null]})]},A.value)}),x]})},"BaseRadioGroup"));function qD(e){if(e==="x")return {overflowX:"auto",overflowY:"hidden"};if(e==="y")return {overflowX:"hidden",overflowY:"auto"};if(e==="both")return {overflowX:"auto",overflowY:"auto"};throw new TypeError('BaseScrollArea axis must be "x", "y", or "both".')}a(qD,"resolveOverflow");var YD=ho.forwardRef(a(function({children:t,axis:o="y",maxWidth:r,maxHeight:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b=qD(o),x=r===void 0?void 0:rr("BaseScrollArea","maxWidth",r),y=n===void 0?void 0:rr("BaseScrollArea","maxHeight",n);return jsxRuntime.jsx("div",{...g,...c,ref:p,"data-monkeys-component":"scroll-area","data-slot":"viewport","data-axis":o,className:m(f.slots.scrollAreaViewport,l?.viewport,s),style:{...f.styles.scrollArea,...b,maxWidth:x,maxHeight:y,...d},children:t})},"BaseScrollArea"));var iP=500;function sP({options:e,value:t,defaultValue:o,invalid:r,disabled:n,openForPreview:i,portal:s,required:l}){for(let[d,c]of [["invalid",r],["disabled",n],["openForPreview",i],["portal",s]])if(typeof c!="boolean")throw new TypeError(`BaseSelect ${d} must be a boolean.`);if(l!==void 0&&typeof l!="boolean")throw new TypeError("BaseSelect required must be a boolean.");if(e!==void 0&&!Array.isArray(e))throw new TypeError("BaseSelect options must be an array.");if(e?.forEach((d,c)=>{if(!d||typeof d!="object")throw new TypeError(`BaseSelect option at index ${c} must be an object.`);if(typeof d.value!="string")throw new TypeError(`BaseSelect option value at index ${c} must be a string.`);if(d.disabled!==void 0&&typeof d.disabled!="boolean")throw new TypeError(`BaseSelect option disabled at index ${c} must be a boolean.`);if(d.textValue!==void 0&&typeof d.textValue!="string")throw new TypeError(`BaseSelect option textValue at index ${c} must be a string.`)}),e?.length){if(t!==void 0&&typeof t!="string"&&typeof t!="number")throw new TypeError("BaseSelect value must be a string or number when options are used.");if(o!==void 0&&typeof o!="string"&&typeof o!="number")throw new TypeError("BaseSelect defaultValue must be a string or number when options are used.")}}a(sP,"validateSelectProps");function rf(e){return typeof e=="string"||typeof e=="number"?String(e):""}a(rf,"normalizeValue");function lP(e,t){if(t!==void 0)return e.find(o=>o.value===t)}a(lP,"findOption");function _s(e,t){let o=e.findIndex(r=>r.value===t&&!r.disabled);return o>=0?o:e.findIndex(r=>!r.disabled)}a(_s,"getInitialActiveIndex");function dP(e,t,o){if(!e.length)return -1;let r=t>=0?t:o===1?-1:0;for(let n=1;n<=e.length;n+=1){let i=(r+n*o+e.length)%e.length;if(!e[i]?.disabled)return i}return -1}a(dP,"getNextEnabledIndex");function cP(e,t){if(t==="first")return e.findIndex(o=>!o.disabled);for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return -1}a(cP,"getBoundaryEnabledIndex");function Yx(e){return e.textValue!==void 0?e.textValue:typeof e.label=="string"?e.label:e.value}a(Yx,"getOptionText");function uP(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(uP,"toDomId");var Fc=ho.forwardRef(a(function({options:t,placeholder:o,icon:r,invalid:n=false,disabled:i=false,openForPreview:s=false,portal:l=false,appearance:d,className:c,classNames:p,style:u,children:g,value:f,defaultValue:b,onBlur:x,onChange:y,onFocus:k,onInvalid:w,name:v,id:h,required:S,"aria-invalid":T,"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":B,...N},D){sP({options:t,value:f,defaultValue:b,invalid:n,disabled:i,openForPreview:s,portal:l,required:S});let E=Pe(d),P=ke(),W=Ne(E),H=Yn(),A=n||H.invalid,L=ho.useId(),F=h??L,G=`${F}-button`,$=`${F}-listbox`,_=ho.useRef(null),z=ho.useRef(null),re=ho.useRef(null),Z=ho.useRef([]),ae=ho.useRef(false),ee=ho.useRef(""),q=ho.useRef(null),U=t??[],X=U.length>0,O=s,[K,ne]=ho.useState(false),[fe,he]=ho.useState(false),me=O||K,ie=wr({disabled:O||!l?true:void 0}),{refs:be,floatingStyles:He,isPositioned:We,placement:Ke}=react.useFloating({transform:false,open:X&&me&&ie.shouldPortal,placement:"bottom-start",strategy:"fixed",whileElementsMounted:ie.shouldPortal?react.autoUpdate:void 0,middleware:[react.offset(6),react.flip({padding:8}),react.shift({padding:8}),react.size({padding:8,apply({rects:Ce,availableHeight:Xe,elements:de}){Object.assign(de.floating.style,{width:`${Ce.reference.width}px`,maxHeight:`min(15rem, ${Math.max(0,Xe)}px)`});}})]}),ce=ho.useCallback(Ce=>{z.current=Ce,be.setReference(Ce);},[be.setReference]),[Q,ge]=ho.useState(()=>rf(b)),we=f!==void 0,Ie=we?rf(f):Q,oe=lP(U,Ie),[xe,Ve]=ho.useState(()=>_s(U,Ie)),_e=xe>=0&&!U[xe]?.disabled?xe:_s(U,Ie),Ge=U.map((Ce,Xe)=>`${F}-option-${Xe}-${uP(Ce.value)}`),le=oe?.label??o,Me=!oe,Ae=N.dir??P.dir,J=i?"disabled":A?"invalid":me?"open":"closed",$e=a(Ce=>{re.current=Ce,typeof D=="function"?D(Ce):D&&(D.current=Ce);},"setSelectRef"),ue=a(Ce=>{x?.(Ce),H.notifyBlur(Ce.currentTarget.value);},"handleNativeBlur"),Re=a(Ce=>{y?.(Ce),H.notifyChange(Ce.currentTarget.value);},"handleNativeChange"),se=a(()=>{Ve(_s(U,Ie));},"resetActiveIndex"),te=a(()=>{se(),O||ne(false);},"cancelAndClose"),Te=a((Ce,Xe=false)=>{he(Xe),Ve(Ce??_s(U,Ie)),O||ne(true);},"openMenu"),ze=a(Ce=>{let Xe=re.current;if(!Xe)return;let de=Xe.ownerDocument.defaultView;if(!de)throw new Error("BaseSelect cannot dispatch change without an owning window.");let Ee=Object.getOwnPropertyDescriptor(de.HTMLSelectElement.prototype,"value")?.set;if(!Ee)throw new Error("BaseSelect could not resolve the native select value setter.");Ee.call(Xe,Ce),Xe.dispatchEvent(new de.Event("change",{bubbles:true}));},"notifyChange"),je=a(Ce=>{let Xe=U[Ce];!Xe||Xe.disabled||i||(Ve(Ce),Xe.value!==Ie&&(we||ge(Xe.value),ze(Xe.value)),O||ne(false));},"commitIndex"),it=a(Ce=>{Ce<0||U[Ce]?.disabled||(Ve(Ce),me||Te(Ce));},"moveActive"),Y=a((Ce,Xe)=>{let de=Ce.currentTarget.ownerDocument.defaultView;if(!de)return;let Ee=`${ee.current}${Xe}`.toLocaleLowerCase();ee.current=Ee,q.current&&q.current.ownerWindow.clearTimeout(q.current.timerId),q.current={ownerWindow:de,timerId:de.setTimeout(()=>{ee.current="",q.current=null;},iP)};let Le=Array.from(Ee).every(Je=>Je===Ee[0])?Xe.toLocaleLowerCase():Ee,Se=me?_e:U.findIndex(Je=>Je.value===Ie&&!Je.disabled);for(let Je=1;Je<=U.length;Je+=1){let bt=(Se+Je+U.length)%U.length,xt=U[bt];if(!xt?.disabled&&Yx(xt).trim().toLocaleLowerCase().startsWith(Le)){Ce.preventDefault(),it(bt);return}}},"handleTypeahead"),pe=a(Ce=>{if(!(i||ae.current||Ce.nativeEvent.isComposing)){if(Ce.key==="ArrowDown"||Ce.key==="ArrowUp"){Ce.preventDefault();let Xe=U.findIndex(Ee=>Ee.value===Ie&&!Ee.disabled);it(dP(U,me?_e:Xe,Ce.key==="ArrowDown"?1:-1));return}if(Ce.key==="Home"||Ce.key==="End"){Ce.preventDefault(),it(cP(U,Ce.key==="Home"?"first":"last"));return}if(Ce.key==="Enter"||Ce.key===" "){Ce.preventDefault(),me?je(_e):Te();return}if(Ce.key==="Escape"&&me){Ce.preventDefault(),te();return}if(Ce.key==="Tab"&&me){je(_e);return}Ce.key.length===1&&!Ce.ctrlKey&&!Ce.metaKey&&!Ce.altKey&&!/\s/.test(Ce.key)&&Y(Ce,Ce.key);}},"handleKeyDown"),Be=a(Ce=>{k?.(Ce),Ce.defaultPrevented||z.current?.focus();},"handleCustomFocus"),rt=a(Ce=>{w?.(Ce),Ce.preventDefault(),z.current?.focus();},"handleCustomInvalid");return ho.useEffect(()=>{if(!X||!me||O)return;let Ce=_.current?.ownerDocument;if(!Ce)return;let Xe=a(de=>{!_.current?.contains(de.target)&&!be.floating.current?.contains(de.target)&&te();},"handlePointerDown");return Ce.addEventListener("pointerdown",Xe),()=>{Ce.removeEventListener("pointerdown",Xe);}},[O,X,me,U,Ie]),ho.useEffect(()=>{!X||!me||_e<0||Z.current[_e]?.scrollIntoView?.({block:"nearest"});},[X,me,_e]),ho.useEffect(()=>{if(!X||we)return;let Ce=re.current,Xe=Ce?.form,de=Ce?.ownerDocument.defaultView;if(!Xe||!de)return;let Ee=a(()=>{de.setTimeout(()=>{let qe=rf(b);ge(qe),Ve(_s(U,qe)),O||ne(false);},0);},"handleReset");return Xe.addEventListener("reset",Ee),()=>Xe.removeEventListener("reset",Ee)},[b,O,we,X,U]),ho.useEffect(()=>()=>{q.current&&q.current.ownerWindow.clearTimeout(q.current.timerId);},[]),X?jsxRuntime.jsxs("div",{...P,ref:_,dir:Ae,"data-monkeys-component":"select","data-slot":"root","data-state":J,"data-native":"false",className:m(W.slots.controlWrapper,"overflow-visible",me&&"z-50",A&&W.slots.controlInvalid,i&&W.slots.controlDisabled,p?.root,c),style:{...W.styles.control,...A?W.styles.controlInvalid:void 0,...i?W.styles.controlDisabled:void 0,...u},children:[V(r)?jsxRuntime.jsx("span",{className:m(W.slots.controlIcon,p?.icon),children:r}):null,jsxRuntime.jsx("button",{...P,ref:ce,type:"button",id:G,role:"combobox",disabled:i,dir:Ae,"aria-haspopup":"listbox","aria-expanded":me,"aria-controls":$,"aria-activedescendant":me&&_e>=0?Ge[_e]:void 0,"aria-autocomplete":"none","aria-invalid":T??(A||void 0),"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":B??(S||void 0),"data-monkeys-component":"select","data-slot":"trigger","data-state":J,className:m(W.slots.controlBase,W.slots.controlSelect,"flex items-center text-left",p?.control),onClick:Ce=>{me?te():Te(void 0,Ce.detail>0);},onBlur:Ce=>{!_.current?.contains(Ce.relatedTarget)&&!be.floating.current?.contains(Ce.relatedTarget)&&(te(),H.notifyBlur(Ie));},onCompositionStart:()=>{ae.current=true;},onCompositionEnd:()=>{ae.current=false;},onKeyDown:pe,children:jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",Me&&W.slots.selectPlaceholder,Me&&p?.placeholder),children:le})}),jsxRuntime.jsx("span",{className:m(W.slots.selectChevron,me&&"rotate-[225deg]")}),jsxRuntime.jsxs("select",{...P,...N,ref:$e,id:h,name:v,value:Ie,required:S,disabled:i,dir:Ae,"aria-hidden":"true",tabIndex:-1,"data-monkeys-component":"select","data-slot":"native","data-state":J,"data-native":"false",className:W.slots.selectNative,onBlur:x,onFocus:Be,onInvalid:rt,onChange:Re,children:[V(o)?jsxRuntime.jsx("option",{value:"",disabled:true,children:o}):null,U.map(Ce=>jsxRuntime.jsx("option",{value:Ce.value,disabled:Ce.disabled,children:Yx(Ce)},Ce.value))]}),me?Oy(jsxRuntime.jsx("div",{...P,ref:ie.shouldPortal?be.setFloating:void 0,id:$,role:"listbox",dir:Ae,"aria-labelledby":G,"data-monkeys-component":"select","data-slot":"menu","data-portal":ie.shouldPortal?"portaled":"inline","data-state":"open","data-side":ie.shouldPortal?Ke.split("-")[0]:"bottom",className:m(W.slots.selectMenu,ie.shouldPortal&&Ke.startsWith("top")?"origin-bottom":"origin-top",fe&&!O&&(!ie.shouldPortal||We)&&"motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-150 motion-safe:ease-out",p?.menu),style:{...W.styles.selectMenu,...ie.shouldPortal?{...He,right:"auto",visibility:We?"visible":"hidden"}:void 0},children:U.map((Ce,Xe)=>{let de=Ce.value===Ie,Ee=Xe===_e,qe=Ce.disabled?"disabled":Ee?"active":de?"selected":"idle";return ho.createElement("button",{...P,ref:Le=>{Z.current[Xe]=Le;},key:Ce.value,id:Ge[Xe],type:"button",role:"option",tabIndex:-1,disabled:Ce.disabled,dir:Ae,"aria-selected":de,"data-monkeys-component":"select","data-slot":"option","data-state":qe,"data-active":Ee||void 0,"data-selected":de||void 0,"data-disabled":Ce.disabled||void 0,className:m(W.slots.selectOption,Ee&&W.slots.selectOptionActive,de&&W.slots.selectOptionSelected,Ce.disabled&&W.slots.selectOptionDisabled,p?.option),style:{...W.styles.selectOption,...Ee?W.styles.selectOptionActive:void 0,...de?W.styles.selectOptionSelected:void 0},onMouseDown:Le=>Le.preventDefault(),onClick:()=>je(Xe)},jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:Ce.label}))})}),ie):null]}):jsxRuntime.jsxs("div",{...P,"data-monkeys-component":"select","data-slot":"root","data-state":J,"data-native":"true",className:m(W.slots.controlWrapper,A&&W.slots.controlInvalid,i&&W.slots.controlDisabled,p?.root,c),style:{...W.styles.control,...A?W.styles.controlInvalid:void 0,...i?W.styles.controlDisabled:void 0,...u},children:[V(r)?jsxRuntime.jsx("span",{className:m(W.slots.controlIcon,p?.icon),children:r}):null,jsxRuntime.jsxs("select",{...P,...N,id:h,ref:D,name:v,value:f,defaultValue:b,required:S,disabled:i,"aria-invalid":T??(A||void 0),"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":B,"data-monkeys-component":"select","data-slot":"native","data-state":J,"data-native":"true",onBlur:ue,onFocus:k,onInvalid:w,onChange:Re,className:m(W.slots.controlBase,W.slots.controlSelect,p?.control),children:[V(o)?jsxRuntime.jsx("option",{value:"",disabled:true,children:o}):null,g]}),jsxRuntime.jsx("span",{className:W.slots.selectChevron})]})},"BaseSelect"));function Qx({eyebrow:e,title:t,description:o,actions:r,children:n,appearance:i,className:s,classNames:l,style:d,...c}){let p=Ne(i),u=n??o;return jsxRuntime.jsxs("div",{...c,className:m(p.slots.sectionHeaderRoot,l?.root,s),style:{...p.styles.sectionHeader,...d},children:[jsxRuntime.jsxs("div",{className:m(p.slots.sectionHeaderContent,l?.content),children:[V(e)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderEyebrow,l?.eyebrow),children:e}):null,V(t)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderTitle,l?.title),children:t}):null,V(u)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderDescription,l?.description),children:u}):null]}),V(r)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderActions,l?.actions),children:r}):null]})}a(Qx,"BaseSectionHeader");function fP(e,t){return t&&e?.some(o=>o.value===t)&&!e.find(r=>r.value===t)?.disabled?t:e?.find(o=>!o.disabled)?.value??e?.[0]?.value}a(fP,"getInitialSegmentValue");function aa({options:e=[],value:t,defaultValue:o,appearance:r,className:n,classNames:i,style:s,onValueChange:l,...d}){let c=Ne(r),[p,u]=ho.useState(()=>fP(e,o)),g=t!==void 0,f=g?t:p,b=a((y,k)=>{k||(g||u(y),l?.(y));},"handleSelect"),x=a(y=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(y.key))return;let k=e.filter(C=>!C.disabled);if(k.length===0)return;y.preventDefault();let w=Math.max(0,k.findIndex(C=>C.value===f)),v=y.key==="Home"?0:y.key==="End"?k.length-1:y.key==="ArrowLeft"||y.key==="ArrowUp"?(w-1+k.length)%k.length:(w+1)%k.length,h=k[v],S=y.currentTarget.querySelectorAll('[role="radio"]'),T=Array.from(S).find(C=>C.dataset.value===h.value);b(h.value),T?.focus();},"handleKeyDown");return jsxRuntime.jsx("div",{...d,role:"radiogroup","aria-orientation":"horizontal",className:m(c.slots.segmentedRoot,i?.root,n),style:{...c.styles.segmentedRoot,...s},onKeyDown:x,children:e.map(y=>{let k=y.value===f;return jsxRuntime.jsxs("button",{type:"button",role:"radio","data-value":y.value,"aria-checked":k,tabIndex:k?0:-1,disabled:y.disabled,className:m(c.slots.segmentedItem,k&&c.slots.segmentedItemActive,y.disabled&&c.slots.segmentedItemDisabled,i?.item),style:c.styles.segmentedItem,onClick:()=>b(y.value,y.disabled),children:[V(y.icon)?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 shrink-0",i?.icon),children:y.icon}):null,jsxRuntime.jsx("span",{className:m("min-w-0 truncate",i?.label),children:y.label})]},y.value)})})}a(aa,"BaseSegmentedControl");var hP=ho.forwardRef(a(function({decorative:t=false,label:o,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Ye(),p=Pe(r),u=ke(),g=Ne(p);if(typeof t!="boolean")throw new TypeError("BaseSpinner decorative must be a boolean.");if(t&&o!==void 0)throw new TypeError("BaseSpinner label cannot be provided when decorative is true.");let f=t?void 0:o??c.loading.spinner;if(!t&&(typeof f!="string"||!f.trim()))throw new TypeError("BaseSpinner label must be a non-empty string.");return jsxRuntime.jsx("span",{...u,...l,ref:d,role:t?void 0:"status","aria-label":f,"aria-hidden":t?"true":void 0,"data-monkeys-component":"spinner","data-slot":"root","data-decorative":t||void 0,className:m(g.slots.spinnerRoot,i?.root,n),style:{...g.styles.spinner,...s},children:jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(g.slots.spinnerIndicator,i?.indicator),style:g.styles.spinnerIndicator})})},"BaseSpinner"));var xP=ho.forwardRef(a(function({children:t,gap:o,align:r="stretch",justify:n="start",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Go(),g=Pe(i),f=ke(),b=Ne(g),x=o===void 0?void 0:rr("BaseStack","gap",o);return jsxRuntime.jsx("div",{...f,...c,ref:p,"data-monkeys-component":"stack","data-slot":"root","data-align":r,"data-justify":n,className:m(b.slots.stackRoot,u>0&&o===void 0&&"gap-[var(--monkeys-bento-gap)]",g?.slots?.stackRoot,l?.root,s),style:{...b.styles.stack,gap:x??b.styles.stack?.gap,alignItems:bi("BaseStack",r),justifyContent:gi("BaseStack",n),...d},children:t})},"BaseStack"));var CP=new Set(["pending","current","completed","error"]),Jx=["current","completed","error","disabled"],ev=/[\s\u0000-\u001f\u007f]/u;function tv(e){if(!e||typeof e!="object"||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}a(tv,"isPlainRecord");function ov(e){return V(e)?typeof e=="string"?!!e.trim():Array.isArray(e)?e.some(ov):true:false}a(ov,"hasStepLabel");function SP(e){try{return encodeURIComponent(e)}catch{throw new TypeError(`BaseSteps item id ${JSON.stringify(e)} must contain valid Unicode.`)}}a(SP,"encodeStepId");function TP(e){if(!Array.isArray(e))throw new TypeError("BaseSteps items must be an array.");let t=new Set,o=0,r=e.map((n,i)=>{if(!tv(n))throw new TypeError(`BaseSteps item at index ${i} must be an object.`);let s=n;if(typeof s.id!="string"||!s.id||ev.test(s.id))throw new TypeError(`BaseSteps item at index ${i} must have a non-empty id without whitespace or control characters.`);if(t.has(s.id))throw new TypeError(`BaseSteps item id ${JSON.stringify(s.id)} is duplicated.`);if(t.add(s.id),!ov(s.label))throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} label must contain renderable content.`);let l=s.status??"pending";if(!CP.has(l))throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} status must be one of: pending, current, completed, error.`);if(l==="current"&&(o+=1),s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} disabled must be a boolean.`);if(s.selectable!==void 0&&typeof s.selectable!="boolean")throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} selectable must be a boolean.`);return {item:s,encodedId:SP(s.id),status:l}});if(o>1)throw new RangeError("BaseSteps items may contain at most one current step.");return r}a(TP,"validateItems");function NP(e,t){if(t!==void 0&&!tv(t))throw new TypeError("BaseSteps statusLabels must be an object.");let o=t;for(let n of Object.keys(o??{}))if(!Jx.includes(n))throw new TypeError(`BaseSteps statusLabels.${n} is not a supported status label.`);let r={current:o?.current??e.current,completed:o?.completed??e.completed,error:o?.error??e.error,disabled:o?.disabled??e.disabled};for(let n of Jx){let i=r[n];if(typeof i!="string"||!i.trim())throw new TypeError(`BaseSteps statusLabels.${n} must be a non-empty string.`)}return r}a(NP,"resolveStatusLabels");function RP(e,t){if(e!==void 0&&(typeof e!="string"||!e.trim()))throw new TypeError("BaseSteps aria-label must be a non-empty string when provided.");if(t===void 0)return;if(typeof t!="string"||!t.trim())throw new TypeError("BaseSteps aria-labelledby must contain at least one valid ID token.");if(t.trim().split(/\s+/).some(r=>ev.test(r)))throw new TypeError("BaseSteps aria-labelledby must contain only valid ID tokens.")}a(RP,"validateAccessibleName");function MP(e,t){return e==="completed"?"\u2713":e==="error"?"!":t+1}a(MP,"getIndicator");function IP(e,t){return m(e==="pending"&&t.stepsIndicatorPending,e==="current"&&t.stepsIndicatorCurrent,e==="completed"&&t.stepsIndicatorCompleted,e==="error"&&t.stepsIndicatorError)}a(IP,"getIndicatorClassName");var DP=ho.forwardRef(a(function({items:t,orientation:o="horizontal",statusLabels:r,appearance:n,className:i,classNames:s,style:l,onStepSelect:d,"aria-label":c,"aria-labelledby":p,...u},g){let f=ho.useId(),b=Ye().steps,x=Pe(n),y=ke(),k=Ne(x);if(o!=="horizontal"&&o!=="vertical")throw new TypeError('BaseSteps orientation must be "horizontal" or "vertical".');if(d!==void 0&&typeof d!="function")throw new TypeError("BaseSteps onStepSelect must be a function.");if(typeof b.label!="string"||!b.label.trim())throw new TypeError("BaseSteps locale label must be a non-empty string.");RP(c,p);let w=TP(t),v=NP(b,r);return jsxRuntime.jsx("ol",{...y,...u,ref:g,role:"list","aria-label":c??(p===void 0?b.label:void 0),"aria-labelledby":p,"data-monkeys-component":"steps","data-slot":"root","data-orientation":o,className:m(k.slots.stepsRoot,o==="horizontal"?k.slots.stepsHorizontal:k.slots.stepsVertical,s?.root,i),style:{...k.styles.steps,...l},children:w.map(({item:h,encodedId:S,status:T},C)=>{let R=`${f}-step-${S}`,M=`${R}-label`,I=`${R}-description`,B=`${R}-status`,N=V(h.description),D=T==="pending"?void 0:v[T],E=!!(D||h.disabled),P=d!==void 0&&h.selectable!==false,W=[N?I:void 0,E?B:void 0].filter(Boolean).join(" ")||void 0,H=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(k.slots.stepsIndicator,IP(T,k.slots),s?.indicator),style:k.styles.stepsIndicator,children:MP(T,C)}),jsxRuntime.jsxs("span",{"data-slot":"content",className:m(k.slots.stepsContent,s?.content),children:[jsxRuntime.jsx("span",{id:M,"data-slot":"label",className:m(k.slots.stepsLabel,s?.label),children:h.label}),N?jsxRuntime.jsx("span",{id:I,"data-slot":"description",className:m(k.slots.stepsDescription,s?.description),children:h.description}):null,E?jsxRuntime.jsxs("span",{id:B,"data-slot":"status",className:m(k.slots.stepsStatus,s?.status),children:[D,D&&h.disabled?". ":null,h.disabled?v.disabled:null]}):null]})]});return jsxRuntime.jsxs("li",{id:R,"aria-current":T==="current"?"step":void 0,"aria-disabled":h.disabled||void 0,"data-step-id":h.id,"data-status":T,"data-disabled":h.disabled||void 0,"data-selectable":P||void 0,className:m(k.slots.stepsItem,o==="horizontal"?k.slots.stepsItemHorizontal:k.slots.stepsItemVertical,s?.item),style:k.styles.stepsItem,children:[P?jsxRuntime.jsx("button",{type:"button",disabled:h.disabled,"aria-labelledby":M,"aria-describedby":W,"data-slot":"trigger",className:m(k.slots.stepsTrigger,k.slots.stepsTriggerInteractive,h.disabled&&k.slots.stepsTriggerDisabled,s?.trigger),style:k.styles.stepsTrigger,onClick:()=>{h.disabled||d(h.id,h,C);},children:H}):jsxRuntime.jsx("div",{"data-slot":"trigger",className:m(k.slots.stepsTrigger,h.disabled&&k.slots.stepsTriggerDisabled,s?.trigger),style:k.styles.stepsTrigger,children:H}),C<w.length-1?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"connector",className:m(k.slots.stepsConnector,o==="horizontal"?k.slots.stepsConnectorHorizontal:k.slots.stepsConnectorVertical,T==="completed"&&k.slots.stepsConnectorCompleted,T==="error"&&k.slots.stepsConnectorError,s?.connector),style:k.styles.stepsConnector}):null]},h.id)})})},"BaseSteps"));var BP={sm:"h-5 w-9",md:"h-6 w-10",lg:"h-7 w-12"},LP={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},WP={sm:"translate-x-[18px]",md:"translate-x-5",lg:"translate-x-6"},zP={compact:"sm",default:"md",comfortable:"lg"},rv=ho.forwardRef(a(function({label:t,description:o,disabled:r=false,controlSize:n,appearance:i,className:s,classNames:l,style:d,checked:c,defaultChecked:p,onChange:u,...g},f){if(typeof r!="boolean")throw new TypeError("BaseSwitch disabled must be a boolean.");if(n!==void 0&&n!=="sm"&&n!=="md"&&n!=="lg")throw new TypeError('BaseSwitch controlSize must be "sm", "md", or "lg".');let b=Pe(i),x=ke(),y=Ne(b),k=V(t),w=Rd(o),[v,h]=ho.useState(p??false),S=c!==void 0,T=S?c:v,C=T?"checked":"unchecked",R=n??zP[y.density],M=a(I=>{r||(S||h(I.currentTarget.checked),u?.(I));},"handleChange");return jsxRuntime.jsxs("label",{...x,"data-monkeys-component":"switch","data-slot":"root","data-state":C,"data-size":n,"data-disabled":r||void 0,className:m(y.slots.switchRoot,!w&&"items-center",r&&y.slots.switchDisabled,l?.root,s),style:{...y.styles.switchRoot,...d},children:[jsxRuntime.jsxs("span",{"data-slot":"track","data-state":C,"data-size":n,className:m(y.slots.switchTrack,!w&&"mt-0",T&&y.slots.switchChecked,n&&BP[n],l?.track),style:y.styles.switchTrack,children:[jsxRuntime.jsx("input",{...g,ref:f,type:"checkbox",role:"switch",disabled:r,checked:c,defaultChecked:p,"aria-checked":T,"data-slot":"input","data-state":C,"data-size":n,"data-disabled":r||void 0,onChange:M,className:m(y.slots.switchInput,l?.input)}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"thumb","data-state":C,"data-size":n,className:m(y.slots.switchThumb,n&&LP[n],T&&WP[R],l?.thumb),style:y.styles.switchThumb})]}),k||w?jsxRuntime.jsxs("span",{"data-slot":"content",className:m(y.slots.switchContent,l?.content),children:[k?jsxRuntime.jsx("span",{"data-slot":"label",className:m(y.slots.switchLabel,l?.label),children:t}):null,w?jsxRuntime.jsx("span",{"data-slot":"description",className:m(y.slots.switchDescription,l?.description),children:o}):null]}):null]})},"BaseSwitch"));function FP({kind:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",children:{error:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M12 7v6"}),jsxRuntime.jsx("path",{d:"M12 17h.01"})]}),permission:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"}),jsxRuntime.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}),offline:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12.5a10 10 0 0 1 14 0"}),jsxRuntime.jsx("path",{d:"M8.5 16a5 5 0 0 1 7 0"}),jsxRuntime.jsx("path",{d:"M12 20h.01"}),jsxRuntime.jsx("path",{d:"m4 4 16 16"})]}),fallback:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 4.2 1.8c-1 .8-1.7 1.2-1.7 2.7"}),jsxRuntime.jsx("path",{d:"M12 17h.01"})]})}[e]})}a(FP,"SystemStateIcon");var za=ho.forwardRef(a(function({kind:t="fallback",icon:o,title:r,description:n,actions:i,appearance:s,className:l,classNames:d,style:c,role:p,"aria-live":u,...g},f){let b=Pe(s),x=ke(),y=Wr(),k=y.density==="compact"?"min-h-0 px-3 py-3":y.density==="comfortable"?"min-h-56 px-8 py-12":void 0,w=Ne(b),v=o===void 0?jsxRuntime.jsx(FP,{kind:t}):o,h=p??(t==="error"||t==="offline"?"alert":"status");return jsxRuntime.jsxs("div",{...x,...g,ref:f,role:h,"aria-live":u??(h==="alert"?"assertive":"polite"),"data-monkeys-component":"system-state","data-slot":"root","data-state":t,"data-density":y.density,className:m(w.slots.stateRoot,k,d?.root,l),style:{...w.styles.stateRoot,...c},children:[V(v)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":t,className:m(w.slots.stateIcon,d?.icon),style:w.styles.stateIcon,children:v}):null,V(r)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":t,className:m(w.slots.stateTitle,d?.title),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":t,className:m(w.slots.stateDescription,d?.description),children:n}):null,V(i)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":t,className:m(w.slots.stateActions,d?.actions),children:i}):null]})},"BaseSystemState"));var sf="application/x-monkeys-base-table-column",$c=8;function uf(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(uf,"assignRef");function jr(e,t){if(t!==void 0&&typeof t!="boolean")throw new Error(`BaseTable ${e} must be a boolean.`)}a(jr,"assertBoolean");function Ai(e,t,o){if(t!==void 0&&!o.includes(t))throw new Error(`BaseTable ${e} must be one of ${o.map(r=>`"${r}"`).join(", ")}.`)}a(Ai,"assertEnum");function Uc(e,t){if(t!==void 0&&(typeof t!="string"||t.trim().length===0))throw new Error(`BaseTable ${e} must be a non-empty string when provided.`)}a(Uc,"assertOptionalLabel");function cf(e,t){if(t!==void 0&&typeof t!="function")throw new Error(`BaseTable ${e} must be a function when provided.`)}a(cf,"assertOptionalFunction");function gn(e,t,o={}){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable ${t} must be a finite non-negative number${o.stringAllowed?" or a non-empty CSS size string":""}.`);return}if(!(o.stringAllowed&&typeof e=="string"&&e.trim().length>0))throw new Error(`BaseTable ${t} must be ${o.stringAllowed?"a finite non-negative number or a non-empty CSS size string":"a finite non-negative number"}.`)}}a(gn,"validateCssSizeValue");function $P(e){if(e===void 0)return;if(!Array.isArray(e))throw new Error("BaseTable columns must be an array when provided.");let t=new Set;return e.forEach((o,r)=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error(`BaseTable column at index ${r} must be an object.`);let n=o;if(typeof n.id!="string"||n.id.trim().length===0)throw new Error(`BaseTable column id at index ${r} must be a non-empty string.`);let i=n.id.trim();if(n.id!==i)throw new Error(`BaseTable column id "${n.id}" must not contain surrounding whitespace.`);if(t.has(i))throw new Error(`BaseTable columns contain duplicate id "${i}".`);if(t.add(i),gn(n.width,`column "${i}" width`,{stringAllowed:true}),gn(n.minWidth,`column "${i}" minWidth`,{stringAllowed:true}),gn(n.maxWidth,`column "${i}" maxWidth`,{stringAllowed:true}),typeof n.minWidth=="number"&&typeof n.maxWidth=="number"&&n.minWidth>n.maxWidth)throw new Error(`BaseTable column "${i}" minWidth cannot be greater than maxWidth.`)}),t}a($P,"validateColumns");function jP(e,t){if(e===void 0)return;if(!Array.isArray(e))throw new Error("BaseTable columnOrder must be an array when provided.");let o=new Set;if(e.forEach((r,n)=>{if(typeof r!="string"||r.trim().length===0)throw new Error(`BaseTable columnOrder entry at index ${n} must be a non-empty string.`);let i=r.trim();if(r!==i)throw new Error(`BaseTable columnOrder entry "${r}" must not contain surrounding whitespace.`);if(o.has(i))throw new Error(`BaseTable columnOrder contains duplicate id "${i}".`);if(t&&!t.has(i))throw new Error(`BaseTable columnOrder contains unknown column id "${i}".`);o.add(i);}),t&&o.size!==t.size){let r=[...t].filter(n=>!o.has(n));throw new Error(`BaseTable columnOrder must contain every configured column id; missing ${r.map(n=>`"${n}"`).join(", ")}.`)}}a(jP,"validateColumnOrder");function UP(e,t){if(e!==void 0){if(!e||typeof e!="object"||Array.isArray(e)||![Object.prototype,null].includes(Object.getPrototypeOf(e)))throw new Error("BaseTable columnSizes must be a plain record when provided.");Object.entries(e).forEach(([o,r])=>{let n=o.trim();if(n.length===0)throw new Error("BaseTable columnSizes keys must be non-empty strings.");if(o!==n)throw new Error(`BaseTable columnSizes key "${o}" must not contain surrounding whitespace.`);if(t&&!t.has(n))throw new Error(`BaseTable columnSizes contains unknown column id "${o}".`);gn(r,`columnSizes["${o}"]`);});}}a(UP,"validateColumnSizes");function jc(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":e.closest('[dir="rtl"]')!==null}a(jc,"isRtl");function KP(e,t){if(e.setPointerCapture)try{e.setPointerCapture(t);}catch(o){let r=e.ownerDocument.defaultView?.DOMException;if(r&&o instanceof r&&o.name==="NotFoundError")return;throw o}}a(KP,"setPointerCaptureIfAvailable");var sv=ho.createContext(null);function hn(e){let t=ho.useContext(sv),o=Pe(e);if(t){let n=e===void 0?t.appearance:o;return {...t,theme:e===void 0?t.theme:Ne(n),appearance:n}}let r=Ne(o);return {appearance:o,theme:r,layout:"native",setDraggingColumnId:a(()=>{},"setDraggingColumnId")}}a(hn,"useBaseTableContext");function lv(e){let t=false;return ho.Children.forEach(e,o=>{if(t||!ho.isValidElement(o))return;let r=o.props;if(r.layout==="split-scroll"){t=true;return}r.children&&(t=lv(r.children));}),t}a(lv,"hasSplitScrollTable");function Kc(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(Kc,"toCssSize");function qP(e,t){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable ${t} must be a finite non-negative number when numeric.`);return `${e}px`}if(e.trim().length===0)throw new Error(`BaseTable ${t} must not be an empty CSS size.`);return e}}a(qP,"validateTableCssSize");function lf(e,t,o){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable split-scroll column "${t}" has invalid ${o}. Expected a finite non-negative number.`);return `${e}px`}if(e.trim().length===0)throw new Error(`BaseTable split-scroll column "${t}" has an empty ${o} value.`);return e}}a(lf,"validateCssSize");function av(e,t,o){if(!(e===void 0||typeof e!="number")){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable split-scroll column "${t}" has invalid ${o}. Expected a finite non-negative number.`);return e}}a(av,"validateNumericSize");function YP(e,t){if(!e?.length)throw new Error('BaseTable layout="split-scroll" requires at least one column definition.');let o=new Set;return `${e.map((n,i)=>{let s=n.id.trim();if(!s)throw new Error(`BaseTable split-scroll column at index ${i} requires a non-empty id.`);if(o.has(s))throw new Error(`BaseTable layout="split-scroll" received duplicate column id "${s}".`);o.add(s);let l=t?.[s],d=av(n.minWidth,s,"minWidth"),c=av(n.maxWidth,s,"maxWidth");if(d!==void 0&&c!==void 0&&c<d)throw new Error(`BaseTable split-scroll column "${s}" has maxWidth smaller than minWidth.`);let p=lf(n.minWidth,s,"minWidth"),u=lf(n.maxWidth,s,"maxWidth"),g=l!==void 0?ia(l,d,c):n.width,f=lf(g,s,"width");return f||`minmax(${p??"0px"}, ${u??"1fr"})`}).join(" ")} var(--base-table-split-scrollbar-gutter)`}a(YP,"buildSplitColumnTemplate");function ia(e,t,o){let r=t??48,n=o??Number.POSITIVE_INFINITY;return Math.min(Math.max(e,r),n)}a(ia,"clampWidth");function df(e,t,o){if(!e||t===o)return;let r=e.indexOf(t),n=e.indexOf(o);if(r<0||n<0)return;let i=[...e],[s]=i.splice(r,1);return i.splice(n,0,s),i}a(df,"getNextColumnOrder");function XP(e){switch(e){case "asc":return "ascending";case "desc":return "descending";default:return}}a(XP,"sortAriaValue");function QP(e){switch(e){case "center":return "center";case "right":return "flex-end";default:return "flex-start"}}a(QP,"getSplitHeadJustifyContent");function ZP(e){switch(e){case "top":return "flex-start";case "bottom":return "flex-end";default:return "center"}}a(ZP,"getSplitHeadAlignItems");function JP({direction:e,className:t}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:m(t,e==="desc"&&"rotate-180",(!e||e==="none")&&"opacity-45"),children:"\u25B2"})}a(JP,"SortIndicator");function eE(){return jsxRuntime.jsxs("span",{"aria-hidden":"true",className:"grid gap-0.5",children:[jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"}),jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"}),jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"})]})}a(eE,"DragHandleIcon");var Bi=ho.forwardRef(a(function({appearance:t,attachedFooter:o=false,children:r,className:n,classNames:i,style:s,...l},d){jr("attachedFooter",o);let c=Pe(t),p=ke(),u=Ne(c),f=lv(r)?{overflow:"hidden",scrollbarGutter:"auto"}:void 0;return jsxRuntime.jsx("div",{...p,...l,ref:d,"data-monkeys-component":"table-container","data-slot":"container","data-base-table-container":"","data-attached-footer":o?"":void 0,className:m(u.slots.tableContainer,o&&u.slots.tableContainerFooterAttached,i?.root,n),style:{...u.styles.tableContainer,...o?u.styles.tableContainerFooterAttached:void 0,...f,...s},children:r})},"BaseTableContainer")),Li=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,layout:i="native",columns:s,bodyMaxHeight:l,bodyClassName:d,columnOrder:c,columnSizes:p,columnDragEnabled:u=false,columnResizeEnabled:g=false,onColumnOrderChange:f,onColumnSizeChange:b,...x},y){Ai("layout",i,["native","split-scroll"]),jr("columnDragEnabled",u),jr("columnResizeEnabled",g),cf("onColumnOrderChange",f),cf("onColumnSizeChange",b),gn(l,"bodyMaxHeight",{stringAllowed:true});let k=$P(s);jP(c,k),UP(p,k);let w=Pe(t),v=ke(),h=Ne(w),[S,T]=ho.useState(),C=ho.useRef(null),R=ho.useRef(null),M=i==="split-scroll",I=M?YP(s,p):void 0,B={appearance:w,theme:h,layout:i,columnTemplate:I,bodyMaxHeight:l,bodyClassName:d,splitHeaderRef:C,splitFooterRef:R,columnOrder:c,columnSizes:p,columnDragEnabled:u,columnResizeEnabled:g,onColumnOrderChange:f,onColumnSizeChange:b,draggingColumnId:S,setDraggingColumnId:T};return jsxRuntime.jsx(sv.Provider,{value:B,children:jsxRuntime.jsx("table",{...v,...x,ref:y,"data-monkeys-component":"table","data-slot":"root","data-base-table-layout":i,className:m(h.slots.tableRoot,M&&h.slots.tableSplitRoot,r?.root,o),style:{...h.styles.table,...M?h.styles.tableSplitRoot:void 0,...I?{"--base-table-column-template":I}:void 0,...n}})})},"BaseTable")),Wi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{layout:l,splitHeaderRef:d,theme:c}=hn(t),p=l==="split-scroll";return jsxRuntime.jsx("thead",{...i,ref:a(g=>{d&&(d.current=p?g:null),uf(s,g);},"setHeaderRef"),"data-slot":"header",className:m(c.slots.tableHeader,p&&c.slots.tableSplitHeader,r?.root,o),style:{...c.styles.tableHeader,...p?c.styles.tableSplitHeader:void 0,...n}})},"BaseTableHeader")),zi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,onScroll:n,style:i,...s},l){let{bodyClassName:d,bodyMaxHeight:c,layout:p,splitFooterRef:u,splitHeaderRef:g,theme:f}=hn(t),b=p==="split-scroll";return jsxRuntime.jsx("tbody",{...s,ref:l,"data-slot":"body",onScroll:b?y=>{let k=y.currentTarget.scrollLeft;g?.current&&(g.current.scrollLeft=k),u?.current&&(u.current.scrollLeft=k),n?.(y);}:n,className:m(f.slots.tableBody,b&&f.slots.tableSplitBody,b&&d,r?.root,o),style:{...f.styles.tableBody,...b?f.styles.tableSplitBody:void 0,...b&&c!==void 0?{maxHeight:qP(c,"bodyMaxHeight")}:void 0,...i}})},"BaseTableBody")),dv=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{layout:l,splitFooterRef:d,theme:c}=hn(t),p=l==="split-scroll";return jsxRuntime.jsx("tfoot",{...i,ref:a(g=>{d&&(d.current=p?g:null),uf(s,g);},"setFooterRef"),"data-slot":"footer",className:m(c.slots.tableFooter,p&&c.slots.tableSplitFooter,r?.root,o),style:{...c.styles.tableFooter,...p?c.styles.tableSplitFooter:void 0,...n}})},"BaseTableFooter")),yn=ho.forwardRef(a(function({interactive:t,selected:o,disabled:r,appearance:n,className:i,classNames:s,style:l,...d},c){jr("interactive",t),jr("selected",o),jr("disabled",r);let{layout:p,theme:u}=hn(n),g=p==="split-scroll";return jsxRuntime.jsx("tr",{...d,ref:c,"data-slot":"row","aria-disabled":r||void 0,"data-state":o?"selected":void 0,className:m(u.slots.tableRow,g&&u.slots.tableSplitRow,t&&!r&&u.slots.tableRowInteractive,o&&u.slots.tableRowSelected,r&&u.slots.tableRowDisabled,s?.root,i),style:{...u.styles.tableRow,...g?u.styles.tableSplitRow:void 0,...l}})},"BaseTableRow")),Oi=ho.forwardRef(a(function({presentation:t,columnId:o,align:r,verticalAlign:n,icon:i,label:s,description:l,meta:d,actions:c,trailing:p,sortable:u,sortDirection:g="none",sortLabel:f,onSort:b,draggable:x,dragLabel:y,resizable:k,resizeLabel:w,width:v,minWidth:h,maxWidth:S,appearance:T,className:C,classNames:R,style:M,children:I,onDragOver:B,onDrop:N,...D},E){if(Ai("head presentation",t,["classic-data-grid"]),Ai("head align",r,["left","center","right"]),Ai("head verticalAlign",n,["top","middle","bottom"]),Ai("head sortDirection",g,["asc","desc","none"]),jr("head sortable",u),jr("head draggable",x),jr("head resizable",k),cf("head onSort",b),Uc("head sortLabel",f),Uc("head dragLabel",y),Uc("head resizeLabel",w),o!==void 0&&(typeof o!="string"||o.trim().length===0))throw new Error("BaseTable head columnId must be a non-empty string when provided.");if(gn(v,"head width",{stringAllowed:true}),gn(h,"head minWidth"),gn(S,"head maxWidth"),h!==void 0&&S!==void 0&&h>S)throw new Error("BaseTable head minWidth cannot be greater than maxWidth.");let P=hn(T),{theme:W}=P,H=Ye().table,A=P.layout==="split-scroll",L=t==="classic-data-grid",F=r??(A?"center":"left"),G=n??"middle",$=ho.useRef(null),_=ho.useRef(()=>{}),[z,re]=ho.useState(),Z=a(ce=>{$.current=ce,uf(E,ce);},"setHeadRef"),ae=o&&P.columnSizes?.[o]!==void 0?P.columnSizes[o]:v,ee=!!(o&&x!==false&&(x||P.columnDragEnabled)&&P.columnOrder&&P.onColumnOrderChange),q=!!(o&&k!==false&&(k||P.columnResizeEnabled)&&P.onColumnSizeChange);if(q&&S!==void 0&&S<(h??48))throw new Error("BaseTable resizable head maxWidth cannot be smaller than its effective minWidth.");let U=!!(u||b),X=XP(g),O=V(s)?s:I,K=V(O)||V(l),ne=f??(K?void 0:H.sortColumn({columnId:o?.trim()||void 0})),fe=ee||V(i)||V(s)||V(l)||V(d)||V(c)||V(p)||U,he=L?jsxRuntime.jsx("div",{className:m("flex h-full min-w-0 select-none items-center",F==="center"?"justify-center":F==="right"?"justify-end":"justify-start",ee&&"cursor-grab active:cursor-grabbing"),...ee?{draggable:true,role:"button",tabIndex:0,"aria-disabled":false,"aria-roledescription":"sortable",onKeyDown:a(ce=>{if(!o||!P.columnOrder||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;let Q=P.columnOrder.indexOf(o);if(Q<0)return;let ge=jc(ce.currentTarget),we=ce.key==="ArrowLeft"?-1:1,Ie=Q+(ge?-we:we),oe=P.columnOrder[Ie];if(!oe)return;let xe=df(P.columnOrder,o,oe);xe&&(ce.preventDefault(),P.onColumnOrderChange?.(xe,{columnId:o,targetColumnId:oe}));},"onKeyDown"),onDragStart:a(ce=>{ce.stopPropagation(),P.setDraggingColumnId(o),ce.dataTransfer.effectAllowed="move",ce.dataTransfer.setData(sf,o);},"onDragStart"),onDragEnd:a(ce=>{ce.stopPropagation(),P.setDraggingColumnId(void 0);},"onDragEnd")}:{},children:O}):fe?jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadContent,R?.content),children:[jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadMain,R?.main),children:[ee?jsxRuntime.jsx("button",{type:"button",draggable:true,title:y,"aria-label":y??H.dragColumn({columnId:o}),className:m(W.slots.tableHeadDragHandle,R?.dragHandle),onClick:ce=>ce.stopPropagation(),onKeyDown:ce=>{if(!o||!P.columnOrder||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;let Q=P.columnOrder.indexOf(o);if(Q<0)return;let ge=jc(ce.currentTarget),we=ce.key==="ArrowLeft"?-1:1,Ie=Q+(ge?-we:we),oe=P.columnOrder[Ie];if(!oe)return;let xe=df(P.columnOrder,o,oe);xe&&(ce.preventDefault(),P.onColumnOrderChange?.(xe,{columnId:o,targetColumnId:oe}));},onDragStart:ce=>{ce.stopPropagation(),P.setDraggingColumnId(o),ce.dataTransfer.effectAllowed="move",ce.dataTransfer.setData(sf,o);},onDragEnd:ce=>{ce.stopPropagation(),P.setDraggingColumnId(void 0);},children:jsxRuntime.jsx(eE,{})}):null,i?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadIcon,R?.icon),children:i}):null,U?jsxRuntime.jsxs("button",{type:"button",disabled:!b,title:f,"aria-label":ne,className:m(W.slots.tableHeadSortButton,R?.sortButton),onClick:ce=>{ce.stopPropagation(),b?.(o);},children:[jsxRuntime.jsxs("span",{className:m(W.slots.tableHeadText,R?.text),children:[V(O)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadLabel,R?.label),children:O}):null,V(l)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadDescription,R?.description),children:l}):null]}),jsxRuntime.jsx(JP,{direction:g,className:m(W.slots.tableHeadSortIcon,R?.sortIcon)})]}):jsxRuntime.jsxs("span",{className:m(W.slots.tableHeadText,R?.text),children:[V(O)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadLabel,R?.label),children:O}):null,V(l)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadDescription,R?.description),children:l}):null]})]}),V(d)||V(c)||V(p)?jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadActions,R?.actions),children:[V(d)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadMeta,R?.meta),children:d}):null,c,p]}):null]}):I,me=a(ce=>{B?.(ce),!(!ee||!P.draggingColumnId||P.draggingColumnId===o)&&(ce.preventDefault(),ce.dataTransfer.dropEffect="move");},"handleDragOver"),ie=a(ce=>{if(N?.(ce),!ee||!o)return;let Q=P.draggingColumnId||ce.dataTransfer.getData(sf);if(!Q||Q===o)return;let ge=df(P.columnOrder,Q,o);ge&&(ce.preventDefault(),P.onColumnOrderChange?.(ge,{columnId:Q,targetColumnId:o})),P.setDraggingColumnId(void 0);},"handleDrop"),be=a(ce=>{if(!q||!o||!P.onColumnSizeChange||ce.button!==0&&ce.pointerType!=="touch")return;ce.preventDefault(),ce.stopPropagation(),_.current();let Q=ce.clientX,ge=He??$.current?.offsetWidth??h??48,we=ia(ge,h,S),Ie=ce.pointerId,oe=ce.currentTarget,xe=oe.ownerDocument,Ve=jc(oe),_e=a(Me=>{if(Me.pointerId!==Ie)return;let Ae=ia(we+(Ve?Q-Me.clientX:Me.clientX-Q),h,S);P.onColumnSizeChange?.(o,Ae,{columnId:o,previousWidth:we,minWidth:h,maxWidth:S});},"handlePointerMove"),Ge=a(Me=>{Me.pointerId===Ie&&_.current();},"handleStop"),le=a(Me=>{Me.pointerId===Ie&&_.current();},"handleLostCapture");_.current=()=>{xe.removeEventListener("pointermove",_e),xe.removeEventListener("pointerup",Ge),xe.removeEventListener("pointercancel",Ge),oe.removeEventListener("lostpointercapture",le),oe.hasPointerCapture?.(Ie)&&oe.releasePointerCapture?.(Ie),_.current=()=>{};},KP(oe,Ie),xe.addEventListener("pointermove",_e),xe.addEventListener("pointerup",Ge),xe.addEventListener("pointercancel",Ge),oe.addEventListener("lostpointercapture",le);},"handleResizePointerDown"),He=typeof ae=="number"?ia(ae,h,S):z,We=He??ia(h??48,h,S),Ke=a(ce=>{if(!q||!o||!P.onColumnSizeChange)return;let Q=jc(ce.currentTarget),ge=He??ia($.current?.offsetWidth||h||48,h,S),we;ce.key==="ArrowLeft"&&(we=ge+(Q?$c:-$c)),ce.key==="ArrowRight"&&(we=ge+(Q?-$c:$c)),ce.key==="Home"&&h!==void 0&&(we=h),ce.key==="End"&&S!==void 0&&(we=S),we!==void 0&&(ce.preventDefault(),ce.stopPropagation(),P.onColumnSizeChange(o,ia(we,h,S),{columnId:o,previousWidth:ge,minWidth:h,maxWidth:S}));},"handleResizeKeyDown");return ho.useEffect(()=>{if(typeof ae=="number"){re(void 0);return}let ce=$.current?.getBoundingClientRect().width;if(ce&&Number.isFinite(ce)){let Q=ia(ce,h,S);re(ge=>ge===Q?ge:Q);}},[ae,h,S,q]),ho.useEffect(()=>(q||_.current(),()=>_.current()),[q,o,P.onColumnSizeChange]),jsxRuntime.jsxs("th",{...D,ref:Z,"data-slot":"head","data-v2-header-drag-id":L&&ee?o:void 0,scope:D.scope??"col","aria-sort":X,className:m(W.slots.tableHead,A&&W.slots.tableSplitHead,F==="center"&&W.slots.tableCellAlignCenter,F==="right"&&W.slots.tableCellAlignRight,L&&"!relative !h-9 !px-3 !align-middle !text-sm !font-medium !text-muted-foreground after:pointer-events-none after:absolute after:bottom-2 after:right-0 after:top-2 after:w-px after:bg-border/50 after:content-['']",R?.root,C),style:{...W.styles.tableHead,...A?W.styles.tableSplitHead:void 0,width:A?void 0:Kc(ae),minWidth:A?void 0:Kc(h),maxWidth:A?void 0:Kc(S),...A?{alignItems:ZP(G),justifyContent:QP(F),textAlign:F}:n?{verticalAlign:n}:void 0,...M},onDragOver:me,onDrop:ie,children:[he,q&&L?jsxRuntime.jsx("div",{"data-column-resize-handle":"true",className:"absolute right-0 top-0 z-20 h-full w-2 cursor-col-resize touch-none select-none hover:bg-muted",onPointerDown:be}):q?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-valuenow":We,"aria-valuemin":h??48,"aria-valuemax":S,"aria-valuetext":`${We}px`,title:w,"aria-label":w??H.resizeColumn({columnId:o}),className:m(W.slots.tableHeadResizeHandle,R?.resizeHandle),onClick:ce=>ce.stopPropagation(),onKeyDown:Ke,onPointerDown:be}):null]})},"BaseTableHead")),Oa=ho.forwardRef(a(function({align:t="left",appearance:o,className:r,classNames:n,style:i,...s},l){Ai("cell align",t,["left","center","right"]);let{layout:d,theme:c}=hn(o),p=d==="split-scroll";return jsxRuntime.jsx("td",{...s,ref:l,"data-slot":"cell",className:m(c.slots.tableCell,p&&c.slots.tableSplitCell,t==="center"&&c.slots.tableCellAlignCenter,t==="right"&&c.slots.tableCellAlignRight,n?.root,r),style:{...c.styles.tableCell,...p?c.styles.tableSplitCell:void 0,...i}})},"BaseTableCell")),cv=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{theme:l}=hn(t);return jsxRuntime.jsx("caption",{...i,ref:s,"data-slot":"caption",className:m(l.slots.tableCaption,r?.root,o),style:{...l.styles.tableCaption,...n}})},"BaseTableCaption")),Fi=ho.forwardRef(a(function({colSpan:t,icon:o,title:r,description:n,actions:i,children:s,appearance:l,className:d,classNames:c,style:p,...u},g){if(!Number.isSafeInteger(t)||t<1)throw new Error("BaseTable empty colSpan must be a positive safe integer.");let{layout:f,theme:b}=hn(l),x=f==="split-scroll",y=V(o)||V(r)||V(n)||V(i);return jsxRuntime.jsx("tr",{...u,ref:g,"data-slot":"empty-row",className:m(b.slots.tableEmptyRow,x&&b.slots.tableSplitRow,c?.row,d),style:{...b.styles.tableEmpty,...x?b.styles.tableSplitRow:void 0,...p},children:jsxRuntime.jsx("td",{colSpan:t,"data-slot":"empty-cell",className:m(b.slots.tableEmptyCell,x&&b.slots.tableSplitCell,c?.cell),style:x?{gridColumn:"1 / -1"}:void 0,children:y?jsxRuntime.jsxs("div",{className:m(b.slots.tableEmptyContent,c?.content),children:[V(o)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyIcon,c?.icon),children:o}):null,V(r)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyTitle,c?.title),children:r}):null,V(n)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyDescription,c?.description),children:n}):null,V(i)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyActions,c?.actions),children:i}):null]}):s})})},"BaseTableEmpty"));function tE({baseClassName:e,className:t,style:o}){let r=Zd();return jsxRuntime.jsx("div",{ref:r.ref,"aria-hidden":"true","data-slot":"loading-skeleton","data-skeleton-animation":r.mode,className:m(e,r.mode==="pulse"&&"animate-pulse motion-reduce:animate-none",t),style:{...r.style,...o}})}a(tE,"BaseTableLoadingSkeleton");function uv({rows:e=3,columns:t,columnWidths:o=[],animated:r=true,animation:n,rowLabel:i,appearance:s,className:l,classNames:d,style:c}){if(!Number.isSafeInteger(e)||e<0)throw new Error("BaseTable loading rows must be a non-negative safe integer.");if(!Number.isSafeInteger(t)||t<1)throw new Error("BaseTable loading columns must be a positive safe integer.");if(!Array.isArray(o))throw new Error("BaseTable loading columnWidths must be an array.");o.forEach((x,y)=>gn(x,`loading columnWidths[${y}]`,{stringAllowed:true})),jr("loading animated",r),Uc("loading rowLabel",i);let{layout:p,theme:u}=hn(s),g=Ye().table,f=i??g.loadingRow,b=p==="split-scroll";return jsxRuntime.jsx(qn,{animation:n,animated:r,children:Array.from({length:e}).map((x,y)=>jsxRuntime.jsx(Qd,{index:y,children:jsxRuntime.jsx("tr",{"data-slot":"loading-row","aria-label":`${f} ${y+1}`,"aria-busy":"true",className:m(u.slots.tableLoadingRow,b&&u.slots.tableSplitRow,d?.row,l),style:{...u.styles.tableLoading,...b?u.styles.tableSplitRow:void 0,...c},children:Array.from({length:t}).map((k,w)=>jsxRuntime.jsx("td",{"data-slot":"loading-cell",className:m(u.slots.tableLoadingCell,b&&u.slots.tableSplitCell,d?.cell),children:jsxRuntime.jsx(tE,{baseClassName:u.slots.tableLoadingSkeleton,className:d?.skeleton,style:{width:Kc(o[w])}})},w))})},y))})}a(uv,"BaseTableLoading");var pv=ho.forwardRef(a(function({appearance:t,leading:o,actions:r,attached:n=true,children:i,className:s,classNames:l,style:d,...c},p){if(typeof n!="boolean")throw new Error("BaseTableFooterBar attached must be a boolean.");let u=Pe(t),g=ke(),f=Ne(u);return jsxRuntime.jsxs("div",{...g,...c,ref:p,"data-monkeys-component":"table-footer-bar","data-slot":"footer-bar","data-base-table-footer-bar":"","data-attached":n?"":void 0,className:m(f.slots.tableFooterBar,n&&f.slots.tableFooterBarAttached,l?.root,s),style:{...f.styles.tableFooterBar,...d},children:[V(o)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarLeading,l?.leading),children:o}):null,V(i)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarContent,l?.content),children:i}):null,V(r)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarActions,l?.actions),children:r}):null]})},"BaseTableFooterBar"));function sE({items:e,value:t,defaultValue:o,orientation:r,activationMode:n}){if(!Array.isArray(e))throw new TypeError("BaseTabs items must be an array.");if(t!==void 0&&typeof t!="string")throw new TypeError("BaseTabs value must be a string.");if(o!==void 0&&typeof o!="string")throw new TypeError("BaseTabs defaultValue must be a string.");if(r!=="horizontal"&&r!=="vertical")throw new TypeError('BaseTabs orientation must be "horizontal" or "vertical".');if(n!=="automatic"&&n!=="manual")throw new TypeError('BaseTabs activationMode must be "automatic" or "manual".');let i=new Set;e.forEach((s,l)=>{if(!s||typeof s!="object")throw new TypeError(`BaseTabs item at index ${l} must be an object.`);if(typeof s.value!="string")throw new TypeError(`BaseTabs item value at index ${l} must be a string.`);if(i.has(s.value))throw new TypeError(`BaseTabs items must use unique values; duplicate value ${JSON.stringify(s.value)} at index ${l}.`);if(s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseTabs item disabled at index ${l} must be a boolean.`);i.add(s.value);});}a(sE,"validateTabsProps");function mf(e,t){return t!==void 0&&e.some(o=>o.value===t&&!o.disabled)?t:e.find(o=>!o.disabled)?.value}a(mf,"getResolvedValue");function lE(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(lE,"toDomId");function dE(e){let t=new Set;return e.map((o,r)=>{let n=lE(o.value),i=n;if(t.has(i))for(i=`${n}-${r}`;t.has(i);)i=`${i}-${r}`;return t.add(i),i})}a(dE,"getDomIdFragments");function cE(e,t){let n=e.currentTarget.ownerDocument.defaultView?.getComputedStyle(e.currentTarget).direction==="rtl";return t==="ArrowRight"?n?-1:1:n?1:-1}a(cE,"getHorizontalStep");var fv=ho.forwardRef(a(function({items:t=[],value:o,defaultValue:r,orientation:n="horizontal",activationMode:i="automatic",appearance:s,className:l,classNames:d,style:c,onValueChange:p,id:u,"aria-label":g,"aria-labelledby":f,...b},x){sE({items:t,value:o,defaultValue:r,orientation:n,activationMode:i});let y=Pe(s),k=ke(),w=Ne(y),v=ho.useId(),h=u??v,S=o!==void 0?o:r,[T,C]=ho.useState(()=>mf(t,r)),[R,M]=ho.useState(()=>mf(t,S)),I=ho.useRef([]),B=o!==void 0,N=mf(t,B?o:T),D=t.findIndex(z=>z.value===N&&!z.disabled),E=D>=0?t[D]:void 0,P=t.reduce((z,re,Z)=>(re.disabled||z.push(Z),z),[]),W=t.findIndex(z=>z.value===R&&!z.disabled),H=W>=0?W:D,A=dE(t),L=E?"active":"disabled",F=typeof b.dir=="string"?b.dir:k.dir,G=a(z=>{z.disabled||(B||C(z.value),p?.(z.value));},"activateItem"),$=a((z,re)=>{let Z=t[re];!Z||Z.disabled||(z.preventDefault(),M(Z.value),I.current[re]?.focus(),i==="automatic"&&G(Z));},"moveFocus"),_=a((z,re,Z)=>{if(re.disabled)return;if(i==="manual"&&(z.key==="Enter"||z.key===" ")){z.preventDefault(),G(re);return}if(P.length===0)return;if(z.key==="Home"){$(z,P[0]);return}if(z.key==="End"){$(z,P[P.length-1]);return}let ae;if(n==="horizontal"&&(z.key==="ArrowLeft"||z.key==="ArrowRight")?ae=cE(z,z.key):n==="vertical"&&z.key==="ArrowUp"?ae=-1:n==="vertical"&&z.key==="ArrowDown"&&(ae=1),ae===void 0)return;let q=(P.indexOf(Z)+ae+P.length)%P.length;$(z,P[q]);},"handleKeyDown");return jsxRuntime.jsxs("div",{...k,...b,ref:x,id:u,"data-monkeys-component":"tabs","data-slot":"root","data-state":L,"data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsRoot,d?.root,l),style:c,children:[jsxRuntime.jsx("div",{...k,dir:F,role:"tablist","aria-label":g,"aria-labelledby":f,"aria-orientation":n,"data-monkeys-component":"tabs","data-slot":"list","data-state":L,"data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsList,n==="vertical"&&"flex-col items-stretch",d?.list),style:w.styles.tabsList,children:t.map((z,re)=>{let Z=A[re],ae=re===D,ee=z.disabled?"disabled":ae?"active":"inactive";return ho.createElement("button",{...k,ref:q=>{I.current[re]=q;},key:z.value,id:`${h}-${Z}-tab`,type:"button",role:"tab",tabIndex:!z.disabled&&re===H?0:-1,"aria-selected":ae,"aria-controls":`${h}-${Z}-panel`,disabled:z.disabled,dir:F,"data-monkeys-component":"tabs","data-slot":"trigger","data-state":ee,"data-orientation":n,"data-activation-mode":i,"data-disabled":z.disabled||void 0,className:m(w.slots.tabsTrigger,ae&&w.slots.tabsTriggerActive,z.disabled&&w.slots.tabsTriggerDisabled,d?.trigger),style:w.styles.tabsTrigger,onFocus:()=>M(z.value),onKeyDown:q=>_(q,z,re),onClick:()=>{M(z.value),G(z);}},jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:z.label}))})}),E?jsxRuntime.jsx("div",{...k,id:`${h}-${A[D]}-panel`,role:"tabpanel",tabIndex:0,"aria-labelledby":`${h}-${A[D]}-tab`,dir:F,"data-monkeys-component":"tabs","data-slot":"panel","data-state":"active","data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsPanel,d?.panel),style:w.styles.tabsPanel,children:V(E.content)?E.content:V(E.description)?jsxRuntime.jsx("p",{className:"m-0 text-muted-foreground",children:E.description}):null}):null]})},"BaseTabs"));var fE={sm:"min-h-20 px-2.5 py-1.5 text-xs leading-5",md:"min-h-24 px-3 py-2 text-sm leading-6",lg:"min-h-28 px-3.5 py-2.5 text-base leading-7"},bv=ho.forwardRef(a(function({invalid:t=false,disabled:o=false,readOnly:r=false,controlSize:n,appearance:i,className:s,classNames:l,style:d,"aria-invalid":c,onBlur:p,onChange:u,...g},f){for(let[v,h]of [["invalid",t],["disabled",o],["readOnly",r]])if(typeof h!="boolean")throw new TypeError(`BaseTextarea ${v} must be a boolean.`);if(n!==void 0&&n!=="sm"&&n!=="md"&&n!=="lg")throw new TypeError('BaseTextarea controlSize must be "sm", "md", or "lg".');let b=Pe(i),x=ke(),y=Ne(b),k=Yn(),w=t||k.invalid;return jsxRuntime.jsx("textarea",{...x,...g,ref:f,disabled:o,readOnly:r,"aria-invalid":c??(w||void 0),"data-monkeys-component":"textarea","data-slot":"control","data-size":n,"data-invalid":w||void 0,"data-disabled":o||void 0,"data-readonly":r||void 0,className:m(y.slots.controlWrapper,y.slots.controlBase,y.slots.controlTextarea,w&&y.slots.controlInvalid,o&&y.slots.controlDisabled,r&&y.slots.controlReadOnly,n&&fE[n],l?.control,s),style:{...y.styles.control,...w?y.styles.controlInvalid:void 0,...o?y.styles.controlDisabled:void 0,...d},onBlur:v=>{p?.(v),k.notifyBlur(v.currentTarget.value);},onChange:v=>{u?.(v),k.notifyChange(v.currentTarget.value);}})},"BaseTextarea"));function gv(e,t,o,r,n=false){ho.useEffect(()=>{let i=e.current,s=t.current,l=i?.ownerDocument.defaultView;if(!o||!i||!s||!l?.matchMedia||!s.animate)return;let d=i.closest("button, a, [tabindex]")??i,c=l.matchMedia("(prefers-reduced-motion: reduce)"),p=d.matches(":hover"),u=d.contains(i.ownerDocument.activeElement),g,f=a(()=>{g?.cancel(),g=void 0,delete i.dataset.scrolling;},"stop"),b=a(()=>{f();let h=s.scrollWidth-i.clientWidth;if(c.matches&&!(n&&p)||!p&&!u||h<=1)return;let T=h/64*1e3,C=160,R=T+C*2;g=s.animate([{transform:"translateX(0)",offset:0},{transform:"translateX(0)",offset:C/R},{transform:`translateX(-${h}px)`,offset:1-C/R},{transform:`translateX(-${h}px)`,offset:1}],{duration:R,iterations:1/0,direction:"alternate",easing:"linear"}),i.dataset.scrolling="true";},"update"),x=a(()=>{p=true,b();},"enter"),y=a(()=>{p=false,b();},"leave"),k=a(()=>{u=true,b();},"focus"),w=a(h=>{u=h.relatedTarget instanceof l.Node&&d.contains(h.relatedTarget),b();},"blur"),v=l.ResizeObserver?new l.ResizeObserver(b):void 0;return v?.observe(i),v?.observe(s),d.addEventListener("pointerenter",x),d.addEventListener("pointerleave",y),d.addEventListener("focusin",k),d.addEventListener("focusout",w),c.addEventListener("change",b),b(),()=>{f(),v?.disconnect(),d.removeEventListener("pointerenter",x),d.removeEventListener("pointerleave",y),d.removeEventListener("focusin",k),d.removeEventListener("focusout",w),c.removeEventListener("change",b);}},[e,t,o,r,n]);}a(gv,"useOverflowMotion");var xE=ho.forwardRef(a(function({as:t="p",children:o,size:r="md",tone:n="default",overflowMotion:i,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Pe(s),f=ke(),b=Ne(g),x=ho.useRef(null),y=ho.useRef(null),k=i==="hover-scroll"||i==="hover-scroll-always",w=ho.useCallback(v=>{x.current=v,typeof u=="function"?u(v):u&&(u.current=v);},[u]);return gv(x,y,k,o,i==="hover-scroll-always"),ho.createElement(t,{...f,...p,ref:w,"data-monkeys-component":"text","data-slot":"root","data-size":r,"data-tone":n,className:m(b.slots.textRoot,zd(b,r),fi(b,n),d?.root,l),style:{...b.styles.text,...k?{display:"block",minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{},...c}},k?ho.createElement("span",{ref:y,style:{display:"inline-block",whiteSpace:"nowrap"}},o):o)},"BaseText"));function xv({leading:e,title:t,description:o,actions:r,children:n,appearance:i,className:s,classNames:l,style:d,...c}){let p=Ne(i),u=V(t)||V(o);return jsxRuntime.jsxs("div",{...c,className:m(p.slots.toolbarRoot,l?.root,s),style:{...p.styles.toolbar,...d},children:[jsxRuntime.jsxs("div",{className:m(p.slots.toolbarLeading,l?.leading),children:[V(e)?e:null,u?jsxRuntime.jsxs("div",{className:m(p.slots.toolbarContent,l?.content),children:[V(t)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarTitle,l?.title),children:t}):null,V(o)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarDescription,l?.description),children:o}):null]}):null]}),V(n)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarContent,l?.content),children:n}):null,V(r)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarActions,l?.actions),children:r}):null]})}a(xv,"BaseToolbar");var wE=ho.forwardRef(a(function({children:t,focusable:o=false,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);if(typeof o!="boolean")throw new TypeError("BaseVisuallyHidden focusable must be a boolean.");return jsxRuntime.jsx("span",{...p,...l,ref:d,"data-monkeys-component":"visually-hidden","data-slot":"root","data-focusable":o||void 0,className:m(u.slots.visuallyHiddenRoot,o&&u.slots.visuallyHiddenFocusable,i?.root,n),style:{...u.styles.visuallyHidden,...s},children:t})},"BaseVisuallyHidden"));var vv;function CE(){return vv??(vv=import('@inf-monkeys-tech/monkeys-design/icons/catalog').catch(e=>{throw vv=void 0,e}))}a(CE,"loadCatalog");async function SE(){return (await CE()).records}a(SE,"loadIconRecords");async function wv(e){let t=e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").replace(/\s+/g,"-").toLowerCase();return (await SE())[t]?.svg}a(wv,"resolveAssetIconNodes");var RE={oneOf:[{type:"object",additionalProperties:false,required:["kind","src"],properties:{kind:{const:"image"},src:{type:"string",minLength:1,maxLength:4096}}},{type:"object",additionalProperties:false,required:["kind","value"],properties:{kind:{const:"emoji"},value:{type:"string",minLength:1,maxLength:64},backgroundColor:{type:"string",maxLength:128}}},{type:"object",additionalProperties:false,required:["kind","name"],properties:{kind:{const:"lucide"},name:{type:"string",minLength:1,maxLength:128}}}]},Tv={path:["d"],circle:["cx","cy","r"],rect:["x","y","width","height","rx","ry"],polyline:["points"],line:["x1","x2","y1","y2"],ellipse:["cx","cy","rx","ry"],polygon:["points"]};function Nv(e){if(!Array.isArray(e)||!e.length||e.length>256)return;let t=[];for(let o of e){if(!Array.isArray(o)||o.length!==2||typeof o[0]!="string"||!Object.prototype.hasOwnProperty.call(Tv,o[0]))return;let r=o[0],n=o[1];if(!n||typeof n!="object"||Array.isArray(n)||Object.getPrototypeOf(n)!==Object.prototype)return;let i={};for(let[s,l]of Object.entries(Object.getOwnPropertyDescriptors(n))){if(!("value"in l)||typeof l.value!="string")return;let d=l.value;if(s==="key"){if(d.length>256)return}else if(s==="fill"){if(d!=="currentColor"&&d!=="none")return}else if(Tv[r].includes(s)){if(s==="d"){if(!d.length||d.length>8192||!/^[MmZzLlHhVvCcSsQqTtAa0-9eE+.,\s-]+$/.test(d))return}else if(s==="points"){if(!d.length||d.length>8192||!/^[0-9eE+.,\s-]+$/.test(d))return}else if(!d.trim()||d.length>128||!Number.isFinite(Number(d)))return}else return;i[s]=d;}t.push([r,i]);}return t}a(Nv,"parseAssetIconNodes");var bf=ho.forwardRef(a(function({icon:t,alt:o,normalizeImageIcon:r=false,className:n,style:i,...s},l){let d=ke(),c=am()??wv,p=fh(),u=t.kind==="image"?t.src:void 0,[g,f]=ho.useState();ho.useEffect(()=>{if(!u||!p)return;let v=new AbortController;return Promise.resolve().then(()=>p(u,v.signal)).then(h=>{v.signal.aborted||f({reference:u,resolver:p,src:pn(h,"media")});}).catch(()=>{v.signal.aborted||f({reference:u,resolver:p});}),()=>v.abort()},[u,p]);let b=p?g&&g.reference===u&&g.resolver===p?g.src:void 0:pn(u,"media"),x=t.kind==="lucide"?t.name:void 0,[y,k]=ho.useState();ho.useEffect(()=>{let v=true;return x&&c&&Promise.resolve().then(()=>c(x)).then(h=>{v&&k({name:x,resolver:c,nodes:Nv(h)});}).catch(()=>{v&&k({name:x,resolver:c,nodes:void 0});}),()=>{v=false;}},[x,c]);let w=y?.name===x&&y?.resolver===c?y?.nodes:void 0;return jsxRuntime.jsx("div",{...d,...s,ref:l,role:"img","aria-label":o,className:m("monkeys-asset-icon flex h-11 w-11 shrink-0 items-center justify-center rounded-xl text-muted-foreground",t.kind==="emoji"?"text-2xl":t.kind==="image"&&!r?"overflow-hidden border":"bg-muted",n),style:{...t.kind==="emoji"&&t.backgroundColor?{backgroundColor:t.backgroundColor}:{},...i},children:t.kind==="image"?b?jsxRuntime.jsx("img",{src:b,alt:"","aria-hidden":"true",loading:"lazy",className:r?"h-5 w-5 object-contain":"h-full w-full object-cover"}):jsxRuntime.jsx(lucideReact.Wrench,{"aria-hidden":"true",className:"h-5 w-5 max-h-full max-w-full"}):t.kind==="emoji"?jsxRuntime.jsx("span",{"aria-hidden":"true",children:t.value}):w?jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5 max-h-full max-w-full",children:w.map(([v,h],S)=>{let{key:T,...C}=h;return ho.createElement(v,{...C,key:T??S})})}):jsxRuntime.jsx(lucideReact.Wrench,{"aria-hidden":"true",className:"h-5 w-5 max-h-full max-w-full"})})},"BaseAssetIcon"));function Dv(e){try{let t=new URL(e.trim());return ["http:","https:"].includes(t.protocol)?t.href:void 0}catch{return}}a(Dv,"imageLink");function Ev({accept:e,multiple:t=false,disabled:o=false,busy:r=false,title:n="Upload files",description:i,hint:s,busyLabel:l="Uploading...",icon:d,inputProps:c,className:p,classNames:u,onFilesSelected:g,renderPreview:f,replaceLabel:b,clearLabel:x,pasteLabel:y,renderActions:k,onClear:w,onChoose:v,onPasteClick:h,onUrlSelected:S,onInputError:T}){let C=f?.(),R=k?.(),M=ho.useRef(null),[I,B]=ho.useState(false),[N,D]=ho.useState(false),E=ho.useRef(true),P=ho.useRef(0),W=o||r,H=ho.useRef({blocked:W,onFilesSelected:g,onUrlSelected:S,onInputError:T});H.current={blocked:W,onFilesSelected:g,onUrlSelected:S,onInputError:T},ho.useEffect(()=>(E.current=true,()=>{E.current=false,P.current++;}),[]),ho.useEffect(()=>{W&&(P.current++,D(false),B(false));},[W]);let A=a(z=>{let re=Array.from(z);!H.current.blocked&&re.length&&H.current.onFilesSelected?.(t?re:re.slice(0,1));},"emitFiles"),L=a(()=>{W||(P.current++,D(false),v?v():M.current?.click());},"choose"),F=a(z=>{if(W)return false;if(z.files.length&&g)return P.current++,D(false),A(z.files),true;let re=Dv(z.getData("text/plain"));return re&&S?(P.current++,D(false),S(re),true):false},"acceptTransfer"),G=a(async()=>{if(W||N)return;let z=++P.current,re=a(()=>E.current&&!H.current.blocked&&z===P.current,"active");D(true);try{if(!navigator.clipboard?.read)throw new Error("Clipboard reading is unavailable.");let Z=await navigator.clipboard.read();for(let ae of Z){let ee=ae.types.find(q=>q.startsWith("image/"));if(ee&&H.current.onFilesSelected){let q=await ae.getType(ee);re()&&A([new File([q],`clipboard.${ee.split("/")[1]}`,{type:ee})]);return}}for(let ae of Z){if(!ae.types.includes("text/plain"))continue;let ee=Dv(await(await ae.getType("text/plain")).text());if(ee&&H.current.onUrlSelected){re()&&H.current.onUrlSelected(ee);return}}re()&&H.current.onInputError?.("empty-clipboard");}catch{re()&&H.current.onInputError?.("clipboard-unavailable");}finally{E.current&&z===P.current&&D(false);}},"paste"),$=a((z,re,Z)=>z?jsxRuntime.jsx("span",{"data-slot":Z,className:j("max-w-full [overflow-wrap:anywhere]",re),children:z}):null,"renderText"),_=a((z,re,Z)=>z?jsxRuntime.jsx(To,{content:z,portal:true,children:jsxRuntime.jsx(mt,{label:z,iconOnly:true,icon:re,disabled:W||N,onClick:Z})}):null,"action");return jsxRuntime.jsxs("div",{"data-monkeys-component":"data-explorer-upload-surface","data-state":r?"busy":I?"dragging":"idle",className:j("grid min-w-0 gap-global rounded-[var(--radius)] border border-border bg-muted/20 p-global transition-colors",!C&&"border-dashed",I&&"border-primary bg-primary/5",W&&"opacity-60",u?.root,p),tabIndex:W?-1:0,onPaste:z=>{F(z.clipboardData)&&(z.preventDefault(),z.stopPropagation());},onDragEnter:z=>{z.preventDefault(),W||B(true);},onDragOver:z=>z.preventDefault(),onDragLeave:z=>{z.relatedTarget instanceof Node&&z.currentTarget.contains(z.relatedTarget)||B(false);},onDrop:z=>{z.preventDefault(),B(false),F(z.dataTransfer)&&z.stopPropagation();},children:[!v&&jsxRuntime.jsx("input",{...c,ref:M,className:"sr-only",type:"file",accept:e,multiple:t,disabled:W,onChange:z=>{P.current++,D(false),A(z.target.files??[]),z.target.value="";}}),C?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ms,{aspectRatio:"video",className:"rounded-[var(--radius)] bg-background",children:C}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-token-sm",children:[_(b,jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-4 w-4"}),L),_(y,jsxRuntime.jsx(lucideReact.Clipboard,{className:"h-4 w-4"}),h??G),w&&_(x,jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),()=>{P.current++,D(false),w();}),R]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",className:j("flex min-w-0 flex-col items-center gap-token-sm rounded-[var(--radius)] py-global text-center focus-visible:outline focus-visible:outline-primary",u?.button),disabled:W,onClick:L,children:[jsxRuntime.jsx("span",{className:j("text-muted-foreground",u?.icon),children:d??jsxRuntime.jsx(lucideReact.UploadCloud,{className:"h-8 w-8","aria-hidden":true})}),$(r?l:n,j("text-sm font-medium text-foreground",u?.title),"title"),$(i,j("text-xs text-muted-foreground",u?.description),"description"),$(s,j("text-xs text-muted-foreground",u?.hint),"hint")]}),y&&jsxRuntime.jsx(mt,{label:y,icon:jsxRuntime.jsx(lucideReact.Clipboard,{className:"h-4 w-4"}),disabled:W||N,onClick:h??G,className:"w-full"}),R]})]})}a(Ev,"DataExplorerUploadSurface");function PE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"7"}),jsxRuntime.jsx("path",{d:"m20 20-3.5-3.5"})]})}a(PE,"DefaultSearchIcon");function Av({rootRef:e,dataAttributes:t,context:o,leading:r,leadingActions:n,searchVisible:i=true,searchValue:s="",searchPlaceholder:l="Search data...",searchIcon:d,viewOptions:c=[],activeViewId:p,actions:u,toolbarActions:g,appearance:f,children:b,className:x,classNames:y,onSearchChange:k,onSearchSubmit:w,onViewChange:v}){let h=a(C=>{C.preventDefault(),w?.(s);},"handleSubmit"),S=Et(f),T=Ct(S);return jsxRuntime.jsxs("div",{ref:e,...t,className:j(T.slots.toolbarRoot,y?.root,x),style:T.styles.toolbarRoot,children:[r||n?.length?jsxRuntime.jsxs("div",{className:j(T.slots.toolbarLeading,y?.leading),children:[r,n?.length?jsxRuntime.jsx(sn,{context:o,actions:n,layout:"inline",appearance:S,classNames:{action:y?.action,menuContent:y?.menuContent,menuItem:y?.menuItem}}):null]}):null,i?jsxRuntime.jsxs("form",{className:j(T.slots.toolbarSearch,y?.search),style:T.styles.toolbarSearch,onSubmit:h,children:[jsxRuntime.jsx("span",{className:j(T.slots.toolbarSearchIcon,y?.searchIcon),children:d??jsxRuntime.jsx(PE,{})}),jsxRuntime.jsx("input",{value:s,placeholder:l,className:j(T.slots.toolbarSearchInput,y?.searchInput),onChange:C=>k?.(C.currentTarget.value)})]}):null,c.length>0?jsxRuntime.jsx("div",{className:j(T.slots.toolbarViewSwitch,y?.viewSwitch),style:T.styles.toolbarViewSwitch,children:c.map(C=>{let R=C.id===p;return jsxRuntime.jsxs("button",{type:"button",disabled:C.disabled,className:j(T.slots.toolbarViewButton,R&&T.slots.toolbarViewButtonActive,y?.viewButton),onClick:()=>v?.(C.id),children:[C.icon,C.label?jsxRuntime.jsx("span",{children:C.label}):null]},C.id)})}):null,g?.length?jsxRuntime.jsx(sn,{context:o,actions:g,layout:"toolbar",appearance:f,classNames:{root:y?.actions,action:y?.action,menuContent:y?.menuContent,menuItem:y?.menuItem}}):u||b?jsxRuntime.jsxs("div",{className:j(T.slots.toolbarActions,y?.actions),children:[u,b]}):null]})}a(Av,"DataExplorerToolbarShell");function EE(e){if(!e||typeof e!="object")return;let t=e.children;return Array.isArray(t)?t:void 0}a(EE,"defaultGetChildren");function Bv({nodes:e=[],context:t,capabilities:o,className:r,classNames:n,empty:i,selectedNodeId:s,getNodeId:l,getChildren:d=EE,renderNode:c,onSelect:p}){let u=Array.isArray(e)?e:[],g=a((f,b)=>f.map((x,y)=>{let k=l?l(x,y):`${b}-${y}`,w=d(x,y,b)??[],v=w.length>0,h=String(s??"")===String(k),S=v?g(w,b+1):null;return c?jsxRuntime.jsx("div",{className:"min-w-0",children:c({node:x,index:y,depth:b,context:t,capabilities:o,childNodes:w,hasChildren:v,selected:h,onSelect:p,renderChildren:a(()=>S,"renderChildren")})},k):S}),"renderTreeNodes");return u.length===0?i?jsxRuntime.jsx("div",{className:j(n?.empty),children:i}):null:jsxRuntime.jsx("div",{className:j("min-w-0",n?.root,r),children:g(u,0)})}a(Bv,"DataExplorerTree");function Lv({title:e,subtitle:t,toolbar:o,footer:r,children:n,appearance:i,className:s,classNames:l}){let d=Ct(Et(i)),c=!!e||!!t||!!o;return jsxRuntime.jsxs("section",{className:j(d.slots.treeShellRoot,l?.root,s),children:[c?jsxRuntime.jsxs("div",{className:j(d.slots.treeShellHeader,l?.header),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e?jsxRuntime.jsx("div",{className:j(d.slots.treeShellTitle,l?.title),children:e}):null,t?jsxRuntime.jsx("div",{className:j(d.slots.treeShellSubtitle,l?.subtitle),children:t}):null]}),o?jsxRuntime.jsx("div",{className:j(d.slots.treeShellToolbar,l?.toolbar),children:o}):null]}):null,jsxRuntime.jsx("div",{className:j(d.slots.treeShellBody,l?.body),children:n}),r?jsxRuntime.jsx("div",{className:j(d.slots.treeShellFooter,l?.footer),children:r}):null]})}a(Lv,"DataExplorerTreeShell");function zv({expanded:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:e?"m6 9 6 6 6-6":"m9 18 6-6-6-6"})})}a(zv,"ChevronIcon");function BE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"12",cy:"5",r:"1"}),jsxRuntime.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}a(BE,"MoreIcon");function LE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"9",cy:"6",r:"1"}),jsxRuntime.jsx("circle",{cx:"9",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"9",cy:"18",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"6",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"18",r:"1"})]})}a(LE,"GripIcon");function Hv(e,t){for(let o of e??[])o.defaultExpanded&&t.add(o.id),Hv(o.children,t);}a(Hv,"collectDefaultExpandedNodeIds");function Ov(e,t){let o=new Set(t??[]);for(let r of e)Hv(r.nodes,o);return o}a(Ov,"buildDefaultNodeExpandedSet");function Fv(e,t){let o=new Set(t??[]);for(let r of e)(r.hideHeader||r.defaultExpanded!==false)&&o.add(r.id);return o}a(Fv,"buildDefaultGroupExpandedSet");function Vv(e,t,o,r){for(let[n,i]of (e??[]).entries())r.set(i.id,{node:i,group:t,parentId:o,index:n}),Vv(i.children,t,i.id,r);}a(Vv,"flattenNodes");function WE(e){let t=new Map;for(let o of e)Vv(o.nodes,o,void 0,t);return t}a(WE,"buildFlattenedNodeMap");function zE(e,t){return [...t??[],...e.actions??[]]}a(zE,"getNodeActions");function OE(e,t){return [...t??[],...e.actions??[]]}a(OE,"getGroupActions");function Jc({groups:e,nodes:t,context:o,selectedNodeId:r,selectedGroupId:n,expandedNodeIds:i,defaultExpandedNodeIds:s,expandedGroupIds:l,defaultExpandedGroupIds:d,resetExpansionKey:c,nodeActions:p,groupActions:u,indentSize:g=16,indentOffset:f=8,actionIcon:b,empty:x,loading:y=false,loadingNode:k,error:w,labels:v,reorderMode:h="none",appearance:S,className:T,classNames:C,onSelectNode:R,onSelectGroup:M,onExpandedNodeIdsChange:I,onExpandedGroupIdsChange:B,onAction:N,onReorderNodes:D}){let E=Ye().dataExplorer.viewTree,P=Ct(Et(S)),W=v?.actions??E.actions,H=v?.expand??E.expand,A=v?.collapse??E.collapse,L=k??v?.loading??E.loading,F=x??v?.empty??E.empty,G=Array.isArray(e),$=ho.useMemo(()=>G?e:[{id:"__root__",hideHeader:true,defaultExpanded:true,nodes:Array.isArray(t)?t:[]}],[e,G,t]),_=ho.useMemo(()=>WE($),[$]),[z,re]=ho.useState(()=>Ov($,s)),[Z,ae]=ho.useState(()=>Fv($,d)),[ee,q]=ho.useState(),[U,X]=ho.useState();ho.useEffect(()=>{re(Ov($,s)),ae(Fv($,d));},[d,s,c]);let O=i!==void 0?new Set(i):z,K=l!==void 0?new Set(l):Z,ne=a((Q,ge)=>{let we=new Set(O);ge?we.add(Q):we.delete(Q),i===void 0&&re(we),I?.([...we]);},"setNodeExpanded"),fe=a((Q,ge)=>{let we=new Set(K);ge?we.add(Q):we.delete(Q),l===void 0&&ae(we),B?.([...we]);},"setGroupExpanded"),he=a((Q,ge)=>ge.type==="node"?{type:"node",action:Q,node:ge.node,group:ge.group,context:o}:{type:"group",action:Q,group:ge.group,context:o},"createActionContext"),me=a((Q,ge)=>{let we=Q.filter(Ie=>{let oe=he(Ie,ge);return Mt(Ie.visible,oe)??true});return we.length===0?null:jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx("button",{type:"button",title:W,"aria-label":W,className:m(P.slots.menuTrigger,ge.type==="group"?P.slots.treeGroupActions:P.slots.treeNodeActions,ge.type==="group"?C?.groupActions:m(C?.nodeActions,C?.itemActions)),onClick:Ie=>Ie.stopPropagation(),children:b??jsxRuntime.jsx(BE,{})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{align:"end",sideOffset:6,className:m(P.slots.menuContent,C?.menuContent),style:P.styles.menuContent,onClick:Ie=>Ie.stopPropagation(),children:we.map(Ie=>{let oe=he(Ie,ge),xe=(Mt(Ie.disabled,oe)??false)||(Mt(Ie.loading,oe)??false),Ve=Mt(Ie.active,oe)??false;return Ie.render?jsxRuntime.jsx("div",{children:Ie.render(oe)},Ie.id):jsxRuntime.jsxs("div",{children:[Ie.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:P.slots.menuSeparator}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:Ie.title,disabled:xe,className:m(P.slots.menuItem,Vn(P,Ie.tone),Ve&&"bg-accent text-accent-foreground",C?.menuItem),style:P.styles.menuItem,onSelect:()=>{xe||(Ie.onAction?.(oe),N?.(oe));},children:[Ie.icon?jsxRuntime.jsx("span",{className:P.slots.menuItemIcon,children:Ie.icon}):null,jsxRuntime.jsx("span",{className:P.slots.menuItemLabel,children:Ie.label})]}),Ie.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:P.slots.menuSeparator}):null]},Ie.id)})})})]})},"renderActions"),ie=a((Q,ge)=>{Q.preventDefault();let we=ee||Q.dataTransfer.getData("application/x-data-explorer-node");if(!we||we===ge.id||!D){q(void 0),X(void 0);return}let Ie=_.get(we),oe=_.get(ge.id);if(!Ie||!oe){q(void 0),X(void 0);return}let xe=Ie.parentId===oe.parentId&&Ie.group?.id===oe.group?.id;if(h==="same-parent"&&!xe){q(void 0),X(void 0);return}let Ve={activeNode:Ie.node,overNode:oe.node,activeGroup:Ie.group,overGroup:oe.group,activeParentId:Ie.parentId,overParentId:oe.parentId,oldIndex:Ie.index,newIndex:oe.index,sameParent:xe,context:o};D(Ve),q(void 0),X(void 0);},"handleDrop"),be=a((Q,ge,we)=>{let Ie=Array.isArray(Q.children)?Q.children:[],oe=Ie.length>0,xe=Q.collapsible===false||O.has(Q.id),Ve=r===Q.id,_e=Q.selectable!==false&&!Q.disabled,Ge=h!=="none"&&!!D&&Q.reorderable!==false,le=ee===Q.id,Me=U===Q.id&&ee!==Q.id,Ae=zE(Q,p);return jsxRuntime.jsxs("div",{"data-data-explorer-entry":"node","data-data-explorer-node-id":Q.id,"data-data-explorer-group-id":ge?.id,className:m(P.slots.treeNode,C?.node,C?.item,Q.className),onDragOver:J=>{!ee||!Ge||(J.preventDefault(),X(Q.id));},onDragLeave:()=>{U===Q.id&&X(void 0);},onDrop:J=>ie(J,Q),children:[jsxRuntime.jsxs("div",{className:m(P.slots.treeNodeButton,Ve&&P.slots.treeNodeSelected,Q.disabled&&P.slots.treeNodeDisabled,le&&P.slots.treeNodeDragging,Me&&"ring-1 ring-primary/30",Ve&&C?.itemSelected,Ve&&C?.nodeSelected,Q.disabled&&C?.nodeDisabled,le&&C?.nodeDragging,C?.nodeButton,C?.itemButton),style:{paddingLeft:`calc(${(Q.indentLevel??we)*g+f}px + var(--data-explorer-tree-group-indent, 0px))`},role:"treeitem","aria-selected":Ve||void 0,"aria-disabled":Q.disabled||void 0,"aria-expanded":oe?xe:void 0,"aria-label":Q.ariaLabel,tabIndex:_e?0:-1,onClick:()=>{_e&&R?.(Q,o);},onKeyDown:J=>{J.target===J.currentTarget&&_e&&(J.key!=="Enter"&&J.key!==" "||(J.preventDefault(),R?.(Q,o)));},children:[Ge?jsxRuntime.jsx("span",{draggable:true,className:m(P.slots.treeNodeDragHandle,C?.nodeDragHandle),onClick:J=>J.stopPropagation(),onDragStart:J=>{J.stopPropagation(),J.dataTransfer.effectAllowed="move",J.dataTransfer.setData("application/x-data-explorer-node",Q.id),q(Q.id);},onDragEnd:()=>{q(void 0),X(void 0);},children:jsxRuntime.jsx(LE,{})}):null,oe?jsxRuntime.jsx("button",{type:"button",className:m(P.slots.treeNodeToggle,C?.nodeToggle,C?.expander),"aria-label":xe?A:H,onClick:J=>{J.stopPropagation(),ne(Q.id,!xe);},children:jsxRuntime.jsx(zv,{expanded:xe})}):jsxRuntime.jsx("span",{className:m(P.slots.treeNodeToggle,C?.nodeToggle)}),Q.icon?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeIcon,C?.nodeIcon,C?.itemIcon),children:Q.icon}):null,jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[jsxRuntime.jsx("span",{className:m(P.slots.treeNodeLabel,C?.nodeLabel,C?.itemLabel),children:Q.label}),Q.description?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeDescription,C?.nodeDescription),children:Q.description}):null]}),Q.meta?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeMeta,C?.nodeMeta),children:Q.meta}):null,Q.badge?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeBadge,C?.nodeBadge),children:Q.badge}):null,me(Ae,{type:"node",node:Q,group:ge})]}),oe&&xe?jsxRuntime.jsx("div",{className:m(P.slots.treeNodeChildren,C?.nodeChildren,C?.list),children:Ie.map(J=>be(J,ge,we+1))}):null]},Q.id)},"renderNode"),He=a((Q,ge,we)=>Q===false?null:jsxRuntime.jsx("div",{className:m(ge,we),children:Q}),"renderPlaceholder");if(y)return jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(L,P.slots.treeLoading,C?.loading)});if(w)return jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(w??v?.error,P.slots.treeError,C?.error)});let We=$.some(Q=>(Q.nodes??[]).length>0),Ke=$.some(Q=>Q.status==="loading"||Q.error);return !We&&!Ke&&(!G||$.length===0)?jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(F,P.slots.treeEmpty,C?.empty)}):jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),role:We||$.some(Q=>!Q.hideHeader)?"tree":void 0,children:$.map(Q=>{let ge=Q.hideHeader||Q.collapsible===false||K.has(Q.id),we=Q.nodes?.length??0,Ie=OE(Q,u),oe=n===Q.id,xe=Q.collapsible!==false;return jsxRuntime.jsxs("section",{"data-data-explorer-entry":"group","data-data-explorer-group-id":Q.id,className:m(P.slots.treeGroup,C?.group,Q.className),children:[Q.hideHeader?null:jsxRuntime.jsxs("div",{role:"treeitem","aria-label":typeof Q.label=="string"?Q.label:void 0,"aria-selected":Q.selectable?oe:void 0,"aria-expanded":xe?ge:void 0,className:m(P.slots.treeGroupHeader,P.slots.treeGroupHeaderButton,oe&&P.slots.treeNodeSelected,C?.groupHeader,C?.groupHeaderButton,oe&&C?.itemSelected),children:[jsxRuntime.jsxs("button",{type:"button",className:m("flex min-w-0 flex-1 items-center gap-2 text-left outline-hidden focus-visible:ring-2 focus-visible:ring-ring",C?.groupLabel),"aria-pressed":Q.selectable?oe:void 0,"aria-expanded":!Q.selectable&&xe?ge:void 0,onClick:()=>{if(Q.selectable){M?.(Q,o);return}xe&&fe(Q.id,!ge);},children:[Q.icon?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeIcon,C?.nodeIcon,C?.itemIcon),children:Q.icon}):null,jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[Q.label?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeLabel,C?.nodeLabel,C?.itemLabel),children:Q.label}):null,Q.description?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeDescription,C?.nodeDescription),children:Q.description}):null]}),Q.meta?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeMeta,C?.nodeMeta),children:Q.meta}):null,Q.badge?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeBadge,C?.nodeBadge),children:Q.badge}):null]}),xe?jsxRuntime.jsx("button",{type:"button",className:m(P.slots.treeNodeToggle,C?.expander),"aria-label":ge?A:H,"aria-expanded":ge,onClick:()=>fe(Q.id,!ge),children:jsxRuntime.jsx(zv,{expanded:ge})}):jsxRuntime.jsx("span",{className:m(P.slots.treeNodeToggle,C?.expander)}),me(Ie,{type:"group",group:Q})]}),ge?jsxRuntime.jsx("div",{role:"group",className:m(P.slots.treeGroupContent,C?.groupContent,C?.list),children:Q.loading||Q.status==="loading"?He(L,P.slots.treeLoading,C?.loading):Q.error||Q.status==="error"?He(Q.error??v?.error??E.error,P.slots.treeError,C?.error):we>0?Q.nodes?.map(Ve=>be(Ve,Q,0)):He(Q.empty??F,P.slots.treeEmpty,C?.empty)}):null]},Q.id)})})}a(Jc,"DataExplorerViewTree");function FE(e,t,o){let r=e.filter(n=>!n.hidden);if(r.length!==0){if(t){let n=r.find(i=>i.id===t);if(n)return n}if(o){let n=r.find(i=>i.id===o);if(n)return n}return r[0]}}a(FE,"resolveActiveViewDefinition");function Gv({items:e,views:t=[],activeViewId:o,fallbackViewId:r,context:n,capabilities:i,className:s,classNames:l,empty:d,loading:c,loadingNode:p,footer:u,overlay:g,layout:f,collection:b,selectedIds:x=[],getItemId:y,itemDefinition:k,renderItem:w,onOpenItem:v,onSelectionChange:h}){let S=Array.isArray(e)?e:[],T=FE(t,o,r),C=T?.id??o??r??"",R=b||T?.collection?{...b,...T?.collection,classNames:{...b?.classNames,...T?.collection?.classNames}}:void 0,M=T?.layout??T?.collection?.layout??f??b?.layout,I=T?.collection?.loading??b?.loading??c,B=T?.collection?.loadingNode??b?.loadingNode??p,N=T?.collection?.footer??b?.footer??u,D=T?.collection?.overlay??b?.overlay??g,E=typeof T?.empty=="function"?T.empty({items:S,activeViewId:C,context:n,capabilities:i,className:s,empty:d,loading:c,loadingNode:p,footer:u,overlay:g,layout:f,collection:R,selectedIds:x,getItemId:y,itemDefinition:k,renderItem:w,onOpenItem:v,onSelectionChange:h}):T?.empty??d,P={items:S,activeViewId:C,context:n,capabilities:i,className:s,empty:E,loading:I,loadingNode:B,footer:N,overlay:D,layout:M,collection:R,selectedIds:x,getItemId:y,itemDefinition:T?.itemDefinition??k,renderItem:T?.renderItem??w,onOpenItem:v,onSelectionChange:h};return T?.render?jsxRuntime.jsx(jsxRuntime.Fragment,{children:T.render(P)}):jsxRuntime.jsx(Ci,{items:S,activeViewId:C,context:n,capabilities:i,className:R?.className??s,classNames:{...l,...R?.classNames},empty:E,loading:P.loading,loadingNode:P.loadingNode,footer:P.footer,overlay:P.overlay,layout:P.layout,scrollable:R?.scrollable,wrapItems:R?.wrapItems,measuredGrid:R?.measuredGrid,itemsStyle:R?.itemsStyle,itemStyle:R?.itemStyle,selectedIds:x,getItemId:y,itemDefinition:P.itemDefinition,renderItem:P.renderItem,getItemClassName:T?.getItemClassName,onOpenItem:v,onSelectionChange:h})}a(Gv,"DataExplorerView");function $v({header:e,footer:t,overlay:o,empty:r,isEmpty:n=false,children:i,className:s,classNames:l}){return jsxRuntime.jsxs("section",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",l?.root,s),children:[e?jsxRuntime.jsx("div",{className:j("shrink-0",l?.header),children:e}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden",l?.body),children:n&&r?jsxRuntime.jsx("div",{className:j("flex h-full items-center justify-center p-6 text-sm text-muted-foreground",l?.empty),children:r}):i}),t?jsxRuntime.jsx("div",{className:j("shrink-0",l?.footer),children:t}):null,o?jsxRuntime.jsx("div",{className:j("absolute inset-0",l?.overlay),children:o}):null]})}a($v,"DataExplorerViewShell");var qs="gap-2 rounded-[var(--radius)] border border-transparent text-sm font-medium motion-reduce:transition-none",Ys="size-[var(--monkeys-component-navigation-sidebar-icon-size,1.125rem)] shrink-0 text-inherit [&_svg]:size-full",yf="text-foreground hover:border-transparent hover:bg-[var(--navigation-internal-hover-background)] hover:text-[var(--navigation-internal-hover-foreground)]",xf="border-[var(--navigation-internal-selected-border)] bg-[var(--navigation-internal-selected-background)] text-[var(--navigation-internal-selected-foreground)] hover:border-[var(--navigation-internal-selected-border)] hover:bg-[var(--navigation-internal-selected-background)] hover:text-[var(--navigation-internal-selected-foreground)]",jv="[--navigation-internal-theme-selected-background:color-mix(in_srgb,hsl(var(--monkeys-color-primary,var(--primary)))_10%,transparent)] [--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-primary,var(--primary)))] dark:[--navigation-internal-theme-selected-background:hsl(var(--monkeys-color-accent,var(--accent)))] dark:[--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-foreground,var(--foreground)))]";function Uv(e){let t={muted:"hsl(var(--monkeys-color-accent,var(--accent)))",soft:"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 10%,transparent)",solid:"hsl(var(--monkeys-color-primary,var(--primary)))",outline:"hsl(var(--monkeys-color-background,var(--background)))"}[e??"muted"];return {"--navigation-internal-default-selected-background":e===void 0?"var(--navigation-internal-theme-selected-background)":t,"--navigation-internal-default-selected-foreground":e===void 0?"var(--navigation-internal-theme-selected-foreground)":e==="solid"?"hsl(var(--monkeys-color-primary-foreground,var(--primary-foreground)))":"hsl(var(--monkeys-color-foreground,var(--foreground)))","--navigation-internal-selected-background":"var(--monkeys-component-navigation-sidebar-row-selected-background,var(--navigation-internal-default-selected-background))","--navigation-internal-selected-foreground":"var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--navigation-internal-default-selected-foreground))","--navigation-internal-selected-border":`var(--monkeys-component-navigation-sidebar-row-selected-border,${e===void 0||e==="muted"?"transparent":e==="soft"?"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 25%,transparent)":e==="outline"?"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 55%,transparent)":"hsl(var(--monkeys-color-primary,var(--primary)))"})`,"--navigation-internal-hover-background":"var(--monkeys-component-navigation-sidebar-row-hover-background,color-mix(in srgb,hsl(var(--monkeys-color-accent,var(--accent))) 65%,transparent))","--navigation-internal-hover-foreground":"var(--monkeys-component-navigation-sidebar-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground))))"}}a(Uv,"unifiedStyle");var _E="[--navigation-internal-selected-background:var(--monkeys-component-navigation-sidebar-row-selected-background,var(--monkeys-component-navigation-sidebar-tree-row-selected-background,var(--navigation-internal-default-selected-background)))] [--navigation-internal-selected-foreground:var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,var(--navigation-internal-default-selected-foreground)))] [--navigation-internal-hover-background:var(--monkeys-component-navigation-sidebar-row-hover-background,var(--monkeys-component-navigation-sidebar-tree-row-hover-background,color-mix(in_srgb,hsl(var(--monkeys-color-accent,var(--accent)))_65%,transparent)))] [--navigation-internal-hover-foreground:var(--monkeys-component-navigation-sidebar-row-hover-foreground,var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground)))))]",GE="aria-selected:border-[var(--navigation-internal-selected-border)] aria-selected:bg-[var(--navigation-internal-selected-background)] aria-selected:text-[var(--navigation-internal-selected-foreground)] aria-selected:hover:border-[var(--navigation-internal-selected-border)] aria-selected:hover:bg-[var(--navigation-internal-selected-background)] aria-selected:hover:text-[var(--navigation-internal-selected-foreground)]",Ks="rounded-[var(--monkeys-component-navigation-sidebar-action-radius,0.25rem)] text-inherit hover:bg-foreground/10 hover:text-inherit focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none";function Kv(e,t,o={}){let r=m(qs,e,t,yf);return {...o,root:m(_E,"space-y-0.5",o.root),group:m("space-y-0.5","[&>[role=treeitem]+[role=group]]:[--data-explorer-tree-group-indent:var(--monkeys-component-navigation-sidebar-tree-group-indent,1rem)]",o.group),groupHeaderButton:m("h-auto",r,o.groupHeaderButton),nodeButton:m(r,GE,o.nodeButton),itemSelected:m(xf,o.itemSelected),nodeIcon:m(Ys,"group-hover/tree-node:text-inherit",o.nodeIcon),nodeLabel:m("font-medium",o.nodeLabel),nodeDescription:m("text-inherit",o.nodeDescription),nodeDisabled:m("opacity-50",o.nodeDisabled),groupActions:m(Ks,"order-2 size-5 p-0 group-focus-within/tree-group:opacity-100",o.groupActions),nodeActions:m(Ks,"order-2 size-5 p-0 group-focus-within/tree-node:opacity-100",o.nodeActions),nodeToggle:m(Ks,"order-1 empty:hidden",o.nodeToggle),expander:m(Ks,"order-1 empty:hidden",o.expander),nodeDragHandle:m(Ks,o.nodeDragHandle)}}a(Kv,"unifiedTreeClassNames");function UE({collapsed:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"none",children:jsxRuntime.jsx("path",{d:e?"M4 4.5h12M4 15.5h12M5 7.5 7.5 10 5 12.5M15 7.5 12.5 10l2.5 2.5":"M4 4.5h12M4 15.5h12M7.5 7.5 5 10l2.5 2.5M12.5 7.5 15 10l-2.5 2.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}a(UE,"CollapseIcon");function KE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"5",stroke:"currentColor",strokeWidth:"1.6"}),jsxRuntime.jsx("path",{d:"m12.2 12.2 3.3 3.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}a(KE,"SearchIcon");function qE(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5",fill:"none",children:jsxRuntime.jsx("path",{d:"m6 6 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}a(qE,"ClearIcon");function YE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"5",cy:"10",r:"1.2"}),jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"1.2"}),jsxRuntime.jsx("circle",{cx:"15",cy:"10",r:"1.2"})]})}a(YE,"MoreIcon");function tu({expanded:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:m("h-4 w-4 transition-transform motion-reduce:transition-none",e&&"rotate-180"),fill:"none",children:jsxRuntime.jsx("path",{d:"m6 8 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}a(tu,"DisclosureIcon");function XE(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(XE,"assignRef");function _i(e,t){if(!Number.isFinite(t))throw new RangeError(`NavigationSidebar ${e} must be a finite number.`)}a(_i,"requireFiniteNumber");function QE(e){let t=e.minWidth??180,o=e.maxWidth??420,r=e.defaultWidth??256,n=e.collapsedWidth??60,i=e.collapseThreshold??140;if(_i("minWidth",t),_i("maxWidth",o),_i("defaultWidth",r),_i("collapsedWidth",n),_i("collapseThreshold",i),t<=0)throw new RangeError("NavigationSidebar minWidth must be greater than zero.");if(o<t)throw new RangeError("NavigationSidebar maxWidth must be greater than or equal to minWidth.");if(n<0)throw new RangeError("NavigationSidebar collapsedWidth cannot be negative.");if(i<0)throw new RangeError("NavigationSidebar collapseThreshold cannot be negative.");return {defaultWidth:r,minWidth:t,maxWidth:o,collapsedWidth:n,collapseThreshold:i}}a(QE,"resolveLayoutBounds");function ou(e,t){return Math.min(Math.max(e,t.minWidth),t.maxWidth)}a(ou,"clampWidth");function Zv(e,t){if(t){t(e);return}typeof console<"u"&&console.warn("NavigationSidebar could not persist layout state.",e);}a(Zv,"reportStorageError");function Jv(e){if(e)return e;if(!(typeof window>"u"))return window.localStorage}a(Jv,"resolveStorage");function ZE(e,t){let o={collapsed:e.defaultCollapsed??false,width:ou(t.defaultWidth,t)};if(!e.storageKey)return o;let r=Jv(e.storage);if(!r)return o;try{let n=r.getItem(e.storageKey);if(!n)return o;let i=JSON.parse(n);return {collapsed:typeof i.collapsed=="boolean"?i.collapsed:o.collapsed,width:typeof i.width=="number"&&Number.isFinite(i.width)?ou(i.width,t):o.width}}catch(n){return Zv(n,e.onStorageError),o}}a(ZE,"readStoredLayout");function wf(e,t){return t||(typeof e=="string"?e:void 0)}a(wf,"getNodeTitle");function JE(e){return e==="solid"?"border-primary bg-primary text-primary-foreground shadow-sm":e==="outline"?"border-primary/55 bg-background text-foreground ring-1 ring-primary/20":e==="muted"?"border-transparent bg-muted text-foreground":"border-primary/25 bg-primary/10 text-foreground"}a(JE,"activeVariantClassName");function eA(e){if(e?.preset!==void 0&&e.preset!=="unified")throw new TypeError(`Unknown NavigationSidebar preset "${e.preset}". Supported preset: unified.`);let t=e?.preset==="unified",o=e?.density??(t?"compact":"default"),r=e?.surface??"panel",n=e?.activeVariant??(t?"muted":"soft");return {unified:t,density:o,surface:r,activeVariant:n,selected:t?xf:JE(n),inactive:t?yf:"text-muted-foreground hover:border-border/70 hover:bg-muted/60 hover:text-foreground",root:m(r==="plain"&&"border-transparent bg-transparent shadow-none",r==="panel"&&"border-border/70 bg-card text-card-foreground shadow-sm",r==="frosted"&&"border-border/55 bg-card/80 text-card-foreground shadow-sm backdrop-blur-xl",r==="outlined"&&"border-border bg-background text-foreground shadow-none",t&&"rounded-[var(--radius)] shadow-none",t&&jv,t&&r==="panel"&&"border-[var(--monkeys-component-navigation-sidebar-border,hsl(var(--monkeys-color-border,var(--border))))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--monkeys-color-card,var(--card))))] text-foreground"),itemHeight:o==="compact"?t?"min-h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]":"min-h-9":o==="comfortable"?"min-h-14":"min-h-11",itemPadding:o==="compact"?t?"px-2 py-2":"px-2 py-1.5":o==="comfortable"?"px-3 py-3":"px-3 py-2",searchHeight:o==="compact"?t?"h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]":"h-8":o==="comfortable"?"h-10":"h-9"}}a(eA,"resolveAppearance");var Qv="hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-hover-background,hsl(var(--muted)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--foreground)))]",tA="bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",Xs="hover:!bg-transparent hover:!text-inherit focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring";function oA(e){return {...e,groupHeader:m(Qv,e?.groupHeader),itemSelected:m(tA,e?.itemSelected),nodeButton:m(Qv,"aria-selected:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] aria-selected:hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",e?.nodeButton),expander:m(Xs,e?.expander),nodeToggle:m(Xs,e?.nodeToggle),groupActions:m(Xs,e?.groupActions),nodeActions:m(Xs,e?.nodeActions),nodeDragHandle:m(Xs,e?.nodeDragHandle)}}a(oA,"resolveNavigationTreeClassNames");function kf({item:e,active:t,collapsed:o,mobile:r,embedded:n=false,appearance:i,classNames:s,domClassName:l}){return m("group/navigation-item relative flex w-full min-w-0 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm outline-hidden transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i.itemHeight,i.itemPadding,i.unified&&qs,n?"min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit":t?i.selected:i.inactive,o&&!r&&"justify-center px-0",e.disabled&&"pointer-events-none opacity-50",s?.item,t&&s?.itemActive,r&&s?.mobileItem,l,e.className)}a(kf,"entryClassName");function Cf({item:e,collapsed:t,mobile:o,classNames:r,endIndicator:n,appearance:i}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(e.icon)?jsxRuntime.jsx("span",{className:m("flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",i.unified&&Ys,r?.itemIcon),"aria-hidden":"true",children:e.icon}):null,o||!t?jsxRuntime.jsxs("span",{className:m("flex min-w-0 flex-1 flex-col",r?.itemContent),children:[jsxRuntime.jsx("span",{className:m("min-w-0 truncate font-semibold",i.unified&&"font-medium",r?.itemLabel),children:e.label}),V(e.description)?jsxRuntime.jsx("span",{className:m("mt-0.5 truncate text-xs font-normal",i.unified&&"text-inherit",r?.itemDescription),children:e.description}):null]}):null,(o||!t)&&V(e.meta)?jsxRuntime.jsx("span",{className:m("shrink-0 text-xs text-muted-foreground",r?.itemMeta),children:e.meta}):null,(o||!t)&&V(e.endContent)?jsxRuntime.jsx("span",{className:m("shrink-0",r?.itemEndContent),children:e.endContent}):null,(o||!t)&&V(n)?jsxRuntime.jsx("span",{className:"flex shrink-0 items-center justify-center",children:n}):null]})}a(Cf,"EntryContent");function ru({item:e,active:t,collapsed:o,itemAs:r,appearance:n,classNames:i,mobile:s=false,embedded:l=false,onSelect:d,ariaControls:c,ariaExpanded:p,endIndicator:u}){let g=r??(e.href?"a":"button"),f=wf(e.label,e.title),b=e.domProps??{},x=a(k=>{if(e.disabled){k.preventDefault();return}e.onClick?.(k),d?.();},"handleClick"),y={...b,...e.to?{to:e.to}:{},...e.href?{href:e.href}:{},...g==="button"?{type:"button",disabled:e.disabled}:{},title:f,"aria-current":t?"page":void 0,"aria-disabled":e.disabled||void 0,"aria-controls":c,"aria-expanded":p,tabIndex:e.disabled?-1:b.tabIndex,onClick:x};return jsxRuntime.jsx(g,{...y,"data-navigation-sidebar-item-id":e.id,"data-active":t?"true":"false","data-expanded":p===void 0?void 0:String(p),className:kf({item:e,active:t,collapsed:o,mobile:s,embedded:l,appearance:n,classNames:i,domClassName:b.className}),children:jsxRuntime.jsx(Cf,{appearance:n,item:e,collapsed:o,mobile:s,classNames:i,endIndicator:u})})}a(ru,"EntryButton");function rA({item:e,appearance:t,classNames:o}){let r=e.domProps??{};return jsxRuntime.jsx("div",{...r,"data-navigation-sidebar-item-id":e.id,"aria-disabled":e.disabled||void 0,title:wf(e.label,e.title),className:kf({item:e,active:false,collapsed:false,mobile:true,embedded:true,appearance:t,classNames:o,domClassName:r.className}),children:jsxRuntime.jsx(Cf,{appearance:t,item:e,collapsed:false,mobile:true,classNames:o})})}a(rA,"EntryPresentation");function nu({active:e,appearance:t}){return m("flex w-full min-w-0 items-center gap-0.5 rounded-[var(--radius)] border border-transparent pr-1 text-sm transition-[background-color,border-color,color,box-shadow] motion-reduce:transition-none",t.itemHeight,t.unified&&qs,e?t.selected:t.inactive)}a(nu,"routeRowClassName");function au(e,t){return t?e.filter(o=>!o.filterIds?.length||o.filterIds.includes(t)):e}a(au,"filterCatalogItems");function nA({props:e,collapsed:t,appearance:o}){let{items:r=[],sections:n=[],filters:i=[],activeFilterId:s,activeItemId:l,onFilterSelect:d,itemAs:c,layout:p="single",empty:u,ariaLabel:g,classNames:f}=e,b=au(r,s),x=n.map(v=>({...v,items:au(v.items,s)})).filter(v=>v.items.length>0),y=b.length>0||x.length>0,k=i.length>0&&!t?jsxRuntime.jsx("div",{role:"group",className:m(p==="split"?"flex min-w-32 flex-col gap-1 border-r border-border/60 pr-2":"flex flex-wrap gap-1",f?.filterList),"aria-label":g?`${g} filters`:void 0,children:i.map(v=>{let h=v.id===s;return jsxRuntime.jsxs("button",{type:"button",title:v.title??(typeof v.label=="string"?v.label:void 0),"aria-pressed":h,disabled:v.disabled,className:m("inline-flex min-h-8 items-center gap-2 rounded-md px-2.5 text-xs font-medium text-muted-foreground outline-hidden transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",h&&"bg-muted text-foreground",f?.filterItem,h&&f?.filterItemActive),onClick:()=>d?.(v),children:[V(v.icon)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:v.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:v.label})]},v.id)})}):null,w=y?jsxRuntime.jsxs("div",{className:m("min-w-0 flex-1",f?.list),children:[b.length>0?jsxRuntime.jsx("ul",{className:"grid list-none gap-1 p-0",children:b.map(v=>jsxRuntime.jsx("li",{children:jsxRuntime.jsx(ru,{item:v,active:v.active??v.id===l,collapsed:t,itemAs:c,appearance:o,classNames:f})},v.id))}):null,x.map(v=>jsxRuntime.jsxs("section",{className:m("mt-3 first:mt-0",f?.section,v.className),children:[!t&&V(v.label)?jsxRuntime.jsx("div",{className:m("mb-1 px-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",f?.sectionLabel,v.labelClassName),children:v.label}):null,jsxRuntime.jsx("ul",{className:"grid list-none gap-1 p-0",children:v.items.map(h=>jsxRuntime.jsx("li",{children:jsxRuntime.jsx(ru,{item:h,active:h.active??h.id===l,collapsed:t,itemAs:c,appearance:o,classNames:f})},h.id))})]},v.id))]}):jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:u});return jsxRuntime.jsxs("nav",{"aria-label":g,className:m(p==="split"&&!t&&"flex min-w-0 gap-2"),children:[k,w]})}a(nA,"CatalogContent");function aA({child:e,parent:t,active:o,interactive:r,onSelect:n,appearance:i,classNames:s,embedded:l=false}){let d=r?"button":"div",c=e.domProps??{};return jsxRuntime.jsxs(d,{...c,...r?{type:"button"}:{},"data-navigation-sidebar-child-id":e.id,"aria-current":r&&o?"page":void 0,"aria-disabled":e.disabled||void 0,title:wf(e.label,e.title),disabled:r?e.disabled:void 0,className:m("flex w-full min-w-0 flex-1 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm font-semibold outline-hidden transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i.itemHeight,i.itemPadding,i.unified&&qs,l?"min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit":o?i.selected:i.inactive,e.disabled&&"pointer-events-none opacity-50",s?.childItem,o&&s?.childItemActive,c.className,e.className),onClick:r&&!e.disabled?()=>n?.(e,t):void 0,children:[V(e.icon)?jsxRuntime.jsx("span",{className:m("flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",i.unified&&Ys),"aria-hidden":"true",children:e.icon}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e.label})]})}a(aA,"ChildEntry");function iu({itemId:e,actions:t,kind:o,className:r,mobile:n=false}){return V(t)?jsxRuntime.jsx("div",{"data-navigation-sidebar-item-actions":o==="item"?e:void 0,"data-navigation-sidebar-child-actions":o==="child"?e:void 0,"data-navigation-sidebar-actions-mobile":n?"true":void 0,className:m("ml-auto flex shrink-0 items-center gap-1 [&>button]:border-0 [&>button]:bg-transparent [&>button]:shadow-none [&>button:hover]:bg-muted",r),children:t}):null}a(iu,"RouteActions");function Sf(e){return e.interaction==="disclosure"}a(Sf,"isDisclosureRouteItem");function iA(e){let t=new Set,o=new Set,r=new Set;for(let n of e){let i=n.id;if(t.has(i))throw new RangeError(`NavigationSidebar route item ids must be unique; received "${i}" more than once.`);if(t.add(i),Sf(n)){if(!n.children.length)throw new RangeError(`NavigationSidebar disclosure item "${n.id}" must include at least one child.`);if(n.href!==void 0||n.to!==void 0||n.onClick!==void 0)throw new TypeError(`NavigationSidebar disclosure item "${i}" cannot define href, to, or onClick.`);r.add(n.id);}else if(n.childrenPresentation==="collapsible"){if(!n.children?.length)throw new RangeError(`NavigationSidebar collapsible route item "${n.id}" must include at least one child.`);r.add(n.id);}for(let l of n.children??[]){if(o.has(l.id))throw new RangeError(`NavigationSidebar route child ids must be unique; received "${l.id}" more than once.`);o.add(l.id);}}return r}a(iA,"validateRouteItems");function sA({item:e,expanded:t,controls:o,label:r,onToggle:n,classNames:i}){let s=typeof e.label=="string"?e.label:e.id;return jsxRuntime.jsx("button",{type:"button",disabled:e.disabled,"aria-expanded":t,"aria-controls":o,"aria-label":`${r}: ${s}`,title:r,"data-navigation-sidebar-disclosure-trigger":e.id,className:m("inline-flex h-8 w-7 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground shadow-none outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",i?.childMenuTrigger),onClick:n,children:jsxRuntime.jsx(tu,{expanded:t})})}a(sA,"RouteChildrenToggle");function su({item:e,activeChildId:t,label:o,onChildSelect:r,classNames:n,appearance:i,triggerVariant:s="submenu",mobile:l=false}){let d=(e.children??[]).filter(g=>!g.disabled);if(!e.children?.length||s==="submenu"&&(!r||d.length===0))return null;let c=typeof e.label=="string"?e.label:e.id,p=!!e.disabled||!r||d.length===0,u=e.domProps??{};return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:s==="item"&&i?jsxRuntime.jsx("button",{...u,type:"button",disabled:p,"aria-label":`${o}: ${c}`,title:o,"data-navigation-sidebar-item-id":e.id,"data-navigation-sidebar-disclosure-menu":"true",className:kf({item:e,active:false,collapsed:!l,mobile:l,appearance:i,classNames:n,domClassName:u.className}),children:jsxRuntime.jsx(Cf,{appearance:i,item:e,collapsed:!l,mobile:l,classNames:n,endIndicator:l?jsxRuntime.jsx(tu,{expanded:false}):void 0})}):jsxRuntime.jsx("button",{type:"button",disabled:s==="disclosure"?p:void 0,"data-navigation-sidebar-disclosure-trigger":s==="disclosure"?e.id:void 0,className:m("inline-flex h-8 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground shadow-none outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",s==="disclosure"?"w-7":"w-6",n?.childMenuTrigger),"aria-label":`${o}: ${c}`,title:o,children:s==="disclosure"?jsxRuntime.jsx(tu,{expanded:false}):jsxRuntime.jsx(YE,{})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{side:"right",align:"start",sideOffset:8,className:m("z-50 min-w-40 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-hidden",n?.childMenuContent),children:e.children?.map(g=>jsxRuntime.jsxs(Bt__namespace.Item,{disabled:g.disabled,"data-navigation-sidebar-child-id":g.id,"data-active":g.id===t?"true":"false",className:m("flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",g.id===t&&"bg-accent text-accent-foreground"),onSelect:()=>r?.(g,e),children:[V(g.icon)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:g.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:g.label})]},g.id))})})]})}a(su,"CollapsedChildMenu");function lA({props:e,collapsed:t,appearance:o}){let{routeItems:r,activeItemId:n,activeChildId:i,expandedItemIds:s,defaultExpandedItemIds:l=[],itemAs:d,onItemSelect:c,onChildSelect:p,onExpandedItemIdsChange:u,collapsedChildMenuLabel:g="Open submenu",disclosureLabel:f="Toggle submenu",ariaLabel:b,classNames:x}=e,y=ho.useId(),k=ho.useMemo(()=>iA(r),[r]),[w,v]=ho.useState(()=>l),h=s!==void 0,S=s??w,T=ho.useMemo(()=>S.filter(M=>k.has(M)),[k,S]),C=ho.useMemo(()=>new Set(T),[T]),R=ho.useCallback(M=>{if(M.disabled||!k.has(M.id))return;let I=C.has(M.id)?T.filter(B=>B!==M.id):[...T,M.id];h||v(I),u?.(I);},[k,C,h,T,u]);return jsxRuntime.jsx("nav",{"aria-label":b,children:jsxRuntime.jsx("ul",{className:m("grid list-none gap-2 p-0",o.unified&&"gap-0.5",x?.list),children:r.map((M,I)=>{let B=Sf(M),N=!B&&M.id===n,D=!!M.children?.length,E=k.has(M.id),P=!E||C.has(M.id),W=!t&&V(M.actions),H=t&&D&&!!p||!t&&E&&!B||W,A=`${y}-route-children-${I}`;return jsxRuntime.jsxs("li",{className:"grid min-w-0 gap-1",children:[t&&B?jsxRuntime.jsx(su,{item:M,activeChildId:i,label:g,onChildSelect:p,classNames:x,appearance:o,triggerVariant:"item"}):jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":H?M.id:void 0,"data-active":H?String(N):void 0,className:H?nu({active:N,appearance:o}):void 0,children:[jsxRuntime.jsx(ru,{item:M,active:N,collapsed:t,embedded:H,itemAs:B?"button":d,appearance:o,classNames:x,onSelect:B?()=>R(M):c?()=>c(M):void 0,ariaControls:!t&&E&&B?A:void 0,ariaExpanded:!t&&E&&B?P:void 0,endIndicator:!t&&B&&!W?jsxRuntime.jsx(tu,{expanded:P}):void 0}),W?jsxRuntime.jsx(iu,{itemId:M.id,actions:M.actions,kind:"item",className:x?.itemActions}):null,t&&p?jsxRuntime.jsx(su,{item:M,activeChildId:i,label:g,onChildSelect:p,classNames:x}):null,!t&&E&&(!B||W)?jsxRuntime.jsx(sA,{item:M,expanded:P,controls:A,label:f,onToggle:()=>R(M),classNames:x}):null]}),!t&&D?jsxRuntime.jsx("ul",{id:A,hidden:!P,style:P?void 0:{display:"none"},className:m("ml-5 grid list-none gap-0.5 border-l border-border/70 py-1 pl-3",o.unified&&"border-border",x?.childList),children:M.children?.map(L=>{let F=V(L.actions),G=L.id===i,$=jsxRuntime.jsx(aA,{child:L,parent:M,active:G,interactive:!!p,onSelect:p,appearance:o,classNames:x,embedded:F});return jsxRuntime.jsx("li",{children:F?jsxRuntime.jsxs("div",{"data-navigation-sidebar-child-row":L.id,"data-active":String(G),className:nu({active:G,appearance:o}),children:[$,jsxRuntime.jsx(iu,{itemId:L.id,actions:L.actions,kind:"child",className:x?.childActions})]}):$},L.id)})}):null]},M.id)})})})}a(lA,"RouteContent");function dA(e,t,o){return [...au(e,o),...t.flatMap(r=>au(r.items,o))]}a(dA,"flattenCatalogItems");function cA({props:e,appearance:t}){if(!e.mobile||e.mobile.mode!=="horizontal")return null;let o=e.classNames,r=e.kind==="catalog"?dA(e.items??[],e.sections??[],e.activeFilterId):e.routeItems;return jsxRuntime.jsx("nav",{"aria-label":e.ariaLabel,className:m("flex gap-2 overflow-x-auto pb-1",o?.mobileNav,e.mobile.className),children:r.map(n=>{let i={...o,mobileItem:m(o?.mobileItem,e.mobile?.itemClassName)},s=e.kind==="route"?n:void 0,l=s!==void 0&&V(s.actions);if(e.kind==="route"&&Sf(n))return l?jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":n.id,"data-active":"false",className:m(nu({active:false,appearance:t}),"shrink-0"),children:[jsxRuntime.jsx(rA,{item:n,appearance:t,classNames:i}),jsxRuntime.jsx(iu,{itemId:n.id,actions:n.actions,kind:"item",className:o?.itemActions,mobile:true}),jsxRuntime.jsx(su,{item:n,activeChildId:e.activeChildId,label:e.collapsedChildMenuLabel??"Open submenu",onChildSelect:e.onChildSelect,classNames:i,appearance:t,triggerVariant:"disclosure",mobile:true})]},n.id):jsxRuntime.jsx(ho.Fragment,{children:jsxRuntime.jsx(su,{item:n,activeChildId:e.activeChildId,label:e.collapsedChildMenuLabel??"Open submenu",onChildSelect:e.onChildSelect,classNames:i,appearance:t,triggerVariant:"item",mobile:true})},n.id);let d=e.kind==="catalog"?n.active??n.id===e.activeItemId:n.id===e.activeItemId,c=jsxRuntime.jsx(ru,{item:n,active:d,collapsed:false,embedded:l,itemAs:e.itemAs,appearance:t,classNames:i,mobile:true,onSelect:e.kind==="route"&&e.onItemSelect?()=>e.onItemSelect?.(n):void 0});return l&&s?jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":n.id,"data-active":String(d),className:m(nu({active:d,appearance:t}),"shrink-0"),children:[c,jsxRuntime.jsx(iu,{itemId:s.id,actions:s.actions,kind:"item",className:o?.itemActions,mobile:true})]},n.id):jsxRuntime.jsx(ho.Fragment,{children:c},n.id)})})}a(cA,"MobileNavigation");function uA(e,t){let o=QE(e);e.width!==void 0&&_i("width",e.width);let r=ho.useRef(null);r.current||(r.current=ZE(e,o));let n=ho.useRef(null),[i,s]=ho.useState(r.current.collapsed),[l,d]=ho.useState(r.current.width),[c,p]=ho.useState(e.search?.defaultValue??""),[u,g]=ho.useState(false),f=e.collapsed??i,b=ou(e.width??l,o),x=e.search?.value??c,y=e.collapsed!==void 0,k=e.width!==void 0,w=ho.useMemo(()=>eA(e.appearance),[e.appearance]),v=e.collapsible??true,h=e.resizable??true,S=v?e.collapsePlacement??"header":"none",T=e.collapseLabel??"Collapse sidebar",C=e.expandLabel??"Expand sidebar",R=e.resizeLabel??"Resize sidebar",M=!f||o.collapsedWidth>0,I=a(H=>{n.current=H,XE(t,H);},"setSidebarRef"),B=ho.useCallback(H=>{!v&&H||(y||s(H),e.onCollapsedChange?.(H));},[v,y,e.onCollapsedChange]),N=ho.useCallback(H=>{let A=ou(H,o);k||d(A),e.onWidthChange?.(A);},[o.maxWidth,o.minWidth,k,e.onWidthChange]);ho.useEffect(()=>{if(!e.storageKey)return;let H=Jv(e.storage);if(H)try{H.setItem(e.storageKey,JSON.stringify({collapsed:f,width:b}));}catch(A){Zv(A,e.onStorageError);}},[e.onStorageError,e.storage,e.storageKey,f,b]),ho.useEffect(()=>{if(!u)return;let H=document.body.style.cursor,A=document.body.style.userSelect,L=a(G=>{let $=n.current;if(!$)return;let _=G.clientX-$.getBoundingClientRect().left;if(v&&_<o.collapseThreshold){B(true);return}B(false),N(_);},"handlePointerMove"),F=a(()=>g(false),"handlePointerUp");return window.addEventListener("pointermove",L),window.addEventListener("pointerup",F),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",F),document.body.style.cursor=H,document.body.style.userSelect=A;}},[o.collapseThreshold,v,u,B,N]);let D=a(H=>{if(!(H.key!=="ArrowLeft"&&H.key!=="ArrowRight")){if(H.preventDefault(),H.key==="ArrowLeft"){let A=b-24;v&&A<o.collapseThreshold?B(true):N(A);return}f&&B(false),N(Math.max(b+24,o.minWidth));}},"handleResizeKeyDown"),E=a(H=>jsxRuntime.jsx("button",{type:"button",className:m("inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-hidden transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",e.classNames?.collapseButton,H),"aria-label":f?C:T,title:f?C:T,"aria-expanded":!f,onClick:()=>B(!f),children:jsxRuntime.jsx(UE,{collapsed:f})}),"collapseButton"),P=V(e.title)||V(e.headerLeading)||V(e.headerActions)||S==="header",W=a(()=>{if(e.kind==="catalog")return jsxRuntime.jsx(nA,{props:e,collapsed:f,appearance:w});if(e.kind==="route")return jsxRuntime.jsx(lA,{props:e,collapsed:f,appearance:w});let H=e.tree;return jsxRuntime.jsx(Jc,{...H,classNames:w.unified?Kv(w.itemHeight,w.itemPadding,H.classNames):oA(H.classNames)})},"renderContent");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("aside",{...e.rootDomProps,ref:I,"aria-label":e.ariaLabel,"data-monkeys-component":e.dataComponent??"navigation-sidebar","data-navigation-sidebar-kind":e.kind,"data-navigation-sidebar-preset":e.appearance?.preset,"data-collapsed":f?"true":"false",className:m("relative flex h-full min-h-0 shrink-0 flex-col overflow-visible rounded-[calc(var(--radius)+0.25rem)] border transition-[width,opacity] duration-300 motion-reduce:transition-none",w.root,e.desktopClassName,e.classNames?.root,e.rootDomProps?.className,e.className),style:{...w.unified?Uv(e.appearance?.activeVariant):{},...e.style,width:e.widthMode==="fill"?void 0:f?o.collapsedWidth:b,transition:u?"none":e.style?.transition},children:[h?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-valuemin":o.minWidth,"aria-valuemax":o.maxWidth,"aria-valuenow":b,"aria-label":R,title:R,className:m("group/resize absolute -right-1.5 bottom-0 top-0 z-40 w-3 cursor-col-resize bg-transparent outline-hidden focus-visible:ring-2 focus-visible:ring-ring",e.classNames?.resizeHandle),onPointerDown:H=>{H.preventDefault(),g(true);},onKeyDown:D,children:jsxRuntime.jsx("span",{className:"pointer-events-none absolute bottom-3 right-1/2 top-3 w-px translate-x-1/2 rounded-full bg-border opacity-0 transition-opacity group-hover/resize:opacity-100 group-focus-visible/resize:opacity-100"})}):null,S==="edge"?E("absolute -right-3 top-1/2 z-50 -translate-y-1/2 border border-border bg-background shadow-sm"):null,M?jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:[P?jsxRuntime.jsxs("div",{className:m("flex min-h-12 min-w-0 items-center gap-2 border-b border-border/60 px-3",w.unified&&"min-h-14 border-border px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))]",f&&"justify-center px-1",e.classNames?.header),children:[V(e.headerLeading)?jsxRuntime.jsx("span",{className:m("flex shrink-0 items-center justify-center",e.classNames?.headerLeading),children:e.headerLeading}):null,!f&&V(e.title)?jsxRuntime.jsx("div",{className:m("min-w-0 flex-1 truncate text-sm font-semibold",e.classNames?.title),children:e.title}):null,!f&&V(e.headerActions)?jsxRuntime.jsx("div",{className:m("flex shrink-0 items-center gap-1",e.classNames?.headerActions),children:e.headerActions}):null,S==="header"?E():null]}):null,!f&&e.search?jsxRuntime.jsx("div",{className:m("px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] pb-2 pt-3",w.unified&&"pb-1",e.classNames?.search),children:jsxRuntime.jsxs("div",{className:m("flex items-center gap-2 rounded-md border border-input bg-[var(--monkeys-component-navigation-sidebar-search-background,hsl(var(--monkeys-color-control-surface)))] px-3 text-muted-foreground ring-offset-control-surface focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",w.searchHeight,w.unified&&"rounded-[var(--radius)] border-border bg-[var(--monkeys-component-navigation-sidebar-search-background,transparent)] px-2"),children:[jsxRuntime.jsx("span",{className:m("flex shrink-0",w.unified&&Ys,e.classNames?.searchIcon),"aria-hidden":"true",children:e.search.icon??jsxRuntime.jsx(KE,{})}),jsxRuntime.jsx("input",{type:"search",value:x,placeholder:e.search.placeholder,"aria-label":e.search.ariaLabel,className:m("min-w-0 flex-1 bg-transparent text-sm text-foreground outline-hidden placeholder:text-muted-foreground",e.classNames?.searchInput),onChange:H=>{let A=H.currentTarget.value;e.search?.value===void 0&&p(A),e.search?.onValueChange?.(A);}}),x&&e.search.clearLabel?jsxRuntime.jsx("button",{type:"button",className:m("inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",e.classNames?.searchClear),"aria-label":e.search.clearLabel,title:e.search.clearLabel,onClick:()=>{e.search?.value===void 0&&p(""),e.search?.onValueChange?.("");},children:jsxRuntime.jsx(qE,{})}):null]})}):null,jsxRuntime.jsx("div",{className:m("min-h-0 flex-1 overflow-y-auto px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] py-3",w.unified&&e.search&&"pt-1",f&&"px-1.5",e.classNames?.content),children:W()}),V(e.footer)||S==="footer"?jsxRuntime.jsxs("div",{className:m("flex shrink-0 items-center gap-2 border-t border-border/70 p-3",w.unified&&"border-border",f&&"justify-center px-1",e.classNames?.footer),children:[!f&&V(e.footer)?jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:e.footer}):null,S==="footer"?E():null]}):null]}):null]}),e.kind!=="tree"?jsxRuntime.jsx(cA,{props:e,appearance:w}):null]})}a(uA,"NavigationSidebarInner");var Gi=ho.forwardRef(uA);var tw=ho.forwardRef(a(function({title:t,items:o,sections:r=[],activeItemId:n,onItemSelect:i,itemAs:s,collapsed:l,defaultCollapsed:d=false,onCollapsedChange:c,width:p,onWidthChange:u,defaultWidth:g=220,minWidth:f=180,maxWidth:b=420,collapsedWidth:x=60,collapseThreshold:y=140,storageKey:k,resizable:w=true,collapsible:v=true,collapseLabel:h="Collapse sidebar",expandLabel:S="Expand sidebar",resizeLabel:T="Resize sidebar",desktopClassName:C="hidden md:flex",mobileClassName:R="flex md:hidden",className:M,classNames:I,style:B,...N},D){let{level:E,variables:P}=Uh(),W=a(H=>({...H,icon:H.icon??(H.iconName?jsxRuntime.jsx(bf,{icon:{kind:"lucide",name:H.iconName},alt:"",className:"h-4 w-4 rounded-none bg-transparent"}):void 0),endContent:H.endContent??(H.count!==void 0?jsxRuntime.jsx(bc,{children:H.count}):void 0),onClick:a(A=>{H.disabled||(H.onClick?.(A),A.defaultPrevented||i?.({itemId:H.id}));},"onClick")}),"project");return jsxRuntime.jsx(um,{depth:E,children:jsxRuntime.jsx(Gi,{ref:D,kind:"catalog",title:t,items:o.map(W),sections:r.map(H=>({...H,items:H.items.map(W)})),activeItemId:n,itemAs:s,collapsed:l,defaultCollapsed:d,onCollapsedChange:c,width:p,onWidthChange:u,defaultWidth:g,minWidth:f,maxWidth:b,collapsedWidth:x,collapseThreshold:y,storageKey:k,resizable:w,collapsible:v,collapsePlacement:"header",collapseLabel:h,expandLabel:S,resizeLabel:T,desktopClassName:C,dataComponent:"workbench-resizable-sidebar",rootDomProps:{...N,"data-workbench-resizable-sidebar":"","data-monkeys-bento-level":E},appearance:{density:"compact",surface:"panel",activeVariant:"soft"},mobile:{mode:"horizontal",className:R},className:m(jh,"[&>div]:gap-[var(--monkeys-bento-gap)] [--monkeys-sidebar-item-padding:var(--monkeys-bento-gap)] data-[collapsed=true]:[--monkeys-sidebar-item-padding:0px]",I?.root,M),classNames:{root:I?.root,header:m("min-h-0 gap-[var(--monkeys-bento-gap)] border-0 p-0",I?.header),title:m("text-xs font-medium uppercase text-muted-foreground",I?.title),collapseButton:m("h-8 w-8",I?.collapseButton),content:m("space-y-[var(--monkeys-bento-gap)] p-0",I?.list),list:"[&_ul]:gap-[var(--monkeys-bento-gap)]",section:m("mt-[var(--monkeys-bento-gap)]",I?.section),sectionLabel:m("mb-[var(--monkeys-bento-gap)] px-[var(--monkeys-bento-gap)]",I?.sectionLabel),item:m("h-auto min-h-9 gap-[var(--monkeys-bento-gap)] rounded-md px-[var(--monkeys-sidebar-item-padding)] py-[calc(var(--monkeys-bento-gap)/2)] text-sm shadow-none",I?.item),itemIcon:m("[&_svg]:h-3.5 [&_svg]:w-3.5",I?.itemIcon),itemLabel:I?.itemLabel,resizeHandle:I?.resizeHandle,mobileNav:m("gap-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] pb-0",I?.mobileNav),mobileItem:m("h-auto min-h-9 w-auto shrink-0 gap-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] px-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] py-[calc(var(--monkeys-bento-gap,var(--global-spacing,0.75rem))/2)] text-sm",I?.mobileItem)},style:{...P,...B}})})},"WorkbenchResizableSidebar"));function fA(e){return !!(e.header||e.footer||e.bodyAs||e.bodyClassName||e.bodyProps||e.classNames?.body)}a(fA,"shouldRenderBodyWrapper");var ow=ho.forwardRef(a(function({as:t="section",bodyAs:o="div",header:r,footer:n,children:i,className:s,headerClassName:l,bodyClassName:d,footerClassName:c,bodyProps:p,classNames:u,style:g,...f},b){let x=fA({header:r,footer:n,bodyAs:o==="div"?void 0:o,bodyClassName:d,bodyProps:p,classNames:u}),{className:y,...k}=p??{};return jsxRuntime.jsxs(t,{ref:b,"data-workbench-content-pane":true,className:m("workbench-surface-subtle flex h-full min-w-0 flex-1 flex-col overflow-hidden rounded-lg border border-border/50 transition-all duration-300 dark:border-border/40",u?.root,s),style:g,...f,children:[r?jsxRuntime.jsx("div",{className:m("shrink-0 border-b border-border/40 px-4 py-3 dark:border-border/30",u?.header,l),children:r}):null,x?jsxRuntime.jsx(o,{className:m("min-h-0 flex-1 overflow-hidden",u?.body,d,y),...k,children:i}):i,n?jsxRuntime.jsx("div",{className:m("shrink-0 border-t border-border/40 px-4 py-3 dark:border-border/30",u?.footer,c),children:n}):null]})},"WorkbenchContentPane"));var aw={settingsButton:"Gallery settings",title:"Gallery settings",visibleColumns:"Visible fields",coverField:"Cover field",autoDetect:"Auto",cardDensity:"Card density",cardColumns:"Cards per row",detailColumns:"Detail columns",fieldVisibility:"Field visibility",fieldLimit:"Field limit",fieldLimitHint:"Uses current field order",layout:"Gallery layout",compact:"Compact",comfortable:"Standard",detailed:"Detailed",autoColumns:"Auto",columns:a(e=>`${e}`,"columns"),bentoColumns:a(e=>`${e}`,"bentoColumns"),topLimit:"First fields",allFields:"All fields",adaptiveGrid:"Grid",masonry:"Masonry"};function sa(e){return String(e?.key||"")}a(sa,"normalizeColumnKey");function yA(e){return e.label??e.key}a(yA,"getDefaultColumnLabel");function xA(e){return e.filter(t=>sa(t)&&t.hidden!==true).map(t=>sa(t))}a(xA,"getDefaultVisibleColumnKeys");function vA({columns:e,visibleColumnKeys:t,allowEmptyVisibleColumns:o}){let r=new Set(e.map(sa).filter(Boolean)),n=Array.isArray(t)?t.filter(i=>r.has(String(i))):null;return n&&(n.length||o)?n:xA(e)}a(vA,"getResolvedVisibleColumnKeys");function wA(e){return [{value:"compact",label:e.compact},{value:"comfortable",label:e.comfortable},{value:"detailed",label:e.detailed}]}a(wA,"getDefaultDensityOptions");function kA(e){return [{value:"auto",label:e.autoColumns},{value:1,label:e.columns(1)},{value:2,label:e.columns(2)},{value:3,label:e.columns(3)},{value:4,label:e.columns(4)}]}a(kA,"getDefaultGridColumnOptions");function CA(e){return [{value:1,label:e.bentoColumns(1)},{value:2,label:e.bentoColumns(2)},{value:3,label:e.bentoColumns(3)}]}a(CA,"getDefaultBentoColumnOptions");function SA(e){return [{value:"limit",label:e.topLimit},{value:"all",label:e.allFields}]}a(SA,"getDefaultDetailVisibilityOptions");function TA(e){return [{value:"fixed",label:e.adaptiveGrid},{value:"masonry",label:e.masonry}]}a(TA,"getDefaultLayoutOptions");function Zs(e){return String(e)}a(Zs,"normalizeOptionValue");function Js(e,t,o){let r=String(t??o);return e.some(n=>String(n.value)===r)?r:String(o)}a(Js,"getOptionValue");function nw(e){let t=Number.parseInt(e,10);return Number.isFinite(t)?t:1}a(nw,"parseNumberOption");var el={root:"flex w-full flex-wrap",item:"min-w-[58px] flex-1 px-2 text-[11px]",label:"text-[11px]"};function Nf({columns:e=[],galleryFieldOptions:t,value:o,onValueChange:r,labels:n,densityOptions:i,gridColumnOptions:s,bentoColumnOptions:l,detailVisibilityOptions:d,layoutOptions:c,getColumnLabel:p=yA,getColumnDescription:u,showColumnVisibility:g=true,showGalleryControls:f=true,showLayoutControl:b=true,showGridColumns:x=true,showDetailColumns:y=true,allowEmptyVisibleColumns:k=false,className:w,classNames:v}){let h={...aw,...n},S=o||{},T=e.filter(F=>sa(F)),C=vA({columns:T,visibleColumnKeys:S.visibleColumnKeys,allowEmptyVisibleColumns:k}),R=new Set(C),M=(t||T).filter(F=>sa(F)),I=i||wA(h),B=s||kA(h),N=l||CA(h),D=d||SA(h),E=c||TA(h),P=typeof r=="function",W=a(F=>{r?.({...S,...F},F);},"updateValue"),H=a(F=>{if(!P)return;let G=new Set(C);G.has(F)?G.delete(F):G.add(F);let $=T.map(sa).filter(_=>G.has(_));!$.length&&!k&&($=[F]),W({visibleColumnKeys:$});},"toggleColumn"),A=g&&T.length>0,L=f;return jsxRuntime.jsxs("div",{className:m("space-y-3 text-foreground",v?.root,w),children:[A?jsxRuntime.jsxs("section",{className:m("space-y-2",v?.section),children:[jsxRuntime.jsx("div",{className:m("text-[10px] font-medium uppercase tracking-wide text-muted-foreground",v?.sectionHeader),children:h.visibleColumns}),jsxRuntime.jsx("div",{className:m("max-h-[220px] space-y-1 overflow-y-auto pr-1",v?.columnList),children:T.map(F=>{let G=sa(F);return jsxRuntime.jsx(vi,{checked:R.has(G),disabled:!P,label:p(F),description:u?.(F),onChange:()=>H(G),className:m("flex w-full rounded-lg px-2 py-1.5 hover:bg-muted/50",v?.columnItem)},`workbench-gallery-column-${G}`)})})]}):null,L?jsxRuntime.jsxs("section",{className:m("space-y-3 border-t border-border/60 pt-3",v?.section),children:[jsxRuntime.jsx(Gr,{label:h.coverField,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(Fc,{value:String(S.galleryFieldKey||"auto"),options:[{value:"auto",label:h.autoDetect},...M.map(F=>({value:sa(F),label:p(F)}))],disabled:!P,onChange:F=>W({galleryFieldKey:F.currentTarget.value||"auto"}),className:v?.control})}),jsxRuntime.jsx(Gr,{label:h.cardDensity,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(I,S.galleryDensity,"comfortable"),options:I.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryDensity:F}),className:m("w-full",v?.control),classNames:el})}),x?jsxRuntime.jsx(Gr,{label:h.cardColumns,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(B,S.galleryGridColumns,"auto"),options:B.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryGridColumns:F==="auto"?"auto":nw(F)}),className:m("w-full",v?.control),classNames:el})}):null,y?jsxRuntime.jsx(Gr,{label:h.detailColumns,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(N,S.galleryBentoColumns,2),options:N.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryBentoColumns:nw(F)}),className:m("w-full",v?.control),classNames:el})}):null,jsxRuntime.jsx(Gr,{label:h.fieldVisibility,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(D,S.galleryDetailVisibility,"limit"),options:D.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryDetailVisibility:F}),className:m("w-full",v?.control),classNames:el})}),S.galleryDetailVisibility!=="all"?jsxRuntime.jsx(Gr,{label:h.fieldLimit,description:h.fieldLimitHint,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground",description:"text-[10px]"},children:jsxRuntime.jsx(Rc,{type:"number",min:1,step:1,value:String(S.galleryDetailLimit||4),disabled:!P,onChange:F=>W({galleryDetailLimit:F.currentTarget.value}),className:v?.control})}):null,b?jsxRuntime.jsx(Gr,{label:h.layout,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(E,S.galleryLayout,"fixed"),options:E.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryLayout:F}),className:m("w-full",v?.control),classNames:el})}):null]}):null]})}a(Nf,"WorkbenchGallerySettingsPanel");function ol({open:e,defaultOpen:t=false,onOpenChange:o,triggerIcon:r,triggerLabel:n,triggerTitle:i,align:s="end",popoverWidth:l=320,panelHeader:d,panelBefore:c,panelAfter:p,panelClassName:u,buttonClassName:g,popoverClassName:f,buttonClassNames:b,labels:x,className:y,classNames:k,...w}){let v={...aw,...x},h=ho.useRef(null),[S,T]=ho.useState(t),[C,R]=ho.useState({}),M=e!==void 0,I=M?!!e:S,B=a(E=>{M||T(E),o?.(E);},"setOpen");ho.useLayoutEffect(()=>{if(!I)return;let E=a(()=>{let H=h.current?.getBoundingClientRect();if(!H||typeof window>"u")return;let A=12,L=Math.max(window.innerWidth-A*2,0),F=Math.min(l,L||l),G=s==="start"?H.left:H.right-F,$=Math.min(Math.max(G,A),Math.max(window.innerWidth-F-A,A)),_=Math.min(H.bottom+8,Math.max(window.innerHeight-80,A));R({left:$,top:_,width:F,maxHeight:`calc(100vh - ${Math.round(_+A)}px)`});},"updatePopoverPosition"),P=a(H=>{h.current?.contains(H.target)||B(false);},"handlePointerDown"),W=a(H=>{H.key==="Escape"&&B(false);},"handleKeyDown");return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),window.addEventListener("pointerdown",P),window.addEventListener("keydown",W),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true),window.removeEventListener("pointerdown",P),window.removeEventListener("keydown",W);}},[s,I,l]);let N=n??v.settingsButton,D=d??v.title;return jsxRuntime.jsxs("div",{ref:h,className:m("relative inline-flex",b?.root,y),children:[jsxRuntime.jsx(mt,{icon:r,label:N,title:i||(typeof N=="string"?N:void 0),iconOnly:!!r,active:I,tone:"muted","aria-haspopup":"dialog","aria-expanded":I,className:m(b?.trigger,g),onClick:()=>B(!I)}),I?jsxRuntime.jsxs("div",{role:"dialog","aria-label":typeof D=="string"?D:void 0,className:m("fixed z-50 overflow-y-auto rounded-xl border border-border bg-card p-3 text-foreground shadow-lg",s==="start"?"origin-top-left":"origin-top-right",b?.popover,f),style:C,children:[D?jsxRuntime.jsx("div",{className:m("mb-3 text-[11px] font-medium text-foreground",b?.header),children:D}):null,c,jsxRuntime.jsx(Nf,{...w,labels:v,className:m(b?.panel,u),classNames:k}),p]}):null]})}a(ol,"WorkbenchGallerySettingsButton");function dw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M3 10h18M9 4v16"})]})}a(dw,"TableViewIcon");function cw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]})}a(cw,"GalleryViewIcon");function iw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 7h-9M7 7H4M14 17H4M20 17h-3"}),jsxRuntime.jsx("circle",{cx:"9",cy:"7",r:"2"}),jsxRuntime.jsx("circle",{cx:"16",cy:"17",r:"2"})]})}a(iw,"SettingsIcon");function DA({open:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:m("h-3 w-3 opacity-55 transition-transform",e&&"rotate-180"),fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(DA,"ChevronDownIcon");var PA=[{value:"list",label:"Table view",icon:jsxRuntime.jsx(dw,{})},{value:"gallery",label:"Gallery view",icon:jsxRuntime.jsx(cw,{})}];function sw(e){return e.icon!==void 0?e.icon:e.value==="list"||e.value==="table"?jsxRuntime.jsx(dw,{}):e.value==="gallery"?jsxRuntime.jsx(cw,{}):null}a(sw,"getViewModeOptionIcon");function lw(e){return e.triggerLabel??e.labels?.settingsButton??"Settings"}a(lw,"getSettingsTriggerLabel");function EA({value:e,options:t,onValueChange:o,classNames:r}){let n=ho.useRef(null),[i,s]=ho.useState(false),l=t.find(c=>c.value===e)||t.find(c=>!c.disabled)||t[0],d=l?sw(l):null;return ho.useEffect(()=>{if(!i)return;let c=a(u=>{n.current?.contains(u.target)||s(false);},"handlePointerDown"),p=a(u=>{u.key==="Escape"&&s(false);},"handleKeyDown");return window.addEventListener("pointerdown",c),window.addEventListener("keydown",p),()=>{window.removeEventListener("pointerdown",c),window.removeEventListener("keydown",p);}},[i]),l?jsxRuntime.jsxs("div",{ref:n,className:m("relative inline-flex",r?.viewModeRoot),children:[jsxRuntime.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-expanded":i,className:m("inline-flex h-7 min-w-0 items-center justify-center gap-1.5 rounded-md border border-border/70 bg-card px-2 text-xs font-medium text-foreground shadow-none transition-colors hover:bg-muted/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/25",r?.viewModeTrigger),onClick:()=>s(c=>!c),children:[d?jsxRuntime.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-muted-foreground",children:d}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:l.label}),jsxRuntime.jsx(DA,{open:i})]}),i?jsxRuntime.jsx("div",{role:"listbox",className:m("absolute left-0 top-full z-50 mt-2 min-w-[160px] overflow-hidden rounded-xl border border-border/60 bg-card/95 p-1.5 text-xs text-foreground shadow-lg backdrop-blur-xl",r?.viewModeMenu),children:t.map(c=>{let p=c.value===l.value,u=sw(c);return jsxRuntime.jsxs("button",{type:"button",role:"option","aria-selected":p,disabled:c.disabled,className:m("flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/55 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",p&&"bg-muted/60 text-foreground",r?.viewModeItem),onClick:()=>{c.disabled||(o?.(c.value,c),s(false));},children:[u?jsxRuntime.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:u}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:c.label})]},c.value)})}):null]}):null}a(EA,"WorkbenchContentToolbarViewModeControl");var du=ho.forwardRef(a(function({as:t="div",children:o,end:r,viewMode:n,viewModeOptions:i,onViewModeChange:s,gallerySettings:l,gallerySettingsPlacement:d="start",className:c,startClassName:p,endClassName:u,classNames:g,...f},b){let x=i||(n?PA:[]),y=l&&typeof l=="object"?l:null,k=!!x.length,w=!!y,v=w&&d!=="end",h=w&&d==="end",S=k||v||!!o,T=!!r||h;return jsxRuntime.jsxs(t,{ref:b,"data-workbench-content-toolbar":true,className:m("flex min-h-[46px] shrink-0 flex-col gap-2 border-b border-border/60 px-4 py-2 md:flex-row md:items-center md:justify-between",g?.root,c),...f,children:[S?jsxRuntime.jsxs("div",{className:m("flex flex-wrap items-center gap-2",g?.start,p),children:[k?jsxRuntime.jsx(EA,{value:n,options:x,onValueChange:s,classNames:g}):null,v&&y?jsxRuntime.jsx(ol,{align:"end",triggerIcon:jsxRuntime.jsx(iw,{}),triggerLabel:lw(y),...y,buttonClassName:m("!h-7 !w-7 !min-h-0 !rounded-md !p-0 text-xs",g?.settings,y.buttonClassName)}):null,o]}):null,T?jsxRuntime.jsxs("div",{className:m("flex shrink-0 items-center gap-2",g?.end,u),children:[r,h&&y?jsxRuntime.jsx(ol,{align:"end",triggerIcon:jsxRuntime.jsx(iw,{}),triggerLabel:lw(y),...y,buttonClassName:m("!h-7 !w-7 !min-h-0 !rounded-md !p-0 text-xs",g?.settings,y.buttonClassName)}):null]}):null]})},"WorkbenchContentToolbar"));function LA(e){return !!(e.header||e.footer||e.bodyAs||e.bodyClassName||e.bodyProps||e.classNames?.body)}a(LA,"shouldRenderBodyWrapper");function fw(e){if(e==null||typeof e=="boolean")return false;if(typeof e=="string")return e.trim().length>0;if(Array.isArray(e))return e.some(fw);let t=ho.Children.toArray(e);return t.length?t.some(o=>typeof o=="string"?o.trim().length>0:true):false}a(fw,"hasRenderableChildren");function WA(e,t){return t===void 0?{}:e===void 0?{width:t}:{width:e?t:0,opacity:e?1:0}}a(WA,"resolveWidthStyle");function uw(e){return e.label??e.key}a(uw,"getFallbackFieldLabel");function zA(e){let t=["text","label","title","display","value","recordId"];for(let o of t){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let r=e[o];if(r!=null&&r!=="")return r}}a(zA,"getObjectDisplayValue");function pw(e){return e==null||e===""}a(pw,"isEmptyDetailValue");function mw(e){return ["string","number","boolean"].includes(typeof e)}a(mw,"isPlainDisplayValue");function bw(e){if(!e)return null;if(typeof e=="string"){let r=e.startsWith("data:image/"),n=/\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(e);return r||n?{src:e}:null}if(typeof e!="object"||ho.isValidElement(e))return null;let t=e,o=t.src||t.url||t.thumbnail||t.preview||t.image;return o?{src:String(o),alt:t.alt||t.label||t.title||"",caption:t.caption||t.description||t.label||t.title}:null}a(bw,"getMediaDisplayData");function OA(e,t){let o=String(e?.renderType||"").toLowerCase();return ["image","media","preview","thumbnail"].includes(o)||!!bw(t)}a(OA,"shouldRenderAsMedia");function FA(e,t){return e?typeof e=="string"||typeof e=="number"?jsxRuntime.jsx("span",{className:m("inline-flex h-3.5 min-w-3.5 shrink-0 items-center justify-center rounded-sm text-[10px] font-semibold text-primary",t),children:e}):typeof e=="boolean"?null:ho.isValidElement(e)?e:jsxRuntime.jsx(e,{className:m("h-3.5 w-3.5 shrink-0 text-primary",t)}):jsxRuntime.jsxs("span",{className:m("relative inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",t),children:[jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-full border border-primary/25 bg-primary/10"}),jsxRuntime.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"})]})}a(FA,"renderMaybeFieldIcon");function HA(e,t,o){return jsxRuntime.jsxs("span",{className:m("inline-flex min-w-0 items-center gap-1.5 text-[11px] font-semibold text-foreground",o?.fieldLabel),children:[FA(t.labelIcon||t.icon,o?.fieldLabelIcon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e})]})}a(HA,"renderDetailFieldLabel");function VA({media:e,classNames:t}){return jsxRuntime.jsxs("div",{className:m("grid gap-2",t?.mediaValue),children:[jsxRuntime.jsx("div",{className:"overflow-hidden rounded-md border border-border/55 bg-muted/20 dark:border-border/45 dark:bg-muted/10",children:jsxRuntime.jsx("img",{src:e.src,alt:String(e.alt||""),className:m("block aspect-[16/9] w-full object-cover",t?.mediaImage)})}),e.caption?jsxRuntime.jsx("div",{className:m("truncate text-[11px] leading-4 text-muted-foreground",t?.mediaCaption),children:e.caption}):null]})}a(VA,"WorkbenchDetailSidebarMediaValue");function Rf(e,t,o,r){if(pw(e))return t;if(ho.isValidElement(e))return e;if(OA(o,e)){let n=bw(e);if(n)return jsxRuntime.jsx(VA,{media:n,classNames:r})}if(Array.isArray(e)){let n=e.map(i=>Rf(i,"",void 0,r)).filter(i=>!pw(i));return n.length?n.every(mw)?n.map(String).join(" \xB7 "):jsxRuntime.jsx("span",{className:"inline-flex flex-wrap items-center gap-1",children:n.map((i,s)=>jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1",children:[s>0?jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"\xB7"}):null,mw(i)?String(i):i]},s))}):t}if(typeof e=="object"){let n=zA(e);return n===void 0?t:Rf(n,t,o,r)}return String(e)}a(Rf,"getDefaultDetailDisplayValue");function _A(e,t){return Object.prototype.hasOwnProperty.call(e,"value")?typeof e.value=="function"?e.value(t,e):e.value:t?t?.[e.key]:void 0}a(_A,"getDefaultFieldValue");function GA(e,t){return typeof e.hidden=="function"?e.hidden(e,t):!!e.hidden}a(GA,"shouldHideField");function $A(e,t){return typeof e.hidden=="function"?e.hidden(e,t):!!e.hidden}a($A,"shouldHideSection");function jA({record:e,fields:t,sections:o,fieldColumns:r=1,emptyValue:n="\u2014",emptyState:i,getFieldValue:s,renderFieldValue:l,formatFieldValue:d,formatFieldLabel:c,classNames:p}){let g=(o?.length?o:t?.length?[{fields:t,columns:r}]:[]).filter(f=>!$A(f,e));return g.length?jsxRuntime.jsx("div",{className:m("space-y-3",p?.autoBody),children:g.map((f,b)=>{let x=(f.fields||[]).filter(w=>!GA(w,e)),y=f.id||`section-${b}`;if(!x.length&&!f.emptyState)return null;let k=x.map((w,v)=>{let h={field:w,fieldIndex:v,section:f,sectionIndex:b,record:e},S=s?s(w,e,h):_A(w,e),T=l?l(w,e,h):d?d(S,h):Rf(S,w.emptyValue??n,w,p),C=c?c(uw(w),h):uw(w);return {term:HA(C,w,p),value:T}});return jsxRuntime.jsxs("section",{className:m("min-w-0 space-y-3",p?.section),children:[f.title||f.description?jsxRuntime.jsxs("div",{className:m("min-w-0 space-y-1.5",p?.sectionHeader),children:[f.title?jsxRuntime.jsx("div",{className:m("inline-flex max-w-full items-center gap-2 rounded-md border border-primary/20 bg-primary/5 px-2.5 py-1.5 text-xs font-medium text-primary dark:border-primary/25 dark:bg-primary/10",p?.sectionTitle),children:f.title}):null,f.description?jsxRuntime.jsx("div",{className:m("text-[11px] leading-5 text-muted-foreground",p?.sectionDescription),children:f.description}):null]}):null,k.length?jsxRuntime.jsx(wc,{items:k,columns:f.columns||r,className:m("gap-3",p?.descriptionList),classNames:{item:m("!border-0 !bg-transparent !p-0 !shadow-none !gap-1.5",p?.descriptionListItem),term:m("!normal-case !tracking-normal !text-foreground",p?.descriptionListTerm),value:m("min-h-10 rounded-md border border-border/55 bg-muted/25 px-3 py-2 text-xs leading-5 text-foreground shadow-[inset_0_1px_0_hsl(var(--background)/0.8)] dark:border-border/45 dark:bg-white/[0.035]",p?.fieldValue,p?.descriptionListValue)}}):jsxRuntime.jsx("div",{className:m("py-3 text-center text-xs text-muted-foreground",p?.emptyState),children:f.emptyState})]},y)})}):i?jsxRuntime.jsx("div",{className:m("rounded-lg border border-dashed border-border/60 px-3 py-6 text-center text-xs text-muted-foreground",p?.emptyState),children:i}):null}a(jA,"WorkbenchDetailSidebarAutoContent");var gw=ho.forwardRef(a(function({as:t="aside",bodyAs:o="div",open:r,width:n,header:i,footer:s,resizeHandle:l,children:d,record:c,fields:p,sections:u,fieldColumns:g,emptyValue:f,emptyState:b,getFieldValue:x,renderFieldValue:y,formatFieldValue:k,formatFieldLabel:w,className:v,headerClassName:h,bodyClassName:S,footerClassName:T,resizeHandleClassName:C,bodyProps:R,classNames:M,style:I,...B},N){let D=fw(d)?d:jsxRuntime.jsx(jA,{record:c,fields:p,sections:u,fieldColumns:g,emptyValue:f,emptyState:b,getFieldValue:x,renderFieldValue:y,formatFieldValue:k,formatFieldLabel:w,classNames:M}),E=LA({header:i,footer:s,bodyAs:o==="div"?void 0:o,bodyClassName:S,bodyProps:R,classNames:M}),{className:P,...W}=R??{};return jsxRuntime.jsxs(t,{ref:N,"data-workbench-detail-sidebar":true,"data-open":r===void 0?void 0:r?"true":"false",className:m("workbench-surface-subtle relative flex flex-shrink-0 flex-col self-stretch overflow-hidden rounded-lg border border-border/50 transition-all duration-300 dark:border-border/40",r===false&&"pointer-events-none",M?.root,v),style:{...WA(r,n),...I},...B,children:[l?jsxRuntime.jsx("div",{className:m(M?.resizeHandle,C),children:l}):null,i?jsxRuntime.jsx("div",{className:m("shrink-0 border-b border-border/40 px-4 py-3 dark:border-border/30",M?.header,h),children:i}):null,E?jsxRuntime.jsx(o,{className:m("min-h-0 flex-1 overflow-y-auto",M?.body,S,P),...W,children:D}):D,s?jsxRuntime.jsx("div",{className:m("shrink-0 border-t border-border/40 px-4 py-3 dark:border-border/30",M?.footer,T),children:s}):null]})},"WorkbenchDetailSidebar"));function yw(e){return typeof e=="function"?true:typeof e=="object"&&e!==null&&!ho.isValidElement(e)&&"$$typeof"in e}a(yw,"isWorkbenchIconComponent");function rl(e,t){return e?ho.isValidElement(e)?e:yw(e)?jsxRuntime.jsx(e,{className:t}):e:null}a(rl,"renderWorkbenchIcon");function xw(e){return !e||!yw(e)?null:e}a(xw,"getWorkbenchIconComponent");function qA(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(qA,"toCssSize");var YA=160,XA=56,QA=128;function vw(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return;let t=e.trim().match(/^(\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}a(vw,"numericCssSize");function Cw(e,t){return e.renderType==="icon"?XA:t?QA:YA}a(Cw,"defaultWorkbenchColumnWidth");function ww(e,t,o){return t??vw(e.width)??vw(e.minWidth)??Cw(e,o)}a(ww,"resolvedWorkbenchColumnWidth");function ZA(e){return e==null||e===false?null:e}a(ZA,"defaultFormatLabel");function kw(e){if(typeof e=="string"||typeof e=="number")return String(e)}a(kw,"toTitle");function JA(e,t){return e?.id??e?.key??e?.linkKey??t}a(JA,"defaultGetRowKey");function eB(e){return e?.linkKey??e?.id??e?.key}a(eB,"defaultGetRowSelectionKey");function tB(e,t){if(!t?.length)return e;let o=new Map(e.map(s=>[s.key,s])),r=t.map(s=>o.get(s)).filter(Boolean),n=new Set(r.map(s=>s.key)),i=e.filter(s=>!n.has(s.key));return [...r,...i]}a(tB,"getOrderedColumns");function Pf(e,t){let o=new Set(e),r=(t||[]).filter(s=>o.has(s)),n=new Set(r),i=e.filter(s=>!n.has(s));return [...r,...i]}a(Pf,"normalizeColumnOrder");function oB({helperText:e,className:t}){return V(e)?jsxRuntime.jsxs("span",{className:m("group relative inline-flex items-center",t),children:[jsxRuntime.jsx("button",{type:"button",title:kw(e),"aria-label":kw(e)||"Field help",className:"inline-flex h-4 w-4 items-center justify-center rounded-md border border-border/60 bg-background text-xs font-semibold normal-case tracking-normal text-muted-foreground shadow-sm transition-colors hover:border-primary/40 hover:text-primary focus-visible:border-primary/40 focus-visible:text-primary focus-visible:outline-hidden",onClick:o=>o.stopPropagation(),children:"?"}),jsxRuntime.jsx("span",{role:"tooltip",className:"pointer-events-none absolute left-1/2 top-full z-40 mt-2 hidden w-72 -translate-x-1/2 whitespace-pre-line rounded-lg border border-border/60 bg-card px-3 py-2 text-xs font-normal normal-case leading-5 tracking-normal text-foreground shadow-sm backdrop-blur-sm group-hover:block group-focus-within:block",children:e})]}):null}a(oB,"WorkbenchTableHeaderHelper");function Sw({rows:e=[],columns:t=[],onRowClick:o,selectedRowKey:r,selectedLinkKey:n,activePrimaryColumn:i,activeTablePrimaryColumn:s,renderedRowCount:l,totalRowCount:d,tableMinWidth:c,minWidth:p,bodyMaxHeight:u="min(58vh, 38rem)",stickyFirstColumn:g=true,appearance:f,headerPresentation:b,fillRemainingWidthColumnKey:x,columnOrder:y,columnSizes:k,columnDragEnabled:w,columnResizeEnabled:v,className:h,tableClassName:S,rowClassName:T,classNames:C,style:R,renderCell:M,renderFieldValue:I,renderColumnHeader:B,onColumnOrderChange:N,onColumnSizeChange:D,onSort:E,formatLabel:P=ZA,getColumnDataType:W,getColumnIcon:H,getColumnTypeIcon:A,getRowKey:L=JA,getRowSelectionKey:F=eB,isActionColumn:G,isActionField:$,isRowDisabled:_,isWorkbenchPlaceholderRow:z,emptyState:re="-",hiddenRowsMessage:Z,scrollFooter:ae,scrollRestoration:ee}){let q=t.map(se=>se.key).join(""),U=ho.useMemo(()=>q?q.split(""):[],[q]),[X,O]=ho.useState(U),[K,ne]=ho.useState({}),fe=ho.useRef(null),he=ho.useRef(new Map),me=ho.useRef(ee);me.current=ee;let ie=ho.useRef(void 0),be=ho.useCallback(()=>{let se=fe.current,te=me.current;if(!se||!te||ie.current!==te.key)return;let Te=se.getBoundingClientRect().top,ze=Array.from(he.current.entries()).find(([,je])=>je.getBoundingClientRect().bottom>Te);te.write({x:se.scrollLeft,y:se.scrollTop,...ze?{rowKey:ze[0],rowOffset:ze[1].getBoundingClientRect().top-Te}:{}});},[]);ho.useEffect(()=>{let se=fe.current,te=me.current;if(!se||!te||ie.current===te.key||e.length===0)return;let Te=te.read(),ze=a(()=>{let Y=Te?.rowKey?he.current.get(Te.rowKey):void 0,pe=Y&&typeof Te?.rowOffset=="number"?se.scrollTop+Y.getBoundingClientRect().top-se.getBoundingClientRect().top-Te.rowOffset:Te?.y??0;se.scrollTo({left:Te?.x??0,top:Math.max(0,pe),behavior:"auto"}),ie.current=te.key;},"restore"),je=se.ownerDocument.defaultView;if(!je){ze();return}let it=je.requestAnimationFrame(ze);return ()=>je.cancelAnimationFrame(it)},[e,ee?.key]),ho.useEffect(()=>{let se=fe.current?.ownerDocument.defaultView;return se?.addEventListener("pagehide",be),()=>{se?.removeEventListener("pagehide",be),be();}},[be]);let[He,We]=ho.useState();ho.useEffect(()=>{O(se=>Pf(U,se));},[U]);let Ke=y?Pf(U,y):X,ce=k??K,Q=ho.useCallback((se,te)=>{let Te=Pf(U,se);y||O(Te),N?.(Te,te);},[y,U,N]),ge=ho.useCallback((se,te,Te)=>{k||ne(ze=>({...ze,[se]:te})),D?.(se,te,Te);},[k,D]),we=r??n,Ie=i??s,oe=tB(t,Ke),xe=x?oe.reduce((se,te)=>te.key===x?se:se+ww(te,ce[te.key],G?.(te)??$?.(te)??false),0):void 0,Ve=x&&xe!==void 0&&He!==void 0?Math.max(0,Math.round(He-xe)):void 0,_e=oe.flatMap(se=>se.key!==x?[se]:Ve===0?[]:Ve===void 0?[se]:[{...se,width:Ve,minWidth:Ve,maxWidth:Ve}]),Ge=Math.max(0,Number(d||e.length)-Number(l||e.length)),le=M??I??((se,te)=>te?.[se.key]),Me=G??$??(()=>false),Ae=_??z??(()=>false),J=H??A,$e=xe!==void 0&&Ve!==void 0?xe+Ve:void 0,ue=$e??c??p??Math.max(760,_e.reduce((se,te)=>se+ww(te,ce[te.key],Me(te)),0));ho.useEffect(()=>{if(!x){We(void 0);return}let se=fe.current;if(!se)return;let te=se.ownerDocument.defaultView,Te=a(()=>{let it=Math.round(se.getBoundingClientRect().width);!Number.isFinite(it)||it<=0||We(Y=>Y===it?Y:it);},"updateWidth");Te();let ze=te?.ResizeObserver,je=ze?new ze(Te):void 0;return je?.observe(se),te?.addEventListener("resize",Te),()=>{je?.disconnect(),te?.removeEventListener("resize",Te);}},[x]);let Re=Ge>0&&Z?typeof Z=="function"?Z(Ge,l||e.length,d||e.length):Z:null;return jsxRuntime.jsxs(Bi,{appearance:f,className:m("w-full overflow-hidden rounded-lg border border-border/40 bg-muted/15 dark:border-border/35 dark:bg-muted/10",C?.root,h),style:u==="100%"?{display:"flex",minHeight:0,flex:1,flexDirection:"column",...R}:R,children:[jsxRuntime.jsxs("div",{ref:fe,onScroll:be,className:m("w-full overflow-auto",C?.scrollArea),style:{maxHeight:qA(u),...u==="100%"?{minHeight:0,flex:1}:{}},children:[jsxRuntime.jsxs(Li,{appearance:f,columnOrder:Ke,columnSizes:ce,columnDragEnabled:w,columnResizeEnabled:v,onColumnOrderChange:Q,onColumnSizeChange:ge,className:m("w-full table-auto text-left text-xs",C?.table,S),style:{width:$e,minWidth:ue},children:[jsxRuntime.jsx(Wi,{appearance:f,className:m("z-20 text-xs font-sans text-muted-foreground",C?.header),children:jsxRuntime.jsx(yn,{className:m("hover:bg-transparent",C?.headerRow),children:_e.map((se,te)=>{let Te=Cw(se,Me(se)),ze=se.renderType||se.type||W?.(se.key,e,se),je=rl(J?.(ze,se),"h-3.5 w-3.5 shrink-0 text-primary"),Y=_e[te-1]?.renderType==="icon"&&se.key===Ie?.key,pe=B?B(se,{column:se,columnIndex:te,columns:_e,rows:e,columnType:ze}):P(se.label,{column:se}),Be=!B&&(V(se.trailing)||V(se.helperText))?jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[V(se.trailing)?P(se.trailing,{column:se}):null,jsxRuntime.jsx(oB,{helperText:P(se.helperText,{column:se}),className:C?.helper})]}):void 0,rt=!!se.sortable,Ce=rt&&E?()=>E(se.key,se):void 0;return jsxRuntime.jsx(Oi,{appearance:f,presentation:b,columnId:se.key,align:se.align,icon:B?void 0:je,label:pe,description:B?void 0:P(se.description,{column:se}),meta:B?void 0:P(se.meta,{column:se}),actions:se.actions,trailing:Be,sortable:rt,sortDirection:se.sortDirection,sortLabel:se.sortLabel,onSort:Ce,draggable:se.draggable,dragLabel:se.dragLabel,resizable:se.resizable,resizeLabel:se.resizeLabel,width:se.width??Te,minWidth:typeof se.minWidth=="number"?se.minWidth:void 0,maxWidth:typeof se.maxWidth=="number"?se.maxWidth:void 0,className:m("sticky top-0 z-20 h-auto whitespace-nowrap bg-card/95 px-4 py-3 font-medium backdrop-blur-sm supports-[backdrop-filter]:bg-card/90",g&&te===0&&"md:left-0 md:z-30 md:shadow-[1px_0_0_0_hsl(var(--border)/0.35)]",se.compactHeaderClassName,se.renderType==="icon"&&"pl-3 pr-1",Y&&"pl-2",C?.headerCell,se.headerClassName),style:{minWidth:typeof se.minWidth=="string"?se.minWidth:void 0,maxWidth:typeof se.maxWidth=="string"?se.maxWidth:void 0,...se.headerStyle}},se.key)})})}),jsxRuntime.jsx(zi,{appearance:f,className:m("divide-y divide-border/35 dark:divide-border/30",C?.body),children:e.length?e.map((se,te)=>{let Te=L(se,te),ze=Ae(se,te),je=F(se,te),it=!!(we&&String(je)===String(we)),Y=typeof T=="function"?T(se,te):T;return jsxRuntime.jsx(yn,{appearance:f,ref:pe=>{pe?he.current.set(String(Te),pe):he.current.delete(String(Te));},interactive:!!o&&!ze,"data-item-key":String(Te),tabIndex:o&&!ze?0:void 0,selected:it,disabled:ze,onClick:pe=>{ze||(o&&pe.currentTarget.focus({preventScroll:true}),o?.(se,te));},onKeyDown:pe=>{pe.target!==pe.currentTarget||ze||!o||!["Enter"," "].includes(pe.key)||(pe.preventDefault(),o(se,te));},className:m(o&&!ze?"cursor-pointer":"cursor-default",it?"bg-primary/10 hover:bg-primary/15":ze?"":"hover:bg-muted/25 dark:hover:bg-muted/15",C?.row,Y),children:_e.map((pe,Be)=>{let rt=Me(pe)||pe.wrap===true,Xe=_e[Be-1]?.renderType==="icon"&&pe.key===Ie?.key;return jsxRuntime.jsx(Oa,{appearance:f,align:pe.align,className:m(rt?"align-top whitespace-normal":"whitespace-nowrap","px-4 py-3 text-muted-foreground",!rt&&"overflow-hidden text-ellipsis",g&&Be===0&&"md:sticky md:left-0 md:z-10 md:bg-card/95 md:text-foreground md:shadow-[1px_0_0_0_hsl(var(--border)/0.3)]",pe.compactCellClassName,pe.renderType==="icon"&&"pl-3 pr-1",Xe&&"pl-2",C?.cell,pe.cellClassName),style:pe.cellStyle,children:le(pe,se,{row:se,rowIndex:te,column:pe,columnIndex:Be,compact:true,surface:"list"})},`${Te}-${pe.key}`)})},Te)}):jsxRuntime.jsx(Fi,{appearance:f,colSpan:Math.max(_e.length,1),classNames:{cell:"px-4 py-10 text-center text-sm text-muted-foreground"},children:re})})]}),V(ae)?jsxRuntime.jsx("div",{style:{minWidth:ue},children:ae}):null]}),Re?jsxRuntime.jsx("div",{className:m("border-t border-border/40 px-4 py-2 text-xs text-muted-foreground dark:border-border/30",C?.footer),children:Re}):null]})}a(Sw,"WorkbenchTableView");function Ef(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(Ef,"toCssSize");function Ui(){return typeof window<"u"}a(Ui,"isBrowser");function Nw(e,t){return e?.id??e?.key??t}a(Nw,"defaultGetRowKey");function mu(e){return typeof e.width=="number"?e.width:typeof e.minWidth=="number"?e.minWidth:160}a(mu,"getColumnDefaultSize");function rB(e,t){return e.reduce((o,r)=>(o[r.key]=t?.[r.key]??mu(r),o),{})}a(rB,"buildDefaultColumnSizes");function Rw(e,t){if(!e||!Ui())return t;try{let o=JSON.parse(window.localStorage.getItem(e)||"{}");return Object.keys(t).reduce((r,n)=>{let i=Number(o?.[n]);return r[n]=Number.isFinite(i)?i:t[n],r},{})}catch{return t}}a(Rw,"loadStoredColumnSizes");function Mw(e,t){!e||!Ui()||window.localStorage.setItem(e,JSON.stringify(t));}a(Mw,"persistColumnSizes");function Bw(e){return e?`${e}.frozenColumnCount`:void 0}a(Bw,"getFrozenColumnStorageKey");function Lw(e){return e?`${e}.frozenEndColumnCount`:void 0}a(Lw,"getFrozenEndColumnStorageKey");function la(e,t){return Number.isFinite(e)?Math.max(0,Math.min(Math.round(e),t)):0}a(la,"clampFrozenColumnCount");function nB(e,t,o){let r=la(e,o),n=la(t,Math.max(0,o-r));return {startCount:r,endCount:n}}a(nB,"normalizeFrozenColumnCounts");function Iw(e,t,o){let r=la(t,o),n=Bw(e);if(!n||!Ui())return r;try{let i=window.localStorage.getItem(n);if(i===null)return r;let s=Number(i);return Number.isFinite(s)?la(s,o):r}catch{return r}}a(Iw,"loadStoredFrozenColumnCount");function aB(e,t){let o=Bw(e);!o||!Ui()||window.localStorage.setItem(o,String(t));}a(aB,"persistFrozenColumnCount");function Dw(e,t,o){let r=la(t,o),n=Lw(e);if(!n||!Ui())return r;try{let i=window.localStorage.getItem(n);if(i===null)return r;let s=Number(i);return Number.isFinite(s)?la(s,o):r}catch{return r}}a(Dw,"loadStoredFrozenEndColumnCount");function iB(e,t){let o=Lw(e);!o||!Ui()||window.localStorage.setItem(o,String(t));}a(iB,"persistFrozenEndColumnCount");function pu(e,t){let o=new Set(e),r=(t||[]).filter(s=>o.has(s)),n=new Set(r),i=e.filter(s=>!n.has(s));return [...r,...i]}a(pu,"normalizeColumnOrder");function sB(e,t){let o=pu(e.map(n=>n.key),t),r=new Map(e.map(n=>[n.key,n]));return o.map(n=>r.get(n)).filter(Boolean)}a(sB,"getOrderedColumns");function sl(e,t){let o=t[e.key];return typeof o=="number"?o:mu(e)}a(sl,"getColumnNumericWidth");function lB(e,t,o){let r=new Map,n=0;return e.slice(0,Math.max(0,o)).forEach(i=>{r.set(i.key,n),n+=sl(i,t);}),r}a(lB,"buildFrozenOffsets");function dB(e,t,o){let r=new Map,n=0;return e.slice(Math.max(0,e.length-o)).reverse().forEach(i=>{r.set(i.key,n),n+=sl(i,t);}),r}a(dB,"buildFrozenEndOffsets");function Pw(e,t,o){return typeof e=="function"?e(t,o):e}a(Pw,"resolveRowClassName");function Ew(e,t){let o=t?.[e.key];return o==null||o===""?"\u2014":String(o)}a(Ew,"renderDefaultCell");function Aw({children:e,wrap:t}){return jsxRuntime.jsx("div",{className:m("min-w-0 max-w-full overflow-auto overscroll-contain [scrollbar-width:thin]",t?"max-h-20 whitespace-pre-wrap break-words leading-5":"whitespace-nowrap"),children:e})}a(Aw,"InteractiveTableCellContent");function cB({className:e}){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",children:[jsxRuntime.jsx("path",{d:"M5.25 2.75h5.5"}),jsxRuntime.jsx("path",{d:"M6.25 2.75v4L4.5 9.25h7L9.75 6.75v-4"}),jsxRuntime.jsx("path",{d:"M8 9.25v4"})]})}a(cB,"PinIcon");function Ww({rows:e=[],columns:t=[],pinnedTopRows:o=[],getRowKey:r=Nw,getPinnedTopRowKey:n=Nw,renderCell:i,renderPinnedTopCell:s,renderColumnHeader:l,onRowClick:d,getRowState:c,rowClassName:p,pinnedTopRowClassName:u,emptyState:g="\u2014",columnMenuLabels:f,columnStorageKey:b,columnOrder:x,columnSizes:y,defaultColumnSizes:k,columnDragEnabled:w=false,columnResizeEnabled:v=true,frozenColumnCount:h=0,frozenEndColumnCount:S=0,tableMinWidth:T,bodyMaxHeight:C="min(60vh, 42rem)",appearance:R,className:M,tableClassName:I,classNames:B,style:N,onColumnOrderChange:D,onColumnSizeChange:E,onResetColumnSizes:P,onFrozenColumnCountChange:W,onFrozenEndColumnCountChange:H,onSort:A}){let L=Ye().workbench.interactiveTable,F=t.map(oe=>oe.key).join(""),G=ho.useMemo(()=>F?F.split(""):[],[F]),$=ho.useMemo(()=>rB(t,k),[t,k]),[_,z]=ho.useState(G),[re,Z]=ho.useState(()=>Rw(b,$)),[ae,ee]=ho.useState(()=>Iw(b,h,t.length)),[q,U]=ho.useState(()=>Dw(b,S,t.length));ho.useEffect(()=>{z(oe=>pu(G,oe));},[G]),ho.useEffect(()=>{y||Z(Rw(b,$));},[y,b,$]),ho.useEffect(()=>{ee(Iw(b,h,t.length));},[b,t.length,h]),ho.useEffect(()=>{U(Dw(b,S,t.length));},[b,t.length,S]);let X=x?pu(G,x):_,O=y??re,K=sB(t,X),{startCount:ne,endCount:fe}=nB(ae,q,K.length),he=lB(K,O,ne),me=dB(K,O,fe),ie=T??Math.max(760,K.reduce((oe,xe)=>oe+sl(xe,O),0)),be={columnActions:f?.columnActions??L.columnActions,freezeColumn:f?.freezeColumn??L.freezeColumn,freezeEndColumn:f?.freezeEndColumn??L.freezeEndColumn,unfreezeColumn:f?.unfreezeColumn??L.unfreezeColumn,unfreezeEndColumn:f?.unfreezeEndColumn??L.unfreezeEndColumn,unfreezeAllColumns:f?.unfreezeAllColumns??L.unfreezeAllColumns,resetColumnWidth:f?.resetColumnWidth??L.resetColumnWidth,frozenColumnTitle:f?.frozenColumnTitle??L.frozenColumnTitle},He=ho.useCallback((oe,xe)=>{let Ve=pu(G,oe);x||z(Ve),D?.(Ve,xe);},[x,G,D]),We=ho.useCallback((oe,xe,Ve)=>{let _e=t.find(J=>J.key===oe),Ge=_e?.minWidth,le=_e?.maxWidth,Me=Math.max(typeof Ge=="number"?Ge:0,Math.min(xe,typeof le=="number"?le:Number.POSITIVE_INFINITY)),Ae={...O,[oe]:Me};y||Z(Ae),Mw(b,Ae),E?.(oe,Me,Ve);},[y,b,t,E,O]),Ke=ho.useCallback(oe=>{let xe=$[oe.key]??mu(oe),Ve=sl(oe,O),_e={...O,[oe.key]:xe};y||Z(_e),Mw(b,_e),E?.(oe.key,xe,{columnId:oe.key,previousWidth:Ve,minWidth:oe.minWidth,maxWidth:oe.maxWidth}),P?.(_e);},[y,b,$,E,P,O]),ce=ho.useCallback(oe=>{let xe=la(oe,Math.max(0,K.length-fe));ee(xe),aB(b,xe),W?.(xe);},[b,W,K.length,fe]),Q=ho.useCallback(oe=>{let xe=la(oe,Math.max(0,K.length-ne));U(xe),iB(b,xe),H?.(xe);},[b,H,K.length,ne]),ge=a(oe=>{if(oe<ne)return "start";if(oe>=K.length-fe)return "end"},"getFrozenPosition"),we=a((oe,xe,Ve=false)=>{let _e=ge(xe);if(_e)return m("sticky",_e==="start"?"shadow-[1px_0_0_0_hsl(var(--border)/0.45)]":"shadow-[-1px_0_0_0_hsl(var(--border)/0.45)]",Ve?"bg-muted/60":"bg-inherit",Ve?"z-40":"z-20",(xe===0||xe===K.length-1)&&(Ve?"z-50":"z-30"))},"getFrozenClassName"),Ie=a((oe,xe)=>{let Ve=ge(xe);if(Ve==="start")return {left:he.get(oe.key)??0};if(Ve==="end")return {right:me.get(oe.key)??0}},"getFrozenStyle");return jsxRuntime.jsx(Bi,{appearance:R,className:m("flex h-full min-h-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-card",B?.root,M),style:N,children:jsxRuntime.jsx("div",{className:m("min-h-0 flex-1 overflow-auto",B?.scrollArea),style:{maxHeight:Ef(C)},children:jsxRuntime.jsxs(Li,{appearance:R,columnOrder:X,columnSizes:O,columnDragEnabled:w,columnResizeEnabled:v,onColumnOrderChange:He,onColumnSizeChange:We,className:m("w-full table-fixed text-left text-xs",B?.table,I),style:{minWidth:ie},children:[jsxRuntime.jsx("colgroup",{children:K.map(oe=>jsxRuntime.jsx("col",{style:{width:Ef(O[oe.key]??oe.width),minWidth:Ef(oe.minWidth)}},oe.key))}),jsxRuntime.jsx(Wi,{appearance:R,className:m("border-b border-border/60 bg-muted/60 text-[11px] font-medium text-muted-foreground",B?.tableHeader),children:jsxRuntime.jsx(yn,{appearance:R,className:m("hover:bg-transparent",B?.headerRow),children:K.map((oe,xe)=>{let Ve=l?l(oe,{column:oe,columnIndex:xe,columns:K,rows:e}):oe.label,_e=!!oe.sortable,Ge=_e&&A?()=>A(oe.key,oe):void 0,le=xe<ne,Me=xe>=K.length-fe,Ae=le||Me,J=sl(oe,O)===($[oe.key]??mu(oe));return jsxRuntime.jsxs(yc,{modal:false,children:[jsxRuntime.jsx(Ls,{asChild:true,appearance:R,children:jsxRuntime.jsx(Oi,{appearance:R,columnId:oe.key,align:oe.align,label:Ve,description:oe.description,trailing:Ae?jsxRuntime.jsx("span",{title:be.frozenColumnTitle,className:"inline-flex h-5 w-5 items-center justify-center rounded text-primary",children:jsxRuntime.jsx(cB,{className:"h-3.5 w-3.5"})}):null,sortable:_e,sortDirection:oe.sortDirection,sortLabel:oe.sortLabel,onSort:Ge,draggable:oe.draggable,resizable:oe.resizable,width:oe.width,minWidth:oe.minWidth,maxWidth:oe.maxWidth,className:m("sticky top-0 h-9 whitespace-nowrap border-r border-border/50 bg-muted/60 px-2.5 py-2 backdrop-blur",we(oe,xe,true),oe.headerClassName,oe.className,B?.headerCell),style:Ie(oe,xe)})}),jsxRuntime.jsxs(Ws,{appearance:R,alignOffset:-4,className:"min-w-44",children:[jsxRuntime.jsx(xc,{appearance:R,children:be.columnActions}),Ae?jsxRuntime.jsx(oa,{appearance:R,onSelect:()=>{Me?Q(K.length-xe-1):ce(xe);},children:Me?be.unfreezeEndColumn:be.unfreezeColumn}):jsxRuntime.jsx(oa,{appearance:R,onSelect:()=>ce(xe+1),children:be.freezeColumn}),Ae?null:jsxRuntime.jsx(oa,{appearance:R,onSelect:()=>Q(K.length-xe),children:be.freezeEndColumn}),jsxRuntime.jsx(oa,{appearance:R,disabled:ne===0&&fe===0,onSelect:()=>{ce(0),Q(0);},children:be.unfreezeAllColumns}),jsxRuntime.jsx(vc,{appearance:R}),jsxRuntime.jsx(oa,{appearance:R,disabled:J,onSelect:()=>Ke(oe),children:be.resetColumnWidth})]})]},oe.key)})})}),jsxRuntime.jsxs(zi,{appearance:R,className:m("divide-y divide-border/50",B?.body),children:[o.map((oe,xe)=>{let Ve=n(oe,xe),_e=Pw(u,oe,xe);return jsxRuntime.jsx(yn,{appearance:R,className:m("bg-card/95",B?.pinnedTopRow,_e),children:K.map((Ge,le)=>jsxRuntime.jsx(Oa,{appearance:R,align:Ge.align,className:m("h-[52px] border-r border-border/50 px-2.5 py-1.5 align-middle",Ge.wrap?"whitespace-normal":"whitespace-nowrap",we(Ge,le),Ge.cellClassName,B?.cell),style:Ie(Ge,le),children:jsxRuntime.jsx(Aw,{wrap:Ge.wrap,children:s?s(Ge,oe,{row:oe,rowIndex:xe,column:Ge,columnIndex:le,isPinnedTopRow:true}):Ew(Ge,oe)})},`pinned-${Ve}-${Ge.key}`))},`pinned-${Ve}`)}),e.length?e.map((oe,xe)=>{let Ve=r(oe,xe),_e=c?.(oe,xe)||{},Ge=Pw(p,oe,xe);return jsxRuntime.jsx(yn,{appearance:R,interactive:!!d&&!_e.disabled,selected:_e.selected,disabled:_e.disabled,onClick:()=>{_e.disabled||d?.(oe,xe);},className:m("min-h-[52px] bg-card transition-colors",_e.saving&&"bg-primary/5",_e.pending&&"opacity-80",d&&!_e.disabled?"cursor-pointer hover:bg-muted/30":"hover:bg-muted/30",B?.row,Ge),children:K.map((le,Me)=>jsxRuntime.jsx(Oa,{appearance:R,align:le.align,className:m("h-[52px] border-r border-border/50 px-2.5 py-1.5 align-middle",le.wrap?"whitespace-normal":"whitespace-nowrap",we(le,Me),le.cellClassName,B?.cell),style:Ie(le,Me),children:jsxRuntime.jsx(Aw,{wrap:le.wrap,children:i?i(le,oe,{row:oe,rowIndex:xe,column:le,columnIndex:Me,isPinnedTopRow:false}):Ew(le,oe)})},`${Ve}-${le.key}`))},Ve)}):o.length?null:jsxRuntime.jsx(Fi,{appearance:R,colSpan:Math.max(K.length,1),className:B?.empty,children:g})]})]})})})}a(Ww,"InteractiveTable");function zw({value:e,placeholder:t,disabled:o,multiline:r=false,commitOnBlur:n=true,className:i,inputClassName:s,onCommit:l}){let d=String(e||""),[c,p]=ho.useState(d);ho.useEffect(()=>{p(d);},[d]);let u=ho.useCallback(async()=>{let f=String(c||"").trim(),b=String(d||"").trim();if(f!==b)try{await l?.(f);}catch{p(d);}},[c,d,l]),g=m("w-full resize-none rounded-sm border border-transparent bg-transparent px-1.5 py-1 text-xs text-foreground outline-hidden transition-colors","placeholder:text-muted-foreground/70 hover:border-border/60 hover:bg-background focus:border-primary/45 focus:bg-background",r?"min-h-[42px] leading-5":"h-8",o&&"cursor-not-allowed text-muted-foreground hover:border-transparent hover:bg-transparent",s);return r?jsxRuntime.jsx("textarea",{className:m(g,i),disabled:o,value:c,placeholder:t,onChange:f=>p(f.target.value),onBlur:()=>{n&&u();},onKeyDown:f=>{(f.metaKey||f.ctrlKey)&&f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&(p(d),f.currentTarget.blur());}}):jsxRuntime.jsx("input",{className:m(g,i),disabled:o,value:c,placeholder:t,onChange:f=>p(f.target.value),onBlur:()=>{n&&u();},onKeyDown:f=>{f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&(p(d),f.currentTarget.blur());}})}a(zw,"InteractiveTableEditableTextCell");function Ow({children:e,mono:t=false,className:o}){return jsxRuntime.jsx("div",{className:m("min-w-0 text-xs text-muted-foreground",t&&"font-mono",o),children:V(e)?e:"\u2014"})}a(Ow,"InteractiveTableReadonlyCell");function Fw({value:e,options:t,disabled:o,ariaLabel:r,children:n,className:i,onChange:s}){return jsxRuntime.jsxs("div",{className:m("relative flex w-full items-center",i),children:[n,jsxRuntime.jsx("select",{"aria-label":r,disabled:o,value:e,onChange:l=>s?.(l.target.value),className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",children:t.map(l=>jsxRuntime.jsx("option",{value:l.value,children:l.label},l.value))})]})}a(Fw,"InteractiveTableSelectCell");function Hw({children:e,title:t,presentation:o,renderSlot:r}){let n=o.title,i=n?.placement??"none",s=n?.background==="panel"?"div":"span",l=(o.slots??[]).map(p=>({slot:p,content:r?.(p)})).filter(p=>p.content!=null),d=i==="none"?null:jsxRuntime.jsx("div",{className:"monkeys-gallery-cover-title",title:typeof t=="string"||typeof t=="number"?String(t):void 0,"data-placement":i,"data-background":n?.background??(i.startsWith("overlay")?"gradient":"none"),style:{...n?.background==="panel"?{margin:12,borderRadius:"var(--radius)",border:"1px solid hsl(var(--border) / .8)",background:"hsl(var(--card) / .9)",backdropFilter:"blur(12px)",boxShadow:"var(--monkeys-component-overlay-dialog-shadow)"}:{},textAlign:n?.align??"left",padding:n?.padding??12,fontSize:`var(--monkeys-gallery-title-${n?.size??"md"})`,fontWeight:n?.weight==="normal"?400:n?.weight==="medium"?500:600},children:jsxRuntime.jsx(s,{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:n?.background==="panel"?void 0:n?.maxLines??2,overflow:"hidden"},children:t})}),c=a(p=>jsxRuntime.jsx("div",{className:"monkeys-gallery-slot-row","data-row":p,children:l.filter(({slot:u})=>u.position.startsWith(p)).map(({slot:u,content:g})=>jsxRuntime.jsx("div",{"data-card-slot":u.position,"data-visibility":u.visibility??"always",className:u.visibility==="hover"?"monkeys-gallery-hover-actions":void 0,style:{gridColumn:u.position.endsWith("left")?1:u.position.endsWith("center")?2:3,justifySelf:u.position.endsWith("left")?"start":u.position.endsWith("center")?"center":"end",padding:u.inset??12,gap:u.gap??8,flexDirection:u.direction==="vertical"?"column":"row"},children:g},u.position))}),"band");return jsxRuntime.jsxs("div",{className:"monkeys-gallery-card-surface","data-hover-effect":o.hover?.effect??"none",style:{"--monkeys-gallery-hover-scale":o.hover?.scale??1.02},children:[i==="above"&&d,jsxRuntime.jsxs("div",{className:"monkeys-gallery-media-card",children:[jsxRuntime.jsx("div",{className:"monkeys-gallery-card-media",children:e}),jsxRuntime.jsxs("div",{className:"monkeys-gallery-card-overlay",children:[jsxRuntime.jsxs("div",{children:[i==="overlay-top"&&d,c("top")]}),c("middle"),jsxRuntime.jsxs("div",{children:[c("bottom"),i==="overlay-bottom"&&d]})]})]}),i==="below"&&d]})}a(Hw,"WorkbenchGalleryCardSurface");var uB=/\.(png|jpe?g|webp|gif|svg|bmp|avif)$/i,pB=/\.(wav|mp3|ogg|m4a|flac|aac)$/i,mB=a(e=>/^https?:\/\//i.test(String(e||"")),"isLikelyUrl"),Vw=a(e=>String(e?.renderType||e?.type||"").toLowerCase(),"getColumnRenderKind"),fB=a(e=>String(e||"").startsWith("data:image/")||uB.test(String(e||"")),"isImageLikeValue"),bB=a(e=>String(e||"").startsWith("data:audio/")||pB.test(String(e||"")),"isAudioLikeValue"),gB=a(e=>String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"escapeSvgText"),Ki=a((e,t)=>e?t?.[e.key]??null:null,"getDefaultGalleryFieldValue"),cl=a(e=>{if(e==null||e==="")return "\u2014";if(Array.isArray(e))return e.map(o=>{if(typeof o=="string")return o;if(!o||typeof o!="object")return "";let r=o;return r.text||r.label||r.title||r.display||r.value||r.recordId||""}).filter(Boolean).join(" \xB7 ")||"\u2014";if(typeof e=="object"){let t=e;return String(t.text||t.label||t.title||t.display||t.value||"\u2014")}return String(e)},"getDefaultGalleryDisplayText"),ul=a((e={key:""},t)=>Vw(e)==="image"||fB(t),"isDefaultGalleryImageField"),pl=a((e={key:""},t)=>Vw(e)==="audio"||bB(t),"isDefaultGalleryAudioField"),_w=a((e,t,o)=>{if(mB(e)||String(e||"").startsWith("data:image/"))return String(e);let r=gB(e||o||t||""),i=`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 960 540'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0%' stop-color='#0f172a'/><stop offset='55%' stop-color='#1d4ed8'/><stop offset='100%' stop-color='#14b8a6'/></linearGradient></defs><rect width='960' height='540' fill='url(#g)'/><g opacity='0.28'><circle cx='780' cy='130' r='150' fill='#67e8f9'/><circle cx='180' cy='430' r='170' fill='#a78bfa'/></g>${r?`<text x='68' y='450' fill='white' font-family='Inter, Arial' font-size='52' font-weight='700'>${r}</text>`:""}</svg>`;return `data:image/svg+xml;utf8,${encodeURIComponent(i)}`},"getDefaultGalleryImagePreviewSrc"),fu=a((e,t,{getFieldValue:o=Ki,shouldEnhanceMultimodal:r=true,isImageField:n=ul,isAudioField:i=pl}={})=>{if(!e||!r)return false;let s=o(e,t);return n(e,s)||i(e,s)},"isDefaultGalleryMediaColumn"),bu=a((e,t,{isMediaColumn:o=a(()=>false,"isMediaColumn")}={})=>!e||e.renderType==="icon"?false:!o(e,t),"isDefaultGalleryTitleCandidate"),gu=a((e,t,{isMediaColumn:o=a(()=>false,"isMediaColumn")}={})=>!e||e.renderType==="icon"?false:!o(e,t),"isDefaultGallerySummaryCandidate"),Gw=a((e,t,{compact:o=false,getFieldValue:r=Ki,getDisplayText:n=cl}={})=>{let i=r(e,t);return jsxRuntime.jsx("span",{className:m("leading-relaxed",o&&e?.wrap===true&&"line-clamp-2 block"),children:n(i)})},"renderDefaultGalleryFieldValue");var yB=a(e=>e==="compact"?2:e==="detailed"?6:4,"getDefaultGalleryDetailLimit"),xB=a((e,t)=>e===1||e===2||e===3?Number(e):t==="detailed"?1:2,"getNormalizedGalleryBentoColumns"),vB=a(({density:e,visibility:t,limit:o})=>{if(t==="all")return Number.POSITIVE_INFINITY;let r=Number.parseInt(String(o),10);return Number.isFinite(r)&&r>0?r:yB(e)},"getNormalizedGalleryDetailLimit"),wB=a(e=>e==="compact"?"p-3":e==="detailed"?"p-4":"p-3.5","getGalleryCardPaddingClassName"),kB=a((e,t)=>t?"h-auto w-full object-cover":e==="compact"?"h-32 w-full object-cover":e==="detailed"?"h-48 w-full object-cover":"h-40 w-full object-cover","getGalleryPreviewClassName"),CB=a(e=>e===1?"grid-cols-1":e===3?"grid-cols-1 sm:grid-cols-2 2xl:grid-cols-3":"grid-cols-1 sm:grid-cols-2","getGalleryDetailGridClassName");function SB(e){return xw(e)}a(SB,"getIconComponent");function TB(e){return e}a(TB,"defaultFormatLabel");function NB(e){return typeof e=="string"||typeof e=="number"?String(e):""}a(NB,"getLabelText");function hu({row:e,columns:t,onClick:o,cardInteraction:r="button",cardPresentation:n,renderCardSlot:i,renderCoverTitle:s,isSelected:l=false,isMasonry:d=false,galleryFieldKey:c="auto",galleryDensity:p="comfortable",galleryBentoColumns:u,galleryDetailVisibility:g="limit",galleryDetailLimit:f,galleryDetailPresentation:b="tiles",shouldEnhanceMultimodal:x=true,getFieldValue:y,isMediaColumn:k,isTitleCandidate:w,isSummaryCandidate:v,getDisplayText:h,renderFieldValue:S,getImagePreviewSrc:T,isImageField:C,isAudioField:R,AudioPlayerComponent:M,cardVariant:I="default",renderPreview:B,renderMeta:N,renderLeadingVisual:D,resolveRecordVisual:E,hiddenDetailFieldKeys:P=[],labels:W,formatLabel:H=TB,className:A}){let L=y||Ki,F=h||cl,G=C||ul,$=R||pl,_=T||_w,z=k||((Se,Je)=>fu(Se,Je,{getFieldValue:L,shouldEnhanceMultimodal:x,isImageField:G,isAudioField:$})),re=w||((Se,Je)=>bu(Se,Je,{isMediaColumn:z})),Z=v||((Se,Je)=>gu(Se,Je,{isMediaColumn:z})),ae=S||((Se,Je,{compact:bt}={})=>Gw(Se,Je,{compact:bt,getFieldValue:L,getDisplayText:F})),ee=I==="preview-only",q=I==="image-only",U=I==="chromatic-bento",O=(c!=="auto"?t.find(Se=>Se.key===c&&z(Se,e)):null)||(x?t.find(Se=>z(Se,e)):null),K=t.find(Se=>Se.renderType==="icon"),ne=K&&E?E(e[K.key],e,K):null,fe=SB(ne?.Icon||ne?.icon),he=O?L(O,e):null,me=O?G(O,he):false,ie=O?$(O,he):false,be=t.filter(Se=>Se.key!==O?.key&&Se.renderType!=="icon"),We=be.filter(Se=>{if(!Se||z(Se,e)||!re(Se,e))return false;let Je=L(Se,e);return !(Je==null||Je==="")})[0]||null,Ke=F(We?L(We,e):e.linkKey||e.id),Q=be.filter(Se=>Se&&Se.key!==We?.key&&!z(Se,e)&&Z(Se,e)).map(Se=>({column:Se,text:String(F(L(Se,e)))})),ge=(Q.find(({text:Se})=>Se!=="\u2014"&&Se.length>12)||Q.find(({text:Se})=>Se!=="\u2014"))?.column||null,we=ge?F(L(ge,e)):"",Ie=new Set(P),oe=be.filter(Se=>Se.key!==We?.key&&Se.key!==ge?.key&&!Ie.has(Se.key)),xe=vB({density:p,visibility:g,limit:f}),Ve=Number.isFinite(xe)?oe.slice(0,xe):oe,_e=p==="detailed",Ge=xB(u,p),le=wB(p),Me=CB(Ge),Ae=b==="lines",J=q?n?"block h-auto w-full":"block h-auto w-full transition-transform duration-500 group-hover:scale-[1.02]":kB(p,d),$e=typeof B=="function"?B({row:e,mediaColumn:O,mediaValue:he,isImageMedia:me,isAudioMedia:ie,iconVisual:ne,IconComponent:fe,previewClassName:J}):null,ue={row:e,contentColumns:be,detailColumns:oe,titleColumn:We,summaryColumn:ge,getDisplayText:F,getFieldValue:L},Re=N?.(ue)??null,se=D?.({...ue,iconVisual:ne})??null,te=!se&&ne?jsxRuntime.jsx("div",{className:m("flex h-9 w-9 items-center justify-center rounded-lg border",ne.chipClassName||"border-primary/20 bg-primary/10 text-primary"),children:rl(ne.Icon||ne.icon,m("h-4 w-4",ne.iconClassName||"text-primary"))}):null,Te=se||te,ze=U?"shrink-0 rounded-full border border-border/40 bg-muted/25 px-2.5 py-1 text-[10px] text-muted-foreground transition-all duration-300 group-hover:border-primary/30 group-hover:bg-primary/10 group-hover:text-primary dark:border-border/35 dark:bg-muted/15":"shrink-0 rounded-md border border-border/40 bg-muted/25 px-2 py-1 text-[10px] text-muted-foreground dark:border-border/35 dark:bg-muted/15",je=U?"rounded-xl border border-border/35 bg-muted/20 px-3 py-2.5 transition-all duration-300 group-hover:border-primary/25 group-hover:bg-primary/5 dark:border-border/30 dark:bg-muted/10":"rounded-lg border border-border/35 bg-muted/20 px-2.5 py-2 dark:border-border/30 dark:bg-muted/10",it=U?"text-[10px] uppercase tracking-[0.14em] text-muted-foreground transition-colors duration-300 group-hover:text-foreground":"text-[10px] uppercase tracking-[0.12em] text-muted-foreground",Y=U?"mt-1.5 text-[11px] text-muted-foreground transition-colors duration-300 group-hover:text-foreground [&_*]:max-w-full [&_pre]:text-[11px] [&_pre]:leading-relaxed":"mt-1.5 text-[11px] text-foreground [&_*]:max-w-full [&_pre]:text-[11px] [&_pre]:leading-relaxed",pe=W?.fieldCount?.(be.length),Be=W?.coverOnlyHint,rt=$e==null&&me&&O?_(he,e.id,O.label):void 0,Ce=$e??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[me&&O?jsxRuntime.jsx("div",{className:m("overflow-hidden bg-card/50",q?"rounded-[inherit] bg-transparent":ee?"rounded-[inherit]":"mb-3 rounded-lg border border-border/70"),children:jsxRuntime.jsx("img",{src:rt,style:Un(rt),alt:typeof he?.alt=="string"?he.alt:typeof he=="string"?he:String(O.label||""),className:J,loading:"lazy",referrerPolicy:"no-referrer",onError:Se=>{Se.currentTarget.onerror=null,Se.currentTarget.src=_("",e.id,O.label);}})}):null,!me&&ne&&ee?jsxRuntime.jsx("div",{className:m("flex items-center justify-center","rounded-[inherit] border py-10",ne.chipClassName||"border-primary/20 bg-primary/5"),children:rl(ne.Icon||ne.icon,m("h-10 w-10",ne.iconClassName||"text-primary"))}):null,ie&&M?jsxRuntime.jsx("div",{className:m(!ee&&"mb-3"),children:jsxRuntime.jsx(M,{filename:String(he)})}):null]}),Xe=n?Hw:null,de=n?.title?.fieldId?t.find(Se=>Se.key===n.title?.fieldId):We,Ee=s?s(e):de?F(L(de,e)):Ke,qe=!!n?.slots?.length,Le=qe||r==="container"?"div":"button";return jsxRuntime.jsxs(Le,{"data-gallery-card":true,"data-card-hover-effect":n?.hover?.effect,type:Le==="button"?"button":void 0,role:qe&&r==="button"&&o?"group":void 0,tabIndex:qe&&r==="button"&&o?0:void 0,onKeyDown:qe&&r==="button"&&o?Se=>{Se.target===Se.currentTarget&&(Se.key==="Enter"||Se.key===" ")&&(Se.preventDefault(),o());}:void 0,onClick:r==="button"?Se=>{(!qe||!Se.target.closest("button,a,input,select,textarea,[role=button],[role=menuitem]"))&&o?.();}:void 0,"aria-label":NB(Ke),className:m("group relative w-full rounded-lg text-left transition-all duration-300",q?"overflow-hidden bg-transparent p-0 shadow-none":ee?"overflow-hidden bg-transparent p-0":m("overflow-hidden border",U&&"shadow-none"),!ee&&!q&&le,!ee&&!q&&(l?U?"border-primary/35 bg-background/85 ring-1 ring-primary/20":"border-primary/40 bg-primary/10 ring-1 ring-primary/30":U?n?"workbench-surface-card":"workbench-surface-card hover:-translate-y-1 hover:border-primary/20":n?"workbench-surface-card":"workbench-surface-card hover:border-primary/30"),ee&&l&&"ring-1 ring-primary/30",q&&(l?"ring-1 ring-primary/30":!n&&"hover:-translate-y-0.5"),d?"block h-full w-full min-w-0":"h-full min-w-0",A),children:[U?jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_right,hsl(var(--primary)/0.18),transparent_40%),radial-gradient(circle_at_bottom_left,hsl(var(--accent)/0.18),transparent_45%)] opacity-0 transition-opacity duration-300",l?"opacity-100":"group-hover:opacity-100")}):null,jsxRuntime.jsxs("div",{className:m("relative z-[1]",(q||ee)&&"rounded-[inherit]"),children:[Xe&&n?jsxRuntime.jsx(Xe,{presentation:n,title:Ee,renderSlot:Se=>i?.(Se,ue),children:Ce}):Ce,!ee&&!q?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[Te?jsxRuntime.jsx("div",{className:"shrink-0",children:Te}):null,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[!n?.title&&jsxRuntime.jsx("div",{className:m("flex items-center gap-2 text-sm font-semibold",U?"text-muted-foreground transition-colors duration-300 group-hover:text-foreground":"text-foreground"),children:jsxRuntime.jsx("span",{className:"truncate",children:r==="container"&&o?jsxRuntime.jsx("button",{type:"button",onClick:o,className:"border-0 bg-transparent p-0 text-left hover:underline",style:{font:"inherit",color:"inherit"},children:Ke}):Ke})}),we&&we!==Ke?jsxRuntime.jsx("div",{className:m("mt-1 text-[11px] leading-5 text-muted-foreground",_e?"line-clamp-4":"line-clamp-2",U&&"transition-colors duration-300 group-hover:text-foreground"),children:we}):null]}),Re??(V(pe)?jsxRuntime.jsx("span",{className:ze,children:pe}):null)]})]}),Ve.length>0?jsxRuntime.jsx("div",{"data-gallery-detail-presentation":b,className:m("mt-3 grid grid-flow-row gap-2",Ae?"grid-cols-1":Me),children:Ve.map(Se=>jsxRuntime.jsxs("div",{className:Ae?"flex min-w-0 items-start gap-2 text-xs":je,children:[Se.label?jsxRuntime.jsx("div",{className:Ae?"shrink-0 text-muted-foreground":it,children:H(Se.label,{column:Se})}):null,jsxRuntime.jsx("div",{className:Ae?"min-w-0 text-foreground":m(Y,!Se.label&&"mt-0"),children:ae(Se,e,{compact:p!=="detailed",surface:"gallery"})})]},`${e.id||e.linkKey}-${Se.key}`))}):null,!We&&!we&&Ve.length===0&&V(Be)?jsxRuntime.jsx("div",{className:m("mt-3 text-[11px] text-muted-foreground",U&&"transition-colors duration-300 group-hover:text-foreground"),children:Be}):null]}):null]})]})}a(hu,"WorkbenchGalleryCard");function jw(e,t){let o=e==="rail"?"horizontal":"vertical";if(t&&t!=="auto"&&t!==o)throw new TypeError(`Gallery layout ${e} requires ${o} scrolling.`);return o}a(jw,"resolveGalleryScrollDirection");function IB(e,t,o,r,n){let i=Array.from({length:t},()=>0),s=0,l=0,d=e.map((c,p)=>{if(n==="rail")return {index:p,left:p*(o+r),top:0,width:o,height:c};if(n==="grid")return p>0&&p%t===0&&(s+=l+r,l=0),l=Math.max(l,c),{index:p,left:p%t*(o+r),top:s,width:o,height:c};let u=i.indexOf(Math.min(...i)),g=i[u];return i[u]=g+c+r,{index:p,left:u*(o+r),top:g,width:o,height:c}});return {placements:d,height:Math.max(0,...d.map(c=>c.top+c.height)),width:n==="rail"?Math.max(0,e.length*(o+r)-r):t*(o+r)-r}}a(IB,"placeWindowedItems");function DB(e,t,o,r,n){let i=t-n,s=t+o+n;return e.filter(l=>{let d=r?l.left:l.top;return d<=s&&d+(r?l.width:l.height)>=i})}a(DB,"visibleWindow");function Kw({items:e,getKey:t,layout:o,cardWidth:r,estimateHeight:n,getScrollOwner:i,railRef:s,tailRef:l,containerProps:d,getItemProps:c,renderItem:p}){let u=o.mode==="rail",g=u?1:o.columnCount,f=Math.max(1,u?r??280:o.columnWidth),b=ho.useRef(null),x=ho.useRef(new Map),y=ho.useRef(),[k,w]=ho.useState({width:f,heights:{}}),[v,h]=ho.useState({start:0,length:u?1280:720}),[S,T]=ho.useState(),[C,R]=ho.useState(),M=e.map(t),I=JSON.stringify(M),B=M.map((L,F)=>k.heights[L]??Math.max(1,n(e[F],f))),N=ho.useMemo(()=>IB(B,g,f,o.gap,u?"rail":o.mode==="grid"?"grid":"masonry"),[JSON.stringify(B),g,f,o.gap,u,o.mode]),D=ho.useCallback(()=>{let L=b.current,F=i();if(!L||!F)return;let G=L.getBoundingClientRect(),$=F.getBoundingClientRect(),_=F.offsetHeight>0?$.height/F.offsetHeight:1,z=u?F.scrollLeft:($.top-G.top)/(_||1)+F.clientTop,re=u?F.clientWidth:F.clientHeight;re<=0||h(Z=>Z.start===z&&Z.length===re?Z:{start:z,length:re});},[i,u]);ho.useLayoutEffect(()=>{D();},[D,N.height,N.width]),ho.useEffect(()=>{let L=i();if(!L)return;let F=0,G=a(()=>{F||(F=requestAnimationFrame(()=>{F=0,D();}));},"update");L.addEventListener("scroll",G,{passive:true}),window.addEventListener("resize",G);let $=typeof ResizeObserver=="function"?new ResizeObserver(G):void 0;return $?.observe(L),b.current&&$?.observe(b.current),()=>{L.removeEventListener("scroll",G),window.removeEventListener("resize",G),$?.disconnect(),cancelAnimationFrame(F);}},[i,D]),ho.useEffect(()=>{if(typeof ResizeObserver!="function")return;let L=new ResizeObserver(F=>{w(G=>{let $={...G.heights},_=G.width!==f;for(let z of F){let re=z.target.dataset.windowKey,Z=z.borderBoxSize?.[0]?.blockSize??z.target.offsetHeight;re!==void 0&&Z>0&&$[re]!==Z&&($[re]=Z,_=true);}return _?{width:f,heights:$}:G});});return y.current=L,x.current.forEach(F=>L.observe(F)),()=>{L.disconnect(),y.current=void 0;}},[f]),ho.useEffect(()=>{let L=new Set(M);w(F=>({width:F.width,heights:Object.fromEntries(Object.entries(F.heights).filter(([G])=>L.has(G)))}));},[I]);let E=a((L,F)=>{let G=x.current.get(L);if(G&&y.current?.unobserve(G),!F){x.current.delete(L);return}F.dataset.windowKey=L,x.current.set(L,F),y.current?.observe(F);},"register"),P=v.length,W=DB(N.placements,v.start,v.length,u,P),H=new Set(W.map(L=>L.index));for(let L of [S,C]){let F=L===void 0?-1:M.indexOf(L);F>=0&&H.add(F);}ho.useLayoutEffect(()=>{if(!C)return;let L=x.current.get(C)?.parentElement;L&&(L.focus(),L.scrollIntoView({block:"nearest",inline:"nearest"}),R(void 0));},[C]);let A={...o,columnWidth:f,itemWidth:f};return jsxRuntime.jsxs("div",{...d,ref:L=>{b.current=L,s&&(s.current=L);},"data-collection-windowed":"","data-collection-total":e.length,style:{...d.style,position:"relative",...u?{overflowX:"auto",height:N.height+12}:{height:N.height},overflowAnchor:"none"},children:[u?jsxRuntime.jsx("div",{"aria-hidden":"true",style:{width:N.width,height:1,pointerEvents:"none"}}):null,Array.from(H).sort((L,F)=>L-F).map(L=>{let F=e[L],G=M[L],$=N.placements[L],_=c(F,A);return jsxRuntime.jsx("div",{..._,"aria-posinset":L+1,"aria-setsize":e.length,onFocus:z=>{T(G),_.onFocus?.(z);},onBlur:z=>{z.currentTarget.contains(z.relatedTarget)||T(void 0),_.onBlur?.(z);},onKeyDown:z=>{if(z.target===z.currentTarget){let re=u?1:g,Z=z.key==="Home"?0:z.key==="End"?e.length-1:z.key==="ArrowRight"?L+1:z.key==="ArrowLeft"?L-1:z.key==="ArrowDown"?L+re:z.key==="ArrowUp"?L-re:void 0;if(Z!==void 0){z.preventDefault(),R(M[Math.min(e.length-1,Math.max(0,Z))]);return}}_.onKeyDown?.(z);},style:{..._.style,position:"absolute",left:$.left,top:$.top,width:$.width},children:jsxRuntime.jsx("div",{ref:z=>E(G,z),children:p(F,A)})},G)}),l?jsxRuntime.jsx("div",{ref:l,"aria-hidden":"true",style:{position:"absolute",left:Math.max(0,N.width-1),top:0,width:1,height:1}}):null]})}a(Kw,"WorkbenchWindowedLayout");var AB=12,BB=8,Xw=280,Zw=240,LB=typeof window>"u"?ho.useEffect:ho.useLayoutEffect;function wu(e,t,o){return Math.min(Math.max(e,t),o)}a(wu,"clamp");function WB(e){if(typeof window>"u")return 16;let t=e||document.documentElement,o=Number.parseFloat(window.getComputedStyle(t).fontSize);return Number.isFinite(o)&&o>0?o:16}a(WB,"getRootFontSize");function ku(e,t,o){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let r=e.trim().toLowerCase();if(!r)return t;if(/^\d+(\.\d+)?$/.test(r)){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("px")){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("rem")){let n=Number.parseFloat(r);return !Number.isFinite(n)||n<=0?t:n*WB(o)}return t}a(ku,"resolveLengthToPixels");function Qw(e,t){let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return false;for(let n of r)if(e[n]!==t[n])return false;return true}a(Qw,"areMeasurementMapsEqual");function zB({containerWidth:e,itemCount:t,targetColumnWidth:o,gap:r}){if(!e)return 1;let n=Math.max(t,1),i=Math.max(1,Math.min(n,Math.ceil((e+r)/(Math.max(o*.58,1)+r)))),s=1,l=Number.POSITIVE_INFINITY;for(let d=1;d<=i;d+=1){let c=(e-r*Math.max(d-1,0))/d;if(!Number.isFinite(c)||c<=0)continue;let p=Math.max(0,o*.78-c),u=Math.max(0,c-o*1.35),g=Math.abs(c-o)+p*3+u*2;g<l&&(l=g,s=d);}return s}a(zB,"getMasonryColumnCount");function OB({size:e,columnWidth:t,columnCount:o,gap:r}){if(Number.isFinite(e?.columnSpan)&&Number(e?.columnSpan)>0)return wu(Math.round(Number(e?.columnSpan)),1,o);let n=ku(e?.width,t,null);return wu(Math.ceil((n+r)/(t+r)),1,o)}a(OB,"getItemColumnSpan");function FB({size:e,measuredHeight:t,rowHeight:o,gap:r}){if(Number.isFinite(e?.rowSpan)&&Number(e?.rowSpan)>0)return Math.max(1,Math.round(Number(e?.rowSpan)));let n=Number.isFinite(t)&&Number(t)>0?Number(t):ku(e?.height,Zw,null);return Math.max(1,Math.ceil((n+r)/(o+r)))}a(FB,"getItemRowSpan");function HB({size:e,measuredHeight:t}){return Number.isFinite(t)&&Number(t)>0?Number(t):ku(e?.height,Zw,null)}a(HB,"getResolvedItemHeight");function Yi({items:e=[],renderItem:t,getItemKey:o=a((g,f)=>g?.id??g?.key??f,"getItemKey"),getItemSize:r,columnWidth:n=Xw,columnCount:i,gap:s=AB,rowHeight:l=BB,placementStrategy:d="shelf",containerProps:c,getItemProps:p,className:u}){let g=ho.useRef(null),f=ho.useRef(new Map),b=ho.useRef(null),[x,y]=ho.useState(0),[k,w]=ho.useState({}),v=ho.useMemo(()=>e.map((N,D)=>String(o(N,D))),[o,e]),h=v.join("|");ho.useEffect(()=>{let N=g.current;if(!N)return;let D=a(()=>{let E=Math.round(N.getBoundingClientRect().width);y(P=>P===E?P:E);},"updateWidth");if(D(),typeof ResizeObserver=="function"){let E=new ResizeObserver(()=>D());return E.observe(N),()=>E.disconnect()}return window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]),ho.useEffect(()=>{w(N=>{let D=new Set(v),E=Object.fromEntries(Object.entries(N).filter(([P])=>D.has(P)));return Qw(N,E)?N:E});},[v,h]);let S=ku(n,Xw,g.current),T=d==="dense",R=(Number.isFinite(i)&&Number(i)>0?wu(Math.round(Number(i)),1,24):void 0)||zB({containerWidth:x,itemCount:e.length,targetColumnWidth:S,gap:s}),M=x>0?(x-s*Math.max(R-1,0))/R:S,I=ho.useMemo(()=>e.map((N,D)=>{let E=v[D],P=typeof r=="function"?r(N,{columnCount:R,columnWidth:M,containerWidth:x,gap:s,placementStrategy:d,rowHeight:l})||{}:{};return {key:E,item:N,size:P,columnSpan:OB({size:P,columnWidth:M,columnCount:R,gap:s}),rowSpan:FB({size:P,measuredHeight:k[E],rowHeight:l,gap:s})}}),[R,x,s,r,v,e,k,d,M,l]);LB(()=>{let N={};f.current.forEach((D,E)=>{let P=Math.ceil(D.getBoundingClientRect().height);Number.isFinite(P)&&P>0&&(N[E]=P);}),w(D=>{if(!Object.keys(N).length)return D;let E={...D,...N};return Qw(D,E)?D:E});},[R,T,h,M]),ho.useEffect(()=>{if(typeof ResizeObserver!="function")return;let N=new ResizeObserver(D=>{w(E=>{let P={...E},W=false;for(let H of D){let A=H.target.dataset.masonryKey;if(!A)continue;let L=Math.ceil(H.contentRect.height);!Number.isFinite(L)||L<=0||P[A]===L||(P[A]=L,W=true);}return W?P:E});});return b.current=N,f.current.forEach(D=>N.observe(D)),()=>{N.disconnect(),b.current=null;}},[T,h]);let B=a((N,D)=>{let E=f.current,P=E.get(N);if(P&&P!==D&&b.current&&b.current.unobserve(P),!D){E.delete(N);return}D.dataset.masonryKey=N,E.set(N,D),b.current&&b.current.observe(D);},"registerItemNode");if(!T){let N=(()=>{let D=Array.from({length:R},()=>0),E=0,P=0,W=I.map(({key:H,item:A,columnSpan:L,rowSpan:F,size:G})=>{let $=wu(L,1,R),_=E;if(d==="shortest"){let q=Number.POSITIVE_INFINITY;for(let U=0;U<=R-$;U+=1){let X=Math.max(...D.slice(U,U+$));X<q&&(q=X,_=U);}}else _+$>R&&(_=0),_=Math.min(_,R-$);let z=M*$+s*Math.max($-1,0),re=HB({size:G,measuredHeight:k[H]}),Z=Math.max(...D.slice(_,_+$)),ae=_*(M+s),ee=Z+re;for(let q=_;q<_+$;q+=1)D[q]=ee+s;return P=Math.max(P,ee),d!=="shortest"&&(E=_+$,E>=R&&(E=0)),{key:H,item:A,columnSpan:$,itemHeight:re,itemWidth:z,left:ae,rowSpan:F,size:G,top:Z}});return {containerHeight:Math.max(0,P),positionedItems:W}})();return jsxRuntime.jsx("div",{ref:g,...c,className:m("relative w-full",u,c?.className),style:{...c?.style,height:`${N.containerHeight}px`},children:N.positionedItems.map(({key:D,item:E,columnSpan:P,rowSpan:W,size:H,itemWidth:A,left:L,top:F})=>{let G=x<=0&&R===1,$=G?"100%":`${A}px`,_={columnCount:R,columnSpan:P,columnWidth:M,containerWidth:x,gap:s,itemWidth:A,placementStrategy:d,rowSpan:W,rowHeight:l,size:H},z=p?.(E,_);return jsxRuntime.jsx("div",{...z,className:m("absolute min-w-0",z?.className),style:{...z?.style,left:G?0:`${L}px`,top:`${F}px`,width:$,maxWidth:$},children:jsxRuntime.jsx("div",{ref:re=>B(D,re),role:"presentation",className:"min-w-0",children:t(E,_)})},D)})})}return jsxRuntime.jsx("div",{ref:g,...c,className:m("grid w-full items-start",u,c?.className),style:{...c?.style,gap:`${s}px`,gridAutoFlow:"row dense",gridAutoRows:`${l}px`,gridTemplateColumns:`repeat(${R}, minmax(0, 1fr))`},children:I.map(({key:N,item:D,columnSpan:E,rowSpan:P,size:W})=>{let H={columnCount:R,columnSpan:E,columnWidth:M,containerWidth:x,gap:s,placementStrategy:d,rowSpan:P,rowHeight:l,size:W},A=p?.(D,H);return jsxRuntime.jsx("div",{...A,className:m("min-w-0",A?.className),style:{...A?.style,gridColumn:`span ${E}`,gridRow:`span ${P}`},children:jsxRuntime.jsx("div",{ref:L=>B(N,L),role:"presentation",className:"min-w-0",children:t(D,H)})},N)})})}a(Yi,"WorkbenchMasonryLayout");var _B=12,GB=[1],$B=[4/3],jB=[1,4/5,3/2,3/4,5/4],UB=.5,KB=2,qB="hsl(var(--monkeys-color-muted, var(--muted)))";function Cu(e,t,o){return Math.min(Math.max(e,t),o)}a(Cu,"clamp");function Wf(e,t,o){return typeof e!="number"||!Number.isFinite(e)||e<=0?t:Cu(Math.round(e),1,o)}a(Wf,"normalizeCount");function YB(e){return e==="masonry"||e==="dense"?jB:e==="rail"?$B:GB}a(YB,"getDefaultAspectRatios");function XB(e,t){let o=t?.filter(r=>typeof r=="number"&&Number.isFinite(r)&&r>0).map(r=>Cu(r,UB,KB));return o?.length?o:YB(e)}a(XB,"resolveAspectRatios");function ek(e){return Wf(e?.count,_B,48)}a(ek,"resolveWorkbenchCollectionSkeletonCapacity");function tk(e){if(e===void 0)return "skeleton";if(e==="skeleton"||e==="spinner")return e;throw new TypeError('WorkbenchCollection loading.variant must be "skeleton" or "spinner".')}a(tk,"resolveWorkbenchCollectionLoadingVariant");function QB({columnCount:e,config:t,phase:o}){if(o==="initial"){let n=Cu(e*2,6,24);return Wf(t?.count,n,48)}let r=Cu(e,1,12);return Wf(t?.loadMoreCount,r,24)}a(QB,"resolveSkeletonCount");function Jw(e,t){return Math.max(1,e/t)}a(Jw,"getSkeletonHeight");function zf({mode:e,phase:t,columnCount:o,columnWidth:r,cardWidth:n,gap:i,rowHeight:s,config:l,ariaLabel:d,className:c}){let p=QB({columnCount:o,config:l,phase:t}),u=XB(e,l?.aspectRatios),g=l?.animated??true,f=ho.useMemo(()=>Array.from({length:p},(x,y)=>({aspectRatio:u[y%u.length],key:`${t}-${y}`,index:y})),[u,p,t]),b=a((x,y)=>jsxRuntime.jsx(Qd,{index:x.index,children:jsxRuntime.jsx(na,{variant:"block",animated:g,className:"h-auto w-full rounded-lg",style:{backgroundColor:qB,...y??{aspectRatio:String(x.aspectRatio)}},"data-collection-skeleton-item":"","data-skeleton-aspect-ratio":x.aspectRatio})}),"renderSkeleton");return jsxRuntime.jsx(qn,{animation:l?.animation,animated:g,children:jsxRuntime.jsx("div",{role:"status","aria-label":d,"aria-atomic":"true","data-collection-loading":t,"data-layout-mode":e,className:"min-w-0",children:e==="masonry"||e==="dense"?jsxRuntime.jsx(Yi,{items:f,columnCount:o,columnWidth:r,gap:i,rowHeight:s,placementStrategy:e==="dense"?"dense":"shortest",className:c,containerProps:{"aria-hidden":true},getItemKey:x=>x.key,getItemSize:(x,y)=>({height:Jw(y.columnWidth,x.aspectRatio)}),renderItem:(x,y)=>b(x,{height:`${Jw(y.columnWidth,x.aspectRatio)}px`})}):e==="rail"?jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("grid min-w-0 grid-flow-col items-start overflow-x-auto",c),style:{gap:i,gridAutoColumns:typeof n=="number"?`${n}px`:n??`${r}px`},children:f.map(x=>jsxRuntime.jsx("div",{children:b(x)},x.key))}):jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("grid min-w-0 items-start",c),style:{gap:i,gridTemplateColumns:`repeat(${o}, minmax(0, 1fr))`},children:f.map(x=>jsxRuntime.jsx("div",{children:b(x)},x.key))})})})}a(zf,"WorkbenchCollectionSkeleton");function JB(e,t){if(e.size!==t.size)return false;for(let o of e)if(!t.has(o))return false;return true}a(JB,"setsEqual");function e5(e){return String(e)}a(e5,"getComparableKey");function t5(e){return e==="multiple"?"toggle":"replace"}a(t5,"getDefaultBehavior");function Su({items:e,getItemKey:t,mode:o="none",behavior:r,selectedKeys:n,defaultSelectedKeys:i,isItemDisabled:s,onSelectionChange:l}){let d=n!==void 0,[c,p]=ho.useState(()=>new Set(i??[])),u=ho.useRef(null),g=ho.useRef(l);g.current=l;let f=ho.useMemo(()=>{let h=new Map;return e.map((S,T)=>{let C=t(S,T),R=e5(C),M=h.get(R);if(M!==void 0)throw new TypeError(`useWorkbenchCollectionSelection received duplicate item key "${R}" at indices ${M} and ${T}.`);return h.set(R,T),{item:S,index:T,key:C}})},[t,e]),b=ho.useMemo(()=>{let h=new Map;return f.forEach(S=>h.set(S.key,S)),h},[f]),x=ho.useMemo(()=>o==="none"?new Set:d?new Set(n??[]):c,[d,n,c,o]),y=ho.useRef(x);y.current=x;let k=ho.useCallback(()=>{u.current=null;},[]);ho.useEffect(()=>{if(d)return;let h=new Set(f.map(({key:S})=>S));p(S=>{let T=new Set(Array.from(S).filter(C=>h.has(C)));return JB(S,T)?S:(y.current=T,T)});},[d,f]),ho.useEffect(()=>{let h=u.current;if(o!=="multiple"||x.size===0||h===null){k();return}let S=b.get(h);(!S||s?.(S.item,S.index))&&k();},[s,b,o,k,x.size]);let w=ho.useCallback((h,S={})=>{if(o==="none")return;let T=b.get(h);if(!T||s?.(T.item,T.index))return;let C=new Set(y.current),R=r??t5(o),M=S.shiftKey&&o==="multiple"?"range":S.behavior??R;o==="single"&&(M=M==="toggle"?"toggle":"replace");let I=u.current===null?void 0:b.get(u.current),B=!!(I&&!s?.(I.item,I.index));o==="multiple"&&M==="range"&&!B&&(M=R==="range"?"toggle":R);let N=new Set;if(o==="single")M==="toggle"&&C.has(T.key)||N.add(T.key);else if(M==="range"&&I){C.forEach(P=>N.add(P));let D=Math.min(I.index,T.index),E=Math.max(I.index,T.index);f.slice(D,E+1).forEach(P=>{s?.(P.item,P.index)||N.add(P.key);});}else M==="replace"?N.add(T.key):(C.forEach(D=>N.add(D)),N.has(T.key)?N.delete(T.key):N.add(T.key));u.current=o==="multiple"?T.key:null,d||(y.current=N,p(N)),g.current?.(N,{item:T.item,index:T.index,key:T.key,behavior:M});},[r,d,s,b,o,f]),v=ho.useCallback(h=>x.has(h),[x]);return {mode:o,selectedKeys:x,isSelected:v,selectKey:w,resetAnchor:k}}a(Su,"useWorkbenchCollectionSelection");var Gf=12,n5=8,Nu=280,a5=640,i5=1024,ik=24;function Ru(e,t,o){return Math.min(Math.max(e,t),o)}a(Ru,"clamp");function Rr(e,t){return typeof e=="function"?e(t):e}a(Rr,"resolveRenderableSlot");function Qi(e,t,o){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let r=e.trim().toLowerCase();if(!r)return t;if(/^\d+(\.\d+)?(px)?$/.test(r)){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("rem")){let n=Number.parseFloat(r),i=typeof window>"u"?16:Number.parseFloat(window.getComputedStyle(o||document.documentElement).fontSize)||16;return Number.isFinite(n)&&n>0?n*i:t}return t}a(Qi,"resolveLengthToPixels");function Tu(e){if(!(typeof e!="number"||!Number.isFinite(e)||e<=0))return Ru(Math.round(e),1,ik)}a(Tu,"normalizeColumns");function rk(e,t){if(e==="auto"||e===void 0)return;if(typeof e=="number")return Tu(e);let o=Tu(e.mobile),r=Tu(e.tablet),n=Tu(e.desktop);return t>=i5?n??r??o:t>=a5?r??o??n:o??r??n}a(rk,"resolveResponsiveColumns");function s5({containerWidth:e,itemCount:t,gap:o,columns:r,underfilledBehavior:n,maxColumns:i,minCardWidth:s,idealCardWidth:l,maxCardWidth:d,node:c}){let p=rk(r,e),u=rk(i,e);if(p)return u?Math.min(p,u):p;if(!e)return 1;let g=Qi(l,Nu,c),f=Qi(s,g*.78,c),b=Math.max(f,Qi(d,g*1.35,c)),x=Math.max(t,1),y=Math.max(1,Math.min(n==="preserve-columns"?ik:x,Math.ceil((e+o)/(Math.max(f*.75,1)+o)))),k=1,w=Number.POSITIVE_INFINITY;for(let v=1;v<=y;v+=1){let h=(e-o*Math.max(v-1,0))/v;if(!Number.isFinite(h)||h<=0)continue;let S=Math.abs(h-g)+Math.max(0,f-h)*3+Math.max(0,h-b)*2;S<w&&(w=S,k=v);}return u?Math.min(k,u):k}a(s5,"resolveColumnCount");function nk(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:Gf}a(nk,"normalizeGap");function l5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n5}a(l5,"normalizeRowHeight");function d5(e){return typeof e=="number"&&Number.isFinite(e)?Ru(e,0,1):0}a(d5,"normalizeThreshold");function c5(e,t,o){let r=Number.isFinite(t)&&Number(t)>0?Number(t):void 0,n=e?.height??(r?Math.max(1,o/r):void 0);return {...e,height:n}}a(c5,"normalizeItemSize");function u5(e,t){if(e&&typeof e=="object"){let o=e;if(typeof o.id=="string"||typeof o.id=="number")return o.id;if(typeof o.key=="string"||typeof o.key=="number")return o.key}return t}a(u5,"getDefaultItemKey");function p5(e){return `@inf-monkeys-tech/monkeys-design:workbench-collection:${e}`}a(p5,"getScrollStorageKey");function m5(e){let t=e?.parentElement??null;for(;t;){if(typeof window>"u")return t;let o=window.getComputedStyle(t).overflowY;if(o==="auto"||o==="scroll")return t;t=t.parentElement;}return null}a(m5,"getParentScrollOwner");function ak(e,t){if(typeof Element>"u"||!(e instanceof Element)||e===t)return false;let o=e.closest('a, button, input, select, textarea, summary, [contenteditable="true"], [data-collection-action]');return !!(o&&t.contains(o))}a(ak,"isInteractiveEventTarget");function f5(e){if(!(!Number.isFinite(e)||Number(e)<=0))return Ru(Math.round(Number(e)),1,12)}a(f5,"normalizeTitleMaxLines");function kn({items:e,config:t,renderItem:o,slots:r,callbacks:n,className:i,classNames:s,style:l,ariaLabel:d}){let c=ke(),p=Ye().workbench.collection,u=Wr(),g=On(),f=ho.useId().replace(/:/g,""),b=ho.useRef(null),x=ho.useRef(null),y=ho.useRef(null),k=ho.useRef(null),w=ho.useRef(false),v=ho.useRef(false),h=ho.useRef(false),S=ho.useRef(false),T=ho.useRef(null),C=ho.useRef(null),R=ho.useRef(void 0),M=ho.useRef(false),[I,B]=ho.useState(0),[N,D]=ho.useState(Gf),[E,P]=ho.useState(null),W=ho.useRef(n);W.current=n;let H=ho.useCallback(de=>{y.current=de,P(de);},[]),A=t.layout.mode;if(A!=="grid"&&A!=="masonry"&&A!=="dense"&&A!=="rail")throw new TypeError(`WorkbenchCollection layout.mode "${String(A)}" is not supported.`);let L=t.layout.gap===void 0?N:nk(t.layout.gap),F=l5(t.layout.rowHeight),G=t.getItemKey??u5,$=ho.useMemo(()=>e.map((de,Ee)=>{let qe=G(de,Ee);return {item:de,index:Ee,key:qe,stringKey:String(qe)}}),[G,e]),_=$.map(({stringKey:de})=>de).join(""),z=t.state,re=z?.loading===true,Z=z?.loadingMore===true,ae=z?.hasMore===true,ee=tk(t.loading?.variant),q=re&&$.length===0&&ee==="skeleton"?ek(t.loading?.skeleton):$.length,U=t.selection?.mode??"none",X=ho.useCallback(de=>t.selection?.isItemDisabled?.(de.item,de.index)??false,[t.selection?.isItemDisabled]),O=ho.useCallback(de=>de.key,[]),K=ho.useCallback((de,Ee)=>{W.current?.onSelectionChange?.(de,{item:Ee.item.item,key:Ee.key,behavior:Ee.behavior});},[]),{selectedKeys:ne,selectKey:fe}=Su({items:$,getItemKey:O,mode:U,behavior:t.selection?.behavior,selectedKeys:t.selection?.selectedKeys,defaultSelectedKeys:t.selection?.defaultSelectedKeys,isItemDisabled:X,onSelectionChange:K});ho.useEffect(()=>{let de=E;if(!de)return;let Ee=a(()=>{if(t.layout.gap===void 0&&b.current){let Le=Number.parseFloat(window.getComputedStyle(b.current).columnGap);D(Number.isFinite(Le)&&Le>=0?Le:Gf);}let qe=de.clientWidth;B(Le=>Le===qe?Le:qe);},"updateWidth");if(Ee(),typeof ResizeObserver=="function"){let qe=new ResizeObserver(Ee);return qe.observe(de),()=>qe.disconnect()}if(!(typeof window>"u"))return window.addEventListener("resize",Ee),()=>window.removeEventListener("resize",Ee)},[E,t.layout.gap,l?.gap,g]);let he=s5({containerWidth:I,itemCount:q,gap:L,columns:t.layout.columns,underfilledBehavior:t.layout.underfilledBehavior,maxColumns:t.layout.maxColumns,minCardWidth:t.layout.minCardWidth,idealCardWidth:t.layout.idealCardWidth??t.layout.columnWidth,maxCardWidth:t.layout.maxCardWidth,node:y.current}),me=I>0?Math.max(0,(I-L*Math.max(he-1,0))/he):Qi(t.layout.cardWidth??t.layout.columnWidth??t.layout.idealCardWidth,Nu,y.current),ie=t.layout.placementStrategy??(A==="dense"?"dense":A==="masonry"?"shortest":"shelf"),be=ho.useMemo(()=>({collection:t.labels?.collection??p.label,loading:t.labels?.loading??p.loading,empty:t.labels?.empty??p.empty,loadError:t.labels?.loadError??p.loadError,refreshError:t.labels?.refreshError??p.refreshError,retry:t.labels?.retry??p.retry,loadingMore:t.labels?.loadingMore??p.loadingMore,permission:t.labels?.permission??p.permission,offline:t.labels?.offline??p.offline,requestAccess:t.labels?.requestAccess??p.requestAccess}),[t.labels,p]),He=ho.useMemo(()=>{let de=t.virtualization;return de?.enabled!==true||de.fallback!=="error"?null:de.adapter?de.adapter.supports?.(A)===false?new Error(`WorkbenchCollection virtualization adapter does not support mode "${A}".`):null:new Error("WorkbenchCollection virtualization requires an adapter.")},[t.virtualization,A]),We=ho.useMemo(()=>({mode:A,columnCount:he,columnWidth:me,containerWidth:I,gap:L,itemCount:$.length}),[he,me,I,L,A,$.length]);ho.useEffect(()=>{W.current?.onLayoutChange?.(We),I>0&&!M.current&&(M.current=true,W.current?.onLayoutReady?.(We));},[We,I]),ho.useEffect(()=>{M.current=false;},[A]);let Ke=ho.useCallback(()=>{let de=t.layout.scrollOwner;return de&&de!=="self"&&de!=="parent"?de:A==="rail"?x.current:de==="parent"?m5(b.current):b.current},[t.layout.scrollOwner,A]);ho.useEffect(()=>{let de=t.scrollRestorationKey?.trim();if(!de||typeof window>"u")return;let Ee=Ke();if(!Ee)return;let qe=p5(de);try{let Se=Number.parseFloat(window.sessionStorage.getItem(qe)??"");Number.isFinite(Se)&&Se>=0&&(Ee.scrollTop=Se);}catch{}let Le=a(()=>{try{window.sessionStorage.setItem(qe,String(Ee.scrollTop));}catch{}},"saveScrollPosition");return Ee.addEventListener("scroll",Le,{passive:true}),()=>{Le(),Ee.removeEventListener("scroll",Le);}},[t.scrollRestorationKey,Ke]);let ce=typeof n?.onLoadMore=="function",Q=z?.error??He;ho.useEffect(()=>{(!ce||!ae)&&(v.current=false,h.current=false,S.current=false);},[ce,ae]);let ge=ho.useCallback(()=>{if(!ce||!ae||Z||w.current)return;w.current=true;let de=a(()=>{w.current=false;},"releaseRequest");try{let Ee=W.current?.onLoadMore?.();Ee&&typeof Ee.then=="function"?Ee.then(de,de):de();}catch(Ee){throw de(),Ee}},[ce,ae,Z]);ho.useEffect(()=>{let de=k.current;if((T.current!==de||C.current!==_||R.current!==t.loading?.pageKey)&&(T.current=de,C.current=_,R.current=t.loading?.pageKey,v.current=false,h.current=false,S.current=false),!de||!ce||!ae||typeof IntersectionObserver!="function")return;let Ee=Ke(),qe=false,Le=true,Se=new IntersectionObserver(xt=>{if(!Le)return;let Gt=xt.some(wa=>wa.isIntersecting);if(!(Gt&&(Z||w.current))){if(S.current){if(qe=true,S.current=false,v.current=Gt,!Gt){h.current=false;return}if(h.current)return;h.current=true,ge();return}if(!qe){qe=true,v.current=Gt,Gt||(h.current=false),Gt&&t.loading?.autoFill&&!h.current&&(h.current=true,ge());return}if(!Gt){v.current=false,h.current=false;return}v.current||(v.current=true,h.current=true,ge());}},{root:Ee===b.current?Ee:Ee||null,rootMargin:t.loading?.rootMargin??"240px",threshold:d5(t.loading?.threshold)}),Je=Ee??(typeof window>"u"?null:window),bt=a(()=>{!v.current||h.current||S.current||(S.current=true,Se.unobserve(de),Se.takeRecords(),Se.observe(de));},"validateActiveIntersection");return Se.observe(de),Je?.addEventListener("scroll",bt,{passive:true}),()=>{Le=false,Se.disconnect(),Je?.removeEventListener("scroll",bt);}},[ce,t.loading?.autoFill,t.loading?.pageKey,t.loading?.rootMargin,t.loading?.threshold,ae,_,Z,$.length,ge,Ke]),ho.useEffect(()=>{if(!t.loading?.autoFill||!ce||!ae||Z||h.current||w.current||!k.current)return;let Ee=Ke()??(t.layout.scrollOwner==="parent"?b.current?.parentElement??null:null)??b.current;if(!Ee)return;let qe=A==="rail"?Ee.clientWidth:Ee.clientHeight,Le=A==="rail"?Ee.scrollWidth:Ee.scrollHeight;qe<=0||Le<=qe+1&&(h.current=true,ge());},[ce,t.layout.scrollOwner,t.loading?.autoFill,t.loading?.pageKey,ae,_,Z,$.length,ge,Ke,A]);let we=ho.useMemo(()=>{if(!t.grouping)return [{key:"__all__",stringKey:"__all__",items:$}];let de=new Map;return $.forEach(Ee=>{let qe=t.grouping?.getGroupKey(Ee.item,Ee.index)??"__all__",Le=String(qe),Se=de.get(Le);if(Se){Se.items.push(Ee);return}de.set(Le,{key:qe,stringKey:Le,label:t.grouping?.getGroupLabel?.(qe,Ee.item),items:[Ee]});}),Array.from(de.values())},[t.grouping,$]),Ie=ho.useCallback((de,Ee)=>{let qe=t.selection?.isItemDisabled?.(de.item,de.index)??false,Le={item:de.item,index:de.index,key:de.key,status:t.getItemStatus?.(de.item,de.index)??"idle",disabled:qe,selected:ne.has(de.key),selectionMode:U,layout:Ee,select:a(Se=>fe(de.key,{behavior:Se}),"select"),selectFromEvent:a((Se,Je)=>fe(de.key,{behavior:Je,shiftKey:Se.shiftKey}),"selectFromEvent"),preview:a(()=>n?.onItemPreview?.(de.item,Le),"preview"),detail:a(()=>n?.onItemDetail?.(de.item,Le),"detail"),renderSlot:a(Se=>r?.item?.[Se]?.(de.item,Le),"renderSlot"),notifyMediaLoad:a(()=>n?.onMediaLoad?.(de.item,Le),"notifyMediaLoad"),notifyMediaError:a(Se=>n?.onMediaError?.(de.item,Le,Se),"notifyMediaError")};return Le},[n,t.getItemStatus,t.selection,ne,fe,U,r?.item]),oe=ho.useCallback((de,Ee)=>{let qe=a(Le=>{Le.target!==Le.currentTarget||Le.key!=="Enter"&&Le.key!==" "||(Le.preventDefault(),U!=="none"?Ee.selectFromEvent(Le):n?.onItemClick?.(de.item,Ee,Le));},"handleKeyboard");return {id:`${f}-item-${de.index}`,"data-monkeys-collection-item":"","data-item-key":de.stringKey,"data-selected":Ee.selected||void 0,"data-disabled":Ee.disabled||void 0,"data-status":Ee.status,role:U==="none"?"listitem":"option","aria-selected":U==="none"?void 0:Ee.selected,"aria-disabled":Ee.disabled||void 0,tabIndex:n?.onItemClick||U!=="none"||t.item?.title?.visibility==="hover"?0:void 0,draggable:n?.onItemDragStart?true:void 0,className:m("min-w-0 group/workbench-collection-item outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t.appearance?.hover&&t.appearance.hover!=="none"&&"transition-[transform,box-shadow,background-color] duration-200",t.appearance?.hover==="highlight"&&"hover:bg-muted/30",t.appearance?.hover==="lift"&&"hover:-translate-y-0.5 motion-reduce:transform-none",t.appearance?.hover==="scale"&&"hover:scale-[1.01] motion-reduce:transform-none",t.appearance?.hover==="shadow"&&"hover:shadow-md",t.appearance?.hover==="lift-shadow"&&"hover:-translate-y-0.5 hover:shadow-md motion-reduce:transform-none",t.appearance?.selection==="ring"&&Ee.selected&&"ring-2 ring-primary",t.appearance?.selection==="outline"&&Ee.selected&&"outline outline-2 outline-primary",s?.item),onClick:a(Le=>{ak(Le.target,Le.currentTarget)||(U!=="none"&&Ee.selectFromEvent(Le),n?.onItemClick?.(de.item,Ee,Le));},"onClick"),onDoubleClick:a(Le=>{ak(Le.target,Le.currentTarget)||n?.onItemDoubleClick?.(de.item,Ee,Le);},"onDoubleClick"),onMouseEnter:a(Le=>n?.onItemHoverChange?.(de.item,Ee,true,Le),"onMouseEnter"),onMouseLeave:a(Le=>n?.onItemHoverChange?.(de.item,Ee,false,Le),"onMouseLeave"),onKeyDown:qe,onDragStart:a(Le=>n?.onItemDragStart?.(de.item,Ee,Le),"onDragStart"),onDragOver:n?.onItemDrop?Le=>Le.preventDefault():void 0,onDrop:a(Le=>n?.onItemDrop?.(de.item,Ee,Le),"onDrop")}},[n,s?.item,f,t.appearance,t.item?.title?.visibility,U]),xe=ho.useCallback((de,Ee)=>{let qe=o(de.item,Ee),Le=t.item?.title,Se=Le?.visibility??"always",Je=Le&&Se!=="never"?Le.getContent?.(de.item,Ee)??Ee.renderSlot("title"):null,bt=!!(Le&&V(Je)),xt=Le?.placement??"below",Gt=bt&&xt.startsWith("overlay-"),wa=f5(Le?.maxLines),en=Le?.surface??(Gt?"scrim":"none"),ms=bt?jsxRuntime.jsx("div",{"data-collection-item-title":"","data-title-placement":xt,"data-title-visibility":Se,className:m("min-w-0 px-1 py-2 text-sm font-medium text-foreground",Le?.align==="center"&&"text-center",Le?.align==="end"&&"text-right",Se==="hover"&&"!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100",Gt&&"pointer-events-none absolute inset-x-0 z-10 px-3 py-2",xt==="overlay-top"&&"top-0",xt==="overlay-center"&&"top-1/2 -translate-y-1/2 motion-reduce:transform-none",xt==="overlay-bottom"&&"bottom-0",en==="surface"&&"bg-background/90 backdrop-blur-sm",en==="scrim"&&xt==="overlay-top"&&"bg-gradient-to-b from-background/90 to-transparent pb-8",en==="scrim"&&xt==="overlay-bottom"&&"bg-gradient-to-t from-background/90 to-transparent pt-8",en==="scrim"&&xt==="overlay-center"&&"bg-background/75 backdrop-blur-sm",!!wa&&"overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]",s?.itemTitle),style:wa?{WebkitLineClamp:wa}:void 0,children:Je}):null,Eo=t.item?.actions,Za=Eo?.visibility??"always",fs=Eo&&Za!=="never"?Ee.renderSlot("actions"):null,ka=!!(Eo&&V(fs)),gr=Eo?.placement??"overlay-bottom",Ja=ka&&gr.startsWith("overlay-"),bs=ka?jsxRuntime.jsx("div",{"data-collection-item-actions":"","data-actions-placement":gr,"data-actions-align":Eo?.align??"center","data-actions-visibility":Za,className:m("flex min-w-0 items-center gap-2 px-2 py-2",Eo?.align==="start"&&"justify-start",(Eo?.align===void 0||Eo.align==="center")&&"justify-center",Eo?.align==="end"&&"justify-end",Eo?.wrap!==false&&"flex-wrap",Za==="hover"&&"!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100 [@media(hover:none)]:!opacity-100",Ja&&"pointer-events-none absolute inset-x-0 z-20",gr==="overlay-top"&&"top-1",gr==="overlay-bottom"&&"bottom-1",s?.itemActions),children:jsxRuntime.jsx("div",{className:m("pointer-events-auto flex items-center gap-2",Eo?.wrap!==false&&"flex-wrap"),children:fs})}):null;return !bt&&!ka?qe:jsxRuntime.jsxs("div",{className:m("min-w-0",(Gt||Ja)&&"relative",s?.itemContent),"data-collection-item-content":"",children:[xt==="above"?ms:null,gr==="above"?bs:null,qe,xt==="below"||Gt?ms:null,gr==="below"||Ja?bs:null]})},[s?.itemActions,s?.itemContent,s?.itemTitle,t.item,o]),Ve=ho.useCallback((de,Ee,qe=true)=>{let Le=Ie(de,Ee),Se=xe(de,Le);return qe?jsxRuntime.jsx("div",{...oe(de,Le),children:Se}):Se},[Ie,oe,xe]),_e=ho.useMemo(()=>({mode:A,columnCount:he,columnWidth:me,containerWidth:I,gap:L,placementStrategy:ie,rowHeight:F}),[he,me,I,L,A,ie,F]),Ge=a(de=>{if(t.windowed&&A!=="dense"){let Se=de===we[we.length-1];return jsxRuntime.jsx(Kw,{items:de.items,getKey:Je=>Je.stringKey,layout:_e,cardWidth:Qi(t.layout.cardWidth,Nu,b.current),getScrollOwner:Ke,railRef:A==="rail"&&Se?x:void 0,tailRef:A==="rail"&&Se?k:void 0,estimateHeight:(Je,bt)=>{let xt=t.layout.getItemSize?.(Je.item,{..._e,columnWidth:bt}),Gt=t.layout.getItemAspectRatio?.(Je.item,Je.index);return Qi(xt?.height,Gt&&Gt>0?bt/Gt:300,b.current)},containerProps:{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:s?.layout},getItemProps:(Je,bt)=>oe(Je,Ie(Je,bt)),renderItem:(Je,bt)=>Ve(Je,bt,false)})}let Ee=t.virtualization,qe=Ee?.adapter,Le=Ee?.enabled===true;if(Le&&(!qe||qe.supports?.(A)===false)&&Ee?.fallback==="error")return null;if(Le&&qe&&qe.supports?.(A)!==false)return qe.render({items:de.items.map(({item:Se})=>Se),keys:de.items.map(({key:Se})=>Se),layout:t.layout,scrollOwner:Ke(),renderItem:a((Se,Je,bt)=>{let xt=de.items[Je];return xt?jsxRuntime.jsx(ho.Fragment,{children:Ve(xt,bt)},xt.stringKey):null},"renderItem")});if(A==="masonry"||A==="dense")return jsxRuntime.jsx(Yi,{items:de.items,columnCount:he,columnWidth:t.layout.cardWidth??t.layout.columnWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,placementStrategy:A==="dense"?"dense":ie,className:s?.layout,containerProps:{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0},getItemProps:(Se,Je)=>{let bt=Ie(Se,{...Je,mode:A});return oe(Se,bt)},getItemKey:Se=>Se.key,getItemSize:(Se,Je)=>{let bt={...Je,mode:A},xt=t.layout.getItemSize?.(Se.item,bt),Gt=t.layout.getItemAspectRatio?.(Se.item,Se.index);return c5(xt,Gt,Je.columnWidth)},renderItem:(Se,Je)=>Ve(Se,{...Je,mode:A},false)});if(A==="rail"){let Se=t.layout.cardWidth??t.layout.idealCardWidth??Nu,Je=de===we[we.length-1];return jsxRuntime.jsx("div",{ref:Je?x:void 0,role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:m("grid min-w-0 grid-flow-col items-start overflow-x-auto",s?.layout),style:{gap:L,gridAutoColumns:typeof Se=="number"?`${Se}px`:Se},children:de.items.map((bt,xt)=>jsxRuntime.jsx("div",{ref:Je&&xt===de.items.length-1?k:void 0,className:"min-w-0",children:Ve(bt,_e)},bt.stringKey))})}return jsxRuntime.jsx("div",{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:m("grid min-w-0 items-start",s?.layout),style:{gap:L,gridTemplateColumns:`repeat(${he}, minmax(0, 1fr))`},children:de.items.map(Se=>{let Je=t.layout.getItemSize?.(Se.item,_e),bt=Ru(Math.round(Number(Je?.columnSpan)||1),1,he),xt=t.layout.getItemAspectRatio?.(Se.item,Se.index);return jsxRuntime.jsx("div",{...oe(Se,Ie(Se,{..._e,columnSpan:bt,size:Je})),style:{gridColumn:bt>1?`span ${bt}`:void 0,aspectRatio:Number.isFinite(xt)&&Number(xt)>0?String(xt):void 0},children:Ve(Se,{..._e,columnSpan:bt,size:Je},false)},Se.stringKey)})})},"renderGroupItems"),le={items:e,error:Q,loading:re,loadingMore:Z,selectedKeys:ne,retry:a(()=>n?.onRetry?.(),"retry")},Me=Rr(r?.header,le),Ae=Rr(r?.toolbar,le),J=ne.size>0?Rr(r?.selectionToolbar,le):null,$e=Rr(r?.beforeItems,le),ue=Rr(r?.footer,le),Re=z?.permission===true,se=z?.offline===true&&!Re,te=re&&e.length===0&&!Re&&!se,Te=!!Q&&e.length===0&&!Re&&!se&&!te,ze=!Re&&!se&&!te&&!Te&&(z?.empty===true||e.length===0),je=Rr(r?.loading,le),it=Rr(r?.error,le),Y=Rr(r?.permission,le),pe=Rr(r?.offline,le),Be=Rr(r?.empty,le),rt=Rr(r?.loadMore,le),Ce=t.layout.scrollOwner==="self"||t.layout.scrollOwner===void 0&&(t.layout.fillHeight||t.layout.maxHeight),Xe={...l,gap:t.layout.gap===void 0?l?.gap??"var(--monkeys-bento-gap, var(--global-spacing, 0.75rem))":nk(t.layout.gap),padding:t.layout.padding??l?.padding,height:t.layout.fillHeight?"100%":l?.height,maxHeight:t.layout.maxHeight??l?.maxHeight,overflow:Ce?"auto":l?.overflow};return jsxRuntime.jsxs("section",{ref:b,...c,"data-monkeys-component":"workbench-collection","data-layout-mode":A,"data-density":t.appearance?.density,"data-radius":t.appearance?.radius,"data-media-fit":t.appearance?.mediaFit,"data-hover-effect":t.appearance?.hover,"aria-label":d??be.collection,"aria-busy":re||Z||void 0,className:m("min-h-0 min-w-0",t.layout.fillHeight&&"h-full",s?.root,i),style:Xe,children:[V(Me)?jsxRuntime.jsx("div",{className:s?.header,children:Me}):null,V(Ae)?jsxRuntime.jsx("div",{className:s?.toolbar,children:Ae}):null,V(J)?jsxRuntime.jsx("div",{className:s?.selectionToolbar,children:J}):null,V($e)?jsxRuntime.jsx("div",{className:s?.beforeItems,children:$e}):null,Re?V(Y)?Y:jsxRuntime.jsx(za,{kind:"permission",title:be.permission,actions:u.permission?.showRequestAccess!==false&&n?.onRequestAccess?jsxRuntime.jsx(mt,{size:"sm",label:be.requestAccess,onClick:n.onRequestAccess}):void 0}):se?V(pe)?pe:jsxRuntime.jsx(za,{kind:"offline",title:be.offline,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(mt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0}):te?V(je)?je:ee==="spinner"?jsxRuntime.jsx($r,{title:be.loading,variant:"spinner"}):jsxRuntime.jsx("div",{ref:H,className:m("min-w-0",s?.items),children:jsxRuntime.jsx(zf,{mode:A,phase:"initial",columnCount:he,columnWidth:me,cardWidth:t.layout.cardWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,config:t.loading?.skeleton,ariaLabel:be.loading,className:s?.layout})}):Te?V(it)?it:jsxRuntime.jsx(za,{kind:"error",title:be.loadError,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(mt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0}):ze?V(Be)?Be:jsxRuntime.jsx(Di,{title:be.empty}):jsxRuntime.jsx("div",{ref:H,className:m("min-w-0",s?.items),children:we.map((de,Ee)=>{let qe={key:de.key,label:de.label,items:de.items.map(({item:Je})=>Je),groupIndex:Ee},Le=t.grouping?r?.groupHeading?.(qe,le)??de.label:null,Se=`${f}-group-${Ee}`;return jsxRuntime.jsxs("div",{"data-collection-group":de.stringKey,className:s?.group,children:[V(Le)?jsxRuntime.jsx("div",{id:Se,role:"heading","aria-level":2,className:s?.groupHeading,children:Le}):null,Ge(de)]},de.stringKey)})}),e.length>0&&Q?jsxRuntime.jsx("div",{className:s?.status,children:V(it)?it:jsxRuntime.jsx(za,{kind:"error",title:be.refreshError,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(mt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0})}):null,e.length>0&&(ae||Z)?jsxRuntime.jsx("div",{ref:A==="rail"?void 0:k,className:s?.loadMore,"data-collection-load-more":"",children:V(rt)?rt:Z?ee==="spinner"?jsxRuntime.jsx($r,{title:be.loadingMore,variant:"spinner"}):jsxRuntime.jsx(zf,{mode:A,phase:"load-more",columnCount:he,columnWidth:me,cardWidth:t.layout.cardWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,config:t.loading?.skeleton,ariaLabel:be.loadingMore,className:s?.layout}):null}):null,V(ue)?jsxRuntime.jsx("div",{className:s?.footer,children:ue}):null]})}a(kn,"WorkbenchCollection");function h5(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return `${e}px`;if(typeof e=="string"&&e.trim())return e.trim()}a(h5,"getNormalizedGalleryGridCardWidth");function y5(e){return e==="compact"?2:e==="detailed"?6:4}a(y5,"getDefaultGalleryDetailLimit");function x5(e,t){return e===1||e===2||e===3?Number(e):t==="detailed"?1:2}a(x5,"getNormalizedGalleryBentoColumns");function v5({density:e,visibility:t,limit:o}){if(t==="all")return Number.POSITIVE_INFINITY;let r=Number.parseInt(String(o),10);return Number.isFinite(r)&&r>0?r:y5(e)}a(v5,"getNormalizedGalleryDetailLimit");function sk(e){return e==="compact"?{min:220,ideal:244,max:268}:e==="detailed"?{min:320,ideal:372,max:420}:{min:260,ideal:304,max:348}}a(sk,"getGalleryCardWidthMetrics");function w5(e){if(e==null||e===""||e==="auto")return;let t=Number.parseInt(String(e),10);if(!(!Number.isFinite(t)||t<=0))return Math.max(1,Math.min(t,8))}a(w5,"getNormalizedGalleryGridColumns");function lk(e){if(e==null)return 0;let t=String(e).trim();return t&&t!=="\u2014"?t.length:0}a(lk,"getGalleryTextLength");function ml({column:e,row:t,getFieldValue:o,getDisplayText:r}){if(!e)return "";let n=o(e,t);if(n==null||n==="")return "";let i=r(n);return i==="\u2014"?"":String(i)}a(ml,"getGalleryFieldText");function $f({text:e,charsPerLine:t,maxLines:o}){let r=lk(e);return r?Math.max(1,Math.min(o,Math.ceil(r/t))):0}a($f,"estimateLineCount");function k5({text:e,density:t,bentoColumns:o}){let r=t==="detailed"?54:t==="compact"?44:48,s=$f({text:e,charsPerLine:o===1?t==="detailed"?32:26:t==="detailed"?18:15,maxLines:t==="detailed"?3:2});return s?r+Math.max(0,s-1)*16:r}a(k5,"estimateGalleryDetailCellHeight");function C5({columns:e,density:t,bentoColumns:o}){if(!e.length)return 0;let r=e.map(i=>k5({text:i.text,density:t,bentoColumns:o}));if(o===1)return 12+r.reduce((i,s)=>i+s,0)+Math.max(0,e.length-1)*8;let n=12;for(let i=0;i<r.length;i+=o){let s=r.slice(i,i+o);n+=Math.max(...s),i+o<r.length&&(n+=8);}return n}a(C5,"estimateGalleryDetailGridHeight");function S5({row:e,columns:t,galleryFieldKey:o,galleryDensity:r,galleryBentoColumns:n,galleryDetailVisibility:i,galleryDetailLimit:s,getFieldValue:l,isMediaColumn:d,isTitleCandidate:c,isSummaryCandidate:p,getDisplayText:u,isImageField:g,isAudioField:f,cardVariant:b,renderPreview:x,renderLeadingVisual:y,hiddenDetailFieldKeys:k,layout:w,resolveRecordVisual:v}){let h=t.find(U=>U.renderType==="icon"),S=h&&v?v(e?.[h.key],e,h):null,C=(o!=="auto"?t.find(U=>U.key===o&&d(U,e)):null)||t.find(U=>d(U,e))||null,R=C?l(C,e):null,M=C?g(C,R):false,I=C?f(C,R):false,N=!!y||!!S,D=t.filter(U=>U.key!==C?.key&&U.renderType!=="icon"),P=D.filter(U=>{if(!U||d(U,e)||!c(U,e))return false;let X=l(U,e);return !(X==null||X==="")})[0]||null,W=P?ml({column:P,row:e,getFieldValue:l,getDisplayText:u}):String(u(e?.linkKey||e?.id||"")),H=D.find(U=>!U||U.key===P?.key||d(U,e)||!p(U,e)?false:ml({column:U,row:e,getFieldValue:l,getDisplayText:u}).length>12)||D.find(U=>!U||U.key===P?.key||d(U,e)||!p(U,e)?false:lk(ml({column:U,row:e,getFieldValue:l,getDisplayText:u}))>0)||null,A=H?ml({column:H,row:e,getFieldValue:l,getDisplayText:u}):"",L=new Set(k),F=D.filter(U=>U.key!==P?.key&&U.key!==H?.key&&!L.has(U.key)).map(U=>({column:U,text:ml({column:U,row:e,getFieldValue:l,getDisplayText:u})})),G=v5({density:r,visibility:i,limit:s}),$=Number.isFinite(G)?F.slice(0,G):F,_=Math.max(F.length-$.length,0),z=x5(n,r),re=w?.columnWidth||sk(r).ideal;if(b==="image-only")return {width:re,height:Math.round(re*1.25)};if(b==="preview-only")return {width:re,height:Math.round(re*.82)};let Z=r==="detailed"?84:r==="compact"?64:72;typeof x=="function"?Z+=r==="detailed"?188:r==="compact"?140:164:M?Z+=Math.round(re*(r==="detailed"?.72:.62))+12:I&&(Z+=92);let ae=$f({text:W,charsPerLine:r==="detailed"?26:24,maxLines:2})||1,ee=$f({text:A,charsPerLine:N?22:r==="detailed"?30:26,maxLines:r==="detailed"?4:2}),q=26+ae*18+(ee>0?ee*16+4:0);return Z+=Math.max(N?56:0,q),Z+=C5({columns:$,density:r,bentoColumns:z}),_>0&&(Z+=18),!A&&$.length===0&&(Z+=24),{width:re,height:Z}}a(S5,"getDefaultGalleryMasonryItemSize");function dk({rows:e=[],children:t,columns:o=[],onRowClick:r,cardInteraction:n="button",selectedLinkKey:i,selectedRowKey:s,selectedRowKeys:l,className:d,isMasonry:c=false,galleryLayoutMode:p="auto",galleryRailCardWidth:u,galleryGap:g,galleryScrollDirection:f,galleryGridColumns:b,galleryGridColumnsResponsive:x,galleryCardWidthMetrics:y,galleryCardAspectRatio:k,galleryCardMinHeight:w,galleryGridCardWidth:v,galleryUnderfilledBehavior:h,galleryMasonryColumnWidth:S,masonryPlacementStrategy:T,pagination:C,onLoadMore:R,scrollOwner:M,windowed:I,galleryFieldKey:B="auto",galleryDensity:N="comfortable",galleryBentoColumns:D=2,galleryDetailVisibility:E="limit",galleryDetailLimit:P,shouldEnhanceMultimodal:W=true,getFieldValue:H,isMediaColumn:A,isTitleCandidate:L,isSummaryCandidate:F,getDisplayText:G,renderFieldValue:$,getImagePreviewSrc:_,isImageField:z,isAudioField:re,AudioPlayerComponent:Z,cardVariant:ae="default",cardPresentation:ee,renderCardSlot:q,renderCoverTitle:U,galleryDetailPresentation:X,renderPreview:O,renderMeta:K,renderLeadingVisual:ne,resolveRecordVisual:fe,hiddenDetailFieldKeys:he=[],labels:me,formatLabel:ie,getMasonryItemSize:be}){let{min:He,ideal:We,max:Ke}=y??sk(N),ce=u||He,Q=w5(b),ge=h5(v),we=S||He,Ie=p==="rail",oe=H||Ki,xe=G||cl,Ve=z||ul,_e=re||pl,Ge=A||((ue,Re)=>fu(ue,Re,{getFieldValue:oe,shouldEnhanceMultimodal:W,isImageField:Ve,isAudioField:_e})),le=L||((ue,Re)=>bu(ue,Re,{isMediaColumn:Ge})),Me=F||((ue,Re)=>gu(ue,Re,{isMediaColumn:Ge})),Ae=$||((ue,Re,{compact:se}={})=>jsxRuntime.jsx("span",{children:xe(oe(ue,Re))})),J=a((ue,Re)=>jsxRuntime.jsx(hu,{row:ue,columns:o,cardInteraction:n,onClick:r?()=>r(ue,Re):void 0,isSelected:l?l.has(String(ue?.linkKey||ue?.id||"")):String(ue?.linkKey||ue?.id||"")===String(s||i||""),isMasonry:c,galleryFieldKey:B,galleryDensity:N,galleryBentoColumns:D,galleryDetailVisibility:E,galleryDetailLimit:P,galleryDetailPresentation:X,shouldEnhanceMultimodal:W,getFieldValue:oe,isMediaColumn:Ge,isTitleCandidate:le,isSummaryCandidate:Me,getDisplayText:xe,renderFieldValue:Ae,getImagePreviewSrc:_,isImageField:Ve,isAudioField:_e,AudioPlayerComponent:Z,cardVariant:ae,cardPresentation:ee,renderCardSlot:q,renderCoverTitle:U,renderPreview:O,renderMeta:K,renderLeadingVisual:ne,resolveRecordVisual:fe,hiddenDetailFieldKeys:he,labels:me,formatLabel:ie},ue?.id||ue?.linkKey||Re),"renderGalleryCard"),$e=c?T==="dense"?"dense":"masonry":Ie?"rail":"grid";if(jw($e,f),t!==void 0){let ue=ho.Children.toArray(t);return jsxRuntime.jsx(kn,{items:ue,callbacks:{onLoadMore:R},slots:{loadMore:C?.loadingMore?jsxRuntime.jsx($r,{variant:"spinner",className:"py-global",style:{minHeight:0}}):void 0},classNames:{layout:d},config:{windowed:I,state:C,loading:{autoFill:true},getItemKey:a((Re,se)=>ho.isValidElement(Re)&&Re.key!=null?Re.key:se,"getItemKey"),layout:{mode:$e,scrollOwner:M??"parent",gap:g,columns:x??(Q?{mobile:1,tablet:Math.min(2,Q),desktop:Q}:"auto"),underfilledBehavior:h,cardWidth:Ie?ce:void 0,minCardWidth:ge??He,idealCardWidth:ge??We,maxCardWidth:ge??Ke}},renderItem:Re=>Re})}return jsxRuntime.jsx(kn,{items:e,slots:{loadMore:C?.loadingMore?jsxRuntime.jsx($r,{variant:"spinner",className:"py-global",style:{minHeight:0}}):void 0},callbacks:{onLoadMore:R,onItemClick:n==="container"&&r?(ue,Re)=>r(ue,Re.index):void 0},classNames:{layout:d},config:{windowed:I,state:C,loading:{autoFill:true},getItemKey:a((ue,Re)=>ue?.id||ue?.linkKey||Re,"getItemKey"),layout:{mode:$e,underfilledBehavior:h,scrollOwner:M,gap:g,columns:x??(Q?{mobile:1,tablet:Math.min(2,Q),desktop:Q}:"auto"),cardWidth:Ie?ce:void 0,minCardWidth:ge??He,idealCardWidth:c?we:ge??We,maxCardWidth:ge??Ke,placementStrategy:T??(ae==="image-only"?"shortest":"shelf"),getItemAspectRatio:ae==="image-only"?ue=>{let Re=o.find(je=>je.key===B)??o.find(je=>Ge(je,ue)),se=Re?oe(Re,ue):void 0,te=se&&typeof se=="object"&&"aspectRatio"in se?se.aspectRatio:void 0;if(typeof te!="string"||!/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(te))return;let[Te,ze]=te.split(":").map(Number);return Te>0&&ze>0?Te/ze:void 0}:void 0,getItemSize:ae==="image-only"&&k&&k>0?(ue,Re)=>({height:Math.max(w??0,Re.columnWidth/k)}):c?(ue,Re)=>{let se=S5({row:ue,columns:o,galleryFieldKey:B,galleryDensity:N,galleryBentoColumns:D,galleryDetailVisibility:E,galleryDetailLimit:P,getFieldValue:oe,isMediaColumn:Ge,isTitleCandidate:le,isSummaryCandidate:Me,getDisplayText:xe,isImageField:Ve,isAudioField:_e,cardVariant:ae,renderPreview:O,renderLeadingVisual:ne,hiddenDetailFieldKeys:he,layout:Re,resolveRecordVisual:fe});if(typeof be!="function")return se;let te=be(ue,{...Re,placementStrategy:Re.placementStrategy==="dense"?"dense":"shelf",defaultSize:se})||{};return {...se,...te}}:void 0}},renderItem:(ue,Re)=>J(ue,Re.index)})}a(dk,"WorkbenchGalleryView");function ck({layout:e="horizontal",mediaPosition:t="start",detailsSize:o="balanced",sizing:r="content",asidePosition:n="end",detailsVisible:i=true,heading:s,metadata:l,message:d,actions:c,media:p,toolbar:u,aside:g,secondary:f,children:b,className:x,...y}){let k=i&&(V(s)||V(l)||V(b)||V(d)||V(c)),w=e==="horizontal"&&V(p)&&k,v=r==="fill",h=V(f),S=w&&h,T=V(g)?jsxRuntime.jsx("div",{"data-record-part":"aside",className:"flex min-h-0 shrink-0 gap-global",children:g}):null;return jsxRuntime.jsxs("article",{...y,"data-monkeys-component":"record-view","data-record-layout":e,"data-record-sizing":r,className:m("@container flex min-h-0 min-w-0 flex-col gap-global font-[family-name:var(--font-sans)] text-sm leading-5 text-foreground",v&&"h-full",x),children:[V(u)&&jsxRuntime.jsx("div",{"data-record-part":"toolbar",className:"flex shrink-0 flex-wrap items-center gap-global",children:u}),jsxRuntime.jsxs("div",{className:m("flex min-h-0 min-w-0 gap-global",v&&"flex-1"),children:[n==="start"&&T,jsxRuntime.jsxs("div",{"data-record-part":"body",className:m("grid min-h-0 min-w-0 flex-1 grid-cols-1 gap-global",S?"@[48rem]:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)]":w&&(o==="balanced"?"@[48rem]:grid-cols-2":t==="start"?"@[48rem]:grid-cols-[minmax(0,1fr)_minmax(16rem,24rem)]":"@[48rem]:grid-cols-[minmax(16rem,24rem)_minmax(0,1fr)]"),v&&"overflow-auto @[48rem]:overflow-hidden"),children:[V(p)&&jsxRuntime.jsx("div",{"data-record-part":"media",className:m("min-h-0 min-w-0",t==="end"&&w&&"@[48rem]:order-2",v&&"flex flex-col"),children:p}),k&&jsxRuntime.jsxs("div",{"data-record-part":"details",className:m("flex min-h-0 min-w-0 flex-col [&>section]:flex-1",v&&"@[48rem]:overflow-auto"),children:[V(s)&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global",children:s}),V(l)&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global text-sm tabular-nums text-muted-foreground [&_span]:text-inherit [&_time]:text-inherit",children:l}),b,V(d)&&jsxRuntime.jsx("div",{className:"mt-global break-words text-sm text-destructive-text",children:d}),V(c)&&jsxRuntime.jsx("div",{className:"mt-auto flex shrink-0 flex-wrap gap-global pt-global",children:c})]}),h&&jsxRuntime.jsx("div",{"data-record-part":"secondary",className:m("flex min-h-0 min-w-0 flex-col [&>section]:flex-1",v&&"@[48rem]:overflow-auto"),children:f})]}),n==="end"&&T]})]})}a(ck,"RecordView");function uk(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(uk,"toCssSize");function A5(e,t){return String(e?.id??e?.key??t)}a(A5,"defaultGetRowId");function B5(e){return String(e?.columnId??e?.status??"")}a(B5,"defaultGetColumnId");function L5(e){let t=e?.title??e?.name??e?.id??"Untitled";return jsxRuntime.jsx("div",{className:"rounded-lg border border-border/70 bg-card px-3 py-2 text-sm text-foreground shadow-sm",children:String(t)})}a(L5,"defaultRenderCard");function W5({row:e,rowId:t,rowIndex:o,column:r,classNames:n,renderCard:i}){let{attributes:s,listeners:l,setNodeRef:d,isDragging:c}=core.useDraggable({id:t});return jsxRuntime.jsx("div",{ref:d,...l,...s,className:m("touch-none",n?.cardWrapper),children:i(e,{row:e,rowIndex:o,column:r,isDragging:c,isOverlay:false})})}a(W5,"WorkbenchLaneDraggableCard");function z5({column:e,columnRows:t,columnWidth:o,columnMinHeight:r,emptyColumn:n,classNames:i,renderCard:s}){let{setNodeRef:l,isOver:d}=core.useDroppable({id:e.id});return jsxRuntime.jsxs("section",{className:m("flex shrink-0 flex-col rounded-xl border border-border/60 bg-card p-2 shadow-sm",i?.column,e.className),style:{width:uk(o)??"280px"},children:[jsxRuntime.jsxs("div",{className:m("flex h-10 items-center gap-2 px-1",i?.columnHeader,e.headerClassName),children:[e.icon?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 items-center justify-center text-muted-foreground",i?.columnIcon,e.iconClassName),children:e.icon}):null,jsxRuntime.jsx("span",{className:m("inline-flex items-center rounded px-2 py-0.5 text-xs font-semibold bg-muted text-muted-foreground",i?.columnBadge,e.badgeClassName),children:e.label??e.id}),jsxRuntime.jsx("span",{className:m("text-xs text-muted-foreground",i?.columnCount),children:t.length})]}),jsxRuntime.jsx("div",{ref:l,className:m("mt-1 flex min-h-[200px] flex-1 flex-col gap-2 overflow-y-auto rounded-lg p-1 transition-colors [scrollbar-width:thin]",d&&"bg-accent/60",i?.columnBody,e.bodyClassName),style:{minHeight:uk(r)},children:t.length?t.map(({row:c,rowIndex:p,rowId:u})=>jsxRuntime.jsx(W5,{row:c,rowId:u,rowIndex:p,column:e,classNames:i,renderCard:s},u)):n?jsxRuntime.jsx("div",{className:m("flex min-h-24 items-center justify-center rounded-lg border border-dashed border-border/60 px-3 py-4 text-xs text-muted-foreground",i?.emptyColumn),children:n}):null})]})}a(z5,"WorkbenchLaneColumnView");function pk({rows:e=[],columns:t=[],getRowId:o=A5,getColumnId:r=B5,renderCard:n,renderOverlayCard:i,onMoveRow:s,onSelectRow:l,emptyColumn:d,activationDistance:c=5,columnWidth:p=280,columnMinHeight:u,className:g,classNames:f,style:b}){let x=n??((B,N)=>l?jsxRuntime.jsx(mt,{className:"w-full justify-start whitespace-normal text-left",onClick:()=>l({rowId:o(B,N.rowIndex)}),children:String(B?.title??B?.name??o(B,N.rowIndex))}):L5(B)),[y,k]=ho.useState(null),w=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:c}})),v=ho.useMemo(()=>new Map(t.map(B=>[B.id,B])),[t]),h=ho.useMemo(()=>e.map((B,N)=>({row:B,rowIndex:N,rowId:o(B,N),columnId:r(B,N)})),[r,o,e]),S=y?h.find(B=>B.rowId===y):void 0,T=ho.useMemo(()=>{let B=new Map;return t.forEach(N=>B.set(N.id,[])),h.forEach(({row:N,rowIndex:D,rowId:E,columnId:P})=>{B.get(P)?.push({row:N,rowIndex:D,rowId:E});}),B},[t,h]),C=S?v.get(S.columnId):void 0,R=ho.useCallback(B=>{k(String(B.active.id));},[]),M=ho.useCallback(B=>{k(null);let N=String(B.active.id),D=String(B.over?.id??""),E=h.find(P=>P.rowId===N);!E||!v.has(D)||E.columnId===D||s?.(N,D,E.row);},[v,s,h]),I=ho.useCallback(()=>{k(null);},[]);return jsxRuntime.jsxs(core.DndContext,{sensors:w,onDragStart:R,onDragEnd:M,onDragCancel:I,children:[jsxRuntime.jsx("div",{className:m("flex min-h-0 flex-1 gap-4 overflow-x-auto p-4 [scrollbar-width:thin]",f?.root,g),style:b,children:t.map(B=>jsxRuntime.jsx(z5,{column:B,columnRows:T.get(B.id)||[],columnWidth:p,columnMinHeight:u,emptyColumn:d,classNames:f,renderCard:x},B.id))}),jsxRuntime.jsx(core.DragOverlay,{children:S&&C?jsxRuntime.jsx("div",{className:m(f?.overlayWrapper),children:(i||x)(S.row,{row:S.row,rowIndex:S.rowIndex,column:C,isDragging:false,isOverlay:true})}):null})]})}a(pk,"WorkbenchLaneView");var mk=a(e=>{if(Number.isFinite(e))return Math.min(1,Math.max(0,Number(e)))},"normalizeProgress");function fk({items:e,summary:t,variant:o="bars",density:r="comfortable",emptyState:n=null,ariaLabel:i="Metrics",className:s,itemClassName:l}){if(!e.length)return V(n)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:n}):null;if(o==="radar"&&e.length>=3&&e.length<=12){let d=a((u,g)=>{let f=-Math.PI/2+u*Math.PI*2/e.length;return [180+Math.cos(f)*g,160+Math.sin(f)*g]},"point"),c=e.map((u,g)=>{let f=mk(u.progress);return f===void 0?void 0:d(g,f*100)}),p=c.every(Boolean);return jsxRuntime.jsxs("figure",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":"radar",className:m("m-0 min-w-0",s),children:[jsxRuntime.jsxs("svg",{viewBox:"0 0 360 320",role:"img","aria-label":t?`${i} \xB7 ${t.label} ${t.value}`:i,className:"mx-auto block w-full max-w-sm overflow-visible",children:[[.25,.5,.75,1].map(u=>jsxRuntime.jsx("polygon",{points:e.map((g,f)=>d(f,u*100).join(",")).join(" "),fill:"none",stroke:"hsl(var(--border))"},u)),e.map((u,g)=>{let f=d(g,100),b=d(g,131);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:"180",y1:"160",x2:f[0],y2:f[1],stroke:"hsl(var(--border))"}),typeof u.label=="string"||typeof u.label=="number"?jsxRuntime.jsx("text",{x:b[0],y:b[1]-7,textAnchor:"middle",dominantBaseline:"middle",fontSize:"12",fill:"hsl(var(--muted-foreground))",children:u.label}):null,typeof u.value=="string"||typeof u.value=="number"?jsxRuntime.jsx("text",{"data-metric-axis-value":u.id,x:b[0],y:b[1]+10,textAnchor:"middle",dominantBaseline:"middle",fontSize:"13",fontWeight:"600",fill:"hsl(var(--foreground))",children:u.value}):null]},u.id)}),p?jsxRuntime.jsx("polygon",{"data-metric-radar-series":"complete",points:c.map(u=>u.join(",")).join(" "),fill:"hsl(var(--primary) / .18)",stroke:"hsl(var(--primary))",strokeWidth:"2.5"}):c.map((u,g)=>{let f=c[(g+1)%c.length];return u&&f?jsxRuntime.jsx("line",{"data-metric-radar-series":"partial",x1:u[0],y1:u[1],x2:f[0],y2:f[1],stroke:"hsl(var(--primary))",strokeWidth:"2.5"},e[g].id):null}),c.map((u,g)=>u?jsxRuntime.jsx("circle",{cx:u[0],cy:u[1],r:"3",fill:"hsl(var(--primary))"},e[g].id):null),t?jsxRuntime.jsxs("g",{"data-metric-radar-summary":"true",textAnchor:"middle",paintOrder:"stroke",stroke:"hsl(var(--card))",strokeWidth:"3",strokeLinejoin:"round",children:[jsxRuntime.jsx("text",{x:"180",y:"149",fontSize:"12",fill:"hsl(var(--muted-foreground))",children:t.label}),jsxRuntime.jsx("text",{x:"180",y:"174",fontSize:"23",fontWeight:"700",fill:"hsl(var(--foreground))",children:t.value})]}):null]}),jsxRuntime.jsx("dl",{className:"sr-only",children:e.map(u=>jsxRuntime.jsxs("div",{className:m("flex min-w-0 justify-between gap-2",l),children:[jsxRuntime.jsx("dt",{className:"truncate text-muted-foreground",children:u.label}),jsxRuntime.jsx("dd",{className:"font-semibold tabular-nums",children:u.value})]},u.id))})]})}return o==="list"?jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>jsxRuntime.jsxs("div",{className:m("flex min-w-0 items-start justify-between gap-4",r==="compact"?"text-xs":"text-sm",l),children:[jsxRuntime.jsxs("dt",{className:"min-w-0 text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"block truncate",children:d.label}),V(d.description)?jsxRuntime.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-muted-foreground/80",children:d.description}):null]}),jsxRuntime.jsx("dd",{className:"shrink-0 font-semibold tabular-nums text-foreground",children:d.value})]},d.id))}):o==="cards"?jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0 [grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))]",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>jsxRuntime.jsxs("div",{className:m("min-w-0 rounded-lg border border-border/70 bg-card text-card-foreground",r==="compact"?"p-3":"p-4",l),children:[jsxRuntime.jsx("dt",{className:"truncate text-xs font-medium text-muted-foreground",children:d.label}),jsxRuntime.jsx("dd",{className:m("font-semibold tabular-nums text-foreground",r==="compact"?"mt-1.5 text-xl":"mt-2 text-2xl"),children:d.value}),V(d.description)?jsxRuntime.jsx("div",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:d.description}):null]},d.id))}):jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0 [grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr))]",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>{let c=mk(d.progress);return jsxRuntime.jsxs("div",{className:m("min-w-0",l),children:[jsxRuntime.jsx("div",{role:c===void 0?void 0:"meter","aria-label":c===void 0?void 0:String(d.label),"aria-valuemin":c===void 0?void 0:0,"aria-valuemax":c===void 0?void 0:100,"aria-valuenow":c===void 0?void 0:Math.round(c*100),className:m("overflow-hidden rounded-full bg-muted",r==="compact"?"h-1.5":"h-2"),children:c===void 0?null:jsxRuntime.jsx("span",{className:"block h-full rounded-full bg-primary transition-[width] duration-200 motion-reduce:transition-none",style:{width:`${Math.max(c>0?4:0,c*100)}%`}})}),jsxRuntime.jsxs("div",{className:"mt-1.5 flex min-w-0 items-baseline justify-between gap-2",children:[jsxRuntime.jsx("dt",{className:"truncate text-xs text-muted-foreground",children:d.label}),jsxRuntime.jsx("dd",{className:"shrink-0 text-xs font-semibold tabular-nums text-foreground",children:d.value})]})]},d.id)})})}a(fk,"WorkbenchMetricGrid");var bk=Math.PI*(3-Math.sqrt(5)),gk=a(e=>Array.from(e).reduce((t,o)=>Math.imul(t^o.charCodeAt(0),16777619)>>>0,2166136261),"hash");function Iu(e,t){let o=new Set(e.map(v=>v.id)),r=new Map,n=new Set,i=new Map(e.map(v=>[v.id,new Set])),s=t.filter(v=>o.has(v.sourceId)&&o.has(v.targetId));for(let v of s){let h=r.get(v.sourceId)??[];h.includes(v.targetId)||h.push(v.targetId),r.set(v.sourceId,h),n.add(v.targetId),i.get(v.sourceId).add(v.targetId),i.get(v.targetId).add(v.sourceId);}let d=e.filter(v=>!n.has(v.id))[0]?.id??e[0]?.id,c=new Map,p=d?[d]:[];d&&c.set(d,{depth:0,branch:d,cluster:d});for(let v=0;v<p.length;v++){let h=p[v],S=c.get(h);for(let T of r.get(h)??[])c.has(T)||(c.set(T,{depth:S.depth+1,branch:S.depth===0?T:S.branch,cluster:S.depth<2?T:S.cluster}),p.push(T));}for(let v of e)c.has(v.id)||c.set(v.id,{depth:1,branch:v.id,cluster:v.id});let u=[...new Set([...c.values()].filter(v=>v.depth>0).map(v=>v.branch))],g=new Map;for(let[v,h]of c){if(h.depth<2)continue;let S=g.get(h.cluster)??[];S.push(v),g.set(h.cluster,S);}let f=u.map(v=>Math.sqrt([...c.values()].filter(h=>h.branch===v).length+8)),b=f.reduce((v,h)=>v+h,0)||1,x=-Math.PI/2,y=new Map;u.forEach((v,h)=>{let S=Math.PI*2*f[h]/b,T=x+S/2;y.set(v,{x:Math.cos(T)*12,y:Math.sin(T)*10,z:Math.sin(T*2)*3.2,angle:T}),x+=S;});let k=new Map;for(let v of u){let h=y.get(v),S=[...g.keys()].filter(T=>c.get(T)?.branch===v);S.forEach((T,C)=>{let R=S.length>1?Math.max(3,Math.sqrt(S.length)*1.7):1.5,M=C*bk+h.angle;k.set(T,{x:h.x+Math.cos(M)*R,y:h.y+Math.sin(M)*R,z:h.z+Math.sin(M)*2.5});});}let w=e.map(v=>{let h=c.get(v.id),S=h.depth<2?y.get(h.branch):k.get(h.cluster);if(h.depth===0||!S)return {...v,...h,x:0,y:0,z:0};if(h.depth===1)return {...v,...h,x:S.x*.76,y:S.y*.76,z:S.z};let C=g.get(h.cluster).indexOf(v.id),R=h.depth===2?0:1.5+Math.sqrt(C)*.72,M=C*bk+gk(h.cluster)%360*Math.PI/180;return {...v,...h,x:S.x+Math.cos(M)*R,y:S.y+Math.sin(M)*R*.85,z:S.z+Math.sin(M*1.37)*Math.min(R,3.5)}});for(let v=0;v<30;v++)for(let h=0;h<w.length;h++)for(let S=h+1;S<w.length;S++){let T=w[h],C=w[S],R=C.x-T.x,M=C.y-T.y,I=Math.hypot(R,M),B=T.depth<3||C.depth<3?1.4:.85;if(I>=B)continue;let N=gk(T.id+C.id)%360*Math.PI/180,D=I>.001?R/I:Math.cos(N),E=I>.001?M/I:Math.sin(N),P=(B-I)*.25;T.depth>0&&(T.x-=D*P,T.y-=E*P),C.depth>0&&(C.x+=D*P,C.y+=E*P);}if(w.length)for(let v of ["x","y","z"]){let h=(Math.min(...w.map(S=>S[v]))+Math.max(...w.map(S=>S[v])))/2;w.forEach(S=>{S[v]-=h;});}return {points:w,links:s,neighbors:i,root:d}}a(Iu,"buildRelationshipGalaxyLayout");function yk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:n,className:i}){let s=Ye(),l=ho.useRef(null),d=ho.useRef(new Map),c=ho.useRef(o),p=ho.useRef(r),[u,g]=ho.useState(false),f=JSON.stringify([e,t]),b=ho.useMemo(()=>Iu(e,t),[f]);return c.current=o,p.current=r,ho.useEffect(()=>{let x=l.current;if(!x)return;let y=false,k=a(()=>{},"cleanup");return g(false),Promise.all([import('three'),import('three/examples/jsm/controls/OrbitControls.js')]).then(([w,{OrbitControls:v}])=>{if(y)return;let h=[],S=new w.Scene,T=getComputedStyle(x),C=a((ie,be)=>{let He=document.createElement("span");He.style.color=`hsl(${T.getPropertyValue(ie).trim()||T.getPropertyValue(be).trim()})`,x.append(He);let We=new w.Color(getComputedStyle(He).color);return He.remove(),We},"tokenColor"),R=C("--radar-canvas","--background");S.background=R;let M=new w.PerspectiveCamera(48,1,.1,250),I=new w.WebGLRenderer({antialias:true,alpha:false});I.setPixelRatio(Math.min(devicePixelRatio,2)),I.domElement.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none",I.domElement.setAttribute("aria-hidden","true"),x.prepend(I.domElement);let B=new v(M,I.domElement);B.enableDamping=true,B.dampingFactor=.08,B.rotateSpeed=.45,B.minDistance=8,B.maxDistance=130,B.autoRotate=false;let N=new Map(b.points.map(ie=>[ie.id,new w.Vector3(ie.x,ie.y,ie.z)])),D={primary:C("--radar-series-one","--primary"),secondary:C("--radar-series-two","--success"),accent:C("--radar-series-three","--warning"),muted:C("--radar-series-four","--muted-foreground")},E=128,P=new Uint8Array(E*E*4);for(let ie=0;ie<E;ie++)for(let be=0;be<E;be++){let He=Math.hypot(be+.5-E/2,ie+.5-E/2)/(E/2),We=He<.09?1:Math.exp(-He*7.5)*.85;P.set([255,255,255,Math.round(We*255)],(ie*E+be)*4);}let W=new w.DataTexture(P,E,E,w.RGBAFormat);W.minFilter=W.magFilter=w.LinearFilter,W.needsUpdate=true,h.push(W);let H=b.points.map(ie=>{let be=new w.SpriteMaterial({map:W,color:D[ie.tone??"primary"],transparent:true,blending:w.AdditiveBlending,depthWrite:false}),He=new w.Sprite(be);return He.position.copy(N.get(ie.id)),S.add(He),h.push(be),He}),A=new w.BufferGeometry;A.setAttribute("position",new w.Float32BufferAttribute(b.links.flatMap(ie=>[...N.get(ie.sourceId).toArray(),...N.get(ie.targetId).toArray()]),3));let L=new Float32Array(b.links.length*6);A.setAttribute("color",new w.BufferAttribute(L,3));let F=new w.LineBasicMaterial({vertexColors:true,transparent:true,opacity:.5,depthWrite:false});S.add(new w.LineSegments(A,F)),h.push(A,F);let G=new Map;b.points.filter(ie=>ie.depth>0).forEach(ie=>{let be=G.get(ie.cluster)??[];be.push(ie),G.set(ie.cluster,be);});for(let ie of G.values()){if(ie.length<3)continue;let be=ie.reduce((Ke,ce)=>Ke.add(N.get(ce.id)),new w.Vector3).multiplyScalar(1/ie.length),He=new w.SpriteMaterial({map:W,color:D[ie[0].tone??"primary"],transparent:true,opacity:.13,blending:w.AdditiveBlending,depthWrite:false}),We=new w.Sprite(He);We.position.copy(be),We.position.z-=1,We.scale.setScalar(8+Math.sqrt(ie.length)*1.2),S.add(We),h.push(He);}let $=Math.max(8,...b.points.map(ie=>Math.abs(ie.x)))+3,_=Math.max(6,...b.points.map(ie=>Math.abs(ie.y)))+3,z=55,re=false,Z=new ResizeObserver(()=>{let{width:ie,height:be}=x.getBoundingClientRect();if(!ie||!be)return;M.aspect=ie/be;let He=Math.max(_,$/M.aspect)/Math.tan(w.MathUtils.degToRad(M.fov/2))+7;re?M.position.sub(B.target).multiplyScalar(He/z).add(B.target):(M.position.set(0,0,He),re=true),z=He,B.update(),M.updateProjectionMatrix(),I.setSize(ie,be,false);});Z.observe(x);let ae=new w.Vector3,ee=new w.Vector2,q={x:0,y:0},U,X,O=a(ie=>{let be=I.domElement.getBoundingClientRect();ee.set(ie.clientX-be.left,ie.clientY-be.top);let He,We=12;for(let Ke of b.points){if(ae.copy(N.get(Ke.id)).project(M),ae.z<-1||ae.z>1)continue;let ce=Math.hypot((ae.x+1)*be.width/2-ee.x,(-ae.y+1)*be.height/2-ee.y);ce<We&&(We=ce,He=Ke);}return He},"nodeAt"),K=a(ie=>{q={x:ie.clientX,y:ie.clientY};},"pointerDown"),ne=a(ie=>{U=O(ie)?.id,I.domElement.style.cursor=U?"pointer":"grab";},"pointerMove"),fe=a(()=>{U=void 0;},"pointerLeave"),he=a(ie=>{if(Math.hypot(ie.clientX-q.x,ie.clientY-q.y)>5)return;let be=O(ie);be&&p.current?.(be);},"pointerUp");I.domElement.addEventListener("pointerdown",K),I.domElement.addEventListener("pointermove",ne),I.domElement.addEventListener("pointerleave",fe),I.domElement.addEventListener("pointerup",he);let me=[...b.points].sort((ie,be)=>ie.depth-be.depth||(b.neighbors.get(be.id)?.size??0)-(b.neighbors.get(ie.id)?.size??0));I.setAnimationLoop(()=>{B.update();let ie=c.current,be=ie?b.neighbors.get(ie):void 0;(X!==ie||!A.userData.initialized)&&(X=ie,A.userData.initialized=true,b.links.forEach((ge,we)=>{let Ie=ge.sourceId===ie||ge.targetId===ie,oe=b.points.find(Ve=>Ve.id===ge.targetId),xe=D[oe.tone??"primary"].clone().multiplyScalar(ie?Ie?1.35:.12:.45);L.set([...xe.toArray(),...xe.toArray()],we*6);}),A.attributes.color.needsUpdate=true),H.forEach((ge,we)=>{let Ie=b.points[we],oe=ie===Ie.id;ge.scale.setScalar((Ie.depth===0?2.2:Ie.depth===1?1.8:Ie.depth===2?1.2:.82)*(oe?1.5:1)),ge.material.opacity=!ie||oe||be?.has(Ie.id)?1:.25;});let He=x.clientWidth,We=x.clientHeight,Ke=z/M.position.distanceTo(B.target),ce=[],Q=[...me].sort((ge,we)=>+(we.id===ie||we.id===U)-+(ge.id===ie||ge.id===U));for(let ge of Q){let we=d.current.get(ge.id);if(!we)continue;let Ie=ge.id===ie,oe=ge.id===U,xe=be?.has(ge.id);ae.copy(N.get(ge.id)).project(M);let Ve=(ae.x+1)*He/2,_e=(-ae.y+1)*We/2+10,Ge={x:Ve-Math.min(ge.label.length*13,170)/2,y:_e,width:Math.min(ge.label.length*13,170),height:21},le=ae.z>-1&&ae.z<1&&Ge.x>4&&Ge.x+Ge.width<He-4&&_e>4&&_e+21<We-4,Me=Ie||oe||xe||ge.depth<=2||Ke>1.65,Ae=ce.some($e=>Ge.x<$e.x+$e.width+8&&Ge.x+Ge.width+8>$e.x&&Ge.y<$e.y+$e.height+5&&Ge.y+Ge.height+5>$e.y),J=le&&Me&&(Ie||oe||!Ae)&&(!ie||Ie||oe||xe||ge.depth<2);we.style.display=J?"block":"none",we.tabIndex=J?0:-1,we.style.transform=`translate(${Ve}px,${_e}px) translate(-50%,0)`,we.style.color="#"+D[ge.tone??"primary"].clone().lerp(D.primary,.45).getHexString(),we.style.opacity=ie&&!Ie&&!xe&&!oe?"0.45":"1",we.style.fontWeight=ge.depth<2||Ie?"var(--monkeys-semantic-font-weight-semibold, 600)":"var(--monkeys-semantic-font-weight-normal, 400)",we.style.zIndex=Ie||oe?"2":"1",J&&ce.push(Ge);}I.render(S,M);}),k=a(()=>{I.domElement.removeEventListener("pointerdown",K),I.domElement.removeEventListener("pointermove",ne),I.domElement.removeEventListener("pointerleave",fe),I.domElement.removeEventListener("pointerup",he),Z.disconnect(),I.setAnimationLoop(null),B.dispose(),h.forEach(ie=>ie.dispose()),I.dispose(),I.domElement.remove();},"cleanup");}).catch(()=>{y||g(true);}),()=>{y=true,k();}},[b]),jsxRuntime.jsxs("div",{ref:l,className:i,role:"group","aria-label":n,"data-monkeys-component":"relationship-galaxy",style:{position:"relative",width:"100%",height:"100%",minHeight:400,overflow:"hidden",background:"hsl(var(--radar-canvas, var(--background)))"},children:[e.map(x=>jsxRuntime.jsx("button",{ref:y=>{y?d.current.set(x.id,y):d.current.delete(x.id);},"aria-pressed":o===x.id,className:"font-sans text-xs",title:x.meta,onClick:()=>p.current?.(x),style:{display:"none",position:"absolute",left:0,top:0,maxWidth:170,border:0,background:"transparent",padding:"calc(var(--global-spacing, 0.75rem) / 6)",cursor:"pointer",textShadow:"0 1px 4px hsl(var(--radar-canvas, var(--foreground)))",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:x.label},x.id)),u&&jsxRuntime.jsx("div",{role:"alert",className:"absolute inset-0 grid place-items-center bg-background text-foreground",children:s.workbench.collection.loadError})]})}a(yk,"RelationshipGalaxy");var Ji={physics:{repulsion:18e3,linkDistance:100,weakLinkDistance:280,linkStrength:.014,strongLinkStrength:.025,centerStrength:.0015,velocityRetention:.72,maxVelocity:35,collisionPadding:18,collisionPasses:2,cooling:.975,minAlpha:.002,ticksPerFrame:2},nodes:{fontSize:13,iconSize:16,showIcons:true,showLabels:true,focusScale:1.08,borderRadius:999,glow:true,contextOpacity:null},edges:{visible:true,curved:true,widthScale:1,opacityScale:1,glow:true,color:null},interaction:{pan:true,zoom:true,dragNodes:true,keyboard:true,openNodes:true,dragThreshold:4,keyboardStep:15,keyboardFastStep:50},viewport:{minZoom:.08,maxZoom:8,fitMaxZoom:2,fitPadding:60,screenPadding:50,zoomSensitivity:.0012,zoomStep:180,fitOnResize:true},ui:{controls:true,minimap:true,minimapWidth:156,minimapHeight:108,dock:"bottom-left"}};for(let e of Object.values(Ji))Object.freeze(e);Object.freeze(Ji);var xk={repulsion:[0,1e6],linkDistance:[0,2e3],weakLinkDistance:[0,3e3],linkStrength:[0,.2],strongLinkStrength:[0,.2],centerStrength:[0,.1],velocityRetention:[0,.99],maxVelocity:[1,100],collisionPadding:[0,200],collisionPasses:[0,8],cooling:[.5,.995],minAlpha:[.001,.1],ticksPerFrame:[1,10],fontSize:[8,48],iconSize:[8,64],focusScale:[.5,2],borderRadius:[0,999],contextOpacity:[0,1],widthScale:[0,8],opacityScale:[0,5],dragThreshold:[0,30],keyboardStep:[1,200],keyboardFastStep:[1,500],minZoom:[.01,20],maxZoom:[.01,20],fitMaxZoom:[.01,20],fitPadding:[0,500],screenPadding:[0,300],zoomSensitivity:[1e-4,.01],zoomStep:[1,1e3],minimapWidth:[140,360],minimapHeight:[60,300]},vk=new Set(["collisionPasses","ticksPerFrame"]),wk=a(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"record");function fl(e={}){if(!wk(e))throw new Error("config must be an object");let t=structuredClone(Ji);for(let[o,r]of Object.entries(e)){if(!Object.prototype.hasOwnProperty.call(t,o))throw new Error(`Unknown config group: ${o}`);if(!wk(r))throw new Error(`config.${o} must be an object`);let n=t[o];for(let[i,s]of Object.entries(r)){let l=`config.${o}.${i}`;if(!Object.prototype.hasOwnProperty.call(n,i))throw new Error(`Unknown field: ${l}`);if((i==="contextOpacity"||i==="color")&&s===null){n[i]=null;continue}if(i==="dock"){if(typeof s!="string"||!["bottom-left","bottom-right","top-left","top-right"].includes(s))throw new Error(`${l} must be a supported corner`)}else if(i==="color"){if(typeof s!="string"||!/^#[\da-f]{6}$/i.test(s))throw new Error(`${l} must be a #RRGGBB color or null`)}else if(xk[i]){let[d,c]=xk[i];if(typeof s!="number"||!Number.isFinite(s)||s<d||s>c||vk.has(i)&&!Number.isInteger(s))throw new Error(`${l} must be ${vk.has(i)?"an integer":"a number"} in [${d}, ${c}]`)}else if(typeof s!="boolean")throw new Error(`${l} must be a boolean`);n[i]=s;}}if(t.viewport.minZoom>t.viewport.maxZoom)throw new Error("config.viewport.minZoom must not exceed maxZoom");return t}a(fl,"resolveRelationshipGraphConfig");var qf=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp");function Pu(e,t,o={}){let r=fl({physics:o.physics??{}}).physics,n=[...e].sort((u,g)=>u.id.localeCompare(g.id,"en")).map((u,g)=>({...u,x:Number.isFinite(u.x)?u.x:Math.cos(g*2.39996)*100,y:Number.isFinite(u.y)?u.y:Math.sin(g*2.39996)*100,vx:0,vy:0,...o.fixedNodes?.has(u.id)?{fx:o.fixedNodes.get(u.id).x,fy:o.fixedNodes.get(u.id).y}:{}})),i=new Map(n.map(u=>[u.id,u])),s=t.flatMap(u=>{let g=i.get(u.sourceId),f=i.get(u.targetId);if(!g||!f||g===f)return [];let b=Number.isFinite(u.associationStrength)?qf(u.associationStrength,0,1):0;return [{source:g,target:f,strength:b,distance:(g.width+f.width)/2+(r.linkDistance+(1-b)*r.weakLinkDistance)}]}).sort((u,g)=>`${u.source.id}:${u.target.id}`.localeCompare(`${g.source.id}:${g.target.id}`,"en")),l=o.center??{x:3800,y:2800},d=n.length?1:0,c=0;function p(u=1){for(let g=0;g<u&&d>0;g++){for(let f=0;f<n.length;f++)for(let b=f+1;b<n.length;b++){let x=n[f],y=n[b],k=y.x-x.x,w=y.y-x.y;if(Math.abs(k)+Math.abs(w)<.01){let C=(f+b+1)*2.39996;k=Math.cos(C),w=Math.sin(C);}let v=Math.max(1,Math.hypot(k,w)),h=Math.min(8,r.repulsion/Math.max(2500,v*v))*d,S=k/v*h,T=w/v*h;x.vx-=S,x.vy-=T,y.vx+=S,y.vy+=T;}for(let{source:f,target:b,strength:x,distance:y}of s){let k=b.x-f.x,w=b.y-f.y,v=Math.max(1,Math.hypot(k,w)),h=(v-y)*(r.linkStrength+x*r.strongLinkStrength)*d,S=k/v*h,T=w/v*h;f.vx+=S,f.vy+=T,b.vx-=S,b.vy-=T;}c=0;for(let f of n)f.vx=qf((f.vx+(l.x-f.x)*r.centerStrength*d)*r.velocityRetention,-r.maxVelocity,r.maxVelocity),f.vy=qf((f.vy+(l.y-f.y)*r.centerStrength*d)*r.velocityRetention,-r.maxVelocity,r.maxVelocity),f.fx!==void 0&&f.fy!==void 0?(f.x=f.fx,f.y=f.fy,f.vx=f.vy=0):(f.x+=f.vx,f.y+=f.vy,c+=f.vx*f.vx+f.vy*f.vy);for(let f=0;f<r.collisionPasses;f++)for(let b=0;b<n.length;b++)for(let x=b+1;x<n.length;x++){let y=n[b],k=n[x],w=k.x-y.x,v=k.y-y.y,h=(y.width+k.width)/2+r.collisionPadding-Math.abs(w),S=(y.height+k.height)/2+r.collisionPadding-Math.abs(v);if(h<=0||S<=0)continue;let T=y.fx===void 0,C=k.fx===void 0,R=Number(T)+Number(C);if(R)if(h<S){let M=Math.sign(w||1)*h/R;T&&(y.x-=M),C&&(k.x+=M);}else {let M=Math.sign(v||1)*S/R;T&&(y.y-=M),C&&(k.y+=M);}}d*=r.cooling,d<r.minAlpha&&(d=0);}return d>0}return a(p,"step"),{step:p,get active(){return d>0},get energy(){return c},positions:a(()=>new Map(n.map(({id:u,x:g,y:f})=>[u,{x:g,y:f}])),"positions"),reheat(){n.length&&(d=Math.max(d,.65));},pin(u,g,f){let b=i.get(u);!b||!Number.isFinite(g)||!Number.isFinite(f)||(b.x=b.fx=g,b.y=b.fy=f,b.vx=b.vy=0,d=Math.max(d,.65));},release(u){let g=i.get(u);if(!g)return;let f=o.fixedNodes?.get(u);g.fx=f?.x,g.fy=f?.y,d=Math.max(d,.65);}}}a(Pu,"createForceSimulation");var G5=a((e,t,o,r={})=>{let n=[...e].sort((d,c)=>d.id.localeCompare(c.id,"en")),i=new Map;for(let d of t)i.set(d.sourceId,(i.get(d.sourceId)??0)+1),i.set(d.targetId,(i.get(d.targetId)??0)+1);let s=n.map((d,c)=>{let p=c*Math.PI*(3-Math.sqrt(5)),u=d.role==="focus"?0:130*Math.sqrt(c+1);return {...d,x:3800+Math.cos(p)*u,y:2800+Math.sin(p)*u}}),l=Pu(s,t,r);return l.step(Math.max(1,Math.min(1e3,Number.isFinite(o)?Math.floor(o):280))),new Map([...l.positions()].map(([d,c])=>[d,{...c,degree:i.get(d)??0}]))},"layoutTrendRadarFocusTopology"),Eu=a((e,t)=>{if(!e.length)return {x:0,y:0,width:2,height:2};let o=Math.min(...e.map(s=>s.x-s.width/2))-t,r=Math.max(...e.map(s=>s.x+s.width/2))+t,n=Math.min(...e.map(s=>s.y-s.height/2))-t,i=Math.max(...e.map(s=>s.y+s.height/2))+t;return {x:o,y:n,width:Math.max(2,r-o),height:Math.max(2,i-n)}},"calculateTrendRadarFocusTopologyBounds");var Mr={x:0,y:0,width:7600,height:5600};var $5=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp");var kk=a(e=>{let t=Number.isFinite(e)?$5(e,0,1):0,o=.8+Math.pow(t,1.35)*7.2;return {strokeWidth:o,strokeOpacity:.26+t*.7,glowWidth:o+3+t*7,glowOpacity:t<.28?.02:.04+t*.14}},"getTrendRadarFocusTopologyFocusEdgeStyle"),Au=a((e,t="dark")=>{let o=a((l,d,c)=>`color-mix(in srgb, ${d} ${c}%, ${l})`,"mix"),r=e.role==="context",n=e.role==="focus",i=o("hsl(var(--monkeys-color-background))",e.solidColor,t==="light"?n?16:r?4:10:n?48:40),s=t==="light"?o(r?"hsl(var(--monkeys-color-muted-foreground))":"hsl(var(--monkeys-color-foreground))",e.solidColor,r?10:38):o(e.color,"hsl(var(--monkeys-color-foreground))",n?45:34);return {background:i,foreground:s,border:o(i,s,n?82:67)}},"getTrendRadarFocusTopologyNodeTone"),j5=a((e,t)=>{let o=t.x-e.x,r=t.y-e.y,n=Math.max(Math.hypot(o,r),1),i=Math.min(72,Math.max(18,n*.13)),s=e.id.localeCompare(t.id)>=0?1:-1;return {x:(e.x+t.x)/2+r/n*i*s,y:(e.y+t.y)/2-o/n*i*s}},"getTrendRadarFocusTopologyEdgeControlPoint"),Ck=a((e,t)=>{let o=j5(e,t);return `M ${e.x} ${e.y} Q ${o.x} ${o.y} ${t.x} ${t.y}`},"getTrendRadarFocusTopologyEdgePath");var dL={"align-justify":lucideReact.AlignJustify,grid:lucideReact.Grid3X3,layers:lucideReact.Layers,"map-pin":lucideReact.MapPin,mountain:lucideReact.Mountain,package:lucideReact.Package,paintbrush:lucideReact.Paintbrush,palette:lucideReact.Palette,scissors:lucideReact.Scissors,shield:lucideReact.Shield,"shield-check":lucideReact.ShieldCheck,shirt:lucideReact.Shirt,snowflake:lucideReact.Snowflake,sparkles:lucideReact.Sparkles,user:lucideReact.UserRound,users:lucideReact.UsersRound},cL=a((e,t)=>{if(e.role!=="focus")return "var(--trend-radar-muted-color)";let o=Math.pow(e.associationStrength,1.2)*86;return `color-mix(in srgb, var(--trend-radar-muted-color), ${t.color} ${o}%)`},"edgeStroke");function Tk({model:e,config:t=Ji,onOpenNode:o,renderNodeAction:r,relationshipLabel:n,colorMode:i="dark",onNodePointerDown:s,onNodeKeyDown:l}){let d=a((u,g)=>t.edges.curved?Ck(u,g):`M ${u.x} ${u.y} L ${g.x} ${g.y}`,"edgePath"),c=ho.useId().replace(/:/g,""),p=ho.useMemo(()=>new Map(e.nodes.map(u=>[u.id,u])),[e.nodes]);return jsxRuntime.jsxs("div",{className:"trend-radar-focus-topology-background pointer-events-none relative size-full overflow-visible","data-radar-focus-topology-surface":"true","data-radar-focus-topology-color-mode":i,children:[t.edges.visible&&jsxRuntime.jsxs("svg",{viewBox:`0 0 ${Mr.width} ${Mr.height}`,className:"absolute inset-0 size-full overflow-visible","aria-hidden":"true",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("filter",{id:c,x:"-40%",y:"-40%",width:"180%",height:"180%",children:jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"7"})})}),jsxRuntime.jsx("g",{"data-radar-focus-topology-edge-layer":"context",children:e.edges.filter(u=>u.role!=="focus").map(u=>{let g=p.get(u.sourceId),f=p.get(u.targetId);return !g||!f?null:jsxRuntime.jsx("path",{d:d(g,f),fill:"none",stroke:t.edges.color??"var(--trend-radar-muted-color)",strokeWidth:Math.max(.8,.72+Math.pow(u.associationStrength,1.08)*2.2)*t.edges.widthScale,strokeOpacity:Math.min(1,(u.role==="related"?.12:.045)*t.edges.opacityScale),strokeLinecap:"round",strokeLinejoin:"round"},u.id)})}),jsxRuntime.jsx("g",{"data-radar-focus-topology-edge-layer":"focus",children:e.edges.filter(u=>u.role==="focus").map(u=>{let g=p.get(u.sourceId),f=p.get(u.targetId);if(!g||!f)return null;let b=d(g,f),x=t.edges.color??cL(u,g.id===e.subjectId?f:g),y=kk(u.associationStrength);return jsxRuntime.jsxs("g",{"data-radar-focus-topology-focus-edge":u.id,"data-radar-focus-topology-association-strength":u.associationStrength.toFixed(4),children:[jsxRuntime.jsx("path",{d:b,fill:"none",stroke:x,strokeWidth:y.glowWidth*t.edges.widthScale,strokeOpacity:t.edges.glow?Math.min(1,y.glowOpacity*t.edges.opacityScale):0,strokeLinecap:"round",filter:`url(#${c})`}),jsxRuntime.jsx("path",{d:b,fill:"none",stroke:x,strokeWidth:y.strokeWidth*t.edges.widthScale,strokeOpacity:Math.min(1,y.strokeOpacity*t.edges.opacityScale),strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("title",{children:n(u)})})]},u.id)})})]}),e.nodes.map(u=>{let g=dL[u.iconName]??lucideReact.Palette,f=Au(u,i),b=u.role==="focus",x=u.role==="context",y=!!(o&&!b);return jsxRuntime.jsxs("div",{className:m("absolute transition-[filter,opacity,transform] duration-200",b?"z-20":u.role==="related"?"z-10":"z-0",x&&i==="dark"&&"opacity-[0.18] brightness-[0.72] saturate-[0.3] hover:!opacity-100 hover:!filter-none"),style:{"--radar-node-background":f.background,"--radar-node-foreground":f.foreground,"--radar-node-border":f.border,left:u.x,opacity:x?t.nodes.contextOpacity??(i==="dark"?u.contextOpacity:void 0):void 0,top:u.y,width:u.width,height:u.height,transform:`translate(-50%, -50%) scale(${b?t.nodes.focusScale:1})`,transformOrigin:"center center"},"data-radar-focus-topology-node-anchor":u.ref.id,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!y&&!s,"aria-label":u.label,title:u.taxonomy?.secondaryLabel?`${u.label} \xB7 ${u.taxonomy.secondaryLabel}`:u.label,onPointerDown:k=>{k.stopPropagation(),s?.(k,u);},onKeyDown:k=>l?.(k,u),onClick:k=>{k.stopPropagation(),y&&o?.(u);},className:m("focus-visible:ring-primary pointer-events-auto flex size-full items-center justify-center gap-2 rounded-full border-0 px-3 text-left text-[0.8125rem] leading-none font-semibold outline-hidden transition-[box-shadow,filter,transform] focus-visible:ring-2",y&&"cursor-pointer hover:brightness-110",!y&&"cursor-default disabled:opacity-100"),style:{fontSize:t.nodes.fontSize,borderRadius:t.nodes.borderRadius,color:f.foreground,backgroundColor:f.background,boxShadow:t.nodes.glow?b?`inset 0 0 0 2px ${f.border}, 0 0 34px ${u.color}66`:u.role==="related"?`inset 0 0 0 1px ${f.border}, 0 0 18px ${u.color}24`:`inset 0 0 0 1px ${f.border}`:`inset 0 0 0 ${b?2:1}px ${f.border}`},"data-radar-focus-topology-node":u.ref.id,"data-world-x":u.x.toFixed(2),"data-world-y":u.y.toFixed(2),"data-radar-focus-topology-node-role":u.role,children:[t.nodes.showIcons&&jsxRuntime.jsx(g,{className:"shrink-0",size:t.nodes.iconSize,color:f.foreground,strokeWidth:1.8,"aria-hidden":"true"}),t.nodes.showLabels&&jsxRuntime.jsx("span",{className:"min-w-0 truncate",style:{color:"inherit"},children:u.label})]}),r?.(u)]},u.id)})]})}a(Tk,"TrendRadarFocusTopologySurface");function zu({model:e,config:t,onCameraChange:o,colorMode:r="light",ariaLabel:n,onOpenNode:i,renderNodeAction:s,nodeAction:l,onNodeAction:d,relationshipLabel:c,controls:p,onNodePositionChange:u}){if(l?.maxActive!==void 0&&(!Number.isSafeInteger(l.maxActive)||l.maxActive<1))throw new TypeError("Node action maxActive must be a positive integer.");if(l?.size!==void 0&&(!Number.isFinite(l.size)||l.size<16||l.size>48))throw new TypeError("Node action size must be between 16 and 48.");let g=ho.useMemo(()=>fl(t),[t]),f=ho.useMemo(()=>new Set(l?.activeNodeIds??[]),[l?.activeNodeIds]),b=JSON.stringify(g.physics),x=ho.useMemo(()=>JSON.parse(b),[b]),y=JSON.stringify(g.viewport),k=ho.useMemo(()=>JSON.parse(y),[y]),{interaction:w,ui:v}=g,h=ho.useRef(null),S=ho.useRef(),T=JSON.stringify({nodes:e.nodes.map(({id:O,x:K,y:ne,width:fe,height:he})=>({id:O,x:K,y:ne,width:fe,height:he})),edges:e.edges.map(({sourceId:O,targetId:K,associationStrength:ne})=>({sourceId:O,targetId:K,associationStrength:ne}))}),C=ho.useMemo(()=>{let O=JSON.parse(T);return Pu(O.nodes,O.edges,{physics:x})},[T,x]),[R,M]=ho.useState(()=>C.positions()),[I,B]=ho.useState(false),[N,D]=ho.useState({x:0,y:0,z:1}),E=ho.useRef(o);E.current=o,ho.useEffect(()=>{E.current?.(N);},[N]);let P=ho.useRef(N),W=ho.useRef(),H=ho.useRef(false),[A,L]=ho.useState({width:1,height:1}),F=ho.useRef(false),G=ho.useMemo(()=>e.nodes.map(O=>({...O,...R.get(O.id)??{}})),[e.nodes,R]),$=ho.useRef(G);$.current=G;let _=ho.useCallback(O=>{P.current=O,D(O);},[]),z=ho.useCallback(()=>{if(S.current!==void 0)return;if(F.current&&!W.current){C.step(1400),M(C.positions()),B(false);return}B(C.active);let O=a(()=>{C.step(x.ticksPerFrame),M(C.positions()),C.active?S.current=requestAnimationFrame(O):(S.current=void 0,B(false));},"tick");S.current=requestAnimationFrame(O);},[C,x.ticksPerFrame]),re=ho.useCallback(()=>{let O=h.current;if(!O)return;let K=Eu($.current,k.fitPadding),ne=Math.max(k.minZoom,Math.min(k.maxZoom,k.fitMaxZoom,(O.clientWidth-k.screenPadding*2)/K.width,(O.clientHeight-k.screenPadding*2)/K.height));_({x:O.clientWidth/(2*ne)-K.x-K.width/2,y:O.clientHeight/(2*ne)-K.y-K.height/2,z:ne});},[_,k]);ho.useEffect(()=>{F.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;let O=C.positions();return M(O),$.current=$.current.map(K=>({...K,...O.get(K.id)})),re(),z(),()=>{S.current!==void 0&&cancelAnimationFrame(S.current),S.current=void 0;let K=W.current;K?.target.hasPointerCapture?.(K.pointerId)&&K.target.releasePointerCapture(K.pointerId),W.current=void 0;}},[C,re,z]),ho.useEffect(()=>{let O=h.current;if(!O)return;let K=new ResizeObserver(()=>{L({width:O.clientWidth,height:O.clientHeight}),k.fitOnResize&&re();});return K.observe(O),()=>K.disconnect()},[re,k.fitOnResize]);let Z=ho.useCallback((O,K,ne)=>{if(!w.zoom)return;let fe=P.current,he=Math.max(k.minZoom,Math.min(k.maxZoom,fe.z*Math.exp(-O*k.zoomSensitivity)));_({x:fe.x-K/fe.z+K/he,y:fe.y-ne/fe.z+ne/he,z:he});},[_,k,w.zoom]);ho.useEffect(()=>{let O=h.current;if(!O)return;let K=a(ne=>{if(W.current||!w.zoom)return;ne.preventDefault();let fe=O.getBoundingClientRect();Z(ne.deltaY,ne.clientX-fe.left,ne.clientY-fe.top);},"wheel");return O.addEventListener("wheel",K,{passive:false}),()=>O.removeEventListener("wheel",K)},[Z,w.zoom]);let ae=a((O,K)=>{if(O.button!==0||W.current||(K?!w.dragNodes:!w.pan))return;H.current=false;let ne=P.current;W.current={pointerId:O.pointerId,id:K?.id,startX:O.clientX,startY:O.clientY,x:K?.x??ne.x,y:K?.y??ne.y,moved:false,target:O.currentTarget},O.currentTarget.setPointerCapture(O.pointerId),K&&(C.pin(K.id,K.x,K.y),z());},"begin"),ee=a(O=>{let K=W.current;if(!(!K||K.pointerId!==O.pointerId)){if(W.current=void 0,H.current=K.moved,K.id){let ne=C.positions().get(K.id);C.release(K.id),z(),K.moved&&ne&&u?.(K.id,ne);}K.target.hasPointerCapture(O.pointerId)&&K.target.releasePointerCapture(O.pointerId);}},"end"),q={...e,nodes:G},U=new Map(G.map(O=>[O.id,O])),X=Eu([...e.nodes,...G],200);return jsxRuntime.jsxs("section",{ref:h,className:"relationship-graph bg-background relative size-full overflow-hidden",style:{cursor:w.pan?void 0:"default",touchAction:w.pan||w.dragNodes?"none":"auto"},role:"region","aria-label":n,"data-radar-focus-topology":"true","data-graph-engine":"native-force","data-force-running":I,"data-radar-focus-topology-camera":`${N.x.toFixed(2)},${N.y.toFixed(2)},${N.z.toFixed(3)}`,onPointerDown:O=>{O.target.closest("button")||ae(O);},onPointerMove:O=>{let K=W.current;if(!K||K.pointerId!==O.pointerId)return;let ne=O.clientX-K.startX,fe=O.clientY-K.startY;K.moved||(K.moved=Math.hypot(ne,fe)>w.dragThreshold),K.moved&&(K.id?(C.pin(K.id,K.x+ne/P.current.z,K.y+fe/P.current.z),M(C.positions()),z()):_({...P.current,x:K.x+ne/P.current.z,y:K.y+fe/P.current.z}));},onPointerUp:ee,onPointerCancel:ee,onLostPointerCapture:ee,onClickCapture:O=>{H.current&&(O.preventDefault(),O.stopPropagation(),H.current=false);},children:[jsxRuntime.jsx("div",{style:{position:"absolute",left:0,top:0,width:Mr.width,height:Mr.height,transformOrigin:"0 0",transform:`translate(${N.x*N.z}px, ${N.y*N.z}px) scale(${N.z})`},children:jsxRuntime.jsx(Tk,{model:q,config:g,colorMode:r,relationshipLabel:c,onOpenNode:w.openNodes?i:void 0,renderNodeAction:s??(l&&d?O=>{if(l.nodeKinds&&!l.nodeKinds.includes(O.ref.kind))return null;let K=f.has(O.id),ne=l.disabled||!K&&l.maxActive!==void 0&&f.size>=l.maxActive,fe=`${K?l.activeLabel??l.label:l.label}: ${O.label}`,he=K?lucideReact.Check:lucideReact.Plus,me=l.size??24;return jsxRuntime.jsx("button",{type:"button","data-relationship-node-action":O.id,"aria-label":fe,title:fe,"aria-pressed":K,disabled:ne,className:"grid place-items-center rounded-md border border-current bg-card text-foreground shadow-sm outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",style:{position:"absolute",right:0,top:0,width:me,height:me,color:Au(O,r).foreground,transform:`translate(50%, -50%) scale(${l.keepScreenSize===false?1:1/N.z})`,transformOrigin:"center"},onPointerDown:ie=>ie.stopPropagation(),onKeyDown:ie=>ie.stopPropagation(),onClick:ie=>{ie.stopPropagation(),d(O);},children:jsxRuntime.jsx(he,{size:me*.6,"aria-hidden":"true"})})}:void 0),onNodePointerDown:w.dragNodes?(O,K)=>ae(O,K):void 0,onNodeKeyDown:(O,K)=>{if(!w.keyboard||!w.dragNodes)return;let ne={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[O.key];if(!ne)return;O.preventDefault(),O.stopPropagation();let fe=(O.shiftKey?w.keyboardFastStep:w.keyboardStep)/P.current.z,he={x:K.x+ne[0]*fe,y:K.y+ne[1]*fe};C.pin(K.id,he.x,he.y),M(C.positions()),C.release(K.id),z(),u?.(K.id,he);}})}),(v.controls||v.minimap)&&jsxRuntime.jsxs("div",{className:"relationship-minimap","data-radar-focus-topology-minimap":"true",style:{width:v.minimapWidth,left:v.dock.endsWith("left")?12:"auto",right:v.dock.endsWith("right")?12:"auto",top:v.dock.startsWith("top")?12:"auto",bottom:v.dock.startsWith("bottom")?12:"auto"},children:[v.controls&&jsxRuntime.jsxs("div",{className:"relationship-controls",children:[jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomOut,onClick:()=>Z(k.zoomStep,A.width/2,A.height/2),disabled:!w.zoom||N.z<=k.minZoom,children:jsxRuntime.jsx(lucideReact.Minus,{size:15})}),jsxRuntime.jsxs("output",{children:[Math.round(N.z*100),"%"]}),jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomIn,onClick:()=>Z(-k.zoomStep,A.width/2,A.height/2),disabled:!w.zoom||N.z>=k.maxZoom,children:jsxRuntime.jsx(lucideReact.Plus,{size:15})}),jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomToFit,onClick:re,children:jsxRuntime.jsx(lucideReact.LocateFixed,{size:15})})]}),v.minimap&&jsxRuntime.jsx("button",{type:"button",className:"relationship-minimap-map",disabled:!w.pan,"aria-label":p.minimap,onClick:O=>{if(O.detail===0){re();return}let K=O.currentTarget.getBoundingClientRect(),ne=(O.clientX-K.left)/K.width*X.width+X.x,fe=(O.clientY-K.top)/K.height*X.height+X.y;_({...N,x:A.width/(2*N.z)-ne,y:A.height/(2*N.z)-fe});},children:jsxRuntime.jsxs("svg",{viewBox:`${X.x} ${X.y} ${X.width} ${X.height}`,style:{height:v.minimapHeight},preserveAspectRatio:"none","aria-hidden":"true",children:[e.edges.map(O=>{let K=U.get(O.sourceId),ne=U.get(O.targetId);return K&&ne?jsxRuntime.jsx("line",{x1:K.x,y1:K.y,x2:ne.x,y2:ne.y,stroke:"currentColor",strokeWidth:2,opacity:.2},O.id):null}),G.map(O=>jsxRuntime.jsx("circle",{cx:O.x,cy:O.y,r:O.role==="focus"?14:8,fill:O.color},O.id)),jsxRuntime.jsx("rect",{x:-N.x,y:-N.y,width:A.width/N.z,height:A.height/N.z,fill:"currentColor",fillOpacity:.07,stroke:"currentColor",strokeWidth:4})]})})]})]})}a(zu,"RelationshipGraph2D");var fL={primary:"hsl(var(--radar-series-one, var(--primary)))",secondary:"hsl(var(--radar-series-two, var(--success)))",accent:"hsl(var(--radar-series-three, var(--warning)))",muted:"hsl(var(--radar-series-four, var(--muted-foreground)))"},bL={nodes:{showIcons:false,glow:false,contextOpacity:1},edges:{glow:false,opacityScale:3,widthScale:.5}};function Mk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:n="Relationship graph",className:i,height:s=440}){let l=Ye(),d=On(),c=JSON.stringify([e,t]),p=ho.useMemo(()=>Iu(e,t),[c]),u=ho.useMemo(()=>({subjectId:o??"",bounds:Mr,focusBounds:Mr,nodes:p.points.map(b=>{let x=Math.max(88,Math.min(240,Array.from(b.label).length*14+32)),y=fL[b.tone??"muted"];return {id:b.id,ref:{kind:"node",id:b.id},label:b.label,x:Mr.width/2+b.x*70,y:Mr.height/2+b.y*70,width:x,height:36,radius:x/2,score:0,degree:p.neighbors.get(b.id)?.size??0,colorKey:b.tone??"muted",color:y,solidColor:y,iconName:"layers",role:b.id===o?"focus":"related"}}),edges:p.links.map((b,x)=>({id:b.id??`${b.sourceId}:${b.targetId}:${x}`,sourceId:b.sourceId,targetId:b.targetId,evidenceRefs:[],evidenceCount:0,associationStrength:1,role:b.sourceId===o||b.targetId===o?"focus":"related"}))}),[p,o]),g=ho.useMemo(()=>new Map(e.map(b=>[b.id,b])),[c]),f=ho.useMemo(()=>new Map(p.links.map((b,x)=>[b.id??`${b.sourceId}:${b.targetId}:${x}`,b.label??`${g.get(b.sourceId)?.label} \u2192 ${g.get(b.targetId)?.label}`])),[p,g]);return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-relationship-graph","data-workbench-relationship-variant":"force-2d",className:m("relative h-[var(--relationship-height)] min-h-0 min-w-0 overflow-hidden",i),style:{"--relationship-height":`${s}px`},children:jsxRuntime.jsx(zu,{model:u,config:bL,colorMode:d?.colorMode==="dark"?"dark":"light",ariaLabel:n,controls:l.workbench.relationshipGraph??{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview"},relationshipLabel:b=>f.get(b.id)??"",onOpenNode:r?b=>{let x=g.get(b.id);x&&r(x);}:void 0})})}a(Mk,"RelationshipForce2D");var gL={primary:"fill-primary/10 stroke-primary text-primary",secondary:"fill-secondary stroke-secondary-foreground text-secondary-foreground",accent:"fill-accent stroke-accent-foreground text-accent-foreground",muted:"fill-muted stroke-muted-foreground text-muted-foreground"},hL={primary:"--radar-series-one",secondary:"--radar-series-two",accent:"--radar-series-three",muted:"--radar-series-four"},yL={primary:"var(--primary)",secondary:"var(--secondary-foreground)",accent:"var(--accent-foreground)",muted:"var(--muted-foreground)"},Fu=a((e,t=1)=>`hsl(var(${hL[e]}, ${yL[e]}) / ${t})`,"radarToneColor"),xL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateNode");function Dk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,width:n=900,height:i=440,emptyState:s=null,ariaLabel:l="Relationship graph",className:d,variant:c="default"}){if(!e.length)return V(s)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:s}):null;if(c==="galaxy")return jsxRuntime.jsx(yk,{nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:l,className:d});if(c==="force-2d")return jsxRuntime.jsx(Mk,{nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:l,className:d,height:i});let p=c==="radar",u=Math.min(n,i)*(p?.37:.35),g=o?e.findIndex(x=>x.id===o):-1,f=g>=0?e.filter((x,y)=>y!==g):e,b=new Map(e.map((x,y)=>{if(e.length===1)return [x.id,{x:n/2,y:i/2}];if(p&&y===g)return [x.id,{x:n/2,y:i/2}];let k=f.findIndex(v=>v.id===x.id),w=Math.PI*2*k/f.length-Math.PI/2;return [x.id,{x:n/2+Math.cos(w)*u,y:i/2+Math.sin(w)*u}]}));return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-relationship-graph","data-workbench-relationship-variant":c,className:m("relative min-w-0 overflow-hidden rounded-lg border",p?"min-h-[42rem]":"overflow-x-auto border-border/70 bg-card",d),style:p?{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",borderColor:"hsl(var(--radar-shell-border, var(--border)))",backgroundImage:"linear-gradient(hsl(var(--radar-grid, var(--border)) / 0.28) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--radar-grid, var(--border)) / 0.28) 1px, transparent 1px), radial-gradient(circle at center, hsl(var(--primary) / 0.1), transparent 45%)",backgroundSize:"4rem 4rem, 4rem 4rem, 100% 100%"}:void 0,children:jsxRuntime.jsxs("svg",{viewBox:`0 0 ${n} ${i}`,className:m(p?"absolute inset-0 size-full":"min-w-[42rem]"),preserveAspectRatio:p?"xMidYMid meet":void 0,role:"img","aria-label":l,children:[t.map((x,y)=>{let k=b.get(x.sourceId),w=b.get(x.targetId);return !k||!w?null:jsxRuntime.jsx("line",{x1:k.x,y1:k.y,x2:w.x,y2:w.y,className:p?void 0:"stroke-border",strokeWidth:p?"2":"1.5",style:p?{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.46)",filter:"drop-shadow(0 0 0.35rem hsl(var(--primary) / 0.34))"}:void 0,children:jsxRuntime.jsx("title",{children:x.label||`${x.sourceId} to ${x.targetId}`})},x.id||`${x.sourceId}:${x.targetId}:${y}`)}),e.map(x=>{let y=b.get(x.id),k=x.id===o,w=x.tone||"muted",v=p?{color:Fu(w)}:void 0;return jsxRuntime.jsxs("g",{transform:`translate(${y.x}, ${y.y})`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":x.meta?`${x.label}, ${x.meta}`:x.label,"aria-pressed":r?k:void 0,onClick:r?()=>r(x):void 0,onKeyDown:h=>xL(h,x,r),className:m(p?"outline-hidden":gL[w],r&&"cursor-pointer outline-hidden"),style:v,children:[jsxRuntime.jsx("circle",{r:p&&k?"50":p?"40":"36",className:m("stroke-1 transition-[stroke-width] duration-150 motion-reduce:transition-none",k&&"stroke-[3]"),style:p?{fill:Fu(w,k?.22:.12),stroke:Fu(w,k?1:.78),filter:`drop-shadow(0 0 ${k?"1.4rem":"0.75rem"} ${Fu(w,.62)})`}:void 0}),jsxRuntime.jsx("text",{textAnchor:"middle",y:x.meta?-3:4,className:m("pointer-events-none fill-current font-semibold",p?"text-sm":"text-xs"),children:x.label.slice(0,18)}),x.meta?jsxRuntime.jsx("text",{textAnchor:"middle",y:"16",className:m("pointer-events-none text-xs",p?"fill-current opacity-70":"fill-muted-foreground"),children:x.meta.slice(0,22)}):null]},x.id)})]})})}a(Dk,"WorkbenchRelationshipGraph");var wL={primary:"fill-primary stroke-primary",secondary:"fill-secondary stroke-secondary-foreground",accent:"fill-accent stroke-accent-foreground",muted:"fill-muted stroke-muted-foreground"},kL=a(e=>e.filter(Number.isFinite),"finiteValues"),Yf=a((e,t,o)=>{let r=kL(e),n=Number.isFinite(t)?Number(t):Math.min(...r,0),i=Number.isFinite(o)?Number(o):Math.max(...r,1);return n===i?[n,i+1]:n<i?[n,i]:[i,n]},"getDomain"),hl=a((e,t,o,r)=>o+(e-t[0])/(t[1]-t[0])*(r-o),"scale"),Va=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),CL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activatePoint");function Ek({points:e,xAxis:t,yAxis:o,thresholds:r,selectedPointId:n,onPointSelect:i,width:s=900,height:l=420,emptyState:d=null,ariaLabel:c=`${t.label} by ${o.label}`,className:p}){let u=e.filter(T=>Number.isFinite(T.x)&&Number.isFinite(T.y));if(!u.length)return V(d)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:d}):null;let g=56,f=Yf(u.map(T=>T.x),t.min,t.max),b=Yf(u.map(T=>T.y),o.min,o.max),x=Yf(u.map(T=>T.size??1)),y=g,k=s-g,w=g,v=l-g,h=Number.isFinite(r?.x)?hl(Number(r?.x),f,y,k):void 0,S=Number.isFinite(r?.y)?hl(Number(r?.y),b,v,w):void 0;return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-scatter-plot",className:m("min-w-0 overflow-x-auto rounded-lg border border-border/70 bg-card p-3",p),children:jsxRuntime.jsxs("svg",{viewBox:`0 0 ${s} ${l}`,className:"min-w-[42rem]",role:"img","aria-label":c,children:[jsxRuntime.jsx("line",{x1:y,y1:v,x2:k,y2:v,className:"stroke-border"}),jsxRuntime.jsx("line",{x1:y,y1:w,x2:y,y2:v,className:"stroke-border"}),h===void 0?null:jsxRuntime.jsx("line",{x1:Va(h,y,k),y1:w,x2:Va(h,y,k),y2:v,className:"stroke-muted-foreground/50",strokeDasharray:"5 5"}),S===void 0?null:jsxRuntime.jsx("line",{x1:y,y1:Va(S,w,v),x2:k,y2:Va(S,w,v),className:"stroke-muted-foreground/50",strokeDasharray:"5 5"}),jsxRuntime.jsx("text",{x:s/2,y:l-12,textAnchor:"middle",className:"fill-muted-foreground text-xs",children:t.label}),jsxRuntime.jsx("text",{x:"16",y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,className:"fill-muted-foreground text-xs",children:o.label}),u.map(T=>{let C=Va(hl(T.x,f,y,k),y,k),R=Va(hl(T.y,b,v,w),w,v),M=T.size===void 0?9:Va(hl(T.size,x,7,18),7,18),I=n===T.id;return jsxRuntime.jsxs("g",{transform:`translate(${C}, ${R})`,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":`${T.label}: ${t.label} ${T.x}, ${o.label} ${T.y}`,"aria-pressed":i?I:void 0,onClick:i?()=>i(T):void 0,onKeyDown:B=>CL(B,T,i),className:m(i&&"cursor-pointer outline-hidden"),children:[jsxRuntime.jsx("circle",{r:M,className:m("stroke-1 opacity-80 transition-opacity duration-150 motion-reduce:transition-none",wL[T.tone||"primary"],I?"opacity-100 stroke-[3]":"hover:opacity-100")}),jsxRuntime.jsx("text",{y:-M-7,textAnchor:"middle",className:"pointer-events-none fill-foreground text-[0.6875rem] font-semibold",children:T.label.slice(0,24)}),jsxRuntime.jsx("title",{children:T.description||T.label})]},T.id)})]})})}a(Ek,"WorkbenchScatterPlot");var TL=a((e,t,o)=>{!o||t.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function Bk({items:e,onItemSelect:t,ariaLabel:o="Journey",className:r}){return jsxRuntime.jsx("nav",{"aria-label":o,"data-monkeys-component":"workbench-journey-navigation",className:m("min-w-0 overflow-x-auto rounded-lg border border-border/70 bg-card p-2",r),children:jsxRuntime.jsx("ol",{className:"flex min-w-max items-stretch gap-1",children:e.map((n,i)=>{let s=n.state||"upcoming";return jsxRuntime.jsxs("li",{className:"flex items-center",children:[i?jsxRuntime.jsx("span",{className:"mx-1 h-px w-5 bg-border","aria-hidden":"true"}):null,jsxRuntime.jsxs("button",{type:"button",disabled:n.disabled,"aria-current":s==="current"?"page":void 0,onClick:t&&!n.disabled?()=>t(n):void 0,onKeyDown:l=>TL(l,n,t),className:m("min-w-28 rounded-md border px-3 py-2 text-left outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background motion-reduce:transition-none",s==="current"&&"border-primary bg-primary text-primary-foreground",s==="complete"&&"border-primary/30 bg-primary/10 text-foreground",s==="upcoming"&&"border-transparent bg-muted/50 text-muted-foreground",n.disabled&&"cursor-not-allowed opacity-50"),children:[V(n.eyebrow)?jsxRuntime.jsx("span",{className:m("block text-[0.625rem] font-semibold uppercase tracking-[0.14em]",s==="current"?"text-primary-foreground/75":"text-muted-foreground"),children:n.eyebrow}):null,jsxRuntime.jsx("span",{className:"mt-0.5 block text-xs font-semibold",children:n.label})]})]},n.id)})})})}a(Bk,"WorkbenchJourneyNavigation");var NL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function Lk({items:e,selectedItemId:t,onItemSelect:o,emptyState:r=null,ariaLabel:n="Ranked items",className:i}){return e.length?jsxRuntime.jsx("ol",{"aria-label":n,"data-monkeys-component":"workbench-ranked-list",className:m("grid min-w-0 gap-2",i),children:e.map((s,l)=>{let d=t===s.id;return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{type:"button","aria-pressed":o?d:void 0,onClick:o?()=>o(s):void 0,onKeyDown:c=>NL(c,s,o),className:m("grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 rounded-lg border bg-card p-3 text-left text-card-foreground outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",d?"border-primary bg-primary/5":"border-border/70 hover:border-primary/40 hover:bg-accent/50",!o&&"cursor-default"),children:[jsxRuntime.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold tabular-nums text-muted-foreground",children:s.leading||l+1}),jsxRuntime.jsxs("span",{className:"min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:s.label}),V(s.description)?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.description}):null,s.tags?.length?jsxRuntime.jsx("span",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map((c,p)=>jsxRuntime.jsx("span",{className:"rounded-full bg-secondary px-2 py-0.5 text-[0.625rem] font-medium text-secondary-foreground",children:c},`${s.id}:tag:${p}`))}):null,s.metrics?.length?jsxRuntime.jsx("span",{className:"mt-2 grid grid-cols-2 gap-x-4 gap-y-1 sm:grid-cols-4",children:s.metrics.map(c=>jsxRuntime.jsxs("span",{className:"min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate text-[0.625rem] text-muted-foreground",children:c.label}),jsxRuntime.jsx("span",{className:"block text-xs font-semibold tabular-nums text-foreground",children:c.value})]},c.id))}):null]}),jsxRuntime.jsxs("span",{className:"shrink-0 text-right",children:[V(s.score)?jsxRuntime.jsx("span",{className:"block text-lg font-semibold tabular-nums text-primary",children:s.score}):null,V(s.trailing)?jsxRuntime.jsx("span",{className:"mt-1 block text-muted-foreground",children:s.trailing}):null]})]})},s.id)})}):V(r)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:r}):null}a(Lk,"WorkbenchRankedList");function Wk({title:e,description:t,items:o,onRemove:r,removeLabel:n=a(()=>"Remove","removeLabel"),actions:i,emptyState:s=null,className:l}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-selection-tray",className:m("rounded-lg border border-border/70 bg-card p-4 text-card-foreground",l),children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e}),V(t)?jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:t}):null]}),jsxRuntime.jsx("span",{className:"rounded-full bg-primary/10 px-2.5 py-1 text-xs font-semibold tabular-nums text-primary",children:o.length})]}),o.length?jsxRuntime.jsx("ul",{className:"mt-3 flex flex-wrap gap-2",children:o.map(d=>jsxRuntime.jsxs("li",{className:"flex max-w-full items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 text-xs text-foreground",children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate font-medium",children:d.label}),V(d.meta)?jsxRuntime.jsx("span",{className:"shrink-0 text-muted-foreground",children:d.meta}):null,r?jsxRuntime.jsx("button",{type:"button","aria-label":n(d),onClick:()=>r(d),className:"rounded-md px-1 text-muted-foreground outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:"\xD7"}):null]},d.id))}):jsxRuntime.jsx("div",{className:"mt-3 rounded-md border border-dashed border-border px-4 py-5 text-center text-xs text-muted-foreground",children:s}),V(i)?jsxRuntime.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2 border-t border-border pt-4",children:i}):null]})}a(Wk,"WorkbenchSelectionTray");function zk(e,t="milliseconds",o){if(t!=="milliseconds"&&t!=="seconds")return "\u2014";let r;if(typeof e=="number")r=t==="seconds"?e*1e3:e;else if(typeof e=="string"){let i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,3}))?(Z|[+-]\d{2}:\d{2})$/.exec(e);if(!i)return "\u2014";let s=Number(i[1]),l=Number(i[2]),d=Number(i[3]),c=Number(i[4]),p=Number(i[5]),u=Number(i[6]),g=new Date(0);if(g.setUTCFullYear(s,l-1,d),g.getUTCFullYear()!==s||g.getUTCMonth()!==l-1||g.getUTCDate()!==d||c>23||p>59||u>59)return "\u2014";r=Date.parse(e);}else return "\u2014";if(!Number.isFinite(r))return "\u2014";let n=new Date(r);if(!Number.isFinite(n.getTime()))return "\u2014";try{return n.toLocaleString(o)}catch{return "\u2014"}}a(zk,"renderDateTimeValue");function Ok({items:e,emptyState:t=null,ariaLabel:o="Evidence",className:r,translate:n=a(i=>i,"translate")}){let{locale:i}=Co();return e.length?jsxRuntime.jsx("ol",{"aria-label":o,"data-monkeys-component":"workbench-evidence-list",className:m("grid min-w-0 gap-0",r),children:e.map((s,l)=>jsxRuntime.jsxs("li",{className:"grid min-w-0 grid-cols-[1.25rem_minmax(0,1fr)_auto] gap-3",children:[jsxRuntime.jsxs("span",{className:"flex flex-col items-center","aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:"mt-1 flex size-5 items-center justify-center rounded-full border border-primary/40 bg-primary/10 text-[0.625rem] font-semibold text-primary",children:s.marker||l+1}),l<e.length-1?jsxRuntime.jsx("span",{className:"min-h-8 w-px flex-1 bg-border"}):null]}),jsxRuntime.jsxs("span",{className:"min-w-0 pb-5",children:[jsxRuntime.jsx("span",{className:"block text-sm font-semibold text-foreground",children:s.titleKey?n(s.titleKey):s.title}),V(s.description)||s.descriptionKey?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.descriptionKey?n(s.descriptionKey):s.description}):null,V(s.source)||s.sourceKey||V(s.timestamp)||s.timestampValue!==void 0?jsxRuntime.jsxs("span",{className:"mt-1.5 flex flex-wrap gap-x-3 gap-y-1 text-[0.6875rem] text-muted-foreground",children:[V(s.source)||s.sourceKey?jsxRuntime.jsx("span",{children:s.sourceKey?n(s.sourceKey):s.source}):null,V(s.timestamp)||s.timestampValue!==void 0?jsxRuntime.jsx("time",{children:s.timestampValue!==void 0?zk(s.timestampValue,"milliseconds",i):s.timestamp}):null]}):null]}),V(s.action)?jsxRuntime.jsx("span",{className:"pb-5",children:s.action}):null]},s.id))}):V(t)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}):null}a(Ok,"WorkbenchEvidenceList");var IL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function Hk({items:e,selectedItemId:t,onItemSelect:o,emptyState:r=null,ariaLabel:n="Assets",className:i}){return e.length?jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-asset-gallery",children:jsxRuntime.jsx(kn,{items:e,config:{getItemKey:a(s=>s.id,"getItemKey"),layout:{mode:"grid",columns:"auto",minCardWidth:"12rem",idealCardWidth:"16rem",gap:12},appearance:{hover:"none"}},ariaLabel:n,className:i,renderItem:s=>{let l=t===s.id;return jsxRuntime.jsxs("button",{type:"button","aria-pressed":o?l:void 0,onClick:o?()=>o(s):void 0,onKeyDown:d=>IL(d,s,o),className:m("group w-full overflow-hidden rounded-lg border bg-card text-left text-card-foreground outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",l?"border-primary ring-1 ring-primary":"border-border/70 hover:border-primary/40",!o&&"cursor-default"),children:[jsxRuntime.jsx("span",{className:"block aspect-[4/3] overflow-hidden bg-muted",children:jsxRuntime.jsx("img",{src:s.url,alt:s.alt,loading:"lazy",className:"size-full object-cover transition-transform duration-200 group-hover:scale-[1.02] motion-reduce:transition-none"})}),jsxRuntime.jsxs("span",{className:"block p-3",children:[V(s.title)?jsxRuntime.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:s.title}):null,V(s.description)?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.description}):null,s.badges?.length?jsxRuntime.jsx("span",{className:"mt-2 flex flex-wrap gap-1.5",children:s.badges.map((d,c)=>jsxRuntime.jsx("span",{className:"rounded-full bg-secondary px-2 py-0.5 text-[0.625rem] text-secondary-foreground",children:d},`${s.id}:badge:${c}`))}):null]})]})}})}):V(r)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:r}):null}a(Hk,"WorkbenchAssetGallery");var Vk={primary:"--radar-series-one",secondary:"--radar-series-two",accent:"--radar-series-three",muted:"--radar-series-four"},_k={primary:"var(--primary)",secondary:"var(--secondary-foreground)",accent:"var(--accent-foreground)",muted:"var(--muted-foreground)"},_a=a(e=>`hsl(var(${Vk[e]}, ${_k[e]}))`,"workbenchVisualizationToneColor"),xl=a((e,t)=>`hsl(var(${Vk[e]}, ${_k[e]}) / ${t})`,"workbenchVisualizationToneColorWithAlpha");var PL={backgroundColor:"hsl(var(--radar-canvas, var(--background)))",color:"hsl(var(--foreground))"},Gk={backgroundColor:"hsl(var(--radar-panel, var(--card)))",borderColor:"hsl(var(--radar-border, var(--border)))"};function Xf({items:e,activeItemId:t,activeChildId:o,onItemSelect:r,onChildSelect:n,footer:i,ariaLabel:s="Radar navigation"}){return jsxRuntime.jsx(Gi,{kind:"route",routeItems:e.map(l=>({...l,children:l.children?.map(d=>({...d,domProps:{"data-radar-navigation-child-id":d.id}}))})),activeItemId:t,activeChildId:o,onItemSelect:r?l=>r(l):void 0,onChildSelect:n?(l,d)=>n(l,d):void 0,footer:i,ariaLabel:s,dataComponent:"workbench-radar-navigation",widthMode:"fill",resizable:false,collapsible:false,appearance:{density:"default",surface:"outlined",activeVariant:"solid"},className:"min-w-0 self-stretch rounded-lg",classNames:{content:"p-3",list:"gap-2",item:"min-h-11 px-3 py-2 text-sm font-semibold",itemActive:"bg-primary text-primary-foreground shadow-[0_0_1.25rem_hsl(var(--primary)/0.28)]",childList:"ml-5 gap-0.5 border-l border-border/70 py-1 pl-3",childItem:"min-h-9 px-2 text-xs font-medium",childItemActive:"border-primary/40 bg-primary/15 text-primary",footer:"p-3"},style:Gk})}a(Xf,"WorkbenchRadarNavigation");function $k({navigationItems:e=[],activeNavigationId:t,activeNavigationChildId:o,onNavigationSelect:r,onNavigationChildSelect:n,navigationFooter:i,navigation:s,children:l,inspector:d,inspectorLabel:c="Context controls",className:p,contentClassName:u,minimumHeight:g="calc(100dvh - 1rem)",ariaLabel:f="Radar workspace"}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-radar-workspace","data-radar-active-navigation-id":t,"aria-label":f,className:m("grid min-w-0 gap-3 overflow-hidden p-3 lg:grid-cols-[12.5rem_minmax(0,1fr)] xl:grid-cols-[12.5rem_minmax(0,1fr)_20rem]",p),style:{...PL,minHeight:g},children:[V(s)?s:jsxRuntime.jsx(Xf,{items:e,activeItemId:t,activeChildId:o,onItemSelect:r,onChildSelect:n,footer:i}),jsxRuntime.jsx("div",{"data-radar-workspace-region":"content",className:m("relative min-h-[42rem] min-w-0 overflow-hidden rounded-lg border",u),style:{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",borderColor:"hsl(var(--radar-shell-border, var(--border)))",boxShadow:"inset 0 0 0 1px hsl(var(--radar-grid, var(--border)) / 0.22)"},children:l}),V(d)?jsxRuntime.jsx("aside",{"aria-label":c,"data-radar-workspace-region":"inspector",className:"min-h-0 overflow-y-auto rounded-lg border lg:col-span-2 xl:col-span-1",style:Gk,children:d}):null]})}a($k,"WorkbenchRadarWorkspace");function jk({title:e,icon:t,description:o,children:r,className:n}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-radar-inspector-section",className:m("border-b border-border/70 p-4 last:border-b-0",n),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-primary",children:[V(t)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:t}):null,jsxRuntime.jsx("h2",{children:e})]}),V(o)?jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:o}):null,V(r)?jsxRuntime.jsx("div",{className:"mt-3",children:r}):null]})}a(jk,"WorkbenchRadarInspectorSection");function EL(e){let{disclosure:t,onSelect:o}=e;if(!t&&!o||t?.mode==="integrated"&&(!!o||e.selected!==void 0)||t?.mode==="separate"&&!o)throw new Error("Invalid WorkbenchRadarFilterRow props.")}a(EL,"assertValidRadarFilterRowProps");function Uk(e){EL(e);let{label:t,value:o,icon:r,selected:n,disabled:i=false,tone:s,onSelect:l,disclosure:d,className:c}=e,p=n??false,u=p?void 0:"monkeys-workbench-radar-filter-row--idle",g=i?"monkeys-workbench-radar-filter-disabled":void 0,f=s??"primary",b=_a(f),x={"--workbench-radar-filter-tone":b,"--tw-ring-color":s?b:"hsl(var(--ring))",...p||s?{backgroundColor:xl(f,p?.14:.08),borderColor:b}:{}},y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(r)?jsxRuntime.jsx("span",{className:m("flex size-4 shrink-0 items-center justify-center",s?"text-[var(--workbench-radar-filter-tone)]":"text-muted-foreground"),"aria-hidden":"true",children:r}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:t}),V(o)?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 tabular-nums text-muted-foreground",children:o}):null]}),k=d?jsxRuntime.jsx("span",{"aria-hidden":"true",className:m("text-lg leading-none transition-transform motion-reduce:transition-none",d.expanded&&"rotate-90"),children:"\u203A"}):null;if(d?.mode==="separate"){let h=d.expanded?d.collapseLabel:d.expandLabel;return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-radar-filter-row",className:m("monkeys-workbench-radar-filter-row monkeys-workbench-radar-filter-row--separate",u,g,c),style:x,children:[jsxRuntime.jsx("button",{type:"button","aria-pressed":n,disabled:i,onClick:l,className:m("monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row__action",g),children:y}),jsxRuntime.jsx("button",{type:"button","aria-expanded":d.expanded,"aria-controls":d.controls,"aria-label":h,disabled:i,onClick:d.onToggle,className:m("monkeys-workbench-radar-filter-row__disclosure",g),children:k})]})}let w=d?.mode==="integrated"?d:void 0,v=w?w.expanded?w.collapseLabel:w.expandLabel:void 0;return jsxRuntime.jsxs("button",{type:"button","data-monkeys-component":"workbench-radar-filter-row","aria-label":v,"aria-pressed":w?void 0:n,"aria-expanded":w?.expanded,"aria-controls":w?.controls,disabled:i,onClick:w?.onToggle??l,className:m("monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row",u,g,c),style:x,children:[y,w?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:k}):null]})}a(Uk,"WorkbenchRadarFilterRow");function Kk({label:e,value:t,icon:o,selected:r=false,disabled:n=false,onSelect:i,className:s}){let l=!!i||n;return jsxRuntime.jsxs(l?"button":"div",{type:l?"button":void 0,"aria-pressed":i&&!n?r:void 0,disabled:l?n:void 0,onClick:i,className:m("flex min-w-0 items-center border text-xs font-semibold outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none","monkeys-workbench-radar-filter-control rounded-md",r?"border-primary bg-primary/20 text-primary":"border-border bg-background/40 text-foreground hover:border-primary/60 hover:bg-primary/10",n&&"cursor-not-allowed opacity-50",s),children:[V(o)?jsxRuntime.jsx("span",{className:"shrink-0","aria-hidden":"true",children:o}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e}),V(t)?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:t}):null]})}a(Kk,"WorkbenchRadarFilterChip");var BL=a(e=>e.filter(Number.isFinite),"finiteValues"),Qf=a((e,t,o)=>{let r=BL(e),n=Number.isFinite(t)?Number(t):Math.min(...r,0),i=Number.isFinite(o)?Number(o):Math.max(...r,1);return n===i?[n,i+1]:n<i?[n,i]:[i,n]},"getDomain"),pa=a((e,t,o,r)=>o+(e-t[0])/(t[1]-t[0])*(r-o),"scale"),ma=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),LL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activatePoint"),WL={"low-high":{x:26,y:8,anchor:"start"},"high-high":{x:974,y:8,anchor:"end"},"low-low":{x:26,y:660,anchor:"start"},"high-low":{x:974,y:660,anchor:"end"}};function qk({points:e,xAxis:t,yAxis:o,thresholds:r,quadrants:n=[],legend:i=[],selectedPointId:s,onPointSelect:l,width:d=1e3,height:c=700,labelLimit:p=18,emptyState:u=null,ariaLabel:g=`${t.label} by ${o.label} radar matrix`,className:f}){let b=e.filter(M=>Number.isFinite(M.x)&&Number.isFinite(M.y));if(!b.length)return V(u)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:u}):null;let x=Qf(b.map(M=>M.x),t.min,t.max),y=Qf(b.map(M=>M.y),o.min,o.max),k=Qf(b.map(M=>M.size??1)),w=0,v=d,h=0,S=c,T=ma(pa(Number.isFinite(r?.x)?Number(r?.x):(x[0]+x[1])/2,x,w,v),w,v),C=ma(pa(Number.isFinite(r?.y)?Number(r?.y):(y[0]+y[1])/2,y,S,h),h,S),R=new Set([...b].sort((M,I)=>(I.size??0)-(M.size??0)).slice(0,p).map(M=>M.id));return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-radar-matrix",className:m("relative size-full min-h-[42rem] min-w-0 overflow-hidden",f),style:{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",backgroundImage:"radial-gradient(circle at 78% 20%, hsl(var(--primary) / 0.08), transparent 32%), radial-gradient(circle at 18% 82%, hsl(var(--radar-series-two, var(--accent-foreground)) / 0.06), transparent 30%)"},children:[jsxRuntime.jsxs("svg",{viewBox:`0 0 ${d} ${c}`,preserveAspectRatio:"none",className:"absolute inset-0 size-full",role:"img","aria-label":g,children:[jsxRuntime.jsxs("g",{"aria-hidden":"true",children:[Array.from({length:13},(M,I)=>{let B=d/12*I,N=c/12*I;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:B,y1:0,x2:B,y2:c,style:{stroke:"hsl(var(--radar-grid, var(--border)) / 0.36)"}}),jsxRuntime.jsx("line",{x1:0,y1:N,x2:d,y2:N,style:{stroke:"hsl(var(--radar-grid, var(--border)) / 0.36)"}})]},I)}),jsxRuntime.jsx("line",{x1:T,y1:0,x2:T,y2:c,strokeWidth:"1.5",style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.64)"}}),jsxRuntime.jsx("line",{x1:0,y1:C,x2:d,y2:C,strokeWidth:"1.5",style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.64)"}})]}),n.map(M=>{let I=WL[M.id];return jsxRuntime.jsxs("g",{"aria-hidden":"true",children:[jsxRuntime.jsx("text",{x:I.x,y:I.y+20,textAnchor:I.anchor,className:"fill-muted-foreground text-[0.8125rem] font-semibold",children:M.title}),V(M.description)&&typeof M.description=="string"?jsxRuntime.jsx("text",{x:I.x,y:I.y+40,textAnchor:I.anchor,className:"fill-muted-foreground text-[0.6875rem]",children:M.description}):null]},M.id)}),b.map((M,I)=>{let B=ma(pa(M.x,x,40,d-40),40,d-40),N=ma(pa(M.y,y,c-48,54),54,c-48),D=M.tone||(I%2===0?"primary":"accent"),E=s===M.id,P=R.has(M.id),W=P?ma(pa(M.size??1,k,5,9),5,9):3.5,H=P?ma(pa(M.size??1,k,14,31),14,31):0,A={fill:_a(D),stroke:"hsl(var(--foreground) / 0.74)"},L={fill:_a(D),filter:`drop-shadow(0 0 0.65rem ${xl(D,.72)})`};return jsxRuntime.jsxs("g",{transform:`translate(${B}, ${N})`,role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":`${M.label}: ${t.label} ${M.x}, ${o.label} ${M.y}`,"aria-pressed":l?E:void 0,onClick:l?()=>l(M):void 0,onKeyDown:F=>LL(F,M,l),className:m(l&&"cursor-pointer outline-hidden"),children:[E?jsxRuntime.jsx("circle",{r:W+10,fill:"none",strokeWidth:"2",style:{stroke:xl(D,.48)}}):null,jsxRuntime.jsx("circle",{r:W,strokeWidth:"1.25",style:A}),P?jsxRuntime.jsx("text",{y:-W-8,textAnchor:"middle",fontSize:H,fontWeight:"700",style:L,className:"pointer-events-none",children:M.label.slice(0,22)}):null,jsxRuntime.jsx("title",{children:M.description||M.label})]},M.id)}),jsxRuntime.jsx("circle",{cx:T,cy:C,r:"10",style:{fill:"hsl(var(--radar-axis, var(--primary)))"}}),jsxRuntime.jsx("circle",{cx:T,cy:C,r:"3",className:"fill-primary-foreground"}),jsxRuntime.jsx("text",{x:d/2,y:c-12,textAnchor:"middle",className:"fill-muted-foreground text-[0.6875rem]",children:t.label}),jsxRuntime.jsx("text",{x:"14",y:c/2,textAnchor:"middle",transform:`rotate(-90 14 ${c/2})`,className:"fill-muted-foreground text-[0.6875rem]",children:o.label})]}),jsxRuntime.jsxs("div",{className:"absolute bottom-4 left-4 hidden w-44 overflow-hidden rounded-[var(--radius)] border bg-card/95 shadow-xl sm:block",style:{borderColor:"hsl(var(--radar-border, var(--border)))"},"aria-hidden":"true",children:[jsxRuntime.jsxs("div",{className:"flex h-9 items-center justify-between border-b border-border px-3 text-xs font-semibold text-muted-foreground",children:[jsxRuntime.jsx("span",{children:"\u2212"}),jsxRuntime.jsx("span",{children:"100%"}),jsxRuntime.jsx("span",{children:"\uFF0B"})]}),jsxRuntime.jsxs("svg",{viewBox:`0 0 ${d} ${c}`,className:"h-24 w-full",children:[jsxRuntime.jsx("rect",{width:d,height:c,style:{fill:"hsl(var(--radar-canvas, var(--background)))"}}),jsxRuntime.jsx("line",{x1:T,y1:0,x2:T,y2:c,style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.7)"},strokeWidth:"6"}),jsxRuntime.jsx("line",{x1:0,y1:C,x2:d,y2:C,style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.7)"},strokeWidth:"6"}),b.map((M,I)=>jsxRuntime.jsx("circle",{cx:ma(pa(M.x,x,40,d-40),40,d-40),cy:ma(pa(M.y,y,c-48,54),54,c-48),r:"8",style:{fill:_a(M.tone||(I%2===0?"primary":"accent"))}},M.id)),jsxRuntime.jsx("rect",{x:d*.22,y:c*.12,width:d*.58,height:c*.62,fill:"none",strokeWidth:"8",style:{stroke:"hsl(var(--primary))"}})]})]}),i.length?jsxRuntime.jsx("div",{className:"absolute bottom-4 left-1/2 hidden -translate-x-1/2 items-center gap-4 rounded-full border border-border bg-card/95 px-4 py-2 text-xs font-semibold shadow-xl md:flex",children:i.map(M=>{let I=M.tone||"muted";return jsxRuntime.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:_a(I)}}),M.label]},M.id)})}):null]})}a(qk,"WorkbenchRadarMatrix");function Xk({viewMode:e="list",heading:t,metadata:o,message:r,actions:n,outputs:i,children:s,className:l,...d}){return jsxRuntime.jsxs("article",{...d,"data-monkeys-component":"workbench-task-card","data-view-mode":e,className:m("border-border/70 font-[family-name:var(--font-sans)] text-sm leading-5",e==="grid"?"flex h-full flex-col gap-global rounded-lg border bg-card p-global shadow-sm":"grid items-center gap-global border-b py-global last:border-b-0 lg:grid-cols-2",l),children:[jsxRuntime.jsxs("div",{"data-task-part":"details",className:m("flex min-w-0 flex-col",e==="grid"?"flex-1":"min-h-60"),children:[jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global",children:t}),o!=null&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global text-sm tabular-nums text-muted-foreground [&_span]:text-inherit [&_time]:text-inherit",children:o}),s,r!=null&&jsxRuntime.jsx("div",{className:"mt-global break-words text-sm text-destructive-text",children:r}),n!=null&&jsxRuntime.jsx("div",{className:"mt-auto flex flex-wrap gap-global pt-global",children:n})]}),i!=null&&jsxRuntime.jsx("div",{"data-task-part":"outputs",className:m("min-w-0 w-full",e==="grid"&&"-order-1"),children:i})]})}a(Xk,"WorkbenchTaskCard");function Zk({title:e,filters:t,sortOrder:o,viewMode:r,onSortOrderChange:n,onViewModeChange:i,labels:s,disabled:l,className:d}){return jsxRuntime.jsx(du,{"data-monkeys-component":"workbench-task-toolbar",classNames:{root:"min-h-0 flex-row flex-wrap items-center gap-global border-0 p-0 font-[family-name:var(--font-sans)] text-sm leading-5",end:"max-w-full flex-wrap gap-global"},className:d,end:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,jsxRuntime.jsxs("div",{className:"flex items-center gap-global",children:[jsxRuntime.jsx(mt,{type:"button",variant:"outline",disabled:l,title:s.sort,icon:o==="latest"?jsxRuntime.jsx(lucideReact.ArrowDownWideNarrow,{}):jsxRuntime.jsx(lucideReact.ArrowUpNarrowWide,{}),className:"h-10 min-w-28 gap-global rounded-lg bg-muted/40 px-global py-global-1/2 text-sm font-medium shadow-none hover:bg-muted/70",onClick:()=>n(o==="latest"?"oldest":"latest"),children:o==="latest"?s.latest:s.oldest}),jsxRuntime.jsx(mt,{type:"button",variant:"outline",disabled:l,icon:r==="list"?jsxRuntime.jsx(lucideReact.Grid2X2,{}):jsxRuntime.jsx(lucideReact.LayoutList,{}),className:"h-10 gap-global rounded-lg bg-muted/40 px-global py-global-1/2 text-sm font-medium shadow-none hover:bg-muted/70",onClick:()=>i(r==="list"?"grid":"list"),children:r==="list"?s.gridView:s.listView})]})]}),children:e})}a(Zk,"WorkbenchTaskToolbar");function Jk({items:e=[],children:t,hasOutputs:o,viewMode:r="list",ariaLabel:n,previewLabel:i,processingLabel:s,processing:l=false,emptyState:d,onPreview:c,className:p}){let u=r==="grid"?"aspect-square w-full":"aspect-square w-[calc((100%-3*var(--global-spacing))/4)] min-w-32 max-w-48";return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-task-outputs",role:"region","aria-label":n,tabIndex:0,className:m("flex w-full min-w-0 snap-x snap-proximity items-center gap-global overflow-x-auto py-global-1/2 font-[family-name:var(--font-sans)] text-sm leading-5 focus-visible:outline focus-visible:outline-2",p),children:[t,e.map(g=>g.kind==="media"?c?jsxRuntime.jsx("button",{type:"button",onClick:()=>c(g),"aria-label":g.previewLabel||i,className:m("flex shrink-0 snap-start items-center justify-center overflow-hidden rounded-lg border bg-muted/20 focus-visible:outline focus-visible:outline-2",u),children:g.content},g.id):jsxRuntime.jsx("div",{className:m("flex shrink-0 snap-start items-center justify-center overflow-hidden rounded-lg border bg-muted/20",u),children:g.content},g.id):jsxRuntime.jsx("pre",{className:"h-60 w-full min-w-0 shrink-0 snap-start overflow-auto whitespace-pre-wrap break-words rounded-lg border bg-muted/20 p-global font-[family-name:var(--font-sans)] text-sm leading-5",children:g.content},g.id)),!(o??(e.length>0||!!t))&&(l?jsxRuntime.jsx("div",{role:"status","aria-label":s,className:m("flex shrink-0 items-center justify-center rounded-lg border bg-gradient-to-br from-muted via-background to-muted",u),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:"size-16 animate-spin rounded-full border-[8px] border-muted-foreground/40 border-t-foreground motion-reduce:animate-none sm:size-20"})}):jsxRuntime.jsx("div",{className:"flex min-h-60 w-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-global text-center text-sm text-muted-foreground",children:d}))]})}a(Jk,"WorkbenchTaskOutputs");function e0({src:e,kind:t,alt:o,expanded:r=false,loading:n=false,failed:i=false,loadingLabel:s,errorLabel:l,onError:d,renderMedia:c}){return c?jsxRuntime.jsx(jsxRuntime.Fragment,{children:c({src:e,kind:t,alt:o,expanded:r,loadingLabel:s,errorLabel:l})}):n?jsxRuntime.jsx("span",{role:"status","aria-label":s,children:jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"size-6 animate-spin text-muted-foreground motion-reduce:animate-none"})}):i||!e||t==="3d"?jsxRuntime.jsx("span",{role:"img","aria-label":l,children:jsxRuntime.jsx(lucideReact.ImageOff,{"aria-hidden":"true",className:"size-6 text-muted-foreground"})}):t==="video"?jsxRuntime.jsxs("span",{className:r?"contents":"relative block size-full",children:[jsxRuntime.jsx("video",{src:e,"aria-label":o,controls:r,playsInline:true,preload:"metadata",onError:d,className:r?"max-h-[75vh] max-w-full":"size-full object-contain"}),!r&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-[hsl(var(--monkeys-color-media-overlay)/0.6)] shadow-md sm:size-14",children:jsxRuntime.jsx(lucideReact.Play,{className:"ml-0.5 size-5 !fill-[hsl(var(--monkeys-color-media-foreground))] !stroke-[hsl(var(--monkeys-color-media-foreground))] sm:size-6"})})})]}):jsxRuntime.jsx(Is,{src:e,alt:o,loading:"lazy",onError:d,className:r?"h-auto w-auto max-h-[75vh] max-w-full":void 0})}a(e0,"WorkbenchTaskMedia");function n0({text:e,labels:t,className:o}){let r=ho.useId(),n=ho.useRef(null),[i,s]=ho.useState(false),[l,d]=ho.useState(false),c=e||t.empty;return ho.useEffect(()=>{s(false);},[c]),ho.useEffect(()=>{let p=n.current;if(!p)return;let u=a(()=>{let f=Number.parseFloat(getComputedStyle(p).lineHeight);d(p.scrollHeight>f*3+1);},"measure");if(u(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(u);return g.observe(p),()=>g.disconnect()},[c]),jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-task-prompt",className:m("min-w-0 font-[family-name:var(--font-sans)] text-sm leading-5",o),children:[jsxRuntime.jsx("p",{ref:n,id:r,className:m("whitespace-pre-wrap break-words text-sm leading-5 text-foreground [overflow-wrap:anywhere]",!i&&"line-clamp-3"),children:c}),l&&jsxRuntime.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":r,onClick:()=>s(p=>!p),className:"mt-global-1/2 inline-flex min-h-8 items-center gap-global-1/2 rounded-lg px-global-1/2 text-sm font-medium text-foreground underline underline-offset-4 hover:bg-muted focus-visible:outline focus-visible:outline-2",children:[i?t.less:t.more,i?jsxRuntime.jsx(lucideReact.ChevronUp,{"aria-hidden":"true",className:"size-4"}):jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"size-4"})]})]})}a(n0,"WorkbenchTaskPrompt");function aW({item:e,playLabel:t,selectionMode:o}){let[r,n]=ho.useState(false);if(ho.useEffect(()=>n(false),[e.thumbnailSrc,e.src]),e.notice||e.status==="blocked")return jsxRuntime.jsx("div",{className:"flex size-full items-center justify-center bg-muted p-2 text-center text-xs text-muted-foreground",children:e.notice});let i=r?e.src:e.thumbnailSrc||e.src;if(!i)return jsxRuntime.jsx("div",{className:"size-full bg-muted","aria-hidden":"true"});if(e.mediaType==="video"){let s=jsxRuntime.jsx("span",{className:"rounded-full bg-foreground/60 p-2 text-background",children:jsxRuntime.jsx(lucideReact.Play,{className:"size-4 fill-current"})});return jsxRuntime.jsxs("div",{className:"relative size-full",children:[jsxRuntime.jsx("video",{src:i,muted:true,playsInline:true,preload:"metadata",className:"size-full object-cover","aria-label":e.alt}),jsxRuntime.jsx(mt,{ariaLabel:t,tabIndex:o?-1:0,variant:"ghost",className:"absolute inset-0 size-full rounded-none border-0 p-0",icon:s})]})}return jsxRuntime.jsx("img",{src:i,alt:e.alt??"",loading:"lazy",onError:()=>{!r&&e.src&&i!==e.src&&n(true);},className:"size-full object-cover opacity-100"})}a(aW,"HistoryMedia");function iW({items:e,loading:t=false,loadingMore:o=false,error:r,hasMore:n=false,pageKey:i,expanded:s,selectedIds:l,selectionMode:d,className:c,itemClassName:p,labels:u,busy:g=false,popupScale:f=1,panelClassName:b,buttonClassName:x,buttonVariant:y="outline",onRetry:k,onLoadMore:w,onExpandedChange:v,onSelectionModeChange:h,onSelectedIdsChange:S,onItemActivate:T,onDelete:C,onItemDragStart:R}){let M=ho.useRef(null),[I,B]=ho.useState(),[N,D]=ho.useState(false),[E,P]=ho.useState(false),[W,H]=ho.useState([]),A=s??N,L=d??E,F=l??W,G=ho.useMemo(()=>new Set(F),[F]),$=ho.useRef(F);$.current=F;let _=Number.isFinite(f)&&f>0?f:1;ho.useLayoutEffect(()=>{if(!A||!M.current)return;let O=0,K=a(()=>{let he=M.current?.getBoundingClientRect();he&&B({left:he.left,width:he.width,bottom:Math.max(0,window.innerHeight-he.bottom)});},"measure"),ne=a(()=>{cancelAnimationFrame(O),O=requestAnimationFrame(K);},"schedule");K();let fe=typeof ResizeObserver=="function"?new ResizeObserver(ne):void 0;return fe?.observe(M.current),window.addEventListener("resize",ne),window.addEventListener("scroll",ne,true),()=>{fe?.disconnect(),cancelAnimationFrame(O),window.removeEventListener("resize",ne),window.removeEventListener("scroll",ne,true);}},[A]),ho.useEffect(()=>{let O=new Set(e.map(ne=>ne.id)),K=F.filter(ne=>O.has(ne));K.length!==F.length&&(H(K),S?.(K));},[e,F,S]);let z=a(O=>{s===void 0&&D(O),v?.(O);},"setExpanded"),re=a(O=>{d===void 0&&P(O),h?.(O),O||Z([]);},"setSelection"),Z=a(O=>{$.current=O,l===void 0&&H(O),S?.(O);},"updateSelection"),ae=a(O=>{if(g||O.selectable===false)return;let K=$.current;Z(K.includes(O.id)?K.filter(ne=>ne!==O.id):[...K,O.id]);},"toggle"),ee=a(O=>{let K=G.has(O.id),ne=O.selectable!==false&&!g;return jsxRuntime.jsxs("div",{"data-history-selection-key":O.id,"data-history-item-id":O.id,role:L?"checkbox":"button","aria-checked":L?K:void 0,"aria-label":L?O.label??u.selectItem:O.alt,"aria-disabled":(L?!ne:O.disabled)||void 0,tabIndex:(L?ne:!O.disabled)?0:void 0,draggable:!!(O.draggable&&!L&&!O.disabled),onDragStart:fe=>{if(!O.draggable||L||O.disabled){fe.preventDefault();return}R?.(fe,O);},onClick:fe=>{L?(fe.stopPropagation(),ae(O)):O.disabled||T?.(O);},onKeyDown:fe=>{(fe.key===" "||fe.key==="Enter")&&(fe.preventDefault(),L?ae(O):O.disabled||T?.(O));},...O.dataAttributes,className:m("relative aspect-square min-w-0 overflow-hidden rounded-md border border-border/60 bg-muted outline-hidden transition-[box-shadow,border-color,opacity] focus-visible:ring-2 focus-visible:ring-ring",K&&"border-primary ring-2 ring-primary/70",O.disabled&&"opacity-60",L&&ne&&"cursor-pointer",p),children:[jsxRuntime.jsx(aW,{item:O,playLabel:u.playVideo,selectionMode:L}),L&&ne?jsxRuntime.jsx("span",{className:"pointer-events-none absolute right-1 top-1 z-10 rounded-full bg-background/85 p-0.5",children:jsxRuntime.jsx(vi,{checked:K,controlSize:"sm","aria-hidden":"true",tabIndex:-1,readOnly:true})}):null]},O.id)},"renderItem"),q=a(O=>jsxRuntime.jsx(kn,{items:e,config:{getItemKey:a(K=>K.id,"getItemKey"),layout:{mode:O,cardWidth:O==="rail"?72:void 0,idealCardWidth:72,gap:8,getItemAspectRatio:a(()=>1,"getItemAspectRatio"),scrollOwner:"parent"},state:{loading:t,loadingMore:o&&n,hasMore:n},loading:{rootMargin:"1px",pageKey:i,variant:"spinner",autoFill:true},windowed:true,appearance:{hover:"none"},labels:{collection:u.ariaLabel,loading:u.loading,loadingMore:u.loadingMore,empty:u.empty}},classNames:{loadMore:"h-px min-h-0 overflow-hidden"},slots:{loadMore:jsxRuntime.jsx("span",{"aria-hidden":"true",className:"block h-px"})},callbacks:{onLoadMore:O==="grid"||!A?w:void 0},renderItem:ee}),"collection"),U=a((O,K,ne,fe=false)=>jsxRuntime.jsx(mt,{icon:jsxRuntime.jsx(O,{}),iconOnly:true,ariaLabel:K,size:"md",variant:y,className:x,disabled:fe,onClick:ne}),"button"),X=jsxRuntime.jsxs("div",{role:"alert",className:"flex min-h-20 flex-col items-center justify-center gap-1 p-2 text-center text-sm",children:[jsxRuntime.jsx("span",{children:u.loadError}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:u.loadErrorDescription}),k?jsxRuntime.jsx(mt,{size:"sm",variant:"outline",label:u.retry,onClick:k}):null]});return jsxRuntime.jsxs("div",{ref:M,"data-workbench-history-result":true,className:m("relative w-full min-w-0 max-w-full rounded-lg",b,c),children:[e.length?jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2 p-3",children:[U(A?lucideReact.Minimize2:lucideReact.Maximize2,A?u.collapse:u.expand,()=>z(!A)),jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:q("rail")})]}):t?jsxRuntime.jsx($r,{title:u.loading,variant:"spinner",className:"min-h-20 p-2"}):r?X:jsxRuntime.jsx(Di,{title:u.empty,className:"min-h-20 p-2"}),A&&typeof document<"u"?reactDom.createPortal(jsxRuntime.jsxs("div",{"data-history-expanded":true,className:m("fixed z-50 rounded-lg border border-border bg-card text-card-foreground shadow-xl",b),style:{left:I?.left??0,width:(I?.width??0)/_,bottom:I?.bottom??0,transform:`scale(${_})`,transformOrigin:"left bottom"},children:[jsxRuntime.jsxs("div",{className:"max-h-[50vh] overflow-y-auto p-3",style:{marginBottom:72,maxHeight:"50vh",overflowY:"auto"},children:[q("grid"),r&&e.length?jsxRuntime.jsxs("div",{role:"alert",className:"flex items-center gap-2 text-xs",children:[u.refreshError,k?jsxRuntime.jsx(mt,{size:"sm",label:u.retry,onClick:k}):null]}):null]}),jsxRuntime.jsxs("div",{className:"absolute inset-x-3 bottom-3 flex items-center justify-between gap-2",children:[U(lucideReact.Minimize2,u.collapse,()=>z(false)),jsxRuntime.jsx("div",{className:"flex items-center gap-1.5",children:L?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"rounded-full border border-border px-2 py-1 text-xs",children:u.selectedCount}),U(lucideReact.X,u.exitSelection,()=>re(false),g),C?U(lucideReact.Trash2,u.deleteSelected,()=>{g||C(F);},!F.length||g):null]}):C?U(lucideReact.Trash2,u.enterSelection,()=>re(true),g):null})]})]}),document.body):null]})}a(iW,"WorkbenchHistoryResult");function cW({open:e,title:t,description:o,name:r,nameLabel:n,namePlaceholder:i,createLabel:s,cancelLabel:l,closeLabel:d,creating:c=false,error:p,showError:u=true,className:g,onOpenChange:f,onNameChange:b,onCreate:x}){let y=ho.useId(),k=ho.useRef(null),[w,v]=ho.useState(false),[h,S]=ho.useState(null),T=ho.useRef(false),C=ho.useRef(false);ho.useEffect(()=>{e||(T.current=false,S(null),v(false));},[e]);let R=c,M=a(N=>{!R&&!C.current&&f?.(N);},"close"),I=a(async()=>{if(!(!r.trim()||R||C.current||T.current||!x)){C.current=true,v(true);try{await x();}finally{C.current=false;}}},"create"),B={radius:"lg"};return jsxRuntime.jsx(Ri,{open:e,onOpenChange:M,title:t,description:o,closeLabel:d,closeOnEscape:!R,closeOnOverlayClick:!R,showCloseButton:!R,portal:true,initialFocus:"explicit",initialFocusRef:k,className:g,classNames:{panel:"w-full max-w-[420px] gap-4 p-6",header:"border-0 p-0",title:"text-lg font-semibold leading-tight",description:"text-sm text-muted-foreground",body:"overflow-visible p-0",footer:"border-0 p-0"},footer:jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(mt,{size:"lg",appearance:B,className:"text-sm",disabled:R,onClick:()=>M(false),children:l}),jsxRuntime.jsx(mt,{size:"lg",tone:"primary",appearance:{...B,slots:{buttonPrimary:"border-primary bg-primary text-primary-foreground hover:bg-primary/90"}},className:"text-sm",loading:c,disabled:R||!r.trim(),onClick:I,children:s})]}),children:jsxRuntime.jsxs("div",{className:"space-y-4","data-monkeys-component":"create-collection-dialog",children:[jsxRuntime.jsxs("div",{className:"space-y-2 py-2",children:[jsxRuntime.jsx("label",{htmlFor:y,className:"text-sm font-medium leading-5",children:n}),jsxRuntime.jsx(un,{ref:k,id:y,maxLength:80,"aria-label":n,placeholder:i,value:h??r,disabled:R,onCompositionStart:N=>{T.current=true,S(N.currentTarget.value);},onCompositionEnd:N=>{T.current=false,S(null),b?.(N.currentTarget.value);},onChange:N=>{T.current?S(N.currentTarget.value):b?.(N.currentTarget.value);},onKeyDown:N=>{N.key==="Enter"&&!N.nativeEvent.isComposing&&!T.current&&(N.preventDefault(),I());}})]}),w&&!c&&u&&p&&jsxRuntime.jsx("div",{role:"alert",className:"text-sm text-destructive-text",children:p})]})})}a(cW,"WorkbenchCreateCollectionDialog");var pW={width:"var(--monkeys-component-app-shell-sidebar-width, 16rem)",borderRadius:"var(--monkeys-component-app-shell-sidebar-radius, var(--radius, 0.75rem))",background:"var(--monkeys-component-app-shell-sidebar-background, hsl(var(--card)))",color:"var(--monkeys-component-app-shell-sidebar-foreground, hsl(var(--card-foreground)))",borderColor:"var(--monkeys-component-app-shell-sidebar-border-color, hsl(var(--border)))",boxShadow:"var(--monkeys-component-app-shell-sidebar-shadow, none)"},mW={padding:"var(--monkeys-component-app-shell-sidebar-header-padding, var(--global-spacing, 0.75rem))",borderColor:"var(--monkeys-component-app-shell-sidebar-header-border-color, hsl(var(--border)))"},fW={padding:"var(--monkeys-component-app-shell-sidebar-navigation-padding, var(--global-spacing, 0.75rem))","--monkeys-component-accordion-item-border-color":"transparent"},bW={padding:"var(--monkeys-component-app-shell-sidebar-footer-padding, var(--global-spacing, 0.75rem))",background:"var(--monkeys-component-app-shell-sidebar-footer-background, hsl(var(--muted) / 0.22))",borderColor:"var(--monkeys-component-app-shell-sidebar-footer-border-color, hsl(var(--border)))"},ob=ho.forwardRef(a(function({navigation:t,header:o,footer:r,width:n,className:i,classNames:s,style:l,"aria-label":d="Application navigation",...c},p){return jsxRuntime.jsxs("aside",{ref:p,"aria-label":d,"data-app-shell-sidebar":"",className:m("relative isolate flex h-full min-h-0 shrink-0 flex-col overflow-hidden border",s?.root,i),style:{...pW,...n===void 0?null:{width:n},...l},...c,children:[o?jsxRuntime.jsx("div",{"data-slot":"header",className:m("shrink-0 border-b",s?.header),style:mW,children:o}):null,jsxRuntime.jsx("div",{"data-slot":"navigation",className:m("relative min-h-0 flex-1 overflow-hidden",s?.navigation),style:fW,children:t}),r?jsxRuntime.jsx("div",{"data-slot":"footer",className:m("shrink-0 border-t",s?.footer),style:bW,children:r}):null]})},"AppShellSidebar"));ob.displayName="AppShellSidebar";var hW={preset:"soft",density:"compact",radius:"lg",border:"subtle",background:"soft"},c0={default:"rounded-md",none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"};function yW(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6 9 17l-5-5"})})}a(yW,"CheckIcon");function xW(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}a(xW,"MoreIcon");function rb(e,t){return e?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center",t),children:e}):null}a(rb,"renderIcon");function vW(e){return e.options.find(t=>t.value===e.value)?.label??e.value}a(vW,"getCurrentOptionLabel");function wW({classNames:e,menuRadius:t,selector:o}){if(o.visible===false||o.options.length===0)return null;let r=c0[t],n=vW(o);return jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{disabled:o.disabled,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r,e?.subTrigger),children:[rb(o.icon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:o.label}),jsxRuntime.jsx("span",{className:"ml-auto min-w-0 max-w-[7rem] truncate text-xs text-[hsl(var(--muted-foreground))]",children:n})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{sideOffset:8,className:m("z-50 min-w-40 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",r,o.contentWidthClassName,e?.subContent),children:jsxRuntime.jsx(Bt__namespace.RadioGroup,{value:o.value,onValueChange:o.onChange,children:o.options.map(i=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{value:i.value,disabled:i.disabled,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 pl-8 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r,e?.item),children:[jsxRuntime.jsx(Bt__namespace.ItemIndicator,{className:"absolute left-2 inline-flex h-4 w-4 items-center justify-center",children:jsxRuntime.jsx(yW,{})}),rb(i.icon,e?.itemIcon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:i.label})]},i.value))})})})]})}a(wW,"UserAccountMenuSelector");function u0({align:e="end",appearance:t=hW,ariaLabel:o,className:r,classNames:n,contentWidthClassName:i="w-56",fallbackName:s="User",items:l=[],menuRadius:d="default",selectors:c=[],side:p="bottom",sideOffset:u=8,triggerEndIcon:g,triggerTitle:f,triggerVariant:b="avatar",user:x}){let y=x.name?.trim()||s,k=c0[d],w=c.filter(C=>C.visible!==false&&C.options.length>0),v=l.filter(C=>C.visible!==false),h=w.length>0||v.length>0,S=jsxRuntime.jsx(fc,{appearance:t,alt:x.avatarAlt??y,className:m("h-8 w-8",n?.avatar),initials:x.initials,name:y,size:"sm",src:x.avatarUrl}),T=b==="profile";return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(mt,{appearance:t,ariaLabel:o??y,className:m(T?"h-auto w-full justify-start rounded-lg border-transparent bg-transparent px-2 py-2 text-left shadow-none transition-all hover:bg-[hsl(var(--muted))]/60":"h-9 w-9 overflow-visible rounded-md border-transparent bg-transparent p-0 shadow-none transition-all hover:ring-2 hover:ring-[hsl(var(--ring))]/20",r,n?.root,n?.trigger),classNames:{icon:"h-8 w-8",label:T?"min-w-0 flex-1 text-left":void 0},endIcon:T?g??jsxRuntime.jsx(xW,{}):void 0,icon:S,iconOnly:!T,label:T?jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-col items-start",children:[jsxRuntime.jsx("span",{className:"max-w-full truncate text-sm font-medium leading-none text-[hsl(var(--foreground))]",children:y}),x.secondaryText?jsxRuntime.jsx("span",{className:"mt-1 max-w-full truncate text-xs leading-none text-[hsl(var(--muted-foreground))]",children:x.secondaryText}):null]}):void 0,title:f??y,tone:"muted"})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:e,side:p,sideOffset:u,className:m("z-50 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",i,k,n?.content),children:[jsxRuntime.jsx(Bt__namespace.Label,{className:m("px-2 py-1.5 font-normal",n?.label),children:jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[S,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col",children:[jsxRuntime.jsx("span",{className:m("truncate text-sm font-medium leading-none",n?.userName),children:y}),x.secondaryText?jsxRuntime.jsx("span",{className:m("truncate pt-1 text-xs leading-none text-[hsl(var(--muted-foreground))]",n?.secondaryText),children:x.secondaryText}):null]})]})}),h?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,w.map((C,R)=>jsxRuntime.jsx(wW,{classNames:n,menuRadius:d,selector:C},C.id??`selector-${R}`)),w.length>0&&v.length>0?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,v.map(C=>jsxRuntime.jsxs("div",{children:[C.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,jsxRuntime.jsxs(Bt__namespace.Item,{disabled:C.disabled,onSelect:C.disabled?void 0:C.onSelect,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",k,C.tone==="danger"&&"text-[hsl(var(--destructive))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",n?.item,C.tone==="danger"&&n?.dangerItem),children:[rb(C.icon,n?.itemIcon),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.label}),C.shortcut?jsxRuntime.jsx("span",{className:"ml-3 shrink-0 text-xs text-[hsl(var(--muted-foreground))]",children:C.shortcut}):null]})]},C.id))]})})]})}a(u0,"UserAccountMenu");function De(...e){return e.filter(Boolean).join(" ")}a(De,"cn");function kl({active:e,disabled:t,icon:o,postfix:r,onClick:n,className:i,children:s}){return jsxRuntime.jsxs("button",{type:"button","aria-disabled":t,"aria-pressed":e,disabled:t,className:De("flex w-full cursor-pointer select-none items-center gap-2 rounded-xl border p-2 text-left text-xs text-[hsl(var(--foreground))] transition-colors",e?"border-[hsl(var(--input))] bg-[hsl(var(--muted))] font-bold":t?"border-transparent":"border-transparent hover:border-[hsl(var(--input))]/60 hover:bg-[hsl(var(--muted))]/60",t&&"!cursor-not-allowed opacity-60",i),onClick:n,children:[jsxRuntime.jsx("div",{className:"w-[20px] [&_svg]:h-[16px] [&_svg]:w-[16px]",children:o}),jsxRuntime.jsx("span",{className:"text-sm",children:s}),r]})}a(kl,"NavButton");function CW({logo:e,tabs:t,activeTab:o,onTabChange:r,user:n,onLogout:i,logoutLabel:s="\u9000\u51FA\u767B\u5F55",userMenuItems:l,extra:d,className:c}){let p=a(u=>u.split(" ").map(g=>g[0]).join("").toUpperCase().slice(0,2),"getUserInitials");return jsxRuntime.jsxs("header",{className:De("flex h-[72px] w-full shrink-0 items-center justify-between gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",c),children:[jsxRuntime.jsxs("div",{className:"flex shrink-0 cursor-pointer items-center gap-2",onClick:e.onClick,children:[jsxRuntime.jsx("div",{className:De("flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",e.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:e.url?jsxRuntime.jsx("img",{src:e.url,alt:e.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:e.title.charAt(0)})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold whitespace-nowrap",children:e.title})]}),t&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-1/2 w-px bg-[hsl(var(--border))]"}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center",children:jsxRuntime.jsx("div",{className:"inline-flex h-9 items-center gap-1 rounded-md bg-transparent p-1",children:t.map(u=>jsxRuntime.jsx("button",{className:De("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all",u.id===o?"bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--muted))]/50"),onClick:()=>r?.(u.id),children:u.label},u.id))})})]}),(!t||t.length===0)&&jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-4",children:[d,n&&jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-md hover:ring-2 hover:ring-[hsl(var(--ring))]/20 transition-all overflow-hidden focus-visible:outline-hidden",children:n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-8 w-8 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium",children:n.name?p(n.name):"U"})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{className:"z-50 w-52 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:5,align:"end",children:[jsxRuntime.jsxs(Bt__namespace.Label,{className:"flex items-center gap-2 px-2 py-1.5 font-normal",children:[n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-8 w-8 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium",children:n.name?p(n.name):"U"}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium leading-none",children:n.name}),n.email&&jsxRuntime.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] leading-none mt-1",children:n.email})]})]}),jsxRuntime.jsx(Bt__namespace.Separator,{className:"h-px bg-[hsl(var(--border))] my-1"}),jsxRuntime.jsxs(Bt__namespace.Group,{children:[l,jsxRuntime.jsxs(Bt__namespace.Item,{className:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-[hsl(var(--destructive))] outline-hidden transition-colors hover:bg-[hsl(var(--accent))]",onSelect:()=>i?.(),children:[jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntime.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntime.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),s]})]})]})})]})]})]})}a(CW,"AppHeader");function SW({logo:e,navItems:t,activeItemId:o,onNavigate:r,account:n,onLogout:i,logoutLabel:s="\u9000\u51FA\u767B\u5F55",footer:l,defaultExpandedGroups:d,className:c}){return jsxRuntime.jsxs("div",{className:De("flex w-[13.7rem] shrink-0 flex-col justify-between gap-[var(--global-spacing,0.75rem)] overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-5",c),children:[e&&jsxRuntime.jsxs("div",{className:"flex shrink-0 cursor-pointer items-center gap-2",onClick:e.onClick,children:[jsxRuntime.jsx("div",{className:De("flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",e.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:e.url?jsxRuntime.jsx("img",{src:e.url,alt:e.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:e.title.charAt(0)})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold whitespace-nowrap",children:e.title})]}),jsxRuntime.jsx(TW,{items:t,activeItemId:o,onNavigate:r,defaultExpandedGroups:d}),(n||l)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[n&&jsxRuntime.jsx("div",{className:"flex w-full flex-col gap-2 rounded-lg bg-[hsl(var(--muted))] p-2 shadow-sm",children:jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between px-3 py-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-5 w-5 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-[10px] font-medium",children:n.name?n.name.charAt(0).toUpperCase():"U"}),jsxRuntime.jsx("span",{className:"text-xs font-medium truncate max-w-[100px]",children:n.name})]}),i&&jsxRuntime.jsx("button",{onClick:i,className:"flex items-center justify-center text-[hsl(var(--destructive))] hover:opacity-80 transition-opacity",title:s,children:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntime.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntime.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})}),l]})]})}a(SW,"AppSidebar");function TW({items:e,activeItemId:t,onNavigate:o,defaultExpandedGroups:r}){let[n,i]=ho.useState(()=>{let p={};return (r??e.map(u=>u.id)).forEach(u=>{p[u]=true;}),p}),[s,l]=ho.useState(t);ho.useEffect(()=>{t!==void 0&&l(t);},[t]);let d=a(p=>{i(u=>({...u,[p]:!u[p]}));},"toggle"),c=t??s;return jsxRuntime.jsxs("div",{className:"h-full flex-1 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[jsxRuntime.jsx("style",{children:".monkeys-sidebar-nav::-webkit-scrollbar { display: none; }"}),jsxRuntime.jsx("div",{className:"monkeys-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",children:e.map(p=>{if(p.children&&p.children.length>0){let u=n[p.id]??true;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(kl,{active:p.id===c,disabled:p.disabled,icon:p.icon,onClick:()=>d(p.id),postfix:jsxRuntime.jsx("div",{className:"flex flex-1 justify-end",children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})}),children:p.label}),u&&!p.disabled&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1 mt-1",children:p.children.map(g=>jsxRuntime.jsx(kl,{active:g.id===c,disabled:g.disabled,onClick:()=>{l(g.id),o?.(g.id);},children:g.label},g.id))})]},p.id)}return jsxRuntime.jsx(kl,{icon:p.icon,active:p.id===c,disabled:p.disabled,onClick:()=>{l(p.id),o?.(p.id);},children:p.label},p.id)})})]})}a(TW,"SidebarNavList");function g0({header:e,sidebar:t,children:o,flush:r=false,contentFrame:n=true,className:i}){return jsxRuntime.jsxs("div",{className:De("flex h-screen flex-col gap-[var(--global-spacing,0.75rem)] overflow-hidden p-[var(--global-spacing,0.75rem)]",i),style:{backgroundColor:"hsl(var(--muted))"},children:[e||null,jsxRuntime.jsxs("div",{className:"flex flex-1 gap-[var(--global-spacing,0.75rem)] overflow-hidden min-h-0",children:[t||null,jsxRuntime.jsx("main",{className:De("flex-1 min-h-0 overflow-hidden",n&&"rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))]",!r&&"overflow-y-auto"),children:r?o:jsxRuntime.jsx("div",{className:"h-full overflow-y-auto",children:o})})]})]})}a(g0,"AppLayout");var NW="13.7rem",RW="4.25rem",MW="15rem",IW="cubic-bezier(0.22, 1, 0.36, 1)",DW=72,PW=56,EW=120,h0=64,AW=12,BW=8,LW=44,WW=36,cr={preset:"soft",density:"compact",radius:"lg",border:"subtle",background:"soft"},zW={none:{all:"rounded-none",left:"!rounded-none",right:"!rounded-none"},sm:{all:"rounded-sm",left:"!rounded-l-sm !rounded-r-none",right:"!rounded-l-none !rounded-r-sm"},md:{all:"rounded-md",left:"!rounded-l-md !rounded-r-none",right:"!rounded-l-none !rounded-r-md"},lg:{all:"rounded-lg",left:"!rounded-l-lg !rounded-r-none",right:"!rounded-l-none !rounded-r-lg"},xl:{all:"rounded-xl",left:"!rounded-l-xl !rounded-r-none",right:"!rounded-l-none !rounded-r-xl"},full:{all:"rounded-full",left:"!rounded-l-full !rounded-r-none",right:"!rounded-l-none !rounded-r-full"}};function OW(e){return typeof e!="number"||!Number.isFinite(e)?DW:Math.min(EW,Math.max(PW,Math.round(e)))}a(OW,"clampHeadbarHeight");function FW(e){return e<=h0?BW:AW}a(FW,"getHeadbarVerticalPaddingPx");function HW(e){return e<=h0?WW:LW}a(HW,"getHeadbarLogoSizePx");function $u(e="default",t="all"){return e==="default"?t==="left"?"rounded-l-lg rounded-r-none":t==="right"?"rounded-l-none rounded-r-lg":"rounded-lg":zW[e][t]}a($u,"getHeadbarMenuRadiusClass");function VW(e="boxed",t="center"){let o=t==="center"?"grid-cols-[minmax(max-content,1fr)_minmax(0,max-content)_minmax(max-content,1fr)]":"grid-cols-[max-content_minmax(0,1fr)_max-content]";return De(e==="full-bleed"?"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-none border-b border-x-0 border-t-0 border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]":"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",o)}a(VW,"getHeadbarFrameClass");function _W(e="boxed",t,o="card"){let r=FW(t),i={height:`var(--monkeys-component-navigation-headbar-height, ${t}px)`,minHeight:`var(--monkeys-component-navigation-headbar-height, ${t}px)`,paddingTop:`${r}px`,paddingBottom:`${r}px`,background:"var(--monkeys-component-navigation-headbar-frame-background, hsl(var(--background)))",color:"var(--monkeys-component-navigation-headbar-frame-foreground, hsl(var(--foreground)))",borderColor:o==="glassy"?"var(--monkeys-component-navigation-headbar-frame-border-color, rgb(255 255 255 / 0.5))":"var(--monkeys-component-navigation-headbar-frame-border-color, hsl(var(--input)))",borderRadius:e==="full-bleed"?"0":"var(--monkeys-component-navigation-headbar-frame-radius, var(--radius, 0.75rem))",boxShadow:o==="glassy"?"var(--monkeys-component-navigation-headbar-frame-shadow, inset 0 0 0 0 rgb(0 0 0 / 0.1))":"var(--monkeys-component-navigation-headbar-frame-shadow, none)",backdropFilter:`blur(var(--monkeys-component-navigation-headbar-frame-backdrop-blur, ${o==="glassy"?"45px":"0px"}))`};return e==="full-bleed"&&(i.marginLeft="calc(var(--global-spacing,0.75rem) * -1)",i.marginRight="calc(var(--global-spacing,0.75rem) * -1)",i.marginTop="calc(var(--global-spacing,0.75rem) * -1)",i.width="calc(100% + (var(--global-spacing,0.75rem) * 2))"),i}a(_W,"getHeadbarFrameStyle");function GW(e="center"){return e==="left"?"justify-start":e==="right"?"justify-end":"justify-center"}a(GW,"getHeadbarNavClass");function ju(e,t=true){return {height:"var(--monkeys-component-navigation-headbar-item-height, 2.25rem)",borderRadius:t?"var(--monkeys-component-navigation-headbar-item-radius, var(--radius, 0.5rem))":void 0,paddingInline:"var(--monkeys-component-navigation-headbar-item-padding-inline, 0.75rem)",columnGap:"var(--monkeys-component-navigation-headbar-item-gap, 0.375rem)",color:e?"var(--monkeys-component-navigation-headbar-item-active-foreground, hsl(var(--foreground)))":"var(--monkeys-component-navigation-headbar-item-foreground, hsl(var(--muted-foreground)))",background:e?"var(--monkeys-component-navigation-headbar-item-active-background, hsl(var(--muted)))":"transparent",borderColor:e?"var(--monkeys-component-navigation-headbar-item-active-border-color, transparent)":"transparent",fontSize:"var(--monkeys-component-navigation-headbar-item-font-size, 0.875rem)",fontWeight:"var(--monkeys-component-navigation-headbar-item-font-weight, 500)"}}a(ju,"getHeadbarItemStyle");function $W(e,t=true){return {...ju(e,t),paddingInline:void 0,columnGap:void 0}}a($W,"getHeadbarCompoundStyle");function y0(e,t){for(let o of e)if(o.id===t||Sl(o,t))return o.id;return t}a(y0,"findNavigationRootId");function Sl(e,t){return t?e.id===t?true:e.children?.some(o=>Sl(o,t))??false:false}a(Sl,"containsNavigationItem");function jW(e,t){return e.children?.find(o=>Sl(o,t))}a(jW,"findActiveNavigationBranch");function p0(e){return e.title||(typeof e.label=="string"?e.label:void 0)}a(p0,"getNavigationActionTitle");function m0({actions:e,compact:t}){return e.length?t?jsxRuntime.jsx("div",{className:"flex flex-col items-center gap-2",children:e.map(o=>{let r=p0(o);return jsxRuntime.jsx(To,{appearance:cr,content:o.label,placement:"right",portal:true,children:jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",iconOnly:true,icon:o.icon,onClick:o.onClick,title:r,ariaLabel:r,className:De("h-10 w-10 rounded-lg border-transparent text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]","active:translate-y-0 active:scale-[0.96]")})},o.id)})}):jsxRuntime.jsx("div",{className:"flex flex-col gap-2",children:e.map(o=>jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",icon:o.icon,label:jsxRuntime.jsx("span",{className:"truncate",children:o.label}),onClick:o.onClick,title:p0(o),className:De("h-9 w-full justify-start gap-2.5 rounded-lg border-transparent px-3 text-left text-[13px] text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]","active:translate-y-0 active:scale-[0.985]")},o.id))}):null}a(m0,"NavigationLayoutActionButtons");function x0({activeItemId:e,items:t,onNavigate:o,revealRequest:r}){let n=ho.useRef(null),[i,s]=ho.useState({}),l=r?t.some(p=>Sl(p,r.id)&&!p.disabled):false,d=a(p=>{s(u=>({...u,[p]:!u[p]}));},"toggleRoot");ho.useEffect(()=>{if(!r||!l)return;s(u=>({...u,[r.id]:true}));let p=window.requestAnimationFrame(()=>{let u=n.current?.querySelector(`[data-navigation-sidebar-item-id="${CSS.escape(r.id)}"]`);u instanceof HTMLElement&&u.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});});return ()=>window.cancelAnimationFrame(p)},[l,r]);let c=a((p,u=0)=>p.map(g=>{let f=!!g.children?.length,b=Sl(g,e),x=!g.disabled&&(i[g.id]??b);return jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-id":g.id,children:[jsxRuntime.jsx(kl,{active:b,className:u>0?"pl-3":void 0,disabled:g.disabled,icon:g.icon,onClick:()=>f?d(g.id):o?.(g.id),postfix:f?jsxRuntime.jsx("div",{className:"flex flex-1 justify-end",children:jsxRuntime.jsx(ab,{open:false,sideways:true,className:"text-[hsl(var(--foreground))] transition-transform duration-200",style:{transform:x?"rotate(90deg)":"rotate(0deg)"}})}):void 0,children:g.label}),f&&x?jsxRuntime.jsx("div",{className:"mt-1 ml-3 flex flex-col gap-1 border-l border-[hsl(var(--input))] pl-2",children:c(g.children??[],u+1)}):null]},g.id)}),"renderItems");return jsxRuntime.jsxs("div",{className:"h-full flex-1 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[jsxRuntime.jsx("style",{children:".monkeys-navigation-sidebar-nav::-webkit-scrollbar { display: none; }"}),jsxRuntime.jsx("div",{ref:n,className:"monkeys-navigation-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",children:c(t)})]})}a(x0,"SidebarNavigationList");function f0({collapsed:e,logo:t,title:o}){if(!t)return null;let r=o??t.title,n=jsxRuntime.jsx("div",{className:De("flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",t.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:t.url?jsxRuntime.jsx("img",{src:t.url,alt:t.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:t.title.charAt(0)})});return e?jsxRuntime.jsx(To,{appearance:cr,content:r,placement:"right",portal:true,children:jsxRuntime.jsx(mt,{appearance:cr,ariaLabel:typeof r=="string"?r:t.title,className:"h-10 w-10 rounded-lg border-transparent bg-transparent p-0 shadow-none hover:bg-[hsl(var(--muted))]/60",icon:n,iconOnly:true,onClick:t.onClick,title:typeof r=="string"?r:t.title,tone:"muted"})}):jsxRuntime.jsx(mt,{appearance:cr,ariaLabel:t.title,className:"h-auto w-full justify-start gap-3 border-transparent bg-transparent p-0 text-left shadow-none hover:bg-transparent",classNames:{icon:"h-9 w-9"},icon:n,label:jsxRuntime.jsx("span",{className:"min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]",children:r}),onClick:t.onClick,title:typeof r=="string"?r:t.title,tone:"muted"})}a(f0,"SidebarBrand");function UW({accountMenu:e,activeItemId:t,actions:o=[],collapsed:r,collapsedAccountMenu:n,footer:i,header:s,items:l,logo:d,onCollapsedChange:c,onNavigate:p,onRevealRoot:u,revealRequest:g,title:f}){if(r){let b=y0(l,t);return jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col rounded-xl border border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] p-2 shadow-sm",children:[jsxRuntime.jsx("div",{className:"mb-3 flex shrink-0 justify-center",children:s??jsxRuntime.jsx(f0,{collapsed:true,logo:d,title:f})}),jsxRuntime.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center gap-2 overflow-y-auto pb-3",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:l.map(x=>{let y=b===x.id;return jsxRuntime.jsx(To,{appearance:cr,content:x.label,placement:"right",portal:true,children:jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",active:y,disabled:x.disabled,iconOnly:true,icon:x.icon,onClick:()=>{x.disabled||(u?.(x.id),c?.(false),!x.children?.length&&p?.(x.id));},title:typeof x.label=="string"?x.label:void 0,ariaLabel:typeof x.label=="string"?x.label:x.id,className:De("h-10 w-10 rounded-lg border text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.96]",y?"border-[hsl(var(--input))] bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm":"border-transparent hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]")})},x.id)})}),jsxRuntime.jsxs("div",{className:"-mx-2 mt-2 border-t border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-2 pt-2.5 pb-0.5",children:[jsxRuntime.jsx(m0,{actions:o,compact:true}),n?jsxRuntime.jsx("div",{className:"mt-2 flex justify-center border-t border-[hsl(var(--input))] pt-2",children:n}):null]})]})}return jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col justify-between gap-0 overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-5 pt-5 pb-1.5",children:[jsxRuntime.jsx("div",{className:"mb-4 shrink-0",children:s??jsxRuntime.jsx(f0,{logo:d,title:f})}),jsxRuntime.jsx(x0,{activeItemId:t,items:l,onNavigate:p,revealRequest:g}),jsxRuntime.jsxs("div",{className:"-mx-5 mt-2 border-t border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-4 pt-2.5 pb-1",children:[jsxRuntime.jsx(m0,{actions:o,compact:false}),i,e?jsxRuntime.jsx("div",{className:"mt-2 border-t border-[hsl(var(--input))] pt-2",children:e}):null]})]})}a(UW,"Sidebar");function ab({className:e,open:t,sideways:o=false,style:r}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",className:De("h-4 w-4 shrink-0",!o&&"transition-transform duration-200",!o&&t&&"rotate-180",e),style:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:o?"m9 18 6-6-6-6":"m6 9 6 6 6-6"})})}a(ab,"HeadbarChevronIcon");function KW(e,t){if(typeof e!="string"||typeof t!="string")return;let o=e.trim(),r=t.trim();return o&&r?`${o} / ${r}`:void 0}a(KW,"getHeadbarSummaryTitle");var b0="relative flex w-full min-w-0 cursor-pointer select-none items-center gap-2.5 px-3 py-2 text-sm outline-hidden transition-colors hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] focus:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] focus:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] data-[highlighted]:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] data-[highlighted]:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))]",v0={width:"max-content",maxWidth:"min(20rem, var(--radix-dropdown-menu-content-available-width))",background:"var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--monkeys-color-menu-surface)))",borderColor:"var(--monkeys-component-navigation-headbar-menu-border-color, var(--monkeys-component-overlay-border-color, hsl(var(--monkeys-color-border))))",color:"var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--monkeys-color-popover-foreground)))",boxShadow:"var(--monkeys-component-navigation-headbar-menu-shadow, var(--monkeys-component-overlay-menu-shadow, 0 10px 15px -3px rgb(0 0 0 / 0.1)))",backdropFilter:"blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, var(--monkeys-component-overlay-backdrop-blur, 0px)))",WebkitBackdropFilter:"blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, var(--monkeys-component-overlay-backdrop-blur, 0px)))"};function w0({activeItemId:e,items:t,menuContentRadiusClass:o,menuItemRadiusClass:r,onNavigate:n,onNavigateComplete:i,useTokenRadius:s}){let l=ke();return t.map(d=>{let c=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d.icon?jsxRuntime.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[hsl(var(--muted-foreground))]",children:d.icon}):null,jsxRuntime.jsx("span",{className:De("min-w-0 truncate",!!d.children?.length&&"flex-1"),children:d.headbarLabel??d.label})]});return d.children?.length?jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{disabled:d.disabled,className:De(b0,r),children:[c,jsxRuntime.jsx(ab,{open:false,sideways:true})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{...l,sideOffset:4,alignOffset:-6,"data-monkeys-component":"navigation-headbar-menu","data-slot":"content","data-surface":"menu",className:De("z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",ln("menu"),o),style:{...v0,minWidth:"12rem"},children:jsxRuntime.jsx(w0,{activeItemId:e,items:d.children,menuContentRadiusClass:o,menuItemRadiusClass:r,onNavigate:n,onNavigateComplete:i,useTokenRadius:s})})})]},d.id):jsxRuntime.jsxs(Bt__namespace.Item,{disabled:d.disabled,className:De(b0,r),style:ju(d.id===e,s),onSelect:()=>{d.disabled||(i(),n?.(d.id));},children:[c,d.trailing]},d.id)})}a(w0,"HeadbarDropdownItems");function qW({activeItemId:e,compound:t,isActive:o,item:r,label:n,menuButtonRadiusClass:i,menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:d,title:c,useTokenRadius:p}){let[u,g]=ho.useState(false),f=ke(),b=!r.disabled&&u,x=ho.useRef(null),y=ho.useRef(false),k=a(()=>{x.current&&(clearTimeout(x.current),x.current=null);},"clearCloseTimer"),w=a(()=>{r.disabled||(k(),g(true));},"openMenu"),v=a(()=>{k(),x.current=setTimeout(()=>{g(false),x.current=null;},120);},"scheduleCloseMenu"),h=a(()=>{let S=r.children?.find(T=>!T.disabled);return S?(g(false),d?.(S.id),true):false},"navigateToFirstEnabledChild");return ho.useEffect(()=>k,[]),jsxRuntime.jsxs(Bt__namespace.Root,{modal:false,open:b,onOpenChange:S=>g(!r.disabled&&S),children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",active:o||b,icon:r.icon,endIcon:jsxRuntime.jsx(ab,{open:b}),label:n,title:c,disabled:r.disabled,onClick:()=>{let S=y.current;y.current=false,!(S&&h())&&g(true);},onPointerDown:()=>{y.current=b;},onPointerCancel:()=>{y.current=false;},onKeyDown:S=>{!b||S.key!=="Enter"&&S.key!==" "||h()&&S.preventDefault();},onMouseEnter:w,onMouseLeave:v,style:ju(o||b,t?false:p),classNames:{icon:"text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",label:"flex shrink-0 items-center !overflow-visible !text-clip text-[inherit] [&_*]:!text-[inherit]"},className:De("shrink-0 border shadow-none",t&&"!rounded-none !border-0 !bg-transparent",i,o||b?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]")})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{...f,align:"start",sideOffset:5,"data-monkeys-component":"navigation-headbar-menu","data-slot":"content","data-surface":"menu",onCloseAutoFocus:S=>S.preventDefault(),onMouseEnter:w,onMouseLeave:v,className:De("z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",ln("menu"),s),style:{...v0,minWidth:"var(--radix-dropdown-menu-trigger-width)"},children:jsxRuntime.jsx(w0,{activeItemId:e,items:r.children??[],menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:d,onNavigateComplete:()=>g(false),useTokenRadius:p})})})]})}a(qW,"HeadbarNavMenuItem");function Gu(e){e.preventDefault(),e.stopPropagation();}a(Gu,"blockEvent");function YW({activeItemId:e,activeRootId:t,items:o,menuRadius:r="default",onNavigate:n}){let i=$u(r),s=$u(r),l=$u(r),d=r==="default";return jsxRuntime.jsx("div",{className:"flex w-max min-w-0 shrink-0 items-center gap-1",children:o.map(c=>{let p=t===c.id||e===c.id,u=!!c.headbarSecondaryAction,g=c.headbarLabel??c.label,f=jW(c,e),b=f?f.headbarLabel??f.label:void 0,x=f?jsxRuntime.jsxs("span",{"data-navigation-headbar-selected-child":f.id,className:"flex shrink-0 items-center gap-1.5 whitespace-nowrap",children:[jsxRuntime.jsx("span",{className:"shrink-0",children:g}),jsxRuntime.jsx("span",{className:"shrink-0",children:"/"}),jsxRuntime.jsx("span",{className:"shrink-0",children:b})]}):jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:g}),y=f?KW(g,b):void 0,k=c.children?.length?jsxRuntime.jsx(qW,{activeItemId:e,compound:u,isActive:p,item:c,label:x,menuButtonRadiusClass:i,menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:n,title:y,useTokenRadius:d}):jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",active:p,disabled:c.disabled,icon:c.icon,label:jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:x}),c.trailing]}),onClick:()=>n?.(c.id),style:ju(p,u?false:d),classNames:{icon:"text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",label:"shrink-0 !overflow-visible !text-clip text-[inherit] [&_*]:!text-[inherit]"},className:De("shrink-0 border shadow-none",u&&"!rounded-none !border-0 !bg-transparent",i,p?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]")});return u?jsxRuntime.jsxs("div",{"data-navigation-headbar-compound-item":c.id,"aria-disabled":c.disabled,className:De("inline-flex min-w-0 shrink-0 items-center gap-0 overflow-hidden border shadow-none",i,p?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]"),style:$W(p,d),children:[jsxRuntime.jsx("span",{"data-navigation-headbar-primary-action":"",className:"inline-flex min-w-0 shrink-0",children:k}),jsxRuntime.jsx("span",{"data-navigation-headbar-secondary-action":c.id,...c.disabled&&{inert:"",onClickCapture:Gu,onKeyDownCapture:Gu,onKeyUpCapture:Gu,onPointerDownCapture:Gu},className:De("inline-flex min-w-0 shrink-0 items-center",c.disabled&&"!cursor-not-allowed opacity-60"),children:c.headbarSecondaryAction})]},c.id):jsxRuntime.jsx(ho.Fragment,{children:k},c.id)})})}a(YW,"NavigationHeadbarMenu");function XW({activeItemId:e,activeRootId:t,actions:o,accountMenu:r,className:n,extra:i,layout:s,brand:l,logo:d,navigation:c,navItems:p=[],onNavigate:u}){let g=OW(s?.heightPx),f=s?.layoutMode??"boxed",b=s?.menuRadius??"default",x=s?.surface??"card",y=HW(g),k=_W(f,g,x),w=!!s?.brandTitle;return jsxRuntime.jsxs("header",{className:De(VW(f,s?.navPosition),n),"data-navigation-headbar":"","data-navigation-headbar-surface":x,style:k,children:[jsxRuntime.jsx("div",{className:"flex min-w-0 items-center justify-start",children:l??(d?jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",icon:jsxRuntime.jsx("div",{className:De("flex items-center justify-center overflow-hidden rounded-lg",d.url?"w-auto max-w-[min(22rem,30vw)] bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),style:d.url?{height:y}:{width:y,height:y},children:d.url?jsxRuntime.jsx("img",{src:d.url,alt:d.title,className:"block h-full w-auto object-contain"}):jsxRuntime.jsx("span",{className:"text-base font-bold",children:d.title.charAt(0)})}),label:w?jsxRuntime.jsx("span",{className:"truncate whitespace-nowrap text-base font-medium text-[hsl(var(--foreground))]",children:s?.brandTitle}):null,ariaLabel:d.title,title:d.title,className:"h-auto min-w-0 justify-start border-transparent bg-transparent p-0 shadow-none hover:bg-transparent",classNames:d.url?{icon:"!h-auto !w-auto shrink-0"}:void 0,onClick:d.onClick}):null)}),jsxRuntime.jsx("div",{className:De("flex min-w-0 items-center",GW(s?.navPosition)),children:jsxRuntime.jsx("div",{className:"no-scrollbar flex max-w-full min-w-0 items-center overflow-x-auto overscroll-x-contain",children:c??jsxRuntime.jsx(YW,{activeItemId:e,activeRootId:t,items:p,menuRadius:b,onNavigate:u})})}),jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center justify-end gap-3",children:[o,i,r]})]})}a(XW,"NavigationHeadbar");function QW({activeItemId:e,activeRootId:t,allowModeSwitch:o=false,accountMenu:r,children:n,className:i,collapsedSidebarAccountMenu:s,collapsedSidebarWidth:l=RW,contextualSidebar:d=false,contextualSidebarHeader:c,contextualSidebarWidth:p=MW,defaultMode:u="headbar",defaultSidebarCollapsed:g=false,expandedSidebarWidth:f=NW,expandSidebarLabel:b="Expand sidebar",flush:x=false,contentFrame:y=true,headbarActions:k,headbarLayout:w,logo:v,mode:h,navItems:S,onModeChange:T,onNavigate:C,onSidebarCollapsedChange:R,renderHeadbarExtra:M,collapseSidebarLabel:I="Collapse sidebar",sidebarCollapsed:B,sidebarAccountMenu:N,sidebarFooter:D,sidebarHeader:E,switchToHeadbarLabel:P="Switch to headbar",switchToSidebarLabel:W="Switch to sidebar"}){let[H,A]=ho.useState(u),[L,F]=ho.useState(g),[G,$]=ho.useState(null),_=h!==void 0,z=B!==void 0,re=_?h:H,Z=z?B:L,ae=re==="headbar",ee=Z?l:f,q=t??y0(S,e),U=S.find(me=>me.id===q),X=U?.children??[];ho.useEffect(()=>{_||A(u);},[u,_]),ho.useEffect(()=>{z||F(g);},[g,z]);let O=a(me=>{_||A(me),T?.(me);},"setNavigationMode"),K=a(me=>{z||F(me),R?.(me);},"setCollapsed"),ne=[];o&&ne.push({id:"toggle-headbar",label:P,onClick:a(()=>O("headbar"),"onClick"),icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px] rotate-180",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M3 9h18"})]})}),ne.push({id:"toggle-sidebar",label:Z?b:I,onClick:a(()=>K(!Z),"onClick"),icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M9 3v18"}),jsxRuntime.jsx("path",{d:Z?"m14 9 3 3-3 3":"m16 15-3-3 3-3"})]})});let fe=ae&&d&&X.length?jsxRuntime.jsx("aside",{className:"relative h-full min-h-0 shrink-0 overflow-hidden","data-navigation-contextual-sidebar":q,style:{width:p},children:jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col gap-3 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] px-4 py-4",children:[jsxRuntime.jsx("div",{className:"shrink-0 px-2 text-sm font-semibold text-[hsl(var(--foreground))]",children:c??U?.label}),jsxRuntime.jsx(x0,{activeItemId:e,items:X,onNavigate:C})]})}):ae?null:jsxRuntime.jsx("div",{className:De("relative h-full min-h-0 shrink-0 transition-[width] duration-260",Z?"z-20 overflow-visible":"z-10 overflow-hidden"),style:{width:ee,transitionTimingFunction:IW},children:jsxRuntime.jsx(UW,{accountMenu:N??r,activeItemId:e,actions:ne,collapsed:Z,collapsedAccountMenu:s??r,footer:D,header:E,items:S,logo:v,onCollapsedChange:K,onNavigate:C,onRevealRoot:me=>$(ie=>({id:me,nonce:(ie?.nonce??0)+1})),revealRequest:G,title:w?.brandTitle})}),he=ae?jsxRuntime.jsx(XW,{activeItemId:e,activeRootId:q,actions:o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[k,jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M9 3v18"}),jsxRuntime.jsx("path",{d:"m14 9 3 3-3 3"})]}),label:jsxRuntime.jsx("span",{className:"truncate whitespace-nowrap",children:W}),onClick:()=>O("sidebar"),className:De("h-auto min-w-0 shrink px-3 py-2 text-sm font-medium text-[hsl(var(--muted-foreground))] shadow-none hover:border-[hsl(var(--input))]/70 hover:bg-[hsl(var(--muted))]/60 hover:text-[hsl(var(--foreground))]",$u(w?.menuRadius))})]}):k,accountMenu:r,extra:M,layout:w,logo:v,navItems:S,onNavigate:C}):null;return jsxRuntime.jsx(g0,{header:he,sidebar:fe,flush:x,contentFrame:y,className:i,children:n})}a(QW,"NavigationLayout");var t3={variant:"default",density:"default"},o3=ho.createContext(t3);function r3(e,t={}){return {variant:t.variant??e.variant,density:t.density??(t.variant==="trend"?"compact":e.density)}}a(r3,"resolveAgentWorkbenchAppearance");function Tl(e={}){return r3(ho.useContext(o3),e)}a(Tl,"useAgentWorkbenchAppearance");var n3={page:"bg-background text-foreground",panel:"bg-card text-card-foreground",elevated:"border border-border bg-popover text-popover-foreground shadow-sm",subtle:"bg-muted/40 text-foreground",overlay:"border border-border bg-popover text-popover-foreground shadow-lg"};ho.forwardRef(a(function({level:t="panel",variant:o,density:r,className:n,children:i,...s},l){let d=Tl({variant:o,density:r});return jsxRuntime.jsx("div",{...s,ref:l,"data-agent-workbench-surface":t,"data-agent-workbench-variant":d.variant,"data-agent-workbench-density":d.density,className:De(n3[t],n),children:i})},"AgentWorkbenchSurface"));var S0={sparkles:lucideReact.Sparkles,palette:lucideReact.Palette,search:lucideReact.Search,"file-text":lucideReact.FileText,code:lucideReact.Code2,"shopping-bag":lucideReact.ShoppingBag},Ua="__quick-start__";function g3({template:e}){let t=S0[e.icon||"sparkles"];return e.coverImageUrl?jsxRuntime.jsx("img",{src:e.coverImageUrl,alt:"",className:"size-full bg-muted object-contain"}):jsxRuntime.jsx("span",{className:"flex size-full items-center justify-center bg-gradient-to-br from-primary/5 via-muted/50 to-primary/15",children:jsxRuntime.jsx("span",{className:"flex size-14 items-center justify-center rounded-2xl border border-primary/10 bg-background/85 text-primary shadow-sm",children:jsxRuntime.jsx(t,{className:"size-7","aria-hidden":"true"})})})}a(g3,"TemplateVisual");function T0({viewModel:e,className:t,onIntent:o}){let r=Ye().agentWorkbench.quickStart,n=ho.useRef(null),[i,s]=ho.useState(),[l,d]=ho.useState(),[c,p]=ho.useState(),u=ho.useMemo(()=>e.categories.map(h=>({...h,sections:h.sections.map(S=>({...S,templates:S.templates.filter(T=>!T.modes||T.modes.includes(e.mode))})).filter(S=>S.templates.length>0)})).filter(h=>h.sections.length>0),[e.categories,e.mode]),g=ho.useMemo(()=>{let h=u.flatMap(S=>S.sections.filter(T=>T.id==="quick-start")).map(S=>S.templates).flat().filter((S,T,C)=>C.findIndex(R=>R.id===S.id)===T);if(h.length!==0)return {id:Ua,label:r.label,icon:"sparkles",sections:[{id:"quick-start",label:r.label,templates:h}]}},[u,r.label]),f=i===Ua?g:u.find(h=>h.id===i),b=f?.sections.find(h=>h.id===l)||f?.sections[0],x=b?.templates.length?b.templates.every(h=>!h.coverImageUrl):false;if(ho.useEffect(()=>{i&&i!==Ua&&!u.some(h=>h.id===i)&&(s(void 0),d(void 0)),i===Ua&&!g&&(s(void 0),d(void 0));},[i,u,g]),u.length===0)return null;let y=a(h=>{s(h.id),d(h.sections[0]?.id),o?.({type:"change-category",categoryId:h.id});},"selectCategory"),k=a(()=>{g&&(s(Ua),d(g.sections[0]?.id),o?.({type:"change-category"}));},"selectQuickStart"),w=a(h=>{f&&(d(h),o?.({type:"change-section",categoryId:f.id,sectionId:h}));},"selectSection"),v=a(h=>{if(e.disabled)return;if(h.action!=="upload"){o?.({type:"select-template",templateId:h.id,prompt:h.prompt});return}let S=n.current;S&&(S.accept=h.accept||"*/*",S.multiple=h.multiple===true,p(h),S.click());},"selectTemplate");return jsxRuntime.jsxs("section",{className:De("agent-workbench-quick-start min-w-0 max-w-full",t),"aria-label":r.label,children:[jsxRuntime.jsx("input",{ref:n,type:"file",className:"hidden",onChange:h=>{let S=Array.from(h.target.files||[]);c&&S.length>0&&o?.({type:"select-template",templateId:c.id,prompt:c.prompt,files:c.multiple?S:S.slice(0,1)}),p(void 0),h.target.value="";}}),f?jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 max-w-full items-center gap-1 overflow-x-auto pb-1",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>{s(void 0),d(void 0),o?.({type:"change-category"});},children:[jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"size-4","aria-hidden":"true"}),r.back]}),f.sections.map((h,S)=>jsxRuntime.jsx("button",{type:"button","aria-pressed":b?.id===h.id,className:De("h-9 shrink-0 rounded-md px-4 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",b?.id===h.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"),onClick:()=>w(h.id),children:f.id!==Ua&&S===0?f.label:h.label},h.id))]}),jsxRuntime.jsx("div",{"data-quick-start-layout":x?"list":"cards",className:De("grid",x?"grid-cols-1 gap-0":"grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3"),children:b?.templates.map(h=>jsxRuntime.jsxs("button",{type:"button",disabled:e.disabled,"data-quick-start-template-id":h.id,className:De("group min-w-0 overflow-hidden text-left transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x?"flex min-h-14 items-center rounded-none border-x-0 border-t-0 bg-transparent shadow-none hover:border-border hover:bg-muted/40 last:border-b-0":"rounded-xl border border-border bg-background hover:border-primary/30 hover:bg-muted/20"),onClick:()=>v(h),children:[jsxRuntime.jsxs("span",{className:De(x?"min-w-0 flex-1 px-2 py-2.5":"block px-4 pb-3 pt-4"),children:[jsxRuntime.jsxs("span",{className:De("flex items-center gap-2 text-sm text-foreground",x?"font-medium":"font-semibold"),children:[h.title,h.action==="upload"?jsxRuntime.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"size-3","aria-hidden":"true"}),r.addFile]}):null]}),h.description?jsxRuntime.jsx("span",{className:De("line-clamp-2 block text-xs leading-4 text-muted-foreground",x?"mt-0.5 min-h-0 text-muted-foreground/75":"mt-1 min-h-8"),children:h.description}):null]}),x?jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"mr-2 size-4 shrink-0 text-muted-foreground/45","aria-hidden":"true"}):jsxRuntime.jsx("span",{className:De("block overflow-hidden",h.coverImageUrl?"aspect-[5/2]":"h-28"),children:jsxRuntime.jsx(g3,{template:h})})]},h.id))})]}):jsxRuntime.jsxs("div",{className:"flex max-w-full items-center justify-center gap-2 overflow-x-auto px-1 pb-1",children:[g?jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring","aria-pressed":i===Ua,onClick:k,children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),r.label]}):null,u.map(h=>{let S=S0[h.icon||"sparkles"];return jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>y(h),children:[jsxRuntime.jsx(S,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),h.label]},h.id)})]})]})}a(T0,"AgentWorkbenchQuickStart");var Ka=ho.forwardRef(a(function({children:t,header:o,search:r,primaryAction:n,actions:i,groups:s,footer:l,className:d,classNames:c,bodyProps:p,bodyScrollable:u=true,status:g="ready",variant:f,density:b,loadingState:x,emptyState:y,errorState:k,...w},v){let h=Tl({variant:f,density:b}),S=h.density==="compact",T=r!==void 0||n!==void 0||i!==void 0,C=g==="loading"?x:g==="empty"?y:g==="error"?k:t;return jsxRuntime.jsxs("nav",{ref:v,"data-agent-workbench-variant":h.variant,"data-agent-workbench-density":h.density,"data-agent-workbench-status":g,className:De("flex h-full min-h-0 flex-col bg-card text-card-foreground",c?.root,d),...w,children:[o!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.header),children:o}):null,T?jsxRuntime.jsxs("div",{className:De("shrink-0",S?"space-y-2 px-3 pb-2 pt-3":"space-y-3 px-4 pb-2 pt-4",c?.search),children:[r,n!==void 0?jsxRuntime.jsx("div",{className:De(c?.primaryAction),children:n}):null,i!==void 0?jsxRuntime.jsx("div",{className:De("flex min-w-0 items-center gap-2",c?.actions),children:i}):null]}):null,jsxRuntime.jsx("div",{"data-agent-workbench-scroll-region":u?"":void 0,...p,tabIndex:p?.tabIndex??(u?0:void 0),className:De("min-h-0 flex-1",S?"px-3 pb-3":"px-4 pb-4",u&&"overflow-x-hidden overflow-y-auto overscroll-contain",c?.body),children:C}),s!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.groups),children:s}):null,l!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.footer),children:l}):null]})},"AgentWorkbenchSidebarContainer"));Ka.displayName="AgentWorkbenchSidebarContainer";function Uu({value:e,label:t,placeholder:o=t,className:r,variant:n="default",onChange:i}){let s=Ye().agentWorkbench.navigation,l=ho.useRef(null);return ho.useEffect(()=>{let d=a(c=>{!(c.ctrlKey||c.metaKey)||c.key.toLocaleLowerCase()!=="k"||(c.preventDefault(),l.current?.focus(),l.current?.select());},"handleShortcut");return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]),jsxRuntime.jsxs(oy,{className:De(n==="trend"?"h-12 rounded-[var(--radius)] border-border bg-card text-foreground":"h-10 rounded-lg bg-card",r),children:[jsxRuntime.jsx(qd,{children:jsxRuntime.jsx(lucideReact.Search,{className:"size-4","aria-hidden":"true"})}),jsxRuntime.jsx(gm,{ref:l,type:"search",value:e,"aria-label":t,placeholder:o,className:"min-w-0 [&::-webkit-search-cancel-button]:hidden",onChange:d=>i(d.target.value),onKeyDown:d=>{d.key==="Escape"&&(i(""),d.currentTarget.blur());}}),e?jsxRuntime.jsx(qd,{align:"inline-end",children:jsxRuntime.jsx(ry,{size:"icon-xs","aria-label":s.clearSearch,onClick:()=>i(""),children:jsxRuntime.jsx(lucideReact.X,{className:"size-3.5","aria-hidden":"true"})})}):jsxRuntime.jsx(qd,{align:"inline-end",children:jsxRuntime.jsx("kbd",{className:"border border-border px-1.5 py-0.5 text-[10px]",children:"Ctrl K"})})]})}a(Uu,"AgentWorkbenchSidebarSearch");function Ku({label:e,className:t,variant:o="default",onClick:r}){return jsxRuntime.jsxs(pt,{type:"button",variant:o==="trend"?"default":"ghost",className:De(o==="trend"?"h-11 w-full justify-center gap-2 rounded-[var(--radius)] border border-primary/60 bg-primary px-3 font-semibold text-primary-foreground hover:bg-primary/90":"h-9 w-full justify-start gap-2 px-3 text-sm",t),onClick:r,children:[jsxRuntime.jsx(lucideReact.SquarePen,{className:"size-4","aria-hidden":"true"}),e]})}a(Ku,"AgentWorkbenchSidebarNewSessionButton");function I0({item:e}){let[t,o]=ho.useState(false);return e.thumbnailUrl&&!t?jsxRuntime.jsx("img",{src:e.thumbnailUrl,alt:"",className:"size-full object-cover",loading:"lazy",onError:()=>o(true)}):jsxRuntime.jsx(lucideReact.Image,{className:"size-5","aria-hidden":"true"})}a(I0,"SessionAvatar");function D0({item:e}){let{locale:t}=Co(),o=Ye().agentWorkbench.navigation;return jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate text-xs text-foreground/80",children:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e.updatedAt))}),e.mode?jsxRuntime.jsx("span",{className:De("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none",e.mode==="work"?"bg-primary/10 text-primary":"bg-muted text-foreground"),children:e.mode==="work"?o.work:o.chat}):null]})}a(D0,"SessionMeta");function D3({status:e}){let t=Ye().agentWorkbench.navigation;return e==="running"?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin text-primary","aria-label":t.running}):e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-primary","aria-label":t.completed}):e==="error"?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"size-4 text-destructive-text","aria-label":t.failed}):null}a(D3,"StatusIndicator");function qu({sessions:e,selectedSessionId:t,status:o="ready",error:r,query:n="",emptyLabel:i,noResultsLabel:s,retryLabel:l,groupByMode:d=false,showHeading:c=false,variant:p="default",className:u,itemClassName:g,capabilities:f,onSelect:b,onTogglePin:x,onRename:y,onDelete:k,onRetry:w}){let v=Ye().agentWorkbench.navigation,h=ho.useRef(null),[S,T]=ho.useState(),[C,R]=ho.useState("");ho.useEffect(()=>{S&&(h.current?.focus(),h.current?.select());},[S]);let M=a(()=>{T(void 0),R("");},"cancelRename"),I=a(D=>{let E=C.trim();E&&E!==D.title&&y?.(D.id,E),M();},"saveRename");if(o==="loading"&&e.length===0)return jsxRuntime.jsx("div",{className:"space-y-2 px-1 py-3",role:"status","aria-label":v.loading,children:Array.from({length:4},(D,E)=>jsxRuntime.jsx("div",{"aria-hidden":"true",className:De("animate-pulse rounded-[var(--radius)] bg-muted/70",p==="trend"?"h-10":"h-14")},E))});if(o==="error")return jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 px-3 py-8 text-center",children:[jsxRuntime.jsx("p",{className:"max-w-full break-words text-sm text-muted-foreground",role:"alert",children:r}),w?jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 px-0 text-sm text-primary hover:text-primary",onClick:w,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-3.5","aria-hidden":"true"}),l??v.retry]}):null]});if(e.length===0)return jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:n?s:i});let B=a(D=>jsxRuntime.jsx("div",{className:"space-y-3",children:D.map(E=>jsxRuntime.jsxs("div",{"aria-current":E.id===t?"page":void 0,"data-agent-session-status":E.status??"idle","aria-busy":E.status==="running"?"true":void 0,className:"group flex h-10 w-full min-w-0 items-center rounded-[var(--radius)] border border-transparent bg-muted/60 text-foreground transition hover:bg-muted focus-within:border-ring focus-within:ring-2 focus-within:ring-ring aria-[current=page]:border-primary aria-[current=page]:bg-primary/10",children:[jsxRuntime.jsx("button",{type:"button",title:E.title,className:"h-full min-w-0 flex-1 truncate px-3 text-left text-sm font-semibold",onClick:()=>b(E.id),children:E.title}),f?.delete?jsxRuntime.jsx("span",{"data-agent-workbench-item-actions":true,className:"mr-1 shrink-0 opacity-0 transition-opacity group-aria-[current=page]:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100",onClick:P=>P.stopPropagation(),onKeyDown:P=>P.stopPropagation(),children:jsxRuntime.jsxs(Ts,{children:[jsxRuntime.jsx(Ns,{asChild:true,children:jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon","aria-label":v.actions,className:"size-8 text-muted-foreground",children:jsxRuntime.jsx(lucideReact.Ellipsis,{className:"size-4","aria-hidden":"true"})})}),jsxRuntime.jsx(yi,{align:"end",children:jsxRuntime.jsxs(Rs,{className:"text-destructive-text",onSelect:()=>k?.(E.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"mr-2 size-4","aria-hidden":"true"}),v.delete]})})]})}):null]},E.id))}),"renderTrendItems"),N=a(D=>jsxRuntime.jsx("div",{className:"space-y-1",children:D.map(E=>{let P=E.contextUsage&&E.contextUsage.maxTokens>0?Math.min(100,Math.round(E.contextUsage.usedTokens/E.contextUsage.maxTokens*100)):void 0;return jsxRuntime.jsxs("div",{"aria-current":E.id===t?"page":void 0,className:De("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted",g),children:[S===E.id?jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(I0,{item:E})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx(un,{ref:h,value:C,"aria-label":v.rename,appearance:"compact",className:"h-6 w-full border-primary px-1.5 text-sm font-medium",onChange:W=>R(W.target.value),onClick:W=>W.stopPropagation(),onBlur:()=>I(E),onKeyDown:W=>{W.stopPropagation(),W.key==="Enter"?(W.preventDefault(),I(E)):W.key==="Escape"&&(W.preventDefault(),M());}}),jsxRuntime.jsx(D0,{item:E})]})]}):jsxRuntime.jsxs("button",{type:"button",title:E.title,className:"flex min-w-0 flex-1 items-center gap-3 text-left",onClick:()=>b(E.id),children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(I0,{item:E})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-medium",children:E.title}),jsxRuntime.jsx(D0,{item:E})]})]}),jsxRuntime.jsxs("span",{"data-agent-workbench-item-actions":true,className:"flex shrink-0 items-center gap-1",children:[P!==void 0&&E.status==="idle"?jsxRuntime.jsxs("span",{className:"text-xs text-foreground","aria-label":v.contextUsage({percent:P}),children:[P,"%"]}):jsxRuntime.jsx(D3,{status:E.status}),f?.pin?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon","aria-label":E.pinned?v.unpin:v.pin,className:De("size-8 text-muted-foreground opacity-0 group-hover:opacity-100",E.pinned&&"text-primary opacity-100"),onClick:W=>{W.stopPropagation(),x?.(E.id,!E.pinned);},children:jsxRuntime.jsx(lucideReact.Pin,{className:De("size-4",E.pinned&&"fill-current")})}):null,f?.rename||f?.delete?jsxRuntime.jsx("span",{onClick:W=>W.stopPropagation(),onKeyDown:W=>W.stopPropagation(),children:jsxRuntime.jsxs(Ts,{children:[jsxRuntime.jsx(Ns,{asChild:true,children:jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon",className:"size-8","aria-label":v.actions,children:jsxRuntime.jsx(lucideReact.Ellipsis,{className:"size-4","aria-hidden":"true"})})}),jsxRuntime.jsxs(yi,{align:"end",children:[f.rename?jsxRuntime.jsxs(Rs,{onSelect:()=>{T(E.id),R(E.title);},children:[jsxRuntime.jsx(lucideReact.Pencil,{className:"mr-2 size-4","aria-hidden":"true"}),v.rename]}):null,f.delete?jsxRuntime.jsxs(Rs,{className:"text-destructive-text",onSelect:()=>k?.(E.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"mr-2 size-4","aria-hidden":"true"}),v.delete]}):null]})]})}):null]})]},E.id)})}),"renderItems");return jsxRuntime.jsxs("div",{className:De("space-y-2",u),children:[c&&!d?jsxRuntime.jsx("h3",{className:"mb-2 px-3 text-xs font-medium text-muted-foreground",children:v.recentSessions}):null,p==="trend"?B(e):d?[{id:"chatbot",label:v.chats,icon:lucideReact.MessageSquare,items:e.filter(D=>D.mode!=="work")},{id:"agent",label:v.agents,icon:lucideReact.Bot,items:e.filter(D=>D.mode==="work")}].map(({id:D,label:E,icon:P,items:W})=>jsxRuntime.jsxs("details",{open:true,"aria-label":E,children:[jsxRuntime.jsxs("summary",{className:"flex h-9 cursor-pointer list-none items-center gap-2 rounded-md px-3 text-sm font-semibold hover:bg-muted",children:[jsxRuntime.jsx(P,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:E})]}),N(W)]},D)):N(e)]})}a(qu,"AgentWorkbenchSessionList");var F3={contract:"AgentWorkbenchNavigationViewModel",activeTab:"sessions",searchQuery:"",agents:{status:"loading",items:[]},sessions:{status:"loading",items:[]},capabilities:{createAgent:false,createSession:false,manageCapabilities:false,manageAgentSettings:false,pinAgents:false,pinSessions:false,renameSessions:false,deleteSessions:false}};function H3({item:e}){let[t,o]=ho.useState(false);if(e.iconUrl&&!t)return jsxRuntime.jsx("img",{src:e.iconUrl,alt:"",className:"size-full object-cover",onError:()=>o(true)});let r=e.name.trim().charAt(0).toLocaleUpperCase();return r?jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:r}):jsxRuntime.jsx(lucideReact.Bot,{className:"size-4"})}a(H3,"ItemAvatar");function V3({status:e,empty:t,noResults:o,hasItems:r,query:n,error:i,onRetry:s}){let l=Ye().agentWorkbench.navigation;return e==="loading"&&!r?jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:l.loading}):e==="error"?jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 px-3 py-8 text-center",children:[jsxRuntime.jsx("p",{className:"max-w-full break-words text-sm text-muted-foreground",role:"alert",children:i}),jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 px-0 text-sm text-primary hover:text-primary",onClick:s,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-3.5","aria-hidden":"true"}),l.retry]})]}):r?null:jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:n?o:t})}a(V3,"CollectionState");function A0({viewModel:e=F3,navigationMode:t,config:o,header:r,headerActions:n,footer:i,className:s,classNames:l,onIntent:d}){let c=Ye().agentWorkbench.navigation,p=ho.useMemo(()=>monkeys.resolveAgentWorkbenchSidebarConfig(o),[o]),u=ho.useMemo(()=>new Set(p.visibleSections),[p.visibleSections]),g=t==="sessions-only"||t===void 0&&p.navigationMode!=="default",f=u.has("agents")&&!g,b=u.has("sessions"),x=e.searchQuery.trim().toLocaleLowerCase(),y=ho.useMemo(()=>e.agents.items.filter(w=>!x||`${w.name} ${w.description??""}`.toLocaleLowerCase().includes(x)),[x,e.agents.items]),k=ho.useMemo(()=>e.sessions.items.filter(w=>!x||w.title.toLocaleLowerCase().includes(x)),[x,e.sessions.items]);return jsxRuntime.jsx(Da,{value:g||!f?"sessions":e.activeTab,onValueChange:w=>{!g&&(w==="agents"||w==="sessions")&&d?.({type:"change-tab",tab:w});},className:"h-full min-h-0",children:jsxRuntime.jsxs(Ka,{"data-sidebar-width-percent":p.widthPercent,"aria-label":c.tabsLabel,header:u.has("header")?r:void 0,search:u.has("search")?jsxRuntime.jsx(Uu,{value:e.searchQuery,label:g?c.searchSessions:c.search,className:l?.search,onChange:w=>d?.({type:"change-search",query:w})}):void 0,actions:f&&b||n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&b?jsxRuntime.jsxs(Pa,{className:De("grid min-w-0 flex-1 grid-cols-2 text-foreground",l?.tabs),"aria-label":c.tabsLabel,children:[jsxRuntime.jsx(jn,{value:"agents",children:c.agents}),jsxRuntime.jsx(jn,{value:"sessions",children:c.sessions})]}):null,n?jsxRuntime.jsx("div",{className:"flex shrink-0 items-center",children:n}):null]}):void 0,footer:u.has("footer")&&(!g&&e.capabilities.manageAgentSettings||i)?jsxRuntime.jsxs("div",{className:De("border-t border-border p-4",l?.footer),children:[!g&&e.capabilities.manageAgentSettings?jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",className:"h-10 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"open-agent-settings"}),children:[jsxRuntime.jsx(lucideReact.Settings,{className:"size-4","aria-hidden":"true"}),c.settings]}):null,i]}):void 0,bodyScrollable:false,className:s,classNames:{root:l?.root,body:"flex min-h-0 flex-1 flex-col p-0"},children:[f?jsxRuntime.jsxs(cn,{value:"agents","data-agent-workbench-scroll-region":true,className:De("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4",l?.body),children:[e.capabilities.createAgent?jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",className:"mb-3 h-9 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"create-agent"}),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"size-4","aria-hidden":"true"}),c.newAgent]}):null,jsxRuntime.jsx("h3",{className:"mb-2 px-3 text-xs font-medium text-muted-foreground",children:c.allAgents}),jsxRuntime.jsx(V3,{status:e.agents.status,empty:c.emptyAgents,noResults:c.noResults,hasItems:y.length>0,query:x,error:e.agents.error,onRetry:()=>d?.({type:"retry-agents"})}),jsxRuntime.jsx("div",{className:"space-y-1",children:y.map(w=>jsxRuntime.jsxs("div",{"aria-current":w.id===e.selectedAgentItem?"page":void 0,className:De("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted",l?.item),children:[jsxRuntime.jsxs("button",{type:"button",title:w.name,className:"flex min-w-0 flex-1 items-center gap-3 text-left",onClick:()=>d?.({type:"select-agent",itemId:w.id}),children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(H3,{item:w})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-medium",children:w.name}),jsxRuntime.jsx("span",{className:"block truncate text-xs text-foreground/80",children:w.description||c.noDescription})]})]}),w.builtIn?jsxRuntime.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-1 text-[10px] text-foreground",children:c.builtIn}):null,e.capabilities.pinAgents?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon","aria-label":w.pinned?c.unpin:c.pin,className:De("size-8 text-muted-foreground opacity-0 group-hover:opacity-100",w.pinned&&"text-primary opacity-100"),onClick:v=>{v.stopPropagation(),d?.({type:"toggle-agent-pin",itemId:w.id,pinned:!w.pinned});},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),d?.({type:"toggle-agent-pin",itemId:w.id,pinned:!w.pinned}));},children:jsxRuntime.jsx(lucideReact.Pin,{className:De("size-4",w.pinned&&"fill-current",w.pinPending&&"animate-pulse")})}):null]},w.id))})]}):null,b?jsxRuntime.jsxs(cn,{value:"sessions","data-agent-workbench-scroll-region":true,className:De("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4",l?.body),children:[u.has("new-session")&&e.capabilities.createSession?jsxRuntime.jsx(Ku,{label:c.newSession,onClick:()=>d?.({type:"create-session"})}):null,!g&&e.capabilities.manageCapabilities?jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",className:"mb-3 h-9 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"open-capabilities"}),children:[jsxRuntime.jsx(lucideReact.Blocks,{className:"size-4","aria-hidden":"true"}),c.capabilities]}):null,jsxRuntime.jsx(qu,{sessions:k,selectedSessionId:e.selectedSessionItem,status:e.sessions.status,error:e.sessions.error,query:x,emptyLabel:c.emptySessions,noResultsLabel:c.noResults,groupByMode:g,showHeading:!g,itemClassName:l?.item,capabilities:{pin:e.capabilities.pinSessions,rename:e.capabilities.renameSessions,delete:e.capabilities.deleteSessions},onSelect:w=>d?.({type:"select-session",sessionId:w}),onTogglePin:(w,v)=>d?.({type:"toggle-session-pin",sessionId:w,pinned:v}),onRename:(w,v)=>d?.({type:"rename-session",sessionId:w,title:v}),onDelete:w=>d?.({type:"delete-session",sessionId:w}),onRetry:()=>d?.({type:"retry-sessions"})})]}):null]})})}a(A0,"AgentWorkbenchSidebar");function B0({item:e,src:t=e.imageUrl,className:o,onError:r}){if(!t)return null;let n=e.mediaVariant??"cover",i=n==="logo",s=n==="cover-with-label",l=e.mediaTreatment==="monochrome-light"?"brightness-0 invert":e.mediaTreatment==="invert"?"invert":"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:De(i?"flex size-full items-center justify-center bg-[hsl(var(--monkeys-color-media-surface))] p-token-xl":"block size-full",o),children:jsxRuntime.jsx("img",{src:t,alt:"",className:De("transition-transform duration-300 group-hover:scale-[1.03]",i?"max-h-full max-w-full object-contain":"size-full object-cover",l),onError:r})}),s?jsxRuntime.jsxs("span",{className:"pointer-events-none absolute inset-x-0 bottom-0 text-[hsl(var(--monkeys-color-media-foreground))]",style:{paddingInline:"var(--global-spacing, 0.75rem)",paddingBottom:"var(--global-spacing-sm, 0.5rem)",paddingTop:"var(--global-spacing-2xl, 1.5rem)",backgroundImage:"linear-gradient(to top, hsl(var(--monkeys-color-media-overlay) / 0.8), hsl(var(--monkeys-color-media-overlay) / 0.3), transparent)"},children:[jsxRuntime.jsx("span",{className:"block text-base font-semibold",children:e.title}),e.subtitle?jsxRuntime.jsx("span",{className:"block text-xs opacity-75",style:{marginTop:"calc(var(--global-spacing, 0.75rem) / 6)"},children:e.subtitle}):null]}):null]})}a(B0,"AgentWorkbenchExploreCardMedia");function L0({sessions:e,groups:t,config:o,labels:r,selectedSessionId:n,searchQuery:i="",loading:s=false,error:l,showDraftSession:d=!n,deleteSessions:c=false,variant:p="default",defaultGroupId:u,header:g,footer:f,className:b,renderItemMedia:x,onIntent:y}){let k=ho.useMemo(()=>monkeys.resolveAgentWorkbenchSidebarConfig(o),[o]),w=ho.useMemo(()=>new Set(k.visibleSections),[k.visibleSections]),v=t?.length?t:k.groups,h=u??k.defaultGroupId,[S,T]=ho.useState(h??v[0]?.id??""),C=v.find(D=>D.id===S)??v[0],R=i.trim().toLocaleLowerCase(),M=d&&(!R||r.draftSession.toLocaleLowerCase().includes(R)),I=ho.useMemo(()=>e.filter(D=>!R||D.title.toLocaleLowerCase().includes(R)),[R,e]);ho.useEffect(()=>{v.some(D=>D.id===S)||T(h??v[0]?.id??"");},[S,v,h]);let B=a(D=>{T(D),y?.({type:"change-group",groupId:D});},"changeGroup"),N=w.has("groups")&&C?jsxRuntime.jsx("div",{className:"border-t border-border px-4 pb-4 pt-3",children:jsxRuntime.jsxs(Da,{value:C.id,onValueChange:B,children:[jsxRuntime.jsx(Pa,{className:"grid h-10 w-full rounded-[var(--radius)] bg-muted p-0.5 text-foreground",style:{gridTemplateColumns:`repeat(${v.length}, minmax(0, 1fr))`},children:v.map(D=>jsxRuntime.jsx(jn,{value:D.id,className:"rounded-md text-sm font-semibold text-foreground data-[state=active]:border data-[state=active]:border-border data-[state=active]:bg-background",children:D.label},D.id))}),v.map(D=>jsxRuntime.jsx(cn,{value:D.id,className:"mt-3",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:D.items.map(E=>jsxRuntime.jsx("button",{type:"button","aria-label":E.title,className:"group relative aspect-[1.27] overflow-hidden rounded-[var(--radius)] border border-border bg-card text-left transition hover:border-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",style:Number.isFinite(D.itemAspectRatio)&&Number(D.itemAspectRatio)>0?{aspectRatio:D.itemAspectRatio}:void 0,onClick:()=>y?.({type:"select-item",groupId:D.id,item:E}),children:x?.(E,D)??jsxRuntime.jsx(B0,{item:E})},E.id))})},D.id))]})}):void 0;return jsxRuntime.jsx(Ka,{"data-sidebar-style":"explore","data-sidebar-width-percent":k.widthPercent,"aria-label":r.navigation,variant:p,density:p==="trend"?"compact":void 0,header:w.has("header")?g:void 0,search:w.has("search")?jsxRuntime.jsx(Uu,{value:i,label:r.search,variant:p,onChange:D=>y?.({type:"change-search",query:D})}):void 0,primaryAction:w.has("new-session")?jsxRuntime.jsx(Ku,{label:r.newSession,variant:p,onClick:()=>y?.({type:"create-session"})}):void 0,groups:N,footer:w.has("footer")?f:void 0,bodyProps:{"data-agent-workbench-session-scroll-region":""},className:b,classNames:{body:"min-h-[160px] flex-[0_1_280px]"},children:w.has("sessions")?jsxRuntime.jsxs("div",{className:"space-y-2",children:[M?jsxRuntime.jsx("button",{type:"button","aria-current":"page",className:"block h-10 w-full min-w-0 truncate rounded-[var(--radius)] border border-primary bg-primary/10 px-3 text-left text-sm font-semibold text-foreground",onClick:()=>y?.({type:"create-session"}),children:r.draftSession}):null,I.length>0||!M||s||l?jsxRuntime.jsx(qu,{sessions:I,selectedSessionId:n,status:l?"error":s?"loading":"ready",error:l,query:R,emptyLabel:r.emptySessions,noResultsLabel:r.noResults,retryLabel:r.retry,groupByMode:k.navigationMode!=="default",variant:p,capabilities:{delete:c},onSelect:D=>y?.({type:"select-session",sessionId:D}),onDelete:D=>y?.({type:"delete-session",sessionId:D}),onRetry:r.retry?()=>y?.({type:"retry-sessions"}):void 0}):null]}):null})}a(L0,"AgentWorkbenchExploreSidebar");var K3={reasoning:"reasoning",plan:"plan",task:"tasks",tool:"tools",approval:"approval",artifact:"artifacts",usage:"usage"};function q3(e){let t=e.filter(c=>c.eventType==="status"),o=t.at(-1);if(!o)return;if(o.payload.status!=="stopped"||o.payload.durationMs!==void 0)return o;let r=o.runId?t.filter(c=>c.runId===o.runId&&c.sequence<=o.sequence):t.filter(c=>c.sequence<=o.sequence),n=-1;for(let c=r.length-1;c>=0;c-=1){let p=r[c];if(p.sequence<o.sequence&&p.payload.status==="stopped"){n=c;break}}let i=r.slice(n+1).reverse().find(c=>c.payload.status==="running"||c.payload.status==="queued"),s=i?.payload.startedAt??i?.occurredAt,l=o.payload.stoppedAt??o.occurredAt;if(!s||!l)return o;let d=Date.parse(l)-Date.parse(s);return Number.isFinite(d)&&d>=0?{...o,resolvedDurationMs:d}:o}a(q3,"projectRun");function Y3(e,t){let o=K3[e.eventType];return o?t[o]===true:true}a(Y3,"isVisible");function ns(e,t,o){let r=new Map;for(let n of e){if(n.eventType!==t)continue;let i=n;r.set(o(i),i);}return [...r.values()].sort((n,i)=>n.sequence-i.sequence)}a(ns,"latestBy");function Qu(e){let t=e.events.filter(o=>Y3(o,e.snapshot.capabilities));return {mode:e.snapshot.mode,status:e.status,reasoning:ns(t,"reasoning",o=>o.payload.reasoningId),plans:ns(t,"plan",o=>o.payload.planId),tasks:ns(t,"task",o=>o.payload.taskId),tools:ns(t,"tool",o=>o.payload.toolCallId),approvals:ns(t,"approval",o=>o.payload.approvalId),artifacts:ns(t,"artifact",o=>o.payload.artifactId),usage:[...t].reverse().find(o=>o.eventType==="usage"),run:q3(t)}}a(Qu,"createAgentWorkbenchActivityModel");function J3({value:e}){if(e===void 0)return null;let t=typeof e=="string"?e:JSON.stringify(e,null,2);return jsxRuntime.jsx("pre",{className:"max-h-48 max-w-full overflow-auto overscroll-contain whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground [overflow-wrap:anywhere]",tabIndex:0,children:t})}a(J3,"JsonValue");function W0({approval:e,className:t,onDecision:o}){let r=Ye().agentWorkbench.approval,n=e.status==="requested",i=e.status==="approved";return jsxRuntime.jsx("article",{className:De("min-w-0 overflow-hidden rounded-lg border border-border bg-card p-3 text-card-foreground",t),"data-agent-approval-status":e.status,children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[n?jsxRuntime.jsx(lucideReact.Clock3,{className:"mt-0.5 size-4 shrink-0 text-warning-foreground","aria-hidden":"true"}):i?jsxRuntime.jsx(lucideReact.Check,{className:"mt-0.5 size-4 shrink-0 text-success","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.X,{className:"mt-0.5 size-4 shrink-0 text-destructive-text","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("h3",{className:"break-words text-sm font-medium",children:e.title}),e.description?jsxRuntime.jsx("p",{tabIndex:0,className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]",children:e.description}):null,e.requestedAction!==void 0?jsxRuntime.jsx("div",{className:"mt-3 min-w-0",children:jsxRuntime.jsx(J3,{value:e.requestedAction})}):null,n?jsxRuntime.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[jsxRuntime.jsx(pt,{type:"button",size:"sm",className:"h-auto px-3 py-1.5 text-sm",disabled:!o,onClick:()=>o?.({approvalId:e.approvalId,approved:true}),children:r.approve}),jsxRuntime.jsx(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto px-3 py-1.5 text-sm",disabled:!o,onClick:()=>o?.({approvalId:e.approvalId,approved:false}),children:r.reject})]}):jsxRuntime.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:i?r.approved:r.rejected})]})]})})}a(W0,"AgentWorkbenchApproval");function z0({value:e,className:t}){if(e===void 0)return null;let o=typeof e=="string"?e:JSON.stringify(e,null,2);return jsxRuntime.jsx("pre",{tabIndex:0,className:De("max-h-64 max-w-full overflow-auto overscroll-contain whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground [overflow-wrap:anywhere]",t),children:o})}a(z0,"JsonValue");function s4({status:e}){Ye().agentWorkbench.tool.status;let o="size-3.5 shrink-0";return e==="pending"?jsxRuntime.jsx(lucideReact.Clock3,{className:o,"aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Loader2,{className:De(o,"animate-spin"),"aria-hidden":"true"}):e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:De(o,"text-primary"),"aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.XCircle,{className:De(o,"text-destructive-text"),"aria-hidden":"true"})}a(s4,"ToolStatus");function Zu({event:e,expanded:t,defaultExpanded:o=e.payload.status==="failed",className:r,classNames:n,onExpandedChange:i}){let s=Ye().agentWorkbench.tool,[l,d]=ho.useState(o),c=t!==void 0,p=t??l,u=e.payload.status,g=a(f=>{c||d(f),i?.(f);},"setExpanded");return jsxRuntime.jsxs("details",{open:p,className:De("group min-w-0 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",n?.root,r),"data-tool-status":u,children:[jsxRuntime.jsxs("summary",{className:De("flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",n?.trigger),onClick:f=>{f.preventDefault(),g(!p);},children:[jsxRuntime.jsx(lucideReact.TerminalSquare,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:e.payload.toolName}),jsxRuntime.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-foreground",children:[jsxRuntime.jsx(s4,{status:u}),s.status[u]]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsxs("div",{className:De("min-w-0 space-y-3 border-t border-border px-3 py-3 text-sm",n?.content),children:[e.payload.input!==void 0?jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.input}),jsxRuntime.jsx(z0,{value:e.payload.input,className:n?.input})]}):null,e.payload.output!==void 0?jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.output}),jsxRuntime.jsx(z0,{value:e.payload.output,className:n?.output})]}):null,e.payload.error?jsxRuntime.jsx("p",{tabIndex:0,className:"max-h-32 overflow-auto whitespace-pre-wrap break-words text-sm text-destructive-text [overflow-wrap:anywhere]",role:"alert",children:e.payload.error}):null]})]})}a(Zu,"AgentWorkbenchTool");function y4({artifact:e,label:t,onDownload:o}){let r=ho.useRef(false),[n,i]=ho.useState(false);return jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon","aria-label":t,title:t,disabled:n,className:"text-muted-foreground hover:text-foreground",onClick:async s=>{if(s.preventDefault(),s.stopPropagation(),!r.current){r.current=true,i(true);try{await o(e);}finally{r.current=false,i(false);}}},children:n?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Download,{className:"size-4","aria-hidden":"true"})})}a(y4,"ArtifactDownloadButton");function ub({icon:e,title:t,open:o,streaming:r,className:n,triggerClassName:i,contentClassName:s,children:l}){return jsxRuntime.jsxs("details",{className:De("group min-w-0 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",n),open:o,children:[jsxRuntime.jsxs("summary",{className:De("flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",i),children:[r?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 shrink-0 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(e,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsx("div",{className:De("min-w-0 border-t border-border px-3 py-3 text-sm",s),children:l})]})}a(ub,"ActivityDetails");function O0({status:e}){return e==="completed"||e==="passed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-success","aria-hidden":"true"}):e==="failed"?jsxRuntime.jsx(lucideReact.XCircle,{className:"size-4 text-destructive-text","aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Clock3,{className:"size-4 animate-pulse text-warning-foreground","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Circle,{className:"size-4 text-muted-foreground","aria-hidden":"true"})}a(O0,"StatusIcon");function x4(e){if(e<1e3)return "<1s";let t=Math.floor(e/1e3),o=Math.floor(t/60),r=t%60;return o>0?`${o}m ${r}s`:`${r}s`}a(x4,"formatDuration");function v4({event:e}){let t=Ye().agentWorkbench,o=e.payload.status;return o!=="stopping"&&o!=="stopped"?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",role:"status",children:[o==="stopping"?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.CircleStop,{className:"size-4","aria-hidden":"true"}),jsxRuntime.jsx("span",{children:o==="stopping"?t.run.stopping:t.run.stoppedAfter({duration:x4(e.payload.durationMs??e.resolvedDurationMs??0)})})]})}a(v4,"RunStatus");function F0({viewModel:e,ariaLabel:t,hiddenToolCallIds:o,hideReasoning:r=false,hideStoppedRun:n=false,className:i,classNames:s,onApprovalDecision:l,onArtifactOpen:d,onArtifactDownload:c}){let p=Ye().agentWorkbench;if(!e)return null;let u=Qu(e),g=r?[]:u.reasoning,f=u.tools.filter(v=>!o?.has(v.payload.toolCallId)),b=u.approvals.filter(v=>!v.payload.toolCallId||!o?.has(v.payload.toolCallId)),x=u.usage?.payload,y=typeof x?.contextWindow=="number"&&x.contextWindow>0?x.contextWindow:void 0,k=u.run?.payload.status==="stopping"||u.run?.payload.status==="stopped"&&!n;return g.length>0||u.plans.length>0||u.tasks.length>0||f.length>0||b.length>0||u.artifacts.length>0||k||y!==void 0?jsxRuntime.jsxs("section",{className:De("space-y-3",s?.root,i),"aria-label":t??p.label,"data-agent-workbench-mode":u.mode,"data-agent-workbench-status":u.status,children:[g.map(v=>jsxRuntime.jsx(ub,{icon:lucideReact.Circle,title:p.reasoning,open:v.payload.status==="streaming",streaming:v.payload.status==="streaming",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsx("div",{tabIndex:0,className:"max-h-64 overflow-auto whitespace-pre-wrap break-words text-muted-foreground [overflow-wrap:anywhere]",children:v.payload.text})},v.payload.reasoningId)),u.plans.map(v=>jsxRuntime.jsx(ub,{icon:lucideReact.Circle,title:v.payload.title||p.plan,open:v.payload.status==="running",streaming:v.payload.status==="running",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsx("ol",{className:"space-y-2",children:v.payload.steps.map(h=>jsxRuntime.jsxs("li",{className:"flex min-w-0 items-start gap-2",children:[jsxRuntime.jsx(O0,{status:h.status}),jsxRuntime.jsx("span",{className:"min-w-0 break-words [overflow-wrap:anywhere]",children:h.title})]},h.id))})},v.payload.planId)),u.tasks.map(v=>jsxRuntime.jsx(ub,{icon:lucideReact.Circle,title:v.payload.title,open:v.payload.status==="running",streaming:v.payload.status==="running",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[jsxRuntime.jsx(O0,{status:v.payload.status}),jsxRuntime.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words text-muted-foreground [overflow-wrap:anywhere]",children:v.payload.detail||p.taskNoDetail})]})},v.payload.taskId)),f.map(v=>jsxRuntime.jsx(Zu,{event:v,defaultExpanded:v.payload.status==="failed",classNames:{root:s?.item,trigger:s?.trigger,content:s?.content}},v.payload.toolCallId)),b.map(v=>jsxRuntime.jsx(W0,{approval:v.payload,className:s?.approval,onDecision:l},v.payload.approvalId)),u.artifacts.map(v=>{let h=!!(v.payload.url&&d);return jsxRuntime.jsxs("article",{className:De("flex items-center gap-3 rounded-lg border border-border bg-card p-3 text-card-foreground",s?.artifact),children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-sm font-medium",children:v.payload.name}),jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:p.artifact[v.payload.status]})]}),v.payload.url?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground","aria-label":p.artifact.open({name:v.payload.name}),title:p.artifact.open({name:v.payload.name}),disabled:!h,onClick:S=>{S.preventDefault(),S.stopPropagation(),v.payload.url&&d?.({artifactId:v.payload.artifactId,name:v.payload.name,url:v.payload.url});},children:jsxRuntime.jsx(lucideReact.PanelRightOpen,{className:"size-4","aria-hidden":"true"})}):null,v.payload.url&&v.payload.status==="ready"&&c?jsxRuntime.jsx(y4,{artifact:{artifactId:v.payload.artifactId,name:v.payload.name,url:v.payload.url},label:p.artifactWorkspace.download({name:v.payload.name}),onDownload:c}):null]},v.payload.artifactId)}),k&&u.run?jsxRuntime.jsx(v4,{event:u.run}):null,x&&y!==void 0?jsxRuntime.jsx("div",{className:De("flex justify-end",s?.usage),"aria-label":p.usage.label,children:jsxRuntime.jsx("span",{className:"rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground",children:p.usage.context({used:x.contextTokens??x.totalTokens??0,total:y})})}):null]}):null}a(F0,"AgentWorkbenchActivity");var w4={diff:"diff","workspace-file":"workspaceFiles",terminal:"terminal","test-result":"testResults",artifact:"artifacts"};function ep(e,t,o){let r=new Map;for(let n of e){if(n.eventType!==t)continue;let i=n;r.set(o(i),i);}return [...r.values()].sort((n,i)=>n.sequence-i.sequence)}a(ep,"latestBy");function k4(e){let t=new Map;for(let o of e){let r=t.get(o.payload.terminalId)??{terminalId:o.payload.terminalId,stdin:"",stdout:"",stderr:"",status:"",sequence:o.sequence},n=o.payload.stream;t.set(o.payload.terminalId,{...r,...n==="status"?{status:o.payload.chunk}:{[n]:`${r[n]}${o.payload.chunk}`},...o.payload.exitCode===void 0?{}:{exitCode:o.payload.exitCode},sequence:o.sequence});}return [...t.values()].sort((o,r)=>o.sequence-r.sequence)}a(k4,"projectTerminals");function tp(e){let t=e.snapshot.capabilities,o=e.events.filter(s=>{let l=w4[s.eventType];return l?t[l]===true:false}),r=[...e.events].reverse().find(s=>s.eventType==="status"),n=r?.runId,i=[...e.events].reverse().find(s=>s.eventType==="summary"&&t.summary===true&&(!n||s.runId===n));return {mode:e.snapshot.mode,modelId:e.snapshot.modelId,permissionProfile:e.snapshot.permissionProfile,status:e.status,sessionId:e.sessionId,capabilities:t,resumable:t.resume===true&&e.resumable,summary:i,error:[...e.events].reverse().find(s=>s.eventType==="error"),run:r,usage:t.usage?[...e.events].reverse().find(s=>s.eventType==="usage"):void 0,workspace:{diffs:ep(o,"diff",s=>s.payload.path),files:ep(o,"workspace-file",s=>s.payload.path),terminals:k4(o.filter(s=>s.eventType==="terminal")),tests:ep(o,"test-result",s=>s.payload.testId),artifacts:ep(o,"artifact",s=>s.payload.artifactId)}}}a(tp,"createAgentWorkbenchDetailsModel");function V0(e){if(e===void 0)return "-";let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}a(V0,"formatDuration");function H4(e,t){if(!e)return "-";let o=new Date(e);return Number.isNaN(o.getTime())?"-":new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(o)}a(H4,"formatDate");function _0({value:e}){return jsxRuntime.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold text-foreground",children:e})}a(_0,"Count");function Nl({title:e,count:t,icon:o,className:r,children:n}){return t===0?null:jsxRuntime.jsxs("details",{className:De("group rounded-lg border border-border bg-card text-card-foreground",r),open:true,children:[jsxRuntime.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[jsxRuntime.jsx(o,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:e}),jsxRuntime.jsx(_0,{value:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsx("div",{className:"border-t border-border p-3",children:n})]})}a(Nl,"DetailsSection");function G0({status:e}){return e==="completed"||e==="passed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-primary","aria-hidden":"true"}):e==="failed"?jsxRuntime.jsx(lucideReact.XCircle,{className:"size-4 text-destructive-text","aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Clock3,{className:"size-4 animate-pulse","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Circle,{className:"size-4 text-muted-foreground","aria-hidden":"true"})}a(G0,"StatusIcon");function H0({state:e}){let t=Ye().agentWorkbench.details,o=e==="error";return jsxRuntime.jsxs("div",{className:"flex min-h-48 flex-col items-center justify-center gap-2 px-6 text-center",role:o?"alert":e==="loading"?"status":void 0,"aria-busy":e==="loading"||void 0,children:[e==="loading"?jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-5 animate-spin text-muted-foreground","aria-hidden":"true"}):o?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"size-5 text-destructive-text","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"text-sm font-medium",children:t.state[e].title}),jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:t.state[e].description})]})}a(H0,"StateContent");function V4({model:e,onIntent:t}){let o=Ye().agentWorkbench,r=o.details,n=Co().locale,i=e.summary,s=e.run?.payload,l=e.error,d=e.status==="failed"&&l?.payload.retryable,c=e.resumable&&["stopped","completed","failed"].includes(e.status),p=e.capabilities.threadForking,u=e.capabilities.editAndRerun,g=e.usage?.payload.totalTokens??(e.usage?.payload.inputTokens!==void 0||e.usage?.payload.outputTokens!==void 0?(e.usage.payload.inputTokens??0)+(e.usage.payload.outputTokens??0):void 0);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("section",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(G0,{status:e.status}),jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:r.status[e.status]})]}),jsxRuntime.jsxs("dl",{className:"mt-3 grid grid-cols-2 gap-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.duration}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:V0(s?.durationMs)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.updated}),jsxRuntime.jsx("dd",{className:"mt-0.5 truncate font-medium",children:H4(s?.stoppedAt??s?.completedAt??s?.failedAt,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.model}),jsxRuntime.jsx("dd",{className:"mt-0.5 truncate font-medium",children:e.modelId})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.mode}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:o.modes[e.mode]})]}),e.permissionProfile?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.permissions}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:o.composer.permissionOptions[e.permissionProfile]})]}):null,g!==void 0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.tokenUsage}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:new Intl.NumberFormat(n).format(g)})]}):null]}),l?jsxRuntime.jsx("div",{className:"mt-3 rounded-md border border-destructive/30 bg-destructive/5 p-2.5 text-sm text-destructive-text",role:"alert",children:l.payload.message}):null,d||c?jsxRuntime.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d?jsxRuntime.jsx(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"retry",eventId:l.eventId}),children:r.actions.retry}):null,c?jsxRuntime.jsx(pt,{type:"button",size:"sm",className:"h-auto px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"resume",sessionId:e.sessionId}),children:r.actions.resume}):null]}):null]}),jsxRuntime.jsxs("section",{className:"flex flex-wrap gap-2 rounded-lg border border-border bg-card p-3 text-card-foreground",children:[p?jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"continue-in-new-task",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.GitFork,{className:"size-3.5","aria-hidden":"true"}),r.actions.continueInNewTask]}):null,u?jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"edit-and-rerun",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.PencilLine,{className:"size-3.5","aria-hidden":"true"}),r.actions.editAndRerun]}):null,jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"export",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.Download,{className:"size-3.5","aria-hidden":"true"}),r.actions.export]})]}),jsxRuntime.jsxs("section",{className:"rounded-lg border border-border bg-card p-3 text-card-foreground",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:r.summary}),i?.payload.text?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-foreground","aria-label":r.actions.copySummary,disabled:!t,onClick:()=>t?.({type:"copy-summary",summaryId:i.payload.summaryId,text:i.payload.text}),children:jsxRuntime.jsx(lucideReact.Copy,{className:"size-4","aria-hidden":"true"})}):null]}),i?.payload.status==="failed"?jsxRuntime.jsxs("div",{className:"mt-3 space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-destructive-text",role:"alert",children:r.summaryFailed}),jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"retry-summary",eventId:i.eventId}),children:[jsxRuntime.jsx(lucideReact.RotateCcw,{className:"size-3.5","aria-hidden":"true"}),r.actions.retrySummary]})]}):i?.payload.text?jsxRuntime.jsxs("div",{className:"mt-3 space-y-3 text-sm",children:[jsxRuntime.jsx("p",{className:"whitespace-pre-wrap text-muted-foreground",children:i.payload.text}),i.payload.highlights.length>0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"text-xs font-medium",children:r.highlights}),jsxRuntime.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-muted-foreground",children:i.payload.highlights.map(f=>jsxRuntime.jsx("li",{children:f},f))})]}):null,i.payload.pendingItems.length>0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"text-xs font-medium",children:r.pendingItems}),jsxRuntime.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-muted-foreground",children:i.payload.pendingItems.map(f=>jsxRuntime.jsx("li",{children:f},f))})]}):null]}):jsxRuntime.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:r.summaryEmpty})]})]})}a(V4,"SummaryPanel");function _4({model:e,sectionClassName:t,codeClassName:o}){let r=Ye().agentWorkbench.details.workspace,n=e.workspace;return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Nl,{title:r.diffs,count:n.diffs.length,icon:lucideReact.FileCode2,className:t,children:jsxRuntime.jsx("div",{className:"space-y-3",children:n.diffs.map(i=>jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[jsxRuntime.jsx("span",{className:"truncate font-medium",children:i.payload.path}),jsxRuntime.jsx("span",{className:"shrink-0 text-muted-foreground",children:r.diffStatus[i.payload.status]})]}),i.payload.patch?jsxRuntime.jsx("pre",{className:De("mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:i.payload.patch}):null]},i.payload.path))})}),jsxRuntime.jsx(Nl,{title:r.files,count:n.files.length,icon:lucideReact.Files,className:t,children:jsxRuntime.jsx("ul",{className:"space-y-2 text-xs",children:n.files.map(i=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-3.5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.payload.path}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r.fileOperation[i.payload.operation]})]},i.payload.path))})}),jsxRuntime.jsx(Nl,{title:r.terminals,count:n.terminals.length,icon:lucideReact.TerminalSquare,className:t,children:jsxRuntime.jsx("div",{className:"space-y-3",children:n.terminals.map(i=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between gap-2 text-xs font-medium",children:[jsxRuntime.jsx("span",{children:i.terminalId}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i.exitCode===void 0?i.status:r.exitCode({code:i.exitCode})})]}),jsxRuntime.jsx("pre",{className:De("mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:[i.stdin,i.stdout,i.stderr].filter(Boolean).join(`
|
|
65
|
+
var zS=Object.defineProperty;var a=(e,t)=>zS(e,"name",{value:t,configurable:true});var Br=a((e,t=0,o=1)=>oi(ri(t,e),o),"default");var Sa=a(e=>{e._clipped=false,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=true),e[t]=Br(e[t],0,255)):t===3&&(e[t]=Br(e[t],0,1));return e},"default");var rg={};for(let e of ["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])rg[`[object ${e}]`]=e.toLowerCase();function Qe(e){return rg[Object.prototype.toString.call(e)]||"object"}a(Qe,"default");var Ue=a((e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Qe(e[0])=="object"&&t?t.split("").filter(o=>e[0][o]!==void 0).map(o=>e[0][o]):e[0],"default");var tn=a(e=>{if(e.length<2)return null;let t=e.length-1;return Qe(e[t])=="string"?e[t].toLowerCase():null},"default");var{PI:Kl,min:oi,max:ri}=Math,er=Kl*2,ql=Kl/3,ng=Kl/180,ag=180/Kl;var Ze={format:{},autodetect:[]};var Mp=class Mp{constructor(...t){let o=this;if(Qe(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=tn(t),n=false;if(!r){n=true,Ze.sorted||(Ze.autodetect=Ze.autodetect.sort((i,s)=>s.p-i.p),Ze.sorted=true);for(let i of Ze.autodetect)if(r=i.test(...t),r)break}if(Ze.format[r]){let i=Ze.format[r].apply(null,n?t:t.slice(0,-1));o._rgb=Sa(i);}else throw new Error("unknown format: "+t);o._rgb.length===3&&o._rgb.push(1);}toString(){return Qe(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};a(Mp,"Color");var Rp=Mp,ye=Rp;var ig="2.6.0";var Yl=a((...e)=>new Yl.Color(...e),"chroma");Yl.Color=ye;Yl.version=ig;var ot=Yl;var OS=a((...e)=>{e=Ue(e,"cmyk");let[t,o,r,n]=e,i=e.length>4?e[4]:1;return n===1?[0,0,0,i]:[t>=1?0:255*(1-t)*(1-n),o>=1?0:255*(1-o)*(1-n),r>=1?0:255*(1-r)*(1-n),i]},"cmyk2rgb"),sg=OS;var{max:lg}=Math,FS=a((...e)=>{let[t,o,r]=Ue(e,"rgb");t=t/255,o=o/255,r=r/255;let n=1-lg(t,lg(o,r)),i=n<1?1/(1-n):0,s=(1-t-n)*i,l=(1-o-n)*i,d=(1-r-n)*i;return [s,l,d,n]},"rgb2cmyk"),dg=FS;ye.prototype.cmyk=function(){return dg(this._rgb)};ot.cmyk=(...e)=>new ye(...e,"cmyk");Ze.format.cmyk=sg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"cmyk"),Qe(e)==="array"&&e.length===4)return "cmyk"},"test")});var Ip=a(e=>Math.round(e*100)/100,"rnd"),HS=a((...e)=>{let t=Ue(e,"hsla"),o=tn(e)||"lsa";return t[0]=Ip(t[0]||0),t[1]=Ip(t[1]*100)+"%",t[2]=Ip(t[2]*100)+"%",o==="hsla"||t.length>3&&t[3]<1?(t[3]=t.length>3?t[3]:1,o="hsla"):t.length=3,`${o}(${t.join(",")})`},"hsl2css"),cg=HS;var VS=a((...e)=>{e=Ue(e,"rgba");let[t,o,r]=e;t/=255,o/=255,r/=255;let n=oi(t,o,r),i=ri(t,o,r),s=(i+n)/2,l,d;return i===n?(l=0,d=Number.NaN):l=s<.5?(i-n)/(i+n):(i-n)/(2-i-n),t==i?d=(o-r)/(i-n):o==i?d=2+(r-t)/(i-n):r==i&&(d=4+(t-o)/(i-n)),d*=60,d<0&&(d+=360),e.length>3&&e[3]!==void 0?[d,l,s,e[3]]:[d,l,s]},"rgb2hsl"),Xl=VS;var{round:Dp}=Math,_S=a((...e)=>{let t=Ue(e,"rgba"),o=tn(e)||"rgb";return o.substr(0,3)=="hsl"?cg(Xl(t),o):(t[0]=Dp(t[0]),t[1]=Dp(t[1]),t[2]=Dp(t[2]),(o==="rgba"||t.length>3&&t[3]<1)&&(t[3]=t.length>3?t[3]:1,o="rgba"),`${o}(${t.slice(0,o==="rgb"?3:4).join(",")})`)},"rgb2css"),ug=_S;var{round:Pp}=Math,GS=a((...e)=>{e=Ue(e,"hsl");let[t,o,r]=e,n,i,s;if(o===0)n=i=s=r*255;else {let l=[0,0,0],d=[0,0,0],c=r<.5?r*(1+o):r+o-r*o,p=2*r-c,u=t/360;l[0]=u+1/3,l[1]=u,l[2]=u-1/3;for(let g=0;g<3;g++)l[g]<0&&(l[g]+=1),l[g]>1&&(l[g]-=1),6*l[g]<1?d[g]=p+(c-p)*6*l[g]:2*l[g]<1?d[g]=c:3*l[g]<2?d[g]=p+(c-p)*(2/3-l[g])*6:d[g]=p;[n,i,s]=[Pp(d[0]*255),Pp(d[1]*255),Pp(d[2]*255)];}return e.length>3?[n,i,s,e[3]]:[n,i,s,1]},"hsl2rgb"),hs=GS;var mg=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,fg=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,bg=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,gg=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,hg=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,yg=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,{round:pg}=Math,xg=a(e=>{e=e.toLowerCase().trim();let t;if(Ze.format.named)try{return Ze.format.named(e)}catch{}if(t=e.match(mg)){let o=t.slice(1,4);for(let r=0;r<3;r++)o[r]=+o[r];return o[3]=1,o}if(t=e.match(fg)){let o=t.slice(1,5);for(let r=0;r<4;r++)o[r]=+o[r];return o}if(t=e.match(bg)){let o=t.slice(1,4);for(let r=0;r<3;r++)o[r]=pg(o[r]*2.55);return o[3]=1,o}if(t=e.match(gg)){let o=t.slice(1,5);for(let r=0;r<3;r++)o[r]=pg(o[r]*2.55);return o[3]=+o[3],o}if(t=e.match(hg)){let o=t.slice(1,4);o[1]*=.01,o[2]*=.01;let r=hs(o);return r[3]=1,r}if(t=e.match(yg)){let o=t.slice(1,4);o[1]*=.01,o[2]*=.01;let r=hs(o);return r[3]=+t[4],r}},"css2rgb");xg.test=e=>mg.test(e)||fg.test(e)||bg.test(e)||gg.test(e)||hg.test(e)||yg.test(e);var Ep=xg;ye.prototype.css=function(e){return ug(this._rgb,e)};ot.css=(...e)=>new ye(...e,"css");Ze.format.css=Ep;Ze.autodetect.push({p:5,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&Ep.test(e))return "css"},"test")});Ze.format.gl=(...e)=>{let t=Ue(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};ot.gl=(...e)=>new ye(...e,"gl");ye.prototype.gl=function(){let e=this._rgb;return [e[0]/255,e[1]/255,e[2]/255,e[3]]};var{floor:$S}=Math,jS=a((...e)=>{e=Ue(e,"hcg");let[t,o,r]=e,n,i,s;r=r*255;let l=o*255;if(o===0)n=i=s=r;else {t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let d=$S(t),c=t-d,p=r*(1-o),u=p+l*(1-c),g=p+l*c,f=p+l;switch(d){case 0:[n,i,s]=[f,g,p];break;case 1:[n,i,s]=[u,f,p];break;case 2:[n,i,s]=[p,f,g];break;case 3:[n,i,s]=[p,u,f];break;case 4:[n,i,s]=[g,p,f];break;case 5:[n,i,s]=[f,p,u];break}}return [n,i,s,e.length>3?e[3]:1]},"hcg2rgb"),vg=jS;var US=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),n=oi(t,o,r),i=ri(t,o,r),s=i-n,l=s*100/255,d=n/(255-s)*100,c;return s===0?c=Number.NaN:(t===i&&(c=(o-r)/s),o===i&&(c=2+(r-t)/s),r===i&&(c=4+(t-o)/s),c*=60,c<0&&(c+=360)),[c,l,d]},"rgb2hcg"),wg=US;ye.prototype.hcg=function(){return wg(this._rgb)};ot.hcg=(...e)=>new ye(...e,"hcg");Ze.format.hcg=vg;Ze.autodetect.push({p:1,test:a((...e)=>{if(e=Ue(e,"hcg"),Qe(e)==="array"&&e.length===3)return "hcg"},"test")});var KS=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,qS=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,YS=a(e=>{if(e.match(KS)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16),o=t>>16,r=t>>8&255,n=t&255;return [o,r,n,1]}if(e.match(qS)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16),o=t>>24&255,r=t>>16&255,n=t>>8&255,i=Math.round((t&255)/255*100)/100;return [o,r,n,i]}throw new Error(`unknown hex color: ${e}`)},"hex2rgb"),Ql=YS;var{round:Zl}=Math,XS=a((...e)=>{let[t,o,r,n]=Ue(e,"rgba"),i=tn(e)||"auto";n===void 0&&(n=1),i==="auto"&&(i=n<1?"rgba":"rgb"),t=Zl(t),o=Zl(o),r=Zl(r);let l="000000"+(t<<16|o<<8|r).toString(16);l=l.substr(l.length-6);let d="0"+Zl(n*255).toString(16);switch(d=d.substr(d.length-2),i.toLowerCase()){case "rgba":return `#${l}${d}`;case "argb":return `#${d}${l}`;default:return `#${l}`}},"rgb2hex"),Jl=XS;ye.prototype.hex=function(e){return Jl(this._rgb,e)};ot.hex=(...e)=>new ye(...e,"hex");Ze.format.hex=Ql;Ze.autodetect.push({p:4,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return "hex"},"test")});var{cos:ni}=Math,QS=a((...e)=>{e=Ue(e,"hsi");let[t,o,r]=e,n,i,s;return isNaN(t)&&(t=0),isNaN(o)&&(o=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(s=(1-o)/3,n=(1+o*ni(er*t)/ni(ql-er*t))/3,i=1-(s+n)):t<2/3?(t-=1/3,n=(1-o)/3,i=(1+o*ni(er*t)/ni(ql-er*t))/3,s=1-(n+i)):(t-=2/3,i=(1-o)/3,s=(1+o*ni(er*t)/ni(ql-er*t))/3,n=1-(i+s)),n=Br(r*n*3),i=Br(r*i*3),s=Br(r*s*3),[n*255,i*255,s*255,e.length>3?e[3]:1]},"hsi2rgb"),kg=QS;var{min:ZS,sqrt:JS,acos:e1}=Math,t1=a((...e)=>{let[t,o,r]=Ue(e,"rgb");t/=255,o/=255,r/=255;let n,i=ZS(t,o,r),s=(t+o+r)/3,l=s>0?1-i/s:0;return l===0?n=NaN:(n=(t-o+(t-r))/2,n/=JS((t-o)*(t-o)+(t-r)*(o-r)),n=e1(n),r>o&&(n=er-n),n/=er),[n*360,l,s]},"rgb2hsi"),Cg=t1;ye.prototype.hsi=function(){return Cg(this._rgb)};ot.hsi=(...e)=>new ye(...e,"hsi");Ze.format.hsi=kg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsi"),Qe(e)==="array"&&e.length===3)return "hsi"},"test")});ye.prototype.hsl=function(){return Xl(this._rgb)};ot.hsl=(...e)=>new ye(...e,"hsl");Ze.format.hsl=hs;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsl"),Qe(e)==="array"&&e.length===3)return "hsl"},"test")});var{floor:o1}=Math,r1=a((...e)=>{e=Ue(e,"hsv");let[t,o,r]=e,n,i,s;if(r*=255,o===0)n=i=s=r;else {t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let l=o1(t),d=t-l,c=r*(1-o),p=r*(1-o*d),u=r*(1-o*(1-d));switch(l){case 0:[n,i,s]=[r,u,c];break;case 1:[n,i,s]=[p,r,c];break;case 2:[n,i,s]=[c,r,u];break;case 3:[n,i,s]=[c,p,r];break;case 4:[n,i,s]=[u,c,r];break;case 5:[n,i,s]=[r,c,p];break}}return [n,i,s,e.length>3?e[3]:1]},"hsv2rgb"),Sg=r1;var{min:n1,max:a1}=Math,i1=a((...e)=>{e=Ue(e,"rgb");let[t,o,r]=e,n=n1(t,o,r),i=a1(t,o,r),s=i-n,l,d,c;return c=i/255,i===0?(l=Number.NaN,d=0):(d=s/i,t===i&&(l=(o-r)/s),o===i&&(l=2+(r-t)/s),r===i&&(l=4+(t-o)/s),l*=60,l<0&&(l+=360)),[l,d,c]},"rgb2hsl"),Tg=i1;ye.prototype.hsv=function(){return Tg(this._rgb)};ot.hsv=(...e)=>new ye(...e,"hsv");Ze.format.hsv=Sg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsv"),Qe(e)==="array"&&e.length===3)return "hsv"},"test")});var ao={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452};var{pow:s1}=Math,l1=a((...e)=>{e=Ue(e,"lab");let[t,o,r]=e,n,i,s,l,d,c;return i=(t+16)/116,n=isNaN(o)?i:i+o/500,s=isNaN(r)?i:i-r/200,i=ao.Yn*Bp(i),n=ao.Xn*Bp(n),s=ao.Zn*Bp(s),l=Ap(3.2404542*n-1.5371385*i-.4985314*s),d=Ap(-0.969266*n+1.8760108*i+.041556*s),c=Ap(.0556434*n-.2040259*i+1.0572252*s),[l,d,c,e.length>3?e[3]:1]},"lab2rgb"),Ap=a(e=>255*(e<=.00304?12.92*e:1.055*s1(e,1/2.4)-.055),"xyz_rgb"),Bp=a(e=>e>ao.t1?e*e*e:ao.t2*(e-ao.t0),"lab_xyz"),ed=l1;var{pow:Ng}=Math,d1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=c1(t,o,r),l=116*i-16;return [l<0?0:l,500*(n-i),200*(i-s)]},"rgb2lab"),Lp=a(e=>(e/=255)<=.04045?e/12.92:Ng((e+.055)/1.055,2.4),"rgb_xyz"),Wp=a(e=>e>ao.t3?Ng(e,1/3):e/ao.t2+ao.t0,"xyz_lab"),c1=a((e,t,o)=>{e=Lp(e),t=Lp(t),o=Lp(o);let r=Wp((.4124564*e+.3575761*t+.1804375*o)/ao.Xn),n=Wp((.2126729*e+.7151522*t+.072175*o)/ao.Yn),i=Wp((.0193339*e+.119192*t+.9503041*o)/ao.Zn);return [r,n,i]},"rgb2xyz"),td=d1;ye.prototype.lab=function(){return td(this._rgb)};ot.lab=(...e)=>new ye(...e,"lab");Ze.format.lab=ed;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"lab"),Qe(e)==="array"&&e.length===3)return "lab"},"test")});var{sin:u1,cos:p1}=Math,m1=a((...e)=>{let[t,o,r]=Ue(e,"lch");return isNaN(r)&&(r=0),r=r*ng,[t,p1(r)*o,u1(r)*o]},"lch2lab"),od=m1;var f1=a((...e)=>{e=Ue(e,"lch");let[t,o,r]=e,[n,i,s]=od(t,o,r),[l,d,c]=ed(n,i,s);return [l,d,c,e.length>3?e[3]:1]},"lch2rgb"),rd=f1;var b1=a((...e)=>{let t=Ue(e,"hcl").reverse();return rd(...t)},"hcl2rgb"),Rg=b1;var{sqrt:g1,atan2:h1,round:y1}=Math,x1=a((...e)=>{let[t,o,r]=Ue(e,"lab"),n=g1(o*o+r*r),i=(h1(r,o)*ag+360)%360;return y1(n*1e4)===0&&(i=Number.NaN),[t,n,i]},"lab2lch"),nd=x1;var v1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=td(t,o,r);return nd(n,i,s)},"rgb2lch"),zp=v1;ye.prototype.lch=function(){return zp(this._rgb)};ye.prototype.hcl=function(){return zp(this._rgb).reverse()};ot.lch=(...e)=>new ye(...e,"lch");ot.hcl=(...e)=>new ye(...e,"hcl");Ze.format.lch=rd;Ze.format.hcl=Rg;["lch","hcl"].forEach(e=>Ze.autodetect.push({p:2,test:a((...t)=>{if(t=Ue(t,e),Qe(t)==="array"&&t.length===3)return e},"test")}));var w1={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},En=w1;ye.prototype.name=function(){let e=Jl(this._rgb,"rgb");for(let t of Object.keys(En))if(En[t]===e)return t.toLowerCase();return e};Ze.format.named=e=>{if(e=e.toLowerCase(),En[e])return Ql(En[e]);throw new Error("unknown color name: "+e)};Ze.autodetect.push({p:5,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&En[e.toLowerCase()])return "named"},"test")});var k1=a(e=>{if(Qe(e)=="number"&&e>=0&&e<=16777215){let t=e>>16,o=e>>8&255,r=e&255;return [t,o,r,1]}throw new Error("unknown num color: "+e)},"num2rgb"),Mg=k1;var C1=a((...e)=>{let[t,o,r]=Ue(e,"rgb");return (t<<16)+(o<<8)+r},"rgb2num"),Ig=C1;ye.prototype.num=function(){return Ig(this._rgb)};ot.num=(...e)=>new ye(...e,"num");Ze.format.num=Mg;Ze.autodetect.push({p:5,test:a((...e)=>{if(e.length===1&&Qe(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return "num"},"test")});var{round:Dg}=Math;ye.prototype.rgb=function(e=true){return e===false?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Dg)};ye.prototype.rgba=function(e=true){return this._rgb.slice(0,4).map((t,o)=>o<3?e===false?t:Dg(t):t)};ot.rgb=(...e)=>new ye(...e,"rgb");Ze.format.rgb=(...e)=>{let t=Ue(e,"rgba");return t[3]===void 0&&(t[3]=1),t};Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"rgba"),Qe(e)==="array"&&(e.length===3||e.length===4&&Qe(e[3])=="number"&&e[3]>=0&&e[3]<=1))return "rgb"},"test")});var{log:ad}=Math,S1=a(e=>{let t=e/100,o,r,n;return t<66?(o=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*ad(r),n=t<20?0:-254.76935184120902+.8274096064007395*(n=t-10)+115.67994401066147*ad(n)):(o=351.97690566805693+.114206453784165*(o=t-55)-40.25366309332127*ad(o),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*ad(r),n=255),[o,r,n,1]},"temperature2rgb"),id=S1;var{round:T1}=Math,N1=a((...e)=>{let t=Ue(e,"rgb"),o=t[0],r=t[2],n=1e3,i=4e4,s=.4,l;for(;i-n>s;){l=(i+n)*.5;let d=id(l);d[2]/d[0]>=r/o?i=l:n=l;}return T1(l)},"rgb2temperature"),Pg=N1;ye.prototype.temp=ye.prototype.kelvin=ye.prototype.temperature=function(){return Pg(this._rgb)};ot.temp=ot.kelvin=ot.temperature=(...e)=>new ye(...e,"temp");Ze.format.temp=Ze.format.kelvin=Ze.format.temperature=id;var{pow:sd,sign:R1}=Math,M1=a((...e)=>{e=Ue(e,"lab");let[t,o,r]=e,n=sd(t+.3963377774*o+.2158037573*r,3),i=sd(t-.1055613458*o-.0638541728*r,3),s=sd(t-.0894841775*o-1.291485548*r,3);return [255*Op(4.0767416621*n-3.3077115913*i+.2309699292*s),255*Op(-1.2684380046*n+2.6097574011*i-.3413193965*s),255*Op(-0.0041960863*n-.7034186147*i+1.707614701*s),e.length>3?e[3]:1]},"oklab2rgb"),ld=M1;function Op(e){let t=Math.abs(e);return t>.0031308?(R1(e)||1)*(1.055*sd(t,1/2.4)-.055):e*12.92}a(Op,"lrgb2rgb");var{cbrt:Fp,pow:I1,sign:D1}=Math,P1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=[Hp(t/255),Hp(o/255),Hp(r/255)],l=Fp(.4122214708*n+.5363325363*i+.0514459929*s),d=Fp(.2119034982*n+.6806995451*i+.1073969566*s),c=Fp(.0883024619*n+.2817188376*i+.6299787005*s);return [.2104542553*l+.793617785*d-.0040720468*c,1.9779984951*l-2.428592205*d+.4505937099*c,.0259040371*l+.7827717662*d-.808675766*c]},"rgb2oklab"),dd=P1;function Hp(e){let t=Math.abs(e);return t<.04045?e/12.92:(D1(e)||1)*I1((t+.055)/1.055,2.4)}a(Hp,"rgb2lrgb");ye.prototype.oklab=function(){return dd(this._rgb)};ot.oklab=(...e)=>new ye(...e,"oklab");Ze.format.oklab=ld;Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"oklab"),Qe(e)==="array"&&e.length===3)return "oklab"},"test")});var E1=a((...e)=>{e=Ue(e,"lch");let[t,o,r]=e,[n,i,s]=od(t,o,r),[l,d,c]=ld(n,i,s);return [l,d,c,e.length>3?e[3]:1]},"oklch2rgb"),Eg=E1;var A1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=dd(t,o,r);return nd(n,i,s)},"rgb2oklch"),Ag=A1;ye.prototype.oklch=function(){return Ag(this._rgb)};ot.oklch=(...e)=>new ye(...e,"oklch");Ze.format.oklch=Eg;Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"oklch"),Qe(e)==="array"&&e.length===3)return "oklch"},"test")});ye.prototype.alpha=function(e,t=false){return e!==void 0&&Qe(e)==="number"?t?(this._rgb[3]=e,this):new ye([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};ye.prototype.clipped=function(){return this._rgb._clipped||false};ye.prototype.darken=function(e=1){let t=this,o=t.lab();return o[0]-=ao.Kn*e,new ye(o,"lab").alpha(t.alpha(),true)};ye.prototype.brighten=function(e=1){return this.darken(-e)};ye.prototype.darker=ye.prototype.darken;ye.prototype.brighter=ye.prototype.brighten;ye.prototype.get=function(e){let[t,o]=e.split("."),r=this[t]();if(o){let n=t.indexOf(o)-(t.substr(0,2)==="ok"?2:0);if(n>-1)return r[n];throw new Error(`unknown channel ${o} in mode ${t}`)}else return r};var{pow:B1}=Math,L1=1e-7,W1=20;ye.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&Qe(e)==="number"){if(e===0)return new ye([0,0,0,this._rgb[3]],"rgb");if(e===1)return new ye([255,255,255,this._rgb[3]],"rgb");let o=this.luminance(),r=W1,n=a((s,l)=>{let d=s.interpolate(l,.5,t),c=d.luminance();return Math.abs(e-c)<L1||!r--?d:c>e?n(s,d):n(d,l)},"test"),i=(o>e?n(new ye([0,0,0]),this):n(this,new ye([255,255,255]))).rgb();return new ye([...i,this._rgb[3]])}return z1(...this._rgb.slice(0,3))};var z1=a((e,t,o)=>(e=Vp(e),t=Vp(t),o=Vp(o),.2126*e+.7152*t+.0722*o),"rgb2luminance"),Vp=a(e=>(e/=255,e<=.03928?e/12.92:B1((e+.055)/1.055,2.4)),"luminance_x");var Pt={};var An=a((e,t,o=.5,...r)=>{let n=r[0]||"lrgb";if(!Pt[n]&&!r.length&&(n=Object.keys(Pt)[0]),!Pt[n])throw new Error(`interpolation mode ${n} is not defined`);return Qe(e)!=="object"&&(e=new ye(e)),Qe(t)!=="object"&&(t=new ye(t)),Pt[n](e,t,o).alpha(e.alpha()+o*(t.alpha()-e.alpha()))},"default");ye.prototype.mix=ye.prototype.interpolate=function(e,t=.5,...o){return An(this,e,t,...o)};ye.prototype.premultiply=function(e=false){let t=this._rgb,o=t[3];return e?(this._rgb=[t[0]*o,t[1]*o,t[2]*o,o],this):new ye([t[0]*o,t[1]*o,t[2]*o,o],"rgb")};ye.prototype.saturate=function(e=1){let t=this,o=t.lch();return o[1]+=ao.Kn*e,o[1]<0&&(o[1]=0),new ye(o,"lch").alpha(t.alpha(),true)};ye.prototype.desaturate=function(e=1){return this.saturate(-e)};ye.prototype.set=function(e,t,o=false){let[r,n]=e.split("."),i=this[r]();if(n){let s=r.indexOf(n)-(r.substr(0,2)==="ok"?2:0);if(s>-1){if(Qe(t)=="string")switch(t.charAt(0)){case "+":i[s]+=+t;break;case "-":i[s]+=+t;break;case "*":i[s]*=+t.substr(1);break;case "/":i[s]/=+t.substr(1);break;default:i[s]=+t;}else if(Qe(t)==="number")i[s]=t;else throw new Error("unsupported value for Color.set");let l=new ye(i,r);return o?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${n} in mode ${r}`)}else return i};ye.prototype.tint=function(e=.5,...t){return An(this,"white",e,...t)};ye.prototype.shade=function(e=.5,...t){return An(this,"black",e,...t)};var O1=a((e,t,o)=>{let r=e._rgb,n=t._rgb;return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"rgb")},"rgb");Pt.rgb=O1;var{sqrt:_p,pow:ai}=Math,F1=a((e,t,o)=>{let[r,n,i]=e._rgb,[s,l,d]=t._rgb;return new ye(_p(ai(r,2)*(1-o)+ai(s,2)*o),_p(ai(n,2)*(1-o)+ai(l,2)*o),_p(ai(i,2)*(1-o)+ai(d,2)*o),"rgb")},"lrgb");Pt.lrgb=F1;var H1=a((e,t,o)=>{let r=e.lab(),n=t.lab();return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"lab")},"lab");Pt.lab=H1;var tr=a((e,t,o,r)=>{let n,i;r==="hsl"?(n=e.hsl(),i=t.hsl()):r==="hsv"?(n=e.hsv(),i=t.hsv()):r==="hcg"?(n=e.hcg(),i=t.hcg()):r==="hsi"?(n=e.hsi(),i=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",n=e.hcl(),i=t.hcl()):r==="oklch"&&(n=e.oklch().reverse(),i=t.oklch().reverse());let s,l,d,c,p,u;(r.substr(0,1)==="h"||r==="oklch")&&([s,d,p]=n,[l,c,u]=i);let g,f,b,x;return !isNaN(s)&&!isNaN(l)?(l>s&&l-s>180?x=l-(s+360):l<s&&s-l>180?x=l+360-s:x=l-s,f=s+o*x):isNaN(s)?isNaN(l)?f=Number.NaN:(f=l,(p==1||p==0)&&r!="hsv"&&(g=c)):(f=s,(u==1||u==0)&&r!="hsv"&&(g=d)),g===void 0&&(g=d+o*(c-d)),b=p+o*(u-p),r==="oklch"?new ye([b,g,f],r):new ye([f,g,b],r)},"default");var Bg=a((e,t,o)=>tr(e,t,o,"lch"),"lch");Pt.lch=Bg;Pt.hcl=Bg;var V1=a((e,t,o)=>{let r=e.num(),n=t.num();return new ye(r+o*(n-r),"num")},"num");Pt.num=V1;var _1=a((e,t,o)=>tr(e,t,o,"hcg"),"hcg");Pt.hcg=_1;var G1=a((e,t,o)=>tr(e,t,o,"hsi"),"hsi");Pt.hsi=G1;var $1=a((e,t,o)=>tr(e,t,o,"hsl"),"hsl");Pt.hsl=$1;var j1=a((e,t,o)=>tr(e,t,o,"hsv"),"hsv");Pt.hsv=j1;var U1=a((e,t,o)=>{let r=e.oklab(),n=t.oklab();return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"oklab")},"oklab");Pt.oklab=U1;var K1=a((e,t,o)=>tr(e,t,o,"oklch"),"oklch");Pt.oklch=K1;var{pow:Gp,sqrt:$p,PI:jp,cos:Lg,sin:Wg,atan2:q1}=Math,zg=a((e,t="lrgb",o=null)=>{let r=e.length;o||(o=Array.from(new Array(r)).map(()=>1));let n=r/o.reduce(function(u,g){return u+g});if(o.forEach((u,g)=>{o[g]*=n;}),e=e.map(u=>new ye(u)),t==="lrgb")return Y1(e,o);let i=e.shift(),s=i.get(t),l=[],d=0,c=0;for(let u=0;u<s.length;u++)if(s[u]=(s[u]||0)*o[0],l.push(isNaN(s[u])?0:o[0]),t.charAt(u)==="h"&&!isNaN(s[u])){let g=s[u]/180*jp;d+=Lg(g)*o[0],c+=Wg(g)*o[0];}let p=i.alpha()*o[0];e.forEach((u,g)=>{let f=u.get(t);p+=u.alpha()*o[g+1];for(let b=0;b<s.length;b++)if(!isNaN(f[b]))if(l[b]+=o[g+1],t.charAt(b)==="h"){let x=f[b]/180*jp;d+=Lg(x)*o[g+1],c+=Wg(x)*o[g+1];}else s[b]+=f[b]*o[g+1];});for(let u=0;u<s.length;u++)if(t.charAt(u)==="h"){let g=q1(c/l[u],d/l[u])/jp*180;for(;g<0;)g+=360;for(;g>=360;)g-=360;s[u]=g;}else s[u]=s[u]/l[u];return p/=r,new ye(s,t).alpha(p>.99999?1:p,true)},"default"),Y1=a((e,t)=>{let o=e.length,r=[0,0,0,0];for(let n=0;n<e.length;n++){let i=e[n],s=t[n]/o,l=i._rgb;r[0]+=Gp(l[0],2)*s,r[1]+=Gp(l[1],2)*s,r[2]+=Gp(l[2],2)*s,r[3]+=l[3]*s;}return r[0]=$p(r[0]),r[1]=$p(r[1]),r[2]=$p(r[2]),r[3]>.9999999&&(r[3]=1),new ye(Sa(r))},"_average_lrgb");var{pow:X1}=Math;function Bn(e){let t="rgb",o=ot("#ccc"),r=0,n=[0,1],i=[],s=[0,0],l=false,d=[],c=false,p=0,u=1,g=false,f={},b=true,x=1,y=a(function(C){if(C=C||["#fff","#000"],C&&Qe(C)==="string"&&ot.brewer&&ot.brewer[C.toLowerCase()]&&(C=ot.brewer[C.toLowerCase()]),Qe(C)==="array"){C.length===1&&(C=[C[0],C[0]]),C=C.slice(0);for(let R=0;R<C.length;R++)C[R]=ot(C[R]);i.length=0;for(let R=0;R<C.length;R++)i.push(R/(C.length-1));}return S(),d=C},"setColors"),k=a(function(C){if(l!=null){let R=l.length-1,M=0;for(;M<R&&C>=l[M];)M++;return M-1}return 0},"getClass"),w=a(C=>C,"tMapLightness"),v=a(C=>C,"tMapDomain"),h=a(function(C,R){let M,I;if(R==null&&(R=false),isNaN(C)||C===null)return o;R?I=C:l&&l.length>2?I=k(C)/(l.length-2):u!==p?I=(C-p)/(u-p):I=1,I=v(I),R||(I=w(I)),x!==1&&(I=X1(I,x)),I=s[0]+I*(1-s[0]-s[1]),I=Br(I,0,1);let B=Math.floor(I*1e4);if(b&&f[B])M=f[B];else {if(Qe(d)==="array")for(let N=0;N<i.length;N++){let D=i[N];if(I<=D){M=d[N];break}if(I>=D&&N===i.length-1){M=d[N];break}if(I>D&&I<i[N+1]){I=(I-D)/(i[N+1]-D),M=ot.interpolate(d[N],d[N+1],I,t);break}}else Qe(d)==="function"&&(M=d(I));b&&(f[B]=M);}return M},"getColor");var S=a(()=>f={},"resetCache");y(e);let T=a(function(C){let R=ot(h(C));return c&&R[c]?R[c]():R},"f");return T.classes=function(C){if(C!=null){if(Qe(C)==="array")l=C,n=[C[0],C[C.length-1]];else {let R=ot.analyze(n);C===0?l=[R.min,R.max]:l=ot.limits(R,"e",C);}return T}return l},T.domain=function(C){if(!arguments.length)return n;p=C[0],u=C[C.length-1],i=[];let R=d.length;if(C.length===R&&p!==u)for(let M of Array.from(C))i.push((M-p)/(u-p));else {for(let M=0;M<R;M++)i.push(M/(R-1));if(C.length>2){let M=C.map((B,N)=>N/(C.length-1)),I=C.map(B=>(B-p)/(u-p));I.every((B,N)=>M[N]===B)||(v=a(B=>{if(B<=0||B>=1)return B;let N=0;for(;B>=I[N+1];)N++;let D=(B-I[N])/(I[N+1]-I[N]);return M[N]+D*(M[N+1]-M[N])},"tMapDomain"));}}return n=[p,u],T},T.mode=function(C){return arguments.length?(t=C,S(),T):t},T.range=function(C,R){return y(C,R),T},T.out=function(C){return c=C,T},T.spread=function(C){return arguments.length?(r=C,T):r},T.correctLightness=function(C){return C==null&&(C=true),g=C,S(),g?w=a(function(R){let M=h(0,true).lab()[0],I=h(1,true).lab()[0],B=M>I,N=h(R,true).lab()[0],D=M+(I-M)*R,E=N-D,P=0,W=1,H=20;for(;Math.abs(E)>.01&&H-- >0;)(function(){return B&&(E*=-1),E<0?(P=R,R+=(W-R)*.5):(W=R,R+=(P-R)*.5),N=h(R,true).lab()[0],E=N-D})();return R},"tMapLightness"):w=a(R=>R,"tMapLightness"),T},T.padding=function(C){return C!=null?(Qe(C)==="number"&&(C=[C,C]),s=C,T):s},T.colors=function(C,R){arguments.length<2&&(R="hex");let M=[];if(arguments.length===0)M=d.slice(0);else if(C===1)M=[T(.5)];else if(C>1){let I=n[0],B=n[1]-I;M=Q1(0,C,false).map(N=>T(I+N/(C-1)*B));}else {e=[];let I=[];if(l&&l.length>2)for(let B=1,N=l.length,D=1<=N;D?B<N:B>N;D?B++:B--)I.push((l[B-1]+l[B])*.5);else I=n;M=I.map(B=>T(B));}return ot[R]&&(M=M.map(I=>I[R]())),M},T.cache=function(C){return C!=null?(b=C,T):b},T.gamma=function(C){return C!=null?(x=C,T):x},T.nodata=function(C){return C!=null?(o=ot(C),T):o},T}a(Bn,"default");function Q1(e,t,o){let r=[],n=e<t,i=o?n?t+1:t-1:t;for(let s=e;n?s<i:s>i;n?s++:s--)r.push(s);return r}a(Q1,"__range__");var Z1=a(function(e){let t=[1,1];for(let o=1;o<e;o++){let r=[1];for(let n=1;n<=t.length;n++)r[n]=(t[n]||0)+t[n-1];t=r;}return t},"binom_row"),J1=a(function(e){let t,o,r,n;if(e=e.map(i=>new ye(i)),e.length===2)[o,r]=e.map(i=>i.lab()),t=a(function(i){let s=[0,1,2].map(l=>o[l]+i*(r[l]-o[l]));return new ye(s,"lab")},"I");else if(e.length===3)[o,r,n]=e.map(i=>i.lab()),t=a(function(i){let s=[0,1,2].map(l=>(1-i)*(1-i)*o[l]+2*(1-i)*i*r[l]+i*i*n[l]);return new ye(s,"lab")},"I");else if(e.length===4){let i;[o,r,n,i]=e.map(s=>s.lab()),t=a(function(s){let l=[0,1,2].map(d=>(1-s)*(1-s)*(1-s)*o[d]+3*(1-s)*(1-s)*s*r[d]+3*(1-s)*s*s*n[d]+s*s*s*i[d]);return new ye(l,"lab")},"I");}else if(e.length>=5){let i,s,l;i=e.map(d=>d.lab()),l=e.length-1,s=Z1(l),t=a(function(d){let c=1-d,p=[0,1,2].map(u=>i.reduce((g,f,b)=>g+s[b]*c**(l-b)*d**b*f[u],0));return new ye(p,"lab")},"I");}else throw new RangeError("No point in running bezier with only one color.");return t},"bezier"),Og=a(e=>{let t=J1(e);return t.scale=()=>Bn(t),t},"default");var hr=a((e,t,o)=>{if(!hr[o])throw new Error("unknown blend mode "+o);return hr[o](e,t)},"blend"),Ln=a(e=>(t,o)=>{let r=ot(o).rgb(),n=ot(t).rgb();return ot.rgb(e(r,n))},"blend_f"),Wn=a(e=>(t,o)=>{let r=[];return r[0]=e(t[0],o[0]),r[1]=e(t[1],o[1]),r[2]=e(t[2],o[2]),r},"each"),eT=a(e=>e,"normal"),tT=a((e,t)=>e*t/255,"multiply"),oT=a((e,t)=>e>t?t:e,"darken"),rT=a((e,t)=>e>t?e:t,"lighten"),nT=a((e,t)=>255*(1-(1-e/255)*(1-t/255)),"screen"),aT=a((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),"overlay"),iT=a((e,t)=>255*(1-(1-t/255)/(e/255)),"burn"),sT=a((e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e),"dodge");hr.normal=Ln(Wn(eT));hr.multiply=Ln(Wn(tT));hr.screen=Ln(Wn(nT));hr.overlay=Ln(Wn(aT));hr.darken=Ln(Wn(oT));hr.lighten=Ln(Wn(rT));hr.dodge=Ln(Wn(sT));hr.burn=Ln(Wn(iT));var Fg=hr;var{pow:lT,sin:dT,cos:cT}=Math;function Up(e=300,t=-1.5,o=1,r=1,n=[0,1]){let i=0,s;Qe(n)==="array"?s=n[1]-n[0]:(s=0,n=[n,n]);let l=a(function(d){let c=er*((e+120)/360+t*d),p=lT(n[0]+s*d,r),g=(i!==0?o[0]+d*i:o)*p*(1-p)/2,f=cT(c),b=dT(c),x=p+g*(-0.14861*f+1.78277*b),y=p+g*(-0.29227*f-.90649*b),k=p+g*(1.97294*f);return ot(Sa([x*255,y*255,k*255,1]))},"f");return l.start=function(d){return d==null?e:(e=d,l)},l.rotations=function(d){return d==null?t:(t=d,l)},l.gamma=function(d){return d==null?r:(r=d,l)},l.hue=function(d){return d==null?o:(o=d,Qe(o)==="array"?(i=o[1]-o[0],i===0&&(o=o[1])):i=0,l)},l.lightness=function(d){return d==null?n:(Qe(d)==="array"?(n=d,s=d[1]-d[0]):(n=[d,d],s=0),l)},l.scale=()=>ot.scale(l),l.hue(o),l}a(Up,"default");var uT="0123456789abcdef",{floor:pT,random:mT}=Math,Hg=a(()=>{let e="#";for(let t=0;t<6;t++)e+=uT.charAt(pT(mT()*16));return new ye(e,"hex")},"default");var{log:Vg,pow:fT,floor:bT,abs:gT}=Math;function Kp(e,t=null){let o={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Qe(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&Qe(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(o.values.push(r),o.sum+=r,r<o.min&&(o.min=r),r>o.max&&(o.max=r),o.count+=1);}),o.domain=[o.min,o.max],o.limits=(r,n)=>qp(o,r,n),o}a(Kp,"analyze");function qp(e,t="equal",o=7){Qe(e)=="array"&&(e=Kp(e));let{min:r,max:n}=e,i=e.values.sort((l,d)=>l-d);if(o===1)return [r,n];let s=[];if(t.substr(0,1)==="c"&&(s.push(r),s.push(n)),t.substr(0,1)==="e"){s.push(r);for(let l=1;l<o;l++)s.push(r+l/o*(n-r));s.push(n);}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");let l=Math.LOG10E*Vg(r),d=Math.LOG10E*Vg(n);s.push(r);for(let c=1;c<o;c++)s.push(fT(10,l+c/o*(d-l)));s.push(n);}else if(t.substr(0,1)==="q"){s.push(r);for(let l=1;l<o;l++){let d=(i.length-1)*l/o,c=bT(d);if(c===d)s.push(i[c]);else {let p=d-c;s.push(i[c]*(1-p)+i[c+1]*p);}}s.push(n);}else if(t.substr(0,1)==="k"){let l,d=i.length,c=new Array(d),p=new Array(o),u=true,g=0,f=null;f=[],f.push(r);for(let y=1;y<o;y++)f.push(r+y/o*(n-r));for(f.push(n);u;){for(let k=0;k<o;k++)p[k]=0;for(let k=0;k<d;k++){let w=i[k],v=Number.MAX_VALUE,h;for(let S=0;S<o;S++){let T=gT(f[S]-w);T<v&&(v=T,h=S),p[h]++,c[k]=h;}}let y=new Array(o);for(let k=0;k<o;k++)y[k]=null;for(let k=0;k<d;k++)l=c[k],y[l]===null?y[l]=i[k]:y[l]+=i[k];for(let k=0;k<o;k++)y[k]*=1/p[k];u=false;for(let k=0;k<o;k++)if(y[k]!==f[k]){u=true;break}f=y,g++,g>200&&(u=false);}let b={};for(let y=0;y<o;y++)b[y]=[];for(let y=0;y<d;y++)l=c[y],b[l].push(i[y]);let x=[];for(let y=0;y<o;y++)x.push(b[y][0]),x.push(b[y][b[y].length-1]);x=x.sort((y,k)=>y-k),s.push(x[0]);for(let y=1;y<x.length;y+=2){let k=x[y];!isNaN(k)&&s.indexOf(k)===-1&&s.push(k);}}return s}a(qp,"limits");var _g=a((e,t)=>{e=new ye(e),t=new ye(t);let o=e.luminance(),r=t.luminance();return o>r?(o+.05)/(r+.05):(r+.05)/(o+.05)},"default");var{sqrt:on,pow:eo,min:hT,max:yT,atan2:Gg,abs:$g,cos:cd,sin:jg,exp:xT,PI:Ug}=Math;function Yp(e,t,o=1,r=1,n=1){var i=a(function(_){return 360*_/(2*Ug)},"rad2deg"),s=a(function(_){return 2*Ug*_/360},"deg2rad");e=new ye(e),t=new ye(t);let[l,d,c]=Array.from(e.lab()),[p,u,g]=Array.from(t.lab()),f=(l+p)/2,b=on(eo(d,2)+eo(c,2)),x=on(eo(u,2)+eo(g,2)),y=(b+x)/2,k=.5*(1-on(eo(y,7)/(eo(y,7)+eo(25,7)))),w=d*(1+k),v=u*(1+k),h=on(eo(w,2)+eo(c,2)),S=on(eo(v,2)+eo(g,2)),T=(h+S)/2,C=i(Gg(c,w)),R=i(Gg(g,v)),M=C>=0?C:C+360,I=R>=0?R:R+360,B=$g(M-I)>180?(M+I+360)/2:(M+I)/2,N=1-.17*cd(s(B-30))+.24*cd(s(2*B))+.32*cd(s(3*B+6))-.2*cd(s(4*B-63)),D=I-M;D=$g(D)<=180?D:I<=M?D+360:D-360,D=2*on(h*S)*jg(s(D)/2);let E=p-l,P=S-h,W=1+.015*eo(f-50,2)/on(20+eo(f-50,2)),H=1+.045*T,A=1+.015*T*N,L=30*xT(-eo((B-275)/25,2)),G=-(2*on(eo(T,7)/(eo(T,7)+eo(25,7))))*jg(2*s(L)),$=on(eo(E/(o*W),2)+eo(P/(r*H),2)+eo(D/(n*A),2)+G*(P/(r*H))*(D/(n*A)));return yT(0,hT(100,$))}a(Yp,"default");function Xp(e,t,o="lab"){e=new ye(e),t=new ye(t);let r=e.get(o),n=t.get(o),i=0;for(let s in r){let l=(r[s]||0)-(n[s]||0);i+=l*l;}return Math.sqrt(i)}a(Xp,"default");var Kg=a((...e)=>{try{return new ye(...e),!0}catch{return false}},"default");var qg={cool(){return Bn([ot.hsl(180,1,.9),ot.hsl(250,.7,.4)])},hot(){return Bn(["#000","#f00","#ff0","#fff"]).mode("rgb")}};var ud={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(let e of Object.keys(ud))ud[e.toLowerCase()]=ud[e];var Yg=ud;Object.assign(ot,{average:zg,bezier:Og,blend:Fg,cubehelix:Up,mix:An,interpolate:An,random:Hg,scale:Bn,analyze:Kp,contrast:_g,deltaE:Yp,distance:Xp,limits:qp,valid:Kg,scales:qg,input:Ze,colors:En,brewer:Yg});var rn=ot;var Qp=500,Lr={xs:.01,sm:.02,md:.03,lg:.08,xl:.14},vT=a((e,t)=>(e%t+t)%t,"normalizeHue"),pd=a(e=>{let t=rn(e).hsv();return rn(t[0],t[1]*.92,Math.min(t[2]+.01,1),"hsv").hex()},"markDarkColor"),md=a((e,t,o)=>{o===void 0&&(o=Qp);let r=t-o,n;return t<=o?e[0]>80&&e[0]<260?n=r*Lr.xs:n=-r*Lr.sm:e[0]>20&&e[0]<48?n=-r*Lr.md:e[0]>=48&&e[0]<260?n=r*Lr.xs:n=-r*Lr.sm,vT(e[0]+n,360)},"calculateHue"),fd=a((e,t,o)=>{o===void 0&&(o=Qp);let r=(t-o)/100,n=0;t<o?(n=r*e[1]/5,t<100&&(n-=Lr.sm)):t>o&&(e[0]<30||e[0]>200?n=r*Lr.md:n=r*Lr.xs,e[1]===0&&(n=0));let i=e[1]+n;return i>1?1:i<0?0:i},"calculateSaturation"),bd=a((e,t,o)=>{o===void 0&&(o=Qp);let r=(t-o)/100,n=0;t<o?e[1]<.1?n=r*(1-e[2])/5*1.06:n=r*(1-e[2])/5:t>o&&((e[0]<30||e[0]>200)&&e[0]>0?(n=r*Lr.lg,e[2]>.8&&(n=r*Lr.xl)):n=r*e[2]/6);let i=e[2]-n;return i>1?1:i<0?0:i},"calculateLightness");var Zp=[50,100,200,300,400,500,600,700,800,900],gd=a((e,t="light")=>{let o=t==="dark",r=o?pd(e):e,n=rn(r).luminance();n<.1?r=rn(r).set("hsl.l",.4).hex():n>.9&&(r=rn(r).set("hsl.l",.6).hex());let i=rn(r).hsv(),s=Zp.map(l=>{let d=md(i,l,500),c=fd(i,l,500),p=bd(i,l,500);return rn(d,c,p,"hsv")});return o?s.reverse():s},"createSolidColorScale"),Jp=a(e=>{let t=gd(e,"light"),o=gd(e,"dark"),r={};return ["monkeys","monkeys-dark"].forEach((n,i)=>{let s={};i?o.map((l,d)=>Object.assign(s,{[Zp[d]]:l.rgb().join(" ")})):t.map((l,d)=>Object.assign(s,{[Zp[d]]:l.rgb().join(" ")})),Object.assign(r,{[n]:s});}),r},"genTailwindTheme"),Xg=wT__default.default(e=>{let t=Jp(e),o="";Object.entries(t).forEach(([n,i])=>{o+=(n==="monkeys-dark"?".dark":":root,::selection")+"{",Object.entries(i).forEach(([s,l])=>{o+=`--monkeys-${s}:${l};`;}),o+="}";});let r=document.getElementById("monkeys-theme");if(r)r.innerHTML=o;else {let n=document.createElement("style");n.id="monkeys-theme",document.head.appendChild(n),n.innerHTML=o;}},64);var CT="com.infmonkeys.css",hd=new WeakMap;function tm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}a(tm,"isRecord");function ST(e){let t=e?.[CT];return tm(t)?t:void 0}a(ST,"readCssExtension");function fo(e){return Number.isInteger(e)?String(e):String(Number(e.toFixed(6)))}a(fo,"formatNumber");function zn(e){return `${fo(e.value)}${e.unit}`}a(zn,"formatDimension");function em(e){return `${fo(e.value)}${e.unit}`}a(em,"formatDuration");function Ta(e){return e==="none"?e:fo(e)}a(Ta,"formatColorComponent");function TT(e){return [Number.parseInt(e.slice(1,3),16)/255,Number.parseInt(e.slice(3,5),16)/255,Number.parseInt(e.slice(5,7),16)/255]}a(TT,"hexToSrgb");function NT(e){if(e.colorSpace==="srgb"&&e.components.every(t=>typeof t=="number"))return e.components;if(e.hex)return TT(e.hex);throw new TypeError(`Web semantic colors in ${e.colorSpace} require a six-digit hex fallback for hsl(var(--token)) consumers.`)}a(NT,"colorSrgbComponents");function RT([e,t,o]){let r=Math.max(e,t,o),n=Math.min(e,t,o),i=(r+n)/2;if(r===n)return [0,0,i*100];let s=r-n,l=i>.5?s/(2-r-n):s/(r+n),d;return r===e?d=(t-o)/s+(t<o?6:0):r===t?d=(o-e)/s+2:d=(e-t)/s+4,[d/6*360,l*100,i*100]}a(RT,"srgbToHsl");function MT(e){if(e.colorSpace==="hsl"&&e.components.every(n=>typeof n=="number")){let[n,i,s]=e.components;return `${fo(n)} ${fo(i)}% ${fo(s)}%`}let[t,o,r]=RT(NT(e));return `${fo(t)} ${fo(o)}% ${fo(r)}%`}a(MT,"formatHslTriplet");function yd(e){let t=e.alpha??1;if(e.hex&&t===1)return e.hex;let o=e.components.map(Ta).join(" "),r=t===1?"":` / ${fo(t)}`;switch(e.colorSpace){case "srgb":return `rgb(${e.components.map(i=>i==="none"?"none":fo(i*255)).join(" ")}${r})`;case "hsl":return `hsl(${Ta(e.components[0])} ${Ta(e.components[1])}% ${Ta(e.components[2])}%${r})`;case "hwb":return `hwb(${Ta(e.components[0])} ${Ta(e.components[1])}% ${Ta(e.components[2])}%${r})`;case "lab":case "lch":case "oklab":case "oklch":return `${e.colorSpace}(${o}${r})`;default:return `color(${e.colorSpace} ${o}${r})`}}a(yd,"formatColor");function Qg(e){let t=Array.isArray(e)?e:[e],o=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);return t.map(r=>o.has(r)||/^[a-zA-Z][\w-]*$/.test(r)?r:`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`).join(", ")}a(Qg,"formatFontFamily");function IT(e){return (Array.isArray(e)?e:[e]).map(o=>{if(!tm(o))throw new TypeError("DTCG shadow values must be objects.");return [zn(o.offsetX),zn(o.offsetY),zn(o.blur),zn(o.spread),yd(o.color),o.inset===true?"inset":""].filter(Boolean).join(" ")}).join(", ")}a(IT,"formatShadow");function DT(e,t){if(!Array.isArray(e))throw new TypeError("DTCG gradient values must be arrays.");let o=e.map(n=>{if(!tm(n))throw new TypeError("DTCG gradient stops must be objects.");return `${yd(n.color)} ${fo(Number(n.position)*100)}%`}).join(", "),r=ST(t)?.gradient;return r?.kind==="radial"?`radial-gradient(${o})`:`linear-gradient(${fo(r?.angle??90)}deg, ${o})`}a(DT,"formatGradient");function Zg(e){switch(e.type){case "color":return yd(e.value);case "dimension":return zn(e.value);case "fontFamily":return Qg(e.value);case "fontWeight":case "number":return String(e.value);case "duration":return em(e.value);case "cubicBezier":return `cubic-bezier(${e.value.map(fo).join(", ")})`;case "strokeStyle":return typeof e.value=="string"?e.value:e.value.dashArray.map(zn).join(" ");case "border":{let t=e.value,o={...e,type:"strokeStyle",value:t.style};return `${zn(t.width)} ${Zg(o)} ${yd(t.color)}`}case "transition":{let t=e.value;return `${em(t.duration)} cubic-bezier(${t.timingFunction.map(fo).join(", ")}) ${em(t.delay)}`}case "shadow":return IT(e.value);case "gradient":return DT(e.value,e.extensions);case "typography":{let t=e.value;return `${t.fontWeight} ${zn(t.fontSize)}/${fo(t.lineHeight)} ${Qg(t.fontFamily)}`}}}a(Zg,"formatTokenValue");function Jg(e,t){let o=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase();return `--${t}-${o}`}a(Jg,"toCssVariableName");function PT(e){if(!/^[a-zA-Z][a-zA-Z0-9-]*$/.test(e))throw new TypeError("Theme token variablePrefix must start with a letter and contain only letters, numbers, or hyphens.")}a(PT,"assertCssVariablePrefix");function eh(e,t,o){let r=`${t}.${o}`;return e.has(r)?r:e.has(t)?t:void 0}a(eh,"selectModePath");var ET={"semantic.color.background":"--background","semantic.color.foreground":"--foreground","semantic.color.card":"--card","semantic.color.card-foreground":"--card-foreground","semantic.color.popover":"--popover","semantic.color.popover-foreground":"--popover-foreground","semantic.color.primary":"--primary","semantic.color.primary-foreground":"--primary-foreground","semantic.color.secondary":"--secondary","semantic.color.secondary-foreground":"--secondary-foreground","semantic.color.muted":"--muted","semantic.color.muted-foreground":"--muted-foreground","semantic.color.accent":"--accent","semantic.color.accent-foreground":"--accent-foreground","semantic.color.destructive":"--destructive","semantic.color.destructive-foreground":"--destructive-foreground","semantic.color.success":"--success","semantic.color.success-foreground":"--success-foreground","semantic.color.warning":"--warning","semantic.color.warning-foreground":"--warning-foreground","semantic.color.border":"--border","semantic.color.input":"--input","semantic.color.ring":"--ring","semantic.color.media-surface":"--media-surface","semantic.color.media-foreground":"--media-foreground","semantic.color.media-overlay":"--media-overlay","semantic.color.radar-canvas":"--radar-canvas","semantic.color.radar-panel":"--radar-panel","semantic.color.radar-border":"--radar-border","semantic.color.radar-shell-border":"--radar-shell-border","semantic.color.radar-grid":"--radar-grid","semantic.color.radar-axis":"--radar-axis","semantic.color.radar-series-one":"--radar-series-one","semantic.color.radar-series-two":"--radar-series-two","semantic.color.radar-series-three":"--radar-series-three","semantic.color.radar-series-four":"--radar-series-four"},th=Object.freeze({...Object.fromEntries(Object.entries(ET).map(([e,t])=>[e,{variableName:t,axis:"colorMode",expectedType:"color",format:"hsl"}])),"semantic.color.neocard":{variableName:"--neocard",axis:"colorMode",expectedType:"color",format:"css"},"semantic.radius.base":{variableName:"--radius",axis:"colorMode",expectedType:"dimension",format:"css"},"semantic.spacing.global":{variableName:"--global-spacing",axis:"density",expectedType:"dimension",format:"css"},"semantic.gradient.brand":{variableName:"--monkeys-gradient",axis:"colorMode",expectedType:"gradient",format:"css"},"semantic.font.body":{variableName:"--font-sans",axis:"colorMode",expectedType:"fontFamily",format:"css"}});function om(e){let t=e.startsWith("$")?e.slice(1).trim():e.trim();if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/i.test(t))throw new TypeError(`Invalid Design Token path ${e}.`);let o=th[t];return o?o.format==="hsl"?`hsl(var(${o.variableName}))`:`var(${o.variableName})`:`var(${Jg(t,"monkeys")})`}a(om,"resolveThemeTokenCssVariable");function oh(e,t){let o=eh(new Set(Object.keys(e.cssValues)),t,e.colorMode);return o?e.cssValues[o]:void 0}a(oh,"getThemeTokenCssValue");function ys(e,t={}){let o=runtime.resolveThemeTokens(e),r=o.document,n=t.colorMode??"light",i=t.density??"default",s=t.variablePrefix??"monkeys";PT(s);let l={},d={},c={},p=new Map;for(let[f,b]of o.tokens){l[f]=b.value;let x=Zg(b);d[f]=x;let y=Jg(f,s),k=p.get(y);if(k)throw new TypeError(`Theme token paths ${k} and ${f} both compile to ${y}. Rename one token.`);p.set(y,f),c[y]=x;}let u=new Set(o.tokens.keys());for(let[f,b]of Object.entries(th)){let x=b.axis==="density"?i:n,y=eh(u,f,x);if(!y)continue;let k=o.tokens.get(y);if(!k||k.type!==b.expectedType)throw new TypeError(`${y} must be a ${b.expectedType} token to drive ${b.variableName}.`);c[b.variableName]=b.format==="hsl"?MT(k.value):d[y];}let g=Object.entries(c).sort(([f],[b])=>f.localeCompare(b)).map(([f,b])=>`${f}:${b};`).join("");return {contract:r,colorMode:n,density:i,values:Object.freeze(l),cssValues:Object.freeze(d),cssVariables:Object.freeze(c),cssText:g}}a(ys,"compileThemeTokens");function rh(e,t={}){let o=ys(e,t),r=t.target??(typeof document>"u"?null:document.documentElement);if(!r)return o;let n=hd.get(r)??new Set,i=new Set(Object.keys(o.cssVariables));for(let s of n)i.has(s)||r.style.removeProperty(s);for(let[s,l]of Object.entries(o.cssVariables))r.style.setProperty(s,l);return hd.set(r,i),t.themeId?r.dataset.monkeysTheme=t.themeId:delete r.dataset.monkeysTheme,r.dataset.monkeysColorMode=o.colorMode,r.dataset.monkeysDensity=o.density,o}a(rh,"applyThemeTokens");function nh(e={}){let t=e.target??(typeof document>"u"?null:document.documentElement);if(!t)return;let o=hd.get(t)??new Set;for(let r of o)t.style.removeProperty(r);hd.delete(t),delete t.dataset.monkeysTheme,delete t.dataset.monkeysColorMode,delete t.dataset.monkeysDensity;}a(nh,"clearThemeTokens");var xd=["background","glowColor","borderColor","borderWidth","borderStyle","radius","shadow","padding","gap"],AT={background:"hsl(var(--card, 0 0% 100%))",glowColor:"var(--monkeys-bento-glow-default)",borderColor:"hsl(var(--border, 214.3 31.8% 91.4%))",borderWidth:"1px",borderStyle:"solid",radius:"var(--radius, 0.75rem)",shadow:"none",padding:"var(--global-spacing, 0.75rem)",gap:"var(--global-spacing, 0.75rem)"},rm=new WeakMap;function ah(e,t){if(!Number.isSafeInteger(t)||t<1)throw new RangeError("Bento level must be a positive safe integer.");let o=e&&rm.get(e)?.get(t);if(o)return o;let r={...AT},n=Object.fromEntries(xd.map(s=>[s,"builtin"]));for(let s of xd){let l=s==="padding"||s==="gap"?e?.density:e?.colorMode,d=s==="glowColor"?"component.bento":"semantic.bento",c=[`${d}.levels.level${t}.${s}`,`${d}.default.${s}`];for(let p of c){let u=l&&e?.cssValues[`${p}.${l}`]!==void 0?`${p}.${l}`:p,g=e?.cssValues[u];if(g!==void 0){r[s]=g,n[s]=u;break}}}let i=Object.freeze({values:Object.freeze(r),sources:Object.freeze(n)});if(e){let s=rm.get(e)??new Map;s.set(t,i),rm.set(e,s);}return i}a(ah,"resolveBentoTokens");var nn={locale:"en-US",messages:{pagination:{navigation:"Pagination",first:"First",previous:"Previous",next:"Next",last:"Last",page:a(({page:e,pageCount:t})=>`Page ${e} of ${t}`,"page"),currentPage:a(({page:e,pageCount:t})=>`Page ${e} of ${t}, current page`,"currentPage"),emptyResults:"0 results",range:a(({start:e,end:t,total:o})=>`${e}-${t} of ${o}`,"range"),selected:a(({count:e})=>`${e} selected`,"selected"),pageSize:"Items per page",loadBatchSize:"Items per load",perLoad:"Items per load",jumpToPage:"Jump to page",pages:"pages",clickToJump:"Click to jump to a page"},dialog:{close:"Close dialog"},dropdownMenu:{actions:"Actions"},loading:{spinner:"Loading"},layout:{resizePanels:"Resize panels",expandPanel:"Expand",collapsePanel:"Collapse",movePanel:"Move",moveBefore:"Move earlier",moveAfter:"Move later"},steps:{label:"Progress",current:"Current",completed:"Completed",error:"Error",disabled:"Disabled"},numberInput:{increment:"Increase value",decrement:"Decrease value"},passwordInput:{showPassword:"Show password",hidePassword:"Hide password"},multiSelect:{placeholder:"Select options",empty:"No options",removeOption:a(({value:e})=>`Remove ${e}`,"removeOption")},table:{dragColumn:a(({columnId:e})=>`Drag column ${e}`,"dragColumn"),resizeColumn:a(({columnId:e})=>`Resize column ${e}`,"resizeColumn"),sortColumn:a(({columnId:e})=>e?`Sort column ${e}`:"Sort column","sortColumn"),loadingRow:"Loading table row"},toolbar:{theme:{label:"Appearance",toggle:"Toggle theme",auto:"Auto",light:"Light",dark:"Dark"},language:{label:"Language",switch:"Switch language"}},toast:{errorTitle:"Error",warningTitle:"Warning",defaultErrorDescription:"Something went wrong.",defaultWarningDescription:"Please check and try again."},dataExplorer:{viewTree:{actions:"More actions",expand:"Expand",collapse:"Collapse",loading:"Loading...",empty:"No views",error:"Unable to load views"}},workbench:{relationshipGraph:{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview"},collection:{label:"Collection",loading:"Loading items",empty:"No items",loadError:"Unable to load items",refreshError:"Unable to refresh items",retry:"Retry",loadingMore:"Loading more items",permission:"You do not have permission to view this content",offline:"You appear to be offline",requestAccess:"Request access"},interactiveTable:{columnActions:"Column actions",freezeColumn:"Freeze to left",freezeEndColumn:"Freeze to right",unfreezeColumn:"Unfreeze from left",unfreezeEndColumn:"Unfreeze from right",unfreezeAllColumns:"Unfreeze all columns",resetColumnWidth:"Reset column width",frozenColumnTitle:"Frozen column"}},agentWorkbench:{label:"Session activity",reasoning:"Reasoning",plan:"Plan",taskNoDetail:"No additional details",modes:{chat:"Chat",work:"Work"},composer:{send:"Send message",stop:"Stop generating",queue:"Queue message",attach:"Add photos or files",voice:"Start voice input",webSearch:"Web search",chatMode:"Chat mode",model:"Model",reasoning:"Reasoning effort",permissions:"Permissions",removeAttachment:"Remove attachment",editQueued:"Edit queued message",deleteQueued:"Delete queued message",moveUp:"Move message up",moveDown:"Move message down",queued:"Queued messages",uploading:"Uploading",uploadFailed:"Upload failed",retryAttachment:"Retry attachment upload",noModels:"No models available",message:"Message",attachmentOnly:"Attachment",reasoningOptions:{low:"Low",medium:"Medium",high:"High",xhigh:"Extra high"},permissionOptions:{"approval-required":"Approval required","auto-approve":"Auto approve","full-access":"Full access"}},quickStart:{label:"Quick start",back:"Back",addFile:"Add file"},tool:{input:"Input",output:"Output",status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Error",denied:"Denied"}},approval:{approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected"},artifact:{pending:"Preparing",ready:"Ready",failed:"Failed",open:a(({name:e})=>`Open ${e}`,"open")},run:{stopping:"Stopping...",stoppedAfter:a(({duration:e})=>`You stopped after ${e}`,"stoppedAfter")},process:{running:"Working",queued:"Queued",waitingApproval:"Waiting for approval",failed:"Failed",stopped:"Stopped",processed:"Processed",processedFor:a(({duration:e})=>`Worked for ${e}`,"processedFor"),completedCount:a(({completed:e,total:t})=>`${e}/${t} completed`,"completedCount")},artifactWorkspace:{outputs:"Outputs",sources:"Sources",viewAll:"View all",toggleSummary:"Toggle files",tabs:"Open files",closeTab:a(({name:e})=>`Close ${e}`,"closeTab"),closeWorkspace:"Close workspace",download:a(({name:e})=>`Download ${e}`,"download"),openExternal:a(({name:e})=>`Open ${e} in a new window`,"openExternal"),loading:"Loading preview...",failed:"Preview unavailable",retry:"Try again"},usage:{label:"Context usage",context:a(({used:e,total:t})=>`${e} / ${t} tokens`,"context")},navigation:{search:"Search agents and sessions",searchSessions:"Search sessions",searchShortcut:"Focus search",clearSearch:"Clear search",tabsLabel:"Agent workbench navigation",agents:"Agents",sessions:"Sessions",newAgent:"New Agent",newSession:"New Session",capabilities:"Capabilities & Extensions",settings:"Agent Settings",allAgents:"All Agents",recentSessions:"Recent Sessions",chat:"Chat",work:"Work",chats:"Chats",builtIn:"Built-in",noDescription:"No description",loading:"Loading...",emptyAgents:"No agents yet",emptySessions:"No sessions yet",noResults:"No matching results",retry:"Retry",pin:"Pin",unpin:"Unpin",rename:"Rename",delete:"Delete",actions:"Actions",save:"Save",cancel:"Cancel",running:"Running",completed:"Completed",failed:"Failed",contextUsage:a(({percent:e})=>`${e}% context used`,"contextUsage")},details:{title:"Task details",description:"Summary and workspace activity",duration:"Duration",updated:"Updated",model:"Model",mode:"Mode",permissions:"Permissions",tokenUsage:"Token usage",summary:"Summary",summaryEmpty:"No summary is available yet.",summaryFailed:"The summary could not be generated.",highlights:"Highlights",pendingItems:"Pending items",tabs:{label:"Task detail views",summary:"Summary",workspace:"Workspace"},status:{queued:"Queued",running:"Running",waiting_approval:"Waiting for approval",stopping:"Stopping",stopped:"Stopped",completed:"Completed",failed:"Failed"},state:{loading:{title:"Loading task details",description:"Restoring the latest session activity."},empty:{title:"No task selected",description:"Select a task to inspect its details."},error:{title:"Unable to load task details",description:"Try again after the session is available."}},actions:{close:"Close task details",copySummary:"Copy summary",retry:"Retry",retrySummary:"Retry summary",resume:"Resume",continueInNewTask:"Continue in new task",editAndRerun:"Edit and rerun",export:"Export"},workspace:{diffs:"Code changes",files:"Files",terminals:"Terminals",tests:"Tests",artifacts:"Artifacts",exitCode:a(({code:e})=>`Exit code ${e}`,"exitCode"),diffStatus:{added:"Added",modified:"Modified",deleted:"Deleted",renamed:"Renamed"},fileOperation:{upsert:"Updated",delete:"Deleted"}}}}}};var vd={locale:"zh-CN",messages:{pagination:{navigation:"\u5206\u9875\u5BFC\u822A",first:"\u9996\u9875",previous:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",last:"\u672B\u9875",page:a(({page:e,pageCount:t})=>`\u7B2C ${e} \u9875\uFF0C\u5171 ${t} \u9875`,"page"),currentPage:a(({page:e,pageCount:t})=>`\u7B2C ${e} \u9875\uFF0C\u5171 ${t} \u9875\uFF0C\u5F53\u524D\u9875`,"currentPage"),emptyResults:"\u5171 0 \u6761",range:a(({start:e,end:t,total:o})=>`\u7B2C ${e}-${t} \u6761\uFF0C\u5171 ${o} \u6761`,"range"),selected:a(({count:e})=>`\u5DF2\u9009\u62E9 ${e} \u9879`,"selected"),pageSize:"\u6BCF\u9875\u663E\u793A\u6570\u91CF",loadBatchSize:"\u6BCF\u6B21\u52A0\u8F7D\u6570\u91CF",perLoad:"\u6BCF\u6B21\u52A0\u8F7D",jumpToPage:"\u8DF3\u8F6C\u5230\u9875\u7801",pages:"\u9875",clickToJump:"\u70B9\u51FB\u8DF3\u8F6C\u9875\u7801"},dialog:{close:"\u5173\u95ED\u5BF9\u8BDD\u6846"},dropdownMenu:{actions:"\u64CD\u4F5C"},loading:{spinner:"\u6B63\u5728\u52A0\u8F7D"},layout:{resizePanels:"\u8C03\u6574\u9762\u677F\u5927\u5C0F",expandPanel:"\u5C55\u5F00",collapsePanel:"\u6536\u8D77",movePanel:"\u79FB\u52A8",moveBefore:"\u5411\u524D\u79FB\u52A8",moveAfter:"\u5411\u540E\u79FB\u52A8"},steps:{label:"\u8FDB\u5EA6",current:"\u5F53\u524D\u6B65\u9AA4",completed:"\u5DF2\u5B8C\u6210",error:"\u9519\u8BEF",disabled:"\u5DF2\u7981\u7528"},numberInput:{increment:"\u589E\u52A0\u6570\u503C",decrement:"\u51CF\u5C11\u6570\u503C"},passwordInput:{showPassword:"\u663E\u793A\u5BC6\u7801",hidePassword:"\u9690\u85CF\u5BC6\u7801"},multiSelect:{placeholder:"\u8BF7\u9009\u62E9",empty:"\u6682\u65E0\u9009\u9879",removeOption:a(({value:e})=>`\u79FB\u9664 ${e}`,"removeOption")},table:{dragColumn:a(({columnId:e})=>`\u62D6\u52A8\u5217 ${e}`,"dragColumn"),resizeColumn:a(({columnId:e})=>`\u8C03\u6574\u5217\u5BBD ${e}`,"resizeColumn"),sortColumn:a(({columnId:e})=>e?`\u6392\u5E8F\u5217 ${e}`:"\u6392\u5E8F\u5217","sortColumn"),loadingRow:"\u6B63\u5728\u52A0\u8F7D\u8868\u683C\u884C"},toolbar:{theme:{label:"\u5916\u89C2",toggle:"\u5207\u6362\u4E3B\u9898",auto:"\u8DDF\u968F\u7CFB\u7EDF",light:"\u6D45\u8272\u6A21\u5F0F",dark:"\u6DF1\u8272\u6A21\u5F0F"},language:{label:"\u8BED\u8A00",switch:"\u5207\u6362\u8BED\u8A00"}},toast:{errorTitle:"\u9519\u8BEF",warningTitle:"\u63D0\u793A",defaultErrorDescription:"\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",defaultWarningDescription:"\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002"},dataExplorer:{viewTree:{actions:"\u66F4\u591A\u64CD\u4F5C",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77",loading:"\u6B63\u5728\u52A0\u8F7D...",empty:"\u6682\u65E0\u89C6\u56FE",error:"\u65E0\u6CD5\u52A0\u8F7D\u89C6\u56FE"}},workbench:{relationshipGraph:{zoomOut:"\u7F29\u5C0F",zoomIn:"\u653E\u5927",zoomToFit:"\u9002\u5E94\u753B\u5E03",minimap:"\u56FE\u8C31\u6982\u89C8"},collection:{label:"\u5185\u5BB9\u96C6\u5408",loading:"\u6B63\u5728\u52A0\u8F7D\u5185\u5BB9",empty:"\u6682\u65E0\u5185\u5BB9",loadError:"\u65E0\u6CD5\u52A0\u8F7D\u5185\u5BB9",refreshError:"\u65E0\u6CD5\u5237\u65B0\u5185\u5BB9",retry:"\u91CD\u8BD5",loadingMore:"\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9",permission:"\u4F60\u6CA1\u6709\u6743\u9650\u67E5\u770B\u6B64\u5185\u5BB9",offline:"\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00",requestAccess:"\u7533\u8BF7\u6743\u9650"},interactiveTable:{columnActions:"\u5217\u64CD\u4F5C",freezeColumn:"\u56FA\u5B9A\u5230\u5DE6\u4FA7",freezeEndColumn:"\u56FA\u5B9A\u5230\u53F3\u4FA7",unfreezeColumn:"\u53D6\u6D88\u5DE6\u4FA7\u56FA\u5B9A",unfreezeEndColumn:"\u53D6\u6D88\u53F3\u4FA7\u56FA\u5B9A",unfreezeAllColumns:"\u53D6\u6D88\u5168\u90E8\u56FA\u5B9A",resetColumnWidth:"\u91CD\u7F6E\u5217\u5BBD",frozenColumnTitle:"\u5DF2\u56FA\u5B9A\u5217"}},agentWorkbench:{label:"\u4F1A\u8BDD\u6D3B\u52A8",reasoning:"\u601D\u8003\u8FC7\u7A0B",plan:"\u6267\u884C\u8BA1\u5212",taskNoDetail:"\u6682\u65E0\u66F4\u591A\u8BE6\u60C5",modes:{chat:"\u5BF9\u8BDD",work:"\u5DE5\u4F5C"},composer:{send:"\u53D1\u9001\u6D88\u606F",stop:"\u505C\u6B62\u751F\u6210",queue:"\u6392\u961F\u53D1\u9001",attach:"\u6DFB\u52A0\u7167\u7247\u6216\u6587\u4EF6",voice:"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",webSearch:"\u8054\u7F51\u641C\u7D22",chatMode:"\u5BF9\u8BDD\u6A21\u5F0F",model:"\u6A21\u578B",reasoning:"\u601D\u8003\u5F3A\u5EA6",permissions:"\u6743\u9650",removeAttachment:"\u79FB\u9664\u9644\u4EF6",editQueued:"\u7F16\u8F91\u6392\u961F\u6D88\u606F",deleteQueued:"\u5220\u9664\u6392\u961F\u6D88\u606F",moveUp:"\u4E0A\u79FB\u6D88\u606F",moveDown:"\u4E0B\u79FB\u6D88\u606F",queued:"\u6392\u961F\u6D88\u606F",uploading:"\u4E0A\u4F20\u4E2D",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",retryAttachment:"\u91CD\u8BD5\u9644\u4EF6\u4E0A\u4F20",noModels:"\u6682\u65E0\u53EF\u7528\u6A21\u578B",message:"\u6D88\u606F",attachmentOnly:"\u9644\u4EF6",reasoningOptions:{low:"\u4F4E",medium:"\u4E2D",high:"\u9AD8",xhigh:"\u6700\u9AD8"},permissionOptions:{"approval-required":"\u9700\u8981\u6279\u51C6","auto-approve":"\u81EA\u52A8\u6279\u51C6","full-access":"\u5B8C\u5168\u8BBF\u95EE"}},quickStart:{label:"\u5FEB\u901F\u5F00\u59CB",back:"\u8FD4\u56DE",addFile:"\u6DFB\u52A0\u6587\u4EF6"},tool:{input:"\u8F93\u5165",output:"\u8F93\u51FA",status:{pending:"\u7B49\u5F85\u4E2D",running:"\u8FD0\u884C\u4E2D",completed:"\u5DF2\u5B8C\u6210",failed:"\u9519\u8BEF",denied:"\u5DF2\u62D2\u7EDD"}},approval:{approve:"\u5141\u8BB8",reject:"\u62D2\u7EDD",approved:"\u5DF2\u5141\u8BB8",rejected:"\u5DF2\u62D2\u7EDD"},artifact:{pending:"\u51C6\u5907\u4E2D",ready:"\u5DF2\u5C31\u7EEA",failed:"\u5931\u8D25",open:a(({name:e})=>`\u6253\u5F00 ${e}`,"open")},run:{stopping:"\u6B63\u5728\u505C\u6B62...",stoppedAfter:a(({duration:e})=>`\u4F60\u5728 ${e} \u540E\u505C\u6B62\u4E86\u4EFB\u52A1`,"stoppedAfter")},process:{running:"\u6267\u884C\u8FC7\u7A0B",queued:"\u6392\u961F\u4E2D",waitingApproval:"\u7B49\u5F85\u5BA1\u6279",failed:"\u5931\u8D25",stopped:"\u5DF2\u505C\u6B62",processed:"\u5DF2\u5904\u7406",processedFor:a(({duration:e})=>`\u8017\u65F6 ${e.replace(/(\d+)h/g,"$1\u5C0F\u65F6").replace(/(\d+)m/g,"$1\u5206\u949F").replace(/(\d+)s/g,"$1\u79D2").replace(/\s+/g,"")}`,"processedFor"),completedCount:a(({completed:e,total:t})=>`${e}/${t} \u5DF2\u5B8C\u6210`,"completedCount")},artifactWorkspace:{outputs:"\u8F93\u51FA",sources:"\u6765\u6E90",viewAll:"\u67E5\u770B\u5168\u90E8",toggleSummary:"\u5207\u6362\u6587\u4EF6\u6458\u8981",tabs:"\u5DF2\u6253\u5F00\u6587\u4EF6",closeTab:a(({name:e})=>`\u5173\u95ED ${e}`,"closeTab"),closeWorkspace:"\u5173\u95ED\u5DE5\u4F5C\u533A",download:a(({name:e})=>`\u4E0B\u8F7D ${e}`,"download"),openExternal:a(({name:e})=>`\u5728\u65B0\u7A97\u53E3\u6253\u5F00 ${e}`,"openExternal"),loading:"\u6B63\u5728\u52A0\u8F7D\u9884\u89C8...",failed:"\u9884\u89C8\u4E0D\u53EF\u7528",retry:"\u91CD\u8BD5"},usage:{label:"\u4E0A\u4E0B\u6587\u7528\u91CF",context:a(({used:e,total:t})=>`${e} / ${t} tokens`,"context")},navigation:{search:"\u641C\u7D22\u667A\u80FD\u4F53\u548C\u4F1A\u8BDD",searchSessions:"\u641C\u7D22\u4F1A\u8BDD",searchShortcut:"\u805A\u7126\u641C\u7D22\u6846",clearSearch:"\u6E05\u9664\u641C\u7D22",tabsLabel:"\u667A\u80FD\u4F53\u5DE5\u4F5C\u53F0\u5BFC\u822A",agents:"\u667A\u80FD\u4F53",sessions:"\u4F1A\u8BDD",newAgent:"\u65B0\u5EFA\u667A\u80FD\u4F53",newSession:"\u65B0\u5EFA\u4F1A\u8BDD",capabilities:"\u80FD\u529B\u4E0E\u6269\u5C55",settings:"\u667A\u80FD\u4F53\u8BBE\u7F6E",allAgents:"\u5168\u90E8\u667A\u80FD\u4F53",recentSessions:"\u6700\u8FD1\u4F1A\u8BDD",chat:"\u5BF9\u8BDD",work:"\u5DE5\u4F5C",chats:"\u804A\u5929",builtIn:"\u5185\u7F6E",noDescription:"\u6682\u65E0\u63CF\u8FF0",loading:"\u52A0\u8F7D\u4E2D...",emptyAgents:"\u6682\u65E0\u667A\u80FD\u4F53",emptySessions:"\u6682\u65E0\u4F1A\u8BDD",noResults:"\u6CA1\u6709\u5339\u914D\u7ED3\u679C",retry:"\u91CD\u8BD5",pin:"\u7F6E\u9876",unpin:"\u53D6\u6D88\u7F6E\u9876",rename:"\u91CD\u547D\u540D",delete:"\u5220\u9664",actions:"\u64CD\u4F5C",save:"\u4FDD\u5B58",cancel:"\u53D6\u6D88",running:"\u8FD0\u884C\u4E2D",completed:"\u5DF2\u5B8C\u6210",failed:"\u5931\u8D25",contextUsage:a(({percent:e})=>`\u5DF2\u4F7F\u7528 ${e}% \u4E0A\u4E0B\u6587`,"contextUsage")},details:{title:"\u4EFB\u52A1\u8BE6\u60C5",description:"\u6458\u8981\u4E0E\u5DE5\u4F5C\u533A\u6D3B\u52A8",duration:"\u8017\u65F6",updated:"\u66F4\u65B0\u65F6\u95F4",model:"\u6A21\u578B",mode:"\u6A21\u5F0F",permissions:"\u6743\u9650",tokenUsage:"Token \u7528\u91CF",summary:"\u6458\u8981",summaryEmpty:"\u6682\u65F6\u6CA1\u6709\u53EF\u7528\u6458\u8981\u3002",summaryFailed:"\u6458\u8981\u751F\u6210\u5931\u8D25\u3002",highlights:"\u91CD\u70B9",pendingItems:"\u5F85\u5904\u7406\u4E8B\u9879",tabs:{label:"\u4EFB\u52A1\u8BE6\u60C5\u89C6\u56FE",summary:"\u6458\u8981",workspace:"\u5DE5\u4F5C\u533A"},status:{queued:"\u6392\u961F\u4E2D",running:"\u8FD0\u884C\u4E2D",waiting_approval:"\u7B49\u5F85\u5BA1\u6279",stopping:"\u6B63\u5728\u505C\u6B62",stopped:"\u5DF2\u505C\u6B62",completed:"\u5DF2\u5B8C\u6210",failed:"\u5931\u8D25"},state:{loading:{title:"\u6B63\u5728\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5",description:"\u6B63\u5728\u6062\u590D\u6700\u65B0\u7684\u4F1A\u8BDD\u6D3B\u52A8\u3002"},empty:{title:"\u672A\u9009\u62E9\u4EFB\u52A1",description:"\u9009\u62E9\u4EFB\u52A1\u540E\u67E5\u770B\u8BE6\u7EC6\u4FE1\u606F\u3002"},error:{title:"\u65E0\u6CD5\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5",description:"\u4F1A\u8BDD\u6062\u590D\u53EF\u7528\u540E\u8BF7\u91CD\u8BD5\u3002"}},actions:{close:"\u5173\u95ED\u4EFB\u52A1\u8BE6\u60C5",copySummary:"\u590D\u5236\u6458\u8981",retry:"\u91CD\u8BD5",retrySummary:"\u91CD\u65B0\u751F\u6210\u6458\u8981",resume:"\u7EE7\u7EED\u8FD0\u884C",continueInNewTask:"\u5728\u65B0\u4EFB\u52A1\u4E2D\u7EE7\u7EED",editAndRerun:"\u7F16\u8F91\u5E76\u91CD\u65B0\u8FD0\u884C",export:"\u5BFC\u51FA"},workspace:{diffs:"\u4EE3\u7801\u53D8\u66F4",files:"\u6587\u4EF6",terminals:"\u7EC8\u7AEF",tests:"\u6D4B\u8BD5",artifacts:"\u4EA7\u7269",exitCode:a(({code:e})=>`\u9000\u51FA\u7801 ${e}`,"exitCode"),diffStatus:{added:"\u65B0\u589E",modified:"\u4FEE\u6539",deleted:"\u5220\u9664",renamed:"\u91CD\u547D\u540D"},fileOperation:{upsert:"\u5DF2\u66F4\u65B0",delete:"\u5DF2\u5220\u9664"}}}}}};var BT={"en-US":nn,"zh-CN":vd};function ih(e){if(typeof e!="string"||!e.trim())throw new TypeError("Monkeys locale must be a non-empty BCP 47 string.");try{return Intl.getCanonicalLocales(e)[0]}catch{throw new RangeError(`Monkeys locale "${e}" is not a valid BCP 47 identifier.`)}}a(ih,"normalizeLocaleId");function sh(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}a(sh,"isRecord");function lh(e,t,o){if(!sh(e)||!sh(t))throw new TypeError(`${o} must be an object.`);for(let[r,n]of Object.entries(e)){if(n===void 0)continue;if(!(r in t))throw new TypeError(`${o}.${r} is not a supported Monkeys message.`);let i=t[r],s=`${o}.${r}`;if(typeof i=="function"){if(typeof n!="function")throw new TypeError(`${s} must be a function.`)}else if(typeof i=="string"){if(typeof n!="string")throw new TypeError(`${s} must be a string.`)}else lh(n,i,s);}}a(lh,"validateMessageOverride");function dh(e,t){lh(e,nn.messages,t);}a(dh,"assertMessagesOverride");function ch(e){return e==="en-US"||e==="zh-CN"}a(ch,"isBuiltInLocale");function LT(e){if(e===void 0)return {locale:void 0,messages:void 0,hasExplicitLocale:false};if(typeof e=="string"){let o=ih(e);if(!ch(o))throw new RangeError(`Unsupported built-in Monkeys locale "${o}". Provide a locale pack object for custom locales.`);return {locale:o,messages:void 0,hasExplicitLocale:true}}if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("Monkeys locale must be a locale id or locale pack object.");let t=ih(e.locale);return dh(e.messages,"Monkeys locale messages"),{locale:t,messages:e.messages,hasExplicitLocale:true}}a(LT,"normalizeLocaleInput");function Na(e,t){return t?{pagination:{...e.pagination,...t.pagination},dialog:{...e.dialog,...t.dialog},dropdownMenu:{...e.dropdownMenu,...t.dropdownMenu},loading:{...e.loading,...t.loading},layout:{...e.layout,...t.layout},steps:{...e.steps,...t.steps},numberInput:{...e.numberInput,...t.numberInput},passwordInput:{...e.passwordInput,...t.passwordInput},multiSelect:{...e.multiSelect,...t.multiSelect},table:{...e.table,...t.table},toolbar:{theme:{...e.toolbar.theme,...t.toolbar?.theme},language:{...e.toolbar.language,...t.toolbar?.language}},toast:{...e.toast,...t.toast},dataExplorer:{viewTree:{...e.dataExplorer.viewTree,...t.dataExplorer?.viewTree}},workbench:{relationshipGraph:{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview",...e.workbench.relationshipGraph,...t.workbench?.relationshipGraph},collection:{...e.workbench.collection,...t.workbench?.collection},interactiveTable:{...e.workbench.interactiveTable,...t.workbench?.interactiveTable}},agentWorkbench:{...e.agentWorkbench,...t.agentWorkbench,modes:{...e.agentWorkbench.modes,...t.agentWorkbench?.modes},composer:{...e.agentWorkbench.composer,...t.agentWorkbench?.composer},quickStart:{...e.agentWorkbench.quickStart,...t.agentWorkbench?.quickStart},tool:{...e.agentWorkbench.tool,...t.agentWorkbench?.tool,status:{...e.agentWorkbench.tool.status,...t.agentWorkbench?.tool?.status}},approval:{...e.agentWorkbench.approval,...t.agentWorkbench?.approval},artifact:{...e.agentWorkbench.artifact,...t.agentWorkbench?.artifact},run:{...e.agentWorkbench.run,...t.agentWorkbench?.run},process:{...e.agentWorkbench.process,...t.agentWorkbench?.process},artifactWorkspace:{...e.agentWorkbench.artifactWorkspace,...t.agentWorkbench?.artifactWorkspace},usage:{...e.agentWorkbench.usage,...t.agentWorkbench?.usage},navigation:{...e.agentWorkbench.navigation,...t.agentWorkbench?.navigation},details:{...e.agentWorkbench.details,...t.agentWorkbench?.details,tabs:{...e.agentWorkbench.details.tabs,...t.agentWorkbench?.details?.tabs},status:{...e.agentWorkbench.details.status,...t.agentWorkbench?.details?.status},state:{loading:{...e.agentWorkbench.details.state.loading,...t.agentWorkbench?.details?.state?.loading},empty:{...e.agentWorkbench.details.state.empty,...t.agentWorkbench?.details?.state?.empty},error:{...e.agentWorkbench.details.state.error,...t.agentWorkbench?.details?.state?.error}},actions:{...e.agentWorkbench.details.actions,...t.agentWorkbench?.details?.actions},workspace:{...e.agentWorkbench.details.workspace,...t.agentWorkbench?.details?.workspace,diffStatus:{...e.agentWorkbench.details.workspace.diffStatus,...t.agentWorkbench?.details?.workspace?.diffStatus},fileOperation:{...e.agentWorkbench.details.workspace.fileOperation,...t.agentWorkbench?.details?.workspace?.fileOperation}}}}}:e}a(Na,"mergeMonkeysLocaleMessages");var ii={locale:nn.locale,messages:Na(nn.messages)};function wd(e,t,o){t!==void 0&&dh(t,"MonkeysProvider messages");let r=LT(e),n=r.locale??o?.locale??nn.locale,i=ch(n)?BT[n].messages:void 0,s=Na(nn.messages,i);return o&&(!r.hasExplicitLocale||o.locale===n)&&(s=Na(s,o.messages)),s=Na(s,r.messages),s=Na(s,t),{locale:n,messages:s}}a(wd,"resolveMonkeysLocale");var WT=Object.freeze({}),zT=Object.freeze({}),uh=Symbol.for("@inf-monkeys-tech/monkeys-design/provider-context@1");function OT(){return Object.freeze({locale:ho.createContext({...ii,provided:false}),theme:ho.createContext({provided:false}),direction:ho.createContext({provided:false}),environment:ho.createContext({provided:false,environment:WT,portal:zT})})}a(OT,"createMonkeysProviderContexts");function FT(){let e=globalThis,t=e[uh];if(t)return t;let o=OT();return Object.defineProperty(e,uh,{value:o,enumerable:false,configurable:false,writable:false}),o}a(FT,"getMonkeysProviderContexts");var Cd=FT(),si=Cd.locale,an=Cd.theme,xs=Cd.direction,Ra=Cd.environment;function ph(e,t){return t===void 0?e:e===void 0?t:{...e,...t,slots:e.slots||t.slots?{...e.slots,...t.slots}:void 0,styles:e.styles||t.styles?{...e.styles,...t.styles}:void 0}}a(ph,"mergeAppearance");function Co(){try{return ho.useContext(si)??{...ii,provided:!1}}catch{return {...ii,provided:false}}}a(Co,"useMonkeysLocale");function Ye(){return ho.useContext(si).messages}a(Ye,"useMonkeysLocaleMessages");function On(){return ho.useContext(an).resolvedTheme}a(On,"useMonkeysResolvedTheme");function Pe(e){let t=ho.useContext(an).baseAppearance;return ho.useMemo(()=>ph(t,e),[e,t])}a(Pe,"useMonkeysBaseAppearance");function mh(e){let t=ho.useContext(an).dataExplorerAppearance;return ho.useMemo(()=>ph(t,e),[e,t])}a(mh,"useMonkeysDataExplorerAppearance");function Wr(){return ho.useContext(an).statusStates??{}}a(Wr,"useMonkeysStatusStates");function Sd(){return ho.useContext(an).listFooter??{}}a(Sd,"useMonkeysListFooter");function li(){return ho.useContext(xs).direction}a(li,"useMonkeysDirection");function di(){return ho.useContext(Ra).environment}a(di,"useMonkeysEnvironment");function ci(){return ho.useContext(Ra).portal}a(ci,"useMonkeysPortalOptions");function ke(){let e=ho.useContext(si),t=ho.useContext(an),o=ho.useContext(xs),r=e.provided||t.provided||o.provided;return ho.useMemo(()=>r?{dir:o.direction,"data-monkeys-direction":o.direction,"data-monkeys-locale":e.locale,"data-monkeys-theme":t.themeId,"data-monkeys-theme-mode":t.resolvedTheme?.colorMode}:{},[o.direction,e.locale,r,t.resolvedTheme?.colorMode,t.themeId])}a(ke,"useMonkeysComponentAttributes");function am(){return ho.useContext(Ra).iconResolver}a(am,"useMonkeysAssetIconResolver");function fh(){return ho.useContext(Ra).imageResolver}a(fh,"useMonkeysAssetImageResolver");function bh(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}a(bh,"isRecord");function HT(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('MonkeysProvider direction must be "ltr" or "rtl".')}a(HT,"validateDirection");function VT(e){if(e!==void 0){if(!bh(e))throw new TypeError("MonkeysProvider environment must be an object.");if(e.getDocument!==void 0&&typeof e.getDocument!="function")throw new TypeError("MonkeysProvider environment.getDocument must be a function.");if(e.getWindow!==void 0&&typeof e.getWindow!="function")throw new TypeError("MonkeysProvider environment.getWindow must be a function.")}}a(VT,"validateEnvironment");function _T(e){if(e!==void 0){if(!bh(e))throw new TypeError("MonkeysProvider portal must be an object.");if(e.disabled!==void 0&&typeof e.disabled!="boolean")throw new TypeError("MonkeysProvider portal.disabled must be a boolean.");if(e.container!=null&&typeof e.container!="function"&&typeof e.container!="object")throw new TypeError("MonkeysProvider portal.container must be an Element, null, or a function.")}}a(_T,"validatePortal");function GT(e,t,o,r){return e?ys(e,{colorMode:t,density:o}):r}a(GT,"resolveProviderTheme");function gh({children:e,locale:t,messages:o,direction:r,theme:n,themeId:i,colorMode:s,density:l,appearance:d,environment:c,iconResolver:p,imageResolver:u,portal:g,statusStates:f,listFooter:b}){let x=ho.useContext(si),y=ho.useContext(an),k=ho.useContext(xs),w=ho.useContext(Ra);if(HT(r),VT(c),p!==void 0&&typeof p!="function")throw new TypeError("MonkeysProvider iconResolver must be a function.");if(u!==void 0&&typeof u!="function")throw new TypeError("MonkeysProvider imageResolver must be a function.");_T(g);let v=ho.useMemo(()=>wd(t,o,x),[t,o,x]),h=ho.useMemo(()=>({...v,provided:true}),[v]),S=ho.useMemo(()=>GT(n,s,l,y.resolvedTheme),[s,l,y.resolvedTheme,n]),T=ho.useMemo(()=>({provided:true,resolvedTheme:S,themeId:i??y.themeId,baseAppearance:{...y.baseAppearance,...d?.base,...l?{density:l}:void 0,slots:{...y.baseAppearance?.slots,...d?.base?.slots},styles:{...y.baseAppearance?.styles,...d?.base?.styles}},dataExplorerAppearance:{...y.dataExplorerAppearance,...d?.dataExplorer,...l?{density:l}:void 0,slots:{...y.dataExplorerAppearance?.slots,...d?.dataExplorer?.slots},styles:{...y.dataExplorerAppearance?.styles,...d?.dataExplorer?.styles}},statusStates:{...y.statusStates,...f,loading:{...y.statusStates?.loading,...f?.loading},empty:{...y.statusStates?.empty,...f?.empty},error:{...y.statusStates?.error,...f?.error},permission:{...y.statusStates?.permission,...f?.permission}},listFooter:{...y.listFooter,...b,...b?.pageSizeOptions?{pageSizeOptions:[...b.pageSizeOptions]}:void 0}}),[d?.base,d?.dataExplorer,l,y.baseAppearance,y.dataExplorerAppearance,y.statusStates,y.themeId,S,f,b,i]),C=ho.useMemo(()=>({provided:true,direction:r??k.direction??"ltr"}),[r,k.direction]),R=ho.useMemo(()=>({provided:true,iconResolver:p??w.iconResolver,imageResolver:u??w.imageResolver,environment:{...w.environment,...c},portal:{...w.portal,...g}}),[c,w.environment,w.iconResolver,p,u,w.imageResolver,w.portal,g]);return jsxRuntime.jsx(si.Provider,{value:h,children:jsxRuntime.jsx(an.Provider,{value:T,children:jsxRuntime.jsx(xs.Provider,{value:C,children:jsxRuntime.jsx(Ra.Provider,{value:R,children:e})})})})}a(gh,"MonkeysProvider");function m(...e){return tailwindMerge.twMerge(e.filter(Boolean).join(" "))}a(m,"cn");function V(e){return e!=null&&typeof e!="boolean"}a(V,"hasRenderableNode");function Rd(e){return typeof e=="string"?e.trim().length>0:V(e)}a(Rd,"hasNonEmptyRenderableNode");var QT={"bottom-start":{side:"bottom",align:"start"},"bottom-end":{side:"bottom",align:"end"},"top-start":{side:"top",align:"start"},"top-end":{side:"top",align:"end"}};function im(e,t=0){return e.flatMap(o=>[{...o,depth:t},...o.children?im(o.children,t+1):[]])}a(im,"flattenOptions");function ZT(e){let t=new Set;im(e).forEach(o=>{if(!o||typeof o!="object")throw new TypeError("UnifiedDropdown options must contain objects.");if(typeof o.value!="string"||!o.value.trim())throw new TypeError("UnifiedDropdown option value must be a non-empty string.");if(t.has(o.value))throw new TypeError(`UnifiedDropdown option value "${o.value}" must be unique.`);t.add(o.value);});}a(ZT,"validateOptions");function JT(e){let t=Array.isArray(e)?e:e===void 0?[]:[e];return [...new Set(t.filter(o=>typeof o=="string"))]}a(JT,"normalizeValues");function vh(e){return e.textValue?e.textValue:typeof e.label=="string"?e.label:e.value}a(vh,"getOptionText");function pi(e){return e==="multi"||e==="checkbox"}a(pi,"isMultiMode");function eN(e,t){return vh(e).toLocaleLowerCase().includes(t.toLocaleLowerCase())}a(eN,"matchesSearch");function xh(e,t,o){if(t!==void 0&&(pi(e)?!Array.isArray(t):typeof t!="string"))throw new TypeError(`UnifiedDropdown ${o} must be ${pi(e)?"a string array":"a string"} in ${e} mode.`)}a(xh,"validateValueShape");var wh=ho.forwardRef(a(function({mode:t,options:o=[],groups:r=[],value:n,defaultValue:i,placeholder:s="Select\u2026",trigger:l,triggerLabel:d,searchPlaceholder:c="Search\u2026",emptyLabel:p="No options",loadingLabel:u="Loading\u2026",clearLabel:g="Clear selection",retryLabel:f="Retry",loading:b=false,error:x,searchable:y=t==="searchable",clearable:k=false,maxSelections:w,disabled:v=false,invalid:h=false,open:S,defaultOpen:T=false,placement:C="bottom-start",closeOnSelect:R=t!=="multi"&&t!=="checkbox",portal:M=true,size:I="default",width:B="trigger",appearance:N,className:D,classNames:E,slots:P,style:W,onOpenChange:H,onValueChange:A,onSelect:L,onAction:F,onClear:G,onRetry:$,..._},z){if(!["single","multi","searchable","radio","checkbox","tree","action"].includes(t))throw new TypeError(`UnifiedDropdown mode "${String(t)}" is not supported.`);let re=ho.useMemo(()=>r.reduce((te,Te)=>{let ze=typeof Te.label=="string"?Te.label:Te.value;return te.push(...Te.options.map(je=>({...je,group:je.group??ze}))),te},[...o]),[r,o]);if(ZT(re),w!==void 0&&(!Number.isFinite(w)||w<0))throw new TypeError("UnifiedDropdown maxSelections must be a non-negative finite number.");if(t==="action"&&(n!==void 0||i!==void 0))throw new TypeError("UnifiedDropdown action mode does not accept a value.");t!=="action"&&(xh(t,n,"value"),xh(t,i,"defaultValue"));let Z=ho.useId(),ae=`${Z}-trigger`,ee=`${Z}-listbox`,q=`${Z}-search`,U=ho.useRef(null),X=ho.useRef([]),[O,K]=ho.useState(T),[ne,fe]=ho.useState(i??(pi(t)?[]:"")),[he,me]=ho.useState(""),[ie,be]=ho.useState(0),He=S!==void 0,We=He?S:O,Ke=JT(n??ne),ce=ho.useMemo(()=>im(re),[re]),Q=ho.useMemo(()=>y?ce.filter(te=>eN(te,he)):ce,[ce,he,y]),ge=ho.useMemo(()=>new Set(Ke),[Ke]),we=ce.filter(te=>ge.has(te.value)),Ie=we.map(vh).join(", "),oe=d??(Ie||s),xe=we.length===0&&!d,{side:Ve,align:_e}=QT[C],Ge=t==="action",le=t==="radio"||t==="checkbox",Me=Ge||le?"menu":"listbox";ho.useEffect(()=>{We&&be(0);},[We,he]);let Ae=a(te=>{v||(He||K(te),H?.(te));},"setOpen"),J=a(te=>{n===void 0&&fe(te),A?.(te);},"commitValue"),$e=a(te=>{if(!(v||te.disabled)){if(L?.(te),t==="action"){R&&Ae(false),F&&queueMicrotask(()=>F(te));return}if(pi(t)){let Te=ge.has(te.value)?Ke.filter(ze=>ze!==te.value):w!==void 0&&Ke.length>=w?Ke:[...Ke,te.value];J(Te);}else J(te.value);R&&!pi(t)&&Ae(false);}},"selectOption"),ue=a(te=>{if(!v&&(te.key==="ArrowDown"||te.key==="ArrowUp")){te.preventDefault(),We||Ae(true);let Te=te.key==="ArrowDown"?1:-1;be(ze=>Math.max(0,Math.min(Q.length-1,ze+Te)));}},"handleTriggerKeyDown"),Re=a(te=>{if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();let Te=te.key==="ArrowDown"?1:-1;be(ze=>{let je=ze+Te;return Math.max(0,Math.min(Q.length-1,je))});}te.key==="Enter"&&Q[ie]&&(te.preventDefault(),$e(Q[ie]));},"handleContentKeyDown");ho.useEffect(()=>{We&&X.current[ie]?.scrollIntoView({block:"nearest"});},[ie,We]);let se=a(()=>{J(pi(t)?[]:""),G?.();},"clearSelection");return jsxRuntime.jsx(Hn__namespace.Root,{open:We,onOpenChange:Ae,children:jsxRuntime.jsxs("div",{..._,ref:z,className:m("relative inline-flex min-w-0",D),style:W,"data-monkeys-component":"unified-dropdown","data-mode":t,"data-state":We?"open":"closed","data-invalid":h||void 0,"data-disabled":v||void 0,"data-appearance-preset":N?.preset,"data-appearance-variant":N?.variant,"data-appearance-density":N?.density,"data-appearance-radius":N?.radius,children:[jsxRuntime.jsx(Hn__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{ref:U,id:ae,type:"button",disabled:v,"aria-expanded":We,"aria-haspopup":Ge||le?"menu":"listbox","aria-controls":We?ee:void 0,"aria-invalid":h||void 0,onKeyDown:ue,className:m("flex min-w-0 items-center justify-between gap-2 rounded-md border border-input bg-control-surface px-3 text-left text-sm text-foreground shadow-sm outline-hidden transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-control-surface","disabled:cursor-not-allowed disabled:opacity-50",I==="sm"?"h-8 py-1 text-xs":"h-10 py-2",h&&"border-destructive focus-visible:ring-destructive",B==="responsive"&&"w-full sm:w-auto",E?.trigger),children:[l?jsxRuntime.jsx("span",{className:"min-w-0 shrink-0",children:l}):null,jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",xe&&"text-muted-foreground"),children:oe}),jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 opacity-60"})]})}),(()=>{let te=jsxRuntime.jsxs(Hn__namespace.Content,{id:ee,side:Ve,align:_e,sideOffset:6,collisionPadding:8,avoidCollisions:true,onKeyDown:Re,onOpenAutoFocus:Te=>{Te.preventDefault(),(y?document.getElementById(q):X.current[0])?.focus();},tabIndex:-1,className:m("z-50 max-h-[min(24rem,calc(100vh-1rem))] max-w-[calc(100vw-1rem)] overflow-y-auto rounded-md border bg-menu-surface p-1 text-popover-foreground shadow-md outline-hidden",B==="trigger"&&"w-[var(--radix-popover-trigger-width)] min-w-[12rem]",B==="content"&&"min-w-[12rem] max-w-[min(32rem,calc(100vw-1rem))]",B==="responsive"&&"w-[min(var(--radix-popover-trigger-width),calc(100vw-1rem))] min-w-[12rem]",E?.content),children:[y?jsxRuntime.jsxs("div",{className:"relative mb-1",children:[jsxRuntime.jsx(lucideReact.Search,{"aria-hidden":"true",className:"pointer-events-none absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),jsxRuntime.jsx("input",{id:q,value:he,onChange:Te=>me(Te.target.value),placeholder:c,"aria-label":c,className:m("h-9 w-full rounded-sm border-0 bg-transparent pl-8 pr-2 text-sm outline-hidden ring-0 placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring",E?.search)})]}):null,k&&we.length>0?jsxRuntime.jsx("button",{type:"button",className:"mb-1 w-full rounded-sm px-2 py-1 text-left text-xs text-muted-foreground hover:bg-accent",onClick:se,children:g}):null,b&&Q.length===0?P?.loading?P.loading():jsxRuntime.jsx("div",{role:"status",className:m("px-2 py-6 text-center text-sm text-muted-foreground",E?.empty),children:u}):x&&Q.length===0?P?.error?P.error():jsxRuntime.jsxs("div",{role:"alert",className:m("px-2 py-6 text-center text-sm text-destructive-text",E?.empty),children:[x,$?jsxRuntime.jsx("button",{type:"button",className:"mt-2 block w-full text-center text-foreground underline",onClick:$,children:f}):null]}):Q.length===0?P?.empty?P.empty():jsxRuntime.jsx("div",{role:"status",className:m("px-2 py-6 text-center text-sm text-muted-foreground",E?.empty),children:p}):jsxRuntime.jsx("div",{role:t==="tree"?"tree":Me,"aria-multiselectable":t==="multi"||void 0,children:Q.map((Te,ze)=>{let je=ge.has(Te.value),it=t==="radio"?jsxRuntime.jsx(lucideReact.Circle,{"aria-hidden":"true",className:m("h-3.5 w-3.5",je&&"fill-current")}):jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"});return jsxRuntime.jsxs("div",{children:[Te.group&&(ze===0||Q[ze-1]?.group!==Te.group)?jsxRuntime.jsx("div",{role:"presentation",className:m("px-2 pb-1 pt-2 text-xs font-medium text-muted-foreground",E?.groupLabel),children:Te.group}):null,jsxRuntime.jsxs("button",{ref:Y=>{X.current[ze]=Y;},type:"button",role:t==="tree"?"treeitem":t==="radio"?"menuitemradio":t==="checkbox"?"menuitemcheckbox":Ge?"menuitem":"option","aria-level":t==="tree"?Te.depth+1:void 0,"aria-selected":!Ge&&!le?je:void 0,"aria-checked":le?je:void 0,disabled:Te.disabled,"data-highlighted":ze===ie||void 0,"data-state":je?"checked":"unchecked",onMouseEnter:()=>be(ze),onClick:()=>$e(Te),className:m("relative flex min-h-9 w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-hidden transition-colors","hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",ze===ie&&"bg-accent text-accent-foreground",je&&"font-medium",Te.danger&&"text-destructive-text",t!=="action"&&"pl-8",E?.item),style:t==="tree"?{paddingInlineStart:`${8+Te.depth*16}px`}:void 0,children:[t!=="action"?jsxRuntime.jsx("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:je?it:null}):null,P?.option?P.option({option:Te,selected:je,highlighted:ze===ie}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Te.icon?jsxRuntime.jsx("span",{className:"shrink-0",children:Te.icon}):null,jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",E?.itemLabel),children:Te.label}),Te.description?jsxRuntime.jsx("span",{className:m("max-w-[45%] truncate text-xs text-muted-foreground",E?.itemDescription),children:Te.description}):null]})]})]},Te.value)})}),x&&Q.length>0?jsxRuntime.jsx("div",{role:"status",className:"px-2 py-1 text-xs text-destructive-text",children:x}):null,b&&Q.length>0?jsxRuntime.jsx("div",{role:"status",className:"px-2 py-1 text-xs text-muted-foreground",children:u}):null,P?.footer?P.footer():null]});return M?jsxRuntime.jsx(Hn__namespace.Portal,{children:te}):te})()]})})},"UnifiedDropdown"));var kh=ho.createContext(void 0);function Ch({appearance:e,children:t}){return jsxRuntime.jsx(kh.Provider,{value:e,children:t})}a(Ch,"DataExplorerAppearanceProvider");function Et(e){let t=ho.useContext(kh);return ho.useMemo(()=>e?t?{...t,...e,slots:{...t.slots,...e.slots},styles:{...t.styles,...e.styles}}:e:t,[e,t])}a(Et,"useDataExplorerAppearance");function j(...e){return e.filter(Boolean).join(" ")}a(j,"cn");function Mt(e,t){return typeof e=="function"?e(t):e}a(Mt,"resolveDataExplorerValue");var iN={},Th={surfaceRoot:"relative flex h-full min-h-0 w-full min-w-0 overflow-hidden rounded-md border border-border bg-background shadow-sm",toolbarRoot:"flex flex-wrap items-center gap-2 border-b border-border bg-background px-4 py-3",toolbarLeading:"flex items-center gap-2",toolbarSearch:"flex h-10 min-w-52 flex-1 items-center gap-2 rounded-md border border-border bg-background px-3 text-sm",toolbarSearchIcon:"inline-flex shrink-0 text-muted-foreground",toolbarSearchInput:"min-w-0 flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground",toolbarViewSwitch:"flex items-center rounded-md border border-border bg-background p-0.5",toolbarViewButton:"inline-flex h-9 min-w-9 items-center justify-center gap-2 rounded-md px-2 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50",toolbarViewButtonActive:"bg-muted text-foreground",toolbarActions:"flex items-center gap-2",actionBarRoot:"flex min-w-0 flex-wrap items-center gap-2",actionBarLeading:"flex shrink-0 items-center gap-2",actionBarActions:"flex min-w-0 flex-1 flex-wrap items-center gap-2",actionBarTrailing:"flex shrink-0 items-center gap-2",actionButtonBase:"inline-flex h-9 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",actionButtonDefault:"border-border bg-background text-foreground hover:bg-accent/60",actionButtonPrimary:"border-primary/20 bg-primary/10 text-primary hover:bg-primary/15",actionButtonDanger:"border-destructive/20 bg-destructive/10 text-destructive-text hover:bg-destructive/15",actionButtonMuted:"border-border/60 bg-muted/45 text-muted-foreground hover:bg-muted/70 hover:text-foreground",actionButtonActive:"ring-1 ring-primary/30",actionButtonDisabled:"cursor-not-allowed opacity-60",actionIconButton:"w-9 px-0",actionToggleActive:"border-primary/30 bg-primary/10 text-primary",controlButton:"inline-flex h-10 min-w-0 items-center justify-center gap-2 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlButtonIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current [&_svg_*]:!stroke-current",controlButtonLabel:"min-w-0 truncate",controlSelectTrigger:"inline-flex h-10 min-w-28 items-center justify-between gap-3 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlSelectValue:"flex min-w-0 items-center gap-1 truncate",controlCheckbox:"inline-flex h-9 items-center gap-2 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlCheckboxIndicator:"flex h-4 w-4 shrink-0 items-center justify-center rounded border border-border bg-background text-primary",controlCheckboxLabel:"min-w-0 truncate",menuTrigger:"inline-flex h-8 w-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",menuContent:"z-50 min-w-36 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-hidden",menuLabel:"px-2 py-1.5 text-xs font-medium text-muted-foreground",menuSeparator:"-mx-1 my-1 h-px bg-border",menuItem:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",menuItemPrimary:"text-primary focus:text-primary",menuItemDanger:"text-destructive-text focus:text-destructive-text",menuItemMuted:"text-muted-foreground",menuItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",menuItemLabel:"truncate",cardRoot:"group relative flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background transition-shadow",cardInteractive:"cursor-pointer hover:shadow-sm",cardSelected:"ring-2 ring-primary",cardDisabled:"opacity-60",cardHeader:"p-4",cardMedia:"shrink-0 overflow-hidden",cardFooter:"shrink-0 border-t border-border/60 px-4 py-3",recordCardRoot:"group relative border-border/70 transition-shadow hover:shadow-sm",recordCardActive:"z-10 ring-2 ring-monkeys-500",footerRoot:"flex items-center border-t border-border bg-background px-4 py-3",footerSummary:"flex items-center gap-1 whitespace-nowrap text-sm text-muted-foreground",footerJumpButton:"inline-flex items-center gap-1 text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",footerPageSizeSelect:"h-8 rounded-md border border-border bg-background px-2 text-sm text-foreground",previewRoot:"relative h-full min-h-0 w-full flex-1 select-none self-stretch overflow-hidden bg-slate-950",previewPlaceholder:"flex h-full w-full items-center justify-center rounded-xl bg-white/5 px-6 text-center text-sm text-white/60",previewActions:"absolute right-4 top-4 z-20 flex flex-col gap-2",previewControls:"absolute bottom-4 right-4 z-20 flex flex-col gap-2",previewZoomLabel:"min-w-[3rem] rounded-full border border-white/15 bg-black/30 px-1 py-1 text-center text-xs font-medium text-white/70 shadow-lg backdrop-blur",previewControlButton:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur transition hover:bg-black/45",previewNavigationButton:"absolute top-1/2 flex h-10 w-10 -translate-y-1/2 items-center justify-center rounded-full border border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur transition-colors hover:bg-black/45 disabled:pointer-events-none disabled:opacity-40",detailRoot:"flex h-full flex-col overflow-hidden bg-background",detailHeader:"flex items-center justify-between gap-3 border-b border-border bg-background px-4 py-4 sm:px-5",detailLeading:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",detailNavigation:"hidden items-center gap-1 rounded-lg border border-border bg-background px-1 py-1 md:flex",detailNavigationButton:"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",detailCloseButton:"flex h-10 w-10 items-center justify-center rounded-full border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",detailPreviewPanel:"min-h-0 overflow-hidden border-b border-border bg-background xl:border-b-0",detailPreviewFrame:"relative h-full min-h-0 w-full overflow-hidden bg-background",detailRightPanel:"min-h-0 min-w-0 border-t border-border bg-background xl:border-l xl:border-t-0",detailRightPanelBody:"h-full overflow-y-auto overscroll-contain bg-background p-5",treeShellRoot:"flex h-full min-h-0 flex-col overflow-hidden",treeShellHeader:"flex shrink-0 items-start justify-between gap-3 px-4 py-3",treeShellTitle:"truncate text-sm font-semibold",treeShellSubtitle:"mt-1 text-sm text-muted-foreground",treeShellToolbar:"flex shrink-0 items-center gap-2",treeShellBody:"min-h-0 flex-1 overflow-hidden",treeShellFooter:"shrink-0",treeRoot:"min-w-0 space-y-1 overflow-hidden text-sm",treeGroup:"min-w-0 space-y-1",treeGroupHeader:"group/tree-group flex min-w-0 items-center gap-1",treeGroupHeaderButton:"flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-left font-medium text-muted-foreground transition-colors hover:bg-accent/55 hover:text-foreground",treeGroupContent:"min-w-0 space-y-0.5",treeGroupActions:"shrink-0 opacity-0 transition-opacity group-hover/tree-group:opacity-100 data-[state=open]:opacity-100",treeNode:"min-w-0",treeNodeButton:"group/tree-node flex min-h-9 w-full min-w-0 items-center gap-1 rounded-md pr-1 text-left text-sm text-foreground transition-colors hover:bg-accent/55 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",treeNodeSelected:"bg-accent text-accent-foreground",treeNodeDisabled:"cursor-not-allowed opacity-55",treeNodeDragging:"opacity-50",treeNodeToggle:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",treeNodeIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground group-hover/tree-node:text-foreground",treeNodeLabel:"min-w-0 truncate",treeNodeDescription:"mt-0.5 truncate text-xs text-muted-foreground",treeNodeMeta:"ml-2 shrink-0 text-xs text-muted-foreground",treeNodeBadge:"ml-2 shrink-0 rounded-full border border-border bg-muted px-1.5 py-0.5 text-[11px] leading-none text-muted-foreground",treeNodeActions:"ml-1 shrink-0 opacity-0 transition-opacity group-hover/tree-node:opacity-100 data-[state=open]:opacity-100",treeNodeChildren:"mt-0.5 min-w-0 space-y-0.5",treeNodeDragHandle:"inline-flex h-5 w-5 shrink-0 cursor-grab items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground active:cursor-grabbing group-hover/tree-node:opacity-100",treeEmpty:"px-3 py-2 text-xs text-muted-foreground",treeError:"px-3 py-2 text-xs text-destructive-text",treeLoading:"px-3 py-2 text-xs text-muted-foreground"},sN={flush:{surfaceRoot:"relative flex h-full min-h-0 w-full min-w-0 overflow-hidden"}},lN={compact:{treeShellHeader:"px-3 py-2",toolbarRoot:"px-3 py-2",toolbarSearch:"h-9 min-w-48",toolbarViewButton:"h-8 min-w-8 text-xs",actionButtonBase:"h-8 px-2.5 text-xs",actionIconButton:"h-8 w-8 px-0",controlButton:"h-9 px-2.5 text-xs",controlSelectTrigger:"h-9 min-w-24 px-2.5 text-xs",controlCheckbox:"h-8 px-2.5 text-xs",menuTrigger:"h-8 w-8",footerRoot:"px-3 py-2",footerPageSizeSelect:"h-8 text-xs",treeGroupHeaderButton:"h-8 text-xs",treeNodeButton:"min-h-8 text-xs",treeEmpty:"py-1.5 text-xs",treeError:"py-1.5 text-xs",treeLoading:"py-1.5 text-xs"},default:{},comfortable:{treeShellHeader:"px-5 py-4",toolbarRoot:"px-5 py-4",toolbarSearch:"h-11",toolbarViewButton:"h-10 min-w-10",actionButtonBase:"h-10 px-3.5",actionIconButton:"h-10 w-10 px-0",controlButton:"h-11 px-3.5",controlSelectTrigger:"h-11 min-w-32 px-3.5",controlCheckbox:"h-10 px-3.5",menuTrigger:"h-9 w-9",footerRoot:"px-5 py-3.5",treeGroupHeaderButton:"h-10",treeNodeButton:"min-h-10"}},dN={none:{surfaceRoot:"rounded-none",toolbarSearch:"rounded-none",toolbarViewSwitch:"rounded-none",toolbarViewButton:"rounded-none",actionButtonBase:"rounded-none",controlButton:"rounded-none",controlSelectTrigger:"rounded-none",controlCheckbox:"rounded-none",controlCheckboxIndicator:"rounded-none",menuTrigger:"rounded-none",menuContent:"rounded-none",menuItem:"rounded-none",cardRoot:"rounded-none",footerPageSizeSelect:"rounded-none",detailLeading:"rounded-none",detailNavigation:"rounded-none",detailNavigationButton:"rounded-none",detailCloseButton:"rounded-none",treeGroupHeaderButton:"rounded-none",treeNodeButton:"rounded-none",treeNodeToggle:"rounded-none",treeNodeBadge:"rounded-none",treeNodeDragHandle:"rounded-none"},sm:{surfaceRoot:"rounded-sm",toolbarSearch:"rounded-sm",toolbarViewSwitch:"rounded-sm",toolbarViewButton:"rounded-sm",actionButtonBase:"rounded-sm",controlButton:"rounded-sm",controlSelectTrigger:"rounded-sm",controlCheckbox:"rounded-sm",controlCheckboxIndicator:"rounded-sm",menuTrigger:"rounded-sm",menuContent:"rounded-sm",menuItem:"rounded-sm",cardRoot:"rounded-sm",treeGroupHeaderButton:"rounded-sm",treeNodeButton:"rounded-sm",treeNodeToggle:"rounded-sm",treeNodeBadge:"rounded-sm",treeNodeDragHandle:"rounded-sm"},md:{},lg:{surfaceRoot:"rounded-xl",toolbarSearch:"rounded-lg",toolbarViewSwitch:"rounded-lg",toolbarViewButton:"rounded-lg",actionButtonBase:"rounded-lg",controlButton:"rounded-lg",controlSelectTrigger:"rounded-lg",controlCheckbox:"rounded-lg",controlCheckboxIndicator:"rounded-md",menuTrigger:"rounded-lg",menuContent:"rounded-lg",cardRoot:"rounded-xl",treeGroupHeaderButton:"rounded-lg",treeNodeButton:"rounded-lg",treeNodeToggle:"rounded-md",treeNodeBadge:"rounded-lg",treeNodeDragHandle:"rounded-md"},xl:{surfaceRoot:"rounded-2xl",toolbarSearch:"rounded-xl",toolbarViewSwitch:"rounded-xl",toolbarViewButton:"rounded-xl",actionButtonBase:"rounded-xl",controlButton:"rounded-xl",controlSelectTrigger:"rounded-xl",controlCheckbox:"rounded-xl",controlCheckboxIndicator:"rounded-lg",menuTrigger:"rounded-xl",menuContent:"rounded-xl",cardRoot:"rounded-2xl",treeGroupHeaderButton:"rounded-xl",treeNodeButton:"rounded-xl",treeNodeToggle:"rounded-lg",treeNodeBadge:"rounded-xl",treeNodeDragHandle:"rounded-lg"},full:{surfaceRoot:"rounded-2xl",toolbarSearch:"rounded-full",toolbarViewSwitch:"rounded-full",toolbarViewButton:"rounded-full",actionButtonBase:"rounded-full",controlButton:"rounded-full",controlSelectTrigger:"rounded-full",controlCheckbox:"rounded-full",controlCheckboxIndicator:"rounded-full",menuTrigger:"rounded-full",cardRoot:"rounded-2xl",treeGroupHeaderButton:"rounded-full",treeNodeButton:"rounded-full",treeNodeToggle:"rounded-full",treeNodeBadge:"rounded-full",treeNodeDragHandle:"rounded-full"}},cN={none:{surfaceRoot:"border-transparent",toolbarRoot:"border-transparent",toolbarSearch:"border-transparent",toolbarViewSwitch:"border-transparent",actionButtonBase:"border-transparent",controlButton:"border-transparent",controlSelectTrigger:"border-transparent",controlCheckbox:"border-transparent",cardRoot:"border-transparent",footerRoot:"border-transparent",detailHeader:"border-transparent",detailPreviewPanel:"border-transparent",detailRightPanel:"border-transparent"},subtle:{surfaceRoot:"border-border/60",toolbarRoot:"border-border/60",toolbarSearch:"border-border/60",toolbarViewSwitch:"border-border/60",actionButtonDefault:"border-border/60",controlButton:"border-border/60",controlSelectTrigger:"border-border/60",controlCheckbox:"border-border/60",cardRoot:"border-border/60",footerRoot:"border-border/60"},solid:{},strong:{surfaceRoot:"border-foreground/20",toolbarRoot:"border-foreground/20",toolbarSearch:"border-foreground/20",toolbarViewSwitch:"border-foreground/20",actionButtonDefault:"border-foreground/20",controlButton:"border-foreground/20",controlSelectTrigger:"border-foreground/20",controlCheckbox:"border-foreground/20",cardRoot:"border-foreground/20",footerRoot:"border-foreground/20"}},uN={plain:{},muted:{surfaceRoot:"bg-card",toolbarRoot:"bg-muted/20",toolbarSearch:"bg-background",toolbarViewSwitch:"bg-background",controlButton:"bg-background",controlSelectTrigger:"bg-background",controlCheckbox:"bg-background",cardRoot:"bg-card",footerRoot:"bg-muted/20",detailHeader:"bg-muted/20"},soft:{surfaceRoot:"bg-background/95 shadow-sm",toolbarRoot:"bg-background/95",actionButtonDefault:"bg-muted/30 hover:bg-muted/55",controlButton:"bg-muted/30 hover:bg-muted/55",controlSelectTrigger:"bg-muted/30 hover:bg-muted/55",controlCheckbox:"bg-muted/30 hover:bg-muted/55",cardRoot:"bg-background/95 shadow-sm",footerRoot:"bg-background/95"},glass:{surfaceRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",toolbarRoot:"border-white/10 bg-white/5 backdrop-blur-md",toolbarSearch:"border-white/10 bg-white/5",toolbarViewSwitch:"border-white/10 bg-white/5",actionButtonDefault:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlButton:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlSelectTrigger:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlCheckbox:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlCheckboxIndicator:"border-white/15 bg-white/10",cardRoot:"border-white/10 bg-white/[0.06] shadow-none",footerRoot:"border-white/10 bg-white/5 backdrop-blur-md"},"dark-stage":{previewRoot:"bg-slate-950",previewPlaceholder:"bg-white/5 text-white/60",actionButtonBase:"inline-flex h-9 items-center justify-center gap-2 rounded-full border px-3 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-white/45 focus-visible:ring-offset-0",actionButtonDefault:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlButton:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlSelectTrigger:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlCheckbox:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",actionButtonPrimary:"border-white/25 bg-white/20 text-white shadow-lg backdrop-blur hover:bg-white/28",actionButtonMuted:"border-white/10 bg-black/20 text-white/70 shadow-lg backdrop-blur hover:bg-black/[0.35] hover:text-white",actionIconButton:"h-9 w-9 px-0"}},Sh={default:{density:"default",radius:"md",border:"solid",background:"plain"},soft:{density:"default",radius:"md",border:"subtle",background:"plain"},compact:{density:"compact",radius:"md",border:"subtle",background:"soft"},"tinted-glass":{density:"default",radius:"lg",border:"subtle",background:"glass"},flat:{density:"compact",radius:"none",border:"solid",background:"plain"},glass:{density:"default",radius:"lg",border:"subtle",background:"glass"},"hard-edge":{density:"compact",radius:"none",border:"solid",background:"plain"}},pN={soft:{actionButtonBase:"font-medium",controlButton:"font-medium",controlSelectTrigger:"font-medium",controlCheckbox:"font-medium",menuTrigger:"rounded-full",cardRoot:"border-border/70"},compact:{toolbarRoot:"gap-2",actionButtonBase:"text-xs",controlButton:"text-xs",controlSelectTrigger:"text-xs",controlCheckbox:"text-xs",footerRoot:"text-xs"},"tinted-glass":{actionButtonDefault:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",actionButtonPrimary:"border-primary/30 bg-primary/15 text-primary-foreground hover:bg-primary/20",actionButtonMuted:"border-border/50 bg-muted/20 text-muted-foreground hover:bg-muted/45 hover:text-foreground",controlButton:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlSelectTrigger:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlCheckbox:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlCheckboxIndicator:"border-border/60 bg-background/10 text-primary",menuContent:"border-border bg-popover text-popover-foreground shadow-2xl",menuSeparator:"bg-border",menuItem:"focus:bg-accent focus:text-accent-foreground",cardSelected:"ring-2 ring-primary",previewRoot:"bg-background",treeGroupHeaderButton:"text-muted-foreground hover:bg-accent/60 hover:text-foreground",treeNodeButton:"text-foreground hover:bg-accent/60 hover:text-accent-foreground focus-visible:ring-ring",treeNodeSelected:"bg-accent text-accent-foreground",treeNodeToggle:"text-muted-foreground hover:bg-accent hover:text-foreground",treeNodeIcon:"text-muted-foreground group-hover/tree-node:text-foreground",treeNodeMeta:"text-muted-foreground",treeNodeBadge:"border-border bg-muted text-muted-foreground",treeNodeActions:"text-muted-foreground",treeNodeDragHandle:"text-muted-foreground hover:bg-accent hover:text-foreground group-hover/tree-node:opacity-100",treeEmpty:"text-muted-foreground",treeError:"text-destructive-text",treeLoading:"text-muted-foreground"},flat:{toolbarRoot:"border-slate-200 bg-white",toolbarSearch:"rounded-none border-slate-200 bg-white shadow-none",toolbarViewSwitch:"rounded-none border-slate-200 bg-white shadow-none",actionButtonBase:"rounded-none shadow-none",controlButton:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",controlSelectTrigger:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",controlCheckbox:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",actionButtonDefault:"border-slate-200 bg-white text-slate-700 hover:bg-slate-50",menuTrigger:"rounded-none border border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",menuContent:"rounded-none border-slate-200 bg-white shadow-none",cardRoot:"rounded-none border-slate-200 bg-white shadow-none",footerRoot:"border-slate-200 bg-white",treeRoot:"space-y-1 text-sm",treeGroupHeader:"group/tree-group flex min-w-0 items-center",treeGroupHeaderButton:"h-9 rounded-none px-3 text-slate-600 shadow-none hover:bg-slate-100 hover:text-slate-950",treeGroupContent:"space-y-1",treeNodeButton:"min-h-9 rounded-none text-slate-700 hover:bg-slate-100 hover:text-slate-950 focus-visible:ring-slate-300",treeNodeSelected:"bg-slate-100 text-slate-950",treeNodeToggle:"rounded-none text-slate-500 hover:bg-transparent hover:text-slate-950",treeNodeIcon:"text-slate-500 group-hover/tree-node:text-slate-950",treeNodeDragHandle:"rounded-none text-slate-400 hover:bg-transparent hover:text-slate-700",treeNodeActions:"text-slate-500"},glass:{menuContent:"border-white/10 bg-slate-950/90 text-white backdrop-blur-xl",menuSeparator:"bg-white/10",menuItem:"focus:bg-white/10 focus:text-white"},"hard-edge":{toolbarRoot:"border-slate-200 bg-white",actionButtonBase:"rounded-none shadow-none",controlButton:"rounded-none shadow-none",controlSelectTrigger:"rounded-none shadow-none",controlCheckbox:"rounded-none shadow-none",cardRoot:"rounded-none border-slate-200 bg-white shadow-none",footerRoot:"border-slate-200 bg-white",footerPageSizeSelect:"rounded-none border-slate-200 shadow-none"}},mN=Object.keys(Th);function fN(...e){return mN.reduce((t,o)=>(t[o]=j(...e.map(r=>r?.[o])),t),{})}a(fN,"mergeSlots");function bN(...e){return e.reduce((t,o)=>({...t,...o}),{})}a(bN,"mergeStyles");function gN(e){let t=Sh[e];if(!t)throw new TypeError(`Unknown Data Explorer theme preset "${String(e)}". Expected one of: ${Object.keys(Sh).join(", ")}.`);return t}a(gN,"getPresetDefaults");function Ct(e){let t=e?.preset??"default",o=e?.surface??"card",r=gN(t),n=e?.density??r.density??"default",i=e?.radius??r.radius??"md",s=e?.border??r.border??"solid",l=e?.background??r.background??"plain",d=fN(Th,pN[t],lN[n],dN[i],cN[s],uN[l],e?.slots);return o==="flush"&&(d.surfaceRoot=j(sN.flush.surfaceRoot,e?.slots?.surfaceRoot)),{surface:o,preset:t,density:n,radius:i,border:s,background:l,styles:bN(iN,e?.styles),slots:d}}a(Ct,"resolveDataExplorerAppearance");function Dd(e,t,o){return j(t==="primary"?e.slots.actionButtonPrimary:t==="danger"?e.slots.actionButtonDanger:t==="muted"?e.slots.actionButtonMuted:e.slots.actionButtonDefault,o&&e.slots.actionButtonActive)}a(Dd,"getDataExplorerActionToneClassName");function Vn(e,t){if(t==="primary")return e.slots.menuItemPrimary;if(t==="danger")return e.slots.menuItemDanger;if(t==="muted")return e.slots.menuItemMuted}a(Vn,"getDataExplorerMenuItemToneClassName");function yN(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4 animate-spin",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(yN,"LoadingIcon");var vs=ho.forwardRef(a(function({children:t,label:o,icon:r,endIcon:n,type:i="button",title:s,ariaLabel:l,tone:d,active:c=false,iconOnly:p=false,disabled:u=false,loading:g=false,stopPropagation:f=false,appearance:b,className:x,classNames:y,style:k,onClick:w,"aria-label":v,...h},S){let T=Ct(Et(b)),C=t??o,R=u||g,M=a(I=>{f&&I.stopPropagation(),!R&&w?.(I);},"handleClick");return jsxRuntime.jsxs("button",{...h,ref:S,type:i,title:s,"aria-label":l??v,"aria-pressed":c||void 0,"aria-busy":g||void 0,disabled:R,className:j(T.slots.controlButton,p&&T.slots.actionIconButton,Dd(T,d,c),R&&T.slots.actionButtonDisabled,y?.root,x),style:{...T.styles.control,...c?T.styles.controlActive:void 0,...R?T.styles.controlDisabled:void 0,...k},onClick:M,children:[g?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:jsxRuntime.jsx(yN,{})}):r?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:r}):null,p?jsxRuntime.jsx("span",{className:"sr-only",children:C}):C?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonLabel,y?.label),children:C}):null,n?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:n}):null]})},"DataExplorerButton"));function xN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",children:jsxRuntime.jsx("path",{d:"m5 12 4 4L19 6"})})}a(xN,"CheckIcon");function Pd({checked:e=false,icon:t,label:o,title:r,disabled:n=false,appearance:i,className:s,classNames:l,style:d,onCheckedChange:c}){let p=Ct(Et(i));return jsxRuntime.jsxs("button",{type:"button",title:r,"aria-pressed":e,disabled:n,className:j(p.slots.controlCheckbox,e&&p.slots.actionToggleActive,n&&p.slots.actionButtonDisabled,l?.root,s),style:{...p.styles.control,...e?p.styles.controlActive:void 0,...n?p.styles.controlDisabled:void 0,...d},onClick:u=>{u.stopPropagation(),!n&&c?.(!e);},children:[jsxRuntime.jsx("span",{className:j(p.slots.controlCheckboxIndicator,l?.indicator,t!=null&&!e&&l?.icon),children:e?jsxRuntime.jsx(xN,{}):t}),o?jsxRuntime.jsx("span",{className:j(p.slots.controlCheckboxLabel,l?.label),children:o}):null]})}a(Pd,"DataExplorerCheckbox");function wN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(wN,"ChevronDownIcon");function kN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m5 12 4 4L19 6"})})}a(kN,"CheckIcon");function Ad({value:e="",options:t=[],label:o,placeholder:r="Select",icon:n,title:i,triggerLabel:s,disabled:l=false,display:d="value",align:c="start",sideOffset:p=6,appearance:u,className:g,classNames:f,style:b,onValueChange:x}){let y=Ct(Et(u)),k=t.find(v=>v.value===e),w=d==="label-value"&&o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:k?.label??r})]}):k?.label??o??r;return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{type:"button",title:i,"aria-label":s,disabled:l||t.length===0,className:j(y.slots.controlSelectTrigger,f?.trigger,f?.root,g),style:{...y.styles.control,...b},onClick:v=>v.stopPropagation(),children:[n?jsxRuntime.jsx("span",{className:j(y.slots.controlButtonIcon,f?.icon),children:n}):null,jsxRuntime.jsx("span",{className:j(y.slots.controlSelectValue,f?.value),children:w}),jsxRuntime.jsx(wN,{})]})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{align:c,sideOffset:p,className:j(y.slots.menuContent,f?.content),style:y.styles.menuContent,onClick:v=>v.stopPropagation(),children:jsxRuntime.jsx(Bt__namespace.RadioGroup,{value:e,onValueChange:v=>{l||x?.(v);},children:t.map(v=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{value:v.value,title:v.title,disabled:v.disabled,className:j(y.slots.menuItem,f?.item),style:y.styles.menuItem,children:[jsxRuntime.jsx("span",{className:j(y.slots.menuItemIcon,f?.itemIcon),children:v.value===e?jsxRuntime.jsx(kN,{}):v.icon}),jsxRuntime.jsx("span",{className:j(y.slots.menuItemLabel,f?.itemLabel),children:v.label})]},v.value))})})})]})}a(Ad,"DataExplorerSelect");function SN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(SN,"ChevronDownIcon");function sm(e,t){return Mt(e.disabled,t)??Mt(e.loading,t)??false}a(sm,"resolveActionDisabled");function TN(e){return e.onAction??e.onClick}a(TN,"getActionCallback");function NN(e,t,o,r){let n=(Mt(e.disabled,t)??false)||(Mt(e.loading,t)??false),i=Mt(e.active,t)??false;return jsxRuntime.jsxs("div",{children:[e.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:e.title,disabled:n,className:j(o.slots.menuItem,Vn(o,e.tone),i&&"bg-accent text-accent-foreground",r),style:o.styles.menuItem,onSelect:()=>{!e.onAction||n||e.onAction(t);},children:[e.icon?jsxRuntime.jsx("span",{className:o.slots.menuItemIcon,children:e.icon}):null,jsxRuntime.jsx("span",{className:o.slots.menuItemLabel,children:e.label})]}),e.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator}):null]},e.id)}a(NN,"renderMenuItem");function RN(e,t,o,r,n){let i=sm(e,t),s=Mt(e.active,t)??false,l=(e.items??[]).filter(d=>Mt(d.visible,t)??true);return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(vs,{title:e.title,ariaLabel:e.triggerLabel,disabled:i||l.length===0,label:e.label,icon:e.icon,endIcon:jsxRuntime.jsx(SN,{}),tone:e.tone,active:s,stopPropagation:true,appearance:n,className:r?.action})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:e.align??"end",sideOffset:e.sideOffset??6,className:j(o.slots.menuContent,r?.menuContent),style:o.styles.menuContent,onClick:d=>d.stopPropagation(),children:[e.menuLabel?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Bt__namespace.Label,{className:o.slots.menuLabel,children:e.menuLabel}),jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator})]}):null,l.map(d=>NN(d,t,o,r?.menuItem))]})})]},e.id)}a(RN,"renderMenuAction");function MN(e,t,o,r){let n=sm(e,t),i=String(Mt(e.value,t)??""),s=e.options??[];return jsxRuntime.jsx(Ad,{value:i,label:e.label,icon:e.icon,title:e.title,triggerLabel:e.triggerLabel,disabled:n,display:e.selectDisplay??"label-value",align:e.align??"end",sideOffset:e.sideOffset??6,options:s.map(l=>({value:l.value,label:l.label,icon:l.icon,title:l.title,disabled:Mt(l.disabled,t)??false})),appearance:r,classNames:{trigger:o?.action,content:o?.menuContent,item:o?.menuItem},onValueChange:l=>{!e.onValueChange||n||e.onValueChange(l,t);}},e.id)}a(MN,"renderSelectAction");function IN(e,t,o,r){let n=e.kind??"button",i=n==="toggle"?Mt(e.checked,t)??Mt(e.active,t)??false:Mt(e.active,t)??false,s=sm(e,t),l=TN(e);return n==="toggle"?jsxRuntime.jsx(Pd,{checked:i,icon:e.icon,label:e.label,title:e.title,disabled:s,appearance:o,className:r,onCheckedChange:d=>{e.onCheckedChange&&e.onCheckedChange(d,t);}},e.id):jsxRuntime.jsx(vs,{label:e.label,icon:e.icon,title:e.title,ariaLabel:n==="icon-button"?e.triggerLabel||e.title:void 0,tone:e.tone,active:i,iconOnly:n==="icon-button",disabled:s,loading:Mt(e.loading,t)??false,stopPropagation:true,appearance:o,className:r,onClick:()=>{l&&l(t);}},e.id)}a(IN,"renderButtonAction");function sn({context:e,actions:t=[],layout:o="action-bar",appearance:r,empty:n,children:i,className:s,classNames:l}){let d=Ct(Et(r)),c=t.filter(u=>Mt(u.visible,e)??true).map(u=>{if(u.render)return jsxRuntime.jsx("div",{children:u.render(e)},u.id);if(u.renderTrigger)return jsxRuntime.jsx("div",{children:u.renderTrigger(e)},u.id);let g=u.kind==="menu"?RN(u,e,d,l,r):u.kind==="select"?MN(u,e,l,r):IN(u,e,r,l?.action);return u.wrapTrigger?jsxRuntime.jsx("div",{children:u.wrapTrigger(g,e)},u.id):g});if(c.length===0&&!i&&!n)return null;let p=o==="action-bar"?d.slots.actionBarActions:o==="toolbar"?d.slots.toolbarActions:"flex items-center gap-2";return jsxRuntime.jsxs("div",{className:j(p,l?.root,s),children:[c,i,c.length===0&&!i?n:null]})}a(sn,"DataExplorerToolbarActions");function Rh({context:e,actions:t=[],leading:o,trailing:r,children:n,empty:i,appearance:s,className:l,classNames:d}){let c=Ct(Et(s)),p=!!o||!!r||!!n||t.length>0;return p||!!i?jsxRuntime.jsxs("div",{className:j(c.slots.actionBarRoot,d?.root,l),children:[o?jsxRuntime.jsx("div",{className:j(c.slots.actionBarLeading,d?.leading),children:o}):null,jsxRuntime.jsx(sn,{context:e,actions:t,layout:"action-bar",appearance:s,empty:p?void 0:i,classNames:{root:d?.actions,action:d?.action},children:n}),r?jsxRuntime.jsx("div",{className:j(c.slots.actionBarTrailing,d?.trailing),children:r}):null]}):null}a(Rh,"DataExplorerActionBar");var EN={},to="motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",yr="motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",Bd="motion-safe:transition-transform motion-safe:duration-300 motion-safe:ease-out",Mh=m("[scrollbar-width:thin]","[scrollbar-color:hsl(var(--muted-foreground)/0.45)_transparent]","[&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2","[&::-webkit-scrollbar-button]:hidden [&::-webkit-scrollbar-button]:h-0 [&::-webkit-scrollbar-button]:w-0 [&::-webkit-scrollbar-button]:bg-transparent","[&::-webkit-scrollbar-button:single-button]:hidden [&::-webkit-scrollbar-button:single-button]:h-0 [&::-webkit-scrollbar-button:single-button]:w-0","[&::-webkit-scrollbar-button:double-button]:hidden [&::-webkit-scrollbar-button:double-button]:h-0 [&::-webkit-scrollbar-button:double-button]:w-0","[&::-webkit-scrollbar-corner]:bg-transparent","[&::-webkit-scrollbar-track]:bg-transparent","[&:has(thead.sticky)::-webkit-scrollbar-track]:mt-[var(--base-table-header-height)]","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/40","hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/55"),AN=m("[&.sticky_th]:sticky [&.sticky_th]:top-0 [&.sticky_th]:z-[2]","[&.sticky_th]:bg-[var(--base-table-sticky-header-bg)]","[&.sticky_th]:shadow-[inset_0_-1px_0_var(--base-table-header-separator)]"),Eh={buttonBase:m("group/button inline-flex min-w-0 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium focus-visible:outline-hidden","cursor-pointer disabled:!cursor-not-allowed",yr),buttonDefault:"border-border bg-background text-foreground hover:bg-accent/60",buttonPrimary:"border-primary/20 bg-primary/10 text-primary hover:bg-primary/15",buttonSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))] hover:bg-[hsl(var(--success,142_72%_29%)_/_0.15)]",buttonWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))] hover:bg-[hsl(var(--warning,45_93%_47%)_/_0.15)]",buttonDanger:"border-destructive/20 bg-destructive/10 text-destructive-text hover:bg-destructive/15",buttonMuted:"border-border/60 bg-muted/45 text-muted-foreground hover:bg-muted/70 hover:text-foreground",buttonActive:"border-primary/35 bg-primary/10 text-primary",buttonDisabled:"!cursor-not-allowed opacity-60",buttonIconOnly:"w-9 px-0",buttonIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current [&_svg_*]:!stroke-current",buttonLabel:"min-w-0 truncate",badgeBase:m("inline-flex max-w-full items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium",to),badgeDefault:"border-border/60 bg-background text-foreground",badgePrimary:"border-primary/30 bg-primary/10 text-primary",badgeSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))]",badgeWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",badgeDanger:"border-destructive/30 bg-destructive/10 text-destructive-text",badgeMuted:"border-border/60 bg-muted text-muted-foreground",badgeIcon:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",badgeLabel:"min-w-0 truncate",textRoot:"min-w-0 break-words leading-6",textSizeXs:"text-xs",textSizeSm:"text-sm",textSizeMd:"text-base",textSizeLg:"text-lg",textSizeXl:"text-xl",typographyToneDefault:"text-foreground",typographyToneMuted:"text-muted-foreground",typographyTonePrimary:"text-primary",typographyToneSuccess:"text-emerald-700 dark:text-emerald-400",typographyToneWarning:"text-amber-700 dark:text-amber-400",typographyToneDanger:"text-destructive-text",typographyToneInherit:"text-inherit",headingRoot:"min-w-0 break-words font-semibold tracking-tight",headingSizeXs:"text-sm leading-5",headingSizeSm:"text-base leading-6",headingSizeMd:"text-lg leading-7",headingSizeLg:"text-xl leading-7",headingSizeXl:"text-2xl leading-8",headingSize2xl:"text-3xl leading-9",linkRoot:"inline break-words underline decoration-current/40 underline-offset-4 hover:decoration-current focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",codeInline:"rounded border border-border/70 bg-muted/60 px-1.5 py-0.5 font-mono text-[0.875em] leading-[1.45] text-foreground",codeBlock:"m-0 max-w-full overflow-x-auto rounded-md border border-border/70 bg-muted/60 p-4 text-foreground",codeContent:"font-mono text-sm leading-6",kbdRoot:"inline-flex min-h-5 items-center rounded border border-border bg-muted/70 px-1.5 font-mono text-[0.75em] font-medium leading-5 text-foreground shadow-[inset_0_-1px_0_hsl(var(--monkeys-color-border))]",listRoot:"m-0 min-w-0 list-outside break-words ps-5 text-foreground",listSpacingCompact:"[&>li+li]:mt-1",listSpacingDefault:"[&>li+li]:mt-2",listSpacingRelaxed:"[&>li+li]:mt-3",listMarkerNone:"list-none ps-0",listMarkerDisc:"list-disc",listMarkerCircle:"list-[circle]",listMarkerSquare:"list-[square]",listMarkerDecimal:"list-decimal",listMarkerLowerAlpha:"list-[lower-alpha]",listMarkerUpperAlpha:"list-[upper-alpha]",listItem:"min-w-0 ps-1 leading-6 marker:text-muted-foreground",stackRoot:"flex min-w-0 flex-col",inlineRoot:"flex min-w-0 flex-row",gridRoot:"grid min-w-0",containerRoot:"mx-auto w-full min-w-0",aspectRatioRoot:"relative min-w-0 overflow-hidden [&>*]:h-full [&>*]:w-full",spinnerRoot:"inline-flex shrink-0 items-center justify-center text-current align-middle",spinnerIndicator:"h-5 w-5 rounded-full border-2 border-current border-r-transparent motion-safe:animate-spin motion-reduce:animate-none",visuallyHiddenRoot:"sr-only",visuallyHiddenFocusable:"focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[1000] focus:rounded-md focus:bg-background focus:px-4 focus:py-2 focus:text-foreground focus:shadow-lg focus:outline-hidden focus:ring-2 focus:ring-ring focus-within:not-sr-only focus-within:fixed focus-within:left-4 focus-within:top-4 focus-within:z-[1000] focus-within:rounded-md focus-within:bg-background focus-within:px-4 focus-within:py-2 focus-within:text-foreground focus-within:shadow-lg focus-within:ring-2 focus-within:ring-ring",fieldsetRoot:"min-w-0 border-0 p-0 text-foreground",fieldsetLegend:"min-w-0 text-sm font-semibold leading-6 text-foreground",fieldsetDescription:"mt-1 text-sm leading-5 text-muted-foreground",fieldsetError:"mt-1 text-sm leading-5 text-destructive-text",fieldsetContent:"mt-3 grid min-w-0 gap-3",stepsRoot:"m-0 min-w-0 list-none p-0 text-foreground",stepsHorizontal:"flex w-full max-w-full items-start overflow-x-auto pb-2",stepsVertical:"grid",stepsItem:"relative min-w-0",stepsItemHorizontal:"flex min-w-52 flex-1 items-start",stepsItemVertical:"pb-6 last:pb-0",stepsTrigger:"flex min-w-0 flex-1 items-start gap-3 rounded-md border-0 bg-transparent p-1 text-start text-inherit",stepsTriggerInteractive:"cursor-pointer hover:bg-accent/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",stepsTriggerDisabled:"!cursor-not-allowed opacity-60",stepsIndicator:"relative z-[1] inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",stepsIndicatorPending:"border-border bg-background text-muted-foreground",stepsIndicatorCurrent:"border-primary/50 bg-primary/10 text-primary",stepsIndicatorCompleted:"border-primary bg-primary text-primary-foreground",stepsIndicatorError:"border-destructive bg-destructive text-destructive-foreground",stepsContent:"grid min-w-0 gap-1 pt-0.5",stepsLabel:"min-w-0 break-words text-sm font-medium leading-5",stepsDescription:"min-w-0 break-words text-sm leading-5 text-muted-foreground",stepsStatus:"sr-only",stepsConnector:"shrink-0 bg-border",stepsConnectorHorizontal:"mt-3.5 h-px w-8",stepsConnectorVertical:"absolute bottom-0 top-8 start-3.5 w-px -translate-x-1/2",stepsConnectorCompleted:"bg-primary/60",stepsConnectorError:"bg-destructive/60",scrollAreaViewport:"min-h-0 min-w-0",numberInputControl:"tabular-nums",numberInputStepControls:"me-1 flex shrink-0 self-stretch overflow-hidden border-s border-border",numberInputStepButton:"flex min-h-6 w-7 cursor-pointer items-center justify-center border-0 bg-transparent px-1 text-xs leading-none text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:z-[1] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-40",passwordInputControl:"pe-2",passwordInputToggle:"me-1 inline-flex min-h-7 shrink-0 cursor-pointer items-center justify-center rounded px-2 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-40",inputGroupRoot:m("relative flex min-w-0 items-stretch overflow-hidden rounded-md border border-border bg-background text-foreground focus-within:border-primary/50 focus-within:ring-2 focus-within:ring-ring/30",to),inputGroupInvalid:"border-destructive/55 focus-within:border-destructive/70 focus-within:ring-destructive/25",inputGroupDisabled:"!cursor-not-allowed bg-muted/35",inputGroupContent:"flex min-w-0 flex-1 items-stretch [&>*]:min-w-0",inputGroupStartElement:"inline-flex shrink-0 items-center justify-center ps-3 pe-1 text-foreground/75",inputGroupEndElement:"inline-flex shrink-0 items-center justify-center ps-1 pe-3 text-foreground/75",inputGroupStartAddon:"inline-flex max-w-[min(40%,16rem)] shrink-0 items-center overflow-hidden border-e border-border bg-muted/60 px-3 text-sm text-foreground/75 text-ellipsis whitespace-nowrap [&>*]:min-w-0",inputGroupEndAddon:"inline-flex max-w-[min(40%,16rem)] shrink-0 items-center overflow-hidden border-s border-border bg-muted/60 px-3 text-sm text-foreground/75 text-ellipsis whitespace-nowrap [&>*]:min-w-0",panelRoot:m("group relative flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background",yr),panelInteractive:"cursor-pointer hover:shadow-md",panelSelected:"border-primary/45 bg-primary/5",panelDisabled:"!cursor-not-allowed opacity-60",panelMedia:"shrink-0 overflow-hidden",panelHeader:"min-w-0 p-token-lg",panelTitle:"min-w-0 truncate text-sm font-semibold leading-none text-foreground",panelDescription:"mt-1 text-sm leading-5 text-foreground/75",panelBody:"min-w-0 px-token-lg pb-token-lg text-sm text-foreground",panelBodyStandalone:"pt-token-lg",panelFooter:"shrink-0 border-t border-border/60 px-token-lg py-token-md",stateRoot:m("flex min-h-48 flex-col items-center justify-center rounded-lg border border-border/70 bg-background px-6 py-10 text-center",to),stateIcon:"mb-token-lg flex h-12 w-12 items-center justify-center rounded-full bg-muted text-muted-foreground motion-safe:animate-in motion-safe:fade-in",stateTitle:"text-sm font-semibold text-foreground",stateDescription:"mt-2 max-w-md text-sm leading-6 text-muted-foreground",stateActions:"mt-token-xl flex flex-wrap items-center justify-center gap-token-sm",loadingSpinner:"h-5 w-5 motion-safe:animate-spin motion-reduce:animate-none",fieldRoot:"grid min-w-0 gap-token-md",fieldLabelRow:"flex min-w-0 items-center justify-between gap-token-md",fieldLabel:"min-w-0 text-sm font-medium leading-none text-foreground",fieldRequired:"text-destructive-text",fieldDescription:"text-sm leading-5 text-muted-foreground",fieldMessage:"text-sm leading-5 text-muted-foreground",fieldControl:"min-w-0",controlWrapper:m("relative flex min-w-0 items-center rounded-md border border-border bg-background text-foreground focus-within:border-primary/35",to),controlBase:"min-w-0 flex-1 bg-transparent px-3 text-sm text-foreground outline-hidden placeholder:text-muted-foreground disabled:!cursor-not-allowed",controlInput:"h-9",controlTextarea:"min-h-24 resize-y py-2 leading-6",controlSelect:"h-9 cursor-pointer appearance-none pr-9 disabled:!cursor-not-allowed",controlIcon:"pointer-events-none ml-3 inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",controlTrailing:"mr-3 inline-flex shrink-0 items-center justify-center text-muted-foreground",controlInvalid:"border-destructive/45 focus-within:border-destructive/60",controlDisabled:"!cursor-not-allowed opacity-60",controlReadOnly:"bg-muted/35",selectChevron:m("pointer-events-none absolute right-3 top-1/2 h-2 w-2 -translate-y-1/2 rotate-45 border-b border-r border-current text-muted-foreground",Bd),selectMenu:"absolute left-0 right-0 top-[calc(100%+0.375rem)] z-50 max-h-60 overflow-auto rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden",selectOption:m("flex min-h-8 w-full min-w-0 cursor-pointer items-center rounded-sm px-2.5 py-1.5 text-left text-sm text-foreground",yr),selectOptionActive:"bg-accent text-accent-foreground",selectOptionSelected:"bg-primary/10 text-primary",selectOptionDisabled:"!cursor-not-allowed opacity-50",selectPlaceholder:"text-muted-foreground",selectNative:"sr-only",switchRoot:"inline-flex min-w-0 cursor-pointer items-start gap-3",switchInput:"sr-only",switchTrack:m("relative mt-0.5 inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-border bg-muted focus-within:border-primary/35",to),switchThumb:m("h-4 w-4 translate-x-1 rounded-full bg-background shadow-sm",Bd),switchChecked:"border-primary/40 bg-primary/80 text-primary-foreground",switchDisabled:"!cursor-not-allowed opacity-60",switchContent:"grid min-w-0 gap-1",switchLabel:"text-sm font-medium leading-none text-foreground",switchDescription:"text-sm leading-5 text-muted-foreground",checkboxRoot:"inline-flex min-w-0 cursor-pointer items-start gap-3",checkboxInput:"sr-only",checkboxBox:m("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border border-border bg-background text-primary focus-within:border-primary/40",to),checkboxBoxChecked:"border-primary/45 bg-primary text-primary-foreground",checkboxBoxInvalid:"border-destructive/50",checkboxIndicator:"text-xs font-bold leading-none",checkboxDisabled:"!cursor-not-allowed opacity-60",checkboxContent:"grid min-w-0 gap-1",checkboxLabel:"text-sm font-medium leading-none text-foreground",checkboxDescription:"text-sm leading-5 text-muted-foreground",radioGroupRoot:"grid min-w-0 gap-2",radioOption:m("inline-flex min-w-0 cursor-pointer items-start gap-3 rounded-md border border-border/60 bg-background px-3 py-2 text-sm",yr,"hover:bg-muted/35"),radioInput:"sr-only",radioMarker:m("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border bg-background text-primary focus-within:border-primary/40",to),radioMarkerChecked:"border-primary/50 bg-primary/10",radioIndicator:"h-2 w-2 rounded-full bg-primary",radioOptionDisabled:"!cursor-not-allowed opacity-60 hover:bg-background",radioContent:"grid min-w-0 gap-1",radioLabel:"text-sm font-medium leading-none text-foreground",radioDescription:"text-sm leading-5 text-muted-foreground",dialogRoot:"relative",dialogTrigger:"",dialogTriggerDisabled:"!cursor-not-allowed opacity-60",dialogOverlay:"fixed inset-0 z-50 bg-background/70 backdrop-blur-sm motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",dialogContent:"pointer-events-none fixed inset-0 z-50 flex min-h-0 items-center justify-center p-4",dialogPanel:m("pointer-events-auto relative flex max-h-[min(85vh,720px)] w-full max-w-lg min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background text-foreground shadow-xl","motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out"),dialogHeader:"grid min-w-0 gap-1 border-b border-border/60 px-5 py-4",dialogTitle:"min-w-0 pr-8 text-base font-semibold leading-6 text-foreground",dialogDescription:"text-sm leading-6 text-muted-foreground",dialogBody:"min-h-0 min-w-0 overflow-auto px-5 py-4 text-sm text-foreground",dialogFooter:"flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border/60 px-5 py-4",dialogClose:m("absolute right-3 top-3 inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",yr),dropdownRoot:"relative inline-flex min-w-0",dropdownTrigger:"",dropdownTriggerDisabled:"!cursor-not-allowed opacity-60",dropdownMenu:"z-50 min-w-48 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",dropdownMenuTop:"bottom-[calc(100%+0.375rem)] top-auto",dropdownMenuEnd:"left-auto right-0",dropdownLabel:"px-2.5 py-1.5 text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",dropdownSeparator:"my-1 h-px bg-border/70",dropdownItem:m("flex min-w-0 cursor-pointer items-center gap-2 rounded-sm px-2.5 py-2 text-left text-sm text-foreground hover:bg-accent/60 focus:bg-accent/60 data-[highlighted]:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",yr),dropdownItemDanger:"text-destructive-text hover:bg-destructive/10 focus:bg-destructive/10 data-[highlighted]:bg-destructive/10",dropdownItemDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent focus:bg-transparent data-[highlighted]:bg-transparent",dropdownItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",dropdownItemContent:"grid min-w-0 flex-1 gap-0.5",dropdownItemLabel:"min-w-0 truncate",dropdownItemDescription:"min-w-0 truncate text-xs leading-4 text-muted-foreground",dropdownItemShortcut:"ml-3 shrink-0 text-xs font-medium text-muted-foreground",tooltipRoot:"relative inline-flex min-w-0",tooltipTrigger:"inline-flex min-w-0",tooltipContent:"pointer-events-none z-50 max-w-xs rounded-md border border-border bg-popover px-2.5 py-1.5 text-xs leading-5 text-popover-foreground shadow-lg motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",noticeBase:m("flex min-w-0 gap-3 rounded-lg border px-4 py-3 text-sm",to,"motion-safe:animate-in motion-safe:fade-in"),noticeDefault:"border-border bg-background text-foreground",noticePrimary:"border-primary/25 bg-primary/10 text-primary",noticeSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-foreground",noticeWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",noticeDanger:"border-destructive/30 bg-destructive/10 text-destructive-text",noticeMuted:"border-border/60 bg-muted/35 text-muted-foreground",noticeIcon:"mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center motion-safe:animate-in motion-safe:fade-in",noticeTitle:"font-semibold leading-5",noticeDescription:"leading-6",noticeActions:"mt-3 flex flex-wrap items-center gap-2",dividerRoot:m("shrink-0 border-border/70",to),dividerLabel:"mx-3 shrink-0 text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground motion-safe:animate-in motion-safe:fade-in",sectionHeaderRoot:"flex min-w-0 flex-wrap items-start justify-between gap-token-md motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",sectionHeaderContent:"grid min-w-0 gap-1",sectionHeaderEyebrow:"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",sectionHeaderTitle:"text-base font-semibold leading-6 text-foreground",sectionHeaderDescription:"max-w-2xl text-sm leading-6 text-muted-foreground",sectionHeaderActions:"flex shrink-0 flex-wrap items-center gap-2",tabsRoot:"grid min-w-0 gap-token-md",tabsList:m("inline-flex min-w-0 flex-wrap items-center gap-token-xs rounded-lg border border-border/70 bg-muted/30 p-token-xs",to),tabsTrigger:m("inline-flex min-w-0 cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-background/70 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-1 motion-reduce:transition-none",yr),tabsTriggerActive:"bg-background text-foreground shadow-sm",tabsTriggerDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent",tabsPanel:"min-w-0 rounded-lg border border-border/70 bg-background p-4 text-sm text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",segmentedRoot:m("inline-flex min-w-0 items-center gap-1 rounded-lg border border-border/70 bg-muted/30 p-1",to),segmentedItem:m("inline-flex min-w-0 cursor-pointer items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-background/70 hover:text-foreground focus-visible:outline-hidden",yr),segmentedItemActive:"bg-background text-foreground shadow-sm",segmentedItemDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent",progressRoot:"grid min-w-0 gap-2",progressTrack:"h-2 w-full overflow-hidden rounded-full bg-muted",progressIndicator:"h-full rounded-full bg-primary motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-out",progressLabelRow:"flex min-w-0 items-center justify-between gap-3",progressLabel:"min-w-0 truncate text-sm font-medium text-foreground",progressValue:"shrink-0 text-xs font-medium text-muted-foreground",skeletonRoot:"relative overflow-hidden rounded-md bg-muted/70",avatarRoot:"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-border bg-muted text-sm font-semibold text-muted-foreground motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",avatarImage:"h-full w-full object-cover",avatarFallback:"flex h-full w-full items-center justify-center bg-muted text-foreground",avatarStatus:"absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-muted-foreground motion-safe:animate-pulse",avatarText:"min-w-0 truncate text-sm font-medium text-foreground",toolbarRoot:m("flex min-w-0 flex-wrap items-center justify-between gap-token-md rounded-lg border border-border/70 bg-background px-token-lg py-token-md",to),toolbarLeading:"flex min-w-0 items-center gap-token-md",toolbarTitle:"min-w-0 truncate text-sm font-semibold text-foreground",toolbarDescription:"mt-0.5 text-sm leading-5 text-muted-foreground",toolbarContent:"min-w-0 flex-1",toolbarActions:"flex shrink-0 flex-wrap items-center gap-token-sm",breadcrumbRoot:"min-w-0 text-sm text-muted-foreground",breadcrumbList:"flex min-w-0 flex-wrap items-center gap-1.5",breadcrumbItem:"inline-flex min-w-0 items-center gap-1.5",breadcrumbLink:"min-w-0 cursor-pointer truncate text-muted-foreground hover:text-foreground disabled:!cursor-not-allowed disabled:opacity-50 aria-disabled:!cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:text-muted-foreground motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",breadcrumbCurrent:"min-w-0 truncate font-medium text-foreground",breadcrumbSeparator:"shrink-0 text-muted-foreground/70",paginationRoot:"flex min-w-0 flex-wrap items-center justify-between gap-3 text-sm",paginationInfo:"min-w-0 text-muted-foreground",paginationControls:"flex min-w-0 flex-wrap items-center justify-end gap-1.5",paginationButton:"inline-flex h-8 min-w-8 cursor-pointer items-center justify-center whitespace-nowrap rounded-md border border-border bg-background px-2.5 text-sm font-medium text-foreground hover:bg-accent/60 disabled:!cursor-not-allowed disabled:opacity-50 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",paginationButtonDisabled:"!cursor-not-allowed opacity-50",paginationPage:"inline-flex h-8 min-w-8 cursor-default items-center justify-center rounded-md bg-muted/50 px-2.5 text-sm font-medium text-foreground hover:bg-muted/50",paginationEllipsis:"inline-flex h-8 min-w-6 items-center justify-center px-1 text-sm text-muted-foreground",descriptionListRoot:"grid min-w-0 gap-3 text-sm",descriptionListItem:"grid min-w-0 gap-1 rounded-md border border-border/60 bg-background px-3 py-2 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out hover:shadow-sm",descriptionListTerm:"min-w-0 truncate text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",descriptionListValue:"min-w-0 text-sm leading-6 text-foreground",accordionRoot:"grid min-w-0 gap-2",accordionItem:"overflow-hidden rounded-lg border border-border/70 bg-background motion-safe:transition motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",accordionTrigger:"flex w-full min-w-0 cursor-pointer items-center justify-between gap-3 px-4 py-3 text-start text-sm font-medium text-foreground hover:bg-muted/40 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-50 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",accordionTriggerIcon:m("h-2 w-2 shrink-0 rotate-45 border-b border-r border-current text-muted-foreground",Bd,"motion-reduce:transition-none"),accordionPanel:"border-t border-border/60 px-4 py-3 text-sm leading-6 text-muted-foreground motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out motion-reduce:animate-none",menuTrigger:"inline-flex min-w-0",menuContent:"z-50 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out",menuLabel:"px-2 py-1.5 text-xs font-medium text-muted-foreground",menuSeparator:"-mx-1 my-1 h-px bg-border",menuItem:m("relative flex min-h-8 min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm text-foreground outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:!cursor-not-allowed data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",yr),menuItemDefault:"text-foreground",menuItemPrimary:"text-primary focus:text-primary data-[highlighted]:text-primary",menuItemSuccess:"text-[hsl(var(--success,142_72%_29%))] focus:text-[hsl(var(--success,142_72%_29%))] data-[highlighted]:text-[hsl(var(--success,142_72%_29%))]",menuItemWarning:"text-[hsl(var(--warning-foreground,28_73%_26%))] focus:text-[hsl(var(--warning-foreground,28_73%_26%))] data-[highlighted]:text-[hsl(var(--warning-foreground,28_73%_26%))]",menuItemDanger:"text-destructive-text focus:text-destructive-text data-[highlighted]:text-destructive-text",menuItemMuted:"text-muted-foreground focus:text-foreground data-[highlighted]:text-foreground",menuItemDisabled:"!cursor-not-allowed opacity-50 data-[disabled]:pointer-events-none",menuItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",menuItemLabel:"min-w-0 flex-1 truncate",menuItemShortcut:"ml-4 shrink-0 text-xs font-medium text-muted-foreground",menuCheckboxIndicator:"absolute left-2 inline-flex h-4 w-4 items-center justify-center text-current",menuRadioIndicator:"absolute left-2 inline-flex h-4 w-4 items-center justify-center text-current",menuSubTrigger:m("relative flex min-h-8 min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm text-foreground outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:!cursor-not-allowed data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",yr),menuSubTriggerIcon:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",menuSubContent:"z-50 min-w-40 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out",tableContainer:m("relative isolate min-w-0 overflow-auto rounded-lg border border-border/70 bg-background/95 bg-clip-padding [scrollbar-gutter:stable]","[--base-table-header-height:2.75rem] [--base-table-split-scrollbar-gutter:0.75rem]","[--base-table-sticky-header-bg:hsl(var(--background))] [--base-table-header-separator:hsl(var(--border)_/_0.7)]",Mh,to),tableContainerFooterAttached:"!rounded-b-none !shadow-none",tableRoot:"w-full caption-bottom border-separate border-spacing-0 text-sm text-foreground",tableCaption:"mt-3 text-sm text-muted-foreground",tableHeader:m("relative z-[2] bg-transparent [&_tr]:bg-transparent",AN),tableBody:"[&_tr:last-child>*]:border-b-0",tableFooter:"bg-muted/30 font-medium [&_tr>*]:border-t [&_tr>*]:border-border/70",tableFooterBar:m("flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-lg border border-border/70 bg-muted/20 px-4 py-3 text-sm text-foreground shadow-none",to),tableFooterBarAttached:"-mt-px rounded-t-none border-t border-border/70 shadow-none",tableFooterBarLeading:"flex min-w-0 items-center gap-2",tableFooterBarContent:"min-w-0 flex-1",tableFooterBarActions:"ms-auto flex shrink-0 flex-wrap items-center gap-2",tableSplitRoot:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)_auto] caption-bottom border-separate border-spacing-0 text-sm text-foreground",tableSplitHeader:"block w-full min-w-0 shrink-0 overflow-x-hidden overflow-y-hidden bg-transparent",tableSplitBody:m("block min-h-0 w-full min-w-0 max-w-full justify-self-stretch overflow-auto [scrollbar-gutter:stable]",Mh),tableSplitFooter:"block w-full min-w-0 shrink-0 overflow-x-hidden overflow-y-hidden",tableSplitRow:"grid w-max min-w-full [grid-template-columns:var(--base-table-column-template)]",tableSplitHead:"flex min-w-0 overflow-hidden",tableSplitCell:"block min-w-0 overflow-hidden [overflow-wrap:anywhere]",tableRow:m("[&>*]:border-b [&>*]:border-border/60 data-[state=selected]:bg-primary/5 data-[state=selected]:[&>*]:bg-primary/5",to),tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.35)] hover:bg-[var(--base-table-row-hover-bg)] hover:[&>*]:bg-[var(--base-table-row-hover-bg)]",tableRowSelected:"bg-primary/5 [&>*]:bg-primary/5",tableRowDisabled:"!cursor-not-allowed opacity-60",tableHead:"relative h-11 whitespace-nowrap px-3 py-2 text-left align-middle text-xs font-semibold text-muted-foreground shadow-[inset_0_-1px_0_var(--base-table-header-separator)]",tableHeadContent:"flex min-w-0 items-center justify-between gap-2",tableHeadMain:"flex min-w-0 items-center gap-2",tableHeadIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",tableHeadText:"grid min-w-0 gap-0.5",tableHeadLabel:"min-w-0 truncate text-xs font-semibold leading-4 text-foreground",tableHeadDescription:"min-w-0 truncate text-xs font-normal leading-4 text-muted-foreground",tableHeadMeta:"shrink-0 text-xs font-medium text-muted-foreground",tableHeadActions:"flex shrink-0 items-center gap-1",tableHeadSortButton:m("inline-flex min-w-0 cursor-pointer items-center gap-1 rounded-sm text-left focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-60",to),tableHeadSortIcon:m("inline-flex h-3 w-3 shrink-0 items-center justify-center text-muted-foreground",Bd),tableHeadDragHandle:m("inline-flex h-5 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-muted-foreground hover:bg-muted active:cursor-grabbing focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-50",to),tableHeadResizeHandle:m("absolute end-0 top-1/2 h-7 w-2 -translate-y-1/2 cursor-col-resize touch-none rounded-sm after:absolute after:start-1/2 after:top-1/2 after:h-5 after:w-px after:-translate-x-1/2 after:-translate-y-1/2 after:bg-border hover:after:bg-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-50",to),tableCell:"min-w-0 px-3 py-2 align-middle text-sm text-foreground [overflow-wrap:anywhere]",tableCellAlignCenter:"text-center",tableCellAlignRight:"text-right",tableEmptyRow:"[&>*]:border-b [&>*]:border-border/60",tableEmptyCell:"px-4 py-10 text-center",tableEmptyContent:"mx-auto flex max-w-md flex-col items-center justify-center text-center",tableEmptyIcon:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-muted text-muted-foreground",tableEmptyTitle:"text-sm font-semibold text-foreground",tableEmptyDescription:"mt-1 text-sm leading-6 text-muted-foreground",tableEmptyActions:"mt-4 flex flex-wrap items-center justify-center gap-2",tableLoadingRow:"[&>*]:border-b [&>*]:border-border/60",tableLoadingCell:"px-3 py-2",tableLoadingSkeleton:"h-4 w-full rounded-md bg-muted/70",layoutRoot:m("grid min-w-0 overflow-hidden grid-rows-[auto_minmax(0,1fr)_auto] gap-3 rounded-lg border border-border/70 bg-background p-3 text-foreground",to),layoutRootFull:"h-full min-h-0",layoutHeader:"min-w-0",layoutBody:"grid min-h-0 min-w-0 overflow-hidden gap-token-md",layoutSidebar:"min-h-0 min-w-0 overflow-hidden",layoutMain:"min-h-0 min-w-0 overflow-hidden",layoutAside:"min-h-0 min-w-0 overflow-hidden",layoutFooter:"min-w-0",layoutPane:m("h-full max-h-full min-h-0 min-w-0 overflow-hidden rounded-lg bg-background text-foreground",to),layoutPaneScrollable:"overflow-auto",layoutPaneBordered:"border border-border/70",layoutPaneMuted:"bg-muted/25",layoutPaneSoft:"bg-background/95 shadow-sm",layoutPaneTransparent:"bg-transparent shadow-none",layoutSplitRoot:"grid min-h-0 min-w-0 overflow-hidden",layoutSplitHorizontal:"grid-flow-col",layoutSplitVertical:"grid-flow-row",layoutSplitPane:"min-h-0 min-w-0 overflow-hidden",layoutSplitPrimary:"",layoutSplitSecondary:"",layoutResizeHandle:m("group/resize relative z-10 flex shrink-0 items-center justify-center bg-transparent text-muted-foreground hover:bg-border/60 active:bg-border/70 focus-visible:bg-border/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",yr),layoutResizeHandleHorizontal:"w-2 cursor-col-resize",layoutResizeHandleVertical:"h-2 cursor-row-resize",layoutResizeHandleDisabled:"cursor-default opacity-60",layoutResizeHandleIndicator:"rounded-full bg-muted-foreground/45 group-hover/resize:bg-primary/70"},BN={compact:{buttonBase:"h-8 px-2.5 text-xs",buttonIconOnly:"h-8 w-8 px-0",badgeBase:"px-1.5 py-0 text-xs",panelHeader:"p-token-md",panelBody:"px-token-md pb-token-md text-xs",panelBodyStandalone:"pt-token-md",panelFooter:"px-token-md py-token-md",stateRoot:"min-h-36 px-4 py-7",stateIcon:"mb-3 h-10 w-10",fieldRoot:"gap-token-sm",fieldLabel:"text-xs",fieldDescription:"text-xs leading-5",fieldMessage:"text-xs leading-5",controlInput:"h-8 text-xs",controlTextarea:"min-h-20 text-xs",controlSelect:"h-8 text-xs",selectMenu:"text-xs",selectOption:"min-h-7 px-2 py-1 text-xs",switchTrack:"h-5 w-9",switchThumb:"h-3.5 w-3.5",checkboxBox:"h-3.5 w-3.5",checkboxLabel:"text-xs",checkboxDescription:"text-xs leading-5",radioOption:"px-2 py-1.5 text-xs",radioMarker:"h-3.5 w-3.5",radioIndicator:"h-1.5 w-1.5",radioLabel:"text-xs",radioDescription:"text-xs leading-5",dialogPanel:"max-w-md",dialogHeader:"px-4 py-3",dialogTitle:"text-sm leading-5",dialogDescription:"text-xs leading-5",dialogBody:"px-4 py-3 text-xs",dialogFooter:"px-4 py-3",dropdownMenu:"min-w-44 text-xs",dropdownItem:"px-2 py-1.5 text-xs",tooltipContent:"text-xs leading-4",noticeBase:"px-3 py-2 text-xs",dividerLabel:"text-xs",sectionHeaderRoot:"gap-token-sm",sectionHeaderTitle:"text-sm leading-5",sectionHeaderDescription:"text-xs leading-5",tabsList:"gap-token-xs p-token-xs",tabsTrigger:"px-2 py-1 text-xs",tabsPanel:"p-3 text-xs",segmentedRoot:"gap-token-xs p-token-xs",segmentedItem:"px-2 py-1 text-xs",progressTrack:"h-1.5",avatarRoot:"text-xs",toolbarRoot:"gap-token-sm px-token-md py-token-md",toolbarTitle:"text-xs",toolbarDescription:"text-xs leading-5",paginationButton:"h-7 min-w-7 px-2 text-xs",paginationPage:"h-7 min-w-7 px-2 text-xs",descriptionListRoot:"gap-2 text-xs",descriptionListItem:"px-2 py-1.5",descriptionListTerm:"text-xs",descriptionListValue:"text-xs leading-5",accordionTrigger:"px-3 py-2 text-xs",accordionPanel:"px-3 py-2 text-xs leading-5",menuContent:"min-w-40 p-0.5 text-xs",menuSubContent:"min-w-36 p-0.5 text-xs",menuLabel:"px-2 py-1 text-xs",menuItem:"min-h-7 px-2 py-1 text-xs",menuSubTrigger:"min-h-7 px-2 py-1 text-xs",menuItemShortcut:"text-xs",tableContainer:"[--base-table-header-height:2.25rem]",tableHead:"h-9 px-2 py-1.5 text-xs",tableCell:"px-2 py-1.5 text-xs",tableHeadLabel:"text-xs",tableHeadDescription:"text-xs leading-3",tableLoadingCell:"px-2 py-1.5",layoutRoot:"gap-token-md p-token-md",layoutBody:"gap-token-md",layoutPane:"rounded-md text-xs",layoutResizeHandleHorizontal:"w-1.5",layoutResizeHandleVertical:"h-1.5"},default:{buttonBase:"h-9"},comfortable:{buttonBase:"h-10 px-3.5",buttonIconOnly:"h-10 w-10 px-0",badgeBase:"px-2.5 py-1",panelHeader:"p-token-xl",panelBody:"px-token-xl pb-token-xl",panelBodyStandalone:"pt-token-xl",panelFooter:"px-token-xl py-token-lg",stateRoot:"min-h-56 px-8 py-12",stateIcon:"mb-5 h-14 w-14",fieldRoot:"gap-token-md",controlInput:"h-10",controlTextarea:"min-h-28",controlSelect:"h-10",selectMenu:"p-1.5",selectOption:"min-h-9 px-3 py-2",switchTrack:"h-7 w-12",switchThumb:"h-5 w-5",checkboxBox:"h-5 w-5",radioOption:"px-4 py-3",radioMarker:"h-5 w-5",radioIndicator:"h-2.5 w-2.5",dialogPanel:"max-w-xl",dialogHeader:"px-6 py-5",dialogBody:"px-6 py-5",dialogFooter:"px-6 py-5",dropdownMenu:"min-w-56",dropdownItem:"px-3 py-2.5",noticeBase:"px-5 py-4",sectionHeaderTitle:"text-lg leading-7",tabsTrigger:"px-3.5 py-2",tabsPanel:"p-5",segmentedItem:"px-3.5 py-2",progressTrack:"h-2.5",toolbarRoot:"px-token-xl py-token-lg",paginationButton:"h-9 min-w-9 px-3",paginationPage:"h-9 min-w-9 px-3",descriptionListItem:"px-4 py-3",accordionTrigger:"px-5 py-4",accordionPanel:"px-5 py-4",menuContent:"min-w-48 p-1.5",menuSubContent:"min-w-44 p-1.5",menuItem:"min-h-9 px-3 py-2",menuSubTrigger:"min-h-9 px-3 py-2",tableContainer:"[--base-table-header-height:3rem]",tableHead:"h-12 px-4 py-3",tableCell:"px-4 py-3",tableLoadingCell:"px-4 py-3",layoutRoot:"gap-token-lg p-token-lg",layoutBody:"gap-token-lg",layoutPane:"rounded-xl",layoutResizeHandleHorizontal:"w-2.5",layoutResizeHandleVertical:"h-2.5"}},LN={none:{buttonBase:"rounded-none",badgeBase:"rounded-none",panelRoot:"rounded-none",stateRoot:"rounded-none",stateIcon:"rounded-none",controlWrapper:"rounded-none",selectMenu:"rounded-none",selectOption:"rounded-none",switchTrack:"rounded-none",switchThumb:"rounded-none",checkboxBox:"rounded-none",radioOption:"rounded-none",dialogPanel:"rounded-none",dialogClose:"rounded-none",dropdownMenu:"rounded-none",dropdownItem:"rounded-none",tooltipContent:"rounded-none",noticeBase:"rounded-none",tabsList:"rounded-none",tabsTrigger:"rounded-none",tabsPanel:"rounded-none",segmentedRoot:"rounded-none",segmentedItem:"rounded-none",progressTrack:"rounded-none",progressIndicator:"rounded-none",skeletonRoot:"rounded-none",avatarRoot:"rounded-none",avatarStatus:"rounded-none",toolbarRoot:"rounded-none",paginationButton:"rounded-none",paginationPage:"rounded-none",descriptionListItem:"rounded-none",accordionItem:"rounded-none",menuContent:"rounded-none",menuItem:"rounded-none",menuSubTrigger:"rounded-none",menuSubContent:"rounded-none",tableContainer:"rounded-none",tableEmptyIcon:"rounded-none",tableLoadingSkeleton:"rounded-none",layoutRoot:"rounded-none",layoutPane:"rounded-none"},sm:{buttonBase:"rounded-sm",badgeBase:"rounded-sm",panelRoot:"rounded-sm",stateRoot:"rounded-sm",stateIcon:"rounded-sm",controlWrapper:"rounded-sm",selectMenu:"rounded-sm",selectOption:"rounded-sm",switchTrack:"rounded-sm",switchThumb:"rounded-sm",checkboxBox:"rounded-sm",radioOption:"rounded-sm",dialogPanel:"rounded-sm",dialogClose:"rounded-sm",dropdownMenu:"rounded-sm",dropdownItem:"rounded-sm",tooltipContent:"rounded-sm",noticeBase:"rounded-sm",tabsList:"rounded-sm",tabsTrigger:"rounded-sm",tabsPanel:"rounded-sm",segmentedRoot:"rounded-sm",segmentedItem:"rounded-sm",progressTrack:"rounded-sm",progressIndicator:"rounded-sm",skeletonRoot:"rounded-sm",avatarRoot:"rounded-sm",avatarStatus:"rounded-sm",toolbarRoot:"rounded-sm",paginationButton:"rounded-sm",paginationPage:"rounded-sm",descriptionListItem:"rounded-sm",accordionItem:"rounded-sm",menuContent:"rounded-sm",menuItem:"rounded-sm",menuSubTrigger:"rounded-sm",menuSubContent:"rounded-sm",tableContainer:"rounded-sm",tableEmptyIcon:"rounded-sm",tableLoadingSkeleton:"rounded-sm",layoutRoot:"rounded-sm",layoutPane:"rounded-sm"},md:{},lg:{buttonBase:"rounded-lg",badgeBase:"rounded-lg",panelRoot:"rounded-xl",stateRoot:"rounded-xl",stateIcon:"rounded-xl",controlWrapper:"rounded-lg",selectMenu:"rounded-lg",selectOption:"rounded-md",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-md",radioOption:"rounded-xl",dialogPanel:"rounded-xl",dialogClose:"rounded-lg",dropdownMenu:"rounded-lg",dropdownItem:"rounded-md",tooltipContent:"rounded-md",noticeBase:"rounded-xl",tabsList:"rounded-xl",tabsTrigger:"rounded-lg",tabsPanel:"rounded-xl",segmentedRoot:"rounded-xl",segmentedItem:"rounded-lg",skeletonRoot:"rounded-lg",toolbarRoot:"rounded-xl",descriptionListItem:"rounded-lg",accordionItem:"rounded-xl",menuContent:"rounded-lg",menuItem:"rounded-md",menuSubTrigger:"rounded-md",menuSubContent:"rounded-lg",tableContainer:"rounded-xl",tableEmptyIcon:"rounded-xl",tableLoadingSkeleton:"rounded-lg",layoutRoot:"rounded-xl",layoutPane:"rounded-xl"},xl:{buttonBase:"rounded-xl",badgeBase:"rounded-xl",panelRoot:"rounded-2xl",stateRoot:"rounded-2xl",stateIcon:"rounded-2xl",controlWrapper:"rounded-xl",selectMenu:"rounded-xl",selectOption:"rounded-lg",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-lg",radioOption:"rounded-2xl",dialogPanel:"rounded-2xl",dialogClose:"rounded-xl",dropdownMenu:"rounded-xl",dropdownItem:"rounded-lg",tooltipContent:"rounded-lg",noticeBase:"rounded-2xl",tabsList:"rounded-2xl",tabsTrigger:"rounded-xl",tabsPanel:"rounded-2xl",segmentedRoot:"rounded-2xl",segmentedItem:"rounded-xl",skeletonRoot:"rounded-xl",toolbarRoot:"rounded-2xl",paginationButton:"rounded-xl",paginationPage:"rounded-xl",descriptionListItem:"rounded-xl",accordionItem:"rounded-2xl",menuContent:"rounded-xl",menuItem:"rounded-lg",menuSubTrigger:"rounded-lg",menuSubContent:"rounded-xl",tableContainer:"rounded-2xl",tableEmptyIcon:"rounded-2xl",tableLoadingSkeleton:"rounded-xl",layoutRoot:"rounded-2xl",layoutPane:"rounded-2xl"},full:{buttonBase:"rounded-full",badgeBase:"rounded-full",panelRoot:"rounded-2xl",stateRoot:"rounded-2xl",stateIcon:"rounded-full",controlWrapper:"rounded-full",selectMenu:"rounded-2xl",selectOption:"rounded-full",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-full",radioOption:"rounded-2xl",dialogPanel:"rounded-2xl",dialogClose:"rounded-full",dropdownMenu:"rounded-2xl",dropdownItem:"rounded-full",tooltipContent:"rounded-full",noticeBase:"rounded-2xl",tabsList:"rounded-full",tabsTrigger:"rounded-full",tabsPanel:"rounded-2xl",segmentedRoot:"rounded-full",segmentedItem:"rounded-full",progressTrack:"rounded-full",progressIndicator:"rounded-full",skeletonRoot:"rounded-full",avatarRoot:"rounded-full",avatarStatus:"rounded-full",toolbarRoot:"rounded-2xl",paginationButton:"rounded-full",paginationPage:"rounded-full",descriptionListItem:"rounded-2xl",accordionItem:"rounded-2xl",menuContent:"rounded-2xl",menuItem:"rounded-full",menuSubTrigger:"rounded-full",menuSubContent:"rounded-2xl",tableContainer:"rounded-2xl",tableEmptyIcon:"rounded-full",tableLoadingSkeleton:"rounded-full",layoutRoot:"rounded-2xl",layoutPane:"rounded-2xl"}},WN={none:{buttonBase:"border-transparent",badgeBase:"border-transparent",panelRoot:"border-transparent",panelFooter:"border-transparent",stateRoot:"border-transparent",controlWrapper:"border-transparent",selectMenu:"border-transparent",switchTrack:"border-transparent",checkboxBox:"border-transparent",radioOption:"border-transparent",radioMarker:"border-transparent",dialogPanel:"border-transparent",dialogHeader:"border-transparent",dialogFooter:"border-transparent",dropdownMenu:"border-transparent",tooltipContent:"border-transparent",noticeBase:"border-transparent",dividerRoot:"border-transparent",tabsList:"border-transparent",tabsPanel:"border-transparent",segmentedRoot:"border-transparent",avatarRoot:"border-transparent",toolbarRoot:"border-transparent",paginationButton:"border-transparent",descriptionListItem:"border-transparent",accordionItem:"border-transparent",accordionPanel:"border-transparent",menuContent:"border-transparent",menuSeparator:"bg-transparent",menuSubContent:"border-transparent",tableContainer:"border-transparent [--base-table-header-separator:transparent]",tableHeader:"border-transparent",tableFooter:"[&_tr>*]:border-transparent",tableFooterBar:"border-transparent",tableFooterBarAttached:"border-t border-transparent",tableRow:"[&>*]:border-transparent",tableEmptyRow:"[&>*]:border-transparent",tableLoadingRow:"[&>*]:border-transparent",layoutRoot:"border-transparent",layoutPaneBordered:"border-transparent",layoutResizeHandle:"bg-transparent hover:bg-transparent active:bg-transparent focus-visible:bg-transparent"},subtle:{buttonDefault:"border-border/60",badgeDefault:"border-border/60",panelRoot:"border-border/60",panelFooter:"border-border/60",stateRoot:"border-border/60",controlWrapper:"border-border/60",selectMenu:"border-border/60",switchTrack:"border-border/60",checkboxBox:"border-border/60",radioOption:"border-border/60",radioMarker:"border-border/60",dialogPanel:"border-border/60",dialogHeader:"border-border/60",dialogFooter:"border-border/60",dropdownMenu:"border-border/60",tooltipContent:"border-border/60",noticeDefault:"border-border/60",dividerRoot:"border-border/60",tabsList:"border-border/60",tabsPanel:"border-border/60",segmentedRoot:"border-border/60",avatarRoot:"border-border/60",toolbarRoot:"border-border/60",paginationButton:"border-border/60",descriptionListItem:"border-border/60",accordionItem:"border-border/60",accordionPanel:"border-border/60",menuContent:"border-border/60",menuSeparator:"bg-border/60",menuSubContent:"border-border/60",tableContainer:"border-border/60 [--base-table-header-separator:hsl(var(--border)_/_0.6)]",tableHeader:"border-border/60",tableFooter:"[&_tr>*]:border-border/60",tableFooterBar:"border-border/60",tableFooterBarAttached:"border-t border-border/60",tableRow:"[&>*]:border-border/50",tableEmptyRow:"[&>*]:border-border/50",tableLoadingRow:"[&>*]:border-border/50",layoutRoot:"border-border/60",layoutPaneBordered:"border-border/60"},solid:{},strong:{buttonDefault:"border-foreground/20",badgeDefault:"border-foreground/20",panelRoot:"border-foreground/20",panelFooter:"border-foreground/20",stateRoot:"border-foreground/20",controlWrapper:"border-foreground/20",selectMenu:"border-foreground/20",switchTrack:"border-foreground/20",checkboxBox:"border-foreground/20",radioOption:"border-foreground/20",radioMarker:"border-foreground/20",dialogPanel:"border-foreground/20",dialogHeader:"border-foreground/15",dialogFooter:"border-foreground/15",dropdownMenu:"border-foreground/20",tooltipContent:"border-foreground/20",noticeDefault:"border-foreground/20",dividerRoot:"border-foreground/20",tabsList:"border-foreground/20",tabsPanel:"border-foreground/20",segmentedRoot:"border-foreground/20",avatarRoot:"border-foreground/20",toolbarRoot:"border-foreground/20",paginationButton:"border-foreground/20",descriptionListItem:"border-foreground/20",accordionItem:"border-foreground/20",accordionPanel:"border-foreground/20",menuContent:"border-foreground/20",menuSeparator:"bg-foreground/15",menuSubContent:"border-foreground/20",tableContainer:"border-foreground/20 [--base-table-header-separator:hsl(var(--foreground)_/_0.15)]",tableHeader:"border-foreground/20",tableFooter:"[&_tr>*]:border-foreground/20",tableFooterBar:"border-foreground/20",tableFooterBarAttached:"border-t border-foreground/20",tableRow:"[&>*]:border-foreground/15",tableEmptyRow:"[&>*]:border-foreground/15",tableLoadingRow:"[&>*]:border-foreground/15",layoutRoot:"border-foreground/20",layoutPaneBordered:"border-foreground/20",layoutResizeHandle:"hover:bg-foreground/15 active:bg-foreground/20 focus-visible:bg-foreground/15"}},zN={plain:{},muted:{buttonDefault:"bg-muted/20 hover:bg-muted/45",panelRoot:"bg-card",panelFooter:"bg-muted/20",stateRoot:"bg-muted/20",controlWrapper:"bg-background",selectMenu:"bg-background",selectOptionActive:"bg-muted/70 text-foreground",checkboxBox:"bg-background",radioOption:"bg-card hover:bg-muted/45",radioMarker:"bg-background",dialogPanel:"bg-card",dropdownMenu:"bg-background",dropdownItem:"hover:bg-muted/60",tooltipContent:"bg-popover",noticeDefault:"bg-muted/20",tabsList:"bg-muted/35",tabsTriggerActive:"bg-background",tabsPanel:"bg-card",segmentedRoot:"bg-muted/35",segmentedItemActive:"bg-background",progressTrack:"bg-muted/60",skeletonRoot:"bg-muted",toolbarRoot:"bg-card",paginationButton:"bg-background hover:bg-muted/60",paginationPage:"bg-muted/60",descriptionListItem:"bg-card",accordionItem:"bg-card",menuContent:"bg-background",menuItem:"focus:bg-muted/70 data-[highlighted]:bg-muted/70",menuSubTrigger:"focus:bg-muted/70 data-[highlighted]:bg-muted/70 data-[state=open]:bg-muted/70",menuSubContent:"bg-background",tableContainer:"bg-background/95 [scrollbar-gutter:stable]",tableFooter:"bg-muted/35",tableFooterBar:"bg-muted/30 shadow-none",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.45)]",tableLoadingSkeleton:"bg-muted",layoutRoot:"bg-card",layoutPane:"bg-card",layoutPaneMuted:"bg-muted/35",layoutResizeHandle:"hover:bg-border/70 active:bg-border/80 focus-visible:bg-border/70"},soft:{buttonDefault:"bg-muted/30 hover:bg-muted/55",panelRoot:"bg-background/95 shadow-sm",stateRoot:"bg-background/95 shadow-sm",controlWrapper:"bg-background/95",selectMenu:"bg-background/95 shadow-xl",selectOptionActive:"bg-muted/60 text-foreground",checkboxBox:"bg-background/95",radioOption:"bg-background/95 shadow-sm hover:bg-muted/35",radioMarker:"bg-background/95",dialogPanel:"bg-background/95 shadow-xl",dropdownMenu:"bg-background/95 shadow-xl",dropdownItem:"hover:bg-muted/55",tooltipContent:"bg-popover shadow-xl",noticeDefault:"bg-background/95 shadow-sm",tabsList:"bg-background/60 shadow-sm",tabsTriggerActive:"bg-background",tabsPanel:"bg-background/95 shadow-sm",segmentedRoot:"bg-background/60 shadow-sm",segmentedItemActive:"bg-background",skeletonRoot:"bg-background/80",toolbarRoot:"bg-background/95 shadow-sm",paginationButton:"bg-background/95 hover:bg-muted/55",descriptionListItem:"bg-background/95 shadow-sm",accordionItem:"bg-background/95 shadow-sm",menuContent:"bg-background/95 shadow-xl",menuItem:"focus:bg-muted/60 data-[highlighted]:bg-muted/60",menuSubTrigger:"focus:bg-muted/60 data-[highlighted]:bg-muted/60 data-[state=open]:bg-muted/60",menuSubContent:"bg-background/95 shadow-xl",tableContainer:"bg-background/95 shadow-sm [scrollbar-gutter:stable]",tableFooter:"bg-muted/25",tableFooterBar:"bg-muted/25 shadow-none",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.35)]",tableLoadingSkeleton:"bg-muted/65",layoutRoot:"bg-background/95 shadow-sm",layoutPane:"bg-background/95 shadow-sm",layoutPaneSoft:"bg-background/95 shadow-md"},glass:{buttonBase:"backdrop-blur-md",buttonDefault:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",badgeDefault:"border-white/10 bg-white/[0.08] text-foreground",panelRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",panelFooter:"border-white/10 bg-white/[0.05]",stateRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",stateIcon:"bg-white/10 text-foreground",controlWrapper:"border-white/10 bg-white/[0.08] text-foreground backdrop-blur-md",selectMenu:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",selectOption:"text-foreground",selectOptionActive:"bg-white/[0.14] text-foreground",selectOptionSelected:"bg-white/[0.18] text-foreground",switchTrack:"border-white/10 bg-white/[0.12] backdrop-blur-md",checkboxBox:"border-white/10 bg-white/[0.08] backdrop-blur-md",checkboxBoxChecked:"border-white/20 bg-white/[0.22] text-foreground",radioOption:"border-white/10 bg-white/[0.06] backdrop-blur-md hover:bg-white/[0.10]",radioMarker:"border-white/10 bg-white/[0.08] backdrop-blur-md",radioMarkerChecked:"border-white/25 bg-white/[0.16]",dialogOverlay:"bg-background/45 backdrop-blur-md",dialogPanel:"border-white/10 bg-white/[0.08] shadow-2xl backdrop-blur-md",dialogHeader:"border-white/10",dialogFooter:"border-white/10",dropdownMenu:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",dropdownItem:"text-foreground hover:bg-white/[0.14]",tooltipContent:"border-foreground/10 bg-background/15 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",noticeDefault:"border-white/10 bg-white/[0.08] text-foreground backdrop-blur-md",dividerRoot:"border-white/15",tabsList:"border-white/10 bg-white/[0.08] backdrop-blur-md",tabsTrigger:"text-muted-foreground hover:bg-white/[0.12] hover:text-foreground",tabsTriggerActive:"bg-white/[0.16] text-foreground shadow-none",tabsPanel:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",segmentedRoot:"border-white/10 bg-white/[0.08] backdrop-blur-md",segmentedItem:"text-muted-foreground hover:bg-white/[0.12] hover:text-foreground",segmentedItemActive:"bg-white/[0.16] text-foreground shadow-none",progressTrack:"bg-white/[0.12]",skeletonRoot:"bg-white/[0.16]",avatarRoot:"border-white/10 bg-white/[0.12] text-foreground",avatarFallback:"bg-white/[0.12] text-foreground",avatarStatus:"border-background",toolbarRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",paginationButton:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",paginationPage:"bg-white/[0.12] text-foreground",descriptionListItem:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",accordionItem:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",accordionPanel:"border-white/10",menuContent:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",menuSeparator:"bg-white/10",menuItem:"text-foreground focus:bg-white/[0.14] focus:text-foreground data-[highlighted]:bg-white/[0.14] data-[highlighted]:text-foreground",menuSubTrigger:"text-foreground focus:bg-white/[0.14] focus:text-foreground data-[highlighted]:bg-white/[0.14] data-[highlighted]:text-foreground data-[state=open]:bg-white/[0.16]",menuSubContent:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",tableContainer:"border-foreground/10 bg-background/[0.06] shadow-none backdrop-blur-md [scrollbar-gutter:stable] [--base-table-sticky-header-bg:hsl(var(--background)/0.94)] [--base-table-header-separator:hsl(var(--foreground)/0.24)]",tableHeader:"border-white/10",tableFooter:"bg-white/[0.05] [&_tr>*]:border-white/10",tableFooterBar:"border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",tableFooterBarAttached:"border-t border-white/10",tableRow:"[&>*]:border-white/10",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--foreground)/0.08)]",tableHeadLabel:"text-foreground",tableLoadingSkeleton:"bg-white/[0.16]",layoutRoot:"border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",layoutPane:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",layoutPaneMuted:"bg-white/[0.08]",layoutPaneSoft:"bg-white/[0.10] shadow-none backdrop-blur-md",layoutResizeHandle:"text-foreground/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",layoutResizeHandleIndicator:"bg-white/45 group-hover/resize:bg-white/75"},dark:{buttonBase:"border-white/15 text-white shadow-lg backdrop-blur",buttonDefault:"bg-black/30 hover:bg-black/[0.45]",buttonPrimary:"border-white/25 bg-white/20 text-white hover:bg-white/25",buttonMuted:"border-white/10 bg-black/20 text-white/70 hover:bg-black/[0.35] hover:text-white",badgeDefault:"border-white/10 bg-white/[0.08] text-white",badgeMuted:"border-white/10 bg-black/20 text-white/70",panelRoot:"border-white/10 bg-slate-950 text-white shadow-none",panelTitle:"text-white",panelDescription:"text-white/65",panelBody:"text-white/85",panelFooter:"border-white/10 bg-white/[0.04]",stateRoot:"border-white/10 bg-slate-950 text-white shadow-none",stateIcon:"bg-white/10 text-white/75",stateTitle:"text-white",stateDescription:"text-white/65",fieldLabel:"text-white",fieldDescription:"text-white/65",fieldMessage:"text-white/65",controlWrapper:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur focus-within:border-white/35",controlBase:"text-white placeholder:text-white/45",selectChevron:"text-white/65",selectMenu:"border-white/15 bg-slate-950 text-white shadow-2xl",selectOption:"text-white",selectOptionActive:"bg-white/[0.12] text-white",selectOptionSelected:"bg-white/[0.16] text-white",selectPlaceholder:"text-white/45",switchTrack:"border-white/15 bg-black/30 shadow-lg backdrop-blur",switchChecked:"border-white/25 bg-white/25 text-white",switchLabel:"text-white",switchDescription:"text-white/65",checkboxBox:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur",checkboxBoxChecked:"border-white/25 bg-white/25 text-white",checkboxLabel:"text-white",checkboxDescription:"text-white/65",radioOption:"border-white/10 bg-white/[0.06] text-white hover:bg-white/[0.08]",radioMarker:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur",radioMarkerChecked:"border-white/25 bg-white/25",radioIndicator:"bg-white",radioLabel:"text-white",radioDescription:"text-white/65",dialogOverlay:"bg-slate-950/75",dialogPanel:"border-white/10 bg-slate-950 text-white shadow-2xl",dialogHeader:"border-white/10",dialogTitle:"text-white",dialogDescription:"text-white/65",dialogBody:"text-white/85",dialogFooter:"border-white/10",dialogClose:"text-white/65 hover:bg-white/[0.08] hover:text-white",dropdownMenu:"border-white/15 bg-slate-950 text-white shadow-2xl",dropdownLabel:"text-white/55",dropdownSeparator:"bg-white/15",dropdownItem:"text-white hover:bg-white/[0.10]",dropdownItemDescription:"text-white/55",dropdownItemShortcut:"text-white/55",tooltipContent:"border-white/15 bg-slate-950 text-white shadow-2xl",noticeDefault:"border-white/10 bg-white/[0.08] text-white",noticeMuted:"border-white/10 bg-black/20 text-white/70",dividerRoot:"border-white/15",dividerLabel:"text-white/55",sectionHeaderEyebrow:"text-white/55",sectionHeaderTitle:"text-white",sectionHeaderDescription:"text-white/65",tabsList:"border-white/10 bg-white/[0.08]",tabsTrigger:"text-white/65 hover:bg-white/[0.12] hover:text-white",tabsTriggerActive:"bg-white/[0.16] text-white shadow-none",tabsPanel:"border-white/10 bg-white/[0.06] text-white",segmentedRoot:"border-white/10 bg-white/[0.08]",segmentedItem:"text-white/65 hover:bg-white/[0.12] hover:text-white",segmentedItemActive:"bg-white/[0.16] text-white shadow-none",progressTrack:"bg-white/[0.12]",progressLabel:"text-white",progressValue:"text-white/65",skeletonRoot:"bg-white/[0.14]",avatarRoot:"border-white/15 bg-white/[0.10] text-white",avatarFallback:"bg-white/[0.10] text-white/75",avatarText:"text-white",avatarStatus:"border-slate-950",toolbarRoot:"border-white/10 bg-white/[0.06] text-white",toolbarTitle:"text-white",toolbarDescription:"text-white/65",breadcrumbLink:"text-white/65 hover:text-white",breadcrumbCurrent:"text-white",breadcrumbSeparator:"text-white/45",paginationInfo:"text-white/65",paginationButton:"border-white/10 bg-white/[0.08] text-white hover:bg-white/[0.14]",paginationPage:"bg-white/[0.14] text-white",descriptionListItem:"border-white/10 bg-white/[0.06]",descriptionListTerm:"text-white/55",descriptionListValue:"text-white",accordionItem:"border-white/10 bg-white/[0.06]",accordionTrigger:"text-white hover:bg-white/[0.08]",accordionPanel:"border-white/10 text-white/70",tableContainer:"border-foreground/10 bg-background text-foreground shadow-none [scrollbar-gutter:stable] [--base-table-sticky-header-bg:hsl(var(--background)/0.98)] [--base-table-header-separator:hsl(var(--foreground)/0.16)]",tableRoot:"text-white",tableHeader:"border-white/10",tableFooter:"bg-white/[0.05] [&_tr>*]:border-white/10",tableFooterBar:"border-white/10 bg-white/[0.05] text-white/65",tableFooterBarAttached:"border-t border-white/10",tableRow:"[&>*]:border-white/10",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--foreground)/0.06)]",tableHead:"text-white/65",tableHeadLabel:"text-white",tableHeadDescription:"text-white/55",tableHeadMeta:"text-white/55",tableHeadIcon:"text-white/55",tableHeadSortIcon:"text-white/55",tableHeadDragHandle:"text-white/55 hover:bg-white/[0.08]",tableHeadResizeHandle:"after:bg-white/20 hover:after:bg-white/60",tableCell:"text-white/85",tableEmptyIcon:"bg-white/10 text-white/65",tableEmptyTitle:"text-white",tableEmptyDescription:"text-white/60",menuContent:"border-white/10 bg-slate-950 text-white shadow-2xl",menuLabel:"text-white/55",menuSeparator:"bg-white/10",menuItem:"text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white",menuItemDefault:"text-white",menuItemPrimary:"text-primary focus:text-primary data-[highlighted]:text-primary",menuItemSuccess:"text-[hsl(var(--success,142_69%_58%))] focus:text-[hsl(var(--success,142_69%_58%))] data-[highlighted]:text-[hsl(var(--success,142_69%_58%))]",menuItemWarning:"text-[hsl(var(--warning-foreground,53_98%_77%))] focus:text-[hsl(var(--warning-foreground,53_98%_77%))] data-[highlighted]:text-[hsl(var(--warning-foreground,53_98%_77%))]",menuItemDanger:"text-destructive-text focus:text-destructive-text data-[highlighted]:text-destructive-text",menuItemMuted:"text-white/65 focus:text-white data-[highlighted]:text-white",menuItemShortcut:"text-white/45",menuSubTrigger:"text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white data-[state=open]:bg-white/[0.12]",menuSubTriggerIcon:"text-white/55",menuSubContent:"border-white/10 bg-slate-950 text-white shadow-2xl",tableLoadingSkeleton:"bg-white/[0.14]",layoutRoot:"border-white/10 bg-slate-950 text-white shadow-none",layoutPane:"border-white/10 bg-slate-950 text-white shadow-none",layoutPaneMuted:"bg-white/[0.06]",layoutPaneSoft:"bg-white/[0.08] shadow-none",layoutResizeHandle:"text-white/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",layoutResizeHandleIndicator:"bg-white/45 group-hover/resize:bg-white/75"}},Ih={default:{density:"default",radius:"md",border:"solid",background:"plain"},soft:{density:"default",radius:"lg",border:"subtle",background:"soft"},compact:{density:"compact",radius:"md",border:"subtle",background:"muted"},"tinted-glass":{density:"default",radius:"lg",border:"subtle",background:"glass"},glass:{density:"default",radius:"xl",border:"subtle",background:"glass"},"hard-edge":{density:"compact",radius:"none",border:"strong",background:"plain"}},ON={soft:{buttonBase:"font-medium",panelRoot:"border-border/70",controlWrapper:"font-medium",tabsTrigger:"font-medium",segmentedItem:"font-medium",toolbarRoot:"border-border/70",tableContainer:"border-border/70",tableFooterBar:"border-border/70",tableHeadLabel:"font-semibold",menuItemLabel:"font-medium"},compact:{buttonBase:"text-xs",badgeBase:"text-xs",fieldLabel:"text-xs",controlBase:"text-xs",selectOption:"text-xs",menuItem:"text-xs",menuSubTrigger:"text-xs",noticeBase:"text-xs",sectionHeaderTitle:"text-sm",tabsTrigger:"text-xs",segmentedItem:"text-xs",toolbarTitle:"text-xs",paginationRoot:"text-xs"},"tinted-glass":{buttonPrimary:"border-primary/25 bg-primary/15 text-primary-foreground hover:bg-primary/20",badgePrimary:"border-primary/25 bg-primary/15 text-primary-foreground",noticePrimary:"border-primary/25 bg-primary/15 text-primary-foreground",progressIndicator:"bg-primary",avatarStatus:"border-background"},glass:{panelRoot:"shadow-[0_24px_80px_hsl(var(--foreground)/0.12)]",stateRoot:"shadow-[0_24px_80px_hsl(var(--foreground)/0.12)]",noticeBase:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",tabsPanel:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",toolbarRoot:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",descriptionListItem:"shadow-[0_12px_40px_hsl(var(--foreground)/0.08)]",accordionItem:"shadow-[0_12px_40px_hsl(var(--foreground)/0.08)]"},"hard-edge":{buttonBase:"shadow-none",panelRoot:"shadow-none",stateRoot:"shadow-none",controlWrapper:"shadow-none",selectMenu:"shadow-none",menuContent:"shadow-none",menuSubContent:"shadow-none",noticeBase:"shadow-none",tabsList:"shadow-none",tabsTriggerActive:"shadow-none",tabsPanel:"shadow-none",segmentedRoot:"shadow-none",segmentedItemActive:"shadow-none",toolbarRoot:"shadow-none",descriptionListItem:"shadow-none",accordionItem:"shadow-none"}};function FN(e){return Ih[e]??Ih.default}a(FN,"getPresetDefaults");var HN=Object.keys(Eh);function VN(...e){return HN.reduce((t,o)=>(t[o]=m(...e.map(r=>r?.[o])),t),{})}a(VN,"mergeSlots");function _N(...e){return Object.assign({},...e.filter(Boolean))}a(_N,"mergeStyles");function Ne(e){let t=e?.preset??"default",o=e?.variant??"default",r=FN(t),n=e?.density??r.density??"default",i=e?.state??"idle",s=e?.radius??r.radius??"md",l=e?.border??r.border??"solid",d=e?.background??r.background??"plain";return {preset:t,variant:o,density:n,state:i,radius:s,border:l,background:d,styles:_N(EN,e?.styles),slots:VN(Eh,ON[t],BN[n],LN[s],WN[l],zN[d],e?.slots)}}a(Ne,"resolveBaseAppearance");function Gn(e,t="default",o=false){return m(t==="default"&&e.slots.buttonDefault,t==="primary"&&e.slots.buttonPrimary,t==="success"&&e.slots.buttonSuccess,t==="warning"&&e.slots.buttonWarning,t==="danger"&&e.slots.buttonDanger,t==="muted"&&e.slots.buttonMuted,o&&e.slots.buttonActive)}a(Gn,"getBaseButtonToneClassName");function Ld(e,t="default"){return m(t==="default"&&e.slots.badgeDefault,t==="primary"&&e.slots.badgePrimary,t==="success"&&e.slots.badgeSuccess,t==="warning"&&e.slots.badgeWarning,t==="danger"&&e.slots.badgeDanger,t==="muted"&&e.slots.badgeMuted)}a(Ld,"getBaseBadgeToneClassName");function Wd(e,t="default"){return m(t==="default"&&e.slots.noticeDefault,t==="primary"&&e.slots.noticePrimary,t==="success"&&e.slots.noticeSuccess,t==="warning"&&e.slots.noticeWarning,t==="danger"&&e.slots.noticeDanger,t==="muted"&&e.slots.noticeMuted)}a(Wd,"getBaseNoticeToneClassName");function Ma(e,t="default"){return m(t==="default"&&e.slots.menuItemDefault,t==="primary"&&e.slots.menuItemPrimary,t==="success"&&e.slots.menuItemSuccess,t==="warning"&&e.slots.menuItemWarning,t==="danger"&&e.slots.menuItemDanger,t==="muted"&&e.slots.menuItemMuted)}a(Ma,"getBaseMenuItemToneClassName");function fi(e,t="default"){return m(t==="default"&&e.slots.typographyToneDefault,t==="muted"&&e.slots.typographyToneMuted,t==="primary"&&e.slots.typographyTonePrimary,t==="success"&&e.slots.typographyToneSuccess,t==="warning"&&e.slots.typographyToneWarning,t==="danger"&&e.slots.typographyToneDanger,t==="inherit"&&e.slots.typographyToneInherit)}a(fi,"getBaseTypographyToneClassName");function zd(e,t="md"){return m(t==="xs"&&e.slots.textSizeXs,t==="sm"&&e.slots.textSizeSm,t==="md"&&e.slots.textSizeMd,t==="lg"&&e.slots.textSizeLg,t==="xl"&&e.slots.textSizeXl)}a(zd,"getBaseTextSizeClassName");function Ah(e,t="lg"){return m(t==="xs"&&e.slots.headingSizeXs,t==="sm"&&e.slots.headingSizeSm,t==="md"&&e.slots.headingSizeMd,t==="lg"&&e.slots.headingSizeLg,t==="xl"&&e.slots.headingSizeXl,t==="2xl"&&e.slots.headingSize2xl)}a(Ah,"getBaseHeadingSizeClassName");function Bh(e,t="default"){return m(t==="compact"&&e.slots.listSpacingCompact,t==="default"&&e.slots.listSpacingDefault,t==="relaxed"&&e.slots.listSpacingRelaxed)}a(Bh,"getBaseListSpacingClassName");function Lh(e,t){return m(t==="none"&&e.slots.listMarkerNone,t==="disc"&&e.slots.listMarkerDisc,t==="circle"&&e.slots.listMarkerCircle,t==="square"&&e.slots.listMarkerSquare,t==="decimal"&&e.slots.listMarkerDecimal,t==="lower-alpha"&&e.slots.listMarkerLowerAlpha,t==="upper-alpha"&&e.slots.listMarkerUpperAlpha)}a(Lh,"getBaseListMarkerClassName");var Wh=/^(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))$/i,GN=new Set(["calc","clamp","max","min","var"]),zh=/[;{}<>"'\\\u0000-\u001f\u007f]/,$N=/(?:\b(?:auto|fit-content|max-content|min-content|subgrid)\b|(?:calc|clamp|max|min|minmax|repeat|var)\s*\(|(?:^|[\s,(])(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|fr|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))(?:$|[\s,)\]]))/i;function Oh(e){let t={")":"(","]":"["},o=[];for(let r of e)if(r==="("||r==="[")o.push(r);else if((r===")"||r==="]")&&o.pop()!==t[r])return false;return o.length===0}a(Oh,"hasBalancedDelimiters");function jN(e){let t=/^([a-z]+)\(([\s\S]+)\)$/i.exec(e);return !t||!GN.has(t[1].toLowerCase())||!t[2].trim()||!Oh(e)?false:t[1].toLowerCase()==="var"?/^\s*--[a-z0-9_-]+(?:\s*,[\s\S]+)?\s*$/i.test(t[2]):Wh.test(t[2].trim())||/\b(?:calc|clamp|max|min|var)\s*\(/i.test(t[2])||/(?:^|[\s,(])(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))(?:$|[\s,)])/i.test(t[2])}a(jN,"isSupportedCssLengthFunction");function rr(e,t,o){if(typeof o=="number"){if(!Number.isFinite(o)||o<0)throw new RangeError(`${e} ${t} must be a finite, non-negative number or a supported CSS length string.`);return `${o}px`}if(typeof o!="string")throw new TypeError(`${e} ${t} must be a finite, non-negative number or a supported CSS length string.`);let r=o.trim();if(!r||zh.test(r)||!Wh.test(r)&&!jN(r))throw new TypeError(`${e} ${t} must be a non-empty, non-negative CSS length (for example 12px, 1rem, 5%, or var(--space)).`);return r}a(rr,"resolveBaseLayoutLength");function Fh(e){if(typeof e=="number"){if(!Number.isInteger(e)||e<=0)throw new RangeError("BaseGrid columns must be a positive integer or a supported CSS grid-template-columns string.");return `repeat(${e}, minmax(0, 1fr))`}if(typeof e!="string")throw new TypeError("BaseGrid columns must be a positive integer or a supported CSS grid-template-columns string.");let t=e.trim();if(!t||zh.test(t)||/\burl\s*\(/i.test(t)||!Oh(t)||!$N.test(t))throw new TypeError('BaseGrid columns must be a non-empty CSS grid-template-columns value such as "12rem minmax(0, 1fr)" or "repeat(3, minmax(0, 1fr))".');return t}a(Fh,"resolveBaseGridColumns");var Dh={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},Ph={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};function bi(e,t){if(!Object.prototype.hasOwnProperty.call(Dh,t))throw new TypeError(`${e} align must be one of: start, center, end, stretch, baseline.`);return Dh[t]}a(bi,"resolveBaseLayoutAlign");function gi(e,t){if(!Object.prototype.hasOwnProperty.call(Ph,t))throw new TypeError(`${e} justify must be one of: start, center, end, between, around, evenly.`);return Ph[t]}a(gi,"resolveBaseLayoutJustify");var qN=new Set(["compact","pages"]);function Hh(e,t){return Math.min(Math.max(e,1),Math.max(t,1))}a(Hh,"clampPage");function Od(e,t){if(!Number.isSafeInteger(e)||e<1)throw new RangeError(`BasePagination ${t} must be a positive safe integer.`)}a(Od,"assertPositiveInteger");function dm(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`BasePagination ${t} must be a non-negative safe integer.`)}a(dm,"assertNonNegativeInteger");function Fd(e,t){if(typeof e=="string"&&!e.trim())throw new TypeError(`BasePagination ${t} must be a non-empty string when provided.`)}a(Fd,"assertOptionalControlLabel");function YN(e,t){if(e!==void 0&&(typeof e!="string"||!e.trim()))throw new TypeError("BasePagination aria-label must be a non-empty string when provided.");if(t!==void 0&&(typeof t!="string"||!t.trim()))throw new TypeError("BasePagination aria-labelledby must contain at least one valid ID token.");if(typeof t=="string"&&t.trim().split(/\s+/).some(r=>/[\u0000-\u001f\u007f]/u.test(r)))throw new TypeError("BasePagination aria-labelledby must contain only valid ID tokens.")}a(YN,"assertAccessibleName");function Ia(e,t){if(typeof e!="string"||!e.trim())throw new TypeError(`BasePagination locale ${t} must resolve to a non-empty string.`);return e}a(Ia,"assertLocaleString");function Hd(e,t){return V(e)?e:t}a(Hd,"getControlContent");function Vd(e,t){return typeof e=="string"&&e.trim()?e:t}a(Vd,"getControlAriaLabel");function XN(e,t,o,r){let n=new Set,i=a(d=>{d>=1&&d<=t&&n.add(d);},"addPage");for(let d=0;d<o;d+=1)i(1+d),i(t-d);for(let d=-r;d<=r;d+=1)i(e+d);let s=[...n].sort((d,c)=>d-c),l=[];return s.forEach((d,c)=>{let p=s[c-1];if(p!==void 0){let u=d-p;u===2&&l.push(p+1),u>2&&l.push("ellipsis");}l.push(d);}),l}a(XN,"getPageItems");var Gd=ho.forwardRef(a(function({page:t,defaultPage:o,pageSize:r=20,total:n=0,pageCount:i,hasNext:s,hasPrevious:l,mode:d="compact",siblingCount:c=1,boundaryCount:p=1,label:u,firstLabel:g,previousLabel:f,nextLabel:b,lastLabel:x,appearance:y,className:k,classNames:w,style:v,onPageChange:h,role:S="navigation","aria-label":T,"aria-labelledby":C,...R},M){let I=Ye().pagination,B=Pe(y),N=ke(),D=Ne(B),[E,P]=ho.useState(()=>o??1);if(t!==void 0&&Od(t,"page"),o!==void 0&&Od(o,"defaultPage"),Od(r,"pageSize"),dm(n,"total"),i!==void 0&&Od(i,"pageCount"),dm(c,"siblingCount"),dm(p,"boundaryCount"),!qN.has(d))throw new TypeError('BasePagination mode must be "compact" or "pages".');if(h!==void 0&&typeof h!="function")throw new TypeError("BasePagination onPageChange must be a function.");Fd(g,"firstLabel"),Fd(f,"previousLabel"),Fd(b,"nextLabel"),Fd(x,"lastLabel"),YN(T,C);let W=Ia(I.navigation,"navigation"),H=Ia(I.first,"first"),A=Ia(I.previous,"previous"),L=Ia(I.next,"next"),F=Ia(I.last,"last"),G=i??Math.max(Math.ceil(n/r),1),$=t!==void 0,_=!$&&o!==void 0,z=Hh($?t:_?E:1,G),re=n>0?(z-1)*r+1:0,Z=Math.min(z*r,n),ae=l??z>1,ee=s??z<G,q=d==="pages"?XN(z,G,p,c):[],U=a(O=>{let K=Hh(O,G);K!==z&&(_&&P(K),h?.(K));},"requestPage"),X=a((O,K,ne,fe,he)=>jsxRuntime.jsx("button",{type:"button",disabled:!ne,"aria-label":he,"data-slot":O,className:m(D.slots.paginationButton,!ne&&D.slots.paginationButtonDisabled,w?.button),onClick:()=>U(K),children:fe}),"renderControl");return jsxRuntime.jsxs("div",{...N,...R,ref:M,role:S,"aria-label":T??(C===void 0?W:void 0),"aria-labelledby":C,"data-monkeys-component":"pagination","data-slot":"root","data-mode":d,"data-controlled":$||void 0,"data-uncontrolled":_||void 0,className:m(D.slots.paginationRoot,w?.root,k),style:{...D.styles.pagination,...v},children:[jsxRuntime.jsx("div",{"aria-live":"polite","data-slot":"info",className:m(D.slots.paginationInfo,w?.info),children:V(u)?u:n>0?I.range({start:re,end:Z,total:n}):I.emptyResults}),jsxRuntime.jsxs("div",{"data-slot":"controls",className:m(D.slots.paginationControls,w?.controls),children:[d==="pages"?X("first",1,ae,Hd(g,H),Vd(g,H)):null,X("previous",z-1,ae,Hd(f,A),Vd(f,A)),d==="compact"?jsxRuntime.jsxs("span",{"aria-current":"page","aria-label":Ia(I.currentPage({page:z,pageCount:G}),"currentPage"),"data-slot":"page","data-page":z,className:m(D.slots.paginationPage,w?.page),children:[z," / ",G]}):q.map((O,K)=>{if(O==="ellipsis")return jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"ellipsis",className:m(D.slots.paginationEllipsis,w?.ellipsis),children:"\u2026"},`ellipsis-${K}`);let ne=O===z;return jsxRuntime.jsx("button",{type:"button","aria-current":ne?"page":void 0,"aria-label":Ia(ne?I.currentPage({page:O,pageCount:G}):I.page({page:O,pageCount:G}),ne?"currentPage":"page"),"data-slot":"page","data-page":O,"data-current":ne||void 0,className:m(D.slots.paginationButton,ne&&D.slots.paginationPage,w?.button,ne&&w?.page),onClick:()=>U(O),children:O},O)}),X("next",z+1,ee,Hd(b,L),Vd(b,L)),d==="pages"?X("last",G,ee,Hd(x,F),Vd(x,F)):null]})]})},"BasePagination"));function QN(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"ml-1 inline-block h-3 w-3 animate-spin",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(QN,"LoadingIcon");function jd({total:e=0,loadedStart:t,loadedEnd:o,selectedCount:r,page:n=1,pageCount:i,pageSize:s=20,pageSizeOptions:l,showTotal:d,showPageSize:c,paginationMode:p,hasNext:u,hasPrevious:g,loading:f=false,totalLabel:b,selectedLabel:x,pageSizeLabel:y,appearance:k,className:w,classNames:v,onPageChange:h,onPageSizeChange:S,onSummaryClick:T,...C}){let R=Sd(),M=Ye().pagination,I=[...new Set(l??R.pageSizeOptions??[10,20,50,100])].filter(L=>Number.isSafeInteger(L)&&L>0),B=d??R.showTotal??true,N=c??R.showPageSize??true,D=p??R.paginationMode??"auto",E=D==="auto"?e>0?"pages":"compact":D,P=t!==void 0&&t>0&&o!==void 0&&o>=t,W=B?b??(P?M.range({start:t,end:o,total:e}):M.range({start:e>0?(n-1)*s+1:0,end:o??0,total:e})):void 0,H=!!h&&(u!==void 0||g!==void 0?!!(u||g||e>s):e>s),A=R.alignment==="end"?"justify-end":R.alignment==="start"?"justify-start":"justify-between";return jsxRuntime.jsx("div",{...C,className:m("flex min-w-0 flex-wrap items-center gap-3 py-2 text-sm",A,v?.root,w),"data-monkeys-component":"list-footer","data-density":R.density,children:jsxRuntime.jsxs("div",{className:"monkeys-list-footer-groups contents",children:[jsxRuntime.jsx("div",{className:m("min-w-0 text-muted-foreground",v?.summary),children:(()=>{let L=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[x??(r!==void 0?M.selected({count:r}):null),r!==void 0&&W?jsxRuntime.jsx("span",{className:"mx-2",children:"\xB7"}):null,W,f?jsxRuntime.jsx(QN,{}):null]});return T?jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center",onClick:T,children:L}):L})()}),H?jsxRuntime.jsx(Gd,{page:n,pageCount:i,pageSize:s,total:e,mode:E,hasNext:u,hasPrevious:g,onPageChange:h,appearance:k,className:v?.pagination,classNames:{info:"sr-only"}}):null,N&&S&&I.length>0?jsxRuntime.jsxs("label",{className:m("inline-flex items-center gap-2 whitespace-nowrap text-muted-foreground",v?.pageSize),children:[jsxRuntime.jsx("span",{className:"sr-only",children:y??M.pageSize}),jsxRuntime.jsx("select",{"aria-label":typeof y=="string"?y:M.pageSize,value:String(s),className:"h-8 rounded-md border border-border bg-background px-2 text-sm text-foreground",onChange:L=>S(Number(L.currentTarget.value)),children:I.map(L=>jsxRuntime.jsx("option",{value:L,children:L},L))})]}):null]})})}a(jd,"BaseListFooter");var Vh=Symbol.for("@inf-monkeys-tech/monkeys-design/bento-depth@1"),_h=globalThis,Gh=_h[Vh]??(_h[Vh]=ho.createContext(0));function Go(){return ho.useContext(Gh)}a(Go,"useBentoDepth");function um({children:e,depth:t}){return jsxRuntime.jsx(Gh.Provider,{value:t,children:e})}a(um,"BentoDepthProvider");function ks({children:e}){return jsxRuntime.jsx(um,{depth:0,children:e})}a(ks,"BentoScope");var jh="rounded-[var(--monkeys-bento-radius)] border-[length:var(--monkeys-bento-border-width)] border-[color:var(--monkeys-bento-border-color)] [border-style:var(--monkeys-bento-border-style)] bg-[var(--monkeys-bento-background)] shadow-[shadow:var(--monkeys-bento-shadow)] p-[var(--monkeys-bento-padding)] gap-[var(--monkeys-bento-gap)]";function Uh(){let e=Go(),t=e+1,o=ah(On(),t),r=Object.fromEntries(xd.map(n=>[`--monkeys-bento-${n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`,o.values[n]]));return {parentDepth:e,level:t,variables:r}}a(Uh,"useBentoSurface");function qh({as:e="article",title:t,description:o,media:r,header:n,footer:i,children:s,interactive:l,selected:d,disabled:c,appearance:p,variant:u,density:g,state:f,className:b,classNames:x,style:y,...k}){let w=Ne({...p,variant:u,density:g,state:f}),v=e,h=n!==void 0?V(n):V(t)||V(o),S=r!=null,T=!h&&!S;return jsxRuntime.jsxs(v,{...k,"aria-disabled":c||void 0,"data-variant":w.variant,"data-density":w.density,"data-state":f??(c?"disabled":d?"selected":"idle"),"data-monkeys-component":"panel","data-slot":"root","data-interactive":l||void 0,"data-selected":d||void 0,"data-disabled":c||void 0,className:m(w.slots.panelRoot,l&&!c&&w.slots.panelInteractive,d&&w.slots.panelSelected,c&&w.slots.panelDisabled,x?.root,b),style:{...w.styles.panel,...y},children:[S?jsxRuntime.jsx("div",{"data-slot":"media",className:m(w.slots.panelMedia,x?.media),children:r}):null,h?jsxRuntime.jsx("div",{"data-slot":"header",className:m(w.slots.panelHeader,x?.header),style:w.styles.panelHeader,children:n!==void 0?n:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(t)?jsxRuntime.jsx("div",{"data-slot":"title",className:m(w.slots.panelTitle,x?.title),children:t}):null,V(o)?jsxRuntime.jsx("div",{"data-slot":"description",className:m(w.slots.panelDescription,x?.description),children:o}):null]})}):null,s!=null?jsxRuntime.jsx("div",{"data-slot":"body",className:m(w.slots.panelBody,T&&w.slots.panelBodyStandalone,x?.body),style:w.styles.panelBody,children:s}):null,i!=null?jsxRuntime.jsx("div",{"data-slot":"footer",className:m(w.slots.panelFooter,x?.footer),style:w.styles.panelFooter,children:i}):null]})}a(qh,"BasePanel");var oR={menu:"monkeys-overlay-surface--menu bg-menu-surface text-popover-foreground",dialog:"monkeys-overlay-surface--dialog bg-dialog-surface text-foreground"};function ln(e,t={}){return ["monkeys-overlay-surface",oR[e],t.rounded===false?void 0:"monkeys-overlay-surface--rounded"].filter(Boolean).join(" ")}a(ln,"getOverlaySurfaceClassName");var sR=ho__namespace.forwardRef(({className:e,style:t,...o},r)=>jsxRuntime.jsx(dn__namespace.Item,{ref:r,className:m("border-b",e),style:{borderColor:"var(--monkeys-component-accordion-item-border-color, hsl(var(--border)))",...t},...o}));sR.displayName="AccordionItem";var lR=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsx(dn__namespace.Header,{className:"flex",children:jsxRuntime.jsxs(dn__namespace.Trigger,{ref:r,className:m("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...o,children:[t,jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));lR.displayName="AccordionTrigger";var dR=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsx(dn__namespace.Content,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:jsxRuntime.jsx("div",{className:m("pb-4 pt-0",e),children:t})}));dR.displayName="AccordionContent";var cR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Ud__namespace.Root,{ref:o,className:m("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:jsxRuntime.jsx(Ud__namespace.Indicator,{className:"flex items-center justify-center text-current",children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}));cR.displayName="Checkbox";var uR=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_[data-slot=icon]]:text-[inherit] [&_[data-slot=icon]_*]:!text-[inherit] [&_[data-slot=icon]_svg]:!stroke-current [&_[data-slot=icon]_svg_*]:!stroke-current [&_[data-slot=end-icon]]:text-[inherit] [&_[data-slot=end-icon]_*]:!text-[inherit] [&_[data-slot=end-icon]_svg]:!stroke-current [&_[data-slot=end-icon]_svg_*]:!stroke-current [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-control-surface shadow-sm ring-offset-control-surface hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-sm px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pt=ho__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...n},i)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{ref:i,className:uR({variant:t,size:o,className:e}),...n}));pt.displayName="Button";var pR=ho__namespace.forwardRef(({className:e,children:t,viewportClassName:o,viewportRef:r,onViewportScroll:n,scrollbar:i=true,scrollbarOrientation:s="vertical",scrollBarDisabled:l=false,type:d,...c},p)=>{let u=Go();return jsxRuntime.jsxs(zr__namespace.Root,{ref:p,type:d??(u>0?"auto":void 0),className:m("group relative overflow-hidden",l&&"no-scrollbar",e),...c,children:[jsxRuntime.jsx(zr__namespace.Viewport,{ref:r,onScroll:n,className:m("h-full w-full rounded-[inherit]",o),children:t}),i?jsxRuntime.jsx(Yh,{orientation:s,className:m(l&&"size-0 p-0")}):null,jsxRuntime.jsx(zr__namespace.Corner,{})]})});pR.displayName="ScrollArea";var Yh=ho__namespace.forwardRef(({className:e,orientation:t="vertical",...o},r)=>jsxRuntime.jsx(zr__namespace.ScrollAreaScrollbar,{ref:r,"data-monkeys-scrollbar":"",orientation:t,className:m("flex touch-none select-none opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...o,children:jsxRuntime.jsx(zr__namespace.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Yh.displayName="ScrollBar";var mR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Kd__namespace.Root,{ref:o,className:m("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:jsxRuntime.jsx(Kd__namespace.Thumb,{className:"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"})}));mR.displayName="Switch";var Da=ho__namespace.forwardRef(({variant:e="default",...t},o)=>jsxRuntime.jsx($n__namespace.Root,{ref:o,"data-variant":e,...t}));Da.displayName="Tabs";var Pa=ho__namespace.forwardRef(({className:e,gap:t,style:o,...r},n)=>jsxRuntime.jsx($n__namespace.List,{ref:n,className:m("inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),style:{gap:t,...o},...r}));Pa.displayName="TabsList";var jn=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx($n__namespace.Trigger,{ref:o,className:m("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));jn.displayName="TabsTrigger";var cn=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=Go();return jsxRuntime.jsx($n__namespace.Content,{ref:o,className:m("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r>0&&"gap-[var(--monkeys-bento-gap)]",e),...t})});cn.displayName="TabsContent";var Xh=mr__namespace.Provider,Qh=mr__namespace.Root,Zh=mr__namespace.Trigger,pm=ho__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>{let n=ke();return jsxRuntime.jsx(mr__namespace.Portal,{children:jsxRuntime.jsx(mr__namespace.Content,{...n,...o,ref:r,sideOffset:t,"data-monkeys-component":"tooltip","data-slot":"content","data-surface":"menu",className:m("z-50 overflow-hidden border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",ln("menu"),e)})})});pm.displayName="TooltipContent";var un=ho__namespace.forwardRef(({className:e,appearance:t="standard",type:o,...r},n)=>jsxRuntime.jsx("input",{ref:n,type:o,className:m("flex w-full border border-input bg-control-surface px-3 text-foreground ring-offset-control-surface transition-[border-color,background-color,color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t==="compact"?"h-9 rounded-md py-1 text-sm shadow-sm":"h-10 rounded-md py-2 text-sm shadow-sm",t==="shadow"&&"rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",e),...r}));un.displayName="Input";var fm=ho__namespace.forwardRef(({className:e,appearance:t="standard",...o},r)=>jsxRuntime.jsx("textarea",{ref:r,className:m("flex w-full border border-input bg-control-surface px-3 py-2 text-foreground ring-offset-control-surface placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t==="compact"?"min-h-[60px] rounded-md text-sm shadow-sm":"min-h-[80px] rounded-md text-sm",t==="shadow"&&"rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",e),...o}));fm.displayName="Textarea";function oy({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"input-group",role:"group",className:m("group/input-group shadow-xs relative flex w-full items-center rounded-md border border-input outline-hidden transition-[color,box-shadow] dark:bg-input/30","h-9 has-[>textarea]:h-auto","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col","has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot=input-group-control]:focus-visible]:ring-ring","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}a(oy,"InputGroup");var fR=classVarianceAuthority.cva("text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]","block-start":"[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5","block-end":"[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function qd({className:e,align:t="inline-start",...o}){return jsxRuntime.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:m(fR({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus();},...o})}a(qd,"InputGroupAddon");var bR=classVarianceAuthority.cva("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function ry({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return jsxRuntime.jsx(pt,{type:t,"data-size":r,variant:o,className:m(bR({size:r}),e),...n})}a(ry,"InputGroupButton");var gm=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(un,{ref:o,"data-slot":"input-group-control",className:m("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",e),...t}));gm.displayName="InputGroupInput";var gR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(fm,{ref:o,"data-slot":"input-group-control",className:m("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",e),...t}));gR.displayName="InputGroupTextarea";var Ss="relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",hm=`z-50 min-w-[8rem] overflow-hidden border p-1 ${ln("menu")} data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,Ts=Bt__namespace.Root,Ns=Bt__namespace.Trigger;var iy=Bt__namespace.RadioGroup,vR=ho__namespace.forwardRef(({className:e,inset:t,children:o,...r},n)=>jsxRuntime.jsxs(Bt__namespace.SubTrigger,{ref:n,className:m(Ss,"data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[o,jsxRuntime.jsx(lucideReact.ChevronRight,{"aria-hidden":"true",className:"ml-auto"})]}));vR.displayName="DropdownMenuSubTrigger";var wR=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=ke();return jsxRuntime.jsx(Bt__namespace.SubContent,{...r,...t,ref:o,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-surface":"menu",className:m(hm,e)})});wR.displayName="DropdownMenuSubContent";var yi=ho__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>{let n=ke();return jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{...n,...o,ref:r,sideOffset:t,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-surface":"menu",className:m(hm,e)})})});yi.displayName="DropdownMenuContent";var Rs=ho__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(Bt__namespace.Item,{ref:r,className:m(Ss,t&&"pl-8",e),...o}));Rs.displayName="DropdownMenuItem";var kR=ho__namespace.forwardRef(({className:e,children:t,checked:o,...r},n)=>jsxRuntime.jsxs(Bt__namespace.CheckboxItem,{ref:n,className:m(Ss,"pl-8",e),checked:o,...r,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Bt__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}),t]}));kR.displayName="DropdownMenuCheckboxItem";var ym=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{ref:r,className:m(Ss,"pl-8",e),...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Bt__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Circle,{"aria-hidden":"true",className:"h-2 w-2 fill-current"})})}),t]}));ym.displayName="DropdownMenuRadioItem";var xm=ho__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(Bt__namespace.Label,{ref:r,className:m("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));xm.displayName="DropdownMenuLabel";var vm=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Bt__namespace.Separator,{ref:o,className:m("-mx-1 my-1 h-px bg-muted",e),...t}));vm.displayName="DropdownMenuSeparator";var CR=a(({className:e,...t})=>jsxRuntime.jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t}),"DropdownMenuShortcut");CR.displayName="DropdownMenuShortcut";var SR=ho__namespace.forwardRef(({className:e,children:t,iconClassName:o,size:r="default",...n},i)=>jsxRuntime.jsxs(At__namespace.Trigger,{ref:i,className:m("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-control-surface px-3 py-2 text-left text-sm text-foreground shadow-sm ring-offset-control-surface data-[placeholder]:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:text-left",r==="sm"&&"h-8 px-2 py-1 text-xs",e),...n,children:[t,jsxRuntime.jsx(At__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:m("h-4 w-4 opacity-50",o)})})]}));SR.displayName="SelectTrigger";var sy=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.ScrollUpButton,{ref:o,className:m("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronUp,{"aria-hidden":"true",className:"h-4 w-4"})}));sy.displayName="SelectScrollUpButton";var ly=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.ScrollDownButton,{ref:o,className:m("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4"})}));ly.displayName="SelectScrollDownButton";var TR=ho__namespace.forwardRef(({className:e,children:t,position:o="popper",viewportClassName:r,disableTriggerViewportSizing:n=false,...i},s)=>{let l=ke();return jsxRuntime.jsx(At__namespace.Portal,{children:jsxRuntime.jsxs(At__namespace.Content,{...l,...i,ref:s,position:o,"data-monkeys-component":"select","data-slot":"content","data-surface":"menu",className:m(hm,"relative max-h-[var(--radix-select-content-available-height)] overflow-y-auto overflow-x-hidden",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),children:[jsxRuntime.jsx(sy,{}),jsxRuntime.jsx(At__namespace.Viewport,{className:m("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]",o==="popper"&&!n&&"h-[var(--radix-select-trigger-height)]",r),children:t}),jsxRuntime.jsx(ly,{})]})})});TR.displayName="SelectContent";var NR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.Label,{ref:o,className:m("px-2 py-1.5 text-sm font-semibold",e),...t}));NR.displayName="SelectLabel";var RR=ho__namespace.forwardRef(({className:e,children:t,indicatorClassName:o,itemText:r,hideIndicator:n=false,...i},s)=>jsxRuntime.jsxs(At__namespace.Item,{ref:s,className:m(Ss,"w-full",n?"px-2":"pl-8 pr-2",e),...i,children:[n?null:jsxRuntime.jsx("span",{className:m("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",o),children:jsxRuntime.jsx(At__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}),r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(At__namespace.ItemText,{asChild:true,children:jsxRuntime.jsx("span",{className:"sr-only",children:r})}),t]}):jsxRuntime.jsx(At__namespace.ItemText,{children:t})]}));RR.displayName="SelectItem";var MR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.Separator,{ref:o,className:m("-mx-1 my-1 h-px bg-muted",e),...t}));MR.displayName="SelectSeparator";function Un(e){if(!e)return;let t=/^data:image\/svg\+xml(?:[;,]|$)/i.test(e.trim());if(!t)try{t=/\.svgz?$/i.test(decodeURIComponent(new URL(e,"https://preview.invalid").pathname));}catch{return}return t?{backgroundColor:"var(--monkeys-media-svg-background)",objectFit:"contain"}:void 0}a(Un,"svgPreviewSurface");var DR=a(({aspectRatio:e="square",maxSquareHeight:t=true,className:o}={})=>m("w-full overflow-hidden bg-muted",(e==="square"||e==="1:1")&&"aspect-square",(e==="square"||e==="1:1")&&t&&"max-h-[300px]",e==="4:3"&&"aspect-[4/3]",e==="3:4"&&"aspect-[3/4]",(e==="video"||e==="16:9")&&"aspect-video",e==="9:16"&&"aspect-[9/16]",o),"mediaPreviewFrameClassName"),Ms=ho__namespace.forwardRef(({aspectRatio:e="square",maxSquareHeight:t=true,className:o,...r},n)=>jsxRuntime.jsx("div",{ref:n,className:DR({aspectRatio:e,maxSquareHeight:t,className:o}),...r}));Ms.displayName="MediaPreviewFrame";var Is=ho__namespace.forwardRef(({fit:e="contain",className:t,style:o,...r},n)=>{let i=Un(r.src);return jsxRuntime.jsx("img",{ref:n,className:m("block size-full",e==="contain"?"object-contain":"object-cover",t),style:{...i,...i?{objectFit:e}:{},...o},...r})});Is.displayName="MediaPreviewImage";var Cm=xo__namespace.Root;var PR=xo__namespace.Portal,cy=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=ke();return jsxRuntime.jsx(xo__namespace.Overlay,{...r,...t,ref:o,"data-monkeys-component":"sheet","data-slot":"overlay","data-monkeys-overlay":true,className:m("theme-overlay-backdrop fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)})});cy.displayName="SheetOverlay";var ER={top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm"},Yd=ho__namespace.forwardRef(({side:e="right",className:t,children:o,...r},n)=>{let i=ke();return jsxRuntime.jsxs(PR,{children:[jsxRuntime.jsx(cy,{}),jsxRuntime.jsxs(xo__namespace.Content,{...i,...r,ref:n,"data-monkeys-component":"sheet","data-slot":"content","data-surface":"dialog","data-monkeys-dialog-content":true,className:m("fixed z-50 gap-4 p-6 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",ln("dialog",{rounded:false}),ER[e],t),children:[jsxRuntime.jsxs(xo__namespace.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-dialog-surface transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]}),jsxRuntime.jsx(ks,{children:o})]})]})});Yd.displayName="SheetContent";var Xd=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(xo__namespace.Title,{ref:o,className:m("text-lg font-semibold text-foreground",e),...t}));Xd.displayName="SheetTitle";var AR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(xo__namespace.Description,{ref:o,className:m("text-sm text-muted-foreground",e),...t}));AR.displayName="SheetDescription";var uy=["pulse","shimmer","shimmer-soft","shimmer-diagonal","shimmer-vertical","drift","outline","none"];function my(e,t=false){if(!(e===void 0||uy.includes(e))&&!(t&&(e==="shimmer-shared"||e==="shimmer-stagger")))throw new TypeError(`Skeleton animation must be ${uy.join(", ")}${t?", shimmer-shared, or shimmer-stagger":""}.`)}a(my,"validateSkeletonAnimation");var Tm=ho.createContext(null),Es=ho.createContext(void 0);function Nm(e){delete e.dataset.skeletonReady;for(let t of ["width","offset","delay"])e.style.removeProperty(`--monkeys-skeleton-${t}`);}a(Nm,"clearGeometry");function LR(e,t,o,r){let n=ho.useMemo(()=>({nodes:new Map,update:a(()=>{},"update")}),[]);return ho.useEffect(()=>{if(!o||t||e!=="shimmer-shared"&&e!=="shimmer-stagger")return;let i=window.matchMedia("(prefers-reduced-motion: reduce)"),s,l,d=false,c=new Set,p=a(()=>{if(l=void 0,!d)return;let b=[...n.nodes.keys()].filter(S=>S.isConnected);if(b.sort((S,T)=>S.compareDocumentPosition(T)&2?1:-1),e==="shimmer-stagger"){b.forEach((S,T)=>{let C=n.nodes.get(S)?.item??T;S.style.setProperty("--monkeys-skeleton-delay",`${Math.min(C*80,400)}ms`);});return}let x=r?.current??b[0]?.parentElement;for(let S of b)for(;x&&!x.contains(S);)x=x.parentElement;let y=new Set(b);for(let S of b)for(let T=S.parentElement;T&&(y.add(T),T!==x);T=T.parentElement);x&&y.add(x);for(let S of c)y.has(S)||(s?.unobserve(S),c.delete(S));for(let S of y)c.has(S)||(s?.observe(S),c.add(S));let k=b.map(S=>S.getBoundingClientRect()),w=b.map((S,T)=>{let C=getComputedStyle(S),R=C.boxSizing==="border-box"?0:parseFloat(C.paddingLeft)+parseFloat(C.paddingRight)+parseFloat(C.borderLeftWidth)+parseFloat(C.borderRightWidth),M=parseFloat(C.width)+R,I=M?k[T].width/M:1;return Math.abs(I-1)<1e-4?1:I}),v=Math.min(...k.map(S=>S.left)),h=Math.max(...k.map(S=>S.right));b.forEach((S,T)=>{let C=k[T];if(!C.width||!C.height){Nm(S);return}let R=w[T];S.style.setProperty("--monkeys-skeleton-width",`${(h-v)/R}px`),S.style.setProperty("--monkeys-skeleton-offset",`${(v-C.left)/R}px`),S.dataset.skeletonReady||(S.style.setProperty("--monkeys-skeleton-delay",`${-(performance.now()%2600)}ms`),S.dataset.skeletonReady="true");});},"measure"),u=a(()=>{d&&l===void 0&&(l=window.requestAnimationFrame(p));},"schedule"),g=a(()=>{d=false,s?.disconnect(),s=void 0,c.clear(),l!==void 0&&window.cancelAnimationFrame(l),l=void 0,window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true),n.nodes.forEach((b,x)=>Nm(x));},"stop"),f=a(()=>{g(),!(i.matches||e==="shimmer-shared"&&typeof ResizeObserver>"u")&&(d=true,e==="shimmer-shared"&&(s=new ResizeObserver(u),window.addEventListener("resize",u),window.addEventListener("scroll",u,{capture:true,passive:true})),u());},"start");return n.update=u,f(),i.addEventListener("change",f),()=>{g(),i.removeEventListener("change",f),n.update=()=>{};}},[e,t,o,n,r]),ho.useEffect(()=>{n.update();}),n}a(LR,"useGroupRegistry");function qn({animation:e,animated:t,children:o,independent:r=false,containerRef:n}){if(my(e,true),t!==void 0&&typeof t!="boolean")throw new TypeError("SkeletonGroup animated must be a boolean.");let i=ho.useContext(Tm),s=ho.useContext(Es),l=r||e!==void 0||!i,d=e??i?.animation??"pulse",c=!!i?.disabled||t===false||d==="none",p=LR(d,c,l,n),u=ho.useMemo(()=>({animation:d,disabled:c,registry:l?p:i.registry}),[d,c,l,p,i]),g=jsxRuntime.jsx(Tm.Provider,{value:u,children:o});return jsxRuntime.jsx(Es.Provider,{value:l?void 0:s,children:g})}a(qn,"SkeletonScope");function Qd({index:e,children:t}){let o=ho.useContext(Es);return jsxRuntime.jsx(Es.Provider,{value:o??e,children:t})}a(Qd,"SkeletonItem");function Im(e,t){return ho.useMemo(()=>{let o;return r=>{if(e(r),typeof t=="function"){if(o)o(),o=void 0;else if(r===null){t(null);return}if(r!==null){let n=t(r);typeof n=="function"&&(o=n);}}else t&&(t.current=r);}},[e,t])}a(Im,"useSkeletonRef");function Zd(e,t=true,o){my(e);let r=ho.useContext(Tm),n=ho.useContext(Es),i=!t||r?.disabled?"none":e??r?.animation??"pulse",[s,l]=ho.useState(null),d=Im(l,o),c=e===void 0&&(i==="shimmer-shared"||i==="shimmer-stagger")?r?.registry:void 0;return ho.useEffect(()=>{if(!(!s||!c))return c.nodes.set(s,{item:n}),c.update(),()=>{c.nodes.delete(s),Nm(s),c.update();}},[s,c,n,i]),{ref:d,mode:i,style:i==="shimmer-stagger"&&n!==void 0?{"--monkeys-skeleton-delay":`${Math.min(n*80,400)}ms`}:void 0}}a(Zd,"useSkeletonMotion");var FR=ho.forwardRef(a(function({animation:t,animated:o,children:r,...n},i){let s=ho.useRef(null),l=ho.useCallback(c=>{s.current=c;},[]),d=Im(l,i);return jsxRuntime.jsx(qn,{animation:t,animated:o,independent:true,containerRef:s,children:jsxRuntime.jsx("div",{...n,ref:d,children:r})})},"SkeletonGroup"));function yy({selectedCount:e,loadedStart:t,loadedEnd:o,total:r,currentPage:n=1,pageSize:i=Math.max(1,o||1),pageSizeOptions:s=[],loading:l,selectedLabel:d,loadedLabel:c,pageSizeLabel:p,pageText:u,tone:g="default",className:f,classNames:b,onJump:x,onJumpToPage:y,onPageSizeChange:k}){let w=Ye().pagination,v=typeof t=="number"&&t>0&&o>=t,h=c??(v?w.range({start:t,end:o,total:r}):w.range({start:0,end:o,total:r})),[S,T]=ho.useState(false),[C,R]=ho.useState(String(n)),M=ho.useRef(null),I=r>0?Math.max(1,Math.ceil(r/Math.max(1,i))):1;if(ho.useEffect(()=>{S||R(String(n));},[n,S]),ho.useEffect(()=>{if(!S)return;let B=window.setTimeout(()=>{M.current?.focus(),M.current?.select();},0);return ()=>window.clearTimeout(B)},[S]),g==="hard-edge"){let B=a(()=>{let N=Math.floor(Number(C));if(!Number.isFinite(N)||Number.isNaN(N)){R(String(n)),T(false);return}let D=Math.min(I,Math.max(1,N));T(false),D!==n&&y?.(D);},"confirmJump");return jsxRuntime.jsxs("div",{className:m("flex items-center border-t bg-background px-4 py-3",b?.root,f),"data-monkeys-component":"collection-footer","data-tone":"hard-edge",children:[jsxRuntime.jsxs("div",{className:m("flex min-w-0 items-center gap-1 whitespace-nowrap text-sm text-muted-foreground",b?.summary),children:[e!==void 0?jsxRuntime.jsxs("span",{children:[d??w.selected({count:e})," \xB7"]}):null,y&&r>0?S?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:w.jumpToPage}),jsxRuntime.jsx(un,{ref:M,type:"number",inputMode:"numeric",min:1,max:I,value:C,onChange:N=>R(N.currentTarget.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.currentTarget.blur()),N.key==="Escape"&&(N.preventDefault(),T(false),R(String(n)));},onBlur:B,className:"h-7 w-20 px-2 text-xs","aria-label":w.jumpToPage}),jsxRuntime.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",I," ",w.pages]})]}):jsxRuntime.jsxs("button",{type:"button",className:m("inline-flex items-center text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",b?.jumpButton),onClick:()=>{R(String(n)),T(true),x?.();},title:w.clickToJump,children:[h,u?` (${u})`:null,l?jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"ml-1 inline-block h-3 w-3 animate-spin"}):null]}):jsxRuntime.jsxs("span",{className:"inline-flex items-center",children:[h,u?` (${u})`:null,l?jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"ml-1 h-3 w-3 animate-spin"}):null]})]}),k&&s.length>0?jsxRuntime.jsx("div",{className:m("ml-auto",b?.pageSizeControl),children:jsxRuntime.jsxs(Ts,{children:[jsxRuntime.jsx(Ns,{asChild:true,children:jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:m("h-8 gap-1 px-2",b?.pageSizeButton),"aria-label":typeof p=="string"?p:w.perLoad,children:[i,jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4"})]})}),jsxRuntime.jsxs(yi,{align:"end",className:"w-32",children:[jsxRuntime.jsx(xm,{children:p??w.perLoad}),jsxRuntime.jsx(vm,{}),jsxRuntime.jsx(iy,{value:String(i),onValueChange:N=>{let D=Number(N);Number.isFinite(D)&&k(D);},children:s.map(N=>jsxRuntime.jsx(ym,{value:String(N),children:N},N))})]})]})}):null]})}return jsxRuntime.jsx(jd,{total:r,loadedStart:t,loadedEnd:o,selectedCount:e,page:n,pageSize:i,pageSizeOptions:s,loading:l,totalLabel:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[h," ",u?`(${u})`:null]}),selectedLabel:d,pageSizeLabel:p,className:f,classNames:{root:b?.root,summary:b?.summary,pageSize:b?.pageSizeControl},onSummaryClick:x,onPageSizeChange:k})}a(yy,"DataExplorerCollectionFooter");function GR(e){return typeof e=="number"?`${e}px`:e}a(GR,"toCssSize");function vy({label:e,leading:t,children:o,actions:r,maxFieldsHeight:n=80,className:i,classNames:s,style:l,...d}){let c={maxHeight:GR(n)};return jsxRuntime.jsx("div",{className:j("border-b border-border/60 bg-background px-8 py-3",s?.root,i),style:l,...d,children:jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-start gap-2 text-sm",s?.layout),children:[e?jsxRuntime.jsx("div",{className:j("flex h-9 shrink-0 items-center font-semibold text-foreground",s?.label),children:e}):null,jsxRuntime.jsx("div",{className:j("min-w-0 flex-1 overflow-y-auto overscroll-contain",s?.fieldsViewport),style:c,children:jsxRuntime.jsxs("div",{className:j("flex flex-wrap items-center gap-2",s?.fields),children:[t,o]})}),r?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",s?.actions),children:r}):null]})})}a(vy,"DataExplorerFilterBar");function wy(e){return e!=null&&e!==false&&e!==""}a(wy,"hasContent");function ec({field:e,label:t=e?.label,icon:o=e?.icon,value:r=e?.value,helperText:n=e?.helperText,error:i=e?.error,required:s=e?.required??false,disabled:l=e?.disabled??false,children:d,context:c,className:p,valueClassName:u=e?.valueClassName,classNames:g,dataAttributes:f=e?.dataAttributes,labelDataAttributes:b=e?.labelDataAttributes,valueDataAttributes:x=e?.valueDataAttributes,helperDataAttributes:y=e?.helperDataAttributes,errorDataAttributes:k=e?.errorDataAttributes}){let w={...e?.classNames,...g},v=d??(e?.render?e.render(c):r),h=wy(i);return jsxRuntime.jsxs("div",{...f,title:e?.title,"aria-disabled":l||void 0,"data-disabled":l||void 0,"data-invalid":h||void 0,"data-required":s||void 0,className:j("min-w-0 space-y-1",l&&"opacity-60",w.root,e?.className,p),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center gap-1.5 text-[13px] font-medium text-muted-foreground",w.label),children:[o?jsxRuntime.jsx("span",{className:j("inline-flex shrink-0 items-center justify-center",w.icon),children:o}):null,jsxRuntime.jsx("span",{...b,className:"min-w-0 truncate",children:t}),s?jsxRuntime.jsx("span",{"aria-hidden":"true",className:j("text-destructive-text",w.required),children:"*"}):null]}),jsxRuntime.jsx("div",{...x,className:j("min-w-0 max-w-full text-[15px] leading-6 text-foreground [overflow-wrap:anywhere]",w.value,u),children:v}),wy(n)?jsxRuntime.jsx("div",{...y,"data-slot":"helper",className:j("min-w-0 max-w-full text-xs leading-5 text-muted-foreground [overflow-wrap:anywhere]",w.helper),children:n}):null,h?jsxRuntime.jsx("div",{...k,role:"alert","data-slot":"error",className:j("min-w-0 max-w-full text-xs leading-5 text-destructive-text [overflow-wrap:anywhere]",w.error),children:i}):null]})}a(ec,"DataExplorerDetailField");function tc({section:e,title:t=e?.title,fields:o=e?.fields,children:r,context:n,className:i,classNames:s,fieldClassNames:l}){let d={...e?.classNames,...s},c=(o||[]).filter(g=>!(Mt(g.hidden,n)??false)),p=r??(typeof e?.children=="function"?e.children(n):e?.children);return !(!!p||c.length>0)||Mt(e?.hidden,n)?null:jsxRuntime.jsxs("section",{className:j("border-b border-border pb-6 last:border-b-0 last:pb-0",d.root,e?.className,i),children:[t?jsxRuntime.jsx("div",{className:j("mb-4 text-[15px] font-semibold text-foreground",d.title),children:t}):null,jsxRuntime.jsxs("div",{className:j("space-y-4",d.body),children:[p,c.map((g,f)=>jsxRuntime.jsx(ec,{field:g,context:n,classNames:l},g.id||String(f)))]})]})}a(tc,"DataExplorerDetailSection");function $R(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-[18px] w-[18px]",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]})}a($R,"DefaultCloseIcon");function Ty(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m15 18-6-6 6-6"})})}a(Ty,"DefaultChevronLeftIcon");function Ny(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})}a(Ny,"DefaultChevronRightIcon");function Ry({title:e,subtitle:t,leading:o,actions:r,preview:n,previewVisible:i=true,previewStyle:s,previewPadded:l=false,previewCentered:d=true,sections:c=[],rightPanel:p,context:u,navigation:g,closeLabel:f="Close",closeIcon:b,closeVisible:x=true,onClose:y,appearance:k,className:w,classNames:v}){let h=Ct(Et(k)),S=(g?.visible??true)&&typeof g?.count=="number"&&g.count>1,T=c.filter(C=>!(Mt(C.hidden,u)??false));return jsxRuntime.jsxs("div",{className:j(h.slots.detailRoot,v?.root,w),style:h.styles.detailRoot,children:[jsxRuntime.jsxs("div",{className:j(h.slots.detailHeader,v?.header),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center gap-3",v?.headerMain),children:[o?jsxRuntime.jsx("div",{className:j(h.slots.detailLeading,v?.leading),children:o}):null,jsxRuntime.jsxs("div",{className:j("min-w-0",v?.titleGroup),children:[jsxRuntime.jsx("div",{className:j("truncate text-[20px] font-semibold leading-tight text-foreground",v?.title),children:e}),t?jsxRuntime.jsx("div",{className:j("mt-1 min-w-0 truncate text-sm text-muted-foreground",v?.subtitle),children:t}):null]})]}),jsxRuntime.jsxs("div",{className:j("flex items-center gap-2",v?.headerActions),children:[r,S?jsxRuntime.jsxs("div",{className:j(h.slots.detailNavigation,v?.navigation),children:[jsxRuntime.jsx("button",{type:"button","aria-label":g?.previousLabel||"Previous",className:j(h.slots.detailNavigationButton,v?.navigationButton),disabled:!g?.onPrevious,onClick:g?.onPrevious,children:jsxRuntime.jsx(Ty,{})}),jsxRuntime.jsxs("div",{className:j("min-w-[74px] text-center text-xs font-medium text-muted-foreground",v?.navigationCount),children:[g.index+1," / ",g.count]}),jsxRuntime.jsx("button",{type:"button","aria-label":g?.nextLabel||"Next",className:j(h.slots.detailNavigationButton,v?.navigationButton),disabled:!g?.onNext,onClick:g?.onNext,children:jsxRuntime.jsx(Ny,{})})]}):null,x?jsxRuntime.jsx("button",{type:"button","aria-label":f,className:j(h.slots.detailCloseButton,v?.closeButton),onClick:y,children:b??jsxRuntime.jsx($R,{})}):null]})]}),jsxRuntime.jsxs("div",{className:j("grid min-h-0 flex-1",i?"xl:grid-cols-[minmax(0,1fr)_380px] 2xl:grid-cols-[minmax(0,1fr)_400px]":"grid-cols-1",v?.body),children:[i?jsxRuntime.jsx("div",{className:j(h.slots.detailPreviewPanel,v?.previewPanel),children:jsxRuntime.jsxs("div",{className:j("flex h-full min-h-0 flex-col",v?.previewStack),children:[S?jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsxs("div",{className:j("text-xs text-muted-foreground xl:hidden",v?.previewMobileCount),children:[g.index+1," / ",g.count]})}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 justify-center",d&&"items-stretch",v?.previewWrapper),children:jsxRuntime.jsxs("div",{className:j(h.slots.detailPreviewFrame,v?.previewFrame),style:s,children:[jsxRuntime.jsx("div",{className:j("relative flex h-full w-full items-center justify-center",l&&"p-4",v?.previewContent),children:n}),S?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button","aria-label":g?.previousLabel||"Previous",className:j(h.slots.previewNavigationButton,"left-4",v?.previewNavigationButton),disabled:!g?.onPrevious,onClick:g?.onPrevious,children:jsxRuntime.jsx(Ty,{})}),jsxRuntime.jsx("button",{type:"button","aria-label":g?.nextLabel||"Next",className:j(h.slots.previewNavigationButton,"right-4",v?.previewNavigationButton),disabled:!g?.onNext,onClick:g?.onNext,children:jsxRuntime.jsx(Ny,{})})]}):null]})})]})}):null,jsxRuntime.jsx("div",{className:j(h.slots.detailRightPanel,v?.rightPanel),children:jsxRuntime.jsx("div",{className:j(h.slots.detailRightPanelBody,v?.rightPanelBody),style:{scrollbarGutter:"stable"},children:p??jsxRuntime.jsx("div",{className:j("space-y-6",v?.sections),children:T.map(C=>jsxRuntime.jsx(tc,{section:C,context:u,className:v?.section,fieldClassNames:{root:v?.field}},C.id))})})})]})]})}a(Ry,"DataExplorerDetailShell");function Iy(e){if(e===null)return null;if(typeof e=="string"&&e.trim().length>0)return e;throw new TypeError("BaseField validate must return a non-empty error string or null.")}a(Iy,"resolveBaseFieldValidationResult");var Dm=ho.createContext(null);function Yn(){let e=ho.useContext(Dm),t=ho.useRef(null);t.current===null&&(t.current=Symbol("BaseFieldControl"));let o=e?.registerControl;ho.useEffect(()=>{if(!(!o||t.current===null))return o(t.current)},[o]);let r=e?.notifyBlur,n=e?.notifyChange;return {invalid:e?.invalid??false,notifyBlur:ho.useCallback(i=>r?.(i),[r]),notifyChange:ho.useCallback(i=>n?.(i),[n])}}a(Yn,"useBaseFieldControl");var eM={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},tM={sm:"text-[10px]",md:"text-[11px]",lg:"text-xs"};function oM(e,...t){for(let o of t)if(o){if(typeof o=="function"){o(e);continue}o.current=e;}}a(oM,"setRefs");var vi=ho.forwardRef(a(function({label:t,description:o,indeterminate:r=false,invalid:n=false,disabled:i=false,controlSize:s,appearance:l,className:d,classNames:c,style:p,checked:u,defaultChecked:g,onBlur:f,onChange:b,"aria-invalid":x,...y},k){for(let[L,F]of [["indeterminate",r],["invalid",n],["disabled",i]])if(typeof F!="boolean")throw new TypeError(`BaseCheckbox ${L} must be a boolean.`);if(s!==void 0&&s!=="sm"&&s!=="md"&&s!=="lg")throw new TypeError('BaseCheckbox controlSize must be "sm", "md", or "lg".');let w=Pe(l),v=ke(),h=Ne(w),S=Yn(),T=n||S.invalid,C=V(t),R=Rd(o),M=ho.useRef(null),I=ho.useRef(r);I.current=r;let[B,N]=ho.useState(g??false),D=u!==void 0,E=!!(D?u:B),P=r||E,W=r?"mixed":E?"checked":"unchecked",H=ho.useCallback(L=>{M.current=L,L&&(L.indeterminate=I.current),oM(L,k);},[k]);ho.useEffect(()=>{M.current&&(M.current.indeterminate=r);},[r]);let A=a(L=>{i||(D||N(L.currentTarget.checked),b?.(L),S.notifyChange(L.currentTarget.checked),M.current&&(M.current.indeterminate=r));},"handleChange");return jsxRuntime.jsxs("label",{...v,"data-monkeys-component":"checkbox","data-slot":"root","data-state":W,"data-size":s,"data-invalid":T||void 0,"data-disabled":i||void 0,className:m(h.slots.checkboxRoot,!R&&"items-center",i&&h.slots.checkboxDisabled,c?.root,d),style:{...h.styles.checkboxRoot,...p},children:[jsxRuntime.jsxs("span",{"data-slot":"box","data-state":W,"data-size":s,className:m(h.slots.checkboxBox,!R&&"mt-0",P&&h.slots.checkboxBoxChecked,T&&h.slots.checkboxBoxInvalid,s&&eM[s],c?.box),style:{...h.styles.checkboxBox},children:[jsxRuntime.jsx("input",{...y,ref:H,type:"checkbox",disabled:i,checked:u,defaultChecked:g,"aria-invalid":x??(T||void 0),"aria-checked":r?"mixed":E,"data-slot":"input","data-state":W,"data-size":s,"data-invalid":T||void 0,"data-disabled":i||void 0,className:m(h.slots.checkboxInput,c?.input),onBlur:L=>{f?.(L),S.notifyBlur(L.currentTarget.checked);},onChange:A}),P?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator","data-state":W,"data-size":s,className:m(h.slots.checkboxIndicator,s&&tM[s],c?.indicator),children:r?"\u2013":"\u2713"}):null]}),C||R?jsxRuntime.jsxs("span",{"data-slot":"content",className:m(h.slots.checkboxContent,c?.content),children:[C?jsxRuntime.jsx("span",{"data-slot":"label",className:m(h.slots.checkboxLabel,c?.label),children:t}):null,R?jsxRuntime.jsx("span",{"data-slot":"description",className:m(h.slots.checkboxDescription,c?.description),children:o}):null]}):null]})},"BaseCheckbox"));function nM(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}a(nM,"MoreIcon");function rc({item:e,itemId:t=e?.id,source:o=e?.source,actions:r=[],label:n="Actions",triggerLabel:i="Open actions",triggerIcon:s,align:l="end",sideOffset:d=6,appearance:c,className:p,classNames:u}){let[g,f]=ho.useState(false),b=Ct(Et(c)),x={itemId:t,item:e,source:o},y=r.filter(k=>Mt(k.visible,x)??true);return y.length===0?null:jsxRuntime.jsx("span",{className:j("inline-flex",u?.root),children:jsxRuntime.jsxs(Bt__namespace.Root,{open:g,onOpenChange:f,children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{type:"button","aria-label":i,className:j(b.slots.menuTrigger,u?.trigger,p),onClick:k=>k.stopPropagation(),children:[s??jsxRuntime.jsx(nM,{}),jsxRuntime.jsx("span",{className:"sr-only",children:i})]})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:l,sideOffset:d,className:j(b.slots.menuContent,u?.content),style:b.styles.menuContent,onClick:k=>k.stopPropagation(),children:[n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Bt__namespace.Label,{className:j(b.slots.menuLabel,u?.label),children:n}),jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)})]}):null,y.map(k=>{let w=(Mt(k.disabled,x)??false)||(Mt(k.loading,x)??false);return k.render?jsxRuntime.jsxs("div",{children:[k.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null,k.render(x),k.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null]},k.id):jsxRuntime.jsxs("div",{children:[k.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:j("-mx-1 my-1 h-px bg-border",u?.separator)}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:k.title,disabled:w,className:j(b.slots.menuItem,Vn(b,k.tone),u?.item,k.className),style:b.styles.menuItem,onSelect:()=>{!k.onAction||w||k.onAction(x);},onContextMenu:v=>{!k.onContextAction||w||(v.preventDefault(),v.stopPropagation(),f(false),k.onContextAction(x));},children:[k.icon?jsxRuntime.jsx("span",{className:j(b.slots.menuItemIcon,u?.itemIcon),children:k.icon}):null,jsxRuntime.jsx("span",{className:j(b.slots.menuItemLabel,u?.itemLabel),children:k.label})]}),k.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null]},k.id)})]})})]})})}a(rc,"DataExplorerDisplayActionMenu");function iM(e){return e?Array.isArray(e)?e.filter(Boolean):[e]:[]}a(iM,"normalizeMedia");function sM(e){return String(e||"unknown").toLowerCase()}a(sM,"resolveMediaKind");function wi({media:e,fallbackTitle:t,empty:o,className:r,classNames:n,onOpen:i}){let l=iM(e)[0];if(!l)return o?jsxRuntime.jsx("div",{className:j("flex min-h-24 items-center justify-center bg-muted/30 text-sm text-muted-foreground",n?.placeholder,r),children:o}):null;if(l.node)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",n?.root,r),children:l.node});let d=sM(l.kind),c=String(l.src||l.thumbnail||"").trim(),p=l.title??t,u=l.alt||(typeof p=="string"?p:"preview"),g=typeof i=="function",f=c?d==="image"||d==="unknown"?jsxRuntime.jsx("img",{src:c,style:Un(c),alt:u,className:j("h-auto w-full object-contain",n?.media),loading:"lazy",decoding:"async",draggable:false}):d==="video"?jsxRuntime.jsx("video",{src:c,className:j("h-auto w-full",n?.media),controls:true,preload:"metadata"}):d==="audio"?jsxRuntime.jsx("audio",{src:c,className:j("w-full",n?.media),controls:true,preload:"metadata"}):jsxRuntime.jsxs("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-1 bg-muted/30 p-4 text-center text-sm text-muted-foreground",n?.placeholder),children:[p?jsxRuntime.jsx("span",{className:j("max-w-full truncate",n?.title),children:p}):null,jsxRuntime.jsx("span",{className:"max-w-full truncate",children:c})]}):jsxRuntime.jsx("div",{className:j("flex min-h-24 items-center justify-center bg-muted/30 text-sm text-muted-foreground",n?.placeholder),children:p||"No preview"});return g?jsxRuntime.jsx("button",{type:"button",className:j("block min-w-0 overflow-hidden text-left",n?.root,r),onClick:()=>i?.(l,0),children:f}):jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",n?.root,r),children:f})}a(wi,"DataExplorerDisplayMedia");function dM(e){return e?Array.isArray(e)?e.every(t=>!!t&&typeof t=="object"&&("src"in t||"thumbnail"in t||"node"in t||"kind"in t)):typeof e=="object"&&("src"in e||"thumbnail"in e||"node"in e||"kind"in e):false}a(dM,"isDisplayMedia");function cM(e){if(e?.length)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((t,o)=>jsxRuntime.jsx("span",{title:t.title,className:j("inline-flex max-w-full items-center rounded-full border border-border/60 px-2 py-0.5 text-xs font-medium",t.tone==="primary"&&"border-primary/30 bg-primary/10 text-primary",t.tone==="success"&&"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))]",t.tone==="warning"&&"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",t.tone==="danger"&&"border-destructive/30 bg-destructive/10 text-destructive-text",t.tone==="muted"&&"bg-muted text-muted-foreground"),children:jsxRuntime.jsx("span",{className:"truncate",children:t.label})},t.id??o))})}a(cM,"renderBadges");function uM(e){if(e?.length)return jsxRuntime.jsx("dl",{className:"grid min-w-0 grid-cols-1 gap-2 text-xs sm:grid-cols-2",children:e.map((t,o)=>jsxRuntime.jsxs("div",{className:"min-w-0",children:[t.label?jsxRuntime.jsx("dt",{className:"truncate text-muted-foreground",title:t.title,children:t.label}):null,jsxRuntime.jsx("dd",{className:"mt-0.5 min-w-0 truncate text-foreground",children:t.value})]},t.id??o))})}a(uM,"renderMetadata");function pM(e){if(e?.length)return jsxRuntime.jsx("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:e.map((t,o)=>jsxRuntime.jsx("span",{className:"max-w-full truncate rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:t},o))})}a(pM,"renderKeywords");function Qn({item:e,title:t=e?.title,description:o=e?.description,badges:r=cM(e?.badges),meta:n=e?.status,actions:i,media:s=e?.media,header:l,headerLeading:d,headerContent:c,overlay:p,footer:u,children:g,selected:f=e?.selected,disabled:b=e?.disabled,interactive:x,role:y,tabIndex:k,appearance:w,className:v,classNames:h,onClick:S,onKeyDown:T}){let C=Ct(Et(w)),R=x??!!(S||T),I=l!==void 0?!!l:!!(d||c||t||o||r||n||i),B=dM(s)?jsxRuntime.jsx(wi,{media:s,fallbackTitle:t}):s,N=uM(e?.metadata),D=pM(e?.keywords),E=g!==void 0?g:N||D?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[N,D]}):void 0,P=!!E;return jsxRuntime.jsxs("article",{className:j(C.slots.cardRoot,R&&!b&&C.slots.cardInteractive,f&&C.slots.cardSelected,b&&C.slots.cardDisabled,h?.root,v),"aria-disabled":b||void 0,role:y,tabIndex:k,style:C.styles.cardRoot,onClick:b?void 0:S,onKeyDown:b?void 0:T,children:[p?jsxRuntime.jsx("div",{className:j(h?.overlay),children:p}):null,I?jsxRuntime.jsx("div",{className:j(C.slots.cardHeader,h?.header),children:l!==void 0?l:jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-start justify-between gap-3",h?.headerMain),children:[d?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",h?.headerLeading),children:d}):null,jsxRuntime.jsx("div",{className:j("min-w-0 flex-1",h?.headerContent),children:c??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t?jsxRuntime.jsx("div",{className:j("truncate text-sm font-semibold leading-none text-foreground",h?.title),children:t}):null,o?jsxRuntime.jsx("div",{className:j("mt-1 min-w-0 text-sm text-muted-foreground [overflow-wrap:anywhere]",h?.description),children:o}):null,r?jsxRuntime.jsx("div",{className:j("mt-2 flex flex-wrap items-center gap-2",h?.badges),children:r}):null]})}),n||i?jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n?jsxRuntime.jsx("div",{className:j("min-w-0 max-w-[12rem] truncate text-sm text-muted-foreground",h?.meta),children:n}):null,i?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",h?.actions),children:i}):null]}):null]})}):null,B?jsxRuntime.jsx("div",{className:j(C.slots.cardMedia,h?.media),children:B}):null,P?jsxRuntime.jsx("div",{className:j("min-w-0 px-4 pb-4",h?.body),children:E}):null,u?jsxRuntime.jsx("div",{className:j(C.slots.cardFooter,h?.footer),children:u}):null]})}a(Qn,"DataExplorerDisplayCard");function nc({media:e,title:t,description:o,meta:r,badges:n,actions:i,footer:s,children:l,className:d,classNames:c}){let p=!!t||!!o||!!r||!!n||!!i;return jsxRuntime.jsxs("article",{className:j("flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-background",c?.root,d),children:[e?jsxRuntime.jsx("div",{className:j("shrink-0 overflow-hidden",c?.media),children:e}):null,p?jsxRuntime.jsxs("div",{className:j("flex flex-col gap-3 p-4",c?.header),children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[t?jsxRuntime.jsx("div",{className:j("truncate text-sm font-semibold text-foreground",c?.title),children:t}):null,o?jsxRuntime.jsx("div",{className:j("mt-1 text-sm text-muted-foreground",c?.description),children:o}):null]}),r||i?jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r?jsxRuntime.jsx("div",{className:j("text-sm text-muted-foreground",c?.meta),children:r}):null,i?jsxRuntime.jsx("div",{className:j("flex items-center gap-2",c?.actions),children:i}):null]}):null]}),n?jsxRuntime.jsx("div",{className:j("flex flex-wrap items-center gap-2",c?.badges),children:n}):null]}):null,l?jsxRuntime.jsx("div",{className:j("min-w-0 px-4 pb-4",c?.body),children:l}):null,s?jsxRuntime.jsx("div",{className:j("shrink-0 border-t border-border/60 px-4 py-3",c?.footer),children:s}):null]})}a(nc,"DataExplorerViewItemShell");function ac(e){let{item:t,index:o,itemId:r,context:n,capabilities:i,itemDefinition:s,className:l,selected:d,actions:c,onOpen:p,onSelectionChange:u}=e;if(s?.render)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:s.render(e)});let g=typeof s?.shellProps=="function"?s.shellProps({item:t,index:o,itemId:r,context:n,capabilities:i,itemDefinition:s,className:l,selected:d,actions:c,onOpen:p,onSelectionChange:u}):s?.shellProps;return jsxRuntime.jsx(nc,{...g,className:l})}a(ac,"DataExplorerViewItem");function hM(e){switch(e){case "list":return "flex min-h-0 flex-col gap-3";case "waterfall":return "columns-1 gap-4 sm:columns-2 lg:columns-3";default:return "grid min-h-0 gap-4"}}a(hM,"getItemsClassName");function yM(e){if(e==="waterfall")return "mb-4 break-inside-avoid"}a(yM,"getDefaultItemClassName");function xM(e,t){return String(t)}a(xM,"defaultResolveItemId");function vM(e){return typeof e=="number"?`${Am(e,220)}px`:e}a(vM,"resolveMeasuredGridMinColumnWidth");function Ay(e,t,o){return Math.max(1,Math.ceil((e+o)/(t+o)))}a(Ay,"resolveMeasuredGridSpan");function Am(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}a(Am,"resolvePositiveNumber");function wM(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:t}a(wM,"resolveNonNegativeNumber");function Ci({items:e,activeViewId:t,context:o,capabilities:r,className:n,classNames:i,empty:s,loading:l,loadingNode:d,footer:c,overlay:p,layout:u="grid",scrollable:g=true,wrapItems:f=true,measuredGrid:b,itemsStyle:x,itemStyle:y,selectedIds:k=[],getItemId:w,itemDefinition:v,renderItem:h,getItemClassName:S,onOpenItem:T,onSelectionChange:C}){let R=Array.isArray(e)?e:[],M=new Set(k),I=w??xM,B=b===true?{}:b&&typeof b=="object"?b:void 0,N=u==="grid"&&!!(B?.enabled??b),D=Am(B?.rowHeight,4),E=wM(B?.gap,8),P=B?.minColumnWidth??"220px",W=ho.useRef(new Map),H=ho.useRef(new Map),A=ho.useRef(new Map),L=ho.useRef(null),[,F]=ho.useState(0),G=typeof y=="function"?ae=>y(ae):()=>y;ho.useEffect(()=>{if(!N||typeof ResizeObserver>"u")return;let ae=new ResizeObserver(ee=>{let q=false;for(let U of ee){let O=U.target.dataset.dataExplorerItemId;if(!O)continue;let K=Math.ceil(U.contentRect.height),ne=Ay(K,D,E);A.current.get(O)!==ne&&(A.current.set(O,ne),q=true);}q&&F(U=>U+1);});L.current=ae;for(let ee of W.current.values())ae.observe(ee);return ()=>{ae.disconnect(),L.current===ae&&(L.current=null);}},[N,E,D]),ho.useEffect(()=>{if(!N){W.current.clear(),H.current.clear(),A.current.clear();return}let ae=new Set(R.map((q,U)=>I(q,U))),ee=false;for(let q of A.current.keys())ae.has(q)||(A.current.delete(q),ee=true);for(let[q,U]of W.current.entries())ae.has(q)||(L.current?.unobserve(U),W.current.delete(q));for(let q of H.current.keys())ae.has(q)||H.current.delete(q);ee&&F(q=>q+1);},[N,R,I]);let $=ho.useCallback(ae=>{let ee=H.current.get(ae);if(ee)return ee;let q=a(U=>{let X=W.current.get(ae);X&&X!==U&&(L.current?.unobserve(X),W.current.delete(ae)),U&&(U.dataset.dataExplorerItemId=ae,W.current.set(ae,U),L.current?.observe(U));},"callback");return H.current.set(ae,q),q},[]),_=a(ae=>{let ee=ae.itemId;if(ee){let O=A.current.get(ee);if(O)return O}let q=B?.estimateItemHeight,U=typeof q=="function"?q(ae):typeof q=="number"?q:240,X=Am(U,240);return Ay(X,D,E)},"getMeasuredGridSpan"),z=a(()=>N?{...x,gap:E,gridAutoFlow:"dense",gridAutoRows:D,gridTemplateColumns:`repeat(auto-fill, minmax(${vM(P)}, 1fr))`}:x,"resolveMeasuredItemsStyle"),re=a(()=>l&&d?jsxRuntime.jsx("div",{className:j("flex items-center justify-center p-6 text-sm text-muted-foreground",i?.loading),children:d}):s?jsxRuntime.jsx("div",{className:j("flex items-center justify-center p-6 text-sm text-muted-foreground",i?.empty),children:s}):null,"renderStatus"),Z=a((ae,ee,q,U)=>{if(!C)return;let X=w?w(ae,ee):q,O=U?Array.from(new Set([...k,X])):k.filter(K=>K!==X);C(O);},"handleSelectionChange");return R.length===0&&!c&&!p?re():jsxRuntime.jsxs("div",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",i?.root,n),"data-view-id":t||void 0,children:[R.length>0?jsxRuntime.jsx("div",{className:j(hM(u),g&&"overflow-auto",i?.items),style:z(),children:R.map((ae,ee)=>{let q=I(ae,ee),U=M.has(q),O={item:ae,index:ee,itemId:q,context:o,capabilities:r,itemDefinition:v,selected:U,onOpen:T,onSelectionChange:a((ie,be)=>{Z(ie,ee,q,be);},"selectionChange")},K=j(yM(u),i?.item,S?.({...O,className:i?.item})),ne={...O,className:K},fe=h?h(ne):jsxRuntime.jsx(ac,{...ne}),he=G(ne),me=N?{...he,gridRowEnd:`span ${_(ne)}`}:he;return f?jsxRuntime.jsx("div",{className:K,style:me,children:N?jsxRuntime.jsx("div",{ref:$(q),children:fe}):fe},q):N?jsxRuntime.jsx("div",{className:K,style:me,children:jsxRuntime.jsx("div",{ref:$(q),children:fe})},q):jsxRuntime.jsx(ho.Fragment,{children:fe},q)})}):re(),l&&d&&R.length>0?jsxRuntime.jsx("div",{className:j("shrink-0 p-3 text-sm text-muted-foreground",i?.loading),children:d}):null,c?jsxRuntime.jsx("div",{className:j("shrink-0",i?.footer),children:c}):null,p?jsxRuntime.jsx("div",{className:j("absolute inset-0 z-10",i?.overlay),children:p}):null]})}a(Ci,"DataExplorerViewCollection");function sc({className:e,classNames:t,...o}){return jsxRuntime.jsx(Qn,{...o,className:j("rounded-md",e),classNames:{...t,root:j("flex-row items-stretch",t?.root),media:j("w-28 shrink-0",t?.media),header:j("flex min-w-0 flex-1 items-center p-3",t?.header),body:j("px-3 pb-3",t?.body)}})}a(sc,"DataExplorerDisplayListItem");function By(e,t){if(e)return typeof e=="function"?e(t):e}a(By,"resolveDisplayItemProps");function SM(e,t,o){let{item:r,layout:n}=e,i=!!t&&!r.disabled,s=o?.renderActions?o.renderActions(e):r.actions?.length?jsxRuntime.jsx(rc,{item:r,actions:r.actions,appearance:o?.appearance}):void 0,l={media:o?.renderMedia?o.renderMedia(e):void 0,actions:s,appearance:o?.appearance,interactive:i,onClick:i?()=>t?.(r):void 0};if(n==="list"){let c=By(o?.listItemProps,e);return jsxRuntime.jsx(sc,{...l,...c,item:r,className:j(l.className,c?.className)})}let d=By(o?.cardProps,e);return jsxRuntime.jsx(Qn,{...l,...d,item:r,className:j(l.className,d?.className)})}a(SM,"renderDefaultItem");function Ly({items:e,activeViewId:t="display",layout:o="grid",appearance:r,selectedIds:n,empty:i,loading:s,loadingNode:l,footer:d,overlay:c,className:p,classNames:u,scrollable:g,wrapItems:f,measuredGrid:b,itemsStyle:x,itemStyle:y,getItemClassName:k,cardProps:w,listItemProps:v,renderMedia:h,renderActions:S,renderItem:T,onOpenItem:C,onSelectionChange:R}){return jsxRuntime.jsx(Ci,{activeViewId:t,items:e,layout:o,selectedIds:n,className:p,classNames:u,empty:i,loading:s,loadingNode:l,footer:d,overlay:c,scrollable:g,wrapItems:f,measuredGrid:b,itemsStyle:x,itemStyle:typeof y=="function"?({item:M,index:I=0,itemId:B="",selected:N=false})=>y({item:M,index:I,itemId:B,selected:N,activeViewId:t,layout:o}):y,getItemId:M=>M.id,getItemClassName:k?({item:M,index:I=0,itemId:B="",selected:N=false})=>k({item:M,index:I,itemId:B,selected:N,activeViewId:t,layout:o}):void 0,renderItem:({item:M,index:I})=>(()=>{let B={item:M,index:I??0,itemId:M.id,selected:n?.includes(M.id)??false,activeViewId:t,layout:o};return T?T(M,B.index,B):SM(B,C,{cardProps:w,listItemProps:v,appearance:r,renderMedia:h,renderActions:S})})(),onOpenItem:C,onSelectionChange:R})}a(Ly,"DataExplorerDisplayCollectionView");function Bm(e,t){let o=typeof e=="function"?e():e;if(o===null)return null;if(!o||typeof o!="object"||o.nodeType!==1)throw new TypeError(`${t} must resolve to an Element or null.`);return o}a(Bm,"resolveContainerValue");function Lm({explicitProvided:e,explicitContainer:t,providerProvided:o,providerContainer:r,getDocument:n}){if(e)return Bm(t,"BasePortal container");if(o)return Bm(r,"MonkeysProvider portal.container");if(!n)return null;let i=n();if(i===null)return null;if(!i||typeof i!="object"||!("body"in i))throw new TypeError("MonkeysProvider environment.getDocument must resolve to a Document or null.");return Bm(i.body,"MonkeysProvider environment.getDocument().body")}a(Lm,"resolveBasePortalContainer");function MM(e){let t=di(),o=ci(),[r,n]=ho.useState(false);if(ho.useEffect(()=>{n(true);},[]),e.disabled!==void 0&&typeof e.disabled!="boolean")throw new TypeError("BasePortal disabled must be a boolean.");if(e.inline!==void 0&&typeof e.inline!="boolean")throw new TypeError("BasePortal inline must be a boolean.");let i=e.disabled??o.disabled??false;if(!r||i||e.inline)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children});let s=Lm({explicitProvided:e.container!==void 0,explicitContainer:e.container,providerProvided:o.container!==void 0,providerContainer:o.container,getDocument:t.getDocument});return s?reactDom.createPortal(e.children,s):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children})}a(MM,"BasePortal");function EM({mounted:e,explicitDisabled:t,explicitContainer:o,providerDisabled:r,providerContainer:n,getDocument:i}){let s=t??r??false;if(!e||s)return {mounted:e,disabled:s,shouldPortal:false,container:null,radixPortalProps:void 0};let l=Lm({explicitProvided:o!==void 0,explicitContainer:o,providerProvided:n!==void 0,providerContainer:n,getDocument:i});return l?{mounted:true,disabled:false,shouldPortal:true,container:l,radixPortalProps:Object.freeze({container:l})}:{mounted:true,disabled:false,shouldPortal:false,container:null,radixPortalProps:void 0}}a(EM,"resolveBaseOverlayPortalState");function AM(){return globalThis.document??null}a(AM,"getDefaultDocument");function wr(e={}){let t=di(),o=ci(),[r,n]=ho.useState(false);return ho.useEffect(()=>{n(true);},[]),EM({mounted:r,explicitDisabled:e.disabled,explicitContainer:e.container,providerDisabled:o.disabled,providerContainer:o.container,getDocument:t.getDocument??AM})}a(wr,"useBaseOverlayPortal");function Oy(e,t){return t.shouldPortal?reactDom.createPortal(e,t.container):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}a(Oy,"renderBaseOverlayPortalContent");function dc(e,t){if(typeof e!="boolean")throw new TypeError(`BaseTooltip ${t} must be a boolean.`)}a(dc,"validateBoolean");function HM(e){if(e!=="top"&&e!=="bottom"&&e!=="left"&&e!=="right")throw new TypeError('BaseTooltip placement must be "top", "bottom", "left", or "right".')}a(HM,"validatePlacement");function VM(e,t){return ho.isValidElement(e)&&e.type!==ho.Fragment?e:jsxRuntime.jsx("span",{tabIndex:!t&&V(e)?0:void 0,children:e})}a(VM,"normalizeTrigger");var To=ho.forwardRef(a(function({content:t,children:o,open:r,defaultOpen:n=false,placement:i="top",disabled:s=false,portal:l=false,appearance:d,className:c,classNames:p,style:u,onOpenChange:g,...f},b){r!==void 0&&dc(r,"open"),dc(n,"defaultOpen"),dc(s,"disabled"),dc(l,"portal"),HM(i);let x=Pe(d),y=ke(),k=Ne(x),w=wr({disabled:!l}),[v,h]=ho.useState(n),S=r!==void 0,T=!s&&V(t),R=T&&(S?r:v),M=l&&w.shouldPortal?"portaled":"inline",I=a(D=>{D&&!T||(S||h(D),g?.(D));},"handleOpenChange"),B=VM(o,s),N=T?jsxRuntime.jsx(mr__namespace.Content,{...y,side:i,sideOffset:8,collisionPadding:8,"data-monkeys-component":"tooltip","data-slot":"content","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipContent,p?.content),style:k.styles.tooltip,children:t}):null;return jsxRuntime.jsx("span",{...y,...f,ref:b,"data-monkeys-component":"tooltip","data-slot":"root","data-state":R?"open":"closed","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipRoot,p?.root,c),style:u,children:jsxRuntime.jsx(mr__namespace.Provider,{delayDuration:0,skipDelayDuration:0,disableHoverableContent:true,children:jsxRuntime.jsxs(mr__namespace.Root,{open:R,onOpenChange:I,delayDuration:0,disableHoverableContent:true,children:[jsxRuntime.jsx("span",{...y,"data-monkeys-component":"tooltip","data-slot":"trigger-wrapper","data-state":R?"open":"closed","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipTrigger,p?.trigger),children:jsxRuntime.jsx(mr__namespace.Trigger,{asChild:true,...y,"data-monkeys-component":"tooltip","data-slot":"trigger","data-placement":i,"data-portal":M,"data-disabled":s||void 0,children:B})}),l&&w.shouldPortal?jsxRuntime.jsx(mr__namespace.Portal,{...w.radixPortalProps,children:N}):N]})})})},"BaseTooltip"));var Hy=1.18,Vy=16,_y=1e6,zm=1e-6,Gy={topLeft:"left-4 top-4",top:"left-1/2 top-4 -translate-x-1/2",topRight:"right-4 top-4",left:"left-4 top-1/2 -translate-y-1/2",right:"right-4 top-1/2 -translate-y-1/2",bottomLeft:"bottom-4 left-4",bottom:"bottom-4 left-1/2 -translate-x-1/2",bottomRight:"bottom-4 right-4"},Bs=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),uc=a(e=>e instanceof Element&&!!e.closest('[data-no-drag="true"],button,a,input,textarea,select,[contenteditable="true"],[role="button"]'),"isNoDragTarget");function UM(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),jsxRuntime.jsx("path",{d:"M3 4v6h6"})]})}a(UM,"ResetIcon");function KM(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 5v14"}),jsxRuntime.jsx("path",{d:"M5 12h14"})]})}a(KM,"PlusIcon");function qM(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M5 12h14"})})}a(qM,"MinusIcon");var $y=ho.forwardRef(a(function({src:t,rotation:o=0,flipX:r=false,flipY:n=false,alt:i="Preview image",empty:s="No image preview",actions:l,actionContext:d,toolbarActions:c,zoomStep:p=Hy,stagePadding:u=Vy,minScale:g=zm,maxScale:f=_y,wheelZoom:b="plain",doubleClickAction:x="reset",panEnabled:y=true,keyboardEnabled:k=true,slots:w,overlay:v,imageOverlay:h,controlsPosition:S="bottomRight",renderControls:T,onScaleChange:C,controlsVisible:R=true,zoomLabelVisible:M=false,resetLabel:I="Reset image view",zoomInLabel:B="Zoom in",zoomOutLabel:N="Zoom out",originalSizeLabel:D="Original size",appearance:E,className:P,classNames:W,onLoad:H,onError:A},L){let F=Ct(E??{background:"dark-stage"}),G=typeof t=="string"?t.trim():"",$=ho.useRef(null),_=ho.useRef(null),z=ho.useRef({scale:1,translateX:u,translateY:u}),re=ho.useRef(void 0),[Z,ae]=ho.useState(null),[ee,q]=ho.useState(false),U=ho.useRef("page"),[{scale:X,translateX:O,translateY:K},ne]=ho.useState(()=>({scale:1,translateX:u,translateY:u}));ho.useLayoutEffect(()=>{z.current={scale:X,translateX:O,translateY:K};},[X,O,K]),ho.useLayoutEffect(()=>{ae(null),U.current="page";let le=re.current?.pointerId;le!==void 0&&$.current?.hasPointerCapture(le)&&$.current.releasePointerCapture(le),re.current=void 0,q(false),ne({scale:1,translateX:0,translateY:0});},[G]);let fe=ho.useRef(C);fe.current=C,ho.useEffect(()=>{Z&&fe.current?.(X);},[X,Z]);let he=Number.isFinite(g)?Math.max(zm,g):zm,me=Number.isFinite(f)?Math.max(he,f):_y,ie=Number.isFinite(p)&&p>1?p:Hy,be=Number.isFinite(u)&&u>=0?u:Vy,He=Number.isFinite(o)?o%360:0,We=ho.useCallback(le=>{let Me=He*Math.PI/180,Ae=Math.abs(Math.cos(Me)),J=Math.abs(Math.sin(Me));return {width:Math.round((le.width*Ae+le.height*J)*1e6)/1e6,height:Math.round((le.width*J+le.height*Ae)*1e6)/1e6}},[He]),Ke=Z?We(Z):null,ce=ho.useCallback((le,Me="page")=>{U.current=Me;let Ae=$.current,J=le??Z;if(!Ae||!J)return;let $e=We(J),ue=Math.max(0,Ae.clientWidth-be*2),Re=Math.max(0,Ae.clientHeight-be*2);if(ue<=0||Re<=0||$e.width<=0||$e.height<=0)return;let se=Me==="width"?ue/$e.width:Math.min(ue/$e.width,Re/$e.height),te=Bs(se,he,me),Te=$e.width*te,ze=$e.height*te;ne({scale:te,translateX:(Ae.clientWidth-Te)/2,translateY:(Ae.clientHeight-ze)/2});},[Z,me,he,be,We]),Q=ho.useCallback((le,Me)=>{if(!Number.isFinite(le)||!Number.isFinite(Me)||le<=0||Me<=0)return;let Ae=_.current;if(_.current={width:le,height:Me},!Ae||!G)return;if(U.current&&Z){ce(Z,U.current);return}let J=(le-Ae.width)/2,$e=(Me-Ae.height)/2;J===0&&$e===0||ne(ue=>({scale:ue.scale,translateX:ue.translateX+J,translateY:ue.translateY+$e}));},[G,Z,ce]);ho.useLayoutEffect(()=>{let le=$.current;if(!le)return;if(Q(le.clientWidth,le.clientHeight),typeof ResizeObserver<"u"){let Ae=new ResizeObserver(J=>{let $e=J[0];$e&&Q($e.contentRect.width,$e.contentRect.height);});return Ae.observe(le),()=>Ae.disconnect()}let Me=a(()=>{Q(le.clientWidth,le.clientHeight);},"handleResize");return window.addEventListener("resize",Me),()=>window.removeEventListener("resize",Me)},[Q]);let ge=ho.useCallback((le,Me,Ae)=>{!Number.isFinite(le)||le===1||!Number.isFinite(Me)||!Number.isFinite(Ae)||(U.current=null,ne(J=>{let $e=Bs(J.scale*le,he,me);if(!Number.isFinite($e)||$e===J.scale)return J;let ue=$e/J.scale;return {scale:$e,translateX:Me-(Me-J.translateX)*ue,translateY:Ae-(Ae-J.translateY)*ue}}));},[me,he]);ho.useEffect(()=>{let le=$.current;if(!le||!G||!Z)return;let Me=a(Ae=>{if(uc(Ae.target)||b==="disabled"||b==="modifier"&&!(Ae.ctrlKey||Ae.metaKey)||b==="plain"&&(Ae.ctrlKey||Ae.metaKey))return;Ae.preventDefault();let J=le.getBoundingClientRect(),$e=Ae.clientX-J.left,ue=Ae.clientY-J.top,Re=Ae.deltaY*(Ae.deltaMode===1?16:Ae.deltaMode===2?le.clientHeight:1),se=Math.pow(ie,-Bs(Re,-1e3,1e3)/100);ge(se,$e,ue);},"handleWheel");return le.addEventListener("wheel",Me,{passive:false}),()=>le.removeEventListener("wheel",Me)},[G,Z,ie,ge,b]),ho.useLayoutEffect(()=>{let le=$.current;if(!le||!Z)return;let Me=z.current.scale,Ae=Bs(Me,he,me);Ae!==Me&&ge(Ae/Me,le.clientWidth/2,le.clientHeight/2);},[Z,he,me,ge]);let we=ho.useCallback(le=>{if(le.button!==0||!y||!G||!Z||uc(le.target))return;let Me=$.current;Me&&(le.preventDefault(),Me.setPointerCapture(le.pointerId),Me.focus({preventScroll:true}),U.current=null,re.current={pointerId:le.pointerId,startClientX:le.clientX,startClientY:le.clientY,startTranslateX:z.current.translateX,startTranslateY:z.current.translateY},q(true));},[G,Z,y]),Ie=ho.useCallback(le=>{let Me=re.current;!Me||Me.pointerId!==le.pointerId||(le.preventDefault(),ne({scale:z.current.scale,translateX:Me.startTranslateX+le.clientX-Me.startClientX,translateY:Me.startTranslateY+le.clientY-Me.startClientY}));},[]),oe=ho.useCallback(le=>{let Me=re.current;if(!Me||Me.pointerId!==le.pointerId)return;re.current=void 0,q(false);let Ae=$.current;Ae?.hasPointerCapture(le.pointerId)&&Ae.releasePointerCapture(le.pointerId);},[]),xe=ho.useCallback(()=>{let le=$.current;if(!le||!Z)return;U.current=null;let Me=We(Z),Ae=Bs(1,he,me);ne({scale:Ae,translateX:(le.clientWidth-Me.width*Ae)/2,translateY:(le.clientHeight-Me.height*Ae)/2});},[Z,he,me,We]),Ve=ho.useCallback(le=>{!G||!Z||uc(le.target)||(x==="reset"&&ce(),x==="original-size"&&xe());},[G,Z,ce,xe,x]),_e=ho.useCallback(le=>{let Me=$.current;!Me||!Z||ge(le,Me.clientWidth/2,Me.clientHeight/2);},[Z,ge]),Ge={scale:X,ready:!!(G&&Z),canZoomIn:!!(Z&&X<me),canZoomOut:!!(Z&&X>he),zoomIn:a(()=>_e(ie),"zoomIn"),zoomOut:a(()=>_e(1/ie),"zoomOut"),reset:a(()=>ce(),"reset"),fitWidth:a(()=>ce(void 0,"width"),"fitWidth"),originalSize:xe};return ho.useImperativeHandle(L,()=>Ge),jsxRuntime.jsxs("div",{ref:$,"data-image-preview":true,tabIndex:k?0:void 0,onKeyDown:le=>{if(!k||!Ge.ready||uc(le.target))return;let Me=le.key==="+"||le.key==="="?Ge.zoomIn:le.key==="-"?Ge.zoomOut:le.key==="0"?Ge.reset:le.key==="1"?Ge.originalSize:void 0;Me&&(le.preventDefault(),le.stopPropagation(),Me());},className:tailwindMerge.twMerge(F.slots.previewRoot,G&&Z&&y?ee?"cursor-grabbing":"cursor-grab":"cursor-default",W?.root,P),onPointerDown:we,onPointerMove:Ie,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:oe,onDoubleClick:Ve,style:{touchAction:y?"none":void 0,...F.styles.previewRoot},children:[G?jsxRuntime.jsx("div",{"data-image-transform":true,className:tailwindMerge.twMerge("absolute left-0 top-0 will-change-transform",W?.imageLayer),style:{visibility:Z?"visible":"hidden",width:Ke?.width,height:Ke?.height,transform:`translate(${O}px, ${K}px) scale(${X})`,transformOrigin:"0 0"},children:jsxRuntime.jsxs("div",{"data-image-orientation":true,className:"absolute left-1/2 top-1/2",style:{width:Z?.width,height:Z?.height,transform:`translate(-50%, -50%) rotate(${He}deg) scaleX(${r?-1:1}) scaleY(${n?-1:1})`},children:[jsxRuntime.jsx("img",{src:G,style:Un(G),alt:i,draggable:false,className:tailwindMerge.twMerge("pointer-events-none max-h-none max-w-none select-none",W?.image),onLoad:le=>{let Me=le.currentTarget.naturalWidth,Ae=le.currentTarget.naturalHeight;if(!Me||!Ae)return;let J={width:Me,height:Ae};ae(J),ce(J),H?.(J);},onError:le=>{ae(null),A?.(le);}},G),h?jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0","data-image-coordinate-overlay":true,children:h}):null]})}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(F.slots.previewPlaceholder,W?.placeholder),children:s}),v?jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0","data-no-drag":"true",children:v}):null,Object.keys(Gy).map(le=>{let Me=le==="topRight"&&(c?.length||l),Ae=le===S&&R;return !w?.[le]&&!Me&&!Ae?null:jsxRuntime.jsxs("div",{"data-image-slot":le,"data-no-drag":"true",className:tailwindMerge.twMerge("absolute z-20 flex max-h-full max-w-full flex-col gap-2",Gy[le]),children:[w?.[le],Me?jsxRuntime.jsxs("div",{"data-no-drag":"true",className:tailwindMerge.twMerge(F.slots.previewActions,"static",W?.actions),children:[c?.length?jsxRuntime.jsx(sn,{context:d,actions:c,layout:"inline",appearance:E??{background:"dark-stage"}}):null,l]}):null,Ae?T?T(Ge):jsxRuntime.jsxs("div",{"data-no-drag":"true",className:tailwindMerge.twMerge(F.slots.previewControls,"static",W?.controls),children:[M?jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge(F.slots.previewZoomLabel,W?.zoomLabel),children:[Math.round(X*100),"%"]}):null,jsxRuntime.jsx(To,{content:N,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":N,disabled:!Ge.canZoomOut,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>_e(1/ie),children:jsxRuntime.jsx(qM,{})})}),jsxRuntime.jsx(To,{content:B,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":B,disabled:!Ge.canZoomIn,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>_e(ie),children:jsxRuntime.jsx(KM,{})})}),jsxRuntime.jsx(To,{content:I,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":I,disabled:!G||!Z,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>ce(),children:jsxRuntime.jsx(UM,{})})}),jsxRuntime.jsx(To,{content:D,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":D,disabled:!Ge.ready,className:tailwindMerge.twMerge(F.slots.previewControlButton,W?.controlButton),onClick:xe,children:jsxRuntime.jsx(lucideReact.Scan,{className:"h-4 w-4","aria-hidden":"true"})})})]}):null]},le)})]})},"DataExplorerImagePreview"));function pn(e,t){if(typeof e!="string")return;let o=e.trim();if(!o||/[\u0000-\u001f\u007f\\]/.test(o)||/^https?:/i.test(o)&&!/^https?:\/\//i.test(o))return;let r;try{r=new URL(o,"https://monkeys.invalid/");}catch{return}if(!(r.username||r.password)){if(r.protocol==="http:"||r.protocol==="https:"||t==="link"&&(r.protocol==="mailto:"||r.protocol==="tel:"))return o;if(r.protocol==="blob:"){if(r.pathname.startsWith("null/"))return o;try{let n=new URL(r.pathname);if(["https:","http:"].includes(n.protocol)&&!n.username&&!n.password)return o}catch{}}}}a(pn,"safeDisplayUrl");function jy(e){if(typeof e!="string"||!e.trim())return;let t=e.split(",");for(let o of t){let r=o.trim().split(/\s+/);if(!pn(r[0],"media")||r.length>2||r.length===2&&!/^(?:[1-9]\d*w|(?:\d+(?:\.\d+)?|\.\d+)x)$/.test(r[1]))return}return e}a(jy,"safeDisplaySrcSet");function Uy({kind:e}){return jsxRuntime.jsx(e==="image"?lucideReact.Image:e==="video"?lucideReact.Video:e==="audio"?lucideReact.Music2:lucideReact.FileText,{className:"h-6 w-6","aria-hidden":"true"})}a(Uy,"PreviewIcon");function qy({src:e,kind:t="image",alt:o="Preview",title:r,aspectRatio:n="auto",fit:i="contain",controls:s=true,loading:l=false,empty:d="No preview available",error:c="Preview is unavailable right now.",className:p,style:u,classNames:g,mediaAttributes:f,onLoad:b,onError:x}){let[y,k]=ho.useState(false),w=pn(e,"media")??"",v=Object.fromEntries(Object.entries(f??{}).flatMap(([C,R])=>{let M=C.toLowerCase();return M==="src"||M==="srcdoc"||M==="dangerouslysetinnerhtml"?[]:M==="srcset"?[["srcSet",jy(R)]]:M==="poster"?[["poster",pn(R,"media")]]:[[C,R]]}));ho.useEffect(()=>{k(false);},[w,t]);let h=a((C,R)=>jsxRuntime.jsx("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-2 bg-muted/30 p-4 text-center text-sm text-muted-foreground",g?.placeholder,R),role:l?"status":"img","aria-label":typeof C=="string"?C:void 0,children:C}),"renderPlaceholder");if(l)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,"aria-busy":"true",children:jsxRuntime.jsxs("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-2 bg-muted/30 p-4 text-sm text-muted-foreground",g?.loading),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-5 w-5 animate-spin","aria-hidden":"true"}),r||"Loading preview..."]})});if(!w||y)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,children:h(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Uy,{kind:t}),jsxRuntime.jsx("span",{className:j("max-w-full truncate",y?g?.error:void 0),children:y?c:d}),r?jsxRuntime.jsx("span",{className:"max-w-full truncate text-xs",children:r}):null]}))});let S=a(()=>{k(true),x?.();},"handleError"),T=t==="image"?jsxRuntime.jsx(Is,{...v,src:w,alt:o,fit:i,className:g?.media,loading:"lazy",decoding:"async",draggable:false,onLoad:b,onError:S}):t==="video"?jsxRuntime.jsx("video",{...v,src:w,className:j("block h-auto w-full",i==="cover"?"object-cover":"object-contain",g?.media),controls:s,preload:"metadata",onLoadedData:b,onError:S}):t==="audio"?jsxRuntime.jsx("audio",{...v,src:w,className:j("w-full",g?.media),controls:s,preload:"metadata",onCanPlay:b,onError:S}):h(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Uy,{kind:"file"}),jsxRuntime.jsx("span",{className:"max-w-full truncate",children:r||w})]}));return t==="image"?jsxRuntime.jsx(Ms,{aspectRatio:n,className:j(g?.root,p),style:u,children:T}):jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,children:T})}a(qy,"DataExplorerMediaPreview");function Xy({sidebar:e,tree:t,toolbar:o,controls:r,notices:n,content:i,view:s,detail:l,appearance:d,className:c,classNames:p}){let u=Et(d),g=u?Ct(u):void 0,f=t??e,b=r??o,x=s??i;return jsxRuntime.jsx(Ch,{appearance:u,children:jsxRuntime.jsxs("div",{className:j("flex h-full min-h-0 overflow-hidden",g?.slots.surfaceRoot,p?.root,c),style:g?.styles.surfaceRoot,children:[f?jsxRuntime.jsx("div",{className:j("min-h-0 shrink-0 overflow-hidden",p?.sidebar,p?.tree),children:f}):null,jsxRuntime.jsxs("div",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",p?.main),children:[b?jsxRuntime.jsx("div",{className:j("shrink-0",p?.toolbar,p?.controls),children:b}):null,n?jsxRuntime.jsx("div",{className:j("shrink-0",p?.notices),children:n}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden",p?.content,p?.view),children:x}),l?jsxRuntime.jsx("div",{className:j(p?.detail),children:l}):null]})]})})}a(Xy,"DataExplorerPage");function o2({item:e,selected:t,label:o,className:r,onToggleSelection:n}){return n?jsxRuntime.jsx("input",{type:"checkbox",checked:t,"aria-label":o,className:j("h-4 w-4 shrink-0 accent-primary",r),onChange:()=>n(e),onClick:i=>i.stopPropagation()}):null}a(o2,"DefaultCheckbox");function r2({item:e,active:t,label:o,className:r,onToggleFavorite:n}){return n?jsxRuntime.jsxs("button",{type:"button","aria-pressed":t,title:o,className:j("inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",t&&"text-[hsl(var(--warning,45_93%_47%))]",r),onClick:i=>{i.stopPropagation(),n(e);},children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:t?"currentColor":"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8-6.2-3.3L5.8 21 7 14.2 2 9.3l6.9-1L12 2Z"})}),jsxRuntime.jsx("span",{className:"sr-only",children:o})]}):null}a(r2,"DefaultFavorite");function n2({item:e,limit:t,classNames:o}){let r=e.keywords??[];if(r.length===0)return null;let n=r.slice(0,t),i=Math.max(0,r.length-n.length);return jsxRuntime.jsxs("div",{className:j("mt-2 flex flex-wrap gap-2",o?.keywords),children:[n.map((s,l)=>jsxRuntime.jsx("span",{className:j("max-w-full truncate rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",o?.keyword),title:typeof s=="string"?s:void 0,children:s},l)),i>0?jsxRuntime.jsxs("span",{className:j("rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground",o?.keywordOverflow),children:["+",i]}):null]})}a(n2,"renderKeywords");function Qy({item:e,selected:t=e.selected??false,active:o,disabled:r=e.disabled,hasMedia:n,showHeaderWithMedia:i=false,selectionVisible:s,favoriteVisible:l,overlayControlsAlwaysVisible:d,favoriteActive:c=false,favoriteLabel:p="Favorite",favoriteActiveLabel:u="Unfavorite",selectLabel:g="Select item",unselectLabel:f="Unselect item",actions:b,media:x,footer:y,checkbox:k,favorite:w,keywordLimit:v=3,appearance:h,className:S,classNames:T,onClick:C,onToggleSelection:R,onToggleFavorite:M}){let I=Ct(Et(h)),B=n??!!(x??e.media),N=!B||i,D=s??!!(t||R),E=l??!!(w||M),P=c?u:p,H=k??(D?jsxRuntime.jsx(o2,{item:e,selected:t,label:t?f:g,className:T?.selectionControl,onToggleSelection:R}):null),A=w??(E?jsxRuntime.jsx(r2,{item:e,active:c,label:P,className:T?.favoriteControl,onToggleFavorite:M}):null),L=x??(e.media?jsxRuntime.jsx(wi,{media:e.media,fallbackTitle:e.title}):void 0),F=N?jsxRuntime.jsxs("div",{className:j("flex flex-col",T?.header),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center justify-between gap-2",T?.headerMain),children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[H,jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:e.title?jsxRuntime.jsx("h3",{className:j("truncate text-sm font-semibold leading-none",T?.title),children:e.title}):null})]}),A||b?jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[A,b]}):null]}),n2({item:e,limit:v,classNames:T})]}):null,G=B&&(H||A||b)?jsxRuntime.jsx("div",{className:j("absolute inset-x-2 top-2 z-10",T?.overlay),children:jsxRuntime.jsxs("div",{className:j("flex items-start justify-between gap-1 transition-opacity",t||d?"opacity-100":"opacity-0 group-hover:opacity-100",T?.overlayControls),children:[H??jsxRuntime.jsx("span",{}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[A,b?jsxRuntime.jsx("div",{className:j(T?.floatingActions),children:b}):null]})]})}):null;return jsxRuntime.jsx(Qn,{item:e,selected:t,disabled:r,appearance:h,className:j(I.slots.recordCardRoot,o&&I.slots.recordCardActive,T?.root,S),classNames:{overlay:T?.overlay,header:j(B?"p-3":"p-3 pb-2",T?.header),media:j("p-0 bg-muted/30",T?.media),footer:T?.footer},header:F,overlay:G,media:L?jsxRuntime.jsx("div",{className:j("relative overflow-hidden",T?.mediaFrame),children:L}):void 0,footer:y,children:null,onClick:C})}a(Qy,"DataExplorerRecordCard");var c2=a((e,t)=>{let o=t?Array.isArray(e)?e:e?[e]:[]:typeof e=="string"?[e]:[];return Array.from(new Set(o.filter(r=>typeof r=="string"&&r.length>0)))},"normalizeValues"),Fm=a(e=>e.textValue??(typeof e.label=="string"?e.label:e.value),"getOptionText");function tx({value:e,activeValue:t,options:o=[],createOption:r,multiple:n=false,placeholder:i="Select a record",triggerLabel:s,triggerIcon:l,searchPlaceholder:d="Search records",emptyState:c="No records found",loadingState:p,loadingMoreState:u,errorState:g,loading:f=false,loadingMore:b=false,disabled:x=false,open:y,defaultOpen:k=false,searchValue:w,defaultSearchValue:v="",appearance:h,className:S,classNames:T,triggerProps:C,dataAttributes:R,onOpenChange:M,onListScroll:I,onSearchValueChange:B,onValueChange:N}){let D=Ct(Et(h)),[E,P]=ho.useState(k),[W,H]=ho.useState(v),A=y!==void 0,L=A?y:E,F=w!==void 0,G=F?w:W,$=ho.useMemo(()=>c2(e,n),[n,e]),_=ho.useMemo(()=>new Set($),[$]),z=$.map(X=>o.find(O=>O.value===X)).filter(X=>!!X),re=r?[r,...o]:o,Z=z.length?n&&z.length>1?`${z.slice(0,2).map(X=>Fm(X)).join(", ")} +${z.length-2}`:Fm(z[0]):i;ho.useEffect(()=>{if(!L)return;let X=a(O=>{O.key==="Escape"&&M?.(false);},"handleKeyDown");return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[L,M]);let ae=a(X=>{x||(A||P(X),M?.(X));},"setOpen"),ee=a(X=>{F||H(X),B?.(X);},"setQuery"),q=a(X=>{if(!(x||X.disabled)){if(n){let O=_.has(X.value)?$.filter(K=>K!==X.value):[...$,X.value];N?.(O);return}N?.(X.value),ae(false);}},"handleOptionClick"),U=a(X=>{x||N?.($.filter(O=>O!==X));},"removeValue");return jsxRuntime.jsxs("div",{...R?.root,className:j("relative min-w-0 w-full",T?.root,S),children:[jsxRuntime.jsxs(Hn__namespace.Root,{open:L,onOpenChange:ae,children:[jsxRuntime.jsx(Hn__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{...C,...R?.trigger,type:"button",disabled:x,"aria-label":s,"aria-expanded":L,className:j(D.slots.controlSelectTrigger,T?.trigger),children:[l,jsxRuntime.jsx("span",{...R?.triggerValue,className:j(D.slots.controlSelectValue,!z.length&&"text-muted-foreground",T?.triggerValue),children:Z}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 shrink-0","aria-hidden":"true"})]})}),jsxRuntime.jsx(Hn__namespace.Portal,{children:jsxRuntime.jsxs(Hn__namespace.Content,{...R?.content,align:"start",sideOffset:6,className:j("z-50 w-[min(30rem,calc(100vw-2rem))] rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-md",T?.content),onOpenAutoFocus:X=>X.preventDefault(),children:[jsxRuntime.jsxs("label",{className:j("flex h-9 items-center gap-2 rounded-md border border-border bg-background px-2 text-sm",T?.search),children:[jsxRuntime.jsx(lucideReact.Search,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("input",{autoFocus:true,value:G,onChange:X=>ee(X.target.value),placeholder:d,"aria-label":d,className:"min-w-0 flex-1 bg-transparent outline-hidden placeholder:text-muted-foreground"})]}),jsxRuntime.jsx("div",{className:j("mt-2 max-h-72 overflow-y-auto",T?.list),...R?.list,role:"listbox","aria-multiselectable":n||void 0,onScroll:I,children:f?jsxRuntime.jsxs("div",{...R?.loading,className:j("flex min-h-16 items-center justify-center gap-2 px-3 py-4 text-sm text-muted-foreground",T?.status),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),p??"Loading records..."]}):g?jsxRuntime.jsx("div",{...R?.error,className:j("px-3 py-4 text-sm text-destructive-text",T?.status),children:g}):re.length===0?jsxRuntime.jsx("div",{...R?.empty,className:j("px-3 py-4 text-sm text-muted-foreground",T?.status),children:c}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[re.map(X=>{let O=_.has(X.value);return jsxRuntime.jsxs("button",{...R?.option,type:"button",role:"option","aria-selected":O,"aria-current":t!==void 0&&X.value===t?"true":void 0,disabled:X.disabled,onClick:()=>q(X),className:j("flex w-full items-start gap-2 rounded-sm px-2.5 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50",O&&"bg-accent/60",T?.option),children:[jsxRuntime.jsx("span",{className:j("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center",T?.optionIndicator),children:O?jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4","aria-hidden":"true"}):null}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:j("block truncate",T?.optionLabel),children:X.label}),X.description?jsxRuntime.jsx("span",{className:j("mt-0.5 block truncate text-xs text-muted-foreground",T?.optionDescription),children:X.description}):null]})]},X.value)}),b?jsxRuntime.jsxs("div",{...R?.loadingMore,className:j("flex items-center justify-center gap-2 px-3 py-2 text-xs text-muted-foreground",T?.status),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),u??"Loading more records..."]}):null]})})]})})]}),n&&z.length>0?jsxRuntime.jsx("div",{className:j("mt-2 flex flex-wrap gap-1.5",T?.selectedList),children:z.map(X=>jsxRuntime.jsxs("span",{className:j("inline-flex max-w-full items-center gap-1 rounded-full border border-border bg-muted px-2 py-1 text-xs",T?.selectedItem),children:[jsxRuntime.jsx("span",{className:j("min-w-0 truncate",T?.selectedItemLabel),children:X.label}),jsxRuntime.jsx("button",{type:"button","aria-label":`Remove ${Fm(X)}`,onClick:()=>U(X.value),className:j("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",T?.selectedItemRemove),children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3","aria-hidden":"true"})})]},X.value))}):null]})}a(tx,"DataExplorerRecordPicker");function b2({items:e,value:t,defaultValue:o,allowCollapse:r,keyboardNavigation:n}){if(!Array.isArray(e))throw new TypeError("BaseAccordion items must be an array.");if(t!==void 0&&(typeof t!="string"||!t.trim()))throw new TypeError("BaseAccordion value must be a non-empty string when provided.");if(o!==void 0&&(typeof o!="string"||!o.trim()))throw new TypeError("BaseAccordion defaultValue must be a non-empty string when provided.");if(typeof r!="boolean")throw new TypeError("BaseAccordion allowCollapse must be a boolean.");if(typeof n!="boolean")throw new TypeError("BaseAccordion keyboardNavigation must be a boolean.");let i=new Set;e.forEach((s,l)=>{if(!s||typeof s!="object")throw new TypeError(`BaseAccordion item at index ${l} must be an object.`);if(typeof s.value!="string"||!s.value.trim())throw new TypeError(`BaseAccordion item value at index ${l} must be a non-empty string.`);if(i.has(s.value))throw new TypeError(`BaseAccordion items must use unique values; duplicate value ${JSON.stringify(s.value)} at index ${l}.`);if(s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseAccordion item disabled at index ${l} must be a boolean.`);i.add(s.value);});}a(b2,"validateBaseAccordionProps");function g2(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(g2,"toDomId");function h2(e){let t=new Set;return e.map((o,r)=>{let n=g2(o.value)||`item-${r}`,i=n;if(t.has(i))for(i=`${n}-${r}`;t.has(i);)i=`${i}-${r}`;return t.add(i),i})}a(h2,"getDomIdFragments");var nx=ho.forwardRef(a(function({items:t=[],value:o,defaultValue:r,allowCollapse:n=true,keyboardNavigation:i=true,appearance:s,className:l,classNames:d,style:c,onValueChange:p,id:u,onFocusCapture:g,onBlurCapture:f,...b},x){b2({items:t,value:o,defaultValue:r,allowCollapse:n,keyboardNavigation:i});let y=Pe(s),k=ke(),w=Ne(y),v=ho.useId(),h=u??v,[S,T]=ho.useState(r),[C,R]=ho.useState(),M=ho.useRef(new Map),I=ho.useRef(false),B=o!==void 0,N=B?o:S,D=h2(t),E=t.filter(_=>!_.disabled),P=t.find(_=>_.value===N),W=typeof b.dir=="string"?b.dir:k.dir;ho.useEffect(()=>{if(!I.current||C===void 0)return;let _=t.find(re=>re.value===C);if(_&&!_.disabled)return;let z=E.find(re=>re.value===N)??E[0];if(!z){I.current=false;return}R(z.value),M.current.get(z.value)?.focus();},[E,C,t,N]);let H=a(_=>{if(_.disabled)return;let z=N===_.value;if(z&&!n){p?.(_.value);return}let re=z?void 0:_.value;B||T(re),p?.(re);},"handleToggle"),A=a((_,z,re)=>{if(!i||E.length===0)return;let Z;if(re==="first")Z=E[0];else if(re==="last")Z=E[E.length-1];else {let ee=(E.findIndex(q=>q.value===z.value)+re+E.length)%E.length;Z=E[ee];}Z&&(_.preventDefault(),R(Z.value),M.current.get(Z.value)?.focus());},"moveFocus"),L=a((_,z)=>{z.disabled||(_.key==="ArrowDown"?A(_,z,1):_.key==="ArrowUp"?A(_,z,-1):_.key==="Home"?A(_,z,"first"):_.key==="End"&&A(_,z,"last"));},"handleKeyDown"),F=a(_=>_ instanceof HTMLElement&&_.dataset.accordionOwner===h,"isOwnedTrigger"),G=a(_=>{F(_.target)&&(I.current=true),g?.(_);},"handleFocusCapture"),$=a(_=>{F(_.target)&&!F(_.relatedTarget)&&(I.current=false),f?.(_);},"handleBlurCapture");return jsxRuntime.jsx("div",{...k,...b,ref:x,id:u,dir:W,"data-monkeys-component":"accordion","data-slot":"root","data-state":P?"open":"closed","data-collapsible":n,"data-keyboard-navigation":i,className:m(w.slots.accordionRoot,d?.root,l),style:{...w.styles.accordion,...c},onFocusCapture:G,onBlurCapture:$,children:t.map((_,z)=>{let re=D[z],Z=`${h}-${re}-trigger`,ae=`${h}-${re}-panel`,ee=_.value===N,q=ee?"open":"closed";return ho.createElement("div",{...k,key:_.value,dir:W,"data-monkeys-component":"accordion","data-slot":"item","data-state":q,"data-disabled":_.disabled||void 0,className:m(w.slots.accordionItem,d?.item)},jsxRuntime.jsxs("button",{...k,ref:U=>{U?M.current.set(_.value,U):M.current.delete(_.value);},id:Z,type:"button","aria-expanded":ee,"aria-controls":ae,"aria-disabled":_.disabled||void 0,disabled:_.disabled,dir:W,"data-accordion-owner":h,"data-monkeys-component":"accordion","data-slot":"trigger","data-state":q,"data-disabled":_.disabled||void 0,className:m(w.slots.accordionTrigger,d?.trigger),onFocus:()=>R(_.value),onKeyDown:U=>L(U,_),onClick:()=>H(_),children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:_.title}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-monkeys-component":"accordion","data-slot":"trigger-icon","data-state":q,className:m(w.slots.accordionTriggerIcon,ee&&"rotate-[225deg]",d?.triggerIcon)})]}),ee?jsxRuntime.jsx("div",{...k,id:ae,role:"region","aria-labelledby":Z,dir:W,"data-monkeys-component":"accordion","data-slot":"panel","data-state":"open",className:m(w.slots.accordionPanel,d?.panel),children:V(_.content)?_.content:null}):null)})})},"BaseAccordion"));var C2={sm:"h-7 w-7 text-xs",md:"h-9 w-9 text-sm",lg:"h-12 w-12 text-base"},ix={online:"bg-[hsl(var(--success,142_72%_29%))]",busy:"bg-[hsl(var(--warning,45_93%_47%))]",offline:"bg-muted-foreground",neutral:"bg-muted-foreground"};function ax(e){return typeof e=="string"&&e in ix}a(ax,"isStatusPreset");function S2(e){if(!e)return;let t=e.trim().split(/\s+/).filter(Boolean);if(t.length)return t.slice(0,2).map(o=>o[0]?.toUpperCase()).join("")}a(S2,"getInitials");var fc=ho.forwardRef(a(function({src:t,alt:o,name:r,initials:n,icon:i,status:s,size:l="md",appearance:d,className:c,classNames:p,style:u,children:g,title:f,...b},x){if(l!=="sm"&&l!=="md"&&l!=="lg")throw new TypeError('BaseAvatar size must be "sm", "md", or "lg".');let y=Pe(d),k=ke(),w=Ne(y),[v,h]=ho.useState(),T=!!t&&!!!(t&&v===t),C=S2(r),R=V(g)?"children":V(n)?"initials":V(C)?"name":V(i)?"icon":"default",M=V(g)?g:V(n)?n:V(C)?C:V(i)?i:"?",I=ax(s)?s:V(s)?"custom":void 0;return ho.useEffect(()=>{h(void 0);},[t]),jsxRuntime.jsxs("div",{...k,...b,ref:x,title:f??r,"data-monkeys-component":"avatar","data-slot":"root","data-state":T?"image":"fallback","data-size":l,"data-status":I,"data-fallback":T?void 0:R,className:m(w.slots.avatarRoot,C2[l],p?.root,c),style:{...w.styles.avatar,...u},children:[T?jsxRuntime.jsx("img",{src:t,alt:o??r??"","data-slot":"image","data-size":l,"data-status":I,className:m(w.slots.avatarImage,p?.image),onError:()=>h(t)}):jsxRuntime.jsx("span",{"data-slot":"fallback","data-size":l,"data-status":I,"data-fallback":R,className:m(w.slots.avatarFallback,p?.fallback,p?.text),children:M}),ax(s)?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"status","data-size":l,"data-status":s,className:m(w.slots.avatarStatus,ix[s],p?.status)}):V(s)?jsxRuntime.jsx("span",{"data-slot":"status","data-size":l,"data-status":"custom",className:m(w.slots.avatarStatus,p?.status),children:s}):null]})},"BaseAvatar"));function R2(e){if(!Number.isFinite(e)||e<=0)throw new RangeError("BaseAspectRatio ratio must be a positive finite number.");return String(e)}a(R2,"resolveAspectRatio");var M2=ho.forwardRef(a(function({children:t,ratio:o=16/9,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);return jsxRuntime.jsx("div",{...p,...l,ref:d,"data-monkeys-component":"aspect-ratio","data-slot":"root","data-ratio":o,className:m(u.slots.aspectRatioRoot,i?.root,n),style:{...u.styles.aspectRatio,aspectRatio:R2(o),...s},children:t})},"BaseAspectRatio"));var bc=ho.forwardRef(a(function({children:t,label:o,icon:r,tone:n,appearance:i,variant:s,density:l,state:d,className:c,classNames:p,style:u,...g},f){if(n!==void 0&&n!=="default"&&n!=="primary"&&n!=="success"&&n!=="warning"&&n!=="danger"&&n!=="muted")throw new TypeError('BaseBadge tone must be "default", "primary", "success", "warning", "danger", or "muted".');let b=Pe(i),x=ke(),y=Ne({...b,variant:s,density:l,state:d}),k=t??o,w=n??"default";return jsxRuntime.jsxs("span",{...x,...g,ref:f,"data-monkeys-component":"badge","data-slot":"root","data-tone":w,"data-variant":y.variant,"data-density":y.density,"data-state":y.state,className:m(y.slots.badgeBase,Ld(y,n),p?.root,c),style:{...y.styles.badge,...u},children:[r?jsxRuntime.jsx("span",{"data-slot":"icon","data-tone":w,className:m(y.slots.badgeIcon,p?.icon),children:r}):null,k!=null?jsxRuntime.jsx("span",{"data-slot":"label","data-tone":w,className:m(y.slots.badgeLabel,p?.label),children:k}):null]})},"BaseBadge"));function E2(e,t,o){return e.current??t===o-1}a(E2,"isCurrentItem");function lx({items:e=[],separator:t="/",appearance:o,className:r,classNames:n,style:i,onSelect:s,...l}){let d=Ne(o),c=a((p,u,g)=>{if(u.disabled){p.preventDefault();return}s?.(u,g);},"handleClick");return jsxRuntime.jsx("nav",{...l,"aria-label":l["aria-label"]??"Breadcrumb",className:m(d.slots.breadcrumbRoot,n?.root,r),style:{...d.styles.breadcrumb,...i},children:jsxRuntime.jsx("ol",{className:m(d.slots.breadcrumbList,n?.list),children:e.map((p,u)=>{let g=E2(p,u,e.length);return jsxRuntime.jsxs("li",{className:m(d.slots.breadcrumbItem,n?.item),children:[g?jsxRuntime.jsx("span",{"aria-current":"page",className:m(d.slots.breadcrumbCurrent,n?.current),children:p.label}):p.href?jsxRuntime.jsx("a",{href:p.href,"aria-disabled":p.disabled||void 0,className:m(d.slots.breadcrumbLink,n?.link),onClick:f=>c(f,p,u),children:p.label}):jsxRuntime.jsx("button",{type:"button",disabled:p.disabled,className:m(d.slots.breadcrumbLink,"bg-transparent p-0",n?.link),onClick:f=>c(f,p,u),children:p.label}),u<e.length-1?jsxRuntime.jsx("span",{"aria-hidden":"true",className:m(d.slots.breadcrumbSeparator,n?.separator),children:t}):null]},`${u}-${p.value??p.href??String(p.label)}`)})})})}a(lx,"BaseBreadcrumb");var L2={sm:"h-8 px-2.5 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-3.5 text-base"},W2={sm:"h-8 w-8 px-0",md:"h-9 w-9 px-0",lg:"h-10 w-10 px-0"},Hm={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"};function gc(e){return typeof e=="string"&&e.trim()?e:void 0}a(gc,"nonEmptyText");function z2(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-full w-full motion-safe:animate-spin motion-reduce:animate-none",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(z2,"LoadingIcon");var mt=ho.forwardRef(a(function({children:t,label:o,icon:r,endIcon:n,type:i="button",title:s,ariaLabel:l,tone:d,size:c,active:p=false,iconOnly:u=false,disabled:g=false,loading:f=false,stopPropagation:b=false,appearance:x,variant:y,density:k,state:w,className:v,classNames:h,style:S,onClick:T,"aria-label":C,"aria-pressed":R,...M},I){for(let[z,re]of [["active",p],["iconOnly",u],["disabled",g],["loading",f],["stopPropagation",b]])if(typeof re!="boolean")throw new TypeError(`BaseButton ${z} must be a boolean.`);if(c!==void 0&&c!=="sm"&&c!=="md"&&c!=="lg")throw new TypeError('BaseButton size must be "sm", "md", or "lg".');if(d!==void 0&&d!=="default"&&d!=="primary"&&d!=="success"&&d!=="warning"&&d!=="danger"&&d!=="muted")throw new TypeError('BaseButton tone must be "default", "primary", "success", "warning", "danger", or "muted".');let B=Pe(x),N=ke(),D=Ne({...B,variant:y,density:k,state:w}),E=t??o,P=V(E)&&(typeof E!="string"||!!E.trim()),W=gc(l)??gc(C),H=typeof E=="string"?gc(E):void 0,A=gc(s);if(u&&!P&&!W&&!A)throw new TypeError("BaseButton iconOnly requires ariaLabel, aria-label, title, or a renderable label.");let L=W??H??A,F=g||f,G=d??"default",$=w??(f?"loading":g?"disabled":p?"active":"idle"),_=a(z=>{b&&z.stopPropagation(),!F&&T?.(z);},"handleClick");return jsxRuntime.jsxs("button",{...N,...M,ref:I,type:i,title:s,"aria-label":L,"aria-pressed":R??(p||void 0),"aria-busy":f||void 0,"data-variant":D.variant,"data-density":D.density,disabled:F,"data-monkeys-component":"button","data-slot":"root","data-state":$,"data-tone":G,"data-size":c,"data-active":p||void 0,"data-loading":f||void 0,"data-disabled":F||void 0,"data-icon-only":u||void 0,className:m(D.slots.buttonBase,u&&D.slots.buttonIconOnly,c&&L2[c],u&&c&&W2[c],Gn(D,d,p),F&&D.slots.buttonDisabled,h?.root,v),style:{...D.styles.button,...p?D.styles.buttonActive:void 0,...F?D.styles.buttonDisabled:void 0,...S},onClick:_,children:[f?jsxRuntime.jsx("span",{"data-slot":"icon","data-state":$,"data-tone":G,"data-size":c,className:m(D.slots.buttonIcon,c&&Hm[c],h?.icon),children:jsxRuntime.jsx(z2,{})}):r?jsxRuntime.jsx("span",{"data-slot":"icon","data-state":$,"data-tone":G,"data-size":c,className:m(D.slots.buttonIcon,c&&Hm[c],h?.icon),children:r}):null,u?V(E)?jsxRuntime.jsx("span",{"data-slot":"label","data-state":$,"data-tone":G,"data-size":c,className:"sr-only",children:E}):null:V(E)?jsxRuntime.jsx("span",{"data-slot":"label","data-state":$,"data-tone":G,"data-size":c,className:m(D.slots.buttonLabel,h?.label),children:E}):null,!f&&n?jsxRuntime.jsx("span",{"data-slot":"end-icon","data-state":$,"data-tone":G,"data-size":c,className:m(D.slots.buttonIcon,c&&Hm[c],h?.icon,h?.endIcon),children:n}):null]})},"BaseButton"));var F2=ho.forwardRef(a(function({children:t,display:o="inline",appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);return o==="block"?jsxRuntime.jsx("pre",{...p,...l,ref:d,"data-monkeys-component":"code","data-slot":"root","data-display":"block",className:m(u.slots.codeBlock,i?.root,n),style:{...u.styles.code,...s},children:jsxRuntime.jsx("code",{"data-slot":"code",className:m(u.slots.codeContent,i?.code),style:u.styles.codeContent,children:t})}):jsxRuntime.jsx("code",{...p,...l,ref:d,"data-monkeys-component":"code","data-slot":"root","data-display":"inline",className:m(u.slots.codeInline,u.slots.codeContent,i?.root,i?.code,n),style:{...u.styles.code,...u.styles.codeContent,...s},children:t})},"BaseCode"));function cx(e,t){let o=Number.isFinite(t?.speed)?Math.max(-1,Math.min(1,t.speed)):0,r=Number.isFinite(t?.maxOffset)?Math.max(0,Math.min(200,t.maxOffset)):16;ho.useEffect(()=>{let n=e.current;if(!n||!o||!r)return;let i=n.ownerDocument.defaultView;if(!i)return;let s=n.parentElement;for(;s&&!/(auto|scroll|overlay)/.test(i.getComputedStyle(s).overflowY);)s=s.parentElement;let l=s,d=l??i,c=i.matchMedia("(prefers-reduced-motion: reduce)"),p=n.style.translate,u,g=false,f=a(()=>{u=void 0;let k=Math.max(-r,Math.min(r,Math.max(0,l?l.scrollTop:i.scrollY)*o));n.style.translate=`0 ${k}px`;},"update"),b=a(()=>{u===void 0&&(u=i.requestAnimationFrame(f));},"schedule"),x=a(()=>{d.removeEventListener("scroll",b),g=false,u!==void 0&&i.cancelAnimationFrame(u),u=void 0,n.style.translate=p;},"stop"),y=a(()=>{c.matches?x():g||(d.addEventListener("scroll",b,{passive:true}),g=true,f());},"syncPreference");return c.addEventListener("change",y),y(),()=>{x(),c.removeEventListener("change",y);}},[e,o,r]);}a(cx,"useScrollMotion");var $2=ho.forwardRef(a(function({children:t,maxWidth:o="80rem",padding:r="1rem",scrollMotion:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=ho.useRef(null),g=ho.useCallback(w=>{u.current=w,typeof p=="function"?p(w):p&&(p.current=w);},[p]);cx(u,n);let f=Pe(i),b=ke(),x=Ne(f),y=rr("BaseContainer","maxWidth",o),k=rr("BaseContainer","padding",r);return jsxRuntime.jsx("div",{...b,...c,ref:g,"data-monkeys-component":"container","data-slot":"root",className:m(x.slots.containerRoot,l?.root,s),style:{...x.styles.container,maxWidth:y,paddingInline:k,...d},children:t})},"BaseContainer"));var U2=["default","primary","success","warning","danger","muted"];function Lo(e,t){if(typeof e!="boolean")throw new TypeError(`BaseContextMenu ${t} must be a boolean.`)}a(Lo,"validateBoolean");function hc(e){if(e!==void 0&&!U2.includes(e))throw new TypeError('BaseContextMenu tone must be "default", "primary", "success", "warning", "danger", or "muted".')}a(hc,"validateTone");function K2(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('BaseContextMenu dir must be "ltr" or "rtl".')}a(K2,"validateDirection");function q2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 4.5"})})}a(q2,"CheckIcon");function Y2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"currentColor",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3"})})}a(Y2,"DotIcon");function X2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 4 4 4-4 4"})})}a(X2,"ChevronRightIcon");function _m({label:e,icon:t,shortcut:o,children:r,classNames:n,inset:i,indicator:s}){let l=r??e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s||null,V(t)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(n?.icon),children:t}):i?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"icon",className:"h-4 w-4 shrink-0"}):null,V(l)?jsxRuntime.jsx("span",{"data-slot":"label",className:m(n?.label),children:l}):null,V(o)?jsxRuntime.jsx("span",{"data-slot":"shortcut",className:m(n?.shortcut),children:o}):null]})}a(_m,"renderItemContent");function yc({children:e,trigger:t,content:o,disabled:r=false,modal:n=true,dir:i,appearance:s,className:l,classNames:d,onOpenChange:c}){Lo(r,"disabled"),Lo(n,"modal"),K2(i);let p=li(),u=Pe(s);return jsxRuntime.jsxs(Tt__namespace.Root,{onOpenChange:c,modal:n,dir:i??p,children:[t?jsxRuntime.jsx(Ls,{disabled:r,appearance:u,className:m(d?.trigger,l),children:t}):null,o?jsxRuntime.jsx(Ws,{appearance:u,className:d?.content,children:o}):null,e]})}a(yc,"BaseContextMenu");var Ls=ho.forwardRef(a(function({children:t,disabled:o=false,asChild:r=false,appearance:n,className:i,style:s,...l},d){Lo(o,"Trigger disabled"),Lo(r,"Trigger asChild");let c=Pe(n),p=ke(),u=Ne(c);return jsxRuntime.jsx(Tt__namespace.Trigger,{...p,...l,ref:d,asChild:r,disabled:o,"data-monkeys-component":"context-menu","data-slot":"trigger","data-disabled":o||void 0,className:m(!r&&u.slots.menuTrigger,o&&!r&&u.slots.menuItemDisabled,i),style:s,children:t})},"BaseContextMenuTrigger")),Ws=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d),u=wr(),g=jsxRuntime.jsx(Tt__namespace.Content,{...c,...s,ref:l,"data-monkeys-component":"context-menu","data-slot":"content",className:m(p.slots.menuContent,n?.root,r),style:{...p.styles.menuContent,...i},children:t});return u.shouldPortal?jsxRuntime.jsx(Tt__namespace.Portal,{...u.radixPortalProps,children:g}):g},"BaseContextMenuContent")),xc=ho.forwardRef(a(function({children:t,appearance:o,className:r,style:n,...i},s){let l=Pe(o),d=ke(),c=Ne(l);return jsxRuntime.jsx(Tt__namespace.Label,{...d,...i,ref:s,"data-monkeys-component":"context-menu","data-slot":"label",className:m(c.slots.menuLabel,r),style:n,children:t})},"BaseContextMenuLabel")),vc=ho.forwardRef(a(function({appearance:t,className:o,style:r,...n},i){let s=Pe(t),l=ke(),d=Ne(s);return jsxRuntime.jsx(Tt__namespace.Separator,{...l,...n,ref:i,"data-monkeys-component":"context-menu","data-slot":"separator",className:m(d.slots.menuSeparator,o),style:r})},"BaseContextMenuSeparator")),oa=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,appearance:d,className:c,classNames:p,style:u,onSelect:g,...f},b){Lo(s,"Item disabled"),Lo(l,"Item inset"),hc(i);let x=i??"default",y=Pe(d),k=ke(),w=Ne(y);return jsxRuntime.jsx(Tt__namespace.Item,{...k,...f,ref:b,disabled:s,"data-monkeys-component":"context-menu","data-slot":"item","data-tone":x,"data-disabled":s||void 0,className:m(w.slots.menuItem,Ma(w,i),s&&w.slots.menuItemDisabled,p?.root,c),style:{...w.styles.menuItem,...u},onSelect:v=>{if(s){v.preventDefault();return}g?.(v);},children:_m({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(w.slots.menuItemIcon,p?.icon),label:m(w.slots.menuItemLabel,p?.label),shortcut:m(w.slots.menuItemShortcut,p?.shortcut)}})})},"BaseContextMenuItem")),ux=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,checked:d,onCheckedChange:c,appearance:p,className:u,classNames:g,style:f,onSelect:b,...x},y){if(Lo(s,"CheckboxItem disabled"),Lo(l,"CheckboxItem inset"),hc(i),d!==void 0&&d!=="indeterminate"&&typeof d!="boolean")throw new TypeError('BaseContextMenu CheckboxItem checked must be a boolean or "indeterminate".');let k=i??"default",w=Pe(p),v=ke(),h=Ne(w);return jsxRuntime.jsx(Tt__namespace.CheckboxItem,{...v,...x,ref:y,checked:d,disabled:s,"data-monkeys-component":"context-menu","data-slot":"checkbox-item","data-tone":k,"data-disabled":s||void 0,"data-checked":d==="indeterminate"?"mixed":d===void 0?void 0:String(d),onCheckedChange:S=>{s||c?.(S);},className:m(h.slots.menuItem,"pl-8",Ma(h,i),s&&h.slots.menuItemDisabled,g?.root,u),style:{...h.styles.menuItem,...f},onSelect:S=>{if(s){S.preventDefault();return}b?.(S);},children:_m({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(h.slots.menuItemIcon,g?.icon),label:m(h.slots.menuItemLabel,g?.label),shortcut:m(h.slots.menuItemShortcut,g?.shortcut)},indicator:jsxRuntime.jsx(Tt__namespace.ItemIndicator,{"data-slot":"indicator",className:m(h.slots.menuCheckboxIndicator,g?.indicator),children:jsxRuntime.jsx(q2,{})})})})},"BaseContextMenuCheckboxItem"));function px({children:e,value:t,onValueChange:o}){return jsxRuntime.jsx(Tt__namespace.RadioGroup,{value:t,onValueChange:o,children:e})}a(px,"BaseContextMenuRadioGroup");var mx=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,value:d,appearance:c,className:p,classNames:u,style:g,onSelect:f,...b},x){Lo(s,"RadioItem disabled"),Lo(l,"RadioItem inset"),hc(i);let y=i??"default",k=Pe(c),w=ke(),v=Ne(k);return jsxRuntime.jsx(Tt__namespace.RadioItem,{...w,...b,ref:x,value:d,disabled:s,"data-monkeys-component":"context-menu","data-slot":"radio-item","data-tone":y,"data-value":d,"data-disabled":s||void 0,className:m(v.slots.menuItem,"pl-8",Ma(v,i),s&&v.slots.menuItemDisabled,u?.root,p),style:{...v.styles.menuItem,...g},onSelect:h=>{if(s){h.preventDefault();return}f?.(h);},children:_m({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(v.slots.menuItemIcon,u?.icon),label:m(v.slots.menuItemLabel,u?.label),shortcut:m(v.slots.menuItemShortcut,u?.shortcut)},indicator:jsxRuntime.jsx(Tt__namespace.ItemIndicator,{"data-slot":"indicator",className:m(v.slots.menuRadioIndicator,u?.indicator),children:jsxRuntime.jsx(Y2,{})})})})},"BaseContextMenuRadioItem"));function fx({children:e,open:t,defaultOpen:o,onOpenChange:r}){return t!==void 0&&Lo(t,"Sub open"),o!==void 0&&Lo(o,"Sub defaultOpen"),jsxRuntime.jsx(Tt__namespace.Sub,{open:t,defaultOpen:o,onOpenChange:r,children:e})}a(fx,"BaseContextMenuSub");var bx=ho.forwardRef(a(function({children:t,label:o,icon:r,tone:n,disabled:i=false,inset:s=false,appearance:l,className:d,classNames:c,style:p,...u},g){Lo(i,"SubTrigger disabled"),Lo(s,"SubTrigger inset"),hc(n);let f=n??"default",b=Pe(l),x=ke(),y=Ne(b),k=t??o;return jsxRuntime.jsxs(Tt__namespace.SubTrigger,{...x,...u,ref:g,disabled:i,"data-monkeys-component":"context-menu","data-slot":"sub-trigger","data-tone":f,"data-disabled":i||void 0,className:m(y.slots.menuSubTrigger,Ma(y,n),i&&y.slots.menuItemDisabled,c?.root,d),style:{...y.styles.menuItem,...p},children:[V(r)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(y.slots.menuItemIcon,c?.icon),children:r}):s?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"icon",className:"h-4 w-4 shrink-0"}):null,V(k)?jsxRuntime.jsx("span",{"data-slot":"label",className:m(y.slots.menuItemLabel,c?.label),children:k}):null,jsxRuntime.jsx("span",{"data-slot":"sub-indicator",className:m(y.slots.menuSubTriggerIcon,c?.shortcut,"rtl:rotate-180"),children:jsxRuntime.jsx(X2,{})})]})},"BaseContextMenuSubTrigger")),gx=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,sideOffset:s=6,...l},d){let c=Pe(o),p=ke(),u=Ne(c),g=wr(),f=jsxRuntime.jsx(Tt__namespace.SubContent,{...p,...l,ref:d,sideOffset:s,"data-monkeys-component":"context-menu","data-slot":"sub-content",className:m(u.slots.menuSubContent,n?.root,r),style:{...u.styles.menuContent,...i},children:t});return g.shouldPortal?jsxRuntime.jsx(Tt__namespace.Portal,{...g.radixPortalProps,children:f}):f},"BaseContextMenuSubContent"));var Z2={1:"grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-2 xl:grid-cols-3"};function wc({items:e,columns:t=1,appearance:o,className:r,classNames:n,style:i,children:s,...l}){let d=Ne(o);return jsxRuntime.jsxs("dl",{...l,className:m(d.slots.descriptionListRoot,Z2[t],n?.root,r),style:{...d.styles.descriptionList,...i},children:[e?.map((c,p)=>jsxRuntime.jsxs("div",{className:m(d.slots.descriptionListItem,n?.item),children:[jsxRuntime.jsx("dt",{className:m(d.slots.descriptionListTerm,n?.term),children:c.term}),jsxRuntime.jsx("dd",{className:m(d.slots.descriptionListValue,n?.value),children:c.value})]},p)),s]})}a(wc,"BaseDescriptionList");var oI=["default","primary","success","warning","danger","muted"];function _r(e,t){if(typeof e!="boolean")throw new TypeError(`BaseDialog ${t} must be a boolean.`)}a(_r,"validateBoolean");function rI(e){if(!oI.includes(e))throw new TypeError('BaseDialog triggerTone must be "default", "primary", "success", "warning", "danger", or "muted".')}a(rI,"validateTriggerTone");function nI({trigger:e,triggerLabel:t,triggerIcon:o,triggerTone:r,triggerDisabled:n,theme:i}){return V(e)?jsxRuntime.jsx("span",{role:"button",tabIndex:n?-1:0,"aria-disabled":n||void 0,onKeyDown:s=>{n||(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),s.currentTarget.click());},children:e}):V(t)?jsxRuntime.jsxs("button",{type:"button",disabled:n,"aria-label":typeof t=="string"&&t.trim()?t:void 0,className:m(i.slots.buttonBase,Gn(i,r),n&&i.slots.buttonDisabled),style:{...i.styles.button,...n?i.styles.buttonDisabled:void 0},children:[V(o)?jsxRuntime.jsx("span",{"data-slot":"icon",className:i.slots.buttonIcon,children:o}):null,jsxRuntime.jsx("span",{"data-slot":"label",className:i.slots.buttonLabel,children:t})]}):null}a(nI,"renderTrigger");var Ri=ho.forwardRef(a(function({open:t,defaultOpen:o=false,size:r="default",title:n,description:i,header:s,footer:l,trigger:d,triggerLabel:c,triggerIcon:p,triggerTone:u="default",triggerDisabled:g=false,closeLabel:f,closeOnEscape:b=true,closeOnOverlayClick:x=true,showCloseButton:y=true,keepMounted:k=false,trapFocus:w=true,restoreFocus:v=true,initialFocus:h="first-interactive",initialFocusRef:S,zIndex:T,portal:C=false,appearance:R,className:M,classNames:I,style:B,children:N,onOpenChange:D,id:E,...P},W){if(t!==void 0&&_r(t,"open"),_r(o,"defaultOpen"),!["default","viewport","page"].includes(r))throw new TypeError("BaseDialog size must be default, viewport or page.");if(_r(g,"triggerDisabled"),_r(b,"closeOnEscape"),_r(x,"closeOnOverlayClick"),_r(y,"showCloseButton"),_r(k,"keepMounted"),_r(w,"trapFocus"),_r(v,"restoreFocus"),_r(C,"portal"),rI(u),h!=="first-interactive"&&h!=="container"&&h!=="explicit")throw new TypeError('BaseDialog initialFocus must be "first-interactive", "container", or "explicit".');if(T!==void 0&&!Number.isFinite(T))throw new TypeError("BaseDialog zIndex must be a finite number.");let H=Ye().dialog,A=Pe(R),L=ke(),F=f===void 0?H.close:f,G=Ne(A),$=wr({disabled:!C}),[_,z]=ho.useState(o),re=ho.useRef(null),Z=ho.useRef(null),ae=t!==void 0,ee=ae?t:_,q=C&&$.shouldPortal?"portaled":"inline",U=V(n),X=V(i),O=V(s);if(y&&(typeof F!="string"||!F.trim()))throw new TypeError("BaseDialog closeLabel must be a non-empty string when showCloseButton is true.");let K=a(me=>{ae||z(me),D?.(me);},"handleOpenChange");ho.useEffect(()=>{if(!ee||!k)return;let me=re.current,ie=me?.ownerDocument,be=ie?.defaultView;if(!me||!ie||!be)return;Z.current=ie.activeElement instanceof be.HTMLElement?ie.activeElement:null;let He=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),We=a(()=>{let Q=me.querySelector(He);(h==="container"?me:h==="explicit"?S?.current??me:Q??me).focus();},"focusInitial"),Ke=be.requestAnimationFrame(We),ce=a(Q=>{if(Q.key==="Escape"&&b){Q.preventDefault(),Q.stopPropagation(),K(false);return}if(Q.key!=="Tab"||!w)return;let ge=Array.from(me.querySelectorAll(He));if(ge.length===0){Q.preventDefault(),me.focus();return}let we=ge[0],Ie=ge[ge.length-1];Q.shiftKey&&ie.activeElement===we?(Q.preventDefault(),Ie.focus()):!Q.shiftKey&&ie.activeElement===Ie&&(Q.preventDefault(),we.focus());},"handleKeyDown");return be.addEventListener("keydown",ce),()=>{be.cancelAnimationFrame(Ke),be.removeEventListener("keydown",ce),v&&Z.current?.isConnected&&Z.current.focus();}},[b,h,S,ee,k,v,w]);let ne=O||U||X?jsxRuntime.jsxs("div",{...L,"data-monkeys-component":"dialog","data-slot":"header","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogHeader,I?.header,r==="page"&&"sr-only"),children:[O?s:null,U?jsxRuntime.jsx(xo__namespace.Title,{...L,"data-monkeys-component":"dialog","data-slot":"title","data-state":ee?"open":"closed","data-portal":q,className:O?"sr-only":m(G.slots.dialogTitle,I?.title),children:n}):null,X?jsxRuntime.jsx(xo__namespace.Description,{...L,"data-monkeys-component":"dialog","data-slot":"description","data-state":ee?"open":"closed","data-portal":q,className:O?"sr-only":m(G.slots.dialogDescription,I?.description),children:i}):null]}):null,fe=nI({trigger:d,triggerLabel:c,triggerIcon:p,triggerTone:u,triggerDisabled:g,theme:G}),he=ee||k?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(xo__namespace.Overlay,{forceMount:k||void 0,hidden:!ee,...L,"aria-hidden":"true","data-monkeys-component":"dialog","data-slot":"overlay","data-portal":q,className:m(G.slots.dialogOverlay,I?.overlay),style:{...G.styles.dialogOverlay,zIndex:T,...r==="page"?{background:"transparent",backdropFilter:"none"}:{}}}),jsxRuntime.jsx("div",{...L,hidden:!ee,"data-monkeys-component":"dialog","data-slot":"content","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogContent,I?.content),style:{zIndex:T,...r==="page"?{padding:0,inset:0}:{}},children:jsxRuntime.jsx(xo__namespace.Content,{forceMount:k||void 0,...L,...U?{}:{"aria-labelledby":void 0},...X?{}:{"aria-describedby":void 0},asChild:true,onOpenAutoFocus:me=>{if(k){me.preventDefault();return}let ie=re.current;Z.current=ie?.ownerDocument.activeElement,(h==="container"||h==="explicit")&&(me.preventDefault(),(h==="explicit"?S?.current??ie:ie)?.focus({preventScroll:true}));},onCloseAutoFocus:me=>{if(k||!v){me.preventDefault();return}let ie=Z.current;ie?.isConnected&&(me.preventDefault(),ie.focus({preventScroll:true}));},onEscapeKeyDown:me=>{(k||!b)&&me.preventDefault();},onPointerDownOutside:me=>{x||me.preventDefault();},children:jsxRuntime.jsxs("div",{...L,ref:re,tabIndex:-1,"aria-modal":"true","data-monkeys-component":"dialog","data-slot":"panel","data-portal":q,className:m(G.slots.dialogPanel,I?.panel),"data-presentation":r,style:{...G.styles.dialogPanel,...r!=="default"?{width:r==="page"?"100vw":"96vw",maxWidth:"none",height:r==="page"?"100dvh":"94dvh",maxHeight:r==="page"?"100dvh":"94dvh",display:"flex",flexDirection:"column"}:{},...r==="page"?{borderRadius:0,border:0,boxShadow:"none",margin:0,animation:"none"}:{}},children:[ne,y?jsxRuntime.jsx(xo__namespace.Close,{asChild:true,children:jsxRuntime.jsx("button",{...L,type:"button","aria-label":F,title:F,"data-monkeys-component":"dialog","data-slot":"close","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogClose,I?.close),children:"\xD7"})}):null,jsxRuntime.jsx("div",{...L,"data-monkeys-component":"dialog","data-slot":"body","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogBody,I?.body),style:r!=="default"?{minHeight:0,flex:"1 1 0%",overflow:"hidden",padding:0}:void 0,children:N}),V(l)?jsxRuntime.jsx("div",{...L,"data-monkeys-component":"dialog","data-slot":"footer","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogFooter,I?.footer),children:l}):null]})})})]}):null;return jsxRuntime.jsx("div",{...L,...P,ref:W,id:E,"data-monkeys-component":"dialog","data-slot":"root","data-state":ee?"open":"closed","data-portal":q,className:m(G.slots.dialogRoot,I?.root,M),style:B,children:jsxRuntime.jsxs(xo__namespace.Root,{open:ee,onOpenChange:K,modal:!k&&w,children:[fe?jsxRuntime.jsx(xo__namespace.Trigger,{...L,asChild:true,disabled:g,"data-monkeys-component":"dialog","data-slot":"trigger","data-portal":q,"data-tone":u,"data-disabled":g||void 0,className:m(G.slots.dialogTrigger,g&&G.slots.dialogTriggerDisabled,I?.trigger),children:fe}):null,C&&$.shouldPortal?jsxRuntime.jsx(ks,{children:jsxRuntime.jsx(xo__namespace.Portal,{...$.radixPortalProps,forceMount:k||void 0,children:he})}):jsxRuntime.jsx(ks,{children:he})]})})},"BaseDialog"));var vx=ho.forwardRef(a(function({orientation:t="horizontal",label:o,appearance:r,className:n,classNames:i,style:s,...l},d){if(t!=="horizontal"&&t!=="vertical")throw new TypeError('BaseDivider orientation must be "horizontal" or "vertical".');let c=Pe(r),p=ke(),u=Ne(c),g=t==="vertical",f=V(o)&&!g,b={...u.styles.divider,...s};return f?jsxRuntime.jsxs("div",{...p,...l,ref:d,role:"separator","aria-orientation":t,"data-monkeys-component":"divider","data-slot":"root","data-orientation":t,"data-state":"labeled",className:m("flex min-w-0 items-center",i?.root,n),style:b,children:[jsxRuntime.jsx("div",{"data-slot":"line","data-orientation":t,className:m("min-w-0 flex-1 border-t",u.slots.dividerRoot,i?.line)}),jsxRuntime.jsx("span",{"data-slot":"label","data-orientation":t,className:m(u.slots.dividerLabel,i?.label),children:o}),jsxRuntime.jsx("div",{"data-slot":"line","data-orientation":t,className:m("min-w-0 flex-1 border-t",u.slots.dividerRoot,i?.line)})]}):jsxRuntime.jsx("div",{...p,...l,ref:d,role:"separator","aria-orientation":t,"data-monkeys-component":"divider","data-slot":"root","data-orientation":t,"data-state":"unlabeled",className:m(u.slots.dividerRoot,g?"min-h-full self-stretch border-l":"w-full border-t",i?.root,n),style:b})},"BaseDivider"));function Mi(e,t){if(typeof e!="boolean")throw new TypeError(`BaseDropdownMenu ${t} must be a boolean.`)}a(Mi,"validateBoolean");function cI(e){if(e!=="bottom-start"&&e!=="bottom-end"&&e!=="top-start"&&e!=="top-end")throw new TypeError('BaseDropdownMenu placement must be "bottom-start", "bottom-end", "top-start", or "top-end".')}a(cI,"validatePlacement");function uI(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('BaseDropdownMenu dir must be "ltr" or "rtl".')}a(uI,"validateDirection");function pI(e){if(!Array.isArray(e))throw new TypeError("BaseDropdownMenu items must be an array.");let t=new Set;for(let[o,r]of e.entries()){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`BaseDropdownMenu items[${o}] must be an object.`);if(typeof r.value!="string"||!r.value.trim())throw new TypeError(`BaseDropdownMenu items[${o}].value must be a non-empty string.`);if(t.has(r.value))throw new TypeError(`BaseDropdownMenu item value "${r.value}" must be unique.`);t.add(r.value);for(let n of ["disabled","danger","separatorBefore"]){let i=r[n];i!==void 0&&Mi(i,`items[${o}].${n}`);}if(r.onSelect!==void 0&&typeof r.onSelect!="function")throw new TypeError(`BaseDropdownMenu items[${o}].onSelect must be a function.`)}}a(pI,"validateItems");function mI(e){let[t,o]=e.split("-");return {side:t,align:o}}a(mI,"resolvePlacement");function fI({trigger:e,triggerLabel:t,triggerIcon:o,disabled:r,theme:n}){return V(e)?jsxRuntime.jsx("span",{role:"button",tabIndex:r?-1:0,"aria-disabled":r||void 0,children:e}):jsxRuntime.jsxs("button",{type:"button",disabled:r,"aria-label":typeof t=="string"&&t.trim()?t:void 0,className:m(n.slots.buttonBase,Gn(n),r&&n.slots.buttonDisabled),style:{...n.styles.button,...r?n.styles.buttonDisabled:void 0},children:[V(o)?jsxRuntime.jsx("span",{"data-slot":"icon",className:n.slots.buttonIcon,children:o}):null,V(t)?jsxRuntime.jsx("span",{"data-slot":"label",className:n.slots.buttonLabel,children:t}):null]})}a(fI,"renderTrigger");var wx=ho.forwardRef(a(function({items:t=[],label:o,trigger:r,triggerLabel:n,triggerIcon:i,disabled:s=false,open:l,defaultOpen:d=false,placement:c="bottom-start",closeOnSelect:p=true,portal:u=false,dir:g,appearance:f,className:b,classNames:x,style:y,children:k,onOpenChange:w,onSelect:v,...h},S){l!==void 0&&Mi(l,"open"),Mi(d,"defaultOpen"),Mi(s,"disabled"),Mi(p,"closeOnSelect"),Mi(u,"portal"),cI(c),uI(g),pI(t);let T=li(),C=g??T,R=Pe(f),M=ke(),I=Ye().dropdownMenu,B=Ne(R),N=wr({disabled:!u}),[D,E]=ho.useState(d),P=l!==void 0,W=P?l:D,H=n===void 0?I.actions:n,A=u&&N.shouldPortal?"portaled":"inline",{side:L,align:F}=mI(c);if(n===void 0&&(typeof I.actions!="string"||!I.actions.trim()))throw new TypeError("BaseDropdownMenu locale actions message must be a non-empty string.");let G=a(_=>{s||(P||E(_),w?.(_));},"handleOpenChange"),$=jsxRuntime.jsxs(Bt__namespace.Content,{...M,side:L,align:F,sideOffset:6,collisionPadding:8,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-placement":c,"data-portal":A,"data-tone":"default","data-disabled":s||void 0,className:m(B.slots.dropdownMenu,x?.menu),style:B.styles.dropdownMenu,children:[V(o)?jsxRuntime.jsx(Bt__namespace.Label,{...M,"data-monkeys-component":"dropdown-menu","data-slot":"label","data-state":"static",className:m(B.slots.dropdownLabel,x?.label),children:o}):null,t.map(_=>{let z=_.disabled??false,re=_.danger?"danger":"default";return jsxRuntime.jsxs("div",{"data-monkeys-component":"dropdown-menu","data-slot":"item-wrapper",children:[_.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{...M,"data-monkeys-component":"dropdown-menu","data-slot":"separator","data-state":"static",className:m(B.slots.dropdownSeparator,x?.separator)}):null,jsxRuntime.jsx(Bt__namespace.Item,{asChild:true,disabled:z,onSelect:Z=>{_.onSelect?.(_),v?.(_),p||Z.preventDefault();},children:jsxRuntime.jsxs("button",{...M,type:"button",disabled:z,"data-monkeys-component":"dropdown-menu","data-slot":"item","data-state":z?"disabled":"enabled","data-value":_.value,"data-placement":c,"data-portal":A,"data-tone":re,"data-disabled":z||void 0,className:m(B.slots.dropdownItem,_.danger&&B.slots.dropdownItemDanger,z&&B.slots.dropdownItemDisabled,x?.item),style:B.styles.dropdownItem,children:[V(_.icon)?jsxRuntime.jsx("span",{"data-slot":"item-icon",className:m(B.slots.dropdownItemIcon,x?.itemIcon),children:_.icon}):null,jsxRuntime.jsxs("span",{"data-slot":"item-content",className:m(B.slots.dropdownItemContent,x?.itemContent),children:[jsxRuntime.jsx("span",{"data-slot":"item-label",className:m(B.slots.dropdownItemLabel,x?.itemLabel),children:_.label}),V(_.description)?jsxRuntime.jsx("span",{"data-slot":"item-description",className:m(B.slots.dropdownItemDescription,x?.itemDescription),children:_.description}):null]}),V(_.shortcut)?jsxRuntime.jsx("span",{"data-slot":"item-shortcut",className:m(B.slots.dropdownItemShortcut,x?.itemShortcut),children:_.shortcut}):null]})})]},_.value)}),k]});return jsxRuntime.jsx("div",{...M,...h,ref:S,dir:C,"data-monkeys-component":"dropdown-menu","data-slot":"root","data-state":W?"open":"closed","data-placement":c,"data-portal":A,"data-tone":"default","data-disabled":s||void 0,className:m(B.slots.dropdownRoot,x?.root,b),style:y,children:jsxRuntime.jsxs(Bt__namespace.Root,{open:W,onOpenChange:G,dir:C,modal:false,children:[jsxRuntime.jsx(Bt__namespace.Trigger,{...M,asChild:true,disabled:s,"data-monkeys-component":"dropdown-menu","data-slot":"trigger","data-placement":c,"data-portal":A,"data-tone":"default","data-disabled":s||void 0,className:m(B.slots.dropdownTrigger,s&&B.slots.dropdownTriggerDisabled,x?.trigger),children:fI({trigger:r,triggerLabel:H,triggerIcon:i,disabled:s,theme:B})}),u&&N.shouldPortal?jsxRuntime.jsx(Bt__namespace.Portal,{...N.radixPortalProps,children:$}):$]})})},"BaseDropdownMenu"));function gI(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",children:[jsxRuntime.jsx("rect",{width:"16",height:"12",x:"4",y:"6",rx:"2"}),jsxRuntime.jsx("path",{d:"M8 10h8"}),jsxRuntime.jsx("path",{d:"M8 14h5"})]})}a(gI,"DefaultEmptyIcon");var Di=ho.forwardRef(a(function({icon:t=jsxRuntime.jsx(gI,{}),title:o,description:r,actions:n,variant:i,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Pe(s),f=ke(),b=Wr(),x=i??b.empty?.variant??"default",y=b.density==="compact"?"min-h-0 px-3 py-3":b.density==="comfortable"?"min-h-56 px-8 py-12":void 0,k=Ne(g);return jsxRuntime.jsxs("div",{...f,...p,ref:u,"data-monkeys-component":"empty-state","data-slot":"root","data-state":"empty","data-variant":x,"data-density":b.density,className:m(k.slots.stateRoot,y,x==="compact"&&"min-h-0 gap-1 py-3",d?.root,l),style:{...k.styles.stateRoot,...c},children:[V(t)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":"empty",className:m(k.slots.stateIcon,d?.icon),style:k.styles.stateIcon,children:t}):null,V(o)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":"empty",className:m(k.slots.stateTitle,d?.title),children:o}):null,V(r)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":"empty",className:m(k.slots.stateDescription,d?.description),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":"empty",className:m(k.slots.stateActions,d?.actions),children:n}):null]})},"BaseEmptyState"));var Cx=ho.createContext(false);function Sx({children:e}){let{locale:t}=Co();return e==null||e===""?null:jsxRuntime.jsx(To,{content:e,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":typeof e=="string"?e:t.startsWith("zh")?"\u8BF4\u660E":"Help","data-form-help":true,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:jsxRuntime.jsx(lucideReact.HelpCircle,{className:"h-4 w-4","aria-hidden":"true"})})})}a(Sx,"BaseFormHelp");function SI(...e){let t=e.flatMap(o=>o?.split(/\s+/).filter(Boolean)??[]);return t.length?Array.from(new Set(t)).join(" "):void 0}a(SI,"mergeAriaIds");function jm(e,t,o){if(e===void 0)return t;if(!e.trim()||/\s/.test(e))throw new TypeError(`BaseField ${o} must be a non-empty ID without whitespace.`);return e}a(jm,"resolveOptionalId");var Gr=ho.forwardRef(a(function({label:t,description:o,message:r,error:n,required:i=false,disabled:s=false,htmlFor:l,descriptionId:d,messageId:c,errorId:p,validate:u,validationMode:g="onBlur",children:f,appearance:b,className:x,classNames:y,style:k,...w},v){for(let[K,ne]of [["required",i],["disabled",s]])if(typeof ne!="boolean")throw new TypeError(`BaseField ${K} must be a boolean.`);if(u!==void 0&&typeof u!="function")throw new TypeError("BaseField validate must be a function.");if(g!=="onBlur"&&g!=="onChange")throw new TypeError('BaseField validationMode must be "onBlur" or "onChange".');let h=ho.useContext(Cx)?"tooltip":"inline",S=ho.useId(),T=Pe(b),C=ke(),R=Ne(T),M=V(o),[I,B]=ho.useState(null),N=ho.useRef(new Set),D=ho.useRef(u),E=ho.useRef(g),P=ho.useRef(s);D.current=u,E.current=g,P.current=s;let W=u!==void 0;ho.useEffect(()=>{(!W||s)&&B(null);},[s,W]),ho.useEffect(()=>{if(W&&N.current.size!==1)throw new TypeError("BaseField with validate must contain exactly one compatible Base control.")},[W]);let H=ho.useCallback(K=>{let ne=N.current;if(D.current!==void 0&&!ne.has(K)&&ne.size>0)throw new TypeError("BaseField with validate supports exactly one compatible Base control. Use BaseFieldset for control groups.");return ne.add(K),()=>{ne.delete(K);}},[]),A=ho.useCallback((K,ne)=>{let fe=D.current;if(P.current||fe===void 0||E.current!==K)return;let he=Iy(fe(ne));if(he===null){B(null);return}B(he);},[]),L=ho.useCallback(K=>A("onBlur",K),[A]),F=ho.useCallback(K=>A("onChange",K),[A]),$=V(n)?n:I,_=V($),z=!_&&V(r),re=_?$:r,Z=l??`${S}-control`,ae=M?jm(d,`${S}-description`,"descriptionId"):void 0,ee=z?jm(c,`${S}-message`,"messageId"):void 0,q=_?jm(p,`${S}-error`,"errorId"):void 0,U={id:Z,"aria-describedby":SI(ae,ee),"aria-errormessage":q,"aria-invalid":_?true:void 0,"aria-required":i?true:void 0,required:i||void 0,disabled:s||void 0},X=typeof f=="function"?f(U):f,O=ho.useMemo(()=>({invalid:_,registerControl:H,notifyBlur:L,notifyChange:F}),[_,L,F,H]);return jsxRuntime.jsxs("div",{...C,...w,ref:v,"aria-disabled":s||void 0,"data-monkeys-component":"field","data-slot":"root","data-required":i||void 0,"data-disabled":s||void 0,"data-invalid":_||void 0,className:m(R.slots.fieldRoot,s&&R.slots.controlDisabled,y?.root,x),style:{...R.styles.field,...k},children:[V(t)?jsxRuntime.jsxs("div",{"data-slot":"label-row",className:m(R.slots.fieldLabelRow,y?.labelRow),children:[jsxRuntime.jsxs("label",{htmlFor:typeof f=="function"?Z:l,"data-slot":"label",className:m(R.slots.fieldLabel,y?.label),children:[t,i?jsxRuntime.jsxs("span",{"aria-hidden":"true","data-slot":"required-indicator",className:m(R.slots.fieldRequired,y?.required),children:[" ","*"]}):null]}),h==="tooltip"&&M?jsxRuntime.jsx(Sx,{children:o}):null]}):null,M?jsxRuntime.jsx("div",{id:ae,"data-slot":"description",className:m(R.slots.fieldDescription,y?.description,h==="tooltip"&&"sr-only"),children:o}):null,V(X)?jsxRuntime.jsx("div",{"data-slot":"control",className:m(R.slots.fieldControl,y?.control),style:R.styles.fieldControl,children:jsxRuntime.jsx(Dm.Provider,{value:O,children:X})}):null,V(re)?jsxRuntime.jsx("div",{id:_?q:ee,role:_?"alert":void 0,"data-slot":_?"error":"message",className:m(R.slots.fieldMessage,_&&"text-destructive-text",y?.message),children:re}):null]})},"BaseField"));function Nx(...e){let t=e.flatMap(o=>o?.split(/\s+/).filter(Boolean)??[]);return t.length?Array.from(new Set(t)).join(" "):void 0}a(Nx,"mergeAriaIds");function Rx(e,t,o){if(e===void 0)return t;if(!e.trim()||/\s/.test(e))throw new TypeError(`BaseFieldset ${o} must be a non-empty ID without whitespace.`);return e}a(Rx,"resolveOptionalId");var RI=ho.forwardRef(a(function({children:t,legend:o,description:r,descriptionId:n,error:i,errorId:s,disabled:l,appearance:d,className:c,classNames:p,style:u,"aria-describedby":g,"aria-errormessage":f,...b},x){let y=ho.useId(),k=Pe(d),w=ke(),v=Ne(k);if(!V(o)||typeof o=="string"&&!o.trim())throw new TypeError("BaseFieldset legend must contain an accessible name.");if(l!==void 0&&typeof l!="boolean")throw new TypeError("BaseFieldset disabled must be a boolean.");let h=V(r),S=V(i),T=h?Rx(n,`${y}-description`,"descriptionId"):void 0,C=S?Rx(s,`${y}-error`,"errorId"):void 0;return jsxRuntime.jsxs("fieldset",{...w,...b,ref:x,disabled:l,"aria-describedby":Nx(g,T),"aria-errormessage":Nx(f,C),"data-monkeys-component":"fieldset","data-slot":"root",className:m(v.slots.fieldsetRoot,p?.root,c),style:{...v.styles.fieldset,...u},children:[jsxRuntime.jsx("legend",{"data-slot":"legend",className:m(v.slots.fieldsetLegend,p?.legend),style:v.styles.fieldsetLegend,children:o}),h?jsxRuntime.jsx("div",{id:T,"data-slot":"description",className:m(v.slots.fieldsetDescription,p?.description),style:v.styles.fieldsetDescription,children:r}):null,S?jsxRuntime.jsx("div",{id:C,"data-slot":"error",className:m(v.slots.fieldsetError,p?.error),style:v.styles.fieldsetError,children:i}):null,jsxRuntime.jsx("div",{"data-slot":"content",className:m(v.slots.fieldsetContent,p?.content),style:v.styles.fieldsetContent,children:t})]})},"BaseFieldset"));function PI(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=6}a(PI,"isHeadingLevel");var EI=ho.forwardRef(a(function({level:t=2,children:o,size:r="lg",tone:n="default",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u);if(!PI(t))throw new RangeError("BaseHeading level must be an integer from 1 to 6.");return ho.createElement(`h${t}`,{...g,...c,ref:p,"data-monkeys-component":"heading","data-slot":"root","data-level":t,"data-size":r,"data-tone":n,className:m(f.slots.headingRoot,Ah(f,r),fi(f,n),l?.root,s),style:{...f.styles.heading,...d}},o)},"BaseHeading"));var BI=ho.forwardRef(a(function({children:t,columns:o=1,gap:r,align:n="stretch",justify:i="start",appearance:s,className:l,classNames:d,style:c,...p},u){let g=Go(),f=Pe(s),b=ke(),x=Ne(f),y=r===void 0?void 0:rr("BaseGrid","gap",r);return jsxRuntime.jsx("div",{...b,...p,ref:u,"data-monkeys-component":"grid","data-slot":"root","data-align":n,"data-justify":i,"data-columns":o,className:m(x.slots.gridRoot,g>0&&r===void 0&&"gap-[var(--monkeys-bento-gap)]",f?.slots?.gridRoot,d?.root,l),style:{...x.styles.grid,gridTemplateColumns:Fh(o),gap:y??x.styles.grid?.gap,alignItems:bi("BaseGrid",n),justifyContent:gi("BaseGrid",i),...c},children:t})},"BaseGrid"));var zI={sm:"h-8 px-2.5 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-3.5 text-base"},Rc=ho.forwardRef(a(function({icon:t,trailing:o,invalid:r=false,disabled:n=false,readOnly:i=false,controlSize:s,appearance:l,className:d,classNames:c,style:p,"aria-invalid":u,onBlur:g,onChange:f,...b},x){for(let[S,T]of [["invalid",r],["disabled",n],["readOnly",i]])if(typeof T!="boolean")throw new TypeError(`BaseInput ${S} must be a boolean.`);if(s!==void 0&&s!=="sm"&&s!=="md"&&s!=="lg")throw new TypeError('BaseInput controlSize must be "sm", "md", or "lg".');let y=Pe(l),k=ke(),w=Ne(y),v=Yn(),h=r||v.invalid;return jsxRuntime.jsxs("div",{...k,"data-monkeys-component":"input","data-slot":"root","data-size":s,"data-invalid":h||void 0,"data-disabled":n||void 0,"data-readonly":i||void 0,className:m(w.slots.controlWrapper,h&&w.slots.controlInvalid,n&&w.slots.controlDisabled,i&&w.slots.controlReadOnly,c?.root,d),style:{...w.styles.control,...h?w.styles.controlInvalid:void 0,...n?w.styles.controlDisabled:void 0,...p},children:[V(t)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(w.slots.controlIcon,c?.icon),children:t}):null,jsxRuntime.jsx("input",{...b,ref:x,disabled:n,readOnly:i,"aria-invalid":u??(h||void 0),"data-slot":"control","data-size":s,"data-invalid":h||void 0,"data-disabled":n||void 0,"data-readonly":i||void 0,className:m(w.slots.controlBase,w.slots.controlInput,s&&zI[s],c?.control),onBlur:S=>{g?.(S),v.notifyBlur(S.currentTarget.value);},onChange:S=>{f?.(S),v.notifyChange(S.currentTarget.value);}}),V(o)?jsxRuntime.jsx("span",{"data-slot":"trailing",className:m(w.slots.controlTrailing,c?.trailing),children:o}):null]})},"BaseInput"));var HI=ho.forwardRef(a(function({children:t,startElement:o,endElement:r,startAddon:n,endAddon:i,invalid:s=false,disabled:l=false,appearance:d,className:c,classNames:p,style:u,...g},f){for(let[k,w]of [["invalid",s],["disabled",l]])if(typeof w!="boolean")throw new TypeError(`BaseInputGroup ${k} must be a boolean.`);let b=Pe(d),x=ke(),y=Ne(b);return jsxRuntime.jsxs("div",{...x,...g,ref:f,"data-monkeys-component":"input-group","data-slot":"root","data-invalid":s||void 0,"data-disabled":l||void 0,className:m(y.slots.inputGroupRoot,s&&y.slots.inputGroupInvalid,l&&y.slots.inputGroupDisabled,p?.root,c),style:{...y.styles.inputGroup,...s?y.styles.inputGroupInvalid:void 0,...l?y.styles.inputGroupDisabled:void 0,...u},children:[V(n)?jsxRuntime.jsx("span",{"data-slot":"start-addon","data-placement":"start",className:m(y.slots.inputGroupStartAddon,p?.startAddon),style:y.styles.inputGroupAddon,children:n}):null,V(o)?jsxRuntime.jsx("span",{"data-slot":"start-element","data-placement":"start",className:m(y.slots.inputGroupStartElement,p?.startElement),style:y.styles.inputGroupElement,children:o}):null,jsxRuntime.jsx("div",{"data-slot":"content",className:m(y.slots.inputGroupContent,p?.content),style:y.styles.inputGroupContent,children:t}),V(r)?jsxRuntime.jsx("span",{"data-slot":"end-element","data-placement":"end",className:m(y.slots.inputGroupEndElement,p?.endElement),style:y.styles.inputGroupElement,children:r}):null,V(i)?jsxRuntime.jsx("span",{"data-slot":"end-addon","data-placement":"end",className:m(y.slots.inputGroupEndAddon,p?.endAddon),style:y.styles.inputGroupAddon,children:i}):null]})},"BaseInputGroup"));var GI=ho.forwardRef(a(function({children:t,gap:o,align:r="center",justify:n="start",wrap:i=true,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Go(),f=Pe(s),b=ke(),x=Ne(f);if(typeof i!="boolean")throw new TypeError("BaseInline wrap must be a boolean.");let y=o===void 0?void 0:rr("BaseInline","gap",o);return jsxRuntime.jsx("div",{...b,...p,ref:u,"data-monkeys-component":"inline","data-slot":"root","data-align":r,"data-justify":n,"data-wrap":i?"wrap":"nowrap",className:m(x.slots.inlineRoot,g>0&&o===void 0&&"gap-[var(--monkeys-bento-gap)]",f?.slots?.inlineRoot,d?.root,l),style:{...x.styles.inline,gap:y??x.styles.inline?.gap,alignItems:bi("BaseInline",r),justifyContent:gi("BaseInline",n),flexWrap:i?"wrap":"nowrap",...c},children:t})},"BaseInline"));var UI=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d);return jsxRuntime.jsx("kbd",{...c,...s,ref:l,"data-monkeys-component":"kbd","data-slot":"root",className:m(p.slots.kbdRoot,n?.root,r),style:{...p.styles.kbd,...i},children:t})},"BaseKbd"));var XI=50,QI=20,ZI=80,JI=2.5;function eD(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(eD,"assignRef");function Ba(e,t){if(typeof t!="boolean")throw new TypeError(`BaseLayout ${e} must be a boolean.`)}a(Ba,"assertBoolean");function Px(e){if(e!=="horizontal"&&e!=="vertical")throw new TypeError('BaseLayout orientation must be "horizontal" or "vertical".')}a(Px,"assertOrientation");function Ic(e,t){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error("BaseLayout size and gap props must be finite, non-negative numbers.");return `${e}px`}if(typeof e=="string"){if(e.trim().length===0)throw new TypeError("BaseLayout size and gap string props must not be empty.");return e}return t}a(Ic,"toCssSize");function Pi(e,t){if(!Number.isFinite(t))throw new Error(`BaseLayoutSplit ${e} must be a finite number.`);if(t<0||t>100)throw new Error(`BaseLayoutSplit ${e} must be between 0 and 100.`);return t}a(Pi,"assertPercent");function qm(e,t,o){return Math.min(Math.max(e,t),o)}a(qm,"clamp");function tD({minSize:e=QI,maxSize:t=ZI,keyboardStep:o=JI}){let r=Pi("minSize",e),n=Pi("maxSize",t);if(r>n)throw new Error("BaseLayoutSplit minSize cannot be greater than maxSize.");if(!Number.isFinite(o)||o<=0)throw new Error("BaseLayoutSplit keyboardStep must be a finite positive number.");return {min:r,max:n,keyboardStep:o}}a(tD,"resolveSplitBounds");function Ix(e,t,o,r,n){return qm(Pi(e,t??o),r,n)}a(Ix,"resolveSplitSize");function oD(e){return e==="horizontal"?"vertical":"horizontal"}a(oD,"getSeparatorOrientation");function Dx(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":e.closest('[dir="rtl"]')!==null}a(Dx,"isRtl");function rD(e,t){if(e.setPointerCapture)try{e.setPointerCapture(t);}catch(o){let r=e.ownerDocument.defaultView?.DOMException;if(r&&o instanceof r&&o.name==="NotFoundError")return;throw o}}a(rD,"setPointerCaptureIfAvailable");var Ex=ho.forwardRef(a(function({header:t,sidebar:o,aside:r,sidebarLabel:n,asideLabel:i,footer:s,children:l,sidebarSize:d,asideSize:c,gap:p,fullHeight:u=false,appearance:g,className:f,classNames:b,style:x,...y},k){Ba("fullHeight",u);let w=Pe(g),v=ke(),h=Ne(w),S=V(t),T=V(o),C=V(r),R=V(s),M=[T?"var(--base-layout-sidebar-size)":void 0,"minmax(0, 1fr)",C?"var(--base-layout-aside-size)":void 0].filter(Boolean).join(" "),I=[S?"auto":void 0,"minmax(0, 1fr)",R?"auto":void 0].filter(Boolean).join(" "),B=p!==void 0?Ic(p,"0px"):void 0,N={...h.styles.layout,"--base-layout-sidebar-size":Ic(d,"16rem"),"--base-layout-aside-size":Ic(c,"20rem"),gridTemplateRows:I,...B!==void 0?{gap:B}:{},...x},D={...h.styles.layoutBody,gridTemplateColumns:M,...B!==void 0?{gap:B}:{}};return jsxRuntime.jsxs("div",{...v,...y,ref:k,"data-monkeys-component":"layout","data-slot":"root","data-full-height":u?"true":"false",className:m(h.slots.layoutRoot,u&&h.slots.layoutRootFull,b?.root,f),style:N,children:[S?jsxRuntime.jsx("div",{"data-slot":"header",className:m(h.slots.layoutHeader,b?.header),style:h.styles.layoutHeader,children:t}):null,jsxRuntime.jsxs("div",{"data-slot":"body",className:m(h.slots.layoutBody,b?.body),style:D,children:[T?jsxRuntime.jsx("aside",{"aria-label":n,"data-slot":"sidebar",className:m(h.slots.layoutSidebar,b?.sidebar),style:h.styles.layoutSidebar,children:o}):null,jsxRuntime.jsx("main",{"data-slot":"main",className:m(h.slots.layoutMain,b?.main),style:h.styles.layoutMain,children:l}),C?jsxRuntime.jsx("aside",{"aria-label":i,"data-slot":"aside",className:m(h.slots.layoutAside,b?.aside),style:h.styles.layoutAside,children:r}):null]}),R?jsxRuntime.jsx("div",{"data-slot":"footer",className:m(h.slots.layoutFooter,b?.footer),style:h.styles.layoutFooter,children:s}):null]})},"BaseLayout")),Ax=ho.forwardRef(a(function({as:t="div",scrollable:o=false,bordered:r=true,surface:n="default",children:i,appearance:s,className:l,classNames:d,style:c,...p},u){Ba("scrollable",o),Ba("bordered",r);let g=Pe(s),f=ke(),b=Ne(g);return jsxRuntime.jsx(t,{...f,...p,ref:u,"data-monkeys-component":"layout-pane","data-slot":"root","data-scrollable":o?"true":"false","data-surface":n,className:m(b.slots.layoutPane,o&&b.slots.layoutPaneScrollable,r&&b.slots.layoutPaneBordered,n==="muted"&&b.slots.layoutPaneMuted,n==="soft"&&b.slots.layoutPaneSoft,n==="transparent"&&b.slots.layoutPaneTransparent,d?.root,l),style:{...b.styles.layoutPane,...c},children:i})},"BaseLayoutPane")),Ym=ho.forwardRef(a(function({orientation:t="horizontal",resizable:o=false,disabled:r=false,size:n,minSize:i,maxSize:s,label:l,appearance:d,className:c,classNames:p,style:u,tabIndex:g,...f},b){Px(t),Ba("resizable",o),Ba("disabled",r);let x=i===void 0?void 0:Pi("minSize",i),y=s===void 0?void 0:Pi("maxSize",s);if(x!==void 0&&y!==void 0&&x>y)throw new Error("BaseLayoutSplit minSize cannot be greater than maxSize.");let k=n===void 0?void 0:qm(Pi("size",n),x??0,y??100),w=Pe(d),v=ke(),h=Ye().layout,S=Ne(w),T=l??h.resizePanels;if(o&&(typeof T!="string"||T.trim().length===0))throw new TypeError("BaseLayoutResizeHandle label must be a non-empty string.");let C=o&&!r,R=oD(t);return jsxRuntime.jsx("div",{...v,...f,ref:b,"data-monkeys-component":"layout-resize-handle","data-slot":"handle","data-orientation":t,"data-state":C?"enabled":r?"disabled":"static",role:o?"separator":void 0,"aria-label":o?T:void 0,"aria-orientation":o?R:void 0,"aria-valuemin":o?x:void 0,"aria-valuemax":o?y:void 0,"aria-valuenow":o?k:void 0,"aria-disabled":o&&r?true:void 0,tabIndex:C?g??0:void 0,className:m(S.slots.layoutResizeHandle,t==="horizontal"?S.slots.layoutResizeHandleHorizontal:S.slots.layoutResizeHandleVertical,!C&&S.slots.layoutResizeHandleDisabled,p?.root,c),style:{...S.styles.layoutResizeHandle,...u},children:jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(S.slots.layoutResizeHandleIndicator,t==="horizontal"?"h-8 w-px":"h-px w-8",p?.indicator)})})},"BaseLayoutResizeHandle")),Bx=ho.forwardRef(a(function({orientation:t="horizontal",primary:o,secondary:r,children:n,resizable:i=false,disabled:s=false,size:l,defaultSize:d,minSize:c,maxSize:p,gap:u,keyboardStep:g,resizeLabel:f,appearance:b,className:x,classNames:y,style:k,onSizeChange:w,...v},h){Px(t),Ba("resizable",i),Ba("disabled",s);let S=Pe(b),T=ke(),C=Ne(S),R=tD({minSize:c,maxSize:p,keyboardStep:g}),M=Ix("defaultSize",d,XI,R.min,R.max),[I,B]=ho.useState(M),N=ho.useRef(null),D=ho.useRef(null),E=l!==void 0,P=i&&!s,W=Ix("size",E?l:I,M,R.min,R.max),H=v.dir??T.dir,A=ho.useCallback(ee=>{N.current=ee,eD(h,ee);},[h]),L=ho.useCallback(ee=>{let q=qm(ee,R.min,R.max);E||B(q),w?.(q);},[R.max,R.min,E,w]),F=ho.useCallback(ee=>{let q=N.current;if(!q)return;let U=q.getBoundingClientRect(),X=t==="horizontal"?U.width:U.height;if(!Number.isFinite(X)||X<=0)return;let O=t==="horizontal"?Dx(q)?U.right-ee.clientX:ee.clientX-U.left:ee.clientY-U.top;L(O/X*100);},[L,t]),G=ho.useCallback(()=>{let ee=D.current;D.current=null,ee?.();},[]);ho.useEffect(()=>(P||G(),G),[P,G]);let $=a(ee=>{if(!P||ee.button!==0&&ee.pointerType!=="touch")return;ee.preventDefault(),G(),F(ee);let q=ee.pointerId,U=ee.currentTarget,X=U.ownerDocument,O=a(fe=>{fe.pointerId===q&&F(fe);},"handleMove"),K=a(fe=>{fe.pointerId===q&&G();},"handleStop"),ne=a(fe=>{fe.pointerId===q&&G();},"handleLostCapture");X.addEventListener("pointermove",O),X.addEventListener("pointerup",K),X.addEventListener("pointercancel",K),U.addEventListener("lostpointercapture",ne),D.current=()=>{X.removeEventListener("pointermove",O),X.removeEventListener("pointerup",K),X.removeEventListener("pointercancel",K),U.removeEventListener("lostpointercapture",ne),U.hasPointerCapture?.(q)&&U.releasePointerCapture?.(q);},rD(U,q);},"handlePointerDown"),_=a(ee=>{if(!P)return;let q=ee.shiftKey?R.keyboardStep*4:R.keyboardStep,U=t==="horizontal"&&Dx(ee.currentTarget),X;ee.key==="Home"&&(X=R.min),ee.key==="End"&&(X=R.max),t==="horizontal"&&ee.key==="ArrowLeft"&&(X=W+(U?q:-q)),t==="horizontal"&&ee.key==="ArrowRight"&&(X=W+(U?-q:q)),t==="vertical"&&ee.key==="ArrowUp"&&(X=W-q),t==="vertical"&&ee.key==="ArrowDown"&&(X=W+q),X!==void 0&&(ee.preventDefault(),L(X));},"handleKeyDown"),z=u!==void 0?Ic(u,"0px"):void 0,re=z!==void 0?"var(--base-layout-split-gap)":"auto",Z=z!==void 0?t==="horizontal"?{width:"var(--base-layout-split-gap)"}:{height:"var(--base-layout-split-gap)"}:void 0,ae={...C.styles.layoutSplit,[t==="horizontal"?"gridTemplateColumns":"gridTemplateRows"]:i?`${W}% ${re} minmax(0, 1fr)`:`${W}% minmax(0, 1fr)`,...i?{gap:0}:{},...z!==void 0?{"--base-layout-split-gap":z,...i?{}:{gap:z}}:{},...k};return jsxRuntime.jsxs("div",{...T,...v,ref:A,"data-monkeys-component":"layout-split","data-slot":"root","data-orientation":t,"data-state":P?"enabled":s?"disabled":"static","data-controlled":E?"true":"false",className:m(C.slots.layoutSplitRoot,t==="horizontal"?C.slots.layoutSplitHorizontal:C.slots.layoutSplitVertical,y?.root,x),style:ae,children:[jsxRuntime.jsx("div",{"data-slot":"primary",className:m(C.slots.layoutSplitPane,C.slots.layoutSplitPrimary,y?.primary),style:C.styles.layoutSplitPane,children:V(o)?o:n}),i?jsxRuntime.jsx(Ym,{orientation:t,resizable:true,disabled:s,size:W,minSize:R.min,maxSize:R.max,label:f,appearance:b,dir:H,className:y?.handle,style:Z,onPointerDown:$,onKeyDown:_}):null,jsxRuntime.jsx("div",{"data-slot":"secondary",className:m(C.slots.layoutSplitPane,C.slots.layoutSplitSecondary,y?.secondary),style:C.styles.layoutSplitPane,children:r})]})},"BaseLayoutSplit"));var aD={line:"h-4 w-full",block:"h-24 w-full",circle:"aspect-square h-10 rounded-full"},na=ho.forwardRef(a(function({variant:t="line",animated:o=true,animation:r,appearance:n,className:i,classNames:s,style:l,...d},c){if(t!=="line"&&t!=="block"&&t!=="circle")throw new TypeError('BaseSkeleton variant must be "line", "block", or "circle".');if(typeof o!="boolean")throw new TypeError("BaseSkeleton animated must be a boolean.");let p=Pe(n),u=ke(),g=Ne(p),f=Zd(r,o,c);return jsxRuntime.jsx("div",{...u,...d,ref:f.ref,"aria-hidden":"true","data-monkeys-component":"skeleton","data-slot":"root","data-variant":t,"data-animated":f.mode!=="none","data-state":f.mode!=="none"?"animated":"static","data-skeleton-animation":f.mode,className:m(g.slots.skeletonRoot,aD[t],f.mode==="pulse"&&"motion-safe:animate-pulse motion-reduce:animate-none",s?.root,i),style:{...g.styles.skeleton,...f.style,...l}})},"BaseSkeleton"));function lD({className:e}){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:e,fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(lD,"DefaultLoadingIcon");var $r=ho.forwardRef(a(function({icon:t,title:o,description:r,actions:n,variant:i,animation:s,appearance:l,className:d,classNames:c,style:p,role:u="status","aria-live":g="polite","aria-busy":f=true,"aria-label":b,"aria-labelledby":x,...y},k){let w=Pe(l),v=ke(),{loading:h}=Ye(),S=Wr(),T=i??S.loading?.variant??"spinner",C=S.density==="compact"?"min-h-0 px-3 py-3":S.density==="comfortable"?"min-h-56 px-8 py-12":void 0,R=Ne(w),M=T==="skeleton"&&t===void 0?void 0:t===void 0?jsxRuntime.jsx(lD,{className:R.slots.loadingSpinner}):t,I=b??(x===void 0?typeof o=="string"?o:h.spinner:void 0);return jsxRuntime.jsxs("div",{...v,...y,ref:k,role:u,"aria-live":g,"aria-busy":f,"aria-label":I,"aria-labelledby":x,"data-monkeys-component":"loading-state","data-slot":"root","data-state":"loading","data-variant":T,"data-density":S.density,className:m(R.slots.stateRoot,C,c?.root,d),style:{...R.styles.stateRoot,...p},children:[T==="skeleton"?jsxRuntime.jsx(qn,{animation:s,children:jsxRuntime.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-3","data-slot":"skeleton",children:[jsxRuntime.jsx(na,{variant:"block",className:"h-20"}),jsxRuntime.jsx(na,{variant:"line",className:"w-4/5"}),jsxRuntime.jsx(na,{variant:"line",className:"w-3/5"})]})}):V(M)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":"loading",className:m(R.slots.stateIcon,c?.icon),style:R.styles.stateIcon,children:M}):null,T!=="skeleton"&&V(o)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":"loading",className:m(R.slots.stateTitle,c?.title),children:o}):null,T!=="skeleton"&&V(r)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":"loading",className:m(R.slots.stateDescription,c?.description),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":"loading",className:m(R.slots.stateActions,c?.actions),children:n}):null]})},"BaseLoadingState"));var pD=ho.forwardRef(a(function({children:t,openOnMount:o=false,size:r="md",tone:n="primary",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b=pn(c.href,"link"),x=c.href!==void 0&&b===void 0,y=ho.useRef();return ho.useEffect(()=>{!o||!b||c.target!=="_blank"||c["aria-disabled"]===true||c["aria-disabled"]==="true"||y.current===b||(y.current=b,window.open(b,"_blank","noopener,noreferrer"));},[o,b,c.target,c["aria-disabled"]]),jsxRuntime.jsx("a",{...g,...c,href:b,"aria-disabled":x?true:c["aria-disabled"],onClickCapture:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onClickCapture?.(k);},onClick:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onClick?.(k);},onAuxClickCapture:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onAuxClickCapture?.(k);},ref:p,"data-monkeys-component":"link","data-slot":"root","data-size":r,"data-tone":n,className:m(f.slots.linkRoot,zd(f,r),fi(f,n),l?.root,s),style:{...f.styles.link,...d},children:t})},"BaseLink"));var fD=ho.forwardRef(a(function({ordered:t=false,marker:o="auto",spacing:r="default",children:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b={...g,...c,"data-monkeys-component":"list","data-slot":"root","data-list-type":t?"ordered":"unordered","data-marker":o,"data-spacing":r,className:m(f.slots.listRoot,Bh(f,r),o!=="auto"&&Lh(f,o),l?.root,s),style:{...f.styles.list,...d},children:n};return t?jsxRuntime.jsx("ol",{...b,ref:p}):jsxRuntime.jsx("ul",{...b,ref:p})},"BaseList")),bD=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d);return jsxRuntime.jsx("li",{...c,...s,ref:l,"data-monkeys-component":"list-item","data-slot":"item",className:m(p.slots.listItem,n?.root,r),style:{...p.styles.listItem,...i},children:t})},"BaseListItem"));var yD=500;function xD({options:e,value:t,defaultValue:o,invalid:r,disabled:n,required:i,openForPreview:s,maxTagCount:l}){for(let[d,c]of [["invalid",r],["disabled",n],["required",i],["openForPreview",s]])if(typeof c!="boolean")throw new TypeError(`BaseMultiSelect ${d} must be a boolean.`);if(l!==void 0&&typeof l!="number")throw new TypeError("BaseMultiSelect maxTagCount must be a number.");if(e!==void 0&&!Array.isArray(e))throw new TypeError("BaseMultiSelect options must be an array.");e?.forEach((d,c)=>{if(!d||typeof d!="object")throw new TypeError(`BaseMultiSelect option at index ${c} must be an object.`);if(typeof d.value!="string")throw new TypeError(`BaseMultiSelect option value at index ${c} must be a string.`);if(d.disabled!==void 0&&typeof d.disabled!="boolean")throw new TypeError(`BaseMultiSelect option disabled at index ${c} must be a boolean.`);if(d.textValue!==void 0&&typeof d.textValue!="string")throw new TypeError(`BaseMultiSelect option textValue at index ${c} must be a string.`)});for(let[d,c]of [["value",t],["defaultValue",o]]){if(c!==void 0&&!Array.isArray(c))throw new TypeError(`BaseMultiSelect ${d} must be an array.`);c?.forEach((p,u)=>{if(typeof p!="string")throw new TypeError(`BaseMultiSelect ${d} item at index ${u} must be a string.`)});}}a(xD,"validateMultiSelectProps");function ef(e){let t=[],o=new Set;return e?.forEach(r=>{o.has(r)||(o.add(r),t.push(r));}),t}a(ef,"normalizeValues");function vD(e,t,o){if(!e.length)return -1;let r=t>=0?t:o===1?-1:0;for(let n=1;n<=e.length;n+=1){let i=(r+n*o+e.length)%e.length;if(!e[i]?.disabled)return i}return -1}a(vD,"getNextEnabledIndex");function Ec(e,t){if(t==="first")return e.findIndex(o=>!o.disabled);for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return -1}a(Ec,"getBoundaryEnabledIndex");function wD(e,t){return e===void 0||!Number.isFinite(e)?t:Math.max(0,Math.min(t,Math.floor(e)))}a(wD,"getSafeTagCount");function kD(e){return e.textValue!==void 0?e.textValue:typeof e.label=="string"?e.label:e.value}a(kD,"getOptionText");function CD(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(CD,"toDomId");var zx=ho.forwardRef(a(function({options:t,value:o,defaultValue:r,name:n,placeholder:i,icon:s,invalid:l=false,disabled:d=false,required:c=false,openForPreview:p=false,maxTagCount:u,removeLabel:g,emptyLabel:f,appearance:b,className:x,classNames:y,style:k,id:w,"aria-invalid":v,"aria-label":h,"aria-labelledby":S,"aria-describedby":T,"aria-errormessage":C,onValueChange:R,...M},I){xD({options:t,value:o,defaultValue:r,invalid:l,disabled:d,required:c,openForPreview:p,maxTagCount:u});let B=Ye().multiSelect,N=Pe(b),D=ke(),E=Ne(N),P=ho.useId(),W=w??P,H=`${W}-control`,A=`${W}-listbox`,L=ho.useRef(null),F=ho.useRef(null),G=ho.useRef(false),$=ho.useRef(""),_=ho.useRef(null),z=t??[],re=z.map((J,$e)=>`${W}-option-${$e}-${CD(J.value)}`),Z=p,[ae,ee]=ho.useState(false),q=Z||ae,U=ho.useRef(ef(r)),[X,O]=ho.useState(()=>[...U.current]),[K,ne]=ho.useState(()=>Ec(z,"first")),fe=o!==void 0,he=ho.useMemo(()=>ef(fe?o:X),[fe,X,o]),me=ho.useMemo(()=>new Set(he),[he]),ie=ho.useMemo(()=>{let J=new Map;return z.forEach($e=>{J.has($e.value)||J.set($e.value,$e);}),J},[z]),be=ho.useMemo(()=>he.map(J=>ie.get(J)).filter(J=>J!==void 0),[ie,he]),He=Ec(z,"first"),We=K>=0&&!z[K]?.disabled?K:He,Ke=wD(u,be.length),ce=be.slice(0,Ke),Q=be.length-ce.length,ge=be.length===0,we=M.dir??D.dir,Ie=d?"disabled":l?"invalid":q?"open":"closed",oe=a(J=>{L.current=J,typeof I=="function"?I(J):I&&(I.current=J);},"setRootRef"),xe=a(J=>{d||Z||(ee(J),J&&We<0&&ne(He));},"setOpen"),Ve=a(J=>{let $e=ef(J);fe||O($e),R?.($e);},"commitValues"),_e=a(J=>{if(!J||J.disabled||d)return;let $e=me.has(J.value)?he.filter(ue=>ue!==J.value):[...he,J.value];Ve($e);},"toggleOption"),Ge=a(J=>{d||Ve(he.filter($e=>$e!==J.value));},"removeOption"),le=a(J=>{J<0||z[J]?.disabled||(ne(J),q||xe(true));},"moveActive"),Me=a((J,$e)=>{let ue=J.currentTarget.ownerDocument.defaultView;if(!ue)return;let Re=`${$.current}${$e}`.toLocaleLowerCase();$.current=Re,_.current&&_.current.ownerWindow.clearTimeout(_.current.timerId),_.current={ownerWindow:ue,timerId:ue.setTimeout(()=>{$.current="",_.current=null;},yD)};let te=Array.from(Re).every(Te=>Te===Re[0])?$e.toLocaleLowerCase():Re;for(let Te=1;Te<=z.length;Te+=1){let ze=(We+Te+z.length)%z.length,je=z[ze];if(!je?.disabled&&kD(je).trim().toLocaleLowerCase().startsWith(te)){J.preventDefault(),le(ze);return}}},"handleTypeahead"),Ae=a(J=>{if(!(d||G.current||J.nativeEvent.isComposing)){if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),q?le(vD(z,We,J.key==="ArrowDown"?1:-1)):(ne(He),xe(true));return}if(J.key==="Home"||J.key==="End"){J.preventDefault(),le(Ec(z,J.key==="Home"?"first":"last"));return}if(J.key==="Enter"||J.key===" "){J.preventDefault(),q?_e(z[We]):xe(true);return}if(J.key==="Escape"&&q){J.preventDefault(),xe(false);return}if(J.key==="Tab"&&q){xe(false);return}J.key.length===1&&!J.ctrlKey&&!J.metaKey&&!J.altKey&&!/\s/.test(J.key)&&Me(J,J.key);}},"handleKeyDown");return ho.useEffect(()=>{if(!q||Z)return;let J=L.current?.ownerDocument;if(!J)return;let $e=a(ue=>{L.current?.contains(ue.target)||ee(false);},"handlePointerDown");return J.addEventListener("pointerdown",$e),()=>J.removeEventListener("pointerdown",$e)},[Z,q]),ho.useEffect(()=>{if(fe)return;let J=L.current?.closest("form");if(!J)return;let $e=a(()=>{O([...U.current]),ne(Ec(z,"first")),Z||ee(false);},"handleReset");return J.addEventListener("reset",$e),()=>J.removeEventListener("reset",$e)},[Z,fe,z]),ho.useEffect(()=>()=>{_.current&&_.current.ownerWindow.clearTimeout(_.current.timerId);},[]),jsxRuntime.jsxs("div",{...D,...M,id:w,ref:oe,dir:we,"data-monkeys-component":"multi-select","data-slot":"root","data-state":Ie,"data-disabled":d||void 0,"data-invalid":l||void 0,className:m(E.slots.controlWrapper,"overflow-visible",q&&"z-50",l&&E.slots.controlInvalid,d&&E.slots.controlDisabled,y?.root,x),style:{...E.styles.control,...l?E.styles.controlInvalid:void 0,...d?E.styles.controlDisabled:void 0,...k},children:[V(s)?jsxRuntime.jsx("span",{className:m(E.slots.controlIcon,y?.icon),children:s}):null,jsxRuntime.jsx("div",{...D,ref:F,id:H,role:"combobox",tabIndex:d?-1:0,dir:we,"aria-haspopup":"listbox","aria-expanded":q,"aria-controls":A,"aria-activedescendant":q&&We>=0?re[We]:void 0,"aria-autocomplete":"none","aria-disabled":d||void 0,"aria-required":c||void 0,"aria-invalid":v??(l||void 0),"aria-label":h,"aria-labelledby":S,"aria-describedby":T,"aria-errormessage":C,"data-monkeys-component":"multi-select","data-slot":"control","data-state":Ie,className:m(E.slots.controlBase,"flex min-h-9 cursor-pointer flex-wrap items-center gap-1.5 py-1.5 pr-9 text-left",d&&"!cursor-not-allowed",y?.control),onMouseDown:J=>{d||J.button!==0||(J.preventDefault(),F.current?.focus());},onClick:()=>{F.current?.focus(),xe(!q);},onBlur:J=>{L.current?.contains(J.relatedTarget)||xe(false);},onCompositionStart:()=>{G.current=true;},onCompositionEnd:()=>{G.current=false;},onKeyDown:Ae,children:jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag-list","data-state":ge?"empty":"filled",className:m("flex min-w-0 flex-1 flex-wrap items-center gap-1.5",y?.tagList),children:[ce.map((J,$e)=>jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag","data-state":"selected",className:m("inline-flex max-w-full items-center gap-1 rounded-full border border-border/70 bg-muted/65 px-2 py-0.5 text-xs font-medium text-foreground",y?.tag),children:[jsxRuntime.jsx("span",{"data-slot":"tag-label",className:m("max-w-40 truncate",y?.tagLabel),children:J.label}),jsxRuntime.jsx("button",{...D,type:"button",tabIndex:-1,dir:we,"aria-label":g?.(J)??B.removeOption({value:J.value}),disabled:d,"data-monkeys-component":"multi-select","data-slot":"tag-remove","data-state":"selected",className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/80 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed",y?.tagRemove),onClick:ue=>{ue.preventDefault(),ue.stopPropagation(),Ge(J),F.current?.focus();},onMouseDown:ue=>{ue.preventDefault(),ue.stopPropagation();},onKeyDown:ue=>ue.stopPropagation(),children:jsxRuntime.jsx("span",{"aria-hidden":"true",children:"x"})})]},`${J.value}-${$e}`)),Q>0?jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag-overflow","data-state":"selected",className:m("inline-flex max-w-full items-center rounded-full border border-border/70 bg-muted/45 px-2 py-0.5 text-xs font-medium text-muted-foreground",y?.tag),children:["+",Q]}):null,ge?jsxRuntime.jsx("span",{"data-monkeys-component":"multi-select","data-slot":"placeholder","data-state":"empty",className:m("min-w-0 truncate",E.slots.selectPlaceholder,y?.placeholder),children:i===void 0?B.placeholder:i}):null]})}),jsxRuntime.jsx("span",{"data-monkeys-component":"multi-select","data-slot":"chevron","data-state":q?"open":"closed",className:m(E.slots.selectChevron,q&&"rotate-[225deg]",y?.chevron)}),n?he.map(J=>ho.createElement("input",{...D,key:J,type:"hidden",name:n,value:J,disabled:d,dir:we,"data-monkeys-component":"multi-select","data-slot":"hidden-input","data-state":"selected",className:y?.hiddenInput})):null,q?jsxRuntime.jsx("div",{...D,id:A,role:"listbox",dir:we,"aria-multiselectable":"true","aria-labelledby":H,"data-monkeys-component":"multi-select","data-slot":"menu","data-state":"open",className:m(E.slots.selectMenu,y?.menu),style:E.styles.selectMenu,children:z.length>0?z.map((J,$e)=>{let ue=me.has(J.value),Re=$e===We,se=J.disabled?"disabled":Re?"active":ue?"selected":"idle";return ho.createElement("button",{...D,key:`${J.value}-${$e}`,id:re[$e],type:"button",role:"option",tabIndex:-1,dir:we,"aria-selected":ue,disabled:J.disabled,"data-monkeys-component":"multi-select","data-slot":"option","data-state":se,"data-active":Re||void 0,"data-selected":ue||void 0,"data-disabled":J.disabled||void 0,className:m(E.slots.selectOption,"gap-2",Re&&E.slots.selectOptionActive,ue&&E.slots.selectOptionSelected,J.disabled&&E.slots.selectOptionDisabled,y?.option),style:{...E.styles.selectOption,...Re?E.styles.selectOptionActive:void 0,...ue?E.styles.selectOptionSelected:void 0},onMouseEnter:()=>{J.disabled||ne($e);},onMouseDown:te=>te.preventDefault(),onClick:()=>{_e(J),F.current?.focus();}},jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"option-indicator",className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-border/70 text-[10px]",ue&&"border-primary/40 bg-primary text-primary-foreground",y?.optionIndicator),children:ue?"\u2713":null}),jsxRuntime.jsx("span",{"data-slot":"option-label",className:m("min-w-0 flex-1 truncate",y?.optionLabel),children:J.label}))}):jsxRuntime.jsx("div",{...D,dir:we,role:"option",tabIndex:-1,"aria-disabled":"true","aria-selected":"false","data-monkeys-component":"multi-select","data-slot":"empty","data-state":"empty",className:m("px-2.5 py-2 text-sm text-muted-foreground",y?.empty),children:f===void 0?B.empty:f})}):null]})},"BaseMultiSelect"));var ND=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/;function of(e){if(!ND.test(e))return null;let t=Number(e);return Number.isFinite(t)?t:null}a(of,"parseBaseNumberInputValue");function RD(e){let t=/^(?:\d+)(?:\.(\d*))?(?:e([+-]?\d+))?$/i.exec(Math.abs(e).toString());if(!t)return 0;let o=t[1]?.length??0,r=Number(t[2]??0);return Math.min(12,Math.max(0,o-r))}a(RD,"resolveDecimalPlaces");function Ox(e,t){let r=10**Math.max(...t.map(RD)),n=Math.round((e+Number.EPSILON)*r)/r;return Object.is(n,-0)?0:n}a(Ox,"normalizeSteppedValue");function MD({rawValue:e,direction:t,step:o,min:r,max:n}){let s=of(e)??0,l=[s,o];r!==void 0&&l.push(r),n!==void 0&&l.push(n);let d=Ox(s+t*o,l);return r!==void 0&&(d=Math.max(r,d)),n!==void 0&&(d=Math.min(n,d)),Ox(d,l)}a(MD,"resolveBaseNumberInputStep");function Fx(e,t){if(t!==void 0&&!Number.isFinite(t))throw new TypeError(`BaseNumberInput ${e} must be a finite number.`)}a(Fx,"validateBoundary");function Hx(e,t){if(!t.trim())throw new TypeError(`BaseNumberInput ${e} must be a non-empty string.`)}a(Hx,"validateLabel");function ID(e,t,o){return e!==null&&(t===void 0||e>=t)&&(o===void 0||e<=o)}a(ID,"isInRange");var DD=ho.forwardRef(a(function({value:t,defaultValue:o="",min:r,max:n,step:i=1,showStepControls:s=false,incrementLabel:l,decrementLabel:d,invalid:c=false,disabled:p=false,readOnly:u=false,appearance:g,className:f,classNames:b,style:x,onChange:y,onKeyDown:k,onValueChange:w,"aria-invalid":v,...h},S){if(t!==void 0&&typeof t!="string")throw new TypeError("BaseNumberInput value must be a string.");if(typeof o!="string")throw new TypeError("BaseNumberInput defaultValue must be a string.");if(Fx("min",r),Fx("max",n),r!==void 0&&n!==void 0&&r>n)throw new RangeError("BaseNumberInput min must be less than or equal to max.");if(!Number.isFinite(i)||i<=0)throw new TypeError("BaseNumberInput step must be a positive finite number.");for(let[_,z]of [["showStepControls",s],["invalid",c],["disabled",p],["readOnly",u]])if(typeof z!="boolean")throw new TypeError(`BaseNumberInput ${_} must be a boolean.`);let T=Ye(),C=l??T.numberInput.increment,R=d??T.numberInput.decrement;Hx("incrementLabel",C),Hx("decrementLabel",R);let[M,I]=ho.useState(o),B=t!==void 0,N=B?t:M,D=of(N),E=Pe(g),P=ke(),W=Ne(E),H=a((_,z)=>{B||I(_);let re=of(_);w?.(re,{rawValue:_,reason:z,inRange:ID(re,r,n)});},"emitValueChange"),A=a(_=>{if(p||u||D!==null&&(_===1&&n!==void 0&&D>=n||_===-1&&r!==void 0&&D<=r))return;let z=MD({rawValue:N,direction:_,step:i,min:r,max:n});H(String(z),_===1?"step-up":"step-down");},"stepValue"),L=a(_=>{y?.(_),H(_.currentTarget.value,"input");},"handleChange"),F=a(_=>{k?.(_),!(_.defaultPrevented||p||u)&&(_.key!=="ArrowUp"&&_.key!=="ArrowDown"||(_.preventDefault(),A(_.key==="ArrowUp"?1:-1)));},"handleKeyDown"),G=p||u||D!==null&&r!==void 0&&D<=r,$=p||u||D!==null&&n!==void 0&&D>=n;return jsxRuntime.jsxs("div",{...P,"data-monkeys-component":"number-input","data-slot":"root","data-invalid":c||void 0,"data-disabled":p||void 0,"data-readonly":u||void 0,className:m(W.slots.controlWrapper,c&&W.slots.controlInvalid,p&&W.slots.controlDisabled,u&&W.slots.controlReadOnly,b?.root,f),style:{...W.styles.control,...c?W.styles.controlInvalid:void 0,...p?W.styles.controlDisabled:void 0,...x},children:[jsxRuntime.jsx("input",{...h,ref:S,type:"text",inputMode:"decimal",role:"spinbutton",value:N,disabled:p,readOnly:u,"aria-invalid":v??(c||void 0),"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":D??void 0,"aria-valuetext":N||void 0,"data-slot":"control",className:m(W.slots.controlBase,W.slots.controlInput,W.slots.numberInputControl,b?.control),onChange:L,onKeyDown:F}),s?jsxRuntime.jsxs("span",{"data-slot":"step-controls",className:m(W.slots.numberInputStepControls,b?.stepControls),style:W.styles.numberInputStepControls,children:[jsxRuntime.jsx("button",{type:"button","aria-label":C,disabled:$,"data-slot":"increment",className:m(W.slots.numberInputStepButton,b?.increment),style:W.styles.numberInputStepButton,onClick:()=>A(1),children:"+"}),jsxRuntime.jsx("button",{type:"button","aria-label":R,disabled:G,"data-slot":"decrement",className:m(W.slots.numberInputStepButton,b?.decrement),style:W.styles.numberInputStepButton,onClick:()=>A(-1),children:"\u2212"})]}):null]})},"BaseNumberInput"));function Gx({tone:e,icon:t,title:o,description:r,actions:n,children:i,appearance:s,className:l,classNames:d,style:c,...p}){let u=Ne(s),g=i??r;return jsxRuntime.jsxs("div",{...p,className:m(u.slots.noticeBase,Wd(u,e),d?.root,l),style:{...u.styles.notice,...c},children:[V(t)?jsxRuntime.jsx("div",{className:m(u.slots.noticeIcon,d?.icon),children:t}):null,jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[V(o)?jsxRuntime.jsx("div",{className:m(u.slots.noticeTitle,d?.title),children:o}):null,V(g)?jsxRuntime.jsx("div",{className:m(u.slots.noticeDescription,d?.description),children:g}):null,V(n)?jsxRuntime.jsx("div",{className:m(u.slots.noticeActions,d?.actions),children:n}):null]})]})}a(Gx,"BaseNotice");function BD(e,...t){for(let o of t)o&&(typeof o=="function"?o(e):o.current=e);}a(BD,"setRefs");function $x(e,t){if(!t.trim())throw new TypeError(`BasePasswordInput ${e} must be a non-empty string.`)}a($x,"validateLabel");var LD=ho.forwardRef(a(function({visible:t,defaultVisible:o=false,onVisibleChange:r,showPasswordLabel:n,hidePasswordLabel:i,invalid:s=false,disabled:l=false,readOnly:d=false,appearance:c,className:p,classNames:u,style:g,"aria-invalid":f,...b},x){for(let[E,P]of [["defaultVisible",o],["invalid",s],["disabled",l],["readOnly",d]])if(typeof P!="boolean")throw new TypeError(`BasePasswordInput ${E} must be a boolean.`);if(t!==void 0&&typeof t!="boolean")throw new TypeError("BasePasswordInput visible must be a boolean.");let y=Ye(),k=n??y.passwordInput.showPassword,w=i??y.passwordInput.hidePassword;$x("showPasswordLabel",k),$x("hidePasswordLabel",w);let v=ho.useRef(null),[h,S]=ho.useState(o),T=t!==void 0,C=T?t:h,R=Pe(c),M=ke(),I=Ne(R),B=a(E=>{let P=v.current;P&&P.ownerDocument.activeElement===P&&E.preventDefault();},"handleTogglePointerDown"),N=a(()=>{if(l)return;let E=!C;T||S(E),r?.(E);},"handleToggle"),D=C?w:k;return jsxRuntime.jsxs("div",{...M,"data-monkeys-component":"password-input","data-slot":"root","data-visible":C||void 0,"data-invalid":s||void 0,"data-disabled":l||void 0,"data-readonly":d||void 0,className:m(I.slots.controlWrapper,s&&I.slots.controlInvalid,l&&I.slots.controlDisabled,d&&I.slots.controlReadOnly,u?.root,p),style:{...I.styles.control,...s?I.styles.controlInvalid:void 0,...l?I.styles.controlDisabled:void 0,...g},children:[jsxRuntime.jsx("input",{...b,ref:E=>BD(E,v,x),type:C?"text":"password",disabled:l,readOnly:d,"aria-invalid":f??(s||void 0),"data-slot":"control",className:m(I.slots.controlBase,I.slots.controlInput,I.slots.passwordInputControl,u?.control)}),jsxRuntime.jsx("button",{type:"button","aria-label":D,"aria-pressed":C,disabled:l,"data-slot":"toggle","data-state":C?"visible":"hidden",className:m(I.slots.passwordInputToggle,u?.toggle),style:I.styles.passwordInputToggle,onPointerDown:B,onClick:N,children:D})]})},"BasePasswordInput"));function FD(e,t,o){return Math.min(Math.max(e,t),o)}a(FD,"clamp");var Kx=ho.forwardRef(a(function({value:t=0,max:o=100,label:r,showValue:n=false,valueFormatter:i,appearance:s,className:l,classNames:d,style:c,"aria-label":p,"aria-labelledby":u,...g},f){let b=`${ho.useId()}-label`;if(typeof o!="number"||!Number.isFinite(o)||o<=0)throw new TypeError("BaseProgress max must be a positive finite number.");if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("BaseProgress value must be a finite number.");let x=Pe(s),y=ke(),k=Ne(x),w=FD(t,0,o),v=w/o*100,h=i?.(w,o)??`${Math.round(v)}%`,S=V(r),T=S||n,C=typeof r=="string"?r:void 0,M=S&&C===void 0&&!(p!==void 0||u!==void 0)?b:void 0,I=w===0?"empty":w===o?"complete":"progress";return jsxRuntime.jsxs("div",{...y,...g,ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":w,"aria-label":p??(u===void 0?C:void 0),"aria-labelledby":u??M,"data-monkeys-component":"progress","data-slot":"root","data-state":I,"data-value":w,"data-max":o,className:m(k.slots.progressRoot,d?.root,l),style:{...k.styles.progressRoot,...c},children:[T?jsxRuntime.jsxs("div",{"data-slot":"label-row","data-state":I,className:m(k.slots.progressLabelRow,d?.labelRow),children:[S?jsxRuntime.jsx("span",{id:M,"data-slot":"label",className:m(k.slots.progressLabel,d?.label),children:r}):jsxRuntime.jsx("span",{"data-slot":"label"}),n?jsxRuntime.jsx("span",{"data-slot":"value","data-value":w,className:m(k.slots.progressValue,d?.value),children:h}):null]}):null,jsxRuntime.jsx("div",{"data-slot":"track","data-state":I,className:m(k.slots.progressTrack,d?.track),children:jsxRuntime.jsx("div",{"data-slot":"indicator","data-state":I,"data-value":w,className:m(k.slots.progressIndicator,d?.indicator),style:{...k.styles.progressIndicator,width:`${v}%`}})})]})},"BaseProgress"));function GD(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(GD,"toDomId");var $D={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"},jD={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},UD={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},qx=ho.forwardRef(a(function({options:t=[],value:o,defaultValue:r,name:n,form:i,orientation:s="vertical",required:l=false,invalid:d=false,disabled:c=false,controlSize:p,appearance:u,className:g,classNames:f,style:b,children:x,onChange:y,onValueChange:k,id:w,"aria-invalid":v,...h},S){for(let[A,L]of [["required",l],["invalid",d],["disabled",c]])if(typeof L!="boolean")throw new TypeError(`BaseRadioGroup ${A} must be a boolean.`);if(s!=="horizontal"&&s!=="vertical")throw new TypeError('BaseRadioGroup orientation must be "horizontal" or "vertical".');if(p!==void 0&&p!=="sm"&&p!=="md"&&p!=="lg")throw new TypeError('BaseRadioGroup controlSize must be "sm", "md", or "lg".');if(!Array.isArray(t))throw new TypeError("BaseRadioGroup options must be an array.");let T=new Set;t.forEach((A,L)=>{if(!A||typeof A!="object")throw new TypeError(`BaseRadioGroup option at index ${L} must be an object.`);if(typeof A.value!="string")throw new TypeError(`BaseRadioGroup option value at index ${L} must be a string.`);if(T.has(A.value)){let F=JSON.stringify(A.value);throw new TypeError(`BaseRadioGroup options must use unique values; duplicate value ${F} at index ${L}.`)}if(A.disabled!==void 0&&typeof A.disabled!="boolean")throw new TypeError(`BaseRadioGroup option disabled at index ${L} must be a boolean.`);T.add(A.value);});let C=Pe(u),R=ke(),M=Ne(C),I=ho.useId(),B=w??I,N=n??B,[D,E]=ho.useState(r),P=o!==void 0,W=P?o:D,H=a((A,L)=>{if(c||L)return;let F=A.currentTarget.value;P||E(F),y?.(A),k?.(F,A);},"handleSelect");return jsxRuntime.jsxs("div",{...R,...h,ref:S,id:w,role:"radiogroup","aria-orientation":s,"aria-required":l||void 0,"aria-invalid":v??(d||void 0),"aria-disabled":c||void 0,"data-monkeys-component":"radio-group","data-slot":"root","data-state":c?"disabled":"enabled","data-orientation":s,"data-size":p,"data-required":l||void 0,"data-invalid":d||void 0,"data-disabled":c||void 0,className:m(M.slots.radioGroupRoot,s==="horizontal"&&"flex flex-wrap items-center",f?.root,g),style:{...M.styles.radioGroup,...b},children:[t.map((A,L)=>{let F=c||A.disabled,G=A.value===W,$=G?"checked":"unchecked",_=`${B}-${L}-${GD(A.value)}`;return jsxRuntime.jsxs("label",{htmlFor:_,"data-slot":"option","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioOption,F&&M.slots.radioOptionDisabled,p&&$D[p],f?.option),style:M.styles.radioOption,children:[jsxRuntime.jsxs("span",{"data-slot":"marker","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioMarker,G&&M.slots.radioMarkerChecked,p&&jD[p],f?.marker),children:[jsxRuntime.jsx("input",{id:_,type:"radio",name:N,form:i,value:A.value,checked:G,required:l,disabled:F,"aria-invalid":v??(d||void 0),"data-slot":"input","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioInput,f?.input),onChange:z=>H(z,A.disabled)}),G?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator","data-state":$,"data-size":p,className:m(M.slots.radioIndicator,p&&UD[p],f?.indicator)}):null]}),V(A.icon)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m("mt-0.5 shrink-0",f?.icon),children:A.icon}):null,jsxRuntime.jsxs("span",{"data-slot":"content",className:m(M.slots.radioContent,f?.content),children:[jsxRuntime.jsx("span",{"data-slot":"label",className:m(M.slots.radioLabel,f?.label),children:A.label}),V(A.description)?jsxRuntime.jsx("span",{"data-slot":"description",className:m(M.slots.radioDescription,f?.description),children:A.description}):null]})]},A.value)}),x]})},"BaseRadioGroup"));function qD(e){if(e==="x")return {overflowX:"auto",overflowY:"hidden"};if(e==="y")return {overflowX:"hidden",overflowY:"auto"};if(e==="both")return {overflowX:"auto",overflowY:"auto"};throw new TypeError('BaseScrollArea axis must be "x", "y", or "both".')}a(qD,"resolveOverflow");var YD=ho.forwardRef(a(function({children:t,axis:o="y",maxWidth:r,maxHeight:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b=qD(o),x=r===void 0?void 0:rr("BaseScrollArea","maxWidth",r),y=n===void 0?void 0:rr("BaseScrollArea","maxHeight",n);return jsxRuntime.jsx("div",{...g,...c,ref:p,"data-monkeys-component":"scroll-area","data-slot":"viewport","data-axis":o,className:m(f.slots.scrollAreaViewport,l?.viewport,s),style:{...f.styles.scrollArea,...b,maxWidth:x,maxHeight:y,...d},children:t})},"BaseScrollArea"));var iP=500;function sP({options:e,value:t,defaultValue:o,invalid:r,disabled:n,openForPreview:i,portal:s,required:l}){for(let[d,c]of [["invalid",r],["disabled",n],["openForPreview",i],["portal",s]])if(typeof c!="boolean")throw new TypeError(`BaseSelect ${d} must be a boolean.`);if(l!==void 0&&typeof l!="boolean")throw new TypeError("BaseSelect required must be a boolean.");if(e!==void 0&&!Array.isArray(e))throw new TypeError("BaseSelect options must be an array.");if(e?.forEach((d,c)=>{if(!d||typeof d!="object")throw new TypeError(`BaseSelect option at index ${c} must be an object.`);if(typeof d.value!="string")throw new TypeError(`BaseSelect option value at index ${c} must be a string.`);if(d.disabled!==void 0&&typeof d.disabled!="boolean")throw new TypeError(`BaseSelect option disabled at index ${c} must be a boolean.`);if(d.textValue!==void 0&&typeof d.textValue!="string")throw new TypeError(`BaseSelect option textValue at index ${c} must be a string.`)}),e?.length){if(t!==void 0&&typeof t!="string"&&typeof t!="number")throw new TypeError("BaseSelect value must be a string or number when options are used.");if(o!==void 0&&typeof o!="string"&&typeof o!="number")throw new TypeError("BaseSelect defaultValue must be a string or number when options are used.")}}a(sP,"validateSelectProps");function rf(e){return typeof e=="string"||typeof e=="number"?String(e):""}a(rf,"normalizeValue");function lP(e,t){if(t!==void 0)return e.find(o=>o.value===t)}a(lP,"findOption");function _s(e,t){let o=e.findIndex(r=>r.value===t&&!r.disabled);return o>=0?o:e.findIndex(r=>!r.disabled)}a(_s,"getInitialActiveIndex");function dP(e,t,o){if(!e.length)return -1;let r=t>=0?t:o===1?-1:0;for(let n=1;n<=e.length;n+=1){let i=(r+n*o+e.length)%e.length;if(!e[i]?.disabled)return i}return -1}a(dP,"getNextEnabledIndex");function cP(e,t){if(t==="first")return e.findIndex(o=>!o.disabled);for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return -1}a(cP,"getBoundaryEnabledIndex");function Yx(e){return e.textValue!==void 0?e.textValue:typeof e.label=="string"?e.label:e.value}a(Yx,"getOptionText");function uP(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(uP,"toDomId");var Fc=ho.forwardRef(a(function({options:t,placeholder:o,icon:r,invalid:n=false,disabled:i=false,openForPreview:s=false,portal:l=false,appearance:d,className:c,classNames:p,style:u,children:g,value:f,defaultValue:b,onBlur:x,onChange:y,onFocus:k,onInvalid:w,name:v,id:h,required:S,"aria-invalid":T,"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":B,...N},D){sP({options:t,value:f,defaultValue:b,invalid:n,disabled:i,openForPreview:s,portal:l,required:S});let E=Pe(d),P=ke(),W=Ne(E),H=Yn(),A=n||H.invalid,L=ho.useId(),F=h??L,G=`${F}-button`,$=`${F}-listbox`,_=ho.useRef(null),z=ho.useRef(null),re=ho.useRef(null),Z=ho.useRef([]),ae=ho.useRef(false),ee=ho.useRef(""),q=ho.useRef(null),U=t??[],X=U.length>0,O=s,[K,ne]=ho.useState(false),[fe,he]=ho.useState(false),me=O||K,ie=wr({disabled:O||!l?true:void 0}),{refs:be,floatingStyles:He,isPositioned:We,placement:Ke}=react.useFloating({transform:false,open:X&&me&&ie.shouldPortal,placement:"bottom-start",strategy:"fixed",whileElementsMounted:ie.shouldPortal?react.autoUpdate:void 0,middleware:[react.offset(6),react.flip({padding:8}),react.shift({padding:8}),react.size({padding:8,apply({rects:Ce,availableHeight:Xe,elements:de}){Object.assign(de.floating.style,{width:`${Ce.reference.width}px`,maxHeight:`min(15rem, ${Math.max(0,Xe)}px)`});}})]}),ce=ho.useCallback(Ce=>{z.current=Ce,be.setReference(Ce);},[be.setReference]),[Q,ge]=ho.useState(()=>rf(b)),we=f!==void 0,Ie=we?rf(f):Q,oe=lP(U,Ie),[xe,Ve]=ho.useState(()=>_s(U,Ie)),_e=xe>=0&&!U[xe]?.disabled?xe:_s(U,Ie),Ge=U.map((Ce,Xe)=>`${F}-option-${Xe}-${uP(Ce.value)}`),le=oe?.label??o,Me=!oe,Ae=N.dir??P.dir,J=i?"disabled":A?"invalid":me?"open":"closed",$e=a(Ce=>{re.current=Ce,typeof D=="function"?D(Ce):D&&(D.current=Ce);},"setSelectRef"),ue=a(Ce=>{x?.(Ce),H.notifyBlur(Ce.currentTarget.value);},"handleNativeBlur"),Re=a(Ce=>{y?.(Ce),H.notifyChange(Ce.currentTarget.value);},"handleNativeChange"),se=a(()=>{Ve(_s(U,Ie));},"resetActiveIndex"),te=a(()=>{se(),O||ne(false);},"cancelAndClose"),Te=a((Ce,Xe=false)=>{he(Xe),Ve(Ce??_s(U,Ie)),O||ne(true);},"openMenu"),ze=a(Ce=>{let Xe=re.current;if(!Xe)return;let de=Xe.ownerDocument.defaultView;if(!de)throw new Error("BaseSelect cannot dispatch change without an owning window.");let Ee=Object.getOwnPropertyDescriptor(de.HTMLSelectElement.prototype,"value")?.set;if(!Ee)throw new Error("BaseSelect could not resolve the native select value setter.");Ee.call(Xe,Ce),Xe.dispatchEvent(new de.Event("change",{bubbles:true}));},"notifyChange"),je=a(Ce=>{let Xe=U[Ce];!Xe||Xe.disabled||i||(Ve(Ce),Xe.value!==Ie&&(we||ge(Xe.value),ze(Xe.value)),O||ne(false));},"commitIndex"),it=a(Ce=>{Ce<0||U[Ce]?.disabled||(Ve(Ce),me||Te(Ce));},"moveActive"),Y=a((Ce,Xe)=>{let de=Ce.currentTarget.ownerDocument.defaultView;if(!de)return;let Ee=`${ee.current}${Xe}`.toLocaleLowerCase();ee.current=Ee,q.current&&q.current.ownerWindow.clearTimeout(q.current.timerId),q.current={ownerWindow:de,timerId:de.setTimeout(()=>{ee.current="",q.current=null;},iP)};let Le=Array.from(Ee).every(Je=>Je===Ee[0])?Xe.toLocaleLowerCase():Ee,Se=me?_e:U.findIndex(Je=>Je.value===Ie&&!Je.disabled);for(let Je=1;Je<=U.length;Je+=1){let bt=(Se+Je+U.length)%U.length,xt=U[bt];if(!xt?.disabled&&Yx(xt).trim().toLocaleLowerCase().startsWith(Le)){Ce.preventDefault(),it(bt);return}}},"handleTypeahead"),pe=a(Ce=>{if(!(i||ae.current||Ce.nativeEvent.isComposing)){if(Ce.key==="ArrowDown"||Ce.key==="ArrowUp"){Ce.preventDefault();let Xe=U.findIndex(Ee=>Ee.value===Ie&&!Ee.disabled);it(dP(U,me?_e:Xe,Ce.key==="ArrowDown"?1:-1));return}if(Ce.key==="Home"||Ce.key==="End"){Ce.preventDefault(),it(cP(U,Ce.key==="Home"?"first":"last"));return}if(Ce.key==="Enter"||Ce.key===" "){Ce.preventDefault(),me?je(_e):Te();return}if(Ce.key==="Escape"&&me){Ce.preventDefault(),te();return}if(Ce.key==="Tab"&&me){je(_e);return}Ce.key.length===1&&!Ce.ctrlKey&&!Ce.metaKey&&!Ce.altKey&&!/\s/.test(Ce.key)&&Y(Ce,Ce.key);}},"handleKeyDown"),Be=a(Ce=>{k?.(Ce),Ce.defaultPrevented||z.current?.focus();},"handleCustomFocus"),rt=a(Ce=>{w?.(Ce),Ce.preventDefault(),z.current?.focus();},"handleCustomInvalid");return ho.useEffect(()=>{if(!X||!me||O)return;let Ce=_.current?.ownerDocument;if(!Ce)return;let Xe=a(de=>{!_.current?.contains(de.target)&&!be.floating.current?.contains(de.target)&&te();},"handlePointerDown");return Ce.addEventListener("pointerdown",Xe),()=>{Ce.removeEventListener("pointerdown",Xe);}},[O,X,me,U,Ie]),ho.useEffect(()=>{!X||!me||_e<0||Z.current[_e]?.scrollIntoView?.({block:"nearest"});},[X,me,_e]),ho.useEffect(()=>{if(!X||we)return;let Ce=re.current,Xe=Ce?.form,de=Ce?.ownerDocument.defaultView;if(!Xe||!de)return;let Ee=a(()=>{de.setTimeout(()=>{let qe=rf(b);ge(qe),Ve(_s(U,qe)),O||ne(false);},0);},"handleReset");return Xe.addEventListener("reset",Ee),()=>Xe.removeEventListener("reset",Ee)},[b,O,we,X,U]),ho.useEffect(()=>()=>{q.current&&q.current.ownerWindow.clearTimeout(q.current.timerId);},[]),X?jsxRuntime.jsxs("div",{...P,ref:_,dir:Ae,"data-monkeys-component":"select","data-slot":"root","data-state":J,"data-native":"false",className:m(W.slots.controlWrapper,"overflow-visible",me&&"z-50",A&&W.slots.controlInvalid,i&&W.slots.controlDisabled,p?.root,c),style:{...W.styles.control,...A?W.styles.controlInvalid:void 0,...i?W.styles.controlDisabled:void 0,...u},children:[V(r)?jsxRuntime.jsx("span",{className:m(W.slots.controlIcon,p?.icon),children:r}):null,jsxRuntime.jsx("button",{...P,ref:ce,type:"button",id:G,role:"combobox",disabled:i,dir:Ae,"aria-haspopup":"listbox","aria-expanded":me,"aria-controls":$,"aria-activedescendant":me&&_e>=0?Ge[_e]:void 0,"aria-autocomplete":"none","aria-invalid":T??(A||void 0),"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":B??(S||void 0),"data-monkeys-component":"select","data-slot":"trigger","data-state":J,className:m(W.slots.controlBase,W.slots.controlSelect,"flex items-center text-left",p?.control),onClick:Ce=>{me?te():Te(void 0,Ce.detail>0);},onBlur:Ce=>{!_.current?.contains(Ce.relatedTarget)&&!be.floating.current?.contains(Ce.relatedTarget)&&(te(),H.notifyBlur(Ie));},onCompositionStart:()=>{ae.current=true;},onCompositionEnd:()=>{ae.current=false;},onKeyDown:pe,children:jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",Me&&W.slots.selectPlaceholder,Me&&p?.placeholder),children:le})}),jsxRuntime.jsx("span",{className:m(W.slots.selectChevron,me&&"rotate-[225deg]")}),jsxRuntime.jsxs("select",{...P,...N,ref:$e,id:h,name:v,value:Ie,required:S,disabled:i,dir:Ae,"aria-hidden":"true",tabIndex:-1,"data-monkeys-component":"select","data-slot":"native","data-state":J,"data-native":"false",className:W.slots.selectNative,onBlur:x,onFocus:Be,onInvalid:rt,onChange:Re,children:[V(o)?jsxRuntime.jsx("option",{value:"",disabled:true,children:o}):null,U.map(Ce=>jsxRuntime.jsx("option",{value:Ce.value,disabled:Ce.disabled,children:Yx(Ce)},Ce.value))]}),me?Oy(jsxRuntime.jsx("div",{...P,ref:ie.shouldPortal?be.setFloating:void 0,id:$,role:"listbox",dir:Ae,"aria-labelledby":G,"data-monkeys-component":"select","data-slot":"menu","data-portal":ie.shouldPortal?"portaled":"inline","data-state":"open","data-side":ie.shouldPortal?Ke.split("-")[0]:"bottom",className:m(W.slots.selectMenu,ie.shouldPortal&&Ke.startsWith("top")?"origin-bottom":"origin-top",fe&&!O&&(!ie.shouldPortal||We)&&"motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-150 motion-safe:ease-out",p?.menu),style:{...W.styles.selectMenu,...ie.shouldPortal?{...He,right:"auto",visibility:We?"visible":"hidden"}:void 0},children:U.map((Ce,Xe)=>{let de=Ce.value===Ie,Ee=Xe===_e,qe=Ce.disabled?"disabled":Ee?"active":de?"selected":"idle";return ho.createElement("button",{...P,ref:Le=>{Z.current[Xe]=Le;},key:Ce.value,id:Ge[Xe],type:"button",role:"option",tabIndex:-1,disabled:Ce.disabled,dir:Ae,"aria-selected":de,"data-monkeys-component":"select","data-slot":"option","data-state":qe,"data-active":Ee||void 0,"data-selected":de||void 0,"data-disabled":Ce.disabled||void 0,className:m(W.slots.selectOption,Ee&&W.slots.selectOptionActive,de&&W.slots.selectOptionSelected,Ce.disabled&&W.slots.selectOptionDisabled,p?.option),style:{...W.styles.selectOption,...Ee?W.styles.selectOptionActive:void 0,...de?W.styles.selectOptionSelected:void 0},onMouseDown:Le=>Le.preventDefault(),onClick:()=>je(Xe)},jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:Ce.label}))})}),ie):null]}):jsxRuntime.jsxs("div",{...P,"data-monkeys-component":"select","data-slot":"root","data-state":J,"data-native":"true",className:m(W.slots.controlWrapper,A&&W.slots.controlInvalid,i&&W.slots.controlDisabled,p?.root,c),style:{...W.styles.control,...A?W.styles.controlInvalid:void 0,...i?W.styles.controlDisabled:void 0,...u},children:[V(r)?jsxRuntime.jsx("span",{className:m(W.slots.controlIcon,p?.icon),children:r}):null,jsxRuntime.jsxs("select",{...P,...N,id:h,ref:D,name:v,value:f,defaultValue:b,required:S,disabled:i,"aria-invalid":T??(A||void 0),"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":B,"data-monkeys-component":"select","data-slot":"native","data-state":J,"data-native":"true",onBlur:ue,onFocus:k,onInvalid:w,onChange:Re,className:m(W.slots.controlBase,W.slots.controlSelect,p?.control),children:[V(o)?jsxRuntime.jsx("option",{value:"",disabled:true,children:o}):null,g]}),jsxRuntime.jsx("span",{className:W.slots.selectChevron})]})},"BaseSelect"));function Qx({eyebrow:e,title:t,description:o,actions:r,children:n,appearance:i,className:s,classNames:l,style:d,...c}){let p=Ne(i),u=n??o;return jsxRuntime.jsxs("div",{...c,className:m(p.slots.sectionHeaderRoot,l?.root,s),style:{...p.styles.sectionHeader,...d},children:[jsxRuntime.jsxs("div",{className:m(p.slots.sectionHeaderContent,l?.content),children:[V(e)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderEyebrow,l?.eyebrow),children:e}):null,V(t)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderTitle,l?.title),children:t}):null,V(u)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderDescription,l?.description),children:u}):null]}),V(r)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderActions,l?.actions),children:r}):null]})}a(Qx,"BaseSectionHeader");function fP(e,t){return t&&e?.some(o=>o.value===t)&&!e.find(r=>r.value===t)?.disabled?t:e?.find(o=>!o.disabled)?.value??e?.[0]?.value}a(fP,"getInitialSegmentValue");function aa({options:e=[],value:t,defaultValue:o,appearance:r,className:n,classNames:i,style:s,onValueChange:l,...d}){let c=Ne(r),[p,u]=ho.useState(()=>fP(e,o)),g=t!==void 0,f=g?t:p,b=a((y,k)=>{k||(g||u(y),l?.(y));},"handleSelect"),x=a(y=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(y.key))return;let k=e.filter(C=>!C.disabled);if(k.length===0)return;y.preventDefault();let w=Math.max(0,k.findIndex(C=>C.value===f)),v=y.key==="Home"?0:y.key==="End"?k.length-1:y.key==="ArrowLeft"||y.key==="ArrowUp"?(w-1+k.length)%k.length:(w+1)%k.length,h=k[v],S=y.currentTarget.querySelectorAll('[role="radio"]'),T=Array.from(S).find(C=>C.dataset.value===h.value);b(h.value),T?.focus();},"handleKeyDown");return jsxRuntime.jsx("div",{...d,role:"radiogroup","aria-orientation":"horizontal",className:m(c.slots.segmentedRoot,i?.root,n),style:{...c.styles.segmentedRoot,...s},onKeyDown:x,children:e.map(y=>{let k=y.value===f;return jsxRuntime.jsxs("button",{type:"button",role:"radio","data-value":y.value,"aria-checked":k,tabIndex:k?0:-1,disabled:y.disabled,className:m(c.slots.segmentedItem,k&&c.slots.segmentedItemActive,y.disabled&&c.slots.segmentedItemDisabled,i?.item),style:c.styles.segmentedItem,onClick:()=>b(y.value,y.disabled),children:[V(y.icon)?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 shrink-0",i?.icon),children:y.icon}):null,jsxRuntime.jsx("span",{className:m("min-w-0 truncate",i?.label),children:y.label})]},y.value)})})}a(aa,"BaseSegmentedControl");var hP=ho.forwardRef(a(function({decorative:t=false,label:o,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Ye(),p=Pe(r),u=ke(),g=Ne(p);if(typeof t!="boolean")throw new TypeError("BaseSpinner decorative must be a boolean.");if(t&&o!==void 0)throw new TypeError("BaseSpinner label cannot be provided when decorative is true.");let f=t?void 0:o??c.loading.spinner;if(!t&&(typeof f!="string"||!f.trim()))throw new TypeError("BaseSpinner label must be a non-empty string.");return jsxRuntime.jsx("span",{...u,...l,ref:d,role:t?void 0:"status","aria-label":f,"aria-hidden":t?"true":void 0,"data-monkeys-component":"spinner","data-slot":"root","data-decorative":t||void 0,className:m(g.slots.spinnerRoot,i?.root,n),style:{...g.styles.spinner,...s},children:jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(g.slots.spinnerIndicator,i?.indicator),style:g.styles.spinnerIndicator})})},"BaseSpinner"));var xP=ho.forwardRef(a(function({children:t,gap:o,align:r="stretch",justify:n="start",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Go(),g=Pe(i),f=ke(),b=Ne(g),x=o===void 0?void 0:rr("BaseStack","gap",o);return jsxRuntime.jsx("div",{...f,...c,ref:p,"data-monkeys-component":"stack","data-slot":"root","data-align":r,"data-justify":n,className:m(b.slots.stackRoot,u>0&&o===void 0&&"gap-[var(--monkeys-bento-gap)]",g?.slots?.stackRoot,l?.root,s),style:{...b.styles.stack,gap:x??b.styles.stack?.gap,alignItems:bi("BaseStack",r),justifyContent:gi("BaseStack",n),...d},children:t})},"BaseStack"));var CP=new Set(["pending","current","completed","error"]),Jx=["current","completed","error","disabled"],ev=/[\s\u0000-\u001f\u007f]/u;function tv(e){if(!e||typeof e!="object"||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}a(tv,"isPlainRecord");function ov(e){return V(e)?typeof e=="string"?!!e.trim():Array.isArray(e)?e.some(ov):true:false}a(ov,"hasStepLabel");function SP(e){try{return encodeURIComponent(e)}catch{throw new TypeError(`BaseSteps item id ${JSON.stringify(e)} must contain valid Unicode.`)}}a(SP,"encodeStepId");function TP(e){if(!Array.isArray(e))throw new TypeError("BaseSteps items must be an array.");let t=new Set,o=0,r=e.map((n,i)=>{if(!tv(n))throw new TypeError(`BaseSteps item at index ${i} must be an object.`);let s=n;if(typeof s.id!="string"||!s.id||ev.test(s.id))throw new TypeError(`BaseSteps item at index ${i} must have a non-empty id without whitespace or control characters.`);if(t.has(s.id))throw new TypeError(`BaseSteps item id ${JSON.stringify(s.id)} is duplicated.`);if(t.add(s.id),!ov(s.label))throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} label must contain renderable content.`);let l=s.status??"pending";if(!CP.has(l))throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} status must be one of: pending, current, completed, error.`);if(l==="current"&&(o+=1),s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} disabled must be a boolean.`);if(s.selectable!==void 0&&typeof s.selectable!="boolean")throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} selectable must be a boolean.`);return {item:s,encodedId:SP(s.id),status:l}});if(o>1)throw new RangeError("BaseSteps items may contain at most one current step.");return r}a(TP,"validateItems");function NP(e,t){if(t!==void 0&&!tv(t))throw new TypeError("BaseSteps statusLabels must be an object.");let o=t;for(let n of Object.keys(o??{}))if(!Jx.includes(n))throw new TypeError(`BaseSteps statusLabels.${n} is not a supported status label.`);let r={current:o?.current??e.current,completed:o?.completed??e.completed,error:o?.error??e.error,disabled:o?.disabled??e.disabled};for(let n of Jx){let i=r[n];if(typeof i!="string"||!i.trim())throw new TypeError(`BaseSteps statusLabels.${n} must be a non-empty string.`)}return r}a(NP,"resolveStatusLabels");function RP(e,t){if(e!==void 0&&(typeof e!="string"||!e.trim()))throw new TypeError("BaseSteps aria-label must be a non-empty string when provided.");if(t===void 0)return;if(typeof t!="string"||!t.trim())throw new TypeError("BaseSteps aria-labelledby must contain at least one valid ID token.");if(t.trim().split(/\s+/).some(r=>ev.test(r)))throw new TypeError("BaseSteps aria-labelledby must contain only valid ID tokens.")}a(RP,"validateAccessibleName");function MP(e,t){return e==="completed"?"\u2713":e==="error"?"!":t+1}a(MP,"getIndicator");function IP(e,t){return m(e==="pending"&&t.stepsIndicatorPending,e==="current"&&t.stepsIndicatorCurrent,e==="completed"&&t.stepsIndicatorCompleted,e==="error"&&t.stepsIndicatorError)}a(IP,"getIndicatorClassName");var DP=ho.forwardRef(a(function({items:t,orientation:o="horizontal",statusLabels:r,appearance:n,className:i,classNames:s,style:l,onStepSelect:d,"aria-label":c,"aria-labelledby":p,...u},g){let f=ho.useId(),b=Ye().steps,x=Pe(n),y=ke(),k=Ne(x);if(o!=="horizontal"&&o!=="vertical")throw new TypeError('BaseSteps orientation must be "horizontal" or "vertical".');if(d!==void 0&&typeof d!="function")throw new TypeError("BaseSteps onStepSelect must be a function.");if(typeof b.label!="string"||!b.label.trim())throw new TypeError("BaseSteps locale label must be a non-empty string.");RP(c,p);let w=TP(t),v=NP(b,r);return jsxRuntime.jsx("ol",{...y,...u,ref:g,role:"list","aria-label":c??(p===void 0?b.label:void 0),"aria-labelledby":p,"data-monkeys-component":"steps","data-slot":"root","data-orientation":o,className:m(k.slots.stepsRoot,o==="horizontal"?k.slots.stepsHorizontal:k.slots.stepsVertical,s?.root,i),style:{...k.styles.steps,...l},children:w.map(({item:h,encodedId:S,status:T},C)=>{let R=`${f}-step-${S}`,M=`${R}-label`,I=`${R}-description`,B=`${R}-status`,N=V(h.description),D=T==="pending"?void 0:v[T],E=!!(D||h.disabled),P=d!==void 0&&h.selectable!==false,W=[N?I:void 0,E?B:void 0].filter(Boolean).join(" ")||void 0,H=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(k.slots.stepsIndicator,IP(T,k.slots),s?.indicator),style:k.styles.stepsIndicator,children:MP(T,C)}),jsxRuntime.jsxs("span",{"data-slot":"content",className:m(k.slots.stepsContent,s?.content),children:[jsxRuntime.jsx("span",{id:M,"data-slot":"label",className:m(k.slots.stepsLabel,s?.label),children:h.label}),N?jsxRuntime.jsx("span",{id:I,"data-slot":"description",className:m(k.slots.stepsDescription,s?.description),children:h.description}):null,E?jsxRuntime.jsxs("span",{id:B,"data-slot":"status",className:m(k.slots.stepsStatus,s?.status),children:[D,D&&h.disabled?". ":null,h.disabled?v.disabled:null]}):null]})]});return jsxRuntime.jsxs("li",{id:R,"aria-current":T==="current"?"step":void 0,"aria-disabled":h.disabled||void 0,"data-step-id":h.id,"data-status":T,"data-disabled":h.disabled||void 0,"data-selectable":P||void 0,className:m(k.slots.stepsItem,o==="horizontal"?k.slots.stepsItemHorizontal:k.slots.stepsItemVertical,s?.item),style:k.styles.stepsItem,children:[P?jsxRuntime.jsx("button",{type:"button",disabled:h.disabled,"aria-labelledby":M,"aria-describedby":W,"data-slot":"trigger",className:m(k.slots.stepsTrigger,k.slots.stepsTriggerInteractive,h.disabled&&k.slots.stepsTriggerDisabled,s?.trigger),style:k.styles.stepsTrigger,onClick:()=>{h.disabled||d(h.id,h,C);},children:H}):jsxRuntime.jsx("div",{"data-slot":"trigger",className:m(k.slots.stepsTrigger,h.disabled&&k.slots.stepsTriggerDisabled,s?.trigger),style:k.styles.stepsTrigger,children:H}),C<w.length-1?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"connector",className:m(k.slots.stepsConnector,o==="horizontal"?k.slots.stepsConnectorHorizontal:k.slots.stepsConnectorVertical,T==="completed"&&k.slots.stepsConnectorCompleted,T==="error"&&k.slots.stepsConnectorError,s?.connector),style:k.styles.stepsConnector}):null]},h.id)})})},"BaseSteps"));var BP={sm:"h-5 w-9",md:"h-6 w-10",lg:"h-7 w-12"},LP={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},WP={sm:"translate-x-[18px]",md:"translate-x-5",lg:"translate-x-6"},zP={compact:"sm",default:"md",comfortable:"lg"},rv=ho.forwardRef(a(function({label:t,description:o,disabled:r=false,controlSize:n,appearance:i,className:s,classNames:l,style:d,checked:c,defaultChecked:p,onChange:u,...g},f){if(typeof r!="boolean")throw new TypeError("BaseSwitch disabled must be a boolean.");if(n!==void 0&&n!=="sm"&&n!=="md"&&n!=="lg")throw new TypeError('BaseSwitch controlSize must be "sm", "md", or "lg".');let b=Pe(i),x=ke(),y=Ne(b),k=V(t),w=Rd(o),[v,h]=ho.useState(p??false),S=c!==void 0,T=S?c:v,C=T?"checked":"unchecked",R=n??zP[y.density],M=a(I=>{r||(S||h(I.currentTarget.checked),u?.(I));},"handleChange");return jsxRuntime.jsxs("label",{...x,"data-monkeys-component":"switch","data-slot":"root","data-state":C,"data-size":n,"data-disabled":r||void 0,className:m(y.slots.switchRoot,!w&&"items-center",r&&y.slots.switchDisabled,l?.root,s),style:{...y.styles.switchRoot,...d},children:[jsxRuntime.jsxs("span",{"data-slot":"track","data-state":C,"data-size":n,className:m(y.slots.switchTrack,!w&&"mt-0",T&&y.slots.switchChecked,n&&BP[n],l?.track),style:y.styles.switchTrack,children:[jsxRuntime.jsx("input",{...g,ref:f,type:"checkbox",role:"switch",disabled:r,checked:c,defaultChecked:p,"aria-checked":T,"data-slot":"input","data-state":C,"data-size":n,"data-disabled":r||void 0,onChange:M,className:m(y.slots.switchInput,l?.input)}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"thumb","data-state":C,"data-size":n,className:m(y.slots.switchThumb,n&&LP[n],T&&WP[R],l?.thumb),style:y.styles.switchThumb})]}),k||w?jsxRuntime.jsxs("span",{"data-slot":"content",className:m(y.slots.switchContent,l?.content),children:[k?jsxRuntime.jsx("span",{"data-slot":"label",className:m(y.slots.switchLabel,l?.label),children:t}):null,w?jsxRuntime.jsx("span",{"data-slot":"description",className:m(y.slots.switchDescription,l?.description),children:o}):null]}):null]})},"BaseSwitch"));function FP({kind:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",children:{error:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M12 7v6"}),jsxRuntime.jsx("path",{d:"M12 17h.01"})]}),permission:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"}),jsxRuntime.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}),offline:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12.5a10 10 0 0 1 14 0"}),jsxRuntime.jsx("path",{d:"M8.5 16a5 5 0 0 1 7 0"}),jsxRuntime.jsx("path",{d:"M12 20h.01"}),jsxRuntime.jsx("path",{d:"m4 4 16 16"})]}),fallback:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 4.2 1.8c-1 .8-1.7 1.2-1.7 2.7"}),jsxRuntime.jsx("path",{d:"M12 17h.01"})]})}[e]})}a(FP,"SystemStateIcon");var za=ho.forwardRef(a(function({kind:t="fallback",icon:o,title:r,description:n,actions:i,appearance:s,className:l,classNames:d,style:c,role:p,"aria-live":u,...g},f){let b=Pe(s),x=ke(),y=Wr(),k=y.density==="compact"?"min-h-0 px-3 py-3":y.density==="comfortable"?"min-h-56 px-8 py-12":void 0,w=Ne(b),v=o===void 0?jsxRuntime.jsx(FP,{kind:t}):o,h=p??(t==="error"||t==="offline"?"alert":"status");return jsxRuntime.jsxs("div",{...x,...g,ref:f,role:h,"aria-live":u??(h==="alert"?"assertive":"polite"),"data-monkeys-component":"system-state","data-slot":"root","data-state":t,"data-density":y.density,className:m(w.slots.stateRoot,k,d?.root,l),style:{...w.styles.stateRoot,...c},children:[V(v)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":t,className:m(w.slots.stateIcon,d?.icon),style:w.styles.stateIcon,children:v}):null,V(r)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":t,className:m(w.slots.stateTitle,d?.title),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":t,className:m(w.slots.stateDescription,d?.description),children:n}):null,V(i)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":t,className:m(w.slots.stateActions,d?.actions),children:i}):null]})},"BaseSystemState"));var sf="application/x-monkeys-base-table-column",$c=8;function uf(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(uf,"assignRef");function jr(e,t){if(t!==void 0&&typeof t!="boolean")throw new Error(`BaseTable ${e} must be a boolean.`)}a(jr,"assertBoolean");function Ai(e,t,o){if(t!==void 0&&!o.includes(t))throw new Error(`BaseTable ${e} must be one of ${o.map(r=>`"${r}"`).join(", ")}.`)}a(Ai,"assertEnum");function Uc(e,t){if(t!==void 0&&(typeof t!="string"||t.trim().length===0))throw new Error(`BaseTable ${e} must be a non-empty string when provided.`)}a(Uc,"assertOptionalLabel");function cf(e,t){if(t!==void 0&&typeof t!="function")throw new Error(`BaseTable ${e} must be a function when provided.`)}a(cf,"assertOptionalFunction");function gn(e,t,o={}){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable ${t} must be a finite non-negative number${o.stringAllowed?" or a non-empty CSS size string":""}.`);return}if(!(o.stringAllowed&&typeof e=="string"&&e.trim().length>0))throw new Error(`BaseTable ${t} must be ${o.stringAllowed?"a finite non-negative number or a non-empty CSS size string":"a finite non-negative number"}.`)}}a(gn,"validateCssSizeValue");function $P(e){if(e===void 0)return;if(!Array.isArray(e))throw new Error("BaseTable columns must be an array when provided.");let t=new Set;return e.forEach((o,r)=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error(`BaseTable column at index ${r} must be an object.`);let n=o;if(typeof n.id!="string"||n.id.trim().length===0)throw new Error(`BaseTable column id at index ${r} must be a non-empty string.`);let i=n.id.trim();if(n.id!==i)throw new Error(`BaseTable column id "${n.id}" must not contain surrounding whitespace.`);if(t.has(i))throw new Error(`BaseTable columns contain duplicate id "${i}".`);if(t.add(i),gn(n.width,`column "${i}" width`,{stringAllowed:true}),gn(n.minWidth,`column "${i}" minWidth`,{stringAllowed:true}),gn(n.maxWidth,`column "${i}" maxWidth`,{stringAllowed:true}),typeof n.minWidth=="number"&&typeof n.maxWidth=="number"&&n.minWidth>n.maxWidth)throw new Error(`BaseTable column "${i}" minWidth cannot be greater than maxWidth.`)}),t}a($P,"validateColumns");function jP(e,t){if(e===void 0)return;if(!Array.isArray(e))throw new Error("BaseTable columnOrder must be an array when provided.");let o=new Set;if(e.forEach((r,n)=>{if(typeof r!="string"||r.trim().length===0)throw new Error(`BaseTable columnOrder entry at index ${n} must be a non-empty string.`);let i=r.trim();if(r!==i)throw new Error(`BaseTable columnOrder entry "${r}" must not contain surrounding whitespace.`);if(o.has(i))throw new Error(`BaseTable columnOrder contains duplicate id "${i}".`);if(t&&!t.has(i))throw new Error(`BaseTable columnOrder contains unknown column id "${i}".`);o.add(i);}),t&&o.size!==t.size){let r=[...t].filter(n=>!o.has(n));throw new Error(`BaseTable columnOrder must contain every configured column id; missing ${r.map(n=>`"${n}"`).join(", ")}.`)}}a(jP,"validateColumnOrder");function UP(e,t){if(e!==void 0){if(!e||typeof e!="object"||Array.isArray(e)||![Object.prototype,null].includes(Object.getPrototypeOf(e)))throw new Error("BaseTable columnSizes must be a plain record when provided.");Object.entries(e).forEach(([o,r])=>{let n=o.trim();if(n.length===0)throw new Error("BaseTable columnSizes keys must be non-empty strings.");if(o!==n)throw new Error(`BaseTable columnSizes key "${o}" must not contain surrounding whitespace.`);if(t&&!t.has(n))throw new Error(`BaseTable columnSizes contains unknown column id "${o}".`);gn(r,`columnSizes["${o}"]`);});}}a(UP,"validateColumnSizes");function jc(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":e.closest('[dir="rtl"]')!==null}a(jc,"isRtl");function KP(e,t){if(e.setPointerCapture)try{e.setPointerCapture(t);}catch(o){let r=e.ownerDocument.defaultView?.DOMException;if(r&&o instanceof r&&o.name==="NotFoundError")return;throw o}}a(KP,"setPointerCaptureIfAvailable");var sv=ho.createContext(null);function hn(e){let t=ho.useContext(sv),o=Pe(e);if(t){let n=e===void 0?t.appearance:o;return {...t,theme:e===void 0?t.theme:Ne(n),appearance:n}}let r=Ne(o);return {appearance:o,theme:r,layout:"native",setDraggingColumnId:a(()=>{},"setDraggingColumnId")}}a(hn,"useBaseTableContext");function lv(e){let t=false;return ho.Children.forEach(e,o=>{if(t||!ho.isValidElement(o))return;let r=o.props;if(r.layout==="split-scroll"){t=true;return}r.children&&(t=lv(r.children));}),t}a(lv,"hasSplitScrollTable");function Kc(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(Kc,"toCssSize");function qP(e,t){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable ${t} must be a finite non-negative number when numeric.`);return `${e}px`}if(e.trim().length===0)throw new Error(`BaseTable ${t} must not be an empty CSS size.`);return e}}a(qP,"validateTableCssSize");function lf(e,t,o){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable split-scroll column "${t}" has invalid ${o}. Expected a finite non-negative number.`);return `${e}px`}if(e.trim().length===0)throw new Error(`BaseTable split-scroll column "${t}" has an empty ${o} value.`);return e}}a(lf,"validateCssSize");function av(e,t,o){if(!(e===void 0||typeof e!="number")){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable split-scroll column "${t}" has invalid ${o}. Expected a finite non-negative number.`);return e}}a(av,"validateNumericSize");function YP(e,t){if(!e?.length)throw new Error('BaseTable layout="split-scroll" requires at least one column definition.');let o=new Set;return `${e.map((n,i)=>{let s=n.id.trim();if(!s)throw new Error(`BaseTable split-scroll column at index ${i} requires a non-empty id.`);if(o.has(s))throw new Error(`BaseTable layout="split-scroll" received duplicate column id "${s}".`);o.add(s);let l=t?.[s],d=av(n.minWidth,s,"minWidth"),c=av(n.maxWidth,s,"maxWidth");if(d!==void 0&&c!==void 0&&c<d)throw new Error(`BaseTable split-scroll column "${s}" has maxWidth smaller than minWidth.`);let p=lf(n.minWidth,s,"minWidth"),u=lf(n.maxWidth,s,"maxWidth"),g=l!==void 0?ia(l,d,c):n.width,f=lf(g,s,"width");return f||`minmax(${p??"0px"}, ${u??"1fr"})`}).join(" ")} var(--base-table-split-scrollbar-gutter)`}a(YP,"buildSplitColumnTemplate");function ia(e,t,o){let r=t??48,n=o??Number.POSITIVE_INFINITY;return Math.min(Math.max(e,r),n)}a(ia,"clampWidth");function df(e,t,o){if(!e||t===o)return;let r=e.indexOf(t),n=e.indexOf(o);if(r<0||n<0)return;let i=[...e],[s]=i.splice(r,1);return i.splice(n,0,s),i}a(df,"getNextColumnOrder");function XP(e){switch(e){case "asc":return "ascending";case "desc":return "descending";default:return}}a(XP,"sortAriaValue");function QP(e){switch(e){case "center":return "center";case "right":return "flex-end";default:return "flex-start"}}a(QP,"getSplitHeadJustifyContent");function ZP(e){switch(e){case "top":return "flex-start";case "bottom":return "flex-end";default:return "center"}}a(ZP,"getSplitHeadAlignItems");function JP({direction:e,className:t}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:m(t,e==="desc"&&"rotate-180",(!e||e==="none")&&"opacity-45"),children:"\u25B2"})}a(JP,"SortIndicator");function eE(){return jsxRuntime.jsxs("span",{"aria-hidden":"true",className:"grid gap-0.5",children:[jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"}),jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"}),jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"})]})}a(eE,"DragHandleIcon");var Bi=ho.forwardRef(a(function({appearance:t,attachedFooter:o=false,children:r,className:n,classNames:i,style:s,...l},d){jr("attachedFooter",o);let c=Pe(t),p=ke(),u=Ne(c),f=lv(r)?{overflow:"hidden",scrollbarGutter:"auto"}:void 0;return jsxRuntime.jsx("div",{...p,...l,ref:d,"data-monkeys-component":"table-container","data-slot":"container","data-base-table-container":"","data-attached-footer":o?"":void 0,className:m(u.slots.tableContainer,o&&u.slots.tableContainerFooterAttached,i?.root,n),style:{...u.styles.tableContainer,...o?u.styles.tableContainerFooterAttached:void 0,...f,...s},children:r})},"BaseTableContainer")),Li=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,layout:i="native",columns:s,bodyMaxHeight:l,bodyClassName:d,columnOrder:c,columnSizes:p,columnDragEnabled:u=false,columnResizeEnabled:g=false,onColumnOrderChange:f,onColumnSizeChange:b,...x},y){Ai("layout",i,["native","split-scroll"]),jr("columnDragEnabled",u),jr("columnResizeEnabled",g),cf("onColumnOrderChange",f),cf("onColumnSizeChange",b),gn(l,"bodyMaxHeight",{stringAllowed:true});let k=$P(s);jP(c,k),UP(p,k);let w=Pe(t),v=ke(),h=Ne(w),[S,T]=ho.useState(),C=ho.useRef(null),R=ho.useRef(null),M=i==="split-scroll",I=M?YP(s,p):void 0,B={appearance:w,theme:h,layout:i,columnTemplate:I,bodyMaxHeight:l,bodyClassName:d,splitHeaderRef:C,splitFooterRef:R,columnOrder:c,columnSizes:p,columnDragEnabled:u,columnResizeEnabled:g,onColumnOrderChange:f,onColumnSizeChange:b,draggingColumnId:S,setDraggingColumnId:T};return jsxRuntime.jsx(sv.Provider,{value:B,children:jsxRuntime.jsx("table",{...v,...x,ref:y,"data-monkeys-component":"table","data-slot":"root","data-base-table-layout":i,className:m(h.slots.tableRoot,M&&h.slots.tableSplitRoot,r?.root,o),style:{...h.styles.table,...M?h.styles.tableSplitRoot:void 0,...I?{"--base-table-column-template":I}:void 0,...n}})})},"BaseTable")),Wi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{layout:l,splitHeaderRef:d,theme:c}=hn(t),p=l==="split-scroll";return jsxRuntime.jsx("thead",{...i,ref:a(g=>{d&&(d.current=p?g:null),uf(s,g);},"setHeaderRef"),"data-slot":"header",className:m(c.slots.tableHeader,p&&c.slots.tableSplitHeader,r?.root,o),style:{...c.styles.tableHeader,...p?c.styles.tableSplitHeader:void 0,...n}})},"BaseTableHeader")),zi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,onScroll:n,style:i,...s},l){let{bodyClassName:d,bodyMaxHeight:c,layout:p,splitFooterRef:u,splitHeaderRef:g,theme:f}=hn(t),b=p==="split-scroll";return jsxRuntime.jsx("tbody",{...s,ref:l,"data-slot":"body",onScroll:b?y=>{let k=y.currentTarget.scrollLeft;g?.current&&(g.current.scrollLeft=k),u?.current&&(u.current.scrollLeft=k),n?.(y);}:n,className:m(f.slots.tableBody,b&&f.slots.tableSplitBody,b&&d,r?.root,o),style:{...f.styles.tableBody,...b?f.styles.tableSplitBody:void 0,...b&&c!==void 0?{maxHeight:qP(c,"bodyMaxHeight")}:void 0,...i}})},"BaseTableBody")),dv=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{layout:l,splitFooterRef:d,theme:c}=hn(t),p=l==="split-scroll";return jsxRuntime.jsx("tfoot",{...i,ref:a(g=>{d&&(d.current=p?g:null),uf(s,g);},"setFooterRef"),"data-slot":"footer",className:m(c.slots.tableFooter,p&&c.slots.tableSplitFooter,r?.root,o),style:{...c.styles.tableFooter,...p?c.styles.tableSplitFooter:void 0,...n}})},"BaseTableFooter")),yn=ho.forwardRef(a(function({interactive:t,selected:o,disabled:r,appearance:n,className:i,classNames:s,style:l,...d},c){jr("interactive",t),jr("selected",o),jr("disabled",r);let{layout:p,theme:u}=hn(n),g=p==="split-scroll";return jsxRuntime.jsx("tr",{...d,ref:c,"data-slot":"row","aria-disabled":r||void 0,"data-state":o?"selected":void 0,className:m(u.slots.tableRow,g&&u.slots.tableSplitRow,t&&!r&&u.slots.tableRowInteractive,o&&u.slots.tableRowSelected,r&&u.slots.tableRowDisabled,s?.root,i),style:{...u.styles.tableRow,...g?u.styles.tableSplitRow:void 0,...l}})},"BaseTableRow")),Oi=ho.forwardRef(a(function({presentation:t,columnId:o,align:r,verticalAlign:n,icon:i,label:s,description:l,meta:d,actions:c,trailing:p,sortable:u,sortDirection:g="none",sortLabel:f,onSort:b,draggable:x,dragLabel:y,resizable:k,resizeLabel:w,width:v,minWidth:h,maxWidth:S,appearance:T,className:C,classNames:R,style:M,children:I,onDragOver:B,onDrop:N,...D},E){if(Ai("head presentation",t,["classic-data-grid"]),Ai("head align",r,["left","center","right"]),Ai("head verticalAlign",n,["top","middle","bottom"]),Ai("head sortDirection",g,["asc","desc","none"]),jr("head sortable",u),jr("head draggable",x),jr("head resizable",k),cf("head onSort",b),Uc("head sortLabel",f),Uc("head dragLabel",y),Uc("head resizeLabel",w),o!==void 0&&(typeof o!="string"||o.trim().length===0))throw new Error("BaseTable head columnId must be a non-empty string when provided.");if(gn(v,"head width",{stringAllowed:true}),gn(h,"head minWidth"),gn(S,"head maxWidth"),h!==void 0&&S!==void 0&&h>S)throw new Error("BaseTable head minWidth cannot be greater than maxWidth.");let P=hn(T),{theme:W}=P,H=Ye().table,A=P.layout==="split-scroll",L=t==="classic-data-grid",F=r??(A?"center":"left"),G=n??"middle",$=ho.useRef(null),_=ho.useRef(()=>{}),[z,re]=ho.useState(),Z=a(ce=>{$.current=ce,uf(E,ce);},"setHeadRef"),ae=o&&P.columnSizes?.[o]!==void 0?P.columnSizes[o]:v,ee=!!(o&&x!==false&&(x||P.columnDragEnabled)&&P.columnOrder&&P.onColumnOrderChange),q=!!(o&&k!==false&&(k||P.columnResizeEnabled)&&P.onColumnSizeChange);if(q&&S!==void 0&&S<(h??48))throw new Error("BaseTable resizable head maxWidth cannot be smaller than its effective minWidth.");let U=!!(u||b),X=XP(g),O=V(s)?s:I,K=V(O)||V(l),ne=f??(K?void 0:H.sortColumn({columnId:o?.trim()||void 0})),fe=ee||V(i)||V(s)||V(l)||V(d)||V(c)||V(p)||U,he=L?jsxRuntime.jsx("div",{className:m("flex h-full min-w-0 select-none items-center",F==="center"?"justify-center":F==="right"?"justify-end":"justify-start",ee&&"cursor-grab active:cursor-grabbing"),...ee?{draggable:true,role:"button",tabIndex:0,"aria-disabled":false,"aria-roledescription":"sortable",onKeyDown:a(ce=>{if(!o||!P.columnOrder||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;let Q=P.columnOrder.indexOf(o);if(Q<0)return;let ge=jc(ce.currentTarget),we=ce.key==="ArrowLeft"?-1:1,Ie=Q+(ge?-we:we),oe=P.columnOrder[Ie];if(!oe)return;let xe=df(P.columnOrder,o,oe);xe&&(ce.preventDefault(),P.onColumnOrderChange?.(xe,{columnId:o,targetColumnId:oe}));},"onKeyDown"),onDragStart:a(ce=>{ce.stopPropagation(),P.setDraggingColumnId(o),ce.dataTransfer.effectAllowed="move",ce.dataTransfer.setData(sf,o);},"onDragStart"),onDragEnd:a(ce=>{ce.stopPropagation(),P.setDraggingColumnId(void 0);},"onDragEnd")}:{},children:O}):fe?jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadContent,R?.content),children:[jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadMain,R?.main),children:[ee?jsxRuntime.jsx("button",{type:"button",draggable:true,title:y,"aria-label":y??H.dragColumn({columnId:o}),className:m(W.slots.tableHeadDragHandle,R?.dragHandle),onClick:ce=>ce.stopPropagation(),onKeyDown:ce=>{if(!o||!P.columnOrder||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;let Q=P.columnOrder.indexOf(o);if(Q<0)return;let ge=jc(ce.currentTarget),we=ce.key==="ArrowLeft"?-1:1,Ie=Q+(ge?-we:we),oe=P.columnOrder[Ie];if(!oe)return;let xe=df(P.columnOrder,o,oe);xe&&(ce.preventDefault(),P.onColumnOrderChange?.(xe,{columnId:o,targetColumnId:oe}));},onDragStart:ce=>{ce.stopPropagation(),P.setDraggingColumnId(o),ce.dataTransfer.effectAllowed="move",ce.dataTransfer.setData(sf,o);},onDragEnd:ce=>{ce.stopPropagation(),P.setDraggingColumnId(void 0);},children:jsxRuntime.jsx(eE,{})}):null,i?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadIcon,R?.icon),children:i}):null,U?jsxRuntime.jsxs("button",{type:"button",disabled:!b,title:f,"aria-label":ne,className:m(W.slots.tableHeadSortButton,R?.sortButton),onClick:ce=>{ce.stopPropagation(),b?.(o);},children:[jsxRuntime.jsxs("span",{className:m(W.slots.tableHeadText,R?.text),children:[V(O)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadLabel,R?.label),children:O}):null,V(l)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadDescription,R?.description),children:l}):null]}),jsxRuntime.jsx(JP,{direction:g,className:m(W.slots.tableHeadSortIcon,R?.sortIcon)})]}):jsxRuntime.jsxs("span",{className:m(W.slots.tableHeadText,R?.text),children:[V(O)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadLabel,R?.label),children:O}):null,V(l)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadDescription,R?.description),children:l}):null]})]}),V(d)||V(c)||V(p)?jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadActions,R?.actions),children:[V(d)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadMeta,R?.meta),children:d}):null,c,p]}):null]}):I,me=a(ce=>{B?.(ce),!(!ee||!P.draggingColumnId||P.draggingColumnId===o)&&(ce.preventDefault(),ce.dataTransfer.dropEffect="move");},"handleDragOver"),ie=a(ce=>{if(N?.(ce),!ee||!o)return;let Q=P.draggingColumnId||ce.dataTransfer.getData(sf);if(!Q||Q===o)return;let ge=df(P.columnOrder,Q,o);ge&&(ce.preventDefault(),P.onColumnOrderChange?.(ge,{columnId:Q,targetColumnId:o})),P.setDraggingColumnId(void 0);},"handleDrop"),be=a(ce=>{if(!q||!o||!P.onColumnSizeChange||ce.button!==0&&ce.pointerType!=="touch")return;ce.preventDefault(),ce.stopPropagation(),_.current();let Q=ce.clientX,ge=He??$.current?.offsetWidth??h??48,we=ia(ge,h,S),Ie=ce.pointerId,oe=ce.currentTarget,xe=oe.ownerDocument,Ve=jc(oe),_e=a(Me=>{if(Me.pointerId!==Ie)return;let Ae=ia(we+(Ve?Q-Me.clientX:Me.clientX-Q),h,S);P.onColumnSizeChange?.(o,Ae,{columnId:o,previousWidth:we,minWidth:h,maxWidth:S});},"handlePointerMove"),Ge=a(Me=>{Me.pointerId===Ie&&_.current();},"handleStop"),le=a(Me=>{Me.pointerId===Ie&&_.current();},"handleLostCapture");_.current=()=>{xe.removeEventListener("pointermove",_e),xe.removeEventListener("pointerup",Ge),xe.removeEventListener("pointercancel",Ge),oe.removeEventListener("lostpointercapture",le),oe.hasPointerCapture?.(Ie)&&oe.releasePointerCapture?.(Ie),_.current=()=>{};},KP(oe,Ie),xe.addEventListener("pointermove",_e),xe.addEventListener("pointerup",Ge),xe.addEventListener("pointercancel",Ge),oe.addEventListener("lostpointercapture",le);},"handleResizePointerDown"),He=typeof ae=="number"?ia(ae,h,S):z,We=He??ia(h??48,h,S),Ke=a(ce=>{if(!q||!o||!P.onColumnSizeChange)return;let Q=jc(ce.currentTarget),ge=He??ia($.current?.offsetWidth||h||48,h,S),we;ce.key==="ArrowLeft"&&(we=ge+(Q?$c:-$c)),ce.key==="ArrowRight"&&(we=ge+(Q?-$c:$c)),ce.key==="Home"&&h!==void 0&&(we=h),ce.key==="End"&&S!==void 0&&(we=S),we!==void 0&&(ce.preventDefault(),ce.stopPropagation(),P.onColumnSizeChange(o,ia(we,h,S),{columnId:o,previousWidth:ge,minWidth:h,maxWidth:S}));},"handleResizeKeyDown");return ho.useEffect(()=>{if(typeof ae=="number"){re(void 0);return}let ce=$.current?.getBoundingClientRect().width;if(ce&&Number.isFinite(ce)){let Q=ia(ce,h,S);re(ge=>ge===Q?ge:Q);}},[ae,h,S,q]),ho.useEffect(()=>(q||_.current(),()=>_.current()),[q,o,P.onColumnSizeChange]),jsxRuntime.jsxs("th",{...D,ref:Z,"data-slot":"head","data-v2-header-drag-id":L&&ee?o:void 0,scope:D.scope??"col","aria-sort":X,className:m(W.slots.tableHead,A&&W.slots.tableSplitHead,F==="center"&&W.slots.tableCellAlignCenter,F==="right"&&W.slots.tableCellAlignRight,L&&"!relative !h-9 !px-3 !align-middle !text-sm !font-medium !text-muted-foreground after:pointer-events-none after:absolute after:bottom-2 after:right-0 after:top-2 after:w-px after:bg-border/50 after:content-['']",R?.root,C),style:{...W.styles.tableHead,...A?W.styles.tableSplitHead:void 0,width:A?void 0:Kc(ae),minWidth:A?void 0:Kc(h),maxWidth:A?void 0:Kc(S),...A?{alignItems:ZP(G),justifyContent:QP(F),textAlign:F}:n?{verticalAlign:n}:void 0,...M},onDragOver:me,onDrop:ie,children:[he,q&&L?jsxRuntime.jsx("div",{"data-column-resize-handle":"true",className:"absolute right-0 top-0 z-20 h-full w-2 cursor-col-resize touch-none select-none hover:bg-muted",onPointerDown:be}):q?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-valuenow":We,"aria-valuemin":h??48,"aria-valuemax":S,"aria-valuetext":`${We}px`,title:w,"aria-label":w??H.resizeColumn({columnId:o}),className:m(W.slots.tableHeadResizeHandle,R?.resizeHandle),onClick:ce=>ce.stopPropagation(),onKeyDown:Ke,onPointerDown:be}):null]})},"BaseTableHead")),Oa=ho.forwardRef(a(function({align:t="left",appearance:o,className:r,classNames:n,style:i,...s},l){Ai("cell align",t,["left","center","right"]);let{layout:d,theme:c}=hn(o),p=d==="split-scroll";return jsxRuntime.jsx("td",{...s,ref:l,"data-slot":"cell",className:m(c.slots.tableCell,p&&c.slots.tableSplitCell,t==="center"&&c.slots.tableCellAlignCenter,t==="right"&&c.slots.tableCellAlignRight,n?.root,r),style:{...c.styles.tableCell,...p?c.styles.tableSplitCell:void 0,...i}})},"BaseTableCell")),cv=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{theme:l}=hn(t);return jsxRuntime.jsx("caption",{...i,ref:s,"data-slot":"caption",className:m(l.slots.tableCaption,r?.root,o),style:{...l.styles.tableCaption,...n}})},"BaseTableCaption")),Fi=ho.forwardRef(a(function({colSpan:t,icon:o,title:r,description:n,actions:i,children:s,appearance:l,className:d,classNames:c,style:p,...u},g){if(!Number.isSafeInteger(t)||t<1)throw new Error("BaseTable empty colSpan must be a positive safe integer.");let{layout:f,theme:b}=hn(l),x=f==="split-scroll",y=V(o)||V(r)||V(n)||V(i);return jsxRuntime.jsx("tr",{...u,ref:g,"data-slot":"empty-row",className:m(b.slots.tableEmptyRow,x&&b.slots.tableSplitRow,c?.row,d),style:{...b.styles.tableEmpty,...x?b.styles.tableSplitRow:void 0,...p},children:jsxRuntime.jsx("td",{colSpan:t,"data-slot":"empty-cell",className:m(b.slots.tableEmptyCell,x&&b.slots.tableSplitCell,c?.cell),style:x?{gridColumn:"1 / -1"}:void 0,children:y?jsxRuntime.jsxs("div",{className:m(b.slots.tableEmptyContent,c?.content),children:[V(o)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyIcon,c?.icon),children:o}):null,V(r)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyTitle,c?.title),children:r}):null,V(n)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyDescription,c?.description),children:n}):null,V(i)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyActions,c?.actions),children:i}):null]}):s})})},"BaseTableEmpty"));function tE({baseClassName:e,className:t,style:o}){let r=Zd();return jsxRuntime.jsx("div",{ref:r.ref,"aria-hidden":"true","data-slot":"loading-skeleton","data-skeleton-animation":r.mode,className:m(e,r.mode==="pulse"&&"animate-pulse motion-reduce:animate-none",t),style:{...r.style,...o}})}a(tE,"BaseTableLoadingSkeleton");function uv({rows:e=3,columns:t,columnWidths:o=[],animated:r=true,animation:n,rowLabel:i,appearance:s,className:l,classNames:d,style:c}){if(!Number.isSafeInteger(e)||e<0)throw new Error("BaseTable loading rows must be a non-negative safe integer.");if(!Number.isSafeInteger(t)||t<1)throw new Error("BaseTable loading columns must be a positive safe integer.");if(!Array.isArray(o))throw new Error("BaseTable loading columnWidths must be an array.");o.forEach((x,y)=>gn(x,`loading columnWidths[${y}]`,{stringAllowed:true})),jr("loading animated",r),Uc("loading rowLabel",i);let{layout:p,theme:u}=hn(s),g=Ye().table,f=i??g.loadingRow,b=p==="split-scroll";return jsxRuntime.jsx(qn,{animation:n,animated:r,children:Array.from({length:e}).map((x,y)=>jsxRuntime.jsx(Qd,{index:y,children:jsxRuntime.jsx("tr",{"data-slot":"loading-row","aria-label":`${f} ${y+1}`,"aria-busy":"true",className:m(u.slots.tableLoadingRow,b&&u.slots.tableSplitRow,d?.row,l),style:{...u.styles.tableLoading,...b?u.styles.tableSplitRow:void 0,...c},children:Array.from({length:t}).map((k,w)=>jsxRuntime.jsx("td",{"data-slot":"loading-cell",className:m(u.slots.tableLoadingCell,b&&u.slots.tableSplitCell,d?.cell),children:jsxRuntime.jsx(tE,{baseClassName:u.slots.tableLoadingSkeleton,className:d?.skeleton,style:{width:Kc(o[w])}})},w))})},y))})}a(uv,"BaseTableLoading");var pv=ho.forwardRef(a(function({appearance:t,leading:o,actions:r,attached:n=true,children:i,className:s,classNames:l,style:d,...c},p){if(typeof n!="boolean")throw new Error("BaseTableFooterBar attached must be a boolean.");let u=Pe(t),g=ke(),f=Ne(u);return jsxRuntime.jsxs("div",{...g,...c,ref:p,"data-monkeys-component":"table-footer-bar","data-slot":"footer-bar","data-base-table-footer-bar":"","data-attached":n?"":void 0,className:m(f.slots.tableFooterBar,n&&f.slots.tableFooterBarAttached,l?.root,s),style:{...f.styles.tableFooterBar,...d},children:[V(o)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarLeading,l?.leading),children:o}):null,V(i)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarContent,l?.content),children:i}):null,V(r)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarActions,l?.actions),children:r}):null]})},"BaseTableFooterBar"));function sE({items:e,value:t,defaultValue:o,orientation:r,activationMode:n}){if(!Array.isArray(e))throw new TypeError("BaseTabs items must be an array.");if(t!==void 0&&typeof t!="string")throw new TypeError("BaseTabs value must be a string.");if(o!==void 0&&typeof o!="string")throw new TypeError("BaseTabs defaultValue must be a string.");if(r!=="horizontal"&&r!=="vertical")throw new TypeError('BaseTabs orientation must be "horizontal" or "vertical".');if(n!=="automatic"&&n!=="manual")throw new TypeError('BaseTabs activationMode must be "automatic" or "manual".');let i=new Set;e.forEach((s,l)=>{if(!s||typeof s!="object")throw new TypeError(`BaseTabs item at index ${l} must be an object.`);if(typeof s.value!="string")throw new TypeError(`BaseTabs item value at index ${l} must be a string.`);if(i.has(s.value))throw new TypeError(`BaseTabs items must use unique values; duplicate value ${JSON.stringify(s.value)} at index ${l}.`);if(s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseTabs item disabled at index ${l} must be a boolean.`);i.add(s.value);});}a(sE,"validateTabsProps");function mf(e,t){return t!==void 0&&e.some(o=>o.value===t&&!o.disabled)?t:e.find(o=>!o.disabled)?.value}a(mf,"getResolvedValue");function lE(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(lE,"toDomId");function dE(e){let t=new Set;return e.map((o,r)=>{let n=lE(o.value),i=n;if(t.has(i))for(i=`${n}-${r}`;t.has(i);)i=`${i}-${r}`;return t.add(i),i})}a(dE,"getDomIdFragments");function cE(e,t){let n=e.currentTarget.ownerDocument.defaultView?.getComputedStyle(e.currentTarget).direction==="rtl";return t==="ArrowRight"?n?-1:1:n?1:-1}a(cE,"getHorizontalStep");var fv=ho.forwardRef(a(function({items:t=[],value:o,defaultValue:r,orientation:n="horizontal",activationMode:i="automatic",appearance:s,className:l,classNames:d,style:c,onValueChange:p,id:u,"aria-label":g,"aria-labelledby":f,...b},x){sE({items:t,value:o,defaultValue:r,orientation:n,activationMode:i});let y=Pe(s),k=ke(),w=Ne(y),v=ho.useId(),h=u??v,S=o!==void 0?o:r,[T,C]=ho.useState(()=>mf(t,r)),[R,M]=ho.useState(()=>mf(t,S)),I=ho.useRef([]),B=o!==void 0,N=mf(t,B?o:T),D=t.findIndex(z=>z.value===N&&!z.disabled),E=D>=0?t[D]:void 0,P=t.reduce((z,re,Z)=>(re.disabled||z.push(Z),z),[]),W=t.findIndex(z=>z.value===R&&!z.disabled),H=W>=0?W:D,A=dE(t),L=E?"active":"disabled",F=typeof b.dir=="string"?b.dir:k.dir,G=a(z=>{z.disabled||(B||C(z.value),p?.(z.value));},"activateItem"),$=a((z,re)=>{let Z=t[re];!Z||Z.disabled||(z.preventDefault(),M(Z.value),I.current[re]?.focus(),i==="automatic"&&G(Z));},"moveFocus"),_=a((z,re,Z)=>{if(re.disabled)return;if(i==="manual"&&(z.key==="Enter"||z.key===" ")){z.preventDefault(),G(re);return}if(P.length===0)return;if(z.key==="Home"){$(z,P[0]);return}if(z.key==="End"){$(z,P[P.length-1]);return}let ae;if(n==="horizontal"&&(z.key==="ArrowLeft"||z.key==="ArrowRight")?ae=cE(z,z.key):n==="vertical"&&z.key==="ArrowUp"?ae=-1:n==="vertical"&&z.key==="ArrowDown"&&(ae=1),ae===void 0)return;let q=(P.indexOf(Z)+ae+P.length)%P.length;$(z,P[q]);},"handleKeyDown");return jsxRuntime.jsxs("div",{...k,...b,ref:x,id:u,"data-monkeys-component":"tabs","data-slot":"root","data-state":L,"data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsRoot,d?.root,l),style:c,children:[jsxRuntime.jsx("div",{...k,dir:F,role:"tablist","aria-label":g,"aria-labelledby":f,"aria-orientation":n,"data-monkeys-component":"tabs","data-slot":"list","data-state":L,"data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsList,n==="vertical"&&"flex-col items-stretch",d?.list),style:w.styles.tabsList,children:t.map((z,re)=>{let Z=A[re],ae=re===D,ee=z.disabled?"disabled":ae?"active":"inactive";return ho.createElement("button",{...k,ref:q=>{I.current[re]=q;},key:z.value,id:`${h}-${Z}-tab`,type:"button",role:"tab",tabIndex:!z.disabled&&re===H?0:-1,"aria-selected":ae,"aria-controls":`${h}-${Z}-panel`,disabled:z.disabled,dir:F,"data-monkeys-component":"tabs","data-slot":"trigger","data-state":ee,"data-orientation":n,"data-activation-mode":i,"data-disabled":z.disabled||void 0,className:m(w.slots.tabsTrigger,ae&&w.slots.tabsTriggerActive,z.disabled&&w.slots.tabsTriggerDisabled,d?.trigger),style:w.styles.tabsTrigger,onFocus:()=>M(z.value),onKeyDown:q=>_(q,z,re),onClick:()=>{M(z.value),G(z);}},jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:z.label}))})}),E?jsxRuntime.jsx("div",{...k,id:`${h}-${A[D]}-panel`,role:"tabpanel",tabIndex:0,"aria-labelledby":`${h}-${A[D]}-tab`,dir:F,"data-monkeys-component":"tabs","data-slot":"panel","data-state":"active","data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsPanel,d?.panel),style:w.styles.tabsPanel,children:V(E.content)?E.content:V(E.description)?jsxRuntime.jsx("p",{className:"m-0 text-muted-foreground",children:E.description}):null}):null]})},"BaseTabs"));var fE={sm:"min-h-20 px-2.5 py-1.5 text-xs leading-5",md:"min-h-24 px-3 py-2 text-sm leading-6",lg:"min-h-28 px-3.5 py-2.5 text-base leading-7"},bv=ho.forwardRef(a(function({invalid:t=false,disabled:o=false,readOnly:r=false,controlSize:n,appearance:i,className:s,classNames:l,style:d,"aria-invalid":c,onBlur:p,onChange:u,...g},f){for(let[v,h]of [["invalid",t],["disabled",o],["readOnly",r]])if(typeof h!="boolean")throw new TypeError(`BaseTextarea ${v} must be a boolean.`);if(n!==void 0&&n!=="sm"&&n!=="md"&&n!=="lg")throw new TypeError('BaseTextarea controlSize must be "sm", "md", or "lg".');let b=Pe(i),x=ke(),y=Ne(b),k=Yn(),w=t||k.invalid;return jsxRuntime.jsx("textarea",{...x,...g,ref:f,disabled:o,readOnly:r,"aria-invalid":c??(w||void 0),"data-monkeys-component":"textarea","data-slot":"control","data-size":n,"data-invalid":w||void 0,"data-disabled":o||void 0,"data-readonly":r||void 0,className:m(y.slots.controlWrapper,y.slots.controlBase,y.slots.controlTextarea,w&&y.slots.controlInvalid,o&&y.slots.controlDisabled,r&&y.slots.controlReadOnly,n&&fE[n],l?.control,s),style:{...y.styles.control,...w?y.styles.controlInvalid:void 0,...o?y.styles.controlDisabled:void 0,...d},onBlur:v=>{p?.(v),k.notifyBlur(v.currentTarget.value);},onChange:v=>{u?.(v),k.notifyChange(v.currentTarget.value);}})},"BaseTextarea"));function gv(e,t,o,r,n=false){ho.useEffect(()=>{let i=e.current,s=t.current,l=i?.ownerDocument.defaultView;if(!o||!i||!s||!l?.matchMedia||!s.animate)return;let d=i.closest("button, a, [tabindex]")??i,c=l.matchMedia("(prefers-reduced-motion: reduce)"),p=d.matches(":hover"),u=d.contains(i.ownerDocument.activeElement),g,f=a(()=>{g?.cancel(),g=void 0,delete i.dataset.scrolling;},"stop"),b=a(()=>{f();let h=s.scrollWidth-i.clientWidth;if(c.matches&&!(n&&p)||!p&&!u||h<=1)return;let T=h/64*1e3,C=160,R=T+C*2;g=s.animate([{transform:"translateX(0)",offset:0},{transform:"translateX(0)",offset:C/R},{transform:`translateX(-${h}px)`,offset:1-C/R},{transform:`translateX(-${h}px)`,offset:1}],{duration:R,iterations:1/0,direction:"alternate",easing:"linear"}),i.dataset.scrolling="true";},"update"),x=a(()=>{p=true,b();},"enter"),y=a(()=>{p=false,b();},"leave"),k=a(()=>{u=true,b();},"focus"),w=a(h=>{u=h.relatedTarget instanceof l.Node&&d.contains(h.relatedTarget),b();},"blur"),v=l.ResizeObserver?new l.ResizeObserver(b):void 0;return v?.observe(i),v?.observe(s),d.addEventListener("pointerenter",x),d.addEventListener("pointerleave",y),d.addEventListener("focusin",k),d.addEventListener("focusout",w),c.addEventListener("change",b),b(),()=>{f(),v?.disconnect(),d.removeEventListener("pointerenter",x),d.removeEventListener("pointerleave",y),d.removeEventListener("focusin",k),d.removeEventListener("focusout",w),c.removeEventListener("change",b);}},[e,t,o,r,n]);}a(gv,"useOverflowMotion");var xE=ho.forwardRef(a(function({as:t="p",children:o,size:r="md",tone:n="default",overflowMotion:i,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Pe(s),f=ke(),b=Ne(g),x=ho.useRef(null),y=ho.useRef(null),k=i==="hover-scroll"||i==="hover-scroll-always",w=ho.useCallback(v=>{x.current=v,typeof u=="function"?u(v):u&&(u.current=v);},[u]);return gv(x,y,k,o,i==="hover-scroll-always"),ho.createElement(t,{...f,...p,ref:w,"data-monkeys-component":"text","data-slot":"root","data-size":r,"data-tone":n,className:m(b.slots.textRoot,zd(b,r),fi(b,n),d?.root,l),style:{...b.styles.text,...k?{display:"block",minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{},...c}},k?ho.createElement("span",{ref:y,style:{display:"inline-block",whiteSpace:"nowrap"}},o):o)},"BaseText"));function xv({leading:e,title:t,description:o,actions:r,children:n,appearance:i,className:s,classNames:l,style:d,...c}){let p=Ne(i),u=V(t)||V(o);return jsxRuntime.jsxs("div",{...c,className:m(p.slots.toolbarRoot,l?.root,s),style:{...p.styles.toolbar,...d},children:[jsxRuntime.jsxs("div",{className:m(p.slots.toolbarLeading,l?.leading),children:[V(e)?e:null,u?jsxRuntime.jsxs("div",{className:m(p.slots.toolbarContent,l?.content),children:[V(t)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarTitle,l?.title),children:t}):null,V(o)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarDescription,l?.description),children:o}):null]}):null]}),V(n)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarContent,l?.content),children:n}):null,V(r)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarActions,l?.actions),children:r}):null]})}a(xv,"BaseToolbar");var wE=ho.forwardRef(a(function({children:t,focusable:o=false,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);if(typeof o!="boolean")throw new TypeError("BaseVisuallyHidden focusable must be a boolean.");return jsxRuntime.jsx("span",{...p,...l,ref:d,"data-monkeys-component":"visually-hidden","data-slot":"root","data-focusable":o||void 0,className:m(u.slots.visuallyHiddenRoot,o&&u.slots.visuallyHiddenFocusable,i?.root,n),style:{...u.styles.visuallyHidden,...s},children:t})},"BaseVisuallyHidden"));var vv;function CE(){return vv??(vv=import('@inf-monkeys-tech/monkeys-design/icons/catalog').catch(e=>{throw vv=void 0,e}))}a(CE,"loadCatalog");async function SE(){return (await CE()).records}a(SE,"loadIconRecords");async function wv(e){let t=e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").replace(/\s+/g,"-").toLowerCase();return (await SE())[t]?.svg}a(wv,"resolveAssetIconNodes");var RE={oneOf:[{type:"object",additionalProperties:false,required:["kind","src"],properties:{kind:{const:"image"},src:{type:"string",minLength:1,maxLength:4096}}},{type:"object",additionalProperties:false,required:["kind","value"],properties:{kind:{const:"emoji"},value:{type:"string",minLength:1,maxLength:64},backgroundColor:{type:"string",maxLength:128}}},{type:"object",additionalProperties:false,required:["kind","name"],properties:{kind:{const:"lucide"},name:{type:"string",minLength:1,maxLength:128}}}]},Tv={path:["d"],circle:["cx","cy","r"],rect:["x","y","width","height","rx","ry"],polyline:["points"],line:["x1","x2","y1","y2"],ellipse:["cx","cy","rx","ry"],polygon:["points"]};function Nv(e){if(!Array.isArray(e)||!e.length||e.length>256)return;let t=[];for(let o of e){if(!Array.isArray(o)||o.length!==2||typeof o[0]!="string"||!Object.prototype.hasOwnProperty.call(Tv,o[0]))return;let r=o[0],n=o[1];if(!n||typeof n!="object"||Array.isArray(n)||Object.getPrototypeOf(n)!==Object.prototype)return;let i={};for(let[s,l]of Object.entries(Object.getOwnPropertyDescriptors(n))){if(!("value"in l)||typeof l.value!="string")return;let d=l.value;if(s==="key"){if(d.length>256)return}else if(s==="fill"){if(d!=="currentColor"&&d!=="none")return}else if(Tv[r].includes(s)){if(s==="d"){if(!d.length||d.length>8192||!/^[MmZzLlHhVvCcSsQqTtAa0-9eE+.,\s-]+$/.test(d))return}else if(s==="points"){if(!d.length||d.length>8192||!/^[0-9eE+.,\s-]+$/.test(d))return}else if(!d.trim()||d.length>128||!Number.isFinite(Number(d)))return}else return;i[s]=d;}t.push([r,i]);}return t}a(Nv,"parseAssetIconNodes");var bf=ho.forwardRef(a(function({icon:t,alt:o,normalizeImageIcon:r=false,className:n,style:i,...s},l){let d=ke(),c=am()??wv,p=fh(),u=t.kind==="image"?t.src:void 0,[g,f]=ho.useState();ho.useEffect(()=>{if(!u||!p)return;let v=new AbortController;return Promise.resolve().then(()=>p(u,v.signal)).then(h=>{v.signal.aborted||f({reference:u,resolver:p,src:pn(h,"media")});}).catch(()=>{v.signal.aborted||f({reference:u,resolver:p});}),()=>v.abort()},[u,p]);let b=p?g&&g.reference===u&&g.resolver===p?g.src:void 0:pn(u,"media"),x=t.kind==="lucide"?t.name:void 0,[y,k]=ho.useState();ho.useEffect(()=>{let v=true;return x&&c&&Promise.resolve().then(()=>c(x)).then(h=>{v&&k({name:x,resolver:c,nodes:Nv(h)});}).catch(()=>{v&&k({name:x,resolver:c,nodes:void 0});}),()=>{v=false;}},[x,c]);let w=y?.name===x&&y?.resolver===c?y?.nodes:void 0;return jsxRuntime.jsx("div",{...d,...s,ref:l,role:"img","aria-label":o,className:m("monkeys-asset-icon flex h-11 w-11 shrink-0 items-center justify-center rounded-xl text-muted-foreground",t.kind==="emoji"?"text-2xl":t.kind==="image"&&!r?"overflow-hidden border":"bg-muted",n),style:{...t.kind==="emoji"&&t.backgroundColor?{backgroundColor:t.backgroundColor}:{},...i},children:t.kind==="image"?b?jsxRuntime.jsx("img",{src:b,alt:"","aria-hidden":"true",loading:"lazy",className:r?"h-5 w-5 object-contain":"h-full w-full object-cover"}):jsxRuntime.jsx(lucideReact.Wrench,{"aria-hidden":"true",className:"h-5 w-5 max-h-full max-w-full"}):t.kind==="emoji"?jsxRuntime.jsx("span",{"aria-hidden":"true",children:t.value}):w?jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5 max-h-full max-w-full",children:w.map(([v,h],S)=>{let{key:T,...C}=h;return ho.createElement(v,{...C,key:T??S})})}):jsxRuntime.jsx(lucideReact.Wrench,{"aria-hidden":"true",className:"h-5 w-5 max-h-full max-w-full"})})},"BaseAssetIcon"));function Dv(e){try{let t=new URL(e.trim());return ["http:","https:"].includes(t.protocol)?t.href:void 0}catch{return}}a(Dv,"imageLink");function Ev({accept:e,multiple:t=false,disabled:o=false,busy:r=false,title:n="Upload files",description:i,hint:s,busyLabel:l="Uploading...",icon:d,inputProps:c,className:p,classNames:u,onFilesSelected:g,renderPreview:f,replaceLabel:b,clearLabel:x,pasteLabel:y,renderActions:k,onClear:w,onChoose:v,onPasteClick:h,onUrlSelected:S,onInputError:T}){let C=f?.(),R=k?.(),M=ho.useRef(null),[I,B]=ho.useState(false),[N,D]=ho.useState(false),E=ho.useRef(true),P=ho.useRef(0),W=o||r,H=ho.useRef({blocked:W,onFilesSelected:g,onUrlSelected:S,onInputError:T});H.current={blocked:W,onFilesSelected:g,onUrlSelected:S,onInputError:T},ho.useEffect(()=>(E.current=true,()=>{E.current=false,P.current++;}),[]),ho.useEffect(()=>{W&&(P.current++,D(false),B(false));},[W]);let A=a(z=>{let re=Array.from(z);!H.current.blocked&&re.length&&H.current.onFilesSelected?.(t?re:re.slice(0,1));},"emitFiles"),L=a(()=>{W||(P.current++,D(false),v?v():M.current?.click());},"choose"),F=a(z=>{if(W)return false;if(z.files.length&&g)return P.current++,D(false),A(z.files),true;let re=Dv(z.getData("text/plain"));return re&&S?(P.current++,D(false),S(re),true):false},"acceptTransfer"),G=a(async()=>{if(W||N)return;let z=++P.current,re=a(()=>E.current&&!H.current.blocked&&z===P.current,"active");D(true);try{if(!navigator.clipboard?.read)throw new Error("Clipboard reading is unavailable.");let Z=await navigator.clipboard.read();for(let ae of Z){let ee=ae.types.find(q=>q.startsWith("image/"));if(ee&&H.current.onFilesSelected){let q=await ae.getType(ee);re()&&A([new File([q],`clipboard.${ee.split("/")[1]}`,{type:ee})]);return}}for(let ae of Z){if(!ae.types.includes("text/plain"))continue;let ee=Dv(await(await ae.getType("text/plain")).text());if(ee&&H.current.onUrlSelected){re()&&H.current.onUrlSelected(ee);return}}re()&&H.current.onInputError?.("empty-clipboard");}catch{re()&&H.current.onInputError?.("clipboard-unavailable");}finally{E.current&&z===P.current&&D(false);}},"paste"),$=a((z,re,Z)=>z?jsxRuntime.jsx("span",{"data-slot":Z,className:j("max-w-full [overflow-wrap:anywhere]",re),children:z}):null,"renderText"),_=a((z,re,Z)=>z?jsxRuntime.jsx(To,{content:z,portal:true,children:jsxRuntime.jsx(mt,{label:z,iconOnly:true,icon:re,disabled:W||N,onClick:Z})}):null,"action");return jsxRuntime.jsxs("div",{"data-monkeys-component":"data-explorer-upload-surface","data-state":r?"busy":I?"dragging":"idle",className:j("grid min-w-0 gap-global rounded-[var(--radius)] border border-border bg-muted/20 p-global transition-colors",!C&&"border-dashed",I&&"border-primary bg-primary/5",W&&"opacity-60",u?.root,p),tabIndex:W?-1:0,onPaste:z=>{F(z.clipboardData)&&(z.preventDefault(),z.stopPropagation());},onDragEnter:z=>{z.preventDefault(),W||B(true);},onDragOver:z=>z.preventDefault(),onDragLeave:z=>{z.relatedTarget instanceof Node&&z.currentTarget.contains(z.relatedTarget)||B(false);},onDrop:z=>{z.preventDefault(),B(false),F(z.dataTransfer)&&z.stopPropagation();},children:[!v&&jsxRuntime.jsx("input",{...c,ref:M,className:"sr-only",type:"file",accept:e,multiple:t,disabled:W,onChange:z=>{P.current++,D(false),A(z.target.files??[]),z.target.value="";}}),C?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ms,{aspectRatio:"video",className:"rounded-[var(--radius)] bg-background",children:C}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-token-sm",children:[_(b,jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-4 w-4"}),L),_(y,jsxRuntime.jsx(lucideReact.Clipboard,{className:"h-4 w-4"}),h??G),w&&_(x,jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),()=>{P.current++,D(false),w();}),R]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",className:j("flex min-w-0 flex-col items-center gap-token-sm rounded-[var(--radius)] py-global text-center focus-visible:outline focus-visible:outline-primary",u?.button),disabled:W,onClick:L,children:[jsxRuntime.jsx("span",{className:j("text-muted-foreground",u?.icon),children:d??jsxRuntime.jsx(lucideReact.UploadCloud,{className:"h-8 w-8","aria-hidden":true})}),$(r?l:n,j("text-sm font-medium text-foreground",u?.title),"title"),$(i,j("text-xs text-muted-foreground",u?.description),"description"),$(s,j("text-xs text-muted-foreground",u?.hint),"hint")]}),y&&jsxRuntime.jsx(mt,{label:y,icon:jsxRuntime.jsx(lucideReact.Clipboard,{className:"h-4 w-4"}),disabled:W||N,onClick:h??G,className:"w-full"}),R]})]})}a(Ev,"DataExplorerUploadSurface");function PE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"7"}),jsxRuntime.jsx("path",{d:"m20 20-3.5-3.5"})]})}a(PE,"DefaultSearchIcon");function Av({rootRef:e,dataAttributes:t,context:o,leading:r,leadingActions:n,searchVisible:i=true,searchValue:s="",searchPlaceholder:l="Search data...",searchIcon:d,viewOptions:c=[],activeViewId:p,actions:u,toolbarActions:g,appearance:f,children:b,className:x,classNames:y,onSearchChange:k,onSearchSubmit:w,onViewChange:v}){let h=a(C=>{C.preventDefault(),w?.(s);},"handleSubmit"),S=Et(f),T=Ct(S);return jsxRuntime.jsxs("div",{ref:e,...t,className:j(T.slots.toolbarRoot,y?.root,x),style:T.styles.toolbarRoot,children:[r||n?.length?jsxRuntime.jsxs("div",{className:j(T.slots.toolbarLeading,y?.leading),children:[r,n?.length?jsxRuntime.jsx(sn,{context:o,actions:n,layout:"inline",appearance:S,classNames:{action:y?.action,menuContent:y?.menuContent,menuItem:y?.menuItem}}):null]}):null,i?jsxRuntime.jsxs("form",{className:j(T.slots.toolbarSearch,y?.search),style:T.styles.toolbarSearch,onSubmit:h,children:[jsxRuntime.jsx("span",{className:j(T.slots.toolbarSearchIcon,y?.searchIcon),children:d??jsxRuntime.jsx(PE,{})}),jsxRuntime.jsx("input",{value:s,placeholder:l,className:j(T.slots.toolbarSearchInput,y?.searchInput),onChange:C=>k?.(C.currentTarget.value)})]}):null,c.length>0?jsxRuntime.jsx("div",{className:j(T.slots.toolbarViewSwitch,y?.viewSwitch),style:T.styles.toolbarViewSwitch,children:c.map(C=>{let R=C.id===p;return jsxRuntime.jsxs("button",{type:"button",disabled:C.disabled,className:j(T.slots.toolbarViewButton,R&&T.slots.toolbarViewButtonActive,y?.viewButton),onClick:()=>v?.(C.id),children:[C.icon,C.label?jsxRuntime.jsx("span",{children:C.label}):null]},C.id)})}):null,g?.length?jsxRuntime.jsx(sn,{context:o,actions:g,layout:"toolbar",appearance:f,classNames:{root:y?.actions,action:y?.action,menuContent:y?.menuContent,menuItem:y?.menuItem}}):u||b?jsxRuntime.jsxs("div",{className:j(T.slots.toolbarActions,y?.actions),children:[u,b]}):null]})}a(Av,"DataExplorerToolbarShell");function EE(e){if(!e||typeof e!="object")return;let t=e.children;return Array.isArray(t)?t:void 0}a(EE,"defaultGetChildren");function Bv({nodes:e=[],context:t,capabilities:o,className:r,classNames:n,empty:i,selectedNodeId:s,getNodeId:l,getChildren:d=EE,renderNode:c,onSelect:p}){let u=Array.isArray(e)?e:[],g=a((f,b)=>f.map((x,y)=>{let k=l?l(x,y):`${b}-${y}`,w=d(x,y,b)??[],v=w.length>0,h=String(s??"")===String(k),S=v?g(w,b+1):null;return c?jsxRuntime.jsx("div",{className:"min-w-0",children:c({node:x,index:y,depth:b,context:t,capabilities:o,childNodes:w,hasChildren:v,selected:h,onSelect:p,renderChildren:a(()=>S,"renderChildren")})},k):S}),"renderTreeNodes");return u.length===0?i?jsxRuntime.jsx("div",{className:j(n?.empty),children:i}):null:jsxRuntime.jsx("div",{className:j("min-w-0",n?.root,r),children:g(u,0)})}a(Bv,"DataExplorerTree");function Lv({title:e,subtitle:t,toolbar:o,footer:r,children:n,appearance:i,className:s,classNames:l}){let d=Ct(Et(i)),c=!!e||!!t||!!o;return jsxRuntime.jsxs("section",{className:j(d.slots.treeShellRoot,l?.root,s),children:[c?jsxRuntime.jsxs("div",{className:j(d.slots.treeShellHeader,l?.header),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e?jsxRuntime.jsx("div",{className:j(d.slots.treeShellTitle,l?.title),children:e}):null,t?jsxRuntime.jsx("div",{className:j(d.slots.treeShellSubtitle,l?.subtitle),children:t}):null]}),o?jsxRuntime.jsx("div",{className:j(d.slots.treeShellToolbar,l?.toolbar),children:o}):null]}):null,jsxRuntime.jsx("div",{className:j(d.slots.treeShellBody,l?.body),children:n}),r?jsxRuntime.jsx("div",{className:j(d.slots.treeShellFooter,l?.footer),children:r}):null]})}a(Lv,"DataExplorerTreeShell");function zv({expanded:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:e?"m6 9 6 6 6-6":"m9 18 6-6-6-6"})})}a(zv,"ChevronIcon");function BE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"12",cy:"5",r:"1"}),jsxRuntime.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}a(BE,"MoreIcon");function LE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"9",cy:"6",r:"1"}),jsxRuntime.jsx("circle",{cx:"9",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"9",cy:"18",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"6",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"18",r:"1"})]})}a(LE,"GripIcon");function Hv(e,t){for(let o of e??[])o.defaultExpanded&&t.add(o.id),Hv(o.children,t);}a(Hv,"collectDefaultExpandedNodeIds");function Ov(e,t){let o=new Set(t??[]);for(let r of e)Hv(r.nodes,o);return o}a(Ov,"buildDefaultNodeExpandedSet");function Fv(e,t){let o=new Set(t??[]);for(let r of e)(r.hideHeader||r.defaultExpanded!==false)&&o.add(r.id);return o}a(Fv,"buildDefaultGroupExpandedSet");function Vv(e,t,o,r){for(let[n,i]of (e??[]).entries())r.set(i.id,{node:i,group:t,parentId:o,index:n}),Vv(i.children,t,i.id,r);}a(Vv,"flattenNodes");function WE(e){let t=new Map;for(let o of e)Vv(o.nodes,o,void 0,t);return t}a(WE,"buildFlattenedNodeMap");function zE(e,t){return [...t??[],...e.actions??[]]}a(zE,"getNodeActions");function OE(e,t){return [...t??[],...e.actions??[]]}a(OE,"getGroupActions");function Jc({groups:e,nodes:t,context:o,selectedNodeId:r,selectedGroupId:n,expandedNodeIds:i,defaultExpandedNodeIds:s,expandedGroupIds:l,defaultExpandedGroupIds:d,resetExpansionKey:c,nodeActions:p,groupActions:u,indentSize:g=16,indentOffset:f=8,actionIcon:b,empty:x,loading:y=false,loadingNode:k,error:w,labels:v,reorderMode:h="none",appearance:S,className:T,classNames:C,onSelectNode:R,onSelectGroup:M,onExpandedNodeIdsChange:I,onExpandedGroupIdsChange:B,onAction:N,onReorderNodes:D}){let E=Ye().dataExplorer.viewTree,P=Ct(Et(S)),W=v?.actions??E.actions,H=v?.expand??E.expand,A=v?.collapse??E.collapse,L=k??v?.loading??E.loading,F=x??v?.empty??E.empty,G=Array.isArray(e),$=ho.useMemo(()=>G?e:[{id:"__root__",hideHeader:true,defaultExpanded:true,nodes:Array.isArray(t)?t:[]}],[e,G,t]),_=ho.useMemo(()=>WE($),[$]),[z,re]=ho.useState(()=>Ov($,s)),[Z,ae]=ho.useState(()=>Fv($,d)),[ee,q]=ho.useState(),[U,X]=ho.useState();ho.useEffect(()=>{re(Ov($,s)),ae(Fv($,d));},[d,s,c]);let O=i!==void 0?new Set(i):z,K=l!==void 0?new Set(l):Z,ne=a((Q,ge)=>{let we=new Set(O);ge?we.add(Q):we.delete(Q),i===void 0&&re(we),I?.([...we]);},"setNodeExpanded"),fe=a((Q,ge)=>{let we=new Set(K);ge?we.add(Q):we.delete(Q),l===void 0&&ae(we),B?.([...we]);},"setGroupExpanded"),he=a((Q,ge)=>ge.type==="node"?{type:"node",action:Q,node:ge.node,group:ge.group,context:o}:{type:"group",action:Q,group:ge.group,context:o},"createActionContext"),me=a((Q,ge)=>{let we=Q.filter(Ie=>{let oe=he(Ie,ge);return Mt(Ie.visible,oe)??true});return we.length===0?null:jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx("button",{type:"button",title:W,"aria-label":W,className:m(P.slots.menuTrigger,ge.type==="group"?P.slots.treeGroupActions:P.slots.treeNodeActions,ge.type==="group"?C?.groupActions:m(C?.nodeActions,C?.itemActions)),onClick:Ie=>Ie.stopPropagation(),children:b??jsxRuntime.jsx(BE,{})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{align:"end",sideOffset:6,className:m(P.slots.menuContent,C?.menuContent),style:P.styles.menuContent,onClick:Ie=>Ie.stopPropagation(),children:we.map(Ie=>{let oe=he(Ie,ge),xe=(Mt(Ie.disabled,oe)??false)||(Mt(Ie.loading,oe)??false),Ve=Mt(Ie.active,oe)??false;return Ie.render?jsxRuntime.jsx("div",{children:Ie.render(oe)},Ie.id):jsxRuntime.jsxs("div",{children:[Ie.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:P.slots.menuSeparator}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:Ie.title,disabled:xe,className:m(P.slots.menuItem,Vn(P,Ie.tone),Ve&&"bg-accent text-accent-foreground",C?.menuItem),style:P.styles.menuItem,onSelect:()=>{xe||(Ie.onAction?.(oe),N?.(oe));},children:[Ie.icon?jsxRuntime.jsx("span",{className:P.slots.menuItemIcon,children:Ie.icon}):null,jsxRuntime.jsx("span",{className:P.slots.menuItemLabel,children:Ie.label})]}),Ie.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:P.slots.menuSeparator}):null]},Ie.id)})})})]})},"renderActions"),ie=a((Q,ge)=>{Q.preventDefault();let we=ee||Q.dataTransfer.getData("application/x-data-explorer-node");if(!we||we===ge.id||!D){q(void 0),X(void 0);return}let Ie=_.get(we),oe=_.get(ge.id);if(!Ie||!oe){q(void 0),X(void 0);return}let xe=Ie.parentId===oe.parentId&&Ie.group?.id===oe.group?.id;if(h==="same-parent"&&!xe){q(void 0),X(void 0);return}let Ve={activeNode:Ie.node,overNode:oe.node,activeGroup:Ie.group,overGroup:oe.group,activeParentId:Ie.parentId,overParentId:oe.parentId,oldIndex:Ie.index,newIndex:oe.index,sameParent:xe,context:o};D(Ve),q(void 0),X(void 0);},"handleDrop"),be=a((Q,ge,we)=>{let Ie=Array.isArray(Q.children)?Q.children:[],oe=Ie.length>0,xe=Q.collapsible===false||O.has(Q.id),Ve=r===Q.id,_e=Q.selectable!==false&&!Q.disabled,Ge=h!=="none"&&!!D&&Q.reorderable!==false,le=ee===Q.id,Me=U===Q.id&&ee!==Q.id,Ae=zE(Q,p);return jsxRuntime.jsxs("div",{"data-data-explorer-entry":"node","data-data-explorer-node-id":Q.id,"data-data-explorer-group-id":ge?.id,className:m(P.slots.treeNode,C?.node,C?.item,Q.className),onDragOver:J=>{!ee||!Ge||(J.preventDefault(),X(Q.id));},onDragLeave:()=>{U===Q.id&&X(void 0);},onDrop:J=>ie(J,Q),children:[jsxRuntime.jsxs("div",{className:m(P.slots.treeNodeButton,Ve&&P.slots.treeNodeSelected,Q.disabled&&P.slots.treeNodeDisabled,le&&P.slots.treeNodeDragging,Me&&"ring-1 ring-primary/30",Ve&&C?.itemSelected,Ve&&C?.nodeSelected,Q.disabled&&C?.nodeDisabled,le&&C?.nodeDragging,C?.nodeButton,C?.itemButton),style:{paddingLeft:`calc(${(Q.indentLevel??we)*g+f}px + var(--data-explorer-tree-group-indent, 0px))`},role:"treeitem","aria-selected":Ve||void 0,"aria-disabled":Q.disabled||void 0,"aria-expanded":oe?xe:void 0,"aria-label":Q.ariaLabel,tabIndex:_e?0:-1,onClick:()=>{_e&&R?.(Q,o);},onKeyDown:J=>{J.target===J.currentTarget&&_e&&(J.key!=="Enter"&&J.key!==" "||(J.preventDefault(),R?.(Q,o)));},children:[Ge?jsxRuntime.jsx("span",{draggable:true,className:m(P.slots.treeNodeDragHandle,C?.nodeDragHandle),onClick:J=>J.stopPropagation(),onDragStart:J=>{J.stopPropagation(),J.dataTransfer.effectAllowed="move",J.dataTransfer.setData("application/x-data-explorer-node",Q.id),q(Q.id);},onDragEnd:()=>{q(void 0),X(void 0);},children:jsxRuntime.jsx(LE,{})}):null,oe?jsxRuntime.jsx("button",{type:"button",className:m(P.slots.treeNodeToggle,C?.nodeToggle,C?.expander),"aria-label":xe?A:H,onClick:J=>{J.stopPropagation(),ne(Q.id,!xe);},children:jsxRuntime.jsx(zv,{expanded:xe})}):jsxRuntime.jsx("span",{className:m(P.slots.treeNodeToggle,C?.nodeToggle)}),Q.icon?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeIcon,C?.nodeIcon,C?.itemIcon),children:Q.icon}):null,jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[jsxRuntime.jsx("span",{className:m(P.slots.treeNodeLabel,C?.nodeLabel,C?.itemLabel),children:Q.label}),Q.description?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeDescription,C?.nodeDescription),children:Q.description}):null]}),Q.meta?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeMeta,C?.nodeMeta),children:Q.meta}):null,Q.badge?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeBadge,C?.nodeBadge),children:Q.badge}):null,me(Ae,{type:"node",node:Q,group:ge})]}),oe&&xe?jsxRuntime.jsx("div",{className:m(P.slots.treeNodeChildren,C?.nodeChildren,C?.list),children:Ie.map(J=>be(J,ge,we+1))}):null]},Q.id)},"renderNode"),He=a((Q,ge,we)=>Q===false?null:jsxRuntime.jsx("div",{className:m(ge,we),children:Q}),"renderPlaceholder");if(y)return jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(L,P.slots.treeLoading,C?.loading)});if(w)return jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(w??v?.error,P.slots.treeError,C?.error)});let We=$.some(Q=>(Q.nodes??[]).length>0),Ke=$.some(Q=>Q.status==="loading"||Q.error);return !We&&!Ke&&(!G||$.length===0)?jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(F,P.slots.treeEmpty,C?.empty)}):jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),role:We||$.some(Q=>!Q.hideHeader)?"tree":void 0,children:$.map(Q=>{let ge=Q.hideHeader||Q.collapsible===false||K.has(Q.id),we=Q.nodes?.length??0,Ie=OE(Q,u),oe=n===Q.id,xe=Q.collapsible!==false;return jsxRuntime.jsxs("section",{"data-data-explorer-entry":"group","data-data-explorer-group-id":Q.id,className:m(P.slots.treeGroup,C?.group,Q.className),children:[Q.hideHeader?null:jsxRuntime.jsxs("div",{role:"treeitem","aria-label":typeof Q.label=="string"?Q.label:void 0,"aria-selected":Q.selectable?oe:void 0,"aria-expanded":xe?ge:void 0,className:m(P.slots.treeGroupHeader,P.slots.treeGroupHeaderButton,oe&&P.slots.treeNodeSelected,C?.groupHeader,C?.groupHeaderButton,oe&&C?.itemSelected),children:[jsxRuntime.jsxs("button",{type:"button",className:m("flex min-w-0 flex-1 items-center gap-2 text-left outline-hidden focus-visible:ring-2 focus-visible:ring-ring",C?.groupLabel),"aria-pressed":Q.selectable?oe:void 0,"aria-expanded":!Q.selectable&&xe?ge:void 0,onClick:()=>{if(Q.selectable){M?.(Q,o);return}xe&&fe(Q.id,!ge);},children:[Q.icon?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeIcon,C?.nodeIcon,C?.itemIcon),children:Q.icon}):null,jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[Q.label?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeLabel,C?.nodeLabel,C?.itemLabel),children:Q.label}):null,Q.description?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeDescription,C?.nodeDescription),children:Q.description}):null]}),Q.meta?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeMeta,C?.nodeMeta),children:Q.meta}):null,Q.badge?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeBadge,C?.nodeBadge),children:Q.badge}):null]}),xe?jsxRuntime.jsx("button",{type:"button",className:m(P.slots.treeNodeToggle,C?.expander),"aria-label":ge?A:H,"aria-expanded":ge,onClick:()=>fe(Q.id,!ge),children:jsxRuntime.jsx(zv,{expanded:ge})}):jsxRuntime.jsx("span",{className:m(P.slots.treeNodeToggle,C?.expander)}),me(Ie,{type:"group",group:Q})]}),ge?jsxRuntime.jsx("div",{role:"group",className:m(P.slots.treeGroupContent,C?.groupContent,C?.list),children:Q.loading||Q.status==="loading"?He(L,P.slots.treeLoading,C?.loading):Q.error||Q.status==="error"?He(Q.error??v?.error??E.error,P.slots.treeError,C?.error):we>0?Q.nodes?.map(Ve=>be(Ve,Q,0)):He(Q.empty??F,P.slots.treeEmpty,C?.empty)}):null]},Q.id)})})}a(Jc,"DataExplorerViewTree");function FE(e,t,o){let r=e.filter(n=>!n.hidden);if(r.length!==0){if(t){let n=r.find(i=>i.id===t);if(n)return n}if(o){let n=r.find(i=>i.id===o);if(n)return n}return r[0]}}a(FE,"resolveActiveViewDefinition");function Gv({items:e,views:t=[],activeViewId:o,fallbackViewId:r,context:n,capabilities:i,className:s,classNames:l,empty:d,loading:c,loadingNode:p,footer:u,overlay:g,layout:f,collection:b,selectedIds:x=[],getItemId:y,itemDefinition:k,renderItem:w,onOpenItem:v,onSelectionChange:h}){let S=Array.isArray(e)?e:[],T=FE(t,o,r),C=T?.id??o??r??"",R=b||T?.collection?{...b,...T?.collection,classNames:{...b?.classNames,...T?.collection?.classNames}}:void 0,M=T?.layout??T?.collection?.layout??f??b?.layout,I=T?.collection?.loading??b?.loading??c,B=T?.collection?.loadingNode??b?.loadingNode??p,N=T?.collection?.footer??b?.footer??u,D=T?.collection?.overlay??b?.overlay??g,E=typeof T?.empty=="function"?T.empty({items:S,activeViewId:C,context:n,capabilities:i,className:s,empty:d,loading:c,loadingNode:p,footer:u,overlay:g,layout:f,collection:R,selectedIds:x,getItemId:y,itemDefinition:k,renderItem:w,onOpenItem:v,onSelectionChange:h}):T?.empty??d,P={items:S,activeViewId:C,context:n,capabilities:i,className:s,empty:E,loading:I,loadingNode:B,footer:N,overlay:D,layout:M,collection:R,selectedIds:x,getItemId:y,itemDefinition:T?.itemDefinition??k,renderItem:T?.renderItem??w,onOpenItem:v,onSelectionChange:h};return T?.render?jsxRuntime.jsx(jsxRuntime.Fragment,{children:T.render(P)}):jsxRuntime.jsx(Ci,{items:S,activeViewId:C,context:n,capabilities:i,className:R?.className??s,classNames:{...l,...R?.classNames},empty:E,loading:P.loading,loadingNode:P.loadingNode,footer:P.footer,overlay:P.overlay,layout:P.layout,scrollable:R?.scrollable,wrapItems:R?.wrapItems,measuredGrid:R?.measuredGrid,itemsStyle:R?.itemsStyle,itemStyle:R?.itemStyle,selectedIds:x,getItemId:y,itemDefinition:P.itemDefinition,renderItem:P.renderItem,getItemClassName:T?.getItemClassName,onOpenItem:v,onSelectionChange:h})}a(Gv,"DataExplorerView");function $v({header:e,footer:t,overlay:o,empty:r,isEmpty:n=false,children:i,className:s,classNames:l}){return jsxRuntime.jsxs("section",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",l?.root,s),children:[e?jsxRuntime.jsx("div",{className:j("shrink-0",l?.header),children:e}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden",l?.body),children:n&&r?jsxRuntime.jsx("div",{className:j("flex h-full items-center justify-center p-6 text-sm text-muted-foreground",l?.empty),children:r}):i}),t?jsxRuntime.jsx("div",{className:j("shrink-0",l?.footer),children:t}):null,o?jsxRuntime.jsx("div",{className:j("absolute inset-0",l?.overlay),children:o}):null]})}a($v,"DataExplorerViewShell");var qs="gap-2 rounded-[var(--radius)] border border-transparent text-sm font-medium motion-reduce:transition-none",Ys="size-[var(--monkeys-component-navigation-sidebar-icon-size,1.125rem)] shrink-0 text-inherit [&_svg]:size-full",yf="text-foreground hover:border-transparent hover:bg-[var(--navigation-internal-hover-background)] hover:text-[var(--navigation-internal-hover-foreground)]",xf="border-[var(--navigation-internal-selected-border)] bg-[var(--navigation-internal-selected-background)] text-[var(--navigation-internal-selected-foreground)] hover:border-[var(--navigation-internal-selected-border)] hover:bg-[var(--navigation-internal-selected-background)] hover:text-[var(--navigation-internal-selected-foreground)]",jv="[--navigation-internal-theme-selected-background:color-mix(in_srgb,hsl(var(--monkeys-color-primary,var(--primary)))_10%,transparent)] [--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-primary,var(--primary)))] dark:[--navigation-internal-theme-selected-background:hsl(var(--monkeys-color-accent,var(--accent)))] dark:[--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-foreground,var(--foreground)))]";function Uv(e){let t={muted:"hsl(var(--monkeys-color-accent,var(--accent)))",soft:"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 10%,transparent)",solid:"hsl(var(--monkeys-color-primary,var(--primary)))",outline:"hsl(var(--monkeys-color-background,var(--background)))"}[e??"muted"];return {"--navigation-internal-default-selected-background":e===void 0?"var(--navigation-internal-theme-selected-background)":t,"--navigation-internal-default-selected-foreground":e===void 0?"var(--navigation-internal-theme-selected-foreground)":e==="solid"?"hsl(var(--monkeys-color-primary-foreground,var(--primary-foreground)))":"hsl(var(--monkeys-color-foreground,var(--foreground)))","--navigation-internal-selected-background":"var(--monkeys-component-navigation-sidebar-row-selected-background,var(--navigation-internal-default-selected-background))","--navigation-internal-selected-foreground":"var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--navigation-internal-default-selected-foreground))","--navigation-internal-selected-border":`var(--monkeys-component-navigation-sidebar-row-selected-border,${e===void 0||e==="muted"?"transparent":e==="soft"?"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 25%,transparent)":e==="outline"?"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 55%,transparent)":"hsl(var(--monkeys-color-primary,var(--primary)))"})`,"--navigation-internal-hover-background":"var(--monkeys-component-navigation-sidebar-row-hover-background,color-mix(in srgb,hsl(var(--monkeys-color-accent,var(--accent))) 65%,transparent))","--navigation-internal-hover-foreground":"var(--monkeys-component-navigation-sidebar-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground))))"}}a(Uv,"unifiedStyle");var _E="[--navigation-internal-selected-background:var(--monkeys-component-navigation-sidebar-row-selected-background,var(--monkeys-component-navigation-sidebar-tree-row-selected-background,var(--navigation-internal-default-selected-background)))] [--navigation-internal-selected-foreground:var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,var(--navigation-internal-default-selected-foreground)))] [--navigation-internal-hover-background:var(--monkeys-component-navigation-sidebar-row-hover-background,var(--monkeys-component-navigation-sidebar-tree-row-hover-background,color-mix(in_srgb,hsl(var(--monkeys-color-accent,var(--accent)))_65%,transparent)))] [--navigation-internal-hover-foreground:var(--monkeys-component-navigation-sidebar-row-hover-foreground,var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground)))))]",GE="aria-selected:border-[var(--navigation-internal-selected-border)] aria-selected:bg-[var(--navigation-internal-selected-background)] aria-selected:text-[var(--navigation-internal-selected-foreground)] aria-selected:hover:border-[var(--navigation-internal-selected-border)] aria-selected:hover:bg-[var(--navigation-internal-selected-background)] aria-selected:hover:text-[var(--navigation-internal-selected-foreground)]",Ks="rounded-[var(--monkeys-component-navigation-sidebar-action-radius,0.25rem)] text-inherit hover:bg-foreground/10 hover:text-inherit focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none";function Kv(e,t,o={}){let r=m(qs,e,t,yf);return {...o,root:m(_E,"space-y-0.5",o.root),group:m("space-y-0.5","[&>[role=treeitem]+[role=group]]:[--data-explorer-tree-group-indent:var(--monkeys-component-navigation-sidebar-tree-group-indent,1rem)]",o.group),groupHeaderButton:m("h-auto",r,o.groupHeaderButton),nodeButton:m(r,GE,o.nodeButton),itemSelected:m(xf,o.itemSelected),nodeIcon:m(Ys,"group-hover/tree-node:text-inherit",o.nodeIcon),nodeLabel:m("font-medium",o.nodeLabel),nodeDescription:m("text-inherit",o.nodeDescription),nodeDisabled:m("opacity-50",o.nodeDisabled),groupActions:m(Ks,"order-2 size-5 p-0 group-focus-within/tree-group:opacity-100",o.groupActions),nodeActions:m(Ks,"order-2 size-5 p-0 group-focus-within/tree-node:opacity-100",o.nodeActions),nodeToggle:m(Ks,"order-1 empty:hidden",o.nodeToggle),expander:m(Ks,"order-1 empty:hidden",o.expander),nodeDragHandle:m(Ks,o.nodeDragHandle)}}a(Kv,"unifiedTreeClassNames");function UE({collapsed:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"none",children:jsxRuntime.jsx("path",{d:e?"M4 4.5h12M4 15.5h12M5 7.5 7.5 10 5 12.5M15 7.5 12.5 10l2.5 2.5":"M4 4.5h12M4 15.5h12M7.5 7.5 5 10l2.5 2.5M12.5 7.5 15 10l-2.5 2.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}a(UE,"CollapseIcon");function KE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"5",stroke:"currentColor",strokeWidth:"1.6"}),jsxRuntime.jsx("path",{d:"m12.2 12.2 3.3 3.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}a(KE,"SearchIcon");function qE(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5",fill:"none",children:jsxRuntime.jsx("path",{d:"m6 6 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}a(qE,"ClearIcon");function YE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"5",cy:"10",r:"1.2"}),jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"1.2"}),jsxRuntime.jsx("circle",{cx:"15",cy:"10",r:"1.2"})]})}a(YE,"MoreIcon");function tu({expanded:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:m("h-4 w-4 transition-transform motion-reduce:transition-none",e&&"rotate-180"),fill:"none",children:jsxRuntime.jsx("path",{d:"m6 8 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}a(tu,"DisclosureIcon");function XE(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(XE,"assignRef");function _i(e,t){if(!Number.isFinite(t))throw new RangeError(`NavigationSidebar ${e} must be a finite number.`)}a(_i,"requireFiniteNumber");function QE(e){let t=e.minWidth??180,o=e.maxWidth??420,r=e.defaultWidth??256,n=e.collapsedWidth??60,i=e.collapseThreshold??140;if(_i("minWidth",t),_i("maxWidth",o),_i("defaultWidth",r),_i("collapsedWidth",n),_i("collapseThreshold",i),t<=0)throw new RangeError("NavigationSidebar minWidth must be greater than zero.");if(o<t)throw new RangeError("NavigationSidebar maxWidth must be greater than or equal to minWidth.");if(n<0)throw new RangeError("NavigationSidebar collapsedWidth cannot be negative.");if(i<0)throw new RangeError("NavigationSidebar collapseThreshold cannot be negative.");return {defaultWidth:r,minWidth:t,maxWidth:o,collapsedWidth:n,collapseThreshold:i}}a(QE,"resolveLayoutBounds");function ou(e,t){return Math.min(Math.max(e,t.minWidth),t.maxWidth)}a(ou,"clampWidth");function Zv(e,t){if(t){t(e);return}typeof console<"u"&&console.warn("NavigationSidebar could not persist layout state.",e);}a(Zv,"reportStorageError");function Jv(e){if(e)return e;if(!(typeof window>"u"))return window.localStorage}a(Jv,"resolveStorage");function ZE(e,t){let o={collapsed:e.defaultCollapsed??false,width:ou(t.defaultWidth,t)};if(!e.storageKey)return o;let r=Jv(e.storage);if(!r)return o;try{let n=r.getItem(e.storageKey);if(!n)return o;let i=JSON.parse(n);return {collapsed:typeof i.collapsed=="boolean"?i.collapsed:o.collapsed,width:typeof i.width=="number"&&Number.isFinite(i.width)?ou(i.width,t):o.width}}catch(n){return Zv(n,e.onStorageError),o}}a(ZE,"readStoredLayout");function wf(e,t){return t||(typeof e=="string"?e:void 0)}a(wf,"getNodeTitle");function JE(e){return e==="solid"?"border-primary bg-primary text-primary-foreground shadow-sm":e==="outline"?"border-primary/55 bg-background text-foreground ring-1 ring-primary/20":e==="muted"?"border-transparent bg-muted text-foreground":"border-primary/25 bg-primary/10 text-foreground"}a(JE,"activeVariantClassName");function eA(e){if(e?.preset!==void 0&&e.preset!=="unified")throw new TypeError(`Unknown NavigationSidebar preset "${e.preset}". Supported preset: unified.`);let t=e?.preset==="unified",o=e?.density??(t?"compact":"default"),r=e?.surface??"panel",n=e?.activeVariant??(t?"muted":"soft");return {unified:t,density:o,surface:r,activeVariant:n,selected:t?xf:JE(n),inactive:t?yf:"text-muted-foreground hover:border-border/70 hover:bg-muted/60 hover:text-foreground",root:m(r==="plain"&&"border-transparent bg-transparent shadow-none",r==="panel"&&"border-border/70 bg-card text-card-foreground shadow-sm",r==="frosted"&&"border-border/55 bg-card/80 text-card-foreground shadow-sm backdrop-blur-xl",r==="outlined"&&"border-border bg-background text-foreground shadow-none",t&&"rounded-[var(--radius)] shadow-none",t&&jv,t&&r==="panel"&&"border-[var(--monkeys-component-navigation-sidebar-border,hsl(var(--monkeys-color-border,var(--border))))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--monkeys-color-card,var(--card))))] text-foreground"),itemHeight:o==="compact"?t?"min-h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]":"min-h-9":o==="comfortable"?"min-h-14":"min-h-11",itemPadding:o==="compact"?t?"px-2 py-2":"px-2 py-1.5":o==="comfortable"?"px-3 py-3":"px-3 py-2",searchHeight:o==="compact"?t?"h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]":"h-8":o==="comfortable"?"h-10":"h-9"}}a(eA,"resolveAppearance");var Qv="hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-hover-background,hsl(var(--muted)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--foreground)))]",tA="bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",Xs="hover:!bg-transparent hover:!text-inherit focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring";function oA(e){return {...e,groupHeader:m(Qv,e?.groupHeader),itemSelected:m(tA,e?.itemSelected),nodeButton:m(Qv,"aria-selected:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] aria-selected:hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",e?.nodeButton),expander:m(Xs,e?.expander),nodeToggle:m(Xs,e?.nodeToggle),groupActions:m(Xs,e?.groupActions),nodeActions:m(Xs,e?.nodeActions),nodeDragHandle:m(Xs,e?.nodeDragHandle)}}a(oA,"resolveNavigationTreeClassNames");function kf({item:e,active:t,collapsed:o,mobile:r,embedded:n=false,appearance:i,classNames:s,domClassName:l}){return m("group/navigation-item relative flex w-full min-w-0 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm outline-hidden transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i.itemHeight,i.itemPadding,i.unified&&qs,n?"min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit":t?i.selected:i.inactive,o&&!r&&"justify-center px-0",e.disabled&&"pointer-events-none opacity-50",s?.item,t&&s?.itemActive,r&&s?.mobileItem,l,e.className)}a(kf,"entryClassName");function Cf({item:e,collapsed:t,mobile:o,classNames:r,endIndicator:n,appearance:i}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(e.icon)?jsxRuntime.jsx("span",{className:m("flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",i.unified&&Ys,r?.itemIcon),"aria-hidden":"true",children:e.icon}):null,o||!t?jsxRuntime.jsxs("span",{className:m("flex min-w-0 flex-1 flex-col",r?.itemContent),children:[jsxRuntime.jsx("span",{className:m("min-w-0 truncate font-semibold",i.unified&&"font-medium",r?.itemLabel),children:e.label}),V(e.description)?jsxRuntime.jsx("span",{className:m("mt-0.5 truncate text-xs font-normal",i.unified&&"text-inherit",r?.itemDescription),children:e.description}):null]}):null,(o||!t)&&V(e.meta)?jsxRuntime.jsx("span",{className:m("shrink-0 text-xs text-muted-foreground",r?.itemMeta),children:e.meta}):null,(o||!t)&&V(e.endContent)?jsxRuntime.jsx("span",{className:m("shrink-0",r?.itemEndContent),children:e.endContent}):null,(o||!t)&&V(n)?jsxRuntime.jsx("span",{className:"flex shrink-0 items-center justify-center",children:n}):null]})}a(Cf,"EntryContent");function ru({item:e,active:t,collapsed:o,itemAs:r,appearance:n,classNames:i,mobile:s=false,embedded:l=false,onSelect:d,ariaControls:c,ariaExpanded:p,endIndicator:u}){let g=r??(e.href?"a":"button"),f=wf(e.label,e.title),b=e.domProps??{},x=a(k=>{if(e.disabled){k.preventDefault();return}e.onClick?.(k),d?.();},"handleClick"),y={...b,...e.to?{to:e.to}:{},...e.href?{href:e.href}:{},...g==="button"?{type:"button",disabled:e.disabled}:{},title:f,"aria-current":t?"page":void 0,"aria-disabled":e.disabled||void 0,"aria-controls":c,"aria-expanded":p,tabIndex:e.disabled?-1:b.tabIndex,onClick:x};return jsxRuntime.jsx(g,{...y,"data-navigation-sidebar-item-id":e.id,"data-active":t?"true":"false","data-expanded":p===void 0?void 0:String(p),className:kf({item:e,active:t,collapsed:o,mobile:s,embedded:l,appearance:n,classNames:i,domClassName:b.className}),children:jsxRuntime.jsx(Cf,{appearance:n,item:e,collapsed:o,mobile:s,classNames:i,endIndicator:u})})}a(ru,"EntryButton");function rA({item:e,appearance:t,classNames:o}){let r=e.domProps??{};return jsxRuntime.jsx("div",{...r,"data-navigation-sidebar-item-id":e.id,"aria-disabled":e.disabled||void 0,title:wf(e.label,e.title),className:kf({item:e,active:false,collapsed:false,mobile:true,embedded:true,appearance:t,classNames:o,domClassName:r.className}),children:jsxRuntime.jsx(Cf,{appearance:t,item:e,collapsed:false,mobile:true,classNames:o})})}a(rA,"EntryPresentation");function nu({active:e,appearance:t}){return m("flex w-full min-w-0 items-center gap-0.5 rounded-[var(--radius)] border border-transparent pr-1 text-sm transition-[background-color,border-color,color,box-shadow] motion-reduce:transition-none",t.itemHeight,t.unified&&qs,e?t.selected:t.inactive)}a(nu,"routeRowClassName");function au(e,t){return t?e.filter(o=>!o.filterIds?.length||o.filterIds.includes(t)):e}a(au,"filterCatalogItems");function nA({props:e,collapsed:t,appearance:o}){let{items:r=[],sections:n=[],filters:i=[],activeFilterId:s,activeItemId:l,onFilterSelect:d,itemAs:c,layout:p="single",empty:u,ariaLabel:g,classNames:f}=e,b=au(r,s),x=n.map(v=>({...v,items:au(v.items,s)})).filter(v=>v.items.length>0),y=b.length>0||x.length>0,k=i.length>0&&!t?jsxRuntime.jsx("div",{role:"group",className:m(p==="split"?"flex min-w-32 flex-col gap-1 border-r border-border/60 pr-2":"flex flex-wrap gap-1",f?.filterList),"aria-label":g?`${g} filters`:void 0,children:i.map(v=>{let h=v.id===s;return jsxRuntime.jsxs("button",{type:"button",title:v.title??(typeof v.label=="string"?v.label:void 0),"aria-pressed":h,disabled:v.disabled,className:m("inline-flex min-h-8 items-center gap-2 rounded-md px-2.5 text-xs font-medium text-muted-foreground outline-hidden transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",h&&"bg-muted text-foreground",f?.filterItem,h&&f?.filterItemActive),onClick:()=>d?.(v),children:[V(v.icon)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:v.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:v.label})]},v.id)})}):null,w=y?jsxRuntime.jsxs("div",{className:m("min-w-0 flex-1",f?.list),children:[b.length>0?jsxRuntime.jsx("ul",{className:"grid list-none gap-1 p-0",children:b.map(v=>jsxRuntime.jsx("li",{children:jsxRuntime.jsx(ru,{item:v,active:v.active??v.id===l,collapsed:t,itemAs:c,appearance:o,classNames:f})},v.id))}):null,x.map(v=>jsxRuntime.jsxs("section",{className:m("mt-3 first:mt-0",f?.section,v.className),children:[!t&&V(v.label)?jsxRuntime.jsx("div",{className:m("mb-1 px-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",f?.sectionLabel,v.labelClassName),children:v.label}):null,jsxRuntime.jsx("ul",{className:"grid list-none gap-1 p-0",children:v.items.map(h=>jsxRuntime.jsx("li",{children:jsxRuntime.jsx(ru,{item:h,active:h.active??h.id===l,collapsed:t,itemAs:c,appearance:o,classNames:f})},h.id))})]},v.id))]}):jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:u});return jsxRuntime.jsxs("nav",{"aria-label":g,className:m(p==="split"&&!t&&"flex min-w-0 gap-2"),children:[k,w]})}a(nA,"CatalogContent");function aA({child:e,parent:t,active:o,interactive:r,onSelect:n,appearance:i,classNames:s,embedded:l=false}){let d=r?"button":"div",c=e.domProps??{};return jsxRuntime.jsxs(d,{...c,...r?{type:"button"}:{},"data-navigation-sidebar-child-id":e.id,"aria-current":r&&o?"page":void 0,"aria-disabled":e.disabled||void 0,title:wf(e.label,e.title),disabled:r?e.disabled:void 0,className:m("flex w-full min-w-0 flex-1 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm font-semibold outline-hidden transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i.itemHeight,i.itemPadding,i.unified&&qs,l?"min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit":o?i.selected:i.inactive,e.disabled&&"pointer-events-none opacity-50",s?.childItem,o&&s?.childItemActive,c.className,e.className),onClick:r&&!e.disabled?()=>n?.(e,t):void 0,children:[V(e.icon)?jsxRuntime.jsx("span",{className:m("flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",i.unified&&Ys),"aria-hidden":"true",children:e.icon}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e.label})]})}a(aA,"ChildEntry");function iu({itemId:e,actions:t,kind:o,className:r,mobile:n=false}){return V(t)?jsxRuntime.jsx("div",{"data-navigation-sidebar-item-actions":o==="item"?e:void 0,"data-navigation-sidebar-child-actions":o==="child"?e:void 0,"data-navigation-sidebar-actions-mobile":n?"true":void 0,className:m("ml-auto flex shrink-0 items-center gap-1 [&>button]:border-0 [&>button]:bg-transparent [&>button]:shadow-none [&>button:hover]:bg-muted",r),children:t}):null}a(iu,"RouteActions");function Sf(e){return e.interaction==="disclosure"}a(Sf,"isDisclosureRouteItem");function iA(e){let t=new Set,o=new Set,r=new Set;for(let n of e){let i=n.id;if(t.has(i))throw new RangeError(`NavigationSidebar route item ids must be unique; received "${i}" more than once.`);if(t.add(i),Sf(n)){if(!n.children.length)throw new RangeError(`NavigationSidebar disclosure item "${n.id}" must include at least one child.`);if(n.href!==void 0||n.to!==void 0||n.onClick!==void 0)throw new TypeError(`NavigationSidebar disclosure item "${i}" cannot define href, to, or onClick.`);r.add(n.id);}else if(n.childrenPresentation==="collapsible"){if(!n.children?.length)throw new RangeError(`NavigationSidebar collapsible route item "${n.id}" must include at least one child.`);r.add(n.id);}for(let l of n.children??[]){if(o.has(l.id))throw new RangeError(`NavigationSidebar route child ids must be unique; received "${l.id}" more than once.`);o.add(l.id);}}return r}a(iA,"validateRouteItems");function sA({item:e,expanded:t,controls:o,label:r,onToggle:n,classNames:i}){let s=typeof e.label=="string"?e.label:e.id;return jsxRuntime.jsx("button",{type:"button",disabled:e.disabled,"aria-expanded":t,"aria-controls":o,"aria-label":`${r}: ${s}`,title:r,"data-navigation-sidebar-disclosure-trigger":e.id,className:m("inline-flex h-8 w-7 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground shadow-none outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",i?.childMenuTrigger),onClick:n,children:jsxRuntime.jsx(tu,{expanded:t})})}a(sA,"RouteChildrenToggle");function su({item:e,activeChildId:t,label:o,onChildSelect:r,classNames:n,appearance:i,triggerVariant:s="submenu",mobile:l=false}){let d=(e.children??[]).filter(g=>!g.disabled);if(!e.children?.length||s==="submenu"&&(!r||d.length===0))return null;let c=typeof e.label=="string"?e.label:e.id,p=!!e.disabled||!r||d.length===0,u=e.domProps??{};return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:s==="item"&&i?jsxRuntime.jsx("button",{...u,type:"button",disabled:p,"aria-label":`${o}: ${c}`,title:o,"data-navigation-sidebar-item-id":e.id,"data-navigation-sidebar-disclosure-menu":"true",className:kf({item:e,active:false,collapsed:!l,mobile:l,appearance:i,classNames:n,domClassName:u.className}),children:jsxRuntime.jsx(Cf,{appearance:i,item:e,collapsed:!l,mobile:l,classNames:n,endIndicator:l?jsxRuntime.jsx(tu,{expanded:false}):void 0})}):jsxRuntime.jsx("button",{type:"button",disabled:s==="disclosure"?p:void 0,"data-navigation-sidebar-disclosure-trigger":s==="disclosure"?e.id:void 0,className:m("inline-flex h-8 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground shadow-none outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",s==="disclosure"?"w-7":"w-6",n?.childMenuTrigger),"aria-label":`${o}: ${c}`,title:o,children:s==="disclosure"?jsxRuntime.jsx(tu,{expanded:false}):jsxRuntime.jsx(YE,{})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{side:"right",align:"start",sideOffset:8,className:m("z-50 min-w-40 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-hidden",n?.childMenuContent),children:e.children?.map(g=>jsxRuntime.jsxs(Bt__namespace.Item,{disabled:g.disabled,"data-navigation-sidebar-child-id":g.id,"data-active":g.id===t?"true":"false",className:m("flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",g.id===t&&"bg-accent text-accent-foreground"),onSelect:()=>r?.(g,e),children:[V(g.icon)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:g.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:g.label})]},g.id))})})]})}a(su,"CollapsedChildMenu");function lA({props:e,collapsed:t,appearance:o}){let{routeItems:r,activeItemId:n,activeChildId:i,expandedItemIds:s,defaultExpandedItemIds:l=[],itemAs:d,onItemSelect:c,onChildSelect:p,onExpandedItemIdsChange:u,collapsedChildMenuLabel:g="Open submenu",disclosureLabel:f="Toggle submenu",ariaLabel:b,classNames:x}=e,y=ho.useId(),k=ho.useMemo(()=>iA(r),[r]),[w,v]=ho.useState(()=>l),h=s!==void 0,S=s??w,T=ho.useMemo(()=>S.filter(M=>k.has(M)),[k,S]),C=ho.useMemo(()=>new Set(T),[T]),R=ho.useCallback(M=>{if(M.disabled||!k.has(M.id))return;let I=C.has(M.id)?T.filter(B=>B!==M.id):[...T,M.id];h||v(I),u?.(I);},[k,C,h,T,u]);return jsxRuntime.jsx("nav",{"aria-label":b,children:jsxRuntime.jsx("ul",{className:m("grid list-none gap-2 p-0",o.unified&&"gap-0.5",x?.list),children:r.map((M,I)=>{let B=Sf(M),N=!B&&M.id===n,D=!!M.children?.length,E=k.has(M.id),P=!E||C.has(M.id),W=!t&&V(M.actions),H=t&&D&&!!p||!t&&E&&!B||W,A=`${y}-route-children-${I}`;return jsxRuntime.jsxs("li",{className:"grid min-w-0 gap-1",children:[t&&B?jsxRuntime.jsx(su,{item:M,activeChildId:i,label:g,onChildSelect:p,classNames:x,appearance:o,triggerVariant:"item"}):jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":H?M.id:void 0,"data-active":H?String(N):void 0,className:H?nu({active:N,appearance:o}):void 0,children:[jsxRuntime.jsx(ru,{item:M,active:N,collapsed:t,embedded:H,itemAs:B?"button":d,appearance:o,classNames:x,onSelect:B?()=>R(M):c?()=>c(M):void 0,ariaControls:!t&&E&&B?A:void 0,ariaExpanded:!t&&E&&B?P:void 0,endIndicator:!t&&B&&!W?jsxRuntime.jsx(tu,{expanded:P}):void 0}),W?jsxRuntime.jsx(iu,{itemId:M.id,actions:M.actions,kind:"item",className:x?.itemActions}):null,t&&p?jsxRuntime.jsx(su,{item:M,activeChildId:i,label:g,onChildSelect:p,classNames:x}):null,!t&&E&&(!B||W)?jsxRuntime.jsx(sA,{item:M,expanded:P,controls:A,label:f,onToggle:()=>R(M),classNames:x}):null]}),!t&&D?jsxRuntime.jsx("ul",{id:A,hidden:!P,style:P?void 0:{display:"none"},className:m("ml-5 grid list-none gap-0.5 border-l border-border/70 py-1 pl-3",o.unified&&"border-border",x?.childList),children:M.children?.map(L=>{let F=V(L.actions),G=L.id===i,$=jsxRuntime.jsx(aA,{child:L,parent:M,active:G,interactive:!!p,onSelect:p,appearance:o,classNames:x,embedded:F});return jsxRuntime.jsx("li",{children:F?jsxRuntime.jsxs("div",{"data-navigation-sidebar-child-row":L.id,"data-active":String(G),className:nu({active:G,appearance:o}),children:[$,jsxRuntime.jsx(iu,{itemId:L.id,actions:L.actions,kind:"child",className:x?.childActions})]}):$},L.id)})}):null]},M.id)})})})}a(lA,"RouteContent");function dA(e,t,o){return [...au(e,o),...t.flatMap(r=>au(r.items,o))]}a(dA,"flattenCatalogItems");function cA({props:e,appearance:t}){if(!e.mobile||e.mobile.mode!=="horizontal")return null;let o=e.classNames,r=e.kind==="catalog"?dA(e.items??[],e.sections??[],e.activeFilterId):e.routeItems;return jsxRuntime.jsx("nav",{"aria-label":e.ariaLabel,className:m("flex gap-2 overflow-x-auto pb-1",o?.mobileNav,e.mobile.className),children:r.map(n=>{let i={...o,mobileItem:m(o?.mobileItem,e.mobile?.itemClassName)},s=e.kind==="route"?n:void 0,l=s!==void 0&&V(s.actions);if(e.kind==="route"&&Sf(n))return l?jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":n.id,"data-active":"false",className:m(nu({active:false,appearance:t}),"shrink-0"),children:[jsxRuntime.jsx(rA,{item:n,appearance:t,classNames:i}),jsxRuntime.jsx(iu,{itemId:n.id,actions:n.actions,kind:"item",className:o?.itemActions,mobile:true}),jsxRuntime.jsx(su,{item:n,activeChildId:e.activeChildId,label:e.collapsedChildMenuLabel??"Open submenu",onChildSelect:e.onChildSelect,classNames:i,appearance:t,triggerVariant:"disclosure",mobile:true})]},n.id):jsxRuntime.jsx(ho.Fragment,{children:jsxRuntime.jsx(su,{item:n,activeChildId:e.activeChildId,label:e.collapsedChildMenuLabel??"Open submenu",onChildSelect:e.onChildSelect,classNames:i,appearance:t,triggerVariant:"item",mobile:true})},n.id);let d=e.kind==="catalog"?n.active??n.id===e.activeItemId:n.id===e.activeItemId,c=jsxRuntime.jsx(ru,{item:n,active:d,collapsed:false,embedded:l,itemAs:e.itemAs,appearance:t,classNames:i,mobile:true,onSelect:e.kind==="route"&&e.onItemSelect?()=>e.onItemSelect?.(n):void 0});return l&&s?jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":n.id,"data-active":String(d),className:m(nu({active:d,appearance:t}),"shrink-0"),children:[c,jsxRuntime.jsx(iu,{itemId:s.id,actions:s.actions,kind:"item",className:o?.itemActions,mobile:true})]},n.id):jsxRuntime.jsx(ho.Fragment,{children:c},n.id)})})}a(cA,"MobileNavigation");function uA(e,t){let o=QE(e);e.width!==void 0&&_i("width",e.width);let r=ho.useRef(null);r.current||(r.current=ZE(e,o));let n=ho.useRef(null),[i,s]=ho.useState(r.current.collapsed),[l,d]=ho.useState(r.current.width),[c,p]=ho.useState(e.search?.defaultValue??""),[u,g]=ho.useState(false),f=e.collapsed??i,b=ou(e.width??l,o),x=e.search?.value??c,y=e.collapsed!==void 0,k=e.width!==void 0,w=ho.useMemo(()=>eA(e.appearance),[e.appearance]),v=e.collapsible??true,h=e.resizable??true,S=v?e.collapsePlacement??"header":"none",T=e.collapseLabel??"Collapse sidebar",C=e.expandLabel??"Expand sidebar",R=e.resizeLabel??"Resize sidebar",M=!f||o.collapsedWidth>0,I=a(H=>{n.current=H,XE(t,H);},"setSidebarRef"),B=ho.useCallback(H=>{!v&&H||(y||s(H),e.onCollapsedChange?.(H));},[v,y,e.onCollapsedChange]),N=ho.useCallback(H=>{let A=ou(H,o);k||d(A),e.onWidthChange?.(A);},[o.maxWidth,o.minWidth,k,e.onWidthChange]);ho.useEffect(()=>{if(!e.storageKey)return;let H=Jv(e.storage);if(H)try{H.setItem(e.storageKey,JSON.stringify({collapsed:f,width:b}));}catch(A){Zv(A,e.onStorageError);}},[e.onStorageError,e.storage,e.storageKey,f,b]),ho.useEffect(()=>{if(!u)return;let H=document.body.style.cursor,A=document.body.style.userSelect,L=a(G=>{let $=n.current;if(!$)return;let _=G.clientX-$.getBoundingClientRect().left;if(v&&_<o.collapseThreshold){B(true);return}B(false),N(_);},"handlePointerMove"),F=a(()=>g(false),"handlePointerUp");return window.addEventListener("pointermove",L),window.addEventListener("pointerup",F),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",F),document.body.style.cursor=H,document.body.style.userSelect=A;}},[o.collapseThreshold,v,u,B,N]);let D=a(H=>{if(!(H.key!=="ArrowLeft"&&H.key!=="ArrowRight")){if(H.preventDefault(),H.key==="ArrowLeft"){let A=b-24;v&&A<o.collapseThreshold?B(true):N(A);return}f&&B(false),N(Math.max(b+24,o.minWidth));}},"handleResizeKeyDown"),E=a(H=>jsxRuntime.jsx("button",{type:"button",className:m("inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-hidden transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",e.classNames?.collapseButton,H),"aria-label":f?C:T,title:f?C:T,"aria-expanded":!f,onClick:()=>B(!f),children:jsxRuntime.jsx(UE,{collapsed:f})}),"collapseButton"),P=V(e.title)||V(e.headerLeading)||V(e.headerActions)||S==="header",W=a(()=>{if(e.kind==="catalog")return jsxRuntime.jsx(nA,{props:e,collapsed:f,appearance:w});if(e.kind==="route")return jsxRuntime.jsx(lA,{props:e,collapsed:f,appearance:w});let H=e.tree;return jsxRuntime.jsx(Jc,{...H,classNames:w.unified?Kv(w.itemHeight,w.itemPadding,H.classNames):oA(H.classNames)})},"renderContent");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("aside",{...e.rootDomProps,ref:I,"aria-label":e.ariaLabel,"data-monkeys-component":e.dataComponent??"navigation-sidebar","data-navigation-sidebar-kind":e.kind,"data-navigation-sidebar-preset":e.appearance?.preset,"data-collapsed":f?"true":"false",className:m("relative flex h-full min-h-0 shrink-0 flex-col overflow-visible rounded-[calc(var(--radius)+0.25rem)] border transition-[width,opacity] duration-300 motion-reduce:transition-none",w.root,e.desktopClassName,e.classNames?.root,e.rootDomProps?.className,e.className),style:{...w.unified?Uv(e.appearance?.activeVariant):{},...e.style,width:e.widthMode==="fill"?void 0:f?o.collapsedWidth:b,transition:u?"none":e.style?.transition},children:[h?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-valuemin":o.minWidth,"aria-valuemax":o.maxWidth,"aria-valuenow":b,"aria-label":R,title:R,className:m("group/resize absolute -right-1.5 bottom-0 top-0 z-40 w-3 cursor-col-resize bg-transparent outline-hidden focus-visible:ring-2 focus-visible:ring-ring",e.classNames?.resizeHandle),onPointerDown:H=>{H.preventDefault(),g(true);},onKeyDown:D,children:jsxRuntime.jsx("span",{className:"pointer-events-none absolute bottom-3 right-1/2 top-3 w-px translate-x-1/2 rounded-full bg-border opacity-0 transition-opacity group-hover/resize:opacity-100 group-focus-visible/resize:opacity-100"})}):null,S==="edge"?E("absolute -right-3 top-1/2 z-50 -translate-y-1/2 border border-border bg-background shadow-sm"):null,M?jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:[P?jsxRuntime.jsxs("div",{className:m("flex min-h-12 min-w-0 items-center gap-2 border-b border-border/60 px-3",w.unified&&"min-h-14 border-border px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))]",f&&"justify-center px-1",e.classNames?.header),children:[V(e.headerLeading)?jsxRuntime.jsx("span",{className:m("flex shrink-0 items-center justify-center",e.classNames?.headerLeading),children:e.headerLeading}):null,!f&&V(e.title)?jsxRuntime.jsx("div",{className:m("min-w-0 flex-1 truncate text-sm font-semibold",e.classNames?.title),children:e.title}):null,!f&&V(e.headerActions)?jsxRuntime.jsx("div",{className:m("flex shrink-0 items-center gap-1",e.classNames?.headerActions),children:e.headerActions}):null,S==="header"?E():null]}):null,!f&&e.search?jsxRuntime.jsx("div",{className:m("px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] pb-2 pt-3",w.unified&&"pb-1",e.classNames?.search),children:jsxRuntime.jsxs("div",{className:m("flex items-center gap-2 rounded-md border border-input bg-[var(--monkeys-component-navigation-sidebar-search-background,hsl(var(--monkeys-color-control-surface)))] px-3 text-muted-foreground ring-offset-control-surface focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",w.searchHeight,w.unified&&"rounded-[var(--radius)] border-border bg-[var(--monkeys-component-navigation-sidebar-search-background,transparent)] px-2"),children:[jsxRuntime.jsx("span",{className:m("flex shrink-0",w.unified&&Ys,e.classNames?.searchIcon),"aria-hidden":"true",children:e.search.icon??jsxRuntime.jsx(KE,{})}),jsxRuntime.jsx("input",{type:"search",value:x,placeholder:e.search.placeholder,"aria-label":e.search.ariaLabel,className:m("min-w-0 flex-1 bg-transparent text-sm text-foreground outline-hidden placeholder:text-muted-foreground",e.classNames?.searchInput),onChange:H=>{let A=H.currentTarget.value;e.search?.value===void 0&&p(A),e.search?.onValueChange?.(A);}}),x&&e.search.clearLabel?jsxRuntime.jsx("button",{type:"button",className:m("inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",e.classNames?.searchClear),"aria-label":e.search.clearLabel,title:e.search.clearLabel,onClick:()=>{e.search?.value===void 0&&p(""),e.search?.onValueChange?.("");},children:jsxRuntime.jsx(qE,{})}):null]})}):null,jsxRuntime.jsx("div",{className:m("min-h-0 flex-1 overflow-y-auto px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] py-3",w.unified&&e.search&&"pt-1",f&&"px-1.5",e.classNames?.content),children:W()}),V(e.footer)||S==="footer"?jsxRuntime.jsxs("div",{className:m("flex shrink-0 items-center gap-2 border-t border-border/70 p-3",w.unified&&"border-border",f&&"justify-center px-1",e.classNames?.footer),children:[!f&&V(e.footer)?jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:e.footer}):null,S==="footer"?E():null]}):null]}):null]}),e.kind!=="tree"?jsxRuntime.jsx(cA,{props:e,appearance:w}):null]})}a(uA,"NavigationSidebarInner");var Gi=ho.forwardRef(uA);var tw=ho.forwardRef(a(function({title:t,items:o,sections:r=[],activeItemId:n,onItemSelect:i,itemAs:s,collapsed:l,defaultCollapsed:d=false,onCollapsedChange:c,width:p,onWidthChange:u,defaultWidth:g=220,minWidth:f=180,maxWidth:b=420,collapsedWidth:x=60,collapseThreshold:y=140,storageKey:k,resizable:w=true,collapsible:v=true,collapseLabel:h="Collapse sidebar",expandLabel:S="Expand sidebar",resizeLabel:T="Resize sidebar",desktopClassName:C="hidden md:flex",mobileClassName:R="flex md:hidden",className:M,classNames:I,style:B,...N},D){let{level:E,variables:P}=Uh(),W=a(H=>({...H,icon:H.icon??(H.iconName?jsxRuntime.jsx(bf,{icon:{kind:"lucide",name:H.iconName},alt:"",className:"h-4 w-4 rounded-none bg-transparent"}):void 0),endContent:H.endContent??(H.count!==void 0?jsxRuntime.jsx(bc,{children:H.count}):void 0),onClick:a(A=>{H.disabled||(H.onClick?.(A),A.defaultPrevented||i?.({itemId:H.id}));},"onClick")}),"project");return jsxRuntime.jsx(um,{depth:E,children:jsxRuntime.jsx(Gi,{ref:D,kind:"catalog",title:t,items:o.map(W),sections:r.map(H=>({...H,items:H.items.map(W)})),activeItemId:n,itemAs:s,collapsed:l,defaultCollapsed:d,onCollapsedChange:c,width:p,onWidthChange:u,defaultWidth:g,minWidth:f,maxWidth:b,collapsedWidth:x,collapseThreshold:y,storageKey:k,resizable:w,collapsible:v,collapsePlacement:"header",collapseLabel:h,expandLabel:S,resizeLabel:T,desktopClassName:C,dataComponent:"workbench-resizable-sidebar",rootDomProps:{...N,"data-workbench-resizable-sidebar":"","data-monkeys-bento-level":E},appearance:{density:"compact",surface:"panel",activeVariant:"soft"},mobile:{mode:"horizontal",className:R},className:m(jh,"[&>div]:gap-[var(--monkeys-bento-gap)] [--monkeys-sidebar-item-padding:var(--monkeys-bento-gap)] data-[collapsed=true]:[--monkeys-sidebar-item-padding:0px]",I?.root,M),classNames:{root:I?.root,header:m("min-h-0 gap-[var(--monkeys-bento-gap)] border-0 p-0",I?.header),title:m("text-xs font-medium uppercase text-muted-foreground",I?.title),collapseButton:m("h-8 w-8",I?.collapseButton),content:m("space-y-[var(--monkeys-bento-gap)] p-0",I?.list),list:"[&_ul]:gap-[var(--monkeys-bento-gap)]",section:m("mt-[var(--monkeys-bento-gap)]",I?.section),sectionLabel:m("mb-[var(--monkeys-bento-gap)] px-[var(--monkeys-bento-gap)]",I?.sectionLabel),item:m("h-auto min-h-9 gap-[var(--monkeys-bento-gap)] rounded-md px-[var(--monkeys-sidebar-item-padding)] py-[calc(var(--monkeys-bento-gap)/2)] text-sm shadow-none",I?.item),itemIcon:m("[&_svg]:h-3.5 [&_svg]:w-3.5",I?.itemIcon),itemLabel:I?.itemLabel,resizeHandle:I?.resizeHandle,mobileNav:m("gap-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] pb-0",I?.mobileNav),mobileItem:m("h-auto min-h-9 w-auto shrink-0 gap-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] px-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] py-[calc(var(--monkeys-bento-gap,var(--global-spacing,0.75rem))/2)] text-sm",I?.mobileItem)},style:{...P,...B}})})},"WorkbenchResizableSidebar"));function fA(e){return !!(e.header||e.footer||e.bodyAs||e.bodyClassName||e.bodyProps||e.classNames?.body)}a(fA,"shouldRenderBodyWrapper");var ow=ho.forwardRef(a(function({as:t="section",bodyAs:o="div",header:r,footer:n,children:i,className:s,headerClassName:l,bodyClassName:d,footerClassName:c,bodyProps:p,classNames:u,style:g,...f},b){let x=fA({header:r,footer:n,bodyAs:o==="div"?void 0:o,bodyClassName:d,bodyProps:p,classNames:u}),{className:y,...k}=p??{};return jsxRuntime.jsxs(t,{ref:b,"data-workbench-content-pane":true,className:m("workbench-surface-subtle flex h-full min-w-0 flex-1 flex-col overflow-hidden rounded-lg border border-border/50 transition-all duration-300 dark:border-border/40",u?.root,s),style:g,...f,children:[r?jsxRuntime.jsx("div",{className:m("shrink-0 border-b border-border/40 px-4 py-3 dark:border-border/30",u?.header,l),children:r}):null,x?jsxRuntime.jsx(o,{className:m("min-h-0 flex-1 overflow-hidden",u?.body,d,y),...k,children:i}):i,n?jsxRuntime.jsx("div",{className:m("shrink-0 border-t border-border/40 px-4 py-3 dark:border-border/30",u?.footer,c),children:n}):null]})},"WorkbenchContentPane"));var aw={settingsButton:"Gallery settings",title:"Gallery settings",visibleColumns:"Visible fields",coverField:"Cover field",autoDetect:"Auto",cardDensity:"Card density",cardColumns:"Cards per row",detailColumns:"Detail columns",fieldVisibility:"Field visibility",fieldLimit:"Field limit",fieldLimitHint:"Uses current field order",layout:"Gallery layout",compact:"Compact",comfortable:"Standard",detailed:"Detailed",autoColumns:"Auto",columns:a(e=>`${e}`,"columns"),bentoColumns:a(e=>`${e}`,"bentoColumns"),topLimit:"First fields",allFields:"All fields",adaptiveGrid:"Grid",masonry:"Masonry"};function sa(e){return String(e?.key||"")}a(sa,"normalizeColumnKey");function yA(e){return e.label??e.key}a(yA,"getDefaultColumnLabel");function xA(e){return e.filter(t=>sa(t)&&t.hidden!==true).map(t=>sa(t))}a(xA,"getDefaultVisibleColumnKeys");function vA({columns:e,visibleColumnKeys:t,allowEmptyVisibleColumns:o}){let r=new Set(e.map(sa).filter(Boolean)),n=Array.isArray(t)?t.filter(i=>r.has(String(i))):null;return n&&(n.length||o)?n:xA(e)}a(vA,"getResolvedVisibleColumnKeys");function wA(e){return [{value:"compact",label:e.compact},{value:"comfortable",label:e.comfortable},{value:"detailed",label:e.detailed}]}a(wA,"getDefaultDensityOptions");function kA(e){return [{value:"auto",label:e.autoColumns},{value:1,label:e.columns(1)},{value:2,label:e.columns(2)},{value:3,label:e.columns(3)},{value:4,label:e.columns(4)}]}a(kA,"getDefaultGridColumnOptions");function CA(e){return [{value:1,label:e.bentoColumns(1)},{value:2,label:e.bentoColumns(2)},{value:3,label:e.bentoColumns(3)}]}a(CA,"getDefaultBentoColumnOptions");function SA(e){return [{value:"limit",label:e.topLimit},{value:"all",label:e.allFields}]}a(SA,"getDefaultDetailVisibilityOptions");function TA(e){return [{value:"fixed",label:e.adaptiveGrid},{value:"masonry",label:e.masonry}]}a(TA,"getDefaultLayoutOptions");function Zs(e){return String(e)}a(Zs,"normalizeOptionValue");function Js(e,t,o){let r=String(t??o);return e.some(n=>String(n.value)===r)?r:String(o)}a(Js,"getOptionValue");function nw(e){let t=Number.parseInt(e,10);return Number.isFinite(t)?t:1}a(nw,"parseNumberOption");var el={root:"flex w-full flex-wrap",item:"min-w-[58px] flex-1 px-2 text-[11px]",label:"text-[11px]"};function Nf({columns:e=[],galleryFieldOptions:t,value:o,onValueChange:r,labels:n,densityOptions:i,gridColumnOptions:s,bentoColumnOptions:l,detailVisibilityOptions:d,layoutOptions:c,getColumnLabel:p=yA,getColumnDescription:u,showColumnVisibility:g=true,showGalleryControls:f=true,showLayoutControl:b=true,showGridColumns:x=true,showDetailColumns:y=true,allowEmptyVisibleColumns:k=false,className:w,classNames:v}){let h={...aw,...n},S=o||{},T=e.filter(F=>sa(F)),C=vA({columns:T,visibleColumnKeys:S.visibleColumnKeys,allowEmptyVisibleColumns:k}),R=new Set(C),M=(t||T).filter(F=>sa(F)),I=i||wA(h),B=s||kA(h),N=l||CA(h),D=d||SA(h),E=c||TA(h),P=typeof r=="function",W=a(F=>{r?.({...S,...F},F);},"updateValue"),H=a(F=>{if(!P)return;let G=new Set(C);G.has(F)?G.delete(F):G.add(F);let $=T.map(sa).filter(_=>G.has(_));!$.length&&!k&&($=[F]),W({visibleColumnKeys:$});},"toggleColumn"),A=g&&T.length>0,L=f;return jsxRuntime.jsxs("div",{className:m("space-y-3 text-foreground",v?.root,w),children:[A?jsxRuntime.jsxs("section",{className:m("space-y-2",v?.section),children:[jsxRuntime.jsx("div",{className:m("text-[10px] font-medium uppercase tracking-wide text-muted-foreground",v?.sectionHeader),children:h.visibleColumns}),jsxRuntime.jsx("div",{className:m("max-h-[220px] space-y-1 overflow-y-auto pr-1",v?.columnList),children:T.map(F=>{let G=sa(F);return jsxRuntime.jsx(vi,{checked:R.has(G),disabled:!P,label:p(F),description:u?.(F),onChange:()=>H(G),className:m("flex w-full rounded-lg px-2 py-1.5 hover:bg-muted/50",v?.columnItem)},`workbench-gallery-column-${G}`)})})]}):null,L?jsxRuntime.jsxs("section",{className:m("space-y-3 border-t border-border/60 pt-3",v?.section),children:[jsxRuntime.jsx(Gr,{label:h.coverField,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(Fc,{value:String(S.galleryFieldKey||"auto"),options:[{value:"auto",label:h.autoDetect},...M.map(F=>({value:sa(F),label:p(F)}))],disabled:!P,onChange:F=>W({galleryFieldKey:F.currentTarget.value||"auto"}),className:v?.control})}),jsxRuntime.jsx(Gr,{label:h.cardDensity,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(I,S.galleryDensity,"comfortable"),options:I.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryDensity:F}),className:m("w-full",v?.control),classNames:el})}),x?jsxRuntime.jsx(Gr,{label:h.cardColumns,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(B,S.galleryGridColumns,"auto"),options:B.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryGridColumns:F==="auto"?"auto":nw(F)}),className:m("w-full",v?.control),classNames:el})}):null,y?jsxRuntime.jsx(Gr,{label:h.detailColumns,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(N,S.galleryBentoColumns,2),options:N.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryBentoColumns:nw(F)}),className:m("w-full",v?.control),classNames:el})}):null,jsxRuntime.jsx(Gr,{label:h.fieldVisibility,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(D,S.galleryDetailVisibility,"limit"),options:D.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryDetailVisibility:F}),className:m("w-full",v?.control),classNames:el})}),S.galleryDetailVisibility!=="all"?jsxRuntime.jsx(Gr,{label:h.fieldLimit,description:h.fieldLimitHint,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground",description:"text-[10px]"},children:jsxRuntime.jsx(Rc,{type:"number",min:1,step:1,value:String(S.galleryDetailLimit||4),disabled:!P,onChange:F=>W({galleryDetailLimit:F.currentTarget.value}),className:v?.control})}):null,b?jsxRuntime.jsx(Gr,{label:h.layout,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(aa,{value:Js(E,S.galleryLayout,"fixed"),options:E.map(F=>({value:Zs(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryLayout:F}),className:m("w-full",v?.control),classNames:el})}):null]}):null]})}a(Nf,"WorkbenchGallerySettingsPanel");function ol({open:e,defaultOpen:t=false,onOpenChange:o,triggerIcon:r,triggerLabel:n,triggerTitle:i,align:s="end",popoverWidth:l=320,panelHeader:d,panelBefore:c,panelAfter:p,panelClassName:u,buttonClassName:g,popoverClassName:f,buttonClassNames:b,labels:x,className:y,classNames:k,...w}){let v={...aw,...x},h=ho.useRef(null),[S,T]=ho.useState(t),[C,R]=ho.useState({}),M=e!==void 0,I=M?!!e:S,B=a(E=>{M||T(E),o?.(E);},"setOpen");ho.useLayoutEffect(()=>{if(!I)return;let E=a(()=>{let H=h.current?.getBoundingClientRect();if(!H||typeof window>"u")return;let A=12,L=Math.max(window.innerWidth-A*2,0),F=Math.min(l,L||l),G=s==="start"?H.left:H.right-F,$=Math.min(Math.max(G,A),Math.max(window.innerWidth-F-A,A)),_=Math.min(H.bottom+8,Math.max(window.innerHeight-80,A));R({left:$,top:_,width:F,maxHeight:`calc(100vh - ${Math.round(_+A)}px)`});},"updatePopoverPosition"),P=a(H=>{h.current?.contains(H.target)||B(false);},"handlePointerDown"),W=a(H=>{H.key==="Escape"&&B(false);},"handleKeyDown");return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),window.addEventListener("pointerdown",P),window.addEventListener("keydown",W),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true),window.removeEventListener("pointerdown",P),window.removeEventListener("keydown",W);}},[s,I,l]);let N=n??v.settingsButton,D=d??v.title;return jsxRuntime.jsxs("div",{ref:h,className:m("relative inline-flex",b?.root,y),children:[jsxRuntime.jsx(mt,{icon:r,label:N,title:i||(typeof N=="string"?N:void 0),iconOnly:!!r,active:I,tone:"muted","aria-haspopup":"dialog","aria-expanded":I,className:m(b?.trigger,g),onClick:()=>B(!I)}),I?jsxRuntime.jsxs("div",{role:"dialog","aria-label":typeof D=="string"?D:void 0,className:m("fixed z-50 overflow-y-auto rounded-xl border border-border bg-card p-3 text-foreground shadow-lg",s==="start"?"origin-top-left":"origin-top-right",b?.popover,f),style:C,children:[D?jsxRuntime.jsx("div",{className:m("mb-3 text-[11px] font-medium text-foreground",b?.header),children:D}):null,c,jsxRuntime.jsx(Nf,{...w,labels:v,className:m(b?.panel,u),classNames:k}),p]}):null]})}a(ol,"WorkbenchGallerySettingsButton");function dw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M3 10h18M9 4v16"})]})}a(dw,"TableViewIcon");function cw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]})}a(cw,"GalleryViewIcon");function iw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 7h-9M7 7H4M14 17H4M20 17h-3"}),jsxRuntime.jsx("circle",{cx:"9",cy:"7",r:"2"}),jsxRuntime.jsx("circle",{cx:"16",cy:"17",r:"2"})]})}a(iw,"SettingsIcon");function DA({open:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:m("h-3 w-3 opacity-55 transition-transform",e&&"rotate-180"),fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(DA,"ChevronDownIcon");var PA=[{value:"list",label:"Table view",icon:jsxRuntime.jsx(dw,{})},{value:"gallery",label:"Gallery view",icon:jsxRuntime.jsx(cw,{})}];function sw(e){return e.icon!==void 0?e.icon:e.value==="list"||e.value==="table"?jsxRuntime.jsx(dw,{}):e.value==="gallery"?jsxRuntime.jsx(cw,{}):null}a(sw,"getViewModeOptionIcon");function lw(e){return e.triggerLabel??e.labels?.settingsButton??"Settings"}a(lw,"getSettingsTriggerLabel");function EA({value:e,options:t,onValueChange:o,classNames:r}){let n=ho.useRef(null),[i,s]=ho.useState(false),l=t.find(c=>c.value===e)||t.find(c=>!c.disabled)||t[0],d=l?sw(l):null;return ho.useEffect(()=>{if(!i)return;let c=a(u=>{n.current?.contains(u.target)||s(false);},"handlePointerDown"),p=a(u=>{u.key==="Escape"&&s(false);},"handleKeyDown");return window.addEventListener("pointerdown",c),window.addEventListener("keydown",p),()=>{window.removeEventListener("pointerdown",c),window.removeEventListener("keydown",p);}},[i]),l?jsxRuntime.jsxs("div",{ref:n,className:m("relative inline-flex",r?.viewModeRoot),children:[jsxRuntime.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-expanded":i,className:m("inline-flex h-7 min-w-0 items-center justify-center gap-1.5 rounded-md border border-border/70 bg-card px-2 text-xs font-medium text-foreground shadow-none transition-colors hover:bg-muted/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/25",r?.viewModeTrigger),onClick:()=>s(c=>!c),children:[d?jsxRuntime.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-muted-foreground",children:d}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:l.label}),jsxRuntime.jsx(DA,{open:i})]}),i?jsxRuntime.jsx("div",{role:"listbox",className:m("absolute left-0 top-full z-50 mt-2 min-w-[160px] overflow-hidden rounded-xl border border-border/60 bg-card/95 p-1.5 text-xs text-foreground shadow-lg backdrop-blur-xl",r?.viewModeMenu),children:t.map(c=>{let p=c.value===l.value,u=sw(c);return jsxRuntime.jsxs("button",{type:"button",role:"option","aria-selected":p,disabled:c.disabled,className:m("flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/55 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",p&&"bg-muted/60 text-foreground",r?.viewModeItem),onClick:()=>{c.disabled||(o?.(c.value,c),s(false));},children:[u?jsxRuntime.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:u}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:c.label})]},c.value)})}):null]}):null}a(EA,"WorkbenchContentToolbarViewModeControl");var du=ho.forwardRef(a(function({as:t="div",children:o,end:r,viewMode:n,viewModeOptions:i,onViewModeChange:s,gallerySettings:l,gallerySettingsPlacement:d="start",className:c,startClassName:p,endClassName:u,classNames:g,...f},b){let x=i||(n?PA:[]),y=l&&typeof l=="object"?l:null,k=!!x.length,w=!!y,v=w&&d!=="end",h=w&&d==="end",S=k||v||!!o,T=!!r||h;return jsxRuntime.jsxs(t,{ref:b,"data-workbench-content-toolbar":true,className:m("flex min-h-[46px] shrink-0 flex-col gap-2 border-b border-border/60 px-4 py-2 md:flex-row md:items-center md:justify-between",g?.root,c),...f,children:[S?jsxRuntime.jsxs("div",{className:m("flex flex-wrap items-center gap-2",g?.start,p),children:[k?jsxRuntime.jsx(EA,{value:n,options:x,onValueChange:s,classNames:g}):null,v&&y?jsxRuntime.jsx(ol,{align:"end",triggerIcon:jsxRuntime.jsx(iw,{}),triggerLabel:lw(y),...y,buttonClassName:m("!h-7 !w-7 !min-h-0 !rounded-md !p-0 text-xs",g?.settings,y.buttonClassName)}):null,o]}):null,T?jsxRuntime.jsxs("div",{className:m("flex shrink-0 items-center gap-2",g?.end,u),children:[r,h&&y?jsxRuntime.jsx(ol,{align:"end",triggerIcon:jsxRuntime.jsx(iw,{}),triggerLabel:lw(y),...y,buttonClassName:m("!h-7 !w-7 !min-h-0 !rounded-md !p-0 text-xs",g?.settings,y.buttonClassName)}):null]}):null]})},"WorkbenchContentToolbar"));function LA(e){return !!(e.header||e.footer||e.bodyAs||e.bodyClassName||e.bodyProps||e.classNames?.body)}a(LA,"shouldRenderBodyWrapper");function fw(e){if(e==null||typeof e=="boolean")return false;if(typeof e=="string")return e.trim().length>0;if(Array.isArray(e))return e.some(fw);let t=ho.Children.toArray(e);return t.length?t.some(o=>typeof o=="string"?o.trim().length>0:true):false}a(fw,"hasRenderableChildren");function WA(e,t){return t===void 0?{}:e===void 0?{width:t}:{width:e?t:0,opacity:e?1:0}}a(WA,"resolveWidthStyle");function uw(e){return e.label??e.key}a(uw,"getFallbackFieldLabel");function zA(e){let t=["text","label","title","display","value","recordId"];for(let o of t){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let r=e[o];if(r!=null&&r!=="")return r}}a(zA,"getObjectDisplayValue");function pw(e){return e==null||e===""}a(pw,"isEmptyDetailValue");function mw(e){return ["string","number","boolean"].includes(typeof e)}a(mw,"isPlainDisplayValue");function bw(e){if(!e)return null;if(typeof e=="string"){let r=e.startsWith("data:image/"),n=/\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(e);return r||n?{src:e}:null}if(typeof e!="object"||ho.isValidElement(e))return null;let t=e,o=t.src||t.url||t.thumbnail||t.preview||t.image;return o?{src:String(o),alt:t.alt||t.label||t.title||"",caption:t.caption||t.description||t.label||t.title}:null}a(bw,"getMediaDisplayData");function OA(e,t){let o=String(e?.renderType||"").toLowerCase();return ["image","media","preview","thumbnail"].includes(o)||!!bw(t)}a(OA,"shouldRenderAsMedia");function FA(e,t){return e?typeof e=="string"||typeof e=="number"?jsxRuntime.jsx("span",{className:m("inline-flex h-3.5 min-w-3.5 shrink-0 items-center justify-center rounded-sm text-[10px] font-semibold text-primary",t),children:e}):typeof e=="boolean"?null:ho.isValidElement(e)?e:jsxRuntime.jsx(e,{className:m("h-3.5 w-3.5 shrink-0 text-primary",t)}):jsxRuntime.jsxs("span",{className:m("relative inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",t),children:[jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-full border border-primary/25 bg-primary/10"}),jsxRuntime.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"})]})}a(FA,"renderMaybeFieldIcon");function HA(e,t,o){return jsxRuntime.jsxs("span",{className:m("inline-flex min-w-0 items-center gap-1.5 text-[11px] font-semibold text-foreground",o?.fieldLabel),children:[FA(t.labelIcon||t.icon,o?.fieldLabelIcon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e})]})}a(HA,"renderDetailFieldLabel");function VA({media:e,classNames:t}){return jsxRuntime.jsxs("div",{className:m("grid gap-2",t?.mediaValue),children:[jsxRuntime.jsx("div",{className:"overflow-hidden rounded-md border border-border/55 bg-muted/20 dark:border-border/45 dark:bg-muted/10",children:jsxRuntime.jsx("img",{src:e.src,alt:String(e.alt||""),className:m("block aspect-[16/9] w-full object-cover",t?.mediaImage)})}),e.caption?jsxRuntime.jsx("div",{className:m("truncate text-[11px] leading-4 text-muted-foreground",t?.mediaCaption),children:e.caption}):null]})}a(VA,"WorkbenchDetailSidebarMediaValue");function Rf(e,t,o,r){if(pw(e))return t;if(ho.isValidElement(e))return e;if(OA(o,e)){let n=bw(e);if(n)return jsxRuntime.jsx(VA,{media:n,classNames:r})}if(Array.isArray(e)){let n=e.map(i=>Rf(i,"",void 0,r)).filter(i=>!pw(i));return n.length?n.every(mw)?n.map(String).join(" \xB7 "):jsxRuntime.jsx("span",{className:"inline-flex flex-wrap items-center gap-1",children:n.map((i,s)=>jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1",children:[s>0?jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"\xB7"}):null,mw(i)?String(i):i]},s))}):t}if(typeof e=="object"){let n=zA(e);return n===void 0?t:Rf(n,t,o,r)}return String(e)}a(Rf,"getDefaultDetailDisplayValue");function _A(e,t){return Object.prototype.hasOwnProperty.call(e,"value")?typeof e.value=="function"?e.value(t,e):e.value:t?t?.[e.key]:void 0}a(_A,"getDefaultFieldValue");function GA(e,t){return typeof e.hidden=="function"?e.hidden(e,t):!!e.hidden}a(GA,"shouldHideField");function $A(e,t){return typeof e.hidden=="function"?e.hidden(e,t):!!e.hidden}a($A,"shouldHideSection");function jA({record:e,fields:t,sections:o,fieldColumns:r=1,emptyValue:n="\u2014",emptyState:i,getFieldValue:s,renderFieldValue:l,formatFieldValue:d,formatFieldLabel:c,classNames:p}){let g=(o?.length?o:t?.length?[{fields:t,columns:r}]:[]).filter(f=>!$A(f,e));return g.length?jsxRuntime.jsx("div",{className:m("space-y-3",p?.autoBody),children:g.map((f,b)=>{let x=(f.fields||[]).filter(w=>!GA(w,e)),y=f.id||`section-${b}`;if(!x.length&&!f.emptyState)return null;let k=x.map((w,v)=>{let h={field:w,fieldIndex:v,section:f,sectionIndex:b,record:e},S=s?s(w,e,h):_A(w,e),T=l?l(w,e,h):d?d(S,h):Rf(S,w.emptyValue??n,w,p),C=c?c(uw(w),h):uw(w);return {term:HA(C,w,p),value:T}});return jsxRuntime.jsxs("section",{className:m("min-w-0 space-y-3",p?.section),children:[f.title||f.description?jsxRuntime.jsxs("div",{className:m("min-w-0 space-y-1.5",p?.sectionHeader),children:[f.title?jsxRuntime.jsx("div",{className:m("inline-flex max-w-full items-center gap-2 rounded-md border border-primary/20 bg-primary/5 px-2.5 py-1.5 text-xs font-medium text-primary dark:border-primary/25 dark:bg-primary/10",p?.sectionTitle),children:f.title}):null,f.description?jsxRuntime.jsx("div",{className:m("text-[11px] leading-5 text-muted-foreground",p?.sectionDescription),children:f.description}):null]}):null,k.length?jsxRuntime.jsx(wc,{items:k,columns:f.columns||r,className:m("gap-3",p?.descriptionList),classNames:{item:m("!border-0 !bg-transparent !p-0 !shadow-none !gap-1.5",p?.descriptionListItem),term:m("!normal-case !tracking-normal !text-foreground",p?.descriptionListTerm),value:m("min-h-10 rounded-md border border-border/55 bg-muted/25 px-3 py-2 text-xs leading-5 text-foreground shadow-[inset_0_1px_0_hsl(var(--background)/0.8)] dark:border-border/45 dark:bg-white/[0.035]",p?.fieldValue,p?.descriptionListValue)}}):jsxRuntime.jsx("div",{className:m("py-3 text-center text-xs text-muted-foreground",p?.emptyState),children:f.emptyState})]},y)})}):i?jsxRuntime.jsx("div",{className:m("rounded-lg border border-dashed border-border/60 px-3 py-6 text-center text-xs text-muted-foreground",p?.emptyState),children:i}):null}a(jA,"WorkbenchDetailSidebarAutoContent");var gw=ho.forwardRef(a(function({as:t="aside",bodyAs:o="div",open:r,width:n,header:i,footer:s,resizeHandle:l,children:d,record:c,fields:p,sections:u,fieldColumns:g,emptyValue:f,emptyState:b,getFieldValue:x,renderFieldValue:y,formatFieldValue:k,formatFieldLabel:w,className:v,headerClassName:h,bodyClassName:S,footerClassName:T,resizeHandleClassName:C,bodyProps:R,classNames:M,style:I,...B},N){let D=fw(d)?d:jsxRuntime.jsx(jA,{record:c,fields:p,sections:u,fieldColumns:g,emptyValue:f,emptyState:b,getFieldValue:x,renderFieldValue:y,formatFieldValue:k,formatFieldLabel:w,classNames:M}),E=LA({header:i,footer:s,bodyAs:o==="div"?void 0:o,bodyClassName:S,bodyProps:R,classNames:M}),{className:P,...W}=R??{};return jsxRuntime.jsxs(t,{ref:N,"data-workbench-detail-sidebar":true,"data-open":r===void 0?void 0:r?"true":"false",className:m("workbench-surface-subtle relative flex flex-shrink-0 flex-col self-stretch overflow-hidden rounded-lg border border-border/50 transition-all duration-300 dark:border-border/40",r===false&&"pointer-events-none",M?.root,v),style:{...WA(r,n),...I},...B,children:[l?jsxRuntime.jsx("div",{className:m(M?.resizeHandle,C),children:l}):null,i?jsxRuntime.jsx("div",{className:m("shrink-0 border-b border-border/40 px-4 py-3 dark:border-border/30",M?.header,h),children:i}):null,E?jsxRuntime.jsx(o,{className:m("min-h-0 flex-1 overflow-y-auto",M?.body,S,P),...W,children:D}):D,s?jsxRuntime.jsx("div",{className:m("shrink-0 border-t border-border/40 px-4 py-3 dark:border-border/30",M?.footer,T),children:s}):null]})},"WorkbenchDetailSidebar"));function yw(e){return typeof e=="function"?true:typeof e=="object"&&e!==null&&!ho.isValidElement(e)&&"$$typeof"in e}a(yw,"isWorkbenchIconComponent");function rl(e,t){return e?ho.isValidElement(e)?e:yw(e)?jsxRuntime.jsx(e,{className:t}):e:null}a(rl,"renderWorkbenchIcon");function xw(e){return !e||!yw(e)?null:e}a(xw,"getWorkbenchIconComponent");function qA(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(qA,"toCssSize");var YA=160,XA=56,QA=128;function vw(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return;let t=e.trim().match(/^(\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}a(vw,"numericCssSize");function Cw(e,t){return e.renderType==="icon"?XA:t?QA:YA}a(Cw,"defaultWorkbenchColumnWidth");function ww(e,t,o){return t??vw(e.width)??vw(e.minWidth)??Cw(e,o)}a(ww,"resolvedWorkbenchColumnWidth");function ZA(e){return e==null||e===false?null:e}a(ZA,"defaultFormatLabel");function kw(e){if(typeof e=="string"||typeof e=="number")return String(e)}a(kw,"toTitle");function JA(e,t){return e?.id??e?.key??e?.linkKey??t}a(JA,"defaultGetRowKey");function eB(e){return e?.linkKey??e?.id??e?.key}a(eB,"defaultGetRowSelectionKey");function tB(e,t){if(!t?.length)return e;let o=new Map(e.map(s=>[s.key,s])),r=t.map(s=>o.get(s)).filter(Boolean),n=new Set(r.map(s=>s.key)),i=e.filter(s=>!n.has(s.key));return [...r,...i]}a(tB,"getOrderedColumns");function Pf(e,t){let o=new Set(e),r=(t||[]).filter(s=>o.has(s)),n=new Set(r),i=e.filter(s=>!n.has(s));return [...r,...i]}a(Pf,"normalizeColumnOrder");function oB({helperText:e,className:t}){return V(e)?jsxRuntime.jsxs("span",{className:m("group relative inline-flex items-center",t),children:[jsxRuntime.jsx("button",{type:"button",title:kw(e),"aria-label":kw(e)||"Field help",className:"inline-flex h-4 w-4 items-center justify-center rounded-md border border-border/60 bg-background text-xs font-semibold normal-case tracking-normal text-muted-foreground shadow-sm transition-colors hover:border-primary/40 hover:text-primary focus-visible:border-primary/40 focus-visible:text-primary focus-visible:outline-hidden",onClick:o=>o.stopPropagation(),children:"?"}),jsxRuntime.jsx("span",{role:"tooltip",className:"pointer-events-none absolute left-1/2 top-full z-40 mt-2 hidden w-72 -translate-x-1/2 whitespace-pre-line rounded-lg border border-border/60 bg-card px-3 py-2 text-xs font-normal normal-case leading-5 tracking-normal text-foreground shadow-sm backdrop-blur-sm group-hover:block group-focus-within:block",children:e})]}):null}a(oB,"WorkbenchTableHeaderHelper");function Sw({rows:e=[],columns:t=[],onRowClick:o,selectedRowKey:r,selectedLinkKey:n,activePrimaryColumn:i,activeTablePrimaryColumn:s,renderedRowCount:l,totalRowCount:d,tableMinWidth:c,minWidth:p,bodyMaxHeight:u="min(58vh, 38rem)",stickyFirstColumn:g=true,appearance:f,headerPresentation:b,fillRemainingWidthColumnKey:x,columnOrder:y,columnSizes:k,columnDragEnabled:w,columnResizeEnabled:v,className:h,tableClassName:S,rowClassName:T,classNames:C,style:R,renderCell:M,renderFieldValue:I,renderColumnHeader:B,onColumnOrderChange:N,onColumnSizeChange:D,onSort:E,formatLabel:P=ZA,getColumnDataType:W,getColumnIcon:H,getColumnTypeIcon:A,getRowKey:L=JA,getRowSelectionKey:F=eB,isActionColumn:G,isActionField:$,isRowDisabled:_,isWorkbenchPlaceholderRow:z,emptyState:re="-",hiddenRowsMessage:Z,scrollFooter:ae,scrollRestoration:ee}){let q=t.map(se=>se.key).join(""),U=ho.useMemo(()=>q?q.split(""):[],[q]),[X,O]=ho.useState(U),[K,ne]=ho.useState({}),fe=ho.useRef(null),he=ho.useRef(new Map),me=ho.useRef(ee);me.current=ee;let ie=ho.useRef(void 0),be=ho.useCallback(()=>{let se=fe.current,te=me.current;if(!se||!te||ie.current!==te.key)return;let Te=se.getBoundingClientRect().top,ze=Array.from(he.current.entries()).find(([,je])=>je.getBoundingClientRect().bottom>Te);te.write({x:se.scrollLeft,y:se.scrollTop,...ze?{rowKey:ze[0],rowOffset:ze[1].getBoundingClientRect().top-Te}:{}});},[]);ho.useEffect(()=>{let se=fe.current,te=me.current;if(!se||!te||ie.current===te.key||e.length===0)return;let Te=te.read(),ze=a(()=>{let Y=Te?.rowKey?he.current.get(Te.rowKey):void 0,pe=Y&&typeof Te?.rowOffset=="number"?se.scrollTop+Y.getBoundingClientRect().top-se.getBoundingClientRect().top-Te.rowOffset:Te?.y??0;se.scrollTo({left:Te?.x??0,top:Math.max(0,pe),behavior:"auto"}),ie.current=te.key;},"restore"),je=se.ownerDocument.defaultView;if(!je){ze();return}let it=je.requestAnimationFrame(ze);return ()=>je.cancelAnimationFrame(it)},[e,ee?.key]),ho.useEffect(()=>{let se=fe.current?.ownerDocument.defaultView;return se?.addEventListener("pagehide",be),()=>{se?.removeEventListener("pagehide",be),be();}},[be]);let[He,We]=ho.useState();ho.useEffect(()=>{O(se=>Pf(U,se));},[U]);let Ke=y?Pf(U,y):X,ce=k??K,Q=ho.useCallback((se,te)=>{let Te=Pf(U,se);y||O(Te),N?.(Te,te);},[y,U,N]),ge=ho.useCallback((se,te,Te)=>{k||ne(ze=>({...ze,[se]:te})),D?.(se,te,Te);},[k,D]),we=r??n,Ie=i??s,oe=tB(t,Ke),xe=x?oe.reduce((se,te)=>te.key===x?se:se+ww(te,ce[te.key],G?.(te)??$?.(te)??false),0):void 0,Ve=x&&xe!==void 0&&He!==void 0?Math.max(0,Math.round(He-xe)):void 0,_e=oe.flatMap(se=>se.key!==x?[se]:Ve===0?[]:Ve===void 0?[se]:[{...se,width:Ve,minWidth:Ve,maxWidth:Ve}]),Ge=Math.max(0,Number(d||e.length)-Number(l||e.length)),le=M??I??((se,te)=>te?.[se.key]),Me=G??$??(()=>false),Ae=_??z??(()=>false),J=H??A,$e=xe!==void 0&&Ve!==void 0?xe+Ve:void 0,ue=$e??c??p??Math.max(760,_e.reduce((se,te)=>se+ww(te,ce[te.key],Me(te)),0));ho.useEffect(()=>{if(!x){We(void 0);return}let se=fe.current;if(!se)return;let te=se.ownerDocument.defaultView,Te=a(()=>{let it=Math.round(se.getBoundingClientRect().width);!Number.isFinite(it)||it<=0||We(Y=>Y===it?Y:it);},"updateWidth");Te();let ze=te?.ResizeObserver,je=ze?new ze(Te):void 0;return je?.observe(se),te?.addEventListener("resize",Te),()=>{je?.disconnect(),te?.removeEventListener("resize",Te);}},[x]);let Re=Ge>0&&Z?typeof Z=="function"?Z(Ge,l||e.length,d||e.length):Z:null;return jsxRuntime.jsxs(Bi,{appearance:f,className:m("w-full overflow-hidden rounded-lg border border-border/40 bg-muted/15 dark:border-border/35 dark:bg-muted/10",C?.root,h),style:u==="100%"?{display:"flex",minHeight:0,flex:1,flexDirection:"column",...R}:R,children:[jsxRuntime.jsxs("div",{ref:fe,onScroll:be,className:m("w-full overflow-auto",C?.scrollArea),style:{maxHeight:qA(u),...u==="100%"?{minHeight:0,flex:1}:{}},children:[jsxRuntime.jsxs(Li,{appearance:f,columnOrder:Ke,columnSizes:ce,columnDragEnabled:w,columnResizeEnabled:v,onColumnOrderChange:Q,onColumnSizeChange:ge,className:m("w-full table-auto text-left text-xs",C?.table,S),style:{width:$e,minWidth:ue},children:[jsxRuntime.jsx(Wi,{appearance:f,className:m("z-20 text-xs font-sans text-muted-foreground",C?.header),children:jsxRuntime.jsx(yn,{className:m("hover:bg-transparent",C?.headerRow),children:_e.map((se,te)=>{let Te=Cw(se,Me(se)),ze=se.renderType||se.type||W?.(se.key,e,se),je=rl(J?.(ze,se),"h-3.5 w-3.5 shrink-0 text-primary"),Y=_e[te-1]?.renderType==="icon"&&se.key===Ie?.key,pe=B?B(se,{column:se,columnIndex:te,columns:_e,rows:e,columnType:ze}):P(se.label,{column:se}),Be=!B&&(V(se.trailing)||V(se.helperText))?jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[V(se.trailing)?P(se.trailing,{column:se}):null,jsxRuntime.jsx(oB,{helperText:P(se.helperText,{column:se}),className:C?.helper})]}):void 0,rt=!!se.sortable,Ce=rt&&E?()=>E(se.key,se):void 0;return jsxRuntime.jsx(Oi,{appearance:f,presentation:b,columnId:se.key,align:se.align,icon:B?void 0:je,label:pe,description:B?void 0:P(se.description,{column:se}),meta:B?void 0:P(se.meta,{column:se}),actions:se.actions,trailing:Be,sortable:rt,sortDirection:se.sortDirection,sortLabel:se.sortLabel,onSort:Ce,draggable:se.draggable,dragLabel:se.dragLabel,resizable:se.resizable,resizeLabel:se.resizeLabel,width:se.width??Te,minWidth:typeof se.minWidth=="number"?se.minWidth:void 0,maxWidth:typeof se.maxWidth=="number"?se.maxWidth:void 0,className:m("sticky top-0 z-20 h-auto whitespace-nowrap bg-card/95 px-4 py-3 font-medium backdrop-blur-sm supports-[backdrop-filter]:bg-card/90",g&&te===0&&"md:left-0 md:z-30 md:shadow-[1px_0_0_0_hsl(var(--border)/0.35)]",se.compactHeaderClassName,se.renderType==="icon"&&"pl-3 pr-1",Y&&"pl-2",C?.headerCell,se.headerClassName),style:{minWidth:typeof se.minWidth=="string"?se.minWidth:void 0,maxWidth:typeof se.maxWidth=="string"?se.maxWidth:void 0,...se.headerStyle}},se.key)})})}),jsxRuntime.jsx(zi,{appearance:f,className:m("divide-y divide-border/35 dark:divide-border/30",C?.body),children:e.length?e.map((se,te)=>{let Te=L(se,te),ze=Ae(se,te),je=F(se,te),it=!!(we&&String(je)===String(we)),Y=typeof T=="function"?T(se,te):T;return jsxRuntime.jsx(yn,{appearance:f,ref:pe=>{pe?he.current.set(String(Te),pe):he.current.delete(String(Te));},interactive:!!o&&!ze,"data-item-key":String(Te),tabIndex:o&&!ze?0:void 0,selected:it,disabled:ze,onClick:pe=>{ze||(o&&pe.currentTarget.focus({preventScroll:true}),o?.(se,te));},onKeyDown:pe=>{pe.target!==pe.currentTarget||ze||!o||!["Enter"," "].includes(pe.key)||(pe.preventDefault(),o(se,te));},className:m(o&&!ze?"cursor-pointer":"cursor-default",it?"bg-primary/10 hover:bg-primary/15":ze?"":"hover:bg-muted/25 dark:hover:bg-muted/15",C?.row,Y),children:_e.map((pe,Be)=>{let rt=Me(pe)||pe.wrap===true,Xe=_e[Be-1]?.renderType==="icon"&&pe.key===Ie?.key;return jsxRuntime.jsx(Oa,{appearance:f,align:pe.align,className:m(rt?"align-top whitespace-normal":"whitespace-nowrap","px-4 py-3 text-muted-foreground",!rt&&"overflow-hidden text-ellipsis",g&&Be===0&&"md:sticky md:left-0 md:z-10 md:bg-card/95 md:text-foreground md:shadow-[1px_0_0_0_hsl(var(--border)/0.3)]",pe.compactCellClassName,pe.renderType==="icon"&&"pl-3 pr-1",Xe&&"pl-2",C?.cell,pe.cellClassName),style:pe.cellStyle,children:le(pe,se,{row:se,rowIndex:te,column:pe,columnIndex:Be,compact:true,surface:"list"})},`${Te}-${pe.key}`)})},Te)}):jsxRuntime.jsx(Fi,{appearance:f,colSpan:Math.max(_e.length,1),classNames:{cell:"px-4 py-10 text-center text-sm text-muted-foreground"},children:re})})]}),V(ae)?jsxRuntime.jsx("div",{style:{minWidth:ue},children:ae}):null]}),Re?jsxRuntime.jsx("div",{className:m("border-t border-border/40 px-4 py-2 text-xs text-muted-foreground dark:border-border/30",C?.footer),children:Re}):null]})}a(Sw,"WorkbenchTableView");function Ef(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(Ef,"toCssSize");function Ui(){return typeof window<"u"}a(Ui,"isBrowser");function Nw(e,t){return e?.id??e?.key??t}a(Nw,"defaultGetRowKey");function mu(e){return typeof e.width=="number"?e.width:typeof e.minWidth=="number"?e.minWidth:160}a(mu,"getColumnDefaultSize");function rB(e,t){return e.reduce((o,r)=>(o[r.key]=t?.[r.key]??mu(r),o),{})}a(rB,"buildDefaultColumnSizes");function Rw(e,t){if(!e||!Ui())return t;try{let o=JSON.parse(window.localStorage.getItem(e)||"{}");return Object.keys(t).reduce((r,n)=>{let i=Number(o?.[n]);return r[n]=Number.isFinite(i)?i:t[n],r},{})}catch{return t}}a(Rw,"loadStoredColumnSizes");function Mw(e,t){!e||!Ui()||window.localStorage.setItem(e,JSON.stringify(t));}a(Mw,"persistColumnSizes");function Bw(e){return e?`${e}.frozenColumnCount`:void 0}a(Bw,"getFrozenColumnStorageKey");function Lw(e){return e?`${e}.frozenEndColumnCount`:void 0}a(Lw,"getFrozenEndColumnStorageKey");function la(e,t){return Number.isFinite(e)?Math.max(0,Math.min(Math.round(e),t)):0}a(la,"clampFrozenColumnCount");function nB(e,t,o){let r=la(e,o),n=la(t,Math.max(0,o-r));return {startCount:r,endCount:n}}a(nB,"normalizeFrozenColumnCounts");function Iw(e,t,o){let r=la(t,o),n=Bw(e);if(!n||!Ui())return r;try{let i=window.localStorage.getItem(n);if(i===null)return r;let s=Number(i);return Number.isFinite(s)?la(s,o):r}catch{return r}}a(Iw,"loadStoredFrozenColumnCount");function aB(e,t){let o=Bw(e);!o||!Ui()||window.localStorage.setItem(o,String(t));}a(aB,"persistFrozenColumnCount");function Dw(e,t,o){let r=la(t,o),n=Lw(e);if(!n||!Ui())return r;try{let i=window.localStorage.getItem(n);if(i===null)return r;let s=Number(i);return Number.isFinite(s)?la(s,o):r}catch{return r}}a(Dw,"loadStoredFrozenEndColumnCount");function iB(e,t){let o=Lw(e);!o||!Ui()||window.localStorage.setItem(o,String(t));}a(iB,"persistFrozenEndColumnCount");function pu(e,t){let o=new Set(e),r=(t||[]).filter(s=>o.has(s)),n=new Set(r),i=e.filter(s=>!n.has(s));return [...r,...i]}a(pu,"normalizeColumnOrder");function sB(e,t){let o=pu(e.map(n=>n.key),t),r=new Map(e.map(n=>[n.key,n]));return o.map(n=>r.get(n)).filter(Boolean)}a(sB,"getOrderedColumns");function sl(e,t){let o=t[e.key];return typeof o=="number"?o:mu(e)}a(sl,"getColumnNumericWidth");function lB(e,t,o){let r=new Map,n=0;return e.slice(0,Math.max(0,o)).forEach(i=>{r.set(i.key,n),n+=sl(i,t);}),r}a(lB,"buildFrozenOffsets");function dB(e,t,o){let r=new Map,n=0;return e.slice(Math.max(0,e.length-o)).reverse().forEach(i=>{r.set(i.key,n),n+=sl(i,t);}),r}a(dB,"buildFrozenEndOffsets");function Pw(e,t,o){return typeof e=="function"?e(t,o):e}a(Pw,"resolveRowClassName");function Ew(e,t){let o=t?.[e.key];return o==null||o===""?"\u2014":String(o)}a(Ew,"renderDefaultCell");function Aw({children:e,wrap:t}){return jsxRuntime.jsx("div",{className:m("min-w-0 max-w-full overflow-auto overscroll-contain [scrollbar-width:thin]",t?"max-h-20 whitespace-pre-wrap break-words leading-5":"whitespace-nowrap"),children:e})}a(Aw,"InteractiveTableCellContent");function cB({className:e}){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",children:[jsxRuntime.jsx("path",{d:"M5.25 2.75h5.5"}),jsxRuntime.jsx("path",{d:"M6.25 2.75v4L4.5 9.25h7L9.75 6.75v-4"}),jsxRuntime.jsx("path",{d:"M8 9.25v4"})]})}a(cB,"PinIcon");function Ww({rows:e=[],columns:t=[],pinnedTopRows:o=[],getRowKey:r=Nw,getPinnedTopRowKey:n=Nw,renderCell:i,renderPinnedTopCell:s,renderColumnHeader:l,onRowClick:d,getRowState:c,rowClassName:p,pinnedTopRowClassName:u,emptyState:g="\u2014",columnMenuLabels:f,columnStorageKey:b,columnOrder:x,columnSizes:y,defaultColumnSizes:k,columnDragEnabled:w=false,columnResizeEnabled:v=true,frozenColumnCount:h=0,frozenEndColumnCount:S=0,tableMinWidth:T,bodyMaxHeight:C="min(60vh, 42rem)",appearance:R,className:M,tableClassName:I,classNames:B,style:N,onColumnOrderChange:D,onColumnSizeChange:E,onResetColumnSizes:P,onFrozenColumnCountChange:W,onFrozenEndColumnCountChange:H,onSort:A}){let L=Ye().workbench.interactiveTable,F=t.map(oe=>oe.key).join(""),G=ho.useMemo(()=>F?F.split(""):[],[F]),$=ho.useMemo(()=>rB(t,k),[t,k]),[_,z]=ho.useState(G),[re,Z]=ho.useState(()=>Rw(b,$)),[ae,ee]=ho.useState(()=>Iw(b,h,t.length)),[q,U]=ho.useState(()=>Dw(b,S,t.length));ho.useEffect(()=>{z(oe=>pu(G,oe));},[G]),ho.useEffect(()=>{y||Z(Rw(b,$));},[y,b,$]),ho.useEffect(()=>{ee(Iw(b,h,t.length));},[b,t.length,h]),ho.useEffect(()=>{U(Dw(b,S,t.length));},[b,t.length,S]);let X=x?pu(G,x):_,O=y??re,K=sB(t,X),{startCount:ne,endCount:fe}=nB(ae,q,K.length),he=lB(K,O,ne),me=dB(K,O,fe),ie=T??Math.max(760,K.reduce((oe,xe)=>oe+sl(xe,O),0)),be={columnActions:f?.columnActions??L.columnActions,freezeColumn:f?.freezeColumn??L.freezeColumn,freezeEndColumn:f?.freezeEndColumn??L.freezeEndColumn,unfreezeColumn:f?.unfreezeColumn??L.unfreezeColumn,unfreezeEndColumn:f?.unfreezeEndColumn??L.unfreezeEndColumn,unfreezeAllColumns:f?.unfreezeAllColumns??L.unfreezeAllColumns,resetColumnWidth:f?.resetColumnWidth??L.resetColumnWidth,frozenColumnTitle:f?.frozenColumnTitle??L.frozenColumnTitle},He=ho.useCallback((oe,xe)=>{let Ve=pu(G,oe);x||z(Ve),D?.(Ve,xe);},[x,G,D]),We=ho.useCallback((oe,xe,Ve)=>{let _e=t.find(J=>J.key===oe),Ge=_e?.minWidth,le=_e?.maxWidth,Me=Math.max(typeof Ge=="number"?Ge:0,Math.min(xe,typeof le=="number"?le:Number.POSITIVE_INFINITY)),Ae={...O,[oe]:Me};y||Z(Ae),Mw(b,Ae),E?.(oe,Me,Ve);},[y,b,t,E,O]),Ke=ho.useCallback(oe=>{let xe=$[oe.key]??mu(oe),Ve=sl(oe,O),_e={...O,[oe.key]:xe};y||Z(_e),Mw(b,_e),E?.(oe.key,xe,{columnId:oe.key,previousWidth:Ve,minWidth:oe.minWidth,maxWidth:oe.maxWidth}),P?.(_e);},[y,b,$,E,P,O]),ce=ho.useCallback(oe=>{let xe=la(oe,Math.max(0,K.length-fe));ee(xe),aB(b,xe),W?.(xe);},[b,W,K.length,fe]),Q=ho.useCallback(oe=>{let xe=la(oe,Math.max(0,K.length-ne));U(xe),iB(b,xe),H?.(xe);},[b,H,K.length,ne]),ge=a(oe=>{if(oe<ne)return "start";if(oe>=K.length-fe)return "end"},"getFrozenPosition"),we=a((oe,xe,Ve=false)=>{let _e=ge(xe);if(_e)return m("sticky",_e==="start"?"shadow-[1px_0_0_0_hsl(var(--border)/0.45)]":"shadow-[-1px_0_0_0_hsl(var(--border)/0.45)]",Ve?"bg-muted/60":"bg-inherit",Ve?"z-40":"z-20",(xe===0||xe===K.length-1)&&(Ve?"z-50":"z-30"))},"getFrozenClassName"),Ie=a((oe,xe)=>{let Ve=ge(xe);if(Ve==="start")return {left:he.get(oe.key)??0};if(Ve==="end")return {right:me.get(oe.key)??0}},"getFrozenStyle");return jsxRuntime.jsx(Bi,{appearance:R,className:m("flex h-full min-h-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-card",B?.root,M),style:N,children:jsxRuntime.jsx("div",{className:m("min-h-0 flex-1 overflow-auto",B?.scrollArea),style:{maxHeight:Ef(C)},children:jsxRuntime.jsxs(Li,{appearance:R,columnOrder:X,columnSizes:O,columnDragEnabled:w,columnResizeEnabled:v,onColumnOrderChange:He,onColumnSizeChange:We,className:m("w-full table-fixed text-left text-xs",B?.table,I),style:{minWidth:ie},children:[jsxRuntime.jsx("colgroup",{children:K.map(oe=>jsxRuntime.jsx("col",{style:{width:Ef(O[oe.key]??oe.width),minWidth:Ef(oe.minWidth)}},oe.key))}),jsxRuntime.jsx(Wi,{appearance:R,className:m("border-b border-border/60 bg-muted/60 text-[11px] font-medium text-muted-foreground",B?.tableHeader),children:jsxRuntime.jsx(yn,{appearance:R,className:m("hover:bg-transparent",B?.headerRow),children:K.map((oe,xe)=>{let Ve=l?l(oe,{column:oe,columnIndex:xe,columns:K,rows:e}):oe.label,_e=!!oe.sortable,Ge=_e&&A?()=>A(oe.key,oe):void 0,le=xe<ne,Me=xe>=K.length-fe,Ae=le||Me,J=sl(oe,O)===($[oe.key]??mu(oe));return jsxRuntime.jsxs(yc,{modal:false,children:[jsxRuntime.jsx(Ls,{asChild:true,appearance:R,children:jsxRuntime.jsx(Oi,{appearance:R,columnId:oe.key,align:oe.align,label:Ve,description:oe.description,trailing:Ae?jsxRuntime.jsx("span",{title:be.frozenColumnTitle,className:"inline-flex h-5 w-5 items-center justify-center rounded text-primary",children:jsxRuntime.jsx(cB,{className:"h-3.5 w-3.5"})}):null,sortable:_e,sortDirection:oe.sortDirection,sortLabel:oe.sortLabel,onSort:Ge,draggable:oe.draggable,resizable:oe.resizable,width:oe.width,minWidth:oe.minWidth,maxWidth:oe.maxWidth,className:m("sticky top-0 h-9 whitespace-nowrap border-r border-border/50 bg-muted/60 px-2.5 py-2 backdrop-blur",we(oe,xe,true),oe.headerClassName,oe.className,B?.headerCell),style:Ie(oe,xe)})}),jsxRuntime.jsxs(Ws,{appearance:R,alignOffset:-4,className:"min-w-44",children:[jsxRuntime.jsx(xc,{appearance:R,children:be.columnActions}),Ae?jsxRuntime.jsx(oa,{appearance:R,onSelect:()=>{Me?Q(K.length-xe-1):ce(xe);},children:Me?be.unfreezeEndColumn:be.unfreezeColumn}):jsxRuntime.jsx(oa,{appearance:R,onSelect:()=>ce(xe+1),children:be.freezeColumn}),Ae?null:jsxRuntime.jsx(oa,{appearance:R,onSelect:()=>Q(K.length-xe),children:be.freezeEndColumn}),jsxRuntime.jsx(oa,{appearance:R,disabled:ne===0&&fe===0,onSelect:()=>{ce(0),Q(0);},children:be.unfreezeAllColumns}),jsxRuntime.jsx(vc,{appearance:R}),jsxRuntime.jsx(oa,{appearance:R,disabled:J,onSelect:()=>Ke(oe),children:be.resetColumnWidth})]})]},oe.key)})})}),jsxRuntime.jsxs(zi,{appearance:R,className:m("divide-y divide-border/50",B?.body),children:[o.map((oe,xe)=>{let Ve=n(oe,xe),_e=Pw(u,oe,xe);return jsxRuntime.jsx(yn,{appearance:R,className:m("bg-card/95",B?.pinnedTopRow,_e),children:K.map((Ge,le)=>jsxRuntime.jsx(Oa,{appearance:R,align:Ge.align,className:m("h-[52px] border-r border-border/50 px-2.5 py-1.5 align-middle",Ge.wrap?"whitespace-normal":"whitespace-nowrap",we(Ge,le),Ge.cellClassName,B?.cell),style:Ie(Ge,le),children:jsxRuntime.jsx(Aw,{wrap:Ge.wrap,children:s?s(Ge,oe,{row:oe,rowIndex:xe,column:Ge,columnIndex:le,isPinnedTopRow:true}):Ew(Ge,oe)})},`pinned-${Ve}-${Ge.key}`))},`pinned-${Ve}`)}),e.length?e.map((oe,xe)=>{let Ve=r(oe,xe),_e=c?.(oe,xe)||{},Ge=Pw(p,oe,xe);return jsxRuntime.jsx(yn,{appearance:R,interactive:!!d&&!_e.disabled,selected:_e.selected,disabled:_e.disabled,onClick:()=>{_e.disabled||d?.(oe,xe);},className:m("min-h-[52px] bg-card transition-colors",_e.saving&&"bg-primary/5",_e.pending&&"opacity-80",d&&!_e.disabled?"cursor-pointer hover:bg-muted/30":"hover:bg-muted/30",B?.row,Ge),children:K.map((le,Me)=>jsxRuntime.jsx(Oa,{appearance:R,align:le.align,className:m("h-[52px] border-r border-border/50 px-2.5 py-1.5 align-middle",le.wrap?"whitespace-normal":"whitespace-nowrap",we(le,Me),le.cellClassName,B?.cell),style:Ie(le,Me),children:jsxRuntime.jsx(Aw,{wrap:le.wrap,children:i?i(le,oe,{row:oe,rowIndex:xe,column:le,columnIndex:Me,isPinnedTopRow:false}):Ew(le,oe)})},`${Ve}-${le.key}`))},Ve)}):o.length?null:jsxRuntime.jsx(Fi,{appearance:R,colSpan:Math.max(K.length,1),className:B?.empty,children:g})]})]})})})}a(Ww,"InteractiveTable");function zw({value:e,placeholder:t,disabled:o,multiline:r=false,commitOnBlur:n=true,className:i,inputClassName:s,onCommit:l}){let d=String(e||""),[c,p]=ho.useState(d);ho.useEffect(()=>{p(d);},[d]);let u=ho.useCallback(async()=>{let f=String(c||"").trim(),b=String(d||"").trim();if(f!==b)try{await l?.(f);}catch{p(d);}},[c,d,l]),g=m("w-full resize-none rounded-sm border border-transparent bg-transparent px-1.5 py-1 text-xs text-foreground outline-hidden transition-colors","placeholder:text-muted-foreground/70 hover:border-border/60 hover:bg-background focus:border-primary/45 focus:bg-background",r?"min-h-[42px] leading-5":"h-8",o&&"cursor-not-allowed text-muted-foreground hover:border-transparent hover:bg-transparent",s);return r?jsxRuntime.jsx("textarea",{className:m(g,i),disabled:o,value:c,placeholder:t,onChange:f=>p(f.target.value),onBlur:()=>{n&&u();},onKeyDown:f=>{(f.metaKey||f.ctrlKey)&&f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&(p(d),f.currentTarget.blur());}}):jsxRuntime.jsx("input",{className:m(g,i),disabled:o,value:c,placeholder:t,onChange:f=>p(f.target.value),onBlur:()=>{n&&u();},onKeyDown:f=>{f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&(p(d),f.currentTarget.blur());}})}a(zw,"InteractiveTableEditableTextCell");function Ow({children:e,mono:t=false,className:o}){return jsxRuntime.jsx("div",{className:m("min-w-0 text-xs text-muted-foreground",t&&"font-mono",o),children:V(e)?e:"\u2014"})}a(Ow,"InteractiveTableReadonlyCell");function Fw({value:e,options:t,disabled:o,ariaLabel:r,children:n,className:i,onChange:s}){return jsxRuntime.jsxs("div",{className:m("relative flex w-full items-center",i),children:[n,jsxRuntime.jsx("select",{"aria-label":r,disabled:o,value:e,onChange:l=>s?.(l.target.value),className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",children:t.map(l=>jsxRuntime.jsx("option",{value:l.value,children:l.label},l.value))})]})}a(Fw,"InteractiveTableSelectCell");function Hw({children:e,title:t,presentation:o,renderSlot:r}){let n=o.title,i=n?.placement??"none",s=n?.background==="panel"?"div":"span",l=(o.slots??[]).map(p=>({slot:p,content:r?.(p)})).filter(p=>p.content!=null),d=i==="none"?null:jsxRuntime.jsx("div",{className:"monkeys-gallery-cover-title",title:typeof t=="string"||typeof t=="number"?String(t):void 0,"data-placement":i,"data-background":n?.background??(i.startsWith("overlay")?"gradient":"none"),style:{...n?.background==="panel"?{margin:12,borderRadius:"var(--radius)",border:"1px solid hsl(var(--border) / .8)",background:"hsl(var(--card) / .9)",backdropFilter:"blur(12px)",boxShadow:"var(--monkeys-component-overlay-dialog-shadow)"}:{},textAlign:n?.align??"left",padding:n?.padding??12,fontSize:`var(--monkeys-gallery-title-${n?.size??"md"})`,fontWeight:n?.weight==="normal"?400:n?.weight==="medium"?500:600},children:jsxRuntime.jsx(s,{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:n?.background==="panel"?void 0:n?.maxLines??2,overflow:"hidden"},children:t})}),c=a(p=>jsxRuntime.jsx("div",{className:"monkeys-gallery-slot-row","data-row":p,children:l.filter(({slot:u})=>u.position.startsWith(p)).map(({slot:u,content:g})=>jsxRuntime.jsx("div",{"data-card-slot":u.position,"data-visibility":u.visibility??"always",className:u.visibility==="hover"?"monkeys-gallery-hover-actions":void 0,style:{gridColumn:u.position.endsWith("left")?1:u.position.endsWith("center")?2:3,justifySelf:u.position.endsWith("left")?"start":u.position.endsWith("center")?"center":"end",padding:u.inset??12,gap:u.gap??8,flexDirection:u.direction==="vertical"?"column":"row"},children:g},u.position))}),"band");return jsxRuntime.jsxs("div",{className:"monkeys-gallery-card-surface","data-hover-effect":o.hover?.effect??"none",style:{"--monkeys-gallery-hover-scale":o.hover?.scale??1.02},children:[i==="above"&&d,jsxRuntime.jsxs("div",{className:"monkeys-gallery-media-card",children:[jsxRuntime.jsx("div",{className:"monkeys-gallery-card-media",children:e}),jsxRuntime.jsxs("div",{className:"monkeys-gallery-card-overlay",children:[jsxRuntime.jsxs("div",{children:[i==="overlay-top"&&d,c("top")]}),c("middle"),jsxRuntime.jsxs("div",{children:[c("bottom"),i==="overlay-bottom"&&d]})]})]}),i==="below"&&d]})}a(Hw,"WorkbenchGalleryCardSurface");var uB=/\.(png|jpe?g|webp|gif|svg|bmp|avif)$/i,pB=/\.(wav|mp3|ogg|m4a|flac|aac)$/i,mB=a(e=>/^https?:\/\//i.test(String(e||"")),"isLikelyUrl"),Vw=a(e=>String(e?.renderType||e?.type||"").toLowerCase(),"getColumnRenderKind"),fB=a(e=>String(e||"").startsWith("data:image/")||uB.test(String(e||"")),"isImageLikeValue"),bB=a(e=>String(e||"").startsWith("data:audio/")||pB.test(String(e||"")),"isAudioLikeValue"),gB=a(e=>String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"escapeSvgText"),Ki=a((e,t)=>e?t?.[e.key]??null:null,"getDefaultGalleryFieldValue"),cl=a(e=>{if(e==null||e==="")return "\u2014";if(Array.isArray(e))return e.map(o=>{if(typeof o=="string")return o;if(!o||typeof o!="object")return "";let r=o;return r.text||r.label||r.title||r.display||r.value||r.recordId||""}).filter(Boolean).join(" \xB7 ")||"\u2014";if(typeof e=="object"){let t=e;return String(t.text||t.label||t.title||t.display||t.value||"\u2014")}return String(e)},"getDefaultGalleryDisplayText"),ul=a((e={key:""},t)=>Vw(e)==="image"||fB(t),"isDefaultGalleryImageField"),pl=a((e={key:""},t)=>Vw(e)==="audio"||bB(t),"isDefaultGalleryAudioField"),_w=a((e,t,o)=>{if(mB(e)||String(e||"").startsWith("data:image/"))return String(e);let r=gB(e||o||t||""),i=`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 960 540'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0%' stop-color='#0f172a'/><stop offset='55%' stop-color='#1d4ed8'/><stop offset='100%' stop-color='#14b8a6'/></linearGradient></defs><rect width='960' height='540' fill='url(#g)'/><g opacity='0.28'><circle cx='780' cy='130' r='150' fill='#67e8f9'/><circle cx='180' cy='430' r='170' fill='#a78bfa'/></g>${r?`<text x='68' y='450' fill='white' font-family='Inter, Arial' font-size='52' font-weight='700'>${r}</text>`:""}</svg>`;return `data:image/svg+xml;utf8,${encodeURIComponent(i)}`},"getDefaultGalleryImagePreviewSrc"),fu=a((e,t,{getFieldValue:o=Ki,shouldEnhanceMultimodal:r=true,isImageField:n=ul,isAudioField:i=pl}={})=>{if(!e||!r)return false;let s=o(e,t);return n(e,s)||i(e,s)},"isDefaultGalleryMediaColumn"),bu=a((e,t,{isMediaColumn:o=a(()=>false,"isMediaColumn")}={})=>!e||e.renderType==="icon"?false:!o(e,t),"isDefaultGalleryTitleCandidate"),gu=a((e,t,{isMediaColumn:o=a(()=>false,"isMediaColumn")}={})=>!e||e.renderType==="icon"?false:!o(e,t),"isDefaultGallerySummaryCandidate"),Gw=a((e,t,{compact:o=false,getFieldValue:r=Ki,getDisplayText:n=cl}={})=>{let i=r(e,t);return jsxRuntime.jsx("span",{className:m("leading-relaxed",o&&e?.wrap===true&&"line-clamp-2 block"),children:n(i)})},"renderDefaultGalleryFieldValue");var yB=a(e=>e==="compact"?2:e==="detailed"?6:4,"getDefaultGalleryDetailLimit"),xB=a((e,t)=>e===1||e===2||e===3?Number(e):t==="detailed"?1:2,"getNormalizedGalleryBentoColumns"),vB=a(({density:e,visibility:t,limit:o})=>{if(t==="all")return Number.POSITIVE_INFINITY;let r=Number.parseInt(String(o),10);return Number.isFinite(r)&&r>0?r:yB(e)},"getNormalizedGalleryDetailLimit"),wB=a(e=>e==="compact"?"p-3":e==="detailed"?"p-4":"p-3.5","getGalleryCardPaddingClassName"),kB=a((e,t)=>t?"h-auto w-full object-cover":e==="compact"?"h-32 w-full object-cover":e==="detailed"?"h-48 w-full object-cover":"h-40 w-full object-cover","getGalleryPreviewClassName"),CB=a(e=>e===1?"grid-cols-1":e===3?"grid-cols-1 sm:grid-cols-2 2xl:grid-cols-3":"grid-cols-1 sm:grid-cols-2","getGalleryDetailGridClassName");function SB(e){return xw(e)}a(SB,"getIconComponent");function TB(e){return e}a(TB,"defaultFormatLabel");function NB(e){return typeof e=="string"||typeof e=="number"?String(e):""}a(NB,"getLabelText");function hu({row:e,columns:t,onClick:o,cardInteraction:r="button",cardPresentation:n,renderCardSlot:i,renderCoverTitle:s,isSelected:l=false,isMasonry:d=false,galleryFieldKey:c="auto",galleryDensity:p="comfortable",galleryBentoColumns:u,galleryDetailVisibility:g="limit",galleryDetailLimit:f,galleryDetailPresentation:b="tiles",shouldEnhanceMultimodal:x=true,getFieldValue:y,isMediaColumn:k,isTitleCandidate:w,isSummaryCandidate:v,getDisplayText:h,renderFieldValue:S,getImagePreviewSrc:T,isImageField:C,isAudioField:R,AudioPlayerComponent:M,cardVariant:I="default",renderPreview:B,renderMeta:N,renderLeadingVisual:D,resolveRecordVisual:E,hiddenDetailFieldKeys:P=[],labels:W,formatLabel:H=TB,className:A}){let L=y||Ki,F=h||cl,G=C||ul,$=R||pl,_=T||_w,z=k||((Se,Je)=>fu(Se,Je,{getFieldValue:L,shouldEnhanceMultimodal:x,isImageField:G,isAudioField:$})),re=w||((Se,Je)=>bu(Se,Je,{isMediaColumn:z})),Z=v||((Se,Je)=>gu(Se,Je,{isMediaColumn:z})),ae=S||((Se,Je,{compact:bt}={})=>Gw(Se,Je,{compact:bt,getFieldValue:L,getDisplayText:F})),ee=I==="preview-only",q=I==="image-only",U=I==="chromatic-bento",O=(c!=="auto"?t.find(Se=>Se.key===c&&z(Se,e)):null)||(x?t.find(Se=>z(Se,e)):null),K=t.find(Se=>Se.renderType==="icon"),ne=K&&E?E(e[K.key],e,K):null,fe=SB(ne?.Icon||ne?.icon),he=O?L(O,e):null,me=O?G(O,he):false,ie=O?$(O,he):false,be=t.filter(Se=>Se.key!==O?.key&&Se.renderType!=="icon"),We=be.filter(Se=>{if(!Se||z(Se,e)||!re(Se,e))return false;let Je=L(Se,e);return !(Je==null||Je==="")})[0]||null,Ke=F(We?L(We,e):e.linkKey||e.id),Q=be.filter(Se=>Se&&Se.key!==We?.key&&!z(Se,e)&&Z(Se,e)).map(Se=>({column:Se,text:String(F(L(Se,e)))})),ge=(Q.find(({text:Se})=>Se!=="\u2014"&&Se.length>12)||Q.find(({text:Se})=>Se!=="\u2014"))?.column||null,we=ge?F(L(ge,e)):"",Ie=new Set(P),oe=be.filter(Se=>Se.key!==We?.key&&Se.key!==ge?.key&&!Ie.has(Se.key)),xe=vB({density:p,visibility:g,limit:f}),Ve=Number.isFinite(xe)?oe.slice(0,xe):oe,_e=p==="detailed",Ge=xB(u,p),le=wB(p),Me=CB(Ge),Ae=b==="lines",J=q?n?"block h-auto w-full":"block h-auto w-full transition-transform duration-500 group-hover:scale-[1.02]":kB(p,d),$e=typeof B=="function"?B({row:e,mediaColumn:O,mediaValue:he,isImageMedia:me,isAudioMedia:ie,iconVisual:ne,IconComponent:fe,previewClassName:J}):null,ue={row:e,contentColumns:be,detailColumns:oe,titleColumn:We,summaryColumn:ge,getDisplayText:F,getFieldValue:L},Re=N?.(ue)??null,se=D?.({...ue,iconVisual:ne})??null,te=!se&&ne?jsxRuntime.jsx("div",{className:m("flex h-9 w-9 items-center justify-center rounded-lg border",ne.chipClassName||"border-primary/20 bg-primary/10 text-primary"),children:rl(ne.Icon||ne.icon,m("h-4 w-4",ne.iconClassName||"text-primary"))}):null,Te=se||te,ze=U?"shrink-0 rounded-full border border-border/40 bg-muted/25 px-2.5 py-1 text-[10px] text-muted-foreground transition-all duration-300 group-hover:border-primary/30 group-hover:bg-primary/10 group-hover:text-primary dark:border-border/35 dark:bg-muted/15":"shrink-0 rounded-md border border-border/40 bg-muted/25 px-2 py-1 text-[10px] text-muted-foreground dark:border-border/35 dark:bg-muted/15",je=U?"rounded-xl border border-border/35 bg-muted/20 px-3 py-2.5 transition-all duration-300 group-hover:border-primary/25 group-hover:bg-primary/5 dark:border-border/30 dark:bg-muted/10":"rounded-lg border border-border/35 bg-muted/20 px-2.5 py-2 dark:border-border/30 dark:bg-muted/10",it=U?"text-[10px] uppercase tracking-[0.14em] text-muted-foreground transition-colors duration-300 group-hover:text-foreground":"text-[10px] uppercase tracking-[0.12em] text-muted-foreground",Y=U?"mt-1.5 text-[11px] text-muted-foreground transition-colors duration-300 group-hover:text-foreground [&_*]:max-w-full [&_pre]:text-[11px] [&_pre]:leading-relaxed":"mt-1.5 text-[11px] text-foreground [&_*]:max-w-full [&_pre]:text-[11px] [&_pre]:leading-relaxed",pe=W?.fieldCount?.(be.length),Be=W?.coverOnlyHint,rt=$e==null&&me&&O?_(he,e.id,O.label):void 0,Ce=$e??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[me&&O?jsxRuntime.jsx("div",{className:m("overflow-hidden bg-card/50",q?"rounded-[inherit] bg-transparent":ee?"rounded-[inherit]":"mb-3 rounded-lg border border-border/70"),children:jsxRuntime.jsx("img",{src:rt,style:Un(rt),alt:typeof he?.alt=="string"?he.alt:typeof he=="string"?he:String(O.label||""),className:J,loading:"lazy",referrerPolicy:"no-referrer",onError:Se=>{Se.currentTarget.onerror=null,Se.currentTarget.src=_("",e.id,O.label);}})}):null,!me&&ne&&ee?jsxRuntime.jsx("div",{className:m("flex items-center justify-center","rounded-[inherit] border py-10",ne.chipClassName||"border-primary/20 bg-primary/5"),children:rl(ne.Icon||ne.icon,m("h-10 w-10",ne.iconClassName||"text-primary"))}):null,ie&&M?jsxRuntime.jsx("div",{className:m(!ee&&"mb-3"),children:jsxRuntime.jsx(M,{filename:String(he)})}):null]}),Xe=n?Hw:null,de=n?.title?.fieldId?t.find(Se=>Se.key===n.title?.fieldId):We,Ee=s?s(e):de?F(L(de,e)):Ke,qe=!!n?.slots?.length,Le=qe||r==="container"?"div":"button";return jsxRuntime.jsxs(Le,{"data-gallery-card":true,"data-card-hover-effect":n?.hover?.effect,type:Le==="button"?"button":void 0,role:qe&&r==="button"&&o?"group":void 0,tabIndex:qe&&r==="button"&&o?0:void 0,onKeyDown:qe&&r==="button"&&o?Se=>{Se.target===Se.currentTarget&&(Se.key==="Enter"||Se.key===" ")&&(Se.preventDefault(),o());}:void 0,onClick:r==="button"?Se=>{(!qe||!Se.target.closest("button,a,input,select,textarea,[role=button],[role=menuitem]"))&&o?.();}:void 0,"aria-label":NB(Ke),className:m("group relative w-full rounded-lg text-left transition-all duration-300",q?"overflow-hidden bg-transparent p-0 shadow-none":ee?"overflow-hidden bg-transparent p-0":m("overflow-hidden border",U&&"shadow-none"),!ee&&!q&&le,!ee&&!q&&(l?U?"border-primary/35 bg-background/85 ring-1 ring-primary/20":"border-primary/40 bg-primary/10 ring-1 ring-primary/30":U?n?"workbench-surface-card":"workbench-surface-card hover:-translate-y-1 hover:border-primary/20":n?"workbench-surface-card":"workbench-surface-card hover:border-primary/30"),ee&&l&&"ring-1 ring-primary/30",q&&(l?"ring-1 ring-primary/30":!n&&"hover:-translate-y-0.5"),d?"block h-full w-full min-w-0":"h-full min-w-0",A),children:[U?jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_right,hsl(var(--primary)/0.18),transparent_40%),radial-gradient(circle_at_bottom_left,hsl(var(--accent)/0.18),transparent_45%)] opacity-0 transition-opacity duration-300",l?"opacity-100":"group-hover:opacity-100")}):null,jsxRuntime.jsxs("div",{className:m("relative z-[1]",(q||ee)&&"rounded-[inherit]"),children:[Xe&&n?jsxRuntime.jsx(Xe,{presentation:n,title:Ee,renderSlot:Se=>i?.(Se,ue),children:Ce}):Ce,!ee&&!q?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[Te?jsxRuntime.jsx("div",{className:"shrink-0",children:Te}):null,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[!n?.title&&jsxRuntime.jsx("div",{className:m("flex items-center gap-2 text-sm font-semibold",U?"text-muted-foreground transition-colors duration-300 group-hover:text-foreground":"text-foreground"),children:jsxRuntime.jsx("span",{className:"truncate",children:r==="container"&&o?jsxRuntime.jsx("button",{type:"button",onClick:o,className:"border-0 bg-transparent p-0 text-left hover:underline",style:{font:"inherit",color:"inherit"},children:Ke}):Ke})}),we&&we!==Ke?jsxRuntime.jsx("div",{className:m("mt-1 text-[11px] leading-5 text-muted-foreground",_e?"line-clamp-4":"line-clamp-2",U&&"transition-colors duration-300 group-hover:text-foreground"),children:we}):null]}),Re??(V(pe)?jsxRuntime.jsx("span",{className:ze,children:pe}):null)]})]}),Ve.length>0?jsxRuntime.jsx("div",{"data-gallery-detail-presentation":b,className:m("mt-3 grid grid-flow-row gap-2",Ae?"grid-cols-1":Me),children:Ve.map(Se=>jsxRuntime.jsxs("div",{className:Ae?"flex min-w-0 items-start gap-2 text-xs":je,children:[Se.label?jsxRuntime.jsx("div",{className:Ae?"shrink-0 text-muted-foreground":it,children:H(Se.label,{column:Se})}):null,jsxRuntime.jsx("div",{className:Ae?"min-w-0 text-foreground":m(Y,!Se.label&&"mt-0"),children:ae(Se,e,{compact:p!=="detailed",surface:"gallery"})})]},`${e.id||e.linkKey}-${Se.key}`))}):null,!We&&!we&&Ve.length===0&&V(Be)?jsxRuntime.jsx("div",{className:m("mt-3 text-[11px] text-muted-foreground",U&&"transition-colors duration-300 group-hover:text-foreground"),children:Be}):null]}):null]})]})}a(hu,"WorkbenchGalleryCard");function jw(e,t){let o=e==="rail"?"horizontal":"vertical";if(t&&t!=="auto"&&t!==o)throw new TypeError(`Gallery layout ${e} requires ${o} scrolling.`);return o}a(jw,"resolveGalleryScrollDirection");function IB(e,t,o,r,n){let i=Array.from({length:t},()=>0),s=0,l=0,d=e.map((c,p)=>{if(n==="rail")return {index:p,left:p*(o+r),top:0,width:o,height:c};if(n==="grid")return p>0&&p%t===0&&(s+=l+r,l=0),l=Math.max(l,c),{index:p,left:p%t*(o+r),top:s,width:o,height:c};let u=i.indexOf(Math.min(...i)),g=i[u];return i[u]=g+c+r,{index:p,left:u*(o+r),top:g,width:o,height:c}});return {placements:d,height:Math.max(0,...d.map(c=>c.top+c.height)),width:n==="rail"?Math.max(0,e.length*(o+r)-r):t*(o+r)-r}}a(IB,"placeWindowedItems");function DB(e,t,o,r,n){let i=t-n,s=t+o+n;return e.filter(l=>{let d=r?l.left:l.top;return d<=s&&d+(r?l.width:l.height)>=i})}a(DB,"visibleWindow");function Kw({items:e,getKey:t,layout:o,cardWidth:r,estimateHeight:n,getScrollOwner:i,railRef:s,tailRef:l,containerProps:d,getItemProps:c,renderItem:p}){let u=o.mode==="rail",g=u?1:o.columnCount,f=Math.max(1,u?r??280:o.columnWidth),b=ho.useRef(null),x=ho.useRef(new Map),y=ho.useRef(),[k,w]=ho.useState({width:f,heights:{}}),[v,h]=ho.useState({start:0,length:u?1280:720}),[S,T]=ho.useState(),[C,R]=ho.useState(),M=e.map(t),I=JSON.stringify(M),B=M.map((L,F)=>k.heights[L]??Math.max(1,n(e[F],f))),N=ho.useMemo(()=>IB(B,g,f,o.gap,u?"rail":o.mode==="grid"?"grid":"masonry"),[JSON.stringify(B),g,f,o.gap,u,o.mode]),D=ho.useCallback(()=>{let L=b.current,F=i();if(!L||!F)return;let G=L.getBoundingClientRect(),$=F.getBoundingClientRect(),_=F.offsetHeight>0?$.height/F.offsetHeight:1,z=u?F.scrollLeft:($.top-G.top)/(_||1)+F.clientTop,re=u?F.clientWidth:F.clientHeight;re<=0||h(Z=>Z.start===z&&Z.length===re?Z:{start:z,length:re});},[i,u]);ho.useLayoutEffect(()=>{D();},[D,N.height,N.width]),ho.useEffect(()=>{let L=i();if(!L)return;let F=0,G=a(()=>{F||(F=requestAnimationFrame(()=>{F=0,D();}));},"update");L.addEventListener("scroll",G,{passive:true}),window.addEventListener("resize",G);let $=typeof ResizeObserver=="function"?new ResizeObserver(G):void 0;return $?.observe(L),b.current&&$?.observe(b.current),()=>{L.removeEventListener("scroll",G),window.removeEventListener("resize",G),$?.disconnect(),cancelAnimationFrame(F);}},[i,D]),ho.useEffect(()=>{if(typeof ResizeObserver!="function")return;let L=new ResizeObserver(F=>{w(G=>{let $={...G.heights},_=G.width!==f;for(let z of F){let re=z.target.dataset.windowKey,Z=z.borderBoxSize?.[0]?.blockSize??z.target.offsetHeight;re!==void 0&&Z>0&&$[re]!==Z&&($[re]=Z,_=true);}return _?{width:f,heights:$}:G});});return y.current=L,x.current.forEach(F=>L.observe(F)),()=>{L.disconnect(),y.current=void 0;}},[f]),ho.useEffect(()=>{let L=new Set(M);w(F=>({width:F.width,heights:Object.fromEntries(Object.entries(F.heights).filter(([G])=>L.has(G)))}));},[I]);let E=a((L,F)=>{let G=x.current.get(L);if(G&&y.current?.unobserve(G),!F){x.current.delete(L);return}F.dataset.windowKey=L,x.current.set(L,F),y.current?.observe(F);},"register"),P=v.length,W=DB(N.placements,v.start,v.length,u,P),H=new Set(W.map(L=>L.index));for(let L of [S,C]){let F=L===void 0?-1:M.indexOf(L);F>=0&&H.add(F);}ho.useLayoutEffect(()=>{if(!C)return;let L=x.current.get(C)?.parentElement;L&&(L.focus(),L.scrollIntoView({block:"nearest",inline:"nearest"}),R(void 0));},[C]);let A={...o,columnWidth:f,itemWidth:f};return jsxRuntime.jsxs("div",{...d,ref:L=>{b.current=L,s&&(s.current=L);},"data-collection-windowed":"","data-collection-total":e.length,style:{...d.style,position:"relative",...u?{overflowX:"auto",height:N.height+12}:{height:N.height},overflowAnchor:"none"},children:[u?jsxRuntime.jsx("div",{"aria-hidden":"true",style:{width:N.width,height:1,pointerEvents:"none"}}):null,Array.from(H).sort((L,F)=>L-F).map(L=>{let F=e[L],G=M[L],$=N.placements[L],_=c(F,A);return jsxRuntime.jsx("div",{..._,"aria-posinset":L+1,"aria-setsize":e.length,onFocus:z=>{T(G),_.onFocus?.(z);},onBlur:z=>{z.currentTarget.contains(z.relatedTarget)||T(void 0),_.onBlur?.(z);},onKeyDown:z=>{if(z.target===z.currentTarget){let re=u?1:g,Z=z.key==="Home"?0:z.key==="End"?e.length-1:z.key==="ArrowRight"?L+1:z.key==="ArrowLeft"?L-1:z.key==="ArrowDown"?L+re:z.key==="ArrowUp"?L-re:void 0;if(Z!==void 0){z.preventDefault(),R(M[Math.min(e.length-1,Math.max(0,Z))]);return}}_.onKeyDown?.(z);},style:{..._.style,position:"absolute",left:$.left,top:$.top,width:$.width},children:jsxRuntime.jsx("div",{ref:z=>E(G,z),children:p(F,A)})},G)}),l?jsxRuntime.jsx("div",{ref:l,"aria-hidden":"true",style:{position:"absolute",left:Math.max(0,N.width-1),top:0,width:1,height:1}}):null]})}a(Kw,"WorkbenchWindowedLayout");var AB=12,BB=8,Xw=280,Zw=240,LB=typeof window>"u"?ho.useEffect:ho.useLayoutEffect;function wu(e,t,o){return Math.min(Math.max(e,t),o)}a(wu,"clamp");function WB(e){if(typeof window>"u")return 16;let t=e||document.documentElement,o=Number.parseFloat(window.getComputedStyle(t).fontSize);return Number.isFinite(o)&&o>0?o:16}a(WB,"getRootFontSize");function ku(e,t,o){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let r=e.trim().toLowerCase();if(!r)return t;if(/^\d+(\.\d+)?$/.test(r)){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("px")){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("rem")){let n=Number.parseFloat(r);return !Number.isFinite(n)||n<=0?t:n*WB(o)}return t}a(ku,"resolveLengthToPixels");function Qw(e,t){let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return false;for(let n of r)if(e[n]!==t[n])return false;return true}a(Qw,"areMeasurementMapsEqual");function zB({containerWidth:e,itemCount:t,targetColumnWidth:o,gap:r}){if(!e)return 1;let n=Math.max(t,1),i=Math.max(1,Math.min(n,Math.ceil((e+r)/(Math.max(o*.58,1)+r)))),s=1,l=Number.POSITIVE_INFINITY;for(let d=1;d<=i;d+=1){let c=(e-r*Math.max(d-1,0))/d;if(!Number.isFinite(c)||c<=0)continue;let p=Math.max(0,o*.78-c),u=Math.max(0,c-o*1.35),g=Math.abs(c-o)+p*3+u*2;g<l&&(l=g,s=d);}return s}a(zB,"getMasonryColumnCount");function OB({size:e,columnWidth:t,columnCount:o,gap:r}){if(Number.isFinite(e?.columnSpan)&&Number(e?.columnSpan)>0)return wu(Math.round(Number(e?.columnSpan)),1,o);let n=ku(e?.width,t,null);return wu(Math.ceil((n+r)/(t+r)),1,o)}a(OB,"getItemColumnSpan");function FB({size:e,measuredHeight:t,rowHeight:o,gap:r}){if(Number.isFinite(e?.rowSpan)&&Number(e?.rowSpan)>0)return Math.max(1,Math.round(Number(e?.rowSpan)));let n=Number.isFinite(t)&&Number(t)>0?Number(t):ku(e?.height,Zw,null);return Math.max(1,Math.ceil((n+r)/(o+r)))}a(FB,"getItemRowSpan");function HB({size:e,measuredHeight:t}){return Number.isFinite(t)&&Number(t)>0?Number(t):ku(e?.height,Zw,null)}a(HB,"getResolvedItemHeight");function Yi({items:e=[],renderItem:t,getItemKey:o=a((g,f)=>g?.id??g?.key??f,"getItemKey"),getItemSize:r,columnWidth:n=Xw,columnCount:i,gap:s=AB,rowHeight:l=BB,placementStrategy:d="shelf",containerProps:c,getItemProps:p,className:u}){let g=ho.useRef(null),f=ho.useRef(new Map),b=ho.useRef(null),[x,y]=ho.useState(0),[k,w]=ho.useState({}),v=ho.useMemo(()=>e.map((N,D)=>String(o(N,D))),[o,e]),h=v.join("|");ho.useEffect(()=>{let N=g.current;if(!N)return;let D=a(()=>{let E=Math.round(N.getBoundingClientRect().width);y(P=>P===E?P:E);},"updateWidth");if(D(),typeof ResizeObserver=="function"){let E=new ResizeObserver(()=>D());return E.observe(N),()=>E.disconnect()}return window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]),ho.useEffect(()=>{w(N=>{let D=new Set(v),E=Object.fromEntries(Object.entries(N).filter(([P])=>D.has(P)));return Qw(N,E)?N:E});},[v,h]);let S=ku(n,Xw,g.current),T=d==="dense",R=(Number.isFinite(i)&&Number(i)>0?wu(Math.round(Number(i)),1,24):void 0)||zB({containerWidth:x,itemCount:e.length,targetColumnWidth:S,gap:s}),M=x>0?(x-s*Math.max(R-1,0))/R:S,I=ho.useMemo(()=>e.map((N,D)=>{let E=v[D],P=typeof r=="function"?r(N,{columnCount:R,columnWidth:M,containerWidth:x,gap:s,placementStrategy:d,rowHeight:l})||{}:{};return {key:E,item:N,size:P,columnSpan:OB({size:P,columnWidth:M,columnCount:R,gap:s}),rowSpan:FB({size:P,measuredHeight:k[E],rowHeight:l,gap:s})}}),[R,x,s,r,v,e,k,d,M,l]);LB(()=>{let N={};f.current.forEach((D,E)=>{let P=Math.ceil(D.getBoundingClientRect().height);Number.isFinite(P)&&P>0&&(N[E]=P);}),w(D=>{if(!Object.keys(N).length)return D;let E={...D,...N};return Qw(D,E)?D:E});},[R,T,h,M]),ho.useEffect(()=>{if(typeof ResizeObserver!="function")return;let N=new ResizeObserver(D=>{w(E=>{let P={...E},W=false;for(let H of D){let A=H.target.dataset.masonryKey;if(!A)continue;let L=Math.ceil(H.contentRect.height);!Number.isFinite(L)||L<=0||P[A]===L||(P[A]=L,W=true);}return W?P:E});});return b.current=N,f.current.forEach(D=>N.observe(D)),()=>{N.disconnect(),b.current=null;}},[T,h]);let B=a((N,D)=>{let E=f.current,P=E.get(N);if(P&&P!==D&&b.current&&b.current.unobserve(P),!D){E.delete(N);return}D.dataset.masonryKey=N,E.set(N,D),b.current&&b.current.observe(D);},"registerItemNode");if(!T){let N=(()=>{let D=Array.from({length:R},()=>0),E=0,P=0,W=I.map(({key:H,item:A,columnSpan:L,rowSpan:F,size:G})=>{let $=wu(L,1,R),_=E;if(d==="shortest"){let q=Number.POSITIVE_INFINITY;for(let U=0;U<=R-$;U+=1){let X=Math.max(...D.slice(U,U+$));X<q&&(q=X,_=U);}}else _+$>R&&(_=0),_=Math.min(_,R-$);let z=M*$+s*Math.max($-1,0),re=HB({size:G,measuredHeight:k[H]}),Z=Math.max(...D.slice(_,_+$)),ae=_*(M+s),ee=Z+re;for(let q=_;q<_+$;q+=1)D[q]=ee+s;return P=Math.max(P,ee),d!=="shortest"&&(E=_+$,E>=R&&(E=0)),{key:H,item:A,columnSpan:$,itemHeight:re,itemWidth:z,left:ae,rowSpan:F,size:G,top:Z}});return {containerHeight:Math.max(0,P),positionedItems:W}})();return jsxRuntime.jsx("div",{ref:g,...c,className:m("relative w-full",u,c?.className),style:{...c?.style,height:`${N.containerHeight}px`},children:N.positionedItems.map(({key:D,item:E,columnSpan:P,rowSpan:W,size:H,itemWidth:A,left:L,top:F})=>{let G=x<=0&&R===1,$=G?"100%":`${A}px`,_={columnCount:R,columnSpan:P,columnWidth:M,containerWidth:x,gap:s,itemWidth:A,placementStrategy:d,rowSpan:W,rowHeight:l,size:H},z=p?.(E,_);return jsxRuntime.jsx("div",{...z,className:m("absolute min-w-0",z?.className),style:{...z?.style,left:G?0:`${L}px`,top:`${F}px`,width:$,maxWidth:$},children:jsxRuntime.jsx("div",{ref:re=>B(D,re),role:"presentation",className:"min-w-0",children:t(E,_)})},D)})})}return jsxRuntime.jsx("div",{ref:g,...c,className:m("grid w-full items-start",u,c?.className),style:{...c?.style,gap:`${s}px`,gridAutoFlow:"row dense",gridAutoRows:`${l}px`,gridTemplateColumns:`repeat(${R}, minmax(0, 1fr))`},children:I.map(({key:N,item:D,columnSpan:E,rowSpan:P,size:W})=>{let H={columnCount:R,columnSpan:E,columnWidth:M,containerWidth:x,gap:s,placementStrategy:d,rowSpan:P,rowHeight:l,size:W},A=p?.(D,H);return jsxRuntime.jsx("div",{...A,className:m("min-w-0",A?.className),style:{...A?.style,gridColumn:`span ${E}`,gridRow:`span ${P}`},children:jsxRuntime.jsx("div",{ref:L=>B(N,L),role:"presentation",className:"min-w-0",children:t(D,H)})},N)})})}a(Yi,"WorkbenchMasonryLayout");var _B=12,GB=[1],$B=[4/3],jB=[1,4/5,3/2,3/4,5/4],UB=.5,KB=2,qB="hsl(var(--monkeys-color-muted, var(--muted)))";function Cu(e,t,o){return Math.min(Math.max(e,t),o)}a(Cu,"clamp");function Wf(e,t,o){return typeof e!="number"||!Number.isFinite(e)||e<=0?t:Cu(Math.round(e),1,o)}a(Wf,"normalizeCount");function YB(e){return e==="masonry"||e==="dense"?jB:e==="rail"?$B:GB}a(YB,"getDefaultAspectRatios");function XB(e,t){let o=t?.filter(r=>typeof r=="number"&&Number.isFinite(r)&&r>0).map(r=>Cu(r,UB,KB));return o?.length?o:YB(e)}a(XB,"resolveAspectRatios");function ek(e){return Wf(e?.count,_B,48)}a(ek,"resolveWorkbenchCollectionSkeletonCapacity");function tk(e){if(e===void 0)return "skeleton";if(e==="skeleton"||e==="spinner")return e;throw new TypeError('WorkbenchCollection loading.variant must be "skeleton" or "spinner".')}a(tk,"resolveWorkbenchCollectionLoadingVariant");function QB({columnCount:e,config:t,phase:o}){if(o==="initial"){let n=Cu(e*2,6,24);return Wf(t?.count,n,48)}let r=Cu(e,1,12);return Wf(t?.loadMoreCount,r,24)}a(QB,"resolveSkeletonCount");function Jw(e,t){return Math.max(1,e/t)}a(Jw,"getSkeletonHeight");function zf({mode:e,phase:t,columnCount:o,columnWidth:r,cardWidth:n,gap:i,rowHeight:s,config:l,ariaLabel:d,className:c}){let p=QB({columnCount:o,config:l,phase:t}),u=XB(e,l?.aspectRatios),g=l?.animated??true,f=ho.useMemo(()=>Array.from({length:p},(x,y)=>({aspectRatio:u[y%u.length],key:`${t}-${y}`,index:y})),[u,p,t]),b=a((x,y)=>jsxRuntime.jsx(Qd,{index:x.index,children:jsxRuntime.jsx(na,{variant:"block",animated:g,className:"h-auto w-full rounded-lg",style:{backgroundColor:qB,...y??{aspectRatio:String(x.aspectRatio)}},"data-collection-skeleton-item":"","data-skeleton-aspect-ratio":x.aspectRatio})}),"renderSkeleton");return jsxRuntime.jsx(qn,{animation:l?.animation,animated:g,children:jsxRuntime.jsx("div",{role:"status","aria-label":d,"aria-atomic":"true","data-collection-loading":t,"data-layout-mode":e,className:"min-w-0",children:e==="masonry"||e==="dense"?jsxRuntime.jsx(Yi,{items:f,columnCount:o,columnWidth:r,gap:i,rowHeight:s,placementStrategy:e==="dense"?"dense":"shortest",className:c,containerProps:{"aria-hidden":true},getItemKey:x=>x.key,getItemSize:(x,y)=>({height:Jw(y.columnWidth,x.aspectRatio)}),renderItem:(x,y)=>b(x,{height:`${Jw(y.columnWidth,x.aspectRatio)}px`})}):e==="rail"?jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("grid min-w-0 grid-flow-col items-start overflow-x-auto",c),style:{gap:i,gridAutoColumns:typeof n=="number"?`${n}px`:n??`${r}px`},children:f.map(x=>jsxRuntime.jsx("div",{children:b(x)},x.key))}):jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("grid min-w-0 items-start",c),style:{gap:i,gridTemplateColumns:`repeat(${o}, minmax(0, 1fr))`},children:f.map(x=>jsxRuntime.jsx("div",{children:b(x)},x.key))})})})}a(zf,"WorkbenchCollectionSkeleton");function JB(e,t){if(e.size!==t.size)return false;for(let o of e)if(!t.has(o))return false;return true}a(JB,"setsEqual");function e5(e){return String(e)}a(e5,"getComparableKey");function t5(e){return e==="multiple"?"toggle":"replace"}a(t5,"getDefaultBehavior");function Su({items:e,getItemKey:t,mode:o="none",behavior:r,selectedKeys:n,defaultSelectedKeys:i,isItemDisabled:s,onSelectionChange:l}){let d=n!==void 0,[c,p]=ho.useState(()=>new Set(i??[])),u=ho.useRef(null),g=ho.useRef(l);g.current=l;let f=ho.useMemo(()=>{let h=new Map;return e.map((S,T)=>{let C=t(S,T),R=e5(C),M=h.get(R);if(M!==void 0)throw new TypeError(`useWorkbenchCollectionSelection received duplicate item key "${R}" at indices ${M} and ${T}.`);return h.set(R,T),{item:S,index:T,key:C}})},[t,e]),b=ho.useMemo(()=>{let h=new Map;return f.forEach(S=>h.set(S.key,S)),h},[f]),x=ho.useMemo(()=>o==="none"?new Set:d?new Set(n??[]):c,[d,n,c,o]),y=ho.useRef(x);y.current=x;let k=ho.useCallback(()=>{u.current=null;},[]);ho.useEffect(()=>{if(d)return;let h=new Set(f.map(({key:S})=>S));p(S=>{let T=new Set(Array.from(S).filter(C=>h.has(C)));return JB(S,T)?S:(y.current=T,T)});},[d,f]),ho.useEffect(()=>{let h=u.current;if(o!=="multiple"||x.size===0||h===null){k();return}let S=b.get(h);(!S||s?.(S.item,S.index))&&k();},[s,b,o,k,x.size]);let w=ho.useCallback((h,S={})=>{if(o==="none")return;let T=b.get(h);if(!T||s?.(T.item,T.index))return;let C=new Set(y.current),R=r??t5(o),M=S.shiftKey&&o==="multiple"?"range":S.behavior??R;o==="single"&&(M=M==="toggle"?"toggle":"replace");let I=u.current===null?void 0:b.get(u.current),B=!!(I&&!s?.(I.item,I.index));o==="multiple"&&M==="range"&&!B&&(M=R==="range"?"toggle":R);let N=new Set;if(o==="single")M==="toggle"&&C.has(T.key)||N.add(T.key);else if(M==="range"&&I){C.forEach(P=>N.add(P));let D=Math.min(I.index,T.index),E=Math.max(I.index,T.index);f.slice(D,E+1).forEach(P=>{s?.(P.item,P.index)||N.add(P.key);});}else M==="replace"?N.add(T.key):(C.forEach(D=>N.add(D)),N.has(T.key)?N.delete(T.key):N.add(T.key));u.current=o==="multiple"?T.key:null,d||(y.current=N,p(N)),g.current?.(N,{item:T.item,index:T.index,key:T.key,behavior:M});},[r,d,s,b,o,f]),v=ho.useCallback(h=>x.has(h),[x]);return {mode:o,selectedKeys:x,isSelected:v,selectKey:w,resetAnchor:k}}a(Su,"useWorkbenchCollectionSelection");var Gf=12,n5=8,Nu=280,a5=640,i5=1024,ik=24;function Ru(e,t,o){return Math.min(Math.max(e,t),o)}a(Ru,"clamp");function Rr(e,t){return typeof e=="function"?e(t):e}a(Rr,"resolveRenderableSlot");function Qi(e,t,o){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let r=e.trim().toLowerCase();if(!r)return t;if(/^\d+(\.\d+)?(px)?$/.test(r)){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("rem")){let n=Number.parseFloat(r),i=typeof window>"u"?16:Number.parseFloat(window.getComputedStyle(o||document.documentElement).fontSize)||16;return Number.isFinite(n)&&n>0?n*i:t}return t}a(Qi,"resolveLengthToPixels");function Tu(e){if(!(typeof e!="number"||!Number.isFinite(e)||e<=0))return Ru(Math.round(e),1,ik)}a(Tu,"normalizeColumns");function rk(e,t){if(e==="auto"||e===void 0)return;if(typeof e=="number")return Tu(e);let o=Tu(e.mobile),r=Tu(e.tablet),n=Tu(e.desktop);return t>=i5?n??r??o:t>=a5?r??o??n:o??r??n}a(rk,"resolveResponsiveColumns");function s5({containerWidth:e,itemCount:t,gap:o,columns:r,underfilledBehavior:n,maxColumns:i,minCardWidth:s,idealCardWidth:l,maxCardWidth:d,node:c}){let p=rk(r,e),u=rk(i,e);if(p)return u?Math.min(p,u):p;if(!e)return 1;let g=Qi(l,Nu,c),f=Qi(s,g*.78,c),b=Math.max(f,Qi(d,g*1.35,c)),x=Math.max(t,1),y=Math.max(1,Math.min(n==="preserve-columns"?ik:x,Math.ceil((e+o)/(Math.max(f*.75,1)+o)))),k=1,w=Number.POSITIVE_INFINITY;for(let v=1;v<=y;v+=1){let h=(e-o*Math.max(v-1,0))/v;if(!Number.isFinite(h)||h<=0)continue;let S=Math.abs(h-g)+Math.max(0,f-h)*3+Math.max(0,h-b)*2;S<w&&(w=S,k=v);}return u?Math.min(k,u):k}a(s5,"resolveColumnCount");function nk(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:Gf}a(nk,"normalizeGap");function l5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n5}a(l5,"normalizeRowHeight");function d5(e){return typeof e=="number"&&Number.isFinite(e)?Ru(e,0,1):0}a(d5,"normalizeThreshold");function c5(e,t,o){let r=Number.isFinite(t)&&Number(t)>0?Number(t):void 0,n=e?.height??(r?Math.max(1,o/r):void 0);return {...e,height:n}}a(c5,"normalizeItemSize");function u5(e,t){if(e&&typeof e=="object"){let o=e;if(typeof o.id=="string"||typeof o.id=="number")return o.id;if(typeof o.key=="string"||typeof o.key=="number")return o.key}return t}a(u5,"getDefaultItemKey");function p5(e){return `@inf-monkeys-tech/monkeys-design:workbench-collection:${e}`}a(p5,"getScrollStorageKey");function m5(e){let t=e?.parentElement??null;for(;t;){if(typeof window>"u")return t;let o=window.getComputedStyle(t).overflowY;if(o==="auto"||o==="scroll")return t;t=t.parentElement;}return null}a(m5,"getParentScrollOwner");function ak(e,t){if(typeof Element>"u"||!(e instanceof Element)||e===t)return false;let o=e.closest('a, button, input, select, textarea, summary, [contenteditable="true"], [data-collection-action]');return !!(o&&t.contains(o))}a(ak,"isInteractiveEventTarget");function f5(e){if(!(!Number.isFinite(e)||Number(e)<=0))return Ru(Math.round(Number(e)),1,12)}a(f5,"normalizeTitleMaxLines");function kn({items:e,config:t,renderItem:o,slots:r,callbacks:n,className:i,classNames:s,style:l,ariaLabel:d}){let c=ke(),p=Ye().workbench.collection,u=Wr(),g=On(),f=ho.useId().replace(/:/g,""),b=ho.useRef(null),x=ho.useRef(null),y=ho.useRef(null),k=ho.useRef(null),w=ho.useRef(false),v=ho.useRef(false),h=ho.useRef(false),S=ho.useRef(false),T=ho.useRef(null),C=ho.useRef(null),R=ho.useRef(void 0),M=ho.useRef(false),[I,B]=ho.useState(0),[N,D]=ho.useState(Gf),[E,P]=ho.useState(null),W=ho.useRef(n);W.current=n;let H=ho.useCallback(de=>{y.current=de,P(de);},[]),A=t.layout.mode;if(A!=="grid"&&A!=="masonry"&&A!=="dense"&&A!=="rail")throw new TypeError(`WorkbenchCollection layout.mode "${String(A)}" is not supported.`);let L=t.layout.gap===void 0?N:nk(t.layout.gap),F=l5(t.layout.rowHeight),G=t.getItemKey??u5,$=ho.useMemo(()=>e.map((de,Ee)=>{let qe=G(de,Ee);return {item:de,index:Ee,key:qe,stringKey:String(qe)}}),[G,e]),_=$.map(({stringKey:de})=>de).join(""),z=t.state,re=z?.loading===true,Z=z?.loadingMore===true,ae=z?.hasMore===true,ee=tk(t.loading?.variant),q=re&&$.length===0&&ee==="skeleton"?ek(t.loading?.skeleton):$.length,U=t.selection?.mode??"none",X=ho.useCallback(de=>t.selection?.isItemDisabled?.(de.item,de.index)??false,[t.selection?.isItemDisabled]),O=ho.useCallback(de=>de.key,[]),K=ho.useCallback((de,Ee)=>{W.current?.onSelectionChange?.(de,{item:Ee.item.item,key:Ee.key,behavior:Ee.behavior});},[]),{selectedKeys:ne,selectKey:fe}=Su({items:$,getItemKey:O,mode:U,behavior:t.selection?.behavior,selectedKeys:t.selection?.selectedKeys,defaultSelectedKeys:t.selection?.defaultSelectedKeys,isItemDisabled:X,onSelectionChange:K});ho.useEffect(()=>{let de=E;if(!de)return;let Ee=a(()=>{if(t.layout.gap===void 0&&b.current){let Le=Number.parseFloat(window.getComputedStyle(b.current).columnGap);D(Number.isFinite(Le)&&Le>=0?Le:Gf);}let qe=de.clientWidth;B(Le=>Le===qe?Le:qe);},"updateWidth");if(Ee(),typeof ResizeObserver=="function"){let qe=new ResizeObserver(Ee);return qe.observe(de),()=>qe.disconnect()}if(!(typeof window>"u"))return window.addEventListener("resize",Ee),()=>window.removeEventListener("resize",Ee)},[E,t.layout.gap,l?.gap,g]);let he=s5({containerWidth:I,itemCount:q,gap:L,columns:t.layout.columns,underfilledBehavior:t.layout.underfilledBehavior,maxColumns:t.layout.maxColumns,minCardWidth:t.layout.minCardWidth,idealCardWidth:t.layout.idealCardWidth??t.layout.columnWidth,maxCardWidth:t.layout.maxCardWidth,node:y.current}),me=I>0?Math.max(0,(I-L*Math.max(he-1,0))/he):Qi(t.layout.cardWidth??t.layout.columnWidth??t.layout.idealCardWidth,Nu,y.current),ie=t.layout.placementStrategy??(A==="dense"?"dense":A==="masonry"?"shortest":"shelf"),be=ho.useMemo(()=>({collection:t.labels?.collection??p.label,loading:t.labels?.loading??p.loading,empty:t.labels?.empty??p.empty,loadError:t.labels?.loadError??p.loadError,refreshError:t.labels?.refreshError??p.refreshError,retry:t.labels?.retry??p.retry,loadingMore:t.labels?.loadingMore??p.loadingMore,permission:t.labels?.permission??p.permission,offline:t.labels?.offline??p.offline,requestAccess:t.labels?.requestAccess??p.requestAccess}),[t.labels,p]),He=ho.useMemo(()=>{let de=t.virtualization;return de?.enabled!==true||de.fallback!=="error"?null:de.adapter?de.adapter.supports?.(A)===false?new Error(`WorkbenchCollection virtualization adapter does not support mode "${A}".`):null:new Error("WorkbenchCollection virtualization requires an adapter.")},[t.virtualization,A]),We=ho.useMemo(()=>({mode:A,columnCount:he,columnWidth:me,containerWidth:I,gap:L,itemCount:$.length}),[he,me,I,L,A,$.length]);ho.useEffect(()=>{W.current?.onLayoutChange?.(We),I>0&&!M.current&&(M.current=true,W.current?.onLayoutReady?.(We));},[We,I]),ho.useEffect(()=>{M.current=false;},[A]);let Ke=ho.useCallback(()=>{let de=t.layout.scrollOwner;return de&&de!=="self"&&de!=="parent"?de:A==="rail"?x.current:de==="parent"?m5(b.current):b.current},[t.layout.scrollOwner,A]);ho.useEffect(()=>{let de=t.scrollRestorationKey?.trim();if(!de||typeof window>"u")return;let Ee=Ke();if(!Ee)return;let qe=p5(de);try{let Se=Number.parseFloat(window.sessionStorage.getItem(qe)??"");Number.isFinite(Se)&&Se>=0&&(Ee.scrollTop=Se);}catch{}let Le=a(()=>{try{window.sessionStorage.setItem(qe,String(Ee.scrollTop));}catch{}},"saveScrollPosition");return Ee.addEventListener("scroll",Le,{passive:true}),()=>{Le(),Ee.removeEventListener("scroll",Le);}},[t.scrollRestorationKey,Ke]);let ce=typeof n?.onLoadMore=="function",Q=z?.error??He;ho.useEffect(()=>{(!ce||!ae)&&(v.current=false,h.current=false,S.current=false);},[ce,ae]);let ge=ho.useCallback(()=>{if(!ce||!ae||Z||w.current)return;w.current=true;let de=a(()=>{w.current=false;},"releaseRequest");try{let Ee=W.current?.onLoadMore?.();Ee&&typeof Ee.then=="function"?Ee.then(de,de):de();}catch(Ee){throw de(),Ee}},[ce,ae,Z]);ho.useEffect(()=>{let de=k.current;if((T.current!==de||C.current!==_||R.current!==t.loading?.pageKey)&&(T.current=de,C.current=_,R.current=t.loading?.pageKey,v.current=false,h.current=false,S.current=false),!de||!ce||!ae||typeof IntersectionObserver!="function")return;let Ee=Ke(),qe=false,Le=true,Se=new IntersectionObserver(xt=>{if(!Le)return;let Gt=xt.some(wa=>wa.isIntersecting);if(!(Gt&&(Z||w.current))){if(S.current){if(qe=true,S.current=false,v.current=Gt,!Gt){h.current=false;return}if(h.current)return;h.current=true,ge();return}if(!qe){qe=true,v.current=Gt,Gt||(h.current=false),Gt&&t.loading?.autoFill&&!h.current&&(h.current=true,ge());return}if(!Gt){v.current=false,h.current=false;return}v.current||(v.current=true,h.current=true,ge());}},{root:Ee===b.current?Ee:Ee||null,rootMargin:t.loading?.rootMargin??"240px",threshold:d5(t.loading?.threshold)}),Je=Ee??(typeof window>"u"?null:window),bt=a(()=>{!v.current||h.current||S.current||(S.current=true,Se.unobserve(de),Se.takeRecords(),Se.observe(de));},"validateActiveIntersection");return Se.observe(de),Je?.addEventListener("scroll",bt,{passive:true}),()=>{Le=false,Se.disconnect(),Je?.removeEventListener("scroll",bt);}},[ce,t.loading?.autoFill,t.loading?.pageKey,t.loading?.rootMargin,t.loading?.threshold,ae,_,Z,$.length,ge,Ke]),ho.useEffect(()=>{if(!t.loading?.autoFill||!ce||!ae||Z||h.current||w.current||!k.current)return;let Ee=Ke()??(t.layout.scrollOwner==="parent"?b.current?.parentElement??null:null)??b.current;if(!Ee)return;let qe=A==="rail"?Ee.clientWidth:Ee.clientHeight,Le=A==="rail"?Ee.scrollWidth:Ee.scrollHeight;qe<=0||Le<=qe+1&&(h.current=true,ge());},[ce,t.layout.scrollOwner,t.loading?.autoFill,t.loading?.pageKey,ae,_,Z,$.length,ge,Ke,A]);let we=ho.useMemo(()=>{if(!t.grouping)return [{key:"__all__",stringKey:"__all__",items:$}];let de=new Map;return $.forEach(Ee=>{let qe=t.grouping?.getGroupKey(Ee.item,Ee.index)??"__all__",Le=String(qe),Se=de.get(Le);if(Se){Se.items.push(Ee);return}de.set(Le,{key:qe,stringKey:Le,label:t.grouping?.getGroupLabel?.(qe,Ee.item),items:[Ee]});}),Array.from(de.values())},[t.grouping,$]),Ie=ho.useCallback((de,Ee)=>{let qe=t.selection?.isItemDisabled?.(de.item,de.index)??false,Le={item:de.item,index:de.index,key:de.key,status:t.getItemStatus?.(de.item,de.index)??"idle",disabled:qe,selected:ne.has(de.key),selectionMode:U,layout:Ee,select:a(Se=>fe(de.key,{behavior:Se}),"select"),selectFromEvent:a((Se,Je)=>fe(de.key,{behavior:Je,shiftKey:Se.shiftKey}),"selectFromEvent"),preview:a(()=>n?.onItemPreview?.(de.item,Le),"preview"),detail:a(()=>n?.onItemDetail?.(de.item,Le),"detail"),renderSlot:a(Se=>r?.item?.[Se]?.(de.item,Le),"renderSlot"),notifyMediaLoad:a(()=>n?.onMediaLoad?.(de.item,Le),"notifyMediaLoad"),notifyMediaError:a(Se=>n?.onMediaError?.(de.item,Le,Se),"notifyMediaError")};return Le},[n,t.getItemStatus,t.selection,ne,fe,U,r?.item]),oe=ho.useCallback((de,Ee)=>{let qe=a(Le=>{Le.target!==Le.currentTarget||Le.key!=="Enter"&&Le.key!==" "||(Le.preventDefault(),U!=="none"?Ee.selectFromEvent(Le):n?.onItemClick?.(de.item,Ee,Le));},"handleKeyboard");return {id:`${f}-item-${de.index}`,"data-monkeys-collection-item":"","data-item-key":de.stringKey,"data-selected":Ee.selected||void 0,"data-disabled":Ee.disabled||void 0,"data-status":Ee.status,role:U==="none"?"listitem":"option","aria-selected":U==="none"?void 0:Ee.selected,"aria-disabled":Ee.disabled||void 0,tabIndex:n?.onItemClick||U!=="none"||t.item?.title?.visibility==="hover"?0:void 0,draggable:n?.onItemDragStart?true:void 0,className:m("min-w-0 group/workbench-collection-item outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t.appearance?.hover&&t.appearance.hover!=="none"&&"transition-[transform,box-shadow,background-color] duration-200",t.appearance?.hover==="highlight"&&"hover:bg-muted/30",t.appearance?.hover==="lift"&&"hover:-translate-y-0.5 motion-reduce:transform-none",t.appearance?.hover==="scale"&&"hover:scale-[1.01] motion-reduce:transform-none",t.appearance?.hover==="shadow"&&"hover:shadow-md",t.appearance?.hover==="lift-shadow"&&"hover:-translate-y-0.5 hover:shadow-md motion-reduce:transform-none",t.appearance?.selection==="ring"&&Ee.selected&&"ring-2 ring-primary",t.appearance?.selection==="outline"&&Ee.selected&&"outline outline-2 outline-primary",s?.item),onClick:a(Le=>{ak(Le.target,Le.currentTarget)||(U!=="none"&&Ee.selectFromEvent(Le),n?.onItemClick?.(de.item,Ee,Le));},"onClick"),onDoubleClick:a(Le=>{ak(Le.target,Le.currentTarget)||n?.onItemDoubleClick?.(de.item,Ee,Le);},"onDoubleClick"),onMouseEnter:a(Le=>n?.onItemHoverChange?.(de.item,Ee,true,Le),"onMouseEnter"),onMouseLeave:a(Le=>n?.onItemHoverChange?.(de.item,Ee,false,Le),"onMouseLeave"),onKeyDown:qe,onDragStart:a(Le=>n?.onItemDragStart?.(de.item,Ee,Le),"onDragStart"),onDragOver:n?.onItemDrop?Le=>Le.preventDefault():void 0,onDrop:a(Le=>n?.onItemDrop?.(de.item,Ee,Le),"onDrop")}},[n,s?.item,f,t.appearance,t.item?.title?.visibility,U]),xe=ho.useCallback((de,Ee)=>{let qe=o(de.item,Ee),Le=t.item?.title,Se=Le?.visibility??"always",Je=Le&&Se!=="never"?Le.getContent?.(de.item,Ee)??Ee.renderSlot("title"):null,bt=!!(Le&&V(Je)),xt=Le?.placement??"below",Gt=bt&&xt.startsWith("overlay-"),wa=f5(Le?.maxLines),en=Le?.surface??(Gt?"scrim":"none"),ms=bt?jsxRuntime.jsx("div",{"data-collection-item-title":"","data-title-placement":xt,"data-title-visibility":Se,className:m("min-w-0 px-1 py-2 text-sm font-medium text-foreground",Le?.align==="center"&&"text-center",Le?.align==="end"&&"text-right",Se==="hover"&&"!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100",Gt&&"pointer-events-none absolute inset-x-0 z-10 px-3 py-2",xt==="overlay-top"&&"top-0",xt==="overlay-center"&&"top-1/2 -translate-y-1/2 motion-reduce:transform-none",xt==="overlay-bottom"&&"bottom-0",en==="surface"&&"bg-background/90 backdrop-blur-sm",en==="scrim"&&xt==="overlay-top"&&"bg-gradient-to-b from-background/90 to-transparent pb-8",en==="scrim"&&xt==="overlay-bottom"&&"bg-gradient-to-t from-background/90 to-transparent pt-8",en==="scrim"&&xt==="overlay-center"&&"bg-background/75 backdrop-blur-sm",!!wa&&"overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]",s?.itemTitle),style:wa?{WebkitLineClamp:wa}:void 0,children:Je}):null,Eo=t.item?.actions,Za=Eo?.visibility??"always",fs=Eo&&Za!=="never"?Ee.renderSlot("actions"):null,ka=!!(Eo&&V(fs)),gr=Eo?.placement??"overlay-bottom",Ja=ka&&gr.startsWith("overlay-"),bs=ka?jsxRuntime.jsx("div",{"data-collection-item-actions":"","data-actions-placement":gr,"data-actions-align":Eo?.align??"center","data-actions-visibility":Za,className:m("flex min-w-0 items-center gap-2 px-2 py-2",Eo?.align==="start"&&"justify-start",(Eo?.align===void 0||Eo.align==="center")&&"justify-center",Eo?.align==="end"&&"justify-end",Eo?.wrap!==false&&"flex-wrap",Za==="hover"&&"!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100 [@media(hover:none)]:!opacity-100",Ja&&"pointer-events-none absolute inset-x-0 z-20",gr==="overlay-top"&&"top-1",gr==="overlay-bottom"&&"bottom-1",s?.itemActions),children:jsxRuntime.jsx("div",{className:m("pointer-events-auto flex items-center gap-2",Eo?.wrap!==false&&"flex-wrap"),children:fs})}):null;return !bt&&!ka?qe:jsxRuntime.jsxs("div",{className:m("min-w-0",(Gt||Ja)&&"relative",s?.itemContent),"data-collection-item-content":"",children:[xt==="above"?ms:null,gr==="above"?bs:null,qe,xt==="below"||Gt?ms:null,gr==="below"||Ja?bs:null]})},[s?.itemActions,s?.itemContent,s?.itemTitle,t.item,o]),Ve=ho.useCallback((de,Ee,qe=true)=>{let Le=Ie(de,Ee),Se=xe(de,Le);return qe?jsxRuntime.jsx("div",{...oe(de,Le),children:Se}):Se},[Ie,oe,xe]),_e=ho.useMemo(()=>({mode:A,columnCount:he,columnWidth:me,containerWidth:I,gap:L,placementStrategy:ie,rowHeight:F}),[he,me,I,L,A,ie,F]),Ge=a(de=>{if(t.windowed&&A!=="dense"){let Se=de===we[we.length-1];return jsxRuntime.jsx(Kw,{items:de.items,getKey:Je=>Je.stringKey,layout:_e,cardWidth:Qi(t.layout.cardWidth,Nu,b.current),getScrollOwner:Ke,railRef:A==="rail"&&Se?x:void 0,tailRef:A==="rail"&&Se?k:void 0,estimateHeight:(Je,bt)=>{let xt=t.layout.getItemSize?.(Je.item,{..._e,columnWidth:bt}),Gt=t.layout.getItemAspectRatio?.(Je.item,Je.index);return Qi(xt?.height,Gt&&Gt>0?bt/Gt:300,b.current)},containerProps:{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:s?.layout},getItemProps:(Je,bt)=>oe(Je,Ie(Je,bt)),renderItem:(Je,bt)=>Ve(Je,bt,false)})}let Ee=t.virtualization,qe=Ee?.adapter,Le=Ee?.enabled===true;if(Le&&(!qe||qe.supports?.(A)===false)&&Ee?.fallback==="error")return null;if(Le&&qe&&qe.supports?.(A)!==false)return qe.render({items:de.items.map(({item:Se})=>Se),keys:de.items.map(({key:Se})=>Se),layout:t.layout,scrollOwner:Ke(),renderItem:a((Se,Je,bt)=>{let xt=de.items[Je];return xt?jsxRuntime.jsx(ho.Fragment,{children:Ve(xt,bt)},xt.stringKey):null},"renderItem")});if(A==="masonry"||A==="dense")return jsxRuntime.jsx(Yi,{items:de.items,columnCount:he,columnWidth:t.layout.cardWidth??t.layout.columnWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,placementStrategy:A==="dense"?"dense":ie,className:s?.layout,containerProps:{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0},getItemProps:(Se,Je)=>{let bt=Ie(Se,{...Je,mode:A});return oe(Se,bt)},getItemKey:Se=>Se.key,getItemSize:(Se,Je)=>{let bt={...Je,mode:A},xt=t.layout.getItemSize?.(Se.item,bt),Gt=t.layout.getItemAspectRatio?.(Se.item,Se.index);return c5(xt,Gt,Je.columnWidth)},renderItem:(Se,Je)=>Ve(Se,{...Je,mode:A},false)});if(A==="rail"){let Se=t.layout.cardWidth??t.layout.idealCardWidth??Nu,Je=de===we[we.length-1];return jsxRuntime.jsx("div",{ref:Je?x:void 0,role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:m("grid min-w-0 grid-flow-col items-start overflow-x-auto",s?.layout),style:{gap:L,gridAutoColumns:typeof Se=="number"?`${Se}px`:Se},children:de.items.map((bt,xt)=>jsxRuntime.jsx("div",{ref:Je&&xt===de.items.length-1?k:void 0,className:"min-w-0",children:Ve(bt,_e)},bt.stringKey))})}return jsxRuntime.jsx("div",{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:m("grid min-w-0 items-start",s?.layout),style:{gap:L,gridTemplateColumns:`repeat(${he}, minmax(0, 1fr))`},children:de.items.map(Se=>{let Je=t.layout.getItemSize?.(Se.item,_e),bt=Ru(Math.round(Number(Je?.columnSpan)||1),1,he),xt=t.layout.getItemAspectRatio?.(Se.item,Se.index);return jsxRuntime.jsx("div",{...oe(Se,Ie(Se,{..._e,columnSpan:bt,size:Je})),style:{gridColumn:bt>1?`span ${bt}`:void 0,aspectRatio:Number.isFinite(xt)&&Number(xt)>0?String(xt):void 0},children:Ve(Se,{..._e,columnSpan:bt,size:Je},false)},Se.stringKey)})})},"renderGroupItems"),le={items:e,error:Q,loading:re,loadingMore:Z,selectedKeys:ne,retry:a(()=>n?.onRetry?.(),"retry")},Me=Rr(r?.header,le),Ae=Rr(r?.toolbar,le),J=ne.size>0?Rr(r?.selectionToolbar,le):null,$e=Rr(r?.beforeItems,le),ue=Rr(r?.footer,le),Re=z?.permission===true,se=z?.offline===true&&!Re,te=re&&e.length===0&&!Re&&!se,Te=!!Q&&e.length===0&&!Re&&!se&&!te,ze=!Re&&!se&&!te&&!Te&&(z?.empty===true||e.length===0),je=Rr(r?.loading,le),it=Rr(r?.error,le),Y=Rr(r?.permission,le),pe=Rr(r?.offline,le),Be=Rr(r?.empty,le),rt=Rr(r?.loadMore,le),Ce=t.layout.scrollOwner==="self"||t.layout.scrollOwner===void 0&&(t.layout.fillHeight||t.layout.maxHeight),Xe={...l,gap:t.layout.gap===void 0?l?.gap??"var(--monkeys-bento-gap, var(--global-spacing, 0.75rem))":nk(t.layout.gap),padding:t.layout.padding??l?.padding,height:t.layout.fillHeight?"100%":l?.height,maxHeight:t.layout.maxHeight??l?.maxHeight,overflow:Ce?"auto":l?.overflow};return jsxRuntime.jsxs("section",{ref:b,...c,"data-monkeys-component":"workbench-collection","data-layout-mode":A,"data-density":t.appearance?.density,"data-radius":t.appearance?.radius,"data-media-fit":t.appearance?.mediaFit,"data-hover-effect":t.appearance?.hover,"aria-label":d??be.collection,"aria-busy":re||Z||void 0,className:m("min-h-0 min-w-0",t.layout.fillHeight&&"h-full",s?.root,i),style:Xe,children:[V(Me)?jsxRuntime.jsx("div",{className:s?.header,children:Me}):null,V(Ae)?jsxRuntime.jsx("div",{className:s?.toolbar,children:Ae}):null,V(J)?jsxRuntime.jsx("div",{className:s?.selectionToolbar,children:J}):null,V($e)?jsxRuntime.jsx("div",{className:s?.beforeItems,children:$e}):null,Re?V(Y)?Y:jsxRuntime.jsx(za,{kind:"permission",title:be.permission,actions:u.permission?.showRequestAccess!==false&&n?.onRequestAccess?jsxRuntime.jsx(mt,{size:"sm",label:be.requestAccess,onClick:n.onRequestAccess}):void 0}):se?V(pe)?pe:jsxRuntime.jsx(za,{kind:"offline",title:be.offline,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(mt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0}):te?V(je)?je:ee==="spinner"?jsxRuntime.jsx($r,{title:be.loading,variant:"spinner"}):jsxRuntime.jsx("div",{ref:H,className:m("min-w-0",s?.items),children:jsxRuntime.jsx(zf,{mode:A,phase:"initial",columnCount:he,columnWidth:me,cardWidth:t.layout.cardWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,config:t.loading?.skeleton,ariaLabel:be.loading,className:s?.layout})}):Te?V(it)?it:jsxRuntime.jsx(za,{kind:"error",title:be.loadError,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(mt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0}):ze?V(Be)?Be:jsxRuntime.jsx(Di,{title:be.empty}):jsxRuntime.jsx("div",{ref:H,className:m("min-w-0",s?.items),children:we.map((de,Ee)=>{let qe={key:de.key,label:de.label,items:de.items.map(({item:Je})=>Je),groupIndex:Ee},Le=t.grouping?r?.groupHeading?.(qe,le)??de.label:null,Se=`${f}-group-${Ee}`;return jsxRuntime.jsxs("div",{"data-collection-group":de.stringKey,className:s?.group,children:[V(Le)?jsxRuntime.jsx("div",{id:Se,role:"heading","aria-level":2,className:s?.groupHeading,children:Le}):null,Ge(de)]},de.stringKey)})}),e.length>0&&Q?jsxRuntime.jsx("div",{className:s?.status,children:V(it)?it:jsxRuntime.jsx(za,{kind:"error",title:be.refreshError,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(mt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0})}):null,e.length>0&&(ae||Z)?jsxRuntime.jsx("div",{ref:A==="rail"?void 0:k,className:s?.loadMore,"data-collection-load-more":"",children:V(rt)?rt:Z?ee==="spinner"?jsxRuntime.jsx($r,{title:be.loadingMore,variant:"spinner"}):jsxRuntime.jsx(zf,{mode:A,phase:"load-more",columnCount:he,columnWidth:me,cardWidth:t.layout.cardWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,config:t.loading?.skeleton,ariaLabel:be.loadingMore,className:s?.layout}):null}):null,V(ue)?jsxRuntime.jsx("div",{className:s?.footer,children:ue}):null]})}a(kn,"WorkbenchCollection");function h5(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return `${e}px`;if(typeof e=="string"&&e.trim())return e.trim()}a(h5,"getNormalizedGalleryGridCardWidth");function y5(e){return e==="compact"?2:e==="detailed"?6:4}a(y5,"getDefaultGalleryDetailLimit");function x5(e,t){return e===1||e===2||e===3?Number(e):t==="detailed"?1:2}a(x5,"getNormalizedGalleryBentoColumns");function v5({density:e,visibility:t,limit:o}){if(t==="all")return Number.POSITIVE_INFINITY;let r=Number.parseInt(String(o),10);return Number.isFinite(r)&&r>0?r:y5(e)}a(v5,"getNormalizedGalleryDetailLimit");function sk(e){return e==="compact"?{min:220,ideal:244,max:268}:e==="detailed"?{min:320,ideal:372,max:420}:{min:260,ideal:304,max:348}}a(sk,"getGalleryCardWidthMetrics");function w5(e){if(e==null||e===""||e==="auto")return;let t=Number.parseInt(String(e),10);if(!(!Number.isFinite(t)||t<=0))return Math.max(1,Math.min(t,8))}a(w5,"getNormalizedGalleryGridColumns");function lk(e){if(e==null)return 0;let t=String(e).trim();return t&&t!=="\u2014"?t.length:0}a(lk,"getGalleryTextLength");function ml({column:e,row:t,getFieldValue:o,getDisplayText:r}){if(!e)return "";let n=o(e,t);if(n==null||n==="")return "";let i=r(n);return i==="\u2014"?"":String(i)}a(ml,"getGalleryFieldText");function $f({text:e,charsPerLine:t,maxLines:o}){let r=lk(e);return r?Math.max(1,Math.min(o,Math.ceil(r/t))):0}a($f,"estimateLineCount");function k5({text:e,density:t,bentoColumns:o}){let r=t==="detailed"?54:t==="compact"?44:48,s=$f({text:e,charsPerLine:o===1?t==="detailed"?32:26:t==="detailed"?18:15,maxLines:t==="detailed"?3:2});return s?r+Math.max(0,s-1)*16:r}a(k5,"estimateGalleryDetailCellHeight");function C5({columns:e,density:t,bentoColumns:o}){if(!e.length)return 0;let r=e.map(i=>k5({text:i.text,density:t,bentoColumns:o}));if(o===1)return 12+r.reduce((i,s)=>i+s,0)+Math.max(0,e.length-1)*8;let n=12;for(let i=0;i<r.length;i+=o){let s=r.slice(i,i+o);n+=Math.max(...s),i+o<r.length&&(n+=8);}return n}a(C5,"estimateGalleryDetailGridHeight");function S5({row:e,columns:t,galleryFieldKey:o,galleryDensity:r,galleryBentoColumns:n,galleryDetailVisibility:i,galleryDetailLimit:s,getFieldValue:l,isMediaColumn:d,isTitleCandidate:c,isSummaryCandidate:p,getDisplayText:u,isImageField:g,isAudioField:f,cardVariant:b,renderPreview:x,renderLeadingVisual:y,hiddenDetailFieldKeys:k,layout:w,resolveRecordVisual:v}){let h=t.find(U=>U.renderType==="icon"),S=h&&v?v(e?.[h.key],e,h):null,C=(o!=="auto"?t.find(U=>U.key===o&&d(U,e)):null)||t.find(U=>d(U,e))||null,R=C?l(C,e):null,M=C?g(C,R):false,I=C?f(C,R):false,N=!!y||!!S,D=t.filter(U=>U.key!==C?.key&&U.renderType!=="icon"),P=D.filter(U=>{if(!U||d(U,e)||!c(U,e))return false;let X=l(U,e);return !(X==null||X==="")})[0]||null,W=P?ml({column:P,row:e,getFieldValue:l,getDisplayText:u}):String(u(e?.linkKey||e?.id||"")),H=D.find(U=>!U||U.key===P?.key||d(U,e)||!p(U,e)?false:ml({column:U,row:e,getFieldValue:l,getDisplayText:u}).length>12)||D.find(U=>!U||U.key===P?.key||d(U,e)||!p(U,e)?false:lk(ml({column:U,row:e,getFieldValue:l,getDisplayText:u}))>0)||null,A=H?ml({column:H,row:e,getFieldValue:l,getDisplayText:u}):"",L=new Set(k),F=D.filter(U=>U.key!==P?.key&&U.key!==H?.key&&!L.has(U.key)).map(U=>({column:U,text:ml({column:U,row:e,getFieldValue:l,getDisplayText:u})})),G=v5({density:r,visibility:i,limit:s}),$=Number.isFinite(G)?F.slice(0,G):F,_=Math.max(F.length-$.length,0),z=x5(n,r),re=w?.columnWidth||sk(r).ideal;if(b==="image-only")return {width:re,height:Math.round(re*1.25)};if(b==="preview-only")return {width:re,height:Math.round(re*.82)};let Z=r==="detailed"?84:r==="compact"?64:72;typeof x=="function"?Z+=r==="detailed"?188:r==="compact"?140:164:M?Z+=Math.round(re*(r==="detailed"?.72:.62))+12:I&&(Z+=92);let ae=$f({text:W,charsPerLine:r==="detailed"?26:24,maxLines:2})||1,ee=$f({text:A,charsPerLine:N?22:r==="detailed"?30:26,maxLines:r==="detailed"?4:2}),q=26+ae*18+(ee>0?ee*16+4:0);return Z+=Math.max(N?56:0,q),Z+=C5({columns:$,density:r,bentoColumns:z}),_>0&&(Z+=18),!A&&$.length===0&&(Z+=24),{width:re,height:Z}}a(S5,"getDefaultGalleryMasonryItemSize");function dk({rows:e=[],children:t,columns:o=[],onRowClick:r,cardInteraction:n="button",selectedLinkKey:i,selectedRowKey:s,selectedRowKeys:l,className:d,isMasonry:c=false,galleryLayoutMode:p="auto",galleryRailCardWidth:u,galleryGap:g,galleryScrollDirection:f,galleryGridColumns:b,galleryGridColumnsResponsive:x,galleryCardWidthMetrics:y,galleryCardAspectRatio:k,galleryCardMinHeight:w,galleryGridCardWidth:v,galleryUnderfilledBehavior:h,galleryMasonryColumnWidth:S,masonryPlacementStrategy:T,pagination:C,onLoadMore:R,scrollOwner:M,windowed:I,galleryFieldKey:B="auto",galleryDensity:N="comfortable",galleryBentoColumns:D=2,galleryDetailVisibility:E="limit",galleryDetailLimit:P,shouldEnhanceMultimodal:W=true,getFieldValue:H,isMediaColumn:A,isTitleCandidate:L,isSummaryCandidate:F,getDisplayText:G,renderFieldValue:$,getImagePreviewSrc:_,isImageField:z,isAudioField:re,AudioPlayerComponent:Z,cardVariant:ae="default",cardPresentation:ee,renderCardSlot:q,renderCoverTitle:U,galleryDetailPresentation:X,renderPreview:O,renderMeta:K,renderLeadingVisual:ne,resolveRecordVisual:fe,hiddenDetailFieldKeys:he=[],labels:me,formatLabel:ie,getMasonryItemSize:be}){let{min:He,ideal:We,max:Ke}=y??sk(N),ce=u||He,Q=w5(b),ge=h5(v),we=S||He,Ie=p==="rail",oe=H||Ki,xe=G||cl,Ve=z||ul,_e=re||pl,Ge=A||((ue,Re)=>fu(ue,Re,{getFieldValue:oe,shouldEnhanceMultimodal:W,isImageField:Ve,isAudioField:_e})),le=L||((ue,Re)=>bu(ue,Re,{isMediaColumn:Ge})),Me=F||((ue,Re)=>gu(ue,Re,{isMediaColumn:Ge})),Ae=$||((ue,Re,{compact:se}={})=>jsxRuntime.jsx("span",{children:xe(oe(ue,Re))})),J=a((ue,Re)=>jsxRuntime.jsx(hu,{row:ue,columns:o,cardInteraction:n,onClick:r?()=>r(ue,Re):void 0,isSelected:l?l.has(String(ue?.linkKey||ue?.id||"")):String(ue?.linkKey||ue?.id||"")===String(s||i||""),isMasonry:c,galleryFieldKey:B,galleryDensity:N,galleryBentoColumns:D,galleryDetailVisibility:E,galleryDetailLimit:P,galleryDetailPresentation:X,shouldEnhanceMultimodal:W,getFieldValue:oe,isMediaColumn:Ge,isTitleCandidate:le,isSummaryCandidate:Me,getDisplayText:xe,renderFieldValue:Ae,getImagePreviewSrc:_,isImageField:Ve,isAudioField:_e,AudioPlayerComponent:Z,cardVariant:ae,cardPresentation:ee,renderCardSlot:q,renderCoverTitle:U,renderPreview:O,renderMeta:K,renderLeadingVisual:ne,resolveRecordVisual:fe,hiddenDetailFieldKeys:he,labels:me,formatLabel:ie},ue?.id||ue?.linkKey||Re),"renderGalleryCard"),$e=c?T==="dense"?"dense":"masonry":Ie?"rail":"grid";if(jw($e,f),t!==void 0){let ue=ho.Children.toArray(t);return jsxRuntime.jsx(kn,{items:ue,callbacks:{onLoadMore:R},slots:{loadMore:C?.loadingMore?jsxRuntime.jsx($r,{variant:"spinner",className:"py-global",style:{minHeight:0}}):void 0},classNames:{layout:d},config:{windowed:I,state:C,loading:{autoFill:true},getItemKey:a((Re,se)=>ho.isValidElement(Re)&&Re.key!=null?Re.key:se,"getItemKey"),layout:{mode:$e,scrollOwner:M??"parent",gap:g,columns:x??(Q?{mobile:1,tablet:Math.min(2,Q),desktop:Q}:"auto"),underfilledBehavior:h,cardWidth:Ie?ce:void 0,minCardWidth:ge??He,idealCardWidth:ge??We,maxCardWidth:ge??Ke}},renderItem:Re=>Re})}return jsxRuntime.jsx(kn,{items:e,slots:{loadMore:C?.loadingMore?jsxRuntime.jsx($r,{variant:"spinner",className:"py-global",style:{minHeight:0}}):void 0},callbacks:{onLoadMore:R,onItemClick:n==="container"&&r?(ue,Re)=>r(ue,Re.index):void 0},classNames:{layout:d},config:{windowed:I,state:C,loading:{autoFill:true},getItemKey:a((ue,Re)=>ue?.id||ue?.linkKey||Re,"getItemKey"),layout:{mode:$e,underfilledBehavior:h,scrollOwner:M,gap:g,columns:x??(Q?{mobile:1,tablet:Math.min(2,Q),desktop:Q}:"auto"),cardWidth:Ie?ce:void 0,minCardWidth:ge??He,idealCardWidth:c?we:ge??We,maxCardWidth:ge??Ke,placementStrategy:T??(ae==="image-only"?"shortest":"shelf"),getItemAspectRatio:ae==="image-only"?ue=>{let Re=o.find(je=>je.key===B)??o.find(je=>Ge(je,ue)),se=Re?oe(Re,ue):void 0,te=se&&typeof se=="object"&&"aspectRatio"in se?se.aspectRatio:void 0;if(typeof te!="string"||!/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(te))return;let[Te,ze]=te.split(":").map(Number);return Te>0&&ze>0?Te/ze:void 0}:void 0,getItemSize:ae==="image-only"&&k&&k>0?(ue,Re)=>({height:Math.max(w??0,Re.columnWidth/k)}):c?(ue,Re)=>{let se=S5({row:ue,columns:o,galleryFieldKey:B,galleryDensity:N,galleryBentoColumns:D,galleryDetailVisibility:E,galleryDetailLimit:P,getFieldValue:oe,isMediaColumn:Ge,isTitleCandidate:le,isSummaryCandidate:Me,getDisplayText:xe,isImageField:Ve,isAudioField:_e,cardVariant:ae,renderPreview:O,renderLeadingVisual:ne,hiddenDetailFieldKeys:he,layout:Re,resolveRecordVisual:fe});if(typeof be!="function")return se;let te=be(ue,{...Re,placementStrategy:Re.placementStrategy==="dense"?"dense":"shelf",defaultSize:se})||{};return {...se,...te}}:void 0}},renderItem:(ue,Re)=>J(ue,Re.index)})}a(dk,"WorkbenchGalleryView");function ck({layout:e="horizontal",mediaPosition:t="start",detailsSize:o="balanced",sizing:r="content",asidePosition:n="end",detailsVisible:i=true,heading:s,metadata:l,message:d,actions:c,media:p,toolbar:u,aside:g,secondary:f,children:b,className:x,...y}){let k=i&&(V(s)||V(l)||V(b)||V(d)||V(c)),w=e==="horizontal"&&V(p)&&k,v=r==="fill",h=V(f),S=w&&h,T=V(g)?jsxRuntime.jsx("div",{"data-record-part":"aside",className:"flex min-h-0 shrink-0 gap-global",children:g}):null;return jsxRuntime.jsxs("article",{...y,"data-monkeys-component":"record-view","data-record-layout":e,"data-record-sizing":r,className:m("@container flex min-h-0 min-w-0 flex-col gap-global font-[family-name:var(--font-sans)] text-sm leading-5 text-foreground",v&&"h-full",x),children:[V(u)&&jsxRuntime.jsx("div",{"data-record-part":"toolbar",className:"flex shrink-0 flex-wrap items-center gap-global",children:u}),jsxRuntime.jsxs("div",{className:m("flex min-h-0 min-w-0 gap-global",v&&"flex-1"),children:[n==="start"&&T,jsxRuntime.jsxs("div",{"data-record-part":"body",className:m("grid min-h-0 min-w-0 flex-1 grid-cols-1 gap-global",S?"@[48rem]:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)]":w&&(o==="balanced"?"@[48rem]:grid-cols-2":t==="start"?"@[48rem]:grid-cols-[minmax(0,1fr)_minmax(16rem,24rem)]":"@[48rem]:grid-cols-[minmax(16rem,24rem)_minmax(0,1fr)]"),v&&"overflow-auto @[48rem]:overflow-hidden"),children:[V(p)&&jsxRuntime.jsx("div",{"data-record-part":"media",className:m("min-h-0 min-w-0",t==="end"&&w&&"@[48rem]:order-2",v&&"flex flex-col"),children:p}),k&&jsxRuntime.jsxs("div",{"data-record-part":"details",className:m("flex min-h-0 min-w-0 flex-col [&>section]:flex-1",v&&"@[48rem]:overflow-auto"),children:[V(s)&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global",children:s}),V(l)&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global text-sm tabular-nums text-muted-foreground [&_span]:text-inherit [&_time]:text-inherit",children:l}),b,V(d)&&jsxRuntime.jsx("div",{className:"mt-global break-words text-sm text-destructive-text",children:d}),V(c)&&jsxRuntime.jsx("div",{className:"mt-auto flex shrink-0 flex-wrap gap-global pt-global",children:c})]}),h&&jsxRuntime.jsx("div",{"data-record-part":"secondary",className:m("flex min-h-0 min-w-0 flex-col [&>section]:flex-1",v&&"@[48rem]:overflow-auto"),children:f})]}),n==="end"&&T]})]})}a(ck,"RecordView");function uk(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(uk,"toCssSize");function A5(e,t){return String(e?.id??e?.key??t)}a(A5,"defaultGetRowId");function B5(e){return String(e?.columnId??e?.status??"")}a(B5,"defaultGetColumnId");function L5(e){let t=e?.title??e?.name??e?.id??"Untitled";return jsxRuntime.jsx("div",{className:"rounded-lg border border-border/70 bg-card px-3 py-2 text-sm text-foreground shadow-sm",children:String(t)})}a(L5,"defaultRenderCard");function W5({row:e,rowId:t,rowIndex:o,column:r,classNames:n,renderCard:i}){let{attributes:s,listeners:l,setNodeRef:d,isDragging:c}=core.useDraggable({id:t});return jsxRuntime.jsx("div",{ref:d,...l,...s,className:m("touch-none",n?.cardWrapper),children:i(e,{row:e,rowIndex:o,column:r,isDragging:c,isOverlay:false})})}a(W5,"WorkbenchLaneDraggableCard");function z5({column:e,columnRows:t,columnWidth:o,columnMinHeight:r,emptyColumn:n,classNames:i,renderCard:s}){let{setNodeRef:l,isOver:d}=core.useDroppable({id:e.id});return jsxRuntime.jsxs("section",{className:m("flex shrink-0 flex-col rounded-xl border border-border/60 bg-card p-2 shadow-sm",i?.column,e.className),style:{width:uk(o)??"280px"},children:[jsxRuntime.jsxs("div",{className:m("flex h-10 items-center gap-2 px-1",i?.columnHeader,e.headerClassName),children:[e.icon?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 items-center justify-center text-muted-foreground",i?.columnIcon,e.iconClassName),children:e.icon}):null,jsxRuntime.jsx("span",{className:m("inline-flex items-center rounded px-2 py-0.5 text-xs font-semibold bg-muted text-muted-foreground",i?.columnBadge,e.badgeClassName),children:e.label??e.id}),jsxRuntime.jsx("span",{className:m("text-xs text-muted-foreground",i?.columnCount),children:t.length})]}),jsxRuntime.jsx("div",{ref:l,className:m("mt-1 flex min-h-[200px] flex-1 flex-col gap-2 overflow-y-auto rounded-lg p-1 transition-colors [scrollbar-width:thin]",d&&"bg-accent/60",i?.columnBody,e.bodyClassName),style:{minHeight:uk(r)},children:t.length?t.map(({row:c,rowIndex:p,rowId:u})=>jsxRuntime.jsx(W5,{row:c,rowId:u,rowIndex:p,column:e,classNames:i,renderCard:s},u)):n?jsxRuntime.jsx("div",{className:m("flex min-h-24 items-center justify-center rounded-lg border border-dashed border-border/60 px-3 py-4 text-xs text-muted-foreground",i?.emptyColumn),children:n}):null})]})}a(z5,"WorkbenchLaneColumnView");function pk({rows:e=[],columns:t=[],getRowId:o=A5,getColumnId:r=B5,renderCard:n,renderOverlayCard:i,onMoveRow:s,onSelectRow:l,emptyColumn:d,activationDistance:c=5,columnWidth:p=280,columnMinHeight:u,className:g,classNames:f,style:b}){let x=n??((B,N)=>l?jsxRuntime.jsx(mt,{className:"w-full justify-start whitespace-normal text-left",onClick:()=>l({rowId:o(B,N.rowIndex)}),children:String(B?.title??B?.name??o(B,N.rowIndex))}):L5(B)),[y,k]=ho.useState(null),w=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:c}})),v=ho.useMemo(()=>new Map(t.map(B=>[B.id,B])),[t]),h=ho.useMemo(()=>e.map((B,N)=>({row:B,rowIndex:N,rowId:o(B,N),columnId:r(B,N)})),[r,o,e]),S=y?h.find(B=>B.rowId===y):void 0,T=ho.useMemo(()=>{let B=new Map;return t.forEach(N=>B.set(N.id,[])),h.forEach(({row:N,rowIndex:D,rowId:E,columnId:P})=>{B.get(P)?.push({row:N,rowIndex:D,rowId:E});}),B},[t,h]),C=S?v.get(S.columnId):void 0,R=ho.useCallback(B=>{k(String(B.active.id));},[]),M=ho.useCallback(B=>{k(null);let N=String(B.active.id),D=String(B.over?.id??""),E=h.find(P=>P.rowId===N);!E||!v.has(D)||E.columnId===D||s?.(N,D,E.row);},[v,s,h]),I=ho.useCallback(()=>{k(null);},[]);return jsxRuntime.jsxs(core.DndContext,{sensors:w,onDragStart:R,onDragEnd:M,onDragCancel:I,children:[jsxRuntime.jsx("div",{className:m("flex min-h-0 flex-1 gap-4 overflow-x-auto p-4 [scrollbar-width:thin]",f?.root,g),style:b,children:t.map(B=>jsxRuntime.jsx(z5,{column:B,columnRows:T.get(B.id)||[],columnWidth:p,columnMinHeight:u,emptyColumn:d,classNames:f,renderCard:x},B.id))}),jsxRuntime.jsx(core.DragOverlay,{children:S&&C?jsxRuntime.jsx("div",{className:m(f?.overlayWrapper),children:(i||x)(S.row,{row:S.row,rowIndex:S.rowIndex,column:C,isDragging:false,isOverlay:true})}):null})]})}a(pk,"WorkbenchLaneView");var mk=a(e=>{if(Number.isFinite(e))return Math.min(1,Math.max(0,Number(e)))},"normalizeProgress");function fk({items:e,summary:t,variant:o="bars",density:r="comfortable",emptyState:n=null,ariaLabel:i="Metrics",className:s,itemClassName:l}){if(!e.length)return V(n)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:n}):null;if(o==="radar"&&e.length>=3&&e.length<=12){let d=a((u,g)=>{let f=-Math.PI/2+u*Math.PI*2/e.length;return [180+Math.cos(f)*g,160+Math.sin(f)*g]},"point"),c=e.map((u,g)=>{let f=mk(u.progress);return f===void 0?void 0:d(g,f*100)}),p=c.every(Boolean);return jsxRuntime.jsxs("figure",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":"radar",className:m("m-0 min-w-0",s),children:[jsxRuntime.jsxs("svg",{viewBox:"0 0 360 320",role:"img","aria-label":t?`${i} \xB7 ${t.label} ${t.value}`:i,className:"mx-auto block w-full max-w-sm overflow-visible",children:[[.25,.5,.75,1].map(u=>jsxRuntime.jsx("polygon",{points:e.map((g,f)=>d(f,u*100).join(",")).join(" "),fill:"none",stroke:"hsl(var(--border))"},u)),e.map((u,g)=>{let f=d(g,100),b=d(g,131);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:"180",y1:"160",x2:f[0],y2:f[1],stroke:"hsl(var(--border))"}),typeof u.label=="string"||typeof u.label=="number"?jsxRuntime.jsx("text",{x:b[0],y:b[1]-7,textAnchor:"middle",dominantBaseline:"middle",fontSize:"12",fill:"hsl(var(--muted-foreground))",children:u.label}):null,typeof u.value=="string"||typeof u.value=="number"?jsxRuntime.jsx("text",{"data-metric-axis-value":u.id,x:b[0],y:b[1]+10,textAnchor:"middle",dominantBaseline:"middle",fontSize:"13",fontWeight:"600",fill:"hsl(var(--foreground))",children:u.value}):null]},u.id)}),p?jsxRuntime.jsx("polygon",{"data-metric-radar-series":"complete",points:c.map(u=>u.join(",")).join(" "),fill:"hsl(var(--primary) / .18)",stroke:"hsl(var(--primary))",strokeWidth:"2.5"}):c.map((u,g)=>{let f=c[(g+1)%c.length];return u&&f?jsxRuntime.jsx("line",{"data-metric-radar-series":"partial",x1:u[0],y1:u[1],x2:f[0],y2:f[1],stroke:"hsl(var(--primary))",strokeWidth:"2.5"},e[g].id):null}),c.map((u,g)=>u?jsxRuntime.jsx("circle",{cx:u[0],cy:u[1],r:"3",fill:"hsl(var(--primary))"},e[g].id):null),t?jsxRuntime.jsxs("g",{"data-metric-radar-summary":"true",textAnchor:"middle",paintOrder:"stroke",stroke:"hsl(var(--card))",strokeWidth:"3",strokeLinejoin:"round",children:[jsxRuntime.jsx("text",{x:"180",y:"149",fontSize:"12",fill:"hsl(var(--muted-foreground))",children:t.label}),jsxRuntime.jsx("text",{x:"180",y:"174",fontSize:"23",fontWeight:"700",fill:"hsl(var(--foreground))",children:t.value})]}):null]}),jsxRuntime.jsx("dl",{className:"sr-only",children:e.map(u=>jsxRuntime.jsxs("div",{className:m("flex min-w-0 justify-between gap-2",l),children:[jsxRuntime.jsx("dt",{className:"truncate text-muted-foreground",children:u.label}),jsxRuntime.jsx("dd",{className:"font-semibold tabular-nums",children:u.value})]},u.id))})]})}return o==="list"?jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>jsxRuntime.jsxs("div",{className:m("flex min-w-0 items-start justify-between gap-4",r==="compact"?"text-xs":"text-sm",l),children:[jsxRuntime.jsxs("dt",{className:"min-w-0 text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"block truncate",children:d.label}),V(d.description)?jsxRuntime.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-muted-foreground/80",children:d.description}):null]}),jsxRuntime.jsx("dd",{className:"shrink-0 font-semibold tabular-nums text-foreground",children:d.value})]},d.id))}):o==="cards"?jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0 [grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))]",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>jsxRuntime.jsxs("div",{className:m("min-w-0 rounded-lg border border-border/70 bg-card text-card-foreground",r==="compact"?"p-3":"p-4",l),children:[jsxRuntime.jsx("dt",{className:"truncate text-xs font-medium text-muted-foreground",children:d.label}),jsxRuntime.jsx("dd",{className:m("font-semibold tabular-nums text-foreground",r==="compact"?"mt-1.5 text-xl":"mt-2 text-2xl"),children:d.value}),V(d.description)?jsxRuntime.jsx("div",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:d.description}):null]},d.id))}):jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0 [grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr))]",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>{let c=mk(d.progress);return jsxRuntime.jsxs("div",{className:m("min-w-0",l),children:[jsxRuntime.jsx("div",{role:c===void 0?void 0:"meter","aria-label":c===void 0?void 0:String(d.label),"aria-valuemin":c===void 0?void 0:0,"aria-valuemax":c===void 0?void 0:100,"aria-valuenow":c===void 0?void 0:Math.round(c*100),className:m("overflow-hidden rounded-full bg-muted",r==="compact"?"h-1.5":"h-2"),children:c===void 0?null:jsxRuntime.jsx("span",{className:"block h-full rounded-full bg-primary transition-[width] duration-200 motion-reduce:transition-none",style:{width:`${Math.max(c>0?4:0,c*100)}%`}})}),jsxRuntime.jsxs("div",{className:"mt-1.5 flex min-w-0 items-baseline justify-between gap-2",children:[jsxRuntime.jsx("dt",{className:"truncate text-xs text-muted-foreground",children:d.label}),jsxRuntime.jsx("dd",{className:"shrink-0 text-xs font-semibold tabular-nums text-foreground",children:d.value})]})]},d.id)})})}a(fk,"WorkbenchMetricGrid");var bk=Math.PI*(3-Math.sqrt(5)),gk=a(e=>Array.from(e).reduce((t,o)=>Math.imul(t^o.charCodeAt(0),16777619)>>>0,2166136261),"hash");function Iu(e,t){let o=new Set(e.map(v=>v.id)),r=new Map,n=new Set,i=new Map(e.map(v=>[v.id,new Set])),s=t.filter(v=>o.has(v.sourceId)&&o.has(v.targetId));for(let v of s){let h=r.get(v.sourceId)??[];h.includes(v.targetId)||h.push(v.targetId),r.set(v.sourceId,h),n.add(v.targetId),i.get(v.sourceId).add(v.targetId),i.get(v.targetId).add(v.sourceId);}let d=e.filter(v=>!n.has(v.id))[0]?.id??e[0]?.id,c=new Map,p=d?[d]:[];d&&c.set(d,{depth:0,branch:d,cluster:d});for(let v=0;v<p.length;v++){let h=p[v],S=c.get(h);for(let T of r.get(h)??[])c.has(T)||(c.set(T,{depth:S.depth+1,branch:S.depth===0?T:S.branch,cluster:S.depth<2?T:S.cluster}),p.push(T));}for(let v of e)c.has(v.id)||c.set(v.id,{depth:1,branch:v.id,cluster:v.id});let u=[...new Set([...c.values()].filter(v=>v.depth>0).map(v=>v.branch))],g=new Map;for(let[v,h]of c){if(h.depth<2)continue;let S=g.get(h.cluster)??[];S.push(v),g.set(h.cluster,S);}let f=u.map(v=>Math.sqrt([...c.values()].filter(h=>h.branch===v).length+8)),b=f.reduce((v,h)=>v+h,0)||1,x=-Math.PI/2,y=new Map;u.forEach((v,h)=>{let S=Math.PI*2*f[h]/b,T=x+S/2;y.set(v,{x:Math.cos(T)*12,y:Math.sin(T)*10,z:Math.sin(T*2)*3.2,angle:T}),x+=S;});let k=new Map;for(let v of u){let h=y.get(v),S=[...g.keys()].filter(T=>c.get(T)?.branch===v);S.forEach((T,C)=>{let R=S.length>1?Math.max(3,Math.sqrt(S.length)*1.7):1.5,M=C*bk+h.angle;k.set(T,{x:h.x+Math.cos(M)*R,y:h.y+Math.sin(M)*R,z:h.z+Math.sin(M)*2.5});});}let w=e.map(v=>{let h=c.get(v.id),S=h.depth<2?y.get(h.branch):k.get(h.cluster);if(h.depth===0||!S)return {...v,...h,x:0,y:0,z:0};if(h.depth===1)return {...v,...h,x:S.x*.76,y:S.y*.76,z:S.z};let C=g.get(h.cluster).indexOf(v.id),R=h.depth===2?0:1.5+Math.sqrt(C)*.72,M=C*bk+gk(h.cluster)%360*Math.PI/180;return {...v,...h,x:S.x+Math.cos(M)*R,y:S.y+Math.sin(M)*R*.85,z:S.z+Math.sin(M*1.37)*Math.min(R,3.5)}});for(let v=0;v<30;v++)for(let h=0;h<w.length;h++)for(let S=h+1;S<w.length;S++){let T=w[h],C=w[S],R=C.x-T.x,M=C.y-T.y,I=Math.hypot(R,M),B=T.depth<3||C.depth<3?1.4:.85;if(I>=B)continue;let N=gk(T.id+C.id)%360*Math.PI/180,D=I>.001?R/I:Math.cos(N),E=I>.001?M/I:Math.sin(N),P=(B-I)*.25;T.depth>0&&(T.x-=D*P,T.y-=E*P),C.depth>0&&(C.x+=D*P,C.y+=E*P);}if(w.length)for(let v of ["x","y","z"]){let h=(Math.min(...w.map(S=>S[v]))+Math.max(...w.map(S=>S[v])))/2;w.forEach(S=>{S[v]-=h;});}return {points:w,links:s,neighbors:i,root:d}}a(Iu,"buildRelationshipGalaxyLayout");function yk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:n,className:i}){let s=Ye(),l=ho.useRef(null),d=ho.useRef(new Map),c=ho.useRef(o),p=ho.useRef(r),[u,g]=ho.useState(false),f=JSON.stringify([e,t]),b=ho.useMemo(()=>Iu(e,t),[f]);return c.current=o,p.current=r,ho.useEffect(()=>{let x=l.current;if(!x)return;let y=false,k=a(()=>{},"cleanup");return g(false),Promise.all([import('three'),import('three/examples/jsm/controls/OrbitControls.js')]).then(([w,{OrbitControls:v}])=>{if(y)return;let h=[],S=new w.Scene,T=getComputedStyle(x),C=a((ie,be)=>{let He=document.createElement("span");He.style.color=`hsl(${T.getPropertyValue(ie).trim()||T.getPropertyValue(be).trim()})`,x.append(He);let We=new w.Color(getComputedStyle(He).color);return He.remove(),We},"tokenColor"),R=C("--radar-canvas","--background");S.background=R;let M=new w.PerspectiveCamera(48,1,.1,250),I=new w.WebGLRenderer({antialias:true,alpha:false});I.setPixelRatio(Math.min(devicePixelRatio,2)),I.domElement.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none",I.domElement.setAttribute("aria-hidden","true"),x.prepend(I.domElement);let B=new v(M,I.domElement);B.enableDamping=true,B.dampingFactor=.08,B.rotateSpeed=.45,B.minDistance=8,B.maxDistance=130,B.autoRotate=false;let N=new Map(b.points.map(ie=>[ie.id,new w.Vector3(ie.x,ie.y,ie.z)])),D={primary:C("--radar-series-one","--primary"),secondary:C("--radar-series-two","--success"),accent:C("--radar-series-three","--warning"),muted:C("--radar-series-four","--muted-foreground")},E=128,P=new Uint8Array(E*E*4);for(let ie=0;ie<E;ie++)for(let be=0;be<E;be++){let He=Math.hypot(be+.5-E/2,ie+.5-E/2)/(E/2),We=He<.09?1:Math.exp(-He*7.5)*.85;P.set([255,255,255,Math.round(We*255)],(ie*E+be)*4);}let W=new w.DataTexture(P,E,E,w.RGBAFormat);W.minFilter=W.magFilter=w.LinearFilter,W.needsUpdate=true,h.push(W);let H=b.points.map(ie=>{let be=new w.SpriteMaterial({map:W,color:D[ie.tone??"primary"],transparent:true,blending:w.AdditiveBlending,depthWrite:false}),He=new w.Sprite(be);return He.position.copy(N.get(ie.id)),S.add(He),h.push(be),He}),A=new w.BufferGeometry;A.setAttribute("position",new w.Float32BufferAttribute(b.links.flatMap(ie=>[...N.get(ie.sourceId).toArray(),...N.get(ie.targetId).toArray()]),3));let L=new Float32Array(b.links.length*6);A.setAttribute("color",new w.BufferAttribute(L,3));let F=new w.LineBasicMaterial({vertexColors:true,transparent:true,opacity:.5,depthWrite:false});S.add(new w.LineSegments(A,F)),h.push(A,F);let G=new Map;b.points.filter(ie=>ie.depth>0).forEach(ie=>{let be=G.get(ie.cluster)??[];be.push(ie),G.set(ie.cluster,be);});for(let ie of G.values()){if(ie.length<3)continue;let be=ie.reduce((Ke,ce)=>Ke.add(N.get(ce.id)),new w.Vector3).multiplyScalar(1/ie.length),He=new w.SpriteMaterial({map:W,color:D[ie[0].tone??"primary"],transparent:true,opacity:.13,blending:w.AdditiveBlending,depthWrite:false}),We=new w.Sprite(He);We.position.copy(be),We.position.z-=1,We.scale.setScalar(8+Math.sqrt(ie.length)*1.2),S.add(We),h.push(He);}let $=Math.max(8,...b.points.map(ie=>Math.abs(ie.x)))+3,_=Math.max(6,...b.points.map(ie=>Math.abs(ie.y)))+3,z=55,re=false,Z=new ResizeObserver(()=>{let{width:ie,height:be}=x.getBoundingClientRect();if(!ie||!be)return;M.aspect=ie/be;let He=Math.max(_,$/M.aspect)/Math.tan(w.MathUtils.degToRad(M.fov/2))+7;re?M.position.sub(B.target).multiplyScalar(He/z).add(B.target):(M.position.set(0,0,He),re=true),z=He,B.update(),M.updateProjectionMatrix(),I.setSize(ie,be,false);});Z.observe(x);let ae=new w.Vector3,ee=new w.Vector2,q={x:0,y:0},U,X,O=a(ie=>{let be=I.domElement.getBoundingClientRect();ee.set(ie.clientX-be.left,ie.clientY-be.top);let He,We=12;for(let Ke of b.points){if(ae.copy(N.get(Ke.id)).project(M),ae.z<-1||ae.z>1)continue;let ce=Math.hypot((ae.x+1)*be.width/2-ee.x,(-ae.y+1)*be.height/2-ee.y);ce<We&&(We=ce,He=Ke);}return He},"nodeAt"),K=a(ie=>{q={x:ie.clientX,y:ie.clientY};},"pointerDown"),ne=a(ie=>{U=O(ie)?.id,I.domElement.style.cursor=U?"pointer":"grab";},"pointerMove"),fe=a(()=>{U=void 0;},"pointerLeave"),he=a(ie=>{if(Math.hypot(ie.clientX-q.x,ie.clientY-q.y)>5)return;let be=O(ie);be&&p.current?.(be);},"pointerUp");I.domElement.addEventListener("pointerdown",K),I.domElement.addEventListener("pointermove",ne),I.domElement.addEventListener("pointerleave",fe),I.domElement.addEventListener("pointerup",he);let me=[...b.points].sort((ie,be)=>ie.depth-be.depth||(b.neighbors.get(be.id)?.size??0)-(b.neighbors.get(ie.id)?.size??0));I.setAnimationLoop(()=>{B.update();let ie=c.current,be=ie?b.neighbors.get(ie):void 0;(X!==ie||!A.userData.initialized)&&(X=ie,A.userData.initialized=true,b.links.forEach((ge,we)=>{let Ie=ge.sourceId===ie||ge.targetId===ie,oe=b.points.find(Ve=>Ve.id===ge.targetId),xe=D[oe.tone??"primary"].clone().multiplyScalar(ie?Ie?1.35:.12:.45);L.set([...xe.toArray(),...xe.toArray()],we*6);}),A.attributes.color.needsUpdate=true),H.forEach((ge,we)=>{let Ie=b.points[we],oe=ie===Ie.id;ge.scale.setScalar((Ie.depth===0?2.2:Ie.depth===1?1.8:Ie.depth===2?1.2:.82)*(oe?1.5:1)),ge.material.opacity=!ie||oe||be?.has(Ie.id)?1:.25;});let He=x.clientWidth,We=x.clientHeight,Ke=z/M.position.distanceTo(B.target),ce=[],Q=[...me].sort((ge,we)=>+(we.id===ie||we.id===U)-+(ge.id===ie||ge.id===U));for(let ge of Q){let we=d.current.get(ge.id);if(!we)continue;let Ie=ge.id===ie,oe=ge.id===U,xe=be?.has(ge.id);ae.copy(N.get(ge.id)).project(M);let Ve=(ae.x+1)*He/2,_e=(-ae.y+1)*We/2+10,Ge={x:Ve-Math.min(ge.label.length*13,170)/2,y:_e,width:Math.min(ge.label.length*13,170),height:21},le=ae.z>-1&&ae.z<1&&Ge.x>4&&Ge.x+Ge.width<He-4&&_e>4&&_e+21<We-4,Me=Ie||oe||xe||ge.depth<=2||Ke>1.65,Ae=ce.some($e=>Ge.x<$e.x+$e.width+8&&Ge.x+Ge.width+8>$e.x&&Ge.y<$e.y+$e.height+5&&Ge.y+Ge.height+5>$e.y),J=le&&Me&&(Ie||oe||!Ae)&&(!ie||Ie||oe||xe||ge.depth<2);we.style.display=J?"block":"none",we.tabIndex=J?0:-1,we.style.transform=`translate(${Ve}px,${_e}px) translate(-50%,0)`,we.style.color="#"+D[ge.tone??"primary"].clone().lerp(D.primary,.45).getHexString(),we.style.opacity=ie&&!Ie&&!xe&&!oe?"0.45":"1",we.style.fontWeight=ge.depth<2||Ie?"var(--monkeys-semantic-font-weight-semibold, 600)":"var(--monkeys-semantic-font-weight-normal, 400)",we.style.zIndex=Ie||oe?"2":"1",J&&ce.push(Ge);}I.render(S,M);}),k=a(()=>{I.domElement.removeEventListener("pointerdown",K),I.domElement.removeEventListener("pointermove",ne),I.domElement.removeEventListener("pointerleave",fe),I.domElement.removeEventListener("pointerup",he),Z.disconnect(),I.setAnimationLoop(null),B.dispose(),h.forEach(ie=>ie.dispose()),I.dispose(),I.domElement.remove();},"cleanup");}).catch(()=>{y||g(true);}),()=>{y=true,k();}},[b]),jsxRuntime.jsxs("div",{ref:l,className:i,role:"group","aria-label":n,"data-monkeys-component":"relationship-galaxy",style:{position:"relative",width:"100%",height:"100%",minHeight:400,overflow:"hidden",background:"hsl(var(--radar-canvas, var(--background)))"},children:[e.map(x=>jsxRuntime.jsx("button",{ref:y=>{y?d.current.set(x.id,y):d.current.delete(x.id);},"aria-pressed":o===x.id,className:"font-sans text-xs",title:x.meta,onClick:()=>p.current?.(x),style:{display:"none",position:"absolute",left:0,top:0,maxWidth:170,border:0,background:"transparent",padding:"calc(var(--global-spacing, 0.75rem) / 6)",cursor:"pointer",textShadow:"0 1px 4px hsl(var(--radar-canvas, var(--foreground)))",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:x.label},x.id)),u&&jsxRuntime.jsx("div",{role:"alert",className:"absolute inset-0 grid place-items-center bg-background text-foreground",children:s.workbench.collection.loadError})]})}a(yk,"RelationshipGalaxy");var Ji={physics:{repulsion:18e3,linkDistance:100,weakLinkDistance:280,linkStrength:.014,strongLinkStrength:.025,centerStrength:.0015,velocityRetention:.72,maxVelocity:35,collisionPadding:18,collisionPasses:2,cooling:.975,minAlpha:.002,ticksPerFrame:2},nodes:{fontSize:13,iconSize:16,showIcons:true,showLabels:true,focusScale:1.08,borderRadius:999,glow:true,contextOpacity:null},edges:{visible:true,curved:true,widthScale:1,opacityScale:1,glow:true,color:null},interaction:{pan:true,zoom:true,dragNodes:true,keyboard:true,openNodes:true,dragThreshold:4,keyboardStep:15,keyboardFastStep:50},viewport:{minZoom:.08,maxZoom:8,fitMaxZoom:2,fitPadding:60,screenPadding:50,zoomSensitivity:.0012,zoomStep:180,fitOnResize:true},ui:{controls:true,minimap:true,minimapWidth:156,minimapHeight:108,dock:"bottom-left"}};for(let e of Object.values(Ji))Object.freeze(e);Object.freeze(Ji);var xk={repulsion:[0,1e6],linkDistance:[0,2e3],weakLinkDistance:[0,3e3],linkStrength:[0,.2],strongLinkStrength:[0,.2],centerStrength:[0,.1],velocityRetention:[0,.99],maxVelocity:[1,100],collisionPadding:[0,200],collisionPasses:[0,8],cooling:[.5,.995],minAlpha:[.001,.1],ticksPerFrame:[1,10],fontSize:[8,48],iconSize:[8,64],focusScale:[.5,2],borderRadius:[0,999],contextOpacity:[0,1],widthScale:[0,8],opacityScale:[0,5],dragThreshold:[0,30],keyboardStep:[1,200],keyboardFastStep:[1,500],minZoom:[.01,20],maxZoom:[.01,20],fitMaxZoom:[.01,20],fitPadding:[0,500],screenPadding:[0,300],zoomSensitivity:[1e-4,.01],zoomStep:[1,1e3],minimapWidth:[140,360],minimapHeight:[60,300]},vk=new Set(["collisionPasses","ticksPerFrame"]),wk=a(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"record");function fl(e={}){if(!wk(e))throw new Error("config must be an object");let t=structuredClone(Ji);for(let[o,r]of Object.entries(e)){if(!Object.prototype.hasOwnProperty.call(t,o))throw new Error(`Unknown config group: ${o}`);if(!wk(r))throw new Error(`config.${o} must be an object`);let n=t[o];for(let[i,s]of Object.entries(r)){let l=`config.${o}.${i}`;if(!Object.prototype.hasOwnProperty.call(n,i))throw new Error(`Unknown field: ${l}`);if((i==="contextOpacity"||i==="color")&&s===null){n[i]=null;continue}if(i==="dock"){if(typeof s!="string"||!["bottom-left","bottom-right","top-left","top-right"].includes(s))throw new Error(`${l} must be a supported corner`)}else if(i==="color"){if(typeof s!="string"||!/^#[\da-f]{6}$/i.test(s))throw new Error(`${l} must be a #RRGGBB color or null`)}else if(xk[i]){let[d,c]=xk[i];if(typeof s!="number"||!Number.isFinite(s)||s<d||s>c||vk.has(i)&&!Number.isInteger(s))throw new Error(`${l} must be ${vk.has(i)?"an integer":"a number"} in [${d}, ${c}]`)}else if(typeof s!="boolean")throw new Error(`${l} must be a boolean`);n[i]=s;}}if(t.viewport.minZoom>t.viewport.maxZoom)throw new Error("config.viewport.minZoom must not exceed maxZoom");return t}a(fl,"resolveRelationshipGraphConfig");var qf=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp");function Pu(e,t,o={}){let r=fl({physics:o.physics??{}}).physics,n=[...e].sort((u,g)=>u.id.localeCompare(g.id,"en")).map((u,g)=>({...u,x:Number.isFinite(u.x)?u.x:Math.cos(g*2.39996)*100,y:Number.isFinite(u.y)?u.y:Math.sin(g*2.39996)*100,vx:0,vy:0,...o.fixedNodes?.has(u.id)?{fx:o.fixedNodes.get(u.id).x,fy:o.fixedNodes.get(u.id).y}:{}})),i=new Map(n.map(u=>[u.id,u])),s=t.flatMap(u=>{let g=i.get(u.sourceId),f=i.get(u.targetId);if(!g||!f||g===f)return [];let b=Number.isFinite(u.associationStrength)?qf(u.associationStrength,0,1):0;return [{source:g,target:f,strength:b,distance:(g.width+f.width)/2+(r.linkDistance+(1-b)*r.weakLinkDistance)}]}).sort((u,g)=>`${u.source.id}:${u.target.id}`.localeCompare(`${g.source.id}:${g.target.id}`,"en")),l=o.center??{x:3800,y:2800},d=n.length?1:0,c=0;function p(u=1){for(let g=0;g<u&&d>0;g++){for(let f=0;f<n.length;f++)for(let b=f+1;b<n.length;b++){let x=n[f],y=n[b],k=y.x-x.x,w=y.y-x.y;if(Math.abs(k)+Math.abs(w)<.01){let C=(f+b+1)*2.39996;k=Math.cos(C),w=Math.sin(C);}let v=Math.max(1,Math.hypot(k,w)),h=Math.min(8,r.repulsion/Math.max(2500,v*v))*d,S=k/v*h,T=w/v*h;x.vx-=S,x.vy-=T,y.vx+=S,y.vy+=T;}for(let{source:f,target:b,strength:x,distance:y}of s){let k=b.x-f.x,w=b.y-f.y,v=Math.max(1,Math.hypot(k,w)),h=(v-y)*(r.linkStrength+x*r.strongLinkStrength)*d,S=k/v*h,T=w/v*h;f.vx+=S,f.vy+=T,b.vx-=S,b.vy-=T;}c=0;for(let f of n)f.vx=qf((f.vx+(l.x-f.x)*r.centerStrength*d)*r.velocityRetention,-r.maxVelocity,r.maxVelocity),f.vy=qf((f.vy+(l.y-f.y)*r.centerStrength*d)*r.velocityRetention,-r.maxVelocity,r.maxVelocity),f.fx!==void 0&&f.fy!==void 0?(f.x=f.fx,f.y=f.fy,f.vx=f.vy=0):(f.x+=f.vx,f.y+=f.vy,c+=f.vx*f.vx+f.vy*f.vy);for(let f=0;f<r.collisionPasses;f++)for(let b=0;b<n.length;b++)for(let x=b+1;x<n.length;x++){let y=n[b],k=n[x],w=k.x-y.x,v=k.y-y.y,h=(y.width+k.width)/2+r.collisionPadding-Math.abs(w),S=(y.height+k.height)/2+r.collisionPadding-Math.abs(v);if(h<=0||S<=0)continue;let T=y.fx===void 0,C=k.fx===void 0,R=Number(T)+Number(C);if(R)if(h<S){let M=Math.sign(w||1)*h/R;T&&(y.x-=M),C&&(k.x+=M);}else {let M=Math.sign(v||1)*S/R;T&&(y.y-=M),C&&(k.y+=M);}}d*=r.cooling,d<r.minAlpha&&(d=0);}return d>0}return a(p,"step"),{step:p,get active(){return d>0},get energy(){return c},positions:a(()=>new Map(n.map(({id:u,x:g,y:f})=>[u,{x:g,y:f}])),"positions"),reheat(){n.length&&(d=Math.max(d,.65));},pin(u,g,f){let b=i.get(u);!b||!Number.isFinite(g)||!Number.isFinite(f)||(b.x=b.fx=g,b.y=b.fy=f,b.vx=b.vy=0,d=Math.max(d,.65));},release(u){let g=i.get(u);if(!g)return;let f=o.fixedNodes?.get(u);g.fx=f?.x,g.fy=f?.y,d=Math.max(d,.65);}}}a(Pu,"createForceSimulation");var G5=a((e,t,o,r={})=>{let n=[...e].sort((d,c)=>d.id.localeCompare(c.id,"en")),i=new Map;for(let d of t)i.set(d.sourceId,(i.get(d.sourceId)??0)+1),i.set(d.targetId,(i.get(d.targetId)??0)+1);let s=n.map((d,c)=>{let p=c*Math.PI*(3-Math.sqrt(5)),u=d.role==="focus"?0:130*Math.sqrt(c+1);return {...d,x:3800+Math.cos(p)*u,y:2800+Math.sin(p)*u}}),l=Pu(s,t,r);return l.step(Math.max(1,Math.min(1e3,Number.isFinite(o)?Math.floor(o):280))),new Map([...l.positions()].map(([d,c])=>[d,{...c,degree:i.get(d)??0}]))},"layoutTrendRadarFocusTopology"),Eu=a((e,t)=>{if(!e.length)return {x:0,y:0,width:2,height:2};let o=Math.min(...e.map(s=>s.x-s.width/2))-t,r=Math.max(...e.map(s=>s.x+s.width/2))+t,n=Math.min(...e.map(s=>s.y-s.height/2))-t,i=Math.max(...e.map(s=>s.y+s.height/2))+t;return {x:o,y:n,width:Math.max(2,r-o),height:Math.max(2,i-n)}},"calculateTrendRadarFocusTopologyBounds");var Mr={x:0,y:0,width:7600,height:5600};var $5=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp");var kk=a(e=>{let t=Number.isFinite(e)?$5(e,0,1):0,o=.8+Math.pow(t,1.35)*7.2;return {strokeWidth:o,strokeOpacity:.26+t*.7,glowWidth:o+3+t*7,glowOpacity:t<.28?.02:.04+t*.14}},"getTrendRadarFocusTopologyFocusEdgeStyle"),Au=a((e,t="dark")=>{let o=a((l,d,c)=>`color-mix(in srgb, ${d} ${c}%, ${l})`,"mix"),r=e.role==="context",n=e.role==="focus",i=o("hsl(var(--monkeys-color-background))",e.solidColor,t==="light"?n?16:r?4:10:n?48:40),s=t==="light"?o(r?"hsl(var(--monkeys-color-muted-foreground))":"hsl(var(--monkeys-color-foreground))",e.solidColor,r?10:38):o(e.color,"hsl(var(--monkeys-color-foreground))",n?45:34);return {background:i,foreground:s,border:o(i,s,n?82:67)}},"getTrendRadarFocusTopologyNodeTone"),j5=a((e,t)=>{let o=t.x-e.x,r=t.y-e.y,n=Math.max(Math.hypot(o,r),1),i=Math.min(72,Math.max(18,n*.13)),s=e.id.localeCompare(t.id)>=0?1:-1;return {x:(e.x+t.x)/2+r/n*i*s,y:(e.y+t.y)/2-o/n*i*s}},"getTrendRadarFocusTopologyEdgeControlPoint"),Ck=a((e,t)=>{let o=j5(e,t);return `M ${e.x} ${e.y} Q ${o.x} ${o.y} ${t.x} ${t.y}`},"getTrendRadarFocusTopologyEdgePath");var dL={"align-justify":lucideReact.AlignJustify,grid:lucideReact.Grid3X3,layers:lucideReact.Layers,"map-pin":lucideReact.MapPin,mountain:lucideReact.Mountain,package:lucideReact.Package,paintbrush:lucideReact.Paintbrush,palette:lucideReact.Palette,scissors:lucideReact.Scissors,shield:lucideReact.Shield,"shield-check":lucideReact.ShieldCheck,shirt:lucideReact.Shirt,snowflake:lucideReact.Snowflake,sparkles:lucideReact.Sparkles,user:lucideReact.UserRound,users:lucideReact.UsersRound},cL=a((e,t)=>{if(e.role!=="focus")return "var(--trend-radar-muted-color)";let o=Math.pow(e.associationStrength,1.2)*86;return `color-mix(in srgb, var(--trend-radar-muted-color), ${t.color} ${o}%)`},"edgeStroke");function Tk({model:e,config:t=Ji,onOpenNode:o,renderNodeAction:r,relationshipLabel:n,colorMode:i="dark",onNodePointerDown:s,onNodeKeyDown:l}){let d=a((u,g)=>t.edges.curved?Ck(u,g):`M ${u.x} ${u.y} L ${g.x} ${g.y}`,"edgePath"),c=ho.useId().replace(/:/g,""),p=ho.useMemo(()=>new Map(e.nodes.map(u=>[u.id,u])),[e.nodes]);return jsxRuntime.jsxs("div",{className:"trend-radar-focus-topology-background pointer-events-none relative size-full overflow-visible","data-radar-focus-topology-surface":"true","data-radar-focus-topology-color-mode":i,children:[t.edges.visible&&jsxRuntime.jsxs("svg",{viewBox:`0 0 ${Mr.width} ${Mr.height}`,className:"absolute inset-0 size-full overflow-visible","aria-hidden":"true",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("filter",{id:c,x:"-40%",y:"-40%",width:"180%",height:"180%",children:jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"7"})})}),jsxRuntime.jsx("g",{"data-radar-focus-topology-edge-layer":"context",children:e.edges.filter(u=>u.role!=="focus").map(u=>{let g=p.get(u.sourceId),f=p.get(u.targetId);return !g||!f?null:jsxRuntime.jsx("path",{d:d(g,f),fill:"none",stroke:t.edges.color??"var(--trend-radar-muted-color)",strokeWidth:Math.max(.8,.72+Math.pow(u.associationStrength,1.08)*2.2)*t.edges.widthScale,strokeOpacity:Math.min(1,(u.role==="related"?.12:.045)*t.edges.opacityScale),strokeLinecap:"round",strokeLinejoin:"round"},u.id)})}),jsxRuntime.jsx("g",{"data-radar-focus-topology-edge-layer":"focus",children:e.edges.filter(u=>u.role==="focus").map(u=>{let g=p.get(u.sourceId),f=p.get(u.targetId);if(!g||!f)return null;let b=d(g,f),x=t.edges.color??cL(u,g.id===e.subjectId?f:g),y=kk(u.associationStrength);return jsxRuntime.jsxs("g",{"data-radar-focus-topology-focus-edge":u.id,"data-radar-focus-topology-association-strength":u.associationStrength.toFixed(4),children:[jsxRuntime.jsx("path",{d:b,fill:"none",stroke:x,strokeWidth:y.glowWidth*t.edges.widthScale,strokeOpacity:t.edges.glow?Math.min(1,y.glowOpacity*t.edges.opacityScale):0,strokeLinecap:"round",filter:`url(#${c})`}),jsxRuntime.jsx("path",{d:b,fill:"none",stroke:x,strokeWidth:y.strokeWidth*t.edges.widthScale,strokeOpacity:Math.min(1,y.strokeOpacity*t.edges.opacityScale),strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("title",{children:n(u)})})]},u.id)})})]}),e.nodes.map(u=>{let g=dL[u.iconName]??lucideReact.Palette,f=Au(u,i),b=u.role==="focus",x=u.role==="context",y=!!(o&&!b);return jsxRuntime.jsxs("div",{className:m("absolute transition-[filter,opacity,transform] duration-200",b?"z-20":u.role==="related"?"z-10":"z-0",x&&i==="dark"&&"opacity-[0.18] brightness-[0.72] saturate-[0.3] hover:!opacity-100 hover:!filter-none"),style:{"--radar-node-background":f.background,"--radar-node-foreground":f.foreground,"--radar-node-border":f.border,left:u.x,opacity:x?t.nodes.contextOpacity??(i==="dark"?u.contextOpacity:void 0):void 0,top:u.y,width:u.width,height:u.height,transform:`translate(-50%, -50%) scale(${b?t.nodes.focusScale:1})`,transformOrigin:"center center"},"data-radar-focus-topology-node-anchor":u.ref.id,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!y&&!s,"aria-label":u.label,title:u.taxonomy?.secondaryLabel?`${u.label} \xB7 ${u.taxonomy.secondaryLabel}`:u.label,onPointerDown:k=>{k.stopPropagation(),s?.(k,u);},onKeyDown:k=>l?.(k,u),onClick:k=>{k.stopPropagation(),y&&o?.(u);},className:m("focus-visible:ring-primary pointer-events-auto flex size-full items-center justify-center gap-2 rounded-full border-0 px-3 text-left text-[0.8125rem] leading-none font-semibold outline-hidden transition-[box-shadow,filter,transform] focus-visible:ring-2",y&&"cursor-pointer hover:brightness-110",!y&&"cursor-default disabled:opacity-100"),style:{fontSize:t.nodes.fontSize,borderRadius:t.nodes.borderRadius,color:f.foreground,backgroundColor:f.background,boxShadow:t.nodes.glow?b?`inset 0 0 0 2px ${f.border}, 0 0 34px ${u.color}66`:u.role==="related"?`inset 0 0 0 1px ${f.border}, 0 0 18px ${u.color}24`:`inset 0 0 0 1px ${f.border}`:`inset 0 0 0 ${b?2:1}px ${f.border}`},"data-radar-focus-topology-node":u.ref.id,"data-world-x":u.x.toFixed(2),"data-world-y":u.y.toFixed(2),"data-radar-focus-topology-node-role":u.role,children:[t.nodes.showIcons&&jsxRuntime.jsx(g,{className:"shrink-0",size:t.nodes.iconSize,color:f.foreground,strokeWidth:1.8,"aria-hidden":"true"}),t.nodes.showLabels&&jsxRuntime.jsx("span",{className:"min-w-0 truncate",style:{color:"inherit"},children:u.label})]}),r?.(u)]},u.id)})]})}a(Tk,"TrendRadarFocusTopologySurface");function zu({model:e,config:t,onCameraChange:o,colorMode:r="light",ariaLabel:n,onOpenNode:i,renderNodeAction:s,nodeAction:l,onNodeAction:d,relationshipLabel:c,controls:p,onNodePositionChange:u}){if(l?.maxActive!==void 0&&(!Number.isSafeInteger(l.maxActive)||l.maxActive<1))throw new TypeError("Node action maxActive must be a positive integer.");if(l?.size!==void 0&&(!Number.isFinite(l.size)||l.size<16||l.size>48))throw new TypeError("Node action size must be between 16 and 48.");let g=ho.useMemo(()=>fl(t),[t]),f=ho.useMemo(()=>new Set(l?.activeNodeIds??[]),[l?.activeNodeIds]),b=JSON.stringify(g.physics),x=ho.useMemo(()=>JSON.parse(b),[b]),y=JSON.stringify(g.viewport),k=ho.useMemo(()=>JSON.parse(y),[y]),{interaction:w,ui:v}=g,h=ho.useRef(null),S=ho.useRef(),T=JSON.stringify({nodes:e.nodes.map(({id:O,x:K,y:ne,width:fe,height:he})=>({id:O,x:K,y:ne,width:fe,height:he})),edges:e.edges.map(({sourceId:O,targetId:K,associationStrength:ne})=>({sourceId:O,targetId:K,associationStrength:ne}))}),C=ho.useMemo(()=>{let O=JSON.parse(T);return Pu(O.nodes,O.edges,{physics:x})},[T,x]),[R,M]=ho.useState(()=>C.positions()),[I,B]=ho.useState(false),[N,D]=ho.useState({x:0,y:0,z:1}),E=ho.useRef(o);E.current=o,ho.useEffect(()=>{E.current?.(N);},[N]);let P=ho.useRef(N),W=ho.useRef(),H=ho.useRef(false),[A,L]=ho.useState({width:1,height:1}),F=ho.useRef(false),G=ho.useMemo(()=>e.nodes.map(O=>({...O,...R.get(O.id)??{}})),[e.nodes,R]),$=ho.useRef(G);$.current=G;let _=ho.useCallback(O=>{P.current=O,D(O);},[]),z=ho.useCallback(()=>{if(S.current!==void 0)return;if(F.current&&!W.current){C.step(1400),M(C.positions()),B(false);return}B(C.active);let O=a(()=>{C.step(x.ticksPerFrame),M(C.positions()),C.active?S.current=requestAnimationFrame(O):(S.current=void 0,B(false));},"tick");S.current=requestAnimationFrame(O);},[C,x.ticksPerFrame]),re=ho.useCallback(()=>{let O=h.current;if(!O)return;let K=Eu($.current,k.fitPadding),ne=Math.max(k.minZoom,Math.min(k.maxZoom,k.fitMaxZoom,(O.clientWidth-k.screenPadding*2)/K.width,(O.clientHeight-k.screenPadding*2)/K.height));_({x:O.clientWidth/(2*ne)-K.x-K.width/2,y:O.clientHeight/(2*ne)-K.y-K.height/2,z:ne});},[_,k]);ho.useEffect(()=>{F.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;let O=C.positions();return M(O),$.current=$.current.map(K=>({...K,...O.get(K.id)})),re(),z(),()=>{S.current!==void 0&&cancelAnimationFrame(S.current),S.current=void 0;let K=W.current;K?.target.hasPointerCapture?.(K.pointerId)&&K.target.releasePointerCapture(K.pointerId),W.current=void 0;}},[C,re,z]),ho.useEffect(()=>{let O=h.current;if(!O)return;let K=new ResizeObserver(()=>{L({width:O.clientWidth,height:O.clientHeight}),k.fitOnResize&&re();});return K.observe(O),()=>K.disconnect()},[re,k.fitOnResize]);let Z=ho.useCallback((O,K,ne)=>{if(!w.zoom)return;let fe=P.current,he=Math.max(k.minZoom,Math.min(k.maxZoom,fe.z*Math.exp(-O*k.zoomSensitivity)));_({x:fe.x-K/fe.z+K/he,y:fe.y-ne/fe.z+ne/he,z:he});},[_,k,w.zoom]);ho.useEffect(()=>{let O=h.current;if(!O)return;let K=a(ne=>{if(W.current||!w.zoom)return;ne.preventDefault();let fe=O.getBoundingClientRect();Z(ne.deltaY,ne.clientX-fe.left,ne.clientY-fe.top);},"wheel");return O.addEventListener("wheel",K,{passive:false}),()=>O.removeEventListener("wheel",K)},[Z,w.zoom]);let ae=a((O,K)=>{if(O.button!==0||W.current||(K?!w.dragNodes:!w.pan))return;H.current=false;let ne=P.current;W.current={pointerId:O.pointerId,id:K?.id,startX:O.clientX,startY:O.clientY,x:K?.x??ne.x,y:K?.y??ne.y,moved:false,target:O.currentTarget},O.currentTarget.setPointerCapture(O.pointerId),K&&(C.pin(K.id,K.x,K.y),z());},"begin"),ee=a(O=>{let K=W.current;if(!(!K||K.pointerId!==O.pointerId)){if(W.current=void 0,H.current=K.moved,K.id){let ne=C.positions().get(K.id);C.release(K.id),z(),K.moved&&ne&&u?.(K.id,ne);}K.target.hasPointerCapture(O.pointerId)&&K.target.releasePointerCapture(O.pointerId);}},"end"),q={...e,nodes:G},U=new Map(G.map(O=>[O.id,O])),X=Eu([...e.nodes,...G],200);return jsxRuntime.jsxs("section",{ref:h,className:"relationship-graph bg-background relative size-full overflow-hidden",style:{cursor:w.pan?void 0:"default",touchAction:w.pan||w.dragNodes?"none":"auto"},role:"region","aria-label":n,"data-radar-focus-topology":"true","data-graph-engine":"native-force","data-force-running":I,"data-radar-focus-topology-camera":`${N.x.toFixed(2)},${N.y.toFixed(2)},${N.z.toFixed(3)}`,onPointerDown:O=>{O.target.closest("button")||ae(O);},onPointerMove:O=>{let K=W.current;if(!K||K.pointerId!==O.pointerId)return;let ne=O.clientX-K.startX,fe=O.clientY-K.startY;K.moved||(K.moved=Math.hypot(ne,fe)>w.dragThreshold),K.moved&&(K.id?(C.pin(K.id,K.x+ne/P.current.z,K.y+fe/P.current.z),M(C.positions()),z()):_({...P.current,x:K.x+ne/P.current.z,y:K.y+fe/P.current.z}));},onPointerUp:ee,onPointerCancel:ee,onLostPointerCapture:ee,onClickCapture:O=>{H.current&&(O.preventDefault(),O.stopPropagation(),H.current=false);},children:[jsxRuntime.jsx("div",{style:{position:"absolute",left:0,top:0,width:Mr.width,height:Mr.height,transformOrigin:"0 0",transform:`translate(${N.x*N.z}px, ${N.y*N.z}px) scale(${N.z})`},children:jsxRuntime.jsx(Tk,{model:q,config:g,colorMode:r,relationshipLabel:c,onOpenNode:w.openNodes?i:void 0,renderNodeAction:s??(l&&d?O=>{if(l.nodeKinds&&!l.nodeKinds.includes(O.ref.kind))return null;let K=f.has(O.id),ne=l.disabled||!K&&l.maxActive!==void 0&&f.size>=l.maxActive,fe=`${K?l.activeLabel??l.label:l.label}: ${O.label}`,he=K?lucideReact.Check:lucideReact.Plus,me=l.size??24;return jsxRuntime.jsx("button",{type:"button","data-relationship-node-action":O.id,"aria-label":fe,title:fe,"aria-pressed":K,disabled:ne,className:"grid place-items-center rounded-md border border-current bg-card text-foreground shadow-sm outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",style:{position:"absolute",right:0,top:0,width:me,height:me,color:Au(O,r).foreground,transform:`translate(50%, -50%) scale(${l.keepScreenSize===false?1:1/N.z})`,transformOrigin:"center"},onPointerDown:ie=>ie.stopPropagation(),onKeyDown:ie=>ie.stopPropagation(),onClick:ie=>{ie.stopPropagation(),d(O);},children:jsxRuntime.jsx(he,{size:me*.6,"aria-hidden":"true"})})}:void 0),onNodePointerDown:w.dragNodes?(O,K)=>ae(O,K):void 0,onNodeKeyDown:(O,K)=>{if(!w.keyboard||!w.dragNodes)return;let ne={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[O.key];if(!ne)return;O.preventDefault(),O.stopPropagation();let fe=(O.shiftKey?w.keyboardFastStep:w.keyboardStep)/P.current.z,he={x:K.x+ne[0]*fe,y:K.y+ne[1]*fe};C.pin(K.id,he.x,he.y),M(C.positions()),C.release(K.id),z(),u?.(K.id,he);}})}),(v.controls||v.minimap)&&jsxRuntime.jsxs("div",{className:"relationship-minimap","data-radar-focus-topology-minimap":"true",style:{width:v.minimapWidth,left:v.dock.endsWith("left")?12:"auto",right:v.dock.endsWith("right")?12:"auto",top:v.dock.startsWith("top")?12:"auto",bottom:v.dock.startsWith("bottom")?12:"auto"},children:[v.controls&&jsxRuntime.jsxs("div",{className:"relationship-controls",children:[jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomOut,onClick:()=>Z(k.zoomStep,A.width/2,A.height/2),disabled:!w.zoom||N.z<=k.minZoom,children:jsxRuntime.jsx(lucideReact.Minus,{size:15})}),jsxRuntime.jsxs("output",{children:[Math.round(N.z*100),"%"]}),jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomIn,onClick:()=>Z(-k.zoomStep,A.width/2,A.height/2),disabled:!w.zoom||N.z>=k.maxZoom,children:jsxRuntime.jsx(lucideReact.Plus,{size:15})}),jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomToFit,onClick:re,children:jsxRuntime.jsx(lucideReact.LocateFixed,{size:15})})]}),v.minimap&&jsxRuntime.jsx("button",{type:"button",className:"relationship-minimap-map",disabled:!w.pan,"aria-label":p.minimap,onClick:O=>{if(O.detail===0){re();return}let K=O.currentTarget.getBoundingClientRect(),ne=(O.clientX-K.left)/K.width*X.width+X.x,fe=(O.clientY-K.top)/K.height*X.height+X.y;_({...N,x:A.width/(2*N.z)-ne,y:A.height/(2*N.z)-fe});},children:jsxRuntime.jsxs("svg",{viewBox:`${X.x} ${X.y} ${X.width} ${X.height}`,style:{height:v.minimapHeight},preserveAspectRatio:"none","aria-hidden":"true",children:[e.edges.map(O=>{let K=U.get(O.sourceId),ne=U.get(O.targetId);return K&&ne?jsxRuntime.jsx("line",{x1:K.x,y1:K.y,x2:ne.x,y2:ne.y,stroke:"currentColor",strokeWidth:2,opacity:.2},O.id):null}),G.map(O=>jsxRuntime.jsx("circle",{cx:O.x,cy:O.y,r:O.role==="focus"?14:8,fill:O.color},O.id)),jsxRuntime.jsx("rect",{x:-N.x,y:-N.y,width:A.width/N.z,height:A.height/N.z,fill:"currentColor",fillOpacity:.07,stroke:"currentColor",strokeWidth:4})]})})]})]})}a(zu,"RelationshipGraph2D");var fL={primary:"hsl(var(--radar-series-one, var(--primary)))",secondary:"hsl(var(--radar-series-two, var(--success)))",accent:"hsl(var(--radar-series-three, var(--warning)))",muted:"hsl(var(--radar-series-four, var(--muted-foreground)))"},bL={nodes:{showIcons:false,glow:false,contextOpacity:1},edges:{glow:false,opacityScale:3,widthScale:.5}};function Mk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:n="Relationship graph",className:i,height:s=440}){let l=Ye(),d=On(),c=JSON.stringify([e,t]),p=ho.useMemo(()=>Iu(e,t),[c]),u=ho.useMemo(()=>({subjectId:o??"",bounds:Mr,focusBounds:Mr,nodes:p.points.map(b=>{let x=Math.max(88,Math.min(240,Array.from(b.label).length*14+32)),y=fL[b.tone??"muted"];return {id:b.id,ref:{kind:"node",id:b.id},label:b.label,x:Mr.width/2+b.x*70,y:Mr.height/2+b.y*70,width:x,height:36,radius:x/2,score:0,degree:p.neighbors.get(b.id)?.size??0,colorKey:b.tone??"muted",color:y,solidColor:y,iconName:"layers",role:b.id===o?"focus":"related"}}),edges:p.links.map((b,x)=>({id:b.id??`${b.sourceId}:${b.targetId}:${x}`,sourceId:b.sourceId,targetId:b.targetId,evidenceRefs:[],evidenceCount:0,associationStrength:1,role:b.sourceId===o||b.targetId===o?"focus":"related"}))}),[p,o]),g=ho.useMemo(()=>new Map(e.map(b=>[b.id,b])),[c]),f=ho.useMemo(()=>new Map(p.links.map((b,x)=>[b.id??`${b.sourceId}:${b.targetId}:${x}`,b.label??`${g.get(b.sourceId)?.label} \u2192 ${g.get(b.targetId)?.label}`])),[p,g]);return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-relationship-graph","data-workbench-relationship-variant":"force-2d",className:m("relative h-[var(--relationship-height)] min-h-0 min-w-0 overflow-hidden",i),style:{"--relationship-height":`${s}px`},children:jsxRuntime.jsx(zu,{model:u,config:bL,colorMode:d?.colorMode==="dark"?"dark":"light",ariaLabel:n,controls:l.workbench.relationshipGraph??{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview"},relationshipLabel:b=>f.get(b.id)??"",onOpenNode:r?b=>{let x=g.get(b.id);x&&r(x);}:void 0})})}a(Mk,"RelationshipForce2D");var gL={primary:"fill-primary/10 stroke-primary text-primary",secondary:"fill-secondary stroke-secondary-foreground text-secondary-foreground",accent:"fill-accent stroke-accent-foreground text-accent-foreground",muted:"fill-muted stroke-muted-foreground text-muted-foreground"},hL={primary:"--radar-series-one",secondary:"--radar-series-two",accent:"--radar-series-three",muted:"--radar-series-four"},yL={primary:"var(--primary)",secondary:"var(--secondary-foreground)",accent:"var(--accent-foreground)",muted:"var(--muted-foreground)"},Fu=a((e,t=1)=>`hsl(var(${hL[e]}, ${yL[e]}) / ${t})`,"radarToneColor"),xL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateNode");function Dk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,width:n=900,height:i=440,emptyState:s=null,ariaLabel:l="Relationship graph",className:d,variant:c="default"}){if(!e.length)return V(s)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:s}):null;if(c==="galaxy")return jsxRuntime.jsx(yk,{nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:l,className:d});if(c==="force-2d")return jsxRuntime.jsx(Mk,{nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:l,className:d,height:i});let p=c==="radar",u=Math.min(n,i)*(p?.37:.35),g=o?e.findIndex(x=>x.id===o):-1,f=g>=0?e.filter((x,y)=>y!==g):e,b=new Map(e.map((x,y)=>{if(e.length===1)return [x.id,{x:n/2,y:i/2}];if(p&&y===g)return [x.id,{x:n/2,y:i/2}];let k=f.findIndex(v=>v.id===x.id),w=Math.PI*2*k/f.length-Math.PI/2;return [x.id,{x:n/2+Math.cos(w)*u,y:i/2+Math.sin(w)*u}]}));return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-relationship-graph","data-workbench-relationship-variant":c,className:m("relative min-w-0 overflow-hidden rounded-lg border",p?"min-h-[42rem]":"overflow-x-auto border-border/70 bg-card",d),style:p?{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",borderColor:"hsl(var(--radar-shell-border, var(--border)))",backgroundImage:"linear-gradient(hsl(var(--radar-grid, var(--border)) / 0.28) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--radar-grid, var(--border)) / 0.28) 1px, transparent 1px), radial-gradient(circle at center, hsl(var(--primary) / 0.1), transparent 45%)",backgroundSize:"4rem 4rem, 4rem 4rem, 100% 100%"}:void 0,children:jsxRuntime.jsxs("svg",{viewBox:`0 0 ${n} ${i}`,className:m(p?"absolute inset-0 size-full":"min-w-[42rem]"),preserveAspectRatio:p?"xMidYMid meet":void 0,role:"img","aria-label":l,children:[t.map((x,y)=>{let k=b.get(x.sourceId),w=b.get(x.targetId);return !k||!w?null:jsxRuntime.jsx("line",{x1:k.x,y1:k.y,x2:w.x,y2:w.y,className:p?void 0:"stroke-border",strokeWidth:p?"2":"1.5",style:p?{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.46)",filter:"drop-shadow(0 0 0.35rem hsl(var(--primary) / 0.34))"}:void 0,children:jsxRuntime.jsx("title",{children:x.label||`${x.sourceId} to ${x.targetId}`})},x.id||`${x.sourceId}:${x.targetId}:${y}`)}),e.map(x=>{let y=b.get(x.id),k=x.id===o,w=x.tone||"muted",v=p?{color:Fu(w)}:void 0;return jsxRuntime.jsxs("g",{transform:`translate(${y.x}, ${y.y})`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":x.meta?`${x.label}, ${x.meta}`:x.label,"aria-pressed":r?k:void 0,onClick:r?()=>r(x):void 0,onKeyDown:h=>xL(h,x,r),className:m(p?"outline-hidden":gL[w],r&&"cursor-pointer outline-hidden"),style:v,children:[jsxRuntime.jsx("circle",{r:p&&k?"50":p?"40":"36",className:m("stroke-1 transition-[stroke-width] duration-150 motion-reduce:transition-none",k&&"stroke-[3]"),style:p?{fill:Fu(w,k?.22:.12),stroke:Fu(w,k?1:.78),filter:`drop-shadow(0 0 ${k?"1.4rem":"0.75rem"} ${Fu(w,.62)})`}:void 0}),jsxRuntime.jsx("text",{textAnchor:"middle",y:x.meta?-3:4,className:m("pointer-events-none fill-current font-semibold",p?"text-sm":"text-xs"),children:x.label.slice(0,18)}),x.meta?jsxRuntime.jsx("text",{textAnchor:"middle",y:"16",className:m("pointer-events-none text-xs",p?"fill-current opacity-70":"fill-muted-foreground"),children:x.meta.slice(0,22)}):null]},x.id)})]})})}a(Dk,"WorkbenchRelationshipGraph");var wL={primary:"fill-primary stroke-primary",secondary:"fill-secondary stroke-secondary-foreground",accent:"fill-accent stroke-accent-foreground",muted:"fill-muted stroke-muted-foreground"},kL=a(e=>e.filter(Number.isFinite),"finiteValues"),Yf=a((e,t,o)=>{let r=kL(e),n=Number.isFinite(t)?Number(t):Math.min(...r,0),i=Number.isFinite(o)?Number(o):Math.max(...r,1);return n===i?[n,i+1]:n<i?[n,i]:[i,n]},"getDomain"),hl=a((e,t,o,r)=>o+(e-t[0])/(t[1]-t[0])*(r-o),"scale"),Va=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),CL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activatePoint");function Ek({points:e,xAxis:t,yAxis:o,thresholds:r,selectedPointId:n,onPointSelect:i,width:s=900,height:l=420,emptyState:d=null,ariaLabel:c=`${t.label} by ${o.label}`,className:p}){let u=e.filter(T=>Number.isFinite(T.x)&&Number.isFinite(T.y));if(!u.length)return V(d)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:d}):null;let g=56,f=Yf(u.map(T=>T.x),t.min,t.max),b=Yf(u.map(T=>T.y),o.min,o.max),x=Yf(u.map(T=>T.size??1)),y=g,k=s-g,w=g,v=l-g,h=Number.isFinite(r?.x)?hl(Number(r?.x),f,y,k):void 0,S=Number.isFinite(r?.y)?hl(Number(r?.y),b,v,w):void 0;return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-scatter-plot",className:m("min-w-0 overflow-x-auto rounded-lg border border-border/70 bg-card p-3",p),children:jsxRuntime.jsxs("svg",{viewBox:`0 0 ${s} ${l}`,className:"min-w-[42rem]",role:"img","aria-label":c,children:[jsxRuntime.jsx("line",{x1:y,y1:v,x2:k,y2:v,className:"stroke-border"}),jsxRuntime.jsx("line",{x1:y,y1:w,x2:y,y2:v,className:"stroke-border"}),h===void 0?null:jsxRuntime.jsx("line",{x1:Va(h,y,k),y1:w,x2:Va(h,y,k),y2:v,className:"stroke-muted-foreground/50",strokeDasharray:"5 5"}),S===void 0?null:jsxRuntime.jsx("line",{x1:y,y1:Va(S,w,v),x2:k,y2:Va(S,w,v),className:"stroke-muted-foreground/50",strokeDasharray:"5 5"}),jsxRuntime.jsx("text",{x:s/2,y:l-12,textAnchor:"middle",className:"fill-muted-foreground text-xs",children:t.label}),jsxRuntime.jsx("text",{x:"16",y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,className:"fill-muted-foreground text-xs",children:o.label}),u.map(T=>{let C=Va(hl(T.x,f,y,k),y,k),R=Va(hl(T.y,b,v,w),w,v),M=T.size===void 0?9:Va(hl(T.size,x,7,18),7,18),I=n===T.id;return jsxRuntime.jsxs("g",{transform:`translate(${C}, ${R})`,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":`${T.label}: ${t.label} ${T.x}, ${o.label} ${T.y}`,"aria-pressed":i?I:void 0,onClick:i?()=>i(T):void 0,onKeyDown:B=>CL(B,T,i),className:m(i&&"cursor-pointer outline-hidden"),children:[jsxRuntime.jsx("circle",{r:M,className:m("stroke-1 opacity-80 transition-opacity duration-150 motion-reduce:transition-none",wL[T.tone||"primary"],I?"opacity-100 stroke-[3]":"hover:opacity-100")}),jsxRuntime.jsx("text",{y:-M-7,textAnchor:"middle",className:"pointer-events-none fill-foreground text-[0.6875rem] font-semibold",children:T.label.slice(0,24)}),jsxRuntime.jsx("title",{children:T.description||T.label})]},T.id)})]})})}a(Ek,"WorkbenchScatterPlot");var TL=a((e,t,o)=>{!o||t.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function Bk({items:e,onItemSelect:t,ariaLabel:o="Journey",className:r}){return jsxRuntime.jsx("nav",{"aria-label":o,"data-monkeys-component":"workbench-journey-navigation",className:m("min-w-0 overflow-x-auto rounded-lg border border-border/70 bg-card p-2",r),children:jsxRuntime.jsx("ol",{className:"flex min-w-max items-stretch gap-1",children:e.map((n,i)=>{let s=n.state||"upcoming";return jsxRuntime.jsxs("li",{className:"flex items-center",children:[i?jsxRuntime.jsx("span",{className:"mx-1 h-px w-5 bg-border","aria-hidden":"true"}):null,jsxRuntime.jsxs("button",{type:"button",disabled:n.disabled,"aria-current":s==="current"?"page":void 0,onClick:t&&!n.disabled?()=>t(n):void 0,onKeyDown:l=>TL(l,n,t),className:m("min-w-28 rounded-md border px-3 py-2 text-left outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background motion-reduce:transition-none",s==="current"&&"border-primary bg-primary text-primary-foreground",s==="complete"&&"border-primary/30 bg-primary/10 text-foreground",s==="upcoming"&&"border-transparent bg-muted/50 text-muted-foreground",n.disabled&&"cursor-not-allowed opacity-50"),children:[V(n.eyebrow)?jsxRuntime.jsx("span",{className:m("block text-[0.625rem] font-semibold uppercase tracking-[0.14em]",s==="current"?"text-primary-foreground/75":"text-muted-foreground"),children:n.eyebrow}):null,jsxRuntime.jsx("span",{className:"mt-0.5 block text-xs font-semibold",children:n.label})]})]},n.id)})})})}a(Bk,"WorkbenchJourneyNavigation");var NL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function Lk({items:e,selectedItemId:t,onItemSelect:o,emptyState:r=null,ariaLabel:n="Ranked items",className:i}){return e.length?jsxRuntime.jsx("ol",{"aria-label":n,"data-monkeys-component":"workbench-ranked-list",className:m("grid min-w-0 gap-2",i),children:e.map((s,l)=>{let d=t===s.id;return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{type:"button","aria-pressed":o?d:void 0,onClick:o?()=>o(s):void 0,onKeyDown:c=>NL(c,s,o),className:m("grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 rounded-lg border bg-card p-3 text-left text-card-foreground outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",d?"border-primary bg-primary/5":"border-border/70 hover:border-primary/40 hover:bg-accent/50",!o&&"cursor-default"),children:[jsxRuntime.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold tabular-nums text-muted-foreground",children:s.leading||l+1}),jsxRuntime.jsxs("span",{className:"min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:s.label}),V(s.description)?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.description}):null,s.tags?.length?jsxRuntime.jsx("span",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map((c,p)=>jsxRuntime.jsx("span",{className:"rounded-full bg-secondary px-2 py-0.5 text-[0.625rem] font-medium text-secondary-foreground",children:c},`${s.id}:tag:${p}`))}):null,s.metrics?.length?jsxRuntime.jsx("span",{className:"mt-2 grid grid-cols-2 gap-x-4 gap-y-1 sm:grid-cols-4",children:s.metrics.map(c=>jsxRuntime.jsxs("span",{className:"min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate text-[0.625rem] text-muted-foreground",children:c.label}),jsxRuntime.jsx("span",{className:"block text-xs font-semibold tabular-nums text-foreground",children:c.value})]},c.id))}):null]}),jsxRuntime.jsxs("span",{className:"shrink-0 text-right",children:[V(s.score)?jsxRuntime.jsx("span",{className:"block text-lg font-semibold tabular-nums text-primary",children:s.score}):null,V(s.trailing)?jsxRuntime.jsx("span",{className:"mt-1 block text-muted-foreground",children:s.trailing}):null]})]})},s.id)})}):V(r)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:r}):null}a(Lk,"WorkbenchRankedList");function Wk({title:e,description:t,items:o,onRemove:r,removeLabel:n=a(()=>"Remove","removeLabel"),actions:i,emptyState:s=null,className:l}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-selection-tray",className:m("rounded-lg border border-border/70 bg-card p-4 text-card-foreground",l),children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e}),V(t)?jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:t}):null]}),jsxRuntime.jsx("span",{className:"rounded-full bg-primary/10 px-2.5 py-1 text-xs font-semibold tabular-nums text-primary",children:o.length})]}),o.length?jsxRuntime.jsx("ul",{className:"mt-3 flex flex-wrap gap-2",children:o.map(d=>jsxRuntime.jsxs("li",{className:"flex max-w-full items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 text-xs text-foreground",children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate font-medium",children:d.label}),V(d.meta)?jsxRuntime.jsx("span",{className:"shrink-0 text-muted-foreground",children:d.meta}):null,r?jsxRuntime.jsx("button",{type:"button","aria-label":n(d),onClick:()=>r(d),className:"rounded-md px-1 text-muted-foreground outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:"\xD7"}):null]},d.id))}):jsxRuntime.jsx("div",{className:"mt-3 rounded-md border border-dashed border-border px-4 py-5 text-center text-xs text-muted-foreground",children:s}),V(i)?jsxRuntime.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2 border-t border-border pt-4",children:i}):null]})}a(Wk,"WorkbenchSelectionTray");function zk(e,t="milliseconds",o){if(t!=="milliseconds"&&t!=="seconds")return "\u2014";let r;if(typeof e=="number")r=t==="seconds"?e*1e3:e;else if(typeof e=="string"){let i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,3}))?(Z|[+-]\d{2}:\d{2})$/.exec(e);if(!i)return "\u2014";let s=Number(i[1]),l=Number(i[2]),d=Number(i[3]),c=Number(i[4]),p=Number(i[5]),u=Number(i[6]),g=new Date(0);if(g.setUTCFullYear(s,l-1,d),g.getUTCFullYear()!==s||g.getUTCMonth()!==l-1||g.getUTCDate()!==d||c>23||p>59||u>59)return "\u2014";r=Date.parse(e);}else return "\u2014";if(!Number.isFinite(r))return "\u2014";let n=new Date(r);if(!Number.isFinite(n.getTime()))return "\u2014";try{return n.toLocaleString(o)}catch{return "\u2014"}}a(zk,"renderDateTimeValue");function Ok({items:e,emptyState:t=null,ariaLabel:o="Evidence",className:r,translate:n=a(i=>i,"translate")}){let{locale:i}=Co();return e.length?jsxRuntime.jsx("ol",{"aria-label":o,"data-monkeys-component":"workbench-evidence-list",className:m("grid min-w-0 gap-0",r),children:e.map((s,l)=>jsxRuntime.jsxs("li",{className:"grid min-w-0 grid-cols-[1.25rem_minmax(0,1fr)_auto] gap-3",children:[jsxRuntime.jsxs("span",{className:"flex flex-col items-center","aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:"mt-1 flex size-5 items-center justify-center rounded-full border border-primary/40 bg-primary/10 text-[0.625rem] font-semibold text-primary",children:s.marker||l+1}),l<e.length-1?jsxRuntime.jsx("span",{className:"min-h-8 w-px flex-1 bg-border"}):null]}),jsxRuntime.jsxs("span",{className:"min-w-0 pb-5",children:[jsxRuntime.jsx("span",{className:"block text-sm font-semibold text-foreground",children:s.titleKey?n(s.titleKey):s.title}),V(s.description)||s.descriptionKey?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.descriptionKey?n(s.descriptionKey):s.description}):null,V(s.source)||s.sourceKey||V(s.timestamp)||s.timestampValue!==void 0?jsxRuntime.jsxs("span",{className:"mt-1.5 flex flex-wrap gap-x-3 gap-y-1 text-[0.6875rem] text-muted-foreground",children:[V(s.source)||s.sourceKey?jsxRuntime.jsx("span",{children:s.sourceKey?n(s.sourceKey):s.source}):null,V(s.timestamp)||s.timestampValue!==void 0?jsxRuntime.jsx("time",{children:s.timestampValue!==void 0?zk(s.timestampValue,"milliseconds",i):s.timestamp}):null]}):null]}),V(s.action)?jsxRuntime.jsx("span",{className:"pb-5",children:s.action}):null]},s.id))}):V(t)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}):null}a(Ok,"WorkbenchEvidenceList");var IL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function Hk({items:e,selectedItemId:t,onItemSelect:o,emptyState:r=null,ariaLabel:n="Assets",className:i}){return e.length?jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-asset-gallery",children:jsxRuntime.jsx(kn,{items:e,config:{getItemKey:a(s=>s.id,"getItemKey"),layout:{mode:"grid",columns:"auto",minCardWidth:"12rem",idealCardWidth:"16rem",gap:12},appearance:{hover:"none"}},ariaLabel:n,className:i,renderItem:s=>{let l=t===s.id;return jsxRuntime.jsxs("button",{type:"button","aria-pressed":o?l:void 0,onClick:o?()=>o(s):void 0,onKeyDown:d=>IL(d,s,o),className:m("group w-full overflow-hidden rounded-lg border bg-card text-left text-card-foreground outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",l?"border-primary ring-1 ring-primary":"border-border/70 hover:border-primary/40",!o&&"cursor-default"),children:[jsxRuntime.jsx("span",{className:"block aspect-[4/3] overflow-hidden bg-muted",children:jsxRuntime.jsx("img",{src:s.url,alt:s.alt,loading:"lazy",className:"size-full object-cover transition-transform duration-200 group-hover:scale-[1.02] motion-reduce:transition-none"})}),jsxRuntime.jsxs("span",{className:"block p-3",children:[V(s.title)?jsxRuntime.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:s.title}):null,V(s.description)?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.description}):null,s.badges?.length?jsxRuntime.jsx("span",{className:"mt-2 flex flex-wrap gap-1.5",children:s.badges.map((d,c)=>jsxRuntime.jsx("span",{className:"rounded-full bg-secondary px-2 py-0.5 text-[0.625rem] text-secondary-foreground",children:d},`${s.id}:badge:${c}`))}):null]})]})}})}):V(r)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:r}):null}a(Hk,"WorkbenchAssetGallery");var Vk={primary:"--radar-series-one",secondary:"--radar-series-two",accent:"--radar-series-three",muted:"--radar-series-four"},_k={primary:"var(--primary)",secondary:"var(--secondary-foreground)",accent:"var(--accent-foreground)",muted:"var(--muted-foreground)"},_a=a(e=>`hsl(var(${Vk[e]}, ${_k[e]}))`,"workbenchVisualizationToneColor"),xl=a((e,t)=>`hsl(var(${Vk[e]}, ${_k[e]}) / ${t})`,"workbenchVisualizationToneColorWithAlpha");var PL={backgroundColor:"hsl(var(--radar-canvas, var(--background)))",color:"hsl(var(--foreground))"},Gk={backgroundColor:"hsl(var(--radar-panel, var(--card)))",borderColor:"hsl(var(--radar-border, var(--border)))"};function Xf({items:e,activeItemId:t,activeChildId:o,onItemSelect:r,onChildSelect:n,footer:i,ariaLabel:s="Radar navigation"}){return jsxRuntime.jsx(Gi,{kind:"route",routeItems:e.map(l=>({...l,children:l.children?.map(d=>({...d,domProps:{"data-radar-navigation-child-id":d.id}}))})),activeItemId:t,activeChildId:o,onItemSelect:r?l=>r(l):void 0,onChildSelect:n?(l,d)=>n(l,d):void 0,footer:i,ariaLabel:s,dataComponent:"workbench-radar-navigation",widthMode:"fill",resizable:false,collapsible:false,appearance:{density:"default",surface:"outlined",activeVariant:"solid"},className:"min-w-0 self-stretch rounded-lg",classNames:{content:"p-3",list:"gap-2",item:"min-h-11 px-3 py-2 text-sm font-semibold",itemActive:"bg-primary text-primary-foreground shadow-[0_0_1.25rem_hsl(var(--primary)/0.28)]",childList:"ml-5 gap-0.5 border-l border-border/70 py-1 pl-3",childItem:"min-h-9 px-2 text-xs font-medium",childItemActive:"border-primary/40 bg-primary/15 text-primary",footer:"p-3"},style:Gk})}a(Xf,"WorkbenchRadarNavigation");function $k({navigationItems:e=[],activeNavigationId:t,activeNavigationChildId:o,onNavigationSelect:r,onNavigationChildSelect:n,navigationFooter:i,navigation:s,children:l,inspector:d,inspectorLabel:c="Context controls",className:p,contentClassName:u,minimumHeight:g="calc(100dvh - 1rem)",ariaLabel:f="Radar workspace"}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-radar-workspace","data-radar-active-navigation-id":t,"aria-label":f,className:m("grid min-w-0 gap-3 overflow-hidden p-3 lg:grid-cols-[12.5rem_minmax(0,1fr)] xl:grid-cols-[12.5rem_minmax(0,1fr)_20rem]",p),style:{...PL,minHeight:g},children:[V(s)?s:jsxRuntime.jsx(Xf,{items:e,activeItemId:t,activeChildId:o,onItemSelect:r,onChildSelect:n,footer:i}),jsxRuntime.jsx("div",{"data-radar-workspace-region":"content",className:m("relative min-h-[42rem] min-w-0 overflow-hidden rounded-lg border",u),style:{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",borderColor:"hsl(var(--radar-shell-border, var(--border)))",boxShadow:"inset 0 0 0 1px hsl(var(--radar-grid, var(--border)) / 0.22)"},children:l}),V(d)?jsxRuntime.jsx("aside",{"aria-label":c,"data-radar-workspace-region":"inspector",className:"min-h-0 overflow-y-auto rounded-lg border lg:col-span-2 xl:col-span-1",style:Gk,children:d}):null]})}a($k,"WorkbenchRadarWorkspace");function jk({title:e,icon:t,description:o,children:r,className:n}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-radar-inspector-section",className:m("border-b border-border/70 p-4 last:border-b-0",n),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-primary",children:[V(t)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:t}):null,jsxRuntime.jsx("h2",{children:e})]}),V(o)?jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:o}):null,V(r)?jsxRuntime.jsx("div",{className:"mt-3",children:r}):null]})}a(jk,"WorkbenchRadarInspectorSection");function EL(e){let{disclosure:t,onSelect:o}=e;if(!t&&!o||t?.mode==="integrated"&&(!!o||e.selected!==void 0)||t?.mode==="separate"&&!o)throw new Error("Invalid WorkbenchRadarFilterRow props.")}a(EL,"assertValidRadarFilterRowProps");function Uk(e){EL(e);let{label:t,value:o,icon:r,selected:n,disabled:i=false,tone:s,onSelect:l,disclosure:d,className:c}=e,p=n??false,u=p?void 0:"monkeys-workbench-radar-filter-row--idle",g=i?"monkeys-workbench-radar-filter-disabled":void 0,f=s??"primary",b=_a(f),x={"--workbench-radar-filter-tone":b,"--tw-ring-color":s?b:"hsl(var(--ring))",...p||s?{backgroundColor:xl(f,p?.14:.08),borderColor:b}:{}},y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(r)?jsxRuntime.jsx("span",{className:m("flex size-4 shrink-0 items-center justify-center",s?"text-[var(--workbench-radar-filter-tone)]":"text-muted-foreground"),"aria-hidden":"true",children:r}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:t}),V(o)?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 tabular-nums text-muted-foreground",children:o}):null]}),k=d?jsxRuntime.jsx("span",{"aria-hidden":"true",className:m("text-lg leading-none transition-transform motion-reduce:transition-none",d.expanded&&"rotate-90"),children:"\u203A"}):null;if(d?.mode==="separate"){let h=d.expanded?d.collapseLabel:d.expandLabel;return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-radar-filter-row",className:m("monkeys-workbench-radar-filter-row monkeys-workbench-radar-filter-row--separate",u,g,c),style:x,children:[jsxRuntime.jsx("button",{type:"button","aria-pressed":n,disabled:i,onClick:l,className:m("monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row__action",g),children:y}),jsxRuntime.jsx("button",{type:"button","aria-expanded":d.expanded,"aria-controls":d.controls,"aria-label":h,disabled:i,onClick:d.onToggle,className:m("monkeys-workbench-radar-filter-row__disclosure",g),children:k})]})}let w=d?.mode==="integrated"?d:void 0,v=w?w.expanded?w.collapseLabel:w.expandLabel:void 0;return jsxRuntime.jsxs("button",{type:"button","data-monkeys-component":"workbench-radar-filter-row","aria-label":v,"aria-pressed":w?void 0:n,"aria-expanded":w?.expanded,"aria-controls":w?.controls,disabled:i,onClick:w?.onToggle??l,className:m("monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row",u,g,c),style:x,children:[y,w?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:k}):null]})}a(Uk,"WorkbenchRadarFilterRow");function Kk({label:e,value:t,icon:o,selected:r=false,disabled:n=false,onSelect:i,className:s}){let l=!!i||n;return jsxRuntime.jsxs(l?"button":"div",{type:l?"button":void 0,"aria-pressed":i&&!n?r:void 0,disabled:l?n:void 0,onClick:i,className:m("flex min-w-0 items-center border text-xs font-semibold outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none","monkeys-workbench-radar-filter-control rounded-md",r?"border-primary bg-primary/20 text-primary":"border-border bg-background/40 text-foreground hover:border-primary/60 hover:bg-primary/10",n&&"cursor-not-allowed opacity-50",s),children:[V(o)?jsxRuntime.jsx("span",{className:"shrink-0","aria-hidden":"true",children:o}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e}),V(t)?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:t}):null]})}a(Kk,"WorkbenchRadarFilterChip");var BL=a(e=>e.filter(Number.isFinite),"finiteValues"),Qf=a((e,t,o)=>{let r=BL(e),n=Number.isFinite(t)?Number(t):Math.min(...r,0),i=Number.isFinite(o)?Number(o):Math.max(...r,1);return n===i?[n,i+1]:n<i?[n,i]:[i,n]},"getDomain"),pa=a((e,t,o,r)=>o+(e-t[0])/(t[1]-t[0])*(r-o),"scale"),ma=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),LL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activatePoint"),WL={"low-high":{x:26,y:8,anchor:"start"},"high-high":{x:974,y:8,anchor:"end"},"low-low":{x:26,y:660,anchor:"start"},"high-low":{x:974,y:660,anchor:"end"}};function qk({points:e,xAxis:t,yAxis:o,thresholds:r,quadrants:n=[],legend:i=[],selectedPointId:s,onPointSelect:l,width:d=1e3,height:c=700,labelLimit:p=18,emptyState:u=null,ariaLabel:g=`${t.label} by ${o.label} radar matrix`,className:f}){let b=e.filter(M=>Number.isFinite(M.x)&&Number.isFinite(M.y));if(!b.length)return V(u)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:u}):null;let x=Qf(b.map(M=>M.x),t.min,t.max),y=Qf(b.map(M=>M.y),o.min,o.max),k=Qf(b.map(M=>M.size??1)),w=0,v=d,h=0,S=c,T=ma(pa(Number.isFinite(r?.x)?Number(r?.x):(x[0]+x[1])/2,x,w,v),w,v),C=ma(pa(Number.isFinite(r?.y)?Number(r?.y):(y[0]+y[1])/2,y,S,h),h,S),R=new Set([...b].sort((M,I)=>(I.size??0)-(M.size??0)).slice(0,p).map(M=>M.id));return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-radar-matrix",className:m("relative size-full min-h-[42rem] min-w-0 overflow-hidden",f),style:{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",backgroundImage:"radial-gradient(circle at 78% 20%, hsl(var(--primary) / 0.08), transparent 32%), radial-gradient(circle at 18% 82%, hsl(var(--radar-series-two, var(--accent-foreground)) / 0.06), transparent 30%)"},children:[jsxRuntime.jsxs("svg",{viewBox:`0 0 ${d} ${c}`,preserveAspectRatio:"none",className:"absolute inset-0 size-full",role:"img","aria-label":g,children:[jsxRuntime.jsxs("g",{"aria-hidden":"true",children:[Array.from({length:13},(M,I)=>{let B=d/12*I,N=c/12*I;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:B,y1:0,x2:B,y2:c,style:{stroke:"hsl(var(--radar-grid, var(--border)) / 0.36)"}}),jsxRuntime.jsx("line",{x1:0,y1:N,x2:d,y2:N,style:{stroke:"hsl(var(--radar-grid, var(--border)) / 0.36)"}})]},I)}),jsxRuntime.jsx("line",{x1:T,y1:0,x2:T,y2:c,strokeWidth:"1.5",style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.64)"}}),jsxRuntime.jsx("line",{x1:0,y1:C,x2:d,y2:C,strokeWidth:"1.5",style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.64)"}})]}),n.map(M=>{let I=WL[M.id];return jsxRuntime.jsxs("g",{"aria-hidden":"true",children:[jsxRuntime.jsx("text",{x:I.x,y:I.y+20,textAnchor:I.anchor,className:"fill-muted-foreground text-[0.8125rem] font-semibold",children:M.title}),V(M.description)&&typeof M.description=="string"?jsxRuntime.jsx("text",{x:I.x,y:I.y+40,textAnchor:I.anchor,className:"fill-muted-foreground text-[0.6875rem]",children:M.description}):null]},M.id)}),b.map((M,I)=>{let B=ma(pa(M.x,x,40,d-40),40,d-40),N=ma(pa(M.y,y,c-48,54),54,c-48),D=M.tone||(I%2===0?"primary":"accent"),E=s===M.id,P=R.has(M.id),W=P?ma(pa(M.size??1,k,5,9),5,9):3.5,H=P?ma(pa(M.size??1,k,14,31),14,31):0,A={fill:_a(D),stroke:"hsl(var(--foreground) / 0.74)"},L={fill:_a(D),filter:`drop-shadow(0 0 0.65rem ${xl(D,.72)})`};return jsxRuntime.jsxs("g",{transform:`translate(${B}, ${N})`,role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":`${M.label}: ${t.label} ${M.x}, ${o.label} ${M.y}`,"aria-pressed":l?E:void 0,onClick:l?()=>l(M):void 0,onKeyDown:F=>LL(F,M,l),className:m(l&&"cursor-pointer outline-hidden"),children:[E?jsxRuntime.jsx("circle",{r:W+10,fill:"none",strokeWidth:"2",style:{stroke:xl(D,.48)}}):null,jsxRuntime.jsx("circle",{r:W,strokeWidth:"1.25",style:A}),P?jsxRuntime.jsx("text",{y:-W-8,textAnchor:"middle",fontSize:H,fontWeight:"700",style:L,className:"pointer-events-none",children:M.label.slice(0,22)}):null,jsxRuntime.jsx("title",{children:M.description||M.label})]},M.id)}),jsxRuntime.jsx("circle",{cx:T,cy:C,r:"10",style:{fill:"hsl(var(--radar-axis, var(--primary)))"}}),jsxRuntime.jsx("circle",{cx:T,cy:C,r:"3",className:"fill-primary-foreground"}),jsxRuntime.jsx("text",{x:d/2,y:c-12,textAnchor:"middle",className:"fill-muted-foreground text-[0.6875rem]",children:t.label}),jsxRuntime.jsx("text",{x:"14",y:c/2,textAnchor:"middle",transform:`rotate(-90 14 ${c/2})`,className:"fill-muted-foreground text-[0.6875rem]",children:o.label})]}),jsxRuntime.jsxs("div",{className:"absolute bottom-4 left-4 hidden w-44 overflow-hidden rounded-[var(--radius)] border bg-card/95 shadow-xl sm:block",style:{borderColor:"hsl(var(--radar-border, var(--border)))"},"aria-hidden":"true",children:[jsxRuntime.jsxs("div",{className:"flex h-9 items-center justify-between border-b border-border px-3 text-xs font-semibold text-muted-foreground",children:[jsxRuntime.jsx("span",{children:"\u2212"}),jsxRuntime.jsx("span",{children:"100%"}),jsxRuntime.jsx("span",{children:"\uFF0B"})]}),jsxRuntime.jsxs("svg",{viewBox:`0 0 ${d} ${c}`,className:"h-24 w-full",children:[jsxRuntime.jsx("rect",{width:d,height:c,style:{fill:"hsl(var(--radar-canvas, var(--background)))"}}),jsxRuntime.jsx("line",{x1:T,y1:0,x2:T,y2:c,style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.7)"},strokeWidth:"6"}),jsxRuntime.jsx("line",{x1:0,y1:C,x2:d,y2:C,style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.7)"},strokeWidth:"6"}),b.map((M,I)=>jsxRuntime.jsx("circle",{cx:ma(pa(M.x,x,40,d-40),40,d-40),cy:ma(pa(M.y,y,c-48,54),54,c-48),r:"8",style:{fill:_a(M.tone||(I%2===0?"primary":"accent"))}},M.id)),jsxRuntime.jsx("rect",{x:d*.22,y:c*.12,width:d*.58,height:c*.62,fill:"none",strokeWidth:"8",style:{stroke:"hsl(var(--primary))"}})]})]}),i.length?jsxRuntime.jsx("div",{className:"absolute bottom-4 left-1/2 hidden -translate-x-1/2 items-center gap-4 rounded-full border border-border bg-card/95 px-4 py-2 text-xs font-semibold shadow-xl md:flex",children:i.map(M=>{let I=M.tone||"muted";return jsxRuntime.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:_a(I)}}),M.label]},M.id)})}):null]})}a(qk,"WorkbenchRadarMatrix");function Xk({viewMode:e="list",heading:t,metadata:o,message:r,actions:n,outputs:i,children:s,className:l,...d}){return jsxRuntime.jsxs("article",{...d,"data-monkeys-component":"workbench-task-card","data-view-mode":e,className:m("border-border/70 font-[family-name:var(--font-sans)] text-sm leading-5",e==="grid"?"flex h-full flex-col gap-global rounded-lg border bg-card p-global shadow-sm":"grid items-center gap-global border-b py-global last:border-b-0 lg:grid-cols-2",l),children:[jsxRuntime.jsxs("div",{"data-task-part":"details",className:m("flex min-w-0 flex-col",e==="grid"?"flex-1":"min-h-60"),children:[jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global",children:t}),o!=null&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global text-sm tabular-nums text-muted-foreground [&_span]:text-inherit [&_time]:text-inherit",children:o}),s,r!=null&&jsxRuntime.jsx("div",{className:"mt-global break-words text-sm text-destructive-text",children:r}),n!=null&&jsxRuntime.jsx("div",{className:"mt-auto flex flex-wrap gap-global pt-global",children:n})]}),i!=null&&jsxRuntime.jsx("div",{"data-task-part":"outputs",className:m("min-w-0 w-full",e==="grid"&&"-order-1"),children:i})]})}a(Xk,"WorkbenchTaskCard");function Zk({title:e,filters:t,sortOrder:o,viewMode:r,onSortOrderChange:n,onViewModeChange:i,labels:s,disabled:l,className:d}){return jsxRuntime.jsx(du,{"data-monkeys-component":"workbench-task-toolbar",classNames:{root:"min-h-0 flex-row flex-wrap items-center gap-global border-0 p-0 font-[family-name:var(--font-sans)] text-sm leading-5",end:"max-w-full flex-wrap gap-global"},className:d,end:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,jsxRuntime.jsxs("div",{className:"flex items-center gap-global",children:[jsxRuntime.jsx(mt,{type:"button",variant:"outline",disabled:l,title:s.sort,icon:o==="latest"?jsxRuntime.jsx(lucideReact.ArrowDownWideNarrow,{}):jsxRuntime.jsx(lucideReact.ArrowUpNarrowWide,{}),className:"h-10 min-w-28 gap-global rounded-lg bg-muted/40 px-global py-global-1/2 text-sm font-medium shadow-none hover:bg-muted/70",onClick:()=>n(o==="latest"?"oldest":"latest"),children:o==="latest"?s.latest:s.oldest}),jsxRuntime.jsx(mt,{type:"button",variant:"outline",disabled:l,icon:r==="list"?jsxRuntime.jsx(lucideReact.Grid2X2,{}):jsxRuntime.jsx(lucideReact.LayoutList,{}),className:"h-10 gap-global rounded-lg bg-muted/40 px-global py-global-1/2 text-sm font-medium shadow-none hover:bg-muted/70",onClick:()=>i(r==="list"?"grid":"list"),children:r==="list"?s.gridView:s.listView})]})]}),children:e})}a(Zk,"WorkbenchTaskToolbar");function Jk({items:e=[],children:t,hasOutputs:o,viewMode:r="list",ariaLabel:n,previewLabel:i,processingLabel:s,processing:l=false,emptyState:d,onPreview:c,className:p}){let u=r==="grid"?"aspect-square w-full":"aspect-square w-[calc((100%-3*var(--global-spacing))/4)] min-w-32 max-w-48";return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-task-outputs",role:"region","aria-label":n,tabIndex:0,className:m("flex w-full min-w-0 snap-x snap-proximity items-center gap-global overflow-x-auto py-global-1/2 font-[family-name:var(--font-sans)] text-sm leading-5 focus-visible:outline focus-visible:outline-2",p),children:[t,e.map(g=>g.kind==="media"?c?jsxRuntime.jsx("button",{type:"button",onClick:()=>c(g),"aria-label":g.previewLabel||i,className:m("flex shrink-0 snap-start items-center justify-center overflow-hidden rounded-lg border bg-muted/20 focus-visible:outline focus-visible:outline-2",u),children:g.content},g.id):jsxRuntime.jsx("div",{className:m("flex shrink-0 snap-start items-center justify-center overflow-hidden rounded-lg border bg-muted/20",u),children:g.content},g.id):jsxRuntime.jsx("pre",{className:"h-60 w-full min-w-0 shrink-0 snap-start overflow-auto whitespace-pre-wrap break-words rounded-lg border bg-muted/20 p-global font-[family-name:var(--font-sans)] text-sm leading-5",children:g.content},g.id)),!(o??(e.length>0||!!t))&&(l?jsxRuntime.jsx("div",{role:"status","aria-label":s,className:m("flex shrink-0 items-center justify-center rounded-lg border bg-gradient-to-br from-muted via-background to-muted",u),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:"size-16 animate-spin rounded-full border-[8px] border-muted-foreground/40 border-t-foreground motion-reduce:animate-none sm:size-20"})}):jsxRuntime.jsx("div",{className:"flex min-h-60 w-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-global text-center text-sm text-muted-foreground",children:d}))]})}a(Jk,"WorkbenchTaskOutputs");function e0({src:e,kind:t,alt:o,expanded:r=false,loading:n=false,failed:i=false,loadingLabel:s,errorLabel:l,onError:d,renderMedia:c}){return c?jsxRuntime.jsx(jsxRuntime.Fragment,{children:c({src:e,kind:t,alt:o,expanded:r,loadingLabel:s,errorLabel:l})}):n?jsxRuntime.jsx("span",{role:"status","aria-label":s,children:jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"size-6 animate-spin text-muted-foreground motion-reduce:animate-none"})}):i||!e||t==="3d"?jsxRuntime.jsx("span",{role:"img","aria-label":l,children:jsxRuntime.jsx(lucideReact.ImageOff,{"aria-hidden":"true",className:"size-6 text-muted-foreground"})}):t==="video"?jsxRuntime.jsxs("span",{className:r?"contents":"relative block size-full",children:[jsxRuntime.jsx("video",{src:e,"aria-label":o,controls:r,playsInline:true,preload:"metadata",onError:d,className:r?"max-h-[75vh] max-w-full":"size-full object-contain"}),!r&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-[hsl(var(--monkeys-color-media-overlay)/0.6)] shadow-md sm:size-14",children:jsxRuntime.jsx(lucideReact.Play,{className:"ml-0.5 size-5 !fill-[hsl(var(--monkeys-color-media-foreground))] !stroke-[hsl(var(--monkeys-color-media-foreground))] sm:size-6"})})})]}):jsxRuntime.jsx(Is,{src:e,alt:o,loading:"lazy",onError:d,className:r?"h-auto w-auto max-h-[75vh] max-w-full":void 0})}a(e0,"WorkbenchTaskMedia");function n0({text:e,labels:t,className:o}){let r=ho.useId(),n=ho.useRef(null),[i,s]=ho.useState(false),[l,d]=ho.useState(false),c=e||t.empty;return ho.useEffect(()=>{s(false);},[c]),ho.useEffect(()=>{let p=n.current;if(!p)return;let u=a(()=>{let f=Number.parseFloat(getComputedStyle(p).lineHeight);d(p.scrollHeight>f*3+1);},"measure");if(u(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(u);return g.observe(p),()=>g.disconnect()},[c]),jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-task-prompt",className:m("min-w-0 font-[family-name:var(--font-sans)] text-sm leading-5",o),children:[jsxRuntime.jsx("p",{ref:n,id:r,className:m("whitespace-pre-wrap break-words text-sm leading-5 text-foreground [overflow-wrap:anywhere]",!i&&"line-clamp-3"),children:c}),l&&jsxRuntime.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":r,onClick:()=>s(p=>!p),className:"mt-global-1/2 inline-flex min-h-8 items-center gap-global-1/2 rounded-lg px-global-1/2 text-sm font-medium text-foreground underline underline-offset-4 hover:bg-muted focus-visible:outline focus-visible:outline-2",children:[i?t.less:t.more,i?jsxRuntime.jsx(lucideReact.ChevronUp,{"aria-hidden":"true",className:"size-4"}):jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"size-4"})]})]})}a(n0,"WorkbenchTaskPrompt");function aW({item:e,playLabel:t,selectionMode:o}){let[r,n]=ho.useState(false);if(ho.useEffect(()=>n(false),[e.thumbnailSrc,e.src]),e.notice||e.status==="blocked")return jsxRuntime.jsx("div",{className:"flex size-full items-center justify-center bg-muted p-2 text-center text-xs text-muted-foreground",children:e.notice});let i=r?e.src:e.thumbnailSrc||e.src;if(!i)return jsxRuntime.jsx("div",{className:"size-full bg-muted","aria-hidden":"true"});if(e.mediaType==="video"){let s=jsxRuntime.jsx("span",{className:"rounded-full bg-foreground/60 p-2 text-background",children:jsxRuntime.jsx(lucideReact.Play,{className:"size-4 fill-current"})});return jsxRuntime.jsxs("div",{className:"relative size-full",children:[jsxRuntime.jsx("video",{src:i,muted:true,playsInline:true,preload:"metadata",className:"size-full object-cover","aria-label":e.alt}),jsxRuntime.jsx(mt,{ariaLabel:t,tabIndex:o?-1:0,variant:"ghost",className:"absolute inset-0 size-full rounded-none border-0 p-0",icon:s})]})}return jsxRuntime.jsx("img",{src:i,alt:e.alt??"",loading:"lazy",onError:()=>{!r&&e.src&&i!==e.src&&n(true);},className:"size-full object-cover opacity-100"})}a(aW,"HistoryMedia");function iW({items:e,loading:t=false,loadingMore:o=false,error:r,hasMore:n=false,pageKey:i,expanded:s,selectedIds:l,selectionMode:d,className:c,itemClassName:p,labels:u,busy:g=false,popupScale:f=1,panelClassName:b,buttonClassName:x,buttonVariant:y="outline",onRetry:k,onLoadMore:w,onExpandedChange:v,onSelectionModeChange:h,onSelectedIdsChange:S,onItemActivate:T,onDelete:C,onItemDragStart:R}){let M=ho.useRef(null),[I,B]=ho.useState(),[N,D]=ho.useState(false),[E,P]=ho.useState(false),[W,H]=ho.useState([]),A=s??N,L=d??E,F=l??W,G=ho.useMemo(()=>new Set(F),[F]),$=ho.useRef(F);$.current=F;let _=Number.isFinite(f)&&f>0?f:1;ho.useLayoutEffect(()=>{if(!A||!M.current)return;let O=0,K=a(()=>{let he=M.current?.getBoundingClientRect();he&&B({left:he.left,width:he.width,bottom:Math.max(0,window.innerHeight-he.bottom)});},"measure"),ne=a(()=>{cancelAnimationFrame(O),O=requestAnimationFrame(K);},"schedule");K();let fe=typeof ResizeObserver=="function"?new ResizeObserver(ne):void 0;return fe?.observe(M.current),window.addEventListener("resize",ne),window.addEventListener("scroll",ne,true),()=>{fe?.disconnect(),cancelAnimationFrame(O),window.removeEventListener("resize",ne),window.removeEventListener("scroll",ne,true);}},[A]),ho.useEffect(()=>{let O=new Set(e.map(ne=>ne.id)),K=F.filter(ne=>O.has(ne));K.length!==F.length&&(H(K),S?.(K));},[e,F,S]);let z=a(O=>{s===void 0&&D(O),v?.(O);},"setExpanded"),re=a(O=>{d===void 0&&P(O),h?.(O),O||Z([]);},"setSelection"),Z=a(O=>{$.current=O,l===void 0&&H(O),S?.(O);},"updateSelection"),ae=a(O=>{if(g||O.selectable===false)return;let K=$.current;Z(K.includes(O.id)?K.filter(ne=>ne!==O.id):[...K,O.id]);},"toggle"),ee=a(O=>{let K=G.has(O.id),ne=O.selectable!==false&&!g;return jsxRuntime.jsxs("div",{"data-history-selection-key":O.id,"data-history-item-id":O.id,role:L?"checkbox":"button","aria-checked":L?K:void 0,"aria-label":L?O.label??u.selectItem:O.alt,"aria-disabled":(L?!ne:O.disabled)||void 0,tabIndex:(L?ne:!O.disabled)?0:void 0,draggable:!!(O.draggable&&!L&&!O.disabled),onDragStart:fe=>{if(!O.draggable||L||O.disabled){fe.preventDefault();return}R?.(fe,O);},onClick:fe=>{L?(fe.stopPropagation(),ae(O)):O.disabled||T?.(O);},onKeyDown:fe=>{(fe.key===" "||fe.key==="Enter")&&(fe.preventDefault(),L?ae(O):O.disabled||T?.(O));},...O.dataAttributes,className:m("relative aspect-square min-w-0 overflow-hidden rounded-md border border-border/60 bg-muted outline-hidden transition-[box-shadow,border-color,opacity] focus-visible:ring-2 focus-visible:ring-ring",K&&"border-primary ring-2 ring-primary/70",O.disabled&&"opacity-60",L&&ne&&"cursor-pointer",p),children:[jsxRuntime.jsx(aW,{item:O,playLabel:u.playVideo,selectionMode:L}),L&&ne?jsxRuntime.jsx("span",{className:"pointer-events-none absolute right-1 top-1 z-10 rounded-full bg-background/85 p-0.5",children:jsxRuntime.jsx(vi,{checked:K,controlSize:"sm","aria-hidden":"true",tabIndex:-1,readOnly:true})}):null]},O.id)},"renderItem"),q=a(O=>jsxRuntime.jsx(kn,{items:e,config:{getItemKey:a(K=>K.id,"getItemKey"),layout:{mode:O,cardWidth:O==="rail"?72:void 0,idealCardWidth:72,gap:8,getItemAspectRatio:a(()=>1,"getItemAspectRatio"),scrollOwner:"parent"},state:{loading:t,loadingMore:o&&n,hasMore:n},loading:{rootMargin:"1px",pageKey:i,variant:"spinner",autoFill:true},windowed:true,appearance:{hover:"none"},labels:{collection:u.ariaLabel,loading:u.loading,loadingMore:u.loadingMore,empty:u.empty}},classNames:{loadMore:"h-px min-h-0 overflow-hidden"},slots:{loadMore:jsxRuntime.jsx("span",{"aria-hidden":"true",className:"block h-px"})},callbacks:{onLoadMore:O==="grid"||!A?w:void 0},renderItem:ee}),"collection"),U=a((O,K,ne,fe=false)=>jsxRuntime.jsx(mt,{icon:jsxRuntime.jsx(O,{}),iconOnly:true,ariaLabel:K,size:"md",variant:y,className:x,disabled:fe,onClick:ne}),"button"),X=jsxRuntime.jsxs("div",{role:"alert",className:"flex min-h-20 flex-col items-center justify-center gap-1 p-2 text-center text-sm",children:[jsxRuntime.jsx("span",{children:u.loadError}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:u.loadErrorDescription}),k?jsxRuntime.jsx(mt,{size:"sm",variant:"outline",label:u.retry,onClick:k}):null]});return jsxRuntime.jsxs("div",{ref:M,"data-workbench-history-result":true,className:m("relative w-full min-w-0 max-w-full rounded-lg",b,c),children:[e.length?jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2 p-3",children:[U(A?lucideReact.Minimize2:lucideReact.Maximize2,A?u.collapse:u.expand,()=>z(!A)),jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:q("rail")})]}):t?jsxRuntime.jsx($r,{title:u.loading,variant:"spinner",className:"min-h-20 p-2"}):r?X:jsxRuntime.jsx(Di,{title:u.empty,className:"min-h-20 p-2"}),A&&typeof document<"u"?reactDom.createPortal(jsxRuntime.jsxs("div",{"data-history-expanded":true,className:m("fixed z-50 rounded-lg border border-border bg-card text-card-foreground shadow-xl",b),style:{left:I?.left??0,width:(I?.width??0)/_,bottom:I?.bottom??0,transform:`scale(${_})`,transformOrigin:"left bottom"},children:[jsxRuntime.jsxs("div",{className:"max-h-[50vh] overflow-y-auto p-3",style:{marginBottom:72,maxHeight:"50vh",overflowY:"auto"},children:[q("grid"),r&&e.length?jsxRuntime.jsxs("div",{role:"alert",className:"flex items-center gap-2 text-xs",children:[u.refreshError,k?jsxRuntime.jsx(mt,{size:"sm",label:u.retry,onClick:k}):null]}):null]}),jsxRuntime.jsxs("div",{className:"absolute inset-x-3 bottom-3 flex items-center justify-between gap-2",children:[U(lucideReact.Minimize2,u.collapse,()=>z(false)),jsxRuntime.jsx("div",{className:"flex items-center gap-1.5",children:L?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"rounded-full border border-border px-2 py-1 text-xs",children:u.selectedCount}),U(lucideReact.X,u.exitSelection,()=>re(false),g),C?U(lucideReact.Trash2,u.deleteSelected,()=>{g||C(F);},!F.length||g):null]}):C?U(lucideReact.Trash2,u.enterSelection,()=>re(true),g):null})]})]}),document.body):null]})}a(iW,"WorkbenchHistoryResult");function cW({open:e,title:t,description:o,name:r,nameLabel:n,namePlaceholder:i,createLabel:s,cancelLabel:l,closeLabel:d,creating:c=false,error:p,showError:u=true,className:g,onOpenChange:f,onNameChange:b,onCreate:x}){let y=ho.useId(),k=ho.useRef(null),[w,v]=ho.useState(false),[h,S]=ho.useState(null),T=ho.useRef(false),C=ho.useRef(false);ho.useEffect(()=>{e||(T.current=false,S(null),v(false));},[e]);let R=c,M=a(N=>{!R&&!C.current&&f?.(N);},"close"),I=a(async()=>{if(!(!r.trim()||R||C.current||T.current||!x)){C.current=true,v(true);try{await x();}finally{C.current=false;}}},"create"),B={radius:"lg"};return jsxRuntime.jsx(Ri,{open:e,onOpenChange:M,title:t,description:o,closeLabel:d,closeOnEscape:!R,closeOnOverlayClick:!R,showCloseButton:!R,portal:true,initialFocus:"explicit",initialFocusRef:k,className:g,classNames:{panel:"w-full max-w-[420px] gap-4 p-6",header:"border-0 p-0",title:"text-lg font-semibold leading-tight",description:"text-sm text-muted-foreground",body:"overflow-visible p-0",footer:"border-0 p-0"},footer:jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(mt,{size:"lg",appearance:B,className:"text-sm",disabled:R,onClick:()=>M(false),children:l}),jsxRuntime.jsx(mt,{size:"lg",tone:"primary",appearance:{...B,slots:{buttonPrimary:"border-primary bg-primary text-primary-foreground hover:bg-primary/90"}},className:"text-sm",loading:c,disabled:R||!r.trim(),onClick:I,children:s})]}),children:jsxRuntime.jsxs("div",{className:"space-y-4","data-monkeys-component":"create-collection-dialog",children:[jsxRuntime.jsxs("div",{className:"space-y-2 py-2",children:[jsxRuntime.jsx("label",{htmlFor:y,className:"text-sm font-medium leading-5",children:n}),jsxRuntime.jsx(un,{ref:k,id:y,maxLength:80,"aria-label":n,placeholder:i,value:h??r,disabled:R,onCompositionStart:N=>{T.current=true,S(N.currentTarget.value);},onCompositionEnd:N=>{T.current=false,S(null),b?.(N.currentTarget.value);},onChange:N=>{T.current?S(N.currentTarget.value):b?.(N.currentTarget.value);},onKeyDown:N=>{N.key==="Enter"&&!N.nativeEvent.isComposing&&!T.current&&(N.preventDefault(),I());}})]}),w&&!c&&u&&p&&jsxRuntime.jsx("div",{role:"alert",className:"text-sm text-destructive-text",children:p})]})})}a(cW,"WorkbenchCreateCollectionDialog");var pW={width:"var(--monkeys-component-app-shell-sidebar-width, 16rem)",borderRadius:"var(--monkeys-component-app-shell-sidebar-radius, var(--radius, 0.75rem))",background:"var(--monkeys-component-app-shell-sidebar-background, hsl(var(--card)))",color:"var(--monkeys-component-app-shell-sidebar-foreground, hsl(var(--card-foreground)))",borderColor:"var(--monkeys-component-app-shell-sidebar-border-color, hsl(var(--border)))",boxShadow:"var(--monkeys-component-app-shell-sidebar-shadow, none)"},mW={padding:"var(--monkeys-component-app-shell-sidebar-header-padding, var(--global-spacing, 0.75rem))",borderColor:"var(--monkeys-component-app-shell-sidebar-header-border-color, hsl(var(--border)))"},fW={padding:"var(--monkeys-component-app-shell-sidebar-navigation-padding, var(--global-spacing, 0.75rem))","--monkeys-component-accordion-item-border-color":"transparent"},bW={padding:"var(--monkeys-component-app-shell-sidebar-footer-padding, var(--global-spacing, 0.75rem))",background:"var(--monkeys-component-app-shell-sidebar-footer-background, hsl(var(--muted) / 0.22))",borderColor:"var(--monkeys-component-app-shell-sidebar-footer-border-color, hsl(var(--border)))"},ob=ho.forwardRef(a(function({navigation:t,header:o,footer:r,width:n,className:i,classNames:s,style:l,"aria-label":d="Application navigation",...c},p){return jsxRuntime.jsxs("aside",{ref:p,"aria-label":d,"data-app-shell-sidebar":"",className:m("relative isolate flex h-full min-h-0 shrink-0 flex-col overflow-hidden border",s?.root,i),style:{...pW,...n===void 0?null:{width:n},...l},...c,children:[o?jsxRuntime.jsx("div",{"data-slot":"header",className:m("shrink-0 border-b",s?.header),style:mW,children:o}):null,jsxRuntime.jsx("div",{"data-slot":"navigation",className:m("relative min-h-0 flex-1 overflow-hidden",s?.navigation),style:fW,children:t}),r?jsxRuntime.jsx("div",{"data-slot":"footer",className:m("shrink-0 border-t",s?.footer),style:bW,children:r}):null]})},"AppShellSidebar"));ob.displayName="AppShellSidebar";var hW={preset:"soft",density:"compact",radius:"lg",border:"subtle",background:"soft"},c0={default:"rounded-md",none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"};function yW(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6 9 17l-5-5"})})}a(yW,"CheckIcon");function xW(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}a(xW,"MoreIcon");function rb(e,t){return e?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center",t),children:e}):null}a(rb,"renderIcon");function vW(e){return e.options.find(t=>t.value===e.value)?.label??e.value}a(vW,"getCurrentOptionLabel");function wW({classNames:e,menuRadius:t,selector:o}){if(o.visible===false||o.options.length===0)return null;let r=c0[t],n=vW(o);return jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{disabled:o.disabled,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r,e?.subTrigger),children:[rb(o.icon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:o.label}),jsxRuntime.jsx("span",{className:"ml-auto min-w-0 max-w-[7rem] truncate text-xs text-[hsl(var(--muted-foreground))]",children:n})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{sideOffset:8,className:m("z-50 min-w-40 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",r,o.contentWidthClassName,e?.subContent),children:jsxRuntime.jsx(Bt__namespace.RadioGroup,{value:o.value,onValueChange:o.onChange,children:o.options.map(i=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{value:i.value,disabled:i.disabled,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 pl-8 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r,e?.item),children:[jsxRuntime.jsx(Bt__namespace.ItemIndicator,{className:"absolute left-2 inline-flex h-4 w-4 items-center justify-center",children:jsxRuntime.jsx(yW,{})}),rb(i.icon,e?.itemIcon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:i.label})]},i.value))})})})]})}a(wW,"UserAccountMenuSelector");function u0({align:e="end",appearance:t=hW,ariaLabel:o,className:r,classNames:n,contentWidthClassName:i="w-56",fallbackName:s="User",items:l=[],menuRadius:d="default",selectors:c=[],side:p="bottom",sideOffset:u=8,triggerEndIcon:g,triggerTitle:f,triggerVariant:b="avatar",user:x}){let y=x.name?.trim()||s,k=c0[d],w=c.filter(C=>C.visible!==false&&C.options.length>0),v=l.filter(C=>C.visible!==false),h=w.length>0||v.length>0,S=jsxRuntime.jsx(fc,{appearance:t,alt:x.avatarAlt??y,className:m("h-8 w-8",n?.avatar),initials:x.initials,name:y,size:"sm",src:x.avatarUrl}),T=b==="profile";return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(mt,{appearance:t,ariaLabel:o??y,className:m(T?"h-auto w-full justify-start rounded-lg border-transparent bg-transparent px-2 py-2 text-left shadow-none transition-all hover:bg-[hsl(var(--muted))]/60":"h-9 w-9 overflow-visible rounded-md border-transparent bg-transparent p-0 shadow-none transition-all hover:ring-2 hover:ring-[hsl(var(--ring))]/20",r,n?.root,n?.trigger),classNames:{icon:"h-8 w-8",label:T?"min-w-0 flex-1 text-left":void 0},endIcon:T?g??jsxRuntime.jsx(xW,{}):void 0,icon:S,iconOnly:!T,label:T?jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-col items-start",children:[jsxRuntime.jsx("span",{className:"max-w-full truncate text-sm font-medium leading-none text-[hsl(var(--foreground))]",children:y}),x.secondaryText?jsxRuntime.jsx("span",{className:"mt-1 max-w-full truncate text-xs leading-none text-[hsl(var(--muted-foreground))]",children:x.secondaryText}):null]}):void 0,title:f??y,tone:"muted"})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:e,side:p,sideOffset:u,className:m("z-50 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",i,k,n?.content),children:[jsxRuntime.jsx(Bt__namespace.Label,{className:m("px-2 py-1.5 font-normal",n?.label),children:jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[S,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col",children:[jsxRuntime.jsx("span",{className:m("truncate text-sm font-medium leading-none",n?.userName),children:y}),x.secondaryText?jsxRuntime.jsx("span",{className:m("truncate pt-1 text-xs leading-none text-[hsl(var(--muted-foreground))]",n?.secondaryText),children:x.secondaryText}):null]})]})}),h?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,w.map((C,R)=>jsxRuntime.jsx(wW,{classNames:n,menuRadius:d,selector:C},C.id??`selector-${R}`)),w.length>0&&v.length>0?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,v.map(C=>jsxRuntime.jsxs("div",{children:[C.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,jsxRuntime.jsxs(Bt__namespace.Item,{disabled:C.disabled,onSelect:C.disabled?void 0:C.onSelect,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",k,C.tone==="danger"&&"text-[hsl(var(--destructive))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",n?.item,C.tone==="danger"&&n?.dangerItem),children:[rb(C.icon,n?.itemIcon),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.label}),C.shortcut?jsxRuntime.jsx("span",{className:"ml-3 shrink-0 text-xs text-[hsl(var(--muted-foreground))]",children:C.shortcut}):null]})]},C.id))]})})]})}a(u0,"UserAccountMenu");function De(...e){return e.filter(Boolean).join(" ")}a(De,"cn");function kl({active:e,disabled:t,icon:o,postfix:r,onClick:n,className:i,children:s}){return jsxRuntime.jsxs("button",{type:"button","aria-disabled":t,"aria-pressed":e,disabled:t,className:De("flex w-full cursor-pointer select-none items-center gap-2 rounded-xl border p-2 text-left text-xs text-[hsl(var(--foreground))] transition-colors",e?"border-[hsl(var(--input))] bg-[hsl(var(--muted))] font-bold":t?"border-transparent":"border-transparent hover:border-[hsl(var(--input))]/60 hover:bg-[hsl(var(--muted))]/60",t&&"!cursor-not-allowed opacity-60",i),onClick:n,children:[jsxRuntime.jsx("div",{className:"w-[20px] [&_svg]:h-[16px] [&_svg]:w-[16px]",children:o}),jsxRuntime.jsx("span",{className:"text-sm",children:s}),r]})}a(kl,"NavButton");function CW({logo:e,tabs:t,activeTab:o,onTabChange:r,user:n,onLogout:i,logoutLabel:s="\u9000\u51FA\u767B\u5F55",userMenuItems:l,extra:d,className:c}){let p=a(u=>u.split(" ").map(g=>g[0]).join("").toUpperCase().slice(0,2),"getUserInitials");return jsxRuntime.jsxs("header",{className:De("flex h-[72px] w-full shrink-0 items-center justify-between gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",c),children:[jsxRuntime.jsxs("div",{className:"flex shrink-0 cursor-pointer items-center gap-2",onClick:e.onClick,children:[jsxRuntime.jsx("div",{className:De("flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",e.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:e.url?jsxRuntime.jsx("img",{src:e.url,alt:e.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:e.title.charAt(0)})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold whitespace-nowrap",children:e.title})]}),t&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-1/2 w-px bg-[hsl(var(--border))]"}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center",children:jsxRuntime.jsx("div",{className:"inline-flex h-9 items-center gap-1 rounded-md bg-transparent p-1",children:t.map(u=>jsxRuntime.jsx("button",{className:De("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all",u.id===o?"bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--muted))]/50"),onClick:()=>r?.(u.id),children:u.label},u.id))})})]}),(!t||t.length===0)&&jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-4",children:[d,n&&jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-md hover:ring-2 hover:ring-[hsl(var(--ring))]/20 transition-all overflow-hidden focus-visible:outline-hidden",children:n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-8 w-8 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium",children:n.name?p(n.name):"U"})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{className:"z-50 w-52 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:5,align:"end",children:[jsxRuntime.jsxs(Bt__namespace.Label,{className:"flex items-center gap-2 px-2 py-1.5 font-normal",children:[n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-8 w-8 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium",children:n.name?p(n.name):"U"}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium leading-none",children:n.name}),n.email&&jsxRuntime.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] leading-none mt-1",children:n.email})]})]}),jsxRuntime.jsx(Bt__namespace.Separator,{className:"h-px bg-[hsl(var(--border))] my-1"}),jsxRuntime.jsxs(Bt__namespace.Group,{children:[l,jsxRuntime.jsxs(Bt__namespace.Item,{className:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-[hsl(var(--destructive))] outline-hidden transition-colors hover:bg-[hsl(var(--accent))]",onSelect:()=>i?.(),children:[jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntime.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntime.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),s]})]})]})})]})]})]})}a(CW,"AppHeader");function SW({logo:e,navItems:t,activeItemId:o,onNavigate:r,account:n,onLogout:i,logoutLabel:s="\u9000\u51FA\u767B\u5F55",footer:l,defaultExpandedGroups:d,className:c}){return jsxRuntime.jsxs("div",{className:De("flex w-[13.7rem] shrink-0 flex-col justify-between gap-[var(--global-spacing,0.75rem)] overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-5",c),children:[e&&jsxRuntime.jsxs("div",{className:"flex shrink-0 cursor-pointer items-center gap-2",onClick:e.onClick,children:[jsxRuntime.jsx("div",{className:De("flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",e.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:e.url?jsxRuntime.jsx("img",{src:e.url,alt:e.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:e.title.charAt(0)})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold whitespace-nowrap",children:e.title})]}),jsxRuntime.jsx(TW,{items:t,activeItemId:o,onNavigate:r,defaultExpandedGroups:d}),(n||l)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[n&&jsxRuntime.jsx("div",{className:"flex w-full flex-col gap-2 rounded-lg bg-[hsl(var(--muted))] p-2 shadow-sm",children:jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between px-3 py-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-5 w-5 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-[10px] font-medium",children:n.name?n.name.charAt(0).toUpperCase():"U"}),jsxRuntime.jsx("span",{className:"text-xs font-medium truncate max-w-[100px]",children:n.name})]}),i&&jsxRuntime.jsx("button",{onClick:i,className:"flex items-center justify-center text-[hsl(var(--destructive))] hover:opacity-80 transition-opacity",title:s,children:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntime.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntime.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})}),l]})]})}a(SW,"AppSidebar");function TW({items:e,activeItemId:t,onNavigate:o,defaultExpandedGroups:r}){let[n,i]=ho.useState(()=>{let p={};return (r??e.map(u=>u.id)).forEach(u=>{p[u]=true;}),p}),[s,l]=ho.useState(t);ho.useEffect(()=>{t!==void 0&&l(t);},[t]);let d=a(p=>{i(u=>({...u,[p]:!u[p]}));},"toggle"),c=t??s;return jsxRuntime.jsxs("div",{className:"h-full flex-1 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[jsxRuntime.jsx("style",{children:".monkeys-sidebar-nav::-webkit-scrollbar { display: none; }"}),jsxRuntime.jsx("div",{className:"monkeys-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",children:e.map(p=>{if(p.children&&p.children.length>0){let u=n[p.id]??true;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(kl,{active:p.id===c,disabled:p.disabled,icon:p.icon,onClick:()=>d(p.id),postfix:jsxRuntime.jsx("div",{className:"flex flex-1 justify-end",children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})}),children:p.label}),u&&!p.disabled&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1 mt-1",children:p.children.map(g=>jsxRuntime.jsx(kl,{active:g.id===c,disabled:g.disabled,onClick:()=>{l(g.id),o?.(g.id);},children:g.label},g.id))})]},p.id)}return jsxRuntime.jsx(kl,{icon:p.icon,active:p.id===c,disabled:p.disabled,onClick:()=>{l(p.id),o?.(p.id);},children:p.label},p.id)})})]})}a(TW,"SidebarNavList");function g0({header:e,sidebar:t,children:o,flush:r=false,contentFrame:n=true,className:i}){return jsxRuntime.jsxs("div",{className:De("flex h-screen flex-col gap-[var(--global-spacing,0.75rem)] overflow-hidden p-[var(--global-spacing,0.75rem)]",i),style:{backgroundColor:"hsl(var(--muted))"},children:[e||null,jsxRuntime.jsxs("div",{className:"flex flex-1 gap-[var(--global-spacing,0.75rem)] overflow-hidden min-h-0",children:[t||null,jsxRuntime.jsx("main",{className:De("flex-1 min-h-0 overflow-hidden",n&&"rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))]",!r&&"overflow-y-auto"),children:r?o:jsxRuntime.jsx("div",{className:"h-full overflow-y-auto",children:o})})]})]})}a(g0,"AppLayout");var NW="13.7rem",RW="4.25rem",MW="15rem",IW="cubic-bezier(0.22, 1, 0.36, 1)",DW=72,PW=56,EW=120,h0=64,AW=12,BW=8,LW=44,WW=36,cr={preset:"soft",density:"compact",radius:"lg",border:"subtle",background:"soft"},zW={none:{all:"rounded-none",left:"!rounded-none",right:"!rounded-none"},sm:{all:"rounded-sm",left:"!rounded-l-sm !rounded-r-none",right:"!rounded-l-none !rounded-r-sm"},md:{all:"rounded-md",left:"!rounded-l-md !rounded-r-none",right:"!rounded-l-none !rounded-r-md"},lg:{all:"rounded-lg",left:"!rounded-l-lg !rounded-r-none",right:"!rounded-l-none !rounded-r-lg"},xl:{all:"rounded-xl",left:"!rounded-l-xl !rounded-r-none",right:"!rounded-l-none !rounded-r-xl"},full:{all:"rounded-full",left:"!rounded-l-full !rounded-r-none",right:"!rounded-l-none !rounded-r-full"}};function OW(e){return typeof e!="number"||!Number.isFinite(e)?DW:Math.min(EW,Math.max(PW,Math.round(e)))}a(OW,"clampHeadbarHeight");function FW(e){return e<=h0?BW:AW}a(FW,"getHeadbarVerticalPaddingPx");function HW(e){return e<=h0?WW:LW}a(HW,"getHeadbarLogoSizePx");function $u(e="default",t="all"){return e==="default"?t==="left"?"rounded-l-lg rounded-r-none":t==="right"?"rounded-l-none rounded-r-lg":"rounded-lg":zW[e][t]}a($u,"getHeadbarMenuRadiusClass");function VW(e="boxed",t="center"){let o=t==="center"?"grid-cols-[minmax(max-content,1fr)_minmax(0,max-content)_minmax(max-content,1fr)]":"grid-cols-[max-content_minmax(0,1fr)_max-content]";return De(e==="full-bleed"?"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-none border-b border-x-0 border-t-0 border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]":"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",o)}a(VW,"getHeadbarFrameClass");function _W(e="boxed",t,o="card"){let r=FW(t),i={height:`var(--monkeys-component-navigation-headbar-height, ${t}px)`,minHeight:`var(--monkeys-component-navigation-headbar-height, ${t}px)`,paddingTop:`${r}px`,paddingBottom:`${r}px`,background:"var(--monkeys-component-navigation-headbar-frame-background, hsl(var(--background)))",color:"var(--monkeys-component-navigation-headbar-frame-foreground, hsl(var(--foreground)))",borderColor:o==="glassy"?"var(--monkeys-component-navigation-headbar-frame-border-color, rgb(255 255 255 / 0.5))":"var(--monkeys-component-navigation-headbar-frame-border-color, hsl(var(--input)))",borderRadius:e==="full-bleed"?"0":"var(--monkeys-component-navigation-headbar-frame-radius, var(--radius, 0.75rem))",boxShadow:o==="glassy"?"var(--monkeys-component-navigation-headbar-frame-shadow, inset 0 0 0 0 rgb(0 0 0 / 0.1))":"var(--monkeys-component-navigation-headbar-frame-shadow, none)",backdropFilter:`blur(var(--monkeys-component-navigation-headbar-frame-backdrop-blur, ${o==="glassy"?"45px":"0px"}))`};return e==="full-bleed"&&(i.marginLeft="calc(var(--global-spacing,0.75rem) * -1)",i.marginRight="calc(var(--global-spacing,0.75rem) * -1)",i.marginTop="calc(var(--global-spacing,0.75rem) * -1)",i.width="calc(100% + (var(--global-spacing,0.75rem) * 2))"),i}a(_W,"getHeadbarFrameStyle");function GW(e="center"){return e==="left"?"justify-start":e==="right"?"justify-end":"justify-center"}a(GW,"getHeadbarNavClass");function ju(e,t=true){return {height:"var(--monkeys-component-navigation-headbar-item-height, 2.25rem)",borderRadius:t?"var(--monkeys-component-navigation-headbar-item-radius, var(--radius, 0.5rem))":void 0,paddingInline:"var(--monkeys-component-navigation-headbar-item-padding-inline, 0.75rem)",columnGap:"var(--monkeys-component-navigation-headbar-item-gap, 0.375rem)",color:e?"var(--monkeys-component-navigation-headbar-item-active-foreground, hsl(var(--foreground)))":"var(--monkeys-component-navigation-headbar-item-foreground, hsl(var(--muted-foreground)))",background:e?"var(--monkeys-component-navigation-headbar-item-active-background, hsl(var(--muted)))":"transparent",borderColor:e?"var(--monkeys-component-navigation-headbar-item-active-border-color, transparent)":"transparent",fontSize:"var(--monkeys-component-navigation-headbar-item-font-size, 0.875rem)",fontWeight:"var(--monkeys-component-navigation-headbar-item-font-weight, 500)"}}a(ju,"getHeadbarItemStyle");function $W(e,t=true){return {...ju(e,t),paddingInline:void 0,columnGap:void 0}}a($W,"getHeadbarCompoundStyle");function y0(e,t){for(let o of e)if(o.id===t||Sl(o,t))return o.id;return t}a(y0,"findNavigationRootId");function Sl(e,t){return t?e.id===t?true:e.children?.some(o=>Sl(o,t))??false:false}a(Sl,"containsNavigationItem");function jW(e,t){return e.children?.find(o=>Sl(o,t))}a(jW,"findActiveNavigationBranch");function p0(e){return e.title||(typeof e.label=="string"?e.label:void 0)}a(p0,"getNavigationActionTitle");function m0({actions:e,compact:t}){return e.length?t?jsxRuntime.jsx("div",{className:"flex flex-col items-center gap-2",children:e.map(o=>{let r=p0(o);return jsxRuntime.jsx(To,{appearance:cr,content:o.label,placement:"right",portal:true,children:jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",iconOnly:true,icon:o.icon,onClick:o.onClick,title:r,ariaLabel:r,className:De("h-10 w-10 rounded-lg border-transparent text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]","active:translate-y-0 active:scale-[0.96]")})},o.id)})}):jsxRuntime.jsx("div",{className:"flex flex-col gap-2",children:e.map(o=>jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",icon:o.icon,label:jsxRuntime.jsx("span",{className:"truncate",children:o.label}),onClick:o.onClick,title:p0(o),className:De("h-9 w-full justify-start gap-2.5 rounded-lg border-transparent px-3 text-left text-[13px] text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]","active:translate-y-0 active:scale-[0.985]")},o.id))}):null}a(m0,"NavigationLayoutActionButtons");function x0({activeItemId:e,items:t,onNavigate:o,revealRequest:r}){let n=ho.useRef(null),[i,s]=ho.useState({}),l=r?t.some(p=>Sl(p,r.id)&&!p.disabled):false,d=a(p=>{s(u=>({...u,[p]:!u[p]}));},"toggleRoot");ho.useEffect(()=>{if(!r||!l)return;s(u=>({...u,[r.id]:true}));let p=window.requestAnimationFrame(()=>{let u=n.current?.querySelector(`[data-navigation-sidebar-item-id="${CSS.escape(r.id)}"]`);u instanceof HTMLElement&&u.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});});return ()=>window.cancelAnimationFrame(p)},[l,r]);let c=a((p,u=0)=>p.map(g=>{let f=!!g.children?.length,b=Sl(g,e),x=!g.disabled&&(i[g.id]??b);return jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-id":g.id,children:[jsxRuntime.jsx(kl,{active:b,className:u>0?"pl-3":void 0,disabled:g.disabled,icon:g.icon,onClick:()=>f?d(g.id):o?.(g.id),postfix:f?jsxRuntime.jsx("div",{className:"flex flex-1 justify-end",children:jsxRuntime.jsx(ab,{open:false,sideways:true,className:"text-[hsl(var(--foreground))] transition-transform duration-200",style:{transform:x?"rotate(90deg)":"rotate(0deg)"}})}):void 0,children:g.label}),f&&x?jsxRuntime.jsx("div",{className:"mt-1 ml-3 flex flex-col gap-1 border-l border-[hsl(var(--input))] pl-2",children:c(g.children??[],u+1)}):null]},g.id)}),"renderItems");return jsxRuntime.jsxs("div",{className:"h-full flex-1 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[jsxRuntime.jsx("style",{children:".monkeys-navigation-sidebar-nav::-webkit-scrollbar { display: none; }"}),jsxRuntime.jsx("div",{ref:n,className:"monkeys-navigation-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",children:c(t)})]})}a(x0,"SidebarNavigationList");function f0({collapsed:e,logo:t,title:o}){if(!t)return null;let r=o??t.title,n=jsxRuntime.jsx("div",{className:De("flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",t.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:t.url?jsxRuntime.jsx("img",{src:t.url,alt:t.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:t.title.charAt(0)})});return e?jsxRuntime.jsx(To,{appearance:cr,content:r,placement:"right",portal:true,children:jsxRuntime.jsx(mt,{appearance:cr,ariaLabel:typeof r=="string"?r:t.title,className:"h-10 w-10 rounded-lg border-transparent bg-transparent p-0 shadow-none hover:bg-[hsl(var(--muted))]/60",icon:n,iconOnly:true,onClick:t.onClick,title:typeof r=="string"?r:t.title,tone:"muted"})}):jsxRuntime.jsx(mt,{appearance:cr,ariaLabel:t.title,className:"h-auto w-full justify-start gap-3 border-transparent bg-transparent p-0 text-left shadow-none hover:bg-transparent",classNames:{icon:"h-9 w-9"},icon:n,label:jsxRuntime.jsx("span",{className:"min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]",children:r}),onClick:t.onClick,title:typeof r=="string"?r:t.title,tone:"muted"})}a(f0,"SidebarBrand");function UW({accountMenu:e,activeItemId:t,actions:o=[],collapsed:r,collapsedAccountMenu:n,footer:i,header:s,items:l,logo:d,onCollapsedChange:c,onNavigate:p,onRevealRoot:u,revealRequest:g,title:f}){if(r){let b=y0(l,t);return jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col rounded-xl border border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] p-2 shadow-sm",children:[jsxRuntime.jsx("div",{className:"mb-3 flex shrink-0 justify-center",children:s??jsxRuntime.jsx(f0,{collapsed:true,logo:d,title:f})}),jsxRuntime.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center gap-2 overflow-y-auto pb-3",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:l.map(x=>{let y=b===x.id;return jsxRuntime.jsx(To,{appearance:cr,content:x.label,placement:"right",portal:true,children:jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",active:y,disabled:x.disabled,iconOnly:true,icon:x.icon,onClick:()=>{x.disabled||(u?.(x.id),c?.(false),!x.children?.length&&p?.(x.id));},title:typeof x.label=="string"?x.label:void 0,ariaLabel:typeof x.label=="string"?x.label:x.id,className:De("h-10 w-10 rounded-lg border text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.96]",y?"border-[hsl(var(--input))] bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm":"border-transparent hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]")})},x.id)})}),jsxRuntime.jsxs("div",{className:"-mx-2 mt-2 border-t border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-2 pt-2.5 pb-0.5",children:[jsxRuntime.jsx(m0,{actions:o,compact:true}),n?jsxRuntime.jsx("div",{className:"mt-2 flex justify-center border-t border-[hsl(var(--input))] pt-2",children:n}):null]})]})}return jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col justify-between gap-0 overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-5 pt-5 pb-1.5",children:[jsxRuntime.jsx("div",{className:"mb-4 shrink-0",children:s??jsxRuntime.jsx(f0,{logo:d,title:f})}),jsxRuntime.jsx(x0,{activeItemId:t,items:l,onNavigate:p,revealRequest:g}),jsxRuntime.jsxs("div",{className:"-mx-5 mt-2 border-t border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-4 pt-2.5 pb-1",children:[jsxRuntime.jsx(m0,{actions:o,compact:false}),i,e?jsxRuntime.jsx("div",{className:"mt-2 border-t border-[hsl(var(--input))] pt-2",children:e}):null]})]})}a(UW,"Sidebar");function ab({className:e,open:t,sideways:o=false,style:r}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",className:De("h-4 w-4 shrink-0",!o&&"transition-transform duration-200",!o&&t&&"rotate-180",e),style:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:o?"m9 18 6-6-6-6":"m6 9 6 6 6-6"})})}a(ab,"HeadbarChevronIcon");function KW(e,t){if(typeof e!="string"||typeof t!="string")return;let o=e.trim(),r=t.trim();return o&&r?`${o} / ${r}`:void 0}a(KW,"getHeadbarSummaryTitle");var b0="relative flex w-full min-w-0 cursor-pointer select-none items-center gap-2.5 px-3 py-2 text-sm outline-hidden transition-colors hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] focus:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] focus:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] data-[highlighted]:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] data-[highlighted]:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))]",v0={width:"max-content",maxWidth:"min(20rem, var(--radix-dropdown-menu-content-available-width))",background:"var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--monkeys-color-menu-surface)))",borderColor:"var(--monkeys-component-navigation-headbar-menu-border-color, var(--monkeys-component-overlay-border-color, hsl(var(--monkeys-color-border))))",color:"var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--monkeys-color-popover-foreground)))",boxShadow:"var(--monkeys-component-navigation-headbar-menu-shadow, var(--monkeys-component-overlay-menu-shadow, 0 10px 15px -3px rgb(0 0 0 / 0.1)))",backdropFilter:"blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, var(--monkeys-component-overlay-backdrop-blur, 0px)))",WebkitBackdropFilter:"blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, var(--monkeys-component-overlay-backdrop-blur, 0px)))"};function w0({activeItemId:e,items:t,menuContentRadiusClass:o,menuItemRadiusClass:r,onNavigate:n,onNavigateComplete:i,useTokenRadius:s}){let l=ke();return t.map(d=>{let c=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d.icon?jsxRuntime.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[hsl(var(--muted-foreground))]",children:d.icon}):null,jsxRuntime.jsx("span",{className:De("min-w-0 truncate",!!d.children?.length&&"flex-1"),children:d.headbarLabel??d.label})]});return d.children?.length?jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{disabled:d.disabled,className:De(b0,r),children:[c,jsxRuntime.jsx(ab,{open:false,sideways:true})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{...l,sideOffset:4,alignOffset:-6,"data-monkeys-component":"navigation-headbar-menu","data-slot":"content","data-surface":"menu",className:De("z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",ln("menu"),o),style:{...v0,minWidth:"12rem"},children:jsxRuntime.jsx(w0,{activeItemId:e,items:d.children,menuContentRadiusClass:o,menuItemRadiusClass:r,onNavigate:n,onNavigateComplete:i,useTokenRadius:s})})})]},d.id):jsxRuntime.jsxs(Bt__namespace.Item,{disabled:d.disabled,className:De(b0,r),style:ju(d.id===e,s),onSelect:()=>{d.disabled||(i(),n?.(d.id));},children:[c,d.trailing]},d.id)})}a(w0,"HeadbarDropdownItems");function qW({activeItemId:e,compound:t,isActive:o,item:r,label:n,menuButtonRadiusClass:i,menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:d,title:c,useTokenRadius:p}){let[u,g]=ho.useState(false),f=ke(),b=!r.disabled&&u,x=ho.useRef(null),y=ho.useRef(false),k=a(()=>{x.current&&(clearTimeout(x.current),x.current=null);},"clearCloseTimer"),w=a(()=>{r.disabled||(k(),g(true));},"openMenu"),v=a(()=>{k(),x.current=setTimeout(()=>{g(false),x.current=null;},120);},"scheduleCloseMenu"),h=a(()=>{let S=r.children?.find(T=>!T.disabled);return S?(g(false),d?.(S.id),true):false},"navigateToFirstEnabledChild");return ho.useEffect(()=>k,[]),jsxRuntime.jsxs(Bt__namespace.Root,{modal:false,open:b,onOpenChange:S=>g(!r.disabled&&S),children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",active:o||b,icon:r.icon,endIcon:jsxRuntime.jsx(ab,{open:b}),label:n,title:c,disabled:r.disabled,onClick:()=>{let S=y.current;y.current=false,!(S&&h())&&g(true);},onPointerDown:()=>{y.current=b;},onPointerCancel:()=>{y.current=false;},onKeyDown:S=>{!b||S.key!=="Enter"&&S.key!==" "||h()&&S.preventDefault();},onMouseEnter:w,onMouseLeave:v,style:ju(o||b,t?false:p),classNames:{icon:"text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",label:"flex shrink-0 items-center !overflow-visible !text-clip text-[inherit] [&_*]:!text-[inherit]"},className:De("shrink-0 border shadow-none",t&&"!rounded-none !border-0 !bg-transparent",i,o||b?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]")})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{...f,align:"start",sideOffset:5,"data-monkeys-component":"navigation-headbar-menu","data-slot":"content","data-surface":"menu",onCloseAutoFocus:S=>S.preventDefault(),onMouseEnter:w,onMouseLeave:v,className:De("z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",ln("menu"),s),style:{...v0,minWidth:"var(--radix-dropdown-menu-trigger-width)"},children:jsxRuntime.jsx(w0,{activeItemId:e,items:r.children??[],menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:d,onNavigateComplete:()=>g(false),useTokenRadius:p})})})]})}a(qW,"HeadbarNavMenuItem");function Gu(e){e.preventDefault(),e.stopPropagation();}a(Gu,"blockEvent");function YW({activeItemId:e,activeRootId:t,items:o,menuRadius:r="default",onNavigate:n}){let i=$u(r),s=$u(r),l=$u(r),d=r==="default";return jsxRuntime.jsx("div",{className:"flex w-max min-w-0 shrink-0 items-center gap-1",children:o.map(c=>{let p=t===c.id||e===c.id,u=!!c.headbarSecondaryAction,g=c.headbarLabel??c.label,f=jW(c,e),b=f?f.headbarLabel??f.label:void 0,x=f?jsxRuntime.jsxs("span",{"data-navigation-headbar-selected-child":f.id,className:"flex shrink-0 items-center gap-1.5 whitespace-nowrap",children:[jsxRuntime.jsx("span",{className:"shrink-0",children:g}),jsxRuntime.jsx("span",{className:"shrink-0",children:"/"}),jsxRuntime.jsx("span",{className:"shrink-0",children:b})]}):jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:g}),y=f?KW(g,b):void 0,k=c.children?.length?jsxRuntime.jsx(qW,{activeItemId:e,compound:u,isActive:p,item:c,label:x,menuButtonRadiusClass:i,menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:n,title:y,useTokenRadius:d}):jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",active:p,disabled:c.disabled,icon:c.icon,label:jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:x}),c.trailing]}),onClick:()=>n?.(c.id),style:ju(p,u?false:d),classNames:{icon:"text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",label:"shrink-0 !overflow-visible !text-clip text-[inherit] [&_*]:!text-[inherit]"},className:De("shrink-0 border shadow-none",u&&"!rounded-none !border-0 !bg-transparent",i,p?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]")});return u?jsxRuntime.jsxs("div",{"data-navigation-headbar-compound-item":c.id,"aria-disabled":c.disabled,className:De("inline-flex min-w-0 shrink-0 items-center gap-0 overflow-hidden border shadow-none",i,p?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]"),style:$W(p,d),children:[jsxRuntime.jsx("span",{"data-navigation-headbar-primary-action":"",className:"inline-flex min-w-0 shrink-0",children:k}),jsxRuntime.jsx("span",{"data-navigation-headbar-secondary-action":c.id,...c.disabled&&{inert:"",onClickCapture:Gu,onKeyDownCapture:Gu,onKeyUpCapture:Gu,onPointerDownCapture:Gu},className:De("inline-flex min-w-0 shrink-0 items-center",c.disabled&&"!cursor-not-allowed opacity-60"),children:c.headbarSecondaryAction})]},c.id):jsxRuntime.jsx(ho.Fragment,{children:k},c.id)})})}a(YW,"NavigationHeadbarMenu");function XW({activeItemId:e,activeRootId:t,actions:o,accountMenu:r,className:n,extra:i,layout:s,brand:l,logo:d,navigation:c,navItems:p=[],onNavigate:u}){let g=OW(s?.heightPx),f=s?.layoutMode??"boxed",b=s?.menuRadius??"default",x=s?.surface??"card",y=HW(g),k=_W(f,g,x),w=!!s?.brandTitle;return jsxRuntime.jsxs("header",{className:De(VW(f,s?.navPosition),n),"data-navigation-headbar":"","data-navigation-headbar-surface":x,style:k,children:[jsxRuntime.jsx("div",{className:"flex min-w-0 items-center justify-start",children:l??(d?jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",icon:jsxRuntime.jsx("div",{className:De("flex items-center justify-center overflow-hidden rounded-lg",d.url?"w-auto max-w-[min(22rem,30vw)] bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),style:d.url?{height:y}:{width:y,height:y},children:d.url?jsxRuntime.jsx("img",{src:d.url,alt:d.title,className:"block h-full w-auto object-contain"}):jsxRuntime.jsx("span",{className:"text-base font-bold",children:d.title.charAt(0)})}),label:w?jsxRuntime.jsx("span",{className:"truncate whitespace-nowrap text-base font-medium text-[hsl(var(--foreground))]",children:s?.brandTitle}):null,ariaLabel:d.title,title:d.title,className:"h-auto min-w-0 justify-start border-transparent bg-transparent p-0 shadow-none hover:bg-transparent",classNames:d.url?{icon:"!h-auto !w-auto shrink-0"}:void 0,onClick:d.onClick}):null)}),jsxRuntime.jsx("div",{className:De("flex min-w-0 items-center",GW(s?.navPosition)),children:jsxRuntime.jsx("div",{className:"no-scrollbar flex max-w-full min-w-0 items-center overflow-x-auto overscroll-x-contain",children:c??jsxRuntime.jsx(YW,{activeItemId:e,activeRootId:t,items:p,menuRadius:b,onNavigate:u})})}),jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center justify-end gap-3",children:[o,i,r]})]})}a(XW,"NavigationHeadbar");function QW({activeItemId:e,activeRootId:t,allowModeSwitch:o=false,accountMenu:r,children:n,className:i,collapsedSidebarAccountMenu:s,collapsedSidebarWidth:l=RW,contextualSidebar:d=false,contextualSidebarHeader:c,contextualSidebarWidth:p=MW,defaultMode:u="headbar",defaultSidebarCollapsed:g=false,expandedSidebarWidth:f=NW,expandSidebarLabel:b="Expand sidebar",flush:x=false,contentFrame:y=true,headbarActions:k,headbarLayout:w,logo:v,mode:h,navItems:S,onModeChange:T,onNavigate:C,onSidebarCollapsedChange:R,renderHeadbarExtra:M,collapseSidebarLabel:I="Collapse sidebar",sidebarCollapsed:B,sidebarAccountMenu:N,sidebarFooter:D,sidebarHeader:E,switchToHeadbarLabel:P="Switch to headbar",switchToSidebarLabel:W="Switch to sidebar"}){let[H,A]=ho.useState(u),[L,F]=ho.useState(g),[G,$]=ho.useState(null),_=h!==void 0,z=B!==void 0,re=_?h:H,Z=z?B:L,ae=re==="headbar",ee=Z?l:f,q=t??y0(S,e),U=S.find(me=>me.id===q),X=U?.children??[];ho.useEffect(()=>{_||A(u);},[u,_]),ho.useEffect(()=>{z||F(g);},[g,z]);let O=a(me=>{_||A(me),T?.(me);},"setNavigationMode"),K=a(me=>{z||F(me),R?.(me);},"setCollapsed"),ne=[];o&&ne.push({id:"toggle-headbar",label:P,onClick:a(()=>O("headbar"),"onClick"),icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px] rotate-180",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M3 9h18"})]})}),ne.push({id:"toggle-sidebar",label:Z?b:I,onClick:a(()=>K(!Z),"onClick"),icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M9 3v18"}),jsxRuntime.jsx("path",{d:Z?"m14 9 3 3-3 3":"m16 15-3-3 3-3"})]})});let fe=ae&&d&&X.length?jsxRuntime.jsx("aside",{className:"relative h-full min-h-0 shrink-0 overflow-hidden","data-navigation-contextual-sidebar":q,style:{width:p},children:jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col gap-3 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] px-4 py-4",children:[jsxRuntime.jsx("div",{className:"shrink-0 px-2 text-sm font-semibold text-[hsl(var(--foreground))]",children:c??U?.label}),jsxRuntime.jsx(x0,{activeItemId:e,items:X,onNavigate:C})]})}):ae?null:jsxRuntime.jsx("div",{className:De("relative h-full min-h-0 shrink-0 transition-[width] duration-260",Z?"z-20 overflow-visible":"z-10 overflow-hidden"),style:{width:ee,transitionTimingFunction:IW},children:jsxRuntime.jsx(UW,{accountMenu:N??r,activeItemId:e,actions:ne,collapsed:Z,collapsedAccountMenu:s??r,footer:D,header:E,items:S,logo:v,onCollapsedChange:K,onNavigate:C,onRevealRoot:me=>$(ie=>({id:me,nonce:(ie?.nonce??0)+1})),revealRequest:G,title:w?.brandTitle})}),he=ae?jsxRuntime.jsx(XW,{activeItemId:e,activeRootId:q,actions:o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[k,jsxRuntime.jsx(mt,{appearance:cr,tone:"muted",icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M9 3v18"}),jsxRuntime.jsx("path",{d:"m14 9 3 3-3 3"})]}),label:jsxRuntime.jsx("span",{className:"truncate whitespace-nowrap",children:W}),onClick:()=>O("sidebar"),className:De("h-auto min-w-0 shrink px-3 py-2 text-sm font-medium text-[hsl(var(--muted-foreground))] shadow-none hover:border-[hsl(var(--input))]/70 hover:bg-[hsl(var(--muted))]/60 hover:text-[hsl(var(--foreground))]",$u(w?.menuRadius))})]}):k,accountMenu:r,extra:M,layout:w,logo:v,navItems:S,onNavigate:C}):null;return jsxRuntime.jsx(g0,{header:he,sidebar:fe,flush:x,contentFrame:y,className:i,children:n})}a(QW,"NavigationLayout");var t3={variant:"default",density:"default"},o3=ho.createContext(t3);function r3(e,t={}){return {variant:t.variant??e.variant,density:t.density??(t.variant==="trend"?"compact":e.density)}}a(r3,"resolveAgentWorkbenchAppearance");function Tl(e={}){return r3(ho.useContext(o3),e)}a(Tl,"useAgentWorkbenchAppearance");var n3={page:"bg-background text-foreground",panel:"bg-card text-card-foreground",elevated:"border border-border bg-popover text-popover-foreground shadow-sm",subtle:"bg-muted/40 text-foreground",overlay:"border border-border bg-popover text-popover-foreground shadow-lg"};ho.forwardRef(a(function({level:t="panel",variant:o,density:r,className:n,children:i,...s},l){let d=Tl({variant:o,density:r});return jsxRuntime.jsx("div",{...s,ref:l,"data-agent-workbench-surface":t,"data-agent-workbench-variant":d.variant,"data-agent-workbench-density":d.density,className:De(n3[t],n),children:i})},"AgentWorkbenchSurface"));var S0={sparkles:lucideReact.Sparkles,palette:lucideReact.Palette,search:lucideReact.Search,"file-text":lucideReact.FileText,code:lucideReact.Code2,"shopping-bag":lucideReact.ShoppingBag},Ua="__quick-start__";function g3({template:e}){let t=S0[e.icon||"sparkles"];return e.coverImageUrl?jsxRuntime.jsx("img",{src:e.coverImageUrl,alt:"",className:"size-full bg-muted object-contain"}):jsxRuntime.jsx("span",{className:"flex size-full items-center justify-center bg-gradient-to-br from-primary/5 via-muted/50 to-primary/15",children:jsxRuntime.jsx("span",{className:"flex size-14 items-center justify-center rounded-2xl border border-primary/10 bg-background/85 text-primary shadow-sm",children:jsxRuntime.jsx(t,{className:"size-7","aria-hidden":"true"})})})}a(g3,"TemplateVisual");function T0({viewModel:e,className:t,onIntent:o}){let r=Ye().agentWorkbench.quickStart,n=ho.useRef(null),[i,s]=ho.useState(),[l,d]=ho.useState(),[c,p]=ho.useState(),u=ho.useMemo(()=>e.categories.map(h=>({...h,sections:h.sections.map(S=>({...S,templates:S.templates.filter(T=>!T.modes||T.modes.includes(e.mode))})).filter(S=>S.templates.length>0)})).filter(h=>h.sections.length>0),[e.categories,e.mode]),g=ho.useMemo(()=>{let h=u.flatMap(S=>S.sections.filter(T=>T.id==="quick-start")).map(S=>S.templates).flat().filter((S,T,C)=>C.findIndex(R=>R.id===S.id)===T);if(h.length!==0)return {id:Ua,label:r.label,icon:"sparkles",sections:[{id:"quick-start",label:r.label,templates:h}]}},[u,r.label]),f=i===Ua?g:u.find(h=>h.id===i),b=f?.sections.find(h=>h.id===l)||f?.sections[0],x=b?.templates.length?b.templates.every(h=>!h.coverImageUrl):false;if(ho.useEffect(()=>{i&&i!==Ua&&!u.some(h=>h.id===i)&&(s(void 0),d(void 0)),i===Ua&&!g&&(s(void 0),d(void 0));},[i,u,g]),u.length===0)return null;let y=a(h=>{s(h.id),d(h.sections[0]?.id),o?.({type:"change-category",categoryId:h.id});},"selectCategory"),k=a(()=>{g&&(s(Ua),d(g.sections[0]?.id),o?.({type:"change-category"}));},"selectQuickStart"),w=a(h=>{f&&(d(h),o?.({type:"change-section",categoryId:f.id,sectionId:h}));},"selectSection"),v=a(h=>{if(e.disabled)return;if(h.action!=="upload"){o?.({type:"select-template",templateId:h.id,prompt:h.prompt});return}let S=n.current;S&&(S.accept=h.accept||"*/*",S.multiple=h.multiple===true,p(h),S.click());},"selectTemplate");return jsxRuntime.jsxs("section",{className:De("agent-workbench-quick-start min-w-0 max-w-full",t),"aria-label":r.label,children:[jsxRuntime.jsx("input",{ref:n,type:"file",className:"hidden",onChange:h=>{let S=Array.from(h.target.files||[]);c&&S.length>0&&o?.({type:"select-template",templateId:c.id,prompt:c.prompt,files:c.multiple?S:S.slice(0,1)}),p(void 0),h.target.value="";}}),f?jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 max-w-full items-center gap-1 overflow-x-auto pb-1",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>{s(void 0),d(void 0),o?.({type:"change-category"});},children:[jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"size-4","aria-hidden":"true"}),r.back]}),f.sections.map((h,S)=>jsxRuntime.jsx("button",{type:"button","aria-pressed":b?.id===h.id,className:De("h-9 shrink-0 rounded-md px-4 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",b?.id===h.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"),onClick:()=>w(h.id),children:f.id!==Ua&&S===0?f.label:h.label},h.id))]}),jsxRuntime.jsx("div",{"data-quick-start-layout":x?"list":"cards",className:De("grid",x?"grid-cols-1 gap-0":"grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3"),children:b?.templates.map(h=>jsxRuntime.jsxs("button",{type:"button",disabled:e.disabled,"data-quick-start-template-id":h.id,className:De("group min-w-0 overflow-hidden text-left transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x?"flex min-h-14 items-center rounded-none border-x-0 border-t-0 bg-transparent shadow-none hover:border-border hover:bg-muted/40 last:border-b-0":"rounded-xl border border-border bg-background hover:border-primary/30 hover:bg-muted/20"),onClick:()=>v(h),children:[jsxRuntime.jsxs("span",{className:De(x?"min-w-0 flex-1 px-2 py-2.5":"block px-4 pb-3 pt-4"),children:[jsxRuntime.jsxs("span",{className:De("flex items-center gap-2 text-sm text-foreground",x?"font-medium":"font-semibold"),children:[h.title,h.action==="upload"?jsxRuntime.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"size-3","aria-hidden":"true"}),r.addFile]}):null]}),h.description?jsxRuntime.jsx("span",{className:De("line-clamp-2 block text-xs leading-4 text-muted-foreground",x?"mt-0.5 min-h-0 text-muted-foreground/75":"mt-1 min-h-8"),children:h.description}):null]}),x?jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"mr-2 size-4 shrink-0 text-muted-foreground/45","aria-hidden":"true"}):jsxRuntime.jsx("span",{className:De("block overflow-hidden",h.coverImageUrl?"aspect-[5/2]":"h-28"),children:jsxRuntime.jsx(g3,{template:h})})]},h.id))})]}):jsxRuntime.jsxs("div",{className:"flex max-w-full items-center justify-center gap-2 overflow-x-auto px-1 pb-1",children:[g?jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring","aria-pressed":i===Ua,onClick:k,children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),r.label]}):null,u.map(h=>{let S=S0[h.icon||"sparkles"];return jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>y(h),children:[jsxRuntime.jsx(S,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),h.label]},h.id)})]})]})}a(T0,"AgentWorkbenchQuickStart");var Ka=ho.forwardRef(a(function({children:t,header:o,search:r,primaryAction:n,actions:i,groups:s,footer:l,className:d,classNames:c,bodyProps:p,bodyScrollable:u=true,status:g="ready",variant:f,density:b,loadingState:x,emptyState:y,errorState:k,...w},v){let h=Tl({variant:f,density:b}),S=h.density==="compact",T=r!==void 0||n!==void 0||i!==void 0,C=g==="loading"?x:g==="empty"?y:g==="error"?k:t;return jsxRuntime.jsxs("nav",{ref:v,"data-agent-workbench-variant":h.variant,"data-agent-workbench-density":h.density,"data-agent-workbench-status":g,className:De("flex h-full min-h-0 flex-col bg-card text-card-foreground",c?.root,d),...w,children:[o!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.header),children:o}):null,T?jsxRuntime.jsxs("div",{className:De("shrink-0",S?"space-y-2 px-3 pb-2 pt-3":"space-y-3 px-4 pb-2 pt-4",c?.search),children:[r,n!==void 0?jsxRuntime.jsx("div",{className:De(c?.primaryAction),children:n}):null,i!==void 0?jsxRuntime.jsx("div",{className:De("flex min-w-0 items-center gap-2",c?.actions),children:i}):null]}):null,jsxRuntime.jsx("div",{"data-agent-workbench-scroll-region":u?"":void 0,...p,tabIndex:p?.tabIndex??(u?0:void 0),className:De("min-h-0 flex-1",S?"px-3 pb-3":"px-4 pb-4",u&&"overflow-x-hidden overflow-y-auto overscroll-contain",c?.body),children:C}),s!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.groups),children:s}):null,l!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.footer),children:l}):null]})},"AgentWorkbenchSidebarContainer"));Ka.displayName="AgentWorkbenchSidebarContainer";function Uu({value:e,label:t,placeholder:o=t,className:r,variant:n="default",onChange:i}){let s=Ye().agentWorkbench.navigation,l=ho.useRef(null);return ho.useEffect(()=>{let d=a(c=>{!(c.ctrlKey||c.metaKey)||c.key.toLocaleLowerCase()!=="k"||(c.preventDefault(),l.current?.focus(),l.current?.select());},"handleShortcut");return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]),jsxRuntime.jsxs(oy,{className:De(n==="trend"?"h-12 rounded-[var(--radius)] border-border bg-card text-foreground":"h-10 rounded-lg bg-card",r),children:[jsxRuntime.jsx(qd,{children:jsxRuntime.jsx(lucideReact.Search,{className:"size-4","aria-hidden":"true"})}),jsxRuntime.jsx(gm,{ref:l,type:"search",value:e,"aria-label":t,placeholder:o,className:"min-w-0 [&::-webkit-search-cancel-button]:hidden",onChange:d=>i(d.target.value),onKeyDown:d=>{d.key==="Escape"&&(i(""),d.currentTarget.blur());}}),e?jsxRuntime.jsx(qd,{align:"inline-end",children:jsxRuntime.jsx(ry,{size:"icon-xs","aria-label":s.clearSearch,onClick:()=>i(""),children:jsxRuntime.jsx(lucideReact.X,{className:"size-3.5","aria-hidden":"true"})})}):jsxRuntime.jsx(qd,{align:"inline-end",children:jsxRuntime.jsx("kbd",{className:"border border-border px-1.5 py-0.5 text-[10px]",children:"Ctrl K"})})]})}a(Uu,"AgentWorkbenchSidebarSearch");function Ku({label:e,className:t,variant:o="default",onClick:r}){return jsxRuntime.jsxs(pt,{type:"button",variant:o==="trend"?"default":"ghost",className:De(o==="trend"?"h-11 w-full justify-center gap-2 rounded-[var(--radius)] border border-primary/60 bg-primary px-3 font-semibold text-primary-foreground hover:bg-primary/90":"h-9 w-full justify-start gap-2 px-3 text-sm",t),onClick:r,children:[jsxRuntime.jsx(lucideReact.SquarePen,{className:"size-4","aria-hidden":"true"}),e]})}a(Ku,"AgentWorkbenchSidebarNewSessionButton");function I0({item:e}){let[t,o]=ho.useState(false);return e.thumbnailUrl&&!t?jsxRuntime.jsx("img",{src:e.thumbnailUrl,alt:"",className:"size-full object-cover",loading:"lazy",onError:()=>o(true)}):jsxRuntime.jsx(lucideReact.Image,{className:"size-5","aria-hidden":"true"})}a(I0,"SessionAvatar");function D0({item:e}){let{locale:t}=Co(),o=Ye().agentWorkbench.navigation;return jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate text-xs text-foreground/80",children:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e.updatedAt))}),e.mode?jsxRuntime.jsx("span",{className:De("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none",e.mode==="work"?"bg-primary/10 text-primary":"bg-muted text-foreground"),children:e.mode==="work"?o.work:o.chat}):null]})}a(D0,"SessionMeta");function D3({status:e}){let t=Ye().agentWorkbench.navigation;return e==="running"?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin text-primary","aria-label":t.running}):e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-primary","aria-label":t.completed}):e==="error"?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"size-4 text-destructive-text","aria-label":t.failed}):null}a(D3,"StatusIndicator");function qu({sessions:e,selectedSessionId:t,status:o="ready",error:r,query:n="",emptyLabel:i,noResultsLabel:s,retryLabel:l,groupByMode:d=false,showHeading:c=false,variant:p="default",className:u,itemClassName:g,capabilities:f,onSelect:b,onTogglePin:x,onRename:y,onDelete:k,onRetry:w}){let v=Ye().agentWorkbench.navigation,h=ho.useRef(null),[S,T]=ho.useState(),[C,R]=ho.useState("");ho.useEffect(()=>{S&&(h.current?.focus(),h.current?.select());},[S]);let M=a(()=>{T(void 0),R("");},"cancelRename"),I=a(D=>{let E=C.trim();E&&E!==D.title&&y?.(D.id,E),M();},"saveRename");if(o==="loading"&&e.length===0)return jsxRuntime.jsx("div",{className:"space-y-2 px-1 py-3",role:"status","aria-label":v.loading,children:Array.from({length:4},(D,E)=>jsxRuntime.jsx("div",{"aria-hidden":"true",className:De("animate-pulse rounded-[var(--radius)] bg-muted/70",p==="trend"?"h-10":"h-14")},E))});if(o==="error")return jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 px-3 py-8 text-center",children:[jsxRuntime.jsx("p",{className:"max-w-full break-words text-sm text-muted-foreground",role:"alert",children:r}),w?jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 px-0 text-sm text-primary hover:text-primary",onClick:w,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-3.5","aria-hidden":"true"}),l??v.retry]}):null]});if(e.length===0)return jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:n?s:i});let B=a(D=>jsxRuntime.jsx("div",{className:"space-y-3",children:D.map(E=>jsxRuntime.jsxs("div",{"aria-current":E.id===t?"page":void 0,"data-agent-session-status":E.status??"idle","aria-busy":E.status==="running"?"true":void 0,className:"group flex h-10 w-full min-w-0 items-center rounded-[var(--radius)] border border-transparent bg-muted/60 text-foreground transition hover:bg-muted focus-within:border-ring focus-within:ring-2 focus-within:ring-ring aria-[current=page]:border-primary aria-[current=page]:bg-primary/10",children:[jsxRuntime.jsx("button",{type:"button",title:E.title,className:"h-full min-w-0 flex-1 truncate px-3 text-left text-sm font-semibold",onClick:()=>b(E.id),children:E.title}),f?.delete?jsxRuntime.jsx("span",{"data-agent-workbench-item-actions":true,className:"mr-1 shrink-0 opacity-0 transition-opacity group-aria-[current=page]:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100",onClick:P=>P.stopPropagation(),onKeyDown:P=>P.stopPropagation(),children:jsxRuntime.jsxs(Ts,{children:[jsxRuntime.jsx(Ns,{asChild:true,children:jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon","aria-label":v.actions,className:"size-8 text-muted-foreground",children:jsxRuntime.jsx(lucideReact.Ellipsis,{className:"size-4","aria-hidden":"true"})})}),jsxRuntime.jsx(yi,{align:"end",children:jsxRuntime.jsxs(Rs,{className:"text-destructive-text",onSelect:()=>k?.(E.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"mr-2 size-4","aria-hidden":"true"}),v.delete]})})]})}):null]},E.id))}),"renderTrendItems"),N=a(D=>jsxRuntime.jsx("div",{className:"space-y-1",children:D.map(E=>{let P=E.contextUsage&&E.contextUsage.maxTokens>0?Math.min(100,Math.round(E.contextUsage.usedTokens/E.contextUsage.maxTokens*100)):void 0;return jsxRuntime.jsxs("div",{"aria-current":E.id===t?"page":void 0,className:De("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted",g),children:[S===E.id?jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(I0,{item:E})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx(un,{ref:h,value:C,"aria-label":v.rename,appearance:"compact",className:"h-6 w-full border-primary px-1.5 text-sm font-medium",onChange:W=>R(W.target.value),onClick:W=>W.stopPropagation(),onBlur:()=>I(E),onKeyDown:W=>{W.stopPropagation(),W.key==="Enter"?(W.preventDefault(),I(E)):W.key==="Escape"&&(W.preventDefault(),M());}}),jsxRuntime.jsx(D0,{item:E})]})]}):jsxRuntime.jsxs("button",{type:"button",title:E.title,className:"flex min-w-0 flex-1 items-center gap-3 text-left",onClick:()=>b(E.id),children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(I0,{item:E})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-medium",children:E.title}),jsxRuntime.jsx(D0,{item:E})]})]}),jsxRuntime.jsxs("span",{"data-agent-workbench-item-actions":true,className:"flex shrink-0 items-center gap-1",children:[P!==void 0&&E.status==="idle"?jsxRuntime.jsxs("span",{className:"text-xs text-foreground","aria-label":v.contextUsage({percent:P}),children:[P,"%"]}):jsxRuntime.jsx(D3,{status:E.status}),f?.pin?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon","aria-label":E.pinned?v.unpin:v.pin,className:De("size-8 text-muted-foreground opacity-0 group-hover:opacity-100",E.pinned&&"text-primary opacity-100"),onClick:W=>{W.stopPropagation(),x?.(E.id,!E.pinned);},children:jsxRuntime.jsx(lucideReact.Pin,{className:De("size-4",E.pinned&&"fill-current")})}):null,f?.rename||f?.delete?jsxRuntime.jsx("span",{onClick:W=>W.stopPropagation(),onKeyDown:W=>W.stopPropagation(),children:jsxRuntime.jsxs(Ts,{children:[jsxRuntime.jsx(Ns,{asChild:true,children:jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon",className:"size-8","aria-label":v.actions,children:jsxRuntime.jsx(lucideReact.Ellipsis,{className:"size-4","aria-hidden":"true"})})}),jsxRuntime.jsxs(yi,{align:"end",children:[f.rename?jsxRuntime.jsxs(Rs,{onSelect:()=>{T(E.id),R(E.title);},children:[jsxRuntime.jsx(lucideReact.Pencil,{className:"mr-2 size-4","aria-hidden":"true"}),v.rename]}):null,f.delete?jsxRuntime.jsxs(Rs,{className:"text-destructive-text",onSelect:()=>k?.(E.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"mr-2 size-4","aria-hidden":"true"}),v.delete]}):null]})]})}):null]})]},E.id)})}),"renderItems");return jsxRuntime.jsxs("div",{className:De("space-y-2",u),children:[c&&!d?jsxRuntime.jsx("h3",{className:"mb-2 px-3 text-xs font-medium text-muted-foreground",children:v.recentSessions}):null,p==="trend"?B(e):d?[{id:"chatbot",label:v.chats,icon:lucideReact.MessageSquare,items:e.filter(D=>D.mode!=="work")},{id:"agent",label:v.agents,icon:lucideReact.Bot,items:e.filter(D=>D.mode==="work")}].map(({id:D,label:E,icon:P,items:W})=>jsxRuntime.jsxs("details",{open:true,"aria-label":E,children:[jsxRuntime.jsxs("summary",{className:"flex h-9 cursor-pointer list-none items-center gap-2 rounded-md px-3 text-sm font-semibold hover:bg-muted",children:[jsxRuntime.jsx(P,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:E})]}),N(W)]},D)):N(e)]})}a(qu,"AgentWorkbenchSessionList");var F3={contract:"AgentWorkbenchNavigationViewModel",activeTab:"sessions",searchQuery:"",agents:{status:"loading",items:[]},sessions:{status:"loading",items:[]},capabilities:{createAgent:false,createSession:false,manageCapabilities:false,manageAgentSettings:false,pinAgents:false,pinSessions:false,renameSessions:false,deleteSessions:false}};function H3({item:e}){let[t,o]=ho.useState(false);if(e.iconUrl&&!t)return jsxRuntime.jsx("img",{src:e.iconUrl,alt:"",className:"size-full object-cover",onError:()=>o(true)});let r=e.name.trim().charAt(0).toLocaleUpperCase();return r?jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:r}):jsxRuntime.jsx(lucideReact.Bot,{className:"size-4"})}a(H3,"ItemAvatar");function V3({status:e,empty:t,noResults:o,hasItems:r,query:n,error:i,onRetry:s}){let l=Ye().agentWorkbench.navigation;return e==="loading"&&!r?jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:l.loading}):e==="error"?jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 px-3 py-8 text-center",children:[jsxRuntime.jsx("p",{className:"max-w-full break-words text-sm text-muted-foreground",role:"alert",children:i}),jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 px-0 text-sm text-primary hover:text-primary",onClick:s,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-3.5","aria-hidden":"true"}),l.retry]})]}):r?null:jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:n?o:t})}a(V3,"CollectionState");function A0({viewModel:e=F3,navigationMode:t,config:o,header:r,headerActions:n,footer:i,className:s,classNames:l,onIntent:d}){let c=Ye().agentWorkbench.navigation,p=ho.useMemo(()=>monkeys.resolveAgentWorkbenchSidebarConfig(o),[o]),u=ho.useMemo(()=>new Set(p.visibleSections),[p.visibleSections]),g=t==="sessions-only"||t===void 0&&p.navigationMode!=="default",f=u.has("agents")&&!g,b=u.has("sessions"),x=e.searchQuery.trim().toLocaleLowerCase(),y=ho.useMemo(()=>e.agents.items.filter(w=>!x||`${w.name} ${w.description??""}`.toLocaleLowerCase().includes(x)),[x,e.agents.items]),k=ho.useMemo(()=>e.sessions.items.filter(w=>!x||w.title.toLocaleLowerCase().includes(x)),[x,e.sessions.items]);return jsxRuntime.jsx(Da,{value:g||!f?"sessions":e.activeTab,onValueChange:w=>{!g&&(w==="agents"||w==="sessions")&&d?.({type:"change-tab",tab:w});},className:"h-full min-h-0",children:jsxRuntime.jsxs(Ka,{"data-sidebar-width-percent":p.widthPercent,"aria-label":c.tabsLabel,header:u.has("header")?r:void 0,search:u.has("search")?jsxRuntime.jsx(Uu,{value:e.searchQuery,label:g?c.searchSessions:c.search,className:l?.search,onChange:w=>d?.({type:"change-search",query:w})}):void 0,actions:f&&b||n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&b?jsxRuntime.jsxs(Pa,{className:De("grid min-w-0 flex-1 grid-cols-2 text-foreground",l?.tabs),"aria-label":c.tabsLabel,children:[jsxRuntime.jsx(jn,{value:"agents",children:c.agents}),jsxRuntime.jsx(jn,{value:"sessions",children:c.sessions})]}):null,n?jsxRuntime.jsx("div",{className:"flex shrink-0 items-center",children:n}):null]}):void 0,footer:u.has("footer")&&(!g&&e.capabilities.manageAgentSettings||i)?jsxRuntime.jsxs("div",{className:De("border-t border-border p-4",l?.footer),children:[!g&&e.capabilities.manageAgentSettings?jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",className:"h-10 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"open-agent-settings"}),children:[jsxRuntime.jsx(lucideReact.Settings,{className:"size-4","aria-hidden":"true"}),c.settings]}):null,i]}):void 0,bodyScrollable:false,className:s,classNames:{root:l?.root,body:"flex min-h-0 flex-1 flex-col p-0"},children:[f?jsxRuntime.jsxs(cn,{value:"agents","data-agent-workbench-scroll-region":true,className:De("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4",l?.body),children:[e.capabilities.createAgent?jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",className:"mb-3 h-9 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"create-agent"}),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"size-4","aria-hidden":"true"}),c.newAgent]}):null,jsxRuntime.jsx("h3",{className:"mb-2 px-3 text-xs font-medium text-muted-foreground",children:c.allAgents}),jsxRuntime.jsx(V3,{status:e.agents.status,empty:c.emptyAgents,noResults:c.noResults,hasItems:y.length>0,query:x,error:e.agents.error,onRetry:()=>d?.({type:"retry-agents"})}),jsxRuntime.jsx("div",{className:"space-y-1",children:y.map(w=>jsxRuntime.jsxs("div",{"aria-current":w.id===e.selectedAgentItem?"page":void 0,className:De("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted",l?.item),children:[jsxRuntime.jsxs("button",{type:"button",title:w.name,className:"flex min-w-0 flex-1 items-center gap-3 text-left",onClick:()=>d?.({type:"select-agent",itemId:w.id}),children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(H3,{item:w})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-medium",children:w.name}),jsxRuntime.jsx("span",{className:"block truncate text-xs text-foreground/80",children:w.description||c.noDescription})]})]}),w.builtIn?jsxRuntime.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-1 text-[10px] text-foreground",children:c.builtIn}):null,e.capabilities.pinAgents?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon","aria-label":w.pinned?c.unpin:c.pin,className:De("size-8 text-muted-foreground opacity-0 group-hover:opacity-100",w.pinned&&"text-primary opacity-100"),onClick:v=>{v.stopPropagation(),d?.({type:"toggle-agent-pin",itemId:w.id,pinned:!w.pinned});},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),d?.({type:"toggle-agent-pin",itemId:w.id,pinned:!w.pinned}));},children:jsxRuntime.jsx(lucideReact.Pin,{className:De("size-4",w.pinned&&"fill-current",w.pinPending&&"animate-pulse")})}):null]},w.id))})]}):null,b?jsxRuntime.jsxs(cn,{value:"sessions","data-agent-workbench-scroll-region":true,className:De("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4",l?.body),children:[u.has("new-session")&&e.capabilities.createSession?jsxRuntime.jsx(Ku,{label:c.newSession,onClick:()=>d?.({type:"create-session"})}):null,!g&&e.capabilities.manageCapabilities?jsxRuntime.jsxs(pt,{type:"button",variant:"ghost",className:"mb-3 h-9 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"open-capabilities"}),children:[jsxRuntime.jsx(lucideReact.Blocks,{className:"size-4","aria-hidden":"true"}),c.capabilities]}):null,jsxRuntime.jsx(qu,{sessions:k,selectedSessionId:e.selectedSessionItem,status:e.sessions.status,error:e.sessions.error,query:x,emptyLabel:c.emptySessions,noResultsLabel:c.noResults,groupByMode:g,showHeading:!g,itemClassName:l?.item,capabilities:{pin:e.capabilities.pinSessions,rename:e.capabilities.renameSessions,delete:e.capabilities.deleteSessions},onSelect:w=>d?.({type:"select-session",sessionId:w}),onTogglePin:(w,v)=>d?.({type:"toggle-session-pin",sessionId:w,pinned:v}),onRename:(w,v)=>d?.({type:"rename-session",sessionId:w,title:v}),onDelete:w=>d?.({type:"delete-session",sessionId:w}),onRetry:()=>d?.({type:"retry-sessions"})})]}):null]})})}a(A0,"AgentWorkbenchSidebar");function B0({item:e,src:t=e.imageUrl,className:o,onError:r}){if(!t)return null;let n=e.mediaVariant??"cover",i=n==="logo",s=n==="cover-with-label",l=e.mediaTreatment==="monochrome-light"?"brightness-0 invert":e.mediaTreatment==="invert"?"invert":"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:De(i?"flex size-full items-center justify-center bg-[hsl(var(--monkeys-color-media-surface))] p-token-xl":"block size-full",o),children:jsxRuntime.jsx("img",{src:t,alt:"",className:De("transition-transform duration-300 group-hover/explore-card:scale-[1.03]",i?"max-h-full max-w-full object-contain":"size-full object-cover",l),onError:r})}),s?jsxRuntime.jsxs("span",{className:"pointer-events-none absolute inset-x-0 bottom-0 text-[hsl(var(--monkeys-color-media-foreground))]",style:{paddingInline:"var(--global-spacing, 0.75rem)",paddingBottom:"var(--global-spacing-sm, 0.5rem)",paddingTop:"var(--global-spacing-2xl, 1.5rem)",backgroundImage:"linear-gradient(to top, hsl(var(--monkeys-color-media-overlay) / 0.8), hsl(var(--monkeys-color-media-overlay) / 0.3), transparent)"},children:[jsxRuntime.jsx("span",{className:"block text-base font-semibold",children:e.title}),e.subtitle?jsxRuntime.jsx("span",{className:"block text-xs opacity-75",style:{marginTop:"calc(var(--global-spacing, 0.75rem) / 6)"},children:e.subtitle}):null]}):null]})}a(B0,"AgentWorkbenchExploreCardMedia");function L0({sessions:e,groups:t,config:o,labels:r,selectedSessionId:n,searchQuery:i="",loading:s=false,error:l,showDraftSession:d=!n,deleteSessions:c=false,variant:p="default",defaultGroupId:u,header:g,footer:f,className:b,renderItemMedia:x,onIntent:y}){let k=ho.useMemo(()=>monkeys.resolveAgentWorkbenchSidebarConfig(o),[o]),w=ho.useMemo(()=>new Set(k.visibleSections),[k.visibleSections]),v=t?.length?t:k.groups,h=u??k.defaultGroupId,[S,T]=ho.useState(h??v[0]?.id??""),C=v.find(D=>D.id===S)??v[0],R=i.trim().toLocaleLowerCase(),M=d&&(!R||r.draftSession.toLocaleLowerCase().includes(R)),I=ho.useMemo(()=>e.filter(D=>!R||D.title.toLocaleLowerCase().includes(R)),[R,e]);ho.useEffect(()=>{v.some(D=>D.id===S)||T(h??v[0]?.id??"");},[S,v,h]);let B=a(D=>{T(D),y?.({type:"change-group",groupId:D});},"changeGroup"),N=w.has("groups")&&C?jsxRuntime.jsx("div",{className:"border-t border-border px-4 pb-4 pt-3",children:jsxRuntime.jsxs(Da,{value:C.id,onValueChange:B,children:[jsxRuntime.jsx(Pa,{className:"grid h-10 w-full rounded-[var(--radius)] bg-muted p-0.5 text-foreground",style:{gridTemplateColumns:`repeat(${v.length}, minmax(0, 1fr))`},children:v.map(D=>jsxRuntime.jsx(jn,{value:D.id,className:"rounded-md text-sm font-semibold text-foreground data-[state=active]:border data-[state=active]:border-border data-[state=active]:bg-background",children:D.label},D.id))}),v.map(D=>jsxRuntime.jsx(cn,{value:D.id,className:"mt-3",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:D.items.map(E=>jsxRuntime.jsx("button",{type:"button","aria-label":E.title,className:"group/explore-card relative aspect-[1.27] overflow-hidden rounded-[var(--radius)] border border-border bg-card text-left transition hover:border-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",style:Number.isFinite(D.itemAspectRatio)&&Number(D.itemAspectRatio)>0?{aspectRatio:D.itemAspectRatio}:void 0,onClick:()=>y?.({type:"select-item",groupId:D.id,item:E}),children:x?.(E,D)??jsxRuntime.jsx(B0,{item:E})},E.id))})},D.id))]})}):void 0;return jsxRuntime.jsx(Ka,{"data-sidebar-style":"explore","data-sidebar-width-percent":k.widthPercent,"aria-label":r.navigation,variant:p,density:p==="trend"?"compact":void 0,header:w.has("header")?g:void 0,search:w.has("search")?jsxRuntime.jsx(Uu,{value:i,label:r.search,variant:p,onChange:D=>y?.({type:"change-search",query:D})}):void 0,primaryAction:w.has("new-session")?jsxRuntime.jsx(Ku,{label:r.newSession,variant:p,onClick:()=>y?.({type:"create-session"})}):void 0,groups:N,footer:w.has("footer")?f:void 0,bodyProps:{"data-agent-workbench-session-scroll-region":""},className:b,classNames:{body:"min-h-[160px] flex-[0_1_280px]"},children:w.has("sessions")?jsxRuntime.jsxs("div",{className:"space-y-2",children:[M?jsxRuntime.jsx("button",{type:"button","aria-current":"page",className:"block h-10 w-full min-w-0 truncate rounded-[var(--radius)] border border-primary bg-primary/10 px-3 text-left text-sm font-semibold text-foreground",onClick:()=>y?.({type:"create-session"}),children:r.draftSession}):null,I.length>0||!M||s||l?jsxRuntime.jsx(qu,{sessions:I,selectedSessionId:n,status:l?"error":s?"loading":"ready",error:l,query:R,emptyLabel:r.emptySessions,noResultsLabel:r.noResults,retryLabel:r.retry,groupByMode:k.navigationMode!=="default",variant:p,capabilities:{delete:c},onSelect:D=>y?.({type:"select-session",sessionId:D}),onDelete:D=>y?.({type:"delete-session",sessionId:D}),onRetry:r.retry?()=>y?.({type:"retry-sessions"}):void 0}):null]}):null})}a(L0,"AgentWorkbenchExploreSidebar");var K3={reasoning:"reasoning",plan:"plan",task:"tasks",tool:"tools",approval:"approval",artifact:"artifacts",usage:"usage"};function q3(e){let t=e.filter(c=>c.eventType==="status"),o=t.at(-1);if(!o)return;if(o.payload.status!=="stopped"||o.payload.durationMs!==void 0)return o;let r=o.runId?t.filter(c=>c.runId===o.runId&&c.sequence<=o.sequence):t.filter(c=>c.sequence<=o.sequence),n=-1;for(let c=r.length-1;c>=0;c-=1){let p=r[c];if(p.sequence<o.sequence&&p.payload.status==="stopped"){n=c;break}}let i=r.slice(n+1).reverse().find(c=>c.payload.status==="running"||c.payload.status==="queued"),s=i?.payload.startedAt??i?.occurredAt,l=o.payload.stoppedAt??o.occurredAt;if(!s||!l)return o;let d=Date.parse(l)-Date.parse(s);return Number.isFinite(d)&&d>=0?{...o,resolvedDurationMs:d}:o}a(q3,"projectRun");function Y3(e,t){let o=K3[e.eventType];return o?t[o]===true:true}a(Y3,"isVisible");function ns(e,t,o){let r=new Map;for(let n of e){if(n.eventType!==t)continue;let i=n;r.set(o(i),i);}return [...r.values()].sort((n,i)=>n.sequence-i.sequence)}a(ns,"latestBy");function Qu(e){let t=e.events.filter(o=>Y3(o,e.snapshot.capabilities));return {mode:e.snapshot.mode,status:e.status,reasoning:ns(t,"reasoning",o=>o.payload.reasoningId),plans:ns(t,"plan",o=>o.payload.planId),tasks:ns(t,"task",o=>o.payload.taskId),tools:ns(t,"tool",o=>o.payload.toolCallId),approvals:ns(t,"approval",o=>o.payload.approvalId),artifacts:ns(t,"artifact",o=>o.payload.artifactId),usage:[...t].reverse().find(o=>o.eventType==="usage"),run:q3(t)}}a(Qu,"createAgentWorkbenchActivityModel");function J3({value:e}){if(e===void 0)return null;let t=typeof e=="string"?e:JSON.stringify(e,null,2);return jsxRuntime.jsx("pre",{className:"max-h-48 max-w-full overflow-auto overscroll-contain whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground [overflow-wrap:anywhere]",tabIndex:0,children:t})}a(J3,"JsonValue");function W0({approval:e,className:t,onDecision:o}){let r=Ye().agentWorkbench.approval,n=e.status==="requested",i=e.status==="approved";return jsxRuntime.jsx("article",{className:De("min-w-0 overflow-hidden rounded-lg border border-border bg-card p-3 text-card-foreground",t),"data-agent-approval-status":e.status,children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[n?jsxRuntime.jsx(lucideReact.Clock3,{className:"mt-0.5 size-4 shrink-0 text-warning-foreground","aria-hidden":"true"}):i?jsxRuntime.jsx(lucideReact.Check,{className:"mt-0.5 size-4 shrink-0 text-success","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.X,{className:"mt-0.5 size-4 shrink-0 text-destructive-text","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("h3",{className:"break-words text-sm font-medium",children:e.title}),e.description?jsxRuntime.jsx("p",{tabIndex:0,className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]",children:e.description}):null,e.requestedAction!==void 0?jsxRuntime.jsx("div",{className:"mt-3 min-w-0",children:jsxRuntime.jsx(J3,{value:e.requestedAction})}):null,n?jsxRuntime.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[jsxRuntime.jsx(pt,{type:"button",size:"sm",className:"h-auto px-3 py-1.5 text-sm",disabled:!o,onClick:()=>o?.({approvalId:e.approvalId,approved:true}),children:r.approve}),jsxRuntime.jsx(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto px-3 py-1.5 text-sm",disabled:!o,onClick:()=>o?.({approvalId:e.approvalId,approved:false}),children:r.reject})]}):jsxRuntime.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:i?r.approved:r.rejected})]})]})})}a(W0,"AgentWorkbenchApproval");function z0({value:e,className:t}){if(e===void 0)return null;let o=typeof e=="string"?e:JSON.stringify(e,null,2);return jsxRuntime.jsx("pre",{tabIndex:0,className:De("max-h-64 max-w-full overflow-auto overscroll-contain whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground [overflow-wrap:anywhere]",t),children:o})}a(z0,"JsonValue");function s4({status:e}){Ye().agentWorkbench.tool.status;let o="size-3.5 shrink-0";return e==="pending"?jsxRuntime.jsx(lucideReact.Clock3,{className:o,"aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Loader2,{className:De(o,"animate-spin"),"aria-hidden":"true"}):e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:De(o,"text-primary"),"aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.XCircle,{className:De(o,"text-destructive-text"),"aria-hidden":"true"})}a(s4,"ToolStatus");function Zu({event:e,expanded:t,defaultExpanded:o=e.payload.status==="failed",className:r,classNames:n,onExpandedChange:i}){let s=Ye().agentWorkbench.tool,[l,d]=ho.useState(o),c=t!==void 0,p=t??l,u=e.payload.status,g=a(f=>{c||d(f),i?.(f);},"setExpanded");return jsxRuntime.jsxs("details",{open:p,className:De("group min-w-0 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",n?.root,r),"data-tool-status":u,children:[jsxRuntime.jsxs("summary",{className:De("flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",n?.trigger),onClick:f=>{f.preventDefault(),g(!p);},children:[jsxRuntime.jsx(lucideReact.TerminalSquare,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:e.payload.toolName}),jsxRuntime.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-foreground",children:[jsxRuntime.jsx(s4,{status:u}),s.status[u]]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsxs("div",{className:De("min-w-0 space-y-3 border-t border-border px-3 py-3 text-sm",n?.content),children:[e.payload.input!==void 0?jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.input}),jsxRuntime.jsx(z0,{value:e.payload.input,className:n?.input})]}):null,e.payload.output!==void 0?jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.output}),jsxRuntime.jsx(z0,{value:e.payload.output,className:n?.output})]}):null,e.payload.error?jsxRuntime.jsx("p",{tabIndex:0,className:"max-h-32 overflow-auto whitespace-pre-wrap break-words text-sm text-destructive-text [overflow-wrap:anywhere]",role:"alert",children:e.payload.error}):null]})]})}a(Zu,"AgentWorkbenchTool");function y4({artifact:e,label:t,onDownload:o}){let r=ho.useRef(false),[n,i]=ho.useState(false);return jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon","aria-label":t,title:t,disabled:n,className:"text-muted-foreground hover:text-foreground",onClick:async s=>{if(s.preventDefault(),s.stopPropagation(),!r.current){r.current=true,i(true);try{await o(e);}finally{r.current=false,i(false);}}},children:n?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Download,{className:"size-4","aria-hidden":"true"})})}a(y4,"ArtifactDownloadButton");function ub({icon:e,title:t,open:o,streaming:r,className:n,triggerClassName:i,contentClassName:s,children:l}){return jsxRuntime.jsxs("details",{className:De("group min-w-0 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",n),open:o,children:[jsxRuntime.jsxs("summary",{className:De("flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",i),children:[r?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 shrink-0 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(e,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsx("div",{className:De("min-w-0 border-t border-border px-3 py-3 text-sm",s),children:l})]})}a(ub,"ActivityDetails");function O0({status:e}){return e==="completed"||e==="passed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-success","aria-hidden":"true"}):e==="failed"?jsxRuntime.jsx(lucideReact.XCircle,{className:"size-4 text-destructive-text","aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Clock3,{className:"size-4 animate-pulse text-warning-foreground","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Circle,{className:"size-4 text-muted-foreground","aria-hidden":"true"})}a(O0,"StatusIcon");function x4(e){if(e<1e3)return "<1s";let t=Math.floor(e/1e3),o=Math.floor(t/60),r=t%60;return o>0?`${o}m ${r}s`:`${r}s`}a(x4,"formatDuration");function v4({event:e}){let t=Ye().agentWorkbench,o=e.payload.status;return o!=="stopping"&&o!=="stopped"?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",role:"status",children:[o==="stopping"?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.CircleStop,{className:"size-4","aria-hidden":"true"}),jsxRuntime.jsx("span",{children:o==="stopping"?t.run.stopping:t.run.stoppedAfter({duration:x4(e.payload.durationMs??e.resolvedDurationMs??0)})})]})}a(v4,"RunStatus");function F0({viewModel:e,ariaLabel:t,hiddenToolCallIds:o,hideReasoning:r=false,hideStoppedRun:n=false,className:i,classNames:s,onApprovalDecision:l,onArtifactOpen:d,onArtifactDownload:c}){let p=Ye().agentWorkbench;if(!e)return null;let u=Qu(e),g=r?[]:u.reasoning,f=u.tools.filter(v=>!o?.has(v.payload.toolCallId)),b=u.approvals.filter(v=>!v.payload.toolCallId||!o?.has(v.payload.toolCallId)),x=u.usage?.payload,y=typeof x?.contextWindow=="number"&&x.contextWindow>0?x.contextWindow:void 0,k=u.run?.payload.status==="stopping"||u.run?.payload.status==="stopped"&&!n;return g.length>0||u.plans.length>0||u.tasks.length>0||f.length>0||b.length>0||u.artifacts.length>0||k||y!==void 0?jsxRuntime.jsxs("section",{className:De("space-y-3",s?.root,i),"aria-label":t??p.label,"data-agent-workbench-mode":u.mode,"data-agent-workbench-status":u.status,children:[g.map(v=>jsxRuntime.jsx(ub,{icon:lucideReact.Circle,title:p.reasoning,open:v.payload.status==="streaming",streaming:v.payload.status==="streaming",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsx("div",{tabIndex:0,className:"max-h-64 overflow-auto whitespace-pre-wrap break-words text-muted-foreground [overflow-wrap:anywhere]",children:v.payload.text})},v.payload.reasoningId)),u.plans.map(v=>jsxRuntime.jsx(ub,{icon:lucideReact.Circle,title:v.payload.title||p.plan,open:v.payload.status==="running",streaming:v.payload.status==="running",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsx("ol",{className:"space-y-2",children:v.payload.steps.map(h=>jsxRuntime.jsxs("li",{className:"flex min-w-0 items-start gap-2",children:[jsxRuntime.jsx(O0,{status:h.status}),jsxRuntime.jsx("span",{className:"min-w-0 break-words [overflow-wrap:anywhere]",children:h.title})]},h.id))})},v.payload.planId)),u.tasks.map(v=>jsxRuntime.jsx(ub,{icon:lucideReact.Circle,title:v.payload.title,open:v.payload.status==="running",streaming:v.payload.status==="running",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[jsxRuntime.jsx(O0,{status:v.payload.status}),jsxRuntime.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words text-muted-foreground [overflow-wrap:anywhere]",children:v.payload.detail||p.taskNoDetail})]})},v.payload.taskId)),f.map(v=>jsxRuntime.jsx(Zu,{event:v,defaultExpanded:v.payload.status==="failed",classNames:{root:s?.item,trigger:s?.trigger,content:s?.content}},v.payload.toolCallId)),b.map(v=>jsxRuntime.jsx(W0,{approval:v.payload,className:s?.approval,onDecision:l},v.payload.approvalId)),u.artifacts.map(v=>{let h=!!(v.payload.url&&d);return jsxRuntime.jsxs("article",{className:De("flex items-center gap-3 rounded-lg border border-border bg-card p-3 text-card-foreground",s?.artifact),children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-sm font-medium",children:v.payload.name}),jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:p.artifact[v.payload.status]})]}),v.payload.url?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground","aria-label":p.artifact.open({name:v.payload.name}),title:p.artifact.open({name:v.payload.name}),disabled:!h,onClick:S=>{S.preventDefault(),S.stopPropagation(),v.payload.url&&d?.({artifactId:v.payload.artifactId,name:v.payload.name,url:v.payload.url});},children:jsxRuntime.jsx(lucideReact.PanelRightOpen,{className:"size-4","aria-hidden":"true"})}):null,v.payload.url&&v.payload.status==="ready"&&c?jsxRuntime.jsx(y4,{artifact:{artifactId:v.payload.artifactId,name:v.payload.name,url:v.payload.url},label:p.artifactWorkspace.download({name:v.payload.name}),onDownload:c}):null]},v.payload.artifactId)}),k&&u.run?jsxRuntime.jsx(v4,{event:u.run}):null,x&&y!==void 0?jsxRuntime.jsx("div",{className:De("flex justify-end",s?.usage),"aria-label":p.usage.label,children:jsxRuntime.jsx("span",{className:"rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground",children:p.usage.context({used:x.contextTokens??x.totalTokens??0,total:y})})}):null]}):null}a(F0,"AgentWorkbenchActivity");var w4={diff:"diff","workspace-file":"workspaceFiles",terminal:"terminal","test-result":"testResults",artifact:"artifacts"};function ep(e,t,o){let r=new Map;for(let n of e){if(n.eventType!==t)continue;let i=n;r.set(o(i),i);}return [...r.values()].sort((n,i)=>n.sequence-i.sequence)}a(ep,"latestBy");function k4(e){let t=new Map;for(let o of e){let r=t.get(o.payload.terminalId)??{terminalId:o.payload.terminalId,stdin:"",stdout:"",stderr:"",status:"",sequence:o.sequence},n=o.payload.stream;t.set(o.payload.terminalId,{...r,...n==="status"?{status:o.payload.chunk}:{[n]:`${r[n]}${o.payload.chunk}`},...o.payload.exitCode===void 0?{}:{exitCode:o.payload.exitCode},sequence:o.sequence});}return [...t.values()].sort((o,r)=>o.sequence-r.sequence)}a(k4,"projectTerminals");function tp(e){let t=e.snapshot.capabilities,o=e.events.filter(s=>{let l=w4[s.eventType];return l?t[l]===true:false}),r=[...e.events].reverse().find(s=>s.eventType==="status"),n=r?.runId,i=[...e.events].reverse().find(s=>s.eventType==="summary"&&t.summary===true&&(!n||s.runId===n));return {mode:e.snapshot.mode,modelId:e.snapshot.modelId,permissionProfile:e.snapshot.permissionProfile,status:e.status,sessionId:e.sessionId,capabilities:t,resumable:t.resume===true&&e.resumable,summary:i,error:[...e.events].reverse().find(s=>s.eventType==="error"),run:r,usage:t.usage?[...e.events].reverse().find(s=>s.eventType==="usage"):void 0,workspace:{diffs:ep(o,"diff",s=>s.payload.path),files:ep(o,"workspace-file",s=>s.payload.path),terminals:k4(o.filter(s=>s.eventType==="terminal")),tests:ep(o,"test-result",s=>s.payload.testId),artifacts:ep(o,"artifact",s=>s.payload.artifactId)}}}a(tp,"createAgentWorkbenchDetailsModel");function V0(e){if(e===void 0)return "-";let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}a(V0,"formatDuration");function H4(e,t){if(!e)return "-";let o=new Date(e);return Number.isNaN(o.getTime())?"-":new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(o)}a(H4,"formatDate");function _0({value:e}){return jsxRuntime.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold text-foreground",children:e})}a(_0,"Count");function Nl({title:e,count:t,icon:o,className:r,children:n}){return t===0?null:jsxRuntime.jsxs("details",{className:De("group rounded-lg border border-border bg-card text-card-foreground",r),open:true,children:[jsxRuntime.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[jsxRuntime.jsx(o,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:e}),jsxRuntime.jsx(_0,{value:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsx("div",{className:"border-t border-border p-3",children:n})]})}a(Nl,"DetailsSection");function G0({status:e}){return e==="completed"||e==="passed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-primary","aria-hidden":"true"}):e==="failed"?jsxRuntime.jsx(lucideReact.XCircle,{className:"size-4 text-destructive-text","aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Clock3,{className:"size-4 animate-pulse","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Circle,{className:"size-4 text-muted-foreground","aria-hidden":"true"})}a(G0,"StatusIcon");function H0({state:e}){let t=Ye().agentWorkbench.details,o=e==="error";return jsxRuntime.jsxs("div",{className:"flex min-h-48 flex-col items-center justify-center gap-2 px-6 text-center",role:o?"alert":e==="loading"?"status":void 0,"aria-busy":e==="loading"||void 0,children:[e==="loading"?jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-5 animate-spin text-muted-foreground","aria-hidden":"true"}):o?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"size-5 text-destructive-text","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"text-sm font-medium",children:t.state[e].title}),jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:t.state[e].description})]})}a(H0,"StateContent");function V4({model:e,onIntent:t}){let o=Ye().agentWorkbench,r=o.details,n=Co().locale,i=e.summary,s=e.run?.payload,l=e.error,d=e.status==="failed"&&l?.payload.retryable,c=e.resumable&&["stopped","completed","failed"].includes(e.status),p=e.capabilities.threadForking,u=e.capabilities.editAndRerun,g=e.usage?.payload.totalTokens??(e.usage?.payload.inputTokens!==void 0||e.usage?.payload.outputTokens!==void 0?(e.usage.payload.inputTokens??0)+(e.usage.payload.outputTokens??0):void 0);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("section",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(G0,{status:e.status}),jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:r.status[e.status]})]}),jsxRuntime.jsxs("dl",{className:"mt-3 grid grid-cols-2 gap-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.duration}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:V0(s?.durationMs)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.updated}),jsxRuntime.jsx("dd",{className:"mt-0.5 truncate font-medium",children:H4(s?.stoppedAt??s?.completedAt??s?.failedAt,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.model}),jsxRuntime.jsx("dd",{className:"mt-0.5 truncate font-medium",children:e.modelId})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.mode}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:o.modes[e.mode]})]}),e.permissionProfile?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.permissions}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:o.composer.permissionOptions[e.permissionProfile]})]}):null,g!==void 0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.tokenUsage}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:new Intl.NumberFormat(n).format(g)})]}):null]}),l?jsxRuntime.jsx("div",{className:"mt-3 rounded-md border border-destructive/30 bg-destructive/5 p-2.5 text-sm text-destructive-text",role:"alert",children:l.payload.message}):null,d||c?jsxRuntime.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d?jsxRuntime.jsx(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"retry",eventId:l.eventId}),children:r.actions.retry}):null,c?jsxRuntime.jsx(pt,{type:"button",size:"sm",className:"h-auto px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"resume",sessionId:e.sessionId}),children:r.actions.resume}):null]}):null]}),jsxRuntime.jsxs("section",{className:"flex flex-wrap gap-2 rounded-lg border border-border bg-card p-3 text-card-foreground",children:[p?jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"continue-in-new-task",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.GitFork,{className:"size-3.5","aria-hidden":"true"}),r.actions.continueInNewTask]}):null,u?jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"edit-and-rerun",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.PencilLine,{className:"size-3.5","aria-hidden":"true"}),r.actions.editAndRerun]}):null,jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"export",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.Download,{className:"size-3.5","aria-hidden":"true"}),r.actions.export]})]}),jsxRuntime.jsxs("section",{className:"rounded-lg border border-border bg-card p-3 text-card-foreground",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:r.summary}),i?.payload.text?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-foreground","aria-label":r.actions.copySummary,disabled:!t,onClick:()=>t?.({type:"copy-summary",summaryId:i.payload.summaryId,text:i.payload.text}),children:jsxRuntime.jsx(lucideReact.Copy,{className:"size-4","aria-hidden":"true"})}):null]}),i?.payload.status==="failed"?jsxRuntime.jsxs("div",{className:"mt-3 space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-destructive-text",role:"alert",children:r.summaryFailed}),jsxRuntime.jsxs(pt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"retry-summary",eventId:i.eventId}),children:[jsxRuntime.jsx(lucideReact.RotateCcw,{className:"size-3.5","aria-hidden":"true"}),r.actions.retrySummary]})]}):i?.payload.text?jsxRuntime.jsxs("div",{className:"mt-3 space-y-3 text-sm",children:[jsxRuntime.jsx("p",{className:"whitespace-pre-wrap text-muted-foreground",children:i.payload.text}),i.payload.highlights.length>0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"text-xs font-medium",children:r.highlights}),jsxRuntime.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-muted-foreground",children:i.payload.highlights.map(f=>jsxRuntime.jsx("li",{children:f},f))})]}):null,i.payload.pendingItems.length>0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"text-xs font-medium",children:r.pendingItems}),jsxRuntime.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-muted-foreground",children:i.payload.pendingItems.map(f=>jsxRuntime.jsx("li",{children:f},f))})]}):null]}):jsxRuntime.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:r.summaryEmpty})]})]})}a(V4,"SummaryPanel");function _4({model:e,sectionClassName:t,codeClassName:o}){let r=Ye().agentWorkbench.details.workspace,n=e.workspace;return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Nl,{title:r.diffs,count:n.diffs.length,icon:lucideReact.FileCode2,className:t,children:jsxRuntime.jsx("div",{className:"space-y-3",children:n.diffs.map(i=>jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[jsxRuntime.jsx("span",{className:"truncate font-medium",children:i.payload.path}),jsxRuntime.jsx("span",{className:"shrink-0 text-muted-foreground",children:r.diffStatus[i.payload.status]})]}),i.payload.patch?jsxRuntime.jsx("pre",{className:De("mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:i.payload.patch}):null]},i.payload.path))})}),jsxRuntime.jsx(Nl,{title:r.files,count:n.files.length,icon:lucideReact.Files,className:t,children:jsxRuntime.jsx("ul",{className:"space-y-2 text-xs",children:n.files.map(i=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-3.5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.payload.path}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r.fileOperation[i.payload.operation]})]},i.payload.path))})}),jsxRuntime.jsx(Nl,{title:r.terminals,count:n.terminals.length,icon:lucideReact.TerminalSquare,className:t,children:jsxRuntime.jsx("div",{className:"space-y-3",children:n.terminals.map(i=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between gap-2 text-xs font-medium",children:[jsxRuntime.jsx("span",{children:i.terminalId}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i.exitCode===void 0?i.status:r.exitCode({code:i.exitCode})})]}),jsxRuntime.jsx("pre",{className:De("mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:[i.stdin,i.stdout,i.stderr].filter(Boolean).join(`
|
|
66
66
|
`)})]},i.terminalId))})}),jsxRuntime.jsx(Nl,{title:r.tests,count:n.tests.length,icon:lucideReact.TestTube2,className:t,children:jsxRuntime.jsx("ul",{className:"space-y-2 text-xs",children:n.tests.map(i=>jsxRuntime.jsxs("li",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(G0,{status:i.payload.status}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.payload.name}),i.payload.durationMs===void 0?null:jsxRuntime.jsx("span",{className:"text-muted-foreground",children:V0(i.payload.durationMs)})]}),i.payload.output?jsxRuntime.jsx("pre",{className:De("mt-2 max-h-48 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:i.payload.output}):null]},i.payload.testId))})}),jsxRuntime.jsx(Nl,{title:r.artifacts,count:n.artifacts.length,icon:lucideReact.FileOutput,className:t,children:jsxRuntime.jsx("ul",{className:"space-y-2 text-xs",children:n.artifacts.map(i=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-3.5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.payload.name}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i.payload.kind})]},i.payload.artifactId))})})]})}a(_4,"WorkspacePanel");function $0({viewModel:e,state:t="ready",activeTab:o="summary",className:r,classNames:n,onActiveTabChange:i,onIntent:s,onExport:l,onCopySummary:d,onRetry:c,onRetrySummary:p}){let u=s||l||d||c||p?w=>{if(w.type==="export"&&l)return l(w);if(w.type==="copy-summary"&&d)return d(w);if(w.type==="retry"&&c)return c(w);if(w.type==="retry-summary"&&p)return p(w);s?.(w);}:void 0,g=Ye().agentWorkbench.details;if(t!=="ready")return jsxRuntime.jsx("aside",{className:De("flex h-full min-h-0 flex-col border-l border-border bg-background",n?.root,r),children:jsxRuntime.jsx(H0,{state:t})});if(!e)return jsxRuntime.jsx("aside",{className:De("flex h-full min-h-0 flex-col border-l border-border bg-background",n?.root,r),children:jsxRuntime.jsx(H0,{state:"empty"})});let f=tp(e),b=Object.values(f.workspace).reduce((w,v)=>w+v.length,0),x=b>0,y=o==="workspace"&&!x?"summary":o,k=[{id:"summary",label:g.tabs.summary,count:f.summary?1:0},...x?[{id:"workspace",label:g.tabs.workspace,count:b}]:[]];return jsxRuntime.jsxs("aside",{className:De("flex h-full min-h-0 min-w-0 flex-col border-l border-border bg-background text-foreground",n?.root,r),"data-agent-workbench-mode":f.mode,children:[jsxRuntime.jsxs("header",{className:De("flex shrink-0 items-center gap-2 border-b border-border px-4 py-3",n?.header),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("h2",{className:"truncate text-sm font-semibold",children:g.title}),jsxRuntime.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:g.description})]}),s?jsxRuntime.jsx(pt,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground","aria-label":g.actions.close,onClick:()=>s({type:"close"}),children:jsxRuntime.jsx(lucideReact.X,{className:"size-4","aria-hidden":"true"})}):null]}),jsxRuntime.jsxs(Da,{value:y,className:"flex min-h-0 flex-1 flex-col",onValueChange:w=>i?.(w),children:[jsxRuntime.jsx(Pa,{"aria-label":g.tabs.label,className:De("flex h-auto shrink-0 gap-1 rounded-none border-b border-border bg-transparent px-3 py-2",n?.tabs),children:k.map(w=>jsxRuntime.jsxs(jn,{value:w.id,className:"min-w-0 flex-1 gap-1 px-2 py-1.5 text-xs shadow-none data-[state=active]:bg-primary/10 data-[state=active]:text-primary data-[state=active]:shadow-none",children:[jsxRuntime.jsx("span",{className:"truncate",children:w.label}),jsxRuntime.jsx(_0,{value:w.count})]},w.id))}),jsxRuntime.jsx(cn,{value:"summary",className:De("mt-0 min-h-0 flex-1 overflow-y-auto p-3",n?.body),children:jsxRuntime.jsx(V4,{model:f,onIntent:u})}),x?jsxRuntime.jsx(cn,{value:"workspace",className:De("mt-0 min-h-0 flex-1 overflow-y-auto p-3",n?.body),children:jsxRuntime.jsx(_4,{model:f,sectionClassName:n?.section,codeClassName:n?.code})}):null]})]})}a($0,"AgentWorkbenchTaskDetails");var np=Object.freeze({mobile:768,drawer:1200,compact:1440,lowHeight:768});function bb(e,t=np){return e<t.mobile?"mobile":e<t.drawer?"drawer":e<t.compact?"compact":"wide"}a(bb,"resolveAgentWorkbenchShellLayout");var fb="monkeys-agent-workbench-overlay-open";function j0(e){return typeof e=="number"?`${e}px`:e}a(j0,"cssSize");function rp(e,t,o){return Math.min(Math.max(e,t),Math.max(t,o))}a(rp,"clamp");function U0(){return typeof window>"u"?{width:1440,height:900}:{width:window.visualViewport?.width??window.innerWidth,height:window.visualViewport?.height??window.innerHeight}}a(U0,"initialMeasuredSize");function K4(e){if(!e||typeof window>"u")return {};try{let t=JSON.parse(window.localStorage.getItem(e)??"{}");return typeof t=="object"&&t!==null?t:{}}catch{return {}}}a(K4,"readStoredWidths");function q4(e,t){!e||typeof window>"u"||window.localStorage.setItem(e,JSON.stringify(t));}a(q4,"writeStoredWidths");function K0({sidebar:e,children:t,details:o,sidebarOpen:r=true,sidebarDefaultOpen:n=true,detailsOpen:i=true,onDetailsOpenChange:s,sidebarWidth:l=280,detailsWidth:d=360,sidebarMinWidth:c=240,sidebarMaxWidth:p=400,detailsMinWidth:u=320,detailsMaxWidth:g=720,mainMinWidth:f=600,responsive:b=false,responsiveMeasurement:x="container",responsiveWidth:y,responsiveHeight:k,breakpoints:w=np,onLayoutChange:v,showResponsiveControls:h=true,overlayGroupId:S,resizable:T=false,widthStorageKey:C,onSidebarWidthChange:R,onDetailsWidthChange:M,labels:I,variant:B,density:N,className:D,classNames:E,style:P,...W}){let H=Tl({variant:B,density:N}),A=ho.useRef(null),L=ho.useRef(null),F=ho.useRef(null),G=ho.useId(),[$,_]=ho.useState(U0),z=ho.useMemo(()=>K4(C),[C]),[re,Z]=ho.useState(()=>typeof l=="number"?z.sidebar??l:280),[ae,ee]=ho.useState(()=>typeof d=="number"?z.details??d:360),[q,U]=ho.useState(false),[X,O]=ho.useState(false),[K,ne]=ho.useState(n),fe=ho.useCallback((te,Te=document.activeElement)=>{if(!(Te instanceof HTMLElement)||Te===document.body||Te===document.documentElement)return;let ze=te==="sidebar"?L:F;ze.current=Te;},[]),he=ho.useCallback(te=>{let Te=te==="sidebar"?L:F,ze=Te.current;Te.current=null,ze?.isConnected&&window.requestAnimationFrame(()=>{ze.isConnected&&ze.focus();});},[]);ho.useEffect(()=>{typeof l=="number"&&Z(z.sidebar??l);},[l,z.sidebar]),ho.useEffect(()=>ne(n),[n]),ho.useEffect(()=>{typeof d=="number"&&ee(z.details??d);},[d,z.details]),ho.useEffect(()=>{if(!b)return;let te=a(()=>{let it=U0();_({width:y??it.width,height:k??it.height});},"updateViewport");if(x==="viewport"||y!==void 0||k!==void 0)return te(),y!==void 0&&k!==void 0?void 0:(window.addEventListener("resize",te),window.visualViewport?.addEventListener("resize",te),()=>{window.removeEventListener("resize",te),window.visualViewport?.removeEventListener("resize",te);});let Te=A.current;if(!Te)return;let ze=a(()=>{let it=Te.getBoundingClientRect();_({width:it.width,height:it.height});},"updateContainer");if(ze(),typeof ResizeObserver>"u")return window.addEventListener("resize",ze),()=>window.removeEventListener("resize",ze);let je=new ResizeObserver(ze);return je.observe(Te),()=>je.disconnect()},[b,k,x,y]);let me=b?bb(y??$.width,w):"wide",ie=b&&(k??$.height)<=w.lowHeight;ho.useEffect(()=>v?.(me),[me,v]);let be=e!==void 0&&r,He=o!==void 0&&i,We=me==="drawer"||me==="mobile",Ke=be&&K&&!We,ce=He&&me==="wide",Q=Math.max(c,Math.min(p,me==="compact"?320:p,$.width-(ce?ae:0)-f)),ge=Math.max(u,Math.min(g,$.width-(Ke?re:0)-f)),we=typeof l=="number"?rp(re,c,Q):l,Ie=typeof d=="number"?rp(ae,u,ge):d,oe=ho.useCallback(te=>{!S||typeof window>"u"||window.dispatchEvent(new CustomEvent(fb,{detail:{groupId:S,ownerId:G,region:te}}));},[S,G]);ho.useEffect(()=>{if(!S||typeof window>"u")return;let te=a(Te=>{let ze=Te.detail;ze?.groupId!==S||ze?.ownerId===G||(U(false),O(je=>(je&&s?.(false),false)));},"handleOverlayOpen");return window.addEventListener(fb,te),()=>window.removeEventListener(fb,te)},[s,S,G]),ho.useEffect(()=>{(Ke||!be)&&U(false);},[be,Ke]),ho.useEffect(()=>{if(ce||!He){O(false);return}fe("details"),oe("details"),O(true);},[He,ce,fe,oe]);let xe=ho.useCallback((te,Te)=>{q4(C,{sidebar:te,details:Te});},[C]),Ve=ho.useCallback((te,Te)=>{if(te==="sidebar"){let je=rp(Te,c,Q);return Z(je),R?.(je),je}let ze=rp(Te,u,ge);return ee(ze),M?.(ze),ze},[u,M,R,ge,Q,c]),_e=ho.useCallback((te,Te)=>{if(!T||Te.button!==0)return;Te.preventDefault();let ze=Te.clientX,je=te==="sidebar"?re:ae,it=je,Y=document.body.style.cursor,pe=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Be=a(Ce=>{let Xe=Ce.clientX-ze;it=Ve(te,je+(te==="sidebar"?Xe:-Xe));},"handleMove"),rt=a(()=>{document.body.style.cursor=Y,document.body.style.userSelect=pe,window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",rt),xe(te==="sidebar"?it:re,te==="details"?it:ae);},"handleUp");window.addEventListener("pointermove",Be),window.addEventListener("pointerup",rt,{once:true});},[ae,xe,T,re,Ve]),Ge=ho.useCallback((te,Te)=>{let je=Ve(te,(te==="sidebar"?re:ae)+Te*16);xe(te==="sidebar"?je:re,te==="details"?je:ae);},[ae,xe,re,Ve]),le={"--agent-workbench-sidebar-width":Ke?j0(we):"0px","--agent-workbench-details-width":ce?j0(Ie):"0px",gridTemplateColumns:Ke&&ce?"var(--agent-workbench-sidebar-width) minmax(0, 1fr) var(--agent-workbench-details-width)":Ke?"var(--agent-workbench-sidebar-width) minmax(0, 1fr)":ce?"minmax(0, 1fr) var(--agent-workbench-details-width)":"minmax(0, 1fr)",...P},Me=be&&We,Ae=be&&!K&&!We,J=He&&!ce,$e=b&&h&&(Me||Ae||J),ue=me==="mobile",Re=ue?"size-11":"size-9",se=ue?"[&>button]:flex [&>button]:size-11 [&>button]:items-center [&>button]:justify-center":"";return jsxRuntime.jsxs("div",{...W,ref:A,role:W.role??"region","aria-label":W["aria-label"]??"Agent workbench","data-agent-workbench-shell":"true","data-agent-workbench-variant":H.variant,"data-agent-workbench-density":H.density,"data-agent-workbench-layout":me,"data-agent-workbench-low-height":ie?"true":"false","data-sidebar-open":be?"true":"false","data-sidebar-expanded":K?"true":"false","data-sidebar-presentation":Ke?"inline":Me?"overlay":"hidden","data-details-open":He?"true":"false","data-details-presentation":ce?"inline":J?"overlay":"hidden",className:De("relative grid size-full min-h-0 min-w-0 overflow-hidden bg-background text-foreground",E?.root,D),style:le,children:[Ke?jsxRuntime.jsx("div",{"data-agent-workbench-region":"sidebar",className:De("min-h-0 min-w-0 overflow-hidden border-r border-border bg-card text-card-foreground",E?.sidebar),children:e}):null,jsxRuntime.jsxs("div",{"data-agent-workbench-region":"main",className:De("flex min-h-0 min-w-0 flex-col overflow-hidden bg-background",E?.main),children:[$e?jsxRuntime.jsxs("div",{"data-agent-workbench-responsive-controls":"true",className:De("flex min-h-11 shrink-0 items-center gap-1 border-b border-border bg-background px-2",ie&&"min-h-10",E?.controls),children:[Me||Ae?jsxRuntime.jsx("button",{type:"button",className:De("inline-flex items-center justify-center rounded-[var(--radius)] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",Re),"aria-label":I?.openSidebar??"Open navigation","aria-expanded":Ae?K:q,onClick:te=>{if(Ae){ne(true);return}fe("sidebar",te.currentTarget),oe("sidebar"),U(true);},children:jsxRuntime.jsx(lucideReact.PanelLeft,{className:"size-5","aria-hidden":"true"})}):null,J&&o?jsxRuntime.jsx("button",{type:"button",className:De("ml-auto inline-flex items-center justify-center rounded-[var(--radius)] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",Re),"aria-label":I?.openDetails??"Open details","aria-expanded":X,onClick:te=>{fe("details",te.currentTarget),oe("details"),O(true);},children:jsxRuntime.jsx(lucideReact.PanelRight,{className:"size-5","aria-hidden":"true"})}):null]}):null,jsxRuntime.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:t})]}),ce?jsxRuntime.jsx("div",{"data-agent-workbench-region":"details",className:De("min-h-0 min-w-0 overflow-hidden border-l border-border bg-card text-card-foreground",E?.details),children:o}):null,T&&Ke&&typeof l=="number"?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-label":I?.resizeSidebar??"Resize navigation","aria-valuemin":c,"aria-valuemax":Q,"aria-valuenow":Number(we),className:De("absolute inset-y-0 z-20 w-2 -translate-x-1/2 cursor-col-resize touch-none bg-transparent outline-hidden after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-border after:transition-colors hover:after:bg-primary focus-visible:after:w-0.5 focus-visible:after:bg-ring",E?.resizeHandle),style:{left:"var(--agent-workbench-sidebar-width)"},onPointerDown:te=>_e("sidebar",te),onKeyDown:te=>{te.key!=="ArrowLeft"&&te.key!=="ArrowRight"||(te.preventDefault(),Ge("sidebar",te.key==="ArrowRight"?1:-1));}}):null,T&&ce&&typeof d=="number"?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-label":I?.resizeDetails??"Resize details","aria-valuemin":u,"aria-valuemax":ge,"aria-valuenow":Number(Ie),className:De("absolute inset-y-0 right-[var(--agent-workbench-details-width)] z-20 w-2 translate-x-1/2 cursor-col-resize touch-none bg-transparent outline-hidden after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-border after:transition-colors hover:after:bg-primary focus-visible:after:w-0.5 focus-visible:after:bg-ring",E?.resizeHandle),onPointerDown:te=>_e("details",te),onKeyDown:te=>{te.key!=="ArrowLeft"&&te.key!=="ArrowRight"||(te.preventDefault(),Ge("details",te.key==="ArrowLeft"?1:-1));}}):null,Me?jsxRuntime.jsx(Cm,{open:q,onOpenChange:te=>{U(te),te||he("sidebar");},children:jsxRuntime.jsxs(Yd,{side:"left","aria-describedby":void 0,className:De("flex h-dvh flex-col gap-0 overflow-hidden bg-card p-0 text-card-foreground",ue?"inset-0 size-dvw !max-w-none border-0":"w-[min(360px,90vw)] !max-w-none",se,E?.sidebarOverlay),children:[jsxRuntime.jsx(Xd,{className:"sr-only",children:I?.sidebar??"Navigation"}),jsxRuntime.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e})]})}):null,J?jsxRuntime.jsx(Cm,{open:X,onOpenChange:te=>{O(te),te||(he("details"),s?.(false));},children:jsxRuntime.jsxs(Yd,{side:"right","aria-describedby":void 0,className:De("flex h-dvh flex-col gap-0 overflow-hidden bg-card p-0 text-card-foreground",ue?"inset-0 size-dvw !max-w-none border-0":"w-[min(520px,92vw)] !max-w-none",se,E?.detailsOverlay),children:[jsxRuntime.jsx(Xd,{className:"sr-only",children:I?.details??"Details"}),jsxRuntime.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o})]})}):null]})}a(K0,"AgentWorkbenchShell");var Y4="https://p1-hera.feishucdn.com/tos-cn-i-jbbdkfciu3/84a9f036fe2b44f99b899fff4beeb963~tplv-jbbdkfciu3-image:0:0.image",q0=a(({alt:e="feishu",width:t=16,height:o=16,style:r,...n})=>jsxRuntime.jsx("img",{src:Y4,alt:e,width:t,height:o,style:{display:"block",...r},...n}),"FeishuIcon"),Y0=a(({width:e=16,height:t=16,style:o,...r})=>jsxRuntime.jsxs("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",...o},...r,children:[jsxRuntime.jsx("path",{d:"M13.9 5.25c-4.45 0-8.05 2.84-8.05 6.35 0 1.89 1.06 3.6 2.72 4.76l-.45 2.01c-.1.45.38.8.78.57l2.42-1.38c.82.25 1.69.39 2.58.39 4.45 0 8.05-2.84 8.05-6.35s-3.6-6.35-8.05-6.35Z",fill:"#1683FF"}),jsxRuntime.jsx("path",{d:"M10.15 3.7c-4.5 0-8.15 2.86-8.15 6.4 0 1.78.94 3.39 2.45 4.55l-.36 1.88c-.08.43.36.75.75.55l2.18-1.15c.7.18 1.44.27 2.2.27 4.5 0 8.15-2.86 8.15-6.4s-3.65-6.1-7.22-6.1Z",fill:"#07C160"}),jsxRuntime.jsx("circle",{cx:"7.2",cy:"9.75",r:"1.05",fill:"#FFFFFF"}),jsxRuntime.jsx("circle",{cx:"11.1",cy:"9.75",r:"1.05",fill:"#FFFFFF"}),jsxRuntime.jsx("circle",{cx:"15.8",cy:"11.9",r:"0.95",fill:"#FFFFFF"}),jsxRuntime.jsx("circle",{cx:"19",cy:"11.9",r:"0.95",fill:"#FFFFFF"})]}),"WeWorkIcon"),X0=a(({className:e,width:t=16,height:o=16,style:r,...n})=>jsxRuntime.jsx("svg",{width:t,height:o,viewBox:"64 64 896 896",xmlns:"http://www.w3.org/2000/svg",className:e,style:{display:"block",...r},...n,children:jsxRuntime.jsx("path",{d:"M573.7 252.5C422.5 197.4 201.3 96.7 201.3 96.7c-15.7-4.1-17.9 11.1-17.9 11.1-5 61.1 33.6 160.5 53.6 182.8 19.9 22.3 319.1 113.7 319.1 113.7S326 357.9 270.5 341.9c-55.6-16-37.9 17.8-37.9 17.8 11.4 61.7 64.9 131.8 107.2 138.4 42.2 6.6 220.1 4 220.1 4s-35.5 4.1-93.2 11.9c-42.7 5.8-97 12.5-111.1 17.8-33.1 12.5 24 62.6 24 62.6 84.7 76.8 129.7 50.5 129.7 50.5 33.3-10.7 61.4-18.5 85.2-24.2L565 743.1h84.6L603 928l205.3-271.9H700.8l22.3-38.7c.3.5.4.8.4.8S799.8 496.1 829 433.8l.6-1h-.1c5-10.8 8.6-19.7 10-25.8 17-71.3-114.5-99.4-265.8-154.5z",fill:"#1683FF"})}),"DingtalkIcon"),Q0=a(({width:e=16,height:t=16,style:o,...r})=>jsxRuntime.jsxs("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",...o},...r,children:[jsxRuntime.jsx("path",{d:"M12 2.65 5.35 5.4v5.2c0 4.75 2.85 8.98 6.65 10.75 3.8-1.77 6.65-6 6.65-10.75V5.4L12 2.65Z",fill:"#2563EB"}),jsxRuntime.jsx("path",{d:"M12 4.65 7.15 6.62v4.02c0 3.5 2 6.72 4.85 8.28 2.85-1.56 4.85-4.78 4.85-8.28V6.62L12 4.65Z",fill:"#38BDF8"}),jsxRuntime.jsx("circle",{cx:"12",cy:"10.1",r:"2.15",fill:"#FFFFFF"}),jsxRuntime.jsx("path",{d:"M12 12.25v3.3",stroke:"#FFFFFF",strokeWidth:"1.8",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M12 15.05h2.2",stroke:"#FFFFFF",strokeWidth:"1.8",strokeLinecap:"round"})]}),"SSOIcon");var ez=["top","middle","bottom"],ss=a(e=>e?.trim()||void 0,"normalizeCssValue"),tz=a((e,t)=>{let o=ss(e),r=ss(t);return [o,r?`url(${JSON.stringify(r)})`:void 0].filter(Boolean).join(", ")},"createBackgroundImage"),oz=a(e=>e&&ez.includes(e)?e:"bottom","normalizeLogoPosition"),rz=a(e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0,"normalizeLogoScale"),nz=a(e=>{let t=ss(e?.url),o=ss(e?.lightUrl)||t,r=ss(e?.darkUrl)||t||o;return {lightUrl:o,darkUrl:r}},"resolveLogoUrls"),J0=a(e=>ss(e)?.toLowerCase().replace(/^oauth[-_:]/,"").replace(/[\s_]+/g,"-"),"normalizeProviderType"),az=a(e=>{switch(J0(e.providerType)??J0(e.id)){case "dingtalk":case "ding-talk":case "dingding":return jsxRuntime.jsx(X0,{"aria-hidden":"true"});case "feishu":case "lark":return jsxRuntime.jsx(q0,{alt:"","aria-hidden":"true"});case "wework":case "wecom":case "wechat-work":case "wechatwork":return jsxRuntime.jsx(Y0,{"aria-hidden":"true"});case "oidc":case "sso":case "saml":case "saml-sso":return jsxRuntime.jsx(Q0,{"aria-hidden":"true"});default:return null}},"getDefaultExternalMethodIcon");function eC({className:e,style:t,background:o,logo:r,toolbar:n,title:i,backAction:s,methods:l,activeMethodId:d,defaultMethodId:c,onMethodChange:p,externalLabel:u,externalMethods:g=[],externalPanel:f,callout:b}){let x=ho.useMemo(()=>l.filter(H=>!H.hidden),[l]),y=c??x[0]?.id,[k,w]=ho.useState(y),v=d??k,h=x.find(H=>H.id===v)??x[0],S=x.length>1,T=!f,C=tz(o?.gradient,o?.imageUrl),R=C?"custom":"default",M=oz(r?.position),I=rz(r?.scale),{lightUrl:B,darkUrl:N}=nz(r),D=!!(B||N),E=!!(B&&N&&B!==N);ho.useEffect(()=>{if(!x.length){w(void 0);return}(!v||!x.some(H=>H.id===v))&&w(y??x[0]?.id);},[x,v,y]);let P=a(H=>{d===void 0&&w(H),p?.(H);},"handleMethodChange"),W=a(H=>{let A=H.icon===void 0?az(H):H.icon,L=jsxRuntime.jsxs("button",{type:"button",className:"login-page__oauth-button","data-login-part":"external-button","data-login-method-id":H.id,onClick:H.onClick,disabled:H.disabled,children:[A?jsxRuntime.jsx("span",{className:"login-page__oauth-icon","data-login-part":"external-icon",children:A}):null,jsxRuntime.jsx("span",{children:H.label})]});return jsxRuntime.jsx(ho__namespace.default.Fragment,{children:H.render?H.render(L):L},H.id)},"renderExternalMethod");return jsxRuntime.jsxs("main",{className:["login-page",e].filter(Boolean).join(" "),"data-login-page":true,"data-login-part":"root","data-login-background":R,style:t,children:[jsxRuntime.jsx("div",{className:"login-page__background","data-login-part":"background","data-login-background":R,style:C?{backgroundImage:C}:void 0,"aria-hidden":"true"}),n?jsxRuntime.jsx("div",{className:"login-page__toolbar","data-login-part":"toolbar",children:n}):null,D?jsxRuntime.jsx("div",{className:`login-page__logo login-page__logo--${M}`,"data-login-part":"logo","data-logo-position":M,children:E?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("img",{className:"login-page__logo-image login-page__logo-image--light","data-login-part":"logo-image","data-login-logo-mode":"light",src:B,alt:r?.alt??"",style:I?{transform:`scale(${I})`}:void 0}),jsxRuntime.jsx("img",{className:"login-page__logo-image login-page__logo-image--dark","data-login-part":"logo-image","data-login-logo-mode":"dark",src:N,alt:r?.alt??"",style:I?{transform:`scale(${I})`}:void 0})]}):jsxRuntime.jsx("img",{className:"login-page__logo-image","data-login-part":"logo-image",src:B||N,alt:r?.alt??"",style:I?{transform:`scale(${I})`}:void 0})}):null,jsxRuntime.jsxs("section",{className:"login-page__form","data-login-part":"panel","aria-label":typeof i=="string"?i:void 0,children:[s?jsxRuntime.jsxs("button",{type:"button",className:"login-page__back","data-login-part":"back",onClick:s.onClick,children:[s.icon?jsxRuntime.jsx("span",{className:"login-page__back-icon","data-login-part":"back-icon",children:s.icon}):null,jsxRuntime.jsx("span",{children:s.label})]}):null,i?jsxRuntime.jsx("h1",{className:"login-page__title","data-login-part":"title",children:i}):null,T&&S?jsxRuntime.jsx("div",{className:"login-page__tabs","data-login-part":"tabs",role:"tablist",children:x.map(H=>{let A=H.id===h?.id;return jsxRuntime.jsxs("button",{type:"button",role:"tab","aria-selected":A,className:`login-page__tab ${A?"login-page__tab--active":""}`,"data-login-part":"tab","data-login-method-id":H.id,"data-active":A?"true":"false",onClick:()=>P(H.id),children:[H.icon?jsxRuntime.jsx("span",{className:"login-page__tab-icon","data-login-part":"tab-icon",children:H.icon}):null,jsxRuntime.jsx("span",{className:"login-page__tab-label",children:H.label})]},H.id)})}):null,f?jsxRuntime.jsxs("div",{className:"login-page__external-panel","data-login-part":"external-panel",children:[f.title?jsxRuntime.jsx("div",{className:"login-page__external-panel-title","data-login-part":"external-panel-title",children:f.title}):null,f.description?jsxRuntime.jsx("p",{className:"login-page__external-panel-description","data-login-part":"external-panel-description",children:f.description}):null,jsxRuntime.jsx("div",{className:"login-page__external-panel-content","data-login-part":"external-panel-content",children:f.content}),f.footer||f.backAction?jsxRuntime.jsxs("div",{className:"login-page__external-panel-footer","data-login-part":"external-panel-footer",children:[f.footer,f.backAction?jsxRuntime.jsx("button",{type:"button",className:"login-page__external-panel-back","data-login-part":"external-panel-back",onClick:f.backAction.onClick,children:f.backAction.label}):null]}):null]}):T&&h?jsxRuntime.jsxs("form",{className:"login-page__form-fields","data-login-part":"form","data-login-method-id":h.id,onSubmit:h.onSubmit,children:[h.fields.map(H=>jsxRuntime.jsx("div",{className:"login-page__field","data-login-part":"field","data-login-field-name":H.name,children:jsxRuntime.jsx("input",{id:H.id,name:H.name,type:H.type??"text",value:H.value,placeholder:H.placeholder,autoComplete:H.autoComplete,inputMode:H.inputMode,maxLength:H.maxLength,pattern:H.pattern,disabled:h.disabled||h.isLoading||H.disabled,required:H.required,className:"login-page__input","data-login-part":"input",onChange:A=>H.onChange(A.target.value)})},H.name)),h.checkbox?jsxRuntime.jsxs("label",{className:"login-page__remember","data-login-part":"checkbox-label",htmlFor:h.checkbox.id,children:[jsxRuntime.jsx("input",{id:h.checkbox.id,type:"checkbox",className:"login-page__checkbox","data-login-part":"checkbox",checked:h.checkbox.checked,disabled:h.disabled||h.isLoading||h.checkbox.disabled,onChange:H=>h.checkbox?.onChange(H.target.checked)}),jsxRuntime.jsx("span",{children:h.checkbox.label})]}):null,h.footer||h.footerAction?jsxRuntime.jsxs("div",{className:"login-page__method-footer","data-login-part":"method-footer",children:[h.footer,h.footerAction?jsxRuntime.jsx("button",{type:"button",className:"login-page__method-footer-action","data-login-part":"method-footer-action","data-login-method-id":h.id,onClick:h.footerAction.onClick,disabled:h.disabled||h.isLoading||h.footerAction.disabled,children:h.footerAction.label}):null]}):null,jsxRuntime.jsx("button",{type:"submit",className:"login-page__submit","data-login-part":"submit-button",disabled:h.disabled||h.isLoading,children:h.isLoading&&h.loadingLabel?h.loadingLabel:h.submitLabel})]}):null,b?jsxRuntime.jsxs("div",{className:`login-page__callout login-page__callout--${b.tone??"info"}`,"data-login-part":"callout","data-tone":b.tone??"info",children:[jsxRuntime.jsx("div",{className:"login-page__callout-title","data-login-part":"callout-title",children:b.title}),b.description?jsxRuntime.jsx("p",{className:"login-page__callout-description","data-login-part":"callout-description",children:b.description}):null,b.detail?jsxRuntime.jsx("p",{className:"login-page__callout-detail","data-login-part":"callout-detail",children:b.detail}):null,b.action?jsxRuntime.jsx("button",{type:"button",className:"login-page__callout-action","data-login-part":"callout-action",onClick:b.action.onClick,disabled:b.action.disabled,children:b.action.label}):null]}):null,!f&&g.length?jsxRuntime.jsxs("div",{className:"login-page__oauth-section","data-login-part":"external-methods",children:[u?jsxRuntime.jsx("div",{className:"login-page__oauth-label","data-login-part":"external-label",children:u}):null,jsxRuntime.jsx("div",{className:"login-page__oauth-list","data-login-part":"external-list",children:g.map(W)})]}):null]})]})}a(eC,"LoginPage");var cz=5200,tC=1200,uz=[/^(please|select|enter|provide|write|choose|confirm|fill)\b/i,/^(请|请选择|请先|请输入|请填写|请确认|请留意)/],pz={toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"},ap=new Map;function mz(...e){return e.filter(Boolean).join(" ")}a(mz,"cn");function fz(e){return !e||typeof e!="object"||ho.isValidElement(e)?false:"title"in e||"description"in e||"variant"in e}a(fz,"isToastInput");function gb(e){return e==null||typeof e=="string"&&!e.trim()}a(gb,"isEmptyToastContent");function ip(e,t,o){let{description:r,...n}=o??{};return fz(e)?{...n,...e,variant:e.variant??t}:{...n,title:e,variant:t}}a(ip,"normalizeToastInput");function ls(e,t){return typeof e=="function"?e(t):e}a(ls,"resolveValue");function nC(e){let t=Date.now();for(let[r,n]of ap.entries())t-n>tC&&ap.delete(r);let o=ap.get(e);return o&&t-o<tC?false:(ap.set(e,t),true)}a(nC,"shouldEmitToast");function sp(e,t){return e?e(t,{defaultValue:t}):t}a(sp,"translateMessage");function lp(e,t,o){return e?.[o]??t[o]}a(lp,"getDefaultMessage");function Ml(e){let{title:t,description:o,duration:r,variant:n="info",...i}=e,s=gb(t)?o:t;if(gb(s))return;let l=!gb(o)&&o!==s?o:void 0,d={...i,description:l,duration:r??cz};switch(n){case "error":return sonner.toast.error(s,d);case "warning":return sonner.toast.warning(s,d);case "success":return sonner.toast.success(s,d);default:return sonner.toast(s,d)}}a(Ml,"emitToast");function hb(e,t=""){if(!e)return t;if(typeof e=="string")return e.trim()||t;if(e instanceof Error)return String(e.message||"").trim()||t;if(typeof e=="object"&&typeof e.message=="string"){let o=e.message.trim();if(o)return o}if(typeof e=="object"&&typeof e.title=="string"){let o=e.title.trim();if(o)return o}return t}a(hb,"extractToastMessage");function bz(e){let t=hb(e);return uz.some(o=>o.test(t))?"warning":"error"}a(bz,"resolveToastVariantForMessage");function yb({className:e,closeButton:t=true,position:o="bottom-right",richColors:r=true,toastOptions:n,useThemeClassNames:i=true,visibleToasts:s=10,...l}){return jsxRuntime.jsx(sonner.Toaster,{className:mz("pointer-events-auto toaster group",e),closeButton:t,position:o,richColors:r,toastOptions:{...n,classNames:i?{...pz,...n?.classNames}:n?.classNames},visibleToasts:s,...l})}a(yb,"MonkeysToaster");function aC({children:e,toasterProps:t}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e,jsxRuntime.jsx(yb,{...t})]})}a(aC,"MonkeysToastProvider");function gz(e,t={}){let o=ho.useRef(null),r=Ye().toast,n=t.translate;ho.useEffect(()=>{if(!e){o.current=null;return}let i=ls(t.variant,e)??"error",s=ls(t.title,e),l=ls(t.fallbackDescription,e),d=ls(t.description,e)??hb(e,l||""),c=sp(n,s||lp(t.messages,r,i==="warning"?"warningTitle":"errorTitle")),p=sp(n,d||lp(t.messages,r,i==="warning"?"defaultWarningDescription":"defaultErrorDescription")),u=ls(t.signature,e)||[i,c,p].join("|");o.current!==u&&(o.current=u,nC(u)&&xb.show({variant:i,title:c,description:p,duration:ls(t.duration,e)}));},[t.description,t.duration,t.fallbackDescription,t.messages,t.signature,t.title,t.variant,r,n,e]);}a(gz,"useToastOnValue");function hz(e,t={}){let o=ho.useRef(new Set),r=Ye().toast,n=t.translate,i=ho.useCallback((s,l,d)=>{let c=s.variant??"info",p=sp(n,s.title||lp(t.messages,r,c==="warning"?"warningTitle":"errorTitle")),u=sp(n,s.description||lp(t.messages,r,c==="warning"?"defaultWarningDescription":"defaultErrorDescription")),g=s.signature||[c,p,u,l].join("|");d.add(g),!(o.current.has(g)||!nC(g))&&xb.show({variant:c,title:p,description:u,duration:s.duration});},[r,t.messages,n]);ho.useEffect(()=>{let s=new Set;e.forEach((l,d)=>{l&&i(l,d,s);}),o.current=s;},[i,e]);}a(hz,"useToastFeed");var xb=Object.assign((e,t)=>sonner.toast(e,t),{show:Ml,error:a((e,t)=>Ml(ip(e,"error",t)),"error"),warning:a((e,t)=>Ml(ip(e,"warning",t)),"warning"),success:a((e,t)=>Ml(ip(e,"success",t)),"success"),info:a((e,t)=>Ml(ip(e,"info",t)),"info"),message:sonner.toast.message,promise:sonner.toast.promise,dismiss:sonner.toast.dismiss,loading:sonner.toast.loading,custom:sonner.toast.custom,getHistory:sonner.toast.getHistory,getToasts:sonner.toast.getToasts});function sC({handoff:e,targetPath:t=e.target.path,targetOrigin:o,children:r,onActivate:n,...i}){let s=o?.trim(),l=s?new URL(t,s).toString():t;return jsxRuntime.jsx("a",{...i,href:runtime.buildApplicationHandoffUrl(l,e),"data-monkeys-handoff-id":e.handoffId,"data-monkeys-handoff-source":e.source.product,"data-monkeys-handoff-target":e.target.product,onClick:d=>n?.(e,d),children:r})}a(sC,"ApplicationHandoffLink");var ga=a(e=>e?.id,"refIdentity"),Dl=a(e=>({"data-monkeys-node-id":e.nodeId,"data-monkeys-node-kind":e.kind,"data-monkeys-node-version":e.version,"data-monkeys-owner":e.ownerRepo,"data-monkeys-parent-node":e.parentNodeId,"data-monkeys-slot":e.slot,"data-monkeys-page-id":ga(e.pageRef),"data-monkeys-semantic-id":ga(e.semanticRef),"data-monkeys-data-context-id":ga(e.dataContextRef),"data-monkeys-capability-id":ga(e.capabilityRef),"data-monkeys-provider-id":ga(e.providerRef),"data-monkeys-state-id":ga(e.stateRef),"data-monkeys-frame-owner":e.surface.frameOwner,"data-monkeys-surface-tone":e.surface.tone,"data-monkeys-density":e.surface.density,"data-monkeys-scroll-owner":e.scroll.owner,"data-monkeys-scroll-axis":e.scroll.axis,"data-monkeys-scroll-restore-key":e.scroll.restoreKey,"data-monkeys-virtualization-boundary":e.scroll.virtualizationBoundary,"data-monkeys-activation-id":e.activation.activationId,"data-monkeys-activation-mode":e.activation.mode,"data-monkeys-mount-policy":e.lifecycle.mountPolicy,"data-monkeys-query-policy":e.lifecycle.queryPolicy,"data-monkeys-deep-link":e.lifecycle.deepLink,"data-monkeys-focus-return":e.lifecycle.focusReturn,"data-monkeys-layout-mode":e.layout.mode,"data-monkeys-responsive-rules":e.responsive.length,"data-monkeys-child-count":e.children.length,"data-monkeys-access-id":ga(e.accessRef),"data-monkeys-evidence-id":ga(e.evidenceRef),"data-monkeys-render-state":e.state}),"getRenderNodeDataAttributes"),vb=a(e=>`monkeys.render.scroll.${e}`,"sessionStorageKey"),kb={read(e){if(!(typeof window>"u"))try{let t=window.sessionStorage.getItem(vb(e));if(!t)return;let o=JSON.parse(t);return typeof o.x=="number"&&typeof o.y=="number"?{x:o.x,y:o.y}:void 0}catch{return}},write(e,t){if(!(typeof window>"u"))try{window.sessionStorage.setItem(vb(e),JSON.stringify(t));}catch{}},remove(e){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(vb(e));}catch{}}},pC=a((e,t)=>{if(t===void 0)return e.layout;let o=e.responsive.filter(r=>(r.minWidthPx===void 0||t>=r.minWidthPx)&&(r.maxWidthPx===void 0||t<=r.maxWidthPx));return o.length===0?e.layout:o[o.length-1].layout},"resolveRenderNodeLayout"),mC=a((e,t,o)=>{let r=o===void 0?[]:t.filter(n=>(n.minWidthPx===void 0||o>=n.minWidthPx)&&(n.maxWidthPx===void 0||o<=n.maxWidthPx)&&n.style);return r.length===0?e:r.reduce((n,i)=>({...n,...i.style}),{...e??{}})},"resolveRenderNodeResponsiveStyle"),Tz={contents:"contents",block:"block",flex:"flex",grid:"grid",absolute:"absolute"},Nz={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},Rz={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"},fC=a(e=>om(e),"tokenPathToCssVariable"),Mz=a(e=>e?Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="string"&&o.startsWith("$")?fC(o):o])):void 0,"resolveRenderNodeStyle"),Iz=a(e=>{if(e.gapTokenRef)return {gap:fC(`$${e.gapTokenRef.id}`)}},"resolveRenderNodeGap"),Dz=a(e=>m(Tz[e.mode],e.mode==="flex"&&(e.direction==="row"?"flex-row":"flex-col"),e.align&&Nz[e.align],e.justify&&Rz[e.justify]),"getRenderLayoutClassName"),wb=a((e,t,o)=>e.lifecycle.mountPolicy==="always"?true:e.lifecycle.mountPolicy==="when-visible"?o:t,"shouldMountNode"),Pz=a((e,t,o,r)=>e.lifecycle.queryPolicy==="always"?true:e.lifecycle.queryPolicy==="when-visible"?o:e.lifecycle.queryPolicy==="when-active"?t:r,"shouldQueryNode"),Cb=a((e,t)=>{let o=wb(e,t.active,t.visible);return {active:t.active,visible:t.visible,mounted:o||e.lifecycle.retainOnDeactivate&&t.previouslyMounted===true,queryEnabled:Pz(e,t.active,t.visible,t.manualQueryEnabled===true)}},"resolveRenderNodePolicyState"),dC=a((e,t,o,r,n)=>e.state==="loading"&&o!==void 0?o:e.state==="empty"&&r!==void 0?r:e.state==="error"&&n!==void 0?n:t,"resolveRenderNodeContent"),cC=a((e,t)=>{typeof e=="function"?e(t):e&&(e.current=t);},"assignRef"),up=ho.forwardRef(a(function({node:t,as:o="div",active:r=true,visible:n=r,manualQueryEnabled:i=false,asChild:s=false,unframed:l=false,children:d,loading:c,empty:p,error:u,elementRef:g,scrollRestoration:f=kb,onActivate:b,onManualQueryEnabledChange:x,onRuntimeStateChange:y,onScroll:k,className:w,hidden:v,role:h,"aria-live":S,"aria-atomic":T,...C},R){let M=Go(),I=s?reactSlot.Slot:o,B=ho.useRef(null),[N,D]=ho.useState(()=>typeof window>"u"?void 0:window.innerWidth),[E,P]=ho.useState(()=>wb(t,r,n)?t.nodeId:void 0),W=wb(t,r,n);ho.useEffect(()=>{if(t.responsive.length===0||typeof window>"u")return;let q=a(()=>D(window.innerWidth),"handleResize");return q(),window.addEventListener("resize",q,{passive:true}),()=>window.removeEventListener("resize",q)},[t.responsive.length]);let H=ho.useMemo(()=>pC(t,N),[t,N]),A=ho.useMemo(()=>mC(t.style,t.responsive,N),[t.responsive,t.style,N]);ho.useEffect(()=>{if(!r||!n||!t.lifecycle.deepLink||!["page","record"].includes(t.kind))return;let q=B.current;!q||q.style.display==="contents"||q.focus({preventScroll:true});},[r,t.kind,t.lifecycle.deepLink,t.nodeId,n]),ho.useEffect(()=>{W?P(t.nodeId):t.lifecycle.retainOnDeactivate||P(void 0);},[t.lifecycle.retainOnDeactivate,t.nodeId,W]);let L=ho.useMemo(()=>Cb(t,{active:r,visible:n,manualQueryEnabled:i,previouslyMounted:E===t.nodeId}),[r,i,E,t,n]),F=ho.useCallback(()=>{b?.(t.activation,t);},[t,b]),G=ho.useCallback(q=>{x?.(q,t);},[t,x]),$=ho.useMemo(()=>({...L,activate:F,setManualQueryEnabled:G}),[F,L,G]);ho.useEffect(()=>{y?.(L,t);},[t,y,L]);let _=ho.useCallback(q=>{B.current=q,cC(g,q),cC(R,q);},[g,R]),z=f===false?void 0:f,re=z!==void 0&&t.scroll.owner!=="provider"&&!t.scroll.virtualizationBoundary&&t.scroll.axis!=="none"&&t.scroll.restoreKey!==void 0,Z=ho.useCallback(()=>{let q=B.current;return q?{x:t.scroll.axis==="y"?0:q.scrollLeft,y:t.scroll.axis==="x"?0:q.scrollTop}:{x:0,y:0}},[t.scroll.axis]);if(ho.useEffect(()=>{if(!L.mounted||!re||!z)return;let q=t.scroll.restoreKey,U=B.current,X=z.read(q),O;if(U&&X){let K=a(()=>U.scrollTo({left:t.scroll.axis==="y"?U.scrollLeft:X.x,top:t.scroll.axis==="x"?U.scrollTop:X.y,behavior:"auto"}),"restore");typeof window<"u"&&typeof window.requestAnimationFrame=="function"?O=window.requestAnimationFrame(K):K();}return ()=>{O!==void 0&&typeof window<"u"&&window.cancelAnimationFrame(O),z.write(q,Z());}},[t.scroll.axis,t.scroll.restoreKey,L.mounted,Z,re,z]),!L.mounted)return null;let ae={...C,...Dl(t),ref:_,className:m((!l||H.mode!=="contents")&&Dz(H),w),style:{...H.mode==="grid"&&H.columns?{gridTemplateColumns:`repeat(${H.columns}, minmax(0, 1fr))`}:{},...M>0&&["flex","grid"].includes(H.mode)?{gap:"var(--monkeys-bento-gap, var(--global-spacing, 0.75rem))"}:{},...Iz(H),...Mz(A),...C.style},hidden:v||!L.visible||void 0,role:h??(t.state==="error"?"alert":t.state==="loading"||t.state==="empty"?"status":void 0),tabIndex:C.tabIndex??(t.lifecycle.deepLink&&["page","record"].includes(t.kind)?-1:void 0),"data-monkeys-active":L.active,"data-monkeys-mounted":L.mounted,"data-monkeys-query-enabled":L.queryEnabled,"aria-busy":t.state==="loading"||void 0,"aria-disabled":t.state==="disabled"||void 0,"aria-hidden":!L.visible||void 0,"aria-live":S??(t.state==="error"?"assertive":t.state==="loading"||t.state==="empty"?"polite":void 0),"aria-atomic":T??(t.state==="loading"||t.state==="empty"||t.state==="error"?true:void 0),onScroll:a(q=>{re&&z&&t.scroll.restoreKey&&z.write(t.scroll.restoreKey,Z()),k?.(q);},"onScroll")},ee=typeof d=="function"?d(l?{...$,elementProps:ae}:$):d;return l?jsxRuntime.jsx(jsxRuntime.Fragment,{children:dC(t,ee,c,p,u)}):jsxRuntime.jsx(I,{...ae,ref:_,children:dC(t,ee,c,p,u)})},"RenderNodeHost"));var Bz={popover:40,drawer:50,modal:60,fullscreen:70,system:80},Sb=a(e=>Bz[e],"getOverlayZIndex"),Lz={drawer:{content:"!items-stretch !justify-end !p-0",panel:"!h-dvh !max-h-none !w-full !max-w-[min(100vw,40rem)] !rounded-none !border-y-0 !border-r-0",body:"min-h-0 flex-1 overflow-auto"},modal:{},fullscreen:{content:"!items-stretch !justify-stretch !p-0",panel:"!h-dvh !max-h-none !w-screen !max-w-none !rounded-none !border-0",body:"min-h-0 flex-1 overflow-auto"}},Tb=a(e=>({...Lz[e]}),"getOverlayPresentationClassNames"),Wz=a((e,t)=>e.startsWith("/")&&!e.startsWith("//")?`${t.pathname}${t.search}${t.hash}`:t.toString(),"relativeUrl"),Pl=a((e,t)=>new URL(t,"https://monkeys.local").searchParams.get(e.url.parameter)===e.url.value,"isOverlayUrlActive"),Nb=a((e,t,o)=>{let r=new URL(t,"https://monkeys.local");return o?r.searchParams.set(e.url.parameter,e.url.value):r.searchParams.get(e.url.parameter)===e.url.value&&r.searchParams.delete(e.url.parameter),Wz(t,r)},"buildOverlayUrl"),Rb={getCurrentUrl(){return typeof window>"u"?"https://monkeys.local/":window.location.href},push(e){typeof window<"u"&&window.history.pushState(window.history.state,"",e);},replace(e){typeof window<"u"&&window.history.replaceState(window.history.state,"",e);},back(){typeof window<"u"&&window.history.back();},subscribe(e){if(typeof window>"u")return ()=>{};let t=a(()=>e(window.location.href),"handlePopState");return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)}},zz=a(e=>{e?.isConnected&&(typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>e.focus()):e.focus());},"scheduleFocus");function xC({node:e,open:t,renderStrategy:o="dialog",title:r,description:n,footer:i,closeLabel:s,children:l,appearance:d,className:c,classNames:p,initialFocusRef:u,focusReturnRef:g,historyAdapter:f=Rb,manualQueryEnabled:b=false,onActivate:x,onRuntimeStateChange:y,onOpenChange:k}){let w=ho.useRef(false),v=ho.useRef(false),h=Sb(e.zIndexLane),S=ho.useCallback(I=>{if(!e.renderNode.lifecycle.deepLink||f===false)return;let B=f.getCurrentUrl();if(Pl(e,B)===I)return;let N=Nb(e,B,I);if(I){e.url.openMode==="push"?(f.push(N),w.current=true):(f.replace(N),w.current=false);return}e.url.closeMode==="back"&&w.current?(w.current=false,f.back()):(f.replace(N),w.current=false);},[f,e]),T=ho.useCallback(I=>{S(I),k(I);},[k,S]);ho.useEffect(()=>{if(!e.renderNode.lifecycle.deepLink||f===false)return;let I=Pl(e,f.getCurrentUrl());return v.current?I!==t&&S(t):(v.current=true,I&&!t?k(true):!I&&t&&S(true)),f.subscribe(B=>{w.current=false;let N=Pl(e,B);N!==t&&k(N);})},[f,e,k,t,S]),ho.useEffect(()=>{if(!t||!e.renderNode.lifecycle.focusReturn||typeof document>"u")return;let I=g?.current??(document.activeElement instanceof HTMLElement?document.activeElement:null);return ()=>zz(g?.current??I)},[g,e.renderNode.lifecycle.focusReturn,t]);let C=ho.useMemo(()=>Dl(e.renderNode),[e.renderNode]),R=Tb(e.presentation),M={...p,body:p?.body??R.body,content:p?.content??R.content,panel:p?.panel??R.panel};return jsxRuntime.jsx(up,{node:e.renderNode,active:t,visible:t,manualQueryEnabled:b,className:c,style:o==="delegate"?{display:"contents"}:void 0,onActivate:x,onRuntimeStateChange:y,children:I=>{let B={...I,open:t,zIndexLane:e.zIndexLane,zIndex:h,initialFocusRef:u,focusReturnRef:g,renderNodeAttributes:C,onOpenChange:T,requestClose:a(()=>T(false),"requestClose")},N=typeof l=="function"?l(B):l;return o==="delegate"?N:jsxRuntime.jsx(Ri,{id:e.overlayId,open:t,title:r,description:n,footer:i,closeLabel:s,closeOnEscape:e.close.escape,closeOnOverlayClick:e.close.backdrop,keepMounted:e.renderNode.lifecycle.retainOnDeactivate,trapFocus:e.focus.trap,restoreFocus:false,initialFocus:e.focus.initial,initialFocusRef:u,zIndex:h,appearance:d,classNames:M,"data-monkeys-overlay-presentation":e.presentation,"data-monkeys-overlay-z-index-lane":e.zIndexLane,onOpenChange:T,children:N})}})}a(xC,"OverlayNodeHost");function Mb(...e){return e.filter(Boolean).join(" ")}a(Mb,"cn");function Ib({className:e}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"4"}),jsxRuntime.jsx("path",{d:"M12 2v2"}),jsxRuntime.jsx("path",{d:"M12 20v2"}),jsxRuntime.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),jsxRuntime.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),jsxRuntime.jsx("path",{d:"M2 12h2"}),jsxRuntime.jsx("path",{d:"M20 12h2"}),jsxRuntime.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),jsxRuntime.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}a(Ib,"SunIcon");function Db({className:e}){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:jsxRuntime.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}a(Db,"MoonIcon");function Pb({className:e}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[jsxRuntime.jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),jsxRuntime.jsx("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),jsxRuntime.jsx("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})}a(Pb,"MonitorIcon");var Oz={light:Ib,dark:Db,auto:Pb};function vC({mode:e,onModeChange:t,labels:o={},tooltip:r,className:n}){let i=Co(),s=ke(),l=i.messages.toolbar.theme,d=Oz[e],c={auto:o.auto??l.auto,light:o.light??l.light,dark:o.dark??l.dark},p=[{value:"auto",label:c.auto,Icon:Pb},{value:"light",label:c.light,Icon:Ib},{value:"dark",label:c.dark,Icon:Db}],u=jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{...s,className:Mb("inline-flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] transition-colors focus-visible:outline-hidden",n),children:[jsxRuntime.jsx(d,{}),jsxRuntime.jsx("span",{className:"sr-only",children:r??l.toggle})]})});return jsxRuntime.jsxs(Bt__namespace.Root,{children:[r?jsxRuntime.jsx(mr__namespace.Provider,{delayDuration:300,children:jsxRuntime.jsxs(mr__namespace.Root,{children:[jsxRuntime.jsx(mr__namespace.Trigger,{asChild:true,children:u}),jsxRuntime.jsx(mr__namespace.Portal,{children:jsxRuntime.jsxs(mr__namespace.Content,{className:"rounded-md bg-[hsl(var(--popover))] px-3 py-1.5 text-xs text-[hsl(var(--popover-foreground))] shadow-md border border-[hsl(var(--border))] animate-in fade-in-0 zoom-in-95",sideOffset:5,children:[r,jsxRuntime.jsx(mr__namespace.Arrow,{className:"fill-[hsl(var(--popover))]"})]})})]})}):u,jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{className:"z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:5,align:"end",children:p.map(({value:g,label:f,Icon:b})=>jsxRuntime.jsxs(Bt__namespace.Item,{className:Mb("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",e===g&&"bg-[hsl(var(--accent))]"),onSelect:()=>t(g),children:[jsxRuntime.jsx(b,{className:"h-4 w-4"}),f]},g))})})]})}a(vC,"DarkModeSelector");function Fz({className:e}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[jsxRuntime.jsx("path",{d:"M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4"}),jsxRuntime.jsx("path",{d:"M12 2v2"}),jsxRuntime.jsx("path",{d:"M12 20v2"}),jsxRuntime.jsx("path",{d:"m4.9 4.9 1.4 1.4"}),jsxRuntime.jsx("path",{d:"m17.7 17.7 1.4 1.4"}),jsxRuntime.jsx("path",{d:"M2 12h2"}),jsxRuntime.jsx("path",{d:"M20 12h2"}),jsxRuntime.jsx("path",{d:"m6.3 17.7-1.4 1.4"}),jsxRuntime.jsx("path",{d:"m19.1 4.9-1.4 1.4"})]})}a(Fz,"SunMoonIcon");function wC({mode:e,onModeChange:t,label:o,labels:r={}}){let n=Co(),i=ke(),s=n.messages.toolbar.theme,l=n.provided?s:{label:"\u5916\u89C2",auto:"\u8DDF\u968F\u7CFB\u7EDF",light:"\u6D45\u8272\u6A21\u5F0F",dark:"\u6DF1\u8272\u6A21\u5F0F"},d={auto:r.auto??l.auto,light:r.light??l.light,dark:r.dark??l.dark},c=e==="auto"?d.auto:e==="dark"?d.dark:d.light,p=[{value:"auto",label:d.auto,Icon:Pb},{value:"light",label:d.light,Icon:Ib},{value:"dark",label:d.dark,Icon:Db}];return jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{...i,className:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))]",children:[jsxRuntime.jsx(Fz,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:o??l.label}),jsxRuntime.jsx("span",{className:"ml-auto text-xs text-[hsl(var(--muted-foreground))]",children:c})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{className:"z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:8,children:p.map(({value:u,label:g,Icon:f})=>jsxRuntime.jsxs(Bt__namespace.CheckboxItem,{checked:e===u,disabled:e===u,className:Mb("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 pl-7 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),onCheckedChange:()=>t(u),children:[jsxRuntime.jsx(Bt__namespace.ItemIndicator,{className:"absolute left-2 inline-flex items-center justify-center",children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6 9 17l-5-5"})})}),jsxRuntime.jsx(f,{className:"h-4 w-4"}),g]},u))})})]})}a(wC,"DarkModeSubMenu");function kC(...e){return e.filter(Boolean).join(" ")}a(kC,"cn");function Hz({className:e}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),jsxRuntime.jsx("path",{d:"M2 12h20"})]})}a(Hz,"GlobeIcon");function CC({languages:e,currentLanguage:t,onLanguageChange:o,tooltip:r,className:n}){let i=Co(),s=ke(),l=jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{...s,className:kC("inline-flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] transition-colors focus-visible:outline-hidden",n),children:[jsxRuntime.jsx(Hz,{}),jsxRuntime.jsx("span",{className:"sr-only",children:r??i.messages.toolbar.language.switch})]})});return jsxRuntime.jsxs(Bt__namespace.Root,{children:[r?jsxRuntime.jsx(mr__namespace.Provider,{delayDuration:300,children:jsxRuntime.jsxs(mr__namespace.Root,{children:[jsxRuntime.jsx(mr__namespace.Trigger,{asChild:true,children:l}),jsxRuntime.jsx(mr__namespace.Portal,{children:jsxRuntime.jsxs(mr__namespace.Content,{className:"rounded-md bg-[hsl(var(--popover))] px-3 py-1.5 text-xs text-[hsl(var(--popover-foreground))] shadow-md border border-[hsl(var(--border))] animate-in fade-in-0 zoom-in-95",sideOffset:5,children:[r,jsxRuntime.jsx(mr__namespace.Arrow,{className:"fill-[hsl(var(--popover))]"})]})})]})}):l,jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{className:"z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:5,align:"end",children:e.map(({code:d,label:c})=>jsxRuntime.jsx(Bt__namespace.Item,{className:kC("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",t===d&&"bg-[hsl(var(--accent))]"),onSelect:()=>o(d),children:c},d))})})]})}a(CC,"I18nSelector");var TC=zod.z.enum(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),SC=zod.z.enum(["core","star","potential","all"]),Eb={position:TC.default("bottom-left"),offsetX:zod.z.number().min(0).max(500).default(12),offsetY:zod.z.number().min(0).max(500).default(12)},Vz=zod.z.object({rendering:zod.z.object({mode:zod.z.enum(["canvas","hybrid"]).default("canvas")}).strict().prefault({}),guides:zod.z.array(zod.z.object({id:zod.z.string().min(1),label:zod.z.string(),description:zod.z.string().default(""),...Eb}).strict()).optional(),minimap:zod.z.object({...Eb,visible:zod.z.boolean().default(true),width:zod.z.number().min(100).max(500).default(168),height:zod.z.number().min(50).max(300).default(108),zoomControls:zod.z.boolean().default(true),avoidViewRail:zod.z.boolean().default(true),interactive:zod.z.boolean().default(true)}).strict().prefault({}),views:zod.z.object({...Eb,position:TC.default("bottom-center"),visible:zod.z.boolean().default(true),initial:SC.default("core"),items:zod.z.array(zod.z.object({id:SC,label:zod.z.string(),center:zod.z.object({x:zod.z.number().finite(),y:zod.z.number().finite()}).strict().optional(),zoomPercent:zod.z.number().min(10).max(1e3).optional()}).strict()).max(4).optional(),animated:zod.z.boolean().default(true)}).strict().prefault({}),interaction:zod.z.object({pan:zod.z.boolean().default(true),zoom:zod.z.boolean().default(true),wheel:zod.z.boolean().default(true),keyboard:zod.z.boolean().default(true),threshold:zod.z.boolean().default(true),openPoints:zod.z.boolean().default(true)}).strict().prefault({}),zoom:zod.z.object({min:zod.z.number().min(10).max(100).default(80),max:zod.z.number().min(100).max(1e3).default(200),step:zod.z.number().min(1).max(100).default(20)}).strict().prefault({}),hover:zod.z.object({enabled:zod.z.boolean().default(true),content:zod.z.enum(["radar","summary"]).default("radar"),delay:zod.z.number().min(0).max(5e3).default(0),trigger:zod.z.enum(["hover","focus","both"]).default("both"),scale:zod.z.number().min(1).max(2).default(1),highlight:zod.z.boolean().default(true)}).strict().prefault({}),appearance:zod.z.object({grid:zod.z.boolean().default(true),axes:zod.z.boolean().default(true),axisLabels:zod.z.boolean().default(true),thresholdHandle:zod.z.boolean().default(true),pointSize:zod.z.number().min(2).max(24).default(5),labelScale:zod.z.number().min(.5).max(2).default(1)}).strict().prefault({}),data:zod.z.object({mode:zod.z.enum(["representative","all"]).default("representative")}).strict().prefault({}),performance:zod.z.object({canvasThreshold:zod.z.number().int().min(100).max(1e3).default(300),maxDomLabels:zod.z.number().int().min(0).max(500).default(160),collisionAttempts:zod.z.number().int().min(1).max(2e4).default(4096)}).strict().prefault({})}).strict().superRefine((e,t)=>{for(let[o,r]of [["guides",e.guides],["views",e.views.items]])r&&new Set(r.map(n=>n.id)).size!==r.length&&t.addIssue({code:"custom",path:[o],message:"IDs must be unique"});});function Ab(e={}){return Vz.parse(e)}a(Ab,"resolveQuadrantConfig");var _z={guides:[],data:{mode:"all"},hover:{content:"summary"},views:{items:[{id:"core",label:"\u4E2D\u5FC3"},{id:"star",label:"\u53F3\u4E0A"},{id:"potential",label:"\u5DE6\u4E0A"},{id:"all",label:"\u5168\u89C8"}]}};function Ya(e){return {top:e.position.startsWith("top")?e.offsetY:"auto",bottom:e.position.startsWith("bottom")?e.offsetY:"auto",left:e.position.endsWith("left")?e.offsetX:e.position.endsWith("center")?"50%":"auto",right:e.position.endsWith("right")?e.offsetX:"auto",transform:e.position.endsWith("center")?"translateX(-50%)":void 0}}a(Ya,"quadrantDockStyle");var ro=a((e,t,o,r)=>Number.isFinite(e)?Math.min(r,Math.max(o,e)):t,"finite");function pp(e={}){return {layout:{mode:e.layout?.mode??"clustered",radius:ro(e.layout?.radius,18,1,1e3),depth:ro(e.layout?.depth,8,0,1e3),spacing:ro(e.layout?.spacing,1.8,.1,50),iterations:Math.round(ro(e.layout?.iterations,60,0,200)),linkStrength:ro(e.layout?.linkStrength,.035,0,.5)},camera:{fieldOfView:ro(e.camera?.fieldOfView,48,15,100),fitPadding:ro(e.camera?.fitPadding,1.2,1,3),rotateSpeed:ro(e.camera?.rotateSpeed,.5,.01,5),autoRotate:e.camera?.autoRotate??false,autoRotateSpeed:ro(e.camera?.autoRotateSpeed,.5,-10,10),enablePan:e.camera?.enablePan??true,enableZoom:e.camera?.enableZoom??true},nodes:{size:ro(e.nodes?.size,.8,.05,10),opacity:ro(e.nodes?.opacity,1,0,1),glow:e.nodes?.glow??true,defaultColor:e.nodes?.defaultColor,groupColors:e.nodes?.groupColors??{}},edges:{opacity:ro(e.edges?.opacity,.4,0,1),dimOpacity:ro(e.edges?.dimOpacity,.08,0,1),defaultColor:e.edges?.defaultColor},labels:{visible:e.labels?.visible??true,fontSize:ro(e.labels?.fontSize,12,8,32),maxVisible:Math.round(ro(e.labels?.maxVisible,100,0,1e3)),collisionPadding:ro(e.labels?.collisionPadding,6,0,50),color:e.labels?.color},controls:{visible:e.controls?.visible??true,placement:e.controls?.placement??"top-right",resetLabel:e.controls?.resetLabel,zoomInLabel:e.controls?.zoomInLabel,zoomOutLabel:e.controls?.zoomOutLabel},interaction:{enabled:e.interaction?.enabled??true,openOn:e.interaction?.openOn??"click",hitRadius:ro(e.interaction?.hitRadius,14,4,100)},minHeight:ro(e.minHeight,320,0,2e3),pixelRatioLimit:ro(e.pixelRatioLimit,2,.5,3)}}a(pp,"resolveRelationship3DConfig");var NC=a(e=>Array.from(e).reduce((t,o)=>Math.imul(t^o.charCodeAt(0),16777619)>>>0,2166136261),"hash"),ds=Math.PI*(3-Math.sqrt(5));function Bb(e,t,o={}){let{layout:r}=pp(o),n=new Set;for(let f of e){if(!f.id||n.has(f.id))throw new TypeError("3D graph node IDs must be nonempty and unique.");n.add(f.id);}let i=[...e].sort((f,b)=>f.id<b.id?-1:f.id>b.id?1:0),s=[...new Set(i.map(f=>f.group??""))].sort(),l=new Map,d=new Map(s.map(f=>[f,i.filter(b=>(b.group??"")===f).length])),c=i.map((f,b)=>{let x=f.group??"",y=l.get(x)??0;l.set(x,y+1);let k,w,v;if(r.mode==="provided"){if(!f.position||![f.position.x,f.position.y,f.position.z].every(Number.isFinite))throw new TypeError("Provided 3D layouts require finite x, y and z for every node.");({x:k,y:w,z:v}=f.position);}else if(r.mode==="sphere"){let h=1-2*(b+.5)/Math.max(i.length,1),S=Math.sqrt(1-h*h);k=Math.cos(b*ds)*S*r.radius,w=h*r.radius,v=Math.sin(b*ds)*S*r.depth;}else {let h=s.indexOf(x),S=h*ds-Math.PI/2,T=s.length>1?r.radius*.6:0,C=Math.sqrt(y)*r.spacing,R=NC(x)/4294967295*Math.PI*2;k=Math.cos(S)*T+Math.cos(y*ds+R)*C,w=Math.sin(S)*T*.8+Math.sin(y*ds+R)*C*.8,v=(s.length>1?(h/(s.length-1)-.5)*r.depth:0)+Math.sin(y*ds*1.37+R)*Math.min(r.depth*.4,Math.sqrt(d.get(x))*.7);}return {...f,x:k,y:w,z:v,anchorX:k,anchorY:w,anchorZ:v}}),p=new Map(c.map(f=>[f.id,f])),u=t.filter(f=>n.has(f.sourceId)&&n.has(f.targetId)&&f.sourceId!==f.targetId),g=new Map(c.map(f=>[f.id,new Set]));if(u.forEach(f=>{g.get(f.sourceId).add(f.targetId),g.get(f.targetId).add(f.sourceId);}),r.mode==="clustered")for(let f=0;f<r.iterations;f++){for(let y of u){let k=p.get(y.sourceId),w=p.get(y.targetId),v=r.linkStrength*((k.group??"")===(w.group??"")?1:.12)*ro(y.weight,.5,0,1);for(let h of ["x","y","z"]){let S=(w[h]-k[h])*v;k[h]+=S,w[h]-=S;}}let b=new Map,x=r.spacing;for(let y of c){y.x+=(y.anchorX-y.x)*.1,y.y+=(y.anchorY-y.y)*.1,y.z+=(y.anchorZ-y.z)*.1;let k=Math.floor(y.x/x),w=Math.floor(y.y/x),v=Math.floor(y.z/x);for(let T=-1;T<=1;T++)for(let C=-1;C<=1;C++)for(let R=-1;R<=1;R++)for(let M of b.get(`${k+T},${w+C},${v+R}`)??[]){let I=y.x-M.x,B=y.y-M.y,N=y.z-M.z,D=Math.hypot(I,B,N);if(D>=x)continue;let E=(x-D)*.22/Math.max(D,.001),P=NC(y.id+M.id)/4294967295*Math.PI*2,W=D?I:Math.cos(P)*.001,H=D?B:Math.sin(P)*.001,A=D?N:.001;y.x+=W*E,y.y+=H*E,y.z+=A*E,M.x-=W*E,M.y-=H*E,M.z-=A*E;}let h=`${k},${w},${v}`,S=b.get(h)??[];S.push(y),b.set(h,S);}}return {points:c,links:u,neighbors:g}}a(Bb,"buildRelationship3DLayout");function Uz({nodes:e,edges:t,ariaLabel:o,config:r,selectedNodeId:n,onNodeSelect:i,onUnavailable:s,className:l,emptyLabel:d="No related nodes"}){let c=Ye(),p=ho.useRef(null),u=ho.useRef(new Map),g=ho.useRef({onNodeSelect:i,onUnavailable:s,selectedNodeId:n,nodes:e});g.current={onNodeSelect:i,onUnavailable:s,selectedNodeId:n,nodes:e};let f=ho.useRef({reset:a(()=>{},"reset"),zoomIn:a(()=>{},"zoomIn"),zoomOut:a(()=>{},"zoomOut"),invalidate:a(()=>{},"invalidate")}),[b,x]=ho.useState(false),[y,k]=ho.useState(0),w=JSON.stringify([e,t,r]),v=ho.useMemo(()=>Bb(e,t,r),[w]),h=ho.useMemo(()=>pp(r),[w]);ho.useEffect(()=>{f.current.invalidate();},[n]),ho.useEffect(()=>{let T=a(()=>{let M=p.current&&getComputedStyle(p.current);return ["--radar-canvas","--background","--radar-series-one","--primary"].map(I=>M?.getPropertyValue(I)).join("|")},"signature"),C=T(),R=new MutationObserver(()=>{let M=T();M!==C&&(C=M,k(I=>I+1));});for(let M=p.current?.parentElement;M;M=M.parentElement)R.observe(M,{attributes:true,attributeFilter:["class","style","data-theme"]});return ()=>R.disconnect()},[]),ho.useEffect(()=>{let T=p.current;if(!T||!v.points.length)return;let C=false,R=[],M=a(()=>{for(;R.length;)R.pop()();},"release");x(false);let I=a(()=>{M(),C||(x(true),g.current.onUnavailable?.("webgl-unavailable"));},"fail");return Promise.all([import('three'),import('three/examples/jsm/controls/OrbitControls.js')]).then(([B,{OrbitControls:N}])=>{if(C)return;let D=new B.WebGLRenderer({antialias:true});R.push(()=>{D.dispose(),D.forceContextLoss(),D.domElement.remove();}),D.setPixelRatio(Math.min(window.devicePixelRatio||1,h.pixelRatioLimit)),D.domElement.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none",D.domElement.setAttribute("aria-hidden","true"),T.prepend(D.domElement);let E=new B.Scene,P=getComputedStyle(T),W=a((ue,Re)=>{let se=document.createElement("span");se.style.color=`hsl(${P.getPropertyValue(ue).trim()||P.getPropertyValue(Re).trim()})`,T.append(se);let te=new B.Color(getComputedStyle(se).color);return se.remove(),te},"token");E.background=W("--radar-canvas","--background");let H=h.nodes.defaultColor?new B.Color(h.nodes.defaultColor):W("--radar-series-one","--primary"),A=new Map(v.points.map(ue=>[ue.id,new B.Color(ue.color??h.nodes.groupColors[ue.group??""]??H)])),L=new Map(v.points.map(ue=>[ue.id,new B.Vector3(ue.x,ue.y,ue.z)])),F=new B.PerspectiveCamera(h.camera.fieldOfView,1,.01,1e5),G=new N(F,D.domElement);R.push(()=>G.dispose()),G.enableDamping=true,G.dampingFactor=.1,G.rotateSpeed=h.camera.rotateSpeed,G.enablePan=h.camera.enablePan,G.enableZoom=h.camera.enableZoom;let $=window.matchMedia?.("(prefers-reduced-motion: reduce)"),_=a(()=>{G.autoRotate=h.camera.autoRotate&&!$?.matches,we();},"motionChange");G.autoRotate=h.camera.autoRotate&&!$?.matches,G.autoRotateSpeed=h.camera.autoRotateSpeed,$?.addEventListener("change",_),R.push(()=>$?.removeEventListener("change",_));let z=64,re=new Uint8Array(z*z*4);for(let ue=0;ue<z;ue++)for(let Re=0;Re<z;Re++){let se=Math.hypot(Re+.5-z/2,ue+.5-z/2)/(z/2),te=h.nodes.glow?se<.1?1:Math.exp(-se*7.5):se<.45?1:0;re.set([255,255,255,Math.round(te*255)],(ue*z+Re)*4);}let Z=new B.DataTexture(re,z,z,B.RGBAFormat);Z.minFilter=Z.magFilter=B.LinearFilter,Z.needsUpdate=true,R.push(()=>Z.dispose());let ae=v.points.map(ue=>{let Re=new B.SpriteMaterial({map:Z,color:A.get(ue.id),transparent:true,depthWrite:false,blending:h.nodes.glow?B.AdditiveBlending:B.NormalBlending});R.push(()=>Re.dispose());let se=new B.Sprite(Re);return se.position.copy(L.get(ue.id)),E.add(se),se}),ee=new B.BufferGeometry;R.push(()=>ee.dispose()),ee.setAttribute("position",new B.Float32BufferAttribute(v.links.flatMap(ue=>[...L.get(ue.sourceId).toArray(),...L.get(ue.targetId).toArray()]),3));let q=new Float32Array(v.links.length*6);ee.setAttribute("color",new B.BufferAttribute(q,3));let U=new B.LineBasicMaterial({vertexColors:true,transparent:true,opacity:h.edges.opacity,depthWrite:false});R.push(()=>U.dispose()),E.add(new B.LineSegments(ee,U));let X=new B.Box3().setFromPoints([...L.values()]),O=X.getCenter(new B.Vector3),K=X.getSize(new B.Vector3),ne=Math.max(K.length()/2,1),fe=0,he=0,me=false,ie=0,be,He,We,Ke=false,ce=new B.Vector3,Q=[...v.points].sort((ue,Re)=>(v.neighbors.get(Re.id)?.size??0)-(v.neighbors.get(ue.id)?.size??0)),ge=a(()=>{let ue=B.MathUtils.degToRad(F.fov/2),Re=ne*h.camera.fitPadding/Math.sin(Math.atan(Math.tan(ue)*Math.min(F.aspect,1)));G.target.copy(O),F.position.copy(O).add(new B.Vector3(0,0,Re)),F.near=Math.max(Re/1e4,.01),F.far=Math.max(Re*100,1e3),G.minDistance=Math.max(ne*.15,.1),G.maxDistance=Re*8,F.updateProjectionMatrix(),G.update(),we();},"fit");function we(){!C&&!ie&&(ie=requestAnimationFrame(Ie));}a(we,"invalidate");function Ie(){if(ie=0,C||!fe||!he||document.hidden)return;G.update(),F.updateMatrixWorld();let ue=g.current.selectedNodeId,Re=be??ue,se=Re?v.neighbors.get(Re):void 0;(!Ke||We!==Re)&&(We=Re,Ke=true,v.links.forEach((je,it)=>{let Y=!Re||je.sourceId===Re||je.targetId===Re,pe=new B.Color(je.color??h.edges.defaultColor??A.get(je.targetId)).multiplyScalar(Y?1:h.edges.dimOpacity);q.set([...pe.toArray(),...pe.toArray()],it*6);}),ee.attributes.color.needsUpdate=true),ae.forEach((je,it)=>{let Y=v.points[it],pe=Re===Y.id;je.scale.setScalar((Y.size&&Number.isFinite(Y.size)?Math.min(10,Math.max(.05,Y.size)):h.nodes.size)*(pe?1.5:1)),je.material.opacity=h.nodes.opacity*(!Re||pe||se?.has(Y.id)?1:.3);});let te=new Map,Te=Re?[...Q.filter(je=>je.id===Re),...Q.filter(je=>je.id!==Re)]:Q,ze=0;for(let je of Te){let it=u.current.get(je.id);if(!it)continue;ce.copy(L.get(je.id)).project(F);let Y=(ce.x+1)*fe/2,pe=(-ce.y+1)*he/2+8,Be=Math.min(180,Math.max(h.labels.fontSize*je.label.length*.7,h.labels.fontSize*2)),rt=h.labels.fontSize+8,Ce={x:Y-Be/2,y:pe,w:Be,h:rt},Xe=[];for(let qe=Math.floor(Ce.x/64);qe<=Math.floor((Ce.x+Be+h.labels.collisionPadding)/64);qe++)for(let Le=Math.floor(pe/32);Le<=Math.floor((pe+rt+h.labels.collisionPadding)/32);Le++)Xe.push(`${qe},${Le}`);let de=Xe.some(qe=>te.get(qe)?.some(Le=>Ce.x<Le.x+Le.w+h.labels.collisionPadding&&Ce.x+Be+h.labels.collisionPadding>Le.x&&pe<Le.y+Le.h+h.labels.collisionPadding&&pe+rt+h.labels.collisionPadding>Le.y)),Ee=h.labels.visible&&ze<h.labels.maxVisible&&ce.z>-1&&ce.z<1&&Ce.x>0&&Ce.x+Be<fe&&pe>0&&pe+rt<he&&(!de||je.id===Re);if(it.style.display=Ee?"block":"none",it.tabIndex=Ee&&h.interaction.enabled?0:-1,Ee){it.style.transform=`translate(${Y}px,${pe}px) translate(-50%,0)`,it.style.color=h.labels.color??"#"+A.get(je.id).getHexString(),it.style.opacity=!Re||je.id===Re||se?.has(je.id)?"1":"0.4";for(let qe of Xe){let Le=te.get(qe)??[];Le.push(Ce),te.set(qe,Le);}ze++;}}D.render(E,F),G.autoRotate&&we();}a(Ie,"draw"),G.addEventListener("change",we),R.push(()=>{G.removeEventListener("change",we),cancelAnimationFrame(ie);}),f.current={reset:ge,zoomIn:a(()=>{F.position.sub(G.target).multiplyScalar(.8).add(G.target),G.update(),we();},"zoomIn"),zoomOut:a(()=>{F.position.sub(G.target).multiplyScalar(1.25).add(G.target),G.update(),we();},"zoomOut"),invalidate:we},R.push(()=>{f.current={reset:a(()=>{},"reset"),zoomIn:a(()=>{},"zoomIn"),zoomOut:a(()=>{},"zoomOut"),invalidate:a(()=>{},"invalidate")};});let oe=new ResizeObserver(()=>{let ue=T.getBoundingClientRect();fe=ue.width,he=ue.height,!(!fe||!he)&&(F.aspect=fe/he,F.updateProjectionMatrix(),D.setSize(fe,he,false),me?we():(me=true,ge()));});oe.observe(T),R.push(()=>oe.disconnect());let xe=a(ue=>{let Re=D.domElement.getBoundingClientRect(),se,te=h.interaction.hitRadius;for(let Te of v.points){if(ce.copy(L.get(Te.id)).project(F),ce.z<-1||ce.z>1)continue;let ze=Math.hypot((ce.x+1)*fe/2-(ue.clientX-Re.left),(-ce.y+1)*he/2-(ue.clientY-Re.top));ze<te&&(se=Te,te=ze);}return se?g.current.nodes.find(Te=>Te.id===se.id):void 0},"hit"),Ve=a(ue=>{He={x:ue.clientX,y:ue.clientY,pointerId:ue.pointerId};},"onDown"),_e=a(ue=>{be=xe(ue)?.id,D.domElement.style.cursor=be&&h.interaction.enabled?"pointer":"grab",we();},"onMove"),Ge=a(()=>{be=void 0,He=void 0,we();},"onLeave"),le=a(ue=>{let Re=He?.pointerId===ue.pointerId&&Math.hypot(ue.clientX-He.x,ue.clientY-He.y)<5;if(He=void 0,Re&&h.interaction.enabled&&h.interaction.openOn==="click"){let se=xe(ue);se&&g.current.onNodeSelect?.(se);}},"onUp"),Me=a(ue=>{if(h.interaction.enabled&&h.interaction.openOn==="double-click"){let Re=xe(ue);Re&&g.current.onNodeSelect?.(Re);}},"onDouble"),Ae=a(ue=>{ue.preventDefault(),I();},"contextLost"),J=a(()=>{document.hidden||we();},"visibility"),$e={pointerdown:Ve,pointermove:_e,pointerup:le,pointerleave:Ge,pointercancel:Ge,dblclick:Me,webglcontextlost:Ae};for(let[ue,Re]of Object.entries($e))D.domElement.addEventListener(ue,Re);document.addEventListener("visibilitychange",J),R.push(()=>{for(let[ue,Re]of Object.entries($e))D.domElement.removeEventListener(ue,Re);document.removeEventListener("visibilitychange",J);});}).catch(I),()=>{C=true,M();}},[v,h,y]);let S=h.controls.placement;return jsxRuntime.jsxs("div",{ref:p,role:"group","aria-label":o,className:l,"data-monkeys-component":"relationship-graph-3d","data-renderer-status":b?"unavailable":"webgl",style:{position:"relative",width:"100%",height:"100%",minHeight:h.minHeight,overflow:"hidden",background:"hsl(var(--radar-canvas, var(--background)))"},children:[e.map(T=>jsxRuntime.jsx("button",{ref:C=>{C?u.current.set(T.id,C):u.current.delete(T.id);},type:"button",disabled:!h.interaction.enabled,tabIndex:b&&h.interaction.enabled?0:-1,"aria-pressed":n===T.id,title:T.meta,onClick:()=>{h.interaction.enabled&&(b||h.interaction.openOn==="click")&&g.current.onNodeSelect?.(T);},onDoubleClick:()=>{h.interaction.enabled&&h.interaction.openOn==="double-click"&&g.current.onNodeSelect?.(T);},onKeyDown:C=>{h.interaction.enabled&&h.interaction.openOn==="double-click"&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),g.current.onNodeSelect?.(T));},className:"font-sans focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary",style:{display:b?"inline-block":"none",position:b?"relative":"absolute",transform:b?"none":void 0,opacity:b?1:void 0,color:b?"hsl(var(--foreground))":void 0,left:0,top:0,border:0,background:"transparent",padding:2,maxWidth:180,fontSize:h.labels.fontSize,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:h.interaction.enabled?"pointer":"default"},children:T.label},T.id)),!e.length&&jsxRuntime.jsx("div",{role:"status",className:"grid size-full place-items-center text-sm text-muted-foreground",children:d}),b&&jsxRuntime.jsx("div",{role:"alert",className:"relative p-3 text-foreground",children:c.workbench.collection.loadError}),!b&&h.controls.visible&&jsxRuntime.jsxs("div",{className:"absolute z-10 flex items-center gap-1 rounded-lg border border-border bg-background/90 p-1 text-foreground",style:{[S.startsWith("top")?"top":"bottom"]:12,[S.endsWith("left")?"left":"right"]:12},children:[h.camera.enableZoom&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:"rounded p-1.5 hover:bg-muted","aria-label":h.controls.zoomOutLabel??"Zoom out",title:h.controls.zoomOutLabel??"Zoom out",onClick:()=>f.current.zoomOut(),children:jsxRuntime.jsx(lucideReact.Minus,{size:14})}),jsxRuntime.jsx("button",{type:"button",className:"rounded p-1.5 hover:bg-muted","aria-label":h.controls.zoomInLabel??"Zoom in",title:h.controls.zoomInLabel??"Zoom in",onClick:()=>f.current.zoomIn(),children:jsxRuntime.jsx(lucideReact.Plus,{size:14})})]}),jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded p-1.5 text-xs hover:bg-muted","aria-label":h.controls.resetLabel??"Reset view",onClick:()=>f.current.reset(),children:[jsxRuntime.jsx(lucideReact.LocateFixed,{size:14}),h.controls.resetLabel??"Reset view"]})]})]})}a(Uz,"RelationshipGraph3D");function Wb(e,{size:t=128,inner:o="rgba(255,255,255,1)",middle:r="rgba(255,255,255,.42)"}={}){let n=document.createElement("canvas");n.width=t,n.height=t;let i=n.getContext("2d");if(!i)throw new Error("Unable to initialize the glow texture canvas.");let s=t/2,l=i.createRadialGradient(s,s,0,s,s,s);l.addColorStop(0,o),l.addColorStop(.16,r),l.addColorStop(.48,"rgba(255,255,255,.12)"),l.addColorStop(1,"rgba(255,255,255,0)"),i.fillStyle=l,i.fillRect(0,0,t,t);let d=new e.CanvasTexture(n);return d.colorSpace=e.SRGBColorSpace,d}a(Wb,"createRadialTexture");var IC=`
|
|
67
67
|
attribute float aSize;
|
|
68
68
|
attribute float aAlpha;
|